From 6d295a01a72bb88641444f6218f995a369dd2e1f Mon Sep 17 00:00:00 2001 From: lowercasedonkey <lowercasedonkey@gmail.com> Date: Thu, 29 Apr 2021 23:06:58 -0400 Subject: [PATCH] work --- css/general/formatting.css | 4 ++++ src/Mods/SecExp/attackOptions.js | 23 +++++++++++++++++------ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/css/general/formatting.css b/css/general/formatting.css index 3d54f5dd67d..c0fe2a072b7 100644 --- a/css/general/formatting.css +++ b/css/general/formatting.css @@ -45,6 +45,10 @@ font-weight: bold; } +.monospace { + font-family: "monospace"; +} + .strikethrough { text-decoration: line-through } diff --git a/src/Mods/SecExp/attackOptions.js b/src/Mods/SecExp/attackOptions.js index 2f720bc83dc..e64d3595853 100644 --- a/src/Mods/SecExp/attackOptions.js +++ b/src/Mods/SecExp/attackOptions.js @@ -17,7 +17,7 @@ App.Events.attackOptions = class attackOptions extends App.Events.BaseEvent { let _options; - App.UI.DOM.appendNewElement("h2", node, `${(V.majorBattle === 1) ? `Major ` : ``}Attack Imminent`); + App.UI.DOM.appendNewElement("h1", node, `${(V.majorBattle === 1) ? `Major ` : ``}Attack Imminent`, ["monospace", "red"]); if (V.majorBattle === 0) { if (V.SecExp.battles.victories + V.SecExp.battles.losses > 0) { r.push(`The ominous message dominates the screens of your office, and ${V.assistant.name} quickly gathers all information available to prepare for battle.`); @@ -110,7 +110,9 @@ App.Events.attackOptions = class attackOptions extends App.Events.BaseEvent { r.push(App.UI.DOM.makeElement("div", `Old world expeditions are usually sent to secure resources and trade routes for their nation or, more often, to provide their citizens with a bogeyman to be scared of. They are usually decently equipped and trained, which together with their generous numbers make them a tough nut to crack. However, they often lack in mobility.`)); } } - r.push(App.UI.DOM.makeElement("div", `<br>__Recon__: (AO: ${V.terrain})`)); + App.Events.addParagraph(node, r); + r = []; + App.UI.DOM.appendNewElement("h3", node, `Recon: (AO: ${V.terrain})`); const _estimatedMen = V.SecExp.war.estimatedMen; const _expectedEquip = V.SecExp.war.expectedEquip; r.push(`It seems your troops and your adversary will fight`); @@ -165,14 +167,13 @@ App.Events.attackOptions = class attackOptions extends App.Events.BaseEvent { r.push(App.UI.DOM.makeElement("span", `extremely well armed`, "strong")); r.push(`with excellent small arms and specialized teams with heavy duty infantry support weapons. Heavy presence of armored military vehicles, artillery pieces and even some attack helicopters.`); } - + App.Events.addParagraph(node, r); + r = []; App.UI.DOM.appendNewElement("h2", node, `Battle plan`); if (V.SecExp.war.commander === "bodyguard" && V.BodyguardID === 0 || V.SecExp.war.commander === "headGirl" && V.HeadGirlID === 0) { App.UI.DOM.makeElement("span", `Chosen leader ${V.SecExp.war.commander} cannot be found, please select another.`, "warning"); V.SecExp.war = "PC"; } - App.Events.addParagraph(node, r); - r = []; /* leader assignment */ _options = new App.UI.OptionsGroup(); @@ -207,9 +208,19 @@ App.Events.attackOptions = class attackOptions extends App.Events.BaseEvent { [`Blitzkrieg`, `Involves breaking the front of the enemy with a fast armored force concentrated into a small area.`], [`Human Wave`, `Involves assaulting the enemy with large numbers of infantry to overwhelm their lines.`], ]); + App.UI.DOM.appendNewElement("h3", node, `Tactics`); const tactics = App.Data.SecExp.TerrainAndTactics.get(V.SecExp.war.terrain); for (const tactic in tactics) { - _options.addOption(tactic, "chosenTactic", V.SecExp.war).addComment(tacticsDesc.get(tactic)).addValue("Select", tactic); + const option = _options.addOption(tactic, "chosenTactic", V.SecExp.war).addValue("Select", tactic); + const comment = document.createElement("span"); + if (tactics[tactic].atkMod > 0.2) { + App.UI.DOM.appendNewElement("span", comment, "Atk+", "green"); + } + if (tactics[tactic].defMod > 0.2) { + App.UI.DOM.appendNewElement("span", comment, "Def+", "green"); + } + comment.append(tacticsDesc.get(tactic)); + option.addComment(comment); } node.append(_options.render()); -- GitLab