1 #include "figures.h" 2 3 #include "city/data_private.h" 4 city_figures_reset(void)5void city_figures_reset(void) 6 { 7 city_data.figure.enemies = 0; 8 city_data.figure.rioters = 0; 9 city_data.figure.attacking_natives = 0; 10 city_data.figure.animals = 0; 11 city_data.figure.imperial_soldiers = 0; 12 city_data.figure.soldiers = 0; 13 if (city_data.figure.security_breach_duration > 0) { 14 city_data.figure.security_breach_duration--; 15 } 16 } 17 city_figures_add_animal(void)18void city_figures_add_animal(void) 19 { 20 city_data.figure.animals++; 21 } 22 city_figures_add_attacking_native(void)23void city_figures_add_attacking_native(void) 24 { 25 city_data.figure.security_breach_duration = 10; 26 city_data.figure.attacking_natives++; 27 } 28 city_figures_add_enemy(void)29void city_figures_add_enemy(void) 30 { 31 city_data.figure.enemies++; 32 } 33 city_figures_add_imperial_soldier(void)34void city_figures_add_imperial_soldier(void) 35 { 36 city_data.figure.imperial_soldiers++; 37 } 38 city_figures_add_rioter(int is_attacking)39void city_figures_add_rioter(int is_attacking) 40 { 41 city_data.figure.rioters++; 42 if (is_attacking) { 43 city_data.figure.security_breach_duration = 10; 44 } 45 } 46 city_figures_add_soldier(void)47void city_figures_add_soldier(void) 48 { 49 city_data.figure.soldiers++; 50 } 51 city_figures_set_gladiator_revolt(void)52void city_figures_set_gladiator_revolt(void) 53 { 54 city_data.figure.attacking_natives = 10; 55 } 56 city_figures_animals(void)57int city_figures_animals(void) 58 { 59 return city_data.figure.animals; 60 } 61 city_figures_attacking_natives(void)62int city_figures_attacking_natives(void) 63 { 64 return city_data.figure.attacking_natives; 65 } 66 city_figures_imperial_soldiers(void)67int city_figures_imperial_soldiers(void) 68 { 69 return city_data.figure.imperial_soldiers; 70 } 71 city_figures_enemies(void)72int city_figures_enemies(void) 73 { 74 return city_data.figure.enemies; 75 } 76 city_figures_rioters(void)77int city_figures_rioters(void) 78 { 79 return city_data.figure.rioters; 80 } 81 city_figures_soldiers(void)82int city_figures_soldiers(void) 83 { 84 return city_data.figure.soldiers; 85 } 86 city_figures_total_invading_enemies(void)87int city_figures_total_invading_enemies(void) 88 { 89 return city_data.figure.imperial_soldiers + city_data.figure.enemies; 90 } 91 city_figures_has_security_breach(void)92int city_figures_has_security_breach(void) 93 { 94 return city_data.figure.security_breach_duration > 0; 95 } 96