Fixes some minor buggs

- Monsters now drop loot as soon as they die
    (not after the dagger has stopped moving)
- Artifacts keep correct alignment even after a level switch.
This commit is contained in:
Linus Probert 2018-08-23 08:41:47 +02:00
parent f67aab0b37
commit 449cc362a0
1 changed files with 8 additions and 6 deletions

View File

@ -311,6 +311,7 @@ startGame(void *unused)
gPlayer = player_create(WARRIOR, gCamera); gPlayer = player_create(WARRIOR, gCamera);
mixer_play_music(GAME_MUSIC0 + get_random(2)); mixer_play_music(GAME_MUSIC0 + get_random(2));
resetGame(); resetGame();
skillbar_reset(gSkillBar);
gui_clear_message_log(); gui_clear_message_log();
gui_log("The Dungeon Crawl begins!"); gui_log("The Dungeon Crawl begins!");
gui_event_message("Welcome to the dungeon!"); gui_event_message("Welcome to the dungeon!");
@ -497,8 +498,6 @@ resetGame(void)
if (gMap) if (gMap)
map_destroy(gMap); map_destroy(gMap);
skillbar_reset(gSkillBar);
particle_engine_clear(); particle_engine_clear();
info("Building new map"); info("Building new map");
@ -717,21 +716,24 @@ run_game_update(void)
map_set_current_room(gMap, &gPlayer->sprite->pos); map_set_current_room(gMap, &gPlayer->sprite->pos);
map_update(&updateData); map_update(&updateData);
bool turnSwitch = false;
if (currentTurn == PLAYER) { if (currentTurn == PLAYER) {
if (player_turn_over(gPlayer)) { if (player_turn_over(gPlayer)) {
currentTurn = MONSTER; currentTurn = MONSTER;
player_reset_steps(gPlayer); player_reset_steps(gPlayer);
map_on_new_turn(gMap); map_on_new_turn(gMap);
map_clear_expired_entities(gMap, gPlayer); turnSwitch = true;
repopulate_roommatrix();
} }
} else if (currentTurn == MONSTER) { } else if (currentTurn == MONSTER) {
if (map_move_monsters(gMap, gRoomMatrix)) { if (map_move_monsters(gMap, gRoomMatrix)) {
currentTurn = PLAYER; currentTurn = PLAYER;
turnSwitch = true;
}
}
map_clear_expired_entities(gMap, gPlayer); map_clear_expired_entities(gMap, gPlayer);
if (turnSwitch)
repopulate_roommatrix(); repopulate_roommatrix();
}
}
} }
static void static void