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

◆ DrawWhip_BoneWhip()

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

Definition at line 33309 of file Main.cs.

33310 {
33313 int height = rectangle.Height;
33314 rectangle.Height -= 2;
33315 Vector2 vector = rectangle.Size() / 2f;
33317 for (int i = 0; i < controlPoints.Count - 1; i++)
33318 {
33319 bool flag = true;
33320 Vector2 origin = vector;
33321 switch (i)
33322 {
33323 case 0:
33324 origin.Y -= 4f;
33325 break;
33326 case 19:
33327 rectangle.Y = height * 4;
33328 break;
33329 default:
33330 rectangle.Y = height * (1 + i % 3);
33331 break;
33332 }
33335 if (flag)
33336 {
33337 float rotation = vector4.ToRotation() - (float)Math.PI / 2f;
33338 Microsoft.Xna.Framework.Color color = Lighting.GetColor(vector3.ToTileCoordinates());
33339 spriteBatch.Draw(value, vector2 - screenPosition, rectangle, color, rotation, origin, 1f, SpriteEffects.None, 0f);
33340 }
33341 vector2 += vector4;
33342 }
33343 return vector2;
33344 }
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().