private void DrawFullMap(SpriteBatch sb)
        {
            this.UI.Update();

            WormholesWorld  modworld       = this.GetModWorld <WormholesWorld>();
            WormholesPlayer curr_modplayer = Main.player[Main.myPlayer].GetModPlayer <WormholesPlayer>(this);

            if (!this.Config.DisableNaturalWormholes)
            {
                if (modworld.Wormholes != null)
                {
                    for (int i = 0; i < modworld.Wormholes.Links.Count; i++)
                    {
                        WormholeLink link = modworld.Wormholes.Links[i];
                        if (link == null)
                        {
                            break;
                        }

                        this.UI.DrawFullscreenMap(link, sb);
                    }
                }
            }

            if (curr_modplayer.MyPortal != null)
            {
                this.UI.DrawFullscreenMap(curr_modplayer.MyPortal, sb);
            }
        }
Beispiel #2
0
        private void DrawFullMap(SpriteBatch sb)
        {
            this.UI.Update();

            WormholesWorld  myworld  = ModContent.GetInstance <WormholesWorld>();
            WormholesPlayer myplayer = Main.LocalPlayer.GetModPlayer <WormholesPlayer>();

            if (!WormholesConfig.Instance.DisableNaturalWormholes)
            {
                if (myworld.Wormholes != null)
                {
                    for (int i = 0; i < myworld.Wormholes.Links.Count; i++)
                    {
                        WormholeLink link = myworld.Wormholes.Links[i];
                        if (link == null)
                        {
                            break;
                        }

                        this.UI.DrawFullscreenMap(link, sb);
                    }
                }
            }

            if (myplayer.MyPortal != null)
            {
                this.UI.DrawFullscreenMap(myplayer.MyPortal, sb);
            }
        }
Beispiel #3
0
        protected virtual void Teleport(Player player, Vector2 dest)
        {
            var             mymod    = WormholesMod.Instance;
            WormholesPlayer myplayer = player.GetModPlayer <WormholesPlayer>(mymod);

            if (myplayer.MyPortal == null || (myplayer.MyPortal != null && this.ID != myplayer.MyPortal.ID))
            {
                myplayer.ChartedLinks.Add(this.ID);
            }

            PlayerHelpers.Teleport(player, dest);

            if (player.FindBuffIndex(88) != -1)
            {
                int def = player.statDefense;
                player.statDefense = 0;
                var dmg = player.Hurt(PlayerDeathReason.ByOther(13), player.statLifeMax2 / 7, 0);
                player.statDefense = def;
            }

            player.AddBuff(164, (int)(60f * 2.5f));      // Distorted
            player.AddBuff(88, 60 * 10);                 // Chaos State

            float vel_x = player.velocity.X * 3;
            float vel_y = player.velocity.Y * 3;

            if (vel_x > 0 && vel_x < 1)
            {
                vel_x = 1;
            }
            else if (vel_x < 0 && vel_x > 1)
            {
                vel_x = -1;
            }
            if (vel_y > 0 && vel_y < 1)
            {
                vel_y = 1;
            }
            else if (vel_y < 0 && vel_y > 1)
            {
                vel_y = -1;
            }

            for (int i = 0; i < 24; i++)
            {
                Dust.NewDust(player.position, player.width, player.height, 245, vel_x, vel_y);
            }

            //Main.PlaySound( 2, player.position, 100 );
            var snd = SoundID.Item100.WithVolume(mymod.Config.WormholeEntrySoundVolume);

            Main.PlaySound(snd, player.position);
        }
Beispiel #4
0
        protected virtual void Teleport(Player player, Vector2 dest)
        {
            WormholesPlayer myplayer = player.GetModPlayer <WormholesPlayer>();

            if (myplayer.MyPortal == null || (myplayer.MyPortal != null && this.ID != myplayer.MyPortal.ID))
            {
                myplayer.ChartedLinks.Add(this.ID);
            }

            PlayerWarpHelpers.Teleport(player, dest);

            if (player.FindBuffIndex(BuffID.ChaosState) != -1)
            {
                int def = player.statDefense;
                player.statDefense = 0;
                var dmg = player.Hurt(PlayerDeathReason.ByOther(13), player.statLifeMax2 / 7, 0);
                player.statDefense = def;
            }

            player.AddBuff(BuffID.VortexDebuff, (int)(60f * 2.5f));     // Distorted
            player.AddBuff(BuffID.ChaosState, 60 * 10);                 // Chaos State

            float velX = player.velocity.X * 3;
            float velY = player.velocity.Y * 3;

            if (velX > 0 && velX < 1)
            {
                velX = 1;
            }
            else if (velX < 0 && velX > 1)
            {
                velX = -1;
            }
            if (velY > 0 && velY < 1)
            {
                velY = 1;
            }
            else if (velY < 0 && velY > 1)
            {
                velY = -1;
            }

            for (int i = 0; i < 24; i++)
            {
                Dust.NewDust(player.position, player.width, player.height, 245, velX, velY);
            }

            //Main.PlaySound( 2, player.position, 100 );
            var snd = SoundID.Item100.WithVolume(WormholesConfig.Instance.WormholeEntrySoundVolume);

            Main.PlaySound(snd, player.position);
        }
        ////////////////

        private void DrawMiniMap(SpriteBatch sb)
        {
            this.UI.Update();

            WormholesWorld  modworld       = this.GetModWorld <WormholesWorld>();
            WormholesPlayer curr_modplayer = Main.player[Main.myPlayer].GetModPlayer <WormholesPlayer>(this);

            if (!this.Config.Data.DisableNaturalWormholes)
            {
                if (modworld.Wormholes != null)
                {
                    for (int i = 0; i < modworld.Wormholes.Links.Count; i++)
                    {
                        WormholeLink link = modworld.Wormholes.Links[i];
                        if (link == null)
                        {
                            break;
                        }

                        if (Main.mapStyle == 1)
                        {
                            this.UI.DrawMiniMap(this.Context, link, sb);
                        }
                        else
                        {
                            this.UI.DrawOverlayMap(this.Context, link, sb);
                        }
                    }
                }
            }

            if (curr_modplayer.MyPortal != null)
            {
                if (Main.mapStyle == 1)
                {
                    this.UI.DrawMiniMap(this.Context, curr_modplayer.MyPortal, sb);
                }
                else
                {
                    this.UI.DrawOverlayMap(this.Context, curr_modplayer.MyPortal, sb);
                }
            }
        }