[Scummvm-git-logs] scummvm master -> 3e0c3089e922779ff4116b1c024de8375e6fc8c3
mduggan
mgithub at guarana.org
Sun May 16 11:39:32 UTC 2021
This automated email contains information about 12 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
15b265abdc ULTIMA8: Use readSByte to eliminate casts
f3eb0a978e ULTMA8: JANITORIAL: Remove incorrect commented-out code
dce361bf3b ULTIMA8: Turn Crusader immediately while moving
07d7e335d7 ULTIMA8: Add repeating firing in Crusader
07dee61a72 ULTIMA8: Add No Remorse data to FireTypeTable
f5d4a91576 ULTIMA8: Use bool type for two firetype flags
46982981f5 ULTIMA8: Update Crusader random weapon table for No Regret
0ee35a1e1f ULTIMA8: Get Crusader default HP from data table
8d3e556e97 ULTIMA8: Clean up a Crusader TODO.
d5a5b5c5ed ULTIMA8: Add comments
ccc91e43ca ULTIMA8: Fix a TODO in Crusader attack, add another one for Regret
3e0c3089e9 ULTIMA8: Remove outdated FIXME and TODO comments
Commit: 15b265abdc63e019e110dd0ac4b6b1506bb62579
https://github.com/scummvm/scummvm/commit/15b265abdc63e019e110dd0ac4b6b1506bb62579
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2021-05-16T18:21:38+09:00
Commit Message:
ULTIMA8: Use readSByte to eliminate casts
Changed paths:
engines/ultima/ultima8/usecode/uc_machine.cpp
diff --git a/engines/ultima/ultima8/usecode/uc_machine.cpp b/engines/ultima/ultima8/usecode/uc_machine.cpp
index 98df3879a5..80f6ee0e18 100644
--- a/engines/ultima/ultima8/usecode/uc_machine.cpp
+++ b/engines/ultima/ultima8/usecode/uc_machine.cpp
@@ -202,7 +202,7 @@ void UCMachine::execProcess(UCProcess *p) {
case 0x00:
// 00 xx
// pop 16 bit int, and assign LS 8 bit int into bp+xx
- si8a = static_cast<int8>(cs->readByte());
+ si8a = cs->readSByte();
ui16a = p->_stack.pop2();
p->_stack.assign1(p->_bp + si8a, static_cast<uint8>(ui16a));
LOGPF(("pop byte\t%s = %02Xh\n", print_bp(si8a), ui16a));
@@ -211,7 +211,7 @@ void UCMachine::execProcess(UCProcess *p) {
case 0x01:
// 01 xx
// pop 16 bit int into bp+xx
- si8a = static_cast<int8>(cs->readByte());
+ si8a = cs->readSByte();
ui16a = p->_stack.pop2();
p->_stack.assign2(p->_bp + si8a, ui16a);
LOGPF(("pop\t\t%s = %04Xh\n", print_bp(si8a), ui16a));
@@ -220,7 +220,7 @@ void UCMachine::execProcess(UCProcess *p) {
case 0x02:
// 02 xx
// pop 32 bit int into bp+xx
- si8a = static_cast<int8>(cs->readByte());
+ si8a = cs->readSByte();
ui32a = p->_stack.pop4();
p->_stack.assign4(p->_bp + si8a, ui32a);
LOGPF(("pop dword\t%s = %08Xh\n", print_bp(si8a), ui32a));
@@ -229,7 +229,7 @@ void UCMachine::execProcess(UCProcess *p) {
case 0x03: {
// 03 xx yy
// pop yy bytes into bp+xx
- si8a = static_cast<int8>(cs->readByte());
+ si8a = cs->readSByte();
uint8 size = cs->readByte();
uint8 buf[256];
p->_stack.pop(buf, size);
@@ -253,9 +253,9 @@ void UCMachine::execProcess(UCProcess *p) {
case 0x09: {
// 09 xx yy zz
// pop yy bytes into an element of list bp+xx (or slist if zz set)
- si8a = static_cast<int8>(cs->readByte());
+ si8a = cs->readSByte();
ui32a = cs->readByte();
- si8b = static_cast<int8>(cs->readByte());
+ si8b = cs->readSByte();
LOGPF(("assign element\t%s (%02X) (slist==%02X)\n",
print_bp(si8a), ui32a, si8b));
ui16a = p->_stack.pop2() - 1; // index
@@ -289,7 +289,7 @@ void UCMachine::execProcess(UCProcess *p) {
case 0x0A:
// 0A xx
// push sign-extended 8 bit xx onto the stack as 16 bit
- ui16a = static_cast<int8>(cs->readByte());
+ ui16a = cs->readSByte();
p->_stack.push2(ui16a);
LOGPF(("push byte\t%04Xh\n", ui16a));
break;
@@ -1044,7 +1044,7 @@ void UCMachine::execProcess(UCProcess *p) {
case 0x3E:
// 3E xx
// push the value of the sign-extended 8 bit local var xx as 16 bit int
- si8a = static_cast<int8>(cs->readByte());
+ si8a = cs->readSByte();
ui16a = static_cast<uint16>(static_cast<int8>(p->_stack.access1(p->_bp + si8a)));
p->_stack.push2(ui16a);
LOGPF(("push byte\t%s = %02Xh\n", print_bp(si8a), ui16a));
@@ -1053,7 +1053,7 @@ void UCMachine::execProcess(UCProcess *p) {
case 0x3F:
// 3F xx
// push the value of the 16 bit local var xx
- si8a = static_cast<int8>(cs->readByte());
+ si8a = cs->readSByte();
ui16a = p->_stack.access2(p->_bp + si8a);
p->_stack.push2(ui16a);
LOGPF(("push\t\t%s = %04Xh\n", print_bp(si8a), ui16a));
@@ -1062,7 +1062,7 @@ void UCMachine::execProcess(UCProcess *p) {
case 0x40:
// 40 xx
// push the value of the 32 bit local var xx
- si8a = static_cast<int8>(cs->readByte());
+ si8a = cs->readSByte();
ui32a = p->_stack.access4(p->_bp + si8a);
p->_stack.push4(ui32a);
LOGPF(("push dword\t%s = %08Xh\n", print_bp(si8a), ui32a));
@@ -1072,7 +1072,7 @@ void UCMachine::execProcess(UCProcess *p) {
// 41 xx
// push the string local var xx
// duplicating the string?
- si8a = static_cast<int8>(cs->readByte());
+ si8a = cs->readSByte();
ui16a = p->_stack.access2(p->_bp + si8a);
p->_stack.push2(duplicateString(ui16a));
LOGPF(("push string\t%s\n", print_bp(si8a)));
@@ -1082,7 +1082,7 @@ void UCMachine::execProcess(UCProcess *p) {
// 42 xx yy
// push the list (with yy size elements) at BP+xx
// duplicating the list?
- si8a = static_cast<int8>(cs->readByte());
+ si8a = cs->readSByte();
ui16a = cs->readByte();
ui16b = p->_stack.access2(p->_bp + si8a);
UCList *l = new UCList(ui16a);
@@ -1104,7 +1104,7 @@ void UCMachine::execProcess(UCProcess *p) {
// 43 xx
// push the stringlist local var xx
// duplicating the list, duplicating the strings in the list
- si8a = static_cast<int8>(cs->readByte());
+ si8a = cs->readSByte();
ui16a = 2;
ui16b = p->_stack.access2(p->_bp + si8a);
UCList *l = new UCList(ui16a);
@@ -1160,7 +1160,7 @@ void UCMachine::execProcess(UCProcess *p) {
case 0x45:
// 45 xx yy
// push huge of size yy from BP+xx
- si8a = static_cast<int8>(cs->readByte());
+ si8a = cs->readSByte();
ui16b = cs->readByte();
p->_stack.push(p->_stack.access(p->_bp + si8a), ui16b);
LOGPF(("push huge\t%s %02X\n", print_bp(si8a), ui16b));
@@ -1175,7 +1175,7 @@ void UCMachine::execProcess(UCProcess *p) {
case 0x4B:
// 4B xx
// push 32 bit pointer address of BP+XX
- si8a = static_cast<int8>(cs->readByte());
+ si8a = cs->readSByte();
p->_stack.push4(stackToPtr(p->_pid, p->_bp + si8a));
LOGPF(("push addr\t%s\n", print_bp(si8a)));
break;
@@ -1536,7 +1536,7 @@ void UCMachine::execProcess(UCProcess *p) {
case 0x62:
// 62 xx
// free the string in var BP+xx
- si8a = static_cast<int8>(cs->readByte());
+ si8a = cs->readSByte();
ui16a = p->_stack.access2(p->_bp + si8a);
freeString(ui16a);
LOGPF(("free string\t%s = %04X\n", print_bp(si8a), ui16a));
@@ -1545,7 +1545,7 @@ void UCMachine::execProcess(UCProcess *p) {
case 0x63:
// 63 xx
// free the stringlist in var BP+xx
- si8a = static_cast<int8>(cs->readByte());
+ si8a = cs->readSByte();
ui16a = p->_stack.access2(p->_bp + si8a);
freeStringList(ui16a);
LOGPF(("free slist\t%s = %04X\n", print_bp(si8a), ui16a));
@@ -1554,7 +1554,7 @@ void UCMachine::execProcess(UCProcess *p) {
case 0x64:
// 64 xx
// free the list in var BP+xx
- si8a = static_cast<int8>(cs->readByte());
+ si8a = cs->readSByte();
ui16a = p->_stack.access2(p->_bp + si8a);
freeList(ui16a);
LOGPF(("free list\t%s = %04X\n", print_bp(si8a), ui16a));
@@ -1565,7 +1565,7 @@ void UCMachine::execProcess(UCProcess *p) {
// free the string at SP+xx
// NB: sometimes there's a 32-bit string pointer at SP+xx
// However, the low word of this is exactly the 16bit ref
- si8a = static_cast<int8>(cs->readByte());
+ si8a = cs->readSByte();
ui16a = p->_stack.access2(p->_stack.getSP() + si8a);
freeString(ui16a);
LOGPF(("free string\t%s = %04X\n", print_sp(si8a), ui16a));
@@ -1574,7 +1574,7 @@ void UCMachine::execProcess(UCProcess *p) {
case 0x66:
// 66 xx
// free the list at SP+xx
- si8a = static_cast<int8>(cs->readByte());
+ si8a = cs->readSByte();
ui16a = p->_stack.access2(p->_stack.getSP() + si8a);
freeList(ui16a);
LOGPF(("free list\t%s = %04X\n", print_sp(si8a), ui16a));
@@ -1583,7 +1583,7 @@ void UCMachine::execProcess(UCProcess *p) {
case 0x67:
// 67 xx
// free the string list at SP+xx
- si8a = static_cast<int8>(cs->readByte());
+ si8a = cs->readSByte();
ui16a = p->_stack.access2(p->_stack.getSP() + si8a);
freeStringList(ui16a);
LOGPF(("free slist\t%s = %04x\n", print_sp(si8a), ui16a));
@@ -1594,7 +1594,7 @@ void UCMachine::execProcess(UCProcess *p) {
case 0x69:
// 69 xx
// push the string in var BP+xx as 32 bit pointer
- si8a = static_cast<int8>(cs->readByte());
+ si8a = cs->readSByte();
ui16a = p->_stack.access2(p->_bp + si8a);
p->_stack.push4(stringToPtr(ui16a));
LOGPF(("str to ptr\t%s\n", print_bp(si8a)));
@@ -1674,7 +1674,7 @@ void UCMachine::execProcess(UCProcess *p) {
// 6E xx
// subtract xx from stack pointer
// (effect on SP is the same as popping xx bytes)
- si8a = static_cast<int8>(cs->readByte());
+ si8a = cs->readSByte();
p->_stack.addSP(-si8a);
LOGPF(("move sp\t\t%s%02Xh\n", si8a < 0 ? "-" : "", si8a < 0 ? -si8a : si8a));
break;
@@ -1682,7 +1682,7 @@ void UCMachine::execProcess(UCProcess *p) {
case 0x6F:
// 6F xx
// push 32 pointer address of SP-xx
- si8a = static_cast<int8>(cs->readByte());
+ si8a = cs->readSByte();
p->_stack.push4(stackToPtr(p->_pid, static_cast<uint16>(p->_stack.getSP() - si8a)));
LOGPF(("push addr\t%s\n", print_sp(-si8a)));
break;
Commit: f3eb0a978e4fbaf43732238109687843aa5aa735
https://github.com/scummvm/scummvm/commit/f3eb0a978e4fbaf43732238109687843aa5aa735
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2021-05-16T18:21:38+09:00
Commit Message:
ULTMA8: JANITORIAL: Remove incorrect commented-out code
Changed paths:
engines/ultima/ultima8/world/item.cpp
diff --git a/engines/ultima/ultima8/world/item.cpp b/engines/ultima/ultima8/world/item.cpp
index 1651d9dd8a..bf2b3ef7b0 100644
--- a/engines/ultima/ultima8/world/item.cpp
+++ b/engines/ultima/ultima8/world/item.cpp
@@ -3481,7 +3481,6 @@ uint32 Item::I_move(const uint8 *args, unsigned int /*argsize*/) {
#endif
item->move(x, y, z);
- //item->collideMove(x, y, z, true, true);
return 0;
}
Commit: dce361bf3b876614e5402cee53bc786077505a13
https://github.com/scummvm/scummvm/commit/dce361bf3b876614e5402cee53bc786077505a13
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2021-05-16T18:21:38+09:00
Commit Message:
ULTIMA8: Turn Crusader immediately while moving
Crusader games allow the avatar to turn once immediately while walking/running.
Changed paths:
engines/ultima/ultima8/world/actors/cru_avatar_mover_process.cpp
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 b413d933d1..66a3a4c2da 100644
--- a/engines/ultima/ultima8/world/actors/cru_avatar_mover_process.cpp
+++ b/engines/ultima/ultima8/world/actors/cru_avatar_mover_process.cpp
@@ -45,6 +45,10 @@ CruAvatarMoverProcess::CruAvatarMoverProcess() : AvatarMoverProcess(), _avatarAn
CruAvatarMoverProcess::~CruAvatarMoverProcess() {
}
+static bool _isAnimRunningWalking(Animation::Sequence anim) {
+ return (anim == Animation::run || anim == Animation::combatRunSmallWeapon ||
+ anim == Animation::walk);
+}
void CruAvatarMoverProcess::run() {
@@ -84,6 +88,22 @@ void CruAvatarMoverProcess::run() {
}
} else {
_avatarAngle = -1;
+ // Check for a turn request while running or walking. This only happens
+ // once per arrow keydown, so clear the flag.
+ if (avatar->isBusy() && _isAnimRunningWalking(avatar->getLastAnim())
+ && hasMovementFlags(MOVE_FORWARD)
+ && (hasMovementFlags(MOVE_TURN_LEFT) || hasMovementFlags(MOVE_TURN_RIGHT))) {
+ Kernel *kernel = Kernel::get_instance();
+ // Stop the current animation and turn now.
+ kernel->killProcesses(avatar->getObjId(), ActorAnimProcess::ACTOR_ANIM_PROC_TYPE, true);
+
+ Direction curdir = avatar->getDir();
+ Animation::Sequence anim = hasMovementFlags(MOVE_RUN) ? Animation::run : Animation::walk;
+ DirectionMode dirmode = avatar->animDirMode(anim);
+ Direction dir = getTurnDirForTurnFlags(curdir, dirmode);
+ clearMovementFlag(MOVE_TURN_LEFT | MOVE_TURN_RIGHT);
+ step(anim, dir);
+ }
}
// Now do the regular process
@@ -106,11 +126,6 @@ static bool _isAnimStartRunning(Animation::Sequence anim) {
anim == Animation::startRunLargeWeapon);
}
-static bool _isAnimRunningWalking(Animation::Sequence anim) {
- return (anim == Animation::run || anim == Animation::combatRunSmallWeapon ||
- anim == Animation::walk);
-}
-
void CruAvatarMoverProcess::handleCombatMode() {
Actor *avatar = getControlledActor();
MainActor *mainactor = dynamic_cast<MainActor *>(avatar);
Commit: 07d7e335d74a3bb97a92bed51b21fee31f08c497
https://github.com/scummvm/scummvm/commit/07d7e335d74a3bb97a92bed51b21fee31f08c497
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2021-05-16T18:21:38+09:00
Commit Message:
ULTIMA8: Add repeating firing in Crusader
Changed paths:
engines/ultima/ultima8/meta_engine.cpp
engines/ultima/ultima8/misc/debugger.cpp
engines/ultima/ultima8/misc/debugger.h
engines/ultima/ultima8/world/actors/avatar_mover_process.h
engines/ultima/ultima8/world/actors/cru_avatar_mover_process.cpp
engines/ultima/ultima8/world/actors/cru_avatar_mover_process.h
engines/ultima/ultima8/world/actors/u8_avatar_mover_process.cpp
engines/ultima/ultima8/world/actors/u8_avatar_mover_process.h
diff --git a/engines/ultima/ultima8/meta_engine.cpp b/engines/ultima/ultima8/meta_engine.cpp
index bd3abdfaa8..d375b41013 100644
--- a/engines/ultima/ultima8/meta_engine.cpp
+++ b/engines/ultima/ultima8/meta_engine.cpp
@@ -90,7 +90,7 @@ static const KeybindingRecord CRUSADER_KEYS[] = {
{ ACTION_SELECT_ITEMS, "SELECT_ITEM", "Select Item", "ItemSelectionProcess::startSelection", nullptr, "s", nullptr, 0 },
{ ACTION_USE_SELECTION, "USE_SELECTION", "Use Selection", "ItemSelectionProcess::useSelectedItem", nullptr, "RETURN", nullptr, 0 },
{ ACTION_GRAB_ITEMS, "GRAB_ITEM", "Grab Items", "ItemSelectionProcess::grabItems", nullptr, "g", nullptr, 0 },
- { ACTION_ATTACK, "ATTACK", "Attack", "AvatarMoverProcess::tryAttack", nullptr, "SPACE", nullptr, 0 },
+ { ACTION_ATTACK, "ATTACK", "Attack", "AvatarMoverProcess::startAttack", "AvatarMoverProcess::stopAttack", "SPACE", nullptr, 0 },
{ ACTION_CAMERA_AVATAR, "CAMERA_AVATAR", "Focus Camera on Silencer", "CameraProcess::moveToAvatar", nullptr, "z", nullptr, 0 },
{ ACTION_JUMP, "JUMP", "Jump / Roll / Crouch", "AvatarMoverProcess::startJump", "AvatarMoverProcess::stopJump", "LCTRL", nullptr, FLAG_MENU_ENABLED },
{ ACTION_MOVE_STEP, "MOVE_STEP", "Side Step / Advance / Retreat", "AvatarMoverProcess::startMoveStep", "AvatarMoverProcess::stopMoveStep", "LALT", "JOY_RIGHT_SHOULDER", FLAG_MENU_ENABLED },
diff --git a/engines/ultima/ultima8/misc/debugger.cpp b/engines/ultima/ultima8/misc/debugger.cpp
index ae4f68aacb..8b9aac3d06 100644
--- a/engines/ultima/ultima8/misc/debugger.cpp
+++ b/engines/ultima/ultima8/misc/debugger.cpp
@@ -112,7 +112,8 @@ Debugger::Debugger() : Shared::Debugger() {
registerCmd("AvatarMoverProcess::stopMoveRun", WRAP_METHOD(Debugger, cmdStopMoveRun));
registerCmd("AvatarMoverProcess::startMoveStep", WRAP_METHOD(Debugger, cmdStartMoveStep));
registerCmd("AvatarMoverProcess::stopMoveStep", WRAP_METHOD(Debugger, cmdStopMoveStep));
- registerCmd("AvatarMoverProcess::tryAttack", WRAP_METHOD(Debugger, cmdAttack));
+ registerCmd("AvatarMoverProcess::startAttack", WRAP_METHOD(Debugger, cmdStartAttack));
+ registerCmd("AvatarMoverProcess::stopAttack", WRAP_METHOD(Debugger, cmdStopAttack));
registerCmd("CameraProcess::moveToAvatar", WRAP_METHOD(Debugger, cmdCameraOnAvatar));
@@ -1165,7 +1166,7 @@ bool Debugger::cmdUseKeyring(int argc, const char **argv) {
return false;
}
-bool Debugger::cmdAttack(int argc, const char **argv) {
+bool Debugger::cmdStartAttack(int argc, const char **argv) {
Ultima8Engine *engine = Ultima8Engine::get_instance();
if (engine->isAvatarInStasis()) {
debugPrintf("Can't attack: avatarInStasis\n");
@@ -1173,7 +1174,16 @@ bool Debugger::cmdAttack(int argc, const char **argv) {
}
AvatarMoverProcess *proc = engine->getAvatarMoverProcess();
if (proc) {
- proc->tryAttack();
+ proc->setMovementFlag(AvatarMoverProcess::MOVE_ATTACKING);
+ }
+ return false;
+}
+
+bool Debugger::cmdStopAttack(int argc, const char **argv) {
+ Ultima8Engine *engine = Ultima8Engine::get_instance();
+ AvatarMoverProcess *proc = engine->getAvatarMoverProcess();
+ if (proc) {
+ proc->clearMovementFlag(AvatarMoverProcess::MOVE_ATTACKING);
}
return false;
}
diff --git a/engines/ultima/ultima8/misc/debugger.h b/engines/ultima/ultima8/misc/debugger.h
index bdd7b74adb..4bda81dd01 100644
--- a/engines/ultima/ultima8/misc/debugger.h
+++ b/engines/ultima/ultima8/misc/debugger.h
@@ -174,7 +174,8 @@ private:
bool cmdStopMoveRun(int argc, const char **argv);
bool cmdStartMoveStep(int argc, const char **argv);
bool cmdStopMoveStep(int argc, const char **argv);
- bool cmdAttack(int argc, const char **argv);
+ bool cmdStartAttack(int argc, const char **argv);
+ bool cmdStopAttack(int argc, const char **argv);
bool cmdCameraOnAvatar(int argc, const char **argv);
diff --git a/engines/ultima/ultima8/world/actors/avatar_mover_process.h b/engines/ultima/ultima8/world/actors/avatar_mover_process.h
index 04558e55dd..995250299e 100644
--- a/engines/ultima/ultima8/world/actors/avatar_mover_process.h
+++ b/engines/ultima/ultima8/world/actors/avatar_mover_process.h
@@ -61,25 +61,26 @@ public:
void onMouseDown(int button, int32 mx, int32 my);
void onMouseUp(int button);
- virtual void tryAttack() = 0;
-
enum MovementFlags {
MOVE_MOUSE_DIRECTION = 0x001,
- MOVE_RUN = 0x002,
+ MOVE_RUN = 0x0002,
MOVE_STEP = 0x0004, // also side-steps in crusader
MOVE_JUMP = 0x0008, // used for roll in crusader (when combined with left/right), and crouch (when combined with back)
// Tank controls
- MOVE_TURN_LEFT = 0x0010,
+ MOVE_TURN_LEFT = 0x0010,
MOVE_TURN_RIGHT = 0x0020,
- MOVE_FORWARD = 0x0040,
- MOVE_BACK = 0x0080,
+ MOVE_FORWARD = 0x0040,
+ MOVE_BACK = 0x0080,
// Directional controls
- MOVE_LEFT = 0x0100,
+ MOVE_LEFT = 0x0100,
MOVE_RIGHT = 0x0200,
- MOVE_UP = 0x0400,
- MOVE_DOWN = 0x0800,
+ MOVE_UP = 0x0400,
+ MOVE_DOWN = 0x0800,
+
+ // Firing weapon (Crusader only)
+ MOVE_ATTACKING = 0x1000,
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 66a3a4c2da..734f2c2300 100644
--- a/engines/ultima/ultima8/world/actors/cru_avatar_mover_process.cpp
+++ b/engines/ultima/ultima8/world/actors/cru_avatar_mover_process.cpp
@@ -103,6 +103,7 @@ void CruAvatarMoverProcess::run() {
Direction dir = getTurnDirForTurnFlags(curdir, dirmode);
clearMovementFlag(MOVE_TURN_LEFT | MOVE_TURN_RIGHT);
step(anim, dir);
+ return;
}
}
@@ -263,6 +264,11 @@ void CruAvatarMoverProcess::handleCombatMode() {
return;
}
+ if (hasMovementFlags(MOVE_ATTACKING) && !hasMovementFlags(MOVE_FORWARD | MOVE_BACK)) {
+ tryAttack();
+ return;
+ }
+
if (_isAnimRunningJumping(lastanim) || _isAnimStartRunning(idleanim)) {
idleanim = Animation::stopRunningAndDrawSmallWeapon;
}
@@ -365,6 +371,11 @@ void CruAvatarMoverProcess::handleNormalMode() {
if (avatar->isBusy())
return;
+ if (hasMovementFlags(MOVE_ATTACKING) && !hasMovementFlags(MOVE_FORWARD | MOVE_BACK)) {
+ tryAttack();
+ return;
+ }
+
// not doing anything in particular? stand
if (lastanim != Animation::stand && currentIdleTime == 0) {
waitFor(avatar->doAnim(Animation::stand, direction));
@@ -531,7 +542,6 @@ void CruAvatarMoverProcess::tryAttack() {
Animation::Sequence fireanim = (avatar->isKneeling() ?
Animation::kneelAndFire : Animation::attack);
uint16 fireanimpid = avatar->doAnim(fireanim, dir);
- waitFor(fireanimpid);
if (wpn->getShape() == 0x332)
_SGA1Loaded = false;
@@ -545,6 +555,8 @@ void CruAvatarMoverProcess::tryAttack() {
if (wpninfo->_shotDelay) {
waitFor(kernel->addProcess(new DelayProcess(wpninfo->_shotDelay)));
+ } else {
+ waitFor(fireanimpid);
}
}
}
diff --git a/engines/ultima/ultima8/world/actors/cru_avatar_mover_process.h b/engines/ultima/ultima8/world/actors/cru_avatar_mover_process.h
index 2672e2e7bb..f892995ccf 100644
--- a/engines/ultima/ultima8/world/actors/cru_avatar_mover_process.h
+++ b/engines/ultima/ultima8/world/actors/cru_avatar_mover_process.h
@@ -46,13 +46,13 @@ public:
bool loadData(Common::ReadStream *rs, uint32 version);
void saveData(Common::WriteStream *ws) override;
- void tryAttack() override;
-
double getAvatarAngleDegrees() const {
return static_cast<double>(_avatarAngle) / 100.0;
}
private:
+ /** Try readying or firing weapon. */
+ void tryAttack();
/**
* Angle of avatar in centidegrees (1/100deg). The original game runs the keyboard
diff --git a/engines/ultima/ultima8/world/actors/u8_avatar_mover_process.cpp b/engines/ultima/ultima8/world/actors/u8_avatar_mover_process.cpp
index 7a395c1253..c18f0890e1 100644
--- a/engines/ultima/ultima8/world/actors/u8_avatar_mover_process.cpp
+++ b/engines/ultima/ultima8/world/actors/u8_avatar_mover_process.cpp
@@ -755,10 +755,6 @@ bool U8AvatarMoverProcess::canAttack() {
return (Kernel::get_instance()->getFrameNum() > _lastAttack + (25 - avatar->getDex()));
}
-void U8AvatarMoverProcess::tryAttack() {
- error("tryAttack should only be called in Crusader");
-}
-
void U8AvatarMoverProcess::saveData(Common::WriteStream *ws) {
AvatarMoverProcess::saveData(ws);
// Note: this field used to be the last thing saved in AvatarMoverProcess,
diff --git a/engines/ultima/ultima8/world/actors/u8_avatar_mover_process.h b/engines/ultima/ultima8/world/actors/u8_avatar_mover_process.h
index ff0c63c404..e6c594a9aa 100644
--- a/engines/ultima/ultima8/world/actors/u8_avatar_mover_process.h
+++ b/engines/ultima/ultima8/world/actors/u8_avatar_mover_process.h
@@ -44,8 +44,6 @@ public:
bool loadData(Common::ReadStream *rs, uint32 version);
void saveData(Common::WriteStream *ws) override;
- void tryAttack() override;
-
protected:
void handleHangingMode() override;
void handleCombatMode() override;
Commit: 07dee61a7256ada48caf91592420499e6f5c7776
https://github.com/scummvm/scummvm/commit/07dee61a7256ada48caf91592420499e6f5c7776
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2021-05-16T18:21:38+09:00
Commit Message:
ULTIMA8: Add No Remorse data to FireTypeTable
Changed paths:
engines/ultima/ultima8/world/fire_type_table.cpp
diff --git a/engines/ultima/ultima8/world/fire_type_table.cpp b/engines/ultima/ultima8/world/fire_type_table.cpp
index 132ecd7c4d..197353971f 100644
--- a/engines/ultima/ultima8/world/fire_type_table.cpp
+++ b/engines/ultima/ultima8/world/fire_type_table.cpp
@@ -24,36 +24,70 @@
#include "ultima/ultima8/world/fire_type_table.h"
#include "ultima/ultima8/world/fire_type.h"
+#include "ultima/ultima8/ultima8.h"
namespace Ultima {
namespace Ultima8 {
static FireType FIRE_TYPE_TABLE_REM[] = {
// Extracted from CRUSADER.EXE 1478:252a
- FireType(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0),
- FireType(0x1, 0x12, 0x19, 0x0, 0x1, 0x82, 0x7, 0x0, 0xc, 0x3e8, 0x0),
- FireType(0x2, 0xa, 0x11, 0x0, 0x8, 0x50, 0x7, 0x0, 0xc, 0x3e8, 0x0),
- FireType(0x3, 0xc8, 0xc8, 0xa, 0x1, 0x0, 0x0, 0x1, 0x3, 0x3e8, 0x1),
- FireType(0x4, 0x96, 0x96, 0xa, 0x1, 0x0, 0x0, 0x0, 0x1, 0x3e8, 0x1),
- FireType(0x5, 0x19, 0x2d, 0x0, 0x1, 0x190, 0x6, 0x0, 0x4, 0x3e8, 0x1),
- FireType(0x6, 0xf, 0x23, 0x0, 0x1, 0x177, 0x6, 0x1, 0x4, 0x3e8, 0x1),
- FireType(0x7, 0x5, 0x5, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x3e8, 0x1),
- FireType(0x8, 0x5, 0x5, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x3e8, 0x0),
- FireType(0x9, 0xa, 0xf, 0x0, 0x1, 0x12c, 0x6, 0x1, 0x1, 0x64, 0x1),
- FireType(0xa, 0x2d, 0x50, 0xa, 0x3, 0x0, 0x0, 0x0, 0x3, 0x64, 0x1),
- FireType(0xb, 0xe, 0x14, 0x0, 0x1, 0x50, 0x7, 0x0, 0xc, 0x3e8, 0x0),
- FireType(0xc, 0x5, 0x5, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x3e8, 0x0),
- FireType(0xd, 0xa, 0x11, 0x0, 0x5, 0x50, 0x7, 0x0, 0xc, 0x3e8, 0x0),
- FireType(0xe, 0xfa, 0xfa, 0x4, 0x1, 0x9c4, 0x4, 0x1, 0x3, 0x3e8, 0x1),
- FireType(0xf, 0x23, 0x37, 0x4, 0x1, 0x2ee, 0x4, 0x0, 0x3, 0x3e8, 0x1),
+ // FType Hign Dmg Num Shots Sh.Mask Cells/Rnd Near Sprite
+ // Low Dmg Range Shield Cost Accurat Rnd Dur
+ FireType(0x0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
+ FireType(0x1, 0x12, 0x19, 0, 1, 0x82, 0x7, 0, 0xc, 1000, 0),
+ FireType(0x2, 0xa, 0x11, 0, 8, 0x50, 0x7, 0, 0xc, 1000, 0),
+ FireType(0x3, 0xc8, 0xc8, 10, 1, 0, 0, 1, 0x3, 1000, 1),
+ FireType(0x4, 0x96, 0x96, 10, 1, 0, 0, 0, 0x1, 1000, 1),
+ FireType(0x5, 0x19, 0x2d, 0, 1, 0x190, 0x6, 0, 0x4, 1000, 1),
+ FireType(0x6, 0xf, 0x23, 0, 1, 0x177, 0x6, 1, 0x4, 1000, 1),
+ FireType(0x7, 0x5, 0x5, 0, 1, 0, 0, 0, 0x1, 1000, 1),
+ FireType(0x8, 0x5, 0x5, 0, 1, 0, 0, 0, 0x1, 1000, 0),
+ FireType(0x9, 0xa, 0xf, 0, 1, 0x12c, 0x6, 1, 0x1, 100, 1),
+ FireType(0xa, 0x2d, 0x50, 10, 3, 0, 0, 0, 0x3, 100, 1),
+ FireType(0xb, 0xe, 0x14, 0, 1, 0x50, 0x7, 0, 0xc, 1000, 0),
+ FireType(0xc, 0x5, 0x5, 0, 1, 0, 0, 0, 0x1, 1000, 0),
+ FireType(0xd, 0xa, 0x11, 0, 5, 0x50, 0x7, 0, 0xc, 1000, 0),
+ FireType(0xe, 0xfa, 0xfa, 4, 1, 0x9c4, 0x4, 1, 0x3, 1000, 1),
+ FireType(0xf, 0x23, 0x37, 4, 1, 0x2ee, 0x4, 0, 0x3, 1000, 1),
};
-static const int FIRE_TYPE_TABLE_LEN = 16;
+static FireType FIRE_TYPE_TABLE_REG[] = {
+ // Extracted from REGRET.EXE 1480:2b2e
+ FireType(0x0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
+ FireType(0x1, 0x12, 0x19, 0, 1, 0x82, 0x7, 0, 0xc, 1000, 0),
+ FireType(0x2, 0xf, 0x14, 0, 10, 0x50, 0x7, 0, 0xc, 1000, 0),
+ FireType(0x3, 0xc8, 0xc8, 10, 1, 0x0, 0x0, 1, 0x3, 1000, 1),
+ FireType(0x4, 0x96, 0x96, 10, 1, 0x0, 0x0, 0, 0x1, 1000, 1),
+ FireType(0x5, 0x2d, 0x3c, 0, 1, 0x190, 0x6, 0, 0x4, 1000, 1),
+ FireType(0x6, 0x19, 0x1e, 0, 1, 0x12c, 0x6, 1, 0x4, 1000, 1),
+ FireType(0x7, 0x5, 0x5, 0, 1, 0x0, 0x0, 0, 0x1, 1000, 1),
+ FireType(0x8, 0x5, 0x5, 0, 1, 0x0, 0x0, 0, 0x1, 1000, 0),
+ FireType(0x9, 0xa, 0xf, 0, 1, 0x12c, 0x6, 1, 0x1, 100, 1),
+ FireType(0xa, 0x2d, 0x50, 7, 3, 0x0, 0x0, 0, 0x3, 100, 1),
+ FireType(0xb, 0xe, 0x14, 0, 1, 0x50, 0x7, 0, 0xc, 1000, 0),
+ FireType(0xc, 0x5, 0x5, 0, 1, 0x0, 0x0, 0, 0x1, 1000, 0),
+ FireType(0xd, 0xf, 0x14, 0, 10, 0x50, 0x7, 0, 0xc, 1000, 0),
+ FireType(0xe, 0xfa, 0xfa, 4, 1, 0x9c4, 0x4, 1, 0x3, 1000, 1),
+ FireType(0xf, 0x32, 0x4b, 4, 1, 0x2ee, 0x4, 0, 0x3, 1000, 1),
+ FireType(0x10, 0x4b, 0x64, 3, 1, 0x1f4, 0x4, 0, 0x3, 1000, 1),
+ FireType(0x11, 0x7d, 0x96, 0, 1, 0x4e2, 0x4, 0, 0x3, 1000, 1),
+ FireType(0x12, 0x14, 0x14, 0, 1, 0x0, 0x0, 0, 0x3, 1000, 1),
+ FireType(0x13, 0x5, 0x5, 0, 1, 0x0, 0x0, 0, 0x3, 1000, 1),
+ FireType(0x14, 0x64, 0x7d, 0, 1, 0x384, 0x4, 0, 0x3, 1000, 1),
+ FireType(0x15, 0x1e, 0x32, 0, 1, 0x15e, 0x7, 0, 0x3, 1000, 1),
+ FireType(0x16, 0x2d, 0x50, 7, 1, 0x0, 0x0, 1, 0x3, 1000, 1)
+};
const FireType *FireTypeTable::get(uint16 type) {
- if (type >= FIRE_TYPE_TABLE_LEN)
- return nullptr;
- return &FIRE_TYPE_TABLE_REM[type];
+ if (GAME_IS_REMORSE) {
+ if (type >= ARRAYSIZE(FIRE_TYPE_TABLE_REM))
+ return nullptr;
+ return &FIRE_TYPE_TABLE_REM[type];
+ } else {
+ if (type >= ARRAYSIZE(FIRE_TYPE_TABLE_REG))
+ return nullptr;
+ return &FIRE_TYPE_TABLE_REG[type];
+ }
}
} // End of namespace Ultima8
Commit: f5d4a91576a5658724c8dd7670b35f79af595c44
https://github.com/scummvm/scummvm/commit/f5d4a91576a5658724c8dd7670b35f79af595c44
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2021-05-16T18:21:38+09:00
Commit Message:
ULTIMA8: Use bool type for two firetype flags
Changed paths:
engines/ultima/ultima8/world/fire_type.cpp
engines/ultima/ultima8/world/fire_type.h
diff --git a/engines/ultima/ultima8/world/fire_type.cpp b/engines/ultima/ultima8/world/fire_type.cpp
index 665d18b03d..833f75732d 100644
--- a/engines/ultima/ultima8/world/fire_type.cpp
+++ b/engines/ultima/ultima8/world/fire_type.cpp
@@ -37,13 +37,14 @@ namespace Ultima {
namespace Ultima8 {
FireType::FireType(uint16 typeNo, uint16 minDamage, uint16 maxDamage, uint8 range,
- uint8 numShots, uint16 shieldCost, uint8 shieldMask, uint8 accurate,
- uint16 cellsPerRound, uint16 roundDuration, uint8 nearSprite) :
+ uint8 numShots, uint16 shieldCost, uint8 shieldMask, bool accurate,
+ uint16 cellsPerRound, uint16 roundDuration, bool nearSprite) :
_typeNo(typeNo), _minDamage(minDamage), _maxDamage(maxDamage),
_range(range), _numShots(numShots), _shieldCost(shieldCost),
_shieldMask(shieldMask), _accurate(accurate),
_cellsPerRound(cellsPerRound), _roundDuration(roundDuration),
_nearSprite(nearSprite) {
+ assert(maxDamage >= minDamage);
}
uint16 FireType::getRandomDamage() const {
diff --git a/engines/ultima/ultima8/world/fire_type.h b/engines/ultima/ultima8/world/fire_type.h
index 33061bae0e..2d8d9ac0da 100644
--- a/engines/ultima/ultima8/world/fire_type.h
+++ b/engines/ultima/ultima8/world/fire_type.h
@@ -35,8 +35,8 @@ struct Point3;
class FireType {
public:
FireType(uint16 typeNo, uint16 minDamage, uint16 maxDamage, uint8 range,
- uint8 numShots, uint16 shieldCost, uint8 shieldMask, uint8 accurate,
- uint16 cellsPerRound, uint16 roundDuration, uint8 nearSprite);
+ uint8 numShots, uint16 shieldCost, uint8 shieldMask, bool accurate,
+ uint16 cellsPerRound, uint16 roundDuration, bool nearSprite);
uint16 getTypeNo() const {
return _typeNo;
@@ -66,7 +66,7 @@ public:
return _shieldMask;
}
- uint8 getAccurate() const {
+ bool getAccurate() const {
return _accurate;
}
@@ -78,7 +78,7 @@ public:
return _roundDuration;
}
- uint8 getNearSprite() const {
+ bool getNearSprite() const {
return _nearSprite;
}
@@ -97,10 +97,10 @@ private:
uint8 _numShots;
uint16 _shieldCost;
uint8 _shieldMask;
- uint8 _accurate;
+ bool _accurate;
uint16 _cellsPerRound;
uint16 _roundDuration;
- uint8 _nearSprite;
+ bool _nearSprite;
};
}
Commit: 46982981f5064d875ddfb8aaf6c8d7a2d1e4ed9a
https://github.com/scummvm/scummvm/commit/46982981f5064d875ddfb8aaf6c8d7a2d1e4ed9a
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2021-05-16T18:21:38+09:00
Commit Message:
ULTIMA8: Update Crusader random weapon table for No Regret
Changed paths:
engines/ultima/ultima8/world/actors/npc_dat.cpp
diff --git a/engines/ultima/ultima8/world/actors/npc_dat.cpp b/engines/ultima/ultima8/world/actors/npc_dat.cpp
index 0b009733fb..357599df74 100644
--- a/engines/ultima/ultima8/world/actors/npc_dat.cpp
+++ b/engines/ultima/ultima8/world/actors/npc_dat.cpp
@@ -24,6 +24,7 @@
#include "ultima/ultima8/world/actors/npc_dat.h"
#include "ultima/ultima8/kernel/kernel.h"
+#include "ultima/ultima8/ultima8.h"
#include "common/memstream.h"
namespace Ultima {
@@ -79,11 +80,17 @@ Std::vector<NPCDat *> NPCDat::load(RawArchive *archive) {
return result;
}
+
/*static*/
uint16 NPCDat::randomlyGetStrongerWeaponTypes(uint shapeno) {
// Apologies for the massive stack of constants, that's how
// it is in the original (fn at 10a0:3b10) :(
+ // This also combines the version from No Regret, which is the same
+ // for 899, 0x371, 0x385, 0x1b4, 0x2cb, 0x528, 0x338, 0x4d1, 0x4e6,
+ // and other differences as noted.
+ // Some shapes are only valid in each game, but that's ok.
+
int rnd = getRandom();
switch (shapeno) {
@@ -94,10 +101,17 @@ uint16 NPCDat::randomlyGetStrongerWeaponTypes(uint shapeno) {
return 7;
case 0x2fd:
case 0x319: /* shape 793 - guardsq */
- if (rnd % 4 == 0)
- return 0xc;
- else
- return 3;
+ if (GAME_IS_REMORSE) {
+ if (rnd % 4 == 0)
+ return 0xc;
+ else
+ return 3;
+ } else {
+ if (rnd % 2 == 0)
+ return 8;
+ else
+ return 9;
+ }
case 0x1b4:
if (rnd % 4 == 0)
return 0xd;
@@ -148,8 +162,25 @@ uint16 NPCDat::randomlyGetStrongerWeaponTypes(uint shapeno) {
return 9;
else
return 8;
+ case 0x30c: // for No Remorse
+ if (rnd % 2 == 0)
+ return 4;
+ else
+ return 0xf;
+ case 0x308: // for No Remorse
+ if (rnd % 2 == 0)
+ return 10;
+ else
+ return 0xb;
+ case 0x57a: // for No Remorse
+ if (rnd % 2 == 0)
+ return 0xd;
+ else
+ return 0xf;
+ case 0x5e2: // for No Remorse
+ return 0xe;
default:
- return 7;
+ return GAME_IS_REMORSE ? 7 : 0xf;
}
}
Commit: 0ee35a1e1f9a576208c611502abbb95cc1abe0cc
https://github.com/scummvm/scummvm/commit/0ee35a1e1f9a576208c611502abbb95cc1abe0cc
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2021-05-16T18:21:38+09:00
Commit Message:
ULTIMA8: Get Crusader default HP from data table
Changed paths:
engines/ultima/ultima8/games/remorse_game.cpp
diff --git a/engines/ultima/ultima8/games/remorse_game.cpp b/engines/ultima/ultima8/games/remorse_game.cpp
index 676f67f2b8..3586986088 100644
--- a/engines/ultima/ultima8/games/remorse_game.cpp
+++ b/engines/ultima/ultima8/games/remorse_game.cpp
@@ -37,6 +37,7 @@
#include "ultima/ultima8/ultima8.h"
#include "ultima/ultima8/world/item_factory.h"
#include "ultima/ultima8/world/actors/main_actor.h"
+#include "ultima/ultima8/world/actors/npc_dat.h"
#include "common/memstream.h"
namespace Ultima {
@@ -105,16 +106,16 @@ bool RemorseGame::startGame() {
for (uint16 i = 384; i < 512; ++i)
objman->reserveObjId(i);
- // FIXME: fix flags and such
Actor *actor = ItemFactory::createActor(1, 0, 0, Item::FLG_IN_NPC_LIST,
1, 1, Item::EXT_PERMANENT_NPC, false);
if (!actor)
error("Couldn't create MainActor");
- // TODO: these should be read from DTable data.
+ const NPCDat *npcData = GameData::get_instance()->getNPCDataForShape(1);
+
actor->setStr(75);
- actor->setHP(150);
- actor->setInt(5000);
+ actor->setHP(npcData->getMaxHp());
+ actor->setInt(5000); // max mana (energy) is 2x intelligence, or 10000.
actor->setMana(2500);
ObjectManager::get_instance()->assignActorObjId(actor, 1);
Commit: 8d3e556e97e9cf6d2d562d7eb13316a3c7d004c0
https://github.com/scummvm/scummvm/commit/8d3e556e97e9cf6d2d562d7eb13316a3c7d004c0
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2021-05-16T20:36:57+09:00
Commit Message:
ULTIMA8: Clean up a Crusader TODO.
Changed paths:
engines/ultima/ultima8/world/actors/guard_process.cpp
diff --git a/engines/ultima/ultima8/world/actors/guard_process.cpp b/engines/ultima/ultima8/world/actors/guard_process.cpp
index 73de3fb143..7b65ac7e4d 100644
--- a/engines/ultima/ultima8/world/actors/guard_process.cpp
+++ b/engines/ultima/ultima8/world/actors/guard_process.cpp
@@ -65,12 +65,9 @@ void GuardProcess::run() {
waitFor(dp);
return;
} else {
- // TODO: What animation happens in here?
- int animno = (getRandom() % 2 ? 0x1e : 0x1f);
- int animproc = a->doAnim(static_cast<Animation::Sequence>(animno), dir_current);
- Process *animstand = new ActorAnimProcess(a, Animation::stand, dir_current, 0);
- Kernel::get_instance()->addProcess(animstand);
- animstand->waitFor(animproc);
+ Animation::Sequence anim = (getRandom() % 2 ? Animation::unknownAnim30 : Animation::startRunLargeWeapon);
+ int animproc = a->doAnim(anim, dir_current);
+ a->doAnimAfter(Animation::stand, dir_current, animproc);
}
return;
}
Commit: d5a5b5c5ed679e84d56c6515fd3b3026c2926ac7
https://github.com/scummvm/scummvm/commit/d5a5b5c5ed679e84d56c6515fd3b3026c2926ac7
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2021-05-16T20:36:57+09:00
Commit Message:
ULTIMA8: Add comments
Changed paths:
engines/ultima/ultima8/world/actors/guard_process.h
diff --git a/engines/ultima/ultima8/world/actors/guard_process.h b/engines/ultima/ultima8/world/actors/guard_process.h
index 0f54264261..9cbba9dcd8 100644
--- a/engines/ultima/ultima8/world/actors/guard_process.h
+++ b/engines/ultima/ultima8/world/actors/guard_process.h
@@ -30,6 +30,10 @@ namespace Ultima8 {
class Actor;
+/**
+ * A process for Crusader where the NPC mostly just stands around until
+ * they see the avatar.
+ */
class GuardProcess : public Process {
public:
GuardProcess();
Commit: ccc91e43caf86c75e8f7a1cff4ab33b3981a140e
https://github.com/scummvm/scummvm/commit/ccc91e43caf86c75e8f7a1cff4ab33b3981a140e
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2021-05-16T20:36:57+09:00
Commit Message:
ULTIMA8: Fix a TODO in Crusader attack, add another one for Regret
Changed paths:
engines/ultima/ultima8/world/actors/attack_process.cpp
diff --git a/engines/ultima/ultima8/world/actors/attack_process.cpp b/engines/ultima/ultima8/world/actors/attack_process.cpp
index e656b17a57..b3409c74a4 100644
--- a/engines/ultima/ultima8/world/actors/attack_process.cpp
+++ b/engines/ultima/ultima8/world/actors/attack_process.cpp
@@ -573,7 +573,7 @@ void AttackProcess::genericAttack() {
if (a->isInCombat()) {
if (randomOf(3) != 0) {
const Animation::Sequence lastanim = a->getLastAnim();
- if ((lastanim != Animation::unreadyWeapon)) // TODO: && (lastanim != Animation::unreadyLargeWeapon))
+ if ((lastanim != Animation::unreadyWeapon) && (lastanim != Animation::unreadyLargeWeapon))
a->doAnim(Animation::unreadyWeapon, dir_current);
else
a->doAnim(Animation::readyWeapon, dir_current);
@@ -755,6 +755,8 @@ void AttackProcess::genericAttack() {
}
void AttackProcess::checkRandomAttackSound(int now, uint32 shapeno) {
+ if (GAME_IS_REGRET)
+ warning("TODO: checkRandomAttackSound: Update for No Regret");
AudioProcess *audio = AudioProcess::get_instance();
int16 attacksound = -1;
if (!_playedStartSound) {
Commit: 3e0c3089e922779ff4116b1c024de8375e6fc8c3
https://github.com/scummvm/scummvm/commit/3e0c3089e922779ff4116b1c024de8375e6fc8c3
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2021-05-16T20:36:58+09:00
Commit Message:
ULTIMA8: Remove outdated FIXME and TODO comments
Changed paths:
engines/ultima/ultima8/graphics/anim_dat.cpp
engines/ultima/ultima8/usecode/uc_machine.cpp
engines/ultima/ultima8/usecode/uc_machine.h
engines/ultima/ultima8/world/actors/actor.cpp
engines/ultima/ultima8/world/super_sprite_process.cpp
diff --git a/engines/ultima/ultima8/graphics/anim_dat.cpp b/engines/ultima/ultima8/graphics/anim_dat.cpp
index f21e0b5e62..176fc808f9 100644
--- a/engines/ultima/ultima8/graphics/anim_dat.cpp
+++ b/engines/ultima/ultima8/graphics/anim_dat.cpp
@@ -116,7 +116,7 @@ uint32 AnimDat::getActionNumberForSequence(Animation::Sequence action, const Act
case Animation::fallBackwards:
return Animation::fallBackwardsCru;
case Animation::die:
- return Animation::fallBackwardsCru; // by default fall over backwards. TODO: randomly use Animation::fallForwardsCru for some deaths.
+ return Animation::fallBackwardsCru; // by default fall over backwards.
case Animation::advance:
return (smallwpn ? Animation::advanceSmallWeapon : Animation::advanceLargeWeapon);
// Kneel start/end never used in code - mover process uses correct ones.
diff --git a/engines/ultima/ultima8/usecode/uc_machine.cpp b/engines/ultima/ultima8/usecode/uc_machine.cpp
index 80f6ee0e18..ea1f222214 100644
--- a/engines/ultima/ultima8/usecode/uc_machine.cpp
+++ b/engines/ultima/ultima8/usecode/uc_machine.cpp
@@ -2444,7 +2444,7 @@ uint32 UCMachine::I_dummyProcess(const uint8 * /*args*/, unsigned int /*argsize*
uint32 UCMachine::I_getName(const uint8 * /*args*/, unsigned int /*argsize*/) {
UCMachine *uc = UCMachine::get_instance();
MainActor *av = getMainActor();
- // FIXME: This could be bad, we're keeping the reference to a string.c_str
+ // Note: assignString takes a copy
return uc->assignString(av->getName().c_str());
}
diff --git a/engines/ultima/ultima8/usecode/uc_machine.h b/engines/ultima/ultima8/usecode/uc_machine.h
index a119bc37c9..6942adaf8c 100644
--- a/engines/ultima/ultima8/usecode/uc_machine.h
+++ b/engines/ultima/ultima8/usecode/uc_machine.h
@@ -102,6 +102,7 @@ private:
Std::map<uint16, UCList *> _listHeap;
Std::map<uint16, Std::string> _stringHeap;
+ // Add a string to the list (copies the string)
uint16 assignString(const char *str);
uint16 assignList(UCList *l);
diff --git a/engines/ultima/ultima8/world/actors/actor.cpp b/engines/ultima/ultima8/world/actors/actor.cpp
index 6f84bea3fc..877c0969fa 100644
--- a/engines/ultima/ultima8/world/actors/actor.cpp
+++ b/engines/ultima/ultima8/world/actors/actor.cpp
@@ -1201,8 +1201,7 @@ void Actor::receiveHitU8(uint16 other, Direction dir, int damage, uint16 damage_
}
}
- // FIXME: What are the equivalent Crusader animations here?
- if (damage && !fallingprocid && GAME_IS_U8) {
+ if (damage && !fallingprocid) {
ProcId anim1pid = doAnim(Animation::stumbleBackwards, dir);
ProcId anim2pid;
if (isInCombat())
diff --git a/engines/ultima/ultima8/world/super_sprite_process.cpp b/engines/ultima/ultima8/world/super_sprite_process.cpp
index e155fe60fe..59f9b64ef2 100644
--- a/engines/ultima/ultima8/world/super_sprite_process.cpp
+++ b/engines/ultima/ultima8/world/super_sprite_process.cpp
@@ -118,7 +118,6 @@ SuperSpriteProcess::SuperSpriteProcess(int shape, int frame, int sx, int sy, int
}
float travel = _destpt.maxDistXYZ(_nextpt);
- // FIXME: how to get this scaled correctly?
float speed = firetypedat->getCellsPerRound() * 32.0f;
float rounds = travel / speed;
if (rounds < 1)
More information about the Scummvm-git-logs
mailing list