Пример #1
0
 def starting_inv(self,inv):
     inv.add(Items.Placeable(Basic.Furnace))
     inv.add(Items.Placeable(Production.Miner))
     inv.add(Items.Placeable(Vehicles.Boat))
     inv.add(Items.Placeable(Boxes.StdBox))
     inv.add(Items.Placeable(Basic.Generator))
     inv.add(Items.Placeable(Basic.Electrolyser))
Пример #2
0
        self.crop = Agriculture.crops[args[0]]

    def update(self, pos, area, events):
        if self.crops:
            if not randint(0, self.crop.gspeed // 25):
                tpos, ch = choice(list(self.crops.items()))
                if ch:
                    if not ch.exists:
                        self.crops[tpos] = None
                    elif ch.growth < ch.max_g:
                        ch.growth += 1
                    elif self.add_output(ch.mined()):
                        ch.growth = ch.harvest_state
        elif self.crop:
            self.init_crops(area, pos)
        super().update(pos, area, events)

    def on_dest(self, area, pos):
        if self.crops:
            for tpos, crop in self.crops.items():
                if crop:
                    crop.bound = None
                    area.ups.add((tpos, crop))


Registry.add_recipe({"Iron": 4, "Gear": 2}, Items.Placeable(Miner))
Research.add_recipesearch({
    "Copper": 8,
    "Gear": 4
}, Items.Placeable(Farmer), [1], 20)
Пример #3
0
 def mined(self):
     return Items.Placeable(self.__class__)
Пример #4
0
                        area.create_exp(pos, 1, "Cross", 1)
            else:
                self.state = "Taxi"
        elif self.player:
            j = self.player.j
            if not self.mprog:
                buttons = j.get_buttons(events)
                if buttons[1]:
                    if area.move(self.player, pos, self.lv, True, 64):
                        self.player.vehicle = None
                        self.player = None
                        self.team = None
                        return
                elif buttons[0]:
                    self.state = "Takeoff"
                for v in j.get_dirs():
                    self.lv = v
                    if area.move(self, pos, v):
                        break
                else:
                    rs = j.get_rstick()
                    if rs:
                        self.lv = rs


Registry.add_recipe({"Log": 10}, Items.Placeable(Boat))
Research.add_recipesearch({
    "Steel": 5,
    "Furnace": 1
}, Items.Placeable(Plane), [1], 30)
Пример #5
0
        Object.__init__(self, c)
        self.dummy = EntangledDummy(self)
        self.area = Area(self.internalsize, self.gen, self.dummy)

    def in_warp(self, d):
        hb = self.area.bounds // 2
        return Coordinate(self.area, hb - d * hb - V(bool(d.y), bool(d.x)))


class EntangledBox2(Box):
    img = Img.imgstripxf("Buildings/EntangledBox")[1]

    def __init__(self, c, a, d):
        Object.__init__(self, c)
        self.area = a
        self.dummy = d
        self.dummy.es.append(self)

    def update(self, pos, area, events):
        if not self.dummy.es[0].exists:
            super().update(pos, area, events)
        else:
            self.area.generate(area.get_power)

    def in_warp(self, d):
        hb = self.area.bounds // 2
        return Coordinate(self.area, hb - d * hb + V(bool(d.y), bool(d.x)))


Registry.add_recipe({"Steel": 4, "ChaosCrystal": 1}, Items.Placeable(StdBox))
Пример #6
0
 def mined(self):
     return Items.ObjPlaceable(self) if self.gui else Items.Placeable(self.__class__)