asteroid-field.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. rooms.push({
  2. id: "asteroid-field",
  3. name: "Asteroid Field",
  4. description: "A seemingly-endless black void filled with spinning iron boulders.",
  5. play: "asteroid-field",
  6. actions: [
  7. 'store-solar',
  8. 'unfurl-solar',
  9. 'activate-ion-engine',
  10. 'activate-ramjet',
  11. 'disable-ion-engine',
  12. 'disable-ramjet',
  13. 'mine',
  14. ],
  15. doors: [
  16. {
  17. id: "nearby-outpost", button: "Travel to Station", action: "Traveling", requires: () => {
  18. let enoughFuel = userData.fuel > 0;
  19. if (!enoughFuel) { errorMessage = "insufficient fuel for a return trip"; }
  20. return enoughFuel;
  21. },
  22. start: () => {
  23. play('travel-left');
  24. },
  25. run: () => {
  26. userData.fuel--;
  27. userData.position = "nearby-outpost";
  28. }, duration: 4000
  29. }
  30. ],
  31. viewable: [
  32. {elementId: 'actions', data: {}},
  33. {elementId: 'doors', data: {}},
  34. {elementId: 'put-in-inventory', data: { action: "harvest", button: "Gather Debris", source: () => userData.debrisInSpace } },
  35. {elementId: 'asteroid-field', data: {}},
  36. {elementId: 'room-description', data: {}},
  37. ],
  38. });