public void MidasRitual(int i, int j, Player player, short itemid) { VampPlayer p = player.GetModPlayer <VampPlayer>(); if (itemid == ItemID.CopperCoin) { PointCost = 1; } else if (itemid == ItemID.SilverCoin) { PointCost = 10; } else if (itemid == ItemID.GoldCoin) { PointCost = 100; } else if (itemid == ItemID.PlatinumCoin) { PointCost = 999; } DustTimer++; if (DustTimer >= 5) { if (itemid == ItemID.CopperCoin) { DustType = 9; PointCost = 1; } else if (itemid == ItemID.SilverCoin) { DustType = 11; PointCost = 10; } else if (itemid == ItemID.GoldCoin) { DustType = 10; PointCost = 100; } else if (itemid == ItemID.PlatinumCoin) { DustType = 11; PointCost = 999; } if (Main.netMode != NetmodeID.MultiplayerClient) { VampPlayer.OvalDust(new Vector2(16 * (i + 1) + 4.5f, 16 * (j - 1) + 4), 1, 2f, Color.White, DustType, 1f); } DustTimer = 0; } if (Main.netMode == NetmodeID.SinglePlayer) { p.BloodPoints -= PointCost; } Item.NewItem(new Vector2(16 * (i + 1) + 4.5f, 16 * (j - 1) + 4), 1, 1, itemid); }
public override bool CanUseItem(Player player) { if (player.statLife > 1) { RegenedHealth = true; } if (player.statLife <= 1 && RegenedHealth) { VampPlayer.OvalDust(player.position, 5f, 5f, Color.Red, 67, 1.2f); RegenedHealth = false; return(false); } else if (player.ownedProjectileCounts[ModContent.ProjectileType <Projectiles.VampiricPrismHeldProj>()] <= 0 && RegenedHealth) { ; } return(true); }
public override bool SafePreKill(int timeLeft) { if (projectile.frame == 0 || projectile.frame == 1 || projectile.frame == 2) { for (int x = 0; x < 4; x++) { VampPlayer.OvalDust(projectile.Center, projectile.width / 8, projectile.height / 8, Color.Pink, 141, 1.3f, true); } } if (projectile.frame == 3 || projectile.frame == 4 || projectile.frame == 5) { for (int x = 0; x < 4; x++) { VampPlayer.OvalDust(projectile.Center, projectile.width / 8, projectile.height / 8, Color.MediumPurple, 141, 1.3f, true); } } return(base.SafePreKill(timeLeft)); }
public override bool SafePreKill(int timeLeft) { if (Main.player[projectile.owner].HeldItem.type == ModContent.ItemType <Items.VtuberItems.BhleggGun>()) { Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/BubblePop").WithVolume(1f).WithPitchVariance(Main.rand.NextFloat(-0.30f, 0.30f)), projectile.position); } else { int RandSound = Main.rand.Next(0, 2); if (RandSound == 0) { Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/Bhlegg1").WithVolume(1f).WithPitchVariance(Main.rand.NextFloat(-0.30f, 0.30f)), projectile.position); } else { Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/Bhlegg2").WithVolume(1f).WithPitchVariance(Main.rand.NextFloat(-0.30f, 0.30f)), projectile.position); } } for (int x = 0; x < 4; x++) { VampPlayer.OvalDust(projectile.Center, projectile.width / 8, projectile.height / 8, Color.Pink, 263, 0.8f, true); } return(base.SafePreKill(timeLeft)); }
public void MinerRitual(int i, int j, Player player, ushort tileid) { VampPlayer p = player.GetModPlayer <VampPlayer>(); if (tileid == TileID.Copper || tileid == TileID.Tin) { PointCost = 1; } else if (tileid == TileID.Iron || tileid == TileID.Lead) { PointCost = 2; } else if (tileid == TileID.Silver || tileid == TileID.Tungsten) { PointCost = 4; } else if (tileid == TileID.Gold || tileid == TileID.Platinum) { PointCost = 8; } else if (tileid == TileID.Meteorite) { PointCost = 12; } else if (tileid == TileID.Demonite || tileid == TileID.Crimtane) { PointCost = 16; } else if (tileid == TileID.Hellstone) { PointCost = 24; } else if (tileid == TileID.Cobalt || tileid == TileID.Palladium) { PointCost = 50; } else if (tileid == TileID.Mythril || tileid == TileID.Orichalcum) { PointCost = 75; } else if (tileid == TileID.Adamantite || tileid == TileID.Titanium) { PointCost = 100; } else if (tileid == TileID.Chlorophyte) { PointCost = 150; } else if (tileid == TileID.LunarOre) { PointCost = 300; } if (Main.netMode == NetmodeID.SinglePlayer) { if (tileid == TileID.Copper) { DustType = 9; } else if (tileid == TileID.Tin) { DustType = 81; } else if (tileid == TileID.Iron) { DustType = 8; } else if (tileid == TileID.Lead) { DustType = 82; } else if (tileid == TileID.Silver) { DustType = 11; } else if (tileid == TileID.Tungsten) { DustType = 83; } else if (tileid == TileID.Gold) { DustType = 10; } else if (tileid == TileID.Platinum) { DustType = 84; } else if (tileid == TileID.Meteorite) { DustType = 127; } else if (tileid == TileID.Demonite) { DustType = 65; } else if (tileid == TileID.Crimtane) { DustType = 117; } else if (tileid == TileID.Hellstone) { DustType = 6; } else if (tileid == TileID.Cobalt) { DustType = 48; } else if (tileid == TileID.Palladium) { DustType = 144; } else if (tileid == TileID.Mythril) { DustType = 49; } else if (tileid == TileID.Orichalcum) { DustType = 145; } else if (tileid == TileID.Adamantite) { DustType = 50; } else if (tileid == TileID.Titanium) { DustType = 146; } else if (tileid == TileID.Chlorophyte) { DustType = 128; } else if (tileid == TileID.LunarOre) { DustType = 242; } DustTimer++; if (DustTimer >= 2) { VampPlayer.OvalDust(new Vector2(16 * (i + 1) + 4.5f, 16 * (j - 1) + 4), 2, 0.8f, Color.White, DustType, 1f); DustTimer = 0; } } if (Main.tile[i + 1, j - 2].type != tileid && Main.netMode == NetmodeID.SinglePlayer) { p.BloodPoints -= PointCost; } WorldGen.PlaceTile(i + 1, j - 2, tileid); if (Main.netMode == NetmodeID.Server) { WorldGen.SquareTileFrame(Position.X + 1, Position.Y - 2, true); if (Main.netMode == NetmodeID.Server) { NetMessage.SendTileSquare(-1, Position.X + 1, Position.Y - 2, 2); } } }
public void StoneRitual(int i, int j, Player player, ushort tileid) { PointCost = 1; VampPlayer p = player.GetModPlayer <VampPlayer>(); if (p.BloodPoints > 1 && Main.netMode != NetmodeID.MultiplayerClient) { if (tileid == TileID.Stone) { DustType = 1; } else if (tileid == TileID.Mud) { DustType = 0; } else if (tileid == TileID.Sand) { DustType = 32; } else if (tileid == TileID.Silt) { DustType = 121; } else if (tileid == TileID.SnowBlock) { DustType = 51; } DustTimer++; if (DustTimer >= 2) { VampPlayer.OvalDust(new Vector2(16 * (i + 1) + 4.5f, 16 * (j - 1) + 4), 2, 0.8f, Color.White, DustType, 0.2f); DustTimer = 0; } } if (Main.tile[i + 1, j - 2].type != tileid && Main.netMode == NetmodeID.SinglePlayer && tileid != TileID.Mud) { p.BloodPoints -= 1; } if (tileid == TileID.Sand || tileid == TileID.Silt || tileid == TileID.SnowBlock) { WorldGen.PlaceTile(i + 1, j - 1, ModContent.TileType <Tiles.AltarPillar>()); } WorldGen.PlaceTile(i + 1, j - 2, tileid); if (Main.tile[i + 1, j - 2].type != tileid) { p.BloodPoints += 1; Cost = false; } else { Cost = true; } if (tileid == TileID.Mud) { Main.tile[i + 1, j - 2].type = TileID.Dirt; } if (Main.netMode == NetmodeID.Server) { WorldGen.SquareTileFrame(Position.X + 1, Position.Y - 2, true); if (Main.netMode == NetmodeID.Server) { NetMessage.SendTileSquare(-1, Position.X + 1, Position.Y - 2, 2); } } }