PK Trap glitch

The PK Trap, sometimes called a Subcharged PK Flash, is a glitch in Super Smash Bros. Melee which involves setting a "trap" using or 's PK Flash. By creating a PK Trap, it is possible to detonate PK Flash instantaneously, should he get hit out of the move.

How to perform
Ness or Kirby must initiate PK Flash while airborne then become grounded, or while grounded then become airborne. Following this, when the user enters a damage state while still charging the attack, PK Flash immediately detonates instead of flying off astray.

Explanation
Similarly to the Empty Chamber glitch, the PK Trap glitch happens because the game clears the user's set of functions that runs when taking damage prematurely.

In order to work properly, the controlling character's code checks if the projectile still exists, and if he is its current owner, while PK Flash's code checks if the owner is still in the charging state before deciding whether to 'dissolve' or to detonate.

Normally, when he takes damage, PK Flash's reference to its current owner is zeroed out, and so is the owner's reference to PK Flash. This series of actions bypasses checks in the projectile's animation function which are vital to maintaining proper communication between the two. The way it works:

1. PK Flash checks on every frame whether the user is the current and original owner and is also in the charging state of the move. Since it was not cleared upon getting hit, he still owns the projectile, but is no longer charging it, thus PK Flash enters its transition state between the charge and the explosion.

2. After another successful ownership check, the explosion is created. This can happen even before the minimum charging time of the attack is reached.

Uses
Although understandably very situational, PK Trap can work as an all-or-nothing bait against unaware opponents. By setting one up, it is possible to charge the projectile right beside the user, asserting him as an easy target, considering how much ending lag he usually suffers. However, attacking him hastily while inside the hitbox of the PK Trap can turn the situation in his favor, especially against opponents at a high percentage.

One way to escape the PK Trap just before it detonates is by grabbing and throwing the user, and using the invincibility frames gained from the action to tank the explosion.

Demonstrations

 * A demonstration of how PK Trap can be applied.


 * A short clip of the PK Trap being used to subcharge PK Flash.