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

athrxx noreply at scummvm.org
Mon Jul 22 13:12:39 UTC 2024


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

Summary:
165a231d4c KYRA: (EOB) - formatting
29cafca8bf KYRA: (EOB) - add launcher checkbox for more faithful AD&D rules
f80a82ed13 KYRA: (EOB) - add some optional add rule enhancements


Commit: 165a231d4c6299126c7d2b612c133d3b9e76d830
    https://github.com/scummvm/scummvm/commit/165a231d4c6299126c7d2b612c133d3b9e76d830
Author: athrxx (athrxx at scummvm.org)
Date: 2024-07-22T15:06:55+02:00

Commit Message:
KYRA: (EOB) - formatting

Changed paths:
    engines/kyra/engine/eobcommon.cpp


diff --git a/engines/kyra/engine/eobcommon.cpp b/engines/kyra/engine/eobcommon.cpp
index 08574a0d5c1..bdd6c7d0143 100644
--- a/engines/kyra/engine/eobcommon.cpp
+++ b/engines/kyra/engine/eobcommon.cpp
@@ -1041,9 +1041,9 @@ int EoBCoreEngine::generateCharacterHitpointsByLevel(int charIndex, int levelInd
 		int d = getCharacterClassType(c->cClass, i);
 
 		if (c->level[i] <= (d >= 0 ? _hpIncrPerLevel[6 + d] : 0))
-			h += rollDice(1, (d >= 0) ? _hpIncrPerLevel[d] : 0);
+			h += rollDice(1, d >= 0 ? _hpIncrPerLevel[d] : 0);
 		else
-			h += (d >= 0 ?_hpIncrPerLevel[12 + d] : 0);
+			h += (d >= 0 ? _hpIncrPerLevel[12 + d] : 0);
 
 		h += m;
 	}


Commit: 29cafca8bf18fa6d6739e4d54fb7aa4c03b66107
    https://github.com/scummvm/scummvm/commit/29cafca8bf18fa6d6739e4d54fb7aa4c03b66107
Author: athrxx (athrxx at scummvm.org)
Date: 2024-07-22T15:09:44+02:00

Commit Message:
KYRA: (EOB) - add launcher checkbox for more faithful AD&D rules

(community suggestion)

I have been told that the implementation is  not always in line with the
AD&D 2nd edition handbook. This switch allows to have more faithful
rules if we implement them as an alternative.

Changed paths:
    engines/kyra/detection.h
    engines/kyra/detection_tables.h
    engines/kyra/engine/eobcommon.cpp
    engines/kyra/engine/eobcommon.h
    engines/kyra/metaengine.cpp


diff --git a/engines/kyra/detection.h b/engines/kyra/detection.h
index 793ca500409..21e4e2d7e4a 100644
--- a/engines/kyra/detection.h
+++ b/engines/kyra/detection.h
@@ -82,6 +82,7 @@ struct KYRAGameDescription {
 
 #define GAMEOPTION_EOB_HPGRAPHS   GUIO_GAMEOPTIONS6
 #define GAMEOPTION_EOB_MOUSESWAP  GUIO_GAMEOPTIONS7
+#define GAMEOPTION_EOB_ADDRULES   GUIO_GAMEOPTIONS9
 
 } // End of anonymous namespace
 
diff --git a/engines/kyra/detection_tables.h b/engines/kyra/detection_tables.h
index ed76c569a12..53171996895 100644
--- a/engines/kyra/detection_tables.h
+++ b/engines/kyra/detection_tables.h
@@ -1889,7 +1889,7 @@ const KYRAGameDescription adGameDescs[] = {
 			Common::EN_ANY,
 			Common::kPlatformDOS,
 			ADGF_NO_FLAGS,
-			GUIO9(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIPCSPK, GUIO_MIDIPCJR, GUIO_RENDERVGA, GUIO_RENDEREGA, GUIO_RENDERCGA, GAMEOPTION_EOB_HPGRAPHS, GAMEOPTION_EOB_MOUSESWAP)
+			GUIO10(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIPCSPK, GUIO_MIDIPCJR, GUIO_RENDERVGA, GUIO_RENDEREGA, GUIO_RENDERCGA, GAMEOPTION_EOB_HPGRAPHS, GAMEOPTION_EOB_MOUSESWAP, GAMEOPTION_EOB_ADDRULES)
 		},
 		EOB_FLAGS
 	},
