public override void AI(Projectile projectile) { bool light = projectile.damage <= 0 && !projectile.friendly && !projectile.hostile && projectile.light >= 0.12f; if (Main.netMode != 1 && Main.LocalPlayer.InErilipah() && !Main.rand.Chance(ErilipahItem.LightSnuffRate * 1.3f) && light) { Main.PlaySound(SoundID.LiquidsWaterLava, projectile.Center); ErilipahItem.SnuffFx(projectile.Center); projectile.Kill(); } }
public static void Snuff(int i, int j, bool ignoreArken = false) { try { Tile tile = Main.tile[i, j]; int type = tile.type; Mod mod = GetInstance <Erilipah>(); bool light = tile.type == TileID.Torches || tile.type == TileID.Campfire || TileLoader.IsTorch(type); if (!ignoreArken) { light &= type != TileType <ArkenTorchTile>(); } else { light &= type != TileType <ArkenTorchTile>() || Main.rand.NextBool(); } if (light) { if (!ignoreArken && type == TileType <CrystallineTorchTile>() && Main.rand.Chance(0.50f)) { return; } if (Main.LocalPlayer.InErilipah()) { ErilipahItem.SnuffFx(new Vector2(i * 16 + 8, j * 16 + 8)); Main.PlaySound(SoundID.LiquidsWaterLava.WithPitchVariance(-0.35f), new Vector2(i * 16 + 8, j * 16 + 8)); WorldGen.KillTile(i, j, false, noItem: type != TileType <ArkenTorchTile>()); WorldGen.TileFrame(i, j); } } } catch { Main.NewText("PEE"); } }