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

◆ AI_145_BookStaffStorm()

void Terraria.Projectile.AI_145_BookStaffStorm ( )
inlineprivate

Definition at line 77549 of file Projectile.cs.

77550 {
77551 //IL_0022: Unknown result type (might be due to invalid IL or missing references)
77552 //IL_0053: Unknown result type (might be due to invalid IL or missing references)
77553 //IL_00fc: Unknown result type (might be due to invalid IL or missing references)
77554 //IL_0101: Unknown result type (might be due to invalid IL or missing references)
77555 //IL_0103: Unknown result type (might be due to invalid IL or missing references)
77556 //IL_0108: Unknown result type (might be due to invalid IL or missing references)
77557 //IL_0109: Unknown result type (might be due to invalid IL or missing references)
77558 //IL_010a: Unknown result type (might be due to invalid IL or missing references)
77559 //IL_0110: Unknown result type (might be due to invalid IL or missing references)
77560 //IL_0115: Unknown result type (might be due to invalid IL or missing references)
77561 //IL_011e: Unknown result type (might be due to invalid IL or missing references)
77562 //IL_0124: Unknown result type (might be due to invalid IL or missing references)
77563 //IL_0132: Unknown result type (might be due to invalid IL or missing references)
77564 //IL_015a: Unknown result type (might be due to invalid IL or missing references)
77565 //IL_0186: Unknown result type (might be due to invalid IL or missing references)
77566 //IL_0193: Unknown result type (might be due to invalid IL or missing references)
77567 //IL_04a9: Unknown result type (might be due to invalid IL or missing references)
77568 //IL_04b8: Unknown result type (might be due to invalid IL or missing references)
77569 //IL_04bd: Unknown result type (might be due to invalid IL or missing references)
77570 //IL_04c2: Unknown result type (might be due to invalid IL or missing references)
77571 //IL_04c9: Unknown result type (might be due to invalid IL or missing references)
77572 //IL_04e5: Unknown result type (might be due to invalid IL or missing references)
77573 //IL_04eb: Unknown result type (might be due to invalid IL or missing references)
77574 //IL_039d: Unknown result type (might be due to invalid IL or missing references)
77575 //IL_039f: Unknown result type (might be due to invalid IL or missing references)
77576 //IL_03a1: Unknown result type (might be due to invalid IL or missing references)
77577 //IL_03a3: Unknown result type (might be due to invalid IL or missing references)
77578 //IL_03ad: Unknown result type (might be due to invalid IL or missing references)
77579 //IL_03b2: Unknown result type (might be due to invalid IL or missing references)
77580 //IL_03b7: Unknown result type (might be due to invalid IL or missing references)
77581 //IL_03b9: Unknown result type (might be due to invalid IL or missing references)
77582 //IL_03be: Unknown result type (might be due to invalid IL or missing references)
77583 //IL_03c5: Unknown result type (might be due to invalid IL or missing references)
77584 //IL_03db: Unknown result type (might be due to invalid IL or missing references)
77585 //IL_03e1: Unknown result type (might be due to invalid IL or missing references)
77586 //IL_03f2: Unknown result type (might be due to invalid IL or missing references)
77587 //IL_03f4: Unknown result type (might be due to invalid IL or missing references)
77588 //IL_041d: Unknown result type (might be due to invalid IL or missing references)
77589 //IL_052c: Unknown result type (might be due to invalid IL or missing references)
77590 //IL_0540: Unknown result type (might be due to invalid IL or missing references)
77591 //IL_0546: Unknown result type (might be due to invalid IL or missing references)
77592 //IL_054b: Unknown result type (might be due to invalid IL or missing references)
77593 //IL_0550: Unknown result type (might be due to invalid IL or missing references)
77594 //IL_057c: Unknown result type (might be due to invalid IL or missing references)
77595 //IL_05f6: Unknown result type (might be due to invalid IL or missing references)
77596 //IL_060a: Unknown result type (might be due to invalid IL or missing references)
77597 //IL_0610: Unknown result type (might be due to invalid IL or missing references)
77598 //IL_0615: Unknown result type (might be due to invalid IL or missing references)
77599 //IL_061a: Unknown result type (might be due to invalid IL or missing references)
77600 //IL_0646: Unknown result type (might be due to invalid IL or missing references)
77601 //IL_06a5: Unknown result type (might be due to invalid IL or missing references)
77602 //IL_06b9: Unknown result type (might be due to invalid IL or missing references)
77603 //IL_06bf: Unknown result type (might be due to invalid IL or missing references)
77604 //IL_06c4: Unknown result type (might be due to invalid IL or missing references)
77605 //IL_06c9: Unknown result type (might be due to invalid IL or missing references)
77606 //IL_06f5: Unknown result type (might be due to invalid IL or missing references)
77607 float num = 300f;
77608 if (soundDelay == 0)
77609 {
77610 soundDelay = -1;
77612 }
77614 if (activeSound != null)
77615 {
77616 activeSound.Position = base.Center;
77617 activeSound.Volume = 1f - Math.Max(ai[0] - (num - 15f), 0f) / 15f;
77618 }
77619 else
77620 {
77621 localAI[1] = SlotId.Invalid.ToFloat();
77622 }
77623 if (localAI[0] >= 16f && ai[0] < num - 15f)
77624 {
77625 ai[0] = num - 15f;
77626 }
77627 ai[0] += 1f;
77628 if (ai[0] >= num)
77629 {
77630 Kill();
77631 }
77632 Vector2 top = base.Top;
77633 Vector2 bottom = base.Bottom;
77634 Vector2 vector = Vector2.Lerp(top, bottom, 0.5f);
77635 Vector2 vector2 = default(Vector2);
77636 ((Vector2)(ref vector2))._002Ector(0f, bottom.Y - top.Y);
77637 vector2.X = vector2.Y * 0.2f;
77638 int num2 = 16;
77639 int num3 = 160;
77640 Vector2 vector3 = default(Vector2);
77641 for (int i = 0; i < 1; i++)
77642 {
77643 ((Vector2)(ref vector3))._002Ector(base.Center.X - (float)(num2 / 2), position.Y + (float)height - (float)num3);
77644 if (Collision.SolidCollision(vector3, num2, num3) || Collision.WetCollision(vector3, num2, num3))
77645 {
77646 if (velocity.Y > 0f)
77647 {
77648 velocity.Y = 0f;
77649 }
77650 if (velocity.Y > -4f)
77651 {
77652 velocity.Y -= 2f;
77653 }
77654 else
77655 {
77656 velocity.Y -= 4f;
77657 localAI[0] += 2f;
77658 }
77659 if (velocity.Y < -16f)
77660 {
77661 velocity.Y = -16f;
77662 }
77663 continue;
77664 }
77665 localAI[0] -= 1f;
77666 if (localAI[0] < 0f)
77667 {
77668 localAI[0] = 0f;
77669 }
77670 if (velocity.Y < 0f)
77671 {
77672 velocity.Y = 0f;
77673 }
77674 if (velocity.Y < 4f)
77675 {
77676 velocity.Y += 2f;
77677 }
77678 else
77679 {
77680 velocity.Y += 4f;
77681 }
77682 if (velocity.Y > 16f)
77683 {
77684 velocity.Y = 16f;
77685 }
77686 }
77687 if (ai[0] < num - 30f)
77688 {
77689 Vector2 vector4 = default(Vector2);
77690 Vector2 vector5 = default(Vector2);
77691 for (int j = 0; j < 1; j++)
77692 {
77693 float value = -1f;
77694 float value2 = 0.9f;
77695 float amount = Main.rand.NextFloat();
77696 ((Vector2)(ref vector4))._002Ector(MathHelper.Lerp(0.1f, 1f, Main.rand.NextFloat()), MathHelper.Lerp(value, value2, amount));
77697 vector4.X *= MathHelper.Lerp(2.2f, 0.6f, amount);
77698 vector4.X *= -1f;
77699 ((Vector2)(ref vector5))._002Ector(6f, 10f);
77700 Vector2 vector6 = vector + vector2 * vector4 * 0.5f + vector5;
77701 Dust dust = Main.dust[Dust.NewDust(vector6, 0, 0, 274)];
77702 dust.position = vector6;
77703 dust.fadeIn = 1.3f;
77704 dust.scale = 0.87f;
77705 dust.alpha = 211;
77706 if (vector4.X > -1.2f)
77707 {
77708 dust.velocity.X = 1f + Main.rand.NextFloat();
77709 }
77710 dust.noGravity = true;
77711 dust.velocity.Y = Main.rand.NextFloat() * -0.5f - 1.3f;
77712 dust.velocity.X += velocity.X * 2.1f;
77713 dust.noLight = true;
77714 }
77715 }
77716 Vector2 vector7 = base.Bottom + new Vector2(-25f, -25f);
77717 for (int k = 0; k < 4; k++)
77718 {
77719 Dust dust2 = Dust.NewDustDirect(vector7, 50, 25, 31, velocity.X, -2f, 100);
77720 dust2.fadeIn = 1.1f;
77721 dust2.noGravity = true;
77722 }
77723 for (int l = 0; l < 1; l++)
77724 {
77725 if (Main.rand.Next(5) == 0)
77726 {
77727 Gore gore = Gore.NewGoreDirect(base.TopLeft + Main.rand.NextVector2Square(0f, 1f) * base.Size, new Vector2(velocity.X * 1.5f, (0f - Main.rand.NextFloat()) * 16f), Utils.SelectRandom<int>(Main.rand, 1007, 1008, 1008));
77728 gore.timeLeft = 60;
77729 gore.alpha = 50;
77730 gore.velocity.X += velocity.X;
77731 }
77732 }
77733 for (int m = 0; m < 1; m++)
77734 {
77735 if (Main.rand.Next(7) == 0)
77736 {
77737 Gore gore2 = Gore.NewGoreDirect(base.TopLeft + Main.rand.NextVector2Square(0f, 1f) * base.Size, new Vector2(velocity.X * 1.5f, (0f - Main.rand.NextFloat()) * 16f), Utils.SelectRandom<int>(Main.rand, 1007, 1008, 1008));
77738 gore2.timeLeft = 0;
77739 gore2.alpha = 80;
77740 }
77741 }
77742 for (int n = 0; n < 1; n++)
77743 {
77744 if (Main.rand.Next(7) == 0)
77745 {
77746 Gore gore3 = Gore.NewGoreDirect(base.TopLeft + Main.rand.NextVector2Square(0f, 1f) * base.Size, new Vector2(velocity.X * 1.5f, (0f - Main.rand.NextFloat()) * 16f), Utils.SelectRandom<int>(Main.rand, 1007, 1008, 1008));
77747 gore3.timeLeft = 0;
77748 gore3.alpha = 80;
77749 }
77750 }
77751 }
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
Vector2 position
The position of this Entity in world coordinates.
Definition Entity.cs:28
int height
The height of this Entity's hitbox, in pixels.
Definition Entity.cs:51
static readonly SoundStyle DD2_BookStaffTwisterLoop
Definition SoundID.cs:207
float[] ai
An array with 3 slots used for any sort of data storage, which is occasionally synced to the server....
float[] localAI
Acts like F:Terraria.Projectile.ai, but does not sync to the server. Many vanilla T:Terraria....

References Terraria.ID.SoundID.DD2_BookStaffTwisterLoop, Terraria.Main.dust, Terraria.Audio.SoundEngine.GetActiveSound(), Terraria.Dust.NewDust(), Terraria.Dust.NewDustDirect(), Terraria.Gore.NewGoreDirect(), Terraria.Audio.SoundEngine.PlayTrackedSound(), Terraria.Main.rand, Terraria.Collision.SolidCollision(), and Terraria.Collision.WetCollision().

+ Here is the call graph for this function: