Skip to content
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

Prevent duplicate trades in potion_master_cleric.sc #362

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rv3r
Copy link
Collaborator

@rv3r rv3r commented Feb 4, 2023

Fixes #325 duplicate trade issue. I haven't touched xp produced by the trades.

Never get two trades of the same potion effect and potion type. Maximum trades will never be more than maximum possible unique trades.

Never get two trades of the same potion effect and potion type
Maximum trades will never be more than maximum possible unique trades
@rv3r rv3r self-assigned this Feb 5, 2023
// add 0-max number of potion trades
loop(rand(1 + global_max_potion_trades),

i = _;
mapped_effects = map(effects, _ ~ '(?<=Potion of )\\w*');
Copy link
Collaborator Author

@rv3r rv3r Feb 5, 2023

Choose a reason for hiding this comment

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

Why did you take the time to map the effects instead of using them directly?

Because debugging with a list that has entries that are 12+ lines of text is painful.

@rv3r rv3r requested a review from altrisi February 13, 2023 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

potion_master_cleric.sc can sometimes give the same trade in the same villager, and gives too few xp
1 participant