Files
mgt2-compendium-amiral-denisov/templates/commerce-result.hbs

217 lines
10 KiB
Handlebars
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<div class="mgt2-commerce-result">
{{!-- En-tête --}}
<div class="commerce-header">
<h3>
{{#if (eq type "passengers")}}
<i class="fas fa-users"></i> Résultats Passagers
{{else if (eq type "cargo")}}
<i class="fas fa-boxes"></i> Résultats Cargaison
{{else if (eq type "trade-goods")}}
<i class="fas fa-search"></i> Marchandises disponibles
{{else if (eq type "buy-prices")}}
<i class="fas fa-tag"></i> Prix d'achat
{{else if (eq type "sell-prices")}}
<i class="fas fa-hand-holding-usd"></i> Prix de vente
{{/if}}
</h3>
</div>
{{!-- ══════════════════════════════════════ --}}
{{!-- Passagers --}}
{{!-- ══════════════════════════════════════ --}}
{{#if (eq type "passengers")}}
<div class="commerce-section">
<p class="route">
<span class="route-uwp">{{dep.uwp}}</span>
<i class="fas fa-arrow-right route-arrow"></i>
<span class="route-uwp">{{dest.uwp}}</span>
<span class="route-parsecs">{{parsecs}} parsec{{#if (gt parsecs 1)}}s{{/if}}</span>
</p>
</div>
<table class="commerce-table">
<thead>
<tr>
<th class="col-label">Catégorie</th>
<th class="col-dice" data-tip="Résultat final (2D6 + MD). Le MD inclut : distance, zones, compétences, rang Social et niveau Intendant. Consulte la table p.238.">Total <i class="fas fa-info-circle tip-icon"></i></th>
<th class="col-main" data-tip="Nombre de passagers disponibles pour embarquement sur cette route.">Passagers</th>
<th class="col-main" data-tip="Prix du billet par passager selon la catégorie et la distance.">Tarif</th>
<th class="col-revenue" data-tip="Revenu potentiel = Nombre de passagers × Tarif unitaire.">Revenu</th>
</tr>
</thead>
<tbody>
{{#each categories}}
<tr class="{{#if count}}has-passengers{{/if}}">
<td class="col-label">{{label}}</td>
<td class="col-dice" title="2D6 ({{diceResult}}) + MD ({{#if (gte modifiers 0)}}+{{/if}}{{modifiers}}) = {{trafficTotal}}">{{trafficTotal}}</td>
<td class="col-main"><strong>{{count}}</strong></td>
<td class="col-main">{{formatCredits pricePerPax}}</td>
<td class="col-revenue">{{formatCredits revenue}}</td>
</tr>
{{/each}}
</tbody>
</table>
<div class="total-revenue-bar">
<span>Revenu total potentiel</span>
<strong>{{formatCredits totalRevenue}}</strong>
</div>
{{/if}}
{{!-- ══════════════════════════════════════ --}}
{{!-- Cargaison --}}
{{!-- ══════════════════════════════════════ --}}
{{#if (eq type "cargo")}}
<div class="commerce-section">
<p class="route">
<span class="route-uwp">{{dep.uwp}}</span>
<i class="fas fa-arrow-right route-arrow"></i>
<span class="route-uwp">{{dest.uwp}}</span>
<span class="route-parsecs">{{parsecs}} parsec{{#if (gt parsecs 1)}}s{{/if}}</span>
</p>
</div>
<table class="commerce-table">
<thead>
<tr>
<th class="col-label">Type</th>
<th class="col-dice" data-tip="Résultat final (2D6 + MD). Le MD inclut : distance, zones, rang Marine/Éclaireurs, SOC, vaisseau armé. Consulte la table p.240.">Total <i class="fas fa-info-circle tip-icon"></i></th>
<th class="col-main" data-tip="Nombre de lots de cargaison disponibles.">Lots</th>
<th class="col-main" data-tip="Tonnage par lot selon le type (Majeure : 10 t, Mineure : 5 t, Irrégulière : 1 t).">T/lot</th>
<th class="col-main" data-tip="Tarif de fret par tonne selon la catégorie et la distance en parsecs.">Tarif/t</th>
<th class="col-revenue" data-tip="Revenu potentiel = Lots × Tonnes/lot × Tarif/t.">Revenu</th>
</tr>
</thead>
<tbody>
{{#each lots}}
<tr>
<td class="col-label">{{label}}</td>
<td class="col-dice" title="2D6 ({{diceResult}}) + MD ({{#if (gte modifiers 0)}}+{{/if}}{{modifiers}}) = {{trafficTotal}}">{{trafficTotal}}</td>
<td class="col-main"><strong>{{count}}</strong></td>
<td class="col-main">{{tonsPerLot}} t</td>
<td class="col-main">{{formatCredits ratePerTon}}</td>
<td class="col-revenue">{{formatCredits revenue}}</td>
</tr>
{{/each}}
</tbody>
</table>
<div class="total-revenue-bar">
<span>Sous-total cargaison</span>
<strong>{{formatCredits cargoRevenue}}</strong>
</div>
</table>
<div class="commerce-section mail-section">
<i class="fas fa-envelope"></i>
<strong>Courrier :</strong>
{{#if mail.available}}
<span class="mail-available">
{{mail.count}} conteneur{{#if (gt mail.count 1)}}s{{/if}}
× 25 000 Cr = <strong>{{formatCredits mail.revenue}}</strong>
</span>
{{else}}
<span class="mail-none">Aucun courrier disponible</span>
{{/if}}
</div>
<div class="total-revenue-bar">
<span>Revenu total potentiel</span>
<strong>{{formatCredits totalRevenue}}</strong>
</div>
{{/if}}
{{!-- ══════════════════════════════════════ --}}
{{!-- Marchandises disponibles (trade-goods) --}}
{{!-- ══════════════════════════════════════ --}}
{{#if (eq type "trade-goods")}}
<div class="commerce-section">
<p>
<strong>Monde :</strong> <span class="route-uwp">{{world.uwp}}</span>
&nbsp;|&nbsp;
<strong>Codes :</strong>
{{#if world.tradeCodes.length}}
<span class="trade-codes">{{join world.tradeCodes " "}}</span>
{{else}}
<em>Aucun</em>
{{/if}}
</p>
{{#if supplierRoll}}
<p class="supplier-roll">
<i class="fas fa-dice"></i>
<strong>Recherche fournisseur :</strong>
<span class="dice-detail">{{supplierRoll.dice}} + {{supplierRoll.mod}}</span>
= <strong class="dice-total">{{supplierRoll.total}}</strong>
</p>
{{/if}}
</div>
{{#if goods.length}}
<table class="commerce-table">
<thead>
<tr>
<th class="col-d66" data-tip="Code de table D66 : lancer 2D6, lire le 1er dé comme dizaine et le 2e comme unité (ex : 3 et 2 → 32). Résultat entre 11 et 66.">D66</th>
<th class="col-label">Marchandise</th>
<th class="col-main" data-tip="Quantité disponible chez ce fournisseur. Résultat d'un jet de dés × multiplicateur de la table.">Dispo</th>
<th class="col-main" data-tip="Prix de référence par tonne selon la table des marchandises (p.244). Le prix réel est calculé lors de l'achat.">Prix base/t</th>
<th class="col-mod" data-tip="Modificateur de Dé à l'achat. S'ajoute au jet 3D : positif = prix réduit (moins cher), négatif = prix augmenté (plus cher).">MD achat <i class="fas fa-info-circle tip-icon"></i></th>
<th class="col-mod" data-tip="Modificateur de Dé à la vente. S'ajoute au jet 3D : positif = prix augmenté (plus cher), négatif = prix réduit (moins cher).">MD vente <i class="fas fa-info-circle tip-icon"></i></th>
</tr>
</thead>
<tbody>
{{#each goods}}
<tr {{#if illegal}}class="illegal-good"{{/if}}>
<td class="col-d66">{{d66}}</td>
<td class="col-label">{{name}}{{#if illegal}} <i class="fas fa-skull" title="Marchandise illégale — marché noir uniquement"></i>{{/if}}</td>
<td class="col-main">{{tons}} t</td>
<td class="col-main">{{formatCredits basePrice}}</td>
<td class="col-mod {{modClass buyMod}}">{{#if (gt buyMod 0)}}+{{/if}}{{buyMod}}</td>
<td class="col-mod {{modClass sellMod}}">{{#if (gt sellMod 0)}}+{{/if}}{{sellMod}}</td>
</tr>
{{/each}}
</tbody>
</table>
{{else}}
<p class="no-goods"><em>Aucune marchandise disponible sur ce monde.</em></p>
{{/if}}
{{/if}}
{{!-- ══════════════════════════════════════ --}}
{{!-- Prix d'achat / vente --}}
{{!-- ══════════════════════════════════════ --}}
{{#if (eq type "buy-prices")}}
<table class="commerce-table">
<thead>
<tr>
<th class="col-label">Marchandise</th>
<th class="col-main" data-tip="Tonnage acheté.">Tonnes</th>
<th class="col-dice" data-tip="Résultat final (3D6 + MD). Le MD inclut les codes commerciaux du monde et la compétence Courtier. Consulte la table des prix p.246.">Total <i class="fas fa-info-circle tip-icon"></i></th>
<th class="col-mod" data-tip="Pourcentage du prix de base appliqué au calcul du prix d'achat réel (ex : 80% = 20% de réduction).">% <i class="fas fa-info-circle tip-icon"></i></th>
<th class="col-revenue" data-tip="Coût total pour toutes les tonnes = Prix de base × % × Tonnes.">Coût total</th>
</tr>
</thead>
<tbody>
{{#each prices}}
<tr>
<td class="col-label" title="Base : {{formatCredits basePrice}}/t — Prix/t : {{formatCredits actualPrice}}">{{name}}</td>
<td class="col-main">{{tons}} t</td>
<td class="col-dice {{modClass modifier}}" title="3D6 ({{diceResult}}) + MD ({{#if (gte modifier 0)}}+{{/if}}{{modifier}}) = {{total}}">{{total}}</td>
<td class="col-mod">{{percent}}%</td>
<td class="col-revenue"><strong>{{formatCredits totalCost}}</strong></td>
</tr>
{{/each}}
</tbody>
</table>
<div class="total-revenue-bar">
<span>Coût d'achat total</span>
<strong>{{formatCredits grandTotal}}</strong>
</div>
{{/if}}
</div>