mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Levels of tripwire pass conditions.
- Invinc and sneaker can go up to BLASTER. - Flame shield and momentum make only the boost by themselves. - Hyuu and grow ignore tripwire so don't make ANY aura without any of the prior also occouring.
This commit is contained in:
parent
31835b380b
commit
97fab1ab20
4 changed files with 28 additions and 12 deletions
|
|
@ -279,7 +279,7 @@ boolean K_BotCanTakeCut(player_t *player)
|
|||
{
|
||||
if (
|
||||
#if 1
|
||||
K_TripwirePassConditions(player) == true
|
||||
K_TripwirePassConditions(player) != TRIPWIRE_NONE
|
||||
#else
|
||||
K_ApplyOffroad(player) == false
|
||||
#endif
|
||||
|
|
|
|||
25
src/k_kart.c
25
src/k_kart.c
|
|
@ -2944,23 +2944,32 @@ boolean K_SlopeResistance(player_t *player)
|
|||
return false;
|
||||
}
|
||||
|
||||
boolean K_TripwirePassConditions(player_t *player)
|
||||
UINT8 K_TripwirePassConditions(player_t *player)
|
||||
{
|
||||
if (
|
||||
player->invincibilitytimer ||
|
||||
player->sneakertimer ||
|
||||
player->growshrinktimer > 0 ||
|
||||
player->sneakertimer
|
||||
)
|
||||
return TRIPWIRE_BLASTER;
|
||||
|
||||
if (
|
||||
player->flamedash ||
|
||||
player->hyudorotimer ||
|
||||
player->speed > 2 * K_GetKartSpeed(player, false, true)
|
||||
)
|
||||
return true;
|
||||
return false;
|
||||
return TRIPWIRE_BOOST;
|
||||
|
||||
if (
|
||||
player->growshrinktimer > 0 ||
|
||||
player->hyudorotimer
|
||||
)
|
||||
return TRIPWIRE_IGNORE;
|
||||
|
||||
return TRIPWIRE_NONE;
|
||||
}
|
||||
|
||||
boolean K_TripwirePass(player_t *player)
|
||||
{
|
||||
return (K_TripwirePassConditions(player) || (player->tripwireLeniency > 0));
|
||||
return ((K_TripwirePassConditions(player) != TRIPWIRE_NONE) || (player->tripwireLeniency > 0));
|
||||
}
|
||||
|
||||
boolean K_WaterRun(player_t *player)
|
||||
|
|
@ -7221,7 +7230,7 @@ static void K_UpdateTripwire(player_t *player)
|
|||
}
|
||||
}
|
||||
|
||||
if (K_TripwirePassConditions(player) == true)
|
||||
if (K_TripwirePassConditions(player) != TRIPWIRE_NONE)
|
||||
{
|
||||
if (!boostExists)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -121,7 +121,13 @@ void K_StripOther(player_t *player);
|
|||
void K_MomentumToFacing(player_t *player);
|
||||
boolean K_ApplyOffroad(player_t *player);
|
||||
boolean K_SlopeResistance(player_t *player);
|
||||
boolean K_TripwirePassConditions(player_t *player);
|
||||
|
||||
#define TRIPWIRE_BLASTER 0x03
|
||||
#define TRIPWIRE_BOOST 0x02
|
||||
#define TRIPWIRE_IGNORE 0x01
|
||||
#define TRIPWIRE_NONE 0x00
|
||||
UINT8 K_TripwirePassConditions(player_t *player);
|
||||
|
||||
boolean K_TripwirePass(player_t *player);
|
||||
boolean K_WaterRun(player_t *player);
|
||||
void K_ApplyTripWire(player_t *player, tripwirestate_t state);
|
||||
|
|
|
|||
|
|
@ -7184,6 +7184,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
|
|||
{
|
||||
fixed_t convSpeed = (mobj->target->player->speed * 100) / K_GetKartSpeed(mobj->target->player, false, true);
|
||||
UINT8 trans = ((mobj->target->player->tripwireLeniency + 1) * (NUMTRANSMAPS+1)) / TRIPWIRETIME;
|
||||
UINT8 triplevel = K_TripwirePassConditions(mobj->target->player);
|
||||
|
||||
if (trans > NUMTRANSMAPS)
|
||||
trans = NUMTRANSMAPS;
|
||||
|
|
@ -7192,13 +7193,13 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
|
|||
|
||||
if ((trans >= NUMTRANSMAPS) // not a valid visibility
|
||||
|| (convSpeed < 150 && !(mobj->target->player->tripwireLeniency & 1)) // < 150% flickering
|
||||
|| (mobj->target->player->curshield == KSHIELD_FLAME && mobj->target->player->flamedash <= 0)) // flame shield but NOT boosting
|
||||
|| (triplevel < TRIPWIRE_BOOST)) // Not strong enough to make an aura
|
||||
{
|
||||
mobj->renderflags |= RF_DONTDRAW;
|
||||
}
|
||||
else
|
||||
{
|
||||
boolean blastermode = (convSpeed >= 180);
|
||||
boolean blastermode = (convSpeed >= 180) && (triplevel >= TRIPWIRE_BLASTER);
|
||||
|
||||
mobj->renderflags &= ~(RF_TRANSMASK|RF_DONTDRAW);
|
||||
if (trans != 0)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue