示例#1
0
        private void bSolarEclipse_onLeftClick(object sender, EventArgs e)
        {
            Main.dayTime = true;
            Main.time    = 32400.1;

            if (Main.netMode != 1)
            {
                AchievementsHelper.NotifyProgressionEvent(1);
                Main.eclipse = true;
                AchievementsHelper.NotifyProgressionEvent(2);
                if (Main.eclipse)
                {
                    if (Main.netMode == 0)
                    {
                        Main.NewText(Lang.misc[20].Value, (byte)50, byte.MaxValue, (byte)130, false);
                    }
                    else if (Main.netMode == 2)
                    {
                        NetMessage.BroadcastChatMessage(Lang.misc[20].ToNetworkText(), new Color(50, 255, 130), -1);
                    }
                }
                if (Main.netMode == 2)
                {
                    NetMessage.SendData(7, -1, -1, null, 0, 0.0f, 0.0f, 0.0f, 0, 0, 0);
                }
            }
        }
 public override bool UseItem(Player player)
 {
     if (Main.moonPhase == 4)
     {
         if (Main.netMode == NetmodeID.Server)
         {
             NetMessage.BroadcastChatMessage(NetworkText.FromKey("The moon phase advanced in order to start the blood moon."), new Color(255, 255, 0));
         }
         else if (Main.netMode == NetmodeID.SinglePlayer)                 // Single Player
         {
             Main.NewText("The moon phase advanced in order to start the blood moon.", 255, 255, 0);
         }
         Main.moonPhase++;
     }
     Main.bloodMoon = true;
     AchievementsHelper.NotifyProgressionEvent(4);
     if (Main.netMode == NetmodeID.SinglePlayer)
     {
         Main.NewText(Lang.misc[8].Value, 50, byte.MaxValue, 130);
     }
     else if (Main.netMode == NetmodeID.Server)
     {
         NetMessage.BroadcastChatMessage(Lang.misc[8].ToNetworkText(), new Color(50, 255, 130));
     }
     if (Main.netMode == NetmodeID.Server)
     {
         NetMessage.SendData(7);
     }
     return(true);
 }
        public override bool UnlockChest(int i, int j, ref short frameXAdjustment, ref int dustType, ref bool manual)
        {
            if (!NPC.downedPlantBoss)
            {
                return(false);
            }

            AchievementsHelper.NotifyProgressionEvent(20);
            return(true);
        }
示例#4
0
 private void TriggerBloodMoon()
 {
     Main.bloodMoon = true;
     AchievementsHelper.NotifyProgressionEvent(4);
     if (Main.netMode == 0)
     {
         Main.NewText(Lang.misc[8].Value, 50, 255, 130, false);
     }
     else if (Main.netMode == 2)
     {
         NetMessage.BroadcastChatMessage(Lang.misc[8].ToNetworkText(), new Color(50, 255, 130), -1);
     }
 }
示例#5
0
 private void TriggerBloodMoon()
 {
     Main.bloodMoon = true;
     AchievementsHelper.NotifyProgressionEvent(4);
     if (Main.netMode == 0)
     {
         Main.NewText(Lang.misc[8], 50, 255, 130, false);
     }
     else if (Main.netMode == 2)
     {
         NetMessage.SendData(25, -1, -1, Lang.misc[8], 255, 50f, 255f, 130f, 0, 0, 0);
     }
 }
示例#6
0
 private void TriggerEclipse()
 {
     Main.eclipse = true;
     AchievementsHelper.NotifyProgressionEvent(2);
     if (Main.netMode == 0)
     {
         Main.NewText(Lang.misc[20], 50, 255, 130, false);
     }
     else if (Main.netMode == 2)
     {
         NetMessage.SendData(25, -1, -1, Lang.misc[20], 255, 50f, 255f, 130f, 0, 0, 0);
         NetMessage.SendData(7, -1, -1, "", 0, 0f, 0f, 0f, 0, 0, 0);
     }
 }
示例#7
0
 private void bBloodmoon_onLeftClick(object sender, EventArgs e)
 {
     Main.dayTime = false;
     Main.time    = 0.0;
     if (Main.moonPhase == 0)
     {
         Main.moonPhase++;
     }
     WorldGen.spawnEye = false;
     Main.bloodMoon    = true;
     AchievementsHelper.NotifyProgressionEvent(4);
     if (Main.netMode == 0)
     {
         Main.NewText(Lang.misc[8].Value, 50, 255, 130, false);
     }
     else if (Main.netMode == 2)
     {
         NetMessage.BroadcastChatMessage(Lang.misc[8].ToNetworkText(), new Microsoft.Xna.Framework.Color(50, 255, 130), -1);
     }
 }
示例#8
0
        public override void KillMultiTile(int i, int j, int frameX, int frameY)
        {
            if (Main.netMode == NetmodeID.MultiplayerClient || !Main.hardMode || WorldGen.noTileActions || WorldGen.gen)
            {
                return;
            }
            ushort defiledStoneID = (ushort)ModContent.TileType <Defiled_Stone>();
            int    type           = WorldGen.altarCount % 3;
            float  veinCount      = Main.maxTilesX / 4200;
            int    veinSize       = 1 - type;

            veinCount  = veinCount * 310f - (85 * type);
            veinCount *= 0.85f;
            veinCount /= WorldGen.altarCount / 3 + 1;
            int messageID = 12;

            switch (type)
            {
            case 0:
                if (WorldGen.oreTier1 == -1)
                {
                    WorldGen.oreTier1 = TileID.Cobalt;
                    if (WorldGen.genRand.Next(2) == 0)
                    {
                        WorldGen.oreTier1 = TileID.Palladium;
                    }
                }
                messageID = 12;
                if (WorldGen.oreTier1 == TileID.Palladium)
                {
                    messageID += 9;
                    veinCount *= 0.9f;
                }
                type       = WorldGen.oreTier1;
                veinCount *= 1.05f;
                break;

            case 1:
                if (WorldGen.oreTier2 == -1)
                {
                    WorldGen.oreTier2 = TileID.Mythril;
                    if (WorldGen.genRand.Next(2) == 0)
                    {
                        WorldGen.oreTier2 = TileID.Orichalcum;
                    }
                }
                messageID = 13;
                if (WorldGen.oreTier2 == TileID.Orichalcum)
                {
                    messageID += 9;
                    veinCount *= 0.9f;
                }
                type = WorldGen.oreTier2;
                break;

            default:
                if (WorldGen.oreTier3 == -1)
                {
                    WorldGen.oreTier3 = TileID.Adamantite;
                    if (WorldGen.genRand.Next(2) == 0)
                    {
                        WorldGen.oreTier3 = TileID.Titanium;
                    }
                }
                messageID = 14;
                if (WorldGen.oreTier3 == TileID.Titanium)
                {
                    messageID += 9;
                    veinCount *= 0.9f;
                }
                type = WorldGen.oreTier3;
                break;
            }

            if (Main.netMode == NetmodeID.SinglePlayer)
            {
                Main.NewText(Lang.misc[messageID].Value, 50, byte.MaxValue, 130);
            }
            else if (Main.netMode == NetmodeID.Server)
            {
                NetMessage.BroadcastChatMessage(NetworkText.FromKey(Lang.misc[messageID].Key), new Color(50, 255, 130));
            }

            for (int k = 0; k < veinCount; k++)
            {
                int    oreX     = WorldGen.genRand.Next(100, Main.maxTilesX - 100);
                double minDepth = Main.worldSurface;
                if (type == TileID.Mythril || type == TileID.Orichalcum)
                {
                    minDepth = Main.rockLayer;
                }
                if (type == TileID.Adamantite || type == TileID.Titanium)
                {
                    minDepth = (Main.rockLayer + Main.rockLayer + Main.maxTilesY) / 3.0;
                }
                int oreY = WorldGen.genRand.Next((int)minDepth, Main.maxTilesY - 150);
                WorldGen.OreRunner(oreX, oreY, WorldGen.genRand.Next(5, 9 + veinSize), WorldGen.genRand.Next(5, 9 + veinSize), (ushort)type);
            }

            int stoneType  = WorldGen.genRand.Next(3);
            int stoneCount = 0;

            while (stoneType != 2 && stoneCount++ < 1000)
            {
                int stoneX = WorldGen.genRand.Next(100, Main.maxTilesX - 100);
                int stoneY = WorldGen.genRand.Next((int)Main.rockLayer + 50, Main.maxTilesY - 300);
                if (!Main.tile[stoneX, stoneY].active() || Main.tile[stoneX, stoneY].type != 1)
                {
                    continue;
                }
                if (stoneType == 1)
                {
                    Main.tile[stoneX, stoneY].type = defiledStoneID;
                }
                else
                {
                    Main.tile[stoneX, stoneY].type = TileID.Pearlstone;
                }
                if (Main.netMode == NetmodeID.Server)
                {
                    NetMessage.SendTileSquare(-1, stoneX, stoneY, 1);
                }
                break;
            }

            if (Main.netMode != NetmodeID.MultiplayerClient)
            {
                int wraithCount = Main.rand.Next(2) + 1;
                for (int l = 0; l < wraithCount; l++)
                {
                    NPC.SpawnOnPlayer(Player.FindClosest(new Vector2(i * 16, j * 16), 16, 16), NPCID.Wraith);
                }
            }

            WorldGen.altarCount++;
            AchievementsHelper.NotifyProgressionEvent(6);
        }