diff --git a/Source/debug.cpp b/Source/debug.cpp index 29686305a..79da713e3 100644 --- a/Source/debug.cpp +++ b/Source/debug.cpp @@ -344,6 +344,28 @@ std::string DebugCmdExit(const std::string_view parameter) return "See you again my Lord."; } +std::string DebugCmdArrow(const std::string_view parameter) +{ + auto &myPlayer = Players[MyPlayerId]; + + myPlayer._pIFlags &= ~ISPL_FIRE_ARROWS; + myPlayer._pIFlags &= ~ISPL_LIGHT_ARROWS; + + if (parameter == "normal") { + // we removed the parameter at the top + } else if (parameter == "fire") { + myPlayer._pIFlags |= ISPL_FIRE_ARROWS; + } else if (parameter == "lightning") { + myPlayer._pIFlags |= ISPL_LIGHT_ARROWS; + } else if (parameter == "explosion") { + myPlayer._pIFlags |= (ISPL_FIRE_ARROWS | ISPL_LIGHT_ARROWS); + } else { + return "Unknown is sometimes similar to nothing (unkown effect)."; + } + + return "I can shoot any arrow."; +} + std::vector DebugCmdList = { { "help", "Prints help overview or help for a specific command.", "({command})", &DebugCmdHelp }, { "give gold", "Fills the inventory with gold.", "", &DebugCmdGiveGoldCheat }, @@ -362,6 +384,7 @@ std::vector DebugCmdList = { { "dropunique", "Attempts to generate unique item {name}.", "{name}", &DebugCmdGenerateUniqueItem }, { "dropitem", "Attempts to generate item {name}.", "{name}", &DebugCmdGenerateItem }, { "exit", "Exits the game.", "", &DebugCmdExit }, + { "arrow", "Changes arrow effect (normal, fire, lightning, explosion).", "{effect}", &DebugCmdArrow }, }; } // namespace diff --git a/Source/diablo.cpp b/Source/diablo.cpp index 94ca38cde..a2f2ee5c4 100644 --- a/Source/diablo.cpp +++ b/Source/diablo.cpp @@ -140,9 +140,6 @@ bool forceSpawn; bool forceDiablo; int sgnTimeoutCurs; bool gbShowIntro = true; -#ifdef _DEBUG -int arrowdebug = 0; -#endif /** To know if these things have been done when we get to the diablo_deinit() function */ bool was_archives_init = false; /** To know if surfaces have been initialized or not */ @@ -580,26 +577,6 @@ void PressChar(char vkey) } return; #ifdef _DEBUG - case ')': - case '0': - if (debug_mode_key_inverted_v) { - if (arrowdebug > 2) { - arrowdebug = 0; - } - auto &myPlayer = Players[MyPlayerId]; - if (arrowdebug == 0) { - myPlayer._pIFlags &= ~ISPL_FIRE_ARROWS; - myPlayer._pIFlags &= ~ISPL_LIGHT_ARROWS; - } - if (arrowdebug == 1) { - myPlayer._pIFlags |= ISPL_FIRE_ARROWS; - } - if (arrowdebug == 2) { - myPlayer._pIFlags |= ISPL_LIGHT_ARROWS; - } - arrowdebug++; - } - return; case 'a': if (debug_mode_key_inverted_v) { spelldata[SPL_TELEPORT].sTownSpell = true;