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

◆ DrawWhip_FireWhip()

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

Definition at line 33397 of file Main.cs.

33398 {
33401 int height = rectangle.Height;
33402 rectangle.Height -= 2;
33403 Vector2 vector = rectangle.Size() / 2f;
33405 for (int i = 0; i < controlPoints.Count - 1; i++)
33406 {
33407 bool flag = true;
33408 Vector2 origin = vector;
33409 switch (i)
33410 {
33411 case 0:
33412 origin.Y -= 4f;
33413 break;
33414 case 3:
33415 case 5:
33416 case 7:
33417 rectangle.Y = height;
33418 break;
33419 case 9:
33420 case 11:
33421 case 13:
33422 rectangle.Y = height * 2;
33423 break;
33424 case 15:
33425 case 17:
33426 rectangle.Y = height * 3;
33427 break;
33428 case 19:
33429 rectangle.Y = height * 4;
33430 break;
33431 default:
33432 flag = false;
33433 break;
33434 }
33437 if (flag)
33438 {
33439 float rotation = vector4.ToRotation() - (float)Math.PI / 2f;
33440 Microsoft.Xna.Framework.Color alpha = proj.GetAlpha(Lighting.GetColor(vector3.ToTileCoordinates()));
33441 spriteBatch.Draw(value, vector2 - screenPosition, rectangle, alpha, rotation, origin, 1f, SpriteEffects.None, 0f);
33442 }
33443 vector2 += vector4;
33444 }
33445 return vector2;
33446 }
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().