code:
:: corporate widgets [widget nobr]

/*
Usage:
<<CorporateLedger _ledger $week>>

	_ledger: One of the members of App.Corporate.ledger, such as .current or .old
	$week: The current week or the previous week, depending on whether you used current or old.
*/
<<widget "CorporateLedger">>
<<scope>>
<<set _ledger = $args[0]>>
<<set _week = $args[1]>>

Ledger for <<= asDateString(_week) >> - <<= asDateString(_week + 1, -1) >>

/*Returns last week's revenue, gets calculated in corporationDevelopments, but slaves sold here also added to it for next week*/

Revenue	<<= cashFormatColor(_ledger.revenue)>>

<<if ($cheatMode) && ($cheatModeM) && App.Corporate.foreignRevenue > 0>>

Including Neighbor Bonus	<<= cashFormatColor(_ledger.foreignRevenue)>>

<</if>>
/*Just like revenue, except for operating expenses (all calculated in corporationDevelopments)*/

Operating Expenses	<<= cashFormatColor(_ledger.operations, true)>>

/*buying slaves to work on adds to this expense, works just like revenue*/

Slave Expenses	<<= cashFormatColor(_ledger.slaves, true)>>

/*costs associated with expanding divisions end up here, reports costs from last week, not current*/

Asset Expenses	<<= cashFormatColor(_ledger.development, true)>>

<<if ($cheatMode) && ($cheatModeM)>>

		Economic <<if _ledger.economicBoost < 0>>Expenses<<else>>Windfall<</if>>
		<<= cashFormatColor(_ledger.economicBoost)>>

<</if>>

Overhead	<<= cashFormatColor(_ledger.overhead, true)>>

Profit

<<= cashFormatColor(_ledger.profit)>>

<<if _ledger.economicBoost > 0>>

	<<if _ledger.economy > 100>>
		* Profits benefited from a strong economy.
	<<elseif _ledger.economy > 60>>
		* Profits were lowered by the weak economy.
	<<else>>
		* Profits were severely depressed by the failing economy.
	<</if>>

<</if>>

Totals

	Liquidity

	<<if ($cheatMode) && ($cheatModeM)>>
		<<= cashFormatColor(App.Corporate.cash)>>
		<<set _TcorpCash = App.Corporate.cash>>
		<<textbox "_TcorpCash" _TcorpCash>>
		<<link "Apply">>
		<<set App.Corporate.cheatCash(_TcorpCash)>>
		<<replace "#corpCash">><<= cashFormatColor(App.Corporate.cash)>><</replace>>
		<</link>>
	<<else>>
		<<= cashFormatColor(App.Corporate.cash)>>
	<</if>>

Corporate Value	<<= cashFormatColor(App.Corporate.value)>>

Dividend for Payout

<<= cashFormatColor(App.Corporate.dividend)>>

Pays out on <<=asDateString($args[1] + App.Corporate.dividendTimer, -1)>>, <<if App.Corporate.dividendTimer == 1>>
	the end of this week
<<else>>
	in <<= App.Corporate.dividendTimer >> weeks
<</if>>

<</scope>>
<</widget>>


code:
:: Corporation Developments [nobr]

/*Main Corporation Pass*/

<<if App.Corporate.cash < 0>>
	<<set App.Corporate.cash = Math.trunc(App.Corporate.cash * 1.02)>> /*2% weekly interest rate on negative cash*/
<</if>>

Corporation Management

Operational Results

/*Divisions doing their thing*/
<<set _weekLedger = App.Corporate.endWeek()>>
/* TODO: I would like to move some of the following loop into a new loop. It should go Process -> Transfer -> Sell -> Buy (most expensive to least) to give the best chance of auto-buy having enough money to make purchases. */
<<for _d range _weekLedger.divisionLedgers>>
	<<set _div = _d.division>>
	/* Reporting on number of slaves being processed or completed processing */

<<= _div.name>>: The division <<= _div.message_endWeek_Slaves(_d) >>.
	<<if _d.market.originalBuy != null>>

		<<if _d.market.buy == 0>>
			It couldn't purchase <<= numberWithPlural(_d.market.originalBuy, "slave") >> to replenish its stock from the market because it couldn't afford to purchase price.
		<<else>>
			It needed to replenish its slave stock of <<= numberWithPlural(_d.market.originalBuy, "slave")>>, but couldn't afford to buy all of them. It bought <<= numberWithPlural(_d.market.buy, _div.nounSlaveFromMarket)>> for <<= cashFormatColor(_d.market.finalPurchase, true) >>.
		<</if>>
	<<elseif _d.market.buy > 0>>

It replenished its slave stock and bought <<= numberWithPlural(_d.market.buy, _div.nounSlaveFromMarket) >> from the market for <<= cashFormatColor(_d.market.finalPurchase, true) >>.
	<</if>>
	<<if _d.transfer.total > 0>>
		<<for _nextDivLedger range _d.transfer.divisions>>
			<<set _nextDiv = _nextDivLedger.division>>
			<<set _slavesToNext = _nextDivLedger.fill>>

			It moved <<= numberWithPlural(_slavesToNext, "slave")>> to the <<= _nextDiv.name>> Division.
		<</for>>
	<</if>>
	<<if _div.toMarket>>
		<<if _div.heldSlaves == 0>>
			<<if _d.market.sell > 0>>
				It immediately sold <<= numberWithPlural(_d.market.sell, _div.nounFinishedSlave) >> to the market and made <<= cashFormatColor(_d.market.finalSale)>>.
			<</if>>
		<<else>>
			It holds @@.green;<<= numberWithPlural(_div.heldSlaves, _div.nounFinishedSlave)>>@@ at the end of the
			<<if _d.market.sell > 0>>
				 week, but it ran out of storage space and had to sell @@.red;<<= numberWithPlural(_d.market.sell, "slave")>>@@ and made <<= cashFormatColor(_d.market.finalSale)>>.
			<<else>>
				 week.
			<</if>>
		<</if>>
	<</if>>
	<<if _d.revenue.value > 0>>
		It earned <<= cashFormatColor(_d.revenue.value)>> in revenue.
	<</if>>
<</for>>

/*Aggregate Corporation Results*/
<<set _ledger = App.Corporate.ledger.current>>/*Note: You can't just pass the object directly into a widget. */
<<CorporateLedger _ledger $week>>

/*Division Expansion Tokens*/
<<if _weekLedger.canExpandNow>>

Your corporation is ready to start an additional division!

<</if>>

/*Specializations tokens*/
<<if _weekLedger.canSpecializeNow>>

Your corporation is ready to specialize its slaves further!

<</if>>

/*Calculating cash set aside for dividend*/

Dividend

<<if App.Corporate.dividendRatio > 0>>
	The corporation is currently reserving <<= Math.floor(App.Corporate.dividendRatio * 100)>>% of its profit to be paid out as dividends.
<<else>>
	The corporation is currently not reserving a portion of its profit to be paid out as dividends.
<</if>>
<<if App.Corporate.payoutCash>>
	It is putting aside unused cash reserves to be paid out as dividends.
<</if>>

<<if App.Corporate.dividend > 0>>
	<<if _weekLedger.hasDividend>>
		It reserved <<print cashFormatColor(_weekLedger.dividend)>> this week.
	<</if>>
	A total of <<print cashFormatColor(App.Corporate.dividend)>> has been put aside for its shareholders.
<</if>>

<<if _weekLedger.hasPayout>>

This week the dividends were paid out, you received <<print cashFormatColor(_weekLedger.payout)>>.

<</if>>

/*Bankrupted the Corporation*/
<<if App.Corporate.value < 0>>
	<<run App.Corporation.Dissolve()>>

@@.red;Your corporation went bankrupt.@@
<</if>>
/*This needs to be at the very end of the financials*/
<<run App.Corporate.ledger.swap()>>

license: mit


code:
:: Manage Corporation [nobr]

<<set $nextButton = "Back", $nextLink = "Main", $showEncyclopedia = 1, $encyclopedia = "The Corporation">>

<<set _sepObj = { 'need': false, text: '|' }>>

<<if !App.Corporate.founded >>

Incorporation

//Please consider that the market price of slaves has quite the impact on the profitability of your corporation.//

//Focus on acquisition when prices are high, exploitation if prices are low. Slave improvement is a safe choice either way.//

//Also note the option for a 8 - 7 share split instead of the vanilla 2 - 1, this makes the initial investment cheaper but leaves you with relatively less shares.//

<<set _divisionsByFoundingCost = App.Corporate.divisionList.concat().sort( function(a,b) { return a.founding.startingPrice - b.founding.startingPrice; })>>
<<set _optionsText = ["to found a slave corporation", "for most options", "for many options", "for some options", "for the final option"]>>

 /*Picking a starting division*/
<<if $vanillaShareSplit == 1>>
	<<set _corpPerShares = 2000>>
	<<set _corpPubShares = 1000>>
<<else>>
	<<set _corpPerShares = 8000>>
	<<set _corpPubShares = 7000>>
<</if>>

<<for _index, _div range _divisionsByFoundingCost>>
	<<set _divCost = App.Corporate.foundingCostToPlayer(_div, _corpPerShares, _corpPubShares)>>
	<<if $cash >= _divCost>>
		<<if _index == 0>>
			You can lay the groundwork for a slave corporation and choose to start out with:
		<</if>>

		<<= "[[" + _div.name + "|Manage Corporation]"
		 +  "[App.Corporate.create( '"+ _div.id + "'"
								+", " + _corpPerShares
								+", " + _corpPubShares
								+")]]">> (<<=cashFormat(_divCost)>>): Focuses on <<= _div.focusDescription >>.

	<<else>>

You lack the funds <<= _optionsText[App.Utils.mapIndexBetweenLists(_index, _divisionsByFoundingCost, _optionsText)] >>. You need at least @@.yellowgreen;<<print cashFormat(_divCost)>>@@
		<<if _index != 0>>
			<<if _index < _divisionsByFoundingCost.length - 1>>
				for the next option and at most @@.yellowgreen;<<print cashFormat(App.Corporate.foundingCostToPlayer(_divisionsByFoundingCost[_divisionsByFoundingCost.length - 1], _corpPerShares, _corpPubShares))>>@@.
			<<else>>
				for it.
			<</if>>
		<</if>>
		<<break>>
	<</if>>
<</for>>

<<if $vanillaShareSplit == 1>>

[[8-7 Share Split|Manage Corporation][$vanillaShareSplit = 0]]
<<else>>

[[2-1 Share Split|Manage Corporation][$vanillaShareSplit = 1]]
<</if>>

<<else>> /*When the corporation exists*/

Corporation Overview

<<if App.Corporate.foundedDate>>

Founded on <<= asDateString(App.Corporate.foundedDate)>>

<</if>>
<<set _ledger = App.Corporate.ledger.old>>/*You can't pass the object directly into the widget. */
<<set _lastWeek = $week - 1>>
<<CorporateLedger _ledger _lastWeek>>

Division Management

<<for _div range App.Corporate.divisionList.filter(x => x.founded)>>

<<= _div.name>> Division

	<<if _div.foundedDate != 0>>

Founded on <<= asDateString(_div.foundedDate)>>

	<</if>>
	This division focuses on <<= _div.focusDescription >>.

<<= _div.messageSlaveCount() >>

	<<set _divMaint = _div.getDisplayMaintenanceCost()>>

It costs @@.red;<<= cashFormat(Math.trunc(_divMaint.cost))>>@@ to run. On average that is @@.red;<<= cashFormat(Math.trunc(_divMaint.perUnit)) >>@@ per slave.

<<= _div.messageSlaveOutput() >>
	<<set _divSentanceStart = ["Currently the division", "It also"]>>

Direct Control

	<<if _div.fromMarket>>

		<<= _divSentanceStart.shift() >> is <<= _div.slaveAction.present >> @@.green;<<= numberWithPlural(_div.activeSlaves, "slave") >>@@.
		<<if _div.activeSlaves < _div.developmentCount>>
			<<set _fillSlaveCount  = _div.availableRoom>>

There is room to <<= _div.slaveAction.future >> <<= numberWithPluralOne(_fillSlaveCount, "more slave")>>.
			<<set _buySlaveArray = [
				{ 'name': 'Buy Slave', 'count':1 },
				{ 'name': 'Buy x10'  , 'count':10}
			]>>
			<<if !_buySlaveArray.some(function(x) { return x.count == _fillSlaveCount })>>
				<<run _buySlaveArray.push({ 'name': 'Fill'  , 'count':_fillSlaveCount})>>
			<</if>>
			<<set _singleSlaveCost = App.Corporate.slaveMarketPurchaseValue(_div, 1)>>
			<<if $corpCash > _singleSlaveCost>>

				The corporation can purchase slaves directly from the market for about <<=cashFormatColor(_singleSlaveCost)>>

				<<set _sepObj.need = false>>
				<<for  _slaveNum range _buySlaveArray.filter(num => _div.availableRoom > num.count)>>
					<<set _slaveSetCost = App.Corporate.slaveMarketPurchaseValue(_div, _slaveNum.count)>>
					<<if $corpCash < _slaveSetCost>>
						<<continue>>
					<</if>>
					<<= Seperator(_sepObj) >>
					<<= "[[" + _slaveNum.name + "|Manage Corporation]"
					  + "[App.Corporate.buySlaves('"+_div.id+"', "+_slaveNum.count+")]"
					  + "]">>
				<</for>>

			<<else>>

//The corporation cannot afford to purchase any slaves from the market.// It requires about @@.yellowgreen;<<= cashFormat(_singleSlaveCost)>>@@ to buy a <<= asSingular(_div.slaveAction.market)>>.

			<</if>>
		<<else>>

