projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rnd-20030411-1-src
[rocksndiamonds.git]
/
src
/
game.c
diff --git
a/src/game.c
b/src/game.c
index a9d0e2698361c6f1869024455056e3e6ea869e0d..d60f158a4404d9f6a443f6d91568cedc835c1e07 100644
(file)
--- a/
src/game.c
+++ b/
src/game.c
@@
-658,6
+658,8
@@
void InitGame()
player->is_moving = FALSE;
player->is_waiting = FALSE;
player->is_moving = FALSE;
player->is_waiting = FALSE;
+ player->is_digging = FALSE;
+ player->is_collecting = FALSE;
player->move_delay = game.initial_move_delay;
player->move_delay_value = game.initial_move_delay_value;
player->move_delay = game.initial_move_delay;
player->move_delay_value = game.initial_move_delay_value;
@@
-917,7
+919,7
@@
void InitGame()
else
{
DrawTextExt(drawto, DX + XX_EMERALDS, DY + YY_EMERALDS,
else
{
DrawTextExt(drawto, DX + XX_EMERALDS, DY + YY_EMERALDS,
- int2str(level_nr, 3), FONT_LEVEL_NUMBER,
FON
T_OPAQUE);
+ int2str(level_nr, 3), FONT_LEVEL_NUMBER,
BLI
T_OPAQUE);
BlitBitmap(drawto, drawto,
DX + XX_EMERALDS, DY + YY_EMERALDS + 1,
getFontWidth(FONT_LEVEL_NUMBER) * 3,
BlitBitmap(drawto, drawto,
DX + XX_EMERALDS, DY + YY_EMERALDS + 1,
getFontWidth(FONT_LEVEL_NUMBER) * 3,
@@
-1382,6
+1384,7
@@
static int MovingOrBlocked2ElementIfNotLeaving(int x, int y)
static void RemoveField(int x, int y)
{
Feld[x][y] = EL_EMPTY;
static void RemoveField(int x, int y)
{
Feld[x][y] = EL_EMPTY;
+ GfxElement[x][y] = EL_EMPTY;
MovPos[x][y] = 0;
MovDir[x][y] = 0;
MovDelay[x][y] = 0;
MovPos[x][y] = 0;
MovDir[x][y] = 0;
MovDelay[x][y] = 0;
@@
-1615,6
+1618,7
@@
void Explode(int ex, int ey, int phase, int mode)
}
Feld[x][y] = EL_EXPLOSION;
}
Feld[x][y] = EL_EXPLOSION;
+ GfxElement[x][y] = EL_EMPTY;
MovDir[x][y] = MovPos[x][y] = 0;
AmoebaNr[x][y] = 0;
ExplodePhase[x][y] = 1;
MovDir[x][y] = MovPos[x][y] = 0;
AmoebaNr[x][y] = 0;
ExplodePhase[x][y] = 1;
@@
-1686,7
+1690,7
@@
void Explode(int ex, int ey, int phase, int mode)
int frame = getGraphicAnimationFrame(graphic, phase - delay);
if (phase == delay)
int frame = getGraphicAnimationFrame(graphic, phase - delay);
if (phase == delay)
- Draw
CrumbledSand(SCREENX(x), SCREENY(y)
);
+ Draw
LevelFieldCrumbledSand(x, y
);
if (IS_PFORTE(Store[x][y]))
{
if (IS_PFORTE(Store[x][y]))
{
@@
-3395,7
+3399,7
@@
void ContinueMoving(int x, int y)
yy = y + xy[i][1];
if (IN_LEV_FIELD(xx, yy) && Feld[xx][yy] == EL_SAND)
yy = y + xy[i][1];
if (IN_LEV_FIELD(xx, yy) && Feld[xx][yy] == EL_SAND)
- DrawLevelField(xx, yy); /* for "
DrawCrumbledSand()
" */
+ DrawLevelField(xx, yy); /* for "
crumbled sand
" */
}
}
}
}
@@
-4380,7
+4384,7
@@
static void ChangeActiveTrap(int x, int y)
/* if new animation frame was drawn, correct crumbled sand border */
if (IS_NEW_FRAME(GfxFrame[x][y], graphic))
/* if new animation frame was drawn, correct crumbled sand border */
if (IS_NEW_FRAME(GfxFrame[x][y], graphic))
- Draw
CrumbledSand(SCREENX(x), SCREENY(y)
);
+ Draw
LevelFieldCrumbledSand(x, y
);
}
static void ChangeElement(int x, int y)
}
static void ChangeElement(int x, int y)
@@
-5251,7
+5255,7
@@
boolean MoveFigure(struct PlayerInfo *player, int dx, int dy)
else if (old_jx == jx && old_jy != jy)
player->MovDir = (old_jy < jy ? MV_DOWN : MV_UP);
else if (old_jx == jx && old_jy != jy)
player->MovDir = (old_jy < jy ? MV_DOWN : MV_UP);
- DrawLevelField(jx, jy); /* for "
DrawCrumbledSand()
" */
+ DrawLevelField(jx, jy); /* for "
crumbled sand
" */
player->last_move_dir = player->MovDir;
player->is_moving = TRUE;
player->last_move_dir = player->MovDir;
player->is_moving = TRUE;
@@
-5664,7
+5668,10
@@
int DigField(struct PlayerInfo *player,
int element;
if (player->MovPos == 0)
int element;
if (player->MovPos == 0)
+ {
player->is_digging = FALSE;
player->is_digging = FALSE;
+ player->is_collecting = FALSE;
+ }
if (player->MovPos == 0)
player->Pushing = FALSE;
if (player->MovPos == 0)
player->Pushing = FALSE;
@@
-5721,11
+5728,14
@@
int DigField(struct PlayerInfo *player,
case EL_SP_BASE:
case EL_SP_BUGGY_BASE:
case EL_SP_BUGGY_BASE_ACTIVATING:
case EL_SP_BASE:
case EL_SP_BUGGY_BASE:
case EL_SP_BUGGY_BASE_ACTIVATING:
+ RemoveField(x, y);
#if 1
#if 1
- if (mode != DF_SNAP && element == EL_SAND)
- GfxElement[x][y] = Feld[x][y];
+ if (mode != DF_SNAP && element != EL_EMPTY)
+ {
+ GfxElement[x][y] = (CAN_BE_CRUMBLED(element) ? EL_SAND : element);
+ player->is_digging = TRUE;
+ }
#endif
#endif
- RemoveField(x, y);
PlaySoundLevelElementAction(x, y, element, ACTION_DIGGING);
break;
PlaySoundLevelElementAction(x, y, element, ACTION_DIGGING);
break;
@@
-5739,6
+5749,13
@@
int DigField(struct PlayerInfo *player,
case EL_PEARL:
case EL_CRYSTAL:
RemoveField(x, y);
case EL_PEARL:
case EL_CRYSTAL:
RemoveField(x, y);
+#if 1
+ if (mode != DF_SNAP)
+ {
+ GfxElement[x][y] = element;
+ player->is_collecting = TRUE;
+ }
+#endif
local_player->gems_still_needed -= (element == EL_DIAMOND ? 3 :
element == EL_PEARL ? 5 :
element == EL_CRYSTAL ? 8 : 1);
local_player->gems_still_needed -= (element == EL_DIAMOND ? 3 :
element == EL_PEARL ? 5 :
element == EL_CRYSTAL ? 8 : 1);
@@
-6368,8
+6385,8
@@
int DigField(struct PlayerInfo *player,
player->push_delay = 0;
player->push_delay = 0;
- if (Feld[x][y] != element) /* really digged something */
- player->is_
digging = TRUE
;
+ if (Feld[x][y] != element) /* really digged
/collected
something */
+ player->is_
collecting = !player->is_digging
;
return MF_MOVING;
}
return MF_MOVING;
}
@@
-6393,7
+6410,10
@@
boolean SnapField(struct PlayerInfo *player, int dx, int dy)
player->snapped = FALSE;
if (player->MovPos == 0)
player->snapped = FALSE;
if (player->MovPos == 0)
+ {
player->is_digging = FALSE;
player->is_digging = FALSE;
+ player->is_collecting = FALSE;
+ }
return FALSE;
}
return FALSE;
}
@@
-6411,6
+6431,8
@@
boolean SnapField(struct PlayerInfo *player, int dx, int dy)
player->snapped = TRUE;
player->is_digging = FALSE;
player->snapped = TRUE;
player->is_digging = FALSE;
+ player->is_collecting = FALSE;
+
DrawLevelField(x, y);
BackToFront();
DrawLevelField(x, y);
BackToFront();