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

◆ DrawWhip_WhipScythe()

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

Definition at line 47278 of file Main.cs.

47279 {
47280 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
47281 //IL_0028: Unknown result type (might be due to invalid IL or missing references)
47282 //IL_002d: Unknown result type (might be due to invalid IL or missing references)
47283 //IL_002e: Unknown result type (might be due to invalid IL or missing references)
47284 //IL_0041: Unknown result type (might be due to invalid IL or missing references)
47285 //IL_0042: Unknown result type (might be due to invalid IL or missing references)
47286 //IL_004c: Unknown result type (might be due to invalid IL or missing references)
47287 //IL_0051: Unknown result type (might be due to invalid IL or missing references)
47288 //IL_0055: Unknown result type (might be due to invalid IL or missing references)
47289 //IL_005a: Unknown result type (might be due to invalid IL or missing references)
47290 //IL_000b: Unknown result type (might be due to invalid IL or missing references)
47291 //IL_000d: Unknown result type (might be due to invalid IL or missing references)
47292 //IL_000e: Unknown result type (might be due to invalid IL or missing references)
47293 //IL_0067: Unknown result type (might be due to invalid IL or missing references)
47294 //IL_0069: Unknown result type (might be due to invalid IL or missing references)
47295 //IL_01b0: Unknown result type (might be due to invalid IL or missing references)
47296 //IL_012a: Unknown result type (might be due to invalid IL or missing references)
47297 //IL_012f: Unknown result type (might be due to invalid IL or missing references)
47298 //IL_0136: Unknown result type (might be due to invalid IL or missing references)
47299 //IL_013b: Unknown result type (might be due to invalid IL or missing references)
47300 //IL_013d: Unknown result type (might be due to invalid IL or missing references)
47301 //IL_0142: Unknown result type (might be due to invalid IL or missing references)
47302 //IL_0190: Unknown result type (might be due to invalid IL or missing references)
47303 //IL_0192: Unknown result type (might be due to invalid IL or missing references)
47304 //IL_0194: Unknown result type (might be due to invalid IL or missing references)
47305 //IL_0199: Unknown result type (might be due to invalid IL or missing references)
47306 //IL_0148: Unknown result type (might be due to invalid IL or missing references)
47307 //IL_0157: Unknown result type (might be due to invalid IL or missing references)
47308 //IL_0159: Unknown result type (might be due to invalid IL or missing references)
47309 //IL_015e: Unknown result type (might be due to invalid IL or missing references)
47310 //IL_0163: Unknown result type (might be due to invalid IL or missing references)
47311 //IL_016b: Unknown result type (might be due to invalid IL or missing references)
47312 //IL_016d: Unknown result type (might be due to invalid IL or missing references)
47313 //IL_0172: Unknown result type (might be due to invalid IL or missing references)
47314 //IL_0177: Unknown result type (might be due to invalid IL or missing references)
47315 //IL_017d: Unknown result type (might be due to invalid IL or missing references)
47316 //IL_0181: Unknown result type (might be due to invalid IL or missing references)
47317 //IL_0185: Unknown result type (might be due to invalid IL or missing references)
47318 SpriteEffects spriteEffects = (SpriteEffects)0;
47319 if (proj.spriteDirection == 1)
47320 {
47321 spriteEffects = (SpriteEffects)(spriteEffects ^ 1);
47322 }
47323 Texture2D value = TextureAssets.Projectile[proj.type].Value;
47324 Rectangle rectangle = value.Frame(1, 5);
47325 int height = rectangle.Height;
47326 rectangle.Height -= 2;
47327 Vector2 vector = rectangle.Size() / 2f;
47328 Vector2 vector2 = controlPoints[0];
47329 for (int i = 0; i < controlPoints.Count - 1; i++)
47330 {
47331 bool flag = false;
47332 Vector2 origin = vector;
47333 float scale = 1f;
47334 if (i == 0)
47335 {
47336 origin.Y -= 4f;
47337 flag = true;
47338 }
47339 else if (i % 2 == 0)
47340 {
47341 flag = true;
47342 int num = 1;
47343 if (i > 10)
47344 {
47345 num = 2;
47346 }
47347 if (i > 20)
47348 {
47349 num = 3;
47350 }
47351 rectangle.Y = height * num;
47352 }
47353 if (i == controlPoints.Count - 2)
47354 {
47355 flag = true;
47356 rectangle.Y = height * 4;
47357 scale = 1.3f;
47358 Projectile.GetWhipSettings(proj, out var timeToFlyOut, out var _, out var _);
47359 float t = proj.ai[0] / timeToFlyOut;
47360 float amount = Utils.GetLerpValue(0.1f, 0.7f, t, clamped: true) * Utils.GetLerpValue(0.9f, 0.7f, t, clamped: true);
47361 scale = MathHelper.Lerp(0.5f, 1.5f, amount);
47362 }
47363 Vector2 vector3 = controlPoints[i];
47364 Vector2 vector4 = controlPoints[i + 1] - vector3;
47365 if (flag)
47366 {
47367 float rotation = vector4.ToRotation() - (float)Math.PI / 2f;
47368 Color color = Lighting.GetColor(vector3.ToTileCoordinates());
47369 spriteBatch.Draw(value, vector2 - screenPosition, (Rectangle?)rectangle, color, rotation, origin, scale, spriteEffects, 0f);
47370 }
47371 vector2 += vector4;
47372 }
47373 return vector2;
47374 }
static Asset< Texture2D >[] Projectile
static SpriteBatch spriteBatch
Definition Main.cs:1043
static Vector2 screenPosition
The position of the top left corner of the screen in world coordinates. Modify in M:Terraria....
Definition Main.cs:1864

References Terraria.Lighting.GetColor(), Terraria.Utils.GetLerpValue(), Terraria.Projectile.GetWhipSettings(), Terraria.GameContent.TextureAssets.Projectile, Terraria.Main.screenPosition, and Terraria.Main.spriteBatch.

Referenced by Terraria.Main.DrawWhip().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: