mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-18 23:42:11 +00:00
Merge branch 'next' into udmf-thing-types
# Conflicts: # src/p_mobj.c
This commit is contained in:
commit
95248dc80f
10 changed files with 169 additions and 148 deletions
|
@ -29,11 +29,16 @@ void B_UpdateBotleader(player_t *player)
|
|||
{
|
||||
if (players[i].bot || players[i].playerstate != PST_LIVE || players[i].spectator || !players[i].mo)
|
||||
continue;
|
||||
if (!player->mo) //Can't do distance calculations if there's no player object, so we'll just take the first we find
|
||||
|
||||
if (!player->botleader)
|
||||
{
|
||||
player->botleader = &players[i];
|
||||
player->botleader = &players[i]; // set default
|
||||
return;
|
||||
}
|
||||
|
||||
if (!player->mo)
|
||||
return;
|
||||
|
||||
//Update best candidate based on nearest distance
|
||||
dist = R_PointToDist2(player->mo->x, player->mo->y, players[i].mo->x, players[i].mo->y);
|
||||
if (neardist > dist)
|
||||
|
|
|
@ -3763,7 +3763,7 @@ static void Command_ListWADS_f(void)
|
|||
nameonly(tempname = va("%s", wadfiles[i]->filename));
|
||||
if (!i)
|
||||
CONS_Printf("\x82 IWAD\x80: %s\n", tempname);
|
||||
else if (i <= mainwads)
|
||||
else if (i < mainwads)
|
||||
CONS_Printf("\x82 * %.2d\x80: %s\n", i, tempname);
|
||||
else if (!wadfiles[i]->important)
|
||||
CONS_Printf("\x86 %.2d: %s\n", i, tempname);
|
||||
|
|
10
src/info.c
10
src/info.c
|
@ -5198,11 +5198,11 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
0, // speed
|
||||
24*FRACUNIT, // radius
|
||||
34*FRACUNIT, // height
|
||||
0, // display offset
|
||||
1, // display offset
|
||||
DMG_FIRE, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
MF_NOGRAVITY|MF_NOBLOCKMAP|MF_FIRE|MF_PAIN, // flags
|
||||
MF_NOGRAVITY|MF_NOBLOCKMAP|MF_NOCLIPHEIGHT|MF_FIRE|MF_PAIN, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
|
@ -7977,7 +7977,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
DMG_SPIKE, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
MF_NOBLOCKMAP|MF_SCENERY|MF_NOCLIPHEIGHT, // flags
|
||||
MF_SOLID|MF_SCENERY, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
|
@ -8004,7 +8004,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
DMG_SPIKE, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
MF_NOBLOCKMAP|MF_NOGRAVITY|MF_SCENERY|MF_NOCLIPHEIGHT|MF_PAPERCOLLISION, // flags
|
||||
MF_SOLID|MF_NOGRAVITY|MF_SCENERY|MF_PAPERCOLLISION, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
|
@ -8031,7 +8031,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
4, // mass
|
||||
0, // damage
|
||||
sfx_None, // activesound
|
||||
MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIP|MF_NOCLIPTHING, // flags
|
||||
MF_NOBLOCKMAP|MF_NOGRAVITY|MF_SCENERY|MF_NOCLIP|MF_NOCLIPTHING, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
|
|
|
@ -1117,7 +1117,7 @@ int LUA_HookMusicChange(const char *oldname, struct MusicChange *param)
|
|||
lua_pushstring(gL, oldname);/* the only constant value */
|
||||
lua_pushstring(gL, param->newname);/* semi constant */
|
||||
|
||||
for (k = 0; k <= map->numHooks; ++k)
|
||||
for (k = 0; k < map->numHooks; ++k)
|
||||
{
|
||||
get_hook(&hook, map->ids, k);
|
||||
|
||||
|
|
|
@ -88,6 +88,12 @@ static int lib_finetangent(lua_State *L)
|
|||
return 1;
|
||||
}
|
||||
|
||||
static int lib_fixedasin(lua_State *L)
|
||||
{
|
||||
lua_pushangle(L, -FixedAcos(luaL_checkfixed(L, 1)) + ANGLE_90);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_fixedacos(lua_State *L)
|
||||
{
|
||||
lua_pushangle(L, FixedAcos(luaL_checkfixed(L, 1)));
|
||||
|
@ -199,6 +205,7 @@ static luaL_Reg lib_math[] = {
|
|||
{"sin", lib_finesine},
|
||||
{"cos", lib_finecosine},
|
||||
{"tan", lib_finetangent},
|
||||
{"asin", lib_fixedasin},
|
||||
{"acos", lib_fixedacos},
|
||||
{"FixedAngle", lib_fixedangle},
|
||||
{"fixangle" , lib_fixedangle},
|
||||
|
|
166
src/p_map.c
166
src/p_map.c
|
@ -1152,9 +1152,9 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
return true; // underneath
|
||||
|
||||
if (tmthing->eflags & MFE_VERTICALFLIP)
|
||||
thing->z = tmthing->z - thing->height - FixedMul(FRACUNIT, tmthing->scale);
|
||||
P_TeleportMove(thing, thing->x, thing->y, tmthing->z - thing->height - FixedMul(FRACUNIT, tmthing->scale));
|
||||
else
|
||||
thing->z = tmthing->z + tmthing->height + FixedMul(FRACUNIT, tmthing->scale);
|
||||
P_TeleportMove(thing, thing->x, thing->y, tmthing->z + tmthing->height + FixedMul(FRACUNIT, tmthing->scale));
|
||||
if (thing->flags & MF_SHOOTABLE)
|
||||
P_DamageMobj(thing, tmthing, tmthing, 1, DMG_SPIKE);
|
||||
return true;
|
||||
|
@ -1465,86 +1465,6 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
return true;
|
||||
}
|
||||
|
||||
// Sprite Spikes!
|
||||
// Do not return because solidity code comes below.
|
||||
if (tmthing->type == MT_SPIKE && tmthing->flags & MF_SOLID && thing->player) // moving spike rams into player?!
|
||||
{
|
||||
if (tmthing->eflags & MFE_VERTICALFLIP)
|
||||
{
|
||||
if (thing->z + thing->height <= tmthing->z + FixedMul(FRACUNIT, tmthing->scale)
|
||||
&& thing->z + thing->height + thing->momz >= tmthing->z + FixedMul(FRACUNIT, tmthing->scale) + tmthing->momz
|
||||
&& !(thing->player->charability == CA_BOUNCE && thing->player->panim == PA_ABILITY && thing->eflags & MFE_VERTICALFLIP))
|
||||
P_DamageMobj(thing, tmthing, tmthing, 1, DMG_SPIKE);
|
||||
}
|
||||
else if (thing->z >= tmthing->z + tmthing->height - FixedMul(FRACUNIT, tmthing->scale)
|
||||
&& thing->z + thing->momz <= tmthing->z + tmthing->height - FixedMul(FRACUNIT, tmthing->scale) + tmthing->momz
|
||||
&& !(thing->player->charability == CA_BOUNCE && thing->player->panim == PA_ABILITY && !(thing->eflags & MFE_VERTICALFLIP)))
|
||||
P_DamageMobj(thing, tmthing, tmthing, 1, DMG_SPIKE);
|
||||
}
|
||||
else if (thing->type == MT_SPIKE && thing->flags & MF_SOLID && tmthing->player) // unfortunate player falls into spike?!
|
||||
{
|
||||
if (thing->eflags & MFE_VERTICALFLIP)
|
||||
{
|
||||
if (tmthing->z + tmthing->height <= thing->z - FixedMul(FRACUNIT, thing->scale)
|
||||
&& tmthing->z + tmthing->height + tmthing->momz >= thing->z - FixedMul(FRACUNIT, thing->scale)
|
||||
&& !(tmthing->player->charability == CA_BOUNCE && tmthing->player->panim == PA_ABILITY && tmthing->eflags & MFE_VERTICALFLIP))
|
||||
P_DamageMobj(tmthing, thing, thing, 1, DMG_SPIKE);
|
||||
}
|
||||
else if (tmthing->z >= thing->z + thing->height + FixedMul(FRACUNIT, thing->scale)
|
||||
&& tmthing->z + tmthing->momz <= thing->z + thing->height + FixedMul(FRACUNIT, thing->scale)
|
||||
&& !(tmthing->player->charability == CA_BOUNCE && tmthing->player->panim == PA_ABILITY && !(tmthing->eflags & MFE_VERTICALFLIP)))
|
||||
P_DamageMobj(tmthing, thing, thing, 1, DMG_SPIKE);
|
||||
}
|
||||
|
||||
if (tmthing->type == MT_WALLSPIKE && tmthing->flags & MF_SOLID && thing->player) // wall spike impales player
|
||||
{
|
||||
fixed_t bottomz, topz;
|
||||
bottomz = tmthing->z;
|
||||
topz = tmthing->z + tmthing->height;
|
||||
if (tmthing->eflags & MFE_VERTICALFLIP)
|
||||
bottomz -= FixedMul(FRACUNIT, tmthing->scale);
|
||||
else
|
||||
topz += FixedMul(FRACUNIT, tmthing->scale);
|
||||
|
||||
if (thing->z + thing->height > bottomz // above bottom
|
||||
&& thing->z < topz) // below top
|
||||
// don't check angle, the player was clearly in the way in this case
|
||||
P_DamageMobj(thing, tmthing, tmthing, 1, DMG_SPIKE);
|
||||
}
|
||||
else if (thing->type == MT_WALLSPIKE && thing->flags & MF_SOLID && tmthing->player)
|
||||
{
|
||||
fixed_t bottomz, topz;
|
||||
angle_t touchangle = R_PointToAngle2(thing->tracer->x, thing->tracer->y, tmthing->x, tmthing->y);
|
||||
|
||||
if (P_PlayerInPain(tmthing->player) && (tmthing->momx || tmthing->momy))
|
||||
{
|
||||
angle_t playerangle = R_PointToAngle2(0, 0, tmthing->momx, tmthing->momy) - touchangle;
|
||||
if (playerangle > ANGLE_180)
|
||||
playerangle = InvAngle(playerangle);
|
||||
if (playerangle < ANGLE_90)
|
||||
return true; // Yes, this is intentionally outside the z-height check. No standing on spikes whilst moving away from them.
|
||||
}
|
||||
|
||||
bottomz = thing->z;
|
||||
topz = thing->z + thing->height;
|
||||
|
||||
if (thing->eflags & MFE_VERTICALFLIP)
|
||||
bottomz -= FixedMul(FRACUNIT, thing->scale);
|
||||
else
|
||||
topz += FixedMul(FRACUNIT, thing->scale);
|
||||
|
||||
if (tmthing->z + tmthing->height > bottomz // above bottom
|
||||
&& tmthing->z < topz // below top
|
||||
&& !P_MobjWasRemoved(thing->tracer)) // this probably wouldn't work if we didn't have a tracer
|
||||
{ // use base as a reference point to determine what angle you touched the spike at
|
||||
touchangle = thing->angle - touchangle;
|
||||
if (touchangle > ANGLE_180)
|
||||
touchangle = InvAngle(touchangle);
|
||||
if (touchangle <= ANGLE_22h) // if you touched it at this close an angle, you get poked!
|
||||
P_DamageMobj(tmthing, thing, thing, 1, DMG_SPIKE);
|
||||
}
|
||||
}
|
||||
|
||||
if (thing->flags & MF_PUSHABLE)
|
||||
{
|
||||
if (tmthing->type == MT_FAN || tmthing->type == MT_STEAM)
|
||||
|
@ -1623,6 +1543,22 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
|
||||
if (thing->player)
|
||||
{
|
||||
if (tmthing->type == MT_WALLSPIKE && (tmthing->flags & MF_SOLID)) // wall spike impales player
|
||||
{
|
||||
fixed_t bottomz, topz;
|
||||
bottomz = tmthing->z;
|
||||
topz = tmthing->z + tmthing->height;
|
||||
if (tmthing->eflags & MFE_VERTICALFLIP)
|
||||
bottomz -= FixedMul(FRACUNIT, tmthing->scale);
|
||||
else
|
||||
topz += FixedMul(FRACUNIT, tmthing->scale);
|
||||
|
||||
if (thing->z + thing->height > bottomz // above bottom
|
||||
&& thing->z < topz) // below top
|
||||
// don't check angle, the player was clearly in the way in this case
|
||||
P_DamageMobj(thing, tmthing, tmthing, 1, DMG_SPIKE);
|
||||
}
|
||||
|
||||
// Doesn't matter what gravity player's following! Just do your stuff in YOUR direction only
|
||||
if (tmthing->eflags & MFE_VERTICALFLIP
|
||||
&& (tmthing->z + tmthing->height + tmthing->momz < thing->z
|
||||
|
@ -1657,6 +1593,55 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
if (!tmthing->health)
|
||||
return true;
|
||||
|
||||
if (thing->type == MT_SPIKE && (thing->flags & MF_SOLID)) // unfortunate player falls into spike?!
|
||||
{
|
||||
if (thing->eflags & MFE_VERTICALFLIP)
|
||||
{
|
||||
if (tmthing->z + tmthing->height <= thing->z - FixedMul(FRACUNIT, thing->scale)
|
||||
&& tmthing->z + tmthing->height + tmthing->momz >= thing->z - FixedMul(FRACUNIT, thing->scale)
|
||||
&& !(tmthing->player->charability == CA_BOUNCE && tmthing->player->panim == PA_ABILITY && tmthing->eflags & MFE_VERTICALFLIP))
|
||||
P_DamageMobj(tmthing, thing, thing, 1, DMG_SPIKE);
|
||||
}
|
||||
else if (tmthing->z >= thing->z + thing->height + FixedMul(FRACUNIT, thing->scale)
|
||||
&& tmthing->z + tmthing->momz <= thing->z + thing->height + FixedMul(FRACUNIT, thing->scale)
|
||||
&& !(tmthing->player->charability == CA_BOUNCE && tmthing->player->panim == PA_ABILITY && !(tmthing->eflags & MFE_VERTICALFLIP)))
|
||||
P_DamageMobj(tmthing, thing, thing, 1, DMG_SPIKE);
|
||||
}
|
||||
|
||||
if (thing->type == MT_WALLSPIKE && (thing->flags & MF_SOLID))
|
||||
{
|
||||
fixed_t bottomz, topz;
|
||||
angle_t touchangle = R_PointToAngle2(thing->tracer->x, thing->tracer->y, tmthing->x, tmthing->y);
|
||||
|
||||
if (P_PlayerInPain(tmthing->player) && (tmthing->momx || tmthing->momy))
|
||||
{
|
||||
angle_t playerangle = R_PointToAngle2(0, 0, tmthing->momx, tmthing->momy) - touchangle;
|
||||
if (playerangle > ANGLE_180)
|
||||
playerangle = InvAngle(playerangle);
|
||||
if (playerangle < ANGLE_90)
|
||||
return true; // Yes, this is intentionally outside the z-height check. No standing on spikes whilst moving away from them.
|
||||
}
|
||||
|
||||
bottomz = thing->z;
|
||||
topz = thing->z + thing->height;
|
||||
|
||||
if (thing->eflags & MFE_VERTICALFLIP)
|
||||
bottomz -= FixedMul(FRACUNIT, thing->scale);
|
||||
else
|
||||
topz += FixedMul(FRACUNIT, thing->scale);
|
||||
|
||||
if (tmthing->z + tmthing->height > bottomz // above bottom
|
||||
&& tmthing->z < topz // below top
|
||||
&& !P_MobjWasRemoved(thing->tracer)) // this probably wouldn't work if we didn't have a tracer
|
||||
{ // use base as a reference point to determine what angle you touched the spike at
|
||||
touchangle = thing->angle - touchangle;
|
||||
if (touchangle > ANGLE_180)
|
||||
touchangle = InvAngle(touchangle);
|
||||
if (touchangle <= ANGLE_22h) // if you touched it at this close an angle, you get poked!
|
||||
P_DamageMobj(tmthing, thing, thing, 1, DMG_SPIKE);
|
||||
}
|
||||
}
|
||||
|
||||
if (thing->type == MT_FAN || thing->type == MT_STEAM)
|
||||
P_DoFanAndGasJet(thing, tmthing);
|
||||
else if (thing->flags & MF_SPRING && tmthing->player->powers[pw_carry] != CR_MINECART)
|
||||
|
@ -1721,8 +1706,8 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
}
|
||||
}
|
||||
|
||||
if ((tmthing->flags & MF_SPRING || tmthing->type == MT_STEAM || tmthing->type == MT_SPIKE || tmthing->type == MT_WALLSPIKE) && (thing->player))
|
||||
; // springs, gas jets and springs should never be able to step up onto a player
|
||||
if ((thing->player) && (tmthing->flags & MF_SPRING || tmthing->type == MT_STEAM))
|
||||
; // springs and gas jets should never be able to step up onto a player
|
||||
// z checking at last
|
||||
// Treat noclip things as non-solid!
|
||||
else if ((thing->flags & (MF_SOLID|MF_NOCLIP)) == MF_SOLID
|
||||
|
@ -1730,6 +1715,9 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
{
|
||||
fixed_t topz, tmtopz;
|
||||
|
||||
if (tmthing->type == MT_SPIKE || tmthing->type == MT_WALLSPIKE) // do not run height checks if you are a spike
|
||||
return true;
|
||||
|
||||
if (tmthing->eflags & MFE_VERTICALFLIP)
|
||||
{
|
||||
// pass under
|
||||
|
@ -2727,6 +2715,16 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
|
|||
&& P_MobjFlip(thing)*thing->momz > FixedMul(FRACUNIT, thing->scale))
|
||||
maxstep = 0;
|
||||
}
|
||||
else if (thing->flags & MF_PUSHABLE)
|
||||
{
|
||||
// If using type Section1:13, double the maxstep.
|
||||
if (GETSECSPECIAL(R_PointInSubsector(x, y)->sector->special, 1) == 13)
|
||||
maxstep <<= 1;
|
||||
|
||||
// If using type Section1:14, no maxstep.
|
||||
if (GETSECSPECIAL(R_PointInSubsector(x, y)->sector->special, 1) == 14)
|
||||
maxstep = 0;
|
||||
}
|
||||
|
||||
if (thing->type == MT_SKIM)
|
||||
maxstep = 0;
|
||||
|
|
107
src/p_mobj.c
107
src/p_mobj.c
|
@ -396,13 +396,13 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state)
|
|||
if (skin)
|
||||
{
|
||||
UINT16 stateframe = st->frame;
|
||||
|
||||
|
||||
// Add/Remove FF_SPR2SUPER based on certain conditions
|
||||
if (player->charflags & SF_NOSUPERSPRITES)
|
||||
stateframe = stateframe & ~FF_SPR2SUPER;
|
||||
else if (player->powers[pw_super])
|
||||
stateframe = stateframe | FF_SPR2SUPER;
|
||||
|
||||
|
||||
if (stateframe & FF_SPR2SUPER)
|
||||
{
|
||||
if (mobj->eflags & MFE_FORCENOSUPER)
|
||||
|
@ -410,11 +410,11 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state)
|
|||
}
|
||||
else if (mobj->eflags & MFE_FORCESUPER)
|
||||
stateframe = stateframe | FF_SPR2SUPER;
|
||||
|
||||
|
||||
// Get the sprite2 and frame number
|
||||
spr2 = P_GetSkinSprite2(skin, (stateframe & FF_FRAMEMASK), mobj->player);
|
||||
numframes = skin->sprites[spr2].numframes;
|
||||
|
||||
|
||||
if (state == S_PLAY_STND && (spr2 & FF_SPR2SUPER) && skin->sprites[SPR2_WAIT|FF_SPR2SUPER].numframes == 0)
|
||||
mobj->tics = -1; // If no super wait, don't wait at all
|
||||
}
|
||||
|
@ -542,7 +542,7 @@ boolean P_SetMobjState(mobj_t *mobj, statenum_t state)
|
|||
if (skin)
|
||||
{
|
||||
UINT16 stateframe = st->frame;
|
||||
|
||||
|
||||
// Add/Remove FF_SPR2SUPER based on certain conditions
|
||||
if (stateframe & FF_SPR2SUPER)
|
||||
{
|
||||
|
@ -551,11 +551,11 @@ boolean P_SetMobjState(mobj_t *mobj, statenum_t state)
|
|||
}
|
||||
else if (mobj->eflags & MFE_FORCESUPER)
|
||||
stateframe = stateframe | FF_SPR2SUPER;
|
||||
|
||||
|
||||
// Get the sprite2 and frame number
|
||||
spr2 = P_GetSkinSprite2(skin, (stateframe & FF_FRAMEMASK), NULL);
|
||||
numframes = skin->sprites[spr2].numframes;
|
||||
|
||||
|
||||
if (state == S_PLAY_STND && (spr2 & FF_SPR2SUPER) && skin->sprites[SPR2_WAIT|FF_SPR2SUPER].numframes == 0)
|
||||
mobj->tics = -1; // If no super wait, don't wait at all
|
||||
}
|
||||
|
@ -1878,7 +1878,7 @@ void P_XYMovement(mobj_t *mo)
|
|||
// blocked move
|
||||
moved = false;
|
||||
|
||||
if (player)
|
||||
if (player)
|
||||
B_MoveBlocked(player);
|
||||
|
||||
if (LUA_HookMobjMoveBlocked(mo, tmhitthing, blockingline))
|
||||
|
@ -3329,7 +3329,7 @@ void P_MobjCheckWater(mobj_t *mobj)
|
|||
{ // Water removes electric and non-water fire shields...
|
||||
if (electric)
|
||||
P_FlashPal(p, PAL_WHITE, 1);
|
||||
|
||||
|
||||
p->powers[pw_shield] = p->powers[pw_shield] & SH_STACK;
|
||||
}
|
||||
}
|
||||
|
@ -7062,6 +7062,8 @@ static void P_PyreFlyBurn(mobj_t *mobj, fixed_t hoffs, INT16 vrange, mobjtype_t
|
|||
fixed_t zoffs = P_RandomRange(-vrange, vrange)*FRACUNIT;
|
||||
mobj_t *particle = P_SpawnMobjFromMobj(mobj, xoffs, yoffs, zoffs, mobjtype);
|
||||
particle->momz = momz;
|
||||
particle->flags2 |= MF2_LINKDRAW;
|
||||
P_SetTarget(&particle->tracer, mobj);
|
||||
}
|
||||
|
||||
static void P_MobjScaleThink(mobj_t *mobj)
|
||||
|
@ -7858,6 +7860,36 @@ static void P_MobjSceneryThink(mobj_t *mobj)
|
|||
if (P_MobjFlip(mobj)*mobj->momz < mobj->info->speed)
|
||||
mobj->momz = P_MobjFlip(mobj)*mobj->info->speed;
|
||||
break;
|
||||
case MT_SPIKE:
|
||||
case MT_WALLSPIKE:
|
||||
if (mobj->fuse)
|
||||
{
|
||||
mobj->fuse--;
|
||||
break;
|
||||
}
|
||||
P_SetMobjState(mobj, mobj->state->nextstate);
|
||||
mobj->fuse = mobj->spawnpoint ? mobj->spawnpoint->args[0] : mobj->info->speed;
|
||||
break;
|
||||
case MT_WALLSPIKEBASE:
|
||||
if (!mobj->target)
|
||||
{
|
||||
P_RemoveMobj(mobj);
|
||||
return;
|
||||
}
|
||||
mobj->frame = (mobj->frame & ~FF_FRAMEMASK)|(mobj->target->frame & FF_FRAMEMASK);
|
||||
#if 0
|
||||
if (mobj->angle != mobj->target->angle + ANGLE_90) // reposition if not the correct angle
|
||||
{
|
||||
mobj_t* target = mobj->target; // shortcut
|
||||
const fixed_t baseradius = target->radius - (target->scale/2); //FixedMul(FRACUNIT/2, target->scale);
|
||||
P_UnsetThingPosition(mobj);
|
||||
mobj->x = target->x - P_ReturnThrustX(target, target->angle, baseradius);
|
||||
mobj->y = target->y - P_ReturnThrustY(target, target->angle, baseradius);
|
||||
P_SetThingPosition(mobj);
|
||||
mobj->angle = target->angle + ANGLE_90;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case MT_ROCKCRUMBLE1:
|
||||
case MT_ROCKCRUMBLE2:
|
||||
case MT_ROCKCRUMBLE3:
|
||||
|
@ -9363,25 +9395,6 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
|
|||
|
||||
switch (mobj->type)
|
||||
{
|
||||
case MT_WALLSPIKEBASE:
|
||||
if (!mobj->target) {
|
||||
P_RemoveMobj(mobj);
|
||||
return false;
|
||||
}
|
||||
mobj->frame = (mobj->frame & ~FF_FRAMEMASK)|(mobj->target->frame & FF_FRAMEMASK);
|
||||
#if 0
|
||||
if (mobj->angle != mobj->target->angle + ANGLE_90) // reposition if not the correct angle
|
||||
{
|
||||
mobj_t* target = mobj->target; // shortcut
|
||||
const fixed_t baseradius = target->radius - (target->scale/2); //FixedMul(FRACUNIT/2, target->scale);
|
||||
P_UnsetThingPosition(mobj);
|
||||
mobj->x = target->x - P_ReturnThrustX(target, target->angle, baseradius);
|
||||
mobj->y = target->y - P_ReturnThrustY(target, target->angle, baseradius);
|
||||
P_SetThingPosition(mobj);
|
||||
mobj->angle = target->angle + ANGLE_90;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case MT_FALLINGROCK:
|
||||
// Despawn rocks here in case zmovement code can't do so (blame slopes)
|
||||
if (!mobj->momx && !mobj->momy && !mobj->momz
|
||||
|
@ -10066,11 +10079,6 @@ static boolean P_FuseThink(mobj_t *mobj)
|
|||
break;
|
||||
case MT_METALSONIC_BATTLE:
|
||||
break; // don't remove
|
||||
case MT_SPIKE:
|
||||
case MT_WALLSPIKE:
|
||||
P_SetMobjState(mobj, mobj->state->nextstate);
|
||||
mobj->fuse = mobj->spawnpoint ? mobj->spawnpoint->args[0] : mobj->info->speed;
|
||||
break;
|
||||
case MT_NIGHTSCORE:
|
||||
P_RemoveMobj(mobj);
|
||||
return false;
|
||||
|
@ -10515,7 +10523,7 @@ static fixed_t P_DefaultMobjShadowScale (mobj_t *thing)
|
|||
|
||||
case MT_RING:
|
||||
case MT_FLINGRING:
|
||||
|
||||
|
||||
case MT_COIN:
|
||||
case MT_FLINGCOIN:
|
||||
|
||||
|
@ -13010,37 +13018,36 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj, boolean
|
|||
case MT_SPIKE:
|
||||
// Pop up spikes!
|
||||
if (mthing->args[0])
|
||||
{
|
||||
mobj->flags &= ~MF_SCENERY;
|
||||
mobj->fuse = mthing->args[1];
|
||||
}
|
||||
// Use per-thing collision for spikes unless the intangible flag is checked.
|
||||
if (!(mthing->args[2] & TMSF_INTANGIBLE) && !metalrecording)
|
||||
else
|
||||
mobj->flags |= MF_NOTHINK;
|
||||
if (mthing->args[2] & TMSF_RETRACTED)
|
||||
P_SetMobjState(mobj, mobj->info->meleestate);
|
||||
// no collision for spikes if the intangible flag is checked
|
||||
if ((mthing->args[2] & TMSF_INTANGIBLE) || metalrecording)
|
||||
{
|
||||
P_UnsetThingPosition(mobj);
|
||||
mobj->flags &= ~(MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIPHEIGHT);
|
||||
mobj->flags |= MF_SOLID;
|
||||
mobj->flags |= (MF_NOBLOCKMAP|MF_NOCLIPHEIGHT);
|
||||
mobj->flags &= ~MF_SOLID;
|
||||
P_SetThingPosition(mobj);
|
||||
}
|
||||
break;
|
||||
case MT_WALLSPIKE:
|
||||
// Pop up spikes!
|
||||
if (mthing->args[0])
|
||||
{
|
||||
mobj->flags &= ~MF_SCENERY;
|
||||
mobj->fuse = mthing->args[1];
|
||||
}
|
||||
else
|
||||
mobj->flags |= MF_NOTHINK;
|
||||
if (mthing->args[2] & TMSF_RETRACTED)
|
||||
P_SetMobjState(mobj, mobj->info->meleestate);
|
||||
// Use per-thing collision for spikes unless the intangible flag is checked.
|
||||
if (!(mthing->args[2] & TMSF_INTANGIBLE) && !metalrecording)
|
||||
// no collision for spikes if the intangible flag is checked
|
||||
if ((mthing->args[2] & TMSF_INTANGIBLE) || metalrecording)
|
||||
{
|
||||
P_UnsetThingPosition(mobj);
|
||||
mobj->flags &= ~(MF_NOBLOCKMAP|MF_NOCLIPHEIGHT);
|
||||
mobj->flags |= MF_SOLID;
|
||||
mobj->flags |= (MF_NOBLOCKMAP|MF_NOCLIPHEIGHT);
|
||||
mobj->flags &= ~MF_SOLID;
|
||||
P_SetThingPosition(mobj);
|
||||
}
|
||||
|
||||
// spawn base
|
||||
{
|
||||
const angle_t mobjangle = FixedAngle(mthing->angle << FRACBITS); // the mobj's own angle hasn't been set quite yet so...
|
||||
|
@ -13054,6 +13061,8 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj, boolean
|
|||
P_SetScale(base, mobj->scale);
|
||||
P_SetTarget(&base->target, mobj);
|
||||
P_SetTarget(&mobj->tracer, base);
|
||||
if (!mthing->args[0])
|
||||
base->flags |= MF_NOTHINK;
|
||||
}
|
||||
break;
|
||||
case MT_RING_BOX:
|
||||
|
|
|
@ -1630,7 +1630,7 @@ static void SaveMobjThinker(const thinker_t *th, const UINT8 type)
|
|||
diff2 = 0;
|
||||
|
||||
// not the default but the most probable
|
||||
if (mobj->momx != 0 || mobj->momy != 0 || mobj->momz != 0)
|
||||
if (mobj->momx != 0 || mobj->momy != 0 || mobj->momz != 0 || mobj->pmomz !=0)
|
||||
diff |= MD_MOM;
|
||||
if (mobj->radius != mobj->info->radius)
|
||||
diff |= MD_RADIUS;
|
||||
|
@ -1805,6 +1805,7 @@ static void SaveMobjThinker(const thinker_t *th, const UINT8 type)
|
|||
WRITEFIXED(save_p, mobj->momx);
|
||||
WRITEFIXED(save_p, mobj->momy);
|
||||
WRITEFIXED(save_p, mobj->momz);
|
||||
WRITEFIXED(save_p, mobj->pmomz);
|
||||
}
|
||||
if (diff & MD_RADIUS)
|
||||
WRITEFIXED(save_p, mobj->radius);
|
||||
|
@ -2798,6 +2799,7 @@ static thinker_t* LoadMobjThinker(actionf_p1 thinker)
|
|||
mobj->momx = READFIXED(save_p);
|
||||
mobj->momy = READFIXED(save_p);
|
||||
mobj->momz = READFIXED(save_p);
|
||||
mobj->pmomz = READFIXED(save_p);
|
||||
} // otherwise they're zero, and the memset took care of it
|
||||
|
||||
if (diff & MD_RADIUS)
|
||||
|
|
|
@ -12123,7 +12123,7 @@ void P_PlayerThink(player_t *player)
|
|||
player->losstime--;
|
||||
|
||||
// Flash player after being hit.
|
||||
if (player->powers[pw_flashing] > 0 && player->powers[pw_flashing] < flashingtics && (leveltime & 1))
|
||||
if (player->powers[pw_flashing] > 0 && player->powers[pw_flashing] < flashingtics && (leveltime & 1) && player->playerstate == PST_LIVE)
|
||||
player->mo->flags2 |= MF2_DONTDRAW;
|
||||
else
|
||||
player->mo->flags2 &= ~MF2_DONTDRAW;
|
||||
|
@ -12661,12 +12661,12 @@ void P_PlayerAfterThink(player_t *player)
|
|||
if (!ptera->movefactor)
|
||||
goto dropoff;
|
||||
|
||||
if (ptera->cusval >= 50)
|
||||
if (ptera->cusval >= 30)
|
||||
{
|
||||
player->powers[pw_carry] = CR_NONE;
|
||||
P_SetTarget(&player->mo->tracer, NULL);
|
||||
P_KillMobj(ptera, player->mo, player->mo, 0);
|
||||
player->mo->momz = 9*FRACUNIT;
|
||||
P_SetObjectMomZ(player->mo, 12*FRACUNIT, false);
|
||||
player->pflags |= PF_APPLYAUTOBRAKE|PF_JUMPED|PF_THOKKED;
|
||||
P_SetMobjState(player->mo, S_PLAY_ROLL);
|
||||
break;
|
||||
|
|
|
@ -2023,7 +2023,7 @@ static void Y_AwardCoopBonuses(void)
|
|||
|
||||
for (i = 0; i < MAXPLAYERS; ++i)
|
||||
{
|
||||
if (!playeringame[i] || players[i].lives < 1) // not active or game over
|
||||
if (!playeringame[i] || players[i].lives < 1 || players[i].bot == BOT_2PAI || players[i].bot == BOT_2PHUMAN) // not active, game over or tails bot
|
||||
bonusnum = 0; // all null
|
||||
else
|
||||
bonusnum = mapheaderinfo[prevmap]->bonustype + 1; // -1 is none
|
||||
|
@ -2073,7 +2073,7 @@ static void Y_AwardSpecialStageBonus(void)
|
|||
{
|
||||
oldscore = players[i].score;
|
||||
|
||||
if (!playeringame[i] || players[i].lives < 1) // not active or game over
|
||||
if (!playeringame[i] || players[i].lives < 1 || players[i].bot == BOT_2PAI || players[i].bot == BOT_2PHUMAN) // not active, game over or tails bot
|
||||
{
|
||||
Y_SetNullBonus(&players[i], &localbonuses[0]);
|
||||
Y_SetNullBonus(&players[i], &localbonuses[1]);
|
||||
|
|
Loading…
Reference in a new issue