From 4643450d8ad9dc793f128c5215c93498d26b071b Mon Sep 17 00:00:00 2001 From: Arkerthan <arkerthan@mailbox.org> Date: Fri, 3 Mar 2023 21:29:34 +0100 Subject: [PATCH] Use standard game over function in murderAttempt event --- src/events/scheduled/murderAttempt.js | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/src/events/scheduled/murderAttempt.js b/src/events/scheduled/murderAttempt.js index e0d99580217..7de099c6674 100644 --- a/src/events/scheduled/murderAttempt.js +++ b/src/events/scheduled/murderAttempt.js @@ -180,7 +180,7 @@ App.Events.MurderAttempt = class MurderAttempt extends App.Events.BaseEvent { paragraphStart.push(`Before ${he} can leave the building, your security detains ${him}, but this won't help a dead ${womanPC}.`); } App.Events.addParagraph(fragment, paragraphStart); - gameOver(fragment); + App.Events.LocalGameOver(fragment); } else { poisoned(fragment, paragraphStart); } @@ -189,7 +189,7 @@ App.Events.MurderAttempt = class MurderAttempt extends App.Events.BaseEvent { function sentOutRoute() { const fragment = document.createDocumentFragment(); - const r = [`Grumbling under ${his} breath ${he} quickly leaves.`] + const r = [`Grumbling under ${his} breath ${he} quickly leaves.`]; App.Events.addParagraph(fragment, r); continueButton(fragment); return fragment; @@ -242,7 +242,7 @@ App.Events.MurderAttempt = class MurderAttempt extends App.Events.BaseEvent { paragraphStart.push(`Alas, ${heBG} is too incompetent to even do that. By the time ${heBG} manages to get a steady grip on ${hisBG} weapon, your murderer is already introducing ${hisBG} skull to the corner of your table. Sure ${he} is detained before ${he} makes it out of the building, but does that really matter when you're dead?`); } App.Events.addParagraph(fragment, paragraphStart); - gameOver(fragment); + App.Events.LocalGameOver(fragment); } else { paragraphStart.push(paragraphStart.pop() + ","); if (deadliness(S.Bodyguard).value > 1 || (S.Bodyguard.muscles > 95 && S.Bodyguard.height >= 185)) { @@ -259,7 +259,7 @@ App.Events.MurderAttempt = class MurderAttempt extends App.Events.BaseEvent { } else { paragraphStart.push(`just a moment too slow, ${S.Bodyguard.slaveName} draws ${hisBG} own, shooting ${him} in the chest, but not before you already have a bullet through your heart. Seeing you fall down, ${heBG} sets ${hisBG} weapon to automatic, puts it under ${hisBG} chin, and pulls the trigger.`); App.Events.addParagraph(fragment, paragraphStart); - gameOver(fragment); + App.Events.LocalGameOver(fragment); } } } @@ -286,7 +286,7 @@ App.Events.MurderAttempt = class MurderAttempt extends App.Events.BaseEvent { r = []; r.push("Several hours later you start to feel strange. A few minutes after that, you collapse. You are dead long before help can arrive. Later autopsy reveals your cause of death to be poisoning."); App.Events.addParagraph(fragment, r); - gameOver(fragment); + App.Events.LocalGameOver(fragment); } function sincereProposal(fragment, paragraphStart) { @@ -380,12 +380,6 @@ App.Events.MurderAttempt = class MurderAttempt extends App.Events.BaseEvent { /* End event functions */ - function gameOver(fragment) { - App.Events.addParagraph(fragment, ["<span class='bold'>GAME OVER</span>"]); - V.ui = "start"; - App.Utils.scheduleSidebarRefresh(); - } - function endEvent() { Engine.play(V.nextLink); return []; @@ -472,8 +466,8 @@ App.Events.MurderAttemptFollowup = class MurderAttemptFollowup extends App.Event // Normally schoolmate race would be based on the shared nationality, if that is not possible because PC // is "Stateless" let them share race as well. But not if player chose "catgirl" as race since that // shouldn't be available outside the mod. - if (V.PC.nationality === "Stateless" - && V.PC.race !== "catgirl") { + if (V.PC.nationality === "Stateless" && + V.PC.race !== "catgirl") { race = V.PC.race; } slave = GenerateNewSlave(null, { -- GitLab