nearby-outpost.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. rooms.push({
  2. id: "nearby-outpost",
  3. name: "Nearby Station",
  4. description: "Nestled close to a dilapidated mining outpost, surrounded by an endless black void.",
  5. play: "nearby-outpost",
  6. actions: [
  7. 'store-solar',
  8. 'unfurl-solar',
  9. 'activate-ion-engine',
  10. 'activate-ramjet',
  11. 'disable-ion-engine',
  12. 'disable-ramjet',
  13. ],
  14. doors: [
  15. {
  16. id: "mining-outpost",
  17. button: "Dock",
  18. action: "Docking",
  19. requires: () => true,
  20. start: () => {
  21. receiveMessage({name:"[Station Tower]", id:-1, style: "station"}, "Acknowledged "+userData.name+". You are cleared to dock.");
  22. play('dock-with-station');
  23. },
  24. run: () => { userData.position = "mining-outpost"; },
  25. duration: 2000
  26. },
  27. {
  28. id: "asteroid-field",
  29. button: "Travel to Asteroid Field",
  30. action: "Traveling",
  31. requires: () => {
  32. let enoughFuel = userData.fuel > 1;
  33. if (!enoughFuel) { errorMessage = "insufficient fuel for a return trip"; }
  34. return enoughFuel;
  35. },
  36. start: () => {
  37. play('travel-right')
  38. },
  39. run: () => {
  40. userData.fuel--;
  41. userData.position = "asteroid-field";
  42. },
  43. duration: 4000
  44. }
  45. ],
  46. viewable: [
  47. {elementId: 'actions', data: {}},
  48. {elementId: 'doors', data: {}},
  49. {elementId: 'room-description', data: {}},
  50. ]
  51. });