From 5abbce1131133490e463b449ef8f4aef891fcdac Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Tue, 13 Mar 2018 09:30:48 -0400 Subject: [PATCH] Added a reversal move when grappled --- combat.js | 31 +++++++++++++++++++++++++++++++ vore.js | 2 ++ 2 files changed, 33 insertions(+) diff --git a/combat.js b/combat.js index 7f607a6..b0b3e81 100644 --- a/combat.js +++ b/combat.js @@ -174,6 +174,37 @@ function grappledStruggle(attacker) { }; } +function grappledReverse(attacker) { + return { + name: "Reversal", + desc: "Try to pin your grappler. Less likely to work than struggling.", + attack: function(defender) { + let success = Math.random() < 0.25 + (1 - defender.health / defender.maxHealth) * 0.5; + if (success) { + attacker.grappled = false; + defender.grappled = true; + return "You surprise the " + defender.description() + " with a burst of strength, flipping them over and pinning them."; + } else { + return "You try to throw your opponent off of you, but fail."; + } + }, + 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; + defender.grappled = true; + return "Your prey suddenly grabs hold and flips you over, pinning you!"; + } else { + return "Your prey tries to grab at you, but you keep them under control."; + } + }, + requirements: [ + function(attacker, defender) { return isGrappled(attacker) && isNormal(defender); } + ], + priority: 1, + }; +} + function pass(attacker) { return { name: "Pass", diff --git a/vore.js b/vore.js index 6719c5a..7477678 100644 --- a/vore.js +++ b/vore.js @@ -54,6 +54,7 @@ function Player(name = "Player") { this.attacks.push(new grappleRelease(this)); this.attacks.push(new grappledStruggle(this)); + this.attacks.push(new grappledReverse(this)); this.backupAttack = new pass(this); } @@ -81,6 +82,7 @@ function Anthro() { this.attacks.push(new grappleDevour(this)); this.attacks.push(new grappledStruggle(this)); + this.attacks.push(new grappledReverse(this)); this.backupAttack = new pass(this);