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

◆ AI_157_SharpTears()

void Terraria.Projectile.AI_157_SharpTears ( )
inlineprivate

Definition at line 41699 of file Projectile.cs.

41700 {
41701 int num = 5;
41702 float num2 = 1f;
41703 int num3 = 30;
41704 int num4 = 30;
41705 int num5 = 2;
41706 int num6 = 2;
41707 int num7 = 20;
41708 int num8 = 30;
41709 int num9 = 35;
41710 int maxValue = 6;
41711 if (type == 961)
41712 {
41713 num = 16;
41714 num2 = 0.75f;
41715 num3 = 5;
41716 num4 = 5;
41717 num5 = 0;
41718 num6 = 0;
41719 num7 = 10;
41720 num8 = 10;
41721 num9 = 20;
41722 maxValue = 5;
41723 }
41724 bool flag = ai[0] < (float)num7;
41725 bool flag2 = ai[0] >= (float)num8;
41726 bool flag3 = ai[0] >= (float)num9;
41727 ai[0] += 1f;
41728 if (localAI[0] == 0f)
41729 {
41730 localAI[0] = 1f;
41731 rotation = velocity.ToRotation();
41732 frame = Main.rand.Next(maxValue);
41733 for (int i = 0; i < num3; i++)
41734 {
41735 Dust dust = Dust.NewDustPerfect(base.Center + Main.rand.NextVector2Circular(24f, 24f), num, velocity * num2 * MathHelper.Lerp(0.2f, 0.7f, Main.rand.NextFloat()));
41736 dust.velocity += Main.rand.NextVector2Circular(0.5f, 0.5f);
41737 dust.scale = 0.8f + Main.rand.NextFloat() * 0.5f;
41738 }
41739 for (int j = 0; j < num4; j++)
41740 {
41741 Dust dust2 = Dust.NewDustPerfect(base.Center + Main.rand.NextVector2Circular(24f, 24f), num, Main.rand.NextVector2Circular(2f, 2f) + velocity * num2 * MathHelper.Lerp(0.2f, 0.5f, Main.rand.NextFloat()));
41742 dust2.velocity += Main.rand.NextVector2Circular(0.5f, 0.5f);
41743 dust2.scale = 0.8f + Main.rand.NextFloat() * 0.5f;
41744 dust2.fadeIn = 1f;
41745 }
41746 if (type == 961)
41747 {
41749 }
41750 else
41751 {
41753 }
41754 }
41755 if (flag)
41756 {
41757 Opacity += 0.1f;
41758 scale = Opacity * ai[1];
41759 for (int k = 0; k < num5; k++)
41760 {
41761 Dust dust3 = Dust.NewDustPerfect(base.Center + Main.rand.NextVector2Circular(16f, 16f), num, velocity * num2 * MathHelper.Lerp(0.2f, 0.5f, Main.rand.NextFloat()));
41762 dust3.velocity += Main.rand.NextVector2Circular(0.5f, 0.5f);
41763 dust3.velocity *= 0.5f;
41764 dust3.scale = 0.8f + Main.rand.NextFloat() * 0.5f;
41765 }
41766 }
41767 if (flag2)
41768 {
41769 Opacity -= 0.2f;
41770 for (int l = 0; l < num6; l++)
41771 {
41772 Dust dust4 = Dust.NewDustPerfect(base.Center + Main.rand.NextVector2Circular(16f, 16f), num, velocity * num2 * MathHelper.Lerp(0.2f, 0.5f, Main.rand.NextFloat()));
41773 dust4.velocity += Main.rand.NextVector2Circular(0.5f, 0.5f);
41774 dust4.velocity *= 0.5f;
41775 dust4.scale = 0.8f + Main.rand.NextFloat() * 0.5f;
41776 }
41777 }
41778 if (flag3)
41779 {
41780 Kill();
41781 }
41782 if (type == 756)
41783 {
41784 Lighting.AddLight(base.Center, new Vector3(0.5f, 0.1f, 0.1f) * scale);
41785 }
41786 }
static float Lerp(float value1, float value2, float amount)
Definition MathHelper.cs:53
static void PlaySound(int type, Vector2 position, int style=1)
Vector2 velocity
Definition Entity.cs:16
static readonly LegacySoundStyle DeerclopsIceAttack
Definition SoundID.cs:966
static readonly LegacySoundStyle Item60
Definition SoundID.cs:534

References Terraria.Lighting.AddLight(), Terraria.ID.SoundID.DeerclopsIceAttack, Terraria.ID.SoundID.Item60, Microsoft.Xna.Framework.MathHelper.Lerp(), Terraria.Dust.NewDustPerfect(), Terraria.Audio.SoundEngine.PlaySound(), Terraria.Main.rand, and System.type.