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

◆ DrawVineStrip()

void Terraria.GameContent.Drawing.TileDrawing.DrawVineStrip ( Vector2 screenPosition,
Vector2 offSet,
int x,
int startY )
inlineprivate

Definition at line 10687 of file TileDrawing.cs.

10688 {
10689 //IL_0163: Unknown result type (might be due to invalid IL or missing references)
10690 //IL_0168: Unknown result type (might be due to invalid IL or missing references)
10691 //IL_018f: Unknown result type (might be due to invalid IL or missing references)
10692 //IL_0198: Unknown result type (might be due to invalid IL or missing references)
10693 //IL_01a1: Unknown result type (might be due to invalid IL or missing references)
10694 //IL_01a6: Unknown result type (might be due to invalid IL or missing references)
10695 //IL_01a7: Unknown result type (might be due to invalid IL or missing references)
10696 //IL_01ac: Unknown result type (might be due to invalid IL or missing references)
10697 //IL_01ad: Unknown result type (might be due to invalid IL or missing references)
10698 //IL_01b2: Unknown result type (might be due to invalid IL or missing references)
10699 //IL_01bd: Unknown result type (might be due to invalid IL or missing references)
10700 //IL_01c2: Unknown result type (might be due to invalid IL or missing references)
10701 //IL_01e1: Unknown result type (might be due to invalid IL or missing references)
10702 //IL_01e6: Unknown result type (might be due to invalid IL or missing references)
10703 //IL_03a2: Unknown result type (might be due to invalid IL or missing references)
10704 //IL_03ab: Unknown result type (might be due to invalid IL or missing references)
10705 //IL_03b5: Unknown result type (might be due to invalid IL or missing references)
10706 //IL_03ba: Unknown result type (might be due to invalid IL or missing references)
10707 //IL_03bf: Unknown result type (might be due to invalid IL or missing references)
10708 //IL_0327: Unknown result type (might be due to invalid IL or missing references)
10709 //IL_033a: Unknown result type (might be due to invalid IL or missing references)
10710 //IL_0344: Unknown result type (might be due to invalid IL or missing references)
10711 //IL_0353: Unknown result type (might be due to invalid IL or missing references)
10712 //IL_035d: Unknown result type (might be due to invalid IL or missing references)
10713 //IL_0374: Unknown result type (might be due to invalid IL or missing references)
10714 //IL_0376: Unknown result type (might be due to invalid IL or missing references)
10715 //IL_037d: Unknown result type (might be due to invalid IL or missing references)
10716 //IL_038c: Unknown result type (might be due to invalid IL or missing references)
10717 //IL_0396: Unknown result type (might be due to invalid IL or missing references)
10718 //IL_0277: Unknown result type (might be due to invalid IL or missing references)
10719 //IL_0279: Unknown result type (might be due to invalid IL or missing references)
10720 //IL_0286: Unknown result type (might be due to invalid IL or missing references)
10721 //IL_02a3: Unknown result type (might be due to invalid IL or missing references)
10722 //IL_02dd: Unknown result type (might be due to invalid IL or missing references)
10723 //IL_02e7: Unknown result type (might be due to invalid IL or missing references)
10724 //IL_02ec: Unknown result type (might be due to invalid IL or missing references)
10725 int num = 0;
10726 int num2 = 0;
10727 Vector2 vector = default(Vector2);
10728 ((Vector2)(ref vector))._002Ector((float)(x * 16 + 8), (float)(startY * 16 - 2));
10729 float amount = Math.Abs(Main.WindForVisuals) / 1.2f;
10730 amount = MathHelper.Lerp(0.2f, 1f, amount);
10731 float num3 = -0.08f * amount;
10733 float num4 = 0f;
10734 float num5 = 0f;
10735 for (int i = startY; i < Main.maxTilesY - 10; i++)
10736 {
10737 Tile tile = Main.tile[x, i];
10738 if (tile == null)
10739 {
10740 continue;
10741 }
10742 ushort type = tile.type;
10743 if (!tile.active() || !TileID.Sets.VineThreads[type])
10744 {
10745 break;
10746 }
10747 num++;
10748 if (num2 >= 5)
10749 {
10750 num3 += 0.0075f * amount;
10751 }
10752 if (num2 >= 2)
10753 {
10754 num3 += 0.0025f;
10755 }
10756 if (Main.remixWorld)
10757 {
10758 if (WallID.Sets.AllowsWind[tile.wall] && (double)i > Main.worldSurface)
10759 {
10760 num2++;
10761 }
10762 }
10763 else if (WallID.Sets.AllowsWind[tile.wall] && (double)i < Main.worldSurface)
10764 {
10765 num2++;
10766 }
10767 float windGridPush = GetWindGridPush(x, i, 20, 0.01f);
10768 num4 = ((windGridPush != 0f || num5 == 0f) ? (num4 - windGridPush) : (num4 * -0.78f));
10770 short tileFrameX = tile.frameX;
10771 short tileFrameY = tile.frameY;
10772 Color color = Lighting.GetColor(x, i);
10773 GetTileDrawData(x, i, tile, type, ref tileFrameX, ref tileFrameY, out var tileWidth, out var tileHeight, out var tileTop, out var halfBrickHeight, out var addFrX, out var addFrY, out var tileSpriteEffect, out var glowTexture, out var glowSourceRect, out var glowColor);
10774 Vector2 position = new Vector2((float)(-(int)screenPosition.X), (float)(-(int)screenPosition.Y)) + offSet + vector;
10775 if (tile.fullbrightBlock())
10776 {
10777 color = Color.White;
10778 }
10779 float num6 = (float)num2 * num3 * windCycle + num4;
10781 {
10782 Color sightColor = Color.White;
10783 if (Main.IsTileBiomeSightable(x, i, type, tileFrameX, tileFrameY, ref sightColor))
10784 {
10785 if (((Color)(ref color)).R < ((Color)(ref sightColor)).R)
10786 {
10787 ((Color)(ref color)).R = ((Color)(ref sightColor)).R;
10788 }
10789 if (((Color)(ref color)).G < ((Color)(ref sightColor)).G)
10790 {
10791 ((Color)(ref color)).G = ((Color)(ref sightColor)).G;
10792 }
10793 if (((Color)(ref color)).B < ((Color)(ref sightColor)).B)
10794 {
10795 ((Color)(ref color)).B = ((Color)(ref sightColor)).B;
10796 }
10797 if (_isActiveAndNotPaused && _rand.Next(480) == 0)
10798 {
10799 Color newColor = sightColor;
10800 int num7 = Dust.NewDust(new Vector2((float)(x * 16), (float)(i * 16)), 16, 16, 267, 0f, 0f, 150, newColor, 0.3f);
10801 _dust[num7].noGravity = true;
10802 _dust[num7].fadeIn = 1f;
10803 Dust obj = _dust[num7];
10804 obj.velocity *= 0.1f;
10805 _dust[num7].noLightEmittence = true;
10806 }
10807 }
10808 }
10809 Texture2D tileDrawTexture = GetTileDrawTexture(tile, x, i);
10810 if (tileDrawTexture == null)
10811 {
10812 break;
10813 }
10814 if (IsVisible(tile))
10815 {
10816 Main.spriteBatch.Draw(tileDrawTexture, position, (Rectangle?)new Rectangle(tileFrameX + addFrX, tileFrameY + addFrY, tileWidth, tileHeight - halfBrickHeight), color, num6, new Vector2((float)(tileWidth / 2), (float)(halfBrickHeight - tileTop)), 1f, tileSpriteEffect, 0f);
10817 if (glowTexture != null)
10818 {
10819 Main.spriteBatch.Draw(glowTexture, position, (Rectangle?)glowSourceRect, glowColor, num6, new Vector2((float)(tileWidth / 2), (float)(halfBrickHeight - tileTop)), 1f, tileSpriteEffect, 0f);
10820 }
10821 }
10822 vector += (num6 + (float)Math.PI / 2f).ToRotationVector2() * 16f;
10823 }
10824 }
bool noGravity
Indicates if a dust should be affected by gravity or not. Not all vanilla dust have logic checking th...
Definition Dust.cs:45
bool noLightEmittence
Definition Dust.cs:62
float fadeIn
Used by some dust AI to control logic pertaining to the dust fading in. The specific behavior depends...
Definition Dust.cs:40
float GetWindGridPush(int i, int j, int pushAnimationTimeTotal, float pushForcePerFrame)
Determines how much wind should affect a theoretical tile at the target location on the current updat...
static bool IsVisible(Tile tile)
Returns true if the tile is visible.
Texture2D GetTileDrawTexture(Tile tile, int tileX, int tileY)
void GetTileDrawData(int x, int y, Tile tileCache, ushort typeCache, ref short tileFrameX, ref short tileFrameY, out int tileWidth, out int tileHeight, out int tileTop, out int halfBrickHeight, out int addFrX, out int addFrY, out SpriteEffects tileSpriteEffect, out Texture2D glowTexture, out Rectangle glowSourceRect, out Color glowColor)
float GetWindCycle(int x, int y, double windCounter)
Fetches the degree to which wind would/should affect a tile at the given location.
static bool[] VineThreads
Definition TileID.cs:240
static bool[] AllowsWind
Definition WallID.cs:51

References Terraria.GameContent.Drawing.TileDrawing._dust, Terraria.GameContent.Drawing.TileDrawing._isActiveAndNotPaused, Terraria.GameContent.Drawing.TileDrawing._localPlayer, Terraria.GameContent.Drawing.TileDrawing._rand, Terraria.GameContent.Drawing.TileDrawing._vineWindCounter, Terraria.Tile.active(), Terraria.ID.WallID.Sets.AllowsWind, Terraria.Player.biomeSight, Terraria.Dust.fadeIn, Terraria.Tile.frameX, Terraria.Tile.frameY, Terraria.Tile.fullbrightBlock(), Terraria.Lighting.GetColor(), Terraria.GameContent.Drawing.TileDrawing.GetTileDrawData(), Terraria.GameContent.Drawing.TileDrawing.GetTileDrawTexture(), Terraria.GameContent.Drawing.TileDrawing.GetWindCycle(), Terraria.GameContent.Drawing.TileDrawing.GetWindGridPush(), Terraria.Main.IsTileBiomeSightable(), Terraria.GameContent.Drawing.TileDrawing.IsVisible(), Terraria.Dust.NewDust(), Terraria.Utilities.UnifiedRandom.Next(), Terraria.Dust.noGravity, Terraria.Dust.noLightEmittence, Terraria.Main.remixWorld, Terraria.Main.spriteBatch, Terraria.Main.tile, Terraria.Tile.type, Terraria.ID.TileID.Sets.VineThreads, Terraria.Tile.wall, Terraria.Main.WindForVisuals, and Terraria.Main.worldSurface.

Referenced by Terraria.GameContent.Drawing.TileDrawing.DrawVines().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: