

;-------------------------------------------------
; Forward Diagonal Fireball
;-------------------------------------------------
[Statedef 10200]
type = S
movetype= A
physics = S
poweradd = 0
ctrl = 0
anim = 200
velset = 0

[State 200, 1]
type = Playsnd
trigger1 = AnimElem = 1
value = S0,1

[State 200, 2]
type = velset
trigger1 = time >= 0
trigger1 = time <= 20
x = 0
y = 0

;This where you start taking the damage set by the helper in state 1007.
[State 0, LifeAdd]
type = LifeAdd
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
trigger1 = fvar(17) > 0
value = -floor(fvar(17))
ignorehitpause = 1

;Right after you take the damage, you IMMEDIATELY subtract the damage from fvar(10) by itself. If you want, this can also be a varset that sets it to 0.
[State 0, VarAdd]
type = VarAdd
trigger1 = var(3) > 0
trigger1 = 1
fv = 17
value = -floor(fvar(17))
ignorehitpause=  1

;This makes you invincible while the helper is out, but as the great prophets of Yu-Gi-Oh! Arc-V say: BUT YOU'LL STILL TAKE THE DAMAGE!
[State 0, NotHitBy]
type = NotHitBy
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT

[State 200, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 10201
ctrl = 0

; Fireball itself
[statedef 10201]
type = S
movetype = A
physics = S
anim = 201

;This where you start taking the damage set by the helper in state 1007.
[State 0, LifeAdd]
type = LifeAdd
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
trigger1 = fvar(17) > 0
value = -floor(fvar(17))
ignorehitpause = 1

;Right after you take the damage, you IMMEDIATELY subtract the damage from fvar(10) by itself. If you want, this can also be a varset that sets it to 0.
[State 0, VarAdd]
type = VarAdd
trigger1 = var(3) > 0
trigger1 = 1
fv = 17
value = -floor(fvar(17))
ignorehitpause=  1

;This makes you invincible while the helper is out, but as the great prophets of Yu-Gi-Oh! Arc-V say: BUT YOU'LL STILL TAKE THE DAMAGE!
[State 0, NotHitBy]
type = NotHitBy
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT

[State 201, 1]
type = Projectile
trigger1 = AnimElem = 1
projanim = 202
projheightbound = -240, 70
projscale = 3,3
offset = 17,-24
velocity = 5,0
attr = S, SP
damage = 50, 6
animtype = light
guardflag = MA
hitflag = MAF
pausetime = 5,5
;hitsound = s2,4
;guardsound = s2,3
guard.sparkno = 40
sparkno = 0                      
sparkxy = -10,0 
ground.type = Low
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -5,0
air.velocity = -5,0
air.juggle = 5
air.fall = 0
down.velocity = -4,-6
down.hittime = 10
down.bounce = 0

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

;-------------------------------------------------
; Forward Diagonal Fireball
;-------------------------------------------------
[Statedef 10205]
type = S
movetype= A
physics = S
poweradd = 0
ctrl = 0
anim = 200
velset = 0

[State 200, 1]
type = Playsnd
trigger1 = AnimElem = 1
value = S0,1

[State 200, 2]
type = velset
trigger1 = time >= 0
trigger1 = time <= 20
x = 0
y = 0

;This where you start taking the damage set by the helper in state 1007.
[State 0, LifeAdd]
type = LifeAdd
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
trigger1 = fvar(17) > 0
value = -floor(fvar(17))
ignorehitpause = 1

;Right after you take the damage, you IMMEDIATELY subtract the damage from fvar(10) by itself. If you want, this can also be a varset that sets it to 0.
[State 0, VarAdd]
type = VarAdd
trigger1 = var(3) > 0
trigger1 = 1
fv = 17
value = -floor(fvar(17))
ignorehitpause=  1

;This makes you invincible while the helper is out, but as the great prophets of Yu-Gi-Oh! Arc-V say: BUT YOU'LL STILL TAKE THE DAMAGE!
[State 0, NotHitBy]
type = NotHitBy
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT


[State 200, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 10206
ctrl = 0

; Fireball itself
[statedef 10206]
type = S
movetype = A
physics = S
anim = 201
Velset = 0,0

;This where you start taking the damage set by the helper in state 1007.
[State 0, LifeAdd]
type = LifeAdd
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
trigger1 = fvar(17) > 0
value = -floor(fvar(17))
ignorehitpause = 1

;Right after you take the damage, you IMMEDIATELY subtract the damage from fvar(10) by itself. If you want, this can also be a varset that sets it to 0.
[State 0, VarAdd]
type = VarAdd
trigger1 = var(3) > 0
trigger1 = 1
fv = 17
value = -floor(fvar(17))
ignorehitpause=  1

;This makes you invincible while the helper is out, but as the great prophets of Yu-Gi-Oh! Arc-V say: BUT YOU'LL STILL TAKE THE DAMAGE!
[State 0, NotHitBy]
type = NotHitBy
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT

[State 0, Helper]
type = Helper
trigger1 = AnimElem = 1
helpertype = normal ;player
name = "BallCrits"
ID = 207
stateno = 207
pos = 17,-24
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = 3
size.yscale = 3

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

; Fireball itself
[statedef 207]
type = S
movetype = A
physics = S
anim = 202

[State 0, VelSet]
type = VelSet
trigger1 = 1
x = 5
y = 0

[State 0, PalFX]
type = PalFX
trigger1 = 1
time = 1
add = 0,0,256
mul = 256,256,256
invertall = 0
color = 256

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = S,AA,AP,AT       
slot = 1
stateno = 9999
time = 1
forceair = 0

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,AA,AP,AT
time = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S9500,0
volume = 100
channel = -1
freqmul = 1.0
loop = 0
pan = 0
abspan = 1

[State 0, HitDef]
type = HitDef
trigger1 = time = 0
attr = S,SP
damage = 150, 0
animtype = hard
guardflag =
hitflag = MAF
pausetime = 0,0
;hitsound = s2,4
;guardsound = s2,3
sparkno = 2                    
sparkxy = -10,0 
hitsound = S9500, 1   
ground.type = Low
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -5,0
air.velocity = -5,0
air.juggle = 5
air.fall = 0
down.velocity = -4,-6
down.hittime = 10
down.bounce = 0

[State 0, Helper]
type = Helper
trigger1 = movehit = 1
helpertype = normal ;player
name = "CriticalHit"
ID = 9500
stateno = 9500
pos = -15,-30+floor(Enemy,Const(Size.Head.Pos.Y))
postype = p2    ;p2,front,back,left,right
facing = 0
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = 0.1 
size.yscale = 0.1
persistent = 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = movecontact
value = 9999

[State 0, ChangeState]
type = DestroySelf
trigger1 = movehit
trigger2 = moveguarded 
trigger3 = FrontEdgeDist <= -20
trigger4 = BackEdgeDist <= -20


;-------------------------------------------------
; Forward Up Horizontal Fireball
;-------------------------------------------------
[Statedef 10210]
type = S
movetype= A
physics = S
poweradd = 0
ctrl = 0
anim = 210
velset = 0

[State 230, 1]
type = Playsnd
trigger1 = AnimElem = 1
value = S0,1

[State 230, 2]
type = velset
trigger1 = time >= 0
trigger1 = time <= 20
x = 0
y = 0

;This where you start taking the damage set by the helper in state 1007.
[State 0, LifeAdd]
type = LifeAdd
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
trigger1 = fvar(17) > 0
value = -floor(fvar(17))
ignorehitpause = 1

;Right after you take the damage, you IMMEDIATELY subtract the damage from fvar(10) by itself. If you want, this can also be a varset that sets it to 0.
[State 0, VarAdd]
type = VarAdd
trigger1 = var(3) > 0
trigger1 = 1
fv = 17
value = -floor(fvar(17))
ignorehitpause=  1

;This makes you invincible while the helper is out, but as the great prophets of Yu-Gi-Oh! Arc-V say: BUT YOU'LL STILL TAKE THE DAMAGE!
[State 0, NotHitBy]
type = NotHitBy
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT

[State 0, ChangeState]
type = ChangeState
trigger1 = var(3) = 0
value = 0
ctrl = 1

[State 230, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 10211
ctrl = 0

; Fireball itself
[statedef 10211]
type = S
movetype = A
physics = S
anim = 211

;This where you start taking the damage set by the helper in state 1007.
[State 0, LifeAdd]
type = LifeAdd
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
trigger1 = fvar(17) > 0
value = -floor(fvar(17))
ignorehitpause = 1

;Right after you take the damage, you IMMEDIATELY subtract the damage from fvar(10) by itself. If you want, this can also be a varset that sets it to 0.
[State 0, VarAdd]
type = VarAdd
trigger1 = var(3) > 0
trigger1 = 1
fv = 17
value = -floor(fvar(17))
ignorehitpause=  1

;This makes you invincible while the helper is out, but as the great prophets of Yu-Gi-Oh! Arc-V say: BUT YOU'LL STILL TAKE THE DAMAGE!
[State 0, NotHitBy]
type = NotHitBy
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT

[State 0, ChangeState]
type = ChangeState
trigger1 = var(3) = 0
value = 0
ctrl = 1

[State 211, 1]
type = Projectile
trigger1 = AnimElem = 1
projanim = 212
projheightbound = -240, 70
projscale = 3,3
offset = 17,-24
velocity = 4,-1.5
attr = S, SP
damage = 50,6
animtype = light
guardflag = MA
hitflag = MAF
pausetime = 5,5
;hitsound = s2,4
;guardsound = s2,3
guard.sparkno = 40
sparkno = 0                      
sparkxy = -10,0 
ground.type = Low
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -4,-0.2
air.velocity = -4,-3
air.juggle = 5
air.fall = 0
down.velocity = -4,-3
down.hittime = 10
down.bounce = 0

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

;-------------------------------------------------
; Forward Up Diagonal Fireball
;-------------------------------------------------
[Statedef 10215]
type = S
movetype= A
physics = S
poweradd = 0
ctrl = 0
anim = 210
velset = 0

[State 200, 1]
type = Playsnd
trigger1 = AnimElem = 1
value = S0,1

[State 200, 2]
type = velset
trigger1 = time >= 0
trigger1 = time <= 20
x = 0
y = 0

;This where you start taking the damage set by the helper in state 1007.
[State 0, LifeAdd]
type = LifeAdd
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
trigger1 = fvar(17) > 0
value = -floor(fvar(17))
ignorehitpause = 1

;Right after you take the damage, you IMMEDIATELY subtract the damage from fvar(10) by itself. If you want, this can also be a varset that sets it to 0.
[State 0, VarAdd]
type = VarAdd
trigger1 = var(3) > 0
trigger1 = 1
fv = 17
value = -floor(fvar(17))
ignorehitpause=  1

;This makes you invincible while the helper is out, but as the great prophets of Yu-Gi-Oh! Arc-V say: BUT YOU'LL STILL TAKE THE DAMAGE!
[State 0, NotHitBy]
type = NotHitBy
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT

[State 200, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 10216
ctrl = 0

; Fireball itself
[statedef 10216]
type = S
movetype = A
physics = S
anim = 210
Velset = 0,0

;This where you start taking the damage set by the helper in state 1007.
[State 0, LifeAdd]
type = LifeAdd
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
trigger1 = fvar(17) > 0
value = -floor(fvar(17))
ignorehitpause = 1

;Right after you take the damage, you IMMEDIATELY subtract the damage from fvar(10) by itself. If you want, this can also be a varset that sets it to 0.
[State 0, VarAdd]
type = VarAdd
trigger1 = var(3) > 0
trigger1 = 1
fv = 17
value = -floor(fvar(17))
ignorehitpause=  1

;This makes you invincible while the helper is out, but as the great prophets of Yu-Gi-Oh! Arc-V say: BUT YOU'LL STILL TAKE THE DAMAGE!
[State 0, NotHitBy]
type = NotHitBy
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT

[State 0, Helper]
type = Helper
trigger1 = AnimElem = 1
helpertype = normal ;player
name = "BallCrits"
ID = 217
stateno = 217
pos = 17,-24
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = 3
size.yscale = 3

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

; Fireball itself
[statedef 217]
type = S
movetype = A
physics = S
anim = 212

[State 0, VelSet]
type = VelSet
trigger1 = 1
x = 4
y = -1.5

[State 0, PalFX]
type = PalFX
trigger1 = 1
time = 1
add = 0,0,256
mul = 256,256,256
invertall = 0
color = 256

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = S,AA,AP,AT       
slot = 1
stateno = 9999
time = 1
forceair = 0

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,AA,AP,AT
time = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S9500,0
volume = 100
channel = -1
freqmul = 1.0
loop = 0
pan = 0
abspan = 1

[State 0, HitDef]
type = HitDef
trigger1 = time = 0
attr = S,SP
damage = 150, 0
animtype = hard
guardflag =
hitflag = MAF
pausetime = 0,0
;hitsound = s2,4
;guardsound = s2,3
sparkno = 2                    
sparkxy = -10,0 
hitsound = S9500, 1   
ground.type = Low
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -4,-0.2
air.velocity = -4,-3
air.juggle = 5
air.fall = 0
down.velocity = -4,-3
down.hittime = 10
down.bounce = 0

[State 0, Helper]
type = Helper
trigger1 = movehit = 1
helpertype = normal ;player
name = "CriticalHit"
ID = 9500
stateno = 9500
pos = -15,-30+floor(Enemy,Const(Size.Head.Pos.Y))
postype = p2    ;p2,front,back,left,right
facing = 0
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = 0.1 
size.yscale = 0.1
persistent = 0

[State 0, ChangeState]
type = DestroySelf
trigger1 = movehit
trigger2 = moveguarded 
trigger3 = FrontEdgeDist <= -20
trigger4 = BackEdgeDist <= -20

;-------------------------------------------------
; Forward Up Diagonal Fireball
;-------------------------------------------------
[Statedef 10220]
type = S
movetype= A
physics = S
poweradd = 0
ctrl = 0
anim = 220
velset = 0

[State 230, 1]
type = Playsnd
trigger1 = AnimElem = 1
value = S0,1

[State 230, 2]
type = velset
trigger1 = time >= 0
trigger1 = time <= 20
x = 0
y = 0

;This where you start taking the damage set by the helper in state 1007.
[State 0, LifeAdd]
type = LifeAdd
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
trigger1 = fvar(17) > 0
value = -floor(fvar(17))
ignorehitpause = 1

;Right after you take the damage, you IMMEDIATELY subtract the damage from fvar(10) by itself. If you want, this can also be a varset that sets it to 0.
[State 0, VarAdd]
type = VarAdd
trigger1 = var(3) > 0
trigger1 = 1
fv = 17
value = -floor(fvar(17))
ignorehitpause=  1

;This makes you invincible while the helper is out, but as the great prophets of Yu-Gi-Oh! Arc-V say: BUT YOU'LL STILL TAKE THE DAMAGE!
[State 0, NotHitBy]
type = NotHitBy
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT


[State 230, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 10221
ctrl = 0

; Fireball itself
[statedef 10221]
type = S
movetype = A
physics = S
anim = 221

;This where you start taking the damage set by the helper in state 1007.
[State 0, LifeAdd]
type = LifeAdd
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
trigger1 = fvar(17) > 0
value = -floor(fvar(17))
ignorehitpause = 1

;Right after you take the damage, you IMMEDIATELY subtract the damage from fvar(10) by itself. If you want, this can also be a varset that sets it to 0.
[State 0, VarAdd]
type = VarAdd
trigger1 = var(3) > 0
trigger1 = 1
fv = 17
value = -floor(fvar(17))
ignorehitpause=  1

;This makes you invincible while the helper is out, but as the great prophets of Yu-Gi-Oh! Arc-V say: BUT YOU'LL STILL TAKE THE DAMAGE!
[State 0, NotHitBy]
type = NotHitBy
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT

[State 221, 1]
type = Projectile
trigger1 = AnimElem = 1
projanim = 222
projheightbound = -240, 70
projscale = 3,3
offset = 17,-24
velocity = 3,-3
attr = S, SP
damage = 50,6
animtype = light
guardflag = MA
hitflag = MAF
pausetime = 5,5
;hitsound = s2,4
;guardsound = s2,3
guard.sparkno = 40
sparkno = 0                      
sparkxy = -10,0 
ground.type = Low
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -3,-1
air.velocity = -3,-6
air.juggle = 5
air.fall = 0
down.velocity = -3,-7
down.hittime = 10
down.bounce = 0

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

;-------------------------------------------------
; Forward Up Diagonal Fireball
;-------------------------------------------------
[Statedef 10225]
type = S
movetype= A
physics = S
poweradd = 0
ctrl = 0
anim = 220
velset = 0

[State 200, 1]
type = Playsnd
trigger1 = AnimElem = 1
value = S0,1

[State 200, 2]
type = velset
trigger1 = time >= 0
trigger1 = time <= 20
x = 0
y = 0

;This where you start taking the damage set by the helper in state 1007.
[State 0, LifeAdd]
type = LifeAdd
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
trigger1 = fvar(17) > 0
value = -floor(fvar(17))
ignorehitpause = 1

;Right after you take the damage, you IMMEDIATELY subtract the damage from fvar(10) by itself. If you want, this can also be a varset that sets it to 0.
[State 0, VarAdd]
type = VarAdd
trigger1 = var(3) > 0
trigger1 = 1
fv = 17
value = -floor(fvar(17))
ignorehitpause=  1

;This makes you invincible while the helper is out, but as the great prophets of Yu-Gi-Oh! Arc-V say: BUT YOU'LL STILL TAKE THE DAMAGE!
[State 0, NotHitBy]
type = NotHitBy
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT

[State 200, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 10226
ctrl = 0

; Fireball itself
[statedef 10226]
type = S
movetype = A
physics = S
anim = 221
Velset = 0,0

;This where you start taking the damage set by the helper in state 1007.
[State 0, LifeAdd]
type = LifeAdd
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
trigger1 = fvar(17) > 0
value = -floor(fvar(17))
ignorehitpause = 1

;Right after you take the damage, you IMMEDIATELY subtract the damage from fvar(10) by itself. If you want, this can also be a varset that sets it to 0.
[State 0, VarAdd]
type = VarAdd
trigger1 = var(3) > 0
trigger1 = 1
fv = 17
value = -floor(fvar(17))
ignorehitpause=  1

;This makes you invincible while the helper is out, but as the great prophets of Yu-Gi-Oh! Arc-V say: BUT YOU'LL STILL TAKE THE DAMAGE!
[State 0, NotHitBy]
type = NotHitBy
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT

[State 0, Helper]
type = Helper
trigger1 = AnimElem = 1
helpertype = normal ;player
name = "BallCrits"
ID = 227
stateno = 227
pos = 17,-24
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = 3
size.yscale = 3

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

; Fireball itself
[statedef 227]
type = S
movetype = A
physics = S
anim = 222

[State 0, VelSet]
type = VelSet
trigger1 = 1
x = 3
y = -3

[State 0, PalFX]
type = PalFX
trigger1 = 1
time = 1
add = 0,0,256
mul = 256,256,256
invertall = 0
color = 256

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = S,AA,AP,AT       
slot = 1
stateno = 9999
time = 1
forceair = 0

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,AA,AP,AT
time = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S9500,0
volume = 100
channel = -1
freqmul = 1.0
loop = 0
pan = 0
abspan = 1

[State 0, HitDef]
type = HitDef
trigger1 = time = 0
attr = S,SP
damage = 150, 0
animtype = hard
guardflag =
hitflag = MAF
pausetime = 0,0
;hitsound = s2,4
;guardsound = s2,3
sparkno = 2                    
sparkxy = -10,0 
hitsound = S9500, 1   
ground.type = Low
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -3,-1
air.velocity = -3,-6
air.juggle = 5
air.fall = 0
down.velocity = -3,-7
down.hittime = 10
down.bounce = 0

[State 0, Helper]
type = Helper
trigger1 = movehit = 1
helpertype = normal ;player
name = "CriticalHit"
ID = 9500
stateno = 9500
pos = -15,-30+floor(Enemy,Const(Size.Head.Pos.Y))
postype = p2    ;p2,front,back,left,right
facing = 0
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = 0.1 
size.yscale = 0.1
persistent = 0

[State 0, ChangeState]
type = DestroySelf
trigger1 = movehit
trigger2 = moveguarded 
trigger3 = FrontEdgeDist <= -20
trigger4 = BackEdgeDist <= -20

;-------------------------------------------------
; Forward Diagonal Fireball
;-------------------------------------------------
[Statedef 10300]
type = S
movetype= A
physics = S
poweradd = 0
ctrl = 0
anim = 300
velset = 0

[State 200, 1]
type = Playsnd
trigger1 = AnimElem = 1
value = S0,1

[State 200, 2]
type = velset
trigger1 = time >= 0
trigger1 = time <= 20
x = 0
y = 0

;This where you start taking the damage set by the helper in state 1007.
[State 0, LifeAdd]
type = LifeAdd
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
trigger1 = fvar(17) > 0
value = -floor(fvar(17))
ignorehitpause = 1

;Right after you take the damage, you IMMEDIATELY subtract the damage from fvar(10) by itself. If you want, this can also be a varset that sets it to 0.
[State 0, VarAdd]
type = VarAdd
trigger1 = var(3) > 0
trigger1 = 1
fv = 17
value = -floor(fvar(17))
ignorehitpause=  1

;This makes you invincible while the helper is out, but as the great prophets of Yu-Gi-Oh! Arc-V say: BUT YOU'LL STILL TAKE THE DAMAGE!
[State 0, NotHitBy]
type = NotHitBy
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT

[State 200, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 10301
ctrl = 0

; Fireball itself
[statedef 10301]
type = S
movetype = A
physics = S
anim = 301

;This where you start taking the damage set by the helper in state 1007.
[State 0, LifeAdd]
type = LifeAdd
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
trigger1 = fvar(17) > 0
value = -floor(fvar(17))
ignorehitpause = 1

;Right after you take the damage, you IMMEDIATELY subtract the damage from fvar(10) by itself. If you want, this can also be a varset that sets it to 0.
[State 0, VarAdd]
type = VarAdd
trigger1 = var(3) > 0
trigger1 = 1
fv = 17
value = -floor(fvar(17))
ignorehitpause=  1

;This makes you invincible while the helper is out, but as the great prophets of Yu-Gi-Oh! Arc-V say: BUT YOU'LL STILL TAKE THE DAMAGE!
[State 0, NotHitBy]
type = NotHitBy
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT

[State 201, 1]
type = Projectile
trigger1 = AnimElem = 1
projanim = 202
projheightbound = -240, 70
projscale = 3,3
offset = 17,-24
velocity = 5,0
attr = S, SP
damage = 50,6
animtype = light
guardflag = MA
hitflag = MAF
pausetime = 5,5
;hitsound = s2,4
;guardsound = s2,3
guard.sparkno = 40
sparkno = 0                      
sparkxy = -10,0 
ground.type = Low
ground.slidetime = 7
ground.hittime  = 7
ground.velocity = -5,0
air.velocity = -5,0
air.juggle = 5
air.fall = 0
down.velocity = -4,-6
down.hittime = 10
down.bounce = 0
getpower = 0,0

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

;-------------------------------------------------
; Forward Diagonal Fireball
;-------------------------------------------------
[Statedef 10305]
type = S
movetype= A
physics = S
poweradd = 0
ctrl = 0
anim = 300
velset = 0

[State 200, 1]
type = Playsnd
trigger1 = AnimElem = 1
value = S0,1

[State 200, 2]
type = velset
trigger1 = time >= 0
trigger1 = time <= 20
x = 0
y = 0

;This where you start taking the damage set by the helper in state 1007.
[State 0, LifeAdd]
type = LifeAdd
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
trigger1 = fvar(17) > 0
value = -floor(fvar(17))
ignorehitpause = 1

;Right after you take the damage, you IMMEDIATELY subtract the damage from fvar(10) by itself. If you want, this can also be a varset that sets it to 0.
[State 0, VarAdd]
type = VarAdd
trigger1 = var(3) > 0
trigger1 = 1
fv = 17
value = -floor(fvar(17))
ignorehitpause=  1

;This makes you invincible while the helper is out, but as the great prophets of Yu-Gi-Oh! Arc-V say: BUT YOU'LL STILL TAKE THE DAMAGE!
[State 0, NotHitBy]
type = NotHitBy
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT


[State 200, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 10306
ctrl = 0

; Fireball itself
[statedef 10306]
type = S
movetype = A
physics = S
anim = 301
Velset = 0,0

;This where you start taking the damage set by the helper in state 1007.
[State 0, LifeAdd]
type = LifeAdd
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
trigger1 = fvar(17) > 0
value = -floor(fvar(17))
ignorehitpause = 1

;Right after you take the damage, you IMMEDIATELY subtract the damage from fvar(10) by itself. If you want, this can also be a varset that sets it to 0.
[State 0, VarAdd]
type = VarAdd
trigger1 = var(3) > 0
trigger1 = 1
fv = 17
value = -floor(fvar(17))
ignorehitpause=  1

;This makes you invincible while the helper is out, but as the great prophets of Yu-Gi-Oh! Arc-V say: BUT YOU'LL STILL TAKE THE DAMAGE!
[State 0, NotHitBy]
type = NotHitBy
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT

[State 0, Helper]
type = Helper
trigger1 = AnimElem = 1
helpertype = normal ;player
name = "BallCrits"
ID = 307
stateno = 307
pos = 17,-24
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = 3
size.yscale = 3

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

; Fireball itself
[statedef 307]
type = S
movetype = A
physics = S
anim = 302

[State 0, VelSet]
type = VelSet
trigger1 = 1
x = 5
y = 0

[State 0, PalFX]
type = PalFX
trigger1 = 1
time = 1
add = 0,0,256
mul = 256,256,256
invertall = 0
color = 256

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = S,AA,AP,AT       
slot = 1
stateno = 9999
time = 1
forceair = 0

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,AA,AP,AT
time = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S9500,0
volume = 100
channel = -1
freqmul = 1.0
loop = 0
pan = 0
abspan = 1

[State 0, HitDef]
type = HitDef
trigger1 = time = 0
attr = S,SP
damage = 150,
animtype = hard
guardflag =
hitflag = MAF
pausetime = 0,0
;hitsound = s2,4
;guardsound = s2,3
sparkno = 2                    
sparkxy = -10,0 
hitsound = S9500, 1   
ground.type = Low
ground.slidetime = 7
ground.hittime  = 7
ground.velocity = -5,0
air.velocity = -5,0
air.juggle = 5
air.fall = 0
down.velocity = -4,-6
down.hittime = 10
down.bounce = 0
getpower = 0,0

[State 0, Helper]
type = Helper
trigger1 = movehit = 1
helpertype = normal ;player
name = "CriticalHit"
ID = 9500
stateno = 9500
pos = -15,-30+floor(Enemy,Const(Size.Head.Pos.Y))
postype = p2    ;p2,front,back,left,right
facing = 0
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = 0.1 
size.yscale = 0.1
persistent = 0

[State 0, ChangeState]
type = DestroySelf
trigger1 = movehit
trigger2 = moveguarded 
trigger3 = FrontEdgeDist <= -20
trigger4 = BackEdgeDist <= -20

;-------------------------------------------------
; Forward Up Horizontal Fireball
;-------------------------------------------------
[Statedef 10310]
type = S
movetype= A
physics = S
poweradd = 0
ctrl = 0
anim = 300
velset = 0

[State 230, 1]
type = Playsnd
trigger1 = AnimElem = 1
value = S0,1

[State 230, 2]
type = velset
trigger1 = time >= 0
trigger1 = time <= 20
x = 0
y = 0

;This where you start taking the damage set by the helper in state 1007.
[State 0, LifeAdd]
type = LifeAdd
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
trigger1 = fvar(17) > 0
value = -floor(fvar(17))
ignorehitpause = 1

;Right after you take the damage, you IMMEDIATELY subtract the damage from fvar(10) by itself. If you want, this can also be a varset that sets it to 0.
[State 0, VarAdd]
type = VarAdd
trigger1 = var(3) > 0
trigger1 = 1
fv = 17
value = -floor(fvar(17))
ignorehitpause=  1

;This makes you invincible while the helper is out, but as the great prophets of Yu-Gi-Oh! Arc-V say: BUT YOU'LL STILL TAKE THE DAMAGE!
[State 0, NotHitBy]
type = NotHitBy
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT

[State 230, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 10311
ctrl = 0

; Fireball itself
[statedef 10311]
type = S
movetype = A
physics = S
anim = 301

;This where you start taking the damage set by the helper in state 1007.
[State 0, LifeAdd]
type = LifeAdd
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
trigger1 = fvar(17) > 0
value = -floor(fvar(17))
ignorehitpause = 1

;Right after you take the damage, you IMMEDIATELY subtract the damage from fvar(10) by itself. If you want, this can also be a varset that sets it to 0.
[State 0, VarAdd]
type = VarAdd
trigger1 = var(3) > 0
trigger1 = 1
fv = 17
value = -floor(fvar(17))
ignorehitpause=  1

;This makes you invincible while the helper is out, but as the great prophets of Yu-Gi-Oh! Arc-V say: BUT YOU'LL STILL TAKE THE DAMAGE!
[State 0, NotHitBy]
type = NotHitBy
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT

[State 211, 1]
type = Projectile
trigger1 = AnimElem = 1
projanim = 302
projheightbound = -240, 70
projscale = 3,3
offset = 17,-24
velocity = 4,-1.5
attr = S, SP
damage = 50,6
animtype = light
guardflag = MA
hitflag = MAF
pausetime = 5,5
;hitsound = s2,4
;guardsound = s2,3
guard.sparkno = 40
sparkno = 0                      
sparkxy = -10,0 
ground.type = Low
ground.slidetime = 7
ground.hittime  = 7
ground.velocity = -4,-0.2
air.velocity = -4,-3
air.juggle = 5
air.fall = 0
down.velocity = -4,-3
down.hittime = 10
down.bounce = 0
getpower = 0,0

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

;-------------------------------------------------
; Forward Up Diagonal Fireball
;-------------------------------------------------
[Statedef 10315]
type = S
movetype= A
physics = S
poweradd = 0
ctrl = 0
anim = 300
velset = 0

[State 200, 1]
type = Playsnd
trigger1 = AnimElem = 1
value = S0,1

[State 200, 2]
type = velset
trigger1 = time >= 0
trigger1 = time <= 20
x = 0
y = 0

;This where you start taking the damage set by the helper in state 1007.
[State 0, LifeAdd]
type = LifeAdd
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
trigger1 = fvar(17) > 0
value = -floor(fvar(17))
ignorehitpause = 1

;Right after you take the damage, you IMMEDIATELY subtract the damage from fvar(10) by itself. If you want, this can also be a varset that sets it to 0.
[State 0, VarAdd]
type = VarAdd
trigger1 = var(3) > 0
trigger1 = 1
fv = 17
value = -floor(fvar(17))
ignorehitpause=  1

;This makes you invincible while the helper is out, but as the great prophets of Yu-Gi-Oh! Arc-V say: BUT YOU'LL STILL TAKE THE DAMAGE!
[State 0, NotHitBy]
type = NotHitBy
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT

[State 200, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 10316
ctrl = 0

; Fireball itself
[statedef 10316]
type = S
movetype = A
physics = S
anim = 301
Velset = 0,0

;This where you start taking the damage set by the helper in state 1007.
[State 0, LifeAdd]
type = LifeAdd
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
trigger1 = fvar(17) > 0
value = -floor(fvar(17))
ignorehitpause = 1

;Right after you take the damage, you IMMEDIATELY subtract the damage from fvar(10) by itself. If you want, this can also be a varset that sets it to 0.
[State 0, VarAdd]
type = VarAdd
trigger1 = var(3) > 0
trigger1 = 1
fv = 17
value = -floor(fvar(17))
ignorehitpause=  1

;This makes you invincible while the helper is out, but as the great prophets of Yu-Gi-Oh! Arc-V say: BUT YOU'LL STILL TAKE THE DAMAGE!
[State 0, NotHitBy]
type = NotHitBy
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT

[State 0, Helper]
type = Helper
trigger1 = AnimElem = 1
helpertype = normal ;player
name = "BallCrits"
ID = 317
stateno = 317
pos = 17,-24
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = 3
size.yscale = 3

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

; Fireball itself
[statedef 317]
type = S
movetype = A
physics = S
anim = 302

[State 0, VelSet]
type = VelSet
trigger1 = 1
x = 4
y = -1.5

[State 0, PalFX]
type = PalFX
trigger1 = 1
time = 1
add = 0,0,256
mul = 256,256,256
invertall = 0
color = 256

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = S,AA,AP,AT       
slot = 1
stateno = 9999
time = 1
forceair = 0

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,AA,AP,AT
time = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S9500,0
volume = 100
channel = -1
freqmul = 1.0
loop = 0
pan = 0
abspan = 1

[State 0, HitDef]
type = HitDef
trigger1 = time = 0
attr = S,SP
damage = 150, 0
animtype = hard
guardflag =
hitflag = MAF
pausetime = 0,0
;hitsound = s2,4
;guardsound = s2,3
sparkno = 2                    
sparkxy = -10,0 
hitsound = S9500, 1   
ground.type = Low
ground.slidetime = 7
ground.hittime  = 7
ground.velocity = -4,-0.2
air.velocity = -4,-3
air.juggle = 5
air.fall = 0
down.velocity = -4,-3
down.hittime = 10
down.bounce = 0

[State 0, Helper]
type = Helper
trigger1 = movehit = 1
helpertype = normal ;player
name = "CriticalHit"
ID = 9500
stateno = 9500
pos = -15,-30+floor(Enemy,Const(Size.Head.Pos.Y))
postype = p2    ;p2,front,back,left,right
facing = 0
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = 0.1 
size.yscale = 0.1
persistent = 0

[State 0, ChangeState]
type = DestroySelf
trigger1 = movehit
trigger2 = moveguarded 
trigger3 = FrontEdgeDist <= -20
trigger4 = BackEdgeDist <= -20

;-------------------------------------------------
; Forward Up Diagonal Fireball
;-------------------------------------------------
[Statedef 10320]
type = S
movetype= A
physics = S
poweradd = 0
ctrl = 0
anim = 300
velset = 0

[State 230, 1]
type = Playsnd
trigger1 = AnimElem = 1
value = S0,1

[State 230, 2]
type = velset
trigger1 = time >= 0
trigger1 = time <= 20
x = 0
y = 0

;This where you start taking the damage set by the helper in state 1007.
[State 0, LifeAdd]
type = LifeAdd
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
trigger1 = fvar(17) > 0
value = -floor(fvar(17))
ignorehitpause = 1

;Right after you take the damage, you IMMEDIATELY subtract the damage from fvar(10) by itself. If you want, this can also be a varset that sets it to 0.
[State 0, VarAdd]
type = VarAdd
trigger1 = var(3) > 0
trigger1 = 1
fv = 17
value = -floor(fvar(17))
ignorehitpause=  1

;This makes you invincible while the helper is out, but as the great prophets of Yu-Gi-Oh! Arc-V say: BUT YOU'LL STILL TAKE THE DAMAGE!
[State 0, NotHitBy]
type = NotHitBy
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT

[State 230, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 10321
ctrl = 0

; Fireball itself
[statedef 10321]
type = S
movetype = A
physics = S
anim = 301

;This where you start taking the damage set by the helper in state 1007.
[State 0, LifeAdd]
type = LifeAdd
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
trigger1 = fvar(17) > 0
value = -floor(fvar(17))
ignorehitpause = 1

;Right after you take the damage, you IMMEDIATELY subtract the damage from fvar(10) by itself. If you want, this can also be a varset that sets it to 0.
[State 0, VarAdd]
type = VarAdd
trigger1 = var(3) > 0
trigger1 = 1
fv = 17
value = -floor(fvar(17))
ignorehitpause=  1

;This makes you invincible while the helper is out, but as the great prophets of Yu-Gi-Oh! Arc-V say: BUT YOU'LL STILL TAKE THE DAMAGE!
[State 0, NotHitBy]
type = NotHitBy
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT

[State 221, 1]
type = Projectile
trigger1 = AnimElem = 1
projanim = 302
projheightbound = -240, 70
projscale = 3,3
offset = 17,-24
velocity = 3,-3
attr = S, SP
damage = 50,6
animtype = light
guardflag = MA
hitflag = MAF
pausetime = 5,5
;hitsound = s2,4
;guardsound = s2,3
guard.sparkno = 40
sparkno = 0                      
sparkxy = -10,0 
ground.type = Low
ground.slidetime = 7
ground.hittime  = 7
ground.velocity = -3,-1
air.velocity = -3,-6
air.juggle = 5
air.fall = 0
down.velocity = -3,-7
down.hittime = 10
down.bounce = 0

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

;-------------------------------------------------
; Forward Up Diagonal Fireball
;-------------------------------------------------
[Statedef 10325]
type = S
movetype= A
physics = S
poweradd = 0
ctrl = 0
anim = 300
velset = 0

[State 200, 1]
type = Playsnd
trigger1 = AnimElem = 1
value = S0,1

[State 200, 2]
type = velset
trigger1 = time >= 0
trigger1 = time <= 20
x = 0
y = 0

;This where you start taking the damage set by the helper in state 1007.
[State 0, LifeAdd]
type = LifeAdd
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
trigger1 = fvar(17) > 0
value = -floor(fvar(17))
ignorehitpause = 1

;Right after you take the damage, you IMMEDIATELY subtract the damage from fvar(10) by itself. If you want, this can also be a varset that sets it to 0.
[State 0, VarAdd]
type = VarAdd
trigger1 = var(3) > 0
trigger1 = 1
fv = 17
value = -floor(fvar(17))
ignorehitpause=  1

;This makes you invincible while the helper is out, but as the great prophets of Yu-Gi-Oh! Arc-V say: BUT YOU'LL STILL TAKE THE DAMAGE!
[State 0, NotHitBy]
type = NotHitBy
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT

[State 200, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 10326
ctrl = 0

; Fireball itself
[statedef 10326]
type = S
movetype = A
physics = S
anim = 301
Velset = 0,0

;This where you start taking the damage set by the helper in state 1007.
[State 0, LifeAdd]
type = LifeAdd
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
trigger1 = fvar(17) > 0
value = -floor(fvar(17))
ignorehitpause = 1

;Right after you take the damage, you IMMEDIATELY subtract the damage from fvar(10) by itself. If you want, this can also be a varset that sets it to 0.
[State 0, VarAdd]
type = VarAdd
trigger1 = var(3) > 0
trigger1 = 1
fv = 17
value = -floor(fvar(17))
ignorehitpause=  1

;This makes you invincible while the helper is out, but as the great prophets of Yu-Gi-Oh! Arc-V say: BUT YOU'LL STILL TAKE THE DAMAGE!
[State 0, NotHitBy]
type = NotHitBy
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT

[State 0, Helper]
type = Helper
trigger1 = AnimElem = 1
helpertype = normal ;player
name = "BallCrits"
ID = 327
stateno = 327
pos = 17,-24
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = 3
size.yscale = 3

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

; Fireball itself
[statedef 327]
type = S
movetype = A
physics = S
anim = 302

[State 0, VelSet]
type = VelSet
trigger1 = 1
x = 3
y = -3

[State 0, PalFX]
type = PalFX
trigger1 = 1
time = 1
add = 0,0,256
mul = 256,256,256
invertall = 0
color = 256

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = S,AA,AP,AT       
slot = 1
stateno = 9999
time = 1
forceair = 0

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,AA,AP,AT
time = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S9500,0
volume = 100
channel = -1
freqmul = 1.0
loop = 0
pan = 0
abspan = 1

[State 0, HitDef]
type = HitDef
trigger1 = time = 0
attr = S,SP
damage = 150, 0
animtype = hard
guardflag =
hitflag = MAF
pausetime = 0,0
;hitsound = s2,4
;guardsound = s2,3
sparkno = 2                    
sparkxy = -10,0 
hitsound = S9500, 1   
ground.type = Low
ground.slidetime = 7
ground.hittime  = 7
ground.velocity = -3,-1
air.velocity = -3,-6
air.juggle = 5
air.fall = 0
down.velocity = -3,-7
down.hittime = 10
down.bounce = 0

[State 0, Helper]
type = Helper
trigger1 = movehit = 1
helpertype = normal ;player
name = "CriticalHit"
ID = 9500
stateno = 9500
pos = -15,-30+floor(Enemy,Const(Size.Head.Pos.Y))
postype = p2    ;p2,front,back,left,right
facing = 0
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = 0.1 
size.yscale = 0.1
persistent = 0

[State 0, ChangeState]
type = DestroySelf
trigger1 = movehit
trigger2 = moveguarded 
trigger3 = FrontEdgeDist <= -20
trigger4 = BackEdgeDist <= -20

;-------------------------------------------------
; Triple Fireball
;-------------------------------------------------
[Statedef 10400]
type = S
movetype= A
physics = S
poweradd = 0
ctrl = 0
anim = 400
velset = 0

[State 200, 1]
type = Playsnd
trigger1 = AnimElem = 1
value = S0,1

[State 200, 2]
type = velset
trigger1 = time >= 0
trigger1 = time <= 20
x = 0
y = 0

;This where you start taking the damage set by the helper in state 1007.
[State 0, LifeAdd]
type = LifeAdd
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
trigger1 = fvar(17) > 0
value = -floor(fvar(17))
ignorehitpause = 1

;Right after you take the damage, you IMMEDIATELY subtract the damage from fvar(10) by itself. If you want, this can also be a varset that sets it to 0.
[State 0, VarAdd]
type = VarAdd
trigger1 = var(3) > 0
trigger1 = 1
fv = 17
value = -floor(fvar(17))
ignorehitpause=  1

;This makes you invincible while the helper is out, but as the great prophets of Yu-Gi-Oh! Arc-V say: BUT YOU'LL STILL TAKE THE DAMAGE!
[State 0, NotHitBy]
type = NotHitBy
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT

[State 200, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 10401
ctrl = 0

; Fireball itself
[statedef 10401]
type = S
movetype = A
physics = S
anim = 401

;This where you start taking the damage set by the helper in state 1007.
[State 0, LifeAdd]
type = LifeAdd
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
trigger1 = fvar(17) > 0
value = -floor(fvar(17))
ignorehitpause = 1

;Right after you take the damage, you IMMEDIATELY subtract the damage from fvar(10) by itself. If you want, this can also be a varset that sets it to 0.
[State 0, VarAdd]
type = VarAdd
trigger1 = var(3) > 0
trigger1 = 1
fv = 17
value = -floor(fvar(17))
ignorehitpause=  1

;This makes you invincible while the helper is out, but as the great prophets of Yu-Gi-Oh! Arc-V say: BUT YOU'LL STILL TAKE THE DAMAGE!
[State 0, NotHitBy]
type = NotHitBy
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT

[State 201, 1]
type = Projectile
Triggerall = var(30) = [3280,65536]
trigger1 = AnimElem = 1
projanim = 402
projheightbound = -240, 70
projscale = 3,3
offset = 17,-24
velocity = 5,0
attr = S, SP
damage = 50, 6
animtype = light
guardflag = MA
hitflag = MAF
pausetime = 5,5
;hitsound = s2,4
;guardsound = s2,3
guard.sparkno = 40
sparkno = 0                      
sparkxy = -10,0  
ground.type = Low
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -5,0
air.velocity = -5,0
air.juggle = 5
air.fall = 0
down.velocity = -4,-6
down.hittime = 10
down.bounce = 0
getpower = 0,0

[State 211, 1]
type = Projectile
Triggerall = var(20) = [3280,65536]
trigger1 = AnimElem = 1
projanim = 402
projheightbound = -240, 70
projscale = 3,3
offset = 17,-24
velocity = 4,-1.5
attr = S, SP
damage = 50,6
animtype = light
guardflag = MA
hitflag = MAF
pausetime = 5,5
;hitsound = s2,4
;guardsound = s2,3
guard.sparkno = 40
sparkno = 0                      
sparkxy = -10,0 
ground.type = Low
ground.slidetime = 7
ground.hittime  = 7
ground.velocity = -4,-0.2
air.velocity = -4,-3
air.juggle = 5
air.fall = 0
down.velocity = -4,-3
down.hittime = 10
down.bounce = 0
getpower = 0,0

[State 221, 1]
type = Projectile
Triggerall = var(10) = [3280,65536]
trigger1 = AnimElem = 1
projanim = 402
projheightbound = -240, 70
projscale = 3,3
offset = 17,-24
velocity = 3,-3
attr = S, SP
damage = 50,6
animtype = light
guardflag = MA
hitflag = MAF
pausetime = 5,5
;hitsound = s2,4
;guardsound = s2,3
guard.sparkno = 40
sparkno = 0                      
sparkxy = -10,0 
ground.type = Low
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -3,-1
air.velocity = -3,-6
air.juggle = 5
air.fall = 0
down.velocity = -3,-7
down.hittime = 10
down.bounce = 0
getpower = 0,0


[State 0, Helper]
type = Helper
Triggerall = var(30) = [0,3279]
trigger1 = AnimElem = 1
helpertype = normal ;player
name = "BallCrits"
ID = 407
stateno = 407
pos = 17,-24
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = 3
size.yscale = 3

[State 0, Helper]
type = Helper
Triggerall = var(20) = [0,3279]
trigger1 = AnimElem = 1
helpertype = normal ;player
name = "BallCrits"
ID = 417
stateno = 417
pos = 17,-24
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = 3
size.yscale = 3

[State 0, Helper]
type = Helper
Triggerall = var(10) = [0,3279]
trigger1 = AnimElem = 1
helpertype = normal ;player
name = "BallCrits"
ID = 427
stateno = 427
pos = 17,-24
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = 3
size.yscale = 3

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

; Fireball itself
[statedef 407]
type = S
movetype = A
physics = S
anim = 402

[State 0, VelSet]
type = VelSet
trigger1 = 1
x = 5
y = 0

[State 0, PalFX]
type = PalFX
trigger1 = 1
time = 1
add = 0,0,256
mul = 256,256,256
invertall = 0
color = 256

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = S,AA,AP,AT       
slot = 1
stateno = 9999
time = 1
forceair = 0

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,AA,AP,AT
time = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S9500,0
volume = 100
channel = -1
freqmul = 1.0
loop = 0
pan = 0
abspan = 1

[State 0, HitDef]
type = HitDef
trigger1 = time = 0
attr = S,SP
damage = 150, 0
animtype = hard
guardflag =
hitflag = MAF
pausetime = 0,0
;hitsound = s2,4
;guardsound = s2,3
sparkno = 2                    
sparkxy = -10,0 
hitsound = S9500, 1   
ground.type = Low
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -5,0
air.velocity = -5,0
air.juggle = 5
air.fall = 0
down.velocity = -4,-6
down.hittime = 10
down.bounce = 0
getpower = 0,0

[State 0, Helper]
type = Helper
trigger1 = movehit = 1
helpertype = normal ;player
name = "CriticalHit"
ID = 9500
stateno = 9500
pos = -15,-30+floor(Enemy,Const(Size.Head.Pos.Y))
postype = p2    ;p2,front,back,left,right
facing = 0
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = 0.1 
size.yscale = 0.1
persistent = 0

[State 0, ChangeState]
type = DestroySelf
trigger1 = movehit
trigger2 = moveguarded 
trigger3 = FrontEdgeDist <= -20
trigger4 = BackEdgeDist <= -20

; Fireball itself
[statedef 417]
type = S
movetype = A
physics = S
anim = 402

[State 0, VelSet]
type = VelSet
trigger1 = 1
x = 4
y = -1.5

[State 0, PalFX]
type = PalFX
trigger1 = 1
time = 1
add = 0,0,256
mul = 256,256,256
invertall = 0
color = 256

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = S,AA,AP,AT       
slot = 1
stateno = 9999
time = 1
forceair = 0

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,AA,AP,AT
time = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S9500,0
volume = 100
channel = -1
freqmul = 1.0
loop = 0
pan = 0
abspan = 1

[State 0, HitDef]
type = HitDef
trigger1 = time = 0
attr = S,SP
damage = 150, 0
animtype = hard
guardflag =
hitflag = MAF
pausetime = 0,0
;hitsound = s2,4
;guardsound = s2,3
sparkno = 2                    
sparkxy = -10,0 
hitsound = S9500, 1   
ground.type = Low
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -4,-0.2
air.velocity = -4,-3
air.juggle = 5
air.fall = 0
down.velocity = -4,-3
down.hittime = 10
down.bounce = 0
getpower = 0,0


[State 0, Helper]
type = Helper
trigger1 = movehit = 1
helpertype = normal ;player
name = "CriticalHit"
ID = 9500
stateno = 9500
pos = -15,-30+floor(Enemy,Const(Size.Head.Pos.Y))
postype = p2    ;p2,front,back,left,right
facing = 0
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = 0.1 
size.yscale = 0.1
persistent = 0

[State 0, ChangeState]
type = DestroySelf
trigger1 = movehit
trigger2 = moveguarded 
trigger3 = FrontEdgeDist <= -20
trigger4 = BackEdgeDist <= -20

; Fireball itself
[statedef 427]
type = S
movetype = A
physics = S
anim = 402

[State 0, VelSet]
type = VelSet
trigger1 = 1
x = 3
y = -3

[State 0, PalFX]
type = PalFX
trigger1 = 1
time = 1
add = 0,0,256
mul = 256,256,256
invertall = 0
color = 256

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = S,AA,AP,AT       
slot = 1
stateno = 9999
time = 1
forceair = 0

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,AA,AP,AT
time = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S9500,0
volume = 100
channel = -1
freqmul = 1.0
loop = 0
pan = 0
abspan = 1

[State 0, HitDef]
type = HitDef
trigger1 = time = 0
attr = S,SP
damage = 150, 0
animtype = hard
guardflag =
hitflag = MAF
pausetime = 0,0
;hitsound = s2,4
;guardsound = s2,3
sparkno = 2                    
sparkxy = -10,0 
hitsound = S9500, 1   
ground.type = Low
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -3,-1
air.velocity = -3,-6
air.juggle = 5
air.fall = 0
down.velocity = -3,-7
down.hittime = 10
down.bounce = 0
getpower = 0,0

[State 0, Helper]
type = Helper
trigger1 = movehit = 1
helpertype = normal ;player
name = "CriticalHit"
ID = 9500
stateno = 9500
pos = -15,-30+floor(Enemy,Const(Size.Head.Pos.Y))
postype = p2    ;p2,front,back,left,right
facing = 0
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = 0.1 
size.yscale = 0.1
persistent = 0

[State 0, ChangeState]
type = DestroySelf
trigger1 = movehit
trigger2 = moveguarded 
trigger3 = FrontEdgeDist <= -20
trigger4 = BackEdgeDist <= -20

;-------------------------------------------------
; Triple Fast Fireball
;-------------------------------------------------
[Statedef 10500]
type = S
movetype= A
physics = S
poweradd = 0
ctrl = 0
anim = 300
velset = 0

[State 200, 1]
type = Playsnd
trigger1 = AnimElem = 1
value = S0,1

[State 200, 2]
type = velset
trigger1 = time >= 0
trigger1 = time <= 20
x = 0
y = 0
;This where you start taking the damage set by the helper in state 1007.
[State 0, LifeAdd]
type = LifeAdd
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
trigger1 = fvar(17) > 0
value = -floor(fvar(17))
ignorehitpause = 1

;Right after you take the damage, you IMMEDIATELY subtract the damage from fvar(10) by itself. If you want, this can also be a varset that sets it to 0.
[State 0, VarAdd]
type = VarAdd
trigger1 = var(3) > 0
trigger1 = 1
fv = 17
value = -floor(fvar(17))
ignorehitpause=  1

;This makes you invincible while the helper is out, but as the great prophets of Yu-Gi-Oh! Arc-V say: BUT YOU'LL STILL TAKE THE DAMAGE!
[State 0, NotHitBy]
type = NotHitBy
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT

[State 200, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 10501
ctrl = 0

; Fireball itself
[statedef 10501]
type = S
movetype = A
physics = S
anim = 301

;This where you start taking the damage set by the helper in state 1007.
[State 0, LifeAdd]
type = LifeAdd
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
trigger1 = fvar(17) > 0
value = -floor(fvar(17))
ignorehitpause = 1

;Right after you take the damage, you IMMEDIATELY subtract the damage from fvar(10) by itself. If you want, this can also be a varset that sets it to 0.
[State 0, VarAdd]
type = VarAdd
trigger1 = var(3) > 0
trigger1 = 1
fv = 17
value = -floor(fvar(17))
ignorehitpause=  1

;This makes you invincible while the helper is out, but as the great prophets of Yu-Gi-Oh! Arc-V say: BUT YOU'LL STILL TAKE THE DAMAGE!
[State 0, NotHitBy]
type = NotHitBy
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT

[State 201, 1]
type = Projectile
Triggerall = var(30) = [3280,65536]
trigger1 = AnimElem = 1
projanim = 302
projheightbound = -240, 70
projscale = 3,3
offset = 17,-24
velocity = 5,0
attr = S, SP
damage = 50, 6
animtype = light
guardflag = MA
hitflag = MAF
pausetime = 5,5
;hitsound = s2,4
;guardsound = s2,3
guard.sparkno = 40
sparkno = 0                      
sparkxy = -10,0 
ground.type = Low
ground.slidetime = 7
ground.hittime  = 7
ground.velocity = -5,0
air.velocity = -5,0
air.juggle = 5
air.fall = 0
down.velocity = -4,-6
down.hittime = 10
down.bounce = 0
getpower = 0,0

[State 211, 1]
type = Projectile
Triggerall = var(20) = [3280,65536]
trigger1 = AnimElem = 1
projanim = 302
projheightbound = -240, 70
projscale = 3,3
offset = 17,-24
velocity = 4,-1.5
attr = S, SP
damage = 50,6
animtype = light
guardflag = MA
hitflag = MAF
pausetime = 5,5
;hitsound = s2,4
;guardsound = s2,3
guard.sparkno = 40
sparkno = 0                      
sparkxy = -10,0 
ground.type = Low
ground.slidetime = 7
ground.hittime  = 7
ground.velocity = -4,-0.2
air.velocity = -4,-3
air.juggle = 5
air.fall = 0
down.velocity = -4,-3
down.hittime = 10
down.bounce = 0
getpower = 0,0

[State 221, 1]
type = Projectile
Triggerall = var(10) = [3280,65536]
trigger1 = AnimElem = 1
projanim = 302
projheightbound = -240, 70
projscale = 3,3
offset = 17,-24
velocity = 3,-3
attr = S, SP
damage = 50,6
animtype = light
guardflag = MA
hitflag = MAF
pausetime = 5,5
;hitsound = s2,4
;guardsound = s2,3
guard.sparkno = 40
sparkno = 0                      
sparkxy = -10,0 
ground.type = Low
ground.slidetime = 7
ground.hittime  = 7
ground.velocity = -3,-1
air.velocity = -3,-6
air.juggle = 5
air.fall = 0
down.velocity = -3,-7
down.hittime = 10
down.bounce = 0
getpower = 0,0


[State 0, Helper]
type = Helper
Triggerall = var(30) = [0,3279]
trigger1 = AnimElem = 1
helpertype = normal ;player
name = "BallCrits"
ID = 507
stateno = 507
pos = 17,-24
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = 3
size.yscale = 3

[State 0, Helper]
type = Helper
Triggerall = var(20) = [0,3279]
trigger1 = AnimElem = 1
helpertype = normal ;player
name = "BallCrits"
ID = 517
stateno = 517
pos = 17,-24
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = 3
size.yscale = 3

[State 0, Helper]
type = Helper
Triggerall = var(10) = [0,3279]
trigger1 = AnimElem = 1
helpertype = normal ;player
name = "BallCrits"
ID = 527
stateno = 527
pos = 17,-24
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = 3
size.yscale = 3

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

; Fireball itself
[statedef 507]
type = S
movetype = A
physics = S
anim = 302

[State 0, VelSet]
type = VelSet
trigger1 = 1
x = 5
y = 0

[State 0, PalFX]
type = PalFX
trigger1 = 1
time = 1
add = 0,0,256
mul = 256,256,256
invertall = 0
color = 256

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = S,AA,AP,AT       
slot = 1
stateno = 9999
time = 1
forceair = 0

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,AA,AP,AT
time = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S9500,0
volume = 100
channel = -1
freqmul = 1.0
loop = 0
pan = 0
abspan = 1

[State 0, HitDef]
type = HitDef
trigger1 = time = 0
attr = S,SP
damage = 150, 0
animtype = hard
guardflag =
hitflag = MAF
pausetime = 0,0
;hitsound = s2,4
;guardsound = s2,3
sparkno = 2                    
sparkxy = -10,0 
hitsound = S9500, 1   
ground.type = Low
ground.slidetime = 7
ground.hittime  = 7
ground.velocity = -5,0
air.velocity = -5,0
air.juggle = 5
air.fall = 0
down.velocity = -4,-6
down.hittime = 10
down.bounce = 0
getpower = 0,0

[State 0, Helper]
type = Helper
trigger1 = movehit = 1
helpertype = normal ;player
name = "CriticalHit"
ID = 9500
stateno = 9500
pos = -15,-30+floor(Enemy,Const(Size.Head.Pos.Y))
postype = p2    ;p2,front,back,left,right
facing = 0
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = 0.1 
size.yscale = 0.1
persistent = 0

[State 0, ChangeState]
type = DestroySelf
trigger1 = movehit
trigger2 = moveguarded 
trigger3 = FrontEdgeDist <= -20
trigger4 = BackEdgeDist <= -20

; Fireball itself
[statedef 517]
type = S
movetype = A
physics = S
anim = 302

[State 0, VelSet]
type = VelSet
trigger1 = 1
x = 4
y = -1.5

[State 0, PalFX]
type = PalFX
trigger1 = 1
time = 1
add = 0,0,256
mul = 256,256,256
invertall = 0
color = 256

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = S,AA,AP,AT       
slot = 1
stateno = 9999
time = 1
forceair = 0

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,AA,AP,AT
time = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S9500,0
volume = 100
channel = -1
freqmul = 1.0
loop = 0
pan = 0
abspan = 1

[State 0, HitDef]
type = HitDef
trigger1 = time = 0
attr = S,SP
damage = 150, 0
animtype = hard
guardflag =
hitflag = MAF
pausetime = 0,0
;hitsound = s2,4
;guardsound = s2,3
sparkno = 2                    
sparkxy = -10,0 
hitsound = S9500, 1   
ground.type = Low
ground.slidetime = 7
ground.hittime  = 7
ground.velocity = -4,-0.2
air.velocity = -4,-3
air.juggle = 5
air.fall = 0
down.velocity = -4,-3
down.hittime = 10
down.bounce = 0
getpower = 0,0


[State 0, Helper]
type = Helper
trigger1 = movehit = 1
helpertype = normal ;player
name = "CriticalHit"
ID = 9500
stateno = 9500
pos = -15,-30+floor(Enemy,Const(Size.Head.Pos.Y))
postype = p2    ;p2,front,back,left,right
facing = 0
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = 0.1 
size.yscale = 0.1
persistent = 0

[State 0, ChangeState]
type = DestroySelf
trigger1 = movehit
trigger2 = moveguarded 
trigger3 = FrontEdgeDist <= -20
trigger4 = BackEdgeDist <= -20

; Fireball itself
[statedef 527]
type = S
movetype = A
physics = S
anim = 302

[State 0, VelSet]
type = VelSet
trigger1 = 1
x = 3
y = -3

[State 0, PalFX]
type = PalFX
trigger1 = 1
time = 1
add = 0,0,256
mul = 256,256,256
invertall = 0
color = 256

[State 0, HitOverride]
type = HitOverride
trigger1 = 1
attr = S,AA,AP,AT       
slot = 1
stateno = 9999
time = 1
forceair = 0

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,AA,AP,AT
time = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S9500,0
volume = 100
channel = -1
freqmul = 1.0
loop = 0
pan = 0
abspan = 1

[State 0, HitDef]
type = HitDef
trigger1 = time = 0
attr = S,SP
damage = 150, 0
animtype = hard
guardflag =
hitflag = MAF
pausetime = 0,0
;hitsound = s2,4
;guardsound = s2,3
sparkno = 2                    
sparkxy = -10,0 
hitsound = S9500, 1   
ground.type = Low
ground.slidetime = 7
ground.hittime  = 7
ground.velocity = -3,-1
air.velocity = -3,-6
air.juggle = 5
air.fall = 0
down.velocity = -3,-7
down.hittime = 10
down.bounce = 0
getpower = 0,0

[State 0, Helper]
type = Helper
trigger1 = movehit = 1
helpertype = normal ;player
name = "CriticalHit"
ID = 9500
stateno = 9500
pos = -15,-30+floor(Enemy,Const(Size.Head.Pos.Y))
postype = p2    ;p2,front,back,left,right
facing = 0
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
size.xscale = 0.1 
size.yscale = 0.1
persistent = 0

[State 0, ChangeState]
type = DestroySelf
trigger1 = movehit
trigger2 = moveguarded 
trigger3 = FrontEdgeDist <= -20
trigger4 = BackEdgeDist <= -20


[statedef 11000]
type = S
movetype = I
physics = S
anim = 0
poweradd = -1000

[State 200, 1]
type = varadd
trigger1 = Time = 0
var(1) = 360

;This where you start taking the damage set by the helper in state 1007.
[State 0, LifeAdd]
type = LifeAdd
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
trigger1 = fvar(17) > 0
value = -floor(fvar(17))
ignorehitpause = 1

;Right after you take the damage, you IMMEDIATELY subtract the damage from fvar(10) by itself. If you want, this can also be a varset that sets it to 0.
[State 0, VarAdd]
type = VarAdd
trigger1 = var(3) > 0
trigger1 = 1
fv = 17
value = -floor(fvar(17))
ignorehitpause=  1

;This makes you invincible while the helper is out, but as the great prophets of Yu-Gi-Oh! Arc-V say: BUT YOU'LL STILL TAKE THE DAMAGE!
[State 0, NotHitBy]
type = NotHitBy
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT

[State 0, ChangeState]
type = ChangeState
trigger1 = time >= 2
value = 10000
ctrl = 1

[statedef 12000]
type = S
movetype = I
physics = S
anim = 0
poweradd = -1000

[State 200, 1]
type = varadd
trigger1 = Time = 0
var(2) = 360

;This where you start taking the damage set by the helper in state 1007.
[State 0, LifeAdd]
type = LifeAdd
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
trigger1 = fvar(17) > 0
value = -floor(fvar(17))
ignorehitpause = 1

;Right after you take the damage, you IMMEDIATELY subtract the damage from fvar(10) by itself. If you want, this can also be a varset that sets it to 0.
[State 0, VarAdd]
type = VarAdd
trigger1 = var(3) > 0
trigger1 = 1
fv = 17
value = -floor(fvar(17))
ignorehitpause=  1

;This makes you invincible while the helper is out, but as the great prophets of Yu-Gi-Oh! Arc-V say: BUT YOU'LL STILL TAKE THE DAMAGE!
[State 0, NotHitBy]
type = NotHitBy
trigger1 = var(3) > 0
trigger1 = numhelper(1006)
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT

[State 0, ChangeState]
type = ChangeState
trigger1 = time >= 2
value = 10000
ctrl = 1



