diff --git a/src/Mods/SecExp/rebellionHandler.tw b/src/Mods/SecExp/rebellionHandler.tw index a30bed87ce91a9516c905a6fb1b42bc3e80ea98d..dff703c5f4e302bf525d3d68a77ef6dbc9f32ede 100644 --- a/src/Mods/SecExp/rebellionHandler.tw +++ b/src/Mods/SecExp/rebellionHandler.tw @@ -114,8 +114,8 @@ <<set _moraleTroopMod = Math.clamp(App.SecExp.battle.troopCount() / 100,1,10)>> /* morale and baseHp calculation */ -<<set _morale = (App.SecExp.BaseDroneUnit.morale * $secBots.active + App.SecExp.BaseMilitiaUnit.morale * App.SecExp.battle.deployedUnits('militia') + App.SecExp.BaseSlaveUnit.morale * App.SecExp.battle.deployedUnits('slaves') + App.SecExp.BaseMercUnit.morale * App.SecExp.battle.deployedUnits('mercs') + App.SecExp.BaseSpecialForcesUnit.morale * $SF.Active) / ($secBots.active + App.SecExp.battle.deployedUnits('militia') + App.SecExp.battle.deployedUnits('slaves') + App.SecExp.battle.deployedUnits('mercs') + $SF.Active)>> -<<set _morale = _morale + _morale * $SecExp.buildings ? $SecExp.buildings.barracks.luxury : 0 * 0.05>> /* barracks bonus */ +<<set _morale += (App.SecExp.BaseDroneUnit.morale * $secBots.active + App.SecExp.BaseMilitiaUnit.morale * App.SecExp.battle.deployedUnits('militia') + App.SecExp.BaseSlaveUnit.morale * App.SecExp.battle.deployedUnits('slaves') + App.SecExp.BaseMercUnit.morale * App.SecExp.battle.deployedUnits('mercs') + App.SecExp.BaseSpecialForcesUnit.morale * $SF.Active) / ($secBots.active + App.SecExp.battle.deployedUnits('militia') + App.SecExp.battle.deployedUnits('slaves') + App.SecExp.battle.deployedUnits('mercs') + $SF.Active)>> +<<set _morale += _morale * $SecExp.buildings.barracks ? $SecExp.buildings.barracks.luxury * 0.05 : 0>> /* barracks bonus */ <<set _morale *= _moraleTroopMod>> <<set _baseHp = (App.SecExp.BaseDroneUnit.hp * $secBots.active + App.SecExp.BaseMilitiaUnit.hp * App.SecExp.battle.deployedUnits('militia') + App.SecExp.BaseSlaveUnit.hp * App.SecExp.battle.deployedUnits('slaves') + App.SecExp.BaseMercUnit.hp * App.SecExp.battle.deployedUnits('mercs') + App.SecExp.BaseSpecialForcesUnit.hp * $SF.Active) / ($secBots.active + App.SecExp.battle.deployedUnits('militia') + App.SecExp.battle.deployedUnits('slaves') + App.SecExp.battle.deployedUnits('mercs') + $SF.Active)>> diff --git a/src/Mods/SecExp/rebellionReport.tw b/src/Mods/SecExp/rebellionReport.tw index 77ea87cedc3955b924c29f2c2974f738b587f1bc..e5ccfb4fefbf85a6bc21903882f95cc48ac36d8d 100644 --- a/src/Mods/SecExp/rebellionReport.tw +++ b/src/Mods/SecExp/rebellionReport.tw @@ -883,9 +883,6 @@ <</if>> <</if>> -<br> -<br> - <<include "unitsRebellionReport">> /* resets variables and flags */ diff --git a/src/Mods/SecExp/unitsRebellionReport.tw b/src/Mods/SecExp/unitsRebellionReport.tw index 9ec5cb55eea22044c0f5b220171899fffc842890..56e3694e378eb3785b100ea70ec8b03ff7116d12 100644 --- a/src/Mods/SecExp/unitsRebellionReport.tw +++ b/src/Mods/SecExp/unitsRebellionReport.tw @@ -2,17 +2,18 @@ <<if $losses == 0>> <<if $irregulars > 0>> - The volunteering citizens were quickly organized into an irregular militia unit and deployed in the arcology. No casualties suffered. + <p>The volunteering citizens were quickly organized into an irregular militia unit and deployed in the arcology. No casualties suffered.</p> <</if>> <<if App.SecExp.battle.deployedUnits('bots') >= 1>> - <br>Security drones: no casualties suffered. + <p>Security drones: no casualties suffered.</p> <</if>> <<if $SF.Toggle && $SF.Active >= 1>> <br>$SF.Lower, <<print num($SF.ArmySize)>> strong, was called to join the battle: no casualties suffered. <</if>> <<set _count = 0>> <<set _loyalUnits = $militiaUnits.length + $slaveUnits.length + $mercUnits.length - $rebellingID.length>> - <<if _loyalUnits > 0>> <br> + <<if _loyalUnits > 0>> + <p> <<for _i = 0; _i < $militiaUnits.length; _i++>> <<if $militiaUnits[_i].active == 1 && (!$rebellingID.includes($militiaUnits[_i].ID))>> <<set $militiaUnits[_i].battlesFought++>> @@ -47,6 +48,7 @@ <</if>> <</for>> participated in the battle without taking any casualties. They remained loyal until the end. + </p> <</if>> <<elseif $losses > 0>> /* if the losses are more than zero */ @@ -91,7 +93,7 @@ <<if _loss > $ACitizens * 0.95>> <<set _loss = Math.trunc($ACitizens * 0.95)>> /* this is unlikely to happen, but might as well be safe*/ <</if>> - <br><br>The volunteering citizens were quickly organized into an irregular militia unit and deployed in the arcology: + <p>The volunteering citizens were quickly organized into an irregular militia unit and deployed in the arcology: <<if _loss <= 0>> no casualties <<elseif _loss <= 10>> @@ -127,12 +129,13 @@ <<else>> <<set $lowerClass -= _loss>> <</if>> + </p> <</if>> <<if $secBots.active == 1>> <<set _loss = _lossesList.pluck()>> <<set _loss = Math.clamp(_loss,0,$secBots.troops)>> <<set $secBots.troops -= _loss>> - <br><br>Security drones: + <p>Security drones: <<if _loss <= 0>> no casualties <<elseif _loss <= 10>> @@ -151,11 +154,12 @@ <<elseif $secBots.troops <= 10>> The unit has very few operatives left, it risks complete annihilation if deployed again. <</if>> + </p> <</if>> <<if $SF.Toggle && $SF.Active >= 1>> <<set _loss = _lossesList.pluck()>> <<set _loss = Math.clamp(_loss,0,$SF.ArmySize)>> - <br><br> <<= App.SF.Caps()>>, $SF.ArmySize strong, is called to join the battle: + <p> <<= App.SF.Caps()>>, $SF.ArmySize strong, is called to join the battle: <<set $SF.ArmySize -= _loss>> <<if _loss <= 0>> no casualties @@ -169,9 +173,10 @@ catastrophic casualties <</if>> suffered. + </p> <</if>> <<if App.SecExp.battle.deployedUnits('militia') >= 1>> - <br> <<set _med = 0>> + <p> <<set _med = 0>> <<for _j = 0; _j < $militiaUnits.length; _j++>> <<if $militiaUnits[_j].active == 1 && !$rebellingID.includes($militiaUnits[_j].ID)>> <<set $militiaUnits[_j].battlesFought++>> @@ -210,9 +215,10 @@ <</if>> <</if>> <</for>> + </p> <</if>> <<if App.SecExp.battle.deployedUnits('slaves') >= 1>> - <br> <<set _med = 0>> + <p> <<set _med = 0>> <<for _j = 0; _j < $slaveUnits.length; _j++>> <<if $slaveUnits[_j].active == 1 && !$rebellingID.includes($slaveUnits[_j].ID)>> <<set $slaveUnits[_j].battlesFought++>> @@ -255,9 +261,10 @@ <</if>> <</if>> <</for>> + </p> <</if>> <<if App.SecExp.battle.deployedUnits('mercs') >= 1>> - <br> <<set _med = 0>> + <p> <<set _med = 0>> <<for _j = 0; _j < $mercUnits.length; _j++>> <<if $mercUnits[_j].active == 1 && !$rebellingID.includes($mercUnits[_j].ID)>> <<set $mercUnits[_j].battlesFought++>> @@ -296,6 +303,7 @@ <</if>> <</if>> <</for>> + </p> <</if>> <<else>> <br>@@.red;Error: losses are a negative number or NaN@@ @@ -485,4 +493,4 @@ <</if>> <<run cashX(forceNeg(1000 * _mercRebelledID.length), "war")>> <<run $mercUnits.deleteWith((u) => _mercRebelledID.includes(u.ID))>> -<</if>> +<</if>> \ No newline at end of file