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

◆ AI_188_LightsBane()

void Terraria.Projectile.AI_188_LightsBane ( )
inlineprivate

Definition at line 34342 of file Projectile.cs.

34343 {
34344 if (soundDelay == 0)
34345 {
34346 soundDelay = -1;
34347 SoundEffectInstance soundEffectInstance = SoundEngine.PlaySound(SoundID.Item60, base.Center);
34348 if (soundEffectInstance != null)
34349 {
34350 soundEffectInstance.Volume *= 0.15f * ai[0];
34351 }
34352 }
34353 scale = ai[0];
34354 localAI[0] += 1f;
34355 if (++frameCounter >= 3)
34356 {
34357 frameCounter = 0;
34358 if (++frame >= 12)
34359 {
34360 Kill();
34361 return;
34362 }
34363 }
34364 rotation = velocity.ToRotation();
34365 float f = rotation;
34366 float num = 46f * scale;
34367 Vector2 vector = f.ToRotationVector2();
34368 float num2 = localAI[0] / 36f * 4f;
34369 if (num2 >= 0f && num2 <= 1f)
34370 {
34371 Dust dust = Dust.NewDustPerfect(Vector2.Lerp(base.Center - vector * num, base.Center + vector * num, localAI[0] / 36f), 278, vector.RotatedBy((float)Math.PI * 2f * Main.rand.NextFloatDirection() * 0.02f) * 8f * Main.rand.NextFloat(), 0, new Color(60, 0, 150), 0.7f * num2);
34372 dust.noGravity = true;
34373 dust.noLight = (dust.noLightEmittence = true);
34374 }
34375 }
const double PI
Definition Math.cs:16
static void PlaySound(int type, Vector2 position, int style=1)
Vector2 velocity
Definition Entity.cs:16
static readonly LegacySoundStyle Item60
Definition SoundID.cs:534
static Vector2 Lerp(Vector2 value1, Vector2 value2, float amount)
Definition Vector2.cs:227

References Terraria.ID.SoundID.Item60, Microsoft.Xna.Framework.Vector2.Lerp(), Terraria.Dust.NewDustPerfect(), System.Math.PI, Terraria.Audio.SoundEngine.PlaySound(), and Terraria.Main.rand.