class Atrocity(TarotCard):
    # A faction has been implicated in serious wrongdoing.
    TAGS = (MT_FACTION, MT_INCRIMINATING)
    QOL = gears.QualityOfLife(stability=-2)

    def custom_init(self, nart):
        # Add the subplot which will decide the splinter faction and provide a discovery route.
        if not self.elements.get(ME_AUTOREVEAL):
            tplot = self.add_sub_plot(nart, "DZD_WarCrimes", ident="REVEAL")
            self.elements[ME_CRIME] = tplot.elements[ME_CRIME]
            self.elements[ME_CRIMED] = tplot.elements[ME_CRIMED]
        else:
            if not self.elements.get(ME_CRIME):
                self.register_element(ME_CRIME, "an atrocity")
            if not self.elements.get(ME_CRIMED):
                self.register_element(ME_CRIMED, "committed atrocities")
            self.memo = "You know that {} {}.".format(
                self.elements[ME_FACTION], self.elements[ME_CRIMED])
        return True

    def REVEAL_WIN(self, camp):
        # The subplot has been won.
        self.visible = True
        self.memo = "You learned that {} has {}.".format(
            self.elements[ME_FACTION], self.elements[ME_CRIMED])
Exemple #2
0
class Epidemic(TarotCard):
    # An illness strikes the area.
    TAGS = (MT_THREAT, )
    QOL = gears.QualityOfLife(health=-4, prosperity=-1)
    active = True
    NEGATIONS = ("Recovery", )
    UNIQUE = True

    SOCKETS = (TarotSocket("MT_SOCKET_Cure",
                           TarotSignal(SIG_CURE, [ME_PROBLEM]),
                           consequences={
                               CONSEQUENCE_WIN:
                               TarotTransformer("Recovery", (ME_PROBLEM, ))
                           }), )

    AUTO_MEMO = "{METROSCENE} has been afflicted with {ME_PROBLEM}."

    def custom_init(self, nart):
        if ME_PROBLEM not in self.elements:
            self.elements[ME_PROBLEM] = TechnoProblem(
                plotutility.random_disease_name(),
                plotutility.random_medicine_name(), ("DISEASE", ))
        if not self.elements.get(ME_AUTOREVEAL):
            sp = self.add_sub_plot(nart, "MT_REVEAL_Epidemic", ident="REVEAL")

        return True
Exemple #3
0
class Murder(TarotCard):
    # A murder has been committed.
    TAGS = (MT_CRIME, )
    QOL = gears.QualityOfLife(stability=-1, health=-2)
    active = True
    ONE_USE = True
    AUTO_MEMO = "You learned that {ME_CRIME} has taken place."

    SIGNALS = (TarotSignal(SIG_CRIME, [
        ME_CRIME,
    ]), )

    def custom_init(self, nart):
        if not self.elements.get(ME_AUTOREVEAL):
            sp = self.add_sub_plot(nart, "MT_REVEAL_Murder", ident="REVEAL")
            if not self.elements.get(ME_CRIME):
                self.elements[ME_CRIME] = sp.elements[ME_CRIME]
            else:
                self.elements[ME_CRIME].update(sp.elements[ME_CRIME])
        else:
            if not self.elements.get(ME_CRIME):
                self.register_element(
                    ME_CRIME, CrimeObject("a murder", "murdered someone"))

        return True
class CultOfPersonality(Plot):
    # Elements:
    #   METROSCENE, METRO
    # The city leader has established dominance over the city through fanatical followers
    LABEL = "CONSEQUENCE_CULTOFPERSONALITY"
    active = True
    scope = "METRO"

    QOL = gears.QualityOfLife(
        -2, -1, 0, -3, 0
    )

    def custom_init(self, nart):
        npc = self.register_element("NPC", self.elements["METRO"].city_leader)
        self.elements["ORIGINAL_FACTION"] = self.elements["METROSCENE"].faction
        return True

    def get_dialogue_grammar(self, npc: gears.base.Character, camp: gears.GearHeadCampaign):
        mygram = dict()

        if npc is not self.elements["NPC"]:
            mygram["[CURRENT_EVENTS]"] = [
                "Life is better now... {NPC} says so.".format(**self.elements),
                "[THIS_IS_A_SECRET] I'm not sure {NPC} is such a good leader.".format(**self.elements)
            ]

        return mygram

    def t_UPDATE(self, camp):
        # This plot ends if the metroscene faction changes or the NPC is deposed.
        if self.elements["METROSCENE"].faction is not self.elements["ORIGINAL_FACTION"]:
            self.end_plot(camp, True)
        elif self.elements["NPC"] and self.elements["METRO"].city_leader is not self.elements["NPC"]:
            self.end_plot(camp, True)
Exemple #5
0
class DinosaurAttack(TarotCard):
    # Genetically engineered dinosaurs causing problems.
    TAGS = (MT_THREAT, )
    QOL = gears.QualityOfLife(defense=-4, health=-1)
    active = True
    NEGATIONS = ("EcologicalBalance", )
    UNIQUE = True

    SOCKETS = (TarotSocket("MT_SOCKET_DinosaurSolution",
                           TarotSignal(SIG_APPLY, [ME_PROBLEM]),
                           consequences={
                               CONSEQUENCE_WIN:
                               TarotTransformer("EcologicalBalance",
                                                (ME_PROBLEM, ))
                           }), )

    AUTO_MEMO = "{METROSCENE} is under constant threat from mutant dinosaurs."

    def custom_init(self, nart):
        if ME_PROBLEM not in self.elements:
            self.elements[ME_PROBLEM] = TechnoProblem('mutant dinosaurs',
                                                      "sonic fence",
                                                      ("MONSTERS", ))
        if not self.elements.get(ME_AUTOREVEAL):
            sp = self.add_sub_plot(nart, "MT_REVEAL_Dinosaurs", ident="REVEAL")

        return True
class Kleptocracy(Plot):
    # Elements:
    #   METROSCENE, METRO
    # The city leader is looting the city for personal gain
    LABEL = "CONSEQUENCE_KLEPTOCRACY"
    active = True
    scope = "METRO"

    QOL = gears.QualityOfLife(
        -3, -1, -2, -1, -2
    )

    def custom_init(self, nart):
        npc = self.register_element("NPC", self.elements["METRO"].city_leader)
        self.elements["ORIGINAL_FACTION"] = self.elements["METROSCENE"].faction
        return True

    def get_dialogue_grammar(self, npc: gears.base.Character, camp: gears.GearHeadCampaign):
        mygram = dict()

        if npc is not self.elements["NPC"]:
            mygram["[CURRENT_EVENTS]"] = [
                "{NPC} is a corrupt leader, but no-one dare oppose {NPC.gender.object_pronoun}.".format(**self.elements),
                "[THIS_IS_A_SECRET] {NPC} has been robbing {METROSCENE} blind.".format(**self.elements)
            ]

        return mygram

    def t_UPDATE(self, camp):
        # This plot ends if the metroscene faction changes or the NPC is deposed.
        if self.elements["METROSCENE"].faction is not self.elements["ORIGINAL_FACTION"]:
            self.end_plot(camp, True)
        elif self.elements["NPC"] and self.elements["METRO"].city_leader is not self.elements["NPC"]:
            self.end_plot(camp, True)
Exemple #7
0
class Atrocity(TarotCard):
    # A faction made a war crime.
    TAGS = (MT_CRIME, )
    QOL = gears.QualityOfLife(stability=-3)
    active = True
    ONE_USE = True

    SIGNALS = (TarotSignal(SIG_INCRIMINATE, [
        ME_FACTION,
    ]), )

    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
Exemple #8
0
class HateClub(TarotCard):
    # A group of people who love to hate.
    TAGS = (MT_THREAT, ME_FACTION)
    QOL = gears.QualityOfLife(stability=-2, community=-2)
    active = True
    NEGATIONS = ("TheDisbanded", )
    UNIQUE = True

    SOCKETS = (TarotSocket("MT_SOCKET_Accuse",
                           TarotSignal(SIG_ACCUSE, [ME_FACTION]),
                           consequences={
                               CONSEQUENCE_WIN:
                               TarotTransformer("TheDisbanded", (ME_FACTION, ),
                                                (ME_CRIME, ))
                           }), )

    def custom_init(self, nart):
        # Add the subplot which will decide the splinter faction and provide a discovery route.
        if not self.elements.get(ME_AUTOREVEAL):
            sp = self.add_sub_plot(nart, "MT_REVEAL_HateClub", ident="REVEAL")
            if ME_FACTION not in self.elements:
                self.elements[ME_FACTION] = sp.elements[ME_FACTION]
        else:
            if "METROSCENE" in self.elements:
                location = self.elements["METROSCENE"]
            else:
                location = None
            self.memo = Memo(
                "You learned that {} has been taken over by extremists.".
                format(self.elements[ME_FACTION]), location)

        return True
class MilitaryOccupation(Plot):
    # Elements:
    #   METROSCENE, METRO
    #   OCCUPYING_FACTION = The faction that has taken over this city.
    LABEL = "CONSEQUENCE_MILOCCUPATION"
    active = True
    scope = "METRO"

    QOL = gears.QualityOfLife(
        0, -2, 0, -2, -1
    )

    def custom_init(self, nart):
        # Step One: Check to make sure the city isn't already occupied.
        mycity: gears.GearHeadScene = self.elements.get("METROSCENE")
        camp: gears.GearHeadCampaign = nart.camp
        original_faction = mycity.faction
        occupying_faction = self.elements["OCCUPYING_FACTION"]
        if mycity and mycity.faction is not occupying_faction:
            # Go through the city and place all allies of the original faction in exile, replacing them with
            # occupying forces when possible.
            num_new_npcs = 0
            for thing in camp.all_contents(mycity):
                if hasattr(thing, "faction"):
                    if isinstance(thing, gears.base.Character) and camp.are_faction_enemies(thing, occupying_faction):
                        myscene = thing.scene
                        camp.freeze(thing)
                        num_new_npcs += 1
                        self.register_element("SCENE{}".format(num_new_npcs), myscene)
                        new_npc = self.register_element(
                            "NPC{}".format(num_new_npcs),
                            gears.selector.random_character(
                                self.rank, current_year=camp.year, faction=occupying_faction,
                                combatant=thing.combatant
                            ), dident="SCENE{}".format(num_new_npcs)
                        )
                    elif isinstance(thing, gears.GearHeadScene) and thing.faction is original_faction:
                        thing.faction = occupying_faction

            return True

    def get_dialogue_grammar(self, npc: gears.base.Character, camp: gears.GearHeadCampaign):
        mygram = dict()

        if npc.faction is self.elements["OCCUPYING_FACTION"]:
            mygram["[CURRENT_EVENTS]"] = [
                "{METROSCENE} is now safely under the protection of {OCCUPYING_FACTION}.".format(**self.elements),
            ]
        else:
            mygram["[CURRENT_EVENTS]"] = [
                "{METROSCENE} has been taken over by {OCCUPYING_FACTION}.".format(**self.elements),
            ]

        return mygram

    def t_UPDATE(self, camp):
        # This plot ends if the metroscene faction changes.
        if self.elements["METROSCENE"].faction is not self.elements["OCCUPYING_FACTION"]:
            self.end_plot(camp, True)
class Injustice(Plot):
    # Elements:
    #   METROSCENE, METRO
    # An injustice stains this city.
    LABEL = "CONSEQUENCE_INJUSTICE"
    active = True
    scope = "METRO"

    QOL = gears.QualityOfLife(
        stability=-3
    )
Exemple #11
0
class RobberBaron(TarotCard):
    # Exploitation leading to widespread poverty.
    TAGS = (MT_THREAT, MT_PERSON, MT_FACTION)
    QOL = gears.QualityOfLife(prosperity=-4, community=-1)
    active = True
    NEGATIONS = ("TheExiled", )
    UNIQUE = True

    SOCKETS = (
        TarotSocket("MT_SOCKET_Accuse",
                    TarotSignal(SIG_ACCUSE, [
                        ME_PERSON,
                    ]),
                    consequences={
                        CONSEQUENCE_WIN:
                        TarotTransformer("TheExiled", (ME_PERSON, ))
                    }),
        TarotSocket("MT_SOCKET_Accuse",
                    TarotSignal(SIG_ACCUSE, [
                        ME_FACTION,
                    ]),
                    consequences={
                        CONSEQUENCE_WIN:
                        TarotTransformer("TheExiled", (ME_PERSON, ))
                    }),
    )

    AUTO_MEMO = "{ME_PERSON} practically owns {METROSCENE}."

    def custom_init(self, nart):
        if not self.elements.get(ME_AUTOREVEAL):
            sp = self.add_sub_plot(nart,
                                   "MT_REVEAL_RobberBaron",
                                   ident="REVEAL")
            if ME_PERSON not in self.elements:
                self.elements[ME_PERSON] = sp.elements[ME_PERSON]
            if ME_FACTION in sp.elements:
                self.elements[ME_FACTION] = sp.elements[ME_FACTION]
        if ME_FACTION not in self.elements:
            mynpc = self.elements[ME_PERSON]
            self.elements[ME_FACTION] = gears.factions.Circle(
                nart.camp, name="{} Industries".format(mynpc))
            mynpc.faction = self.elements[ME_FACTION]
        return True
Exemple #12
0
class Kleptocrat(TarotCard):
    # A politician with their hand in the treasury
    TAGS = (MT_THREAT, ME_PERSON)
    UNIQUE = True
    QOL = gears.QualityOfLife(prosperity=-2, stability=-2)
    active = True
    NEGATIONS = ("HasBeen", "TheExiled")

    SOCKETS = (
        TarotSocket("MT_SOCKET_Accuse",
                    TarotSignal(SIG_ACCUSE, [
                        ME_PERSON,
                    ]),
                    consequences={
                        CONSEQUENCE_WIN:
                        TarotTransformer("TheExiled", (ME_PERSON, ))
                    }),
        TarotSocket("MT_SOCKET_Cancel",
                    TarotSignal(SIG_CANCEL, [ME_PERSON]),
                    consequences={
                        CONSEQUENCE_WIN:
                        TarotTransformer("HasBeen", (ME_PERSON, ))
                    }),
        TarotSocket("MT_SOCKET_Extort",
                    TarotSignal(SIG_EXTORT, [ME_PERSON]),
                    consequences={
                        CONSEQUENCE_WIN:
                        TarotTransformer("CultHierophant", (ME_PERSON, )),
                        "CONSEQUENCE_GOAWAY":
                        TarotTransformer("TheExiled", (ME_PERSON, )),
                    }),
    )

    AUTO_MEMO = "{ME_PERSON} at {ME_PERSON.scene} is a corrupt {ME_PERSON.job}."

    def custom_init(self, nart):
        if not self.elements.get(ME_AUTOREVEAL):
            sp = self.add_sub_plot(nart,
                                   "MT_REVEAL_Kleptocrat",
                                   ident="REVEAL")
            if ME_PERSON not in self.elements:
                self.elements[ME_PERSON] = sp.elements[ME_PERSON]

        return True
Exemple #13
0
class Shortages(TarotCard):
    TAGS = (MT_THREAT, )
    QOL = gears.QualityOfLife(prosperity=-3, health=-2)
    active = True
    NEGATIONS = ("Recovery", )
    UNIQUE = True

    SOCKETS = (TarotSocket(
        "MT_SOCKET_FamineRelief",
        TarotSignal(SIG_FOODBOOST, []),
        consequences={CONSEQUENCE_WIN: TarotTransformer("Recovery", [])}), )

    AUTO_MEMO = "{METROSCENE} is suffering from a shortage of basic necessities."

    def custom_init(self, nart):
        if not self.elements.get(ME_AUTOREVEAL):
            sp = self.add_sub_plot(nart, "MT_REVEAL_Shortages", ident="REVEAL")

        return True
class TotalitarianCrackdown(Plot):
    # Elements:
    #   METROSCENE, METRO
    #   CRACKDOWN_REASON: An independent clause describing the circumstances of the crackdown.
    LABEL = "CONSEQUENCE_TOTALCRACKDOWN"
    active = True
    scope = "METRO"

    QOL = gears.QualityOfLife(
        0, 1, -2, -3, 0
    )

    def custom_init(self, nart):
        npc = self.register_element("NPC", self.elements["METRO"].city_leader)
        self.elements["ORIGINAL_FACTION"] = self.elements["METROSCENE"].faction
        return True

    def get_dialogue_grammar(self, npc: gears.base.Character, camp: gears.GearHeadCampaign):
        mygram = dict()

        if npc is not self.elements["NPC"]:
            mygram["[CURRENT_EVENTS]"] = [
                "{CRACKDOWN_REASON}.".format(**self.elements),
                "[THIS_IS_A_SECRET] {CRACKDOWN_REASON}.".format(**self.elements)
            ]

            if self.elements["NPC"]:
                mygram["News"] = [
                    "{NPC} rules {METROSCENE} with an iron fist".format(**self.elements),
                    "{NPC} has been cracking down on {METROSCENE}".format(**self.elements)
                ]

        return mygram

    def t_UPDATE(self, camp):
        # This plot ends if the metroscene faction changes or the NPC is deposed.
        if self.elements["METROSCENE"].faction is not self.elements["ORIGINAL_FACTION"]:
            self.end_plot(camp, True)
        elif self.elements["NPC"] and self.elements["METRO"].city_leader is not self.elements["NPC"]:
            self.end_plot(camp, True)
Exemple #15
0
class Demagogue(TarotCard):
    # A character exploiting local divisions for personal gain
    TAGS = (MT_THREAT, ME_PERSON)
    UNIQUE = True
    QOL = gears.QualityOfLife(community=-3)
    active = True
    NEGATIONS = ("HasBeen", )

    SOCKETS = (
        TarotSocket("MT_SOCKET_Cancel",
                    TarotSignal(SIG_CANCEL, [ME_PERSON]),
                    consequences={
                        CONSEQUENCE_WIN:
                        TarotTransformer("HasBeen", (ME_PERSON, ))
                    }),
        TarotSocket("MT_SOCKET_Extort",
                    TarotSignal(SIG_EXTORT, [ME_PERSON]),
                    consequences={
                        CONSEQUENCE_WIN:
                        TarotTransformer("CultHierophant", (ME_PERSON, )),
                        "CONSEQUENCE_GOAWAY":
                        TarotTransformer("TheExiled", (ME_PERSON, )),
                    }),
    )

    def custom_init(self, nart):
        if not self.elements.get(ME_AUTOREVEAL):
            sp = self.add_sub_plot(nart, "MT_REVEAL_Demagogue", ident="REVEAL")
            if ME_PERSON not in self.elements:
                self.elements[ME_PERSON] = sp.elements[ME_PERSON]
        else:
            self.memo = Memo(
                "You learned that {} is a demagogue.".format(
                    self.elements[ME_PERSON]),
                self.elements[ME_PERSON].get_scene())
        return True
Exemple #16
0
class HasBeen(TarotCard):
    # A person's influence has been spent, reducing them to an empty punchline.
    TAGS = (ME_PERSON, )
    QOL = gears.QualityOfLife(community=1)
    active = True
Exemple #17
0
def get_element_effect(elem, elem_id, script_list):
    myeffect = gears.QualityOfLife()
    for card in script_list:
        if card.elements.get(elem_id) is elem and hasattr(card, "QOL"):
            myeffect.add(card.QOL)
    return myeffect
Exemple #18
0
class TheDisbanded(TarotCard):
    # This faction has been utterly destroyed; it now exists only as a cautionary tale.
    TAGS = (ME_FACTION, )
    QOL = gears.QualityOfLife(stability=1)
    active = True
Exemple #19
0
class CultHierophant(TarotCard):
    # This character has become an untouchable and poisonous presence.
    TAGS = (ME_PERSON, )
    QOL = gears.QualityOfLife(stability=-3, community=-3)
    active = True
Exemple #20
0
class Renegades(TarotCard):
    TAGS = (MT_FACTION, )
    QOL = gears.QualityOfLife(defense=-1)
Exemple #21
0
class OmegaTalksTyphon(Plot):
    LABEL = "DZD_OMEGA1004"
    active = True
    scope = "METRO"

    RUMOR = Rumor(
        "there's a robot hanging out at {NPC_SCENE}",
        offer_msg=
        "He seems to be a nice guy... I just never met a robot that's a person before. But once you start talking you forget that he's made of metal.",
        offer_subject="a robot hanging out",
        offer_subject_data="the robot",
        memo="There's a robot hanging out at {NPC_SCENE}.",
        prohibited_npcs=("NPC"))

    QOL = gears.QualityOfLife(community=1)

    def custom_init(self, nart):
        scene = self.seek_element(nart,
                                  "NPC_SCENE",
                                  self._is_best_scene,
                                  scope=self.elements["METROSCENE"],
                                  backup_seek_func=self._is_okay_scene)
        npc = self.register_element("NPC",
                                    nart.camp.get_major_npc("Omega 1004"),
                                    dident="NPC_SCENE")
        self._got_initial_story = False
        self._got_typhon_story = False

        self.infoblasts = (OneShotInfoBlast(
            "Snake Lake",
            "I was presenting arguments in favor of Constitutional Amendment 79-MS, which granted full citizenship rights to all sentient beings no matter if they are organic, mechanical, or biomechanical. The news media called this 'The Omega Law' but it is not a law it is a constitutional amendment."
        ), )
        self.shop = services.SkillTrainer([
            gears.stats.Biotechnology, gears.stats.Wildcraft,
            gears.stats.Science
        ])

        return True

    def _is_best_scene(self, nart, candidate):
        return (isinstance(candidate, gears.GearHeadScene)
                and gears.tags.SCENE_PUBLIC in candidate.attributes
                and gears.tags.SCENE_BUILDING in candidate.attributes)

    def _is_okay_scene(self, nart, candidate):
        return isinstance(candidate, gears.GearHeadScene
                          ) and gears.tags.SCENE_PUBLIC in candidate.attributes

    def NPC_offers(self, camp):
        mylist = list()
        if not self._got_initial_story:
            if camp.pc.has_badge("Typhon Slayer"):
                mylist.append(
                    Offer(
                        "[THANKS] I replaced all of my rusted out body panels, had some chrome installed, and bought myself a genuine face. It's top quality synthetic polyvinyl chloride.",
                        ContextTag([context.CUSTOM]),
                        data={
                            "reply": "Omega! You're looking good these days."
                        },
                        subject=self,
                        subject_start=True))
            else:
                mylist.append(
                    Offer(
                        "Yes, your information is correct, though I am not certain I feel comfortable with that being my best known achievement. It is a pleasure to meet a fellow cavalier.",
                        ContextTag([context.CUSTOM]),
                        data={
                            "reply":
                            "Aren't you the robot that helped defeat Typhon?"
                        },
                        subject=self,
                        subject_start=True))

            mylist.append(
                Offer(
                    "I am happy to be back at my old task, cataloging neofauna in the trans-Eurasian dead zone. I spent far too much of the past year indoors at the parliament buildings in Snake Lake. I would be happy to discuss my research with you sometime.",
                    ContextTag([context.CUSTOMREPLY]),
                    data={"reply": "What have you been doing lately?"},
                    subject=self,
                    effect=self._do_introduction))
        else:
            mylist.append(
                Offer(
                    "Nothing would make me happier... other than possibly discovering a new type of feral synthoid.",
                    ContextTag([context.CUSTOM]),
                    data={
                        "reply":
                        "I would like to discuss your research findings."
                    },
                    dead_end=True,
                    effect=self.shop))
            if random.randint(1, 2) == 1 and not self._got_typhon_story:
                mylist.append(
                    Offer(
                        "I have been thinking about Typhon again, and how tragic its life was. Imagine being created solely as a weapon. A living, feeling tool of death. And think of Cetus, never truly born, but experimented upon and tortured for centuries. I run the scenarios again and again yet cannot find a happy ending.",
                        ContextTag([context.CUSTOM]),
                        data={
                            "reply":
                            "You look sort of down today... Is anything wrong?"
                        },
                        subject=self.shop,
                        subject_start=True))

            mylist.append(
                Offer(
                    "And that is what bothers me- unlike my human lancemates, it was not fear or will to survive that led me to kill Typhon. It was the cold equation that Typhon must die so many others could live. Even with the benefit of hindsight I see no other solutions.",
                    ContextTag([context.CUSTOMREPLY]),
                    data={"reply": "You did the only thing you could do."},
                    subject=self.shop,
                    effect=self._do_typhon_talk))

            mylist.append(
                Offer(
                    "Yet as cavaliers we must always try to make things better. I know my actions that day were mathematically justified. It was the cold equation that Typhon must die so many others could live. Still, I mourn for the creature that was never given a chance to really exist.",
                    ContextTag([context.CUSTOMREPLY]),
                    data={
                        "reply": "Life isn't fair. In fact usually it sucks."
                    },
                    subject=self.shop,
                    effect=self._do_typhon_talk))

        for ib in self.infoblasts:
            if ib.active:
                mylist.append(ib.build_offer())

        return mylist

    def _do_introduction(self, camp):
        self._got_initial_story = True
        self.RUMOR = False
        self.memo = pbge.memos.Memo(
            "Omega 1004 at {NPC_SCENE} offered to discuss his research with you."
            .format(**self.elements),
            location=self.elements["NPC_SCENE"])

    def _do_typhon_talk(self, camp):
        self._got_typhon_story = True
Exemple #22
0
class Recovery(TarotCard):
    # From an illness or physical problem
    QOL = gears.QualityOfLife(health=1)
    active = True
Exemple #23
0
class TheExiled(TarotCard):
    # A person has been driven out due to their real or perceived crimes.
    TAGS = (ME_PERSON, )
    QOL = gears.QualityOfLife(stability=1)
    active = True
Exemple #24
0
class MilitantSplinter(TarotCard):
    TAGS = (MT_FACTION, MT_THREAT)
    NEGATIONS = (TheDisbanded, )
    ASCENSIONS = ()
    QOL = gears.QualityOfLife(stability=-2, community=-2, defense=2)

    def get_incrimination_offers(self, beta_card, npc, camp, interaction):
        """

        :type camp: gears.GearHeadCampaign
        """
        myoff = list()
        myfac = self.elements[ME_FACTION]
        mycity = camp.scene.get_metro_scene()
        if npc.faction and npc.faction.get_faction_tag(
        ) == myfac.get_faction_tag() and npc.faction != myfac:
            # This character is a member of the main faction, but not a member of the splinter faction.
            myoff.append(
                Offer(
                    "[THIS_IS_TERRIBLE_NEWS] [FACTION_MUST_BE_PUNISHED] You are authorized to launch a mecha strike against their command center.",
                    context=(context.REVEAL, ),
                    subject=self,
                    subject_start=True,
                    data={
                        "reveal":
                        "{} has {}".format(
                            myfac,
                            beta_card.elements.get(ME_CRIMED, "gone rogue")),
                        "faction":
                        str(self.elements[ME_FACTION])
                    },
                    effect=CardCaller(beta_card, interaction,
                                      self._start_disbanding_mission)))
        elif npc.faction and npc.faction != myfac and gears.tags.Police in npc.faction.get_faction_tag(
        ).factags:
            # This character is a police officer; they can also authorize action against the lawbreakers.
            myoff.append(
                Offer(
                    "[THIS_IS_TERRIBLE_NEWS] [FACTION_MUST_BE_PUNISHED] You are authorized to launch a mecha strike against their command center.",
                    context=(context.REVEAL, ),
                    subject=self,
                    subject_start=True,
                    data={
                        "reveal":
                        "{} has {}".format(
                            myfac,
                            beta_card.elements.get(ME_CRIMED, "gone rogue")),
                        "faction":
                        str(self.elements[ME_FACTION])
                    },
                    effect=CardCaller(beta_card, interaction,
                                      self._start_disbanding_mission)))
        elif mycity and mycity.faction and npc.faction and npc.faction != myfac and npc.faction.get_faction_tag(
        ) is mycity.faction.get_faction_tag():
            # This character belongs to the city's ruling faction. They too can authorize a mecha strike.
            myoff.append(
                Offer(
                    "[THIS_IS_TERRIBLE_NEWS] [FACTION_MUST_BE_PUNISHED] You are authorized to launch a mecha strike against their command center.",
                    context=(context.REVEAL, ),
                    subject=self,
                    subject_start=True,
                    data={
                        "reveal":
                        "{} has {}".format(
                            myfac,
                            beta_card.elements.get(ME_CRIMED, "gone rogue")),
                        "faction":
                        str(self.elements[ME_FACTION])
                    },
                    effect=CardCaller(beta_card, interaction,
                                      self._start_disbanding_mission)))

        return myoff

    INTERACTIONS = (
        Interaction(
            # Revealing an atrocity committed by the splinter faction will force them to disband.
            card_checker=TagChecker(needed_tags=(MT_INCRIMINATING, ),
                                    needed_elements=(ME_FACTION, )),
            action_triggers={
                mechtarot.AT_GET_DIALOGUE_OFFERS: get_incrimination_offers,
            },
            consequences={
                "Justice":
                Consequence(alpha_card_tf=CardTransformer(
                    "TheDisbanded", alpha_params=(ME_FACTION, )),
                            beta_card_tf=CardDeactivator()),
                "Lose":
                Consequence(alpha_card_tf=CardTransformer(
                    "Renegades", alpha_params=(ME_FACTION, )),
                            beta_card_tf=CardDeactivator()),
            }), )

    def custom_init(self, nart):
        # Add the subplot which will decide the splinter faction and provide a discovery route.
        if not self.elements.get(ME_AUTOREVEAL):
            tplot = self.add_sub_plot(nart,
                                      "DZD_SplinterFaction",
                                      ident="REVEAL")
            self.elements[ME_FACTION] = tplot.elements["FACTION"]
        else:
            self.memo = "You learned that {} has been taken over by extremists.".format(
                self.elements[ME_FACTION])

        self.adventure_seed = None

        return True

    def REVEAL_WIN(self, camp):
        # The subplot has been won.
        self.visible = True
        self.memo = "You learned that {} has been taken over by extremists.".format(
            self.elements[ME_FACTION])

    def get_dialogue_grammar(self, npc, camp):
        mygram = collections.defaultdict(list)
        if npc.faction is not self.elements[ME_FACTION]:
            if not self.visible:
                mygram["[News]"].append(
                    "there has been a lot of hostility from {} lately".format(
                        self.elements[ME_FACTION]))
        if npc.faction is self.elements[ME_FACTION]:
            mygram["[HELLO]"].append("I am proud to be a member of {}.".format(
                self.elements[ME_FACTION]))
        return mygram

    def _start_disbanding_mission(self, camp, beta_card, interaction):
        self.adventure_seed = missionbuilder.BuildAMissionSeed(
            camp,
            "Strike {}'s command center".format(self.elements[ME_FACTION]),
            (self.elements["LOCALE"], self.elements["MISSION_GATE"]),
            enemy_faction=self.elements[ME_FACTION],
            rank=self.rank,
            objectives=(missionbuilder.BAMO_STORM_THE_CASTLE, ),
            cash_reward=500,
            experience_reward=250,
            data={
                "win":
                CardCaller(self, beta_card,
                           interaction.consequences["Justice"]),
                "lose":
                CardCaller(self, beta_card, interaction.consequences["Lose"]),
                "win_message":
                "With their command center destroyed, the remnants of {} are quickly brought to justice."
                .format(self.elements[ME_FACTION]),
                "lose_message":
                "Following the attack on their command center, the remnants of {} scatter to the wind. They will continue to be a thorn in the side of {} for years to come."
                .format(self.elements[ME_FACTION], self.elements["LOCALE"]),
            })
        self.memo = "You have been authorized to take action against {}'s command center.".format(
            self.elements[ME_FACTION])
        self.elements["METROSCENE"].purge_faction(camp,
                                                  self.elements[ME_FACTION])

    def MISSION_GATE_menu(self, camp, thingmenu):
        if self.adventure_seed:
            thingmenu.add_item(self.adventure_seed.name, self.adventure_seed)

    def t_UPDATE(self, camp):
        # If the adventure has ended, get rid of it.
        if self.adventure_seed and self.adventure_seed.ended:
            if self.adventure_seed.is_won():
                pbge.alert(self.adventure_seed.data["win_message"])
                self.adventure_seed.data["win"](camp)
            else:
                pbge.alert(self.adventure_seed.data["lose_message"])
                self.adventure_seed.data["lose"](camp)
            self.adventure_seed = None
