Merge branch 'flying-sharks-suck' into 'next'

Flying sharks suck

See merge request KartKrew/Kart-Public!46
This commit is contained in:
Sal 2019-02-02 01:45:42 -05:00
commit 3f283fd2a9
7 changed files with 86 additions and 51 deletions

View file

@ -348,10 +348,11 @@ typedef enum
k_wanted, // Timer for determining WANTED status, lowers when hitting people, prevents the game turning into Camp Lazlo
k_yougotem, // "You Got Em" gfx when hitting someone as a karma player via a method that gets you back in the game instantly
// v1.0.2 vars
// v1.0.2+ vars
k_itemblink, // Item flashing after roulette, prevents Hyudoro stealing AND serves as a mashing indicator
k_itemblinkmode, // Type of flashing: 0 = white (normal), 1 = red (mashing), 2 = rainbow (enhanced items)
k_getsparks, // Disable drift sparks at low speed, JUST enough to give acceleration the actual headstart above speed
k_jawztargetdelay, // Delay for Jawz target switching, to make it less twitchy
NUMKARTSTUFF
} kartstufftype_t;

View file

@ -8333,7 +8333,8 @@ static const char *const KARTSTUFF_LIST[] = {
"ITEMBLINK",
"ITEMBLINKMODE",
"GETSPARKS"
"GETSPARKS",
"JAWZTARGETDELAY"
};
static const char *const HUDITEMS_LIST[] = {

View file

@ -15449,7 +15449,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_ORBINAUT_SHIELDDEAD, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
10*FRACUNIT, // speed
4*FRACUNIT, // speed
16*FRACUNIT, // radius
32*FRACUNIT, // height
0, // display offset
@ -15530,7 +15530,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_JAWZ_DEAD1, // deathstate
S_JAWZ_DEAD2, // xdeathstate
sfx_None, // deathsound
10*FRACUNIT, // speed
4*FRACUNIT, // speed
16*FRACUNIT, // radius
32*FRACUNIT, // height
0, // display offset

View file

@ -1068,6 +1068,26 @@ void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid)
|| (mobj2->player && mobj2->player->kartstuff[k_respawn]))
return;
{ // Don't bump if you're flashing
INT32 flash;
flash = K_GetKartFlashing(mobj1->player);
if (mobj1->player && mobj1->player->powers[pw_flashing] > 0 && mobj1->player->powers[pw_flashing] < flash)
{
if (mobj1->player->powers[pw_flashing] < flash-1)
mobj1->player->powers[pw_flashing]++;
return;
}
flash = K_GetKartFlashing(mobj2->player);
if (mobj2->player && mobj2->player->powers[pw_flashing] > 0 && mobj2->player->powers[pw_flashing] < flash)
{
if (mobj2->player->powers[pw_flashing] < flash-1)
mobj2->player->powers[pw_flashing]++;
return;
}
}
// Don't bump if you've recently bumped
if (mobj1->player && mobj1->player->kartstuff[k_justbumped])
{
@ -1219,9 +1239,8 @@ static UINT8 K_CheckOffroadCollide(mobj_t *mo, sector_t *sec)
for (i = 2; i < 5; i++)
{
if ((sec2 && GETSECSPECIAL(sec2->special, 1) == i)
|| (P_IsObjectOnRealGround(mo, sec)
&& GETSECSPECIAL(sec->special, 1) == i))
return i;
|| (P_IsObjectOnRealGround(mo, sec) && GETSECSPECIAL(sec->special, 1) == i))
return i-1;
}
return 0;
@ -1238,19 +1257,9 @@ static void K_UpdateOffroad(player_t *player)
fixed_t offroad;
sector_t *nextsector = R_PointInSubsector(
player->mo->x + player->mo->momx*2, player->mo->y + player->mo->momy*2)->sector;
UINT8 offroadstrength = K_CheckOffroadCollide(player->mo, nextsector);
fixed_t offroadstrength = 0;
if (K_CheckOffroadCollide(player->mo, nextsector) == 2) // Weak Offroad
offroadstrength = 1;
else if (K_CheckOffroadCollide(player->mo, nextsector) == 3) // Mid Offroad
offroadstrength = 2;
else if (K_CheckOffroadCollide(player->mo, nextsector) == 4) // Strong Offroad
offroadstrength = 3;
// If you are offroad, a timer starts. Depending on your weight value, the timer increments differently.
//if ((nextsector->special & 256) && nextsector->special != 768
// && nextsector->special != 1024 && nextsector->special != 4864)
// If you are in offroad, a timer starts.
if (offroadstrength)
{
if (K_CheckOffroadCollide(player->mo, player->mo->subsector->sector) && player->kartstuff[k_offroad] == 0)
@ -1258,7 +1267,7 @@ static void K_UpdateOffroad(player_t *player)
if (player->kartstuff[k_offroad] > 0)
{
offroad = (FRACUNIT * offroadstrength) / (TICRATE/2);
offroad = (offroadstrength << FRACBITS) / (TICRATE/2);
//if (player->kartstuff[k_growshrinktimer] > 1) // grow slows down half as fast
// offroad /= 2;
@ -1266,8 +1275,8 @@ static void K_UpdateOffroad(player_t *player)
player->kartstuff[k_offroad] += offroad;
}
if (player->kartstuff[k_offroad] > FRACUNIT*offroadstrength)
player->kartstuff[k_offroad] = FRACUNIT*offroadstrength;
if (player->kartstuff[k_offroad] > (offroadstrength << FRACBITS))
player->kartstuff[k_offroad] = (offroadstrength << FRACBITS);
}
else
player->kartstuff[k_offroad] = 0;
@ -1617,10 +1626,8 @@ static void K_GetKartBoostPower(player_t *player)
&& player->kartstuff[k_offroad] >= 0)
boostpower = FixedDiv(boostpower, player->kartstuff[k_offroad] + FRACUNIT);
if (player->kartstuff[k_itemtype] == KITEM_KITCHENSINK)
boostpower = max((TICRATE/2), (5*TICRATE)-(player->kartstuff[k_bananadrag]/2))*boostpower/(5*TICRATE);
else if (player->kartstuff[k_bananadrag] > TICRATE)
boostpower = 4*boostpower/5;
if (player->kartstuff[k_bananadrag] > TICRATE)
boostpower = (4*boostpower)/5;
// Banana drag/offroad dust
if (boostpower < FRACUNIT
@ -2502,7 +2509,17 @@ static mobj_t *K_SpawnKartMissile(mobj_t *source, mobjtype_t type, angle_t an, I
break;
case MT_JAWZ:
if (source && source->player)
{
INT32 lasttarg = source->player->kartstuff[k_lastjawztarget];
th->cvmem = source->player->skincolor;
if ((lasttarg >= 0 && lasttarg < MAXPLAYERS)
&& playeringame[lasttarg]
&& !players[lasttarg].spectator
&& players[lasttarg].mo)
{
P_SetTarget(&th->tracer, players[lasttarg].mo);
}
}
else
th->cvmem = SKINCOLOR_KETCHUP;
/* FALLTHRU */
@ -3626,6 +3643,7 @@ static void K_MoveHeldObjects(player_t *player)
case MT_JAWZ_SHIELD:
{
mobj_t *cur = player->mo->hnext;
fixed_t speed = ((8 - min(4, player->kartstuff[k_itemamount])) * cur->info->speed) / 7;
player->kartstuff[k_bananadrag] = 0; // Just to make sure
@ -3643,10 +3661,10 @@ static void K_MoveHeldObjects(player_t *player)
cur->color = player->skincolor;
cur->angle -= ANGLE_90;
cur->angle += FixedAngle(cur->info->speed);
cur->angle += FixedAngle(speed);
if (cur->extravalue1 < radius)
cur->extravalue1 += FixedMul(P_AproxDistance(cur->extravalue1, radius), FRACUNIT/12);
cur->extravalue1 += P_AproxDistance(cur->extravalue1, radius) / 12;
if (cur->extravalue1 > radius)
cur->extravalue1 = radius;
@ -3906,13 +3924,14 @@ player_t *K_FindJawzTarget(mobj_t *actor, player_t *source)
if (thisang > ANGLE_180)
thisang = InvAngle(thisang);
if (thisang > ANGLE_45) // Don't go for people who are behind you
continue;
// Jawz only go after the person directly ahead of you in race... sort of literally now!
if (G_RaceGametype())
{
if (player->kartstuff[k_position] >= source->kartstuff[k_position]) // Don't pay attention to people behind you
// Don't go for people who are behind you
if (thisang > ANGLE_67h)
continue;
// Don't pay attention to people who aren't above your position
if (player->kartstuff[k_position] >= source->kartstuff[k_position])
continue;
if ((best == -1) || (player->kartstuff[k_position] > best))
{
@ -3925,6 +3944,11 @@ player_t *K_FindJawzTarget(mobj_t *actor, player_t *source)
fixed_t thisdist;
fixed_t thisavg;
// Don't go for people who are behind you
if (thisang > ANGLE_45)
continue;
// Don't pay attention to dead players
if (player->kartstuff[k_bumper] <= 0)
continue;
@ -4438,12 +4462,22 @@ void K_KartPlayerAfterThink(player_t *player)
// Jawz reticule (seeking)
if (player->kartstuff[k_itemtype] == KITEM_JAWZ && player->kartstuff[k_itemheld])
{
player_t *targ = K_FindJawzTarget(player->mo, player);
INT32 lasttarg = player->kartstuff[k_lastjawztarget];
player_t *targ;
mobj_t *ret;
if (!targ)
if (player->kartstuff[k_jawztargetdelay] && playeringame[lasttarg] && !players[lasttarg].spectator)
{
targ = &players[lasttarg];
player->kartstuff[k_jawztargetdelay]--;
}
else
targ = K_FindJawzTarget(player->mo, player);
if (!targ || !targ->mo || P_MobjWasRemoved(targ->mo))
{
player->kartstuff[k_lastjawztarget] = -1;
player->kartstuff[k_jawztargetdelay] = 0;
return;
}
@ -4453,7 +4487,7 @@ void K_KartPlayerAfterThink(player_t *player)
ret->tics = 1;
ret->color = player->skincolor;
if (targ-players != player->kartstuff[k_lastjawztarget])
if (targ-players != lasttarg)
{
if (P_IsLocalPlayer(player) || P_IsLocalPlayer(targ))
S_StartSound(NULL, sfx_s3k89);
@ -4461,11 +4495,13 @@ void K_KartPlayerAfterThink(player_t *player)
S_StartSound(targ->mo, sfx_s3k89);
player->kartstuff[k_lastjawztarget] = targ-players;
player->kartstuff[k_jawztargetdelay] = 5;
}
}
else
{
player->kartstuff[k_lastjawztarget] = -1;
player->kartstuff[k_jawztargetdelay] = 0;
}
}
@ -4667,9 +4703,9 @@ static void K_KartDrift(player_t *player, boolean onground)
}
// Disable drift-sparks until you're going fast enough
if (player->kartstuff[k_getsparks] == 0)
if (player->kartstuff[k_getsparks] == 0 || player->kartstuff[k_offroad])
driftadditive = 0;
if (player->speed > minspeed*2 && !player->kartstuff[k_offroad])
if (player->speed > minspeed*2)
player->kartstuff[k_getsparks] = 1;
// This spawns the drift sparks
@ -5109,7 +5145,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
for (moloop = 0; moloop < player->kartstuff[k_itemamount]; moloop++)
{
newangle = FixedAngle(((360/player->kartstuff[k_itemamount])*moloop)*FRACUNIT) + ANGLE_90;
newangle = (player->mo->angle + ANGLE_157h) + FixedAngle(((360 / player->kartstuff[k_itemamount]) * moloop) << FRACBITS) + ANGLE_90;
mo = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_ORBINAUT_SHIELD);
if (!mo)
{
@ -5150,7 +5186,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
for (moloop = 0; moloop < player->kartstuff[k_itemamount]; moloop++)
{
newangle = FixedAngle(((360/player->kartstuff[k_itemamount])*moloop)*FRACUNIT) + ANGLE_90;
newangle = (player->mo->angle + ANGLE_157h) + FixedAngle(((360 / player->kartstuff[k_itemamount]) * moloop) << FRACBITS) + ANGLE_90;
mo = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_JAWZ_SHIELD);
if (!mo)
{

View file

@ -8264,8 +8264,8 @@ void A_JawzChase(mobj_t *actor)
if (actor->tracer)
{
if (G_RaceGametype()) // Stop looking after first target in race
actor->extravalue1 = 1;
/*if (G_RaceGametype()) // Stop looking after first target in race
actor->extravalue1 = 1;*/
if (actor->tracer->health)
{

View file

@ -752,9 +752,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
// Player Damage
P_DamageMobj(thing, tmthing, tmthing->target, 1);
K_KartBouncing(thing, tmthing, false, false);
if (tmthing->type == MT_ORBINAUT || tmthing->type == MT_JAWZ || tmthing->type == MT_JAWZ_DUD)
S_StartSound(thing, sfx_s3k7b);
S_StartSound(thing, sfx_s3k7b);
// This Item Damage
if (tmthing->eflags & MFE_VERTICALFLIP)
@ -1035,9 +1033,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
// Player Damage
P_DamageMobj(tmthing, thing, thing->target, 1);
K_KartBouncing(tmthing, thing, false, false);
if (thing->type == MT_ORBINAUT || thing->type == MT_JAWZ || thing->type == MT_JAWZ_DUD)
S_StartSound(tmthing, sfx_s3k7b);
S_StartSound(tmthing, sfx_s3k7b);
// Other Item Damage
if (thing->eflags & MFE_VERTICALFLIP)

View file

@ -1354,7 +1354,7 @@ fixed_t P_GetMobjGravity(mobj_t *mo)
if (wasflip == !(mo->eflags & MFE_VERTICALFLIP)) // note!! == ! is not equivalent to != here - turns numeric into bool this way
P_PlayerFlip(mo);
if (mo->player->kartstuff[k_pogospring])
gravityadd = FixedMul(gravityadd, 5*FRACUNIT/2);
gravityadd = (5*gravityadd)/2;
}
else
{
@ -1404,11 +1404,12 @@ fixed_t P_GetMobjGravity(mobj_t *mo)
break;
case MT_BANANA:
case MT_EGGMANITEM:
case MT_ORBINAUT:
case MT_JAWZ:
case MT_JAWZ_DUD:
case MT_SSMINE:
gravityadd = FixedMul(gravityadd, 5*FRACUNIT/2);
break;
case MT_SINK:
gravityadd = FixedMul(gravityadd, 5*FRACUNIT); // Double gravity
gravityadd = (5*gravityadd)/2;
break;
case MT_SIGN:
gravityadd /= 8;