Пример #1
0
 def add_locations (self, *names):
     ret = []
     for name in names:
         if isinstance (name, tuple):
             name, attributes = name
         else:
             attributes = {}
         loc = maps.location ("Loc" + name, **attributes)
         self.m_locations[name] = loc
         ret.append (loc)
     return ret
Пример #2
0
    def construct(self, game):

        self.m_monster_cup = game.deck(self.mod_monster.MonsterCup)
        self.m_common_deck = game.deck(self.mod_common.CommonDeck)
        self.m_unique_deck = game.deck(self.mod_unique.UniqueDeck)
        self.m_spell_deck = game.deck(self.mod_spell.SpellDeck)
        self.m_skill_deck = game.deck(self.mod_skill.SkillDeck)

        class TerrorTrack_AHEvents(arkham.TrackEvent):
            def event(self, game, owner, level):
                print "drop ally"  # XXX
                if level == 10:
                    print "relax monster limit"  # XXX
                elif level > 10:
                    print "add to doom track"  # XXX

                for location in game.all_locations():
                    if location.attributes().get("terror_close") == level:
                        print "close location %s" % location.name()  # XXX

        self.mod_terror.track.add_event(TerrorTrack_AHEvents())

        maps.in_neighborhood(maps.neighborhood(game))
        merchant_district = maps.location("Merchant District", street=True)
        unvisited_isle = maps.location("Unvisited Isle", unstable=True)
        river_docks = maps.location("River Docks")
        the_unnamable = maps.location("The Unnamable", unstable=True)
        (maps.draw_from(merchant_district).out(
            unvisited_isle, black=True,
            white=True).back().out(the_unnamable, black=True,
                                   white=True).back().out(river_docks,
                                                          black=True,
                                                          white=True).back())

        maps.in_neighborhood(maps.neighborhood(game))
        miskatonic_u = maps.location("Miskatonic University", street=True)
        science_building = maps.location("Science Building", unstable=True)
        administration = maps.location("Administration")
        library = maps.location("Library")
        (maps.draw_from(miskatonic_u).out(
            science_building, black=True,
            white=True).back().out(administration, black=True,
                                   white=True).back().out(library,
                                                          black=True,
                                                          white=True).back())

        maps.in_neighborhood(maps.neighborhood(game))
        uptown = maps.location("Uptown", street=True)
        st_mary = maps.location("St. Mary's Hospital",
                                hospital=True,
                                seeker_avoids=True)
        magick_shop = maps.location("Ye Olde Magick Shoppe", terror_close=9)
        woods = maps.location("Woods", unstable=True)
        (maps.draw_from(uptown).out(
            st_mary, black=True,
            white=True).back().out(magick_shop, black=True,
                                   white=True).back().out(woods,
                                                          black=True,
                                                          white=True).back())

        maps.in_neighborhood(maps.neighborhood(game))
        southside = maps.location("Southside", street=True)
        historical_society = maps.location \
            ("Historical society", unstable = True)
        south_church = maps.location("South Church")
        ma_s_boarding = maps.location("Ma's Boarding House")
        (maps.draw_from(southside).out(
            historical_society, black=True,
            white=True).back().out(south_church, black=True,
                                   white=True).back().out(ma_s_boarding,
                                                          black=True,
                                                          white=True).back())

        maps.in_neighborhood(maps.neighborhood(game))
        french_hill = maps.location("French Hill", street=True)
        silver_twilight = maps.location \
            ("Silver Twilight Lodge", unstable = True)
        witch_house = maps.location("The Witch House", unstable=True)
        (maps.draw_from(french_hill).out(silver_twilight,
                                         black=True,
                                         white=True).back().out(
                                             witch_house,
                                             black=True,
                                             white=True).back())

        maps.in_neighborhood(maps.neighborhood(game))
        rivertown = maps.location("Rivertown", street=True)
        general_store = maps.location("General Store", terror_close=3)
        black_cave = maps.location("Black Cave", unstable=True)
        graveyard = maps.location("Graveyard", unstable=True)
        (maps.draw_from(rivertown).out(
            general_store, black=True,
            white=True).back().out(black_cave, black=True,
                                   white=True).back().out(graveyard,
                                                          black=True,
                                                          white=True).back())

        maps.in_neighborhood(maps.neighborhood(game))
        easttown = maps.location("Easttown", street=True)
        police_station = maps.location("Police Station")
        velmas_dinner = maps.location("Velma's Dinner")
        hibbs_roadhouse = maps.location("Hibb's Roadhouse", unstable=True)
        (maps.draw_from(easttown).out(
            police_station, black=True,
            white=True).back().out(velmas_dinner, black=True,
                                   white=True).back().out(hibbs_roadhouse,
                                                          black=True,
                                                          white=True).back())

        maps.in_neighborhood(maps.neighborhood(game))
        downtown = maps.location("Downtown", street=True)
        independence_sq = maps.location("Independence Square", unstable=True)
        arkham_asylum = maps.location("Arkham Asylum",
                                      asylum=True,
                                      seeker_avoids=True)
        bank_of_arkham = maps.location("Bank of Arkham")
        (maps.draw_from(downtown).out(
            independence_sq, black=True,
            white=True).back().out(arkham_asylum, black=True,
                                   white=True).back().out(bank_of_arkham,
                                                          black=True,
                                                          white=True).back())

        maps.in_neighborhood(maps.neighborhood(game))
        northside = maps.location("Northside", street=True)
        train_station = maps.location("Train Station")
        newspaper = maps.location("Newspaper")
        curiosity_shop = maps.location("Curiositie Shoppe", terror_close=6)
        (maps.draw_from(northside).out(
            train_station, black=True,
            white=True).back().out(newspaper, black=True,
                                   white=True).back().out(curiosity_shop,
                                                          black=True,
                                                          white=True).back())

        maps.in_neighborhood(None)
        maps.location("Sky", sky=True)
        maps.location("Lost in Time and Space", lost_in_time_and_space=True)

        (maps.draw_from(downtown).to(northside, black=True).back(
            white=True).to(merchant_district, black=True).back(white=True).to(
                miskatonic_u,
                black=True).back(white=True).out(french_hill).back().to(
                    uptown, black=True).back(white=True).to(
                        southside, black=True).back(white=True).to(
                            french_hill, black=True).back(white=True).to(
                                rivertown,
                                black=True).back(white=True).to(easttown,
                                                                black=True).
         back(white=True).to(downtown, black=True).back(
             white=True).to(merchant_district).back().to(rivertown).back())

        game.add_investigator(
            arkham.CommonInvestigator("\"Ashcan\" Pete", {
                arkham.health_sanity: 4,
                arkham.health_stamina: 6
            }, 1, 3, arkham.SkillScales(4, 3, 6, 5, 5, 3, 3), river_docks))

        import mod_ah_monsters
        mod_ah_monsters.build(game, self)

        import mod_ah_items
        mod_ah_items.build(game, self)

        # xxx Some of these will have special skills, and it will be
        # necessary to expand the definition.  For now, this condensed
        # form suffices.
        Ancient = self.mod_ancient.Ancient

        def ancient(name):
            class AH_Ancient(Ancient):
                def __init__(self):
                    Ancient.__init__(self, name)

            return AH_Ancient

        def Nyarlathotep(monster_cup):
            class Nyarlathotep(Ancient):
                def __init__(self):
                    Ancient.__init__(self, "Nyarlathotep")

                def before_turn_0(self, game):
                    import random
                    masks = [
                        monster for monster in monster_cup.registered_cards()
                        if monster.attributes().flag("mask")
                    ]

                    for mask in random.sample(masks, 5):
                        monster_cup.activate(mask)

                def before_battle(self, game):
                    # Any investigator with no Clue tokens is devoured.
                    for investigator in game.investigators():
                        if investigator.clues() == 0:
                            investigator.devour(game, self)

            return Nyarlathotep

        for ancient in [
                ancient("Azathoth"),
                ancient("Cthulhu"),
                Nyarlathotep(self.m_monster_cup)
        ]:
            self.mod_ancient.register(ancient)
