X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Fgame_sp%2FDoGameStuff.c;h=7a7c1ac77919bfb0dc60bef1f6cc901e2999715d;hp=8e7d8830c9dc360fa294616da41450cdf098c5f9;hb=ff45a13c41aeeb995cb556c3f3b7f7be477fc214;hpb=2af2c61f4dde2d22c1dc0e8dfad033b40d81dc6c diff --git a/src/game_sp/DoGameStuff.c b/src/game_sp/DoGameStuff.c index 8e7d8830..7a7c1ac7 100644 --- a/src/game_sp/DoGameStuff.c +++ b/src/game_sp/DoGameStuff.c @@ -4,30 +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() { - int subDoGameStuff; - int si, cx, dx, bl; + int InfotronsNeeded_last = InfotronsNeeded; 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. @@ -52,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,72 +66,22 @@ int subDoGameStuff() } // loop locloop_g_22B8 ' until all animatables done } -#if 0 - printf("::: DoGameStuff.c: KillMurphyFlag == %d [%d]\n", - KillMurphyFlag, MurphyMoveCounter); -#endif - // All animations are done now - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (KillMurphyFlag == 1 || MurphyMoveCounter == 0) { -#if 1 if (LeadOutCounter == 0 && - !game_sp_info.LevelSolved && - !game_sp_info.GameOver) -#else - if (LeadOutCounter == 0) -#endif + !game_sp.LevelSolved && + !game_sp.GameOver) { -#if 1 - printf("::: DoGameStuff.c: killing murphy [%d] ...\n", KillMurphyFlag); -#endif + 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 - -#if 1 - -#if 1 - printf("::: DoGameStuff.c: !!!!!!!!!! GAME OVER !!!!!!!!!!\n"); - printf("::: [KillMurphyFlag == %d]\n", KillMurphyFlag); -#endif - -#if 1 /* give Murphy some more time (LeadOutCounter) to reach the exit */ -#else - game_sp_info.GameOver = TRUE; -#endif - -#endif } - -#if 1 -#if 0 - printf("::: *** %d, %d, %d\n", KillMurphyFlag, - game_sp_info.LevelSolved, game_sp_info.GameOver); -#endif - -#if 0 - if (KillMurphyFlag == 1 && - !game_sp_info.LevelSolved && - !game_sp_info.GameOver) - { -#if 1 - printf("::: DoGameStuff.c: !!!!!!!!!! GAME OVER !!!!!!!!!!\n"); -#endif - - game_sp_info.GameOver = TRUE; - } -#endif -#endif - } // loc_g_22FB: - - - return subDoGameStuff; -} // subDoGameStuff +} static boolean IsToBeAnimated(int bl) {