PDA

View Full Version : Stealing the mirror shield?



Tamamo
11-17-2015, 12:36 PM
I want to make it so you can steal the mirror shield off a fancy darknut with the hookshot which in turn breaks the shield but only if you hit it from the from the front.

SUCCESSOR
11-17-2015, 04:16 PM
Is there an issue you are running into? I could script this. It doesn't seem too complicated, but I know your talents. I imagine you could aswell.

CJC
11-17-2015, 04:31 PM
Well, you're going to need to know two things:

1.) Which bit of the enemy flags refers to the Shielded (Front) flag, so that you can set the bit to 0 when the logic of the snatch succeeds.
I can't help with this, all I know is it's one of the enemy flags. I guess you might be able to find this info on Shardstorm.

2.) EXACTLY when the hookshot collides with the target, so that you can compare the LWeapon direction and ensure it is the opposite of the Darknut's (IE the enemy is facing the weapon directly).
I don't have an exact answer from this, but I have a few suggestions. First, you could define a 1-pixel border around the Darknut where you test the direction of the hookshot weapon; on a correct direction you switch the shielded enemy flag off, thereby snatching the shield away (you could also draw a tile to show the shield shattering).
Second, you could use my method of converting direction indices to a rotational modular equivalency, letting you more easily check which direction is the reverse:
-=SPOILER=-

To see if the darknut is facing the right way relative to the hookshot, you would want to store the hookshot's direction in a variable (by looking for the LWeapon type LW_HOOKSHOT [might be a different constant, don't know off the spot]), the darknut's direction in a separate variable (by checking each enemy on screen, comparing enemy # to confirm it is a darknut, and then recording its direction) and then comparing the two

if(darknut->dir == SpinDir8(ToSpinDir8(hook->Dir) + 4){
//Do the shield snatchy
}


I know this isn't everything you need to do what you want, but it should help you come up with some ideas. Then your scripting talent can fill in the rest.

Tamamo
11-17-2015, 07:43 PM
My main problem is that the hookshot should break the shield and I want the same collision as normal for darknuts. (stun them from sides and behind) but no shield stealing.
Chances are I'm going to have to script the normal hookshot block-stun behavior

SUCCESSOR
11-17-2015, 11:25 PM
My main problem is that the hookshot should break the shield and I want the same collision as normal for darknuts. (stun them from sides and behind) but no shield stealing.
Chances are I'm going to have to script the normal hookshot block-stun behavior

Well yeah, you would script the shield stealing and the shield breaking. Just detect that the hookshot was blocked by the Darknut's shield. I believe the hookshot would show WDS_BOUNCE when it hits.

Tamamo
11-18-2015, 11:49 AM
Oh yeah, I forgot that deadstate effected hookshots too and not just boomerangs.
Thanks SUCCESSOR. I'll give it a spin.