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

mduggan noreply at scummvm.org
Tue Jan 4 09:03:59 UTC 2022


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

Summary:
0e66f4bd3c ULTIMA8: Expose christmas easter-egg option in GUI
f9b10f6e6f ULTIMA8: Add Crusader toggle crouch button mapping


Commit: 0e66f4bd3cbe0b05a5d28d4deae5f31dead335f2
    https://github.com/scummvm/scummvm/commit/0e66f4bd3cbe0b05a5d28d4deae5f31dead335f2
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2022-01-04T18:03:41+09:00

Commit Message:
ULTIMA8: Expose christmas easter-egg option in GUI

Changed paths:
    engines/ultima/detection.cpp


diff --git a/engines/ultima/detection.cpp b/engines/ultima/detection.cpp
index 48498b2ef97..e84931e6538 100644
--- a/engines/ultima/detection.cpp
+++ b/engines/ultima/detection.cpp
@@ -123,12 +123,25 @@ static const ExtraGuiOption U8_OPTIONS[] = {
 	{ nullptr, nullptr, nullptr, false }
 };
 
-static const ExtraGuiOption CRUSADER_OPTIONS[] = {
+static const ExtraGuiOption CAMERA_WITH_SILENCER = {
+	// I18N: Silencer is the player-character in Crusader games, known as the Avatar in Ultima series.
+	_s("Camera moves with Silencer"),
+	_s("Camera tracks the player movement rather than snapping to defined positions."),
+	"camera_on_player",
+	true
+};
+
+static const ExtraGuiOption REMORSE_OPTIONS[] = {
+	CAMERA_WITH_SILENCER,
+	{ nullptr, nullptr, nullptr, false }
+};
+
+static const ExtraGuiOption REGRET_OPTIONS[] = {
+	CAMERA_WITH_SILENCER,
 	{
-		// I18N: Silencer is the player-character in Crusader games, known as the Avatar in Ultima series.
-		_s("Camera moves with Silencer"),
-		_s("Camera tracks the player movement rather than snapping to defined positions."),
-		"camera_on_player",
+		_s("Always enable Christmas easter-egg"),
+		_s("Enable the Christmas music at any time of year."),
+		"always_christmas",
 		true
 	},
 	{ nullptr, nullptr, nullptr, false }
@@ -167,7 +180,14 @@ const ExtraGuiOptions UltimaMetaEngineDetection::getExtraGuiOptions(const Common
 		}
 
 		// Game specific options
-		const ExtraGuiOption *game_options = (target.equals("ultima8") ? Ultima::U8_OPTIONS : Ultima::CRUSADER_OPTIONS);
+		const ExtraGuiOption *game_options;
+		if (gameId == "ultima8")
+			game_options = Ultima::U8_OPTIONS;
+		else if (gameId == "remorse")
+			game_options = Ultima::REMORSE_OPTIONS;
+		else
+			game_options = Ultima::REGRET_OPTIONS;
+
 		for (const ExtraGuiOption *o = game_options; o->configOption; ++o) {
 			options.push_back(*o);
 		}


Commit: f9b10f6e6facf4dceb72e6726fe306bd433cda25
    https://github.com/scummvm/scummvm/commit/f9b10f6e6facf4dceb72e6726fe306bd433cda25
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2022-01-04T18:03:41+09:00

Commit Message:
ULTIMA8: Add Crusader toggle crouch button mapping

Also rework the one-shot movement slightly so there's less if/elses.

Changed paths:
    engines/ultima/ultima8/meta_engine.cpp
    engines/ultima/ultima8/meta_engine.h
    engines/ultima/ultima8/misc/debugger.cpp
    engines/ultima/ultima8/misc/debugger.h
    engines/ultima/ultima8/world/actors/animation.cpp
    engines/ultima/ultima8/world/actors/avatar_mover_process.h
    engines/ultima/ultima8/world/actors/cru_avatar_mover_process.cpp


diff --git a/engines/ultima/ultima8/meta_engine.cpp b/engines/ultima/ultima8/meta_engine.cpp
index 26610d1000d..0b50e550ef4 100644
--- a/engines/ultima/ultima8/meta_engine.cpp
+++ b/engines/ultima/ultima8/meta_engine.cpp
@@ -96,6 +96,7 @@ static const KeybindingRecord CRUSADER_KEYS[] = {
 	{ ACTION_STEP_BACK, "STEP_BACK", "Step Back", "AvatarMoverProcess::stepBack", nullptr, "END", "KP2" },
 	{ ACTION_ROLL_LEFT, "ROLL_LEFT", "Roll Left", "AvatarMoverProcess::rollLeft", nullptr, "INSERT", "KP1" },
 	{ ACTION_ROLL_RIGHT, "ROLL_RIGHT", "Roll Right", "AvatarMoverProcess::rollRight", nullptr, "PAGEUP", "KP3" },
+	{ ACTION_TOGGLE_CROUCH, "TOGGLE_CROUCH", "Toggle Crouch", "AvatarMoverProcess::toggleCrouch", nullptr, "KP5", nullptr },
 	{ ACTION_MOVE_STEP, "MOVE_STEP", "Side Step / Advance / Retreat", "AvatarMoverProcess::startMoveStep", "AvatarMoverProcess::stopMoveStep", "LALT", "JOY_RIGHT_SHOULDER" },
 	{ ACTION_NONE, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr }
 };
diff --git a/engines/ultima/ultima8/meta_engine.h b/engines/ultima/ultima8/meta_engine.h
index d862588e9d8..4c67c2a77b0 100644
--- a/engines/ultima/ultima8/meta_engine.h
+++ b/engines/ultima/ultima8/meta_engine.h
@@ -40,7 +40,8 @@ enum KeybindingAction {
 	ACTION_MOVE_BACK, ACTION_MOVE_UP, ACTION_MOVE_DOWN, ACTION_MOVE_LEFT,
 	ACTION_MOVE_RIGHT, ACTION_MOVE_RUN, ACTION_MOVE_STEP, ACTION_ATTACK,
 	ACTION_STEP_LEFT, ACTION_STEP_RIGHT, ACTION_STEP_FORWARD,
-	ACTION_STEP_BACK, ACTION_ROLL_LEFT, ACTION_ROLL_RIGHT, ACTION_CAMERA_AVATAR,
+	ACTION_STEP_BACK, ACTION_ROLL_LEFT, ACTION_ROLL_RIGHT, ACTION_TOGGLE_CROUCH,
+	ACTION_CAMERA_AVATAR,
 
 	ACTION_CLIPPING, ACTION_DEC_SORT_ORDER,
 	ACTION_INC_SORT_ORDER, ACTION_QUICK_MOVE_ASCEND, ACTION_QUICK_MOVE_DESCEND,
diff --git a/engines/ultima/ultima8/misc/debugger.cpp b/engines/ultima/ultima8/misc/debugger.cpp
index 4883092ca20..28c5dd20e30 100644
--- a/engines/ultima/ultima8/misc/debugger.cpp
+++ b/engines/ultima/ultima8/misc/debugger.cpp
@@ -121,6 +121,7 @@ Debugger::Debugger() : Shared::Debugger() {
 	registerCmd("AvatarMoverProcess::stepBack", WRAP_METHOD(Debugger, cmdStepBack));
 	registerCmd("AvatarMoverProcess::rollLeft", WRAP_METHOD(Debugger, cmdRollLeft));
 	registerCmd("AvatarMoverProcess::rollRight", WRAP_METHOD(Debugger, cmdRollRight));
+	registerCmd("AvatarMoverProcess::toggleCrouch", WRAP_METHOD(Debugger, cmdToggleCrouch));
 
 	registerCmd("CameraProcess::moveToAvatar", WRAP_METHOD(Debugger, cmdCameraOnAvatar));
 
@@ -1374,6 +1375,10 @@ bool Debugger::cmdRollRight(int argc, const char **argv) {
 	return _avatarMoveKey(AvatarMoverProcess::MOVE_ROLL_RIGHT, "roll right");
 }
 
+bool Debugger::cmdToggleCrouch(int argc, const char **argv) {
+	return _avatarMoveKey(AvatarMoverProcess::MOVE_TOGGLE_CROUCH, "toggle crouch");
+}
+
 bool Debugger::cmdToggleCombat(int argc, const char **argv) {
 	if (Ultima8Engine::get_instance()->isAvatarInStasis()) {
 		debugPrintf("Can't toggle combat: avatarInStasis\n");
diff --git a/engines/ultima/ultima8/misc/debugger.h b/engines/ultima/ultima8/misc/debugger.h
index 1f7c4a8fd97..8a96758e756 100644
--- a/engines/ultima/ultima8/misc/debugger.h
+++ b/engines/ultima/ultima8/misc/debugger.h
@@ -181,6 +181,7 @@ private:
 	bool cmdStepBack(int argc, const char **argv);
 	bool cmdRollLeft(int argc, const char **argv);
 	bool cmdRollRight(int argc, const char **argv);
+	bool cmdToggleCrouch(int argc, const char **argv);
 
 	bool cmdCameraOnAvatar(int argc, const char **argv);
 
diff --git a/engines/ultima/ultima8/world/actors/animation.cpp b/engines/ultima/ultima8/world/actors/animation.cpp
index 02fc7ecde47..49947f519f8 100644
--- a/engines/ultima/ultima8/world/actors/animation.cpp
+++ b/engines/ultima/ultima8/world/actors/animation.cpp
@@ -88,6 +88,8 @@ bool isCombatAnimCru(const Sequence anim) {
 	case startRun:
 	case run:
 	case stopRunningAndDrawSmallWeapon:
+	case kneelingAdvance:
+	case kneelingRetreat:
 		return true;
 	default:
 		return false;
diff --git a/engines/ultima/ultima8/world/actors/avatar_mover_process.h b/engines/ultima/ultima8/world/actors/avatar_mover_process.h
index 44917b24dc5..a2173670595 100644
--- a/engines/ultima/ultima8/world/actors/avatar_mover_process.h
+++ b/engines/ultima/ultima8/world/actors/avatar_mover_process.h
@@ -94,6 +94,7 @@ public:
 		MOVE_STEP_RIGHT   = 0x080000,
 		MOVE_STEP_FORWARD = 0x100000,
 		MOVE_STEP_BACK    = 0x200000,
+		MOVE_TOGGLE_CROUCH = 0x400000,
 
 		MOVE_ANY_DIRECTION = MOVE_MOUSE_DIRECTION | MOVE_FORWARD | MOVE_BACK | MOVE_LEFT | MOVE_RIGHT | MOVE_UP | MOVE_DOWN
 	};
diff --git a/engines/ultima/ultima8/world/actors/cru_avatar_mover_process.cpp b/engines/ultima/ultima8/world/actors/cru_avatar_mover_process.cpp
index 7ea90e60005..660ddccd749 100644
--- a/engines/ultima/ultima8/world/actors/cru_avatar_mover_process.cpp
+++ b/engines/ultima/ultima8/world/actors/cru_avatar_mover_process.cpp
@@ -144,40 +144,50 @@ static bool _isAnimStartRunning(Animation::Sequence anim) {
 
 bool CruAvatarMoverProcess::checkOneShotMove(Direction direction) {
 	Actor *avatar = getControlledActor();
+	MainActor *mainactor = dynamic_cast<MainActor *>(avatar);
 
 	static const MovementFlags oneShotFlags[] = {
 		MOVE_ROLL_LEFT, MOVE_ROLL_RIGHT,
 		MOVE_STEP_LEFT, MOVE_STEP_RIGHT,
 		MOVE_STEP_FORWARD, MOVE_STEP_BACK,
-		MOVE_SHORT_JUMP
+		MOVE_SHORT_JUMP, MOVE_TOGGLE_CROUCH
 	};
 
 	static const Animation::Sequence oneShotAnims[] = {
 		Animation::combatRollLeft, Animation::combatRollRight,
 		Animation::slideLeft, Animation::slideRight,
 		Animation::advance, Animation::retreat,
-		Animation::jumpForward
+		Animation::jumpForward, Animation::kneelStartCru
+	};
+
+	static const Animation::Sequence oneShotKneelingAnims[] = {
+		Animation::kneelCombatRollLeft, Animation::kneelCombatRollRight,
+		Animation::slideLeft, Animation::slideRight,
+		Animation::kneelingAdvance, Animation::kneelingRetreat,
+		Animation::jumpForward, Animation::kneelEndCru
 	};
 
 	for (int i = 0; i < ARRAYSIZE(oneShotFlags); i++) {
 		if (hasMovementFlags(oneShotFlags[i])) {
+			Animation::Sequence anim = (avatar->isKneeling() ?
+							oneShotKneelingAnims[i] : oneShotAnims[i]);
+
+			// All the animations should finish with gun drawn, *except*
+			// jump which should finish with gun stowed.  For other cases we should
+			// toggle.
+			bool incombat = avatar->isInCombat();
+			bool isjump = (anim == Animation::jumpForward);
+			if (mainactor && (incombat == isjump)) {
+				mainactor->toggleInCombat();
+			}
+
 			clearMovementFlag(oneShotFlags[i]);
-			Animation::Sequence anim = oneShotAnims[i];
-			if (avatar->isKneeling()) {
-				// TODO: check what should advance/retreat do here?
-				if (anim == Animation::combatRollLeft)
-					avatar->doAnim(Animation::kneelCombatRollLeft, direction);
-				else if (anim == Animation::combatRollRight)
-					avatar->doAnim(Animation::kneelCombatRollRight, direction);
-				else if (anim == Animation::advance)
-					step(Animation::kneelingAdvance, direction);
-				else if (anim == Animation::retreat)
-					step(Animation::kneelingRetreat, direction);
+
+			if (anim == Animation::advance || anim == Animation::retreat ||
+				anim == Animation::kneelingAdvance || anim == Animation::kneelingRetreat) {
+				step(anim, direction);
 			} else {
-				if (anim == Animation::advance || anim == Animation::retreat)
-					step(anim, direction);
-				else
-					avatar->doAnim(anim, direction);
+				avatar->doAnim(anim, direction);
 			}
 			return true;
 		}




More information about the Scummvm-git-logs mailing list