mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-05 01:38:36 +00:00
ULTIMA8: Add Crusader single-key steps and rolls
This commit is contained in:
parent
5f86c391ec
commit
99261d855e
@ -89,16 +89,21 @@ static const KeybindingRecord CRUSADER_KEYS[] = {
|
||||
{ ACTION_ATTACK, "ATTACK", "Attack", "AvatarMoverProcess::startAttack", "AvatarMoverProcess::stopAttack", "SPACE", "KP0" },
|
||||
{ ACTION_CAMERA_AVATAR, "CAMERA_AVATAR", "Focus Camera on Silencer", "CameraProcess::moveToAvatar", nullptr, "z", nullptr },
|
||||
{ ACTION_JUMP, "JUMP", "Jump / Roll / Crouch", "AvatarMoverProcess::startJump", "AvatarMoverProcess::stopJump", "LCTRL", nullptr },
|
||||
{ ACTION_SHORT_JUMP, "SHORT_JUMP", "Short Jump", "AvatarMoverProcess::shortJump", nullptr, "TAB", nullptr },
|
||||
// TODO: MOVE_STEP should also be mapped to KP_DIVIDE?? Actually original key was advance, slightly different
|
||||
{ ACTION_SHORT_JUMP, "SHORT_JUMP", "Short Jump", "AvatarMoverProcess::shortJump", nullptr, "TAB", "j" },
|
||||
{ ACTION_STEP_LEFT, "STEP_LEFT", "Sidestep Left", "AvatarMoverProcess::stepLeft", nullptr, "DELETE", "KP7" },
|
||||
{ ACTION_STEP_RIGHT, "STEP_RIGHT", "Sidestep Rgiht", "AvatarMoverProcess::stepRight", nullptr, "PAGEDOWN", "KP9" },
|
||||
{ ACTION_STEP_FORWARD, "STEP_FORWARD", "Step Forward", "AvatarMoverProcess::stepForward", nullptr, "HOME", "KP_DIVIDE" },
|
||||
{ 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_MOVE_STEP, "MOVE_STEP", "Side Step / Advance / Retreat", "AvatarMoverProcess::startMoveStep", "AvatarMoverProcess::stopMoveStep", "LALT", "JOY_RIGHT_SHOULDER" },
|
||||
{ ACTION_NONE, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr }
|
||||
};
|
||||
|
||||
static const KeybindingRecord CHEAT_KEYS[] = {
|
||||
{ ACTION_CLIPPING, "CLIPPING", "Toggle Clipping", "QuickAvatarMoverProcess::toggleClipping", nullptr, "INSERT", nullptr },
|
||||
{ ACTION_QUICK_MOVE_ASCEND, "ASCEND", "Ascend", "QuickAvatarMoverProcess::startAscend", "QuickAvatarMoverProcess::stopAscend", "HOME", nullptr },
|
||||
{ ACTION_QUICK_MOVE_DESCEND, "DESCEND", "Descend", "QuickAvatarMoverProcess::startDescend", "QuickAvatarMoverProcess::stopDescend", "END", nullptr },
|
||||
{ ACTION_CLIPPING, "CLIPPING", "Toggle Clipping", "QuickAvatarMoverProcess::toggleClipping", nullptr, "M+INSERT", nullptr },
|
||||
{ ACTION_QUICK_MOVE_ASCEND, "ASCEND", "Ascend", "QuickAvatarMoverProcess::startAscend", "QuickAvatarMoverProcess::stopAscend", "M+HOME", nullptr },
|
||||
{ ACTION_QUICK_MOVE_DESCEND, "DESCEND", "Descend", "QuickAvatarMoverProcess::startDescend", "QuickAvatarMoverProcess::stopDescend", "M+END", nullptr },
|
||||
{ ACTION_QUICK_MOVE_UP, "MOVE_UP", "Move Up", "QuickAvatarMoverProcess::startMoveUp", "QuickAvatarMoverProcess::stopMoveUp", "M+UP", nullptr },
|
||||
{ ACTION_QUICK_MOVE_DOWN, "MOVE_DOWN", "Move Down", "QuickAvatarMoverProcess::startMoveDown", "QuickAvatarMoverProcess::stopMoveDown", "M+DOWN", nullptr },
|
||||
{ ACTION_QUICK_MOVE_LEFT, "MOVE_LEFT", "Move Left", "QuickAvatarMoverProcess::startMoveLeft", "QuickAvatarMoverProcess::stopMoveLeft", "M+LEFT", nullptr },
|
||||
|
@ -39,7 +39,8 @@ enum KeybindingAction {
|
||||
ACTION_SHORT_JUMP, ACTION_TURN_LEFT, ACTION_TURN_RIGHT, ACTION_MOVE_FORWARD,
|
||||
ACTION_MOVE_BACK, ACTION_MOVE_UP, ACTION_MOVE_DOWN, ACTION_MOVE_LEFT,
|
||||
ACTION_MOVE_RIGHT, ACTION_MOVE_RUN, ACTION_MOVE_STEP, ACTION_ATTACK,
|
||||
ACTION_CAMERA_AVATAR,
|
||||
ACTION_STEP_LEFT, ACTION_STEP_RIGHT, ACTION_STEP_FORWARD,
|
||||
ACTION_STEP_BACK, ACTION_ROLL_LEFT, ACTION_ROLL_RIGHT, ACTION_CAMERA_AVATAR,
|
||||
|
||||
ACTION_CLIPPING, ACTION_DEC_SORT_ORDER,
|
||||
ACTION_INC_SORT_ORDER, ACTION_QUICK_MOVE_ASCEND, ACTION_QUICK_MOVE_DESCEND,
|
||||
|
@ -89,7 +89,6 @@ Debugger::Debugger() : Shared::Debugger() {
|
||||
|
||||
registerCmd("AvatarMoverProcess::startJump", WRAP_METHOD(Debugger, cmdStartJump));
|
||||
registerCmd("AvatarMoverProcess::stopJump", WRAP_METHOD(Debugger, cmdStopJump));
|
||||
registerCmd("AvatarMoverProcess::shortJump", WRAP_METHOD(Debugger, cmdShortJump));
|
||||
registerCmd("AvatarMoverProcess::startTurnLeft", WRAP_METHOD(Debugger, cmdStartTurnLeft));
|
||||
registerCmd("AvatarMoverProcess::startTurnRight", WRAP_METHOD(Debugger, cmdStartTurnRight));
|
||||
registerCmd("AvatarMoverProcess::startMoveForward", WRAP_METHOD(Debugger, cmdStartMoveForward));
|
||||
@ -115,6 +114,14 @@ Debugger::Debugger() : Shared::Debugger() {
|
||||
registerCmd("AvatarMoverProcess::startAttack", WRAP_METHOD(Debugger, cmdStartAttack));
|
||||
registerCmd("AvatarMoverProcess::stopAttack", WRAP_METHOD(Debugger, cmdStopAttack));
|
||||
|
||||
registerCmd("AvatarMoverProcess::shortJump", WRAP_METHOD(Debugger, cmdShortJump));
|
||||
registerCmd("AvatarMoverProcess::stepLeft", WRAP_METHOD(Debugger, cmdStepLeft));
|
||||
registerCmd("AvatarMoverProcess::stepRight", WRAP_METHOD(Debugger, cmdStepRight));
|
||||
registerCmd("AvatarMoverProcess::stepForward", WRAP_METHOD(Debugger, cmdStepForward));
|
||||
registerCmd("AvatarMoverProcess::stepBack", WRAP_METHOD(Debugger, cmdStepBack));
|
||||
registerCmd("AvatarMoverProcess::rollLeft", WRAP_METHOD(Debugger, cmdRollLeft));
|
||||
registerCmd("AvatarMoverProcess::rollRight", WRAP_METHOD(Debugger, cmdRollRight));
|
||||
|
||||
registerCmd("CameraProcess::moveToAvatar", WRAP_METHOD(Debugger, cmdCameraOnAvatar));
|
||||
|
||||
registerCmd("AudioProcess::listSFX", WRAP_METHOD(Debugger, cmdListSFX));
|
||||
@ -1201,28 +1208,6 @@ bool Debugger::cmdUseKeyring(int argc, const char **argv) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Debugger::cmdStartAttack(int argc, const char **argv) {
|
||||
Ultima8Engine *engine = Ultima8Engine::get_instance();
|
||||
if (engine->isAvatarInStasis()) {
|
||||
debugPrintf("Can't attack: avatarInStasis\n");
|
||||
return false;
|
||||
}
|
||||
AvatarMoverProcess *proc = engine->getAvatarMoverProcess();
|
||||
if (proc) {
|
||||
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;
|
||||
}
|
||||
|
||||
bool Debugger::cmdCameraOnAvatar(int argc, const char **argv) {
|
||||
if (Ultima8Engine::get_instance()->isCruStasis()) {
|
||||
debugPrintf("Can't move camera: cruStasis\n");
|
||||
@ -1238,302 +1223,155 @@ bool Debugger::cmdCameraOnAvatar(int argc, const char **argv) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Debugger::cmdStartJump(int argc, const char **argv) {
|
||||
static bool _avatarMoveKey(uint32 flag, const char *debugname) {
|
||||
Ultima8Engine *engine = Ultima8Engine::get_instance();
|
||||
engine->moveKeyEvent();
|
||||
if (engine->isAvatarInStasis()) {
|
||||
debugPrintf("Can't jump: avatarInStasis\n");
|
||||
debug("Can't %s: avatarInStasis\n", debugname);
|
||||
return false;
|
||||
}
|
||||
AvatarMoverProcess *proc = engine->getAvatarMoverProcess();
|
||||
|
||||
if (proc) {
|
||||
proc->setMovementFlag(AvatarMoverProcess::MOVE_JUMP);
|
||||
proc->setMovementFlag(flag);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool _avatarMoveKeyEnd(uint32 flag) {
|
||||
Ultima8Engine *engine = Ultima8Engine::get_instance();
|
||||
engine->moveKeyEvent();
|
||||
|
||||
AvatarMoverProcess *proc = engine->getAvatarMoverProcess();
|
||||
if (proc) {
|
||||
proc->clearMovementFlag(flag);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Debugger::cmdStartAttack(int argc, const char **argv) {
|
||||
return _avatarMoveKey(AvatarMoverProcess::MOVE_ATTACKING, "attack");
|
||||
}
|
||||
|
||||
bool Debugger::cmdStopAttack(int argc, const char **argv) {
|
||||
return _avatarMoveKeyEnd(AvatarMoverProcess::MOVE_ATTACKING);
|
||||
}
|
||||
|
||||
bool Debugger::cmdStartJump(int argc, const char **argv) {
|
||||
return _avatarMoveKey(AvatarMoverProcess::MOVE_JUMP, "jump");
|
||||
}
|
||||
|
||||
bool Debugger::cmdStopJump(int argc, const char **argv) {
|
||||
Ultima8Engine *engine = Ultima8Engine::get_instance();
|
||||
|
||||
AvatarMoverProcess *proc = engine->getAvatarMoverProcess();
|
||||
if (proc) {
|
||||
proc->clearMovementFlag(AvatarMoverProcess::MOVE_JUMP);
|
||||
}
|
||||
return false;
|
||||
return _avatarMoveKeyEnd(AvatarMoverProcess::MOVE_JUMP);
|
||||
}
|
||||
|
||||
bool Debugger::cmdShortJump(int argc, const char **argv) {
|
||||
Ultima8Engine *engine = Ultima8Engine::get_instance();
|
||||
|
||||
AvatarMoverProcess *proc = engine->getAvatarMoverProcess();
|
||||
if (proc) {
|
||||
proc->setMovementFlag(AvatarMoverProcess::MOVE_SHORT_JUMP);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool Debugger::cmdStartTurnLeft(int argc, const char **argv) {
|
||||
Ultima8Engine *engine = Ultima8Engine::get_instance();
|
||||
engine->moveKeyEvent();
|
||||
if (engine->isAvatarInStasis()) {
|
||||
debugPrintf("Can't turn left: avatarInStasis\n");
|
||||
return false;
|
||||
}
|
||||
AvatarMoverProcess *proc = engine->getAvatarMoverProcess();
|
||||
|
||||
if (proc) {
|
||||
proc->setMovementFlag(AvatarMoverProcess::MOVE_TURN_LEFT);
|
||||
}
|
||||
return false;
|
||||
return _avatarMoveKey(AvatarMoverProcess::MOVE_TURN_LEFT, "turn left");
|
||||
}
|
||||
|
||||
bool Debugger::cmdStartTurnRight(int argc, const char **argv) {
|
||||
Ultima8Engine *engine = Ultima8Engine::get_instance();
|
||||
engine->moveKeyEvent();
|
||||
if (engine->isAvatarInStasis()) {
|
||||
debugPrintf("Can't turn right: avatarInStasis\n");
|
||||
return false;
|
||||
}
|
||||
AvatarMoverProcess *proc = engine->getAvatarMoverProcess();
|
||||
|
||||
if (proc) {
|
||||
proc->setMovementFlag(AvatarMoverProcess::MOVE_TURN_RIGHT);
|
||||
}
|
||||
return false;
|
||||
return _avatarMoveKey(AvatarMoverProcess::MOVE_TURN_RIGHT, "turn right");
|
||||
}
|
||||
|
||||
bool Debugger::cmdStartMoveForward(int argc, const char **argv) {
|
||||
Ultima8Engine *engine = Ultima8Engine::get_instance();
|
||||
engine->moveKeyEvent();
|
||||
if (engine->isAvatarInStasis()) {
|
||||
debugPrintf("Can't move forward: avatarInStasis\n");
|
||||
return false;
|
||||
}
|
||||
AvatarMoverProcess *proc = engine->getAvatarMoverProcess();
|
||||
|
||||
if (proc) {
|
||||
proc->setMovementFlag(AvatarMoverProcess::MOVE_FORWARD);
|
||||
}
|
||||
return false;
|
||||
return _avatarMoveKey(AvatarMoverProcess::MOVE_FORWARD, "move forward");
|
||||
}
|
||||
|
||||
bool Debugger::cmdStartMoveBack(int argc, const char **argv) {
|
||||
Ultima8Engine *engine = Ultima8Engine::get_instance();
|
||||
engine->moveKeyEvent();
|
||||
if (engine->isAvatarInStasis()) {
|
||||
debugPrintf("Can't move back: avatarInStasis\n");
|
||||
return false;
|
||||
}
|
||||
AvatarMoverProcess *proc = engine->getAvatarMoverProcess();
|
||||
|
||||
if (proc) {
|
||||
proc->setMovementFlag(AvatarMoverProcess::MOVE_BACK);
|
||||
}
|
||||
return false;
|
||||
return _avatarMoveKey(AvatarMoverProcess::MOVE_BACK, "move back");
|
||||
}
|
||||
|
||||
bool Debugger::cmdStartMoveLeft(int argc, const char **argv) {
|
||||
Ultima8Engine *engine = Ultima8Engine::get_instance();
|
||||
engine->moveKeyEvent();
|
||||
if (engine->isAvatarInStasis()) {
|
||||
debugPrintf("Can't move left: avatarInStasis\n");
|
||||
return false;
|
||||
}
|
||||
AvatarMoverProcess *proc = engine->getAvatarMoverProcess();
|
||||
|
||||
if (proc) {
|
||||
proc->setMovementFlag(AvatarMoverProcess::MOVE_LEFT);
|
||||
}
|
||||
return false;
|
||||
return _avatarMoveKey(AvatarMoverProcess::MOVE_LEFT, "move left");
|
||||
}
|
||||
|
||||
bool Debugger::cmdStartMoveRight(int argc, const char **argv) {
|
||||
Ultima8Engine *engine = Ultima8Engine::get_instance();
|
||||
engine->moveKeyEvent();
|
||||
if (engine->isAvatarInStasis()) {
|
||||
debugPrintf("Can't move right: avatarInStasis\n");
|
||||
return false;
|
||||
}
|
||||
AvatarMoverProcess *proc = engine->getAvatarMoverProcess();
|
||||
|
||||
if (proc) {
|
||||
proc->setMovementFlag(AvatarMoverProcess::MOVE_RIGHT);
|
||||
}
|
||||
return false;
|
||||
return _avatarMoveKey(AvatarMoverProcess::MOVE_RIGHT, "move right");
|
||||
}
|
||||
|
||||
bool Debugger::cmdStartMoveUp(int argc, const char **argv) {
|
||||
Ultima8Engine *engine = Ultima8Engine::get_instance();
|
||||
engine->moveKeyEvent();
|
||||
if (engine->isAvatarInStasis()) {
|
||||
debugPrintf("Can't move up: avatarInStasis\n");
|
||||
return false;
|
||||
}
|
||||
AvatarMoverProcess *proc = engine->getAvatarMoverProcess();
|
||||
|
||||
if (proc) {
|
||||
proc->setMovementFlag(AvatarMoverProcess::MOVE_UP);
|
||||
}
|
||||
return false;
|
||||
return _avatarMoveKey(AvatarMoverProcess::MOVE_UP, "move up");
|
||||
}
|
||||
|
||||
bool Debugger::cmdStartMoveDown(int argc, const char **argv) {
|
||||
Ultima8Engine *engine = Ultima8Engine::get_instance();
|
||||
engine->moveKeyEvent();
|
||||
if (engine->isAvatarInStasis()) {
|
||||
debugPrintf("Can't move down: avatarInStasis\n");
|
||||
return false;
|
||||
}
|
||||
AvatarMoverProcess *proc = engine->getAvatarMoverProcess();
|
||||
|
||||
if (proc) {
|
||||
proc->setMovementFlag(AvatarMoverProcess::MOVE_DOWN);
|
||||
}
|
||||
return false;
|
||||
return _avatarMoveKey(AvatarMoverProcess::MOVE_DOWN, "move down");
|
||||
}
|
||||
|
||||
bool Debugger::cmdStopTurnLeft(int argc, const char **argv) {
|
||||
Ultima8Engine *engine = Ultima8Engine::get_instance();
|
||||
engine->moveKeyEvent();
|
||||
|
||||
AvatarMoverProcess *proc = engine->getAvatarMoverProcess();
|
||||
if (proc) {
|
||||
proc->clearMovementFlag(AvatarMoverProcess::MOVE_TURN_LEFT);
|
||||
}
|
||||
return false;
|
||||
return _avatarMoveKeyEnd(AvatarMoverProcess::MOVE_TURN_LEFT);
|
||||
}
|
||||
|
||||
bool Debugger::cmdStopTurnRight(int argc, const char **argv) {
|
||||
Ultima8Engine *engine = Ultima8Engine::get_instance();
|
||||
engine->moveKeyEvent();
|
||||
|
||||
AvatarMoverProcess *proc = engine->getAvatarMoverProcess();
|
||||
if (proc) {
|
||||
proc->clearMovementFlag(AvatarMoverProcess::MOVE_TURN_RIGHT);
|
||||
}
|
||||
return false;
|
||||
return _avatarMoveKeyEnd(AvatarMoverProcess::MOVE_TURN_RIGHT);
|
||||
}
|
||||
|
||||
bool Debugger::cmdStopMoveForward(int argc, const char **argv) {
|
||||
Ultima8Engine *engine = Ultima8Engine::get_instance();
|
||||
engine->moveKeyEvent();
|
||||
|
||||
AvatarMoverProcess *proc = engine->getAvatarMoverProcess();
|
||||
if (proc) {
|
||||
proc->clearMovementFlag(AvatarMoverProcess::MOVE_FORWARD);
|
||||
}
|
||||
return false;
|
||||
return _avatarMoveKeyEnd(AvatarMoverProcess::MOVE_FORWARD);
|
||||
}
|
||||
|
||||
bool Debugger::cmdStopMoveBack(int argc, const char **argv) {
|
||||
Ultima8Engine *engine = Ultima8Engine::get_instance();
|
||||
engine->moveKeyEvent();
|
||||
|
||||
AvatarMoverProcess *proc = engine->getAvatarMoverProcess();
|
||||
if (proc) {
|
||||
// Clear both back and forward as avatar turns then moves forward when not in combat
|
||||
proc->clearMovementFlag(AvatarMoverProcess::MOVE_BACK | AvatarMoverProcess::MOVE_FORWARD);
|
||||
}
|
||||
return false;
|
||||
// Clear both back and forward as avatar turns then moves forward when not in combat
|
||||
return _avatarMoveKeyEnd(AvatarMoverProcess::MOVE_BACK | AvatarMoverProcess::MOVE_FORWARD);
|
||||
}
|
||||
|
||||
bool Debugger::cmdStopMoveLeft(int argc, const char **argv) {
|
||||
Ultima8Engine *engine = Ultima8Engine::get_instance();
|
||||
engine->moveKeyEvent();
|
||||
|
||||
AvatarMoverProcess *proc = engine->getAvatarMoverProcess();
|
||||
if (proc) {
|
||||
proc->clearMovementFlag(AvatarMoverProcess::MOVE_LEFT);
|
||||
}
|
||||
return false;
|
||||
return _avatarMoveKeyEnd(AvatarMoverProcess::MOVE_LEFT);
|
||||
}
|
||||
|
||||
bool Debugger::cmdStopMoveRight(int argc, const char **argv) {
|
||||
Ultima8Engine *engine = Ultima8Engine::get_instance();
|
||||
engine->moveKeyEvent();
|
||||
|
||||
AvatarMoverProcess *proc = engine->getAvatarMoverProcess();
|
||||
if (proc) {
|
||||
proc->clearMovementFlag(AvatarMoverProcess::MOVE_RIGHT);
|
||||
}
|
||||
return false;
|
||||
return _avatarMoveKeyEnd(AvatarMoverProcess::MOVE_RIGHT);
|
||||
}
|
||||
|
||||
bool Debugger::cmdStopMoveUp(int argc, const char **argv) {
|
||||
Ultima8Engine *engine = Ultima8Engine::get_instance();
|
||||
engine->moveKeyEvent();
|
||||
|
||||
AvatarMoverProcess *proc = engine->getAvatarMoverProcess();
|
||||
if (proc) {
|
||||
proc->clearMovementFlag(AvatarMoverProcess::MOVE_UP);
|
||||
}
|
||||
return false;
|
||||
return _avatarMoveKeyEnd(AvatarMoverProcess::MOVE_UP);
|
||||
}
|
||||
|
||||
bool Debugger::cmdStopMoveDown(int argc, const char **argv) {
|
||||
Ultima8Engine *engine = Ultima8Engine::get_instance();
|
||||
engine->moveKeyEvent();
|
||||
|
||||
AvatarMoverProcess *proc = engine->getAvatarMoverProcess();
|
||||
if (proc) {
|
||||
proc->clearMovementFlag(AvatarMoverProcess::MOVE_DOWN);
|
||||
}
|
||||
return false;
|
||||
return _avatarMoveKeyEnd(AvatarMoverProcess::MOVE_DOWN);
|
||||
}
|
||||
|
||||
bool Debugger::cmdStartMoveRun(int argc, const char **argv) {
|
||||
Ultima8Engine *engine = Ultima8Engine::get_instance();
|
||||
engine->moveKeyEvent();
|
||||
if (engine->isAvatarInStasis()) {
|
||||
debugPrintf("Can't run: avatarInStasis\n");
|
||||
return false;
|
||||
}
|
||||
AvatarMoverProcess *proc = engine->getAvatarMoverProcess();
|
||||
|
||||
if (proc) {
|
||||
proc->setMovementFlag(AvatarMoverProcess::MOVE_RUN);
|
||||
}
|
||||
return false;
|
||||
return _avatarMoveKey(AvatarMoverProcess::MOVE_RUN, "run");
|
||||
}
|
||||
|
||||
bool Debugger::cmdStopMoveRun(int argc, const char **argv) {
|
||||
Ultima8Engine *engine = Ultima8Engine::get_instance();
|
||||
engine->moveKeyEvent();
|
||||
|
||||
AvatarMoverProcess *proc = engine->getAvatarMoverProcess();
|
||||
if (proc) {
|
||||
proc->clearMovementFlag(AvatarMoverProcess::MOVE_RUN);
|
||||
}
|
||||
return false;
|
||||
return _avatarMoveKeyEnd(AvatarMoverProcess::MOVE_RUN);
|
||||
}
|
||||
|
||||
bool Debugger::cmdStartMoveStep(int argc, const char **argv) {
|
||||
Ultima8Engine *engine = Ultima8Engine::get_instance();
|
||||
engine->moveKeyEvent();
|
||||
if (engine->isAvatarInStasis()) {
|
||||
debugPrintf("Can't step: avatarInStasis\n");
|
||||
return false;
|
||||
}
|
||||
AvatarMoverProcess *proc = engine->getAvatarMoverProcess();
|
||||
|
||||
if (proc) {
|
||||
proc->setMovementFlag(AvatarMoverProcess::MOVE_STEP);
|
||||
}
|
||||
return false;
|
||||
return _avatarMoveKey(AvatarMoverProcess::MOVE_STEP, "step");
|
||||
}
|
||||
|
||||
bool Debugger::cmdStopMoveStep(int argc, const char **argv) {
|
||||
Ultima8Engine *engine = Ultima8Engine::get_instance();
|
||||
engine->moveKeyEvent();
|
||||
return _avatarMoveKeyEnd(AvatarMoverProcess::MOVE_STEP);
|
||||
}
|
||||
|
||||
AvatarMoverProcess *proc = engine->getAvatarMoverProcess();
|
||||
if (proc) {
|
||||
proc->clearMovementFlag(AvatarMoverProcess::MOVE_STEP);
|
||||
}
|
||||
return false;
|
||||
bool Debugger::cmdShortJump(int argc, const char **argv) {
|
||||
return _avatarMoveKey(AvatarMoverProcess::MOVE_SHORT_JUMP, "short jump");
|
||||
}
|
||||
|
||||
bool Debugger::cmdStepLeft(int argc, const char **argv) {
|
||||
return _avatarMoveKey(AvatarMoverProcess::MOVE_STEP_LEFT, "step left");
|
||||
}
|
||||
|
||||
bool Debugger::cmdStepRight(int argc, const char **argv) {
|
||||
return _avatarMoveKey(AvatarMoverProcess::MOVE_STEP_RIGHT, "step right");
|
||||
}
|
||||
|
||||
bool Debugger::cmdStepForward(int argc, const char **argv) {
|
||||
return _avatarMoveKey(AvatarMoverProcess::MOVE_STEP_FORWARD, "step forward");
|
||||
}
|
||||
|
||||
bool Debugger::cmdStepBack(int argc, const char **argv) {
|
||||
return _avatarMoveKey(AvatarMoverProcess::MOVE_STEP_BACK, "step back");
|
||||
}
|
||||
|
||||
bool Debugger::cmdRollLeft(int argc, const char **argv) {
|
||||
return _avatarMoveKey(AvatarMoverProcess::MOVE_ROLL_LEFT, "roll left");
|
||||
}
|
||||
|
||||
bool Debugger::cmdRollRight(int argc, const char **argv) {
|
||||
return _avatarMoveKey(AvatarMoverProcess::MOVE_ROLL_RIGHT, "roll right");
|
||||
}
|
||||
|
||||
bool Debugger::cmdToggleCombat(int argc, const char **argv) {
|
||||
|
@ -149,7 +149,6 @@ private:
|
||||
// Avatar mover
|
||||
bool cmdStartJump(int argc, const char **argv);
|
||||
bool cmdStopJump(int argc, const char **argv);
|
||||
bool cmdShortJump(int argc, const char **argv);
|
||||
bool cmdStartTurnLeft(int argc, const char **argv);
|
||||
bool cmdStartTurnRight(int argc, const char **argv);
|
||||
bool cmdStartMoveForward(int argc, const char **argv);
|
||||
@ -174,6 +173,15 @@ private:
|
||||
bool cmdStartAttack(int argc, const char **argv);
|
||||
bool cmdStopAttack(int argc, const char **argv);
|
||||
|
||||
// One-shot Avatar mover commands
|
||||
bool cmdShortJump(int argc, const char **argv);
|
||||
bool cmdStepLeft(int argc, const char **argv);
|
||||
bool cmdStepRight(int argc, const char **argv);
|
||||
bool cmdStepForward(int argc, const char **argv);
|
||||
bool cmdStepBack(int argc, const char **argv);
|
||||
bool cmdRollLeft(int argc, const char **argv);
|
||||
bool cmdRollRight(int argc, const char **argv);
|
||||
|
||||
bool cmdCameraOnAvatar(int argc, const char **argv);
|
||||
|
||||
// Audio Process
|
||||
|
@ -86,7 +86,14 @@ public:
|
||||
MOVE_PENDING_TURN_LEFT = 0x2000,
|
||||
MOVE_PENDING_TURN_RIGHT = 0x4000,
|
||||
|
||||
MOVE_SHORT_JUMP = 0x8000, // Crusader only
|
||||
// Single-button moves (Crusader only)
|
||||
MOVE_SHORT_JUMP = 0x008000,
|
||||
MOVE_ROLL_LEFT = 0x010000,
|
||||
MOVE_ROLL_RIGHT = 0x020000,
|
||||
MOVE_STEP_LEFT = 0x040000,
|
||||
MOVE_STEP_RIGHT = 0x080000,
|
||||
MOVE_STEP_FORWARD = 0x100000,
|
||||
MOVE_STEP_BACK = 0x200000,
|
||||
|
||||
MOVE_ANY_DIRECTION = MOVE_MOUSE_DIRECTION | MOVE_FORWARD | MOVE_BACK | MOVE_LEFT | MOVE_RIGHT | MOVE_UP | MOVE_DOWN
|
||||
};
|
||||
|
@ -142,6 +142,50 @@ static bool _isAnimStartRunning(Animation::Sequence anim) {
|
||||
anim == Animation::startRunLargeWeapon*/);
|
||||
}
|
||||
|
||||
bool CruAvatarMoverProcess::checkOneShotMove(Direction direction) {
|
||||
Actor *avatar = getControlledActor();
|
||||
|
||||
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
|
||||
};
|
||||
|
||||
static const Animation::Sequence oneShotAnims[] = {
|
||||
Animation::combatRollLeft, Animation::combatRollRight,
|
||||
Animation::slideLeft, Animation::slideRight,
|
||||
Animation::advance, Animation::retreat,
|
||||
Animation::jumpForward
|
||||
};
|
||||
|
||||
for (int i = 0; i < ARRAYSIZE(oneShotFlags); i++) {
|
||||
if (hasMovementFlags(oneShotFlags[i])) {
|
||||
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::combatRollLeft)
|
||||
avatar->doAnim(Animation::kneelCombatRollRight, direction);
|
||||
else if (anim == Animation::advance)
|
||||
step(Animation::kneelingAdvance, direction);
|
||||
else if (anim == Animation::retreat)
|
||||
step(Animation::kneelingRetreat, direction);
|
||||
} else {
|
||||
if (anim == Animation::advance || anim == Animation::retreat)
|
||||
step(anim, direction);
|
||||
else
|
||||
avatar->doAnim(anim, direction);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void CruAvatarMoverProcess::handleCombatMode() {
|
||||
Actor *avatar = getControlledActor();
|
||||
MainActor *mainactor = dynamic_cast<MainActor *>(avatar);
|
||||
@ -161,11 +205,10 @@ void CruAvatarMoverProcess::handleCombatMode() {
|
||||
if (stasis)
|
||||
return;
|
||||
|
||||
if (hasMovementFlags(MOVE_SHORT_JUMP)) {
|
||||
clearMovementFlag(MOVE_SHORT_JUMP);
|
||||
avatar->doAnim(Animation::jumpForward, direction);
|
||||
if (checkOneShotMove(direction))
|
||||
return;
|
||||
} else if (hasMovementFlags(MOVE_FORWARD)) {
|
||||
|
||||
if (hasMovementFlags(MOVE_FORWARD)) {
|
||||
Animation::Sequence nextanim;
|
||||
if (hasMovementFlags(MOVE_STEP)) {
|
||||
nextanim = avatar->isKneeling() ?
|
||||
@ -325,12 +368,6 @@ void CruAvatarMoverProcess::handleNormalMode() {
|
||||
mainactor->toggleInCombat();
|
||||
}
|
||||
|
||||
if (hasMovementFlags(MOVE_SHORT_JUMP)) {
|
||||
clearMovementFlag(MOVE_SHORT_JUMP);
|
||||
avatar->doAnim(Animation::jumpForward, direction);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!hasMovementFlags(MOVE_ANY_DIRECTION) && lastanim == Animation::run) {
|
||||
// if we were running, slow to a walk before stopping
|
||||
// (even in stasis)
|
||||
@ -352,6 +389,9 @@ void CruAvatarMoverProcess::handleNormalMode() {
|
||||
if (stasis)
|
||||
return;
|
||||
|
||||
if (checkOneShotMove(direction))
|
||||
return;
|
||||
|
||||
bool moving = (lastanim == Animation::step || lastanim == Animation::run || lastanim == Animation::walk);
|
||||
|
||||
DirectionMode dirmode = avatar->animDirMode(Animation::step);
|
||||
|
@ -87,6 +87,7 @@ private:
|
||||
|
||||
void step(Animation::Sequence action, Direction direction, bool adjusted = false);
|
||||
|
||||
bool checkOneShotMove(Direction direction);
|
||||
};
|
||||
|
||||
} // End of namespace Ultima8
|
||||
|
Loading…
x
Reference in New Issue
Block a user