Exemplo n.º 1
0
bool AIScriptCrazylegs::GoalChanged(int currentGoalNumber, int newGoalNumber) {
	if (newGoalNumber > 2)
		return false;

	if (newGoalNumber) {
		if (newGoalNumber != 1) {
			AI_Movement_Track_Flush(kActorCrazylegs);
			AI_Movement_Track_Append(kActorCrazylegs, 360, 0);
			AI_Movement_Track_Append(kActorCrazylegs, 40, 0);
			AI_Movement_Track_Repeat(kActorCrazylegs);
			return true;
		}
		AI_Movement_Track_Flush(kActorCrazylegs);
		Actor_Set_Targetable(kActorCrazylegs, 0);
	}

	return true;
}
Exemplo n.º 2
0
bool AIScriptFreeSlotB::GoalChanged(int currentGoalNumber, int newGoalNumber) {
	switch (newGoalNumber) {
	case 300:
		AI_Movement_Track_Flush(kActorFreeSlotB);
		AI_Movement_Track_Append(kActorFreeSlotB, 39, 2);
		AI_Movement_Track_Repeat(kActorFreeSlotB);
		break;

	case 301:
		AI_Movement_Track_Flush(kActorFreeSlotB);
		processGoal301();
		AI_Movement_Track_Repeat(kActorFreeSlotB);
		break;

	case 302:
		Actor_Set_Targetable(kActorFreeSlotB, 1);
		Non_Player_Actor_Combat_Mode_On(kActorFreeSlotB, 0, 0, 0, 8, 4, 7, 8, 25, 0, 75, 5, 300, 0);
		break;

	case 400:
		AI_Movement_Track_Append(kActorFreeSlotB, 39, 0);
		AI_Movement_Track_Repeat(kActorFreeSlotB);
		break;

	case 406:
		AI_Movement_Track_Flush(kActorFreeSlotB);
		AI_Movement_Track_Append(kActorFreeSlotB, 527, 0);
		AI_Movement_Track_Repeat(kActorFreeSlotB);
		break;

	case 599:
		Actor_Set_Health(kActorFreeSlotB, 20, 20);
		break;

	default:
		return false;
	}

	return true;
}
Exemplo n.º 3
0
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;
}
Exemplo n.º 4
0
bool AIScriptBryant::GoalChanged(int currentGoalNumber, int newGoalNumber) {
	switch (newGoalNumber) {
	case 101:
		AI_Movement_Track_Flush(kActorBryant);

		switch (Random_Query(0, 9)) {
		case 0:
			AI_Movement_Track_Append(kActorBryant, 134, 0);
			AI_Movement_Track_Append(kActorBryant, 135, 0);
			AI_Movement_Track_Append(kActorBryant, 136, 0);
			AI_Movement_Track_Append(kActorBryant, 137, 0);
			AI_Movement_Track_Append(kActorBryant, 138, 0);
			AI_Movement_Track_Append(kActorBryant, 139, 0);
			AI_Movement_Track_Repeat(kActorBryant);
			break;
		case 1:
			AI_Movement_Track_Append(kActorBryant, 139, 0);
			AI_Movement_Track_Append(kActorBryant, 138, 0);
			AI_Movement_Track_Append(kActorBryant, 137, 0);
			AI_Movement_Track_Append(kActorBryant, 136, 0);
			AI_Movement_Track_Append(kActorBryant, 135, 0);
			AI_Movement_Track_Append(kActorBryant, 134, 0);
			AI_Movement_Track_Repeat(kActorBryant);
			break;
		case 2:
			AI_Movement_Track_Append(kActorBryant, 196, 0);
			AI_Movement_Track_Append(kActorBryant, 197, 0);
			AI_Movement_Track_Append(kActorBryant, 198, 0);
			AI_Movement_Track_Repeat(kActorBryant);
			break;
		case 3:
			AI_Movement_Track_Append(kActorBryant, 198, 0);
			AI_Movement_Track_Append(kActorBryant, 197, 0);
			AI_Movement_Track_Append(kActorBryant, 196, 0);
			AI_Movement_Track_Repeat(kActorBryant);
			break;
		case 4:
			AI_Movement_Track_Append(kActorBryant, 326, 0);
			AI_Movement_Track_Append(kActorBryant, 332, 0);
			AI_Movement_Track_Append(kActorBryant, 327, 0);
			AI_Movement_Track_Repeat(kActorBryant);
			break;
		case 5:
			AI_Movement_Track_Append(kActorBryant, 327, 0);
			AI_Movement_Track_Append(kActorBryant, 332, 0);
			AI_Movement_Track_Append(kActorBryant, 326, 0);
			AI_Movement_Track_Repeat(kActorBryant);
			break;
		case 6:
			AI_Movement_Track_Append(kActorBryant, 329, 0);
			AI_Movement_Track_Append(kActorBryant, 328, 0);
			AI_Movement_Track_Append(kActorBryant, 330, 0);
			AI_Movement_Track_Repeat(kActorBryant);
			break;
		case 7:
			AI_Movement_Track_Append(kActorBryant, 330, 0);
			AI_Movement_Track_Append(kActorBryant, 328, 0);
			AI_Movement_Track_Append(kActorBryant, 329, 0);
			AI_Movement_Track_Repeat(kActorBryant);
			break;
		case 8:
			AI_Movement_Track_Append(kActorBryant, 331, 0);
			AI_Movement_Track_Append(kActorBryant, 333, 0);
			AI_Movement_Track_Append(kActorBryant, 335, 0);
			AI_Movement_Track_Repeat(kActorBryant);
			break;
		case 9:
			AI_Movement_Track_Append(kActorBryant, 335, 0);
			AI_Movement_Track_Append(kActorBryant, 333, 0);
			AI_Movement_Track_Append(kActorBryant, 331, 0);
			AI_Movement_Track_Repeat(kActorBryant);
			break;
		}
		// fallthrough
	case 102:
		AI_Movement_Track_Append(kActorBryant, 39, 0);
		AI_Movement_Track_Repeat(kActorBryant);
		break;
	}

	return false;
}
Exemplo n.º 5
0
bool AIScriptGenericWalkerC::preparePath() {
	AI_Movement_Track_Flush(kActorGenwalkerC);
	int set = Player_Query_Current_Set();

	if (set == kSetAR01_AR02) {
		isInside = false;
		int waypointStart = Random_Query(155, 158);
		int waypointEnd = 0;
		AI_Movement_Track_Append(kActorGenwalkerC, waypointStart, 0);
		do {
			waypointEnd = Random_Query(155, 158);
		} while (waypointEnd == waypointStart);
		if ((waypointStart == 155 || waypointStart == 156) && (waypointEnd == 157 || waypointEnd == 158)) {
			AI_Movement_Track_Append(kActorGenwalkerC, 159, 0);
			AI_Movement_Track_Append(kActorGenwalkerC, 160, 0);
			if (Random_Query(0, 3) == 0) {
				AI_Movement_Track_Append_With_Facing(kActorGenwalkerC, 161, Random_Query(15, 30), 904);
			}
		} else if ((waypointEnd == 155 || waypointEnd == 156) && (waypointStart == 157 || waypointStart == 158)) {
			if (Random_Query(0, 3) == 0) {
				AI_Movement_Track_Append_With_Facing(kActorGenwalkerC, 161, Random_Query(15, 30), 904);
			}
			AI_Movement_Track_Append(kActorGenwalkerC, 160, 0);
			AI_Movement_Track_Append(kActorGenwalkerC, 159, 0);
		} else if ((waypointStart == 155 && waypointEnd == 156) || (waypointStart == 156 && waypointEnd == 155)) {
			AI_Movement_Track_Append(kActorGenwalkerC, 159, 0);
		}
		AI_Movement_Track_Append(kActorGenwalkerC, waypointEnd, 0);
		AI_Movement_Track_Repeat(kActorGenwalkerC);
		return true;
	}

	if (set == kSetCT01_CT12) {
		isInside = false;
		if (Random_Query(0, 1)) {
			AI_Movement_Track_Append(kActorGenwalkerC, 54, 1);
			if (Random_Query(1, 3) == 1) {
				AI_Movement_Track_Append(kActorGenwalkerC, 56, 0);
				AI_Movement_Track_Append(kActorGenwalkerC, 43, 1);
			} else {
				AI_Movement_Track_Append(kActorGenwalkerC, 53, 1);
			}
			AI_Movement_Track_Append(kActorGenwalkerC, 40, 1);
			AI_Movement_Track_Repeat(kActorGenwalkerC);
		} else {
			AI_Movement_Track_Append(kActorGenwalkerC, 53, 1);
			if (Random_Query(1, 3) == 1) {
				AI_Movement_Track_Append(kActorGenwalkerC, 43, 1);
			} else {
				AI_Movement_Track_Append(kActorGenwalkerC, 54, 1);
			}
			AI_Movement_Track_Append(kActorGenwalkerC, 40, 1);
			AI_Movement_Track_Repeat(kActorGenwalkerC);
		}
		return true;
	}

	if (set == kSetHC01_HC02_HC03_HC04) {
		isInside = true;
		if (Random_Query(0, 1)) {
			AI_Movement_Track_Append(kActorGenwalkerC, 164, 0);
			if (Random_Query(0, 1)) {
				AI_Movement_Track_Append(kActorGenwalkerC, 163, 0);
				AI_Movement_Track_Append(kActorGenwalkerC, 162, 0);
			} else if (Random_Query(0, 1)) {
				AI_Movement_Track_Append(kActorGenwalkerC, 163, 0);
				AI_Movement_Track_Append(kActorGenwalkerC, 162, 0);
			} else {
				AI_Movement_Track_Append(kActorGenwalkerC, 163, 0);
				AI_Movement_Track_Append(kActorGenwalkerC, 162, 0);
			}
		} else {
			AI_Movement_Track_Append(kActorGenwalkerC, 162, 0);
			if (Random_Query(0, 1)) {
				AI_Movement_Track_Append(kActorGenwalkerC, 163, 0);
				AI_Movement_Track_Append(kActorGenwalkerC, 164, 0);
			} else {
				if (Random_Query(0, 1)) {
					AI_Movement_Track_Append_With_Facing(kActorGenwalkerC, 166, 0, 30);
				}
				AI_Movement_Track_Append(kActorGenwalkerC, 163, 0);
				AI_Movement_Track_Append(kActorGenwalkerC, 164, 0);
			}
		}
		AI_Movement_Track_Repeat(kActorGenwalkerC);
		return true;
	}

	if (set == kSetRC03) {
		isInside = false;
		int waypointStart = 0;
		int waypointEnd = 0;
		do {
			waypointStart = Random_Query(167, 171);
		} while (waypointStart == 168 || waypointStart == 169);
		do {
			waypointEnd = Random_Query(167, 171);
		} while (waypointEnd == waypointStart || waypointEnd == 168 || waypointEnd == 169);
		AI_Movement_Track_Append(kActorGenwalkerC, waypointStart, 0);
		if (waypointStart == 170) {
			AI_Movement_Track_Append(kActorGenwalkerC, 169, 0);
			AI_Movement_Track_Append(kActorGenwalkerC, 168, 0);
		} else if (waypointEnd == 170) {
			AI_Movement_Track_Append(kActorGenwalkerC, 168, 0);
			AI_Movement_Track_Append(kActorGenwalkerC, 169, 0);
		}
		AI_Movement_Track_Append(kActorGenwalkerC, waypointEnd, 0);
		AI_Movement_Track_Repeat(kActorGenwalkerC);
		return true;
	}

	return false;
}
Exemplo n.º 6
0
bool AIScriptGaff::GoalChanged(int currentGoalNumber, int newGoalNumber) {
	switch (newGoalNumber) {
	case kGoalGaffCT12WaitForMcCoy:
		Actor_Put_In_Set(kActorGaff, kSetCT01_CT12);
		Actor_Set_At_Waypoint(kActorGaff, 43, 0);
		return true;

	case kGoalGaffCT12GoToSpinner:
		AI_Movement_Track_Append(kActorGaff, 123, 1);
		AI_Movement_Track_Repeat(kActorGaff);
		return true;

	case kGoalGaffMA01ApproachMcCoy:
		Player_Loses_Control();
		AI_Movement_Track_Flush(kActorGaff);
		AI_Movement_Track_Append(kActorGaff, 124, 0);
		AI_Movement_Track_Append(kActorGaff, 126, 0);
		AI_Movement_Track_Repeat(kActorGaff);
		return true;

	case kGoalGaffMA01Leave:
		AI_Movement_Track_Flush(kActorGaff);
		AI_Movement_Track_Append(kActorGaff, 124, 0);
		AI_Movement_Track_Append(kActorGaff, 35, 0);
		AI_Movement_Track_Repeat(kActorGaff);
		return true;

	case kGoalGaffCT12Leave:
		AI_Movement_Track_Flush(kActorGaff);
		AI_Movement_Track_Append(kActorGaff, 35, 90);
		AI_Movement_Track_Repeat(kActorGaff);
		return true;

	case kGoalGaffCT12FlyAway:
		Game_Flag_Reset(kFlagCT12GaffSpinner);
		Scene_Loop_Set_Default(2);
		Scene_Loop_Start_Special(kSceneLoopModeOnce, 6, true);
		return true;

	case kGoalGaffStartWalkingAround:
		AI_Movement_Track_Flush(kActorGaff);
		AI_Movement_Track_Append(kActorGaff, 35, 300);
		AI_Movement_Track_Repeat(kActorGaff);
		return true;

	case kGoalGaffWalkAround:
		{
			AI_Movement_Track_Flush(kActorGaff);
			AI_Movement_Track_Append(kActorGaff, 82, 1);
			AI_Movement_Track_Append(kActorGaff, 76, 1);
			AI_Movement_Track_Append(kActorGaff, 78, 1);
			int rnd = Random_Query(1, 3);
			if (rnd == 1) {
				AI_Movement_Track_Append(kActorGaff, 271, 0);
				AI_Movement_Track_Append(kActorGaff, 272, 0);
				AI_Movement_Track_Append(kActorGaff, 273, 0);
			} else if (rnd == 2) {
				AI_Movement_Track_Append(kActorGaff, 273, 0);
				AI_Movement_Track_Append(kActorGaff, 272, 0);
				AI_Movement_Track_Append(kActorGaff, 271, 0);
			} else if (rnd == 3) {
				AI_Movement_Track_Append(kActorGaff, 272, 0);
				AI_Movement_Track_Append(kActorGaff, 273, 0);
			}
			AI_Movement_Track_Append(kActorGaff, 274, 0);
			AI_Movement_Track_Append(kActorGaff, 275, 0);
			AI_Movement_Track_Repeat(kActorGaff);
		}
		return true;

	case kGoalGaffRepeatWalkingAround:
		AI_Movement_Track_Flush(kActorGaff);
		AI_Movement_Track_Append(kActorGaff, 35, 90);
		AI_Movement_Track_Repeat(kActorGaff);
		return true;

	case 299:
		AI_Movement_Track_Flush(kActorGaff);
		Actor_Put_In_Set(kActorGaff, kSetFreeSlotC);
		Actor_Set_At_Waypoint(kActorGaff, 35, 0);
		return true;

	case kGoalGaffMA07Wait:
		Player_Loses_Control();
		Actor_Put_In_Set(kActorGaff, kSetMA07);
		Actor_Set_At_XYZ(kActorGaff, -102.54f, -172.43f, 463.18f, 1015);
		Actor_Set_Goal_Number(kActorGaff, kGoalGaffMA07TalkToMcCoy);
		return true;

	case kGoalGaffMA07TalkToMcCoy:
		Game_Flag_Set(kFlagMA07GaffTalk);
		Actor_Face_Actor(kActorGaff, kActorMcCoy, true);
		Actor_Says(kActorGaff, 110, 12);
		Actor_Face_Actor(kActorMcCoy, kActorGaff, true);
		Actor_Says(kActorMcCoy, 2945, 14);
		Loop_Actor_Walk_To_Actor(kActorGaff, kActorMcCoy, 180, false, false);
		Actor_Says(kActorGaff, 120, 16);
		Actor_Says(kActorGaff, 130, 13);
		Actor_Says(kActorMcCoy, 2950, kAnimationModeTalk);
		Actor_Says(kActorMcCoy, 2955, 16);
		Actor_Says_With_Pause(kActorGaff, 140, 1.0f, 14);
		Loop_Actor_Walk_To_Actor(kActorMcCoy, kActorGaff, 36, false, false);
		Actor_Says(kActorGaff, 150, kAnimationModeTalk);
		Actor_Says(kActorMcCoy, 2960, 12);
		Actor_Says_With_Pause(kActorGaff, 160, 1.0f, 16);
		Actor_Says(kActorMcCoy, 2965, 13);
		Actor_Says_With_Pause(kActorGaff, 170, 1.0f, kAnimationModeTalk);
		Actor_Says_With_Pause(kActorGaff, 180, 1.0f, 12);
		Actor_Says(kActorGaff, 190, 14);
		Actor_Says(kActorGaff, 200, 15);
		Async_Actor_Walk_To_XYZ(kActorGaff, -388.44f, -162.8f, 165.08f, false, false);
		Delay(4000);
		Player_Gains_Control();
		Actor_Start_Speech_Sample(kActorGaff, 210);
		Actor_Set_Goal_Number(kActorGaff, kGoalGaffMA07Left);
		return true;

	case kGoalGaffMA07Left:
		return true;

	case kGoalGaffMA07ShootMcCoy:
		Actor_Face_Actor(kActorGaff, kActorMcCoy, true);
		Actor_Change_Animation_Mode(kActorGaff, kAnimationModeCombatAttack);
		Sound_Play(kSfxSMCAL3, 100, 0, 0, 50);
		Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeDie);
		Actor_Retired_Here(kActorMcCoy, 12, 12, true, -1);
		return true;

	case kGoalGaffGone:
		AI_Movement_Track_Flush(kActorGaff);
		Actor_Put_In_Set(kActorGaff, kSetKP05_KP06);
		Actor_Set_At_XYZ(kActorGaff, -782.15f, 8.26f, -263.64f, 52);
		return true;
	}
	return false;
}
Exemplo n.º 7
0
void AIScriptFreeSlotB::processGoal301() {
	switch (Random_Query(1, 14)) {
	case 1:
		AI_Movement_Track_Append(kActorFreeSlotB, 450, 1);
		AI_Movement_Track_Append(kActorFreeSlotB, 451, 5);
		AI_Movement_Track_Append(kActorFreeSlotB, 450, 0);
		break;

	case 2:
		World_Waypoint_Set(466, 74, 144.98f, -50.13f, -175.75f);
		World_Waypoint_Set(547, 74, 105.6f, -50.13f, -578.46f);
		World_Waypoint_Set(548, 74, 62.0f, -50.13f, -574.0f);
		AI_Movement_Track_Append(kActorFreeSlotB, 466, 1);
		AI_Movement_Track_Append(kActorFreeSlotB, 547, 1);
		AI_Movement_Track_Append(kActorFreeSlotB, 548, 5);
		AI_Movement_Track_Append(kActorFreeSlotB, 466, 5);
		break;

	case 3:
		AI_Movement_Track_Append(kActorFreeSlotB, 446, 15);
		AI_Movement_Track_Append(kActorFreeSlotB, 447, 1);
		AI_Movement_Track_Append(kActorFreeSlotB, 449, 1);
		AI_Movement_Track_Append(kActorFreeSlotB, 448, 2);
		AI_Movement_Track_Append(kActorFreeSlotB, 449, 0);
		break;

	case 4:
		World_Waypoint_Set(466, 77, -22.70f, 6.39f, 33.12f);
		World_Waypoint_Set(547, 77, -6.70f, -1.74f, -362.88f);
		World_Waypoint_Set(548, 77, 164.0f, 11.87f, -1013.0f);
		AI_Movement_Track_Append(kActorFreeSlotB, 466, 2);
		AI_Movement_Track_Append(kActorFreeSlotB, 547, 0);
		AI_Movement_Track_Append(kActorFreeSlotB, 548, 0);
		break;

	case 5:
		AI_Movement_Track_Append(kActorFreeSlotB, 457, 15);
		AI_Movement_Track_Append(kActorFreeSlotB, 458, 0);
		AI_Movement_Track_Append(kActorFreeSlotB, 459, 15);
		break;

	case 6:
		AI_Movement_Track_Append(kActorFreeSlotB, 460, 15);
		AI_Movement_Track_Append(kActorFreeSlotB, 461, 5);
		AI_Movement_Track_Append(kActorFreeSlotB, 460, 15);
		break;

	case 7:
		if (Actor_Query_In_Set(kActorClovis, kSetUG07)) {
			AI_Movement_Track_Append(kActorFreeSlotB, 39, 10);
		} else {
			World_Waypoint_Set(466, 80, -88.78f, -12.21f, -184.08f);
			World_Waypoint_Set(547, 80, 250.0f, -12.21f, -342.0f);
			World_Waypoint_Set(548, 80, -164.78f, -12.21f, -832.08f);
			AI_Movement_Track_Append(kActorFreeSlotB, 466, 5);
			AI_Movement_Track_Append(kActorFreeSlotB, 547, 1);
		}
		break;

	case 8:
		World_Waypoint_Set(466, 80, -88.78f, -12.21f, -184.08f);
		World_Waypoint_Set(547, 80, 250.0f, -12.21f, -342.0f);
		World_Waypoint_Set(548, 80, -164.78f, -12.21f, -832.08f);
		AI_Movement_Track_Append(kActorFreeSlotB, 547, 5);
		AI_Movement_Track_Append(kActorFreeSlotB, 466, 1);
		break;

	case 9:
		World_Waypoint_Set(466, 80, -88.78f, -12.21f, -184.08f);
		World_Waypoint_Set(547, 80, 250.0f, -12.21f, -342.0f);
		World_Waypoint_Set(548, 80, -164.78f, -12.21f, -832.08f);
		AI_Movement_Track_Append(kActorFreeSlotB, 547, 5);
		AI_Movement_Track_Append(kActorFreeSlotB, 548, 1);
		break;

	case 10:
		World_Waypoint_Set(466, 80, -88.78f, -12.21f, -184.08f);
		World_Waypoint_Set(547, 80, 250.0f, -12.21f, -342.0f);
		World_Waypoint_Set(548, 80, -164.78f, -12.21f, -832.08f);
		AI_Movement_Track_Append(kActorFreeSlotB, 548, 5);
		AI_Movement_Track_Append(kActorFreeSlotB, 547, 1);
		break;

	case 11:
		World_Waypoint_Set(466, 82, 91.0f, 156.94f, -498.0f);
		World_Waypoint_Set(547, 82, -149.0f, 156.94f, -498.0f);
		AI_Movement_Track_Append(kActorFreeSlotB, 466, 5);
		AI_Movement_Track_Append(kActorFreeSlotB, 547, 1);
		break;

	case 12:
		World_Waypoint_Set(466, 82, 91.0f, 156.94f, -498.0f);
		World_Waypoint_Set(547, 82, -149.0f, 156.94f, -498.0f);
		AI_Movement_Track_Append(kActorFreeSlotB, 547, 5);
		AI_Movement_Track_Append(kActorFreeSlotB, 466, 1);
		break;

	case 13:
		World_Waypoint_Set(466, 82, -152.51f, 277.31f, 311.98f);
		World_Waypoint_Set(547, 82, -124.51f, 275.08f, 319.98f);
		AI_Movement_Track_Append(kActorFreeSlotB, 466, 1);
		AI_Movement_Track_Append(kActorFreeSlotB, 547, 8);
		AI_Movement_Track_Append(kActorFreeSlotB, 466, 1);
		break;

	case 14:
		World_Waypoint_Set(466, 84, -360.67f, 21.39f, 517.55f);
		World_Waypoint_Set(547, 84, -250.67f, 21.39f, 477.55f);
		World_Waypoint_Set(548, 84, -248.67f, 21.39f, -1454.45f);
		AI_Movement_Track_Append(kActorFreeSlotB, 466, 1);
		AI_Movement_Track_Append(kActorFreeSlotB, 547, 8);
		AI_Movement_Track_Append(kActorFreeSlotB, 548, 1);
		break;

	default:
		AI_Movement_Track_Append(kActorFreeSlotB, 39, Random_Query(1, 10));
		break;
	}
}
Exemplo n.º 8
0
bool AIScriptMutant1::GoalChanged(int currentGoalNumber, int newGoalNumber) {
	switch (newGoalNumber) {
	case 400:
		AI_Movement_Track_Flush(kActorMutant1);
		AI_Movement_Track_Append(kActorMutant1, 39, 0);
		AI_Movement_Track_Repeat(kActorMutant1);

		if (Game_Flag_Query(kFlagCT04HomelessKilledByMcCoy)) {
			Actor_Set_Combat_Aggressiveness(kActorMutant1, 70);
			Actor_Set_Friendliness_To_Other(kActorMutant1, kActorMcCoy, 20);
		}
		return true;

	case 401:
		Actor_Set_Targetable(kActorMutant1, 1);
		AI_Movement_Track_Flush(kActorMutant1);
		AI_Movement_Track_Append(kActorMutant1, 39, 0);

		switch (Random_Query(1, 8)) {
		case 1:
			AI_Movement_Track_Append(kActorMutant1, 182, 0);
			AI_Movement_Track_Append(kActorMutant1, 183, 2);
			AI_Movement_Track_Append(kActorMutant1, 184, 0);
			AI_Movement_Track_Repeat(kActorMutant1);
			break;

		case 2:
			AI_Movement_Track_Append(kActorMutant1, 296, 0);
			AI_Movement_Track_Append(kActorMutant1, 297, 0);
			AI_Movement_Track_Repeat(kActorMutant1);
			break;

		case 3:
			AI_Movement_Track_Append(kActorMutant1, 176, 0);
			AI_Movement_Track_Append(kActorMutant1, 177, 0);
			AI_Movement_Track_Append(kActorMutant1, 178, 2);
			AI_Movement_Track_Append(kActorMutant1, 177, 0);
			AI_Movement_Track_Append(kActorMutant1, 176, 1);
			AI_Movement_Track_Append(kActorMutant1, 39, 45);
			AI_Movement_Track_Repeat(kActorMutant1);
			break;

		case 4:
			AI_Movement_Track_Append(kActorMutant1, 298, 0);
			AI_Movement_Track_Append(kActorMutant1, 300, 0);
			AI_Movement_Track_Repeat(kActorMutant1);
			break;

		case 5:
			AI_Movement_Track_Append(kActorMutant1, 301, 0);
			AI_Movement_Track_Append(kActorMutant1, 302, 2);
			AI_Movement_Track_Append(kActorMutant1, 303, 0);
			AI_Movement_Track_Append(kActorMutant1, 304, 0);
			AI_Movement_Track_Append(kActorMutant1, 305, 0);
			AI_Movement_Track_Append(kActorMutant1, 304, 0);
			AI_Movement_Track_Append(kActorMutant1, 306, 0);
			AI_Movement_Track_Append(kActorMutant1, 39, 60);
			AI_Movement_Track_Repeat(kActorMutant1);
			break;

		case 6:
			AI_Movement_Track_Append(kActorMutant1, 307, 0);
			AI_Movement_Track_Append(kActorMutant1, 308, 0);
			AI_Movement_Track_Append(kActorMutant1, 309, 1);
			AI_Movement_Track_Append(kActorMutant1, 310, 3);
			AI_Movement_Track_Append(kActorMutant1, 311, 0);
			AI_Movement_Track_Repeat(kActorMutant1);
			break;

		case 7:
			switch (Random_Query(1, 5)) {
			case 1:
				AI_Movement_Track_Append(kActorMutant1, 532, 0);
				AI_Movement_Track_Append(kActorMutant1, 533, 0);
				AI_Movement_Track_Append(kActorMutant1, 534, 2);
				AI_Movement_Track_Append(kActorMutant1, 535, 3);
				AI_Movement_Track_Append(kActorMutant1, 533, 0);
				AI_Movement_Track_Append(kActorMutant1, 532, 0);
				AI_Movement_Track_Repeat(kActorMutant1);
				break;

			case 2:
				AI_Movement_Track_Append(kActorMutant1, 532, 0);
				AI_Movement_Track_Append(kActorMutant1, 533, 0);
				AI_Movement_Track_Append(kActorMutant1, 535, 2);
				AI_Movement_Track_Append(kActorMutant1, 534, 3);
				AI_Movement_Track_Append(kActorMutant1, 533, 0);
				AI_Movement_Track_Append(kActorMutant1, 532, 0);
				AI_Movement_Track_Repeat(kActorMutant1);
				break;

			case 3:
				AI_Movement_Track_Append(kActorMutant1, 536, 0);
				AI_Movement_Track_Append(kActorMutant1, 537, 0);
				AI_Movement_Track_Append(kActorMutant1, 538, 2);
				AI_Movement_Track_Append(kActorMutant1, 537, 0);
				AI_Movement_Track_Append(kActorMutant1, 536, 0);
				AI_Movement_Track_Repeat(kActorMutant1);
				break;

			case 4:
				AI_Movement_Track_Append(kActorMutant1, 532, 0);
				AI_Movement_Track_Append(kActorMutant1, 533, 0);
				AI_Movement_Track_Append(kActorMutant1, 534, 3);
				AI_Movement_Track_Append(kActorMutant1, 533, 0);
				AI_Movement_Track_Append(kActorMutant1, 532, 0);
				AI_Movement_Track_Repeat(kActorMutant1);
				break;

			case 5:
				AI_Movement_Track_Append(kActorMutant1, 532, 0);
				AI_Movement_Track_Append(kActorMutant1, 533, 0);
				AI_Movement_Track_Append(kActorMutant1, 535, 1);
				AI_Movement_Track_Append(kActorMutant1, 533, 0);
				AI_Movement_Track_Append(kActorMutant1, 532, 0);
				AI_Movement_Track_Repeat(kActorMutant1);
				break;

			default:
				return true;
			}
			break;

		case 8:
			if (Game_Flag_Query(623) == 1) {
				AI_Movement_Track_Append(kActorMutant1, 418, 0);
				AI_Movement_Track_Append(kActorMutant1, 417, 0);
				AI_Movement_Track_Append(kActorMutant1, 539, 0);
				AI_Movement_Track_Repeat(kActorMutant1);
			} else {
				Actor_Set_Goal_Number(kActorMutant1, 403);
			}
			break;

		default:
			AI_Movement_Track_Append(kActorMutant1, 39, 60);
			AI_Movement_Track_Repeat(kActorMutant1);
			break;
		}
		return true;

	case 403:
		Actor_Set_Targetable(kActorMutant1, 0);
		Actor_Set_Goal_Number(kActorMutant1, 401);
		return true;

	case 404:
		AI_Movement_Track_Flush(kActorMutant1);
		AI_Movement_Track_Append(kActorMutant1, 39, 0);
		AI_Movement_Track_Repeat(kActorMutant1);
		return true;

	case 410:
		switch (Actor_Query_Which_Set_In(kActorMutant1)) {
		case kSetUG01:
			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, kActorCombatStateIdle, false, kActorMcCoy, 10, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, -1, -1, -1, 10, 300, false);
			break;

		case kSetUG07:
			Non_Player_Actor_Combat_Mode_On(kActorMutant1, kActorCombatStateIdle, false, kActorMcCoy, 12, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, -1, -1, -1, 10, 300, false);
			break;

		case kSetUG10:
		case kSetUG12:
		case kSetUG14:
			Non_Player_Actor_Combat_Mode_On(kActorMutant1, kActorCombatStateIdle, false, kActorMcCoy, 14, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, -1, -1, -1, 10, 300, false);
			break;
		}
		return true;

	case 411:
		AI_Movement_Track_Flush(kActorMutant1);
		Actor_Set_Intelligence(kActorMutant1, 40);
		Actor_Set_Health(kActorMutant1, 10 * Query_Difficulty_Level() + 30, 10 * Query_Difficulty_Level() + 30);

		if (Game_Flag_Query(kFlagCT04HomelessKilledByMcCoy)) {
			Actor_Set_Combat_Aggressiveness(kActorMutant1, 70);
			Actor_Set_Friendliness_To_Other(kActorMutant1, kActorMcCoy, 20);
		} else {
			Actor_Set_Combat_Aggressiveness(kActorMutant1, 40);
			Actor_Set_Friendliness_To_Other(kActorMutant1, kActorMcCoy, 45);
		}

		Actor_Modify_Friendliness_To_Other(kActorMutant2, kActorMcCoy, -10);
		Actor_Modify_Friendliness_To_Other(kActorMutant3, kActorMcCoy, -20);
		Actor_Modify_Combat_Aggressiveness(kActorMutant2, 10);
		Actor_Modify_Combat_Aggressiveness(kActorMutant3, 15);
		Actor_Set_Goal_Number(kActorMutant1, 403);
		return true;

	case 590:
		AI_Movement_Track_Flush(kActorMutant1);
		AI_Movement_Track_Append(kActorMutant1, 39, 100);
		AI_Movement_Track_Repeat(kActorMutant1);
		return true;

	case 599:
		AI_Movement_Track_Flush(kActorMutant1);
		Actor_Change_Animation_Mode(kActorMutant1, 48);
		Actor_Modify_Friendliness_To_Other(kActorMutant2, kActorMcCoy, -10);
		Actor_Modify_Friendliness_To_Other(kActorMutant3, kActorMcCoy, -20);
		Actor_Modify_Combat_Aggressiveness(kActorMutant2, 10);
		Actor_Modify_Combat_Aggressiveness(kActorMutant3, 15);
		return true;

	default:
		break;
	}

	return false;
}
Exemplo n.º 9
0
bool AIScriptSadik::UpdateAnimation(int *animation, int *frame) {
	switch (_animationState) {
	case 0:
		if (_var2 == 1) {
			*animation = 329;
			_animationFrame++;
			if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(329)) {
				*animation = 328;
				_animationFrame = 0;
				_var2 = 0;
			}
		} else if (_var2 == 0) {
			*animation = 328;
			if (_var3) {
				_var3--;
				if (!Random_Query(0, 6)) {
					_var4 = -_var4;
				}
			} else {
				_animationFrame += _var4;
				if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(328)) {
					_animationFrame = 0;
				}
				if (_animationFrame < 0) {
					_animationFrame = Slice_Animation_Query_Number_Of_Frames(328) - 1;
				}
				if (!Random_Query(0, 4)) {
					_var3 = 1;
				}
				if (!_animationFrame || _animationFrame == 8) {
					_var3 = Random_Query(2, 8);
				}
				if (!Random_Query(0, 2)) {
					if (!_animationFrame) {
						_var2 = 1;
						_var3 = 0;
						*animation = 329;
					}
				}
			}
		}
		break;

	case 1:
	case 2:
	case 3:
	case 4:
	case 5:
	case 6:
		switch (_animationState) {
		case 1:
			*animation = 323;
			break;
		case 2:
			*animation = 324;
			break;
		case 3:
			*animation = 317;
			break;
		case 4:
			*animation = 318;
			break;
		case 6:
			*animation = 340;
			break;
		case 5:
			*animation = 339;
			break;
		}
		_animationFrame++;
		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) {
			_animationFrame = 0;
		}
		break;

	case 7:
		*animation = 312;
		_animationFrame++;
		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(312)) {
			_animationFrame = 0;
		}
		break;

	case 8:
		*animation = 313;
		_animationFrame++;
		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(313)) {
			_animationFrame = 0;
			_animationState = 7;
			*animation = 312;
			Actor_Change_Animation_Mode(kActorSadik, 4);
		}
		break;

	case 9:
		*animation = 314;
		_animationFrame++;
		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(314)) {
			_animationFrame = 0;
			_animationState = 7;
			*animation = 312;
			Actor_Change_Animation_Mode(kActorSadik, 4);
		}
		break;

	case 10:
		*animation = 325;
		_animationFrame++;
		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(325)) {
			*animation = 328;
			_animationFrame = 0;
			_animationState = 0;
			Actor_Change_Animation_Mode(kActorSadik, 0);
		}
		break;

	case 11:
		*animation = 326;
		_animationFrame++;
		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(326)) {
			*animation = 328;
			_animationFrame = 0;
			_animationState = 0;
			Actor_Change_Animation_Mode(kActorSadik, kAnimationModeIdle);
		}
		break;

	case 12:
		*animation = 315;
		_animationFrame++;
		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(315)) {
			_animationFrame = 0;
			_animationState = 7;
			*animation = 312;
			Actor_Change_Animation_Mode(kActorSadik, kAnimationModeCombatIdle);
		}
		break;

	case 13:
		*animation = 316;
		_animationFrame++;
		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(316)) {
			_animationFrame = 0;
			_animationState = 7;
			*animation = 312;
			Actor_Change_Animation_Mode(kActorSadik, kAnimationModeCombatIdle);
		}
		break;

	case 14:
		*animation = 327;
		if (_animationFrame < Slice_Animation_Query_Number_Of_Frames(327) - 1) {
			_animationFrame++;
		}
		break;

	case 15:
		*animation = 327;
		if (_animationFrame < Slice_Animation_Query_Number_Of_Frames(327) - 1) {
			_animationFrame++;
		}
		break;

	case 16:
		*animation = 320;
		_animationFrame++;
		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(320)) {
			_animationFrame = 0;
			_animationState = 7;
			*animation = 312;
		}
		break;

	case 17:
		*animation = 321;
		_animationFrame++;
		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(321)) {
			*animation = 328;
			_animationFrame = 0;
			_animationState = 0;
		}
		break;

	case 18:
		*animation = 322;
		_animationFrame++;
		if (_animationFrame == 5) {
			int snd;
			if (Random_Query(1, 2) == 1) {
				snd = 9010;
			} else {
				snd = 9015;
			}
			Sound_Play_Speech_Line(kActorSadik, snd, 75, 0, 99);
		}
		if (_animationFrame == 7) {
			Actor_Combat_AI_Hit_Attempt(kActorSadik);
		}
		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(322)) {
			_animationFrame = 0;
			_animationState = 7;
			*animation = 312;
			Actor_Change_Animation_Mode(kActorSadik, kAnimationModeCombatIdle);
		}
		break;

	case 19:
		*animation = 331;
		if (!_animationFrame && _flag) {
			*animation = 328;
			_animationState = 0;
			_flag = 0;
		} else {
			_animationFrame++;
			if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(331)) {
				_animationFrame = 0;
			}
		}
		break;

	case 20:
	case 21:
	case 22:
	case 23:
	case 24:
	case 25:
	case 26:
		switch (_animationState) {
		case 20:
			*animation = 332;
			break;
		case 21:
			*animation = 333;
			break;
		case 22:
			*animation = 334;
			break;
		case 23:
			*animation = 335;
			break;
		case 24:
			*animation = 336;
			break;
		case 25:
			*animation = 337;
			break;
		default:
			*animation = 338;
			break;
		}
		_animationFrame++;
		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) {
			_animationFrame = 0;
			_animationState = 19;
			*animation = 331;
		}
		break;

	case 27:
		*animation = 330;
		_animationFrame++;
		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(330)) {
			*animation = 328;
			_animationFrame = 0;
			_animationState = 0;
			Actor_Change_Animation_Mode(kActorSadik, kAnimationModeIdle);
		}
		break;

	case 28:
		*animation = 341;
		_animationFrame++;
		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(341)) {
			*animation = 328;
			_animationFrame = 0;
			_animationState = 0;
		}
		break;

	case 29:
		*animation = 342;
		_animationFrame++;
		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(342)) {
			*animation = 328;
			_animationFrame = 0;
			_animationState = 0;
		}
		break;

	case 30:
		*animation = 343;
		_animationFrame++;
		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(343)) {
			*animation = 328;
			_animationFrame = 0;
			_animationState = 0;
			Actor_Change_Animation_Mode(kActorSadik, kAnimationModeIdle);
		}
		break;

	case 31:
		*animation = 344;
		_animationFrame++;
		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(344)) {
			*animation = 328;
			_animationFrame = 0;
			_animationState = 0;
			Actor_Change_Animation_Mode(kActorSadik, kAnimationModeIdle);
		}
		break;

	case 32:
		*animation = 345;
		_animationFrame++;
		if (_animationFrame == 23) {
			_nextSoundId = kSfxMTLDOOR2;
		}
		if (_animationFrame >= 25) {
			_animationFrame = 0;
			_animationState = 0;
			*animation = 328;
			Actor_Set_Goal_Number(kActorSadik, kGoalSadikBB11CatchMcCoy);
		}
		break;

	case 33:
		*animation = 344;
		_animationFrame++;
		if (Actor_Query_Goal_Number(kActorSadik) == kGoalSadikBB11KnockOutMcCoy) {
			if (_animationFrame == 4) {
				_nextSoundId = kSfxPUNCH1;
			}
			if (_animationFrame == 6) {
				Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeHit);
			}
		}
		if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) {
			*animation = 328;
			_animationFrame = 0;
			_animationState = 0;

			Actor_Change_Animation_Mode(kActorSadik, kAnimationModeIdle);
			if (Actor_Query_Goal_Number(kActorSadik) == kGoalSadikBB11KnockOutMcCoy) {
				Actor_Change_Animation_Mode(kActorSadik, 63);
			}
		}
		break;

	case 34:
		*animation = 343;
		_animationFrame++;
		if (_animationFrame == 4) {
			if (Actor_Query_Goal_Number(kActorSadik) == kGoalSadikBB11KnockOutMcCoy) {
				Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeDie);
				_nextSoundId = kSfxKICK1;
			} else {
				Actor_Change_Animation_Mode(kActorMcCoy, 68);
				_nextSoundId = kSfxKICK2;
			}
		}

		if (_animationFrame >= 15) {
			*animation = 328;
			_animationFrame = 0;
			_animationState = 0;
			Actor_Change_Animation_Mode(kActorSadik, kAnimationModeIdle);
			if (Actor_Query_Goal_Number(kActorSadik) == kGoalSadikBB11KnockOutMcCoy) {
				AI_Movement_Track_Flush(kActorSadik);
				AI_Movement_Track_Append(kActorSadik, 318, 0);
				AI_Movement_Track_Repeat(kActorSadik);
			} else {
				if (Actor_Query_Goal_Number(kActorSadik) == kGoalSadikBB11KickMcCoy) {
					Actor_Change_Animation_Mode(kActorSadik, 63);
				}
			}
		}
		break;

	default:
		*animation = 406;
		_animationFrame = 0;
		break;
	}

	*frame = _animationFrame;

	return true;
}
Exemplo n.º 10
0
bool AIScriptSadik::GoalChanged(int currentGoalNumber, int newGoalNumber) {
	switch (newGoalNumber) {
	case kGoalSadikDefaut:
		AI_Movement_Track_Flush(kActorSadik);
		AI_Movement_Track_Append(kActorSadik, 33, 0);
		AI_Movement_Track_Repeat(kActorSadik);
		return true;

	case kGoalSadikRunFromBB09:
		AI_Movement_Track_Flush(kActorSadik);
		AI_Movement_Track_Append_Run(kActorSadik, 131, 0);
		AI_Movement_Track_Append_Run(kActorSadik, 132, 0);
		AI_Movement_Track_Append_Run(kActorSadik, 133, 0);
		AI_Movement_Track_Repeat(kActorSadik);
		return true;

	case kGoalSadikBB11Wait:
		AI_Movement_Track_Flush(kActorSadik);
		AI_Movement_Track_Append(kActorSadik, 313, 0);
		AI_Movement_Track_Repeat(kActorSadik);
		Game_Flag_Set(kFlagBB11SadikFight);
		return true;

	case kGoalSadikBB11ThrowMcCoy:
		Actor_Set_Immunity_To_Obstacles(kActorSadik, true);
		Actor_Face_Heading(kActorSadik, kActorMcCoy, kActorMcCoy);
		_animationState = 32;
		_animationFrame = -1;
		Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeDie);
		return true;

	case kGoalSadikBB11CatchMcCoy:
		Actor_Set_Goal_Number(kActorMcCoy, kGoalMcCoyBB11GetUp);
		AI_Movement_Track_Flush(kActorSadik);
		AI_Movement_Track_Append(kActorSadik, 314, 0);
		AI_Movement_Track_Append_Run(kActorSadik, 317, 0);
		AI_Movement_Track_Repeat(kActorSadik);
		return true;

	case kGoalSadikBB11KnockOutMcCoy:
		Actor_Change_Animation_Mode(kActorSadik, 62);
		return true;

	case kGoalSadikBB11KickMcCoy:
		Actor_Face_Heading(kActorSadik, 100, false);
		Actor_Change_Animation_Mode(kActorSadik, 63);
		Actor_Set_Goal_Number(kActorClovis, kGoalClovisBB11WalkToMcCoy);
		Actor_Set_Immunity_To_Obstacles(kActorSadik, false);
		return true;

	case kGoalSadikBB11TalkWithClovis:
		_nextSoundId = -1; // changed from original (0) to be more clear that this is an invalid sfx id
		return false;

	case 200:
		Actor_Put_In_Set(kActorSadik, kSetFreeSlotA);
		Actor_Set_At_Waypoint(kActorSadik, 33, 0);
		Actor_Set_Goal_Number(kActorMcCoy, 199);
		return true;

	case kGoalSadikUG18Wait:
		Actor_Put_In_Set(kActorSadik, kSetUG18);
		Actor_Set_At_XYZ(kActorSadik, 111.89f, 0.0f, 408.42f, 0);
		Actor_Change_Animation_Mode(kActorSadik, 4);
		return true;

	case kGoalSadikUG18Move:
		Actor_Set_Targetable(kActorSadik, true);
		World_Waypoint_Set(436, kSetUG18, -356.11f, 0.0f, 652.42f);
		AI_Movement_Track_Flush(kActorSadik);
		AI_Movement_Track_Append_Run(kActorSadik, 436, 0);
		AI_Movement_Track_Repeat(kActorSadik);
		return true;

	case kGoalSadikUG18Decide:
		Actor_Set_Targetable(kActorSadik, false);
		return true;

	// goals 303, 304 and 305 are never set,  cut out part of game?
	case 303:
		AI_Countdown_Timer_Reset(kActorSadik, kActorTimerAIScriptCustomTask0);
		AI_Countdown_Timer_Start(kActorSadik, kActorTimerAIScriptCustomTask0, 5);
		return true;

	case 304:
		Actor_Set_Targetable(kActorSadik, false);
		AI_Countdown_Timer_Reset(kActorSadik, kActorTimerAIScriptCustomTask0);
		return true;

	case 305:
	case kGoalSadikUG18WillShootMcCoy:
	case kGoalSadikUG18Leave:
		return true;

	case kGoalSadikUG18PrepareShootMcCoy:
		Sound_Play(kSfxLGCAL1, 100, 0, 0, 50);
		AI_Countdown_Timer_Start(kActorSadik, kActorTimerAIScriptCustomTask0, 2);
		return true;

	case kGoalSadikUG18ShootMcCoy:
		if (Player_Query_Current_Scene() == kSceneUG18) {
			Actor_Force_Stop_Walking(kActorMcCoy);
			Actor_Change_Animation_Mode(kActorSadik, kAnimationModeCombatAttack);
			Sound_Play(kSfxLGCAL1, 100, 0, 0, 50);
			Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeDie);
			Actor_Retired_Here(kActorMcCoy, 6, 6, true, -1);
		}
		return true;

	case 309:
		AI_Countdown_Timer_Reset(kActorSadik, kActorTimerAIScriptCustomTask0);
		return true;

	case 400:
		Actor_Set_Goal_Number(kActorSadik, 410);
		return true;

	case 410:
		if (Game_Flag_Query(kFlagMcCoyIsHelpingReplicants) == 1) {
			Actor_Set_Goal_Number(kActorSadik, 414);
		} else {
			Actor_Set_Goal_Number(kActorSadik, 411);
		}
		return true;

	case 411:
		Actor_Put_In_Set(kActorSadik, kSetKP05_KP06);
		Actor_Set_At_XYZ(kActorSadik, -1134.0f, 0.0f, 73.45f, 398);
		Actor_Set_Goal_Number(kActorClovis, kGoalClovisKP07Wait);
		Actor_Set_Goal_Number(kActorMaggie, kGoalMaggieKP05Wait);
		return true;

	case 412:
		Actor_Says(kActorSadik, 60, 3);
		Actor_Says(kActorMcCoy, 2240, 3);
		Actor_Says(kActorSadik, 70, 3);
		Actor_Says(kActorSadik, 80, 3);
		Actor_Says(kActorMcCoy, 2245, 3);
		Actor_Says(kActorSadik, 90, 3);
		Actor_Says(kActorSadik, 100, 3);
		Actor_Says(kActorMcCoy, 2250, 3);
		Actor_Set_Goal_Number(kActorSadik, 413);
		return true;

	case 413:
		Loop_Actor_Walk_To_XYZ(kActorSadik, -1062.0f, 0.0f, 219.0f, 0, false, true, false);
		Actor_Set_Targetable(kActorSadik, true);
		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;

	case 414:
		Actor_Put_In_Set(kActorSadik, kSetKP05_KP06);
		Actor_Set_At_XYZ(kActorSadik, -961.0f, 0.0f, -778.0f, 150);
		Actor_Set_Targetable(kActorSadik, true);
		return true;

	case 415:
		Actor_Says(kActorSadik, 110, kAnimationModeTalk);
		Actor_Says(kActorMcCoy, 2290, kAnimationModeTalk);
		Actor_Says(kActorSadik, 310, kAnimationModeTalk);
		Actor_Says(kActorMcCoy, 2300, kAnimationModeTalk);
		if (Game_Flag_Query(kFlagSadikIsReplicant)) {
			Actor_Says(kActorSadik, 180, kAnimationModeTalk);
			Actor_Says(kActorSadik, 190, kAnimationModeTalk);
			Actor_Says(kActorMcCoy, 2310, kAnimationModeTalk);
			Actor_Says(kActorSadik, 200, kAnimationModeTalk);
		} else {
			Actor_Says(kActorSadik, 140, kAnimationModeTalk);
			Actor_Says(kActorSadik, 150, kAnimationModeTalk);
			Actor_Says(kActorMcCoy, 2305, kAnimationModeTalk);
			Actor_Says(kActorSadik, 160, kAnimationModeTalk);
			Actor_Says(kActorSadik, 170, kAnimationModeTalk);
		}
		Actor_Says(kActorMcCoy, 2315, kAnimationModeTalk);
		Actor_Says(kActorSadik, 210, kAnimationModeTalk);
		Actor_Says(kActorSadik, 220, kAnimationModeTalk);
		Actor_Says(kActorSadik, 230, kAnimationModeTalk);
		Actor_Says(kActorSadik, 240, kAnimationModeTalk);
		Actor_Says(kActorSadik, 250, kAnimationModeTalk);
		Actor_Says(kActorSadik, 260, kAnimationModeTalk);
		Actor_Set_Goal_Number(kActorSadik, kGoalSadikUG18NeedsReactorCoreFromMcCoy);
		return true;

	case kGoalSadikUG18NeedsReactorCoreFromMcCoy:
		Loop_Actor_Walk_To_XYZ(kActorSadik, -961.0f, 0.0f, -778.0f, 0, false, false, false);
		Actor_Face_Heading(kActorSadik, 150, false);
		return true;

	case 417:
		Actor_Face_Actor(kActorSadik, kActorMcCoy, true);
		Actor_Says(kActorSadik, 320, kAnimationModeTalk);
		Loop_Actor_Walk_To_XYZ(kActorSadik, -857.0f, 0.0f, -703.0f, 0, false, true, false);
		Actor_Says(kActorMcCoy, 2330, kAnimationModeTalk);
		Actor_Says(kActorSadik, 330, kAnimationModeTalk);
		Actor_Says(kActorMcCoy, 2335, kAnimationModeTalk);
		Actor_Says(kActorSadik, 340, kAnimationModeTalk);
		Actor_Set_Goal_Number(kActorSadik, kGoalSadikUG18NeedsReactorCoreFromMcCoy);
		return true;

	case 418:
		Game_Flag_Reset(kFlagMcCoyIsHelpingReplicants);
		Actor_Set_Goal_Number(kActorClovis, kGoalClovisKP07LayDown);
		Non_Player_Actor_Combat_Mode_On(kActorSadik, kActorCombatStateIdle, true, kActorMcCoy, 9, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, -1, -1, 15, 300, false);
		return true;

	case 419:
		Actor_Put_In_Set(kActorSadik, kSetKP07);
		Actor_Set_At_XYZ(kActorSadik, -12.0f, -41.58f, 72.0f, 0);
		return true;

	case 420:
	case 450:
		return true;
	}
	return false;
}
Exemplo n.º 11
0
bool AIScriptSadik::GoalChanged(int currentGoalNumber, int newGoalNumber) {
	switch (newGoalNumber) {
	case kGoalSadikDefaut:
		AI_Movement_Track_Flush(kActorSadik);
		AI_Movement_Track_Append(kActorSadik, 33, 0);
		AI_Movement_Track_Repeat(kActorSadik);
		return true;

	case kGoalSadikRunFromBB09:
		AI_Movement_Track_Flush(kActorSadik);
		AI_Movement_Track_Append_Run(kActorSadik, 131, 0);
		AI_Movement_Track_Append_Run(kActorSadik, 132, 0);
		AI_Movement_Track_Append_Run(kActorSadik, 133, 0);
		AI_Movement_Track_Repeat(kActorSadik);
		return true;

	case kGoalSadikBB11Wait:
		AI_Movement_Track_Flush(kActorSadik);
		AI_Movement_Track_Append(kActorSadik, 313, 0);
		AI_Movement_Track_Repeat(kActorSadik);
		Game_Flag_Set(kFlagBB11SadikFight);
		return true;

	case kGoalSadikBB11ThrowMcCoy:
		Actor_Set_Immunity_To_Obstacles(kActorSadik, true);
		Actor_Face_Heading(kActorSadik, kActorMcCoy, kActorMcCoy);
		_animationState = 32;
		_animationFrame = -1;
		Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeDie);
		return true;

	case kGoalSadikBB11CatchMcCoy:
		Actor_Set_Goal_Number(kActorMcCoy, kGoalMcCoyBB11GetUp);
		AI_Movement_Track_Flush(kActorSadik);
		AI_Movement_Track_Append(kActorSadik, 314, 0);
		AI_Movement_Track_Append_Run(kActorSadik, 317, 0);
		AI_Movement_Track_Repeat(kActorSadik);
		return true;

	case kGoalSadikBB11KnockOutMcCoy:
		Actor_Change_Animation_Mode(kActorSadik, 62);
		return true;

	case kGoalSadikBB11KickMcCoy:
		Actor_Face_Heading(kActorSadik, 100, false);
		Actor_Change_Animation_Mode(kActorSadik, 63);
		Actor_Set_Goal_Number(kActorClovis, kGoalClovisBB11WalkToMcCoy);
		Actor_Set_Immunity_To_Obstacles(kActorSadik, false);
		return true;

	case kGoalSadikBB11TalkWithClovis:
		_var1 = 0;
		return false;

	case 200:
		Actor_Put_In_Set(kActorSadik, kSetFreeSlotA);
		Actor_Set_At_Waypoint(kActorSadik, 33, 0);
		Actor_Set_Goal_Number(kActorMcCoy, 199);
		return true;

	case 300:
		Actor_Put_In_Set(kActorSadik, kSetUG18);
		Actor_Set_At_XYZ(kActorSadik, 111.89f, 0.0f, 408.42f, 0);
		Actor_Change_Animation_Mode(kActorSadik, 4);
		return true;

	case 301:
		Actor_Set_Targetable(kActorSadik, true);
		World_Waypoint_Set(436, 89, -356.11f, 0.0f, 652.42f);
		AI_Movement_Track_Flush(kActorSadik);
		AI_Movement_Track_Append_Run(kActorSadik, 436, 0);
		AI_Movement_Track_Repeat(kActorSadik);
		return true;

	case 302:
		Actor_Set_Targetable(kActorSadik, false);
		return true;

	case 303:
		AI_Countdown_Timer_Reset(kActorSadik, 0);
		AI_Countdown_Timer_Start(kActorSadik, 0, 5);
		return true;

	case 304:
		Actor_Set_Targetable(kActorSadik, false);
		AI_Countdown_Timer_Reset(kActorSadik, 0);
		return true;

	case 305:
	case 306:
	case 310:
		return true;

	case 307:
		Sound_Play(12, 100, 0, 0, 50);
		AI_Countdown_Timer_Start(kActorSadik, 0, 2);
		return true;

	case 308:
		if (Player_Query_Current_Scene() == kSceneUG18) {
			Actor_Force_Stop_Walking(kActorMcCoy);
			Actor_Change_Animation_Mode(kActorSadik, kAnimationModeCombatAttack);
			Sound_Play(12, 100, 0, 0, 50);
			Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeDie);
			Actor_Retired_Here(kActorMcCoy, 6, 6, true, -1);
		}
		return true;

	case 309:
		AI_Countdown_Timer_Reset(kActorSadik, 0);
		return true;

	case 400:
		Actor_Set_Goal_Number(kActorSadik, 410);
		return true;

	case 410:
		if (Game_Flag_Query(653) == 1) {
			Actor_Set_Goal_Number(kActorSadik, 414);
		} else {
			Actor_Set_Goal_Number(kActorSadik, 411);
		}
		return true;

	case 411:
		Actor_Put_In_Set(kActorSadik, kSetKP05_KP06);
		Actor_Set_At_XYZ(kActorSadik, -1134.0f, 0.0f, 73.45f, 398);
		Actor_Set_Goal_Number(kActorClovis, 513);
		Actor_Set_Goal_Number(kActorMaggie, 411);
		return true;

	case 412:
		Actor_Says(kActorSadik, 60, 3);
		Actor_Says(kActorMcCoy, 2240, 3);
		Actor_Says(kActorSadik, 70, 3);
		Actor_Says(kActorSadik, 80, 3);
		Actor_Says(kActorMcCoy, 2245, 3);
		Actor_Says(kActorSadik, 90, 3);
		Actor_Says(kActorSadik, 100, 3);
		Actor_Says(kActorMcCoy, 2250, 3);
		Actor_Set_Goal_Number(kActorSadik, 413);
		return true;

	case 413:
		Loop_Actor_Walk_To_XYZ(kActorSadik, -1062.0f, 0.0f, 219.0f, 0, false, true, 0);
		Actor_Set_Targetable(kActorSadik, true);
		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;

	case 414:
		Actor_Put_In_Set(kActorSadik, kSetKP05_KP06);
		Actor_Set_At_XYZ(kActorSadik, -961.0f, 0.0f, -778.0f, 150);
		Actor_Set_Targetable(kActorSadik, true);
		return true;

	case 415:
		Actor_Says(kActorSadik, 110, kAnimationModeTalk);
		Actor_Says(kActorMcCoy, 2290, kAnimationModeTalk);
		Actor_Says(kActorSadik, 310, kAnimationModeTalk);
		Actor_Says(kActorMcCoy, 2300, kAnimationModeTalk);
		if (Game_Flag_Query(kFlagSadikIsReplicant)) {
			Actor_Says(kActorSadik, 180, kAnimationModeTalk);
			Actor_Says(kActorSadik, 190, kAnimationModeTalk);
			Actor_Says(kActorMcCoy, 2310, kAnimationModeTalk);
			Actor_Says(kActorSadik, 200, kAnimationModeTalk);
		} else {
			Actor_Says(kActorSadik, 140, kAnimationModeTalk);
			Actor_Says(kActorSadik, 150, kAnimationModeTalk);
			Actor_Says(kActorMcCoy, 2305, kAnimationModeTalk);
			Actor_Says(kActorSadik, 160, kAnimationModeTalk);
			Actor_Says(kActorSadik, 170, kAnimationModeTalk);
		}
		Actor_Says(kActorMcCoy, 2315, kAnimationModeTalk);
		Actor_Says(kActorSadik, 210, kAnimationModeTalk);
		Actor_Says(kActorSadik, 220, kAnimationModeTalk);
		Actor_Says(kActorSadik, 230, kAnimationModeTalk);
		Actor_Says(kActorSadik, 240, kAnimationModeTalk);
		Actor_Says(kActorSadik, 250, kAnimationModeTalk);
		Actor_Says(kActorSadik, 260, kAnimationModeTalk);
		Actor_Set_Goal_Number(kActorSadik, 416);
		return true;

	case 416:
		Loop_Actor_Walk_To_XYZ(kActorSadik, -961.0f, 0.0f, -778.0f, 0, false, false, 0);
		Actor_Face_Heading(kActorSadik, 150, false);
		return true;

	case 417:
		Actor_Face_Actor(kActorSadik, kActorMcCoy, true);
		Actor_Says(kActorSadik, 320, kAnimationModeTalk);
		Loop_Actor_Walk_To_XYZ(kActorSadik, -857.0f, 0.0f, -703.0f, 0, false, true, 0);
		Actor_Says(kActorMcCoy, 2330, kAnimationModeTalk);
		Actor_Says(kActorSadik, 330, kAnimationModeTalk);
		Actor_Says(kActorMcCoy, 2335, kAnimationModeTalk);
		Actor_Says(kActorSadik, 340, kAnimationModeTalk);
		Actor_Set_Goal_Number(kActorSadik, 416);
		return true;

	case 418:
		Game_Flag_Reset(653);
		Actor_Set_Goal_Number(kActorClovis, 518);
		Non_Player_Actor_Combat_Mode_On(kActorSadik, kActorCombatStateIdle, true, kActorMcCoy, 9, kAnimationModeCombatIdle, kAnimationModeCombatWalk, kAnimationModeCombatRun, 0, -1, -1, 15, 300, false);
		return true;

	case 419:
		Actor_Put_In_Set(kActorSadik, kSetKP07);
		Actor_Set_At_XYZ(kActorSadik, -12.0f, -41.58f, 72.0f, 0);
		return true;

	case 420:
	case 450:
		return true;
	}
	return false;
}
Exemplo n.º 12
0
bool AIScriptLucy::GoalChanged(int currentGoalNumber, int newGoalNumber) {
	if (!newGoalNumber) {
		Actor_Put_In_Set(kActorLucy, kSetFreeSlotA);
		return false;
	}

	switch (newGoalNumber) {
	case 200:
		if (Global_Variable_Query(40) == 3) {
			if (Game_Flag_Query(591) && Game_Flag_Query(592) && Player_Query_Current_Scene() != 36) {
				Actor_Set_Goal_Number(kActorLucy, 205);
			} else {
				if (Random_Query(1, 2) - 1) {
					Actor_Set_Goal_Number(kActorLucy, 225);
				} else {
					Actor_Set_Goal_Number(kActorLucy, 220);
				}
			}
		} else {
			int rnd = Random_Query(1, 4) - 1;

			if (rnd) {
				if (rnd == 1) {
					Actor_Set_Goal_Number(kActorLucy, 225);
				} else if (Player_Query_Current_Scene() == 36) {
					Actor_Set_Goal_Number(kActorLucy, 220);
				} else {
					Actor_Set_Goal_Number(kActorLucy, 205);
				}
			} else {
				Actor_Set_Goal_Number(kActorLucy, 220);
			}
		}
		break;

	case 205:
		AI_Movement_Track_Flush(kActorLucy);
		AI_Movement_Track_Append_With_Facing(kActorLucy, 371, 0, 156);
		AI_Movement_Track_Repeat(kActorLucy);
		break;

	case 210:
		Actor_Set_Immunity_To_Obstacles(kActorLucy, 1);
		AI_Movement_Track_Flush(kActorLucy);
		AI_Movement_Track_Append_Run(kActorLucy, 377, 0);
		AI_Movement_Track_Repeat(kActorLucy);
		break;

	case 211:
		Actor_Set_Immunity_To_Obstacles(kActorLucy, 0);
		AI_Movement_Track_Flush(kActorLucy);
		AI_Movement_Track_Append_Run(kActorLucy, 372, 0);
		AI_Movement_Track_Append(kActorLucy, 33, 0);
		AI_Movement_Track_Repeat(kActorLucy);
		break;

	case 212:
		Actor_Set_Immunity_To_Obstacles(kActorLucy, 1);
		AI_Movement_Track_Flush(kActorLucy);
		AI_Movement_Track_Append_Run(kActorLucy, 378, 0);
		AI_Movement_Track_Repeat(kActorLucy);
		break;

	case 213:
		Actor_Set_Immunity_To_Obstacles(kActorLucy, 0);
		AI_Movement_Track_Flush(kActorLucy);
		AI_Movement_Track_Append_Run(kActorLucy, 373, 0);
		AI_Movement_Track_Append(kActorLucy, 33, 0);
		AI_Movement_Track_Repeat(kActorLucy);
		break;

	case 214:
		Actor_Says(kActorLucy, 320, 16);
		Actor_Set_Goal_Number(kActorHolloway, 242);
		Actor_Set_Immunity_To_Obstacles(6, 1);
		AI_Movement_Track_Flush(kActorLucy);
		AI_Movement_Track_Append(kActorLucy, 378, 0);
		AI_Movement_Track_Repeat(kActorLucy);
		break;

	case 215:
		Actor_Set_Immunity_To_Obstacles(kActorLucy, 0);
		AI_Movement_Track_Flush(kActorLucy);
		AI_Movement_Track_Append_Run(kActorLucy, 373, 0);
		AI_Movement_Track_Append(kActorLucy, 33, 30);
		AI_Movement_Track_Repeat(kActorLucy);
		break;

	case 220:
		AI_Movement_Track_Flush(kActorLucy);
		AI_Movement_Track_Append(kActorLucy, 39, Random_Query(5, 10));
		AI_Movement_Track_Append(kActorLucy, 33, Random_Query(5, 10));
		AI_Movement_Track_Append(kActorLucy, 39, Random_Query(5, 10));
		AI_Movement_Track_Repeat(kActorLucy);
		break;

	case 225:
		AI_Movement_Track_Flush(kActorLucy);
		AI_Movement_Track_Append(kActorLucy, 39, Random_Query(5, 15));
		AI_Movement_Track_Append(kActorLucy, 33, Random_Query(10, 30));
		AI_Movement_Track_Append(kActorLucy, 40, Random_Query(15, 30));
		AI_Movement_Track_Append(kActorLucy, 42, Random_Query(10, 20));
		AI_Movement_Track_Repeat(kActorLucy);
		break;

	case 230:
		AI_Movement_Track_Flush(kActorLucy);
		Actor_Put_In_Set(kActorLucy, kSetHF04);
		Actor_Set_At_Waypoint(kActorLucy, 518, 0);
		Actor_Set_Targetable(kActorLucy, 1);
		Actor_Set_Health(kActorLucy, 5, 5);
		break;

	case 232:
		Player_Loses_Control();
		Actor_Says(kActorMcCoy, 1700, 16);
		AI_Movement_Track_Flush(kActorLucy);
		Actor_Face_Actor(kActorLucy, 0, 1);
		Actor_Face_Actor(kActorMcCoy, kActorLucy, 1);
		Actor_Says(kActorLucy, 350, 13);
		Actor_Says(kActorMcCoy, 1705, 13);
		Actor_Says(kActorLucy, 360, 13);
		Actor_Says(kActorMcCoy, 1710, 13);

		if (Global_Variable_Query(kVariableAffectionTowards) == 3) {
			Actor_Says(kActorLucy, 940, 13);
			Actor_Says(kActorMcCoy, 6780, 12);
			Actor_Says(kActorLucy, 950, 12);
			Actor_Says(kActorLucy, 960, 14);
			Actor_Says(kActorMcCoy, 6785, 13);
			Actor_Says(kActorLucy, 970, 16);
			Actor_Says(kActorLucy, 980, 13);
			if (Game_Flag_Query(47)) {
				Actor_Says(kActorLucy, 990, 15);
			}
			Actor_Says(kActorMcCoy, 6790, 13);
			if (Game_Flag_Query(47) && Game_Flag_Query(46)) {
				Actor_Says(kActorLucy, 1000, 12);
			}
			Actor_Says(kActorLucy, 1010, 15);
			Actor_Says(kActorLucy, 1020, 12);
			Actor_Says(kActorMcCoy, 6795, 18);
			Actor_Says(kActorLucy, 1030, 15);
			Actor_Says(kActorMcCoy, 6800, 16);
			Actor_Says(kActorLucy, 1040, 12);
			Actor_Says(kActorMcCoy, 6805, 15);
			Actor_Says(kActorLucy, 1050, 12);
		}
		Actor_Says(kActorLucy, 370, 14);
		Actor_Set_Goal_Number(kActorLucy, 239);
		if (Global_Variable_Query(40) == 3) {
			Actor_Set_Goal_Number(kActorSteele, 243);
			Game_Flag_Set(593);
		}
		Player_Gains_Control();
		break;

	case 233:
		AI_Movement_Track_Flush(kActorLucy);
		AI_Movement_Track_Append_Run(kActorLucy, 519, 0);
		AI_Movement_Track_Repeat(kActorLucy);
		Actor_Set_Health(kActorLucy, 5, 5);
		break;

	case 234:
		AI_Movement_Track_Flush(kActorLucy);
		AI_Movement_Track_Append_Run(kActorLucy, 520, 0);
		AI_Movement_Track_Repeat(kActorLucy);
		break;

	case 236:
		AI_Movement_Track_Flush(kActorLucy);
		AI_Movement_Track_Append_Run(kActorLucy, 521, 0);
		AI_Movement_Track_Repeat(kActorLucy);
		break;

	case 238:
		AI_Movement_Track_Flush(kActorLucy);
		AI_Movement_Track_Append_Run(kActorLucy, 522, 0);
		AI_Movement_Track_Repeat(kActorLucy);
		break;

	case 239:
		AI_Movement_Track_Flush(kActorLucy);
		AI_Movement_Track_Append_Run(kActorLucy, 523, 0);
		AI_Movement_Track_Append(kActorLucy, 33, 0);
		AI_Movement_Track_Repeat(kActorLucy);
		Player_Gains_Control();
		Actor_Set_Health(kActorLucy, 30, 30);
		break;

	case 240:
		if (Global_Variable_Query(40) == 3) {
			Actor_Set_Goal_Number(kActorLucy, 599);
			Actor_Set_Goal_Number(kActorSteele, 240);
		} else {
			Actor_Set_Goal_Number(kActorLucy, 299);
			Game_Flag_Set(593);
		}
		break;

	case 250:
		AI_Movement_Track_Flush(kActorLucy);
		AI_Movement_Track_Append(kActorLucy, 372, 0);
		AI_Movement_Track_Append_With_Facing(kActorLucy, 371, 0, 156);
		AI_Movement_Track_Repeat(kActorLucy);
		break;

	case 300:
		Actor_Put_In_Set(kActorLucy, kSetFreeSlotA);
		Actor_Set_At_Waypoint(kActorLucy, 33, 0);
		if (Global_Variable_Query(kVariableAffectionTowards) == 3) {
			Actor_Set_Goal_Number(kActorLucy, 310);
		}
		break;

	case 310:
		Actor_Put_In_Set(kActorLucy, kSetUG01);
		Actor_Set_At_Waypoint(kActorLucy, 544, 651);
		break;

	case 311:
		voightKempTest();
		break;

	case 312:
		AI_Movement_Track_Flush(kActorLucy);
		AI_Movement_Track_Append_Run(kActorLucy, 545, 0);
		AI_Movement_Track_Append(kActorLucy, 33, 0);
		AI_Movement_Track_Repeat(kActorLucy);
		break;

	case 599:
		Game_Flag_Set(593);
		break;
	}

	return false;
}