Skip to content
12 changes: 12 additions & 0 deletions args/chests.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ def parse(parser):
chests.add_argument("-cms", "--chest-monsters-shuffle", action = "store_true",
help = "Monsters-in-a-box shuffled but locations unchanged")

chests.add_argument("-ntc", "--no-trash-chests", action = "store_true",
help="Replace Low Tier Items with gold in chests")




def process(args):
if args.chest_contents_shuffle_random is not None:
args.chest_contents_shuffle_random_percent = args.chest_contents_shuffle_random
Expand All @@ -37,6 +43,8 @@ def flags(args):

if args.chest_monsters_shuffle:
flags += " -cms"
if args.no_trash_chests:
flags += " -ntc"

return flags

Expand All @@ -58,6 +66,10 @@ def options(args):
result.append(("Random Percent", f"{args.chest_contents_shuffle_random_percent}%"))
result.append(("Monsters-In-A-Box Shuffled", args.chest_monsters_shuffle))

if args.no_trash_chests:
result.append(("No Trash Chests", args.no_trash_chests))


return result

def menu(args):
Expand Down
3 changes: 3 additions & 0 deletions args/items.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ def parse(parser):
items.add_argument("-saw", "--stronger-atma-weapon", action = "store_true",
help = "Atma Weapon moved to higher tier and divisor reduced from 64 to 32")



def process(args):
args._process_min_max("item_equipable_random")
if args.item_equipable_balanced_random is not None:
Expand Down Expand Up @@ -108,6 +110,7 @@ def flags(args):
if args.stronger_atma_weapon:
flags += " -saw"


return flags

def options(args):
Expand Down
7 changes: 7 additions & 0 deletions args/shops.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ def parse(parser):
shops.add_argument("-snil", "--shops-no-illuminas", action = "store_true",
help = "Illuminas not sold in shops")

shops.add_argument("-nts", "--no-trash-shops", action = "store_true",
help="Omit Low tier items in shops")

def process(args):
if args.shop_inventory_shuffle_random is not None:
args.shop_inventory_shuffle_random_percent = args.shop_inventory_shuffle_random
Expand Down Expand Up @@ -106,6 +109,9 @@ def flags(args):
if args.shops_no_illuminas:
flags += " -snil"

if args.no_trash_shops:
flags += " -nts"

return flags

def options(args):
Expand Down Expand Up @@ -159,6 +165,7 @@ def options(args):
("Expensive Balls", args.shops_expensive_super_balls),
("No Exp. Eggs", args.shops_no_exp_eggs),
("No Illuminas", args.shops_no_illuminas),
("No Trash Shops", args.no_trash_shops)
])
return result

Expand Down
22 changes: 22 additions & 0 deletions constants/items.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,3 +295,25 @@
"Marvel Shoes",
"Exp. Egg",
]

## TRASH LIST https://docs.google.com/spreadsheets/d/1Cit5Xl_TCBPFI4q1NEVQhSYGH1wKY9st_1yee3lzCP8/edit#gid=0

TRASH_WEAPONS = [
"Dirk", "MithrilKnife", "Guardian", "MithrilBlade", "RegalCutlass", "Crystal", "Mithril Pike",
"Stout Spear", "Imperial", "Kodachi", "Hardened", "Ashura", "Kotetsu", "Forged",
"Aura", "Strato", "Punisher", "MetalKnuckle", "Mithril Claw", "Kaiser",
"Flail", "Morning Star", "Full Moon", "Boomerang", "Rising Sun", "Cards", "Darts", "Chocobo Brsh",
]

TRASH_ARMOR = ["Buckler", "Mithril Shld", "Heavy Shld", "Gold Shld", "Leather Hat", "Plumed Hat", "Bandana",
"Iron Helmet", "Mithril Helm", "Gold Helmet", "LeatherArmor", "Kung Fu Suit", "Mithril Vest",
"Diamond Vest", "Cotton Robe", "Silk Robe", "Iron Armor",
"DiamondArmor", "Crystal Mail", "Gold Armor",
"Mithril Mail"
]
TRASH_RElICS = ["Charm Bangle", "Coin Toss", "FakeMustache"]


TRASH_ITEMS = TRASH_WEAPONS + TRASH_ARMOR + TRASH_RElICS

TRASH_IDS = [name_id.get(value) for value in TRASH_ITEMS]
22 changes: 22 additions & 0 deletions data/chests.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from data.chest import Chest
import data.chests_asm as chests_asm
from data.item import Item
from data.structures import DataArrays
import random

Expand Down Expand Up @@ -105,6 +106,27 @@ def shuffle_random(self):
elif chest.type == Chest.ITEM:
chest.contents = self.items.get_random()

if self.args.no_trash_chests:
Copy link
Collaborator

@asilverthorn asilverthorn Apr 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change only affects -ccsr # (where number is non-zero). I recommend making it apply for all other chest options as well by moving it into its own method called by mod.

if self.args.shop_sell_fraction4:
sell_factor = 1/4
elif self.args.shop_sell_fraction8:
sell_factor = 1 / 8
elif self.args.shop_sell_fraction0:
sell_factor = 0
else:
sell_factor = 1/2
for chest in possible_chests:
if not chest.type == Chest.ITEM:
continue
item = Item(chest.contents, self.rom)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change to item = self.items.items[chest.contents] (otherwise there's a merge conflict with other Item changes)

if item.is_trash:
item_chest_value = int(min((item.price * sell_factor)//100, Chest.MAX_GOLD_VALUE))
if not item.sell_gold_value:
chest.type = Chest.EMPTY
chest.type = Chest.GOLD
chest.contents = item_chest_value


def random_tiered(self):
def get_item(tiers, tier_s_distribution):
from data.chest_item_tiers import weights
Expand Down
10 changes: 10 additions & 0 deletions data/item.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import data.text as text
from constants.items import TRASH_IDS
from data.text.text2 import text_value, value_text

class Item():
Expand All @@ -20,6 +21,10 @@ def __init__(self, id, rom):

self.read()

@property
def is_trash(self):
return self.id in TRASH_IDS

def is_equipable(self):
return self.equipable_characters

Expand All @@ -42,6 +47,11 @@ def remove_learnable_spell(self):
self.learnable_spell = 0
self.learnable_spell_rate = 0

@property
def sell_gold_value(self):
## half price for sell and //100
return self.price//200

def scale_price(self, factor):
self.price = int(self.price * factor)
self.price = max(min(self.price, 2**16 - 1), 0)
Expand Down
4 changes: 4 additions & 0 deletions data/shops.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from constants.items import TRASH_IDS
from data.item import Item
from data.shop import Shop
from data.structures import DataArray

Expand Down Expand Up @@ -226,6 +228,8 @@ def remove_excluded_items(self):
exclude.append(self.items.get_id("Exp. Egg"))
if self.args.shops_no_illuminas:
exclude.append(self.items.get_id("Illumina"))
if self.args.no_trash_shops:
exclude.extend(TRASH_IDS)

for shop in self.shops:
for item in exclude:
Expand Down