munch
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 

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