| @@ -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) { | function pass(attacker) { | ||||
| return { | return { | ||||
| name: "Pass", | name: "Pass", | ||||
| @@ -24,7 +24,7 @@ | |||||
| <div id="game"> | <div id="game"> | ||||
| <div id="game-and-stats"> | <div id="game-and-stats"> | ||||
| <div id="log"> | <div id="log"> | ||||
| Welcome to Feast v0.0.3 | |||||
| Welcome to Feast v0.0.4 | |||||
| </div> | </div> | ||||
| <div id="stats"> | <div id="stats"> | ||||
| <div class="stat-line" id="time">Time: to get a watch</div> | <div class="stat-line" id="time">Time: to get a watch</div> | ||||
| @@ -29,11 +29,13 @@ function Player(name = "Player") { | |||||
| this.attacks.push(new punchAttack(this)); | this.attacks.push(new punchAttack(this)); | ||||
| this.attacks.push(new flankAttack(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 grappleDevour(this)); | ||||
| this.attacks.push(new grappleRelease(this)); | this.attacks.push(new grappleRelease(this)); | ||||
| this.attacks.push(new grappledStruggle(this)); | |||||
| this.backupAttack = new pass(this); | this.backupAttack = new pass(this); | ||||
| this.str = 15; | this.str = 15; | ||||
| this.dex = 15; | this.dex = 15; | ||||
| @@ -58,10 +60,12 @@ function Anthro() { | |||||
| this.attacks.push(new punchAttack(this)); | this.attacks.push(new punchAttack(this)); | ||||
| this.attacks.push(new flankAttack(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 grappleDevour(this)); | ||||
| this.attacks.push(new grappledStruggle(this)); | |||||
| this.backupAttack = new pass(this); | this.backupAttack = new pass(this); | ||||
| this.struggles = []; | this.struggles = []; | ||||