Exemple #25
0
class EcologicalBalance(TarotCard):
    # Recovery from pollution or other ecological damage
    QOL = gears.QualityOfLife(prosperity=1)
    active = True
Exemple #26
0
class RanMagnusMechaFactory(Plot):
    LABEL = "DZD_MAGNUSMECHA"

    active = True
    scope = "METRO"

    QOL = gears.QualityOfLife(defense=1, prosperity=1)

    def custom_init(self, nart):
        # Create a building within the town.
        garage_name = "Magnus Mecha Works"
        building = self.register_element(
            "_EXTERIOR",
            ghterrain.IndustrialBuilding(
                waypoints={
                    "DOOR": ghwaypoints.ScrapIronDoor(name=garage_name)
                },
                door_sign=(ghterrain.FixitShopSignEast,
                           ghterrain.FixitShopSignSouth),
                tags=[
                    pbge.randmaps.CITY_GRID_ROAD_OVERLAP,
                    pbge.randmaps.IS_CONNECTED_ROOM
                ]),
            dident="METROSCENE")

        self.rank = 55
        tplot = self.add_sub_plot(nart,
                                  "MECHA_WORKSHOP",
                                  elements={"BUILDING_NAME": garage_name})
        self.elements["LOCALE"] = tplot.elements["LOCALE"]

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

        npc = self.register_element(
            "SHOPKEEPER",
            gears.selector.random_character(
                name="Ran Magnus",
                rank=75,
                local_tags=(gears.personality.GreenZone, ),
                job=gears.jobs.ALL_JOBS["Mecha Designer"],
                birth_year=106,
                combatant=False,
                faction=gears.factions.ProDuelistAssociation,
                personality=[
                    personality.Passionate, personality.Sociable,
                    personality.Fellowship
                ],
                mnpcid="RAN_MAGNUS",
                gender=gears.genderobj.Gender.get_default_female(),
                portrait='card_f_ranmagnus.png',
                colors=(gears.color.GriffinGreen, gears.color.DarkSkin,
                        gears.color.Fuschia, gears.color.PlasmaBlue,
                        gears.color.CardinalRed),
            ))
        npc.place(tplot.elements["LOCALE"],
                  team=tplot.elements["CIVILIAN_TEAM"])

        self.shop = services.Shop(
            npc=npc,
            shop_faction=gears.factions.ProDuelistAssociation,
            ware_types=services.MEXTRA_STORE,
            rank=55)

        self.got_reward = False

        self.magnus_info = (
            OneShotInfoBlast(
                "Osmund",
                "We used to be lancemates back in the old days. You couldn't ask for a better partner. Then his knees gave out and I discovered that I like building mecha better than I like blasting them."
            ),
            OneShotInfoBlast(
                "mecha",
                "Kind of a lifelong obsession for me. One of several, to be honest. But, it's the one that gets me paid. I've been designing mecha for thirty years now. Around ten years back I started this company and now I build mecha, too."
            ),
            OneShotInfoBlast(
                "design",
                "It's important that a mecha know what its job is. There is no such thing as a perfect mecha, just fitness for a particular role. Install that which is useful, uninstall that which is not, and create that which is essentially your own."
            ),
            OneShotInfoBlast(
                "factory",
                "This is my first factory in Eurasia. We're trying to ramp up production; the possibility of a war with Luna has doubled the demand for our meks. It's way too cold in {} but the local food is delicious so that kind of evens out."
                .format(self.elements["METROSCENE"]),
                subject_text="the factory"),
        )

        return True

    def SHOPKEEPER_offers(self, camp):
        mylist = list()

        if camp.campdata.get("MINE_MISSION_WON") and not self.got_reward:
            mylist.append(
                Offer(
                    "[HELLO] Osmund told me that you liberated my mine from those bandits; that means you get to buy the good stuff.",
                    context=ContextTag([context.HELLO]),
                    effect=self._open_custom_shop))
        else:
            mylist.append(
                Offer(
                    "[HELLO] [_MAGNUS_SPIEL]",
                    context=ContextTag([context.HELLO]),
                ))

        mylist.append(
            Offer("[OPENSHOP]",
                  context=ContextTag([context.OPEN_SHOP]),
                  effect=self.shop,
                  data={
                      "shop_name": str(self.elements["LOCALE"]),
                      "wares": "mecha"
                  }))

        for inf in self.magnus_info:
            if inf.active:
                mylist.append(inf.build_offer())

        return mylist

    def _open_custom_shop(self, camp):
        self.got_reward = True
        self.shop.sell_champion_equipment = True
        self.shop.last_updated = -1
        self.elements["SHOPKEEPER"].relationship.history.append(
            gears.relationships.Memory(
                "you liberated my mine from some bandits",
                "I recovered your mine from bandits", 10,
                (gears.relationships.MEM_AidedByPC, )))
        camp.campdata["CD_SPOKE_TO_RAN"] = True

    def _get_dialogue_grammar(self, npc, camp):
        mygram = dict()
        mygram["[_MAGNUS_SPIEL]"] = [
            "This factory is where the magic happens.",
            "Next time you're in Wujung tell Osmund to come visit {METROSCENE}."
            .format(**self.elements),
            "Remember when [MEM_AidedByPC]? Good times.",
            "Obviously pilots are important, but it's the right design that spells the difference between victory and defeat.",
            "This is where the mecha magic happens."
        ]

        return mygram
class HateClub(TarotCard):
    TAGS = (MT_HOUSE,MT_THREAT)
    QOL = gears.QualityOfLife(stability=-2,community=-2)