Skip to content

"Craftable" property wrong #51

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
qustrolabe opened this issue May 25, 2025 · 0 comments
Open

"Craftable" property wrong #51

qustrolabe opened this issue May 25, 2025 · 0 comments

Comments

@qustrolabe
Copy link

Code that checks whether card is craftable doesn't work properly.

Currently it looks like this:

@property
def craftable(self):
	if isinstance(self.card_set, CardSet) and not self.card_set.craftable:
		return False
	if not self.type.craftable:
		return False
	if not self.rarity.craftable:
		return False
	return True

And this works for "Uncraftable" cards like Bob The Bartender (gets flagged because it's in EVENT CardSet), but there also card like Marin The Fox which passes all three checks (it's a legendary, minion, from catacombs (LOOTAPALOOZA) set). This leads to wrong calculations on Craft/Disenchant costs and just other complications.

From Hearthstone API docs (from what I found) seems like there no direct way to tell that card is Uncraftable so the only way I see to fix that would be to have list of all Uncraftable cards hardcoded somewhere that needs to be updated as new Uncraftable cards get introduced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant