Browse Source

Debug: Add maxstats and minstats command (#5539)

* Debug: Add maxstats command

Maxes all player stats

* clang

* Remove network command

* Add minstats command

* Improve functions
pull/5542/head
KPhoenix 3 years ago committed by GitHub
parent
commit
c16b4932b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 22
      Source/debug.cpp

22
Source/debug.cpp

@ -532,6 +532,26 @@ std::string DebugCmdLevelUp(const string_view parameter)
return "New experience leads to new insights.";
}
std::string DebugCmdMaxStats(const string_view parameter)
{
Player &myPlayer = *MyPlayer;
ModifyPlrStr(myPlayer, myPlayer.GetMaximumAttributeValue(CharacterAttribute::Strength) - myPlayer._pBaseStr);
ModifyPlrMag(myPlayer, myPlayer.GetMaximumAttributeValue(CharacterAttribute::Magic) - myPlayer._pBaseMag);
ModifyPlrDex(myPlayer, myPlayer.GetMaximumAttributeValue(CharacterAttribute::Dexterity) - myPlayer._pBaseDex);
ModifyPlrVit(myPlayer, myPlayer.GetMaximumAttributeValue(CharacterAttribute::Vitality) - myPlayer._pBaseVit);
return "Who needs elixirs anyway?";
}
std::string DebugCmdMinStats(const string_view parameter)
{
Player &myPlayer = *MyPlayer;
ModifyPlrStr(myPlayer, -myPlayer._pBaseStr);
ModifyPlrMag(myPlayer, -myPlayer._pBaseMag);
ModifyPlrDex(myPlayer, -myPlayer._pBaseDex);
ModifyPlrVit(myPlayer, -myPlayer._pBaseVit);
return "From hero to zero.";
}
std::string DebugCmdSetSpellsLevel(const string_view parameter)
{
int level = std::max(0, atoi(parameter.data()));
@ -989,6 +1009,8 @@ std::vector<DebugCmdItem> DebugCmdList = {
{ "help", "Prints help overview or help for a specific command.", "({command})", &DebugCmdHelp },
{ "give gold", "Fills the inventory with gold.", "", &DebugCmdGiveGoldCheat },
{ "give xp", "Levels the player up (min 1 level or {levels}).", "({levels})", &DebugCmdLevelUp },
{ "maxstats", "Sets all stat values to maximum.", "", &DebugCmdMaxStats },
{ "minstats", "Sets all stat values to minimum.", "", &DebugCmdMinStats },
{ "setspells", "Set spell level to {level} for all spells.", "{level}", &DebugCmdSetSpellsLevel },
{ "take gold", "Removes all gold from inventory.", "", &DebugCmdTakeGoldCheat },
{ "give quest", "Enable a given quest.", "({id})", &DebugCmdQuest },

Loading…
Cancel
Save