- Fixed: The minimum parameter count for ACS_Execute and ACS_ExecuteAlways for
DECORATE was wrong (2 instead of 1.) - Changed: Hexen set every cluster to be a hub if it hadn't been defined before a level using this cluster. Now it will only do that if HexenHack is true, i.e. when original Hexen format MAPINFOs are parsed. For ZDoom format MAPINFOs it will now be the same as for the other games which means that 'hub' has to be declared explicitly. - Added an Idle state that is entered in place of the spawn state if a monster has to return to its inactive state if it can't find any more targets. - Added MF5_NOINTERACTION flag which completely disables all physics related code for any actor with this flag. Mostly useful for particle effects where the actors just move a certain distance and then disappear. - Removed the last remains of the antialias precalculation code from am_map.cpp because it was no longer used. - Fixed: Two-sided lines bordering a secret sector were not drawn in the proper color - Fixed: The automap didn't check ACS_LockedExecuteDoor for its lock color. SVN r876 (trunk)
This commit is contained in:
parent
799a4ea1bb
commit
d780c2e3a4
11 changed files with 424 additions and 424 deletions
721
src/p_mobj.cpp
721
src/p_mobj.cpp
|
|
@ -1432,11 +1432,12 @@ void P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly)
|
|||
mo->momx = mo->momy = mo->momz = 0;
|
||||
if (!(mo->flags2 & MF2_DORMANT))
|
||||
{
|
||||
mo->SetState (mo->SeeState != NULL ? mo->SeeState : mo->SpawnState);
|
||||
if (mo->SeeState != NULL) mo->SetState (mo->SeeState);
|
||||
else mo->SetIdle();
|
||||
}
|
||||
else
|
||||
{
|
||||
mo->SetState (mo->SpawnState);
|
||||
mo->SetIdle();
|
||||
mo->tics = -1;
|
||||
}
|
||||
}
|
||||
|
|
@ -2398,11 +2399,12 @@ bool AActor::Slam (AActor *thing)
|
|||
int dam = GetMissileDamage (7, 1);
|
||||
P_DamageMobj (thing, this, this, dam, NAME_Melee);
|
||||
P_TraceBleed (dam, thing, this);
|
||||
SetState (SeeState != NULL ? SeeState : SpawnState);
|
||||
if (SeeState != NULL) SetState (SeeState);
|
||||
else SetIdle();
|
||||
}
|
||||
else
|
||||
{
|
||||
SetState (SpawnState);
|
||||
SetIdle();
|
||||
tics = -1;
|
||||
}
|
||||
}
|
||||
|
|
@ -2542,403 +2544,417 @@ void AActor::Tick ()
|
|||
PrevY = y;
|
||||
PrevZ = z;
|
||||
|
||||
AInventory * item = Inventory;
|
||||
|
||||
// Handle powerup effects here so that the order is controlled
|
||||
// by the order in the inventory, not the order in the thinker table
|
||||
while (item != NULL && item->Owner == this)
|
||||
if (flags5 & MF5_NOINTERACTION)
|
||||
{
|
||||
item->DoEffect();
|
||||
item = item->Inventory;
|
||||
// only do the minimally necessary things here to save time.
|
||||
UnlinkFromWorld ();
|
||||
flags |= MF_NOBLOCKMAP;
|
||||
x += momx;
|
||||
y += momy;
|
||||
z += momz;
|
||||
LinkToWorld ();
|
||||
}
|
||||
|
||||
if (flags & MF_UNMORPHED)
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//Added by MC: Freeze mode.
|
||||
if (bglobal.freeze && !(player && !player->isbot))
|
||||
{
|
||||
return;
|
||||
}
|
||||
AInventory * item = Inventory;
|
||||
|
||||
// Apply freeze mode.
|
||||
if (( level.flags & LEVEL_FROZEN ) && ( player == NULL || !( player->cheats & CF_TIMEFREEZE )))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
fixed_t oldz = z;
|
||||
|
||||
// [RH] Give the pain elemental vertical friction
|
||||
// This used to be in APainElemental::Tick but in order to use
|
||||
// A_PainAttack with other monsters it has to be here!
|
||||
if (flags4 & MF4_VFRICTION)
|
||||
{
|
||||
if (health >0)
|
||||
// Handle powerup effects here so that the order is controlled
|
||||
// by the order in the inventory, not the order in the thinker table
|
||||
while (item != NULL && item->Owner == this)
|
||||
{
|
||||
if (abs (momz) < FRACUNIT/4)
|
||||
{
|
||||
momz = 0;
|
||||
flags4 &= ~MF4_VFRICTION;
|
||||
}
|
||||
else
|
||||
{
|
||||
momz = FixedMul (momz, 0xe800);
|
||||
}
|
||||
item->DoEffect();
|
||||
item = item->Inventory;
|
||||
}
|
||||
}
|
||||
|
||||
// [RH] Pulse in and out of visibility
|
||||
if (effects & FX_VISIBILITYPULSE)
|
||||
{
|
||||
if (visdir > 0)
|
||||
if (flags & MF_UNMORPHED)
|
||||
{
|
||||
alpha += 0x800;
|
||||
if (alpha >= OPAQUE)
|
||||
{
|
||||
alpha = OPAQUE;
|
||||
visdir = -1;
|
||||
}
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
alpha -= 0x800;
|
||||
if (alpha <= TRANSLUC25)
|
||||
{
|
||||
alpha = TRANSLUC25;
|
||||
visdir = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (flags & MF_STEALTH)
|
||||
{
|
||||
// [RH] Fade a stealth monster in and out of visibility
|
||||
RenderStyle.Flags &= ~STYLEF_Alpha1;
|
||||
if (visdir > 0)
|
||||
{
|
||||
alpha += 2*FRACUNIT/TICRATE;
|
||||
if (alpha > OPAQUE)
|
||||
{
|
||||
alpha = OPAQUE;
|
||||
visdir = 0;
|
||||
}
|
||||
}
|
||||
else if (visdir < 0)
|
||||
{
|
||||
alpha -= 3*FRACUNIT/TICRATE/2;
|
||||
if (alpha < 0)
|
||||
{
|
||||
alpha = 0;
|
||||
visdir = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (bglobal.botnum && consoleplayer == Net_Arbitrator && !demoplayback &&
|
||||
(flags & (MF_SPECIAL|MF_MISSILE)) || (flags3 & MF3_ISMONSTER))
|
||||
{
|
||||
clock (BotSupportCycles);
|
||||
bglobal.m_Thinking = true;
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
//Added by MC: Freeze mode.
|
||||
if (bglobal.freeze && !(player && !player->isbot))
|
||||
{
|
||||
if (!playeringame[i] || !players[i].isbot)
|
||||
continue;
|
||||
return;
|
||||
}
|
||||
|
||||
if (flags3 & MF3_ISMONSTER)
|
||||
// Apply freeze mode.
|
||||
if (( level.flags & LEVEL_FROZEN ) && ( player == NULL || !( player->cheats & CF_TIMEFREEZE )))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
fixed_t oldz = z;
|
||||
|
||||
// [RH] Give the pain elemental vertical friction
|
||||
// This used to be in APainElemental::Tick but in order to use
|
||||
// A_PainAttack with other monsters it has to be here!
|
||||
if (flags4 & MF4_VFRICTION)
|
||||
{
|
||||
if (health >0)
|
||||
{
|
||||
if (health > 0
|
||||
&& !players[i].enemy
|
||||
&& player ? !IsTeammate (players[i].mo) : true
|
||||
&& P_AproxDistance (players[i].mo->x-x, players[i].mo->y-y) < MAX_MONSTER_TARGET_DIST
|
||||
&& P_CheckSight (players[i].mo, this, 2))
|
||||
{ //Probably a monster, so go kill it.
|
||||
players[i].enemy = this;
|
||||
if (abs (momz) < FRACUNIT/4)
|
||||
{
|
||||
momz = 0;
|
||||
flags4 &= ~MF4_VFRICTION;
|
||||
}
|
||||
}
|
||||
else if (flags & MF_SPECIAL)
|
||||
{ //Item pickup time
|
||||
//clock (BotWTG);
|
||||
bglobal.WhatToGet (players[i].mo, this);
|
||||
//unclock (BotWTG);
|
||||
BotWTG++;
|
||||
}
|
||||
else if (flags & MF_MISSILE)
|
||||
{
|
||||
if (!players[i].missile && (flags3 & MF3_WARNBOT))
|
||||
{ //warn for incoming missiles.
|
||||
if (target != players[i].mo && bglobal.Check_LOS (players[i].mo, this, ANGLE_90))
|
||||
players[i].missile = this;
|
||||
else
|
||||
{
|
||||
momz = FixedMul (momz, 0xe800);
|
||||
}
|
||||
}
|
||||
}
|
||||
bglobal.m_Thinking = false;
|
||||
unclock (BotSupportCycles);
|
||||
}
|
||||
|
||||
//End of MC
|
||||
|
||||
// [RH] Consider carrying sectors here
|
||||
fixed_t cummx = 0, cummy = 0;
|
||||
if ((level.Scrolls != NULL || player != NULL) && !(flags & MF_NOCLIP) && !(flags & MF_NOSECTOR))
|
||||
{
|
||||
fixed_t height, waterheight; // killough 4/4/98: add waterheight
|
||||
const msecnode_t *node;
|
||||
int countx, county;
|
||||
|
||||
// killough 3/7/98: Carry things on floor
|
||||
// killough 3/20/98: use new sector list which reflects true members
|
||||
// killough 3/27/98: fix carrier bug
|
||||
// killough 4/4/98: Underwater, carry things even w/o gravity
|
||||
|
||||
// Move objects only if on floor or underwater,
|
||||
// non-floating, and clipped.
|
||||
|
||||
countx = county = 0;
|
||||
|
||||
for (node = touching_sectorlist; node; node = node->m_tnext)
|
||||
// [RH] Pulse in and out of visibility
|
||||
if (effects & FX_VISIBILITYPULSE)
|
||||
{
|
||||
const sector_t *sec = node->m_sector;
|
||||
fixed_t scrollx, scrolly;
|
||||
|
||||
if (level.Scrolls != NULL)
|
||||
if (visdir > 0)
|
||||
{
|
||||
const FSectorScrollValues *scroll = &level.Scrolls[sec - sectors];
|
||||
scrollx = scroll->ScrollX;
|
||||
scrolly = scroll->ScrollY;
|
||||
alpha += 0x800;
|
||||
if (alpha >= OPAQUE)
|
||||
{
|
||||
alpha = OPAQUE;
|
||||
visdir = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
scrollx = scrolly = 0;
|
||||
alpha -= 0x800;
|
||||
if (alpha <= TRANSLUC25)
|
||||
{
|
||||
alpha = TRANSLUC25;
|
||||
visdir = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (player != NULL)
|
||||
}
|
||||
else if (flags & MF_STEALTH)
|
||||
{
|
||||
// [RH] Fade a stealth monster in and out of visibility
|
||||
RenderStyle.Flags &= ~STYLEF_Alpha1;
|
||||
if (visdir > 0)
|
||||
{
|
||||
int scrolltype = sec->special & 0xff;
|
||||
alpha += 2*FRACUNIT/TICRATE;
|
||||
if (alpha > OPAQUE)
|
||||
{
|
||||
alpha = OPAQUE;
|
||||
visdir = 0;
|
||||
}
|
||||
}
|
||||
else if (visdir < 0)
|
||||
{
|
||||
alpha -= 3*FRACUNIT/TICRATE/2;
|
||||
if (alpha < 0)
|
||||
{
|
||||
alpha = 0;
|
||||
visdir = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (scrolltype >= Scroll_North_Slow &&
|
||||
scrolltype <= Scroll_SouthWest_Fast)
|
||||
{ // Hexen scroll special
|
||||
scrolltype -= Scroll_North_Slow;
|
||||
if (i_compatflags&COMPATF_RAVENSCROLL)
|
||||
{
|
||||
angle_t fineangle = HexenScrollDirs[scrolltype / 3] * 32;
|
||||
fixed_t carryspeed = DivScale32 (HexenSpeedMuls[scrolltype % 3], 32*CARRYFACTOR);
|
||||
if (bglobal.botnum && consoleplayer == Net_Arbitrator && !demoplayback &&
|
||||
(flags & (MF_SPECIAL|MF_MISSILE)) || (flags3 & MF3_ISMONSTER))
|
||||
{
|
||||
clock (BotSupportCycles);
|
||||
bglobal.m_Thinking = true;
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (!playeringame[i] || !players[i].isbot)
|
||||
continue;
|
||||
|
||||
if (flags3 & MF3_ISMONSTER)
|
||||
{
|
||||
if (health > 0
|
||||
&& !players[i].enemy
|
||||
&& player ? !IsTeammate (players[i].mo) : true
|
||||
&& P_AproxDistance (players[i].mo->x-x, players[i].mo->y-y) < MAX_MONSTER_TARGET_DIST
|
||||
&& P_CheckSight (players[i].mo, this, 2))
|
||||
{ //Probably a monster, so go kill it.
|
||||
players[i].enemy = this;
|
||||
}
|
||||
}
|
||||
else if (flags & MF_SPECIAL)
|
||||
{ //Item pickup time
|
||||
//clock (BotWTG);
|
||||
bglobal.WhatToGet (players[i].mo, this);
|
||||
//unclock (BotWTG);
|
||||
BotWTG++;
|
||||
}
|
||||
else if (flags & MF_MISSILE)
|
||||
{
|
||||
if (!players[i].missile && (flags3 & MF3_WARNBOT))
|
||||
{ //warn for incoming missiles.
|
||||
if (target != players[i].mo && bglobal.Check_LOS (players[i].mo, this, ANGLE_90))
|
||||
players[i].missile = this;
|
||||
}
|
||||
}
|
||||
}
|
||||
bglobal.m_Thinking = false;
|
||||
unclock (BotSupportCycles);
|
||||
}
|
||||
|
||||
//End of MC
|
||||
|
||||
// [RH] Consider carrying sectors here
|
||||
fixed_t cummx = 0, cummy = 0;
|
||||
if ((level.Scrolls != NULL || player != NULL) && !(flags & MF_NOCLIP) && !(flags & MF_NOSECTOR))
|
||||
{
|
||||
fixed_t height, waterheight; // killough 4/4/98: add waterheight
|
||||
const msecnode_t *node;
|
||||
int countx, county;
|
||||
|
||||
// killough 3/7/98: Carry things on floor
|
||||
// killough 3/20/98: use new sector list which reflects true members
|
||||
// killough 3/27/98: fix carrier bug
|
||||
// killough 4/4/98: Underwater, carry things even w/o gravity
|
||||
|
||||
// Move objects only if on floor or underwater,
|
||||
// non-floating, and clipped.
|
||||
|
||||
countx = county = 0;
|
||||
|
||||
for (node = touching_sectorlist; node; node = node->m_tnext)
|
||||
{
|
||||
const sector_t *sec = node->m_sector;
|
||||
fixed_t scrollx, scrolly;
|
||||
|
||||
if (level.Scrolls != NULL)
|
||||
{
|
||||
const FSectorScrollValues *scroll = &level.Scrolls[sec - sectors];
|
||||
scrollx = scroll->ScrollX;
|
||||
scrolly = scroll->ScrollY;
|
||||
}
|
||||
else
|
||||
{
|
||||
scrollx = scrolly = 0;
|
||||
}
|
||||
|
||||
if (player != NULL)
|
||||
{
|
||||
int scrolltype = sec->special & 0xff;
|
||||
|
||||
if (scrolltype >= Scroll_North_Slow &&
|
||||
scrolltype <= Scroll_SouthWest_Fast)
|
||||
{ // Hexen scroll special
|
||||
scrolltype -= Scroll_North_Slow;
|
||||
if (i_compatflags&COMPATF_RAVENSCROLL)
|
||||
{
|
||||
angle_t fineangle = HexenScrollDirs[scrolltype / 3] * 32;
|
||||
fixed_t carryspeed = DivScale32 (HexenSpeedMuls[scrolltype % 3], 32*CARRYFACTOR);
|
||||
scrollx += FixedMul (carryspeed, finecosine[fineangle]);
|
||||
scrolly += FixedMul (carryspeed, finesine[fineangle]);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Use speeds that actually match the scrolling textures!
|
||||
scrollx -= HexenScrollies[scrolltype][0] << (FRACBITS-1);
|
||||
scrolly += HexenScrollies[scrolltype][1] << (FRACBITS-1);
|
||||
}
|
||||
}
|
||||
else if (scrolltype >= Carry_East5 &&
|
||||
scrolltype <= Carry_West35)
|
||||
{ // Heretic scroll special
|
||||
scrolltype -= Carry_East5;
|
||||
BYTE dir = HereticScrollDirs[scrolltype / 5];
|
||||
fixed_t carryspeed = DivScale32 (HereticSpeedMuls[scrolltype % 5], 32*CARRYFACTOR);
|
||||
if (scrolltype<=Carry_East35 && !(i_compatflags&COMPATF_RAVENSCROLL))
|
||||
{
|
||||
// Use speeds that actually match the scrolling textures!
|
||||
carryspeed = (1 << ((scrolltype%5) + FRACBITS-1));
|
||||
}
|
||||
scrollx += carryspeed * ((dir & 3) - 1);
|
||||
scrolly += carryspeed * (((dir & 12) >> 2) - 1);
|
||||
}
|
||||
else if (scrolltype == dScroll_EastLavaDamage)
|
||||
{ // Special Heretic scroll special
|
||||
if (i_compatflags&COMPATF_RAVENSCROLL)
|
||||
{
|
||||
scrollx += DivScale32 (28, 32*CARRYFACTOR);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Use a speed that actually matches the scrolling texture!
|
||||
scrollx += DivScale32 (12, 32*CARRYFACTOR);
|
||||
}
|
||||
}
|
||||
else if (scrolltype == Scroll_StrifeCurrent)
|
||||
{ // Strife scroll special
|
||||
int anglespeed = sec->tag - 100;
|
||||
fixed_t carryspeed = DivScale32 (anglespeed % 10, 16*CARRYFACTOR);
|
||||
angle_t fineangle = (anglespeed / 10) << (32-3);
|
||||
fineangle >>= ANGLETOFINESHIFT;
|
||||
scrollx += FixedMul (carryspeed, finecosine[fineangle]);
|
||||
scrolly += FixedMul (carryspeed, finesine[fineangle]);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Use speeds that actually match the scrolling textures!
|
||||
scrollx -= HexenScrollies[scrolltype][0] << (FRACBITS-1);
|
||||
scrolly += HexenScrollies[scrolltype][1] << (FRACBITS-1);
|
||||
}
|
||||
}
|
||||
else if (scrolltype >= Carry_East5 &&
|
||||
scrolltype <= Carry_West35)
|
||||
{ // Heretic scroll special
|
||||
scrolltype -= Carry_East5;
|
||||
BYTE dir = HereticScrollDirs[scrolltype / 5];
|
||||
fixed_t carryspeed = DivScale32 (HereticSpeedMuls[scrolltype % 5], 32*CARRYFACTOR);
|
||||
if (scrolltype<=Carry_East35 && !(i_compatflags&COMPATF_RAVENSCROLL))
|
||||
{
|
||||
// Use speeds that actually match the scrolling textures!
|
||||
carryspeed = (1 << ((scrolltype%5) + FRACBITS-1));
|
||||
}
|
||||
scrollx += carryspeed * ((dir & 3) - 1);
|
||||
scrolly += carryspeed * (((dir & 12) >> 2) - 1);
|
||||
}
|
||||
else if (scrolltype == dScroll_EastLavaDamage)
|
||||
{ // Special Heretic scroll special
|
||||
if (i_compatflags&COMPATF_RAVENSCROLL)
|
||||
{
|
||||
scrollx += DivScale32 (28, 32*CARRYFACTOR);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Use a speed that actually matches the scrolling texture!
|
||||
scrollx += DivScale32 (12, 32*CARRYFACTOR);
|
||||
}
|
||||
}
|
||||
else if (scrolltype == Scroll_StrifeCurrent)
|
||||
{ // Strife scroll special
|
||||
int anglespeed = sec->tag - 100;
|
||||
fixed_t carryspeed = DivScale32 (anglespeed % 10, 16*CARRYFACTOR);
|
||||
angle_t fineangle = (anglespeed / 10) << (32-3);
|
||||
fineangle >>= ANGLETOFINESHIFT;
|
||||
scrollx += FixedMul (carryspeed, finecosine[fineangle]);
|
||||
scrolly += FixedMul (carryspeed, finesine[fineangle]);
|
||||
}
|
||||
}
|
||||
|
||||
if ((scrollx | scrolly) == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (flags & MF_NOGRAVITY &&
|
||||
(sec->heightsec == NULL || (sec->heightsec->MoreFlags & SECF_IGNOREHEIGHTSEC)))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
height = sec->floorplane.ZatPoint (x, y);
|
||||
if (z > height)
|
||||
{
|
||||
if (sec->heightsec == NULL || (sec->heightsec->MoreFlags & SECF_IGNOREHEIGHTSEC))
|
||||
if ((scrollx | scrolly) == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
waterheight = sec->heightsec->floorplane.ZatPoint (x, y);
|
||||
if (waterheight > height && z >= waterheight)
|
||||
if (flags & MF_NOGRAVITY &&
|
||||
(sec->heightsec == NULL || (sec->heightsec->MoreFlags & SECF_IGNOREHEIGHTSEC)))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
cummx += scrollx;
|
||||
cummy += scrolly;
|
||||
if (scrollx) countx++;
|
||||
if (scrolly) county++;
|
||||
}
|
||||
|
||||
// Some levels designed with Boom in mind actually want things to accelerate
|
||||
// at neighboring scrolling sector boundaries. But it is only important for
|
||||
// non-player objects.
|
||||
if (player != NULL || !(i_compatflags & COMPATF_BOOMSCROLL))
|
||||
{
|
||||
if (countx > 1)
|
||||
{
|
||||
cummx /= countx;
|
||||
}
|
||||
if (county > 1)
|
||||
{
|
||||
cummy /= county;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// [RH] If standing on a steep slope, fall down it
|
||||
if ((flags & MF_SOLID) && !(flags & (MF_NOCLIP|MF_NOGRAVITY)) &&
|
||||
!(flags & MF_NOBLOCKMAP) &&
|
||||
momz <= 0 &&
|
||||
floorz == z)
|
||||
{
|
||||
const secplane_t * floorplane = &floorsector->floorplane;
|
||||
if (floorplane->c < STEEPSLOPE &&
|
||||
floorplane->ZatPoint (x, y) <= floorz)
|
||||
{
|
||||
const msecnode_t *node;
|
||||
bool dopush = true;
|
||||
|
||||
if (floorplane->c > STEEPSLOPE*2/3)
|
||||
{
|
||||
for (node = touching_sectorlist; node; node = node->m_tnext)
|
||||
height = sec->floorplane.ZatPoint (x, y);
|
||||
if (z > height)
|
||||
{
|
||||
const sector_t *sec = node->m_sector;
|
||||
if (sec->floorplane.c >= STEEPSLOPE)
|
||||
if (sec->heightsec == NULL || (sec->heightsec->MoreFlags & SECF_IGNOREHEIGHTSEC))
|
||||
{
|
||||
if (floorplane->ZatPoint (x, y) >= z - MaxStepHeight)
|
||||
continue;
|
||||
}
|
||||
|
||||
waterheight = sec->heightsec->floorplane.ZatPoint (x, y);
|
||||
if (waterheight > height && z >= waterheight)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
cummx += scrollx;
|
||||
cummy += scrolly;
|
||||
if (scrollx) countx++;
|
||||
if (scrolly) county++;
|
||||
}
|
||||
|
||||
// Some levels designed with Boom in mind actually want things to accelerate
|
||||
// at neighboring scrolling sector boundaries. But it is only important for
|
||||
// non-player objects.
|
||||
if (player != NULL || !(i_compatflags & COMPATF_BOOMSCROLL))
|
||||
{
|
||||
if (countx > 1)
|
||||
{
|
||||
cummx /= countx;
|
||||
}
|
||||
if (county > 1)
|
||||
{
|
||||
cummy /= county;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// [RH] If standing on a steep slope, fall down it
|
||||
if ((flags & MF_SOLID) && !(flags & (MF_NOCLIP|MF_NOGRAVITY)) &&
|
||||
!(flags & MF_NOBLOCKMAP) &&
|
||||
momz <= 0 &&
|
||||
floorz == z)
|
||||
{
|
||||
const secplane_t * floorplane = &floorsector->floorplane;
|
||||
if (floorplane->c < STEEPSLOPE &&
|
||||
floorplane->ZatPoint (x, y) <= floorz)
|
||||
{
|
||||
const msecnode_t *node;
|
||||
bool dopush = true;
|
||||
|
||||
if (floorplane->c > STEEPSLOPE*2/3)
|
||||
{
|
||||
for (node = touching_sectorlist; node; node = node->m_tnext)
|
||||
{
|
||||
const sector_t *sec = node->m_sector;
|
||||
if (sec->floorplane.c >= STEEPSLOPE)
|
||||
{
|
||||
dopush = false;
|
||||
break;
|
||||
if (floorplane->ZatPoint (x, y) >= z - MaxStepHeight)
|
||||
{
|
||||
dopush = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (dopush)
|
||||
{
|
||||
momx += floorplane->a;
|
||||
momy += floorplane->b;
|
||||
if (dopush)
|
||||
{
|
||||
momx += floorplane->a;
|
||||
momy += floorplane->b;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// [RH] Missiles moving perfectly vertical need some X/Y movement, or they
|
||||
// won't hurt anything. Don't do this if damage is 0! That way, you can
|
||||
// still have missiles that go straight up and down through actors without
|
||||
// damaging anything.
|
||||
if ((flags & MF_MISSILE) && (momx|momy) == 0 && Damage != 0)
|
||||
{
|
||||
momx = 1;
|
||||
}
|
||||
|
||||
// Handle X and Y momemtums
|
||||
BlockingMobj = NULL;
|
||||
P_XYMovement (this, cummx, cummy);
|
||||
if (ObjectFlags & OF_EuthanizeMe)
|
||||
{ // actor was destroyed
|
||||
return;
|
||||
}
|
||||
if ((momx | momy) == 0 && (flags2 & MF2_BLASTED))
|
||||
{ // Reset to not blasted when momentums are gone
|
||||
flags2 &= ~MF2_BLASTED;
|
||||
}
|
||||
|
||||
if (flags2 & MF2_FLOATBOB)
|
||||
{ // Floating item bobbing motion
|
||||
z += FloatBobDiffs[(FloatBobPhase + level.maptime) & 63];
|
||||
}
|
||||
if (momz || BlockingMobj ||
|
||||
(z != floorz && (!(flags2 & MF2_FLOATBOB) ||
|
||||
(z - FloatBobOffsets[(FloatBobPhase + level.maptime) & 63] != floorz)
|
||||
)))
|
||||
{ // Handle Z momentum and gravity
|
||||
if (((flags2 & MF2_PASSMOBJ) || (flags & MF_SPECIAL)) && !(i_compatflags & COMPATF_NO_PASSMOBJ))
|
||||
// [RH] Missiles moving perfectly vertical need some X/Y movement, or they
|
||||
// won't hurt anything. Don't do this if damage is 0! That way, you can
|
||||
// still have missiles that go straight up and down through actors without
|
||||
// damaging anything.
|
||||
if ((flags & MF_MISSILE) && (momx|momy) == 0 && Damage != 0)
|
||||
{
|
||||
if (!(onmo = P_CheckOnmobj (this)))
|
||||
momx = 1;
|
||||
}
|
||||
|
||||
// Handle X and Y momemtums
|
||||
BlockingMobj = NULL;
|
||||
P_XYMovement (this, cummx, cummy);
|
||||
if (ObjectFlags & OF_EuthanizeMe)
|
||||
{ // actor was destroyed
|
||||
return;
|
||||
}
|
||||
if ((momx | momy) == 0 && (flags2 & MF2_BLASTED))
|
||||
{ // Reset to not blasted when momentums are gone
|
||||
flags2 &= ~MF2_BLASTED;
|
||||
}
|
||||
|
||||
if (flags2 & MF2_FLOATBOB)
|
||||
{ // Floating item bobbing motion
|
||||
z += FloatBobDiffs[(FloatBobPhase + level.maptime) & 63];
|
||||
}
|
||||
if (momz || BlockingMobj ||
|
||||
(z != floorz && (!(flags2 & MF2_FLOATBOB) ||
|
||||
(z - FloatBobOffsets[(FloatBobPhase + level.maptime) & 63] != floorz)
|
||||
)))
|
||||
{ // Handle Z momentum and gravity
|
||||
if (((flags2 & MF2_PASSMOBJ) || (flags & MF_SPECIAL)) && !(i_compatflags & COMPATF_NO_PASSMOBJ))
|
||||
{
|
||||
P_ZMovement (this);
|
||||
flags2 &= ~MF2_ONMOBJ;
|
||||
if (!(onmo = P_CheckOnmobj (this)))
|
||||
{
|
||||
P_ZMovement (this);
|
||||
flags2 &= ~MF2_ONMOBJ;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (player)
|
||||
{
|
||||
if (momz < (fixed_t)(level.gravity * Sector->gravity * -655.36f)
|
||||
&& !(flags&MF_NOGRAVITY))
|
||||
{
|
||||
PlayerLandedOnThing (this, onmo);
|
||||
}
|
||||
}
|
||||
if (onmo->z + onmo->height - z <= MaxStepHeight)
|
||||
{
|
||||
if (player && player->mo == this)
|
||||
{
|
||||
player->viewheight -= onmo->z + onmo->height - z;
|
||||
fixed_t deltaview = player->GetDeltaViewHeight();
|
||||
if (deltaview > player->deltaviewheight)
|
||||
{
|
||||
player->deltaviewheight = deltaview;
|
||||
}
|
||||
}
|
||||
z = onmo->z + onmo->height;
|
||||
}
|
||||
flags2 |= MF2_ONMOBJ;
|
||||
momz = 0;
|
||||
Crash();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (player)
|
||||
{
|
||||
if (momz < (fixed_t)(level.gravity * Sector->gravity * -655.36f)
|
||||
&& !(flags&MF_NOGRAVITY))
|
||||
{
|
||||
PlayerLandedOnThing (this, onmo);
|
||||
}
|
||||
}
|
||||
if (onmo->z + onmo->height - z <= MaxStepHeight)
|
||||
{
|
||||
if (player && player->mo == this)
|
||||
{
|
||||
player->viewheight -= onmo->z + onmo->height - z;
|
||||
fixed_t deltaview = player->GetDeltaViewHeight();
|
||||
if (deltaview > player->deltaviewheight)
|
||||
{
|
||||
player->deltaviewheight = deltaview;
|
||||
}
|
||||
}
|
||||
z = onmo->z + onmo->height;
|
||||
}
|
||||
flags2 |= MF2_ONMOBJ;
|
||||
momz = 0;
|
||||
Crash();
|
||||
P_ZMovement (this);
|
||||
}
|
||||
|
||||
if (ObjectFlags & OF_EuthanizeMe)
|
||||
return; // actor was destroyed
|
||||
}
|
||||
else
|
||||
else if (z <= floorz)
|
||||
{
|
||||
P_ZMovement (this);
|
||||
Crash();
|
||||
}
|
||||
|
||||
if (ObjectFlags & OF_EuthanizeMe)
|
||||
return; // actor was destroyed
|
||||
}
|
||||
else if (z <= floorz)
|
||||
{
|
||||
Crash();
|
||||
}
|
||||
UpdateWaterLevel (oldz);
|
||||
|
||||
UpdateWaterLevel (oldz);
|
||||
|
||||
// [RH] Don't advance if predicting a player
|
||||
if (player && (player->cheats & CF_PREDICTING))
|
||||
{
|
||||
return;
|
||||
// [RH] Don't advance if predicting a player
|
||||
if (player && (player->cheats & CF_PREDICTING))
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// cycle through states, calling action functions at transitions
|
||||
|
|
@ -3195,7 +3211,7 @@ AActor *AActor::StaticSpawn (const PClass *type, fixed_t ix, fixed_t iy, fixed_t
|
|||
actor->ceilingsector = actor->Sector;
|
||||
actor->ceilingpic = actor->ceilingsector->ceilingpic;
|
||||
}
|
||||
else
|
||||
else if (!(actor->flags5 & MF5_NOINTERACTION))
|
||||
{
|
||||
P_FindFloorCeiling (actor);
|
||||
actor->floorz = tmffloorz;
|
||||
|
|
@ -3206,6 +3222,16 @@ AActor *AActor::StaticSpawn (const PClass *type, fixed_t ix, fixed_t iy, fixed_t
|
|||
actor->ceilingpic = tmfceilingpic;
|
||||
actor->ceilingsector = tmfceilingsector;
|
||||
}
|
||||
else
|
||||
{
|
||||
actor->floorz = FIXED_MIN;
|
||||
actor->dropoffz = FIXED_MIN;
|
||||
actor->ceilingz = FIXED_MAX;
|
||||
actor->floorpic = 0;
|
||||
actor->floorsector = actor->Sector;
|
||||
actor->ceilingpic = 0;
|
||||
actor->ceilingsector = actor->Sector;
|
||||
}
|
||||
|
||||
actor->SpawnPoint[0] = ix >> FRACBITS;
|
||||
actor->SpawnPoint[1] = iy >> FRACBITS;
|
||||
|
|
@ -4922,6 +4948,13 @@ void AActor::Crash()
|
|||
}
|
||||
}
|
||||
|
||||
void AActor::SetIdle()
|
||||
{
|
||||
FState *idle = FindState (NAME_Idle);
|
||||
if (idle == NULL) idle = SpawnState;
|
||||
SetState(idle);
|
||||
}
|
||||
|
||||
FArchive &operator<< (FArchive &arc, FSoundIndex &snd)
|
||||
{
|
||||
if (arc.IsStoring ())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue