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

◆ RaiseGoblins()

static void Terraria.GameContent.Events.DD2Event.RaiseGoblins ( NPC caller,
Vector2 spot )
inlinestatic

Definition at line 718 of file DD2Event.cs.

719 {
720 //IL_0015: Unknown result type (might be due to invalid IL or missing references)
721 //IL_001a: Unknown result type (might be due to invalid IL or missing references)
722 //IL_001b: Unknown result type (might be due to invalid IL or missing references)
723 //IL_001c: Unknown result type (might be due to invalid IL or missing references)
724 //IL_002a: Unknown result type (might be due to invalid IL or missing references)
725 //IL_0054: Unknown result type (might be due to invalid IL or missing references)
726 //IL_0059: Unknown result type (might be due to invalid IL or missing references)
727 //IL_0060: Unknown result type (might be due to invalid IL or missing references)
728 //IL_0091: Unknown result type (might be due to invalid IL or missing references)
729 //IL_0096: Unknown result type (might be due to invalid IL or missing references)
730 //IL_009b: Unknown result type (might be due to invalid IL or missing references)
731 //IL_00b6: Unknown result type (might be due to invalid IL or missing references)
732 //IL_012f: Unknown result type (might be due to invalid IL or missing references)
733 //IL_013b: Unknown result type (might be due to invalid IL or missing references)
734 //IL_00ec: Unknown result type (might be due to invalid IL or missing references)
735 //IL_00f8: Unknown result type (might be due to invalid IL or missing references)
736 List<Vector2> list = new List<Vector2>();
737 foreach (Vector2 deadGoblinSpot in _deadGoblinSpots)
738 {
739 if (Vector2.DistanceSquared(deadGoblinSpot, spot) <= 722500f)
740 {
741 list.Add(deadGoblinSpot);
742 }
743 }
744 foreach (Vector2 item in list)
745 {
746 _deadGoblinSpots.Remove(item);
747 }
748 int num = 0;
749 foreach (Vector2 item2 in list)
750 {
751 Point origin = item2.ToTileCoordinates();
752 origin.X += Main.rand.Next(-15, 16);
753 if (WorldUtils.Find(origin, Searches.Chain(new Searches.Down(50), new Conditions.IsSolid()), out var result))
754 {
755 if (OngoingDifficulty == 3)
756 {
757 NPC.NewNPC(caller.GetSpawnSourceForNPCFromNPCAI(), result.X * 16 + 8, result.Y * 16, 567);
758 }
759 else
760 {
761 NPC.NewNPC(caller.GetSpawnSourceForNPCFromNPCAI(), result.X * 16 + 8, result.Y * 16, 566);
762 }
763 if (++num >= 8)
764 {
765 break;
766 }
767 }
768 }
769 }
static List< Vector2 > _deadGoblinSpots
Definition DD2Event.cs:51
static GenSearch Chain(GenSearch search, params GenCondition[] conditions)
Definition Searches.cs:154
static bool Find(Point origin, GenSearch search, out Point result)
Definition WorldUtils.cs:30

References Terraria.GameContent.Events.DD2Event._deadGoblinSpots, Terraria.WorldBuilding.Searches.Chain(), Terraria.WorldBuilding.WorldUtils.Find(), Terraria.NPC.NewNPC(), Terraria.GameContent.Events.DD2Event.OngoingDifficulty, and Terraria.Main.rand.

Referenced by Terraria.NPC.AI_109_DarkMage().

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