There is //no room// to <<= _div.slaveAction.future>> more slaves.
		<</if>>

	<</if>>
	<<if _div.toMarket>>
		<<set _finishedSlaveNoun = _div.nounFinishedSlave>>
		<<if _div.heldSlaves > 0>>

			<<= _divSentanceStart.shift() >> holds @@.green;<<= numberWithPlural(_div.heldSlaves, _finishedSlaveNoun) >>@@.
			<<for _nextDiv range _div.relatedDivisions
									 .to
									 .filter(div => div.availableRoom > 0
												 && !App.Corporate.ownsIntermediaryDivision(_div, div))>>

				The <<= _nextDiv.name >> Division can accept up to @@.green;<<= numberWithPlural(_nextDiv.availableRoom, "slave") >>@@.

				<<set _sendSlaveArray = [
					{'name': 'Send Slave', 'count':1  },
					{'name': 'Send x10'   , 'count':10 }
				]>>
				<<if _div.heldSlaves >= _nextDiv.availableRoom>>
					<<run _sendSlaveArray.push({'name':`Fill  ${_nextDiv.name} Division`, 'count':_nextDiv.availableRoom})>>
				<<else>>
					<<run _sendSlaveArray.push({'name':'Send All', 'count':_div.heldSlaves})>>
				<</if>>
				<<set _sepObj.need = false>>
				<<for _index, _slaveNum range _sendSlaveArray.filter(slaveNum => slaveNum.count <= _nextDiv.availableRoom && slaveNum.count <= _div.heldSlaves)>>
					<<= Seperator(_sepObj)>>
					<<= "[[" + _slaveNum.name + "|Manage Corporation]"
					  + "[App.Corporate.transferSlaves('"+_div.id+"', '"+_nextDiv.id+"', "+_slaveNum.count+")"
					  + "]]">>
				<</for>>

			<</for>>

The corporation can sell these slaves to the market.

			<<set _sellSlaveArray = [
				{'name':'Sell Slave', 'count':1   },
				{'name':'Sell x10'  , 'count':10  },
				{'name':'Sell x100' , 'count':100 },
				{'name':'Sell All'  , 'count':_div.heldSlaves }
			]>>

			<<set _sepObj.need = false>>
			<<for _index, _slaveNum range _sellSlaveArray.filter(slaveNum => _div.heldSlaves >= slaveNum.count)>>
				<<= Seperator(_sepObj)>>
				<<= "[[" + _slaveNum.name + "|Manage Corporation]"
				  + "[App.Corporate.sellSlaves('"+_div.id+"',"+_slaveNum.count+")]"
				  + "]">>
			<</for>>

		<<else>>

The division is not holding any <<= asPlural(_finishedSlaveNoun)>>.

		<</if>>
	<</if>>

	/* Expanding the division*/
	<<set _depExpandCost = _div.sizeCost * 1000>>

Expanding the division costs <<print cashFormat(_depExpandCost)>>. Downsizing recoups 80% of the investment; slaves will be sold at the going rate.

	<<set _buyDevArray = [
				{ 'name': 'Expand Division' , 'count':1},
				{ 'name': 'Expand x10', 'count':10}
			]>>
	<<set _sepObj.need = false>>
	<<for _buySet range _buyDevArray.filter(buySet => App.Corporate.cash >= buySet.count * _depExpandCost)>>
		<<= Seperator(_sepObj) >>
		<<= "[["+_buySet.name+"|Manage Corporation]"
		  + "[App.Corporate.buyDevelopment('" + _div.id + "', " + _buySet.count + ")]"
		  + "]">>
	<</for>>

	/* Downsize the division*/
	<<set _depDownsizeCost = _depExpandCost * 0.8>>
	<<set _sellDevArray = [
				{ 'name': 'Downsize Division', 'count':1 },
				{ 'name': 'Downsize x10'	 , 'count':10}
			]>>
	<<for _sellSet range _sellDevArray.filter(divNum => _div.developmentCount > divNum.count)>>
		<<= Seperator(_sepObj) >>
		<<= "[["+_sellSet.name+"|Manage Corporation]"
		  + "[App.Corporate.sellDevelopment('"+_div.id+"', "+_sellSet.count+")]"
		  + "]">>
	<</for>>

Rules

	<<for _nextDiv range _div.relatedDivisions.to.filter(nextDiv => nextDiv.founded && !App.Corporate.ownsIntermediaryDivision(_div, nextDiv))>>
		/* TODO: Originally this had a bit of flavor per nextDep. ie, Surgery said "to undergo surgery"*/

		<<if _div.getAutoSendToDivision(_nextDiv)>>
			Auto send slaves to <<= _nextDiv.name >> Division <<= "[[Stop Auto Send|Manage Corporation][App.Corporate.setAutoSendToDivision('"+_div.id+"', '"+_nextDiv.id+"', false)]]">>
		<<else>>
			Do not send slaves to <<= _nextDiv.name >> Division <<= "[[Auto Send|Manage Corporation][App.Corporate.setAutoSendToDivision('"+_div.id+"', '"+_nextDiv.id+"', true)]]">>
		<</if>>

	<</for>>
	<<if _div.toMarket>>

		<<if _div.getAutoSendToMarket()>>
			Auto sell slaves to the market <<= "[[Stop Auto Sell|Manage Corporation][App.Corporate.setAutoSendToMarket('"+_div.id+"', false)]]" >>
		<<else>>
			Do not sell slaves to the market <<= "[[Auto Sell|Manage Corporation][App.Corporate.setAutoSendToMarket('"+_div.id+"', true)]]" >>
		<</if>>

	<</if>>
	<<if _div.fromMarket>>

		<<if _div.getAutoBuyFromMarket()>>
			Auto buy slaves from the market <<= "[[Stop Auto Buy|Manage Corporation][App.Corporate.setAutoBuyFromMarket('"+ _div.id +"', false)]]" >>
		<<else>>
			Do not buy slaves from the market <<= "[[Auto Buy|Manage Corporation][App.Corporate.setAutoBuyFromMarket('"+ _div.id +"', true)]]" >>
		<</if>>

	<</if>>
	<<if App.Corporate.numDivisions > 1>> /* Cannot dissolve the last division */

Dissolve the division @@.orange;//Think before you click//@@ /* TODO: Add a confirmation button. Probably use replace?*/
		<<= "[[Dissolve|Manage Corporation]"
		  + "[App.Corporate.divisions['" + _div.id + "'].dissolve()]"
		  + "]">>

	<</if>>
<</for>>

<<if App.Corporate.canExpand>> /*is the corporation large enough to expand into another division?*/

Found New Division

The corporation can expand by founding a new division related to its current <<= onlyPlural(App.Corporate.divisionList.filter(div => div.founded).length, "division") >>.

	<<for _div range App.Corporate.divisionList.filter(x => !x.founded && x.relatedDivisions.anyFounded)>>
		<<set _depCost = _div.foundingCost * 1000>>

		<<if App.Corporate.cash >= _depCost>>
			<<= "[[Add " + _div.name + " Division|Manage Corporation]"
			  + "[App.Corporate.divisions['"+_div.id+"'].create(App.Corporate)]]">>
			(@@.yellowgreen;<<print cashFormat(_depCost)>>@@): A division focusing on <<= _div.focusDescription >>.
		<<else>>
			<<=  _div.name >>
			(@@.red;<<print cashFormat(_depCost)>>@@):
			The corporation cannot afford to start a division focusing on <<= _div.focusDescription >>.
		<</if>>

	<</for>>
<</if>>

Financials

Dividend

<<set _dividends = App.Corporate.dividendOptions>>
<<set _index = _dividends.findIndex(element => App.Corporate.dividendRatio >= element ) >>
<<set _dividend = _dividends[_index] >>
<<if _index >= 0>>
	<<set _nextIndex = _index + 1>>
	<<set App.Corporate.dividendRatio = _dividend>>/* Normalize */
	The corporation is currently reserving <<= Math.trunc(_dividend * 100)>>% of its profit to be paid out as dividends.
	<<set _sepObj.need = false>>
	<<if _index > 0>>
		<<= Seperator(_sepObj)>>
		<<= "[[Increase Ratio|Manage Corporation][App.Corporate.dividendRatio = " + _dividends[_index - 1] + "]]">>
	<</if>>
	<<if _nextIndex != _dividends.length>>
		<<= Seperator(_sepObj)>>
		<<= "[[Reduce Ratio|Manage Corporation][App.Corporate.dividendRatio = " + _dividends[_nextIndex] + "]]">>
	<<else>>
		<<= Seperator(_sepObj)>>
		<<= "[[None|Manage Corporation][App.Corporate.dividendRatio = 0]]">>
	<</if>>
<<else>>
	The corporation is currently not reserving a portion of its profit to be paid out as dividends.
	<<= "[[Increase Ratio|Manage Corporation][App.Corporate.dividendRatio = "+_dividends[_dividends.length - 1]+"]]" >>
<</if>>

<<if App.Corporate.payoutCash>>
	The corporation will payout unused cash reserves over @@.yellowgreen;<<print cashFormat(App.Corporate.payoutAfterCash)>>@@ as dividends [[Stop|Manage Corporation][App.Corporate.payoutCash = false]]
<<else>>
	You can direct the corporation to reserve cash over @@.yellowgreen;<<print cashFormat(App.Corporate.payoutAfterCash)>>@@ to be paid out as dividends as well. [[Payout Cash Reserves|Manage Corporation][App.Corporate.payoutCash = true]]
<</if>>

Shares

You own <<print num($personalShares)>> shares while another <<print num($publicShares)>> shares are traded publicly. The going rate on the market for 1000 shares is currently @@.yellowgreen;<<print cashFormat(corpSharePrice())>>.@@

The corporation can buyback 1000 shares for @@.red;<<print cashFormat(corpSharePrice(-1000))>>@@ or issue 1000 shares and net @@.yellowgreen;<<print cashFormat(corpSharePrice(1000))>>.@@ The corporation will prefer to round shares to the nearest 1000 and will issue or buy shares toward that goal first.
<<if $corpCash > corpSharePrice(-1000)>>
	<<if $publicShares <= $personalShares - 2000 && $publicShares > 0>> /*It won't buy back player shares if the corporation is entirely owned by the player*/
		<<set _persExtraShares = $personalShares % 1000 || 1000>>

The corporation can buyback some of your shares.
		<<= "[[Buyback "+ _persExtraShares + "|Manage Corporation][cashX(corpSharePrice(-"+_persExtraShares+"), 'stocksTraded'), $corpCash -= corpSharePrice(-"+_persExtraShares+"), $personalShares -= "+_persExtraShares+"]]">>
	<</if>>
	<<if $publicShares >= 1000>>
		<<set _pubExtraShares = $publicShares % 1000 || 1000>>

The corporation can buyback some of the public shares.
		<<= "[[Buyback "+ _pubExtraShares + "|Manage Corporation][$corpCash -= corpSharePrice(-"+_pubExtraShares+"), $publicShares -= "+_pubExtraShares+"]]">>
	<</if>>
<</if>>

<<set _persLeftoverShares = 1000 - ($personalShares % 1000)>>
<<if $cash > corpSharePrice(_persLeftoverShares)>>

The corporation can issue <<=_persLeftoverShares>> shares to you.
	<<= "[[Issue " + _persLeftoverShares + "|Manage Corporation][cashX(forceNeg(corpSharePrice("+_persLeftoverShares+")), 'stocksTraded'), $corpCash += corpSharePrice("+_persLeftoverShares+"), $personalShares += "+_persLeftoverShares+"]]">>
<</if>>
<<set _pubLeftoverShares = 1000 - ($publicShares % 1000)>>
<<if $publicShares <= $personalShares - 2000>>

The corporation can issue <<=_pubLeftoverShares>> shares onto the stock market.
	<<= "[[Issue " + _pubLeftoverShares + "|Manage Corporation][$corpCash += corpSharePrice("+_pubLeftoverShares+"), $publicShares += "+_pubLeftoverShares+"]]">>
<</if>>
<<if $publicShares <= $personalShares - 3000>>

You can sell some of your shares on the stock market. [[Sell 1000|Manage Corporation][cashX(corpSharePrice(), "stocksTraded"), $personalShares -= 1000, $publicShares += 1000]]
<</if>>
<<if $cash > corpSharePrice() && $publicShares >= 1000>>

You can buy some shares from the stock market [[Buy 1000|Manage Corporation][cashX(forceNeg(corpSharePrice()), "stocksTraded"), $personalShares += 1000, $publicShares -= 1000]]
<</if>>

Stock Split

/* Splitting shares when they're unwieldy */
<<set _splitFeeInitial = 10000>>
<<set _splitFeeValue = _splitFeeInitial - Math.floor((_splitFeeInitial * ($PC.skill.trading / 100.0) / 2.0) / 1000) * 1000>>
<<set _splitStockConstants = App.Corporate.stockSplits >>

	The corporation can perform a stock split to increase the number of stocks while maintaining the same owned value. This requires paying a market fee of @@.red;<<= cashFormat(_splitFeeValue)>>@@ plus a per-share fee depending on the type of split being done.
	<<if _splitFeeValue < _splitFeeInitial>>
		//You negotiated lower fees due to your @@.springgreen;business acumen@@.//
	<</if>>
<<if $corpSpecTimer > 0>>

//The corporation has restructured too recently.//
<</if>>

<<for _stockType range _splitStockConstants>>
	<<set _splitInitial	= _stockType['cost']>>
	<<set _splitValue	  = _splitInitial>>
	<<set _splitDenom	  = _stockType['oldStocks'] || 1>>
	<<set _splitNumerator  = _stockType['newStocks'] || 1>>
	<<set _splitMultiplier = _splitNumerator / _splitDenom>>
	<<set _splitTotal	  = _splitValue * ($publicShares + $personalShares) + _splitFeeValue>>
	<<set _splitWeek	   = _stockType['weeks']>>

<<= _splitNumerator >>-for-<<= _splitDenom>> <<if _splitDenom > _splitNumerator>>inverse<</if>> stock split at @@.red;<<= cashFormat(_splitValue) >>@@ per share.
		Including market fees, this will cost the corporation a total of @@.red;<<= cashFormat(_splitTotal)>>@@,
		leaving the going rate for stock at @@.yellowgreen;<<= cashFormat(Math.floor(corpSharePrice(0, $personalShares * _splitMultiplier, $publicShares * _splitMultiplier))) >>@@ per 1000 shares.
	<<if $corpSpecTimer == 0>>
		<<if $publicShares % _splitDenom != 0 || $personalShares % _splitDenom != 0>>
		//The number of shares cannot be evenly split//
		<<elseif $corpCash > _splitTotal>>
		<<= "[[Split Shares|Manage Corporation][$corpCash -= " + _splitTotal + ", $publicShares *= " + _splitMultiplier + ", $personalShares *= " + _splitMultiplier + ", $corpSpecTimer="+_splitWeek+"]]" >>
		<<else>>
		//The corporation cannot afford the fees.//
		<</if>>
	<</if>>

<</for>>

Slave specialization

<<if $corpSpecToken > 0>> /*Spending tokens on new specializations*/
	<<if $corpSpecToken > 1>>
		Your corporation has $corpSpecToken specializations left.
	<<else>>
		Your corporation has one specialization left.
	<</if>>
	<<if $corpSpecTimer > 0>>
		You have recently changed specializations and the corporation needs <<if $corpSpecTimer > 1>>$corpSpecTimer more weeks<<else>>another week<</if>> before it can comply with another directive.
	<<else>>

Choosing to specialize your corporation uses a specialization. The corporation can be directed to focus on the following:
		<<if $corpSpecRaces.length == 0 && ($corpDivExtra > 0 || $corpDivLegal > 0)>> /*This used to be $captureUpgradeRace, it is a general acquisition specialization*/

Slaves who are not
			<<if $arcologies[0].FSSubjugationistRace != "amerindian" || $arcologies[0].FSSubjugationist == "unset">>[[Amerindian|Manage Corporation][$corpSpecRaces = corpBlacklistRace("amerindian", 1), $corpSpecToken -= 1, $corpSpecTimer = 1]] | <</if>>
			<<if $arcologies[0].FSSubjugationistRace != "asian" || $arcologies[0].FSSubjugationist == "unset">>[[Asian|Manage Corporation][$corpSpecRaces = corpBlacklistRace("asian", 1), $corpSpecToken -= 1, $corpSpecTimer = 1]] | <</if>>
			<<if $arcologies[0].FSSubjugationistRace != "black" || $arcologies[0].FSSubjugationist == "unset">>[[Black|Manage Corporation][$corpSpecRaces = corpBlacklistRace("black", 1), $corpSpecToken -= 1, $corpSpecTimer = 1]] | <</if>>
			<<if $arcologies[0].FSSubjugationistRace != "indo-aryan" || $arcologies[0].FSSubjugationist == "unset">>[[Indo-aryan|Manage Corporation][$corpSpecRaces = corpBlacklistRace("indo-aryan", 1), $corpSpecToken -= 1, $corpSpecTimer = 1]] | <</if>>
			<<if $arcologies[0].FSSubjugationistRace != "latina" || $arcologies[0].FSSubjugationist == "unset">>[[Latina|Manage Corporation][$corpSpecRaces = corpBlacklistRace("latina", 1), $corpSpecToken -= 1, $corpSpecTimer = 1]] | <</if>>
			<<if $arcologies[0].FSSubjugationistRace != "malay" || $arcologies[0].FSSubjugationist == "unset">>[[Malay|Manage Corporation][$corpSpecRaces = corpBlacklistRace("malay", 1), $corpSpecToken -= 1, $corpSpecTimer = 1]] | <</if>>
			<<if $arcologies[0].FSSubjugationistRace != "middle eastern" || $arcologies[0].FSSubjugationist == "unset">>[[Middle Eastern|Manage Corporation][$corpSpecRaces = corpBlacklistRace("middle eastern", 1), $corpSpecToken -= 1, $corpSpecTimer = 1]] | <</if>>
			<<if $arcologies[0].FSSubjugationistRace != "mixed race" || $arcologies[0].FSSubjugationist == "unset">>[[Mixed Race|Manage Corporation][$corpSpecRaces = corpBlacklistRace("mixed race", 1), $corpSpecToken -= 1, $corpSpecTimer = 1]] | <</if>>
			<<if $arcologies[0].FSSubjugationistRace != "pacific islander" || $arcologies[0].FSSubjugationist == "unset">>[[Pacific Islander|Manage Corporation][$corpSpecRaces = corpBlacklistRace("pacific islander", 1), $corpSpecToken -= 1, $corpSpecTimer = 1]] | <</if>>
			<<if $arcologies[0].FSSubjugationistRace != "semitic" || $arcologies[0].FSSubjugationist == "unset">>[[Semitic|Manage Corporation][$corpSpecRaces = corpBlacklistRace("semitic", 1), $corpSpecToken -= 1, $corpSpecTimer = 1]] | <</if>>
			<<if $arcologies[0].FSSubjugationistRace != "southern european" || $arcologies[0].FSSubjugationist == "unset">>[[Southern European|Manage Corporation][$corpSpecRaces = corpBlacklistRace("southern european", 1), $corpSpecToken -= 1, $corpSpecTimer = 1]] | <</if>>
			<<if $arcologies[0].FSSubjugationistRace != "white" || $arcologies[0].FSSubjugationist == "unset">>[[White|Manage Corporation][$corpSpecRaces = corpBlacklistRace("white", 1), $corpSpecToken -= 1, $corpSpecTimer = 1]]<</if>>
			— //additional races can be excluded. 4 races per token.//
			<<if $corpSpecToken >= 3>>

Only slaves who are
				<<if $arcologies[0].FSSupremacistRace != "amerindian" || $arcologies[0].FSSubjugationist == "unset">>[[Amerindian|Manage Corporation][$corpSpecRaces = corpBlacklistRace("amerindian", 0), $corpSpecToken -= 3, $corpSpecTimer = 2]] | <</if>>
				<<if $arcologies[0].FSSupremacistRace != "asian" || $arcologies[0].FSSubjugationist == "unset">>[[Asian|Manage Corporation][$corpSpecRaces = corpBlacklistRace("asian", 0), $corpSpecToken -= 3, $corpSpecTimer = 2]] | <</if>>
				<<if $arcologies[0].FSSupremacistRace != "black" || $arcologies[0].FSSubjugationist == "unset">>[[Black|Manage Corporation][$corpSpecRaces = corpBlacklistRace("black", 0), $corpSpecToken -= 3, $corpSpecTimer = 2]] | <</if>>
				<<if $arcologies[0].FSSupremacistRace != "indo-aryan" || $arcologies[0].FSSubjugationist == "unset">>[[Indo-aryan|Manage Corporation][$corpSpecRaces = corpBlacklistRace("indo-aryan", 0), $corpSpecToken -= 3, $corpSpecTimer = 2]] | <</if>>
				<<if $arcologies[0].FSSupremacistRace != "latina" || $arcologies[0].FSSubjugationist == "unset">>[[Latina|Manage Corporation][$corpSpecRaces = corpBlacklistRace("latina", 0), $corpSpecToken -= 3, $corpSpecTimer = 2]] | <</if>>
				<<if $arcologies[0].FSSupremacistRace != "malay" || $arcologies[0].FSSubjugationist == "unset">>[[Malay|Manage Corporation][$corpSpecRaces = corpBlacklistRace("malay", 0), $corpSpecToken -= 3, $corpSpecTimer = 2]] | <</if>>
				<<if $arcologies[0].FSSupremacistRace != "middle eastern" || $arcologies[0].FSSubjugationist == "unset">>[[Middle Eastern|Manage Corporation][$corpSpecRaces = corpBlacklistRace("middle eastern", 0), $corpSpecToken -= 3, $corpSpecTimer = 2]] | <</if>>
				<<if $arcologies[0].FSSupremacistRace != "mixed race" || $arcologies[0].FSSubjugationist == "unset">>[[Mixed Race|Manage Corporation][$corpSpecRaces = corpBlacklistRace("mixed race", 0), $corpSpecToken -= 3, $corpSpecTimer = 2]] | <</if>>
				<<if $arcologies[0].FSSupremacistRace != "pacific islander" || $arcologies[0].FSSubjugationist == "unset">>[[Pacific Islander|Manage Corporation][$corpSpecRaces = corpBlacklistRace("pacific islander", 0), $corpSpecToken -= 3, $corpSpecTimer = 2]] | <</if>>
				<<if $arcologies[0].FSSupremacistRace != "semitic" || $arcologies[0].FSSubjugationist == "unset">>[[Semitic|Manage Corporation][$corpSpecRaces = corpBlacklistRace("semitic", 0), $corpSpecToken -= 3, $corpSpecTimer = 2]] | <</if>>
				<<if $arcologies[0].FSSupremacistRace != "southern european" || $arcologies[0].FSSubjugationist == "unset">>[[Southern European|Manage Corporation][$corpSpecRaces = corpBlacklistRace("southern european", 0), $corpSpecToken -= 3, $corpSpecTimer = 2]] | <</if>>
				<<if $arcologies[0].FSSupremacistRace != "white" || $arcologies[0].FSSubjugationist == "unset">>[[White|Manage Corporation][$corpSpecRaces = corpBlacklistRace("white", 0), $corpSpecToken -= 3, $corpSpecTimer = 2]]<</if>>
			<<else>>

Only slaves of a particular race requires 3 tokens.
			<</if>>
		<</if>>
		<<if $seeDicks != 0 && ndef $corpSpecGender && ($corpDivExtra > 0 || $corpDivLegal > 0)>> /*This used to be $captureUpgradeGender, it is a general acquisition specialization*/

Train only slaves with [[Pussies|Manage Corporation][$corpSpecGender = 1, $corpSpecToken -= 1, $corpSpecTimer = 2]] | [[Dicks|Manage Corporation][$corpSpecGender = 2, $corpSpecToken -= 1, $corpSpecTimer = 2]]
		<</if>>
		<<if ndef $corpSpecHeight && ($corpDivExtra > 0 || $corpDivLegal > 0)>> /*This is a general acquisition specialization*/

Slaves that are [[Short|Manage Corporation][$corpSpecHeight = 2, $corpSpecToken -= 1, $corpSpecTimer = 2]] | [[Tall|Manage Corporation][$corpSpecHeight = 4, $corpSpecToken -= 1, $corpSpecTimer = 2]] -- //Further specializations possible//
		<</if>>
		<<if ndef $corpSpecVirgin && ($corpDivExtra > 0 || $corpDivLegal > 0)>> /*This is a general acquisition specialization*/

Slaves that are [[Virgins|Manage Corporation][$corpSpecVirgin = 1, $corpSpecToken -= 1, $corpSpecTimer = 2]]
		<</if>>
		<<if ndef $corpSpecIntelligence && $corpDivLegal > 0 >> /*This used to be $entrapmentUpgradeIntelligence, it is a legal enslavement specialization*/

Slaves who are [[Stupid|Manage Corporation][$corpSpecIntelligence = 1, $corpSpecToken -= 1, $corpSpecTimer = 2]] | [[Intelligent|Manage Corporation][$corpSpecIntelligence = 3, $corpSpecToken -= 1, $corpSpecTimer = 2]] --//Further specializations possible//
		<</if>>
		<<if ndef $corpSpecAge && $corpDivExtra > 0>> /*This used to be $captureUpgradeAge, it is the extralegal enslavement specialization*/

Slaves who are [[Younger|Manage Corporation][$corpSpecAge = 1, $corpSpecToken -= 1, $corpSpecTimer = 2]] | [[Older|Manage Corporation][$corpSpecAge = 3, $corpSpecToken -= 1, $corpSpecTimer = 2]]
		<</if>>
		<<if ndef $corpSpecWeight && ($corpDivBreak > 0 || $corpDivSurgery > 0 || $corpDivTrain > 0)>> /*This used to be $generalUpgradeWeight, it is a general improvement specialization*/

Managing slaves' diets to achieve [[Thin Slaves|Manage Corporation][$corpSpecWeight = 2, $corpSpecToken -= 1, $corpSpecTimer = 2]] | [[Fat nor Thin Slaves|Manage Corporation][$corpSpecWeight = 3, $corpSpecToken -= 1, $corpSpecTimer = 2]] | [[Fat Slaves|Manage Corporation][$corpSpecWeight = 5, $corpSpecToken -= 1, $corpSpecTimer = 2]] -- //Further specializations possible//
		<</if>>
		<<if ndef $corpSpecDevotion && ($corpDivBreak > 0 || $corpDivSurgery > 0 || $corpDivTrain > 0)>> /*This used to be $entrapmentUpgradeDevotionOne/Two, it is a general improvement specialization*/

Slaves who are [[Reluctant|Manage Corporation][$corpSpecDevotion = 2, $corpSpecToken -= 1, $corpSpecTimer = 2]] | [[Obedient|Manage Corporation][$corpSpecDevotion = 4, $corpSpecToken -= 1, $corpSpecTimer = 2]] -- //Further specializations possible//
		<</if>>
		<<if ndef $corpSpecAccent && ($corpDivBreak > 0 || $corpDivSurgery > 0 || $corpDivTrain > 0)>> /*This used to be $trainingUpgradeAccent, it is a general improvement specialization*/

Slaves are taught to [[Speak the Language|Manage Corporation][$corpSpecAccent = 1, $corpSpecToken -= 1, $corpSpecTimer = 2]] | [[Speak without Accent|Manage Corporation][$corpSpecAccent = 2, $corpSpecToken -= 1, $corpSpecTimer = 2]]
		<</if>>
		<<if ndef $corpSpecHormones && ($corpDivBreak > 0 || $corpDivSurgery > 0 || $corpDivTrain > 0)>> /*This used to be $drugUpgradeHormones, it is a general improvement specialization*/

Slaves are given hormones to [[Feminize|Manage Corporation][$corpSpecHormones = 1, $corpSpecToken -= 1, $corpSpecTimer = 2]] | [[Masculinize|Manage Corporation][$corpSpecHormones = 2, $corpSpecToken -= 1, $corpSpecTimer = 2]]
		<</if>>
		<<if ndef $corpSpecInjection && ($corpDivBreak > 0 || $corpDivSurgery > 0 || $corpDivTrain > 0)>> /*This used to be $drugUpgradeInjectionOne, it is a general improvement specialization*/

Slave assets are made to be [[Petite|Manage Corporation][$corpSpecInjection = 1, $corpSpecToken -= 1, $corpSpecTimer = 2]] | [[Tasteful|Manage Corporation][$corpSpecInjection = 2, $corpSpecToken -= 1, $corpSpecTimer = 2]] | [[Huge|Manage Corporation][$corpSpecInjection = 3, $corpSpecToken -= 1, $corpSpecTimer = 2]] -- //Further specializations possible//
		<</if>>
		<<if ndef $corpSpecCosmetics && ($corpDivBreak > 0 || $corpDivSurgery > 0 || $corpDivTrain > 0)>> /*This used to be $surgicalUpgradeCosmetics, it is a general improvement specialization*/

Straightforward cosmetic procedures are [[Applied|Manage Corporation][$corpSpecCosmetics = 1, $corpSpecToken -= 1, $corpSpecTimer = 2]] | [[Not Applied|Manage Corporation][$corpSpecCosmetics = 0, $corpSpecTimer = 2]]
		<</if>>
		<<if ndef $corpSpecEducation && $corpDivTrain > 0>> /*This used to be $trainingUpgradeEducation, it is the training specialization*/

Slaves are given [[No Education|Manage Corporation][$corpSpecEducation == 0, $corpSpecToken -= 1, $corpSpecTimer = 2]] | [[Basic Education|Manage Corporation][$corpSpecEducation = 1, $corpSpecToken -= 1, $corpSpecTimer = 2]] -- //Further specializations possible//
		<</if>>
		<<if ndef $corpSpecImplants && $corpDivSurgery > 0>> /*This used to be $surgicalUpgradeImplants, it is the surgery specialization*/

Slave implants are [[Applied|Manage Corporation][$corpSpecImplants = 1, $corpSpecToken -= 1, $corpSpecTimer = 2]] | [[Not Applied|Manage Corporation][$corpSpecImplants = 0, $corpSpecTimer = 2]] -- //Further specializations possible//
		<</if>>
		<<if ndef $corpSpecGenitalia && $corpDivSurgeryDev > 100>> /*This used to be $surgicalUpgradeGenitalia, it is the surgery specialization*/

Slaves get their genitalia reconfigured [[Add Pussy|Manage Corporation][$corpSpecPussy = 1, $corpSpecGenitalia = 1, $corpSpecToken -= 1, $corpSpecTimer = 2]] | [[Remove Pussy|Manage Corporation][$corpSpecPussy = -1, $corpSpecGenitalia = 1, $corpSpecToken -= 1, $corpSpecTimer = 2]] | [[Add Dick|Manage Corporation][$corpSpecDick = 1, $corpSpecGenitalia = 1, $corpSpecToken -= 1, $corpSpecTimer = 2]] | [[Remove Dick|Manage Corporation][$corpSpecDick = -1, $corpSpecGenitalia = 1, $corpSpecToken -= 1, $corpSpecTimer = 2]] | [[Add Balls|Manage Corporation][$corpSpecBalls = 1, $corpSpecGenitalia = 1, $corpSpecToken -= 1, $corpSpecTimer = 2]] | [[Remove Balls|Manage Corporation][$corpSpecBalls = -1, $corpSpecGenitalia = 1, $corpSpecToken -= 1, $corpSpecTimer = 2]] -- //Further specializations possible//
		<</if>>
		<<if ndef $corpSpecTrust && $corpDivBreak > 0>> /*This used to be $generalUpgradeBreaking, it is the slave breaking specific specialization*/

Breaking slaves with [[Brutality|Manage Corporation][$corpSpecTrust = 2, $corpSpecToken -= 1, $corpSpecTimer = 2]] | [[Care|Manage Corporation][$corpSpecTrust = 4, $corpSpecToken -= 1, $corpSpecTimer = 2]] -- //Further specializations possible//
		<</if>>
		<<if ndef $corpSpecAmputee && $corpDivArcade > 0 && $corpDivSurgeryDev > 100>> /*This is the arcade specialization*/

Slave limbs are categorically [[Removed|Manage Corporation][$corpSpecAmputee = 1, $corpSpecToken -= 1, $corpSpecTimer = 2]]
		<</if>>
		<<if ndef $corpSpecMuscle && $corpDivMenial > 0>> /*This used to be $generalUpgradeMuscle, it is the Menial division's specialization*/

Slaves with muscles that are <<if $arcologies[0].FSPhysicalIdealist == "unset">> [[Weak|Manage Corporation][$corpSpecMuscle = 2, $corpSpecToken -= 1, $corpSpecTimer = 2]] | <</if>>[[Soft|Manage Corporation][$corpSpecMuscle = 3, $corpSpecToken -= 1, $corpSpecTimer = 2]] | [[Toned|Manage Corporation][$corpSpecMuscle = 4, $corpSpecToken -= 1, $corpSpecTimer = 2]] -- //Further specializations possible//
		<</if>>
		<<if ndef $corpSpecMilk && $corpDivDairy > 0>> /*This is the dairy specialization*/

Slaves are made to be lactating [[Naturally|Manage Corporation][$corpSpecMilk = 1, $corpSpecToken -= 1, $corpSpecTimer = 2]] | [[Through Implant|Manage Corporation][$corpSpecMilk = 2, $corpSpecToken -= 1, $corpSpecTimer = 2]]
		<</if>>
		<<if ndef $corpSpecSexEd && $corpDivWhore > 0>> /*This used to be $trainingUpgradeSexEd, it is the escort division specialization*/

Slaves are sexually [[Clueless|Manage Corporation][$corpSpecSexEd = 0, $corpSpecToken -= 0, $corpSpecTimer = 2]] | [[Competent|Manage Corporation][$corpSpecSexEd = 1, $corpSpecToken -= 1, $corpSpecTimer = 2]] -- //Further specializations possible//
		<</if>>
	<</if>>
<<else>>

Your corporation cannot pick a new specialization at this time.
<</if>>

<<if $corpSpec > $corpSpecToken>> /*Modifying specializations*/

You have chosen the following specializations;

//You can choose to specialize further with additional tokens, specialize less, end the specialization or sometimes tweak them for free.//
	<<if $corpSpecRaces.length == 12>>
		<<set $corpSpecRaces = []>>
	<</if>>
	<<if $corpSpecRaces.length > 0>>

The corporation enslaves people of the following race(s);
		<<if $corpSpecRaces.includes("amerindian")>>

Amerindian
			<<if !($arcologies[0].FSSubjugationist != "unset" && $arcologies[0].FSSubjugationistRace != "amerindian")>>
				<<if $corpSpecRaces.length > 1 && $corpSpecTimer == 0>>
					<<if ($corpSpecRaces.length == 4 || $corpSpecRaces.length == 8) && $corpSpecToken > 0>>
						[[Blacklist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("amerindian",1), $corpSpecToken -= 1, $corpSpecTimer = 1]]
					<<elseif ($corpSpecRaces.length != 4 || $corpSpecRaces.length != 8)>>
						[[Blacklist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("amerindian",1)]]
					<</if>>
				<</if>>
			<</if>>
		<<else>>

==Amerindian==
			<<if $corpSpecTimer == 0>>
				<<if $corpSpecRaces.length == 3 || $corpSpecRaces.length == 7 || $corpSpecRaces.length == 11>>
					[[Whitelist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("amerindian",0), $corpSpecToken += 1, $corpSpecTimer = 1]]
				<<else>>
					[[Whitelist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("amerindian",0)]]
				<</if>>
			<</if>>
		<</if>>
		<<if $corpSpecRaces.includes("asian")>>

Asian
			<<if !($arcologies[0].FSSubjugationist != "unset" && $arcologies[0].FSSubjugationistRace != "asian")>>
				<<if $corpSpecRaces.length > 1 && $corpSpecTimer == 0>>
					<<if ($corpSpecRaces.length == 4 || $corpSpecRaces.length == 8) && $corpSpecToken > 0>>
						[[Blacklist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("asian",1), $corpSpecToken -= 1, $corpSpecTimer = 1]]
					<<elseif ($corpSpecRaces.length != 4 || $corpSpecRaces.length != 8)>>
						[[Blacklist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("asian",1)]]
					<</if>>
				<</if>>
			<</if>>
		<<else>>

==Asian==
			<<if $corpSpecTimer == 0>>
				<<if $corpSpecRaces.length == 3 || $corpSpecRaces.length == 7 || $corpSpecRaces.length == 11>>
					[[Whitelist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("asian",0), $corpSpecToken += 1, $corpSpecTimer = 1]]
				<<else>>
					[[Whitelist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("asian",0)]]
				<</if>>
			<</if>>
		<</if>>
		<<if $corpSpecRaces.includes("black")>>

Black
			<<if !($arcologies[0].FSSubjugationist != "unset" && $arcologies[0].FSSubjugationistRace != "black")>>
				<<if $corpSpecRaces.length > 1 && $corpSpecTimer == 0>>
					<<if ($corpSpecRaces.length == 4 || $corpSpecRaces.length == 8) && $corpSpecToken > 0>>
						[[Blacklist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("black",1), $corpSpecToken -= 1, $corpSpecTimer = 1]]
					<<elseif ($corpSpecRaces.length != 4 || $corpSpecRaces.length != 8)>>
						[[Blacklist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("black",1)]]
					<</if>>
				<</if>>
			<</if>>
		<<else>>

==Black==
			<<if $corpSpecTimer == 0>>
				<<if $corpSpecRaces.length == 3 || $corpSpecRaces.length == 7 || $corpSpecRaces.length == 11>>
					[[Whitelist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("black",0), $corpSpecToken += 1, $corpSpecTimer = 1]]
				<<else>>
					[[Whitelist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("black",0)]]
				<</if>>
			<</if>>
		<</if>>
		<<if $corpSpecRaces.includes("indo-aryan")>>

Indo-Aryan
			<<if !($arcologies[0].FSSubjugationist != "unset" && $arcologies[0].FSSubjugationistRace != "indo-aryan")>>
				<<if $corpSpecRaces.length > 1 && $corpSpecTimer == 0>>
					<<if ($corpSpecRaces.length == 4 || $corpSpecRaces.length == 8) && $corpSpecToken > 0>>
						[[Blacklist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("indo-aryan",1), $corpSpecToken -= 1, $corpSpecTimer = 1]]
					<<elseif ($corpSpecRaces.length != 4 || $corpSpecRaces.length != 8)>>
						[[Blacklist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("indo-aryan",1)]]
					<</if>>
				<</if>>
			<</if>>
		<<else>>

==Indo-Aryan==
			<<if $corpSpecTimer == 0>>
				<<if $corpSpecRaces.length == 3 || $corpSpecRaces.length == 7 || $corpSpecRaces.length == 11>>
					[[Whitelist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("indo-aryan",0), $corpSpecToken += 1, $corpSpecTimer = 1]]
				<<else>>
					[[Whitelist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("indo-aryan",0)]]
				<</if>>
			<</if>>
		<</if>>
		<<if $corpSpecRaces.includes("latina")>>

Latina
			<<if !($arcologies[0].FSSubjugationist != "unset" && $arcologies[0].FSSubjugationistRace != "latina")>>
				<<if $corpSpecRaces.length > 1 && $corpSpecTimer == 0>>
					<<if ($corpSpecRaces.length == 4 || $corpSpecRaces.length == 8) && $corpSpecToken > 0>>
						[[Blacklist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("latina",1), $corpSpecToken -= 1, $corpSpecTimer = 1]]
					<<elseif ($corpSpecRaces.length != 4 || $corpSpecRaces.length != 8)>>
						[[Blacklist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("latina",1)]]
					<</if>>
				<</if>>
			<</if>>
		<<else>>

==Latina==
			<<if $corpSpecTimer == 0>>
				<<if $corpSpecRaces.length == 3 || $corpSpecRaces.length == 7 || $corpSpecRaces.length == 11>>
					[[Whitelist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("latina",0), $corpSpecToken += 1, $corpSpecTimer = 1]]
				<<else>>
					[[Whitelist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("latina",0)]]
				<</if>>
			<</if>>
		<</if>>
		<<if $corpSpecRaces.includes("malay")>>

Malay
			<<if !($arcologies[0].FSSubjugationist != "unset" && $arcologies[0].FSSubjugationistRace != "malay")>>
				<<if $corpSpecRaces.length > 1 && $corpSpecTimer == 0>>
					<<if ($corpSpecRaces.length == 4 || $corpSpecRaces.length == 8) && $corpSpecToken > 0>>
						[[Blacklist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("malay",1), $corpSpecToken -= 1, $corpSpecTimer = 1]]
					<<elseif ($corpSpecRaces.length != 4 || $corpSpecRaces.length != 8)>>
						[[Blacklist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("malay",1)]]
					<</if>>
				<</if>>
			<</if>>
		<<else>>

==Malay==
			<<if $corpSpecTimer == 0>>
				<<if $corpSpecRaces.length == 3 || $corpSpecRaces.length == 7 || $corpSpecRaces.length == 11>>
					[[Whitelist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("malay",0), $corpSpecToken += 1, $corpSpecTimer = 1]]
				<<else>>
					[[Whitelist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("malay",0)]]
				<</if>>
			<</if>>
		<</if>>
		<<if $corpSpecRaces.includes("middle eastern")>>

Middle Eastern
			<<if !($arcologies[0].FSSubjugationist != "unset" && $arcologies[0].FSSubjugationistRace != "middle eastern")>>
				<<if $corpSpecRaces.length > 1 && $corpSpecTimer == 0>>
					<<if ($corpSpecRaces.length == 4 || $corpSpecRaces.length == 8) && $corpSpecToken > 0>>
						[[Blacklist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("middle eastern",1), $corpSpecToken -= 1, $corpSpecTimer = 1]]
					<<elseif ($corpSpecRaces.length != 4 || $corpSpecRaces.length != 8)>>
						[[Blacklist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("middle eastern",1)]]
					<</if>>
				<</if>>
			<</if>>
		<<else>>

==Middle Eastern==
			<<if $corpSpecTimer == 0>>
				<<if $corpSpecRaces.length == 3 || $corpSpecRaces.length == 7 || $corpSpecRaces.length == 11>>
					[[Whitelist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("middle eastern",0), $corpSpecToken += 1, $corpSpecTimer = 1]]
				<<else>>
					[[Whitelist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("middle eastern",0)]]
				<</if>>
			<</if>>
		<</if>>
		<<if $corpSpecRaces.includes("mixed race")>>

Mixed Race
			<<if !($arcologies[0].FSSubjugationist != "unset" && $arcologies[0].FSSubjugationistRace != "mixed race")>>
				<<if $corpSpecRaces.length > 1 && $corpSpecTimer == 0>>
					<<if ($corpSpecRaces.length == 4 || $corpSpecRaces.length == 8) && $corpSpecToken > 0>>
						[[Blacklist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("mixed race",1), $corpSpecToken -= 1, $corpSpecTimer = 1]]
					<<elseif ($corpSpecRaces.length != 4 || $corpSpecRaces.length != 8)>>
						[[Blacklist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("mixed race",1)]]
					<</if>>
				<</if>>
			<</if>>
		<<else>>

==Mixed Race==
			<<if $corpSpecTimer == 0>>
				<<if $corpSpecRaces.length == 3 || $corpSpecRaces.length == 7 || $corpSpecRaces.length == 11>>
					[[Whitelist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("mixed race",0), $corpSpecToken += 1, $corpSpecTimer = 1]]
				<<else>>
					[[Whitelist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("mixed race",0)]]
				<</if>>
			<</if>>
		<</if>>
		<<if $corpSpecRaces.includes("pacific islander")>>

Pacific Islander
			<<if !($arcologies[0].FSSubjugationist != "unset" && $arcologies[0].FSSubjugationistRace != "pacific islander")>>
				<<if $corpSpecRaces.length > 1 && $corpSpecTimer == 0>>
					<<if ($corpSpecRaces.length == 4 || $corpSpecRaces.length == 8) && $corpSpecToken > 0>>
						[[Blacklist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("pacific islander",1), $corpSpecToken -= 1, $corpSpecTimer = 1]]
					<<elseif ($corpSpecRaces.length != 4 || $corpSpecRaces.length != 8)>>
						[[Blacklist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("pacific islander",1)]]
					<</if>>
				<</if>>
			<</if>>
		<<else>>

==Pacific Islander==
			<<if $corpSpecTimer == 0>>
				<<if $corpSpecRaces.length == 3 || $corpSpecRaces.length == 7 || $corpSpecRaces.length == 11>>
					[[Whitelist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("pacific islander",0), $corpSpecToken += 1, $corpSpecTimer = 1]]
				<<else>>
					[[Whitelist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("pacific islander",0)]]
				<</if>>
			<</if>>
		<</if>>
		<<if $corpSpecRaces.includes("semitic")>>

Semitic
			<<if !($arcologies[0].FSSubjugationist != "unset" && $arcologies[0].FSSubjugationistRace != "semitic")>>
				<<if $corpSpecRaces.length > 1 && $corpSpecTimer == 0>>
					<<if ($corpSpecRaces.length == 4 || $corpSpecRaces.length == 8) && $corpSpecToken > 0>>
						[[Blacklist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("semitic",1), $corpSpecToken -= 1, $corpSpecTimer = 1]]
					<<elseif ($corpSpecRaces.length != 4 || $corpSpecRaces.length != 8)>>
						[[Blacklist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("semitic",1)]]
					<</if>>
				<</if>>
			<</if>>
		<<else>>

==Semitic==
			<<if $corpSpecTimer == 0>>
				<<if $corpSpecRaces.length == 3 || $corpSpecRaces.length == 7 || $corpSpecRaces.length == 11>>
					[[Whitelist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("semitic",0), $corpSpecToken += 1, $corpSpecTimer = 1]]
				<<else>>
					[[Whitelist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("semitic",0)]]
				<</if>>
			<</if>>
		<</if>>
		<<if $corpSpecRaces.includes("southern european")>>

Southern European
			<<if !($arcologies[0].FSSubjugationist != "unset" && $arcologies[0].FSSubjugationistRace != "southern european")>>
				<<if $corpSpecRaces.length > 1 && $corpSpecTimer == 0>>
					<<if ($corpSpecRaces.length == 4 || $corpSpecRaces.length == 8) && $corpSpecToken > 0>>
						[[Blacklist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("southern european",1), $corpSpecToken -= 1, $corpSpecTimer = 1]]
					<<elseif ($corpSpecRaces.length != 4 || $corpSpecRaces.length != 8)>>
						[[Blacklist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("southern european",1)]]
					<</if>>
				<</if>>
			<</if>>
		<<else>>

==Southern European==
			<<if $corpSpecTimer == 0>>
				<<if $corpSpecRaces.length == 3 || $corpSpecRaces.length == 7 || $corpSpecRaces.length == 11>>
					[[Whitelist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("southern european",0), $corpSpecToken += 1, $corpSpecTimer = 1]]
				<<else>>
					[[Whitelist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("southern european",0)]]
				<</if>>
			<</if>>
		<</if>>
		<<if $corpSpecRaces.includes("white")>>

White
			<<if !($arcologies[0].FSSubjugationist != "unset" && $arcologies[0].FSSubjugationistRace == "white")>>
				<<if $corpSpecRaces.length > 1 && $corpSpecTimer == 0>>
					<<if ($corpSpecRaces.length == 4 || $corpSpecRaces.length == 8) && $corpSpecToken > 0>>
						[[Blacklist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("white",1), $corpSpecToken -= 1, $corpSpecTimer = 1]]
					<<elseif ($corpSpecRaces.length != 4 || $corpSpecRaces.length != 8)>>
						[[Blacklist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("white",1)]]
					<</if>>
				<</if>>
			<</if>>
		<<else>>

==White==
			<<if $corpSpecTimer == 0>>
				<<if $corpSpecRaces.length == 3 || $corpSpecRaces.length == 7 || $corpSpecRaces.length == 11>>
					[[Whitelist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("white",0), $corpSpecToken += 1, $corpSpecTimer = 1]]
				<<else>>
					[[Whitelist|Manage Corporation][$corpSpecRaces = corpBlacklistRace("white",0)]]
				<</if>>
			<</if>>
		<</if>>
	<</if>>
	<<if $corpSpecGender == 1>>

The corporation trains slaves with pussies.
		<<if $corpSpecTimer == 0>>
			<<link "No Focus">><<unset $corpSpecGender>><<set $corpSpecToken += 1, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<<elseif $corpSpecGender == 2>>

The corporation trains slaves with dicks.
		<<if $corpSpecTimer == 0>>
			<<link "No Focus">><<unset $corpSpecGender>><<set $corpSpecToken += 1, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<</if>>
	<<if $corpSpecHeight == 1>>

The corporation is targeting tiny slaves.
		<<if $corpSpecTimer == 0>>
			[[Short Slaves|Manage Corporation][$corpSpecHeight = 2, $corpSpecToken += 1, $corpSpecTimer = 2]] | <<link "No Focus">><<unset $corpSpecHeight>><<set $corpSpecToken += 2, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<<elseif $corpSpecHeight == 2>>

The corporation is targeting short slaves.
		<<if $corpSpecTimer == 0>>
			<<if $corpSpecToken > 0 && ($corpDivExtraDev + $corpDivLegalDev) > 50>>
				[[Tiny Slaves|Manage Corporation][$corpSpecHeight = 1, $corpSpecToken -= 1, $corpSpecTimer = 2]] |
			<</if>>
			<<link "No Focus">><<unset $corpSpecHeight>><<set $corpSpecToken += 1, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<<elseif $corpSpecHeight == 4>>

The corporation is targeting tall slaves.
		<<if $corpSpecTimer == 0>>
			<<if $corpSpecToken > 0 && ($corpDivExtraDev + $corpDivLegalDev) > 50>>
				[[Giant Slaves|Manage Corporation][$corpSpecHeight = 5, $corpSpecToken -= 1, $corpSpecTimer = 2]] |
			<</if>>
			<<link "No Focus">><<unset $corpSpecHeight>><<set $corpSpecToken += 1, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<<elseif $corpSpecHeight == 5>>

The corporation is targeting giant slaves.
		<<if $corpSpecTimer == 0>>
			[[Tall Slaves|Manage Corporation][$corpSpecHeight = 4, $corpSpecToken += 1, $corpSpecTimer = 2]] | <<link "No Focus">><<unset $corpSpecHeight>><<set $corpSpecToken += 2, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<</if>>
	<<if $corpSpecVirgin == 1>>

The corporation is ensuring slaves remain virgins.
		<<if $corpSpecTimer == 0>>
			<<link "No Focus">><<unset $corpSpecVirgin>><<set $corpSpecToken += 1, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<</if>>
	<<if $corpSpecTrust == 1>>

The corporation is breaking slaves with extreme brutality.
		<<if $corpSpecTimer == 0>>
			[[Apply Less Brutality|Manage Corporation][$corpSpecTrust = 2, $corpSpecTimer = 2]] | <<link "No Focus">><<unset $corpSpecTrust>><<set $corpSpecToken += 1, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>> /*Don't think this deserves the added cost of a token, unlike the 'utmost care' one*/
	<<elseif $corpSpecTrust == 2>>

The corporation is breaking slaves with brutality.
		<<if $corpSpecTimer == 0>>
			<<if $corpSpecToken > 0 && $arcologies[0].FSDegradationist > 20 && $corpDivBreakDev > 50>>
				[[Apply Extreme Brutality|Manage Corporation][$corpSpecTrust = 1, $corpSpecTimer = 2]] |
			<</if>>
			<<link "No Focus">><<unset $corpSpecTrust>><<set $corpSpecToken += 1, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<<elseif $corpSpecTrust == 4>>

The corporation is breaking slaves with care.
		<<if $corpSpecTimer == 0>>
			<<if $corpSpecToken > 0 && $arcologies[0].FSPaternalist > 20 && $corpDivBreakDev > 50>>
				[[Use the Utmost Care|Manage Corporation][$corpSpecTrust = 5, $corpSpecToken += 1, $corpSpecTimer == 2]] |
			<</if>>
			<<link "No Focus">><<unset $corpSpecTrust>><<set $corpSpecToken += 1, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<<elseif $corpSpecTrust == 5>>

The corporation is breaking slaves with the utmost care.
		<<if $corpSpecTimer == 0>>
			[[Use Less Care|Manage Corporation][$corpSpecTrust = 4, $corpSpecToken += 1, $corpSpecTimer = 2]] | <<link "No Focus">><<unset $corpSpecTrust>><<set $corpSpecToken += 2, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<</if>>
	<<if $corpSpecWeight == 1>>

The corporation makes slaves follow incredibly strict diets.
		<<if $corpSpecTimer == 0>>
			[[Apply Looser Diet|Manage Corporation][$corpSpecWeight = 2, $corpSpecTimer = 2]] | <<link "No Focus">><<unset $corpSpecWeight>><<set $corpSpecToken += 1, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<<elseif $corpSpecWeight == 2>>

The corporation makes slaves diet.
		<<if $corpSpecTimer == 0>>
			<<if $corpSpecToken > 0 && $arcologies[0].FSHedonisticDecadence == "unset">>
				[[Apply Strict Diet|Manage Corporation][$corpSpecWeight = 1, $corpSpecTimer = 2]] |
			<</if>>
			[[Aim for Healthy Weight|Manage Corporation][$corpSpecWeight = 3, $corpSpecTimer = 2]] | <<link "No Focus">><<unset $corpSpecWeight>><<set $corpSpecToken += 1, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<<elseif $corpSpecWeight == 3>>

The corporation is aiming for slaves with a healthy weight.
		<<if $corpSpecTimer == 0>>
			[[Apply Diet|Manage Corporation][$corpSpecWeight = 2, $corpSpecTimer = 2]] | [[Plump up Slaves|Manage Corporation][$corpSpecWeight = 5, $corpSpecTimer = 2]] | <<link "No Focus">><<unset $corpSpecWeight>><<set $corpSpecToken += 1, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>> /*Perhaps 'plump up' is not the right phrase*/
	<<elseif $corpSpecWeight == 5>>

