diff --git a/js/003-data/gameVariableData.js b/js/003-data/gameVariableData.js index 443b3b1bb927c8fa48e09c582b2e1167f96b1dbe..8b0cb52636dba90c43f553db3db97c7f0e62b463 100644 --- a/js/003-data/gameVariableData.js +++ b/js/003-data/gameVariableData.js @@ -672,12 +672,14 @@ App.Data.resetOnNGPlus = { /** @type {App.Entity.Animal} */ feline: null, }, - /** @type {App.Entity.Animal[]} */ - canine: [], - /** @type {App.Entity.Animal[]} */ - hooved: [], - /** @type {App.Entity.Animal[]} */ - feline: [], + animals: { + /** @type {App.Entity.Animal[]} */ + canine: [], + /** @type {App.Entity.Animal[]} */ + hooved: [], + /** @type {App.Entity.Animal[]} */ + feline: [], + }, farmyardName: "the Farmyard", HGSuite: 0, diff --git a/src/002-config/fc-version.js b/src/002-config/fc-version.js index b4765090a556ec9c6a548faba9760444161c566a..61e2c59a00c4fe7a17f166c976924c1ea0d49a9d 100644 --- a/src/002-config/fc-version.js +++ b/src/002-config/fc-version.js @@ -2,5 +2,5 @@ App.Version = { base: "0.10.7.1", // The vanilla version the mod is based off of, this should never be changed. pmod: "4.0.0-alpha.11", commitHash: null, - release: 1152 // When getting close to 2000, please remove the check located within the onLoad() function defined at line five of src/js/eventHandlers.js. + release: 1153 // When getting close to 2000, please remove the check located within the onLoad() function defined at line five of src/js/eventHandlers.js. }; diff --git a/src/descriptions/arcologyDescription.js b/src/descriptions/arcologyDescription.js index 08e85880ca56049ab7ae9bae243365220884e644..1fc836ab544fe921bd8f7156808000033f87698b 100644 --- a/src/descriptions/arcologyDescription.js +++ b/src/descriptions/arcologyDescription.js @@ -978,7 +978,7 @@ App.Desc.playerArcology = function(lastElement) { if (A.FSHedonisticDecadenceSMR === 1) { buffer.push(`${A.name} must import a very large quantity of fattening food to plump up its slaves.`); } - if (V.canine.length > 0) { + if (V.animals.canine.length > 0) { buffer.push(`Slaves can be seen walking one of your canines every so often.`); } diff --git a/src/endWeek/reports/farmyardReport.js b/src/endWeek/reports/farmyardReport.js index e216d11a7a363958af33ad0493f0d031ebbe30fe..79b7bed866dc509084082813915302c8d1f85e0d 100644 --- a/src/endWeek/reports/farmyardReport.js +++ b/src/endWeek/reports/farmyardReport.js @@ -458,7 +458,7 @@ App.EndWeek.farmyardReport = function farmyardReport() { if (V.farmyardDecoration !== 'standard') { text.push(`${capFirstChar(V.farmyardName)}'s customer's enjoyed`); - if (V.seeBestiality && V.policies.bestialityOpenness && (V.canine.length || V.hooved.length || V.feline.length)) { + if (V.seeBestiality && V.policies.bestialityOpenness && (V.animals.canine.length || V.animals.hooved.length || V.animals.feline.length)) { text.push(`<span class="reputation inc">watching farmhands fuck animals in ${V.farmyardDecoration} surroundings.</span>`); } else if (V.farmyardShows) { text.push(`<span class="reputation inc">watching farmhands put on shows in ${V.farmyardDecoration} surroundings.</span>`); diff --git a/src/facilities/farmyard/farmyard.js b/src/facilities/farmyard/farmyard.js index 287f1df6ef37e3f339ad928299d6195a8117e389..545ed2282e7760f9a0cb061b2aa4a48363eac033 100644 --- a/src/facilities/farmyard/farmyard.js +++ b/src/facilities/farmyard/farmyard.js @@ -34,13 +34,17 @@ App.Facilities.Farmyard.farmyard = class Farmyard extends App.Facilities.Facilit seeds: 0 }; - V.canine = []; - V.hooved = []; - V.feline = []; + V.animals = { + canine: [], + hooved: [], + feline: [], + }; - V.active.canine = null; - V.active.hooved = null; - V.active.feline = null; + V.active = { + canine: null, + hooved: null, + feline: null, + }; App.Arcology.cellUpgrade(V.building, App.Arcology.Cell.Manufacturing, "Farmyard", "Manufacturing"); }; @@ -294,7 +298,7 @@ App.Facilities.Farmyard.farmyard = class Farmyard extends App.Facilities.Facilit prereqs: [ () => !!V.seeBestiality, () => !!V.farmyardShows, - () => !!V.canine || !!V.hooved || !!V.feline, + () => !!V.animals.canine || !!V.animals.hooved || !!V.animals.feline, ], options: [ { @@ -480,22 +484,22 @@ App.Facilities.Farmyard.farmyard = class Farmyard extends App.Facilities.Facilit const cost = Math.trunc(5000 * V.upgradeMultiplierArcology); - const CL = V.canine.length; + const CL = V.animals.canine.length; let dogs = ''; let canines = ''; if (CL === 1) { - dogs = `${V.canine[0].name}s`; + dogs = `${V.animals.canine[0].name}s`; - if (V.canine[0].species === "dog") { - canines = V.canine[0].name; + if (V.animals.canine[0].species === "dog") { + canines = V.animals.canine[0].name; } else { - canines = asPlural(V.canine[0].species); + canines = asPlural(V.animals.canine[0].species); } } else if (CL < 3) { dogs = `a couple different breeds of dogs`; - if (V.canine.every(c => c.species === "dog")) { + if (V.animals.canine.every(c => c.species === "dog")) { canines = `a couple different breeds of dog`; } else { canines = `a couple different species of canine`; @@ -543,10 +547,10 @@ App.Facilities.Farmyard.farmyard = class Farmyard extends App.Facilities.Facilit const cost = Math.trunc(5000 * V.upgradeMultiplierArcology); - const HL = V.hooved.length; + const HL = V.animals.hooved.length; const hooved = HL === 1 - ? `${V.hooved[0].name}s` : HL < 3 + ? `${V.animals.hooved[0].name}s` : HL < 3 ? `several different types of hooved animals` : `all kinds of hooved animals`; @@ -588,22 +592,22 @@ App.Facilities.Farmyard.farmyard = class Farmyard extends App.Facilities.Facilit const cost = Math.trunc(5000 * V.upgradeMultiplierArcology); - const FL = V.feline.length; + const FL = V.animals.feline.length; let cats = ''; let felines = ''; if (FL === 1) { - cats = `${V.feline[0].name}s`; + cats = `${V.animals.feline[0].name}s`; - if (V.feline[0].species === "cat") { - felines = V.feline[0].name; + if (V.animals.feline[0].species === "cat") { + felines = V.animals.feline[0].name; } else { - felines = asPlural(V.feline[0].species); + felines = asPlural(V.animals.feline[0].species); } } else if (FL < 3) { cats = `a couple different breeds of cats`; - if (V.feline.every(c => c.species === "cat")) { + if (V.animals.feline.every(c => c.species === "cat")) { felines = `a couple different breeds of cat`; } else { felines = `a couple different species of feline`; @@ -657,13 +661,21 @@ App.Facilities.Farmyard.farmyard = class Farmyard extends App.Facilities.Facilit V.farmyardStables = 0; V.farmyardCages = 0; - V.active.canine = null; - V.active.hooved = null; - V.active.feline = null; - - V.canine = []; - V.hooved = []; - V.feline = []; + V.animals = { + canine: [], + hooved: [], + feline: [], + }; + + V.active = { + canine: null, + hooved: null, + feline: null, + }; + + if (V.pit) { + V.pit.animal = null; + } V.farmyardShows = 0; V.farmyardBreeding = 0; diff --git a/src/facilities/farmyard/farmyardBC.js b/src/facilities/farmyard/farmyardBC.js index f9bd211faa22b64205d590d110f9bbe0e09f62e5..78fb2b457ffafda07b154ae0d1288b7ec83f51f9 100644 --- a/src/facilities/farmyard/farmyardBC.js +++ b/src/facilities/farmyard/farmyardBC.js @@ -1,5 +1,5 @@ // @ts-nocheck -App.Facilities.Farmyard.BC = function () { +App.Facilities.Farmyard.BC = function() { if (typeof V.farmyardUpgrades !== "object") { V.farmyardUpgrades = { pump: 0, fertilizer: 0, hydroponics: 0, machinery: 0, seeds: 0 @@ -15,4 +15,20 @@ App.Facilities.Farmyard.BC = function () { delete V.foodStored; } + + if (V.canine) { + V.animals.canine = Array.from(V.canine); + + delete V.canine; + } + if (V.hooved) { + V.animals.hooved = Array.from(V.hooved); + + delete V.hooved; + } + if (V.feline) { + V.animals.feline = Array.from(V.feline); + + delete V.feline; + } }; diff --git a/src/js/birth/birth.js b/src/js/birth/birth.js index 743495d518e9c0351b0df86a4109723de8d8ba01..755ab30a6e23240b5a214148489be606c5a7606c 100644 --- a/src/js/birth/birth.js +++ b/src/js/birth/birth.js @@ -5000,14 +5000,14 @@ globalThis.birth = function(slave, {birthStorm = false, cSection = false, artRen /** @type {App.Entity.Animal[]} */ const animals = []; - if (V.canine.length > 0) { - animals.push(V.canine.random()); + if (V.animals.canine.length > 0) { + animals.push(V.animals.canine.random()); } - if (V.hooved.length > 0) { - animals.push(V.hooved.random()); + if (V.animals.hooved.length > 0) { + animals.push(V.animals.hooved.random()); } - if (V.feline.length > 0) { - animals.push(V.feline.random()); + if (V.animals.feline.length > 0) { + animals.push(V.animals.feline.random()); } const animal = animals.random(); diff --git a/src/js/economyJS.js b/src/js/economyJS.js index 3a55f4b21048acd86b24fb2dcc669b977c5eb9c2..9309c7e2c5e8e9abda57948a60826d5cd64eb9e6 100644 --- a/src/js/economyJS.js +++ b/src/js/economyJS.js @@ -692,12 +692,12 @@ globalThis.calculateCosts = (function() { function getFarmyardCosts() { const facility = V.farmyard * V.facilityCost; - const exotic = V.canine.filter(c => c.rarity === "exotic").length + - V.hooved.filter(h => h.rarity === "exotic").length + - V.feline.filter(f => f.rarity === "exotic").length; - const domestic = V.canine.filter(c => c.rarity === "domestic").length + - V.hooved.filter(h => h.rarity === "domestic").length + - V.feline.filter(f => f.rarity === "domestic").length; + const exotic = V.animals.canine.filter(c => c.rarity === "exotic").length + + V.animals.hooved.filter(h => h.rarity === "exotic").length + + V.animals.feline.filter(f => f.rarity === "exotic").length; + const domestic = V.animals.canine.filter(c => c.rarity === "domestic").length + + V.animals.hooved.filter(h => h.rarity === "domestic").length + + V.animals.feline.filter(f => f.rarity === "domestic").length; return ( ( (facility) + diff --git a/src/js/vignettes.js b/src/js/vignettes.js index 2be7992805d763a1fec287892556ba510c4a4205..6e61b8f7dcf487a5ad196f9eeb28c6cbab73b46d 100644 --- a/src/js/vignettes.js +++ b/src/js/vignettes.js @@ -4701,7 +4701,7 @@ globalThis.GetVignette = function(slave) { effect: -1 }); - if ((V.canine.length > 0) && hasAnyNaturalLegs(slave)) { + if ((V.animals.canine.length > 0) && hasAnyNaturalLegs(slave)) { r.push({ text: `an over-excited dog left scratch marks on ${his} leg,`, type: "health", @@ -4709,7 +4709,7 @@ globalThis.GetVignette = function(slave) { }); } - if (V.hooved.length > 0) { + if (V.animals.hooved.length > 0) { r.push({ text: `${he} was injured by a particularly well-endowed horse,`, type: "health", @@ -4717,7 +4717,7 @@ globalThis.GetVignette = function(slave) { }); } - if (V.feline.length > 0) { + if (V.animals.feline.length > 0) { r.push({ text: `${he} managed to take two tigers at once, aweing the crowd,`, type: "cash", diff --git a/src/npc/interaction/killSlave.js b/src/npc/interaction/killSlave.js index 326f300245f3922b592f437fbe32780e59a479d9..5589ae0c315335d0b93b72a4a2a5abef8404ebac 100644 --- a/src/npc/interaction/killSlave.js +++ b/src/npc/interaction/killSlave.js @@ -443,7 +443,7 @@ App.UI.SlaveInteract.killSlave = function(slave) { reactionText = `${He} nods ${his} head and straightens up, as though mentally preparing ${himself} for the fight for ${his} life.`; } - if (V.canine.length || V.hooved.length || V.feline.length) { + if (V.animals.canine.length || V.animals.hooved.length || V.animals.feline.length) { combatDiv.append(animals()); } else { combatDiv.append(bodyguard()); diff --git a/src/npc/interaction/passage/fAnimalImpreg.js b/src/npc/interaction/passage/fAnimalImpreg.js index 9433b2d0af06c0e90dd5e82fcae6f91c8820b904..3f2b9909410424d344d0b29f137f8bf03e5386ca 100644 --- a/src/npc/interaction/passage/fAnimalImpreg.js +++ b/src/npc/interaction/passage/fAnimalImpreg.js @@ -12,7 +12,7 @@ App.Interact.fAnimalImpreg = function(slave) { App.UI.DOM.appendNewElement("h2", node, `Select an eligible animal to knock ${him} up`); /* FIXME: this might not work */ - for (const canine of V.canine) { + for (const canine of V.animals.canine) { if (canBreed(slave, canine)) { App.UI.DOM.appendNewElement("div", node, App.UI.DOM.link( `Have a ${canine.species !== "dog" ? canine.species : canine.breed} knock ${him} up`, @@ -21,7 +21,7 @@ App.Interact.fAnimalImpreg = function(slave) { eligibility = true; } } - for (const hooved of V.hooved) { + for (const hooved of V.animals.hooved) { if (canBreed(slave, hooved)) { App.UI.DOM.appendNewElement("div", node, App.UI.DOM.link( `Have a ${hooved.species} knock ${him} up`, @@ -30,7 +30,7 @@ App.Interact.fAnimalImpreg = function(slave) { eligibility = true; } } - for (const feline of V.feline) { + for (const feline of V.animals.feline) { if (canBreed(slave, feline)) { App.UI.DOM.appendNewElement("div", node, App.UI.DOM.link( `Have a ${feline.species !== "cat" ? feline.species : feline.breed} knock ${him} up`,