Mercurial > boosterpack
comparison index.pl @ 3:2e849c856026 boosterpack
[svn r5] it works!
author | robert |
---|---|
date | Tue, 08 Sep 2009 05:55:51 -0400 |
parents | d7dd496a4fa6 |
children | e91d6f908222 |
comparison
equal
deleted
inserted
replaced
2:d7dd496a4fa6 | 3:2e849c856026 |
---|---|
76 } | 76 } |
77 | 77 |
78 my $currentRuleref = retrieve 'rlm/booster.prefs'; | 78 my $currentRuleref = retrieve 'rlm/booster.prefs'; |
79 $currentRule = $$currentRuleref; | 79 $currentRule = $$currentRuleref; |
80 | 80 |
81 my $mapRules = $currentRule -> getRarityMap(); | |
82 my %mapRules = %$mapRules; | |
83 | |
84 | |
85 | |
86 | |
81 #print ERR "@pokes"; | 87 #print ERR "@pokes"; |
82 @reduced = filter(\&tag_analyze, @pokes); | 88 @reduced = filter(\&tag_analyze, @pokes); |
89 @reduced = shuffle(@reduced); | |
83 | 90 |
84 #print ERR "@reduced"; | 91 my @final_list = (); |
92 my $rnum = $mapRules{"Rare"}; | |
93 my $unum = $mapRules{"Uncommon"}; | |
94 my $cnum = $mapRules{"Common"}; | |
85 | 95 |
86 for $crd(@reduced) | 96 for $crd(@reduced) |
87 { | 97 { |
88 #print ERR $crd->getPix(); | 98 if (($crd -> hasTags("Rare") or $crd -> hasTags("Rare Holo"))and ($rnum>0)){push @r_list, $crd; $rnum--;} |
89 $rob = $rob.$crd->getPix(); | 99 if (($crd -> hasTags("Uncommon"))and ($unum>0)){push @u_list, $crd; $unum--;} |
90 $rob = $rob."<br>"; | 100 if (($crd -> hasTags("Common"))and ($cnum>0)){push @c_list, $crd; $cnum--;} |
101 if ($rnum+$unum+$cnum == 0){last;} | |
91 } | 102 } |
92 | 103 |
104 @final_list = (@r_list,@u_list,@c_list); | |
105 | |
106 | |
107 for $crd(@final_list) | |
108 { | |
109 $rob = $rob."<img src = \"".$crd->getPix()."\"></img>"; | |
110 } | |
111 | |
93 #print $rob; | 112 #print $rob; |
94 | 113 |
95 #print ERR @reduced; | 114 #print ERR @reduced; |
96 #print ERR $rob; | 115 #print ERR $rob; |
97 #print $rob; | 116 #print $rob; |