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

◆ AI_151_SuperStar()

void Terraria.Projectile.AI_151_SuperStar ( )
inlineprivate

Definition at line 18515 of file Projectile.cs.

18516 {
18517 alpha -= 10;
18518 int num = 100;
18519 if (alpha < num)
18520 {
18521 alpha = num;
18522 }
18523 if (soundDelay == 0)
18524 {
18525 soundDelay = 20 + Main.rand.Next(40);
18527 }
18528 rotation += (Math.Abs(velocity.X) + Math.Abs(velocity.Y)) * 0.005f * (float)direction;
18529 Vector2 vector = new Vector2(Main.screenWidth, Main.screenHeight);
18530 if (base.Hitbox.Intersects(Utils.CenteredRectangle(Main.screenPosition + vector / 2f, vector + new Vector2(400f))) && Main.rand.Next(6) == 0)
18531 {
18532 Gore.NewGore(position, velocity * 0.2f, Utils.SelectRandom<int>(Main.rand, 16, 17, 17, 17));
18533 }
18534 for (int i = 0; i < 2; i++)
18535 {
18536 if (Main.rand.Next(8) == 0)
18537 {
18538 int num2 = 228;
18539 Dust dust = Dust.NewDustDirect(position, width, height, num2, 0f, 0f, 127);
18540 dust.velocity *= 0.25f;
18541 dust.scale = 1.3f;
18542 dust.noGravity = true;
18543 dust.velocity += velocity.RotatedBy((float)Math.PI / 8f * (1f - (float)(2 * i))) * 0.2f;
18544 }
18545 }
18546 }
static double Abs(double value)
const double PI
Definition Math.cs:16
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 Item9
Definition SoundID.cs:432

References System.Math.Abs(), Terraria.Projectile.alpha, Terraria.Utils.CenteredRectangle(), Terraria.Entity.direction, Terraria.Entity.height, Terraria.ID.SoundID.Item9, Terraria.Dust.NewDustDirect(), Terraria.Gore.NewGore(), System.Math.PI, Terraria.Audio.SoundEngine.PlaySound(), Terraria.Entity.position, Terraria.Main.rand, Terraria.Projectile.rotation, Terraria.Main.screenHeight, Terraria.Main.screenPosition, Terraria.Main.screenWidth, Terraria.Projectile.soundDelay, Terraria.Entity.velocity, Terraria.Entity.width, Microsoft.Xna.Framework.Vector2.X, and Microsoft.Xna.Framework.Vector2.Y.