rnd-20051227-1-src
authorHolger Schemel <info@artsoft.org>
Tue, 27 Dec 2005 22:38:24 +0000 (23:38 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:50:04 +0000 (10:50 +0200)
* changed "score for each 10 seconds/steps left" to "1 second/step"
* added own score for collecting "extra time" instead of sharing it

ChangeLog
src/conftime.h
src/editor.c
src/files.c
src/game.c
src/main.h

index bef90ca370c1234f13fcc1b4b6a98b2ba0ed5245..d3ed1b8ee87058abdc55a7f319b029ba8ae3f211 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2005-12-27
+       * changed "score for each 10 seconds/steps left" to "1 second/step"
+       * added own score for collecting "extra time" instead of sharing it
+
 2005-12-22
        * added "set player shield: off / normal / deadly" to CE action options
        * added new player option "use level start element" in level editor
index 1fcfa537a2802b4728d1283630b85bfd2d4d743c..57c3fa1800bb184ebd1e9b74e03d877cad39a86e 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2005-12-23 02:25]"
+#define COMPILE_DATE_STRING "[2005-12-27 23:30]"
index 91a51ea49e2880f66ff5af4f805cbd29010fbee2..2a4700546c28d3b07816007ffd1dc0c841b9960f 100644 (file)
@@ -1023,7 +1023,7 @@ static struct
     GADGET_ID_LEVEL_TIMESCORE_DOWN,    GADGET_ID_LEVEL_TIMESCORE_UP,
     GADGET_ID_LEVEL_TIMESCORE_TEXT,    GADGET_ID_NONE,
     &level.score[SC_TIME_BONUS],
-    "score for each 10 sec/steps left:", NULL, NULL
+    "score for each second/step left:",        NULL, NULL
   },
   {
     ED_LEVEL_SETTINGS_XPOS(0),         ED_COUNTER2_YPOS(8),
@@ -1700,6 +1700,10 @@ static struct ValueTextInfo options_action_arg_number[] =
   { CA_ARG_NUMBER_CE_SCORE,    "CE score"                      },
   { CA_ARG_NUMBER_CE_VALUE,    "CE value"                      },
   { CA_ARG_UNDEFINED,          " "                             },
+  { CA_ARG_NUMBER_LEVEL_TIME,  "time"                          },
+  { CA_ARG_NUMBER_LEVEL_GEMS,  "gems"                          },
+  { CA_ARG_NUMBER_LEVEL_SCORE, "score"                         },
+  { CA_ARG_UNDEFINED,          " "                             },
   { CA_ARG_ELEMENT_HEADLINE,   "[CE value"                     },
   { CA_ARG_ELEMENT_HEADLINE,   " of"                           },
   { CA_ARG_ELEMENT_HEADLINE,   " element]"                     },
@@ -7218,7 +7222,7 @@ static struct
   { EL_DYNABOMB_INCREASE_POWER,        &level.score[SC_DYNAMITE],TEXT_COLLECTING },
   { EL_SHIELD_NORMAL,  &level.score[SC_SHIELD],        TEXT_COLLECTING },
   { EL_SHIELD_DEADLY,  &level.score[SC_SHIELD],        TEXT_COLLECTING },
-  { EL_EXTRA_TIME,     &level.score[SC_TIME_BONUS],    TEXT_COLLECTING },
+  { EL_EXTRA_TIME,     &level.extra_time_score,        TEXT_COLLECTING },
   { EL_KEY_1,          &level.score[SC_KEY],           TEXT_COLLECTING },
   { EL_KEY_2,          &level.score[SC_KEY],           TEXT_COLLECTING },
   { EL_KEY_3,          &level.score[SC_KEY],           TEXT_COLLECTING },
index e49a2965922169e7d4ffb495061232afcde7b5ca..b867a6b330228c75c9575b10e3534b824362ee43 100644 (file)
@@ -195,6 +195,10 @@ static struct
     EL_EXTRA_TIME,                     CONF_VALUE_INTEGER_1,
     &li.extra_time,                    10
   },
