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

◆ SummonMonkGhast()

void Terraria.Projectile.SummonMonkGhast ( )
inlineprivate

Definition at line 13125 of file Projectile.cs.

13126 {
13127 if (localAI[0] > 0f)
13128 {
13129 return;
13130 }
13131 localAI[0] = 1000f;
13132 List<NPC> list = new List<NPC>();
13133 for (int i = 0; i < 200; i++)
13134 {
13135 NPC nPC = Main.npc[i];
13136 if (nPC.CanBeChasedBy(this) && Distance(nPC.Center) < 800f)
13137 {
13138 list.Add(nPC);
13139 }
13140 }
13141 Vector2 center = base.Center;
13143 if (list.Count > 0)
13144 {
13145 NPC nPC2 = list[Main.rand.Next(list.Count)];
13146 center = nPC2.Center;
13147 zero = nPC2.velocity;
13148 }
13149 int num = Main.rand.Next(2) * 2 - 1;
13150 Vector2 vector = new Vector2((float)num * (4f + (float)Main.rand.Next(3)), 0f);
13151 Vector2 vector2 = center + new Vector2(-num * 120, 0f);
13152 vector += (center + zero * 15f - vector2).SafeNormalize(Vector2.Zero) * 2f;
13154 }
void Add(TKey key, TValue value)
float Distance(Vector2 Other)
Definition Entity.cs:187
IEntitySource GetProjectileSource_FromThis()
static int NewProjectile(IEntitySource spawnSource, Vector2 position, Vector2 velocity, int Type, int Damage, float KnockBack, int Owner=-1, float ai0=0f, float ai1=0f, float ai2=0f)

References Terraria.Projectile.damage, Terraria.Entity.Distance(), Terraria.Projectile.GetProjectileSource_FromThis(), System.list, Terraria.Projectile.localAI, Terraria.Projectile.NewProjectile(), Terraria.Main.npc, Terraria.Projectile.owner, Terraria.Main.rand, and Microsoft.Xna.Framework.Vector2.Zero.

Referenced by Terraria.Projectile.Damage().