summaryrefslogtreecommitdiff
path: root/views/gemini/village.twig
blob: d44802051195dd66501d50ce3e915fe068178a45 (plain)
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
=> /villages Overview


# {{ village.name }} - {{ village.x }} x {{ village.y }}
=> /map/{{ village.x }}/{{ village.y }} Map - {{ village.x }} x {{ village.y }}
Satisfaction: {{ village.satisfaction }}


# Resources

Wood: {{ village.wood }} / {{ village.getStorage(village.id).getResourceCapacity('wood') }} - Increment: {{ village.getBuilding(village.id, 'WoodCutter').getResourceIncrementor() }}
Clay: {{ village.clay }} / {{ village.getStorage(village.id).getResourceCapacity('clay') }} - Increment: {{ village.getBuilding(village.id, 'ClayPit').getResourceIncrementor() }}
Iron: {{ village.iron }} / {{ village.getStorage(village.id).getResourceCapacity('iron') }} - Increment: {{ village.getBuilding(village.id, 'IronMine').getResourceIncrementor() }}
Food: {{ village.food }} / {{ village.getStorage(village.id).getResourceCapacity('food') }} - Increment: {{ village.getBuilding(village.id, 'Farm').getResourceIncrementor() }}
Storage Capacity: {{ village.getStorage(village.id).getCapacity() }}
=> /village/{{ village.x }}/{{ village.y }}/storage/config Configure Storage


# Events

{% if events['UpgradeBuilding'] %}
## Upgrade Building
{% for typeEvents in events['UpgradeBuilding'] %}
{% for event in typeEvents %}
### {{ event.type }}
Finished: {{ event.event.time | date('c') }}
=> /village/{{ village.x }}/{{ village.y }}/building/UpgradeBuilding/build/cancel Cancel
{% endfor %}
{% endfor %}
{% endif %}

{% if events['TrainUnits'] %}
## Train Units
{% for event in events['TrainUnits'] %}
### {{ event.type }}
Amount: {{ event.amount }}
Finished: {{ event.event.time | date('c') }}
=> /village/{{ village.x }}/{{ village.y }}/unit/train/cancel Cancel
{% endfor %}
{% endif %}

{% if events['SendUnits'] %}
## Send Units
{% for event in events['SendUnits'] %}
### {{ event.unit }} - {{ event.type }}
Amount: {{ event.amount }}
Source: {{ village.get(event.source).name }}
Destination: {{ village.get(event.destination).name }}
Finished: {{ event.event.time | date('c') }}
{% if event.isCanceled %}
Canceled
{% else %}
{% if event.event.villageId == village.id %}
=> /event/{{ event.event.id }}/cancel Cancel
{% endif %}
{% endif %}
{% endfor %}
{% endif %}

{% if events['SendResources'] %}
## Send Resources
{% for event in events['SendResources'] %}
### {{ village.get(event.source).name }} -> {{ village.get(event.destination).name }}
Wood: {{ event.wood }}
Clay: {{ event.clay }}
Iron: {{ event.iron }}
Food: {{ event.food }}
Source: {{ village.get(event.source).name }}
Destination: {{ village.get(event.destination).name }}
Finished: {{ event.event.time | date('c') }}
{% if event.isCanceled %}
Canceled
{% else %}
{% if event.event.villageId == village.id %}
=> /event/{{ event.event.id }}/cancel Cancel
{% endif %}
{% endif %}
{% endfor %}
{% endif %}


# Buildings

{% for building in buildings %}
## {{ building.type }}
Level: {{ building.level | default(0) }}
Build Time: {{ building.getBuildTimeForLevel(building.getEffectiveLevel() + 1) | buildTime }}
Resources:
* Wood: {{ building.getResourceRequirementsForLevel(building.getEffectiveLevel() + 1)['wood'] }}
* Clay: {{ building.getResourceRequirementsForLevel(building.getEffectiveLevel() + 1)['clay'] }}
* Iron: {{ building.getResourceRequirementsForLevel(building.getEffectiveLevel() + 1)['iron'] }}
=> /village/{{ village.x }}/{{ village.y }}/building/{{ building.type }}/manage Manage
{% if village.canBuild(village, building) %}
=> /village/{{ village.x }}/{{ village.y }}/building/{{ building.type }}/level-up Level up
{% endif %}
{% endfor %}


# Units At Home

{% for unit in village.getUnits(village.id, 1, 3) %}
## {{ unit.type }}
Amount: {{ unit.amount }}
{% if not unit.isTraveling %}
Build Time: {{ unit.getBuildTime(1) | buildTime }}
Resources:
* Wood: {{ unit.getResourceRequirements(unit, 1)['wood'] }}
* Clay: {{ unit.getResourceRequirements(unit, 1)['clay'] }}
* Iron: {{ unit.getResourceRequirements(unit, 1)['iron'] }}
* Food: {{ unit.getResourceRequirements(unit, 1)['food'] ?? 0 }}
{% if village.canTrain(village, unit, 1) %}
=> /village/{{ village.x }}/{{ village.y }}/unit/{{ unit.type }}/create Train
{% endif %}
=> /village/{{ village.x }}/{{ village.y }}/send-units/type/{{ unit.type }} Send
{% else %}
~traveling~
{% endif %}
{% endfor %}


# Units Supporting

{% for unit in village.getUnits(village.id, 2) | merge(village.getUnits(village.id, 3)) %}
## {{ unit.type }}
Amount: {{ unit.amount }}
Origin: {{ village.get(unit.homeVillageId).name }}
Location: {{ not unit.isTraveling ? village.get(unit.residenceVillageId).name : '~traveling~' }}
Travel Time: {{ unit.getTravelTime(unit, village.getDistance(unit.getHomeVillage().x, unit.getHomeVillage().x, unit.getResidenceVillage().x, unit.getResidenceVillage().y)) | buildTime }}
{% if not unit.isTraveling %}
{% if unit.homeVillageId == village.id %}
=> /village/{{ village.x }}/{{ village.y }}/unit/{{ unit.type }}/location/{{ unit.getResidenceVillage().x }}/{{ unit.getResidenceVillage().y }}/recall Recall Home
{% else %}
=> /village/{{ village.x }}/{{ village.y }}/unit/{{ unit.type }}/location/{{ unit.getHomeVillage().x }}/{{ unit.getHomeVillage().y }}/send-back Send Back
{% endif %}
{% endif %}
{% endfor %}


# Send Units

{% include 'send-units/01-units.twig' %}


{% if village.canSendResources(village) %}
# Send Resources

{% include 'send-resources/01-resource-types.twig' %}
{% endif %}


{% include 'footer.twig' %}