{{#if (eq rollType 'CM')}}
{{localize 'BRP.card.CM'}}
{{else}} {{#if (eq cardType 'RE')}}
{{localize 'BRP.card.RE'}}
{{else}} {{#if (eq cardType 'PP')}}
{{localize 'BRP.card.PP'}}
{{else}}
{{#if edgeHeaderLabel}}{{edgeHeaderLabel}}{{else}}{{localize 'BRP.card.NO'}}{{/if}}
{{/if}} {{/if}} {{/if}}
    {{#each chatCard as |c key|}}
  1. {{c.label}} ({{c.targetScore}}%)
    {{#isOr (eq ../cardType 'RE') (eq ../cardType 'PP')}}
    {{localize 'BRP.rawScore'}}: {{c.rawScore}} | {{localize 'BRP.resistVal'}}: {{c.resistance}} | {{localize 'BRP.targetScore'}}: {{c.targetScore}}%
    {{else}}
    Edge: {{c.diffLabel}} | {{c.targetBreakdownText}}
    Roll: {{c.edgeRollText}}
    {{#if (eq ../rollType 'CM')}}
    Weapon: {{c.weaponLabel}} | Ammo: {{c.ammoTag}} | Mode: {{c.fireMode}}
    {{#if (gt c.fireModeHitBonus 0)}}
    Fire Mode Bonus: +{{c.fireModeHitBonus}}% | Hits on this roll: {{c.fireModeHitCount}}
    {{/if}}
    Ammo Cost: {{c.ammoCostTotal}} CRD | Credits: {{c.ammoCreditsBefore}} -> {{c.ammoCreditsAfter}}
    {{#if c.ammoCreditsDeficit}}
    CREDIT DEFICIT: {{c.ammoCreditsDeficitAmount}} CRD
    {{/if}} {{#if c.fireModeStrayRisk}}
    AUTO FUMBLE: +1 stray round may hit a friendly or bystander in lane.
    {{/if}} {{/if}} {{/isOr}} {{#if (eq c.resultLevel 4)}} {{c.resultLabel}}: {{c.rollVal}} {{#unless (eq healing 0)}} [{{healing}}]{{/unless}} {{/if}} {{#if (eq c.resultLevel 3)}} {{c.resultLabel}}: {{c.rollVal}} {{#unless (eq healing 0)}} [{{healing}}]{{/unless}} {{/if}} {{#if (eq c.resultLevel 2)}} {{c.resultLabel}}: {{c.rollVal}} {{#unless (eq healing 0)}} [{{healing}}]{{/unless}} {{/if}} {{#if (eq c.resultLevel 1)}} {{c.resultLabel}}: {{c.rollVal}} {{/if}} {{#if (eq c.resultLevel 0)}} {{c.resultLabel}}: {{c.rollVal}} {{#unless (eq healing 0)}} [{{healing}}]{{/unless}} {{/if}} {{#if (lt c.malfunction 0)}} {{localize 'BRP.malfunction'}} {{/if}}
  2. {{localize 'BRP.targetScore'}}: {{c.targetScore}}
    {{localize 'BRP.rawScore'}}: {{c.rawScore}}
    {{#isOr (eq ../cardType 'RE') (eq ../cardType 'PP')}}
    {{localize 'BRP.resistVal'}}: {{c.resistance}}
    {{else}}
    {{localize 'BRP.difficulty'}}: {{c.diffLabel}}
    Edge Roll: {{c.edgeRollText}}
    Target Breakdown: {{c.targetBreakdownText}}
    {{/isOr}} {{#isOr (eq ../cardType 'RE') (eq ../cardType 'PP')}} {{else}}
    {{localize 'BRP.flatMod'}}: {{#if (lt c.flatMod 0)}} {{c.flatMod}} {{else}} +{{c.flatMod}} {{/if}}
    {{/isOr}} {{#if c.drugSummary}}
    {{localize 'BRP.drugEffects'}}: {{c.drugSummary}}
    {{localize 'BRP.drugRollMod'}}: {{c.drugFlatMod}}%
    {{#if (gt c.drugExtraActions 0)}}
    {{localize 'BRP.drugExtraActions'}}: +{{c.drugExtraActions}}
    {{/if}} {{/if}} {{#if c.mentalSummary}}
    Mental: {{c.mentalSummary}}
    Mental Roll Mod: {{c.mentalFlatMod}}%
    {{/if}} {{#unless (eq c.healingLabel "")}}
    {{localize 'BRP.healing'}}: {{c.healingLabel}}[{{c.healing}}]
    {{/unless}} {{#if (eq ../rollType 'CM')}}
    {{localize 'BRP.ammo'}}: {{c.ammoTag}}
    {{#if c.ammoSummary}}
    {{localize 'BRP.ammoEffect'}}: {{c.ammoSummary}}
    {{/if}} {{#if (gt c.ammoCreditsSpent 0)}}
    {{localize 'BRP.ammoCreditsSpent'}}: {{c.ammoCreditsSpent}} CRD ({{c.ammoCreditsBefore}} -> {{c.ammoCreditsAfter}})
    {{/if}} {{/if}} {{#if (eq c.description "")}}
    {{localize 'BRP.diceRoll'}}: {{c.diceRolled}}
    {{else}}
    {{localize 'BRP.diceRoll'}}: {{c.diceRolled}}
    {{localize 'BRP.description'}}: {{c.description}}
    {{/if}} {{#if c.showDebug}}
    DEBUG: {{#with c.debugPayload as |d|}} type={{d.rollType}} card={{d.cardType}} edge={{d.edge}} | base={{d.targetBase}} manual={{d.manualFlat}} sys={{d.systemFlat}} fire={{d.fireModeBonus}} cap={{d.targetCapApplied}} final={{d.targetFinal}} | roll={{d.rollVal}} lvl={{d.resultLevel}} {{/with}}
    {{/if}}
    {{#if (eq ../rollType 'CM')}} {{#if (gt c.resultLevel 1)}} {{#with (lookup ../slaAppliedCardMeta key) as |applied|}} {{#if (gt applied.count 0)}}
    {{localize 'BRP.slaDamageTotal' damage=applied.lastDamage}}
    {{localize 'BRP.slaDamageAppliedSummary' count=applied.count target=applied.lastTarget damage=applied.lastDamage location=applied.lastLocation}}
    {{localize 'BRP.slaDamageAppliedWeapon' weapon=applied.lastWeaponName ammo=applied.lastAmmoTag mode=applied.lastFireMode}}
    {{localize 'BRP.slaDamageHitBreakdown' breakdown=applied.hitBreakdownText}}
    {{localize 'BRP.slaDamageDiceSummary' summary=applied.damageDiceSummary}}
    {{else}}
    {{/if}} {{else}}
    {{/with}} {{/if}} {{/if}} {{/each}}