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

◆ AI_120_HallowBoss_DoMagicEffect()

void Terraria.NPC.AI_120_HallowBoss_DoMagicEffect ( Vector2 spot,
int effectType,
float progress )
inlineprivate

Definition at line 39028 of file NPC.cs.

39029 {
39030 float num = 4f;
39031 float num2 = 1f;
39032 float fadeIn = 0f;
39033 float num3 = 0.5f;
39034 int num4 = 2;
39035 int num5 = 267;
39036 switch (effectType)
39037 {
39038 case 1:
39039 num2 = 0.5f;
39040 fadeIn = 2f;
39041 num3 = 0f;
39042 break;
39043 case 2:
39044 case 4:
39045 num = 50f;
39046 num2 = 0.5f;
39047 fadeIn = 0f;
39048 num3 = 0f;
39049 num4 = 4;
39050 break;
39051 case 3:
39052 num = 30f;
39053 num2 = 0.1f;
39054 fadeIn = 2.5f;
39055 num3 = 0f;
39056 break;
39057 case 5:
39058 if (progress == 0f)
39059 {
39060 num4 = 0;
39061 }
39062 else
39063 {
39064 num4 = 5;
39065 num5 = Main.rand.Next(86, 92);
39066 }
39067 if (progress >= 1f)
39068 {
39069 num4 = 0;
39070 }
39071 break;
39072 }
39073 for (int i = 0; i < num4; i++)
39074 {
39075 Dust dust = Dust.NewDustPerfect(spot, num5, Main.rand.NextVector2CircularEdge(num, num) * (Main.rand.NextFloat() * (1f - num3) + num3), 0, Main.hslToRgb(Main.rand.NextFloat(), 1f, 0.5f), (Main.rand.NextFloat() * 2f + 2f) * num2);
39076 dust.fadeIn = fadeIn;
39077 dust.noGravity = true;
39078 switch (effectType)
39079 {
39080 case 2:
39081 case 4:
39082 {
39083 dust.velocity *= 0.005f;
39084 dust.scale = 3f * Utils.GetLerpValue(0.7f, 0f, progress, clamped: true) * Utils.GetLerpValue(0f, 0.3f, progress, clamped: true);
39085 dust.velocity = ((float)Math.PI * 2f * ((float)i / 4f) + (float)Math.PI / 4f).ToRotationVector2() * 8f * Utils.GetLerpValue(1f, 0f, progress, clamped: true);
39086 dust.velocity += velocity * 0.3f;
39087 float num6 = 0f;
39088 if (effectType == 4)
39089 {
39090 num6 = 0.5f;
39091 }
39092 dust.color = Main.hslToRgb(((float)i / 5f + num6 + progress * 0.5f) % 1f, 1f, 0.5f);
39093 dust.color.A /= 2;
39094 dust.alpha = 127;
39095 break;
39096 }
39097 case 5:
39098 if (progress == 0f)
39099 {
39100 dust.customData = this;
39101 dust.scale = 1.5f;
39102 dust.fadeIn = 0f;
39103 dust.velocity = new Vector2(0f, -1f) + Main.rand.NextVector2Circular(1f, 1f);
39104 dust.color = new Color(255, 255, 255, 80) * 0.3f;
39105 }
39106 else
39107 {
39108 dust.color = Main.hslToRgb(progress * 2f % 1f, 1f, 0.5f);
39109 dust.alpha = 0;
39110 dust.scale = 1f;
39111 dust.fadeIn = 1.3f;
39112 dust.velocity *= 3f;
39113 dust.velocity.X *= 0.1f;
39114 dust.velocity += velocity * 1f;
39115 }
39116 break;
39117 }
39118 }
39119 }
const double PI
Definition Math.cs:16
Vector2 velocity
Definition Entity.cs:16

References Microsoft.Xna.Framework.Graphics.Color, Terraria.Utils.GetLerpValue(), Terraria.Main.hslToRgb(), Terraria.Dust.NewDustPerfect(), System.Math.PI, Terraria.Main.rand, Microsoft.Xna.Framework.Graphics.Vector2, and Terraria.Entity.velocity.

Referenced by Terraria.NPC.AI_120_HallowBoss().