2024-01-25 18:57:49 +00:00
|
|
|
from nullptr.missions.base import MissionParam
|
|
|
|
from nullptr.missions.extraction import ExtractionMission
|
2024-01-20 19:33:50 +00:00
|
|
|
from nullptr.models.waypoint import Waypoint
|
|
|
|
|
2024-01-25 18:57:49 +00:00
|
|
|
class SiphonMission(ExtractionMission):
|
2024-01-20 19:33:50 +00:00
|
|
|
def start_state(self):
|
|
|
|
return 'travel-to'
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def params(cls):
|
|
|
|
return {
|
|
|
|
'site': MissionParam(Waypoint, True),
|
|
|
|
}
|
2024-01-21 19:21:38 +00:00
|
|
|
|
|
|
|
def step_siphon(self):
|
|
|
|
result = self.api.siphon(self.ship)
|
|
|
|
self.next_step = self.ship.cooldown
|
|
|
|
if self.ship.cargo_space() > 5:
|
|
|
|
return 'more'
|
|
|
|
else:
|
|
|
|
return 'full'
|
2024-01-25 18:57:49 +00:00
|
|
|
|
2024-01-20 19:33:50 +00:00
|
|
|
|
|
|
|
def steps(self):
|
|
|
|
return {
|
|
|
|
**self.travel_steps('to', 'site', 'siphon'),
|
2024-01-21 19:21:38 +00:00
|
|
|
'siphon': (self.step_siphon, {
|
|
|
|
'more': 'siphon',
|
|
|
|
'full': 'unload'
|
|
|
|
}),
|
|
|
|
'unload': (self.step_unload, {
|
|
|
|
'more': 'unload',
|
|
|
|
'done': 'done'
|
|
|
|
})
|
2024-01-20 19:33:50 +00:00
|
|
|
}
|
|
|
|
|
2024-01-21 19:21:38 +00:00
|
|
|
|
2024-01-20 19:33:50 +00:00
|
|
|
|