{% extends 'entity/layout.html.twig' %} {% from 'entity/layout.html.twig' import stats, stat_changes, rarity_stars, icon_img, currency_pill %} {% set entityName = weapon.name %} {% set backCategory = 'weapon' %} {% set backLabel = 'Armes' %} {% set statLbl = {pvMax: 'PV Max', egMax: 'EG Max', attaque: 'Attaque', defense: 'Défense', arcane: 'Arcane', sagesse: 'Sagesse', vitesse: 'Vitesse', finesse: 'Finesse'} %} {% block stylesheets %} {{ parent() }} {% endblock %} {% macro variant_row(w, isBase, statusMap, skillMap) %} {% from 'entity/layout.html.twig' import icon_img, stats as render_stats, rarity_stars %} {{ icon_img(w) }}
{{ w.name }} {% if isBase %}Base{% endif %} {% if w.elementModifier %}{{ w.elementModifier.name }}{% endif %} {{ rarity_stars(w.rarity, w.gameId) }}
{% if w.description %}
{{ w.description }}
{% endif %} {{ render_stats(w.stats) }} {% set vMultMap = { 'PvMax': {label: 'PV Max', value: w.multiplierPvMax}, 'EgMax': {label: 'EG Max', value: w.multiplierEgMax}, 'Attaque': {label: 'Attaque', value: w.multiplierAttaque}, 'Defense': {label: 'Défense', value: w.multiplierDefense}, 'Arcane': {label: 'Arcane', value: w.multiplierArcane}, 'Sagesse': {label: 'Sagesse', value: w.multiplierSagesse}, 'Vitesse': {label: 'Vitesse', value: w.multiplierVitesse}, 'Finesse': {label: 'Finesse', value: w.multiplierFinesse}, } %} {% if vMultMap|filter(m => m.value is not null)|length > 0 %}
{% for _, m in vMultMap %} {% if m.value is not null %} {% set pct = ((m.value - 1) * 100)|round %} {{ m.label }} : {{ pct > 0 ? '+' }}{{ pct }}% {% endif %} {% endfor %}
{% endif %} {% if w.regenPv is not null or w.regenEg is not null or w.regenPower is not null or w.regenRate is not null or w.healingRate is not null or w.egCost is not null or w.powerGains is not null %}
{% if w.regenPv is not null %}Rég. PV :{{ w.regenPv > 0 ? '+' }}{{ w.regenPv }}%{% endif %} {% if w.regenEg is not null %}Rég. {{ ('resource.eg.' ~ w.gameId)|trans({}, 'game') }} :{{ w.regenEg > 0 ? '+' }}{{ w.regenEg }}%{% endif %} {% if w.regenPower is not null %}Rég. {{ ('resource.tp.' ~ w.gameId)|trans({}, 'game') }} :{{ w.regenPower > 0 ? '+' }}{{ w.regenPower }}%{% endif %} {% if w.regenRate is not null %}Taux rég. :×{{ w.regenRate }}{% endif %} {% if w.healingRate is not null %}Taux soin :×{{ w.healingRate }}{% endif %} {% if w.egCost is not null %}{% set pctC = ((w.egCost - 1) * 100)|round %}Coût {{ ('resource.eg.' ~ w.gameId)|trans({}, 'game') }} :{{ pctC > 0 ? '+' }}{{ pctC }}%{% endif %} {% if w.powerGains is not null %}Gains {{ ('resource.tp.' ~ w.gameId)|trans({}, 'game') }} :×{{ w.powerGains }}{% endif %}
{% endif %} {% if w.specialEffect %}
Effet spécial : {{ w.specialEffect }}
{% endif %} {% if w.statusInflicted %}
Inflige : {%- for e in w.statusInflicted -%} {{ statusMap[e['status_id']] ?? '?' }}{% if e['probability'] < 100 %} ({{ e['probability'] }}%){% endif %}{% if not loop.last %}, {% endif %} {%- endfor -%}
{% endif %} {% if w.grantsSkills %}
Confère : {%- for id in w.grantsSkills -%} {{ skillMap[id] ?? '?' }}{% if not loop.last %}, {% endif %} {%- endfor -%}
{% endif %}
{% endmacro %} {% block detail %} {% import _self as variantMacros %}
{{ icon_img(weapon) }}

{{ weapon.name }} {% include 'entity/_favorite_star.html.twig' with {favType: 'weapon', favEntityId: weapon.id} only %}

{% if weapon.weaponType %}{{ weapon.weaponType.name }}{% endif %} {% if weapon.elementModifier %}{{ weapon.elementModifier.name }}{% endif %} {{ rarity_stars(weapon.rarity, weapon.gameId) }}
{% if weapon.description %}

{{ weapon.description }}

