void ScriptMA04::sub_403DA8() { if (!Loop_Actor_Walk_To_Scene_Object(0, "BED-SHEETS", 12, 1, false)) { Actor_Says(0, 8530, 12); Music_Stop(4); if (sub_402820() || sub_402758()) { Overlay_Remove("MA04OVER"); } Player_Loses_Control(); Game_Flag_Set(647); if ((Game_Flag_Query(40) || Game_Flag_Query(41)) && Global_Variable_Query(1) == 1) { if (Actor_Query_Goal_Number(19) == 599) { Actor_Put_In_Set(19, 91); Actor_Set_At_Waypoint(19, 33, 0); } Game_Flag_Set(678); Global_Variable_Set(1, 2); Chapter_Enter(2, 10, 50); if (Query_Difficulty_Level() != 0) { if (!Game_Flag_Query(723)) { Global_Variable_Increment(2, 200); } } } else { Set_Enter(10, 50); } Scene_Loop_Start_Special(1, 3, 0); } }
bool AIScriptBulletBob::ShotAtAndHit() { Global_Variable_Increment(kVariableBobShot, 1); if (Global_Variable_Query(kVariableBobShot) > 0) { Actor_Set_Targetable(kActorBulletBob, false); Actor_Set_Goal_Number(kActorBulletBob, 99); _animationFrame = 0; _animationState = 3; Ambient_Sounds_Play_Speech_Sound(kActorGordo, 9000, 100, 0, 0, 0); // not a typo, it's really from Gordo Actor_Face_Heading(kActorBulletBob, 281, false); } return false; }
void AIScriptLucy::Retired(int byActorId) { if (byActorId == kActorMcCoy) { Actor_Modify_Friendliness_To_Other(kActorClovis, kActorMcCoy, -6); } if ((byActorId == kActorSteele || byActorId == kActorMcCoy) && Actor_Query_In_Set(kActorSteele, kSetHF06) && Actor_Query_In_Set(kActorMcCoy, kSetHF06)) { 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); } Actor_Set_Goal_Number(kActorLucy, 599); }
void ScriptKP07::InitializeScene() { Setup_Scene_Information(-12.0f, -41.58f, 72.0f, 0); Game_Flag_Reset(578); Scene_Exit_Add_2D_Exit(0, 315, 185, 381, 285, 0); if (Game_Flag_Query(653)) { if (Game_Flag_Query(47) && Actor_Query_Goal_Number(3) < 599) { Actor_Set_Targetable(3, true); Global_Variable_Increment(51, 1); Actor_Put_In_Set(3, 48); Actor_Set_At_XYZ(3, -52.0f, -41.52f, -5.0f, 289); } if (Actor_Query_Goal_Number(19) < 599) { Global_Variable_Increment(51, 1); Actor_Set_Targetable(19, true); Actor_Put_In_Set(19, 48); Actor_Set_At_XYZ(19, -26.0f, -41.52f, -135.0f, 0); } if (Game_Flag_Query(44) && Actor_Query_Goal_Number(7) < 599) { Global_Variable_Increment(51, 1); Actor_Set_Targetable(7, true); Actor_Put_In_Set(7, 48); Actor_Set_At_XYZ(7, -38.0f, -41.52f, -175.0f, 500); } if (Game_Flag_Query(45) && Actor_Query_Goal_Number(2) < 599) { Global_Variable_Increment(51, 1); Actor_Set_Targetable(2, true); Actor_Put_In_Set(2, 48); Actor_Set_At_XYZ(2, 61.0f, -41.52f, -3.0f, 921); } if (Game_Flag_Query(46) && Actor_Query_Goal_Number(6) < 599) { Global_Variable_Increment(51, 1); Actor_Put_In_Set(6, 48); Actor_Set_At_XYZ(6, 78.0f, -41.52f, -119.0f, 659); } if (Actor_Query_Goal_Number(10) < 599) { Global_Variable_Increment(51, 1); Actor_Put_In_Set(10, 48); Actor_Set_At_XYZ(10, -47.0f, 0.0f, 151.0f, 531); } } Ambient_Sounds_Add_Looping_Sound(585, 7, 1, 1); Ambient_Sounds_Add_Looping_Sound(586, 52, 1, 1); Ambient_Sounds_Add_Looping_Sound(109, 38, 1, 1); if (Game_Flag_Query(582)) { Scene_Loop_Set_Default(2); } else { Scene_Loop_Set_Default(0); } }
void ScriptKP07::PlayerWalkedIn() { Loop_Actor_Walk_To_XYZ(0, 9.0f, -41.88f, -81.0f, 0, 0, false, 0); if (!Game_Flag_Query(658)) { if (Game_Flag_Query(653)) { Actor_Face_Actor(0, 5, true); Actor_Says(5, 1240, 3); Actor_Says(0, 8500, 3); Actor_Says(5, 1250, 3); if (Actor_Query_Goal_Number(8) == 416) { Actor_Put_In_Set(8, 48); Global_Variable_Increment(51, 1); Actor_Set_At_XYZ(8, -12.0f, -41.58f, 72.0f, 0); Actor_Face_Actor(8, 5, true); } } else { Actor_Face_Actor(0, 5, true); Actor_Says(5, 160, 3); Actor_Retired_Here(5, 72, 60, 0, -1); } Game_Flag_Set(658); } }
bool AIScriptClovis::GoalChanged(int currentGoalNumber, int newGoalNumber) { switch (newGoalNumber) { case kGoalClovisDefault: AI_Movement_Track_Flush(kActorClovis); AI_Movement_Track_Append(kActorClovis, 33, 0); AI_Movement_Track_Repeat(kActorClovis); return true; case kGoalClovisBB11WalkToMcCoy: AI_Movement_Track_Flush(kActorClovis); AI_Movement_Track_Append(kActorClovis, 319, 0); AI_Movement_Track_Append(kActorClovis, 320, 0); AI_Movement_Track_Repeat(kActorClovis); return true; case kGoalClovisBB11StopSadik: Actor_Start_Speech_Sample(kActorClovis, 0); AI_Movement_Track_Flush(kActorClovis); AI_Movement_Track_Append(kActorClovis, 321, 0); AI_Movement_Track_Repeat(kActorClovis); return true; case kGoalClovisBB11TalkWithSadik: Actor_Set_Goal_Number(kActorSadik, kGoalSadikBB11TalkWithClovis); Actor_Says(kActorClovis, 10, 15); Actor_Says(kActorSadik, 0, kAnimationModeTalk); Actor_Face_Actor(kActorClovis, kActorSadik, true); Actor_Says(kActorClovis, 20, 13); Actor_Says(kActorClovis, 30, 12); Actor_Face_Actor(kActorSadik, kActorClovis, true); Actor_Says(kActorSadik, 10, kAnimationModeTalk); Actor_Says(kActorClovis, 40, 17); Actor_Says(kActorSadik, 20, kAnimationModeTalk); Actor_Face_Actor(kActorClovis, kActorMcCoy, true); Actor_Face_Actor(kActorSadik, kActorMcCoy, true); Actor_Says(kActorClovis, 50, 14); Actor_Change_Animation_Mode(kActorClovis, kAnimationModeSit); return true; case kGoalClovisBB11TalkToMcCoy: Actor_Says(kActorClovis, 60, 30); Actor_Says(kActorSadik, 30, kAnimationModeTalk); Actor_Says(kActorClovis, 70, 30); Actor_Says(kActorClovis, 80, 30); Actor_Change_Animation_Mode(kActorClovis, 29); Actor_Says(kActorSadik, 40, kAnimationModeTalk); Actor_Says(kActorSadik, 50, kAnimationModeTalk); Actor_Says(kActorClovis, 90, 13); Actor_Face_Current_Camera(5, true); Actor_Says(kActorClovis, 100, 17); Delay(1000); if (!Game_Flag_Query(kFlagSadikIsReplicant)) { Actor_Clue_Acquire(kActorMcCoy, kClueStaggeredbyPunches, true, kActorSadik); } Game_Flag_Set(kFlagNotUsed383); Game_Flag_Reset(kFlagBB11SadikFight); Global_Variable_Set(kVariableChapter, 3); Actor_Set_Goal_Number(kActorClovis, 200); Actor_Set_Goal_Number(kActorSadik, 200); Actor_Clue_Acquire(kActorMcCoy, kClueAct2Ended, true, -1); Player_Gains_Control(); Chapter_Enter(3, kSetCT08_CT51_UG12, kSceneCT08); Game_Flag_Set(kFlagMcCoyTiedDown); Game_Flag_Set(kFlagChapter3Intro); return true; case 300: Actor_Put_In_Set(kActorClovis, kSetUG18); Actor_Set_At_XYZ(kActorClovis, -52.26f, 0.0f, 611.02f, 900); Actor_Change_Animation_Mode(kActorClovis, kAnimationModeIdle); return true; case 301: case 302: case 303: case 310: return true; case 350: Actor_Put_In_Set(kActorClovis, kSetFreeSlotA); Actor_Set_At_Waypoint(kActorClovis, 33, 0); return true; case 400: AI_Movement_Track_Flush(kActorClovis); Actor_Put_In_Set(kActorClovis, kSetFreeSlotA); Actor_Set_At_Waypoint(kActorClovis, 33, 0); return true; case 401: AI_Movement_Track_Flush(kActorClovis); AI_Movement_Track_Append(kActorClovis, 341, 0); AI_Movement_Track_Append(kActorClovis, 342, 0); AI_Movement_Track_Repeat(kActorClovis); return true; case 402: Player_Loses_Control(); Actor_Force_Stop_Walking(kActorMcCoy); Actor_Face_Actor(kActorMcCoy, kActorClovis, 1); Loop_Actor_Walk_To_Actor(kActorClovis, kActorMcCoy, 48, 0, 1); Actor_Face_Actor(kActorClovis, kActorMcCoy, 1); Actor_Change_Animation_Mode(kActorClovis, 6); if (Player_Query_Combat_Mode()) { Actor_Change_Animation_Mode(kActorMcCoy, 49); } else { Actor_Change_Animation_Mode(kActorMcCoy, 48); } Delay(3000); Actor_Retired_Here(kActorMcCoy, 12, 48, 1, kActorClovis); return true; case 500: Actor_Set_Goal_Number(kActorClovis, 510); return true; case 510: if (Game_Flag_Query(653)) { Actor_Set_Goal_Number(kActorClovis, 513); } else { Actor_Set_Goal_Number(kActorClovis, 511); Game_Flag_Set(685); } return true; case 511: Actor_Put_In_Set(kActorClovis, kSetKP05_KP06); Actor_Set_At_XYZ(kActorClovis, -1072.0f, 8.26f, -708.0f, 530); return true; case 512: Actor_Says(kActorClovis, 110, kAnimationModeTalk); Actor_Says(kActorMcCoy, 2255, kAnimationModeTalk); Actor_Says(kActorClovis, 120, kAnimationModeTalk); Actor_Says(kActorClovis, 130, kAnimationModeTalk); Actor_Says(kActorClovis, 140, kAnimationModeTalk); Actor_Says(kActorMcCoy, 2260, kAnimationModeTalk); Actor_Says(kActorClovis, 150, kAnimationModeTalk); Actor_Set_Goal_Number(kActorClovis, 513); return true; case 513: Actor_Put_In_Set(kActorClovis, kSetKP07); Actor_Set_Targetable(kActorClovis, true); if (Game_Flag_Query(653)) { Global_Variable_Set(kVariableReplicants, 0); Global_Variable_Increment(kVariableReplicants, 1); Actor_Set_At_XYZ(kActorClovis, 45.0f, -41.52f, -85.0f, 750); } else { Actor_Set_At_XYZ(kActorClovis, 84.85f, -50.56f, -68.87f, 800); Actor_Face_Heading(kActorClovis, 1022, false); } someAnim(); return true; case 514: Actor_Says(kActorMcCoy, 2345, 16); Actor_Says(kActorClovis, 170, -1); Actor_Says(kActorClovis, 180, kAnimationModeTalk); Actor_Says(kActorMcCoy, 2350, 17); if (!Game_Flag_Query(714)) { Actor_Says(kActorMcCoy, 2355, 11); } Actor_Says(kActorClovis, 190, -1); Actor_Says(kActorClovis, 200, kAnimationModeTalk); Actor_Says(kActorMcCoy, 2360, 18); Actor_Says(kActorClovis, 210, kAnimationModeTalk); Actor_Says(kActorClovis, 220, -1); Actor_Set_Goal_Number(kActorClovis, 515); return true; case 515: ADQ_Add(kActorClovis, 240, -1); ADQ_Add(kActorClovis, 250, -1); ADQ_Add(kActorClovis, 260, -1); ADQ_Add(kActorClovis, 270, -1); ADQ_Add_Pause(1000); ADQ_Add(kActorClovis, 280, -1); ADQ_Add(kActorClovis, 290, -1); ADQ_Add(kActorClovis, 300, -1); return true; case 516: Actor_Says(kActorMcCoy, 8501, kAnimationModeTalk); Actor_Says(kActorClovis, 1260, kAnimationModeTalk); Actor_Says(kActorMcCoy, 8502, kAnimationModeTalk); Actor_Says(kActorClovis, 1270, kAnimationModeTalk); Actor_Says(kActorMcCoy, 8504, kAnimationModeTalk); Actor_Says(kActorClovis, 1290, kAnimationModeTalk); Actor_Says(kActorMcCoy, 8505, kAnimationModeTalk); Actor_Says(kActorClovis, 1300, kAnimationModeTalk); Actor_Says(kActorClovis, 1310, kAnimationModeTalk); Ambient_Sounds_Remove_All_Non_Looping_Sounds(true); Ambient_Sounds_Remove_All_Looping_Sounds(1); Outtake_Play(kOuttakeEnd4A, 0, -1); if (Global_Variable_Query(kVariableAffectionTowards) == kAffectionTowardsLucy && Game_Flag_Query(kFlagLucyIsReplicant) ) { Outtake_Play(kOuttakeEnd4B, 0, -1); } else if (Global_Variable_Query(kVariableAffectionTowards) == kAffectionTowardsDektora && Game_Flag_Query(kFlagDektoraIsReplicant) ) { Outtake_Play(kOuttakeEnd4C, 0, -1); } Outtake_Play(kOuttakeEnd4D, 0, -1); Game_Over(); return true; case 517: if (Global_Variable_Query(kVariableChapter) == 5 && Actor_Query_In_Set(kActorLucy, kSetKP07)) { Actor_Set_Goal_Number(kActorLucy, 599); Global_Variable_Decrement(kVariableReplicants, 1); } if (Global_Variable_Query(kVariableChapter) == 5 && Actor_Query_In_Set(kActorLuther, kSetKP07)) { Actor_Set_Goal_Number(kActorLuther, 599); Global_Variable_Decrement(kVariableReplicants, 1); } if (Global_Variable_Query(kVariableChapter) == 5 && Actor_Query_In_Set(kActorDektora, kSetKP07)) { 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, 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, 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, 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, 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, kActorCombatStateIdle, false, kActorMcCoy, 19, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, 0, 100, 10, 300, false); } return true; case 518: Actor_Set_At_XYZ(kActorClovis, 84.85f, -50.56f, -68.87f, 800); Actor_Face_Heading(kActorClovis, 1022, false); Actor_Set_Targetable(kActorClovis, true); Game_Flag_Set(685); someAnim(); return true; default: break; } return false; }
bool SceneScriptHC02::ClickedOnActor(int actorId) { if (actorId == kActorHawkersBarkeep) { if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -150.51f, 0.14f, 62.74f, 0, true, false, 0)) { Actor_Face_Actor(kActorMcCoy, kActorHawkersBarkeep, true); if (!Game_Flag_Query(kFlagHC02HawkersBarkeepIntroduction)) { Actor_Says(kActorMcCoy, 1225, 13); Actor_Says_With_Pause(kActorHawkersBarkeep, 0, 0.0f, 13); Actor_Says(kActorHawkersBarkeep, 10, 16); Actor_Set_Goal_Number(kActorHawkersBarkeep, 1); Actor_Change_Animation_Mode(kActorMcCoy, 23); Delay(1500); Actor_Change_Animation_Mode(kActorMcCoy, 75); Delay(1500); Global_Variable_Increment(kVariableMcCoyDrinks, 1); Game_Flag_Set(kFlagHC02HawkersBarkeepIntroduction); } else if ( Actor_Clue_Query(kActorMcCoy, kClueChinaBarSecurityCamera) && !Actor_Clue_Query(kActorMcCoy, kClueChinaBarSecurityDisc) ) { Actor_Says(kActorMcCoy, 4545, 11); Actor_Says(kActorHawkersBarkeep, 120, 12); Actor_Says(kActorHawkersBarkeep, 180, 13); Actor_Clue_Acquire(kActorMcCoy, kClueChinaBarSecurityDisc, true, kActorHawkersBarkeep); Item_Pickup_Spin_Effect(975, 229, 215); } else if ( Actor_Clue_Query(kActorMcCoy, kClueHomelessManInterview1) && !Actor_Clue_Query(kActorMcCoy, kClueFlaskOfAbsinthe) && (Global_Variable_Query(kVariableChinyen) > 20 || Query_Difficulty_Level() == 0 ) ) { Actor_Clue_Acquire(kActorMcCoy, kClueFlaskOfAbsinthe, true, kActorHawkersBarkeep); Actor_Says(kActorMcCoy, 1230, 13); Actor_Says(kActorHawkersBarkeep, 20, 12); Actor_Says(kActorMcCoy, 1235, 13); Actor_Says(kActorHawkersBarkeep, 30, 15); Actor_Says(kActorMcCoy, 1240, 13); Actor_Says(kActorHawkersBarkeep, 40, 14); Item_Pickup_Spin_Effect(945, 229, 215); Actor_Set_Goal_Number(kActorHawkersBarkeep, 2); Actor_Change_Animation_Mode(kActorMcCoy, 23); Delay(1500); Actor_Says_With_Pause(kActorHawkersBarkeep, 50, 1.6f, 17); if (Query_Difficulty_Level() != 0) { Global_Variable_Decrement(kVariableChinyen, 20); } Actor_Says(kActorMcCoy, 1245, 13); } else { if ( Actor_Clue_Query(kActorMcCoy, kClueMaggieBracelet) && !Game_Flag_Query(kFlagHC02HawkersBarkeepBraceletTalk) ) { Actor_Says(kActorHawkersBarkeep, 80, 16); Actor_Says(kActorMcCoy, 1265, 13); Actor_Says(kActorHawkersBarkeep, 90, 13); Game_Flag_Set(kFlagHC02HawkersBarkeepBraceletTalk); } if (Global_Variable_Query(kVariableChinyen) > 5 || Query_Difficulty_Level() == 0 ) { if (Query_Difficulty_Level() != 0) { Global_Variable_Decrement(kVariableChinyen, 5); } Global_Variable_Increment(kVariableMcCoyDrinks, 1); Actor_Says(kActorMcCoy, 1250, 13); Actor_Says_With_Pause(kActorHawkersBarkeep, 60, 0.8f, 14); Actor_Says(kActorMcCoy, 1255, 13); Actor_Set_Goal_Number(kActorHawkersBarkeep, 1); Actor_Change_Animation_Mode(kActorMcCoy, 23); Delay(1500); Actor_Change_Animation_Mode(kActorMcCoy, 75); Delay(1500); } else { Actor_Says_With_Pause(kActorMcCoy, 1260, 0.3f, 13); Actor_Says(kActorHawkersBarkeep, 70, 14); } } } return true; } return false; }