rnd-19990829-2-src
authorHolger Schemel <info@artsoft.org>
Sun, 29 Aug 1999 18:52:59 +0000 (20:52 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:34:12 +0000 (10:34 +0200)
src/editor.c
src/files.c
src/game.c
src/init.c
src/main.c
src/main.h
src/tools.c

index 50988c0d88b527cd13e7078b21c36a2bd5151cf3..f3feeba7a337ef8e694b44349ad54082791df791 100644 (file)
@@ -1076,6 +1076,11 @@ int editor_element[] =
   EL_SWITCHGATE_SWITCH_1,
   EL_ENVELOPE,
 
+  EL_TIMEGATE_CLOSED,
+  EL_TIMEGATE_OPEN,
+  EL_TIMEGATE_SWITCH_OFF,
+  EL_LEERRAUM,
+
   EL_LANDMINE,
   EL_SAND_INVISIBLE,
   EL_STEEL_SLANTED,
@@ -1086,10 +1091,10 @@ int editor_element[] =
   EL_LIGHT_SWITCH_OFF,
   EL_LIGHT_SWITCH_ON,
 
-  EL_FORCE_FIELD_PASSIVE,
+  EL_SHIELD_PASSIVE,
+  EL_SHIELD_ACTIVE,
   EL_EXTRA_TIME,
   EL_LEERRAUM,
-  EL_FORCE_FIELD_ACTIVE,
 
   /*
   EL_CHAR('D'),
index ce0a95befddb0ff20ff3f7c0be7ae3fa44d81d7d..364a04620f9fb015ea7653d91d7f0496525fd659 100644 (file)
@@ -355,6 +355,8 @@ static void setLevelInfoToDefaults()
   level.amoeba_speed = 10;
   level.time_magic_wall = 10;
   level.time_wheel = 10;
+  level.time_light = 10;
+  level.time_timegate = 10;
   level.amoeba_content = EL_DIAMANT;
   level.double_speed = FALSE;
   level.gravity = FALSE;
index d7fb2368f8536f59501a5dc05cbe86eb6309eda9..e3fc38ba736906daf1b8440a5405bf9e6ee105d7 100644 (file)
 #define NUM_GAME_BUTTONS               6
 
 /* forward declaration for internal use */
+static void CloseAllOpenTimegates(void);
 static void CheckGravityMovement(struct PlayerInfo *);
-static void KillHeroUnlessForceField(struct PlayerInfo *);
+static void KillHeroUnlessShield(struct PlayerInfo *);
 
 static void MapGameButtons();
 static void HandleGameButtons(struct GadgetInfo *);
@@ -408,7 +409,7 @@ static void InitField(int x, int y, boolean init_game)
 
     case EL_LIGHT_SWITCH_ON:
       if (init_game)
-       game.light_time_left = 10 * FRAMES_PER_SECOND;
+       game.light_time_left = level.time_light * FRAMES_PER_SECOND;
       break;
 
     default:
@@ -480,8 +481,8 @@ void InitGame()
     player->last_jx = player->last_jy = 0;
     player->jx = player->jy = 0;
 
-    player->force_field_passive_time_left = 0;
-    player->force_field_active_time_left = 0;
+    player->shield_passive_time_left = 0;
+    player->shield_active_time_left = 0;
 
     DigField(player, 0, 0, 0, 0, DF_NO_PUSH);
     SnapField(player, 0, 0);
@@ -515,8 +516,10 @@ void InitGame()
   AllPlayersGone = FALSE;
   game.magic_wall_active = FALSE;
   game.magic_wall_time_left = 0;
-  game.switchgate_pos = 0;
   game.light_time_left = 0;
+  game.timegate_time_left = 0;
+  game.switchgate_pos = 0;
+
   for (i=0; i<4; i++)
   {
     game.belt_dir[i] = MV_NO_MOVING;
@@ -696,6 +699,11 @@ void InitGame()
   DrawAllPlayers();
   FadeToFront();
 
+  /* after drawing the level, corect some elements */
+
+  if (game.timegate_time_left == 0)
+    CloseAllOpenTimegates();
+
   if (setup.soft_scrolling)
     XCopyArea(display, fieldbuffer, backbuffer, gc,
              FX, FY, SXSIZE, SYSIZE, SX, SY);
@@ -1257,7 +1265,7 @@ void Explode(int ex, int ey, int phase, int mode)
       if (IS_MASSIVE(element) || element == EL_BURNING)
        continue;
 
-      if (IS_PLAYER(x, y) && FORCE_FIELD_ON(PLAYERINFO(x, y)))
+      if (IS_PLAYER(x, y) && SHIELD_ON(PLAYERINFO(x, y)))
       {
        if (IS_ACTIVE_BOMB(element))
        {
@@ -1272,7 +1280,7 @@ void Explode(int ex, int ey, int phase, int mode)
       if (element == EL_EXPLODING)
        element = Store2[x][y];
 
-      if (IS_PLAYER(ex, ey) && !FORCE_FIELD_ON(PLAYERINFO(ex, ey)))
+      if (IS_PLAYER(ex, ey) && !SHIELD_ON(PLAYERINFO(ex, ey)))
       {
        switch(StorePlayer[ex][ey])
        {
@@ -1373,7 +1381,7 @@ void Explode(int ex, int ey, int phase, int mode)
     int element = Store2[x][y];
 
     if (IS_PLAYER(x, y))
-      KillHeroUnlessForceField(PLAYERINFO(x, y));
+      KillHeroUnlessShield(PLAYERINFO(x, y));
     else if (IS_EXPLOSIVE(element))
     {
       Feld[x][y] = Store2[x][y];
@@ -1650,39 +1658,79 @@ static void ToggleSwitchgateSwitch(int x, int y)
   }
 }
 
-static void ToggleLightSwitch(int x, int y)
+static void RedrawAllLightSwitchesAndInvisibleElements()
 {
-  int element = Feld[x][y];
-  int xx, yy;
-
-  game.light_time_left =
-    (element == EL_LIGHT_SWITCH_OFF ? 10 * FRAMES_PER_SECOND : 0);
+  int x, y;
 
-  for (yy=0; yy<lev_fieldy; yy++)
+  for (y=0; y<lev_fieldy; y++)
   {
-    for (xx=0; xx<lev_fieldx; xx++)
+    for (x=0; x<lev_fieldx; x++)
     {
-      int element = Feld[xx][yy];
+      int element = Feld[x][y];
 
       if (element == EL_LIGHT_SWITCH_OFF &&
          game.light_time_left > 0)
       {
-       Feld[xx][yy] = EL_LIGHT_SWITCH_ON;
-       DrawLevelField(xx, yy);
+       Feld[x][y] = EL_LIGHT_SWITCH_ON;
+       DrawLevelField(xy);
       }
       else if (element == EL_LIGHT_SWITCH_ON &&
               game.light_time_left == 0)
       {
-       Feld[xx][yy] = EL_LIGHT_SWITCH_OFF;
-       DrawLevelField(xx, yy);
+       Feld[x][y] = EL_LIGHT_SWITCH_OFF;
+       DrawLevelField(xy);
       }
 
       if (element == EL_INVISIBLE_STEEL ||
          element == EL_UNSICHTBAR ||
          element == EL_SAND_INVISIBLE)
+       DrawLevelField(x, y);
+    }
+  }
+}
+
+static void ToggleLightSwitch(int x, int y)
+{
+  int element = Feld[x][y];
+
+  game.light_time_left =
+    (element == EL_LIGHT_SWITCH_OFF ?
+     level.time_light * FRAMES_PER_SECOND : 0);
+
+  RedrawAllLightSwitchesAndInvisibleElements();
+}
+
+static void ActivateTimegateSwitch(int x, int y)
+{
+  int xx, yy;
+
+  game.timegate_time_left = level.time_timegate * FRAMES_PER_SECOND;
+
+  for (yy=0; yy<lev_fieldy; yy++)
+  {
+    for (xx=0; xx<lev_fieldx; xx++)
+    {
+      int element = Feld[xx][yy];
+
+      if (element == EL_TIMEGATE_CLOSED ||
+         element == EL_TIMEGATE_CLOSING)
+      {
+       Feld[xx][yy] = EL_TIMEGATE_OPENING;
+       PlaySoundLevel(xx, yy, SND_OEFFNEN);
+      }
+
+      /*
+      else if (element == EL_TIMEGATE_SWITCH_ON)
+      {
+       Feld[xx][yy] = EL_TIMEGATE_SWITCH_OFF;
        DrawLevelField(xx, yy);
+      }
+      */
+
     }
   }
+
+  Feld[x][y] = EL_TIMEGATE_SWITCH_ON;
 }
 
 void Impact(int x, int y)
@@ -1720,7 +1768,7 @@ void Impact(int x, int y)
   if (element == EL_TROPFEN && (lastline || object_hit))       /* acid drop */
   {
     if (object_hit && IS_PLAYER(x, y+1))
-      KillHeroUnlessForceField(PLAYERINFO(x, y+1));
+      KillHeroUnlessShield(PLAYERINFO(x, y+1));
     else if (object_hit && smashed == EL_PINGUIN)
       Bang(x, y+1);
     else
@@ -1753,7 +1801,7 @@ void Impact(int x, int y)
 
     if (IS_PLAYER(x, y+1))
     {
-      KillHeroUnlessForceField(PLAYERINFO(x, y+1));
+      KillHeroUnlessShield(PLAYERINFO(x, y+1));
       return;
     }
     else if (smashed == EL_PINGUIN)
@@ -2562,7 +2610,7 @@ void StartMoving(int x, int y)
     Moving2Blocked(x, y, &newx, &newy);        /* get next screen position */
 
     if (IS_ENEMY(element) && IS_PLAYER(newx, newy) &&
-       !FORCE_FIELD_ON(PLAYERINFO(newx, newy)))
+       !SHIELD_ON(PLAYERINFO(newx, newy)))
     {
 
 #if 1
@@ -3365,6 +3413,31 @@ void Ablenk(int x, int y)
     ZX = ZY = -1;
 }
 
+void TimegateWheel(int x, int y)
+{
+  if (!MovDelay[x][y])         /* next animation frame */
+    MovDelay[x][y] = level.time_wheel * FRAMES_PER_SECOND;
+
+  if (MovDelay[x][y])          /* wait some time before next frame */
+  {
+    MovDelay[x][y]--;
+    if (MovDelay[x][y])
+    {
+      if (IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
+       DrawGraphic(SCREENX(x), SCREENY(y),
+                   GFX_TIMEGATE_SWITCH + MovDelay[x][y]%4);
+      if (!(MovDelay[x][y]%4))
+       PlaySoundLevel(x, y, SND_MIEP);
+      return;
+    }
+  }
+
+  Feld[x][y] = EL_TIMEGATE_SWITCH_OFF;
+  DrawLevelField(x, y);
+  if (ZX == x && ZY == y)
+    ZX = ZY = -1;
+}
+
 void Birne(int x, int y)
 {
   if (!MovDelay[x][y])         /* next animation frame */
@@ -3521,6 +3594,73 @@ void CloseSwitchgate(int x, int y)
   }
 }
 
+void OpenTimegate(int x, int y)
+{
+  int delay = 6;
+
+  if (!MovDelay[x][y])         /* next animation frame */
+    MovDelay[x][y] = 5 * delay;
+
+  if (MovDelay[x][y])          /* wait some time before next frame */
+  {
+    int phase;
+
+    MovDelay[x][y]--;
+    phase = MovDelay[x][y] / delay;
+    if (!(MovDelay[x][y] % delay) && IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
+      DrawGraphic(SCREENX(x), SCREENY(y), GFX_TIMEGATE_OPEN - phase);
+
+    if (!MovDelay[x][y])
+    {
+      Feld[x][y] = EL_TIMEGATE_OPEN;
+      DrawLevelField(x, y);
+    }
+  }
+}
+
+void CloseTimegate(int x, int y)
+{
+  int delay = 6;
+
+  if (!MovDelay[x][y])         /* next animation frame */
+    MovDelay[x][y] = 5 * delay;
+
+  if (MovDelay[x][y])          /* wait some time before next frame */
+  {
+    int phase;
+
+    MovDelay[x][y]--;
+    phase = MovDelay[x][y] / delay;
+    if (!(MovDelay[x][y] % delay) && IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
+      DrawGraphic(SCREENX(x), SCREENY(y), GFX_TIMEGATE_CLOSED + phase);
+
+    if (!MovDelay[x][y])
+    {
+      Feld[x][y] = EL_TIMEGATE_CLOSED;
+      DrawLevelField(x, y);
+    }
+  }
+}
+
+static void CloseAllOpenTimegates()
+{
+  int x, y;
+
+  for (y=0; y<lev_fieldy; y++)
+  {
+    for (x=0; x<lev_fieldx; x++)
+    {
+      int element = Feld[x][y];
+
+      if (element == EL_TIMEGATE_OPEN || element == EL_TIMEGATE_OPENING)
+      {
+       Feld[x][y] = EL_TIMEGATE_CLOSING;
+       PlaySoundLevel(x, y, SND_OEFFNEN);
+      }
+    }
+  }
+}
+
 void EdelsteinFunkeln(int x, int y)
 {
   if (!IN_SCR_FIELD(SCREENX(x), SCREENY(y)) || IS_MOVING(x, y))
@@ -4092,6 +4232,8 @@ void GameActions()
       Life(x, y);
     else if (element == EL_ABLENK_EIN)
       Ablenk(x, y);
+    else if (element == EL_TIMEGATE_SWITCH_ON)
+      TimegateWheel(x, y);
     else if (element == EL_SALZSAEURE)
       Blubber(x, y);
     else if (element == EL_BLURB_LEFT || element == EL_BLURB_RIGHT)
@@ -4125,12 +4267,16 @@ void GameActions()
       OpenSwitchgate(x, y);
     else if (element == EL_SWITCHGATE_CLOSING)
       CloseSwitchgate(x, y);
+    else if (element == EL_TIMEGATE_OPENING)
+      OpenTimegate(x, y);
+    else if (element == EL_TIMEGATE_CLOSING)
+      CloseTimegate(x, y);
     else if (element == EL_EXTRA_TIME)
       DrawGraphicAnimation(x, y, GFX_EXTRA_TIME, 6, 4, ANIM_NORMAL);
-    else if (element == EL_FORCE_FIELD_PASSIVE)
-      DrawGraphicAnimation(x, y, GFX_FORCE_FIELD_PASSIVE, 6, 4, ANIM_NORMAL);
-    else if (element == EL_FORCE_FIELD_ACTIVE)
-      DrawGraphicAnimation(x, y, GFX_FORCE_FIELD_ACTIVE, 6, 4, ANIM_NORMAL);
+    else if (element == EL_SHIELD_PASSIVE)
+      DrawGraphicAnimation(x, y, GFX_SHIELD_PASSIVE, 6, 4, ANIM_NORMAL);
+    else if (element == EL_SHIELD_ACTIVE)
+      DrawGraphicAnimation(x, y, GFX_SHIELD_ACTIVE, 6, 4, ANIM_NORMAL);
 
     if (game.magic_wall_active)
     {
@@ -4213,6 +4359,14 @@ void GameActions()
     }
   }
 
+  if (game.timegate_time_left > 0)
+  {
+    game.timegate_time_left--;
+
+    if (game.timegate_time_left == 0)
+      CloseAllOpenTimegates();
+  }
+
   if (TimeFrames >= (1000 / GameFrameDelay))
   {
     TimeFrames = 0;
@@ -4220,12 +4374,12 @@ void GameActions()
 
     for (i=0; i<MAX_PLAYERS; i++)
     {
-      if (FORCE_FIELD_ON(&stored_player[i]))
+      if (SHIELD_ON(&stored_player[i]))
       {
-       stored_player[i].force_field_passive_time_left--;
+       stored_player[i].shield_passive_time_left--;
 
-       if (stored_player[i].force_field_active_time_left > 0)
-         stored_player[i].force_field_active_time_left--;
+       if (stored_player[i].shield_active_time_left > 0)
+         stored_player[i].shield_active_time_left--;
       }
     }
 
@@ -4390,7 +4544,7 @@ boolean MoveFigureOneStep(struct PlayerInfo *player,
 #if 1
       TestIfBadThingHitsHero(new_jx, new_jy);
 #else
-      if (player->force_field_time_left == 0)
+      if (player->shield_time_left == 0)
        KillHero(player);
 #endif
     }
@@ -4710,9 +4864,9 @@ void TestIfGoodThingHitsBadThing(int goodx, int goody)
     {
       struct PlayerInfo *player = PLAYERINFO(goodx, goody);
 
-      if (player->force_field_active_time_left > 0)
+      if (player->shield_active_time_left > 0)
        Bang(killx, killy);
-      else if (player->force_field_passive_time_left == 0)
+      else if (player->shield_passive_time_left == 0)
        KillHero(player);
     }
     else
@@ -4772,9 +4926,9 @@ void TestIfBadThingHitsGoodThing(int badx, int bady)
     {
       struct PlayerInfo *player = PLAYERINFO(killx, killy);
 
-      if (player->force_field_active_time_left > 0)
+      if (player->shield_active_time_left > 0)
        Bang(badx, bady);
-      else if (player->force_field_passive_time_left == 0)
+      else if (player->shield_passive_time_left == 0)
        KillHero(player);
     }
     else
@@ -4846,17 +5000,17 @@ void KillHero(struct PlayerInfo *player)
   if (IS_PFORTE(Feld[jx][jy]))
     Feld[jx][jy] = EL_LEERRAUM;
 
-  /* deactivate force field (else Bang()/Explode() would not work right) */
-  player->force_field_passive_time_left = 0;
-  player->force_field_active_time_left = 0;
+  /* deactivate shield (else Bang()/Explode() would not work right) */
+  player->shield_passive_time_left = 0;
+  player->shield_active_time_left = 0;
 
   Bang(jx, jy);
   BuryHero(player);
 }
 
-static void KillHeroUnlessForceField(struct PlayerInfo *player)
+static void KillHeroUnlessShield(struct PlayerInfo *player)
 {
-  if (!FORCE_FIELD_ON(player))
+  if (!SHIELD_ON(player))
     KillHero(player);
 }
 
@@ -4981,16 +5135,16 @@ int DigField(struct PlayerInfo *player,
       PlaySoundStereo(SND_GONG, PSND_MAX_RIGHT);
       break;
 
-    case EL_FORCE_FIELD_PASSIVE:
+    case EL_SHIELD_PASSIVE:
       RemoveField(x, y);
-      player->force_field_passive_time_left += 10;
+      player->shield_passive_time_left += 10;
       PlaySoundLevel(x, y, SND_PONG);
       break;
 
-    case EL_FORCE_FIELD_ACTIVE:
+    case EL_SHIELD_ACTIVE:
       RemoveField(x, y);
-      player->force_field_passive_time_left += 10;
-      player->force_field_active_time_left += 10;
+      player->shield_passive_time_left += 10;
+      player->shield_active_time_left += 10;
       PlaySoundLevel(x, y, SND_PONG);
       break;
 
@@ -5137,6 +5291,12 @@ int DigField(struct PlayerInfo *player,
       return MF_ACTION;
       break;
 
+    case EL_TIMEGATE_SWITCH_OFF:
+      ActivateTimegateSwitch(x, y);
+
+      return MF_ACTION;
+      break;
+
     case EL_SP_EXIT:
       if (local_player->gems_still_needed > 0)
        return MF_NO_ACTION;
@@ -5238,6 +5398,7 @@ int DigField(struct PlayerInfo *player,
       break;
 
     case EL_SWITCHGATE_OPEN:
+    case EL_TIMEGATE_OPEN:
       if (!IN_LEV_FIELD(x + dx, y + dy) || !IS_FREE(x + dx, y + dy))
        return MF_NO_ACTION;
 
index 78e38abed59c678931755f597e8a3e5bd3e6ce64..c41f8c7626545b1c2c7ab7ca01178417a5734f8b 100644 (file)
@@ -561,6 +561,8 @@ void InitGfx()
     { GFX_SOKOBAN_OBJEKT, 1 },
     { GFX_FUNKELN_BLAU, 3 },
     { GFX_FUNKELN_WEISS, 3 },
+    { GFX2_SHIELD_PASSIVE, 3 },
+    { GFX2_SHIELD_ACTIVE, 3 },
     { -1, 0 }
   };
 
@@ -872,7 +874,9 @@ void InitElementProperties()
     EL_EM_GATE_3X,
     EL_EM_GATE_4X,
     EL_SWITCHGATE_OPEN,
-    EL_SWITCHGATE_CLOSED
+    EL_SWITCHGATE_CLOSED,
+    EL_TIMEGATE_OPEN,
+    EL_TIMEGATE_CLOSED
   };
   static int ep_pforte_num = sizeof(ep_pforte)/sizeof(int);
 
@@ -941,8 +945,12 @@ void InitElementProperties()
     EL_BELT4_SWITCH_LEFT,
     EL_BELT4_SWITCH_MIDDLE,
     EL_BELT4_SWITCH_RIGHT,
+    EL_SWITCHGATE_SWITCH_1,
+    EL_SWITCHGATE_SWITCH_2,
     EL_LIGHT_SWITCH_OFF,
     EL_LIGHT_SWITCH_ON,
+    EL_TIMEGATE_SWITCH_OFF,
+    EL_TIMEGATE_SWITCH_ON,
     EL_SIGN_EXCLAMATION,
     EL_SIGN_RADIOACTIVITY,
     EL_SIGN_STOP,
@@ -986,6 +994,8 @@ void InitElementProperties()
     EL_EM_GATE_4X,
     EL_SWITCHGATE_OPEN,
     EL_SWITCHGATE_CLOSED,
+    EL_TIMEGATE_OPEN,
+    EL_TIMEGATE_CLOSED,
     EL_SP_HARD_GRAY,
     EL_SP_HARD_GREEN,
     EL_SP_HARD_BLUE,
@@ -1613,7 +1623,8 @@ void InitElementProperties()
     EL_SP_PORT_X,
     EL_SP_PORT_Y,
     EL_SP_PORT_XY,
-    EL_SWITCHGATE_OPEN
+    EL_SWITCHGATE_OPEN,
+    EL_TIMEGATE_OPEN
   };
   static int ep_quick_gate_num = sizeof(ep_quick_gate)/sizeof(int);
 
index f6439e8fe3487e06deeccef6658d594404657698..f94664ab3a2f0d577cb60b69b072d1b33ce71998 100644 (file)
@@ -463,14 +463,14 @@ char *element_info[] =
   "white door",                                        /* 260 */
   "gray door (opened by white key)",
   "white key",
-  "force field (passive)",
+  "shield (passive)",
   "extra time",
   "switch gate (open)",
   "switch gate (closed)",
   "switch for switch gate",
   "switch for switch gate",
-  "time gate",
-  "time gate with magic wheel",                        /* 270 */
+  "-",
+  "-",                                         /* 270 */
   "red conveyor belt (left)",
   "red conveyor belt (middle)",
   "red conveyor belt (right)",
@@ -521,10 +521,11 @@ char *element_info[] =
   "dx unknown 42",
   "-",
   "-",                                         /* 320 */
-  "force field (active, kills enemies)",
-  "-",
-  "-",
-  "-",
+  "shield (active, kills enemies)",
+  "time gate (open)",
+  "time gate (closed)",
+  "switch for time gate",
+  "switch for time gate",
   "-",
   "-",
   "-"
index 4e6bd02f0fe3b33a6f2f8413041dbf5b6cf03b8a..eb644bc886009a6227a9f6b8f2c29623f36d5323 100644 (file)
@@ -191,7 +191,7 @@ typedef unsigned char byte;
 #define TAPE_IS_STOPPED(x)     (!(x).recording && !(x).playing &&!(x).pausing)
 
 #define PLAYERINFO(x,y)                (&stored_player[StorePlayer[x][y]-EL_SPIELER1])
-#define FORCE_FIELD_ON(p)      ((p)->force_field_passive_time_left > 0)
+#define SHIELD_ON(p)           ((p)->shield_passive_time_left > 0)
 
 /* Pixmaps with graphic file */
 #define PIX_BACK               0
@@ -354,8 +354,8 @@ struct PlayerInfo
   int key[4];
   int dynamite;
   int dynabomb_count, dynabomb_size, dynabombs_left, dynabomb_xl;
-  int force_field_passive_time_left;
-  int force_field_active_time_left;
+  int shield_passive_time_left;
+  int shield_active_time_left;
 };
 
 struct LevelInfo
@@ -373,6 +373,8 @@ struct LevelInfo
   int amoeba_content;
   int time_magic_wall;
   int time_wheel;
+  int time_light;
+  int time_timegate;
   boolean double_speed;
   boolean gravity;
 };
@@ -421,10 +423,11 @@ struct GameInfo
   int yam_content_nr;
   boolean magic_wall_active;
   int magic_wall_time_left;
+  int light_time_left;
+  int timegate_time_left;
   int belt_dir[4];
   int belt_dir_nr[4];
   int switchgate_pos;
-  int light_time_left;
 };
 
 struct GlobalInfo
@@ -853,14 +856,16 @@ extern char               *element_info[];
 #define EL_DOOR_WHITE          260
 #define EL_DOOR_WHITE_GRAY     261
 #define EL_KEY_WHITE           262
-#define EL_FORCE_FIELD_PASSIVE 263
+#define EL_SHIELD_PASSIVE      263
 #define EL_EXTRA_TIME          264
 #define EL_SWITCHGATE_OPEN     265
 #define EL_SWITCHGATE_CLOSED   266
 #define EL_SWITCHGATE_SWITCH_1 267
 #define EL_SWITCHGATE_SWITCH_2 268
-#define EL_TIME_GATE           269
-#define EL_TIME_GATE_WHEEL     270
+
+#define EL_UNUSED_269          269
+#define EL_UNUSED_270          270
+
 #define EL_BELT1_LEFT          271
 #define EL_BELT1_MIDDLE                272
 #define EL_BELT1_RIGHT         273
@@ -913,7 +918,11 @@ extern char                *element_info[];
 #define EL_UNUSED_319          319
 #define EL_UNUSED_320          320
 
-#define EL_FORCE_FIELD_ACTIVE  321
+#define EL_SHIELD_ACTIVE       321
+#define EL_TIMEGATE_OPEN       322
+#define EL_TIMEGATE_CLOSED     323
+#define EL_TIMEGATE_SWITCH_ON  324
+#define EL_TIMEGATE_SWITCH_OFF 325
 
 /* "real" (and therefore drawable) runtime elements */
 #define EL_SIEB_LEER           500
@@ -935,6 +944,8 @@ extern char         *element_info[];
 #define EL_DYNABOMB_ACTIVE_4   516
 #define EL_SWITCHGATE_OPENING  517
 #define EL_SWITCHGATE_CLOSING  518
+#define EL_TIMEGATE_OPENING    519
+#define EL_TIMEGATE_CLOSING    520
 
 /* "unreal" (and therefore not drawable) runtime elements */
 #define EL_BLOCKED             600
@@ -1175,6 +1186,8 @@ extern char               *element_info[];
 #define GFX_SPIELER4_PUSH_LEFT (GFX_START_ROCKSHEROES +11*HEROES_PER_LINE + 4)
 #define GFX_MAUER_DOWN         (GFX_START_ROCKSHEROES +12*HEROES_PER_LINE + 0)
 #define GFX_MAUER_UP           (GFX_START_ROCKSHEROES +12*HEROES_PER_LINE + 3)
+#define GFX2_SHIELD_PASSIVE    (GFX_START_ROCKSHEROES +14*HEROES_PER_LINE + 1)
+#define GFX2_SHIELD_ACTIVE     (GFX_START_ROCKSHEROES +14*HEROES_PER_LINE + 5)
 
 #define GFX_SONDE_START                (GFX_START_ROCKSHEROES + 9*HEROES_PER_LINE + 8)
 #define GFX_SCHWEIN_DOWN       (GFX_START_ROCKSHEROES + 0*HEROES_PER_LINE + 8)
@@ -1185,18 +1198,20 @@ extern char             *element_info[];
 #define GFX_DRACHE_UP          (GFX_START_ROCKSHEROES + 2*HEROES_PER_LINE +12)
 #define GFX_DRACHE_LEFT                (GFX_START_ROCKSHEROES + 3*HEROES_PER_LINE + 8)
 #define GFX_DRACHE_RIGHT       (GFX_START_ROCKSHEROES + 3*HEROES_PER_LINE +12)
+/*
 #define GFX_MOLE_DOWN          (GFX_START_ROCKSHEROES + 4*HEROES_PER_LINE + 8)
 #define GFX_MOLE_UP            (GFX_START_ROCKSHEROES + 4*HEROES_PER_LINE +12)
 #define GFX_MOLE_LEFT          (GFX_START_ROCKSHEROES + 5*HEROES_PER_LINE + 8)
 #define GFX_MOLE_RIGHT         (GFX_START_ROCKSHEROES + 5*HEROES_PER_LINE +12)
+*/
 #define GFX_PINGUIN_DOWN       (GFX_START_ROCKSHEROES + 6*HEROES_PER_LINE + 8)
 #define GFX_PINGUIN_UP         (GFX_START_ROCKSHEROES + 6*HEROES_PER_LINE +12)
 #define GFX_PINGUIN_LEFT       (GFX_START_ROCKSHEROES + 7*HEROES_PER_LINE + 8)
 #define GFX_PINGUIN_RIGHT      (GFX_START_ROCKSHEROES + 7*HEROES_PER_LINE +12)
 #define GFX_BLURB_LEFT         (GFX_START_ROCKSHEROES +10*HEROES_PER_LINE + 8)
 #define GFX_BLURB_RIGHT                (GFX_START_ROCKSHEROES +10*HEROES_PER_LINE +12)
-#define GFX_FUNKELN_BLAU       (GFX_START_ROCKSHEROES +11*HEROES_PER_LINE + 8)
-#define GFX_FUNKELN_WEISS      (GFX_START_ROCKSHEROES +11*HEROES_PER_LINE +12)
+#define GFX_FUNKELN_BLAU       (GFX_START_ROCKSHEROES +11*HEROES_PER_LINE + 9)
+#define GFX_FUNKELN_WEISS      (GFX_START_ROCKSHEROES +11*HEROES_PER_LINE +13)
 #define GFX_FLAMMEN_LEFT       (GFX_START_ROCKSHEROES +12*HEROES_PER_LINE + 8)
 #define GFX_FLAMMEN_RIGHT      (GFX_START_ROCKSHEROES +13*HEROES_PER_LINE + 8)
 #define GFX_FLAMMEN_UP         (GFX_START_ROCKSHEROES +14*HEROES_PER_LINE + 8)
@@ -1318,12 +1333,11 @@ extern char             *element_info[];
 #define GFX_BELT3_SWITCH_RIGHT (GFX_START_ROCKSDC + 14 * DC_PER_LINE +  2)
 #define GFX_BELT4_SWITCH_RIGHT (GFX_START_ROCKSDC + 14 * DC_PER_LINE +  3)
 
-#define GFX_SWITCHGATE_OPEN    (GFX_START_ROCKSDC + 15 * DC_PER_LINE +  4)
-#define GFX_SWITCHGATE_CLOSED  (GFX_START_ROCKSDC + 15 * DC_PER_LINE +  0)
 #define GFX_SWITCHGATE_SWITCH_1        (GFX_START_ROCKSDC + 12 * DC_PER_LINE +  4)
 #define GFX_SWITCHGATE_SWITCH_2        (GFX_START_ROCKSDC + 12 * DC_PER_LINE +  5)
 #define GFX_LIGHT_SWITCH_OFF   (GFX_START_ROCKSDC + 12 * DC_PER_LINE +  6)
 #define GFX_LIGHT_SWITCH_ON    (GFX_START_ROCKSDC + 12 * DC_PER_LINE +  7)
+#define GFX_TIMEGATE_SWITCH    (GFX_START_ROCKSDC + 15 * DC_PER_LINE +  0)
 
 #define GFX_ENVELOPE           (GFX_START_ROCKSDC + 14 * DC_PER_LINE +  4)
 #define GFX_SIGN_EXCLAMATION   (GFX_START_ROCKSDC + 14 * DC_PER_LINE +  5)
@@ -1332,8 +1346,16 @@ extern char              *element_info[];
 #define GFX_STEEL_SLANTED      (GFX_START_ROCKSDC + 15 * DC_PER_LINE +  5)
 
 #define GFX_EXTRA_TIME         (GFX_START_ROCKSDC +  0 * DC_PER_LINE +  8)
-#define GFX_FORCE_FIELD_PASSIVE        (GFX_START_ROCKSDC +  1 * DC_PER_LINE +  8)
-#define GFX_FORCE_FIELD_ACTIVE (GFX_START_ROCKSDC +  1 * DC_PER_LINE +  8)
+#define GFX_SHIELD_ACTIVE      (GFX_START_ROCKSDC +  1 * DC_PER_LINE +  8)
+#define GFX_SHIELD_PASSIVE     (GFX_START_ROCKSDC +  2 * DC_PER_LINE +  8)
+#define GFX_MOLE_DOWN          (GFX_START_ROCKSDC +  3 * DC_PER_LINE +  8)
+#define GFX_MOLE_UP            (GFX_START_ROCKSDC +  3 * DC_PER_LINE + 12)
+#define GFX_MOLE_LEFT          (GFX_START_ROCKSDC +  4 * DC_PER_LINE +  8)
+#define GFX_MOLE_RIGHT         (GFX_START_ROCKSDC +  4 * DC_PER_LINE + 12)
+#define GFX_SWITCHGATE_CLOSED  (GFX_START_ROCKSDC +  5 * DC_PER_LINE +  8)
+#define GFX_SWITCHGATE_OPEN    (GFX_START_ROCKSDC +  5 * DC_PER_LINE + 12)
+#define GFX_TIMEGATE_CLOSED    (GFX_START_ROCKSDC +  6 * DC_PER_LINE +  8)
+#define GFX_TIMEGATE_OPEN      (GFX_START_ROCKSDC +  6 * DC_PER_LINE + 12)
 
 /* graphics from "RocksFont" */
 #define GFX_CHAR_START         (GFX_START_ROCKSFONT)
@@ -1375,8 +1397,6 @@ extern char               *element_info[];
 #define GFX_DOOR_WHITE         GFX_CHAR_FRAGE
 #define GFX_DOOR_WHITE_GRAY    GFX_CHAR_FRAGE
 #define GFX_KEY_WHITE          GFX_CHAR_FRAGE
-#define GFX_TIME_GATE          GFX_CHAR_FRAGE
-#define GFX_TIME_GATE_WHEEL    GFX_CHAR_FRAGE
 #define GFX_SIGN_RADIOACTIVITY GFX_CHAR_FRAGE
 #define GFX_SIGN_WHEELCHAIR    GFX_CHAR_FRAGE
 #define GFX_SIGN_PARKING       GFX_CHAR_FRAGE
index 046d47c47dbefe1fc26f3bb83f506fad67d82c04..fbd0ca17d7da66db7838717432ca6206eb17ee35 100644 (file)
@@ -606,9 +606,14 @@ void DrawPlayer(struct PlayerInfo *player)
 
   DrawGraphicShiftedThruMask(sx, sy, sxx, syy, graphic, NO_CUTTING);
 
-  if (FORCE_FIELD_ON(player))
-    DrawGraphicAnimationShiftedThruMask(sx, sy, sxx, syy, GFX_FUNKELN_BLAU,
+  if (SHIELD_ON(player))
+  {
+    int graphic = (player->shield_active_time_left ? GFX2_SHIELD_ACTIVE :
+                  GFX2_SHIELD_PASSIVE);
+
+    DrawGraphicAnimationShiftedThruMask(sx, sy, sxx, syy, graphic,
                                        3, 8, ANIM_OSCILLATE);
+  }
 
   if (player->Pushing && player->GfxPos)
   {
@@ -2504,15 +2509,13 @@ int el2gfx(int element)
     case EL_DOOR_WHITE:                return GFX_DOOR_WHITE;
     case EL_DOOR_WHITE_GRAY:   return GFX_DOOR_WHITE_GRAY;
     case EL_KEY_WHITE:         return GFX_KEY_WHITE;
-    case EL_FORCE_FIELD_PASSIVE:return GFX_FORCE_FIELD_PASSIVE;
-    case EL_FORCE_FIELD_ACTIVE:        return GFX_FORCE_FIELD_ACTIVE;
+    case EL_SHIELD_PASSIVE:    return GFX_SHIELD_PASSIVE;
+    case EL_SHIELD_ACTIVE:     return GFX_SHIELD_ACTIVE;
     case EL_EXTRA_TIME:                return GFX_EXTRA_TIME;
     case EL_SWITCHGATE_OPEN:   return GFX_SWITCHGATE_OPEN;
     case EL_SWITCHGATE_CLOSED: return GFX_SWITCHGATE_CLOSED;
     case EL_SWITCHGATE_SWITCH_1:return GFX_SWITCHGATE_SWITCH_1;
     case EL_SWITCHGATE_SWITCH_2:return GFX_SWITCHGATE_SWITCH_2;
-    case EL_TIME_GATE:         return GFX_TIME_GATE;
-    case EL_TIME_GATE_WHEEL:   return GFX_TIME_GATE_WHEEL;
     case EL_BELT1_LEFT:                return GFX_BELT1_LEFT;
     case EL_BELT1_MIDDLE:      return GFX_BELT1_MIDDLE;
     case EL_BELT1_RIGHT:       return GFX_BELT1_RIGHT;
@@ -2561,6 +2564,10 @@ int el2gfx(int element)
     case EL_SAND_INVISIBLE:    return GFX_SAND_INVISIBLE;
     case EL_DX_UNKNOWN_15:     return GFX_DX_UNKNOWN_15;
     case EL_DX_UNKNOWN_42:     return GFX_DX_UNKNOWN_42;
+    case EL_TIMEGATE_OPEN:     return GFX_TIMEGATE_OPEN;
+    case EL_TIMEGATE_CLOSED:   return GFX_TIMEGATE_CLOSED;
+    case EL_TIMEGATE_SWITCH_ON:        return GFX_TIMEGATE_SWITCH;
+    case EL_TIMEGATE_SWITCH_OFF:return GFX_TIMEGATE_SWITCH;
 
     default:
     {