Exemple #1
0
    def redraw(self, window, breadcrumbs=False):
        """
        Repaint the screen with the helper UI.
        """

        if self.manager.cursor_is_on_player() and breadcrumbs:
            self._breadcrumbs(window)

        if self._things_to_buy_identify() is not None:
            item, price = self._things_to_buy_identify()
            items = shops.buy_identify(self.player.charisma(), item, price, self.player.sucker())

            identify_frame = self._identify_box(items)
            identify_frame.overwrite(window)
        elif self._things_to_sell_identify() is not None:
            item, price = self._things_to_sell_identify()
            items = shops.sell_identify(item, price, self.player.sucker())

            identify_frame = self._identify_box(items)
            identify_frame.overwrite(window)

        status_frame = self._status_box()
        dungeon_frame = self._level_box()
        intrinsic_frame = self._intrinsic_box()

        status_frame.overwrite(window)
        dungeon_frame.overwrite(window)
        intrinsic_frame.overwrite(window)

        window.noutrefresh()
Exemple #2
0
    def redraw(self, window, breadcrumbs=False):
        """
        Repaint the screen with the helper UI.
        """

        if self.manager.cursor_is_on_player() and breadcrumbs:
            self._breadcrumbs(window)

        if self._things_to_buy_identify() is not None:
            item, price = self._things_to_buy_identify()
            items = shops.buy_identify(self.player.charisma(), item, price,
                                       self.player.sucker())

            identify_frame = self._identify_box(items)
            identify_frame.overwrite(window)
        elif self._things_to_sell_identify() is not None:
            item, price = self._things_to_sell_identify()
            items = shops.sell_identify(item, price, self.player.sucker())

            identify_frame = self._identify_box(items)
            identify_frame.overwrite(window)

        status_frame = self._status_box()
        dungeon_frame = self._level_box()
        intrinsic_frame = self._intrinsic_box()

        status_frame.overwrite(window)
        dungeon_frame.overwrite(window)
        intrinsic_frame.overwrite(window)

        window.noutrefresh()
Exemple #3
0
def test_appearance_identify():
    # the shop functions return both(all) the possible prices. Updated test to match
    assert set([
        ("orcish dagger", 2, 12, "crude dagger"), 
        ("orcish dagger", 1, 12, "crude dagger")
    ]) == sell_identify("crude dagger", 2)
Exemple #4
0
def test_sucker_penalty():
    assert set([
        ("orcish dagger", 1, 12, "crude dagger")
    ]) == sell_identify("crude dagger", 1, True)
Exemple #5
0
def test_random_markdown():
    assert set([
        ("death", 125, 5, None), 
        ("wishing", 125, 5, None)
    ]) == sell_identify("wand", 125)
Exemple #6
0
def test_appearance_identify():
    # the shop functions return both(all) the possible prices. Updated test to match
    assert set([("orcish dagger", 2, 12, "crude dagger"),
                ("orcish dagger", 1, 12, "crude dagger")
                ]) == sell_identify("crude dagger", 2)
Exemple #7
0
def test_sucker_penalty():
    assert set([("orcish dagger", 1, 12, "crude dagger")
                ]) == sell_identify("crude dagger", 1, True)
Exemple #8
0
def test_random_markdown():
    assert set([("death", 125, 5, None),
                ("wishing", 125, 5, None)]) == sell_identify("wand", 125)