BLADERUNNER: Fix bug and inconsitency with weapons forms

This commit is contained in:
Thanasis Antoniou 2020-02-04 17:54:42 +02:00
parent be9557d698
commit 03521f7ab9
5 changed files with 103 additions and 44 deletions

View File

@ -222,7 +222,7 @@ enum Clues {
kClueCrazylegsInterview1 = 116,
kClueCrazylegsInterview2 = 117,
kClueLichenDogWrapper = 118,
kClueRequisitionForm = 119,
kClueRequisitionForm = 119, // original: Never acquired
kClueScaryChair = 120,
kClueIzosStashRaided = 121,
kClueHomelessManInterview1 = 122,
@ -230,7 +230,7 @@ enum Clues {
kClueHomelessManKid = 124,
kClueFolder = 125,
kClueGuzzaFramedMcCoy = 126,
kClueOriginalShippingForm = 127,
kClueOriginalShippingForm = 127, // original: Never acquired
kClueOriginalRequisitionForm = 128,
kClueCandyWrapper = 129,
kClueGordoBlabs = 130,
@ -1107,7 +1107,7 @@ enum Flags {
kFlagUG19Available = 665,
kFlagMcCoyFreedOfAccusations = 666,
// 667 is never used
// 668 is never used
kFlagUG13OriginalRequisitionFormPlaced = 668, // Re-purposed. Original: 668 is never used
kFlagKP02DispatchOnToxicKipple = 669, // Re-purposed. Original: 669 is never used
kFlagCallWithGuzza = 670,
kFlagUG18GuzzaScene = 671,
@ -1928,7 +1928,7 @@ enum GameModelAnimations {
kModelAnimationMaggieBracelet = 956,
kModelAnimationGrigoriansNote = 957,
kModelAnimationOriginalRequisitionForm = 958,
kModelAnimationOriginalShippingForm = 959,
kModelAnimationOriginalShippingForm = 959, // original: Never placed in game world
kModelAnimationPowerSource = 960,
kModelAnimationCollectionReceipt = 961,
kModelAnimationRequisitionForm = 962,

View File

@ -62,7 +62,7 @@ void SceneScriptCT11::SceneLoaded() {
Unobstacle_Object("BOX SOUTH 1", true);
if (Global_Variable_Query(kVariableChapter) < 4) {
if (!Game_Flag_Query(kFlagCT11DogWrapperTaken)) {
Item_Add_To_World(kItemDogWrapper, kModelAnimationLichenDogWrapper, 33, 640.21f, 30.0f, 470.0f, 512, 12, 12, false, true, false, true);
Item_Add_To_World(kItemDogWrapper, kModelAnimationLichenDogWrapper, kSetCT11, 640.21f, 30.0f, 470.0f, 512, 12, 12, false, true, false, true);
Scene_2D_Region_Add(0, 505, 316, 513, 321);
Game_Flag_Set(kFlagCT11DogWrapperAvailable);
}

View File

@ -101,6 +101,7 @@ bool SceneScriptPS04::ClickedOnActor(int actorId) {
}
bool SceneScriptPS04::ClickedOnItem(int itemId, bool a2) {
#if BLADERUNNER_ORIGINAL_BUGS
if (itemId == kItemWeaponsOrderForm
&& Actor_Query_Is_In_Current_Set(kActorGuzza)
) {
@ -109,12 +110,21 @@ bool SceneScriptPS04::ClickedOnItem(int itemId, bool a2) {
Item_Remove_From_World(kItemWeaponsOrderForm);
Item_Pickup_Spin_Effect(kModelAnimationOriginalRequisitionForm, 464, 362);
Actor_Says(kActorMcCoy, 4485, kAnimationModeTalk);
#if BLADERUNNER_ORIGINAL_BUGS
Actor_Clue_Acquire(kActorMcCoy, kClueWeaponsOrderForm, true, kActorMcCoy); // A bug? Shouldn't the last argument be -1 here?
#else
Actor_Clue_Acquire(kActorMcCoy, kClueWeaponsOrderForm, true, -1);
#endif // BLADERUNNER_ORIGINAL_BUGS
Actor_Clue_Acquire(kActorMcCoy, kClueWeaponsOrderForm, true, kActorMcCoy);
}
#else
// bugfix: correct code, this is only for clicking on the kItemWeaponsOrderForm
if (itemId == kItemWeaponsOrderForm) {
if (Actor_Query_Is_In_Current_Set(kActorGuzza)) {
Actor_Says(kActorGuzza, 560, 30);
} else if (!Actor_Clue_Query(kActorMcCoy, kClueWeaponsOrderForm)) {
Item_Remove_From_World(kItemWeaponsOrderForm);
Item_Pickup_Spin_Effect(kModelAnimationOriginalRequisitionForm, 464, 362);
Actor_Says(kActorMcCoy, 4485, kAnimationModeTalk);
Actor_Clue_Acquire(kActorMcCoy, kClueWeaponsOrderForm, true, kActorMcCoy);
}
}
#endif // BLADERUNNER_ORIGINAL_BUGS
return false;
}
@ -244,8 +254,8 @@ void SceneScriptPS04::dialogueWithGuzza() {
break;
case 130: // REPORT IN
if ( Game_Flag_Query(kFlagZubenRetired)
&& !Game_Flag_Query(kFlagPS04GuzzaTalkZubenRetired)
if (Game_Flag_Query(kFlagZubenRetired)
&& !Game_Flag_Query(kFlagPS04GuzzaTalkZubenRetired)
) {
Actor_Says(kActorMcCoy, 3920, 13);
Actor_Says(kActorGuzza, 140, 30);
@ -294,8 +304,8 @@ void SceneScriptPS04::dialogueWithGuzza() {
Game_Flag_Set(kFlagZubenBountyPaid); // not a proper bug, but was missing from original code, so the flag would remain in non-consistent state in this case
}
#endif // BLADERUNNER_ORIGINAL_BUGS
} else if ( Game_Flag_Query(kFlagZubenSpared)
&& !Game_Flag_Query(kFlagPS04GuzzaTalkZubenEscaped)
} else if (Game_Flag_Query(kFlagZubenSpared)
&& !Game_Flag_Query(kFlagPS04GuzzaTalkZubenEscaped)
) {
Actor_Says(kActorMcCoy, 3955, 13);
Actor_Says(kActorGuzza, 280, 30);
@ -316,13 +326,11 @@ void SceneScriptPS04::dialogueWithGuzza() {
}
#endif // BLADERUNNER_ORIGINAL_BUGS
Game_Flag_Set(kFlagPS04GuzzaTalkZubenEscaped);
} else if (
( Actor_Clue_Query(kActorMcCoy, kClueChopstickWrapper)
|| Actor_Clue_Query(kActorMcCoy, kClueSushiMenu)
)
&& Actor_Clue_Query(kActorMcCoy, kClueRunciterInterviewA)
&& Actor_Query_Friendliness_To_Other(kActorGuzza, kActorMcCoy) < 50
&& !Game_Flag_Query(kFlagPS04GuzzaTalk1)
} else if ((Actor_Clue_Query(kActorMcCoy, kClueChopstickWrapper)
|| Actor_Clue_Query(kActorMcCoy, kClueSushiMenu))
&& Actor_Clue_Query(kActorMcCoy, kClueRunciterInterviewA)
&& Actor_Query_Friendliness_To_Other(kActorGuzza, kActorMcCoy) < 50
&& !Game_Flag_Query(kFlagPS04GuzzaTalk1)
) {
Actor_Says(kActorMcCoy, 3970, 18);
Actor_Says(kActorGuzza, 330, 30);
@ -338,12 +346,10 @@ void SceneScriptPS04::dialogueWithGuzza() {
Actor_Says(kActorGuzza, 400, 34);
Actor_Says(kActorGuzza, 410, 31);
Game_Flag_Set(kFlagPS04GuzzaTalk1);
} else if (
( Actor_Clue_Query(kActorMcCoy, kClueChopstickWrapper)
|| Actor_Clue_Query(kActorMcCoy, kClueSushiMenu)
)
&& Actor_Clue_Query(kActorMcCoy, kClueRunciterInterviewA)
&& !Game_Flag_Query(kFlagPS04GuzzaTalk2)
} else if ((Actor_Clue_Query(kActorMcCoy, kClueChopstickWrapper)
|| Actor_Clue_Query(kActorMcCoy, kClueSushiMenu))
&& Actor_Clue_Query(kActorMcCoy, kClueRunciterInterviewA)
&& !Game_Flag_Query(kFlagPS04GuzzaTalk2)
) {
Actor_Says(kActorMcCoy, 3920, 13);
Actor_Says(kActorGuzza, 570, 32);

View File

@ -43,7 +43,7 @@ void SceneScriptPS15::InitializeScene() {
void SceneScriptPS15::SceneLoaded() {
Obstacle_Object("E.ARCH", true);
if (Global_Variable_Query(kVariableChapter) == 2) {
Item_Add_To_World(kItemWeaponsCrate, kModelAnimationWeaponsCrate, 101, -208.0f, -113.43f, 30.28f, 750, 16, 12, false, true, false, true);
Item_Add_To_World(kItemWeaponsCrate, kModelAnimationWeaponsCrate, kSetPS15, -208.0f, -113.43f, 30.28f, 750, 16, 12, false, true, false, true);
}
}
@ -57,10 +57,16 @@ bool SceneScriptPS15::ClickedOn3DObject(const char *objectName, bool a2) {
bool SceneScriptPS15::ClickedOnActor(int actorId) {
if (actorId == kActorSergeantWalls) {
if ((Actor_Clue_Query(kActorMcCoy, kClueWeaponsOrderForm)
|| Actor_Clue_Query(kActorMcCoy, kCluePoliceIssueWeapons)
)
&& !Actor_Clue_Query(kActorMcCoy, kClueShippingForm)
if (
#if BLADERUNNER_ORIGINAL_BUGS
(Actor_Clue_Query(kActorMcCoy, kClueWeaponsOrderForm)
|| Actor_Clue_Query(kActorMcCoy, kCluePoliceIssueWeapons))
&& !Actor_Clue_Query(kActorMcCoy, kClueShippingForm)
#else
(Actor_Clue_Query(kActorMcCoy, kClueShippingForm)
|| Actor_Clue_Query(kActorMcCoy, kCluePoliceIssueWeapons))
&& !Actor_Clue_Query(kActorMcCoy, kClueWeaponsOrderForm)
#endif // BLADERUNNER_ORIGINAL_BUGS
) {
if (!Loop_Actor_Walk_To_XYZ(kActorMcCoy, -256.0f, -113.43f, 43.51f, 0, true, false, false)) {
Actor_Face_Actor(kActorMcCoy, kActorSergeantWalls, true);
@ -72,10 +78,25 @@ bool SceneScriptPS15::ClickedOnActor(int actorId) {
Actor_Says(kActorSergeantWalls, 140, 16);
Item_Pickup_Spin_Effect(kModelAnimationWeaponsOrderForm, 211, 239);
Actor_Says(kActorSergeantWalls, 150, 14);
#if BLADERUNNER_ORIGINAL_BUGS
// This code makes no sense (why remove the order form from the world,
// when it's not added (it only gets added when kFlagPS04WeaponsOrderForm is set)
// Also, why remove the kItemWeaponsOrderForm when McCoy acquires the kClueShippingForm from Walls?
Actor_Clue_Acquire(kActorMcCoy, kClueShippingForm, true, kActorSergeantWalls);
if (!Game_Flag_Query(kFlagPS04WeaponsOrderForm)) {
Item_Remove_From_World(kItemWeaponsOrderForm);
}
#else
// BugFix: McCoy here gets the kClueWeaponsOrderForm form from Sgt Walls
// (not the shipping form)
// and if the order form was added to Guzza's office (PS04),
// then the kFlagPS04WeaponsOrderForm would be set
// so in that case we remove the item from the game world (ie. from PS04)
Actor_Clue_Acquire(kActorMcCoy, kClueWeaponsOrderForm, true, kActorSergeantWalls);
if (Game_Flag_Query(kFlagPS04WeaponsOrderForm)) {
Item_Remove_From_World(kItemWeaponsOrderForm);
}
#endif // BLADERUNNER_ORIGINAL_BUGS
}
} else {
Actor_Face_Actor(kActorMcCoy, kActorSergeantWalls, true);
@ -100,11 +121,31 @@ bool SceneScriptPS15::ClickedOnActor(int actorId) {
bool SceneScriptPS15::ClickedOnItem(int itemId, bool a2) {
if (itemId == kItemWeaponsCrate) {
if (Actor_Clue_Query(kActorMcCoy, kClueWeaponsOrderForm)
&& Actor_Clue_Query(kActorMcCoy, kCluePoliceIssueWeapons)
if (
#if BLADERUNNER_ORIGINAL_BUGS
// the check here ideally should be about kClueShippingForm
// although it suffices that we also check for kCluePoliceIssueWeapons (logic AND)
// and the additional check for kClueWeaponsOrderForm does not affect anything
Actor_Clue_Query(kActorMcCoy, kClueWeaponsOrderForm)
#else
Actor_Clue_Query(kActorMcCoy, kClueShippingForm)
#endif // BLADERUNNER_ORIGINAL_BUGS
&& Actor_Clue_Query(kActorMcCoy, kCluePoliceIssueWeapons)
) {
#if BLADERUNNER_ORIGINAL_BUGS
#else
// McCoy should face the crate when saying "I've got all I can from that."
Actor_Face_Item(kActorMcCoy, kItemWeaponsCrate, true);
#endif // BLADERUNNER_ORIGINAL_BUGS
Actor_Says(kActorMcCoy, 8570, 14);
} else {
#if BLADERUNNER_ORIGINAL_BUGS
#else
// A form is added to McCoy's KIA from examining the crate
// but no item pickup effect was playing in the original
Item_Pickup_Spin_Effect(kModelAnimationWeaponsOrderForm, 411, 333);
#endif // BLADERUNNER_ORIGINAL_BUGS
Actor_Face_Actor(kActorMcCoy, kActorSergeantWalls, true);
Actor_Face_Actor(kActorSergeantWalls, kActorMcCoy, true);
Actor_Says(kActorMcCoy, 4485, 17);
@ -112,10 +153,18 @@ bool SceneScriptPS15::ClickedOnItem(int itemId, bool a2) {
Actor_Says(kActorMcCoy, 4490, 12);
Actor_Says(kActorSergeantWalls, 170, 13);
#if BLADERUNNER_ORIGINAL_BUGS
Actor_Clue_Acquire(kActorMcCoy, kClueWeaponsOrderForm, true, kActorMcCoy); // A bug? Shouldn't the last argument be -1 or kActorSergeantWalls here?
Actor_Clue_Acquire(kActorMcCoy, kCluePoliceIssueWeapons, true, kActorMcCoy); // A bug? Shouldn't the last argument be -1 or kActorSergeantWalls here?
// if the player did not get the weapons order form from Guzza's office, they get it here
Actor_Clue_Acquire(kActorMcCoy, kClueWeaponsOrderForm, true, kActorMcCoy);
// A bug? Shouldn't the last argument be -1 or kActorSergeantWalls here?
Actor_Clue_Acquire(kActorMcCoy, kCluePoliceIssueWeapons, true, kActorMcCoy);
#else
Actor_Clue_Acquire(kActorMcCoy, kClueWeaponsOrderForm, true, kActorSergeantWalls);
// Bugfix: Shipping form makes more sense to be attached to the box of weapons
// Order form is now acquired from Walls or from Guzza's office
if (!Actor_Clue_Query(kActorMcCoy, kClueShippingForm)) {
// (McCoy apparently finds it attached to the weapon's shipment crate)
// It's not given by Sgt Walls, so McCoy is credited for the clue find
Actor_Clue_Acquire(kActorMcCoy, kClueShippingForm, true, kActorMcCoy);
}
Actor_Clue_Acquire(kActorMcCoy, kCluePoliceIssueWeapons, true, kActorSergeantWalls);
#endif // BLADERUNNER_ORIGINAL_BUGS
}

View File

@ -94,14 +94,18 @@ void SceneScriptUG13::SceneLoaded() {
Clickable_Object("BOLLARD");
Unclickable_Object("BASKET");
if ( Global_Variable_Query(kVariableChapter) >= 3
&& !Actor_Clue_Query(kActorMcCoy, kClueOriginalRequisitionForm)
&& Game_Flag_Query(kFlagCT04HomelessKilledByMcCoy)
&& (Actor_Clue_Query(kActorMcCoy, kClueShippingForm)
|| Actor_Clue_Query(kActorMcCoy, kClueWeaponsOrderForm)
)
if (Global_Variable_Query(kVariableChapter) >= 3
&& !Actor_Clue_Query(kActorMcCoy, kClueOriginalRequisitionForm)
&& Game_Flag_Query(kFlagCT04HomelessKilledByMcCoy)
&& (Actor_Clue_Query(kActorMcCoy, kClueShippingForm)
|| Actor_Clue_Query(kActorMcCoy, kClueWeaponsOrderForm))
#if BLADERUNNER_ORIGINAL_BUGS
#else
&& !Game_Flag_Query(kFlagUG13OriginalRequisitionFormPlaced)
#endif // BLADERUNNER_ORIGINAL_BUGS
) {
Item_Add_To_World(kItemWeaponsOrderForm, kModelAnimationOriginalRequisitionForm, 85, -209.01f, 70.76f, -351.79f, 0, 16, 12, false, true, false, true);
Game_Flag_Set(kFlagUG13OriginalRequisitionFormPlaced);
Item_Add_To_World(kItemWeaponsOrderForm, kModelAnimationOriginalRequisitionForm, kSetUG13, -209.01f, 70.76f, -351.79f, 0, 16, 12, false, true, false, true);
}
}