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

◆ AI_187_ShadowHand()

void Terraria.Projectile.AI_187_ShadowHand ( )
inlineprivate

Definition at line 43768 of file Projectile.cs.

43769 {
43770 //IL_0025: Unknown result type (might be due to invalid IL or missing references)
43771 //IL_0071: Unknown result type (might be due to invalid IL or missing references)
43772 //IL_00ee: Unknown result type (might be due to invalid IL or missing references)
43773 //IL_00f8: Unknown result type (might be due to invalid IL or missing references)
43774 //IL_00fd: Unknown result type (might be due to invalid IL or missing references)
43775 //IL_0341: Unknown result type (might be due to invalid IL or missing references)
43776 //IL_0348: Unknown result type (might be due to invalid IL or missing references)
43777 //IL_034d: Unknown result type (might be due to invalid IL or missing references)
43778 //IL_012b: Unknown result type (might be due to invalid IL or missing references)
43779 //IL_03b5: Unknown result type (might be due to invalid IL or missing references)
43780 //IL_03bf: Unknown result type (might be due to invalid IL or missing references)
43781 //IL_03c5: Unknown result type (might be due to invalid IL or missing references)
43782 //IL_03c7: Unknown result type (might be due to invalid IL or missing references)
43783 //IL_03cc: Unknown result type (might be due to invalid IL or missing references)
43784 //IL_037b: Unknown result type (might be due to invalid IL or missing references)
43785 //IL_01bf: Unknown result type (might be due to invalid IL or missing references)
43786 //IL_01ca: Unknown result type (might be due to invalid IL or missing references)
43787 //IL_01d1: Unknown result type (might be due to invalid IL or missing references)
43788 //IL_01d6: Unknown result type (might be due to invalid IL or missing references)
43789 //IL_01db: Unknown result type (might be due to invalid IL or missing references)
43790 //IL_02a4: Unknown result type (might be due to invalid IL or missing references)
43791 //IL_02ac: Unknown result type (might be due to invalid IL or missing references)
43792 //IL_02b3: Unknown result type (might be due to invalid IL or missing references)
43793 //IL_02b8: Unknown result type (might be due to invalid IL or missing references)
43794 //IL_019e: Unknown result type (might be due to invalid IL or missing references)
43795 //IL_01a8: Unknown result type (might be due to invalid IL or missing references)
43796 //IL_01ad: Unknown result type (might be due to invalid IL or missing references)
43797 //IL_03fa: Unknown result type (might be due to invalid IL or missing references)
43800 if (fakeCounter == 0f)
43801 {
43803 }
43805 if (activeSound == null)
43806 {
43807 localAI[1] = SlotId.Invalid.ToFloat();
43808 }
43809 else
43810 {
43811 activeSound.Position = base.Center;
43812 }
43813 float num = counterMax - 15f;
43814 if (fakeCounter > num)
43815 {
43816 alpha += 25;
43817 if (alpha > 255)
43818 {
43819 alpha = 255;
43820 }
43821 }
43822 else
43823 {
43824 alpha -= 25;
43825 if (alpha < 50)
43826 {
43827 alpha = 50;
43828 }
43829 }
43830 if (fakeCounter >= counterMax - 1f)
43831 {
43832 Kill();
43833 return;
43834 }
43835 if (variation == 0)
43836 {
43837 velocity *= 0.98f;
43838 direction = (spriteDirection = ((velocity.X > 0f) ? 1 : (-1)));
43839 rotation = velocity.ToRotation();
43840 if (spriteDirection == -1)
43841 {
43842 rotation += (float)Math.PI;
43843 }
43844 }
43845 if (variation == 1)
43846 {
43847 float num2 = 70f;
43848 direction = (spriteDirection = ((velocity.X > 0f) ? 1 : (-1)));
43849 if (((Vector2)(ref velocity)).Length() > 0.1f)
43850 {
43851 velocity *= 0.95f;
43852 }
43853 num2 *= (float)direction;
43854 Vector2 vector = base.Center - rotation.ToRotationVector2() * num2;
43855 float num8 = Utils.Remap(fromValue, 0.3f, 0.5f, 0f, 1f) * Utils.Remap(fromValue, 0.45f, 0.5f, 1f, 0f);
43856 float num3 = Utils.Remap(fromValue, 0.5f, 0.55f, 0f, 1f) * Utils.Remap(fromValue, 0.5f, 1f, 1f, 0f);
43857 float num4 = num8 * (float)Math.PI * 1f / 60f;
43858 num4 += num3 * -(float)Math.PI * 8f / 60f;
43859 rotation += num4 * (float)(-direction);
43860 rotation = MathHelper.WrapAngle(rotation);
43861 base.Center = vector + rotation.ToRotationVector2() * num2;
43862 }
43863 if (variation == 2)
43864 {
43865 float f = ai[1];
43866 float num9 = Utils.Remap(fromValue, 0f, 0.4f, 1f, 0f);
43867 float num5 = Utils.Remap(fromValue, 0.3f, 0.4f, 0f, 1f) * Utils.Remap(fromValue, 0.4f, 1f, 1f, 0f);
43868 float num6 = num9 * 2f + num5 * 8f + 0.01f;
43869 velocity = f.ToRotationVector2() * num6;
43870 direction = (spriteDirection = ((velocity.X > 0f) ? 1 : (-1)));
43871 rotation = velocity.ToRotation();
43872 if (spriteDirection == -1)
43873 {
43874 rotation += (float)Math.PI;
43875 }
43876 }
43877 if (variation == 3)
43878 {
43879 float num7 = ai[1];
43880 velocity = velocity.RotatedBy(num7);
43881 direction = (spriteDirection = ((velocity.X > 0f) ? 1 : (-1)));
43882 rotation = velocity.ToRotation();
43883 if (spriteDirection == -1)
43884 {
43885 rotation += (float)Math.PI;
43886 }
43887 }
43888 ai[0] += 1f;
43889 }
static ? ActiveSound GetActiveSound(SlotId slotId)
static SlotId PlayTrackedSound(in SoundStyle style, Vector2? position=null)
Vector2 velocity
The velocity of this Entity in world coordinates per tick.
Definition Entity.cs:33
static readonly SoundStyle DD2_GhastlyGlaiveImpactGhost
Definition SoundID.cs:209
float[] ai
An array with 3 slots used for any sort of data storage, which is occasionally synced to the server....
int alpha
How transparent to draw this projectile. 0 to 255. 255 is completely transparent. ExampleBulletsets...
float[] localAI
Acts like F:Terraria.Projectile.ai, but does not sync to the server. Many vanilla T:Terraria....
float rotation
Rotation of the projectile. Radians not Degrees. Use T:Microsoft.Xna.Framework.MathHelper if you want...
void AI_187_ShadowHand_GetVariation(out int variation, out float fakeCounter, out float counterMax)

References Terraria.ID.SoundID.DD2_GhastlyGlaiveImpactGhost, Terraria.Audio.SoundEngine.GetActiveSound(), Terraria.Audio.SoundEngine.PlayTrackedSound(), and Terraria.Utils.Remap().

+ Here is the call graph for this function: