コード例 #1
0
    def custom_init(self, nart):
        # Add the interior scene.
        team1 = teams.Team(name="Player Team")
        team2 = teams.Team(name="Civilian Team",
                           faction=self.elements["METRO_FACTION"])
        intscene = gears.GearHeadScene(
            35,
            35,
            "Fallout Shelter",
            player_team=team1,
            civilian_team=team2,
            attributes=(gears.tags.SCENE_PUBLIC, gears.tags.SCENE_BUILDING,
                        gears.tags.SCENE_GOVERNMENT, gears.tags.SCENE_RUINS),
            scale=gears.scale.HumanScale)
        intscenegen = pbge.randmaps.SceneGenerator(
            intscene, gharchitecture.DefaultBuilding())
        self.register_scene(nart,
                            intscene,
                            intscenegen,
                            ident="INTERIOR",
                            dident="LOCALE")
        foyer = self.register_element(
            '_introom',
            pbge.randmaps.rooms.ClosedRoom(
                anchor=pbge.randmaps.anchors.south, ),
            dident="INTERIOR")

        mycon2 = plotutility.TownBuildingConnection(
            self,
            self.elements["LOCALE"],
            intscene,
            room2=foyer,
            door1=ghwaypoints.UndergroundEntrance(name="Fallout Shelter"))

        npc = self.register_element(
            "LEADER",
            gears.selector.random_character(
                self.rank,
                local_tags=self.elements["LOCALE"].attributes,
                job=gears.jobs.ALL_JOBS["Mayor"],
                faction=self.elements["METRO_FACTION"]))
        npc.place(intscene, team=team2)

        self.town_origin_ready = True

        bodyguard = self.register_element(
            "BODYGUARD",
            gears.selector.random_character(
                self.rank,
                local_tags=self.elements["LOCALE"].attributes,
                job=gears.jobs.choose_random_job(
                    (gears.tags.Adventurer, ),
                    self.elements["LOCALE"].attributes),
                faction=self.elements["METRO_FACTION"]))
        bodyguard.place(intscene, team=team2)

        return True
コード例 #2
0
    def custom_init(self, nart):
        # Create the shopkeeper
        npc1 = self.register_element("SHOPKEEPER", gears.selector.random_character(
            self.rank, job=gears.jobs.ALL_JOBS["Bartender"]))

        self.shopname = self._generate_shop_name()

        # Create a building within the dungeon.
        building = self.register_element(
            "_EXTERIOR", ghterrain.BrickBuilding(
                waypoints={"DOOR": ghwaypoints.WoodenDoor(name=self.shopname)},
                door_sign=(ghterrain.CafeSign1East, ghterrain.CafeSign1South)
            ),
            dident="LOCALE")

        # Add the interior scene.
        team1 = teams.Team(name="Player Team")
        team2 = teams.Team(name="Civilian Team")
        intscene = gears.GearHeadScene(
            35, 35, self.shopname, player_team=team1, civilian_team=team2,
            attributes=(gears.tags.SCENE_SEMIPUBLIC, gears.tags.SCENE_BUILDING, gears.tags.SCENE_CULTURE),
            scale=gears.scale.HumanScale)

        intscenegen = pbge.randmaps.PackedBuildingGenerator(
            intscene, gharchitecture.DefaultBuilding(floor_terrain=ghterrain.HardwoodFloor)
        )
        self.register_scene(nart, intscene, intscenegen, ident="INTERIOR", dident="LOCALE")
        foyer = self.register_element('FOYER', pbge.randmaps.rooms.ClosedRoom(width=random.randint(20, 25),
                                                                              height=random.randint(11, 15),
                                                                              anchor=pbge.randmaps.anchors.south),
                                      dident="INTERIOR")

        mybar = ghrooms.BarArea(random.randint(5, 10), random.randint(2, 3), anchor=pbge.randmaps.anchors.north)
        foyer.contents.append(mybar)

        barteam = self.register_element("BAR_TEAM", teams.Team(name="Bar Team", allies=[team2]))
        mybar.contents.append(barteam)
        npc1.place(intscene, team=barteam)

        myfloor = pbge.randmaps.rooms.Room(foyer.width - 2, foyer.height - mybar.height - 2,
                                           anchor=pbge.randmaps.anchors.south,
                                           decorate=gharchitecture.RestaurantDecor())
        foyer.contents.append(myfloor)

        mycon2 = plotutility.TownBuildingConnection(
            nart, self, self.elements["LOCALE"], intscene, room1=building,
            room2=foyer, door1=building.waypoints["DOOR"], move_door1=False)

        self.got_explanation = False
        self.coffee_price = self.rank * 10

        return True
コード例 #3
0
    def custom_init(self, nart):
        # Add the interior scene.
        team1 = teams.Team(name="Player Team")
        team2 = teams.Team(name="Guild Team")
        intscene = gears.GearHeadScene(
            35,
            35,
            self.elements.get("GUILD_NAME", self._generate_guild_name()),
            player_team=team1,
            civilian_team=team2,
            faction=self.elements.get("FACTION"),
            attributes=self.elements.get("INTERIOR_TAGS",
                                         (gears.tags.SCENE_SEMIPUBLIC, )) +
            (gears.tags.SCENE_BUILDING, gears.tags.Criminal),
            scale=gears.scale.HumanScale)

        intscenegen = pbge.randmaps.SceneGenerator(
            intscene, gharchitecture.DefaultBuilding())
        self.register_scene(nart,
                            intscene,
                            intscenegen,
                            ident="INTERIOR",
                            dident="LOCALE")
        foyer = self.register_element('_introom',
                                      pbge.randmaps.rooms.ClosedRoom(
                                          10,
                                          10,
                                          anchor=pbge.randmaps.anchors.south),
                                      dident="INTERIOR")
        foyer.contents.append(team2)

        exit = self.register_element("EXIT",
                                     ghwaypoints.Exit(
                                         name="Exit",
                                         dest_wp=self.elements["ENTRANCE"],
                                         anchor=pbge.randmaps.anchors.south),
                                     dident="_introom")

        # Add some ne'er do wells
        for t in range(random.randint(2, 4)):
            npc = gears.selector.random_character(
                self.rank,
                combatant=True,
                local_tags=intscene.attributes,
                needed_tags=(gears.tags.Criminal, ))
            npc.place(intscene, team=team2)

        self.add_sub_plot(nart, "TGUILD_SERVICE")

        return True
コード例 #4
0
ファイル: utility.py プロジェクト: xordspar0/gearhead-caramel
    def custom_init( self, nart ):
        # Add the interior scene.
        team1 = teams.Team(name="Player Team")
        team2 = teams.Team(name="Civilian Team")
        intscene = gears.GearHeadScene(35, 35, "{} Base".format(self.elements["FACTION"]), player_team=team1,
                                       civilian_team=team2, scale=gears.scale.HumanScale, faction=self.elements["FACTION"])
        intscenegen = pbge.randmaps.SceneGenerator(intscene, gharchitecture.DefaultBuilding())
        self.register_scene(nart, intscene, intscenegen, ident="INTERIOR")

        foyer = self.register_element('_introom', pbge.randmaps.rooms.ClosedRoom(anchor=pbge.randmaps.anchors.south,),
                                    dident="INTERIOR")
        foyer.contents.append(team2)
        # Add the NPCs.
        team2.contents.append(gears.selector.random_character(self.rank+10,job=self.elements["FACTION"].choose_job(gears.tags.Commander),combatant=True,faction=self.elements["FACTION"]))
        team2.contents.append(gears.selector.random_character(self.rank+5,job=self.elements["FACTION"].choose_job(gears.tags.Support),combatant=True,faction=self.elements["FACTION"]))
        team2.contents.append(gears.selector.random_character(self.rank,faction=self.elements["FACTION"],
                                                                  job=self.elements["FACTION"].choose_job(
                                                                      gears.tags.Trooper), combatant=True))

        return True
