Skip to content

Prevent duplicate trades in potion_master_cleric.sc#362

Open
rv3r wants to merge 1 commit intomasterfrom
rv3r-potion-master-cleric-duplicates
Open

Prevent duplicate trades in potion_master_cleric.sc#362
rv3r wants to merge 1 commit intomasterfrom
rv3r-potion-master-cleric-duplicates

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
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

Comments