26 lines
643 B
Python
26 lines
643 B
Python
|
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
|