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

◆ AI_171_HallowBossRainbowStreak()

void Terraria.Projectile.AI_171_HallowBossRainbowStreak ( )
inlineprivate

Definition at line 47923 of file Projectile.cs.

47924 {
47925 //IL_0098: Unknown result type (might be due to invalid IL or missing references)
47926 //IL_009d: Unknown result type (might be due to invalid IL or missing references)
47927 //IL_017d: Unknown result type (might be due to invalid IL or missing references)
47928 //IL_0184: Unknown result type (might be due to invalid IL or missing references)
47929 //IL_0189: Unknown result type (might be due to invalid IL or missing references)
47930 //IL_0190: Unknown result type (might be due to invalid IL or missing references)
47931 //IL_01b2: Unknown result type (might be due to invalid IL or missing references)
47932 //IL_01b8: Unknown result type (might be due to invalid IL or missing references)
47933 //IL_01ba: Unknown result type (might be due to invalid IL or missing references)
47934 //IL_01bf: Unknown result type (might be due to invalid IL or missing references)
47935 //IL_00ad: Unknown result type (might be due to invalid IL or missing references)
47936 //IL_00c6: Unknown result type (might be due to invalid IL or missing references)
47937 //IL_00e1: Unknown result type (might be due to invalid IL or missing references)
47938 //IL_00ec: Unknown result type (might be due to invalid IL or missing references)
47939 //IL_0377: Unknown result type (might be due to invalid IL or missing references)
47940 //IL_024c: Unknown result type (might be due to invalid IL or missing references)
47941 //IL_0251: Unknown result type (might be due to invalid IL or missing references)
47942 //IL_0301: Unknown result type (might be due to invalid IL or missing references)
47943 //IL_0306: Unknown result type (might be due to invalid IL or missing references)
47944 //IL_030a: Unknown result type (might be due to invalid IL or missing references)
47945 //IL_030f: Unknown result type (might be due to invalid IL or missing references)
47946 //IL_0276: Unknown result type (might be due to invalid IL or missing references)
47947 //IL_027b: Unknown result type (might be due to invalid IL or missing references)
47948 //IL_0282: Unknown result type (might be due to invalid IL or missing references)
47949 //IL_0287: Unknown result type (might be due to invalid IL or missing references)
47950 //IL_0323: Unknown result type (might be due to invalid IL or missing references)
47951 //IL_034e: Unknown result type (might be due to invalid IL or missing references)
47952 //IL_0353: Unknown result type (might be due to invalid IL or missing references)
47953 //IL_02be: Unknown result type (might be due to invalid IL or missing references)
47954 //IL_02c3: Unknown result type (might be due to invalid IL or missing references)
47955 //IL_02ca: Unknown result type (might be due to invalid IL or missing references)
47956 //IL_02cf: Unknown result type (might be due to invalid IL or missing references)
47957 bool flag = false;
47958 bool flag2 = false;
47959 float num = 140f;
47960 float num2 = 30f;
47961 float num3 = 0.98f;
47962 float value = 0.05f;
47963 float value2 = 0.1f;
47964 float num4 = 30f;
47965 if (type == 931)
47966 {
47967 num = 180f;
47968 num2 = 20f;
47969 num4 = 30f;
47970 num3 = 0.97f;
47971 value = 0.075f;
47972 value2 = 0.125f;
47973 if (timeLeft == 238)
47974 {
47975 int num5 = alpha;
47976 alpha = 0;
47978 alpha = num5;
47979 for (int i = 0; i < 3; i++)
47980 {
47981 Dust dust = Dust.NewDustPerfect(base.Center, 267, Main.rand.NextVector2CircularEdge(3f, 3f) * (Main.rand.NextFloat() * 0.5f + 0.5f), 0, fairyQueenWeaponsColor);
47982 dust.scale *= 1.2f;
47983 dust.noGravity = true;
47984 }
47985 }
47986 }
47987 if ((float)timeLeft > num)
47988 {
47989 flag = true;
47990 }
47991 else if ((float)timeLeft > num2)
47992 {
47993 flag2 = true;
47994 }
47995 if (flag)
47996 {
47997 float num6 = (float)Math.Cos((float)whoAmI % 6f / 6f + position.X / 320f + position.Y / 160f);
47998 velocity *= num3;
47999 velocity = velocity.RotatedBy(num6 * ((float)Math.PI * 2f) * 0.125f * 1f / 30f);
48000 }
48001 if (friendly)
48002 {
48003 int num7 = (int)ai[0];
48004 if (Main.npc.IndexInRange(num7) && !Main.npc[num7].CanBeChasedBy(this))
48005 {
48006 num7 = -1;
48007 ai[0] = -1f;
48008 netUpdate = true;
48009 }
48010 if (num7 == -1)
48011 {
48013 if (num8 != -1)
48014 {
48015 num7 = num8;
48016 ai[0] = num8;
48017 netUpdate = true;
48018 }
48019 }
48020 }
48021 if (flag2)
48022 {
48023 int num9 = (int)ai[0];
48024 Vector2 value3 = velocity;
48025 if (hostile && Main.player.IndexInRange(num9))
48026 {
48027 Player player = Main.player[num9];
48028 value3 = DirectionTo(player.Center) * num4;
48029 }
48030 if (friendly)
48031 {
48032 if (Main.npc.IndexInRange(num9))
48033 {
48034 if (timeLeft < 10)
48035 {
48036 timeLeft = 10;
48037 }
48038 NPC nPC = Main.npc[num9];
48039 value3 = DirectionTo(nPC.Center) * num4;
48040 }
48041 else
48042 {
48043 timeLeft--;
48044 }
48045 }
48046 float amount = MathHelper.Lerp(value, value2, Utils.GetLerpValue(num, 30f, timeLeft, clamped: true));
48047 velocity = Vector2.SmoothStep(velocity, value3, amount);
48048 if (type == 931)
48049 {
48050 velocity *= MathHelper.Lerp(0.85f, 1f, Utils.GetLerpValue(0f, 90f, timeLeft, clamped: true));
48051 }
48052 }
48053 Opacity = Utils.GetLerpValue(240f, 220f, timeLeft, clamped: true);
48054 rotation = velocity.ToRotation() + (float)Math.PI / 2f;
48055 }
int whoAmI
The index of this Entity within its specific array. These arrays track the entities in the world....
Definition Entity.cs:16
Vector2 velocity
The velocity of this Entity in world coordinates per tick.
Definition Entity.cs:33
Vector2 DirectionTo(Vector2 Destination)
Definition Entity.cs:289
Color GetFairyQueenWeaponsColor(float alphaChannelMultiplier=1f, float lerpToWhite=0f, float? rawHueOverride=null)
float[] ai
An array with 3 slots used for any sort of data storage, which is occasionally synced to the server....
bool netUpdate
Set manually to true in M:Terraria.ModLoader.ModProjectile.AI once to make it sync its current F:Terr...
int alpha
How transparent to draw this projectile. 0 to 255. 255 is completely transparent. ExampleBulletsets...
int FindTargetWithLineOfSight(float maxRange=800f)
Finds the closest NPC to this projectile which can be targeted and which it has line of sight to.
bool friendly
If True, this projectile will hurt enemies (!F:Terraria.NPC.friendly) Defaults to false.
int type
The Projectile ID of this projectile. The Projectile ID is a unique number assigned to each Projectil...
int timeLeft
Time in ticks before this projectile will naturally despawn. Each update timeLeft is decreased by 1...
float rotation
Rotation of the projectile. Radians not Degrees. Use T:Microsoft.Xna.Framework.MathHelper if you want...
bool hostile
If True, this projectile will hurt players and friendly NPCs (F:Terraria.NPC.friendly) Defaults to ...

References Terraria.Entity.Center, Terraria.Utils.GetLerpValue(), Terraria.Dust.NewDustPerfect(), Terraria.Main.npc, Terraria.Main.player, and Terraria.Main.rand.

+ Here is the call graph for this function: