Merge branch 'sonicitems' of https://git.magicalgirl.moe/KartKrew/Kart into sonicitems

This commit is contained in:
TehRealSalt 2018-07-03 15:35:39 -04:00
commit 9a716a7cfe
24 changed files with 270 additions and 206 deletions

1
bin/Mingw/Release/null Normal file
View file

@ -0,0 +1 @@
Press any key to continue . . .

Binary file not shown.

View file

@ -0,0 +1 @@
Press any key to continue . . .

View file

@ -2145,6 +2145,7 @@ static void CL_ConnectToServer(boolean viams)
}
while (!(cl_mode == CL_CONNECTED && (client || (server && nodewaited <= pnumnodes))));
F_StartWaitingPlayers();
DEBFILE(va("Synchronisation Finished\n"));
displayplayer = consoleplayer;
@ -2493,7 +2494,7 @@ static void CL_RemovePlayer(INT32 playernum)
if (G_TagGametype()) //Check if you still have a game. Location flexible. =P
P_CheckSurvivors();
else if (G_BattleGametype()) // SRB2Kart
K_CheckBalloons();
K_CheckBumpers();
else if (G_RaceGametype())
P_CheckRacers();
}
@ -3878,9 +3879,8 @@ FILESTAMP
// Update the nettics
nettics[node] = realend;
// Don't do anything for packets of type NODEKEEPALIVE?
if (netconsole == -1 || netbuffer->packettype == PT_NODEKEEPALIVE
|| netbuffer->packettype == PT_NODEKEEPALIVEMIS)
// This should probably still timeout though, as the node should always have a player 1 number
if (netconsole == -1)
break;
// If a client sends a ticcmd it should mean they are done receiving the savegame
@ -3890,6 +3890,12 @@ FILESTAMP
/// \todo Use a separate cvar for that kind of timeout?
freezetimeout[node] = I_GetTime() + connectiontimeout;
// Don't do anything for packets of type NODEKEEPALIVE?
// Sryder 2018/07/01: Update the freezetimeout still!
if (netbuffer->packettype == PT_NODEKEEPALIVE
|| netbuffer->packettype == PT_NODEKEEPALIVEMIS)
break;
// Copy ticcmd
G_MoveTiccmd(&netcmds[maketic%BACKUPTICS][netconsole], &netbuffer->u.clientpak.cmd, 1);

View file

@ -388,6 +388,8 @@ static void D_Display(void)
case GS_WAITINGPLAYERS:
// The clientconnect drawer is independent...
// I don't think HOM from nothing drawing is independent...
F_WaitingPlayersDrawer();
case GS_DEDICATEDSERVER:
case GS_NULL:
break;

View file

