From 1425c29558e242df93042fe6d99653fae6247a36 Mon Sep 17 00:00:00 2001 From: Jers Date: Sun, 8 Dec 2024 13:11:12 -0600 Subject: [PATCH] Added flag to exclude specific items by name --- args/items.py | 3 +++ data/items.py | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/args/items.py b/args/items.py index fb0bc0c1..f7467b48 100644 --- a/args/items.py +++ b/args/items.py @@ -55,6 +55,7 @@ def parse(parser): help="All weapons enable swdtech and runic") items.add_argument("-saw", "--stronger-atma-weapon", action="store_true", help="Atma Weapon moved to higher tier and divisor reduced from 64 to 32") + items.add_argument("-exi", "--exclude-items", type=str, help="Items to exclude from shops and chests. Doesn't affect drops. Separate with periods") def process(args): @@ -177,6 +178,8 @@ def flags(args): if args.stronger_atma_weapon: flags += " -saw" + if args.exclude_items: + flags += f" -exi {args.exclude_items}" return flags diff --git a/data/items.py b/data/items.py index f90bf5b1..a17bac30 100644 --- a/data/items.py +++ b/data/items.py @@ -357,6 +357,11 @@ def get_excluded(self): exclude.append(name_id["Cursed Shld"]) if self.args.permadeath: exclude.append(name_id["Fenix Down"]) + if self.args.exclude_items: + try: + exclude.extend([name_id[item_name] for item_name in self.args.exclude_items.split(".")]) + except KeyError as e: + raise KeyError(f"Item to exclude with -exi not found: {e}. Check the spelling and capitalization") return exclude