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

◆ AI_119_Dandelion()

void Terraria.NPC.AI_119_Dandelion ( )
inlineprivate

Definition at line 48614 of file NPC.cs.

48615 {
48616 //IL_0052: Unknown result type (might be due to invalid IL or missing references)
48617 //IL_0057: Unknown result type (might be due to invalid IL or missing references)
48618 //IL_0062: Unknown result type (might be due to invalid IL or missing references)
48619 //IL_006e: Unknown result type (might be due to invalid IL or missing references)
48620 //IL_0083: Unknown result type (might be due to invalid IL or missing references)
48621 //IL_008f: Unknown result type (might be due to invalid IL or missing references)
48622 //IL_01dd: Unknown result type (might be due to invalid IL or missing references)
48623 //IL_01df: Unknown result type (might be due to invalid IL or missing references)
48624 //IL_01e6: Unknown result type (might be due to invalid IL or missing references)
48625 //IL_01eb: Unknown result type (might be due to invalid IL or missing references)
48626 //IL_01f0: Unknown result type (might be due to invalid IL or missing references)
48627 //IL_01f2: Unknown result type (might be due to invalid IL or missing references)
48628 //IL_020d: Unknown result type (might be due to invalid IL or missing references)
48629 //IL_0212: Unknown result type (might be due to invalid IL or missing references)
48630 //IL_0214: Unknown result type (might be due to invalid IL or missing references)
48631 //IL_0219: Unknown result type (might be due to invalid IL or missing references)
48632 //IL_0234: Unknown result type (might be due to invalid IL or missing references)
48633 //IL_0236: Unknown result type (might be due to invalid IL or missing references)
48634 if (!Main.IsItAHappyWindyDay && timeLeft > 10)
48635 {
48636 timeLeft = 10;
48637 }
48638 bool flag = false;
48639 float num = 0f;
48640 float num2 = 0f;
48643 if (targetData.Type == NPCTargetType.Player)
48644 {
48645 Rectangle hitbox = targetData.Hitbox;
48646 float windSpeedCurrent = Main.windSpeedCurrent;
48647 num = (float)((Rectangle)(ref hitbox)).Center.X - base.Center.X;
48648 num2 = Math.Abs(num);
48649 flag = Math.Abs((float)((Rectangle)(ref hitbox)).Center.Y - base.Center.Y) < 100f && num2 < 600f && ((num > 0f && windSpeedCurrent > 0f) || (num < 0f && windSpeedCurrent < 0f));
48650 }
48651 if (ai[0] == 1f)
48652 {
48653 localAI[0] = 0f;
48654 if (num2 < 500f)
48655 {
48656 localAI[0] = 1f;
48657 }
48658 if (Main.netMode == 1)
48659 {
48660 return;
48661 }
48662 if (!flag)
48663 {
48664 ai[0] = 0f;
48665 netUpdate = true;
48666 }
48667 else
48668 {
48669 if (localAI[0] != 1f)
48670 {
48671 return;
48672 }
48673 localAI[1] += 1f;
48674 if (localAI[1] > 80f)
48675 {
48676 ai[0] = 0f;
48677 netUpdate = true;
48678 }
48679 else
48680 {
48681 if (localAI[1] != 40f)
48682 {
48683 return;
48684 }
48685 Vector2 vector = default(Vector2);
48686 Vector2 vector2 = default(Vector2);
48687 for (int i = 0; i < 1 + Main.rand.Next(3); i++)
48688 {
48689 int num3 = -1;
48690 if (num > 0f)
48691 {
48692 num3 = 1;
48693 }
48694 ((Vector2)(ref vector))._002Ector((float)(num3 * Main.rand.Next(-2, 10)), (float)(10 + Main.rand.Next(-6, 6)));
48695 ((Vector2)(ref vector2))._002Ector(2f * (float)num3, -2f);
48696 vector2 += vector * 0.25f;
48697 if (vector2.Y > -3f)
48698 {
48699 vector2.Y = -3f;
48700 }
48701 Vector2 vector3 = base.Center + vector;
48702 vector3.X += num3 * 6;
48703 int num4 = 7;
48704 Projectile.NewProjectile(GetSpawnSource_ForProjectile(), vector3, vector2, 836, num4, 1f, Main.myPlayer, 0f, target);
48705 }
48706 netUpdate = true;
48707 }
48708 }
48709 }
48710 else if (ai[0] == 0f)
48711 {
48712 localAI[0] = 0f;
48713 localAI[1] = 0f;
48714 if (Main.netMode != 1 && flag)
48715 {
48716 ai[0] = 1f;
48717 netUpdate = true;
48718 }
48719 }
48720 }
Vector2 Center
Definition Entity.cs:70
int timeLeft
Definition NPC.cs:1017
float[] localAI
Acts like F:Terraria.NPC.ai, but does not sync to the server. Many vanilla T:Terraria....
Definition NPC.cs:1003
NPCAimedTarget GetTargetData(bool ignorePlayerTankPets=true)
Definition NPC.cs:1668
float[] ai
An array with 4 slots used for any sort of data storage, which is occasionally synced from the server...
Definition NPC.cs:997
IEntitySource GetSpawnSource_ForProjectile()
Definition NPC.cs:107558
bool netUpdate
Definition NPC.cs:1130
int target
Definition NPC.cs:1019
static void TargetClosestDownwindFromNPC(NPC searcher, float distanceMaxX, bool faceTarget=true, Vector2? checkPosition=null)
Definition NPCUtils.cs:312

References Terraria.NPC.ai, Terraria.Entity.Center, Terraria.NPC.GetSpawnSource_ForProjectile(), Terraria.NPC.GetTargetData(), Terraria.Main.IsItAHappyWindyDay, Terraria.NPC.localAI, Terraria.Main.myPlayer, Terraria.Main.netMode, Terraria.NPC.netUpdate, Terraria.Projectile.NewProjectile(), Terraria.Main.rand, Terraria.NPC.target, Terraria.Utilities.NPCUtils.TargetClosestDownwindFromNPC(), Terraria.NPC.timeLeft, and Terraria.Main.windSpeedCurrent.

Referenced by Terraria.NPC.VanillaAI_Inner().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: