mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Linedef Action 460 (Award Rings) now supports negative ring counts
UDMF now has a native ring drainer effect. Also fixes the WriteTextmap warning for the deprecated sector effect, which should have been encouraging you to use this action, not action 462!?
This commit is contained in:
parent
992840dd0f
commit
c5c78df946
2 changed files with 20 additions and 7 deletions
|
|
@ -2379,7 +2379,7 @@ static void P_WriteTextmap(void)
|
|||
{
|
||||
case 9:
|
||||
case 10:
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Sector %s has ring drainer effect, which is not supported in UDMF. Use action 462 instead.\n"), sizeu1(i));
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Sector %s has ring drainer effect, which is not supported in UDMF. Use action 460 instead.\n"), sizeu1(i));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
|||
25
src/p_spec.c
25
src/p_spec.c
|
|
@ -4194,17 +4194,30 @@ boolean P_ProcessSpecial(activator_t *activator, INT16 special, INT32 *args, cha
|
|||
{
|
||||
INT16 rings = args[0];
|
||||
INT32 delay = args[1];
|
||||
if (mo && mo->player)
|
||||
if (
|
||||
mo && mo->player // Player
|
||||
&& rings != 0 // Any effect
|
||||
&& (delay <= 0 || !(leveltime % delay)) // Timing
|
||||
)
|
||||
{
|
||||
// Don't award rings while SPB is targetting you
|
||||
if (mo->player->pflags & PF_RINGLOCK)
|
||||
return false;
|
||||
|
||||
if (delay <= 0 || !(leveltime % delay))
|
||||
if (rings > 0)
|
||||
{
|
||||
// Don't award rings while SPB is targetting you
|
||||
if (mo->player->pflags & PF_RINGLOCK)
|
||||
return false;
|
||||
|
||||
// args[2]: don't cap rings to 20
|
||||
K_AwardPlayerRings(mo->player, rings, args[2]);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Don't push you below baseline
|
||||
if (mo->player->rings < 0)
|
||||
return false;
|
||||
|
||||
mo->player->rings--;
|
||||
S_StartSound(mo, sfx_antiri);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue