:: P invasion [nobr]

<<set $nextButton = "Continue", $nextLink = "Random Nonindividual Event">>

<<set $invasionVictory = 1, $peacekeepers = 0>>
<<setAssistantPronouns>>

The day that wasn't supposed to come is here. The troubled little country next door is falling apart. Last month, its stock market collapsed. Last week, its government fell. Yesterday, there was open looting in its cities. And today, a faction of disaffected citizens that blames the Free Cities for siphoning off business and causing the collapse seized weapons from unguarded army depots<<if ($terrain == "marine") || ($terrain == "oceanic")>>, armed merchant ships and private vessels, and are approaching the Free City over the water<<else>> and advanced towards your home<</if>>.

<br><br>

Sirens are blaring; there is a crump far above as $arcologies[0].name's defensive systems knock down one of the first mortar rounds fired into the Free City. The lights in your office changed to a harsh emergency scheme as soon as the attack became a certainty.
<<if $assistant.personality == 0>>
	Your personal assistant offers terse reports on the efficiency of the point defense fire.
<<else>>
	You get a report on the artillery battle from $assistant.name, whose avatar is showing off _hisA prowess at point defense.
	<<switch $assistant.appearance>>
	<<case "monstergirl">>
		_HisA tentacle hair is spread out and forward, forming a concave shape around _hisA face, and _heA's firing beams from _hisA eyes
	<<case "shemale">>
		_HeA's using both hands to aim _hisA massive erection, and is firing blasts of cum
	<<case "amazon">>
		_HeA's holding a hide shield and a club, which _heA's using to swat
	<<case "businesswoman">>
		_HeA looks as immaculate as ever. The stern little business<<= _womanA>> is cradling an expensive fowling piece, which _heA's using to fire
	<<case "fairy">>
		_HeA zips around in the air, getting in close to fire a barrage of little balls of light
	<<case "pregnant fairy">>
		Striking a match almost half as long as _heA is, _heA happily skips along a line of fireworks and lights them as _heA goes. One by one they blast off and fly into the sky
	<<case "goddess">>
		_HisA expression is one of affronted maternal protectiveness, and _heA's using outstretched hands to project beams of pure light
	<<case "hypergoddess">>
		_HisA expression is one of affronted maternal protectiveness, and _heA's using outstretched hands to project beams of pure light
	<<case "loli">>
		_HeA's wearing an annoyed expression and is pretending to shoot _hisA fingers
	<<case "preggololi">>
		_HeA's wearing a tired expression and is pretending to shoot _hisA fingers
	<<case "schoolgirl">>
		_HeA's wearing a fierce expression and holding a baseball bat, using it to swat
	<<case "angel">>
		_HeA has _hisA wings spread to safeguard your arcology and firing beams of holy light
	<<case "cherub">>
		_HeA is darting around, firing beams of holy light
	<<case "incubus">>
		_HeA is carefully aiming _hisA cumshots
	<<case "succubus">>
		_HeA is flying around, using _hisA rear to catch depictions of projectiles and moaning lewdly with each hit.
	<<case "imp">>
		_HeA is darting around, throwing balls of darkness
	<<case "witch">>
		_HeA is using a broom to swat
	<<case "ERROR_1606_APPEARANCE_FILE_CORRUPT">>
		_HeA has split into countless fleshy tendrils and is rapidly swinging
	<<default>>
		The symbol radiates readouts of ammunition, power, and targeting, clean lines flashing
	<</switch>>
	<<if $assistant.appearance != "succubus">>at depictions of projectiles.<</if>>
<</if>>
It's going well. Whoever's in command of the attackers sees that their fire is having no effect, and orders an advance. The mortars and other artillery systems maintain their fire, trying to occupy as many guns as possible.

<br><br>

The loose militia lately organized by the arcology owners has been called out to defend the city. Its commander, seeing that the attackers have more passion than tactical skill, orders an immediate counterattack by anyone able<<if ($terrain == "marine") || ($terrain == "oceanic")>> to push the invaders landing in the dock areas back into the sea<</if>>. Technology has advanced to the point that rich militiamen who buy their own gear can form a powerful fighting force. With luck, the counterattack should shatter the enemy.

<br><br>

<<if $personalArms == 0>>Since you are not well armed or armored, you stay back and oversee the defense of your own arcology.<<elseif $personalArms == 1>>Since you are well armed and armored, you take part in the counterattack. Your exoskeleton mounts a smart mortar system that independently targets and eliminates enemy groups even as you lay down fire from the guns mounted on your forearms.<<else>>Since you are well armed and armored and your drones are combat ready, you take part in the counterattack. You are preceded into combat by a wedge of your drones, which lack the intelligence to take good cover but are remorseless and highly accurate. Your exoskeleton mounts a smart mortar system that independently targets and eliminates enemy groups even as you lay down fire from the guns mounted on your forearms.<</if>>

