munch
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

209 lines
5.0 KiB

  1. "use strict";
  2. function GameObject(name="Potato") {
  3. this.name = name;
  4. this.actions = [];
  5. }
  6. function Nerd() {
  7. GameObject.call(this, "Nerd");
  8. this.actions.push({
  9. "name": "Eat Nerd",
  10. "action": function() {
  11. startDialog(new EatDude());
  12. }
  13. });
  14. }
  15. function Toilet() {
  16. GameObject.call(this, "Toilet");
  17. this.actions.push({
  18. "name": "Admire toilet",
  19. "action": function() {
  20. update(["You admire the toilet."]);
  21. }
  22. });
  23. this.actions.push({
  24. "name": "Use toilet",
  25. "action": function() {
  26. let lines = [];
  27. lines.push("You sit down on the toilet.");
  28. if (player.bowels.waste == 0) {
  29. lines.push("But nothing happens.");
  30. } else {
  31. if (player.bowels.waste <= 25) {
  32. lines.push("You grunt and clench, squeezing out the remains of your former prey.");
  33. } else if (player.bowels.waste <= 50) {
  34. lines.push("A crass fart precedes a thick, heavy log of waste. Your intestines strain to force out the heavy heap of shit.");
  35. } else if (player.bowels.waste <= 100) {
  36. lines.push("You barely need to strain to let out your former prey - they're all too eager to flow out, emerging as forearm-thick (and long) logs of scat that crackle as they pile up in the bowl, filling it more than halfway with long-dead prey.");
  37. } else {
  38. lines.push("Your bowels vent an inordinate amount of scat, tailhole opening wide to unleash a bowl-filling heap of your dead prey. You moan and grunt, rippling farts punctuating the swift, steady outflow of chunky shit.");
  39. }
  40. player.bowels.waste = 0;
  41. }
  42. if (player.bowels.digested.length > 0) {
  43. lines.push("The remains of " + join(player.bowels.digested) + " empty into the sewers as you flush them away.");
  44. }
  45. player.bowels.digested = [];
  46. update(lines);
  47. },
  48. "conditions": [
  49. function(player) {
  50. return player.prefs.scat == true;
  51. }
  52. ]
  53. });
  54. }
  55. function TV() {
  56. GameObject.call(this, "TV");
  57. this.actions.push({
  58. "name": "Watch TV",
  59. "action": function() {
  60. update(["Reruns, again."]);
  61. }
  62. });
  63. }
  64. function Phone() {
  65. GameObject.call(this, "Phone");
  66. this.actions.push({
  67. "name": "Use phone",
  68. "action": function() {
  69. startDialog(new PhoneCall());
  70. }
  71. });
  72. }
  73. function Bed() {
  74. GameObject.call(this, "Bed");
  75. this.actions.push({
  76. "name": "Sleep",
  77. "action": function() {
  78. if (player.health >= player.maxHealth) {
  79. if (Math.random() < 0.33 && (time > EVENING)) {
  80. update(["You crawl into bed and fall asleep...",newline]);
  81. advanceTimeTo(MIDNIGHT);
  82. startDialog(new LalimEncounter());
  83. return;
  84. }
  85. }
  86. update(["You take a nap."]);
  87. advanceTime(3600*2);
  88. updateDisplay();
  89. }
  90. });
  91. this.actions.push({
  92. "name": "Save Game",
  93. "action": function() {
  94. saveGame();
  95. }
  96. });
  97. this.actions.push({
  98. "name": "Load Game",
  99. "action": function() {
  100. loadGame();
  101. }
  102. });
  103. this.actions.push({
  104. "name": "Whack off",
  105. "action": function() {
  106. player.arousal = player.arousalLimit();
  107. advanceTime(240);
  108. }
  109. });
  110. }
  111. function Journal() {
  112. GameObject.call(this, "Journal");
  113. this.actions.push({
  114. "name": "Read Journal",
  115. "action": function() {
  116. if (deaths.length == 0)
  117. update(["You pick up the journal and read it.",newline,"It's empty."]);
  118. else
  119. update(["You pick up the journal and read it.",newline].concat(deaths));
  120. }
  121. });
  122. }
  123. function Sofa() {
  124. GameObject.call(this, "Sofa");
  125. this.actions.push({
  126. "name": "Sit on sofa",
  127. "action": function(){
  128. startDialog(SofaSit());
  129. }
  130. });
  131. }
  132. function NatureTrailExercise() {
  133. GameObject.call(this, "Exercise");
  134. this.actions.push({
  135. "name": "Exercise",
  136. "action": function() {
  137. startDialog(new NatureExercise());
  138. }
  139. });
  140. }
  141. function VendingMachine() {
  142. GameObject.call(this, "Vending Machine");
  143. this.actions.push({
  144. "name": "Use the vending machine",
  145. "action": function() {
  146. startDialog(new VendingMachinePurchase());
  147. }
  148. });
  149. }
  150. function WildernessExplore(natureTrail) {
  151. GameObject.call(this, "Explore the Wilderness");
  152. this.actions.push({
  153. "name": "Explore",
  154. "action": function() {
  155. let outcome = Math.random();
  156. advanceTime(60*15);
  157. if (outcome < 0.25) {
  158. moveToByName("Nature Trail", "You find your way back");
  159. } else if (outcome < 0.35) {
  160. startCombat(new Trance());
  161. } else if (outcome < 0.45) {
  162. startCombat(new Taluthus());
  163. } else if (outcome < 0.55) {
  164. startCombat(new Selicia());
  165. } else {
  166. update(["You wander around for a bit, but haven't found your way out yet."]);
  167. }
  168. }
  169. });
  170. this.actions.push({
  171. "name": "Look for trouble",
  172. "action": function() {
  173. let outcome = Math.random();
  174. advanceTime(60*15);
  175. if (outcome < 0.33) {
  176. startCombat(new Trance());
  177. } else if (outcome < 0.66) {
  178. startCombat(new Taluthus());
  179. } else {
  180. startCombat(new Selicia());
  181. }
  182. }
  183. });
  184. }