Skip to content

Commit

Permalink
Merge pull request #118 from MissLavender-LQ/cypress-e0text
Browse files Browse the repository at this point in the history
QC: Enhance Intermission+Epilogue Implementation, Add Episode 0 Epilogue.
  • Loading branch information
MissLavender-LQ committed Mar 10, 2024
2 parents e14167d + 0c6e4a8 commit 55588ee
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 51 deletions.
97 changes: 46 additions & 51 deletions qcsrc/client.qc
Expand Up @@ -171,6 +171,28 @@ void() GotoNextMap =
changelevel (nextmap);
};

// cypress (09 mar 2024) -- use struct for epilogue levels.
var struct
{
string map_name;
float cd_track;
string epilogue_text;
string freeware_text;
} intermission_levels[] =
{

#ifdef __LIBREQUAKE__

{"maps/e0m7.bsp", 2, LOC_EPILOGUE_0, __NULL__},

#endif // __LIBREQUAKE__

{"maps/e1m7.bsp", 2, LOC_EPILOGUE_1, LOC_EPILOGUE_1_FREEWARE},
{"maps/e2m6.bsp", 2, LOC_EPILOGUE_2, __NULL__},
{"maps/e3m6.bsp", 2, LOC_EPILOGUE_3, __NULL__},
{"maps/e4m7.bsp", 2, LOC_EPILOGUE_4, __NULL__}
};
// --cypress

void() ExitIntermission =
{
Expand All @@ -189,62 +211,29 @@ void() ExitIntermission =
//
if (intermission_running == 2)
{
if (world.model == "maps/e1m7.bsp")
// cypress (09 mar 2024) -- use struct for epilogue levels.
for (float i = 0; i < intermission_levels.length; i++)
{
WriteByte (MSG_ALL, SVC_CDTRACK);
WriteByte (MSG_ALL, 2);
WriteByte (MSG_ALL, 3);

if (!cvar("registered"))
if (world.model == intermission_levels[i].map_name)
{
WriteByte (MSG_ALL, SVC_FINALE);
WriteString (MSG_ALL, LOC_EPILOGUE_1_FREEWARE);
}
WriteByte (MSG_ALL, SVC_CDTRACK);
WriteByte (MSG_ALL, intermission_levels[i].cd_track); // [cdtrack]
WriteByte (MSG_ALL, 3); // [looptrack], unused.

else
{
WriteByte (MSG_ALL, SVC_FINALE);
WriteString (MSG_ALL, LOC_EPILOGUE_1);
}

return;
}

else if (world.model == "maps/e2m6.bsp")
{
WriteByte (MSG_ALL, SVC_CDTRACK);
WriteByte (MSG_ALL, 2);
WriteByte (MSG_ALL, 3);
WriteByte(MSG_ALL, SVC_FINALE);

WriteByte (MSG_ALL, SVC_FINALE);
WriteString (MSG_ALL, LOC_EPILOGUE_2);

return;
}

else if (world.model == "maps/e3m6.bsp")
{
WriteByte (MSG_ALL, SVC_CDTRACK);
WriteByte (MSG_ALL, 2);
WriteByte (MSG_ALL, 3);

WriteByte (MSG_ALL, SVC_FINALE);
WriteString (MSG_ALL, LOC_EPILOGUE_3);

return;
}

else if (world.model == "maps/e4m7.bsp")
{
WriteByte (MSG_ALL, SVC_CDTRACK);
WriteByte (MSG_ALL, 2);
WriteByte (MSG_ALL, 3);

WriteByte (MSG_ALL, SVC_FINALE);
WriteString (MSG_ALL, LOC_EPILOGUE_4);

return;
if (!cvar("registered") && intermission_levels[i].freeware_text != __NULL__)
{
WriteString(MSG_ALL, intermission_levels[i].freeware_text);
}
else
{
WriteString(MSG_ALL, intermission_levels[i].epilogue_text);
}
return;
}
}
// --cypress

GotoNextMap();
}
Expand Down Expand Up @@ -1314,7 +1303,13 @@ called when a player dies
void(entity targ, entity attacker) ClientObituary =
{
local float rnum;

#ifdef __LIBREQUAKE__

local float rnum2;

#endif // __LIBREQUAKE__

local string deathstring, deathstring2;
deathstring = deathstring2 = string_null;
// From GPL QW source
Expand Down
4 changes: 4 additions & 0 deletions qcsrc/localized_text.qc
Expand Up @@ -29,10 +29,14 @@

EPISODE EPILOGUE STRINGS

These strings in-engine have a 40 character limit before
truncation.

==============================================================================*/

#ifdef __LIBREQUAKE__

#define LOC_EPILOGUE_0 "\nAs the ethereal essence of your very\nbeing drifts through time and space,\nyou experience relentless calm and\nserene determination. You embrace the\nliminal, formless nature of your\nexistence within the amorphous expanse\nbetween realities.\n\nSuspended between the veils of life\nand death, among the realm of celestial\ndissolution, you wait to be called upon\nagain. To regain your corporeal form\nand step into the crucible of fate.\nTo finish your task and keep at bay the\nonslaught of cosmic horrors.\n"
#define LOC_EPILOGUE_1 "EPISODE 1 COMPLETION TEXT GOES HERE"
#define LOC_EPILOGUE_1_FREEWARE "EPISODE 1 COMPLETION TEXT GOES HERE"
#define LOC_EPILOGUE_2 "EPISODE 2 COMPLETION TEXT GOES HERE"
Expand Down

0 comments on commit 55588ee

Please sign in to comment.