Skip to content

Commit

Permalink
Fix minigame-related mistakes
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonardoTheMutant committed Oct 14, 2024
1 parent 5a2bf50 commit 5e76232
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion SRC/LUA/HUD.LUA
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
10 changes: 5 additions & 5 deletions SRC/LUA/MINIGAMES/HUD_MINIGAMES.LUA
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion SRC/LUA/MINIGAMES/MINIGAMES.LUA
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion SRC/LUA/WEAPONS.LUA
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5e76232

Please sign in to comment.