From 6b05de16b4637d4d9700ad69ca27407b5c9e7a6f Mon Sep 17 00:00:00 2001 From: lowercasedonkey <lowercasedonkey@gmail.com> Date: Sat, 10 Jul 2021 19:23:55 -0400 Subject: [PATCH] mercs help --- src/events/nonRandom/mercs/pMercsHelpCorp.js | 94 ++++++++++++-------- src/events/nonRandomEvent.js | 3 +- 2 files changed, 58 insertions(+), 39 deletions(-) diff --git a/src/events/nonRandom/mercs/pMercsHelpCorp.js b/src/events/nonRandom/mercs/pMercsHelpCorp.js index cdcc707ec4b..c7e4f1cf6d3 100644 --- a/src/events/nonRandom/mercs/pMercsHelpCorp.js +++ b/src/events/nonRandom/mercs/pMercsHelpCorp.js @@ -1,22 +1,35 @@ - :: P Mercs Help Corp [nobr] +App.Events.PMercsHelpCorp = class PMercsHelpCorp extends App.Events.BaseEvent { + eventPrerequisites() { + return [ + () => V.corp.Incorporated > 0, + () => V.rivalOwnerEnslaved > 0, + () => V.mercenaries >= 3, + () => V.mercenariesHelpCorp === 0, + () => V.corp.DivExtra > 0, + () => App.Events.effectiveWeek() > 70, + ]; + } - V.nextButton = "Decline", V.nextLink = "Random Nonindividual Event", V.mercenariesHelpCorp = -1; - r.push(`/* hide button until user makes a selection */`); + execute(node) { + let r = []; + V.nextButton = "Decline"; /* hide button until user makes a selection */ + V.nextLink = "Random Nonindividual Event"; + V.mercenariesHelpCorp = -1; - Your weekly meeting with your V.mercenariesTitle commander finishes with unusual speed. With the arcology owner who set the Daughters on you enslaved, all other immediate threats defused or smashed, + r.push(`Your weekly meeting with your V.mercenariesTitle commander finishes with unusual speed. With the arcology owner who set the Daughters on you enslaved, all other immediate threats defused or smashed,`); if (V.arcologies[0].FSRomanRevivalistLaw > 0) { r.push(`your citizens serving in the urban cohorts with enthusiasm,`); } if (V.arcologies[0].FSNeoImperialistLaw1 > 0) { r.push(`your Knights vigilantly watching the streets for any possible threat,`); } - r.push(`and the ${V.mercenariesTitle} in excellent fighting condition, there just weren't enough concerns from either of your perspectives to fill the time. You sit across your desk from each other, discussing the global situation over V.PC.refreshment.`); + r.push(`and the ${V.mercenariesTitle} in excellent fighting condition, there just weren't enough concerns from either of your perspectives to fill the time. You sit across your desk from each other, discussing the global situation over V.PC.refreshment.`); - <br><br> + App.Events.addParagraph(node, r); + r = []; - "You know, - V.properTitle() - r.push(`," the scarred man says thoughtfully. "Threat board's pretty sparse these days. I mean, not for those poor bastards." He`); + + r.push(`"You know, ${properTitle()}," the scarred man says thoughtfully. "Threat board's pretty sparse these days. I mean, not for those poor bastards." He`); if (V.PC.refreshmentType === 0) { r.push(`waves his ${V.PC.refreshment}`); } else if (V.PC.refreshmentType === 1) { @@ -32,40 +45,47 @@ } else if (V.PC.refreshmentType === 6) { r.push(`using the sheet of ${V.PC.refreshment} to point`); } - r.push(`at a screen showing a live news feed from a war on the other side of the world. A huge cloud in an unmistakable, malevolent shape, a broad rising head atop a dirty column of vapor, is towering above a large city.`); + r.push(`at a screen showing a live news feed from a war on the other side of the world. A huge cloud in an unmistakable, malevolent shape, a broad rising head atop a dirty column of vapor, is towering above a large city.`); - <br><br> + App.Events.addParagraph(node, r); + r = []; - "But in our immediate area, there's just not much that can threaten us. Most trouble on the horizon's going to come from economics and supply and the climate, but that stuff doesn't shoot back. I think we can afford a little dispersal of military effort. Why don't I second squads to your corporation, when we've got the availability? Your corporate guys are already pulling meat out of the conflict zones. No offense to them, they're pretty good, but they're not quite at the level of my boys and girls. And don't worry, I'd keep 'em clear of shit like that." He indicates the on-screen mushroom cloud again. + r.push(`"But in our immediate area, there's just not much that can threaten us. Most trouble on the horizon's going to come from economics and supply and the climate, but that stuff doesn't shoot back. I think we can afford a little dispersal of military effort. Why don't I second squads to your corporation, when we've got the availability? Your corporate guys are already pulling meat out of the conflict zones. No offense to them, they're pretty good, but they're not quite at the level of my boys and girls. And don't worry, I'd keep 'em clear of shit like that." He indicates the on-screen mushroom cloud again.`); - <br><br> + App.Events.addParagraph(node, r); + r = []; - ''This is a unique opportunity'' and will not reoccur. + r.push( + App.UI.DOM.makeElement("span", "This is a unique opportunity", "bold"), + `and will not reoccur.` + ); + App.Events.addParagraph(node, r); - <br><br> + App.Events.addResponses(node, [ + new App.Events.Result(`Decline`, decline), + new App.Events.Result(`Make it so`, makeItSo) + ]); - <span id="result"> - <<link "Decline">> - <<replace "#result">> - r.push(`Best to keep the ${V.mercenariesTitle} in reserve. You decline, and the commander chuckles. "Well`); - V.properTitle() - r.push(`, if you insist, I suppose we could find ways to keep busy around the arcology. I mean, we're a little starved for`); - if (V.seeDicks !== 0) { - r.push(`female`); - } else { - r.push(`intimate`); + function decline() { + const frag = new DocumentFragment(); + let r = []; + r.push(`Best to keep the ${V.mercenariesTitle} in reserve. You decline, and the commander chuckles. "Well ${properTitle()} , if you insist, I suppose we could find ways to keep busy around the arcology. I mean, we're a little starved for`); + if (V.seeDicks !== 0) { + r.push(`female`); + } else { + r.push(`intimate`); + } + r.push(`company here, but we can make do."`); + App.Events.addParagraph(frag, r); + return frag; } - r.push(`company here, but we can make do."/replace>> - <</link>> - <br> - <<link "Make it so">> + + function makeItSo() { V.nextButton = "Continue"; - App.Utils.updateUserButton(); - <<replace "#result">> - <<setNonlocalPronouns V.seeDicksIt's a fine idea, and you agree. The commander looks so enthused that you feel obliged to ask that he not risk himself unduly. He laughs. "There are no old, bold mercs,`); - V.properTitle() - r.push(`, and I am sure as hell old. I'll be sure to grow even older under contract with you. Now, unless there's anything else, I've just bought a nice${ _girlU} to add to the commander's suite, and _heU makes me feel a bit younger."`); + App.Utils.updateUserButton(); + const {girlU, heU} = getNonlocalPronouns(V.seeDicks).appendSuffix("U"); V.mercenariesHelpCorp = 1; - <</replace>> - <</link>> - </span> + return `It's a fine idea, and you agree. The commander looks so enthused that you feel obliged to ask that he not risk himself unduly. He laughs. "There are no old, bold mercs, ${properTitle()}, and I am sure as hell old. I'll be sure to grow even older under contract with you. Now, unless there's anything else, I've just bought a nice ${girlU} to add to the commander's suite, and ${heU} makes me feel a bit younger."`; + } + } +}; diff --git a/src/events/nonRandomEvent.js b/src/events/nonRandomEvent.js index 6019c492ce1..69fa401ef3c 100644 --- a/src/events/nonRandomEvent.js +++ b/src/events/nonRandomEvent.js @@ -102,6 +102,7 @@ App.Events.getNonrandomEvents = function() { new App.Events.secExpSmilingMan3(), new App.Events.PEPitFight(), + new App.Events.PMercsHelpCorp(), ]; }; @@ -276,8 +277,6 @@ globalThis.nonRandomEvent = function() { setTimeout(() => Engine.play("P peacekeepers intro"), Engine.minDomActionDelay); } else if (V.arcologies[0].prosperity > 80 && App.Utils.schoolCounter() === 0 && V.schoolSuggestion === 0) { setTimeout(() => Engine.play("P school suggestion"), Engine.minDomActionDelay); - } else if (effectiveWeek > 70 && V.corp.Incorporated > 0 && V.rivalOwnerEnslaved > 0 && V.mercenaries >= 3 && V.mercenariesHelpCorp === 0 && V.corp.DivExtra > 0) { - setTimeout(() => Engine.play("P Mercs Help Corp"), Engine.minDomActionDelay); } else if (effectiveWeek > 75 && (V.peacekeepers) && V.peacekeepers.strength < 50 && V.rivalOwner === 0 && V.peacekeepersFate !== 1) { setTimeout(() => Engine.play("P peacekeepers independence"), Engine.minDomActionDelay); } else if ((V.peacekeepers) && V.peacekeepers.strength >= 50 && V.peacekeepers.influenceAnnounced === 0) { -- GitLab