* Make maces use the x offset of their controlling linedef to set the stage in the cycle the mace should be at, instead of contributing to the tilt of the plane of the maces.
* Make the noclimb flag of the mace-controlling linedef turn the mace types that have spiked balls on the ends to also have the middles of the chain be spiked, CEZ3 style. * Partake in some refactoring. https://cdn.discordapp.com/attachments/293238104096112641/329335623250870275/srb20026.png An image of both changes in action!
This commit is contained in:
parent
e3f627120f
commit
23bdb14eda
|
@ -5206,8 +5206,8 @@ void A_MaceRotate(mobj_t *actor)
|
||||||
radius = FixedMul(actor->info->speed * actor->reactiontime, actor->target->scale);
|
radius = FixedMul(actor->info->speed * actor->reactiontime, actor->target->scale);
|
||||||
|
|
||||||
// Double the radius if the chain links are made up of maces.
|
// Double the radius if the chain links are made up of maces.
|
||||||
if (actor->target->type == MT_AXIS && (actor->type == MT_SMALLMACE || actor->type == MT_BIGMACE))
|
/*if (actor->target->type == MT_AXIS && (actor->type == MT_SMALLMACE || actor->type == MT_BIGMACE))
|
||||||
radius *= 2;
|
radius *= 2;*/
|
||||||
|
|
||||||
// Axis offset for the axis.
|
// Axis offset for the axis.
|
||||||
radius += actor->target->extravalue1;
|
radius += actor->target->extravalue1;
|
||||||
|
@ -5261,7 +5261,6 @@ void A_MaceRotate(mobj_t *actor)
|
||||||
|
|
||||||
actor->threshold += actor->target->lastlook;
|
actor->threshold += actor->target->lastlook;
|
||||||
actor->threshold &= FINEMASK;
|
actor->threshold &= FINEMASK;
|
||||||
actor->target->health &= FINEMASK;
|
|
||||||
|
|
||||||
fa = actor->threshold;
|
fa = actor->threshold;
|
||||||
v[0] = FixedMul(FINECOSINE(fa), radius);
|
v[0] = FixedMul(FINECOSINE(fa), radius);
|
||||||
|
|
77
src/p_mobj.c
77
src/p_mobj.c
|
@ -9775,10 +9775,10 @@ void P_SpawnMapThing(mapthing_t *mthing)
|
||||||
case MT_HANGMACEPOINT:
|
case MT_HANGMACEPOINT:
|
||||||
case MT_SPINMACEPOINT:
|
case MT_SPINMACEPOINT:
|
||||||
{
|
{
|
||||||
fixed_t mlength, mspeed, mxspeed, mzspeed, mstartangle, mmaxspeed;
|
fixed_t mlength, mspeed, mxspeed, mzspeed, mstartangle, mmaxspeed, movecountset, thresholdset, radiusfactor = 1;
|
||||||
mobjtype_t chainlink = MT_SMALLMACECHAIN;
|
mobjtype_t chainlink = MT_SMALLMACECHAIN;
|
||||||
mobjtype_t macetype = MT_SMALLMACE;
|
mobjtype_t macetype = MT_SMALLMACE;
|
||||||
boolean firsttime;
|
const boolean hazard = (mobj->type == MT_MACEPOINT || mobj->type == MT_SWINGMACEPOINT);
|
||||||
mobj_t *spawnee;
|
mobj_t *spawnee;
|
||||||
INT32 line;
|
INT32 line;
|
||||||
const size_t mthingi = (size_t)(mthing - mapthings);
|
const size_t mthingi = (size_t)(mthing - mapthings);
|
||||||
|
@ -9820,66 +9820,71 @@ ML_NOCLIMB : Direction not controllable
|
||||||
|
|
||||||
mobj->lastlook = mspeed << 4;
|
mobj->lastlook = mspeed << 4;
|
||||||
mobj->movecount = mobj->lastlook;
|
mobj->movecount = mobj->lastlook;
|
||||||
mobj->health = (FixedAngle(mzspeed*FRACUNIT)>>ANGLETOFINESHIFT) + (FixedAngle(mstartangle*FRACUNIT)>>ANGLETOFINESHIFT);
|
mobj->health = (FixedAngle(((mzspeed+mstartangle)%360)*FRACUNIT)>>ANGLETOFINESHIFT);
|
||||||
mobj->threshold = (FixedAngle(mxspeed*FRACUNIT)>>ANGLETOFINESHIFT) + (FixedAngle(mstartangle*FRACUNIT)>>ANGLETOFINESHIFT);
|
mobj->threshold = (FixedAngle(mstartangle*FRACUNIT)>>ANGLETOFINESHIFT);
|
||||||
mobj->movefactor = mobj->threshold;
|
mobj->movefactor = mobj->threshold;
|
||||||
mobj->friction = mmaxspeed;
|
mobj->friction = mmaxspeed;
|
||||||
|
|
||||||
if (lines[line].flags & ML_NOCLIMB)
|
|
||||||
mobj->flags |= MF_SLIDEME;
|
|
||||||
|
|
||||||
mobj->reactiontime = 0;
|
|
||||||
|
|
||||||
if (mthing->options & MTF_AMBUSH)
|
if (mthing->options & MTF_AMBUSH)
|
||||||
{
|
{
|
||||||
chainlink = MT_BIGMACECHAIN;
|
chainlink = MT_BIGMACECHAIN;
|
||||||
macetype = MT_BIGMACE;
|
macetype = MT_BIGMACE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (lines[line].flags & ML_NOCLIMB)
|
||||||
|
{
|
||||||
|
if (hazard)
|
||||||
|
{
|
||||||
|
chainlink = macetype;
|
||||||
|
radiusfactor = 2; // Double the radius.
|
||||||
|
}
|
||||||
|
else
|
||||||
|
mobj->flags |= MF_SLIDEME;
|
||||||
|
}
|
||||||
|
|
||||||
|
mobj->reactiontime = 0;
|
||||||
|
|
||||||
if (mthing->options & MTF_OBJECTSPECIAL)
|
if (mthing->options & MTF_OBJECTSPECIAL)
|
||||||
mobj->flags2 |= MF2_BOSSNOTRAP; // shut up maces.
|
mobj->flags2 |= MF2_BOSSNOTRAP; // shut up maces.
|
||||||
|
|
||||||
if (mobj->type == MT_HANGMACEPOINT || mobj->type == MT_SPINMACEPOINT)
|
if (mobj->type == MT_HANGMACEPOINT || mobj->type == MT_SWINGMACEPOINT)
|
||||||
firsttime = true;
|
movecountset = FixedAngle(mstartangle*FRACUNIT)>>ANGLETOFINESHIFT;
|
||||||
else
|
else
|
||||||
{
|
movecountset = 0;
|
||||||
firsttime = false;
|
|
||||||
|
|
||||||
|
thresholdset = FixedAngle(((mxspeed + mstartangle)%360)*FRACUNIT)>>ANGLETOFINESHIFT;
|
||||||
|
|
||||||
|
if (hazard) // outermost mace
|
||||||
|
{
|
||||||
spawnee = P_SpawnMobj(mobj->x, mobj->y, mobj->z, macetype);
|
spawnee = P_SpawnMobj(mobj->x, mobj->y, mobj->z, macetype);
|
||||||
P_SetTarget(&spawnee->target, mobj);
|
P_SetTarget(&spawnee->target, mobj);
|
||||||
|
|
||||||
if (mobj->type == MT_SWINGMACEPOINT)
|
spawnee->movecount = movecountset;
|
||||||
spawnee->movecount = FixedAngle(mstartangle*FRACUNIT)>>ANGLETOFINESHIFT;
|
spawnee->threshold = thresholdset;
|
||||||
else
|
spawnee->reactiontime = radiusfactor*(mlength+1);
|
||||||
spawnee->movecount = 0;
|
}
|
||||||
|
else if (mlength) // outermost link
|
||||||
|
{
|
||||||
|
spawnee = P_SpawnMobj(mobj->x, mobj->y, mobj->z, chainlink);
|
||||||
|
P_SetTarget(&spawnee->target, mobj);
|
||||||
|
|
||||||
spawnee->threshold = FixedAngle(mstartangle*FRACUNIT)>>ANGLETOFINESHIFT;
|
spawnee->movecount = movecountset;
|
||||||
spawnee->reactiontime = mlength+1;
|
spawnee->threshold = thresholdset;
|
||||||
|
spawnee->reactiontime = radiusfactor*(mlength--);
|
||||||
|
|
||||||
|
spawnee->flags2 |= MF2_AMBUSH;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (mlength > 0)
|
while (mlength > 0)
|
||||||
{
|
{
|
||||||
spawnee = P_SpawnMobj(mobj->x, mobj->y, mobj->z, chainlink);
|
spawnee = P_SpawnMobj(mobj->x, mobj->y, mobj->z, chainlink);
|
||||||
|
|
||||||
P_SetTarget(&spawnee->target, mobj);
|
P_SetTarget(&spawnee->target, mobj);
|
||||||
|
|
||||||
if (mobj->type == MT_HANGMACEPOINT || mobj->type == MT_SWINGMACEPOINT)
|
spawnee->movecount = movecountset;
|
||||||
spawnee->movecount = FixedAngle(mstartangle*FRACUNIT)>>ANGLETOFINESHIFT;
|
spawnee->threshold = thresholdset;
|
||||||
else
|
spawnee->reactiontime = radiusfactor*(mlength--);
|
||||||
spawnee->movecount = 0;
|
|
||||||
|
|
||||||
spawnee->threshold = FixedAngle(mstartangle*FRACUNIT)>>ANGLETOFINESHIFT;
|
|
||||||
spawnee->reactiontime = mlength;
|
|
||||||
|
|
||||||
if (firsttime)
|
|
||||||
{
|
|
||||||
// This is the outermost link in the chain
|
|
||||||
spawnee->flags2 |= MF2_AMBUSH;
|
|
||||||
firsttime = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
mlength--;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case MT_PARTICLEGEN:
|
case MT_PARTICLEGEN:
|
||||||
|
|
Loading…
Reference in New Issue