diff --git a/src/npc/startingGirls/editFamily.js b/src/npc/startingGirls/editFamily.js index 7909a3cd626692ca8f964abd1d973fa7b1994f1f..586423a228d30f2a8590c5a71f86c2aa7888033f 100644 --- a/src/npc/startingGirls/editFamily.js +++ b/src/npc/startingGirls/editFamily.js @@ -22,9 +22,13 @@ App.Intro.editFamily = function(slave, cheat) { function makeFamilyTable() { const familyTable = makeElWithID("family-table"); - familyTable.append(relationshipType()); - familyTable.append(relationshipTarget()); - App.UI.DOM.appendNewElement("h2", familyTable, "Family"); + if (cheat) { + familyTable.append(relationshipTarget()); + familyTable.append(relationshipType()); + familyTable.append(rivalTarget()); + familyTable.append(rivalryType()); + App.UI.DOM.appendNewElement("h2", familyTable, "Family"); + } familyTable.append(summary()); familyTable.append(makeElWithID("dont-be-dumb")); familyTable.append(mother()); @@ -48,24 +52,22 @@ App.Intro.editFamily = function(slave, cheat) { function relationshipType() { const el = new DocumentFragment(); const options = new App.UI.OptionsGroup(); - if (cheat) { - const option = options.addOption("Relationship", "relationship", slave) - .addValueList([ - ["Married to you", -3], - ["Emotionally bound to you", -2], - ["Emotional slut", -1], - ["None", 0], - ]); - const relation = getSlave(slave.relationshipTarget); - if (relation) { - option.addValueList([ - [`Friends with ${relation.slaveName}`, 1], - [`Best friends with ${relation.slaveName}`, 2], - [`Friends with benefits with ${relation.slaveName}`, 3], - [`Lover with ${relation.slaveName}`, 4], - [`${relation.slaveName}'s slave wife`, 5] - ]); - } + const option = options.addOption("Relationship", "relationship", slave) + .addValueList([ + ["Married to you", -3], + ["Emotionally bound to you", -2], + ["Emotional slut", -1], + ["None", 0], + ]); + const relation = getSlave(slave.relationshipTarget); + if (relation) { + option.addValueList([ + [`Friends with ${relation.slaveName}`, 1], + [`Best friends with ${relation.slaveName}`, 2], + [`Friends with benefits with ${relation.slaveName}`, 3], + [`Lover with ${relation.slaveName}`, 4], + [`${relation.slaveName}'s slave wife`, 5] + ]); } el.append(options.render()); return el; @@ -73,147 +75,207 @@ App.Intro.editFamily = function(slave, cheat) { function relationshipTarget() { const div = document.createElement("div"); - const linkArray = []; const relation = getSlave(slave.relationshipTarget); if (slave.relationshipTarget < 0) { - div.append(`${slave.slaveName} has a relationship with you.`); + div.append(`${slave.slaveName} has a relationship with you. `); } else if (slave.relationshipTarget === 0) { - div.append(`${slave.slaveName} is not in a relationship.`); + div.append(`${slave.slaveName} is not in a relationship. `); } else if (relation) { div.append(`${slave.slaveName} has a relationship with ${relation.slaveName} `); } else { div.append(`${slave.slaveName}'s relationship target, "${slave.relationshipTarget}" is not found `); } + const change = App.UI.DOM.makeElement("span", App.UI.DOM.link("Change", () => { + const linkArray = []; + linkArray.push( + App.UI.DOM.link( + "Reset", + () => { + slave.relationshipTarget = 0; + refresh(); + } + ) + ); - linkArray.push( - App.UI.DOM.link( - "Reset", - () => { - slave.relationshipTarget = 0; - refresh(); - } - ) - ); - - for (const potentialRel of V.slaves) { - const relTerm = relativeTerm(slave, potentialRel); - const link = document.createElement("span"); - link.append(App.UI.DOM.link( - potentialRel.slaveName, - () => { - slave.relationshipTarget = potentialRel.ID; - refresh(); + for (const potentialRel of V.slaves) { + const relTerm = relativeTerm(slave, potentialRel); + const link = document.createElement("span"); + link.append(App.UI.DOM.link( + potentialRel.slaveName, + () => { + slave.relationshipTarget = potentialRel.ID; + refresh(); + } + )); + if (relTerm) { + App.UI.DOM.appendNewElement("span", link, ` (${relTerm})`); } - )); - if (relTerm) { - App.UI.DOM.appendNewElement("span", link, ` (${relTerm})`); + linkArray.push(link); } - linkArray.push(link); - } - div.append(App.UI.DOM.generateLinksStrip(linkArray)); + jQuery(change).empty().append(App.UI.DOM.makeElement("div", App.UI.DOM.generateLinksStrip(linkArray))); + })); + div.append(change); return div; } - function mother() { + function rivalryType() { + const el = new DocumentFragment(); + const options = new App.UI.OptionsGroup(); + if (slave.rivalry) { + options.addOption("Rivalry level", "rivalry", slave) + .addValueList([ + [`Dislikes`, 1], + [`Rival of`, 2], + ["Bitterly hates", 3], + ]); + } + el.append(options.render()); + return el; + } + + function rivalTarget() { const div = document.createElement("div"); - const linkArray = []; + const rival = getSlave(slave.rivalryTarget); + if (slave.rivalryTarget < 0) { + div.append(`${slave.slaveName} has a rivalry with you. `); + } else if (slave.rivalryTarget === 0) { + div.append(`${slave.slaveName} has no rival. `); + } else if (rival) { + div.append(`${slave.slaveName} has a rivalry with ${rival.slaveName} `); + } else { + div.append(`${slave.slaveName}'s rivalry target, "${slave.rivalryTarget}" is not found `); + } - div.append(`${slave.slaveName}'s mother is `, parentName("mother"), `. `); + const change = App.UI.DOM.makeElement("span", App.UI.DOM.link("Change", () => { + const linkArray = []; + linkArray.push( + App.UI.DOM.link( + "Reset", + () => { + slave.rivalryTarget = 0; + slave.rivalry = 0; + refresh(); + } + ) + ); - linkArray.push( - App.UI.DOM.link( - "Reset", - () => { - slave.mother = 0; - refresh(); - } - ) - ); + for (const potentialRival of V.slaves) { + linkArray.push(App.UI.DOM.link( + potentialRival.slaveName, + () => { + slave.rivalryTarget = potentialRival.ID; + slave.rivalry = slave.rivalry || 1; + refresh(); + } + )); + } + jQuery(change).empty().append(App.UI.DOM.makeElement("div", App.UI.DOM.generateLinksStrip(linkArray))); + })); + div.append(change); - if (V.PC.vagina > 0 && isNotMom(V.PC) && ((V.PC.actualAge - slave.actualAge) >= V.fertilityAge) && _allowPCFamily) { + return div; + } + + function mother() { + const div = document.createElement("div"); + div.append(`${slave.slaveName}'s mother is `, parentName("mother"), `. `); + const change = App.UI.DOM.makeElement("span", App.UI.DOM.link("Change", () => { + const linkArray = []; linkArray.push( App.UI.DOM.link( - "You", + "Reset", () => { - slave.mother = V.PC.ID; + slave.mother = 0; refresh(); } ) ); - } - for (const potentialRel of V.slaves) { - if (potentialRel.vagina > 0 && isNotMom(potentialRel) && ((potentialRel.actualAge - slave.actualAge) >= potentialRel.pubertyAgeXX) && potentialRel.newGamePlus === 0) { + if (V.PC.vagina > 0 && isNotMom(V.PC) && ((V.PC.actualAge - slave.actualAge) >= V.fertilityAge) && _allowPCFamily) { linkArray.push( App.UI.DOM.link( - potentialRel.slaveName, + "You", () => { - slave.mother = potentialRel.ID; + slave.mother = V.PC.ID; refresh(); } ) ); } - } - div.append(App.UI.DOM.generateLinksStrip(linkArray)); + for (const potentialRel of V.slaves) { + if (potentialRel.vagina > 0 && isNotMom(potentialRel) && ((potentialRel.actualAge - slave.actualAge) >= potentialRel.pubertyAgeXX) && potentialRel.newGamePlus === 0) { + linkArray.push( + App.UI.DOM.link( + potentialRel.slaveName, + () => { + slave.mother = potentialRel.ID; + refresh(); + } + ) + ); + } + } + + jQuery(change).empty().append(App.UI.DOM.makeElement("div", App.UI.DOM.generateLinksStrip(linkArray))); + })); + div.append(change); return div; } function father() { const div = document.createElement("div"); - const linkArray = []; - div.append(`${slave.slaveName}'s father is `, parentName("father"), `. `); - - linkArray.push( - App.UI.DOM.link( - "Reset", - () => { - slave.father = 0; - refresh(); - } - ) - ); - - if (V.PC.dick > 0 && isNotDad(V.PC) && ((V.PC.actualAge - slave.actualAge) >= V.potencyAge) && _allowPCFamily) { + const change = App.UI.DOM.makeElement("span", App.UI.DOM.link("Change", () => { + const linkArray = []; linkArray.push( App.UI.DOM.link( - "You", + "Reset", () => { - slave.father = V.PC.ID; + slave.father = 0; refresh(); } ) ); - } - for (const potentialRel of V.slaves) { - if (potentialRel.dick > 0 && isNotDad(potentialRel) && ((potentialRel.actualAge - slave.actualAge) >= potentialRel.pubertyAgeXY) && potentialRel.newGamePlus === 0) { + if (V.PC.dick > 0 && isNotDad(V.PC) && ((V.PC.actualAge - slave.actualAge) >= V.potencyAge) && _allowPCFamily) { linkArray.push( App.UI.DOM.link( - potentialRel.slaveName, + "You", () => { - slave.father = potentialRel.ID; + slave.father = V.PC.ID; refresh(); } ) ); } - } - div.append(App.UI.DOM.generateLinksStrip(linkArray)); + for (const potentialRel of V.slaves) { + if (potentialRel.dick > 0 && isNotDad(potentialRel) && ((potentialRel.actualAge - slave.actualAge) >= potentialRel.pubertyAgeXY) && potentialRel.newGamePlus === 0) { + linkArray.push( + App.UI.DOM.link( + potentialRel.slaveName, + () => { + slave.father = potentialRel.ID; + refresh(); + } + ) + ); + } + } + + jQuery(change).empty().append(App.UI.DOM.makeElement("div", App.UI.DOM.generateLinksStrip(linkArray))); + })); + div.append(change); return div; } function sameMotherAs() { const div = document.createElement("div"); - const linkArray = []; - if (slave.mother === -1) { div.append(`You are ${his} mother, and also the mother of: `); } else { @@ -221,44 +283,47 @@ App.Intro.editFamily = function(slave, cheat) { } div.append(App.StartingGirls.listOfSlavesWithParent('mother', slave.mother), " "); - - linkArray.push( - App.UI.DOM.link( - "Reset", - () => { - slave.mother = 0; - refresh(); - } - ) - ); - - if ((slave.mother !== V.PC.ID) && (V.PC.mother !== slave.ID) && _allowPCFamily) { + const change = App.UI.DOM.makeElement("span", App.UI.DOM.link("Change", () => { + const linkArray = []; linkArray.push( App.UI.DOM.link( - "You", + "Reset", () => { - setRel(V.PC); + slave.mother = 0; refresh(); } ) ); - } - for (const potentialRel of V.slaves) { - if ((slave.mother !== potentialRel.ID) && (potentialRel.mother !== slave.ID) && potentialRel.newGamePlus === 0) { + if ((slave.mother !== V.PC.ID) && (V.PC.mother !== slave.ID) && _allowPCFamily) { linkArray.push( App.UI.DOM.link( - potentialRel.slaveName, + "You", () => { - setRel(potentialRel); + setRel(V.PC); refresh(); } ) ); } - } - div.append(App.UI.DOM.generateLinksStrip(linkArray)); + for (const potentialRel of V.slaves) { + if ((slave.mother !== potentialRel.ID) && (potentialRel.mother !== slave.ID) && potentialRel.newGamePlus === 0) { + linkArray.push( + App.UI.DOM.link( + potentialRel.slaveName, + () => { + setRel(potentialRel); + refresh(); + } + ) + ); + } + } + + jQuery(change).empty().append(App.UI.DOM.makeElement("div", App.UI.DOM.generateLinksStrip(linkArray))); + })); + div.append(change); return div; @@ -268,7 +333,7 @@ App.Intro.editFamily = function(slave, cheat) { } else if (slave.mother !== 0) { potentialRel.mother = slave.mother; } else { - slave.mother = -20 - 2*slave.ID; + slave.mother = -20 - 2 * slave.ID; potentialRel.mother = slave.mother; } } @@ -276,7 +341,6 @@ App.Intro.editFamily = function(slave, cheat) { function sameFatherAs() { const div = document.createElement("div"); - const linkArray = []; if (slave.father === -1) { div.append(`You are ${his} father, and also the father of: `); @@ -286,43 +350,48 @@ App.Intro.editFamily = function(slave, cheat) { div.append(App.StartingGirls.listOfSlavesWithParent('father', slave.father), " "); - linkArray.push( - App.UI.DOM.link( - "Reset", - () => { - slave.father = 0; - refresh(); - } - ) - ); + const change = App.UI.DOM.makeElement("span", App.UI.DOM.link("Change", () => { + const linkArray = []; - if ((slave.father !== V.PC.ID) && (V.PC.father !== slave.ID) && _allowPCFamily) { linkArray.push( App.UI.DOM.link( - "You", + "Reset", () => { - setRel(V.PC); + slave.father = 0; refresh(); } ) ); - } - for (const potentialRel of V.slaves) { - if ((slave.father !== potentialRel.ID) && (potentialRel.father !== slave.ID) && potentialRel.newGamePlus === 0) { + if ((slave.father !== V.PC.ID) && (V.PC.father !== slave.ID) && _allowPCFamily) { linkArray.push( App.UI.DOM.link( - potentialRel.slaveName, + "You", () => { - setRel(potentialRel); + setRel(V.PC); refresh(); } ) ); } - } - div.append(App.UI.DOM.generateLinksStrip(linkArray)); + for (const potentialRel of V.slaves) { + if ((slave.father !== potentialRel.ID) && (potentialRel.father !== slave.ID) && potentialRel.newGamePlus === 0) { + linkArray.push( + App.UI.DOM.link( + potentialRel.slaveName, + () => { + setRel(potentialRel); + refresh(); + } + ) + ); + } + } + + jQuery(change).empty().append(App.UI.DOM.makeElement("div", App.UI.DOM.generateLinksStrip(linkArray))); + })); + div.append(change); return div; @@ -332,7 +401,7 @@ App.Intro.editFamily = function(slave, cheat) { } else if (slave.father !== 0) { potentialRel.father = slave.father; } else { - slave.father = -20 - 2*slave.ID - 1; + slave.father = -20 - 2 * slave.ID - 1; potentialRel.father = slave.father; } } @@ -340,56 +409,59 @@ App.Intro.editFamily = function(slave, cheat) { function motherOfTheChildren() { const div = document.createElement("div"); - const linkArray = []; div.append(motheredNames()); - linkArray.push( - App.UI.DOM.link( - "Reset", - () => { - for (const s of V.slaves) { - if (s.mother === slave.ID && s.newGamePlus === 0) { - s.mother = 0; + const change = App.UI.DOM.makeElement("span", App.UI.DOM.link("Change", () => { + const linkArray = []; + linkArray.push( + App.UI.DOM.link( + "Reset", + () => { + for (const s of V.slaves) { + if (s.mother === slave.ID && s.newGamePlus === 0) { + s.mother = 0; + } } - } - if (V.PC.mother === slave.ID && _allowPCFamily) { - V.PC.mother = 0; - } - refresh(); - } - ) - ); - - if (slave.vagina >= 0) { - if (isNotMom(V.PC) && (slave.actualAge - V.PC.actualAge) >= V.fertilityAge && _allowPCFamily) { - linkArray.push( - App.UI.DOM.link( - "You", - () => { - setRel(V.PC); - refresh(); + if (V.PC.mother === slave.ID && _allowPCFamily) { + V.PC.mother = 0; } - ) - ); - } + refresh(); + } + ) + ); - for (const potentialRel of V.slaves) { - if (isNotMom(potentialRel) && ((potentialRel.actualAge - slave.actualAge) >= potentialRel.pubertyAgeXX) && potentialRel.newGamePlus === 0) { + if (slave.vagina >= 0) { + if (isNotMom(V.PC) && (slave.actualAge - V.PC.actualAge) >= V.fertilityAge && _allowPCFamily) { linkArray.push( App.UI.DOM.link( - potentialRel.slaveName, + "You", () => { - setRel(potentialRel); + setRel(V.PC); refresh(); } ) ); } + + for (const potentialRel of V.slaves) { + if (isNotMom(potentialRel) && ((potentialRel.actualAge - slave.actualAge) >= potentialRel.pubertyAgeXX) && potentialRel.newGamePlus === 0) { + linkArray.push( + App.UI.DOM.link( + potentialRel.slaveName, + () => { + setRel(potentialRel); + refresh(); + } + ) + ); + } + } } - } - div.append(App.UI.DOM.generateLinksStrip(linkArray)); + jQuery(change).empty().append(App.UI.DOM.makeElement("div", App.UI.DOM.generateLinksStrip(linkArray))); + })); + div.append(change); return div; @@ -412,56 +484,59 @@ App.Intro.editFamily = function(slave, cheat) { function fatherOfTheChildren() { const div = document.createElement("div"); - const linkArray = []; div.append(fatheredNames()); - linkArray.push( - App.UI.DOM.link( - "Reset", - () => { - for (const s of V.slaves) { - if (s.father === slave.ID && s.newGamePlus === 0) { - s.father = 0; + const change = App.UI.DOM.makeElement("span", App.UI.DOM.link("Change", () => { + const linkArray = []; + linkArray.push( + App.UI.DOM.link( + "Reset", + () => { + for (const s of V.slaves) { + if (s.father === slave.ID && s.newGamePlus === 0) { + s.father = 0; + } } - } - if (V.PC.father === slave.ID && _allowPCFamily) { - V.PC.father = 0; - } - refresh(); - } - ) - ); - - if (slave.dick > 0) { - if (isNotDad(V.PC) && (slave.actualAge - V.PC.actualAge) >= V.potencyAge && _allowPCFamily) { - linkArray.push( - App.UI.DOM.link( - "You", - () => { - V.PC.father = slave.ID; - refresh(); + if (V.PC.father === slave.ID && _allowPCFamily) { + V.PC.father = 0; } - ) - ); - } + refresh(); + } + ) + ); - for (const potentialRel of V.slaves) { - if (isNotDad(potentialRel) && ((potentialRel.actualAge - slave.actualAge) >= potentialRel.pubertyAgeXX) && potentialRel.newGamePlus === 0) { + if (slave.dick > 0) { + if (isNotDad(V.PC) && (slave.actualAge - V.PC.actualAge) >= V.potencyAge && _allowPCFamily) { linkArray.push( App.UI.DOM.link( - potentialRel.slaveName, + "You", () => { - potentialRel.father = slave.ID; + V.PC.father = slave.ID; refresh(); } ) ); } + + for (const potentialRel of V.slaves) { + if (isNotDad(potentialRel) && ((potentialRel.actualAge - slave.actualAge) >= potentialRel.pubertyAgeXX) && potentialRel.newGamePlus === 0) { + linkArray.push( + App.UI.DOM.link( + potentialRel.slaveName, + () => { + potentialRel.father = slave.ID; + refresh(); + } + ) + ); + } + } } - } - div.append(App.UI.DOM.generateLinksStrip(linkArray)); + jQuery(change).empty().append(App.UI.DOM.makeElement("div", App.UI.DOM.generateLinksStrip(linkArray))); + })); + div.append(change); return div; } diff --git a/src/npc/startingGirls/startingGirls.js b/src/npc/startingGirls/startingGirls.js index fb5a18b12935dadacf6cc20b45ac73083aaedb34..f59abeb9a0cddf0ee050d53640f6710e50143f20 100644 --- a/src/npc/startingGirls/startingGirls.js +++ b/src/npc/startingGirls/startingGirls.js @@ -1016,12 +1016,6 @@ App.StartingGirls.upper = function(slave, cheat = false) { options.addOption("Shoulders", "shoulders", slave) .addValueList([["Very narrow", -2], ["Narrow", -1], ["Feminine", 0], ["Broad", 1], ["Very broad", 2]]); - option = options.addOption("Hips", "hips", slave) - .addValueList([["Very narrow", -2], ["Narrow", -1], ["Normal", 0], ["Broad", 1], ["Very broad", 2]]); - if (cheat) { - option.addValue("Unnaturally broad", 3); - } - el.append(options.render()); return el; }; @@ -1036,6 +1030,11 @@ App.StartingGirls.lower = function(slave, cheat = false) { const {he} = getPronouns(slave); const options = new App.UI.OptionsGroup(); let option; + option = options.addOption("Hips", "hips", slave) + .addValueList([["Very narrow", -2], ["Narrow", -1], ["Normal", 0], ["Broad", 1], ["Very broad", 2]]); + if (cheat) { + option.addValue("Unnaturally broad", 3); + } options.addOption("Hips implant", "hipsImplant", slave) .addValueList([["Very narrow", -2], ["Narrow", -1], ["Normal", 0], ["Broad", 1], ["Very broad", 2]]);