mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-26 12:01:47 +00:00
Let give command give power-ups, amount = power-up duration in tics
This commit is contained in:
parent
996f01f418
commit
7130435667
2 changed files with 38 additions and 1 deletions
|
|
@ -67,6 +67,7 @@
|
|||
#include "k_vote.h"
|
||||
#include "k_zvote.h"
|
||||
#include "k_bot.h"
|
||||
#include "k_powerup.h"
|
||||
|
||||
#ifdef SRB2_CONFIG_ENABLE_WEBM_MOVIES
|
||||
#include "m_avrecorder.h"
|
||||
|
|
@ -440,6 +441,11 @@ static CV_PossibleValue_t kartdebugitem_cons_t[] =
|
|||
#define FOREACH( name, n ) { n, #name }
|
||||
KART_ITEM_ITERATOR,
|
||||
#undef FOREACH
|
||||
{POWERUP_SMONITOR, "SMonitor"},
|
||||
{POWERUP_BARRIER, "Barrier"},
|
||||
{POWERUP_BUMPER, "Bumper"},
|
||||
{POWERUP_BADGE, "Badge"},
|
||||
{POWERUP_SUPERFLICKY, "SuperFlicky"},
|
||||
{0}
|
||||
};
|
||||
consvar_t cv_kartdebugitem = CVAR_INIT ("debugitem", "None", CV_NETVAR|CV_CHEAT, kartdebugitem_cons_t, NULL);
|
||||
|
|
@ -2072,6 +2078,11 @@ void D_Cheat(INT32 playernum, INT32 cheat, ...)
|
|||
COPY(WRITEUINT8, unsigned int);
|
||||
break;
|
||||
|
||||
case CHEAT_GIVEPOWERUP:
|
||||
COPY(WRITEUINT8, unsigned int);
|
||||
COPY(WRITEUINT16, unsigned int);
|
||||
break;
|
||||
|
||||
case CHEAT_SCORE:
|
||||
COPY(WRITEUINT32, UINT32);
|
||||
break;
|
||||
|
|
@ -6112,6 +6123,20 @@ static void Got_Cheat(UINT8 **cp, INT32 playernum)
|
|||
break;
|
||||
}
|
||||
|
||||
case CHEAT_GIVEPOWERUP: {
|
||||
UINT8 powerup = READUINT8(*cp);
|
||||
UINT16 time = READUINT16(*cp);
|
||||
|
||||
// FIXME: we should have actual KITEM_ name array
|
||||
const char *powerupname = cv_kartdebugitem.PossibleValue[
|
||||
1 + NUMKARTITEMS + (powerup - FIRSTPOWERUP)].strvalue;
|
||||
|
||||
K_GivePowerUp(player, powerup, time);
|
||||
|
||||
CV_CheaterWarning(playernum, va("give powerup %s %d tics", powerupname, time));
|
||||
break;
|
||||
}
|
||||
|
||||
case CHEAT_SCORE: {
|
||||
UINT32 score = READUINT32(*cp);
|
||||
|
||||
|
|
@ -6419,7 +6444,18 @@ static void Command_KartGiveItem_f(void)
|
|||
}
|
||||
}
|
||||
|
||||
if (item < NUMKARTITEMS)
|
||||
if (item >= FIRSTPOWERUP)
|
||||
{
|
||||
INT32 amt;
|
||||
|
||||
if (ac > 2)
|
||||
amt = atoi(COM_Argv(2));
|
||||
else
|
||||
amt = BATTLE_POWERUP_TIME;
|
||||
|
||||
D_Cheat(consoleplayer, CHEAT_GIVEPOWERUP, item, amt);
|
||||
}
|
||||
else if (item < NUMKARTITEMS)
|
||||
{
|
||||
INT32 amt;
|
||||
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ typedef enum {
|
|||
CHEAT_SCORE,
|
||||
CHEAT_ANGLE,
|
||||
CHEAT_RESPAWNAT,
|
||||
CHEAT_GIVEPOWERUP,
|
||||
|
||||
NUMBER_OF_CHEATS
|
||||
} cheat_t;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue