From df2a72e224d3aa2c80e6934775121dd4ae130c6c Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Wed, 14 Mar 2018 16:13:10 -0400 Subject: [PATCH] Fixed issues where anthros showed up in human mode --- game.js | 29 ++++++++++++++++------------- recursive-desc.js | 14 +++++++------- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/game.js b/game.js index 9f00808..1aebbec 100644 --- a/game.js +++ b/game.js @@ -1470,19 +1470,15 @@ function summarize(sum, fatal = true) function getOnePrey(biome, area, sameSize = true) { - let potential = ["Person"]; + let weights = getWeights(biome, area); - if (area >= areas["Planet"]) - potential = ["Planet","Star","Solar System","Galaxy","Cluster","Universe","Multiverse"]; - else if (area >= areas["Town"]) - potential = ["Town","City","Continent","Planet"]; - else - switch(biome) { - case "suburb": potential = ["Person", "Car", "Bus", "Train", "House"]; break; - case "city": potential = ["Person", "Car", "Bus", "Train", "Tram", "House", "Parking Garage"]; break; - case "downtown": potential = ["Person", "Car", "Bus", "Tram", "Small Skyscraper", "Large Skyscraper", "Parking Garage"]; break; - case "rural": potential = ["Person", "Barn", "House", "Cow"]; break; + let potential = []; + + for (let key in weights) { + if (weights.hasOwnProperty(key)) { + potential.push(key); } + } let potAreas = []; @@ -1507,8 +1503,7 @@ function getOnePrey(biome, area, sameSize = true) return new Container(); } -function getPrey(region, area, sameSize = false) -{ +function getWeights(region, area) { let weights = {}; if (area > areas["Planet"]) { @@ -1565,6 +1560,14 @@ function getPrey(region, area, sameSize = false) weights["Macro"] = 0.0001; } } + + return weights; +} + +function getPrey(region, area, sameSize = false) +{ + let weights = getWeights(region, area); + var prey = fill_area(area,weights); if (prey.count == 0 && sameSize) diff --git a/recursive-desc.js b/recursive-desc.js index d300d2d..8fbe8f8 100644 --- a/recursive-desc.js +++ b/recursive-desc.js @@ -3,7 +3,7 @@ /*jshint browser: true*/ var rules = {}; -var defaults= {}; +var defaults = {}; function getDefault(name) { let tokens = name.split("-"); @@ -284,14 +284,14 @@ function defaultBreastMilk(container, macro, verbose) { function defaultUnbirth(container, macro, verbose) { if (container.count == 0) - return "You grab " + new Person(1).describe(verbose) + " and grind them against your slit...but they won't fit."; + return "You grab " + (macro.victimsHuman ? new Human(1).describe(verbose) : new Person(1).describe(verbose)) + " and grind them against your slit...but they won't fit."; else return "You gasp as you slide " + container.describe(verbose) + " up your slit. "; } function defaultSheathStuff(container, macro, verbose) { if (container.count == 0) - return "You grab a " + new Person(1).describe(verbose) + " and grind them against your sheath-slit...but they won't fit."; + return "You grab a " + (macro.victimsHuman ? new Human(1).describe(verbose) : new Person(1).describe(verbose)) + " and grind them against your sheath-slit...but they won't fit."; else return "You pluck " + container.describe(verbose) + " from the ground and slip them into your musky sheath."; } @@ -344,7 +344,7 @@ function defaultSheathAbsorb(container, macro, verbose) { function defaultCockVore(container, macro, verbose) { if (container.count == 0) - return "You grab " + new Person(1).describe(verbose) + " and grind them against your cock...but they won't fit."; + return "You grab " + (macro.victimsHuman ? new Human(1).describe(verbose) : new Person(1).describe(verbose)) + " and grind them against your cock...but they won't fit."; else return "You stuff " + container.describe(verbose) + " into your throbbing shaft, forcing them down to your heavy balls."; } @@ -420,7 +420,7 @@ function defaultGrind(container, macro, verbose) { function defaultPouchStuff(container, macro, verbose) { if (container.count == 0) - return "You grab " + new Person(1).describe(verbose) + " and stuff them against your pouch...but they won't fit!"; + return "You grab " + (macro.victimsHuman ? new Human(1).describe(verbose) : new Person(1).describe(verbose)) + " and stuff them against your pouch...but they won't fit!"; else return "You grab " + container.describe(verbose) + " and stuff " + (container.count > 1 ? "them" : "it") + " into your pouch."; } @@ -782,8 +782,8 @@ rules["chew"].push({ hasExactly(container, "Person", 2) && isGory(macro); }, "desc": function(container, macro, verbose) { - var prey1 = new Person(1).describe(verbose); - var prey2 = new Person(1).describe(verbose); + var prey1 = macro.victimsHuman ? new Human(1).describe(verbose) : new Person(1).describe(verbose); + var prey2 = macro.victimsHuman ? new Human(1).describe(verbose) : new Person(1).describe(verbose); return "Powerful " + macro.jawDesc(true) + " obliterate " + prey1 +"'s body. You toss your head back and swallow their gory remains, your free hand slowly crushing " + prey2 + " like a nut \ in a vice. A heartbeat later, their face is jammed into your bloody throat. A squeeze of your " + macro.jawDesc(true) + " snaps their spine with ease, and their limp body plunges down into \ your churning depths to be destroyed.";