From 528a3a924b555070aea6b3d3653db40e7ddf3ae1 Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Thu, 15 Mar 2018 13:16:07 -0400 Subject: [PATCH] Added more nasty stuff to Trance --- combat.js | 4 +-- customs.js | 103 +++++++++++++++++++++++++++++++++++++++++++++++++++-- feast.js | 2 +- vore.js | 4 +-- 4 files changed, 106 insertions(+), 7 deletions(-) diff --git a/combat.js b/combat.js index c8a3450..e4f685a 100644 --- a/combat.js +++ b/combat.js @@ -113,7 +113,7 @@ function grappleSubdue(attacker) { } ], priority: 1, - weight: function(attacker, defender) { return 1 - defender.health / defender.maxHealth; } + weight: function(attacker, defender) { return defender.health / defender.maxHealth; } }; } @@ -148,7 +148,7 @@ function grappleDevour(attacker) { function(attacker, defender) { return defender.prefs.prey; } ], priority: 1, - weight: function(attacker, defender) { return defender.health / defender.maxHealth; } + weight: function(attacker, defender) { return 1 - defender.health / defender.maxHealth; } }; } diff --git a/customs.js b/customs.js index 202fccb..a18f049 100644 --- a/customs.js +++ b/customs.js @@ -219,10 +219,12 @@ function Trance() { this.description = function() { return "Trance"; }; this.attacks.push(new punchAttack(this)); + this.attacks.push(new tranceKick(this)); this.attacks.push(new grapple(this)); this.attacks.push(new grappleDevour(this)); this.attacks.push(new grappleSubdue(this)); + this.attacks.push(new tranceGrappleMaul(this)); this.attacks.push(new grappledReverse(this)); this.attacks.push(new grappledDevour(this)); @@ -231,14 +233,111 @@ function Trance() { this.digests = []; - this.digests.push(new digestPlayerStomach(this,50)); + this.digests.push(new tranceDigest(this,50)); + this.digests.push(new tranceDigestCrush(this,75)); + this.digests.push(new tranceDigestInstakill(this,75)); + this.struggles = []; 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..."]; }; + this.finishDigest = function() { return ["The sergal's crushing guts reduce you to a pool of chyme..."]; }; this.defeated = function() { changeMode("explore"); update(["The sergal winces and stumbles, grabbing a thick branch to steady himself...and snapping in half like a twig. You decide discretion is the better part of valor and run while you can."]); }; this.prefs.prey = false; +} + +function tranceKick(attacker) { + return { + attackPlayer: function(defender) { + return [attacker.description("The") + " leaps at you, lashing out with sharp-clawed paws and goring you for " + attack(attacker, defender, attacker.str * 3) + " damage"]; + }, requirements: [ + function(attacker, defender) { return isNormal(attacker) && isNormal(defender); } + ], conditions: [ + function(attacker, defender) { return defender.prefs.gore; } + ], + priority: 1, + weight: function(attacker, defender) { return defender.health / defender.maxHealth; } + }; +} + +function grappleDevour(attacker) { + return { + attackPlayer: function(defender) { + let success = statHealthCheck(attacker, defender, "str"); + if(success) { + defender.flags.grappled = false; + changeMode("eaten"); + return [attacker.description("The") + " forces your head into their sloppy jaws, devouring you despite your frantic struggles. Glp."]; + } else { + return [attacker.description("The") + " tries to swallow you down, but you manage to resist their hunger."]; + } + }, requirements: [ + function(attacker, defender) { return isNormal(attacker) && isGrappled(defender) && defender.flags.shrunk != true; } + ], conditions: [ + function(attacker, defender) { return defender.prefs.prey; } + ], + priority: 1, + weight: function(attacker, defender) { return 1 - defender.health / defender.maxHealth; } + }; +} + +function tranceGrappleMaul(attacker) { + return { + attackPlayer: function(defender) { + return [attacker.description("The") + " digs into you with his claws and jaws, ripping you apart for " + attack(attacker, defender, attacker.str * 4) + " damage"]; + }, + requirements: [ + function(attacker, defender) { + return isNormal(attacker) && isGrappled(defender); + } + ], + priority: 1, + weight: function(attacker, defender) { return defender.health / defender.maxHealth; } + }; +} + +function tranceDigest(predator,damage=50) { + return { + digest: function(player) { + attack(predator, player, damage); + player.stamina = Math.max(0,player.stamina - 50); + return [predator.description("The") + "'s powerful stomach grinds over your body, swiftly digesting you."]; + }, + priority: 1, + weight: function() { return 1; } + }; +} +function tranceDigestCrush(predator, damage=75) { + return { + digest: function(player) { + attack(predator, player, damage); + player.stamina = Math.max(0,player.stamina - 100); + return ["Trance's belly clenches, crushing your body between walls of ruthless muscle. Bones snap and tendons strain. The chyme floods your mouth."]; + }, + conditions: [ + function(attacker, defender) { + return defender.prefs.gore; + } + ], + priority: 1, + weight: function() { return 0.5; } + }; +} + +function tranceDigestInstakill(predator) { + return { + digest: function(player) { + player.health = -100; + return ["A ripple of muscle catches your head in just the right way, crushing your skull like a grape. Your lifeless body slumps in the caustic pit of slime and acid...and you melt away."]; + }, + conditions: [ + function(attacker, defender) { + return defender.prefs.gore; + } + ], + priority: 1, + weight: function(attacker, defender) { return defender.stamina <= 0 ? 5 : 0.1; } + }; } diff --git a/feast.js b/feast.js index 311ae52..c3edac3 100644 --- a/feast.js +++ b/feast.js @@ -39,7 +39,7 @@ function pick(list, attacker, defender) { if (list.length == 0) return null; else { - let sum = list.reduce((sum, choice) => choice.weight == undefined ? sum + 1 : sum + choice.weight(attacker, defender) + sum, 0); + let sum = list.reduce((sum, choice) => choice.weight == undefined ? sum + 1 : sum + choice.weight(attacker, defender), 0); let target = Math.random() * sum; diff --git a/vore.js b/vore.js index e3ae7ef..8bb1edf 100644 --- a/vore.js +++ b/vore.js @@ -390,7 +390,7 @@ function struggle(predator) { 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) { + if (player.health <= 0 || player.stamina <= 0) { escape = escape && Math.random() < 0.25; } @@ -417,7 +417,7 @@ function struggleStay(predator) { 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) { + if (player.health <= 0 || player.stamina <= 0) { escape = escape && Math.random() < 0.25; }