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

◆ DrawWhip_WhipSword()

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

Definition at line 33541 of file Main.cs.

33542 {
33545 int height = rectangle.Height;
33546 rectangle.Height -= 2;
33547 Vector2 vector = rectangle.Size() / 2f;
33549 for (int i = 0; i < controlPoints.Count - 1; i++)
33550 {
33551 bool flag = true;
33552 Vector2 origin = vector;
33553 switch (i)
33554 {
33555 case 0:
33556 origin.Y -= 4f;
33557 break;
33558 case 3:
33559 case 5:
33560 case 7:
33561 rectangle.Y = height;
33562 break;
33563 case 9:
33564 case 11:
33565 case 13:
33566 rectangle.Y = height * 2;
33567 break;
33568 case 15:
33569 case 17:
33570 rectangle.Y = height * 3;
33571 break;
33572 case 19:
33573 rectangle.Y = height * 4;
33574 break;
33575 default:
33576 flag = false;
33577 break;
33578 }
33581 if (flag)
33582 {
33583 float rotation = vector4.ToRotation() - (float)Math.PI / 2f;
33584 Microsoft.Xna.Framework.Color color = Lighting.GetColor(vector3.ToTileCoordinates());
33585 spriteBatch.Draw(value, vector2 - screenPosition, rectangle, color, rotation, origin, 1f, SpriteEffects.None, 0f);
33586 }
33587 vector2 += vector4;
33588 }
33589 return vector2;
33590 }
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().