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.looters = 0; 10 city_data.figure.robbers = 0; 11 city_data.figure.protesters = 0; 12 city_data.figure.attacking_natives = 0; 13 city_data.figure.animals = 0; 14 city_data.figure.imperial_soldiers = 0; 15 city_data.figure.soldiers = 0; 16 if (city_data.figure.security_breach_duration > 0) { 17 city_data.figure.security_breach_duration--; 18 } 19 } 20 city_figures_add_animal(void)21void city_figures_add_animal(void) 22 { 23 city_data.figure.animals++; 24 } 25 city_figures_add_attacking_native(void)26void city_figures_add_attacking_native(void) 27 { 28 city_data.figure.security_breach_duration = 10; 29 city_data.figure.attacking_natives++; 30 } 31 city_figures_add_enemy(void)32void city_figures_add_enemy(void) 33 { 34 city_data.figure.enemies++; 35 } 36 city_figures_add_imperial_soldier(void)37void city_figures_add_imperial_soldier(void) 38 { 39 city_data.figure.imperial_soldiers++; 40 } 41 city_figures_add_rioter(int is_attacking)42void city_figures_add_rioter(int is_attacking) 43 { 44 city_data.figure.rioters++; 45 if (is_attacking) { 46 city_data.figure.security_breach_duration = 10; 47 } 48 } 49 city_figures_add_looter(int is_attacking)50void city_figures_add_looter(int is_attacking) 51 { 52 city_data.figure.looters++; 53 if (is_attacking) { 54 city_data.figure.security_breach_duration = 10; 55 } 56 } 57 city_figures_add_robber(int is_attacking)58void city_figures_add_robber(int is_attacking) 59 { 60 city_data.figure.robbers++; 61 if (is_attacking) { 62 city_data.figure.security_breach_duration = 10; 63 } 64 } 65 city_figures_add_protester(void)66void city_figures_add_protester(void) 67 { 68 city_data.figure.protesters++; 69 } 70 city_figures_add_soldier(void)71void city_figures_add_soldier(void) 72 { 73 city_data.figure.soldiers++; 74 } 75 city_figures_set_gladiator_revolt(void)76void city_figures_set_gladiator_revolt(void) 77 { 78 city_data.figure.attacking_natives = 10; 79 } 80 city_figures_animals(void)81int city_figures_animals(void) 82 { 83 return city_data.figure.animals; 84 } 85 city_figures_attacking_natives(void)86int city_figures_attacking_natives(void) 87 { 88 return city_data.figure.attacking_natives; 89 } 90 city_figures_imperial_soldiers(void)91int city_figures_imperial_soldiers(void) 92 { 93 return city_data.figure.imperial_soldiers; 94 } 95 city_figures_enemies(void)96int city_figures_enemies(void) 97 { 98 return city_data.figure.enemies; 99 } 100 city_figures_rioters(void)101int city_figures_rioters(void) 102 { 103 return city_data.figure.rioters; 104 } 105 city_figures_looters(void)106int city_figures_looters(void) 107 { 108 return city_data.figure.looters; 109 } 110 city_figures_robbers(void)111int city_figures_robbers(void) 112 { 113 return city_data.figure.robbers; 114 } 115 city_figures_protesters(void)116int city_figures_protesters(void) 117 { 118 return city_data.figure.protesters; 119 } 120 city_figures_criminals(void)121int city_figures_criminals(void) 122 { 123 return city_figures_rioters() + city_figures_looters() + city_figures_robbers(); 124 } 125 city_figures_soldiers(void)126int city_figures_soldiers(void) 127 { 128 return city_data.figure.soldiers; 129 } 130 city_figures_total_invading_enemies(void)131int city_figures_total_invading_enemies(void) 132 { 133 return city_data.figure.imperial_soldiers + city_data.figure.enemies; 134 } 135 city_figures_has_security_breach(void)136int city_figures_has_security_breach(void) 137 { 138 return city_data.figure.security_breach_duration > 0; 139 } 140