crunch
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 

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