From ab5ec0b4acb7cb151e17d6a73205fcb5606d8d46 Mon Sep 17 00:00:00 2001
From: Svornost <11434-svornost@users.noreply.gitgud.io>
Date: Thu, 16 Jul 2020 14:03:15 -0700
Subject: [PATCH] Prevent heavily-influenced arcologies from occasionally
 adopting too many FSes.

---
 src/uncategorized/neighborsFSAdoption.tw | 60 ++++++++++++------------
 1 file changed, 31 insertions(+), 29 deletions(-)

diff --git a/src/uncategorized/neighborsFSAdoption.tw b/src/uncategorized/neighborsFSAdoption.tw
index 69cf45e9b1e..ac1b969e1e8 100644
--- a/src/uncategorized/neighborsFSAdoption.tw
+++ b/src/uncategorized/neighborsFSAdoption.tw
@@ -862,6 +862,7 @@ societal development.
 
 /* NEIGHBOR ADOPTION*/
 
+<<if _adopted == 0>>
 <<for $j = 0; $j < $arcologies.length; $j++>>
 	<<if $arcologies[$i].direction != $arcologies[$j].direction>>
 
@@ -882,7 +883,7 @@ societal development.
 
 		<<if ($arcologies[$i].FSSubjugationist == "unset")>>
 			<<if ($arcologies[$i].FSSupremacist == "unset") || ($arcologies[$i].FSSupremacistRace != $arcologies[$j].FSSubjugationistRace)>>
-				<<if $arcologies[$j].FSSubjugationist > random(0,200)+(_adopted*100)-_influenceBonus>>
+				<<if $arcologies[$j].FSSubjugationist > random(0,200)-_influenceBonus>>
 					It @@.yellow;adopts $arcologies[$j].FSSubjugationistRace Subjugation@@ due to influence from its trading partner $arcologies[$j].name.
 					<<set $arcologies[$i].FSSubjugationist = 5>><<set _adopted = 1>>
 					<<set $arcologies[$i].FSSubjugationistRace = $arcologies[$j].FSSubjugationistRace>>
@@ -892,7 +893,7 @@ societal development.
 		<</if>>
 		<<if ($arcologies[$i].FSSupremacist == "unset")>>
 			<<if ($arcologies[$i].FSSubjugationist == "unset") || ($arcologies[$i].FSSubjugationistRace != $arcologies[$j].FSSupremacistRace)>>
-				<<if $arcologies[$j].FSSupremacist > random(0,200)+(_adopted*100)-_influenceBonus>>
+				<<if $arcologies[$j].FSSupremacist > random(0,200)-_influenceBonus>>
 					It @@.yellow;adopts $arcologies[$j].FSSupremacistRace Supremacy@@ due to influence from its trading partner $arcologies[$j].name.
 					<<set $arcologies[$i].FSSupremacist = 5>><<set _adopted = 1>>
 					<<set $arcologies[$i].FSSupremacistRace = $arcologies[$j].FSSupremacistRace>>
@@ -901,159 +902,159 @@ societal development.
 			<</if>>
 		<</if>>
 		<<if ($arcologies[$i].FSRepopulationFocus == "unset") && ($arcologies[$i].FSRestart == "unset") && ($seePreg == 1)>>
-			<<if $arcologies[$j].FSRepopulationFocus > random(0,200)+(_adopted*100)-_influenceBonus>>
+			<<if $arcologies[$j].FSRepopulationFocus > random(0,200)-_influenceBonus>>
 				It @@.yellow;adopts Repopulation@@ due to influence from its trading partner $arcologies[$j].name.
 				<<set $arcologies[$i].FSRepopulationFocus = 5>><<set _adopted = 1>>
 				<<break>>
 			<</if>>
-			<<if $arcologies[$j].FSRestart > random(0,200)+(_adopted*100)-_influenceBonus>>
+			<<if $arcologies[$j].FSRestart > random(0,200)-_influenceBonus>>
 				It @@.yellow;adopts Eugenics@@ due to influence from its trading partner $arcologies[$j].name.
 				<<set $arcologies[$i].FSRestart = 5>><<set _adopted = 1>>
 				<<break>>
 			<</if>>
 		<</if>>
 		<<if ($arcologies[$i].FSGenderRadicalist == "unset") && ($arcologies[$i].FSGenderFundamentalist == "unset")>>
-			<<if $arcologies[$j].FSGenderRadicalist > random(0,200)+(_adopted*100)-_influenceBonus>>
+			<<if $arcologies[$j].FSGenderRadicalist > random(0,200)-_influenceBonus>>
 				It @@.yellow;adopts Gender Radicalism@@ due to influence from its trading partner $arcologies[$j].name.
 				<<set $arcologies[$i].FSGenderRadicalist = 5>><<set _adopted = 1>>
 				<<break>>
 			<</if>>
