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

◆ AI_143_MonkStaffT2Ghast()

void Terraria.Projectile.AI_143_MonkStaffT2Ghast ( )
inlineprivate

Definition at line 58859 of file Projectile.cs.

58860 {
58861 //IL_0037: Unknown result type (might be due to invalid IL or missing references)
58862 //IL_0021: Unknown result type (might be due to invalid IL or missing references)
58863 //IL_0026: Unknown result type (might be due to invalid IL or missing references)
58864 //IL_004c: Unknown result type (might be due to invalid IL or missing references)
58865 //IL_0051: Unknown result type (might be due to invalid IL or missing references)
58866 SlotId val;
58867 if (ai[0] == 0f)
58868 {
58869 float[] array = localAI;
58871 array[1] = ((SlotId)(ref val)).ToFloat();
58872 }
58874 if (activeSound == null)
58875 {
58876 float[] array2 = localAI;
58877 val = SlotId.Invalid;
58878 array2[1] = ((SlotId)(ref val)).ToFloat();
58879 }
58880 else
58881 {
58882 activeSound.Position = base.Center;
58883 }
58884 ai[0] += 1f;
58885 if (ai[0] > 50f)
58886 {
58887 alpha += 25;
58888 if (alpha > 255)
58889 {
58890 alpha = 255;
58891 }
58892 }
58893 else
58894 {
58895 alpha -= 25;
58896 if (alpha < 100)
58897 {
58898 alpha = 100;
58899 }
58900 }
58901 velocity *= 0.98f;
58902 if (++frameCounter >= 5)
58903 {
58904 frameCounter = 0;
58905 if (++frame >= 4)
58906 {
58907 frame = 0;
58908 }
58909 }
58910 if (ai[0] >= 60f)
58911 {
58912 Kill();
58913 }
58914 direction = (spriteDirection = ((velocity.X > 0f) ? 1 : (-1)));
58915 rotation = velocity.ToRotation();
58916 if (spriteDirection == -1)
58917 {
58918 rotation += (float)Math.PI;
58919 }
58920 if (ai[0] >= 10f && ai[0] < 34f)
58921 {
58922 Vector2 vector = velocity.SafeNormalize(Vector2.UnitY);
58923 float num = ai[0] / 60f;
58924 float num2 = 2f;
58925 for (int i = 0; (float)i < num2; i++)
58926 {
58927 Dust dust = Dust.NewDustDirect(base.Center, 14, 14, 228, 0f, 0f, 110);
58928 dust.velocity = vector * 2f;
58929 dust.position = base.Center + vector.RotatedBy(num * ((float)Math.PI * 2f) * 2f + (float)i / num2 * ((float)Math.PI * 2f)) * 7f;
58930 dust.scale = 1f + 0.6f * Main.rand.NextFloat();
58931 dust.velocity += vector * 3f;
58932 dust.noGravity = true;
58933 }
58934 }
58935 }
const double PI
Definition Math.cs:16
static SlotId PlayTrackedSound(SoundStyle style, Vector2 position)
static ActiveSound GetActiveSound(SlotId id)
Vector2 velocity
Definition Entity.cs:16
static readonly LegacySoundStyle DD2_GhastlyGlaiveImpactGhost
Definition SoundID.cs:938
static readonly SlotId Invalid
Definition SlotId.cs:5
static SlotId FromFloat(float value)
Definition SlotId.cs:80

References System.array, Terraria.ID.SoundID.DD2_GhastlyGlaiveImpactGhost, ReLogic.Utilities.SlotId.FromFloat(), Terraria.Audio.SoundEngine.GetActiveSound(), ReLogic.Utilities.SlotId.Invalid, Terraria.Dust.NewDustDirect(), System.Math.PI, Terraria.Audio.SoundEngine.PlayTrackedSound(), Terraria.Main.rand, and Microsoft.Xna.Framework.Vector2.UnitY.