diff options
author | Paul Gilbert | 2018-04-07 16:29:43 -0400 |
---|---|---|
committer | Paul Gilbert | 2018-04-07 16:30:04 -0400 |
commit | a42ca33a1cd43e804018d88d5c272859ddecb878 (patch) | |
tree | f4cee84a2587cbb8d782dfc17e4c2ba13e441fde /engines | |
parent | db1b7b0e1f128ab866d1a08b4eb16c54851b217a (diff) | |
download | scummvm-rg350-a42ca33a1cd43e804018d88d5c272859ddecb878.tar.gz scummvm-rg350-a42ca33a1cd43e804018d88d5c272859ddecb878.tar.bz2 scummvm-rg350-a42ca33a1cd43e804018d88d5c272859ddecb878.zip |
XEEN: Add 'strength' debugger command
Diffstat (limited to 'engines')
-rw-r--r-- | engines/xeen/combat.cpp | 3 | ||||
-rw-r--r-- | engines/xeen/debugger.cpp | 9 | ||||
-rw-r--r-- | engines/xeen/debugger.h | 6 |
3 files changed, 17 insertions, 1 deletions
diff --git a/engines/xeen/combat.cpp b/engines/xeen/combat.cpp index 397370f41f..0ac80650eb 100644 --- a/engines/xeen/combat.cpp +++ b/engines/xeen/combat.cpp @@ -1372,6 +1372,7 @@ void Combat::attack(Character &c, RangeType rangeType) { } void Combat::attack2(int damage, RangeType rangeType) { + Debugger &debugger = *_vm->_debugger; Interface &intf = *_vm->_interface; Map &map = *_vm->_map; Party &party = *_vm->_party; @@ -1383,6 +1384,8 @@ void Combat::attack2(int damage, RangeType rangeType) { if (!ccNum && damage && rangeType != RT_SINGLE && monster._spriteId == 89) damage = 0; + if (debugger._superStrength) + damage = 10000; if (!damage) { sound.playSound(_missVoc, 1); diff --git a/engines/xeen/debugger.cpp b/engines/xeen/debugger.cpp index 978baf1715..322833eed6 100644 --- a/engines/xeen/debugger.cpp +++ b/engines/xeen/debugger.cpp @@ -45,7 +45,7 @@ static int strToInt(const char *s) { /*------------------------------------------------------------------------*/ Debugger::Debugger(XeenEngine *vm) : GUI::Debugger(), _vm(vm), - _spellId(-1), _invincible(false), _intangible(false) { + _spellId(-1), _invincible(false), _intangible(false), _superStrength(false) { registerCmd("continue", WRAP_METHOD(Debugger, cmdExit)); registerCmd("spell", WRAP_METHOD(Debugger, cmdSpell)); registerCmd("spells", WRAP_METHOD(Debugger, cmdSpells)); @@ -55,6 +55,7 @@ Debugger::Debugger(XeenEngine *vm) : GUI::Debugger(), _vm(vm), registerCmd("map", WRAP_METHOD(Debugger, cmdMap)); registerCmd("pos", WRAP_METHOD(Debugger, cmdPos)); registerCmd("invincible", WRAP_METHOD(Debugger, cmdInvincible)); + registerCmd("strength", WRAP_METHOD(Debugger, cmdSuperStrength)); registerCmd("intangible", WRAP_METHOD(Debugger, cmdIntangible)); } @@ -200,6 +201,12 @@ bool Debugger::cmdInvincible(int argc, const char **argv) { return true; } +bool Debugger::cmdSuperStrength(int argc, const char **argv) { + _superStrength = (argc < 2) || strcmp(argv[1], "off"); + debugPrintf("Super-powered attacks are %s\n", _superStrength ? "on" : "off"); + return true; +} + bool Debugger::cmdIntangible(int argc, const char **argv) { _intangible = (argc < 2) || strcmp(argv[1], "off"); debugPrintf("Intangibility is %s\n", _intangible ? "on" : "off"); diff --git a/engines/xeen/debugger.h b/engines/xeen/debugger.h index c459dc1bfa..48eb8f35f6 100644 --- a/engines/xeen/debugger.h +++ b/engines/xeen/debugger.h @@ -76,12 +76,18 @@ private: bool cmdInvincible(int argc, const char **argv); /** + * Flags whether to make the party super-strength attacks + */ + bool cmdSuperStrength(int argc, const char **argv); + + /** * Flags whether to make the party invincible */ bool cmdIntangible(int argc, const char **argv); public: bool _invincible; bool _intangible; + bool _superStrength; public: Debugger(XeenEngine *vm); |