@@ -1902,7 +1902,7 @@ const KYRAGameDescription adGameDescs[] = {
 			Common::DE_DEU,
 			Common::kPlatformDOS,
 			ADGF_NO_FLAGS,
-			GUIO9(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIPCSPK, GUIO_MIDIPCJR, GUIO_RENDERVGA, GUIO_RENDEREGA, GUIO_RENDERCGA, GAMEOPTION_EOB_HPGRAPHS, GAMEOPTION_EOB_MOUSESWAP)
+			GUIO10(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIPCSPK, GUIO_MIDIPCJR, GUIO_RENDERVGA, GUIO_RENDEREGA, GUIO_RENDERCGA, GAMEOPTION_EOB_HPGRAPHS, GAMEOPTION_EOB_MOUSESWAP, GAMEOPTION_EOB_ADDRULES)
 		},
 		EOB_FLAGS
 	},
@@ -1915,7 +1915,7 @@ const KYRAGameDescription adGameDescs[] = {
 			Common::IT_ITA,
 			Common::kPlatformDOS,
 			ADGF_NO_FLAGS,
-			GUIO9(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIPCSPK, GUIO_MIDIPCJR, GUIO_RENDERVGA, GUIO_RENDEREGA, GUIO_RENDERCGA, GAMEOPTION_EOB_HPGRAPHS, GAMEOPTION_EOB_MOUSESWAP)
+			GUIO10(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIPCSPK, GUIO_MIDIPCJR, GUIO_RENDERVGA, GUIO_RENDEREGA, GUIO_RENDERCGA, GAMEOPTION_EOB_HPGRAPHS, GAMEOPTION_EOB_MOUSESWAP, GAMEOPTION_EOB_ADDRULES)
 		},
 		EOB_FLAGS
 	},
@@ -1928,7 +1928,7 @@ const KYRAGameDescription adGameDescs[] = {
 			Common::ES_ESP,
 			Common::kPlatformDOS,
 			ADGF_NO_FLAGS,
-			GUIO9(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIPCSPK, GUIO_MIDIPCJR, GUIO_RENDERVGA, GUIO_RENDEREGA, GUIO_RENDERCGA, GAMEOPTION_EOB_HPGRAPHS, GAMEOPTION_EOB_MOUSESWAP)
+			GUIO10(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIPCSPK, GUIO_MIDIPCJR, GUIO_RENDERVGA, GUIO_RENDEREGA, GUIO_RENDERCGA, GAMEOPTION_EOB_HPGRAPHS, GAMEOPTION_EOB_MOUSESWAP, GAMEOPTION_EOB_ADDRULES)
 		},
 		EOB_SPANISH_FLAGS
 	},
@@ -1941,7 +1941,7 @@ const KYRAGameDescription adGameDescs[] = {
 			Common::EN_ANY,
 			Common::kPlatformAmiga,
 			ADGF_NO_FLAGS,
-			GUIO5(GUIO_NOSPEECH, GUIO_MIDIAMIGA, GUIO_RENDERAMIGA, GAMEOPTION_EOB_HPGRAPHS, GAMEOPTION_EOB_MOUSESWAP)
+			GUIO6(GUIO_NOSPEECH, GUIO_MIDIAMIGA, GUIO_RENDERAMIGA, GAMEOPTION_EOB_HPGRAPHS, GAMEOPTION_EOB_MOUSESWAP, GAMEOPTION_EOB_ADDRULES)
 		},
 		EOB_FLAGS
 	},
