-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhmo_aqueduct_maintenance.txt
97 lines (83 loc) · 1.66 KB
/
hmo_aqueduct_maintenance.txt
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
namespace = aqueduct_maintenance
aqueduct_maintenance.1 = {
type = country_event
hidden = yes
trigger = {
is_ai = no
any_owned_province = {
has_city_status = yes
OR = {
NOT = {
has_variable = previous_total_aqueduct_buildings
}
trigger_if = {
limit = {
has_variable = previous_total_aqueduct_buildings
}
NOT = {
var:previous_total_aqueduct_buildings = num_of_aqueduct_building
}
}
}
}
}
immediate = {
random_owned_province = { # dont need to do everything all at once
limit = {
has_city_status = yes
num_of_aqueduct_building > 4 # allow 4 free aqueducts
OR = {
NOT = {
has_variable = previous_total_aqueduct_buildings
}
trigger_if = {
limit = {
has_variable = previous_total_aqueduct_buildings
}
NOT = {
var:previous_total_aqueduct_buildings = num_of_aqueduct_building
}
}
}
}
trigger_event = {
id = aqueduct_maintenance.2
days = 3
}
}
}
}
aqueduct_maintenance.2 = {
type = province_event
hidden = yes
immediate = {
if = {
limit = {
has_variable = previous_total_aqueduct_buildings
}
remove_variable = previous_total_aqueduct_buildings
}
set_variable = {
name = previous_total_aqueduct_buildings
value = num_of_aqueduct_building
}
set_variable = {
name = aqueduct_count
value = num_of_aqueduct_building
}
change_variable = {
name = aqueduct_count
add = -4
min = 0
}
while = {
count = var:aqueduct_count
add_province_modifier = {
name = aqueduct_maintenance
mode = add
duration = -1
}
}
remove_variable = aqueduct_count
}
}