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

This commit is contained in:
toaster 2018-08-07 17:09:25 +01:00
commit cfaaac78be
34 changed files with 2462 additions and 535 deletions

View file

@ -1,2 +0,0 @@
# DON'T REMOVE
# This keeps the folder from disappearing

View file

@ -1037,7 +1037,17 @@ boolean CON_Responder(event_t *ev)
else if (key == KEY_KPADSLASH)
key = '/';
if (shiftdown)
// capslock
if (key == KEY_CAPSLOCK) // it's a toggle.
{
if (capslock)
capslock = false;
else
capslock = true;
return true;
}
if (capslock ^ shiftdown) // gets capslock to work because capslock is cool
key = shiftxform[key];
// enter a char into the command prompt
@ -1045,7 +1055,7 @@ boolean CON_Responder(event_t *ev)
return true; // even if key can't be printed, eat it anyway
// add key to cmd line here
if (key >= 'A' && key <= 'Z' && !shiftdown) //this is only really necessary for dedicated servers
if (key >= 'A' && key <= 'Z' && !(shiftdown ^ capslock)) //this is only really necessary for dedicated servers
key = key + 'a' - 'A';
if (input_sel != input_cur)
@ -1432,7 +1442,7 @@ static void CON_DrawHudlines(void)
if (con_hudlines <= 0)
return;
if (chat_on)
if (chat_on && OLDCHAT)
y = charheight; // leave place for chat input in the first row of text
else
y = 0;

View file

@ -186,6 +186,7 @@ void D_PostEvent_end(void) {};
UINT8 shiftdown = 0; // 0x1 left, 0x2 right
UINT8 ctrldown = 0; // 0x1 left, 0x2 right
UINT8 altdown = 0; // 0x1 left, 0x2 right
boolean capslock = 0; // jeez i wonder what this does.
//
// D_ModifierKeyResponder
// Sets global shift/ctrl/alt variables, never actually eats events

View file

