[Scummvm-git-logs] scummvm master -> 46fbef1b309bc9bf39bf4996e61955777685a55d

dreammaster dreammaster at scummvm.org
Fri Jan 15 04:15:38 UTC 2021


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:
46fbef1b30 ULTIMA4: Change damage to match DOS version


Commit: 46fbef1b309bc9bf39bf4996e61955777685a55d
    https://github.com/scummvm/scummvm/commit/46fbef1b309bc9bf39bf4996e61955777685a55d
Author: Fenyx4 (Fenyx4 at gmail.com)
Date: 2021-01-14T20:15:34-08:00

Commit Message:
ULTIMA4: Change damage to match DOS version

Through an interesting series of events I noticed that the xu4 damage was different from the DOS version of the game.
Disassembled DOS version: https://github.com/ergonomy-joe/u4-decompiled/blob/master/SRC/U4_AI.C#L127

Note: D_23D2[C_7C25((unsigned char)Fighters._tile[bp04])] is equivalent to creature.basehp

If I'm doing the math right then they are equal when the monster base health is below 64. But above that they diverge with xu4 creatures doing significantly less damage.

(It is possible that the xu4 version is getting the damage calculation from a different port of the game. I haven't been able to check that.)

Changed paths:
    engines/ultima/ultima4/game/creature.cpp


diff --git a/engines/ultima/ultima4/game/creature.cpp b/engines/ultima/ultima4/game/creature.cpp
index 35bc276bcc..a24fe0cd4a 100644
--- a/engines/ultima/ultima4/game/creature.cpp
+++ b/engines/ultima/ultima4/game/creature.cpp
@@ -253,7 +253,7 @@ int  Creature::getDamage() const {
 	int damage, val, x;
 	val = _baseHp;
 	x = xu4_random(val >> 2);
-	damage = (x >> 4) + ((x >> 2) & 0xfc);
+	damage = (x >> 4) * 10;
 	damage += x % 10;
 	return damage;
 }




More information about the Scummvm-git-logs mailing list