munch
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 

782 Zeilen
25 KiB

  1. function ForestExplore() {
  2. GameObject.call(this, "Explore the Forest");
  3. this.actions.push({
  4. "name": "Explore",
  5. "action": function() {
  6. let outcome = Math.random();
  7. advanceTime(60*30 * (Math.random() * 0.2 + 0.9));
  8. if (outcome < 0.35) {
  9. currentRoom.flags.exit = true;
  10. update(["You find a way back!"]);
  11. } else if (outcome < 0.5) {
  12. startCombat(new Wolf());
  13. } else if (outcome < 0.6) {
  14. startCombat(new AlphaWolf());
  15. } else if (outcome < 0.75) {
  16. startCombat(new Anaconda());
  17. } else {
  18. update(["You explore the forest for a while, but don't find anything."]);
  19. }
  20. }
  21. });
  22. this.actions.push({
  23. "name": "Leave",
  24. "action": function() {
  25. moveToByName("East Trail", "You leave the forest");
  26. },
  27. "conditions": [
  28. function(player) {
  29. return currentRoom.flags.exit;
  30. }
  31. ]
  32. });
  33. }
  34. function Wolf() {
  35. Creature.call(this, "Wolf", 10, 15, 15);
  36. this.hasName = false;
  37. this.description = function(prefix) { return prefix + " wolf"; };
  38. this.attacks = [];
  39. this.attacks.push(wolfBite(this));
  40. this.attacks.push(wolfHowl(this));
  41. this.attacks.push(wolfTackle(this));
  42. this.attacks.push(wolfTackleBite(this));
  43. this.attacks.push(wolfTackleSwallow(this));
  44. this.attacks.push(grappledStruggle(this));
  45. this.backupAttack = pass(this);
  46. this.struggles = [];
  47. this.struggles.push(new struggle(this));
  48. this.struggles.push(new submit(this));
  49. this.digests = [];
  50. this.digests.push(wolfDigest(this));
  51. this.digests.push(wolfBelch(this));
  52. this.flags.stage = "combat";
  53. this.startCombat = function(player) {
  54. return ["A snapping twig grabs your attention. You turn and find yourself facing a large, mangy wolf. The cur stands at least half your height at the shoulder, and it looks <i>hungry.</i>"];
  55. };
  56. this.finishCombat = function() {
  57. if (this.flags.stage == "combat")
  58. return [this.description("The") + " knocks you to the ground. You bash your head on a rock and black out."];
  59. else if (this.flags.stage == "oral")
  60. return ["You fall limp in " + this.description("the") + "'s roiling guts, melting away to feed the mangy predator for a good, long time..."];
  61. };
  62. this.status = function(player) {
  63. return [];
  64. };
  65. }
  66. function AlphaWolf() {
  67. Creature.call(this, "Alpha Wolf", 20, 20, 20);
  68. this.hasName = false;
  69. this.description = function(prefix) { return prefix + " alpha wolf"; };
  70. this.attacks = [];
  71. this.attacks.push(wolfBite(this));
  72. this.attacks.push(wolfHowl(this));
  73. this.attacks.push(wolfTackle(this));
  74. this.attacks.push(wolfTackleBite(this));
  75. this.attacks.push(wolfTackleSwallow(this));
  76. this.attacks.push(wolfSwallow(this));
  77. this.attacks.push(grappledStruggle(this));
  78. this.attacks.push(grappledReverse(this));
  79. this.backupAttack = pass(this);
  80. this.struggles = [];
  81. this.struggles.push(new struggle(this));
  82. this.struggles.push(new submit(this));
  83. this.digests = [];
  84. this.digests.push(wolfDigest(this));
  85. this.digests.push(wolfBelch(this));
  86. this.flags.stage = "combat";
  87. this.startCombat = function(player) {
  88. return ["A low growl sends a chill up your spine. You turn around slowly, coming face-to-face with a massive, snarling wolf. Nearly six feet tall at the shoulder, the beast is eyeing you up as a snack."];
  89. };
  90. this.finishCombat = function() {
  91. if (this.flags.stage == "combat")
  92. return [this.description("The") + " knocks you to the ground. You bash your head on a rock and black out."];
  93. else if (this.flags.stage == "oral")
  94. return ["You fall limp in " + this.description("the") + "'s roiling guts, melting away to feed the mangy predator for a good, long time..."];
  95. };
  96. this.status = function(player) {
  97. return [];
  98. };
  99. }
  100. function wolfBite(attacker) {
  101. return {
  102. attackPlayer: function(defender){
  103. let damage = attack(attacker, defender, attacker.str);
  104. return [attacker.description("The") + " jumps at you, biting for " + damage + " damage"];
  105. },
  106. requirements: [
  107. function(attacker, defender) {
  108. return attacker.flags.stage == "combat";
  109. },
  110. function(attacker, defender) {
  111. return !attacker.flags.grappled && !defender.flags.grappled;
  112. }
  113. ],
  114. priority: 1,
  115. weight: function(attacker, defender) { return 1 + defender.health/defender.maxHealth; }
  116. };
  117. }
  118. function wolfHowl(attacker) {
  119. return {
  120. attackPlayer: function(defender){
  121. attacker.statBuffs.push(new StatBuff("str", 1.25));
  122. return [attacker.description("The") + " backs up and lets out a long, wailing howl.",newline,"It seems emboldened."];
  123. },
  124. requirements: [
  125. function(attacker, defender) {
  126. return attacker.flags.stage == "combat";
  127. },
  128. function(attacker, defender) {
  129. return !attacker.flags.grappled && !defender.flags.grappled;
  130. }
  131. ],
  132. priority: 1,
  133. weight: function(attacker, defender) { return 0.25; }
  134. };
  135. }
  136. function wolfTackle(attacker) {
  137. return {
  138. attackPlayer: function(defender){
  139. defender.flags.grappled = true;
  140. return [attacker.description("The") + " leaps on top of you, pinning you to the ground!"];
  141. },
  142. requirements: [
  143. function(attacker, defender) {
  144. return attacker.flags.stage == "combat";
  145. },
  146. function(attacker, defender) {
  147. return !attacker.flags.grappled && !defender.flags.grappled;
  148. }
  149. ],
  150. priority: 1,
  151. weight: function(attacker, defender) { return 1.25 - defender.health/defender.maxHealth; }
  152. };
  153. }
  154. function wolfTackleBite(attacker) {
  155. return {
  156. attackPlayer: function(defender){
  157. let damage = attack(attacker, defender, attacker.str * 1.5);
  158. return pickRandom([
  159. ["Pain shoots through your arm as " + attacker.description("the") + " bites it for " + damage + " damage!"],
  160. ["You struggle against " + attacker.description("the") + " as it bites your shoulder for " + damage + " damage."],
  161. [attacker.description("The") + "'s claws dig into your legs for " + damage + " damage."]
  162. ]);
  163. },
  164. requirements: [
  165. function(attacker, defender) {
  166. return attacker.flags.stage == "combat";
  167. },
  168. function(attacker, defender) {
  169. return !attacker.flags.grappled && defender.flags.grappled;
  170. }
  171. ],
  172. priority: 1,
  173. weight: function(attacker, defender) { return 1 + defender.health/defender.maxHealth; }
  174. };
  175. }
  176. function wolfTackleSwallow(attacker) {
  177. return {
  178. attackPlayer: function(defender){
  179. attacker.flags.stage = "oral";
  180. changeMode("eaten");
  181. return ["You struggle against " + attacker.description("the") + ", but it's not enough - its greedy jaws envelop your head, then your shoulders. The hungry beast swallows you down in seconds, cramming you into its hot, slimy stomach."];
  182. },
  183. conditions: [
  184. function(attacker, defender) {
  185. return defender.prefs.prey && defender.prefs.vore.oral > 0;
  186. }
  187. ],
  188. requirements: [
  189. function(attacker, defender) {
  190. return attacker.flags.stage == "combat";
  191. },
  192. function(attacker, defender) {
  193. return !attacker.flags.grappled && defender.flags.grappled;
  194. }
  195. ],
  196. priority: 1,
  197. weight: function(attacker, defender) { return 1; }
  198. };
  199. }
  200. function wolfSwallow(attacker) {
  201. return {
  202. attackPlayer: function(defender){
  203. let success = statCheck(attacker, defender, "dex") || defender.stamina == 0;
  204. if (success) {
  205. attacker.flags.stage = "oral";
  206. changeMode("eaten");
  207. return [attacker.description("The") + " charges, closing the gap in the blink of an eye and jamming your upper body into its massive, drool-slathered maw. <i>Glrp, glllpkh, gulp</i> - and you're in its throat, thrashing and struggling as you plunge into the greedy beast's sloppy stomach."];
  208. } else {
  209. return [attacker.description("The") + " lunges at you, racing up with jaws splayed wide open. You leap to the side, barely avoiding the greedy beast's maw as it barrels past, growling and snapping in frustration."];
  210. }
  211. },
  212. conditions: [
  213. function(attacker, defender) {
  214. return defender.prefs.prey && defender.prefs.vore.oral > 0;
  215. }
  216. ],
  217. requirements: [
  218. function(attacker, defender) {
  219. return attacker.flags.stage == "combat";
  220. },
  221. function(attacker, defender) {
  222. return !attacker.flags.grappled && !defender.flags.grappled;
  223. }
  224. ],
  225. priority: 1,
  226. weight: function(attacker, defender) { return 1; }
  227. };
  228. }
  229. function wolfDigest(attacker) {
  230. return {
  231. digest: function(defender){
  232. let damage = attack(attacker, defender, attacker.str * 3);
  233. return [attacker.description("The") + "'s churning guts wear you down."];
  234. },
  235. requirements: [
  236. function(attacker, defender) {
  237. return attacker.flags.stage == "oral";
  238. }
  239. ],
  240. priority: 1,
  241. weight: function(attacker, defender) { return 1; },
  242. gameover: function() { return "Digested by " + attacker.description("a"); }
  243. };
  244. }
  245. function wolfBelch(attacker) {
  246. return {
  247. digest: function(defender){
  248. defender.stamina -= 50;
  249. let damage = attack(attacker, defender, attacker.str * 2);
  250. return [attacker.description("The") + " lets out a crass <i>BELCH</i>, draining air from its snarling gut and squeezing you even tighter than before."];
  251. },
  252. requirements: [
  253. function(attacker, defender) {
  254. return attacker.flags.stage == "oral";
  255. }
  256. ],
  257. priority: 1,
  258. weight: function(attacker, defender) { return 1; },
  259. gameover: function() { return "Reduced to a belch by " + attacker.description("a"); }
  260. };
  261. }
  262. function Anaconda() {
  263. Creature.call(this, "Anaconda", 60, 10, 20);
  264. this.hasName = false;
  265. this.description = function(prefix) {
  266. if (prefix == "a")
  267. return "an anaconda";
  268. if (prefix == "A")
  269. return "A anaconda";
  270. else
  271. return prefix + " anaconda";
  272. };
  273. this.flags.state = "combat";
  274. this.flags.tail = {};
  275. this.flags.oral = {};
  276. this.flags.grapple = {};
  277. this.flags.stomach = {};
  278. this.stomachPull = function(amount) {
  279. this.flags.stomach.depth += amount;
  280. this.flags.stomach.depth = Math.max(0, this.flags.stomach.depth);
  281. this.flags.stomach.depth = Math.min(30, this.flags.stomach.depth);
  282. };
  283. this.startCombat = function(player) {
  284. return ["An anaconda slithers from the bushes."];
  285. };
  286. this.finishCombat = function() {
  287. if (this.flags.state == "combat")
  288. return ["You fall to your knees, barely aware as the anaconda lashes forward to gulp you down..."];
  289. else if (this.flags.state == "oral")
  290. return ["You black out in the snake's crushing throat. At least you won't have to experience your slow digestion..."];
  291. else if (this.flags.state == "stomach")
  292. return ["The snake's stomach is too much to bear, and you black out as your body begins to collapse under the pressure."];
  293. };
  294. this.status = function() {
  295. if (this.flags.state == "oral") {
  296. switch(this.flags.oral.depth) {
  297. case 1: return ["You're trapped at the top of the serpent's throat."];
  298. case 2: return ["Your body is a heavy bulge, hanging five feet down the snake's gullet."];
  299. case 3: return ["Hot flesh squeezes all around you, grinding on your body as you're held perilously close to the anaconda's stomach."];
  300. case 4: return ["Unyielding flesh holds you tight against the entrance of the serpent's stomach. One last swallow and you're going in."]
  301. }
  302. } else if (this.flags.state == "stomach") {
  303. if (this.flags.stomach.depth <= 1) {
  304. return ["You're held up right against the entrance to the snake's sloppy gut."];
  305. } else if (this.flags.stomach.depth < 10) {
  306. return ["The rippling stomach squeezes on your slick, delicious body."];
  307. } else if (this.flags.stomach.depth < 20) {
  308. return ["You're trapped halway into the anaconda's crushing stomach."];
  309. } else if (this.flags.stomach.depth < 30) {
  310. return ["The anaconda's guts seem endless - rippling, churning, crushing."];
  311. } else {
  312. return ["You're so very deep..."];
  313. }
  314. } else {
  315. return [];
  316. }
  317. };
  318. let attacker = this;
  319. this.attacks = [];
  320. // hiss at player
  321. this.attacks.push({
  322. attackPlayer: function(defender) {
  323. return pickRandom([
  324. ["The anaconda raises its head and hisses"],
  325. ["The hulking serpent narrows its eyes and hisses at you"]
  326. ]);
  327. },
  328. requirements: [
  329. function(attacker, defender) {
  330. return attacker.flags.state == "combat";
  331. }
  332. ],
  333. priority: 1,
  334. weight: function(attacker, defender) { return 1; }
  335. });
  336. // slap player with tail
  337. this.attacks.push({
  338. attackPlayer: function(defender) {
  339. if (statHealthCheck(attacker, defender, "str")) {
  340. let damage = attack(attacker, defender, attacker.str/2);
  341. return ["The snake's tail whips around, smacking you for " + damage + " damage!"];
  342. } else {
  343. return ["The serpent's tail lashes at you, but you manage to stay out of its way."];
  344. }
  345. },
  346. requirements: [
  347. function(attacker, defender) {
  348. return attacker.flags.state == "combat";
  349. }
  350. ],
  351. priority: 1,
  352. weight: function(attacker, defender) { return 1; }
  353. });
  354. // grab player with tail
  355. this.attacks.push({
  356. attackPlayer: function(defender) {
  357. if (statHealthCheck(attacker, defender, "str")) {
  358. attacker.flags.state = "grapple";
  359. attacker.flags.tail.turns = 0;
  360. attacker.flags.tail.submits = 0;
  361. let damage = attack(attacker, defender, attacker.str/2);
  362. return ["The snake's tail whips around and grabs you! A tight embrace of smooth, cold scales grips your entire upper body, a lazy <i>clench</i> of muscle suppressing your meek struggles."];
  363. } else {
  364. return ["The anaconda tries to snatch you up in its tail. You dodge out of the way."];
  365. }
  366. },
  367. requirements: [
  368. function(attacker, defender) {
  369. return attacker.flags.state == "combat";
  370. }
  371. ],
  372. priority: 1,
  373. weight: function(attacker, defender) { return 4 - 4 * defender.healthPercentage(); }
  374. });
  375. // squeeze in tail
  376. this.attacks.push({
  377. attackPlayer: function(defender) {
  378. attacker.flags.tail.turns++;
  379. let damage = attack(attacker, defender, attacker.str / 2 * attacker.flags.tail.turns);
  380. defender.changeStamina(attacker.str / 2 * attacker.flags.tail.turns);
  381. return pickRandom([
  382. ["Tight, crushing coils bear down..."],
  383. ["Stars fill your eyes as the snake crushes you alive."],
  384. ["You gasp silently, struggling for breath."],
  385. ["Your bones creak under the strain as the anaconda squeezes you like a toy."]
  386. ]);
  387. },
  388. requirements: [
  389. function(attacker, defender) {
  390. return attacker.flags.state == "grapple";
  391. }
  392. ],
  393. priority: 1,
  394. weight: function(attacker, defender) { return defender.healthPercentage(); }
  395. });
  396. // swallow from tail
  397. this.attacks.push({
  398. attackPlayer: function(defender) {
  399. attacker.flags.state = "oral";
  400. attacker.flags.oral.depth = 1;
  401. return ["The snake's head swoops in close - and then its jaws split open. You struggle and strain against the beast's crushing scales, its gaping throat taking you in with terrifying ease...enveloping your head, shoulders, chest, hips, and legs in one smooth motion. It hefts its head up before throwing it up high, letting gravity drag you all the way down into its velvety throat. A hot, wet <i>glurrk</i> seals you away..."];
  402. },
  403. requirements: [
  404. function(attacker, defender) {
  405. return attacker.flags.state == "grapple";
  406. }
  407. ],
  408. priority: 1,
  409. weight: function(attacker, defender) { return 1 - defender.healthPercentage() + attacker.flags.tail.submits; }
  410. });
  411. // swallow player
  412. this.attacks.push({
  413. attackPlayer: function(defender) {
  414. attacker.flags.oral.depth++;
  415. return pickRandom([
  416. ["A light swallow sucks you deeper."],
  417. ["You slip deeper still, tugged into the abyss by powerful muscle."],
  418. ["Powerful muscle pulls you down deep."],
  419. ["The snake swallows, tugging you deeper and deeper..."],
  420. ["<i>Glrp.</i> Down you go."]
  421. ]);
  422. },
  423. requirements: [
  424. function(attacker, defender) {
  425. return attacker.flags.state == "oral";
  426. }
  427. ],
  428. priority: 1,
  429. weight: function(attacker, defender) { return 1; }
  430. });
  431. // squeeze
  432. this.attacks.push({
  433. attackPlayer: function(defender) {
  434. attack(attacker, defender, attacker.str/2);
  435. defender.changeStamina(-attacker.str/2);
  436. return pickRandom([
  437. ["Powerful, rippling walls clench around your imprisoned body, wearing your out."],
  438. ["The peristaltic pressure peaks as you're crushed and ground, squeezed and smothered in the anaconda's powerful gullet."],
  439. ["The pressure is immense, squeezing and grinding your body like a stick of gum being chewed."]
  440. ]);
  441. },
  442. requirements: [
  443. function(attacker, defender) {
  444. return attacker.flags.state == "oral";
  445. }
  446. ],
  447. priority: 1,
  448. weight: function(attacker, defender) { return defender.healthPercentage(); },
  449. gameover: function() { return "Crushed and digested by " + attacker.description("a"); }
  450. });
  451. // pull into stomach
  452. this.attacks.push({
  453. attackPlayer: function(defender) {
  454. attacker.flags.state = "stomach";
  455. attacker.flags.stomach.depth = 3;
  456. return ["The snake's throat clenches one last time, sucking you down into the beast's long, crushing stomach. You slide in a few feet, the entrance sealing shut behind you...sealing you away in that acidic pit."];
  457. },
  458. requirements: [
  459. function(attacker, defender) {
  460. return attacker.flags.state == "oral";
  461. },
  462. function(attacker, defender) {
  463. return attacker.flags.oral.depth >= 4;
  464. }
  465. ],
  466. priority: 2,
  467. weight: function(attacker, defender) { return defender.healthPercentage(); }
  468. });
  469. // digest
  470. this.attacks.push({
  471. attackPlayer: function(defender) {
  472. let damage = attacker.con / 5 + attacker.con / 20 * attacker.flags.stomach.depth;
  473. if (attacker.flags.stomach.depth >= 30) {
  474. damage *= 2;
  475. }
  476. attack(attacker, defender, damage);
  477. defender.changeStamina(-damage);
  478. attacker.stomachPull(Math.floor(Math.random()*4+4));
  479. if (attacker.flags.stomach.depth <= 10) {
  480. return pickRandom([
  481. ["Light pressure squeezes on your body."],
  482. ["The rippling walls clench around you."],
  483. ["Faint tingling dances across your skin."]
  484. ]);
  485. } else if (attacker.flags.stomach.depth <= 20) {
  486. return pickRandom([
  487. ["Thick, slimy chyme sloshes over your body."],
  488. ["The pressure is getting painful."],
  489. ["Powerful clenches of muscle bear down."],
  490. ["You struggle to breathe as the snake constricts you within."]
  491. ]);
  492. } else if (attacker.flags.stomach.depth < 30) {
  493. return pickRandom([
  494. ["The pressure is crushing you to death."],
  495. ["Agonizing acids sear your skin."],
  496. ["The snake hisses as it feels your body break."],
  497. ["You're melting and breaking in the snake's crushing stomach."],
  498. ["Trapped in the depths of the snake, you squirm and struggle as it melts you alive."]
  499. ]);
  500. } else {
  501. return pickRandom([
  502. ["You whimper with pain as the snake crushes you alive."],
  503. ["Crushing muscle grinds you against the end of the snake's gut."],
  504. ["You feel your body falling apart."],
  505. ["The rippling walls are too much to bear. You're going to melt..."]
  506. ]);
  507. }
  508. },
  509. requirements: [
  510. function(attacker, defender) {
  511. return attacker.flags.state == "stomach";
  512. }
  513. ],
  514. priority: 1,
  515. weight: function(attacker, defender) { return defender.healthPercentage(); },
  516. gameover: function() { return "Digested alive by " + attacker.description("a"); }
  517. });
  518. /** PLAYER ATTACKS **/
  519. this.playerAttacks = [];
  520. // pass in combat
  521. this.playerAttacks.push(
  522. function(attacker) {
  523. return {
  524. name: "Pass",
  525. desc: "Do nothing",
  526. attack: function(defender) {
  527. return ["You do nothing."];
  528. },
  529. requirements: [
  530. function(attacker, defender) {
  531. return defender.flags.state == "combat";
  532. }
  533. ]
  534. };
  535. }
  536. );
  537. // struggle in coils
  538. this.playerAttacks.push(
  539. function(attacker) {
  540. return {
  541. name: "Struggle",
  542. desc: "Try to escape the coils!",
  543. attack: function(defender) {
  544. if (statHealthCheck(attacker, defender, "str")) {
  545. defender.flags.state = "combat";
  546. return ["You pry your way of the snake's coils!"];
  547. } else {
  548. return pickRandom([
  549. ["You struggle without effect."],
  550. ["Your struggles do nothing."],
  551. ["The snake's crushing coils hold you fast."]
  552. ]);
  553. }
  554. },
  555. requirements: [
  556. function(attacker, defender) {
  557. return defender.flags.state == "grapple";
  558. }
  559. ]
  560. };
  561. }
  562. );
  563. // pass in coils
  564. this.playerAttacks.push(
  565. function(attacker) {
  566. return {
  567. name: "Submit",
  568. desc: "Do nothing",
  569. attack: function(defender) {
  570. defender.flags.tail.submits++;
  571. return ["You lie limp in the coils."];
  572. },
  573. requirements: [
  574. function(attacker, defender) {
  575. return defender.flags.state == "grapple";
  576. }
  577. ]
  578. };
  579. }
  580. );
  581. // struggle in throat
  582. this.playerAttacks.push(
  583. function(attacker) {
  584. return {
  585. name: "Struggle",
  586. desc: "Try to escape the snake's gullet",
  587. attack: function(defender) {
  588. if (statHealthCheck(attacker, defender, "str")) {
  589. defender.flags.oral.depth--;
  590. if (defender.flags.oral.depth < 0) {
  591. defender.flags.state = "oral";
  592. return ["With a tremendous burst of strength, you force yourself into the snake's maw! It hisses and retches, spewing you out onto the forest floor."];
  593. } else {
  594. return ["You claw your way up the snake's throat"];
  595. }
  596. } else {
  597. return ["You struggle...and get nowhere."];
  598. }
  599. },
  600. requirements: [
  601. function(attacker, defender) {
  602. return defender.flags.state == "oral";
  603. }
  604. ]
  605. };
  606. }
  607. );
  608. // pass in throat
  609. this.playerAttacks.push(
  610. function(attacker) {
  611. return {
  612. name: "Submit",
  613. desc: "Do nothing",
  614. attack: function(defender) {
  615. defender.flags.oral.depth++;
  616. return ["You let the snake's throat claim you..."];
  617. },
  618. requirements: [
  619. function(attacker, defender) {
  620. return defender.flags.state == "oral";
  621. }
  622. ]
  623. };
  624. }
  625. );
  626. // struggle in stomach
  627. this.playerAttacks.push(
  628. function(attacker) {
  629. return {
  630. name: "Struggle",
  631. desc: "Try to struggle free!",
  632. attack: function(defender) {
  633. if (statHealthCheck(attacker, defender, "str") ||
  634. statHealthCheck(attacker, defender, "str")) {
  635. let distance = attacker.str / 10 + Math.floor(Math.random() * +attacker.str / 10);
  636. defender.stomachPull(-distance);
  637. if (defender.flags.stomach.depth <= 0) {
  638. if (statHealthCheck(attacker, defender, "str")) {
  639. defender.flags.state = "oral";
  640. defender.flags.oral.depth = 3;
  641. return ["You shove yourself into the entrance to the snake's wretched stomach - and break through! You slide back into its throat."];
  642. } else {
  643. return ["You shove yourself into the entrance to the snake's wretched stomach - and get stuck. The tight of ring of muscle is unyielding."];
  644. }
  645. } else {
  646. return ["You drag yourself " + distance + " feet forward, still imprisoned within the snake's bubbling gut."];
  647. }
  648. } else {
  649. return ["Your thrashes and squirms elicit a low hiss from the snake."];
  650. }
  651. },
  652. requirements: [
  653. function(attacker, defender) {
  654. return defender.flags.state == "stomach";
  655. }
  656. ]
  657. };
  658. }
  659. );
  660. // pass in stomach
  661. this.playerAttacks.push(
  662. function(attacker) {
  663. return {
  664. name: "Rest",
  665. desc: "Rest and recover stamina",
  666. attack: function(defender) {
  667. attacker.changeStamina(attacker.maxStamina / 5);
  668. return ["You rest in the snake's squeezing stomach."];
  669. },
  670. requirements: [
  671. function(attacker, defender) {
  672. return defender.flags.state == "stomach";
  673. }
  674. ]
  675. };
  676. }
  677. );
  678. this.playerAttacks.push(
  679. function(attacker) {
  680. return {
  681. name: "Flee",
  682. desc: "Try to run away",
  683. attack: function(defender) {
  684. let success = statCheck(attacker, defender, "dex");
  685. if (success) {
  686. attacker.changeStamina(-25);
  687. attacker.clear();
  688. changeMode("explore");
  689. return ["You successfully run away."];
  690. } else {
  691. attacker.changeStamina(-25);
  692. defender.changeStamina(-25);
  693. return ["You can't escape!"];
  694. }
  695. },
  696. requirements: [
  697. function(attacker, defender) { return defender.flags.state == "combat"; }
  698. ]
  699. }
  700. });
  701. }