0ptr/nullptr/missions/siphon.py

26 lines
643 B
Python
Raw Normal View History

2024-01-20 19:33:50 +00:00
from nullptr.missions.base import BaseMission, MissionParam
from nullptr.models.waypoint import Waypoint
class SiphonMission(BaseMission):
def start_state(self):
return 'travel-to'
@classmethod
def params(cls):
return {
'site': MissionParam(Waypoint, True),
}
def steps(self):
return {
**self.travel_steps('to', 'site', 'siphon'),
'siphon': (self.step_siphon, 'done', self.cargo_full)
}
def cargo_full(self):
return self.ship.cargo_capacity - self.ship.cargo_units > 5
def step_siphon(self):
result = self.api.siphon(self.ship)
self.next_step = self.ship.cooldown