mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-16 01:31:30 +00:00
Adjust vertical angle and forwards/backwards of NiGHTS bumper in objectplace
This commit is contained in:
parent
f19b7bfacf
commit
18b6b53722
1 changed files with 36 additions and 0 deletions
|
@ -1194,11 +1194,47 @@ void OP_NightsObjectplace(player_t *player)
|
|||
// This places a bumper!
|
||||
if (cmd->buttons & BT_TOSSFLAG)
|
||||
{
|
||||
UINT16 vertangle = (UINT16)(player->anotherflyangle % 360);
|
||||
UINT16 newflags, newz;
|
||||
|
||||
player->pflags |= PF_ATTACKDOWN;
|
||||
if (!OP_HeightOkay(player, false))
|
||||
return;
|
||||
|
||||
mt = OP_CreateNewMapThing(player, (UINT16)mobjinfo[MT_NIGHTSBUMPER].doomednum, false);
|
||||
newz = min((mt->options >> ZSHIFT) - (mobjinfo[MT_NIGHTSBUMPER].height/4), 0);
|
||||
// height offset: from P_TouchSpecialThing case MT_NIGHTSBUMPER
|
||||
|
||||
// clockwise
|
||||
if (vertangle >= 75 && vertangle < 105) // up
|
||||
newflags = 3;
|
||||
else if (vertangle >= 105 && vertangle < 135) // 60 upward tilt
|
||||
newflags = 2;
|
||||
else if (vertangle >= 135 && vertangle < 165) // 30 upward tilt
|
||||
newflags = 1;
|
||||
//else if (vertangle >= 165 && vertangle < 195) // forward, see else case
|
||||
// newflags = 0;
|
||||
else if (vertangle >= 195 && vertangle < 225) // 30 downward tilt
|
||||
newflags = 11;
|
||||
else if (vertangle >= 225 && vertangle < 255) // 60 downward tilt
|
||||
newflags = 10;
|
||||
else if (vertangle >= 255 && vertangle < 285) // down
|
||||
newflags = 9;
|
||||
else if (vertangle >= 285 && vertangle < 315) // 60 downward tilt backwards
|
||||
newflags = 8;
|
||||
else if (vertangle >= 315 && vertangle < 345) // 30 downward tilt backwards
|
||||
newflags = 7;
|
||||
else if (vertangle >= 345 || vertangle < 15) // backwards
|
||||
newflags = 6;
|
||||
else if (vertangle >= 15 && vertangle < 45) // 30 upward tilt backwards
|
||||
newflags = 5;
|
||||
else if (vertangle >= 45 && vertangle < 75) // 60 upward tilt backwards
|
||||
newflags = 4;
|
||||
else // forward
|
||||
newflags = 0;
|
||||
|
||||
mt->options = (newz << ZSHIFT) | newflags;
|
||||
|
||||
P_SpawnMapThing(mt);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue