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

◆ FillWhipControlPoints()

static void Terraria.Projectile.FillWhipControlPoints ( Projectile proj,
List< Vector2 > controlPoints )
inlinestatic

Definition at line 51265 of file Projectile.cs.

51266 {
51267 //IL_00f2: Unknown result type (might be due to invalid IL or missing references)
51268 //IL_00f7: Unknown result type (might be due to invalid IL or missing references)
51269 //IL_00f9: Unknown result type (might be due to invalid IL or missing references)
51270 //IL_00fb: Unknown result type (might be due to invalid IL or missing references)
51271 //IL_0104: Unknown result type (might be due to invalid IL or missing references)
51272 //IL_0106: Unknown result type (might be due to invalid IL or missing references)
51273 //IL_011d: Unknown result type (might be due to invalid IL or missing references)
51274 //IL_011f: Unknown result type (might be due to invalid IL or missing references)
51275 //IL_0129: Unknown result type (might be due to invalid IL or missing references)
51276 //IL_014a: Unknown result type (might be due to invalid IL or missing references)
51277 //IL_014e: Unknown result type (might be due to invalid IL or missing references)
51278 //IL_0155: Unknown result type (might be due to invalid IL or missing references)
51279 //IL_015a: Unknown result type (might be due to invalid IL or missing references)
51280 //IL_015f: Unknown result type (might be due to invalid IL or missing references)
51281 //IL_0161: Unknown result type (might be due to invalid IL or missing references)
51282 //IL_0165: Unknown result type (might be due to invalid IL or missing references)
51283 //IL_0172: Unknown result type (might be due to invalid IL or missing references)
51284 //IL_0177: Unknown result type (might be due to invalid IL or missing references)
51285 //IL_017c: Unknown result type (might be due to invalid IL or missing references)
51286 //IL_017e: Unknown result type (might be due to invalid IL or missing references)
51287 //IL_0182: Unknown result type (might be due to invalid IL or missing references)
51288 //IL_018f: Unknown result type (might be due to invalid IL or missing references)
51289 //IL_0194: Unknown result type (might be due to invalid IL or missing references)
51290 //IL_01b0: Unknown result type (might be due to invalid IL or missing references)
51291 //IL_01b2: Unknown result type (might be due to invalid IL or missing references)
51292 //IL_01c2: Unknown result type (might be due to invalid IL or missing references)
51293 //IL_01c7: Unknown result type (might be due to invalid IL or missing references)
51294 //IL_01c9: Unknown result type (might be due to invalid IL or missing references)
51295 //IL_01ca: Unknown result type (might be due to invalid IL or missing references)
51296 //IL_01da: Unknown result type (might be due to invalid IL or missing references)
51297 //IL_01df: Unknown result type (might be due to invalid IL or missing references)
51298 //IL_01e1: Unknown result type (might be due to invalid IL or missing references)
51299 //IL_01e3: Unknown result type (might be due to invalid IL or missing references)
51300 //IL_01e5: Unknown result type (might be due to invalid IL or missing references)
51301 //IL_01e7: Unknown result type (might be due to invalid IL or missing references)
51302 //IL_01f3: Unknown result type (might be due to invalid IL or missing references)
51303 //IL_01f8: Unknown result type (might be due to invalid IL or missing references)
51304 //IL_01fd: Unknown result type (might be due to invalid IL or missing references)
51305 //IL_0225: Unknown result type (might be due to invalid IL or missing references)
51306 //IL_0227: Unknown result type (might be due to invalid IL or missing references)
51307 //IL_022c: Unknown result type (might be due to invalid IL or missing references)
51308 //IL_022f: Unknown result type (might be due to invalid IL or missing references)
51309 //IL_024b: Unknown result type (might be due to invalid IL or missing references)
51310 //IL_024d: Unknown result type (might be due to invalid IL or missing references)
51311 //IL_024f: Unknown result type (might be due to invalid IL or missing references)
51312 //IL_0251: Unknown result type (might be due to invalid IL or missing references)
51313 //IL_0253: Unknown result type (might be due to invalid IL or missing references)
51315 float num = proj.ai[0] / timeToFlyOut;
51316 float num10 = 0.5f;
51317 float num11 = 1f + num10;
51318 float num12 = (float)Math.PI * 10f * (1f - num * num11) * (float)(-proj.spriteDirection) / (float)segments;
51319 float num13 = num * num11;
51320 float num14 = 0f;
51321 if (num13 > 1f)
51322 {
51323 num14 = (num13 - 1f) / num10;
51324 num13 = MathHelper.Lerp(1f, 0f, num14);
51325 }
51326 float num15 = proj.ai[0] - 1f;
51327 Player player = Main.player[proj.owner];
51328 Item heldItem = Main.player[proj.owner].HeldItem;
51329 num15 = (float)(ContentSamples.ItemsByType[heldItem.type].useAnimation * 2) * num * player.whipRangeMultiplier;
51330 float num16 = ((Vector2)(ref proj.velocity)).Length() * num15 * num13 * rangeMultiplier / (float)segments;
51331 float num17 = 1f;
51332 Vector2 playerArmPosition = Main.GetPlayerArmPosition(proj);
51333 Vector2 vector = playerArmPosition;
51334 float num2 = -(float)Math.PI / 2f;
51335 Vector2 vector2 = vector;
51336 float num3 = (float)Math.PI / 2f + (float)Math.PI / 2f * (float)proj.spriteDirection;
51337 Vector2 vector3 = vector;
51338 float num4 = (float)Math.PI / 2f;
51340 for (int i = 0; i < segments; i++)
51341 {
51342 float num5 = (float)i / (float)segments;
51343 float num6 = num12 * num5 * num17;
51344 Vector2 vector4 = vector + num2.ToRotationVector2() * num16;
51345 Vector2 vector5 = vector3 + num4.ToRotationVector2() * (num16 * 2f);
51346 Vector2 val = vector2 + num3.ToRotationVector2() * (num16 * 2f);
51347 float num7 = 1f - num13;
51348 float num8 = 1f - num7 * num7;
51349 Vector2 value = Vector2.Lerp(vector5, vector4, num8 * 0.9f + 0.1f);
51350 Vector2 vector6 = Vector2.Lerp(val, value, num8 * 0.7f + 0.3f);
51351 Vector2 spinningpoint = playerArmPosition + (vector6 - playerArmPosition) * new Vector2(1f, num11);
51352 float num9 = num14;
51353 num9 *= num9;
51354 Vector2 item = spinningpoint.RotatedBy(proj.rotation + 4.712389f * num9 * (float)proj.spriteDirection, playerArmPosition);
51355 controlPoints.Add(item);
51356 num2 += num6;
51357 num4 += num6;
51358 num3 += num6;
51359 vector = vector4;
51360 vector3 = vector5;
51361 vector2 = val;
51362 }
51363 }
static Dictionary< int, Item > ItemsByType
The default T:Terraria.Item for a given item type (F:Terraria.Item.type).
This class stores instances of various content types in a number of dictionaries. These instances ser...
static void GetWhipSettings(Projectile proj, out float timeToFlyOut, out int segments, out float rangeMultiplier)

References Terraria.Main.GetPlayerArmPosition(), Terraria.ID.ContentSamples.ItemsByType, Terraria.Main.player, Terraria.Item.type, and Terraria.Player.whipRangeMultiplier.

Referenced by Terraria.Projectile.Colliding(), Terraria.Projectile.CutTiles(), Terraria.Main.DrawWhip(), and Terraria.Projectile.UpdateEnchantmentVisuals().

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