diff options
author | Thanasis Antoniou | 2019-09-08 15:04:37 +0300 |
---|---|---|
committer | Thanasis Antoniou | 2019-09-08 15:05:03 +0300 |
commit | a6401e8dac630e7e6e47006ad89f841f0fed830e (patch) | |
tree | 1458aa23c03e5e769dc6636b557910a9bed9ab60 /engines/bladerunner | |
parent | a51efbf560ec511effe964bd364b8ec287c0d9ab (diff) | |
download | scummvm-rg350-a6401e8dac630e7e6e47006ad89f841f0fed830e.tar.gz scummvm-rg350-a6401e8dac630e7e6e47006ad89f841f0fed830e.tar.bz2 scummvm-rg350-a6401e8dac630e7e6e47006ad89f841f0fed830e.zip |
BLADERUNNER: Fix Hasan behavior post Act 2
Diffstat (limited to 'engines/bladerunner')
-rw-r--r-- | engines/bladerunner/game_constants.h | 6 | ||||
-rw-r--r-- | engines/bladerunner/script/ai/hasan.cpp | 21 | ||||
-rw-r--r-- | engines/bladerunner/script/scene/ar01.cpp | 3 | ||||
-rw-r--r-- | engines/bladerunner/script/scene/ar02.cpp | 91 | ||||
-rw-r--r-- | engines/bladerunner/script/script.cpp | 7 | ||||
-rw-r--r-- | engines/bladerunner/script/script.h | 1 |
6 files changed, 72 insertions, 57 deletions
diff --git a/engines/bladerunner/game_constants.h b/engines/bladerunner/game_constants.h index 19af4ce3ea..d641eb5998 100644 --- a/engines/bladerunner/game_constants.h +++ b/engines/bladerunner/game_constants.h @@ -2523,9 +2523,9 @@ enum GoalZuben { enum GoalHasan { kGoalHasanDefault = 0, kGoalHasanIsAway = 300, // original final goal for Hasan - kGoalHasanIsWalkingAroundIsAtCT02 = 301, // new goal for restored content - kGoalHasanIsWalkingAroundStayAwayFromCT02 = 302, // new goal for restored content - kGoalHasanIsWalkingAroundStaysAtCT02 = 303, // new goal for restored content + kGoalHasanIsWalkingAroundIsAtAR02 = 301, // new goal for restored content + kGoalHasanIsWalkingAroundStayAwayFromAR02 = 302, // new goal for restored content + kGoalHasanIsWalkingAroundStaysAtAR02 = 303, // new goal for restored content kGoalHasanIsWalkingAroundIsAway = 304 // new goal for restored content }; diff --git a/engines/bladerunner/script/ai/hasan.cpp b/engines/bladerunner/script/ai/hasan.cpp index 696d44036c..33925e0357 100644 --- a/engines/bladerunner/script/ai/hasan.cpp +++ b/engines/bladerunner/script/ai/hasan.cpp @@ -65,8 +65,8 @@ bool AIScriptHasan::Update() { Actor_Set_Goal_Number(kActorHasan, kGoalHasanDefault); return true; } else if (Global_Variable_Query(kVariableChapter) > 2 - && Actor_Query_Goal_Number(kActorHasan) < kGoalHasanIsWalkingAroundIsAtCT02) { - Actor_Set_Goal_Number(kActorHasan, kGoalHasanIsWalkingAroundIsAtCT02); + && Actor_Query_Goal_Number(kActorHasan) < kGoalHasanIsWalkingAroundIsAtAR02) { + Actor_Set_Goal_Number(kActorHasan, kGoalHasanIsWalkingAroundIsAtAR02); return true; } return false; @@ -99,7 +99,7 @@ void AIScriptHasan::CompletedMovementTrack() { maxHasanLeaveProb = 10; } - if (Actor_Query_Goal_Number(kActorHasan) == kGoalHasanIsWalkingAroundIsAtCT02) { + if (Actor_Query_Goal_Number(kActorHasan) == kGoalHasanIsWalkingAroundIsAtAR02) { if (Random_Query(1, maxHasanLeaveProb) == 1 && Player_Query_Current_Scene() != kSceneAR01 && Player_Query_Current_Scene() != kSceneAR02 @@ -109,7 +109,7 @@ void AIScriptHasan::CompletedMovementTrack() { return; // true; } else { // stay (change goal to a temp one to trigger GoalChanged() (so that we can reset the "track") - Actor_Set_Goal_Number(kActorHasan, kGoalHasanIsWalkingAroundStaysAtCT02); + Actor_Set_Goal_Number(kActorHasan, kGoalHasanIsWalkingAroundStaysAtAR02); return; // true; } } @@ -120,11 +120,11 @@ void AIScriptHasan::CompletedMovementTrack() { && Player_Query_Current_Scene() != kSceneAR02 ) { // Hasan returns tp Animoid Row - Actor_Set_Goal_Number(kActorHasan, kGoalHasanIsWalkingAroundIsAtCT02); + Actor_Set_Goal_Number(kActorHasan, kGoalHasanIsWalkingAroundIsAtAR02); return; // true; } else { // stay away (change goal to a temp one to trigger GoalChanged() (so that we can reset the "track") - Actor_Set_Goal_Number(kActorHasan, kGoalHasanIsWalkingAroundStayAwayFromCT02); + Actor_Set_Goal_Number(kActorHasan, kGoalHasanIsWalkingAroundStayAwayFromAR02); return; // true; } } @@ -184,8 +184,9 @@ bool AIScriptHasan::GoalChanged(int currentGoalNumber, int newGoalNumber) { Actor_Put_In_Set(kActorHasan, kSetFreeSlotH); Actor_Set_At_Waypoint(kActorHasan, 40, 0); // kSetFreeSlotH break; - case kGoalHasanIsWalkingAroundIsAtCT02: + case kGoalHasanIsWalkingAroundIsAtAR02: AI_Movement_Track_Flush(kActorHasan); + World_Waypoint_Set(554, kSetAR01_AR02, -214.0f, 0.0f, -1379.0f); AI_Movement_Track_Append(kActorHasan, 554, Random_Query(60, 180)); // kSetAR01_AR02 Actor_Face_Heading(kActorHasan, 371, false); AI_Movement_Track_Repeat(kActorHasan); @@ -195,11 +196,11 @@ bool AIScriptHasan::GoalChanged(int currentGoalNumber, int newGoalNumber) { AI_Movement_Track_Append(kActorHasan, 40, Random_Query(10, 40)); // kSetFreeSlotH AI_Movement_Track_Repeat(kActorHasan); break; - case kGoalHasanIsWalkingAroundStayAwayFromCT02: + case kGoalHasanIsWalkingAroundStayAwayFromAR02: Actor_Set_Goal_Number(kActorHasan, kGoalHasanIsWalkingAroundIsAway); break; - case kGoalHasanIsWalkingAroundStaysAtCT02: - Actor_Set_Goal_Number(kActorHasan, kGoalHasanIsWalkingAroundIsAtCT02); + case kGoalHasanIsWalkingAroundStaysAtAR02: + Actor_Set_Goal_Number(kActorHasan, kGoalHasanIsWalkingAroundIsAtAR02); break; } } else { diff --git a/engines/bladerunner/script/scene/ar01.cpp b/engines/bladerunner/script/scene/ar01.cpp index d7ed9bc174..bb872cc29a 100644 --- a/engines/bladerunner/script/scene/ar01.cpp +++ b/engines/bladerunner/script/scene/ar01.cpp @@ -204,7 +204,8 @@ bool SceneScriptAR01::ClickedOnActor(int actorId) { case 0: Global_Variable_Increment(kVariableFishDealerBanterTalk, 1); Actor_Says(kActorFishDealer, 230, 14); - Item_Pickup_Spin_Effect(kModelAnimationGoldfish, 88, 400); // TODO check co-ordinates + + Item_Pickup_Spin_Effect_From_Actor(kModelAnimationGoldfish, kActorFishDealer, 0, -40); dialogueWithFishDealerBuyGoldfish(); break; case 1: diff --git a/engines/bladerunner/script/scene/ar02.cpp b/engines/bladerunner/script/scene/ar02.cpp index de462bb3c6..165a8aeb63 100644 --- a/engines/bladerunner/script/scene/ar02.cpp +++ b/engines/bladerunner/script/scene/ar02.cpp @@ -202,7 +202,7 @@ bool SceneScriptAR02::ClickedOnActor(int actorId) { if (Actor_Query_Friendliness_To_Other(kActorInsectDealer, kActorMcCoy) > 40) { Actor_Says(kActorInsectDealer, 460, 14); Actor_Says(kActorInsectDealer, 470, 13); // This slug, perhaps. - Item_Pickup_Spin_Effect(kModelAnimationSlug, 288, 257); + Item_Pickup_Spin_Effect_From_Actor(kModelAnimationSlug, kActorInsectDealer, 0, -40); dialogueWithInsectDealerBuySlug(); } break; @@ -252,49 +252,54 @@ bool SceneScriptAR02::ClickedOnActor(int actorId) { if (actorId == kActorHasan && Global_Variable_Query(kVariableChapter) > 2) { - if (Actor_Clue_Query(kActorMcCoy, kClueStrangeScale1) - && !Game_Flag_Query(kFlagWrongInvestigation) - ) { - dialogueWithHassan(); - } else { - switch (Global_Variable_Query(kVariableHasanBanterTalk)) { - case 0: - Global_Variable_Increment(kVariableHasanBanterTalk, 1); - Actor_Says(kActorMcCoy, 155, 13); // How's business? - Actor_Says(kActorHasan, 10, 13); - Actor_Says(kActorHasan, 20, 14); - break; - case 1: - Global_Variable_Increment(kVariableHasanBanterTalk, 1); - Actor_Says(kActorMcCoy, 6980, 13); // What's the word - Actor_Says(kActorHasan, 290, 13); - if (Actor_Query_Friendliness_To_Other(kActorHasan, kActorMcCoy) > 49) { - Actor_Says(kActorHasan, 300, 14); - Actor_Says(kActorHasan, 310, 13); - Item_Pickup_Spin_Effect(kModelAnimationGarterSnake, 328, 237); // TODO check co-ordinates - dialogueWithHassanBuySnake(); - } - break; - case 2: - // offer to buy snake - Global_Variable_Increment(kVariableHasanBanterTalk, 1); - if (Player_Query_Agenda() == kPlayerAgendaSurly - || Actor_Query_Friendliness_To_Other(kActorHasan, kActorMcCoy) <= 49 ) { - Actor_Says(kActorMcCoy, 8915, 14); // You got a minute, pal? - Actor_Says(kActorHasan, 260, 14); // My time is quite valuable, noble one - Actor_Modify_Friendliness_To_Other(kActorHasan, kActorMcCoy, -5); - } else { - Actor_Says(kActorMcCoy, 8615, 13); // Heard anything on the street? - Actor_Says(kActorHasan, 250, 13); // I'm afraid not, noble one. But you shall surely be the first to know, if I do hear something. - } - break; - default: - if (Actor_Query_Friendliness_To_Other(kActorHasan, kActorMcCoy) <= 45 ) { - Actor_Says(kActorMcCoy, 8940, 13); - } else { - Actor_Says(kActorMcCoy, 1315, 13); + if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -240.79f, 0.0f, -1328.89f, 12, true, false, false)) { + Actor_Face_Actor(kActorMcCoy, kActorHasan, true); + Actor_Face_Actor(kActorHasan, kActorMcCoy, true); + + if (Actor_Clue_Query(kActorMcCoy, kClueStrangeScale1) + && !Game_Flag_Query(kFlagWrongInvestigation) + ) { + dialogueWithHassan(); + } else { + switch (Global_Variable_Query(kVariableHasanBanterTalk)) { + case 0: + Global_Variable_Increment(kVariableHasanBanterTalk, 1); + Actor_Says(kActorMcCoy, 155, 13); // How's business? + Actor_Says(kActorHasan, 10, 13); + Actor_Says(kActorHasan, 20, 14); + break; + case 1: + Global_Variable_Increment(kVariableHasanBanterTalk, 1); + Actor_Says(kActorMcCoy, 6980, 13); // What's the word + Actor_Says(kActorHasan, 290, 13); + if (Actor_Query_Friendliness_To_Other(kActorHasan, kActorMcCoy) > 49) { + Actor_Says(kActorHasan, 300, 14); + Actor_Says(kActorHasan, 310, 13); + Item_Pickup_Spin_Effect_From_Actor(kModelAnimationGarterSnake, kActorHasan, 0, -40); + dialogueWithHassanBuySnake(); + } + break; + case 2: + // offer to buy snake + Global_Variable_Increment(kVariableHasanBanterTalk, 1); + if (Player_Query_Agenda() == kPlayerAgendaSurly + || Actor_Query_Friendliness_To_Other(kActorHasan, kActorMcCoy) <= 49 ) { + Actor_Says(kActorMcCoy, 8915, 14); // You got a minute, pal? + Actor_Says(kActorHasan, 260, 14); // My time is quite valuable, noble one + Actor_Modify_Friendliness_To_Other(kActorHasan, kActorMcCoy, -5); + } else { + Actor_Says(kActorMcCoy, 8615, 13); // Heard anything on the street? + Actor_Says(kActorHasan, 250, 13); // I'm afraid not, noble one. But you shall surely be the first to know, if I do hear something. + } + break; + default: + if (Actor_Query_Friendliness_To_Other(kActorHasan, kActorMcCoy) <= 45 ) { + Actor_Says(kActorMcCoy, 8940, 13); + } else { + Actor_Says(kActorMcCoy, 1315, 13); + } + break; } - break; } } } diff --git a/engines/bladerunner/script/script.cpp b/engines/bladerunner/script/script.cpp index d8faa02f0d..b51a82dc12 100644 --- a/engines/bladerunner/script/script.cpp +++ b/engines/bladerunner/script/script.cpp @@ -870,6 +870,13 @@ void ScriptBase::Item_Pickup_Spin_Effect(int animationId, int x, int y) { _vm->_itemPickup->setup(animationId, x, y); } +void ScriptBase::Item_Pickup_Spin_Effect_From_Actor(int animationId, int actorId, int xOffset, int yOffset) { + debugC(kDebugScript, "Item_Pickup_Spin_Effect_From_Actor(%d, %d, %d, %d)", animationId, actorId, xOffset, yOffset); + + const Common::Rect &rect = _vm->_actors[actorId]->getScreenRectangle(); + _vm->_itemPickup->setup(animationId, CLIP((rect.right + rect.left) / 2 + xOffset, 0, 639), CLIP((rect.bottom + rect.top) / 2 + yOffset, 0, 479)); +} + bool ScriptBase::Item_Query_Visible(int itemId) { debugC(kDebugScript, "Item_Query_Visible(%d)", itemId); return _vm->_items->isVisible(itemId); diff --git a/engines/bladerunner/script/script.h b/engines/bladerunner/script/script.h index 4eb929004b..832c22e76f 100644 --- a/engines/bladerunner/script/script.h +++ b/engines/bladerunner/script/script.h @@ -127,6 +127,7 @@ protected: void Item_Flag_As_Target(int itemId); void Item_Flag_As_Non_Target(int itemId); void Item_Pickup_Spin_Effect(int animationId, int x, int y); + void Item_Pickup_Spin_Effect_From_Actor(int animationId, int actorId, int xOffset = 0, int yOffset = 0); // new for restored content mostly bool Item_Query_Visible(int itemId); void Set_Subtitle_Text_On_Screen(Common::String displayText); #if BLADERUNNER_ORIGINAL_BUGS |