Skip to content
Snippets Groups Projects
Commit 81523a82 authored by hexall90's avatar hexall90
Browse files

Attackhandler almost finished

parent 879882b1
No related branches found
No related tags found
3 merge requests!1155Pregmod master,!1039Hexall90's security expansion mod,!871Security expansion
:: attackHandler [nobr]
Attack Imminent
<strong>Attack Imminent</strong>
<hr>
<br>
The ominous message dominates the screens of your office. <<print $assistantName>> quickly gathers all information available to prepare your arcology for battle.
<<if $attackType == "raiders">>
<<if $riskSim == 1 && $riskSimExpectedAttack == $attackType>>
......@@ -78,33 +77,31 @@ The ominous message dominates the screens of your office. <<print $assistantName
Some of your citizens, terrified by the mass of slaves assaulting, killing and butchering their fellow citizens, were gathering near the entrance of your penthouse. In the end it happened, the slaves dared attack their betters
<</if>>
<</if>>
<br><br>
<hr>
It seems your troops and your adversary will fight
<<if $battleTerrain == "urban">>
in @@.yellow;the streets of the arcology.@@
in <strong>the streets of the arcology.</strong>
<<elseif $battleTerrain == "rural">>
in @@.yellow;the rural land@@ surrounding the free city.
in <strong>the rural land</strong> surrounding the free city.
<<elseif $battleTerrain == "hills">>
on @@.yellow;the hills@@ around the free city.
on <strong>the hills</strong> around the free city.
<<elseif $battleTerrain == "sea">>
in @@.yellow;the sea@@ surrounding the city.
in <strong>the sea</strong> surrounding the city.
<<elseif $battleTerrain == "coast">>
along @@.yellow;the coast@@ just outside the free city.
along <strong>the coast</strong> just outside the free city.
<<elseif $battleterrain == "outskirts">>
right against @@.yellow;the walls of the arcology.@@
right against <strong>the walls of the arcology.</strong>
<<elseif $battleTerrain == "mountains">>
in @@.yellow;the mountains@@ overlooking the arcology.
in <strong>the mountains</strong> overlooking the arcology.
<<elseif $battleTerrain == "wasteland">>
in @@.yellow;the wastelands@@ outside the free city territory.
in <strong>the wastelands</strong> outside the free city territory.
<</if>>
<<if $riskSim == 1 && $riskSimExpectedAttack == $attackType>>
Your sophisticated virtual simulations and advanced recon drones allows you to accurately predict the numbers you're about to face. <<print $assistantName>> sends you the data: approximately @@.yellow;<<print Math.round($attackTroops * (1 + random(-1,1) * 0.1))>> men@@ are coming.
Your sophisticated virtual simulations and advanced recon drones allows you to accurately predict the numbers you're about to face. <<print $assistantName>> sends you the data: approximately <strong><<print Math.round($attackTroops * (1 + random(-1,1) * 0.1))>> men</strong> are coming.
<<elseif $perimeterDrones ==1>>
Thanks to your drones you have a rough estimate of the numbers you're about to face. <<print $assistantName>> sends you the data: around @@.yellow;<<print Math.round($attackTroops * (1 + random(-3,3) * 0.1))>> men@@ are coming
Thanks to your drones you have a rough estimate of the numbers you're about to face. <<print $assistantName>> sends you the data: around <strong><<print Math.round($attackTroops * (1 + random(-3,3) * 0.1))>> men</strong> are coming
<<else>>
Unfortunately you have no good information on what is coming your way, the confused reports of your citizens gives you only a vague number. @@.yellow;<<print $assistantName>> sends you the data: around <<print Math.round($attackTroops * (1 + random(-5,5) * 0.1))>> men@@ are coming.
Unfortunately you have no good information on what is coming your way, the confused reports of your citizens gives you only a vague number. <<print $assistantName>> sends you the data: around <strong><<print Math.round($attackTroops * (1 + random(-5,5) * 0.1))>> men</strong> are coming.
<</if>>
They seems to be
<<if $riskSim == 1 && $riskSimExpectedAttack == $attackType>>
......@@ -114,19 +111,32 @@ They seems to be
<<else>>
<<set $expectedEquip = $attackEquip + random(-2,2)>>
<</if>>
<<if $expectedEquip == 0>>
@@.yellow;poorly armed@@: old rusty small arms are the norm with just a few barely working civilian vehicles.
<<elseif $expectedEquip == 1>>
@@.yellow;lightly armed@@: mostly small arms with some repurposed civilian vehicles and a scattered few machine guns. There's no sign of heavy vehicles, artillery or aircrafts.
<<elseif $expectedEquip == 2>>
@@.yellow;decently armed@@: good quality small arms, machine guns a few mortars. There seems to be some heavy military vehicles coming as well.
<<elseif $expectedEquip == 3>>
@@.yellow;well armed@@: high quality small arms, snipers, demolitions teams, heavy duty machine guns and mortars. Heavy military vehicles are numerous and a few artillery piecies are accompaning the detachment.
<<elseif $expectedEquip == 4>>
extremely well armed: 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.
<<if $battleTerrain == "sea">>
<<if $expectedEquip == 0>>
<strong>;poorly armed</strong>: small rusty civilian ships armed with whatever could be salvaged.
<<elseif $expectedEquip == 1>>
<strong>;lightly armed</strong>: mostly unarmed civilian ships with a few small military boats with decent armaments.
<<elseif $expectedEquip == 2>>
<strong>;decently armed</strong>: a small fleet of salvaged military ships. Most small in size and firepower, with a few exceptions.
<<elseif $expectedEquip == 3>>
<strong>;well armed</strong>: a good assortment of military ships with good armament and some menacing heavy ships fitting a few powerful pieces of naval artillery.
<<elseif $expectedEquip == 4>>
extremely well armed: a majestic fleet filled with well armed ships, with heavy artillery present in high numbers. It seems even an old salvaged carrier is joining the attack.
<</if>>
<<else>>
<<if $expectedEquip == 0>>
<strong>;poorly armed</strong>: old rusty small arms are the norm with just a few barely working civilian vehicles.
<<elseif $expectedEquip == 1>>
<strong>;lightly armed</strong>: mostly small arms with some repurposed civilian vehicles and a scattered few machine guns. There's no sign of heavy vehicles, artillery or aircrafts.
<<elseif $expectedEquip == 2>>
<strong>;decently armed</strong>: good quality small arms, machine guns a few mortars. There seems to be some heavy military vehicles coming as well.
<<elseif $expectedEquip == 3>>
<strong>;well armed</strong>: high quality small arms, snipers, demolitions teams, heavy duty machine guns and mortars. Heavy military vehicles are numerous and a few artillery piecies are accompaning the detachment.
<<elseif $expectedEquip == 4>>
extremely well armed: 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.
<</if>>
<</if>>
<hr>
<br><br>
You quickly lay down a plan of action:
......@@ -143,34 +153,33 @@ You quickly lay down a plan of action:
<br><br>
/* leader assignment */
<span id="leader"><strong>$assistantName</strong></span> will lead your troops.
<span id="leader"><strong><<print $assistantName>></strong></span> will lead your troops.
<br>&nbsp;&nbsp;&nbsp;&nbsp;
<<if $leadingTroops != "PC">>
<<link "Personally join the battle">>
<<set $leadingTroops = "PC">>
<<replace "#leader">><strong>$PC.name</strong><</replace>>
<<replace "#leader">><strong><<print $PC.name>></strong><</replace>>
<<goto "attackHandler">>
<</link>>
<<else>>
Personally join the battle
<</if>>
<<if $Bodyguard != 0>>
|
<<if $leadingTroops != "assistant">>
<<link "Let $assistantName lead the troops">>
<<set $leadingTroops = "assistant">>
<<replace "#leader">><strong>$assistantName</strong><</replace>>
<<replace "#leader">><strong><<print $assistantName>></strong><</replace>>
<<goto "attackHandler">>
<</link>>
<<else>>
Personally join the battle
Let $assistantName lead the troops
<</if>>
<<if $Bodyguard != 0 && $slavesInArmy == 1>>
|
<<if $leadingTroops != "bodyguard">>
<<link "Let your bodyguard lead your troops">>
<<set $leadingTroops = "bodyguard">>
<<replace "#leader">><strong>$Bodyguard.slaveName</strong><</replace>>
<<replace "#leader">><strong><<print $Bodyguard.slaveName>></strong><</replace>>
<<goto "attackHandler">>
<</link>>
<<else>>
......@@ -182,7 +191,7 @@ You quickly lay down a plan of action:
<<if $leadingTroops != "headgirl">>
<<link "Let your head girl lead your troops">>
<<set $leadingTroops = "headGirl">>
<<replace "#leader">><strong>$HeadGirl.slaveName</strong><</replace>>
<<replace "#leader">><strong><<print $HeadGirl.slaveName>></strong><</replace>>
<<goto "attackHandler">>
<</link>>
<<else>>
......@@ -216,7 +225,7 @@ You quickly lay down a plan of action:
/* troop deployment */
<br><br>
With your current readiness level you can still send <span id="deploUni"><strong>$deployableUnits</strong></span>. Available units:
With your current readiness level you can <<if $deployedUnits > 0>>still<</if>> send <span id="deploUni"><strong><<print $deployableUnits>></strong></span>. Available units:
<<set _mL = $militiaUnits.length>>
<br>
<<for _i = 0; _i < _mL; _i++>>
......@@ -232,13 +241,13 @@ With your current readiness level you can still send <span id="deploUni"><strong
<<set $militiaUnits[_i].isDeployed = 1>>
<<set $deployableUnits-->>
<<set $deployedUnits++>>
<<replace "#deploUni">><strong>$deployableUnits</strong><</replace>>
<<replace "#deploUni">><strong><<print $deployableUnits>></strong><</replace>>
<<goto "attackHandler">>
<</link>>
<</if>>
<</if>>
<</for>>
<<set _ms $slaveUnits.length>>
<<set _ms = $slaveUnits.length>>
<br>
<<for _i = 0; _i < _mL; _i++>>
<<if $deployableUnits == 0>>
......@@ -253,7 +262,7 @@ With your current readiness level you can still send <span id="deploUni"><strong
<<set $slaveUnits[_i].isDeployed = 1>>
<<set $deployableUnits-->>
<<set $deployedUnits++>>
<<replace "#deploUni">><strong>$deployableUnits</strong><</replace>>
<<replace "#deploUni">><strong><<print $deployableUnits>></strong><</replace>>
<<goto "attackHandler">>
<</link>>
<</if>>
......@@ -273,7 +282,7 @@ With your current readiness level you can still send <span id="deploUni"><strong
<<set $mercUnits[_i].isDeployed = 1>>
<<set $deployableUnits-->>
<<set $deployedUnits++>>
<<replace "#deploUni">><strong>$deployableUnits</strong><</replace>>
<<replace "#deploUni">><strong><<print $deployableUnits>></strong><</replace>>
<<goto "attackHandler">>
<</link>>
<</if>>
......@@ -293,7 +302,7 @@ Units about to be deployed:
<<set $militiaUnits[_i].isDeployed = 0>>
<<set $deployableUnits++>>
<<set $deployedUnits-->>
<<replace "#deploUni">><strong>$deployableUnits</strong><</replace>>
<<replace "#deploUni">><strong><<print $deployableUnits>></strong><</replace>>
<<goto "attackHandler">>
<</link>>
<</if>>
......@@ -307,7 +316,7 @@ Units about to be deployed:
<<set $slaveUnits[_i].isDeployed = 0>>
<<set $deployableUnits++>>
<<set $deployedUnits-->>
<<replace "#deploUni">><strong>$deployableUnits</strong><</replace>>
<<replace "#deploUni">><strong><<print $deployableUnits>></strong><</replace>>
<<goto "attackHandler">>
<</link>>
<</if>>
......@@ -321,10 +330,79 @@ Units about to be deployed:
<<set $mercUnits[_i].isDeployed = 0>>
<<set $deployableUnits++>>
<<set $deployedUnits-->>
<<replace "#deploUni">><strong>$deployableUnits</strong><</replace>>
<<replace "#deploUni">><strong><<print $deployableUnits>></strong><</replace>>
<<goto "attackHandler">>
<</link>>
<</if>>
<</for>>
/* tactics */
<<if $leadingTroops != "PC">>
For this battle you command your chosen leaders to follow a <span id="tactic"><strong><<print $chosenTactic>></strong></span>
<<else>>
For this battle you choose to follow a <span id="tactic"><strong><<print $chosenTactic>></strong></span>
<</if>>
<br>
Defensive tactics
<br>
<<link "Bait and Bleed">>
<<set $chosenTactics = "Bait and Bleed">>
<<replace "#tactic">><strong><<print $chosenTactic>></strong><</replace>>
<</link>>
<br>&nbsp;&nbsp;&nbsp;&nbsp;//Combines bait and switch tactics with guerriglia style assaults, with the objective of slowly bleed the enemy.//
<br>&nbsp;&nbsp;&nbsp;&nbsp;//Useful for a force facing a superior enemy both in numbers and firepower. More effective in rough terrain.//
<br>
<<link "Guerrilla">>
<<set $chosenTactics = "Guerrilla">>
<<replace "#tactic">><strong><<print $chosenTactic>></strong><</replace>>
<</link>>
<br>&nbsp;&nbsp;&nbsp;&nbsp;//Involves using terrain knowledge and small fast attacks to hinder and weaken the enemy.//
<br>&nbsp;&nbsp;&nbsp;&nbsp;//Useful for a force facing a disciplined, classic army. More effective in rough terrain.//
<br>
<<link "choke Points">>
<<set $chosenTactics = "choke Points">>
<<replace "#tactic">><strong><<print $chosenTactic>></strong><</replace>>
<</link>>
<br>&nbsp;&nbsp;&nbsp;&nbsp;//Involves using terrain knowledge and strong fortifications in order to stop the enemy on its track.//
<br>&nbsp;&nbsp;&nbsp;&nbsp;//Useful for a force facing an enemy with superior firepower. More effective in rough terrain.//
<br>
<<link "Interior Lines">>
<<set $chosenTactics = "Interior Lines">>
<<replace "#tactic">><strong><<print $chosenTactic>></strong><</replace>>
<</link>>
<br>&nbsp;&nbsp;&nbsp;&nbsp;//Involves exploiting a defender's shorter logistics lines and redeployment times in order to keep the enemy pressured.//
<br>&nbsp;&nbsp;&nbsp;&nbsp;//Useful for a force facing a superior enemy both in numbers and firepower. More effective in open terrain.//
<br>
<<link "Pincer Manouver">>
<<set $chosenTactics = "Pincer Manouver">>
<<replace "#tactic">><strong><<print $chosenTactic>></strong><</replace>>
<</link>>
<br>&nbsp;&nbsp;&nbsp;&nbsp;//Involves letting the enemy push back the centre in order to envelop their formation.//
<br>&nbsp;&nbsp;&nbsp;&nbsp;//Useful for a force facing a numerically inferior enemy. More effective in open terrain.//
<br>
<<link "Defense In Depth">>
<<set $chosenTactics = "Shock And Awe">>
<<replace "#tactic">><strong><<print $chosenTactic>></strong><</replace>>
<</link>>
<br>&nbsp;&nbsp;&nbsp;&nbsp;//Involves letting the enemy gain terrain and alternating between delaying actions and small counterpushes.//
<br>&nbsp;&nbsp;&nbsp;&nbsp;//Useful for a force facing a numerically superior enemy. More effective in open terrain.//
<br>
Offensive Tactics
<br>
<<link "Blitzkrieg">>
<<set $chosenTactics = "Blitzkrieg">>
<<replace "#tactic">><strong><<print $chosenTactic>></strong><</replace>>
<</link>>
<br>&nbsp;&nbsp;&nbsp;&nbsp;//Involves breaking the front of the enemy with a fast armored force concentrated into a small area.//
<br>&nbsp;&nbsp;&nbsp;&nbsp;//Useful for a force facing a disciplined, strong enemy. More effective in open terrain.//
<br>
<<link "Human Wave">>
<<set $chosenTactics = "Human Wave">>
<<replace "#tactic">><strong><<print $chosenTactic>></strong><</replace>>
<</link>>
<br>&nbsp;&nbsp;&nbsp;&nbsp;//Involves assaulting the enemy with large numbers of infantry to overwhelm their lines.//
<br>&nbsp;&nbsp;&nbsp;&nbsp;//Useful for a technologically limited enemy. More effective in rough terrain.//
<br>
......@@ -3,8 +3,7 @@
/* base vars */
<<set $authority = 1000>>
<<set $security = 50>>
<,set $readiness = 0>>
<<set $attackPhase = 0>>
<<set $readiness = 0>>
<<set $attackType = "none">>
/* attacks progress stats */
......@@ -39,6 +38,7 @@
<<set $attackTraining = 0>>
<<set $deployableUnits = 0>>
<<set $deployedUnits = 0>>
<<set $battleTerrain = "none">>
/* Units */
<<if def $militiaUnits>>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment