Skip to content
Snippets Groups Projects
Commit 8eec4c3d authored by DCoded's avatar DCoded
Browse files

Removed unneeded paramters

parent 43d366c4
No related branches found
No related tags found
1 merge request!9292Refactoring KillSlave
...@@ -64,8 +64,7 @@ App.UI.SlaveInteract.killSlave = function(slave) { ...@@ -64,8 +64,7 @@ App.UI.SlaveInteract.killSlave = function(slave) {
return `, at which point abject fear fills ${his} face. ${He} immediately ${hasBothLegs(slave) ? `drops to ${his} knees and ` : ``}begins openly begging for you to show mercy.`; return `, at which point abject fear fills ${his} face. ${He} immediately ${hasBothLegs(slave) ? `drops to ${his} knees and ` : ``}begins openly begging for you to show mercy.`;
} }
/** @param {App.Entity.SlaveState} slave */ function introReaction() {
function introReaction(slave) {
if (oneWeek.includes(slave.ID)) { if (oneWeek.includes(slave.ID)) {
return introReactionOneWeek(); return introReactionOneWeek();
} }
...@@ -141,7 +140,7 @@ App.UI.SlaveInteract.killSlave = function(slave) { ...@@ -141,7 +140,7 @@ App.UI.SlaveInteract.killSlave = function(slave) {
text.push(`${He} just nods dumbly and continues to watch you with a vacant expression, even as`); text.push(`${He} just nods dumbly and continues to watch you with a vacant expression, even as`);
} }
text.push(`${canHear(slave) ? `quietly ` : ``}reach behind your desk and pull out your trusty ${weapon}${introReaction(slave)}`); text.push(`${canHear(slave) ? `quietly ` : ``}reach behind your desk and pull out your trusty ${weapon}${introReaction()}`);
return text.join(' '); return text.join(' ');
} }
...@@ -297,8 +296,7 @@ App.UI.SlaveInteract.killSlave = function(slave) { ...@@ -297,8 +296,7 @@ App.UI.SlaveInteract.killSlave = function(slave) {
return mercyReactionOther(); return mercyReactionOther();
} }
/** @param {App.Entity.SlaveState} slave */ function mercyEffectsOneWeek() {
function mercyEffectsOneWeek(slave) {
if (isDevoted) { if (isDevoted) {
slave.devotion -= 5; slave.devotion -= 5;
slave.trust -= 10; slave.trust -= 10;
...@@ -314,8 +312,7 @@ App.UI.SlaveInteract.killSlave = function(slave) { ...@@ -314,8 +312,7 @@ App.UI.SlaveInteract.killSlave = function(slave) {
} }
} }
/** @param {App.Entity.SlaveState} slave */ function mercyEffectsTwoWeeks() {
function mercyEffectsTwoWeeks(slave) {
if (isDevoted) { if (isDevoted) {
slave.devotion -= 3; slave.devotion -= 3;
slave.trust -= 7; slave.trust -= 7;
...@@ -331,8 +328,7 @@ App.UI.SlaveInteract.killSlave = function(slave) { ...@@ -331,8 +328,7 @@ App.UI.SlaveInteract.killSlave = function(slave) {
} }
} }
/** @param {App.Entity.SlaveState} slave */ function mercyEffectsThreeWeeks() {
function mercyEffectsThreeWeeks(slave) {
if (isDevoted) { if (isDevoted) {
slave.devotion -= 2; slave.devotion -= 2;
slave.trust -= 5; slave.trust -= 5;
...@@ -348,8 +344,7 @@ App.UI.SlaveInteract.killSlave = function(slave) { ...@@ -348,8 +344,7 @@ App.UI.SlaveInteract.killSlave = function(slave) {
} }
} }
/** @param {App.Entity.SlaveState} slave */ function mercyEffectsFourWeeks() {
function mercyEffectsFourWeeks(slave) {
if (isDevoted) { if (isDevoted) {
slave.devotion--; slave.devotion--;
slave.trust -= 3; slave.trust -= 3;
...@@ -365,8 +360,7 @@ App.UI.SlaveInteract.killSlave = function(slave) { ...@@ -365,8 +360,7 @@ App.UI.SlaveInteract.killSlave = function(slave) {
} }
} }
/** @param {App.Entity.SlaveState} slave */ function mercyEffectsOther() {
function mercyEffectsOther(slave) {
if (isDevoted) { if (isDevoted) {
slave.devotion += 10; slave.devotion += 10;
slave.trust -= 30; slave.trust -= 30;
...@@ -382,22 +376,21 @@ App.UI.SlaveInteract.killSlave = function(slave) { ...@@ -382,22 +376,21 @@ App.UI.SlaveInteract.killSlave = function(slave) {
} }
} }
/** @param {App.Entity.SlaveState} slave */ function mercyEffects() {
function mercyEffects(slave) {
if (oneWeek.includes(slave.ID)) { if (oneWeek.includes(slave.ID)) {
return mercyEffectsOneWeek(slave); return mercyEffectsOneWeek();
} }
if (twoWeeks.includes(slave.ID)) { if (twoWeeks.includes(slave.ID)) {
return mercyEffectsTwoWeeks(slave); return mercyEffectsTwoWeeks();
} }
if (threeWeeks.includes(slave.ID)) { if (threeWeeks.includes(slave.ID)) {
return mercyEffectsThreeWeeks(slave); return mercyEffectsThreeWeeks();
} }
if (fourWeeks.includes(slave.ID)) { if (fourWeeks.includes(slave.ID)) {
return mercyEffectsFourWeeks(slave); return mercyEffectsFourWeeks();
} }
return mercyEffectsOther(slave); return mercyEffectsOther();
} }
function mercy() { function mercy() {
...@@ -409,7 +402,7 @@ App.UI.SlaveInteract.killSlave = function(slave) { ...@@ -409,7 +402,7 @@ App.UI.SlaveInteract.killSlave = function(slave) {
mercyDiv.append(`You change your mind, and with a wave of your hand, send ${slave.slaveName} back to ${his} duties. Maybe some other time.`); mercyDiv.append(`You change your mind, and with a wave of your hand, send ${slave.slaveName} back to ${his} duties. Maybe some other time.`);
} }
mercyEffects(slave); mercyEffects();
oneWeek.push(slave.ID); oneWeek.push(slave.ID);
......
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