72411 {
72414 float num = 15f;
72416 if ((
double)player.position.Y > Main.worldSurface * 16.0 + (
double)(
logicCheckScreenHeight / 2) || player.nearbyActiveNPCs > num)
72417 {
72418 return;
72419 }
72420 float num2 = player.nearbyActiveNPCs / num;
72421 int num3 = 45 + (int)(450f *
num2);
72422 if (Main.expertMode)
72423 {
72424 num3 = (int)((
double)
num3 * 0.85);
72425 }
72426 if (Main.GameModeInfo.IsJourneyMode)
72427 {
72430 {
72431 if (
power.GetShouldDisableSpawnsFor(
plr))
72432 {
72433 return;
72434 }
72436 {
72438 }
72439 }
72440 }
72441 if (Main.rand.Next(
num3) != 0)
72442 {
72443 return;
72444 }
72454 {
72455 return;
72456 }
72458 if (Main.rand.Next(200) == 0)
72459 {
72460 Main.npc[
num8].SetDefaults(-4);
72461 }
72462 else if (Main.expertMode)
72463 {
72464 if (Main.rand.Next(7) == 0)
72465 {
72466 Main.npc[
num8].SetDefaults(-7);
72467 }
72468 else if (Main.rand.Next(3) == 0)
72469 {
72470 Main.npc[
num8].SetDefaults(-3);
72471 }
72472 }
72473 else if (Main.rand.Next(10) == 0)
72474 {
72475 Main.npc[
num8].SetDefaults(-7);
72476 }
72477 else if (Main.rand.Next(5) < 2)
72478 {
72479 Main.npc[
num8].SetDefaults(-3);
72480 }
72481 }
static readonly CreativePowerManager Instance
static int NewNPC(IEntitySource source, int X, int Y, int Type, int Start=0, float ai0=0f, float ai1=0f, float ai2=0f, float ai3=0f, int Target=255)
static IEntitySource GetSpawnSourceForNaturalSpawn()