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

◆ AI_166_Dove()

void Terraria.Projectile.AI_166_Dove ( )
inlineprivate

Definition at line 50706 of file Projectile.cs.

50707 {
50708 //IL_00bf: Unknown result type (might be due to invalid IL or missing references)
50709 //IL_00c5: Unknown result type (might be due to invalid IL or missing references)
50710 //IL_00ca: Unknown result type (might be due to invalid IL or missing references)
50711 //IL_00cc: Unknown result type (might be due to invalid IL or missing references)
50712 //IL_00d1: Unknown result type (might be due to invalid IL or missing references)
50713 bool num5 = type == 855;
50714 if (localAI[0] == 0f)
50715 {
50716 localAI[0] = 1f;
50717 frame = Main.rand.Next(4);
50718 }
50719 int num2 = 4;
50720 if (num5)
50721 {
50722 num2 = 6;
50723 }
50724 if (++frameCounter > num2)
50725 {
50726 frameCounter = 0;
50727 if (++frame > 3)
50728 {
50729 frame = 0;
50730 }
50731 }
50732 spriteDirection = -1;
50733 if (velocity.X > 0f)
50734 {
50735 spriteDirection = 1;
50736 }
50737 if (num5)
50738 {
50739 float num3 = 1f - (float)alpha / 255f;
50740 Vector3 rgb = new Vector3(1f, 0.6f, 0.1f) * num3;
50741 Lighting.AddLight(base.Center, rgb);
50742 rotation = velocity.X * 0.2f;
50743 if (velocity.Y < -1f)
50744 {
50745 velocity.Y *= 0.99f;
50746 }
50747 else
50748 {
50749 velocity.Y += (float)Math.Sin((float)(timeLeft % 200) / 200f * ((float)Math.PI * 2f)) * 0.25f;
50750 if (velocity.Y > 0.5f)
50751 {
50752 velocity.Y *= 0.8f;
50753 }
50754 velocity.Y = MathHelper.Clamp(velocity.Y, -1.5f, 1.5f);
50755 }
50756 float num4 = Main.WindForVisuals;
50757 if (num4 == 0f)
50758 {
50759 num4 = 0.1f;
50760 }
50761 velocity.X += 0.0525f * num4;
50762 velocity.X = MathHelper.Clamp(velocity.X, -2f, 2f);
50763 }
50764 else
50765 {
50766 rotation = velocity.X * 0.15f;
50767 velocity.Y -= 0.025f;
50768 if (velocity.Y < -3f)
50769 {
50770 velocity.Y = -3f;
50771 }
50772 velocity.X = MathHelper.Clamp(velocity.X, -5f, 5f);
50773 }
50774 if (timeLeft < 90)
50775 {
50776 alpha += 3;
50777 }
50778 if (alpha >= 255)
50779 {
50780 Kill();
50781 }
50782 }
Vector2 velocity
The velocity of this Entity in world coordinates per tick.
Definition Entity.cs:33
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....
int frame
The frame number in the spritesheet that this projectile will be drawn with. Assign in M:Terraria....
int type
The Projectile ID of this projectile. The Projectile ID is a unique number assigned to each Projectil...
int timeLeft
Time in ticks before this projectile will naturally despawn. Each update timeLeft is decreased by 1...
float rotation
Rotation of the projectile. Radians not Degrees. Use T:Microsoft.Xna.Framework.MathHelper if you want...
int frameCounter
Used as a timer to decide when to change F:Terraria.Projectile.frame. Defaults to 0.

References Terraria.Lighting.AddLight(), Terraria.Main.rand, and Terraria.Main.WindForVisuals.

+ Here is the call graph for this function: