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

◆ AI_159_PaperAirplanes()

void Terraria.Projectile.AI_159_PaperAirplanes ( )
inlineprivate

Definition at line 51704 of file Projectile.cs.

51705 {
51706 //IL_009e: Unknown result type (might be due to invalid IL or missing references)
51707 //IL_00a8: Unknown result type (might be due to invalid IL or missing references)
51708 //IL_00ad: Unknown result type (might be due to invalid IL or missing references)
51709 //IL_00e4: Unknown result type (might be due to invalid IL or missing references)
51710 //IL_00eb: Unknown result type (might be due to invalid IL or missing references)
51711 //IL_00f0: Unknown result type (might be due to invalid IL or missing references)
51712 //IL_00f5: Unknown result type (might be due to invalid IL or missing references)
51713 //IL_00f6: Unknown result type (might be due to invalid IL or missing references)
51714 //IL_0102: Unknown result type (might be due to invalid IL or missing references)
51715 //IL_002d: Unknown result type (might be due to invalid IL or missing references)
51716 //IL_01c7: Unknown result type (might be due to invalid IL or missing references)
51717 //IL_01c8: Unknown result type (might be due to invalid IL or missing references)
51718 //IL_01cd: Unknown result type (might be due to invalid IL or missing references)
51719 //IL_01dd: Unknown result type (might be due to invalid IL or missing references)
51720 //IL_01e2: Unknown result type (might be due to invalid IL or missing references)
51721 //IL_019d: Unknown result type (might be due to invalid IL or missing references)
51722 //IL_01b8: Unknown result type (might be due to invalid IL or missing references)
51723 //IL_01be: Unknown result type (might be due to invalid IL or missing references)
51724 //IL_01c0: Unknown result type (might be due to invalid IL or missing references)
51725 //IL_01c5: Unknown result type (might be due to invalid IL or missing references)
51726 //IL_02fd: Unknown result type (might be due to invalid IL or missing references)
51727 if (ai[1] == 0f)
51728 {
51729 direction = ((velocity.X > 0f) ? 1 : (-1));
51730 rotation = velocity.ToRotation();
51731 ai[1] = 1f;
51732 ai[0] = -Main.rand.Next(30, 80);
51733 netUpdate = true;
51734 }
51735 if (wet && owner == Main.myPlayer)
51736 {
51737 Kill();
51738 }
51739 ai[0] += 1f;
51740 Vector2 vector = rotation.ToRotationVector2() * 8f;
51741 float y = (float)Math.Sin((float)Math.PI * 2f * (float)(Main.timeForVisualEffects % 90.0 / 90.0)) * (float)direction * Main.WindForVisuals;
51742 Vector2 v = vector + new Vector2(Main.WindForVisuals, y);
51743 _ = Vector2.UnitX * (float)direction;
51744 bool flag = direction == Math.Sign(Main.WindForVisuals) && ((Vector2)(ref velocity)).Length() > 3f;
51745 bool num4 = ai[0] >= 20f && ai[0] <= 69f;
51746 if (ai[0] == 70f)
51747 {
51748 ai[0] = -Main.rand.Next(120, 600);
51749 }
51750 bool num5 = num4 && flag;
51751 if (num5)
51752 {
51753 float lerpValue = Utils.GetLerpValue(0f, 30f, ai[0], clamped: true);
51754 v = vector.RotatedBy((float)(-direction) * ((float)Math.PI * 2f) * 0.02f * lerpValue);
51755 }
51756 velocity = v.SafeNormalize(Vector2.UnitY) * ((Vector2)(ref velocity)).Length();
51757 if (!num5)
51758 {
51759 float num3 = MathHelper.Lerp(0.15f, 0.05f, Math.Abs(Main.WindForVisuals));
51760 if (timeLeft % 40 < 20)
51761 {
51762 velocity.Y -= num3;
51763 }
51764 else
51765 {
51766 velocity.Y += num3;
51767 }
51768 if (velocity.Y < -2f)
51769 {
51770 velocity.Y = -2f;
51771 }
51772 if (velocity.Y > 2f)
51773 {
51774 velocity.Y = 2f;
51775 }
51776 velocity.X = MathHelper.Clamp(velocity.X + Main.WindForVisuals * 0.006f, -6f, 6f);
51777 if (velocity.X * oldVelocity.X < 0f)
51778 {
51779 direction *= -1;
51780 ai[0] = -Main.rand.Next(120, 300);
51781 netUpdate = true;
51782 }
51783 }
51784 rotation = velocity.ToRotation();
51786 }
bool wet
The Entity is currently in water. Projectile: Affects movement speed and some projectiles die when ...
Definition Entity.cs:57
Vector2 velocity
The velocity of this Entity in world coordinates per tick.
Definition Entity.cs:33
Vector2 oldVelocity
Definition Entity.cs:37
int owner
The index of the player who owns this projectile. In Multiplayer, Clients "own" projectiles that they...
float[] ai
An array with 3 slots used for any sort of data storage, which is occasionally synced to the server....
bool netUpdate
Set manually to true in M:Terraria.ModLoader.ModProjectile.AI once to make it sync its current F:Terr...
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...

References Terraria.Utils.GetLerpValue(), Terraria.Main.myPlayer, Terraria.Main.rand, Terraria.Main.timeForVisualEffects, and Terraria.Main.WindForVisuals.

+ Here is the call graph for this function: