public SpawnMinion(string mobid, double chance, BiomeTypes biomeconditions, SpawnConditions spawnconditions, bool isboss = false, bool unittocheckkillamount = true) { MobID = mobid; Chance = chance; SpawnConditions = spawnconditions; BiomeConditions = biomeconditions; isBoss = isboss; UnitToCheckKillAmount = unittocheckkillamount; }
private void DestroyConditionalPowerups(SpawnConditions condition) { GameObject[] toDestroy = GameObject.FindGameObjectsWithTag("Powerup"). Where(o => o.GetComponent <PowerupBase>().spawnConditions == condition). Select(p => p.gameObject).ToArray(); foreach (GameObject powerup in toDestroy) { Destroy(powerup); } }
public CustomNPCSpawning(int spawnrate, float mindepth, float maxdepth, SpawnConditions spawnconditions, bool useterrariaspawn = true, BiomeTypes spawnbiome = BiomeTypes.None, string spawnregion = "", double spawnchance = 100.0) { spawnBiome = spawnbiome; spawnRegion = spawnregion; spawnRate = spawnrate; spawnChance = spawnchance; spawnConditions = spawnconditions; useTerrariaSpawn = useterrariaspawn; minDepth = mindepth; maxDepth = maxdepth; }
internal static bool CheckSpawnConditions(SpawnConditions conditions) { if (conditions == SpawnConditions.None) { //Log.ConsoleInfo("Failed on None"); return(false); } if (conditions.HasFlag(SpawnConditions.BloodMoon) && !Main.bloodMoon) { //Log.ConsoleInfo("Failed on BloodMoon"); return(false); } if (conditions.HasFlag(SpawnConditions.Eclipse) && !Main.eclipse) { //Log.ConsoleInfo("Failed on Eclipse"); return(false); } if (conditions.HasFlag(SpawnConditions.SnowMoon) && !Main.snowMoon) { //Log.ConsoleInfo("Failed on SnowMoon"); return(false); } if (conditions.HasFlag(SpawnConditions.DayTime) && !Main.dayTime) { //Log.ConsoleInfo("Failed on DayTime"); return(false); } if (conditions.HasFlag(SpawnConditions.NightTime) && Main.dayTime) { //Log.ConsoleInfo("Failed on NightTime"); return(false); } if (conditions.HasFlag(SpawnConditions.Day) && (!Main.dayTime || (Main.dayTime && Main.time <= 150.0 && Main.time >= 26999.0))) { //Log.ConsoleInfo("Failed on Day"); return(false); } if (conditions.HasFlag(SpawnConditions.Noon) && (!Main.dayTime || (Main.dayTime && Main.time <= 16200.0 && Main.time >= 32400.0))) { //Log.ConsoleInfo("Failed on Noon"); return(false); } if (conditions.HasFlag(SpawnConditions.Night) && (Main.dayTime || (!Main.dayTime && Main.time <= 27000.0 && Main.time >= 54000.0))) { //Log.ConsoleInfo("Failed on Night"); return(false); } if (conditions.HasFlag(SpawnConditions.Midnight) && (Main.dayTime || (!Main.dayTime && Main.time <= 16200.0 && Main.time >= 32400.0))) { //Log.ConsoleInfo("Failed on Midnight"); return(false); } if (conditions.HasFlag(SpawnConditions.Raining) && !Main.raining) { //Log.ConsoleInfo("Failed on Raining"); return(false); } if (conditions.HasFlag(SpawnConditions.SlimeRaining) && !Main.slimeRain) { //Log.ConsoleInfo("Failed on Slime Raining"); return(false); } return(true); }