Merge branch 'master' into mobj-scale-global

This commit is contained in:
SeventhSentinel 2018-12-27 13:58:42 -05:00
commit 7e936d18d2
5 changed files with 49 additions and 55 deletions

View file

@ -140,7 +140,7 @@
extern FILE *logstream; extern FILE *logstream;
#endif #endif
//#define DEVELOP // Disable this for release builds to remove excessive cheat commands and enable MD5 checking and stuff, all in one go. :3 #define DEVELOP // Disable this for release builds to remove excessive cheat commands and enable MD5 checking and stuff, all in one go. :3
#ifdef DEVELOP #ifdef DEVELOP
#define VERSION 0 // Game version #define VERSION 0 // Game version
#define SUBVERSION 0 // more precise version number #define SUBVERSION 0 // more precise version number

View file

@ -15476,7 +15476,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_JAWZ_DEAD1, // deathstate S_JAWZ_DEAD1, // deathstate
S_JAWZ_DEAD2, // xdeathstate S_JAWZ_DEAD2, // xdeathstate
sfx_s3k5d, // deathsound sfx_s3k5d, // deathsound
7*FRACUNIT, // speed 64*FRACUNIT, // speed
16*FRACUNIT, // radius 16*FRACUNIT, // radius
32*FRACUNIT, // height 32*FRACUNIT, // height
0, // display offset 0, // display offset
@ -15503,7 +15503,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_JAWZ_DEAD1, // deathstate S_JAWZ_DEAD1, // deathstate
S_JAWZ_DEAD2, // xdeathstate S_JAWZ_DEAD2, // xdeathstate
sfx_s3k5d, // deathsound sfx_s3k5d, // deathsound
56*FRACUNIT, // speed 64*FRACUNIT, // speed
16*FRACUNIT, // radius 16*FRACUNIT, // radius
32*FRACUNIT, // height 32*FRACUNIT, // height
0, // display offset 0, // display offset
@ -15773,7 +15773,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_BALLHOG_DEAD, // deathstate S_BALLHOG_DEAD, // deathstate
S_NULL, // xdeathstate S_NULL, // xdeathstate
sfx_hogbom, // deathsound sfx_hogbom, // deathsound
0, // speed 64*FRACUNIT, // speed
16*FRACUNIT, // radius 16*FRACUNIT, // radius
32*FRACUNIT, // height 32*FRACUNIT, // height
0, // display offset 0, // display offset

View file

