diff --git a/combat.js b/combat.js index f4e34b8..c8a3450 100644 --- a/combat.js +++ b/combat.js @@ -97,6 +97,26 @@ function grapple(attacker) { }; } +function grappleSubdue(attacker) { + return { + name: "Subdue", + desc: "Try to subdue your opponent", + attack: function(defender) { + return ["You beat on " + defender.description("the") + " for " + attack(attacker, defender, attacker.str * 2) + " damage."]; + }, + attackPlayer: function(defender) { + return [attacker.description("The") + " beats you for " + attack(attacker, defender, attacker.str * 2) + " damage"]; + }, + requirements: [ + function(attacker, defender) { + return isNormal(attacker) && isGrappled(defender); + } + ], + priority: 1, + weight: function(attacker, defender) { return 1 - defender.health / defender.maxHealth; } + }; +} + function grappleDevour(attacker) { return { name: "Devour", @@ -128,6 +148,7 @@ function grappleDevour(attacker) { function(attacker, defender) { return defender.prefs.prey; } ], priority: 1, + weight: function(attacker, defender) { return defender.health / defender.maxHealth; } }; } diff --git a/customs.js b/customs.js index 2f77066..acdef6d 100644 --- a/customs.js +++ b/customs.js @@ -222,7 +222,9 @@ function Trance() { this.attacks.push(new grapple(this)); this.attacks.push(new grappleDevour(this)); + this.attacks.push(new grappleSubdue(this)); + this.attacks.push(new grappledReverse(this)); this.attacks.push(new grappledDevour(this)); this.backupAttack = new pass(this); @@ -232,7 +234,7 @@ function Trance() { this.digests.push(new digestPlayerStomach(this,50)); this.struggles = []; - this.struggles.push(new struggle(this)); + this.struggles.push(new struggleStay(this)); this.startCombat = function() { return ["You yelp and turn around as hot breath spills over your shoulder. A massive sergal has crept up on you...and he looks hungry"]; }; this.digestFinish = function() { return ["The sergal's crushing guts reduce you to a pool of chyme..."]; }; diff --git a/feast.js b/feast.js index 7986846..618516a 100644 --- a/feast.js +++ b/feast.js @@ -434,7 +434,9 @@ function struggleClicked(index) { update([result.lines]); - if (result.escape) { + if (result.escape == "stay") { + changeMode("combat"); + } else if (result.escape == "escape") { changeMode("explore"); } else { let digest = pick(filterValid(currentFoe.digests, currentFoe, player), currentFoe, player); diff --git a/vore.js b/vore.js index 060f513..e42cbcb 100644 --- a/vore.js +++ b/vore.js @@ -65,6 +65,7 @@ function Player(name = "Player") { this.attacks.push(new flankAttack(this)); this.attacks.push(new grapple(this)); + this.attacks.push(new grappleSubdue(this)); this.attacks.push(new grappleDevour(this)); this.attacks.push(new grappleAnalVore(this)); this.attacks.push(new grappleRelease(this)); @@ -366,12 +367,12 @@ function plead(predator) { if (escape) { return { - "escape": escape, + "escape": "escape", "lines": ["You plead for " + predator.description("the") + " to let you free, and they begrudingly agree, horking you up and leaving you shivering on the ground"] }; } else { return { - "escape": escape, + "escape": "stuck", "lines": ["You plead with " + predator.description("the") + " to let you go, but they refuse."] }; } @@ -391,12 +392,12 @@ function struggle(predator) { if (escape) { return { - "escape": escape, + "escape": "escape", "lines": ["You struggle and squirm, forcing " + predator.description("the") + " to hork you up. They groan and stumble away, exhausted by your efforts."] }; } else { return { - "escape": escape, + "escape": "stuck", "lines": ["You squirm and writhe within " + predator.description("the") + " to no avail."] }; } @@ -404,13 +405,39 @@ function struggle(predator) { }; } +function struggleStay(predator) { + return { + name: "Struggle", + desc: "Try to squirm free. More effective if you've hurt your predator.", + struggle: function(player) { + let escape = Math.random() > predator.health / predator.maxHealth && Math.random() < 0.33; + if (player.health <= 0) { + escape = escape && Math.random() < 0.25; + } + + if (escape) { + return { + "escape": "stay", + "lines": ["You struggle and squirm, forcing " + predator.description("the") + " to hork you up. They're not done with you yet..."] + }; + } else { + return { + "escape": "stuck", + "lines": ["You squirm and writhe within " + predator.description("the") + " to no avail."] + }; + } + } + }; +} + + function rub(predator) { return { name: "Rub", desc: "Rub rub rub", struggle: function(player) { return { - "escape": false, + "escape": "stuck", "lines": ["You rub the walls of your predator's belly. At least " + predator.description("the") + " is getting something out of this."] }; }