Esempio n. 1
0
        public override void UpdateAccessory(Player player, bool hideVisual)
        {
            var aPlayer = player.GetModPlayer <AntiarisPlayer>(mod);

            aPlayer.aItems = true;
            if (!player.buffType.Contains(mod.BuffType("Recharge")))
            {
                if (Antiaris.adventurerKey.JustPressed)
                {
                    player.TeleportationPotion();
                    AntiarisHelper.CreateDust(player, 64, 20);
                    Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Items/AdventurerItem"), player.position);
                    for (var l = 3; l < 8 + player.extraAccessorySlots; l++)
                    {
                        if (player.armor[l].type == mod.ItemType("CelestialManual"))
                        {
                            var newLife = Main.rand.Next(35, 55);
                            player.statLife += newLife;
                            player.HealEffect(newLife);
                        }
                    }
                    player.AddBuff(mod.BuffType("Recharge"), 2000);
                }
            }
        }
Esempio n. 2
0
        public override void UpdateAccessory(Player player, bool hideVisual)
        {
            AntiarisPlayer aPlayer = player.GetModPlayer <AntiarisPlayer>(mod);

            aPlayer.aItems = true;
            if (!player.buffType.Contains(ModContent.BuffType <Recharge>()))
            {
                if (player.showLastDeath)
                {
                    if (AntiarisMod.adventurerKey.JustPressed)
                    {
                        Microsoft.Xna.Framework.Vector2 teleport = player.lastDeathPostion;
                        player.Teleport(teleport, -69);
                        player.Center = teleport;
                        AntiarisHelper.CreateDust(player, 64, 20);
                        SoundEngine.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Items/AdventurerItem"), player.position);
                        for (int l = 3; l < 8 + player.extraAccessorySlots; l++)
                        {
                            if (player.armor[l].type == ModContent.ItemType <CelestialManual>())
                            {
                                int newLife = Main.rand.Next(35, 55);
                                player.statLife += newLife;
                                player.HealEffect(newLife);
                            }
                        }
                        player.AddBuff(ModContent.BuffType <Recharge>(), 2000);
                        NetMessage.SendData(MessageID.Teleport, -1, -1, null, 0, player.whoAmI, teleport.X, teleport.Y, 1, 0, 0);
                    }
                }
            }
        }
Esempio n. 3
0
        public override void UpdateAccessory(Player player, bool hideVisual)
        {
            AntiarisPlayer aPlayer = player.GetModPlayer <AntiarisPlayer>(mod);

            aPlayer.aItems = true;
            if (!player.buffType.Contains(ModContent.BuffType <Recharge>()))
            {
                if (AntiarisMod.adventurerKey.JustPressed)
                {
                    player.GetModPlayer <QuestSystem>(mod).CurrentQuest = -1;
                    AntiarisHelper.CreateDust(player, 64, 20);
                    SoundEngine.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Items/AdventurerItem"), player.position);
                    for (int l = 3; l < 8 + player.extraAccessorySlots; l++)
                    {
                        if (player.armor[l].type == ModContent.ItemType <CelestialManual>())
                        {
                            int newLife = Main.rand.Next(35, 55);
                            player.statLife += newLife;
                            player.HealEffect(newLife);
                        }
                    }
                    player.AddBuff(ModContent.BuffType <Recharge>(), 7200);
                }
            }
        }
        public override void UpdateAccessory(Player player, bool hideVisual)
        {
            var aPlayer = player.GetModPlayer <AntiarisPlayer>(mod);

            aPlayer.aItems = true;
            if (!player.buffType.Contains(mod.BuffType("Recharge")))
            {
                if (player.showLastDeath)
                {
                    if (Antiaris.adventurerKey.JustPressed)
                    {
                        var teleport = player.lastDeathPostion;
                        player.Teleport(teleport, -69);
                        player.Center = teleport;
                        AntiarisHelper.CreateDust(player, 64, 20);
                        Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Items/AdventurerItem"), player.position);
                        for (var l = 3; l < 8 + player.extraAccessorySlots; l++)
                        {
                            if (player.armor[l].type == mod.ItemType("CelestialManual"))
                            {
                                var newLife = Main.rand.Next(35, 55);
                                player.statLife += newLife;
                                player.HealEffect(newLife);
                            }
                        }
                        player.AddBuff(mod.BuffType("Recharge"), 2000);
                        NetMessage.SendData(65, -1, -1, null, 0, player.whoAmI, teleport.X, teleport.Y, 1, 0, 0);
                    }
                }
            }
        }