@ -2464,25 +2464,25 @@ void K_SpawnMineExplosion(mobj_t *source, UINT8 color)
} }
} }
static mobj_t *K_SpawnKartMissile(mobj_t *source, mobjtype_t type, angle_t angle, INT32 flags2, fixed_t speed) static mobj_t *K_SpawnKartMissile(mobj_t *source, mobjtype_t type, angle_t an, INT32 flags2, fixed_t speed)
{ {
mobj_t *th; mobj_t *th;
angle_t an;
fixed_t x, y, z; fixed_t x, y, z;
fixed_t finalspeed = speed; fixed_t finalspeed = speed;
mobj_t *throwmo; mobj_t *throwmo;
//INT32 dir;
// angle at which you fire, is player angle
an = angle;
//if (source->player->kartstuff[k_throwdir] != 0)
// dir = source->player->kartstuff[k_throwdir];
//else
// dir = 1;
if (source->player && source->player->speed > K_GetKartSpeed(source->player, false)) if (source->player && source->player->speed > K_GetKartSpeed(source->player, false))
finalspeed = FixedMul(speed, FixedDiv(source->player->speed, K_GetKartSpeed(source->player, false))); {
angle_t input = source->angle - an;
boolean invert = (input > ANGLE_180);
if (invert)
input = InvAngle(input);
finalspeed = max(speed, FixedMul(speed, FixedMul(
FixedDiv(source->player->speed, K_GetKartSpeed(source->player, false)), // Multiply speed to be proportional to your own, boosted maxspeed.
(((180<<FRACBITS) - AngleFixed(input)) / 180) // multiply speed based on angle diff... i.e: don't do this for firing backward :V
)));
}
x = source->x + source->momx + FixedMul(finalspeed, FINECOSINE(an>>ANGLETOFINESHIFT)); x = source->x + source->momx + FixedMul(finalspeed, FINECOSINE(an>>ANGLETOFINESHIFT));
y = source->y + source->momy + FixedMul(finalspeed, FINESINE(an>>ANGLETOFINESHIFT)); y = source->y + source->momy + FixedMul(finalspeed, FINESINE(an>>ANGLETOFINESHIFT));
@ -2499,15 +2499,8 @@ static mobj_t *K_SpawnKartMissile(mobj_t *source, mobjtype_t type, angle_t angle
th->threshold = 10; th->threshold = 10;
#ifdef WEAPON_SFX
//Since rail and bounce have no thrown objects, this hack is necessary.
//Is creating thrown objects for rail and bounce more or less desirable than this?
if (th->info->seesound && !(th->flags2 & MF2_RAILRING) && !(th->flags2 & MF2_SCATTER))
S_StartSound(source, th->info->seesound);
#else
if (th->info->seesound) if (th->info->seesound)
S_StartSound(source, th->info->seesound); S_StartSound(source, th->info->seesound);
#endif
P_SetTarget(&th->target, source); P_SetTarget(&th->target, source);
@ -2537,6 +2530,7 @@ static mobj_t *K_SpawnKartMissile(mobj_t *source, mobjtype_t type, angle_t angle
th->color = source->player->skincolor; th->color = source->player->skincolor;
else else
th->color = SKINCOLOR_GREY; th->color = SKINCOLOR_GREY;
th->movefactor = finalspeed;
break; break;
case MT_JAWZ: case MT_JAWZ:
if (source && source->player) if (source && source->player)
@ -2546,6 +2540,9 @@ static mobj_t *K_SpawnKartMissile(mobj_t *source, mobjtype_t type, angle_t angle
/* FALLTHRU */ /* FALLTHRU */
case MT_JAWZ_DUD: case MT_JAWZ_DUD:
S_StartSound(th, th->info->activesound); S_StartSound(th, th->info->activesound);
/* FALLTHRU */
case MT_SPB:
th->movefactor = finalspeed;
break; break;
default: default:
break; break;
@ -2895,6 +2892,17 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map
return NULL; return NULL;
// Figure out projectile speed by game speed // Figure out projectile speed by game speed
if (missile && mapthing != MT_BALLHOG) // Trying to keep compatability...
{
PROJSPEED = mobjinfo[mapthing].speed;
if (gamespeed == 0)
PROJSPEED = FixedMul(PROJSPEED, FRACUNIT-FRACUNIT/4);
else if (gamespeed == 2)
PROJSPEED = FixedMul(PROJSPEED, FRACUNIT+FRACUNIT/4);
PROJSPEED = FixedMul(PROJSPEED, mapobjectscale);
}
else
{
switch (gamespeed) switch (gamespeed)
{ {
case 0: case 0:
@ -2907,6 +2915,7 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map
PROJSPEED = 82*mapobjectscale; // Avg Speed is 41 PROJSPEED = 82*mapobjectscale; // Avg Speed is 41
break; break;
} }
}
if (altthrow) if (altthrow)
{ {
@ -2965,7 +2974,7 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map
if (dir == -1 && mapthing != MT_SPB) if (dir == -1 && mapthing != MT_SPB)
{ {
// Shoot backward // Shoot backward
mo = K_SpawnKartMissile(player->mo, mapthing, player->mo->angle + ANGLE_180, 0, PROJSPEED/4); mo = K_SpawnKartMissile(player->mo, mapthing, player->mo->angle + ANGLE_180, 0, PROJSPEED/2);
} }
else else
{ {

View file

@ -8276,7 +8276,7 @@ void A_JawzChase(mobj_t *actor)
ret->frame |= ((leveltime % 10) / 2) + 5; ret->frame |= ((leveltime % 10) / 2) + 5;
ret->color = actor->cvmem; ret->color = actor->cvmem;
P_Thrust(actor, R_PointToAngle2(actor->x, actor->y, actor->tracer->x, actor->tracer->y), actor->info->speed); P_Thrust(actor, R_PointToAngle2(actor->x, actor->y, actor->tracer->x, actor->tracer->y), (7*actor->movefactor)/64);
return; return;
} }
else else
@ -8348,11 +8348,7 @@ void A_SPBChase(mobj_t *actor)
#endif #endif
// Default speed // Default speed
wspeed = FixedMul(actor->info->speed, mapobjectscale); wspeed = actor->movefactor;
if (gamespeed == 0)
wspeed = FixedMul(wspeed, FRACUNIT-FRACUNIT/4);
else if (gamespeed == 2)
wspeed = FixedMul(wspeed, FRACUNIT+FRACUNIT/4);
if (actor->threshold) // Just fired, go straight. if (actor->threshold) // Just fired, go straight.
{ {

View file

@ -8025,15 +8025,10 @@ void P_MobjThinker(mobj_t *mobj)
} }
else else
{ {
fixed_t finalspeed = mobj->info->speed; fixed_t finalspeed = mobj->movefactor;
P_SpawnGhostMobj(mobj); P_SpawnGhostMobj(mobj);
if (gamespeed == 0)
finalspeed = FixedMul(finalspeed, FRACUNIT-FRACUNIT/4);
else if (gamespeed == 2)
finalspeed = FixedMul(finalspeed, FRACUNIT+FRACUNIT/4);
mobj->angle = R_PointToAngle2(0, 0, mobj->momx, mobj->momy); mobj->angle = R_PointToAngle2(0, 0, mobj->momx, mobj->momy);
if (mobj->health <= 5) if (mobj->health <= 5)
{ {
@ -8041,7 +8036,7 @@ void P_MobjThinker(mobj_t *mobj)
for (i = 5; i >= mobj->health; i--) for (i = 5; i >= mobj->health; i--)
finalspeed = FixedMul(finalspeed, FRACUNIT-FRACUNIT/4); finalspeed = FixedMul(finalspeed, FRACUNIT-FRACUNIT/4);
} }
finalspeed = FixedMul(finalspeed, mapobjectscale);
P_InstaThrust(mobj, mobj->angle, finalspeed); P_InstaThrust(mobj, mobj->angle, finalspeed);
if (grounded) if (grounded)
@ -8064,7 +8059,7 @@ void P_MobjThinker(mobj_t *mobj)
case MT_JAWZ: case MT_JAWZ:
{ {
sector_t *sec2; sector_t *sec2;
fixed_t topspeed = 64*mapobjectscale; fixed_t topspeed = mobj->movefactor;
fixed_t distbarrier = 512*mapobjectscale; fixed_t distbarrier = 512*mapobjectscale;
fixed_t distaway; fixed_t distaway;
@ -8076,15 +8071,9 @@ void P_MobjThinker(mobj_t *mobj)
S_StartSound(mobj, mobj->info->activesound); S_StartSound(mobj, mobj->info->activesound);
if (gamespeed == 0) if (gamespeed == 0)
{
topspeed = FixedMul(topspeed, FRACUNIT-FRACUNIT/4);
distbarrier = FixedMul(distbarrier, FRACUNIT-FRACUNIT/4); distbarrier = FixedMul(distbarrier, FRACUNIT-FRACUNIT/4);
}
else if (gamespeed == 2) else if (gamespeed == 2)
{
topspeed = FixedMul(topspeed, FRACUNIT+FRACUNIT/4);
distbarrier = FixedMul(distbarrier, FRACUNIT+FRACUNIT/4); distbarrier = FixedMul(distbarrier, FRACUNIT+FRACUNIT/4);
}
if (G_RaceGametype() && mobj->tracer) if (G_RaceGametype() && mobj->tracer)
{ {
@ -8143,7 +8132,7 @@ void P_MobjThinker(mobj_t *mobj)
{ {
P_SpawnGhostMobj(mobj); P_SpawnGhostMobj(mobj);
mobj->angle = R_PointToAngle2(0, 0, mobj->momx, mobj->momy); mobj->angle = R_PointToAngle2(0, 0, mobj->momx, mobj->momy);
P_InstaThrust(mobj, mobj->angle, mobj->info->speed); P_InstaThrust(mobj, mobj->angle, mobj->movefactor);
if (grounded) if (grounded)
{ {