begin-pickup.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. rooms.push({
  2. id: "begin-pickup",
  3. name: "Sector 12",
  4. description: "A seemingly-endless black void, far enough away from any territories to be detected.",
  5. play: "begin-pickup",
  6. actions: [],
  7. doors: [],
  8. viewable: [
  9. {elementId: 'put-in-inventory', data: { action: "begin-cargo-pickup", button: "Pickup Cargo", source: () => {
  10. let beginCargo = [];
  11. if(!isFlagEnabled('begin-cargo-aboard')) {
  12. beginCargo.push(new Item(1, "contraband", "Suspicious Cargo"));
  13. beginCargo.push(new Item(1, "contraband", "Suspicious Cargo"));
  14. beginCargo.push(new Item(1, "contraband", "Suspicious Cargo"));
  15. }
  16. return beginCargo;
  17. }
  18. }},
  19. {elementId: 'room-description', data: {}},
  20. ],
  21. enter: () => {
  22. if(!isFlagEnabled('begin-cargo-aboard')) {
  23. clearFlag('begin-cargo-requested');
  24. userData.inCargoHold = [];
  25. setTimeout(() => {
  26. receiveMessage({name: "[mysterious signal]", id: -1, style: "dark"}, "Aha. I see you've found the cargo.");
  27. }, 5000);
  28. setTimeout(() => {
  29. receiveMessage({name: "[mysterious signal]", id: -1, style: "dark"}, "Go ahead and select all 3 and bring them aboard.");
  30. setFlag('begin-cargo-requested');
  31. }, 8000);
  32. }
  33. }
  34. });