mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-17 23:21:05 +00:00
Merge branch 'karmegg' into 'master'
Karmegg See merge request KartKrew/Kart!36
This commit is contained in:
commit
49cf05a268
7 changed files with 149 additions and 49 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
|
||||
|
||||
|
|
|
@ -2507,6 +2507,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,
|
||||
|
||||
|
|
76
src/k_kart.c
76
src/k_kart.c
|
@ -1796,11 +1796,20 @@ void K_SpinPlayer(player_t *player, mobj_t *source, INT32 type, boolean trapitem
|
|||
K_CalculateBattleWanted();
|
||||
}
|
||||
|
||||
if (!player->kartstuff[k_bumper])
|
||||
{
|
||||
player->kartstuff[k_comebacktimer] = comebacktime;
|
||||
if (player->kartstuff[k_comebackmode] == 2)
|
||||
{
|
||||
mobj_t *poof = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_EXPLODE);
|
||||
S_StartSound(poof, mobjinfo[MT_KARMAHITBOX].seesound);
|
||||
player->kartstuff[k_comebackmode] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
K_CheckBumpers();
|
||||
}
|
||||
|
||||
player->kartstuff[k_comebacktimer] = comebacktime;
|
||||
|
||||
player->kartstuff[k_spinouttype] = type;
|
||||
|
||||
if (player->kartstuff[k_spinouttype] <= 0)
|
||||
|
@ -1878,11 +1887,20 @@ void K_SquishPlayer(player_t *player, mobj_t *source)
|
|||
K_CalculateBattleWanted();
|
||||
}
|
||||
|
||||
if (!player->kartstuff[k_bumper])
|
||||
{
|
||||
player->kartstuff[k_comebacktimer] = comebacktime;
|
||||
if (player->kartstuff[k_comebackmode] == 2)
|
||||
{
|
||||
mobj_t *poof = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_EXPLODE);
|
||||
S_StartSound(poof, mobjinfo[MT_KARMAHITBOX].seesound);
|
||||
player->kartstuff[k_comebackmode] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
K_CheckBumpers();
|
||||
}
|
||||
|
||||
player->kartstuff[k_comebacktimer] = comebacktime;
|
||||
|
||||
player->kartstuff[k_squishedtimer] = 2*TICRATE;
|
||||
|
||||
player->powers[pw_flashing] = K_GetKartFlashing(player);
|
||||
|
@ -1924,6 +1942,9 @@ void K_ExplodePlayer(player_t *player, mobj_t *source) // A bit of a hack, we ju
|
|||
return;
|
||||
}
|
||||
|
||||
if (source && source != player->mo && source->player)
|
||||
K_PlayHitEmSound(source);
|
||||
|
||||
player->mo->momz = 18*(mapheaderinfo[gamemap-1]->mobj_scale);
|
||||
player->mo->momx = player->mo->momy = 0;
|
||||
|
||||
|
@ -1954,11 +1975,20 @@ void K_ExplodePlayer(player_t *player, mobj_t *source) // A bit of a hack, we ju
|
|||
K_CalculateBattleWanted();
|
||||
}
|
||||
|
||||
if (!player->kartstuff[k_bumper])
|
||||
{
|
||||
player->kartstuff[k_comebacktimer] = comebacktime;
|
||||
if (player->kartstuff[k_comebackmode] == 2)
|
||||
{
|
||||
mobj_t *poof = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_EXPLODE);
|
||||
S_StartSound(poof, mobjinfo[MT_KARMAHITBOX].seesound);
|
||||
player->kartstuff[k_comebackmode] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
K_CheckBumpers();
|
||||
}
|
||||
|
||||
player->kartstuff[k_comebacktimer] = comebacktime;
|
||||
|
||||
player->kartstuff[k_spinouttype] = 1;
|
||||
player->kartstuff[k_spinouttimer] = 2*TICRATE+(TICRATE/2);
|
||||
|
||||
|
@ -4370,8 +4400,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;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -4416,14 +4449,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])
|
||||
|
@ -5909,7 +5957,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)
|
||||
|
|
105
src/p_inter.c
105
src/p_inter.c
|
@ -405,10 +405,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;
|
||||
|
@ -428,39 +427,39 @@ 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)
|
||||
{
|
||||
if (G_RaceGametype() || special->target->player->kartstuff[k_bumper] > 0)
|
||||
player->kartstuff[k_eggmanblame] = special->target->player-players;
|
||||
else
|
||||
player->kartstuff[k_eggmanblame] = player-players;
|
||||
|
||||
if (special->target->hnext == special)
|
||||
{
|
||||
P_SetTarget(&special->target->hnext, NULL);
|
||||
special->target->player->kartstuff[k_eggmanheld] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
P_RemoveMobj(special);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
if (special->target && special->target->player)
|
||||
{
|
||||
if (G_RaceGametype() || special->target->player->kartstuff[k_bumper] > 0)
|
||||
player->kartstuff[k_eggmanblame] = special->target->player-players;
|
||||
else
|
||||
player->kartstuff[k_eggmanblame] = player-players;
|
||||
|
||||
if (special->target->hnext == special)
|
||||
{
|
||||
P_SetTarget(&special->target->hnext, NULL);
|
||||
special->target->player->kartstuff[k_eggmanheld] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
P_RemoveMobj(special);
|
||||
return;
|
||||
case MT_KARMAHITBOX:
|
||||
if (!special->target->player)
|
||||
return;
|
||||
|
@ -476,7 +475,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]
|
||||
|
@ -537,6 +536,52 @@ 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);
|
||||
|
||||
if (player->kartstuff[k_bumper] == 1) // If you have only one bumper left, and see if it's a 1v1
|
||||
{
|
||||
INT32 numingame = 0;
|
||||
INT32 i;
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (!playeringame[i] || players[i].spectator || players[i].kartstuff[k_bumper] <= 0)
|
||||
continue;
|
||||
numingame++;
|
||||
}
|
||||
|
||||
if (numingame <= 2) // If so, then an extra two karma points so they are 100% certain to switch places; it's annoying to end matches with a fake kill
|
||||
special->target->player->kartstuff[k_comebackpoints] += 2;
|
||||
}
|
||||
|
||||
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:
|
||||
|
@ -8364,7 +8364,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)
|
||||
{
|
||||
|
@ -8378,12 +8378,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;
|
||||
|
@ -8750,7 +8753,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