mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 20:41:46 +00:00
Merge branch 'acz_touchups' into 'master'
ACZ touchups Closes #209, #208, and #158 See merge request STJr/SRB2Internal!359
This commit is contained in:
commit
ab31cc01b4
9 changed files with 113 additions and 101 deletions
14
src/b_bot.c
14
src/b_bot.c
|
|
@ -140,6 +140,9 @@ void B_BuildTiccmd(player_t *player, ticcmd_t *cmd)
|
||||||
|
|
||||||
void B_KeysToTiccmd(mobj_t *mo, ticcmd_t *cmd, boolean forward, boolean backward, boolean left, boolean right, boolean strafeleft, boolean straferight, boolean jump, boolean spin)
|
void B_KeysToTiccmd(mobj_t *mo, ticcmd_t *cmd, boolean forward, boolean backward, boolean left, boolean right, boolean strafeleft, boolean straferight, boolean jump, boolean spin)
|
||||||
{
|
{
|
||||||
|
// don't try to do stuff if your sonic is in a minecart or something
|
||||||
|
if (players[consoleplayer].powers[pw_carry])
|
||||||
|
return;
|
||||||
// Turn the virtual keypresses into ticcmd_t.
|
// Turn the virtual keypresses into ticcmd_t.
|
||||||
if (twodlevel || mo->flags2 & MF2_TWOD) {
|
if (twodlevel || mo->flags2 & MF2_TWOD) {
|
||||||
if (players[consoleplayer].climbing
|
if (players[consoleplayer].climbing
|
||||||
|
|
@ -218,7 +221,12 @@ boolean B_CheckRespawn(player_t *player)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Low ceiling, do not want!
|
// Low ceiling, do not want!
|
||||||
if (sonic->ceilingz - sonic->z < 2*sonic->height)
|
if (sonic->eflags & MFE_VERTICALFLIP)
|
||||||
|
{
|
||||||
|
if (sonic->z - sonic->floorz < (sonic->player->exiting ? 5 : 2)*sonic->height)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else if (sonic->ceilingz - sonic->z < (sonic->player->exiting ? 6 : 3)*sonic->height)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// If you're dead, wait a few seconds to respawn.
|
// If you're dead, wait a few seconds to respawn.
|
||||||
|
|
@ -252,11 +260,11 @@ void B_RespawnBot(INT32 playernum)
|
||||||
y = sonic->y;
|
y = sonic->y;
|
||||||
if (sonic->eflags & MFE_VERTICALFLIP) {
|
if (sonic->eflags & MFE_VERTICALFLIP) {
|
||||||
tails->eflags |= MFE_VERTICALFLIP;
|
tails->eflags |= MFE_VERTICALFLIP;
|
||||||
z = sonic->z - FixedMul(512*FRACUNIT,sonic->scale);
|
z = sonic->z - (512*sonic->scale);
|
||||||
if (z < sonic->floorz)
|
if (z < sonic->floorz)
|
||||||
z = sonic->floorz;
|
z = sonic->floorz;
|
||||||
} else {
|
} else {
|
||||||
z = sonic->z + sonic->height + FixedMul(512*FRACUNIT,sonic->scale);
|
z = sonic->z + sonic->height + (512*sonic->scale);
|
||||||
if (z > sonic->ceilingz - sonic->height)
|
if (z > sonic->ceilingz - sonic->height)
|
||||||
z = sonic->ceilingz - sonic->height;
|
z = sonic->ceilingz - sonic->height;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5861,7 +5861,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
|
||||||
|
|
||||||
// Saloon door
|
// Saloon door
|
||||||
"S_SALOONDOOR",
|
"S_SALOONDOOR",
|
||||||
"S_SALOONDOORTHINKER",
|
"S_SALOONDOORCENTER",
|
||||||
|
|
||||||
// Train cameo
|
// Train cameo
|
||||||
"S_TRAINCAMEOSPAWNER_1",
|
"S_TRAINCAMEOSPAWNER_1",
|
||||||
|
|
@ -7601,7 +7601,7 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
|
||||||
"MT_MINECARTSIDEMARK",
|
"MT_MINECARTSIDEMARK",
|
||||||
"MT_MINECARTSPARK",
|
"MT_MINECARTSPARK",
|
||||||
"MT_SALOONDOOR",
|
"MT_SALOONDOOR",
|
||||||
"MT_SALOONDOORTHINKER",
|
"MT_SALOONDOORCENTER",
|
||||||
"MT_TRAINCAMEOSPAWNER",
|
"MT_TRAINCAMEOSPAWNER",
|
||||||
"MT_TRAINSEG",
|
"MT_TRAINSEG",
|
||||||
"MT_TRAINDUSTSPAWNER",
|
"MT_TRAINDUSTSPAWNER",
|
||||||
|
|
|
||||||
17
src/info.c
17
src/info.c
|
|
@ -263,7 +263,6 @@ char sprnames[NUMSPRITES + 1][5] =
|
||||||
"ADST", // Arid dust
|
"ADST", // Arid dust
|
||||||
"MCRT", // Minecart
|
"MCRT", // Minecart
|
||||||
"MCSP", // Minecart spark
|
"MCSP", // Minecart spark
|
||||||
"NON2", // Saloon door thinker
|
|
||||||
"SALD", // Saloon door
|
"SALD", // Saloon door
|
||||||
"TRAE", // Train cameo locomotive
|
"TRAE", // Train cameo locomotive
|
||||||
"TRAI", // Train cameo wagon
|
"TRAI", // Train cameo wagon
|
||||||
|
|
@ -2462,8 +2461,8 @@ state_t states[NUMSTATES] =
|
||||||
{SPR_MCSP, FF_FULLBRIGHT, 1, {A_MinecartSparkThink}, 0, 0, S_MINECARTSPARK}, // S_MINECARTSPARK
|
{SPR_MCSP, FF_FULLBRIGHT, 1, {A_MinecartSparkThink}, 0, 0, S_MINECARTSPARK}, // S_MINECARTSPARK
|
||||||
|
|
||||||
// Saloon door
|
// Saloon door
|
||||||
{SPR_SALD, 0|FF_PAPERSPRITE, -1, {NULL}, 0, 0, S_NULL}, // S_SALOONDOOR
|
{SPR_SALD, 0|FF_PAPERSPRITE, -1, {NULL}, 0, 0, S_NULL}, // S_SALOONDOOR
|
||||||
{SPR_NON2, 0, -1, {A_SaloonDoorSpawn}, 0, 0, S_NULL}, // S_SALONDOORTHINKER
|
{SPR_NULL, 0, -1, {A_SaloonDoorSpawn}, MT_SALOONDOOR, 48, S_NULL}, // S_SALOONDOORCENTER
|
||||||
|
|
||||||
// Train cameo
|
// Train cameo
|
||||||
{SPR_NULL, 0, -1, {NULL}, 0, 0, S_TRAINCAMEOSPAWNER_2}, // S_TRAINCAMEOSPAWNER_1
|
{SPR_NULL, 0, -1, {NULL}, 0, 0, S_TRAINCAMEOSPAWNER_2}, // S_TRAINCAMEOSPAWNER_1
|
||||||
|
|
@ -4780,7 +4779,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
100, // mass
|
100, // mass
|
||||||
0, // damage
|
0, // damage
|
||||||
sfx_None, // activesound
|
sfx_None, // activesound
|
||||||
MF_SCENERY|MF_PAIN|MF_NOCLIPHEIGHT|MF_NOBLOCKMAP|MF_NOGRAVITY, // flags
|
MF_SCENERY|MF_PAIN|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOBLOCKMAP|MF_NOGRAVITY, // flags
|
||||||
S_SNAPPER_LEGRAISE // raisestate
|
S_SNAPPER_LEGRAISE // raisestate
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -4807,7 +4806,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
100, // mass
|
100, // mass
|
||||||
0, // damage
|
0, // damage
|
||||||
sfx_None, // activesound
|
sfx_None, // activesound
|
||||||
MF_PAIN|MF_NOBLOCKMAP|MF_NOGRAVITY, // flags
|
MF_PAIN|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOBLOCKMAP|MF_NOGRAVITY, // flags
|
||||||
S_NULL // raisestate
|
S_NULL // raisestate
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -12199,7 +12198,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
100, // mass
|
100, // mass
|
||||||
0, // damage
|
0, // damage
|
||||||
sfx_None, // activesound
|
sfx_None, // activesound
|
||||||
MF_SOLID|MF_SHOOTABLE|MF_ENEMY|MF_PUSHABLE, // flags
|
MF_SOLID|MF_SHOOTABLE|MF_PUSHABLE, // flags
|
||||||
S_NULL // raisestate
|
S_NULL // raisestate
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -12527,9 +12526,9 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
S_NULL // raisestate
|
S_NULL // raisestate
|
||||||
},
|
},
|
||||||
|
|
||||||
{ // MT_SALOONDOORTHINKER
|
{ // MT_SALOONDOORCENTER
|
||||||
1221, // doomednum
|
1221, // doomednum
|
||||||
S_SALOONDOORTHINKER, // spawnstate
|
S_SALOONDOORCENTER, // spawnstate
|
||||||
1, // spawnhealth
|
1, // spawnhealth
|
||||||
S_NULL, // seestate
|
S_NULL, // seestate
|
||||||
sfx_None, // seesound
|
sfx_None, // seesound
|
||||||
|
|
@ -12550,7 +12549,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
100, // mass
|
100, // mass
|
||||||
0, // damage
|
0, // damage
|
||||||
sfx_None, // activesound
|
sfx_None, // activesound
|
||||||
MF_NOGRAVITY|MF_RUNSPAWNFUNC, // flags
|
MF_SOLID|MF_NOGRAVITY|MF_RUNSPAWNFUNC|MF_PAPERCOLLISION|MF_NOCLIPHEIGHT, // flags
|
||||||
S_NULL // raisestate
|
S_NULL // raisestate
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -511,7 +511,6 @@ typedef enum sprite
|
||||||
SPR_ADST, // Arid dust
|
SPR_ADST, // Arid dust
|
||||||
SPR_MCRT, // Minecart
|
SPR_MCRT, // Minecart
|
||||||
SPR_MCSP, // Minecart spark
|
SPR_MCSP, // Minecart spark
|
||||||
SPR_NON2, // Saloon door thinker
|
|
||||||
SPR_SALD, // Saloon door
|
SPR_SALD, // Saloon door
|
||||||
SPR_TRAE, // Train cameo locomotive
|
SPR_TRAE, // Train cameo locomotive
|
||||||
SPR_TRAI, // Train cameo wagon
|
SPR_TRAI, // Train cameo wagon
|
||||||
|
|
@ -2576,7 +2575,7 @@ typedef enum state
|
||||||
|
|
||||||
// Saloon door
|
// Saloon door
|
||||||
S_SALOONDOOR,
|
S_SALOONDOOR,
|
||||||
S_SALOONDOORTHINKER,
|
S_SALOONDOORCENTER,
|
||||||
|
|
||||||
// Train cameo
|
// Train cameo
|
||||||
S_TRAINCAMEOSPAWNER_1,
|
S_TRAINCAMEOSPAWNER_1,
|
||||||
|
|
@ -4338,7 +4337,7 @@ typedef enum mobj_type
|
||||||
MT_MINECARTSIDEMARK,
|
MT_MINECARTSIDEMARK,
|
||||||
MT_MINECARTSPARK,
|
MT_MINECARTSPARK,
|
||||||
MT_SALOONDOOR,
|
MT_SALOONDOOR,
|
||||||
MT_SALOONDOORTHINKER,
|
MT_SALOONDOORCENTER,
|
||||||
MT_TRAINCAMEOSPAWNER,
|
MT_TRAINCAMEOSPAWNER,
|
||||||
MT_TRAINSEG,
|
MT_TRAINSEG,
|
||||||
MT_TRAINDUSTSPAWNER,
|
MT_TRAINDUSTSPAWNER,
|
||||||
|
|
|
||||||
|
|
@ -5343,20 +5343,22 @@ static mobj_t *minus;
|
||||||
|
|
||||||
static boolean PIT_MinusCarry(mobj_t *thing)
|
static boolean PIT_MinusCarry(mobj_t *thing)
|
||||||
{
|
{
|
||||||
|
if (minus->tracer)
|
||||||
|
return true;
|
||||||
|
|
||||||
if (minus->type == thing->type)
|
if (minus->type == thing->type)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (!(thing->flags & MF_SHOOTABLE) || !(thing->flags & MF_ENEMY))
|
if (!(thing->flags & (MF_PUSHABLE|MF_ENEMY)))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (P_AproxDistance(minus->x - thing->x, minus->y - thing->y) >= minus->radius * 3)
|
if (P_AproxDistance(minus->x - thing->x, minus->y - thing->y) >= minus->radius*3)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (abs(thing->z - minus->z) > minus->height)
|
if (abs(thing->z - minus->z) > minus->height)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
P_SetTarget(&minus->tracer, thing);
|
P_SetTarget(&minus->tracer, thing);
|
||||||
minus->tracer->flags &= ~MF_PUSHABLE;
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -5420,6 +5422,9 @@ void A_MinusDigging(mobj_t *actor)
|
||||||
A_Chase(actor);
|
A_Chase(actor);
|
||||||
|
|
||||||
// Carry over shit, maybe
|
// Carry over shit, maybe
|
||||||
|
if (P_MobjWasRemoved(actor->tracer) || !actor->tracer->health)
|
||||||
|
P_SetTarget(&actor->tracer, NULL);
|
||||||
|
|
||||||
if (!actor->tracer)
|
if (!actor->tracer)
|
||||||
{
|
{
|
||||||
fixed_t radius = 3*actor->radius;
|
fixed_t radius = 3*actor->radius;
|
||||||
|
|
@ -5469,7 +5474,6 @@ void A_MinusPopup(mobj_t *actor)
|
||||||
else
|
else
|
||||||
actor->momz = 10*FRACUNIT;
|
actor->momz = 10*FRACUNIT;
|
||||||
|
|
||||||
actor->flags |= MF_SPECIAL|MF_SHOOTABLE;
|
|
||||||
S_StartSound(actor, sfx_s3k82);
|
S_StartSound(actor, sfx_s3k82);
|
||||||
for (i = 1; i <= num; i++)
|
for (i = 1; i <= num; i++)
|
||||||
{
|
{
|
||||||
|
|
@ -5482,6 +5486,7 @@ void A_MinusPopup(mobj_t *actor)
|
||||||
if (actor->tracer)
|
if (actor->tracer)
|
||||||
P_DamageMobj(actor->tracer, actor, actor, 1, 0);
|
P_DamageMobj(actor->tracer, actor, actor, 1, 0);
|
||||||
|
|
||||||
|
actor->flags = (actor->flags & ~MF_NOCLIPTHING)|MF_SPECIAL|MF_SHOOTABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Function: A_MinusCheck
|
// Function: A_MinusCheck
|
||||||
|
|
@ -13455,6 +13460,13 @@ void A_TNTExplode(mobj_t *actor)
|
||||||
if (LUA_CallAction("A_TNTExplode", actor))
|
if (LUA_CallAction("A_TNTExplode", actor))
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (actor->tracer)
|
||||||
|
{
|
||||||
|
P_SetTarget(&actor->tracer->tracer, NULL);
|
||||||
|
P_SetTarget(&actor->tracer, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
P_UnsetThingPosition(actor);
|
P_UnsetThingPosition(actor);
|
||||||
if (sector_list)
|
if (sector_list)
|
||||||
{
|
{
|
||||||
|
|
@ -13668,8 +13680,6 @@ void A_KillSegments(mobj_t *actor)
|
||||||
static void P_SnapperLegPlace(mobj_t *mo)
|
static void P_SnapperLegPlace(mobj_t *mo)
|
||||||
{
|
{
|
||||||
mobj_t *seg = mo->tracer;
|
mobj_t *seg = mo->tracer;
|
||||||
fixed_t x0 = mo->x;
|
|
||||||
fixed_t y0 = mo->y;
|
|
||||||
angle_t a = mo->angle;
|
angle_t a = mo->angle;
|
||||||
angle_t fa = (a >> ANGLETOFINESHIFT) & FINEMASK;
|
angle_t fa = (a >> ANGLETOFINESHIFT) & FINEMASK;
|
||||||
fixed_t c = FINECOSINE(fa);
|
fixed_t c = FINECOSINE(fa);
|
||||||
|
|
@ -13684,7 +13694,8 @@ static void P_SnapperLegPlace(mobj_t *mo)
|
||||||
fixed_t rad = mo->radius;
|
fixed_t rad = mo->radius;
|
||||||
INT32 necklen = (32*(mo->info->reactiontime - mo->reactiontime))/mo->info->reactiontime; // Not in FU
|
INT32 necklen = (32*(mo->info->reactiontime - mo->reactiontime))/mo->info->reactiontime; // Not in FU
|
||||||
|
|
||||||
P_TeleportMove(seg, mo->x + FixedMul(c, rad) + necklen*c, mo->y + FixedMul(s, rad) + necklen*s, mo->z + mo->height/3);
|
seg->z = mo->z + ((mo->eflags & MFE_VERTICALFLIP) ? (((mo->height<<1)/3) - seg->height) : mo->height/3);
|
||||||
|
P_TryMove(seg, mo->x + FixedMul(c, rad) + necklen*c, mo->y + FixedMul(s, rad) + necklen*s, true);
|
||||||
seg->angle = a;
|
seg->angle = a;
|
||||||
|
|
||||||
// Move as many legs as available.
|
// Move as many legs as available.
|
||||||
|
|
@ -13704,13 +13715,14 @@ static void P_SnapperLegPlace(mobj_t *mo)
|
||||||
{
|
{
|
||||||
x = c*o2 + s*o1;
|
x = c*o2 + s*o1;
|
||||||
y = s*o2 - c*o1;
|
y = s*o2 - c*o1;
|
||||||
P_TryMove(seg, x0 + x, y0 + y, true);
|
seg->z = mo->z + (((mo->eflags & MFE_VERTICALFLIP) ? (mo->height - seg->height) : 0));
|
||||||
|
P_TryMove(seg, mo->x + x, mo->y + y, true);
|
||||||
P_SetMobjState(seg, seg->info->raisestate);
|
P_SetMobjState(seg, seg->info->raisestate);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
P_SetMobjState(seg, seg->info->spawnstate);
|
P_SetMobjState(seg, seg->info->spawnstate);
|
||||||
|
|
||||||
seg->angle = R_PointToAngle2(x0, y0, seg->x, seg->y);
|
seg->angle = R_PointToAngle2(mo->x, mo->y, seg->x, seg->y);
|
||||||
|
|
||||||
seg = seg->tracer;
|
seg = seg->tracer;
|
||||||
} while (seg);
|
} while (seg);
|
||||||
|
|
@ -13738,14 +13750,14 @@ void A_SnapperSpawn(mobj_t *actor)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// It spawns 1 head.
|
// It spawns 1 head.
|
||||||
seg = P_SpawnMobj(actor->x, actor->y, actor->z, headtype);
|
seg = P_SpawnMobjFromMobj(actor, 0, 0, 0, headtype);
|
||||||
P_SetTarget(&ptr->tracer, seg);
|
P_SetTarget(&ptr->tracer, seg);
|
||||||
ptr = seg;
|
ptr = seg;
|
||||||
|
|
||||||
// It spawns 4 legs which will be handled in the thinker function.
|
// It spawns 4 legs which will be handled in the thinker function.
|
||||||
for (i = 1; i <= 4; i++)
|
for (i = 1; i <= 4; i++)
|
||||||
{
|
{
|
||||||
seg = P_SpawnMobj(actor->x, actor->y, actor->z, legtype);
|
seg = P_SpawnMobjFromMobj(actor, 0, 0, 0, legtype);
|
||||||
P_SetTarget(&ptr->tracer, seg);
|
P_SetTarget(&ptr->tracer, seg);
|
||||||
ptr = seg;
|
ptr = seg;
|
||||||
|
|
||||||
|
|
@ -13893,51 +13905,43 @@ void A_SnapperThinker(mobj_t *actor)
|
||||||
//
|
//
|
||||||
// Description: Spawns a saloon door.
|
// Description: Spawns a saloon door.
|
||||||
//
|
//
|
||||||
// var1 = unused
|
// var1 = mobjtype for sides
|
||||||
// var2 = unused
|
// var2 = distance sides should be placed apart
|
||||||
//
|
//
|
||||||
void A_SaloonDoorSpawn(mobj_t *actor)
|
void A_SaloonDoorSpawn(mobj_t *actor)
|
||||||
{
|
{
|
||||||
|
INT32 locvar1 = var1;
|
||||||
|
INT32 locvar2 = var2;
|
||||||
angle_t ang = actor->angle;
|
angle_t ang = actor->angle;
|
||||||
angle_t fa = (ang >> ANGLETOFINESHIFT) & FINEMASK;
|
angle_t fa = (ang >> ANGLETOFINESHIFT) & FINEMASK;
|
||||||
fixed_t c = FINECOSINE(fa);
|
fixed_t c = FINECOSINE(fa)*locvar2;
|
||||||
fixed_t s = FINESINE(fa);
|
fixed_t s = FINESINE(fa)*locvar2;
|
||||||
INT32 d = 48;
|
|
||||||
fixed_t x = actor->x;
|
|
||||||
fixed_t y = actor->y;
|
|
||||||
fixed_t z = actor->z;
|
|
||||||
mobj_t *door;
|
mobj_t *door;
|
||||||
|
mobjflag2_t ambush = (actor->flags & MF2_AMBUSH);
|
||||||
|
|
||||||
#ifdef HAVE_BLUA
|
#ifdef HAVE_BLUA
|
||||||
if (LUA_CallAction("A_SaloonDoorSpawn", actor))
|
if (LUA_CallAction("A_SaloonDoorSpawn", actor))
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//Front
|
if (!locvar1)
|
||||||
door = P_SpawnMobj(x + c*d, y + s*d, z, MT_SALOONDOOR);
|
return;
|
||||||
|
|
||||||
|
// One door...
|
||||||
|
if (!(door = P_SpawnMobjFromMobj(actor, c, s, 0, locvar1))) return;
|
||||||
door->angle = ang + ANGLE_180;
|
door->angle = ang + ANGLE_180;
|
||||||
|
door->extravalue1 = AngleFixed(door->angle); // Origin angle
|
||||||
|
door->extravalue2 = 0; // Angular speed
|
||||||
|
P_SetTarget(&door->tracer, actor); // Origin door
|
||||||
|
door->flags2 |= ambush; // Can be opened by normal players?
|
||||||
|
|
||||||
// Origin angle
|
// ...two door!
|
||||||
door->extravalue1 = AngleFixed(door->angle);
|
if (!(door = P_SpawnMobjFromMobj(actor, -c, -s, 0, locvar1))) return;
|
||||||
|
|
||||||
// Angular speed
|
|
||||||
door->extravalue2 = 0;
|
|
||||||
|
|
||||||
// Origin door
|
|
||||||
P_SetTarget(&door->tracer, actor);
|
|
||||||
|
|
||||||
//Back
|
|
||||||
door = P_SpawnMobj(x - c*d, y - s*d, z, MT_SALOONDOOR);
|
|
||||||
door->angle = ang;
|
door->angle = ang;
|
||||||
|
door->extravalue1 = AngleFixed(door->angle); // Origin angle
|
||||||
// Origin angle
|
door->extravalue2 = 0; // Angular speed
|
||||||
door->extravalue1 = AngleFixed(door->angle);
|
P_SetTarget(&door->tracer, actor); // Origin door
|
||||||
|
door->flags2 |= ambush; // Can be opened by normal players?
|
||||||
// Angular speed
|
|
||||||
door->extravalue2 = 0;
|
|
||||||
|
|
||||||
// Origin door
|
|
||||||
P_SetTarget(&door->tracer, actor);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Function: A_MinecartSparkThink
|
// Function: A_MinecartSparkThink
|
||||||
|
|
|
||||||
|
|
@ -1765,7 +1765,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case MT_MINECARTSPAWNER:
|
case MT_MINECARTSPAWNER:
|
||||||
if (!special->fuse || player->powers[pw_carry] != CR_MINECART)
|
if (!player->bot && (special->fuse < TICRATE || player->powers[pw_carry] != CR_MINECART))
|
||||||
{
|
{
|
||||||
mobj_t *mcart = P_SpawnMobj(special->x, special->y, special->z, MT_MINECART);
|
mobj_t *mcart = P_SpawnMobj(special->x, special->y, special->z, MT_MINECART);
|
||||||
P_SetTarget(&mcart->target, toucher);
|
P_SetTarget(&mcart->target, toucher);
|
||||||
|
|
@ -1775,7 +1775,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||||
P_ResetPlayer(player);
|
P_ResetPlayer(player);
|
||||||
player->pflags |= PF_JUMPDOWN;
|
player->pflags |= PF_JUMPDOWN;
|
||||||
player->powers[pw_carry] = CR_MINECART;
|
player->powers[pw_carry] = CR_MINECART;
|
||||||
toucher->player->pflags &= ~PF_APPLYAUTOBRAKE;
|
player->pflags &= ~PF_APPLYAUTOBRAKE;
|
||||||
P_SetTarget(&toucher->tracer, mcart);
|
P_SetTarget(&toucher->tracer, mcart);
|
||||||
toucher->momx = toucher->momy = toucher->momz = 0;
|
toucher->momx = toucher->momy = toucher->momz = 0;
|
||||||
|
|
||||||
|
|
|
||||||
79
src/p_map.c
79
src/p_map.c
|
|
@ -604,6 +604,34 @@ static void P_SlapStick(mobj_t *fang, mobj_t *pole)
|
||||||
P_SetTarget(&pole->tracer, NULL);
|
P_SetTarget(&pole->tracer, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void P_PlayerBarrelCollide(mobj_t *toucher, mobj_t *barrel)
|
||||||
|
{
|
||||||
|
if (toucher->momz < 0)
|
||||||
|
{
|
||||||
|
if (toucher->z + toucher->momz > barrel->z + barrel->height)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (toucher->z > barrel->z + barrel->height)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (toucher->momz > 0)
|
||||||
|
{
|
||||||
|
if (toucher->z + toucher->height + toucher->momz < barrel->z)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (toucher->z + toucher->height < barrel->z)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (P_PlayerCanDamage(toucher->player, barrel))
|
||||||
|
P_DamageMobj(barrel, toucher, toucher, 1, 0);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// PIT_CheckThing
|
// PIT_CheckThing
|
||||||
//
|
//
|
||||||
|
|
@ -872,12 +900,11 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
||||||
|
|
||||||
if (thing->type == MT_SALOONDOOR && tmthing->player)
|
if (thing->type == MT_SALOONDOOR && tmthing->player)
|
||||||
{
|
{
|
||||||
if (tmthing->player->powers[pw_carry] == CR_MINECART && tmthing->tracer && !P_MobjWasRemoved(tmthing->tracer) && tmthing->tracer->health)
|
mobj_t *ref = (tmthing->player->powers[pw_carry] == CR_MINECART && tmthing->tracer && !P_MobjWasRemoved(tmthing->tracer)) ? tmthing->tracer : tmthing;
|
||||||
|
if ((thing->flags & MF2_AMBUSH) || ref != tmthing)
|
||||||
{
|
{
|
||||||
fixed_t dx = tmthing->tracer->momx;
|
fixed_t dm = min(FixedHypot(ref->momx, ref->momy), 16*FRACUNIT);
|
||||||
fixed_t dy = tmthing->tracer->momy;
|
angle_t ang = R_PointToAngle2(0, 0, ref->momx, ref->momy) - thing->angle;
|
||||||
fixed_t dm = min(FixedHypot(dx, dy), 16*FRACUNIT);
|
|
||||||
angle_t ang = R_PointToAngle2(0, 0, dx, dy) - thing->angle;
|
|
||||||
fixed_t s = FINESINE((ang >> ANGLETOFINESHIFT) & FINEMASK);
|
fixed_t s = FINESINE((ang >> ANGLETOFINESHIFT) & FINEMASK);
|
||||||
S_StartSound(tmthing, thing->info->activesound);
|
S_StartSound(tmthing, thing->info->activesound);
|
||||||
thing->extravalue2 += 2*FixedMul(s, dm)/3;
|
thing->extravalue2 += 2*FixedMul(s, dm)/3;
|
||||||
|
|
@ -885,41 +912,15 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (thing->type == MT_TNTBARREL && tmthing->player)
|
if (thing->type == MT_SALOONDOORCENTER && tmthing->player)
|
||||||
{
|
{
|
||||||
if (tmthing->momz < 0)
|
if ((thing->flags & MF2_AMBUSH) || (tmthing->player->powers[pw_carry] == CR_MINECART && tmthing->tracer && !P_MobjWasRemoved(tmthing->tracer)))
|
||||||
{
|
return true;
|
||||||
if (tmthing->z + tmthing->momz > thing->z + thing->height)
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (tmthing->z > thing->z + thing->height)
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tmthing->momz > 0)
|
|
||||||
{
|
|
||||||
if (tmthing->z + tmthing->height + tmthing->momz < thing->z)
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (tmthing->z + tmthing->height < thing->z)
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((tmthing->player->pflags & (PF_SPINNING | PF_GLIDING))
|
|
||||||
|| ((tmthing->player->pflags & PF_JUMPED)
|
|
||||||
&& (!(tmthing->player->pflags & PF_NOJUMPDAMAGE)
|
|
||||||
|| (tmthing->player->charability == CA_TWINSPIN && tmthing->player->panim == PA_ABILITY)))
|
|
||||||
|| (tmthing->player->charability2 == CA2_MELEE && tmthing->player->panim == PA_ABILITY2)
|
|
||||||
|| ((tmthing->player->charflags & SF_STOMPDAMAGE || tmthing->player->pflags & PF_BOUNCING)
|
|
||||||
&& (P_MobjFlip(tmthing)*(tmthing->z - (thing->z + thing->height / 2)) > 0) && (P_MobjFlip(tmthing)*tmthing->momz < 0))
|
|
||||||
|| (((tmthing->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL || (tmthing->player->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP) && (tmthing->player->pflags & PF_SHIELDABILITY)))
|
|
||||||
P_DamageMobj(thing, tmthing, tmthing, 1, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (thing->type == MT_TNTBARREL && tmthing->player)
|
||||||
|
P_PlayerBarrelCollide(tmthing, thing);
|
||||||
|
|
||||||
if (thing->type == MT_VULTURE && tmthing->type == MT_VULTURE)
|
if (thing->type == MT_VULTURE && tmthing->type == MT_VULTURE)
|
||||||
{
|
{
|
||||||
fixed_t dx = thing->x - tmthing->x;
|
fixed_t dx = thing->x - tmthing->x;
|
||||||
|
|
@ -1560,8 +1561,8 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((!tmthing->player) && (thing->player))
|
if ((tmthing->flags & MF_SPRING || tmthing->type == MT_STEAM) && (thing->player))
|
||||||
; // no solid thing should ever be able to step up onto a player
|
; // springs and gas jets should never be able to step up onto a player
|
||||||
// z checking at last
|
// z checking at last
|
||||||
// Treat noclip things as non-solid!
|
// Treat noclip things as non-solid!
|
||||||
else if ((thing->flags & (MF_SOLID|MF_NOCLIP)) == MF_SOLID
|
else if ((thing->flags & (MF_SOLID|MF_NOCLIP)) == MF_SOLID
|
||||||
|
|
|
||||||
|
|
@ -9915,6 +9915,7 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
|
||||||
}
|
}
|
||||||
case MT_TNTBARREL:
|
case MT_TNTBARREL:
|
||||||
mobj->momx = 1; //stack hack
|
mobj->momx = 1; //stack hack
|
||||||
|
mobj->flags2 |= MF2_INVERTAIMABLE;
|
||||||
break;
|
break;
|
||||||
case MT_MINECARTEND:
|
case MT_MINECARTEND:
|
||||||
P_SetTarget(&mobj->tracer, P_SpawnMobjFromMobj(mobj, 0, 0, 0, MT_MINECARTENDSOLID));
|
P_SetTarget(&mobj->tracer, P_SpawnMobjFromMobj(mobj, 0, 0, 0, MT_MINECARTENDSOLID));
|
||||||
|
|
|
||||||
|
|
@ -8855,7 +8855,7 @@ void P_NukeEnemies(mobj_t *inflictor, mobj_t *source, fixed_t radius)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (mo->type == MT_MINUS && !(mo->flags & (MF_SPECIAL|MF_SHOOTABLE)))
|
if (mo->type == MT_MINUS && !(mo->flags & (MF_SPECIAL|MF_SHOOTABLE)))
|
||||||
mo->flags |= MF_SPECIAL|MF_SHOOTABLE;
|
mo->flags = (mo->flags & ~MF_NOCLIPTHING)|MF_SPECIAL|MF_SHOOTABLE;
|
||||||
|
|
||||||
if (mo->type == MT_EGGGUARD && mo->tracer) //nuke Egg Guard's shield!
|
if (mo->type == MT_EGGGUARD && mo->tracer) //nuke Egg Guard's shield!
|
||||||
P_KillMobj(mo->tracer, inflictor, source, DMG_NUKE);
|
P_KillMobj(mo->tracer, inflictor, source, DMG_NUKE);
|
||||||
|
|
@ -10254,7 +10254,7 @@ static sector_t *P_GetMinecartSector(fixed_t x, fixed_t y, fixed_t z, fixed_t *n
|
||||||
ffloor_t *rover;
|
ffloor_t *rover;
|
||||||
for (rover = sec->ffloors; rover; rover = rover->next)
|
for (rover = sec->ffloors; rover; rover = rover->next)
|
||||||
{
|
{
|
||||||
if (!(rover->flags & FF_EXISTS))
|
if (!(rover->flags & (FF_EXISTS|FF_BLOCKOTHERS)))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
*nz = *rover->t_slope ? P_GetZAt(*rover->t_slope, x, y) : *rover->topheight;
|
*nz = *rover->t_slope ? P_GetZAt(*rover->t_slope, x, y) : *rover->topheight;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue