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

◆ DrawWhip_WhipBland()

static Vector2 Terraria.Main.DrawWhip_WhipBland ( Projectile proj,
List< Vector2 > controlPoints )
inlinestatic

Definition at line 33712 of file Main.cs.

33713 {
33715 if (proj.spriteDirection == 1)
33716 {
33717 spriteEffects ^= SpriteEffects.FlipHorizontally;
33718 }
33721 int height = rectangle.Height;
33722 rectangle.Height -= 2;
33723 Vector2 vector = rectangle.Size() / 2f;
33725 for (int i = 0; i < controlPoints.Count - 1; i++)
33726 {
33727 bool flag = false;
33728 Vector2 origin = vector;
33729 float scale = 1f;
33730 if (i == 0)
33731 {
33732 origin.Y -= 4f;
33733 flag = true;
33734 }
33735 else
33736 {
33737 flag = true;
33738 int num = 1;
33739 if (i > 10)
33740 {
33741 num = 2;
33742 }
33743 if (i > 20)
33744 {
33745 num = 3;
33746 }
33747 rectangle.Y = height * num;
33748 }
33749 if (i == controlPoints.Count - 2)
33750 {
33751 flag = true;
33752 rectangle.Y = height * 4;
33753 scale = 1.3f;
33754 Projectile.GetWhipSettings(proj, out var timeToFlyOut, out var _, out var _);
33755 float t = proj.ai[0] / timeToFlyOut;
33756 float amount = Utils.GetLerpValue(0.1f, 0.7f, t, clamped: true) * Utils.GetLerpValue(0.9f, 0.7f, t, clamped: true);
33757 scale = MathHelper.Lerp(0.5f, 1.5f, amount);
33758 }
33761 if (flag)
33762 {
33763 float rotation = vector4.ToRotation() - (float)Math.PI / 2f;
33764 Microsoft.Xna.Framework.Color color = Lighting.GetColor(vector3.ToTileCoordinates());
33765 spriteBatch.Draw(value, vector2 - screenPosition, rectangle, color, rotation, origin, scale, spriteEffects, 0f);
33766 }
33767 vector2 += vector4;
33768 }
33769 return vector2;
33770 }
static float Lerp(float value1, float value2, float amount)
Definition MathHelper.cs:53
const double PI
Definition Math.cs:16
static Asset< Texture2D >[] Projectile
static SpriteBatch spriteBatch
Definition Main.cs:974
static Vector2 screenPosition
Definition Main.cs:1715

References System.Collections.Generic.Dictionary< TKey, TValue >.Count, Terraria.Lighting.GetColor(), Terraria.Utils.GetLerpValue(), Terraria.Projectile.GetWhipSettings(), System.Text.RegularExpressions.i, Microsoft.Xna.Framework.MathHelper.Lerp(), System.Math.PI, Terraria.GameContent.TextureAssets.Projectile, Terraria.Main.screenPosition, Terraria.Main.spriteBatch, and System.value.

Referenced by Terraria.Main.DrawWhip().