-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathai_data.cpp
77 lines (60 loc) · 1.75 KB
/
ai_data.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#include "ai.h"
#define _role(i) \
cur_id = (i)
#define _name(s) \
City_role_data[cur_id]->name = (s)
#define _skill(s, n) \
City_role_data[cur_id]->skill = (s); \
City_role_data[cur_id]->skill_req = (n)
#define _food_percentage(n) \
City_role_data[cur_id]->food_percentage = (n)
#define _resource_export(r) \
City_role_data[cur_id]->resource_exports.push_back( (r) )
#define _resource_import(r) \
City_role_data[cur_id]->resource_imports.push_back( (r) )
#define _mineral_export(r) \
City_role_data[cur_id]->mineral_exports.push_back( (r) )
#define _mineral_import(r) \
City_role_data[cur_id]->mineral_imports.push_back( (r) )
City_role_datum* City_role_data[CITY_ROLE_MAX];
City_role_datum::City_role_datum()
{
name = "Unitialized Role";
food_percentage = 90; // Most roles require some imports
skill = SKILL_NULL;
skill_req = 0;
}
void init_city_roles()
{
for (int i = 0; i < CITY_ROLE_MAX; i++) {
City_role_data[i] = new City_role_datum;
}
int cur_id = 0;
_role(CITY_ROLE_NULL);
_name("none");
_food_percentage(100);
_role(CITY_ROLE_FARMING);
_name("farming");
_skill(SKILL_FARMING, 3);
_food_percentage(125);
_role(CITY_ROLE_HUNTING);
_name("hunting");
_skill(SKILL_HUNTING, 2); // We're forgiving!
_food_percentage(120);
_role(CITY_ROLE_LIVESTOCK);
_name("livestock");
_skill(SKILL_LIVESTOCK, 3);
_food_percentage(120);
_role(CITY_ROLE_MINING);
_name("mining");
_skill(SKILL_MINING, 3);
_resource_export(RES_STONE);
_mineral_export(MINERAL_TIN);
_mineral_export(MINERAL_COPPER);
_mineral_export(MINERAL_IRON);
_mineral_export(MINERAL_COAL);
_role(CITY_ROLE_LOGGING);
_name("logging");
_skill(SKILL_FORESTRY, 2);
_resource_export(RES_WOOD);
}