@ -358,8 +358,8 @@ consvar_t cv_kartcheck = {"kartcheck", "Yes", CV_SAVE, CV_YesNo, NULL, 0, NULL,
static CV_PossibleValue_t kartinvinsfx_cons_t[] = {{0, "Music"}, {1, "SFX"}, {0, NULL}};
consvar_t cv_kartinvinsfx = {"kartinvinsfx", "SFX", CV_SAVE, kartinvinsfx_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_kartspeed = {"kartspeed", "Normal", CV_NETVAR|CV_CALL|CV_NOINIT, kartspeed_cons_t, KartSpeed_OnChange, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t kartballoons_cons_t[] = {{1, "MIN"}, {12, "MAX"}, {0, NULL}};
consvar_t cv_kartballoons = {"kartballoons", "3", CV_NETVAR|CV_CHEAT, kartballoons_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t kartbumpers_cons_t[] = {{1, "MIN"}, {12, "MAX"}, {0, NULL}};
consvar_t cv_kartbumpers = {"kartbumpers", "3", CV_NETVAR|CV_CHEAT, kartbumpers_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_kartfrantic = {"kartfrantic", "Off", CV_NETVAR|CV_CHEAT|CV_CALL|CV_NOINIT, CV_OnOff, KartFrantic_OnChange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_kartcomeback = {"kartcomeback", "On", CV_NETVAR|CV_CHEAT|CV_CALL|CV_NOINIT, CV_OnOff, KartComeback_OnChange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_kartmirror = {"kartmirror", "Off", CV_NETVAR|CV_CHEAT|CV_CALL|CV_NOINIT, CV_OnOff, KartMirror_OnChange, 0, NULL, NULL, 0, 0, NULL};
@ -2360,7 +2360,7 @@ static void Command_Suicide(void)
return;
}
/*if (!G_RaceGametype()) // srb2kart: not necessary, suiciding makes you lose a balloon in battle, so it's not desirable to use as a way to escape a hit
/*if (!G_RaceGametype()) // srb2kart: not necessary, suiciding makes you lose a bumper in battle, so it's not desirable to use as a way to escape a hit
{
CONS_Printf(M_GetText("You may only use this in co-op, race, and competition!\n"));
return;
@ -3255,7 +3255,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
if (G_TagGametype())
P_CheckSurvivors();
else if (G_BattleGametype())
K_CheckBalloons(); // SRB2Kart
K_CheckBumpers(); // SRB2Kart
else if (G_RaceGametype())
P_CheckRacers(); // also SRB2Kart
}

View file

@ -121,7 +121,7 @@ extern consvar_t cv_kartminimap;
extern consvar_t cv_kartcheck;
extern consvar_t cv_kartinvinsfx;
extern consvar_t cv_kartspeed;
extern consvar_t cv_kartballoons;
extern consvar_t cv_kartbumpers;
extern consvar_t cv_kartfrantic;
extern consvar_t cv_kartcomeback;
extern consvar_t cv_kartmirror;

View file

@ -321,8 +321,8 @@ typedef enum
k_sadtimer, // How long you've been sad
// Battle Mode vars
k_balloon, // Number of balloons left
k_comebackpoints, // Number of times you've bombed or gave an item to someone; once it's 3 it gets set back to 0 and you're given a balloon
k_bumper, // Number of bumpers left
k_comebackpoints, // Number of times you've bombed or gave an item to someone; once it's 3 it gets set back to 0 and you're given a bumper
k_comebackmode, // 0 = bomb, 1 = item
k_wanted, // Timer for determining WANTED status, lowers when hitting people, prevents the game turning into Camp Lazlo

View file

@ -6426,10 +6426,10 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
"S_SINKTRAIL2",
"S_SINKTRAIL3",
// Battle Mode balloon
"S_BATTLEBALLOON1",
"S_BATTLEBALLOON2",
"S_BATTLEBALLOON3",
// Battle Mode bumper
"S_BATTLEBUMPER1",
"S_BATTLEBUMPER2",
"S_BATTLEBUMPER3",
// DEZ respawn laser
"S_DEZLASER",
@ -6512,7 +6512,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
"S_DOOD_BOX4",
"S_DOOD_BOX5",
// D00Dkart - Diddy Kong Racing Balloon
// D00Dkart - Diddy Kong Racing Bumper
"S_DOOD_BALLOON",
// Chaotix Big Ring
@ -7171,7 +7171,7 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
"MT_SINK", // Kitchen Sink Stuff
"MT_SINKTRAIL",
"MT_BATTLEBALLOON", // Battle Mode balloon
"MT_BATTLEBUMPER", // Battle Mode bumper
"MT_DEZLASER",
@ -7621,7 +7621,7 @@ static const char *const KARTSTUFF_LIST[] = {
"SADTIMER",
// Battle Mode vars
"BALLOON",
"BUMPER",
"COMEBACKPOINTS",
"COMEBACKMODE",
};

View file

@ -58,6 +58,9 @@ static patch_t *ttkart; // *vroom* KART
static patch_t *ttcheckers; // *vroom* KART
static patch_t *ttkflash; // flash screen
static patch_t *driver[2]; // Driving character on the waiting screen
static UINT8 *waitcolormap; // colormap for the spinning character
static void F_SkyScroll(INT32 scrollspeed);
//
@ -1031,6 +1034,50 @@ void F_TitleDemoTicker(void)
keypressed = false;
}
// ================
// WAITINGPLAYERS
// ================
void F_StartWaitingPlayers(void)
{
INT32 i;
INT32 randskin;
spriteframe_t *sprframe;
wipegamestate = GS_TITLESCREEN; // technically wiping from title screen
finalecount = 0;
randskin = M_RandomKey(numskins);
waitcolormap = R_GetTranslationColormap(randskin, skins[randskin].prefcolor, 0);
for (i = 0; i < 2; i++)
{
sprframe = &skins[randskin].spritedef.spriteframes[(6+i) & FF_FRAMEMASK];
driver[i] = W_CachePatchNum(sprframe->lumppat[1], PU_LEVEL);
}
}
void F_WaitingPlayersTicker()
{
finalecount++;
// dumb hack, only start the music on the 1st tick so if you instantly go into the map you aren't hearing a tic of music
if (finalecount == 2)
S_ChangeMusicInternal("WAIT2J", true);
}
void F_WaitingPlayersDrawer(void)
{
UINT32 frame = (finalecount % 8) / 4; // The game only tics every other frame while waitingplayers
INT32 flags = V_FLIP;
const char *waittext1 = "You will join";
const char *waittext2 = "the next race...";
V_DrawFill(0, 0, 320, 200, 31);
V_DrawCreditString((160 - (V_CreditStringWidth(waittext1)>>1))<<FRACBITS, 48<<FRACBITS, 0, waittext1);
V_DrawCreditString((160 - (V_CreditStringWidth(waittext2)>>1))<<FRACBITS, 64<<FRACBITS, 0, waittext2);
V_DrawFixedPatch((160<<FRACBITS) - driver[frame]->width / 2, 150<<FRACBITS, 1<<FRACBITS, flags, driver[frame], waitcolormap);
}
// ==========
// CONTINUE
// ==========

View file

@ -39,6 +39,10 @@ FUNCMATH void F_GameEndDrawer(void);
void F_IntroDrawer(void);
void F_TitleScreenDrawer(void);
void F_StartWaitingPlayers(void);
void F_WaitingPlayersTicker(void);
void F_WaitingPlayersDrawer(void);
void F_GameEvaluationDrawer(void);
void F_StartGameEvaluation(void);
void F_GameEvaluationTicker(void);

View file

@ -1814,7 +1814,7 @@ boolean G_Responder(event_t *ev)
// SRB2Kart: Ehhh, who cares, Mario Kart's designed around screen-cheating anyway
/*if (gametype != GT_RACE)
{
if (players[consoleplayer].kartstuff[k_balloon] > 0)
if (players[consoleplayer].kartstuff[k_bumper] > 0)
continue;
}*/
@ -2158,9 +2158,11 @@ void G_Ticker(boolean run)
break;
case GS_TITLESCREEN:
case GS_WAITINGPLAYERS:
F_TitleScreenTicker(run);
break;
case GS_WAITINGPLAYERS:
F_WaitingPlayersTicker();
break;
case GS_DEDICATEDSERVER:
case GS_NULL:
@ -2293,7 +2295,7 @@ void G_PlayerReborn(INT32 player)
// SRB2kart
INT32 starpostwp;
INT32 balloon;
INT32 bumper;
INT32 comebackpoints;
INT32 wanted;
@ -2350,7 +2352,7 @@ void G_PlayerReborn(INT32 player)
// SRB2kart
starpostwp = players[player].kartstuff[k_starpostwp];
balloon = players[player].kartstuff[k_balloon];
bumper = players[player].kartstuff[k_bumper];
comebackpoints = players[player].kartstuff[k_comebackpoints];
wanted = players[player].kartstuff[k_wanted];
@ -2408,7 +2410,7 @@ void G_PlayerReborn(INT32 player)
// SRB2kart
p->kartstuff[k_starpostwp] = starpostwp; // TODO: get these out of kartstuff, it causes desync
p->kartstuff[k_balloon] = balloon;
p->kartstuff[k_bumper] = bumper;
p->kartstuff[k_comebackpoints] = comebackpoints;
p->kartstuff[k_comebacktimer] = comebacktime;
p->kartstuff[k_wanted] = wanted;
@ -3688,7 +3690,7 @@ void G_SaveGameData(boolean force)
if (force) // SRB2Kart: for enabling unlocks online, even if the game is modified
modifiedgame = savemoddata; // L-let's just sort of... hack around the cheat protection, because I'm too worried about just removing it @@;
else if (modifiedgame && !savemoddata)
else if (modifiedgame && !savemoddata)
{
free(savebuffer);
save_p = savebuffer = NULL;

View file

@ -2752,9 +2752,9 @@ state_t states[NUMSTATES] =
{SPR_SITR, 1, 5, {NULL}, 0, 0, S_SINKTRAIL3}, // S_SINKTRAIL2
{SPR_SITR, 2, 3, {NULL}, 0, 0, S_NULL}, // S_SINKTRAIL3
{SPR_KBLN, FF_FULLBRIGHT, -1, {NULL}, 0, 0, S_BATTLEBALLOON1}, // S_BATTLEBALLOON1
{SPR_KBLN, FF_FULLBRIGHT|1, -1, {NULL}, 0, 0, S_BATTLEBALLOON2}, // S_BATTLEBALLOON2
{SPR_KBLN, FF_FULLBRIGHT|2, -1, {NULL}, 0, 0, S_BATTLEBALLOON3}, // S_BATTLEBALLOON3
{SPR_KBLN, FF_FULLBRIGHT, -1, {NULL}, 0, 0, S_BATTLEBUMPER1}, // S_BATTLEBUMPER1
{SPR_KBLN, FF_FULLBRIGHT|1, -1, {NULL}, 0, 0, S_BATTLEBUMPER2}, // S_BATTLEBUMPER2
{SPR_KBLN, FF_FULLBRIGHT|2, -1, {NULL}, 0, 0, S_BATTLEBUMPER3}, // S_BATTLEBUMPER3
{SPR_DEZL, FF_FULLBRIGHT|FF_PAPERSPRITE, 8, {NULL}, 0, 0, S_NULL}, // S_DEZLASER
@ -15056,9 +15056,9 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL // raisestate
},
{ // MT_BATTLEBALLOON
{ // MT_BATTLEBUMPER
-1, // doomednum
S_BATTLEBALLOON1,// spawnstate
S_BATTLEBUMPER1,// spawnstate
1000, // spawnhealth
S_NULL, // seestate
sfx_None, // seesound

View file

@ -599,7 +599,7 @@ typedef enum sprite
SPR_LIGH, // Grow/shrink beams (Metallic Maddness)
SPR_SINK, // Kitchen Sink
SPR_SITR, // Kitchen Sink Trail
SPR_KBLN, // Battle Mode Balloon
SPR_KBLN, // Battle Mode Bumper
SPR_DEZL, // DEZ Laser respawn
@ -3273,10 +3273,10 @@ typedef enum state
S_SINKTRAIL2,
S_SINKTRAIL3,
// Battle Mode balloons
S_BATTLEBALLOON1,
S_BATTLEBALLOON2,
S_BATTLEBALLOON3,
// Battle Mode bumpers
S_BATTLEBUMPER1,
S_BATTLEBUMPER2,
S_BATTLEBUMPER3,
// DEZ Laser respawn
S_DEZLASER,
@ -3359,7 +3359,7 @@ typedef enum state
S_DOOD_BOX4,
S_DOOD_BOX5,
// D00Dkart - Diddy Kong Racing Balloon
// D00Dkart - Diddy Kong Racing Bumper
S_DOOD_BALLOON,
// Chaotix Big Ring
@ -4035,7 +4035,7 @@ typedef enum mobj_type
MT_SINK, // Kitchen Sink Stuff
MT_SINKTRAIL,
MT_BATTLEBALLOON, // Battle Mode balloons
MT_BATTLEBUMPER, // Battle Mode bumpers
MT_DEZLASER,

View file

@ -396,7 +396,7 @@ void K_RegisterKartStuff(void)
CV_RegisterVar(&cv_kartcheck);
CV_RegisterVar(&cv_kartinvinsfx);
CV_RegisterVar(&cv_kartspeed);
CV_RegisterVar(&cv_kartballoons);
CV_RegisterVar(&cv_kartbumpers);
CV_RegisterVar(&cv_kartfrantic);
CV_RegisterVar(&cv_kartcomeback);
CV_RegisterVar(&cv_kartmirror);
@ -725,7 +725,7 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd)
INT32 pdis = 0, useodds = 0;
INT32 spawnchance[NUMKARTRESULTS * NUMKARTODDS];
INT32 chance = 0, numchoices = 0;
INT32 avgballoon = 0;
INT32 avgbumper = 0;
boolean oddsvalid[9];
UINT8 disttable[14];
UINT8 distlen = 0;
@ -743,12 +743,12 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd)
if (!playeringame[i] || players[i].spectator)
continue;
pingame++;
if (players[i].kartstuff[k_balloon] > 0)
avgballoon += players[i].kartstuff[k_balloon];
if (players[i].kartstuff[k_bumper] > 0)
avgbumper += players[i].kartstuff[k_bumper];
}
if (pingame)
avgballoon /= pingame;
avgbumper /= pingame;
// This makes the roulette produce the random noises.
if ((player->kartstuff[k_itemroulette] % 3) == 1 && P_IsLocalPlayer(player))
@ -826,7 +826,7 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd)
useodds = 3;
else
{
SINT8 wantedpos = (player->kartstuff[k_balloon]-avgballoon)+2; // 0 is two balloons below average, 2 is average
SINT8 wantedpos = (player->kartstuff[k_bumper]-avgbumper)+2; // 0 is two bumpers below average, 2 is average
if (wantedpos > 2)
wantedpos = 2;
if (wantedpos < 0)
@ -1386,7 +1386,7 @@ fixed_t K_GetKartSpeed(player_t *player, boolean doboostpower)
break;
}
if (G_BattleGametype() && player->kartstuff[k_balloon] <= 0)
if (G_BattleGametype() && player->kartstuff[k_bumper] <= 0)
kartspeed = 1;
k_speed += kartspeed*3; // 153 - 177
@ -1403,7 +1403,7 @@ fixed_t K_GetKartAccel(player_t *player)
fixed_t k_accel = 32; // 36;
UINT8 kartspeed = player->kartspeed;
if (G_BattleGametype() && player->kartstuff[k_balloon] <= 0)
if (G_BattleGametype() && player->kartstuff[k_bumper] <= 0)
kartspeed = 1;
//k_accel += 3 * (9 - kartspeed); // 36 - 60
@ -1466,7 +1466,7 @@ void K_SpinPlayer(player_t *player, mobj_t *source, INT32 type, boolean trapitem
if (player->powers[pw_flashing] > 0 || player->kartstuff[k_squishedtimer] > 0 || player->kartstuff[k_spinouttimer] > 0
|| player->kartstuff[k_invincibilitytimer] > 0 || player->kartstuff[k_growshrinktimer] > 0 || player->kartstuff[k_hyudorotimer] > 0
|| (G_BattleGametype() && ((player->kartstuff[k_balloon] <= 0 && player->kartstuff[k_comebacktimer]) || player->kartstuff[k_comebackmode] == 1)))
|| (G_BattleGametype() && ((player->kartstuff[k_bumper] <= 0 && player->kartstuff[k_comebacktimer]) || player->kartstuff[k_comebackmode] == 1)))
return;
if (source && source != player->mo && source->player)
@ -1487,22 +1487,22 @@ void K_SpinPlayer(player_t *player, mobj_t *source, INT32 type, boolean trapitem
}
}
if (player->kartstuff[k_balloon] > 0)
if (player->kartstuff[k_bumper] > 0)
{
if (player->kartstuff[k_balloon] == 1)
if (player->kartstuff[k_bumper] == 1)
{
mobj_t *karmahitbox = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_KARMAHITBOX); // Player hitbox is too small!!
P_SetTarget(&karmahitbox->target, player->mo);
karmahitbox->destscale = player->mo->scale;
P_SetScale(karmahitbox, player->mo->scale);
CONS_Printf(M_GetText("%s lost all of their balloons!\n"), player_names[player-players]);
CONS_Printf(M_GetText("%s lost all of their bumpers!\n"), player_names[player-players]);
if (K_IsPlayerWanted(player))
K_CalculateBattleWanted();
}
player->kartstuff[k_balloon]--;
player->kartstuff[k_bumper]--;
}
K_CheckBalloons();
K_CheckBumpers();
}
player->kartstuff[k_comebacktimer] = comebacktime;
@ -1539,7 +1539,7 @@ void K_SquishPlayer(player_t *player, mobj_t *source)
if (player->powers[pw_flashing] > 0 || player->kartstuff[k_squishedtimer] > 0 || player->kartstuff[k_invincibilitytimer] > 0
|| player->kartstuff[k_growshrinktimer] > 0 || player->kartstuff[k_hyudorotimer] > 0
|| (G_BattleGametype() && ((player->kartstuff[k_balloon] <= 0 && player->kartstuff[k_comebacktimer]) || player->kartstuff[k_comebackmode] == 1)))
|| (G_BattleGametype() && ((player->kartstuff[k_bumper] <= 0 && player->kartstuff[k_comebacktimer]) || player->kartstuff[k_comebackmode] == 1)))
return;
player->kartstuff[k_sneakertimer] = 0;
@ -1554,22 +1554,22 @@ void K_SquishPlayer(player_t *player, mobj_t *source)
player->kartstuff[k_wanted] -= (wantedreduce/2);
}
if (player->kartstuff[k_balloon] > 0)
if (player->kartstuff[k_bumper] > 0)
{
if (player->kartstuff[k_balloon] == 1)
if (player->kartstuff[k_bumper] == 1)
{
mobj_t *karmahitbox = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_KARMAHITBOX); // Player hitbox is too small!!
P_SetTarget(&karmahitbox->target, player->mo);
karmahitbox->destscale = player->mo->scale;
P_SetScale(karmahitbox, player->mo->scale);
CONS_Printf(M_GetText("%s lost all of their balloons!\n"), player_names[player-players]);
CONS_Printf(M_GetText("%s lost all of their bumpers!\n"), player_names[player-players]);
if (K_IsPlayerWanted(player))
K_CalculateBattleWanted();
}
player->kartstuff[k_balloon]--;
player->kartstuff[k_bumper]--;
}
K_CheckBalloons();
K_CheckBumpers();
}
player->kartstuff[k_comebacktimer] = comebacktime;
@ -1597,7 +1597,7 @@ void K_ExplodePlayer(player_t *player, mobj_t *source) // A bit of a hack, we ju
if (player->powers[pw_flashing] > 0 || player->kartstuff[k_squishedtimer] > 0 || player->kartstuff[k_spinouttimer] > 0
|| player->kartstuff[k_invincibilitytimer] > 0 || player->kartstuff[k_growshrinktimer] > 0 || player->kartstuff[k_hyudorotimer] > 0
|| (G_BattleGametype() && ((player->kartstuff[k_balloon] <= 0 && player->kartstuff[k_comebacktimer]) || player->kartstuff[k_comebackmode] == 1)))
|| (G_BattleGametype() && ((player->kartstuff[k_bumper] <= 0 && player->kartstuff[k_comebacktimer]) || player->kartstuff[k_comebackmode] == 1)))
return;
player->mo->momz = 18*(mapheaderinfo[gamemap-1]->mobj_scale);
@ -1615,22 +1615,22 @@ void K_ExplodePlayer(player_t *player, mobj_t *source) // A bit of a hack, we ju
player->kartstuff[k_wanted] -= (wantedreduce/2);
}
if (player->kartstuff[k_balloon] > 0)
if (player->kartstuff[k_bumper] > 0)
{
if (player->kartstuff[k_balloon] == 1)
if (player->kartstuff[k_bumper] == 1)
{
mobj_t *karmahitbox = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_KARMAHITBOX); // Player hitbox is too small!!
P_SetTarget(&karmahitbox->target, player->mo);
karmahitbox->destscale = player->mo->scale;
P_SetScale(karmahitbox, player->mo->scale);
CONS_Printf(M_GetText("%s lost all of their balloons!\n"), player_names[player-players]);
CONS_Printf(M_GetText("%s lost all of their bumpers!\n"), player_names[player-players]);
if (K_IsPlayerWanted(player))
K_CalculateBattleWanted();
}
player->kartstuff[k_balloon]--;
player->kartstuff[k_bumper]--;
}
K_CheckBalloons();
K_CheckBumpers();
}
player->kartstuff[k_comebacktimer] = comebacktime;
@ -1654,9 +1654,9 @@ void K_ExplodePlayer(player_t *player, mobj_t *source) // A bit of a hack, we ju
return;
}
void K_StealBalloon(player_t *player, player_t *victim, boolean force)
void K_StealBumper(player_t *player, player_t *victim, boolean force)
{
INT32 newballoon;
INT32 newbumper;
angle_t newangle, diff;
fixed_t newx, newy;
mobj_t *newmo;
@ -1669,12 +1669,12 @@ void K_StealBalloon(player_t *player, player_t *victim, boolean force)
if (!force)
{
if (victim->kartstuff[k_balloon] <= 0) // || player->kartstuff[k_balloon] >= cv_kartballoons.value+2
if (victim->kartstuff[k_bumper] <= 0) // || player->kartstuff[k_bumper] >= cv_kartbumpers.value+2
return;
if ((player->powers[pw_flashing] > 0 || player->kartstuff[k_squishedtimer] > 0 || player->kartstuff[k_spinouttimer] > 0
|| player->kartstuff[k_invincibilitytimer] > 0 || player->kartstuff[k_growshrinktimer] > 0 || player->kartstuff[k_hyudorotimer] > 0
|| (player->kartstuff[k_balloon] <= 0 && player->kartstuff[k_comebacktimer]))
|| (player->kartstuff[k_bumper] <= 0 && player->kartstuff[k_comebacktimer]))
|| (victim->powers[pw_flashing] > 0 || victim->kartstuff[k_squishedtimer] > 0 || victim->kartstuff[k_spinouttimer] > 0
|| victim->kartstuff[k_invincibilitytimer] > 0 || victim->kartstuff[k_growshrinktimer] > 0 || victim->kartstuff[k_hyudorotimer] > 0))
return;
@ -1682,39 +1682,39 @@ void K_StealBalloon(player_t *player, player_t *victim, boolean force)
if (netgame)
{
if (player->kartstuff[k_balloon] <= 0)
if (player->kartstuff[k_bumper] <= 0)
CONS_Printf(M_GetText("%s is back in the game!\n"), player_names[player-players]);
else if (cv_hazardlog.value)
CONS_Printf(M_GetText("%s stole a balloon from %s!\n"), player_names[player-players], player_names[victim-players]);
CONS_Printf(M_GetText("%s stole a bumper from %s!\n"), player_names[player-players], player_names[victim-players]);
}
newballoon = player->kartstuff[k_balloon];
if (newballoon <= 1)
newbumper = player->kartstuff[k_bumper];
if (newbumper <= 1)
diff = 0;
else
diff = FixedAngle(360*FRACUNIT/newballoon);
diff = FixedAngle(360*FRACUNIT/newbumper);
newangle = player->mo->angle;
newx = player->mo->x + P_ReturnThrustX(player->mo, newangle + ANGLE_180, 64*FRACUNIT);
newy = player->mo->y + P_ReturnThrustY(player->mo, newangle + ANGLE_180, 64*FRACUNIT);
newmo = P_SpawnMobj(newx, newy, player->mo->z, MT_BATTLEBALLOON);
newmo->threshold = newballoon;
newmo = P_SpawnMobj(newx, newy, player->mo->z, MT_BATTLEBUMPER);
newmo->threshold = newbumper;
P_SetTarget(&newmo->tracer, victim->mo);
P_SetTarget(&newmo->target, player->mo);
newmo->angle = (diff * (newballoon-1));
newmo->angle = (diff * (newbumper-1));
newmo->color = victim->skincolor;
if (newballoon+1 < 2)
P_SetMobjState(newmo, S_BATTLEBALLOON3);
else if (newballoon+1 < 3)
P_SetMobjState(newmo, S_BATTLEBALLOON2);
if (newbumper+1 < 2)
P_SetMobjState(newmo, S_BATTLEBUMPER3);
else if (newbumper+1 < 3)
P_SetMobjState(newmo, S_BATTLEBUMPER2);
else
P_SetMobjState(newmo, S_BATTLEBALLOON1);
P_SetMobjState(newmo, S_BATTLEBUMPER1);
S_StartSound(player->mo, sfx_3db06);
player->kartstuff[k_balloon]++;
player->kartstuff[k_bumper]++;
player->kartstuff[k_comebackpoints] = 0;
player->powers[pw_flashing] = K_GetKartFlashing();
player->kartstuff[k_comebacktimer] = comebacktime;
@ -1965,7 +1965,7 @@ void K_SpawnBoostTrail(player_t *player)
if (!P_IsObjectOnGround(player->mo)
|| player->kartstuff[k_hyudorotimer] != 0
|| (G_BattleGametype() && player->kartstuff[k_balloon] <= 0 && player->kartstuff[k_comebacktimer]))
|| (G_BattleGametype() && player->kartstuff[k_bumper] <= 0 && player->kartstuff[k_comebacktimer]))
return;
if (player->mo->eflags & MFE_VERTICALFLIP)
@ -2343,7 +2343,7 @@ static void K_DoHyudoroSteal(player_t *player)
// Can steal from this player
&& (G_RaceGametype() //&& players[i].kartstuff[k_position] < player->kartstuff[k_position])
|| (G_BattleGametype() && players[i].kartstuff[k_balloon] > 0))
|| (G_BattleGametype() && players[i].kartstuff[k_bumper] > 0))
// Has an item
&& (players[i].kartstuff[k_itemtype]
@ -2730,7 +2730,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
else if (player->kartstuff[k_comebacktimer])
{
player->kartstuff[k_comebacktimer]--;
if (P_IsLocalPlayer(player) && player->kartstuff[k_balloon] <= 0 && player->kartstuff[k_comebacktimer] <= 0)
if (P_IsLocalPlayer(player) && player->kartstuff[k_bumper] <= 0 && player->kartstuff[k_comebacktimer] <= 0)
comebackshowninfo = true; // client has already seen the message
}
@ -2825,7 +2825,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
if (player->kartstuff[k_tauntvoices])
player->kartstuff[k_tauntvoices]--;
if (G_BattleGametype() && player->kartstuff[k_balloon] > 0)
if (G_BattleGametype() && player->kartstuff[k_bumper] > 0)
player->kartstuff[k_wanted]++;
// ???
@ -2985,7 +2985,7 @@ static void K_KartDrift(player_t *player, boolean onground)
UINT8 kartspeed = player->kartspeed;
fixed_t dsone, dstwo;
if (G_BattleGametype() && player->kartstuff[k_balloon] <= 0)
if (G_BattleGametype() && player->kartstuff[k_bumper] <= 0)
kartspeed = 1;
// IF YOU CHANGE THESE: MAKE SURE YOU UPDATE THE SAME VALUES IN p_mobjc, "case MT_DRIFT:"
@ -3205,9 +3205,9 @@ static void K_KartUpdatePosition(player_t *player)
}
else
{
if (players[i].kartstuff[k_balloon] == player->kartstuff[k_balloon] && players[i].score > player->score)
if (players[i].kartstuff[k_bumper] == player->kartstuff[k_bumper] && players[i].score > player->score)
position++;
else if (players[i].kartstuff[k_balloon] > player->kartstuff[k_balloon])
else if (players[i].kartstuff[k_bumper] > player->kartstuff[k_bumper])
position++;
}
}
@ -3707,13 +3707,13 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
player->mo->eflags &= ~(MFE_DRAWONLYFORP1|MFE_DRAWONLYFORP2|MFE_DRAWONLYFORP3|MFE_DRAWONLYFORP4);
}
if (G_BattleGametype() && player->kartstuff[k_balloon] <= 0) // dead in match? you da bomb
if (G_BattleGametype() && player->kartstuff[k_bumper] <= 0) // dead in match? you da bomb
{
K_StripItems(player);
player->mo->flags2 |= MF2_SHADOW;
player->powers[pw_flashing] = player->kartstuff[k_comebacktimer];
}
else if (G_RaceGametype() || player->kartstuff[k_balloon] > 0)
else if (G_RaceGametype() || player->kartstuff[k_bumper] > 0)
{
player->mo->flags2 &= ~MF2_SHADOW;
}
@ -3727,7 +3727,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
player->mo->friction += 4608;
if (player->speed > 0 && cmd->forwardmove < 0 && player->mo->friction == 59392)
player->mo->friction += 1608;
if (G_BattleGametype() && player->kartstuff[k_balloon] <= 0)
if (G_BattleGametype() && player->kartstuff[k_bumper] <= 0)
{
player->mo->friction += 1228;
@ -3830,10 +3830,10 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
void K_CalculateBattleWanted(void)
{
UINT8 numingame = 0, numwanted = 0;
SINT8 bestballoonplayer = -1, bestballoon = -1;
SINT8 bestbumperplayer = -1, bestbumper = -1;
SINT8 camppos[MAXPLAYERS]; // who is the biggest camper
UINT8 ties = 0, nextcamppos = 0;
boolean setballoon = false;
boolean setbumper = false;
UINT8 i, j;
if (!G_BattleGametype())
@ -3856,24 +3856,24 @@ void K_CalculateBattleWanted(void)
if (players[i].exiting) // We're done, don't calculate.
return;
if (players[i].kartstuff[k_balloon] <= 0) // Not alive, so don't do anything else
if (players[i].kartstuff[k_bumper] <= 0) // Not alive, so don't do anything else
continue;
numingame++;
if (bestballoon == -1 || players[i].kartstuff[k_balloon] > bestballoon)
if (bestbumper == -1 || players[i].kartstuff[k_bumper] > bestbumper)
{
bestballoon = players[i].kartstuff[k_balloon];
bestballoonplayer = i;
bestbumper = players[i].kartstuff[k_bumper];
bestbumperplayer = i;
}
else if (players[i].kartstuff[k_balloon] == bestballoon)
bestballoonplayer = -1; // Tie, no one has best balloon.
else if (players[i].kartstuff[k_bumper] == bestbumper)
bestbumperplayer = -1; // Tie, no one has best bumper.
for (j = 0; j < MAXPLAYERS; j++)
{
if (!playeringame[j] || players[j].spectator)
continue;
if (players[j].kartstuff[k_balloon] <= 0)
if (players[j].kartstuff[k_bumper] <= 0)
continue;
if (j == i)
continue;
@ -3900,16 +3900,16 @@ void K_CalculateBattleWanted(void)
{
if (i+1 > numwanted) // Not enough players for this slot to be wanted!
battlewanted[i] = -1;
else if (bestballoonplayer != -1 && !setballoon) // If there's a player who has an untied balloon lead over everyone else, they are the first to be wanted.
else if (bestbumperplayer != -1 && !setbumper) // If there's a player who has an untied bumper lead over everyone else, they are the first to be wanted.
{
battlewanted[i] = bestballoonplayer;
setballoon = true; // Don't set twice
battlewanted[i] = bestbumperplayer;
setbumper = true; // Don't set twice
}
else
{
// Don't accidentally set the same player, if the bestballoonplayer is also a huge camper.
while (bestballoonplayer != -1 && camppos[nextcamppos] != -1
&& bestballoonplayer == camppos[nextcamppos])
// Don't accidentally set the same player, if the bestbumperplayer is also a huge camper.
while (bestbumperplayer != -1 && camppos[nextcamppos] != -1
&& bestbumperplayer == camppos[nextcamppos])
nextcamppos++;
// Do not add *any* more people if there's too many times that are tied with others.
@ -3946,7 +3946,7 @@ void K_CalculateBattleWanted(void)
}
}
void K_CheckBalloons(void)
void K_CheckBumpers(void)
{
UINT8 i;
UINT8 numingame = 0;
@ -3973,7 +3973,7 @@ void K_CheckBalloons(void)
numingame++;
winnerscoreadd += players[i].score;
if (players[i].kartstuff[k_balloon] <= 0) // if you don't have any balloons, you're probably not a winner
if (players[i].kartstuff[k_bumper] <= 0) // if you don't have any bumpers, you're probably not a winner
continue;
else if (winnernum > -1) // TWO winners? that's dumb :V
return;
@ -4010,8 +4010,8 @@ static patch_t *kp_timestickerwide;
static patch_t *kp_lapsticker;
static patch_t *kp_lapstickernarrow;
static patch_t *kp_splitlapflag;
static patch_t *kp_balloonsticker;
static patch_t *kp_balloonstickerwide;
static patch_t *kp_bumpersticker;
static patch_t *kp_bumperstickerwide;
static patch_t *kp_karmasticker;
static patch_t *kp_splitkarmabomb;
static patch_t *kp_timeoutsticker;
@ -4027,8 +4027,8 @@ static patch_t *kp_facesecond;
static patch_t *kp_facethird;
static patch_t *kp_facefourth;
static patch_t *kp_rankballoon;
static patch_t *kp_ranknoballoons;
static patch_t *kp_rankbumper;
static patch_t *kp_ranknobumpers;
static patch_t *kp_battlewin;
static patch_t *kp_battlelose;
@ -4078,8 +4078,8 @@ void K_LoadKartHUDGraphics(void)
kp_lapsticker = W_CachePatchName("K_STLAPS", PU_HUDGFX);
kp_lapstickernarrow = W_CachePatchName("K_STLAPN", PU_HUDGFX);
kp_splitlapflag = W_CachePatchName("K_SPTLAP", PU_HUDGFX);
kp_balloonsticker = W_CachePatchName("K_STBALN", PU_HUDGFX);
kp_balloonstickerwide = W_CachePatchName("K_STBALW", PU_HUDGFX);
kp_bumpersticker = W_CachePatchName("K_STBALN", PU_HUDGFX);
kp_bumperstickerwide = W_CachePatchName("K_STBALW", PU_HUDGFX);
kp_karmasticker = W_CachePatchName("K_STKARM", PU_HUDGFX);
kp_splitkarmabomb = W_CachePatchName("K_SPTKRM", PU_HUDGFX);
kp_timeoutsticker = W_CachePatchName("K_STTOUT", PU_HUDGFX);
@ -4117,8 +4117,8 @@ void K_LoadKartHUDGraphics(void)
kp_facefourth = W_CachePatchName("K_PFACE4", PU_HUDGFX);
// Extra ranking icons
kp_rankballoon = W_CachePatchName("K_BLNICO", PU_HUDGFX);
kp_ranknoballoons = W_CachePatchName("K_NOBLNS", PU_HUDGFX);
kp_rankbumper = W_CachePatchName("K_BLNICO", PU_HUDGFX);
kp_ranknobumpers = W_CachePatchName("K_NOBLNS", PU_HUDGFX);
// Battle graphics
kp_battlewin = W_CachePatchName("K_BWIN", PU_HUDGFX);
@ -4664,7 +4664,7 @@ static void K_drawKartPositionFaces(void)
INT32 rankplayer[MAXPLAYERS];
INT32 rankcolor[MAXPLAYERS];
INT32 myplayer;
INT32 balloonx;
INT32 bumperx;
UINT8 *colormap;
patch_t *localpatch = kp_facenull;
@ -4704,7 +4704,7 @@ static void K_drawKartPositionFaces(void)
if (players[rankplayer[i]].spectator) continue; // Spectators are ignored
if (!players[rankplayer[i]].mo) continue;
balloonx = FACE_X+18;
bumperx = FACE_X+18;
if (rankcolor[i] == 0)
{
@ -4712,24 +4712,24 @@ static void K_drawKartPositionFaces(void)
if (rankplayer[i] != myplayer)
{
V_DrawSmallTranslucentPatch(FACE_X, Y, V_HUDTRANS|V_SNAPTOLEFT, faceprefix[players[rankplayer[i]].skin]);
if (G_BattleGametype() && players[rankplayer[i]].kartstuff[k_balloon] > 0)
if (G_BattleGametype() && players[rankplayer[i]].kartstuff[k_bumper] > 0)
{
for (j = 0; j < players[rankplayer[i]].kartstuff[k_balloon]; j++)
for (j = 0; j < players[rankplayer[i]].kartstuff[k_bumper]; j++)
{
V_DrawSmallTranslucentPatch(balloonx, Y+10, V_HUDTRANS|V_SNAPTOLEFT, kp_rankballoon);
balloonx += 3;
V_DrawSmallTranslucentPatch(bumperx, Y+10, V_HUDTRANS|V_SNAPTOLEFT, kp_rankbumper);
bumperx += 3;
}
}
}
else
{
V_DrawSmallScaledPatch(FACE_X, Y, V_HUDTRANS|V_SNAPTOLEFT, faceprefix[players[rankplayer[i]].skin]);
if (G_BattleGametype() && players[rankplayer[i]].kartstuff[k_balloon] > 0)
if (G_BattleGametype() && players[rankplayer[i]].kartstuff[k_bumper] > 0)
{
for (j = 0; j < players[rankplayer[i]].kartstuff[k_balloon]; j++)
for (j = 0; j < players[rankplayer[i]].kartstuff[k_bumper]; j++)
{
V_DrawSmallScaledPatch(balloonx, Y+10, V_HUDTRANS|V_SNAPTOLEFT, kp_rankballoon);
balloonx += 3;
V_DrawSmallScaledPatch(bumperx, Y+10, V_HUDTRANS|V_SNAPTOLEFT, kp_rankbumper);
bumperx += 3;
}
}
}
@ -4749,24 +4749,24 @@ static void K_drawKartPositionFaces(void)
if (rankplayer[i] != myplayer)
{
V_DrawSmallTranslucentMappedPatch(FACE_X, Y, V_HUDTRANS|V_SNAPTOLEFT, faceprefix[players[rankplayer[i]].skin], colormap);
if (G_BattleGametype() && players[rankplayer[i]].kartstuff[k_balloon] > 0)
if (G_BattleGametype() && players[rankplayer[i]].kartstuff[k_bumper] > 0)
{
for (j = 0; j < players[rankplayer[i]].kartstuff[k_balloon]; j++)
for (j = 0; j < players[rankplayer[i]].kartstuff[k_bumper]; j++)
{
V_DrawSmallTranslucentMappedPatch(balloonx, Y+10, V_HUDTRANS|V_SNAPTOLEFT, kp_rankballoon, colormap);
balloonx += 3;
V_DrawSmallTranslucentMappedPatch(bumperx, Y+10, V_HUDTRANS|V_SNAPTOLEFT, kp_rankbumper, colormap);
bumperx += 3;
}
}
}
else
{
V_DrawSmallMappedPatch(FACE_X, Y, V_HUDTRANS|V_SNAPTOLEFT, faceprefix[players[rankplayer[i]].skin], colormap);
if (G_BattleGametype() && players[rankplayer[i]].kartstuff[k_balloon] > 0)
if (G_BattleGametype() && players[rankplayer[i]].kartstuff[k_bumper] > 0)
{
for (j = 0; j < players[rankplayer[i]].kartstuff[k_balloon]; j++)
for (j = 0; j < players[rankplayer[i]].kartstuff[k_bumper]; j++)
{
V_DrawSmallMappedPatch(balloonx, Y+10, V_HUDTRANS|V_SNAPTOLEFT, kp_rankballoon, colormap);
balloonx += 3;
V_DrawSmallMappedPatch(bumperx, Y+10, V_HUDTRANS|V_SNAPTOLEFT, kp_rankbumper, colormap);
bumperx += 3;
}
}
}
@ -4784,15 +4784,15 @@ static void K_drawKartPositionFaces(void)
if (rankplayer[i] != myplayer)
{
if (G_BattleGametype() && players[rankplayer[i]].kartstuff[k_balloon] <= 0)
V_DrawSmallTranslucentPatch(FACE_X-2, Y, V_HUDTRANS|V_SNAPTOLEFT, kp_ranknoballoons);
if (G_BattleGametype() && players[rankplayer[i]].kartstuff[k_bumper] <= 0)
V_DrawSmallTranslucentPatch(FACE_X-2, Y, V_HUDTRANS|V_SNAPTOLEFT, kp_ranknobumpers);
else
V_DrawSmallTranslucentPatch(FACE_X, Y, V_HUDTRANS|V_SNAPTOLEFT, localpatch);
}
else
{
if (G_BattleGametype() && players[rankplayer[i]].kartstuff[k_balloon] <= 0)
V_DrawSmallScaledPatch(FACE_X-2, Y, V_HUDTRANS|V_SNAPTOLEFT, kp_ranknoballoons);
if (G_BattleGametype() && players[rankplayer[i]].kartstuff[k_bumper] <= 0)
V_DrawSmallScaledPatch(FACE_X-2, Y, V_HUDTRANS|V_SNAPTOLEFT, kp_ranknobumpers);
else
V_DrawSmallScaledPatch(FACE_X, Y, V_HUDTRANS|V_SNAPTOLEFT, localpatch);
}
@ -4847,38 +4847,38 @@ static void K_drawKartSpeedometer(void)
}
}
static void K_drawKartBalloonsOrKarma(void)
static void K_drawKartBumpersOrKarma(void)
{
UINT8 *colormap = R_GetTranslationColormap(TC_DEFAULT, stplyr->skincolor, 0);
INT32 splitflags = K_calcSplitFlags(V_SNAPTOBOTTOM|V_SNAPTOLEFT);
if (splitscreen > 1)
{
if (stplyr->kartstuff[k_balloon] <= 0)
if (stplyr->kartstuff[k_bumper] <= 0)
{
V_DrawMappedPatch(LAPS_X, LAPS_Y-1, V_HUDTRANS|splitflags, kp_splitkarmabomb, colormap);
V_DrawString(LAPS_X+13, LAPS_Y+1, V_HUDTRANS|splitflags, va("%d/3", stplyr->kartstuff[k_comebackpoints]));
}
else
{
V_DrawMappedPatch(LAPS_X, LAPS_Y-1, V_HUDTRANS|splitflags, kp_rankballoon, colormap);
V_DrawString(LAPS_X+13, LAPS_Y+1, V_HUDTRANS|splitflags, va("%d/%d", stplyr->kartstuff[k_balloon], cv_kartballoons.value));
V_DrawMappedPatch(LAPS_X, LAPS_Y-1, V_HUDTRANS|splitflags, kp_rankbumper, colormap);
V_DrawString(LAPS_X+13, LAPS_Y+1, V_HUDTRANS|splitflags, va("%d/%d", stplyr->kartstuff[k_bumper], cv_kartbumpers.value));
}
}
else
{
if (stplyr->kartstuff[k_balloon] <= 0)
if (stplyr->kartstuff[k_bumper] <= 0)
{
V_DrawMappedPatch(LAPS_X, LAPS_Y, V_HUDTRANS|splitflags, kp_karmasticker, colormap);
V_DrawKartString(LAPS_X+59, LAPS_Y+3, V_HUDTRANS|splitflags, va("%d/3", stplyr->kartstuff[k_comebackpoints]));
}
else
{
if (stplyr->kartstuff[k_balloon] > 9 && cv_kartballoons.value > 9)
V_DrawMappedPatch(LAPS_X, LAPS_Y, V_HUDTRANS|splitflags, kp_balloonstickerwide, colormap);
if (stplyr->kartstuff[k_bumper] > 9 && cv_kartbumpers.value > 9)
V_DrawMappedPatch(LAPS_X, LAPS_Y, V_HUDTRANS|splitflags, kp_bumperstickerwide, colormap);
else
V_DrawMappedPatch(LAPS_X, LAPS_Y, V_HUDTRANS|splitflags, kp_balloonsticker, colormap);
V_DrawKartString(LAPS_X+47, LAPS_Y+3, V_HUDTRANS|splitflags, va("%d/%d", stplyr->kartstuff[k_balloon], cv_kartballoons.value));
V_DrawMappedPatch(LAPS_X, LAPS_Y, V_HUDTRANS|splitflags, kp_bumpersticker, colormap);
V_DrawKartString(LAPS_X+47, LAPS_Y+3, V_HUDTRANS|splitflags, va("%d/%d", stplyr->kartstuff[k_bumper], cv_kartbumpers.value));
}
}
}
@ -5234,7 +5234,7 @@ static void K_drawKartMinimap(void)
continue;
}
if (G_BattleGametype() && players[i].kartstuff[k_balloon] <= 0)
if (G_BattleGametype() && players[i].kartstuff[k_bumper] <= 0)
continue;
if (players[i].kartstuff[k_hyudorotimer] > 0)
{
@ -5298,12 +5298,12 @@ static void K_drawBattleFullscreen(void)
{
if (stplyr == &players[displayplayer])
V_DrawFadeScreen(0xFF00, 16);
if (stplyr->kartstuff[k_balloon])
if (stplyr->kartstuff[k_bumper])
V_DrawFixedPatch(x<<FRACBITS, y<<FRACBITS, scale, splitflags, kp_battlewin, NULL);
else if (splitscreen < 2)
V_DrawFixedPatch(x<<FRACBITS, y<<FRACBITS, scale, splitflags, kp_battlelose, NULL);
}
else if (stplyr->kartstuff[k_balloon] <= 0 && stplyr->kartstuff[k_comebacktimer] && comeback)
else if (stplyr->kartstuff[k_bumper] <= 0 && stplyr->kartstuff[k_comebacktimer] && comeback)
{
INT32 t = stplyr->kartstuff[k_comebacktimer]/TICRATE;
INT32 txoff = 0;
@ -5470,7 +5470,7 @@ void K_drawKartHUD(void)
// Draw full screen stuff that turns off the rest of the HUD
if ((G_BattleGametype())
&& (stplyr->exiting
|| (stplyr->kartstuff[k_balloon] <= 0
|| (stplyr->kartstuff[k_bumper] <= 0
&& stplyr->kartstuff[k_comebacktimer]
&& comeback
&& stplyr->playerstate == PST_LIVE)))
@ -5533,7 +5533,7 @@ void K_drawKartHUD(void)
else if (G_BattleGametype()) // Battle-only
{
// Draw the hits left!
K_drawKartBalloonsOrKarma();
K_drawKartBumpersOrKarma();
}
}

View file

@ -28,7 +28,7 @@ void K_KartPlayerAfterThink(player_t *player);
void K_SpinPlayer(player_t *player, mobj_t *source, INT32 type, boolean trapitem);
void K_SquishPlayer(player_t *player, mobj_t *source);
void K_ExplodePlayer(player_t *player, mobj_t *source);
void K_StealBalloon(player_t *player, player_t *victim, boolean force);
void K_StealBumper(player_t *player, player_t *victim, boolean force);
void K_SpawnKartExplosion(fixed_t x, fixed_t y, fixed_t z, fixed_t radius, INT32 number, mobjtype_t type, angle_t rotangle, boolean spawncenter, boolean ghostit, mobj_t *source);
void K_SpawnMineExplosion(mobj_t *source, UINT8 color);
void K_SpawnBoostTrail(player_t *player);
@ -48,7 +48,7 @@ UINT16 K_GetKartFlashing(void);
fixed_t K_3dKartMovement(player_t *player, boolean onground, fixed_t forwardmove);
void K_MoveKartPlayer(player_t *player, boolean onground);
void K_CalculateBattleWanted(void);
void K_CheckBalloons(void);
void K_CheckBumpers(void);
INT32 K_calcSplitFlags(INT32 snapflags);
void K_LoadKartHUDGraphics(void);

View file

@ -2069,7 +2069,7 @@ static int lib_kExplodePlayer(lua_State *L)
return 0;
}
static int lib_kStealBalloon(lua_State *L)
static int lib_kStealBumper(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
player_t *victim = *((player_t **)luaL_checkudata(L, 2, META_PLAYER));
@ -2079,7 +2079,7 @@ static int lib_kStealBalloon(lua_State *L)
return LUA_ErrInvalid(L, "player_t");
if (!victim)
return LUA_ErrInvalid(L, "player_t");
K_StealBalloon(player, victim, force);
K_StealBumper(player, victim, force);
return 0;
}
@ -2402,7 +2402,7 @@ static luaL_Reg lib[] = {
{"K_SpinPlayer",lib_kSpinPlayer},
{"K_SquishPlayer",lib_kSquishPlayer},
{"K_ExplodePlayer",lib_kExplodePlayer},
{"K_StealBalloon",lib_kStealBalloon},
{"K_StealBumper",lib_kStealBumper},
{"K_SpawnKartExplosion",lib_kSpawnKartExplosion},
{"K_SpawnBoostTrail",lib_kSpawnBoostTrail},
{"K_SpawnSparkleTrail",lib_kSpawnSparkleTrail},

View file

@ -921,7 +921,7 @@ menuitem_t PlayerMenu[32] =
static menuitem_t MP_MainMenu[] =
{
{IT_HEADER, NULL, "Player setup", NULL, 10},
{IT_STRING|IT_CALL, NULL, "It's you!", M_SetupMultiPlayer, 20},
{IT_STRING|IT_CALL, NULL, "Select character & color...", M_SetupMultiPlayer, 20},
{IT_HEADER, NULL, "Host a game", NULL, 34},
{IT_NETCALL, NULL, "Internet/LAN...", M_StartServerMenu, 44},
{IT_STRING|IT_CALL, NULL, "Splitscreen...", M_StartSplitServerMenu, 52},
@ -1402,7 +1402,7 @@ static menuitem_t OP_EraseDataMenu[] =
static menuitem_t OP_HUDOptionsMenu[] =
{
{IT_STRING | IT_CVAR, NULL, "Show HUD", &cv_showhud, 10},
{IT_STRING | IT_CVAR, NULL, "Show HUD (F3)", &cv_showhud, 10},
{IT_STRING | IT_CVAR | IT_CV_SLIDER,
NULL, "HUD Visibility", &cv_translucenthud, 20},
@ -1429,7 +1429,7 @@ static menuitem_t OP_GameOptionsMenu[] =
{IT_STRING | IT_CVAR, NULL, "Exit Countdown Timer", &cv_countdowntime, 80},
//{IT_STRING | IT_CVAR, NULL, "Time Limit", &cv_timelimit, 100},
{IT_STRING | IT_CVAR, NULL, "Starting Balloons", &cv_kartballoons, 100},
{IT_STRING | IT_CVAR, NULL, "Starting Bumpers", &cv_kartbumpers, 100},
{IT_STRING | IT_CVAR, NULL, "Karma Comeback", &cv_kartcomeback, 110},
{IT_STRING | IT_CVAR, NULL, "Force Character #", &cv_forceskin, 130},
@ -1485,7 +1485,7 @@ static menuitem_t OP_ServerOptionsMenu[] =
{IT_STRING | IT_CVAR, NULL, "Use Map Lap Counts", &cv_usemapnumlaps, 34},
{IT_HEADER, NULL, "BATTLE", NULL, 50},
{IT_STRING | IT_CVAR, NULL, "Starting Balloons", &cv_kartballoons, 58},
{IT_STRING | IT_CVAR, NULL, "Starting Bumpers", &cv_kartbumpers, 58},
{IT_STRING | IT_CVAR, NULL, "Karma Comeback", &cv_kartcomeback, 66},
};*/

1
src/null Normal file
View file

@ -0,0 +1 @@
Press any key to continue . . .

View file

@ -3922,7 +3922,7 @@ static inline boolean PIT_GrenadeRing(mobj_t *thing)
return true;
if (thing->player && (thing->player->kartstuff[k_hyudorotimer]
|| (G_BattleGametype() && thing->player && thing->player->kartstuff[k_balloon] <= 0 && thing->player->kartstuff[k_comebacktimer])))
|| (G_BattleGametype() && thing->player && thing->player->kartstuff[k_bumper] <= 0 && thing->player->kartstuff[k_comebacktimer])))
return true;
if ((gametype == GT_CTF || gametype == GT_TEAMMATCH)
@ -8144,7 +8144,7 @@ void A_ItemPop(mobj_t *actor)
if (actor->info->deathsound)
S_StartSound(remains, actor->info->deathsound);
if (!(G_BattleGametype() && actor->target->player->kartstuff[k_balloon] <= 0))
if (!(G_BattleGametype() && actor->target->player->kartstuff[k_bumper] <= 0))
actor->target->player->kartstuff[k_itemroulette] = 1;
remains->flags2 &= ~MF2_AMBUSH;
@ -8228,7 +8228,7 @@ void A_JawzChase(mobj_t *actor)
if (G_BattleGametype())
{
if (player->kartstuff[k_balloon] <= 0)
if (player->kartstuff[k_bumper] <= 0)
continue;
if (P_AproxDistance(P_AproxDistance(player->mo->x-actor->x,
@ -8240,7 +8240,7 @@ void A_JawzChase(mobj_t *actor)
if ((G_RaceGametype()) || (G_BattleGametype() // If in match etc. only home in when you get close enough, in race etc. home in all the time
&& P_AproxDistance(P_AproxDistance(player->mo->x-actor->x,
player->mo->y-actor->y), player->mo->z-actor->z) < RING_DIST
&& player->kartstuff[k_balloon] > 0))
&& player->kartstuff[k_bumper] > 0))
P_SetTarget(&actor->tracer, player->mo);
return;
@ -8324,7 +8324,7 @@ void A_MineExplode(mobj_t *actor)
if (mo2 == actor || mo2->type == MT_MINEEXPLOSIONSOUND) // Don't explode yourself! Endless loop!
continue;
if (G_BattleGametype() && actor->target && actor->target->player && actor->target->player->kartstuff[k_balloon] <= 0 && mo2 == actor->target)
if (G_BattleGametype() && actor->target && actor->target->player && actor->target->player->kartstuff[k_bumper] <= 0 && mo2 == actor->target)
continue;
if (P_AproxDistance(P_AproxDistance(mo2->x - actor->x, mo2->y - actor->y), mo2->z - actor->z) > actor->info->painchance)

View file

@ -155,7 +155,7 @@ boolean P_CanPickupItem(player_t *player, boolean weapon)
if (player->exiting)
return false;
/*if (G_BattleGametype() && player->kartstuff[k_balloon] <= 0) // No balloons in Match
/*if (G_BattleGametype() && player->kartstuff[k_bumper] <= 0) // No bumpers in Match
return false;*/
if (weapon)
@ -410,7 +410,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
if (!P_CanPickupItem(player, true))
return;
if (G_BattleGametype() && player->kartstuff[k_balloon] <= 0)
if (G_BattleGametype() && player->kartstuff[k_bumper] <= 0)
{
if (player->kartstuff[k_comebackmode] == 1 || player->kartstuff[k_comebacktimer])
return;
@ -427,7 +427,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
return;
if (player == special->target->player)
return;
if (player->kartstuff[k_balloon] <= 0)
if (player->kartstuff[k_bumper] <= 0)
return;
if (special->target->player->exiting || player->exiting)
return;
@ -459,7 +459,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
if (netgame && cv_hazardlog.value)
CONS_Printf(M_GetText("%s bombed %s!\n"), player_names[special->target->player-players], player_names[player-players]);
if (special->target->player->kartstuff[k_comebackpoints] >= 3)
K_StealBalloon(special->target->player, player, true);
K_StealBumper(special->target->player, player, true);
special->target->player->kartstuff[k_comebacktimer] = comebacktime;
K_ExplodePlayer(player, special->target);
@ -476,7 +476,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
if (netgame && cv_hazardlog.value)
CONS_Printf(M_GetText("%s gave an item to %s.\n"), player_names[special->target->player-players], player_names[player-players]);
if (special->target->player->kartstuff[k_comebackpoints] >= 3)
K_StealBalloon(special->target->player, player, true);
K_StealBumper(special->target->player, player, true);
special->target->player->kartstuff[k_comebacktimer] = comebacktime;
player->kartstuff[k_itemroulette] = 1;
@ -2330,7 +2330,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source)
}
else if (G_BattleGametype())
{
K_CheckBalloons();
K_CheckBumpers();
}
}
@ -2830,22 +2830,22 @@ static void P_KillPlayer(player_t *player, mobj_t *source, INT32 damage)
if (G_BattleGametype())
{
if (player->kartstuff[k_balloon] > 0)
if (player->kartstuff[k_bumper] > 0)
{
if (player->kartstuff[k_balloon] == 1)
if (player->kartstuff[k_bumper] == 1)
{
mobj_t *karmahitbox = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_KARMAHITBOX); // Player hitbox is too small!!
P_SetTarget(&karmahitbox->target, player->mo);
karmahitbox->destscale = player->mo->scale;
P_SetScale(karmahitbox, player->mo->scale);
CONS_Printf(M_GetText("%s lost all of their balloons!\n"), player_names[player-players]);
CONS_Printf(M_GetText("%s lost all of their bumpers!\n"), player_names[player-players]);
if (K_IsPlayerWanted(player))
K_CalculateBattleWanted();
}
player->kartstuff[k_balloon]--;
player->kartstuff[k_bumper]--;
}
K_CheckBalloons();
K_CheckBumpers();
}
}

View file

@ -1633,11 +1633,11 @@ static boolean PIT_CheckThing(mobj_t *thing)
if (thing->player->kartstuff[k_growshrinktimer] || thing->player->kartstuff[k_squishedtimer]
|| thing->player->kartstuff[k_hyudorotimer] || thing->player->kartstuff[k_spinouttimer]
|| thing->player->kartstuff[k_invincibilitytimer] || thing->player->kartstuff[k_justbumped]
|| (G_BattleGametype() && thing->player->kartstuff[k_balloon] <= 0)
|| (G_BattleGametype() && thing->player->kartstuff[k_bumper] <= 0)
|| tmthing->player->kartstuff[k_growshrinktimer] || tmthing->player->kartstuff[k_squishedtimer]
|| tmthing->player->kartstuff[k_hyudorotimer] || tmthing->player->kartstuff[k_spinouttimer]
|| tmthing->player->kartstuff[k_invincibilitytimer] || tmthing->player->kartstuff[k_justbumped]
|| (G_BattleGametype() && tmthing->player->kartstuff[k_balloon] <= 0))
|| (G_BattleGametype() && tmthing->player->kartstuff[k_bumper] <= 0))
{
return true;
}
@ -1647,7 +1647,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
K_KartBouncing(tmthing, thing, true, false);
if (G_BattleGametype() && tmthing->player->kartstuff[k_pogospring])
{
K_StealBalloon(tmthing->player, thing->player, false);
K_StealBumper(tmthing->player, thing->player, false);
K_SpinPlayer(thing->player, tmthing, 0, false);
}
}
@ -1656,7 +1656,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
K_KartBouncing(thing, tmthing, true, false);
if (G_BattleGametype() && thing->player->kartstuff[k_pogospring])
{
K_StealBalloon(thing->player, tmthing->player, false);
K_StealBumper(thing->player, tmthing->player, false);
K_SpinPlayer(tmthing->player, thing, 0, false);
}
}
@ -1667,12 +1667,12 @@ static boolean PIT_CheckThing(mobj_t *thing)
{
if (thing->player->kartstuff[k_sneakertimer] && !(tmthing->player->kartstuff[k_sneakertimer]))
{
K_StealBalloon(thing->player, tmthing->player, false);
K_StealBumper(thing->player, tmthing->player, false);
K_SpinPlayer(tmthing->player, thing, 0, false);
}
else if (tmthing->player->kartstuff[k_sneakertimer] && !(thing->player->kartstuff[k_sneakertimer]))
{
K_StealBalloon(tmthing->player, thing->player, false);
K_StealBumper(tmthing->player, thing->player, false);
K_SpinPlayer(thing->player, tmthing, 0, false);
}
}