@ -114,6 +114,7 @@ static void KartFrantic_OnChange(void);
static void KartSpeed_OnChange(void);
static void KartEncore_OnChange(void);
static void KartComeback_OnChange(void);
static void KartEliminateLast_OnChange(void);
#ifdef NETGAME_DEVMODE
static void Fishcake_OnChange(void);
@ -272,26 +273,15 @@ INT32 cv_debug;
consvar_t cv_usemouse = {"use_mouse", "Off", CV_SAVE|CV_CALL,usemouse_cons_t, I_StartupMouse, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_usemouse2 = {"use_mouse2", "Off", CV_SAVE|CV_CALL,usemouse_cons_t, I_StartupMouse2, 0, NULL, NULL, 0, 0, NULL};
#if defined (DC) || defined (_XBOX) || defined (WMINPUT) || defined (_WII) //joystick 1 and 2
consvar_t cv_usejoystick = {"use_joystick", "1", CV_SAVE|CV_CALL, usejoystick_cons_t,
I_InitJoystick, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_usejoystick2 = {"use_joystick2", "2", CV_SAVE|CV_CALL, usejoystick_cons_t,
I_InitJoystick2, 0, NULL, NULL, 0, 0, NULL};
#elif defined (PSP) || defined (GP2X) || defined (_NDS) //only one joystick
consvar_t cv_usejoystick = {"use_joystick", "1", CV_SAVE|CV_CALL, usejoystick_cons_t,
I_InitJoystick, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_usejoystick2 = {"use_joystick2", "0", CV_SAVE|CV_CALL, usejoystick_cons_t,
I_InitJoystick2, 0, NULL, NULL, 0, 0, NULL};
#else //all esle, no joystick
consvar_t cv_usejoystick = {"use_joystick", "0", CV_SAVE|CV_CALL, usejoystick_cons_t,
I_InitJoystick, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_usejoystick2 = {"use_joystick2", "0", CV_SAVE|CV_CALL, usejoystick_cons_t,
I_InitJoystick2, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_usejoystick3 = {"use_joystick3", "0", CV_SAVE|CV_CALL, usejoystick_cons_t,
consvar_t cv_usejoystick3 = {"use_joystick3", "3", CV_SAVE|CV_CALL, usejoystick_cons_t,
I_InitJoystick3, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_usejoystick4 = {"use_joystick4", "0", CV_SAVE|CV_CALL, usejoystick_cons_t,
consvar_t cv_usejoystick4 = {"use_joystick4", "4", CV_SAVE|CV_CALL, usejoystick_cons_t,
I_InitJoystick4, 0, NULL, NULL, 0, 0, NULL};
#endif
#if (defined (LJOYSTICK) || defined (HAVE_SDL))
#ifdef LJOYSTICK
consvar_t cv_joyport = {"joyport", "/dev/js0", CV_SAVE, joyport_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
@ -342,7 +332,7 @@ consvar_t cv_ballhog = {"ballhog", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NU
consvar_t cv_selfpropelledbomb = {"selfpropelledbomb", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_grow = {"grow", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_shrink = {"shrink", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_lightningshield = {"lightningshield", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_thundershield = {"thundershield", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_hyudoro = {"hyudoro", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_pogospring = {"pogospring", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
@ -365,6 +355,11 @@ consvar_t cv_kartcomeback = {"kartcomeback", "On", CV_NETVAR|CV_CHEAT|CV_CALL|CV
consvar_t cv_kartencore = {"kartencore", "Off", CV_NETVAR|CV_CHEAT|CV_CALL|CV_NOINIT, CV_OnOff, KartEncore_OnChange, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t kartspeedometer_cons_t[] = {{0, "Off"}, {1, "Kilometers"}, {2, "Miles"}, {3, "Fracunits"}, {0, NULL}};
consvar_t cv_kartspeedometer = {"kartdisplayspeed", "Off", CV_SAVE, kartspeedometer_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; // use tics in display
static CV_PossibleValue_t kartvoices_cons_t[] = {{0, "Never"}, {1, "Tasteful"}, {2, "Meme"}, {0, NULL}};
consvar_t cv_kartvoices = {"kartvoices", "Tasteful", CV_SAVE, kartvoices_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
// this might be a debug or it might be an undocumented regular feature
consvar_t cv_karteliminatelast = {"karteliminatelast", "Yes", CV_NETVAR|CV_CHEAT|CV_CALL, CV_OnOff, KartEliminateLast_OnChange, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t kartdebugitem_cons_t[] = {{-1, "MIN"}, {NUMKARTITEMS-1, "MAX"}, {0, NULL}};
consvar_t cv_kartdebugitem = {"kartdebugitem", "0", CV_NETVAR|CV_CHEAT, kartdebugitem_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
@ -437,7 +432,7 @@ consvar_t cv_maxping = {"maxping", "0", CV_SAVE, CV_Unsigned, NULL, 0, NULL, NUL
static CV_PossibleValue_t inttime_cons_t[] = {{0, "MIN"}, {3600, "MAX"}, {0, NULL}};
consvar_t cv_inttime = {"inttime", "20", CV_NETVAR, inttime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t advancemap_cons_t[] = {{0, "Off"}, {1, "Next"}, {2, "Random"}, {3, "Vote"}, {0, NULL}};
static CV_PossibleValue_t advancemap_cons_t[] = {{0, "Same"}, {1, "Next"}, {2, "Random"}, {3, "Vote"}, {0, NULL}};
consvar_t cv_advancemap = {"advancemap", "Vote", CV_NETVAR, advancemap_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t playersforexit_cons_t[] = {{0, "One"}, {1, "All"}, {0, NULL}};
consvar_t cv_playersforexit = {"playersforexit", "One", CV_NETVAR, playersforexit_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
@ -785,6 +780,14 @@ void D_RegisterClientCommands(void)
CV_RegisterVar(&cv_usegamma);
// m_menu.c
CV_RegisterVar(&cv_compactscoreboard);
CV_RegisterVar(&cv_chatheight);
CV_RegisterVar(&cv_chatwidth);
CV_RegisterVar(&cv_chattime);
CV_RegisterVar(&cv_chatspamprotection);
CV_RegisterVar(&cv_consolechat);
CV_RegisterVar(&cv_chatnotifications);
CV_RegisterVar(&cv_chatbacktint);
CV_RegisterVar(&cv_crosshair);
CV_RegisterVar(&cv_crosshair2);
CV_RegisterVar(&cv_crosshair3);
@ -1966,26 +1969,22 @@ void D_MapChange(INT32 mapnum, INT32 newgametype, boolean pultmode, boolean rese
void D_SetupVote(void)
{
char buf[8];
char *p = buf;
UINT8 buf[6*2]; // five UINT16 maps (at twice the width of a UINT8), and two gametypes
UINT8 *p = buf;
INT32 i;
UINT8 secondgt = G_SometimesGetDifferentGametype();
WRITEUINT8(p, gametype);
WRITEUINT8(p, secondgt);
for (i = 0; i < 5; i++)
{
if (i == 2) // sometimes a different gametype
{
INT16 gt = G_SometimesGetDifferentGametype();
WRITEUINT16(p, G_RandMap(G_TOLFlag(gt), prevmap, false, false, 0, true));
WRITEUINT16(p, gt);
}
WRITEUINT16(p, G_RandMap(G_TOLFlag(secondgt), prevmap, false, false, 0, true));
else if (i >= 3) // unknown-random and force-unknown MAP HELL
WRITEUINT16(p, G_RandMap(G_TOLFlag(gametype), prevmap, true, false, (i-2), (i < 4)));
else
{
if (i >= 3) // unknown-random and force-unknown MAP HELL
WRITEUINT16(p, G_RandMap(G_TOLFlag(gametype), prevmap, true, false, (i-2), (i < 4)));
else
WRITEUINT16(p, G_RandMap(G_TOLFlag(gametype), prevmap, false, false, 0, true));
WRITEUINT16(p, gametype);
}
WRITEUINT16(p, G_RandMap(G_TOLFlag(gametype), prevmap, false, false, 0, true));
}
SendNetXCmd(XD_SETUPVOTE, buf, p - buf);
@ -2531,12 +2530,12 @@ static void Command_Teamchange_f(void)
return;
}
if (players[consoleplayer].spectator && !(players[consoleplayer].pflags & PF_WANTSTOJOIN) && !NetPacket.packet.newteam)
error = true;
else if (G_GametypeHasTeams() && NetPacket.packet.newteam == (unsigned)players[consoleplayer].ctfteam)
error = true;
else if (G_GametypeHasSpectators() && !players[consoleplayer].spectator && NetPacket.packet.newteam == 3)
error = true;
if (players[consoleplayer].spectator)
error = !(NetPacket.packet.newteam || (players[consoleplayer].pflags & PF_WANTSTOJOIN)); // :lancer:
else if (G_GametypeHasTeams())
error = (NetPacket.packet.newteam == (unsigned)players[consoleplayer].ctfteam);
else if (G_GametypeHasSpectators() && !players[consoleplayer].spectator)
error = (NetPacket.packet.newteam == 3);
#ifdef PARANOIA
else
I_Error("Invalid gametype after initial checks!");
@ -2622,12 +2621,12 @@ static void Command_Teamchange2_f(void)
return;
}
if (players[secondarydisplayplayer].spectator && !(players[secondarydisplayplayer].pflags & PF_WANTSTOJOIN) && !NetPacket.packet.newteam)
error = true;
else if (G_GametypeHasTeams() && NetPacket.packet.newteam == (unsigned)players[secondarydisplayplayer].ctfteam)
error = true;
else if (G_GametypeHasSpectators() && !players[secondarydisplayplayer].spectator && NetPacket.packet.newteam == 3)
error = true;
if (players[secondarydisplayplayer].spectator)
error = !(NetPacket.packet.newteam || (players[secondarydisplayplayer].pflags & PF_WANTSTOJOIN));
else if (G_GametypeHasTeams())
error = (NetPacket.packet.newteam == (unsigned)players[secondarydisplayplayer].ctfteam);
else if (G_GametypeHasSpectators() && !players[secondarydisplayplayer].spectator)
error = (NetPacket.packet.newteam == 3);
#ifdef PARANOIA
else
I_Error("Invalid gametype after initial checks!");
@ -2713,12 +2712,12 @@ static void Command_Teamchange3_f(void)
return;
}
if (players[thirddisplayplayer].spectator && !(players[thirddisplayplayer].pflags & PF_WANTSTOJOIN) && !NetPacket.packet.newteam)
error = true;
else if (G_GametypeHasTeams() && NetPacket.packet.newteam == (unsigned)players[thirddisplayplayer].ctfteam)
error = true;
else if (G_GametypeHasSpectators() && !players[thirddisplayplayer].spectator && NetPacket.packet.newteam == 3)
error = true;
if (players[thirddisplayplayer].spectator)
error = !(NetPacket.packet.newteam || (players[thirddisplayplayer].pflags & PF_WANTSTOJOIN));
else if (G_GametypeHasTeams())
error = (NetPacket.packet.newteam == (unsigned)players[thirddisplayplayer].ctfteam);
else if (G_GametypeHasSpectators() && !players[thirddisplayplayer].spectator)
error = (NetPacket.packet.newteam == 3);
#ifdef PARANOIA
else
I_Error("Invalid gametype after initial checks!");
@ -2804,12 +2803,12 @@ static void Command_Teamchange4_f(void)
return;
}
if (players[fourthdisplayplayer].spectator && !(players[fourthdisplayplayer].pflags & PF_WANTSTOJOIN) && !NetPacket.packet.newteam)
error = true;
else if (G_GametypeHasTeams() && NetPacket.packet.newteam == (unsigned)players[fourthdisplayplayer].ctfteam)
error = true;
else if (G_GametypeHasSpectators() && !players[fourthdisplayplayer].spectator && NetPacket.packet.newteam == 3)
error = true;
if (players[fourthdisplayplayer].spectator)
error = !(NetPacket.packet.newteam || (players[fourthdisplayplayer].pflags & PF_WANTSTOJOIN));
else if (G_GametypeHasTeams())
error = (NetPacket.packet.newteam == (unsigned)players[fourthdisplayplayer].ctfteam);
else if (G_GametypeHasSpectators() && !players[fourthdisplayplayer].spectator)
error = (NetPacket.packet.newteam == 3);
#ifdef PARANOIA
else
I_Error("Invalid gametype after initial checks!");
@ -4582,6 +4581,7 @@ static void Got_ExitLevelcmd(UINT8 **cp, INT32 playernum)
static void Got_SetupVotecmd(UINT8 **cp, INT32 playernum)
{
INT32 i;
UINT8 gt, secondgt;
if (playernum != serverplayer && !IsPlayerAdmin(playernum))
{
@ -4597,14 +4597,19 @@ static void Got_SetupVotecmd(UINT8 **cp, INT32 playernum)
return;
}
gt = (UINT8)READUINT8(*cp);
secondgt = (UINT8)READUINT8(*cp);
for (i = 0; i < 5; i++)
{
votelevels[i][0] = (INT16)READUINT16(*cp);
votelevels[i][1] = (INT16)READUINT16(*cp);
votelevels[i][0] = (UINT16)READUINT16(*cp);
votelevels[i][1] = gt;
if (!mapheaderinfo[votelevels[i][0]])
P_AllocMapHeader(votelevels[i][0]);
}
votelevels[2][1] = secondgt;
G_SetGamestate(GS_VOTING);
Y_StartVote();
}
@ -5199,9 +5204,9 @@ static void BaseNumLaps_OnChange(void)
if (gamestate == GS_LEVEL)
{
if (cv_basenumlaps.value)
CONS_Printf(M_GetText("Number of laps will be changed to map defaults next round.\n"));
else
CONS_Printf(M_GetText("Number of laps will be changed to %d next round.\n"), cv_basenumlaps.value);
else
CONS_Printf(M_GetText("Number of laps will be changed to map defaults next round.\n"));
}
}
@ -5257,4 +5262,10 @@ static void KartComeback_OnChange(void)
comeback = (boolean)cv_kartcomeback.value;
}
}
}
}
static void KartEliminateLast_OnChange(void)
{
if (G_RaceGametype() && cv_karteliminatelast.value)
P_CheckRacers();
}

View file

@ -112,7 +112,7 @@ extern consvar_t cv_recycler;*/
extern consvar_t cv_sneaker, cv_rocketsneaker, cv_invincibility, cv_banana;
extern consvar_t cv_eggmanmonitor, cv_orbinaut, cv_jawz, cv_mine;
extern consvar_t cv_ballhog, cv_selfpropelledbomb, cv_grow, cv_shrink;
extern consvar_t cv_lightningshield, cv_hyudoro, cv_pogospring;
extern consvar_t cv_thundershield, cv_hyudoro, cv_pogospring;
extern consvar_t cv_triplesneaker, cv_triplebanana, cv_tripleorbinaut, cv_dualjawz;
@ -126,6 +126,9 @@ extern consvar_t cv_kartfrantic;
extern consvar_t cv_kartcomeback;
extern consvar_t cv_kartencore;
extern consvar_t cv_kartspeedometer;
extern consvar_t cv_kartvoices;
extern consvar_t cv_karteliminatelast;
extern consvar_t cv_votetime;

View file

@ -246,7 +246,7 @@ typedef enum
KITEM_SPB,
KITEM_GROW,
KITEM_SHRINK,
KITEM_LIGHTNINGSHIELD,
KITEM_THUNDERSHIELD,
KITEM_HYUDORO,
KITEM_POGOSPRING,
KITEM_KITCHENSINK,
@ -281,6 +281,7 @@ typedef enum
k_cardanimation, // Used to determine the position of some full-screen Battle Mode graphics
k_voices, // Used to stop the player saying more voices than it should
k_tauntvoices, // Used to specifically stop taunt voice spam
k_instashield, // Instashield no-damage animation timer
k_floorboost, // Prevents Sneaker sounds for a breif duration when triggered by a floor panel
k_spinouttype, // Determines whether to thrust forward or not while spinning out; 0 = move forwards, 1 = stay still
@ -305,7 +306,8 @@ typedef enum
k_itemheld, // Are you holding an item?
// Some items use timers for their duration or effects
k_attractiontimer, // Duration of Lightning Shield's item-break and item box pull
//k_thunderanim, // Duration of Thunder Shield's use animation
k_curshield, // 0 = no shield, 1 = thunder shield
k_hyudorotimer, // Duration of the Hyudoro offroad effect itself
k_stealingtimer, // You are stealing an item, this is your timer
k_stolentimer, // You are being stolen from, this is your timer

View file

@ -1827,6 +1827,7 @@ static actionpointer_t actionpointers[] =
{{A_JawzChase}, "A_JAWZCHASE"}, // SRB2kart
{{A_JawzExplode}, "A_JAWZEXPLODE"}, // SRB2kart
{{A_MineExplode}, "A_MINEEXPLODE"}, // SRB2kart
{{A_BallhogExplode}, "A_BALLHOGEXPLODE"}, // SRB2kart
{{A_OrbitNights}, "A_ORBITNIGHTS"},
{{A_GhostMe}, "A_GHOSTME"},
{{A_SetObjectState}, "A_SETOBJECTSTATE"},
@ -6246,7 +6247,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
"S_DRIFTDUST3",
"S_DRIFTDUST4",
// Lightning Shield Burst
// Thunder Shield Burst
// Sneaker Fire Trail
"S_KARTFIRE1",
@ -6323,8 +6324,13 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
"S_ORBINAUT4",
"S_ORBINAUT5",
"S_ORBINAUT6",
"S_ORBINAUT_SHIELD",
"S_ORBINAUT_DEAD",
"S_ORBINAUT_SHIELD1",
"S_ORBINAUT_SHIELD2",
"S_ORBINAUT_SHIELD3",
"S_ORBINAUT_SHIELD4",
"S_ORBINAUT_SHIELD5",
"S_ORBINAUT_SHIELD6",
"S_ORBINAUT_SHIELDDEAD",
//}
//{ Jawz
@ -6415,6 +6421,22 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
"S_BALLHOG7",
"S_BALLHOG8",
"S_BALLHOG_DEAD",
"S_BALLHOGBOOM1",
"S_BALLHOGBOOM2",
"S_BALLHOGBOOM3",
"S_BALLHOGBOOM4",
"S_BALLHOGBOOM5",
"S_BALLHOGBOOM6",
"S_BALLHOGBOOM7",
"S_BALLHOGBOOM8",
"S_BALLHOGBOOM9",
"S_BALLHOGBOOM10",
"S_BALLHOGBOOM11",
"S_BALLHOGBOOM12",
"S_BALLHOGBOOM13",
"S_BALLHOGBOOM14",
"S_BALLHOGBOOM15",
"S_BALLHOGBOOM16",
// Self-Propelled Bomb - just an explosion for now...
"S_BLUELIGHTNING1",
@ -6429,6 +6451,32 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
"S_LIGHTNING3",
"S_LIGHTNING4",
// Thunder Shield
"S_THUNDERSHIELD1",
"S_THUNDERSHIELD2",
"S_THUNDERSHIELD3",
"S_THUNDERSHIELD4",
"S_THUNDERSHIELD5",
"S_THUNDERSHIELD6",
"S_THUNDERSHIELD7",
"S_THUNDERSHIELD8",
"S_THUNDERSHIELD9",
"S_THUNDERSHIELD10",
"S_THUNDERSHIELD11",
"S_THUNDERSHIELD12",
"S_THUNDERSHIELD13",
"S_THUNDERSHIELD14",
"S_THUNDERSHIELD15",
"S_THUNDERSHIELD16",
"S_THUNDERSHIELD17",
"S_THUNDERSHIELD18",
"S_THUNDERSHIELD19",
"S_THUNDERSHIELD20",
"S_THUNDERSHIELD21",
"S_THUNDERSHIELD22",
"S_THUNDERSHIELD23",
"S_THUNDERSHIELD24",
// The legend
"S_SINK",
"S_SINKTRAIL1",
@ -6608,6 +6656,21 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
"S_FIREDITEM3",
"S_FIREDITEM4",
"S_INSTASHIELDA1", // No damage instashield effect
"S_INSTASHIELDA2",
"S_INSTASHIELDA3",
"S_INSTASHIELDA4",
"S_INSTASHIELDA5",
"S_INSTASHIELDA6",
"S_INSTASHIELDA7",
"S_INSTASHIELDB1",
"S_INSTASHIELDB2",
"S_INSTASHIELDB3",
"S_INSTASHIELDB4",
"S_INSTASHIELDB5",
"S_INSTASHIELDB6",
"S_INSTASHIELDB7",
"S_PLAYERARROW", // Above player arrow
"S_PLAYERARROW_BOX",
"S_PLAYERARROW_ITEM",
@ -7153,8 +7216,8 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
"MT_FAKESHIELD",
"MT_FAKEITEM",
"MT_BANANA",
"MT_BANANA_SHIELD", // Banana Stuff
"MT_BANANA", // Banana Stuff
"MT_BANANA_SHIELD",
"MT_ORBINAUT", // Orbinaut stuff
"MT_ORBINAUT_SHIELD",
@ -7173,11 +7236,14 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
"MT_BOOMPARTICLE",
"MT_BALLHOG", // Ballhog
"MT_BALLHOGBOOM",
"MT_BLUELIGHTNING", // Grow/shrink stuff
"MT_BLUEEXPLOSION",
"MT_LIGHTNING",
"MT_THUNDERSHIELD", // Thunder Shield stuff
"MT_SINK", // Kitchen Sink Stuff
"MT_SINKTRAIL",
@ -7254,6 +7320,9 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s
"MT_FIREDITEM",
"MT_INSTASHIELDA",
"MT_INSTASHIELDB",
"MT_PLAYERARROW",
"MT_PLAYERWANTED",
@ -7591,6 +7660,7 @@ static const char *const KARTSTUFF_LIST[] = {
"CARDANIMATION",
"VOICES",
"TAUNTVOICES",
"INSTASHIELD",
"FLOORBOOST",
"SPINOUTTYPE",
@ -7615,7 +7685,8 @@ static const char *const KARTSTUFF_LIST[] = {
"ITEMHELD",
// Some items use timers for their duration or effects
"ATTRACTIONTIMER",
//"THUNDERANIM",
"CURSHIELD",
"HYUDOROTIMER",
"STEALINGTIMER",
"STOLENTIMER",

View file

@ -437,6 +437,7 @@ extern INT32 cv_debug;
// Modifier key variables, accessible anywhere
extern UINT8 shiftdown, ctrldown, altdown;
extern boolean capslock;
// if we ever make our alloc stuff...
#define ZZ_Alloc(x) Z_Malloc(x, PU_STATIC, NULL)

View file

@ -625,7 +625,7 @@ void F_CreditDrawer(void)
y += 12<<FRACBITS;
break;
}
if (FixedMul(y,vid.dupy) > vid.height)
if (((y>>FRACBITS) * vid.dupy) > vid.height)
break;
}
@ -686,13 +686,20 @@ boolean F_CreditResponder(event_t *event)
break;
}
/*if (!(timesBeaten) && !(netgame || multiplayer))
return false;*/
if (event->type != ev_keydown)
return false;
if (key != KEY_ESCAPE && key != KEY_ENTER && key != KEY_SPACE && key != KEY_BACKSPACE)
if (key == KEY_DOWNARROW || key == KEY_SPACE)
{
if (!timetonext && !finalecount)
animtimer += 7;
return false;
}
/*if (!(timesBeaten) && !(netgame || multiplayer))
return false;*/
if (key != KEY_ESCAPE && key != KEY_ENTER && key != KEY_BACKSPACE)
return false;
if (keypressed)

View file

@ -398,6 +398,36 @@ static CV_PossibleValue_t joyaxis_cons_t[] = {{0, "None"},
#endif
#endif
// don't mind me putting these here, I was lazy to figure out where else I could put those without blowing up the compiler.
// it automatically becomes compact with 20+ players, but if you like it, I guess you can turn that on!
consvar_t cv_compactscoreboard= {"compactscoreboard", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
// chat timer thingy
static CV_PossibleValue_t chattime_cons_t[] = {{5, "MIN"}, {999, "MAX"}, {0, NULL}};
consvar_t cv_chattime = {"chattime", "8", CV_SAVE, chattime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
// chatwidth
static CV_PossibleValue_t chatwidth_cons_t[] = {{64, "MIN"}, {150, "MAX"}, {0, NULL}};
consvar_t cv_chatwidth = {"chatwidth", "150", CV_SAVE, chatwidth_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
// chatheight
static CV_PossibleValue_t chatheight_cons_t[] = {{6, "MIN"}, {22, "MAX"}, {0, NULL}};
consvar_t cv_chatheight = {"chatheight", "8", CV_SAVE, chatheight_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
// chat notifications (do you want to hear beeps? I'd understand if you didn't.)
consvar_t cv_chatnotifications = {"chatnotifications", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
// chat spam protection (why would you want to disable that???)
consvar_t cv_chatspamprotection = {"chatspamprotection", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
// minichat text background
consvar_t cv_chatbacktint = {"chatbacktint", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
// old shit console chat. (mostly exists for stuff like terminal, not because I cared if anyone liked the old chat.)
//static CV_PossibleValue_t consolechat_cons_t[] = {{0, "Box"}, {1, "Console"}, {0, NULL}}; -- for menu, but menu disabled...
consvar_t cv_consolechat = {"consolechat", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_crosshair = {"crosshair", "Cross", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_crosshair2 = {"crosshair2", "Cross", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_crosshair3 = {"crosshair3", "Cross", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
@ -3434,8 +3464,23 @@ void G_AfterIntermission(void)
//
void G_NextLevel(void)
{
boolean dovote = false;
if ((cv_advancemap.value == 3 && gamestate != GS_VOTING)
&& !modeattacking && !skipstats && (multiplayer || netgame))
{
UINT8 i;
for (i = 0; i < MAXPLAYERS; i++)
{
if (playeringame[i] && !players[i].spectator)
{
dovote = true;
break;
}
}
}
if (dovote)
gameaction = ga_startvote;
else
{

View file

@ -54,6 +54,7 @@ extern tic_t timeinmap; // Ticker for time spent in level (used for levelcard di
extern INT16 rw_maximums[NUM_WEAPONS];
// used in game menu
extern consvar_t cv_chatwidth, cv_chatnotifications, cv_chatheight, cv_chattime, cv_consolechat, cv_chatspamprotection, cv_compactscoreboard, cv_chatbacktint;
extern consvar_t cv_crosshair, cv_crosshair2, cv_crosshair3, cv_crosshair4;
extern consvar_t cv_invertmouse, cv_alwaysfreelook, cv_mousemove;
extern consvar_t cv_turnaxis,cv_moveaxis,cv_brakeaxis,cv_aimaxis,cv_lookaxis,cv_fireaxis,cv_driftaxis;

View file

@ -904,6 +904,112 @@ void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color)
PF_Modulated|PF_NoTexture|PF_NoDepthTest);
}
// -------------------+
// HWR_DrawConsoleFill : draw flat coloured transparent rectangle because that's cool, and hw sucks less than sw for that.
// -------------------+
void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, UINT32 color, INT32 options)
{
FOutVector v[4];
FSurfaceInfo Surf;
float fx, fy, fw, fh;
if (w < 0 || h < 0)
return; // consistency w/ software
// 3--2
// | /|
// |/ |
// 0--1
fx = (float)x;
fy = (float)y;
fw = (float)w;
fh = (float)h;
if (!(options & V_NOSCALESTART))
{
float dupx = (float)vid.dupx, dupy = (float)vid.dupy;
if (x == 0 && y == 0 && w == BASEVIDWIDTH && h == BASEVIDHEIGHT)
{
RGBA_t rgbaColour = V_GetColor(color);
FRGBAFloat clearColour;
clearColour.red = (float)rgbaColour.s.red / 255;
clearColour.green = (float)rgbaColour.s.green / 255;
clearColour.blue = (float)rgbaColour.s.blue / 255;
clearColour.alpha = 1;
HWD.pfnClearBuffer(true, false, &clearColour);
return;
}
fx *= dupx;
fy *= dupy;
fw *= dupx;
fh *= dupy;
if (vid.width != BASEVIDWIDTH * vid.dupx)
{
if (options & V_SNAPTORIGHT)
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx));
else if (!(options & V_SNAPTOLEFT))
fx += ((float)vid.width - ((float)BASEVIDWIDTH * dupx)) / 2;
}
if (vid.height != BASEVIDHEIGHT * dupy)
{
// same thing here
if (options & V_SNAPTOBOTTOM)
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy));
else if (!(options & V_SNAPTOTOP))
fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy)) / 2;
}
}
if (fx >= vid.width || fy >= vid.height)
return;
if (fx < 0)
{
fw += fx;
fx = 0;
}
if (fy < 0)
{
fh += fy;
fy = 0;
}
if (fw <= 0 || fh <= 0)
return;
if (fx + fw > vid.width)
fw = (float)vid.width - fx;
if (fy + fh > vid.height)
fh = (float)vid.height - fy;
fx = -1 + fx / (vid.width / 2);
fy = 1 - fy / (vid.height / 2);
fw = fw / (vid.width / 2);
fh = fh / (vid.height / 2);
v[0].x = v[3].x = fx;
v[2].x = v[1].x = fx + fw;
v[0].y = v[1].y = fy;
v[2].y = v[3].y = fy - fh;
//Hurdler: do we still use this argb color? if not, we should remove it
v[0].argb = v[1].argb = v[2].argb = v[3].argb = 0xff00ff00; //;
v[0].z = v[1].z = v[2].z = v[3].z = 1.0f;
v[0].sow = v[3].sow = 0.0f;
v[2].sow = v[1].sow = 1.0f;
v[0].tow = v[1].tow = 0.0f;
v[2].tow = v[3].tow = 1.0f;
Surf.FlatColor.rgba = UINT2RGBA(color);
Surf.FlatColor.s.alpha = 0x80;
HWD.pfnDrawPolygon(&Surf, v, 4, PF_NoTexture|PF_Modulated|PF_Translucent|PF_NoDepthTest);
}
// -----------------+
// HWR_DrawDiag : draw flat coloured rectangle, with no texture
// -----------------+
@ -1000,6 +1106,8 @@ void HWR_DrawDiag(INT32 x, INT32 y, INT32 wh, INT32 color)
PF_Modulated|PF_NoTexture|PF_NoDepthTest);
}
#ifdef HAVE_PNG
#ifndef _MSC_VER

View file

@ -51,6 +51,7 @@ void HWR_CreatePlanePolygons(INT32 bspnum);
void HWR_CreateStaticLightmaps(INT32 bspnum);
void HWR_PrepLevelCache(size_t pnumtextures);
void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color);
void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, UINT32 color, INT32 options); // Lat: separate flags from color since color needs to be an uint to work right.
void HWR_DrawDiag(INT32 x, INT32 y, INT32 wh, INT32 color);
void HWR_DrawPic(INT32 x,INT32 y,lumpnum_t lumpnum);

File diff suppressed because it is too large Load diff

View file

@ -78,6 +78,13 @@ extern patch_t *tagico;
extern patch_t *tallminus;
extern patch_t *iconprefix[MAXSKINS];
#define CHAT_BUFSIZE 64 // that's enough messages, right? We'll delete the older ones when that gets out of hand.
#define OLDCHAT (cv_consolechat.value || dedicated || vid.width < 640)
// some functions
void HU_AddChatText(const char *text);
// set true when entering a chat message
extern boolean chat_on;
@ -102,6 +109,9 @@ void HU_Drawer(void);
char HU_dequeueChatChar(void);
void HU_Erase(void);
void HU_clearChatChars(void);
void HU_drawPing(INT32 x, INT32 y, INT32 ping, boolean notext); // Lat': Ping drawer for scoreboard.
void HU_DrawTeamTabRankings(playersort_t *tab, INT32 whiteplayer);
void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, INT32 whiteplayer);
void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, INT32 whiteplayer, INT32 hilicol);
//void HU_DrawTeamTabRankings(playersort_t *tab, INT32 whiteplayer);
//void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, INT32 whiteplayer);

View file

@ -56,10 +56,11 @@ char sprnames[NUMSPRITES + 1][5] =
"SRBJ","SRBK","SRBL","SRBM","SRBN","SRBO",
//SRB2kart Sprites
"SPRG","BSPR","RNDM","RPOP","KFRE","KINV","KINF","WIPD","DRIF","DUST",
"FITM","BANA","ORBN","JAWZ","SSMN","KRBM","BHOG","BLIG","LIGH","SINK",
"SITR","KBLN","DEZL","POKE","AUDI","DECO","DOOD","SNES","GBAS","SPRS",
"BUZB","CHOM","SACO","CRAB","SHAD","BRNG","BUMP","FLEN","CLAS","PSHW",
"ARRO","ITEM","ITMI","ITMN","WANT","PBOM","VIEW"
"FITM","BANA","ORBN","JAWZ","SSMN","KRBM","BHOG","BHBM","BLIG","LIGH",
"THNS","SINK","SITR","KBLN","DEZL","POKE","AUDI","DECO","DOOD","SNES",
"GBAS","SPRS","BUZB","CHOM","SACO","CRAB","SHAD","BRNG","BUMP","FLEN",
"CLAS","PSHW","ISTA","ISTB","ARRO","ITEM","ITMI","ITMN","WANT","PBOM",
"VIEW"
};
// Doesn't work with g++, needs actionf_p1 (don't modify this comment)
@ -2609,7 +2610,7 @@ state_t states[NUMSTATES] =
{SPR_WIPD, 3, 3, {NULL}, 0, 0, S_WIPEOUTTRAIL5}, // S_WIPEOUTTRAIL4
{SPR_WIPD, 4, 3, {NULL}, 0, 0, S_NULL}, // S_WIPEOUTTRAIL5
{SPR_FITM, 0|FF_FULLBRIGHT, 3, {NULL}, 0, 0, S_FAKEITEM2}, // S_FAKEITEM1
{SPR_FITM, FF_FULLBRIGHT, 3, {NULL}, 0, 0, S_FAKEITEM2}, // S_FAKEITEM1
{SPR_FITM, 1|FF_FULLBRIGHT, 3, {NULL}, 0, 0, S_FAKEITEM3}, // S_FAKEITEM2
{SPR_FITM, 2|FF_FULLBRIGHT, 3, {NULL}, 0, 0, S_FAKEITEM4}, // S_FAKEITEM3
{SPR_FITM, 3|FF_FULLBRIGHT, 3, {NULL}, 0, 0, S_FAKEITEM5}, // S_FAKEITEM4
@ -2633,20 +2634,25 @@ state_t states[NUMSTATES] =
{SPR_FITM, 21|FF_FULLBRIGHT, 3, {NULL}, 0, 0, S_FAKEITEM23}, // S_FAKEITEM22 // *****
{SPR_FITM, 22|FF_FULLBRIGHT, 3, {NULL}, 0, 0, S_FAKEITEM24}, // S_FAKEITEM23 // *****
{SPR_FITM, 23|FF_FULLBRIGHT, 3, {NULL}, 0, 0, S_FAKEITEM1}, // S_FAKEITEM24 // *****
{SPR_FITM, 24|FF_FULLBRIGHT, 175, {NULL}, 0, 0, S_FAKEITEM1}, // S_DEADFAKEITEM
{SPR_FITM, FF_FULLBRIGHT, 175, {NULL}, 0, 0, S_FAKEITEM1}, // S_DEADFAKEITEM
{SPR_BANA, 0, -1, {NULL}, 0, 0, S_NULL}, // S_BANANA
{SPR_BANA, 1, 175, {NULL}, 0, 0, S_NULL}, // S_BANANA_DEAD
{SPR_BANA, 0, 175, {NULL}, 0, 0, S_NULL}, // S_BANANA_DEAD
{SPR_ORBN, 0, 1, {NULL}, 0, 0, S_ORBINAUT2}, // S_ORBINAUT1
{SPR_ORBN, 1, 1, {NULL}, 0, 0, S_ORBINAUT3}, // S_ORBINAUT2
{SPR_ORBN, 2, 1, {NULL}, 0, 0, S_ORBINAUT4}, // S_ORBINAUT3
{SPR_ORBN, 3, 1, {NULL}, 0, 0, S_ORBINAUT5}, // S_ORBINAUT4
{SPR_ORBN, 4, 1, {NULL}, 0, 0, S_ORBINAUT6}, // S_ORBINAUT5
{SPR_ORBN, 5, 1, {NULL}, 0, 0, S_ORBINAUT1}, // S_ORBINAUT6
{SPR_ORBN, 7, 1, {NULL}, 0, 0, S_ORBINAUT_SHIELD}, // S_ORBINAUT_SHIELD
{SPR_ORBN, 6, 175, {NULL}, 0, 0, S_NULL}, // S_ORBINAUT_DEAD
{SPR_ORBN, 8, 175, {NULL}, 0, 0, S_NULL}, // S_ORBINAUT_SHIELDDEAD
{SPR_ORBN, 0, 1, {NULL}, 0, 0, S_ORBINAUT2}, // S_ORBINAUT1
{SPR_ORBN, 1, 1, {NULL}, 0, 0, S_ORBINAUT3}, // S_ORBINAUT2
{SPR_ORBN, 2, 1, {NULL}, 0, 0, S_ORBINAUT4}, // S_ORBINAUT3
{SPR_ORBN, 3, 1, {NULL}, 0, 0, S_ORBINAUT5}, // S_ORBINAUT4
{SPR_ORBN, 4, 1, {NULL}, 0, 0, S_ORBINAUT6}, // S_ORBINAUT5
{SPR_ORBN, 5, 1, {NULL}, 0, 0, S_ORBINAUT1}, // S_ORBINAUT6
{SPR_ORBN, 0, 175, {NULL}, 0, 0, S_NULL}, // S_ORBINAUT_DEAD
{SPR_ORBN, 6, 3, {NULL}, 0, 0, S_ORBINAUT_SHIELD2}, // S_ORBINAUT_SHIELD1
{SPR_ORBN, 7, 3, {NULL}, 0, 0, S_ORBINAUT_SHIELD3}, // S_ORBINAUT_SHIELD2
{SPR_ORBN, 8, 3, {NULL}, 0, 0, S_ORBINAUT_SHIELD4}, // S_ORBINAUT_SHIELD3
{SPR_ORBN, 9, 3, {NULL}, 0, 0, S_ORBINAUT_SHIELD5}, // S_ORBINAUT_SHIELD4
{SPR_ORBN, 10, 3, {NULL}, 0, 0, S_ORBINAUT_SHIELD6}, // S_ORBINAUT_SHIELD5
{SPR_ORBN, 11, 3, {NULL}, 0, 0, S_ORBINAUT_SHIELD1}, // S_ORBINAUT_SHIELD6
{SPR_ORBN, 6, 175, {NULL}, 0, 0, S_NULL}, // S_ORBINAUT_SHIELDDEAD
{SPR_JAWZ, 0, 1, {A_JawzChase}, 0, 0, S_JAWZ2}, // S_JAWZ1
{SPR_JAWZ, 4, 1, {A_JawzChase}, 0, 0, S_JAWZ3}, // S_JAWZ2
@ -2725,15 +2731,31 @@ state_t states[NUMSTATES] =
{SPR_KRBM, FF_FULLBRIGHT|8, 5, {NULL}, 0, 0, S_SLOWBOOM10}, // S_SLOWBOOM9
{SPR_KRBM, FF_FULLBRIGHT|9, 5, {NULL}, 0, 0, S_NULL}, // S_SLOWBOOM10
{SPR_BHOG, 0, 3, {A_PlaySound}, sfx_s1bd, 1, S_BALLHOG2}, // S_BALLHOG1
{SPR_BHOG, FF_FULLBRIGHT|1, 1, {NULL}, 0, 0, S_BALLHOG3}, // S_BALLHOG2
{SPR_BHOG, FF_FULLBRIGHT|2, 2, {NULL}, 0, 0, S_BALLHOG4}, // S_BALLHOG3
{SPR_BHOG, FF_FULLBRIGHT|3, 3, {NULL}, 0, 0, S_BALLHOG5}, // S_BALLHOG4
{SPR_BHOG, FF_FULLBRIGHT|4, 3, {NULL}, 0, 0, S_BALLHOG6}, // S_BALLHOG5
{SPR_BHOG, 5, 2, {NULL}, 0, 0, S_BALLHOG7}, // S_BALLHOG6
{SPR_BHOG, 6, 1, {NULL}, 0, 0, S_BALLHOG8}, // S_BALLHOG7
{SPR_BHOG, 7, 1, {NULL}, 0, 0, S_BALLHOG1}, // S_BALLHOG8
{SPR_NULL, 0, 1, {NULL}, 0, 0, S_NULL}, // S_BALLHOG_DEAD
{SPR_BHOG, 0, 3, {A_PlaySound}, sfx_s1bd, 1, S_BALLHOG2}, // S_BALLHOG1
{SPR_BHOG, FF_FULLBRIGHT|1, 1, {NULL}, 0, 0, S_BALLHOG3}, // S_BALLHOG2
{SPR_BHOG, FF_FULLBRIGHT|2, 2, {NULL}, 0, 0, S_BALLHOG4}, // S_BALLHOG3
{SPR_BHOG, FF_FULLBRIGHT|3, 3, {NULL}, 0, 0, S_BALLHOG5}, // S_BALLHOG4
{SPR_BHOG, FF_FULLBRIGHT|4, 3, {NULL}, 0, 0, S_BALLHOG6}, // S_BALLHOG5
{SPR_BHOG, 5, 2, {NULL}, 0, 0, S_BALLHOG7}, // S_BALLHOG6
{SPR_BHOG, 6, 1, {NULL}, 0, 0, S_BALLHOG8}, // S_BALLHOG7
{SPR_BHOG, 7, 1, {NULL}, 0, 0, S_BALLHOG1}, // S_BALLHOG8
{SPR_NULL, 0, 1, {A_BallhogExplode}, 0, 0, S_NULL}, // S_BALLHOG_DEAD
{SPR_BHBM, FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_BALLHOGBOOM2}, // S_BALLHOGBOOM1
{SPR_BHBM, FF_FULLBRIGHT|1, 1, {NULL}, 0, 0, S_BALLHOGBOOM3}, // S_BALLHOGBOOM2
{SPR_BHBM, FF_FULLBRIGHT|2, 1, {NULL}, 0, 0, S_BALLHOGBOOM4}, // S_BALLHOGBOOM3
{SPR_BHBM, FF_FULLBRIGHT|3, 1, {NULL}, 0, 0, S_BALLHOGBOOM5}, // S_BALLHOGBOOM4
{SPR_BHBM, FF_FULLBRIGHT|4, 1, {NULL}, 0, 0, S_BALLHOGBOOM6}, // S_BALLHOGBOOM5
{SPR_BHBM, FF_FULLBRIGHT|5, 1, {NULL}, 0, 0, S_BALLHOGBOOM7}, // S_BALLHOGBOOM6
{SPR_BHBM, FF_FULLBRIGHT|6, 1, {NULL}, 0, 0, S_BALLHOGBOOM8}, // S_BALLHOGBOOM7
{SPR_BHBM, FF_FULLBRIGHT|7, 1, {NULL}, 0, 0, S_BALLHOGBOOM9}, // S_BALLHOGBOOM8
{SPR_BHBM, FF_FULLBRIGHT|8, 1, {NULL}, 0, 0, S_BALLHOGBOOM10}, // S_BALLHOGBOOM9
{SPR_BHBM, FF_FULLBRIGHT|9, 1, {NULL}, 0, 0, S_BALLHOGBOOM11}, // S_BALLHOGBOOM10
{SPR_BHBM, FF_FULLBRIGHT|10, 1, {NULL}, 0, 0, S_BALLHOGBOOM12}, // S_BALLHOGBOOM11
{SPR_BHBM, FF_FULLBRIGHT|11, 1, {NULL}, 0, 0, S_BALLHOGBOOM13}, // S_BALLHOGBOOM12
{SPR_BHBM, FF_FULLBRIGHT|12, 1, {NULL}, 0, 0, S_BALLHOGBOOM14}, // S_BALLHOGBOOM13
{SPR_BHBM, FF_FULLBRIGHT|13, 1, {NULL}, 0, 0, S_BALLHOGBOOM15}, // S_BALLHOGBOOM14
{SPR_BHBM, FF_FULLBRIGHT|14, 1, {NULL}, 0, 0, S_BALLHOGBOOM16}, // S_BALLHOGBOOM15
{SPR_BHBM, FF_FULLBRIGHT|15, 1, {NULL}, 0, 0, S_NULL}, // S_BALLHOGBOOM16
{SPR_BLIG, 0, 2, {NULL}, 0, 0, S_BLUELIGHTNING2}, // S_BLUELIGHTNING1
{SPR_BLIG, 1, 2, {NULL}, 0, 0, S_BLUELIGHTNING3}, // S_BLUELIGHTNING2
@ -2746,6 +2768,31 @@ state_t states[NUMSTATES] =
{SPR_LIGH, 2, 2, {NULL}, 0, 0, S_LIGHTNING4}, // S_LIGHTNING3
{SPR_LIGH, 3, 2, {NULL}, 0, 0, S_NULL}, // S_LIGHTNING4
{SPR_THNS, 0, 2, {NULL}, 0, 0, S_THUNDERSHIELD2}, // S_THUNDERSHIELD1
{SPR_THNS, 1, 2, {NULL}, 0, 0, S_THUNDERSHIELD3}, // S_THUNDERSHIELD2
{SPR_THNS, 2, 2, {NULL}, 0, 0, S_THUNDERSHIELD4}, // S_THUNDERSHIELD3
{SPR_THNS, 3, 2, {NULL}, 0, 0, S_THUNDERSHIELD5}, // S_THUNDERSHIELD4
{SPR_THNS, 4, 2, {NULL}, 0, 0, S_THUNDERSHIELD6}, // S_THUNDERSHIELD5
{SPR_THNS, 5, 2, {NULL}, 0, 0, S_THUNDERSHIELD7}, // S_THUNDERSHIELD6
{SPR_THNS, 6, 2, {NULL}, 0, 0, S_THUNDERSHIELD8}, // S_THUNDERSHIELD7
{SPR_THNS, 7, 2, {NULL}, 0, 0, S_THUNDERSHIELD9}, // S_THUNDERSHIELD8
{SPR_THNS, 8, 2, {NULL}, 0, 0, S_THUNDERSHIELD10}, // S_THUNDERSHIELD9
{SPR_THNS, 9, 2, {NULL}, 0, 0, S_THUNDERSHIELD11}, // S_THUNDERSHIELD10
{SPR_THNS, 10, 2, {NULL}, 0, 0, S_THUNDERSHIELD12}, // S_THUNDERSHIELD11
{SPR_THNS, 11, 2, {NULL}, 0, 0, S_THUNDERSHIELD13}, // S_THUNDERSHIELD12
{SPR_THNS, 8, 2, {NULL}, 0, 0, S_THUNDERSHIELD14}, // S_THUNDERSHIELD13
{SPR_THNS, 7, 2, {NULL}, 0, 0, S_THUNDERSHIELD15}, // S_THUNDERSHIELD14
{SPR_THNS, 6, 2, {NULL}, 0, 0, S_THUNDERSHIELD16}, // S_THUNDERSHIELD15
{SPR_THNS, 5, 2, {NULL}, 0, 0, S_THUNDERSHIELD17}, // S_THUNDERSHIELD16
{SPR_THNS, 4, 2, {NULL}, 0, 0, S_THUNDERSHIELD18}, // S_THUNDERSHIELD17
{SPR_THNS, 3, 2, {NULL}, 0, 0, S_THUNDERSHIELD19}, // S_THUNDERSHIELD18
{SPR_THNS, 2, 2, {NULL}, 0, 0, S_THUNDERSHIELD20}, // S_THUNDERSHIELD19
{SPR_THNS, 1, 2, {NULL}, 0, 0, S_THUNDERSHIELD21}, // S_THUNDERSHIELD20
{SPR_THNS, 0, 2, {NULL}, 0, 0, S_THUNDERSHIELD22}, // S_THUNDERSHIELD21
{SPR_THNS, 9, 2, {NULL}, 0, 0, S_THUNDERSHIELD23}, // S_THUNDERSHIELD22
{SPR_THNS, 10, 2, {NULL}, 0, 0, S_THUNDERSHIELD24}, // S_THUNDERSHIELD23
{SPR_THNS, 11, 2, {NULL}, 0, 0, S_THUNDERSHIELD1}, // S_THUNDERSHIELD24
{SPR_SINK, 0, 4, {A_SmokeTrailer}, MT_SINKTRAIL, 0, S_SINK}, // S_SINK
{SPR_SITR, 0, 1, {NULL}, 0, 0, S_SINKTRAIL2}, // S_SINKTRAIL1
{SPR_SITR, 1, 5, {NULL}, 0, 0, S_SINKTRAIL3}, // S_SINKTRAIL2
@ -2915,6 +2962,22 @@ state_t states[NUMSTATES] =
{SPR_PSHW, FF_FULLBRIGHT|2, 3, {NULL}, 0, 0, S_FIREDITEM4}, // S_FIREDITEM3
{SPR_PSHW, FF_FULLBRIGHT|3, 3, {NULL}, 0, 0, S_NULL}, // S_FIREDITEM4
{SPR_ISTA, FF_FULLBRIGHT|FF_TRANS30, 2, {NULL}, 0, 0, S_INSTASHIELDA2}, // S_INSTASHIELDA1
{SPR_ISTA, FF_FULLBRIGHT|FF_TRANS30|1, 2, {NULL}, 0, 0, S_INSTASHIELDA3}, // S_INSTASHIELDA2
{SPR_ISTA, FF_FULLBRIGHT|FF_TRANS30|2, 2, {NULL}, 0, 0, S_INSTASHIELDA4}, // S_INSTASHIELDA3
{SPR_ISTA, FF_FULLBRIGHT|FF_TRANS30|3, 2, {NULL}, 0, 0, S_INSTASHIELDA5}, // S_INSTASHIELDA4
{SPR_ISTA, FF_FULLBRIGHT|FF_TRANS30|4, 2, {NULL}, 0, 0, S_INSTASHIELDA6}, // S_INSTASHIELDA5
{SPR_ISTA, FF_FULLBRIGHT|FF_TRANS30|5, 2, {NULL}, 0, 0, S_INSTASHIELDA7}, // S_INSTASHIELDA6
{SPR_ISTA, FF_FULLBRIGHT|FF_TRANS30|6, 2, {NULL}, 0, 0, S_NULL}, // S_INSTASHIELDA7
{SPR_ISTB, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_INSTASHIELDB2}, // S_INSTASHIELDB1
{SPR_ISTB, FF_FULLBRIGHT|1, 2, {NULL}, 0, 0, S_INSTASHIELDB3}, // S_INSTASHIELDB2
{SPR_ISTB, FF_FULLBRIGHT|2, 2, {NULL}, 0, 0, S_INSTASHIELDB4}, // S_INSTASHIELDB3
{SPR_ISTB, FF_FULLBRIGHT|3, 2, {NULL}, 0, 0, S_INSTASHIELDB5}, // S_INSTASHIELDB4
{SPR_ISTB, FF_FULLBRIGHT|4, 2, {NULL}, 0, 0, S_INSTASHIELDB6}, // S_INSTASHIELDB5
{SPR_ISTB, FF_FULLBRIGHT|5, 2, {NULL}, 0, 0, S_INSTASHIELDB7}, // S_INSTASHIELDB6
{SPR_ISTB, FF_FULLBRIGHT|6, 2, {NULL}, 0, 0, S_NULL}, // S_INSTASHIELDB7
// Above player arrow
{SPR_ARRO, FF_FULLBRIGHT, -1, {NULL}, 0, 0, S_NULL}, // S_PLAYERARROW
{SPR_ARRO, FF_FULLBRIGHT|1, -1, {NULL}, 0, 0, S_NULL}, // S_PLAYERARROW_BOX
@ -14603,15 +14666,15 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // seestate
sfx_tossed, // seesound
8, // reactiontime
sfx_mario1, // attacksound
sfx_s3k49, // attacksound
S_NULL, // painstate
0, // painchance
sfx_None, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_ORBINAUT_DEAD, // deathstate
S_ORBINAUT_DEAD,// deathstate
S_NULL, // xdeathstate
sfx_shbrk, // deathsound
sfx_s3k5d, // deathsound
64*FRACUNIT, // speed
16*FRACUNIT, // radius
32*FRACUNIT, // height
@ -14625,7 +14688,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
{ // MT_ORBINAUT_SHIELD
-1, // doomednum
S_ORBINAUT_SHIELD, // spawnstate
S_ORBINAUT_SHIELD1, // spawnstate
1000, // spawnhealth
S_NULL, // seestate
sfx_None, // seesound
@ -14665,7 +14728,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // missilestate
S_JAWZ_DEAD1, // deathstate
S_JAWZ_DEAD2, // xdeathstate
sfx_shbrk, // deathsound
sfx_s3k5d, // deathsound
7*FRACUNIT, // speed
16*FRACUNIT, // radius
32*FRACUNIT, // height
@ -14692,7 +14755,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // missilestate
S_JAWZ_DEAD1, // deathstate
S_JAWZ_DEAD2, // xdeathstate
sfx_shbrk, // deathsound
sfx_s3k5d, // deathsound
56*FRACUNIT, // speed
16*FRACUNIT, // radius
32*FRACUNIT, // height
@ -14753,7 +14816,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
0, // display offset
100, // mass
1, // damage
sfx_bomb, // activesound
sfx_s3k5c, // activesound
MF_BOUNCE|MF_SHOOTABLE, // flags
S_NULL // raisestate
},
@ -14935,7 +14998,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // missilestate
S_BALLHOG_DEAD, // deathstate
S_NULL, // xdeathstate
sfx_mario1, // deathsound
sfx_hogbom, // deathsound
0, // speed
16*FRACUNIT, // radius
32*FRACUNIT, // height
@ -14947,6 +15010,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL // raisestate
},
{ // MT_BALLHOGBOOM
-1, // doomednum
S_BALLHOGBOOM1, // spawnstate
1000, // spawnhealth
S_NULL, // seestate
sfx_None, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_None, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
0, // speed
16*FRACUNIT, // radius
32*FRACUNIT, // height
0, // display offset
100, // mass
1, // damage
sfx_None, // activesound
MF_NOGRAVITY|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOCLIPTHING, // flags
S_NULL // raisestate
},
{ // MT_BLUELIGHTNING
-1, // doomednum
S_BLUELIGHTNING1, // spawnstate
@ -15028,6 +15118,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL // raisestate
},
{ // MT_THUNDERSHIELD
-1, // doomednum
S_THUNDERSHIELD1, // spawnstate
1000, // spawnhealth
S_NULL, // seestate
sfx_None, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_None, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
8, // speed
16*FRACUNIT, // radius
56*FRACUNIT, // height
1, // display offset
16, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOCLIP|MF_NOGRAVITY, // flags
S_NULL // raisestate
},
{ // MT_SINK
-1, // doomednum
S_SINK, // spawnstate
@ -15043,7 +15160,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_shbrk, // deathsound
sfx_s3k5d, // deathsound
0, // speed
16*FRACUNIT, // radius
24*FRACUNIT, // height
@ -16594,6 +16711,60 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL // raisestate
},
{ // MT_INSTASHIELDA
-1, // doomednum
S_INSTASHIELDA1, // spawnstate
1000, // spawnhealth
S_NULL, // seestate
sfx_None, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_None, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
8, // speed
8*FRACUNIT, // radius
8*FRACUNIT, // height
1, // display offset
100, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIP|MF_NOCLIPHEIGHT, // flags
S_NULL // raisestate
},
{ // MT_INSTASHIELDB
-1, // doomednum
S_INSTASHIELDB1, // spawnstate
1000, // spawnhealth
S_NULL, // seestate
sfx_None, // seesound
8, // reactiontime
sfx_None, // attacksound
S_NULL, // painstate
0, // painchance
sfx_None, // painsound
S_NULL, // meleestate
S_NULL, // missilestate
S_NULL, // deathstate
S_NULL, // xdeathstate
sfx_None, // deathsound
8, // speed
8*FRACUNIT, // radius
8*FRACUNIT, // height
2, // display offset
100, // mass
0, // damage
sfx_None, // activesound
MF_NOBLOCKMAP|MF_NOGRAVITY|MF_NOCLIP|MF_NOCLIPHEIGHT, // flags
S_NULL // raisestate
},
{ // MT_PLAYERARROW
-1, // doomednum
S_PLAYERARROW, // spawnstate

View file

@ -167,6 +167,7 @@ void A_ItemPop(); // SRB2kart
void A_JawzChase(); // SRB2kart
void A_JawzExplode(); // SRB2kart
void A_MineExplode(); // SRB2kart
void A_BallhogExplode(); // SRB2kart
void A_OrbitNights();
void A_GhostMe();
void A_SetObjectState();
@ -596,8 +597,10 @@ typedef enum sprite
SPR_SSMN, // SS Mine
SPR_KRBM, // SS Mine BOOM
SPR_BHOG, // Ballhog
SPR_BHBM, // Ballhog BOOM
SPR_BLIG, // Self-Propelled Bomb
SPR_LIGH, // Grow/shrink beams (Metallic Maddness)
SPR_THNS, // Thunder Shield
SPR_SINK, // Kitchen Sink
SPR_SITR, // Kitchen Sink Trail
SPR_KBLN, // Battle Mode Bumper
@ -623,6 +626,8 @@ typedef enum sprite
SPR_FLEN, // Shell hit graphics stuff
SPR_CLAS, // items clash
SPR_PSHW, // thrown indicator
SPR_ISTA, // instashield layer A
SPR_ISTB, // instashield layer B
SPR_ARRO, // player arrows
SPR_ITEM,
@ -3162,8 +3167,13 @@ typedef enum state
S_ORBINAUT4,
S_ORBINAUT5,
S_ORBINAUT6,
S_ORBINAUT_SHIELD,
S_ORBINAUT_DEAD,
S_ORBINAUT_SHIELD1,
S_ORBINAUT_SHIELD2,
S_ORBINAUT_SHIELD3,
S_ORBINAUT_SHIELD4,
S_ORBINAUT_SHIELD5,
S_ORBINAUT_SHIELD6,
S_ORBINAUT_SHIELDDEAD,
//}
//{ Jawz
@ -3254,6 +3264,22 @@ typedef enum state
S_BALLHOG7,
S_BALLHOG8,
S_BALLHOG_DEAD,
S_BALLHOGBOOM1,
S_BALLHOGBOOM2,
S_BALLHOGBOOM3,
S_BALLHOGBOOM4,
S_BALLHOGBOOM5,
S_BALLHOGBOOM6,
S_BALLHOGBOOM7,
S_BALLHOGBOOM8,
S_BALLHOGBOOM9,
S_BALLHOGBOOM10,
S_BALLHOGBOOM11,
S_BALLHOGBOOM12,
S_BALLHOGBOOM13,
S_BALLHOGBOOM14,
S_BALLHOGBOOM15,
S_BALLHOGBOOM16,
// Self-Propelled Bomb - just an explosion for now...
S_BLUELIGHTNING1,
@ -3262,12 +3288,38 @@ typedef enum state
S_BLUELIGHTNING4,
S_BLUEEXPLODE,
// Size-Down
// Grow/Shrink
S_LIGHTNING1,
S_LIGHTNING2,
S_LIGHTNING3,
S_LIGHTNING4,
// Thunder Shield
S_THUNDERSHIELD1,
S_THUNDERSHIELD2,
S_THUNDERSHIELD3,
S_THUNDERSHIELD4,
S_THUNDERSHIELD5,
S_THUNDERSHIELD6,
S_THUNDERSHIELD7,
S_THUNDERSHIELD8,
S_THUNDERSHIELD9,
S_THUNDERSHIELD10,
S_THUNDERSHIELD11,
S_THUNDERSHIELD12,
S_THUNDERSHIELD13,
S_THUNDERSHIELD14,
S_THUNDERSHIELD15,
S_THUNDERSHIELD16,
S_THUNDERSHIELD17,
S_THUNDERSHIELD18,
S_THUNDERSHIELD19,
S_THUNDERSHIELD20,
S_THUNDERSHIELD21,
S_THUNDERSHIELD22,
S_THUNDERSHIELD23,
S_THUNDERSHIELD24,
// The legend
S_SINK,
S_SINKTRAIL1,
@ -3447,6 +3499,21 @@ typedef enum state
S_FIREDITEM3,
S_FIREDITEM4,
S_INSTASHIELDA1, // No damage instashield effect
S_INSTASHIELDA2,
S_INSTASHIELDA3,
S_INSTASHIELDA4,
S_INSTASHIELDA5,
S_INSTASHIELDA6,
S_INSTASHIELDA7,
S_INSTASHIELDB1,
S_INSTASHIELDB2,
S_INSTASHIELDB3,
S_INSTASHIELDB4,
S_INSTASHIELDB5,
S_INSTASHIELDB6,
S_INSTASHIELDB7,
S_PLAYERARROW, // Above player arrow
S_PLAYERARROW_BOX,
S_PLAYERARROW_ITEM,
@ -4029,11 +4096,14 @@ typedef enum mobj_type
MT_BOOMPARTICLE,
MT_BALLHOG, // Ballhog
MT_BALLHOGBOOM,
MT_BLUELIGHTNING, // Grow/shrink stuff
MT_BLUEEXPLOSION,
MT_LIGHTNING,
MT_THUNDERSHIELD, // Thunder Shield stuff
MT_SINK, // Kitchen Sink Stuff
MT_SINKTRAIL,
@ -4110,6 +4180,9 @@ typedef enum mobj_type
MT_FIREDITEM,
MT_INSTASHIELDA,
MT_INSTASHIELDB,
MT_PLAYERARROW,
MT_PLAYERWANTED,

View file

@ -385,7 +385,7 @@ void K_RegisterKartStuff(void)
CV_RegisterVar(&cv_selfpropelledbomb);
CV_RegisterVar(&cv_grow);
CV_RegisterVar(&cv_shrink);
CV_RegisterVar(&cv_lightningshield);
CV_RegisterVar(&cv_thundershield);
CV_RegisterVar(&cv_hyudoro);
CV_RegisterVar(&cv_pogospring);
@ -403,6 +403,8 @@ void K_RegisterKartStuff(void)
CV_RegisterVar(&cv_kartcomeback);
CV_RegisterVar(&cv_kartencore);
CV_RegisterVar(&cv_kartspeedometer);
CV_RegisterVar(&cv_kartvoices);
CV_RegisterVar(&cv_karteliminatelast);
CV_RegisterVar(&cv_votetime);
CV_RegisterVar(&cv_kartdebugitem);
@ -462,9 +464,9 @@ boolean K_IsPlayerWanted(player_t *player)
static INT32 K_KartItemOddsRace[NUMKARTRESULTS][9] =
{
//P-Odds 0 1 2 3 4 5 6 7 8
/*Sneaker*/ {20, 0, 0, 3, 6, 5, 0, 0, 0 }, // Sneaker
/*Rocket Sneaker*/ { 0, 0, 0, 0, 0, 3, 6, 5, 0 }, // Rocket Sneaker
/*Invincibility*/ { 0, 0, 0, 0, 0, 1, 6, 8,16 }, // Invincibility
/*Sneaker*/ {20, 0, 0, 3, 5, 5, 0, 0, 0 }, // Sneaker
/*Rocket Sneaker*/ { 0, 0, 0, 0, 0, 2, 5, 4, 0 }, // Rocket Sneaker
/*Invincibility*/ { 0, 0, 0, 0, 0, 1, 5, 6,16 }, // Invincibility
/*Banana*/ { 0, 9, 4, 2, 1, 0, 0, 0, 0 }, // Banana
/*Eggman Monitor*/ { 0, 4, 3, 2, 0, 0, 0, 0, 0 }, // Eggman Monitor
/*Orbinaut*/ { 0, 6, 5, 4, 2, 0, 0, 0, 0 }, // Orbinaut
@ -472,13 +474,13 @@ static INT32 K_KartItemOddsRace[NUMKARTRESULTS][9] =
/*Mine*/ { 0, 0, 1, 2, 1, 0, 0, 0, 0 }, // Mine
/*Ballhog*/ { 0, 0, 1, 2, 1, 0, 0, 0, 0 }, // Ballhog
/*Self-Propelled Bomb*/ { 0, 0, 1, 1, 1, 2, 2, 3, 2 }, // Self-Propelled Bomb
/*Grow*/ { 0, 0, 0, 0, 0, 0, 1, 2, 4 }, // Grow
/*Grow*/ { 0, 0, 0, 0, 1, 2, 4, 6, 4 }, // Grow
/*Shrink*/ { 0, 0, 0, 0, 0, 0, 0, 1, 0 }, // Shrink
/*Lightning Shield*/ { 0, 1, 2, 0, 0, 0, 0, 0, 0 }, // Lightning Shield
/*Thunder Shield*/ { 0, 1, 2, 0, 0, 0, 0, 0, 0 }, // Thunder Shield
/*Hyudoro*/ { 0, 0, 0, 0, 1, 2, 1, 0, 0 }, // Hyudoro
/*Pogo Spring*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Pogo Spring
/*Kitchen Sink*/ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }, // Kitchen Sink
/*Sneaker x3*/ { 0, 0, 0, 0, 3, 7, 6, 4, 0 }, // Sneaker x3
/*Sneaker x3*/ { 0, 0, 0, 0, 3, 6, 5, 3, 0 }, // Sneaker x3
/*Banana x3*/ { 0, 0, 1, 1, 0, 0, 0, 0, 0 }, // Banana x3
/*Banana x10*/ { 0, 0, 0, 0, 1, 0, 0, 0, 0 }, // Banana x10
/*Orbinaut x3*/ { 0, 0, 0, 1, 1, 1, 0, 0, 0 }, // Orbinaut x3
@ -493,14 +495,14 @@ static INT32 K_KartItemOddsBattle[NUMKARTRESULTS][6] =
/*Invincibility*/ { 4, 2, 1, 2 }, // Invincibility
/*Banana*/ { 0, 0, 2, 0 }, // Banana
/*Eggman Monitor*/ { 0, 0, 1, 0 }, // Eggman Monitor
/*Orbinaut*/ { 0, 1, 4, 0 }, // Orbinaut
/*Orbinaut*/ { 0, 1, 5, 0 }, // Orbinaut
/*Jawz*/ { 1, 3, 2, 2 }, // Jawz
/*Mine*/ { 1, 3, 2, 2 }, // Mine
/*Ballhog*/ { 1, 2, 2, 2 }, // Ballhog
/*Ballhog*/ { 1, 2, 1, 2 }, // Ballhog
/*Self-Propelled Bomb*/ { 0, 0, 0, 0 }, // Self-Propelled Bomb
/*Grow*/ { 4, 2, 0, 2 }, // Grow
/*Shrink*/ { 0, 0, 0, 0 }, // Shrink
/*Lightning Shield*/ { 0, 0, 0, 0 }, // Lightning Shield
/*Thunder Shield*/ { 0, 0, 0, 0 }, // Thunder Shield
/*Hyudoro*/ { 0, 0, 1, 0 }, // Hyudoro
/*Pogo Spring*/ { 0, 0, 1, 0 }, // Pogo Spring
/*Kitchen Sink*/ { 0, 0, 0, 0 }, // Kitchen Sink
@ -678,9 +680,9 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, fixed_t mashed)
|| (indirectitemcooldown > 0)
|| (pingame-1 <= pexiting)) newodds = 0;
break;
case KITEM_LIGHTNINGSHIELD:
case KITEM_THUNDERSHIELD:
POWERITEMODDS(newodds);
if (!cv_lightningshield.value) newodds = 0;
if (!cv_thundershield.value) newodds = 0;
break;
case KITEM_HYUDORO:
if (!cv_hyudoro.value) newodds = 0;
@ -730,7 +732,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 avgbumper = 0;
INT32 bestbumper = 0;
boolean oddsvalid[9];
UINT8 disttable[14];
UINT8 distlen = 0;
@ -748,13 +750,10 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd)
if (!playeringame[i] || players[i].spectator)
continue;
pingame++;
if (players[i].kartstuff[k_bumper] > 0)
avgbumper += players[i].kartstuff[k_bumper];
if (players[i].kartstuff[k_bumper] > bestbumper)
bestbumper = players[i].kartstuff[k_bumper];
}
if (pingame)
avgbumper /= pingame;
// This makes the roulette produce the random noises.
if ((player->kartstuff[k_itemroulette] % 3) == 1 && P_IsLocalPlayer(player))
S_StartSound(NULL, sfx_mkitm1 + ((player->kartstuff[k_itemroulette] / 3) % 8));
@ -834,7 +833,9 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd)
useodds = 3;
else
{
SINT8 wantedpos = (player->kartstuff[k_bumper]-avgbumper)+2; // 0 is two bumpers below average, 2 is average
SINT8 wantedpos = (player->kartstuff[k_bumper]-bestbumper)+2; // 0 is two bumpers below best player's bumper count, 2 is best player's bumper count
if (K_IsPlayerWanted(player))
wantedpos--;
if (wantedpos > 2)
wantedpos = 2;
if (wantedpos < 0)
@ -897,7 +898,7 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd)
SETITEMRESULT(useodds, KITEM_SPB); // Self-Propelled Bomb
SETITEMRESULT(useodds, KITEM_GROW); // Grow
SETITEMRESULT(useodds, KITEM_SHRINK); // Shrink
SETITEMRESULT(useodds, KITEM_LIGHTNINGSHIELD); // Lightning Shield
SETITEMRESULT(useodds, KITEM_THUNDERSHIELD); // Thunder Shield
SETITEMRESULT(useodds, KITEM_HYUDORO); // Hyudoro
SETITEMRESULT(useodds, KITEM_POGOSPRING); // Pogo Spring
//SETITEMRESULT(useodds, KITEM_KITCHENSINK); // Kitchen Sink
@ -1337,16 +1338,47 @@ static void K_RegularVoiceTimers(player_t *player)
static void K_PlayTauntSound(mobj_t *source)
{
#if 1
sfxenum_t pick = P_RandomKey(4); // Gotta roll the RNG every time this is called for sync reasons
boolean tasteful = (!source->player || !source->player->kartstuff[k_tauntvoices]);
if (cv_kartvoices.value && (tasteful || cv_kartvoices.value == 2))
S_StartSound(source, sfx_taunt1+pick);
if (!tasteful)
return;
K_TauntVoiceTimers(source->player);
#else
if (source->player && source->player->kartstuff[k_tauntvoices]) // Prevents taunt sounds from playing every time the button is pressed
return;
S_StartSound(source, sfx_taunt1+P_RandomKey(4));
K_TauntVoiceTimers(source->player);
#endif
}
static void K_PlayOvertakeSound(mobj_t *source)
{
#if 1
boolean tasteful = (!source->player || !source->player->kartstuff[k_voices]);
if (!G_RaceGametype()) // Only in race
return;
// 4 seconds from before race begins, 10 seconds afterwards
if (leveltime < starttime+(10*TICRATE))
return;
if (cv_kartvoices.value && (tasteful || cv_kartvoices.value == 2))
S_StartSound(source, sfx_slow);
if (!tasteful)
return;
K_RegularVoiceTimers(source->player);
#else
if (source->player && source->player->kartstuff[k_voices]) // Prevents taunt sounds from playing every time the button is pressed
return;
@ -1360,11 +1392,13 @@ static void K_PlayOvertakeSound(mobj_t *source)
S_StartSound(source, sfx_slow);
K_RegularVoiceTimers(source->player);
#endif
}
static void K_PlayHitEmSound(mobj_t *source)
{
S_StartSound(source, sfx_hitem);
if (cv_kartvoices.value)
S_StartSound(source, sfx_hitem);
K_RegularVoiceTimers(source->player);
}
@ -1459,6 +1493,9 @@ fixed_t K_GetKartSpeed(player_t *player, boolean doboostpower)
UINT8 kartspeed = player->kartspeed;
fixed_t finalspeed;
if (doboostpower && !player->kartstuff[k_pogospring] && !P_IsObjectOnGround(player->mo))
return (75*mapheaderinfo[gamemap-1]->mobj_scale); // air speed cap
switch (gamespeed)
{
case 0:
@ -1556,9 +1593,34 @@ fixed_t K_3dKartMovement(player_t *player, boolean onground, fixed_t forwardmove
return finalspeed;
}
void K_DoInstashield(player_t *player)
{
mobj_t *layera;
mobj_t *layerb;
if (player->kartstuff[k_instashield] > 0)
return;
player->kartstuff[k_instashield] = 15; // length of instashield animation
S_StartSound(player->mo, sfx_cdpcm9);
layera = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_INSTASHIELDA);
P_SetTarget(&layera->target, player->mo);
layerb = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_INSTASHIELDB);
P_SetTarget(&layerb->target, player->mo);
}
void K_SpinPlayer(player_t *player, mobj_t *source, INT32 type, boolean trapitem)
{
const UINT8 scoremultiply = ((K_IsPlayerWanted(player) && !trapitem) ? 2 : 1);
UINT8 scoremultiply = 1;
if (!trapitem && G_BattleGametype())
{
if (K_IsPlayerWanted(player))
scoremultiply = 3;
else if (player->kartstuff[k_bumper] == 1)
scoremultiply = 2;
}
if (player->health <= 0)
return;
@ -1566,7 +1628,10 @@ 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_bumper] <= 0 && player->kartstuff[k_comebacktimer]) || player->kartstuff[k_comebackmode] == 1)))
{
K_DoInstashield(player);
return;
}
if (source && source != player->mo && source->player)
K_PlayHitEmSound(source);
@ -1626,12 +1691,20 @@ void K_SpinPlayer(player_t *player, mobj_t *source, INT32 type, boolean trapitem
if (player->mo->state != &states[S_KART_SPIN])
P_SetPlayerMobjState(player->mo, S_KART_SPIN);
player->kartstuff[k_instashield] = 15;
return;
}
void K_SquishPlayer(player_t *player, mobj_t *source)
{
const UINT8 scoremultiply = (K_IsPlayerWanted(player) ? 2 : 1);
UINT8 scoremultiply = 1;
if (G_BattleGametype())
{
if (K_IsPlayerWanted(player))
scoremultiply = 3;
else if (player->kartstuff[k_bumper] == 1)
scoremultiply = 2;
}
if (player->health <= 0)
return;
@ -1639,7 +1712,10 @@ 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_bumper] <= 0 && player->kartstuff[k_comebacktimer]) || player->kartstuff[k_comebackmode] == 1)))
{
K_DoInstashield(player);
return;
}
player->kartstuff[k_sneakertimer] = 0;
player->kartstuff[k_driftboost] = 0;
@ -1684,12 +1760,20 @@ void K_SquishPlayer(player_t *player, mobj_t *source)
P_PlayRinglossSound(player->mo);
player->kartstuff[k_instashield] = 15;
return;
}
void K_ExplodePlayer(player_t *player, mobj_t *source) // A bit of a hack, we just throw the player up higher here and extend their spinout timer
{
const UINT8 scoremultiply = (K_IsPlayerWanted(player) ? 2 : 1);
UINT8 scoremultiply = 1;
if (G_BattleGametype())
{
if (K_IsPlayerWanted(player))
scoremultiply = 3;
else if (player->kartstuff[k_bumper] == 1)
scoremultiply = 2;
}
if (player->health <= 0)
return;
@ -1697,7 +1781,10 @@ 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_bumper] <= 0 && player->kartstuff[k_comebacktimer]) || player->kartstuff[k_comebackmode] == 1)))
{
K_DoInstashield(player);
return;
}
player->mo->momz = 18*(mapheaderinfo[gamemap-1]->mobj_scale);
player->mo->momx = player->mo->momy = 0;
@ -1750,6 +1837,7 @@ void K_ExplodePlayer(player_t *player, mobj_t *source) // A bit of a hack, we ju
quake.time = 5;
}
player->kartstuff[k_instashield] = 15;
return;
}
@ -1771,12 +1859,15 @@ void K_StealBumper(player_t *player, player_t *victim, boolean force)
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_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))
if (player->kartstuff[k_squishedtimer] > 0 || player->kartstuff[k_spinouttimer] > 0)
return;
if (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)
{
K_DoInstashield(victim);
return;
}
}
if (netgame)
@ -1821,6 +1912,7 @@ void K_StealBumper(player_t *player, player_t *victim, boolean force)
/*victim->powers[pw_flashing] = K_GetKartFlashing();
victim->kartstuff[k_comebacktimer] = comebacktime;*/
victim->kartstuff[k_instashield] = 15;
return;
}
@ -2046,6 +2138,10 @@ static mobj_t *K_SpawnKartMissile(mobj_t *source, mobjtype_t type, angle_t angle
else
th->color = SKINCOLOR_CLOUDY;
}
else if (type == MT_JAWZ || type == MT_JAWZ_DUD)
{
S_StartSound(th, th->info->activesound);
}
x = x + P_ReturnThrustX(source, an, source->radius + th->radius);
y = y + P_ReturnThrustY(source, an, source->radius + th->radius);
@ -2150,7 +2246,7 @@ void K_SpawnSparkleTrail(mobj_t *mo)
}
}
void K_SpawnWipeoutTrail(mobj_t *mo)
void K_SpawnWipeoutTrail(mobj_t *mo, boolean translucent)
{
mobj_t *dust;
@ -2164,6 +2260,9 @@ void K_SpawnWipeoutTrail(mobj_t *mo)
dust->destscale = mo->scale;
P_SetScale(dust, mo->scale);
dust->eflags = (dust->eflags & ~MFE_VERTICALFLIP)|(mo->eflags & MFE_VERTICALFLIP);
if (translucent)
dust->flags2 |= MF2_SHADOW;
}
// K_DriftDustHandling
@ -2219,6 +2318,10 @@ void K_DriftDustHandling(mobj_t *spawner)
fixed_t spawny = P_RandomRange(-spawnrange, spawnrange)<<FRACBITS;
INT32 speedrange = 2;
mobj_t *dust = P_SpawnMobj(spawner->x + spawnx, spawner->y + spawny, spawner->z, MT_DRIFTDUST);
if (spawner->eflags & MFE_VERTICALFLIP)
{
dust->z += spawner->height - dust->height;
}
dust->momx = FixedMul(spawner->momx + (P_RandomRange(-speedrange, speedrange)<<FRACBITS), 3*FRACUNIT/4);
dust->momy = FixedMul(spawner->momy + (P_RandomRange(-speedrange, speedrange)<<FRACBITS), 3*FRACUNIT/4);
dust->momz = P_MobjFlip(spawner) * P_RandomRange(1, 4)<<FRACBITS;
@ -2234,6 +2337,11 @@ void K_DriftDustHandling(mobj_t *spawner)
else
dust->flags2 &= ~MF2_DONTDRAW;
if (spawner->eflags & MFE_VERTICALFLIP)
dust->eflags |= MFE_VERTICALFLIP;
else
dust->eflags &= ~MFE_VERTICALFLIP;
if (spawner->eflags & MFE_DRAWONLYFORP1)
dust->eflags |= MFE_DRAWONLYFORP1;
else
@ -2276,8 +2384,7 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map
mobj_t *mo;
INT32 dir, PROJSPEED;
angle_t newangle;
fixed_t newx;
fixed_t newy;
fixed_t newx, newy, newz;
mobj_t *throwmo;
if (!player)
@ -2353,6 +2460,8 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map
}
else
{
player->kartstuff[k_bananadrag] = 0; // RESET timer, for multiple bananas
if (dir == 1 || dir == 2)
{
// Shoot forward
@ -2393,6 +2502,7 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map
{
newx = lasttrail->x;
newy = lasttrail->y;
newz = lasttrail->z;
}
else
{
@ -2403,9 +2513,10 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map
newx = player->mo->x + P_ReturnThrustX(player->mo, newangle + ANGLE_180, dropradius);
newy = player->mo->y + P_ReturnThrustY(player->mo, newangle + ANGLE_180, dropradius);
newz = player->mo->z;
}
mo = P_SpawnMobj(newx, newy, player->mo->z, mapthing);
mo = P_SpawnMobj(newx, newy, newz, mapthing);
if (P_MobjFlip(player->mo) < 0)
mo->z = player->mo->z + player->mo->height - mo->height;
@ -2446,10 +2557,10 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map
return mo;
}
static void K_DoLightningShield(player_t *player)
static void K_DoThunderShield(player_t *player)
{
S_StartSound(player->mo, sfx_s3k45);
player->kartstuff[k_attractiontimer] = 35;
//player->kartstuff[k_thunderanim] = 35;
P_NukeEnemies(player->mo, player->mo, RING_DIST/4);
}
@ -2459,6 +2570,7 @@ static void K_DoHyudoroSteal(player_t *player)
INT32 playerswappable[MAXPLAYERS];
INT32 stealplayer = -1; // The player that's getting stolen from
INT32 prandom = 0;
boolean sink = P_RandomChance(FRACUNIT/64);
for (i = 0; i < MAXPLAYERS; i++)
{
@ -2482,7 +2594,7 @@ static void K_DoHyudoroSteal(player_t *player)
prandom = P_RandomFixed();
S_StartSound(player->mo, sfx_s3k92);
if (P_RandomChance(FRACUNIT/64)) // BEHOLD THE KITCHEN SINK
if (sink && numplayers > 0) // BEHOLD THE KITCHEN SINK
{
player->kartstuff[k_hyudorotimer] = hyudorotime;
player->kartstuff[k_stealingtimer] = stealtime;
@ -2632,10 +2744,10 @@ void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, boolean mute)
void K_KillBananaChain(mobj_t *banana, mobj_t *inflictor, mobj_t *source)
{
if (banana->hnext)
{
K_KillBananaChain(banana->hnext, inflictor, source);
}
mobj_t *cachenext;
killnext:
cachenext = banana->hnext;
if (banana->health)
{
@ -2651,6 +2763,9 @@ void K_KillBananaChain(mobj_t *banana, mobj_t *inflictor, mobj_t *source)
if (inflictor)
P_InstaThrust(banana, R_PointToAngle2(inflictor->x, inflictor->y, banana->x, banana->y)+ANGLE_90, 16*FRACUNIT);
}
if ((banana = cachenext))
goto killnext;
}
void K_RepairOrbitChain(mobj_t *orbit)
@ -2704,6 +2819,14 @@ static void K_MoveHeldObjects(player_t *player)
return;
}
if (P_MobjWasRemoved(player->mo->hnext))
{
// we need this here too because this is done in afterthink - pointers are cleaned up at the START of each tic...
P_SetTarget(&player->mo->hnext, NULL);
player->kartstuff[k_bananadrag] = 0;
return;
}
switch (player->mo->hnext->type)
{
case MT_ORBINAUT_SHIELD: // Kart orbit items
@ -2781,8 +2904,12 @@ static void K_MoveHeldObjects(player_t *player)
if (P_IsObjectOnGround(player->mo) && player->speed > 0)
{
player->kartstuff[k_bananadrag]++;
if (player->kartstuff[k_bananadrag] > TICRATE && leveltime % 7 == 0)
S_StartSound(player->mo, sfx_cdfm70);
if (player->kartstuff[k_bananadrag] > TICRATE)
{
K_SpawnWipeoutTrail(player->mo, true);
if (leveltime % 6 == 0)
S_StartSound(player->mo, sfx_cdfm70);
}
}
while (cur && !P_MobjWasRemoved(cur))
@ -2820,6 +2947,15 @@ static void K_MoveHeldObjects(player_t *player)
cur->angle = R_PointToAngle2(cur->x, cur->y, targx, targy);
/*if (P_IsObjectOnGround(player->mo) && player->speed > 0 && player->kartstuff[k_bananadrag] > TICRATE
&& P_RandomChance(min(FRACUNIT/2, FixedDiv(player->speed, K_GetKartSpeed(player, false))/2)))
{
if (leveltime & 1)
targz += 8*(2*FRACUNIT)/7;
else
targz -= 8*(2*FRACUNIT)/7;
}*/
if (speed > dist)
P_InstaThrust(cur, cur->angle, speed-dist);
@ -2905,8 +3041,8 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
if (player->kartstuff[k_spinouttimer] == 0 && player->powers[pw_flashing] == K_GetKartFlashing())
player->powers[pw_flashing]--;
if (player->kartstuff[k_attractiontimer])
player->kartstuff[k_attractiontimer]--;
/*if (player->kartstuff[k_thunderanim])
player->kartstuff[k_thunderanim]--;*/
if (player->kartstuff[k_sneakertimer])
player->kartstuff[k_sneakertimer]--;
@ -3012,6 +3148,9 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
if (P_IsObjectOnGround(player->mo))
player->kartstuff[k_waterskip] = 0;
if (player->kartstuff[k_instashield])
player->kartstuff[k_instashield]--;
// ???
/*
if (player->kartstuff[k_jmp] > 1 && onground)
@ -3430,7 +3569,9 @@ void K_StripItems(player_t *player)
player->kartstuff[k_stealingtimer] = 0;
player->kartstuff[k_stolentimer] = 0;
player->kartstuff[k_attractiontimer] = 0;
player->kartstuff[k_curshield] = 0;
//player->kartstuff[k_thunderanim] = 0;
player->kartstuff[k_bananadrag] = 0;
player->kartstuff[k_sadtimer] = 0;
}
@ -3472,8 +3613,22 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
if (player && player->mo && player->mo->health > 0 && !player->spectator && !(player->exiting || mapreset) && player->kartstuff[k_spinouttimer] == 0)
{
// First, the really specific, finicky items that function without the item being directly in your item slot.
// Karma item dropping
if (ATTACK_IS_DOWN && player->kartstuff[k_comebackmode] && !player->kartstuff[k_comebacktimer])
{
mobj_t *newitem;
player->kartstuff[k_comebackmode] = 0;
player->kartstuff[k_comebacktimer] = comebacktime;
S_StartSound(player->mo, sfx_s254);
newitem = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_RANDOMITEM);
newitem->flags2 = (player->mo->flags2 & MF2_OBJECTFLIP);
newitem->fuse = 15*TICRATE; // selected randomly.
newitem->threshold = 69; // selected "randomly".
}
// Eggman Monitor throwing
if (ATTACK_IS_DOWN && player->kartstuff[k_eggmanheld])
else if (ATTACK_IS_DOWN && player->kartstuff[k_eggmanheld])
{
K_ThrowKartItem(player, false, MT_FAKEITEM, -1, false);
K_PlayTauntSound(player->mo);
@ -3524,7 +3679,6 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
S_StartSound(player->mo, sfx_kinvnc);
K_PlayTauntSound(player->mo);
player->kartstuff[k_itemamount]--;
player->pflags |= PF_ATTACKDOWN;
}
break;
case KITEM_BANANA:
@ -3536,7 +3690,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
//K_PlayTauntSound(player->mo);
player->kartstuff[k_itemheld] = 1;
player->pflags |= PF_ATTACKDOWN;
S_StartSound(player->mo, sfx_s254);
for (moloop = 0; moloop < player->kartstuff[k_itemamount]; moloop++)
{
@ -3554,7 +3708,6 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
{
K_ThrowKartItem(player, false, MT_BANANA, -1, false);
K_PlayTauntSound(player->mo);
player->pflags |= PF_ATTACKDOWN;
player->kartstuff[k_itemamount]--;
if (!player->kartstuff[k_itemamount])
player->kartstuff[k_itemheld] = 0;
@ -3566,7 +3719,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
mobj_t *mo;
player->kartstuff[k_itemamount]--;
player->kartstuff[k_eggmanheld] = 1;
player->pflags |= PF_ATTACKDOWN;
S_StartSound(player->mo, sfx_s254);
mo = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_FAKESHIELD);
mo->threshold = 10;
mo->movecount = 1;
@ -3590,7 +3743,6 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
//K_PlayTauntSound(player->mo);
player->kartstuff[k_itemheld] = 1;
player->pflags |= PF_ATTACKDOWN;
S_StartSound(player->mo, sfx_s3k3a);
for (moloop = 0; moloop < player->kartstuff[k_itemamount]; moloop++)
@ -3614,7 +3766,6 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
{
K_ThrowKartItem(player, true, MT_ORBINAUT, 1, false);
K_PlayTauntSound(player->mo);
player->pflags |= PF_ATTACKDOWN;
player->kartstuff[k_itemamount]--;
if (!player->kartstuff[k_itemamount])
@ -3633,7 +3784,6 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
//K_PlayTauntSound(player->mo);
player->kartstuff[k_itemheld] = 1;
player->pflags |= PF_ATTACKDOWN;
S_StartSound(player->mo, sfx_s3k3a);
for (moloop = 0; moloop < player->kartstuff[k_itemamount]; moloop++)
@ -3659,7 +3809,6 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
else if (player->kartstuff[k_throwdir] == -1) // Throwing backward gives you a dud that doesn't home in
K_ThrowKartItem(player, true, MT_JAWZ_DUD, -1, false);
K_PlayTauntSound(player->mo);
player->pflags |= PF_ATTACKDOWN;
player->kartstuff[k_itemamount]--;
if (!player->kartstuff[k_itemamount])
@ -3671,7 +3820,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
{
mobj_t *mo;
player->kartstuff[k_itemheld] = 1;
player->pflags |= PF_ATTACKDOWN;
S_StartSound(player->mo, sfx_s254);
mo = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_SSMINE_SHIELD);
mo->threshold = 10;
mo->movecount = 1;
@ -3732,7 +3881,6 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
spbplayer = player-players;
player->pflags |= PF_ATTACKDOWN;
player->kartstuff[k_itemamount]--;
K_PlayTauntSound(player->mo);
@ -3752,7 +3900,6 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
if (!cv_kartinvinsfx.value && !P_IsLocalPlayer(player))
S_StartSound(player->mo, sfx_kgrow);
S_StartSound(player->mo, sfx_kc5a);
player->pflags |= PF_ATTACKDOWN;
player->kartstuff[k_itemamount]--;
}
break;
@ -3763,11 +3910,16 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
player->kartstuff[k_itemamount]--;
}
break;
case KITEM_LIGHTNINGSHIELD:
case KITEM_THUNDERSHIELD:
if (player->kartstuff[k_curshield] <= 0)
{
mobj_t *shield = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_THUNDERSHIELD);
P_SetTarget(&shield->target, player->mo);
player->kartstuff[k_curshield] = 1;
}
if (ATTACK_IS_DOWN && !HOLDING_ITEM && NO_HYUDORO)
{
K_DoLightningShield(player);
player->pflags |= PF_ATTACKDOWN;
K_DoThunderShield(player);
player->kartstuff[k_itemamount]--;
}
break;
@ -3775,8 +3927,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
if (ATTACK_IS_DOWN && !HOLDING_ITEM && NO_HYUDORO)
{
player->kartstuff[k_itemamount]--;
player->pflags |= PF_ATTACKDOWN;
K_DoHyudoroSteal(player);
K_DoHyudoroSteal(player); // yes. yes they do.
}
break;
case KITEM_POGOSPRING:
@ -3785,7 +3936,6 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
{
K_PlayTauntSound(player->mo);
K_DoPogoSpring(player->mo, 32<<FRACBITS, false);
player->pflags |= PF_ATTACKDOWN;
player->kartstuff[k_pogospring] = 1;
player->kartstuff[k_itemamount]--;
}
@ -3816,6 +3966,9 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
if (!player->kartstuff[k_itemamount] && !player->kartstuff[k_itemheld])
player->kartstuff[k_itemtype] = KITEM_NONE;
if (player->kartstuff[k_itemtype] != KITEM_THUNDERSHIELD)
player->kartstuff[k_curshield] = 0;
if (player->kartstuff[k_itemtype] == KITEM_SPB
|| player->kartstuff[k_itemtype] == KITEM_SHRINK
|| player->kartstuff[k_growshrinktimer] < 0
@ -3970,8 +4123,14 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
// Determine the outcome of your charge.
if (leveltime > starttime && player->kartstuff[k_boostcharge])
{
// Not even trying?
if (player->kartstuff[k_boostcharge] < 35)
{
if (player->kartstuff[k_boostcharge] > 17)
S_StartSound(player->mo, sfx_cdfm00); // chosen instead of a conventional skid because it's more engine-like
}
// Get an instant boost!
if (player->kartstuff[k_boostcharge] >= 35 && player->kartstuff[k_boostcharge] <= 50)
else if (player->kartstuff[k_boostcharge] <= 50)
{
player->kartstuff[k_sneakertimer] = -((21*(player->kartstuff[k_boostcharge]*player->kartstuff[k_boostcharge]))/425)+131; // max time is 70, min time is 7; yay parabooolas
if (!player->kartstuff[k_floorboost] || player->kartstuff[k_floorboost] == 3)
@ -4276,7 +4435,7 @@ static patch_t *kp_ballhog[2];
static patch_t *kp_selfpropelledbomb[2];
static patch_t *kp_grow[2];
static patch_t *kp_shrink[2];
static patch_t *kp_lightningshield[2];
static patch_t *kp_thundershield[2];
static patch_t *kp_hyudoro[2];
static patch_t *kp_pogospring[2];
static patch_t *kp_kitchensink[2];
@ -4386,7 +4545,7 @@ void K_LoadKartHUDGraphics(void)
kp_selfpropelledbomb[0] = W_CachePatchName("K_ITSPB", PU_HUDGFX);
kp_grow[0] = W_CachePatchName("K_ITGROW", PU_HUDGFX);
kp_shrink[0] = W_CachePatchName("K_ITSHRK", PU_HUDGFX);
kp_lightningshield[0] = W_CachePatchName("K_ITLITS", PU_HUDGFX);
kp_thundershield[0] = W_CachePatchName("K_ITTHNS", PU_HUDGFX);
kp_hyudoro[0] = W_CachePatchName("K_ITHYUD", PU_HUDGFX);
kp_pogospring[0] = W_CachePatchName("K_ITPOGO", PU_HUDGFX);
kp_kitchensink[0] = W_CachePatchName("K_ITSINK", PU_HUDGFX);
@ -4414,7 +4573,7 @@ void K_LoadKartHUDGraphics(void)
kp_selfpropelledbomb[1] = W_CachePatchName("K_ISSPB", PU_HUDGFX);
kp_grow[1] = W_CachePatchName("K_ISGROW", PU_HUDGFX);
kp_shrink[1] = W_CachePatchName("K_ISSHRK", PU_HUDGFX);
kp_lightningshield[1] = W_CachePatchName("K_ISLITS", PU_HUDGFX);
kp_thundershield[1] = W_CachePatchName("K_ISTHNS", PU_HUDGFX);
kp_hyudoro[1] = W_CachePatchName("K_ISHYUD", PU_HUDGFX);
kp_pogospring[1] = W_CachePatchName("K_ISPOGO", PU_HUDGFX);
kp_kitchensink[1] = W_CachePatchName("K_ISSINK", PU_HUDGFX);
@ -4648,22 +4807,22 @@ static void K_drawKartItem(void)
switch((stplyr->kartstuff[k_itemroulette] % (13*3)) / 3)
{
// Each case is handled in threes, to give three frames of in-game time to see the item on the roulette
case 0: localpatch = kp_sneaker[offset]; break; // Sneaker
case 0: localpatch = kp_sneaker[offset]; break; // Sneaker
case 1: localpatch = kp_banana[offset]; break; // Banana
case 2: localpatch = kp_orbinaut[offset]; break; // Orbinaut
case 3: localpatch = kp_mine[offset]; break; // Mine
case 4: localpatch = kp_grow[offset]; break; // Grow
case 5: localpatch = kp_hyudoro[offset]; break; // Hyudoro
case 2: localpatch = kp_orbinaut[offset]; break; // Orbinaut
case 3: localpatch = kp_mine[offset]; break; // Mine
case 4: localpatch = kp_grow[offset]; break; // Grow
case 5: localpatch = kp_hyudoro[offset]; break; // Hyudoro
case 6: localpatch = kp_rocketsneaker[offset]; break; // Rocket Sneaker
case 7: localpatch = kp_jawz[offset]; break; // Jawz
case 7: localpatch = kp_jawz[offset]; break; // Jawz
case 8: localpatch = kp_selfpropelledbomb[offset]; break; // Self-Propelled Bomb
case 9: localpatch = kp_shrink[offset]; break; // Shrink
case 10: localpatch = localinv; break; // Invincibility
case 10: localpatch = localinv; break; // Invincibility
case 11: localpatch = kp_eggman[offset]; break; // Eggman Monitor
case 12: localpatch = kp_ballhog[offset]; break; // Ballhog
case 13: localpatch = kp_lightningshield[offset]; break; // Lightning Shield
//case 14: localpatch = kp_pogospring[offset]; break; // Pogo Spring
//case 15: localpatch = kp_kitchensink[offset]; break; // Kitchen Sink
case 12: localpatch = kp_ballhog[offset]; break; // Ballhog
case 13: localpatch = kp_thundershield[offset]; break; // Thunder Shield
//case 14: localpatch = kp_pogospring[offset]; break; // Pogo Spring
//case 15: localpatch = kp_kitchensink[offset]; break; // Kitchen Sink
default: break;
}
}
@ -4724,7 +4883,7 @@ static void K_drawKartItem(void)
case KITEM_SPB: localpatch = kp_selfpropelledbomb[offset]; break;
case KITEM_GROW: localpatch = kp_grow[offset]; break;
case KITEM_SHRINK: localpatch = kp_shrink[offset]; break;
case KITEM_LIGHTNINGSHIELD: localpatch = kp_lightningshield[offset]; break;
case KITEM_THUNDERSHIELD: localpatch = kp_thundershield[offset]; break;
case KITEM_HYUDORO: localpatch = kp_hyudoro[offset]; break;
case KITEM_POGOSPRING: localpatch = kp_pogospring[offset]; break;
case KITEM_KITCHENSINK: localpatch = kp_kitchensink[offset]; break;
@ -5622,19 +5781,16 @@ static void K_drawBattleFullscreen(void)
}
else if (stplyr->kartstuff[k_bumper] <= 0 && stplyr->kartstuff[k_comebacktimer] && comeback)
{
INT32 t = stplyr->kartstuff[k_comebacktimer]/TICRATE;
INT32 txoff = 0;
UINT16 t = stplyr->kartstuff[k_comebacktimer]/(10*TICRATE);
INT32 txoff, adjust = (splitscreen > 1) ? 4 : 6; // normal string is 8, kart string is 12, half of that for ease
INT32 ty = (BASEVIDHEIGHT/2)+66;
if (t == 0)
txoff = 8;
else
txoff = adjust;
while (t)
{
while (t)
{
txoff += 8;
t /= 10;
}
txoff += adjust;
t /= 10;
}
if (splitscreen)
@ -5655,7 +5811,7 @@ static void K_drawBattleFullscreen(void)
V_DrawFixedPatch(x<<FRACBITS, y<<FRACBITS, scale, splitflags, kp_battlewait, NULL);
if (splitscreen > 1)
V_DrawString(x-(txoff/2), ty, 0, va("%d", stplyr->kartstuff[k_comebacktimer]/TICRATE));
V_DrawString(x-txoff, ty, 0, va("%d", stplyr->kartstuff[k_comebacktimer]/TICRATE));
else
{
V_DrawFixedPatch(x<<FRACBITS, ty<<FRACBITS, scale, 0, kp_timeoutsticker, NULL);
@ -5946,11 +6102,13 @@ static void K_drawCheckpointDebugger(void)
void K_drawKartFreePlay(UINT32 flashtime)
{
// no splitscreen support because it's not FREE PLAY if you have more than one player in-game
if ((flashtime % TICRATE) < TICRATE/2)
return;
V_DrawKartString(BASEVIDWIDTH/2 - (6*9), // horizontally centered, nice
LAPS_Y+3, V_SNAPTOBOTTOM, "FREE PLAY");
V_DrawKartString((BASEVIDWIDTH - (LAPS_X+1)) - (12*9), // mirror the laps thingy
LAPS_Y+3, V_SNAPTOBOTTOM|V_SNAPTORIGHT, "FREE PLAY");
}
void K_drawKartHUD(void)

View file

@ -25,6 +25,7 @@ void K_RespawnChecker(player_t *player);
void K_KartMoveAnimation(player_t *player);
void K_KartPlayerThink(player_t *player, ticcmd_t *cmd);
void K_KartPlayerAfterThink(player_t *player);
void K_DoInstashield(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);
@ -33,7 +34,7 @@ void K_SpawnKartExplosion(fixed_t x, fixed_t y, fixed_t z, fixed_t radius, INT32
void K_SpawnMineExplosion(mobj_t *source, UINT8 color);
void K_SpawnBoostTrail(player_t *player);
void K_SpawnSparkleTrail(mobj_t *mo);
void K_SpawnWipeoutTrail(mobj_t *mo);
void K_SpawnWipeoutTrail(mobj_t *mo, boolean translucent);
void K_DriftDustHandling(mobj_t *spawner);
void K_DoSneaker(player_t *player, boolean doPFlag);
void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, boolean mute);

View file

@ -20,6 +20,8 @@
#include "m_random.h"
#include "s_sound.h"
#include "g_game.h"
#include "hu_stuff.h"
#include "console.h"
#include "k_kart.h"
#include "lua_script.h"
@ -86,6 +88,57 @@ static int lib_print(lua_State *L)
return 0;
}
// Print stuff in the chat, or in the console if we can't.
static int lib_chatprint(lua_State *L)
{
const char *str = luaL_checkstring(L, 1); // retrieve string
if (str == NULL) // error if we don't have a string!
return luaL_error(L, LUA_QL("tostring") " must return a string to " LUA_QL("chatprint"));
int len = strlen(str);
if (len > 255) // string is too long!!!
return luaL_error(L, "String exceeds the 255 characters limit of the chat buffer.");
HU_AddChatText(str);
if OLDCHAT
CONS_Printf("%s\n", str);
else
CON_LogMessage(str); // save to log.txt
return 0;
}
// Same as above, but do it for only one player.
static int lib_chatprintf(lua_State *L)
{
int n = lua_gettop(L); /* number of arguments */
player_t *plr;
if (n < 2)
return luaL_error(L, "chatprintf requires at least two arguments: player and text.");
plr = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); // retrieve player
if (!plr)
return LUA_ErrInvalid(L, "player_t");
if (plr != &players[consoleplayer])
return 0;
const char *str = luaL_checkstring(L, 2); // retrieve string
if (str == NULL) // error if we don't have a string!
return luaL_error(L, LUA_QL("tostring") " must return a string to " LUA_QL("chatprintf"));
int len = strlen(str);
if (len > 255) // string is too long!!!
return luaL_error(L, "String exceeds the 255 characters limit of the chat buffer.");
HU_AddChatText(str);
if OLDCHAT
CONS_Printf("%s\n", str);
else
CON_LogMessage(str); // save to log.txt
return 0;
}
static int lib_evalMath(lua_State *L)
{
const char *word = luaL_checkstring(L, 1);
@ -2038,6 +2091,16 @@ static int lib_kKartBouncing(lua_State *L)
return 0;
}
static int lib_kDoInstashield(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
NOHUD
if (!player)
return LUA_ErrInvalid(L, "player_t");
K_DoInstashield(player);
return 0;
}
static int lib_kSpinPlayer(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
@ -2135,10 +2198,11 @@ static int lib_kSpawnSparkleTrail(lua_State *L)
static int lib_kSpawnWipeoutTrail(lua_State *L)
{
mobj_t *mo = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
boolean translucent = luaL_checkboolean(L, 2);
NOHUD
if (!mo)
return LUA_ErrInvalid(L, "mobj_t");
K_SpawnWipeoutTrail(mo);
K_SpawnWipeoutTrail(mo, translucent);
return 0;
}
@ -2244,6 +2308,8 @@ static int lib_kGetKartFlashing(lua_State *L)
static luaL_Reg lib[] = {
{"print", lib_print},
{"chatprint", lib_chatprint},
{"chatprintf", lib_chatprintf},
{"EvalMath", lib_evalMath},
// m_random
@ -2421,6 +2487,7 @@ static luaL_Reg lib[] = {
{"K_IsPlayerLosing",lib_kIsPlayerLosing},
{"K_IsPlayerWanted",lib_kIsPlayerWanted},
{"K_KartBouncing",lib_kKartBouncing},
{"K_DoInstashield",lib_kDoInstashield},
{"K_SpinPlayer",lib_kSpinPlayer},
{"K_SquishPlayer",lib_kSquishPlayer},
{"K_ExplodePlayer",lib_kExplodePlayer},

View file

@ -74,7 +74,7 @@ boolean LUAh_MobjDeath(mobj_t *target, mobj_t *inflictor, mobj_t *source); // Ho
boolean LUAh_BotTiccmd(player_t *bot, ticcmd_t *cmd); // Hook for B_BuildTiccmd
boolean LUAh_BotAI(mobj_t *sonic, mobj_t *tails, ticcmd_t *cmd); // Hook for B_BuildTailsTiccmd by skin name
boolean LUAh_LinedefExecute(line_t *line, mobj_t *mo, sector_t *sector); // Hook for linedef executors
boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg); // Hook for chat messages
boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg, int mute); // Hook for chat messages
boolean LUAh_HurtMsg(player_t *player, mobj_t *inflictor, mobj_t *source); // Hook for hurt messages
#define LUAh_PlayerSpawn(player) LUAh_PlayerHook(player, hook_PlayerSpawn) // Hook for G_SpawnPlayer

View file

@ -952,7 +952,9 @@ boolean LUAh_LinedefExecute(line_t *line, mobj_t *mo, sector_t *sector)
}
// Hook for player chat
boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg)
// Added the "mute" field. It's set to true if the message was supposed to be eaten by spam protection.
// But for netgame consistency purposes, this hook is ran first reguardless, so this boolean allows for modders to adapt if they so desire.
boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg, int mute)
{
hook_p hookp;
boolean hooked = false;
@ -981,14 +983,19 @@ boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg)
LUA_PushUserdata(gL, &players[target-1], META_PLAYER); // target
}
lua_pushstring(gL, msg); // msg
if (mute)
lua_pushboolean(gL, true); // the message was supposed to be eaten by spamprotecc.
else
lua_pushboolean(gL, false);
}
lua_pushfstring(gL, FMT_HOOKID, hookp->id);
lua_gettable(gL, LUA_REGISTRYINDEX);
lua_pushvalue(gL, -5);
lua_pushvalue(gL, -5);
lua_pushvalue(gL, -5);
lua_pushvalue(gL, -5);
if (lua_pcall(gL, 4, 1, 0)) {
lua_pushvalue(gL, -6);
lua_pushvalue(gL, -6);
lua_pushvalue(gL, -6);
lua_pushvalue(gL, -6);
lua_pushvalue(gL, -6);
if (lua_pcall(gL, 5, 1, 0)) {
if (!hookp->error || cv_debug & DBG_LUA)
CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
lua_pop(gL, 1);

View file

@ -339,7 +339,6 @@ static void M_DrawSetupChoosePlayerMenu(void);
static void M_DrawControl(void);
static void M_DrawVideoMenu(void);
static void M_DrawVideoMode(void);
static void M_DrawHUDOptions(void);
//static void M_DrawMonitorToggles(void);
#ifdef HWRENDER
static void M_OGL_DrawFogMenu(void);
@ -1047,7 +1046,7 @@ static menuitem_t OP_MainMenu[] =
{IT_SUBMENU|IT_STRING, NULL, "Video Options...", &OP_VideoOptionsDef, 30},
{IT_SUBMENU|IT_STRING, NULL, "Sound Options...", &OP_SoundOptionsDef, 40},
{IT_SUBMENU|IT_STRING, NULL, "HUD Options...", &OP_HUDOptionsDef, 60},
{IT_SUBMENU|IT_STRING, NULL, "HUD Options...", &OP_HUDOptionsDef, 60},
{IT_STRING|IT_CALL, NULL, "Screenshot Options...", M_ScreenshotOptions, 70},
{IT_SUBMENU|IT_STRING, NULL, "Gameplay Options...", &OP_GameOptionsDef, 90},
@ -1246,23 +1245,49 @@ static menuitem_t OP_Mouse2OptionsMenu[] =
static menuitem_t OP_VideoOptionsMenu[] =
{
{IT_STRING | IT_CALL, NULL, "Set Resolution...", M_VideoModeMenu, 10},
#ifdef HWRENDER
{IT_SUBMENU|IT_STRING, NULL, "OpenGL Options...", &OP_OpenGLOptionsDef, 20},
#endif
#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL)
{IT_STRING|IT_CVAR, NULL, "Fullscreen", &cv_fullscreen, 30},
{IT_STRING|IT_CVAR, NULL, "Fullscreen", &cv_fullscreen, 20},
#endif
{IT_STRING | IT_CVAR | IT_CV_SLIDER,
NULL, "Gamma", &cv_usegamma, 50},
NULL, "Gamma", &cv_usegamma, 30},
{IT_STRING | IT_CVAR, NULL, "Menu Highlights", &cons_menuhighlight, 45},
// highlight info - (GOOD HIGHLIGHT, WARNING HIGHLIGHT) - 55 (see M_DrawVideoMenu)
{IT_STRING | IT_CVAR, NULL, "Draw Distance", &cv_drawdist, 70},
//{IT_STRING | IT_CVAR, NULL, "NiGHTS Draw Dist", &cv_drawdist_nights, 80},
{IT_STRING | IT_CVAR, NULL, "Weather Draw Dist.", &cv_drawdist_precip, 80},
{IT_STRING | IT_CVAR, NULL, "Weather Draw Distance",&cv_drawdist_precip, 80},
{IT_STRING | IT_CVAR, NULL, "Weather Density", &cv_precipdensity, 90},
{IT_STRING | IT_CVAR, NULL, "Skyboxes", &cv_skybox, 100},
{IT_STRING | IT_CVAR, NULL, "Show FPS", &cv_ticrate, 120},
{IT_STRING | IT_CVAR, NULL, "Vertical Sync", &cv_vidwait, 130},
{IT_STRING | IT_CVAR, NULL, "Show FPS", &cv_ticrate, 115},
{IT_STRING | IT_CVAR, NULL, "Vertical Sync", &cv_vidwait, 125},
{IT_STRING | IT_CVAR, NULL, "Console Text Size", &cv_constextsize, 140},
#ifdef HWRENDER
{IT_SUBMENU|IT_STRING, NULL, "OpenGL Options...", &OP_OpenGLOptionsDef, 155},
#endif
};
enum
{
op_video_res = 0,
#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL)
op_video_fullscreen,
#endif
op_video_gamma,
op_video_hili,
op_video_dd,
op_video_wdd,
op_video_wd,
op_video_skybox,
op_video_fps,
op_video_vsync,
op_video_consoletext,
#ifdef HWRENDER
op_video_ogl,
#endif
};
static menuitem_t OP_VideoModeMenu[] =
@ -1334,12 +1359,14 @@ static menuitem_t OP_SoundOptionsMenu[] =
{IT_STRING|IT_CALL, NULL, "Restart Audio System", M_RestartAudio, 50},
{IT_STRING|IT_CVAR, NULL, "Reverse L/R Channels", &stereoreverse, 70},
{IT_STRING|IT_CVAR, NULL, "Surround Sound", &surround, 80},
{IT_STRING|IT_CVAR, NULL, "Reverse L/R Channels", &stereoreverse, 65},
{IT_STRING|IT_CVAR, NULL, "Surround Sound", &surround, 75},
{IT_STRING|IT_CVAR, NULL, "Powerup Warning", &cv_kartinvinsfx, 100},
{IT_STRING|IT_CVAR, NULL, "Chat sounds", &cv_chatnotifications, 90},
{IT_STRING|IT_CVAR, NULL, "Character voices", &cv_kartvoices, 100},
{IT_STRING|IT_CVAR, NULL, "Powerup Warning", &cv_kartinvinsfx, 110},
{IT_KEYHANDLER|IT_STRING, NULL, "Sound Test", M_HandleSoundTest, 120},
{IT_KEYHANDLER|IT_STRING, NULL, "Sound Test", M_HandleSoundTest, 125},
};
/*static menuitem_t OP_DataOptionsMenu[] =
@ -1392,19 +1419,23 @@ static menuitem_t OP_EraseDataMenu[] =
static menuitem_t OP_HUDOptionsMenu[] =
{
{IT_STRING | IT_CVAR, NULL, "Show HUD (F3)", &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},
{IT_STRING | IT_CVAR | IT_CV_SLIDER,
NULL, "Minimap Visibility", &cv_kartminimap, 40},
{IT_STRING | IT_CVAR, NULL, "Speedometer Display", &cv_kartspeedometer, 50},
{IT_STRING | IT_CVAR, NULL, "Show \"CHECK\"", &cv_kartcheck, 60},
NULL, "Minimap Visibility", &cv_kartminimap, 35},
{IT_STRING | IT_CVAR, NULL, "Speedometer Display", &cv_kartspeedometer, 45},
{IT_STRING | IT_CVAR, NULL, "Show \"CHECK\"", &cv_kartcheck, 55},
{IT_STRING | IT_CVAR, NULL, "Console Color", &cons_backcolor, 80},
{IT_STRING | IT_CVAR, NULL, "Console Text Size", &cv_constextsize, 90},
{IT_STRING | IT_CVAR, NULL, "Menu Highlights", &cons_menuhighlight, 110},
//{IT_STRING | IT_CVAR, NULL, "Chat mode", &cv_consolechat, 70}, -- will ANYONE who doesn't know how to use the console want to touch this
{IT_STRING | IT_CVAR | IT_CV_SLIDER,
NULL, "Chat box width", &cv_chatwidth, 70},
{IT_STRING | IT_CVAR | IT_CV_SLIDER,
NULL, "Chat box height", &cv_chatheight, 80},
{IT_STRING | IT_CVAR, NULL, "Chat fadeout time", &cv_chattime, 90},
{IT_STRING | IT_CVAR, NULL, "Show tint behind messages",&cv_chatbacktint, 100},
{IT_STRING | IT_CVAR, NULL, "Background Color", &cons_backcolor, 110},
};
static menuitem_t OP_GameOptionsMenu[] =
@ -1419,7 +1450,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 Bumpers", &cv_kartbumpers, 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},
@ -1434,16 +1465,16 @@ static menuitem_t OP_ServerOptionsMenu[] =
#endif
{IT_STRING | IT_CVAR, NULL, "Intermission Timer", &cv_inttime, 40},
{IT_STRING | IT_CVAR, NULL, "Voting Timer", &cv_votetime, 50},
{IT_STRING | IT_CVAR, NULL, "Advance to Next Level", &cv_advancemap, 60},
{IT_STRING | IT_CVAR, NULL, "Map Progression", &cv_advancemap, 50},
{IT_STRING | IT_CVAR, NULL, "Voting Timer", &cv_votetime, 60},
#ifndef NONET
{IT_STRING | IT_CVAR, NULL, "Max Player Count", &cv_maxplayers, 80},
{IT_STRING | IT_CVAR, NULL, "Allow Players to Join", &cv_allownewplayer, 90},
{IT_STRING | IT_CVAR, NULL, "Allow Players to Join", &cv_allownewplayer, 90},
//{IT_STRING | IT_CVAR, NULL, "Join on Map Change", &cv_joinnextround, 100},
{IT_STRING | IT_CVAR, NULL, "Allow WAD Downloading", &cv_downloading, 100},
{IT_STRING | IT_CVAR, NULL, "Attempts to Resynch", &cv_resynchattempts, 110},
{IT_STRING | IT_CVAR, NULL, "Allow WAD Downloading", &cv_downloading, 100},
{IT_STRING | IT_CVAR, NULL, "Attempts to resynchronise", &cv_resynchattempts, 110},
#endif
};
@ -1499,7 +1530,7 @@ static menuitem_t OP_MonitorToggleMenu[] =
{IT_STRING | IT_CVAR, NULL, "Self-Propelled Bombs",&cv_selfpropelledbomb,114},
{IT_STRING | IT_CVAR, NULL, "Grow", &cv_grow, 122},
{IT_STRING | IT_CVAR, NULL, "Shrink", &cv_shrink, 130},
{IT_STRING | IT_CVAR, NULL, "Lightning Shields", &cv_lightningshield, 138},
{IT_STRING | IT_CVAR, NULL, "Thunder Shields", &cv_thundershield, 138},
{IT_STRING | IT_CVAR, NULL, "Hyudoros", &cv_hyudoro, 146},
{IT_STRING | IT_CVAR, NULL, "Pogo Springs", &cv_pogospring, 154},
};
@ -1875,7 +1906,7 @@ menu_t OP_VideoOptionsDef =
&OP_MainDef,
OP_VideoOptionsMenu,
M_DrawVideoMenu,
60, 30,
30, 30,
0,
NULL
};
@ -1899,7 +1930,7 @@ menu_t OP_SoundOptionsDef =
&OP_MainDef,
OP_SoundOptionsMenu,
M_DrawSkyRoom,
60, 30,
30, 30,
0,
NULL
};
@ -1910,7 +1941,7 @@ menu_t OP_HUDOptionsDef =
sizeof (OP_HUDOptionsMenu)/sizeof (menuitem_t),
&OP_MainDef,
OP_HUDOptionsMenu,
M_DrawHUDOptions,
M_DrawGenericMenu, //M_DrawHUDOptions,
30, 30,
0,
NULL
@ -2203,29 +2234,30 @@ static void M_ChangeCvar(INT32 choice)
if (cv == &cv_playercolor)
{
SINT8 skinno = R_SkinAvailable(cv_chooseskin.string);
if (skinno == -1)
return;
CV_SetValue(cv,skins[skinno].prefcolor);
if (skinno != -1)
CV_SetValue(cv,skins[skinno].prefcolor);
return;
}
return;
CV_Set(cv,cv->defaultvalue);
return;
}
choice = (choice<<1) - 1;
if (((currentMenu->menuitems[itemOn].status & IT_CVARTYPE) == IT_CV_SLIDER)
||((currentMenu->menuitems[itemOn].status & IT_CVARTYPE) == IT_CV_INVISSLIDER)
||((currentMenu->menuitems[itemOn].status & IT_CVARTYPE) == IT_CV_NOMOD))
{
CV_SetValue(cv,cv->value+(choice*2-1));
CV_SetValue(cv,cv->value+choice);
}
else if (cv->flags & CV_FLOAT)
{
char s[20];
sprintf(s,"%f",FIXED_TO_FLOAT(cv->value)+(choice*2-1)*(1.0f/16.0f));
sprintf(s,"%f",FIXED_TO_FLOAT(cv->value)+(choice)*(1.0f/16.0f));
CV_Set(cv,s);
}
else
CV_AddValue(cv,choice*2-1);
CV_AddValue(cv,choice);
}
static boolean M_ChangeStringCvar(INT32 choice)
@ -2583,7 +2615,7 @@ boolean M_Responder(event_t *ev)
if (routine && ((currentMenu->menuitems[itemOn].status & IT_TYPE) == IT_ARROWS
|| (currentMenu->menuitems[itemOn].status & IT_TYPE) == IT_CVAR))
{
if (currentMenu != &OP_SoundOptionsDef)
if (currentMenu != &OP_SoundOptionsDef || itemOn > 3)
S_StartSound(NULL, sfx_menu1);
routine(0);
}
@ -2593,7 +2625,7 @@ boolean M_Responder(event_t *ev)
if (routine && ((currentMenu->menuitems[itemOn].status & IT_TYPE) == IT_ARROWS
|| (currentMenu->menuitems[itemOn].status & IT_TYPE) == IT_CVAR))
{
if (currentMenu != &OP_SoundOptionsDef)
if (currentMenu != &OP_SoundOptionsDef || itemOn > 3)
S_StartSound(NULL, sfx_menu1);
routine(1);
}
@ -2680,16 +2712,17 @@ boolean M_Responder(event_t *ev)
|| cv == &cv_newgametype)
return true;
if (currentMenu != &OP_SoundOptionsDef)
if (currentMenu != &OP_SoundOptionsDef || itemOn > 3)
S_StartSound(NULL, sfx_menu1);
routine(-1);
return true;
}
// Why _does_ backspace go back anyway?
//currentMenu->lastOn = itemOn;
//if (currentMenu->prevMenu)
// M_SetupNextMenu(currentMenu->prevMenu);
// Sal: Because it supports gamepads better. And still makes sense for keyboard.
currentMenu->lastOn = itemOn;
if (currentMenu->prevMenu)
M_SetupNextMenu(currentMenu->prevMenu);
return false;
default:
@ -3047,7 +3080,7 @@ void M_Init(void)
#ifdef HWRENDER
// Permanently hide some options based on render mode
if (rendermode == render_soft)
OP_VideoOptionsMenu[1].status = IT_DISABLED;
OP_VideoOptionsMenu[op_video_ogl].status = IT_DISABLED;
#endif
#ifndef NONET
@ -3126,7 +3159,7 @@ static void M_DrawSlider(INT32 x, INT32 y, const consvar_t *cv, boolean ontop)
if (ontop)
{
V_DrawCharacter(x - 15 - (skullAnimCounter/5), y,
V_DrawCharacter(x - 16 - (skullAnimCounter/5), y,
'\x1C' | highlightflags, false); // left arrow
V_DrawCharacter(x+(SLIDER_RANGE*8) + 8 + (skullAnimCounter/5), y,
'\x1D' | highlightflags, false); // right arrow
@ -4565,6 +4598,7 @@ static void M_DrawSkyRoom(void)
break;
}
}
if (y)
{
y += currentMenu->y;
@ -4580,9 +4614,9 @@ static void M_DrawSkyRoom(void)
if (lengthstring)
{
V_DrawCharacter(BASEVIDWIDTH - currentMenu->x - 10 - lengthstring - (skullAnimCounter/5), currentMenu->y+currentMenu->menuitems[itemOn].alphaKey,
'\x1C' | highlightflags, false);
'\x1C' | highlightflags, false); // left arrow
V_DrawCharacter(BASEVIDWIDTH - currentMenu->x + 2 + (skullAnimCounter/5), currentMenu->y+currentMenu->menuitems[itemOn].alphaKey,
'\x1D' | highlightflags, false);
'\x1D' | highlightflags, false); // right arrow
}
}
@ -8202,8 +8236,25 @@ static void M_VideoModeMenu(INT32 choice)
static void M_DrawVideoMenu(void)
{
const char *str0 = ")";
const char *str1 = " Warning highlight";
const char *str2 = ",";
const char *str3 = "Good highlight";
INT32 x = BASEVIDWIDTH - currentMenu->x + 2, y = currentMenu->y + 55;
INT32 w0 = V_StringWidth(str0, 0), w1 = V_StringWidth(str1, 0), w2 = V_StringWidth(str2, 0), w3 = V_StringWidth(str3, 0);
M_DrawGenericMenu();
x -= w0;
V_DrawString(x, y, highlightflags, str0);
x -= w1;
V_DrawString(x, y, warningflags, str1);
x -= w2;
V_DrawString(x, y, highlightflags, str2);
x -= w3;
V_DrawString(x, y, recommendedflags, str3);
V_DrawRightAlignedString(x, y, highlightflags, "(");
V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x, currentMenu->y + OP_VideoOptionsMenu[0].alphaKey,
(SCR_IsAspectCorrect(vid.width, vid.height) ? recommendedflags : highlightflags),
va("%dx%d", vid.width, vid.height));
@ -8354,26 +8405,6 @@ static void M_HandleVideoMode(INT32 ch)
}
}
static void M_DrawHUDOptions(void)
{
const char *str0 = ")";
const char *str1 = " Warning highlight";
const char *str2 = ",";
const char *str3 = "Good highlight";
INT32 x = BASEVIDWIDTH - currentMenu->x + 2, y = currentMenu->y + 120;
INT32 w0 = V_StringWidth(str0, 0), w1 = V_StringWidth(str1, 0), w2 = V_StringWidth(str2, 0), w3 = V_StringWidth(str3, 0);
M_DrawGenericMenu();
x -= w0;
V_DrawString(x, y, highlightflags, str0);
x -= w1;
V_DrawString(x, y, warningflags, str1);
x -= w2;
V_DrawString(x, y, highlightflags, str2);
x -= w3;
V_DrawString(x, y, recommendedflags, str3);
V_DrawRightAlignedString(x, y, highlightflags, "(");
}
// ===============
// Monitor Toggles
// ===============

View file

@ -191,6 +191,7 @@ void A_ItemPop(mobj_t *actor); // SRB2kart
void A_JawzChase(mobj_t *actor); // SRB2kart
void A_JawzExplode(mobj_t *actor); // SRB2kart
void A_MineExplode(mobj_t *actor); // SRB2kart
void A_BallhogExplode(mobj_t *actor); // SRB2kart
void A_OrbitNights(mobj_t *actor);
void A_GhostMe(mobj_t *actor);
void A_SetObjectState(mobj_t *actor);
@ -8092,7 +8093,7 @@ void A_ToggleFlameJet(mobj_t* actor)
}
}
//{ SRB2kart - A_ItemPop, A_JawzChase, A_JawzExplode, and A_MineExplode
//{ SRB2kart - A_ItemPop, A_JawzChase, A_JawzExplode, A_MineExplode, and A_BallhogExplode
void A_ItemPop(mobj_t *actor)
{
mobj_t *remains;
@ -8141,7 +8142,7 @@ void A_ItemPop(mobj_t *actor)
remains->flags = actor->flags; // Transfer flags
remains->flags2 = actor->flags2; // Transfer flags2
remains->fuse = actor->fuse; // Transfer respawn timer
remains->threshold = 68;
remains->threshold = (actor->threshold = 69 ? 69 : 68);
remains->skin = NULL;
remains->spawnpoint = actor->spawnpoint;
@ -8155,7 +8156,7 @@ void A_ItemPop(mobj_t *actor)
remains->flags2 &= ~MF2_AMBUSH;
if (G_BattleGametype())
if (G_BattleGametype() && actor->threshold != 69)
numgotboxes++;
P_RemoveMobj(actor);
@ -8361,6 +8362,21 @@ void A_MineExplode(mobj_t *actor)
return;
}
void A_BallhogExplode(mobj_t *actor)
{
mobj_t *mo2;
#ifdef HAVE_BLUA
if (LUA_CallAction("A_BallhogExplode", actor))
return;
#endif
mo2 = P_SpawnMobj(actor->x, actor->y, actor->z, MT_BALLHOGBOOM);
P_SetScale(mo2, actor->scale*2);
mo2->destscale = mo2->scale;
S_StartSound(mo2, actor->info->deathsound);
return;
}
//}
// Function: A_OrbitNights

View file

@ -2068,29 +2068,32 @@ boolean P_CheckRacers(void)
return true;
}
for (j = 0; j < MAXPLAYERS; j++)
if (cv_karteliminatelast.value)
{
if (!playeringame[j] || players[j].spectator)
continue;
numplayersingame++;
}
if (numplayersingame > 1) // if there's more than one player in-game, this is safe to do
{
// check if we just got unlucky and there was only one guy who was a problem
for (j = i+1; j < MAXPLAYERS; j++)
for (j = 0; j < MAXPLAYERS; j++)
{
if (!playeringame[j] || players[j].spectator || players[j].exiting || !players[j].lives)
if (!playeringame[j] || players[j].spectator)
continue;
break;
numplayersingame++;
}
if (j == MAXPLAYERS) // finish anyways, force a time over
if (numplayersingame > 1) // if there's more than one player in-game, this is safe to do
{
P_DoTimeOver(&players[i]);
countdown = countdown2 = 0;
return true;
// check if we just got unlucky and there was only one guy who was a problem
for (j = i+1; j < MAXPLAYERS; j++)
{
if (!playeringame[j] || players[j].spectator || players[j].exiting || !players[j].lives)
continue;
break;
}
if (j == MAXPLAYERS) // finish anyways, force a time over
{
P_DoTimeOver(&players[i]);
countdown = countdown2 = 0;
return true;
}
}
}
@ -2180,6 +2183,9 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source)
if (!target->target->player->kartstuff[k_itemamount])
target->target->player->kartstuff[k_itemheld] = 0;
if (target->target->hnext == target)
P_SetTarget(&target->target->hnext, NULL);
}
}
//
@ -3076,7 +3082,6 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
#else
static const boolean force = false;
#endif
mobj_t *blueexplode;
if (objectplacing)
return false;
@ -3280,12 +3285,13 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
// Self-Propelled Bomb
if (damage == 65)
{
mobj_t *spbexplode;
if (player == source->player)
return false;
// Just need to do this now! Being thrown upwards is done by the explosion.
//P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_BLUELIGHTNING);
blueexplode = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_BLUEEXPLOSION);
P_SetTarget(&blueexplode->target, source);
spbexplode = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_BLUEEXPLOSION);
P_SetTarget(&spbexplode->target, source);
return true;
}
//}
@ -3312,7 +3318,10 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
if (damage == 10000)
P_KillPlayer(player, source, damage);
else if (player->kartstuff[k_invincibilitytimer] > 0 || player->kartstuff[k_growshrinktimer] > 0 || player->powers[pw_flashing])
{
K_DoInstashield(player);
return false;
}
else
{
if (inflictor && (inflictor->type == MT_ORBINAUT || inflictor->type == MT_ORBINAUT_SHIELD
@ -3486,22 +3495,25 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
break;
}
target->reactiontime = 0; // we're awake now...
if (source && source != target)
if (!P_MobjWasRemoved(target))
{
// if not intent on another player,
// chase after this one
P_SetTarget(&target->target, source);
if (target->state == &states[target->info->spawnstate] && target->info->seestate != S_NULL)
target->reactiontime = 0; // we're awake now...
if (source && source != target)
{
if (player)
// if not intent on another player,
// chase after this one
P_SetTarget(&target->target, source);
if (target->state == &states[target->info->spawnstate] && target->info->seestate != S_NULL)
{
if (!(player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds])))
P_SetPlayerMobjState(target, target->info->seestate);
if (player)
{
if (!(player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds])))
P_SetPlayerMobjState(target, target->info->seestate);
}
else
P_SetMobjState(target, target->info->seestate);
}
else
P_SetMobjState(target, target->info->seestate);
}
}

View file

@ -194,9 +194,9 @@ void P_SpawnSpinMobj(player_t *player, mobjtype_t type);
void P_Telekinesis(player_t *player, fixed_t thrust, fixed_t range);
void P_PlayLivesJingle(player_t *player);
#define P_PlayRinglossSound(s) S_StartSound(s, (mariomode) ? sfx_mario8 : sfx_altow1 + P_RandomKey(4));
#define P_PlayDeathSound(s) S_StartSound(s, sfx_altdi1 + P_RandomKey(4));
#define P_PlayVictorySound(s) S_StartSound(s, sfx_victr1 + P_RandomKey(4));
void P_PlayRinglossSound(mobj_t *source);
void P_PlayDeathSound(mobj_t *source);
void P_PlayVictorySound(mobj_t *source);
//

View file

@ -881,7 +881,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
return true;
if (tmthing->type == MT_BALLHOG && thing->type == MT_BALLHOG)
return true; // Fireballs don't collide with eachother
return true; // Ballhogs don't collide with eachother
if (thing->player && thing->player->powers[pw_flashing])
return true;
@ -1633,13 +1633,6 @@ static boolean PIT_CheckThing(mobj_t *thing)
}
else if (thing->player) // bounce when players collide
{
const boolean tvulnerable = (!(thing->player->powers[pw_flashing]
|| thing->player->kartstuff[k_invincibilitytimer]
|| thing->player->kartstuff[k_spinouttimer]));
const boolean tmtvulnerable = (!(tmthing->player->powers[pw_flashing]
|| tmthing->player->kartstuff[k_invincibilitytimer]
|| tmthing->player->kartstuff[k_spinouttimer]));
// see if it went over / under
if (tmthing->z > thing->z + thing->height)
return true; // overhead
@ -1659,7 +1652,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
if (P_IsObjectOnGround(thing) && tmthing->momz < 0)
{
K_KartBouncing(tmthing, thing, true, false);
if (G_BattleGametype() && tmthing->player->kartstuff[k_pogospring] && tvulnerable)
if (G_BattleGametype() && tmthing->player->kartstuff[k_pogospring])
{
K_StealBumper(tmthing->player, thing->player, false);
K_SpinPlayer(thing->player, tmthing, 0, false);
@ -1668,7 +1661,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
else if (P_IsObjectOnGround(tmthing) && thing->momz < 0)
{
K_KartBouncing(thing, tmthing, true, false);
if (G_BattleGametype() && thing->player->kartstuff[k_pogospring] && tmtvulnerable)
if (G_BattleGametype() && thing->player->kartstuff[k_pogospring])
{
K_StealBumper(thing->player, tmthing->player, false);
K_SpinPlayer(tmthing->player, thing, 0, false);
@ -1679,12 +1672,12 @@ static boolean PIT_CheckThing(mobj_t *thing)
if (G_BattleGametype())
{
if (thing->player->kartstuff[k_sneakertimer] && !(tmthing->player->kartstuff[k_sneakertimer]) && tmtvulnerable)
if (thing->player->kartstuff[k_sneakertimer] && !(tmthing->player->kartstuff[k_sneakertimer]))
{
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]) && tvulnerable)
else if (tmthing->player->kartstuff[k_sneakertimer] && !(thing->player->kartstuff[k_sneakertimer]))
{
K_StealBumper(tmthing->player, thing->player, false);
K_SpinPlayer(thing->player, tmthing, 0, false);

View file

@ -1723,14 +1723,22 @@ void P_XYMovement(mobj_t *mo)
if (CheckForBustableBlocks && mo->flags & MF_PUSHABLE)
P_PushableCheckBustables(mo);
//{ SRB2kart - Fireball
//{ SRB2kart - Ballhogs
if (mo->type == MT_BALLHOG)
{
mo->health--;
if (mo->health == 0)
if (mo->health)
{
S_StartSound(mo, mo->info->deathsound);
P_SetMobjState(mo, mo->info->deathstate);
mo->health--;
if (mo->health == 0)
mo->destscale = 1;
}
else
{
if (mo->scale < mapheaderinfo[gamemap-1]->mobj_scale/16)
{
P_RemoveMobj(mo);
return;
}
}
}
//}
@ -2336,6 +2344,7 @@ static boolean P_ZMovement(mobj_t *mo)
case MT_JAWZ:
case MT_JAWZ_DUD:
case MT_BALLHOG:
case MT_SSMINE:
// Remove stuff from death pits.
if (P_CheckDeathPitCollide(mo))
{
@ -6282,6 +6291,11 @@ void P_RunShadows(void)
else
mobj->flags2 &= ~MF2_DONTDRAW;
if (mobj->target->eflags & MFE_VERTICALFLIP)
mobj->eflags |= MFE_VERTICALFLIP;
else
mobj->eflags &= ~MFE_VERTICALFLIP;
if (mobj->target->eflags & MFE_DRAWONLYFORP1) // groooooaann...
mobj->eflags |= MFE_DRAWONLYFORP1;
else
@ -6307,12 +6321,13 @@ void P_RunShadows(void)
P_TeleportMove(mobj, mobj->target->x, mobj->target->y, mobj->target->z);
if (mobj->floorz < mobj->z)
if (((mobj->eflags & MFE_VERTICALFLIP) && (mobj->ceilingz > mobj->z+mobj->height))
|| (!(mobj->eflags & MFE_VERTICALFLIP) && (mobj->floorz < mobj->z)))
{
INT32 i;
fixed_t prevz;
mobj->z = mobj->floorz;
mobj->z = (mobj->eflags & MFE_VERTICALFLIP ? mobj->ceilingz : mobj->floorz);
for (i = 0; i < MAXFFLOORS; i++)
{
@ -6324,7 +6339,7 @@ void P_RunShadows(void)
// Check new position to see if you should still be on that ledge
P_TeleportMove(mobj, mobj->target->x, mobj->target->y, mobj->z);
mobj->z = mobj->floorz;
mobj->z = (mobj->eflags & MFE_VERTICALFLIP ? mobj->ceilingz : mobj->floorz);
if (mobj->z == prevz)
break;
@ -6600,7 +6615,7 @@ void P_MobjThinker(mobj_t *mobj)
{
if (mobj->target && mobj->target->player && mobj->target->player->mo && mobj->target->player->health > 0 && !mobj->target->player->spectator)
{
INT32 HEIGHT;
fixed_t HEIGHT;
fixed_t radius;
fixed_t dsone = K_GetKartDriftSparkValue(mobj->target->player);
@ -6670,15 +6685,15 @@ void P_MobjThinker(mobj_t *mobj)
mobj->angle = ANGLE_180 + mobj->target->player->frameangle;
// If the player is on the ceiling, then flip
if (mobj->target->player && mobj->target->eflags & MFE_VERTICALFLIP)
if (mobj->target->eflags & MFE_VERTICALFLIP)
{
mobj->eflags |= MFE_VERTICALFLIP;
HEIGHT = mobj->target->height;
HEIGHT = (16<<FRACBITS);
}
else
{
mobj->eflags &= ~MFE_VERTICALFLIP;
HEIGHT = mobj->target->height-mobj->target->height;
HEIGHT = 0;
}
// Shrink if the player shrunk too.
@ -6689,7 +6704,7 @@ void P_MobjThinker(mobj_t *mobj)
const angle_t fa = mobj->angle>>ANGLETOFINESHIFT;
mobj->x = mobj->target->x + FixedMul(finecosine[fa],radius);
mobj->y = mobj->target->y + FixedMul(finesine[fa],radius);
mobj->z = mobj->target->z + HEIGHT;
mobj->z = mobj->target->z - HEIGHT;
P_SetThingPosition(mobj);
}
}
@ -7447,12 +7462,23 @@ void P_MobjThinker(mobj_t *mobj)
case MT_BANANA:
case MT_FAKEITEM:
if (mobj->z <= mobj->floorz)
{
P_RemoveMobj(mobj);
return;
}
// fallthru
case MT_ORBINAUT_SHIELD:
case MT_BANANA_SHIELD:
case MT_FAKESHIELD:
mobj->flags2 ^= MF2_DONTDRAW;
break;
case MT_JAWZ:
case MT_JAWZ_DUD:
if (mobj->z <= mobj->floorz)
P_SetMobjState(mobj, mobj->info->xdeathstate);
// fallthru
case MT_JAWZ_SHIELD:
mobj->flags2 ^= MF2_DONTDRAW;
break;
case MT_SSMINE:
case MT_BLUEEXPLOSION:
@ -7462,11 +7488,14 @@ void P_MobjThinker(mobj_t *mobj)
mobj->health = -100;
}
else
{
P_RemoveMobj(mobj);
return;
}
break;
case MT_MINEEXPLOSIONSOUND:
P_RemoveMobj(mobj);
break;
return;
//}
default:
break;
@ -8005,7 +8034,7 @@ void P_MobjThinker(mobj_t *mobj)
if (mobj->threshold > 0)
mobj->threshold--;
if (leveltime % 7 == 0)
if (leveltime % TICRATE == 0)
S_StartSound(mobj, mobj->info->activesound);
if (gamespeed == 0)
@ -8079,7 +8108,7 @@ void P_MobjThinker(mobj_t *mobj)
if (mobj->threshold > 0)
mobj->threshold--;
if (leveltime % 7 == 0)
if (leveltime % TICRATE == 0)
S_StartSound(mobj, mobj->info->activesound);
break;
@ -8191,6 +8220,28 @@ void P_MobjThinker(mobj_t *mobj)
}
P_TeleportMove(mobj, mobj->target->x, mobj->target->y, mobj->target->z);
break;
case MT_INSTASHIELDB:
if (leveltime & 1)
mobj->flags2 |= MF2_DONTDRAW;
else
mobj->flags2 &= ~MF2_DONTDRAW;
/* FALLTHRU */
case MT_INSTASHIELDA:
if (!mobj->target || !mobj->target->health || (mobj->target->player && !mobj->target->player->kartstuff[k_instashield]))
{
P_RemoveMobj(mobj);
return;
}
P_TeleportMove(mobj, mobj->target->x, mobj->target->y, mobj->target->z);
break;
case MT_THUNDERSHIELD:
if (!mobj->target || !mobj->target->health || (mobj->target->player && mobj->target->player->kartstuff[k_curshield] != 1))
{
P_RemoveMobj(mobj);
return;
}
P_TeleportMove(mobj, mobj->target->x, mobj->target->y, mobj->target->z);
break;
case MT_KARMAHITBOX:
if (!mobj->target || !mobj->target->health || !mobj->target->player || mobj->target->player->spectator
|| (G_RaceGametype() || mobj->target->player->kartstuff[k_bumper]))
@ -8521,19 +8572,24 @@ for (i = ((mobj->flags2 & MF2_STRONGBOX) ? strongboxamt : weakboxamt); i; --i) s
return;
case MT_RANDOMITEM:
if (G_BattleGametype())
break;
// Respawn from mapthing if you have one!
if (mobj->spawnpoint)
{
P_SpawnMapThing(mobj->spawnpoint);
newmobj = mobj->spawnpoint->mobj; // this is set to the new mobj in P_SpawnMapThing
if (mobj->threshold != 69)
break;
}
else
newmobj = P_SpawnMobj(mobj->x, mobj->y, mobj->z, mobj->type);
{
// Respawn from mapthing if you have one!
if (mobj->spawnpoint)
{
P_SpawnMapThing(mobj->spawnpoint);
newmobj = mobj->spawnpoint->mobj; // this is set to the new mobj in P_SpawnMapThing
}
else
newmobj = P_SpawnMobj(mobj->x, mobj->y, mobj->z, mobj->type);
// Transfer flags2 (strongbox, objectflip)
newmobj->flags2 = mobj->flags2;
// Transfer flags2 (strongbox, objectflip)
newmobj->flags2 = mobj->flags2;
}
P_RemoveMobj(mobj); // make sure they disappear
return;
case MT_METALSONIC_BATTLE:
@ -8556,6 +8612,8 @@ for (i = ((mobj->flags2 & MF2_STRONGBOX) ? strongboxamt : weakboxamt); i; --i) s
if (P_MobjWasRemoved(mobj))
return;
}
else if (mobj->type == MT_RANDOMITEM && mobj->threshold == 69 && mobj->fuse <= TICRATE)
mobj->flags2 ^= MF2_DONTDRAW;
}
I_Assert(mobj != NULL);

