Permalink
Browse files

BLADERUNNER: Fixed enabling combat mode in scripts

Fixed Zuben chase.
Added name of some flags used in the China town.
  • Loading branch information...
peterkohaut committed Jan 10, 2019
1 parent b4fed90 commit 2f0fb70a27726d2c4a233d394c1cb8ad375ad09d
@@ -37,7 +37,7 @@

//TODO: remove these when game is playable
#define BLADERUNNER_DEBUG_CONSOLE 0
#define BLADERUNNER_DEBUG_GAME 0
#define BLADERUNNER_DEBUG_GAME 1

namespace Common {
struct Event;
@@ -451,6 +451,8 @@ enum Flags {
kFlagPS02toPS05 = 22,
kFlagPS06toPS05 = 23,
kFlagIntroPlayed = 24,
kFlagCT01Visited = 25,
kFlagCT01ZubenLeft = 29,
kFlagMA02toMA06 = 33,
kFlagMA06ToMA02 = 34,
kFlagMA02ToMA04 = 35,
@@ -466,10 +468,26 @@ enum Flags {
kFlagSadikIsReplicant = 48,
kFlagMA07toMA06 = 57,
kFlagMA06toMA07 = 58,
kFlagCT02ZubenTalk = 59,
kFlagChapter1Ended = 61,
kFlagMA04toMA05 = 62,
kFlagMA05toMA04 = 63,
kFlagCT02toCT01 = 68,
kFlagCT02toCT03 = 69,
kFlagCT03toCT02 = 70,
kFlagCT03toCT01 = 71,
kFlagCT03toCT04 = 72,
kFlagCT04toCT03 = 73,
kFlagCT04toCT05 = 74,
kFlagCT05toCT04 = 75,
kFlagCT05toCT12 = 76,
kFlagCT05toCT06 = 77,
kFlagCT06toCT05 = 78,
kFlagCT06toCT08 = 79,
kFlagCT12toCT01 = 88,
kFlagCT12toCT03 = 89,
kFlagCT12toCT05 = 90,
kFlagCT12toCT11 = 91,
kFlagWarehouseOpen = 94,
kFlagKleinTalkPaintTransfer = 104,
kFlagKleinTalkChromeDebris = 105,
@@ -481,13 +499,15 @@ enum Flags {
kFlagPlayerHasOfficersStatement = 126,
kFlagPlayerHasPaintTransfer = 127,
kFlagPlayerHasChromeDebris = 128,
kFlagZubenCheckOnMcCoy = 129,
kFlagPS02toPS01 = 130,
kFlagPS02toPS07 = 131,
kFlagPS02toPS03 = 132,
kFlagPS02toPS09 = 133,
kFlagPS05toPS06 = 136,
kFlagKleinInsulted = 138,
kFlagRC02LucyDeskAvailable = 141,
kFlagCT07toCT06 = 144,
kFlagChapter1Ending = 146,
kFlagChopstickWrapperTaken = 147,
kFlagCandyTaken = 148,
@@ -500,6 +520,9 @@ enum Flags {
kFlagShellCasingsTaken = 190,
kFlagBoughtHowieLeeFood = 192,
kFlagPS15toPS05 = 204,
kFlagCT02ZubenFled = 210,
kFlagCT02toCT01walk = 234,
kFlagArrivedFromSpinner = 247,
kFlagSpinnerToCT01 = 248,
kFlagSpinnerToRC01 = 249,
kFlagSpinnerToMA01 = 250,
@@ -509,14 +532,17 @@ enum Flags {
kFlagSpinnerToBB01 = 254,
kFlagSpinnerToNR01 = 255,
kFlagSpinnerToHF01 = 256,
kFlagCT02PotTipped = 293,
kFlagGaffSpinnerCT12 = 294,
kFlagSpinnerToTB02 = 307,
kFlagDirectorsCut = 378,
KFlagMcCoyAndOfficerLearyTalking = 392,
KFlagMcCoyAndOfficerLearyArtMetaphor = 397,
kFlagCT12ToUG09 = 443,
kFlagGenericWalkerWaiting = 443,
kFlagMaggieIsHurt = 461,
kFlagKIAPrivacyAddon = 487,
kFlagCT07ZubenAttack = 516,
kFlagKIAPrivacyAddonIntro = 599,
kFlagMcCoySleeping = 647,
kFlagPhoneMessageFromClovis = 649,
@@ -529,6 +555,8 @@ enum Flags {
kFlagPS05TV4 = 692,
kFlagRC51Discovered = 709,
kFlagMA04WatchedTV = 711,
kFlagCT02McCoyFell = 719,
kFlagCT02McCoyCombatReady = 720,
kFlagZubenBountyPaid = 723
};

@@ -642,11 +670,11 @@ enum Scenes {
kSceneBB11 = 12,
kSceneCT01 = 13, // Chinatown - Howie Lee Restaurant
kSceneCT02 = 14, // Chinatown - Kitchen
kSceneCT03 = 15, // Chinatown - Back Alley
kSceneCT04 = 16, // Chinatown - Dumpster
kSceneCT05 = 17, // Chinatown - Warehouse
kSceneCT03 = 15, // Chinatown - Back alley
kSceneCT04 = 16, // Chinatown - Back alley - dumpster
kSceneCT05 = 17, // Chinatown - Warehouse - Inside
kSceneCT06 = 18, // Chinatown - Passage
kSceneCT07 = 19,
kSceneCT07 = 19, // Chinatown - Passage form back
kSceneCT08 = 20, // Chinatown - Yukon Hotel - Backroom
kSceneCT09 = 21, // Chinatown - Yukon Hotel - Lobby
kSceneCT10 = 22, // Chinatown - Yukon Hotel - Room
@@ -927,6 +955,32 @@ enum PoliceMazeTrackInstruction {
kPMTI26 = 0
};

enum GoalMcCoy {
kGoalMcCoyDefault = 0,
kGoalMcCoyDodge = 1,
};

enum GoalTransient {
kGoalTransientDefault = 0,
};

enum GoalZuben {
kGoalZubenDefault = 0,
kGoalZubenCT01Leave = 1,
kGoalZubenCT02Flee = 2,
kGoalZubenDie = 6,
kGoalZubenCT02PushPot = 8,
kGoalZubenCT02RunToDoor = 9,
kGoalZubenCT02OpenDoor = 10,
kGoalZubenCT06JumpDown = 11,
kGoalZubenCT06AttackMcCoy = 12,
kGoalZubenCT06Hide = 13,
kGoalZubenCT02PotDodgeCheck = 14,
kGoalZubenFled = 20,
kGoalZubenMA01AttackMcCoy = 21

};

} // End of namespace BladeRunner

#endif
@@ -109,22 +109,22 @@ bool GameInfo::open(const Common::String &name) {
#if BLADERUNNER_DEBUG_CONSOLE
debug("\nScene names\n----------------");
for (uint32 i = 0; i != _sceneNamesCount; ++i) {
debug("%3d: %s", i, _sceneNames[i]);
debug("%3d: %s", i, _sceneNames[i].c_str());
}

debug("\nSfx tracks\n----------------");
for (uint32 i = 0; i != _sfxTrackCount; ++i) {
debug("%3d: %s", i, _sfxTracks[i]);
debug("%3d: %s", i, _sfxTracks[i].c_str());
}

debug("\nMusic tracks\n----------------");
for (uint32 i = 0; i != _musicTrackCount; ++i) {
debug("%3d: %s", i, _musicTracks[i]);
debug("%3d: %s", i, _musicTracks[i].c_str());
}

debug("\nOuttakes\n----------------");
for (uint32 i = 0; i != _outtakeCount; ++i) {
debug("%2d: %s.VQA", i, _outtakes[i]);
debug("%2d: %s.VQA", i, _outtakes[i].c_str());
}
#endif

@@ -272,8 +272,8 @@ bool AIScriptMcCoy::GoalChanged(int currentGoalNumber, int newGoalNumber) {
switch (newGoalNumber) {
case 0:
return true;
case 1:
sub_4058B0();
case kGoalMcCoyDodge:
dodge();
return true;
case 2:
sub_405920();
@@ -1258,7 +1258,7 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) {
return true;
case 15:
_animationState = 16;
_animationFrame = 16 - 16 * _animationFrame / 12;
_animationFrame = 16 - ((16 * _animationFrame) / 12);
return true;
case 16:
case 25:
@@ -1276,16 +1276,16 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) {
}
} else {
if (_animationFrame <= 6) {
int v3 = Random_Query(0, 2);
int v4 = 0;
if (v3 == 0) {
v4 = 595;
} else if (v3 == 1) {
v4 = 594;
} else if (v3 == 2) {
v4 = 593;
int random = Random_Query(0, 2);
int soundId = 0;
if (random == 0) {
soundId = 595;
} else if (random == 1) {
soundId = 594;
} else if (random == 2) {
soundId = 593;
}
Ambient_Sounds_Play_Sound(v4, 39, 0, 0, 99);
Ambient_Sounds_Play_Sound(soundId, 39, 0, 0, 99);
}
_animationState = 57;
_animationFrame = 0;
@@ -1333,7 +1333,7 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) {
break;
case 16:
_animationState = 15;
_animationFrame = 12 - 12 * _animationFrame / 16;
_animationFrame = 12 - ((12 * _animationFrame) / 16);
break;
case 17:
case 20:
@@ -1490,18 +1490,7 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) {
}
break;
case 20:
{
int setId = Actor_Query_Which_Set_In(kActorMcCoy);
if (setId == kSetCT02) {
_animationState = 51;
_animationFrame = 0;
Player_Loses_Control();
Game_Flag_Set(210);
} else if (setId == kSetRC03 || setId == kSetUG15) {
_animationState = 56;
_animationFrame = 0;
}
}
dodge();
break;
case kAnimationModeHit:
switch (_animationState) {
@@ -1815,13 +1804,13 @@ void AIScriptMcCoy::sub_405800() {
}
}

void AIScriptMcCoy::sub_4058B0() {
void AIScriptMcCoy::dodge() {
int setId = Actor_Query_Which_Set_In(kActorMcCoy);
if (setId == kSetCT02) {
_animationState = 51;
_animationFrame = 0;
Player_Loses_Control();
Game_Flag_Set(210);
Game_Flag_Set(kFlagCT02ZubenFled);
} else if (setId == kSetRC03 || setId == kSetUG15) {
_animationState = 56;
_animationFrame = 0;
@@ -35,7 +35,7 @@ void AIScriptTransient::Initialize() {

Actor_Put_In_Set(kActorTransient, kSetCT03_CT04);
Actor_Set_At_XYZ(kActorTransient, -171.41f, -621.3f, 736.52f, 580);
Actor_Set_Goal_Number(kActorTransient, 0);
Actor_Set_Goal_Number(kActorTransient, kGoalTransientDefault);
Actor_Set_Targetable(kActorTransient, true);
}

@@ -44,7 +44,7 @@ bool AIScriptTransient::Update() {
Actor_Put_In_Set(kActorTransient, kSetFreeSlotG);
Actor_Set_At_Waypoint(kActorTransient, 39, false);
}
if (Global_Variable_Query(kVariableChapter) == 2 && (Actor_Query_Goal_Number(kActorTransient) == 0 || Actor_Query_Goal_Number(kActorTransient) == 10)) {
if (Global_Variable_Query(kVariableChapter) == 2 && (Actor_Query_Goal_Number(kActorTransient) == kGoalTransientDefault || Actor_Query_Goal_Number(kActorTransient) == 10)) {
Actor_Set_Goal_Number(kActorTransient, 200);
}
if (Global_Variable_Query(kVariableChapter) == 3 && Game_Flag_Query(169) && Game_Flag_Query(170) && !Game_Flag_Query(171) && !Game_Flag_Query(172)) {
@@ -83,7 +83,7 @@ void AIScriptTransient::TimerExpired(int timer) {
}
}
if (timer == 1) {
if (Actor_Query_Goal_Number(kActorTransient) == 0) {
if (Actor_Query_Goal_Number(kActorTransient) == kGoalTransientDefault) {
Actor_Set_Goal_Number(kActorTransient, 10);
Actor_Change_Animation_Mode(kActorTransient, kAnimationModeIdle);
}
Oops, something went wrong.

0 comments on commit 2f0fb70

Please sign in to comment.