mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-17 23:21:05 +00:00
Karma Eggman. Does what it says on the egg. Tried very hard not to merge conflict with frameperfectegg
.
Also includes some adjustments to: * Horizontal offset of Eggman countdown in splitscreen again. It's not perfectly centered either way, but on second thought I like this better. * Sound of Lat`'s Mine/SPB explosions - now uses same sound as Karma bombing, instead of that shitty paraloop. * Correctly wipe k_eggmanblame when it is appropriate to do so.
This commit is contained in:
parent
5a80d036e7
commit
2f061a531a
7 changed files with 80 additions and 26 deletions
|
@ -6708,6 +6708,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
|
|||
|
||||
"S_PLAYERBOMB", // Player bomb overlay
|
||||
"S_PLAYERITEM", // Player item overlay
|
||||
"S_PLAYERFAKE", // Player fake overlay
|
||||
|
||||
"S_KARMAWHEEL", // Karma player wheels
|
||||
|
||||
|
|
|
@ -2519,6 +2519,7 @@ void G_PlayerReborn(INT32 player)
|
|||
p->kartstuff[k_comebackpoints] = comebackpoints;
|
||||
p->kartstuff[k_comebacktimer] = comebacktime;
|
||||
p->kartstuff[k_wanted] = wanted;
|
||||
p->kartstuff[k_eggmanblame] = -1;
|
||||
|
||||
// Don't do anything immediately
|
||||
p->pflags |= PF_USEDOWN;
|
||||
|
|
|
@ -3006,6 +3006,7 @@ state_t states[NUMSTATES] =
|
|||
|
||||
{SPR_PBOM, FF_ANIMATE, -1, {NULL}, 3, 3, S_NULL}, // S_PLAYERBOMB
|
||||
{SPR_RNDM, FF_ANIMATE, -1, {NULL}, 23, 3, S_NULL}, // S_PLAYERITEM
|
||||
{SPR_FITM, FF_ANIMATE, -1, {NULL}, 23, 3, S_NULL}, // S_PLAYERFAKE
|
||||
|
||||
{SPR_PBOM, 4, -1, {NULL}, 0, 0, S_NULL}, // S_KARMAWHEEL
|
||||
|
||||
|
@ -17132,7 +17133,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
sfx_kc2e, // seesound
|
||||
8, // reactiontime
|
||||
sfx_s3k4e, // attacksound
|
||||
S_NULL, // painstate
|
||||
S_PLAYERFAKE, // painstate
|
||||
0, // painchance
|
||||
sfx_None, // painsound
|
||||
S_NULL, // meleestate
|
||||
|
|
|
@ -3554,6 +3554,7 @@ typedef enum state
|
|||
|
||||
S_PLAYERBOMB,
|
||||
S_PLAYERITEM,
|
||||
S_PLAYERFAKE,
|
||||
|
||||
S_KARMAWHEEL,
|
||||
|
||||
|
|
34
src/k_kart.c
34
src/k_kart.c
|
@ -4398,8 +4398,11 @@ void K_StripOther(player_t *player)
|
|||
player->kartstuff[k_invincibilitytimer] = 0;
|
||||
player->kartstuff[k_growshrinktimer] = 0;
|
||||
|
||||
player->kartstuff[k_eggmanexplode] = 0;
|
||||
player->kartstuff[k_eggmanblame] = 0;
|
||||
if (player->kartstuff[k_eggmanexplode])
|
||||
{
|
||||
player->kartstuff[k_eggmanexplode] = 0;
|
||||
player->kartstuff[k_eggmanblame] = -1;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -4444,14 +4447,29 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
|||
{
|
||||
mobj_t *newitem;
|
||||
|
||||
if (player->kartstuff[k_comebackmode] == 1)
|
||||
{
|
||||
newitem = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_RANDOMITEM);
|
||||
newitem->threshold = 69; // selected "randomly".
|
||||
}
|
||||
else
|
||||
{
|
||||
newitem = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_FAKEITEM);
|
||||
if (player->kartstuff[k_eggmanblame] >= 0
|
||||
&& player->kartstuff[k_eggmanblame] < MAXPLAYERS
|
||||
&& playeringame[player->kartstuff[k_eggmanblame]]
|
||||
&& !players[player->kartstuff[k_eggmanblame]].spectator
|
||||
&& players[player->kartstuff[k_eggmanblame]].mo)
|
||||
P_SetTarget(&newitem->target, players[player->kartstuff[k_eggmanblame]].mo);
|
||||
player->kartstuff[k_eggmanblame] = -1;
|
||||
}
|
||||
|
||||
newitem->flags2 = (player->mo->flags2 & MF2_OBJECTFLIP);
|
||||
newitem->fuse = 15*TICRATE; // selected randomly.
|
||||
|
||||
player->kartstuff[k_comebackmode] = 0;
|
||||
player->kartstuff[k_comebacktimer] = comebacktime;
|
||||
S_StartSound(player->mo, sfx_s254);
|
||||
|
||||
newitem = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_RANDOMITEM);
|
||||
newitem->flags2 = (player->mo->flags2 & MF2_OBJECTFLIP);
|
||||
newitem->fuse = 15*TICRATE; // selected randomly.
|
||||
newitem->threshold = 69; // selected "randomly".
|
||||
}
|
||||
// Eggman Monitor exploding
|
||||
else if (player->kartstuff[k_eggmanexplode])
|
||||
|
@ -5937,7 +5955,7 @@ static void K_drawKartItem(void)
|
|||
|
||||
// Quick Eggman numbers
|
||||
if (stplyr->kartstuff[k_eggmanexplode] > 1 /*&& stplyr->kartstuff[k_eggmanexplode] <= 3*TICRATE*/)
|
||||
V_DrawScaledPatch(ITEM_X+17-offset, ITEM_Y+13-offset, V_HUDTRANS|splitflags, kp_eggnum[min(3, G_TicsToSeconds(stplyr->kartstuff[k_eggmanexplode]))]);
|
||||
V_DrawScaledPatch(ITEM_X+17, ITEM_Y+13-offset, V_HUDTRANS|splitflags, kp_eggnum[min(3, G_TicsToSeconds(stplyr->kartstuff[k_eggmanexplode]))]);
|
||||
}
|
||||
|
||||
void K_drawKartTimestamp(tic_t drawtime, INT32 TX, INT32 TY, INT16 emblemmap, boolean playing)
|
||||
|
|
|
@ -456,10 +456,9 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
|||
|
||||
if (G_BattleGametype() && player->kartstuff[k_bumper] <= 0)
|
||||
{
|
||||
if (player->kartstuff[k_comebackmode] != 0 || player->kartstuff[k_comebacktimer])
|
||||
if (player->kartstuff[k_comebackmode] || player->kartstuff[k_comebacktimer])
|
||||
return;
|
||||
if (player->kartstuff[k_comebackmode] == 0)
|
||||
player->kartstuff[k_comebackmode] = 1;
|
||||
player->kartstuff[k_comebackmode] = 1;
|
||||
}
|
||||
|
||||
special->momx = special->momy = special->momz = 0;
|
||||
|
@ -479,21 +478,22 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
|||
|
||||
if (G_BattleGametype() && player->kartstuff[k_bumper] <= 0)
|
||||
{
|
||||
/*if (player->kartstuff[k_comebackmode] != 0 || player->kartstuff[k_comebacktimer])
|
||||
if (player->kartstuff[k_comebackmode] || player->kartstuff[k_comebacktimer])
|
||||
return;
|
||||
if (player->kartstuff[k_comebackmode] == 0)
|
||||
player->kartstuff[k_comebackmode] = 2;*/
|
||||
return;
|
||||
player->kartstuff[k_comebackmode] = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
K_DropItems(player); //K_StripItems(player);
|
||||
K_StripOther(player);
|
||||
player->kartstuff[k_itemroulette] = 1;
|
||||
player->kartstuff[k_roulettetype] = 2;
|
||||
}
|
||||
|
||||
{
|
||||
mobj_t *poof = P_SpawnMobj(special->x, special->y, special->z, MT_EXPLODE);
|
||||
S_StartSound(poof, special->info->deathsound);
|
||||
|
||||
K_DropItems(player); //K_StripItems(player);
|
||||
K_StripOther(player);
|
||||
player->kartstuff[k_itemroulette] = 1;
|
||||
player->kartstuff[k_roulettetype] = 2;
|
||||
if (special->target && special->target->player
|
||||
&& (G_RaceGametype() || special->target->player->kartstuff[k_bumper] > 0))
|
||||
player->kartstuff[k_eggmanblame] = special->target->player-players;
|
||||
|
@ -503,7 +503,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
|||
P_RemoveMobj(special);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case MT_KARMAHITBOX:
|
||||
if (!special->target->player)
|
||||
return;
|
||||
|
@ -519,7 +518,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
|||
|| special->target->player->kartstuff[k_squishedtimer])
|
||||
return;
|
||||
|
||||
if (special->target->player->kartstuff[k_comebackmode] == 0)
|
||||
if (!special->target->player->kartstuff[k_comebackmode])
|
||||
{
|
||||
if (player->kartstuff[k_growshrinktimer] || player->kartstuff[k_squishedtimer]
|
||||
|| player->kartstuff[k_hyudorotimer] || player->kartstuff[k_spinouttimer]
|
||||
|
@ -580,6 +579,36 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
|||
player->kartstuff[k_itemroulette] = 1;
|
||||
player->kartstuff[k_roulettetype] = 1;
|
||||
}
|
||||
else if (special->target->player->kartstuff[k_comebackmode] == 2 && P_CanPickupItem(player, 2))
|
||||
{
|
||||
mobj_t *poof = P_SpawnMobj(special->x, special->y, special->z, MT_EXPLODE);
|
||||
S_StartSound(poof, special->info->seesound);
|
||||
|
||||
special->target->player->kartstuff[k_comebackmode] = 0;
|
||||
special->target->player->kartstuff[k_comebackpoints]++;
|
||||
|
||||
if (netgame && cv_hazardlog.value)
|
||||
CONS_Printf(M_GetText("%s gave an \"item\" to %s.\n"), player_names[special->target->player-players], player_names[player-players]);
|
||||
if (special->target->player->kartstuff[k_comebackpoints] >= 3)
|
||||
K_StealBumper(special->target->player, player, true);
|
||||
special->target->player->kartstuff[k_comebacktimer] = comebacktime;
|
||||
|
||||
K_DropItems(player); //K_StripItems(player);
|
||||
K_StripOther(player);
|
||||
|
||||
player->kartstuff[k_itemroulette] = 1;
|
||||
player->kartstuff[k_roulettetype] = 2;
|
||||
|
||||
if (special->target->player->kartstuff[k_eggmanblame] >= 0
|
||||
&& special->target->player->kartstuff[k_eggmanblame] < MAXPLAYERS
|
||||
&& playeringame[special->target->player->kartstuff[k_eggmanblame]]
|
||||
&& !players[special->target->player->kartstuff[k_eggmanblame]].spectator)
|
||||
player->kartstuff[k_eggmanblame] = special->target->player->kartstuff[k_eggmanblame];
|
||||
else
|
||||
player->kartstuff[k_eggmanblame] = -1;
|
||||
|
||||
special->target->player->kartstuff[k_eggmanblame] = -1;
|
||||
}
|
||||
return;
|
||||
|
||||
// ***************************************** //
|
||||
|
|
11
src/p_mobj.c
11
src/p_mobj.c
|
@ -8239,7 +8239,7 @@ void P_MobjThinker(mobj_t *mobj)
|
|||
return;
|
||||
case MT_MINEEXPLOSIONSOUND:
|
||||
if (mobj->health == 100)
|
||||
S_StartSound(mobj, sfx_prloop);
|
||||
S_StartSound(mobj, sfx_s3k4e);
|
||||
mobj->health--;
|
||||
break;
|
||||
case MT_BOOSTFLAME:
|
||||
|
@ -8363,7 +8363,7 @@ void P_MobjThinker(mobj_t *mobj)
|
|||
mobj->destscale = mobj->target->destscale;
|
||||
P_SetScale(mobj, mobj->target->scale);
|
||||
mobj->color = mobj->target->color;
|
||||
mobj->colorized = (mobj->target->player->kartstuff[k_comebackmode] == 1);
|
||||
mobj->colorized = (mobj->target->player->kartstuff[k_comebackmode]);
|
||||
|
||||
if (mobj->target->player->kartstuff[k_comebacktimer] > 0)
|
||||
{
|
||||
|
@ -8377,12 +8377,15 @@ void P_MobjThinker(mobj_t *mobj)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (mobj->target->player->kartstuff[k_comebackmode] == 0
|
||||
if (!mobj->target->player->kartstuff[k_comebackmode]
|
||||
&& mobj->state != &states[mobj->info->spawnstate])
|
||||
P_SetMobjState(mobj, mobj->info->spawnstate);
|
||||
else if (mobj->target->player->kartstuff[k_comebackmode] == 1
|
||||
&& mobj->state != &states[mobj->info->seestate])
|
||||
P_SetMobjState(mobj, mobj->info->seestate);
|
||||
else if (mobj->target->player->kartstuff[k_comebackmode] == 2
|
||||
&& mobj->state != &states[mobj->info->painstate])
|
||||
P_SetMobjState(mobj, mobj->info->painstate);
|
||||
|
||||
if (mobj->target->player->powers[pw_flashing] && (leveltime & 1))
|
||||
mobj->flags2 |= MF2_DONTDRAW;
|
||||
|
@ -8749,7 +8752,7 @@ for (i = ((mobj->flags2 & MF2_STRONGBOX) ? strongboxamt : weakboxamt); i; --i) s
|
|||
if (P_MobjWasRemoved(mobj))
|
||||
return;
|
||||
}
|
||||
else if (mobj->type == MT_RANDOMITEM && mobj->threshold == 69 && mobj->fuse <= TICRATE)
|
||||
else if (((mobj->type == MT_RANDOMITEM && mobj->threshold == 69) || mobj->type == MT_FAKEITEM) && mobj->fuse <= TICRATE)
|
||||
mobj->flags2 ^= MF2_DONTDRAW;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue