Преглед изворни кода

Added a reversal move when grappled

tags/v0.2.8
Fen Dweller пре 7 година
родитељ
комит
5abbce1131
2 измењених фајлова са 33 додато и 0 уклоњено
  1. +31
    -0
      combat.js
  2. +2
    -0
      vore.js

+ 31
- 0
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",


+ 2
- 0
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);



Loading…
Откажи
Сачувај