From 94858f738e199895d2551fd89b87460eb14ed4d2 Mon Sep 17 00:00:00 2001 From: antoniou79 Date: Fri, 16 Aug 2019 19:19:10 +0300 Subject: BLADERUNNER: Added cut generic walker models --- engines/bladerunner/script/ai/free_slot_a.cpp | 3 +- engines/bladerunner/script/ai/free_slot_b.cpp | 3 +- engines/bladerunner/script/ai/generic_walker_a.cpp | 71 +++++++++++++++++----- engines/bladerunner/script/ai/generic_walker_b.cpp | 47 ++++++++++++-- engines/bladerunner/script/ai/generic_walker_c.cpp | 48 +++++++++++++-- 5 files changed, 145 insertions(+), 27 deletions(-) (limited to 'engines/bladerunner/script/ai') diff --git a/engines/bladerunner/script/ai/free_slot_a.cpp b/engines/bladerunner/script/ai/free_slot_a.cpp index eaee3e1bfb..441100bf7d 100644 --- a/engines/bladerunner/script/ai/free_slot_a.cpp +++ b/engines/bladerunner/script/ai/free_slot_a.cpp @@ -466,7 +466,8 @@ bool AIScriptFreeSlotA::UpdateAnimation(int *animation, int *frame) { break; case 5: - // a bug? This is an animation for Maggie (exploding) + // This is an animation for Maggie (exploding) but is also used for generic death states (rats, generic walkers) + // probably for debug purposes *animation = 874; _animationFrame++; if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(874) - 1) { diff --git a/engines/bladerunner/script/ai/free_slot_b.cpp b/engines/bladerunner/script/ai/free_slot_b.cpp index 1124d283ec..c3014b83e3 100644 --- a/engines/bladerunner/script/ai/free_slot_b.cpp +++ b/engines/bladerunner/script/ai/free_slot_b.cpp @@ -329,7 +329,8 @@ bool AIScriptFreeSlotB::UpdateAnimation(int *animation, int *frame) { break; case 5: - // a bug? This is an animation for Maggie (exploding) + // This is an animation for Maggie (exploding) but is also used for generic death states (rats, generic walkers) + // probably for debug purposes *animation = 874; _animationFrame++; if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(874) - 1) { diff --git a/engines/bladerunner/script/ai/generic_walker_a.cpp b/engines/bladerunner/script/ai/generic_walker_a.cpp index 6cb363991e..d1e0d0469e 100644 --- a/engines/bladerunner/script/ai/generic_walker_a.cpp +++ b/engines/bladerunner/script/ai/generic_walker_a.cpp @@ -140,7 +140,7 @@ void AIScriptGenericWalkerA::ClickedByPlayer() { Actor_Says(kActorMcCoy, 1085, 3); break; case 9: - Actor_Says(kActorMcCoy, 365, 3); + Actor_Says(kActorMcCoy, 365, 3); // Re-used line, same as case 1 break; case 10: Actor_Says(kActorMcCoy, 7415, 3); @@ -220,45 +220,77 @@ bool AIScriptGenericWalkerA::UpdateAnimation(int *animation, int *frame) { case kGenericWalkerAStatesIdle: switch (Global_Variable_Query(kVariableGenericWalkerAModel)) { case 0: - *animation = 426; + *animation = 426; // Hatted Person with umbrella still break; case 1: - *animation = 430; + *animation = 430; // Hooded person with umbrella still break; case 2: - *animation = 437; + *animation = 437; // Hatted lady with wooden umbrella still (different from 436 model!) break; case 3: - *animation = 431; + *animation = 431; // Person with glasses and beard still break; case 4: - *animation = 427; + *animation = 427; // Hatted Person without umbrella still break; case 5: - *animation = 433; + *animation = 433; // Punk person with glasses still + break; + case 6: + *animation = 434; // Hatted child walking // frame 11 could be used for still + _animationFrame = 11; + break; + case 7: + *animation = 435; // Child walking // frame 5 could be used for still + _animationFrame = 5; + break; + case 8: + *animation = 422; // Hatted person walking fast // frame 1 could be used for still + _animationFrame = 1; + break; + case 9: + *animation = 423; // Hatted person walking lowered face // frame 6 could be used for still + _animationFrame = 6; break; } - _animationFrame = 0; + if (!_vm->_cutContent + || Global_Variable_Query(kVariableGenericWalkerAModel) < 6 + ) { + _animationFrame = 0; + } break; case kGenericWalkerAStatesWalk: switch (Global_Variable_Query(kVariableGenericWalkerAModel)) { case 0: - *animation = 424; + *animation = 424; // Hatted person with umbrella walking break; case 1: - *animation = 428; + *animation = 428; // Hooded person with umbrella walking break; case 2: - *animation = 436; + *animation = 436; // Hatted person with wooden umbrella walking break; case 3: - *animation = 429; + *animation = 429; // Person with glasses and beard walking break; case 4: - *animation = 425; + *animation = 425; // Hatted Person without umbrella - walking small steps break; case 5: - *animation = 432; + *animation = 432; // Punk person with glasses walking + break; + case 6: + *animation = 434; // Hatted child walking + break; + case 7: + *animation = 435; // Child walking + break; + case 8: + *animation = 422; // Hatted person walking fast + break; + case 9: + *animation = 423; // Hatted person walking lowered face break; } ++_animationFrame; @@ -267,6 +299,8 @@ bool AIScriptGenericWalkerA::UpdateAnimation(int *animation, int *frame) { } break; case kGenericWalkerAStatesDie: + // This is an animation for Maggie (exploding) but is also used for generic death states (rats, generic walkers) + // probably for debug purposes *animation = 874; ++_animationFrame; if (++_animationFrame >= Slice_Animation_Query_Number_Of_Frames(874)) @@ -373,10 +407,15 @@ bool AIScriptGenericWalkerA::prepareWalker() { int model = 0; do { if (isInside) { - model = Random_Query(3, 5); + model = Random_Query(3, 5); // 0, 1, 2 models have umbrellas so they should be in outdoors locations } else { - model = Random_Query(0, 5); + if (_vm->_cutContent) { + model = Random_Query(0, 9); + } else { + model = Random_Query(0, 5); + } } + // this while loop ensures choosing a different model for Walker A than the Walker B or Walker C } while (model == Global_Variable_Query(kVariableGenericWalkerBModel) || model == Global_Variable_Query(kVariableGenericWalkerCModel)); Global_Variable_Set(kVariableGenericWalkerAModel, model); diff --git a/engines/bladerunner/script/ai/generic_walker_b.cpp b/engines/bladerunner/script/ai/generic_walker_b.cpp index 8bd17fa92d..4f8d4d3d60 100644 --- a/engines/bladerunner/script/ai/generic_walker_b.cpp +++ b/engines/bladerunner/script/ai/generic_walker_b.cpp @@ -115,7 +115,7 @@ void AIScriptGenericWalkerB::ClickedByPlayer() { Actor_Says(kActorMcCoy, 1085, 3); break; case 9: - Actor_Says(kActorMcCoy, 365, 3); + Actor_Says(kActorMcCoy, 365, 3); // Re-used line, same as case 1 break; case 10: Actor_Says(kActorMcCoy, 7415, 3); @@ -201,8 +201,28 @@ bool AIScriptGenericWalkerB::UpdateAnimation(int *animation, int *frame) { case 5: *animation = 433; break; + case 6: + *animation = 434; // Hatted child walking // frame 11 could be used for still + _animationFrame = 11; + break; + case 7: + *animation = 435; // Child walking // frame 5 could be used for still + _animationFrame = 5; + break; + case 8: + *animation = 422; // Hatted person walking fast // frame 1 could be used for still + _animationFrame = 1; + break; + case 9: + *animation = 423; // Hatted person walking lowered face // frame 6 could be used for still + _animationFrame = 6; + break; + } + if (!_vm->_cutContent + || Global_Variable_Query(kVariableGenericWalkerAModel) < 6 + ) { + _animationFrame = 0; } - _animationFrame = 0; break; case kGenericWalkerBStatesWalk: switch (Global_Variable_Query(kVariableGenericWalkerBModel)) { @@ -224,6 +244,18 @@ bool AIScriptGenericWalkerB::UpdateAnimation(int *animation, int *frame) { case 5: *animation = 432; break; + case 6: + *animation = 434; // Hatted child walking + break; + case 7: + *animation = 435; // Child walking + break; + case 8: + *animation = 422; // Hatted person walking fast + break; + case 9: + *animation = 423; // Hatted person walking lowered face + break; } ++_animationFrame; if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) { @@ -231,6 +263,8 @@ bool AIScriptGenericWalkerB::UpdateAnimation(int *animation, int *frame) { } break; case kGenericWalkerBStatesDie: + // This is an animation for Maggie (exploding) but is also used for generic death states (rats, generic walkers) + // probably for debug purposes *animation = 874; ++_animationFrame; if (++_animationFrame >= Slice_Animation_Query_Number_Of_Frames(874)) @@ -326,10 +360,15 @@ bool AIScriptGenericWalkerB::prepareWalker() { int model = 0; do { if (isInside) { - model = Random_Query(3, 5); + model = Random_Query(3, 5); // 0, 1, 2 models have umbrellas so they should be in outdoors locations } else { - model = Random_Query(0, 5); + if (_vm->_cutContent) { + model = Random_Query(0, 9); + } else { + model = Random_Query(0, 5); + } } + // this while loop ensures choosing a different model for Walker B than the Walker A or Walker C } while (model == Global_Variable_Query(kVariableGenericWalkerAModel) || model == Global_Variable_Query(kVariableGenericWalkerCModel)); Global_Variable_Set(kVariableGenericWalkerBModel, model); diff --git a/engines/bladerunner/script/ai/generic_walker_c.cpp b/engines/bladerunner/script/ai/generic_walker_c.cpp index 159c57a319..b92cf71622 100644 --- a/engines/bladerunner/script/ai/generic_walker_c.cpp +++ b/engines/bladerunner/script/ai/generic_walker_c.cpp @@ -116,7 +116,7 @@ void AIScriptGenericWalkerC::ClickedByPlayer() { Actor_Says(kActorMcCoy, 1085, 3); break; case 9: - Actor_Says(kActorMcCoy, 365, 3); + Actor_Says(kActorMcCoy, 365, 3); // Re-used line, same as case 1 break; case 10: Actor_Says(kActorMcCoy, 7415, 3); @@ -202,8 +202,28 @@ bool AIScriptGenericWalkerC::UpdateAnimation(int *animation, int *frame) { case 5: *animation = 433; break; + case 6: + *animation = 434; // Hatted child walking // frame 11 could be used for still + _animationFrame = 11; + break; + case 7: + *animation = 435; // Child walking // frame 5 could be used for still + _animationFrame = 5; + break; + case 8: + *animation = 422; // Hatted person walking fast // frame 1 could be used for still + _animationFrame = 1; + break; + case 9: + *animation = 423; // Hatted person walking lowered face // frame 6 could be used for still + _animationFrame = 6; + break; + } + if (!_vm->_cutContent + || Global_Variable_Query(kVariableGenericWalkerAModel) < 6 + ) { + _animationFrame = 0; } - _animationFrame = 0; break; case kGenericWalkerCStatesWalk: switch (Global_Variable_Query(kVariableGenericWalkerCModel)) { @@ -225,6 +245,18 @@ bool AIScriptGenericWalkerC::UpdateAnimation(int *animation, int *frame) { case 5: *animation = 432; break; + case 6: + *animation = 434; // Hatted child walking + break; + case 7: + *animation = 435; // Child walking + break; + case 8: + *animation = 422; // Hatted person walking fast + break; + case 9: + *animation = 423; // Hatted person walking lowered face + break; } ++_animationFrame; if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) { @@ -232,6 +264,8 @@ bool AIScriptGenericWalkerC::UpdateAnimation(int *animation, int *frame) { } break; case kGenericWalkerCStatesDie: + // This is an animation for Maggie (exploding) but is also used for generic death states (rats, generic walkers) + // probably for debug purposes *animation = 874; ++_animationFrame; if (++_animationFrame >= Slice_Animation_Query_Number_Of_Frames(874)) @@ -327,11 +361,15 @@ bool AIScriptGenericWalkerC::prepareWalker() { int model = 0; do { if (isInside) { - model = Random_Query(3, 5); + model = Random_Query(3, 5); // 0, 1, 2 models have umbrellas so they should be in outdoors locations } else { - model = Random_Query(0, 5); + if (_vm->_cutContent) { + model = Random_Query(0, 9); + } else { + model = Random_Query(0, 5); + } } - // Here is probably bug in original code, because it not using kVariableGenericWalkerBModel but kVariableGenericWalkerCModel + // this while loop ensures choosing a different model for Walker C than the Walker A or Walker B } while (model == Global_Variable_Query(kVariableGenericWalkerAModel) || model == Global_Variable_Query(kVariableGenericWalkerBModel)); -- cgit v1.2.3