From 6e7b38bd1e0289ca6331d295c365e74c385c56f3 Mon Sep 17 00:00:00 2001 From: Arkerthan <arkerthan@mailbox.org> Date: Wed, 15 Feb 2023 23:48:02 +0100 Subject: [PATCH] Add success mechanic to fights --- src/004-base/basePitFight.js | 16 + src/events/scheduled/pitFight.js | 66 +++- src/facilities/pit/fights/0_lethalRandom.js | 246 +++++++------- .../pit/fights/0_nonLethalRandom.js | 299 +++++++++--------- .../pit/fights/1_lethalBodyguard.js | 8 +- .../pit/fights/1_nonLethalBodyguard.js | 8 +- src/facilities/pit/pit.js | 25 ++ src/facilities/pit/pitFightList.js | 1 + 8 files changed, 389 insertions(+), 280 deletions(-) diff --git a/src/004-base/basePitFight.js b/src/004-base/basePitFight.js index 20f10b2d21e..168863b3b8e 100644 --- a/src/004-base/basePitFight.js +++ b/src/004-base/basePitFight.js @@ -39,11 +39,21 @@ App.Facilities.Pit.Fights.BaseFight = class BaseFight { return false; } + /** + * How high the impact of this fight on the total event is. A flat multiplier. Used in descriptions. + * 1 is a nonlethal 1-vs-1 fight. May not be negative + * @returns {number} + */ + get impact() { + return 1; + } + /** * @typedef {object} fightOption * @property {string} name * @property {string} value */ + /** * @typedef {object} fightOptions * @property {string} name @@ -87,8 +97,13 @@ App.Facilities.Pit.Fights.BaseFight = class BaseFight { /** run the fight and attach DOM output to the pit fight passage. * child classes must implement this. * @param {ParentNode} node - Document fragment which fight output should be attached to + * @returns {number} - How successful the fight was for prestige/cash. + * The expected value should be between -1 and 1 inclusive. May go more extreme for unexpected outcomes. + * At least one maximum/minimum value should be used, and then scaled to other events with the + * {@link App.Facilities.Pit.Fights.BaseFight#impact impact property}. */ execute(node) { + return 0; } /** build the actual list of actors that will be involved in this fight. @@ -154,5 +169,6 @@ App.Facilities.Pit.Fights.TestFight = class extends App.Facilities.Pit.Fights.Ba execute(node) { let [slave1, slave2] = this.actors.map(a => getSlave(a)); // mapped deconstruction of actors into local slave variables node.appendChild(document.createTextNode(`This test fight for ${slave1.slaveName} and ${slave2.slaveName} was successful.`)); + return 0; } }; diff --git a/src/events/scheduled/pitFight.js b/src/events/scheduled/pitFight.js index 1f83e282291..29da1c29796 100644 --- a/src/events/scheduled/pitFight.js +++ b/src/events/scheduled/pitFight.js @@ -32,14 +32,76 @@ App.Events.SEPitFight = class SEPitFight extends App.Events.BaseEvent { App.Events.addParagraph(node, r); + let totalSuccess = 0; + const fights = App.Facilities.Pit.activeFights(); for (let i = 0; i < fights.length; i++) { if (fights[i].fightPrerequisites().every(p => p()) && fights[i].castActors()) { - App.UI.DOM.appendNewElement("span", node, `The ${ordinalSuffixWords(i+1)} fight this day: ` + fights[i].uiDescription + ": ", "bold"); - fights[i].execute(node); + App.UI.DOM.appendNewElement("span", node, `The ${ordinalSuffixWords(i + 1)} fight this day: ` + fights[i].uiDescription + ": ", "bold"); + const impact = fights[i].execute(node) * fights[i].impact; + node.append(eventImpact(impact)); + totalSuccess += impact; } else if (V.cheatMode || V.debugMode) { node.append("Unable to run fight: ", fights[i].key); } } + + const averageSuccess = totalSuccess / fights.length; + node.append(eventSuccess(averageSuccess)); + + if (V.pit.audience === "free") { + repX(200 * totalSuccess, "pit"); + } else if (V.pit.audience === "paid") { + cashX(4000 * totalSuccess, "pit"); + } + + /** + * @param {number} impact + * @returns {HTMLParagraphElement} + */ + function eventImpact(impact) { + const p = document.createElement("p"); + + impact = Math.abs(impact); + + if (impact === 0) { + p.append("The fight had no impact on the total event."); + } else if (impact < 0.2) { + p.append("The fight had little impact on the total event."); + } else if (impact < 0.8) { + p.append("The fight had normal impact on the total event."); + } else if (impact < 1.2) { + p.append("The fight had high impact on the total event."); + } else if (impact < 5) { + p.append("The fight had extreme impact on the total event."); + } + + return p; + } + + + /** + * @param {number} success + * @returns {HTMLParagraphElement} + */ + function eventSuccess(success) { + const p = document.createElement("p"); + + if (success === 0) { + p.append("The event had no success."); + } else if (success < 0) { + p.append("The event was an embarrassment."); + } else if (success < 0.2) { + p.append("The event had little success."); + } else if (success < 0.8) { + p.append("The event had normal success."); + } else if (success < 1.2) { + p.append("The event had high success."); + } else if (success < 5) { + p.append("The event had extremely high success."); + } + + return p; + } } }; diff --git a/src/facilities/pit/fights/0_lethalRandom.js b/src/facilities/pit/fights/0_lethalRandom.js index b40ac07d78c..1780ab9472f 100644 --- a/src/facilities/pit/fights/0_lethalRandom.js +++ b/src/facilities/pit/fights/0_lethalRandom.js @@ -1,13 +1,21 @@ /** Lethal 1v1 between random slaves. */ App.Facilities.Pit.Fights.LR1v1 = class extends App.Facilities.Pit.Fights.BaseFight { get uiDescription() { - return "Lethal 1-vs-1 between two random slaves"; + return "1-vs-1 between two random slaves"; } get key() { return "l r 1v1"; } + get lethal() { + return true; + } + + get impact() { + return 5; + } + fightPrerequisites() { return []; } @@ -27,19 +35,22 @@ App.Facilities.Pit.Fights.LR1v1 = class extends App.Facilities.Pit.Fights.BaseFi const winner = getWinner() ? slave1 : slave2; const loser = winner === slave1 ? slave2 : slave1; + let success = 0; + intro(node); fighterDeadliness(node, slave1); fighterDeadliness(node, slave2); fight(node); postFight(node); + return success; + /** @param {DocumentFragment} parent */ function intro(parent) { const r = []; App.Events.drawEventArt(node, [slave1, slave2], "no clothing"); - r.push(...that.introCombatants(slave1, slave2)); if (V.pit.audience === "none") { @@ -323,153 +334,149 @@ App.Facilities.Pit.Fights.LR1v1 = class extends App.Facilities.Pit.Fights.BaseFi r.push(`${winner.slaveName} and ${loser.slaveName} are both blind, making the fight a staredown. Neither slave wants to make the first move, especially with the drowning cacophony coming from the jeering crowd. Slowly, ${winner.slaveName} moves forward, waving ${his} sword side to side in the hopes of finding ${his} opponent before ${he} ${himself} gets found. ${loser.slaveName}'s sword clips the tip of ${winner.slaveName}'s setting off a surprisingly brutal series of slashes. The two slaves violently lay into each other, suffering more and more strikes as the struggle goes on. Less than a minute from first contact, both slaves are lying in their combined blood. As you begin to call it a draw, you notice ${winner.slaveName} start to stir. ${He} staggers to ${his} feet, coated in ${his} and ${loser.slaveName}'s blood, before dropping back to ${his} knees. It seems ${he} lived through this fight; odds aren't likely ${he}'ll do it again.`); healthDamage(winner, 50); + success = 0.25; if (V.pit.audience === "free") { - r.push(`The audience is surprised by the sudden violence after so much standing around, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', - 'inc']), ` is modest.`); - - cashX(5000, "pit", winner); + r.push(`The audience is `, + App.UI.DOM.makeElement("span", `surprised`, ['reputation', 'inc']), + ` by the sudden violence after so much standing around.`); } else if (V.pit.audience === "paid") { - r.push(`The audience is `, App.UI.DOM.makeElement("span", `surprised`, ['reputation', - 'inc']), ` by the sudden violence after so much standing around.`); - - repX(250, "pit", winner); + r.push(`The audience is surprised by the sudden violence after so much standing around, and your `, + App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', 'inc']), + ` is modest.`); } } else if (winnerDeadliness > (loserDeadliness + 1) && getArmCount(winner, 6) > 1) { r.push(`Upon your word the two combatants approach each other. ${winner.slaveName} does not carry a sword, raising only ${his} hands, but these are terrifying, modern weapons themselves. ${loser.slaveName} tries a probing sweep, but ${winner.slaveName} catches ${his2} blade in one hand, slides it down to the hilt with a shriek of metal on metal, and snaps the blade cleanly. ${loser.slaveName} ${canSee(loser) ? `watches this` : `freezes in place`}, dumbstruck, before regaining composure and taking a fighting stance again. ${winner.slaveName} manages to touch ${his} opponent's bare skin with ${his} own cybernetics, incapacitating ${loser.slaveName} with an electric shock. While ${loser.slaveName} is temporarily stunned, ${winner.slaveName} strikes ${loser.slaveName} on the head with deadly force, crushing ${his} opponent's skull. Though the fight was short,`); - if (V.pit.audience === "free") { - r.push(`the audience is `, App.UI.DOM.makeElement("span", `very impressed`, ['reputation', - 'inc']), ` by the display.`); + success = 0.5; - repX(500, "pit", winner); + if (V.pit.audience === "free") { + r.push(`the audience is `, + App.UI.DOM.makeElement("span", `very impressed`, ['reputation', 'inc']), + ` by the display.`); } else if (V.pit.audience === "paid") { - r.push(`the audience is quite impressed by the display, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', - 'inc']), ` is quite good.`); - - cashX(10000, "pit", winner); + r.push(`the audience is quite impressed by the display, and your `, + App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', 'inc']), + ` is quite good.`); } } else if (winnerDeadliness > (loserDeadliness + 1) && getArmCount(winner, 5) > 1) { r.push(`Upon your word the two combatants approach each other. ${winner.slaveName} drops ${his} sword as ${he} comes, raising only ${his} hands, but these are terrifying, modern weapons themselves. ${loser.slaveName} tries a probing sweep, but ${winner.slaveName} catches ${his2} blade in one hand, slides it down to the hilt with a shriek of metal on metal, and snaps the blade cleanly. As ${loser.slaveName} watches this, dumbstruck, ${winner.slaveName} places a gentle hand under ${his2} chin and then extends that arm's integral blade up and through ${his} opponent's skull. Though the fight was short,`); - if (V.pit.audience === "free") { - r.push(`the audience is `, App.UI.DOM.makeElement("span", `very impressed`, ['reputation', - 'inc']), ` by the display.`); + success = 0.5; - repX(500, "pit", winner); + if (V.pit.audience === "free") { + r.push(`the audience is `, + App.UI.DOM.makeElement("span", `very impressed`, ['reputation', 'inc']), + ` by the display.`); } else if (V.pit.audience === "paid") { - r.push(`the audience is quite impressed by the display, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', - 'inc']), ` is quite good.`); - - cashX(10000, "pit", winner); + r.push(`the audience is quite impressed by the display, and your `, + App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', 'inc']), + ` is quite good.`); } } else if (!canSee(winner)) { - r.push(`${winner.slaveName} centers ${himself} and hones in on ${loser.slaveName}'s rapid breath. ${He} readies ${himself}, knowing ${he} has a single chance to live. With heavy steps, ${loser.slaveName} rushes ${him}, fully prepared to slaughter the helpless combatant. ${winner.slaveName} gambles everything on a single high slash, a slash that cut ${loser.slaveName}'s undefended neck wide open. ${winner.slaveName} collapses to the ground, fully aware of ${loser.slaveName}'s final gurgles, and the sword `, App.UI.DOM.makeElement("span", `firmly planted in ${his} side.`, ['health', - 'dec']), ` ${He} lived this time, barely, but ${he} doubts ${he} can do it again.`); + r.push(`${winner.slaveName} centers ${himself} and hones in on ${loser.slaveName}'s rapid breath. ${He} readies ${himself}, knowing ${he} has a single chance to live. With heavy steps, ${loser.slaveName} rushes ${him}, fully prepared to slaughter the helpless combatant. ${winner.slaveName} gambles everything on a single high slash, a slash that cut ${loser.slaveName}'s undefended neck wide open. ${winner.slaveName} collapses to the ground, fully aware of ${loser.slaveName}'s final gurgles, and the sword `, + App.UI.DOM.makeElement("span", `firmly planted in ${his} side.`, ['health', 'dec']), + ` ${He} lived this time, barely, but ${he} doubts ${he} can do it again.`); healthDamage(winner, 80); + success = 2; if (V.pit.audience === "free") { - r.push(`The audience is `, App.UI.DOM.makeElement("span", `awestruck`, ['reputation', - 'inc']), ` by the blind ${girl}'s triumph.`); - - repX(2000, "pit", winner); + r.push(`The audience is `, + App.UI.DOM.makeElement("span", `awestruck`, ['reputation', 'inc']), + ` by the blind ${girl}'s triumph.`); } else if (V.pit.audience === "paid") { - r.push(`The audience is awestruck by the blind ${girl}'s triumph, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', - 'inc']), ` is enormous.`); - - cashX(40000, "pit", winner); + r.push(`The audience is awestruck by the blind ${girl}'s triumph, and your `, + App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', 'inc']), + ` is enormous.`); } } else if (!canSee(loser)) { r.push(`${winner.slaveName} sighs at ${loser.slaveName}'s random slashing and calmly struts around the panicking slave. In one quick swoop, ${he} buries ${his} blade in ${loser.slaveName}'s back, ending the poor ${girl2}'s flailing.`); + success = -0.1; + if (V.pit.audience === "free") { r.push(`The audience is `, App.UI.DOM.makeElement("span", `annoyed`, ["reputation", "dec"]), ` by this waste of a fight.`); - - repX(-20, "pit", winner); } else if (V.pit.audience === "paid") { r.push(`The audience found the fight embarrassing, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', - 'inc']), ` is pitiful.`); - - cashX(40, "pit", winner); + 'dec']), ` is pitiful.`); } } else if (winnerDeadliness > (loserDeadliness + 3)) { if (winner.skill.combat > 30) { r.push(`${winner.slaveName} wants to win, and ${he} opens the fight with a furious attack. ${loser.slaveName} manages to get ${his2} blade up, blocking a strike with a ringing clash and a few sparks, but by doing so leaves ${his2} abdomen open and obscures ${his2} vision enough that ${he2} is unprepared for the following horizontal slash, which opens ${his2} belly wide. The stricken ${girl2} collapses, feebly trying to push ${his2} viscera back into place. Whether out of mercy or a desire to get it over with, ${winner.slaveName} quickly removes the dying ${girl2}'s head.`); - if (V.pit.audience === "free") { - r.push(`The audience is `, App.UI.DOM.makeElement("span", `reasonably impressed`, ['reputation', - 'inc']), ` by the gore.`); + success = 0.2; - repX(200, "pit", winner); + if (V.pit.audience === "free") { + r.push(`The audience is `, + App.UI.DOM.makeElement("span", `reasonably impressed`, ['reputation', 'inc']), + ` by the gore.`); } else if (V.pit.audience === "paid") { - r.push(`The audience is reasonably impressed by the gore, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', - 'inc']), ` is reasonable.`); - - cashX(4000, "pit", winner); + r.push(`The audience is reasonably impressed by the gore, and your `, + App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', 'inc']), + ` is reasonable.`); } } else { r.push(`${winner.slaveName} wants to win and is confident ${he} will, but ${he} isn't particularly sure about how to do so. ${He} fights cautiously, swinging ${his} sword in powerful but inaccurate strokes. It is only a matter of time before one of these strikes gets through; it's telling that rather than hitting what ${he} aimed at, ${winner.slaveName} accidentally opens a massive gash down ${loser.slaveName}'s thigh. Realizing ${he2} has to do something, ${loser.slaveName} makes a desperate counterattack, pouring blood as ${he2} goes. ${winner.slaveName} panics and fails to parry one of the last counterstrikes before loss of blood ends the attack, suffering a `, App.UI.DOM.makeElement("span", `terrible cut`, ['health', 'dec']), ` to ${his} shoulder. Down to one arm, ${winner.slaveName} is forced to make a long, loud butchery of ending the fight.`); healthDamage(winner, 20); + success = 0.2; if (V.pit.audience === "free") { - r.push(`The audience is `, App.UI.DOM.makeElement("span", `reasonably impressed`, ['reputation', - 'inc']), ` by the blood.`); - - repX(200, "pit", winner); + r.push(`The audience is `, + App.UI.DOM.makeElement("span", `reasonably impressed`, ['reputation', 'inc']), + ` by the blood.`); } else if (V.pit.audience === "paid") { - r.push(`The audience is reasonably impressed by the blood, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', - 'inc']), ` is reasonable.`); - - cashX(4000, "pit", winner); + r.push(`The audience is reasonably impressed by the blood, and your `, + App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', 'inc']), + ` is reasonable.`); } } } else if (winner.skill.combat > 30 && loser.skill.combat > 30) { r.push(`Upon your word the two combatants approach each other warily, both knowing the other is reasonably competent. Before long they are trading thrust and parry, swing and block. ${winner.slaveName} is slowly pressed back, so ${he} decides to change the nature of the fight. After three tries ${he} manages to force ${loser.slaveName} to close, suffering a `, App.UI.DOM.makeElement("span", `nearly severed ear`, ['health', 'dec']), ` as ${he} does. ${loser.slaveName} realizes ${he2} only retains an advantage at long range but cannot back up fast enough to avoid close combat. ${loser.slaveName} is forced back fast enough that ${he2} trips; ${he2}'s barely fallen on ${his2} back before ${he2} grunts with shock and pain, dying with a look of surprise as ${he2} stares at the sword growing out of ${his2} chest.`); - if (V.pit.audience === "free") { - r.push(`The audience is `, App.UI.DOM.makeElement("span", `very impressed`, ['reputation', - 'inc']), ` by the expert fight.`); + success = 0.5; - repX(500, "pit", winner); + if (V.pit.audience === "free") { + r.push(`The audience is `, + App.UI.DOM.makeElement("span", `very impressed`, ['reputation', 'inc']), + ` by the expert fight.`); } else if (V.pit.audience === "paid") { - r.push(`The audience is quite impressed by the expert fight, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', - 'inc']), ` is quite good.`); - - cashX(10000, "pit", winner); + r.push(`The audience is quite impressed by the expert fight, and your `, + App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', 'inc']), + ` is quite good.`); } } else if (winner.height - loser.height < -10) { r.push(`${winner.slaveName} realizes that ${loser.slaveName}'s wingspan gives ${him2} a huge reach advantage. ${He} bores straight in, taking `, App.UI.DOM.makeElement("span", `a glancing scalp wound`, ['health', 'dec']), ` but coming on regardless. ${loser.slaveName} understands ${his2} opponent's intention and backs off, but the pit is small and there isn't much room to retreat. When ${his2} back hits a padded wall, ${winner.slaveName} aims a gutting cut that ${loser.slaveName} struggles to block. ${He2} manages it, but the wall catches ${his2} point, so the block is with ${his2} wrist, not ${his2} sword. The sharp blade cuts almost all the way through the joint, leaving ${him2} in agony and totally incapable of defense. ${winner.slaveName} pushes ${his2} head back against the wall and cuts ${his2} throat down to the spine.`); - if (V.pit.audience === "free") { - r.push(`The audience is `, App.UI.DOM.makeElement("span", `reasonably impressed`, ['reputation', - 'inc']), ` by the blood.`); + success = 0.2; - repX(200, "pit", winner); + if (V.pit.audience === "free") { + r.push(`The audience is `, + App.UI.DOM.makeElement("span", `reasonably impressed`, ['reputation', 'inc']), + ` by the blood.`); } else if (V.pit.audience === "paid") { - r.push(`The audience is reasonably impressed by the blood, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', - 'inc']), ` is reasonable.`); - - cashX(4000, "pit", winner); + r.push(`The audience is reasonably impressed by the blood, and your `, + App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', 'inc']), + ` is reasonable.`); } } else if (winner.muscles > 30) { r.push(`${winner.slaveName} is so massively muscular that ${he}'s actually impeded by ${his} lack of speed and flexibility. ${loser.slaveName} is properly afraid of ${his2} strength, though, so ${he2} tries to stay away as much as ${he2} can. The few times their blades clash reinforces this approach, since ${winner.slaveName} is able to beat ${his} opponent's blocks out of the way with contemptuous ease. The fight takes a long, long time, but it takes more out of ${loser.slaveName} to survive than it takes out of ${winner.slaveName} to keep swinging. Eventually the gasping, weeping ${loser.slaveName} trips and does not struggle to ${his2} feet in time. It takes ${his2} tired opponent several overhead butcher's cleaves to end it.`); - if (V.pit.audience === "free") { - r.push(`The audience is `, App.UI.DOM.makeElement("span", `reasonably impressed`, ['reputation', - 'inc']), ` by the show of strength.`); + success = 0.05; - repX(50, "pit", winner); + if (V.pit.audience === "free") { + r.push(`The audience is `, + App.UI.DOM.makeElement("span", `reasonably impressed`, ['reputation', 'inc']), + ` by the show of strength.`); } else if (V.pit.audience === "paid") { - r.push(`The audience is reasonably impressed by the show of strength, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', - 'inc']), ` is reasonable.`); - - cashX(1000, "pit", winner); + r.push(`The audience is reasonably impressed by the show of strength, and your `, + App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', 'inc']), + ` is reasonable.`); } } else if (loser.belly > 300000) { r.push(`${winner.slaveName} wants to live badly enough that ${he} takes an extremely brutal shortcut to victory. The instant the fight starts, ${he} quickly slices right across ${loser.slaveName}'s massive belly, which is far too large to possibly defend. ${loser.slaveName}'s belly ruptures like a popped water balloon, showering ${winner.slaveName} with`); @@ -484,62 +491,61 @@ App.Facilities.Pit.Fights.LR1v1 = class extends App.Facilities.Pit.Fights.BaseFi r.push(`${winner.slaveName} walks over to the bleeding out slave and quickly cuts ${his2} throat.`); - if (V.pit.audience === "free") { - r.push(`the audience is `, App.UI.DOM.makeElement("span", `not very impressed`, ['reputation', - 'inc']), ` by this easy kill.`); + success = 0.1; - repX(100, "pit", winner); + if (V.pit.audience === "free") { + r.push(`the audience is `, + App.UI.DOM.makeElement("span", `not very impressed`, ['reputation', 'inc']), + ` by this easy kill.`); } else if (V.pit.audience === "paid") { - r.push(`The audience is not very impressed by this easy kill, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', - 'inc']), ` is unimpressive.`); - - cashX(2000, "pit", winner); + r.push(`The audience is not very impressed by this easy kill, and your `, + App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', 'inc']), + ` is unimpressive.`); } } else if (loser.boobs > 1200) { r.push(`${winner.slaveName} takes an extremely simple shortcut to victory. The instant the fight starts, ${he} slices ${loser.slaveName} right across ${his2} huge tits, which are so large they cannot properly be defended. ${loser.slaveName} reflexively drops ${his2} sword to clasp ${his2} ${hasBothArms(loser) ? `hands` : `hand`} over ${his2} ruined breasts, gushing blood${loser.boobsImplant > 400 ? ` and implant fluid` : ``}. ${winner.slaveName}'s follow-up is neither artful nor particularly well planned, but it is effective. ${He} hits the distracted ${girl2}'s neck from the side, almost but not quite separating ${his2} head from ${his2} body.`); - if (V.pit.audience === "free") { - r.push(`The audience is `, App.UI.DOM.makeElement("span", `not very impressed`, ['reputation', - 'inc']), ` by this easy kill.`); + success = 0.1; - repX(100, "pit", winner); + if (V.pit.audience === "free") { + r.push(`The audience is `, + App.UI.DOM.makeElement("span", `not very impressed`, ['reputation', 'inc']), + ` by this easy kill.`); } else if (V.pit.audience === "paid") { - r.push(`The audience is not very impressed by this easy kill, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', - 'inc']), ` is unimpressive.`); - - cashX(2000, "pit", winner); + r.push(`The audience is not very impressed by this easy kill, and your `, + App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', 'inc']), + ` is unimpressive.`); } } else if (loser.dick > 0) { r.push(`${winner.slaveName} wants to live badly enough that ${he} takes an extremely brutal shortcut to victory. The instant the fight starts, ${he} furiously swings for ${loser.slaveName}'s face. ${loser.slaveName} reflexively raises ${his2} sword to block, at which point ${winner.slaveName} simply kicks ${him2} in the dick. ${loser.slaveName} goes down like a marionette with cut strings, ${his2} mouth soundlessly opening and closing and tears leaking from ${his2} closed eyes. ${winner.slaveName} walks over to the prostrate slave and cuts ${his2} throat without much trouble.`); - if (V.pit.audience === "free") { - r.push(`The audience is `, App.UI.DOM.makeElement("span", `not very impressed`, ['reputation', - 'inc']), ` by this easy kill.`); + success = 0.1; - repX(100, "pit", winner); + if (V.pit.audience === "free") { + r.push(`The audience is `, + App.UI.DOM.makeElement("span", `not very impressed`, ['reputation', 'inc']), + ` by this easy kill.`); } else if (V.pit.audience === "paid") { - r.push(`The audience is not very impressed by this easy kill, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', - 'inc']), ` is unimpressive.`); - - cashX(2000, "pit", winner); + r.push(`The audience is not very impressed by this easy kill, and your `, + App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', 'inc']), + ` is unimpressive.`); } } else { r.push(`${winner.slaveName} wants to live badly enough that ${he} takes an extremely brutal shortcut to victory. The instant the fight starts, ${he} furiously swings for ${loser.slaveName}'s face. ${loser.slaveName} reflexively raises ${his2} sword to block, at which point ${winner.slaveName} simply kicks ${him2} in the cunt. ${loser.slaveName} goes down like a marionette with cut strings, ${his2} mouth soundlessly opening and closing and tears leaking from ${his2} closed eyes. ${winner.slaveName} walks over to the prostrate slave and cuts ${his2} throat without much trouble.`); - if (V.pit.audience === "free") { - r.push(`The audience is `, App.UI.DOM.makeElement("span", `not very impressed`, ['reputation', - 'inc']), ` by this easy kill.`); + success = 0.1; - repX(100, "pit", winner); + if (V.pit.audience === "free") { + r.push(`The audience is `, + App.UI.DOM.makeElement("span", `not very impressed`, ['reputation', 'inc']), + ` by this easy kill.`); } else if (V.pit.audience === "paid") { - r.push(`The audience is not very impressed by this easy kill, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', - 'inc']), ` is unimpressive.`); - - cashX(2000, "pit", winner); + r.push(`The audience is not very impressed by this easy kill, and your `, + App.UI.DOM.makeElement("span", `cut of the betting`, ['cash', 'inc']), + ` is unimpressive.`); } } - App.Events.addParagraph(parent, r); } @@ -662,8 +668,6 @@ App.Facilities.Pit.Fights.LR1v1 = class extends App.Facilities.Pit.Fights.BaseFi } } - V.pit.slaveFightingBodyguard = null; - if (winner.skill.combat < 60) { const experienceSpan = App.UI.DOM.makeElement("span", `improved ${his} combat skills.`, ["improvement"]); @@ -678,15 +682,7 @@ App.Facilities.Pit.Fights.LR1v1 = class extends App.Facilities.Pit.Fights.BaseFi V.pitKillsTotal++; V.pitFightsTotal++; - if (loser.hasOwnProperty('slaveName')) { - V.pit.fighterIDs.delete(loser.ID); - - if (V.pit.slavesFighting.length > 0) { - V.pit.slavesFighting = []; - } - - removeSlave(loser); - } + removeSlave(loser); App.Events.addParagraph(parent, r); } diff --git a/src/facilities/pit/fights/0_nonLethalRandom.js b/src/facilities/pit/fights/0_nonLethalRandom.js index fdcdb0bc8d8..3a1340276d2 100644 --- a/src/facilities/pit/fights/0_nonLethalRandom.js +++ b/src/facilities/pit/fights/0_nonLethalRandom.js @@ -1,7 +1,7 @@ /** Nonlethal 1v1 between random slaves. */ App.Facilities.Pit.Fights.NlR1v1 = class extends App.Facilities.Pit.Fights.BaseFight { get uiDescription() { - return "Nonlethal 1-vs-1 between two random slaves"; + return "1-vs-1 between two random slaves"; } get key() { @@ -38,6 +38,8 @@ App.Facilities.Pit.Fights.NlR1v1 = class extends App.Facilities.Pit.Fights.BaseF const winner = getWinner() ? slave1 : slave2; const loser = winner === slave1 ? slave2 : slave1; + let success = 0; + intro(node); fighterDeadliness(node, slave1); fighterDeadliness(node, slave2); @@ -45,6 +47,8 @@ App.Facilities.Pit.Fights.NlR1v1 = class extends App.Facilities.Pit.Fights.BaseF fight(node); postFight(node); + return success; + /** * @param {DocumentFragment} parent */ @@ -330,136 +334,135 @@ App.Facilities.Pit.Fights.NlR1v1 = class extends App.Facilities.Pit.Fights.BaseF if (!canSee(winner) && !canSee(loser)) { r.push(`${winner.slaveName} and ${loser.slaveName} are both blind, making the fight a stare-down. Neither slave wants to make the first move, especially with the drowning cacophony coming from the jeering crowd. Slowly, ${winner.slaveName} moves forward, waving feeling for ${his} opponent before ${he} ${himself} gets found. ${loser.slaveName}'s hand meets ${winner.slaveName}'s and the two move to grab each other in a headlock. The two slaves violently thrash against each other, suffering more and more strikes as the struggle goes on. Eventually, ${loser.slaveName} can take no more and releases ${his2} grip on ${winner.slaveName} neck. It takes a moment for ${winner.slaveName} to stop wrestling the submitting ${loser.slaveName} and accept ${his} victory.`); - if (V.pit.audience === "free") { - r.push(`The audience is `, App.UI.DOM.makeElement("span", `surprised`, ["reputation", - "inc"]), ` by the impromptu wrestling match.`); + success = 0.25; - repX(50, "pit", winner); + if (V.pit.audience === "free") { + r.push(`The audience is `, + App.UI.DOM.makeElement("span", `surprised`, ["reputation", "inc"]), + ` by the impromptu wrestling match.`); } else if (V.pit.audience === "paid") { - r.push(`The audience is surprised by the sudden wrestling match, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ["cash", - "inc"]), ` is modest.`); - - cashX(500, "pit", winner); + r.push(`The audience is surprised by the sudden wrestling match, and your `, + App.UI.DOM.makeElement("span", `cut of the betting`, ["cash", "inc"]), + ` is modest.`); } } else if (winnerDeadliness > (loserDeadliness + 1) && getArmCount(winner, 6) > 1) { r.push(`Upon your word the two combatants approach each other. ${winner.slaveName} keeps ${his} advanced cybernetic limbs up in a protective position. ${loser.slaveName} probes ${him} with some light blows, puzzled by this ironclad defense. Gradually, ${he2} hits harder and harder, ${his2} opponent grunting under the impacts but holding steady. Finally, ${loser.slaveName} tires, gets off balance, and ${winner.slaveName} manages to grab ${his2} forearm. ${winner.slaveName}'s limbs emit an electric shock that temporarily incapacitates ${his} opponent. ${winner.slaveName} uses ${his} grip to pull ${his} stunned opponent in and grab ${his2} neck with the other hand, using it to exert just the right amount of pressure to choke ${him2} out harmlessly. Though the fight was short,`); - if (V.pit.audience === "free") { - r.push(`the audience is `, App.UI.DOM.makeElement("span", `very impressed`, ["reputation", - "inc"]), ` by the display.`); + success = 0.5; - repX(100, "pit", winner); + if (V.pit.audience === "free") { + r.push(`the audience is `, + App.UI.DOM.makeElement("span", `very impressed`, ["reputation", "inc"]), + ` by the display.`); } else if (V.pit.audience === "paid") { - r.push(`the audience is quite impressed by the display, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ["cash", - "inc"]), ` is quite good.`); - - cashX(2000, "pit", winner); + r.push(`the audience is quite impressed by the display, and your `, + App.UI.DOM.makeElement("span", `cut of the betting`, ["cash", "inc"]), + ` is quite good.`); } } else if (winnerDeadliness > (loserDeadliness + 1) && getArmCount(winner, 5) > 1) { r.push(`Upon your word the two combatants approach each other. ${winner.slaveName} keeps ${his} artificial limbs up in a protective position. ${loser.slaveName} probes ${him} with some light blows, puzzled by this ironclad defense. Gradually, ${he2} hits harder and harder, ${his2} opponent grunting under the impacts but holding steady. Finally, ${loser.slaveName} overcommits to a body blow, and ${winner.slaveName} grips ${his2} forearm. That is the end. The augmented grip is effectively unbreakable, and ${winner.slaveName} uses it to pull ${his} opponent in and grab ${his2} neck with the other hand, using it to exert just the right amount of pressure to choke ${him2} out harmlessly. Though the fight was short,`); - if (V.pit.audience === "free") { - r.push(`the audience is `, App.UI.DOM.makeElement("span", `very impressed`, ["reputation", - "inc"]), ` by the display.`); + success = 0.5; - repX(100, "pit", winner); + if (V.pit.audience === "free") { + r.push(`the audience is `, + App.UI.DOM.makeElement("span", `very impressed`, ["reputation", "inc"]), + ` by the display.`); } else if (V.pit.audience === "paid") { - r.push(`the audience is quite impressed by the display, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ["cash", - "inc"]), ` is quite good.`); - - cashX(2000, "pit", winner); + r.push(`the audience is quite impressed by the display, and your `, + App.UI.DOM.makeElement("span", `cut of the betting`, ["cash", "inc"]), + ` is quite good.`); } } else if (!canSee(winner)) { r.push(`${winner.slaveName} centers ${himself} and hones in on ${loser.slaveName}'s rapid breath. ${He} readies ${himself}, knowing ${he} has a single chance to win. With heavy steps, ${loser.slaveName} rushes ${him}, fully prepared to tackle the helpless combatant. ${winner.slaveName} gambles everything on a single high punch, a strike that slams ${loser.slaveName}'s undefended neck. ${loser.slaveName} falls to the ground before the panicking ${winner.slaveName}, who quickly pins the coughing loser.`); healthDamage(winner, 80); + success = 1; if (V.pit.audience === "free") { - r.push(`The audience is `, App.UI.DOM.makeElement("span", `awestruck`, ["reputation", - "inc"]), ` by the blind ${girl}'s triumph.`); - - repX(200, "pit", winner); + r.push(`The audience is `, + App.UI.DOM.makeElement("span", `awestruck`, ["reputation", "inc"]), + ` by the blind ${girl}'s triumph.`); } else if (V.pit.audience === "paid") { - r.push(`The audience is awestruck by the blind ${girl}'s triumph, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ["cash", - "inc"]), ` is enormous.`); - - cashX(4000, "pit", winner); + r.push(`The audience is awestruck by the blind ${girl}'s triumph, and your `, + App.UI.DOM.makeElement("span", `cut of the betting`, ["cash", "inc"]), + ` is enormous.`); } } else if (!canSee(loser)) { r.push(`${winner.slaveName} grins at ${loser.slaveName}'s random swings and poor form. ${He} centers in on ${his} favorite part of ${loser.slaveName}'s body before rushing between ${his2} strikes and tackling ${him2} to the ground. ${loser.slaveName} lays there, helpless to stop ${winner.slaveName} from molesting ${him2}.`); - if (V.pit.audience === "free") { - r.push(`The audience is `, App.UI.DOM.makeElement("span", `annoyed`, ["reputation", - "dec"]), ` by this lack of a fight.`); + success = -0.1; - repX(-20, "pit", winner); + if (V.pit.audience === "free") { + r.push(`The audience is `, + App.UI.DOM.makeElement("span", `annoyed`, ["reputation", "dec"]), + ` by this lack of a fight.`); } else if (V.pit.audience === "paid") { - r.push(`The audience found the fight embarrassing, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ["cash", - "inc"]), ` is pitiful.`); - - cashX(40, "pit", winner); + r.push(`The audience found the fight embarrassing, and your `, + App.UI.DOM.makeElement("span", `cut of the betting`, ["cash", "dec"]), + ` is pitiful.`); } } else if (winnerDeadliness > (loserDeadliness + 3)) { if (winner.skill.combat > 30) { r.push(`${winner.slaveName} wants to win, and ${he} opens the fight with a furious attack. ${loser.slaveName} manages to get ${his2} ${hasBothArms(loser) ? `forearms` : `forearm`} up, blocking a few blows, but by doing so leaves ${his2} abdomen open and obscures ${his2} vision enough that ${he2} is unprepared for the following kidney strike, which brings ${him2} gasping to one knee. ${winner.slaveName} lets ${him2} rise just a little before delivering a calculated hard right that sends ${loser.slaveName} to the mat.`); - if (V.pit.audience === "free") { - r.push(`The audience is `, App.UI.DOM.makeElement("span", `not very impressed`, ["reputation", - "inc"]), ` by this execution.`); + success = 0.125; - repX(25, "pit", winner); + if (V.pit.audience === "free") { + r.push(`The audience is `, + App.UI.DOM.makeElement("span", `not very impressed`, ["reputation", "inc"]), + ` by this execution.`); } else if (V.pit.audience === "paid") { - r.push(`The audience is not very impressed by this execution, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ["cash", - "inc"]), ` is unimpressive.`); - - cashX(500, "pit", winner); + r.push(`The audience is not very impressed by this execution, and your `, + App.UI.DOM.makeElement("span", `cut of the betting`, ["cash", "inc"]), + ` is unimpressive.`); } } else { r.push(`${winner.slaveName} wants to win and is confident ${he} will, but ${he} isn't particularly sure about how to do so. ${He} fights cautiously, mostly hitting ${loser.slaveName} from afar. Slowly, the rain of blows begins to tell, opening ${loser.slaveName}'s lip, giving ${him2} a bloody nose, and bruising ${his2} face. Realizing ${he2} has to do something, ${loser.slaveName} makes a desperate counterattack, `, App.UI.DOM.makeElement("span", `dripping blood`, ["health", "dec"]), ` as ${he2} goes. As ${he2} does ${he2} manages to get ${his2} face in the way of another of ${winner.slaveName}'s inexpert strikes and goes down hard. ${He2} makes to rise, but ${winner.slaveName} decides the fight by the simple expedient of kicking ${him2} in the crotch.`); healthDamage(winner, 20); + success = 0.25; if (V.pit.audience === "free") { - r.push(`The audience is `, App.UI.DOM.makeElement("span", `reasonably impressed`, ["reputation", - "inc"]), ` by the beating.`); - - repX(50, "pit", winner); + r.push(`The audience is `, + App.UI.DOM.makeElement("span", `reasonably impressed`, ["reputation", "inc"]), + ` by the beating.`); } else if (V.pit.audience === "paid") { - r.push(`The audience is reasonably impressed by the beating, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ["cash", - "inc"]), ` is reasonable.`); - - cashX(100, "pit", winner); + r.push(`The audience is reasonably impressed by the beating, and your `, + App.UI.DOM.makeElement("span", `cut of the betting`, ["cash", "inc"]), + ` is reasonable.`); } } } else if (winner.belly > 60000 && loser.belly > 60000) { - r.push(`${winner.slaveName} and ${loser.slaveName} stare each other down and both come to a realization. Neither can reach the other around their massive bellies. Instead, they choose to ram their bulk into each other in hopes of toppling the weaker. After a drawn out struggle, both slaves' middles are `, App.UI.DOM.makeElement("span", `dark red and shuddering,`, ["health", - "dec"]), ` ready to burst open. Rather than continue, ${loser.slaveName} lets the next strike down ${him2} hoping that the outcome of this fight isn't fatal.`); + r.push(`${winner.slaveName} and ${loser.slaveName} stare each other down and both come to a realization. Neither can reach the other around their massive bellies. Instead, they choose to ram their bulk into each other in hopes of toppling the weaker. After a drawn out struggle, both slaves' middles are `, + App.UI.DOM.makeElement("span", `dark red and shuddering,`, ["health", "dec"]), + ` ready to burst open. Rather than continue, ${loser.slaveName} lets the next strike down ${him2} hoping that the outcome of this fight isn't fatal.`); - if (V.pit.audience === "free") { - r.push(`The audience is `, App.UI.DOM.makeElement("span", `very impressed`, ["reputation", - "dec"]), ` by the showdown.`); + success = 0.375; - repX(75, "pit", winner); + if (V.pit.audience === "free") { + r.push(`The audience is `, + App.UI.DOM.makeElement("span", `very impressed`, ["reputation", "dec"]), + ` by the showdown.`); } else if (V.pit.audience === "paid") { - r.push(`The audience is very impressed by the showdown, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ["cash", - "inc"]), ` is good.`); - - cashX(1500, "pit", winner); + r.push(`The audience is very impressed by the showdown, and your `, + App.UI.DOM.makeElement("span", `cut of the betting`, ["cash", "inc"]), + ` is good.`); } } else if (winner.belly > 60000 && loser.belly < 30000) { r.push(`${loser.slaveName} spies an easy win against ${his2} massively bloated opponent and rushes in to topple ${winner.slaveName}. In an effort to defend ${himself}, ${winner.slaveName} hoists ${his} belly and turns suddenly, accidentally impacting ${loser.slaveName} with ${his} massive middle and knocking ${him2} to the ground. Seeing an opportunity, ${winner.slaveName} releases ${his} grip and slams ${his} weighty womb down on ${loser.slaveName}, bashing the wind out of ${him2}. ${loser.slaveName} struggles to slip out from under the mass, but the weight is too great and ${he2} passes out.`); - if (V.pit.audience === "free") { - r.push(`The audience is `, App.UI.DOM.makeElement("span", `impressed`, ["reputation", - "dec"]), ` by this absurd win.`); + success = 0.25; - repX(50, "pit", winner); + if (V.pit.audience === "free") { + r.push(`The audience is `, + App.UI.DOM.makeElement("span", `impressed`, ["reputation", "dec"]), + ` by this absurd win.`); } else if (V.pit.audience === "paid") { - r.push(`The audience is impressed by this absurd win, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ["cash", - "inc"]), ` is reasonably.`); - - cashX(1000, "pit", winner); + r.push(`The audience is impressed by this absurd win, and your `, + App.UI.DOM.makeElement("span", `cut of the betting`, ["cash", "inc"]), + ` is reasonably.`); } } else if (winner.skill.combat > 30 && loser.skill.combat > 30) { const healthSpans = [App.UI.DOM.makeElement("span", `broken nose`, ["health", "dec"]), @@ -467,89 +470,89 @@ App.Facilities.Pit.Fights.NlR1v1 = class extends App.Facilities.Pit.Fights.BaseF r.push(`Upon your word the two combatants approach each other warily, both knowing the other is reasonably competent. Before long they are trading expert blows. ${winner.slaveName} is getting the worst of it, so ${he} decides to change the nature of the fight. After three tries ${he} manages to bring ${loser.slaveName} to the ground, suffering a `, healthSpans[0], ` as ${he} does. ${loser.slaveName} tries to break the imperfect hold but only earns ${himself2} an elbow to the face. ${He2}'s furious and ${winner.slaveName} is obliged to wrench ${his2} arm `, healthSpans[1], ` before ${he2} allows ${himself2} to go limp.`); - if (V.pit.audience === "free") { - r.push(`The audience is `, App.UI.DOM.makeElement("span", `very impressed`, ["reputation", - "inc"]), ` by the expert fight.`); + success = 0.5; - repX(100, "pit", winner); + if (V.pit.audience === "free") { + r.push(`The audience is `, + App.UI.DOM.makeElement("span", `very impressed`, ["reputation", "inc"]), + ` by the expert fight.`); } else if (V.pit.audience === "paid") { - r.push(`The audience is quite impressed by the expert fight, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ["cash", - "inc"]), ` is quite good.`); - - cashX(2000, "pit", winner); + r.push(`The audience is quite impressed by the expert fight, and your `, + App.UI.DOM.makeElement("span", `cut of the betting`, ["cash", "inc"]), + ` is quite good.`); } } else if (winner.height - loser.height < -10) { r.push(`${winner.slaveName} realizes that ${loser.slaveName}'s wingspan gives ${him2} a huge reach advantage. ${He} bores straight in, taking a hit or two but coming on regardless. ${loser.slaveName} understands ${his2} opponent's intention and backs off, but the pit is small and there isn't much room to retreat. When ${his2} back hits a padded wall, ${winner.slaveName} manages to land a light hit to ${his2} stomach that leaves ${loser.slaveName} winded enough that a hard kick to the side of ${his2} knee goes undefended. It causes `, App.UI.DOM.makeElement("span", `considerable damage,`, ["health", "dec"]), ` dropping ${him2} and ending the fight.`); - if (V.pit.audience === "free") { - r.push(`The audience is `, App.UI.DOM.makeElement("span", `reasonably impressed`, ["reputation", - "inc"]), ` by the take-down.`); + success = 0.25; - repX(50, "pit", winner); + if (V.pit.audience === "free") { + r.push(`The audience is `, + App.UI.DOM.makeElement("span", `reasonably impressed`, ["reputation", "inc"]), + ` by the take-down.`); } else if (V.pit.audience === "paid") { - r.push(`The audience is reasonably impressed by the take-down, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ["cash", - "inc"]), ` is reasonable.`); - - cashX(1000, "pit", winner); + r.push(`The audience is reasonably impressed by the take-down, and your `, + App.UI.DOM.makeElement("span", `cut of the betting`, ["cash", "inc"]), + ` is reasonable.`); } } else if (loser.piercing.eyebrow.weight > 0) { r.push(`The fight starts slowly, with the two trading jabs. Just as the spectators are getting bored, ${loser.slaveName} takes a glancing blow to the eyebrow. ${His2} piercing catches on ${winner.slaveName}'s glove and tears out. ${loser.slaveName} goes after ${his2} tormentor in fury, streaming blood, the piercing forgotten on the mat. Any tendency ${winner.slaveName} might have had to feel badly about this is extinguished by the assault, and soon ${winner.slaveName} is even willing to follow up on the success by targeting pierced body parts. The fight ends with poor ${loser.slaveName} writhing in pain on the mat, `, App.UI.DOM.makeElement("span", `leaking blood`, ["health", "dec"]), ` from several terribly shredded areas.`); - if (V.pit.audience === "free") { - r.push(`The audience is `, App.UI.DOM.makeElement("span", `reasonably impressed`, ["reputation", - "inc"]), ` by the gory spectacle.`); + success = 0.25; - repX(50, "pit", winner); + if (V.pit.audience === "free") { + r.push(`The audience is `, + App.UI.DOM.makeElement("span", `reasonably impressed`, ["reputation", "inc"]), + ` by the gory spectacle.`); } else if (V.pit.audience === "paid") { - r.push(`The audience is reasonably impressed by the gory spectacle, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ["cash", - "inc"]), ` is reasonable.`); - - cashX(1000, "pit", winner); + r.push(`The audience is reasonably impressed by the gory spectacle, and your `, + App.UI.DOM.makeElement("span", `cut of the betting`, ["cash", "inc"]), + ` is reasonable.`); } } else if (winner.muscles > 30) { r.push(`${winner.slaveName} is so massively muscular that ${he}'s actually impeded by ${his} size. ${loser.slaveName} is properly afraid of ${his} strength, though, so ${he2} tries to stay away as much as ${he2} can. The pit isn't large, however, and eventually ${winner.slaveName} manages to lay a hand on ${him2}. ${He} pulls ${him2} down, and then it's all over but the beating. ${loser.slaveName} rains blows on ${his2} huge oppressor, but all ${winner.slaveName} has to do is hold on with one arm and deliver damage with the other. By the time ${he2} gives up and goes limp, ${loser.slaveName} has collected `, App.UI.DOM.makeElement("span", `many minor injuries.`, ["health", "dec"])); - if (V.pit.audience === "free") { - r.push(`The audience is `, App.UI.DOM.makeElement("span", `reasonably impressed`, ["reputation", - "inc"]), ` by the show of strength.`); + success = 0.25; - repX(50, "pit", winner); + if (V.pit.audience === "free") { + r.push(`The audience is `, + App.UI.DOM.makeElement("span", `reasonably impressed`, ["reputation", "inc"]), + ` by the show of strength.`); } else if (V.pit.audience === "paid") { - r.push(`The audience is reasonably impressed by the show of strength, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ["cash", - "inc"]), ` is reasonable.`); - - cashX(1000, "pit", winner); + r.push(`The audience is reasonably impressed by the show of strength, and your `, + App.UI.DOM.makeElement("span", `cut of the betting`, ["cash", "inc"]), + ` is reasonable.`); } } else if (loser.belly > 300000) { r.push(`${winner.slaveName} wants to win badly enough that ${he} takes an extremely brutal shortcut to victory. The instant the fight starts, ${he} quickly knees ${loser.slaveName} in the stomach. The massively swollen ${loser.slaveName} goes down with a loud thud and plenty of jiggling. ${winner.slaveName} gloats over the struggling ${loser.slaveName} watching as ${he2} is unable to pull ${his2} bloated form off the ground.`); - if (V.pit.audience === "free") { - r.push(`The audience is `, App.UI.DOM.makeElement("span", `not very impressed`, ["reputation", - "inc"]), ` by this easy win.`); + success = 0.25; - repX(50, "pit", winner); + if (V.pit.audience === "free") { + r.push(`The audience is `, + App.UI.DOM.makeElement("span", `not very impressed`, ["reputation", "inc"]), + ` by this easy win.`); } else if (V.pit.audience === "paid") { - r.push(`The audience is not very impressed by this easy win, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ["cash", - "inc"]), ` is unimpressive.`); - - cashX(500, "pit", winner); + r.push(`The audience is not very impressed by this easy win, and your `, + App.UI.DOM.makeElement("span", `cut of the betting`, ["cash", "inc"]), + ` is unimpressive.`); } } else if (loser.boobs > 1200) { r.push(`${winner.slaveName} wants to win badly enough that ${he} takes an extremely simple shortcut to victory. The instant the fight starts, ${he} hits ${loser.slaveName} right in ${his2} huge tits, as hard as ${he} can. This is a sucker punch of the worst kind; ${loser.slaveName}'s boobs are so big that ${he2} has no real chance of defending them. ${He2} gasps with pain${hasAnyArms(loser) ? ` and wraps ${his2} ${hasBothArms(loser) ? `arms` : `arm`} around ${his2} aching bosom` : ``}, giving ${winner.slaveName} a clear opening to deliver a free and easy blow to the jaw that sends the poor top-heavy slave to the mat. Any chance of ${loser.slaveName} rising is extinguished by ${his2} breasts; it takes ${him2} so long to muster an attempt to get up that ${winner.slaveName} can rain hits on ${him2} while ${he2} does.`); - if (V.pit.audience === "free") { - r.push(`The audience is `, App.UI.DOM.makeElement("span", `not very impressed`, ["reputation", - "inc"]), ` by this easy win.`); + success = 0.125; - repX(25, "pit", winner); + if (V.pit.audience === "free") { + r.push(`The audience is `, + App.UI.DOM.makeElement("span", `not very impressed`, ["reputation", "inc"]), + ` by this easy win.`); } else if (V.pit.audience === "paid") { - r.push(`The audience is not very impressed by this easy win, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ["cash", - "inc"]), ` is unimpressive.`); - - cashX(500, "pit", winner); + r.push(`The audience is not very impressed by this easy win, and your `, + App.UI.DOM.makeElement("span", `cut of the betting`, ["cash", "inc"]), + ` is unimpressive.`); } } else if (loser.dick > 0) { r.push(`${winner.slaveName} wants to win badly enough that ${he} takes an extremely unpleasant shortcut to victory. The instant the fight starts, ${he} furiously goes for ${loser.slaveName}'s eyes${hasBothArms(winner) ? `, hands forming claws` : hasAnyArms(winner) ? `, ${his} hand forming a claw` : ``}. ${loser.slaveName} ${hasAnyArms(loser) ? `defends ${himself2} with ${his2} ${hasBothArms(loser) ? `arms` : `arm`}` : `tries to defend ${himself} as best ${he} can`}, at which point ${winner.slaveName} delivers a mighty cunt punt. ${loser.slaveName} goes straight down, ${his2} mouth soundlessly opening and closing and tears leaking from ${his2} closed eyes${hasAnyArms(loser) @@ -558,49 +561,47 @@ App.Facilities.Pit.Fights.NlR1v1 = class extends App.Facilities.Pit.Fights.BaseF : `hand desperately shields`} ${his2} outraged pussy` : ``}. ${winner.slaveName} follows ${him2} down and puts the unresisting ${girl2}'s head in a simple lock.`); - if (V.pit.audience === "free") { - r.push(`The audience is `, App.UI.DOM.makeElement("span", `not very impressed`, ["reputation", - "inc"]), ` by this easy win.`); + success = 0.125; - repX(25, "pit", winner); + if (V.pit.audience === "free") { + r.push(`The audience is `, + App.UI.DOM.makeElement("span", `not very impressed`, ["reputation", "inc"]), + ` by this easy win.`); } else if (V.pit.audience === "paid") { - r.push(`The audience is not very impressed by this easy win, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ["cash", - "inc"]), ` is unimpressive.`); - - cashX(500, "pit", winner); + r.push(`The audience is not very impressed by this easy win, and your `, + App.UI.DOM.makeElement("span", `cut of the betting`, ["cash", "inc"]), + ` is unimpressive.`); } } else if (loser.vagina > 0) { r.push(`${winner.slaveName} wants to win badly enough that ${he} takes an extremely unpleasant shortcut to victory. The instant the fight starts, ${he} furiously goes for ${loser.slaveName}'s eyes${hasBothArms(winner) ? `, hands forming claws` : hasAnyArms(winner) ? `, ${his} hand forming a claw` : ``}. ${loser.slaveName} ${hasAnyArms(loser) ? `defends ${himself2} with ${his2} ${hasBothArms(loser) ? `arms` : `arm`}` : `tries to defend ${himself} as best ${he} can`}, at which point ${winner.slaveName} delivers a mighty cunt punt. ${loser.slaveName} goes straight down, ${his2} mouth soundlessly opening and closing and tears leaking from ${his2} closed eyes${hasAnyArms(loser) ? ` while ${his} ${hasBothArms(loser) ? `hands` : `hand`} desperately shield${!hasBothArms(loser) ? `s` : ``} ${his2} outraged pussy` : ``}. ${winner.slaveName} follows ${him2} down and puts the unresisting ${girl2}'s head in a simple lock.`); - if (V.pit.audience === "free") { - r.push(`The audience is `, App.UI.DOM.makeElement("span", `not very impressed`, ["reputation", - "inc"]), ` by this easy win.`); + success = 0.125; - repX(25, "pit", winner); + if (V.pit.audience === "free") { + r.push(`The audience is `, + App.UI.DOM.makeElement("span", `not very impressed`, ["reputation", "inc"]), + ` by this easy win.`); } else if (V.pit.audience === "paid") { - r.push(`The audience is not very impressed by this easy win, and your `, App.UI.DOM.makeElement("span", `cut of the betting`, ["cash", - "inc"]), ` is unimpressive.`); - - cashX(500, "pit", winner); + r.push(`The audience is not very impressed by this easy win, and your `, + App.UI.DOM.makeElement("span", `cut of the betting`, ["cash", "inc"]), + ` is unimpressive.`); } } else { r.push(`${winner.slaveName} wants to win badly enough that ${he} takes an extremely unpleasant shortcut to victory. The instant the fight starts, ${he} furiously goes for ${loser.slaveName}'s eyes, hands forming claws. ${loser.slaveName} defends ${himself2} with ${his2} arms, at which point ${winner.slaveName} delivers a clenched fist to ${loser.slaveName}'s throat. ${loser.slaveName} staggers back, wheezing for breath with tears leaking from ${his2} closed eyes. ${winner.slaveName} takes advantage of ${loser.slaveName}'s vulnerability to quickly trip and pin the coughing loser.`); - if (V.pit.audience === "free") { - r.push(`The audience is `, App.UI.DOM.makeElement("span", `not very impressed`, ["reputation", - "inc"]), ` by this easy win.`); + success = 0.125; - repX(25, "pit", winner); + if (V.pit.audience === "free") { + r.push(`The audience is `, + App.UI.DOM.makeElement("span", `not very impressed`, ["reputation", "inc"]), + ` by this easy win.`); } else if (V.pit.audience === "paid") { - const cashSpan = App.UI.DOM.makeElement("span", `cut of the betting`, ["cash", "inc"]); - - r.push(`The audience is not very impressed by this easy win, and your `, cashSpan, ` is unimpressive.`); - - cashX(500, "pit", winner); + r.push(`The audience is not very impressed by this easy win, and your `, + App.UI.DOM.makeElement("span", `cut of the betting`, ["cash", "inc"]), + ` is unimpressive.`); } } - App.Events.addParagraph(parent, r); } diff --git a/src/facilities/pit/fights/1_lethalBodyguard.js b/src/facilities/pit/fights/1_lethalBodyguard.js index bb4562b7a70..a57ce0f6f50 100644 --- a/src/facilities/pit/fights/1_lethalBodyguard.js +++ b/src/facilities/pit/fights/1_lethalBodyguard.js @@ -1,13 +1,17 @@ /** Lethal 1v1 between the BG and a random slave. */ App.Facilities.Pit.Fights.LBg1v1 = class extends App.Facilities.Pit.Fights.LR1v1 { get uiDescription() { - return "Lethal 1-vs-1 between your bodyguard and a random slave"; + return "1-vs-1 between your bodyguard and a random slave"; } get key() { return "l bg 1v1"; } + get impact() { + return super.impact * 1.1; + } + fightPrerequisites() { return [() => !!S.Bodyguard]; } @@ -20,7 +24,7 @@ App.Facilities.Pit.Fights.LBg1v1 = class extends App.Facilities.Pit.Fights.LR1v1 execute(node) { this.actors = [S.Bodyguard.ID, ...this.actors]; - super.execute(node); + return super.execute(node); } introCombatants(slave1, slave2) { diff --git a/src/facilities/pit/fights/1_nonLethalBodyguard.js b/src/facilities/pit/fights/1_nonLethalBodyguard.js index 1d074877135..3666d3d080a 100644 --- a/src/facilities/pit/fights/1_nonLethalBodyguard.js +++ b/src/facilities/pit/fights/1_nonLethalBodyguard.js @@ -1,13 +1,17 @@ /** Nonlethal 1v1 between the BG and a random slave. */ App.Facilities.Pit.Fights.NlBg1v1 = class extends App.Facilities.Pit.Fights.NlR1v1 { get uiDescription() { - return "Nonlethal 1-vs-1 between your bodyguard and a random slave"; + return "1-vs-1 between your bodyguard and a random slave"; } get key() { return "nl bg 1v1"; } + get impact() { + return super.impact * 1.1; + } + fightPrerequisites() { return [() => !!S.Bodyguard]; } @@ -20,7 +24,7 @@ App.Facilities.Pit.Fights.NlBg1v1 = class extends App.Facilities.Pit.Fights.NlR1 execute(node) { this.actors = [S.Bodyguard.ID, ...this.actors]; - super.execute(node); + return super.execute(node); } introCombatants(slave1, slave2) { diff --git a/src/facilities/pit/pit.js b/src/facilities/pit/pit.js index 46cd60a825f..06ab426a71f 100644 --- a/src/facilities/pit/pit.js +++ b/src/facilities/pit/pit.js @@ -223,6 +223,13 @@ App.Facilities.Pit.pit = function() { const p = document.createElement("p"); p.append(fight.uiDescription); + App.UI.DOM.appendNewElement("div", p, `Impact: ${fightImpact(fight.impact)}`); + if (fight.lethal) { + App.UI.DOM.appendNewElement("div", p, `Lethal`, ["warning"]); + } else { + App.UI.DOM.appendNewElement("div", p, `Nonlethal`, ["green"]); + } + const group = new App.UI.OptionsGroup(); const isActive = App.Facilities.Pit.fightIsQueued(fight.key); @@ -249,6 +256,24 @@ App.Facilities.Pit.pit = function() { return p; } + /** + * @param {number} impact + * @returns {string} + */ + function fightImpact(impact) { + if (impact === 0) { + return "None"; + } else if (impact < 0.8) { + return "Small"; + } else if (impact < 1.5) { + return "Average"; + } else if (impact < 8) { + return "High"; + } else { + return "Very High"; + } + } + function pitScheduled() { const el = document.createDocumentFragment(); diff --git a/src/facilities/pit/pitFightList.js b/src/facilities/pit/pitFightList.js index 5856881600d..9fc8b0d8ed8 100644 --- a/src/facilities/pit/pitFightList.js +++ b/src/facilities/pit/pitFightList.js @@ -5,6 +5,7 @@ App.Facilities.Pit.getFights = function() { return [ // order is important, it will be played in the same order during end week! + // TODO make the above statement true // new App.Facilities.Pit.Fights.TestFight(), new App.Facilities.Pit.Fights.NlR1v1(), -- GitLab