Restore display of enemy morale modifier
TLDR: Display morale.enemy exactly the same way that morale.slaves, morale.militia, and morale.mercs are displayed.
Ever since !10474 (merged), we've been converting morale.enemy to a percentage when the time comes to display (like morale.everythingElse).
morale.enemy = Math.round((morale.enemy-1) * 100);
But the calculated percentage is not actually displayed.
This branch displays morale.enemy exactly the same way morale.everythingElse is displayed.
Also, !10474 (diffs) removed
enemyMoraleTroopMod = Math.round((enemyMoraleTroopMod-1) * 100);
and replaced
App.UI.DOM.appendNewElement("div", node, `Morale: ${num(Math.round(enemyMorale))}. ${inBattle ? `Modifier: ${num(Math.round(enemyMod))}.` : ``} Increase due to troop numbers: +${enemyMoraleTroopMod}%.`);
with
App.UI.DOM.appendNewElement("div", node, `Morale: ${num(Math.round(enemyMorale))}. Troop difference multiplier: x${enemyMoraleTroopMod}.`);
This was, in part, because !10474 (diffs) had changed around what kind of number enemyMoraleTroopMod was, replacing
let enemyMoraleTroopMod = Math.clamp(V.SecExp.war.attacker.troops / 100, 1, (inBattle ? 5 : 10));
with
const enemyMoraleTroopMod = App.SecExp.troopDiffAdjust().enemy;
a change which has since then been reverted by !10864 (diffs).
For unknown reasons, when reverting the change to enemyMoraleTroopMod, !10864 (diffs) did not restore the original display of enemyMoraleTroopMod at the same time, instead deleting it entirely.
So the obvious option is to restore the original
enemyMoraleTroopMod = Math.round((enemyMoraleTroopMod-1) * 100);
...
App.UI.DOM.appendNewElement("div", node, `Morale: ${num(Math.round(enemyMorale))}. ${inBattle ? `Modifier: ${num(Math.round(enemyMod))}.` : ``} Increase due to troop numbers: +${enemyMoraleTroopMod}%.`);
But this branch goes ahead and makes the display of enemyMoraleTroopMod consistent with the way the other morale modifiers are now displayed. The code is, for the most part, a direct copy of https://gitgud.io/pregmodfan/fc-pregmod/-/blob/pregmod-master/src/Mods/SecExp/events/conflictHandler.js#L655.