View file

@ -1118,6 +1118,31 @@ void P_PlayLivesJingle(player_t *player)
}
}
void P_PlayRinglossSound(mobj_t *source)
{
sfxenum_t key = P_RandomKey(4);
if (cv_kartvoices.value)
S_StartSound(source, (mariomode) ? sfx_mario8 : sfx_altow1 + key);
else
S_StartSound(source, sfx_slip);
}
void P_PlayDeathSound(mobj_t *source)
{
sfxenum_t key = P_RandomKey(4);
if (cv_kartvoices.value)
S_StartSound(source, sfx_altdi1 + key);
else
S_StartSound(source, sfx_s3k35);
}
void P_PlayVictorySound(mobj_t *source)
{
sfxenum_t key = P_RandomKey(4);
if (cv_kartvoices.value)
S_StartSound(source, sfx_victr1 + key);
}
//
// P_EndingMusic
//
@ -1708,10 +1733,13 @@ void P_DoPlayerExit(player_t *player)
else if (!countdown)
countdown = cv_countdowntime.value*TICRATE + 1; // Use cv_countdowntime
if (K_IsPlayerLosing(player))
S_StartSound(player->mo, sfx_klose);
else
S_StartSound(player->mo, sfx_kwin);
if (cv_kartvoices.value)
{
if (K_IsPlayerLosing(player))
S_StartSound(player->mo, sfx_klose);
else
S_StartSound(player->mo, sfx_kwin);
}
player->exiting = 3*TICRATE;
@ -1719,8 +1747,8 @@ void P_DoPlayerExit(player_t *player)
P_EndingMusic(player);
// SRB2kart 120217
if (!countdown2)
countdown2 = countdown + 8*TICRATE;
//if (!countdown2)
//countdown2 = countdown + 8*TICRATE;
if (P_CheckRacers())
player->exiting = (14*TICRATE)/5 + 1;
@ -4901,7 +4929,7 @@ static void P_3dMovement(player_t *player)
if (newMagnitude > K_GetKartSpeed(player, true)) //topspeed)
{
fixed_t tempmomx, tempmomy;
if (oldMagnitude > K_GetKartSpeed(player, true)) //topspeed)
if (oldMagnitude > K_GetKartSpeed(player, true) && onground) // SRB2Kart: onground check for air speed cap
{
if (newMagnitude > oldMagnitude)
{
@ -6938,7 +6966,7 @@ static void P_MovePlayer(player_t *player)
K_SpawnSparkleTrail(player->mo);
if (player->kartstuff[k_wipeoutslow] > 1 && (leveltime & 1))
K_SpawnWipeoutTrail(player->mo);
K_SpawnWipeoutTrail(player->mo, false);
K_DriftDustHandling(player->mo);
@ -9060,6 +9088,12 @@ void P_DoTimeOver(player_t *player)
player->lives = 0;
P_EndingMusic(player);
#if 0
// sal, when you do the f-zero explosion, this is how you make sure the map doesn't end before it's done ^u^ ~toast
if (!countdown2)
countdown2 = 5*TICRATE;
#endif
}
//

View file

@ -147,9 +147,6 @@ sfxinfo_t S_sfx[NUMSFX] =
{"drown", false, 192, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"fizzle", false, 127, 8, -1, NULL, 0, -1, -1, LUMPERROR},
{"gbeep", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Grenade beep
{"yeeeah", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"noooo1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"noooo2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"ghit" , false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"gloop", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"gspray", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
@ -418,7 +415,7 @@ sfxinfo_t S_sfx[NUMSFX] =
{"s3k42", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3k43", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3k44", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3k45", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Kart Lightning Shield use
{"s3k45", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Kart Thunder Shield use
{"s3k46", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3k47", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"s3k48", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
@ -698,7 +695,7 @@ sfxinfo_t S_sfx[NUMSFX] =
{"cdpcm6", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"cdpcm7", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"cdpcm8", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"cdpcm9", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"cdpcm9", false, 64, 8, -1, NULL, 0, -1, -1, LUMPERROR}, // No damage taken
// Knuckles Chaotix sounds
{"kc2a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
@ -809,6 +806,10 @@ sfxinfo_t S_sfx[NUMSFX] =
{"boing", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"smkinv", false, 140, 8, -1, NULL, 0, -1, -1, LUMPERROR},
{"screec", false, 52, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"yeeeah", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"noooo1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"noooo2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR},
{"hogbom", false, 110, 8, -1, NULL, 0, -1, -1, LUMPERROR},
// SRB2kart - Skin sounds
{"kwin", false, 64, 0, -1, NULL, 0, SKSWIN, -1, LUMPERROR},

View file

@ -219,9 +219,6 @@ typedef enum
sfx_drown,
sfx_fizzle,
sfx_gbeep,
sfx_yeeeah,
sfx_noooo1,
sfx_noooo2,
sfx_ghit,
sfx_gloop,
sfx_gspray,
@ -881,6 +878,10 @@ typedef enum
sfx_boing,
sfx_smkinv,
sfx_screec,
sfx_yeeeah,
sfx_noooo1,
sfx_noooo2,
sfx_hogbom,
sfx_kwin,
sfx_klose,

View file

@ -303,7 +303,7 @@ void VID_BlitLinearScreen(const UINT8 *srcptr, UINT8 *destptr, INT32 width, INT3
#endif
}
//static UINT8 hudplusalpha[11] = { 10, 8, 6, 4, 2, 0, 0, 0, 0, 0, 0};
static UINT8 hudplusalpha[11] = { 10, 8, 6, 4, 2, 0, 0, 0, 0, 0, 0};
static UINT8 hudminusalpha[11] = { 10, 9, 9, 8, 8, 7, 7, 6, 6, 5, 5};
UINT8 hudtrans = 0;
@ -944,6 +944,129 @@ void V_DrawDiag(INT32 x, INT32 y, INT32 wh, INT32 c)
}
}
// THANK YOU MPC!!!
void V_DrawFillConsoleMap(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c)
{
UINT8 *dest;
INT32 u, v;
UINT32 alphalevel = 0;
if (rendermode == render_none)
return;
#ifdef HWRENDER
if (rendermode != render_soft && rendermode != render_none)
{
UINT32 hwcolor;
switch (cons_backcolor.value)
{
case 0: hwcolor = 0xffffff00; break; // White
case 1: hwcolor = 0x80808000; break; // Gray
case 2: hwcolor = 0x40201000; break; // Brown
case 3: hwcolor = 0xff000000; break; // Red
case 4: hwcolor = 0xff800000; break; // Orange
case 5: hwcolor = 0x80800000; break; // Yellow
case 6: hwcolor = 0x00800000; break; // Green
case 7: hwcolor = 0x0000ff00; break; // Blue
case 8: hwcolor = 0x4080ff00; break; // Cyan
// Default green
default: hwcolor = 0x00800000; break;
}
HWR_DrawConsoleFill(x, y, w, h, hwcolor, c); // we still use the regular color stuff but only for flags. actual draw color is "hwcolor" for this.
return;
}
#endif
if (!(c & V_NOSCALESTART))
{
INT32 dupx = vid.dupx, dupy = vid.dupy;
if (x == 0 && y == 0 && w == BASEVIDWIDTH && h == BASEVIDHEIGHT)
{ // Clear the entire screen, from dest to deststop. Yes, this really works.
memset(screens[0], (UINT8)(c&255), vid.width * vid.height * vid.bpp);
return;
}
x *= dupx;
y *= dupy;
w *= dupx;
h *= dupy;
// Center it if necessary
if (vid.width != BASEVIDWIDTH * dupx)
{
// dupx adjustments pretend that screen width is BASEVIDWIDTH * dupx,
// so center this imaginary screen
if (c & V_SNAPTORIGHT)
x += (vid.width - (BASEVIDWIDTH * dupx));
else if (!(c & V_SNAPTOLEFT))
x += (vid.width - (BASEVIDWIDTH * dupx)) / 2;
}
if (vid.height != BASEVIDHEIGHT * dupy)
{
// same thing here
if (c & V_SNAPTOBOTTOM)
y += (vid.height - (BASEVIDHEIGHT * dupy));
else if (!(c & V_SNAPTOTOP))
y += (vid.height - (BASEVIDHEIGHT * dupy)) / 2;
}
}
if (x >= vid.width || y >= vid.height)
return; // off the screen
if (x < 0) {
w += x;
x = 0;
}
if (y < 0) {
h += y;
y = 0;
}
if (w <= 0 || h <= 0)
return; // zero width/height wouldn't draw anything
if (x + w > vid.width)
w = vid.width-x;
if (y + h > vid.height)
h = vid.height-y;
dest = screens[0] + y*vid.width + x;
if ((alphalevel = ((c & V_ALPHAMASK) >> V_ALPHASHIFT)))
{
if (alphalevel == 13)
alphalevel = hudminusalpha[cv_translucenthud.value];
else if (alphalevel == 14)
alphalevel = 10 - cv_translucenthud.value;
else if (alphalevel == 15)
alphalevel = hudplusalpha[cv_translucenthud.value];
if (alphalevel >= 10)
return; // invis
}
c &= 255;
if (!alphalevel) {
for (v = 0; v < h; v++, dest += vid.width) {
for (u = 0; u < w; u++) {
dest[u] = consolebgmap[dest[u]];
}
}
} else { // mpc 12-04-2018
const UINT8 *fadetable = ((UINT8 *)transtables + ((alphalevel-1)<<FF_TRANSSHIFT) + (c*256));
#define clip(x,y) (x>y) ? y : x
w = clip(w,vid.width);
h = clip(h,vid.height);
for (v = 0; v < h; v++, dest += vid.width) {
for (u = 0; u < w; u++) {
dest[u] = fadetable[consolebgmap[dest[u]]];
}
}
}
}
//
// Fills a box of pixels using a flat texture as a pattern, scaled to screen size.
//
@ -1175,6 +1298,32 @@ void V_DrawCharacter(INT32 x, INT32 y, INT32 c, boolean lowercaseallowed)
V_DrawScaledPatch(x, y, flags, hu_font[c]);
}
// Writes a single character for the chat. (draw WHITE if bit 7 set)
// Essentially the same as the above but it's small or big depending on what resolution you've chosen to huge..
//
void V_DrawChatCharacter(INT32 x, INT32 y, INT32 c, boolean lowercaseallowed, UINT8 *colormap)
{
INT32 w, flags;
//const UINT8 *colormap = V_GetStringColormap(c);
flags = c & ~(V_CHARCOLORMASK | V_PARAMMASK);
c &= 0x7f;
if (lowercaseallowed)
c -= HU_FONTSTART;
else
c = toupper(c) - HU_FONTSTART;
if (c < 0 || c >= HU_FONTSIZE || !hu_font[c])
return;
w = (vid.width < 640 ) ? (SHORT(hu_font[c]->width)/2) : (SHORT(hu_font[c]->width)); // use normal sized characters if we're using a terribly low resolution.
if (x + w > vid.width)
return;
V_DrawFixedPatch(x*FRACUNIT, y*FRACUNIT, (vid.width < 640) ? (FRACUNIT) : (FRACUNIT/2), flags, hu_font[c], colormap);
}
// Precompile a wordwrapped string to any given width.
// This is a muuuch better method than V_WORDWRAP.
char *V_WordWrap(INT32 x, INT32 w, INT32 option, const char *string)

View file

@ -142,6 +142,7 @@ void V_DrawScaledPic (INT32 px1, INT32 py1, INT32 scrn, INT32 lumpnum);
// fill a box with a single color
void V_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c);
void V_DrawFillConsoleMap(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c);
// fill a triangle with a single color
void V_DrawDiag(INT32 x, INT32 y, INT32 wh, INT32 c);
// fill a box with a flat as a pattern
@ -154,6 +155,8 @@ void V_DrawFadeConsBack(INT32 plines);
// draw a single character
void V_DrawCharacter(INT32 x, INT32 y, INT32 c, boolean lowercaseallowed);
// draw a single character, but for the chat
void V_DrawChatCharacter(INT32 x, INT32 y, INT32 c, boolean lowercaseallowed, UINT8 *colormap);
const UINT8 *V_GetStringColormap(INT32 colorflags);
void V_DrawLevelTitle(INT32 x, INT32 y, INT32 option, const char *string);

View file

@ -87,7 +87,7 @@ typedef union
INT32 num[MAXPLAYERS]; // Winner's player #
char *name[MAXPLAYERS]; // Winner's name
INT32 numplayers; // Number of players being displayed
char levelstring[62]; // holds levelnames up to 32 characters
char levelstring[64]; // holds levelnames up to 64 characters
// SRB2kart
UINT8 increase[MAXPLAYERS]; //how much did the score increase by?
UINT32 val[MAXPLAYERS]; //Gametype-specific value
@ -143,6 +143,7 @@ typedef struct
UINT8 roffset;
UINT8 rsynctime;
UINT8 rendoff;
boolean loaded;
} y_voteclient;
static y_votelvlinfo levelinfo[5];
@ -204,6 +205,39 @@ static void Y_CalculateMatchData(boolean rankingsmode, void (*comparison)(INT32)
// Initialize variables
if ((data.match.rankingsmode = rankingsmode))
sprintf(data.match.levelstring, "* Total Rankings *");
else
{
// set up the levelstring
if (mapheaderinfo[prevmap]->levelflags & LF_NOZONE)
{
if (mapheaderinfo[prevmap]->actnum[0])
snprintf(data.match.levelstring,
sizeof data.match.levelstring,
"* %s %s *",
mapheaderinfo[prevmap]->lvlttl, mapheaderinfo[prevmap]->actnum);
else
snprintf(data.match.levelstring,
sizeof data.match.levelstring,
"* %s *",
mapheaderinfo[prevmap]->lvlttl);
}
else
{
const char *zonttl = (mapheaderinfo[prevmap]->zonttl[0] ? mapheaderinfo[prevmap]->zonttl : "ZONE");
if (mapheaderinfo[prevmap]->actnum[0])
snprintf(data.match.levelstring,
sizeof data.match.levelstring,
"* %s %s %s *",
mapheaderinfo[prevmap]->lvlttl, zonttl, mapheaderinfo[prevmap]->actnum);
else
snprintf(data.match.levelstring,
sizeof data.match.levelstring,
"* %s %s *",
mapheaderinfo[prevmap]->lvlttl, zonttl);
}
data.match.levelstring[sizeof data.match.levelstring - 1] = '\0';
}
data.match.encore = (!rankingsmode && encoremode);
@ -265,7 +299,6 @@ static void Y_CalculateMatchData(boolean rankingsmode, void (*comparison)(INT32)
//
void Y_IntermissionDrawer(void)
{
boolean forcefreeplay = false;
INT32 i, whiteplayer = MAXPLAYERS, x = 4, hilicol = V_YELLOWMAP; // fallback
if (intertype == int_none || rendermode == render_none)
@ -298,7 +331,7 @@ void Y_IntermissionDrawer(void)
V_DrawPatchFill(bgtile);
if (usebuffer) // Fade everything out
V_DrawFadeScreen(0xFF00, 16);
V_DrawFadeScreen(0xFF00, 20);
if (!splitscreen)
whiteplayer = demoplayback ? displayplayer : consoleplayer;
@ -372,11 +405,7 @@ void Y_IntermissionDrawer(void)
if (data.match.rankingsmode)
timeheader = "RANK";
else
{
timeheader = (intertype == int_race ? "TIME" : "SCORE");
if (data.match.numplayers <= 1)
forcefreeplay = true;
}
// draw the level name
V_DrawCenteredString(-4 + x + BASEVIDWIDTH/2, 20, 0, data.match.levelstring);
@ -497,37 +526,16 @@ void Y_IntermissionDrawer(void)
}
dotimer:
if (netgame) // FREE PLAY?
{
i = MAXPLAYERS;
if (!forcefreeplay)
{
// check to see if there's anyone else at all
for (i = 0; i < MAXPLAYERS; i++)
{
if (i == consoleplayer)
continue;
if (playeringame[i] && !stplyr->spectator)
break;
}
}
if (i == MAXPLAYERS)
K_drawKartFreePlay(intertic);
}
if (timer)
{
INT32 tickdown = (timer+1)/TICRATE;
V_DrawCenteredString(BASEVIDWIDTH/2, 188, hilicol|V_SNAPTOBOTTOM,
va("start in %d second%s", tickdown, (tickdown == 1 ? "" : "s")));
V_DrawCenteredString(BASEVIDWIDTH/2, 188, hilicol,
va("%s starts in %d", cv_advancemap.string, tickdown));
}
// Make it obvious that scrambling is happening next round.
if (cv_scrambleonchange.value && cv_teamscramble.value && (intertic/TICRATE % 2 == 0))
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT/2, hilicol|V_SNAPTOBOTTOM, M_GetText("Teams will be scrambled next round!"));
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT/2, hilicol, M_GetText("Teams will be scrambled next round!"));
}
//
@ -781,38 +789,8 @@ void Y_StartIntermission(void)
break;
}
if (intertype == int_race || intertype == int_match)
//if (intertype == int_race || intertype == int_match)
{
// set up the levelstring
if (strlen(mapheaderinfo[prevmap]->zonttl) > 0)
{
if (strlen(mapheaderinfo[prevmap]->actnum) > 0)
snprintf(data.match.levelstring,
sizeof data.match.levelstring,
"* %.32s %.32s %s *",
mapheaderinfo[prevmap]->lvlttl, mapheaderinfo[prevmap]->zonttl, mapheaderinfo[prevmap]->actnum);
else
snprintf(data.match.levelstring,
sizeof data.match.levelstring,
"* %.32s %.32s *",
mapheaderinfo[prevmap]->lvlttl, mapheaderinfo[prevmap]->zonttl);
}
else
{
if (strlen(mapheaderinfo[prevmap]->actnum) > 0)
snprintf(data.match.levelstring,
sizeof data.match.levelstring,
"* %.32s %s *",
mapheaderinfo[prevmap]->lvlttl, mapheaderinfo[prevmap]->actnum);
else
snprintf(data.match.levelstring,
sizeof data.match.levelstring,
"* %.32s *",
mapheaderinfo[prevmap]->lvlttl);
}
data.match.levelstring[sizeof data.match.levelstring - 1] = '\0';
//bgtile = W_CachePatchName("SRB2BACK", PU_STATIC);
usetile = useinterpic = false;
usebuffer = true;
@ -958,6 +936,9 @@ void Y_VoteDrawer(void)
if (votetic >= voteendtic && voteendtic != -1)
return;
if (!voteclient.loaded)
return;
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
if (widebgpatch && rendermode == render_soft && vid.width / vid.dupx > 320)
@ -1157,8 +1138,8 @@ void Y_VoteDrawer(void)
hilicol = V_SKYMAP;
else //if (gametype == GT_MATCH)
hilicol = V_REDMAP;
V_DrawCenteredString(BASEVIDWIDTH/2, 188, hilicol|V_SNAPTOBOTTOM,
va("Vote ends in %d second%s", tickdown, (tickdown == 1 ? "" : "s")));
V_DrawCenteredString(BASEVIDWIDTH/2, 188, hilicol,
va("Vote ends in %d", tickdown));
}
}
@ -1206,8 +1187,11 @@ void Y_VoteTicker(void)
if (votetic == voteendtic)
{
Y_UnloadVoteData(); // Y_EndVote resets voteendtic too early apparently, causing the game to try to render patches that we just unloaded...
Y_FollowIntermission();
if (voteclient.loaded)
{
Y_EndVote();
Y_FollowIntermission();
}
return;
}
@ -1248,14 +1232,17 @@ void Y_VoteTicker(void)
if (numvotes < 1) // Whoops! Get outta here.
{
Y_UnloadVoteData();
Y_FollowIntermission();
if (voteclient.loaded)
{
Y_EndVote();
Y_FollowIntermission();
}
return;
}
voteclient.rtics--;
if (voteclient.rtics <= 0)
if (voteclient.rtics <= 0 && voteclient.loaded)
{
voteclient.roffset++;
voteclient.rtics = min(20, (3*voteclient.roffset/4)+5);
@ -1276,7 +1263,7 @@ void Y_VoteTicker(void)
if (tempvotes[((pickedvote + voteclient.roffset + i) % numvotes)] == pickedvote)
{
voteclient.rendoff = voteclient.roffset+i;
if (M_RandomChance(FRACUNIT/1024)) // Let it cheat occasionally~
if (M_RandomChance(FRACUNIT/32)) // Let it cheat occasionally~
voteclient.rendoff++;
S_ChangeMusicInternal("voteeb", false);
break;
@ -1480,6 +1467,8 @@ void Y_StartVote(void)
else
levelinfo[i].pic = W_CachePatchName("BLANKLVL", PU_STATIC);
}
voteclient.loaded = true;
}
//
@ -1499,6 +1488,8 @@ static void Y_UnloadVoteData(void)
if (rendermode != render_soft)
return;
voteclient.loaded = false;
UNLOAD(widebgpatch);
UNLOAD(bgpatch);
UNLOAD(cursor);
@ -1522,9 +1513,11 @@ void Y_SetupVoteFinish(SINT8 pick, SINT8 level)
{
if (pick == -1) // No other votes? We gotta get out of here, then!
{
timer = 0;
Y_UnloadVoteData();
Y_FollowIntermission();
if (voteclient.loaded)
{
Y_EndVote();
Y_FollowIntermission();
}
return;
}
@ -1570,9 +1563,11 @@ void Y_SetupVoteFinish(SINT8 pick, SINT8 level)
}
else if (endtype == 0) // Might as well put this here, too.
{
timer = 0;
Y_UnloadVoteData();
Y_FollowIntermission();
if (voteclient.loaded)
{
Y_EndVote();
Y_FollowIntermission();
}
return;
}
else