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;
|
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;
|
return BMIT_CONTINUE;
|
||||||
|
|
||||||
if (PIT_SSMineChecks(thing) == true)
|
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)
|
if (t2->player->flashing > 0 && t2->hitlag == 0)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
if (K_TryPickMeUp(t1, t2, false))
|
||||||
|
return true;
|
||||||
|
|
||||||
// Bomb punting
|
// Bomb punting
|
||||||
if ((t1->state >= &states[S_SSMINE1] && t1->state <= &states[S_SSMINE4])
|
if ((t1->state >= &states[S_SSMINE1] && t1->state <= &states[S_SSMINE4])
|
||||||
|| (t1->state >= &states[S_SSMINE_DEPLOY8] && t1->state <= &states[S_SSMINE_EXPLODE2]))
|
|| (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)
|
if (P_MobjWasRemoved(t1) || P_MobjWasRemoved(t2) || !t1->player || !t2->player)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (G_SameTeam(t1->player, t2->player))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Clash instead of damage if both parties have any of these conditions
|
// Clash instead of damage if both parties have any of these conditions
|
||||||
auto canClash = [](mobj_t *t1, mobj_t *t2)
|
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.
|
// but HUD hooks run at variable timing based on your actual framerate.
|
||||||
static tic_t teams_lastleveltime = 0;
|
static tic_t teams_lastleveltime = 0;
|
||||||
|
|
||||||
static void K_drawKartTeamScores(void)
|
void K_drawKartTeamScores(boolean fromintermission)
|
||||||
{
|
{
|
||||||
if (G_GametypeHasTeams() == false)
|
if (G_GametypeHasTeams() == false)
|
||||||
{
|
{
|
||||||
|
|
@ -3559,8 +3559,16 @@ static void K_drawKartTeamScores(void)
|
||||||
INT32 basey = 0;
|
INT32 basey = 0;
|
||||||
INT32 flags = V_HUDTRANS|V_SLIDEIN;
|
INT32 flags = V_HUDTRANS|V_SLIDEIN;
|
||||||
INT32 snapflags = V_SNAPTOTOP|V_SNAPTORIGHT;
|
INT32 snapflags = V_SNAPTOTOP|V_SNAPTORIGHT;
|
||||||
|
|
||||||
if (use4p)
|
if (use4p)
|
||||||
snapflags = V_SNAPTOTOP;
|
snapflags = V_SNAPTOTOP;
|
||||||
|
|
||||||
|
if (fromintermission)
|
||||||
|
{
|
||||||
|
use4p = true;
|
||||||
|
snapflags = 0;
|
||||||
|
}
|
||||||
|
|
||||||
flags |= snapflags;
|
flags |= snapflags;
|
||||||
|
|
||||||
// bar stuff, relative to base
|
// 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.
|
// 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:
|
draw:
|
||||||
|
|
||||||
|
if (onsecondpass)
|
||||||
|
{
|
||||||
|
if (!fromintermission)
|
||||||
|
{
|
||||||
|
flags |= V_SNAPTOBOTTOM;
|
||||||
|
}
|
||||||
|
flags &= ~V_SNAPTOTOP;
|
||||||
|
basey = 170;
|
||||||
|
}
|
||||||
|
|
||||||
V_DrawScaledPatch(basex, basey, flags, kp_team_sticker[use4p]);
|
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][0], enemycolor);
|
||||||
V_DrawMappedPatch(basex, basey, flags, kp_team_underlay[use4p][1], allycolor);
|
V_DrawMappedPatch(basex, basey, flags, kp_team_underlay[use4p][1], allycolor);
|
||||||
|
|
@ -3807,12 +3827,9 @@ static void K_drawKartTeamScores(void)
|
||||||
you.text("{:02}", youscore);
|
you.text("{:02}", youscore);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (goagain)
|
if (shouldsecondpass && !onsecondpass)
|
||||||
{
|
{
|
||||||
goagain = false;
|
onsecondpass = true;
|
||||||
flags |= V_SNAPTOBOTTOM;
|
|
||||||
flags &= ~V_SNAPTOTOP;
|
|
||||||
basey = 170;
|
|
||||||
goto draw;
|
goto draw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -7572,10 +7589,7 @@ void K_drawKartHUD(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (G_GametypeHasTeams() == true)
|
K_drawKartTeamScores(false);
|
||||||
{
|
|
||||||
K_drawKartTeamScores();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (K_InRaceDuel())
|
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);
|
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
|
#ifdef __cplusplus
|
||||||
} // extern "C"
|
} // extern "C"
|
||||||
#endif
|
#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
|
return !(mobj->renderflags & (RF_TRANSMASK | RF_DONTDRAW)) && // the spraycan wasn't collected yet
|
||||||
P_CheckSight(stplyr->mo, const_cast<mobj_t*>(mobj));
|
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:
|
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;
|
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);
|
disty = FixedMul(minBump, normalisedy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mobj1->player && mobj2->player && G_SameTeam(mobj1->player, mobj2->player))
|
||||||
|
{
|
||||||
|
distx /= 3;
|
||||||
|
disty /= 3;
|
||||||
|
}
|
||||||
|
|
||||||
if (mass2 > 0)
|
if (mass2 > 0)
|
||||||
{
|
{
|
||||||
mobj1->momx = mobj1->momx - FixedMul(FixedDiv(2*mass2, mass1 + mass2), distx);
|
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:
|
||||||
case MT_EGGMANITEM_SHIELD:
|
case MT_EGGMANITEM_SHIELD:
|
||||||
case MT_BUBBLESHIELDTRAP:
|
case MT_BUBBLESHIELDTRAP:
|
||||||
|
case MT_SSMINE:
|
||||||
|
case MT_SSMINE_SHIELD:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -15861,6 +15869,10 @@ static boolean K_PickUp(player_t *player, mobj_t *picked)
|
||||||
case MT_SINK:
|
case MT_SINK:
|
||||||
type = KITEM_KITCHENSINK;
|
type = KITEM_KITCHENSINK;
|
||||||
break;
|
break;
|
||||||
|
case MT_SSMINE:
|
||||||
|
case MT_SSMINE_SHIELD:
|
||||||
|
type = KITEM_MINE;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
type = KITEM_SAD;
|
type = KITEM_SAD;
|
||||||
break;
|
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
|
case MT_GARDENTOP: // Frey
|
||||||
return true;
|
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:
|
default:
|
||||||
|
if (K_IsPickMeUpItem(type))
|
||||||
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1949,6 +1949,8 @@ finalcounter:
|
||||||
if ((modeattacking == ATTACKING_NONE) && demo.recording)
|
if ((modeattacking == ATTACKING_NONE) && demo.recording)
|
||||||
ST_DrawSaveReplayHint(0);
|
ST_DrawSaveReplayHint(0);
|
||||||
|
|
||||||
|
K_drawKartTeamScores(true);
|
||||||
|
|
||||||
if (Y_CanSkipIntermission())
|
if (Y_CanSkipIntermission())
|
||||||
{
|
{
|
||||||
const tic_t end = roundqueue.size != 0 ? 3*TICRATE : TICRATE;
|
const tic_t end = roundqueue.size != 0 ? 3*TICRATE : TICRATE;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue