{ EL_EMC_KEY_7, &level.score[SC_KEY], TEXT_COLLECTING },
{ EL_EMC_KEY_8, &level.score[SC_KEY], TEXT_COLLECTING },
{ EL_DC_KEY_WHITE, &level.score[SC_KEY], TEXT_COLLECTING },
+ { EL_MM_KETTLE, &level.score[SC_EMERALD], TEXT_COLLECTING },
+ { EL_DF_CELL, &level.score[SC_EMERALD], TEXT_COLLECTING },
+ { EL_MM_KEY, &level.score[SC_KEY], TEXT_COLLECTING },
+ { EL_MM_LIGHTBALL, &level.score[SC_ELEM_BONUS], TEXT_COLLECTING },
+ { EL_MM_PACMAN, &level.score[SC_PACMAN], TEXT_SMASHING },
+ { EL_MM_PACMAN_RIGHT, &level.score[SC_PACMAN], TEXT_SMASHING },
+ { EL_MM_PACMAN_UP, &level.score[SC_PACMAN], TEXT_SMASHING },
+ { EL_MM_PACMAN_LEFT, &level.score[SC_PACMAN], TEXT_SMASHING },
+ { EL_MM_PACMAN_DOWN, &level.score[SC_PACMAN], TEXT_SMASHING },
{ EL_AMOEBA_WET, &level.amoeba_speed, TEXT_AMOEBA_SPEED },
{ EL_AMOEBA_DRY, &level.amoeba_speed, TEXT_AMOEBA_SPEED },
{ EL_AMOEBA_FULL, &level.amoeba_speed, TEXT_AMOEBA_SPEED },
TYPE_INTEGER, CONF_VALUE_16_BIT(1),
&li.mm_time_fuse, 0
},
+ {
+ EL_MM_LIGHTBALL, -1,
+ TYPE_INTEGER, CONF_VALUE_16_BIT(1),
+ &li.score[SC_ELEM_BONUS], 10
+ },
/* ---------- unused values ----------------------------------------------- */
{
EL_UNKNOWN, SAVE_CONF_NEVER,
TYPE_INTEGER, CONF_VALUE_16_BIT(1),
- &li.score[SC_UNKNOWN_14], 10
- },
- {
- EL_UNKNOWN, SAVE_CONF_NEVER,
- TYPE_INTEGER, CONF_VALUE_16_BIT(2),
&li.score[SC_UNKNOWN_15], 10
},
strcpy(level_mm->name, level->name);
strcpy(level_mm->author, level->author);
+ level_mm->score[SC_EMERALD] = level->score[SC_EMERALD];
level_mm->score[SC_PACMAN] = level->score[SC_PACMAN];
level_mm->score[SC_KEY] = level->score[SC_KEY];
level_mm->score[SC_TIME_BONUS] = level->score[SC_TIME_BONUS];
+ level_mm->score[SC_ELEM_BONUS] = level->score[SC_ELEM_BONUS];
level_mm->amoeba_speed = level->amoeba_speed;
level_mm->time_fuse = level->mm_time_fuse;
if (!strEqual(level_mm->author, ANONYMOUS_NAME))
strcpy(level->author, level_mm->author);
+ level->score[SC_EMERALD] = level_mm->score[SC_EMERALD];
level->score[SC_PACMAN] = level_mm->score[SC_PACMAN];
level->score[SC_KEY] = level_mm->score[SC_KEY];
level->score[SC_TIME_BONUS] = level_mm->score[SC_TIME_BONUS];
+ level->score[SC_ELEM_BONUS] = level_mm->score[SC_ELEM_BONUS];
level->amoeba_speed = level_mm->amoeba_speed;
level->mm_time_fuse = level_mm->time_fuse;
#define SCORE_COOKIE "MIRRORMAGIC_SCORE_FILE_VERSION_1.4"
+int default_score[LEVEL_SCORE_ELEMENTS] =
+{
+ [SC_COLLECTIBLE] = 10,
+ [SC_PACMAN] = 50,
+ [SC_KEY] = 10,
+ [SC_TIME_BONUS] = 1,
+ [SC_LIGHTBALL] = 10,
+};
+
+
/* ========================================================================= */
/* level file functions */
/* ========================================================================= */
for (i = 0; i < LEVEL_SCORE_ELEMENTS; i++)
level->score[i] = getFile8Bit(file);
+ // scores were 0 and hardcoded in game engine in level files up to 2.0.x
+ if (level->file_version <= MM_FILE_VERSION_2_0)
+ for (i = 0; i < LEVEL_SCORE_ELEMENTS; i++)
+ if (level->score[i] == 0)
+ level->score[i] = default_score[i];
+
level->auto_count_kettles = (getFile8Bit(file) == 1 ? TRUE : FALSE);
level->amoeba_speed = getFile8Bit(file);
level->time_fuse = getFile8Bit(file);
static int MovingOrBlocked2Element_MM(int, int);
static void Bang_MM(int, int);
static void RaiseScore_MM(int);
+static void RaiseScoreElement_MM(int);
static void RemoveMovingField_MM(int, int);
static void InitMovingField_MM(int, int, int);
static void ContinueMoving_MM(int, int);
if (game_mm.kettles_still_needed > 0)
game_mm.kettles_still_needed--;
- RaiseScore_MM(10);
-
if (game_mm.kettles_still_needed == 0)
{
CheckExitMM();
{
game_mm.num_keys++;
}
- else if (element == EL_LIGHTBALL)
- {
- RaiseScore_MM(10);
- }
else if (IS_PACMAN(element))
{
DeletePacMan(ELX, ELY);
- RaiseScore_MM(50);
}
+ RaiseScoreElement_MM(element);
+
return FALSE;
}
else if (element == EL_LIGHTBALL)
{
Bang_MM(x, y);
- RaiseScore_MM(10);
+ RaiseScoreElement_MM(element);
DrawLaser(0, DL_LASER_ENABLED);
}
if (!setup.sound_loops)
PlaySoundStereo(SND_SIRR, SOUND_MAX_RIGHT);
if (TimePlayed < 999 && !(TimePlayed % 10))
- RaiseScore_MM(native_mm_level.score[SC_ZEITBONUS]);
+ RaiseScore_MM(native_mm_level.score[SC_TIME_BONUS]);
if (TimePlayed < 900 && !(TimePlayed % 10))
TimePlayed += 10;
else
switch(element)
{
case EL_PACMAN:
+ case EL_PACMAN_RIGHT:
+ case EL_PACMAN_UP:
+ case EL_PACMAN_LEFT:
+ case EL_PACMAN_DOWN:
RaiseScore_MM(native_mm_level.score[SC_PACMAN]);
break;
RaiseScore_MM(native_mm_level.score[SC_KEY]);
break;
+ case EL_KETTLE:
+ case EL_CELL:
+ RaiseScore_MM(native_mm_level.score[SC_COLLECTIBLE]);
+ break;
+
+ case EL_LIGHTBALL:
+ RaiseScore_MM(native_mm_level.score[SC_LIGHTBALL]);
+ break;
+
default:
break;
}
#include "main_mm.h"
-/* score for elements (also used by editor.c) */
-#define SC_EDELSTEIN 0
-#define SC_DIAMANT 1
-#define SC_KAEFER 2
-#define SC_FLIEGER 3
-#define SC_MAMPFER 4
-#define SC_ROBOT 5
-#define SC_PACMAN 6
-#define SC_KOKOSNUSS 7
-#define SC_DYNAMIT 8
-#define SC_KEY 9
-#define SC_ZEITBONUS 10
-
-
void InitAmoebaNr(int, int);
void GameWon_MM(void);
int NewHiScore_MM(void);
#define MAX_SCORE_ENTRIES 100
#define MAX_ELEMENTS 700 /* 500 static + 200 runtime */
-#define LEVEL_SCORE_ELEMENTS 16 /* level elements with score */
-
#define MICROLEVEL_SCROLL_DELAY 50 /* delay for scrolling micro level */
#define MICROLEVEL_LABEL_DELAY 250 /* delay for micro level label */
+/* score for elements */
+#define SC_COLLECTIBLE 0
+#define SC_UNUSED_1 1
+#define SC_UNUSED_2 2
+#define SC_UNUSED_3 3
+#define SC_UNUSED_4 4
+#define SC_UNUSED_5 5
+#define SC_PACMAN 6
+#define SC_UNUSED_7 7
+#define SC_UNUSED_8 8
+#define SC_KEY 9
+#define SC_TIME_BONUS 10
+#define SC_UNUSED_11 11
+#define SC_UNUSED_12 12
+#define SC_UNUSED_13 13
+#define SC_LIGHTBALL 14
+#define SC_UNUSED_15 15
+
+#define LEVEL_SCORE_ELEMENTS 16 /* level elements with score */
+
+
struct HiScore_MM
{
char Name[MAX_PLAYER_NAME_LEN + 1];
#define SC_CRYSTAL 11
#define SC_PEARL 12
#define SC_SHIELD 13
-#define SC_UNKNOWN_14 14
+#define SC_ELEM_BONUS 14
#define SC_UNKNOWN_15 15
#define LEVEL_SCORE_ELEMENTS 16 /* level elements with score */