diff options
Diffstat (limited to 'engines/bladerunner/script')
32 files changed, 137 insertions, 126 deletions
diff --git a/engines/bladerunner/script/ai/clovis.cpp b/engines/bladerunner/script/ai/clovis.cpp index 9c8976e02d..e55fdb9468 100644 --- a/engines/bladerunner/script/ai/clovis.cpp +++ b/engines/bladerunner/script/ai/clovis.cpp @@ -440,22 +440,22 @@ bool AIScriptClovis::GoalChanged(int currentGoalNumber, int newGoalNumber) { Global_Variable_Decrement(51, 1); } if (Global_Variable_Query(kVariableChapter) == 5 && Actor_Query_In_Set(kActorDektora, kSetKP07)) { - Non_Player_Actor_Combat_Mode_On(kActorDektora, 0, 0, 0, 19, 4, 7, 8, 0, 0, 100, 10, 300, 0); + Non_Player_Actor_Combat_Mode_On(kActorDektora, kActorCombatStateIdle, false, kActorMcCoy, 19, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, 0, 100, 10, 300, false); } if (Global_Variable_Query(kVariableChapter) == 5 && Actor_Query_In_Set(kActorZuben, kSetKP07)) { - Non_Player_Actor_Combat_Mode_On(kActorZuben, 0, 0, 0, 19, 4, 7, 8, 0, 0, 100, 10, 300, 0); + Non_Player_Actor_Combat_Mode_On(kActorZuben, kActorCombatStateIdle, false, kActorMcCoy, 19, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, 0, 100, 10, 300, false); } if (Global_Variable_Query(kVariableChapter) == 5 && Actor_Query_In_Set(kActorSadik, kSetKP07)) { - Non_Player_Actor_Combat_Mode_On(kActorSadik, 0, 1, 0, 19, 4, 7, 8, 0, 0, 100, 10, 300, 0); + Non_Player_Actor_Combat_Mode_On(kActorSadik, kActorCombatStateIdle, true, kActorMcCoy, 19, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, 0, 100, 10, 300, false); } if (Global_Variable_Query(kVariableChapter) == 5 && Actor_Query_In_Set(kActorIzo, kSetKP07)) { - Non_Player_Actor_Combat_Mode_On(kActorIzo, 0, 0, 0, 19, 4, 7, 8, 0, 0, 100, 10, 300, 0); + Non_Player_Actor_Combat_Mode_On(kActorIzo, kActorCombatStateIdle, false, kActorMcCoy, 19, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, 0, 100, 10, 300, false); } if (Global_Variable_Query(kVariableChapter) == 5 && Actor_Query_In_Set(kActorGordo, kSetKP07)) { - Non_Player_Actor_Combat_Mode_On(kActorGordo, 0, 1, 0, 19, 4, 7, 8, 0, 0, 100, 10, 300, 0); + Non_Player_Actor_Combat_Mode_On(kActorGordo, kActorCombatStateIdle, true, kActorMcCoy, 19, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, 0, 100, 10, 300, false); } if (Global_Variable_Query(kVariableChapter) == 5 && Actor_Query_In_Set(kActorClovis, kSetKP07)) { - Non_Player_Actor_Combat_Mode_On(kActorClovis, 0, 0, 0, 19, 4, 7, 8, 0, 0, 100, 10, 300, 0); + Non_Player_Actor_Combat_Mode_On(kActorClovis, kActorCombatStateIdle, false, kActorMcCoy, 19, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, 0, 100, 10, 300, false); } return true; diff --git a/engines/bladerunner/script/ai/dektora.cpp b/engines/bladerunner/script/ai/dektora.cpp index 905c3d16da..28bdf3c83d 100644 --- a/engines/bladerunner/script/ai/dektora.cpp +++ b/engines/bladerunner/script/ai/dektora.cpp @@ -280,7 +280,7 @@ void AIScriptDektora::Retired(int byActorId) { } if (byActorId == kActorSteele && Actor_Query_In_Set(kActorSteele, kSetHF06) && Actor_Query_In_Set(kActorMcCoy, kSetHF06)) { - Non_Player_Actor_Combat_Mode_On(kActorSteele, 3, 1, 0, 15, 4, 7, 8, 0, 0, 100, 25, 300, 0); + Non_Player_Actor_Combat_Mode_On(kActorSteele, kActorCombatStateUncover, true, kActorMcCoy, 15, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, 0, 100, 25, 300, false); } if (Actor_Query_In_Set(kActorDektora, kSetKP07)) { @@ -290,8 +290,8 @@ void AIScriptDektora::Retired(int byActorId) { if (!Global_Variable_Query(51)) { Player_Loses_Control(); Delay(2000); - Player_Set_Combat_Mode(0); - Loop_Actor_Walk_To_XYZ(0, -12.0, -41.580002, 72.0, 0, 1, 0, 0); + Player_Set_Combat_Mode(false); + Loop_Actor_Walk_To_XYZ(kActorMcCoy, -12.0f, -41.58f, 72.0f, 0, true, false, 0); Ambient_Sounds_Remove_All_Non_Looping_Sounds(1); Ambient_Sounds_Remove_All_Looping_Sounds(1); Game_Flag_Set(579); @@ -1095,11 +1095,11 @@ void AIScriptDektora::checkCombat() { && Global_Variable_Query(kVariableChapter) == 5 && Actor_Query_Goal_Number(kActorDektora) != 450) { if (Global_Variable_Query(kVariableAffectionTowards) == 2) { - Global_Variable_Set(45, 0); + Global_Variable_Set(kVariableAffectionTowards, 0); } Actor_Set_Goal_Number(kActorDektora, 450); - Non_Player_Actor_Combat_Mode_On(kActorDektora, 0, 0, kActorMcCoy, 4, 4, 7, 8, 0, -1, -1, 20, 300, 0); + Non_Player_Actor_Combat_Mode_On(kActorDektora, kActorCombatStateIdle, false, kActorMcCoy, 4, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, -1, -1, 20, 300, false); } } diff --git a/engines/bladerunner/script/ai/gaff.cpp b/engines/bladerunner/script/ai/gaff.cpp index c26f0d907f..c5e629cab0 100644 --- a/engines/bladerunner/script/ai/gaff.cpp +++ b/engines/bladerunner/script/ai/gaff.cpp @@ -287,7 +287,7 @@ bool AIScriptGaff::GoalChanged(int currentGoalNumber, int newGoalNumber) { return true; case 303: Actor_Face_Actor(kActorGaff, kActorMcCoy, 1); - Actor_Change_Animation_Mode(kActorGaff, kAnimationModeCombatShoot); + Actor_Change_Animation_Mode(kActorGaff, kAnimationModeCombatAttack); Sound_Play(27, 100, 0, 0, 50); Actor_Change_Animation_Mode(kActorMcCoy, 48); Actor_Retired_Here(kActorMcCoy, 12, 12, 1, -1); diff --git a/engines/bladerunner/script/ai/gordo.cpp b/engines/bladerunner/script/ai/gordo.cpp index fd64112897..c44497176a 100644 --- a/engines/bladerunner/script/ai/gordo.cpp +++ b/engines/bladerunner/script/ai/gordo.cpp @@ -1157,7 +1157,7 @@ bool AIScriptGordo::ChangeAnimationMode(int mode) { break; } break; - case kAnimationModeCombatShoot: + case kAnimationModeCombatAttack: _animationState = 18; _animationFrame = 0; break; diff --git a/engines/bladerunner/script/ai/guzza.cpp b/engines/bladerunner/script/ai/guzza.cpp index 0f99fa8a46..5a4459535e 100644 --- a/engines/bladerunner/script/ai/guzza.cpp +++ b/engines/bladerunner/script/ai/guzza.cpp @@ -728,7 +728,7 @@ bool AIScriptGuzza::ChangeAnimationMode(int mode) { _animationFrame = 0; } break; - case kAnimationModeCombatShoot: + case kAnimationModeCombatAttack: _animationState = 31; _animationFrame = 0; break; diff --git a/engines/bladerunner/script/ai/leon.cpp b/engines/bladerunner/script/ai/leon.cpp index fad9da3cfb..fdcb538f0a 100644 --- a/engines/bladerunner/script/ai/leon.cpp +++ b/engines/bladerunner/script/ai/leon.cpp @@ -386,7 +386,7 @@ bool AIScriptLeon::ChangeAnimationMode(int mode) { _animationFrame = 0; var_45EDAC = 0; break; - case kAnimationModeCombatShoot: + case kAnimationModeCombatAttack: _animationState = 10; _animationFrame = 0; break; diff --git a/engines/bladerunner/script/ai/lucy.cpp b/engines/bladerunner/script/ai/lucy.cpp index aebeac7322..464f228179 100644 --- a/engines/bladerunner/script/ai/lucy.cpp +++ b/engines/bladerunner/script/ai/lucy.cpp @@ -227,7 +227,7 @@ void AIScriptLucy::Retired(int byActorId) { if ((byActorId == kActorSteele || byActorId == kActorMcCoy) && Actor_Query_In_Set(kActorSteele, kSetHF06) && Actor_Query_In_Set(kActorMcCoy, kSetHF06)) { - Non_Player_Actor_Combat_Mode_On(kActorSteele, 3, 1, 0, 15, 4, 7, 8, 0, 0, 100, 25, 300, 0); + Non_Player_Actor_Combat_Mode_On(kActorSteele, kActorCombatStateUncover, true, kActorMcCoy, 15, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, 0, 100, 25, 300, false); } if (Query_Difficulty_Level() && byActorId == kActorMcCoy && Game_Flag_Query(46)) { Global_Variable_Increment(2, 200); @@ -861,10 +861,10 @@ void AIScriptLucy::checkCombat() { && Global_Variable_Query(kVariableChapter) == 5 && Actor_Query_Goal_Number(kActorLucy) != 450) { if (Global_Variable_Query(kVariableAffectionTowards) == 3) { - Global_Variable_Set(45, 0); + Global_Variable_Set(kVariableAffectionTowards, 0); } Actor_Set_Goal_Number(kActorLucy, 450); - Non_Player_Actor_Combat_Mode_On(kActorLucy, 0, 0, 0, 4, 0, 1, 2, -1, 0, 0, 10, 300, 0); + Non_Player_Actor_Combat_Mode_On(kActorLucy, kActorCombatStateIdle, false, kActorMcCoy, 4, kAnimationModeIdle, kAnimationModeWalk, kAnimationModeRun, -1, 0, 0, 10, 300, false); } } diff --git a/engines/bladerunner/script/ai/mccoy.cpp b/engines/bladerunner/script/ai/mccoy.cpp index 554de0cd80..56b54ac0eb 100644 --- a/engines/bladerunner/script/ai/mccoy.cpp +++ b/engines/bladerunner/script/ai/mccoy.cpp @@ -242,22 +242,22 @@ bool AIScriptMcCoy::ShotAtAndHit() { void AIScriptMcCoy::Retired(int byActorId) { if (byActorId == kActorSteele && Actor_Query_In_Set(kActorSteele, kSetHF06)) { if (Actor_Query_In_Set(kActorDektora, kSetHF06) && Actor_Query_Goal_Number(kActorDektora) != 599) { - Non_Player_Actor_Combat_Mode_On(kActorSteele, 3, 1, kActorDektora, 15, 4, 7, 8, 0, 0, 100, 25, 300, 0); + Non_Player_Actor_Combat_Mode_On(kActorSteele, kActorCombatStateUncover, true, kActorDektora, 15, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, 0, 100, 25, 300, false); } else if (Actor_Query_In_Set(kActorLucy, kSetHF06) && Actor_Query_Goal_Number(kActorLucy) != 599) { - Non_Player_Actor_Combat_Mode_On(kActorSteele, 3, 1, kActorLucy, 15, 4, 7, 8, 0, 0, 100, 25, 300, 0); + Non_Player_Actor_Combat_Mode_On(kActorSteele, kActorCombatStateUncover, true, kActorLucy, 15, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, 0, 100, 25, 300, false); } } if (Actor_Query_In_Set(kActorMcCoy, kSetHF05) && Actor_Query_In_Set(kActorOfficerLeary, kSetHF05) && Actor_Query_In_Set(kActorDektora, kSetHF05) && Actor_Query_Goal_Number(kActorDektora) != 599) { - Non_Player_Actor_Combat_Mode_On(kActorOfficerLeary, 3, 1, kActorDektora, 4, 4, 7, 8, 0, 0, 100, 25, 300, 0); + Non_Player_Actor_Combat_Mode_On(kActorOfficerLeary, kActorCombatStateUncover, true, kActorDektora, 4, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, 0, 100, 25, 300, false); } if (Actor_Query_In_Set(kActorMcCoy, kSetHF05) && Actor_Query_In_Set(kActorOfficerGrayford, kSetHF05) && Actor_Query_In_Set(kActorDektora, kSetHF05) && Actor_Query_Goal_Number(kActorDektora) != 599) { - Non_Player_Actor_Combat_Mode_On(kActorOfficerGrayford, 3, 1, kActorDektora, 4, 4, 7, 8, 0, 0, 100, 25, 300, 0); + Non_Player_Actor_Combat_Mode_On(kActorOfficerGrayford, kActorCombatStateUncover, true, kActorDektora, 4, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, 0, 100, 25, 300, false); } if (Actor_Query_In_Set(kActorMcCoy, kSetHF05) && Actor_Query_In_Set(kActorOfficerLeary, kSetHF05) && Actor_Query_In_Set(kActorLucy, kSetHF05) && Actor_Query_Goal_Number(kActorLucy) != 599) { - Non_Player_Actor_Combat_Mode_On(kActorOfficerLeary, 3, 1, kActorLucy, 4, 4, 7, 8, 0, 0, 100, 25, 300, 0); + Non_Player_Actor_Combat_Mode_On(kActorOfficerLeary, kActorCombatStateUncover, true, kActorLucy, 4, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, 0, 100, 25, 300, false); } if (Actor_Query_In_Set(kActorMcCoy, kSetHF05) && Actor_Query_In_Set(kActorOfficerGrayford, kSetHF05) && Actor_Query_In_Set(kActorLucy, kSetHF05) && Actor_Query_Goal_Number(kActorLucy) != 599) { - Non_Player_Actor_Combat_Mode_On(kActorOfficerGrayford, 3, 1, kActorLucy, 4, 4, 7, 8, 0, 0, 100, 25, 300, 0); + Non_Player_Actor_Combat_Mode_On(kActorOfficerGrayford, kActorCombatStateUncover, true, kActorLucy, 4, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, 0, 100, 25, 300, false); } } @@ -307,7 +307,7 @@ bool AIScriptMcCoy::GoalChanged(int currentGoalNumber, int newGoalNumber) { return true; case 230: dword_45A0FC = Actor_Query_Goal_Number(kActorSteele) == 215; - Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeCombatShoot); + Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeCombatAttack); return true; case 220: Actor_Change_Animation_Mode(kActorMcCoy, 75); @@ -412,7 +412,7 @@ bool AIScriptMcCoy::GoalChanged(int currentGoalNumber, int newGoalNumber) { case 400: Actor_Set_Health(kActorMcCoy, 50, 50); Game_Flag_Set(373); - v5 = Global_Variable_Query(45); + v5 = Global_Variable_Query(kVariableAffectionTowards); if (v5 == 1) { Actor_Modify_Friendliness_To_Other(kActorSteele, kActorMcCoy, 3); } else if (v5 == 2) { @@ -428,14 +428,14 @@ bool AIScriptMcCoy::GoalChanged(int currentGoalNumber, int newGoalNumber) { if (Actor_Query_Friendliness_To_Other(kActorSteele, kActorMcCoy) < Actor_Query_Friendliness_To_Other(kActorClovis, kActorMcCoy)) { Game_Flag_Set(653); } - v7 = Global_Variable_Query(45); + v7 = Global_Variable_Query(kVariableAffectionTowards); if (v7 == 1) { if (Game_Flag_Query(653)) { - Global_Variable_Set(45, 0); + Global_Variable_Set(kVariableAffectionTowards, 0); } } else if (v7 == 2 || v7 == 3) { if (!Game_Flag_Query(653)) { - Global_Variable_Set(45, 0); + Global_Variable_Set(kVariableAffectionTowards, 0); } } if (!Game_Flag_Query(653)) { @@ -1382,7 +1382,7 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) { break; } break; - case kAnimationModeCombatShoot: + case kAnimationModeCombatAttack: _animationState = 21; _animationFrame = 0; break; diff --git a/engines/bladerunner/script/ai/mutant1.cpp b/engines/bladerunner/script/ai/mutant1.cpp index 9ecaf9d80e..eb1c0562af 100644 --- a/engines/bladerunner/script/ai/mutant1.cpp +++ b/engines/bladerunner/script/ai/mutant1.cpp @@ -83,7 +83,7 @@ bool AIScriptMutant1::Update() { case 410: if (Actor_Query_Which_Set_In(kActorMutant1) != Player_Query_Current_Set()) { - Non_Player_Actor_Combat_Mode_Off(70); + Non_Player_Actor_Combat_Mode_Off(kActorMutant1); Actor_Set_Goal_Number(kActorMutant1, 403); } break; @@ -326,28 +326,23 @@ bool AIScriptMutant1::GoalChanged(int currentGoalNumber, int newGoalNumber) { case 410: switch (Actor_Query_Which_Set_In(kActorMutant1)) { case kSetUG01: - Non_Player_Actor_Combat_Mode_On(kActorMutant1, 0, 0, 0, 11, 4, 7, 8, -1, -1, -1, 10, 300, 0); + Non_Player_Actor_Combat_Mode_On(kActorMutant1, kActorCombatStateIdle, false, kActorMcCoy, 11, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, -1, -1, -1, 10, 300, false); break; case kSetUG04: case kSetUG05: case kSetUG06: - Non_Player_Actor_Combat_Mode_On(kActorMutant1, 0, 0, 0, 10, 4, 7, 8, -1, -1, -1, 10, 300, 0); + Non_Player_Actor_Combat_Mode_On(kActorMutant1, kActorCombatStateIdle, false, kActorMcCoy, 10, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, -1, -1, -1, 10, 300, false); break; case kSetUG07: - Non_Player_Actor_Combat_Mode_On(kActorMutant1, 0, 0, 0, 12, 4, 7, 8, -1, -1, -1, 10, 300, 0); + Non_Player_Actor_Combat_Mode_On(kActorMutant1, kActorCombatStateIdle, false, kActorMcCoy, 12, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, -1, -1, -1, 10, 300, false); break; case kSetUG10: - Non_Player_Actor_Combat_Mode_On(kActorMutant1, 0, 0, 0, 14, 4, 7, 8, -1, -1, -1, 10, 300, 0); - break; - case kSetUG12: - Non_Player_Actor_Combat_Mode_On(kActorMutant1, 0, 0, 0, 14, 4, 7, 8, -1, -1, -1, 10, 300, 0); - break; case kSetUG14: - Non_Player_Actor_Combat_Mode_On(kActorMutant1, 0, 0, 0, 14, 4, 7, 8, -1, -1, -1, 10, 300, 0); + Non_Player_Actor_Combat_Mode_On(kActorMutant1, kActorCombatStateIdle, false, kActorMcCoy, 14, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, -1, -1, -1, 10, 300, false); break; } return true; diff --git a/engines/bladerunner/script/ai/mutant2.cpp b/engines/bladerunner/script/ai/mutant2.cpp index 6a51c710dd..6317311088 100644 --- a/engines/bladerunner/script/ai/mutant2.cpp +++ b/engines/bladerunner/script/ai/mutant2.cpp @@ -305,25 +305,19 @@ bool AIScriptMutant2::GoalChanged(int currentGoalNumber, int newGoalNumber) { case 410: switch (Actor_Query_Which_Set_In(kActorMutant2)) { case kSetUG01: - Non_Player_Actor_Combat_Mode_On(kActorMutant2, 0, 0, 0, 11, 4, 7, 8, -1, -1, -1, 10, 300, 0); + Non_Player_Actor_Combat_Mode_On(kActorMutant2, kActorCombatStateIdle, false, kActorMcCoy, 11, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, -1, -1, -1, 10, 300, false); break; case kSetUG04: case kSetUG05: case kSetUG06: - Non_Player_Actor_Combat_Mode_On(kActorMutant2, 0, 0, 0, 10, 4, 7, 8, -1, -1, -1, 10, 300, 0); + Non_Player_Actor_Combat_Mode_On(kActorMutant2, kActorCombatStateIdle, false, kActorMcCoy, 10, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, -1, -1, -1, 10, 300, false); break; case kSetUG10: - Non_Player_Actor_Combat_Mode_On(kActorMutant2, 0, 0, 0, 14, 4, 7, 8, -1, -1, -1, 10, 300, 0); - break; - case kSetUG12: - Non_Player_Actor_Combat_Mode_On(kActorMutant2, 0, 0, 0, 14, 4, 7, 8, -1, -1, -1, 10, 300, 0); - break; - case kSetUG14: - Non_Player_Actor_Combat_Mode_On(kActorMutant2, 0, 0, 0, 14, 4, 7, 8, -1, -1, -1, 10, 300, 0); + Non_Player_Actor_Combat_Mode_On(kActorMutant2, kActorCombatStateIdle, false, kActorMcCoy, 14, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, -1, -1, -1, 10, 300, false); break; } return true; diff --git a/engines/bladerunner/script/ai/mutant3.cpp b/engines/bladerunner/script/ai/mutant3.cpp index 76a9a0edff..db161d8d5a 100644 --- a/engines/bladerunner/script/ai/mutant3.cpp +++ b/engines/bladerunner/script/ai/mutant3.cpp @@ -316,24 +316,19 @@ bool AIScriptMutant3::GoalChanged(int currentGoalNumber, int newGoalNumber) { case 410: switch (Actor_Query_Which_Set_In(kActorMutant3)) { case kSetUG01: - Non_Player_Actor_Combat_Mode_On(kActorMutant3, 0, 1, 0, 11, 4, 7, 8, -1, -1, -1, 10, 300, 0); + Non_Player_Actor_Combat_Mode_On(kActorMutant3, kActorCombatStateIdle, false, kActorMcCoy, 11, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, -1, -1, -1, 10, 300, false); break; case kSetUG04: case kSetUG05: case kSetUG06: - Non_Player_Actor_Combat_Mode_On(kActorMutant3, 0, 1, 0, 10, 4, 7, 8, -1, -1, -1, 10, 300, 0); + Non_Player_Actor_Combat_Mode_On(kActorMutant3, kActorCombatStateIdle, false, kActorMcCoy, 10, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, -1, -1, -1, 10, 300, false); break; case kSetUG10: - Non_Player_Actor_Combat_Mode_On(kActorMutant3, 0, 1, 0, 14, 4, 7, 8, -1, -1, -1, 10, 300, 0); - break; case kSetUG12: - Non_Player_Actor_Combat_Mode_On(kActorMutant3, 0, 1, 0, 14, 4, 7, 8, -1, -1, -1, 10, 300, 0); - break; - case kSetUG14: - Non_Player_Actor_Combat_Mode_On(kActorMutant3, 0, 1, 0, 14, 4, 7, 8, -1, -1, -1, 10, 300, 0); + Non_Player_Actor_Combat_Mode_On(kActorMutant3, kActorCombatStateIdle, false, kActorMcCoy, 14, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, -1, -1, -1, 10, 300, false); break; } break; @@ -342,6 +337,7 @@ bool AIScriptMutant3::GoalChanged(int currentGoalNumber, int newGoalNumber) { AI_Movement_Track_Flush(kActorMutant3); AI_Movement_Track_Append(kActorMutant3, 39, 100); AI_Movement_Track_Repeat(kActorMutant3); + break; case 599: AI_Movement_Track_Flush(kActorMutant3); diff --git a/engines/bladerunner/script/ai/officer_leary.cpp b/engines/bladerunner/script/ai/officer_leary.cpp index b18ba0869f..0adbe7c1c0 100644 --- a/engines/bladerunner/script/ai/officer_leary.cpp +++ b/engines/bladerunner/script/ai/officer_leary.cpp @@ -979,7 +979,7 @@ bool AIScriptOfficerLeary::ChangeAnimationMode(int mode) { break; } break; - case kAnimationModeCombatShoot: + case kAnimationModeCombatAttack: _animationState = 24; _animationFrame = 0; break; diff --git a/engines/bladerunner/script/ai/sadik.cpp b/engines/bladerunner/script/ai/sadik.cpp index b6abc8dab8..9fdb889b6c 100644 --- a/engines/bladerunner/script/ai/sadik.cpp +++ b/engines/bladerunner/script/ai/sadik.cpp @@ -356,7 +356,7 @@ bool AIScriptSadik::GoalChanged(int currentGoalNumber, int newGoalNumber) { case 413: Loop_Actor_Walk_To_XYZ(kActorSadik, -1062.0f, 0.0f, 219.0f, 0, 0, 1, 0); Actor_Set_Targetable(kActorSadik, 1); - Non_Player_Actor_Combat_Mode_On(kActorSadik, 0, 1, 0, 9, 4, 7, 8, 0, -1, -1, 15, 300, 0); + Non_Player_Actor_Combat_Mode_On(kActorSadik, kActorCombatStateIdle, true, kActorMcCoy, 9, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, -1, -1, 15, 300, false); Actor_Set_Goal_Number(kActorSadik, 450); return true; @@ -412,7 +412,7 @@ bool AIScriptSadik::GoalChanged(int currentGoalNumber, int newGoalNumber) { case 418: Game_Flag_Reset(653); Actor_Set_Goal_Number(kActorClovis, 518); - Non_Player_Actor_Combat_Mode_On(kActorSadik, 0, 1, 0, 9, 4, 7, 8, 0, -1, -1, 15, 300, 0); + Non_Player_Actor_Combat_Mode_On(kActorSadik, kActorCombatStateIdle, true, kActorMcCoy, 9, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, -1, -1, 15, 300, false); return true; case 419: @@ -999,6 +999,7 @@ bool AIScriptSadik::ChangeAnimationMode(int mode) { _animationState = 33; _animationFrame = 0; } + break; case 63: if (Actor_Query_Goal_Number(kActorSadik) != 105 && Actor_Query_Goal_Number(kActorSadik) != 106) { diff --git a/engines/bladerunner/script/ai/steele.cpp b/engines/bladerunner/script/ai/steele.cpp index e51a14a8ca..ff2afa1ec3 100644 --- a/engines/bladerunner/script/ai/steele.cpp +++ b/engines/bladerunner/script/ai/steele.cpp @@ -419,7 +419,7 @@ bool AIScriptSteele::ShotAtAndHit() { Actor_Set_Goal_Number(kActorSteele, 271); if (/* !a1 && */ Actor_Query_In_Set(kActorSteele, kSetHF06)) - Non_Player_Actor_Combat_Mode_On(1, 3, 1, 0, 15, 4, 7, 8, 0, 0, 100, 25, 300, 0); + Non_Player_Actor_Combat_Mode_On(kActorSteele, kActorCombatStateUncover, true, kActorMcCoy, 15, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, 0, 100, 25, 300, false); return false; } diff --git a/engines/bladerunner/script/ai/taffy_patron.cpp b/engines/bladerunner/script/ai/taffy_patron.cpp index c7fa3a7165..0bf6861d12 100644 --- a/engines/bladerunner/script/ai/taffy_patron.cpp +++ b/engines/bladerunner/script/ai/taffy_patron.cpp @@ -95,13 +95,13 @@ bool AIScriptTaffyPatron::GoalChanged(int currentGoalNumber, int newGoalNumber) case 250: Actor_Put_In_Set(kActorTaffyPatron, kSetNR01); - Actor_Set_At_XYZ(kActorTaffyPatron, -170.39999, 23.68, -850.0, 324); - Async_Actor_Walk_To_XYZ(kActorTaffyPatron, -390.0, 31.549999, -429.0, 24, 1); + Actor_Set_At_XYZ(kActorTaffyPatron, -170.4f, 23.68f, -850.0f, 324); + Async_Actor_Walk_To_XYZ(kActorTaffyPatron, -390.0f, 31.55f, -429.0f, 24, 1); return true; case 255: Actor_Put_In_Set(kActorTaffyPatron, kSetNR01); - Actor_Set_At_XYZ(kActorTaffyPatron, -170.39999, 23.68, -850.0, 324); + Actor_Set_At_XYZ(kActorTaffyPatron, -170.4f, 23.68f, -850.0f, 324); Actor_Change_Animation_Mode(kActorTaffyPatron, 48); return true; diff --git a/engines/bladerunner/script/ai/zuben.cpp b/engines/bladerunner/script/ai/zuben.cpp index 9fe6aa2f10..58cea9d39d 100644 --- a/engines/bladerunner/script/ai/zuben.cpp +++ b/engines/bladerunner/script/ai/zuben.cpp @@ -152,7 +152,7 @@ void AIScriptZuben::CompletedMovementTrack() { Set_Enter(kSetCT06, kSceneCT06); } if (Actor_Query_Goal_Number(kActorZuben) == 21) { - Non_Player_Actor_Combat_Mode_On(kActorZuben, 0, 0, kActorMcCoy, 6, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, 0, 100, 15, 300, 0); + Non_Player_Actor_Combat_Mode_On(kActorZuben, kActorCombatStateIdle, false, kActorMcCoy, 6, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, 0, 100, 15, 300, false); } int goal = Actor_Query_Goal_Number(kActorZuben); if (goal == 200) { @@ -977,7 +977,7 @@ bool AIScriptZuben::ChangeAnimationMode(int mode) { break; } break; - case kAnimationModeCombatShoot: + case kAnimationModeCombatAttack: _animationState = 8; _animationFrame = 0; break; diff --git a/engines/bladerunner/script/ai_script.cpp b/engines/bladerunner/script/ai_script.cpp index 98ad4c152f..aa8c14c6fc 100644 --- a/engines/bladerunner/script/ai_script.cpp +++ b/engines/bladerunner/script/ai_script.cpp @@ -329,4 +329,16 @@ void AIScripts::changeAnimationMode(int actor, int mode) { _inScriptCounter--; } +void AIScripts::fledCombat(int actor) { + if (actor >= _actorCount) { + return; + } + + _inScriptCounter++; + if (_AIScripts[actor]) { + _AIScripts[actor]->FledCombat(); + } + _inScriptCounter--; +} + } // End of namespace BladeRunner diff --git a/engines/bladerunner/script/ai_script.h b/engines/bladerunner/script/ai_script.h index edbb198040..d746dce631 100644 --- a/engines/bladerunner/script/ai_script.h +++ b/engines/bladerunner/script/ai_script.h @@ -535,6 +535,7 @@ public: bool reachedMovementTrackWaypoint(int actor, int waypointId); void updateAnimation(int actor, int *animation, int *frame); void changeAnimationMode(int actor, int mode); + void fledCombat(int actor); bool isInsideScript() const { return _inScriptCounter > 0; } diff --git a/engines/bladerunner/script/scene/ct07.cpp b/engines/bladerunner/script/scene/ct07.cpp index 2eb7805c44..ebbe604b65 100644 --- a/engines/bladerunner/script/scene/ct07.cpp +++ b/engines/bladerunner/script/scene/ct07.cpp @@ -89,7 +89,7 @@ void SceneScriptCT07::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo void SceneScriptCT07::PlayerWalkedIn() { Player_Gains_Control(); - Non_Player_Actor_Combat_Mode_On(kActorZuben, 0, 0, kActorMcCoy, 2, 4, 7, 8, 0, 0, 100, 15, 300, 0); + Non_Player_Actor_Combat_Mode_On(kActorZuben, kActorCombatStateIdle, false, kActorMcCoy, 2, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, 0, 100, 15, 300, false); Game_Flag_Set(516); Actor_Face_Actor(kActorMcCoy, kActorZuben, true); } diff --git a/engines/bladerunner/script/scene/hf01.cpp b/engines/bladerunner/script/scene/hf01.cpp index ce36b91e31..d75c381f35 100644 --- a/engines/bladerunner/script/scene/hf01.cpp +++ b/engines/bladerunner/script/scene/hf01.cpp @@ -90,9 +90,9 @@ bool SceneScriptHF01::ClickedOn3DObject(const char *objectName, bool a2) { bool SceneScriptHF01::ClickedOnActor(int actorId) { int v1; - if (Global_Variable_Query(45) == 2) { + if (Global_Variable_Query(kVariableAffectionTowards) == 2) { v1 = kActorDektora; - } else if (Global_Variable_Query(45) == 3) { + } else if (Global_Variable_Query(kVariableAffectionTowards) == 3) { v1 = kActorLucy; } else { v1 = -1; @@ -295,15 +295,15 @@ void SceneScriptHF01::PlayerWalkedIn() { Actor_Set_At_XYZ(kActorOfficerLeary, 8.2f, 8.0f, -346.67f, 1021); Actor_Put_In_Set(kActorOfficerGrayford, 37); Actor_Set_At_XYZ(kActorOfficerGrayford, 51.21f, 8.0f, -540.78f, 796); - Non_Player_Actor_Combat_Mode_On(kActorOfficerLeary, 3, 1, kActorMcCoy, 4, 4, 7, 8, 0, 0, 0, 100, 300, 0); - Non_Player_Actor_Combat_Mode_On(kActorOfficerGrayford, 3, 1, kActorMcCoy, 4, 4, 7, 8, 0, 0, 0, 100, 300, 0); + Non_Player_Actor_Combat_Mode_On(kActorOfficerLeary, kActorCombatStateUncover, true, kActorMcCoy, 4, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, 0, 0, 100, 300, false); + Non_Player_Actor_Combat_Mode_On(kActorOfficerGrayford, kActorCombatStateUncover, true, kActorMcCoy, 4, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, 0, 0, 100, 300, false); } if (!Game_Flag_Query(165) && Actor_Query_Goal_Number(kActorCrazylegs) != 2) { - if (Actor_Clue_Query(kActorMcCoy, kCluePhoneCallLucy1) && Global_Variable_Query(45) == 3 && Actor_Query_Goal_Number(kActorLucy) != 599) { + if (Actor_Clue_Query(kActorMcCoy, kCluePhoneCallLucy1) && Global_Variable_Query(kVariableAffectionTowards) == 3 && Actor_Query_Goal_Number(kActorLucy) != 599) { Actor_Put_In_Set(kActorLucy, 37); Actor_Set_At_XYZ(kActorLucy, -5.0f, 8.0f, -622.0f, 419); Actor_Set_Targetable(kActorLucy, true); - } else if (Actor_Clue_Query(kActorMcCoy, kCluePhoneCallDektora1) && Global_Variable_Query(45) == 2 && Actor_Query_Goal_Number(kActorDektora) != 599) { + } else if (Actor_Clue_Query(kActorMcCoy, kCluePhoneCallDektora1) && Global_Variable_Query(kVariableAffectionTowards) == 2 && Actor_Query_Goal_Number(kActorDektora) != 599) { Actor_Put_In_Set(kActorDektora, 37); Actor_Set_At_XYZ(kActorDektora, -5.0f, 8.0f, -622.0f, 419); Actor_Set_Targetable(kActorDektora, true); diff --git a/engines/bladerunner/script/scene/hf03.cpp b/engines/bladerunner/script/scene/hf03.cpp index 09bf589bb7..e3b01df4f8 100644 --- a/engines/bladerunner/script/scene/hf03.cpp +++ b/engines/bladerunner/script/scene/hf03.cpp @@ -96,8 +96,8 @@ void SceneScriptHF03::sub_401C80() { Actor_Says(kActorLucy, 210, 13); Actor_Says(kActorMcCoy, 1655, 15); Actor_Modify_Friendliness_To_Other(kActorLucy, kActorMcCoy, Random_Query(9, 10)); - if (Actor_Query_Friendliness_To_Other(kActorLucy, kActorMcCoy) > 59 && !Global_Variable_Query(45)) { - Global_Variable_Set(45, 3); + if (Actor_Query_Friendliness_To_Other(kActorLucy, kActorMcCoy) > 59 && Global_Variable_Query(kVariableAffectionTowards) == 0) { + Global_Variable_Set(kVariableAffectionTowards, 3); Actor_Says(kActorLucy, 940, 14); Actor_Says(kActorMcCoy, 6780, 11); Actor_Says(kActorLucy, 950, 12); diff --git a/engines/bladerunner/script/scene/hf05.cpp b/engines/bladerunner/script/scene/hf05.cpp index ff497ebbe8..a620d3aa15 100644 --- a/engines/bladerunner/script/scene/hf05.cpp +++ b/engines/bladerunner/script/scene/hf05.cpp @@ -483,10 +483,10 @@ void SceneScriptHF05::sub_403738() { } int SceneScriptHF05::sub_404858() { - if (Global_Variable_Query(45) == 2 && Actor_Query_Goal_Number(kActorDektora) != 599) { + if (Global_Variable_Query(kVariableAffectionTowards) == 2 && Actor_Query_Goal_Number(kActorDektora) != 599) { return kActorDektora; } - if (Global_Variable_Query(45) == 3 && Actor_Query_Goal_Number(kActorLucy) != 599) { + if (Global_Variable_Query(kVariableAffectionTowards) == 3 && Actor_Query_Goal_Number(kActorLucy) != 599) { return kActorLucy; } return -1; @@ -494,15 +494,15 @@ int SceneScriptHF05::sub_404858() { void SceneScriptHF05::sub_4042E4() { Actor_Force_Stop_Walking(kActorMcCoy); - Actor_Put_In_Set(kActorOfficerLeary, 41); - Actor_Set_At_XYZ(kActorOfficerLeary, 430.39999f, 40.630001f, -258.17999f, 300); - Actor_Put_In_Set(kActorOfficerGrayford, 41); - Actor_Set_At_XYZ(kActorOfficerGrayford, 526.40002f, 37.18f, -138.17999f, 300); + Actor_Put_In_Set(kActorOfficerLeary, kSetHF05); + Actor_Set_At_XYZ(kActorOfficerLeary, 430.4f, 40.63f, -258.18f, 300); + Actor_Put_In_Set(kActorOfficerGrayford, kSetHF05); + Actor_Set_At_XYZ(kActorOfficerGrayford, 526.4f, 37.18f, -138.18f, 300); ADQ_Flush(); ADQ_Add(kActorOfficerGrayford, 260, -1); Player_Loses_Control(); - Non_Player_Actor_Combat_Mode_On(kActorOfficerLeary, 3, 1, kActorMcCoy, 4, 4, 7, 8, 0, 0, 100, 100, 1200, 1); - return Non_Player_Actor_Combat_Mode_On(kActorOfficerGrayford, 3, 1, kActorMcCoy, 4, 4, 7, 8, 0, 0, 100, 100, 300, 1); + Non_Player_Actor_Combat_Mode_On(kActorOfficerLeary, kActorCombatStateUncover, true, kActorMcCoy, 4, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, 0, 100, 100, 1200, true); + Non_Player_Actor_Combat_Mode_On(kActorOfficerGrayford, kActorCombatStateUncover, true, kActorMcCoy, 4, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, 0, 100, 100, 300, true); } void SceneScriptHF05::sub_403F0C() { diff --git a/engines/bladerunner/script/scene/hf06.cpp b/engines/bladerunner/script/scene/hf06.cpp index 7a41c9eda2..49ea1d81d2 100644 --- a/engines/bladerunner/script/scene/hf06.cpp +++ b/engines/bladerunner/script/scene/hf06.cpp @@ -180,12 +180,13 @@ void SceneScriptHF06::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bo void SceneScriptHF06::PlayerWalkedIn() { if (Game_Flag_Query(662)) { - int actorId; - if (Global_Variable_Query(45) == 3 && Actor_Query_Goal_Number(kActorLucy) != 599) { + int actorId = -1; + if (Global_Variable_Query(kVariableAffectionTowards) == 3 && Actor_Query_Goal_Number(kActorLucy) != 599) { actorId = kActorLucy; - } else { - actorId = Global_Variable_Query(45) == 2 && Actor_Query_Goal_Number(kActorDektora) != 599 ? kActorDektora : -1; - } + } else if (Global_Variable_Query(kVariableAffectionTowards) == 2 && Actor_Query_Goal_Number(kActorDektora) != 599) { + actorId = kActorDektora; + } + if (actorId != -1) { Actor_Put_In_Set(actorId, 42); if (Game_Flag_Query(559)) { @@ -267,7 +268,7 @@ void SceneScriptHF06::sub_401EF4() { Sound_Play(562, 50, 0, 0, 50); Game_Flag_Set(559); Scene_Exits_Disable(); - Non_Player_Actor_Combat_Mode_On(kActorSteele, 3, 1, actorId, 15, 4, 7, 8, 0, 0, 100, 10, 300, 0); + Non_Player_Actor_Combat_Mode_On(kActorSteele, kActorCombatStateUncover, true, actorId, 15, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, 0, 100, 10, 300, false); } void SceneScriptHF06::sub_4023E0() { diff --git a/engines/bladerunner/script/scene/hf07.cpp b/engines/bladerunner/script/scene/hf07.cpp index e9fe2f05fd..b653cfd08a 100644 --- a/engines/bladerunner/script/scene/hf07.cpp +++ b/engines/bladerunner/script/scene/hf07.cpp @@ -142,11 +142,11 @@ void SceneScriptHF07::DialogueQueueFlushed(int a1) { } int SceneScriptHF07::sub_401864() { - if (Global_Variable_Query(45) == 2 && Actor_Query_Goal_Number(3) != 599) { - return 3; + if (Global_Variable_Query(kVariableAffectionTowards) == 2 && Actor_Query_Goal_Number(3) != 599) { + return kActorDektora; } - if (Global_Variable_Query(45) == 3 && Actor_Query_Goal_Number(6) != 599) { - return 6; + if (Global_Variable_Query(kVariableAffectionTowards) == 3 && Actor_Query_Goal_Number(6) != 599) { + return kActorLucy; } return -1; } diff --git a/engines/bladerunner/script/scene/kp05.cpp b/engines/bladerunner/script/scene/kp05.cpp index 9b080aceb0..99fa6c33fa 100644 --- a/engines/bladerunner/script/scene/kp05.cpp +++ b/engines/bladerunner/script/scene/kp05.cpp @@ -158,7 +158,7 @@ void SceneScriptKP05::PlayerWalkedIn() { Actor_Says(kActorMcCoy, 2220, 3); Actor_Says(kActorSteele, 620, 15); Actor_Says(kActorSteele, 630, 17); - Non_Player_Actor_Combat_Mode_On(kActorSteele, 0, 1, kActorMcCoy, 9, 4, 7, 8, 0, -1, -1, 20, 240, 0); + Non_Player_Actor_Combat_Mode_On(kActorSteele, kActorCombatStateIdle, true, kActorMcCoy, 9, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, -1, -1, 20, 240, false); } } diff --git a/engines/bladerunner/script/scene/ma04.cpp b/engines/bladerunner/script/scene/ma04.cpp index 5f1b41e998..ead9f1946d 100644 --- a/engines/bladerunner/script/scene/ma04.cpp +++ b/engines/bladerunner/script/scene/ma04.cpp @@ -176,9 +176,9 @@ bool SceneScriptMA04::ClickedOn2DRegion(int region) { Overlay_Remove("MA04OVER"); Delay(500); if (Game_Flag_Query(653)) { - if (Global_Variable_Query(45) == 2) { + if (Global_Variable_Query(kVariableAffectionTowards) == 2) { phoneCallWithDektora(); - } else if (Global_Variable_Query(45) == 3) { + } else if (Global_Variable_Query(kVariableAffectionTowards) == 3) { phoneCallWithLucy(); } else { phoneCallWithClovis(); diff --git a/engines/bladerunner/script/scene/nr01.cpp b/engines/bladerunner/script/scene/nr01.cpp index 171cea52d8..fd7c9911d0 100644 --- a/engines/bladerunner/script/scene/nr01.cpp +++ b/engines/bladerunner/script/scene/nr01.cpp @@ -384,7 +384,7 @@ void SceneScriptNR01::PlayerWalkedIn() { if (Actor_Query_Goal_Number(kActorGordo) == 230) { Scene_Exits_Disable(); Actor_Set_Goal_Number(kActorGordo, 231); - Non_Player_Actor_Combat_Mode_On(kActorGordo, 0, 1, kActorMcCoy, 3, 4, 7, 8, -1, -1, -1, 20, 300, 0); + Non_Player_Actor_Combat_Mode_On(kActorGordo, kActorCombatStateIdle, true, kActorMcCoy, 3, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, -1, -1, -1, 20, 300, false); } } else if (Game_Flag_Query(545)) { Game_Flag_Reset(545); diff --git a/engines/bladerunner/script/scene/nr11.cpp b/engines/bladerunner/script/scene/nr11.cpp index 95ef4b7d84..5c4f4c141c 100644 --- a/engines/bladerunner/script/scene/nr11.cpp +++ b/engines/bladerunner/script/scene/nr11.cpp @@ -140,7 +140,7 @@ bool SceneScriptNR11::ClickedOn3DObject(const char *objectName, bool a2) { } else { Actor_Says(kActorMcCoy, 3840, 18); Delay(1000); - if (Actor_Query_Friendliness_To_Other(kActorDektora, kActorMcCoy) > 59 && !Global_Variable_Query(45)) { + if (Actor_Query_Friendliness_To_Other(kActorDektora, kActorMcCoy) > 59 && Global_Variable_Query(kVariableAffectionTowards) == 0) { Music_Play(21, 35, 0, 3, -1, 0, 0); } Loop_Actor_Walk_To_XYZ(kActorDektora, -135.0f, 0.33f, -267.0f, 0, 0, false, 0); @@ -164,8 +164,8 @@ bool SceneScriptNR11::ClickedOn3DObject(const char *objectName, bool a2) { Actor_Says(kActorMcCoy, 3870, 3); Actor_Says(kActorDektora, 1070, 14); Actor_Modify_Friendliness_To_Other(kActorDektora, kActorMcCoy, 5); - if (Actor_Query_Friendliness_To_Other(kActorDektora, kActorMcCoy) > 55 && !Global_Variable_Query(45)) { - Global_Variable_Set(45, 2); + if (Actor_Query_Friendliness_To_Other(kActorDektora, kActorMcCoy) > 55 && Global_Variable_Query(kVariableAffectionTowards) == 0) { + Global_Variable_Set(kVariableAffectionTowards, 2); Actor_Says(kActorDektora, 1130, 17); Actor_Says(kActorMcCoy, 6365, 12); Actor_Says(kActorDektora, 1140, 14); diff --git a/engines/bladerunner/script/scene/ug05.cpp b/engines/bladerunner/script/scene/ug05.cpp index c3996dca37..3348ebbfb6 100644 --- a/engines/bladerunner/script/scene/ug05.cpp +++ b/engines/bladerunner/script/scene/ug05.cpp @@ -222,10 +222,10 @@ void SceneScriptUG05::DialogueQueueFlushed(int a1) { } int SceneScriptUG05::sub_4021B0() { - if (Global_Variable_Query(45) == 2 && Actor_Query_Goal_Number(kActorDektora) != 599) { + if (Global_Variable_Query(kVariableAffectionTowards) == 2 && Actor_Query_Goal_Number(kActorDektora) != 599) { return kActorDektora; } - if (Global_Variable_Query(45) == 3 && Actor_Query_Goal_Number(kActorLucy) != 599) { + if (Global_Variable_Query(kVariableAffectionTowards) == 3 && Actor_Query_Goal_Number(kActorLucy) != 599) { return kActorLucy; } return -1; diff --git a/engines/bladerunner/script/scene/ug18.cpp b/engines/bladerunner/script/scene/ug18.cpp index cafe42654a..c20c58cc72 100644 --- a/engines/bladerunner/script/scene/ug18.cpp +++ b/engines/bladerunner/script/scene/ug18.cpp @@ -323,9 +323,8 @@ void SceneScriptUG18::sub_402734() { } void SceneScriptUG18::sub_402DE8() { - if (Player_Query_Agenda()) { - if (Global_Variable_Query(45) > 1 || Player_Query_Agenda() == 2) { + if (Global_Variable_Query(kVariableAffectionTowards) > 1 || Player_Query_Agenda() == 2) { sub_403114(); } else { sub_402F8C(); diff --git a/engines/bladerunner/script/script.cpp b/engines/bladerunner/script/script.cpp index 2aca6db9d3..ff2a840a28 100644 --- a/engines/bladerunner/script/script.cpp +++ b/engines/bladerunner/script/script.cpp @@ -130,7 +130,7 @@ void ScriptBase::Actor_Face_Heading(int actorId, int heading, bool animate) { } int ScriptBase::Actor_Query_Friendliness_To_Other(int actorId, int otherActorId) { - return _vm->_actors[actorId]->_friendlinessToOther[otherActorId]; + return _vm->_actors[actorId]->getFriendlinessToOther(otherActorId); } void ScriptBase::Actor_Modify_Friendliness_To_Other(int actorId, int otherActorId, signed int change) { @@ -158,27 +158,27 @@ void ScriptBase::Actor_Set_Combat_Aggressiveness(int actorId, int combatAggressi } int ScriptBase::Actor_Query_Current_HP(int actorId) { - return _vm->_actors[actorId]->_currentHP; + return _vm->_actors[actorId]->getCurrentHP(); } int ScriptBase::Actor_Query_Max_HP(int actorId) { - return _vm->_actors[actorId]->_maxHP; + return _vm->_actors[actorId]->getMaxHP(); } int ScriptBase::Actor_Query_Combat_Aggressiveness(int actorId) { - return _vm->_actors[actorId]->_combatAggressiveness; + return _vm->_actors[actorId]->getCombatAggressiveness(); } int ScriptBase::Actor_Query_Honesty(int actorId) { - return _vm->_actors[actorId]->_honesty; + return _vm->_actors[actorId]->getHonesty(); } int ScriptBase::Actor_Query_Intelligence(int actorId) { - return _vm->_actors[actorId]->_intelligence; + return _vm->_actors[actorId]->getIntelligence(); } int ScriptBase::Actor_Query_Stability(int actorId) { - return _vm->_actors[actorId]->_stability; + return _vm->_actors[actorId]->getStability(); } void ScriptBase::Actor_Modify_Current_HP(int actorId, signed int change) { @@ -218,8 +218,8 @@ void ScriptBase::Actor_Combat_AI_Hit_Attempt(int actorId) { _vm->_actors[actorId]->_combatInfo->hitAttempt(); } -void ScriptBase::Non_Player_Actor_Combat_Mode_On(int actorId, int a2, int a3, int otherActorId, int a5, int animationModeCombatIdle, int animationModeCombatWalk, int animationModeCombatRun, int a9, int a10, int a11, int a12, int a13, int a14) { - _vm->_actors[actorId]->combatModeOn(a2, a3, otherActorId, a5, animationModeCombatIdle, animationModeCombatWalk, animationModeCombatRun, a9, a10, a11, a12, a13, a14); +void ScriptBase::Non_Player_Actor_Combat_Mode_On(int actorId, int initialState, bool rangedAttack, int enemyId, int waypointType, int animationModeCombatIdle, int animationModeCombatWalk, int animationModeCombatRun, int fleeRatio, int coverRatio, int actionRatio, int damage, int range, bool a14) { + _vm->_actors[actorId]->combatModeOn(initialState, rangedAttack, enemyId, waypointType, animationModeCombatIdle, animationModeCombatWalk, animationModeCombatRun, fleeRatio, coverRatio, actionRatio, damage, range, a14); } void ScriptBase::Non_Player_Actor_Combat_Mode_Off(int actorId) { @@ -723,8 +723,9 @@ int ScriptBase::Animation_Skip_To_Frame() { void ScriptBase::Delay(int miliseconds) { Player_Loses_Control(); int endTime = _vm->getTotalPlayTime() + miliseconds; - while ((int)_vm->getTotalPlayTime() < endTime) + while ((int)_vm->getTotalPlayTime() < endTime) { _vm->gameTick(); + } Player_Gains_Control(); } @@ -1075,14 +1076,27 @@ float ScriptBase::World_Waypoint_Query_Z(int waypointId) { return _vm->_waypoints->getZ(waypointId); } -void ScriptBase::Combat_Cover_Waypoint_Set_Data(int combatCoverId, int type, int setId, int sceneId, float x, float y, float z) { - //TODO - warning("Combat_Cover_Waypoint_Set_Data(%d, %d, %d, %d, %f, %f, %f)", combatCoverId, type, setId, sceneId, x, y, z); +void ScriptBase::Combat_Cover_Waypoint_Set_Data(int coverWaypointId, int type, int setId, int sceneId, float x, float y, float z) { + assert(coverWaypointId < (int)_vm->_combat->_coverWaypoints.size()); + + _vm->_combat->_coverWaypoints[coverWaypointId].type = type; + _vm->_combat->_coverWaypoints[coverWaypointId].setId = setId; + _vm->_combat->_coverWaypoints[coverWaypointId].sceneId = sceneId; + _vm->_combat->_coverWaypoints[coverWaypointId].position.x = x; + _vm->_combat->_coverWaypoints[coverWaypointId].position.y = y; + _vm->_combat->_coverWaypoints[coverWaypointId].position.z = z; } -void ScriptBase::Combat_Flee_Waypoint_Set_Data(int combatFleeWaypointId, int type, int setId, int sceneId, float x, float y, float z, int a8) { - //TODO - warning("Combat_Cover_Waypoint_Set_Data(%d, %d, %d, %d, %f, %f, %f, %d)", combatFleeWaypointId, type, setId, sceneId, x, y, z, a8); +void ScriptBase::Combat_Flee_Waypoint_Set_Data(int fleeWaypointId, int type, int setId, int sceneId, float x, float y, float z, int a8) { + assert(fleeWaypointId < (int)_vm->_combat->_fleeWaypoints.size()); + + _vm->_combat->_fleeWaypoints[fleeWaypointId].type = type; + _vm->_combat->_fleeWaypoints[fleeWaypointId].setId = setId; + _vm->_combat->_fleeWaypoints[fleeWaypointId].sceneId = sceneId; + _vm->_combat->_fleeWaypoints[fleeWaypointId].position.x = x; + _vm->_combat->_fleeWaypoints[fleeWaypointId].position.y = y; + _vm->_combat->_fleeWaypoints[fleeWaypointId].position.z = z; + _vm->_combat->_fleeWaypoints[fleeWaypointId].field7 = a8; } void ScriptBase::Police_Maze_Target_Track_Add(int itemId, float startX, float startY, float startZ, float endX, float endY, float endZ, int steps, signed int data[], bool a10) { @@ -1221,10 +1235,8 @@ bool ScriptBase::Query_System_Currently_Loading_Game() { void ScriptBase::Actor_Retired_Here(int actorId, int width, int height, int retired, int retiredByActorId) { Actor *actor = _vm->_actors[actorId]; - Vector3 actorPosition; - actor->getXYZ(&actorPosition.x, &actorPosition.y, &actorPosition.z); actor->retire(retired, width, height, retiredByActorId); - actor->setAtXYZ(actorPosition, actor->getFacing(), true, false, true); + actor->setAtXYZ(actor->getXYZ(), actor->getFacing(), true, false, true); _vm->_sceneObjects->setRetired(actorId + kSceneObjectOffsetActors, true); } diff --git a/engines/bladerunner/script/script.h b/engines/bladerunner/script/script.h index 7faf3886b2..9df231a1c3 100644 --- a/engines/bladerunner/script/script.h +++ b/engines/bladerunner/script/script.h @@ -78,7 +78,7 @@ protected: void Actor_Set_Flag_Damage_Anim_If_Moving(int actorId, bool value); bool Actor_Query_Flag_Damage_Anim_If_Moving(int actorId); void Actor_Combat_AI_Hit_Attempt(int actorId); - void Non_Player_Actor_Combat_Mode_On(int actorId, int a2, int a3, int otherActorId, int a5, int animationModeCombatIdle, int animationModeCombatWalk, int animationModeCombatRun, int a9, int a10, int a11, int a12, int a13, int a14); + void Non_Player_Actor_Combat_Mode_On(int actorId, int initialState, bool rangedAttack, int enemyId, int waypointType, int animationModeCombatIdle, int animationModeCombatWalk, int animationModeCombatRun, int fleeRatio, int coverRatio, int actionRatio, int damage, int range, bool a14); void Non_Player_Actor_Combat_Mode_Off(int actorId); void Actor_Set_Health(int actorId, int hp, int maxHp); void Actor_Set_Targetable(int actorId, bool targetable); @@ -205,8 +205,8 @@ protected: float World_Waypoint_Query_X(int waypointId); float World_Waypoint_Query_Y(int waypointId); float World_Waypoint_Query_Z(int waypointId); - void Combat_Cover_Waypoint_Set_Data(int combatCoverId, int a2, int setId, int a4, float x, float y, float z); - void Combat_Flee_Waypoint_Set_Data(int combatFleeWaypointId, int a2, int setId, int a4, float x, float y, float z, int a8); + void Combat_Cover_Waypoint_Set_Data(int coverWaypointId, int a2, int setId, int a4, float x, float y, float z); + void Combat_Flee_Waypoint_Set_Data(int fleeWaypointId, int a2, int setId, int a4, float x, float y, float z, int a8); void Police_Maze_Target_Track_Add(int itemId, float startX, float startY, float startZ, float endX, float endY, float endZ, int steps, signed int data[], bool a10); // Police_Maze_Query_Score // Police_Maze_Zero_Score |