-			<<if $arcologies[$j].FSGenderFundamentalist > random(0,200)+(_adopted*100)-_influenceBonus>>
+			<<if $arcologies[$j].FSGenderFundamentalist > random(0,200)-_influenceBonus>>
 				It @@.yellow;adopts Gender Fundamentalism@@ due to influence from its trading partner $arcologies[$j].name.
 				<<set $arcologies[$i].FSGenderFundamentalist = 5>><<set _adopted = 1>>
 				<<break>>
 			<</if>>
 		<</if>>
 		<<if ($arcologies[$i].FSPaternalist == "unset") && ($arcologies[$i].FSDegradationist == "unset")>>
-			<<if $arcologies[$j].FSPaternalist > random(0,200)+(_adopted*100)-_influenceBonus>>
+			<<if $arcologies[$j].FSPaternalist > random(0,200)-_influenceBonus>>
 				It @@.yellow;adopts Paternalism@@ due to influence from its trading partner $arcologies[$j].name.
 				<<set $arcologies[$i].FSPaternalist = 5>><<set _adopted = 1>>
 				<<break>>
 			<</if>>
-			<<if $arcologies[$j].FSDegradationist > random(0,200)+(_adopted*100)-_influenceBonus>>
+			<<if $arcologies[$j].FSDegradationist > random(0,200)-_influenceBonus>>
 				It @@.yellow;adopts Degradationism@@ due to influence from its trading partner $arcologies[$j].name.
 				<<set $arcologies[$i].FSDegradationist = 5>><<set _adopted = 1>>
 				<<break>>
 			<</if>>
 		<</if>>
 		<<if ($arcologies[$i].FSIntellectualDependency == "unset") && ($arcologies[$i].FSSlaveProfessionalism == "unset")>>
-			<<if $arcologies[$j].FSIntellectualDependency > random(0,200)+(_adopted*100)-_influenceBonus>>
+			<<if $arcologies[$j].FSIntellectualDependency > random(0,200)-_influenceBonus>>
 				It @@.yellow;adopts Intellectual Dependency@@ due to influence from its trading partner $arcologies[$j].name.
 				<<set $arcologies[$i].FSIntellectualDependency = 5>><<set _adopted = 1>>
 				<<break>>
 			<</if>>
-			<<if $arcologies[$j].FSSlaveProfessionalism > random(0,200)+(_adopted*100)-_influenceBonus>>
+			<<if $arcologies[$j].FSSlaveProfessionalism > random(0,200)-_influenceBonus>>
 				It @@.yellow;adopts Slave Professionalism@@ due to influence from its trading partner $arcologies[$j].name.
 				<<set $arcologies[$i].FSSlaveProfessionalism = 5>><<set _adopted = 1>>
 				<<break>>
 			<</if>>
 		<</if>>
 		<<if ($arcologies[$i].FSBodyPurist == "unset") && ($arcologies[$i].FSTransformationFetishist == "unset")>>
-			<<if $arcologies[$j].FSBodyPurist > random(0,200)+(_adopted*100)-_influenceBonus>>
+			<<if $arcologies[$j].FSBodyPurist > random(0,200)-_influenceBonus>>
 				It @@.yellow;adopts Body Purism@@ due to influence from its trading partner $arcologies[$j].name.
 				<<set $arcologies[$i].FSBodyPurist = 5>><<set _adopted = 1>>
 				<<break>>
 			<</if>>
-			<<if $arcologies[$j].FSTransformationFetishist > random(0,200)+(_adopted*100)-_influenceBonus>>
+			<<if $arcologies[$j].FSTransformationFetishist > random(0,200)-_influenceBonus>>
 				It @@.yellow;adopts Transformation Fetishism@@ due to influence from its trading partner $arcologies[$j].name.
 				<<set $arcologies[$i].FSTransformationFetishist = 5>><<set _adopted = 1>>
 				<<break>>
 			<</if>>
 		<</if>>
 		<<if ($arcologies[$i].FSYouthPreferentialist == "unset") && ($arcologies[$i].FSMaturityPreferentialist == "unset")>>
-			<<if $arcologies[$j].FSYouthPreferentialist > random(0,200)+(_adopted*100)-_influenceBonus>>
+			<<if $arcologies[$j].FSYouthPreferentialist > random(0,200)-_influenceBonus>>
 				It @@.yellow;adopts Youth Preferentialism@@ due to influence from its trading partner $arcologies[$j].name.
 				<<set $arcologies[$i].FSYouthPreferentialist = 5>><<set _adopted = 1>>
 				<<break>>
 			<</if>>
