From 68808a1b41b214eb3d957a365b1fa97a126965ba Mon Sep 17 00:00:00 2001 From: lowercasedonkey <lowercasedonkey@gmail.com> Date: Mon, 7 Dec 2020 11:40:17 -0500 Subject: [PATCH] better FS removal --- src/endWeek/economics/fsDevelopments.js | 92 +++++++++---------------- 1 file changed, 34 insertions(+), 58 deletions(-) diff --git a/src/endWeek/economics/fsDevelopments.js b/src/endWeek/economics/fsDevelopments.js index ede2aabb215..703bc5959c5 100644 --- a/src/endWeek/economics/fsDevelopments.js +++ b/src/endWeek/economics/fsDevelopments.js @@ -543,8 +543,7 @@ App.EndWeek.FSDevelopments = function() { V.independenceDay = 1; } if (V.arcologies[0].FSSupremacist < 0) { - FutureSocieties.remove("FSSupremacist"); - r.push(`<span class="red">Your future society project has failed:</span> your citizens were repelled from your idea more than they were attracted to it. <span class="yellow">You may select another option, or elect to try again.</span>`); + r.push(removeFS("FSSupremacist")); } else if (V.arcologies[0].FSSupremacist > V.arcologies[0].FSSupremacistDecoration) { V.arcologies[0].FSSupremacist = V.arcologies[0].FSSupremacistDecoration; } @@ -561,8 +560,7 @@ App.EndWeek.FSDevelopments = function() { if (V.arcologies[0].FSSubjugationist !== "unset") { r.push(arcSupport("FSSubjugationist")); if (V.arcologies[0].FSSubjugationist < 0) { - FutureSocieties.remove("FSSubjugationist"); - r.push(`<span class="red">Your future society project has failed:</span> your citizens were repelled from your idea more than they were attracted to it. <span class="yellow">You may select another option, or elect to try again.</span>`); + r.push(removeFS("FSSubjugationist")); } else if (V.arcologies[0].FSSubjugationist > V.arcologies[0].FSSubjugationistDecoration) { V.arcologies[0].FSSubjugationist = V.arcologies[0].FSSubjugationistDecoration; } @@ -579,8 +577,7 @@ App.EndWeek.FSDevelopments = function() { if (V.arcologies[0].FSRepopulationFocus !== "unset") { r.push(arcSupport("FSRepopulationFocus")); if (V.arcologies[0].FSRepopulationFocus < 0) { - FutureSocieties.remove("FSRepopulationFocus"); - r.push(`<span class="red">Your future society project has failed:</span> your citizens were repelled from your idea more than they were attracted to it. <span class="yellow">You may select another option, or elect to try again.</span>`); + r.push(removeFS("FSRepopulationFocus")); } else if (V.arcologies[0].FSRepopulationFocus > V.arcologies[0].FSRepopulationFocusDecoration) { V.arcologies[0].FSRepopulationFocus = V.arcologies[0].FSRepopulationFocusDecoration; } @@ -597,8 +594,7 @@ App.EndWeek.FSDevelopments = function() { if (V.arcologies[0].FSRestart !== "unset") { r.push(arcSupport("FSRestart")); if (V.arcologies[0].FSRestart < 0 && V.arcologies[0].FSRestartDecoration !== 100) { - FutureSocieties.remove("FSRestart"); - r.push(`<span class="red">Your future society project has failed:</span> your citizens were repelled from your idea more than they were attracted to it. <span class="yellow">You may select another option, or elect to try again.</span>`); + r.push(removeFS("FSRestart")); } else if (V.arcologies[0].FSRestart > V.arcologies[0].FSRestartDecoration) { V.arcologies[0].FSRestart = V.arcologies[0].FSRestartDecoration; } @@ -615,8 +611,7 @@ App.EndWeek.FSDevelopments = function() { if (V.arcologies[0].FSGenderRadicalist !== "unset") { r.push(arcSupport("FSGenderRadicalist")); if (V.arcologies[0].FSGenderRadicalist < 0) { - FutureSocieties.remove("FSGenderRadicalist"); - r.push(`<span class="red">Your future society project has failed:</span> your citizens were repelled from your idea more than they were attracted to it. <span class="yellow">You may select another option, or elect to try again.</span>`); + r.push(removeFS("FSGenderRadicalist")); } else if (V.arcologies[0].FSGenderRadicalist > V.arcologies[0].FSGenderRadicalistDecoration) { V.arcologies[0].FSGenderRadicalist = V.arcologies[0].FSGenderRadicalistDecoration; } @@ -637,8 +632,7 @@ App.EndWeek.FSDevelopments = function() { if (V.arcologies[0].FSGenderFundamentalist !== "unset") { r.push(arcSupport("FSGenderFundamentalist")); if (V.arcologies[0].FSGenderFundamentalist < 0) { - FutureSocieties.remove("FSGenderFundamentalist"); - r.push(`<span class="red">Your future society project has failed:</span> your citizens were repelled from your idea more than they were attracted to it. <span class="yellow">You may select another option, or elect to try again.</span>`); + r.push(removeFS("FSGenderFundamentalist")); } else if (V.arcologies[0].FSGenderFundamentalist > V.arcologies[0].FSGenderFundamentalistDecoration) { V.arcologies[0].FSGenderFundamentalist = V.arcologies[0].FSGenderFundamentalistDecoration; } @@ -655,8 +649,7 @@ App.EndWeek.FSDevelopments = function() { if (V.arcologies[0].FSPaternalist !== "unset") { r.push(arcSupport("FSPaternalist")); if (V.arcologies[0].FSPaternalist < 0) { - FutureSocieties.remove("FSPaternalist"); - r.push(`<span class="red">Your future society project has failed:</span> your citizens were repelled from your idea more than they were attracted to it. <span class="yellow">You may select another option, or elect to try again.</span>`); + r.push(removeFS("FSPaternalist")); } else if (V.arcologies[0].FSPaternalist > V.arcologies[0].FSPaternalistDecoration) { V.arcologies[0].FSPaternalist = V.arcologies[0].FSPaternalistDecoration; } @@ -673,8 +666,7 @@ App.EndWeek.FSDevelopments = function() { if (V.arcologies[0].FSDegradationist !== "unset") { r.push(arcSupport("FSDegradationist")); if (V.arcologies[0].FSDegradationist < 0) { - FutureSocieties.remove("FSDegradationist"); - r.push(`<span class="red">Your future society project has failed:</span> your citizens were repelled from your idea more than they were attracted to it. <span class="yellow">You may select another option, or elect to try again.</span>`); + r.push(removeFS("FSDegradationist")); } else if (V.arcologies[0].FSDegradationist > V.arcologies[0].FSDegradationistDecoration) { V.arcologies[0].FSDegradationist = V.arcologies[0].FSDegradationistDecoration; } @@ -691,8 +683,7 @@ App.EndWeek.FSDevelopments = function() { if (V.arcologies[0].FSIntellectualDependency !== "unset") { r.push(arcSupport("FSIntellectualDependency")); if (V.arcologies[0].FSIntellectualDependency < 0) { - FutureSocieties.remove("FSIntellectualDependency"); - r.push(`<span class="red">Your future society project has failed:</span> your citizens were repelled from your idea more than they were attracted to it. <span class="yellow">You may select another option, or elect to try again.</span>`); + r.push(removeFS("FSIntellectualDependency")); } else if (V.arcologies[0].FSIntellectualDependency > V.arcologies[0].FSIntellectualDependencyDecoration) { V.arcologies[0].FSIntellectualDependency = V.arcologies[0].FSIntellectualDependencyDecoration; } @@ -709,8 +700,7 @@ App.EndWeek.FSDevelopments = function() { if (V.arcologies[0].FSSlaveProfessionalism !== "unset") { r.push(arcSupport("FSSlaveProfessionalism")); if (V.arcologies[0].FSSlaveProfessionalism < 0) { - FutureSocieties.remove("FSSlaveProfessionalism"); - r.push(`<span class="red">Your future society project has failed:</span> your citizens were repelled from your idea more than they were attracted to it. <span class="yellow">You may select another option, or elect to try again.</span>`); + r.push(removeFS("FSSlaveProfessionalism")); } else if (V.arcologies[0].FSSlaveProfessionalism > V.arcologies[0].FSSlaveProfessionalismDecoration) { V.arcologies[0].FSSlaveProfessionalism = V.arcologies[0].FSSlaveProfessionalismDecoration; } @@ -727,8 +717,7 @@ App.EndWeek.FSDevelopments = function() { if (V.arcologies[0].FSBodyPurist !== "unset") { r.push(arcSupport("FSBodyPurist")); if (V.arcologies[0].FSBodyPurist < 0) { - FutureSocieties.remove("FSBodyPurist"); - r.push(`<span class="red">Your future society project has failed:</span> your citizens were repelled from your idea more than they were attracted to it. <span class="yellow">You may select another option, or elect to try again.</span>`); + r.push(removeFS("FSBodyPurist")); } else if (V.arcologies[0].FSBodyPurist > V.arcologies[0].FSBodyPuristDecoration) { V.arcologies[0].FSBodyPurist = V.arcologies[0].FSBodyPuristDecoration; } @@ -745,8 +734,7 @@ App.EndWeek.FSDevelopments = function() { if (V.arcologies[0].FSTransformationFetishist !== "unset") { r.push(arcSupport("FSTransformationFetishist")); if (V.arcologies[0].FSTransformationFetishist < 0) { - FutureSocieties.remove("FSTransformationFetishist"); - r.push(`<span class="red">Your future society project has failed:</span> your citizens were repelled from your idea more than they were attracted to it. <span class="yellow">You may select another option, or elect to try again.</span>`); + r.push(removeFS("FSTransformationFetishist")); } else if (V.arcologies[0].FSTransformationFetishist > V.arcologies[0].FSTransformationFetishistDecoration) { V.arcologies[0].FSTransformationFetishist = V.arcologies[0].FSTransformationFetishistDecoration; } @@ -763,8 +751,7 @@ App.EndWeek.FSDevelopments = function() { if (V.arcologies[0].FSMaturityPreferentialist !== "unset") { r.push(arcSupport("FSMaturityPreferentialist")); if (V.arcologies[0].FSMaturityPreferentialist < 0) { - FutureSocieties.remove("FSMaturityPreferentialist"); - r.push(`<span class="red">Your future society project has failed:</span> your citizens were repelled from your idea more than they were attracted to it. <span class="yellow">You may select another option, or elect to try again.</span>`); + r.push(removeFS("FSMaturityPreferentialist")); } else if (V.arcologies[0].FSMaturityPreferentialist > V.arcologies[0].FSMaturityPreferentialistDecoration) { V.arcologies[0].FSMaturityPreferentialist = V.arcologies[0].FSMaturityPreferentialistDecoration; } @@ -781,8 +768,7 @@ App.EndWeek.FSDevelopments = function() { if (V.arcologies[0].FSYouthPreferentialist !== "unset") { r.push(arcSupport("FSYouthPreferentialist")); if (V.arcologies[0].FSYouthPreferentialist < 0) { - FutureSocieties.remove("FSYouthPreferentialist"); - r.push(`<span class="red">Your future society project has failed:</span> your citizens were repelled from your idea more than they were attracted to it. <span class="yellow">You may select another option, or elect to try again.</span>`); + r.push(removeFS("FSYouthPreferentialist")); } else if (V.arcologies[0].FSYouthPreferentialist > V.arcologies[0].FSYouthPreferentialistDecoration) { V.arcologies[0].FSYouthPreferentialist = V.arcologies[0].FSYouthPreferentialistDecoration; } @@ -799,8 +785,7 @@ App.EndWeek.FSDevelopments = function() { if (V.arcologies[0].FSPetiteAdmiration !== "unset") { r.push(arcSupport("FSPetiteAdmiration")); if (V.arcologies[0].FSPetiteAdmiration < 0) { - FutureSocieties.remove("FSPetiteAdmiration"); - r.push(`<span class="red">Your future society project has failed:</span> your citizens were repelled from your idea more than they were attracted to it. <span class="yellow">You may select another option, or elect to try again.</span>`); + r.push(removeFS("FSPetiteAdmiration")); } else if (V.arcologies[0].FSPetiteAdmiration > V.arcologies[0].FSPetiteAdmirationDecoration) { V.arcologies[0].FSPetiteAdmiration = V.arcologies[0].FSPetiteAdmirationDecoration; } @@ -817,8 +802,7 @@ App.EndWeek.FSDevelopments = function() { if (V.arcologies[0].FSStatuesqueGlorification !== "unset") { r.push(arcSupport("FSStatuesqueGlorification")); if (V.arcologies[0].FSStatuesqueGlorification < 0) { - FutureSocieties.remove("FSStatuesqueGlorification"); - r.push(`<span class="red">Your future society project has failed:</span> your citizens were repelled from your idea more than they were attracted to it. <span class="yellow">You may select another option, or elect to try again.</span>`); + r.push(removeFS("FSStatuesqueGlorification")); } else if (V.arcologies[0].FSStatuesqueGlorification > V.arcologies[0].FSStatuesqueGlorificationDecoration) { V.arcologies[0].FSStatuesqueGlorification = V.arcologies[0].FSStatuesqueGlorificationDecoration; } @@ -835,8 +819,7 @@ App.EndWeek.FSDevelopments = function() { if (V.arcologies[0].FSSlimnessEnthusiast !== "unset") { r.push(arcSupport("FSSlimnessEnthusiast")); if (V.arcologies[0].FSSlimnessEnthusiast < 0) { - FutureSocieties.remove("FSSlimnessEnthusiast"); - r.push(`<span class="red">Your future society project has failed:</span> your citizens were repelled from your idea more than they were attracted to it. <span class="yellow">You may select another option, or elect to try again.</span>`); + r.push(removeFS("FSSlimnessEnthusiast")); } else if (V.arcologies[0].FSSlimnessEnthusiast > V.arcologies[0].FSSlimnessEnthusiastDecoration) { V.arcologies[0].FSSlimnessEnthusiast = V.arcologies[0].FSSlimnessEnthusiastDecoration; } @@ -853,8 +836,7 @@ App.EndWeek.FSDevelopments = function() { if (V.arcologies[0].FSAssetExpansionist !== "unset") { r.push(arcSupport("FSAssetExpansionist")); if (V.arcologies[0].FSAssetExpansionist < 0) { - FutureSocieties.remove("FSAssetExpansionist"); - r.push(`<span class="red">Your future society project has failed:</span> your citizens were repelled from your idea more than they were attracted to it. <span class="yellow">You may select another option, or elect to try again.</span>`); + r.push(removeFS("FSAssetExpansionist")); } else if (V.arcologies[0].FSAssetExpansionist > V.arcologies[0].FSAssetExpansionistDecoration) { V.arcologies[0].FSAssetExpansionist = V.arcologies[0].FSAssetExpansionistDecoration; } @@ -871,8 +853,7 @@ App.EndWeek.FSDevelopments = function() { if (V.arcologies[0].FSPastoralist !== "unset") { r.push(arcSupport("FSPastoralist")); if (V.arcologies[0].FSPastoralist < 0) { - FutureSocieties.remove("FSPastoralist"); - r.push(`<span class="red">Your future society project has failed:</span> your citizens were repelled from your idea more than they were attracted to it. <span class="yellow">You may select another option, or elect to try again.</span>`); + r.push(removeFS("FSPastoralist")); } else if (V.arcologies[0].FSPastoralist > V.arcologies[0].FSPastoralistDecoration) { V.arcologies[0].FSPastoralist = V.arcologies[0].FSPastoralistDecoration; } @@ -889,8 +870,7 @@ App.EndWeek.FSDevelopments = function() { if (V.arcologies[0].FSPhysicalIdealist !== "unset") { r.push(arcSupport("FSPhysicalIdealist")); if (V.arcologies[0].FSPhysicalIdealist < 0) { - FutureSocieties.remove("FSPhysicalIdealist"); - r.push(`<span class="red">Your future society project has failed:</span> your citizens were repelled from your idea more than they were attracted to it. <span class="yellow">You may select another option, or elect to try again.</span>`); + r.push(removeFS("FSPhysicalIdealist")); } else if (V.arcologies[0].FSPhysicalIdealist > V.arcologies[0].FSPhysicalIdealistDecoration) { V.arcologies[0].FSPhysicalIdealist = V.arcologies[0].FSPhysicalIdealistDecoration; } @@ -907,8 +887,7 @@ App.EndWeek.FSDevelopments = function() { if (V.arcologies[0].FSHedonisticDecadence !== "unset") { r.push(arcSupport("FSHedonisticDecadence")); if (V.arcologies[0].FSHedonisticDecadence < 0) { - FutureSocieties.remove("FSHedonisticDecadence"); - r.push(`<span class="red">Your future society project has failed:</span> your citizens were repelled from your idea more than they were attracted to it. <span class="yellow">You may select another option, or elect to try again.</span>`); + r.push(removeFS("FSHedonisticDecadence")); } else if (V.arcologies[0].FSHedonisticDecadence > V.arcologies[0].FSHedonisticDecadenceDecoration) { V.arcologies[0].FSHedonisticDecadence = V.arcologies[0].FSHedonisticDecadenceDecoration; } @@ -928,8 +907,7 @@ App.EndWeek.FSDevelopments = function() { V.nicaea.announceable = 1; } if (V.arcologies[0].FSChattelReligionist < 0) { - FutureSocieties.remove("FSChattelReligionist"); - r.push(`<span class="red">Your future society project has failed:</span> your citizens were repelled from your idea more than they were attracted to it. <span class="yellow">You may select another option, or elect to try again.</span>`); + r.push(removeFS("FSChattelReligionist")); } else if (V.arcologies[0].FSChattelReligionist > V.arcologies[0].FSChattelReligionistDecoration) { V.arcologies[0].FSChattelReligionist = V.arcologies[0].FSChattelReligionistDecoration; } @@ -946,8 +924,7 @@ App.EndWeek.FSDevelopments = function() { if (V.arcologies[0].FSRomanRevivalist !== "unset") { r.push(arcSupport("FSRomanRevivalist")); if (V.arcologies[0].FSRomanRevivalist < 0) { - FutureSocieties.remove("FSRomanRevivalist"); - r.push(`<span class="red">Your future society project has failed:</span> your citizens were repelled from your idea more than they were attracted to it. <span class="yellow">You may select another option, or elect to try again.</span>`); + r.push(removeFS("FSRomanRevivalist")); } else if (V.arcologies[0].FSRomanRevivalist > V.arcologies[0].FSRomanRevivalistDecoration) { V.arcologies[0].FSRomanRevivalist = V.arcologies[0].FSRomanRevivalistDecoration; } @@ -964,8 +941,7 @@ App.EndWeek.FSDevelopments = function() { if (V.arcologies[0].FSNeoImperialist !== "unset") { r.push(arcSupport("FSNeoImperialist")); if (V.arcologies[0].FSNeoImperialist < 0) { - FutureSocieties.remove("FSNeoImperialist"); - r.push(`<span class="red">Your future society project has failed:</span> your citizens were repelled from your idea more than they were attracted to it. <span class="yellow">You may select another option, or elect to try again.</span>`); + r.push(removeFS("FSNeoImperialist")); } else if (V.arcologies[0].FSNeoImperialist > V.arcologies[0].FSNeoImperialistDecoration) { V.arcologies[0].FSNeoImperialist = V.arcologies[0].FSNeoImperialistDecoration; } @@ -982,8 +958,7 @@ App.EndWeek.FSDevelopments = function() { if (V.arcologies[0].FSAztecRevivalist !== "unset") { r.push(arcSupport("FSAztecRevivalist")); if (V.arcologies[0].FSAztecRevivalist < 0) { - FutureSocieties.remove("FSAztecRevivalist"); - r.push(`<span class="red">Your future society project has failed:</span> your citizens were repelled from your idea more than they were attracted to it. <span class="yellow">You may select another option, or elect to try again.</span>`); + r.push(removeFS("FSAztecRevivalist")); } else if (V.arcologies[0].FSAztecRevivalist > V.arcologies[0].FSAztecRevivalistDecoration) { V.arcologies[0].FSAztecRevivalist = V.arcologies[0].FSAztecRevivalistDecoration; } @@ -1000,8 +975,7 @@ App.EndWeek.FSDevelopments = function() { if (V.arcologies[0].FSEgyptianRevivalist !== "unset") { r.push(arcSupport("FSEgyptianRevivalist")); if (V.arcologies[0].FSEgyptianRevivalist < 0) { - FutureSocieties.remove("FSEgyptianRevivalist"); - r.push(`<span class="red">Your future society project has failed:</span> your citizens were repelled from your idea more than they were attracted to it. <span class="yellow">You may select another option, or elect to try again.</span>`); + r.push(removeFS("FSEgyptianRevivalist")); } else if (V.arcologies[0].FSEgyptianRevivalist > V.arcologies[0].FSEgyptianRevivalistDecoration) { V.arcologies[0].FSEgyptianRevivalist = V.arcologies[0].FSEgyptianRevivalistDecoration; } @@ -1018,8 +992,7 @@ App.EndWeek.FSDevelopments = function() { if (V.arcologies[0].FSEdoRevivalist !== "unset") { r.push(arcSupport("FSEdoRevivalist")); if (V.arcologies[0].FSEdoRevivalist < 0) { - FutureSocieties.remove("FSEdoRevivalist"); - r.push(`<span class="red">Your future society project has failed:</span> your citizens were repelled from your idea more than they were attracted to it. <span class="yellow">You may select another option, or elect to try again.</span>`); + r.push(removeFS("FSEdoRevivalist")); } else if (V.arcologies[0].FSEdoRevivalist > V.arcologies[0].FSEdoRevivalistDecoration) { V.arcologies[0].FSEdoRevivalist = V.arcologies[0].FSEdoRevivalistDecoration; } @@ -1036,8 +1009,7 @@ App.EndWeek.FSDevelopments = function() { if (V.arcologies[0].FSArabianRevivalist !== "unset") { r.push(arcSupport("FSArabianRevivalist")); if (V.arcologies[0].FSArabianRevivalist < 0) { - FutureSocieties.remove("FSArabianRevivalist"); - r.push(`<span class="red">Your future society project has failed:</span> your citizens were repelled from your idea more than they were attracted to it. <span class="yellow">You may select another option, or elect to try again.</span>`); + r.push(removeFS("FSArabianRevivalist")); } else if (V.arcologies[0].FSArabianRevivalist > V.arcologies[0].FSArabianRevivalistDecoration) { V.arcologies[0].FSArabianRevivalist = V.arcologies[0].FSArabianRevivalistDecoration; } @@ -1054,8 +1026,7 @@ App.EndWeek.FSDevelopments = function() { if (V.arcologies[0].FSChineseRevivalist !== "unset") { r.push(arcSupport("FSChineseRevivalist")); if (V.arcologies[0].FSChineseRevivalist < 0) { - FutureSocieties.remove("FSChineseRevivalist"); - r.push(`<span class="red">Your future society project has failed:</span> your citizens were repelled from your idea more than they were attracted to it. <span class="yellow">You may select another option, or elect to try again.</span>`); + r.push(removeFS("FSChineseRevivalist")); } else if (V.arcologies[0].FSChineseRevivalist > V.arcologies[0].FSChineseRevivalistDecoration) { V.arcologies[0].FSChineseRevivalist = V.arcologies[0].FSChineseRevivalistDecoration; } @@ -1079,4 +1050,9 @@ App.EndWeek.FSDevelopments = function() { } return FutureSocieties.arcSupport(FS); } + + function removeFS(FS) { + FutureSocieties.remove(FS); + return `<span class="red">Your future society project has failed:</span> your citizens were repelled from your idea more than they were attracted to it. <span class="yellow">You may select another option, or elect to try again.</span>`; + } }; -- GitLab