EL_AMOEBE_NASS,
EL_AMOEBE_NORM,
- EL_SCHLUESSEL1,
- EL_SCHLUESSEL2,
- EL_SCHLUESSEL3,
- EL_SCHLUESSEL4,
+ EL_EM_KEY_1_FILE,
+ EL_EM_KEY_2_FILE,
+ EL_EM_KEY_3_FILE,
+ EL_EM_KEY_4_FILE,
EL_EM_GATE_1,
EL_EM_GATE_2,
EL_CHAR('R'),
EL_CHAR('E'),
+ EL_SCHLUESSEL1,
+ EL_SCHLUESSEL2,
+ EL_SCHLUESSEL3,
+ EL_SCHLUESSEL4,
+
EL_PFORTE1,
EL_PFORTE2,
EL_PFORTE3,
{ EL_SCHLUESSEL2, &level.score[9], TEXT_COLLECTING },
{ EL_SCHLUESSEL3, &level.score[9], TEXT_COLLECTING },
{ EL_SCHLUESSEL4, &level.score[9], TEXT_COLLECTING },
+ { EL_EM_KEY_1_FILE, &level.score[9], TEXT_COLLECTING },
+ { EL_EM_KEY_2_FILE, &level.score[9], TEXT_COLLECTING },
+ { EL_EM_KEY_3_FILE, &level.score[9], TEXT_COLLECTING },
+ { EL_EM_KEY_4_FILE, &level.score[9], TEXT_COLLECTING },
{ EL_AMOEBE_NASS, &level.tempo_amoebe, TEXT_SPEED },
{ EL_AMOEBE_NORM, &level.tempo_amoebe, TEXT_SPEED },
{ EL_AMOEBE_VOLL, &level.tempo_amoebe, TEXT_SPEED },
Feld[x][y] = EL_LEERRAUM;
break;
+ case EL_EM_KEY_1_FILE:
+ Feld[x][y] = EL_EM_KEY_1;
+ break;
+ case EL_EM_KEY_2_FILE:
+ Feld[x][y] = EL_EM_KEY_2;
+ break;
+ case EL_EM_KEY_3_FILE:
+ Feld[x][y] = EL_EM_KEY_3;
+ break;
+ case EL_EM_KEY_4_FILE:
+ Feld[x][y] = EL_EM_KEY_4;
+ break;
+
default:
break;
}
return element;
}
+static int MovingOrBlocked2ElementIfNotLeaving(int x, int y)
+{
+ /* like MovingOrBlocked2Element(), but if element is moving
+ and (x,y) is the field the moving element is just leaving,
+ return EL_BLOCKED instead of the element value */
+ int element = Feld[x][y];
+
+ if (IS_MOVING(x, y))
+ {
+ if (element == EL_BLOCKED)
+ {
+ int oldx, oldy;
+
+ Blocked2Moving(x, y, &oldx, &oldy);
+ return Feld[oldx][oldy];
+ }
+ else
+ return EL_BLOCKED;
+ }
+ else
+ return element;
+}
+
static void RemoveField(int x, int y)
{
Feld[x][y] = EL_LEERRAUM;
case EL_SCHLUESSEL2:
case EL_SCHLUESSEL3:
case EL_SCHLUESSEL4:
+ case EL_EM_KEY_1:
+ case EL_EM_KEY_2:
+ case EL_EM_KEY_3:
+ case EL_EM_KEY_4:
sound = SND_KINK;
break;
case EL_ZEIT_VOLL:
if (!options.network && !AllPlayersInSight(player, new_jx, new_jy))
return MF_NO_ACTION;
+#if 0
element = MovingOrBlocked2Element(new_jx, new_jy);
+#else
+ element = MovingOrBlocked2ElementIfNotLeaving(new_jx, new_jy);
+#endif
if (DONT_GO_TO(element))
{
if (!IN_LEV_FIELD(x, y))
continue;
+#if 0
element = Feld[x][y];
+#else
+ element = MovingOrBlocked2ElementIfNotLeaving(x, y);
+#endif
if (DONT_TOUCH(element))
{
case EL_SCHLUESSEL3:
case EL_SCHLUESSEL4:
{
- int key_nr = element-EL_SCHLUESSEL1;
+ int key_nr = element - EL_SCHLUESSEL1;
+
+ RemoveField(x, y);
+ player->key[key_nr] = TRUE;
+ RaiseScoreElement(EL_SCHLUESSEL);
+ DrawMiniGraphicExt(drawto, gc,
+ DX_KEYS+key_nr*MINI_TILEX, DY_KEYS,
+ GFX_SCHLUESSEL1+key_nr);
+ DrawMiniGraphicExt(window, gc,
+ DX_KEYS+key_nr*MINI_TILEX, DY_KEYS,
+ GFX_SCHLUESSEL1+key_nr);
+ PlaySoundLevel(x, y, SND_PONG);
+ break;
+ }
+
+ case EL_EM_KEY_1:
+ case EL_EM_KEY_2:
+ case EL_EM_KEY_3:
+ case EL_EM_KEY_4:
+ {
+ int key_nr = element - EL_EM_KEY_1;
RemoveField(x, y);
player->key[key_nr] = TRUE;
EL_SCHLUESSEL1,
EL_SCHLUESSEL2,
EL_SCHLUESSEL3,
- EL_SCHLUESSEL4
+ EL_SCHLUESSEL4,
+ EL_EM_KEY_1,
+ EL_EM_KEY_2,
+ EL_EM_KEY_3,
+ EL_EM_KEY_4
};
static int ep_schluessel_num = sizeof(ep_schluessel)/sizeof(int);
EL_SCHLUESSEL2,
EL_SCHLUESSEL3,
EL_SCHLUESSEL4,
+ EL_EM_KEY_1,
+ EL_EM_KEY_2,
+ EL_EM_KEY_3,
+ EL_EM_KEY_4,
EL_BOMBE,
EL_KOKOSNUSS,
EL_TROPFEN,
EL_SCHLUESSEL2,
EL_SCHLUESSEL3,
EL_SCHLUESSEL4,
+ EL_EM_KEY_1,
+ EL_EM_KEY_2,
+ EL_EM_KEY_3,
+ EL_EM_KEY_4,
EL_PFORTE1,
EL_PFORTE2,
EL_PFORTE3,
#define EL_SCHWEIN 117
#define EL_DRACHE 118
-#define EL_UNUSED_119 119
+#define EL_EM_KEY_1_FILE 119
#define EL_CHAR_START 120
#define EL_CHAR_ASCII0 (EL_CHAR_START-32)
#define EL_EM_GATE_3 205
#define EL_EM_GATE_4 206
-#define EL_UNUSED_207 207
-#define EL_UNUSED_208 208
-#define EL_UNUSED_209 209
+#define EL_EM_KEY_2_FILE 207
+#define EL_EM_KEY_3_FILE 208
+#define EL_EM_KEY_4_FILE 209
#define EL_SP_START 210
#define EL_SP_EMPTY (EL_SP_START + 0)
#define EL_AUSGANG_ACT 306
#define EL_SP_TERMINAL_ACTIVE 307
#define EL_SP_BUG_ACTIVE 308
+#define EL_EM_KEY_1 309
+#define EL_EM_KEY_2 310
+#define EL_EM_KEY_3 311
+#define EL_EM_KEY_4 312
/* "unreal" (and therefore not drawable) runtime elements */
#define EL_BLOCKED 400
case EL_EM_GATE_2X: return GFX_EM_GATE_2X;
case EL_EM_GATE_3X: return GFX_EM_GATE_3X;
case EL_EM_GATE_4X: return GFX_EM_GATE_4X;
+ case EL_EM_KEY_1_FILE: return GFX_EM_KEY_1;
+ case EL_EM_KEY_2_FILE: return GFX_EM_KEY_2;
+ case EL_EM_KEY_3_FILE: return GFX_EM_KEY_3;
+ case EL_EM_KEY_4_FILE: return GFX_EM_KEY_4;
+ case EL_EM_KEY_1: return GFX_EM_KEY_1;
+ case EL_EM_KEY_2: return GFX_EM_KEY_2;
+ case EL_EM_KEY_3: return GFX_EM_KEY_3;
+ case EL_EM_KEY_4: return GFX_EM_KEY_4;
default:
{