From 77f9842d59c13e15d71e4a01402ec2a37093b864 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Thu, 13 Feb 2020 21:07:18 +0100 Subject: [PATCH] renamed field in level structure for EM engine --- src/files.c | 4 ++-- src/game.c | 4 ++-- src/game_em/cave.c | 6 +++--- src/game_em/cave.h | 6 +++--- src/game_em/convert.c | 3 +-- src/game_em/emerald.h | 6 +++--- src/game_em/logic.c | 10 +++++----- src/game_em/reademc.c | 2 +- 8 files changed, 20 insertions(+), 21 deletions(-) diff --git a/src/files.c b/src/files.c index 5958d83c..e94692c5 100644 --- a/src/files.c +++ b/src/files.c @@ -3522,7 +3522,7 @@ static void CopyNativeLevel_RND_to_EM(struct LevelInfo *level) cav->height = MIN(level->fieldy, MAX_PLAYFIELD_HEIGHT); cav->time_seconds = level->time; - cav->required = level->gems_needed; + cav->gems_needed = level->gems_needed; cav->emerald_score = level->score[SC_EMERALD]; cav->diamond_score = level->score[SC_DIAMOND]; @@ -3630,7 +3630,7 @@ static void CopyNativeLevel_EM_to_RND(struct LevelInfo *level) level->fieldy = MIN(cav->height, MAX_LEV_FIELDY); level->time = cav->time_seconds; - level->gems_needed = cav->required; + level->gems_needed = cav->gems_needed; sprintf(level->name, "Level %d", level->file_info.nr); diff --git a/src/game.c b/src/game.c index fbe34cc7..00c7b5e5 100644 --- a/src/game.c +++ b/src/game.c @@ -2228,14 +2228,14 @@ static void UpdateGameControlValues(void) game_mm.score : game.score); int gems = (level.game_engine_type == GAME_ENGINE_TYPE_EM ? - game_em.lev->required : + game_em.lev->gems_needed : level.game_engine_type == GAME_ENGINE_TYPE_SP ? game_sp.infotrons_still_needed : level.game_engine_type == GAME_ENGINE_TYPE_MM ? game_mm.kettles_still_needed : game.gems_still_needed); int exit_closed = (level.game_engine_type == GAME_ENGINE_TYPE_EM ? - game_em.lev->required > 0 : + game_em.lev->gems_needed > 0 : level.game_engine_type == GAME_ENGINE_TYPE_SP ? game_sp.infotrons_still_needed > 0 : level.game_engine_type == GAME_ENGINE_TYPE_MM ? diff --git a/src/game_em/cave.c b/src/game_em/cave.c index 821602ed..42d2eb0a 100644 --- a/src/game_em/cave.c +++ b/src/game_em/cave.c @@ -29,16 +29,16 @@ void setLevelInfoToDefaults_EM(void) } cav.time_seconds = 0; - cav.required = 0; + cav.gems_needed = 0; cav.eater_score = 0; cav.alien_score = 0; cav.bug_score = 0; cav.tank_score = 0; + cav.slurp_score = 0; + cav.nut_score = 0; cav.emerald_score = 0; cav.diamond_score = 0; - cav.nut_score = 0; - cav.slurp_score = 0; cav.dynamite_score = 0; cav.key_score = 0; cav.lenses_score = 0; diff --git a/src/game_em/cave.h b/src/game_em/cave.h index 133681c6..28984d6d 100644 --- a/src/game_em/cave.h +++ b/src/game_em/cave.h @@ -15,16 +15,16 @@ struct CAVE int player_y[MAX_PLAYERS]; /* player y pos */ int time_seconds; /* available time (seconds) */ - int required; /* emeralds needed */ + int gems_needed; /* emeralds needed */ int eater_score; /* score for killing eater */ int alien_score; /* score for killing alien */ int bug_score; /* score for killing bug */ int tank_score; /* score for killing tank */ + int slurp_score; /* score for slurping alien with spring */ + int nut_score; /* score for cracking nut to emerald */ int emerald_score; /* score for collecting emerald */ int diamond_score; /* score for collecting diamond */ - int nut_score; /* score for cracking nut */ - int slurp_score; /* score for slurping alien with spring */ int dynamite_score; /* score for collecting dynamite */ int key_score; /* score for colleting key */ int lenses_score; /* score for collecting lenses */ diff --git a/src/game_em/convert.c b/src/game_em/convert.c index 7d5d3ef0..509437c7 100644 --- a/src/game_em/convert.c +++ b/src/game_em/convert.c @@ -48,8 +48,7 @@ void prepare_em_level(void) lev.next[x][y] = lev.draw[x][y] = lev.cave[x][y]; lev.time = cav.time_seconds; - - lev.required = cav.required; + lev.gems_needed = cav.gems_needed; lev.score = 0; lev.eater_score = cav.eater_score; diff --git a/src/game_em/emerald.h b/src/game_em/emerald.h index 13854ac2..b3f285a9 100644 --- a/src/game_em/emerald.h +++ b/src/game_em/emerald.h @@ -629,17 +629,17 @@ struct LOGIC int bottom; /* cave bottom edge */ int time; /* time remaining */ - int required; /* emeralds needed */ + int gems_needed; /* emeralds needed */ int score; /* score */ int eater_score; /* score for killing eater */ int alien_score; /* score for killing alien */ int bug_score; /* score for killing bug */ int tank_score; /* score for killing tank */ + int slurp_score; /* score for slurping alien with spring */ + int nut_score; /* score for cracking nut to emerald */ int emerald_score; /* score for collecting emerald */ int diamond_score; /* score for collecting diamond */ - int nut_score; /* score for cracking nut */ - int slurp_score; /* score for slurping alien with spring */ int dynamite_score; /* score for collecting dynamite */ int key_score; /* score for colleting key */ int lenses_score; /* score for collecting lenses */ diff --git a/src/game_em/logic.c b/src/game_em/logic.c index bfe1d843..ae3a9541 100644 --- a/src/game_em/logic.c +++ b/src/game_em/logic.c @@ -533,7 +533,7 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) next[x][y] = Zplayer; play_element_sound(x, y, SOUND_collect, element); lev.score += lev.diamond_score; - lev.required = lev.required < 3 ? 0 : lev.required - 3; + lev.gems_needed = lev.gems_needed < 3 ? 0 : lev.gems_needed - 3; game.snapshot.collected_item = TRUE; ply->anim = PLY_walk_n + anim; ply->x = x; @@ -546,7 +546,7 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) next[x][y] = Zplayer; play_element_sound(x, y, SOUND_collect, element); lev.score += lev.emerald_score; - lev.required = lev.required < 1 ? 0 : lev.required - 1; + lev.gems_needed = lev.gems_needed < 1 ? 0 : lev.gems_needed - 1; game.snapshot.collected_item = TRUE; ply->anim = PLY_walk_n + anim; ply->x = x; @@ -1124,7 +1124,7 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) next[x][y] = Xblank; play_element_sound(x, y, SOUND_collect, element); lev.score += lev.diamond_score; - lev.required = lev.required < 3 ? 0 : lev.required - 3; + lev.gems_needed = lev.gems_needed < 3 ? 0 : lev.gems_needed - 3; game.snapshot.collected_item = TRUE; ply->anim = PLY_walk_n + anim; break; @@ -1135,7 +1135,7 @@ static boolean player_digfield(struct PLAYER *ply, int dx, int dy) next[x][y] = Xblank; play_element_sound(x, y, SOUND_collect, element); lev.score += lev.emerald_score; - lev.required = lev.required < 1 ? 0 : lev.required - 1; + lev.gems_needed = lev.gems_needed < 1 ? 0 : lev.gems_needed - 1; game.snapshot.collected_item = TRUE; ply->anim = PLY_walk_n + anim; break; @@ -6551,7 +6551,7 @@ static void Lslide_ew(int x, int y) static void Lexit(int x, int y) { - if (lev.required > 0) + if (lev.gems_needed > 0) return; switch (RANDOM(64) / 21) diff --git a/src/game_em/reademc.c b/src/game_em/reademc.c index 705de11d..c052ea98 100644 --- a/src/game_em/reademc.c +++ b/src/game_em/reademc.c @@ -333,7 +333,7 @@ void convert_em_level(unsigned char *src, int file_version) if (cav.time_seconds > 9999) cav.time_seconds = 9999; - cav.required = src[2095]; + cav.gems_needed = src[2095]; /* scores */ -- 2.34.1