def custom_init(self, nart): if ME_FACTION not in self.elements: self.elements[ME_FACTION] = plotutility.RandomBanditCircle( nart.camp) self.elements["PASSWORD"] = self.get_random_password() if not self.elements.get(ME_AUTOREVEAL): sp = self.add_sub_plot(nart, "MT_REVEAL_Password", ident="REVEAL") return True
def custom_init(self, nart: GHNarrativeRequest): self.candidates = [ c for c in nart.challenges if c.chaltype == ghchallenges.MAKE_CHALLENGE ] if self.candidates: npc = self.seek_element(nart, "NPC", self._is_good_npc, lock=True, scope=self.elements["METROSCENE"]) mychallenge = self.register_element( "CHALLENGE", self._get_challenge_for_npc(nart, npc)) self.register_element("NPC_SCENE", npc.scene) self.register_element("THING", mychallenge.key[0]) self.expiration = TimeAndChallengeExpiration(nart.camp, mychallenge, time_limit=5) mgram = missionbuilder.MissionGrammar( "recover the supplies needed for {THING}".format( **self.elements), "keep my rightfully looted cargo", "I recovered the supplies needed in {METROSCENE}".format( **self.elements), "you stole the cargo that I had just stolen", "you stole supplies that {METROSCENE} needed to make {THING}". format(**self.elements), "I ransomed the cargo that {METROSCENE} needed to make {THING} back to them for a nice profit" .format(**self.elements)) sgen, archi = gharchitecture.get_mecha_encounter_scenegen_and_architecture( self.elements["METROSCENE"]) # Create the mission seed. Turn the defeat_trigger off because we'll be handling that manually. self.mission_seed = missionbuilder.BuildAMissionSeed( nart.camp, "{NPC}'s Mission".format(**self.elements), self.elements["METROSCENE"], self.elements["MISSION_GATE"], allied_faction=npc.faction, enemy_faction=plotutility.RandomBanditCircle(nart.camp), rank=self.rank, objectives=[ missionbuilder.BAMO_DEFEAT_THE_BANDITS, missionbuilder.BAMO_RECOVER_CARGO ], one_chance=True, scenegen=sgen, architecture=archi, mission_grammar=mgram, cash_reward=120, on_win=self._win_the_mission, defeat_trigger_on=False) self.mission_active = False del self.candidates return True
def custom_init(self, nart): sp = self.add_sub_plot(nart, "ADD_BORING_NPC", elements={"LOCALE": None}) npc = sp.elements["NPC"] self.elements[ME_PERSON] = npc self.elements[ME_FACTION] = plotutility.RandomBanditCircle(nart.camp) self.elements[ME_CRIME] = CrimeObject("the llama burning", "burned the llama") self.visible = True return True
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
def custom_init(self, nart): if ME_FACTION not in self.elements: self.elements[ME_FACTION] = plotutility.RandomBanditCircle( nart.camp) if ME_CRIME not in self.elements: self.elements[ME_CRIME] = CrimeObject("the atrocity", "committed an atrocity") if not self.elements.get(ME_AUTOREVEAL): sp = self.add_sub_plot(nart, "MT_REVEAL_Quitter", ident="REVEAL") if ME_PERSON not in self.elements: self.elements[ME_PERSON] = sp.elements[ME_PERSON] return True
def custom_init(self, nart): if ME_FACTION not in self.elements: self.elements[ME_FACTION] = plotutility.RandomBanditCircle( nart.camp) if not self.elements.get(ME_AUTOREVEAL): sp = self.add_sub_plot(nart, "MT_REVEAL_Investigator", ident="REVEAL", elements={ "INVESTIGATION_SUBJECT": str(self.elements[ME_FACTION]) }) self.elements[ME_PERSON] = sp.elements[ME_PERSON] self.elements["MEP_LOC"] = self.elements[ME_PERSON].get_scene() return True
def custom_init(self, nart): self.rank = 15 + random.randint(1, 6) - random.randint(1, 6) self.register_element("DZ_EDGE_STYLE", RoadEdge.STYLE_YELLOW) self.register_element("FACTION", plotutility.RandomBanditCircle()) myedge = self.elements["DZ_EDGE"] self.add_sub_plot( nart, "DZRE_BanditProblem", ident="MISSION", spstate=PlotState( elements={ "METRO": myedge.start_node.destination.metrodat, "LOCALE": myedge.start_node.destination, "MISSION_GATE": myedge.start_node.entrance }).based_on(self)) return True
def custom_init(self, nart): if ME_FACTION not in self.elements: self.elements[ME_FACTION] = plotutility.RandomBanditCircle( nart.camp) if not self.elements.get(ME_AUTOREVEAL): sp = self.add_sub_plot(nart, "MT_REVEAL_WarCrime", ident="REVEAL") self.elements[ME_CRIME] = sp.elements[ME_CRIME] else: if not self.elements.get(ME_CRIME): self.register_element( ME_CRIME, CrimeObject("a crime", "committed crimes")) if "METROSCENE" in self.elements: location = self.elements["METROSCENE"] else: location = None self.memo = Memo( "You learned that {ME_FACTION} {ME_CRIME.ed}.".format( **self.elements), location) return True
def custom_init(self, nart): # Add the subplot which will decide the splinter faction and provide a discovery route. if ME_FACTION not in self.elements: self.elements[ME_FACTION] = plotutility.RandomBanditCircle( nart.camp) if not self.elements.get(ME_AUTOREVEAL): sp = self.add_sub_plot(nart, "MT_REVEAL_WarCrime", ident="REVEAL") self.elements[ME_CRIME] = sp.elements[ME_CRIME] else: if not self.elements.get(ME_CRIME): self.register_element( ME_CRIME, CrimeObject("an atrocity", "committed atrocities")) if "METROSCENE" in self.elements: location = self.elements["METROSCENE"] else: location = None self.memo = Memo( "You learned that {ME_FACTION} {ME_CRIME.ed}.".format( **self.elements), location) return True
def get_enemy_faction(self, nart): myedge = self.elements["DZ_EDGE"] return plotutility.RandomBanditCircle( nart.camp, enemies=(myedge.start_node.destination.faction, ))
def custom_init(self, nart): self.elements[ME_FACTION] = plotutility.RandomBanditCircle(nart.camp) self.elements["INVESTIGATION_SUBJECT"] = "the tarot test" self.elements["PASSWORD"] = "******" sp = self.add_sub_plot(nart, "MT_REVEAL_TEST", ident="REVEAL") return True
def custom_init(self, nart): # Step One: Create the scene town_name = self.elements.get( "LOCALE_NAME") or self._generate_locale_name() town_fac = self.elements.get( "LOCALE_FACTION") or plotutility.RandomBanditCircle(nart.camp) team1 = teams.Team(name="Player Team") team2 = teams.Team(name="Civilian Team", allies=(team1, ), faction=town_fac) myscene = gears.GearHeadScene(50, 50, town_name, player_team=team1, civilian_team=team2, scale=gears.scale.HumanScale, faction=town_fac, attributes=(gears.tags.Criminal, gears.tags.SCENE_OUTDOORS, gears.tags.SCENE_SEMIPUBLIC)) myscene.exploration_music = 'Komiku_-_06_-_Friendss_theme.ogg' myscenegen = pbge.randmaps.SceneGenerator( myscene, gharchitecture.HumanScaleDeadzone(), ) self.register_scene(nart, myscene, myscenegen, ident="LOCALE", dident="METROSCENE") # Add some NPCs to the scene. for t in range(random.randint(2, 4)): npc = gears.selector.random_character( 50, local_tags=myscene.attributes, needed_tags=(gears.tags.Criminal, )) npc.place(myscene, team=team2) defender = self.register_element( "DEFENDER", gears.selector.random_character( self.rank, local_tags=self.elements["METROSCENE"].attributes, faction=town_fac, combatant=True)) defender.place(myscene, team=team2) # Add the services. self.add_sub_plot( nart, "SHOP_BLACKMARKET", elements={"INTERIOR_TAGS": (gears.tags.SCENE_SEMIPUBLIC, )}) self.add_sub_plot( nart, "HOS_SERVICES", elements={"INTERIOR_TAGS": (gears.tags.SCENE_SEMIPUBLIC, )}) myroom2 = self.register_element("FOYER", pbge.randmaps.rooms.Room( 5, 5, anchor=random.choice( pbge.randmaps.anchors.EDGES)), dident="LOCALE") towngate = self.register_element( "EXIT", ghwaypoints.Exit(name="Back to {}".format( self.elements["METROSCENE"]), dest_wp=self.elements["ENTRANCE"]), dident="FOYER") return True