@@ -1954,7 +1954,7 @@ const KYRAGameDescription adGameDescs[] = {
 			Common::DE_DEU,
 			Common::kPlatformAmiga,
 			ADGF_NO_FLAGS,
-			GUIO5(GUIO_NOSPEECH, GUIO_MIDIAMIGA, GUIO_RENDERAMIGA, GAMEOPTION_EOB_HPGRAPHS, GAMEOPTION_EOB_MOUSESWAP)
+			GUIO6(GUIO_NOSPEECH, GUIO_MIDIAMIGA, GUIO_RENDERAMIGA, GAMEOPTION_EOB_HPGRAPHS, GAMEOPTION_EOB_MOUSESWAP, GAMEOPTION_EOB_ADDRULES)
 		},
 		EOB_FLAGS
 	},
@@ -1967,7 +1967,7 @@ const KYRAGameDescription adGameDescs[] = {
 			Common::JA_JPN,
 			Common::kPlatformPC98,
 			ADGF_NO_FLAGS,
-			GUIO5(GUIO_NOSPEECH, GUIO_MIDIPC98, GUIO_RENDERPC9801, GAMEOPTION_EOB_HPGRAPHS, GAMEOPTION_EOB_MOUSESWAP)
+			GUIO6(GUIO_NOSPEECH, GUIO_MIDIPC98, GUIO_RENDERPC9801, GAMEOPTION_EOB_HPGRAPHS, GAMEOPTION_EOB_MOUSESWAP, GAMEOPTION_EOB_ADDRULES)
 		},
 		EOB_PC98_FLAGS
 	},
@@ -1981,7 +1981,7 @@ const KYRAGameDescription adGameDescs[] = {
 			Common::EN_ANY,
 			Common::kPlatformSegaCD,
 			ADGF_NO_FLAGS,
-			GUIO3(GUIO_NOSPEECH, GUIO_MIDISEGACD, GAMEOPTION_EOB_MOUSESWAP)
+			GUIO4(GUIO_NOSPEECH, GUIO_MIDISEGACD, GAMEOPTION_EOB_MOUSESWAP, GAMEOPTION_EOB_ADDRULES)
 		},
 		EOB_FLAGS
 	},
@@ -1995,7 +1995,7 @@ const KYRAGameDescription adGameDescs[] = {
 			Common::JA_JPN,
 			Common::kPlatformSegaCD,
 			ADGF_NO_FLAGS,
-			GUIO3(GUIO_NOSPEECH, GUIO_MIDISEGACD, GAMEOPTION_EOB_MOUSESWAP)
+			GUIO4(GUIO_NOSPEECH, GUIO_MIDISEGACD, GAMEOPTION_EOB_MOUSESWAP, GAMEOPTION_EOB_ADDRULES)
 		},
 		EOB_FLAGS
 	},
@@ -2008,7 +2008,7 @@ const KYRAGameDescription adGameDescs[] = {
 			Common::EN_ANY,
 			Common::kPlatformDOS,
 			ADGF_NO_FLAGS,
-			GUIO7(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIPCSPK, GUIO_RENDERVGA, GUIO_RENDEREGA, GAMEOPTION_EOB_HPGRAPHS, GAMEOPTION_EOB_MOUSESWAP)
+			GUIO8(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIPCSPK, GUIO_RENDERVGA, GUIO_RENDEREGA, GAMEOPTION_EOB_HPGRAPHS, GAMEOPTION_EOB_MOUSESWAP, GAMEOPTION_EOB_ADDRULES)
 		},
 		EOB2_FLAGS
 	},
