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

◆ DrawWhip_ThornWhip()

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

Definition at line 33501 of file Main.cs.

33502 {
33505 int height = rectangle.Height;
33506 rectangle.Height -= 2;
33507 Vector2 vector = rectangle.Size() / 2f;
33509 for (int i = 0; i < controlPoints.Count - 1; i++)
33510 {
33511 bool flag = true;
33512 Vector2 origin = vector;
33513 float scale = 1f;
33514 switch (i)
33515 {
33516 case 0:
33517 origin.Y -= 4f;
33518 break;
33519 case 19:
33520 rectangle.Y = height * 4;
33521 scale = 1.1f;
33522 break;
33523 default:
33524 rectangle.Y = height * (1 + i % 3);
33525 scale = 0.8f;
33526 break;
33527 }
33530 if (flag)
33531 {
33532 float rotation = vector4.ToRotation() - (float)Math.PI / 2f;
33533 Microsoft.Xna.Framework.Color color = Lighting.GetColor(vector3.ToTileCoordinates());
33534 spriteBatch.Draw(value, vector2 - screenPosition, rectangle, color, rotation, origin, scale, SpriteEffects.None, 0f);
33535 }
33536 vector2 += vector4;
33537 }
33538 return vector2;
33539 }
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 Terraria.Lighting.GetColor(), System.Text.RegularExpressions.i, System.Math.PI, Terraria.GameContent.TextureAssets.Projectile, Terraria.Main.screenPosition, Terraria.Main.spriteBatch, and System.value.

Referenced by Terraria.Main.DrawWhip().