{% extends 'base.html.twig' %} {% block title %}Death Match — CSI World{% endblock %} {% block stylesheets %} {{ parent() }} {% endblock %} {% block body %}
← Retour à la carte
Death Match
{# ── Si le joueur a un combat actif, on le met en avant ── #} {% if myBattle is not null %} {% set opponent = myBattle.player1.id == app.user.id ? myBattle.player2 : myBattle.player1 %} {% set opponentTier = subscriber_tier(opponent) %}
Combat en cours contre {% if opponent.avatar %} {% else %} {{ opponent.username|first|upper }} {% endif %} {{ opponent.username }} Rejoindre le combat →
{% endif %} {# ── Onglets ── #} {% set formatDefs = [ {key: 'solo1', label: 'Solo', subFormat: 'solo', maxChars: 1, minChars: 1}, {key: 'team2', label: 'Duo', subFormat: 'team', maxChars: 2, minChars: 2}, {key: 'team4', label: 'Équipe', subFormat: 'team', maxChars: 4, minChars: 2}, ] %}
{% for fDef in formatDefs %} {% set fData = formats[fDef.key] ?? {dm: null, registrations: [], battles: []} %} {% set dm = fData.dm %} {% set regs = fData.registrations %} {% endfor %}
{% for fDef in formatDefs %} {% set fData = formats[fDef.key] ?? {dm: null, registrations: [], battles: []} %} {% set dm = fData.dm %} {% set regs = fData.registrations %} {% set batt = fData.battles %} {% set myRegHere = myReg is not null and dm is not null and myReg.deathMatch.id == dm.id %}
{# ── Format header ── #}
{% if fDef.subFormat == 'solo' %} Solo — 1 personnage par joueur {% else %} {{ fDef.label }} — {% if fDef.minChars == fDef.maxChars %}{{ fDef.maxChars }}{% else %}{{ fDef.minChars }} à {{ fDef.maxChars }}{% endif %} personnages par joueur {% endif %}
{% if dm is null %} Aucun tournoi {% elseif dm.status == 'registering' %} Inscriptions ouvertes {% if app.debug and regs|length >= 2 %} {% endif %} {% elseif dm.status == 'ongoing' %} En cours {% else %} Terminé {% endif %} {% if dm is not null and dm.status == 'registering' and dm.startsAt is not null %} Fermeture : {{ dm.startsAt|date('d/m H:i') }} {% endif %}
{# ── Prize pool ── #} {% set pool = prizesByFormat[fDef.key] ?? null %} {% if pool is not null and pool.hasAnyPrize() %}
Récompenses
{% for placeNum, placeLabel in {1: '1re place', 2: '2e place', 3: '3e place'} %} {% set money = attribute(pool, 'place' ~ placeNum ~ 'Money') %} {% set eloges = attribute(pool, 'place' ~ placeNum ~ 'Eloges') %} {% set premium = attribute(pool, 'place' ~ placeNum ~ 'Premium') %} {% set weapon = attribute(pool, 'place' ~ placeNum ~ 'Weapon') %} {% set armor = attribute(pool, 'place' ~ placeNum ~ 'Armor') %} {% set item = attribute(pool, 'place' ~ placeNum ~ 'Item') %} {% set itemQty = attribute(pool, 'place' ~ placeNum ~ 'ItemQty') %} {% if money > 0 or eloges > 0 or premium > 0 or weapon is not null or armor is not null or item is not null %}
{{ placeLabel }}
{% if money > 0 %}
{{ money|number_format(0, ',', ' ') }} Dollawrs
{% endif %} {% if eloges > 0 %}
{{ eloges }} Éloge{{ eloges > 1 ? 's' }}
{% endif %} {% if premium > 0 %}
{{ premium|number_format(0, ',', ' ') }} Crédits MM
{% endif %} {% if weapon is not null %}
{% if weapon.iconId %}{% endif %} {{ weapon.name }}
{% endif %} {% if armor is not null %}
{% if armor.iconId %}{% endif %} {{ armor.name }}
{% endif %} {% if item is not null %}
{% if item.iconId %}{% endif %} {{ item.name }}{% if itemQty > 1 %} ×{{ itemQty }}{% endif %}
{% endif %}
{% endif %} {% endfor %}
{% endif %} {% if dm is null %}
Prochain tournoi Aucun tournoi {{ fDef.label }} pour l'instant. Revenez plus tard !
{% elseif dm.status == 'registering' %} {# ── Joueurs inscrits ── #}
{% for reg in regs %} {% set regTier = subscriber_tier(reg.player) %} {% if reg.player.avatar %} {% else %} {{ reg.player.username|first|upper }} {% endif %} {{ reg.player.username }} ({{ reg.characterIds|length }} perso.) {% endfor %} {% if regs is empty %} Aucun inscrit pour l'instant. {% endif %}
{# ── Inscription ── #} {% if myRegHere %}

Vous êtes inscrit avec {% for cid in myReg.characterIds %}{{ cid }}{% if not loop.last %}, {% endif %}{% endfor %}.

{% elseif myReg is not null %}

Vous êtes déjà inscrit dans un autre format de Death Match.

{% elseif myCharacters is empty %}

Vous n'avez aucun personnage.

{% else %}

Sélectionnez {% if fDef.subFormat == 'solo' %} 1 personnage {% else %} {% if fDef.minChars == fDef.maxChars %}{{ fDef.maxChars }}{% else %}{{ fDef.minChars }} à {{ fDef.maxChars }}{% endif %} personnages {% endif %} pour participer :

{% for char in myCharacters %} {% endfor %}
{% endif %} {% elseif dm.status == 'ongoing' %}

Le tournoi est en cours.

{% elseif dm.status == 'finished' %}
Tournoi terminé {% if dm.winner is not null %} Vainqueur : {{ dm.winner.username }} {% endif %}
{% endif %} {# ── Bracket ── #} {% if dm is not null and batt is not empty %}
{% endif %}
{# /panel #} {% endfor %} {# ── Duel panel ── #}
{# Active duel CTA (filled by JS) #}
{# ── Envoyer un défi ── #}
Envoyer un défi
Chargement…
{% for char in myCharacters %} {% endfor %} {% if myCharacters is empty %} Aucun personnage. {% endif %}
{# ── Défis reçus ── #}
Défis reçus
Chargement…
{# ── Défis envoyés ── #}
Défis envoyés
Chargement…
{# /panel-duel #} {# ── Boutique PVP panel ── #}
Boutique PVP — Dépensez vos Éloges
{{ app.user.eloges }} Éloges
{% if pvpShopItems is empty %}
Aucun article disponible pour l'instant.
{% else %}
{% for shopItem in pvpShopItems %}
{% if shopItem.item and shopItem.item.iconId %} {{ shopItem.name }} {% elseif shopItem.iconPath %} {{ shopItem.name }} {% else %}
{% endif %}
{{ shopItem.name }}
{% if shopItem.description %}
{{ shopItem.description }}
{% endif %}
{{ shopItem.price }}
{% if shopItem.stock is not null %} {% if shopItem.stock == 0 %}
Épuisé
{% elseif shopItem.stock <= 5 %}
Plus que {{ shopItem.stock }}
{% else %}
{{ shopItem.stock }} restants
{% endif %} {% endif %} {% if shopItem.available %} {% else %} {% endif %}
{% endfor %}
{% endif %}
{# /panel-pvp-shop #}
{# /panels #}
{% endblock %} {% block javascripts %} {{ parent() }} {% endblock %}