From 073f1981eefc3ae42cb383c921ba1fc9385eab25 Mon Sep 17 00:00:00 2001 From: Pregmodder <pregmodder@gmail.com> Date: Tue, 29 May 2018 14:40:15 -0400 Subject: [PATCH] fixes --- devNotes/VersionChangeLog-Premod+LoliMod.txt | 13 ++- devNotes/twine JS | 90 +++++++++++++++++++- src/events/intro/initNationalities.tw | 4 +- src/pregmod/theBlackMarket.tw | 6 +- src/uncategorized/BackwardsCompatibility.tw | 10 +-- 5 files changed, 109 insertions(+), 14 deletions(-) diff --git a/devNotes/VersionChangeLog-Premod+LoliMod.txt b/devNotes/VersionChangeLog-Premod+LoliMod.txt index 08bf406babb..390969c3b5c 100644 --- a/devNotes/VersionChangeLog-Premod+LoliMod.txt +++ b/devNotes/VersionChangeLog-Premod+LoliMod.txt @@ -2,7 +2,18 @@ 0.10.7.1-0.2.x -5/27/2018 +5/29/2018 + + 8 + -induced NCS fixes (you can now actually buy it) + -fixes to surname stripping having trouble lowercasing a number and losing its shit + + 7 + -added anon's induced NCS + -tweaks to arm/leg tattoos and how they are managed when slaves lack arms and legs + -minor fixes and tweaks + +5/28/2018 6 -bodyswapping moved out of cheatmode diff --git a/devNotes/twine JS b/devNotes/twine JS index a33a38f590b..33fabbb2b65 100644 --- a/devNotes/twine JS +++ b/devNotes/twine JS @@ -9514,14 +9514,28 @@ Macro /*:: Quick List [script]*/ -window.sortDomObjects = function (objects, attrName) +window.sortDomObjects = function (objects, attrName, reverse = 0) { + reverse = (reverse) + ? -1 + : 1 + ; var sortingByAttr = function (a, b) { - var aVal = parseInt(a.getAttribute(attrName)) - , bVal = parseInt(b.getAttribute(attrName)) + var aVal = a.getAttribute(attrName) + , bVal = b.getAttribute(attrName) + ; + var aInt = parseInt(aVal) ; - return bVal - aVal; + if (!isNaN(aInt)) + { + return ((parseInt(bVal) - aInt) * reverse); + } + else if (bVal > aVal) + { + return -1 * reverse; + } + return ((aVal == bVal) ? 0 : 1) * reverse; }; return objects.toArray().sort(sortingByAttr); }; @@ -9565,3 +9579,71 @@ window.quickListBuildLinks = function () }, $speed); }); }; + +window.sortIncubatorPossiblesByName = function () +{ + var $sortedIncubatorPossibles = $('#qlIncubator div.possible').detach(); + + $sortedIncubatorPossibles = sortDomObjects($sortedIncubatorPossibles, 'data-name'); + + $($sortedIncubatorPossibles).appendTo($('#qlIncubator')); +}; + +window.sortIncubatorPossiblesByPregnancyWeek = function () +{ + var $sortedIncubatorPossibles = $('#qlIncubator div.possible').detach(); + + $sortedIncubatorPossibles = sortDomObjects($sortedIncubatorPossibles, 'data-preg-week'); + + $($sortedIncubatorPossibles).appendTo($('#qlIncubator')); +}; + +window.sortIncubatorPossiblesByPregnancyCount = function () +{ + var $sortedIncubatorPossibles = $('#qlIncubator div.possible').detach(); + + $sortedIncubatorPossibles = sortDomObjects($sortedIncubatorPossibles, 'data-preg-count'); + + $($sortedIncubatorPossibles).appendTo($('#qlIncubator')); +}; + +window.sortIncubatorPossiblesByReservedSpots = function () +{ + var $sortedIncubatorPossibles = $('#qlIncubator div.possible').detach(); + + $sortedIncubatorPossibles = sortDomObjects($sortedIncubatorPossibles, 'data-reserved-spots'); + + $($sortedIncubatorPossibles).appendTo($('#qlIncubator')); +}; + +window.sortIncubatorPossiblesByPreviousSort = function () +{ + var sort = State.variables.sortIncubatorList + ; +console.log(State.variables); +console.log('sort', sort); + if ('unsorted' != sort) + { +console.log("sort isn't unsorted", sort); + if ('Name' == sort) + { +console.log("sort is name", sort); + sortIncubatorPossiblesByName(); + } + else if ('Reserved Incubator Spots' == sort) + { +console.log("sort is spots", sort); + sortIncubatorPossiblesByReservedSpots(); + } + else if ('Pregnancy Week' == sort) + { +console.log("sort is week", sort); + sortIncubatorPossiblesByPregnancyWeek(); + } + else if ('Number of Children' == sort) + { +console.log("sort is count", sort); + sortIncubatorPossiblesByPregnancyCount(); + } + } +}; diff --git a/src/events/intro/initNationalities.tw b/src/events/intro/initNationalities.tw index a2507175827..ad76b9edcae 100644 --- a/src/events/intro/initNationalities.tw +++ b/src/events/intro/initNationalities.tw @@ -99,7 +99,7 @@ <<set $neighboringArcologies = Math.clamp($neighboringArcologies, 0, 8)>> <<for $i = 0; $i <= $neighboringArcologies; $i++>> - <<set $activeArcology = {name: "Arcology X-", direction: "north", government: "an individual", leaderID: 0, honeymoon: 0, prosperity: 50, ownership: 50, minority: 20, PCminority: 0, demandFactor: 0, FSSupremacist: "unset", FSSupremacistRace: 0, FSSubjugationist: "unset", FSSubjugationistRace: 0, FSGenderRadicalist: "unset", FSGenderFundamentalist: "unset", FSPaternalist: "unset", FSDegradationist: "unset", FSBodyPurist: "unset", FSTransformationFetishist: "unset", FSYouthPreferentialist: "unset", FSMaturityPreferentialist: "unset", FSSlimnessEnthusiast: "unset", FSAssetExpansionist: "unset", FSPastoralist: "unset", FSPhysicalIdealist: "unset", FSChattelReligionist: "unset", FSRomanRevivalist: "unset", FSAztecRevivalist: "unset", FSEgyptianRevivalist: "unset", FSEdoRevivalist: "unset", FSArabianRevivalist: "unset", FSChineseRevivalist: "unset", FSNull: "unset", embargo: 1, embargoTarget: -1, influenceTarget: -1, influenceBonus: 0, CyberEconomic: 1, CyberEconomicTarget: -1, CyberReputation: 1, CyberReputationTarget: -1, rival: 0, FSRestart: "unset", FSRepopulationFocus: "unset", FSHedonisticDecadence: "unset", FSCummunism: "unset", FSIncestFetishist: "unset", FSGenderRadicalistResearch: 0, FSGenderFundamentalistResearch: 0, FSPaternalistResearch: 0, FSDegradationistResearch: 0, FSBodyPuristResearch: 0, FSTransformationFetishistResearch: 0, FSYouthPreferentialistResearch: 0, FSMaturityPreferentialistResearch: 0, FSSlimnessEnthusiastResearch: 0, FSAssetExpansionistResearch: 0, FSPastoralistResearch: 0, FSPhysicalIdealistResearch: 0, FSRepopulationFocusResearch: 0, FSRestartResearch: 0, FSHedonisticDecadenceResearch: 0, FSHedonisticDecadenceDietResearch: 0, FSCummunismResearch: 0, FSIncestFetishistResearch: 0, childFertilityInducedNCSResearch: 0}>> + <<set $activeArcology = {name: "Arcology X-", direction: "north", government: "an individual", leaderID: 0, honeymoon: 0, prosperity: 50, ownership: 50, minority: 20, PCminority: 0, demandFactor: 0, FSSupremacist: "unset", FSSupremacistRace: 0, FSSubjugationist: "unset", FSSubjugationistRace: 0, FSGenderRadicalist: "unset", FSGenderFundamentalist: "unset", FSPaternalist: "unset", FSDegradationist: "unset", FSBodyPurist: "unset", FSTransformationFetishist: "unset", FSYouthPreferentialist: "unset", FSMaturityPreferentialist: "unset", FSSlimnessEnthusiast: "unset", FSAssetExpansionist: "unset", FSPastoralist: "unset", FSPhysicalIdealist: "unset", FSChattelReligionist: "unset", FSRomanRevivalist: "unset", FSAztecRevivalist: "unset", FSEgyptianRevivalist: "unset", FSEdoRevivalist: "unset", FSArabianRevivalist: "unset", FSChineseRevivalist: "unset", FSNull: "unset", embargo: 1, embargoTarget: -1, influenceTarget: -1, influenceBonus: 0, CyberEconomic: 1, CyberEconomicTarget: -1, CyberReputation: 1, CyberReputationTarget: -1, rival: 0, FSRestart: "unset", FSRepopulationFocus: "unset", FSHedonisticDecadence: "unset", FSCummunism: "unset", FSIncestFetishist: "unset", FSGenderRadicalistResearch: 0, FSGenderFundamentalistResearch: 0, FSPaternalistResearch: 0, FSDegradationistResearch: 0, FSBodyPuristResearch: 0, FSTransformationFetishistResearch: 0, FSYouthPreferentialistResearch: 0, FSMaturityPreferentialistResearch: 0, FSSlimnessEnthusiastResearch: 0, FSAssetExpansionistResearch: 0, FSPastoralistResearch: 0, FSPhysicalIdealistResearch: 0, FSRepopulationFocusResearch: 0, FSRestartResearch: 0, FSHedonisticDecadenceResearch: 0, FSHedonisticDecadenceDietResearch: 0, FSCummunismResearch: 0, FSIncestFetishistResearch: 0}>> <<if $i == 0>> <<set $activeArcology.direction = 0>> <<set $activeArcology.name = "Arcology X-4">> @@ -256,6 +256,8 @@ <<set $arcologies[0].FSEgyptianRevivalistIncestPolicy = 0>> <<set $arcologies[0].FSEgyptianRevivalistInterest = 0>> +<<set $arcologies[0].childhoodFertilityInducedNCSResearch = 0>> + /*Nationalities Setup*/ <<unset $nationalitiescheck>> /* Removes unique nationalities array to avoid var bloat */ diff --git a/src/pregmod/theBlackMarket.tw b/src/pregmod/theBlackMarket.tw index db05ef944a1..e4418b4b5c7 100644 --- a/src/pregmod/theBlackMarket.tw +++ b/src/pregmod/theBlackMarket.tw @@ -143,7 +143,7 @@ Of all the wonders present, the thing that catches your eye the most is a shady <dd> <<if $minimumSlaveAge > 8>> Illegal information for the Childhood Fertility @@.orange;Induced NCS@@ (genetic engineering and hormonal blend) research recipe.<br> - "I'm sorry, I can't sell this product to you, even if I wanted to," he says. "I have this technology, which if applied, would make slaves appear younger than the legal age of majority. I picked up from an exotics dealer, who picked it up from some old world government research center. And yes, I know, this is a black market, and I would be happy to sell it to you, except, you see, too many of the wrong people know I have it, and while the knowledge isn't illegal, selling or using it is. See if I sell this to you, you'd start getting younger looking slaves, and those people would try to take us both down, and since I'm not the master of an arcology, I would probably end up enslaved, and I'm not interested in that. If only the laws had a lower minimum age for slaves, I could sell this to anyone interested." + "I'm sorry, I can't sell this product to you, even if I wanted to," he says. "I have this technology, which if applied, would make slaves appear younger than the legal age of majority. I picked up from an exotics dealer, who picked it up from some old world government research center. And yes, I know, this is a black market, and I would be happy to sell it to you, except, you see, too many of the wrong people know I have it, and while the knowledge isn't illegal, selling or using it is. See if I sell this to you, you'd start getting younger looking slaves, and those people would try to take us both down, and since I'm not the master of an arcology, I would probably end up enslaved, and I'm not interested in that. If only the laws had a lower minimum age for slaves, I could sell this to anyone interested." While the minimum slave age is greater than 8, you cannot purchase this illegal technology for the Childhood Fertility @@.orange;Induced NCS@@ (genetic engineering and hormonal blend) research recipe.<br> He notices your interest and lets you read the information [[Childhood Fertility @@.orange;Induced NCS@@|Encyclopedia][$encyclopedia = "Childhood Fertility Induced NCS"]]. <<else>> @@ -160,12 +160,12 @@ Of all the wonders present, the thing that catches your eye the most is a shady <<if $arcologies[0].childhoodFertilityInducedNCSResearch == 0>> <<if $cash >= 135000>> "_toydolls _match _norefunds"<br> - [[Purchase childhood fertility @@.orange;induced NCS@@|The Black Market][$cash -= 135000, $arcologies[0].childhoodFertilityInducedNCSResearch = 1, _dump = $merchantFSWares.delete("childFertilityInducedSyndromeX")]] //@@.yellowgreen;<<print cashFormat(135000)>>.@@//<br> + [[Purchase childhood fertility induced NCS|The Black Market][$cash -= 135000, $arcologies[0].childhoodFertilityInducedNCSResearch = 1, _dump = $merchantFSWares.delete("childFertilityInducedSyndromeX")]] //@@.yellowgreen;<<print cashFormat(135000)>>.@@//<br> <<else>> "_toydolls _match _norefunds Or, you know, come back with money."<br> You cannot afford the asking price of @@.red;<<print cashFormat(135000)>>@@ for the Childhood Fertility @@.orange;Induced NCS@@ (genetic engineering and hormonal blend) research recipe.<br> <</if>> - He notices your interest and lets you read the information [[Childhood Fertility @@.orange;Induced NCS@@|Encyclopedia][$encyclopedia = "Childhood Fertility Induced NCS"]]. + He notices your interest and lets you read the information [[Childhood Fertility Induced NCS|Encyclopedia][$encyclopedia = "Childhood Fertility Induced NCS"]]. <<else>> You already possess the Childhood Fertility @@.orange;Induced NCS@@ (genetic engineering and hormonal blend) research recipe.<br> <<set _dump = $merchantIllegalWares.delete("childhoodFertilityInducedNCS")>> diff --git a/src/uncategorized/BackwardsCompatibility.tw b/src/uncategorized/BackwardsCompatibility.tw index 0b766f7d72f..38d0523ffc1 100644 --- a/src/uncategorized/BackwardsCompatibility.tw +++ b/src/uncategorized/BackwardsCompatibility.tw @@ -752,11 +752,11 @@ <<set _dump = $merchantIllegalWares.delete("childhoodFertilityInducedNCS")>> <<set $merchantIllegalWares.push("childhoodFertilityInducedNCS")>> <</if>> -<<if ndef $arcologies[0].childFertilityInducedNCSResearch>> - <<for _bci = 0; _bci < $arcologies.length; _bci++>> - <<set $arcologies[_bci].childFertilityInducedNCSResearch = 0>> - <</for>> - <<set $arcologies[0].childFertilityInducedNCSResearch = 0>> +<<if ndef $arcologies[0].childhoodFertilityInducedNCSResearch>> + <<set $arcologies[0].childhoodFertilityInducedNCSResearch = 0>> +<</if>> +<<if $arcologies[0].childFertilityInducedNCSResearch>> + <<unset $arcologies[0].childFertilityInducedNCSResearch>> <</if>> <<if $SFMODToggle == 1 && $securityForceCreate == 1>> -- GitLab