Skip to content
Snippets Groups Projects
Commit 5e1f86d7 authored by svornost's avatar svornost
Browse files

Allow creation of any starting girls' relative from the starting girls screen,...

Allow creation of any starting girls' relative from the starting girls screen, not just the last one.
parent 68fe2daa
No related branches found
No related tags found
No related merge requests found
App.StartingGirls.passage = function() { App.StartingGirls.passage = function() {
if (!V.activeSlave) { if (!V.activeSlave) {
V.activeSlave = App.StartingGirls.generate(); V.activeSlave = V.activeSlave ||App.StartingGirls.generate();
} }
const el = new DocumentFragment(); const el = new DocumentFragment();
let r = []; let r = [];
...@@ -21,13 +21,11 @@ App.StartingGirls.passage = function() { ...@@ -21,13 +21,11 @@ App.StartingGirls.passage = function() {
} }
r.push(`these slaves, <span class="springgreen">they cost half of what they normally would have here.</span>`); r.push(`these slaves, <span class="springgreen">they cost half of what they normally would have here.</span>`);
} }
} else {
const pronoun = V.slaves.length > 0 ? "they" : getPronouns(V.slaves[0]).he;
r.push(`${toSentence(V.slaves.map(s => SlaveFullName(s)))}'s records have been finalized; ${pronoun} will arrive with you when you take over your new arcology.`);
} }
App.UI.DOM.makeElement("div", "Current cash reserves can be found on the far left sidebar."); r.push(App.UI.DOM.makeElement("div", "Current cash reserves can be found on the far left sidebar."));
if (V.slaves.length === 1) {
App.UI.DOM.makeElement("div", "One slave is already committed.");
} else if (V.slaves.length > 1) {
App.UI.DOM.makeElement("div", `${V.slaves.length} slaves already committed.`);
}
App.Events.addNode(el, r, "p"); App.Events.addNode(el, r, "p");
const headerLinks = App.UI.DOM.appendNewElement("div", el); const headerLinks = App.UI.DOM.appendNewElement("div", el);
...@@ -231,6 +229,103 @@ App.StartingGirls.passage = function() { ...@@ -231,6 +229,103 @@ App.StartingGirls.passage = function() {
) )
); );
if (V.slaves.length > 0) {
linkArray.push(
App.UI.DOM.link(
`Start over with a finalized slave's relative`,
() => {
const el = new DocumentFragment();
const select = App.UI.DOM.appendNewElement("select", el);
for (const slave of V.slaves) {
const option = App.UI.DOM.appendNewElement("option", select, `${SlaveFullName(slave)} (${slave.genes}, ${slave.actualAge})`);
option.value = slave.ID.toString();
}
select.selectedIndex = -1;
select.onchange = () => {
const ID = Number.parseInt(select.options[select.selectedIndex].value);
const srcSlave = getSlave(ID);
const relatives = [];
const makeSiblingLink = (sibling) => {
return App.UI.DOM.link(capFirstChar(sibling), () => {
setMissingParents(srcSlave);
V.activeSlave = generateRelatedSlave(srcSlave, sibling);
App.StartingGirls.randomizeUnknowns(V.activeSlave);
}, [], "Starting Girls");
};
if (srcSlave) {
relatives.push(makeSiblingLink("twin"));
if (V.seeDicks !== 100 && srcSlave.mother === 0) {
const ageRange = getParentAgeRange(srcSlave, false);
if (ageRange.min <= ageRange.max) {
relatives.push(
App.UI.DOM.link("Mother", () => {
V.activeSlave = generateRelatedSlave(srcSlave, "mother");
App.StartingGirls.randomizeUnknowns(V.activeSlave);
srcSlave.mother = V.activeSlave.ID;
}, [], "Starting Girls")
);
}
}
if (V.seeDicks !== 0 && srcSlave.father === 0) {
const ageRange = getParentAgeRange(srcSlave, true);
if (ageRange.min <= ageRange.max) {
relatives.push(
App.UI.DOM.link("Father", () => {
V.activeSlave = generateRelatedSlave(srcSlave, "father");
App.StartingGirls.randomizeUnknowns(V.activeSlave);
srcSlave.father = V.activeSlave.ID;
}, [], "Starting Girls")
);
}
}
if (srcSlave.actualAge < V.retirementAge - 2) {
if (V.seeDicks !== 100) {
relatives.push(makeSiblingLink("older sister"));
}
if (V.seeDicks !== 0) {
relatives.push(makeSiblingLink("older brother"));
}
}
if (srcSlave.actualAge > V.minimumSlaveAge + 2) {
if (V.seeDicks !== 100) {
relatives.push(makeSiblingLink("younger sister"));
}
if (V.seeDicks !== 0) {
relatives.push(makeSiblingLink("younger brother"));
}
}
if (srcSlave.actualAge > V.minimumSlaveAge + 11) {
if (V.seeDicks !== 100) {
relatives.push(
App.UI.DOM.link("Daughter", () => {
V.activeSlave = generateRelatedSlave(srcSlave, "daughter");
App.StartingGirls.randomizeUnknowns(V.activeSlave);
}, [], "Starting Girls")
);
}
if (V.seeDicks !== 0) {
relatives.push(
App.UI.DOM.link("Son", () => {
V.activeSlave = generateRelatedSlave(srcSlave, "son");
App.StartingGirls.randomizeUnknowns(V.activeSlave);
}, [], "Starting Girls")
);
}
}
}
jQuery(linkDiv).empty().append(App.UI.DOM.generateLinksStrip(relatives));
};
App.UI.DOM.appendNewElement("div", el, App.UI.DOM.combineNodes(`Relative of slave: `, select));
const linkDiv = App.UI.DOM.appendNewElement("div", el, ``);
App.UI.DOM.appendNewElement("div", el, "Note: finalized slaves have already had your career bonuses applied, and these will transfer to the generated relative; remove them if you don't want to be charged for them.", "note");
App.UI.DOM.appendNewElement("div", el, "Warning: related slaves will influence each others' opinion of you, and may become difficult to control if not properly broken.", "note");
App.UI.DOM.appendNewElement("div", el, App.UI.DOM.passageLink("Back", "Starting Girls"));
jQuery(headerLinks).empty().append(el);
}
)
);
}
linkArray.push(App.UI.DOM.passageLink("Take control of your arcology", "Acquisition")); linkArray.push(App.UI.DOM.passageLink("Take control of your arcology", "Acquisition"));
headerLinks.append(App.UI.DOM.generateLinksStrip(linkArray)); headerLinks.append(App.UI.DOM.generateLinksStrip(linkArray));
el.append(headerLinks); el.append(headerLinks);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment