diff --git a/devNotes/twine JS.txt b/devNotes/twine JS.txt index 6172038987e2b3f34fe1286bb0f696fa29e2c661..32841e6e974da1fff508ad3f4a679f3faf7e8fb0 100644 --- a/devNotes/twine JS.txt +++ b/devNotes/twine JS.txt @@ -10644,6 +10644,34 @@ window.generateChild = function(mother, ova, destination) { } } else { child.slaveName = genes.name; + if (genes.mother == -1) { + child.slaveSurname = V.PC.surname; + } else { + if (genes.father == -1) { + child.slaveSurname = V.PC.surname; + } else if (genes.father > 0) { + let currentMother = getSlave(genes.mother); + if (currentMother !== undefined) { + if (currentMother.slaveSurname !== 0 && currentMother.slaveSurname !== "") { + child.slaveSurname = currentMother.slaveSurname; + } + } else { + let currentFather = getSlave(genes.father); + if (currentFather !== undefined) { + if (currentFather.slaveSurname !== 0 && currentFather.slaveSurname !== "") { + child.slaveSurname = currentFather.slaveSurname; + } + } + } + } else { + let currentMother = getSlave(genes.mother); + if (currentMother !== undefined) { + if (currentMother.slaveSurname !== 0 && currentMother.slaveSurname !== "") { + child.slaveSurname = currentMother.slaveSurname; + } + } + } + } } } else { child.genes = "XY"; @@ -10687,6 +10715,34 @@ window.generateChild = function(mother, ova, destination) { } } else { child.slaveName = genes.name; + if (genes.mother == -1) { + child.slaveSurname = V.PC.surname; + } else { + if (genes.father == -1) { + child.slaveSurname = V.PC.surname; + } else if (genes.father > 0) { + let currentMother = getSlave(genes.mother); + if (currentMother !== undefined) { + if (currentMother.slaveSurname !== 0 && currentMother.slaveSurname !== "") { + child.slaveSurname = currentMother.slaveSurname; + } + } else { + let currentFather = getSlave(genes.father); + if (currentFather !== undefined) { + if (currentFather.slaveSurname !== 0 && currentFather.slaveSurname !== "") { + child.slaveSurname = currentFather.slaveSurname; + } + } + } + } else { + let currentMother = getSlave(genes.mother); + if (currentMother !== undefined) { + if (currentMother.slaveSurname !== 0 && currentMother.slaveSurname !== "") { + child.slaveSurname = currentMother.slaveSurname; + } + } + } + } } } @@ -10788,6 +10844,34 @@ window.generateChild = function(mother, ova, destination) { } } else { child.slaveName = genes.name; + if (genes.mother == -1) { + child.slaveSurname = V.PC.surname; + } else { + if (genes.father == -1) { + child.slaveSurname = V.PC.surname; + } else if (genes.father > 0) { + let currentMother = getSlave(genes.mother); + if (currentMother !== undefined) { + if (currentMother.slaveSurname !== 0 && currentMother.slaveSurname !== "") { + child.slaveSurname = currentMother.slaveSurname; + } + } else { + let currentFather = getSlave(genes.father); + if (currentFather !== undefined) { + if (currentFather.slaveSurname !== 0 && currentFather.slaveSurname !== "") { + child.slaveSurname = currentFather.slaveSurname; + } + } + } + } else { + let currentMother = getSlave(genes.mother); + if (currentMother !== undefined) { + if (currentMother.slaveSurname !== 0 && currentMother.slaveSurname !== "") { + child.slaveSurname = currentMother.slaveSurname; + } + } + } + } } } else { GenerateNewSlave("XY"); @@ -10832,6 +10916,34 @@ window.generateChild = function(mother, ova, destination) { } } else { child.slaveName = genes.name; + if (genes.mother == -1) { + child.slaveSurname = V.PC.surname; + } else { + if (genes.father == -1) { + child.slaveSurname = V.PC.surname; + } else if (genes.father > 0) { + let currentMother = getSlave(genes.mother); + if (currentMother !== undefined) { + if (currentMother.slaveSurname !== 0 && currentMother.slaveSurname !== "") { + child.slaveSurname = currentMother.slaveSurname; + } + } else { + let currentFather = getSlave(genes.father); + if (currentFather !== undefined) { + if (currentFather.slaveSurname !== 0 && currentFather.slaveSurname !== "") { + child.slaveSurname = currentFather.slaveSurname; + } + } + } + } else { + let currentMother = getSlave(genes.mother); + if (currentMother !== undefined) { + if (currentMother.slaveSurname !== 0 && currentMother.slaveSurname !== "") { + child.slaveSurname = currentMother.slaveSurname; + } + } + } + } } } diff --git a/src/js/generateGenetics.tw b/src/js/generateGenetics.tw index 87987638965a41da15fdd0d97fd67cd9fba03392..eeee9419b8e916b89d4d6c6f1bbcbc705279bf62 100644 --- a/src/js/generateGenetics.tw +++ b/src/js/generateGenetics.tw @@ -575,6 +575,34 @@ window.generateChild = function(mother, ova, destination) { } } else { child.slaveName = genes.name; + if (genes.mother == -1) { + child.slaveSurname = V.PC.surname; + } else { + if (genes.father == -1) { + child.slaveSurname = V.PC.surname; + } else if (genes.father > 0) { + let currentMother = getSlave(genes.mother); + if (currentMother !== undefined) { + if (currentMother.slaveSurname !== 0 && currentMother.slaveSurname !== "") { + child.slaveSurname = currentMother.slaveSurname; + } + } else { + let currentFather = getSlave(genes.father); + if (currentFather !== undefined) { + if (currentFather.slaveSurname !== 0 && currentFather.slaveSurname !== "") { + child.slaveSurname = currentFather.slaveSurname; + } + } + } + } else { + let currentMother = getSlave(genes.mother); + if (currentMother !== undefined) { + if (currentMother.slaveSurname !== 0 && currentMother.slaveSurname !== "") { + child.slaveSurname = currentMother.slaveSurname; + } + } + } + } } } else { child.genes = "XY"; @@ -618,6 +646,34 @@ window.generateChild = function(mother, ova, destination) { } } else { child.slaveName = genes.name; + if (genes.mother == -1) { + child.slaveSurname = V.PC.surname; + } else { + if (genes.father == -1) { + child.slaveSurname = V.PC.surname; + } else if (genes.father > 0) { + let currentMother = getSlave(genes.mother); + if (currentMother !== undefined) { + if (currentMother.slaveSurname !== 0 && currentMother.slaveSurname !== "") { + child.slaveSurname = currentMother.slaveSurname; + } + } else { + let currentFather = getSlave(genes.father); + if (currentFather !== undefined) { + if (currentFather.slaveSurname !== 0 && currentFather.slaveSurname !== "") { + child.slaveSurname = currentFather.slaveSurname; + } + } + } + } else { + let currentMother = getSlave(genes.mother); + if (currentMother !== undefined) { + if (currentMother.slaveSurname !== 0 && currentMother.slaveSurname !== "") { + child.slaveSurname = currentMother.slaveSurname; + } + } + } + } } } @@ -719,6 +775,34 @@ window.generateChild = function(mother, ova, destination) { } } else { child.slaveName = genes.name; + if (genes.mother == -1) { + child.slaveSurname = V.PC.surname; + } else { + if (genes.father == -1) { + child.slaveSurname = V.PC.surname; + } else if (genes.father > 0) { + let currentMother = getSlave(genes.mother); + if (currentMother !== undefined) { + if (currentMother.slaveSurname !== 0 && currentMother.slaveSurname !== "") { + child.slaveSurname = currentMother.slaveSurname; + } + } else { + let currentFather = getSlave(genes.father); + if (currentFather !== undefined) { + if (currentFather.slaveSurname !== 0 && currentFather.slaveSurname !== "") { + child.slaveSurname = currentFather.slaveSurname; + } + } + } + } else { + let currentMother = getSlave(genes.mother); + if (currentMother !== undefined) { + if (currentMother.slaveSurname !== 0 && currentMother.slaveSurname !== "") { + child.slaveSurname = currentMother.slaveSurname; + } + } + } + } } } else { GenerateNewSlave("XY"); @@ -763,6 +847,34 @@ window.generateChild = function(mother, ova, destination) { } } else { child.slaveName = genes.name; + if (genes.mother == -1) { + child.slaveSurname = V.PC.surname; + } else { + if (genes.father == -1) { + child.slaveSurname = V.PC.surname; + } else if (genes.father > 0) { + let currentMother = getSlave(genes.mother); + if (currentMother !== undefined) { + if (currentMother.slaveSurname !== 0 && currentMother.slaveSurname !== "") { + child.slaveSurname = currentMother.slaveSurname; + } + } else { + let currentFather = getSlave(genes.father); + if (currentFather !== undefined) { + if (currentFather.slaveSurname !== 0 && currentFather.slaveSurname !== "") { + child.slaveSurname = currentFather.slaveSurname; + } + } + } + } else { + let currentMother = getSlave(genes.mother); + if (currentMother !== undefined) { + if (currentMother.slaveSurname !== 0 && currentMother.slaveSurname !== "") { + child.slaveSurname = currentMother.slaveSurname; + } + } + } + } } }