munch
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 

295 lignes
8.9 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 {
  16. update(["You explore the forest for a while, but don't find anything."]);
  17. }
  18. }
  19. });
  20. this.actions.push({
  21. "name": "Leave",
  22. "action": function() {
  23. moveToByName("East Trail", "You leave the forest");
  24. },
  25. "conditions": [
  26. function(player) {
  27. return currentRoom.flags.exit;
  28. }
  29. ]
  30. });
  31. }
  32. function Wolf() {
  33. Creature.call(this, "Wolf", 10, 15, 15);
  34. this.hasName = false;
  35. this.description = function(prefix) { return prefix + " wolf"; };
  36. this.attacks = [];
  37. this.attacks.push(wolfBite(this));
  38. this.attacks.push(wolfHowl(this));
  39. this.attacks.push(wolfTackle(this));
  40. this.attacks.push(wolfTackleBite(this));
  41. this.attacks.push(wolfTackleSwallow(this));
  42. this.backupAttack = pass(this);
  43. this.struggles = [];
  44. this.struggles.push(new struggle(this));
  45. this.struggles.push(new submit(this));
  46. this.digests = [];
  47. this.digests.push(wolfDigest(this));
  48. this.digests.push(wolfBelch(this));
  49. this.flags.stage = "combat";
  50. this.startCombat = function(player) {
  51. 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>"];
  52. };
  53. this.finishCombat = function() {
  54. if (this.flags.stage == "combat")
  55. return [this.description("The") + " knocks you to the ground. You bash your head on a rock and black out."];
  56. else if (this.flags.stage == "oral")
  57. return ["You fall limp in " + this.description("the") + "'s roiling guts, melting away to feed the mangy predator for a good, long time..."];
  58. };
  59. this.status = function(player) {
  60. return [];
  61. };
  62. }
  63. function AlphaWolf() {
  64. Creature.call(this, "Alpha Wolf", 20, 20, 20);
  65. this.hasName = false;
  66. this.description = function(prefix) { return prefix + " alpha wolf"; };
  67. this.attacks = [];
  68. this.attacks.push(wolfBite(this));
  69. this.attacks.push(wolfHowl(this));
  70. this.attacks.push(wolfTackle(this));
  71. this.attacks.push(wolfTackleBite(this));
  72. this.attacks.push(wolfTackleSwallow(this));
  73. this.attacks.push(wolfSwallow(this));
  74. this.backupAttack = pass(this);
  75. this.struggles = [];
  76. this.struggles.push(new struggle(this));
  77. this.struggles.push(new submit(this));
  78. this.digests = [];
  79. this.digests.push(wolfDigest(this));
  80. this.digests.push(wolfBelch(this));
  81. this.flags.stage = "combat";
  82. this.startCombat = function(player) {
  83. 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."];
  84. };
  85. this.finishCombat = function() {
  86. if (this.flags.stage == "combat")
  87. return [this.description("The") + " knocks you to the ground. You bash your head on a rock and black out."];
  88. else if (this.flags.stage == "oral")
  89. return ["You fall limp in " + this.description("the") + "'s roiling guts, melting away to feed the mangy predator for a good, long time..."];
  90. };
  91. this.status = function(player) {
  92. return [];
  93. };
  94. }
  95. function wolfBite(attacker) {
  96. return {
  97. attackPlayer: function(defender){
  98. let damage = attack(attacker, defender, attacker.str);
  99. return [attacker.description("The") + " jumps at you, biting for " + damage + " damage"];
  100. },
  101. requirements: [
  102. function(attacker, defender) {
  103. return attacker.flags.stage == "combat";
  104. },
  105. function(attacker, defender) {
  106. return !attacker.flags.grappled && !defender.flags.grappled;
  107. }
  108. ],
  109. priority: 1,
  110. weight: function(attacker, defender) { return 1 + defender.health/defender.maxHealth; }
  111. };
  112. }
  113. function wolfHowl(attacker) {
  114. return {
  115. attackPlayer: function(defender){
  116. attacker.statBuffs.push(new StatBuff("str", 1.25));
  117. return [attacker.description("The") + " backs up and lets out a long, wailing howl.",newline,"It seems emboldened."];
  118. },
  119. requirements: [
  120. function(attacker, defender) {
  121. return attacker.flags.stage == "combat";
  122. },
  123. function(attacker, defender) {
  124. return !attacker.flags.grappled && !defender.flags.grappled;
  125. }
  126. ],
  127. priority: 1,
  128. weight: function(attacker, defender) { return 0.25; }
  129. };
  130. }
  131. function wolfTackle(attacker) {
  132. return {
  133. attackPlayer: function(defender){
  134. defender.flags.grappled = true;
  135. return [attacker.description("The") + " leaps on top of you, pinning you to the ground!"];
  136. },
  137. requirements: [
  138. function(attacker, defender) {
  139. return attacker.flags.stage == "combat";
  140. },
  141. function(attacker, defender) {
  142. return !attacker.flags.grappled && !defender.flags.grappled;
  143. }
  144. ],
  145. priority: 1,
  146. weight: function(attacker, defender) { return 1.25 - defender.health/defender.maxHealth; }
  147. };
  148. }
  149. function wolfTackleBite(attacker) {
  150. return {
  151. attackPlayer: function(defender){
  152. let damage = attack(attacker, defender, attacker.str * 1.5);
  153. return pickRandom([
  154. ["Pain shoots through your arm as " + attacker.description("the") + " bites it for " + damage + " damage!"],
  155. ["You struggle against " + attacker.description("the") + " as it bites your shoulder for " + damage + " damage."],
  156. [attacker.description("The") + "'s claws dig into your legs for " + damage + " damage."]
  157. ]);
  158. },
  159. requirements: [
  160. function(attacker, defender) {
  161. return attacker.flags.stage == "combat";
  162. },
  163. function(attacker, defender) {
  164. return !attacker.flags.grappled && defender.flags.grappled;
  165. }
  166. ],
  167. priority: 1,
  168. weight: function(attacker, defender) { return 1 + defender.health/defender.maxHealth; }
  169. };
  170. }
  171. function wolfTackleSwallow(attacker) {
  172. return {
  173. attackPlayer: function(defender){
  174. attacker.flags.stage = "oral";
  175. changeMode("eaten");
  176. 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."];
  177. },
  178. conditions: [
  179. function(attacker, defender) {
  180. return defender.prefs.prey && defender.prefs.vore.oral > 0;
  181. }
  182. ],
  183. requirements: [
  184. function(attacker, defender) {
  185. return attacker.flags.stage == "combat";
  186. },
  187. function(attacker, defender) {
  188. return !attacker.flags.grappled && defender.flags.grappled;
  189. }
  190. ],
  191. priority: 1,
  192. weight: function(attacker, defender) { return 1; }
  193. };
  194. }
  195. function wolfSwallow(attacker) {
  196. return {
  197. attackPlayer: function(defender){
  198. attacker.flags.stage = "oral";
  199. changeMode("eaten");
  200. 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."];
  201. },
  202. conditions: [
  203. function(attacker, defender) {
  204. return defender.prefs.prey && defender.prefs.vore.oral > 0;
  205. }
  206. ],
  207. requirements: [
  208. function(attacker, defender) {
  209. return attacker.flags.stage == "combat";
  210. },
  211. function(attacker, defender) {
  212. return !attacker.flags.grappled && !defender.flags.grappled;
  213. }
  214. ],
  215. priority: 1,
  216. weight: function(attacker, defender) { return 1; }
  217. };
  218. }
  219. function wolfDigest(attacker) {
  220. return {
  221. digest: function(defender){
  222. let damage = attack(attacker, defender, attacker.str * 3);
  223. return [attacker.description("The") + "'s churning guts wear you down."];
  224. },
  225. requirements: [
  226. function(attacker, defender) {
  227. return attacker.flags.stage == "oral";
  228. }
  229. ],
  230. priority: 1,
  231. weight: function(attacker, defender) { return 1; },
  232. gameover: function() { return "Digested by " + attacker.description("a"); }
  233. };
  234. }
  235. function wolfBelch(attacker) {
  236. return {
  237. digest: function(defender){
  238. defender.stamina -= 50;
  239. let damage = attack(attacker, defender, attacker.str * 2);
  240. return [attacker.description("The") + " lets out a crass <i>BELCH</i>, draining air from its snarling gut and squeezing you even tighter than before."];
  241. },
  242. requirements: [
  243. function(attacker, defender) {
  244. return attacker.flags.stage == "oral";
  245. }
  246. ],
  247. priority: 1,
  248. weight: function(attacker, defender) { return 1; },
  249. gameover: function() { return "Reduced to a belch by " + attacker.description("a"); }
  250. };
  251. }