mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Teams juice
This commit is contained in:
parent
9397e07541
commit
adff23f106
7 changed files with 60 additions and 43 deletions
|
|
@ -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]))
|
||||
|
|
@ -1138,6 +1144,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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3540,7 +3540,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)
|
||||
{
|
||||
if (G_GametypeHasTeams() == false)
|
||||
{
|
||||
|
|
@ -3559,8 +3559,16 @@ 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;
|
||||
snapflags = 0;
|
||||
}
|
||||
|
||||
flags |= snapflags;
|
||||
|
||||
// bar stuff, relative to base
|
||||
|
|
@ -3737,10 +3745,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);
|
||||
|
|
@ -3807,12 +3827,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;
|
||||
}
|
||||
|
||||
|
|
@ -7572,10 +7589,7 @@ void K_drawKartHUD(void)
|
|||
}
|
||||
}
|
||||
|
||||
if (G_GametypeHasTeams() == true)
|
||||
{
|
||||
K_drawKartTeamScores();
|
||||
}
|
||||
K_drawKartTeamScores(false);
|
||||
|
||||
if (K_InRaceDuel())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -164,6 +164,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);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -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_t*>(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_t*>(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_t*>(mobj)));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
12
src/k_kart.c
12
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);
|
||||
|
|
@ -15812,6 +15818,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;
|
||||
|
|
@ -15861,6 +15869,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;
|
||||
|
|
|
|||
15
src/p_mobj.c
15
src/p_mobj.c
|
|
@ -5402,20 +5402,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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1949,6 +1949,8 @@ finalcounter:
|
|||
if ((modeattacking == ATTACKING_NONE) && demo.recording)
|
||||
ST_DrawSaveReplayHint(0);
|
||||
|
||||
K_drawKartTeamScores(true);
|
||||
|
||||
if (Y_CanSkipIntermission())
|
||||
{
|
||||
const tic_t end = roundqueue.size != 0 ? 3*TICRATE : TICRATE;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue