YesNoOk
avatar

Projectile Reversal (Read 800 times)

Started by zzazman, February 05, 2021, 11:19:29 PM
Share this topic:
Projectile Reversal
#1  February 05, 2021, 11:19:29 PM
  • avatar
I'm doing an edit of REDHOT's Felicia, and I want to give her a level 1 ground/air super that allows her to counter physical attacks (normals, specials, hypers), as well as projectiles (NSH).
So when she does the super, she stands there for a sec, and if she gets hit, a lightning bolt is supposed to instantly strike the opponent and deal a small amount of damage.
I used ReversalDef for physical attacks, which works fine. But obviously, it doesn't work with projectiles.
Any advice on how to go about this? I've already tried HitOverride, with no success.

Here's the code:

;---------------------------------------------------------------------------
;Please Help Me GOD
[Statedef 2200]
type    = S
movetype= A
physics = N
velset = 0,0
juggle = 0
sprpriority = 6
anim = 2200
ctrl = 0

[State 3000, VarSet]; this variable is for the super background
type = VarSet
trigger1 = animelem = 1
var(4) = 1

[State 3000, VarSet]
type = VarSet
trigger1 = time = 60
var(4) = 0

[State 3000, Explod]; SUPER Dust
type = Explod
trigger1 = animelem = 2
anim = 8300
id = 8300
scale = .5,.5
supermove = 1
sprpriority = 4
ownpal = 1

[State 440, 2];Onegai!
type = PlaySnd
trigger1 = animelem = 1
value = 3,11
volume = 255
volumescale = 255
channel = 0

[State 3000, Helper]; Super FX
type = Helper
trigger1 = animelem = 1
stateno = 8500
supermovetime = 99999999
pos = 0,ceil(-70*const(size.yscale))
ownpal = 1
id = 8500

[State 3000, SuperPause]
type = SuperPause
trigger1 = animelem = 1
time = 36
movetime = 36
darken = 1
anim = -1
p2defmul = 1
poweradd = -1000

[State 2200, ReversalDef]
type = ReversalDef
trigger1 = time = 0
reversal.attr = SCA, NA, SA, HA, NP, SP, HP
pausetime = 0,25
sparkxy = 0,0 ;offset
hitsound = S1,0
p1stateno = 2201
;p2stateno =
ignorehitpause = 1
persistent = 0

[State 0, Shield]; this is the invisible projectile I'm using to absorb incoming projectiles
type = Projectile
trigger1 = time = 0
hitflag = P
ProjID = 777
projanim = 777
projhitanim = 777
projremanim = 777
projcancelanim = 777
projscale = 1,1
projremove = 1
projremovetime = 46
velocity = 0,0
remvelocity = 0,0
accel = 0,0
velmul = 0,0
projhits = 1
projpriority = 7
projsprpriority = 3
projedgebound = 40
projstagebound = 40
projheightbound = -240,-240
offset = 0,0
postype = p1         ;p2,front,back,left,right
projshadow = 0,0,0
supermovetime = 0
pausemovetime = 0
p1stateno = 2201
ignorehitpause = 1
trigger1 = time = 0 ; this part is the start of the projectile's hitdef, not sure if this is what I should be doing
attr = SCA,HP        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
affectteam = E          ;B,E,F
p1stateno = 2201
ignorehitpause = 1
persistent = 0

[State 2200, HitOverride]; in case there were issues with projectiles that are coded as helpers
type = HitOverride
trigger1 = ProjContact777 = 1
attr = SCA, AA, AP    ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
slot = 0
stateno = 2201
time = -1
forceair = 0
ignorehitpause = 1
persistent = 0


[State 8500, Explod]
type = Explod
trigger1 = time = 37
trigger2 = time > 37 && root,var(4) = 1 && !numexplod(8505)
anim = 8505
id = 8505
postype = left
bindtime = -1
removetime = 60
scale = .5,.5*fvar(1)
sprpriority = -3
ownpal = 1

[state 2200]
type = VelSet
trigger1 = Statetype = A
trigger1 = anim = 2200
trigger1 = time = 37
y = .77

[state 2200]
type = VelSet
trigger1 = anim = 42
trigger1 = time = 1
y = .66

[State 9];?????I??
type = Changestate
trigger1 = StateType = S
trigger1 = animtime = 0
value = 0
ctrl = 1

[state 2200]
type = statetypeset
trigger1 = pos Y < 0
statetype = A
physics = N

[State 9];?????I??
type = Changeanim
trigger1 = StateType = A
trigger1 = animtime = 0
value = 42
persistent = 0

[state 2200]
type = statetypeset
trigger1 = anim = 42
physics = A

;-------------------------------------------------------------
;Super Counter Hit (Lightning)
[Statedef 2201]
type    = S
movetype= A
physics = N
velset = 0,0
juggle = 0
sprpriority = 6
anim = 2201
ctrl = 0

[State 2201]
type = playSnd
trigger1 = time = 1
value = 2600,0
channel = 1

[State 0, Projectile]; the Lightning Bolt
type = Projectile
trigger1 = time = 1
ProjID = 7777
projanim = 7777
projhitanim = 7777
projscale = 1,3
projremove = 1
projremovetime = 12
projhits = 1
projpriority = 7
projsprpriority = 7
projedgebound = 40
projstagebound = 40
projheightbound = -240,0;-240
offset = 0,0
postype = p2         ;p2,front,back,left,right
projshadow = 0,0,0
supermovetime = 0
pausemovetime = 0
persistent =0
attr = S,SP        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
hitflag = MAF        ;HLAFD+-
guardflag = MA
getpower = 0,0
givepower = 70,0
affectteam = E          ;B,E,F
animtype = hard          ;light,medium,hard,back,up,diagup
air.animtype = hard
fall.animtype = Back
priority = 7,Hit   ;Hit,Miss,Dodge
damage = 70,0 ; it's instant and it locks on, so this is only fair
pausetime = 0,17
ground.type = High      ;Low,Trip,None
air.type = High
ground.slidetime = 20
guard.slidetime = 20
ground.hittime = 20
guard.hittime = 20
air.hittime = 20
ground.velocity = -7,-7
guard.velocity = 0
air.velocity = -7,-7
airguard.velocity = 0,0
fall = 1
ignorehitpause = 1
persistent =0
kill = 0; I think it's OP to be able to sit on meter against a low hp opponent and wait for them to attack just so you can

[State 3000, VarSet]
type = VarSet
trigger1 = time = 13
var(4) = 0

[state 2200]
type = statetypeset
trigger1 = pos Y < 0
statetype = A
physics = N

[State 9];?????I??
type = Changeanim
trigger1 = StateType = A
trigger1 = animtime = 0
value = 42

[state 2200]
type = statetypeset
trigger1 = anim = 42
physics = A

[State 2201]
type = ChangeState
trigger1 = animtime = 0
value = 0
ctrl = 1
Re: Projectile Reversal
#2  February 05, 2021, 11:40:42 PM
  • ****
  • CPU Purple Heart
    • USA
    • www.dailymotion.com/2a8130871d2742d2f4da3b069

  • Online
 Projectile state controllers are completely immune to reversaldefs. You'll have to also include a hitoverride to deal with those. Specifically, have both a reversaldef and hitoverride active simultaneously.
Re: Projectile Reversal
#3  February 06, 2021, 09:55:03 AM
  • avatar
I tried using both, but for some reason, it wasn't working. Using hitoverride by itself seems to work well enough, though. Thanks!