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

◆ AI_178_FireExplosion()

void Terraria.Projectile.AI_178_FireExplosion ( )
inlineprivate

Definition at line 37248 of file Projectile.cs.

37249 {
37250 if (localAI[0] == 0f)
37251 {
37253 for (int i = 0; i < 4; i++)
37254 {
37255 int num = Dust.NewDust(new Vector2(position.X, position.Y), width, height, 31, 0f, 0f, 100, default(Color), 1.5f);
37256 Main.dust[num].position = base.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * width / 2f;
37257 }
37258 for (int j = 0; j < 30; j++)
37259 {
37260 int num2 = Dust.NewDust(new Vector2(position.X, position.Y), width, height, 6, 0f, 0f, 200, default(Color), 3.7f);
37261 Main.dust[num2].position = base.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * width / 2f;
37262 Main.dust[num2].noGravity = true;
37263 Main.dust[num2].velocity *= 3f;
37264 num2 = Dust.NewDust(new Vector2(position.X, position.Y), width, height, 6, 0f, 0f, 100, default(Color), 1.5f);
37265 Main.dust[num2].position = base.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * width / 2f;
37266 Main.dust[num2].velocity *= 2f;
37267 Main.dust[num2].noGravity = true;
37268 Main.dust[num2].fadeIn = 2.5f;
37269 }
37270 for (int k = 0; k < 10; k++)
37271 {
37272 int num3 = Dust.NewDust(new Vector2(position.X, position.Y), width, height, 6, 0f, 0f, 0, default(Color), 2.7f);
37273 Main.dust[num3].position = base.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy(velocity.ToRotation()) * width / 2f;
37274 Main.dust[num3].noGravity = true;
37275 Main.dust[num3].velocity *= 3f;
37276 }
37277 for (int l = 0; l < 10; l++)
37278 {
37279 int num4 = Dust.NewDust(new Vector2(position.X, position.Y), width, height, 31, 0f, 0f, 0, default(Color), 1.5f);
37280 Main.dust[num4].position = base.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy(velocity.ToRotation()) * width / 2f;
37281 Main.dust[num4].noGravity = true;
37282 Main.dust[num4].velocity *= 3f;
37283 }
37284 for (int m = 0; m < 2; m++)
37285 {
37286 int num5 = Gore.NewGore(position + new Vector2((float)(width * Main.rand.Next(100)) / 100f, (float)(height * Main.rand.Next(100)) / 100f) - Vector2.One * 10f, default(Vector2), Main.rand.Next(61, 64));
37287 Main.gore[num5].position = base.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * width / 2f;
37288 Main.gore[num5].velocity *= 0.3f;
37289 Main.gore[num5].velocity.X += (float)Main.rand.Next(-10, 11) * 0.05f;
37290 Main.gore[num5].velocity.Y += (float)Main.rand.Next(-10, 11) * 0.05f;
37291 }
37292 }
37293 localAI[0] += 1f;
37294 if (localAI[0] >= 10f)
37295 {
37296 Kill();
37297 }
37298 }
static void PlaySound(int type, Vector2 position, int style=1)
Vector2 velocity
Definition Entity.cs:16
Vector2 position
Definition Entity.cs:14
static readonly LegacySoundStyle Item14
Definition SoundID.cs:442

References Terraria.Main.dust, Terraria.Main.gore, Terraria.ID.SoundID.Item14, Terraria.Dust.NewDust(), Terraria.Gore.NewGore(), Terraria.Audio.SoundEngine.PlaySound(), Terraria.Main.rand, Microsoft.Xna.Framework.Vector2.UnitX, Microsoft.Xna.Framework.Vector2.UnitY, Microsoft.Xna.Framework.Vector2.X, and Microsoft.Xna.Framework.Vector2.Y.