Esempio n. 1
0
void SceneScriptRC01::PlayerWalkedIn() {
	if (Game_Flag_Query(kFlagSpinnerAtRC01) && !Game_Flag_Query(kFlagRC02toRC01) && !Game_Flag_Query(kFlagRC03toRC01)) {
		walkToCenter();
	}

	if (Game_Flag_Query(kFlagRC03toRC01)) {
		Player_Loses_Control();
		Loop_Actor_Walk_To_XYZ(kActorMcCoy, -415.98f, -0.30f, 262.15f, 0, 0, false, 0);
		Player_Gains_Control();
		Game_Flag_Reset(kFlagRC03toRC01);
	}

	if (Game_Flag_Query(kFlagRC02toRC01)) {
		Player_Loses_Control();
		Loop_Actor_Walk_To_XYZ(kActorMcCoy, -203.45f, 5.55f, 85.05f, 0, 0, false, 0);
		Player_Gains_Control();
		Game_Flag_Reset(kFlagRC02toRC01);

		if ( Game_Flag_Query(kFlagRC02Entered)
		 && !Game_Flag_Query(kFlagRC02Left)
		) {
			Actor_Voice_Over(1910, kActorVoiceOver);
			Actor_Voice_Over(1920, kActorVoiceOver);
			Actor_Voice_Over(1930, kActorVoiceOver);
			Game_Flag_Set(kFlagRC02Left);
		}
		//return true;
	}
	//return false;
}
Esempio n. 2
0
bool SceneScriptUG10::ClickedOn2DRegion(int region) {
	float x, y, z;
	Actor_Query_XYZ(kActorMcCoy, &x, &y, &z);
	if (region == 0 && !Player_Query_Combat_Mode()) {
		if (x >= 120.0f) {
			Actor_Says(kActorMcCoy, 8525, 3);
		} else if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 4.98f, 0.38f, 83.15f, 0, 1, false, 0)) {
			if (Game_Flag_Query(474)) {
				Scene_Loop_Set_Default(1);
				Scene_Loop_Start_Special(kSceneLoopModeOnce, 0, false);
				Game_Flag_Reset(474);
				Obstacle_Object("BOX01 BRIDGE", true);
				Player_Loses_Control();
			} else {
				Scene_Loop_Set_Default(4);
				Scene_Loop_Start_Special(kSceneLoopModeOnce, 3, false);
				Game_Flag_Set(474);
				Unobstacle_Object("BOX01 BRIDGE", true);
				Player_Loses_Control();
			}
		}
		return true;
	}
	return false;
}
Esempio n. 3
0
void AIScriptLucy::voightKempTest() {
	Player_Loses_Control();
	Actor_Face_Actor(kActorMcCoy, kActorLucy, 1);
	Actor_Says(kActorMcCoy, 6815, 11);
	Actor_Face_Actor(kActorLucy, kActorMcCoy, 1);
	Actor_Says(kActorLucy, 1060, 16);
	Actor_Says(kActorLucy, 1070, 17);
	Delay(1000);
	Actor_Says(kActorLucy, 1080, 14);
	Actor_Says(kActorMcCoy, 6820, 16);
	Actor_Says(kActorLucy, 1090, 13);
	if (!Game_Flag_Query(378)) {
		Actor_Says(kActorMcCoy, 6825, 13);
	}
	Actor_Says(kActorMcCoy, 6830, 12);
	Actor_Says(kActorLucy, 1100, 14);
	Actor_Says(kActorMcCoy, 6835, 14);
	Actor_Says(kActorLucy, 1110, 15);
	Actor_Says(kActorMcCoy, 6840, 13);
	Delay(1000);
	Actor_Says(kActorMcCoy, 6845, 12);
	Delay(500);
	Actor_Says(kActorMcCoy, 6850, 12);
	Actor_Says(kActorLucy, 1120, 14);
	Actor_Says(kActorMcCoy, 6855, 13);
	Actor_Says(kActorMcCoy, 6860, 13);
	Actor_Says(kActorLucy, 1130, 14);
	Music_Stop(2);
	Player_Gains_Control();
	Voight_Kampff_Activate(6, 40);
	Player_Loses_Control();
	if (Actor_Clue_Query(kActorMcCoy, 271)) {
		Actor_Says(kActorMcCoy, 6865, 13);
		Actor_Says(kActorLucy, 1140, 14);
		Actor_Says(kActorMcCoy, 6865, 14);
		Actor_Says(kActorLucy, 1150, 16);
		Actor_Says(kActorMcCoy, 6870, 14);
		Delay(500);
		Actor_Says(kActorMcCoy, 6875, 13);
		Actor_Says(kActorLucy, 1160, 16);
	} else {
		Actor_Says(kActorMcCoy, 6880, 13);
		Actor_Says(kActorLucy, 1170, 13);
		Actor_Says(kActorLucy, 1180, 16);
		Actor_Says(kActorMcCoy, 6890, 15);
		Actor_Says(kActorLucy, 1190, 15);
		Actor_Says(kActorLucy, 1200, 17);
		Actor_Says(kActorMcCoy, 6885, 13);
		Actor_Says(kActorLucy, 1210, 17);
	}
	Actor_Says(kActorMcCoy, 6895, 15);
	Actor_Says(kActorMcCoy, 6900, 11);
	Actor_Says(kActorLucy, 1220, 16);
	Actor_Says(kActorMcCoy, 6905, 13);
	Actor_Says(kActorLucy, 1230, 17);
	Actor_Says(kActorMcCoy, 6910, 13);
	Delay(2000);
	Player_Gains_Control();
	Actor_Set_Goal_Number(kActorLucy, 312);
}
Esempio n. 4
0
void SceneScriptUG06::PlayerWalkedIn() {
	if (Game_Flag_Query(kFlagUG04toUG06)) {
		Loop_Actor_Walk_To_XYZ(kActorMcCoy, 23.0f, 0.0f, 273.0f, 0, false, false, 0);
		Game_Flag_Reset(kFlagUG04toUG06);
	}
	if (Game_Flag_Query(kFlagNR01toUG06)) {
		Loop_Actor_Travel_Stairs(kActorMcCoy, 17, false, kAnimationModeIdle);
		Loop_Actor_Walk_To_XYZ(kActorMcCoy, 66.0f, 0.0f, -36.91f, 0, false, false, 0);
		Game_Flag_Reset(kFlagNR01toUG06);
	}
	if ( Global_Variable_Query(kVariableChapter) == 4
	 && !Game_Flag_Query(524)
	) {
		Player_Loses_Control();
		Actor_Voice_Over(2620, kActorVoiceOver);
		Actor_Voice_Over(2630, kActorVoiceOver);
		Actor_Voice_Over(2640, kActorVoiceOver);
		Actor_Voice_Over(2650, kActorVoiceOver);
		Actor_Voice_Over(2660, kActorVoiceOver);
		Actor_Voice_Over(2670, kActorVoiceOver);
		Actor_Voice_Over(2680, kActorVoiceOver);
		Actor_Voice_Over(2690, kActorVoiceOver);
		Actor_Voice_Over(2700, kActorVoiceOver);
		Player_Gains_Control();
		Game_Flag_Set(524);
		Autosave_Game(2);
	}
	//return false;
}
Esempio n. 5
0
void AIScriptSadik::Retired(int byActorId) {
	if ((Actor_Query_Goal_Number(kActorSadik) == 418
	  || Actor_Query_Goal_Number(kActorSadik) == 450
	 )
	 && Actor_Query_Which_Set_In(kActorSadik) != kSetKP07
	) {
		Scene_Exits_Enable();
	}

	if (Actor_Query_In_Set(kActorSadik, kSetKP07)) {
		Global_Variable_Decrement(kVariableReplicantsSurvivorsAtMoonbus, 1); // can't Sadik still be human (Rep-sympathiser here? A bug?
		Actor_Set_Goal_Number(kActorSadik, kGoalSadikGone);

		if (Global_Variable_Query(kVariableReplicantsSurvivorsAtMoonbus) == 0) {
			Player_Loses_Control();
			Delay(2000);
			Player_Set_Combat_Mode(false);
			Loop_Actor_Walk_To_XYZ(kActorMcCoy, -12.0f, -41.58f, 72.0f, 0, true, false, false);
			Ambient_Sounds_Remove_All_Non_Looping_Sounds(true);
			Ambient_Sounds_Remove_All_Looping_Sounds(1);
			Game_Flag_Set(kFlagKP07toKP06);
			Game_Flag_Reset(kFlagMcCoyIsHelpingReplicants);
			Set_Enter(kSetKP05_KP06, kSceneKP06);
			return; //true;
		}
	}

	Actor_Set_Goal_Number(kActorSadik, kGoalSadikGone);

	return; //false;
}
Esempio n. 6
0
void ScriptBase::Delay(int miliseconds) {
	Player_Loses_Control();
	int endTime = _vm->getTotalPlayTime() + miliseconds;
	while ((int)_vm->getTotalPlayTime() < endTime)
		_vm->gameTick();
	Player_Gains_Control();
}
Esempio n. 7
0
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);
	}
}
Esempio n. 8
0
bool SceneScriptCT10::ClickedOn3DObject(const char *objectName, bool a2) {
	if (Object_Query_Click("TUB", objectName)) {
		if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -41.0f, 0.0f, -106.0f, 0, 1, false, 0)) {
			Player_Loses_Control();
			Actor_Face_Heading(kActorMcCoy, 850, false);
			Actor_Change_Animation_Mode(kActorMcCoy, 38);
			Delay(1000);
			Sound_Play(338, 33, 0, 0, 50);
			Delay(3000);
			if (Actor_Clue_Query(kActorMcCoy, kClueStrangeScale1)) {
				Actor_Voice_Over(3700, kActorVoiceOver);
			} else {
				Actor_Clue_Acquire(kActorMcCoy, kClueStrangeScale1, 1, -1);
				Item_Pickup_Spin_Effect(969, 364, 214);
			}
			Delay(1000);
			Loop_Actor_Walk_To_XYZ(kActorMcCoy, -41.0f, 0.0f, -82.0f, 0, 0, false, 1);
			Player_Gains_Control();
		}
		return true;
	}
	if (Object_Query_Click("CABINETTOP", objectName) || Object_Query_Click("CABINETFRONT", objectName)) {
		sub_401844();
		return true;
	}
	return false;
}
Esempio n. 9
0
void SceneScriptDR04::PlayerWalkedIn() {
	if (Game_Flag_Query(kFlagDR05ViewExplosion)) {
		Player_Loses_Control();
		Delay(4000);
		Actor_Retired_Here(kActorMcCoy, 6, 6, 1, -1);
	} else {
		if ( Game_Flag_Query(kFlagDR05BombActivated)
		 && !Game_Flag_Query(kFlagDR05BombExploded)
		) {
			Scene_Exits_Disable();
		}

		if (Game_Flag_Query(kFlagDR06toDR04)) {
			Footstep_Sound_Override_On(3);
			Actor_Set_Immunity_To_Obstacles(kActorMcCoy, true);
			Actor_Face_Heading(kActorMcCoy, 512, false);
			Loop_Actor_Travel_Stairs(kActorMcCoy, 7, false, kAnimationModeIdle);
			Loop_Actor_Walk_To_XYZ(kActorMcCoy, -851.0f, 71.64f, 647.0f, 0, false, false, 0);
			Actor_Face_Heading(kActorMcCoy, 0, false);
			Loop_Actor_Travel_Stairs(kActorMcCoy, 7, false, kAnimationModeIdle);
			Loop_Actor_Walk_To_XYZ(kActorMcCoy, -774.85f, 7.18f, 386.67f, 0, false, false, 0);
			Actor_Set_Immunity_To_Obstacles(kActorMcCoy, false);
			Footstep_Sound_Override_Off();
		}
	}
	Game_Flag_Reset(kFlagDR01toDR04);
	Game_Flag_Reset(kFlagDR05toDR04);
	Game_Flag_Reset(kFlagDR06toDR04);
}
Esempio n. 10
0
bool SceneScriptBB04::ClickedOnExit(int exitId) {
	if (exitId == 0) {
		if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -92.0f, -26.6f, 45.0f, 0,  true, false, false)) {
			Player_Loses_Control();
			Loop_Actor_Walk_To_XYZ(kActorMcCoy, -15.0f, -25.17f, 45.0f, 0, false, false, false);
			Ambient_Sounds_Remove_All_Non_Looping_Sounds(true);
			Ambient_Sounds_Remove_All_Looping_Sounds(1);
			Game_Flag_Set(kFlagBB04toBB02);
			Game_Flag_Set(kFlagBB02ElevatorDown);
			Set_Enter(kSetBB02_BB04_BB06_BB51, kSceneBB02);
		}
		return true;
	}

	if (exitId == 1) {
		if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -107.0f, -26.6f, 397.0f, 0, true, false, false)) {
			Ambient_Sounds_Remove_All_Non_Looping_Sounds(true);
			Ambient_Sounds_Remove_All_Looping_Sounds(1);
			Game_Flag_Set(kFlagBB04toBB03);
			Set_Enter(kSetBB03, kSceneBB03);
		}
		return true;
	}
	return false;
}
Esempio n. 11
0
void AIScriptSadik::Retired(int byActorId) {
	if ((Actor_Query_Goal_Number(kActorSadik) == 418
	  || Actor_Query_Goal_Number(kActorSadik) == 450
	 )
	 && Actor_Query_Which_Set_In(kActorSadik) != kSetKP07
	) {
		Scene_Exits_Enable();
	}

	if (Actor_Query_In_Set(kActorSadik, kSetKP07)) {
		Global_Variable_Decrement(kVariableReplicants, 1);
		Actor_Set_Goal_Number(kActorSadik, 599);

		if (Global_Variable_Query(kVariableReplicants) == 0) {
			Player_Loses_Control();
			Delay(2000);
			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(true);
			Ambient_Sounds_Remove_All_Looping_Sounds(1);
			Game_Flag_Set(579);
			Game_Flag_Reset(653);
			Set_Enter(kSetKP05_KP06, kSceneKP06);
			return; //true;
		}
	}

	Actor_Set_Goal_Number(kActorSadik, 599);

	return; //false;
}
Esempio n. 12
0
void SceneScriptCT05::PlayerWalkedIn() {
	if (Game_Flag_Query(kFlagCT04toCT05)) {
		Player_Loses_Control();
		Game_Flag_Reset(kFlagCT04toCT05);
		if (Player_Query_Combat_Mode()) {
			Loop_Actor_Walk_To_XYZ(kActorMcCoy, -308.18f, -109.91f, 674.77f, 0, false, true, false);
		} else {
			Loop_Actor_Walk_To_XYZ(kActorMcCoy, -308.18f, -109.91f, 674.77f, 0, false, false, false);
		}
		Player_Gains_Control();
	}

	if (Game_Flag_Query(kFlagCT06toCT05)) {
		Footstep_Sound_Override_On(2);
		Loop_Actor_Travel_Stairs(kActorMcCoy, 7, false, kAnimationModeIdle);
		Actor_Set_At_XYZ(kActorMcCoy, 90.73f, -19.91f, 164.97f, 520);
		Loop_Actor_Travel_Stairs(kActorMcCoy, 10, false, kAnimationModeIdle);
		Game_Flag_Reset(kFlagCT06toCT05);
		Footstep_Sound_Override_Off();
		if (Actor_Query_Goal_Number(kActorGordo) == kGoalGordoCT01Left
		 && Game_Flag_Query(kFlagCT06ZubenPhoto)
		) {
			Actor_Set_Goal_Number(kActorGordo, kGoalGordoCT05WalkThrough);
		}
	}
}
Esempio n. 13
0
void SceneScriptUG16::PlayerWalkedIn() {
	Game_Flag_Set(715);
	if (!Game_Flag_Query(595)) {
		Actor_Set_Goal_Number(kActorLuther, 403);
	}
	if (!Game_Flag_Query(556) && Actor_Query_Is_In_Current_Set(kActorLuther)) {
		Player_Loses_Control();
		Loop_Actor_Walk_To_XYZ(kActorMcCoy, 120.29f, -35.67f, 214.8f, 310, 0, false, 0);
		Actor_Face_Actor(kActorMcCoy, kActorLuther, true);
		Actor_Says(kActorLuther, 0, 6);
		Actor_Says(kActorLuther, 30, 13);
		Actor_Change_Animation_Mode(kActorLuther, 17);
		Actor_Says(kActorLance, 0, 17);
		Actor_Says(kActorMcCoy, 5710, 14);
		Actor_Says(kActorLuther, 40, 13);
		Actor_Says(kActorLuther, 50, 15);
		Actor_Says(kActorLance, 20, 12);
		Actor_Says(kActorLuther, 60, 23);
		Actor_Says(kActorMcCoy, 5715, 14);
		Actor_Says(kActorLance, 30, 16);
		Actor_Says(kActorLuther, 70, 6);
		Player_Gains_Control();
		Game_Flag_Set(556);
	}
}
Esempio n. 14
0
void SceneScriptRC01::walkToCenter() {
	Player_Loses_Control();
	Game_Flag_Set(kFlagMcCoyInRunciters);
	Actor_Set_Immunity_To_Obstacles(kActorMcCoy, true);
	Loop_Actor_Walk_To_XYZ(kActorMcCoy, -151.98f, -0.3f, 318.15f, 0, 0, false, 0);
	Actor_Set_Immunity_To_Obstacles(kActorMcCoy, false);
	Player_Gains_Control();
}
Esempio n. 15
0
bool SceneScriptCT04::ClickedOn3DObject(const char *objectName, bool a2) {
	if (objectName) {
		if (!Game_Flag_Query(137) && !Game_Flag_Query(169) && !Actor_Query_Goal_Number(kActorTransient)) {
			Game_Flag_Set(137);
			Actor_Set_Goal_Number(kActorTransient, 2);
		}
		if (Game_Flag_Query(169) && !Game_Flag_Query(170) && !Game_Flag_Query(171) && !Game_Flag_Query(172) && Global_Variable_Query(1) == 1) {
			if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -147.41f, -621.3f, 724.57f, 0, 1, false, 0)) {
				Player_Loses_Control();
				Actor_Face_Heading(kActorMcCoy, 792, false);
				Actor_Put_In_Set(kActorTransient, 99);
				Actor_Set_At_XYZ(kActorTransient, 0, 0, 0, 0);
				Actor_Change_Animation_Mode(kActorMcCoy, 40);
				Actor_Voice_Over(320, kActorVoiceOver);
				Actor_Voice_Over(330, kActorVoiceOver);
				Actor_Voice_Over(340, kActorVoiceOver);
				Game_Flag_Set(170);
				Game_Flag_Set(173);
			}
			return false;
		}
		if (Game_Flag_Query(170)) {
			if (Game_Flag_Query(172)) {
				Actor_Voice_Over(270, kActorVoiceOver);
				Actor_Voice_Over(280, kActorVoiceOver);
			} else if (Game_Flag_Query(171)) {
				Actor_Voice_Over(250, kActorVoiceOver);
				Actor_Voice_Over(260, kActorVoiceOver);
			} else {
				Actor_Voice_Over(230, kActorVoiceOver);
				Actor_Voice_Over(240, kActorVoiceOver);
				Game_Flag_Reset(173);
			}
			return true;
		}
		if (Game_Flag_Query(174)) {
			if (!Loop_Actor_Walk_To_Waypoint(kActorMcCoy, 75, 0, 1, false)) {
				Actor_Face_Heading(kActorMcCoy, 707, false);
				Actor_Change_Animation_Mode(kActorMcCoy, 38);
				Ambient_Sounds_Play_Sound(553, 45, 30, 30, 0);
				Actor_Voice_Over(1810, kActorVoiceOver);
				Actor_Voice_Over(1820, kActorVoiceOver);
				return true;
			}
			return false;
		}
		if (!Loop_Actor_Walk_To_Waypoint(kActorMcCoy, 75, 0, 1, false)) {
			Actor_Face_Heading(kActorMcCoy, 707, false);
			Actor_Change_Animation_Mode(kActorMcCoy, 38);
			Actor_Clue_Acquire(kActorMcCoy, kClueLicensePlate, 1, -1);
			Item_Pickup_Spin_Effect(952, 392, 225);
			Game_Flag_Set(174);
			return true;
		}
	}
	return false;
}
Esempio n. 16
0
void SceneScriptPS02::InitializeScene() {
	Player_Loses_Control();
	Setup_Scene_Information(-13.31f, -40.28f, -48.12f, 30);
	Scene_Exit_Add_2D_Exit(0, 0, 0, 240, 479, 3);
	Ambient_Sounds_Remove_All_Non_Looping_Sounds(0);
	Ambient_Sounds_Add_Looping_Sound(386, 20, 1, 1);
	Ambient_Sounds_Add_Looping_Sound(210, 20, 1, 1);
	Ambient_Sounds_Add_Sound(0, 3, 20, 12, 16, 0, 0, -101, -101, 0, 0);
	Scene_Loop_Start_Special(0, 0, 0);
	Scene_Loop_Set_Default(1);
}
Esempio n. 17
0
void SceneScriptDR04::SceneFrameAdvanced(int frame) {
	if (Game_Flag_Query(kFlagDR05ViewExplosion)) {
		Game_Flag_Reset(kFlagDR05ViewExplosion);
		Game_Flag_Reset(kFlagDR05BombWillExplode);
		Scene_Loop_Set_Default(kDR04LoopMainPostExplosion);
		Scene_Loop_Start_Special(kSceneLoopModeOnce, kDR04LoopDR04Explosion, true);
		Music_Stop(4);
		Actor_Set_Goal_Number(kActorMoraji, kGoalMorajiPerished);
	} else {
		if (Game_Flag_Query(kFlagDR05BombWillExplode)) {
			Game_Flag_Reset(kFlagDR05BombWillExplode);
			Game_Flag_Set(kFlagDR05BombExploded);
			Scene_Loop_Set_Default(kDR04LoopMainPostExplosion);
			Scene_Loop_Start_Special(kSceneLoopModeOnce, kDR04LoopDR04Explosion, true);
			Item_Remove_From_World(kItemBomb);
		}

		switch (frame) {
		case 193:
			Sound_Play(301, 100, 0, 100, 50);
			Actor_Set_Goal_Number(kActorMoraji, kGoalMorajiChooseFate);
			Player_Loses_Control();
			Actor_Force_Stop_Walking(kActorMcCoy);
			if (farEnoughFromExplosion()) {
				if (Player_Query_Combat_Mode()) {
					Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeCombatHit);
				} else {
					Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeHit);
				}
			} else {
				Sound_Play_Speech_Line(kActorMcCoy, 9905, 100, 0, 99);
				Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeDie);
				Actor_Retired_Here(kActorMcCoy, 6, 6, true, -1);
			}
			Player_Gains_Control();
			break;

		case 235:
			if (Actor_Query_Goal_Number(kActorMoraji) != kGoalMorajiJump
			 && Actor_Query_Goal_Number(kActorMoraji) != kGoalMorajiLayDown
			 && Actor_Query_Goal_Number(kActorMoraji) != kGoalMorajiPerished
			) {
				Actor_Set_Goal_Number(kActorOfficerGrayford, 101);
			}
			Scene_Exits_Enable();
			break;

		case 237:
			Overlay_Play("DR04OVER", 0, true, true, 0);
			break;
		}
	}
}
Esempio n. 18
0
void ScriptDR01::PlayerWalkedIn() {
	if (Game_Flag_Query(531)) {
		Async_Actor_Walk_To_XYZ(0, -757.15f, -0.04f, 24.64f, 0, false);
	} else if (!Game_Flag_Query(225) && !Game_Flag_Query(11)) {
		Player_Loses_Control();
		Loop_Actor_Walk_To_XYZ(0, -447.39f, 0.16f, -92.38f, 0, 0, false, 0);
		Player_Gains_Control();
	}
	Game_Flag_Reset(225);
	Game_Flag_Reset(11);
	Game_Flag_Reset(531);
}
Esempio n. 19
0
void ScriptBase::Actor_Says_With_Pause(int actorId, int sentenceId, float pause, int animationMode) {
	_vm->gameWaitForActive();
	_vm->loopActorSpeaking();
	_vm->_actorDialogueQueue->flush(1, true);

	Actor *actor = _vm->_actors[actorId];

	if (animationMode != -1) {
		actor->stopWalking(false);
	}

	actor->speechPlay(sentenceId, false);
	bool animationModeChanged = false;
	if (animationMode >= 0) {
		if (actorId != kActorMcCoy) {
			actor->changeAnimationMode(animationMode, false);
			animationModeChanged = true;
		} else if (!_vm->_combat->isActive()) {
			actor->changeAnimationMode(animationMode, false);
			animationModeChanged = true;
		}
	}
	Player_Loses_Control();
	while (_vm->_gameIsRunning) {
		_vm->_speechSkipped = false;
		_vm->gameTick();
		if (_vm->_speechSkipped || !actor->isSpeeching()) {
			actor->speechStop();
			break;
		}
	}
	if (animationModeChanged) {
		actor->changeAnimationMode(kAnimationModeIdle, false);
	}

	//TODO: sitcom
	//if (_vm->isSitcom)
	//{
	//	int rnd = _vm->random(1, 100);
	//	if (rnd <= actor::get_unknown3(actor))
	//	{
	//		int soundId = _vm->random(319, 327);
	//		_vm->_audioPlayer->play(soundId, 40, 0, 0, 50);
	//	}
	//}
	if(pause > 0.0f && !_vm->_speechSkipped) {
		Delay(pause * 1000);
	}
	Player_Gains_Control();
}
Esempio n. 20
0
bool SceneScriptCT08::ClickedOn2DRegion(int region) {
	if (region == 0) {
		if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -108.0f, 0.0f, -178.0f, 0, true, false, 0)) {
			Actor_Face_Heading(kActorMcCoy, 512, false);
			Game_Flag_Reset(kFlagMcCoyTiedDown);
			Player_Set_Combat_Mode_Access(true);
			Scene_Exits_Enable();
			Ambient_Sounds_Play_Sound(564, 40, 99, 0, 0);
			Scene_2D_Region_Remove(0);
			Player_Loses_Control();
		}
		return true;
	}
	return false;
}
Esempio n. 21
0
void SceneScriptCT10::sub_401844() {
	if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, 10.6f, 0.0f, -50.5f, 0, 1, false, 0)) {
		Player_Loses_Control();
		Actor_Face_Heading(kActorMcCoy, 0, false);
		Sound_Play(339, 100, 0, 0, 50);
		Delay(1000);
		if (Actor_Clue_Query(kActorMcCoy, kClueHoldensBadge)) {
			Actor_Voice_Over(3700, kActorVoiceOver);
		} else {
			Item_Pickup_Spin_Effect(931, 435, 258);
			Actor_Clue_Acquire(kActorMcCoy, kClueHoldensBadge, 1, -1);
		}
		Player_Gains_Control();
	}
}
Esempio n. 22
0
void SceneScriptCT11::PlayerWalkedIn() {
	if (Game_Flag_Query(91)) {
		Loop_Actor_Walk_To_XYZ(kActorMcCoy, -358.0f, 9.68f, 32.0f, 0, 0, false, 0);
		Game_Flag_Reset(91);
	} else if (Game_Flag_Query(558)) {
		Loop_Actor_Walk_To_XYZ(kActorMcCoy, 329.0f, 0.0f, 617.0f, 0, 0, false, 0);
		Game_Flag_Reset(558);
	} else {
		Player_Loses_Control();
		Actor_Set_Immunity_To_Obstacles(kActorMcCoy, true);
		Loop_Actor_Walk_To_XYZ(kActorMcCoy, 125.0f, 9.68f, 74.0f, 0, 0, false, 0);
		Actor_Set_Immunity_To_Obstacles(kActorMcCoy, false);
		Player_Gains_Control();
		Game_Flag_Reset(83);
	}
}
Esempio n. 23
0
void ScriptNR07::sub_4018D4() {
	Actor_Set_Goal_Number(25, 201);
	Player_Loses_Control();
	Actor_Set_At_XYZ(3, -136.0f, -73.0f, -18.0f, 300);
	Actor_Change_Animation_Mode(3, 71);
	Actor_Change_Animation_Mode(0, 21);
	Loop_Actor_Walk_To_XYZ(3, -102.0f, -73.5f, -233.0f, 0, 0, true, 0);
	if (Game_Flag_Query(47)) {
		Actor_Set_Goal_Number(3, 245);
	} else {
		Actor_Set_Goal_Number(3, 295);
		Game_Flag_Set(591);
		Actor_Put_In_Set(3, 91);
		Actor_Set_At_Waypoint(3, 33, 0);
	}
	Player_Gains_Control();
}
Esempio n. 24
0
void SceneScriptMA06::activateElevator() {
	Game_Flag_Reset(kFlagMA06toMA01);
	Game_Flag_Reset(kFlagMA06ToMA02);
	Game_Flag_Reset(kFlagMA06toMA07);
	while (true) {
		if (Game_Flag_Query(kFlagMA06ToMA02)) {
			break;
		}
		if (Game_Flag_Query(kFlagMA06toMA01)) {
			break;
		}
		if (Game_Flag_Query(kFlagMA06toMA07)) {
			break;
		}
		Actor_Says(kActorAnsweringMachine, 80, 3);
		Player_Gains_Control();
		int floor = Elevator_Activate(1);
		Player_Loses_Control();
		Scene_Loop_Start_Special(kSceneLoopMode2, 1, true);
		if (floor > 1) {
			Game_Flag_Set(kFlagMA06toMA07);
		} else if (floor == 1) {
			if (Game_Flag_Query(kFlagMA01Locked)) {
				Game_Flag_Set(kFlagMA06toMA01);
			} else {
				Sound_Play(412, 100, 0, 0, 50);
				Delay(500);
				Actor_Says(kActorAnsweringMachine, 610, 3);
			}
		} else {
			Actor_Says(kActorMcCoy, 2940, 18);
			if (Global_Variable_Query(1) == 4 && Game_Flag_Query(655)) {
				Sound_Play(412, 100, 0, 0, 50);
				Delay(500);
				Actor_Says(kActorAnsweringMachine, 610, 3);
				Delay(500);
				Actor_Says(kActorMcCoy, 8527, 3);
			} else {
				Game_Flag_Set(kFlagMA06ToMA02);
				Actor_Says(kActorAnsweringMachine, 90, 3);
			}
		}
	}
}
Esempio n. 25
0
void ScriptBase::Loop_Actor_Travel_Ladder(int actorId, int stepCount, bool up, int animationModeEnd) {
	_vm->gameWaitForActive();

	Player_Loses_Control();

	Actor *actor = _vm->_actors[actorId];

	int animationModeWalk = 0;
	if (actor->inCombat()) {
		animationModeWalk = up ? kAnimationModeCombatClimbUp : kAnimationModeCombatClimbDown;
		if (animationModeEnd == kAnimationModeIdle) {
			animationModeEnd = kAnimationModeCombatIdle;
		}
	} else {
		animationModeWalk = up ? kAnimationModeClimbUp : kAnimationModeClimbDown;
	}
	actor->changeAnimationMode(animationModeWalk, false);

	int ladderHeight = stepCount * 12 * (up ? 1 : -1);
	float targetY = actor->getY() + ladderHeight;

	bool immunityToObstacles = actor->isImmuneToObstacles();
	actor->setImmunityToObstacles(true);
	do {
		_vm->gameTick();
		if (up) {
			if (targetY <= actor->getY()) {
				break;
			}
		} else {
			if (targetY >= actor->getY()) {
				break;
			}
		}
	} while (true);
	actor->setImmunityToObstacles(immunityToObstacles);

	actor->setAtXYZ(Vector3(actor->getX(), targetY, actor->getZ()), actor->getFacing(), true, false, false);
	actor->changeAnimationMode(animationModeEnd, false);

	Player_Gains_Control();
}
Esempio n. 26
0
bool ScriptNR04::ClickedOn3DObject(const char *objectName, bool a2) {
	if (Object_Query_Click("B.TV01", objectName) || Object_Query_Click("B.TV02", objectName) || Object_Query_Click("B.TV03", objectName) || Object_Query_Click("B.TV05", objectName) || Object_Query_Click("DESK", objectName)) {
		if (!Loop_Actor_Walk_To_Waypoint(0, 546, 0, 1, false)) {
			if (!Object_Query_Click("DESK", objectName)) {
				Actor_Face_Object(0, "B.TV01", true);
				Actor_Voice_Over(1530, 99);
				Actor_Voice_Over(1540, 99);
				Actor_Voice_Over(1550, 99);
			} else {
				Actor_Face_Object(0, "DESK", true);
				if (!Actor_Clue_Query(0, 56)) {
					Actor_Voice_Over(1600, 99);
					Actor_Voice_Over(1610, 99);
				} else if (Actor_Clue_Query(0, 100)) {
					Actor_Says(0, 8580, 3);
				} else {
					Actor_Clue_Acquire(0, 100, 0, -1);
					Item_Pickup_Spin_Effect(961, 247, 141);
					Actor_Voice_Over(1560, 99);
					Actor_Voice_Over(1570, 99);
					Actor_Voice_Over(1580, 99);
					Actor_Voice_Over(1590, 99);
				}

			}
		}
	} else if (Object_Query_Click("TORUS01", objectName)
		&& !Loop_Actor_Walk_To_XYZ(0, 18.56f, 0.0f, 38.86f, 0, 1, false, 0)
		&& !Game_Flag_Query(605)) {
		Unclickable_Object("TORUS01");
		Scene_Exits_Disable();
		Player_Loses_Control();
		Game_Flag_Set(605);
		Actor_Face_Object(0, "TORUS01", true);
		Item_Pickup_Spin_Effect(975, 358, 160);
		Actor_Voice_Over(1620, 99);
		Actor_Voice_Over(1630, 99);
		Actor_Clue_Acquire(0, 89, 0, -1);
		Actor_Set_Goal_Number(18, 201);
	}
	return false;
}
Esempio n. 27
0
bool SceneScriptNR04::ClickedOn3DObject(const char *objectName, bool a2) {
	if (Object_Query_Click("B.TV01", objectName) || Object_Query_Click("B.TV02", objectName) || Object_Query_Click("B.TV03", objectName) || Object_Query_Click("B.TV05", objectName) || Object_Query_Click("DESK", objectName)) {
		if (!Loop_Actor_Walk_To_Waypoint(kActorMcCoy, 546, 0, 1, false)) {
			if (!Object_Query_Click("DESK", objectName)) {
				Actor_Face_Object(kActorMcCoy, "B.TV01", true);
				Actor_Voice_Over(1530, kActorVoiceOver);
				Actor_Voice_Over(1540, kActorVoiceOver);
				Actor_Voice_Over(1550, kActorVoiceOver);
			} else {
				Actor_Face_Object(kActorMcCoy, "DESK", true);
				if (!Actor_Clue_Query(kActorMcCoy, kCluePeruvianLadyInterview)) {
					Actor_Voice_Over(1600, kActorVoiceOver);
					Actor_Voice_Over(1610, kActorVoiceOver);
				} else if (Actor_Clue_Query(kActorMcCoy, kClueCollectionReceipt)) {
					Actor_Says(kActorMcCoy, 8580, 3);
				} else {
					Actor_Clue_Acquire(kActorMcCoy, kClueCollectionReceipt, 0, -1);
					Item_Pickup_Spin_Effect(961, 247, 141);
					Actor_Voice_Over(1560, kActorVoiceOver);
					Actor_Voice_Over(1570, kActorVoiceOver);
					Actor_Voice_Over(1580, kActorVoiceOver);
					Actor_Voice_Over(1590, kActorVoiceOver);
				}

			}
		}
	} else if (Object_Query_Click("TORUS01", objectName)
		&& !Loop_Actor_Walk_To_XYZ(kActorMcCoy, 18.56f, 0.0f, 38.86f, 0, 1, false, 0)
		&& !Game_Flag_Query(605)) {
		Unclickable_Object("TORUS01");
		Scene_Exits_Disable();
		Player_Loses_Control();
		Game_Flag_Set(605);
		Actor_Face_Object(kActorMcCoy, "TORUS01", true);
		Item_Pickup_Spin_Effect(975, 358, 160);
		Actor_Voice_Over(1620, kActorVoiceOver);
		Actor_Voice_Over(1630, kActorVoiceOver);
		Actor_Clue_Acquire(kActorMcCoy, kClueEarlyQsClub, 0, -1);
		Actor_Set_Goal_Number(kActorEarlyQ, 201);
	}
	return false;
}
Esempio n. 28
0
void AIScriptClovis::Retired(int byActorId) {
	if (Game_Flag_Query(653)) {
		if (Actor_Query_In_Set(kActorClovis, kSetKP07)) {
			Global_Variable_Decrement(kVariableReplicants, 1);
			Actor_Set_Goal_Number(kActorClovis, 599);

			if (Global_Variable_Query(kVariableReplicants) == 0) {
				Player_Loses_Control();
				Delay(2000);
				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(true);
				Ambient_Sounds_Remove_All_Looping_Sounds(1);
				Game_Flag_Set(579);
				Game_Flag_Reset(653);
				Set_Enter(kSetKP05_KP06, kSceneKP06);
			}
		}
	}
}
Esempio n. 29
0
void ScriptBase::Actor_Voice_Over(int sentenceId, int actorId) {
	assert(actorId < BladeRunnerEngine::kActorCount);

	_vm->gameWaitForActive();
	_vm->loopActorSpeaking();
	_vm->_actorDialogueQueue->flush(1, true);

	Actor *actor = _vm->_actors[actorId];

	actor->speechPlay(sentenceId, true);
	Player_Loses_Control();
	while(_vm->_gameIsRunning) {
		_vm->_speechSkipped = false;
		_vm->gameTick();
		if(_vm->_speechSkipped || !actor->isSpeeching()) {
			actor->speechStop();
			break;
		}
	}
	Player_Gains_Control();
}
Esempio n. 30
0
bool SceneScriptNR04::ClickedOn2DRegion(int region) {
	if ((region == 0 || region == 1 || region == 2) && Actor_Query_Which_Set_In(kActorEarlyQ) != 12 && Actor_Query_Animation_Mode(kActorMcCoy) != 53 && !Loop_Actor_Walk_To_Waypoint(kActorMcCoy, 445, 0, 1, false)) {
		Actor_Face_Heading(kActorMcCoy, 49, false);
		Actor_Change_Animation_Mode(kActorMcCoy, 85);
		Delay(2500);
		if (Game_Flag_Query(606) == 1) {
			return true;
		}
		if (Game_Flag_Query(374)) {
			Player_Loses_Control();
			Actor_Voice_Over(4180, kActorVoiceOver);
			Actor_Change_Animation_Mode(kActorMcCoy, 48);
			Ambient_Sounds_Play_Sound(555, 90, 99, 0, 0);
			Delay(350);
			Actor_Set_At_XYZ(kActorMcCoy, 109.0f, 0.0f, 374.0f, 0);
			Actor_Retired_Here(kActorMcCoy, 12, 12, 1, -1);
		}
		return true;
	}
	return false;
}