Minor corrections on epidemic model

This commit is contained in:
Shadow15510 2021-06-04 15:36:10 +02:00
parent de7f58751f
commit 10dc257f20
5 changed files with 9 additions and 12 deletions

Binary file not shown.

View File

@ -47,10 +47,7 @@ void next_frame(struct game *current_game)
current_game->planes[i]->direction = new_dir;
// Infect the plane
if (current_game->grid.data[current_game->planes[i]->x + current_game->planes[i]->y * current_game->grid.width] == 1 &&
(current_game->mutations_selected[2] == 3 ||
current_game->mutations_selected[2] == 2 ||
current_game->mutations_selected[2] == 5)) current_game->planes[i]->is_infected = 1;
if (current_game->grid.data[current_game->planes[i]->x + current_game->planes[i]->y * current_game->grid.width] == 1 && current_game->mutations_selected[2] == 4) current_game->planes[i]->is_infected = 1;
}

View File

@ -40,7 +40,8 @@ struct game
int mutations_bought[3][14];
// Research data
int research, limit, priority;
int research, limit;
float priority;
// Humans stats : healthy, infected, dead, healed
int humans[4];

View File

@ -15,7 +15,7 @@ bool can_become_infected(const struct grid epidemic_grid, const int mutations_se
extern const uint8_t world[64][128];
// In case of water, low or high temperature
if (world[j][i] == 0 && mutations_selected[2] != 3 && mutations_selected[2] != 2 && mutations_selected[2] != 5) return false;
if (world[j][i] == 0 && mutations_selected[2] != 3 && mutations_selected[2] != 4 && mutations_selected[2] != 6) return false;
if (world[j][i] == 1 && mutations_selected[1] != 1 && mutations_selected[1] != 5) return false;
if (world[j][i] == 3 && mutations_selected[1] != 2 && mutations_selected[1] != 5) return false;

View File

@ -80,10 +80,10 @@ void mutation_select(struct game *current_game, const int mutation_menu)
end = mutation_buy(current_game, c, mutation_menu, table);
}
if (key == KEY_LEFT && c.x > 0) c.x --;
if (key == KEY_RIGHT && c.x < 7) c.x ++;
if (key == KEY_UP && c.y > 0) c.y --;
if (key == KEY_DOWN && c.y < 3) c.y ++;
if (key == KEY_LEFT && c.x > 0) c.x = (c.x - 1) % 8;
if (key == KEY_RIGHT && c.x < 7) c.x = (c.x + 1) % 8;
if (key == KEY_UP && c.y > 0) c.y = (c.y - 1) % 4;
if (key == KEY_DOWN && c.y < 3) c.y = (c.y + 1) % 4;
}
if (t >= 0) timer_stop(t);
}
@ -125,8 +125,7 @@ int mutation_buy(struct game *current_game, const struct cursor c, const int mut
// Update
update_disease(current_game);
current_game->priority += floor((mutation_data->severity + mutation_data->lethality) / 20);
current_game->priority += ceil((mutation_data->severity + mutation_data->lethality)/10);
const char *msg[5] = {"mutation", "achetee", "", "", ""};
message(msg);
}