public override bool NewRightClick(int i, int j) { Main.mouseRightRelease = false; //Main.NewText("Click"); Point16 AltarPos = TEPosition(i, j); AltarPos = AltarPos - new Point16(1, 1); //Main.NewText("Pos: " + AltarPos); BloodAltarTE AltarTE = mod.GetTileEntity <BloodAltarTE>(AltarPos); //Main.NewText("Position: " + AltarTE.Position); if (AltarTE == null) { //Main.NewText("Null"); return(false); } Player player = Main.LocalPlayer; VampPlayer vampPlayer = player.GetModPlayer <VampPlayer>(); //if (AltarTE.RitualOwner >= byte.MaxValue) //{ AltarTE.RitualOwner = Main.LocalPlayer.whoAmI; //} if (AltarTE.CurrentPlayer == player.whoAmI) { AltarTE.CloseUI(); } else { AltarTE.CurrentPlayer = (byte)player.whoAmI; AltarTE.OpenUI(); } return(true); }
public override void KillMultiTile(int i, int j, int frameX, int frameY) { Item.NewItem(i * 16, j * 16, 32, 16, ModContent.ItemType <Items.BloodAltarItem>()); Point16 AltarPos = TEPosition(i, j); AltarPos = AltarPos - new Point16(1, 1); BloodAltarTE AltarTE = mod.GetTileEntity <BloodAltarTE>(AltarPos); //if (!AltarTE.BloodCrystal.IsAir) //{ // Item CrystalDrop = Main.item[Item.NewItem(i * 16, j * 16, 32, 16, ModContent.ItemType<Items.Misc.BloodCrystalSoul>())]; // CrystalDrop.GetGlobalItem<Items.Misc.BloodCrystalInstanced>().NPCID = AltarTE.BloodCrystal.GetGlobalItem<Items.Misc.BloodCrystalInstanced>().NPCID; // CrystalDrop.GetGlobalItem<Items.Misc.BloodCrystalInstanced>().NPCName = AltarTE.BloodCrystal.GetGlobalItem<Items.Misc.BloodCrystalInstanced>().NPCName; //} GetInstance <BloodAltarTE>().Kill(AltarPos.X, AltarPos.Y); WorldGen.KillTile(AltarPos.X + 1, AltarPos.Y - 2, false, false, false); WorldGen.KillTile(AltarPos.X + 1, AltarPos.Y - 1, false, false, false); if (Main.netMode != NetmodeID.SinglePlayer) { NetMessage.SendData(MessageID.TileChange, -1, -1, null, 0, (float)AltarPos.X + 1, (float)AltarPos.Y - 1, 0f, 0, 0, 0); NetMessage.SendData(MessageID.TileChange, -1, -1, null, 0, (float)AltarPos.X + 1, (float)AltarPos.Y - 2, 0f, 0, 0, 0); } }