My version of projectile reflection.

Started by Bane84, January 26, 2009, 02:40:59 PM

Previous topic - Next topic

Bane84

Another topic of discussion for the SSBB project.  This reflection involves emulating the effects of things like the Franklin Badge, Pit's Mirror Shield, and the space animal's Reflector.  In the case of the SSBB core, there are three cases in which a reflection occurs:


  • The character is hit by another SSBB styled character with a Helper that acts as a projectile.
  • The character is hit by a non-SSBB styled character with a Helper that acts as a projectile.
  • The character is hit by a non-SSBB styled character with a Projectile state control.

Right now, I'm working with the Franklin Badge.  It spawns a Helper which contains a ReversalDef state control which triggers the reflection.  This is what should happen in each case:


  • The Helper projectile is p2stateno'd into a state which reverses its velocities and turns it around.  Then, it is SelfState'd back to its PrevStateNo.  The PrevStateNo is set up to work with the fact that it was reflected.
  • The Helper projectile is destroyed, and a new generic Helper projectile is created which is owned by the reflector Helper.  This will most likely happen by having the reflection Helper use a NotHitBy instead of a ReversalDef.
  • Similar to the second method, except the enemy's Projectile should destroy itself when it hits (unless it's a multi hit projectile that could potentially cause some problems).  I'm also thinking of using NumProj to perform the checking here as well.

Right now, I'm working with the first method.  The problem here is that if the player is attacking at the same time that the enemy's Helper projectile is being reflected, the player will actually start hitting the Helper projectile and mess it up.  The Helper projectile is coded to have a NotHitBy = SCA on at all times, in all states.

Also, keep in mind that the first method is preferred with SSBB styled characters so that any reflected object can maintain its animation.

What could be the cause of this issue, I wonder?

PotS

IIRC when a ReversalDef connects it always disables NotHitBy for one tick.  Best I could do was just preventing the reflected helper from turning into a clone by having its HitOverride absorb any kind of hit, not just other projectiles.
You can help with Ikemen GO's development by trying out the latest development build and reporting any bugs on GitHub.
My Mugen and Ikemen content can also be found here.

Cyanide

Does it do anything to hitby? Is there any chance that "ignorehitpause" would solve any of this?


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.