<br><br>

<<if $mercenaries == 0>>You are alone in contributing to the defense of your home.<<elseif $mercenaries == 1>>Your mercenaries see to the defense of $arcologies[0].name, ensuring that nothing that gets through will do truly serious damage.<<else>>Your mercenaries see to the defense of $arcologies[0].name, ensuring that nothing that gets through will do truly serious damage. There are enough of them that they can even spare a squad to accompany the counterattack. They're mostly old veterans of many bitter brush wars, and they go about the bloody business with the air of men and women who saw their first battlefield long before their hair was shot with grey.<</if>>

<br><br>

<<if $mercenaries + $personalArms < 2>>
	@@.red;The counterattack fails.@@ The enemy is eventually defeated, but only after they get mired in urban combat in the streets of the Free City. @@.red;$arcologies[0].name takes considerable damage from <<if $terrain == "ravine">>cliffside fire<<else>>stray fire<</if>>, and many supplies have been lost or stolen.@@ The repairs will be extremely costly.
	<<if $terrain == "ravine">>
	<<run cashX(forceNeg(Math.trunc($cash*0.8)), "war")>>
	<<run cashX(-50000, "war")>>
	<<else>>
	<<run cashX(forceNeg(Math.trunc($cash*0.9)), "war")>>
	<<run cashX(-10000, "war")>>
	<</if>>
<<elseif $mercenaries + $personalArms < 6>>
	@@.yellow;The counterattack succeeds.@@ @@.red;$arcologies[0].name takes minor damage from stray fire,@@ but the repairs are not too costly. Your participation in the counterattack that saved the Free City was noted, and @@.green;you are acclaimed as a protector of its people.@@
	<<set $invasionVictory = 2>>
	<<run cashX(forceNeg(Math.trunc($cash*0.2)), "war")>>
	<<run cashX(-5000, "war")>>
	<<run repX(5000, "event")>>
<<else>>

@@.green;The counterattack is a crushing success.@@ Your mercenary squad and your drones form an irresistible phalanx around you that smashes everything it touches. The enemy is put to flight, and you send your drones racing ahead to take captives. By law these are shared among the militia. There is talk that your contributions deserve more than a few wretched slaves in reward. A public subscription pays for the damage $arcologies[0].name took from stray fire, and @@.green;you are acclaimed a hero.@@
<<set $invasionVictory = 3>>
<<run repX(10000, "event")>>

<<set _newSlaves = []>>
<<for _i = 0; _i < 3; _i++>>
	<<if (random(0,99) < $seeDicks)>>
		<<set $oneTimeDisableDisability = 1>>
		<<set $activeSlave = GenerateNewSlave("XY")>>
	<<else>>
		<<set $oneTimeDisableDisability = 1>>
		<<set $activeSlave = GenerateNewSlave("XX")>>
	<</if>>
	<<set $activeSlave.origin = "$He is an enslaved prisoner of war.">>
	<<set _newSlaves.push($activeSlave)>>
<</for>>

<<set $menials += 5>>
<<set $desc = "a shot-torn flag of the failed nation whose militants attacked the Free City">>
<<set $trinkets.push($desc)>>

<br><br>
<span id="result">
<<link "Sell your prisoners immediately">>
	<<replace "#result">>
	<<for _i = 0; _i < _newSlaves.length; _i++>>
		<<set _slaveCost = slaveCost(_newSlaves[_i])>>
		<<run cashX(_slaveCost, "slaveTransfer")>>
	<</for>>
	Prisoners sold.
	<</replace>>
<</link>>
<br><<link "Give your prisoners to citizens who displayed bravery during the counterattack">>
	<<replace "#result">>
	<<for _i = 0; _i < _newSlaves.length; _i++>>
		<<set _slaveCost = slaveCost(_newSlaves[_i])>>
		<<run repX(Math.trunc(_slaveCost/2), "event")>>
	<</for>>
	Prisoners @@.green;given away.@@
	<</replace>>
<</link>>
<br><<link "Enslave all of your prisoners">>
	<<replace "#result">>
		<<for _i = 0; _i < _newSlaves.length; _i++>>
			<<run newSlave(_newSlaves[_i])>> /* skip New Slave Intro */
		<</for>>
		You simply enslave all of your prisoners yourself. These slaves will regret attacking your arcology.
	<</replace>>
<</link>>
</span>

<</if>>

src/uncategorized/pInvasion.tw