BLADERUNNER: Methods for debugging animations

This commit is contained in:
antoniou79 2023-07-05 14:57:58 +03:00
parent ea23048d60
commit 0f7ee148ea
65 changed files with 477 additions and 82 deletions

View File

@ -202,6 +202,16 @@ void Actor::changeAnimationMode(int animationMode, bool force) {
}
}
// New for debugging purposes
void Actor::changeAnimationState(int animationState, int animationFrame, int animationStateNext, int animationNext) {
_vm->_aiScripts->setAnimationState(_id, animationState, animationFrame, animationStateNext, animationNext);
}
// New for debugging purposes
void Actor::queryAnimationState(int *animationState, int *animationFrame, int *animationStateNext, int *animationNext) {
_vm->_aiScripts->queryAnimationState(_id, animationState, animationFrame, animationStateNext, animationNext);
}
int Actor::getFPS() const {
return _fps;
}

View File

@ -139,6 +139,8 @@ public:
Vector3 getPosition() const { return _position; }
void changeAnimationMode(int animationMode, bool force = false);
void changeAnimationState(int animationState, int animationFrame, int animationStateNext, int animationNext); // new for debugging purposes
void queryAnimationState(int *animationState, int *animationFrame, int *animationStateNext, int *animationNext); // new for debugging purposes
int getFPS() const;
void setFPS(int fps);
void increaseFPS();

View File

