Skip to content
Snippets Groups Projects
Commit 0d149bb1 authored by Jones's avatar Jones
Browse files

Descriptions for NPCSlaves sold or bought and a tweak in case there's more slaves than work.

parent a068e7e1
No related branches found
No related tags found
1 merge request!3037NPCSlaves selling and buying descriptions
......@@ -657,31 +657,59 @@ $lowerClass -= _enslaved>>
/*Demand for owning slaves*/
_SCD = Math.trunc(($upperClass * ($slaveDemandU + _slaveDemandU)) + ($topClass * ($slaveDemandT + _slaveDemandT)))>>
/*More slaves than there is work*/
<<if $NPCSlaves > _LSCD / $slaveProductivity>>
<<set $menialDemandFactor -= $NPCSlaves - Math.trunc(_LSCD / ($slaveProductivity + _slaveProductivity)),
<<if $NPCSlaves > (_LSCD / ($slaveProductivity + _slaveProductivity)) - $helots + _SCD>>
<<set _NPCSlavesSold = $NPCSlaves - Math.trunc(_LSCD / ($slaveProductivity + _slaveProductivity) - $helots + _SCD),
$menialDemandFactor -= _NPCSlavesSold,
$NPCSlaves = Math.trunc(_LSCD / ($slaveProductivity + _slaveProductivity))>>
<<if _NPCSlavesSold > 1>>
<br>@@.red;<<print _NPCSlavesSold>> Slaves@@ were sold by your inhabitants. There was no work for them.
<<elseif _NPCSlavesSold > 0>>
<br>@@.red;One slave was sold by your inhabitants. There was no work for it.
<</if>>
/*More slaves than they know what to do with*/
<<elseif $NPCSlaves > _SCD * 1.6>>
<<set $menialDemandFactor -= $NPCSlaves - Math.trunc(_SCD * 1.6),
<<set _NPCSlavesSold = $NPCSlaves - Math.trunc(_SCD * 1.6),
$menialDemandFactor -= _NPCSlavesSold,
$NPCSlaves = Math.trunc(_SCD * 1.6)>>
<<if _NPCSlavesSold > 1>>
<br>@@.red;<<print _NPCSlavesSold>> Slaves@@ were sold by your inhabitants. They've got more than enough of them already.
<<elseif _NPCSlavesSold > 0>>
<br>@@.red;One slave@@ was sold by your inhabitants. They've got more than enough of them already.
<</if>>
/*Cutting back on slaves*/
<<elseif $NPCSlaves > _SCD * 1.4>>
<<if $slaveCostFactor > 0.95>>
<<set $menialDemandFactor -= Math.trunc(($NPCSlaves - _SCD) * 0.4),
$NPCSlaves -= Math.trunc(($NPCSlaves - _SCD) * 0.4)>>
<<set _NPCSlavesSold = Math.trunc(($NPCSlaves - _SCD) * 0.4),
$menialDemandFactor -= _NPCSlavesSold,
$NPCSlaves -= _NPCSlavesSold>>
<<if _NPCSlavesSold > 1>>
<br>@@.red;<<print _NPCSlavesSold>> Slaves were sold by your inhabitants. They've got more than enough of them already.
<<elseif _NPCSlavesSold > 0>>
<br>@@.red;One slave was sold by your inhabitants. They've got more than enough of them already.
</if>
<</if>>
/*Selling excess slaves for profit*/
<<elseif $NPCSlaves > _SCD * 1.2>>
<<if $slaveCostFactor > 1.1>>
<<set $menialDemandFactor -= Math.trunc(($NPCSlaves - _SCD) * 0.4),
$NPCSlaves -= Math.trunc(($NPCSlaves - _SCD) * 0.4)>>
<<set _NPCSlavesSold = Math.trunc(($NPCSlaves - _SCD) * 0.4),
$menialDemandFactor -= _NPCSlavesSold,
$NPCSlaves -= _NPCSlavesSold>>
<<if _NPCSlavesSold > 1>>
<br>@@.red;<<print _NPCSlavesSold>> Slaves were sold by your inhabitants. They saw an opportunity for profit.
<<elseif _NPCSlavesSold > 0>>
<br>@@.red;One slave was sold by your inhabitants. They saw an opportunity for profit.
</if>
<</if>>
<</if>>
/*Buying slaves because they are really cheap*/
<<if $slaveCostFactor < 0.8>>
<<if $NPCSlaves < _SCD * 1.5>>
<<set $menialSupplyFactor -= Math.trunc(_SCD * 0.05),
$NPCSlaves += Math.trunc(_SCD * 0.05)>>
<<set _NPCSlavesBought = Math.trunc(_SCD * 0.05),
$menialSupplyFactor -= _NPCSlavesBought,
$NPCSlaves += _NPCSlavesBought>>
<<if _NPCSlavesBought > 1>>
<br>@@.green;<<print _NPCSlavesBought>> Slaves were bought by your inhabitants. They were too cheap to pass up on.
<</if>> /*there's no way this ever ends up needing a 1 slave version*/
<</if>>
<</if>>
......@@ -935,13 +963,18 @@ This week, rents from $arcologies[0].name came to @@.yellowgreen;<<print cashFor
<<set _earnings = 0>>
You own
<<if $helots > 0>>
<<set _earnings += $helots*10>>
<<if $Sweatshops > 0>>
<<if $Sweatshops*500 <= $helots>>
<<set _earnings += $Sweatshops*7000>>
<<set _earnings += ($helots-$Sweatshops*500)*10>>
<<else>>
<<set _earnings += $helots*10>>
<<if $helots > Math.trunc((_LSCD / ($slaveProductivity + _slaveProductivity) - _SCD)>>
<<set _earnings += Math.trunc((_LSCD / ($slaveProductivity + _slaveProductivity) - _SCD) * 10>>
<br>@@.red;more menial slaves than there was work@@, consider selling some. You own
<<else>>
<<set _earnings += $helots*10>>
<<if $Sweatshops > 0>>
<<if $Sweatshops*500 <= $helots>>
<<set _earnings += $Sweatshops*7000>>
<<set _earnings += ($helots-$Sweatshops*500)*10>>
<<else>>
<<set _earnings += $helots*10>>
<</if>>
<</if>>
<</if>>
<<if $helots > 1>> <<print commaNum($helots)>> menial slaves<<if ($menialBioreactors > 0) && ($fuckdolls == 0)>> and<<else>>,<</if>><<else>>one menial slave<<if ($menialBioreactors > 0) && ($fuckdolls == 0)>> and<<else>>,<</if>><</if>>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment