def in_slf(self): self._touch() if not self.mothership or not self.mothership.supports_slf(): self.mothership = EDVehicleFactory.unknown_vehicle() if not self.slf: self.slf = EDVehicleFactory.unknown_slf() self.piloted_vehicle = self.slf
def in_srv(self): self._touch() if not self.mothership or not self.mothership.supports_srv(): self.mothership = EDVehicleFactory.unknown_vehicle() if not self.srv: self.srv = EDVehicleFactory.default_srv() self.piloted_vehicle = self.srv
def leave_vehicle(self): self.mothership = EDVehicleFactory.unknown_vehicle() self.piloted_vehicle = self.mothership self.slf = None self.srv = None self.instance.reset() self.recon_box.reset() self._touch()
def join_crew(self, captain): self.wing = EDWing() self.instance.reset() self.crew = EDRCrew(captain) self.crew.add(self.name) self.instanced(captain) self.mothership = EDVehicleFactory.unknown_vehicle() self.piloted_vehicle = self.mothership self.slf = None self.srv = None self._touch()
def update_vehicle_if_obsolete(self, vehicle, piloted=True): if vehicle is None: return False updated = False if EDVehicleFactory.is_ship_launched_fighter(vehicle): updated = self.__update_slf_if_obsolete(vehicle) if not self.mothership.supports_slf(): self.mothership = EDVehicleFactory.unknown_vehicle() if piloted: self.piloted_vehicle = self.slf elif EDVehicleFactory.is_surface_vehicle(vehicle): updated = self.__update_srv_if_obsolete(vehicle) if not self.mothership.supports_srv(): self.mothership = EDVehicleFactory.unknown_vehicle() if piloted: self.piloted_vehicle = self.srv else: updated = self.__update_mothership_if_obsolete(vehicle) if piloted: self.piloted_vehicle = self.mothership if updated: self._touch() return updated
def __init__(self, name=None): now = EDTime.py_epoch_now() self._name = name self.mothership = EDVehicleFactory.unknown_vehicle() self.piloted_vehicle = self.mothership self.srv = None self.slf = None self.location = EDLocation() self.powerplay = EDRPowerplayUnknown() self.squadron = None self.sqid = None self.destroyed = False self.wanted = False self.enemy = False self._bounty = None self._fine = None self.targeted = False self.timestamp = now
def inception(self, genesis=False): if genesis: self.from_genesis = True self.previous_mode = None self.previous_wing = set() self.wing = EDWing() self.crew = None self.destroyed = False self.target = None self.wanted = False self.mothership = EDVehicleFactory.unknown_vehicle() self.piloted_vehicle = self.mothership self.srv = None self.slf = None self.location = EDLocation() self._bounty = None self.instance.reset() self.to_normal_space() self._touch() self.reset_mining_stats()
def resurrect(self, rebought=True): self.game_mode = self.previous_mode self.private_group = self.previous_private_group self.wing = EDWing(self.previous_wing) self.previous_mode = None self.previous_wing = set() self.destroyed = False self.target = None self.to_normal_space() self.instance.reset() self._touch() if rebought: self.mothership.reset() if self.slf: self.slf.reset() if self.srv: self.srv.reset() else: self.mothership = EDVehicleFactory.unknown_vehicle() self.piloted_vehicle = self.mothership self.slf = None self.srv = None
def in_mothership(self): self._touch() if not self.mothership: self.mothership = EDVehicleFactory.unknown_vehicle() self.piloted_vehicle = self.mothership