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

◆ DrawWhip_CoolWhip()

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

Definition at line 33346 of file Main.cs.

33347 {
33350 int height = rectangle.Height;
33351 rectangle.Height -= 2;
33352 Vector2 vector = rectangle.Size() / 2f;
33354 for (int i = 0; i < controlPoints.Count - 1; i++)
33355 {
33356 bool flag = true;
33357 Vector2 origin = vector;
33358 switch (i)
33359 {
33360 case 0:
33361 origin.Y -= 4f;
33362 break;
33363 case 3:
33364 case 5:
33365 case 7:
33366 rectangle.Y = height;
33367 break;
33368 case 9:
33369 case 11:
33370 case 13:
33371 rectangle.Y = height * 2;
33372 break;
33373 case 15:
33374 case 17:
33375 rectangle.Y = height * 3;
33376 break;
33377 case 19:
33378 rectangle.Y = height * 4;
33379 break;
33380 default:
33381 flag = false;
33382 break;
33383 }
33386 if (flag)
33387 {
33388 float rotation = vector4.ToRotation() - (float)Math.PI / 2f;
33389 Microsoft.Xna.Framework.Color alpha = proj.GetAlpha(Lighting.GetColor(vector3.ToTileCoordinates()));
33390 spriteBatch.Draw(value, vector2 - screenPosition, rectangle, alpha, rotation, origin, 1f, SpriteEffects.None, 0f);
33391 }
33392 vector2 += vector4;
33393 }
33394 return vector2;
33395 }
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().