コード例 #5
0
    def custom_init(self, nart):
        # Create a building within the town.
        building = self.register_element(
            "_EXTERIOR",
            ghterrain.BrickBuilding(
                waypoints={
                    "DOOR": ghwaypoints.ScrapIronDoor(name="Town Hall")
                },
                tags=[pbge.randmaps.CITY_GRID_ROAD_OVERLAP]),
            dident="LOCALE")

        # Add the interior scene.
        team1 = teams.Team(name="Player Team")
        team2 = teams.Team(name="Civilian Team",
                           faction=self.elements["METRO_FACTION"])
        intscene = gears.GearHeadScene(
            35,
            35,
            "Town Hall",
            player_team=team1,
            civilian_team=team2,
            attributes=(gears.tags.SCENE_PUBLIC, gears.tags.SCENE_BUILDING,
                        gears.tags.SCENE_GOVERNMENT),
            scale=gears.scale.HumanScale)
        intscenegen = pbge.randmaps.SceneGenerator(
            intscene,
            gharchitecture.DefaultBuilding(
                floor_terrain=ghterrain.WhiteTileFloor))
        self.register_scene(nart,
                            intscene,
                            intscenegen,
                            ident="INTERIOR",
                            dident="LOCALE")
        foyer = self.register_element(
            '_introom',
            pbge.randmaps.rooms.ClosedRoom(
                anchor=pbge.randmaps.anchors.south, ),
            dident="INTERIOR")

        mycon2 = plotutility.TownBuildingConnection(
            self,
            self.elements["LOCALE"],
            intscene,
            room1=building,
            room2=foyer,
            door1=building.waypoints["DOOR"],
            move_door1=False)

        npc = self.register_element(
            "LEADER",
            gears.selector.random_character(
                self.rank,
                local_tags=self.elements["LOCALE"].attributes,
                job=gears.jobs.ALL_JOBS["Technocrat"],
                faction=self.elements["METRO_FACTION"]))
        npc.place(intscene, team=team2)

        self.town_origin_ready = True

        bodyguard = self.register_element(
            "BODYGUARD",
            gears.selector.random_character(
                self.rank,
                local_tags=self.elements["LOCALE"].attributes,
                job=gears.jobs.choose_random_job(
                    (gears.tags.Adventurer, ),
                    self.elements["LOCALE"].attributes),
                faction=self.elements["METRO_FACTION"]))
        bodyguard.place(intscene, team=team2)

        return True
コード例 #6
0
    def custom_init(self, nart):
        hallfaction = self.elements.get(
            "HALL_FACTION") or self.elements["LOCALE"].faction
        self.elements["HALL_FACTION"] = hallfaction

        deffaction = self.elements.get(
            "DEFENSE_FACTION") or self._get_defense_faction(nart, hallfaction)
        self.elements["DEFENSE_FACTION"] = deffaction

        # Create the leader
        npc1 = self.register_element(
            "LEADER",
            gears.selector.random_character(
                self.rank,
                local_tags=self.elements["LOCALE"].attributes,
                faction=hallfaction,
                job=self._get_leader_job(hallfaction)))
        npc1.name = self.elements.get("LEADER_NAME", "") or npc1.name
        if not self.elements.get("NOT_METRO_LEADER"):
            self.elements["METRO"].city_leader = npc1

        self._hallname = self.elements.get("HALL_NAME",
                                           "") or self._generate_hall_name()

        # Create a building within the town.
        building = self.register_element(
            "_EXTERIOR",
            get_building(
                self,
                ghterrain.BrickBuilding,
                waypoints={"DOOR": ghwaypoints.GlassDoor(name=self._hallname)},
                door_sign=(ghterrain.GoldTownHallSignEast,
                           ghterrain.GoldTownHallSignSouth),
                tags=[
                    pbge.randmaps.CITY_GRID_ROAD_OVERLAP,
                    pbge.randmaps.IS_CITY_ROOM, pbge.randmaps.IS_CONNECTED_ROOM
                ]),
            dident="LOCALE")

        # Add the interior scene.
        team1 = teams.Team(name="Player Team")
        team2 = teams.Team(name="Civilian Team")
        intscene = gears.GearHeadScene(
            35,
            35,
            self._hallname,
            player_team=team1,
            civilian_team=team2,
            faction=self.elements.get("HALL_FACTION"),
            attributes=self.elements.get("INTERIOR_TAGS",
                                         (gears.tags.SCENE_PUBLIC, )) +
            (gears.tags.SCENE_BUILDING, gears.tags.SCENE_GOVERNMENT),
            scale=gears.scale.HumanScale)

        intscenegen = pbge.randmaps.PackedBuildingGenerator(
            intscene,
            gharchitecture.DefaultBuilding(wall_terrain=ghterrain.DefaultWall))
        self.register_scene(nart,
                            intscene,
                            intscenegen,
                            ident="INTERIOR",
                            dident="LOCALE")

        foyer = self.register_element(
            'FOYER',
            pbge.randmaps.rooms.ClosedRoom(anchor=pbge.randmaps.anchors.south),
            dident="INTERIOR")
        team3 = self.register_element("FOYER_TEAM",
                                      teams.Team("Foyer Team",
                                                 allies=(team2, )),
                                      dident="FOYER")

        mycon2 = plotutility.TownBuildingConnection(
            nart,
            self,
            self.elements["LOCALE"],
            intscene,
            room1=building,
            room2=foyer,
            door1=building.waypoints["DOOR"],
            move_door1=False)

        npc1.place(intscene, team=team2)

        self.add_sub_plot(nart, "TOWNHALL_DEFENDER")

        return True