Skip to content

Commit ebfe40b

Browse files
committed
show prophecies stats on game log
1 parent a2e5678 commit ebfe40b

File tree

8 files changed

+204
-103
lines changed

8 files changed

+204
-103
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"ext-iconv": "*",
1010
"ext-json": "*",
1111
"adnanmula/criteria": "^0.4",
12-
"adnanmula/keyforge-game-log-parser": "^0.2.1",
12+
"adnanmula/keyforge-game-log-parser": "^0.2.2",
1313
"adnanmula/tournament": "dev-master",
1414
"beberlei/assert": "^3.3",
1515
"doctrine/dbal": "^3.6",

composer.lock

Lines changed: 92 additions & 88 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Entrypoint/Controller/Keyforge/Game/Detail/game.html.twig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818

1919
{% include 'Keyforge/Game/Detail/game_graphs.html.twig' %}
2020

21+
{% if log.winner.timeline.propheciesSummary.prophecies|length > 0 or log.loser.timeline.propheciesSummary.prophecies|length > 0 %}
22+
<div class="divider py-1"></div><hr><div class="divider py-1"></div>
23+
24+
{% include 'Keyforge/Game/Detail/game_prophecies.html.twig' %}
25+
{% endif %}
26+
2127
<div class="divider py-1"></div><hr><div class="divider py-1"></div>
2228

2329
{% include 'Keyforge/Game/Detail/game_timeline.html.twig' %}

src/Entrypoint/Controller/Keyforge/Game/Detail/game_header.html.twig

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,6 @@
6868
<p class="text">{{ log.timeline.filter(eventTypes.TIDE_RAISED).count }}</p>
6969
</div>
7070
{% endif %}
71-
{% if log.timeline.filter(eventTypes.PROPHECY_ACTIVATED).count > 0 %}
72-
<div class="col-6 col-md-2 mb-3">
73-
<h6 class="fw-bold">{{ 'menu.prophecies_activated'|trans }}</h6>
74-
<p class="text">{{ log.timeline.filter(eventTypes.PROPHECY_ACTIVATED).count }}</p>
75-
</div>
76-
{% endif %}
7771
{% if log.timeline.filter(eventTypes.PROPHECY_FULFILLED).count > 0 %}
7872
<div class="col-6 col-md-2 mb-3">
7973
<h6 class="fw-bold">{{ 'menu.prophecies_fulfilled'|trans }}</h6>
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
<h5>{{ 'menu.prophecies_stats'|trans }}</h5>
2+
3+
<div class="row">
4+
<div class="col-md-6">
5+
<table class="table table-sm table-borderless">
6+
<thead>
7+
<tr>
8+
<th>{{ log.winner.name }}</th>
9+
<th>{{ 'menu.activated'|trans }}</th>
10+
<th>{{ 'game.timeline.fulfilled'|trans }}</th>
11+
<th>%</th>
12+
</tr>
13+
</thead>
14+
<tbody>
15+
{% for prophecy, data in log.winner.timeline.propheciesSummary.prophecies %}
16+
<tr>
17+
<td>{{ prophecy }}</td>
18+
<td>{{ data.activated }}</td>
19+
<td>{{ data.fulfilled }}</td>
20+
<td>{{ data.percent }}%</td>
21+
</tr>
22+
{% endfor %}
23+
</tbody>
24+
</table>
25+
</div>
26+
27+
<div class="col-md-6">
28+
<table class="table table-sm table-borderless">
29+
<thead>
30+
<tr>
31+
<th>{{ log.loser.name }}</th>
32+
<th>{{ 'menu.activated'|trans }}</th>
33+
<th>{{ 'game.timeline.fulfilled'|trans }}</th>
34+
<th>%</th>
35+
</tr>
36+
</thead>
37+
<tbody>
38+
{% for prophecy, data in log.loser.timeline.propheciesSummary.prophecies %}
39+
<tr>
40+
<td>{{ prophecy }}</td>
41+
<td>{{ data.activated }}</td>
42+
<td>{{ data.fulfilled }}</td>
43+
<td>{{ data.percent }}%</td>
44+
</tr>
45+
{% endfor %}
46+
</tbody>
47+
</table>
48+
</div>
49+
</div>
50+
51+
<div class="divider py-1"></div><hr><div class="divider py-1"></div>
52+
53+
<h5>{{ 'menu.fates_stats'|trans }}</h5>
54+
55+
<div class="row">
56+
<div class="col-md-6">
57+
<table class="table table-sm table-borderless">
58+
<thead>
59+
<tr>
60+
<th>{{ log.winner.name }}</th>
61+
<th>{{ 'game.timeline.resolved2'|trans }}</th>
62+
<th>%</th>
63+
</tr>
64+
</thead>
65+
<tbody>
66+
{% for fate, data in log.winner.timeline.propheciesSummary.fates %}
67+
<tr>
68+
<td>{{ fate }}</td>
69+
<td>{{ data.resolved }}</td>
70+
<td>{{ data.percent }}%</td>
71+
</tr>
72+
{% endfor %}
73+
</tbody>
74+
</table>
75+
</div>
76+
77+
<div class="col-md-6">
78+
<table class="table table-sm table-borderless">
79+
<thead>
80+
<tr>
81+
<th>{{ log.loser.name }}</th>
82+
<th>{{ 'game.timeline.resolved2'|trans }}</th>
83+
<th>%</th>
84+
</tr>
85+
</thead>
86+
<tbody>
87+
{% for fate, data in log.loser.timeline.propheciesSummary.fates %}
88+
<tr>
89+
<td>{{ fate }}</td>
90+
<td>{{ data.resolved }}</td>
91+
<td>{{ data.percent }}%</td>
92+
</tr>
93+
{% endfor %}
94+
</tbody>
95+
</table>
96+
</div>
97+
</div>

