diff --git a/src/SecExp/SecExpBackwardCompatibility.tw b/src/SecExp/SecExpBackwardCompatibility.tw index 7c95933dbc94258d62ef3be7838823eca1a4a5e5..e0f18427c46d391f361cb9fd9ba03c4da2a2a232 100644 --- a/src/SecExp/SecExpBackwardCompatibility.tw +++ b/src/SecExp/SecExpBackwardCompatibility.tw @@ -4,76 +4,145 @@ <<if ndef $authority>> <<set $authority = 1000>> <</if>> -<<if ndef $authority>> +<<if ndef $security>> <<set $security = 50>> <</if>> -<<if ndef $authority>> +<<if ndef $readiness>> <<set $readiness = 0>> <</if>> -<<if ndef $authority>> +<<if ndef $attackType>> <<set $attackType = "none">> <</if>> -<<if ndef $authority>> +<<if ndef $attackThisWeek>> <<set $attackThisWeek = 0>> <</if>> -<<if ndef $authority>> +<<if ndef $lastAttackWeeks>> <<set $lastAttackWeeks = 0>> <</if>> - +<<if ndef $hasFought>> + <<set $hasFought = 0>> +<</if>> + /* upgrades */ <<if ndef $riskSim>> -<<set $riskSim = 0>> + <<set $riskSim = 0>> <</if>> <<if ndef $riskSimExpectedAttack>> -<<set $riskSimExpectedAttack = "none">> + <<set $riskSimExpectedAttack = "none">> <</if>> <<if ndef $perimeterDrones>> -<<set $perimeterDrones = 0>> + <<set $perimeterDrones = 0>> <</if>> /* battle relevant vars */ <<if ndef $chosenTactic>> -<<set $chosenTactic = "none">> + <<set $chosenTactic = "none">> <</if>> <<if ndef $leadingTroops>> -<<set $leadingTroops = "none">> + <<set $leadingTroops = "none">> <</if>> <<if ndef $attackTroops>> -<<set $attackTroops = 0>> + <<set $attackTroops = 0>> <</if>> <<if ndef $attackEquip>> -<<set $attackEquip = 0>> + <<set $attackEquip = 0>> <</if>> <<if ndef $deployableUnits>> -<<set $deployableUnits = 0>> + <<set $deployableUnits = 0>> <</if>> <<if ndef $deployedUnits>> -<<set $deployedUnits = 0>> + <<set $deployedUnits = 0>> <</if>> <<if ndef $battleTerrain>> -<<set $battleTerrain = "none">> + <<set $battleTerrain = "none">> +<</if>> +<<if ndef $expectedEquip>> + <<set $expectedEquip = 0>> +<</if>> +<<if ndef $phase>> + <<set $phase = 0>> +<</if>> +<<if ndef $recon>> + <<set $recon = 0>> +<</if>> +<<if ndef $attackV>> + <<set $attackV = 0>> +<</if>> +<<if ndef $defenseV>> + <<set $defenseV = 0>> +<</if>> +<<if ndef $morale>> + <<set $morale = 0>> +<</if>> +<<if ndef $enemyAttackV>> + <<set $enemyAttackV = 0>> +<</if>> +<<if ndef $enemyDefenseV>> + <<set $enemyDefenseV = 0>> +<</if>> +<<if ndef $enemyMorale>> + <<set $enemyMorale = 0>> +<</if>> +<<if ndef $losses>> + <<set $losses = 0>> <</if>> - -<<set $phase = 0>> -<<set $recon = 0>> -<<set $attackV = 0>> -<<set $defenseV = 0>> -<<set $morale = 0>> -<<set $enemyAttackV = 0>> -<<set $enemyDefenseV = 0>> -<<set $enemyMorale = 0>> -<<set $totalLosses = 0>> -<<set $militiaLosses = 0>> -<<set $slaveLosses = 0>> -<<set $mercLosses = 0>> /* units */ +<<if ndef $secBots && $arcologyUpgrade.drones != 1>> + <<set $secBots = { + active: 0, + isDeployed: 0, + troops: 0, + maxTroops: 0, + equip: 0} >> +<<elseif ndef $secBots && $arcologyUpgrade.drones == 1>> + <<set $secBots = { + active: 1, + isDeployed: 0, + troops: 30, + maxTroops: 30, + equip: 0} >> +<</if>> + <<if ndef $militiaUnits>> <<set $militiaUnits = []>> + <<set $militiaUnits[0] = { + active: 0, + isDeployed: 0, + isTired: 0, + troops: 0, + maxTroops: 0, + equip: 0, + training: 0, + loyalty: 0, + medics: 0, + engineers: 0} >> <</if>> <<if ndef $slaveUnits>> <<set $slaveUnits = []>> + <<set $slaveUnits[0] = { + active: 0, + isDeployed: 0, + isTired: 0, + troops: 0, + maxTroops: 0, + equip: 0, + training: 0, + loyalty: 0, + medics: 0, + engineers: 0} >> <</if>> <<if ndef $mercUnits>> <<set $mercUnits = []>> + <<set $mercUnits[0] = { + active: 0, + isDeployed: 0, + isTired: 0, + troops: 0, + maxTroops: 0, + equip: 0, + training: 0, + loyalty: 0, + medics: 0, + engineers: 0} >> <</if>> \ No newline at end of file diff --git a/src/SecExp/attackGenerator.tw b/src/SecExp/attackGenerator.tw index 14fb539145cdf4573aa20d1f9c6685b07b5c8be9..c3b88dc915c3a4795b7bf7ee9fcebd12acd0e280 100644 --- a/src/SecExp/attackGenerator.tw +++ b/src/SecExp/attackGenerator.tw @@ -1,7 +1,7 @@ :: attackGenerator [nobr] /* _attackChance value is the chance out of 100 of an attack happening this week */ -<<if $lastAttackWeeks < 3>> +<<if $lastAttackWeeks < 3 || $arcologyUpgrade.drones != 1>> /* attacks are deactivated until the player has at least the drones as a unit to send in battle */ <<set _attackChance = 0>> <<else>> <<if $week < 30>> @@ -30,6 +30,10 @@ <<if random(1,100) <= _attackChance>> <<set $attackThisWeek = 1>> <<set $lastAttackWeeks = 0>> + <<set $leadingTroops = "assistant">> + <<set $deployableUnits = 1 + $readiness>> + <<set $chosenTactic = either("Bait and Bleed", "Guerrilla", "choke Points", "Interior Lines", "Pincer Manouver", "Defense In Depth", "Blitzkrieg", "Human Wave")>> + /* _type is the chance out of 100 of an attack of that type happening */ <<set _raider = 25>> <<set _oldWorld = 25>> diff --git a/src/SecExp/attackHandler.tw b/src/SecExp/attackHandler.tw index 3b737e44ba87f56ba1a15c4f0e96a7ccffc43e37..3f9a7fe1712da6c69ee978b3cdf4a3de29789a7c 100644 --- a/src/SecExp/attackHandler.tw +++ b/src/SecExp/attackHandler.tw @@ -12,6 +12,12 @@ The ominous message dominates the screens of your office, <<print $assistantName <<else>> Some of your citizens saw the disorganized horde of raiders coming towards the city and quickly reported it. To such jackals your arcology surely looks like an appetizing morsel. <</if>> + <br> + Raiders: + <br> - high attack + <br> - low defense + <br> - low toughness + <br> - low morale <<elseif $attackType == "free city">> <<if $riskSim == 1 && $riskSimExpectedAttack == $attackType>> A menacing column of consumed mercenaries and slavers is coming to your city. Another free city is ready to use their best tools to bring down a dangerous competitor. @@ -21,6 +27,12 @@ The ominous message dominates the screens of your office, <<print $assistantName <<else>> Some of your citizens saw the menacing column of consumed mercenaries and slavers and rushed to your office to bring the grim news. Another free city is ready to use their best tools to bring down a dangerous competitor. <</if>> + <br> + Free City expedition: + <br> - low attack + <br> - high defense + <br> - moderate toughness + <br> - moderate morale <<elseif $attackType == "freedom fighters">> <<if $riskSim == 1 && $riskSimExpectedAttack == $attackType>> A dangerous looking army of guerrillas is gathering just outside the arcology. Fanatics and idealists armed with dead men's words and hope, set on erasing your fledgling empire. @@ -30,6 +42,12 @@ The ominous message dominates the screens of your office, <<print $assistantName <<else>> Some of your citizens saw the dangerous looking army of guerrillas is gathering just outside the arcology. Fanatics and idealists armed with dead men's words and hope, set on erasing your fledgling empire. <</if>> + <br> + Freedom Fighters: + <br> - very high attack + <br> - low defense + <br> - moderate toughness + <br> - very high morale <<elseif $attackType == "old world">> <<if $riskSim == 1 && $riskSimExpectedAttack == $attackType>> A diciplined yet dusty, scruffy old world army is approaching the confines of your arcology. There's nothing better than a good war to unite the electorate and your arcology is just the perfect target. @@ -39,6 +57,12 @@ The ominous message dominates the screens of your office, <<print $assistantName <<else>> Some of your citizens saw the diciplined yet dusty, scruffy old world army is approaching the confines of your arcology. There's nothing better than a good war to unite the electorate and your arcology is just the perfect target. <</if>> + <br> + Old world expedition: + <br> - high attack + <br> - high defense + <br> - low toughness + <br> - low morale <<elseif $attackType == "mercenary">> <<if $riskSim == 1 && $riskSimExpectedAttack == $attackType>> Some sections of the lower levels were already no longer responding. In the end it happened, your own mercenaries took arms against their benefactor. @@ -67,6 +91,11 @@ 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>> + + <<if $hasFought != 1>> + <br> + This is your first battle as an arcology owner, <<print $assistantName>> suggests reviewing the meaning of all the data laying in front of you: [[Battle statistics and mechanics|secTutorial]] + <</if>> <hr> It seems your troops and your adversary will fight <<if $battleTerrain == "urban">> @@ -85,30 +114,30 @@ It seems your troops and your adversary will fight 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 <strong><<print Math.round($attackTroops * (1 + random(-1,1) * 0.1))>> men</strong> are coming. + Your sophisticated virtual simulations and advanced recon drones allows you to accurately predict the numbers you're about to face.Approximately <strong><<print Math.round($attackTroops * (1 + either(-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 <strong><<print Math.round($attackTroops * (1 + random(-3,3) * 0.1))>> men</strong> are coming + Thanks to your drones you have a rough estimate of the numbers you're about to face. Around <strong><<print Math.round($attackTroops * (1 + either(-1,1) * random(2) * 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. <<print $assistantName>> sends you the data: around <strong><<print Math.round($attackTroops * (1 + random(-5,5) * 0.1))>> men</strong> 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. Around <strong><<print Math.round($attackTroops * (1 + either(-1,1) * random(3) * 0.1))>> men</strong> are coming. <</if>> They seems to be <<if $riskSim == 1 && $riskSimExpectedAttack == $attackType>> <<set $expectedEquip = $attackEquip>> <<elseif $perimeterDrones == 1>> - <<set $expectedEquip = $attackEquip + random(-1,1)>> + <<set $expectedEquip = $attackEquip + either(-1,1)>> <<else>> - <<set $expectedEquip = $attackEquip + random(-2,2)>> + <<set $expectedEquip = $attackEquip + either(-1,1) * random(2)>> <</if>> <<if $expectedEquip == 0>> - <strong>;poorly armed</strong>: old rusty small arms are the norm with just a few barely working civilian vehicles. + <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. + <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. + <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. + <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. + <strong>extremely well armed</strong>. 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>> <br><br> @@ -125,7 +154,7 @@ You quickly lay down a plan of action: <br> //$assistantName will handle leaders, tactics and troop deployment to the best of her abilities. To be implemented// <br><br> -<<set $leadingTroops = "assistant">> + /* leader assignment */ <span id="leader"><strong><<print $assistantName>></strong></span> will lead your troops. <br> @@ -133,7 +162,6 @@ You quickly lay down a plan of action: <<link "Personally join the battle">> <<set $leadingTroops = "PC">> <<replace "#leader">><strong><<print $PC.name>></strong><</replace>> - <<goto "attackHandler">> <</link>> <<else>> Personally join the battle @@ -143,7 +171,6 @@ You quickly lay down a plan of action: <<link "Let $assistantName lead the troops">> <<set $leadingTroops = "assistant">> <<replace "#leader">><strong><<print $assistantName>></strong><</replace>> - <<goto "attackHandler">> <</link>> <<else>> Let $assistantName lead the troops @@ -154,7 +181,6 @@ You quickly lay down a plan of action: <<link "Let your bodyguard lead your troops">> <<set $leadingTroops = "bodyguard">> <<replace "#leader">><strong><<print $Bodyguard.slaveName>></strong><</replace>> - <<goto "attackHandler">> <</link>> <<else>> Let your bodyguard lead your troops @@ -166,7 +192,6 @@ You quickly lay down a plan of action: <<link "Let your head girl lead your troops">> <<set $leadingTroops = "headGirl">> <<replace "#leader">><strong><<print $HeadGirl.slaveName>></strong><</replace>> - <<goto "attackHandler">> <</link>> <<else>> Let your head girl lead your troops @@ -178,7 +203,6 @@ You quickly lay down a plan of action: <<link "Let the citizens' militia officers lead the troops">> <<set $leadingTroops = "citizen">> <<replace "#leader">><strong>The citizens' militia commander</strong><</replace>> - <<goto "attackHandler">> <</link>> <<else>> Let the citizens' militia officers lead the troops. @@ -190,7 +214,6 @@ You quickly lay down a plan of action: <<link "Let the mercenary officers lead the troops">> <<set $leadingTroops = "mercenary">> <<replace "#leader">><strong>The mercenary commander</strong><</replace>> - <<goto "attackHandler">> <</link>> <<else>> Let the mercenary officers lead the troops. @@ -199,15 +222,24 @@ You quickly lay down a plan of action: /* troop deployment */ <br><br> -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++>> - <<if $deployableUnits == 0>> - Unit roster full. - <<break>> - <<else>> - <<if $militiaUnits[_i].isDeployed == 0>> +With your current readiness level you can <<if $deployedUnits > 0>>still<</if>> send <strong><<print $deployableUnits>></strong>. Available units: + +<<if $deployableUnits > 0>> + <<if $secBots.isDeployed == 0>> + <br> + <<secBotsDescription>> + <br> + <<link "Deploy the unit">> + <<set $secBots.isDeployed = 1>> + <<set $deployableUnits-->> + <<set $deployedUnits++>> + <<goto "attackHandler">> + <</link>> + <</if>> + <br> + <<set _mL = $militiaUnits.length>> + <<for _i = 0; _i < _mL; _i++>> + <<if $militiaUnits[_i].active == 1 && $militiaUnits[_i].isDeployed == 0>> <br> <<militiaUnitsDescription $militiaUnits[_i]>> <br> @@ -215,20 +247,14 @@ With your current readiness level you can <<if $deployedUnits > 0>>still<</if>> <<set $militiaUnits[_i].isDeployed = 1>> <<set $deployableUnits-->> <<set $deployedUnits++>> - <<replace "#deploUni">><strong><<print $deployableUnits>></strong><</replace>> <<goto "attackHandler">> <</link>> <</if>> - <</if>> -<</for>> -<<set _ms = $slaveUnits.length>> -<br> -<<for _i = 0; _i < _mL; _i++>> - <<if $deployableUnits == 0>> - Unit roster full. - <<break>> - <<else>> - <<if $slaveUnits[_i].isDeployed == 0>> + <</for>> + <<set _ms = $slaveUnits.length>> + <br> + <<for _i = 0; _i < _mL; _i++>> + <<if $slaveUnits[_i].active == 1 && $slaveUnits[_i].isDeployed == 0>> <br> <<slaveUnitsDescription $slaveUnits[_i]>> <br> @@ -236,19 +262,13 @@ With your current readiness level you can <<if $deployedUnits > 0>>still<</if>> <<set $slaveUnits[_i].isDeployed = 1>> <<set $deployableUnits-->> <<set $deployedUnits++>> - <<replace "#deploUni">><strong><<print $deployableUnits>></strong><</replace>> <<goto "attackHandler">> <</link>> <</if>> - <</if>> -<</for>> -<<set _mL = $mercUnits.length>> -<<for _i = 0; _i < _mL; _i++>> - <<if $deployableUnits == 0>> - Unit roster full. - <<break>> - <<else>> - <<if $mercUnits[_i].isDeployed == 0>> + <</for>> + <<set _mL = $mercUnits.length>> + <<for _i = 0; _i < _mL; _i++>> + <<if $mercUnits[_i].active == 1 && $mercUnits[_i].isDeployed == 0>> <br> <<mercUnitsDescription $mercUnits[_i]>> <br> @@ -256,119 +276,133 @@ With your current readiness level you can <<if $deployedUnits > 0>>still<</if>> <<set $mercUnits[_i].isDeployed = 1>> <<set $deployableUnits-->> <<set $deployedUnits++>> - <<replace "#deploUni">><strong><<print $deployableUnits>></strong><</replace>> <<goto "attackHandler">> <</link>> <</if>> - <</if>> -<</for>> + <</for>> +<<else>> + <br> + Unit roster full. +<</if>> <br><br> Units about to be deployed: -<br> -<<for _i = 0; _i < _mL; _i++>> - <<if $militiaUnits[_i].isDeployed == 1>> - <br> - <<militiaUnitsDescription $militiaUnits[_i]>> - <br> - <<link "Remove the unit">> - <<set $militiaUnits[_i].isDeployed = 0>> - <<set $deployableUnits++>> - <<set $deployedUnits-->> - <<replace "#deploUni">><strong><<print $deployableUnits>></strong><</replace>> - <<goto "attackHandler">> - <</link>> - <</if>> -<</for>> -<<for _i = 0; _i < _mL; _i++>> - <<if $slaveUnits[_i].isDeployed == 1>> - <br> - <<slaveUnitsDescription $slaveUnits[_i]>> - <br> - <<link "Remove the unit">> - <<set $slaveUnits[_i].isDeployed = 0>> - <<set $deployableUnits++>> - <<set $deployedUnits-->> - <<replace "#deploUni">><strong><<print $deployableUnits>></strong><</replace>> - <<goto "attackHandler">> - <</link>> - <</if>> -<</for>> -<<for _i = 0; _i < _mL; _i++>> - <<if $mercUnits[_i].isDeployed == 1>> - <br> - <<mercUnitsDescription $mercUnits[_i]>> - <br> - <<link "Remove the unit">> - <<set $mercUnits[_i].isDeployed = 0>> - <<set $deployableUnits++>> - <<set $deployedUnits-->> - <<replace "#deploUni">><strong><<print $deployableUnits>></strong><</replace>> - <<goto "attackHandler">> - <</link>> - <</if>> -<</for>> +<<if $deployedUnits > 0>> + <<if $secBots.isDeployed == 1>> + <br> + <<secBotsDescription>> + <br> + <<link "Remove the unit">> + <<set $secBots.isDeployed = 0>> + <<set $deployableUnits++>> + <<set $deployedUnits-->> + <<goto "attackHandler">> + <</link>> + <</if>> + <<for _i = 0; _i < _mL; _i++>> + <<if $militiaUnits[_i].isDeployed == 1>> + <br> + <<militiaUnitsDescription $militiaUnits[_i]>> + <br> + <<link "Remove the unit">> + <<set $militiaUnits[_i].isDeployed = 0>> + <<set $deployableUnits++>> + <<set $deployedUnits-->> + <<goto "attackHandler">> + <</link>> + <</if>> + <</for>> + <<for _i = 0; _i < _mL; _i++>> + <<if $slaveUnits[_i].isDeployed == 1>> + <br> + <<slaveUnitsDescription $slaveUnits[_i]>> + <br> + <<link "Remove the unit">> + <<set $slaveUnits[_i].isDeployed = 0>> + <<set $deployableUnits++>> + <<set $deployedUnits-->> + <<goto "attackHandler">> + <</link>> + <</if>> + <</for>> + <<for _i = 0; _i < _mL; _i++>> + <<if $mercUnits[_i].isDeployed == 1>> + <br> + <<mercUnitsDescription $mercUnits[_i]>> + <br> + <<link "Remove the unit">> + <<set $mercUnits[_i].isDeployed = 0>> + <<set $deployableUnits++>> + <<set $deployedUnits-->> + <<goto "attackHandler">> + <</link>> + <</if>> + <</for>> +<</if>> + +<br><br> /* tactics */ <<if $leadingTroops != "PC">> - For this battle you command your chosen leaders to follow a <span id="tactic"><strong><<print $chosenTactic>></strong></span> + For this battle you command your chosen leaders to follow <span id="tactic"><strong><<print $chosenTactic>></strong></span> tactics. <<else>> - For this battle you choose to follow a <span id="tactic"><strong><<print $chosenTactic>></strong></span> + For this battle you choose to follow <span id="tactic"><strong><<print $chosenTactic>></strong></span> tactics. <</if>> -<br> +<br><br> Defensive tactics <br> <<link "Bait and Bleed">> - <<set $chosenTactics = "Bait and Bleed">> + <<set $chosenTactic = "Bait and Bleed">> <<replace "#tactic">><strong><<print $chosenTactic>></strong><</replace>> <</link>> <br> //Combines bait and switch tactics with guerriglia style assaults, with the objective of slowly bleed the enemy.// -<br> //Useful for a force facing a superior enemy both in numbers and firepower. More effective in rough terrain.// +<br> <<link "Guerrilla">> - <<set $chosenTactics = "Guerrilla">> + <<set $chosenTactic = "Guerrilla">> <<replace "#tactic">><strong><<print $chosenTactic>></strong><</replace>> <</link>> <br> //Involves using terrain knowledge and small fast attacks to hinder and weaken the enemy.// -<br> //Useful for a force facing a disciplined, classic army. More effective in rough terrain.// +<br> <<link "choke Points">> - <<set $chosenTactics = "choke Points">> + <<set $chosenTactic = "choke Points">> <<replace "#tactic">><strong><<print $chosenTactic>></strong><</replace>> <</link>> <br> //Involves using terrain knowledge and strong fortifications in order to stop the enemy on its track.// -<br> //Useful for a force facing an enemy with superior firepower. More effective in rough terrain.// +<br> <<link "Interior Lines">> - <<set $chosenTactics = "Interior Lines">> + <<set $chosenTactic = "Interior Lines">> <<replace "#tactic">><strong><<print $chosenTactic>></strong><</replace>> <</link>> <br> //Involves exploiting a defender's shorter logistics lines and redeployment times in order to keep the enemy pressured.// -<br> //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">> + <<set $chosenTactic = "Pincer Manouver">> <<replace "#tactic">><strong><<print $chosenTactic>></strong><</replace>> <</link>> <br> //Involves letting the enemy push back the centre in order to envelop their formation.// -<br> //Useful for a force facing a numerically inferior enemy. More effective in open terrain.// +<br> <<link "Defense In Depth">> - <<set $chosenTactics = "Shock And Awe">> + <<set $chosenTactic = "Defense In Depth">> <<replace "#tactic">><strong><<print $chosenTactic>></strong><</replace>> <</link>> -<br> //Involves letting the enemy gain terrain and alternating between delaying actions and small counterpushes.// -<br> //Useful for a force facing a numerically superior enemy. More effective in open terrain.// +<br> //Involves letting the enemy gain terrain to gain tactical superiority by alternating between delaying actions and small counterattacks.// <br> Offensive Tactics +<br> <<link "Blitzkrieg">> - <<set $chosenTactics = "Blitzkrieg">> + <<set $chosenTactic = "Blitzkrieg">> <<replace "#tactic">><strong><<print $chosenTactic>></strong><</replace>> <</link>> <br> //Involves breaking the front of the enemy with a fast armored force concentrated into a small area.// -<br> //Useful for a force facing a disciplined, strong enemy. More effective in open terrain.// +<br> <<link "Human Wave">> - <<set $chosenTactics = "Human Wave">> + <<set $chosenTactic = "Human Wave">> <<replace "#tactic">><strong><<print $chosenTactic>></strong><</replace>> <</link>> <br> //Involves assaulting the enemy with large numbers of infantry to overwhelm their lines.// -<br> //Useful for a technologically limited enemy. More effective in rough terrain.// - - - +<br> +<br> +<<link "Commit your choices and send your orders">> + <<goto "attackReport">> +<</link>> \ No newline at end of file diff --git a/src/SecExp/secInit.tw b/src/SecExp/secInit.tw index d8f62b067c0f8a4d49979144029d5010142cdde4..ff00f58841b92d315273137c2d493a0b932492f5 100644 --- a/src/SecExp/secInit.tw +++ b/src/SecExp/secInit.tw @@ -4,9 +4,11 @@ <<set $authority = 1000>> <<set $security = 50>> <<set $readiness = 0>> +<<set $maxPlatoons = 0>> <<set $attackType = "none">> <<set $attackThisWeek = 0>> <<set $lastAttackWeeks = 0>> +<<set $hasFought = 0>> /* armed forces stats */ <<set $militiaCreated = 0>> @@ -33,6 +35,7 @@ <<set $deployableUnits = 0>> <<set $deployedUnits = 0>> <<set $battleTerrain = "none">> +<<set $expectedEquip = 0>> <<set $phase = 0>> <<set $recon = 0>> <<set $attackV = 0>> @@ -41,84 +44,130 @@ <<set $enemyAttackV = 0>> <<set $enemyDefenseV = 0>> <<set $enemyMorale = 0>> -<<set $totalLosses = 0>> -<<set $militiaLosses = 0>> -<<set $slaveLosses = 0>> -<<set $mercLosses = 0>> +<<set $losses = 0>> /* Units */ +<<if def $secBots>> + <<set $secBots.active = 0>> + <<set $secBots.isDeployed = 0>> + <<set $secBots.troops = 0>> + <<set $secBots.maxTroops = 0>> + <<set $secBots.equip = 0>> +<<else>> + <<set $secBots = { + active: 0, + isDeployed: 0, + troops: 0, + maxTroops: 0, + equip: 0} >> +<</if>> + <<if def $militiaUnits>> <<set _mL = $militiaUnits.length>> <<for _i = 0; _i < _mL; _i++>> <<if _i == 1>> - <<set $militiaUnits[_i].name = _i + "st Citizens' Division">> + <<set $militiaUnits[_i].platoonName = _i + "st Citizens' platoon">> <<elseif _i == 2>> - <<set $militiaUnits[_i].divisionName = _i + "nd Citizens' Division">> + <<set $militiaUnits[_i].platoonName = _i + "nd Citizens' platoon">> <<elseif _i == 3>> - <<set $militiaUnits[_i].divisionName = _i + "rd Citizens' Division">> + <<set $militiaUnits[_i].platoonName = _i + "rd Citizens' platoon">> <<else>> - <<set $militiaUnits[_i].divisionName = _i + "th Citizens' Division">> + <<set $militiaUnits[_i].platoonName = _i + "th Citizens' platoon">> <</if>> + <<set $militiaUnits[_i].active = 0>> <<set $militiaUnits[_i].isDeployed = 0>> <<set $militiaUnits[_i].isTired = 0>> <<set $militiaUnits[_i].troops = 0>> + <<set $militiaUnits[_i].maxTroops = 0>> <<set $militiaUnits[_i].equip = 0>> <<set $militiaUnits[_i].training = 0>> - <<set $militiaUnits[_i].rep = 0>> <<set $militiaUnits[_i].loyalty = 0>> <<set $militiaUnits[_i].medics = 0>> <<set $militiaUnits[_i].engineers = 0>> <</for>> <<else>> <<set $militiaUnits = []>> + <<set $militiaUnits[0] = { + active: 0, + isDeployed: 0, + isTired: 0, + troops: 0, + maxTroops: 0, + equip: 0, + training: 0, + loyalty: 0, + medics: 0, + engineers: 0} >> <</if>> + <<if def $slaveUnits>> <<set _mL = $slaveUnits.length>> <<for _i = 0; _i < _mL; _i++>> <<if _i == 1>> - <<set $slaveUnits[_i].name = _i + "st slave Division">> + <<set $slaveUnits[_i].platoonName = _i + "st slave platoon">> <<elseif _i == 2>> - <<set $slaveUnits[_i].divisionName = _i + "nd slave Division">> + <<set $slaveUnits[_i].platoonName = _i + "nd slave platoon">> <<elseif _i == 3>> - <<set $slaveUnits[_i].divisionName = _i + "rd slave Division">> + <<set $slaveUnits[_i].platoonName = _i + "rd slave platoon">> <<else>> - <<set $slaveUnits[_i].divisionName = _i + "th slave Division">> + <<set $slaveUnits[_i].platoonName = _i + "th slave platoon">> <</if>> <<set $slaveUnits[_i].isDeployed = 0>> <<set $slaveUnits[_i].isTired = 0>> <<set $slaveUnits[_i].troops = 0>> <<set $slaveUnits[_i].equip = 0>> <<set $slaveUnits[_i].training = 0>> - <<set $slaveUnits[_i].rep = 0>> <<set $slaveUnits[_i].loyalty = 0>> <<set $slaveUnits[_i].medics = 0>> <<set $slaveUnits[_i].engineers = 0>> <</for>> <<else>> <<set $slaveUnits = []>> + <<set $slaveUnits[0] = { + active: 0, + isDeployed: 0, + isTired: 0, + troops: 0, + maxTroops: 0, + equip: 0, + training: 0, + loyalty: 0, + medics: 0, + engineers: 0} >> <</if>> + <<if def $mercUnits>> <<set _mL = $mercUnits.length>> <<for _i = 0; _i < _mL; _i++>> <<if _i == 1>> - <<set $mercUnits[_i].name = _i + "st mercenary Division">> + <<set $mercUnits[_i].platoonName = _i + "st mercenary platoon">> <<elseif _i == 2>> - <<set $mercUnits[_i].divisionName = _i + "nd mercenary Division">> + <<set $mercUnits[_i].platoonName = _i + "nd mercenary platoon">> <<elseif _i == 3>> - <<set $mercUnits[_i].divisionName = _i + "rd mercenary Division">> + <<set $mercUnits[_i].platoonName = _i + "rd mercenary platoon">> <<else>> - <<set $mercUnits[_i].divisionName = _i + "th mercenary Division">> + <<set $mercUnits[_i].platoonName = _i + "th mercenary platoon">> <</if>> <<set $mercUnits[_i].isDeployed = 0>> <<set $mercUnits[_i].isTired = 0>> <<set $mercUnits[_i].troops = 0>> <<set $mercUnits[_i].equip = 0>> <<set $mercUnits[_i].training = 0>> - <<set $mercUnits[_i].rep = 0>> <<set $mercUnits[_i].loyalty = 0>> <<set $mercUnits[_i].medics = 0>> <<set $mercUnits[_i].engineers = 0>> <</for>> <<else>> <<set $mercUnits = []>> + <<set $mercUnits[0] = { + active: 0, + isDeployed: 0, + isTired: 0, + troops: 0, + maxTroops: 0, + equip: 0, + training: 0, + loyalty: 0, + medics: 0, + engineers: 0} >> <</if>> \ No newline at end of file diff --git a/src/SecExp/secTutorial.tw b/src/SecExp/secTutorial.tw new file mode 100644 index 0000000000000000000000000000000000000000..3de375bcd8f1b702a02dad2ebc48fe56bf669373 --- /dev/null +++ b/src/SecExp/secTutorial.tw @@ -0,0 +1 @@ +:: secTutorial [nobr] \ No newline at end of file diff --git a/src/SecExp/widgets/unitsDescriptionWidgets.tw b/src/SecExp/widgets/unitsDescriptionWidgets.tw index 91df19b0a01854fdf030fb40a1fe994f8c4e397e..c2494f374806631440280536a025a151f1042c6e 100644 --- a/src/SecExp/widgets/unitsDescriptionWidgets.tw +++ b/src/SecExp/widgets/unitsDescriptionWidgets.tw @@ -1,13 +1,17 @@ :: unitsDescriptionWidgets [widget nobr] <<widget "militiaUnitsDescription">> - + militia <</widget>> <<widget "slaveUnitsDescription">> - + slaves <</widget>> <<widget "mercUnitsDescription">> - -<</widget>>:: unitsDescriptionWidget [widget nobr] \ No newline at end of file + mercs +<</widget>> + +<<widget "secBotsDescription">> + bots +<</widget>> \ No newline at end of file diff --git a/src/uncategorized/manageArcology.tw b/src/uncategorized/manageArcology.tw index f9b5c69b31b2e1a14e3ac79929839247f65e5385..5a045e48c74d0a5473463a4628b4ad2c4c320285 100644 --- a/src/uncategorized/manageArcology.tw +++ b/src/uncategorized/manageArcology.tw @@ -35,7 +35,15 @@ __Construction__ <br> <<if $arcologyUpgrade.drones != 1>> - //The first major upgrade needed is the installation of a drone security system so higher-class citizens will feel safe and protected should they choose to immigrate. This upgrade will cost ¤<<print Math.trunc(5000*$upgradeMultiplierArcology)>>.// [[Install drone security system|Manage Arcology][$cash -= Math.trunc(5000*$upgradeMultiplierArcology), $arcologyUpgrade.drones = 1]] + //The first major upgrade needed is the installation of a drone security system so higher-class citizens will feel safe and protected should they choose to immigrate. This upgrade will cost ¤<<print Math.trunc(5000*$upgradeMultiplierArcology)>>.// + <<link "Install drone security system">> + <<set $cash -= Math.trunc(5000*$upgradeMultiplierArcology)>> + <<set $arcologyUpgrade.drones = 1>> + <<set $secBots.active = 1>> + <<set $secBots.troops = 30>> + <<set $secBots.maxTroops = 30>> + <<goto "Manage Arcology">> + <</link>> <<elseif $arcologyUpgrade.hydro != 1>> //The next major upgrade needed is the installation of a better water reclamation system so your residents will have access to cheaper water and hydroponically grown food. This upgrade will cost ¤<<print Math.trunc(10000*$upgradeMultiplierArcology)>>.// [[Upgrade water reclamation system|Manage Arcology][$cash -= Math.trunc(10000*$upgradeMultiplierArcology), $arcologyUpgrade.hydro = 1]] <<elseif $arcologyUpgrade.apron != 1>>