def custom_init( self, nart ):
        myscene = self.elements["LOCALE"]
        myroom = self.register_element("ROOM",pbge.randmaps.rooms.FuzzyRoom(10,10),dident="LOCALE")
        myfac = self.elements.get("ENEMY_FACTION")
        team2 = self.register_element("_eteam",teams.Team(enemies=(myscene.player_team,)),dident="ROOM")

        mynpc = self.seek_element(nart,"_commander",self._npc_is_good,must_find=False,lock=True)
        if mynpc:
            plotutility.CharacterMover(self,mynpc,myscene,team2)
            myunit = gears.selector.RandomMechaUnit(self.rank, 120, myfac, myscene.environment, add_commander=False)
        else:
            myunit = gears.selector.RandomMechaUnit(self.rank, 150, myfac, myscene.environment, add_commander=True)
            self.register_element("_commander",myunit.commander)

        team2.contents += myunit.mecha_list

        team3 = self.register_element("_cargoteam",teams.Team(),dident="ROOM")
        team3.contents += game.content.plotutility.CargoContainer.generate_cargo_fleet(self.rank)
        # Oh yeah, when using PyCharm, why not use ludicrously long variable names?
        self.starting_number_of_containers = len(team3.contents)

        self.obj = adventureseed.MissionObjective("Investigate the meteor", missionbuilder.MAIN_OBJECTIVE_VALUE * 2 )
        self.adv.objectives.append(self.obj)
        self.combat_entered = False
        self.combat_finished = False

        return True
Exemplo n.º 2
0
    def custom_init(self, nart):
        team1 = teams.Team(name="Player Team")
        team2 = teams.Team(name="Civilian Team", allies=(team1, ))
        myscene = gears.GearHeadScene(50,
                                      50,
                                      "DZ Village",
                                      player_team=team1,
                                      civilian_team=team2,
                                      scale=gears.scale.HumanScale,
                                      attributes=(gears.personality.DeadZone,
                                                  gears.tags.Village))
        myscene.exploration_music = 'Doctor_Turtle_-_04_-_Lets_Just_Get_Through_Christmas.ogg'

        npc = gears.selector.random_character(50,
                                              local_tags=myscene.attributes)
        npc.place(myscene, team=team2)

        myscenegen = pbge.randmaps.SceneGenerator(
            myscene, game.content.gharchitecture.HumanScaleDeadzone())

        self.register_scene(nart, myscene, myscenegen, ident="LOCALE")

        #myscene.contents.append(ghterrain.ScrapIronBuilding(waypoints={"DOOR":ghwaypoints.ScrapIronDoor(),"OTHER":ghwaypoints.RetroComputer()}))

        wm_con = game.content.plotutility.WMDZTownConnection(
            self, self.elements["WORLD"], myscene)
        wm_con.room1.tags = (ON_THE_ROAD, )

        return True
Exemplo n.º 3
0
    def custom_init( self, nart ):
        """An empty map that will add subplots for the mission's objectives."""
        team1 = teams.Team(name="Player Team")
        myscene = gears.GearHeadScene(
            40,40,"Combat Zone",player_team=team1,scale=gears.scale.MechaScale,
            exploration_music='A wintertale.ogg', combat_music='Chronos.ogg',
        )
        myscenegen = pbge.randmaps.SceneGenerator(myscene, game.content.gharchitecture.MechaScaleSemiDeadzone())
        self.register_scene( nart, myscene, myscenegen, ident="LOCALE", temporary=True)

        player_a,enemy_a = random.choice(pbge.randmaps.anchors.OPPOSING_PAIRS)

        self.register_element("_EROOM",pbge.randmaps.rooms.OpenRoom(5,5,anchor=player_a),dident="LOCALE")
        myent = self.register_element( "ENTRANCE", game.content.ghwaypoints.Waypoint(anchor=pbge.randmaps.anchors.middle), dident="_EROOM")

        enemy_room = self.register_element("ENEMY_ROOM",game.content.ghrooms.MSRuinsRoom(15,15,anchor=enemy_a),dident="LOCALE")
        team2 = self.register_element("_eteam",teams.Team(enemies=(myscene.player_team,)),dident="ENEMY_ROOM")
        myunit = gears.selector.RandomMechaUnit(level=10,strength=50,fac=self.elements.get("ENEMY_FACTION", None),env=myscene.environment)
        team2.contents += myunit.mecha_list
        enemy_room.contents.append(ghwaypoints.SmokingWreckage())
        enemy_room.contents.append(ghwaypoints.SmokingWreckage())
        enemy_room.contents.append(ghterrain.DZDConcreteBuilding)

        self.mission_entrance = (myscene,myent)
        self.started_the_intro = False

        self.tiles_moved = 0
        self.move_tutorial_done = False
        self.threat_tutorial_done = False
        self.combat_tutorial_done = False

        return True
