def custom_init(self, nart): violated_virtues = self.elements.get( "VIOLATED_VIRTUES", [random.choice(gears.personality.VIRTUES)]) upheld_virtue = self.elements.get("UPHELD_VIRTUE", gears.personality.Duty) if upheld_virtue in violated_virtues: upheld_virtue = None reasons_to_dethrone = ["{METROSCENE} is being harmed by {NPC}".format(**self.elements)] + \ self.elements.get("REASONS_TO_DETHRONE", []) for v in violated_virtues: for reason in self.REASONS_TO_DETHRONE[v]: reasons_to_dethrone.append(reason.format(**self.elements)) reasons_to_support = ["{NPC} is doing great things for {METROSCENE}".format(**self.elements)] + \ self.elements.get("REASONS_TO_SUPPORT", []) if upheld_virtue: for reason in self.REASONS_TO_SUPPORT[upheld_virtue]: reasons_to_support.append(reason.format(**self.elements)) npc = self.elements["NPC"] self.register_element( "CHALLENGE", Challenge( "Popular Uprising", ghchallenges.DETHRONE_CHALLENGE, (npc, ), ghchallenges.InvolvedMetroResidentNPCs( self.elements["METROSCENE"], exclude=[npc]), active=False, data={ "reasons_to_dethrone": reasons_to_dethrone, "reasons_to_support": reasons_to_support, "violated_virtue": random.choice(violated_virtues), "upheld_virtue": upheld_virtue }, oppoffers=(AutoOffer(dict( msg= "[YOU_COULD_BE_RIGHT] Maybe {NPC} should be removed from power." .format(**self.elements), context=ContextTag([ context.CUSTOM, ]), effect=self._advance_challenge, data={ "reply": "{}.".format(random.choice(reasons_to_dethrone)) }), active=True, uses=99, access_fun=ghchallenges.AccessSocialRoll( gears.stats.Charm, gears.stats.Negotiation, self.rank, difficulty=gears.stats. DIFFICULTY_HARD, untrained_ok=True)), ), memo=pbge.challenges.ChallengeMemo( "You have agreed to help remove {NPC} from power in {METROSCENE}." .format(**self.elements)), memo_active=True)) return True
def custom_init(self, nart): self.register_element( "CHALLENGE", Challenge( "Treat {DISEASE}".format(**self.elements), ghchallenges.EPIDEMIC_CHALLENGE, [self.elements["DISEASE"], self.elements["THECURE"]], involvement=ghchallenges.InvolvedMetroResidentNPCs( self.elements["METROSCENE"]), active=False, oppoffers=( AutoOffer( dict( msg="[I_DONT_FEEL_WELL] Could you check me out?". format(**self.elements), context=ContextTag([ context.CUSTOM, ]), data={ "reply": "How are you feeling? You look like you might be coming down with {DISEASE}." .format(**self.elements) }, dead_end=True), active=True, uses=99, # No access fun here because InvolvedIfInfected already checks the party's Medicine skill. involvement=ghchallenges.InvolvedIfInfected( self.elements["METROSCENE"]), npc_effect=self.attempt_treatment), ), memo=pbge.challenges.ChallengeMemo( "Many people in {METROSCENE} are infected with {DISEASE}.". format(**self.elements)), memo_active=True)) return True
def custom_init(self, nart): violated_virtue = self.elements.get( "VIOLATED_VIRTUE", [random.choice(gears.personality.VIRTUES)]) upheld_virtue = self.elements.get( "UPHELD_VIRTUE", [random.choice(gears.personality.VIRTUES)]) if upheld_virtue is violated_virtue: upheld_virtue = None metroscene = self.elements["METROSCENE"] faction_to_be_swayed = self.elements.get("FACTION_TO_BE_SWAYED", metroscene.faction) faction_doing_swaying = self.elements.get("FACTION_DOING_SWAYING", None) challenge_subject = self.elements.get("CHALLENGE_SUBJECT", None) if not challenge_subject: challenge_subject = random.choice( self.CHALLENGE_SUBJECTS[violated_virtue]).format( **self.elements) challenge_statements = [ s.format(**self.elements) for s in self.elements.get("CHALLENGE_STATEMENTS", []) + list(self.CHALLENGE_STATEMENTS[upheld_virtue] + self.REVERSE_CHALLENGE_STATEMENTS[violated_virtue]) ] pc_rebuttals = [ s.format(**self.elements) for s in self.elements.get("PC_REBUTTALS", []) + list(self.PC_REBUTTALS[violated_virtue]) ] npc_agreement = [ s.format(**self.elements) for s in self.elements.get("NPC_AGREEMENT", []) + list(self.NPC_AGREEMENT) ] npc_disagreement = [ s.format(**self.elements) for s in self.elements.get("NPC_DISAGREEMENT", []) + list(self.NPC_DISAGREEMENT) ] npc = self.elements["NPC"] self.register_element( "CHALLENGE", Challenge( "Discredit {NPC}".format(**self.elements), ghchallenges.DIPLOMACY_CHALLENGE, [faction_to_be_swayed, faction_doing_swaying], involvement=ghchallenges.InvolvedMetroResidentNPCs( self.elements["METROSCENE"]), active=False, data={ "challenge_subject": challenge_subject, "challenge_statements": challenge_statements, "pc_rebuttals": pc_rebuttals, "npc_agreement": npc_agreement, "npc_disagreement": npc_disagreement, }, oppoffers=(AutoOffer(dict( msg= "[MAYBE_YOU_ARE_RIGHT_ABOUT_OPINION] I will no longer support {NPC.gender.object_pronoun}." .format(**self.elements), context=ContextTag([ context.CUSTOM, ]), effect=self._advance_challenge, data={ "reply": "I think {NPC} is causing trouble in {METROSCENE}.". format(**self.elements), "opinion": "{NPC} is no good".format(**self.elements) }), active=True, uses=99, access_fun=ghchallenges.AccessSocialRoll( gears.stats.Charm, gears.stats.Negotiation, self.rank, untrained_ok=True)), ), memo=pbge.challenges.ChallengeMemo( "You have agreed to help discredit {NPC}.".format( **self.elements)), memo_active=True)) return True
def custom_init(self, nart): npc = gears.selector.random_character( rank=max(random.randint(self.rank - 10, self.rank + 10), 25), local_tags=tuple(self.elements["METROSCENE"].attributes), job=gears.jobs.ALL_JOBS["Bounty Hunter"]) scene = self.seek_element(nart, "NPC_SCENE", self._is_best_scene, scope=self.elements["METROSCENE"], backup_seek_func=self._is_ok_scene) self.register_element("NPC", npc, dident="NPC_SCENE") mymystery: pbge.okapipuzzle.OkapiPuzzle = self.elements["MYSTERY"] self.elements["CULPRIT"] = mymystery.solution[0].gameob involved_set = set() for d in mymystery.decks: for c in d.cards: if c.gameob: involved_set.add(c.gameob) excluded_set = involved_set.copy() excluded_set.add(npc) mychallenge = self.register_element( "CHALLENGE", pbge.challenges.MysteryChallenge( str(mymystery), self.elements["MYSTERY"], memo=pbge.challenges.MysteryMemo( "{NPC} sent you to investigate {MYSTERY.name}.".format( **self.elements)), active=False, oppoffers=[ pbge.challenges. AutoOffer(dict( msg="[I_KNOW_THINGS_ABOUT_STUFF] [LISTEN_TO_MY_INFO]", context=ContextTag([ context.CUSTOM, ]), effect=self._get_a_clue, data={ "reply": "Do you know anything about {MYSTERY}?".format( **self.elements), "stuff": "{MYSTERY}".format(**self.elements) }, dead_end=True), active=True, uses=99, involvement=ghchallenges. InvolvedIfCluesRemainAnd( self.elements["MYSTERY"], ghchallenges.InvolvedMetroResidentNPCs( self.elements["METROSCENE"], exclude=excluded_set)), access_fun=ghchallenges.AccessSocialRoll( gears.stats.Perception, gears.stats.Negotiation, self.rank, untrained_ok=True)), pbge.challenges.AutoOffer( dict( msg="[THINK_ABOUT_THIS] [I_REMEMBER_NOW]", context=ContextTag([ context.CUSTOM, ]), data={ "reply": "Do you remember anything about the {MYSTERY}?" .format(**self.elements), "stuff": "the {MYSTERY}".format(**self.elements) }, dead_end=True), active=True, uses=99, involvement=ghchallenges. InvolvedIfUnassociatedCluesRemainAnd( mymystery, mymystery.decks[0], pbge.challenges.InvolvedSet(involved_set)), npc_effect=self._get_unassociated_clue, ), ], )) return True