:: rebellionEvents [nobr]

<<if $slaveRebellionEventFires == 1>>
	<<if $tension <= 33>>
		<<set _event = 1>>
	<<elseif $tension <= 66>>
		<<set _event = 2>>
	<<else>>
		<<set _event = 3>>
	<</if>>
<<elseif $citizenRebellionEventFires == 1>>
	<<if $tension <= 33>>
		<<set _event = 4>>
	<<elseif $tension <= 66>>
		<<set _event = 5>>
	<<else>>
		<<set _event = 6>>
	<</if>>
<</if>>

<<setNonlocalPronouns $seeDicks>>
<<switch _event>>
<<case 1>>
	/* low tension slave rebellion events */
	<<set _rand = random(0,6)>>
	<<if _rand == 0>>
		This week several slaves were found plotting the death of their master. They were quickly dealt with, but their owner's choice of punishment did little to calm tensions in the arcology.
	<<elseif _rand == 1>>
		This week a large group of slaves attempted to escape. Several were recaptured, but others were deemed too dangerous and were shot on sight. The unfortunate circumstances raised the disapproval of many citizens, either because of the waste of good slaves or the brutality with which the operation was carried. With a bit of luck, however, the incident will be soon forgotten.
	<<elseif _rand == 2>>
		This week books of unknown origin and dangerous content were found in the possession of several slaves. They were mostly sociopolitical treaties, making it clear that the intent of the ones responsible was to fan the fire of rebellion. The books were quickly collected and archived, hopefully this affair will not have lasting consequences.
	<<elseif _rand == 3>>
		This week a citizen was caught giving refuge to an escaped slave. He was not able to pay for the value of the stolen goods, so he was processed as the case required and the slave returned to their rightful master. Many questions however remain without answers.
	<<elseif _rand == 4>>
		This week a member of a well known anti-slavery group was caught trying to infiltrate the arcology. During the capture attempt shots were fired and several guards were injured, and in the end the fugitive unfortunately managed to escape. Reports indicate several slaves helped the criminal, some going as far as using themselves as shields against the bullets of the security drones.
	<<elseif _rand == 5>>
		This week a slave was caught attempting to sabotage a machine in one of the factories. _HeU explained _hisU action as "trying to defend _himselfU from a dangerous machine". Reports confirmed that the apparatus is indeed quite deadly, having killed several slaves since it was installed, but the expert way _heU handled the sabotage leaves open the possibility of a deliberate plan or even external help.
	<<else>>
		This week a slave was found dead in one of the sewer tunnels. It seems _heU was stabbed repeatedly with a sharp object. _HeU was fairly famous for _hisU capabilities as a slave trainer; _hisU old master spent not an insignificant amount of money trying to find _himU once he realized _heU was missing. The episode might have been a simple mugging gone wrong, but _hisU activities as a slave breaker might have played a role in _hisU homicide.
	<</if>>
	<<set $tension += random(1,5)>>
<<case 2>>
	/* med tension slave rebellion events */
	<<set _rand = random(0,5)>>
	<<if _rand == 0>>
		This week some strange reports came in: it seems some assemblies of slaves were observed several nights in a row. The slaves were traced and their masters notified, but many suspect there may be something deeper than a few slaves congregating in the night.
	<<elseif _rand == 1>>
		This week an underground railroad was discovered. The rebels did not go down without a fight, but in the end <<if $mercenaries >= 1>>your mercenaries<<else>>your security drones<</if>> managed to destroy the old tunnels they were using to ship out slaves out of the arcology.
	<<elseif _rand == 2>>
		This week a famous citizen was assaulted and brutally murdered by his slaves. The ones responsible were apprehended and dealt with easily enough, but the mere fact something like this could have happened is concerning. Those slaves had to be aware of their certain doom.
	<<elseif _rand == 3>>
		This week a group of slavers entering the arcology was assaulted. Many reported heavy injuries, but fortunately there were no casualties. The attackers were disguised, but the security systems already identified several slaves who were likely part of the group, based on camera feeds.
	<<elseif _rand == 4>>
		This week the waterways were found infected by a virulent pathogen. The cause was later found to be a diseased slave that died while in the maintenance tunnels. It's not clear if the slave was there because of orders given to _himU or if _heU was trying to escape.
	<<else>>
		This week a sleeper cell of a famous anti slavery organization was discovered in the low levels of the arcology. The group, however, was aware of the coming security forces and retreated before they could be dealt with.
	<</if>>
	<<set $tension += random(5,10)>>
<<case 3>>
	/* high tension slave rebellion events */
	<<set _rand = random(0,4)>>
	<<if _rand == 0>>
		This week a group of slaves took control of one of the manufacturing plants and barricaded themselves inside. It took several days of negotiations and skirmishes to finally end this little insurrection. Many of the slaves involved will be executed in the next few days.
	<<elseif _rand == 1>>
		This week a number of shops were burned to the ground by rioting slaves and sympathetic citizens. It took considerable effort for the security forces to take control of the situation. Harsh punishment is required and scheduled for the instigators.
	<<elseif _rand == 2>>
		This week a mass escape attempt was barely stopped before becoming a catastrophe. Many citizens were trampled by the desperate horde of slaves. It will take some time to restore the streets involved to working order.
	<<elseif _rand == 3>>
		This week a number of riots inflamed the arcology. Many slaves took violent actions against citizens and security personnel. The number of victims keeps getting higher as still now the last sparks of revolt are still active.
	<</if>>
	<<set $tension += random(10,15)>>
<<case 4>>
	<<set _rand = random(0,6)>>
	<<if _rand == 0>>
		This week a citizen refused to pay rent, claiming ideological opposition to the arcology's ownership policies. He was quickly dealt with, but his words might not have fallen silent yet.
	<<elseif _rand == 1>>
		This week books of unknown origin and dangerous content were found in the possession of several citizens. They were mostly sociopolitical treaties, making it clear that the intent of the ones responsible was to fan the fire of rebellion. Most of them were bought and archived, but a few are still circling amongst the citizens of the arcology.
	<<elseif _rand == 2>>
		This week a citizen was caught giving refuge to other citizens, who would be liable to be enslaved because of their debts. The situation was quickly resolved, but the misplaced generosity of that citizen might have inflamed a few souls.
	<<elseif _rand == 3>>
		This week a citizen died in one of the factories. His death sparked some outrage, even some talk of protests against the owners of the factory, but things seem to have calmed down for now.
	<<elseif _rand == 4>>
		This week a citizen refused to be evicted from his house. After some negotiations the man was forcibly removed from the property by your security forces. Unfortunately the forced entry caused some damage to the building.
	<<elseif _rand == 5>>
		This week a citizen refused to be enslaved as his contract established. With an impressive display of his rhetoric capabilities he managed to gather a small crowd agreeing with his position. The impromptu assembly was promptly disrupted by the drones.
	<<else>>
		This week a security drone was found disabled and stripped of important electronic components. It seems the act was not dictated by greed, as the most precious parts of the drone were left on the machine, but rather to cover up something that the drone saw.
	<</if>>
	<<set $tension += random(1,5)>>
<<case 5>>
	<<set _rand = random(0,5)>>
	<<if _rand == 0>>
		This week a factory was subject to a strike by a group of citizens protesting against the owner. They were promptly arrested and the factory returned to its rightful proprietor by your security department.
	<<elseif _rand == 1>>
		This week a group of citizens organized a protest against the systemic enslavement of the citizens of the arcology. Their little parade gathered a surprisingly large crowd, but it was nonetheless quickly suppressed by your forces.
	<<elseif _rand == 2>>
		This week the security department registered the formation of several assemblies of citizens, whose purpose seems to be political in nature. For now no further steps were taken, but it's a worrying sign of further political opposition within the arcology.
	<<elseif _rand == 3>>
		This week there was a protest against one of the wealthiest citizen of the arcology. Many criticize his near monopoly. Supporters of the citizen met the protesters on the streets and it was just thanks to the intervention of the security drones that violence was avoided.
	<<elseif _rand == 4>>
		This week several cameras were sabotaged and in many cases damaged beyond repair. A group of anonymous citizens claims to be responsible; their motivation is apparently the excessive surveillance in the arcology and their attack a response to the breach of their privacy.
	<<else>>
		This week several citizens barricaded themselves in a private brothel. It seems their intention is to protest against the use of ex-citizens in the sex trade, claiming that such a position is unfitting for them. The problem was quickly resolved with the intervention of the security department.
	<</if>>
	<<set $tension += random(5,10)>>
<<case 6>>
	<<set _rand = random(0,4)>>
	<<if _rand == 0>>
		This week the arcology was shaken by a number of strikes throughout the manufacturing levels. Many lament the predatory nature of Free Cities society, many other just want to cause damage to their perceived oppressors. It was a significant effort for the security department to stop all protests.
	<<elseif _rand == 1>>
		This week several factories were set aflame by their workers. The security department worked day and night to control the fire and apprehend the criminals behind the act. Many are known dissidents, but there are a fair few new faces within them. This is a worrying sign.
	<<elseif _rand == 2>>
		This week numerous riots exploded all over the arcology. Many citizens took to the streets to protest against the arcology owner and its supporters. The security forces slowly managed to stop the rioters, with no small amount of trouble and only through generous use of violence.
	<<elseif _rand == 3>>
		This week a massive protest of citizens and slaves gathered just outside the penthouse. The crowd was dispersed only after several hours. There were several victims from both sides and no shortage of injured.
	<</if>>
	<<set $tension += random(10,15)>>
<</switch>>

<<set $tension = Math.clamp($tension,0,100)>>
src/Mods/SecExp/rebellionEvents.tw