// this is used to detect various pwads, and adjust the game options
/* usage:
  // names should be unique! later name will override!
  detector "some name" {
    info {
      // message on detection
      showmessage = <true|false>; // show message on detection? (default: true)
      type = "mod"; // just a string; default: "mod"
      // message will look like: "Detected ${type}: <section name>"
    }

    // preconditions; all fields are optional
    preconditions {
      zscript = <true|false|dontcare>; // check for zscript lumps (default: dontcare)
      gametitle = "glob"; // check "gametitle" from GAMEINFO lump (globs allowed)
      // all defined files and lumps are REQUIRED
      // size and md5 fields are optional
      file { name = "name"; size = int; md5 = "md5sum"; }
      lump { name = "name"; size = int; md5 = "md5sum"; }
    }

    // options applied on succesfull detection
    options {
      //allowzscript = <true|false>; // should zscript be allowed (ignored), or not? (default: false): NOT IMPLEMENTED YET
      nomore = <true|false>; // stop detection on hit? (default: false)
      gamename = "name"; // force game name (default: don't force)
      nakedbase = <true|false>; // disable autoloads? (default: false)
      bdw = <true|false|dontcare>; // bdw mod: force-enable, force-disable, don't change (default: dontcare)
      gore = <true|false|dontcare>; // gore mod: force-enable, force-disable, don't change (default: dontcare)
      modblood = <true|false|nogore>; // enable mod blood replacement? (default: true); "nogore" means "enable only if there's no gore mod"
      iwad = <true|false>; // for some TCs game iwads should be disabled (default: true)
      sprofslump = <true|false>; // disable basepak sprofs lumps (required for some TCs); forced to "true" by "iwad = false;" (and should be reset explicitly)
      acstype = <default|zandronum|zdoom>;
      ignoreplayerspeed = <true|false>; // ignore player speed setting in playerpawn
      ignoreplayerclasses = <list>; // ignore given player classes from mapinfo/keyconf; list is "name, name"
    }
  }
*/


detector "Legion Of Bones" {
  info {
    type = "mod";
  }

  preconditions {
    zscript = true;
    //file { name = "zscript"; size = 186; md5 = "3607cf1f311c2883e459321c34e3ef1b"; }
    file { name = "credits"; size = 2320; md5 = "8fe2cdd80f31556963b1d8fa07471ba2"; }
  }

  options {
    addmod = "lobfix"; // do not use this if you don't know what you're doing! (i.e. don't use this at all)
  }
}


detector "SkullDash EE" {
  info {
    type = "mod";
  }

  preconditions {
    file { name = "maps/titlemap.wad"; size = 286046; md5 = "def4f5e00c60727aeb3a25d1982cfcf1"; }
  }

  options {
    addmod = "skeehud"; // do not use this if you don't know what you're doing! (i.e. don't use this at all)
  }
}


detector "Boringternity" {
  info {
    type = "pwad";
    warning = "Eviternity is not fully supported.\nYou may encounter various problems.";
  }

  preconditions {
    zscript = true;
    lump { name = "zscript"; size = 13153; md5 = "9e53e2d46de1d0f6cfc004c74e1660cf"; }
  }
}


detector "Harmony v1.1" {
  info {
    type = "TC";
  }

  preconditions {
    zscript = false;
    lump { name = "dehacked"; size = 26287; md5 = "3446842b93dfa37075a238ccd5b0f29c"; }
  }

  options {
    gamename = "doom2";
    nakedbase = true;
    bdw = false;
    iwad = false;
    nomore = true; // no more mods
  }
}


detector "The Adventures of Square/Zandro, ported by TDRR" {
  info {
    type = "TC";
  }

  preconditions {
    zscript = true;
    gametitle = "The Adventures of Square*";
    file { name = "SQU-SWE1.txt"; }
    file { name = "GAMEINFO.sq"; }
    file { name = "acs/sqcommon.o"; }
    file { name = "acs/sq_jump.o"; }
    file { name = "DECORATE.base"; }
  }

  options {
    gamename = "doom2";
    nakedbase = true;
    bdw = false;
    gore = false;
    sprofslump = false;
    nomore = true; // no more mods
  }
}


detector "Hunter's Moon" {
  info {
    type = "mod";
  }

  preconditions {
    zscript = false;
    gametitle = "*Hunter's Moon*";
  }

  options {
    nakedbase = true;
    bdw = false;
  }
}


detector "Green Shit" {
  info {
    type = "pwad";
  }

  preconditions {
    zscript = false;
    file { name = "MAPINFO.txt"; size = 2306; md5 = "47b7e6bcc4024d428909a0f3f7b05126"; }
  }

  options {
    gamename = "plutonia";
  }
}


detector "CzechBox/Release" {
  info {
    type = "pwad";
    warning = "CzechBox is not supported.\nPlease, do not report any problems.\nThank you.";
  }

  preconditions {
    lump { name = "credit"; size = 68168; md5 = "8899d7193f124737317f35ef7cb29c14"; }
  }
}


detector "CzechBox/v07e" {
  info {
    type = "pwad";
    warning = "CzechBox is not supported.\nPlease, do not report any problems.\nThank you.";
  }

  preconditions {
    lump { name = "credit"; size = 68168; md5 = "1f5be046b3014c074e5e74b47d4ecb9a"; }
  }
}


detector "HDoom" {
  info {
    type = "pwad";
  }

  preconditions {
    file { name = "readme.txt"; size = 1201; md5 = "b805dec5773675725e03edbf35f21792"; }
  }

  options {
    acstype = zandronum;
  }
}


detector "ZPack" {
  info {
    type = "pwad";
  }

  preconditions {
    file { name = "mapinfo.txt"; size = 6278; md5 = "348daac825f73f771add8b693a34bf58"; }
  }

  options {
    gamename = "doom2";
  }
}


detector "TNT: Revilution" {
  info {
    type = "pwad";
  }

  preconditions {
    file { name = "mapinfo"; size = 4633; md5 = "6ef6f3bdc09a7dc7855e9a5502f0b784"; }
  }

  options {
    gamename = "tnt";
  }
}
