X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Fgame_sp%2FDoGameStuff.c;h=2ba35823a8db9fc16c5b24d9b05d71f797240a50;hp=baa11022c8085c7120a32a69ecdce7b5fb6dcc15;hb=115ce6f2da1914d68b0fe0e5f9082973190dacdd;hpb=5ba7f2d9a3f07f342afdf215a3307d5487cb6d43 diff --git a/src/game_sp/DoGameStuff.c b/src/game_sp/DoGameStuff.c index baa11022..2ba35823 100644 --- a/src/game_sp/DoGameStuff.c +++ b/src/game_sp/DoGameStuff.c @@ -4,29 +4,30 @@ #include "DoGameStuff.h" + static void CallAnimation(int si, byte bl); static boolean IsToBeAnimated(int bl); -static char *VB_Name = "modDoGameStuff"; -// --- Option Explicit +int AnimationPosTable[SP_MAX_PLAYFIELD_SIZE]; +byte AnimationSubTable[SP_MAX_PLAYFIELD_SIZE]; -int *AnimationPosTable; -byte *AnimationSubTable; // ========================================================================== // SUBROUTINE // Do game stuff // ========================================================================== -int subDoGameStuff() +void subDoGameStuff(void) { - int subDoGameStuff; - int si, cx, dx, bl; + int InfotronsNeeded_last = InfotronsNeeded; - subAnimateMurphy(MurphyPosIndex); // move Murphy in any direction + subAnimateMurphy(&MurphyPosIndex); // move Murphy in any direction - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + if (InfotronsNeeded != InfotronsNeeded_last) + game.snapshot.collected_item = TRUE; + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // Build a database of locations and subs-to-call of animatable fields only: // Make a snapshot from the field before the animation cycle starts. // first and last line are not animated. @@ -51,7 +52,7 @@ int subDoGameStuff() } while (0 < cx); // locloop_g_2282' until all lines scanned(not top- and bottom edge) - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // Now use the database to animate all animatables the fastest way. // All the other fields are not checked anymore: those have no database entry. // The field from before animation is frozen in the database in order not to @@ -66,20 +67,21 @@ int subDoGameStuff() } // All animations are done now - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (KillMurphyFlag == 1 || MurphyMoveCounter == 0) { - if (LeadOutCounter == 0) + if (LeadOutCounter == 0 && + !game_sp.LevelSolved && + !game_sp.GameOver) { - KillMurphyFlag = 0; // no more "kill Murphy" - ExplodeFieldSP(MurphyExplodePos); // Explode - LeadOutCounter = 0x40; // quit: start lead-out + KillMurphyFlag = 0; // no more "kill Murphy" + ExplodeFieldSP(MurphyExplodePos); // Explode + LeadOutCounter = 0x40; // quit: start lead-out + + /* give Murphy some more time (LeadOutCounter) to reach the exit */ } } // loc_g_22FB: - - - return subDoGameStuff; -} // subDoGameStuff +} static boolean IsToBeAnimated(int bl) {