@@ -2021,7 +2021,7 @@ const KYRAGameDescription adGameDescs[] = {
 			Common::DE_DEU,
 			Common::kPlatformDOS,
 			ADGF_NO_FLAGS,
-			GUIO7(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIPCSPK, GUIO_RENDERVGA, GUIO_RENDEREGA, GAMEOPTION_EOB_HPGRAPHS, GAMEOPTION_EOB_MOUSESWAP)
+			GUIO8(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIPCSPK, GUIO_RENDERVGA, GUIO_RENDEREGA, GAMEOPTION_EOB_HPGRAPHS, GAMEOPTION_EOB_MOUSESWAP, GAMEOPTION_EOB_ADDRULES)
 		},
 		EOB2_FLAGS
 	},
@@ -2034,7 +2034,7 @@ const KYRAGameDescription adGameDescs[] = {
 			Common::ES_ESP,
 			Common::kPlatformDOS,
 			ADGF_NO_FLAGS,
-			GUIO7(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIPCSPK, GUIO_RENDERVGA, GUIO_RENDEREGA, GAMEOPTION_EOB_HPGRAPHS, GAMEOPTION_EOB_MOUSESWAP)
+			GUIO8(GUIO_NOSPEECH, GUIO_MIDIADLIB, GUIO_MIDIPCSPK, GUIO_RENDERVGA, GUIO_RENDEREGA, GAMEOPTION_EOB_HPGRAPHS, GAMEOPTION_EOB_MOUSESWAP, GAMEOPTION_EOB_ADDRULES)
 		},
 		EOB2_FLAGS
 	},
@@ -2060,7 +2060,7 @@ const KYRAGameDescription adGameDescs[] = {
 			Common::ZH_TWN,
 			Common::kPlatformDOS,
 			ADGF_NO_FLAGS,
-			GUIO6(GUIO_MIDIADLIB, GUIO_MIDIPCSPK, GUIO_RENDERVGA, GUIO_RENDEREGA, GAMEOPTION_EOB_HPGRAPHS, GAMEOPTION_EOB_MOUSESWAP)
+			GUIO7(GUIO_MIDIADLIB, GUIO_MIDIPCSPK, GUIO_RENDERVGA, GUIO_RENDEREGA, GAMEOPTION_EOB_HPGRAPHS, GAMEOPTION_EOB_MOUSESWAP, GAMEOPTION_EOB_ADDRULES)
 		},
 		EOB2_TALKIE_FLAGS
 	},
@@ -2073,7 +2073,7 @@ const KYRAGameDescription adGameDescs[] = {
 			Common::JA_JPN,
 			Common::kPlatformFMTowns,
 			ADGF_NO_FLAGS,
-			GUIO5(GUIO_NOSPEECH, GUIO_MIDITOWNS, GUIO_RENDERFMTOWNS, GAMEOPTION_EOB_HPGRAPHS, GAMEOPTION_EOB_MOUSESWAP)
+			GUIO6(GUIO_NOSPEECH, GUIO_MIDITOWNS, GUIO_RENDERFMTOWNS, GAMEOPTION_EOB_HPGRAPHS, GAMEOPTION_EOB_MOUSESWAP, GAMEOPTION_EOB_ADDRULES)
 		},
 		EOB2_FMTOWNS_FLAGS
 	},
@@ -2086,7 +2086,7 @@ const KYRAGameDescription adGameDescs[] = {
 			Common::EN_ANY,
 			Common::kPlatformAmiga,
 			ADGF_NO_FLAGS,
-			GUIO5(GUIO_NOSPEECH, GUIO_MIDIAMIGA, GUIO_RENDERAMIGA, GAMEOPTION_EOB_HPGRAPHS, GAMEOPTION_EOB_MOUSESWAP)
+			GUIO6(GUIO_NOSPEECH, GUIO_MIDIAMIGA, GUIO_RENDERAMIGA, GAMEOPTION_EOB_HPGRAPHS, GAMEOPTION_EOB_MOUSESWAP, GAMEOPTION_EOB_ADDRULES)
 		},
 		EOB2_FLAGS
 	},
