Lua stuff is done

This commit is contained in:
Sally Coolatta 2020-08-15 07:47:18 -04:00
parent 19016db338
commit 0dc21106e5
31 changed files with 360 additions and 1345 deletions

View file

@ -52,6 +52,7 @@
#include "k_pwrlv.h" #include "k_pwrlv.h"
#include "k_bot.h" #include "k_bot.h"
#include "k_grandprix.h" #include "k_grandprix.h"
#include "doomstat.h"
#ifndef NONET #ifndef NONET
// cl loading screen // cl loading screen

View file

@ -70,6 +70,7 @@
// SRB2Kart // SRB2Kart
#include "k_grandprix.h" #include "k_grandprix.h"
#include "doomstat.h"
#ifdef CMAKECONFIG #ifdef CMAKECONFIG
#include "config.h" #include "config.h"
@ -336,16 +337,10 @@ static void D_Display(void)
if (rendermode != render_none) if (rendermode != render_none)
{ {
// Fade to black first // Fade to black first
if ((wipegamestate == (gamestate_t)FORCEWIPE || if (!(gamestate == GS_LEVEL || (gamestate == GS_TITLESCREEN && titlemapinaction)) // fades to black on its own timing, always
(wipegamestate != (gamestate_t)FORCEWIPEOFF
&& !(gamestate == GS_LEVEL || (gamestate == GS_TITLESCREEN && titlemapinaction)))
) // fades to black on its own timing, always
&& wipetypepre != UINT8_MAX) && wipetypepre != UINT8_MAX)
{ {
F_WipeStartScreen(); F_WipeStartScreen();
// Check for Mega Genesis fade
wipestyleflags = WSF_FADEOUT;
if (wipegamestate == (gamestate_t)FORCEWIPE)
F_WipeColorFill(31); F_WipeColorFill(31);
F_WipeEndScreen(); F_WipeEndScreen();
F_RunWipe(wipetypepre, gamestate != GS_TIMEATTACK, "FADEMAP0", false, false); F_RunWipe(wipetypepre, gamestate != GS_TIMEATTACK, "FADEMAP0", false, false);
@ -460,9 +455,6 @@ static void D_Display(void)
} }
// STUPID race condition... // STUPID race condition...
if (wipegamestate == GS_INTRO && gamestate == GS_TITLESCREEN)
wipegamestate = FORCEWIPEOFF;
else
{ {
wipegamestate = gamestate; wipegamestate = gamestate;

View file

@ -56,6 +56,7 @@
#include "k_color.h" #include "k_color.h"
#include "k_respawn.h" #include "k_respawn.h"
#include "k_grandprix.h" #include "k_grandprix.h"
#include "doomstat.h"
#ifdef NETGAME_DEVMODE #ifdef NETGAME_DEVMODE
#define CV_RESTRICT CV_NETVAR #define CV_RESTRICT CV_NETVAR
@ -310,7 +311,7 @@ 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_usemouse = {"use_mouse", "Off", CV_SAVE|CV_CALL,usemouse_cons_t, I_StartupMouse, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_usejoystick[MAXSPLITSCREENPLAYERS] = { consvar_t cv_usejoystick[MAXSPLITSCREENPLAYERS] = {
{"use_gamepad", "1", CV_SAVE|CV_CALL, usejoystick_cons_t, I_InitJoystick, 0, NULL, NULL, 0, 0, NULL}, {"use_gamepad", "1", CV_SAVE|CV_CALL, usejoystick_cons_t, I_InitJoystick1, 0, NULL, NULL, 0, 0, NULL},
{"use_gamepad2", "2", CV_SAVE|CV_CALL, usejoystick_cons_t, I_InitJoystick2, 0, NULL, NULL, 0, 0, NULL}, {"use_gamepad2", "2", CV_SAVE|CV_CALL, usejoystick_cons_t, I_InitJoystick2, 0, NULL, NULL, 0, 0, NULL},
{"use_joystick3", "3", CV_SAVE|CV_CALL, usejoystick_cons_t, I_InitJoystick3, 0, NULL, NULL, 0, 0, NULL}, {"use_joystick3", "3", CV_SAVE|CV_CALL, usejoystick_cons_t, I_InitJoystick3, 0, NULL, NULL, 0, 0, NULL},
{"use_joystick4", "4", CV_SAVE|CV_CALL, usejoystick_cons_t, I_InitJoystick4, 0, NULL, NULL, 0, 0, NULL} {"use_joystick4", "4", CV_SAVE|CV_CALL, usejoystick_cons_t, I_InitJoystick4, 0, NULL, NULL, 0, 0, NULL}
@ -4865,7 +4866,7 @@ static void Command_Archivetest_f(void)
// test archive // test archive
CONS_Printf("LUA_Archive...\n"); CONS_Printf("LUA_Archive...\n");
LUA_Archive(); LUA_Archive(save_p);
WRITEUINT8(save_p, 0x7F); WRITEUINT8(save_p, 0x7F);
wrote = (UINT32)(save_p-buf); wrote = (UINT32)(save_p-buf);
@ -4876,7 +4877,7 @@ static void Command_Archivetest_f(void)
// test unarchive // test unarchive
save_p = buf; save_p = buf;
CONS_Printf("LUA_UnArchive...\n"); CONS_Printf("LUA_UnArchive...\n");
LUA_UnArchive(); LUA_UnArchive(save_p);
i = READUINT8(save_p); i = READUINT8(save_p);
if (i != 0x7F || wrote != (UINT32)(save_p-buf)) if (i != 0x7F || wrote != (UINT32)(save_p-buf))
CONS_Printf("Savegame corrupted. (write %u, read %u)\n", wrote, (UINT32)(save_p-buf)); CONS_Printf("Savegame corrupted. (write %u, read %u)\n", wrote, (UINT32)(save_p-buf));

View file

@ -21,7 +21,6 @@
#include "w_wad.h" #include "w_wad.h"
#include "m_menu.h" #include "m_menu.h"
#include "m_misc.h" #include "m_misc.h"
#include "filesrch.h" // for refreshdirmenu
#include "f_finale.h" #include "f_finale.h"
#include "y_inter.h" #include "y_inter.h"
#include "dehacked.h" #include "dehacked.h"
@ -38,7 +37,6 @@
#include "lua_script.h" #include "lua_script.h"
#include "lua_hook.h" #include "lua_hook.h"
#include "d_clisrv.h" #include "d_clisrv.h"
#include "r_things.h" // for followers
#include "m_cond.h" #include "m_cond.h"
@ -48,6 +46,10 @@
#include "hardware/hw_light.h" #include "hardware/hw_light.h"
#endif #endif
// SRB2Kart
#include "filesrch.h" // for refreshdirmenu
#include "r_skins.h" // for followers
// Free slot names // Free slot names
// The crazy word-reading stuff uses these. // The crazy word-reading stuff uses these.
static char *FREE_STATES[NUMSTATEFREESLOTS]; static char *FREE_STATES[NUMSTATEFREESLOTS];
@ -3137,7 +3139,6 @@ static actionpointer_t actionpointers[] =
{{A_Scream}, "A_SCREAM"}, {{A_Scream}, "A_SCREAM"},
{{A_BossDeath}, "A_BOSSDEATH"}, {{A_BossDeath}, "A_BOSSDEATH"},
{{A_CustomPower}, "A_CUSTOMPOWER"}, {{A_CustomPower}, "A_CUSTOMPOWER"},
{{A_GiveWeapon}, "A_GIVEWEAPON"},
{{A_RingBox}, "A_RINGBOX"}, {{A_RingBox}, "A_RINGBOX"},
{{A_Invincibility}, "A_INVINCIBILITY"}, {{A_Invincibility}, "A_INVINCIBILITY"},
{{A_SuperSneakers}, "A_SUPERSNEAKERS"}, {{A_SuperSneakers}, "A_SUPERSNEAKERS"},
@ -3147,7 +3148,6 @@ static actionpointer_t actionpointers[] =
{{A_BubbleRise}, "A_BUBBLERISE"}, {{A_BubbleRise}, "A_BUBBLERISE"},
{{A_BubbleCheck}, "A_BUBBLECHECK"}, {{A_BubbleCheck}, "A_BUBBLECHECK"},
{{A_AwardScore}, "A_AWARDSCORE"}, {{A_AwardScore}, "A_AWARDSCORE"},
{{A_ExtraLife}, "A_EXTRALIFE"},
{{A_GiveShield}, "A_GIVESHIELD"}, {{A_GiveShield}, "A_GIVESHIELD"},
{{A_GravityBox}, "A_GRAVITYBOX"}, {{A_GravityBox}, "A_GRAVITYBOX"},
{{A_ScoreRise}, "A_SCORERISE"}, {{A_ScoreRise}, "A_SCORERISE"},
@ -3179,7 +3179,6 @@ static actionpointer_t actionpointers[] =
{{A_RingExplode}, "A_RINGEXPLODE"}, {{A_RingExplode}, "A_RINGEXPLODE"},
{{A_OldRingExplode}, "A_OLDRINGEXPLODE"}, {{A_OldRingExplode}, "A_OLDRINGEXPLODE"},
{{A_MixUp}, "A_MIXUP"}, {{A_MixUp}, "A_MIXUP"},
{{A_RecyclePowers}, "A_RECYCLEPOWERS"},
{{A_Boss1Chase}, "A_BOSS1CHASE"}, {{A_Boss1Chase}, "A_BOSS1CHASE"},
{{A_FocusTarget}, "A_FOCUSTARGET"}, {{A_FocusTarget}, "A_FOCUSTARGET"},
{{A_Boss2Chase}, "A_BOSS2CHASE"}, {{A_Boss2Chase}, "A_BOSS2CHASE"},

View file

@ -382,9 +382,8 @@ void F_IntroDrawer(void)
{ {
if (rendermode != render_none) if (rendermode != render_none)
{ {
wipestyleflags = WSF_FADEOUT;
F_WipeStartScreen(); F_WipeStartScreen();
F_TryColormapFade(31); F_WipeColorFill(31);
F_WipeEndScreen(); F_WipeEndScreen();
F_RunWipe(99, true, "FADEMAP0", false, false); F_RunWipe(99, true, "FADEMAP0", false, false);
} }
@ -430,7 +429,6 @@ void F_IntroDrawer(void)
F_WipeStartScreen(); F_WipeStartScreen();
wipegamestate = -1; wipegamestate = -1;
wipestyleflags = WSF_CROSSFADE;
animtimer = stoptimer = 0; animtimer = stoptimer = 0;
} }

View file

@ -140,43 +140,10 @@ void F_MenuPresTicker(boolean run);
// //
// WIPE // WIPE
// //
// HACK for menu fading while titlemapinaction; skips the level check
#define FORCEWIPE -3
#define FORCEWIPEOFF -2
extern boolean WipeInAction; extern boolean WipeInAction;
extern boolean WipeStageTitle; extern boolean WipeStageTitle;
typedef enum
{
WIPESTYLE_NORMAL,
WIPESTYLE_COLORMAP
} wipestyle_t;
extern wipestyle_t wipestyle;
typedef enum
{
WSF_FADEOUT = 1,
WSF_FADEIN = 1<<1,
WSF_TOWHITE = 1<<2,
WSF_CROSSFADE = 1<<3,
} wipestyleflags_t;
extern wipestyleflags_t wipestyleflags;
// Even my function names are borderline
boolean F_ShouldColormapFade(void);
boolean F_TryColormapFade(UINT8 wipecolor);
#ifndef NOWIPE
void F_DecideWipeStyle(void);
#endif
#define FADECOLORMAPDIV 8
#define FADECOLORMAPROWS (256/FADECOLORMAPDIV)
#define FADEREDFACTOR 15
#define FADEGREENFACTOR 15
#define FADEBLUEFACTOR 10
extern INT32 lastwipetic; extern INT32 lastwipetic;
// Don't know where else to place this constant // Don't know where else to place this constant

View file

@ -31,6 +31,9 @@
#include "m_misc.h" // movie mode #include "m_misc.h" // movie mode
#include "d_clisrv.h" // So the network state can be updated during the wipe #include "d_clisrv.h" // So the network state can be updated during the wipe
#include "g_game.h"
#include "st_stuff.h"
#ifdef HWRENDER #ifdef HWRENDER
#include "hardware/hw_main.h" #include "hardware/hw_main.h"
#endif #endif
@ -82,6 +85,7 @@ UINT8 wipedefs[NUMWIPEDEFS] = {
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
boolean WipeInAction = false; boolean WipeInAction = false;
boolean WipeStageTitle = false;
INT32 lastwipetic = 0; INT32 lastwipetic = 0;
#ifndef NOWIPE #ifndef NOWIPE
@ -401,6 +405,18 @@ static void F_DoEncoreWiggle(UINT8 time)
} }
} }
/** Draw the stage title.
*/
void F_WipeStageTitle(void)
{
// draw level title
if ((WipeStageTitle) && G_IsTitleCardAvailable())
{
ST_runTitleCard();
ST_drawWipeTitleCard();
}
}
/** After setting up the screens you want to wipe, /** After setting up the screens you want to wipe,
* calling this will do a 'typical' wipe. * calling this will do a 'typical' wipe.
*/ */
@ -505,3 +521,52 @@ void F_RunWipe(UINT8 wipetype, boolean drawMenu, const char *colormap, boolean r
} }
#endif #endif
} }
/** Returns tic length of wipe
* One lump equals one tic
*/
tic_t F_GetWipeLength(UINT8 wipetype)
{
#ifdef NOWIPE
(void)wipetype;
return 0;
#else
static char lumpname[10] = "FADEmmss";
lumpnum_t lumpnum;
UINT8 wipeframe;
if (wipetype > 99)
return 0;
for (wipeframe = 0; wipeframe < 100; wipeframe++)
{
sprintf(&lumpname[4], "%.2hu%.2hu", (UINT16)wipetype, (UINT16)wipeframe);
lumpnum = W_CheckNumForName(lumpname);
if (lumpnum == LUMPERROR)
return --wipeframe;
}
return --wipeframe;
#endif
}
/** Does the specified wipe exist?
*/
boolean F_WipeExists(UINT8 wipetype)
{
#ifdef NOWIPE
(void)wipetype;
return false;
#else
static char lumpname[10] = "FADEmm00";
lumpnum_t lumpnum;
if (wipetype > 99)
return false;
sprintf(&lumpname[4], "%.2hu00", (UINT16)wipetype);
lumpnum = W_CheckNumForName(lumpname);
return !(lumpnum == LUMPERROR);
#endif
}

View file

@ -2040,7 +2040,7 @@ void G_BeginRecording(void)
WRITEUINT8(demo_p, 0xFF); // Denote the end of the player listing WRITEUINT8(demo_p, 0xFF); // Denote the end of the player listing
// player lua vars, always saved even if empty // player lua vars, always saved even if empty
LUA_ArchiveDemo(); LUA_Archive(demo_p);
WRITEUINT32(demo_p,P_GetInitSeed()); WRITEUINT32(demo_p,P_GetInitSeed());
@ -3006,7 +3006,7 @@ void G_DoPlayDemo(char *defdemoname)
LUA_ClearState(); LUA_ClearState();
// No modeattacking check, DF_LUAVARS won't be present here. // No modeattacking check, DF_LUAVARS won't be present here.
LUA_UnArchiveDemo(); LUA_UnArchive(demo_p);
} }
splitscreen = 0; splitscreen = 0;

