import {formatDiceMnemonic} from "./formatDiceMnemonic.js"; export function createAttacksSection(data) { // Attacks section let attacks = document.createElement('div'); attacks.className = 'creature_attacks'; let attacksHTML = '

Attacks

'; let attacksTable = ''; for (let attack in data.attacks) { let mnemonic_display; mnemonic_display = formatDiceMnemonic(data.attacks[attack]); if (mnemonic_display === "0d0") { mnemonic_display = 'See Description'; } attacksTable += `` } attacksTable += '
${attack}${mnemonic_display}
'; attacks.innerHTML = attacksHTML + attacksTable; return attacks }