munch
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 

90 lines
1.6 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. }
  34. function TV() {
  35. GameObject.call(this, "TV");
  36. this.actions.push({
  37. "name": "Watch TV",
  38. "action": function() {
  39. update(["Reruns, again."]);
  40. }
  41. });
  42. }
  43. function Phone() {
  44. GameObject.call(this, "Phone");
  45. this.actions.push({
  46. "name": "Use phone",
  47. "action": function() {
  48. startDialog(new PhoneCall());
  49. }
  50. });
  51. }
  52. function Bed() {
  53. GameObject.call(this, "Bed");
  54. this.actions.push({
  55. "name": "Sleep",
  56. "action": function() {
  57. update(["You take a nap."]);
  58. advanceTime(2700);
  59. updateDisplay();
  60. }
  61. });
  62. }
  63. function Sofa() {
  64. GameObject.call(this, "Sofa");
  65. this.actions.push({
  66. "name": "Sit on sofa",
  67. "action": function(){
  68. startDialog(SofaSit());
  69. }
  70. });
  71. }
  72. function NatureTrailExercise() {
  73. GameObject.call(this, "Exercise");
  74. this.actions.push({
  75. "name": "Exercise",
  76. "action": function() {
  77. startDialog(new NatureExercise());
  78. }
  79. });
  80. }