TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ CanDrop()

bool Terraria.GameContent.ItemDropRules.Conditions.PumpkinMoonDropGateForTrophies.CanDrop ( DropAttemptInfo info)
inline

Implements Terraria.GameContent.ItemDropRules.IItemDropRuleCondition.

Definition at line 180 of file Conditions.cs.

181 {
182 if (!Main.pumpkinMoon)
183 {
184 return false;
185 }
186 int waveNumber = NPC.waveNumber;
187 if (NPC.waveNumber < 15)
188 {
189 return false;
190 }
191 int num = 4;
192 if (waveNumber == 16)
193 {
194 num = 4;
195 }
196 if (waveNumber == 17)
197 {
198 num = 3;
199 }
200 if (waveNumber == 18)
201 {
202 num = 3;
203 }
204 if (waveNumber == 19)
205 {
206 num = 2;
207 }
208 if (waveNumber >= 20)
209 {
210 num = 2;
211 }
212 if (Main.expertMode && Main.rand.Next(3) == 0)
213 {
214 num--;
215 }
216 return info.rng.Next(num) == 0;
217 }

References Terraria.Main.expertMode, Terraria.Main.pumpkinMoon, Terraria.Main.rand, and Terraria.NPC.waveNumber.