Terraria v1.4.4.9
Terraria 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 179 of file Conditions.cs.

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

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