Add descriptions for mutations

This commit is contained in:
Shadow15510 2021-06-04 18:21:01 +02:00
parent d6b7f39417
commit 5e5e17c540
8 changed files with 66 additions and 36 deletions

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

@ -92,7 +92,7 @@ int get_inputs(const int background, int *mutation_menu)
if (key == KEY_OPTN && (background == 1 || background == 2)) return (background % 2) + 1;
if (key == KEY_VARS)
{
*mutation_menu = 1;
*mutation_menu = 4;
return 3;
}
if (key == KEY_SQUARE) return 6;

View File

@ -4,53 +4,53 @@
// (contation, severity, lethality, DNA cost, change to cure requirement)
const struct mutation symptoms_data[14] =
{
{10, 10, 0, 2, 0, "NAUSEE"},
{15, 10, 0, 10, 0, "VOMISSEMENT"},
{10, 5, 0, 3, 0, "TOUX"},
{15, 20, 0, 10, 0, "PNEUMONIE"},
{10, 30, 20, 15, 10, "TUMEUR"},
{15, 10, 5, 4, 0, "PLAIES"},
{10, 10, 10, 10, 0, "LESIONS"},
{30, 20, 20, 20, 5, "HEMORRAGIE"},
{25, 15, 10, 17, 0, "INFECTION"},
{15, 10, 5, 5, 0, "INFLAMMATION"},
{10, 15, 20, 15, 0, "IMMUNITE"},
{ 0, 20, 0, 15, 10, "PARANOIA"},
{ 0, 15, 15, 20, 10, "FOLIE"},
{ 0, 30, 30, 30, 20, "ARRET TOTAL"},
{10, 10, 0, 2, 0, "NAUSEE", "DONNE DES NAUSEES"},
{15, 10, 0, 10, 0, "VOMISSEMENT", "PROVOQUE DES REJETS GESTRIQUES"},
{10, 5, 0, 3, 0, "TOUX", "LA PROJECTION DE PARTICULE AUGMENTE LA CONTAGION"},
{15, 20, 5, 10, 0, "PNEUMONIE", "AFFECTION PULMONAIRE PEU MORTELLE"},
{ 0, 30, 20, 15, 10, "TUMEUR", "PEU CONTAGIEUX, MAIS MORTEL"},
{15, 10, 5, 4, 0, "PLAIES", "LA PEAU S'ASSECHE ET DEVIENT CASSANTE"},
{10, 10, 10, 10, 0, "LESIONS", "BLOQUE LA CICATRISATION"},
{30, 20, 20, 20, 5, "HEMORRAGIE", "BLOQUE L'ACTION DES PLAQUETTES"},
{25, 15, 10, 17, 0, "INFECTION", "CREER DES FOYERS D'INFECTION DANS LE CORPS"},
{15, 10, 5, 5, 0, "INFLAMMATION", "PROVOQUE DES ROUGEURS ET DEMANGEAISONS"},
{10, 15, 20, 15, 0, "IMMUNITE", "BLOQUE L'ACTION DU SYSTEME IMMUNITAIRE"},
{ 0, 20, 0, 15, 10, "PARANOIA", "LES CHERCHEURS N'ARRIVENT PLUS A COOPERER ENTRE EUX"},
{ 0, 15, 15, 20, 10, "FOLIE", "PROVOQUE DES CRISES D'HYSTERIES"},
{ 0, 30, 30, 30, 20, "ARRET TOTAL", "EMPECHE LES ORGANES DE FONCTIONNER "},
};
const struct mutation abilities_data[6] =
{
{15, 0, 0, 10, 0, "FROID"},
{15, 0, 0, 15, 0, "CHAUD"},
{ 0, 10, 4, 25, 10, "GENETIQUE"},
{10, 40, 20, 30, 20, "MUTATION+"},
{30, 10, 0, 30, 0, "ENVIRON"},
{ 0, 15, 30, 15, 20, "MEDICAMENT"},
{15, 0, 0, 10, 0, "FROID", "RESISTANCE AU FROID"},
{15, 0, 0, 15, 0, "CHAUD", "RESISTANCE AU CHAUD"},
{ 0, 10, 4, 25, 10, "GENETIQUE", "LE GENOME MUTE, RALENTISSANT LE SEQUENCAGE ADN"},
{10, 40, 20, 30, 20, "MUTATION+", "LE VIRUS MUTE, BLOQUANT LES CHERCHEURS"},
{30, 10, 0, 30, 0, "ENVIRON", "LE VIRUS RESISTE AUX ENVIRONNEMENTS LES PLUS HOSTILES"},
{ 0, 15, 30, 15, 20, "MEDICAMENT", "RESISTANCES AU MEDICAMENTS"},
};
const struct mutation transmissions_data[13] =
{
{ 5, 0, 0, 9, 0, "AIR 1"},
{10, 10, 0, 15, 0, "AIR 2"},
{20, 10, 0, 20, 0, "AIR 3"},
{40, 15, 0, 30, 0, "AEROSOL"},
{10, 0, 0, 9, 0, "EAU 1"},
{20, 10, 0, 12, 0, "EAU 2"},
{20, 0, 0, 10, 0, "ANIMAL 1"},
{40, 10, 0, 16, 0, "ANIMAL 2"},
{20, 0, 0, 12, 0, "OISEAU 1"},
{40, 10, 0, 16, 0, "OISEAU 2"},
{10, 0, 0, 8, 0, "SANG 1"},
{20, 10, 0, 14, 0, "SANG 2"},
{40, 15, 0, 20, 0, "SANG 3"},
{ 5, 0, 0, 9, 0, "AIR 1", "TRANSMISSION PAR L'AIR"},
{10, 10, 0, 15, 0, "AIR 2", "TRANSMISSION PAR L'AIR"},
{20, 10, 0, 20, 0, "AIR 3", "TRANSMISSION PAR L'AIR"},
{40, 15, 0, 30, 0, "AEROSOL", "TRANSMISSION PAR L'AIR ET PAR L'EAU"},
{10, 0, 0, 9, 0, "EAU 1", "TRANSMISSION PAR L'EAU"},
{20, 10, 0, 12, 0, "EAU 2", "TRANSMISSION PAR L'EAU"},
{20, 0, 0, 10, 0, "ANIMAL 1", "LE VIRUS PEUT PASSER DE L'ANIMAL À L'HOMME"},
{40, 10, 0, 16, 0, "ANIMAL 2", "CAPACITE DE TRANSMISSION HOMME-ANIMAL"},
{20, 0, 0, 12, 0, "OISEAU 1", "CAPACITE DE TRANSMISSION ENTRE LES OISEAU"},
{40, 10, 0, 16, 0, "OISEAU 2", "LES OISEAUX DEVIENNENT DES VECTEURS VIRALS"},
{10, 0, 0, 8, 0, "SANG 1", "LE VIRUS SE TRANSMET PAR LE SANG"},
{20, 10, 0, 14, 0, "SANG 2", "LE VIRUS SE TRANSMET PAR LE SANG"},
{40, 15, 0, 20, 0, "SANG 3", "LE VIRUS SE TRANSMET PAR LE SANG"},
};
const struct mutation default_value = {0, 0, 0, 0, 0, "NONE"};
const struct mutation default_value = {0, 0, 0, 0, 0, "NONE", "NONE"};
/* Encoded data for the world

View File

@ -146,6 +146,28 @@ void display_mutation_buy(const struct cursor c, const int mutation_menu, const
}
void display_mutation_description(const char *name, const char *description, const int mutation_menu, const int id)
{
extern const bopti_image_t img_mutations;
int decalage = 0;
dclear(C_WHITE);
display_background(8);
dsubimage(3, 21, &img_mutations, 16 * (mutation_menu - 1), 16 * (id - 1), 15, 15, DIMAGE_NONE);
dprint(47, 25, C_BLACK, name);
for (int i = 0; i < 4; i ++)
{
dtext_opt(25, 33 + i * 7, C_BLACK, C_WHITE, 0 ,0, description + decalage, 16 );
if (description[decalage+1] == '\0') break;
else decalage += 16;
}
dupdate();
}
void display_message(const char *msg[5])
{
dclear(C_WHITE);

View File

@ -15,6 +15,9 @@ void display_mutation(const int table[4][8], const struct cursor c, const int mu
// mutation_selected : display the mutation's informations screen
void display_mutation_buy(const struct cursor c, const int mutation_menu, const int table[4][8], const int button_selected, const struct game *current_game);
// display_mutation_description : display the description of the selected mutation
void display_mutation_description(const char *name, const char *description, const int mutation_menu, const int id);
// output_error : display text and message background
void display_message(const char *msg[5]);

View File

@ -109,6 +109,11 @@ int mutation_buy(struct game *current_game, const struct cursor c, const int mut
if (key == KEY_DOWN || key == KEY_UP) button_selected = (button_selected + 1) % 2;
if (key == KEY_ALPHA) return 1;
if (key == KEY_OPTN)
{
display_mutation_description(mutation_data->name, mutation_data->description, mutation_menu, id);
getkey();
}
if (key == KEY_SHIFT)
{
if (!button_selected) return 0;

View File

@ -21,7 +21,7 @@ struct mutation
int contagion, severity, lethality, dna, changement;
// Name of the mutation
char *name;
char *name, *description;
};
// get_mutation : return the mutation table to display