Skip to content
Snippets Groups Projects
Commit 56adac36 authored by lowercasedonkey's avatar lowercasedonkey
Browse files

finish mother

parent f463b0af
No related branches found
No related tags found
1 merge request!8477Edit family to js
......@@ -23,6 +23,7 @@ App.Intro.editFamily = function(slave) {
function mother() {
const div = new DocumentFragment();
const linkArray = [];
const requirements = (s) => (s.vagina > 0 && ((s.mother !== slave.mother) || (slave.mother === 0)));
const nameEl = makeElWithID("motherName")
nameEl.append(parentName("mother"));
......@@ -40,7 +41,7 @@ App.Intro.editFamily = function(slave) {
)
)
if (V.PC.vagina > 0 && ((V.PC.actualAge - slave.actualAge) >= V.fertilityAge) && ((V.PC.mother !== slave.mother) || (slave.mother === 0)) && _allowPCFamily) {
if (requirements(V.PC) && ((V.PC.actualAge - slave.actualAge) >= V.fertilityAge) && _allowPCFamily) {
linkArray.push(
App.UI.DOM.link(
"You",
......@@ -52,15 +53,13 @@ App.Intro.editFamily = function(slave) {
)
}
for (_efw = 0; _efw < V.slaves.length; _efw++) {
if (V.slaves[_efw].vagina > 0 && ((V.slaves[_efw].actualAge - slave.actualAge) >= V.slaves[_efw].pubertyAgeXX) && ((V.slaves[_efw].mother !== slave.mother) || (slave.mother === 0)) && V.slaves[_efw].newGamePlus === 0) {
_id = V.slaves[_efw].ID;
_slaveName = V.slaves[_efw].slaveName;
for (const potentialRel of V.slaves) {
if (requirements(potentialRel) && ((potentialRel.actualAge - slave.actualAge) >= potentialRel.pubertyAgeXX) && potentialRel.newGamePlus === 0) {
linkArray.push(
App.UI.DOM.link(
_slaveName,
potentialRel.slaveName,
() => {
slave.mother = _id
slave.mother = potentialRel.ID
refresh();
}
)
......@@ -68,6 +67,8 @@ App.Intro.editFamily = function(slave) {
}
}
div.append(App.UI.DOM.generateLinksStrip(linkArray));
return div;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment