Skip to content
Snippets Groups Projects
Commit 29d44974 authored by brickode's avatar brickode
Browse files

Refactored nursery weight rules effects

parent f6826e8b
No related branches found
No related tags found
1 merge request!7243Children Report Rework
......@@ -41,36 +41,7 @@ App.Facilities.Nursery.childrenReport = function childrenReport() {
// TODO: rework these entirely
if (Matron || NL) {
if (V.nurseryWeight) {
const firstNanny = NL > 0 ? App.Entity.facilities.nursery.employees()[0] : null;
r += `<br>`;
if (V.nurseryWeightSetting === 1) {
if (child.weight < 200) {
child.weight += 5;
}
r += `${He} is being fed an excessive amount of food, causing <span class="red">rapid weight gain.</span> `;
} else if (V.nurseryWeightSetting === 2) {
if (child.weight > 10) {
child.weight--;
r += `${Matron ? Matron.slaveName : NL > 1 ? `A nanny` : firstNanny.slaveName} notices ${he} is overweight and <span class="green">decreases the amount of food ${he} eats.</span> `;
} else if (child.weight <= -10) {
child.weight++;
r += `${Matron ? Matron.slaveName : NL > 1 ? `A nanny` : firstNanny.slaveName} notices ${he} is underweight and <span class="green">increases the amount of food ${he} eats.</span> `;
} else {
r += `${He} is <span class="lime">currently a healthy weight;</span> efforts will be made to maintain it. `;
}
} else if (V.nurseryWeightSetting === 0) {
if (child.weight > -20) {
r += `${His} developing body <span class="red">quickly sheds its gained weight.</span> `;
child.weight -= 40;
}
}
} else {
if (child.weight > -20) {
child.weight -= 40;
r += `${His} developing body <span class="red">quickly sheds its gained weight.</span>`;
}
}
// TODO: rewrite these
if (V.nurseryMuscles) {
......@@ -330,5 +301,46 @@ App.Facilities.Nursery.childrenReport = function childrenReport() {
return;
}
// MARK: Nursery Rules Effects
function weightRulesEffects() {
let r = [];
if (V.nurseryWeight) {
const firstNanny = NL > 0 ? nannies[0] : null;
r.push(`<br>`);
if (V.nurseryWeightSetting === 1) {
if (child.weight < 200) {
child.weight += 5;
}
r.push(`${He} is being fed an excessive amount of food, causing <span class="red">rapid weight gain.</span> `);
} else if (V.nurseryWeightSetting === 2) {
if (child.weight > 10) {
child.weight--;
r.push(`${Matron ? Matron.slaveName : NL > 1 ? `A nanny` : firstNanny.slaveName} notices ${he} is overweight and <span class="green">decreases the amount of food ${he} eats.</span> `);
} else if (child.weight <= -10) {
child.weight++;
r.push(`${Matron ? Matron.slaveName : NL > 1 ? `A nanny` : firstNanny.slaveName} notices ${he} is underweight and <span class="green">increases the amount of food ${he} eats.</span> `);
} else {
r.push(`${He} is <span class="lime">currently a healthy weight;</span> efforts will be made to maintain it. `);
}
} else if (V.nurseryWeightSetting === 0) {
if (child.weight > -20) {
r.push(`${His} developing body <span class="red">quickly sheds its gained weight.</span> `);
child.weight -= 40;
}
}
} else {
if (child.weight > -20) {
child.weight -= 40;
r.push(`${His} developing body <span class="red">quickly sheds its gained weight.</span>`);
}
}
return r.join(' ');
}
return r.join(' ');
};
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