Commit 6b09bde7 authored by twanvl's avatar twanvl

while it is still possible: renamed select:cyclic to select:equal.

Added "equal proportional" and "equal nonempty" for symmetry.
select:equal now takes weights into account.
parent 3fc08f0e
......@@ -3,7 +3,7 @@
pack type:
name: basic land
select: cyclic
select: equal
filter: card.rarity == "basic land" and not is_token_card() # can be shifted
pack type:
name: common
......@@ -114,23 +114,22 @@ pack type:
name: common sometimes shifted or special
selectable: false
# TODO: Perhaps use some kind of proportional system here as well?
select: cyclic
item: common
item: common
item: shifted common or else common
item: common
item: common
item: shifted common or else common
item: common
item: common
item: shifted common or else common
item: special or else common
select: equal
item:
name: common
weight: 6
item:
name: shifted common or else common
weight: 3
item:
name: special or else common
weight: 1
# of the uncommon slots, 1/3 will be shifted, 1/4 of that will be shifted rares instead
pack type:
name: uncommon sometimes shifted
selectable: false
select: cyclic
select: equal
item: uncommon
item: uncommon
item: shifted uncommon or rare or else uncommon
......
This diff is collapsed.
......@@ -121,11 +121,13 @@ class PackGenerator;
enum PackSelectType
{ SELECT_AUTO
, SELECT_ALL
, SELECT_REPLACE
, SELECT_NO_REPLACE
, SELECT_CYCLIC
, SELECT_REPLACE
, SELECT_PROPORTIONAL
, SELECT_NONEMPTY
, SELECT_EQUAL
, SELECT_EQUAL_PROPORTIONAL
, SELECT_EQUAL_NONEMPTY
, SELECT_FIRST
};
......@@ -200,17 +202,23 @@ class PackInstance : public IntrusivePtrBase<PackInstance> {
PackGenerator& parent;
int depth; //< 0 = no items, otherwise 1+max depth of items refered to
vector<CardP> cards; //< All cards that pass the filter
size_t count; //< Total number of non-empty cards/items
double total_weight; //< Sum of item and card weights
size_t requested_copies; //< The requested number of copies of this pack
size_t card_copies; //< The number of cards that were chosen to come from this pack
double expected_copies;
/// Generate some copies of all cards and items
void generate_all(vector<CardP>* out, size_t copies);
/// Generate one card/item chosen at random (using the select type)
void generate_one_random(vector<CardP>* out);
};
class PackGenerator {
public:
/// Reset the generator, possibly switching the set or reseeding
void reset(const SetP& set, int seed);
/// Reset the generator, but not the set
void reset(int seed);
/// Find the PackInstance for the PackType with the given name
PackInstance& get(const String& name);
......
......@@ -373,7 +373,7 @@ CustomPackDialog::CustomPackDialog(Window* parent, const SetP& set, const PackTy
}
void CustomPackDialog::updateTotals() {
generator.gen.seed(0);
generator.reset(0);
int total_packs = 0;
FOR_EACH(pick,pickers) {
int copies = pick.value->GetValue();
......@@ -636,7 +636,7 @@ void RandomPackPanel::onPackTypeClick(wxCommandEvent& ev) {
void RandomPackPanel::updateTotals() {
#if USE_NEW_PACK_SYSTEM
generator.gen.seed((unsigned)last_seed);
generator.reset(last_seed);
#else
totals->clear();
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment