munch
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 

643 líneas
16 KiB

  1. "use strict";
  2. function StatBuff(type, amount) {
  3. this.stat = type;
  4. this.amount = amount;
  5. }
  6. function Creature(name = "Creature", str = 10, dex = 10, con = 10) {
  7. this.name = name;
  8. this.mass = 80;
  9. this.attacks = [];
  10. this.baseStr = str;
  11. this.baseDex = dex;
  12. this.baseCon = con;
  13. this.statBuffs = [];
  14. this.statMultiplier = function(stat) {
  15. let multiplier = 1;
  16. return this.statBuffs.reduce((multiplier, effect) => (effect.stat == stat) ? multiplier * effect.amount : multiplier, multiplier);
  17. };
  18. Object.defineProperty(this, "str", {
  19. get: function() {
  20. return this.baseStr * this.statMultiplier("str");
  21. },
  22. set: function(val) {
  23. this.baseStr = val;
  24. }
  25. });
  26. Object.defineProperty(this, "dex", {
  27. get: function() {
  28. return this.baseDex * this.statMultiplier("dex");
  29. },
  30. set: function(val) {
  31. this.baseDex = val;
  32. }
  33. });
  34. Object.defineProperty(this, "con", {
  35. get: function() {
  36. return this.baseCon * this.statMultiplier("con");
  37. },
  38. set: function(val) {
  39. this.baseCon = val;
  40. }
  41. });
  42. this.hasName = false;
  43. Object.defineProperty(this, "maxHealth", {
  44. get: function() {
  45. return this.str * 5 + this.con * 10;
  46. }
  47. });
  48. this.health = this.maxHealth;
  49. Object.defineProperty(this, "maxStamina", {
  50. get: function() {
  51. return this.dex * 5 + this.con * 10;
  52. }
  53. });
  54. this.stamina = this.maxStamina;
  55. // fraction of max health per second
  56. this.healthRate = 1 / 86400 * 4;
  57. this.staminaRate = 1 / 86400 * 6;
  58. this.restoreHealth = function(time) {
  59. this.health = Math.min(this.maxHealth, this.health + this.maxHealth * time * this.healthRate);
  60. };
  61. this.restoreStamina = function(time) {
  62. this.stamina = Math.min(this.maxStamina, this.stamina + this.maxStamina * time * this.staminaRate);
  63. };
  64. this.flags = {};
  65. this.clear = function() {
  66. this.flags = {};
  67. };
  68. this.prefs = {
  69. prey: true,
  70. scat: true,
  71. grapple: true,
  72. vore: {
  73. oral: 1,
  74. anal: 1,
  75. cock: 1,
  76. unbirth: 1,
  77. breast: 1,
  78. hard: 1,
  79. soul: 1
  80. }
  81. };
  82. this.cash = Math.floor(Math.random() * 10 + 5);
  83. this.text = {};
  84. this.startCombat = function() {
  85. return [this.description("A") + " appears. It's a fight!"];
  86. };
  87. this.finishCombat = function() {
  88. return [this.description("The") + " scoops up your limp body and gulps you down."];
  89. };
  90. this.finishDigest = function() {
  91. return [this.description("The") + " digests you..."];
  92. };
  93. this.defeated = function() {
  94. startDialog(new FallenFoe(this));
  95. };
  96. this.changeStamina = function(amount) {
  97. this.stamina += amount;
  98. this.stamina = Math.min(this.maxStamina, this.stamina);
  99. this.stamina = Math.max(0, this.stamina);
  100. };
  101. this.tickEffects = function() {
  102. this.statBuffs.forEach(function(x) {
  103. x.tick();
  104. });
  105. this.statBuffs.filter(function(x) {
  106. return x.alive;
  107. });
  108. };
  109. }
  110. function Player(name = "Player") {
  111. Creature.call(this, name, 15, 15, 15);
  112. this.attacks.push(punchAttack(this));
  113. this.attacks.push(flankAttack(this));
  114. this.attacks.push(grapple(this));
  115. this.attacks.push(grappleSubdue(this));
  116. this.attacks.push(grappleDevour(this));
  117. this.attacks.push(grappleAnalVore(this));
  118. this.attacks.push(grappleCockVore(this));
  119. this.attacks.push(grappleUnbirth(this));
  120. this.attacks.push(grappleBreastVore(this));
  121. this.attacks.push(grappleRelease(this));
  122. this.attacks.push(grappledStruggle(this));
  123. this.attacks.push(grappledReverse(this));
  124. this.attacks.push(shrunkGrapple(this));
  125. this.attacks.push(shrunkSwallow(this));
  126. this.attacks.push(shrunkStomp(this));
  127. this.attacks.push(pass(this));
  128. this.attacks.push(flee(this));
  129. this.backupAttack = pass(this);
  130. this.cash = 100;
  131. this.stomach = new Stomach(this);
  132. this.bowels = new Bowels(this, this.stomach);
  133. this.stomach.bowels = this.bowels;
  134. this.balls = new Balls(this);
  135. this.womb = new Womb(this);
  136. this.breasts = new Breasts(this);
  137. this.parts = {};
  138. this.arousal = 0;
  139. this.arousalRate = 100 / 86400 * 4;
  140. this.arousalLimit = function() {
  141. return 100 * Math.sqrt(this.con / 15);
  142. };
  143. this.buildArousal = function(time) {
  144. this.arousal += this.arousalRate * time;
  145. this.arousal += this.arousalRate * this.bowels.fullnessPercent();
  146. this.arousal += this.arousalRate * this.balls.fullnessPercent();
  147. this.arousal += this.arousalRate * this.womb.fullnessPercent();
  148. this.arousal += this.arousalRate * this.breasts.fullnessPercent();
  149. };
  150. }
  151. function Anthro(name = "Anthro") {
  152. this.build = pickRandom(["skinny", "fat", "muscular", "sickly", "ordinary"]);
  153. switch (this.build) {
  154. case "skinny":
  155. Creature.call(this, name, 8, 12, 8);
  156. this.mass *= (Math.random() * 0.2 + 0.7);
  157. break;
  158. case "fat":
  159. Creature.call(this, name, 10, 7, 15);
  160. this.mass *= (Math.random() * 0.4 + 1.1);
  161. break;
  162. case "muscular":
  163. Creature.call(this, name, 13, 11, 13);
  164. this.mass *= (Math.random() * 0.1 + 1.1);
  165. break;
  166. case "sickly":
  167. Creature.call(this, name, 6, 8, 6);
  168. this.mass *= (Math.random() * 0.2 + 0.6);
  169. break;
  170. case "ordinary":
  171. Creature.call(this, name, 10, 10, 10);
  172. break;
  173. }
  174. this.species = pickRandom(["dog", "cat", "lizard", "deer", "wolf", "fox"]);
  175. // todo better lol
  176. this.description = function(prefix = "") {
  177. if (this.build == "")
  178. if (prefix == "")
  179. return this.species;
  180. else
  181. return prefix + " " + this.species;
  182. else
  183. if (prefix == "")
  184. return this.build + " " + this.species;
  185. else
  186. return prefix + " " + this.build + " " + this.species;
  187. };
  188. this.attacks.push(new punchAttack(this));
  189. this.attacks.push(new flankAttack(this));
  190. this.attacks.push(new grapple(this));
  191. this.attacks.push(new grappleDevour(this));
  192. this.attacks.push(new grappledStruggle(this));
  193. this.attacks.push(new grappledReverse(this));
  194. this.backupAttack = new pass(this);
  195. this.struggles = [];
  196. this.struggles.push(new plead(this));
  197. this.struggles.push(new struggle(this));
  198. this.struggles.push(new submit(this));
  199. this.digests = [];
  200. this.digests.push(new digestPlayerStomach(this, 20));
  201. this.backupDigest = new digestPlayerStomach(this, 20);
  202. }
  203. function Fen() {
  204. Creature.call(this, name, 1000000, 1099900, 1000000);
  205. this.build = "loomy";
  206. this.species = "crux";
  207. this.description = function(prefix) {
  208. return "Fen";
  209. };
  210. this.attacks = [];
  211. this.attacks.push(new devourPlayer(this));
  212. this.attacks.push(new devourPlayerAnal(this));
  213. this.attacks.push(new leer(this));
  214. this.backupAttack = new poke(this);
  215. this.struggles = [];
  216. this.struggles.push(new rub(this));
  217. this.digests = [];
  218. this.digests.push(new instakillPlayerStomach(this));
  219. this.digests.push(new instakillPlayerBowels(this));
  220. this.backupDigest = new digestPlayerStomach(this, 50);
  221. }
  222. function Micro() {
  223. Creature.call(this, name);
  224. this.health = 5;
  225. this.mass = 0.1 * (Math.random() / 2 - 0.25 + 1);
  226. this.species = pick(["dog", "cat", "lizard", "deer", "wolf", "fox"]);
  227. this.description = function(prefix = "") {
  228. if (prefix == "")
  229. return "micro " + this.species;
  230. else
  231. return prefix + " micro " + this.species;
  232. };
  233. }
  234. // vore stuff here
  235. function Container(owner) {
  236. this.owner = owner;
  237. this.contents = [];
  238. this.waste = 0;
  239. this.digested = [];
  240. // health/sec
  241. this.damageRate = 15 * 100 / 86400;
  242. // health percent/sec
  243. this.damageRatePercent = 1 / 86400;
  244. this.capacity = 100;
  245. // kg/sec
  246. this.digestRate = 80 / 8640;
  247. this.digest = function(time) {
  248. let lines = [];
  249. this.contents.forEach(function(prey) {
  250. if (prey.health > 0) {
  251. let damage = Math.min(prey.health, this.damageRate * time + this.damageRatePercent * prey.maxHealth * time);
  252. prey.health -= damage;
  253. time -= damage / (this.damageRate + this.damageRatePercent * prey.maxHealth);
  254. if (prey.health + damage > 50 && prey.health <= 50) {
  255. lines.push(this.describeDamage(prey));
  256. }
  257. if (prey.health <= 0) {
  258. lines.push(this.describeKill(prey));
  259. }
  260. }
  261. if (prey.health <= 0) {
  262. let digested = Math.min(prey.mass, this.digestRate * time);
  263. prey.mass -= digested;
  264. this.owner.changeStamina(digested * 10);
  265. this.fill(digested);
  266. }
  267. if (prey.mass <= 0) {
  268. lines.push(this.describeFinish(prey));
  269. this.finish(prey);
  270. }
  271. this.contents = this.contents.filter(function(prey) {
  272. return prey.mass > 0;
  273. });
  274. }, this);
  275. return lines;
  276. };
  277. this.feed = function(prey) {
  278. this.contents.push(prey);
  279. };
  280. this.fullness = function() {
  281. return this.contents.reduce((total, prey) => total + prey.mass, 0) + this.waste;
  282. };
  283. this.fullnessPercent = function() {
  284. return this.fullness() / this.capacity;
  285. }
  286. this.add = function(amount) {
  287. this.waste += amount;
  288. };
  289. this.finish = function(prey) {
  290. if (prey.prefs.scat)
  291. this.digested.push(prey);
  292. };
  293. }
  294. function Stomach(owner) {
  295. Container.call(this, owner);
  296. this.describeDamage = function(prey) {
  297. return "Your guts gurgle and churn, slowly wearing down " + prey.description("the") + " trapped within.";
  298. };
  299. this.describeKill = function(prey) {
  300. return prey.description("The") + "'s struggles wane as your stomach overpowers them.";
  301. };
  302. this.describeFinish = function(prey) {
  303. return "Your churning guts have reduced " + prey.description("a") + " to meaty chyme.";
  304. };
  305. this.fill = function(amount) {
  306. this.bowels.add(amount);
  307. };
  308. this.finish = function(prey) {
  309. this.bowels.finish(prey);
  310. };
  311. }
  312. function Bowels(owner, stomach) {
  313. Container.call(this, owner);
  314. this.stomach = stomach;
  315. this.parentDigest = this.digest;
  316. this.digest = function(time) {
  317. this.contents.forEach(function(x) {
  318. x.timeInBowels += time;
  319. });
  320. let lines = this.parentDigest(time);
  321. let pushed = this.contents.filter(prey => prey.timeInBowels >= 60 * 30);
  322. pushed.forEach(function(x) {
  323. this.stomach.feed(x);
  324. lines.push("Your winding guts squeeze " + x.description("the") + " into your stomach.");
  325. }, this);
  326. this.contents = this.contents.filter(prey => prey.timeInBowels < 60 * 30);
  327. return lines;
  328. };
  329. this.describeDamage = function(prey) {
  330. return "Your bowels gurgle and squeeze, working to wear down " + prey.description("the") + " trapped in those musky confines.";
  331. };
  332. this.describeKill = function(prey) {
  333. return prey.description("The") + " abruptly stops struggling, overpowered by your winding intestines.";
  334. };
  335. this.describeFinish = function(prey) {
  336. return "That delicious " + prey.description() + " didn't even make it to your stomach...now they're gone.";
  337. };
  338. this.parentFeed = this.feed;
  339. this.feed = function(prey) {
  340. prey.timeInBowels = 0;
  341. this.parentFeed(prey);
  342. };
  343. this.fill = function(amount) {
  344. this.add(amount);
  345. };
  346. this.finish = function(prey) {
  347. this.digested.push(prey);
  348. };
  349. }
  350. function Balls(owner) {
  351. Container.call(this, owner);
  352. this.describeDamage = function(prey) {
  353. return "Your balls slosh as they wear down the " + prey.description("the") + " trapped within.";
  354. };
  355. this.describeKill = function(prey) {
  356. return prey.description("The") + "'s struggles cease, overpowered by your cum-filled balls.";
  357. };
  358. this.describeFinish = function(prey) {
  359. return "Your churning balls have melted " + prey.description("a") + " down to musky cum.";
  360. };
  361. this.fill = function(amount) {
  362. this.add(amount);
  363. };
  364. this.finish = function(prey) {
  365. this.digested.push(prey);
  366. };
  367. }
  368. function Womb(owner) {
  369. Container.call(this, owner);
  370. this.describeDamage = function(prey) {
  371. return "You shiver as " + prey.description("the") + " squrims within your womb.";
  372. };
  373. this.describeKill = function(prey) {
  374. return "Your womb clenches and squeezes, overwhelming " + prey.description("the") + " trapped within.";
  375. };
  376. this.describeFinish = function(prey) {
  377. return "Your womb dissolves " + prey.description("a") + " into femcum.";
  378. };
  379. this.fill = function(amount) {
  380. this.add(amount);
  381. };
  382. this.finish = function(prey) {
  383. this.digested.push(prey);
  384. };
  385. }
  386. function Breasts(owner) {
  387. Container.call(this, owner);
  388. this.describeDamage = function(prey) {
  389. return "Your breasts slosh from side to side, steadily softening " + prey.description("the") + " trapped within.";
  390. };
  391. this.describeKill = function(prey) {
  392. return prey.description("The") + " gives one last mighty shove...and then slumps back in your breasts.";
  393. };
  394. this.describeFinish = function(prey) {
  395. return "Your breasts have broken " + prey.description("a") + " down to creamy milk.";
  396. };
  397. this.fill = function(amount) {
  398. this.add(amount);
  399. };
  400. this.finish = function(prey) {
  401. this.digested.push(prey);
  402. };
  403. }
  404. // PLAYER PREY
  405. function plead(predator) {
  406. return {
  407. name: "Plead",
  408. desc: "Ask very, very nicely for the predator to let you go. More effective if you haven't hurt your predator.",
  409. struggle: function(player) {
  410. let escape = Math.random() < predator.health / predator.maxHealth && Math.random() < 0.33;
  411. if (player.health <= 0) {
  412. escape = escape && Math.random() < 0.25;
  413. }
  414. if (escape) {
  415. player.clear();
  416. predator.clear();
  417. return {
  418. "escape": "escape",
  419. "lines": ["You plead for " + predator.description("the") + " to let you free, and they begrudingly agree, horking you up and leaving you shivering on the ground"]
  420. };
  421. } else {
  422. return {
  423. "escape": "stuck",
  424. "lines": ["You plead with " + predator.description("the") + " to let you go, but they refuse."]
  425. };
  426. }
  427. }
  428. };
  429. }
  430. function struggle(predator) {
  431. return {
  432. name: "Struggle",
  433. desc: "Try to squirm free. More effective if you've hurt your predator.",
  434. struggle: function(player) {
  435. let escape = Math.random() > predator.health / predator.maxHealth && Math.random() < 0.33;
  436. if (player.health <= 0 || player.stamina <= 0) {
  437. escape = escape && Math.random() < 0.25;
  438. }
  439. if (escape) {
  440. player.clear();
  441. predator.clear();
  442. return {
  443. "escape": "escape",
  444. "lines": ["You struggle and squirm, forcing " + predator.description("the") + " to hork you up. They groan and stumble away, exhausted by your efforts."]
  445. };
  446. } else {
  447. return {
  448. "escape": "stuck",
  449. "lines": ["You squirm and writhe within " + predator.description("the") + " to no avail."]
  450. };
  451. }
  452. }
  453. };
  454. }
  455. function struggleStay(predator) {
  456. return {
  457. name: "Struggle",
  458. desc: "Try to squirm free. More effective if you've hurt your predator.",
  459. struggle: function(player) {
  460. let escape = Math.random() > predator.health / predator.maxHealth && Math.random() < 0.33;
  461. if (player.health <= 0 || player.stamina <= 0) {
  462. escape = escape && Math.random() < 0.25;
  463. }
  464. if (escape) {
  465. player.clear();
  466. predator.clear();
  467. return {
  468. "escape": "stay",
  469. "lines": ["You struggle and squirm, forcing " + predator.description("the") + " to hork you up. They're not done with you yet..."]
  470. };
  471. } else {
  472. return {
  473. "escape": "stuck",
  474. "lines": ["You squirm and writhe within " + predator.description("the") + " to no avail."]
  475. };
  476. }
  477. }
  478. };
  479. }
  480. function rub(predator) {
  481. return {
  482. name: "Rub",
  483. desc: "Rub rub rub",
  484. struggle: function(player) {
  485. return {
  486. "escape": "stuck",
  487. "lines": ["You rub the crushing walls. At least " + predator.description("the") + " is getting something out of this."]
  488. };
  489. }
  490. };
  491. }
  492. function submit(predator) {
  493. return {
  494. name: "Submit",
  495. desc: "Do nothing",
  496. struggle: function(player) {
  497. return {
  498. "escape": "stuck",
  499. "lines": ["You do nothing."]
  500. };
  501. }
  502. };
  503. }