munch
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

148 lines
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. }
  43. if (player.bowels.contents.length > 0) {
  44. lines.push("The remains of " + join(player.bowels.contents) + " empty into the sewers as you flush them away.");
  45. }
  46. player.bowels.contents = [];
  47. update(lines);
  48. },
  49. "conditions": [
  50. function(prefs) {
  51. return prefs.scat == true;
  52. }
  53. ]
  54. });
  55. }
  56. function TV() {
  57. GameObject.call(this, "TV");
  58. this.actions.push({
  59. "name": "Watch TV",
  60. "action": function() {
  61. update(["Reruns, again."]);
  62. }
  63. });
  64. }
  65. function Phone() {
  66. GameObject.call(this, "Phone");
  67. this.actions.push({
  68. "name": "Use phone",
  69. "action": function() {
  70. startDialog(new PhoneCall());
  71. }
  72. });
  73. }
  74. function Bed() {
  75. GameObject.call(this, "Bed");
  76. this.actions.push({
  77. "name": "Sleep",
  78. "action": function() {
  79. update(["You take a nap."]);
  80. advanceTime(2700);
  81. updateDisplay();
  82. }
  83. });
  84. }
  85. function Sofa() {
  86. GameObject.call(this, "Sofa");
  87. this.actions.push({
  88. "name": "Sit on sofa",
  89. "action": function(){
  90. startDialog(SofaSit());
  91. }
  92. });
  93. }
  94. function NatureTrailExercise() {
  95. GameObject.call(this, "Exercise");
  96. this.actions.push({
  97. "name": "Exercise",
  98. "action": function() {
  99. startDialog(new NatureExercise());
  100. }
  101. });
  102. }
  103. function VendingMachine() {
  104. GameObject.call(this, "Vending Machine");
  105. this.actions.push({
  106. "name": "Use the vending machine",
  107. "action": function() {
  108. startDialog(new VendingMachinePurchase());
  109. }
  110. });
  111. }
  112. function WildernessExplore(natureTrail) {
  113. GameObject.call(this, "Explore the Wilderness");
  114. this.actions.push({
  115. "name": "Explore",
  116. "action": function() {
  117. let outcome = Math.random();
  118. advanceTime(60*15);
  119. if (outcome < 0.25) {
  120. moveToByName("Nature Trail", "You find your way back");
  121. } else if (outcome < 0.5) {
  122. startCombat(new Trance());
  123. } else {
  124. update(["You wander around for a bit, but haven't found anything."]);
  125. }
  126. }
  127. });
  128. }