@@ -110,39 +110,56 @@ public MotelyItem GetNextSpectral(ref MotelySingleSpectralStream spectralStream)
110110 }
111111 }
112112
113- return ( MotelyItemType ) MotelyItemTypeCategory . SpectralCard |
113+ MotelyItemType spectral = ( MotelyItemType ) MotelyItemTypeCategory . SpectralCard |
114114 ( MotelyItemType ) GetNextRandomInt ( ref spectralStream . ResampleStream . InitialPrngStream , 0 , MotelyEnum < MotelySpectralCard > . ValueCount ) ;
115+
116+ int resampleCount = 0 ;
117+
118+ while ( true )
119+ {
120+ if ( spectral != MotelyItemType . Soul && spectral != MotelyItemType . BlackHole )
121+ {
122+ return spectral ;
123+ }
124+
125+ spectral = ( MotelyItemType ) MotelyItemTypeCategory . SpectralCard | ( MotelyItemType ) GetNextRandomInt (
126+ ref GetResamplePrngStream ( ref spectralStream . ResampleStream , spectralStream . ResampleKey , resampleCount ) ,
127+ 0 , MotelyEnum < MotelySpectralCard > . ValueCount
128+ ) ;
129+
130+ ++ resampleCount ;
131+ }
115132 }
116133
117- public MotelyItem GetNextSpectral ( ref MotelySingleSpectralStream SpectralStream , in MotelySingleItemSet itemSet )
134+ public MotelyItem GetNextSpectral ( ref MotelySingleSpectralStream spectralStream , in MotelySingleItemSet itemSet )
118135 {
119- if ( SpectralStream . IsSoulBlackHoleable )
136+ if ( spectralStream . IsSoulBlackHoleable )
120137 {
121- if ( ! itemSet . Contains ( MotelyItemType . Soul ) && GetNextRandom ( ref SpectralStream . SoulBlackHolePrngStream ) > 0.997 )
138+ if ( ! itemSet . Contains ( MotelyItemType . Soul ) && GetNextRandom ( ref spectralStream . SoulBlackHolePrngStream ) > 0.997 )
122139 {
123140 return MotelyItemType . Soul ;
124141 }
125142
126- if ( ! itemSet . Contains ( MotelyItemType . BlackHole ) && GetNextRandom ( ref SpectralStream . SoulBlackHolePrngStream ) > 0.997 )
143+ if ( ! itemSet . Contains ( MotelyItemType . BlackHole ) && GetNextRandom ( ref spectralStream . SoulBlackHolePrngStream ) > 0.997 )
127144 {
128145 return MotelyItemType . BlackHole ;
129146 }
130147 }
131148
132- MotelyItemType Spectral = ( MotelyItemType ) MotelyItemTypeCategory . SpectralCard |
133- ( MotelyItemType ) GetNextRandomInt ( ref SpectralStream . ResampleStream . InitialPrngStream , 0 , MotelyEnum < MotelySpectralCard > . ValueCount ) ;
149+ MotelyItemType spectral = ( MotelyItemType ) MotelyItemTypeCategory . SpectralCard |
150+ ( MotelyItemType ) GetNextRandomInt ( ref spectralStream . ResampleStream . InitialPrngStream , 0 , MotelyEnum < MotelySpectralCard > . ValueCount ) ;
134151
135152 int resampleCount = 0 ;
136153
137154 while ( true )
138155 {
139- if ( ! itemSet . Contains ( Spectral ) )
156+ if ( ! itemSet . Contains ( spectral ) && spectral != MotelyItemType . Soul && spectral != MotelyItemType . BlackHole )
140157 {
141- return Spectral ;
158+ return spectral ;
142159 }
143160
144- Spectral = ( MotelyItemType ) MotelyItemTypeCategory . SpectralCard | ( MotelyItemType ) GetNextRandomInt (
145- ref GetResamplePrngStream ( ref SpectralStream . ResampleStream , SpectralStream . ResampleKey , resampleCount ) ,
161+ spectral = ( MotelyItemType ) MotelyItemTypeCategory . SpectralCard | ( MotelyItemType ) GetNextRandomInt (
162+ ref GetResamplePrngStream ( ref spectralStream . ResampleStream , spectralStream . ResampleKey , resampleCount ) ,
146163 0 , MotelyEnum < MotelySpectralCard > . ValueCount
147164 ) ;
148165
0 commit comments