diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 39272c462..89dc57988 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -8213,6 +8213,8 @@ const uint8_t CheatFunctionIDs[] = CHEAT_DEBUG, }; +char const * const g_NAMMattCheatQuote = "Matt Saettler. matts@saettler.com"; + static void doinvcheat(int32_t invidx, int32_t defaultnum, int32_t event) { defaultnum = VM_OnEventWithReturn(event, g_player[myconnectindex].ps->i, myconnectindex, defaultnum); @@ -8264,7 +8266,11 @@ GAME_STATIC void G_DoCheats(void) if (VOLUMEONE && !vol1inited) { - Bstrcpy(CheatStrings[2],"scotty##"); + // change "scotty###" to "scotty##" + uint32_t const warpend = Bstrlen(CheatStrings[2]); + if (strcmp(&CheatStrings[2][warpend-3], "###") == 0) + CheatStrings[2][warpend-1] = '\0'; + Bstrcpy(CheatStrings[6],""); vol1inited = 1; } @@ -8597,7 +8603,16 @@ FOUNDCHEAT: return; case CHEAT_TODD: - P_DoQuote(QUOTE_CHEAT_TODD,g_player[myconnectindex].ps); + if (NAM) + { + Bstrcpy(ScriptQuotes[QUOTE_RESERVED4], g_NAMMattCheatQuote); + P_DoQuote(QUOTE_RESERVED4,g_player[myconnectindex].ps); + } + else + { + P_DoQuote(QUOTE_CHEAT_TODD,g_player[myconnectindex].ps); + } + end_cheat(); return; @@ -11621,6 +11636,65 @@ int32_t app_main(int32_t argc, const char **argv) Bstrcpy(GametypeNames[2],"GruntMatch (No Spawn)"); } + // KEEPINSYNC: NAM_WW2GI_CHEATS + if (WW2GI) + { + CheatKeys[0] = CheatKeys[1] = sc_W; + + Bstrcpy(CheatStrings[0], "2god"); + Bstrcpy(CheatStrings[1], "2blood"); + Bstrcpy(CheatStrings[2], "2level###"); + Bstrcpy(CheatStrings[3], "2coords"); + Bstrcpy(CheatStrings[4], "2view"); + Bstrcpy(CheatStrings[5], ""); + Bstrcpy(CheatStrings[7], ""); + Bstrcpy(CheatStrings[8], ""); + Bstrcpy(CheatStrings[9], "2rate"); + Bstrcpy(CheatStrings[10], "2skill"); + Bstrcpy(CheatStrings[11], ""); + Bstrcpy(CheatStrings[12], ""); + Bstrcpy(CheatStrings[13], ""); + Bstrcpy(CheatStrings[16], "2matt"); + Bstrcpy(CheatStrings[17], "2showmap"); + Bstrcpy(CheatStrings[18], "2ryan"); + Bstrcpy(CheatStrings[19], ""); + Bstrcpy(CheatStrings[20], "2clip"); + Bstrcpy(CheatStrings[21], "2weapons"); + Bstrcpy(CheatStrings[22], "2inventory"); + Bstrcpy(CheatStrings[23], ""); + Bstrcpy(CheatStrings[24], "2debug"); + Bstrcpy(CheatStrings[26], "2cgs"); + } + else if (NAM) + { + CheatKeys[0] = sc_N; + CheatKeys[1] = sc_V; + + Bstrcpy(CheatStrings[0], "acaleb"); + Bstrcpy(CheatStrings[1], "ablood"); + Bstrcpy(CheatStrings[2], "alevel###"); + Bstrcpy(CheatStrings[3], "acoords"); + Bstrcpy(CheatStrings[4], "aview"); + Bstrcpy(CheatStrings[5], ""); + Bstrcpy(CheatStrings[7], ""); + Bstrcpy(CheatStrings[8], ""); + Bstrcpy(CheatStrings[9], "arate"); + Bstrcpy(CheatStrings[10], "askill"); + Bstrcpy(CheatStrings[11], ""); + Bstrcpy(CheatStrings[12], "ahyper"); + Bstrcpy(CheatStrings[13], ""); + Bstrcpy(CheatStrings[16], "amatt"); + Bstrcpy(CheatStrings[17], "ashowmap"); + Bstrcpy(CheatStrings[18], "agod"); + Bstrcpy(CheatStrings[19], ""); + Bstrcpy(CheatStrings[20], "aclip"); + Bstrcpy(CheatStrings[21], "aweapons"); + Bstrcpy(CheatStrings[22], "ainventory"); + Bstrcpy(CheatStrings[23], ""); + Bstrcpy(CheatStrings[24], "adebug"); + Bstrcpy(CheatStrings[26], "acgs"); + } + if (!usecwd) G_CleanupSearchPaths(); diff --git a/polymer/eduke32/source/game.h b/polymer/eduke32/source/game.h index f40d6eb02..8fc8685ae 100644 --- a/polymer/eduke32/source/game.h +++ b/polymer/eduke32/source/game.h @@ -264,6 +264,8 @@ extern const char *s_buildDate; extern const char *g_rtsNamePtr; extern char CheatStrings[][MAXCHEATLEN]; +extern char const * const g_NAMMattCheatQuote; + extern char boardfilename[BMAX_PATH], currentboardfilename[BMAX_PATH]; extern char boardfilename[BMAX_PATH]; diff --git a/polymer/eduke32/source/menus.c b/polymer/eduke32/source/menus.c index 9d7fb0dcb..8d99b95c1 100644 --- a/polymer/eduke32/source/menus.c +++ b/polymer/eduke32/source/menus.c @@ -1752,8 +1752,35 @@ static void M_PreMenu(MenuID_t cm) for (i = 0; i < NUMCHEATFUNCS; i++) { + uint32_t cheatmask = cl_cheatmask & (1< 2 && tempbuf[0] == scantoasc[CheatKeys[0]] && tempbuf[1] == scantoasc[CheatKeys[1]]) { for (size_t i = 0; i < NUMCHEATS; i++) - if (!Bstrcmp(tempbuf+2, CheatStrings[i])) + if (M_CheatStringMatch(tempbuf+2, CheatStrings[i])) { cheatID = i; break; @@ -3191,15 +3226,33 @@ static void M_MenuTextFormSubmit(char *input) S_PlaySound(KICK_HIT); break; case CHEAT_SCOTTY: - M_Cheat_Warp(numberpos); + { + char const * const numberpos = Bstrchr(CheatStrings[CHEAT_SCOTTY], '#'); + if (numberpos == NULL) + { + S_PlaySound(KICK_HIT); + break; + } + + M_Cheat_Warp(input + (numberpos - CheatStrings[CHEAT_SCOTTY]) + 2); if (g_player[myconnectindex].ps->gm&MODE_MENU) S_PlaySound(DUKE_GET); break; + } case CHEAT_SKILL: - M_Cheat_Skill(numberpos); + { + char const * const numberpos = Bstrchr(CheatStrings[CHEAT_SKILL], '#'); + if (numberpos == NULL) + { + S_PlaySound(KICK_HIT); + break; + } + + M_Cheat_Skill(input + (numberpos - CheatStrings[CHEAT_SKILL]) + 2); if (g_player[myconnectindex].ps->gm&MODE_MENU) S_PlaySound(DUKE_GET); break; + } default: M_Cheat(cheatID); S_PlaySound(DUKE_GET); @@ -3209,7 +3262,8 @@ static void M_MenuTextFormSubmit(char *input) if (cheatID >= 0) cl_cheatmask |= CheatFunctionFlags[cheatID]; - if ((cl_cheatmask & (1<