The corporation aims for plump slaves.
		<<if $corpSpecTimer == 0>>
			<<if $corpSpecToken > 0 && $arcologies[0].FSPhysicalIdealist == "unset">>
				[[Fatten Slaves|Manage Corporation][$corpSpecWeight = 6, $corpSpecTimer = 2]] |
			<</if>>
			[[Aim for Healthy Weight|Manage Corporation][$corpSpecWeight = 3, $corpSpecTimer = 2]] | <<link "No Focus">><<unset $corpSpecWeight>><<set $corpSpecToken += 1, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<<elseif $corpSpecWeight == 6>>

The corporation aims for fat slaves.
		<<if $corpSpecTimer == 0>>
			[[Settle for Plump|Manage Corporation][$corpSpecWeight = 5, $corpSpecTimer = 2]] | <<link "No Focus">><<unset $corpSpecWeight>><<set $corpSpecToken += 1, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<</if>>
	<<if $corpSpecMuscle == 1>>

The corporation aims to have frail slaves.
		<<if $corpSpecTimer == 0>>
			[[Aim for Weak|Manage Corporation][$corpSpecMuscle = 2, $corpSpecTimer = 2]] | <<link "No Focus">><<unset $corpSpecMuscle>><<set $corpSpecToken += 1, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<<elseif $corpSpecMuscle == 2>> /*Don't think this deserves the added cost of a token, unlike slaves getting ripped*/

The corporation aims to have weak slaves.
		<<if $corpSpecTimer == 0>>
			<<if $arcologies[0].FSPhysicalIdealist == "unset">>
				[[Aim for Frail|Manage Corporation][$corpSpecMuscle = 1, $corpSpecTimer = 2]] |
			<</if>>
			[[Aim for Soft|Manage Corporation][$corpSpecMuscle = 3, $corpSpecTimer = 2]] | <<link "No Focus">><<unset $corpSpecWeight>><<set $corpSpecToken += 1, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<<elseif $corpSpecMuscle == 3>>

The corporation is aiming for slaves with soft muscles.
		<<if $corpSpecTimer == 0>>
			<<if $arcologies[0].FSPhysicalIdealist == "unset">>
				[[Aim for Weak|Manage Corporation][$corpSpecMuscle = 2, $corpSpecTimer = 2]] |
			<</if>>
			[[Aim for Toned|Manage Corporation][$corpSpecMuscle = 4, $corpSpecTimer = 2]] | <<link "No Focus">><<unset $corpSpecWeight>><<set $corpSpecToken += 1, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<<elseif $corpSpecMuscle == 4>>

The corporation aims for toned muscles.
		<<if $corpSpecTimer == 0>>
			<<if $corpSpecToken > 0 && ($corpDivBreakDev + $corpDivSurgeryDev + $corpDivTrainDev > 100)>>
				[[Aim for Ripped|Manage Corporation][$corpSpecMuscle = 5, $corpSpecToken -= 1, $corpSpecTimer = 2]] |
			<</if>>
			[[Aim for Soft|Manage Corporation][$corpSpecMuscle = 3, $corpSpecTimer = 2]] | <<link "No Focus">><<unset $corpSpecWeight>><<set $corpSpecToken += 1, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<<elseif $corpSpecMuscle == 5>>

The corporation aims for ripped slaves.
		<<if $corpSpecTimer == 0>>
			[[Aim for Toned|Manage Corporation][$corpSpecMuscle = 4, $corpSpecToken += 1, $corpSpecTimer = 2]] | <<link "No Focus">><<unset $corpSpecWeight>><<set $corpSpecToken += 2, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<</if>>
		<<if $corpSpecDevotion == 1>>

The corporation keeps slaves extremely defiant.
		<<if $corpSpecTimer == 0>>
			[[Less Defiant|Manage Corporation][$corpSpecDevotion = 2, $corpSpecTimer = 2]] | <<link "No Focus">><<unset $corpSpecDevotion>><<set $corpSpecToken += 1, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>> /*Don't think this deserves the added cost of a token, unlike the 'devoted' one*/
	<<elseif $corpSpecDevotion == 2>>

The corporation keeps slaves reluctant.
		<<if $corpSpecTimer == 0>>
			[[Make them Defiant|Manage Corporation][$corpSpecDevotion = 1, $corpSpecTimer = 2]] | <<link "No Focus">><<unset $corpSpecDevotion>><<set $corpSpecToken += 1, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<<elseif $corpSpecDevotion == 4>>

The corporation is fostering obedience.
		<<if $corpSpecTimer == 0>>
			<<if $corpSpecToken > 0 && $corpDivTrainDev > 100>>
				[[Foster Devotion|Manage Corporation][$corpSpecDevotion = 5, $corpSpecToken += 1, $corpSpecTimer = 2]] |
			<</if>>
		<<link "No Focus">><<unset $corpSpecDevotion>><<set $corpSpecToken += 1, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<<elseif $corpSpecDevotion == 5>>

The corporation is fostering devotion.
		<<if $corpSpecTimer == 0>>
			[[Settle for Obedience|Manage Corporation][$corpSpecDevotion = 4, $corpSpecToken += 1, $corpSpecTimer = 2]] | <<link "No Focus">><<unset $corpSpecDevotion>><<set $corpSpecToken += 2, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<</if>>
	<<if $corpSpecIntelligence == 1>>

The corporation keeps stupid slaves.
		<<if $corpSpecTimer == 0>>
			<<link "No Focus">><<unset $corpSpecIntelligence>><<set $corpSpecToken += 1, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<<elseif $corpSpecIntelligence == 3>>

The corporation keeps intelligent slaves.
		<<if $corpSpecTimer == 0>>
			<<link "No Focus">><<unset $corpSpecIntelligence>><<set $corpSpecToken += 1, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<</if>>
	<<if $corpSpecAge == 1>>

The corporation focuses on young slaves.
		<<if $corpSpecTimer == 0>>
			<<link "No Focus">><<unset $corpSpecAge>><<set $corpSpecToken += 1, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<<elseif $corpSpecAge == 3>>

The corporation focuses on older slaves.
		<<if $corpSpecTimer == 0>>
			<<link "No Focus">><<unset $corpSpecAge>><<set $corpSpecToken += 1, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<</if>>
	<<if $corpSpecAccent == 1>>

The corporation teaches slaves to speak the lingua franca.
		<<if $corpSpecTimer == 0>>
			[[Eliminate Accents|Manage Corporation][$corpSpecAccent = 2, $corpSpecTimer = 2]] | <<link "No Focus">><<unset $corpSpecAccent>><<set $corpSpecToken += 1, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<<elseif $corpSpecAccent == 2>>

The corporation teaches slaves to speak the lingua franca without an accent.
		<<if $corpSpecTimer == 0>>
			[[Just Teach Language|Manage Corporation][$corpSpecAccent = 1, $corpSpecTimer = 2]] | <<link "No Focus">><<unset $corpSpecAccent>><<set $corpSpecToken += 1, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<</if>>
	<<if $corpSpecEducation == 0>>

The corporation focuses on uneducated slaves.
		<<if $corpSpecTimer == 0>>
			<<if $corpSpecToken > 0>>
				[[Basic Education|Manage Corporation][$corpSpecEducation = 1, $corpSpecTimer = 2]] |
			<</if>>
		<<link "No Focus">><<unset $corpSpecEducation>><<set $corpSpecToken += 1, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<<elseif $corpSpecEducation == 1>>

The corporation makes sure all slaves have a basic education.
		<<if $corpSpecTimer == 0>>
			<<if $corpDivTrainDev > 200 && $corpSpecToken > 0>>
				[[Advanced Education|Manage Corporation][$corpSpecEducation = 2, $corpSpecToken -= 1, $corpSpecTimer = 2]] |
			<</if>>
			[[No Education|Manage Corporation][$corpSpecEducation = 1, $corpSpecTimer = 2]] | <<link "No Focus">><<unset $corpSpecEducation>><<set $corpSpecToken += 1, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<<elseif $corpSpecEducation == 2>>

The corporation makes sure all slaves have an advanced education.
		<<if $corpSpecTimer == 0>>
			[[Basic Education|Manage Corporation][$corpSpecEducation = 1, $corpSpecToken += 1, $corpSpecTimer = 2]] | <<link "No Focus">><<unset $corpSpecEducation>><<set $corpSpecToken += 2, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<</if>>
	<<if $corpSpecCosmetics == 1>>

The corporation applies straightforward cosmetic procedures.
		<<if $corpSpecTimer == 0>>
			<<link "No Focus">><<unset $corpSpecCosmetics>><<set $corpSpecToken += 1, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<<elseif $corpSpecCosmetics == 0>>

The corporation doesn't apply cosmetic procedures.
		<<if $corpSpecTimer == 0>>
			<<if $corpSpecToken > 0>>
				[[Applied|Manage Corporation][$corpSpecCosmetics = 1, $corpSpecToken -= 1, $corpSpecTimer = 2]] |
			<</if>>
			<<link "No Focus">><<unset $corpSpecCosmetics>><<set $corpSpecToken += 1, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<</if>>
	<<if $corpSpecImplants == 1>>

The corporation applies tasteful implants to all slaves.
		<<if $corpSpecTimer == 0>>
			<<if $corpDivSurgeryDev > 100 && $corpSpecToken > 0>>
				[[Absurd Implants|Manage Corporation][$corpSpecImplants = 2, $corpSpecToken -= 1, $corpSpecTimer = 2]] |
			<</if>>
			<<link "No Focus">><<unset $corpSpecImplants>><<set $corpSpecToken += 1, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<<elseif $corpSpecImplants == 2>>

The corporation applies absurd implants to all slaves.
		<<if $corpSpecTimer == 0>>
			[[Tasteful Implants|Manage Corporation][$corpSpecImplants = 1, $corpSpecToken += 1, $corpSpecTimer = 2]] | <<link "No Focus">><<unset $corpSpecImplants>><<set $corpSpecToken += 2, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<<elseif $corpSpecImplants == 0>>

The corporation keeps their slaves entirely implant free.
		<<if $corpSpecTimer == 0>>
			<<if $corpSpecToken > 0>>
				[[Tasteful Implants|Manage Corporation][$corpSpecImplants = 1, $corpSpecToken -= 1, $corpSpecTimer = 2]] |
			<</if>>
			<<link "No Focus">><<unset $corpSpecImplants>><<set $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<</if>>
	<<if ndef $corpSpecPussy && ndef $corpSpecDick && ndef $corpSpecBalls && $corpSpecGenitalia == 1>>
		<<set ndef $corpSpecGenitalia,
		$corpSpecToken += 1>>
	<</if>>
	<<if $corpSpecGenitalia == 1>>
		<<if $corpSpecPussy == 1>>

The corporation adds a pussy to all slaves.
			<<if $corpSpecTimer == 0>>
				<<link "Stop">><<unset $corpSpecPussy>><<set $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
			<</if>>
		<<elseif $corpSpecPussy == -1>>

The corporation removes pussies from all slaves.
			<<if $corpSpecTimer == 0>>
				<<link "Stop">><<unset $corpSpecPussy>><<set $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
			<</if>>
		<<else>>

The corporation has no plans for pussies.
			<<if $corpSpecTimer == 0>>
				[[Add Pussy|Manage Corporation][$corpSpecPussy = 1, $corpSpecTimer = 2]] | [[Remove Pussy|Manage Corporation][$corpSpecPussy = -1, $corpSpecToken -= 1, $corpSpecTimer = 2]]
			<</if>>
		<</if>>
		<<if $corpSpecDick == 1>>

The corporation adds a dick to all slaves.
			<<if $corpSpecTimer == 0>>
				<<link "Stop">><<unset $corpSpecDick>><<set $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
			<</if>>
		<<elseif $corpSpecDick == -1>>

The corporation removes dicks from all slaves.
			<<if $corpSpecTimer == 0>>
				<<link "Stop">><<unset $corpSpecDick>><<set $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
			<</if>>
		<<else>>

The corporation has no plans for dicks.
			<<if $corpSpecTimer == 0>>
				[[Add Dick|Manage Corporation][$corpSpecDick = 1, $corpSpecTimer = 2]] | [[Remove Dick|Manage Corporation][$corpSpecDick = -1, $corpSpecToken -= 1, $corpSpecTimer = 2]]
			<</if>>
		<</if>>
		<<if $corpSpecBalls == 1>>

The corporation adds balls to all slaves (penis required).
			<<if $corpSpecTimer == 0>>
				<<link "Stop">><<unset $corpSpecBalls>><<set $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
			<</if>>
		<<elseif $corpSpecBalls == -1>>

The corporation removes balls from all slaves.
			<<if $corpSpecTimer == 0>>
				<<link "Stop">><<unset $corpSpecBalls>><<set $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
			<</if>>
		<<else>>

The corporation has no plans for balls.
			<<if $corpSpecTimer == 0>>
				[[Add Balls|Manage Corporation][$corpSpecBalls = 1, $corpSpecTimer = 2]] | [[Remove Balls|Manage Corporation][$corpSpecBalls = -1, $corpSpecTimer = 2]]
			<</if>>
		<</if>>
	<</if>>
	<<if $corpSpecInjection == 1>>

The corporation aims for petite assets.
		<<if $corpSpecTimer == 0>>
			[[Tasteful Size|Manage Corporation][$corpSpecInjection = 2, $corpSpecTimer = 2]] | [[Huge Size|Manage Corporation][$corpSpecInjection = 3, $corpSpecTimer = 2]] | <<link "No Focus">><<unset $corpSpecInjection>><<set $corpSpecToken += 1, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<<elseif $corpSpecInjection == 2>>

The corporation aims for tasteful assets.
		<<if $corpSpecTimer == 0>>
			[[Small Size|Manage Corporation][$corpSpecInjection = 1, $corpSpecTimer = 2]] | [[Huge Size|Manage Corporation][$corpSpecInjection = 3, $corpSpecTimer = 2]] | <<link "No Focus">><<unset $corpSpecInjection>><<set $corpSpecToken += 1, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<<elseif $corpSpecInjection == 3>>

