Skip to content
Snippets Groups Projects
Commit 2bc16a25 authored by Pregmodder's avatar Pregmodder
Browse files

Merge branch 'pregmod-newcontent1_0-fixes' into 'pregmod-newcontent1_0'

Pregmod newcontent1 0 fixes

See merge request pregmodfan/fc-pregmod!2928
parents 55fbad84 c51d5f35
No related branches found
No related tags found
No related merge requests found
......@@ -321,6 +321,53 @@ window.fetalSplit = function(actor) {
WombNormalizePreg(actor);
};
//safe alternative to .womb.length.
window.WombFetusCount(actor){
WombInit(actor);
return actor.womb.length;
}
//give reference to fetus object, but not remove fetus, use for manupulation in the womb.
window.WombGetFetus = function(actor, fetusNum){
WombInit(actor);
if (actor.womb.length >= fetusNum)
return actor.womb[fetusNum];
else
return null;
}
//give reference to fetus object, and remove it form the womb.
window.WombRemoveFetus = function(actor, fetusNum){
WombInit(actor);
if (actor.womb.length >= fetusNum){
ft = actor.womb[fetusNum];
actor.womb.splice(fetusNum, 1);
WombSort(actor);
}
else
return null;
}
//to add fetus object in the womb. Be warned - you can add one single fetus to many wombs, or even add it many times to one womb. It's will not show error, but behavior become strange, as fetus object will be the same - it's reference, not full copies. If this not desired - use deepCopy on fetus before adding.
window.WombAddFetus = function(actor, fetus)
{
WombInit(actor);
actor.womb.push(fetus);
WombSort(actor);
}
// change property for all fetuses. Like fetus.age = X.
window.WombChangeFetus = function(actor, propName, newValue){
WombInit(actor);
actor.womb.forEach(ft => ft[propName] = newValue);
}
// change genetic property of all fetuses. Like fetus.genetic.intelligence = X
window.WombChangeGene = function(actor, geneName, newValue){
WombInit(actor);
actor.womb.forEach(ft => ft.genetic[geneName] = newValue);
}
/* alt
window.fetalSplit = function(actor)
{
......
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