munch
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

204 строки
4.3 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. lines.push("You grunt and clench, squeezing out the remains of your former prey.");
  32. player.bowels.waste = 0;
  33. }
  34. if (player.bowels.digested.length > 0) {
  35. lines.push("The remains of " + join(player.bowels.digested) + " empty into the sewers as you flush them away.");
  36. }
  37. player.bowels.digested = [];
  38. update(lines);
  39. },
  40. "conditions": [
  41. function(player) {
  42. return player.prefs.scat == true;
  43. }
  44. ]
  45. });
  46. }
  47. function TV() {
  48. GameObject.call(this, "TV");
  49. this.actions.push({
  50. "name": "Watch TV",
  51. "action": function() {
  52. update(["Reruns, again."]);
  53. }
  54. });
  55. }
  56. function Phone() {
  57. GameObject.call(this, "Phone");
  58. this.actions.push({
  59. "name": "Use phone",
  60. "action": function() {
  61. startDialog(new PhoneCall());
  62. }
  63. });
  64. }
  65. function Bed() {
  66. GameObject.call(this, "Bed");
  67. this.actions.push({
  68. "name": "Sleep",
  69. "action": function() {
  70. if (player.health >= player.maxHealth) {
  71. if (Math.random() < 0.33 && (time > EVENING)) {
  72. update(["You crawl into bed and fall asleep...",newline]);
  73. advanceTimeTo(MIDNIGHT);
  74. startDialog(new LalimEncounter());
  75. return;
  76. }
  77. }
  78. update(["You take a nap."]);
  79. advanceTime(3600*2);
  80. updateDisplay();
  81. }
  82. });
  83. this.actions.push({
  84. "name": "Save Game",
  85. "action": function() {
  86. saveGame();
  87. update(["Game saved."]);
  88. updateDisplay();
  89. }
  90. });
  91. this.actions.push({
  92. "name": "Load Game",
  93. "action": function() {
  94. loadGame();
  95. update(["Game loaded."]);
  96. updateDisplay();
  97. }
  98. });
  99. this.actions.push({
  100. "name": "Whack off",
  101. "action": function() {
  102. player.arousal = 100;
  103. advanceTime(240);
  104. }
  105. });
  106. }
  107. function Journal() {
  108. GameObject.call(this, "Journal");
  109. this.actions.push({
  110. "name": "Read Journal",
  111. "action": function() {
  112. if (deaths.length == 0)
  113. update(["You pick up the journal and read it.",newline,"It's empty."]);
  114. else
  115. update(["You pick up the journal and read it.",newline].concat(deaths));
  116. }
  117. });
  118. }
  119. function Sofa() {
  120. GameObject.call(this, "Sofa");
  121. this.actions.push({
  122. "name": "Sit on sofa",
  123. "action": function(){
  124. startDialog(SofaSit());
  125. }
  126. });
  127. }
  128. function NatureTrailExercise() {
  129. GameObject.call(this, "Exercise");
  130. this.actions.push({
  131. "name": "Exercise",
  132. "action": function() {
  133. startDialog(new NatureExercise());
  134. }
  135. });
  136. }
  137. function VendingMachine() {
  138. GameObject.call(this, "Vending Machine");
  139. this.actions.push({
  140. "name": "Use the vending machine",
  141. "action": function() {
  142. startDialog(new VendingMachinePurchase());
  143. }
  144. });
  145. }
  146. function WildernessExplore(natureTrail) {
  147. GameObject.call(this, "Explore the Wilderness");
  148. this.actions.push({
  149. "name": "Explore",
  150. "action": function() {
  151. let outcome = Math.random();
  152. advanceTime(60*15);
  153. if (outcome < 0.25) {
  154. moveToByName("Nature Trail", "You find your way back");
  155. } else if (outcome < 0.35) {
  156. startCombat(new Trance());
  157. } else if (outcome < 0.45) {
  158. startCombat(new Taluthus());
  159. } else if (outcome < 0.55) {
  160. startCombat(new Selicia());
  161. } else {
  162. update(["You wander around for a bit, but haven't found your way out yet."]);
  163. }
  164. }
  165. });
  166. this.actions.push({
  167. "name": "Look for trouble",
  168. "action": function() {
  169. let outcome = Math.random();
  170. advanceTime(60*15);
  171. if (outcome < 0.33) {
  172. startCombat(new Trance());
  173. } else if (outcome < 0.66) {
  174. startCombat(new Taluthus());
  175. } else {
  176. startCombat(new Selicia());
  177. }
  178. }
  179. });
  180. }