{% if gun.grid_image_url %} {{ gun.name }} {% endif %}

{{ gun.name }}

{{ gun.caliber or '?' }} {% if gun.wiki_url %} wiki ↗{% endif %}
{{ "%.3f"|format(gun.weight_kg) if gun.weight_kg is not none else '?' }} Base weight (kg)
{% if gun.ergonomics %}
{{ gun.ergonomics }} Ergonomics
{% endif %} {% if gun.recoil_vertical %}
{{ gun.recoil_vertical }} Recoil (V)
{% endif %} {% if gun.fire_rate %}
{{ gun.fire_rate }} Fire rate
{% endif %}
Lightest possible build: {{ "%.3f"|format(lightest_total) }} kg base {{ "%.3f"|format(gun.weight_kg or 0) }} kg + lightest mod per required slot
{# ---- Macro to render a slot card ---- #} {% macro slot_card(slot, extra_class='', open=False) %} {% set lightest = slot.mods[0] if slot.mods else none %}
{{ slot.slot_name }} {% if extra_class == 'key-slot' %}key slot{% endif %} {{ slot.mods | length }} mods {% if lightest and lightest.weight_kg is not none %} lightest {{ "%.3f"|format(lightest.weight_kg) }} kg {% else %}—{% endif %}
{% if slot.mods %} {% for mod in slot.mods %}
{% if mod.grid_image_url %} {% else %}
{% endif %}
{{ mod.mod_name }} {% if mod.mod_short and mod.mod_short != mod.mod_name %} {{ mod.mod_short }} {% endif %}
{% if mod.wiki_url %} wiki {% endif %} {% if mod.weight_kg is not none %}{{ "%.3f"|format(mod.weight_kg) }} kg{% else %}—{% endif %}
{% endfor %} {% else %}
No compatible mods found in database.
{% endif %}
{% endmacro %} {# ---- Required slots (key slots highlighted, open by default) ---- #} {% if key_slots or req_slots %}
Required slots (counted in lightest build weight)
{% for slot in key_slots %} {{ slot_card(slot, 'key-slot', open=True) }} {% endfor %} {% for slot in req_slots %} {{ slot_card(slot, '', open=False) }} {% endfor %}
{% endif %} {# ---- Optional slots (collapsed behind toggle) ---- #} {% if optional_slots %}
Optional slots (not counted in lightest build weight)
{% for slot in optional_slots %} {{ slot_card(slot) }} {% endfor %}
{% endif %}