mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-02-23 14:01:14 +00:00
Merge branch 'small-battle-fix-friday' into 'master'
Don't Guard Break when damage state player collides; remove invincibility effect when dropping "S" power-up See merge request KartKrew/Kart!1317
This commit is contained in:
commit
219f3407cb
3 changed files with 21 additions and 15 deletions
|
|
@ -3769,6 +3769,9 @@ void K_DoGuardBreak(mobj_t *t1, mobj_t *t2) {
|
|||
if (!(t1->player && t2->player))
|
||||
return;
|
||||
|
||||
if (P_PlayerInPain(t2->player))
|
||||
return;
|
||||
|
||||
// short-circuit instashield for vfx visibility
|
||||
t1->player->instaShieldCooldown = GUARDBREAK_COOLDOWN;
|
||||
t1->player->guardCooldown = GUARDBREAK_COOLDOWN;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
/// \brief Battle mode power-up code
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "k_kart.h"
|
||||
#include "k_objects.h"
|
||||
#include "k_powerup.h"
|
||||
|
|
@ -82,28 +84,29 @@ void K_GivePowerUp(player_t* player, kartitems_t powerup, tic_t time)
|
|||
|
||||
void K_DropPowerUps(player_t* player)
|
||||
{
|
||||
auto simple_drop = [player](kartitems_t powerup, auto& timer)
|
||||
auto drop = [player](kartitems_t powerup, auto callback)
|
||||
{
|
||||
tic_t remaining = K_PowerUpRemaining(player, powerup);
|
||||
|
||||
if (remaining)
|
||||
{
|
||||
K_DropPaperItem(player, powerup, remaining);
|
||||
timer = 0;
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
simple_drop(POWERUP_SMONITOR, player->powerup.superTimer);
|
||||
simple_drop(POWERUP_BARRIER, player->powerup.barrierTimer);
|
||||
simple_drop(POWERUP_BADGE, player->powerup.rhythmBadgeTimer);
|
||||
auto& powerup = player->powerup;
|
||||
|
||||
if (K_PowerUpRemaining(player, POWERUP_SUPERFLICKY))
|
||||
{
|
||||
mobj_t* swarm = player->powerup.flickyController;
|
||||
drop(
|
||||
POWERUP_SMONITOR, [&]
|
||||
{
|
||||
// P_CheckInvincibilityTimer needs 1 tic to end the music
|
||||
player->invincibilitytimer -= std::min(+powerup.superTimer, player->invincibilitytimer - 1);
|
||||
powerup.superTimer = 0;
|
||||
}
|
||||
);
|
||||
|
||||
// Be sure to measure the remaining time before ending the power-up
|
||||
K_DropPaperItem(player, POWERUP_SUPERFLICKY, Obj_SuperFlickySwarmTime(swarm));
|
||||
|
||||
Obj_EndSuperFlickySwarm(swarm);
|
||||
}
|
||||
drop(POWERUP_BARRIER, [&] { powerup.barrierTimer = 0; });
|
||||
drop(POWERUP_BADGE, [&] { powerup.rhythmBadgeTimer = 0; });
|
||||
drop(POWERUP_SUPERFLICKY, [&] { Obj_EndSuperFlickySwarm(powerup.flickyController); });
|
||||
}
|
||||
|
|
|
|||
|
|
@ -335,7 +335,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
|||
case MT_FLOATINGITEM: // SRB2Kart
|
||||
if (special->threshold >= FIRSTPOWERUP)
|
||||
{
|
||||
if (player->flashing || player->tumbleBounces > 0)
|
||||
if (P_PlayerInPain(player))
|
||||
return;
|
||||
|
||||
K_GivePowerUp(player, special->threshold, special->movecount);
|
||||
|
|
@ -2428,7 +2428,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
|||
{
|
||||
// Extend the invincibility if the hit was a direct hit.
|
||||
if (inflictor == source && source->player->invincibilitytimer &&
|
||||
!K_PowerUpRemaining(player, POWERUP_SMONITOR))
|
||||
!K_PowerUpRemaining(source->player, POWERUP_SMONITOR))
|
||||
{
|
||||
tic_t kinvextend;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue