Merge remote-tracking branch 'refs/remotes/origin/gameplay-tweaks' into battle

# Conflicts:
#	src/p_mobj.c
This commit is contained in:
TehRealSalt 2017-11-06 17:44:32 -05:00
commit 7eb9f56741
2 changed files with 80 additions and 73 deletions

View file

@ -1982,12 +1982,29 @@ static mobj_t *K_SpawnKartMissile(mobj_t *source, mobjtype_t type, angle_t angle
x = source->x + source->momx;
y = source->y + source->momy;
z = source->z + source->height/3;
z = source->z; // spawn on the ground please
if (P_MobjFlip(source) < 0)
{
z = source->z+source->height - mobjinfo[type].height;
}
th = P_SpawnMobj(x, y, z, type);
th->flags2 |= flags2;
if (P_IsObjectOnGround(source))
{
// spawn on the ground if the player is on the ground
if (P_MobjFlip(source) < 0)
{
th->z = th->ceilingz - th->height;
th->eflags |= MFE_VERTICALFLIP;
}
else
th->z = th->floorz;
}
th->threshold = 10;
#ifdef WEAPON_SFX
@ -2127,51 +2144,23 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map
{
if (mapthing == MT_FIREBALL) // Messy
{
mobj_t *mo2;
mobj_t *mo3;
mobj_t *mo4;
mobj_t *mo5;
if (dir == -1)
{
// Shoot backward
mo = K_SpawnKartMissile(player->mo, mapthing, player->mo->angle + ANGLE_180 - 0x06000000, 0, PROJSPEED/2);
mo2 = K_SpawnKartMissile(player->mo, mapthing, player->mo->angle + ANGLE_180 - 0x03000000, 0, PROJSPEED/2);
mo3 = K_SpawnKartMissile(player->mo, mapthing, player->mo->angle + ANGLE_180, 0, PROJSPEED/2);
mo4 = K_SpawnKartMissile(player->mo, mapthing, player->mo->angle + ANGLE_180 + 0x03000000, 0, PROJSPEED/2);
mo5 = K_SpawnKartMissile(player->mo, mapthing, player->mo->angle + ANGLE_180 + 0x06000000, 0, PROJSPEED/2);
if (mo)
{
if (player->mo->eflags & MFE_VERTICALFLIP)
{
mo->eflags |= MFE_VERTICALFLIP;
mo2->eflags |= MFE_VERTICALFLIP;
mo3->eflags |= MFE_VERTICALFLIP;
mo4->eflags |= MFE_VERTICALFLIP;
mo5->eflags |= MFE_VERTICALFLIP;
}
}
mo = K_SpawnKartMissile(player->mo, mapthing, player->mo->angle + ANGLE_180 - 0x06000000, 0, PROJSPEED/2);
K_SpawnKartMissile(player->mo, mapthing, player->mo->angle + ANGLE_180 - 0x03000000, 0, PROJSPEED/2);
K_SpawnKartMissile(player->mo, mapthing, player->mo->angle + ANGLE_180, 0, PROJSPEED/2);
K_SpawnKartMissile(player->mo, mapthing, player->mo->angle + ANGLE_180 + 0x03000000, 0, PROJSPEED/2);
K_SpawnKartMissile(player->mo, mapthing, player->mo->angle + ANGLE_180 + 0x06000000, 0, PROJSPEED/2);
}
else
{
// Shoot forward
mo = K_SpawnKartMissile(player->mo, mapthing, player->mo->angle - 0x06000000, 0, PROJSPEED);
mo2 = K_SpawnKartMissile(player->mo, mapthing, player->mo->angle - 0x03000000, 0, PROJSPEED);
mo3 = K_SpawnKartMissile(player->mo, mapthing, player->mo->angle, 0, PROJSPEED);
mo4 = K_SpawnKartMissile(player->mo, mapthing, player->mo->angle + 0x03000000, 0, PROJSPEED);
mo5 = K_SpawnKartMissile(player->mo, mapthing, player->mo->angle + 0x06000000, 0, PROJSPEED);
if (mo)
{
if (player->mo->eflags & MFE_VERTICALFLIP)
{
mo->eflags |= MFE_VERTICALFLIP;
mo2->eflags |= MFE_VERTICALFLIP;
mo3->eflags |= MFE_VERTICALFLIP;
mo4->eflags |= MFE_VERTICALFLIP;
mo5->eflags |= MFE_VERTICALFLIP;
}
}
mo = K_SpawnKartMissile(player->mo, mapthing, player->mo->angle - 0x06000000, 0, PROJSPEED);
K_SpawnKartMissile(player->mo, mapthing, player->mo->angle - 0x03000000, 0, PROJSPEED);
K_SpawnKartMissile(player->mo, mapthing, player->mo->angle, 0, PROJSPEED);
K_SpawnKartMissile(player->mo, mapthing, player->mo->angle + 0x03000000, 0, PROJSPEED);
K_SpawnKartMissile(player->mo, mapthing, player->mo->angle + 0x06000000, 0, PROJSPEED);
}
}
else // Shells
@ -2180,23 +2169,11 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map
{
// Shoot backward
mo = K_SpawnKartMissile(player->mo, mapthing, player->mo->angle + ANGLE_180, 0, PROJSPEED/2);
if (mo)
{
if (player->mo->eflags & MFE_VERTICALFLIP)
mo->eflags |= MFE_VERTICALFLIP;
}
}
else
{
// Shoot forward
mo = K_SpawnKartMissile(player->mo, mapthing, player->mo->angle, 0, PROJSPEED + player->speed);
if (mo)
{
if (player->mo->eflags & MFE_VERTICALFLIP)
mo->eflags |= MFE_VERTICALFLIP;
}
}
}
}
@ -2208,7 +2185,6 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map
mo = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z + player->mo->height/2, mapthing);
mo->threshold = 10;
P_SetTarget(&mo->target, player->mo);
S_StartSound(player->mo, mo->info->seesound);
@ -2225,7 +2201,7 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map
mo->momx = player->mo->momx + FixedMul(FINECOSINE(fa), PROJSPEED);
mo->momy = player->mo->momy + FixedMul(FINESINE(fa), PROJSPEED);
mo->momz = HEIGHT;
mo->momz = P_MobjFlip(player->mo) * HEIGHT;
if (player->mo->eflags & MFE_VERTICALFLIP)
mo->eflags |= MFE_VERTICALFLIP;
@ -2237,21 +2213,19 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map
}
else
{
fixed_t dropradius = FixedHypot(player->mo->radius, player->mo->radius) + FixedHypot(mobjinfo[mapthing].radius, mobjinfo[mapthing].radius);
// Drop it directly behind you.
newangle = player->mo->angle;
mo = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, mapthing);
newx = player->mo->x + P_ReturnThrustX(player->mo, newangle + ANGLE_180, dropradius);
newy = player->mo->y + P_ReturnThrustY(player->mo, newangle + ANGLE_180, dropradius);
mo = P_SpawnMobj(newx, newy, player->mo->z, mapthing);
mo->threshold = 10;
P_SetTarget(&mo->target, player->mo);
newx = player->mo->x + P_ReturnThrustX(player->mo, newangle + ANGLE_180, player->mo->radius*2 + mo->radius*3);
newy = player->mo->y + P_ReturnThrustY(player->mo, newangle + ANGLE_180, player->mo->radius*2 + mo->radius*3);
mo->x = newx;
mo->y = newy;
if (mo)
{
if (player->mo->eflags & MFE_VERTICALFLIP)

View file

@ -6552,16 +6552,12 @@ void P_MobjThinker(mobj_t *mobj)
if (mobj->health > 0 && mobj->target && mobj->target->player && mobj->target->player->mo
&& mobj->target->player->health > 0 && !mobj->target->player->spectator)
{
fixed_t radius; // mobj's distance from its Target, or Radius.
if (mobj->type == MT_BANANASHIELD || mobj->type == MT_TRIPLEBANANASHIELD1 || mobj->type == MT_TRIPLEBANANASHIELD2 || mobj->type == MT_TRIPLEBANANASHIELD3)
radius = 64*mobj->target->scale;
else
radius = 56*mobj->target->scale;
fixed_t z;
const fixed_t radius = FixedHypot(mobj->target->radius, mobj->target->radius) + FixedHypot(mobj->radius, mobj->radius); // mobj's distance from its Target, or Radius.
//mobj->angle += FixedAngle(12*FRACUNIT); // mobj's actual speed.
if (mobj->type == MT_TRIPLEGREENSHIELD1 || mobj->type == MT_TRIPLEGREENSHIELD2 || mobj->type == MT_TRIPLEGREENSHIELD3
|| mobj->type == MT_TRIPLEREDSHIELD1 || mobj->type == MT_TRIPLEREDSHIELD2 || mobj->type == MT_TRIPLEREDSHIELD3)
|| mobj->type == MT_TRIPLEREDSHIELD1 || mobj->type == MT_TRIPLEREDSHIELD2 || mobj->type == MT_TRIPLEREDSHIELD3)
mobj->angle += FixedAngle(mobj->info->speed);
else if (mobj->type == MT_TRIPLEBANANASHIELD2)
mobj->angle = (mobj->target->angle + ANGLE_135);
@ -6570,15 +6566,52 @@ void P_MobjThinker(mobj_t *mobj)
else
mobj->angle = (mobj->target->angle + ANGLE_180);
// Shrink your items if the player shrunk too.
mobj->scale = mobj->target->scale;
// If the player is on the ceiling, then flip your items as well.
if (mobj->target->player && mobj->target->eflags & MFE_VERTICALFLIP)
{
mobj->eflags |= MFE_VERTICALFLIP;
}
else
{
mobj->eflags &= ~MFE_VERTICALFLIP;
}
P_TeleportMove(mobj, mobj->target->x, mobj->target->y, mobj->target->z);
// Shrink your items if the player shrunk too.
if (mobj->target->player)
mobj->scale = mobj->target->scale;
if (P_MobjFlip(mobj) > 0)
{
z = mobj->target->z;
}
else
{
z = mobj->target->z + mobj->target->height - mobj->height;
}
P_TeleportMove(mobj, mobj->target->x, mobj->target->y, z);
mobj->momx = FixedMul(FINECOSINE(mobj->angle>>ANGLETOFINESHIFT),radius);
mobj->momy = FixedMul(FINESINE(mobj->angle>>ANGLETOFINESHIFT), radius);
if (!P_TryMove(mobj, mobj->target->x + mobj->momx, mobj->target->y + mobj->momy, false))
if (!P_TryMove(mobj, mobj->target->x + mobj->momx, mobj->target->y + mobj->momy, true))
P_SlideMove(mobj, true);
mobj->z = mobj->floorz;
if (P_IsObjectOnGround(mobj->target))
{
if (P_MobjFlip(mobj) > 0)
{
if (mobj->floorz > mobj->target->z - mobj->height)
{
z = mobj->floorz;
}
}
else
{
if (mobj->ceilingz < mobj->target->z + mobj->target->height + mobj->height)
{
z = mobj->ceilingz - mobj->height;
}
}
}
mobj->z = z;
mobj->momx = mobj->momy = 0;
// Was this so hard?