From 5e76232f053fb3d9f6c84d295e1a29417dbf139f Mon Sep 17 00:00:00 2001 From: LeonardoTheMutant <70893504+LeonardoTheMutant@users.noreply.github.com> Date: Mon, 14 Oct 2024 17:27:12 +0200 Subject: [PATCH] Fix minigame-related mistakes --- SRC/LUA/HUD.LUA | 2 +- SRC/LUA/MINIGAMES/HUD_MINIGAMES.LUA | 10 +++++----- SRC/LUA/MINIGAMES/MINIGAMES.LUA | 6 +++++- SRC/LUA/WEAPONS.LUA | 2 +- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/SRC/LUA/HUD.LUA b/SRC/LUA/HUD.LUA index e52b92f..5fcd225 100644 --- a/SRC/LUA/HUD.LUA +++ b/SRC/LUA/HUD.LUA @@ -95,7 +95,7 @@ hud.add(function(v, p) end --Do not render the main HUD if it was disabled by another script - if (p.mmhelp.active) or (p.debugdrawer) or ((MM.minigame and p.minigame) or (not MM.minigame and p.minigame)) return end + if (p.mmhelp.active) or (p.debugdrawer) or ((MM.twopgame and MM.minigame) or (not MM.twopgame and p.minigame)) return end hud.disable("lives") hud.disable("textspectator") diff --git a/SRC/LUA/MINIGAMES/HUD_MINIGAMES.LUA b/SRC/LUA/MINIGAMES/HUD_MINIGAMES.LUA index f639623..d7fc73c 100644 --- a/SRC/LUA/MINIGAMES/HUD_MINIGAMES.LUA +++ b/SRC/LUA/MINIGAMES/HUD_MINIGAMES.LUA @@ -30,15 +30,15 @@ local function V_DrawMinigameTime(v) if (timelimit and (not G_TicsToMinutes(timertime)) and (leveltime & 4)) --Swap the colors in the label for flashing effect --0x49 in SRB2's palette is Yellow, 0x25 is Red - V_DrawTextPatch(v, timeLabelX, hudinfo[HUD_TIME].y, xoff, yoff, V_TextPatch_SwapColor(MM.text[consoleplayer.mmlang]["BMP_TIME"], 0x49, 0x25), hudinfo[HUD_TIME].f|v.localTransFlag()) + V_DrawTextPatch(v, timeLabelX, hudinfo[HUD_TIME].y, xoff, yoff, V_TextPatch_SwapColor(MM.text[consoleplayer.mmlang]["BMP_TIME"], 0x49, 0x25), V_SNAPTOTOP|v.localTransFlag()) else - V_DrawTextPatch(v, timeLabelX, hudinfo[HUD_TIME].y, xoff, yoff, MM.text[consoleplayer.mmlang]["BMP_TIME"], hudinfo[HUD_TIME].f|v.localTransFlag()) + V_DrawTextPatch(v, timeLabelX, hudinfo[HUD_TIME].y, xoff, yoff, MM.text[consoleplayer.mmlang]["BMP_TIME"], V_SNAPTOTOP|v.localTransFlag()) end else --in case Text Patch was not found or the game is splitscreen (V_DrawTextPatch() does not support per-player rendering) if (timelimit and (not G_TicsToMinutes(timertime)) and (leveltime & 4)) - v.draw(timeLabelX, hudinfo[HUD_TIME].y, MM.graphics["STTRTIME"], hudinfo[HUD_TIME].f|v.localTransFlag()) + v.draw(timeLabelX, hudinfo[HUD_TIME].y, MM.graphics["STTRTIME"], V_SNAPTOTOP|v.localTransFlag()) else - v.draw(timeLabelX, hudinfo[HUD_TIME].y, MM.graphics["STTTIME"], hudinfo[HUD_TIME].f|v.localTransFlag()) + v.draw(timeLabelX, hudinfo[HUD_TIME].y, MM.graphics["STTTIME"], V_SNAPTOTOP|v.localTransFlag()) end end @@ -81,7 +81,7 @@ hud.add(function(v, p) if ((p.minigame) and ((p.spectator) or (PlayerCount() == 1)) and (not (MM.minigame and MM.twopgame))) --CUSTOM3 related text if (not p.minigametimeout) - V_DrawStrASCII(v, (320 - V_StrWidthASCII((MM_GetText(consoleplayer.mmlang, "HUD_MINIGAME", "PRESS").." "..MM_GetText(consoleplayer.mmlang, "HUD_MINIGAME", "LEAVE")), 0, 32768)), 0, charset, (MM_GetText(consoleplayer.mmlang, "HUD_MINIGAME", "PRESS").." "..MM_GetText(consoleplayer.mmlang, "HUD_MINIGAME", "LEAVE")), V_SNAPTOTOP|V_SNAPTORIGHT|v.localTransFlag(), 32768) --FU/2 + V_DrawStrASCII(v, (320 - V_StrWidthASCII((MM_GetText(consoleplayer.mmlang, "HUD_MINIGAME", "PRESS").." "..MM_GetText(consoleplayer.mmlang, "HUD_MINIGAME", "LEAVE")), 0, 32768)), 0, charset, (MM_GetText(consoleplayer.mmlang, "HUD_MINIGAME", "PRESS").." "..MM_GetText(consoleplayer.mmlang, "HUD_MINIGAME", "LEAVE")), V_SNAPTOTOP|V_SNAPTORIGHT|v.localTransFlag(), true) --FU/2 end --TIME diff --git a/SRC/LUA/MINIGAMES/MINIGAMES.LUA b/SRC/LUA/MINIGAMES/MINIGAMES.LUA index 62985c4..e2b086e 100644 --- a/SRC/LUA/MINIGAMES/MINIGAMES.LUA +++ b/SRC/LUA/MINIGAMES/MINIGAMES.LUA @@ -234,7 +234,11 @@ addHook("PlayerThink", function(p) if ((p.mmhelp) and (p.mmhelp.active)) return end if (not p.custom3pressed) if (p.minigame) - if (not p.minigametimeout) p.minigame = 0 end + if (not p.minigametimeout) then p.minigame = 0 end + if (MM.minigame) + MM.duelplrs[1].minigame = 0 + MM.duelplrs[2].minigame = 0 + end else p.minigame = 1 p.minigametimeout = 105 diff --git a/SRC/LUA/WEAPONS.LUA b/SRC/LUA/WEAPONS.LUA index eeeb997..8417ff4 100644 --- a/SRC/LUA/WEAPONS.LUA +++ b/SRC/LUA/WEAPONS.LUA @@ -197,7 +197,7 @@ addHook("PlayerThink", function(p) --this whole hook is a port of P_DoFiring() f p.powers[pw_infinityring] = $ - 1 else -- RED RING -- - if ((p.role != ROLE_INNOCENT) and (p.rings > 0)) or ((p.role == ROLE_INNOCENT) and (((p.skin == 1) or (p.skin == 5) and (p.rings > 49)) or ((consoleplayer.skin != 1) and (p.rings > 99)))) + if ((p.role != ROLE_INNOCENT) and (p.rings > 0)) or ((p.role == ROLE_INNOCENT) and (((p.skin == 1 or p.skin == 5) and p.rings > 49) or (p.skin != 1 and p.rings > 99))) P_SetWeaponDelay(p, MM.weapons[-1][4]) mo = P_SpawnPlayerMissile(p.mo, MM.weapons[-1][2], MM.weapons[-1][3]) if (p.role == ROLE_INNOCENT) --Weapon shot/use costs 100 rings for Innocents