-			<<if $arcologies[$j].FSMaturityPreferentialist > random(0,200)+(_adopted*100)-_influenceBonus>>
+			<<if $arcologies[$j].FSMaturityPreferentialist > random(0,200)-_influenceBonus>>
 				It @@.yellow;adopts Maturity Preferentialism@@ due to influence from its trading partner $arcologies[$j].name.
 				<<set $arcologies[$i].FSMaturityPreferentialist = 5>><<set _adopted = 1>>
 				<<break>>
 			<</if>>
 		<</if>>
 		<<if ($arcologies[$i].FSPetiteAdmiration == "unset") && ($arcologies[$i].FSStatuesqueGlorification == "unset")>>
-			<<if $arcologies[$j].FSPetiteAdmiration > random(0,200)+(_adopted*100)-_influenceBonus>>
+			<<if $arcologies[$j].FSPetiteAdmiration > random(0,200)-_influenceBonus>>
 				It @@.yellow;adopts Petite Admiration@@ due to influence from its trading partner $arcologies[$j].name.
 				<<set $arcologies[$i].FSPetiteAdmiration = 5>><<set _adopted = 1>>
 				<<break>>
 			<</if>>
-			<<if $arcologies[$j].FSStatuesqueGlorification > random(0,200)+(_adopted*100)-_influenceBonus>>
+			<<if $arcologies[$j].FSStatuesqueGlorification > random(0,200)-_influenceBonus>>
 				It @@.yellow;adopts Statuesque Glorification@@ due to influence from its trading partner $arcologies[$j].name.
 				<<set $arcologies[$i].FSStatuesqueGlorification = 5>><<set _adopted = 1>>
 				<<break>>
 			<</if>>
 		<</if>>
 		<<if ($arcologies[$i].FSSlimnessEnthusiast == "unset") && ($arcologies[$i].FSAssetExpansionist == "unset")>>
-			<<if $arcologies[$j].FSSlimnessEnthusiast > random(0,200)+(_adopted*100)-_influenceBonus>>
+			<<if $arcologies[$j].FSSlimnessEnthusiast > random(0,200)-_influenceBonus>>
 				It @@.yellow;adopts Slimness Enthusiasm@@ due to influence from its trading partner $arcologies[$j].name.
 				<<set $arcologies[$i].FSSlimnessEnthusiast = 5>><<set _adopted = 1>>
 				<<break>>
 			<</if>>
-			<<if $arcologies[$j].FSAssetExpansionist > random(0,200)+(_adopted*100)-_influenceBonus>>
+			<<if $arcologies[$j].FSAssetExpansionist > random(0,200)-_influenceBonus>>
 				It @@.yellow;adopts Asset Expansionism@@ due to influence from its trading partner $arcologies[$j].name.
 				<<set $arcologies[$i].FSAssetExpansionist = 5>><<set _adopted = 1>>
 				<<break>>
 			<</if>>
 		<</if>>
 		<<if ($arcologies[$i].FSPastoralist == "unset") && ($arcologies[$i].FSCummunism == "unset")>>
-			<<if $arcologies[$j].FSPastoralist > random(0,200)+(_adopted*100)-_influenceBonus>>
+			<<if $arcologies[$j].FSPastoralist > random(0,200)-_influenceBonus>>
 				It @@.yellow;adopts Pastoralism@@ due to influence from its trading partner $arcologies[$j].name.
 				<<set $arcologies[$i].FSPastoralist = 5>><<set _adopted = 1>>
 				<<break>>
 			<</if>>
-			<<if $arcologies[$j].FSCummunism > random(0,200)+(_adopted*100)-_influenceBonus>>
+			<<if $arcologies[$j].FSCummunism > random(0,200)-_influenceBonus>>
 				It @@.yellow;adopts Cummunism@@ due to influence from its trading partner $arcologies[$j].name.
 				<<set $arcologies[$i].FSCummunism = 5>><<set _adopted = 1>>
 				<<break>>
 			<</if>>
 		<</if>>
 		<<if ($arcologies[$i].FSHedonisticDecadence == "unset") && ($arcologies[$i].FSPhysicalIdealist == "unset")>>
-			<<if $arcologies[$j].FSHedonisticDecadence > random(0,200)+(_adopted*100)-_influenceBonus>>
+			<<if $arcologies[$j].FSHedonisticDecadence > random(0,200)-_influenceBonus>>
 				It @@.yellow;adopts Decadent Hedonism@@ due to influence from its trading partner $arcologies[$j].name.
 				<<set $arcologies[$i].FSHedonisticDecadence = 5>><<set _adopted = 1>>
 				<<break>>
 			<</if>>