View file

@ -56,7 +56,7 @@
#include "k_color.h" #include "k_color.h"
#include "k_respawn.h" #include "k_respawn.h"
#include "k_grandprix.h" #include "k_grandprix.h"
#include "doomstat.h"
gameaction_t gameaction; gameaction_t gameaction;
gamestate_t gamestate = GS_NULL; gamestate_t gamestate = GS_NULL;
@ -1334,8 +1334,6 @@ void G_PreLevelTitleCard(void)
if (takescreenshot) // Only take screenshots after drawing. if (takescreenshot) // Only take screenshots after drawing.
M_DoScreenShot(); M_DoScreenShot();
} }
if (!cv_showhud.value)
wipestyleflags = WSF_CROSSFADE;
#endif #endif
} }

View file

@ -13,6 +13,7 @@
#include "g_game.h" #include "g_game.h"
#include "p_local.h" #include "p_local.h"
#include "r_local.h" #include "r_local.h"
#include "doomstat.h"
INT32 splitscreen_original_party_size[MAXPLAYERS]; INT32 splitscreen_original_party_size[MAXPLAYERS];
INT32 splitscreen_original_party[MAXPLAYERS][MAXSPLITSCREENPLAYERS]; INT32 splitscreen_original_party[MAXPLAYERS][MAXSPLITSCREENPLAYERS];

View file

@ -214,7 +214,7 @@ void HWR_DrawStretchyFixedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t
} }
} }
if (pscale != FRACUNIT || (splitscreen && option & V_SPLITSCREEN)) if (pscale != FRACUNIT || (r_splitscreen && option & V_SPLITSCREEN))
{ {
fwidth = (float)SHORT(gpatch->width) * fscalew * dupx; fwidth = (float)SHORT(gpatch->width) * fscalew * dupx;
fheight = (float)SHORT(gpatch->height) * fscaleh * dupy; fheight = (float)SHORT(gpatch->height) * fscaleh * dupy;

View file

@ -5441,7 +5441,7 @@ static void HWR_DrawSkyBackground(player_t *player)
dometransform.rollangle = FIXED_TO_FLOAT(rol); dometransform.rollangle = FIXED_TO_FLOAT(rol);
dometransform.roll = true; dometransform.roll = true;
} }
dometransform.splitscreen = splitscreen; dometransform.splitscreen = r_splitscreen;
HWR_GetTexture(texturetranslation[skytexture]); HWR_GetTexture(texturetranslation[skytexture]);
@ -5673,7 +5673,7 @@ void HWR_RenderSkyboxView(INT32 viewnumber, player_t *player)
gl_centery = gl_basecentery; gl_centery = gl_basecentery;
gl_viewwindowy = gl_baseviewwindowy; gl_viewwindowy = gl_baseviewwindowy;
gl_windowcentery = gl_basewindowcentery; gl_windowcentery = gl_basewindowcentery;
if (splitscreen && viewnumber == 1) if (r_splitscreen && viewnumber == 1)
{ {
gl_viewwindowy += (vid.height/2); gl_viewwindowy += (vid.height/2);
gl_windowcentery += (vid.height/2); gl_windowcentery += (vid.height/2);
@ -5729,7 +5729,7 @@ void HWR_RenderSkyboxView(INT32 viewnumber, player_t *player)
HWR_DrawSkyBackground(player); HWR_DrawSkyBackground(player);
//Hurdler: it doesn't work in splitscreen mode //Hurdler: it doesn't work in splitscreen mode
drawsky = splitscreen; drawsky = r_splitscreen;
HWR_ClearSprites(); HWR_ClearSprites();
@ -5934,7 +5934,7 @@ void HWR_RenderPlayerView(INT32 viewnumber, player_t *player)
atransform.rollangle = FIXED_TO_FLOAT(rol); atransform.rollangle = FIXED_TO_FLOAT(rol);
atransform.roll = true; atransform.roll = true;
} }
atransform.splitscreen = splitscreen; atransform.splitscreen = r_splitscreen;
gl_fovlud = (float)(1.0l/tan((double)(fpov*M_PIl/360l))); gl_fovlud = (float)(1.0l/tan((double)(fpov*M_PIl/360l)));
@ -5945,7 +5945,7 @@ void HWR_RenderPlayerView(INT32 viewnumber, player_t *player)
HWR_DrawSkyBackground(player); HWR_DrawSkyBackground(player);
//Hurdler: it doesn't work in splitscreen mode //Hurdler: it doesn't work in splitscreen mode
drawsky = splitscreen; drawsky = r_splitscreen;
HWR_ClearSprites(); HWR_ClearSprites();