View file

@ -6592,7 +6592,7 @@ void P_MobjThinker(mobj_t *mobj)
INT32 HEIGHT;
fixed_t radius;
if (G_BattleGametype() && mobj->target->player->kartstuff[k_balloon] <= 0)
if (G_BattleGametype() && mobj->target->player->kartstuff[k_bumper] <= 0)
kartspeed = 1;
dsone = (26*4 + kartspeed*2 + (9 - mobj->target->player->kartweight))*8;
@ -6779,7 +6779,7 @@ void P_MobjThinker(mobj_t *mobj)
}
}
break;
case MT_BATTLEBALLOON:
case MT_BATTLEBUMPER:
if (mobj->health > 0 && mobj->target && mobj->target->player
&& mobj->target->player->health > 0 && !mobj->target->player->spectator)
{
@ -6792,10 +6792,10 @@ void P_MobjThinker(mobj_t *mobj)
else
ang = FixedAngle(mobj->info->speed);
if (mobj->target->player->kartstuff[k_balloon] <= 1)
if (mobj->target->player->kartstuff[k_bumper] <= 1)
diff = 0;
else
diff = FixedAngle(360*FRACUNIT/mobj->target->player->kartstuff[k_balloon]);
diff = FixedAngle(360*FRACUNIT/mobj->target->player->kartstuff[k_bumper]);
ang = (ang*leveltime) + (diff * (mobj->threshold-1));
@ -6843,16 +6843,16 @@ void P_MobjThinker(mobj_t *mobj)
if (mobj->tracer && mobj->tracer->player && mobj->tracer->player->mo
&& mobj->tracer->player->health > 0 && !mobj->tracer->player->spectator) // STOLEN
mobj->color = mobj->tracer->player->skincolor; // don't do star flashing for stolen balloons
mobj->color = mobj->tracer->player->skincolor; // don't do star flashing for stolen bumpers
else
mobj->color = mobj->target->color; // but do so if it belongs to you :B
if (mobj->target->player->kartstuff[k_balloon] < 2)
P_SetMobjState(mobj, S_BATTLEBALLOON3);
else if (mobj->target->player->kartstuff[k_balloon] < 3)
P_SetMobjState(mobj, S_BATTLEBALLOON2);
if (mobj->target->player->kartstuff[k_bumper] < 2)
P_SetMobjState(mobj, S_BATTLEBUMPER3);
else if (mobj->target->player->kartstuff[k_bumper] < 3)
P_SetMobjState(mobj, S_BATTLEBUMPER2);
else
P_SetMobjState(mobj, S_BATTLEBALLOON1);
P_SetMobjState(mobj, S_BATTLEBUMPER1);
// Shrink your items if the player shrunk too.
mobj->scale = mobj->target->scale;
@ -6867,7 +6867,7 @@ void P_MobjThinker(mobj_t *mobj)
}
// Was this so hard?
if (mobj->target->player->kartstuff[k_balloon] <= mobj->threshold)
if (mobj->target->player->kartstuff[k_bumper] <= mobj->threshold)
{
P_RemoveMobj(mobj);
return;
@ -6893,7 +6893,7 @@ void P_MobjThinker(mobj_t *mobj)
if (G_RaceGametype()
|| mobj->target->player == &players[displayplayer]
|| mobj->target->player->kartstuff[k_balloon] <= 0
|| mobj->target->player->kartstuff[k_bumper] <= 0
|| (mobj->target->player->mo->flags2 & MF2_DONTDRAW)
#if 1 // Set to 0 to test without needing to host
|| !netgame
@ -8179,7 +8179,7 @@ void P_MobjThinker(mobj_t *mobj)
break;
case MT_KARMAHITBOX:
if (!mobj->target || !mobj->target->health || !mobj->target->player
|| (G_RaceGametype() || mobj->target->player->kartstuff[k_balloon]))
|| (G_RaceGametype() || mobj->target->player->kartstuff[k_bumper]))
{
P_RemoveMobj(mobj);
return;
@ -9049,7 +9049,7 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type)
case MT_BIGMACE: case MT_SMALLMACE:
case MT_FALLINGROCK:
//case MT_RANDOMITEM:
case MT_BATTLEBALLOON:
case MT_BATTLEBUMPER:
case MT_BANANA: case MT_BANANA_SHIELD:
case MT_FAKEITEM: case MT_FAKESHIELD:
case MT_GREENITEM: case MT_GREENSHIELD:
@ -9905,7 +9905,7 @@ void P_SpawnPlayer(INT32 playernum)
pcount++;
}*/
if (p->kartstuff[k_balloon] > 0 || leveltime < 1/* || pcount <= 1*/)
if (p->kartstuff[k_bumper] > 0 || leveltime < 1/* || pcount <= 1*/)
{
INT32 i;
angle_t newangle;
@ -9915,20 +9915,20 @@ void P_SpawnPlayer(INT32 playernum)
mobj_t *mo;
if (leveltime < 1 && !p->spectator /*|| pcount <= 1*/) // Start of the map?
p->kartstuff[k_balloon] = cv_kartballoons.value; // Reset those balloons!
p->kartstuff[k_bumper] = cv_kartbumpers.value; // Reset those bumpers!
if (p->kartstuff[k_balloon] <= 1)
if (p->kartstuff[k_bumper] <= 1)
diff = 0;
else
diff = FixedAngle(360*FRACUNIT/p->kartstuff[k_balloon]);
diff = FixedAngle(360*FRACUNIT/p->kartstuff[k_bumper]);
newangle = mobj->angle;
newx = mobj->x + P_ReturnThrustX(mobj, newangle + ANGLE_180, 64*FRACUNIT);
newy = mobj->y + P_ReturnThrustY(mobj, newangle + ANGLE_180, 64*FRACUNIT);
for (i = 0; i < p->kartstuff[k_balloon]; i++)
for (i = 0; i < p->kartstuff[k_bumper]; i++)
{
mo = P_SpawnMobj(newx, newy, mobj->z, MT_BATTLEBALLOON);
mo = P_SpawnMobj(newx, newy, mobj->z, MT_BATTLEBUMPER);
mo->threshold = i;
P_SetTarget(&mo->target, mobj);
mo->angle = (diff * (i-1));
@ -9939,7 +9939,7 @@ void P_SpawnPlayer(INT32 playernum)
mo->flags2 &= ~MF2_DONTDRAW;
}
}
else if (p->kartstuff[k_balloon] <= 0)
else if (p->kartstuff[k_bumper] <= 0)
{
mobj_t *karmahitbox = P_SpawnMobj(mobj->x, mobj->y, mobj->z, MT_KARMAHITBOX); // Player hitbox is too small!!
P_SetTarget(&karmahitbox->target, mobj);

View file

@ -1134,7 +1134,7 @@ void P_RestoreMusic(player_t *player)
{
if (!playeringame[i] || players[i].spectator)
continue;
if (players[i].kartstuff[k_balloon] > player->kartstuff[k_balloon])
if (players[i].kartstuff[k_bumper] > player->kartstuff[k_bumper])
pos++;
else if (players[i].score > player->score)
pos++;
@ -1716,7 +1716,7 @@ void P_DoPlayerExit(player_t *player)
{
if (!playeringame[i] || players[i].spectator)
continue;
if (players[i].kartstuff[k_balloon] > player->kartstuff[k_balloon])
if (players[i].kartstuff[k_bumper] > player->kartstuff[k_bumper])
pos++;
else if (players[i].score > player->score)
pos++;
@ -9585,7 +9585,7 @@ void P_PlayerThink(player_t *player)
if (!(player->pflags & PF_NIGHTSMODE
|| player->kartstuff[k_hyudorotimer] // SRB2kart - fixes Hyudoro not flashing when it should.
|| player->kartstuff[k_growshrinktimer] > 0 // Grow doesn't flash either.
|| (G_BattleGametype() && player->kartstuff[k_balloon] <= 0 && player->kartstuff[k_comebacktimer])
|| (G_BattleGametype() && player->kartstuff[k_bumper] <= 0 && player->kartstuff[k_comebacktimer])
|| leveltime < starttime)) // Level intro
{
if (player->powers[pw_flashing] > 0 && player->powers[pw_flashing] < K_GetKartFlashing()