def __init__(self, name, spec, built=False): super(Base, self).__init__(spec) self._name = name self.started_at = g.pl.raw_min self.location = None self.raw_cpu = 0 self.cpu = 0 self.items = { "cpu": None, "reactor": None, "network": None, "security": None, } self._power_state = "offline" self.grace_over = False self.maintenance = buyable.array(self.spec.maintenance, int64) if built: self.finish(is_player=False) if self.spec.force_cpu: self.cpus = item.Item(g.items[self.spec.force_cpu], base=self, count=self.spec.size) self.cpus.finish(is_player=False)
def describe_maintenance(self, maintenance): m = buyable.array(maintenance, int64) # describe_cost() expects CPU-seconds, not CPU-days m[cpu] *= g.seconds_per_day return self.describe_cost(m, True)