-			<<if $arcologies[$j].FSPhysicalIdealist > random(0,200)+(_adopted*100)-_influenceBonus>>
+			<<if $arcologies[$j].FSPhysicalIdealist > random(0,200)-_influenceBonus>>
 				It @@.yellow;adopts Physical Idealism@@ due to influence from its trading partner $arcologies[$j].name.
 				<<set $arcologies[$i].FSPhysicalIdealist = 5>><<set _adopted = 1>>
 				<<break>>
 			<</if>>
 		<</if>>
 		<<if ($arcologies[$i].FSChattelReligionist == "unset") && ($arcologies[$i].FSNull == "unset")>>
-			<<if $arcologies[$j].FSChattelReligionist > random(0,200)+(_adopted*100)-_influenceBonus>>
+			<<if $arcologies[$j].FSChattelReligionist > random(0,200)-_influenceBonus>>
 				It @@.yellow;adopts Chattel Religionism@@ due to influence from its trading partner $arcologies[$j].name.
 				<<set $arcologies[$i].FSChattelReligionist = 5>><<set _adopted = 1>>
 				<<break>>
 			<</if>>
 		<</if>>
 		<<if ($arcologies[$i].FSRomanRevivalist == "unset") && ($arcologies[$i].FSAztecRevivalist == "unset") && ($arcologies[$i].FSEgyptianRevivalist == "unset") && ($arcologies[$i].FSEdoRevivalist == "unset") && ($arcologies[$i].FSArabianRevivalist == "unset") && ($arcologies[$i].FSChineseRevivalist == "unset")>>
-			<<if $arcologies[$j].FSRomanRevivalist > random(0,200)+(_adopted*100)-_influenceBonus>>
+			<<if $arcologies[$j].FSRomanRevivalist > random(0,200)-_influenceBonus>>
 				It @@.yellow;adopts Roman Revivalism@@ due to influence from its trading partner $arcologies[$j].name.
 				<<set $arcologies[$i].FSRomanRevivalist = 5>><<set _adopted = 1>>
 				<<break>>
 			<</if>>
-			<<if $arcologies[$j].FSAztecRevivalist > random(0,200)+(_adopted*100)-_influenceBonus>>
+			<<if $arcologies[$j].FSAztecRevivalist > random(0,200)-_influenceBonus>>
 				It @@.yellow;adopts Aztec Revivalism@@ due to influence from its trading partner $arcologies[$j].name.
 				<<set $arcologies[$i].FSAztecRevivalist = 5>><<set _adopted = 1>>
 				<<break>>
 			<</if>>
-			<<if $arcologies[$j].FSEgyptianRevivalist > random(0,200)+(_adopted*100)-_influenceBonus>>
+			<<if $arcologies[$j].FSEgyptianRevivalist > random(0,200)-_influenceBonus>>
 				It @@.yellow;adopts Egyptian Revivalism@@ due to influence from its trading partner $arcologies[$j].name.
 				<<set $arcologies[$i].FSEgyptianRevivalist = 5>><<set _adopted = 1>>
 				<<break>>
 			<</if>>
-			<<if $arcologies[$j].FSEdoRevivalist > random(0,200)+(_adopted*100)-_influenceBonus>>
+			<<if $arcologies[$j].FSEdoRevivalist > random(0,200)-_influenceBonus>>
 				It @@.yellow;adopts Edo Revivalism@@ due to influence from its trading partner $arcologies[$j].name.
 				<<set $arcologies[$i].FSEdoRevivalist = 5>><<set _adopted = 1>>
 				<<break>>
 			<</if>>
-			<<if $arcologies[$j].FSArabianRevivalist > random(0,200)+(_adopted*100)-_influenceBonus>>
+			<<if $arcologies[$j].FSArabianRevivalist > random(0,200)-_influenceBonus>>
 				It @@.yellow;adopts Arabian Revivalism@@ due to influence from its trading partner $arcologies[$j].name.
 				<<set $arcologies[$i].FSArabianRevivalist = 5>><<set _adopted = 1>>
 				<<break>>
 			<</if>>
-			<<if $arcologies[$j].FSChineseRevivalist > random(0,200)+(_adopted*100)-_influenceBonus>>
+			<<if $arcologies[$j].FSChineseRevivalist > random(0,200)-_influenceBonus>>
 				It @@.yellow;adopts Chinese Revivalism@@ due to influence from its trading partner $arcologies[$j].name.
 				<<set $arcologies[$i].FSChineseRevivalist = 5>><<set _adopted = 1>>
 				<<break>>
@@ -1061,6 +1062,7 @@ societal development.
 		<</if>>
 	<</if>>
 <</for>>
+<</if>>
 
 /* RANDOM ADOPTION*/
 
-- 
GitLab