View file

@ -51,6 +51,7 @@
#include "lua_hud.h" #include "lua_hud.h"
#include "lua_hook.h" #include "lua_hook.h"
// SRB2Kart
#include "s_sound.h" // song credits #include "s_sound.h" // song credits
#include "k_kart.h" #include "k_kart.h"
#include "k_color.h" #include "k_color.h"

View file

@ -1859,7 +1859,7 @@ state_t states[NUMSTATES] =
{SPR_TVIV, 2, 18, {A_Invincibility}, 0, 0, S_NULL}, // S_INVULN_ICON2 {SPR_TVIV, 2, 18, {A_Invincibility}, 0, 0, S_NULL}, // S_INVULN_ICON2
{SPR_TV1U, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_1UP_ICON2}, // S_1UP_ICON1 {SPR_TV1U, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_1UP_ICON2}, // S_1UP_ICON1
{SPR_TV1U, 2, 18, {A_ExtraLife}, 0, 0, S_NULL}, // S_1UP_ICON2 {SPR_TV1U, 2, 18, {NULL}, 0, 0, S_NULL}, // S_1UP_ICON2
{SPR_TVEG, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_EGGMAN_ICON2}, // S_EGGMAN_ICON1 {SPR_TVEG, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_EGGMAN_ICON2}, // S_EGGMAN_ICON1
{SPR_TVEG, 2, 18, {A_EggmanBox}, 0, 0, S_NULL}, // S_EGGMAN_ICON2 {SPR_TVEG, 2, 18, {A_EggmanBox}, 0, 0, S_NULL}, // S_EGGMAN_ICON2
@ -1871,7 +1871,7 @@ state_t states[NUMSTATES] =
{SPR_TVGV, 2, 18, {A_GravityBox}, 0, 0, S_NULL}, // S_GRAVITY_ICON2 {SPR_TVGV, 2, 18, {A_GravityBox}, 0, 0, S_NULL}, // S_GRAVITY_ICON2
{SPR_TVRC, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_RECYCLER_ICON2}, // S_RECYCLER_ICON1 {SPR_TVRC, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_RECYCLER_ICON2}, // S_RECYCLER_ICON1
{SPR_TVRC, 2, 18, {A_RecyclePowers}, 0, 0, S_NULL}, // S_RECYCLER_ICON2 {SPR_TVRC, 2, 18, {NULL}, 0, 0, S_NULL}, // S_RECYCLER_ICON2
{SPR_TV1K, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_SCORE1K_ICON2}, // S_SCORE1K_ICON1 {SPR_TV1K, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_SCORE1K_ICON2}, // S_SCORE1K_ICON1
{SPR_TV1K, 2, 18, {A_AwardScore}, 0, 0, S_NULL}, // S_SCORE1K_ICON2 {SPR_TV1K, 2, 18, {A_AwardScore}, 0, 0, S_NULL}, // S_SCORE1K_ICON2

View file

@ -39,7 +39,6 @@ void A_FaceTracer();
void A_Scream(); void A_Scream();
void A_BossDeath(); void A_BossDeath();
void A_CustomPower(); // Use this for a custom power void A_CustomPower(); // Use this for a custom power
void A_GiveWeapon(); // Gives the player weapon(s)
void A_RingBox(); // Obtained Ring Box Tails void A_RingBox(); // Obtained Ring Box Tails
void A_Invincibility(); // Obtained Invincibility Box void A_Invincibility(); // Obtained Invincibility Box
void A_SuperSneakers(); // Obtained Super Sneakers Box void A_SuperSneakers(); // Obtained Super Sneakers Box
@ -49,7 +48,6 @@ void A_FanBubbleSpawn();
void A_BubbleRise(); // Bubbles float to surface void A_BubbleRise(); // Bubbles float to surface
void A_BubbleCheck(); // Don't draw if not underwater void A_BubbleCheck(); // Don't draw if not underwater
void A_AwardScore(); void A_AwardScore();
void A_ExtraLife(); // Extra Life
void A_GiveShield(); // Obtained Shield void A_GiveShield(); // Obtained Shield
void A_GravityBox(); void A_GravityBox();
void A_ScoreRise(); // Rise the score logo void A_ScoreRise(); // Rise the score logo
@ -82,7 +80,6 @@ void A_SmokeTrailer();
void A_RingExplode(); void A_RingExplode();
void A_OldRingExplode(); void A_OldRingExplode();
void A_MixUp(); void A_MixUp();
void A_RecyclePowers();
void A_BossScream(); void A_BossScream();
void A_Boss2TakeDamage(); void A_Boss2TakeDamage();
void A_GoopSplat(); void A_GoopSplat();

View file

@ -33,6 +33,9 @@
#include "d_netcmd.h" // IsPlayerAdmin #include "d_netcmd.h" // IsPlayerAdmin
#include "m_menu.h" // Player Setup menu color stuff #include "m_menu.h" // Player Setup menu color stuff
// SRB2Kart
#include "p_spec.h" // P_StartQuake
#include "lua_script.h" #include "lua_script.h"
#include "lua_libs.h" #include "lua_libs.h"
#include "lua_hud.h" // hud_running errors #include "lua_hud.h" // hud_running errors
@ -1265,19 +1268,6 @@ static int lib_pGivePlayerLives(lua_State *L)
return 0; return 0;
} }
static int lib_pGiveCoopLives(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
INT32 numlives = (INT32)luaL_checkinteger(L, 2);
boolean sound = (boolean)lua_opttrueboolean(L, 3);
NOHUD
INLEVEL
if (!player)
return LUA_ErrInvalid(L, "player_t");
P_GiveCoopLives(player, numlives, sound);
return 0;
}
static int lib_pResetScore(lua_State *L) static int lib_pResetScore(lua_State *L)
{ {
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
@ -1289,39 +1279,6 @@ static int lib_pResetScore(lua_State *L)
return 0; return 0;
} }
static int lib_pDoJumpShield(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
NOHUD
INLEVEL
if (!player)
return LUA_ErrInvalid(L, "player_t");
P_DoJumpShield(player);
return 0;
}
static int lib_pDoBubbleBounce(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
NOHUD
INLEVEL
if (!player)
return LUA_ErrInvalid(L, "player_t");
P_DoBubbleBounce(player);
return 0;
}
static int lib_pBlackOw(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
NOHUD
INLEVEL
if (!player)
return LUA_ErrInvalid(L, "player_t");
P_BlackOw(player);
return 0;
}
static int lib_pElementalFire(lua_State *L) static int lib_pElementalFire(lua_State *L)
{ {
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
@ -1358,17 +1315,6 @@ static int lib_pMovePlayer(lua_State *L)
return 0; return 0;
} }
static int lib_pDoPlayerFinish(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
NOHUD
INLEVEL
if (!player)
return LUA_ErrInvalid(L, "player_t");
P_DoPlayerFinish(player);
return 0;
}
static int lib_pDoPlayerExit(lua_State *L) static int lib_pDoPlayerExit(lua_State *L)
{ {
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
@ -1445,19 +1391,6 @@ static int lib_pNukeEnemies(lua_State *L)
return 0; return 0;
} }
static int lib_pEarthquake(lua_State *L)
{
mobj_t *inflictor = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
mobj_t *source = *((mobj_t **)luaL_checkudata(L, 2, META_MOBJ));
fixed_t radius = luaL_checkfixed(L, 3);
NOHUD
INLEVEL
if (!inflictor || !source)
return LUA_ErrInvalid(L, "mobj_t");
P_Earthquake(inflictor, source, radius);
return 0;
}
static int lib_pSwitchShield(lua_State *L) static int lib_pSwitchShield(lua_State *L)
{ {
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
@ -1690,18 +1623,6 @@ static int lib_pPlayerRingBurst(lua_State *L)
return 0; return 0;
} }
static int lib_pPlayerFlagBurst(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
boolean toss = lua_optboolean(L, 2);
NOHUD
INLEVEL
if (!player)
return LUA_ErrInvalid(L, "player_t");
P_PlayerFlagBurst(player, toss);
return 0;
}
static int lib_pPlayRinglossSound(lua_State *L) static int lib_pPlayRinglossSound(lua_State *L)
{ {
mobj_t *source = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ)); mobj_t *source = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
@ -1786,28 +1707,6 @@ static int lib_pCanPickupItem(lua_State *L)
return 1; return 1;
} }
static int lib_pDoNightsScore(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
NOHUD
INLEVEL
if (!player)
return LUA_ErrInvalid(L, "player_t");
P_DoNightsScore(player);
return 0;
}
static int lib_pDoMatchSuper(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
NOHUD
INLEVEL
if (!player)
return LUA_ErrInvalid(L, "player_t");
P_DoMatchSuper(player);
return 0;
}
// P_SPEC // P_SPEC
//////////// ////////////
@ -1840,18 +1739,6 @@ static int lib_pSetMobjStateNF(lua_State *L)
return 1; return 1;
} }
static int lib_pDoSuperTransformation(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
boolean giverings = lua_optboolean(L, 2);
NOHUD
INLEVEL
if (!player)
return LUA_ErrInvalid(L, "player_t");
P_DoSuperTransformation(player, giverings);
return 0;
}
static int lib_pExplodeMissile(lua_State *L) static int lib_pExplodeMissile(lua_State *L)
{ {
mobj_t *mo = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ)); mobj_t *mo = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
@ -1871,9 +1758,9 @@ static int lib_pMobjTouchingSectorSpecial(lua_State *L)
boolean touchground = lua_optboolean(L, 4); boolean touchground = lua_optboolean(L, 4);
//HUDSAFE //HUDSAFE
INLEVEL INLEVEL
if (!player) if (!mo)
return LUA_ErrInvalid(L, "player_t"); return LUA_ErrInvalid(L, "mobj_t");
LUA_PushUserdata(L, P_PlayerTouchingSectorSpecial(player, section, number), META_SECTOR); LUA_PushUserdata(L, P_MobjTouchingSectorSpecial(mo, section, number, touchground), META_SECTOR);
return 1; return 1;
} }
@ -2678,35 +2565,6 @@ static int lib_sMusicName(lua_State *L)
return 1; return 1;
} }
static int lib_sMusicInfo(lua_State *L)
{
player_t *player = NULL;
NOHUD
if (!lua_isnone(L, 1) && lua_isuserdata(L, 1))
{
player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
if (!player)
return LUA_ErrInvalid(L, "player_t");
}
if (!player || P_IsLocalPlayer(player))
{
char mname[7];
UINT16 mflags;
boolean looping;
if (S_MusicInfo(mname, &mflags, &looping))
{
lua_pushstring(L, mname);
lua_pushinteger(L, mflags);
lua_pushboolean(L, looping);
}
else
lua_pushboolean(L, false);
}
else
lua_pushnil(L);
return 1;
}
static int lib_sMusicExists(lua_State *L) static int lib_sMusicExists(lua_State *L)
{ {
boolean checkMIDI = lua_opttrueboolean(L, 2); boolean checkMIDI = lua_opttrueboolean(L, 2);
@ -2761,6 +2619,12 @@ static int lib_sSetMusicLoopPoint(lua_State *L)
return 1; return 1;
} }
static int lib_sGetMusicLoopPoint(lua_State *L)
{
lua_pushinteger(L, S_GetMusicLoopPoint());
return 1;
}
static int lib_sGetMusicLength(lua_State *L) static int lib_sGetMusicLength(lua_State *L)
{ {
lua_pushinteger(L, S_GetMusicLength()); lua_pushinteger(L, S_GetMusicLength());
@ -3536,14 +3400,6 @@ static int lib_kLossSound(lua_State *L)
// Note: Pain, Death and Victory are already exposed. // Note: Pain, Death and Victory are already exposed.
static int lib_kGetKartColorByName(lua_State *L)
{
const char *name = luaL_checkstring(L, 1);
//HUDSAFE
lua_pushinteger(L, K_GetKartColorByName(name));
return 1;
}
static int lib_kIsPlayerLosing(lua_State *L) static int lib_kIsPlayerLosing(lua_State *L)
{ {
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
@ -4041,22 +3897,16 @@ static luaL_Reg lib[] = {
{"P_SpawnGhostMobj",lib_pSpawnGhostMobj}, {"P_SpawnGhostMobj",lib_pSpawnGhostMobj},
{"P_GivePlayerRings",lib_pGivePlayerRings}, {"P_GivePlayerRings",lib_pGivePlayerRings},
{"P_GivePlayerLives",lib_pGivePlayerLives}, {"P_GivePlayerLives",lib_pGivePlayerLives},
{"P_GiveCoopLives",lib_pGiveCoopLives},
{"P_ResetScore",lib_pResetScore}, {"P_ResetScore",lib_pResetScore},
{"P_DoJumpShield",lib_pDoJumpShield},
{"P_DoBubbleBounce",lib_pDoBubbleBounce},
{"P_BlackOw",lib_pBlackOw},
{"P_ElementalFire",lib_pElementalFire}, {"P_ElementalFire",lib_pElementalFire},
{"P_SpawnSkidDust", lib_pSpawnSkidDust}, {"P_SpawnSkidDust", lib_pSpawnSkidDust},
{"P_MovePlayer",lib_pMovePlayer}, {"P_MovePlayer",lib_pMovePlayer},
{"P_DoPlayerFinish",lib_pDoPlayerFinish},
{"P_DoPlayerExit",lib_pDoPlayerExit}, {"P_DoPlayerExit",lib_pDoPlayerExit},
{"P_InstaThrust",lib_pInstaThrust}, {"P_InstaThrust",lib_pInstaThrust},
{"P_ReturnThrustX",lib_pReturnThrustX}, {"P_ReturnThrustX",lib_pReturnThrustX},
{"P_ReturnThrustY",lib_pReturnThrustY}, {"P_ReturnThrustY",lib_pReturnThrustY},
{"P_LookForEnemies",lib_pLookForEnemies}, {"P_LookForEnemies",lib_pLookForEnemies},
{"P_NukeEnemies",lib_pNukeEnemies}, {"P_NukeEnemies",lib_pNukeEnemies},
{"P_Earthquake",lib_pEarthquake},
{"P_SwitchShield",lib_pSwitchShield}, {"P_SwitchShield",lib_pSwitchShield},
// p_map // p_map
@ -4077,19 +3927,15 @@ static luaL_Reg lib[] = {
{"P_DamageMobj",lib_pDamageMobj}, {"P_DamageMobj",lib_pDamageMobj},
{"P_KillMobj",lib_pKillMobj}, {"P_KillMobj",lib_pKillMobj},
{"P_PlayerRingBurst",lib_pPlayerRingBurst}, {"P_PlayerRingBurst",lib_pPlayerRingBurst},
{"P_PlayerFlagBurst",lib_pPlayerFlagBurst},
{"P_PlayRinglossSound",lib_pPlayRinglossSound}, {"P_PlayRinglossSound",lib_pPlayRinglossSound},
{"P_PlayDeathSound",lib_pPlayDeathSound}, {"P_PlayDeathSound",lib_pPlayDeathSound},
{"P_PlayVictorySound",lib_pPlayVictorySound}, {"P_PlayVictorySound",lib_pPlayVictorySound},
{"P_PlayLivesJingle",lib_pPlayLivesJingle}, {"P_PlayLivesJingle",lib_pPlayLivesJingle},
{"P_CanPickupItem",lib_pCanPickupItem}, {"P_CanPickupItem",lib_pCanPickupItem},
{"P_DoNightsScore",lib_pDoNightsScore},
{"P_DoMatchSuper",lib_pDoMatchSuper},
// p_spec // p_spec
{"P_Thrust",lib_pThrust}, {"P_Thrust",lib_pThrust},
{"P_SetMobjStateNF",lib_pSetMobjStateNF}, {"P_SetMobjStateNF",lib_pSetMobjStateNF},
{"P_DoSuperTransformation",lib_pDoSuperTransformation},
{"P_ExplodeMissile",lib_pExplodeMissile}, {"P_ExplodeMissile",lib_pExplodeMissile},
{"P_MobjTouchingSectorSpecial",lib_pMobjTouchingSectorSpecial}, {"P_MobjTouchingSectorSpecial",lib_pMobjTouchingSectorSpecial},
{"P_FindLowestFloorSurrounding",lib_pFindLowestFloorSurrounding}, {"P_FindLowestFloorSurrounding",lib_pFindLowestFloorSurrounding},
@ -4148,7 +3994,6 @@ static luaL_Reg lib[] = {
{"S_MusicPlaying",lib_sMusicPlaying}, {"S_MusicPlaying",lib_sMusicPlaying},
{"S_MusicPaused",lib_sMusicPaused}, {"S_MusicPaused",lib_sMusicPaused},
{"S_MusicName",lib_sMusicName}, {"S_MusicName",lib_sMusicName},
{"S_MusicInfo",lib_sMusicInfo},
{"S_MusicExists",lib_sMusicExists}, {"S_MusicExists",lib_sMusicExists},
{"S_GetMusicLength",lib_sGetMusicLength}, {"S_GetMusicLength",lib_sGetMusicLength},
{"S_SetMusicLoopPoint",lib_sSetMusicLoopPoint}, {"S_SetMusicLoopPoint",lib_sSetMusicLoopPoint},
@ -4199,7 +4044,6 @@ static luaL_Reg lib[] = {
{"K_PlayLossSound", lib_kLossSound}, {"K_PlayLossSound", lib_kLossSound},
{"K_PlayPainSound", lib_kPainSound}, {"K_PlayPainSound", lib_kPainSound},
{"K_PlayHitEmSound", lib_kHitEmSound}, {"K_PlayHitEmSound", lib_kHitEmSound},
{"K_GetKartColorByName",lib_kGetKartColorByName},
{"K_IsPlayerLosing",lib_kIsPlayerLosing}, {"K_IsPlayerLosing",lib_kIsPlayerLosing},
{"K_IsPlayerWanted",lib_kIsPlayerWanted}, {"K_IsPlayerWanted",lib_kIsPlayerWanted},
{"K_KartBouncing",lib_kKartBouncing}, {"K_KartBouncing",lib_kKartBouncing},

View file

@ -109,9 +109,9 @@ boolean LUAh_BotAI(mobj_t *sonic, mobj_t *tails, ticcmd_t *cmd); // Hook for B_B
boolean LUAh_BotRespawn(mobj_t *sonic, mobj_t *tails); // Hook for B_CheckRespawn boolean LUAh_BotRespawn(mobj_t *sonic, mobj_t *tails); // Hook for B_CheckRespawn
boolean LUAh_LinedefExecute(line_t *line, mobj_t *mo, sector_t *sector); // Hook for linedef executors 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, int mute); // 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 boolean LUAh_HurtMsg(player_t *player, mobj_t *inflictor, mobj_t *source, UINT8 damagetype); // Hook for hurt messages
#define LUAh_PlayerSpawn(player) LUAh_PlayerHook(player, hook_PlayerSpawn) // Hook for G_SpawnPlayer #define LUAh_PlayerSpawn(player) LUAh_PlayerHook(player, hook_PlayerSpawn) // Hook for G_SpawnPlayer
void LUAh_PlayerQuit(player_t *plr, int reason); // Hook for player quitting void LUAh_PlayerQuit(player_t *plr, kickreason_t reason); // Hook for player quitting
boolean LUAh_MusicChange(const char *oldname, char *newname, UINT16 *mflags, boolean *looping, boolean LUAh_MusicChange(const char *oldname, char *newname, UINT16 *mflags, boolean *looping,
UINT32 *position, UINT32 *prefadems, UINT32 *fadeinms); // Hook for music changes UINT32 *position, UINT32 *prefadems, UINT32 *fadeinms); // Hook for music changes

View file

@ -527,49 +527,6 @@ void LUAh_PostThinkFrame(void)
lua_pop(gL, 1); // Pop error handler lua_pop(gL, 1); // Pop error handler
} }
// Hook for Y_Ticker
void LUAh_IntermissionThinker(void)
{
hook_p hookp;
if (!gL || !(hooksAvailable[hook_IntermissionThinker/8] & (1<<(hook_IntermissionThinker%8))))
return;
for (hookp = roothook; hookp; hookp = hookp->next)
if (hookp->type == hook_IntermissionThinker)
{
lua_pushfstring(gL, FMT_HOOKID, hookp->id);
lua_gettable(gL, LUA_REGISTRYINDEX);
if (lua_pcall(gL, 0, 0, 0)) {
if (!hookp->error || cv_debug & DBG_LUA)
CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
lua_pop(gL, 1);
hookp->error = true;
}
}
}
// Hook for Y_VoteTicker
void LUAh_VoteThinker(void)
{
hook_p hookp;
if (!gL || !(hooksAvailable[hook_VoteThinker/8] & (1<<(hook_VoteThinker%8))))
return;
for (hookp = roothook; hookp; hookp = hookp->next)
if (hookp->type == hook_VoteThinker)
{
lua_pushfstring(gL, FMT_HOOKID, hookp->id);
lua_gettable(gL, LUA_REGISTRYINDEX);
if (lua_pcall(gL, 0, 0, 0)) {
if (!hookp->error || cv_debug & DBG_LUA)
CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
lua_pop(gL, 1);
hookp->error = true;
}
}
}
// Hook for mobj collisions // Hook for mobj collisions
UINT8 LUAh_MobjCollideHook(mobj_t *thing1, mobj_t *thing2, enum hook which) UINT8 LUAh_MobjCollideHook(mobj_t *thing1, mobj_t *thing2, enum hook which)
{ {
@ -1384,10 +1341,10 @@ boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg, int mute)
hooked = true; hooked = true;
lua_pop(gL, 1); lua_pop(gL, 1);
} }
}
lua_settop(gL, 0); lua_settop(gL, 0);
return hooked; return hooked;
}
} }
// Hook for hurt messages // Hook for hurt messages
@ -2218,6 +2175,27 @@ boolean LUAh_PlayerExplode(player_t *player, mobj_t *inflictor, mobj_t *source)
return hooked; return hooked;
} }
// Hook for Y_VoteTicker
void LUAh_VoteThinker(void)
{
hook_p hookp;
if (!gL || !(hooksAvailable[hook_VoteThinker/8] & (1<<(hook_VoteThinker%8))))
return;
for (hookp = roothook; hookp; hookp = hookp->next)
if (hookp->type == hook_VoteThinker)
{
lua_pushfstring(gL, FMT_HOOKID, hookp->id);
lua_gettable(gL, LUA_REGISTRYINDEX);
if (lua_pcall(gL, 0, 0, 0)) {
if (!hookp->error || cv_debug & DBG_LUA)
CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
lua_pop(gL, 1);
hookp->error = true;
}
}
}
// Hook for game quitting // Hook for game quitting
void LUAh_GameQuit(void) void LUAh_GameQuit(void)
{ {

View file

@ -114,25 +114,10 @@ enum align {
align_left = 0, align_left = 0,
align_center, align_center,
align_right, align_right,
align_fixed,
align_fixedcenter,
align_fixedright,
align_small, align_small,
align_smallfixed,
align_smallfixedcenter,
align_smallfixedright,
align_smallcenter, align_smallcenter,
align_smallright, align_smallright,
align_smallthin,
align_smallthincenter,
align_smallthinright,
align_smallthinfixed,
align_smallthinfixedcenter,
align_smallthinfixedright,
align_thin, align_thin,
align_thinfixed,
align_thinfixedcenter,
align_thinfixedright,
align_thincenter, align_thincenter,
align_thinright align_thinright
}; };
@ -140,25 +125,10 @@ static const char *const align_opt[] = {
"left", "left",
"center", "center",
"right", "right",
"fixed",
"fixed-center",
"fixed-right",
"small", "small",
"small-fixed",
"small-fixed-center",
"small-fixed-right",
"small-center", "small-center",
"small-right", "small-right",
"small-thin",
"small-thin-center",
"small-thin-right",
"small-thin-fixed",
"small-thin-fixed-center",
"small-thin-fixed-right",
"thin", "thin",
"thin-fixed",
"thin-fixed-center",
"thin-fixed-right",
"thin-center", "thin-center",
"thin-right", "thin-right",
NULL}; NULL};
@ -1029,52 +999,16 @@ static int libd_drawString(lua_State *L)
case align_right: case align_right:
V_DrawRightAlignedString(x, y, flags, str); V_DrawRightAlignedString(x, y, flags, str);
break; break;
case align_fixed:
V_DrawStringAtFixed(x, y, flags, str);
break;
case align_fixedcenter:
V_DrawCenteredStringAtFixed(x, y, flags, str);
break;
case align_fixedright:
V_DrawRightAlignedStringAtFixed(x, y, flags, str);
break;
// hu_font, 0.5x scale // hu_font, 0.5x scale
case align_small: case align_small:
V_DrawSmallString(x, y, flags, str); V_DrawSmallString(x, y, flags, str);
break; break;
case align_smallfixed:
V_DrawSmallStringAtFixed(x, y, flags, str);
break;
case align_smallfixedcenter:
V_DrawCenteredSmallStringAtFixed(x, y, flags, str);
break;
case align_smallfixedright:
V_DrawRightAlignedSmallStringAtFixed(x, y, flags, str);
break;
case align_smallcenter: case align_smallcenter:
V_DrawCenteredSmallString(x, y, flags, str); V_DrawCenteredSmallString(x, y, flags, str);
break; break;
case align_smallright: case align_smallright:
V_DrawRightAlignedSmallString(x, y, flags, str); V_DrawRightAlignedSmallString(x, y, flags, str);
break; break;
case align_smallthin:
V_DrawSmallThinString(x, y, flags, str);
break;
case align_smallthincenter:
V_DrawCenteredSmallThinString(x, y, flags, str);
break;
case align_smallthinright:
V_DrawRightAlignedSmallThinString(x, y, flags, str);
break;
case align_smallthinfixed:
V_DrawSmallThinStringAtFixed(x, y, flags, str);
break;
case align_smallthinfixedcenter:
V_DrawCenteredSmallThinStringAtFixed(x, y, flags, str);
break;
case align_smallthinfixedright:
V_DrawRightAlignedSmallThinStringAtFixed(x, y, flags, str);
break;
// tny_font // tny_font
case align_thin: case align_thin:
V_DrawThinString(x, y, flags, str); V_DrawThinString(x, y, flags, str);
@ -1085,81 +1019,10 @@ static int libd_drawString(lua_State *L)
case align_thinright: case align_thinright:
V_DrawRightAlignedThinString(x, y, flags, str); V_DrawRightAlignedThinString(x, y, flags, str);
break; break;
case align_thinfixed:
V_DrawThinStringAtFixed(x, y, flags, str);
break;
case align_thinfixedcenter:
V_DrawCenteredThinStringAtFixed(x, y, flags, str);
break;
case align_thinfixedright:
V_DrawRightAlignedThinStringAtFixed(x, y, flags, str);
break;
} }
return 0; return 0;
} }
static int libd_drawNameTag(lua_State *L)
{
INT32 x;
INT32 y;
const char *str;
INT32 flags;
UINT16 basecolor;
UINT16 outlinecolor;
UINT8 *basecolormap = NULL;
UINT8 *outlinecolormap = NULL;
HUDONLY
x = luaL_checkinteger(L, 1);
y = luaL_checkinteger(L, 2);
str = luaL_checkstring(L, 3);
flags = luaL_optinteger(L, 4, 0);
basecolor = luaL_optinteger(L, 5, SKINCOLOR_BLUE);
outlinecolor = luaL_optinteger(L, 6, SKINCOLOR_ORANGE);
if (basecolor != SKINCOLOR_NONE)
basecolormap = R_GetTranslationColormap(TC_DEFAULT, basecolor, GTC_CACHE);
if (outlinecolor != SKINCOLOR_NONE)
outlinecolormap = R_GetTranslationColormap(TC_DEFAULT, outlinecolor, GTC_CACHE);
flags &= ~V_PARAMMASK; // Don't let crashes happen.
V_DrawNameTag(x, y, flags, FRACUNIT, basecolormap, outlinecolormap, str);
return 0;
}
static int libd_drawScaledNameTag(lua_State *L)
{
fixed_t x;
fixed_t y;
const char *str;
INT32 flags;
fixed_t scale;
UINT16 basecolor;
UINT16 outlinecolor;
UINT8 *basecolormap = NULL;
UINT8 *outlinecolormap = NULL;
HUDONLY
x = luaL_checkfixed(L, 1);
y = luaL_checkfixed(L, 2);
str = luaL_checkstring(L, 3);
flags = luaL_optinteger(L, 4, 0);
scale = luaL_optinteger(L, 5, FRACUNIT);
if (scale < 0)
return luaL_error(L, "negative scale");
basecolor = luaL_optinteger(L, 6, SKINCOLOR_BLUE);
outlinecolor = luaL_optinteger(L, 7, SKINCOLOR_ORANGE);
if (basecolor != SKINCOLOR_NONE)
basecolormap = R_GetTranslationColormap(TC_DEFAULT, basecolor, GTC_CACHE);
if (outlinecolor != SKINCOLOR_NONE)
outlinecolormap = R_GetTranslationColormap(TC_DEFAULT, outlinecolor, GTC_CACHE);
flags &= ~V_PARAMMASK; // Don't let crashes happen.
V_DrawNameTag(FixedInt(x), FixedInt(y), flags, scale, basecolormap, outlinecolormap, str);
return 0;
}
static int libd_drawKartString(lua_State *L) static int libd_drawKartString(lua_State *L)
{ {
fixed_t x = luaL_checkinteger(L, 1); fixed_t x = luaL_checkinteger(L, 1);
@ -1196,13 +1059,6 @@ static int libd_stringWidth(lua_State *L)
return 1; return 1;
} }
static int libd_nameTagWidth(lua_State *L)
{
HUDONLY
lua_pushinteger(L, V_NameTagWidth(luaL_checkstring(L, 1)));
return 1;
}
static int libd_getColormap(lua_State *L) static int libd_getColormap(lua_State *L)
{ {
INT32 skinnum = TC_DEFAULT; INT32 skinnum = TC_DEFAULT;
@ -1368,12 +1224,9 @@ static luaL_Reg lib_draw[] = {
{"drawFill", libd_drawFill}, {"drawFill", libd_drawFill},
{"fadeScreen", libd_fadeScreen}, {"fadeScreen", libd_fadeScreen},
{"drawString", libd_drawString}, {"drawString", libd_drawString},
{"drawNameTag", libd_drawNameTag},
{"drawScaledNameTag", libd_drawScaledNameTag},
{"drawKartString", libd_drawKartString}, {"drawKartString", libd_drawKartString},
// misc // misc
{"stringWidth", libd_stringWidth}, {"stringWidth", libd_stringWidth},
{"nameTagWidth", libd_nameTagWidth},
// m_random // m_random
{"RandomFixed",libd_RandomFixed}, {"RandomFixed",libd_RandomFixed},
{"RandomByte",libd_RandomByte}, {"RandomByte",libd_RandomByte},

View file

@ -229,10 +229,6 @@ static int player_get(lua_State *L)
lua_pushinteger(L, plr->skincolor); lua_pushinteger(L, plr->skincolor);
else if (fastcmp(field,"score")) else if (fastcmp(field,"score"))
lua_pushinteger(L, plr->score); lua_pushinteger(L, plr->score);
else if (fastcmp(field,"dashspeed"))
lua_pushfixed(L, plr->dashspeed);
else if (fastcmp(field,"dashtime"))
lua_pushinteger(L, plr->dashtime);
// SRB2kart // SRB2kart
else if (fastcmp(field,"kartspeed")) else if (fastcmp(field,"kartspeed"))
lua_pushinteger(L, plr->kartspeed); lua_pushinteger(L, plr->kartspeed);
@ -500,10 +496,6 @@ static int player_set(lua_State *L)
} }
else if (fastcmp(field,"score")) else if (fastcmp(field,"score"))
plr->score = (UINT32)luaL_checkinteger(L, 3); plr->score = (UINT32)luaL_checkinteger(L, 3);
else if (fastcmp(field,"dashspeed"))
plr->dashspeed = luaL_checkfixed(L, 3);
else if (fastcmp(field,"dashtime"))
plr->dashtime = (INT32)luaL_checkinteger(L, 3);
// SRB2kart // SRB2kart
else if (fastcmp(field,"kartstuff")) else if (fastcmp(field,"kartstuff"))
return NOSET; return NOSET;

File diff suppressed because it is too large Load diff

View file

@ -54,14 +54,11 @@ void LUA_InvalidateLevel(void);
void LUA_InvalidateMapthings(void); void LUA_InvalidateMapthings(void);
void LUA_InvalidatePlayer(player_t *player); void LUA_InvalidatePlayer(player_t *player);
void LUA_Step(void); void LUA_Step(void);
void LUA_Archive(void); void LUA_Archive(UINT8 *p);
void LUA_UnArchive(void); void LUA_UnArchive(UINT8 *p);
void LUA_ArchiveDemo(void);
void LUA_UnArchiveDemo(void);
int LUA_PushGlobals(lua_State *L, const char *word); int LUA_PushGlobals(lua_State *L, const char *word);
int LUA_CheckGlobals(lua_State *L, const char *word); int LUA_WriteGlobals(lua_State *L, const char *word);
void Got_Luacmd(UINT8 **cp, INT32 playernum); // lua_consolelib.c void Got_Luacmd(UINT8 **cp, INT32 playernum); // lua_consolelib.c
void LUA_CVarChanged(const char *name); // lua_consolelib.c void LUA_CVarChanged(const char *name); // lua_consolelib.c

View file

@ -20,7 +20,6 @@
#include "g_game.h" // record info #include "g_game.h" // record info
#include "r_skins.h" // numskins #include "r_skins.h" // numskins
#include "r_draw.h" // R_GetColorByName #include "r_draw.h" // R_GetColorByName
#include "k_color.h" // K_GetKartColorByName
#include "k_pwrlv.h" #include "k_pwrlv.h"
// Map triggers for linedef executors // Map triggers for linedef executors

View file

@ -2337,6 +2337,64 @@ void Moviemode_option_Onchange(void)
// current menudef // current menudef
menu_t *currentMenu = &MainDef; menu_t *currentMenu = &MainDef;
// =========================================================================
// MENU PRESENTATION PARAMETER HANDLING (BACKGROUNDS)
// =========================================================================
// menu IDs are equal to current/prevMenu in most cases, except MN_SPECIAL when we don't want to operate on Message, Pause, etc.
UINT32 prevMenuId = 0;
UINT32 activeMenuId = 0;
menupres_t menupres[NUMMENUTYPES];
void M_InitMenuPresTables(void)
{
INT32 i;
// Called in d_main before SOC can get to the tables
// Set menupres defaults
for (i = 0; i < NUMMENUTYPES; i++)
{
// so-called "undefined"
menupres[i].fadestrength = -1;
menupres[i].hidetitlepics = -1; // inherits global hidetitlepics
menupres[i].ttmode = TTMODE_NONE;
menupres[i].ttscale = UINT8_MAX;
menupres[i].ttname[0] = 0;
menupres[i].ttx = INT16_MAX;
menupres[i].tty = INT16_MAX;
menupres[i].ttloop = INT16_MAX;
menupres[i].tttics = UINT16_MAX;
menupres[i].enterwipe = -1;
menupres[i].exitwipe = -1;
menupres[i].bgcolor = -1;
menupres[i].titlescrollxspeed = INT32_MAX;
menupres[i].titlescrollyspeed = INT32_MAX;
menupres[i].bghide = true;
// default true
menupres[i].enterbubble = true;
menupres[i].exitbubble = true;
if (i != MN_MAIN)
{
menupres[i].muslooping = true;
}
if (i == MN_SP_TIMEATTACK)
strncpy(menupres[i].musname, "_recat", 7);
else if (i == MN_SP_NIGHTSATTACK)
strncpy(menupres[i].musname, "_nitat", 7);
else if (i == MN_SP_MARATHON)
strncpy(menupres[i].musname, "spec8", 6);
else if (i == MN_SP_PLAYER || i == MN_SR_PLAYER)
strncpy(menupres[i].musname, "_chsel", 7);
else if (i == MN_SR_SOUNDTEST)
{
*menupres[i].musname = '\0';
menupres[i].musstop = true;
}
}
}
// ========================================================================= // =========================================================================
// BASIC MENU HANDLING // BASIC MENU HANDLING
// ========================================================================= // =========================================================================
@ -3313,6 +3371,7 @@ void M_ClearMenus(boolean callexitmenufunc)
if (currentMenu == &MessageDef) // Oh sod off! if (currentMenu == &MessageDef) // Oh sod off!
currentMenu = &MainDef; // Not like it matters currentMenu = &MainDef; // Not like it matters
menuactive = false; menuactive = false;
hidetitlemap = false;
} }
// //
@ -3372,6 +3431,14 @@ void M_SetupNextMenu(menu_t *menudef)
} }
} }
} }
hidetitlemap = false;
}
// Guess I'll put this here, idk
boolean M_MouseNeeded(void)
{
return false;
} }
// //
@ -5309,6 +5376,7 @@ void M_ReplayHut(INT32 choice)
menuactive = true; menuactive = true;
M_SetupNextMenu(&MISC_ReplayHutDef); M_SetupNextMenu(&MISC_ReplayHutDef);
G_SetGamestate(GS_TIMEATTACK); G_SetGamestate(GS_TIMEATTACK);
titlemapinaction = TITLEMAP_OFF; // Nope don't give us HOMs please
demo.rewinding = false; demo.rewinding = false;
CL_ClearRewinds(); CL_ClearRewinds();
@ -7921,6 +7989,7 @@ static void M_TimeAttack(INT32 choice)
M_SetupNextMenu(&SP_TimeAttackDef); M_SetupNextMenu(&SP_TimeAttackDef);
G_SetGamestate(GS_TIMEATTACK); G_SetGamestate(GS_TIMEATTACK);
titlemapinaction = TITLEMAP_OFF; // Nope don't give us HOMs please
if (cv_nextmap.value) if (cv_nextmap.value)
Nextmap_OnChange(); Nextmap_OnChange();
@ -7953,6 +8022,7 @@ static void M_BreakTheCapsules(INT32 choice)
M_SetupNextMenu(&SP_TimeAttackDef); M_SetupNextMenu(&SP_TimeAttackDef);
G_SetGamestate(GS_TIMEATTACK); G_SetGamestate(GS_TIMEATTACK);
titlemapinaction = TITLEMAP_OFF; // Nope don't give us HOMs please
if (cv_nextmap.value) if (cv_nextmap.value)
Nextmap_OnChange(); Nextmap_OnChange();
@ -7971,161 +8041,6 @@ static boolean M_QuitTimeAttackMenu(void)
return true; return true;
} }
// Drawing function for Nights Attack
/*void M_DrawNightsAttackMenu(void)
{
patch_t *PictureOfLevel;
lumpnum_t lumpnum;
char beststr[40];
S_ChangeMusicInternal("racent", true); // Eww, but needed for when user hits escape during demo playback
V_DrawPatchFill(W_CachePatchName("SRB2BACK", PU_CACHE));
// draw menu (everything else goes on top of it)
M_DrawGenericMenu();
// A 160x100 image of the level as entry MAPxxP
lumpnum = W_CheckNumForName(va("%sP", G_BuildMapName(cv_nextmap.value)));
if (lumpnum != LUMPERROR)
PictureOfLevel = W_CachePatchNum(lumpnum, PU_CACHE);
else
PictureOfLevel = W_CachePatchName("BLANKLVL", PU_CACHE);
V_DrawSmallScaledPatch(90, 28, 0, PictureOfLevel);
// Level record list
if (cv_nextmap.value)
{
emblem_t *em;
INT32 yHeight;
UINT8 bestoverall = G_GetBestNightsGrade(cv_nextmap.value, 0);
UINT8 bestgrade = G_GetBestNightsGrade(cv_nextmap.value, cv_dummymares.value);
UINT32 bestscore = G_GetBestNightsScore(cv_nextmap.value, cv_dummymares.value);
tic_t besttime = G_GetBestNightsTime(cv_nextmap.value, cv_dummymares.value);
if (P_HasGrades(cv_nextmap.value, 0))
V_DrawScaledPatch(200, 28 + 8, 0, ngradeletters[bestoverall]);
if (currentMenu == &SP_NightsAttackDef)
{
if (P_HasGrades(cv_nextmap.value, cv_dummymares.value))
{
V_DrawString(160-88, 112, highlightflags, "BEST GRADE:");
V_DrawSmallScaledPatch(160 + 86 - (ngradeletters[bestgrade]->width/2),
112 + 8 - (ngradeletters[bestgrade]->height/2),
0, ngradeletters[bestgrade]);
}
if (!bestscore)
sprintf(beststr, "(none)");
else
sprintf(beststr, "%u", bestscore);
V_DrawString(160 - 88, 122, highlightflags, "BEST SCORE:");
V_DrawRightAlignedString(160 + 88, 122, V_ALLOWLOWERCASE, beststr);
if (besttime == UINT32_MAX)
sprintf(beststr, "(none)");
else
sprintf(beststr, "%i:%02i.%02i", G_TicsToMinutes(besttime, true),
G_TicsToSeconds(besttime),
G_TicsToCentiseconds(besttime));
V_DrawString(160-88, 132, highlightflags, "BEST TIME:");
V_DrawRightAlignedString(160+88, 132, V_ALLOWLOWERCASE, beststr);
if (cv_dummymares.value == 0) {
// Draw record emblems.
em = M_GetLevelEmblems(cv_nextmap.value);
while (em)
{
switch (em->type)
{
case ET_NGRADE: yHeight = 112; break;
case ET_NTIME: yHeight = 132; break;
default:
goto skipThisOne;
}
if (em->collected)
V_DrawSmallMappedPatch(160+88, yHeight, 0, W_CachePatchName(M_GetEmblemPatch(em, false), PU_CACHE),
R_GetTranslationColormap(TC_DEFAULT, M_GetEmblemColor(em), GTC_MENUCACHE));
else
V_DrawSmallScaledPatch(160+88, yHeight, 0, W_CachePatchName("NEEDIT", PU_CACHE));
skipThisOne:
em = M_GetLevelEmblems(-1);
}
}
}
// ALWAYS DRAW level name even when not on this menu!
else
{
consvar_t *ncv;
INT32 x = SP_NightsAttackDef.x;
INT32 y = SP_NightsAttackDef.y;
ncv = (consvar_t *)SP_NightsAttackMenu[0].itemaction;
V_DrawString(x, y + SP_NightsAttackMenu[0].alphaKey, V_TRANSLUCENT, SP_NightsAttackMenu[0].text);
V_DrawString(BASEVIDWIDTH - x - V_StringWidth(ncv->string, 0),
y + SP_NightsAttackMenu[0].alphaKey, highlightflags|V_TRANSLUCENT, ncv->string);
}
}
}*/
// Going to Nights Attack menu...
/*static void M_BreakTheCapsules(INT32 choice)
{
(void)choice;
memset(skins_cons_t, 0, sizeof (skins_cons_t));
levellistmode = LLM_BREAKTHECAPSULES; // Don't be dependent on cv_newgametype
if (M_CountLevelsToShowInList() == 0)
{
M_StartMessage(M_GetText("No NiGHTS-attackable levels found.\n"),NULL,MM_NOTHING);
return;
}
// This is really just to make sure Sonic is the played character, just in case
M_PatchSkinNameTable();
M_PrepareLevelSelect();
M_SetupNextMenu(&SP_NightsAttackDef);
Nextmap_OnChange();
itemOn = nastart; // "Start" is selected.
G_SetGamestate(GS_TIMEATTACK);
S_ChangeMusicInternal("racent", true);
}*/
// Player has selected the "START" from the nights attack screen
/*static void M_ChooseNightsAttack(INT32 choice)
{
char nameofdemo[256];
(void)choice;
emeralds = 0;
M_ClearMenus(true);
modeattacking = ATTACKING_CAPSULES;
I_mkdir(va("%s"PATHSEP"replay", srb2home), 0755);
I_mkdir(va("%s"PATHSEP"replay"PATHSEP"%s", srb2home, timeattackfolder), 0755);
snprintf(nameofdemo, sizeof nameofdemo, "replay"PATHSEP"%s"PATHSEP"%s-last", timeattackfolder, G_BuildMapName(cv_nextmap.value));
if (!cv_autorecord.value)
remove(va("%s"PATHSEP"%s.lmp", srb2home, nameofdemo));
else
G_RecordDemo(nameofdemo);
G_DeferedInitNew(false, G_BuildMapName(cv_nextmap.value), 0, 0, false);
}*/
// Player has selected the "START" from the time attack screen // Player has selected the "START" from the time attack screen
static void M_ChooseTimeAttack(INT32 choice) static void M_ChooseTimeAttack(INT32 choice)
{ {

View file

@ -106,12 +106,10 @@ void A_Pain(mobj_t *actor);
void A_Explode(mobj_t *actor); void A_Explode(mobj_t *actor);
void A_BossDeath(mobj_t *actor); void A_BossDeath(mobj_t *actor);
void A_CustomPower(mobj_t *actor); void A_CustomPower(mobj_t *actor);
void A_GiveWeapon(mobj_t *actor);
void A_RingBox(mobj_t *actor); void A_RingBox(mobj_t *actor);
void A_Invincibility(mobj_t *actor); void A_Invincibility(mobj_t *actor);
void A_SuperSneakers(mobj_t *actor); void A_SuperSneakers(mobj_t *actor);
void A_AwardScore(mobj_t *actor); void A_AwardScore(mobj_t *actor);
void A_ExtraLife(mobj_t *actor);
void A_GiveShield(mobj_t *actor); void A_GiveShield(mobj_t *actor);
void A_GravityBox(mobj_t *actor); void A_GravityBox(mobj_t *actor);
void A_ScoreRise(mobj_t *actor); void A_ScoreRise(mobj_t *actor);
@ -148,7 +146,6 @@ void A_CrawlaCommanderThink(mobj_t *actor);
void A_RingExplode(mobj_t *actor); void A_RingExplode(mobj_t *actor);
void A_OldRingExplode(mobj_t *actor); void A_OldRingExplode(mobj_t *actor);
void A_MixUp(mobj_t *actor); void A_MixUp(mobj_t *actor);
void A_RecyclePowers(mobj_t *actor);
void A_Boss2TakeDamage(mobj_t *actor); void A_Boss2TakeDamage(mobj_t *actor);
void A_Boss7Chase(mobj_t *actor); void A_Boss7Chase(mobj_t *actor);
void A_GoopSplat(mobj_t *actor); void A_GoopSplat(mobj_t *actor);
@ -3878,43 +3875,6 @@ void A_AwardScore(mobj_t *actor)
S_StartSound(player->mo, actor->info->seesound); S_StartSound(player->mo, actor->info->seesound);
} }
// Function: A_ExtraLife
//
// Description: Awards the player an extra life.
//
// var1 = unused
// var2 = unused
//
void A_ExtraLife(mobj_t *actor)
{
player_t *player;
if (LUA_CallAction("A_ExtraLife", actor))
return;
if (!actor->target || !actor->target->player)
{
CONS_Debug(DBG_GAMELOGIC, "Powerup has no target.\n");
return;
}
player = actor->target->player;
if (actor->type == MT_1UP_ICON && actor->tracer)
{
// We're using the overlay, so use the overlay 1up sprite (no text)
actor->sprite = SPR_TV1P;
}
if (ultimatemode) //I don't THINK so!
{
S_StartSound(player->mo, sfx_lose);
return;
}
P_GiveCoopLives(player, 1, true);
}
// Function: A_GiveShield // Function: A_GiveShield
// //
// Description: Awards the player a specified shield. // Description: Awards the player a specified shield.

