From 6af1b3432d674e0784d6d768842603e5e2e789eb Mon Sep 17 00:00:00 2001 From: Pregmodder <pregmodder@gmail.com> Date: Thu, 12 Apr 2018 13:30:28 -0400 Subject: [PATCH] Touch of sorting --- devNotes/twine JS | 30 ++++++++++++++---------------- src/init/setupVars.tw | 6 +++--- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/devNotes/twine JS b/devNotes/twine JS index 79d7818d47c..6dbdf259a41 100644 --- a/devNotes/twine JS +++ b/devNotes/twine JS @@ -6869,24 +6869,24 @@ window.inferiorRaceP = function inferiorRaceP(slave) { window.addSlave = function addSlave(slave) { State.variables.slaves.push(slave); - State.variables.slaveIndices[slave.id] = State.variables.slaves.length - 1; + State.variables.slaveIndices[slave.ID] = State.variables.slaves.length - 1; }; window.removeSlave = function removeSlave(index) { - delete State.variables.slaveIndices[State.variables.slaves[index].id]; + delete State.variables.slaveIndices[State.variables.slaves[index].ID]; return State.variables.slaves.deleteAt(index); }; window.slaves2indices = function slaves2indices() { const obj = {}; - State.variables.slaves.forEach((slave, i) => obj[slave.id] = i); + State.variables.slaves.forEach((slave, i) => obj[slave.ID] = i); return obj; }; window.getSlave = function getSlave(ID) { const index = State.variables.slaveIndices[ID]; if (index === undefined) return null; - else return State.variables.slaves[State.variables.slaveIndices[ID]]; + else return State.variables.slaves[index]; }; /*:: wombJS [script]*/ @@ -7325,7 +7325,7 @@ window.todaysOutfit = function(slave) { } } } else if(slave.devotion <= 20) { - clothing.push({text: "She uses the ability to select outfits to cover up with comfortable cut-offs and a t-shirt,", clothes: "cutoffs and a t-shirt"}); + clothing.push({text: "She uses the ability to select outfits to cover up with comfortable cutoffs and a t-shirt,", clothes: "cutoffs and a t-shirt"}); if(isItemAccessible("conservative clothing")) { wardrobeAssignment.push({text: "She uses the ability to select outfits to cover up with the most conservative clothing she can find.", clothes: "conservative clothing"}); } @@ -7630,7 +7630,7 @@ window.todaysOutfit = function(slave) { wardrobeFS.push({text: "and decides to throw together a slutty outfit that highlight her assets.", clothes: "a slutty outfit"}); } else if(ArcologyZero.FSSlimnessEnthusiast > 0) { if(slave.boobs < 300) { - wardrobeFS.push({text: "and wears s string bikini to show off just how flat she is.", clothes: "a string bikini"}); + wardrobeFS.push({text: "and wears a string bikini to show off just how flat she is.", clothes: "a string bikini"}); } if(slave.boobs < 600 && slave.butt < 3) { wardrobeFS.push({text: "and wears a leotard to show off her lithe body.", clothes: "a leotard"}); @@ -7648,7 +7648,7 @@ window.todaysOutfit = function(slave) { wardrobeTastes.push({text: "and wears nothing but pretty lingerie to attract boys.", clothes: "attractive lingerie"}); wardrobeTastes.push({text: "and selects a slutty outfit that's sure to have men drooling.", clothes: "a slutty outfit"}); if(slave.butt > 3){ - wardrobeTastes.push({text: "and slips on some cuttoffs that are sure to have men checking out her ass.", clothes: "cutoffs and a t-shirt"}); + wardrobeTastes.push({text: "and slips on some cutoffs that are sure to have men checking out her ass.", clothes: "cutoffs and a t-shirt"}); } if(isItemAccessible("a bunny outfit")) { wardrobeAssignment.push({text: "and slips into a bunny outfit that she knows will have men lining up.", clothes: "a bunny outfit"}); @@ -7661,7 +7661,7 @@ window.todaysOutfit = function(slave) { wardrobeTastes.push({text: "and wears pretty lingerie that shows off her body.", clothes: "attractive lingerie"}); wardrobeTastes.push({text: "and selects a slutty outfit that's sure to draw attention.", clothes: "a slutty outfit"}); if(slave.butt > 3){ - wardrobeTastes.push({text: "and slips on some cuttoffs that shows off her ass.", clothes: "cutoffs and a t-shirt"}); + wardrobeTastes.push({text: "and slips on some cutoffs that shows off her ass.", clothes: "cutoffs and a t-shirt"}); } if(isItemAccessible("a bunny outfit")) { wardrobeAssignment.push({text: "and slips into a bunny outfit that hugs her curves.", clothes: "a bunny outfit"}); @@ -7725,7 +7725,7 @@ window.todaysOutfit = function(slave) { wardrobeTastes.push({text: "and wears an elegant gown, since she thinks it makes her look the part of the femme fatale.", clothes: "a slave gown"}); wardrobeTastes.push({text: "and wears a scalemail bikini, since she thinks it makes her look fierce.", clothes: "a scalemail bikini"}); } else if(slave.fetish == "cumslut") { - wardrobeTastes.push({text: "and wears cut-offs and a t-shirt, because the fun yet relatively conservative outfit seems to encourage others to ask her for blowjobs.", clothes: "cutoffs and a t-shirt"}); + wardrobeTastes.push({text: "and wears cutoffs and a t-shirt, because the fun yet relatively conservative outfit seems to encourage others to ask her for blowjobs.", clothes: "cutoffs and a t-shirt"}); } else if(slave.fetish == "humiliation") { wardrobeTastes.push({text: "and wears leather straps with rings over her private parts because she enjoys the embarrassment such a humiliating outfit causes her.", clothes: "uncomfortable straps"}); } else if(slave.fetish == "buttslut") { @@ -7754,7 +7754,7 @@ window.todaysOutfit = function(slave) { wardrobeTastes.push({text: "and wears an elegant gown for some reason.", clothes: "a slave gown"}); wardrobeTastes.push({text: "and wears a scalemail bikini; an odd choice.", clothes: "a scalemail bikini"}); } else if(slave.fetish == "cumslut") { - wardrobeTastes.push({text: "and wears cut-offs and a t-shirt; she can't stop licking her lips.", clothes: "cutoffs and a t-shirt"}); + wardrobeTastes.push({text: "and wears cutoffs and a t-shirt; she can't stop licking her lips.", clothes: "cutoffs and a t-shirt"}); } else if(slave.fetish == "humiliation") { wardrobeTastes.push({text: "and strangely opts for leather straps with rings over her private parts.", clothes: "uncomfortable straps"}); } else if(slave.fetish == "buttslut") { @@ -7897,7 +7897,7 @@ window.todaysCorset = function(slave) { belly.push({text: "She notices the fake bellies; since every girl she has ever met has a rounded middle, it's only natural she is compelled to wear one.", bellyAccessory: jsEither(["a small empathy belly", "a medium empathy belly", "a large empathy belly", "a huge empathy belly"])}); } } else { - belly.push({text: "", bellyAccessory: slave.bellyAccessory}); /*compatiblity for no output, will likely get deprecated in the future as content is added*/ + belly.push({text: "", bellyAccessory: slave.bellyAccessory}); /*compatibility for no output, will likely get deprecated in the future as content is added*/ } } else if(slave.devotion <= 20) { @@ -7923,7 +7923,7 @@ window.todaysCorset = function(slave) { } else if(empathyBellies.includes(slave.bellyAccessory) && slave.sexualFlaw == "breeder") { belly.push({text: "pulls her fake belly off, disgusted by it,", bellyAccessory: "none"}); } else { - belly.push({text: "", bellyAccessory: slave.bellyAccessory}); /*compatiblity for no output, will likely get deprecated in the future as content is added*/ + belly.push({text: "", bellyAccessory: slave.bellyAccessory}); /*compatibility for no output, will likely get deprecated in the future as content is added*/ } } return jsEither(belly); @@ -8022,10 +8022,8 @@ window.FResult = (function() { } function calcWorksWithRelativesVanilla(slave) { - const fre = V.slaves.findIndex(s => { - return haveRelationP(slave, s) && sameAssignmentP(slave, s); - }); - if (fre !== -1) { + const fre = getSlave(slave.relationTarget) + if (fre !== null && sameAssignmentP(slave, fre)) { V.FResult += 2; if (incest_bonus) V.FResult += 2; } diff --git a/src/init/setupVars.tw b/src/init/setupVars.tw index ccf094a2dd3..af253bacf05 100644 --- a/src/init/setupVars.tw +++ b/src/init/setupVars.tw @@ -279,7 +279,7 @@ <<set setup.gratefulCareers = ["a beggar", "a drug mule", "a peddler", "a pick-pocket", "a prisoner", "a refugee", "a shut-in", "a street urchin", "a student from a boarding school", "a sweatshop worker", "an orphan", "from a lower class family", "homeless", "unemployed"]>> -<<set setup.menialCareers = ["a baker", "a blacksmith", "a bus driver", "a butcher", "a butler", "a candlestick maker", "a carpenter", "a cashier", "a chauffeur", "a cobbler", "a construction worker", "a cook", "a courier", "a croupier", "a delivery woman", "a driller", "a dropout", "a factory worker", "a farm laborer", "a firefighter", "a fisherwoman", "a florist", "a gardener", "a gravedigger", "a handmaiden", "a housewife", "a janitor", "a launderer", "a lumberjack", "a maid", "a mail carrier", "a mechanic", "a messenger", "a miner", "a nun", "a paper girl", "a part-time farm laborer", "a pilot", "a plumber", "a producer", "a programmer", "a receptionist", "a referee", "a ride attendant", "a roadie", "a sailor", "a seamstress", "a service worker", "a shrine maiden", "a street vendor", "a student from a private school", "a student from a public school", "a student", "a switchboard operator", "a tailor", "a taxi driver", "a tour guide", "a train conductor", "a truck driver", "a welder", "a whaler", "an apprentice", "an arcade attendant", "an electrician", "an engineer", "an exterminator", "an intern", "being homeschooled by her parents", "from a middle class family", "from an upper class family"]>> +<<set setup.menialCareers = ["a baker", "a blacksmith", "a bus driver", "a butcher", "a candlestick maker", "a carpenter", "a cashier", "a chauffeur", "a cobbler", "a construction worker", "a courier", "a croupier", "a delivery woman", "a driller", "a dropout", "a factory worker", "a farm laborer", "a firefighter", "a fisherwoman", "a florist", "a gardener", "a gravedigger", "a janitor", "a launderer", "a lumberjack", "a mail carrier", "a mechanic", "a messenger", "a miner", "a nun", "a paper girl", "a part-time farm laborer", "a pilot", "a plumber", "a programmer", "a receptionist", "a referee", "a ride attendant", "a roadie", "a sailor", "a seamstress", "a service worker", "a street vendor", "a student from a private school", "a student from a public school", "a student", "a switchboard operator", "a tailor", "a taxi driver", "a tour guide", "a train conductor", "a truck driver", "a welder", "a whaler", "an apprentice", "an arcade attendant", "an electrician", "an engineer", "an exterminator", "an intern"]>> <<set setup.entertainmentCareers = ["a ballerina", "a blogger", "a camgirl", "a camwhore", "a cheerleader", "a child actress", "a clown", "a cocktail waitress", "a comedian", "a gymnast", "a journalist", "a local news anchor", "a magician's assistant", "a medium", "a mime", "a painter", "a party girl", "a photographer", "a poet", "a racing driver", "a sculptor", "a stage magician", "a street performer", "a stuntwoman", "a video game streamer", "a waitress", "a weathergirl", "a wrestler", "a writer", "an acrobat", "an actress", "an animator", "an artist", "an athlete"]>> @@ -307,9 +307,9 @@ <<set setup.recruiterCareers = ["a club recruiter", "a college scout", "a con artist", "a cult leader", "a girl scout", "a hunter", "a lobbyist", "a military recruiter", "a missionary", "a political activist", "a princess", "a talent scout", "retired"]>> /* pregmod */ -/* <<set setup.servantCareers = []>> */ +/* <<set setup.servantCareers = ["a butler", "a cook", "a handmaiden", "a housewife", "a maid", "a shrine maiden"]>> */ -/* <<set setup.otherCareers = []>> */ +/* <<set setup.otherCareers = ["a producer", "being homeschooled by her parents", "from a middle class family", "from an upper class family"]>> */ <<set setup.baseNationalities = ["Afghan", "Albanian", "Algerian", "American", "Andorran", "Angolan", "Antiguan", "Argentinian", "Armenian", "Aruban", "Australian", "Austrian", "Azerbaijani", "Bahamian", "Bahraini", "Bangladeshi", "Barbadian", "Belarusian", "Belgian", "Belizean", "Beninese", "Bermudian", "Bhutanese", "Bissau-Guinean", "Bolivian", "Bosnian", "Brazilian", "British", "Bruneian", "Bulgarian", "Burkinabé", "Burmese", "Burundian", "Cambodian", "Cameroonian", "Canadian", "Cape Verdean", "Catalan", "Central African", "Chadian", "Chilean", "Chinese", "Colombian", "Comorian", "Congolese", "a Cook Islander", "Costa Rican", "Croatian", "Cuban", "Cypriot", "Czech", "Danish", "Djiboutian", "Dominican", "Dominiquais", "Dutch", "East Timorese", "Ecuadorian", "Egyptian", "Emirati", "Equatoguinean", "Eritrean", "Estonian", "Ethiopian", "Fijian", "Filipina", "Finnish", "French Guianan", "French Polynesian", "French", "Gabonese", "Gambian", "Georgian", "German", "Ghanan", "Greek", "Greenlandic", "Grenadian", "Guatemalan", "Guinean", "Guyanese", "Haitian", "Honduran", "Hungarian", "I-Kiribati", "Icelandic", "Indian", "Indonesian", "Iranian", "Iraqi", "Irish", "Israeli", "Italian", "Ivorian", "Jamaican", "Japanese", "Jordanian", "Kazakh", "Kenyan", "Kittitian", "Korean", "Kosovan", "Kurdish", "Kuwaiti", "Kyrgyz", "Laotian", "Latvian", "Lebanese", "Liberian", "Libyan", "a Liechtensteiner", "Lithuanian", "Luxembourgian", "Macedonian", "Malagasy", "Malawian", "Malaysian", "Maldivian", "Malian", "Maltese", "Marshallese", "Mauritanian", "Mauritian", "Mexican", "Micronesian", "Moldovan", "Monégasque", "Mongolian", "Montenegrin", "Moroccan", "Mosotho", "Motswana", "Mozambican", "Namibian", "Nauruan", "Nepalese", "a New Zealander", "Ni-Vanuatu", "Nicaraguan", "Nigerian", "Nigerien", "Niuean", "Norwegian", "Omani", "Pakistani", "Palauan", "Palestinian", "Panamanian", "Papua New Guinean", "Paraguayan", "Peruvian", "Polish", "Portuguese", "Puerto Rican", "Qatari", "Romanian", "Russian", "Rwandan", "Sahrawi", "Saint Lucian", "Salvadoran", "Sammarinese", "Samoan", "São Toméan", "Saudi", "Scottish", "Senegalese", "Serbian", "Seychellois", "Sierra Leonean", "Singaporean", "Slovak", "Slovene", "a Solomon Islander", "Somali", "South African", "South Sudanese", "Spanish", "Sri Lankan", "Sudanese", "Surinamese", "Swazi", "Swedish", "Swiss", "Syrian", "Taiwanese", "Tajik", "Tanzanian", "Thai", "Tibetan", "Togolese", "Tongan", "Trinidadian", "Tunisian", "Turkish", "Turkmen", "Tuvaluan", "Ugandan", "Ukrainian", "Uruguayan", "Uzbek", "Vatican", "Venezuelan", "Vietnamese", "Vincentian", "Yemeni", "Zairian", "Zambian", "Zimbabwean"]>> -- GitLab