diff --git a/src/art/vector/Belly.tw b/src/art/vector/Belly.tw index fbbdd63699492f40c4bd8a9c9b8cf0d6a6fa334b..7f848fd8ca35d2a639b82404f693664c099f5db0 100644 --- a/src/art/vector/Belly.tw +++ b/src/art/vector/Belly.tw @@ -14,115 +14,115 @@ <<elseif _artSlave.navelPiercing == 2>> <<include Art_Vector_Belly_Pregnant_Piercing_Heavy>> <<else>> - <<include Art_Vector_Belly>> - <<if _artSlave.clothes == "a hijab and abaya">> - <<include Art_Vector_Belly_Outfit_Abaya>> - <</if>> - <<if _artSlave.clothes == "an apron">> - <<include Art_Vector_Belly_Outfit_Apron>> - <</if>> - <<if _artSlave.clothes == "a ball gown">> - <<include Art_Vector_Belly_Outfit_Ballgown>> - <</if>> - <<if _artSlave.clothes == "battledress">> - <<include Art_Vector_Belly_Outfit_Battledress>> - <</if>> - <<if _artSlave.clothes == "a bunny outfit">> - <<include Art_Vector_Belly_Outfit_Bunny>> - <</if>> - <<if _artSlave.clothes == "a chattel habit">> - <<include Art_Vector_Belly_Outfit_Chattelhabit>> - <</if>> - <<if _artSlave.clothes == "a cheerleader outfit">> - <<include Art_Vector_Belly_Outfit_Cheerleader>> - <</if>> - <<if _artSlave.clothes == "clubslut netting">> - <<include Art_Vector_Belly_Outfit_Clubslut>> - <</if>> - <<if _artSlave.clothes == "conservative clothing">> - <<include Art_Vector_Belly_Outfit_Abaya>> - <</if>> - <<if _artSlave.clothes == "cutoffs and a t-shirt">> - <<include Art_Vector_Belly_Outfit_Cutoffs>> - <</if>> - <<if _artSlave.clothes == "a fallen nuns habit">> - <<include Art_Vector_Belly_Outfit_Fallennun>> - <</if>> - <<if _artSlave.clothes == "a halter top dress">> - <<include Art_Vector_Belly_Outfit_Haltertopdress>> - <</if>> - <<if _artSlave.clothes == "harem gauze">> - <<include Art_Vector_Belly_Outfit_Harem>> - <</if>> - <<if _artSlave.clothes == "a huipil">> - <<include Art_Vector_Belly_Outfit_Huipil>> - <</if>> - <<if _artSlave.clothes == "a kimono">> - <<include Art_Vector_Belly_Outfit_Kimono>> - <</if>> - <<if _artSlave.clothes == "a leotard">> - <<include Art_Vector_Belly_Outfit_Leotard>> - <</if>> - <<if _artSlave.clothes == "a nice maid outfit">> - <<include Art_Vector_Belly_Outfit_Maidnice>> - <</if>> - <<if _artSlave.clothes == "a slutty maid outfit">> - <<include Art_Vector_Belly_Outfit_Maidslut>> - <</if>> - <<if _artSlave.clothes == "a maternity dress">> - <<include Art_Vector_Belly_Outfit_Maternity>> - <</if>> - <<if _artSlave.clothes == "a military uniform">> - <<include Art_Vector_Belly_Outfit_Military>> - <</if>> - <<if _artSlave.clothes == "a mini dress">> - <<include Art_Vector_Belly_Outfit_Minidress>> - <</if>> - <<if _artSlave.clothes == "a monokini">> - <<include Art_Vector_Belly_Outfit_Monokini>> - <</if>> - <<if _artSlave.clothes == "a nice nurse outfit">> - <<include Art_Vector_Belly_Outfit_Nursenice>> - <</if>> - <<if _artSlave.clothes == "a slutty nurse outfit">> - <<include Art_Vector_Belly_Outfit_Nurseslut>> - <</if>> - <<if _artSlave.clothes == "a penitent nuns habit">> - <<include Art_Vector_Belly_Outfit_Penitentnun>> - <</if>> - <<if _artSlave.clothes == "a slutty qipao">> - <<include Art_Vector_Belly_Outfit_Qipao>> - <</if>> - <<if _artSlave.clothes == "a schutzstaffel uniform">> - <<include Art_Vector_Belly_Outfit_Schutzstaffel>> - <</if>> - <<if _artSlave.clothes == "a schoolgirl outfit">> - <<include Art_Vector_Belly_Outfit_Schoolgirl>> - <</if>> - <<if _artSlave.clothes == "a slave gown">> - <<include Art_Vector_Belly_Outfit_Slavegown>> - <</if>> - <<if _artSlave.clothes == "a red army uniform">> - <<include Art_Vector_Belly_Outfit_Soviet>> - <</if>> - <<if _artSlave.clothes == "spats and a tank top">> - <<include Art_Vector_Belly_Outfit_Spats>> - <</if>> - <<if _artSlave.clothes == "a succubus outfit">> - <<include Art_Vector_Belly_Outfit_Succubus>> - <</if>> - <<if _artSlave.clothes == "nice business attire">> - <<include Art_Vector_Belly_Outfit_Suitnice>> - <</if>> - <<if _artSlave.clothes == "slutty business attire">> - <<include Art_Vector_Belly_Outfit_Suitslut>> - <</if>> - <<if _artSlave.clothes == "a toga">> - <<include Art_Vector_Belly_Outfit_Toga>> - <</if>> - <<if _artSlave.clothes == "Western clothing">> - <<include Art_Vector_Belly_Outfit_Western>> - <</if>> + <<include Art_Vector_Belly>> + <</if>> + <<if _artSlave.clothes == "a hijab and abaya">> + <<include Art_Vector_Belly_Outfit_Abaya>> + <</if>> + <<if _artSlave.clothes == "an apron">> + <<include Art_Vector_Belly_Outfit_Apron>> + <</if>> + <<if _artSlave.clothes == "a ball gown">> + <<include Art_Vector_Belly_Outfit_Ballgown>> + <</if>> + <<if _artSlave.clothes == "battledress">> + <<include Art_Vector_Belly_Outfit_Battledress>> + <</if>> + <<if _artSlave.clothes == "a bunny outfit">> + <<include Art_Vector_Belly_Outfit_Bunny>> + <</if>> + <<if _artSlave.clothes == "a chattel habit">> + <<include Art_Vector_Belly_Outfit_Chattelhabit>> + <</if>> + <<if _artSlave.clothes == "a cheerleader outfit">> + <<include Art_Vector_Belly_Outfit_Cheerleader>> + <</if>> + <<if _artSlave.clothes == "clubslut netting">> + <<include Art_Vector_Belly_Outfit_Clubslut>> + <</if>> + <<if _artSlave.clothes == "conservative clothing">> + <<include Art_Vector_Belly_Outfit_Abaya>> + <</if>> + <<if _artSlave.clothes == "cutoffs and a t-shirt">> + <<include Art_Vector_Belly_Outfit_Cutoffs>> + <</if>> + <<if _artSlave.clothes == "a fallen nuns habit">> + <<include Art_Vector_Belly_Outfit_Fallennun>> + <</if>> + <<if _artSlave.clothes == "a halter top dress">> + <<include Art_Vector_Belly_Outfit_Haltertopdress>> + <</if>> + <<if _artSlave.clothes == "harem gauze">> + <<include Art_Vector_Belly_Outfit_Harem>> + <</if>> + <<if _artSlave.clothes == "a huipil">> + <<include Art_Vector_Belly_Outfit_Huipil>> + <</if>> + <<if _artSlave.clothes == "a kimono">> + <<include Art_Vector_Belly_Outfit_Kimono>> + <</if>> + <<if _artSlave.clothes == "a leotard">> + <<include Art_Vector_Belly_Outfit_Leotard>> + <</if>> + <<if _artSlave.clothes == "a nice maid outfit">> + <<include Art_Vector_Belly_Outfit_Maidnice>> + <</if>> + <<if _artSlave.clothes == "a slutty maid outfit">> + <<include Art_Vector_Belly_Outfit_Maidslut>> + <</if>> + <<if _artSlave.clothes == "a maternity dress">> + <<include Art_Vector_Belly_Outfit_Maternity>> + <</if>> + <<if _artSlave.clothes == "a military uniform">> + <<include Art_Vector_Belly_Outfit_Military>> + <</if>> + <<if _artSlave.clothes == "a mini dress">> + <<include Art_Vector_Belly_Outfit_Minidress>> + <</if>> + <<if _artSlave.clothes == "a monokini">> + <<include Art_Vector_Belly_Outfit_Monokini>> + <</if>> + <<if _artSlave.clothes == "a nice nurse outfit">> + <<include Art_Vector_Belly_Outfit_Nursenice>> + <</if>> + <<if _artSlave.clothes == "a slutty nurse outfit">> + <<include Art_Vector_Belly_Outfit_Nurseslut>> + <</if>> + <<if _artSlave.clothes == "a penitent nuns habit">> + <<include Art_Vector_Belly_Outfit_Penitentnun>> + <</if>> + <<if _artSlave.clothes == "a slutty qipao">> + <<include Art_Vector_Belly_Outfit_Qipao>> + <</if>> + <<if _artSlave.clothes == "a schutzstaffel uniform">> + <<include Art_Vector_Belly_Outfit_Schutzstaffel>> + <</if>> + <<if _artSlave.clothes == "a schoolgirl outfit">> + <<include Art_Vector_Belly_Outfit_Schoolgirl>> + <</if>> + <<if _artSlave.clothes == "a slave gown">> + <<include Art_Vector_Belly_Outfit_Slavegown>> + <</if>> + <<if _artSlave.clothes == "a red army uniform">> + <<include Art_Vector_Belly_Outfit_Soviet>> + <</if>> + <<if _artSlave.clothes == "spats and a tank top">> + <<include Art_Vector_Belly_Outfit_Spats>> + <</if>> + <<if _artSlave.clothes == "a succubus outfit">> + <<include Art_Vector_Belly_Outfit_Succubus>> + <</if>> + <<if _artSlave.clothes == "nice business attire">> + <<include Art_Vector_Belly_Outfit_Suitnice>> + <</if>> + <<if _artSlave.clothes == "slutty business attire">> + <<include Art_Vector_Belly_Outfit_Suitslut>> + <</if>> + <<if _artSlave.clothes == "a toga">> + <<include Art_Vector_Belly_Outfit_Toga>> + <</if>> + <<if _artSlave.clothes == "Western clothing">> + <<include Art_Vector_Belly_Outfit_Western>> <</if>> <</if>> @@ -135,7 +135,6 @@ <</if>> <</if>> - /* belly piercings for flat bellies */ <<if _artSlave.belly == 0>> <<if _artSlave.navelPiercing == 1>> diff --git a/src/js/storyJS.tw b/src/js/storyJS.tw index 40128dd4deff932aab93d1c215570bffa1570385..6e313c2704611119dcfa77b8bc0b0e96bc052528 100644 --- a/src/js/storyJS.tw +++ b/src/js/storyJS.tw @@ -995,6 +995,21 @@ window.overpowerCheck = function(slave, PC) { return strength; } +window.impregnatedBy = function(slave) { /* returns array of IDs of all characters who impregnated slave */ + var IDArray = []; + if (!Array.isArray(slave.womb)) { + WombInit(slave); + } + for (var i = 0; i < slave.womb.length; i++) { + IDArray.push(slave.womb.fatherID); + } + return IDArray; +} + +window.isImpregnatedBy = function(mother, father) { /* returns true if mother was impregnated by father */ + return impregnatedBy(mother).includes(father.ID); +} + window.jsAlert = function(obj) { alert(obj); diff --git a/src/npc/removeActiveSlave.tw b/src/npc/removeActiveSlave.tw index ea3dd93293176173f21fdef29915e9d42981346a..ad4466db4d48a726685f7c931252c0c0a16856d3 100644 --- a/src/npc/removeActiveSlave.tw +++ b/src/npc/removeActiveSlave.tw @@ -143,6 +143,32 @@ <<set $limbs.deleteAt(_o)>> <</if>> + <<set _geneIndex = $genePool.findIndex(function(s) { return s.ID == $activeSlave.ID; })>> + <<if _geneIndex != -1>> + <<set _dontDeleteMe = 0>> + <<if $traitor != 0>> + <<if isImpregnatedBy($traitor, $activeSlave) || $traitor.ID == $activeSlave.ID>> /* did we impregnate the traitor, or are we the traitor? */ + <<set _dontDeleteMe = 1>> + <</if>> + <</if>> + <<if $boomerangSlave != 0>> + <<if isImpregnatedBy($boomerangSlave, $activeSlave) || $boomerangSlave.ID == $activeSlave.ID>> /* did we impregnate the boomerang, or are we the boomerang? */ + <<set _dontDeleteMe = 1>> + <</if>> + <</if>> + <<if _dontDeleteMe == 0>> /* avoid going through this loop if possible */ + <<for _rasi = 0; _rasi < _SL; _rasi++>> + <<if $slaves[_rasi].ID != $activeSlave.ID && isImpregnatedBy($slaves[_rasi], $activeSlave)>> /* have we impregnated a slave that is not ourself? */ + <<set _dontDeleteMe = 1>> + <<break>> + <</if>> + <</for>> + <</if>> + <<if _dontDeleteMe == 0>> + <<set $genePool.deleteAt(_geneIndex)>> + <</if>> + <</if>> + <<set _dump = removeSlave(_x), _SL--, $activeSlave = 0>> <<if _missingID == 1>> diff --git a/src/uncategorized/BackwardsCompatibility.tw b/src/uncategorized/BackwardsCompatibility.tw index b65643338e819228a58239693dd4c5eff3d98d79..a6817d079be8663e2c48d09564246954eef69f9a 100644 --- a/src/uncategorized/BackwardsCompatibility.tw +++ b/src/uncategorized/BackwardsCompatibility.tw @@ -3022,8 +3022,42 @@ Setting missing slave variables: <<set $slavesOriginal = []>> /* not used by pregmod */ <<for _bci = 0; _bci < $genePool.length; _bci++>> -<<set _Slave = $genePool[_bci]>> + <<set _Slave = $genePool[_bci]>> <<if ndef _Slave.origSkin>><<set _Slave.origSkin = _Slave.skin>><</if>> + + <<if $genePool.map(function(s) { return s.ID; }).count(_Slave.ID) > 1>> /* first check for duplicate IDs, keep the first entry and delete the others */ + <<for _bci2 = _bci + 1; _bci2 < $genePool.length; _bci2++>> + <<if $genePool[_bci2].ID == _Slave.ID>> + <<set $genePool.deleteAt(_bci2), _bci2-->> + <</if>> + <</for>> + <</if>> + <<set _dontDeleteMe = 0>> + <<if def $slaveIndices[_Slave.ID]>> /* are we still in the $slaves array? */ + <<set _dontDeleteMe = 1>> + <</if>> + <<if $traitor != 0>> + <<if isImpregnatedBy($traitor, _Slave) || $traitor.ID == _Slave.ID>> /* did we impregnate the traitor, or are we the traitor? */ + <<set _dontDeleteMe = 1>> + <</if>> + <</if>> + <<if $boomerangSlave != 0>> + <<if isImpregnatedBy($boomerangSlave, _Slave) || $boomerangSlave.ID == _Slave.ID>> /* did we impregnate the boomerang, or are we the boomerang? */ + <<set _dontDeleteMe = 1>> + <</if>> + <</if>> + <<if _dontDeleteMe == 0>> /* avoid going through this loop if possible */ + <<for _bci2 = 0; _bci2 < $slaves.length; _bci2++>> + <<if isImpregnatedBy($slaves[_bci2], _Slave)>> /* have we impregnated a slave on the slaves array? */ + <<set _dontDeleteMe = 1>> + <<break>> + <</if>> + <</for>> + <</if>> + <<if _dontDeleteMe == 0>> + <<set $genePool.deleteAt(_bci), _bci-->> + <</if>> + <</for>> <<set $AgeEffectOnTrainerPricingPC = 1>>