+  {
+    EL_EXTRA_TIME,                     CONF_VALUE_INTEGER_2,
+    &li.extra_time_score,              10
+  },
   {
     EL_TIME_ORB_FULL,                  CONF_VALUE_INTEGER_1,
     &li.time_orb_time,                 10
@@ -212,15 +216,15 @@ static struct
     &li.use_start_element[0],          FALSE
   },
   {
-    EL_PLAYER_2,                       CONF_VALUE_ELEMENT_2,
+    EL_PLAYER_2,                       CONF_VALUE_BOOLEAN_2,
     &li.use_start_element[1],          FALSE
   },
   {
-    EL_PLAYER_3,                       CONF_VALUE_ELEMENT_2,
+    EL_PLAYER_3,                       CONF_VALUE_BOOLEAN_2,
     &li.use_start_element[2],          FALSE
   },
   {
-    EL_PLAYER_4,                       CONF_VALUE_ELEMENT_2,
+    EL_PLAYER_4,                       CONF_VALUE_BOOLEAN_2,
     &li.use_start_element[3],          FALSE
   },
 
@@ -481,7 +485,7 @@ static void setLevelInfoToDefaults(struct LevelInfo *level)
   }
 
   for (i = 0; i < LEVEL_SCORE_ELEMENTS; i++)
-    level->score[i] = 10;
+    level->score[i] = (i == SC_TIME_BONUS ? 1 : 10);
 
   level->num_yamyam_contents = STD_ELEMENT_CONTENTS;
   for (i = 0; i < MAX_ELEMENT_CONTENTS; i++)
@@ -2874,14 +2878,21 @@ static void LoadLevel_InitVersion(struct LevelInfo *level, char *filename)
   if (level->game_version < VERSION_IDENT(2,2,0,0))
     level->use_spring_bug = TRUE;
 
-  /* time orb caused limited time in endless time levels before 3.2.0-5 */
   if (level->game_version < VERSION_IDENT(3,2,0,5))
+  {
+    /* time orb caused limited time in endless time levels before 3.2.0-5 */
     level->use_time_orb_bug = TRUE;
 
-  /* default behaviour for snapping was "no snap delay" before 3.2.0-5 */
-  if (level->game_version < VERSION_IDENT(3,2,0,5))
+    /* default behaviour for snapping was "no snap delay" before 3.2.0-5 */
     level->block_snap_field = FALSE;
 
+    /* extra time score was same value as time left score before 3.2.0-5 */
+    level->extra_time_score = level->score[SC_TIME_BONUS];
+
+    /* time bonus score was given for 10 s instead of 1 s before 3.2.0-5 */
+    level->score[SC_TIME_BONUS] /= 10;
+  }
+
   /* only few elements were able to actively move into acid before 3.1.0 */
   /* trigger settings did not exist before 3.1.0; set to default "any" */
   if (level->game_version < VERSION_IDENT(3,1,0,0))
index 346e1269ce6b77342083efe91436d2e4c4db659a..aec9cfc3fbbf266cf1c0e4daf5d2df3edb457027 100644 (file)
@@ -2320,12 +2320,17 @@ void GameWon()
     {
       if (!tape.playing && !setup.sound_loops)
        PlaySoundStereo(SND_GAME_LEVELTIME_BONUS, SOUND_MIDDLE);
-      if (TimeLeft > 0 && !(TimeLeft % 10))
-       RaiseScore(level.score[SC_TIME_BONUS]);
-      if (TimeLeft > 100 && !(TimeLeft % 10))
+
+      if (TimeLeft > 100 && TimeLeft % 10 == 0)
+      {
        TimeLeft -= 10;
+       RaiseScore(level.score[SC_TIME_BONUS] * 10);
+      }
       else
+      {
        TimeLeft--;
+       RaiseScore(level.score[SC_TIME_BONUS]);
+      }
 
       DrawGameValue_Time(TimeLeft);
 
@@ -2348,12 +2353,17 @@ void GameWon()
     {
       if (!tape.playing && !setup.sound_loops)
        PlaySoundStereo(SND_GAME_LEVELTIME_BONUS, SOUND_MIDDLE);
-      if (TimePlayed < 999 && !(TimePlayed % 10))
-       RaiseScore(level.score[SC_TIME_BONUS]);
-      if (TimePlayed < 900 && !(TimePlayed % 10))
+
+      if (TimePlayed < 900 && TimePlayed % 10 == 0)
+      {
        TimePlayed += 10;
+       RaiseScore(level.score[SC_TIME_BONUS] * 10);
+      }
       else
+      {
        TimePlayed++;
+       RaiseScore(level.score[SC_TIME_BONUS]);
+      }
 
       DrawGameValue_Time(TimePlayed);
 
@@ -6589,7 +6599,11 @@ static void ExecuteCustomElementAction(int x, int y, int element, int page)
   if (!change->has_action)
     return;
 
-  /* ---------- determine action paramater values ---------- */
+  /* ---------- determine action paramater values -------------------------- */
+
+  int level_time_value =
+    (level.time > 0 ? TimeLeft :
+     TimePlayed);
 
   int action_arg_element =
     (action_arg == CA_ARG_PLAYER_TRIGGER  ? change->actual_trigger_player :
@@ -6647,6 +6661,9 @@ static void ExecuteCustomElementAction(int x, int y, int element, int page)
      action_arg == CA_ARG_NUMBER_CE_VALUE ? ei->custom_value_initial :
 #endif
      action_arg == CA_ARG_NUMBER_CE_DELAY ? GET_CHANGE_DELAY(change) :
+     action_arg == CA_ARG_NUMBER_LEVEL_TIME ? level_time_value :
+     action_arg == CA_ARG_NUMBER_LEVEL_GEMS ? local_player->gems_still_needed :
+     action_arg == CA_ARG_NUMBER_LEVEL_SCORE ? local_player->score :
      action_arg == CA_ARG_ELEMENT_TARGET ? GET_NEW_CUSTOM_VALUE(change->target_element) :
      action_arg == CA_ARG_ELEMENT_TRIGGER ? change->actual_trigger_ce_value :
      -1);
@@ -6676,7 +6693,7 @@ static void ExecuteCustomElementAction(int x, int y, int element, int page)
      action_arg == CA_ARG_PLAYER_TRIGGER ? trigger_player_bits :
      PLAYER_BITS_ANY);
 
-  /* ---------- execute action  ---------- */
+  /* ---------- execute action  -------------------------------------------- */
 
   switch(action_type)
   {
@@ -6685,24 +6702,78 @@ static void ExecuteCustomElementAction(int x, int y, int element, int page)
       return;
     }
 
-    case CA_EXIT_PLAYER:
+    /* ---------- level actions  ------------------------------------------- */
+
+    case CA_RESTART_LEVEL:
     {
-      for (i = 0; i < MAX_PLAYERS; i++)
-       if (action_arg_player_bits & (1 << i))
-         stored_player[i].LevelSolved = stored_player[i].GameOver = TRUE;
+      game.restart_level = TRUE;
 
       break;
     }
 
-    case CA_KILL_PLAYER:
+    case CA_SHOW_ENVELOPE:
     {
-      for (i = 0; i < MAX_PLAYERS; i++)
-       if (action_arg_player_bits & (1 << i))
-         KillPlayer(&stored_player[i]);
+      int element = getSpecialActionElement(action_arg_element,
+                                           action_arg_number, EL_ENVELOPE_1);
+
+      if (IS_ENVELOPE(element))
+       local_player->show_envelope = element;
+
+      break;
+    }
+
+    case CA_SET_LEVEL_TIME:
+    {
+      if (level.time > 0)      /* only modify limited time value */
+      {
+       TimeLeft = action_arg_number_new;
+
+       DrawGameValue_Time(TimeLeft);
+
+       if (!TimeLeft && setup.time_limit)
+         for (i = 0; i < MAX_PLAYERS; i++)
+           KillPlayer(&stored_player[i]);
+      }
+
+      break;
+    }
+
+    case CA_SET_LEVEL_SCORE:
+    {
+      local_player->score = action_arg_number_new;
+
+      DrawGameValue_Score(local_player->score);
+
+      break;
+    }
+
+    case CA_SET_LEVEL_GEMS:
+    {
+      local_player->gems_still_needed = action_arg_number_new;
+
+      DrawGameValue_Emeralds(local_player->gems_still_needed);
+
+      break;
+    }
+
+    case CA_SET_LEVEL_GRAVITY:
+    {
+      game.gravity = (action_arg == CA_ARG_GRAVITY_OFF    ? FALSE         :
+                     action_arg == CA_ARG_GRAVITY_ON     ? TRUE          :
+                     action_arg == CA_ARG_GRAVITY_TOGGLE ? !game.gravity :
+                     game.gravity);
+      break;
+    }
+
+    case CA_SET_LEVEL_WIND:
+    {
+      game.wind_direction = action_arg_direction;
 
       break;
     }
 
+    /* ---------- player actions  ------------------------------------------ */
+
     case CA_MOVE_PLAYER:
     {
       /* automatically move to the next field in specified direction */
@@ -6713,20 +6784,20 @@ static void ExecuteCustomElementAction(int x, int y, int element, int page)
       break;
     }
 
-    case CA_RESTART_LEVEL:
+    case CA_EXIT_PLAYER:
     {
-      game.restart_level = TRUE;
+      for (i = 0; i < MAX_PLAYERS; i++)
+       if (action_arg_player_bits & (1 << i))
+         stored_player[i].LevelSolved = stored_player[i].GameOver = TRUE;
 
       break;
     }
 
-    case CA_SHOW_ENVELOPE:
+    case CA_KILL_PLAYER:
     {
-      int element = getSpecialActionElement(action_arg_element,
-                                           action_arg_number, EL_ENVELOPE_1);
-
-      if (IS_ENVELOPE(element))
-       local_player->show_envelope = element;
+      for (i = 0; i < MAX_PLAYERS; i++)
+       if (action_arg_player_bits & (1 << i))
+         KillPlayer(&stored_player[i]);
 
       break;
     }
@@ -6828,55 +6899,7 @@ static void ExecuteCustomElementAction(int x, int y, int element, int page)
       break;
     }
 
-    case CA_SET_LEVEL_GRAVITY:
-    {
-      game.gravity = (action_arg == CA_ARG_GRAVITY_OFF    ? FALSE         :
-                     action_arg == CA_ARG_GRAVITY_ON     ? TRUE          :
-                     action_arg == CA_ARG_GRAVITY_TOGGLE ? !game.gravity :
-                     game.gravity);
-      break;
-    }
-
-    case CA_SET_LEVEL_WIND:
-    {
-      game.wind_direction = action_arg_direction;
-
-      break;
-    }
-
-    case CA_SET_LEVEL_GEMS:
-    {
-      local_player->gems_still_needed = action_arg_number_new;
-
-      DrawGameValue_Emeralds(local_player->gems_still_needed);
-
-      break;
-    }
-
-    case CA_SET_LEVEL_TIME:
-    {
-      if (level.time > 0)      /* only modify limited time value */
-      {
-       TimeLeft = action_arg_number_new;
-
-       DrawGameValue_Time(TimeLeft);
-
-       if (!TimeLeft && setup.time_limit)
-         for (i = 0; i < MAX_PLAYERS; i++)
-           KillPlayer(&stored_player[i]);
-      }
-
-      break;
-    }
-
-    case CA_SET_LEVEL_SCORE:
-    {
-      local_player->score = action_arg_number_new;
-
-      DrawGameValue_Score(local_player->score);
-
-      break;
-    }
+    /* ---------- CE actions  ---------------------------------------------- */
 
     case CA_SET_CE_SCORE:
     {
@@ -10636,7 +10659,7 @@ void RaiseScoreElement(int element)
       RaiseScore(level.score[SC_SHIELD]);
       break;
     case EL_EXTRA_TIME:
-      RaiseScore(level.score[SC_TIME_BONUS]);
+      RaiseScore(level.extra_time_score);
       break;
     case EL_KEY_1:
     case EL_KEY_2:
index 71bca9d762d8b422edfb2f7a72859466b693bd3b..e2bfa12bf7bd136384bae2603acd4f1f469576e5 100644 (file)
 #define CA_ARG_NUMBER_CE_SCORE         (CA_ARG_NUMBER + 3)
 #define CA_ARG_NUMBER_CE_VALUE         (CA_ARG_NUMBER + 4)
 #define CA_ARG_NUMBER_CE_DELAY         (CA_ARG_NUMBER + 5)
+#define CA_ARG_NUMBER_LEVEL_TIME       (CA_ARG_NUMBER + 6)
+#define CA_ARG_NUMBER_LEVEL_GEMS       (CA_ARG_NUMBER + 7)
+#define CA_ARG_NUMBER_LEVEL_SCORE      (CA_ARG_NUMBER + 8)
 #define CA_ARG_NUMBER_HEADLINE         (CA_ARG_NUMBER + 999)
 #define CA_ARG_ELEMENT                 12000
 #define CA_ARG_ELEMENT_TARGET          (CA_ARG_ELEMENT + 0)
@@ -1800,9 +1803,12 @@ struct LevelInfo
   int extra_time;
   int time_orb_time;
 
+  int extra_time_score;
+
   int start_element[MAX_PLAYERS];
   boolean use_start_element[MAX_PLAYERS];
 
+#if 1
   /* values for the new EMC elements */
   int android_move_time;
   int android_clone_time;
@@ -1817,6 +1823,7 @@ struct LevelInfo
   int wind_direction_initial;
   struct Content ball_content[MAX_ELEMENT_CONTENTS];
   boolean android_array[16];
+#endif
 
   int can_move_into_acid_bits; /* bitfield to store property for elements */
   int dont_collide_with_bits;  /* bitfield to store property for elements */