diff --git a/src/002-config/fc-js-init.js b/src/002-config/fc-js-init.js index dc9087f30cea22f47092024feba79ae355fe20aa..27db52b134934fac831a6d5f4bdd700180d9ed4a 100644 --- a/src/002-config/fc-js-init.js +++ b/src/002-config/fc-js-init.js @@ -36,7 +36,8 @@ App.Facilities = { HGSuite: {} }; App.Medicine = {}; -App.Medicine.Organs = {}; +App.Medicine.OrganFarm = {}; +App.Medicine.OrganFarm.Organs = {}; App.RA = {}; App.SF = {}; App.Corporate = {}; diff --git a/src/004-base/organFarmBase.js b/src/004-base/organFarmBase.js index 928194873802acad9be253136115ff9142ab1bc9..d84f2623d5626b6c13f9303ac11397c02584ad42 100644 --- a/src/004-base/organFarmBase.js +++ b/src/004-base/organFarmBase.js @@ -16,7 +16,7 @@ implantAction[] { dependencies[] (string) --organ ids */ -App.Medicine.Organ = class { +App.Medicine.OrganFarm.Organ = class { /** * * @param {string} id @@ -26,7 +26,7 @@ App.Medicine.Organ = class { * @param {number} time * @param {function(App.Entity.SlaveState):boolean} canGrow * @param {string[]} dependencies - * @param {App.Medicine.OrganImplantAction[]} actions + * @param {App.Medicine.OrganFarm.OrganImplantAction[]} actions */ constructor({id, name, tooltip, cost, time, canGrow = () => true, dependencies = [], actions= []} = {}) { this.id = id; @@ -41,7 +41,7 @@ App.Medicine.Organ = class { /** @type {App.Data.OrganImplantAction[]} */ this.implantActions = actions; - App.Medicine.Organs[id] = this; + App.Medicine.OrganFarm.Organs[id] = this; } }; @@ -57,7 +57,7 @@ implantAction[] { } */ -App.Medicine.OrganImplantAction = class { +App.Medicine.OrganFarm.OrganImplantAction = class { /** * @param {string} name * @param {string} tooltip diff --git a/src/js/organs.js b/src/js/organs.js index 99bb8ed9be20739c5778396d3e52d97012884333..990641b78e7d31cf833f9dcba4193a5f9ebdc348 100644 --- a/src/js/organs.js +++ b/src/js/organs.js @@ -1,9 +1,17 @@ -App.Medicine.initOrganFarm = function() { - new App.Medicine.Organ({ +/** + * Organs will usually be displayed in this order. + * If an organ is not part of this array, it will be unreachable. + * + * @type {string[]} + */ +App.Medicine.OrganFarm.organDisplayOrder = ["penis", "testicles", "scrotum", "pigTesticles", "dogTesticles, horseTesticles", "cowTesticles", "foreskin", "prostate", "ovaries", "asexualReproOvaries", "pigOvaries", "dogOvaries", "horseOvaries", "cowOvaries", "freshOvaries", "leftEye", "rightEye", "ears", "topEars", "cochleae", "voicebox", "mpreg", "mpregPig", "mpregDog", "mpregHorse", "mpregCow"]; + +App.Medicine.OrganFarm.init = function() { + new App.Medicine.OrganFarm.Organ({ id: "penis", name: "Penis", tooltip: "will add a prostate if one is not already present", cost: 5000, time: 5, canGrow: () => (V.seeDicks !== 0 || V.makeDicks === 1), actions: [ - new App.Medicine.OrganImplantAction({ + new App.Medicine.OrganFarm.OrganImplantAction({ name: "Implant", healthImpact: 20, surgeryType: "addDick", canImplant: slave => (slave.dick <= 0), implantError: () => "this slave already has a penis", @@ -19,10 +27,10 @@ App.Medicine.initOrganFarm = function() { ] }); - new App.Medicine.Organ({ + new App.Medicine.OrganFarm.Organ({ id: "foreskin", name: "Foreskin", cost: 2500, time: 5, actions: [ - new App.Medicine.OrganImplantAction({ + new App.Medicine.OrganFarm.OrganImplantAction({ name: "Graft on", healthImpact: 10, surgeryType: "addForeskin", canImplant: slave => (slave.foreskin <= 0), implantError: slave => `This slave already has a ${slave.dick > 0 ? "foreskin" : "clitoral hood"}.`, @@ -39,17 +47,17 @@ App.Medicine.initOrganFarm = function() { ] }); - new App.Medicine.Testicles({id: "testicles", name: "Testicles", ballType: "human", animal: false}); - new App.Medicine.Testicles({id: "pigTesticles", name: "Pig testicles", ballType: "pig", animal: true}); - new App.Medicine.Testicles({id: "dogTesticles", name: "Dog testicles", ballType: "dog", animal: true}); - new App.Medicine.Testicles({id: "horseTesticles", name: "Horse testicles", ballType: "horse", animal: true}); - new App.Medicine.Testicles({id: "cowTesticles", name: "Cow testicles", ballType: "cow", animal: true}); + new App.Medicine.OrganFarm.Testicles({id: "testicles", name: "Testicles", ballType: "human", animal: false}); + new App.Medicine.OrganFarm.Testicles({id: "pigTesticles", name: "Pig testicles", ballType: "pig", animal: true}); + new App.Medicine.OrganFarm.Testicles({id: "dogTesticles", name: "Dog testicles", ballType: "dog", animal: true}); + new App.Medicine.OrganFarm.Testicles({id: "horseTesticles", name: "Horse testicles", ballType: "horse", animal: true}); + new App.Medicine.OrganFarm.Testicles({id: "cowTesticles", name: "Cow testicles", ballType: "cow", animal: true}); - new App.Medicine.Organ({ + new App.Medicine.OrganFarm.Organ({ id: "scrotum", name: "Scrotum", tooltip: "requires balls for successful implantation", cost: 2500, time: 5, dependencies: ["testicles", "pigTesticles", "dogTesticles", "horseTesticles", "cowTesticles"], actions: [ - new App.Medicine.OrganImplantAction({ + new App.Medicine.OrganFarm.OrganImplantAction({ name: "Graft on", healthImpact: 10, surgeryType: "addScrotum", canImplant: slave => (slave.scrotum <= 0 && slave.balls > 0), implantError: slave => (slave.scrotum > 0) ? "This slave already has a scrotum." : "This slave lacks the balls necessary to accept a scrotum.", @@ -60,53 +68,53 @@ App.Medicine.initOrganFarm = function() { ] }); - new App.Medicine.Ovaries({id: "ovaries", name: "Ovaries", eggType: "human", pregData: "human", animal: false}); - new App.Medicine.Ovaries({id: "pigOvaries", name: "Pig ovaries", eggType: "pig", pregData: "pig", animal: true}); - new App.Medicine.Ovaries({ + new App.Medicine.OrganFarm.Ovaries({id: "ovaries", name: "Ovaries", eggType: "human", pregData: "human", animal: false}); + new App.Medicine.OrganFarm.Ovaries({id: "pigOvaries", name: "Pig ovaries", eggType: "pig", pregData: "pig", animal: true}); + new App.Medicine.OrganFarm.Ovaries({ id: "dogOvaries", name: "Dog ovaries", eggType: "dog", pregData: "canineM", animal: true }); - new App.Medicine.Ovaries({ + new App.Medicine.OrganFarm.Ovaries({ id: "horseOvaries", name: "Horse ovaries", eggType: "horse", pregData: "equine", animal: true }); - new App.Medicine.Ovaries({id: "cowOvaries", name: "Cow ovaries", eggType: "cow", pregData: "cow", animal: true}); + new App.Medicine.OrganFarm.Ovaries({id: "cowOvaries", name: "Cow ovaries", eggType: "cow", pregData: "cow", animal: true}); - new App.Medicine.AnalWomb({ + new App.Medicine.OrganFarm.AnalWomb({ id: "mpreg", name: "Anal womb and ovaries", eggType: "human", pregData: "human", animal: false }); - new App.Medicine.AnalWomb({ + new App.Medicine.OrganFarm.AnalWomb({ id: "mpregPig", name: "Anal pig womb and ovaries", eggType: "pig", pregData: "pig", animal: true }); - new App.Medicine.AnalWomb({ + new App.Medicine.OrganFarm.AnalWomb({ id: "mpregDog", name: "Anal dog womb and ovaries", eggType: "dog", pregData: "canineM", animal: true }); - new App.Medicine.AnalWomb({ + new App.Medicine.OrganFarm.AnalWomb({ id: "mpregHorse", name: "Anal horse womb and ovaries", eggType: "horse", pregData: "equine", animal: true }); - new App.Medicine.AnalWomb({ + new App.Medicine.OrganFarm.AnalWomb({ id: "mpregCow", name: "Anal cow womb and ovaries", eggType: "cow", @@ -114,14 +122,14 @@ App.Medicine.initOrganFarm = function() { animal: true }); - new App.Medicine.Organ({ + new App.Medicine.OrganFarm.Organ({ id: "freshOvaries", name: "Younger Ovaries", tooltip: "Requires a womb for successful implantation", cost: 10000, time: 10, canGrow: () => (V.youngerOvaries === 1), dependencies: ["ovaries", "pigOvaries", "dogOvaries", "horseOvaries", "cowOvaries", "mpreg", "mpregPig", "mpregDog", "mpregHorse", "mpregCow"], actions: [ - new App.Medicine.OrganImplantAction({ + new App.Medicine.OrganFarm.OrganImplantAction({ name: "Implant", healthImpact: 20, surgeryType: "freshOvaries", canImplant: s => ((s.mpreg !== 0 || s.ovaries !== 0) && s.bellyImplant === -1 && s.physicalAge < 70), implantError: s => (s.physicalAge >= 70) ? "This slave's body is too old to handle pregnancy." : "This slave lacks a viable womb.", @@ -146,14 +154,14 @@ App.Medicine.initOrganFarm = function() { ] }); - new App.Medicine.Organ({ + new App.Medicine.OrganFarm.Organ({ id: "asexualReproOvaries", name: "Asexual reproduction modification", tooltip: "Requires existing ovaries for successful implantation.", cost: 10000, time: 10, canGrow: () => (V.asexualReproOvaries === 1), dependencies: ["ovaries", "pigOvaries", "dogOvaries", "horseOvaries", "cowOvaries", "mpreg", "mpregPig", "mpregDog", "mpregHorse", "mpregCow"], actions: [ - new App.Medicine.OrganImplantAction({ + new App.Medicine.OrganFarm.OrganImplantAction({ name: "Implant", healthImpact: 20, surgeryType: "asexualReproOvaries", canImplant: s => (s.mpreg !== 0 || s.ovaries !== 0), implantError: () => "This slave lacks ovaries.", @@ -176,10 +184,10 @@ App.Medicine.initOrganFarm = function() { ] }); - new App.Medicine.Organ({ + new App.Medicine.OrganFarm.Organ({ id: "prostate", name: "Prostate", cost: 5000, time: 5, actions: [ - new App.Medicine.OrganImplantAction({ + new App.Medicine.OrganFarm.OrganImplantAction({ name: "Implant", healthImpact: 20, surgeryType: "addProstate", canImplant: s => (s.prostate === 0), implantError: () => "This slave already has a prostate.", @@ -190,10 +198,10 @@ App.Medicine.initOrganFarm = function() { ] }); - new App.Medicine.Organ({ + new App.Medicine.OrganFarm.Organ({ id: "leftEye", name: "Left Eye", cost: 5000, time: 10, actions: [ - new App.Medicine.OrganImplantAction({ + new App.Medicine.OrganFarm.OrganImplantAction({ name: "Implant", healthImpact: 10, surgeryType: "newEyes", canImplant: s => (getLeftEyeVision(s) === 0 && getLeftEyeType(s) !== 2), implantError: () => "Slave has a working left eye.", @@ -201,7 +209,7 @@ App.Medicine.initOrganFarm = function() { eyeSurgery(s, "left", "normal"); } }), - new App.Medicine.OrganImplantAction({ + new App.Medicine.OrganFarm.OrganImplantAction({ name: "Replace", tooltip: "Replace the existing ocular implant with an organic eye.", healthImpact: 10, surgeryType: "newEyes", autoImplant: false, canImplant: s => (getLeftEyeType(s) === 2), @@ -212,10 +220,10 @@ App.Medicine.initOrganFarm = function() { }) ] }); - new App.Medicine.Organ({ + new App.Medicine.OrganFarm.Organ({ id: "rightEye", name: "Right Eye", cost: 5000, time: 10, actions: [ - new App.Medicine.OrganImplantAction({ + new App.Medicine.OrganFarm.OrganImplantAction({ name: "Implant", healthImpact: 10, surgeryType: "newEyes", canImplant: s => (getRightEyeVision(s) === 0 && getRightEyeType(s) !== 2), implantError: () => "Slave has a working right eye.", @@ -223,7 +231,7 @@ App.Medicine.initOrganFarm = function() { eyeSurgery(s, "right", "normal"); } }), - new App.Medicine.OrganImplantAction({ + new App.Medicine.OrganFarm.OrganImplantAction({ name: "Replace", tooltip: "Replace the existing ocular implant with an organic eye.", healthImpact: 20, surgeryType: "newEyes", autoImplant: false, canImplant: s => (getRightEyeType(s) === 2), @@ -235,10 +243,10 @@ App.Medicine.initOrganFarm = function() { ] }); - new App.Medicine.Organ({ + new App.Medicine.OrganFarm.Organ({ id: "ears", name: "Normal Ears", cost: 1000, time: 2, actions: [ - new App.Medicine.OrganImplantAction({ + new App.Medicine.OrganFarm.OrganImplantAction({ name: "Attach", healthImpact: 15, surgeryType: "earMinor", canImplant: s => (s.earShape === "none"), implantError: () => "This slave already has ears.", @@ -249,7 +257,7 @@ App.Medicine.initOrganFarm = function() { } } }), - new App.Medicine.OrganImplantAction({ + new App.Medicine.OrganFarm.OrganImplantAction({ name: "Replace", tooltip: "Replace current ears with normal human ears.", healthImpact: 20, surgeryType: "earMinor", autoImplant: false, canImplant: s => (s.earShape !== "normal"), @@ -260,11 +268,11 @@ App.Medicine.initOrganFarm = function() { }) ] }); - new App.Medicine.Organ({ + new App.Medicine.OrganFarm.Organ({ id: "topEars", name: "Top Ears", cost: 1000, time: 2, canGrow: () => (V.surgeryUpgrade >= 1), actions: [ - new App.Medicine.OrganImplantAction({ + new App.Medicine.OrganFarm.OrganImplantAction({ name: "Attach", healthImpact: 10, surgeryType: "earMinor", canImplant: s => (s.earT === "none"), implantError: () => "This slave already has ears at the top of the head.", @@ -273,7 +281,7 @@ App.Medicine.initOrganFarm = function() { s.earTColor = "hairless"; } }), - new App.Medicine.OrganImplantAction({ + new App.Medicine.OrganFarm.OrganImplantAction({ name: "Replace", tooltip: "Replace current top ears with normal ears.", healthImpact: 20, surgeryType: "earMinor", autoImplant: false, canImplant: s => (s.earT !== "normal"), @@ -286,10 +294,10 @@ App.Medicine.initOrganFarm = function() { ] }); - new App.Medicine.Organ({ + new App.Medicine.OrganFarm.Organ({ id: "cochleae", name: "Cochleae", cost: 8000, time: 6, actions: [ - new App.Medicine.OrganImplantAction({ + new App.Medicine.OrganFarm.OrganImplantAction({ name: "Implant", healthImpact: 20, surgeryType: "undeafen", canImplant: s => (s.hears <= -2 && s.earImplant === 0), implantError: () => "This slave already has working ears.", @@ -297,7 +305,7 @@ App.Medicine.initOrganFarm = function() { s.hears = 0; } }), - new App.Medicine.OrganImplantAction({ + new App.Medicine.OrganFarm.OrganImplantAction({ name: "Replace", tooltip: "Remove cochlear implants before implanting organic cochleae", healthImpact: 20, surgeryType: "newEars", autoImplant: false, canImplant: s => (s.earImplant === 1), @@ -310,10 +318,10 @@ App.Medicine.initOrganFarm = function() { ] }); - new App.Medicine.Organ({ + new App.Medicine.OrganFarm.Organ({ id: "voicebox", name: "Vocal Cords", cost: 5000, time: 5, actions: [ - new App.Medicine.OrganImplantAction({ + new App.Medicine.OrganFarm.OrganImplantAction({ name: "Implant", healthImpact: 10, surgeryType: "restoreVoice", canImplant: s => (s.voice === 0 && s.electrolarynx === 0), implantError: () => "This slave is not mute.", @@ -327,7 +335,7 @@ App.Medicine.initOrganFarm = function() { } } }), - new App.Medicine.OrganImplantAction({ + new App.Medicine.OrganFarm.OrganImplantAction({ name: "Replace", tooltip: "Remove electrolarynx and implant organic vocal cords", healthImpact: 20, surgeryType: "newVoice", autoImplant: false, canImplant: s => (s.electrolarynx === 1), diff --git a/src/js/reproductiveOrgans.js b/src/js/reproductiveOrgans.js index b8879a334e0ec434d09f64f64b15a925a9a9636d..60f790f34d95766f0927e7ab1ed16f03cf72fda0 100644 --- a/src/js/reproductiveOrgans.js +++ b/src/js/reproductiveOrgans.js @@ -1,4 +1,4 @@ -App.Medicine.TesticlesImplantAction = class extends App.Medicine.OrganImplantAction { +App.Medicine.OrganFarm.TesticlesImplantAction = class extends App.Medicine.OrganFarm.OrganImplantAction { /** * @param {string} name * @param {string} tooltip @@ -25,7 +25,7 @@ App.Medicine.TesticlesImplantAction = class extends App.Medicine.OrganImplantAct } }; -App.Medicine.Testicles = class extends App.Medicine.Organ { +App.Medicine.OrganFarm.Testicles = class extends App.Medicine.OrganFarm.Organ { /** * @param {string} id * @param {string} name @@ -39,7 +39,7 @@ App.Medicine.Testicles = class extends App.Medicine.Organ { cost: 5000, time: 10, canGrow: () => (!this.animal || V.animalTesticles > 0), dependencies: ["penis"], actions: [ - new App.Medicine.TesticlesImplantAction({ + new App.Medicine.OrganFarm.TesticlesImplantAction({ name: "Implant", ballType: ballType, animal: animal, canImplant: slave => (slave.balls <= 0 && slave.dick > 0), implantError: slave => { @@ -69,7 +69,7 @@ App.Medicine.Testicles = class extends App.Medicine.Organ { } } }), - new App.Medicine.TesticlesImplantAction({ + new App.Medicine.OrganFarm.TesticlesImplantAction({ name: "Implant", tooltip: "You can forgo standard procedure and implant testicles directly into $his abdomen.", ballType: ballType, animal: animal, surgeryType: "addTesticles", autoImplant: false, @@ -94,7 +94,7 @@ App.Medicine.Testicles = class extends App.Medicine.Organ { } } }), - new App.Medicine.TesticlesImplantAction({ + new App.Medicine.OrganFarm.TesticlesImplantAction({ name: "Replace", tooltip: "You can replace the existing testicles with a new pair.", healthImpact: 20, @@ -124,7 +124,7 @@ App.Medicine.Testicles = class extends App.Medicine.Organ { } }; -App.Medicine.OvariesImplantAction = class extends App.Medicine.OrganImplantAction { +App.Medicine.OrganFarm.OvariesImplantAction = class extends App.Medicine.OrganFarm.OrganImplantAction { /** * @param {string} name * @param {string} tooltip @@ -150,7 +150,7 @@ App.Medicine.OvariesImplantAction = class extends App.Medicine.OrganImplantActio } }; -App.Medicine.Ovaries = class extends App.Medicine.Organ { +App.Medicine.OrganFarm.Ovaries = class extends App.Medicine.OrganFarm.Organ { /** * @param {string} id * @param {string} name @@ -164,7 +164,7 @@ App.Medicine.Ovaries = class extends App.Medicine.Organ { cost: 10000, time: 10, canGrow: () => (!this.animal || V.animalTesticles > 0), actions: [ - new App.Medicine.OvariesImplantAction({ + new App.Medicine.OrganFarm.OvariesImplantAction({ name: "Implant", eggType: eggType, pregData: pregData, animal: animal, canImplant: s => (s.vagina >= 0 && s.ovaries <= 0 && s.mpreg === 0 && s.bellyImplant === -1), implantError: s => { @@ -186,7 +186,7 @@ App.Medicine.Ovaries = class extends App.Medicine.Organ { } } }), - new App.Medicine.OvariesImplantAction({ + new App.Medicine.OrganFarm.OvariesImplantAction({ name: "Replace", tooltip: "You can replace the existing ovaries with a new pair", eggType: eggType, pregData: pregData, animal: animal, @@ -212,7 +212,7 @@ App.Medicine.Ovaries = class extends App.Medicine.Organ { } }; -App.Medicine.AnalWombImplantAction = class extends App.Medicine.OrganImplantAction { +App.Medicine.OrganFarm.AnalWombImplantAction = class extends App.Medicine.OrganFarm.OrganImplantAction { /** * @param {string} eggType * @param {string} pregData @@ -248,7 +248,7 @@ App.Medicine.AnalWombImplantAction = class extends App.Medicine.OrganImplantActi } }; -App.Medicine.AnalWomb = class extends App.Medicine.Organ { +App.Medicine.OrganFarm.AnalWomb = class extends App.Medicine.OrganFarm.Organ { /** * @param {string} id * @param {string} name @@ -263,7 +263,7 @@ App.Medicine.AnalWomb = class extends App.Medicine.Organ { cost: 20000, time: 10, canGrow: () => (V.arcologies[0].FSGenderRadicalistResearch === 1 && (!this.animal || V.animalMpreg > 0)), actions: [ - new App.Medicine.AnalWombImplantAction({ + new App.Medicine.OrganFarm.AnalWombImplantAction({ eggType: eggType, pregData: pregData, animal: animal