mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'battle-whis-wednesday' into 'master'
Battle: Monitor drops, Overtime elimination, point cap See merge request KartKrew/Kart!1851
This commit is contained in:
commit
3aace4f777
6 changed files with 49 additions and 6 deletions
|
|
@ -122,6 +122,7 @@ void K_CheckBumpers(void)
|
|||
UINT8 numingame = 0;
|
||||
UINT8 nobumpers = 0;
|
||||
UINT8 eliminated = 0;
|
||||
SINT8 kingofthehill = -1;
|
||||
|
||||
if (!(gametyperules & GTR_BUMPERS))
|
||||
return;
|
||||
|
|
@ -148,6 +149,10 @@ void K_CheckBumpers(void)
|
|||
{
|
||||
eliminated++;
|
||||
}
|
||||
else
|
||||
{
|
||||
kingofthehill = i;
|
||||
}
|
||||
}
|
||||
|
||||
if (numingame - eliminated == 2 && battleovertime.enabled && battleovertime.radius <= BARRIER_MIN_RADIUS)
|
||||
|
|
@ -166,6 +171,13 @@ void K_CheckBumpers(void)
|
|||
}
|
||||
else if (eliminated >= numingame - 1)
|
||||
{
|
||||
if (kingofthehill != -1)
|
||||
{
|
||||
// If every other player is eliminated, the
|
||||
// last player standing wins by default.
|
||||
players[kingofthehill].roundscore = 100;
|
||||
}
|
||||
|
||||
P_DoAllPlayersExit(0, false);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3916,6 +3916,7 @@ void K_BattleAwardHit(player_t *player, player_t *victim, mobj_t *inflictor, UIN
|
|||
// Check this before adding to player score
|
||||
if ((gametyperules & GTR_BUMPERS) && finishOff && g_pointlimit <= player->roundscore)
|
||||
{
|
||||
player->roundscore = 100; // Make sure you win!
|
||||
P_DoAllPlayersExit(0, false);
|
||||
}
|
||||
|
||||
|
|
@ -13380,9 +13381,9 @@ UINT32 K_PointLimitForGametype(void)
|
|||
}
|
||||
}
|
||||
|
||||
if (ptsCap > 20)
|
||||
if (ptsCap > 16)
|
||||
{
|
||||
ptsCap = 20;
|
||||
ptsCap = 16;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ void Obj_MonitorThink(mobj_t *monitor);
|
|||
void Obj_MonitorPartThink(mobj_t *part);
|
||||
fixed_t Obj_MonitorGetDamage(mobj_t *monitor, mobj_t *inflictor, UINT8 damagetype);
|
||||
void Obj_MonitorOnDamage(mobj_t *monitor, mobj_t *inflictor, INT32 damage);
|
||||
void Obj_MonitorOnDeath(mobj_t *monitor);
|
||||
void Obj_MonitorOnDeath(mobj_t *monitor, mobj_t *source);
|
||||
void Obj_MonitorShardThink(mobj_t *shard);
|
||||
UINT32 Obj_MonitorGetEmerald(const mobj_t *monitor);
|
||||
void Obj_MonitorSetItemSpot(mobj_t *monitor, mobj_t *spot);
|
||||
|
|
|
|||
|
|
@ -670,7 +670,9 @@ Obj_MonitorOnDamage
|
|||
}
|
||||
|
||||
void
|
||||
Obj_MonitorOnDeath (mobj_t *monitor)
|
||||
Obj_MonitorOnDeath
|
||||
( mobj_t * monitor,
|
||||
mobj_t * source)
|
||||
{
|
||||
const UINT8 itemcount = get_monitor_itemcount(monitor);
|
||||
const angle_t ang = ANGLE_MAX / itemcount;
|
||||
|
|
@ -686,13 +688,21 @@ Obj_MonitorOnDeath (mobj_t *monitor)
|
|||
const SINT8 result = get_item_result();
|
||||
const UINT32 localseed = restore_item_rng(sharedseed);
|
||||
|
||||
adjust_monitor_drop(monitor,
|
||||
mobj_t *drop = adjust_monitor_drop(monitor,
|
||||
K_FlingPaperItem(
|
||||
monitor->x, monitor->y, monitor->z + (128 * mapobjectscale * flip),
|
||||
i * ang, flip,
|
||||
K_ItemResultToType(result),
|
||||
K_ItemResultToAmount(result)));
|
||||
|
||||
if (!P_MobjWasRemoved(source) && source->player)
|
||||
{
|
||||
P_SetTarget(&drop->tracer, source);
|
||||
drop->extravalue1 = 6*TICRATE;
|
||||
drop->colorized = true;
|
||||
drop->color = source->player->skincolor;
|
||||
}
|
||||
|
||||
// K_FlingPaperItem may advance RNG, so update our
|
||||
// copy of the seed afterward
|
||||
sharedseed = restore_item_rng(localseed);
|
||||
|
|
|
|||
|
|
@ -396,6 +396,12 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
|||
P_InstaThrust(player->mo, player->mo->angle, 20<<FRACBITS);
|
||||
return;
|
||||
case MT_FLOATINGITEM: // SRB2Kart
|
||||
if (special->extravalue1 > 0 && toucher != special->tracer)
|
||||
{
|
||||
player->pflags |= PF_CASTSHADOW;
|
||||
return;
|
||||
}
|
||||
|
||||
if (special->threshold >= FIRSTPOWERUP)
|
||||
{
|
||||
if (P_PlayerInPain(player))
|
||||
|
|
@ -1783,6 +1789,11 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget
|
|||
|
||||
if (gametyperules & GTR_BUMPERS)
|
||||
{
|
||||
if (battleovertime.enabled >= 10*TICRATE) // Overtime Barrier is armed
|
||||
{
|
||||
target->player->pflags |= PF_ELIMINATED;
|
||||
}
|
||||
|
||||
K_CheckBumpers();
|
||||
|
||||
if (target->player->roundscore > 1)
|
||||
|
|
@ -2365,7 +2376,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget
|
|||
}
|
||||
|
||||
case MT_MONITOR:
|
||||
Obj_MonitorOnDeath(target);
|
||||
Obj_MonitorOnDeath(target, source);
|
||||
break;
|
||||
case MT_BATTLEUFO:
|
||||
Obj_BattleUFODeath(target, inflictor);
|
||||
|
|
|
|||
|
|
@ -7587,6 +7587,15 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
|
|||
}
|
||||
|
||||
K_UpdateMobjItemOverlay(mobj, mobj->threshold, mobj->movecount);
|
||||
|
||||
if (mobj->extravalue1 > 0)
|
||||
{
|
||||
mobj->extravalue1--;
|
||||
if (mobj->extravalue1 < TICRATE)
|
||||
{
|
||||
mobj->colorized = mobj->extravalue1 & 1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case MT_ITEMCAPSULE:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue