{% extends 'Game/index.html.twig' %} {% block title %} - Battle Report{% endblock %} {% block metas %} {%- set shareUrl = url('MineSeekerBundle_battle_share', { uuid: game.uuid }) | replace({'http://': 'https://'}) -%} {%- set _ogImage = url('MineSeekerBundle_og_battle', { uuid: game.uuid }) | replace({'http://': 'https://'}) -%} {% endblock %} {% block body %}
Battle Report
{% if redAvatar %} {{ redName }} {% else %} {{ redName|slice(0,2)|upper }} {% endif %} {% if redBonusPoints > blueBonusPoints %}
{% endif %}
{{ redName }} Red
{% if redPts is not null and bluePts is not null %}
{{ redPts }} : {{ bluePts }}
{% else %}
— : —
{% endif %}
{{ (redBonusPoints ?? 0)|number_format(1, '.', '') }} : {{ (blueBonusPoints ?? 0)|number_format(1, '.', '') }}
VS
{% if resign == 'red' %}
Blue wins
{% elseif resign == 'blue' %}
Red wins
{% elseif redPts is not null and bluePts is not null %} {% if redPts > bluePts %}
Red wins
{% elseif bluePts > redPts %}
Blue wins
{% else %}
Draw
{% endif %} {% endif %}
{% if blueAvatar %} {{ blueName }} {% else %} {{ blueName|slice(0,2)|upper }} {% endif %} {% if blueBonusPoints > redBonusPoints %}
{% endif %}
{{ blueName }} Blue
{% set durationSec = (game.created and game.updated) ? (game.updated|date('U') - game.created|date('U')) : 0 %} {% set durationStr = '' %} {% if durationSec > 0 %} {% set h = (durationSec / 3600)|round(0, 'floor') %} {% set m = ((durationSec % 3600) / 60)|round(0, 'floor') %} {% set s = durationSec % 60 %} {% if h > 0 %} {% set durationStr = h ~ 'h ' ~ m ~ 'm ' ~ s ~ 's' %} {% elseif m > 0 %} {% set durationStr = m ~ 'm ' ~ s ~ 's' %} {% else %} {% set durationStr = s ~ 's' %} {% endif %} {% endif %} {% set pointDiff = (redPts|default(0) - bluePts|default(0))|abs %} {% set winnerName = redPts|default(0) > bluePts|default(0) ? redName : (bluePts|default(0) > redPts|default(0) ? blueName : null) %}
{% if resign %}
{{ resign|capitalize }} resigned
{% endif %} {% if durationStr %}
Match duration: {{ durationStr }}
{% endif %} {% if pointDiff > 0 and winnerName %}
{{ winnerName }} won by {{ pointDiff }} mine{{ pointDiff == 1 ? '' : 's' }}
{% endif %} {% if game.redExplodedBomb %}
{{ redName }} used their bomb
{% endif %} {% if game.blueExplodedBomb %}
{{ blueName }} used their bomb
{% endif %} {% if game.updated %}
{{ game.updated|date('Y-m-d H:i') }}
{% endif %}
{% set hasRedStats = redBonusStats is not empty and (redBonusStats.blindHits or redBonusStats.chainBest or redBonusStats.edgeMines or redBonusStats.lastMineHits or redBonusStats.biggestReveal) %} {% set hasBlueStats = blueBonusStats is not empty and (blueBonusStats.blindHits or blueBonusStats.chainBest or blueBonusStats.edgeMines or blueBonusStats.lastMineHits or blueBonusStats.biggestReveal) %} {% if redBonusPoints > 0 or blueBonusPoints > 0 or hasRedStats or hasBlueStats %}
Bonus Statistics
{# Red Bonus #}
{{ redBonusPoints|number_format(1, '.', '') }} pts
{% if redBonusStats is not empty and redBonusStats.blindHits %}
Blind hits {{ redBonusStats.blindHits }}
{% endif %} {% if redBonusStats is not empty and redBonusStats.chainBest %}
Best chain {{ redBonusStats.chainBest }}
{% endif %} {% if redBonusStats is not empty and redBonusStats.edgeMines %}
Edge mines {{ redBonusStats.edgeMines }}
{% endif %} {% if redBonusStats is not empty and redBonusStats.lastMineHits %}
Endgame mines {{ redBonusStats.lastMineHits }}
{% endif %} {% if redBonusStats is not empty and redBonusStats.biggestReveal %}
Biggest reveal {{ redBonusStats.biggestReveal }}
{% endif %} {% if not hasRedStats %}
No bonuses earned
{% endif %}
{{ blueBonusPoints|number_format(1, '.', '') }} pts
{% if blueBonusStats is not empty and blueBonusStats.blindHits %}
Blind hits {{ blueBonusStats.blindHits }}
{% endif %} {% if blueBonusStats is not empty and blueBonusStats.chainBest %}
Best chain {{ blueBonusStats.chainBest }}
{% endif %} {% if blueBonusStats is not empty and blueBonusStats.edgeMines %}
Edge mines {{ blueBonusStats.edgeMines }}
{% endif %} {% if blueBonusStats is not empty and blueBonusStats.lastMineHits %}
Endgame mines {{ blueBonusStats.lastMineHits }}
{% endif %} {% if blueBonusStats is not empty and blueBonusStats.biggestReveal %}
Biggest reveal {{ blueBonusStats.biggestReveal }}
{% endif %} {% if not hasBlueStats %}
No bonuses earned
{% endif %}
{% endif %}
{% endblock %}