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.
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.
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: show
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
Code: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.
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
Oh yeah, I forgot that deadstate effected hookshots too and not just boomerangs.
Thanks SUCCESSOR. I'll give it a spin.
There are currently 1 users browsing this thread. (0 members and 1 guests)