{% endif %} {% if weapon.specialEffect %}
Effet spécial
{{ weapon.specialEffect }}
{% endif %} {% with {s: weapon.stats} %} {% if s.pvMax or s.egMax or s.attaque or s.defense or s.arcane or s.sagesse or s.vitesse or s.finesse %}
Stats
{{ stats(s) }}
{% endif %} {% endwith %} {# ── Statistiques de combat (CaracteristicsTrait) ── #} {% set hasCombat = weapon.accuracy is not null or weapon.evasion is not null or weapon.criticalRate is not null or weapon.criticalEvasion is not null or weapon.magicEvasion is not null or weapon.physicalCounter is not null or weapon.magicalCounter is not null or weapon.regenPv is not null or weapon.regenEg is not null or weapon.regenPower is not null or weapon.priority is not null or weapon.bonusHit is not null or weapon.threat is not null or weapon.defenseRate is not null or weapon.regenRate is not null or weapon.healingRate is not null or weapon.egCost is not null or weapon.powerGains is not null or weapon.physicalTaken is not null or weapon.magicalTaken is not null or weapon.xpGain is not null %} {% if hasCombat %}
Statistiques de combat
{% if weapon.accuracy is not null %}Précision :{{ weapon.accuracy }}%{% endif %} {% if weapon.evasion is not null %}Esquive :{{ weapon.evasion }}%{% endif %} {% if weapon.criticalRate is not null %}Critique :{{ weapon.criticalRate }}%{% endif %} {% if weapon.criticalEvasion is not null %}Anti-critique :{{ weapon.criticalEvasion }}%{% endif %} {% if weapon.magicEvasion is not null %}Esquive magique :{{ weapon.magicEvasion }}%{% endif %} {% if weapon.physicalCounter is not null %}Contre physique :{{ weapon.physicalCounter > 0 ? '+' }}{{ weapon.physicalCounter }}%{% endif %} {% if weapon.magicalCounter is not null %}Contre magique :{{ weapon.magicalCounter > 0 ? '+' }}{{ weapon.magicalCounter }}%{% endif %} {% if weapon.regenPv is not null %}Rég. PV :{{ weapon.regenPv > 0 ? '+' }}{{ weapon.regenPv }}%{% endif %} {% if weapon.regenEg is not null %}Rég. {{ ('resource.eg.' ~ weapon.gameId)|trans({}, 'game') }} :{{ weapon.regenEg > 0 ? '+' }}{{ weapon.regenEg }}%{% endif %} {% if weapon.regenPower is not null %}Rég. {{ ('resource.tp.' ~ weapon.gameId)|trans({}, 'game') }} :{{ weapon.regenPower > 0 ? '+' }}{{ weapon.regenPower }}%{% endif %} {% if weapon.priority is not null %}Priorité :{{ weapon.priority }}{% endif %} {% if weapon.bonusHit is not null %}Bonus coup :{{ weapon.bonusHit }}{% endif %} {% if weapon.threat is not null %}Menace :×{{ weapon.threat }}{% endif %} {% if weapon.defenseRate is not null %}Taux défense :×{{ weapon.defenseRate }}{% endif %} {% if weapon.regenRate is not null %}Taux rég. :×{{ weapon.regenRate }}{% endif %} {% if weapon.healingRate is not null %}Taux soin :×{{ weapon.healingRate }}{% endif %} {% if weapon.egCost is not null %}{% set pct = ((weapon.egCost - 1) * 100)|round %}Coût {{ ('resource.eg.' ~ weapon.gameId)|trans({}, 'game') }} :{{ pct > 0 ? '+' }}{{ pct }}%{% endif %} {% if weapon.powerGains is not null %}Gains {{ ('resource.tp.' ~ weapon.gameId)|trans({}, 'game') }} :×{{ weapon.powerGains }}{% endif %} {% if weapon.physicalTaken is not null %}Dég. phys. reçus :×{{ weapon.physicalTaken }}{% endif %} {% if weapon.magicalTaken is not null %}Dég. mag. reçus :×{{ weapon.magicalTaken }}{% endif %} {% if weapon.xpGain is not null %}Gain XP :×{{ weapon.xpGain }}{% endif %}
{% endif %} {# ── Multiplicateurs de stats ── #} {% set multMap = { 'PvMax': {label: 'PV Max', value: weapon.multiplierPvMax}, 'EgMax': {label: 'EG Max', value: weapon.multiplierEgMax}, 'Attaque': {label: 'Attaque', value: weapon.multiplierAttaque}, 'Defense': {label: 'Défense', value: weapon.multiplierDefense}, 'Arcane': {label: 'Arcane', value: weapon.multiplierArcane}, 'Sagesse': {label: 'Sagesse', value: weapon.multiplierSagesse}, 'Vitesse': {label: 'Vitesse', value: weapon.multiplierVitesse}, 'Finesse': {label: 'Finesse', value: weapon.multiplierFinesse}, } %} {% set hasMult = multMap|filter(m => m.value is not null)|length > 0 %} {% if hasMult %}
Multiplicateurs de stats
{% for _, m in multMap %} {% if m.value is not null %} {% set pct = ((m.value - 1) * 100)|round %} {{ m.label }} : {{ pct > 0 ? '+' }}{{ pct }}% {% endif %} {% endfor %}
{% endif %} {# ── Aptitudes passives (flags booléens) ── #} {% set flags = [] %} {% if weapon.bodyguard %}{% set flags = flags|merge(['Garde du corps']) %}{% endif %} {% if weapon.keepsPower %}{% set flags = flags|merge(['Conserve ' ~ ('resource.tp.' ~ weapon.gameId)|trans({}, 'game')]) %}{% endif %} {% if weapon.halfEncounters %}{% set flags = flags|merge(['Rencontres ÷2']) %}{% endif %} {% if weapon.noEncounters %}{% set flags = flags|merge(['Aucune rencontre']) %}{% endif %} {% if weapon.noSurprises %}{% set flags = flags|merge(['Pas de surprise']) %}{% endif %} {% if weapon.morePreventives %}{% set flags = flags|merge(['Plus de préventives']) %}{% endif %} {% if weapon.doubleMoney %}{% set flags = flags|merge(['Argent ×2']) %}{% endif %} {% if weapon.betterLoot %}{% set flags = flags|merge(['Meilleur butin']) %}{% endif %} {% if weapon.noSkills %}{% set flags = flags|merge(['Compétences désactivées']) %}{% endif %} {% if flags is not empty %}
Aptitudes passives
{% for flag in flags %} {{ flag }} {% endfor %}
{% endif %} {% if weapon.statsDebuff %}
Débuffs infligés
{% for entry in weapon.statsDebuff %}
{{ statLbl[entry['stat']] ?? entry['stat'] }} : {{ entry['turns']|default(0) }} tour{{ entry['turns']|default(0) != 1 ? 's' }}
{% endfor %}
{% endif %} {% if weapon.statusInflicted %}
Statuts infligés
{% for e in weapon.statusInflicted %}
Inflige : {{ statusMap[e['status_id']] ?? '?' }} {% if e['probability'] < 100 %} ({{ e['probability'] }}%){% endif %}
{% endfor %}
{% endif %} {% if weapon.elementalResistance %}
Résistances élémentaires
{% for entry in weapon.elementalResistance %} {% set res = ((1 - entry.multiplier) * 100)|round %}
{{ elementMap[entry.element_id] ?? '?' }} : {{ res > 0 ? '+' }}{{ res }}%
{% endfor %}
{% endif %} {% if weapon.statusImmunity %}
Immunités
{% for id in weapon.statusImmunity %}
{{ statusMap[id] ?? '?' }}
{% endfor %}
{% endif %} {% if weapon.grantsSkills %}
Compétences accordées
{% for id in weapon.grantsSkills %} {{ skillMap[id] ?? '?' }} {% endfor %}
{% endif %} {# ── Consommation par utilisation (munition liée à l'attack skill) ── #} {% if weapon.costItem %} {% endif %} {# ── Variantes (Améliorations / Autres variantes) ── #} {% set isOnVariant = baseWeapon is not null and baseWeapon.id != weapon.id %} {% set otherVariants = [] %} {% for n, v in variants %} {% if v.id != weapon.id %}{% set otherVariants = otherVariants|merge([{n: n, w: v}]) %}{% endif %} {% endfor %} {% if isOnVariant or otherVariants|length > 0 %}
{{ isOnVariant ? 'Autres variantes' : 'Améliorations' }}
{# Ordre d'affichage : base d'abord (si on est sur une variante), puis +1..+N #} {% set displayList = [] %} {% if isOnVariant %} {% set displayList = displayList|merge([{w: baseWeapon, isBase: true}]) %} {% endif %} {% for e in otherVariants %} {% set displayList = displayList|merge([{w: e.w, isBase: false}]) %} {% endfor %} {% for item in displayList %} {{ variantMacros.variant_row(item.w, item.isBase, statusMap, skillMap) }} {% if not loop.last %} {# Matériaux nécessaires pour passer au palier suivant, si une recette le produit. On masque l'ingrédient qui correspond à l'arme précédente (redondant avec la boîte du dessus dans un arbre linéaire). #} {% set nextItem = displayList[loop.index0 + 1] %} {% set nextRecipe = variantRecipes[nextItem.w.id] ?? null %} {% if nextRecipe %}
{% for ing in nextRecipe.ingredients %} {% if ing.entity.id != item.w.id %} {{ icon_img(ing.entity, 32) }} {{ ing.entity.name }} ×{{ ing.quantity }} {% endif %} {% endfor %} {% if nextRecipe.recipe.cost %} Coût : {{ currency_pill(nextRecipe.recipe.cost, weapon.gameId) }} {% endif %}
{% endif %} {% endif %} {% endfor %}
{% endif %} {% include 'entity/_recipe_sections.html.twig' with { producedBy: producedBy ?? null, usedIn: usedIn ?? [], currentGameId: weapon.gameId, craftedNoun: 'e', } only %}
{% endblock %}