diff --git a/src/facilities/nursery/nurseryWidgets.js b/src/facilities/nursery/nurseryWidgets.js index 2a07162d9b13cb0c2c2067be3e6d12e9e63f500c..2285091e07bb01074b973464facf270c96be1699 100644 --- a/src/facilities/nursery/nurseryWidgets.js +++ b/src/facilities/nursery/nurseryWidgets.js @@ -2504,7 +2504,7 @@ App.Facilities.Nursery.ChildSummary = function(child) { shortLips(child); shortTeeth(child); shortMuscles(child); - shortLimbs(child); + r += App.Desc.shortLimbs(child); shortVoice(child); shortTitsAss(child); shortHips(child); @@ -2521,7 +2521,7 @@ App.Facilities.Nursery.ChildSummary = function(child) { longLips(child); longTeeth(child); longMuscles(child); - longLimbs(child); + r += App.Desc.longLimbs(child); longVoice(child); longTitsAss(child); longHips(child); @@ -4562,34 +4562,6 @@ App.Facilities.Nursery.ChildSummary = function(child) { } } - /** - * @param {App.Entity.SlaveState} child - */ - function shortLimbs(child) { - if (child.amp !== 0) { - if (child.amp === -1) { - r += `P-Limbs`; - } else if (child.amp === -2) { - r += `Sex P-Limbs`; - } else if (child.amp === -3) { - r += `Beauty P-Limbs`; - } else if (child.amp === -4) { - r += `Combat P-Limbs`; - } else if (child.amp === -5) { - r += `Cyber P-Limbs`; - } else { - r += `Amp`; - } - } - if (!canWalk(child)) { - r += ` Immob `; - } - if (child.heels === 1) { - r += ` Heel `; - } - r += `</span> `; - } - /** * @param {App.Entity.SlaveState} child */ @@ -4915,34 +4887,6 @@ App.Facilities.Nursery.ChildSummary = function(child) { } } - /** - * @param {App.Entity.SlaveState} child - */ - function longLimbs(child) { - if (child.amp !== 0) { - if (child.amp === -1) { - r += `Prosthetic limbs. `; - } else if (child.amp === -2) { - r += `Sexy prosthetic limbs. `; - } else if (child.amp === -3) { - r += `Beautiful prosthetic limbs. `; - } else if (child.amp === -4) { - r += `Deadly prosthetic limbs. `; - } else if (child.amp === -5) { - r += `Cyber prosthetic limbs. `; - } else { - r += `Amputee. `; - } - } - if (!canWalk(child)) { - r += `Immobile. `; - } - if (child.heels === 1) { - r += `Heeled. `; - } - r += `</span> `; - } - /** * @param {App.Entity.SlaveState} child */ diff --git a/src/js/descriptionWidgets.js b/src/js/descriptionWidgets.js index 8f3e63461df1b13749cfc68b1f2291c0af96e742..96a70c4e4f05b51e68bf9191b51358015dacaf28 100644 --- a/src/js/descriptionWidgets.js +++ b/src/js/descriptionWidgets.js @@ -1193,3 +1193,175 @@ App.Desc.extraMarks = function(slave, markType) { } return extras; }; + + +/** + * @param {App.Entity.SlaveState} slave + * @returns {string} short description of the slaves limbs. + */ +App.Desc.shortLimbs = function(slave) { + let r = ""; + function desc(id, limb) { + switch (id) { + case 0: + return limb + "Amp "; + case 1: + return ""; + case 2: + return limb + "P-Limb "; + case 3: + return limb + "Sex P-Limb "; + case 4: + return limb + "Beauty P-Limb "; + case 5: + return limb + "Combat P-Limb "; + case 6: + return limb + "Cyber P-Limb "; + default: + return "unknown ID: " + id; + } + } + + if (getLeftArmID(slave) === getRightArmID(slave) && + getLeftArmID(slave) === getLeftLegID(slave) && + getLeftArmID(slave) === getRightLegID(slave)) { + r += desc(getLeftArmID(slave), ""); + } else { + if (getLeftArmID(slave) === getRightArmID(slave)) { + r += desc(getLeftArmID(slave), "Arms:"); + } else { + r += desc(getLeftArmID(slave), "LArm:"); + r += desc(getRightArmID(slave), "RArm:"); + } + + if (getLeftLegID(slave) === getRightLegID(slave)) { + r += desc(getLeftLegID(slave), "Legs:"); + } else { + r += desc(getLeftLegID(slave), "LLeg:"); + r += desc(getRightLegID(slave), "RLeg:"); + } + } + + r += " "; + if (!canWalk(slave)) { + r += " Immob "; + } + if (slave.heels === 1) { + r += " Heel "; + } + + return r; +}; + +/** + * @param {App.Entity.SlaveState} slave + * @returns {string} long description of the slaves limbs. + */ +App.Desc.longLimbs = function(slave) { + let r = ""; + switch (getLimbCount(slave, 0)) { + case 1: + r += "Amputee. "; + break; + case 2: + r += "Double Amputee. "; + break; + case 3: + r += "Triple Amputee. "; + break; + case 4: + r += "Quadruple Amputee. "; + break; + } + + if (hasAnyProstheticLimbs(slave)) { + // count limbs + switch (getLimbCount(slave, 102)) { + case 1: + r = "One "; + break; + case 2: + r = "Two "; + break; + case 3: + r = "Three "; + break; + case 4: + r = "Four "; + break; + } + + // find out if all prosthetics are the same: + let id; + let count = 0; + + if (getLeftArmID(slave) >= 2) { + id = getLeftArmID(slave); + count++; + } + if (getRightArmID(slave) >= 2) { + if (id) { + if (id === getRightArmID(slave)) { + count++; + } + } else { + id = getRightArmID(slave); + count++; + } + } + if (getLeftLegID(slave) >= 2) { + if (id) { + if (id === getLeftLegID(slave)) { + count++; + } + } else { + id = getLeftLegID(slave); + count++; + } + } + if (getRightLegID(slave) >= 2) { + if (id) { + if (id === getRightLegID(slave)) { + count++; + } + } else { + id = getRightLegID(slave); + count++; + } + } + + if (count === getLimbCount(slave, 102)) { // all prosthetics are the same + switch (id) { + case 3: + r += "sexy "; + break; + case 4: + r += "beautiful "; + break; + case 5: + r += "deadly "; + break; + case 6: + r += "cyber "; + break; + } + if (count > 1) { + r += "prosthetic limbs. "; + } else { + r += "prosthetic limb. "; + } + } else { + // only reachable with count > 1 + r += "mixed prosthetic limbs. "; + } + } + + if (!canWalk(slave)) { + r += "Immobile. "; + } + if (slave.heels === 1) { + r += "Heeled. "; + } + + return r; +}; diff --git a/src/js/slaveSummaryWidgets.js b/src/js/slaveSummaryWidgets.js index ff9afef1c20f4fe1277d68a97ce9ae18d38dc3b6..cc3d22948426d0927d760b9f0a2761d94f591723 100644 --- a/src/js/slaveSummaryWidgets.js +++ b/src/js/slaveSummaryWidgets.js @@ -105,7 +105,7 @@ window.SlaveSummaryUncached = (function() { short_lips(slave, para); short_teeth(slave, para); short_muscles(slave, para); - short_limbs(slave, para); + addText(para, App.Desc.shortLimbs(slave)); short_voice(slave, para); short_tits_ass(slave, para); short_hips(slave, para); @@ -121,7 +121,7 @@ window.SlaveSummaryUncached = (function() { long_lips(slave, para); long_teeth(slave, para); long_muscles(slave, para); - long_limbs(slave, para); + makeSpan(para, App.Desc.longLimbs(slave)); long_voice(slave, para); long_tits_ass(slave, para); long_hips(slave, para); @@ -1948,36 +1948,6 @@ window.SlaveSummaryUncached = (function() { } } - /** - * @param {App.Entity.SlaveState} slave - * @param {Node} c - * @returns {void} - */ - function short_limbs(slave, c) { - if (slave.amp !== 0) { - if (slave.amp === -1) { - addText(c, "P-Limbs"); - } else if (slave.amp === -2) { - addText(c, "Sex P-Limbs"); - } else if (slave.amp === -3) { - addText(c, "Beauty P-Limbs"); - } else if (slave.amp === -4) { - addText(c, "Combat P-Limbs"); - } else if (slave.amp === -5) { - addText(c, "Cyber P-Limbs"); - } else { - addText(c, "Amp"); - } - } - addText(c, " "); - if (!canWalk(slave)) { - addText(c, " Immob "); - } - if (slave.heels === 1) { - addText(c, " Heel "); - } - } - /** * @param {App.Entity.SlaveState} slave * @param {Node} c @@ -2330,35 +2300,6 @@ window.SlaveSummaryUncached = (function() { } } - /** - * @param {App.Entity.SlaveState} slave - * @param {Node} c - * @returns {void} - */ - function long_limbs(slave, c) { - if (slave.amp !== 0) { - if (slave.amp === -1) { - makeSpan(c, `Prosthetic limbs.`); - } else if (slave.amp === -2) { - makeSpan(c, `Sexy prosthetic limbs.`); - } else if (slave.amp === -3) { - makeSpan(c, `Beautiful prosthetic limbs.`); - } else if (slave.amp === -4) { - makeSpan(c, `Deadly prosthetic limbs.`); - } else if (slave.amp === -5) { - makeSpan(c, `Cyber prosthetic limbs.`); - } else { - makeSpan(c, `Amputee.`); - } - } - if (!canWalk(slave)) { - makeSpan(c, "Immobile."); - } - if (slave.heels === 1) { - makeSpan(c, "Heeled."); - } - } - /** * @param {App.Entity.SlaveState} slave * @param {Node} c @@ -4638,4 +4579,4 @@ window.SlaveSummaryUncached = (function() { } return SlaveSummaryUncached; -})(); \ No newline at end of file +})();