The corporation aims for huge assets.
		<<if $corpSpecTimer == 0>>
			[[Small Size|Manage Corporation][$corpSpecInjection = 1, $corpSpecTimer = 2]] | [[Tasteful Size|Manage Corporation][$corpSpecInjection = 2, $corpSpecTimer = 2]] |
			<<if $corpDivSurgeryDev > 100 && $corpSpecToken > 0>>
				[[Supermassive Size|Manage Corporation][$corpSpecInjection = 4, $corpSpecToken -= 1, $corpSpecTimer = 2]]
			<</if>>
			<<if $corpDivDairyDev > 200 && $corpSpecToken > 0>> |
				[[Pastoral Size|Manage Corporation][$corpSpecInjection = 5, $corpSpecToken -= 1, $corpSpecTimer = 2]] |
			<</if>>
			<<link "No Focus">><<unset $corpSpecInjection>><<set $corpSpecToken += 1, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<<elseif $corpSpecInjection == 4>>

The corporation aims for supermassive assets.
		<<if $corpSpecTimer == 0>>
			[[Huge Size|Manage Corporation][$corpSpecInjection = 3, $corpSpecToken += 1, $corpSpecTimer = 2]] |
			<<if $corpDivDairyDev > 200>>
				[[Pastoral Size|Manage Corporation][$corpSpecInjection = 5, $corpSpecTimer = 2]] |
			<</if>>
		<<link "No Focus">><<unset $corpSpecInjection>><<set $corpSpecToken += 2, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<<elseif $corpSpecInjection == 5>>

The corporation aims for pastoral assets.
		<<if $corpSpecTimer == 0>>
			[[Huge Size|Manage Corporation][$corpSpecInjection = 3, $corpSpecToken += 1, $corpSpecTimer = 2]] |
			<<if $corpDivSurgeryDev > 50>>
				[[Supermassive Size|Manage Corporation][$corpSpecInjection = 4, $corpSpecTimer = 2]] |
			<</if>>
			<<link "No Focus">><<unset $corpSpecInjection>><<set $corpSpecToken += 2, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<</if>>
	<<if $corpSpecHormones == 1>>

The corporation feminizes slaves with hormones.
		<<if $corpSpecTimer == 0>>
			[[Masculinize|Manage Corporation][$corpSpecHormones = 2, $corpSpecTimer = 2]] | <<link "No Focus">><<unset $corpSpecHormones>><<set $corpSpecToken += 1, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<<elseif $corpSpecHormones == 2>>

The corporation masculinize slaves with hormones.
		<<if $corpSpecTimer == 0>>
			[[Feminize|Manage Corporation][$corpSpecHormones = 1, $corpSpecTimer = 2]] | <<link "No Focus">><<unset $corpSpecHormones>><<set $corpSpecToken += 1, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<</if>>
	<<if $corpSpecAmputee == 1>>

The corporation removes all limbs from its slaves.
		<<if $corpSpecTimer == 0>>
			<<link "Stop">><<unset $corpSpecAmputee>><<set $corpSpecToken += 1, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<</if>>
	<<if $corpSpecMilk == 1>>

The corporation makes sure all slaves are naturally lactating.
		<<if $corpSpecTimer == 0>>
			[[Lactation Implant|Manage Corporation][$corpSpecMilk = 2, $corpSpecTimer = 2]] | <<link "No Focus">><<unset $corpSpecMilk>><<set $corpSpecToken += 1, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<<elseif $corpSpecMilk == 2>>

The corporation equips all slaves with lactation implants.
		<<if $corpSpecTimer == 0>>
			[[Natural Lactation|Manage Corporation][$corpSpecMilk = 1, $corpSpecTimer = 2]] | <<link "No Focus">><<unset $corpSpecMilk>><<set $corpSpecToken += 1, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<</if>>
	<<if $corpSpecSexEd == 1>>

The corporation familiarizes slaves with sexual service.
		<<if $corpSpecTimer == 0>>
			<<if $corpSpecToken > 0 && $corpDivWhoreDev > 200>>
				[[Advanced Training|Manage Corporation][$corpSpecSexEd = 2, $corpSpecToken -= 1, $corpSpecTimer = 2]] |
			<</if>>
			<<link "No Focus">><<unset $corpSpecSexEd>><<set $corpSpecToken += 1, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<<elseif $corpSpecSexEd == 2>>

The corporation teaches advanced sexual techniques to its slaves.
		<<if $corpSpecTimer == 0>>
			[[Basic Training|Manage Corporation][$corpSpecSexEd = 1, $corpSpecToken +=1, $corpSpecTimer = 2]] | <<link "No Focus">><<unset $corpSpecSexEd>><<set $corpSpecToken += 1, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<<elseif $corpSpecSexEd == 0>>

The corporation teaches no sexual techniques to its slaves.
		<<if $corpSpecTimer == 0>>
			[[Basic Training|Manage Corporation][$corpSpecSexEd = 1, $corpSpecToken -=1, $corpSpecTimer = 2]] | <<link "No Focus">><<unset $corpSpecSexEd>><<set $corpSpecToken += 1, $corpSpecTimer = 2>><<goto "Manage Corporation">><</link>>
		<</if>>
	<</if>>
<</if>> /*End of activated specializations*/

@@.orange;//Warning: Think TWICE before you click this!//@@
<<link "Dissolve the corporation">>
	<<set cashX(Math.min(corpSharePrice() * $personalShares / 1000, 1000000), "stocksTraded")>>
	<<run App.Corporate.dissolve()>>
	<<goto "Manage Corporation">>
<</link>>
@@.orange;//Warning!//@@

<</if>> /*end of incorporated or not check*/


code:
:: Dinner Party Preparations [nobr]

<<set $nextButton = "Cancel The Event", $nextLink = "Main">>

Hosting of high society dinner parties will increase your prestige significantly and it is expected for someone of your station. Since there is a lack of animal meat, human meat is served at these events to illustrate the wealth and power of the host. The success of the evening is judged by how well the human offering is prepared. Guests to these events are encouraged to rate the dishes and special dishes are expected. If the host receives 5 stars on all the dishes, they will receive the coveted title "<<if $PC.title == 1>>Master<<else>>Mistress<</if>> of The Culinary Arts". You ask $assistantName to show you a list of cooking instructions for those dishes.

Cooking Instructions and Recipes:

''Roast Long Pig'' – Made with the meat of a human roasted on a spit. Young meat is better than old meat. There should be some amount of fat to make the meat juicy, but not too much fat that makes the meat greasy. Muscles affect the texture of the meat. Meat without muscles lacks texture while an excess will be tough and hard to chew. Remember that you can't eat silicone, and virgin meat is highly sought after.<<if $seePreg != 0>> If the human is pregnant, a veal dish can also be made from the fetus.<</if>>

''Dicky Roll'' – An erect penis made into a spring roll. For best results, harvest the penis at the moment of ejaculation. The size of the penis and the amount of accumulated ejaculate all affect the quality of the dish. Too big of a dick and too thin of semen can both ruin a dish.

''Testy Meat Balls'' – Testicles made into meat balls served with a sauce. Size matters.

''Titty Tartare'' – Made from finely chopped breasts, mixed with onions, capers, and seasonings, and served raw. Big breasts make the best quality meat for this dish. To add a hint of creamy taste, make sure the breasts are lactating. Remember that you can't eat silicone.

''Camel Toe à l'Orange'' – Pussy grilled like a steak. A big clit and big labia will improve the quality of the dish.

Your assistant will take care of the invitations and all the arrangements; all you need to do is pick the meat.

__Select Your Meat:__

<<= App.UI.SlaveList.slaveSelectionList(
		s => assignmentVisible(s) && s.fuckdoll === 0,
		App.UI.SlaveList.SlaveInteract.stdInteract,
		null,
		(s, i) => {
			const p = getPronouns(s);
			return App.UI.DOM.passageLink(`Make ${p.him} the main course`, "Dinner Party Execution",
				() => { App.Utils.setActiveSlaveByIndex(i); })
		}
	)>>


code:
/**
 * @param {string} message
 * @param {number} week
 * @param {string} [category]
 */
App.Reminders.add = function(message, week, category = "manual") {
	if (message === "") { return; }
	const entry = {message: message, week: week, category: category};

	// V.reminders is sorted by week from low to high, we insert at the correct place so it remains sorted.
	const index = V.reminders.findIndex(e => e.week >= week);
	if (index === -1) {
		V.reminders.push(entry);
	} else {
		V.reminders.splice(index, 0, entry);
	}
};

/**
 * @param {number} [maxFuture] how far into the future should reminders be displayed.
 * @param {string} [category]
 * @return {string}
 */
App.Reminders.list = function list({maxFuture = Number.POSITIVE_INFINITY, category = "all"} = {}) {
	if (V.reminders.length === 0) {
		return "";
	}

	/**
	 * @param {string} c
	 * @return boolean
	 */
	let includedCategory = category === "all" ? () => true : c => c === category;

	let replace = () => App.UI.replace("#reminder", list({maxFuture: maxFuture, category: category}));

	/**
	 * @param {{}} entry
	 */
	function clearEntry(entry) {
		V.reminders.splice(V.reminders.indexOf(entry), 1);
		replace();
	}

	// We only want to remove visible entries
	function clearOverdue() {
		V.reminders = V.reminders.filter(e => e.week >= V.week && (e.week > V.week + maxFuture || !includedCategory(e.category)));
		replace();
	}

	function clearAll() {
		V.reminders = V.reminders.filter(e => e.week > V.week + maxFuture || !includedCategory(e.category));
		replace();
	}

	let r = "";

	let overdue = 0, any = false;

	V.reminders.filter(e => e.week <= V.week + maxFuture && includedCategory(e.category))
		.forEach(entry => {
			any = true;
			let week;
			let classes = "";
			if (entry.week < V.week) {
				classes = "red";
				week = `${numberWithPluralOne(-(entry.week - V.week), 'week')} ago`;
				overdue++;
			} else if (entry.week === V.week) {
				classes = "orange";
				week = "today";
			} else {
				if (entry.week <= V.week + 5) {
					classes = "green";
				}
				week = `in ${numberWithPluralOne(entry.week - V.week, 'week')}`;
			}
			r += `<div>${entry.message} <span class="${classes}">${week}.</span> ${App.UI.link("Clear", clearEntry, [entry])}</div>`;
		});

	if (overdue > 0) {
		r += `<div>${App.UI.link("Clear Overdue", clearOverdue, [])}</div>`;
	}
	if (any) {
		r += `<div>${App.UI.link("Clear All", clearAll, [])}</div>`;
	}

	return `<span id="reminder">${r}</span>`;
};

App.Reminders.addField = function() {

	function addReminder() {
		const week = Number(V.reminderWeek);

		if (Number.isNaN(week)) {
			return;
		}

		App.Reminders.add(V.reminderEntry, V.week + week);
		V.reminderEntry = "";
		V.reminderWeek = "";
	}

	let r = "<<textbox '$reminderEntry' ''>> in <<textbox '$reminderWeek' ''>> weeks.";

	return `<div>${r} ${App.UI.link("Add", addReminder, [], passage())}</div>`;
};

App.Reminders.fullDisplay = function() {
	let r = "
Reminders
";

	let list = App.Reminders.list();
	if (list !== "") {
		r += `<div class="indent">${list}</div>`;
	}

	return `${r}<h3>Add new</h3><div>${App.Reminders.addField()}</div>`;
};


code:
:: CheatEdit [nobr]

<<set $nextButton = "Back to $SF.Lower's Firebase", $nextLink = "Firebase", $returnTo = "Firebase">>
<<= App.SF.Count()>>__Upgrades__: $SF.Size/_max(<<print ($SF.Size/_max).toFixed(2)>>%)

''Firebase:'' <<textbox "$SF.Squad.Firebase" $SF.Squad.Firebase "CheatEdit">>/_FU

''Armory:'' <<textbox "$SF.Squad.Armoury" $SF.Squad.Armoury "CheatEdit">>/_AU

''Drug Lab:'' <<textbox "$SF.Squad.Drugs" $SF.Squad.Drugs "CheatEdit">>/_DrugsU
<<if $SF.Squad.Firebase >= 2>>

''Drone Bay:'' <<textbox "$SF.Squad.Drones" $SF.Squad.Drones "CheatEdit">>/_DU
<</if>>

<<if $SF.Squad.Firebase >= 1 && $terrain != "oceanic">>

''Garage:''

 ''Vehicles:''

  ''Attack:'' <<textbox "$SF.Squad.AV" $SF.Squad.AV "CheatEdit">>/_AVU

  ''Transport:'' <<textbox "$SF.Squad.TV" $SF.Squad.TV "CheatEdit">>/_TVU
	<<if _T1>>

 ''Prototype Goliath Tank:'' <<textbox "$SF.Squad.PGT" $SF.Squad.PGT "CheatEdit">>/_PGTU
	<</if>>
<</if>>

<<if $SF.Squad.Firebase >= 4>>

''Hangar:''

 ''Aircraft:''

  ''Attack:'' <<textbox "$SF.Squad.AA" $SF.Squad.AA "CheatEdit">>/_AAU

  ''Transport:'' <<textbox "$SF.Squad.TA" $SF.Squad.TA "CheatEdit">>/_TAU
	<<if _T1>>

 ''Spaceplane'': <<textbox "$SF.Squad.SpacePlane" $SF.Squad.SpacePlane "CheatEdit">>/_SPU

 ''Gunship:'' <<textbox "$SF.Squad.GunS" $SF.Squad.GunS "CheatEdit">>/_GunSU