@@ -2099,7 +2099,7 @@ const KYRAGameDescription adGameDescs[] = {
 			Common::DE_DEU,
 			Common::kPlatformAmiga,
 			ADGF_NO_FLAGS,
-			GUIO5(GUIO_NOSPEECH, GUIO_MIDIAMIGA, GUIO_RENDERAMIGA, GAMEOPTION_EOB_HPGRAPHS, GAMEOPTION_EOB_MOUSESWAP)
+			GUIO6(GUIO_NOSPEECH, GUIO_MIDIAMIGA, GUIO_RENDERAMIGA, GAMEOPTION_EOB_HPGRAPHS, GAMEOPTION_EOB_MOUSESWAP, GAMEOPTION_EOB_ADDRULES)
 		},
 		EOB2_FLAGS
 	},
@@ -2112,10 +2112,10 @@ const KYRAGameDescription adGameDescs[] = {
 				{ "AAD_LOGO.CPS", 0, "a0951ff3cce7fcbd57b8152278eac3eb", AD_NO_SIZE },
 				{ 0, 0, 0, 0 }
 			},
-				Common::JA_JPN,
-				Common::kPlatformPC98,
-				ADGF_NO_FLAGS,
-				GUIO7(GUIO_NOSPEECH, GUIO_MIDIPC98, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_RENDERPC9821, GUIO_RENDERPC9801, GAMEOPTION_EOB_HPGRAPHS)
+			Common::JA_JPN,
+			Common::kPlatformPC98,
+			ADGF_NO_FLAGS,
+			GUIO9(GUIO_NOSPEECH, GUIO_MIDIPC98, GUIO_MIDIMT32, GUIO_MIDIGM, GUIO_RENDERPC9821, GUIO_RENDERPC9801, GAMEOPTION_EOB_HPGRAPHS, GAMEOPTION_EOB_MOUSESWAP, GAMEOPTION_EOB_ADDRULES)
 		},
 		EOB2_PC98_FLAGS
 	},
diff --git a/engines/kyra/engine/eobcommon.cpp b/engines/kyra/engine/eobcommon.cpp
index bdd6c7d0143..f713c4703d9 100644
--- a/engines/kyra/engine/eobcommon.cpp
+++ b/engines/kyra/engine/eobcommon.cpp
@@ -138,6 +138,7 @@ EoBCoreEngine::EoBCoreEngine(OSystem *system, const GameFlags &flags) : KyraRpgE
 	_charExchangeSwap = 0;
 	_configHpBarGraphs = true;
 	_configMouseBtSwap = false;
+	_configADDRuleEnhancements = false;
 
 	_npcSequenceSub = 0;
 	_moveCounter = 0;
