:: 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>>

<<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 to 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 unknwon 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 responsibles 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 knwon anti-slavery group was caught trying to infiltrate the arcology. During the capture attempt shots were fired and several guards were injured, unfortunately the fugitive managed in th end 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. She explained her action as "trying to defend herself from a dangerous machine". Reports confirmed that the apparatus is indeed quite deadly, having killed several slave since it was installed, but the expert way she 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 she was stabbed repeatedly with a sharp object. She was fairly famous for her capabilities as a slave trainer, her old master spent not an insignificant amount of money trying to find her once he realized she was missing. The episode might have been a simple mugging gone wrong, but her activities as a slave breaker might have played a role in her 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 responsibles 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 assaultes 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 him or if he 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 repreated 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 manufactoring plants and barricated 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 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 attept was barely stopped before becoming a catastrophy. Many citizens were trampled by their terrorized peers of 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>>
	random citizen mini event, low tension
	<<set $tension += random(1,5)>>
<<case 5>>
	random citizen mini event, med tension
	<<set $tension += random(5,10)>>
<<case 6>>
	random citizen mini event, high tension
	<<set $tension += random(10,15)>>
<</switch>>

<<set $tension = Math.clamp($tension,0,100)>>