diff --git a/src/k_collide.cpp b/src/k_collide.cpp index d42be35d0..3436ae936 100644 --- a/src/k_collide.cpp +++ b/src/k_collide.cpp @@ -269,7 +269,10 @@ static inline BlockItReturn_t PIT_SSMineSearch(mobj_t *thing) return BMIT_CONTINUE; } - if (thing == grenade->target && grenade->threshold != 0) // Don't blow up at your owner instantly. + if (thing == grenade->target) // Don't blow up at your owner instantly. + return BMIT_CONTINUE; + + if (grenade->target->player && thing->player && G_SameTeam(grenade->target->player, thing->player)) return BMIT_CONTINUE; if (PIT_SSMineChecks(thing) == true) @@ -388,6 +391,9 @@ boolean K_MineCollide(mobj_t *t1, mobj_t *t2) if (t2->player->flashing > 0 && t2->hitlag == 0) return true; + if (K_TryPickMeUp(t1, t2, false)) + return true; + // Bomb punting if ((t1->state >= &states[S_SSMINE1] && t1->state <= &states[S_SSMINE4]) || (t1->state >= &states[S_SSMINE_DEPLOY8] && t1->state <= &states[S_SSMINE_EXPLODE2])) @@ -1139,6 +1145,11 @@ boolean K_PvPTouchDamage(mobj_t *t1, mobj_t *t2) if (P_MobjWasRemoved(t1) || P_MobjWasRemoved(t2) || !t1->player || !t2->player) return false; + if (G_SameTeam(t1->player, t2->player)) + { + return false; + } + // Clash instead of damage if both parties have any of these conditions auto canClash = [](mobj_t *t1, mobj_t *t2) { diff --git a/src/k_hud.cpp b/src/k_hud.cpp index 762e35683..684a9394e 100644 --- a/src/k_hud.cpp +++ b/src/k_hud.cpp @@ -3580,7 +3580,7 @@ static tic_t scorechangecooldown = 0; // but HUD hooks run at variable timing based on your actual framerate. static tic_t teams_lastleveltime = 0; -static void K_drawKartTeamScores(void) +void K_drawKartTeamScores(boolean fromintermission, INT32 interoffset) { if (G_GametypeHasTeams() == false) { @@ -3599,8 +3599,13 @@ static void K_drawKartTeamScores(void) INT32 basey = 0; INT32 flags = V_HUDTRANS|V_SLIDEIN; INT32 snapflags = V_SNAPTOTOP|V_SNAPTORIGHT; + if (use4p) snapflags = V_SNAPTOTOP; + + if (fromintermission) + use4p = true; + flags |= snapflags; // bar stuff, relative to base @@ -3644,6 +3649,13 @@ static void K_drawKartTeamScores(void) faceoff = 4; } + if (fromintermission) + { + snapflags = 0; + flags = 0; + basex += interoffset; + } + UINT8 allies = stplyr->team; UINT8 enemies = (allies == TEAM_ORANGE) ? TEAM_BLUE : TEAM_ORANGE; @@ -3730,9 +3742,12 @@ static void K_drawKartTeamScores(void) } } - // replace scores with eased scores - allyscore = easedallyscore; - enemyscore = totalscore - allyscore; + if (!fromintermission) + { + // replace scores with eased scores + allyscore = easedallyscore; + enemyscore = totalscore - allyscore; + } } teams_lastleveltime = leveltime; @@ -3777,10 +3792,22 @@ static void K_drawKartTeamScores(void) } // Draw at the top and bottom of the screen in 4P. - boolean goagain = use4p; + // Draw only at the bottom in intermission. + boolean shouldsecondpass = use4p; + boolean onsecondpass = fromintermission; draw: + if (onsecondpass) + { + if (!fromintermission) + { + flags |= V_SNAPTOBOTTOM; + flags &= ~V_SNAPTOTOP; + } + basey = 170; + } + V_DrawScaledPatch(basex, basey, flags, kp_team_sticker[use4p]); V_DrawMappedPatch(basex, basey, flags, kp_team_underlay[use4p][0], enemycolor); V_DrawMappedPatch(basex, basey, flags, kp_team_underlay[use4p][1], allycolor); @@ -3788,8 +3815,10 @@ static void K_drawKartTeamScores(void) if (!use4p) V_DrawScaledPatch(basex, basey, flags, kp_team_you); - if (V_GetHUDTranslucency(0) != 10) + /* + if (V_GetHUDTranslucency(0) != 10 || fromintermission) return; + */ V_DrawFill(basex+barx, basey+bary, enemywidth, barheight, enemyfill|flags); V_DrawFill(basex+barx+enemywidth, basey+bary, allywidth, barheight, allyfill|flags); @@ -3847,12 +3876,9 @@ static void K_drawKartTeamScores(void) you.text("{:02}", youscore); } - if (goagain) + if (shouldsecondpass && !onsecondpass) { - goagain = false; - flags |= V_SNAPTOBOTTOM; - flags &= ~V_SNAPTOTOP; - basey = 170; + onsecondpass = true; goto draw; } @@ -7614,10 +7640,7 @@ void K_drawKartHUD(void) } } - if (G_GametypeHasTeams() == true) - { - K_drawKartTeamScores(); - } + K_drawKartTeamScores(false, 0); if (K_InRaceDuel()) { diff --git a/src/k_hud.h b/src/k_hud.h index 6a991bddf..e382c95ea 100644 --- a/src/k_hud.h +++ b/src/k_hud.h @@ -165,6 +165,8 @@ position_t K_GetKartObjectPosToMinimapPos(fixed_t objx, fixed_t objy); INT32 K_DrawGameControl(UINT16 x, UINT16 y, UINT8 player, const char *str, UINT8 alignment, UINT8 font, UINT32 flags); +void K_drawKartTeamScores(boolean fromintermission, INT32 interoffset); + #ifdef __cplusplus } // extern "C" #endif diff --git a/src/k_hud_track.cpp b/src/k_hud_track.cpp index 0ac07e641..b2a2d19c9 100644 --- a/src/k_hud_track.cpp +++ b/src/k_hud_track.cpp @@ -389,25 +389,12 @@ bool is_object_tracking_target(const mobj_t* mobj) return !(mobj->renderflags & (RF_TRANSMASK | RF_DONTDRAW)) && // the spraycan wasn't collected yet P_CheckSight(stplyr->mo, const_cast(mobj)); - case MT_JAWZ: - case MT_JAWZ_SHIELD: - case MT_ORBINAUT: - case MT_ORBINAUT_SHIELD: - case MT_DROPTARGET: - case MT_DROPTARGET_SHIELD: - case MT_LANDMINE: - case MT_BANANA: - case MT_BANANA_SHIELD: - case MT_GACHABOM: - case MT_BUBBLESHIELDTRAP: - case MT_EGGMANITEM: - case MT_EGGMANITEM_SHIELD: - return (mobj->target && !P_MobjWasRemoved(mobj->target) && ( - (mobj->target->player && stplyr == mobj->target->player) - || (mobj->target->player && G_SameTeam(stplyr, mobj->target->player)) - ) && P_CheckSight(stplyr->mo, const_cast(mobj))); - default: + if (K_IsPickMeUpItem(mobj->type)) + return (mobj->target && !P_MobjWasRemoved(mobj->target) && ( + (mobj->target->player && stplyr == mobj->target->player) + || (mobj->target->player && G_SameTeam(stplyr, mobj->target->player)) + ) && P_CheckSight(stplyr->mo, const_cast(mobj))); return false; } } diff --git a/src/k_kart.c b/src/k_kart.c index c8e03ddf1..ce5ea701e 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1102,6 +1102,12 @@ boolean K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2) disty = FixedMul(minBump, normalisedy); } + if (mobj1->player && mobj2->player && G_SameTeam(mobj1->player, mobj2->player)) + { + distx /= 3; + disty /= 3; + } + if (mass2 > 0) { mobj1->momx = mobj1->momx - FixedMul(FixedDiv(2*mass2, mass1 + mass2), distx); @@ -15861,6 +15867,8 @@ boolean K_IsPickMeUpItem(mobjtype_t type) case MT_EGGMANITEM: case MT_EGGMANITEM_SHIELD: case MT_BUBBLESHIELDTRAP: + case MT_SSMINE: + case MT_SSMINE_SHIELD: return true; default: return false; @@ -15910,6 +15918,10 @@ static boolean K_PickUp(player_t *player, mobj_t *picked) case MT_SINK: type = KITEM_KITCHENSINK; break; + case MT_SSMINE: + case MT_SSMINE_SHIELD: + type = KITEM_MINE; + break; default: type = KITEM_SAD; break; diff --git a/src/p_mobj.c b/src/p_mobj.c index 60a3a6409..da9a8634f 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -5435,20 +5435,9 @@ static boolean P_IsTrackerType(INT32 type) case MT_GARDENTOP: // Frey return true; - case MT_JAWZ_SHIELD: // Pick-me-up - case MT_ORBINAUT: - case MT_ORBINAUT_SHIELD: - case MT_DROPTARGET: - case MT_DROPTARGET_SHIELD: - case MT_LANDMINE: - case MT_BANANA: - case MT_BANANA_SHIELD: - case MT_GACHABOM: - case MT_EGGMANITEM: - case MT_EGGMANITEM_SHIELD: - return true; - default: + if (K_IsPickMeUpItem(type)) + return true; return false; } } diff --git a/src/y_inter.cpp b/src/y_inter.cpp index d2c509424..0f38f377d 100644 --- a/src/y_inter.cpp +++ b/src/y_inter.cpp @@ -2020,6 +2020,9 @@ void Y_IntermissionDrawer(void) // Returns early if there's no players to draw Y_PlayerStandingsDrawer(&data, x); + if (sorttic == -1 || ((intertic - sorttic) < 8)) + K_drawKartTeamScores(true, x); + // Draw bottom (and top) pieces skiptallydrawer: if (!LUA_HudEnabled(hud_intermissionmessages))