From ed6e7a661bffe74933e065ccec8b05e7f43dcc7a Mon Sep 17 00:00:00 2001 From: qndel Date: Sat, 21 Aug 2021 13:57:42 +0200 Subject: [PATCH] debug command: refill --- Source/debug.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Source/debug.cpp b/Source/debug.cpp index 8e7530d70..63497e231 100644 --- a/Source/debug.cpp +++ b/Source/debug.cpp @@ -6,6 +6,7 @@ #ifdef _DEBUG +#include "control.h" #include "cursor.h" #include "debug.h" #include "engine/cel_sprite.hpp" @@ -258,6 +259,19 @@ std::string DebugCmdSetSpellsLevel(const std::string_view parameter) return "Knowledge is power."; } +std::string DebugCmdRefillHealthMana(const std::string_view parameter) +{ + auto &myPlayer = Players[MyPlayerId]; + myPlayer._pMana = myPlayer._pMaxMana; + myPlayer._pManaBase = myPlayer._pMaxManaBase; + myPlayer._pHitPoints = myPlayer._pMaxHP; + myPlayer._pHPBase = myPlayer._pMaxHPBase; + drawhpflag = true; + drawmanaflag = true; + + return "Ready for more."; +} + std::vector DebugCmdList = { { "help", "Prints help overview or help for a specific command.", "({command})", &DebugCmdHelp }, { "give gold", "Fills the inventory with gold.", "", &DebugCmdGiveGoldCheat }, @@ -271,6 +285,7 @@ std::vector DebugCmdList = { { "god", "Togggles godmode.", "", &DebugCmdGodMode }, { "r_drawvision", "Togggles vision debug rendering.", "", &DebugCmdVision }, { "r_fullbright", "Toggles whether light shading is in effect.", "", &DebugCmdLighting }, + { "refill", "Refills health and mana.", "", &DebugCmdRefillHealthMana }, }; } // namespace