View file

@ -175,7 +175,6 @@ mobj_t *P_SpawnGhostMobj(mobj_t *mobj);
void P_GivePlayerRings(player_t *player, INT32 num_rings); void P_GivePlayerRings(player_t *player, INT32 num_rings);
void P_GivePlayerSpheres(player_t *player, INT32 num_spheres); void P_GivePlayerSpheres(player_t *player, INT32 num_spheres);
void P_GivePlayerLives(player_t *player, INT32 numlives); void P_GivePlayerLives(player_t *player, INT32 numlives);
void P_GiveCoopLives(player_t *player, INT32 numlives, boolean sound);
UINT8 P_GetNextEmerald(void); UINT8 P_GetNextEmerald(void);
void P_GiveEmerald(boolean spawnObj); void P_GiveEmerald(boolean spawnObj);
void P_GiveFinishFlags(player_t *player); void P_GiveFinishFlags(player_t *player);
@ -186,18 +185,12 @@ void P_ResetScore(player_t *player);
#endif #endif
boolean P_AutoPause(void); boolean P_AutoPause(void);
void P_DoJumpShield(player_t *player);
void P_DoBubbleBounce(player_t *player);
void P_DoAbilityBounce(player_t *player, boolean changemomz);
void P_TwinSpinRejuvenate(player_t *player, mobjtype_t type);
void P_BlackOw(player_t *player);
void P_ElementalFire(player_t *player, boolean cropcircle); void P_ElementalFire(player_t *player, boolean cropcircle);
void P_SpawnSkidDust(player_t *player, fixed_t radius, boolean sound); void P_SpawnSkidDust(player_t *player, fixed_t radius, boolean sound);
void P_MovePlayer(player_t *player); void P_MovePlayer(player_t *player);
void P_PlayerThink(player_t *player); void P_PlayerThink(player_t *player);
void P_PlayerAfterThink(player_t *player); void P_PlayerAfterThink(player_t *player);
void P_DoPlayerFinish(player_t *player);
void P_DoPlayerExit(player_t *player); void P_DoPlayerExit(player_t *player);
void P_DoTimeOver(player_t *player); void P_DoTimeOver(player_t *player);
@ -502,15 +495,11 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings); /// \todo better fit
void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck); void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck);
void P_TouchStarPost(mobj_t *starpost, player_t *player, boolean snaptopost); void P_TouchStarPost(mobj_t *starpost, player_t *player, boolean snaptopost);
void P_PlayerFlagBurst(player_t *player, boolean toss);
void P_CheckTimeLimit(void); void P_CheckTimeLimit(void);
void P_CheckPointLimit(void); void P_CheckPointLimit(void);
//void P_CheckSurvivors(void);
boolean P_CheckRacers(void); boolean P_CheckRacers(void);
boolean P_CanPickupItem(player_t *player, UINT8 weapon); boolean P_CanPickupItem(player_t *player, UINT8 weapon);
void P_DoNightsScore(player_t *player);
void P_DoMatchSuper(player_t *player);
// //
// P_SPEC // P_SPEC
@ -531,7 +520,6 @@ boolean P_Teleport(mobj_t *thing, fixed_t x, fixed_t y, fixed_t z, angle_t angle
boolean P_SetMobjStateNF(mobj_t *mobj, statenum_t state); boolean P_SetMobjStateNF(mobj_t *mobj, statenum_t state);
boolean P_CheckMissileSpawn(mobj_t *th); boolean P_CheckMissileSpawn(mobj_t *th);
void P_Thrust(mobj_t *mo, angle_t angle, fixed_t move); void P_Thrust(mobj_t *mo, angle_t angle, fixed_t move);
void P_DoSuperTransformation(player_t *player, boolean giverings);
void P_ExplodeMissile(mobj_t *mo); void P_ExplodeMissile(mobj_t *mo);
void P_CheckGravity(mobj_t *mo, boolean affect); void P_CheckGravity(mobj_t *mo, boolean affect);

View file

@ -4372,7 +4372,7 @@ void P_SaveNetGame(void)
P_NetArchiveTubeWaypoints(); P_NetArchiveTubeWaypoints();
P_NetArchiveWaypoints(); P_NetArchiveWaypoints();
} }
LUA_Archive(); LUA_Archive(save_p);
P_ArchiveLuabanksAndConsistency(); P_ArchiveLuabanksAndConsistency();
} }
@ -4416,7 +4416,7 @@ boolean P_LoadNetGame(void)
P_RelinkPointers(); P_RelinkPointers();
P_FinishMobjs(); P_FinishMobjs();
} }
LUA_UnArchive(); LUA_UnArchive(save_p);
// This is stupid and hacky, but maybe it'll work! // This is stupid and hacky, but maybe it'll work!
P_SetRandSeed(P_GetInitSeed()); P_SetRandSeed(P_GetInitSeed());