src/Entrypoint/Controller/Keyforge/Game/Detail/game_stat_comparison.html.twig

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,6 @@
8989
} %}
9090
{% endif %}
9191

92-
{% if log.timeline.filter(eventTypes.PROPHECY_ACTIVATED).count > 0 %}
93-
{% include 'Keyforge/Game/Detail/game_stat_comparison_row.html.twig' with {
94-
label: 'menu.prophecies_activated'|trans,
95-
left: winner.timeline.filter(eventTypes.PROPHECY_ACTIVATED).count,
96-
right: loser.timeline.filter(eventTypes.PROPHECY_ACTIVATED).count,
97-
} %}
98-
{% endif %}
99-
10092
{% if log.timeline.filter(eventTypes.PROPHECY_FULFILLED).count > 0 %}
10193
{% include 'Keyforge/Game/Detail/game_stat_comparison_row.html.twig' with {
10294
label: 'menu.prophecies_fulfilled'|trans,

translations/messages.en_GB.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,8 @@ menu.admin: Admin
213213
menu.admin_no_new_accounts: No pending accounts
214214
menu.all: All
215215
menu.any: Any
216+
menu.prophecies_stats: Prophecy stats
217+
menu.fates_stats: Fate stats
216218
menu.approval_pending_by: 'Approval pending by:'
217219
menu.archenemy: Archenemy
218220
menu.best_performance: 'Best performance'
@@ -404,6 +406,7 @@ game.timeline.to: To
404406
game.timeline.activates: Activates
405407
game.timeline.fulfilled: Fulfilled
406408
game.timeline.resolved: Resolved
409+
game.timeline.resolved2: Resolved
407410
game.timeline.reduced_chains: 'Chains were reduced by %by% to %to%'
408411
game.timeline.added_chains: 'Chains were increased by %by% (%reason%)'
409412
game.timeline.check: Check declared
@@ -480,6 +483,7 @@ menu.extra_turns: Extra turns
480483
menu.tokens_created: Tokens created
481484
menu.tides_raised: Tides raised
482485
menu.prophecies_activated: Prophecies activated
486+
menu.activated: Activated
483487
menu.prophecies_fulfilled: Prophecies fulfilled
484488
menu.chains_obtained: Chains obtained
485489
menu.fates_resolved: Fates resolved

translations/messages.es_ES.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,8 @@ menu.admin: Admin
213213
menu.admin_no_new_accounts: Ninguna cuenta pendiente
214214
menu.all: Todas
215215
menu.any: Cualquiera
216+
menu.prophecies_stats: Estadísticas de profecías
217+
menu.fates_stats: Estadísticas de destinos
216218
menu.approval_pending_by: 'Pendiente de aceptar por:'
217219
menu.archenemy: Archenemy
218220
menu.best_performance: 'Mejor rendimiento'
@@ -404,6 +406,7 @@ game.timeline.to: Para
404406
game.timeline.activates: Activó
405407
game.timeline.fulfilled: Cumplió
406408
game.timeline.resolved: Resolvió
409+
game.timeline.resolved2: Resueltas
407410
game.timeline.reduced_chains: 'Las cadenas se redujeron en %by% a %to%'
408411
game.timeline.added_chains: 'Las cadenas aumentaron en %by% (%reason%)'
409412
game.timeline.check: Check declarado
@@ -480,6 +483,7 @@ menu.extra_turns: Turnos extra
480483
menu.tokens_created: Tokens creados
481484
menu.tides_raised: Mareas subidas
482485
menu.prophecies_activated: Profecías activadas
486+
menu.activated: Activada
483487
menu.prophecies_fulfilled: Profecías cumplidas
484488
menu.chains_obtained: Cadenas obtenidas
485489
menu.fates_resolved: Destinos resueltos

0 commit comments

Comments
 (0)