@@ -32,58 +32,85 @@ function toPack(code) {
3232 _ . choose ( 1 , rare )
3333 )
3434
35- switch ( code ) {
36- case 'DGM' :
37- special = _ . rand ( 20 )
38- ? special . gate
39- : special . shock
40- break
41- case 'MMA' :
42- special = selectRarity ( set )
43- break
44- case 'MM2' :
45- special = selectRarity ( set )
46- break
47- case 'VMA' :
48- //http://www.wizards.com/magic/magazine/article.aspx?x=mtg/daily/arcana/1491
49- if ( _ . rand ( 53 ) )
50- special = selectRarity ( set )
51- break
52- case 'FRF' :
53- special = _ . rand ( 20 )
54- ? special . common
55- : special . fetch
56- break
57- case 'ISD' :
58- //http://www.mtgsalvation.com/forums/magic-fundamentals/magic-general/327956-innistrad-block-transforming-card-pack-odds?comment=4
59- //121 card sheet, 1 mythic, 12 rare (13), 42 uncommon (55), 66 common
60- specialrnd = _ . rand ( 121 )
61- if ( specialrnd == 0 )
62- special = special . mythic
63- else if ( specialrnd < 13 )
64- special = special . rare
65- else if ( specialrnd < 55 )
66- special = special . uncommon
67- else
68- special = special . common
69- break
70- case 'DKA' :
71- //http://www.mtgsalvation.com/forums/magic-fundamentals/magic-general/327956-innistrad-block-transforming-card-pack-odds?comment=4
72- //80 card sheet, 2 mythic, 6 rare (8), 24 uncommon (32), 48 common
73- specialrnd = _ . rand ( 80 )
74- if ( specialrnd <= 1 )
75- special = special . mythic
76- else if ( specialrnd < 8 )
77- special = special . rare
78- else if ( specialrnd < 32 )
79- special = special . uncommon
80- else
81- special = special . common
82- break
35+ var special1
36+ var specialrnd
37+ switch ( code ) { // the author of this switch should be whipped with a switch
38+ // I have fixed it after quite some time of debugging while
39+ // adding SOI. MUTABILITY IS YOUR ENEMY.
40+ // ~~ @manpages
41+
42+ case 'DGM' :
43+ special1 = _ . rand ( 20 )
44+ ? special . gate
45+ : special . shock
46+ break
47+
48+ case 'MMA' :
49+ special1 = selectRarity ( set )
50+ break
51+
52+ case 'MM2' :
53+ special1 = selectRarity ( set )
54+ break
55+
56+ case 'VMA' :
57+ //http://www.wizards.com/magic/magazine/article.aspx?x=mtg/daily/arcana/1491
58+ if ( _ . rand ( 53 ) )
59+ special1 = selectRarity ( set )
60+ break
61+
62+ case 'FRF' :
63+ special1 = _ . rand ( 20 )
64+ ? special . common
65+ : special . fetch
66+ break
67+
68+ case 'ISD' :
69+ //http://www.mtgsalvation.com/forums/magic-fundamentals/magic-general/327956-innistrad-block-transforming-card-pack-odds?comment=4
70+ //121 card sheet, 1 mythic, 12 rare (13), 42 uncommon (55), 66 common
71+ specialrnd = _ . rand ( 121 )
72+ if ( specialrnd == 0 )
73+ special1 = special . mythic
74+ else if ( specialrnd < 13 )
75+ special1 = special . rare
76+ else if ( specialrnd < 55 )
77+ special1 = special . uncommon
78+ else
79+ special1 = special . common
80+ break
81+
82+ case 'SOI' :
83+ // Copied ISD
84+ //121 card sheet, 1 mythic, 12 rare (13), 42 uncommon (55), 66 common
85+ specialrnd = _ . rand ( 121 )
86+ if ( specialrnd == 0 )
87+ special1 = special . mythic
88+ else if ( specialrnd < 13 )
89+ special1 = special . rare
90+ else if ( specialrnd < 55 )
91+ special1 = special . uncommon
92+ else
93+ special1 = special . common
94+ break
95+
96+ case 'DKA' :
97+ //http://www.mtgsalvation.com/forums/magic-fundamentals/magic-general/327956-innistrad-block-transforming-card-pack-odds?comment=4
98+ //80 card sheet, 2 mythic, 6 rare (8), 24 uncommon (32), 48 common
99+ specialrnd = _ . rand ( 80 )
100+ if ( specialrnd <= 1 )
101+ special1 = special . mythic
102+ else if ( specialrnd < 8 )
103+ special1 = special . rare
104+ else if ( specialrnd < 32 )
105+ special1 = special . uncommon
106+ else
107+ special1 = special . common
108+ break
109+
83110 }
84111
85- if ( special )
86- pack . push ( _ . choose ( 1 , special ) )
112+ if ( special1 )
113+ pack . push ( _ . choose ( 1 , special1 ) )
87114
88115 return toCards ( pack , code )
89116}
0 commit comments