unfurl-solar.js 610 B

1234567891011121314151617
  1. states.push({
  2. id: "unfurl-solar",
  3. button: "Unfurl the Solar Array",
  4. action: "Extending Array",
  5. duration: 1200,
  6. show: () => isFlagEnabled('solar-array-purchased') && !isFlagEnabled('solar-enabled'),
  7. requires: () => {
  8. if (isFlagEnabled('solar-enabled')) { errorMessage = "Solar panels already unfurled"; }
  9. if(userData.position == "asteroid-field") { errorMessage = "Too dangerous to activate here";}
  10. return !isFlagEnabled('solar-enabled') && userData.position != "asteroid-field";
  11. },
  12. run: () => {
  13. userData.energyRegenRate = 1;
  14. userData.energyRegenAmount = 2;
  15. setFlag('solar-enabled');
  16. },
  17. });