View file

@ -3805,10 +3805,6 @@ boolean P_LoadLevel(boolean fromnetsave)
// will be set by player think. // will be set by player think.
players[consoleplayer].viewz = 1; players[consoleplayer].viewz = 1;
// Cancel all d_main.c fadeouts (keep fade in though).
wipegamestate = FORCEWIPEOFF;
wipestyleflags = 0;
// Encore mode fade to pink to white // Encore mode fade to pink to white
// This is handled BEFORE sounds are stopped. // This is handled BEFORE sounds are stopped.
if (encoremode && !prevencoremode && !demo.rewinding) if (encoremode && !prevencoremode && !demo.rewinding)
@ -3874,8 +3870,6 @@ boolean P_LoadLevel(boolean fromnetsave)
if (G_GetModeAttackRetryFlag()) if (G_GetModeAttackRetryFlag())
{ {
if (modeattacking)
wipestyleflags |= (WSF_FADEOUT|WSF_TOWHITE);
G_ClearModeAttackRetryFlag(); G_ClearModeAttackRetryFlag();
} }

View file

@ -4728,7 +4728,7 @@ DoneSection2:
{ {
INT32 lineindex; INT32 lineindex;
P_DoPlayerFinish(player); P_DoPlayerExit(player);
P_SetupSignExit(player); P_SetupSignExit(player);
// important: use sector->tag on next line instead of player->mo->subsector->tag // important: use sector->tag on next line instead of player->mo->subsector->tag

View file

@ -1654,6 +1654,7 @@ enum
}; };
musicdef_t *musicdefstart = NULL; musicdef_t *musicdefstart = NULL;
struct cursongcredit cursongcredit; // Currently displayed song credit info
// //
// search for music definition in wad // search for music definition in wad

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2 KART // SONIC ROBO BLAST 2
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Copyright (C) 2020 by James R. // Copyright (C) 2020 by James R.
// //