From 89e3ffab068051c2dbfd4acfd17a05ed36a0e4ef Mon Sep 17 00:00:00 2001 From: lowercasedonkey <lowercasedonkey@gmail.com> Date: Wed, 3 Feb 2021 23:03:00 -0500 Subject: [PATCH] starting girls --- src/npc/startingGirls/startingGirlsPassage.js | 404 +++++++++++------- 1 file changed, 239 insertions(+), 165 deletions(-) diff --git a/src/npc/startingGirls/startingGirlsPassage.js b/src/npc/startingGirls/startingGirlsPassage.js index b6f933f97de..0fbe051eede 100644 --- a/src/npc/startingGirls/startingGirlsPassage.js +++ b/src/npc/startingGirls/startingGirlsPassage.js @@ -1,8 +1,7 @@ -App.startingGirls.passage = function() { +App.startingGirls.passage = function(slave) { const el = new DocumentFragment(); let r = []; let linkArray = []; - //<p> if (V.slaves.length === 0) { r.push(`You're no stranger to the Free Cities, which means you're no stranger to slavery. If you wish, you can bring slaves from your past life with you to your arcology. You can spend your cash reserves on slaves here, or bring it with you to start the game. Slaves created here will be much cheaper than if they were purchased on the market.`); if (V.PC.dick !== 0 && V.PC.vagina !== -1 && (V.seeDicks !== 0 || V.makeDicks === 1)) { @@ -20,181 +19,256 @@ App.startingGirls.passage = function() { r.push(`these slaves, <span class="springgreen">they cost half of what they normally would have here.</span>`); } } - //<br>Current cash reserves can be found on the far left sidebar. + App.UI.DOM.makeElement("div", "Current cash reserves can be found on the far left sidebar."); if (V.slaves.length === 1) { - //<br>One slave is already committed. + App.UI.DOM.makeElement("div", "One slave is already committed."); } else if (V.slaves.length > 1) { - //<br>V.slaves.length slaves already committed. + App.UI.DOM.makeElement("div", `${V.slaves.length} slaves already committed.`); } -//</p> - -//<p> - <span id="headerLinks"> - <span class="major-link"> - <<link "Refresh" "Starting Girls">> -<</link>> - </span> - - | <<link "Randomize career" "Starting Girls">> - slave.career = randomCareer(slave); - <</link>> - - | <<link "Randomize name" "Starting Girls">> - nationalityToName(slave); - slave.slaveName = slave.birthName; - <</link>> - - | <<link "Start over with a random slave" "Starting Girls">> - slave = App.StartingGirls.generate(); - <</link>> - - | <<link "Start over by selecting an archetype">> - <<replace "#headerLinks">> - <div class="note"> - r.push(`Convenient combinations of slave attributes`); - </div> - <div class="indent"> - <<link "Irish Rose" "Starting Girls">> - slave = App.StartingGirls.generate({ nationality: "Irish", race: "white" }); - slave.eye.origColor = "green", slave.origSkin = "fair", slave.origHColor = "red", slave.markings = "heavily freckled"; - <</link>> - <span class="note"> - r.push(`A beautiful flower from the Emerald Isle`); - </span> - </div> - - <div class="indent"> - <<link "Cali Girl" "Starting Girls">> - slave = App.StartingGirls.generate({ nationality: "American" }); - slave.eye.origColor = "blue", slave.skin = "sun tanned", slave.override_Skin = 1, slave.origHColor = "blonde", slave.markings = "none", slave.face = 95, slave.muscles = 20, slave.weight = -20, slave.height = Math.round(Height.forAge(190, slave)); - <</link>> - <span class="note"> - r.push(`Tall, taut, and tan`); - </span> - </div> - - <div class="indent"> - <<link "Novice" "Starting Girls">> + App.Events.addNode(el, r, "p"); + + const headerLinks = App.UI.DOM.appendNewElement("div", el); + linkArray.push( + App.UI.DOM.makeElement("span", App.UI.DOM.appendNewElement("span", App.UI.DOM.passageLink("Refresh", "Starting Girls"), "major-link")) + ); + linkArray.push( + App.UI.DOM.link( + "Randomize career", + () => { + slave.career = randomCareer(slave); + }, + [], + "Starting Girls" + ) + ); + + linkArray.push( + App.UI.DOM.link( + "Randomize name", + () => { + nationalityToName(slave); + slave.slaveName = slave.birthName; + }, + [], + "Starting Girls" + ) + ); + + linkArray.push( + App.UI.DOM.link( + "Start over with a random slave", + () => { + slave = App.StartingGirls.generate(); + }, + [], + "Starting Girls" + ) + ); + + linkArray.push( + App.UI.DOM.link( + "Start over by selecting an archetype", + () => { + const el = new DocumentFragment(); + App.UI.DOM.appendNewElement("div", el, "Convenient combinations of slave attributes", "note"); + App.UI.DOM.appendNewElement("div", el, App.UI.DOM.link( + "Irish Rose", + () => { + slave = App.StartingGirls.generate({nationality: "Irish", race: "white"}); + slave.eye.origColor = "green"; + slave.origSkin = "fair"; + slave.origHColor = "red"; + slave.markings = "heavily freckled"; + }, + [], + "Starting Girls" + ), "indent") + .append(App.UI.DOM.makeElement("span", "A beautiful flower from the Emerald Isle", "note")); + + App.UI.DOM.appendNewElement("div", el, App.UI.DOM.link( + "Cali Girl", + () => { + slave = App.StartingGirls.generate({nationality: "American"}); + slave.eye.origColor = "blue"; + slave.skin = "sun tanned"; + slave.override_Skin = 1; + slave.origHColor = "blonde"; + slave.markings = "none"; + slave.face = 95; + slave.muscles = 20; + slave.weight = -20; + slave.height = Math.round(Height.forAge(190, slave)); + }, + [], + "Starting Girls" + ), "indent") + .append(App.UI.DOM.makeElement("span", "Tall, taut, and tan", "note")); + + App.UI.DOM.appendNewElement("div", el, App.UI.DOM.link( + "Novice", + () => { slave = App.StartingGirls.generate(); - slave.skill.anal = 0, slave.skill.oral = 0, slave.skill.vaginal = 0, slave.skill.whoring = 0, slave.skill.entertainment = 0, slave.skill.combat = 0, slave.actualAge = 18, slave.visualAge = 18, slave.physicalAge = 18, slave.fetishKnown = 0, slave.attrKnown = 0; - <</link>> - <span class="note"> - r.push(`Train your own and save`); - </span> - </div> - - <div class="indent"> - <<link "Head Girl Prospect" "Starting Girls">> - slave = App.StartingGirls.generate({ minAge: 36, maxAge: 44 }); - slave.career = App.Data.Careers.Leader.HG.random(), slave.intelligence = 70, slave.intelligenceImplant = 0; - <</link>> - <span class="note"> - r.push(`Inexpensive potential to become a great right hand woman`); - </span> - </div> + slave.skill.anal = 0; + slave.skill.oral = 0; + slave.skill.vaginal = 0; + slave.skill.whoring = 0; + slave.skill.entertainment = 0; + slave.skill.combat = 0; + slave.actualAge = 18; + slave.visualAge = 18; + slave.physicalAge = 18; + slave.fetishKnown = 0; + slave.attrKnown = 0; + }, + [], + "Starting Girls" + ), "indent") + .append(App.UI.DOM.makeElement("span", "Train your own and save", "note")); + + App.UI.DOM.appendNewElement("div", el, App.UI.DOM.link( + "Head Girl Prospect", + () => { + slave = App.StartingGirls.generate({minAge: 36, maxAge: 44}); + slave.career = App.Data.Careers.Leader.HG.random(); + slave.intelligence = 70; + slave.intelligenceImplant = 0; + }, + [], + "Starting Girls" + ), "indent") + .append(App.UI.DOM.makeElement("span", "Inexpensive potential to become a great right hand woman", "note")); + if (V.seeExtreme !== 0) { - <div class="indent"> - <<link "Wellspring" "Starting Girls">> - slave = App.StartingGirls.generate({ minAge: 18, maxAge: 18 }); - slave.skill.anal = 0, slave.skill.oral = 0, slave.skill.vaginal = 0, slave.skill.whoring = 0, slave.skill.entertainment = 0, slave.skill.combat = 0, slave.fetishKnown = 0, slave.attrKnown = 0, slave.health.condition = 10, slave.intelligence = -100, slave.intelligenceImplant = 0, slave.vagina = 3, slave.anus = 3, slave.ovaries = 1, slave.dick = 5, slave.balls = 5, slave.prostate = 1, slave.lactation = 2, slave.lactationDuration = 2, slave.nipples = "huge", slave.boobs = 10000; - <</link>> - <span class="note"> - r.push(`Capable of producing all kinds of useful fluids`); - </span> - </div> - - <div class="indent"> - <<link "Onahole" "Starting Girls">> + App.UI.DOM.appendNewElement("div", el, App.UI.DOM.link( + "Wellspring", + () => { + slave = App.StartingGirls.generate({minAge: 18, maxAge: 18}); + slave.skill.anal = 0; + slave.skill.oral = 0; + slave.skill.vaginal = 0; + slave.skill.whoring = 0; + slave.skill.entertainment = 0; + slave.skill.combat = 0; + slave.fetishKnown = 0; + slave.attrKnown = 0; + slave.health.condition = 10; + slave.intelligence = -100; + slave.intelligenceImplant = 0; + slave.vagina = 3; + slave.anus = 3; + slave.ovaries = 1; + slave.dick = 5; + slave.balls = 5; + slave.prostate = 1; + slave.lactation = 2; + slave.lactationDuration = 2; + slave.nipples = "huge"; + slave.boobs = 10000; + }, + [], + "Starting Girls" + ), "indent") + .append(App.UI.DOM.makeElement("span", "Capable of producing all kinds of useful fluids", "note")); + + App.UI.DOM.appendNewElement("div", el, App.UI.DOM.link( + "Onahole", + () => { slave = App.StartingGirls.generate(); - slave.skill.anal = 0, slave.skill.oral = 0, slave.skill.vaginal = 0, slave.skill.whoring = 0, slave.skill.entertainment = 0, slave.skill.combat = 0, slave.fetish = "mindbroken", slave.voice = 0, slave.hears = 0; - removeLimbs(slave, "all"), eyeSurgery(slave, "both", "normal"); - <</link>> - <span class="note"> - r.push(`A living cocksleeve`); - </span> - </div> + slave.skill.anal = 0; + slave.skill.oral = 0; + slave.skill.vaginal = 0; + slave.skill.whoring = 0; + slave.skill.entertainment = 0; + slave.skill.combat = 0; + slave.fetish = "mindbroken"; + slave.voice = 0; + slave.hears = 0; + removeLimbs(slave, "all"); + eyeSurgery(slave, "both", "normal"); + }, + [], + "Starting Girls" + ), "indent") + .append(App.UI.DOM.makeElement("span", "A living cocksleeve", "note")); } - <div class="indent"> - <<link "Back" "Starting Girls">> -<</link>> - </div> - <</replace>> - <</link>> - - if (!V.showSGNationalities) { - | <<link "Start over by selecting a nationality" "Starting Girls">> - V.showSGNationalities = 1; - <</link>> - } + App.UI.DOM.appendNewElement("div", el, App.UI.DOM.passageLink("Back", "Starting Girls"), "indent"); + jQuery(headerLinks).empty().append(el); + }, + [], + "Starting Girls" + ) + ); - | <<link "Take control of your arcology" "Acquisition">> - delete V.showSGNationalities; - <</link>> - </span> - <hr> -//</p> - -if (V.showSGNationalities) { - //<p> - <h3>Start over by selecting a nationality:</h3> - <div> - <<for _sg = 0; _sg < setup.baseNationalities.length; _sg++>> - _nation = setup.baseNationalities[_sg]; - <<capture _nation>> - <<link _nation "Starting Girls">> - slave = App.StartingGirls.generate({ nationality: _nation }); - <</link>> - <</capture>> - if (_sg < setup.baseNationalities.length-1) { - | + linkArray.push( + App.UI.DOM.link( + "Start over by selecting a nationality", + () => { + const el = new DocumentFragment(); + const linkArray = []; + App.UI.DOM.appendNewElement("h3", el, "Start over by selecting a nationality:"); + for (const nation of App.Data.misc.baseNationalities) { + linkArray.push( + App.UI.DOM.link( + nation, + () => { + slave = App.StartingGirls.generate({nationality: nation}); + }, + [], + "Starting Girls" + ) + ); } - <</for>> - </div> - <div> - <<link "Hide" "Starting Girls">> -V.showSGNationalities = 0; -<</link>> - </div> - <hr> - //</p> -} - -App.UI.tabBar.handlePreSelectedTab(V.tabChoice.StartingGirls); - -if (!slave) { - slave = App.StartingGirls.generate(); -} - -App.StartingGirls.cleanup(slave); -_slaveCost = startingSlaveCost(slave); - -if (slave.father === -1) { - if (V.PC.dick === 0) { - slave.father = 0; - } else if ((V.PC.actualAge - slave.actualAge) < V.minimumSlaveAge || ((V.PC.actualAge - slave.actualAge) < V.potencyAge)) { - slave.father = 0; + el.append(App.UI.DOM.generateLinksStrip(linkArray)); + App.UI.DOM.appendNewElement("div", el, App.UI.DOM.passageLink("back", "Starting Girls")); + jQuery(headerLinks).empty().append(el); + }, + [], + "Starting Girls" + ) + ); + + linkArray.push(App.UI.DOM.passageLink("Take control of your arcology", "Acquisition")); + headerLinks.append(App.UI.DOM.generateLinksStrip(linkArray)); + el.append(headerLinks); + App.UI.DOM.appendNewElement("hr", el); + + + App.UI.tabBar.handlePreSelectedTab(V.tabChoice.StartingGirls); + + if (!slave) { + slave = App.StartingGirls.generate(); } - if (V.saveImported === 1) { - slave.father = 0; + + App.StartingGirls.cleanup(slave); + const _slaveCost = startingSlaveCost(slave); + + if (slave.father === -1) { + if (V.PC.dick === 0) { + slave.father = 0; + } else if ((V.PC.actualAge - slave.actualAge) < V.minimumSlaveAge || ((V.PC.actualAge - slave.actualAge) < V.potencyAge)) { + slave.father = 0; + } + if (V.saveImported === 1) { + slave.father = 0; + } } -} -if (slave.mother === -1) { - if (V.PC.vagina === -1) { - slave.mother = 0; - } else if (((V.PC.actualAge - slave.actualAge) < V.minimumSlaveAge) || ((V.PC.actualAge - slave.actualAge) < V.fertilityAge)) { - slave.mother = 0; + if (slave.mother === -1) { + if (V.PC.vagina === -1) { + slave.mother = 0; + } else if (((V.PC.actualAge - slave.actualAge) < V.minimumSlaveAge) || ((V.PC.actualAge - slave.actualAge) < V.fertilityAge)) { + slave.mother = 0; + } + if (V.saveImported === 1) { + slave.mother = 0; + } } - if (V.saveImported === 1) { - slave.mother = 0; + /* this block makes starting girls actually apply the slave origins, mostly since it just hates you and everything you do */ + if (V.originOverride !== 1) { + App.StartingGirls.applyPlayerOrigin(slave); } -} -/* this block makes starting girls actually apply the slave origins, mostly since it just hates you and everything you do */ -if (V.originOverride !== 1) { - App.StartingGirls.applyPlayerOrigin(slave); -} - -<h2>You are customizing this slave:</h2> -<<includeDOM App.Desc.longSlave(V.activeSlave, {market: "generic"})>></div> -} \ No newline at end of file + + App.UI.DOM.appendNewElement("h2", el, "You are customizing this slave:"); + el.append(App.Desc.longSlave(slave, {market: "generic"})); +}; -- GitLab