@@ -684,12 +685,14 @@ void EoBCoreEngine::registerDefaultSettings() {
 	KyraEngine_v1::registerDefaultSettings();
 	ConfMan.registerDefault("hpbargraphs", true);
 	ConfMan.registerDefault("mousebtswap", false);
+	ConfMan.registerDefault("addrules", false);
 	ConfMan.registerDefault("importOrigSaves", true);
 }
 
 void EoBCoreEngine::readSettings() {
 	_configHpBarGraphs = ConfMan.getBool("hpbargraphs");
 	_configMouseBtSwap = ConfMan.getBool("mousebtswap");
+	_configADDRuleEnhancements = ConfMan.getBool("addrules");
 	_configSounds = ConfMan.getBool("sfx_mute") ? 0 : 1;
 	_configMusic = (_flags.platform == Common::kPlatformPC98 || _flags.platform == Common::kPlatformSegaCD) ? (ConfMan.getBool("music_mute") ? 0 : 1) : (_configSounds ? 1 : 0);
 
@@ -702,6 +705,7 @@ void EoBCoreEngine::readSettings() {
 void EoBCoreEngine::writeSettings() {
 	ConfMan.setBool("hpbargraphs", _configHpBarGraphs);
 	ConfMan.setBool("mousebtswap", _configMouseBtSwap);
+	ConfMan.setBool("addrules", _configADDRuleEnhancements);
 	ConfMan.setBool("sfx_mute", _configSounds == 0);
 	if (_flags.platform == Common::kPlatformPC98 || _flags.platform == Common::kPlatformSegaCD)
 		ConfMan.setBool("music_mute", _configMusic == 0);
diff --git a/engines/kyra/engine/eobcommon.h b/engines/kyra/engine/eobcommon.h
index c8a3738a017..526b9ca9fae 100644
--- a/engines/kyra/engine/eobcommon.h
+++ b/engines/kyra/engine/eobcommon.h
@@ -846,6 +846,7 @@ protected:
 	uint8 *_swapShape;
 	bool _configHpBarGraphs;
 	bool _configMouseBtSwap;
+	bool _configADDRuleEnhancements;
 
 	Graphics::Surface _thumbNail;
 
diff --git a/engines/kyra/metaengine.cpp b/engines/kyra/metaengine.cpp
index f1c80db71e2..d620805cb29 100644
--- a/engines/kyra/metaengine.cpp
+++ b/engines/kyra/metaengine.cpp
@@ -153,6 +153,18 @@ const ADExtraGuiOptionsMap gameGuiOptions[] = {
 		}
 	},
 
+	{
+		GAMEOPTION_EOB_ADDRULES,
+		{
+			_s("Faithful AD&D rules"),
+			_s("Make implementation of AD&D rules more compliant with the AD&D 2nd edition handbook"),
+			"addrules",
+			false,
+			0,
+			0
+		}
+	},
+
 	AD_EXTRA_GUI_OPTIONS_TERMINATOR
 };
 


Commit: f80a82ed138607c630afcfd9cf81b9f56a817012
    https://github.com/scummvm/scummvm/commit/f80a82ed138607c630afcfd9cf81b9f56a817012
Author: athrxx (athrxx at scummvm.org)
Date: 2024-07-22T15:10:15+02:00

Commit Message:
KYRA: (EOB) - add some optional add rule enhancements

(suggestions from @vrza
https://github.com/scummvm/scummvm/pull/5946 )

Changed paths:
    engines/kyra/engine/eobcommon.cpp


diff --git a/engines/kyra/engine/eobcommon.cpp b/engines/kyra/engine/eobcommon.cpp
index f713c4703d9..e233a2b8cb3 100644
--- a/engines/kyra/engine/eobcommon.cpp
+++ b/engines/kyra/engine/eobcommon.cpp
@@ -1044,12 +1044,19 @@ int EoBCoreEngine::generateCharacterHitpointsByLevel(int charIndex, int levelInd
 
 		int d = getCharacterClassType(c->cClass, i);
 
-		if (c->level[i] <= (d >= 0 ? _hpIncrPerLevel[6 + d] : 0))
-			h += rollDice(1, d >= 0 ? _hpIncrPerLevel[d] : 0);
-		else
+		if (c->level[i] <= (d >= 0 ? _hpIncrPerLevel[6 + d] : 0)) {
+			int hpAdjustment = m;
+			hpAdjustment += rollDice(1, (d >= 0) ? _hpIncrPerLevel[d] : 0);
+			// According to the AD&D handbook the const bonus shouldn't be added here
+			// when the dice roll is 0, but it is like that in the original interpreter.
+			h += (hpAdjustment < 1 && _configADDRuleEnhancements) ? 1 : hpAdjustment;
+		} else {
 			h += (d >= 0 ? _hpIncrPerLevel[12 + d] : 0);
-
-		h += m;
+			// The const bonus shouldn't be added here according to
+			// the AD&D handbook, but the game does it anyway.
+			if (!_configADDRuleEnhancements)
+				h += m;
+		}
 	}
 
 	h /= _numLevelsPerClass[c->cClass];




More information about the Scummvm-git-logs mailing list