Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ DrawTiles_EmitParticles()

void Terraria.GameContent.Drawing.TileDrawing.DrawTiles_EmitParticles ( int j,
int i,
Tile tileCache,
ushort typeCache,
short tileFrameX,
short tileFrameY,
Color tileLight )
inlineprivate

Definition at line 5717 of file TileDrawing.cs.

5718 {
5719 bool num = IsVisible(tileCache);
5721 leafFrequency /= 4;
5722 if (typeCache == 244 && tileFrameX == 18 && tileFrameY == 18 && _rand.Next(2) == 0)
5723 {
5724 if (_rand.Next(500) == 0)
5725 {
5726 Gore.NewGore(new Vector2(i * 16 + 8, j * 16 + 8), default(Vector2), 415, (float)_rand.Next(51, 101) * 0.01f);
5727 }
5728 else if (_rand.Next(250) == 0)
5729 {
5730 Gore.NewGore(new Vector2(i * 16 + 8, j * 16 + 8), default(Vector2), 414, (float)_rand.Next(51, 101) * 0.01f);
5731 }
5732 else if (_rand.Next(80) == 0)
5733 {
5734 Gore.NewGore(new Vector2(i * 16 + 8, j * 16 + 8), default(Vector2), 413, (float)_rand.Next(51, 101) * 0.01f);
5735 }
5736 else if (_rand.Next(10) == 0)
5737 {
5738 Gore.NewGore(new Vector2(i * 16 + 8, j * 16 + 8), default(Vector2), 412, (float)_rand.Next(51, 101) * 0.01f);
5739 }
5740 else if (_rand.Next(3) == 0)
5741 {
5742 Gore.NewGore(new Vector2(i * 16 + 8, j * 16 + 8), default(Vector2), 411, (float)_rand.Next(51, 101) * 0.01f);
5743 }
5744 }
5745 if (typeCache == 565 && tileFrameX == 0 && tileFrameY == 18 && _rand.Next(3) == 0 && ((Main.drawToScreen && _rand.Next(4) == 0) || !Main.drawToScreen))
5746 {
5747 Vector2 vector = new Point(i, j).ToWorldCoordinates();
5748 int type = 1202;
5749 float scale = 8f + Main.rand.NextFloat() * 1.6f;
5750 Vector2 position = vector + new Vector2(0f, -18f);
5751 Vector2 velocity = Main.rand.NextVector2Circular(0.7f, 0.25f) * 0.4f + Main.rand.NextVector2CircularEdge(1f, 0.4f) * 0.1f;
5752 velocity *= 4f;
5753 Gore.NewGorePerfect(position, velocity, type, scale);
5754 }
5755 if (typeCache == 215 && tileFrameY < 36 && _rand.Next(3) == 0 && ((Main.drawToScreen && _rand.Next(4) == 0) || !Main.drawToScreen) && tileFrameY == 0)
5756 {
5757 int num2 = Dust.NewDust(new Vector2(i * 16 + 2, j * 16 - 4), 4, 8, 31, 0f, 0f, 100);
5758 if (tileFrameX == 0)
5759 {
5760 _dust[num2].position.X += _rand.Next(8);
5761 }
5762 if (tileFrameX == 36)
5763 {
5764 _dust[num2].position.X -= _rand.Next(8);
5765 }
5766 _dust[num2].alpha += _rand.Next(100);
5767 _dust[num2].velocity *= 0.2f;
5768 _dust[num2].velocity.Y -= 0.5f + (float)_rand.Next(10) * 0.1f;
5769 _dust[num2].fadeIn = 0.5f + (float)_rand.Next(10) * 0.1f;
5770 }
5771 if (typeCache == 592 && tileFrameY == 18 && _rand.Next(3) == 0)
5772 {
5773 if ((Main.drawToScreen && _rand.Next(6) == 0) || !Main.drawToScreen)
5774 {
5775 int num3 = Dust.NewDust(new Vector2(i * 16 + 2, j * 16 + 4), 4, 8, 31, 0f, 0f, 100);
5776 if (tileFrameX == 0)
5777 {
5778 _dust[num3].position.X += _rand.Next(8);
5779 }
5780 if (tileFrameX == 36)
5781 {
5782 _dust[num3].position.X -= _rand.Next(8);
5783 }
5784 _dust[num3].alpha += _rand.Next(100);
5785 _dust[num3].velocity *= 0.2f;
5786 _dust[num3].velocity.Y -= 0.5f + (float)_rand.Next(10) * 0.1f;
5787 _dust[num3].fadeIn = 0.5f + (float)_rand.Next(10) * 0.1f;
5788 }
5789 }
5790 else if (typeCache == 406 && tileFrameY == 54 && tileFrameX == 0 && _rand.Next(3) == 0)
5791 {
5792 Vector2 position2 = new Vector2(i * 16 + 16, j * 16 + 8);
5793 Vector2 velocity2 = new Vector2(0f, 0f);
5794 if (Main.WindForVisuals < 0f)
5795 {
5796 velocity2.X = 0f - Main.WindForVisuals;
5797 }
5798 int type2 = _rand.Next(825, 828);
5799 if (_rand.Next(4) == 0)
5800 {
5801 Gore.NewGore(position2, velocity2, type2, _rand.NextFloat() * 0.2f + 0.2f);
5802 }
5803 else if (_rand.Next(2) == 0)
5804 {
5805 Gore.NewGore(position2, velocity2, type2, _rand.NextFloat() * 0.3f + 0.3f);
5806 }
5807 else
5808 {
5809 Gore.NewGore(position2, velocity2, type2, _rand.NextFloat() * 0.4f + 0.4f);
5810 }
5811 }
5812 else if (typeCache == 452 && tileFrameY == 0 && tileFrameX == 0 && _rand.Next(3) == 0)
5813 {
5814 Vector2 position3 = new Vector2(i * 16 + 16, j * 16 + 8);
5815 Vector2 velocity3 = new Vector2(0f, 0f);
5816 if (Main.WindForVisuals < 0f)
5817 {
5818 velocity3.X = 0f - Main.WindForVisuals;
5819 }
5820 int num4 = Main.tileFrame[typeCache];
5821 int type3 = 907 + num4 / 5;
5822 if (_rand.Next(2) == 0)
5823 {
5824 Gore.NewGore(position3, velocity3, type3, _rand.NextFloat() * 0.4f + 0.4f);
5825 }
5826 }
5827 if (typeCache == 192 && _rand.Next(leafFrequency) == 0)
5828 {
5829 EmitLivingTreeLeaf(i, j, 910);
5830 }
5831 if (typeCache == 384 && _rand.Next(leafFrequency) == 0)
5832 {
5833 EmitLivingTreeLeaf(i, j, 914);
5834 }
5835 if (typeCache == 666 && _rand.Next(100) == 0 && j - 1 > 0 && !WorldGen.ActiveAndWalkableTile(i, j - 1))
5836 {
5837 ParticleOrchestrator.RequestParticleSpawn(clientOnly: true, ParticleOrchestraType.PooFly, new ParticleOrchestraSettings
5838 {
5839 PositionInWorld = new Vector2(i * 16 + 8, j * 16 - 8)
5840 });
5841 }
5842 if (!num)
5843 {
5844 return;
5845 }
5846 if (typeCache == 238 && _rand.Next(10) == 0)
5847 {
5848 int num5 = Dust.NewDust(new Vector2(i * 16, j * 16), 16, 16, 168);
5849 _dust[num5].noGravity = true;
5850 _dust[num5].alpha = 200;
5851 }
5852 if (typeCache == 139)
5853 {
5854 if (tileCache.frameX == 36 && tileCache.frameY % 36 == 0 && (int)Main.timeForVisualEffects % 7 == 0 && _rand.Next(3) == 0)
5855 {
5856 int num6 = _rand.Next(570, 573);
5857 Vector2 position4 = new Vector2(i * 16 + 8, j * 16 - 8);
5858 Vector2 velocity4 = new Vector2(Main.WindForVisuals * 2f, -0.5f);
5859 velocity4.X *= 1f + (float)_rand.Next(-50, 51) * 0.01f;
5860 velocity4.Y *= 1f + (float)_rand.Next(-50, 51) * 0.01f;
5861 if (num6 == 572)
5862 {
5863 position4.X -= 8f;
5864 }
5865 if (num6 == 571)
5866 {
5867 position4.X -= 4f;
5868 }
5869 Gore.NewGore(position4, velocity4, num6, 0.8f);
5870 }
5871 }
5872 else if (typeCache == 463)
5873 {
5874 if (tileFrameY == 54 && tileFrameX == 0)
5875 {
5876 for (int k = 0; k < 4; k++)
5877 {
5878 if (_rand.Next(2) != 0)
5879 {
5880 Dust dust = Dust.NewDustDirect(new Vector2(i * 16 + 4, j * 16), 36, 8, 16);
5881 dust.noGravity = true;
5882 dust.alpha = 140;
5883 dust.fadeIn = 1.2f;
5884 dust.velocity = Vector2.Zero;
5885 }
5886 }
5887 }
5888 if (tileFrameY == 18 && (tileFrameX == 0 || tileFrameX == 36))
5889 {
5890 for (int l = 0; l < 1; l++)
5891 {
5892 if (_rand.Next(13) == 0)
5893 {
5894 Dust dust2 = Dust.NewDustDirect(new Vector2(i * 16, j * 16), 8, 8, 274);
5895 dust2.position = new Vector2(i * 16 + 8, j * 16 + 8);
5896 dust2.position.X += ((tileFrameX == 36) ? 4 : (-4));
5897 dust2.noGravity = true;
5898 dust2.alpha = 128;
5899 dust2.fadeIn = 1.2f;
5900 dust2.noLight = true;
5901 dust2.velocity = new Vector2(0f, _rand.NextFloatDirection() * 1.2f);
5902 }
5903 }
5904 }
5905 }
5906 else if (typeCache == 497)
5907 {
5908 if (tileCache.frameY / 40 == 31 && tileCache.frameY % 40 == 0)
5909 {
5910 for (int m = 0; m < 1; m++)
5911 {
5912 if (_rand.Next(10) == 0)
5913 {
5914 Dust dust3 = Dust.NewDustDirect(new Vector2(i * 16, j * 16 + 8), 16, 12, 43);
5915 dust3.noGravity = true;
5916 dust3.alpha = 254;
5917 dust3.color = Color.White;
5918 dust3.scale = 0.7f;
5919 dust3.velocity = Vector2.Zero;
5920 dust3.noLight = true;
5921 }
5922 }
5923 }
5924 }
5925 else if (typeCache == 165 && tileFrameX >= 162 && tileFrameX <= 214 && tileFrameY == 72)
5926 {
5927 if (_rand.Next(60) == 0)
5928 {
5929 int num7 = Dust.NewDust(new Vector2(i * 16 + 2, j * 16 + 6), 8, 4, 153);
5930 _dust[num7].scale -= (float)_rand.Next(3) * 0.1f;
5931 _dust[num7].velocity.Y = 0f;
5932 _dust[num7].velocity.X *= 0.05f;
5933 _dust[num7].alpha = 100;
5934 }
5935 }
5936 else if (typeCache == 42 && tileFrameX == 0)
5937 {
5938 int num8 = tileFrameY / 36;
5939 int num9 = tileFrameY / 18 % 2;
5940 if (num8 == 7 && num9 == 1)
5941 {
5942 if (_rand.Next(50) == 0)
5943 {
5944 int num10 = Dust.NewDust(new Vector2(i * 16 + 4, j * 16 + 4), 8, 8, 58, 0f, 0f, 150);
5945 _dust[num10].velocity *= 0.5f;
5946 }
5947 if (_rand.Next(100) == 0)
5948 {
5949 int num11 = Gore.NewGore(new Vector2(i * 16 - 2, j * 16 - 4), default(Vector2), _rand.Next(16, 18));
5950 _gore[num11].scale *= 0.7f;
5951 _gore[num11].velocity *= 0.25f;
5952 }
5953 }
5954 else if (num8 == 29 && num9 == 1 && _rand.Next(40) == 0)
5955 {
5956 int num12 = Dust.NewDust(new Vector2(i * 16 + 4, j * 16), 8, 8, 59, 0f, 0f, 100);
5957 if (_rand.Next(3) != 0)
5958 {
5959 _dust[num12].noGravity = true;
5960 }
5961 _dust[num12].velocity *= 0.3f;
5962 _dust[num12].velocity.Y -= 1.5f;
5963 }
5964 }
5965 if (typeCache == 4 && _rand.Next(40) == 0 && tileFrameX < 66)
5966 {
5967 int num13 = (int)MathHelper.Clamp(tileCache.frameY / 22, 0f, TorchID.Count - 1);
5968 int num14 = TorchID.Dust[num13];
5969 int num15 = 0;
5970 num15 = tileFrameX switch
5971 {
5972 22 => Dust.NewDust(new Vector2(i * 16 + 6, j * 16), 4, 4, num14, 0f, 0f, 100),
5973 44 => Dust.NewDust(new Vector2(i * 16 + 2, j * 16), 4, 4, num14, 0f, 0f, 100),
5974 _ => Dust.NewDust(new Vector2(i * 16 + 4, j * 16), 4, 4, num14, 0f, 0f, 100),
5975 };
5976 if (_rand.Next(3) != 0)
5977 {
5978 _dust[num15].noGravity = true;
5979 }
5980 _dust[num15].velocity *= 0.3f;
5981 _dust[num15].velocity.Y -= 1.5f;
5982 if (num14 == 66)
5983 {
5984 _dust[num15].color = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB);
5985 _dust[num15].noGravity = true;
5986 }
5987 }
5988 if (typeCache == 93 && _rand.Next(40) == 0 && tileFrameX == 0)
5989 {
5990 int num16 = tileFrameY / 54;
5991 if (tileFrameY / 18 % 3 == 0)
5992 {
5993 int num17;
5994 switch (num16)
5995 {
5996 case 0:
5997 case 6:
5998 case 7:
5999 case 8:
6000 case 10:
6001 case 14:
6002 case 15:
6003 case 16:
6004 num17 = 6;
6005 break;
6006 case 20:
6007 num17 = 59;
6008 break;
6009 default:
6010 num17 = -1;
6011 break;
6012 }
6013 if (num17 != -1)
6014 {
6015 int num18 = Dust.NewDust(new Vector2(i * 16 + 4, j * 16 + 2), 4, 4, num17, 0f, 0f, 100);
6016 if (_rand.Next(3) != 0)
6017 {
6018 _dust[num18].noGravity = true;
6019 }
6020 _dust[num18].velocity *= 0.3f;
6021 _dust[num18].velocity.Y -= 1.5f;
6022 }
6023 }
6024 }
6025 if (typeCache == 100 && _rand.Next(40) == 0 && tileFrameX < 36)
6026 {
6027 int num19 = tileFrameY / 36;
6028 if (tileFrameY / 18 % 2 == 0)
6029 {
6030 int num20;
6031 switch (num19)
6032 {
6033 case 0:
6034 case 5:
6035 case 7:
6036 case 8:
6037 case 10:
6038 case 12:
6039 case 14:
6040 case 15:
6041 case 16:
6042 num20 = 6;
6043 break;
6044 case 20:
6045 num20 = 59;
6046 break;
6047 default:
6048 num20 = -1;
6049 break;
6050 }
6051 if (num20 != -1)
6052 {
6053 int num21 = 0;
6054 Vector2 position5 = ((tileFrameX == 0) ? ((_rand.Next(3) != 0) ? new Vector2(i * 16 + 14, j * 16 + 2) : new Vector2(i * 16 + 4, j * 16 + 2)) : ((_rand.Next(3) != 0) ? new Vector2(i * 16, j * 16 + 2) : new Vector2(i * 16 + 6, j * 16 + 2)));
6055 num21 = Dust.NewDust(position5, 4, 4, num20, 0f, 0f, 100);
6056 if (_rand.Next(3) != 0)
6057 {
6058 _dust[num21].noGravity = true;
6059 }
6060 _dust[num21].velocity *= 0.3f;
6061 _dust[num21].velocity.Y -= 1.5f;
6062 }
6063 }
6064 }
6065 if (typeCache == 98 && _rand.Next(40) == 0 && tileFrameY == 0 && tileFrameX == 0)
6066 {
6067 int num22 = Dust.NewDust(new Vector2(i * 16 + 12, j * 16 + 2), 4, 4, 6, 0f, 0f, 100);
6068 if (_rand.Next(3) != 0)
6069 {
6070 _dust[num22].noGravity = true;
6071 }
6072 _dust[num22].velocity *= 0.3f;
6073 _dust[num22].velocity.Y -= 1.5f;
6074 }
6075 if (typeCache == 49 && tileFrameX == 0 && _rand.Next(2) == 0)
6076 {
6077 int num23 = Dust.NewDust(new Vector2(i * 16 + 4, j * 16 - 4), 4, 4, 172, 0f, 0f, 100);
6078 if (_rand.Next(3) == 0)
6079 {
6080 _dust[num23].scale = 0.5f;
6081 }
6082 else
6083 {
6084 _dust[num23].scale = 0.9f;
6085 _dust[num23].noGravity = true;
6086 }
6087 _dust[num23].velocity *= 0.3f;
6088 _dust[num23].velocity.Y -= 1.5f;
6089 }
6090 if (typeCache == 372 && tileFrameX == 0 && _rand.Next(2) == 0)
6091 {
6092 int num24 = Dust.NewDust(new Vector2(i * 16 + 4, j * 16 - 4), 4, 4, 242, 0f, 0f, 100);
6093 if (_rand.Next(3) == 0)
6094 {
6095 _dust[num24].scale = 0.5f;
6096 }
6097 else
6098 {
6099 _dust[num24].scale = 0.9f;
6100 _dust[num24].noGravity = true;
6101 }
6102 _dust[num24].velocity *= 0.3f;
6103 _dust[num24].velocity.Y -= 1.5f;
6104 }
6105 if (typeCache == 646 && tileFrameX == 0)
6106 {
6107 _rand.Next(2);
6108 }
6109 if (typeCache == 34 && _rand.Next(40) == 0 && tileFrameX < 54)
6110 {
6111 int num25 = tileFrameY / 54;
6112 int num26 = tileFrameX / 18 % 3;
6113 if (tileFrameY / 18 % 3 == 1 && num26 != 1)
6114 {
6115 int num27;
6116 switch (num25)
6117 {
6118 case 0:
6119 case 1:
6120 case 2:
6121 case 3:
6122 case 4:
6123 case 5:
6124 case 12:
6125 case 13:
6126 case 16:
6127 case 19:
6128 case 21:
6129 num27 = 6;
6130 break;
6131 case 25:
6132 num27 = 59;
6133 break;
6134 default:
6135 num27 = -1;
6136 break;
6137 }
6138 if (num27 != -1)
6139 {
6140 int num28 = Dust.NewDust(new Vector2(i * 16, j * 16 + 2), 14, 6, num27, 0f, 0f, 100);
6141 if (_rand.Next(3) != 0)
6142 {
6143 _dust[num28].noGravity = true;
6144 }
6145 _dust[num28].velocity *= 0.3f;
6146 _dust[num28].velocity.Y -= 1.5f;
6147 }
6148 }
6149 }
6150 if (typeCache == 83)
6151 {
6152 int style = tileFrameX / 18;
6153 if (IsAlchemyPlantHarvestable(style))
6154 {
6155 EmitAlchemyHerbParticles(j, i, style);
6156 }
6157 }
6158 if (typeCache == 22 && _rand.Next(400) == 0)
6159 {
6160 Dust.NewDust(new Vector2(i * 16, j * 16), 16, 16, 14);
6161 }
6162 else if ((typeCache == 23 || typeCache == 24 || typeCache == 32) && _rand.Next(500) == 0)
6163 {
6164 Dust.NewDust(new Vector2(i * 16, j * 16), 16, 16, 14);
6165 }
6166 else if (typeCache == 25 && _rand.Next(700) == 0)
6167 {
6168 Dust.NewDust(new Vector2(i * 16, j * 16), 16, 16, 14);
6169 }
6170 else if (typeCache == 112 && _rand.Next(700) == 0)
6171 {
6172 Dust.NewDust(new Vector2(i * 16, j * 16), 16, 16, 14);
6173 }
6174 else if (typeCache == 31 && _rand.Next(20) == 0)
6175 {
6176 if (tileFrameX >= 36)
6177 {
6178 int num29 = Dust.NewDust(new Vector2(i * 16, j * 16), 16, 16, 5, 0f, 0f, 100);
6179 _dust[num29].velocity.Y = 0f;
6180 _dust[num29].velocity.X *= 0.3f;
6181 }
6182 else
6183 {
6184 Dust.NewDust(new Vector2(i * 16, j * 16), 16, 16, 14, 0f, 0f, 100);
6185 }
6186 }
6187 else if (typeCache == 26 && _rand.Next(20) == 0)
6188 {
6189 if (tileFrameX >= 54)
6190 {
6191 int num30 = Dust.NewDust(new Vector2(i * 16, j * 16), 16, 16, 5, 0f, 0f, 100);
6192 _dust[num30].scale = 1.5f;
6193 _dust[num30].noGravity = true;
6194 _dust[num30].velocity *= 0.75f;
6195 }
6196 else
6197 {
6198 Dust.NewDust(new Vector2(i * 16, j * 16), 16, 16, 14, 0f, 0f, 100);
6199 }
6200 }
6201 else if ((typeCache == 71 || typeCache == 72) && tileCache.color() == 0 && _rand.Next(500) == 0)
6202 {
6203 Dust.NewDust(new Vector2(i * 16, j * 16), 16, 16, 41, 0f, 0f, 250, default(Color), 0.8f);
6204 }
6205 else if ((typeCache == 17 || typeCache == 77 || typeCache == 133) && _rand.Next(40) == 0)
6206 {
6207 if (tileFrameX == 18 && tileFrameY == 18)
6208 {
6209 int num31 = Dust.NewDust(new Vector2(i * 16 - 4, j * 16 - 6), 8, 6, 6, 0f, 0f, 100);
6210 if (_rand.Next(3) != 0)
6211 {
6212 _dust[num31].noGravity = true;
6213 }
6214 }
6215 }
6216 else if (typeCache == 405 && _rand.Next(20) == 0)
6217 {
6218 if (tileFrameX == 18 && tileFrameY == 18)
6219 {
6220 int num32 = Dust.NewDust(new Vector2(i * 16 - 4, j * 16 - 6), 24, 10, 6, 0f, 0f, 100);
6221 if (_rand.Next(5) != 0)
6222 {
6223 _dust[num32].noGravity = true;
6224 }
6225 }
6226 }
6227 else if (typeCache == 37 && _rand.Next(250) == 0)
6228 {
6229 int num33 = Dust.NewDust(new Vector2(i * 16, j * 16), 16, 16, 6, 0f, 0f, 0, default(Color), _rand.Next(3));
6230 if (_dust[num33].scale > 1f)
6231 {
6232 _dust[num33].noGravity = true;
6233 }
6234 }
6235 else if ((typeCache == 58 || typeCache == 76 || typeCache == 684) && _rand.Next(250) == 0)
6236 {
6237 int num34 = Dust.NewDust(new Vector2(i * 16, j * 16), 16, 16, 6, 0f, 0f, 0, default(Color), _rand.Next(3));
6238 if (_dust[num34].scale > 1f)
6239 {
6240 _dust[num34].noGravity = true;
6241 }
6242 _dust[num34].noLight = true;
6243 }
6244 else if (typeCache == 61)
6245 {
6246 if (tileFrameX == 144 && _rand.Next(60) == 0)
6247 {
6248 int num35 = Dust.NewDust(new Vector2(i * 16, j * 16), 16, 16, 44, 0f, 0f, 250, default(Color), 0.4f);
6249 _dust[num35].fadeIn = 0.7f;
6250 }
6251 }
6252 else if (Main.tileShine[typeCache] > 0)
6253 {
6254 if (tileLight.R <= 20 && tileLight.B <= 20 && tileLight.G <= 20)
6255 {
6256 return;
6257 }
6258 int num36 = tileLight.R;
6259 if (tileLight.G > num36)
6260 {
6261 num36 = tileLight.G;
6262 }
6263 if (tileLight.B > num36)
6264 {
6265 num36 = tileLight.B;
6266 }
6267 num36 /= 30;
6268 if (_rand.Next(Main.tileShine[typeCache]) >= num36 || ((typeCache == 21 || typeCache == 441) && (tileFrameX < 36 || tileFrameX >= 180) && (tileFrameX < 396 || tileFrameX > 409)) || ((typeCache == 467 || typeCache == 468) && (tileFrameX < 144 || tileFrameX >= 180)))
6269 {
6270 return;
6271 }
6273 switch (typeCache)
6274 {
6275 case 178:
6276 {
6277 switch (tileFrameX / 18)
6278 {
6279 case 0:
6280 newColor = new Color(255, 0, 255, 255);
6281 break;
6282 case 1:
6283 newColor = new Color(255, 255, 0, 255);
6284 break;
6285 case 2:
6286 newColor = new Color(0, 0, 255, 255);
6287 break;
6288 case 3:
6289 newColor = new Color(0, 255, 0, 255);
6290 break;
6291 case 4:
6292 newColor = new Color(255, 0, 0, 255);
6293 break;
6294 case 5:
6295 newColor = new Color(255, 255, 255, 255);
6296 break;
6297 case 6:
6298 newColor = new Color(255, 255, 0, 255);
6299 break;
6300 }
6301 int num37 = Dust.NewDust(new Vector2(i * 16, j * 16), 16, 16, 43, 0f, 0f, 254, newColor, 0.5f);
6302 _dust[num37].velocity *= 0f;
6303 return;
6304 }
6305 case 63:
6306 newColor = new Color(0, 0, 255, 255);
6307 break;
6308 }
6309 if (typeCache == 64)
6310 {
6311 newColor = new Color(255, 0, 0, 255);
6312 }
6313 if (typeCache == 65)
6314 {
6315 newColor = new Color(0, 255, 0, 255);
6316 }
6317 if (typeCache == 66)
6318 {
6319 newColor = new Color(255, 255, 0, 255);
6320 }
6321 if (typeCache == 67)
6322 {
6323 newColor = new Color(255, 0, 255, 255);
6324 }
6325 if (typeCache == 68)
6326 {
6327 newColor = new Color(255, 255, 255, 255);
6328 }
6329 if (typeCache == 12 || typeCache == 665)
6330 {
6331 newColor = new Color(255, 0, 0, 255);
6332 }
6333 if (typeCache == 639)
6334 {
6335 newColor = new Color(0, 0, 255, 255);
6336 }
6337 if (typeCache == 204)
6338 {
6339 newColor = new Color(255, 0, 0, 255);
6340 }
6341 if (typeCache == 211)
6342 {
6343 newColor = new Color(50, 255, 100, 255);
6344 }
6345 int num38 = Dust.NewDust(new Vector2(i * 16, j * 16), 16, 16, 43, 0f, 0f, 254, newColor, 0.5f);
6346 _dust[num38].velocity *= 0f;
6347 }
6348 else if (Main.tileSolid[tileCache.type] && Main.shimmerAlpha > 0f && (tileLight.R > 20 || tileLight.B > 20 || tileLight.G > 20))
6349 {
6350 int num39 = tileLight.R;
6351 if (tileLight.G > num39)
6352 {
6353 num39 = tileLight.G;
6354 }
6355 if (tileLight.B > num39)
6356 {
6357 num39 = tileLight.B;
6358 }
6359 int maxValue = 500;
6360 if ((float)_rand.Next(maxValue) < 2f * Main.shimmerAlpha)
6361 {
6363 float scale2 = ((float)num39 / 255f + 1f) / 2f;
6364 int num40 = Dust.NewDust(new Vector2(i * 16, j * 16), 16, 16, 43, 0f, 0f, 254, white, scale2);
6365 _dust[num40].velocity *= 0f;
6366 }
6367 }
6368 }
static float Clamp(float value, float min, float max)
Definition MathHelper.cs:46
Vector2 position
Definition Dust.cs:20
bool noGravity
Definition Dust.cs:26
int alpha
Definition Dust.cs:42
bool noLight
Definition Dust.cs:32
float scale
Definition Dust.cs:28
Color color
Definition Dust.cs:40
float fadeIn
Definition Dust.cs:24
Vector2 velocity
Definition Dust.cs:22
void EmitLivingTreeLeaf(int i, int j, int leafGoreType)
void EmitAlchemyHerbParticles(int j, int i, int style)
Vector2 velocity
Definition Gore.cs:19
float scale
Definition Gore.cs:23
static readonly short Count
Definition TorchID.cs:132
static int[] Dust
Definition TorchID.cs:75

References Terraria.GameContent.Drawing.TileDrawing._dust, Terraria.GameContent.Drawing.TileDrawing._gore, Terraria.GameContent.Drawing.TileDrawing._leafFrequency, Terraria.GameContent.Drawing.TileDrawing._rand, Terraria.WorldGen.ActiveAndWalkableTile(), Terraria.Dust.alpha, Microsoft.Xna.Framework.Color.B, Microsoft.Xna.Framework.MathHelper.Clamp(), Microsoft.Xna.Framework.Graphics.Color, Terraria.Dust.color, Terraria.Tile.color(), Terraria.ID.TorchID.Count, Terraria.Main.DiscoB, Terraria.Main.DiscoG, Terraria.Main.DiscoR, Terraria.Main.drawToScreen, Terraria.ID.TorchID.Dust, Terraria.GameContent.Drawing.TileDrawing.EmitAlchemyHerbParticles(), Terraria.GameContent.Drawing.TileDrawing.EmitLivingTreeLeaf(), Terraria.Dust.fadeIn, Terraria.Tile.frameX, Terraria.Tile.frameY, Microsoft.Xna.Framework.Color.G, Terraria.GameContent.Drawing.TileDrawing.IsAlchemyPlantHarvestable(), Terraria.GameContent.Drawing.TileDrawing.IsVisible(), Terraria.Dust.NewDust(), Terraria.Dust.NewDustDirect(), Terraria.Gore.NewGore(), Terraria.Gore.NewGorePerfect(), Terraria.Utilities.UnifiedRandom.Next(), Terraria.Dust.noGravity, Terraria.Dust.noLight, Microsoft.Xna.Framework.Graphics.Point, Terraria.Dust.position, Microsoft.Xna.Framework.Color.R, Terraria.Main.rand, Terraria.GameContent.Drawing.ParticleOrchestrator.RequestParticleSpawn(), Terraria.Dust.scale, Terraria.Gore.scale, Terraria.Main.shimmerAlpha, Terraria.Main.tileFrame, Terraria.Main.tileShine, Terraria.Main.tileSolid, System.type, Terraria.Tile.type, Microsoft.Xna.Framework.Graphics.Vector2, Terraria.Dust.velocity, Terraria.Gore.velocity, Microsoft.Xna.Framework.Color.White, Terraria.Main.WindForVisuals, Microsoft.Xna.Framework.Vector2.X, Microsoft.Xna.Framework.Vector2.Y, and Microsoft.Xna.Framework.Vector2.Zero.

Referenced by Terraria.GameContent.Drawing.TileDrawing.DrawAnyDirectionalGrass(), Terraria.GameContent.Drawing.TileDrawing.DrawGrass(), Terraria.GameContent.Drawing.TileDrawing.DrawMultiTileGrassInWind(), Terraria.GameContent.Drawing.TileDrawing.DrawMultiTileVinesInWind(), and Terraria.GameContent.Drawing.TileDrawing.DrawSingleTile().