Skip to content

Instantly share code, notes, and snippets.

@jmfergeau
Last active June 5, 2021 13:28
Show Gist options
  • Save jmfergeau/8b9b5d8f967a585676f65e34ccff4267 to your computer and use it in GitHub Desktop.
Save jmfergeau/8b9b5d8f967a585676f65e34ccff4267 to your computer and use it in GitHub Desktop.
Brutal DOOM Checker
#include "zcommon.acs"
///////////////////////////////////////////////////////////////////
/*
BRUTAL DOOM CHECK.
This will detect when, in your zdoom mod, if Brutal Doom has been added too
and, for some reason, you want to discourage the player to do so.
The script simply looks for two decorate classes that are in all versions
of BD. If they're both detected. a message will display. Feel free to
change for your likings.
*/
#DEFINE S7_BrutalDoomCompatibility 912
#define MIN_TID (-32768)
// Because we need to make a function for this. Yeah rly.
function bool ClassExists(str class)
{
int tid = UniqueTID(MIN_TID, 0);
if (SpawnForced(class, 0, 0, 0, tid))
{
Thing_Remove(tid);
return true;
}
return false;
}
script S7_BrutalDoomCompatibility ENTER {
// Not needed or desired in TitleMaps.
if (gameType () == game_Title_Map)
terminate;
// Checks for the existence of two classes that can be found in BD
if (ClassExists("Brutal_Blood") && ClassExists("BrutalPistol"))
{
// Put your own code here
Print(s:"BRUTAL DOOM DETECTED");
}
}
///////////////////////////////////////////////////////////////////
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment