Compare commits

...

17 Commits

Author SHA1 Message Date
Shadow15510 04f6fe80b4 Improve ergonomy and add in-game short help 2022-01-19 21:48:09 +01:00
Shadow15510 fb5615d018 finish cleaning 2021-06-29 17:08:30 +02:00
Shadow15510 97b0c4dd60 Add executable 2021-06-29 16:49:55 +02:00
Shadow15510 2a3a1267dd Update master 2021-06-29 16:49:03 +02:00
Shadow15510 f27f2d2e01 Finish cleaning 2021-06-29 16:47:45 +02:00
Shadow15510 9c835445bb Clean the folder 2021-06-29 16:46:46 +02:00
Shadow15510 7365e237ec Update exec for CG 2021-06-08 09:39:28 +02:00
Shadow15510 398d7564e0 Little change on symptoms 2021-06-08 09:37:30 +02:00
Shadow15510 c5e377cb39 Change on symptôms 2021-06-08 09:35:16 +02:00
Shadow15510 2e27bc56f8 Little adjustment 2021-06-08 09:07:47 +02:00
Shadow15510 7daca632c7 Merge branch 'dev'
Fix some bugs on transmissions
2021-06-08 09:01:51 +02:00
Shadow15510 2e08e460cd Fix bugs on transmissions 2021-06-08 09:01:36 +02:00
Shadow15510 3dba317593 Merge branch 'dev'
Some changes with game mecanics
2021-06-07 21:27:35 +02:00
Shadow15510 d85daa92de Some adjust with game mecanics 2021-06-07 21:26:52 +02:00
Shadow15510 c2f691d8b7 Merge branch 'dev'
Add the compilation folder for CG
2021-06-06 18:33:42 +02:00
Shadow15510 d3d7a5e44d Add folder and files for CG compilation 2021-06-06 18:30:40 +02:00
Shadow15510 685c162fd4 Update .gitignore 2021-06-06 18:30:04 +02:00
11 changed files with 57 additions and 41 deletions

3
.gitignore vendored
View File

@ -1,2 +1,3 @@
build-fx/*
assets-fx/__pycache__/*
assets-fx/__pycache__/*
*.g1a

View File

@ -17,11 +17,11 @@ set(SOURCES
src/data.c
src/epidemic_engine.c
src/save.c
# ...
)
# Shared assets, fx-9860G-only assets and fx-CG-50-only assets
set(ASSETS
# ...
)
set(ASSETS_fx
assets-fx/plague.png
@ -42,16 +42,15 @@ set(ASSETS_fx
assets-fx/mutations_table/transmissions_1.txt
assets-fx/mutations_table/transmissions_2.txt
assets-fx/mutations_table/transmissions_3.txt
# ...
)
set(ASSETS_cg
assets-cg/example.png
# ...
)
fxconv_declare_assets(${ASSETS} ${ASSETS_fx} ${ASSETS_cg} WITH_METADATA)
fxconv_declare_converters(assets-fx/converters.py)
add_executable(myaddin ${SOURCES} ${ASSETS} ${ASSETS_${FXSDK_PLATFORM}})
target_compile_options(myaddin PRIVATE -Wall -Wextra -Os)
target_link_libraries(myaddin Gint::Gint)
@ -60,6 +59,6 @@ if("${FXSDK_PLATFORM_LONG}" STREQUAL fx9860G)
generate_g1a(TARGET myaddin OUTPUT "Plague.g1a"
NAME "Plague" ICON assets-fx/icon.png)
elseif("${FXSDK_PLATFORM_LONG}" STREQUAL fxCG50)
generate_g3a(TARGET myaddin OUTPUT "MyAddin.g3a"
NAME "MyAddin" ICONS assets-cg/icon-uns.png assets-cg/icon-sel.png)
generate_g3a(TARGET myaddin OUTPUT "Plague.g3a"
NAME "Plague" ICONS assets-cg/icon-uns.png assets-cg/icon-sel.png)
endif()

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -1,4 +1,4 @@
1 | 2 | 15 | 0 | 6 | 5 | 0 | 0
0 | 0 | 0 | 15 | 0 | 0 | 0 | 11
9 | 10 | 0 | 0 | 0 | 0 | 0 | 12
0 | 0 | 0 | 7 | 8 | 0 | 0 | 15
1 | 2 | 15 | 0 | 15 | 5 | 0 | 0
0 | 0 | 0 | 15 | 0 | 0 | 0 | 11
9 | 10 | 0 | 0 | 0 | 0 | 0 | 12
0 | 0 | 0 | 7 | 8 | 0 | 0 | 15

View File

@ -82,7 +82,7 @@ int next_frame(struct game *current_game, int *dna_animation, int *vaccine)
if (!current_game->humans[1])
{
if (current_game->humans[0] || current_game->humans[3] < current_game->humans[2]) message("VOUS AVEZ PERDU.");
if (current_game->humans[3] < 4 * (current_game->humans[0] + current_game->humans[2])) message("VOUS AVEZ PERDU.");
else message("VOUS AVEZ GAGNE !");
return 0;
}
@ -108,12 +108,12 @@ int get_inputs(const int background, int *mutation_menu, int *boost)
else if (background == 6) return 1;
}
if (key == KEY_ALPHA)
if (key == KEY_ALPHA || key == KEY_EXIT)
{
if (background == 5) return 3;
if (background == 1 || background == 2) return -1;
else return 1;
}
if (key == KEY_EXIT && (background == 1 || background == 2)) return -1;
if (background == 3)
{
@ -168,5 +168,5 @@ void message(char *msg)
key_event_t ev = {0};
display_message(msg);
while (ev.key != KEY_ALPHA) ev = getkey_opt(opt, NULL);
while (ev.key != KEY_ALPHA && ev.key != KEY_EXIT) ev = getkey_opt(opt, NULL);
}

View File

@ -4,20 +4,20 @@
// (contation, severity, lethality, DNA cost, change to cure requirement)
const struct mutation symptoms_data[14] =
{
{10, 10, 0, 2, 0, "NAUSEE", "DONNE DES NAUSEES"},
{10, 0, 0, 2, 0, "NAUSEE", "DONNE DES NAUSEES"},
{15, 10, 0, 10, 0, "VOMISSEMENT", "PROVOQUE DES REJETS GASTRIQUES"},
{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"},
{10, 0, 0, 3, 0, "TOUX", "LA PROJECTION DE PARTICULE AUGMENTE LA CONTAGION"},
{15, 10, 5, 10, 0, "PNEUMONIE", "AFFECTION PULMONAIRE PEU MORTELLE"},
{ 0, 20, 20, 15, 10, "TUMEUR", "PEU CONTAGIEUX, MAIS MORTEL"},
{15, 0, 5, 4, 0, "PLAIES", "LA PEAU S'ASSECHE ET DEVIENT CASSANTE"},
{10, 5, 10, 10, 0, "LESIONS", "BLOQUE LA CICATRISATION"},
{30, 10, 20, 20, 5, "HEMORRAGIE", "BLOQUE L'ACTION DES PLAQUETTES"},
{25, 10, 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"},
{ 0, 10, 30, 30, 20, "ARRET TOTAL", "EMPECHE LES ORGANES DE FONCTIONNER"},
};
@ -26,26 +26,26 @@ const struct mutation abilities_data[6] =
{15, 0, 0, 10, 0, "FROID", "RESISTANCE AU FROID"},
{15, 0, 0, 15, 0, "CHAUD", "RESISTANCE AU CHAUD"},
{ 0, 10, 0, 25, 10, "GENETIQUE", "LE GENOME MUTE, RALENTISSANT LE SEQUENCAGE ADN"},
{10, 10, 20, 30, 30, "MUTATION+", "LE VIRUS MUTE, BLOQUANT LES CHERCHEURS"},
{10, 10, 10, 30, 30, "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"},
{ 0, 15, 30, 15, 20, "MEDICAMENT", "RESISTANCE AU MEDICAMENTS"},
};
const struct mutation transmissions_data[13] =
{
{ 5, 0, 0, 5, 0, "AIR 1", "TRANSMISSION PAR L'AIR"},
{10, 10, 0, 15, 0, "AIR 2", "TRANSMISSION PAR L'AIR"},
{10, 0, 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, 15, 0, "EAU 1", "TRANSMISSION PAR L'EAU"},
{20, 10, 0, 20, 0, "EAU 2", "TRANSMISSION PAR L'EAU"},
{20, 0, 5, 12, 0, "ANIMAL 1", "LE VIRUS PEUT PASSER DE L'ANIMAL À L'HOMME"},
{20, 0, 5, 12, 0, "ANIMAL 1", "LE VIRUS PEUT PASSER DE L'ANIMAL A L'HOMME"},
{40, 10, 0, 25, 0, "ANIMAL 2", "CAPACITE DE TRANSMISSION HOMME-ANIMAL"},
{20, 0, 0, 15, 0, "OISEAU 1", "LES OISEAUX TRANSMETTENT LE VIRUS"},
{40, 10, 0, 25, 0, "OISEAU 2", "LES OISEAUX TRANSMETTENT LE VIRUS"},
{10, 0, 0, 10, 0, "SANG 1", "LE VIRUS SE TRANSMET PAR LE SANG"},
{20, 10, 0, 15, 0, "SANG 2", "LE VIRUS SE TRANSMET PAR LE SANG"},
{10, 0, 0, 10, 0, "SANG 1", "LE VIRUS SE TRANSMET PAR LE SANG"},
{20, 5, 0, 15, 0, "SANG 2", "LE VIRUS SE TRANSMET PAR LE SANG"},
{40, 15, 0, 25, 0, "SANG 3", "LE VIRUS SE TRANSMET PAR LE SANG"},
};

View File

@ -42,7 +42,7 @@ void epidemic_simulation(struct game *current_game)
init_tab(current_game->grid.width * current_game->grid.height, current_grid, current_game->grid.data);
int healed_rate = 0;
if (current_game->research == current_game->limit) healed_rate = rand() % 11;
if (current_game->research == current_game->limit) healed_rate = rand() % 6;
// Make the epidemic grid evolove
for (int i = 0; i < current_game->grid.width; i ++)

View File

@ -1,7 +1,7 @@
/*
Project name ......: Plague
Version ...........: 1.3.5
Last modification .: 6 June 2021
Version ...........: 1.3.10
Last modification .: 19 January 2022
code and assets provided with licence :
GNU General Public Licence v3.0
@ -20,7 +20,7 @@
#include "mutation_engine.h"
#include "save.h"
const char *VERSION = "1.3.5";
const char *VERSION = "1.3.10";
// title_screen : display the title screen
static void title_screen(void);
@ -77,6 +77,23 @@ int main(void)
gint_world_switch(GINT_CALL(read_save, (void *)&current_game));
if (current_game.total_time == 0)
{
dclear(C_WHITE);
dtext(10, 1, C_BLACK, "CONTROLES :");
dtext(1, 7, C_BLACK, "[REPLAY]:SELECTIONNER");
dtext(1, 14, C_BLACK, "[SHIFT]:VALIDER");
dtext(1, 21, C_BLACK, "[ALPHA/EXIT]:REVENIR");
dtext(1, 28, C_BLACK, "[VARS]:MUTATIONS");
dtext(1, 35, C_BLACK, "[OPTN]:RECHERCHE+ADN");
dtext(1, 42, C_BLACK, "[X^2]:STATISTIQUES");
dtext(1, 49, C_BLACK, "[->]:MODE RAPIDE");
dupdate();
getkey();
}
int to_save = main_loop(&current_game);
if (to_save) gint_world_switch(GINT_CALL(write_save, (void *)&current_game));

View File

@ -42,7 +42,7 @@ void get_mutation(const struct game *current_game, const int mutation_menu, int
if (mutation_menu == 3)
{
if (current_game->mutations_count[2] < 5) init_mat(8, 4, table, mt_transmissions_1.data);
else if (current_game->mutations_count[2] < 10) init_mat(8, 4, table, mt_transmissions_2.data);
else if (current_game->mutations_count[2] < 9 ) init_mat(8, 4, table, mt_transmissions_2.data);
else init_mat(8, 4, table, mt_transmissions_3.data);
}
}
@ -76,7 +76,7 @@ void mutation_select(struct game *current_game, const int mutation_menu)
if (key) {tick = 1; c.display = 1;}
// Manage input
if (key == KEY_ALPHA) end = 1;
if (key == KEY_ALPHA || key == KEY_EXIT) end = 1;
if (key == KEY_SHIFT && table[c.y][c.x] != 15 && table[c.y][c.x] != 0)
{
end = mutation_buy(current_game, c, mutation_menu, table);
@ -115,7 +115,7 @@ int mutation_buy(struct game *current_game, const struct cursor c, const int mut
if (key == KEY_OPTN)
{
display_mutation_description(mutation_data->name, mutation_data->description, mutation_menu, id);
while (ev.key != KEY_ALPHA) ev = getkey_opt(opt, NULL);
while (ev.key != KEY_ALPHA && ev.key != KEY_EXIT) ev = getkey_opt(opt, NULL);
}
if (key == KEY_SHIFT)
{
@ -137,6 +137,7 @@ int mutation_buy(struct game *current_game, const struct cursor c, const int mut
// Update
update_disease(current_game);
current_game->priority += ceil((mutation_data->severity + mutation_data->lethality) / 10);
current_game->limit += mutation_data->changement;
message("MUTATION ACHETEE");
}
else message("ACHAT IMPOSSIBLE");
@ -169,8 +170,6 @@ void update_disease(struct game *current_game)
current_game->severity = symptom->severity + ability->severity + transmission->severity;
current_game->lethality = symptom->lethality + ability->lethality + transmission->lethality;
// research parameter
current_game->limit = RESEARCH_LIMIT + symptom->changement + ability->changement + transmission->changement;
if (current_game->research > current_game->limit) current_game->research = current_game->limit;
}

View File

@ -5,7 +5,7 @@
#include "display_engine.h"
// Basic limit research
#define RESEARCH_LIMIT 250
#define RESEARCH_LIMIT 200
// mutation_table : contain the map of the mutation available
struct mutation_table