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

◆ CheckSpot()

void Terraria.GameContent.SpelunkerProjectileHelper.CheckSpot ( Vector2 Center)
inlineprivate

Definition at line 35 of file SpelunkerProjectileHelper.cs.

36 {
37 int num = (int)Center.X / 16;
38 int num2 = (int)Center.Y / 16;
39 int num3 = Utils.Clamp(num - 30, _clampBox.Left, _clampBox.Right);
40 int num4 = Utils.Clamp(num + 30, _clampBox.Left, _clampBox.Right);
41 int num5 = Utils.Clamp(num2 - 30, _clampBox.Top, _clampBox.Bottom);
42 int num6 = Utils.Clamp(num2 + 30, _clampBox.Top, _clampBox.Bottom);
43 Point item = default(Point);
44 Vector2 position = default(Vector2);
45 for (int i = num3; i <= num4; i++)
46 {
47 for (int j = num5; j <= num6; j++)
48 {
49 Tile tile = Main.tile[i, j];
50 if (tile != null && tile.active() && Main.IsTileSpelunkable(tile) && !(new Vector2(num - i, num2 - j).Length() > 30f))
51 {
52 item.X = i;
53 item.Y = j;
54 if (_tilesChecked.Add(item) && Main.rand.Next(4) == 0)
55 {
56 position.X = i * 16;
57 position.Y = j * 16;
58 Dust dust = Dust.NewDustDirect(position, 16, 16, 204, 0f, 0f, 150, default(Color), 0.3f);
59 dust.fadeIn = 0.75f;
60 dust.velocity *= 0.1f;
61 dust.noLight = true;
62 }
63 }
64 }
65 }
66 }
void ICollection< T >. Add(T item)
Definition HashSet.cs:225

References Terraria.GameContent.SpelunkerProjectileHelper._clampBox, Terraria.GameContent.SpelunkerProjectileHelper._tilesChecked, Terraria.Tile.active(), System.Collections.Generic.HashSet< T >.Add(), Microsoft.Xna.Framework.Rectangle.Bottom, Terraria.Main.IsTileSpelunkable(), Microsoft.Xna.Framework.Rectangle.Left, Terraria.Dust.NewDustDirect(), Terraria.Main.rand, Microsoft.Xna.Framework.Rectangle.Right, Terraria.Main.tile, Microsoft.Xna.Framework.Rectangle.Top, Microsoft.Xna.Framework.Vector2.X, and Microsoft.Xna.Framework.Vector2.Y.

Referenced by Terraria.GameContent.SpelunkerProjectileHelper.AddSpotToCheck().