diff --git a/src/js/modification.js b/src/js/modification.js index ab6a0f33a0de13ce462089e880fb7d99df9765fd..5e56cd04709a1fec27248a2e2e85cb85613222b3 100644 --- a/src/js/modification.js +++ b/src/js/modification.js @@ -5,19 +5,22 @@ App.Medicine.Modification = {}; * @param {string} scar * @param {string} design */ -App.Medicine.Modification.addScar = function(slave, scar, design) { +App.Medicine.Modification.addScar = function(slave, scar, design, weight) { /* const V = State.variables; V.scarApplied = 1; V.degradation += 10; slave.health -= 10; //dangerous to uncomment this as sometimes many scars are applied at once. cashX(forceNeg(surgery.costs), "slaveSurgery", slave); slave.health -= (V.PC.medicine >= 100) ? Math.round(surgery.healthCosts / 2) : surgery.healthCosts;*/ + if (!weight) { + weight = 1; + } if (!slave.scar.hasOwnProperty(scar)) { slave.scar[scar] = new App.Entity.scarState(); } if (!slave.scar[scar].hasOwnProperty(design)) { - slave.scar[scar][design] = 1; + slave.scar[scar][design] = weight; } else { - slave.scar[scar][design] += 1; + slave.scar[scar][design] += weight; } };