''Launch Bay:''

 ''Satellite:'' <<textbox "$SF.Squad.Satellite.lv" $SF.Squad.Satellite.lv "CheatEdit">>/_SatU
		<<if $terrain != "oceanic">>

 ''Giant Robot:'' <<textbox "$SF.Squad.GiantRobot" $SF.Squad.GiantRobot "CheatEdit">>/_GRU
		<</if>>

 ''Cruise Missile:'' <<textbox "$SF.Squad.MissileSilo" $SF.Squad.MissileSilo "CheatEdit">>/_MSU
		<<if $terrain == "oceanic" || $terrain == "marine">>

''Naval Yard:''

 ''Aircraft Carrier:'' <<textbox "$SF.Squad.AircraftCarrier" $SF.Squad.AircraftCarrier "CheatEdit">>/_ACU

 ''Submarine:'' <<textbox "$SF.Squad.Sub" $SF.Squad.Sub "CheatEdit">>/_SubU

 ''Amphibious Transport:'' <<textbox "$SF.Squad.HAT" $SF.Squad.HAT "CheatEdit">>/_HATU
		<</if>>
	<</if>>
<</if>>


code:
:: SFColonelSexDec

<<switch $SF.Colonel.Core>>
<<case "shell shocked">>

		The entire time it is obvious that The Colonel is reliving a horrible event.

<<link "Try to bring her back">>
			<<replace "#result7">>
				"You made an attempt to try to bring her back to the present."
			<</replace>>
		<</link>>

<<link "Leave her be">>
			<<replace "#result7">>
				"It is probably better that she tries to deal with her demons alone."
			<</replace>>
		<</link>>

<<default>>
	Inset sex noises here.
<</switch>>


code:
:: Security Force Naming-Colonel [nobr]

<<set $nextButton = " ">>
<<if $SF.IntroProgress < 0>>
	<<setNonlocalPronouns $seeDicks>>
	You instruct $assistantName to announce to the arcology's citizenry that you will be making an important announcement in the near future regarding the security situation. Given the damage still present from the Daughters' attack, everyone will be tuning in. You also instruct your assistant to begin quietly investigating potential leadership figures for the force itself.
	It's been a short while since you told your citizens that you were going to talk to them about their security, and by all accounts, they've turned out in force to watch your address over the arcology's internal communications system. You wake up early, relieve your frustrations on a few slaves woken out of deep sleep, and take position behind your desk. You also call over a slave and push _himU under your desk. The unspoken instruction is clear, and _heU begins enthusiastically
	<<if $PC.dick > 0>>
		sucking your cock, taking it as deep as _heU can without gagging.
	<<else>>
		eating you out, pressing _hisU face into your pussy and forcing _hisU tongue deep inside you.
	<</if>>

	A blinking light tells you that the channel is open. You take a deep breath, and begin. You greet your citizens and explain that while you believe deeply in the underlying principles of the Free Cities, recent events have forced you to modify some of your views. The old world attack from the outside and the more recent assault by the Daughters of Liberty from within has proven that some form of permanent, organized standing force is needed to ensure the personal safety of the citizen body.

	You tell them that the old world continues to deteriorate. You tell them that it is only a matter of time before the poor, diseased, starving, and unwashed masses try their hand at invading the arcology again. You tell them that such a force would be good for business, securing trade routes and conducting slaving raids far greater in scale than those performed by private slaving corporations. And finally, to quell their greatest fear, you tell them that you would personally support the force financially.

	As you speak, you carefully monitor the citizens' opinions as indicated on their communication devices. It is uniformly positive — they know whom they have to thank for their continued survival and dominance. You also monitor your arousal given the ministrations of your slave. A few small movements on your part communicate to your citizens what is happening without being too obvious. Free Cities business etiquette respects business conducted while being subtly serviced (and your doing so during such a public and important broadcast signals how seriously you are taking it), but a climax would be seen as a serious lack of discipline.

	You finally wrap up your speech, declaring yourself Marshal of the newly-formed <<textbox "$SF.Lower" $SF.Lower "Security Force Naming-Colonel">>

	You close the link to the communication system and read a message from your assistant that appeared during the last moments of your address. In consultation with major figures in the mercenary community, a suitable candidate for day-to-day command of the new unit has been found. Your instructions were to keep you in the dark about them so as to avoid prejudgment. They are waiting outside your office.

	[[Invite them inside|Security Force Naming-Colonel][$SF.IntroProgress = 1]]
<<elseif $SF.IntroProgress < 2>>
	The figure that enters is not what you were expecting, given your previous experiences with the mercenary groups that work with the arcology owners of the Free Cities. Most mercenaries you've worked with have been grizzled stout men, veterans of the old world militaries that finally had too much and went private. Instead, a woman walks in.
	<<if $SF.Colonel.Core === "">>
		She strikes you as someone who is likely to be:

[[Kind|Security Force Naming-Colonel][$SF.Colonel.Core = "kind"]]

[[Cruel and psychopathic|Security Force Naming-Colonel][$SF.Colonel.Core = "cruel"]]

[[A brazen warmonger|Security Force Naming-Colonel][$SF.Colonel.Core = "brazen"]]

[[Jaded|Security Force Naming-Colonel][$SF.Colonel.Core = "jaded"]]

[[Shell-shocked|Security Force Naming-Colonel][$SF.Colonel.Core = "shell shocked"]]
	<<else>>
		<<setNonlocalPronouns $seeDicks>>
		She is likely to be ''$SF.Colonel.Core''.

		She strides in, stopping in front of your desk,
		<<switch $SF.Colonel.Core>>
		<<case "kind">>
			pulling off a laid-back salute with an easy grin.
		<<case "cruel">>
			her eyes flashing a hard glare in an instant before quickly softening into those of someone who wants something you have.
		<<case "brazen">>
			snapping off a textbook salute that decades of hard service grills into a veteran.
		<<default>>
			not bothering to put on even the semi-military air (complete with salute) that most mercenaries tend to adopt when meeting new clients.
		<</switch>>
		She is very tall and wearing the pants, boots, gloves, and the tank top undershirt of a standard female combat uniform. Her bare arms and upper body are corded with muscle, and through the tank top's thin fabric you can see both the shape of her muscled abdomen and the curves of her small but perky breasts, complete with what your experience tells you are barbell nipple piercings. Her eyes are alive with intelligence, and you can see her scanning your office, clearly impressed by its opulence. Her hair is shaved close to the scalp, and her ears and nose are heavily pierced. You can make out three long, ugly scars running over top of the mottled tissue of a previous, severe burn along one side of her face, as well as numerous smaller scars and burns on her bare arms. She's been disarmed prior to meeting you; the pistol holster on her hip lies empty, as do at least three knife holsters about her person.

		Returning your gaze to her face, she crosses her arms underneath her chest, pressing her breasts up and forward. You have her measure. Given the generally patriarchal nature of both the mercenary community, and the same nature combined with the heavily sexualized lifestyle of the Free Cities, she's decided to embrace her position rather than fight it.

		"So," she begins, "you're the boss." You invite her to sit down. "No thanks, boss. Besides," she
		<<switch $SF.Colonel.Core>>
			<<case "kind">> playfully
			<<case "shell shocked">> uncomfortably
		<</switch>>
		indicates the slave under your desk, "you look a little occupied." She nods at the camera across from you. "Saw the speech. Very nice. I'd heard you crazy bastards do business while getting
		<<if $PC.dick > 0>>sucked off<<else>>eaten out<</if>>,
		but I've never seen anyone actually do it. Hell, most of you people don't want to have to have too much to do with a merc like me. I usually get my instructions remotely."
		<<switch $SF.Colonel.Core>>
		<<case "brazen" "jaded">>
			A short, harsh laugh escapes her. "But I guess it keeps you focused. Can't have the entire arcology seeing you cum."
		<<case "kind">>
			She grins. "That kind of thing doesn't really bother me though."
		<<case "cruel">>
			She frowns. "The client always seems to be happier that way."
		<</switch>>

		She moves a step closer. "Your computer-helper-thing told me you wanted me to be a surprise, so I guess I'll tell you why you want me to run $SF.Lower for you. I'm a killer, pure and simple,<<if $SF.Colonel.Core === "cruel">>" she smiles, "<</if>>and you need that. I looked into those attacks you've suffered. Nasty business. I'll make sure that an attack like that never happens again. I was a soldier out there, in charge of about a thousand men when the Free Cities first started going up, and I knew they were the future. Eventually I deserted, found the first refugee convoy I could, killed the moron protecting it, sold the girls off to slavers, and bought enough gear to start killing for people like you. Ran my own merc crew, did well till we tried to take on a bigger one and everyone died."
		<<switch $SF.Colonel.Core>>
		<<case "shell shocked">>
			She looks away, caught in her own memories. It takes a solid minute before she starts again.
		<<case "cruel">>
			Her smile grows.
		<<default>>
			She pauses for a moment.
		<</switch>>
		"Joined with another big outfit, became the number two, then shit went bad and I had to run. Been a solo fighter and slaver ever since. I know my work, and I know I can make this work."

		You feel your climax approaching and hold up a finger. The merc pauses while you grab the slave's head
		<<if $PC.dick > 0>>
			then force your cock roughly down _hisU throat while you cum. _HeU swallows as much as _heU can before pulling
		<<else>>
			tightly with your thighs, pressing _hisU face tightly against your pussy as you cum. When you release _himU, _heU pulls
		<</if>>
		away, coughing.

		<<if $SF.Colonel.Core === "shell shocked">>
			The merc looks away again, letting the _girlU settle down before continuing.
		<<else>>
			The merc laughs again. "I could get used to a place like this."
		<</if>>
		She waves her hand around the office. "I bet you want to know why I'd be trustworthy for something like this." You don't correct her. "Thought so." Her demeanor softens, and you can detect a hit of nervousness. "I would say that I've never turned on a client and leave it at that, but this is different. It's getting worse out there. I'm sure you know that." You give her a slight nod. "Four times now I've woken up in the middle of the night and had to kill
		<<if $SF.Colonel.Core == "shell shocked">>
			someone."
		<<else>>
			someone. Two of them were the people I'd taken to bed. You can't even trust your drunken fucks anymore.
			<<switch $SF.Colonel.Core>>
			<<case "kind">>
				It's a shame, but that's the world we live in."
			<<case "cruel">>
				Then again, who doesn't like a good hard fuck and stab?"
			<<default>>
				But what else is new?"
			<</switch>>
		<</if>>

		<<if $SF.Colonel.Core == "jaded" || $SF.Colonel.Core == "shell shocked">>
			"All I know how to do at this point is fight, and that's kept me alive this far.
		<<else>>
			"I like fighting, but I want to live somewhere where I can relax from life out there.
		<</if>>
		You give me the job and a place to live, let me hang up the uncertainty of being a merc, and I'll die for you if it comes to that. I promise the people I recruit will feel the same. Besides," she grins, "I could get used to
		<<switch $SF.Colonel.Core>>
		<<case "brazen">>
			crushing any enemy that looks our way."
		<<case "cruel">>
			<<setNonlocalPronouns $seeDicks>>
			having my own stable to abuse as I see fit. A terrified little slave<<= _girlU>> locked between my legs, struggling to breathe?"
		<<default>>
			spending my R&R time with a cold beer in one hand, a few lines of coke or a stack of pills in front of me."
		<</switch>>
		A glint runs through her eyes. "Sounds like a good fucking time."

		You quickly decide she'll do. You tap a few commands on your desk's console, assigning her personal quarters on the arcology's higher levels and transferring her first stipend to her new account. You also ask her what title she wants.

		"Title?" Another short laugh. "I guess I do need one, given that I'm all official and shit now." She thinks for a moment. "I was a major before I went freelance, and I think I'd like a promotion. Colonel sounds good." You make a note of this in her file. "You people don't seal contracts with a fuck do you?" Reassuring her you don't, she laughs again. "Good. I make it a point never to fuck the boss. It's bad for business." She turns around. "Well, I guess I'd better get to it. Your helper-thing assigned me space on the lower levels for the firebase. I brought a few squads of guys I know from the old days to start, but we'll grow fast once I put the word out, I guarantee it."

		[[Let her leave|Security Force Naming-Colonel][$SF.IntroProgress = 2]]
	<</if>>
<<elseif $SF.IntroProgress < 3>> <<set $nextLink = "RIE Eligibility Check",$nextButton = "Continue">>
	She turns and leaves, and you chase the slave out after her. A few minutes later, a soft chime announces the arrival of a message. It's from the Colonel.

	//Hey boss, just wanted to mention something else. In your speech you said that you were going to be paying for $SF.Lower. In my mind that means it's yours, no matter what anyone else here might think. I do what you tell me to do. I make sure the troops behave as you want them to behave. I've worked for some 'nice guys' in the past, and I can do that job if you want. It's boring, but sustainable, and I'll have $SF.Lower turning a profit and supporting the arcology in good order. But if you let me <<if $SF.Colonel.Core === "cruel">>off the leash<<else>>do what I do<</if>> and throw any old world complaints in the trash where they belong, I promise you'll have money pouring into your coffers, even accounting for the good amounts me and my boys will pocket along the way. You'll have an empire in short order.
	<<if $mercenaries > 1>>
		Either way, I'll keep my hands off those mercs you've already installed. I figure that you've reasons for having two different death squads under contract.
	<</if>>

	Oh, one last thing. I know you've got some kind of grand social experiment going on up there like all the other arc owners, and that's your own deal, but I'd appreciate it if you could keep that stuff out of the new barracks. I'll have a hard time approaching potential recruits and telling them they should come live in a Roman apartment, an Egyptian temple, a goddamn Japanese teahouse, or some of the other crazy shit I've seen in the past. They're hard, nasty people, and trust me, I can tell you from experience that changing that is just not going to happen. Like I said, though, I can hold them back a bit if you like.

	Talk to you later, boss.//
<</if>>