コード例 #1
0
        public override void PostDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
        {
            Color color = Color.White * (float)Math.Sin(LegendWorld.rottime + 3.14);
            spriteBatch.Draw(Glow, position, new Rectangle(0, 0, 32, 32), color, 0, origin, scale, SpriteEffects.None, 0);

            Bootlegdust.ForEach(BootlegDust => BootlegDust.Draw(spriteBatch));

            if (Main.rand.Next(4) == 0)
            {
                BootlegDust dus = new BlessDust(ModContent.GetTexture("StarlightRiver/GUI/Holy"), position + new Vector2(Main.rand.Next(0, frame.Width - 4), Main.rand.Next(0, frame.Height - 4)), new Vector2(0, 0.1f), Color.White * 0.1f, 1.5f, 120);
                Bootlegdust.Add(dus);
            }

            BootlegDust dus2 = new BlessDust2(ModContent.GetTexture("StarlightRiver/GUI/Holy"), position + new Vector2(-0.4f, -0.4f) + Vector2.One * frame.Width / 2 * scale + Vector2.One.RotatedBy(LegendWorld.rottime) * 13, Vector2.Zero, Color.White * 1f, 0.8f, 60);
            //Bootlegdust.Add(dus2);

            BootlegDust dus3 = new BlessDust2(ModContent.GetTexture("StarlightRiver/GUI/Holy"), position + new Vector2(-0.4f, -0.4f) + Vector2.One * frame.Width / 2 * scale + new Vector2((float)Math.Cos(LegendWorld.rottime) / 2, (float)Math.Sin(LegendWorld.rottime)) * 16, Vector2.Zero, Color.White * 1f, 0.8f, 60);
            if (LegendWorld.rottime > 3.14 / 2 && LegendWorld.rottime < 3.14 * 3 / 2) { Bootlegdust.Add(dus3); }
            else { Bootlegdust2.Add(dus3); }

            BootlegDust dus4 = new BlessDust2(ModContent.GetTexture("StarlightRiver/GUI/Holy"), position + new Vector2(-0.4f, -0.4f) + Vector2.One * frame.Width / 2 * scale + new Vector2((float)Math.Cos(LegendWorld.rottime), (float)Math.Sin(LegendWorld.rottime) / 2) * 16, Vector2.Zero, Color.White * 1f, 0.8f, 60);
            if (LegendWorld.rottime  > 3.14) { Bootlegdust.Add(dus4); }
            else { Bootlegdust2.Add(dus4); }

            drawpos = position - new Vector2((frame.Width / 2), (frame.Width / 2));
        }
コード例 #2
0
        private void drawVitricBackground(On.Terraria.Main.orig_DrawBackgroundBlackFill orig, Terraria.Main self)
        {
            orig(self);
            Player player = Main.LocalPlayer;

            VitricBackgroundDust.ForEach(BootlegDust => BootlegDust.Update());
            VitricBackgroundDust.RemoveAll(BootlegDust => BootlegDust.time <= 0);

            VitricForegroundDust.ForEach(BootlegDust => BootlegDust.Update());
            VitricForegroundDust.RemoveAll(BootlegDust => BootlegDust.time <= 0);

            if (Main.playerLoaded && player.GetModPlayer <BiomeHandler>().ZoneGlass)
            {
                Vector2 basepoint = (LegendWorld.vitricTopLeft != null) ? LegendWorld.vitricTopLeft * 16 + new Vector2(-2000, 1000) : Vector2.Zero;
                for (int k = 5; k >= 0; k--)
                {
                    drawLayer(basepoint, ModContent.GetTexture("StarlightRiver/Backgrounds/Glass" + k), k + 1);
                    if (k == 5)
                    {
                        VitricBackgroundDust.ForEach(BootlegDust => BootlegDust.Draw(Main.spriteBatch));
                    }
                    if (k == 2)
                    {
                        VitricForegroundDust.ForEach(BootlegDust => BootlegDust.Draw(Main.spriteBatch));
                    }
                }

                for (int k = (int)(player.position.X - basepoint.X) - (int)(Main.screenWidth * 1.5f); k <= (int)(player.position.X - basepoint.X) + (int)(Main.screenWidth * 1.5f); k += 30)
                {
                    if (Main.rand.Next(500) == 0)
                    {
                        BootlegDust dus = new VitricDust(ModContent.GetTexture("StarlightRiver/GUI/Light"), basepoint + new Vector2(-2000, 1000), k, 1.5f, 0.3f, 0.1f);
                        VitricBackgroundDust.Add(dus);
                    }

                    if (Main.rand.Next(400) == 0)
                    {
                        BootlegDust dus2 = new VitricDust(ModContent.GetTexture("StarlightRiver/GUI/Light"), basepoint + new Vector2(-2000, 1000), k, 2.25f, 1f, 0.4f);
                        VitricForegroundDust.Add(dus2);
                    }
                }

                for (int i = -2 + (int)(player.position.X - Main.screenWidth / 2) / 16; i <= 2 + (int)(player.position.X + Main.screenWidth / 2) / 16; i++)
                {
                    for (int j = -2 + (int)(player.position.Y - Main.screenHeight) / 16; j <= 2 + (int)(player.position.Y + Main.screenHeight) / 16; j++)
                    {
                        if (Lighting.Brightness(i, j) == 0 || ((Main.tile[i, j].active() && Main.tile[i, j].collisionType == 1) || Main.tile[i, j].wall != 0))
                        {
                            Color color = Color.Black * (1 - Lighting.Brightness(i, j) * 2);
                            Main.spriteBatch.Draw(Main.blackTileTexture, new Vector2(i * 16, j * 16) - Main.screenPosition, color);
                        }
                        else if (i % 4 == 0 && j % 4 == 0 && Main.tile[i, j].wall == 0)
                        {
                            Lighting.AddLight(new Vector2(i * 16, j * 16), new Vector3(0.3f, 0.35f, 0.4f) * 2.1f);
                        }
                    }
                }
            }
        }
コード例 #3
0
        public override void DrawEffects(PlayerDrawInfo drawInfo, ref float r, ref float g, ref float b, ref float a, ref bool fullBright)
        {
            //updates visuals for cursed accessories
            CursedAccessory.Bootlegdust.ForEach(BootlegDust => BootlegDust.Update());
            CursedAccessory.Bootlegdust.RemoveAll(BootlegDust => BootlegDust.time <= 0);
            //updates visuals for blessed accessories
            BlessedAccessory.Bootlegdust.ForEach(BootlegDust => BootlegDust.Update());
            BlessedAccessory.Bootlegdust.RemoveAll(BootlegDust => BootlegDust.time <= 0);

            BlessedAccessory.Bootlegdust2.ForEach(BootlegDust => BootlegDust.Update());
            BlessedAccessory.Bootlegdust2.RemoveAll(BootlegDust => BootlegDust.time <= 0);
        }
コード例 #4
0
        public override void PostDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
        {
            Color color = Color.White * (float)Math.Sin(LegendWorld.rottime);

            spriteBatch.Draw(Glow, position, new Rectangle(0, 0, 32, 32), color, 0, origin, scale, SpriteEffects.None, 0);

            Bootlegdust.ForEach(BootlegDust => BootlegDust.Draw(spriteBatch));

            BootlegDust dus = new CurseDust(ModContent.GetTexture("StarlightRiver/GUI/Dark"), position + new Vector2(Main.rand.Next(0, frame.Width - 4), Main.rand.Next(0, frame.Height - 4)), new Vector2(0, -0.4f), Color.White * 0.1f, 1.5f, 60);

            Bootlegdust.Add(dus);

            drawpos = position - new Vector2((frame.Width / 2), (frame.Width / 2));
        }
コード例 #5
0
 public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
 {
     Bootlegdust2.ForEach(BootlegDust => BootlegDust.Draw(spriteBatch));
     return true;
 }