From 0036bb08a2105484ee922c2e7da303453dea2dff Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Thu, 15 Mar 2018 23:03:57 -0400 Subject: [PATCH] Fixed some stuff with struggling. --- customs.js | 37 +++++++++++++++++++++++++++++-------- feast.js | 2 +- 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/customs.js b/customs.js index 8c6b814..7235a75 100644 --- a/customs.js +++ b/customs.js @@ -512,7 +512,7 @@ function taluthusGrabDevour(attacker) { attacker.changeStamina(-10); defender.changeStamina(-50); defender.flags.grappled = false; - defender.flags.grappleType = "belly"; + attacker.flags.grappleType = "belly"; changeMode("eaten"); return ["Taluthus forces your head into his glowing throat, swallowing forcefully to pull you down to his predatory depths."]; } else { @@ -539,7 +539,7 @@ function taluthusTailDevour(attacker) { attacker.changeStamina(-15); defender.changeStamina(-50); attacker.flags.grappleType = "tail"; - attacker.flags.tailSwallowsLeft = 3; + attacker.flags.tailSwallows = 3; defender.flags.grappled = true; changeMode("eaten"); return ["You yelp as one of the kitsune's massive tails snakes up, maw splitting wide open and taking you in with ease."]; @@ -581,9 +581,9 @@ function taluthusTailSwallow(predator,damage=50) { if (success) { predator.changeStamina(-5); player.changeStamina(-25); - predator.flags.tailSwallowsLeft -= 1; + predator.flags.tailSwallows -= 1; - if (predator.flags.tailSwallowsLeft == 0) { + if (predator.flags.tailSwallows == 0) { player.flags.grappled = false; predator.flags.grappleType = "belly"; return ["A powerful swallow drags you into Taluthus' stomach. You curl up in the bioluminescent prison as it begins to squeeze."]; @@ -641,7 +641,12 @@ function taluthusBellyStruggle(predator) { "lines": ["You squirm and writhe within " + predator.description("the") + " to no avail."] }; } - } + }, + requirements: [ + function(predator, player) { + return predator.flags.grappleType == "belly"; + } + ] }; } @@ -655,6 +660,23 @@ function taluthusTailStruggle(predator) { escape = escape && Math.random() < 0.25; } + let position = ""; + + switch(predator.flags.tailSwallows) { + case 1: + position = "You're one good swallow away from being dragged into Tal's stomach."; + break; + case 2: + position = "Your bulge is perilously deep in the kitsune's tail, hanging close to the ground."; + break; + case 3: + position = "You're halfway down the beast's tail, utterly smothered by heat and muscle."; + break; + case 4: + position = "You're close to freedom, your paws hanging from that wretched tailmaw."; + break; + } + if (escape) { predator.flags.tailSwallows += 1; @@ -666,14 +688,13 @@ function taluthusTailStruggle(predator) { } else { return { "escape": "stuck", - "lines": ["You struggle and squirm, inching closer to freedom."] + "lines": ["You struggle and squirm, inching closer to freedom.", newline, position] }; } - } else { return { "escape": "stuck", - "lines": ["You squirm and writhe within Tal's tail, to no avail."] + "lines": ["You squirm and writhe within Tal's tail, to no avail.", newline, position] }; } }, diff --git a/feast.js b/feast.js index cac2d9f..686d291 100644 --- a/feast.js +++ b/feast.js @@ -461,7 +461,7 @@ function struggleClicked(index) { let result = struggle.struggle(player); - update([result.lines]); + update(result.lines.concat([newline])); if (result.escape == "stay") { changeMode("combat");