def LOCALE_ENTER(self, camp: gears.GearHeadCampaign): if self.choice_ready: self.choice_ready = False # Allow the PC to decide whether or not to respond to the distress call. npc = self.elements["PILOT"] pbge.alert( "While traveling, you receive a distress call from {}.".format( npc)) mymenu = game.content.ghcutscene.SimpleMonologueMenu( "[DISTRESS_CALL]", self.elements["SURVIVOR"], camp) if npc.faction and camp.is_unfavorable_to_pc(npc.faction): game.content.ghcutscene.AddTagBasedLancemateMenuItem( mymenu, "We have no duty to aid an enemy combatant.", self.cancel_the_adventure, camp, (gears.personality.Duty, )) self.glory_npc = game.content.ghcutscene.AddTagBasedLancemateMenuItem( mymenu, "You realize there'll probably be a cash reward for helping out.", self.go_for_glory, camp, (gears.personality.Glory, )) self.fellowship_npc = game.content.ghcutscene.AddTagBasedLancemateMenuItem( mymenu, "Helping {} is the right thing to do.".format(npc), self.go_for_fellowship, camp, (gears.personality.Fellowship, )) mymenu.add_item("Go help {}".format(npc), None) mymenu.add_item("Ignore distress call", self.abandon_distress_call) choice = mymenu.query() if choice: choice(camp)
def generate_world_map_encounter( self, camp: gears.GearHeadCampaign, metroscene, return_wp, dest_scene: gears.GearHeadScene, dest_wp, scenegen=gharchitecture.DeadZoneHighwaySceneGen, architecture=gharchitecture.MechaScaleSemiDeadzone, **kwargs): if camp.is_unfavorable_to_pc(dest_scene): myanchor = kwargs.get("entrance_anchor", None) if not myanchor: myanchor = pbge.randmaps.anchors.east myrank = self.rank dest_metro = dest_scene.get_metro_scene() if dest_metro and dest_metro.metrodat: myqol = dest_metro.metrodat.get_quality_of_life() myrank += myqol.defense * 10 myadv = missionbuilder.BuildAMissionSeed( camp, "{} Militia".format(dest_scene), metroscene, return_wp, enemy_faction=dest_scene.faction, rank=myrank, objectives=(missionbuilder.BAMO_DEFEAT_COMMANDER, ), adv_type="BAM_ROAD_MISSION", custom_elements={ "ADVENTURE_GOAL": dest_wp, "DEST_SCENE": dest_scene, "ENTRANCE_ANCHOR": myanchor }, scenegen=scenegen, architecture=architecture( room_classes=(pbge.randmaps.rooms.FuzzyRoom, )), cash_reward=0, mission_grammar=missionbuilder.MissionGrammar( objective_ep="keep you out of {}".format(dest_scene), win_pp="I got past your militia", win_ep="you fought your way into {}".format(dest_scene), lose_pp="you stopped me from entering {}".format( dest_scene), lose_ep="I drove you out of {}".format(dest_scene))) myadv.priority = 50 myadv.mandatory = True return myadv
def METROSCENE_ENTER(self, camp: gears.GearHeadCampaign): # Upon entering this scene, deal with any dead or incapacitated party members. # Also, deal with party members who have lost their mecha. This may include the PC. etlr = plotutility.EnterTownLanceRecovery(camp, self.elements["METROSCENE"], self.elements["METRO"]) if not camp.is_unfavorable_to_pc(self.elements["METROSCENE"]): camp.home_base = self.elements["MISSION_GATE"] if camp.campdata.get(LANCEDEV_ENABLED, False) and random.randint( 1, 3) == 2 and not etlr.did_recovery: # We can maybe load a lancemate scene here. Yay! if camp.campdata[LANCEDEV_ENABLED](camp): nart = GHNarrativeRequest( camp, pbge.plots.PlotState().based_on(self), adv_type="LANCEDEV", plot_list=PLOT_LIST) if nart.story: nart.build()
def start_conversation(camp: gears.GearHeadCampaign,pc,npc,cue=None): # If this NPC has no relationship with the PC, create that now. realnpc = npc.get_pilot() if realnpc and not realnpc.relationship: realnpc.relationship = camp.get_relationship(realnpc) if not cue: npcteam = camp.scene.local_teams.get(npc) if npcteam and camp.scene.player_team.is_enemy(npcteam): cue = ATTACK_STARTER elif camp.is_favorable_to_pc(realnpc): cue = HELLO_STARTER elif npc not in camp.party and camp.is_unfavorable_to_pc(realnpc): cue = UNFAVORABLE_STARTER else: cue = HELLO_STARTER cviz = ghdview.ConvoVisualizer(npc,camp,pc=pc) cviz.rollout() convo = pbge.dialogue.DynaConversation(camp,realnpc,pc,cue,visualizer=cviz) convo.converse() if realnpc: realnpc.relationship.met_before = True
def LOCALE_ENTER(self, camp: gears.GearHeadCampaign): if self.choice_ready: self.choice_ready = False # Allow the PC to decide whether or not to respond to the distress call. npc = self.elements["PILOT"] pbge.alert( "While traveling, you receive a distress call from {}.".format( npc)) mymenu = game.content.ghcutscene.SimpleMonologueMenu( "[DISTRESS_CALL]", self.elements["SURVIVOR"], camp) if npc.faction and camp.is_unfavorable_to_pc(npc.faction): game.content.ghcutscene.AddTagBasedLancemateMenuItem( mymenu, "This trucker works for {}; we're under no obligation to help." .format(npc.faction), self.cancel_the_adventure, camp, (gears.personality.Duty, )) else: self.duty_npc = game.content.ghcutscene.AddTagBasedLancemateMenuItem( mymenu, "As cavaliers, we are duty-bound to help {}.".format(npc), self.go_for_duty, camp, (gears.personality.Duty, )) self.justice_npc = game.content.ghcutscene.AddTagBasedLancemateMenuItem( mymenu, "Those bandits need to be brought to justice.", self.go_for_justice, camp, (gears.personality.Justice, )) self.criminal_npc = game.content.ghcutscene.AddTagBasedLancemateMenuItem( mymenu, "Meh, the bandits need to earn a living too. Let's just leave...", self.go_for_criminal, camp, (gears.tags.Criminal, )) mymenu.add_item("Go help {}".format(npc), None) mymenu.add_item("Ignore distress call", self.abandon_distress_call) choice = mymenu.query() if choice: choice(camp)
def build_grammar( mygram, camp: gears.GearHeadCampaign, speaker, audience ): speaker = speaker.get_pilot() tags = list(speaker.get_tags()) if speaker.relationship and not speaker.relationship.met_before: tags.append(ghgrammar.FIRST_TIME) else: tags.append(ghgrammar.MET_BEFORE) if audience: audience = audience.get_pilot() react = speaker.get_reaction_score(audience,camp) if react > 60: tags += [ghgrammar.LIKE,ghgrammar.LOVE] elif react > 20: tags += [ghgrammar.LIKE,] elif react < -60: tags += [ghgrammar.DISLIKE,ghgrammar.HATE] elif react < -20: tags += [ghgrammar.DISLIKE,] if audience is camp.pc: if camp.is_favorable_to_pc(speaker): tags.append(ghgrammar.FAVORABLE) elif camp.is_unfavorable_to_pc(speaker): tags.append(ghgrammar.UNFAVORABLE) trait_absorb(mygram,ghgrammar.DEFAULT_GRAMMAR,tags) for p in camp.active_plots(): pgram = p.get_dialogue_grammar(speaker, camp) if pgram: mygram.absorb( pgram ) if speaker.relationship and audience is camp.pc: mygram.absorb(speaker.relationship.get_grammar()) if speaker is camp.pc and audience and audience.relationship: mygram.absorb(audience.relationship.get_pc_grammar()) if hasattr(speaker, "faction") and speaker.faction: mygram["[speaker_faction]"] = [str(speaker.faction),] mygram.absorb({"[speaker]":(str(speaker),),"[audience]":(str(audience),)})
def INTERIOR_ENTER(self, camp: gears.GearHeadCampaign): fac = self.elements["FACTION"] if fac and camp.is_unfavorable_to_pc(fac): # The guild team needs to attack... self.elements["INTERIOR"].civilian_team.attack( self.elements["INTERIOR"].player_team)