Пример #3
0
    def construct (self, game):

        self.m_monster_cup = game.deck (self.mod_monster.MonsterCup)
        self.m_common_deck = game.deck (self.mod_common.CommonDeck)
        self.m_unique_deck = game.deck (self.mod_unique.UniqueDeck)
        self.m_spell_deck = game.deck (self.mod_spell.SpellDeck)
        self.m_skill_deck = game.deck (self.mod_skill.SkillDeck)

        class TerrorTrack_AHEvents (arkham.TrackEvent):
            def event (self, game, owner, level):
                print "drop ally" # XXX
                if level == 10:
                    print "relax monster limit" # XXX
                elif level > 10:
                    print "add to doom track" # XXX

                for location in game.all_locations ():
                    if location.attributes ().get ("terror_close") == level:
                        print "close location %s" % location.name () # XXX

        self.mod_terror.track.add_event (TerrorTrack_AHEvents ())

        maps.in_neighborhood (maps.neighborhood (game))
        merchant_district = maps.location ("Merchant District", street = True)
        unvisited_isle = maps.location ("Unvisited Isle", unstable = True)
        river_docks = maps.location ("River Docks")
        the_unnamable = maps.location ("The Unnamable", unstable = True)
        (maps.draw_from (merchant_district)
         .out (unvisited_isle, black = True, white = True).back ()
         .out (the_unnamable, black = True, white = True).back ()
         .out (river_docks, black = True, white = True).back ())

        maps.in_neighborhood (maps.neighborhood (game))
        miskatonic_u = maps.location ("Miskatonic University", street = True)
        science_building = maps.location ("Science Building", unstable = True)
        administration = maps.location ("Administration")
        library = maps.location ("Library")
        (maps.draw_from (miskatonic_u)
         .out (science_building, black = True, white = True).back ()
         .out (administration, black = True, white = True).back ()
         .out (library, black = True, white = True).back ())

        maps.in_neighborhood (maps.neighborhood (game))
        uptown = maps.location ("Uptown", street = True)
        st_mary = maps.location ("St. Mary's Hospital",
                                 hospital = True, seeker_avoids = True)
        magick_shop = maps.location ("Ye Olde Magick Shoppe", terror_close = 9)
        woods = maps.location ("Woods", unstable = True)
        (maps.draw_from (uptown)
         .out (st_mary, black = True, white = True).back ()
         .out (magick_shop, black = True, white = True).back ()
         .out (woods, black = True, white = True).back ())

        maps.in_neighborhood (maps.neighborhood (game))
        southside = maps.location ("Southside", street = True)
        historical_society = maps.location \
            ("Historical society", unstable = True)
        south_church = maps.location ("South Church")
        ma_s_boarding = maps.location ("Ma's Boarding House")
        (maps.draw_from (southside)
         .out (historical_society, black = True, white = True).back ()
         .out (south_church, black = True, white = True).back ()
         .out (ma_s_boarding, black = True, white = True).back ())

        maps.in_neighborhood (maps.neighborhood (game))
        french_hill = maps.location ("French Hill", street = True)
        silver_twilight = maps.location \
            ("Silver Twilight Lodge", unstable = True)
        witch_house = maps.location ("The Witch House", unstable = True)
        (maps.draw_from (french_hill)
         .out (silver_twilight, black = True, white = True).back ()
         .out (witch_house, black = True, white = True).back ())

        maps.in_neighborhood (maps.neighborhood (game))
        rivertown = maps.location ("Rivertown", street = True)
        general_store = maps.location ("General Store", terror_close = 3)
        black_cave = maps.location ("Black Cave", unstable = True)
        graveyard = maps.location ("Graveyard", unstable = True)
        (maps.draw_from (rivertown)
         .out (general_store, black = True, white = True).back ()
         .out (black_cave, black = True, white = True).back ()
         .out (graveyard, black = True, white = True).back ())

        maps.in_neighborhood (maps.neighborhood (game))
        easttown = maps.location ("Easttown", street = True)
        police_station = maps.location ("Police Station")
        velmas_dinner = maps.location ("Velma's Dinner")
        hibbs_roadhouse = maps.location ("Hibb's Roadhouse", unstable = True)
        (maps.draw_from (easttown)
         .out (police_station, black = True, white = True).back ()
         .out (velmas_dinner, black = True, white = True).back ()
         .out (hibbs_roadhouse, black = True, white = True).back ())

        maps.in_neighborhood (maps.neighborhood (game))
        downtown = maps.location ("Downtown", street = True)
        independence_sq = maps.location ("Independence Square", unstable = True)
        arkham_asylum = maps.location ("Arkham Asylum",
                                       asylum = True, seeker_avoids = True)
        bank_of_arkham = maps.location ("Bank of Arkham")
        (maps.draw_from (downtown)
         .out (independence_sq, black = True, white = True).back ()
         .out (arkham_asylum, black = True, white = True).back ()
         .out (bank_of_arkham, black = True, white = True).back ())

        maps.in_neighborhood (maps.neighborhood (game))
        northside = maps.location ("Northside", street = True)
        train_station = maps.location ("Train Station")
        newspaper = maps.location ("Newspaper")
        curiosity_shop = maps.location ("Curiositie Shoppe", terror_close = 6)
        (maps.draw_from (northside)
         .out (train_station, black = True, white = True).back ()
         .out (newspaper, black = True, white = True).back ()
         .out (curiosity_shop, black = True, white = True).back ())

        maps.in_neighborhood (None)
        maps.location ("Sky", sky = True)
        maps.location ("Lost in Time and Space", lost_in_time_and_space = True)

        (maps.draw_from (downtown)
         .to (northside, black = True).back (white = True)
         .to (merchant_district, black = True).back (white = True)
         .to (miskatonic_u, black = True).back (white = True)
         .out (french_hill).back ()
         .to (uptown, black = True).back (white = True)
         .to (southside, black = True).back (white = True)
         .to (french_hill, black = True).back (white = True)
         .to (rivertown, black = True).back (white = True)
         .to (easttown, black = True).back (white = True)
         .to (downtown, black = True).back (white = True)
         .to (merchant_district).back ()
         .to (rivertown).back ())

        game.add_investigator (
            arkham.CommonInvestigator (
                "\"Ashcan\" Pete",
                {arkham.health_sanity:4,
                 arkham.health_stamina: 6},
                1, 3,
                arkham.SkillScales (4,
                                    3, 6, 5,
                                    5, 3, 3),
                river_docks
            )
        )

        import mod_ah_monsters
        mod_ah_monsters.build (game, self)

        import mod_ah_items
        mod_ah_items.build (game, self)

        # xxx Some of these will have special skills, and it will be
        # necessary to expand the definition.  For now, this condensed
        # form suffices.
        Ancient = self.mod_ancient.Ancient
        def ancient (name):
            class AH_Ancient (Ancient):
                def __init__ (self):
                    Ancient.__init__ (self, name)
            return AH_Ancient

        def Nyarlathotep (monster_cup):
            class Nyarlathotep (Ancient):
                def __init__ (self):
                    Ancient.__init__ (self, "Nyarlathotep")

                def before_turn_0 (self, game):
                    import random
                    masks = [monster
                             for monster in monster_cup.registered_cards ()
                             if monster.attributes ().flag ("mask")]

                    for mask in random.sample (masks, 5):
                        monster_cup.activate (mask)

                def before_battle (self, game):
                    # Any investigator with no Clue tokens is devoured.
                    for investigator in game.investigators ():
                        if investigator.clues () == 0:
                            investigator.devour (game, self)

            return Nyarlathotep

        for ancient in [ancient ("Azathoth"),
                        ancient ("Cthulhu"),
                        Nyarlathotep (self.m_monster_cup)]:
            self.mod_ancient.register (ancient)