1 #include "figures.h"
2 
3 #include "city/data_private.h"
4 
city_figures_reset(void)5 void 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)18 void city_figures_add_animal(void)
19 {
20     city_data.figure.animals++;
21 }
22 
city_figures_add_attacking_native(void)23 void 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)29 void city_figures_add_enemy(void)
30 {
31     city_data.figure.enemies++;
32 }
33 
city_figures_add_imperial_soldier(void)34 void city_figures_add_imperial_soldier(void)
35 {
36     city_data.figure.imperial_soldiers++;
37 }
38 
city_figures_add_rioter(int is_attacking)39 void 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)47 void city_figures_add_soldier(void)
48 {
49     city_data.figure.soldiers++;
50 }
51 
city_figures_set_gladiator_revolt(void)52 void city_figures_set_gladiator_revolt(void)
53 {
54     city_data.figure.attacking_natives = 10;
55 }
56 
city_figures_animals(void)57 int city_figures_animals(void)
58 {
59     return city_data.figure.animals;
60 }
61 
city_figures_attacking_natives(void)62 int city_figures_attacking_natives(void)
63 {
64     return city_data.figure.attacking_natives;
65 }
66 
city_figures_imperial_soldiers(void)67 int city_figures_imperial_soldiers(void)
68 {
69     return city_data.figure.imperial_soldiers;
70 }
71 
city_figures_enemies(void)72 int city_figures_enemies(void)
73 {
74     return city_data.figure.enemies;
75 }
76 
city_figures_rioters(void)77 int city_figures_rioters(void)
78 {
79     return city_data.figure.rioters;
80 }
81 
city_figures_soldiers(void)82 int city_figures_soldiers(void)
83 {
84     return city_data.figure.soldiers;
85 }
86 
city_figures_total_invading_enemies(void)87 int 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)92 int city_figures_has_security_breach(void)
93 {
94     return city_data.figure.security_breach_duration > 0;
95 }
96