munch
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 

723 řádky
18 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 * 2;
  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. if (this.arousal > this.arousalLimit()) {
  150. update(this.orgasm());
  151. }
  152. };
  153. this.orgasm = function() {
  154. this.arousal = 0;
  155. let result = [];
  156. result.push("You're cumming!", newline);
  157. if (this.balls.waste > 0) {
  158. result.push(this.balls.describeOrgasm(), newline);
  159. }
  160. if (this.bowels.waste > 0) {
  161. result.push(this.bowels.describeOrgasm(), newline);
  162. }
  163. if (this.womb.waste > 0) {
  164. result.push(this.womb.describeOrgasm(), newline);
  165. }
  166. if (this.breasts.waste > 0) {
  167. result.push(this.breasts.describeOrgasm(), newline);
  168. }
  169. return result;
  170. };
  171. }
  172. function Anthro(name = "Anthro") {
  173. this.build = pickRandom(["skinny", "fat", "muscular", "sickly", "ordinary"]);
  174. switch (this.build) {
  175. case "skinny":
  176. Creature.call(this, name, 8, 12, 8);
  177. this.mass *= (Math.random() * 0.2 + 0.7);
  178. break;
  179. case "fat":
  180. Creature.call(this, name, 10, 7, 15);
  181. this.mass *= (Math.random() * 0.4 + 1.1);
  182. break;
  183. case "muscular":
  184. Creature.call(this, name, 13, 11, 13);
  185. this.mass *= (Math.random() * 0.1 + 1.1);
  186. break;
  187. case "sickly":
  188. Creature.call(this, name, 6, 8, 6);
  189. this.mass *= (Math.random() * 0.2 + 0.6);
  190. break;
  191. case "ordinary":
  192. Creature.call(this, name, 10, 10, 10);
  193. break;
  194. }
  195. this.species = pickRandom(["dog", "cat", "lizard", "deer", "wolf", "fox"]);
  196. // todo better lol
  197. this.description = function(prefix = "") {
  198. if (this.build == "")
  199. if (prefix == "")
  200. return this.species;
  201. else
  202. return prefix + " " + this.species;
  203. else
  204. if (prefix == "")
  205. return this.build + " " + this.species;
  206. else
  207. return prefix + " " + this.build + " " + this.species;
  208. };
  209. this.attacks.push(new punchAttack(this));
  210. this.attacks.push(new flankAttack(this));
  211. this.attacks.push(new grapple(this));
  212. this.attacks.push(new grappleDevour(this));
  213. this.attacks.push(new grappledStruggle(this));
  214. this.attacks.push(new grappledReverse(this));
  215. this.backupAttack = new pass(this);
  216. this.struggles = [];
  217. this.struggles.push(new plead(this));
  218. this.struggles.push(new struggle(this));
  219. this.struggles.push(new submit(this));
  220. this.digests = [];
  221. this.digests.push(new digestPlayerStomach(this, 20));
  222. this.backupDigest = new digestPlayerStomach(this, 20);
  223. }
  224. function Fen() {
  225. Creature.call(this, name, 1000000, 1099900, 1000000);
  226. this.build = "loomy";
  227. this.species = "crux";
  228. this.description = function(prefix) {
  229. return "Fen";
  230. };
  231. this.attacks = [];
  232. this.attacks.push(new devourPlayer(this));
  233. this.attacks.push(new devourPlayerAnal(this));
  234. this.attacks.push(new leer(this));
  235. this.backupAttack = new poke(this);
  236. this.struggles = [];
  237. this.struggles.push(new rub(this));
  238. this.digests = [];
  239. this.digests.push(new instakillPlayerStomach(this));
  240. this.digests.push(new instakillPlayerBowels(this));
  241. this.backupDigest = new digestPlayerStomach(this, 50);
  242. }
  243. function Micro() {
  244. Creature.call(this, name);
  245. this.health = 5;
  246. this.mass = 0.1 * (Math.random() / 2 - 0.25 + 1);
  247. this.species = pick(["dog", "cat", "lizard", "deer", "wolf", "fox"]);
  248. this.description = function(prefix = "") {
  249. if (prefix == "")
  250. return "micro " + this.species;
  251. else
  252. return prefix + " micro " + this.species;
  253. };
  254. }
  255. // vore stuff here
  256. function Container(owner) {
  257. this.owner = owner;
  258. this.contents = [];
  259. this.waste = 0;
  260. this.digested = [];
  261. // health/sec
  262. this.damageRate = 15 * 100 / 86400;
  263. // health percent/sec
  264. this.damageRatePercent = 1 / 86400;
  265. this.capacity = 100;
  266. // kg/sec
  267. this.digestRate = 80 / 8640;
  268. this.digest = function(time) {
  269. let lines = [];
  270. this.contents.forEach(function(prey) {
  271. if (prey.health > 0) {
  272. let damage = Math.min(prey.health, this.damageRate * time + this.damageRatePercent * prey.maxHealth * time);
  273. prey.health -= damage;
  274. time -= damage / (this.damageRate + this.damageRatePercent * prey.maxHealth);
  275. if (prey.health + damage > 50 && prey.health <= 50) {
  276. lines.push(this.describeDamage(prey));
  277. }
  278. if (prey.health <= 0) {
  279. lines.push(this.describeKill(prey));
  280. }
  281. }
  282. if (prey.health <= 0) {
  283. let digested = Math.min(prey.mass, this.digestRate * time);
  284. prey.mass -= digested;
  285. this.owner.changeStamina(digested * 10);
  286. this.fill(digested);
  287. }
  288. if (prey.mass <= 0) {
  289. lines.push(this.describeFinish(prey));
  290. this.finish(prey);
  291. }
  292. this.contents = this.contents.filter(function(prey) {
  293. return prey.mass > 0;
  294. });
  295. }, this);
  296. return lines;
  297. };
  298. this.feed = function(prey) {
  299. this.contents.push(prey);
  300. };
  301. this.fullness = function() {
  302. return this.contents.reduce((total, prey) => total + prey.mass, 0) + this.waste;
  303. };
  304. this.fullnessPercent = function() {
  305. return this.fullness() / this.capacity;
  306. };
  307. this.add = function(amount) {
  308. this.waste += amount;
  309. };
  310. this.finish = function(prey) {
  311. if (prey.prefs.scat)
  312. this.digested.push(prey);
  313. };
  314. }
  315. function Stomach(owner) {
  316. Container.call(this, owner);
  317. this.describeDamage = function(prey) {
  318. return "Your guts gurgle and churn, slowly wearing down " + prey.description("the") + " trapped within.";
  319. };
  320. this.describeKill = function(prey) {
  321. return prey.description("The") + "'s struggles wane as your stomach overpowers them.";
  322. };
  323. this.describeFinish = function(prey) {
  324. return "Your churning guts have reduced " + prey.description("a") + " to meaty chyme.";
  325. };
  326. this.fill = function(amount) {
  327. if (owner.prefs.scat)
  328. this.bowels.add(amount);
  329. };
  330. this.finish = function(prey) {
  331. this.bowels.finish(prey);
  332. };
  333. }
  334. function Bowels(owner, stomach) {
  335. Container.call(this, owner);
  336. this.stomach = stomach;
  337. this.parentDigest = this.digest;
  338. this.digest = function(time) {
  339. this.contents.forEach(function(x) {
  340. x.timeInBowels += time;
  341. });
  342. let lines = this.parentDigest(time);
  343. let pushed = this.contents.filter(prey => prey.timeInBowels >= 60 * 30);
  344. pushed.forEach(function(x) {
  345. this.stomach.feed(x);
  346. lines.push("Your winding guts squeeze " + x.description("the") + " into your stomach.");
  347. }, this);
  348. this.contents = this.contents.filter(prey => prey.timeInBowels < 60 * 30);
  349. return lines;
  350. };
  351. this.describeDamage = function(prey) {
  352. return "Your bowels gurgle and squeeze, working to wear down " + prey.description("the") + " trapped in those musky confines.";
  353. };
  354. this.describeKill = function(prey) {
  355. return prey.description("The") + " abruptly stops struggling, overpowered by your winding intestines.";
  356. };
  357. this.describeFinish = function(prey) {
  358. return "That delicious " + prey.description() + " didn't even make it to your stomach...now they're gone.";
  359. };
  360. this.describeOrgasm = function() {
  361. let line = "Your knees buckle as your bowels clench and squeeze, forcing out a " + Math.round(this.waste) + "-pound heap of shit in several pleasurable - and forceful - heaves.";
  362. if (this.digested.length > 0) {
  363. line += " The bones of " + join(this.digested) + " are streaked throughout your waste.";
  364. this.digested = [];
  365. }
  366. this.waste = 0;
  367. return [line];
  368. };
  369. this.parentFeed = this.feed;
  370. this.feed = function(prey) {
  371. prey.timeInBowels = 0;
  372. this.parentFeed(prey);
  373. };
  374. this.fill = function(amount) {
  375. if (owner.prefs.scat)
  376. this.add(amount);
  377. };
  378. this.finish = function(prey) {
  379. if (prey.prefs.scat)
  380. this.digested.push(prey);
  381. };
  382. }
  383. function Balls(owner) {
  384. Container.call(this, owner);
  385. this.describeDamage = function(prey) {
  386. return "Your balls slosh as they wear down the " + prey.description("the") + " trapped within.";
  387. };
  388. this.describeKill = function(prey) {
  389. return prey.description("The") + "'s struggles cease, overpowered by your cum-filled balls.";
  390. };
  391. this.describeFinish = function(prey) {
  392. return "Your churning balls have melted " + prey.description("a") + " down to musky cum.";
  393. };
  394. this.describeOrgasm = function() {
  395. let line = "You heavy balls empty themselves over a nearby wall, spraying it with " + Math.round(this.waste) + " pounds of thick cum.";
  396. if (this.digested.length > 0) {
  397. line += " All that seed used to be " + join(this.digested) + ".";
  398. this.digested = [];
  399. }
  400. this.waste = 0;
  401. return [line];
  402. };
  403. this.fill = function(amount) {
  404. this.add(amount);
  405. };
  406. this.finish = function(prey) {
  407. this.digested.push(prey);
  408. };
  409. }
  410. function Womb(owner) {
  411. Container.call(this, owner);
  412. this.describeDamage = function(prey) {
  413. return "You shiver as " + prey.description("the") + " squrims within your womb.";
  414. };
  415. this.describeKill = function(prey) {
  416. return "Your womb clenches and squeezes, overwhelming " + prey.description("the") + " trapped within.";
  417. };
  418. this.describeFinish = function(prey) {
  419. return "Your womb dissolves " + prey.description("a") + " into femcum.";
  420. };
  421. this.describeOrgasm = function() {
  422. let line = "You moan and stumble, nethers exploding with ecstasy and gushing out " + Math.round(this.waste/2.2) + " liters of musky, slick femcum.";
  423. if (this.digested.length > 0) {
  424. line += " You pant, fingering yourself as the remains of " + join(this.digested) + " drip onto the floor.";
  425. this.digested = [];
  426. }
  427. this.waste = 0;
  428. return [line];
  429. };
  430. this.fill = function(amount) {
  431. this.add(amount);
  432. };
  433. this.finish = function(prey) {
  434. this.digested.push(prey);
  435. };
  436. }
  437. function Breasts(owner) {
  438. Container.call(this, owner);
  439. this.describeDamage = function(prey) {
  440. return "Your breasts slosh from side to side, steadily softening " + prey.description("the") + " trapped within.";
  441. };
  442. this.describeKill = function(prey) {
  443. return prey.description("The") + " gives one last mighty shove...and then slumps back in your breasts.";
  444. };
  445. this.describeFinish = function(prey) {
  446. return "Your breasts have broken " + prey.description("a") + " down to creamy milk.";
  447. };
  448. this.describeOrgasm = function() {
  449. let line = "Thick, creamy milk leaks from your overfilled breasts. You grab and squeeze, milking out " + Math.round(this.waste/2.2) + " liters of the warm fluid.";
  450. if (this.digested.length > 0) {
  451. line += " All that milk used to be " + join(this.digested) + ".";
  452. this.digested = [];
  453. }
  454. this.waste = 0;
  455. return [line];
  456. };
  457. this.fill = function(amount) {
  458. this.add(amount);
  459. };
  460. this.finish = function(prey) {
  461. this.digested.push(prey);
  462. };
  463. }
  464. // PLAYER PREY
  465. function plead(predator) {
  466. return {
  467. name: "Plead",
  468. desc: "Ask very, very nicely for the predator to let you go. More effective if you haven't hurt your predator.",
  469. struggle: function(player) {
  470. let escape = Math.random() < predator.health / predator.maxHealth && Math.random() < 0.33;
  471. if (player.health <= 0) {
  472. escape = escape && Math.random() < 0.25;
  473. }
  474. if (escape) {
  475. player.clear();
  476. predator.clear();
  477. return {
  478. "escape": "escape",
  479. "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"]
  480. };
  481. } else {
  482. return {
  483. "escape": "stuck",
  484. "lines": ["You plead with " + predator.description("the") + " to let you go, but they refuse."]
  485. };
  486. }
  487. }
  488. };
  489. }
  490. function struggle(predator) {
  491. return {
  492. name: "Struggle",
  493. desc: "Try to squirm free. More effective if you've hurt your predator.",
  494. struggle: function(player) {
  495. let escape = Math.random() > predator.health / predator.maxHealth && Math.random() < 0.33;
  496. if (player.health <= 0 || player.stamina <= 0) {
  497. escape = escape && Math.random() < 0.25;
  498. }
  499. if (escape) {
  500. player.clear();
  501. predator.clear();
  502. return {
  503. "escape": "escape",
  504. "lines": ["You struggle and squirm, forcing " + predator.description("the") + " to hork you up. They groan and stumble away, exhausted by your efforts."]
  505. };
  506. } else {
  507. return {
  508. "escape": "stuck",
  509. "lines": ["You squirm and writhe within " + predator.description("the") + " to no avail."]
  510. };
  511. }
  512. }
  513. };
  514. }
  515. function struggleStay(predator) {
  516. return {
  517. name: "Struggle",
  518. desc: "Try to squirm free. More effective if you've hurt your predator.",
  519. struggle: function(player) {
  520. let escape = Math.random() > predator.health / predator.maxHealth && Math.random() < 0.33;
  521. if (player.health <= 0 || player.stamina <= 0) {
  522. escape = escape && Math.random() < 0.25;
  523. }
  524. if (escape) {
  525. player.clear();
  526. predator.clear();
  527. return {
  528. "escape": "stay",
  529. "lines": ["You struggle and squirm, forcing " + predator.description("the") + " to hork you up. They're not done with you yet..."]
  530. };
  531. } else {
  532. return {
  533. "escape": "stuck",
  534. "lines": ["You squirm and writhe within " + predator.description("the") + " to no avail."]
  535. };
  536. }
  537. }
  538. };
  539. }
  540. function rub(predator) {
  541. return {
  542. name: "Rub",
  543. desc: "Rub rub rub",
  544. struggle: function(player) {
  545. return {
  546. "escape": "stuck",
  547. "lines": ["You rub the crushing walls. At least " + predator.description("the") + " is getting something out of this."]
  548. };
  549. }
  550. };
  551. }
  552. function submit(predator) {
  553. return {
  554. name: "Submit",
  555. desc: "Do nothing",
  556. struggle: function(player) {
  557. return {
  558. "escape": "stuck",
  559. "lines": ["You do nothing."]
  560. };
  561. }
  562. };
  563. }