From 1edd80286bf61e12725158670ad1cada0f74b843 Mon Sep 17 00:00:00 2001 From: Svornost <11434-svornost@users.noreply.gitgud.io> Date: Wed, 29 Apr 2020 20:30:16 -0700 Subject: [PATCH] Handle pseudo-assignments in assignJob. --- src/js/assignJS.js | 45 +++++++++++++++++++-------------------------- 1 file changed, 19 insertions(+), 26 deletions(-) diff --git a/src/js/assignJS.js b/src/js/assignJS.js index 7a36d101055..3524622ddee 100644 --- a/src/js/assignJS.js +++ b/src/js/assignJS.js @@ -10,7 +10,14 @@ globalThis.assignJob = function(slave, job) { let r = ""; let oldJob = slave.assignment; - if (job === "@Pit" || job === "@Lurcher") { return r; } // psuedo-assignments must be handled through assignmentTransition for now + // handle non-exclusive pseudo-assignments as special cases + if (job === "@Pit") { + V.fighterIDs.push(slave.ID); + return r; + } else if (job === "@Lurcher") { + V.LurcherID = slave.ID; + return r; + } removeJob(slave, slave.assignment, true); const idx = V.slaveIndices[slave.ID]; @@ -942,32 +949,18 @@ globalThis.assignmentTransition = function(slave, assignTo, passage) { } V.activeSlave = slave; // might be needed by the passage we're transitioning to (TODO: get rid of this) - switch (assignTo) { - case "@Pit": { - V.fighterIDs.push(slave.ID); - Engine.play(passage); - break; - } - case "@Lurcher": { - V.LurcherID = slave.ID; + assignJob(slave, assignTo); + if (V.showAssignToScenes === 1 && slave.fetish !== "mindbroken") { + if (assignTo === "Dairy" && ((V.dairyStimulatorsSetting >= 2) || (V.dairyFeedersSetting >= 2) || (V.dairyPregSetting >= 2))) { + detourThroughScene("Industrial Dairy Assignment Scene"); + } else if (assignTo === "Dairy" && (V.dairyRestraintsSetting === 0 && V.activeSlave.devotion > 0)) { + detourThroughScene("Free Range Dairy Assignment Scene"); + } else if (assignTo === "Brothel") { + detourThroughScene("Brothel Assignment Scene"); + } else { Engine.play(passage); - break; - } - default: { - assignJob(slave, assignTo); - if (V.showAssignToScenes === 1 && slave.fetish !== "mindbroken") { - if (assignTo === "Dairy" && ((V.dairyStimulatorsSetting >= 2) || (V.dairyFeedersSetting >= 2) || (V.dairyPregSetting >= 2))) { - detourThroughScene("Industrial Dairy Assignment Scene"); - } else if (assignTo === "Dairy" && (V.dairyRestraintsSetting === 0 && V.activeSlave.devotion > 0)) { - detourThroughScene("Free Range Dairy Assignment Scene"); - } else if (assignTo === "Brothel") { - detourThroughScene("Brothel Assignment Scene"); - } else { - Engine.play(passage); - } - } else { - Engine.play(passage); - } } + } else { + Engine.play(passage); } }; -- GitLab