munch
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

149 行
3.0 KiB

  1. "use strict";
  2. function GameObject(name="Potato") {
  3. this.name = name;
  4. this.actions = [];
  5. }
  6. function Burger() {
  7. GameObject.call(this, "Burger");
  8. this.actions.push({
  9. "name": "Punch Burger",
  10. "action": function() {
  11. player.health += 10;
  12. update(["You punch the hamburger."]);
  13. }
  14. });
  15. }
  16. function Nerd() {
  17. GameObject.call(this, "Nerd");
  18. this.actions.push({
  19. "name": "Eat Nerd",
  20. "action": function() {
  21. startDialog(new EatDude());
  22. }
  23. });
  24. }
  25. function Toilet() {
  26. GameObject.call(this, "Toilet");
  27. this.actions.push({
  28. "name": "Admire toilet",
  29. "action": function() {
  30. update(["You admire the toilet."]);
  31. }
  32. });
  33. this.actions.push({
  34. "name": "Use toilet",
  35. "action": function() {
  36. let lines = [];
  37. lines.push("You sit down on the toilet.");
  38. if (player.bowels.fullness == 0) {
  39. lines.push("But nothing happens.");
  40. } else {
  41. lines.push("You grunt and clench, squeezing out the remains of your former prey.");
  42. player.bowels.fullness = 0;
  43. }
  44. if (player.bowels.contents.length > 0) {
  45. lines.push("The remains of " + join(player.bowels.contents) + " empty into the sewers as you flush them away.");
  46. }
  47. player.bowels.contents = [];
  48. update(lines);
  49. },
  50. "conditions": [
  51. function(prefs) {
  52. return prefs.scat == true;
  53. }
  54. ]
  55. });
  56. }
  57. function TV() {
  58. GameObject.call(this, "TV");
  59. this.actions.push({
  60. "name": "Watch TV",
  61. "action": function() {
  62. update(["Reruns, again."]);
  63. }
  64. });
  65. }
  66. function Phone() {
  67. GameObject.call(this, "Phone");
  68. this.actions.push({
  69. "name": "Use phone",
  70. "action": function() {
  71. startDialog(new PhoneCall());
  72. }
  73. });
  74. }
  75. function Bed() {
  76. GameObject.call(this, "Bed");
  77. this.actions.push({
  78. "name": "Sleep",
  79. "action": function() {
  80. update(["You take a nap."]);
  81. advanceTime(2700);
  82. updateDisplay();
  83. }
  84. });
  85. }
  86. function Sofa() {
  87. GameObject.call(this, "Sofa");
  88. this.actions.push({
  89. "name": "Sit on sofa",
  90. "action": function(){
  91. startDialog(SofaSit());
  92. }
  93. });
  94. }
  95. function NatureTrailExercise() {
  96. GameObject.call(this, "Exercise");
  97. this.actions.push({
  98. "name": "Exercise",
  99. "action": function() {
  100. startDialog(new NatureExercise());
  101. }
  102. });
  103. }
  104. function VendingMachine() {
  105. GameObject.call(this, "Vending Machine");
  106. this.actions.push({
  107. "name": "Use the vending machine",
  108. "action": function() {
  109. startDialog(new VendingMachinePurchase());
  110. }
  111. });
  112. }
  113. function WildernessExplore(natureTrail) {
  114. GameObject.call(this, "Explore the Wilderness");
  115. this.actions.push({
  116. "name": "Explore",
  117. "action": function() {
  118. let outcome = Math.random();
  119. advanceTime(60*15);
  120. if (outcome < 0.25) {
  121. moveToByName("Nature Trail", "You find your way back");
  122. } else if (outcome < 0.5) {
  123. startCombat(new Trance());
  124. } else {
  125. update(["You wander around for a bit, but haven't found anything."]);
  126. }
  127. }
  128. });
  129. }