@ -57,7 +57,8 @@ namespace BladeRunner {
enum DebugLevels {
kDebugScript = 1 << 0,
kDebugSound = 1 << 1
kDebugSound = 1 << 1,
kDebugAnimation = 1 << 2
};
class Actor;

View File

@ -154,6 +154,78 @@ Debugger::~Debugger() {
}
}
const struct AnimationsList {
Actors actorId;
int animationModelIdStart;
int animationModelIdEnd;
int animationModelIdSpecial; // for characters that use an animation outside their "own" range (eg. kActorGenwalkerA using Bob's Gun)
int animationModeMax;
int animationStateMax;
} animationsList[] = {
{ kActorMcCoy, 0, 53, -1, 85, 71 },
{ kActorSteele, 54, 92, -1, 86, 41 },
{ kActorGordo, 93, 133, -1, 84, 39 },
{ kActorDektora, 134, 171, -1, 79, 41 },
{ kActorGuzza, 172, 207, -1, 61, 32 },
{ kActorClovis, 208, 252, -1, 88, 42 },
{ kActorLucy, 253, 276, -1, 48, 21 },
{ kActorIzo, 277, 311, -1, 48, 35 },
{ kActorSadik, 312, 345, -1, 63, 34 },
{ kActorLuther, 346, 359, -1, 50, 12 },
{ kActorEarlyQ, 360, 387, -1, 85, 28 },
{ kActorZuben, 388, 421, -1, 49, 28 },
{ kActorGenwalkerA, 422, 437, 440, 4, 3 },
{ kActorGenwalkerB, 422, 437, -1, 1, 2 },
{ kActorGenwalkerC, 422, 437, -1, 1, 2 },
{ kActorHysteriaPatron3, 438, 439, -1, -1, 2 },
// skip animations 441-450 that refer to targets in shooting range (which are items kItemPS10Target1 to kItemPS10Target9)
{ kActorBaker, 451, 451, -1, -1, 0 },
{ kActorCrazylegs, 452, 469, -1, 43, 19 },
{ kActorGrigorian, 470, 486, -1, 16, 7 },
{ kActorTransient, 487, 505, -1, 89, 19 },
{ kActorBulletBob, 506, 525, -1, 88, 16 },
{ kActorRunciter, 526, 544, -1, 48, 15 },
{ kActorInsectDealer, 545, 554, -1, 23, 8 },
{ kActorTyrellGuard, 555, 565, -1, 55, 11 },
{ kActorMia, 566, 570, -1, 23, 4 },
{ kActorOfficerLeary, 571, 604, -1, 58, 32 },
{ kActorOfficerGrayford, 605, 641, -1, 58, 37 },
{ kActorHanoi, 642, 660, -1, 78, 20 },
{ kActorDeskClerk, 661, 670, -1, 72, 8 },
{ kActorHowieLee, 671, 681, -1, 43, 8 },
{ kActorFishDealer, 682, 687, -1, 23, 5 },
{ kActorKlein, 688, 697, -1, 16, 8 },
{ kActorMurray, 698, 704, -1, 15, 6 },
{ kActorHawkersBarkeep, 705, 715, -1, 16, 9 },
{ kActorHolloway, 716, 721, -1, 15, 7 },
{ kActorSergeantWalls, 722, 731, -1, 23, 9 },
{ kActorMoraji, 732, 743, -1, 48, 14 },
{ kActorPhotographer, 744, 750, -1, 43, 6 },
{ kActorRajif, 751, 751, -1, 0, 0 },
{ kActorEarlyQBartender, 752, 757, -1, 23, 4 },
{ kActorShoeshineMan, 758, 764, -1, 29, 6 },
{ kActorTyrell, 765, 772, -1, 15, 6 },
{ kActorChew, 773, 787, -1, 48, 13 },
{ kActorGaff, 788, 804, -1, 41, 8 },
{ kActorBryant, 805, 808, -1, 48, 3 },
{ kActorSebastian, 809, 821, -1, 48, 11 },
{ kActorRachael, 822, 832, -1, 18, 9 },
{ kActorGeneralDoll, 833, 837, -1, 48, 4 },
{ kActorIsabella, 838, 845, -1, 17, 9 },
{ kActorLeon, 846, 856, -1, 72, 10 },
{ kActorFreeSlotA, 857, 862, -1, 48, 8 },
{ kActorFreeSlotB, 857, 862, -1, 48, 8 },
{ kActorMaggie, 863, 876, -1, 88, 16 },
{ kActorHysteriaPatron1, 877, 884, -1, -1, 26 },
{ kActorHysteriaPatron2, 885, 892, -1, -1, 29 },
{ kActorMutant1, 893, 900, -1, 88, 10 },
{ kActorMutant2, 901, 907, -1, 88, 8 },
{ kActorMutant3, 908, 917, -1, 88, 11 },
{ kActorTaffyPatron, 918, 919, -1, 48, 2 },
{ kActorHasan, 920, 930, -1, 16, 6 }
// skip animations 931-996 which refer to item models/animations
};
bool Debugger::cmdAnimation(int argc, const char **argv) {
if (argc != 2 && argc != 4) {
debugPrintf("Get or set animation mode of the actor.\n");
@ -182,7 +254,23 @@ bool Debugger::cmdAnimation(int argc, const char **argv) {
return false;
}
debugPrintf("actorAnimationMode(%i) = %i, showDamageWhenMoving = %i, inCombat = %i\n", actorId, actor->getAnimationMode(), actor->getFlagDamageAnimIfMoving(), actor->inCombat());
int animationState = -1;
int animationFrame = -1;
int animationStateNext = -1;
int animationNext = -1;
actor->queryAnimationState(&animationState, &animationFrame, &animationStateNext, &animationNext);
debugPrintf("actorAnimationMode(%s) = %i, model: %i, goal: %i, state:%i, frame:%i, stateNext: %i, nextModelId: %i, showDamageWhenMoving = %i, inCombat = %i\n",
_vm->_textActorNames->getText(actorId),
actor->getAnimationMode(),
actor->getAnimationId(),
actor->getGoal(),
animationState,
animationFrame,
animationStateNext,
animationNext,
actor->getFlagDamageAnimIfMoving(),
actor->inCombat());
return true;
}
@ -750,8 +838,9 @@ const struct SceneList {
{ 4, "TB03", 17, 83 }, { 4, "TB07", 18, 108 }, { 4, "UG01", 74, 86 }, { 4, "UG02", 75, 87 },
{ 4, "UG03", 76, 88 }, { 4, "UG04", 77, 89 }, { 4, "UG05", 78, 90 }, { 4, "UG06", 79, 91 },
{ 4, "UG07", 80, 92 }, { 4, "UG08", 81, 93 }, { 4, "UG09", 82, 94 }, { 4, "UG10", 83, 95 },
{ 4, "UG12", 84, 96 }, { 4, "UG13", 85, 97 }, { 4, "UG14", 86, 98 }, { 4, "UG15", 87, 99 },
{ 4, "UG16", 19, 100 }, { 4, "UG17", 88, 101 }, { 4, "UG18", 89, 102 }, { 4, "UG19", 90, 103 },
{ 4, "UG12", 84, 96 }, { 4, "UG12", 6, 96 }, { 4, "UG13", 85, 97 }, { 4, "UG14", 86, 98 },
{ 4, "UG15", 87, 99 }, { 4, "UG16", 19, 100 }, { 4, "UG17", 88, 101 }, { 4, "UG18", 89, 102 },
{ 4, "UG19", 90, 103 },
{ 0, nullptr, 0, 0 }
};

View File

@ -34,6 +34,7 @@
static const DebugChannelDef debugFlagList[] = {
{BladeRunner::kDebugScript, "Script", "Debug the scripts"},
{BladeRunner::kDebugSound, "Sound", "Debug the sound"},
{BladeRunner::kDebugAnimation, "Animation", "Debug the model animations"},
DEBUG_CHANNEL_END
};

View File

@ -97,6 +97,7 @@ bool AIScriptBaker::UpdateAnimation(int *animation, int *frame) {
}
bool AIScriptBaker::ChangeAnimationMode(int mode) {
debugC(6, kDebugAnimation, "AIScriptBaker::ChangeAnimationMode(%d) - Animation mode change is not supported", mode);
return true;
}

View File

@ -262,6 +262,7 @@ bool AIScriptBryant::UpdateAnimation(int *animation, int *frame) {
break;
default:
debugC(6, kDebugAnimation, "AIScriptBryant::UpdateAnimation() - Current _animationState (%d) is not supported", _animationState);
break;
}
@ -288,6 +289,7 @@ bool AIScriptBryant::ChangeAnimationMode(int mode) {
break;
default:
debugC(6, kDebugAnimation, "AIScriptBryant::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}
return true;

View File

@ -438,6 +438,7 @@ bool AIScriptBulletBob::UpdateAnimation(int *animation, int *frame) {
break;
default:
debugC(6, kDebugAnimation, "AIScriptBulletBob::UpdateAnimation() - Current _animationState (%d) is not supported", _animationState);
break;
}
*frame = _animationFrame;
@ -564,6 +565,7 @@ bool AIScriptBulletBob::ChangeAnimationMode(int mode) {
default:
_animationState = 0;
_animationFrame = 0;
debugC(6, kDebugAnimation, "AIScriptBulletBob::ChangeAnimationMode(%d) - Target mode is treated as default, state and frame are set to 0", mode);
break;
}
return true;

View File

@ -302,6 +302,7 @@ bool AIScriptChew::UpdateAnimation(int *animation, int *frame) {
break;
default:
debugC(6, kDebugAnimation, "AIScriptChew::UpdateAnimation() - Current _animationState (%d) is not supported", _animationState);
break;
}
*frame = _animationFrame;
@ -472,6 +473,7 @@ bool AIScriptChew::ChangeAnimationMode(int mode) {
break;
default:
debugC(6, kDebugAnimation, "AIScriptChew::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}

View File

@ -1263,6 +1263,7 @@ bool AIScriptClovis::UpdateAnimation(int *animation, int *frame) {
break;
default:
debugC(6, kDebugAnimation, "AIScriptClovis::UpdateAnimation() - Current _animationState (%d) is not supported", _animationState);
break;
}
*frame = _animationFrame;
@ -1543,6 +1544,7 @@ bool AIScriptClovis::ChangeAnimationMode(int mode) {
break;
default:
debugC(6, kDebugAnimation, "AIScriptClovis::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}

View File

@ -354,6 +354,7 @@ bool AIScriptCrazylegs::UpdateAnimation(int *animation, int *frame) {
break;
default:
debugC(6, kDebugAnimation, "AIScriptCrazylegs::UpdateAnimation() - Current _animationState (%d) is not supported", _animationState);
break;
}
*frame = _animationFrame;
@ -491,6 +492,7 @@ bool AIScriptCrazylegs::ChangeAnimationMode(int mode) {
break;
default:
debugC(6, kDebugAnimation, "AIScriptCrazylegs::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}

View File

@ -1138,6 +1138,7 @@ bool AIScriptDektora::UpdateAnimation(int *animation, int *frame) {
break;
default:
debugC(6, kDebugAnimation, "AIScriptDektora::UpdateAnimation() - Current _animationState (%d) is not supported", _animationState);
break;
}
*frame = _animationFrame;
@ -1497,6 +1498,7 @@ bool AIScriptDektora::ChangeAnimationMode(int mode) {
break;
default:
debugC(6, kDebugAnimation, "AIScriptDektora::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}
return true;

View File

@ -288,6 +288,10 @@ bool AIScriptDeskClerk::UpdateAnimation(int *animation, int *frame) {
_animationState = 0;
}
break;
default:
debugC(6, kDebugAnimation, "AIScriptDeskClerk::UpdateAnimation() - Current _animationState (%d) is not supported", _animationState);
break;
}
*frame = _animationFrame;
@ -375,6 +379,10 @@ bool AIScriptDeskClerk::ChangeAnimationMode(int mode) {
_animationFrame = 0;
}
break;
default:
debugC(6, kDebugAnimation, "AIScriptDeskClerk::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}
return true;

View File

@ -837,6 +837,7 @@ bool AIScriptEarlyQ::UpdateAnimation(int *animation, int *frame) {
break;
default:
debugC(6, kDebugAnimation, "AIScriptEarlyQ::UpdateAnimation() - Current _animationState (%d) is not supported", _animationState);
break;
}
*frame = _animationFrame;
@ -1056,7 +1057,8 @@ bool AIScriptEarlyQ::ChangeAnimationMode(int mode) {
break;
default:
return true;
debugC(6, kDebugAnimation, "AIScriptEarlyQ::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}
return true;

View File

@ -187,6 +187,7 @@ bool AIScriptEarlyQBartender::UpdateAnimation(int *animation, int *frame) {
break;
default:
debugC(6, kDebugAnimation, "AIScriptEarlyQBartender::UpdateAnimation() - Current _animationState (%d) is not supported", _animationState);
break;
}
*frame = _animationFrame;
@ -227,6 +228,7 @@ bool AIScriptEarlyQBartender::ChangeAnimationMode(int mode) {
break;
default:
debugC(6, kDebugAnimation, "AIScriptEarlyQBartender::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}

View File

@ -255,6 +255,7 @@ bool AIScriptFishDealer::UpdateAnimation(int *animation, int *frame) {
break;
default:
debugC(6, kDebugAnimation, "AIScriptFishDealer::UpdateAnimation() - Current _animationState (%d) is not supported", _animationState);
break;
}
@ -312,6 +313,7 @@ bool AIScriptFishDealer::ChangeAnimationMode(int mode) {
break;
default:
debugC(6, kDebugAnimation, "AIScriptFishDealer::ChangeAnimationMode(%d) - Target mode is not supported", mode);
return true;
}

View File

@ -539,6 +539,7 @@ bool AIScriptFreeSlotA::UpdateAnimation(int *animation, int *frame) {
break;
default:
debugC(6, kDebugAnimation, "AIScriptFreeSlotA::UpdateAnimation() - Current _animationState (%d) is not supported", _animationState);
break;
}
*frame = _animationFrame;
@ -547,7 +548,7 @@ bool AIScriptFreeSlotA::UpdateAnimation(int *animation, int *frame) {
bool AIScriptFreeSlotA::ChangeAnimationMode(int mode) {
switch (mode) {
case 0:
case kAnimationModeIdle:
if ((unsigned int)(_animationState - 1) > 1) {
_animationState = 0;
_animationFrame = 0;
@ -556,7 +557,7 @@ bool AIScriptFreeSlotA::ChangeAnimationMode(int mode) {
}
break;
case 1:
case kAnimationModeWalk:
_animationState = 3;
_animationFrame = 0;
break;
@ -599,6 +600,10 @@ bool AIScriptFreeSlotA::ChangeAnimationMode(int mode) {
_animationState = 7;
_animationFrame = 0;
break;
default:
debugC(6, kDebugAnimation, "AIScriptFreeSlotA::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}
return true;
}

View File

@ -400,6 +400,7 @@ bool AIScriptFreeSlotB::UpdateAnimation(int *animation, int *frame) {
break;
default:
debugC(6, kDebugAnimation, "AIScriptFreeSlotB::UpdateAnimation() - Current _animationState (%d) is not supported", _animationState);
break;
}
*frame = _animationFrame;
@ -408,7 +409,7 @@ bool AIScriptFreeSlotB::UpdateAnimation(int *animation, int *frame) {
bool AIScriptFreeSlotB::ChangeAnimationMode(int mode) {
switch (mode) {
case 0:
case kAnimationModeIdle:
if ((unsigned int)(_animationState - 1) > 1) {
_animationState = 0;
_animationFrame = 0;
@ -417,7 +418,7 @@ bool AIScriptFreeSlotB::ChangeAnimationMode(int mode) {
}
break;
case 1:
case kAnimationModeWalk:
_animationState = 3;
_animationFrame = 0;
break;
@ -460,6 +461,10 @@ bool AIScriptFreeSlotB::ChangeAnimationMode(int mode) {
_animationState = 7;
_animationFrame = 0;
break;
default:
debugC(6, kDebugAnimation, "AIScriptFreeSlotB::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}
return true;

View File

@ -426,6 +426,7 @@ bool AIScriptGaff::UpdateAnimation(int *animation, int *frame) {
default:
// Dummy placeholder, kModelAnimationZubenWalking (399) is a Zuben animation
*animation = kModelAnimationZubenWalking;
debugC(6, kDebugAnimation, "AIScriptGaff::UpdateAnimation() - Current _animationState (%d) is a placeholder", _animationState);
break;
}
*frame = _animationFrame;
@ -480,6 +481,10 @@ bool AIScriptGaff::ChangeAnimationMode(int mode) {
_animationState = 8;
_animationFrame = 0;
break;
default:
debugC(6, kDebugAnimation, "AIScriptGaff::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}
return true;
}

View File

@ -61,6 +61,8 @@ bool AIScriptGeneralDoll::Update() {
void AIScriptGeneralDoll::TimerExpired(int timer) {
if (timer == kActorTimerAIScriptCustomTask2) {
// TODO A BUG? McCoy dies here too (it's in original this way also)
// This is untriggered, so it could be leftover or debug code
Actor_Change_Animation_Mode(kActorMcCoy, kAnimationModeDie);
Actor_Change_Animation_Mode(kActorGeneralDoll, kAnimationModeDie);
AI_Countdown_Timer_Reset(kActorGeneralDoll, kActorTimerAIScriptCustomTask2);
@ -337,6 +339,7 @@ bool AIScriptGeneralDoll::UpdateAnimation(int *animation, int *frame) {
break;
default:
debugC(6, kDebugAnimation, "AIScriptGeneralDoll::UpdateAnimation() - Current _animationState (%d) is not supported", _animationState);
break;
}
*frame = _animationFrame;
@ -346,7 +349,7 @@ bool AIScriptGeneralDoll::UpdateAnimation(int *animation, int *frame) {
bool AIScriptGeneralDoll::ChangeAnimationMode(int mode) {
switch (mode) {
case 0:
case kAnimationModeIdle:
if (_animationState == 1) {
_resumeIdleAfterFramesetCompletesFlag = true;
} else {
@ -355,12 +358,12 @@ bool AIScriptGeneralDoll::ChangeAnimationMode(int mode) {
}
break;
case 1:
case kAnimationModeWalk:
_animationState = 2;
_animationFrame = 0;
break;
case 3:
case kAnimationModeTalk:
_animationState = 1;
_animationFrame = 0;
_resumeIdleAfterFramesetCompletesFlag = false;
@ -375,6 +378,10 @@ bool AIScriptGeneralDoll::ChangeAnimationMode(int mode) {
_animationState = 4;
_animationFrame = 0;
break;
default:
debugC(6, kDebugAnimation, "AIScriptGeneralDoll::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}
return true;

View File

@ -338,6 +338,7 @@ bool AIScriptGenericWalkerA::UpdateAnimation(int *animation, int *frame) {
case kGenericWalkerAStatesDie:
// This is an animation for Maggie (exploding) but is also used for generic death states (rats, generic walkers)
// probably for debug purposes
debugC(6, kDebugAnimation, "AIScriptGenericWalkerA::UpdateAnimation() - Current _animationState (%d) is placeholder", _animationState);
*animation = kModelAnimationMaggieExploding;
++_animationFrame;
if (++_animationFrame >= Slice_Animation_Query_Number_Of_Frames(kModelAnimationMaggieExploding))
@ -351,6 +352,7 @@ bool AIScriptGenericWalkerA::UpdateAnimation(int *animation, int *frame) {
break;
case kGenericWalkerAStatesGun:
debugC(6, kDebugAnimation, "AIScriptGenericWalkerA::UpdateAnimation() - Current _animationState (%d) is special (bob's gun)", _animationState);
*animation = kModelAnimationBulletBobsTrackingGun;
++_animationFrame;
if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(kModelAnimationBulletBobsTrackingGun)) {
@ -382,6 +384,10 @@ bool AIScriptGenericWalkerA::ChangeAnimationMode(int mode) {
_animationState = kGenericWalkerAStatesGun;
_animationFrame = 0;
break;
default:
debugC(6, kDebugAnimation, "AIScriptGenericWalkerA::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}
return true;
}

View File

@ -303,8 +303,7 @@ bool AIScriptGenericWalkerB::UpdateAnimation(int *animation, int *frame) {
// probably for debug purposes
*animation = kModelAnimationMaggieExploding;
++_animationFrame;
if (++_animationFrame >= Slice_Animation_Query_Number_Of_Frames(kModelAnimationMaggieExploding))
{
if (++_animationFrame >= Slice_Animation_Query_Number_Of_Frames(kModelAnimationMaggieExploding)) {
_animationFrame = 0;
Actor_Set_Goal_Number(kActorGenwalkerB, kGoalGenwalkerDefault);
_animationState = kGenericWalkerBStatesIdle;
@ -312,6 +311,10 @@ bool AIScriptGenericWalkerB::UpdateAnimation(int *animation, int *frame) {
deltaZ = 0.0f;
}
break;
default:
debugC(6, kDebugAnimation, "AIScriptGenericWalkerB::UpdateAnimation() - Current _animationState (%d) is not supported", _animationState);
break;
}
*frame = _animationFrame;
return true;
@ -332,6 +335,10 @@ bool AIScriptGenericWalkerB::ChangeAnimationMode(int mode) {
_animationState = kGenericWalkerBStatesWalk;
_animationFrame = 0;
break;
default:
debugC(6, kDebugAnimation, "AIScriptGenericWalkerB::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}
return true;
}

View File

@ -312,6 +312,10 @@ bool AIScriptGenericWalkerC::UpdateAnimation(int *animation, int *frame) {
deltaZ = 0.0f;
}
break;
default:
debugC(6, kDebugAnimation, "AIScriptGenericWalkerC::UpdateAnimation() - Current _animationState (%d) is not supported", _animationState);
break;
}
*frame = _animationFrame;
return true;
@ -332,6 +336,10 @@ bool AIScriptGenericWalkerC::ChangeAnimationMode(int mode) {
_animationState = kGenericWalkerCStatesWalk;
_animationFrame = 0;
break;
default:
debugC(6, kDebugAnimation, "AIScriptGenericWalkerC::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}
return true;
}

View File

@ -1245,6 +1245,10 @@ bool AIScriptGordo::UpdateAnimation(int *animation, int *frame) {
_animationState = 24;
}
break;
default:
debugC(6, kDebugAnimation, "AIScriptGordo::UpdateAnimation() - Current _animationState (%d) is not supported", _animationState);
break;
}
*frame = _animationFrame;
return true;
@ -1614,6 +1618,10 @@ bool AIScriptGordo::ChangeAnimationMode(int mode) {
_animationState = 39;
_animationFrame = 0;
break;
default:
debugC(6, kDebugAnimation, "AIScriptGordo::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}
return true;
}

View File

@ -221,6 +221,7 @@ bool AIScriptGrigorian::UpdateAnimation(int *animation, int *frame) {
default:
// Dummy placeholder, kModelAnimationZubenWalking (399) is a Zuben animation
*animation = kModelAnimationZubenWalking;
debugC(6, kDebugAnimation, "AIScriptGrigorian::UpdateAnimation() - Current _animationState (%d) is a placeholder", _animationState);
break;
}
*frame = _animationFrame;
@ -271,6 +272,10 @@ bool AIScriptGrigorian::ChangeAnimationMode(int mode) {
_animationState = 7;
_animationFrame = 0;
break;
default:
debugC(6, kDebugAnimation, "AIScriptGrigorian::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}
return true;
}

View File

@ -789,6 +789,7 @@ bool AIScriptGuzza::UpdateAnimation(int *animation, int *frame) {
default:
// Dummy placeholder, kModelAnimationZubenWalking (399) is a Zuben animation
*animation = kModelAnimationZubenWalking;
debugC(6, kDebugAnimation, "AIScriptGuzza::UpdateAnimation() - Current _animationState (%d) is a placeholder", _animationState);
break;
}
*frame = _animationFrame;
@ -1085,6 +1086,10 @@ bool AIScriptGuzza::ChangeAnimationMode(int mode) {
_animationState = 33;
_animationFrame = 0;
break;
default:
debugC(6, kDebugAnimation, "AIScriptGuzza::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}
return true;
}

View File

@ -643,6 +643,7 @@ bool AIScriptHanoi::UpdateAnimation(int *animation, int *frame) {
break;
default:
debugC(6, kDebugAnimation, "AIScriptHanoi::UpdateAnimation() - Current _animationState (%d) is not supported", _animationState);
break;
}
*frame = _animationFrame;
@ -767,6 +768,10 @@ bool AIScriptHanoi::ChangeAnimationMode(int mode) {
_animationState = 6;
_animationFrame = 16;
break;
default:
debugC(6, kDebugAnimation, "AIScriptHanoi::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}
return true;

View File

@ -356,6 +356,7 @@ bool AIScriptHasan::UpdateAnimation(int *animation, int *frame) {
break;
default:
debugC(6, kDebugAnimation, "AIScriptHasan::UpdateAnimation() - Current _animationState (%d) is not supported", _animationState);
break;
}
*frame = _animationFrame;
@ -392,6 +393,7 @@ bool AIScriptHasan::ChangeAnimationMode(int mode) {
break;
default:
debugC(6, kDebugAnimation, "AIScriptHasan::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}
return true;

View File

@ -327,6 +327,7 @@ bool AIScriptHawkersBarkeep::UpdateAnimation(int *animation, int *frame) {
break;
default:
debugC(6, kDebugAnimation, "AIScriptHawkersBarkeep::UpdateAnimation() - Current _animationState (%d) is not supported", _animationState);
break;
}
@ -419,6 +420,7 @@ bool AIScriptHawkersBarkeep::ChangeAnimationMode(int mode) {
break;
default:
debugC(6, kDebugAnimation, "AIScriptHawkersBarkeep::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}

View File

@ -271,6 +271,7 @@ bool AIScriptHolloway::UpdateAnimation(int *animation, int *frame) {
break;
default:
debugC(6, kDebugAnimation, "AIScriptHolloway::UpdateAnimation() - Current _animationState (%d) is not supported", _animationState);
break;
}
*frame = _animationFrame;
@ -330,6 +331,7 @@ bool AIScriptHolloway::ChangeAnimationMode(int mode) {
break;
default:
debugC(6, kDebugAnimation, "AIScriptHolloway::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}

View File

@ -444,6 +444,7 @@ bool AIScriptHowieLee::UpdateAnimation(int *animation, int *frame) {
default:
// Dummy placeholder, kModelAnimationZubenWalking (399) is a Zuben animation
*animation = kModelAnimationZubenWalking;
debugC(6, kDebugAnimation, "AIScriptHowieLee::UpdateAnimation() - Current _animationState (%d) is a placeholder", _animationState);
break;
}
*frame = _animationFrame;
@ -503,6 +504,10 @@ bool AIScriptHowieLee::ChangeAnimationMode(int mode) {
_animationState = 1;
_animationFrame = 0;
break;
default:
debugC(6, kDebugAnimation, "AIScriptHowieLee::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}
return true;
}

View File

@ -140,6 +140,7 @@ bool AIScriptHysteriaPatron1::UpdateAnimation(int *animation, int *frame) {
}
bool AIScriptHysteriaPatron1::ChangeAnimationMode(int mode) {
debugC(6, kDebugAnimation, "AIScriptHysteriaPatron1::ChangeAnimationMode(%d) - Animation mode change is not supported", mode);
return true;
}

View File

@ -125,6 +125,7 @@ bool AIScriptHysteriaPatron2::UpdateAnimation(int *animation, int *frame) {
}
bool AIScriptHysteriaPatron2::ChangeAnimationMode(int mode) {
debugC(6, kDebugAnimation, "AIScriptHysteriaPatron2::ChangeAnimationMode(%d) - Animation mode change is not supported", mode);
return true;
}

View File

@ -106,31 +106,35 @@ const int animationList[kAnimationsCount] = {
bool AIScriptHysteriaPatron3::UpdateAnimation(int *animation, int *frame) {
if (_vm->_cutContent) {
*animation = animationList[_animationState];
if (_animationState == 2) {
--_animationFrame;
if (_animationFrame == 0) {
_animationState = Random_Query(0, 1); // restart the cycle from 0 or 1 state
_animationFrame = 0;
*animation = animationList[_animationState];
}
if (_animationState >= kAnimationsCount) {
debugC(6, kDebugAnimation, "AIScriptHysteriaPatron3::UpdateAnimation() - Current _animationState (%d) is not supported", _animationState);
} else {
++_animationFrame;
if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) {
_animationFrame = 0;
*animation = animationList[_animationState];
if (_animationState == 0 && Random_Query(0, 2) == 0) {
_animationState = 0; // restart same 0 state, with a small random chance
} else {
++_animationState;
if (_animationState == 2) {
_animationFrame = Slice_Animation_Query_Number_Of_Frames(animationList[_animationState]) - 1;
} else if (_animationState >= kAnimationsCount) {
_animationState = Random_Query(0, 1); // restart the cycle from 0 or 1 state
}
if (_animationState == 2) {
--_animationFrame;
if (_animationFrame == 0) {
_animationState = Random_Query(0, 1); // restart the cycle from 0 or 1 state
_animationFrame = 0;
*animation = animationList[_animationState];
}
} else {
++_animationFrame;
if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(*animation)) {
_animationFrame = 0;
if (_animationState == 0 && Random_Query(0, 2) == 0) {
_animationState = 0; // restart same 0 state, with a small random chance
} else {
++_animationState;
if (_animationState == 2) {
_animationFrame = Slice_Animation_Query_Number_Of_Frames(animationList[_animationState]) - 1;
} else if (_animationState >= kAnimationsCount) {
_animationState = Random_Query(0, 1); // restart the cycle from 0 or 1 state
}
}
*animation = animationList[_animationState];
}
*animation = animationList[_animationState];
}
}
*frame = _animationFrame;
@ -139,6 +143,7 @@ bool AIScriptHysteriaPatron3::UpdateAnimation(int *animation, int *frame) {
}
bool AIScriptHysteriaPatron3::ChangeAnimationMode(int mode) {
debugC(6, kDebugAnimation, "AIScriptHysteriaPatron3::ChangeAnimationMode(%d) - Animation mode change is not supported", mode);
return true;
}

View File

@ -262,6 +262,10 @@ bool AIScriptInsectDealer::UpdateAnimation(int *animation, int *frame) {
_animationState = 0;
}
break;
default:
debugC(6, kDebugAnimation, "AIScriptInsectDealer::UpdateAnimation() - Current _animationState (%d) is not supported", _animationState);
break;
}
*frame = _animationFrame;
@ -331,6 +335,7 @@ bool AIScriptInsectDealer::ChangeAnimationMode(int mode) {
break;
default:
debugC(6, kDebugAnimation, "AIScriptInsectDealer::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}

View File

@ -342,6 +342,7 @@ bool AIScriptIsabella::UpdateAnimation(int *animation, int *frame) {
break;
default:
debugC(6, kDebugAnimation, "AIScriptIsabella::UpdateAnimation() - Current _animationState (%d) is not supported", _animationState);
break;
}
@ -438,6 +439,7 @@ bool AIScriptIsabella::ChangeAnimationMode(int mode) {
break;
default:
debugC(6, kDebugAnimation, "AIScriptIsabella::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}

View File

@ -866,6 +866,7 @@ bool AIScriptIzo::UpdateAnimation(int *animation, int *frame) {
// Dummy placeholder, kModelAnimationZubenIdle (406) is a Zuben animation
*animation = kModelAnimationZubenIdle;
_animationFrame = 0;
debugC(6, kDebugAnimation, "AIScriptIzo::UpdateAnimation() - Current _animationState (%d) is a placeholder", _animationState);
break;
}
@ -1109,6 +1110,10 @@ bool AIScriptIzo::ChangeAnimationMode(int mode) {
_animationState = 19;
_animationFrame = 0;
break;
default:
debugC(6, kDebugAnimation, "AIScriptIzo::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}
return true;

View File

@ -488,6 +488,7 @@ bool AIScriptKlein::UpdateAnimation(int *animation, int *frame) {
default:
// Dummy placeholder, kModelAnimationZubenWalking (399) is a Zuben animation
*animation = kModelAnimationZubenWalking;
debugC(6, kDebugAnimation, "AIScriptKlein::UpdateAnimation() - Current _animationState (%d) is a placeholder", _animationState);
break;
}
*frame = _animationFrame;
@ -577,6 +578,10 @@ bool AIScriptKlein::ChangeAnimationMode(int mode) {
_animationNext = kModelAnimationKleinTalkRaisingBothHands;
}
break;
default:
debugC(6, kDebugAnimation, "AIScriptKlein::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}
return true;
}

View File

@ -387,6 +387,10 @@ bool AIScriptLeon::UpdateAnimation(int *animation, int *frame) {
Actor_Change_Animation_Mode(kActorLeon, kAnimationModeIdle);
}
break;
default:
debugC(6, kDebugAnimation, "AIScriptLeon::UpdateAnimation() - Current _animationState (%d) is not supported", _animationState);
break;
}
*frame = _animationFrame;
return true;
@ -478,6 +482,10 @@ bool AIScriptLeon::ChangeAnimationMode(int mode) {
_animationFrame = 0;
}
break;
default:
debugC(6, kDebugAnimation, "AIScriptLeon::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}
return true;
}

View File

@ -431,7 +431,9 @@ bool AIScriptLucy::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Actor_Says(kActorLucy, 360, 13);
Actor_Says(kActorMcCoy, 1710, 13);
if (Global_Variable_Query(kVariableAffectionTowards) == kAffectionTowardsLucy) { // cut feature? if this is set lucy will not run into hf04
if (Global_Variable_Query(kVariableAffectionTowards) == kAffectionTowardsLucy) {
// TODO A cut feature? if this is set lucy will not run into hf04
// Also this dialogue takes place in HF03 script too, but with different animations
Actor_Says(kActorLucy, 940, 13);
Actor_Says(kActorMcCoy, 6780, 12);
Actor_Says(kActorLucy, 950, 12);
@ -460,6 +462,7 @@ bool AIScriptLucy::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Actor_Says(kActorLucy, 370, 14);
Actor_Set_Goal_Number(kActorLucy, kGoalLucyHF04WalkAway);
// TODO A bug? Should this be here after Lucy walks away? (It's this way in original)
if (Global_Variable_Query(kVariableHollowayArrest) == 3) {
Actor_Set_Goal_Number(kActorSteele, kGoalSteeleHF02LucyRanAway);
Game_Flag_Set(kFlagLucyRanAway);
@ -721,6 +724,7 @@ bool AIScriptLucy::UpdateAnimation(int *animation, int *frame) {
break;
default:
debugC(6, kDebugAnimation, "AIScriptLucy::UpdateAnimation() - Current _animationState (%d) is not supported", _animationState);
break;
}
*frame = _animationFrame;
@ -844,6 +848,10 @@ bool AIScriptLucy::ChangeAnimationMode(int mode) {
_animationState = kLucyStateDie;
_animationFrame = 0;
break;
default:
debugC(6, kDebugAnimation, "AIScriptLucy::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}
return true;

View File

@ -374,6 +374,9 @@ bool AIScriptLuther::UpdateAnimation(int *animation, int *frame) {
}
break;
default:
debugC(6, kDebugAnimation, "AIScriptLuther::UpdateAnimation() - Current _animationState (%d) is not supported", _animationState);
break;
}
*frame = _animationFrame;
@ -453,6 +456,10 @@ bool AIScriptLuther::ChangeAnimationMode(int mode) {
_animationState = 11;
_animationFrame = 0;
break;
default:
debugC(6, kDebugAnimation, "AIScriptLuther::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}
return true;

View File

@ -950,6 +950,10 @@ bool AIScriptMaggie::UpdateAnimation(int *animation, int *frame) {
_animationFrame = 0;
}
break;
default:
debugC(6, kDebugAnimation, "AIScriptMaggie::UpdateAnimation() - Current _animationState (%d) is not supported", _animationState);
break;
}
*frame = _animationFrame;
return true;
@ -1090,6 +1094,9 @@ bool AIScriptMaggie::ChangeAnimationMode(int mode) {
_animationFrame = 0;
break;
default:
debugC(6, kDebugAnimation, "AIScriptMaggie::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}
return true;
}

View File

@ -562,8 +562,7 @@ bool AIScriptMcCoy::GoalChanged(int currentGoalNumber, int newGoalNumber) {
Global_Variable_Set(kVariableAffectionTowards, kAffectionTowardsNone);
}
} else if (affectionTowards == kAffectionTowardsDektora
|| affectionTowards == kAffectionTowardsLucy
) {
|| affectionTowards == kAffectionTowardsLucy) {
if (!Game_Flag_Query(kFlagMcCoyIsHelpingReplicants)) {
Global_Variable_Set(kVariableAffectionTowards, kAffectionTowardsNone);
}
@ -1422,6 +1421,10 @@ bool AIScriptMcCoy::UpdateAnimation(int *animation, int *frame) {
Player_Gains_Control();
}
break;
default:
debugC(6, kDebugAnimation, "AIScriptMcCoy::UpdateAnimation() - Current _animationState (%d) is not supported", _animationState);
break;
}
*frame = _animationFrame;
return true;
@ -1944,6 +1947,10 @@ bool AIScriptMcCoy::ChangeAnimationMode(int mode) {
_animationFrame = 0;
_animationState = 69;
break;
default:
debugC(6, kDebugAnimation, "AIScriptMcCoy::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}
return true;
}

View File

@ -165,6 +165,10 @@ bool AIScriptMia::UpdateAnimation(int *animation, int *frame) {
_animationState = 2;
}
break;
default:
debugC(6, kDebugAnimation, "AIScriptMia::UpdateAnimation() - Current _animationState (%d) is not supported", _animationState);
break;
}
*frame = _animationFrame;
@ -207,6 +211,10 @@ bool AIScriptMia::ChangeAnimationMode(int mode) {
_animationFrame = 0;
_animationState = 1;
break;
default:
debugC(6, kDebugAnimation, "AIScriptMia::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}
return true;

View File

@ -383,6 +383,7 @@ bool AIScriptMoraji::UpdateAnimation(int *animation, int *frame) {
break;
default:
debugC(6, kDebugAnimation, "AIScriptMoraji::UpdateAnimation() - Current _animationState (%d) is not supported", _animationState);
break;
}
*frame = _animationFrame;
@ -456,6 +457,10 @@ bool AIScriptMoraji::ChangeAnimationMode(int mode) {
_animationState = 13;
_animationFrame = -1;
break;
default:
debugC(6, kDebugAnimation, "AIScriptMoraji::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}
return true;

View File

@ -190,6 +190,7 @@ bool AIScriptMurray::UpdateAnimation(int *animation, int *frame) {
break;
default:
debugC(6, kDebugAnimation, "AIScriptMurray::UpdateAnimation() - Current _animationState (%d) is not supported", _animationState);
break;
}
@ -238,6 +239,10 @@ bool AIScriptMurray::ChangeAnimationMode(int mode) {
_animationFrame = 0;
_resumeIdleAfterFramesetCompletesFlag = false;
break;
default:
debugC(6, kDebugAnimation, "AIScriptMurray::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}
return true;

View File

@ -517,6 +517,7 @@ bool AIScriptMutant1::UpdateAnimation(int *animation, int *frame) {
break;
default:
debugC(6, kDebugAnimation, "AIScriptMutant1::UpdateAnimation() - Current _animationState (%d) is not supported", _animationState);
break;
}
*frame = _animationFrame;
@ -526,7 +527,7 @@ bool AIScriptMutant1::UpdateAnimation(int *animation, int *frame) {
bool AIScriptMutant1::ChangeAnimationMode(int mode) {
switch (mode) {
case 0:
case kAnimationModeIdle:
if (_animationState >= 3 && _animationState <= 5) {
_resumeIdleAfterFramesetCompletesFlag = true;
} else {
@ -535,19 +536,23 @@ bool AIScriptMutant1::ChangeAnimationMode(int mode) {
}
break;
case 1:
case kAnimationModeWalk:
// fall through
case 7:
case kAnimationModeCombatWalk:
_animationState = 1;
_animationFrame = 0;
break;
case 2:
case kAnimationModeRun:
// fall through
case kAnimationModeCombatRun:
_animationState = 2;
_animationFrame = 0;
break;
case 3:
// fall through
case 12:
_animationState = 3;
_animationFrame = 0;
_resumeIdleAfterFramesetCompletesFlag = false;
@ -567,17 +572,6 @@ bool AIScriptMutant1::ChangeAnimationMode(int mode) {
_animationFrame = 0;
break;
case 8:
_animationState = 2;
_animationFrame = 0;
break;
case 12:
_animationState = 3;
_animationFrame = 0;
_resumeIdleAfterFramesetCompletesFlag = false;
break;
case 13:
_animationState = 3;
_animationFrame = 0;
@ -600,6 +594,10 @@ bool AIScriptMutant1::ChangeAnimationMode(int mode) {
_animationState = 9;
_animationFrame = Slice_Animation_Query_Number_Of_Frames(kModelAnimationMutant1ShotDead) - 1;
break;
default:
debugC(6, kDebugAnimation, "AIScriptMutant1::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}
return true;

View File

@ -505,6 +505,7 @@ bool AIScriptMutant2::UpdateAnimation(int *animation, int *frame) {
break;
default:
debugC(6, kDebugAnimation, "AIScriptMutant2::UpdateAnimation() - Current _animationState (%d) is not supported", _animationState);
break;
}
*frame = _animationFrame;
@ -514,7 +515,7 @@ bool AIScriptMutant2::UpdateAnimation(int *animation, int *frame) {
bool AIScriptMutant2::ChangeAnimationMode(int mode) {
switch (mode) {
case 0:
case kAnimationModeIdle:
if (_animationState >= 3 && _animationState <= 4) {
_resumeIdleAfterFramesetCompletesFlag = true;
} else {
@ -523,21 +524,23 @@ bool AIScriptMutant2::ChangeAnimationMode(int mode) {
}
break;
case 1:
case kAnimationModeWalk:
// fall through
case 7:
case kAnimationModeCombatWalk:
_animationState = 1;
_animationFrame = 0;
break;
case 2:
case kAnimationModeRun:
// fall through
case 8:
case kAnimationModeCombatRun:
_animationState = 2;
_animationFrame = 0;
break;
case 3:
// fall through
case 12:
_animationState = 3;
_animationFrame = 0;
_resumeIdleAfterFramesetCompletesFlag = false;
@ -557,12 +560,6 @@ bool AIScriptMutant2::ChangeAnimationMode(int mode) {
_animationFrame = 0;
break;
case 12:
_animationState = 3;
_animationFrame = 0;
_resumeIdleAfterFramesetCompletesFlag = false;
break;
case 21:
// fall through
case 22:
@ -580,6 +577,10 @@ bool AIScriptMutant2::ChangeAnimationMode(int mode) {
_animationState = 7;
_animationFrame = Slice_Animation_Query_Number_Of_Frames(kModelAnimationMutant2ShotDead) - 1;
break;
default:
debugC(6, kDebugAnimation, "AIScriptMutant2::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}
return true;

View File

@ -545,6 +545,7 @@ bool AIScriptMutant3::UpdateAnimation(int *animation, int *frame) {
default:
// Dummy placeholder, kModelAnimationZubenIdle (406) is a Zuben animation
*animation = kModelAnimationZubenIdle;
debugC(6, kDebugAnimation, "AIScriptMutant3::UpdateAnimation() - Current _animationState (%d) is a placeholder", _animationState);
break;
}
*frame = _animationFrame;
@ -554,7 +555,7 @@ bool AIScriptMutant3::UpdateAnimation(int *animation, int *frame) {
bool AIScriptMutant3::ChangeAnimationMode(int mode) {
switch (mode) {
case 0:
case kAnimationModeIdle:
switch (_animationState) {
case 3:
// fall through
@ -577,16 +578,16 @@ bool AIScriptMutant3::ChangeAnimationMode(int mode) {
}
break;
case 1:
case kAnimationModeWalk:
// fall through
case 7:
case kAnimationModeCombatWalk:
_animationState = 1;
_animationFrame = 0;
break;
case 2:
case kAnimationModeRun:
// fall through
case 8:
case kAnimationModeCombatRun:
_animationState = 2;
_animationFrame = 0;
break;
@ -621,11 +622,6 @@ bool AIScriptMutant3::ChangeAnimationMode(int mode) {
_var1 = 1;
break;
case 88:
_animationState = 7;
_animationFrame = Slice_Animation_Query_Number_Of_Frames(kModelAnimationMutant3ShotDead) - 1;
break;
case 43:
if ((unsigned int)(_animationState - 8) > 1) {
_animationState = 9;
@ -637,6 +633,15 @@ bool AIScriptMutant3::ChangeAnimationMode(int mode) {
_animationState = 6;
_animationFrame = 0;
break;
case 88:
_animationState = 7;
_animationFrame = Slice_Animation_Query_Number_Of_Frames(kModelAnimationMutant3ShotDead) - 1;
break;
default:
debugC(6, kDebugAnimation, "AIScriptMutant3::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}
return true;

View File

@ -1297,6 +1297,7 @@ bool AIScriptOfficerGrayford::UpdateAnimation(int *animation, int *frame) {
default:
// Dummy placeholder, kModelAnimationZubenWalking (399) is a Zuben animation
*animation = kModelAnimationZubenWalking;
debugC(6, kDebugAnimation, "AIScriptOfficerGrayford::UpdateAnimation() - Current _animationState (%d) is a placeholder", _animationState);
break;
}
*frame = _animationFrame;
@ -1632,6 +1633,9 @@ bool AIScriptOfficerGrayford::ChangeAnimationMode(int mode) {
_animationFrame = 0;
break;
default:
debugC(6, kDebugAnimation, "AIScriptOfficerGrayford::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}
return true;

View File

@ -1142,10 +1142,12 @@ bool AIScriptOfficerLeary::UpdateAnimation(int *animation, int *frame) {
}
*frame = _animationFrame;
return true;
default:
// Dummy placeholder, kModelAnimationZubenWalking (399) is a Zuben animation
*animation = kModelAnimationZubenWalking;
*frame = _animationFrame;
debugC(6, kDebugAnimation, "AIScriptOfficerLeary::UpdateAnimation() - Current _animationState (%d) is a placeholder", _animationState);
return true;
}
}
@ -1480,6 +1482,10 @@ bool AIScriptOfficerLeary::ChangeAnimationMode(int mode) {
_animationState = 20;
_animationFrame = 0;
break;
default:
debugC(6, kDebugAnimation, "AIScriptOfficerLeary::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}
return true;
}

View File

@ -296,6 +296,7 @@ bool AIScriptPhotographer::UpdateAnimation(int *animation, int *frame) {
break;
default:
debugC(6, kDebugAnimation, "AIScriptPhotographer::UpdateAnimation() - Current _animationState (%d) is not supported", _animationState);
break;
}
*frame = _animationFrame;
@ -355,6 +356,7 @@ bool AIScriptPhotographer::ChangeAnimationMode(int mode) {
break;
default:
debugC(6, kDebugAnimation, "AIScriptPhotographer::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}
return true;

View File

@ -304,6 +304,7 @@ bool AIScriptRachael::UpdateAnimation(int *animation, int *frame) {
break;
default:
debugC(6, kDebugAnimation, "AIScriptRachael::UpdateAnimation() - Current _animationState (%d) is not supported", _animationState);
break;
}
*frame = _animationFrame;
@ -376,6 +377,7 @@ bool AIScriptRachael::ChangeAnimationMode(int mode) {
break;
default:
debugC(6, kDebugAnimation, "AIScriptRachael::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}

View File

@ -18,7 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "bladerunner/bladerunner.h"
#include "bladerunner/script/ai_script.h"
namespace BladeRunner {
@ -110,6 +110,7 @@ bool AIScriptRajif::GoalChanged(int currentGoalNumber, int newGoalNumber) {
}
bool AIScriptRajif::UpdateAnimation(int *animation, int *frame) {
#if BLADERUNNER_ORIGINAL_BUGS
if (_animationState <= 1) {
if (_animationState > 0) {
*animation = kModelAnimationRajifWithGunIdle;
@ -117,7 +118,8 @@ bool AIScriptRajif::UpdateAnimation(int *animation, int *frame) {
if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(kModelAnimationRajifWithGunIdle)) {
_animationFrame = 0;
}
} else { // bug in original. Both branches are equal
} else {
// bug in original. Both branches are equal. Also _animationState for Rajif is always 0.
*animation = kModelAnimationRajifWithGunIdle;
++_animationFrame;
if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(kModelAnimationRajifWithGunIdle)) {
@ -125,6 +127,21 @@ bool AIScriptRajif::UpdateAnimation(int *animation, int *frame) {
}
}
}
#else
switch (_animationState) {
case 0:
*animation = kModelAnimationRajifWithGunIdle;
++_animationFrame;
if (_animationFrame >= Slice_Animation_Query_Number_Of_Frames(kModelAnimationRajifWithGunIdle)) {
_animationFrame = 0;
}
break;
default:
debugC(6, kDebugAnimation, "AIScriptRajif::UpdateAnimation() - Current _animationState (%d) is not supported", _animationState);
break;
}
#endif // BLADERUNNER_ORIGINAL_BUGS
*frame = _animationFrame;
@ -132,9 +149,15 @@ bool AIScriptRajif::UpdateAnimation(int *animation, int *frame) {
}
bool AIScriptRajif::ChangeAnimationMode(int mode) {
if (!mode) {
switch (mode) {
case kAnimationModeIdle:
_animationState = 0;
_animationFrame = 0;
break;
default:
debugC(6, kDebugAnimation, "AIScriptRajif::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}
return true;
}

View File

@ -533,6 +533,7 @@ bool AIScriptRunciter::UpdateAnimation(int *animation, int *frame) {
*animation = kModelAnimationZubenWalking;
_animationFrame = 0;
*frame = _animationFrame;
debugC(6, kDebugAnimation, "AIScriptRunciter::UpdateAnimation() - Current _animationState (%d) is a placeholder", _animationState);
break;
}
return true;

View File

@ -900,6 +900,7 @@ bool AIScriptSadik::UpdateAnimation(int *animation, int *frame) {
// Dummy placeholder, kModelAnimationZubenIdle (406) is a Zuben animation
*animation = kModelAnimationZubenIdle;
_animationFrame = 0;
debugC(6, kDebugAnimation, "AIScriptSadik::UpdateAnimation() - Current _animationState (%d) is a placeholder", _animationState);
break;
}
@ -1138,6 +1139,10 @@ bool AIScriptSadik::ChangeAnimationMode(int mode) {
_animationFrame = 2;
}
break;
default:
debugC(6, kDebugAnimation, "AIScriptSadik::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}
return true;
}

View File

@ -19,6 +19,7 @@
*
*/
#include "bladerunner/bladerunner.h"
#include "bladerunner/script/ai_script.h"
namespace BladeRunner {
@ -94,7 +95,14 @@ void AIScriptSebastian::OtherAgentEnteredCombatMode(int otherActorId, int combat
if (otherActorId == kActorMcCoy
&& combatMode
) {
#if BLADERUNNER_ORIGINAL_BUGS
Global_Variable_Increment(kVariableGunPulledInFrontOfSebastian, 1);
#else
// This is a minor fix: Prevent increasing the value of kVariableGunPulledInFrontOfSebastian without restriction
if (Global_Variable_Query(kVariableGunPulledInFrontOfSebastian) < 2) {
Global_Variable_Increment(kVariableGunPulledInFrontOfSebastian, 1);
}
#endif
Actor_Modify_Friendliness_To_Other(kActorSebastian, kActorMcCoy, -5);
AI_Movement_Track_Pause(kActorSebastian);
Actor_Face_Actor(kActorSebastian, kActorMcCoy, true);
@ -264,6 +272,7 @@ bool AIScriptSebastian::UpdateAnimation(int *animation, int *frame) {
break;
default:
debugC(6, kDebugAnimation, "AIScriptSebastian::UpdateAnimation() - Current _animationState (%d) is not supported", _animationState);
break;
}
*frame = _animationFrame;
@ -344,6 +353,10 @@ bool AIScriptSebastian::ChangeAnimationMode(int mode) {
_animationState = 3;
_animationFrame = 0;
break;
default:
debugC(6, kDebugAnimation, "AIScriptSebastian::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}
return true;

View File

@ -196,6 +196,7 @@ bool AIScriptSergeantWalls::UpdateAnimation(int *animation, int *frame) {
default:
// Dummy placeholder, kModelAnimationZubenWalking (399) is a Zuben animation
*animation = kModelAnimationZubenWalking;
debugC(6, kDebugAnimation, "AIScriptSergeantWalls::UpdateAnimation() - Current _animationState (%d) is a placeholder", _animationState);
break;
}
*frame = _animationFrame;
@ -248,6 +249,10 @@ bool AIScriptSergeantWalls::ChangeAnimationMode(int mode) {
_animationState = 9;
_animationFrame = 0;
break;
default:
debugC(6, kDebugAnimation, "AIScriptSergeantWalls::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}
return true;
}

View File

@ -119,6 +119,26 @@ bool AIScriptShoeshineMan::GoalChanged(int currentGoalNumber, int newGoalNumber)
}
bool AIScriptShoeshineMan::UpdateAnimation(int *animation, int *frame) {
switch(_animationState) {
case 0:
// fall through
case 1:
// fall through
case 2:
// fall through
case 3:
// fall through
case 4:
// fall through
case 5:
// fall through
case 6:
break;
default:
debugC(6, kDebugAnimation, "AIScriptShoeshineMan::UpdateAnimation() - Current _animationState (%d) is not supported", _animationState);
break;
}
return true;
}
@ -167,6 +187,7 @@ bool AIScriptShoeshineMan::ChangeAnimationMode(int mode) {
break;
default:
debugC(6, kDebugAnimation, "AIScriptShoeshineMan::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}

View File

@ -125,7 +125,7 @@ bool AIScriptSteele::Update() {
break;
case 3:
if (Global_Variable_Query(kVariableChapter) != 3) { // why is this here? double check?
if (Global_Variable_Query(kVariableChapter) != 3) { // TODO A BUG? why is this here? double check? redundant?
break;
}
@ -2008,6 +2008,7 @@ bool AIScriptSteele::UpdateAnimation(int *animation, int *frame) {
// Dummy placeholder, kModelAnimationZubenIdle (406) is a Zuben animation
*animation = kModelAnimationZubenIdle;
_animationFrame = 0;
debugC(6, kDebugAnimation, "AIScriptSteele::UpdateAnimation() - Current _animationState (%d) is placeholder", _animationState);
break;
}
*frame = _animationFrame;

View File

@ -135,6 +135,7 @@ bool AIScriptTaffyPatron::UpdateAnimation(int *animation, int *frame) {
break;
default:
debugC(6, kDebugAnimation, "AIScriptTaffyPatron::UpdateAnimation() - Current _animationState (%d) is not supported", _animationState);
break;
}
*frame = _animationFrame;
@ -144,12 +145,12 @@ bool AIScriptTaffyPatron::UpdateAnimation(int *animation, int *frame) {
bool AIScriptTaffyPatron::ChangeAnimationMode(int mode) {
switch (mode) {
case 0:
case kAnimationModeIdle:
_animationState = 0;
_animationFrame = 0;
break;
case 2:
case kAnimationModeRun:
_animationState = 1;
_animationFrame = 0;
break;
@ -160,6 +161,7 @@ bool AIScriptTaffyPatron::ChangeAnimationMode(int mode) {
break;
default:
debugC(6, kDebugAnimation, "AIScriptTaffyPatron::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}

View File

@ -407,6 +407,7 @@ bool AIScriptTransient::UpdateAnimation(int *animation, int *frame) {
default:
// Dummy placeholder, kModelAnimationZubenWalking (399) is a Zuben animation
*animation = kModelAnimationZubenWalking;
debugC(6, kDebugAnimation, "AIScriptTransient::UpdateAnimation() - Current _animationState (%d) is a placeholder", _animationState);
break;
}
*frame = _animationFrame;
@ -545,6 +546,10 @@ bool AIScriptTransient::ChangeAnimationMode(int mode) {
_animationState = 12;
_animationFrame = Slice_Animation_Query_Number_Of_Frames(kModelAnimationTransientLayingShotDead) - 1;
break;
default:
debugC(6, kDebugAnimation, "AIScriptTransient::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}
return true;

View File

@ -190,6 +190,7 @@ bool AIScriptTyrell::UpdateAnimation(int *animation, int *frame) {
break;
default:
debugC(6, kDebugAnimation, "AIScriptTyrell::UpdateAnimation() - Current _animationState (%d) is not supported", _animationState);
break;
}
*frame = _animationFrame;
@ -244,6 +245,7 @@ bool AIScriptTyrell::ChangeAnimationMode(int mode) {
break;
default:
debugC(6, kDebugAnimation, "AIScriptTyrell::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}

View File

@ -265,6 +265,10 @@ bool AIScriptTyrellGuard::UpdateAnimation(int *animation, int *frame) {
_animationState = 0;
}
break;
default:
debugC(6, kDebugAnimation, "AIScriptTyrellGuard::UpdateAnimation() - Current _animationState (%d) is not supported", _animationState);
break;
}
*frame = _animationFrame;
@ -374,6 +378,10 @@ bool AIScriptTyrellGuard::ChangeAnimationMode(int mode) {
_animationFrame = 0;
}
break;
default:
debugC(6, kDebugAnimation, "AIScriptTyrellGuard::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}
return true;
}

View File

@ -1036,7 +1036,7 @@ bool AIScriptZuben::UpdateAnimation(int *animation, int *frame) {
*animation = kModelAnimationZubenBashOnDoor;
++_animationFrame;
if (_animationFrame == 5) {
Overlay_Play("ct02over", 1, false, true, 0);
Overlay_Play("CT02OVER", 1, false, true, 0);
}
if (_animationFrame == 6) {
Sound_Play(kSfxMTLDOOR2, 40, 0, 0, 50);
@ -1065,6 +1065,7 @@ bool AIScriptZuben::UpdateAnimation(int *animation, int *frame) {
default:
*animation = kModelAnimationZubenWalking;
debugC(6, kDebugAnimation, "AIScriptZuben::UpdateAnimation() - Current _animationState (%d) is default (walking)", _animationState);
break;
}
*frame = _animationFrame;
@ -1259,6 +1260,10 @@ bool AIScriptZuben::ChangeAnimationMode(int mode) {
_animationState = 14;
_animationFrame = 0;
break;
default:
debugC(6, kDebugAnimation, "AIScriptZuben::ChangeAnimationMode(%d) - Target mode is not supported", mode);
break;
}
return true;
}