Exemplo n.º 4
0
    def custom_init(self, nart):
        myscene = self.elements["LOCALE"]
        roomtype = self.elements["ARCHITECTURE"].get_a_room()
        myroom = self.register_element("ROOM",
                                       roomtype(10, 10),
                                       dident="LOCALE")
        team2 = self.register_element(
            "_eteam",
            teams.Team(enemies=(myscene.player_team, )),
            dident="ROOM")
        myunit = gears.selector.RandomMechaUnit(
            self.rank,
            100,
            self.elements.get("ENEMY_FACTION"),
            myscene.environment,
            add_commander=True)
        team2.contents += myunit.mecha_list

        team3 = self.register_element("_propteam", teams.Team(), dident="ROOM")
        for t in range(random.randint(1, 2 + self.rank // 25)):
            team3.contents.append(
                gears.selector.get_design_by_full_name("Concrete Building"))
        # Oh yeah, when using PyCharm, why not use ludicrously long variable names?
        self.starting_number_of_props = len(team3.contents)

        self.obj = adventureseed.MissionObjective("Capture the buildings",
                                                  MAIN_OBJECTIVE_VALUE)
        self.adv.objectives.append(self.obj)
        self.combat_entered = False
        self.combat_finished = False

        return True
Exemplo n.º 5
0
    def custom_init(self, nart):
        myscene = self.elements["LOCALE"]
        myroom = self.register_element("ROOM",
                                       pbge.randmaps.rooms.FuzzyRoom(10, 10),
                                       dident="LOCALE")
        team2 = self.register_element(
            "_eteam",
            teams.Team(enemies=(myscene.player_team, )),
            dident="ROOM")
        myunit = gears.selector.RandomMechaUnit(
            self.rank,
            120,
            self.elements.get("ENEMY_FACTION"),
            myscene.environment,
            add_commander=False)
        team2.contents += myunit.mecha_list

        team3 = self.register_element("_cargoteam",
                                      teams.Team(),
                                      dident="ROOM")
        team3.contents += game.content.plotutility.CargoContainer.generate_cargo_fleet(
            self.rank)
        # Oh yeah, when using PyCharm, why not use ludicrously long variable names?
        self.starting_number_of_containers = len(team3.contents)

        self.obj = adventureseed.MissionObjective(
            "Respond to convoy distress call", MAIN_OBJECTIVE_VALUE)
        self.adv.objectives.append(self.obj)
        self.combat_entered = False
        self.combat_finished = False

        return True
    def custom_init(self, nart):
        myscene = self.elements["LOCALE"]
        roomtype = self.elements["ARCHITECTURE"].get_a_room()
        self.register_element("ROOM",
                              roomtype(15,
                                       15,
                                       anchor=pbge.randmaps.anchors.middle),
                              dident="LOCALE")

        team2 = self.register_element(
            "_eteam",
            teams.Team(enemies=(myscene.player_team, )),
            dident="ROOM")

        self.cetus: gears.base.Monster = gears.selector.get_design_by_full_name(
            "DZD Cetus")
        self.cetus.never_show_die = True
        team2.contents.append(self.cetus)

        self.obj = adventureseed.MissionObjective(
            "Battle Cetus", adventureseed.MAIN_OBJECTIVE_VALUE)
        self.adv.objectives.append(self.obj)
        self.regen_count = 0

        team3 = self.register_element(
            "_ateam",
            teams.Team(enemies=(myscene.player_team, )),
            dident="ROOM")
        self.allied_mecha = gears.selector.RandomMechaUnit(
            self.rank, 500, gears.factions.DeadzoneFederation,
            myscene.environment).mecha_list

        self.intro_ready = True

        return True
Exemplo n.º 7
0
    def custom_init( self, nart ):
        team1 = teams.Team(name="Player Team")
        myscene = gears.GearHeadScene(35,35,"Radio Tower Area",player_team=team1,scale=gears.scale.MechaScale)
        myscenegen = pbge.randmaps.SceneGenerator(myscene, game.content.gharchitecture.MechaScaleDeadzone())
        self.register_scene( nart, myscene, myscenegen, ident="LOCALE" )
        myscene.exploration_music = 'Lines.ogg'
        myscene.combat_music = 'Late.ogg'

        mygoal = self.register_element("_goalroom",pbge.randmaps.rooms.FuzzyRoom(10,10,parent=myscene,anchor=pbge.randmaps.anchors.middle))

        team1 = teams.Team(name="Player Team")
        team2 = teams.Team(name="Civilian Team")
        intscene = gears.GearHeadScene(10,10,"Radio Tower Interior",player_team=team1,civilian_team=team2,scale= gears.scale.HumanScale)
        intscenegen = pbge.randmaps.SceneGenerator(intscene, game.content.gharchitecture.DefaultBuilding())
        self.register_scene( nart, intscene, intscenegen, ident="GOALSCENE" )

        introom = self.register_element('_introom', pbge.randmaps.rooms.OpenRoom(7, 7, anchor=pbge.randmaps.anchors.middle, decorate=pbge.randmaps.decor.OmniDec(win=game.content.ghterrain.Window)), dident="GOALSCENE")
        self.move_element(self.elements["PERSON"],introom)
        intscene.local_teams[self.elements["PERSON"]] = team2
        self.register_element('WAYPOINT', game.content.ghwaypoints.RetroComputer(), dident="_introom")

        world_scene = self.elements["WORLD"]

        wm_con = game.content.plotutility.WMCommTowerConnection(self, world_scene, myscene)
        if random.randint(1,3) != 1:
            wm_con.room1.tags = (dd_main.ON_THE_ROAD,)
        int_con = game.content.plotutility.IntCommTowerConnection(self, myscene, intscene, room1=mygoal, room2=introom)

        tplot = self.add_sub_plot(nart, "DZD_MECHA_ENCOUNTER", spstate=PlotState().based_on(self,{"ROOM":mygoal}), necessary=False)
        return True
Exemplo n.º 8
0
    def custom_init( self, nart ):
        team1 = teams.Team(name="Player Team")
        myscene = gears.GearHeadScene(50,50,"Combat Zone",player_team=team1,scale=gears.scale.MechaScale)
        myscenegen = pbge.randmaps.SceneGenerator(myscene, game.content.gharchitecture.MechaScaleDeadzone())
        self.register_scene( nart, myscene, myscenegen, ident="LOCALE", temporary=True, dident=self.elements["MISSION_RETURN"][0])

        player_a,enemy_a = random.choice(pbge.randmaps.anchors.OPPOSING_PAIRS)

        if not self.elements.get("FACTION"):
            self.register_element("FACTION",gears.factions.Circle())

        self.register_element("_EROOM",pbge.randmaps.rooms.OpenRoom(5,5,anchor=player_a),dident="LOCALE")
        destination,entrance = self.elements["MISSION_RETURN"]
        myent = self.register_element( "ENTRANCE", game.content.ghwaypoints.Exit(dest_scene=destination,dest_entrance=entrance,anchor=pbge.randmaps.anchors.middle), dident="_EROOM")

        enemy_room = self.register_element("ENEMY_ROOM",pbge.randmaps.rooms.FuzzyRoom(10,10,anchor=enemy_a),dident="LOCALE")
        team2 = self.register_element("_eteam",teams.Team(enemies=(myscene.player_team,)),dident="ENEMY_ROOM")
        myunit = gears.selector.RandomMechaUnit(level=self.rank,strength=150,fac=self.elements["FACTION"],env=myscene.environment)
        team2.contents += myunit.mecha_list
        enemy_room.contents.append(ghwaypoints.SmokingWreckage())
        enemy_room.contents.append(ghwaypoints.SmokingWreckage())

        for t in range(random.randint(1,3)):
            self.add_sub_plot(nart,"MECHA_ENCOUNTER",necessary=False)

        self.mission_entrance = (myscene,myent)
        self.witness_ready = True

        return True
Exemplo n.º 9
0
    def custom_init(self, nart):
        team1 = teams.Team(name="Player Team")
        team2 = teams.Team(name="Civilian Team", allies=(team1,))
        town_fac = self.register_element( "METRO_FACTION",
            gears.factions.Circle(nart.camp,parent_faction=gears.factions.DeadzoneFederation,name="the {} Council".format(self.elements["DZ_TOWN_NAME"]))
        )
        myscene = gears.GearHeadScene(50, 50, self.elements["DZ_TOWN_NAME"], player_team=team1, civilian_team=team2,
                                      scale=gears.scale.HumanScale, is_metro=True,
                                      faction=town_fac,
                                      attributes=(
                                      gears.personality.DeadZone, gears.tags.City, gears.tags.SCENE_PUBLIC))
        myscene.exploration_music = 'Good Night.ogg'

        for t in range(random.randint(1,3)):
            npc = gears.selector.random_character(50, local_tags=myscene.attributes)
            npc.place(myscene, team=team2)

        myscenegen = pbge.randmaps.CityGridGenerator(myscene, gharchitecture.HumanScaleGreenzone(),
                                                     road_terrain=ghterrain.Flagstone)

        self.register_scene(nart, myscene, myscenegen, ident="LOCALE")
        self.register_element("METRO", myscene.metrodat)

        myroom2 = self.register_element("_ROOM2", pbge.randmaps.rooms.Room(3, 3, anchor=pbge.randmaps.anchors.east),
                                        dident="LOCALE")
        towngate = self.register_element("ENTRANCE", DZDRoadMapExit(roadmap=self.elements["DZ_ROADMAP"],
                                                                    node=self.elements["DZ_NODE"],name="The Highway",
                                                                    desc="The highway stretches far beyond the horizon, all the way back to the green zone.",
                                                                    anchor=pbge.randmaps.anchors.east,
                                                                    plot_locked=True), dident="_ROOM2")
        # Gonna register the entrance under another name for the subplots.
        self.register_element("MISSION_GATE", towngate)
        self.register_element("METROSCENE", myscene)

        mystory = self.register_element("BACKSTORY",backstory.Backstory(commands=("DZTOWN_FOUNDING",),elements={"LOCALE":self.elements["LOCALE"]}))

        team3 = teams.Team(name="Sheriff Team", allies=(team1,team2))
        myroom2.contents.append(team3)

        self.first_quest_done = False

        # Gonna store this town in the campdata, so it can be accessed elsewhere.
        nart.camp.campdata["DISTANT_TOWN"] = myscene
        nart.camp.campdata["DISTANT_TEAM"] = team3

        # Add the services.
        tplot = self.add_sub_plot(nart, "DZRS_ORDER")
        tplot = self.add_sub_plot(nart, "DZRS_GARAGE")
        tplot = self.add_sub_plot(nart, "DZRS_HOSPITAL")
        tplot = self.add_sub_plot(nart, "TAVERN")

        # Record the tavern scene
        self.elements["TAVERN"] = tplot.elements["LOCALE"]

        # Add the local tarot.
        #threat_card = nart.add_tarot_card(self, (game.content.ghplots.dd_tarot.MT_THREAT,), )
        #game.content.mechtarot.Constellation(nart, self, threat_card, threat_card.get_negations()[0], steps=3)

        return True
Exemplo n.º 10
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
Exemplo n.º 11
0
    def custom_init(self, nart):
        team1 = teams.Team(name="Player Team")
        myscene = gears.GearHeadScene(50,
                                      50,
                                      plotutility.random_deadzone_spot_name(),
                                      player_team=team1,
                                      scale=gears.scale.MechaScale)
        myscenegen = pbge.randmaps.SceneGenerator(
            myscene, game.content.gharchitecture.MechaScaleDeadzone())
        self.register_scene(nart,
                            myscene,
                            myscenegen,
                            ident="LOCALE",
                            dident="METROSCENE")

        if not self.elements.get("ENEMY_FACTION"):
            self.register_element("ENEMY_FACTION",
                                  plotutility.RandomBanditCircle(nart.camp))

        self.register_element("_EROOM",
                              pbge.randmaps.rooms.OpenRoom(
                                  6,
                                  6,
                                  anchor=random.choice(
                                      pbge.randmaps.anchors.EDGES)),
                              dident="LOCALE")
        destination, entrance = self.elements[
            "MISSION_GATE"].scene, self.elements["MISSION_GATE"]
        myent = self.register_element("ENTRANCE",
                                      game.content.ghwaypoints.Exit(
                                          dest_scene=destination,
                                          dest_entrance=entrance,
                                          anchor=pbge.randmaps.anchors.middle),
                                      dident="_EROOM")

        castle_room = self.register_element(
            "CASTLE_ROOM",
            pbge.randmaps.rooms.FuzzyRoom(10,
                                          10,
                                          anchor=pbge.randmaps.anchors.middle),
            dident="LOCALE")
        team2 = self.register_element(
            "_eteam",
            teams.Team(enemies=(myscene.player_team, )),
            dident="CASTLE_ROOM")
        #myunit = gears.selector.RandomMechaUnit(level=self.rank,strength=150,fac=self.elements["ENEMY_FACTION"],env=myscene.environment)
        #team2.contents += myunit.mecha_list

        self.mission_entrance = (myscene, myent)
        self.next_update = 0
        self.encounters_on = True

        return True
Exemplo n.º 12
0
    def custom_init(self, nart):
        myscene = self.elements["LOCALE"]
        myroom = self.register_element("ROOM",
                                       pbge.randmaps.rooms.FuzzyRoom(10, 10),
                                       dident="LOCALE")
        team2 = self.register_element(
            "_eteam",
            teams.Team(enemies=(myscene.player_team, )),
            dident="ROOM")
        team3 = self.register_element("_ateam",
                                      teams.Team(
                                          enemies=(team2, ),
                                          allies=(myscene.player_team, )),
                                      dident="ROOM")
        myunit = gears.selector.RandomMechaUnit(
            self.rank,
            200,
            self.elements.get("ENEMY_FACTION"),
            myscene.environment,
            add_commander=False)
        team2.contents += myunit.mecha_list

        mynpc = self.seek_element(nart,
                                  "PILOT",
                                  self._npc_is_good,
                                  scope=self.elements["METROSCENE"],
                                  must_find=False,
                                  lock=True)
        if mynpc:
            plotutility.CharacterMover(self, mynpc, myscene, team3)
            mek = mynpc.get_root()
            self.register_element("SURVIVOR", mek)
        else:
            mysurvivor = self.register_element(
                "SURVIVOR",
                gears.selector.generate_ace(
                    self.rank, self.elements.get("ALLIED_FACTION"),
                    myscene.environment))
            self.register_element("PILOT", mysurvivor.get_pilot())
            team3.contents.append(mysurvivor)

        self.obj = adventureseed.MissionObjective(
            "Extract allied pilot {}".format(self.elements["PILOT"]),
            MAIN_OBJECTIVE_VALUE,
            can_reset=False)
        self.adv.objectives.append(self.obj)
        self.intro_ready = True
        self.eteam_activated = False
        self.eteam_defeated = False
        self.pilot_fled = False

        return True
Exemplo n.º 13
0
    def custom_init(self, nart):
        # Create a building within the town.
        myname = "{} Clinic".format(self.elements["LOCALE"])
        building = self.register_element(
            "_EXTERIOR",
            ghterrain.BrickBuilding(
                waypoints={"DOOR": ghwaypoints.WoodenDoor(name=myname)},
                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")
        intscene = gears.GearHeadScene(35,
                                       35,
                                       myname,
                                       player_team=team1,
                                       civilian_team=team2,
                                       attributes=(gears.tags.SCENE_PUBLIC,
                                                   gears.tags.SCENE_HOSPITAL),
                                       scale=gears.scale.HumanScale)
        intscenegen = pbge.randmaps.SceneGenerator(
            intscene, gharchitecture.HospitalBuilding())
        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(
            "DOCTOR",
            gears.selector.random_character(
                50,
                local_tags=self.elements["LOCALE"].attributes,
                job=gears.jobs.ALL_JOBS["Doctor"]))
        npc.place(intscene, team=team2)

        return True
Exemplo n.º 14
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
Exemplo n.º 15
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
Exemplo n.º 16
0
    def custom_init(self, nart):
        shoproom = self.register_element('_introom',
                                         pbge.randmaps.rooms.ClosedRoom(8, 8),
                                         dident="INTERIOR")

        myteam = teams.Team(allies=(self.elements["INTERIOR"].civilian_team, ))
        shoproom.contents.append(myteam)

        # Create the shopkeeper
        npc1 = self.register_element(
            "SHOPKEEPER",
            gears.selector.random_character(
                self.rank,
                local_tags=self.elements["LOCALE"].attributes,
                job=gears.jobs.ALL_JOBS["Smuggler"],
                combatant=False))
        myteam.contents.append(npc1)

        self.shopname = "{}'s Shop".format(npc1)

        self.shop = services.Shop(npc=npc1,
                                  ware_types=services.BLACK_MARKET,
                                  rank=self.rank + random.randint(1, 50),
                                  shop_faction=self.elements.get(
                                      "FACTION",
                                      gears.factions.TreasureHunters))

        return True
    def custom_init(self, nart):
        myscene = self.elements["LOCALE"]
        roomtype = self.elements["ARCHITECTURE"].get_a_room()
        self.register_element("ROOM",
                              roomtype(15,
                                       15,
                                       anchor=pbge.randmaps.anchors.middle),
                              dident="LOCALE")

        team2 = self.register_element(
            "_eteam",
            teams.Team(enemies=(myscene.player_team, )),
            dident="ROOM")

        myunit = [
            gears.selector.get_design_by_full_name("DZD Kerberos")
            for t in range(4)
        ]
        team2.contents += myunit

        self.obj = adventureseed.MissionObjective(
            "Battle Kerberos", adventureseed.MAIN_OBJECTIVE_VALUE)
        self.adv.objectives.append(self.obj)

        return True
    def custom_init(self, nart):
        myscene = self.elements["LOCALE"]
        myfac = self.elements.get("ENEMY_FACTION")
        roomtype = self.elements["ARCHITECTURE"].get_a_room()
        enemy_room = self.register_element("ROOM",
                                           roomtype(15, 15),
                                           dident="LOCALE")

        team2 = self.register_element(
            "_eteam",
            teams.Team(enemies=(myscene.player_team, )),
            dident="ROOM")
        myunit = gears.selector.RandomMechaUnit(self.rank,
                                                100,
                                                myfac,
                                                myscene.environment,
                                                add_commander=True)
        team2.contents += myunit.mecha_list

        self.obj = adventureseed.MissionObjective(
            "Investigate refugee camp", adventureseed.MAIN_OBJECTIVE_VALUE)
        self.adv.objectives.append(self.obj)
        enemy_room.contents.append(ghwaypoints.SmokingWreckage())
        enemy_room.contents.append(ghwaypoints.SmokingWreckage())

        self.intro_ready = True
        return True
Exemplo n.º 19
0
    def custom_init(self, nart):
        myscene = self.elements["LOCALE"]
        myfac = self.elements.get("ENEMY_FACTION")
        roomtype = self.elements["ARCHITECTURE"].get_a_room()
        self.register_element("ROOM",
                              roomtype(15,
                                       15,
                                       anchor=pbge.randmaps.anchors.middle),
                              dident="LOCALE")

        team2 = self.register_element(
            "_eteam",
            teams.Team(enemies=(myscene.player_team, )),
            dident="ROOM")

        myunit = gears.selector.RandomMechaUnit(self.rank,
                                                150,
                                                myfac,
                                                myscene.environment,
                                                add_commander=True)
        team2.contents += myunit.mecha_list

        self.obj = adventureseed.MissionObjective(
            "Defeat hostile mecha".format(myfac),
            missionbuilder.MAIN_OBJECTIVE_VALUE)
        self.adv.objectives.append(self.obj)

        self.intro_ready = True

        return True
    def custom_init(self, nart):
        myscene = self.elements["LOCALE"]
        myroom = self.register_element("ROOM",
                                       pbge.randmaps.rooms.FuzzyRoom(10, 10),
                                       dident="LOCALE")
        myfac = self.elements.get("ENEMY_FACTION")
        team2 = self.register_element(
            "_eteam",
            teams.Team(enemies=(myscene.player_team, )),
            dident="ROOM")

        for i in range(4):
            mek = gears.selector.generate_ace(self.rank, myfac,
                                              myscene.environment)
            champions.upgrade_to_champion(mek)
            team2.contents.append(mek)

            if i == 0:
                self.register_element("_commander", mek.get_pilot())

        self.obj = adventureseed.MissionObjective(
            "Investigate the meteor", missionbuilder.MAIN_OBJECTIVE_VALUE * 2)
        self.adv.objectives.append(self.obj)
        self.combat_entered = False
        self.combat_finished = False

        return True
Exemplo n.º 21
0
    def custom_init(self, nart):
        myscene = self.elements["LOCALE"]
        myfac = self.elements.get("ENEMY_FACTION")
        self.register_element("ROOM",
                              pbge.randmaps.rooms.FuzzyRoom(15, 15),
                              dident="LOCALE")
        self.register_element("DUD_ROOM",
                              pbge.randmaps.rooms.FuzzyRoom(5, 5),
                              dident="LOCALE")

        team2 = self.register_element(
            "_eteam",
            teams.Team(enemies=(myscene.player_team, )),
            dident="ROOM")
        myunit = gears.selector.RandomMechaUnit(self.rank,
                                                100,
                                                myfac,
                                                myscene.environment,
                                                add_commander=True)
        team2.contents += myunit.mecha_list
        self.register_element("_commander", myunit.commander)

        if myfac:
            self.obj = adventureseed.MissionObjective(
                "Locate {} forces".format(myfac), MAIN_OBJECTIVE_VALUE)
        else:
            self.obj = adventureseed.MissionObjective("Locate enemy forces",
                                                      MAIN_OBJECTIVE_VALUE)
        self.adv.objectives.append(self.obj)

        self.intro_ready = True

        return True
Exemplo n.º 22
0
    def custom_init(self, nart):
        deffaction = self.elements["DEFENSE_FACTION"]

        # Create the defender
        npc = self.register_element(
            "DEFENDER",
            gears.selector.random_character(
                self.rank,
                local_tags=self.elements["LOCALE"].attributes,
                faction=deffaction,
                job=self._get_defender_job(deffaction)))
        npc.name = self.elements.get("DEFENDER_NAME", "") or npc.name

        defroom = self.register_element('DEFROOM',
                                        pbge.randmaps.rooms.ClosedRoom(),
                                        dident="INTERIOR")
        team3 = self.register_element(
            "DEFTEAM",
            teams.Team(name="Defroom Team",
                       allies=[self.elements["LOCALE"].civilian_team]),
            dident="DEFROOM")
        team3.contents.append(npc)

        # Add a guard to the foyer.
        npc = self.register_element(
            "GUARD",
            gears.selector.random_character(
                self.rank,
                local_tags=self.elements["LOCALE"].attributes,
                faction=deffaction,
                job=self._get_guard_job(deffaction)),
            dident="FOYER_TEAM")

        return True
Exemplo n.º 23
0
    def custom_init(self, nart):
        team1 = teams.Team(name="Player Team")
        intscene = gears.GearHeadScene(
            65,
            65,
            self.elements[DG_NAME],
            player_team=team1,
            attributes=self.elements[DG_SCENE_TAGS],
            combat_music=self.elements[DG_COMBAT_MUSIC],
            exploration_music=self.elements[DG_EXPLO_MUSIC],
            scale=gears.scale.HumanScale)
        intscenegen = pbge.randmaps.SceneGenerator(
            intscene,
            self.elements[DG_ARCHITECTURE],
            decorate=self.elements[DG_DECOR])
        self.register_scene(nart,
                            intscene,
                            intscenegen,
                            ident="LOCALE",
                            dident=DG_PARENT_SCENE,
                            temporary=self.elements.get(DG_TEMPORARY, False))

        self.last_update = 0

        for t in range(random.randint(3, 5)):
            self.add_sub_plot(
                nart,
                "MONSTER_ENCOUNTER",
                elements={"TYPE_TAGS": self.elements[DG_MONSTER_TAGS]})

        return True
    def custom_init(self, nart):
        myscene = self.elements["LOCALE"]

        self.register_element("ROOM",
                              pbge.randmaps.rooms.FuzzyRoom(
                                  15, 15, anchor=pbge.randmaps.anchors.middle),
                              dident="LOCALE")

        team2 = self.register_element(
            "_eteam",
            teams.Team(enemies=(myscene.player_team, )),
            dident="ROOM")

        mynpc = self.elements["LMNPC"]
        self.locked_elements.add("LMNPC")
        self.party_member = mynpc in nart.camp.party
        if self.party_member:
            plotutility.AutoLeaver(mynpc)(nart.camp)
        plotutility.CharacterMover(nart.camp,
                                   self,
                                   mynpc,
                                   myscene,
                                   team2,
                                   allow_death=False)

        self.obj = adventureseed.MissionObjective(
            "Defeat {}".format(mynpc), missionbuilder.MAIN_OBJECTIVE_VALUE * 2)
        self.adv.objectives.append(self.obj)

        self.intro_ready = True

        return True
Exemplo n.º 25
0
    def custom_init(self, nart):
        myscene = self.elements["LOCALE"]
        myfac = self.elements.get("ENEMY_FACTION")
        if myfac:
            colors = myfac.mecha_colors
        else:
            colors = gears.color.random_mecha_colors()
        roomtype = self.elements["ARCHITECTURE"].get_a_room()
        self.register_element("ROOM", roomtype(8, 8), dident="LOCALE")

        team2 = self.register_element(
            "_eteam",
            teams.Team(enemies=(myscene.player_team, )),
            dident="ROOM")
        for t in range(random.randint(3, 4)):
            mydrone = gears.selector.get_design_by_full_name(
                "DZD-01 Sentry Drone")
            mydrone.colors = colors
            team2.contents.append(mydrone)

        self.obj = adventureseed.MissionObjective(
            "Neutralize all security drones".format(myfac),
            MAIN_OBJECTIVE_VALUE)
        self.adv.objectives.append(self.obj)

        return True
Exemplo n.º 26
0
    def custom_init(self, nart):
        myscene = self.elements["LOCALE"]
        roomtype = self.elements["ARCHITECTURE"].get_a_room()
        myroom = self.register_element(
            "ROOM",
            roomtype(10, 10, anchor=pbge.randmaps.anchors.middle),
            dident="LOCALE")
        team2 = self.register_element(
            "_eteam",
            teams.Team(enemies=(myscene.player_team, )),
            dident="ROOM")
        team3 = self.register_element("_ateam",
                                      teams.Team(
                                          enemies=(team2, ),
                                          allies=(myscene.player_team, )),
                                      dident="ROOM")
        myunit = gears.selector.RandomMechaUnit(
            self.rank,
            200,
            self.elements.get("ENEMY_FACTION"),
            myscene.environment,
            add_commander=False)
        team2.contents += myunit.mecha_list

        mynpc = self.seek_element(nart, "PILOT", self._npc_is_good, lock=True)
        plotutility.CharacterMover(nart.camp, self, mynpc, myscene, team3)
        mek = mynpc.get_root()
        self.register_element("SURVIVOR", mek)
        self.add_sub_plot(nart,
                          "MT_TEAMUP_DEVELOPMENT",
                          ident="NPC_TALK",
                          elements={
                              "NPC": mynpc,
                          })

        self.obj = adventureseed.MissionObjective(
            "Respond to {}'s distress call".format(self.elements["PILOT"]),
            missionbuilder.MAIN_OBJECTIVE_VALUE,
            can_reset=False)
        self.adv.objectives.append(self.obj)
        self.choice_ready = True
        self.intro_ready = True
        self.eteam_activated = False
        self.eteam_defeated = False
        self.pilot_fled = False

        return True
Exemplo n.º 27
0
    def custom_init(self, nart):
        myscene = self.elements["LOCALE"]
        myfac = self.elements.get("ENEMY_FACTION")
        roomtype = self.elements["ARCHITECTURE"].get_a_room()
        self.register_element("ROOM",
                              roomtype(15,
                                       15,
                                       anchor=pbge.randmaps.anchors.middle),
                              dident="LOCALE")

        team2 = self.register_element(
            "_eteam",
            teams.Team(enemies=(myscene.player_team, )),
            dident="ROOM")

        mynpc = self.seek_element(
            nart,
            "_commander",
            self.adv.is_good_enemy_npc,
            must_find=False,
            lock=True,
            backup_seek_func=self.adv.is_good_backup_enemy)
        self.regular_checkpoint = True
        if mynpc:
            plotutility.CharacterMover(nart.camp, self, mynpc, myscene, team2)
            myunit = gears.selector.RandomMechaUnit(self.rank,
                                                    120,
                                                    myfac,
                                                    myscene.environment,
                                                    add_commander=False)
            if nart.camp.is_unfavorable_to_pc(myfac):
                self.add_sub_plot(nart,
                                  "MC_ENEMY_DEVELOPMENT",
                                  elements={"NPC": mynpc})
                self.regular_checkpoint = False
        else:
            myunit = gears.selector.RandomMechaUnit(self.rank,
                                                    150,
                                                    myfac,
                                                    myscene.environment,
                                                    add_commander=True)
            self.register_element("_commander", myunit.commander)
            if nart.camp.is_unfavorable_to_pc(myfac):
                self.add_sub_plot(
                    nart,
                    "MC_NDBCONVERSATION",
                    elements={"NPC": myunit.commander.get_pilot()})
                self.regular_checkpoint = False

        team2.contents += myunit.mecha_list

        self.obj = adventureseed.MissionObjective(
            "Pass {} Checkpoint".format(myfac),
            missionbuilder.MAIN_OBJECTIVE_VALUE * 2)
        self.adv.objectives.append(self.obj)

        self.intro_ready = True

        return True
Exemplo n.º 28
0
    def custom_init( self, nart ):
        """An empty map that will add subplots for the mission's objectives."""
        team1 = teams.Team(name="Player Team")
        team2 = teams.Team(name="Civilian Team")

        self.elements["DZ_TOWN_NAME"] = self.generate_town_name()

        myscene = gears.GearHeadScene(
            15,15,"{} Mecha Hangar".format(self.elements["DZ_TOWN_NAME"]),player_team=team1,
            scale=gears.scale.HumanScale,civilian_team=team2,attributes=(gears.personality.DeadZone,),is_metro=True,
            exploration_music='A wintertale.ogg', combat_music='Chronos.ogg'
        )
        myscenegen = pbge.randmaps.SceneGenerator(myscene, gharchitecture.IndustrialBuilding(floor_terrain=ghterrain.GrateFloor))
        self.register_scene( nart, myscene, myscenegen, ident="LOCALE", temporary=True)

        # Start a new adventure for this plot and its children- the intro will be disposed of when it's finished.
        self.adv = pbge.plots.Adventure(world=myscene)

        myroom = self.register_element("_EROOM",pbge.randmaps.rooms.ClosedRoom(10,7),dident="LOCALE")
        myent = self.register_element( "ENTRANCE", game.content.ghwaypoints.Waypoint(anchor=pbge.randmaps.anchors.middle), dident="_EROOM")
        mychute = self.register_element("CHUTE",ghwaypoints.BoardingChute(plot_locked=True),dident="_EROOM")
        myroom.contents.append(ghwaypoints.ClosedBoardingChute())
        myroom.contents.append(ghwaypoints.VentFan())

        npc = self.register_element("SHERIFF",
                            gears.selector.random_character(45, local_tags=self.elements["LOCALE"].attributes,
                                                            job=gears.jobs.ALL_JOBS["Sheriff"]))
        npc.place(myscene, team=team2)

        self.register_element("MISSION_RETURN", myent)

        # Request the intro mission and debriefing.
        self.add_sub_plot(nart, self.MISSION_LABEL, ident="MISSION", elements=self.MISSION_ELEMENTS)
        self.add_sub_plot(nart,"DZD_MISSION_DEBRIEFING", ident="DEBRIEFING", elements=self.DEBRIEFING_ELEMENTS)

        # Attempt to load the test mission.
        mytest = self.add_sub_plot(nart,"DZRE_TEST",spstate=pbge.plots.PlotState(rank=1,elements={"METRO":myscene.metrodat,"MISSION_GATE":mychute,"FACTION":game.content.plotutility.RandomBanditCircle(nart.camp),"DZREPR_MISSION_WINS":0}).based_on(self),necessary=False)

        if mytest:
            print("Loaded DZRE test!")
            mytest.mission_active = True

        self.started_the_intro = False
        self._tutorial_on = False

        return True
Exemplo n.º 29
0
 def custom_init(self, nart):
     myscene = self.elements["LOCALE"]
     self.register_element("ROOM", self.elements[DG_ARCHITECTURE].get_a_room()(), dident="LOCALE")
     team2 = self.register_element("_eteam", teams.Team(enemies=(myscene.player_team,)), dident="ROOM")
     team2.contents += gears.selector.RandomMonsterUnit(self.rank, 150, myscene.environment,
                                                        self.elements[DG_MONSTER_TAGS], myscene.scale).contents
     self.last_update = 0
     return True
Exemplo n.º 30
0
 def custom_init(self, nart):
     myscene = self.elements["LOCALE"]
     if not self.elements.get("ROOM"):
         self.register_element("ROOM", pbge.randmaps.rooms.OpenRoom(5, 5), dident="LOCALE")
     team2 = self.register_element("_eteam", teams.Team(enemies=(myscene.player_team,)), dident="ROOM")
     team2.contents += gears.selector.RandomMechaUnit(self.rank, 50, self.elements.get("FACTION", None),
                                                      myscene.environment).mecha_list
     return True