[Scummvm-git-logs] scummvm master -> a42ca33a1cd43e804018d88d5c272859ddecb878

dreammaster dreammaster at scummvm.org
Sat Apr 7 22:30:23 CEST 2018


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
a42ca33a1c XEEN: Add 'strength' debugger command


Commit: a42ca33a1cd43e804018d88d5c272859ddecb878
    https://github.com/scummvm/scummvm/commit/a42ca33a1cd43e804018d88d5c272859ddecb878
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-04-07T16:30:04-04:00

Commit Message:
XEEN: Add 'strength' debugger command

Changed paths:
    engines/xeen/combat.cpp
    engines/xeen/debugger.cpp
    engines/xeen/debugger.h


diff --git a/engines/xeen/combat.cpp b/engines/xeen/combat.cpp
index 397370f..0ac8065 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 978baf1..322833e 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 c459dc1..48eb8f3 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);
 





More information about the Scummvm-git-logs mailing list