From 0b9169035dc2d872ad52dc9ac92d41e9f96c19d4 Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Mon, 12 Mar 2018 11:18:07 -0400 Subject: [PATCH] Added a way to struggle out of a grapple --- combat.js | 28 ++++++++++++++++++++++++++++ feast.html | 2 +- vore.js | 8 ++++++-- 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/combat.js b/combat.js index 9170844..f54ee02 100644 --- a/combat.js +++ b/combat.js @@ -115,6 +115,34 @@ function grappleRelease(attacker) { }; } +function grappledStruggle(attacker) { + return { + name: "Struggle", + desc: "Try to break your opponent's pin", + attack: function(defender) { + let success = Math.random() < 0.5 + (1 - defender.health / defender.maxHealth)*0.5; + if (success) { + attacker.grappled = false; + return "You struggle and shove the " + defender.description() + " off of you."; + } else { + return "You struggle, but to no avail."; + } + }, + attackPlayer: function(defender) { + let success = Math.random() < 0.5 + (1 - defender.health / defender.maxHealth)*0.5 && Math.random() < 0.5; + if (success) { + attacker.grappled = false; + return "Your prey shoves you back, breaking your grapple!"; + } else { + return "Your prey squirms, but remains pinned."; + } + }, + requirements: [ + function(attacker, defender) { return isGrappled(attacker) && isNormal(defender); } + ] + }; +} + function pass(attacker) { return { name: "Pass", diff --git a/feast.html b/feast.html index 76a8232..d02a224 100644 --- a/feast.html +++ b/feast.html @@ -24,7 +24,7 @@
- Welcome to Feast v0.0.3 + Welcome to Feast v0.0.4
Time: to get a watch
diff --git a/vore.js b/vore.js index 61bf4ca..9c437b8 100644 --- a/vore.js +++ b/vore.js @@ -29,11 +29,13 @@ function Player(name = "Player") { this.attacks.push(new punchAttack(this)); this.attacks.push(new flankAttack(this)); - this.attacks.push(new grapple(this)); + this.attacks.push(new grapple(this)); this.attacks.push(new grappleDevour(this)); this.attacks.push(new grappleRelease(this)); + this.attacks.push(new grappledStruggle(this)); + this.backupAttack = new pass(this); this.str = 15; this.dex = 15; @@ -58,10 +60,12 @@ function Anthro() { this.attacks.push(new punchAttack(this)); this.attacks.push(new flankAttack(this)); - this.attacks.push(new grapple(this)); + this.attacks.push(new grapple(this)); this.attacks.push(new grappleDevour(this)); + this.attacks.push(new grappledStruggle(this)); + this.backupAttack = new pass(this); this.struggles = [];