BLADERUNNER: Check for recoil jitter

Check if on actor click and on item click

This is the original's behavior too
This commit is contained in:
antoniou79 2022-02-21 22:21:47 +02:00
parent 2362e857a7
commit 5d5fb34aa1
3 changed files with 8 additions and 2 deletions

View File

@ -1865,7 +1865,7 @@ void BladeRunnerEngine::handleMouseClickItem(int itemId, bool buttonDown) {
_isInsideScriptItem = false;
}
} else {
if (!buttonDown || !_items->isTarget(itemId) /* || _mouse->isRandomized() */) {
if (!buttonDown || !_items->isTarget(itemId) || _mouse->isRandomized()) {
return;
}
@ -1933,7 +1933,7 @@ void BladeRunnerEngine::handleMouseClickActor(int actorId, bool mainButton, bool
}
} else {
Actor *actor = _actors[actorId];
if (!_combat->isActive() || actorId == kActorMcCoy || !actor->isTarget() || actor->isRetired() /*|| _mouse->isRandomized()*/) {
if (!_combat->isActive() || actorId == kActorMcCoy || !actor->isTarget() || actor->isRetired() || _mouse->isRandomized()) {
return;
}
_playerActor->stopWalking(false);

View File

@ -442,6 +442,11 @@ void Mouse::tick(int x, int y) {
setCursor(cursorId);
}
// This method checks if jitter (due to gun recoil) is currently ongoing
bool Mouse::isRandomized() const {
return _randomCountdownX > 0 || _randomCountdownY > 0;
}
bool Mouse::isInactive() const {
return _cursor == 6 || _cursor == 8 || _cursor == 10;
}

View File

@ -68,6 +68,7 @@ public:
void updateCursorFrame();
void tick(int x, int y);
bool isRandomized() const;
bool isInactive() const;
// private: