:: P rivalry victory [nobr]

<<set $nextButton = " ", $nextLink = "Random Nonindividual Event", $rivalOwner = 0, $rivalryPower = 0>> /* hide button until user makes a selection */
<<set $rivalRace = 0>>
<<if $rivalGender == 2>>
	<<set _heR = "he">>
	<<set _hisR = "his">>
	<<set _HeR = capFirstChar(_heR)>>
	<<set _HisR = capFirstChar(_hisR)>>
<<else>>
	<<set _heR = "she">>
	<<set _hisR = "her">>
	<<set _HeR = capFirstChar(_heR)>>
	<<set _HisR = capFirstChar(_hisR)>>
<</if>>


For the first time, you receive a direct call from your rival. You pictured the moment as feeling grander than this, sitting at your desk as usual looking into _hisR downcast face. You're the victor in a new form of warfare in which bankruptcy has replaced surrender. If the world survives in its present state, you may one day be remembered as an innovator in the evolution of (nearly) bloodless war. Today, your reputation has @@.green;greatly improved.@@ But today all you have that's tangible is a view of a still-dignified arcology owner, self-possessed despite the situation.

<br><br>

"For what it's worth," _heR says without preamble, "I had nothing against you. The Daughters wouldn't accept a straight buy-off. Their leadership needed a target to attack, or the rank and file would have killed them themselves and gone ahead attacking me. I had to give them an alternative, or it would have been me." _HeR looks nervous for the first time. "So, what do we do now? I've still got enough resources to make the end of this story a messy one for you. Let me go, and I won't. I'll walk away, and I'll sign everything I've got left over to you.<<if $hostageAnnounced == 1>> Including $hostage.slaveName, of course.<</if>>"

<br><br>

<span id="result">
<<link "Accept">>
	<<set $nextButton = "Continue">><<UpdateNextButton>> /* unlock Continue button */
	<<replace "#result">>
	You accept, magnanimous in victory. "I don't think I would have done that," your rival replies. "Thank you. When they write the book, I'll make sure you look good."
	<<if $rivalSet != 0>>
		_HisR remaining liquid assets will go to satisfy _hisR great debts, but _hisR @@.yellowgreen;arcology holdings are yours.@@
		<<for _prv = 0; _prv < $arcologies.length; _prv++>>
			<<if $arcologies[_prv].rival == 1>>
				<<set $arcologies[_prv].embargo = 0>>
				<<set $arcologies[_prv].embargoTarget = -1>>
				<<set $arcologies[_prv].influenceTarget = -1>>
				<<set $arcologies[_prv].rival = 0>>
				<<set $arcologies[_prv].government = "direct democracy">>
				<<set $arcologies[_prv].PCminority += $arcologies[_prv].ownership>>
				<<set $arcologies[_prv].PCminority = Math.clamp($arcologies[_prv].PCminority, 0, 49)>>
				<<break>>
			<</if>>
		<</for>>
		<<if $hostageAnnounced == 1>><<set $hostageRescued = 1>><</if>>
	<<else>>
		_HisR arcology will go to satisfy _hisR great debts, but you will still profit @@.yellowgreen;immensely@@ from your victory<<if $hostageAnnounced == 1>>, and acquire $hostage.slaveName as a slave<</if>>.
		<<run cashX(random(100000,250000), "war")>>
	<</if>>
	<</replace>>
<</link>>
<br><<link "Refuse">>
	<<set $nextButton = "Continue">><<UpdateNextButton>> /* unlock Continue button */
	<<replace "#result">>
	You coldly decline. "That was a mistake," your rival replies, entering a computer command.
	<<if $rivalSet != 0>>
		"All my remaining liquid assets have just been @@.red;carefully dispersed to deny you control of my arcology.@@ You'll get nothing from me." It's true. The financial self-destruction ensures that the fiscal wreckage goes to the arcology's citizens, not you.
		<<for _prv = 0; _prv < $arcologies.length; _prv++>>
			<<if $arcologies[_prv].rival == 1>>
				<<set $arcologies[_prv].embargo = 0>>
				<<set $arcologies[_prv].embargoTarget = -1>>
				<<set $arcologies[_prv].influenceTarget = -1>>
				<<set $arcologies[_prv].rival = 0>>
				<<set $arcologies[_prv].government = "direct democracy">>
				<<break>>
			<</if>>
		<</for>>
		<<if $hostageAnnounced == 1>>
			<br><br>
			<span id="result2">
			<br><<link "Place a bounty of <<print cashFormat(10000)>> on your rival's psychological warfare tool">>
				<<replace "#result2">>
				<<run cashX(-10000, "war")>>
				<<setLocalPronouns $hostage>>
				You make sure to post a bounty sufficient to ensure that $hostage.slaveName, your rival's psychological warfare tool, does not escape or go unrescued, depending on one's point of view. $He is quickly picked out of the chaos of your rival's escape and delivered to you.
				<<set $hostageRescued = 1>>
				<</replace>>
			<</link>>
			</span>
		<</if>>
	<<else>>
		"All my remaining liquid assets have just been @@.red;expended in an attack on the value of your holdings,@@ and my arcology has been heavily sabotaged. You'll get nothing from me." It's not entirely true, but the damage to your holdings does outweigh your gains by a significant margin. Your rival vanishes back into the old world.
		<<run cashX(random(-10000,-25000), "war")>>
	<</if>>
	<</replace>>
<</link>>
<<if $rivalryDuration >= 30 && $hostageAnnounced == 0 && $rivalSet != 0>>
	<br><<link "Refuse, and place a bounty of <<print cashFormat(50000)>> on your rival's death">>
		<<set $nextButton = "Continue">><<UpdateNextButton>> /* unlock Continue button */
		<<replace "#result">>
		You coldly decline. "That was a mistake," your rival replies, entering a computer command. "All my remaining liquid assets have just been @@.red;expended in an attack on the value of your holdings,@@ and my arcology has been heavily sabotaged. You'll get nothing from me." It's not entirely true, but the damage to your holdings does outweigh your gains by a significant margin. Your rival vanishes back into the old world — but only for a few days.
		<br><br>
		Your bounty is quickly claimed, and you are treated to the delicious moment of finding your rival's head delivered to your doorstep. It might not have done much good, but damn did it feel good.
		<<run cashX(-50000, "war")>>
		<<for _prv = 0; _prv < $arcologies.length; _prv++>>
			<<if $arcologies[_prv].rival == 1>>
				<<set $arcologies[_prv].embargo = 0>>
				<<set $arcologies[_prv].embargoTarget = -1>>
				<<set $arcologies[_prv].influenceTarget = -1>>
				<<set $arcologies[_prv].rival = 0>>
				<<set $arcologies[_prv].government = "direct democracy">>
				<<break>>
			<</if>>
		<</for>>
		<</replace>>
	<</link>>
<</if>>
<br><<link "Refuse, and place a bounty of <<print cashFormat(50000)>> on your rival's enslavement">>
	<<set $nextButton = "Continue">><<UpdateNextButton>> /* unlock Continue button */
	<<replace "#result">>
	You coldly decline. "That was a mistake," your rival replies, entering a computer command.
	<<if $rivalSet != 0>>
		"All my remaining liquid assets have just been @@.red;carefully dispersed to deny you control of my arcology.@@ You'll get nothing from me." It's true. The financial self-destruction ensures that the fiscal wreckage goes to the arcology's citizens, not you.
		<<for _prv = 0; _prv < $arcologies.length; _prv++>>
			<<if $arcologies[_prv].rival == 1>>
				<<set $arcologies[_prv].embargo = 0>>
				<<set $arcologies[_prv].embargoTarget = -1>>
				<<set $arcologies[_prv].influenceTarget = -1>>
				<<set $arcologies[_prv].rival = 0>>
				<<set $arcologies[_prv].government = "direct democracy">>
				<<if $arcologies[_prv].FSSupremacist > 20>>
					<<set $rivalRace = $arcologies[_prv].FSSupremacistRace>>
				<<elseif $arcologies[_prv].FSSubjugationist > 20>>
					<<set $rivalRace = setup.filterRacesLowercase.filter(race => race !== $arcologies[_prv].FSSubjugationistRace)>>
				<</if>>
				<<break>>
			<</if>>
		<</for>>
		<<if $hostageAnnounced == 1>>
			<br><br>
			<span id="result2">
			<br><<link "Place a bounty of <<print cashFormat(10000)>> on your rival's psychological warfare tool">>
				<<replace "#result2">>
				<<run cashX(-10000, "war")>>
				<<setLocalPronouns $hostage>>
				You make sure to post a bounty sufficient to ensure that $hostage.slaveName, your rival's psychological warfare tool, does not escape or go unrescued, depending on one's point of view. $He is quickly picked out of the chaos of your rival's escape and delivered to you.
				<<set $hostageRescued = 1>>
				<</replace>>
			<</link>>
			</span>
		<</if>>
	<<else>>
		"All my remaining liquid assets have just been @@.red;expended in an attack on the value of your holdings,@@ and my arcology has been heavily sabotaged. You'll get nothing from me." It's not entirely true, but the damage to your holdings does outweigh your gains by a significant margin.
		<<run cashX(random(-10000,-25000), "war")>>
	<</if>>
	<<run cashX(-50000, "war")>>
	<<include "P rivalry capture">>
	<</replace>>
<</link>>
</span>

src/uncategorized/pRivalryVictory.tw