mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-24 18:21:17 +00:00
Add delay to Jawz target switching, set Jawz target when fired
This commit is contained in:
parent
a3cd131017
commit
3cb468aec8
4 changed files with 31 additions and 7 deletions
|
@ -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;
|
||||
|
|
|
@ -8333,7 +8333,8 @@ static const char *const KARTSTUFF_LIST[] = {
|
|||
|
||||
"ITEMBLINK",
|
||||
"ITEMBLINKMODE",
|
||||
"GETSPARKS"
|
||||
"GETSPARKS",
|
||||
"JAWZTARGETDELAY"
|
||||
};
|
||||
|
||||
static const char *const HUDITEMS_LIST[] = {
|
||||
|
|
28
src/k_kart.c
28
src/k_kart.c
|
@ -2517,7 +2517,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 */
|
||||
|
@ -4454,12 +4464,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;
|
||||
}
|
||||
|
||||
|
@ -4469,7 +4489,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);
|
||||
|
@ -4477,11 +4497,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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue