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

◆ RandomizeInsanityShadowFor()

static void Terraria.Projectile.RandomizeInsanityShadowFor ( Entity targetEntity,
bool isHostile,
out Vector2 spawnposition,
out Vector2 spawnvelocity,
out float ai0,
out float ai1 )
inlinestatic

Definition at line 43664 of file Projectile.cs.

43665 {
43666 //IL_0086: Unknown result type (might be due to invalid IL or missing references)
43667 //IL_008c: Unknown result type (might be due to invalid IL or missing references)
43668 //IL_0092: Unknown result type (might be due to invalid IL or missing references)
43669 //IL_0097: Unknown result type (might be due to invalid IL or missing references)
43670 //IL_00ab: Unknown result type (might be due to invalid IL or missing references)
43671 //IL_00b5: Unknown result type (might be due to invalid IL or missing references)
43672 //IL_00bb: Unknown result type (might be due to invalid IL or missing references)
43673 //IL_00bd: Unknown result type (might be due to invalid IL or missing references)
43674 //IL_00c2: Unknown result type (might be due to invalid IL or missing references)
43675 //IL_00c7: Unknown result type (might be due to invalid IL or missing references)
43676 //IL_00d8: Unknown result type (might be due to invalid IL or missing references)
43677 //IL_00e2: Unknown result type (might be due to invalid IL or missing references)
43678 //IL_00e8: Unknown result type (might be due to invalid IL or missing references)
43679 //IL_00ea: Unknown result type (might be due to invalid IL or missing references)
43680 //IL_00ef: Unknown result type (might be due to invalid IL or missing references)
43681 //IL_011c: Unknown result type (might be due to invalid IL or missing references)
43682 //IL_0123: Unknown result type (might be due to invalid IL or missing references)
43683 //IL_0189: Unknown result type (might be due to invalid IL or missing references)
43684 //IL_0190: Unknown result type (might be due to invalid IL or missing references)
43685 //IL_0196: Unknown result type (might be due to invalid IL or missing references)
43686 //IL_019b: Unknown result type (might be due to invalid IL or missing references)
43687 //IL_01a0: Unknown result type (might be due to invalid IL or missing references)
43688 //IL_01b5: Unknown result type (might be due to invalid IL or missing references)
43689 //IL_0135: Unknown result type (might be due to invalid IL or missing references)
43690 //IL_013a: Unknown result type (might be due to invalid IL or missing references)
43691 //IL_013f: Unknown result type (might be due to invalid IL or missing references)
43692 //IL_015a: Unknown result type (might be due to invalid IL or missing references)
43693 //IL_01c2: Unknown result type (might be due to invalid IL or missing references)
43694 //IL_01c7: Unknown result type (might be due to invalid IL or missing references)
43695 //IL_0205: Unknown result type (might be due to invalid IL or missing references)
43696 //IL_020b: Unknown result type (might be due to invalid IL or missing references)
43697 //IL_0212: Unknown result type (might be due to invalid IL or missing references)
43698 //IL_0217: Unknown result type (might be due to invalid IL or missing references)
43699 //IL_021c: Unknown result type (might be due to invalid IL or missing references)
43700 //IL_0221: Unknown result type (might be due to invalid IL or missing references)
43701 //IL_0167: Unknown result type (might be due to invalid IL or missing references)
43702 //IL_016c: Unknown result type (might be due to invalid IL or missing references)
43703 //IL_022e: Unknown result type (might be due to invalid IL or missing references)
43704 //IL_0233: Unknown result type (might be due to invalid IL or missing references)
43705 //IL_023c: Unknown result type (might be due to invalid IL or missing references)
43706 //IL_0241: Unknown result type (might be due to invalid IL or missing references)
43707 //IL_0243: Unknown result type (might be due to invalid IL or missing references)
43708 //IL_0248: Unknown result type (might be due to invalid IL or missing references)
43709 //IL_024d: Unknown result type (might be due to invalid IL or missing references)
43710 //IL_025a: Unknown result type (might be due to invalid IL or missing references)
43711 //IL_0260: Unknown result type (might be due to invalid IL or missing references)
43712 //IL_0262: Unknown result type (might be due to invalid IL or missing references)
43713 //IL_0267: Unknown result type (might be due to invalid IL or missing references)
43714 //IL_0277: Unknown result type (might be due to invalid IL or missing references)
43715 //IL_0279: Unknown result type (might be due to invalid IL or missing references)
43716 int num = Main.rand.Next(2) * 2 - 1;
43717 int num10 = Main.rand.Next(4);
43718 float num3 = (isHostile ? 200f : 100f);
43719 float num4 = (isHostile ? 30 : 20);
43720 float num5 = (isHostile ? 30 : 0);
43721 float num6 = Main.rand.NextFloatDirection() * (float)Math.PI * 0.125f;
43722 if (isHostile && targetEntity.velocity.X * (float)num > 0f)
43723 {
43724 num *= -1;
43725 }
43726 if (num10 == 0 && isHostile)
43727 {
43728 num4 += 10f;
43729 }
43730 spawnposition = targetEntity.Center + targetEntity.velocity * num5 + Utils.RotatedBy(new Vector2((float)num * (0f - num3), 0f), num6);
43731 spawnvelocity = Utils.RotatedBy(new Vector2((float)num * num3 / num4, 0f), num6);
43732 ai0 = 0f;
43733 ai1 = 0f;
43734 if (num10 == 1)
43735 {
43736 float num7 = (float)Math.PI * 2f * Main.rand.NextFloat();
43737 spawnposition = targetEntity.Center - num7.ToRotationVector2() * (isHostile ? num3 : (num3 * 0.5f));
43738 ai0 = 180f;
43739 ai1 = num7 - (float)Math.PI / 2f;
43740 spawnvelocity = num7.ToRotationVector2() * (float)(isHostile ? 4 : 2);
43741 }
43742 if (num10 == 2)
43743 {
43744 float num8 = (float)Math.PI * 2f * Main.rand.NextFloat();
43745 spawnposition = targetEntity.Center - num8.ToRotationVector2() * num3;
43746 ai0 = 300f;
43747 ai1 = num8;
43748 spawnvelocity = num8.ToRotationVector2() * (float)(isHostile ? 4 : 2);
43749 }
43750 if (num10 == 3)
43751 {
43752 float f = (float)Math.PI * 2f * Main.rand.NextFloat();
43753 float num9 = (isHostile ? 60 : 30);
43754 float num2 = (float)Math.PI / 2f / num9 * Main.rand.NextFloatDirection();
43755 spawnposition = targetEntity.Center + targetEntity.velocity * num9;
43756 Vector2 vector = f.ToRotationVector2() * (float)(isHostile ? 8 : 3);
43757 for (int i = 0; (float)i < num9; i++)
43758 {
43760 vector = vector.RotatedBy(0f - num2);
43761 }
43763 ai0 = 390f;
43764 ai1 = num2;
43765 }
43766 }

References Terraria.Main.rand, and Terraria.Utils.RotatedBy().

Referenced by Terraria.NPC.AI_123_Deerclops(), Terraria.Player.SpawnHallucination(), and Terraria.NPC.SpawnPassiveShadowHands().

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