Real-time clock for DNA points

This commit is contained in:
Shadow15510 2021-05-29 23:10:09 +02:00
parent da2a9b4172
commit 51adb19ba1
5 changed files with 8 additions and 11 deletions

Binary file not shown.

View File

@ -43,6 +43,13 @@ void next_frame(struct game *current_game)
}
}
current_game->time += ENGINE_TICK;
if (current_game->time > 10000)
{
current_game->dna += 1;
current_game->time = 0;
// Epidemic propagation simulation to add here
}
}

View File

@ -39,9 +39,6 @@ void display_foreground(const int background, const struct game *current_game)
break;
case 3:
dprint(1, 35, C_BLACK, "C:%d S:%d L:%d", current_game->contagion, current_game->severity, current_game->lethality);
dprint(102, 37, C_BLACK, "%d", current_game->dna);
length = 67 * current_game->contagion / 26;

View File

@ -44,7 +44,7 @@ int main(void)
.severity = 0,
.lethality = 0,
.dna = 100,
.dna = 0,
.mutations_count = {0, 0, 0},
.mutations_selected = {0, 0, 0},

View File

@ -145,13 +145,6 @@ void update_disease(struct game *current_game)
struct mutation *ability = get_mutation_data(2, current_game->mutations_selected[1]);
struct mutation *transmission = get_mutation_data(3, current_game->mutations_selected[2]);
dclear(C_WHITE);
dprint(0, 0, C_BLACK, "SY C:%d S:%d L:%d", symptom->contagion, symptom->severity, symptom->lethality);
dprint(0, 8, C_BLACK, "AB C:%d S:%d L:%d", ability->contagion, ability->severity, ability->lethality);
dprint(0, 16, C_BLACK, "TR C:%d S:%d L:%d", transmission->contagion, transmission->severity, transmission->lethality);
dupdate();
getkey();
current_game->contagion = symptom->contagion + ability->contagion + transmission->contagion;
current_game->severity = symptom->severity + ability->severity + transmission->severity;
current_game->lethality = symptom->lethality + ability->lethality + transmission->lethality;