Esempio n. 5
0
        public override void UpdateAccessory(Player player, bool hideVisual)
        {
            AntiarisPlayer aPlayer = player.GetModPlayer <AntiarisPlayer>(mod);

            aPlayer.aItems     = true;
            player.pStone      = true;
            player.longInvince = true;
            if (!player.buffType.Contains(ModContent.BuffType <Recharge>()))
            {
                if (AntiarisMod.adventurerKey.JustPressed)
                {
                    var teleportPos = new Vector2();
                    teleportPos.X = Main.mouseX + Main.screenPosition.X - player.width / 2;
                    teleportPos.Y = player.gravDir != 1 ? (Main.screenPosition.Y + Main.screenHeight - Main.mouseY) : (Main.mouseY + Main.screenPosition.Y - player.height);
                    if (teleportPos.X > 50 && teleportPos.X < (double)(Main.maxTilesX * 16 - 50) && (teleportPos.Y > 50 && teleportPos.Y < (double)(Main.maxTilesY * 16 - 55)))
                    {
                        int tileX = (int)(teleportPos.X / 16f);
                        int tileY = (int)(teleportPos.Y / 16f);
                        if (!Collision.SolidCollision(teleportPos, player.width, player.height))
                        {
                            AntiarisHelper.TeleportTo(player, teleportPos);
                            AntiarisHelper.CreateDust(player, 64, 20);
                            SoundEngine.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Items/AdventurerItem"), player.position);
                            for (int l = 3; l < 8 + player.extraAccessorySlots; l++)
                            {
                                int newLife = Main.rand.Next(35, 55);
                                if (player.armor[l].type == ModContent.ItemType <CelestialManual>())
                                {
                                    player.statLife += newLife;
                                    player.HealEffect(newLife);
                                }
                            }
                            player.statLife += 15;
                            NetMessage.SendData(MessageID.Teleport, -1, -1, null, 0, player.whoAmI, teleportPos.X, teleportPos.Y, 1, 0, 0);
                            player.AddBuff(ModContent.BuffType <Recharge>(), 840);
                        }
                    }
                }
            }
        }
Esempio n. 6
0
        public override void UpdateAccessory(Player player, bool hideVisual)
        {
            var aPlayer = player.GetModPlayer <AntiarisPlayer>(mod);

            aPlayer.aItems = true;
            if (!player.buffType.Contains(mod.BuffType("Recharge")))
            {
                if (Antiaris.adventurerKey.JustPressed)
                {
                    var teleportPos = new Vector2();
                    teleportPos.X = Main.mouseX + Main.screenPosition.X - player.width / 2;
                    teleportPos.Y = player.gravDir != 1 ? (Main.screenPosition.Y + Main.screenHeight - Main.mouseY) : (Main.mouseY + Main.screenPosition.Y - player.height);
                    if (teleportPos.X > 50 && teleportPos.X < (double)(Main.maxTilesX * 16 - 50) && (teleportPos.Y > 50 && teleportPos.Y < (double)(Main.maxTilesY * 16 - 55)))
                    {
                        var tileX = (int)(teleportPos.X / 16f);
                        var tileY = (int)(teleportPos.Y / 16f);
                        if (((int)Main.tile[tileX, tileY].wall != 87 || (double)tileY <= Main.worldSurface || NPC.downedPlantBoss) && !Collision.SolidCollision(teleportPos, player.width, player.height))
                        {
                            AntiarisHelper.TeleportTo(player, teleportPos);
                            AntiarisHelper.CreateDust(player, 64, 20);
                            Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Items/AdventurerItem"), player.position);
                            for (var l = 3; l < 8 + player.extraAccessorySlots; l++)
                            {
                                if (player.armor[l].type == mod.ItemType("CelestialManual"))
                                {
                                    var newLife = Main.rand.Next(35, 55);
                                    player.statLife += newLife;
                                    player.HealEffect(newLife);
                                }
                            }
                            NetMessage.SendData(65, -1, -1, null, 0, player.whoAmI, teleportPos.X, teleportPos.Y, 1, 0, 0);
                            player.AddBuff(mod.BuffType("Recharge"), 600);
                        }
                    }
                }
            }
        }