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

◆ AI_191_TrueNightsEdge()

void Terraria.Projectile.AI_191_TrueNightsEdge ( )
inlineprivate

Definition at line 42828 of file Projectile.cs.

42829 {
42830 //IL_0072: Unknown result type (might be due to invalid IL or missing references)
42831 //IL_057b: Unknown result type (might be due to invalid IL or missing references)
42832 //IL_033f: Unknown result type (might be due to invalid IL or missing references)
42833 //IL_0346: Unknown result type (might be due to invalid IL or missing references)
42834 //IL_034c: Unknown result type (might be due to invalid IL or missing references)
42835 //IL_0351: Unknown result type (might be due to invalid IL or missing references)
42836 //IL_0357: Unknown result type (might be due to invalid IL or missing references)
42837 //IL_035e: Unknown result type (might be due to invalid IL or missing references)
42838 //IL_0365: Unknown result type (might be due to invalid IL or missing references)
42839 //IL_036c: Unknown result type (might be due to invalid IL or missing references)
42840 //IL_0371: Unknown result type (might be due to invalid IL or missing references)
42841 //IL_0405: Unknown result type (might be due to invalid IL or missing references)
42842 //IL_040c: Unknown result type (might be due to invalid IL or missing references)
42843 //IL_0416: Unknown result type (might be due to invalid IL or missing references)
42844 //IL_0421: Unknown result type (might be due to invalid IL or missing references)
42845 //IL_0426: Unknown result type (might be due to invalid IL or missing references)
42846 //IL_042b: Unknown result type (might be due to invalid IL or missing references)
42847 //IL_0217: Unknown result type (might be due to invalid IL or missing references)
42848 //IL_07d9: Unknown result type (might be due to invalid IL or missing references)
42849 //IL_07e0: Unknown result type (might be due to invalid IL or missing references)
42850 //IL_07ea: Unknown result type (might be due to invalid IL or missing references)
42851 //IL_07f5: Unknown result type (might be due to invalid IL or missing references)
42852 //IL_07fa: Unknown result type (might be due to invalid IL or missing references)
42853 //IL_07ff: Unknown result type (might be due to invalid IL or missing references)
42854 //IL_0812: Unknown result type (might be due to invalid IL or missing references)
42855 //IL_0836: Unknown result type (might be due to invalid IL or missing references)
42856 //IL_0841: Unknown result type (might be due to invalid IL or missing references)
42857 //IL_084b: Unknown result type (might be due to invalid IL or missing references)
42858 //IL_0856: Unknown result type (might be due to invalid IL or missing references)
42859 //IL_085b: Unknown result type (might be due to invalid IL or missing references)
42860 //IL_0862: Unknown result type (might be due to invalid IL or missing references)
42861 //IL_0647: Unknown result type (might be due to invalid IL or missing references)
42862 //IL_0651: Unknown result type (might be due to invalid IL or missing references)
42863 //IL_0656: Unknown result type (might be due to invalid IL or missing references)
42864 //IL_0665: Unknown result type (might be due to invalid IL or missing references)
42865 //IL_043a: Unknown result type (might be due to invalid IL or missing references)
42866 //IL_044f: Unknown result type (might be due to invalid IL or missing references)
42867 //IL_0455: Unknown result type (might be due to invalid IL or missing references)
42868 //IL_0230: Unknown result type (might be due to invalid IL or missing references)
42869 //IL_0246: Unknown result type (might be due to invalid IL or missing references)
42870 //IL_024e: Unknown result type (might be due to invalid IL or missing references)
42871 //IL_0258: Unknown result type (might be due to invalid IL or missing references)
42872 //IL_0263: Unknown result type (might be due to invalid IL or missing references)
42873 //IL_0268: Unknown result type (might be due to invalid IL or missing references)
42874 //IL_026d: Unknown result type (might be due to invalid IL or missing references)
42875 //IL_0270: Unknown result type (might be due to invalid IL or missing references)
42876 //IL_0286: Unknown result type (might be due to invalid IL or missing references)
42877 //IL_028e: Unknown result type (might be due to invalid IL or missing references)
42878 //IL_0299: Unknown result type (might be due to invalid IL or missing references)
42879 //IL_029e: Unknown result type (might be due to invalid IL or missing references)
42880 //IL_02a3: Unknown result type (might be due to invalid IL or missing references)
42881 //IL_02a6: Unknown result type (might be due to invalid IL or missing references)
42882 //IL_047b: Unknown result type (might be due to invalid IL or missing references)
42883 //IL_0480: Unknown result type (might be due to invalid IL or missing references)
42884 //IL_0485: Unknown result type (might be due to invalid IL or missing references)
42885 //IL_048a: Unknown result type (might be due to invalid IL or missing references)
42886 //IL_02b4: Unknown result type (might be due to invalid IL or missing references)
42887 //IL_02b8: Unknown result type (might be due to invalid IL or missing references)
42888 //IL_088f: Unknown result type (might be due to invalid IL or missing references)
42889 //IL_0891: Unknown result type (might be due to invalid IL or missing references)
42890 //IL_08af: Unknown result type (might be due to invalid IL or missing references)
42891 //IL_08b4: Unknown result type (might be due to invalid IL or missing references)
42892 //IL_08d5: Unknown result type (might be due to invalid IL or missing references)
42893 //IL_08da: Unknown result type (might be due to invalid IL or missing references)
42894 //IL_08ef: Unknown result type (might be due to invalid IL or missing references)
42895 //IL_08f5: Unknown result type (might be due to invalid IL or missing references)
42896 //IL_08fa: Unknown result type (might be due to invalid IL or missing references)
42897 //IL_0904: Unknown result type (might be due to invalid IL or missing references)
42898 //IL_0912: Unknown result type (might be due to invalid IL or missing references)
42899 //IL_0918: Unknown result type (might be due to invalid IL or missing references)
42900 //IL_0920: Unknown result type (might be due to invalid IL or missing references)
42901 //IL_094e: Unknown result type (might be due to invalid IL or missing references)
42902 //IL_0955: Unknown result type (might be due to invalid IL or missing references)
42903 //IL_095f: Unknown result type (might be due to invalid IL or missing references)
42904 //IL_0964: Unknown result type (might be due to invalid IL or missing references)
42905 //IL_0969: Unknown result type (might be due to invalid IL or missing references)
42906 //IL_0971: Unknown result type (might be due to invalid IL or missing references)
42907 //IL_0978: Unknown result type (might be due to invalid IL or missing references)
42908 //IL_0982: Unknown result type (might be due to invalid IL or missing references)
42909 //IL_0987: Unknown result type (might be due to invalid IL or missing references)
42910 //IL_098c: Unknown result type (might be due to invalid IL or missing references)
42911 //IL_09be: Unknown result type (might be due to invalid IL or missing references)
42912 //IL_09c8: Unknown result type (might be due to invalid IL or missing references)
42913 //IL_09cd: Unknown result type (might be due to invalid IL or missing references)
42914 //IL_07a5: Unknown result type (might be due to invalid IL or missing references)
42915 //IL_07af: Unknown result type (might be due to invalid IL or missing references)
42916 //IL_07b4: Unknown result type (might be due to invalid IL or missing references)
42917 //IL_0780: Unknown result type (might be due to invalid IL or missing references)
42918 //IL_078a: Unknown result type (might be due to invalid IL or missing references)
42919 //IL_078f: Unknown result type (might be due to invalid IL or missing references)
42920 //IL_06ab: Unknown result type (might be due to invalid IL or missing references)
42921 //IL_06c5: Unknown result type (might be due to invalid IL or missing references)
42922 //IL_06cc: Unknown result type (might be due to invalid IL or missing references)
42923 //IL_06d6: Unknown result type (might be due to invalid IL or missing references)
42924 //IL_06e1: Unknown result type (might be due to invalid IL or missing references)
42925 //IL_06e6: Unknown result type (might be due to invalid IL or missing references)
42926 //IL_06ec: Unknown result type (might be due to invalid IL or missing references)
42927 //IL_0706: Unknown result type (might be due to invalid IL or missing references)
42928 //IL_070d: Unknown result type (might be due to invalid IL or missing references)
42929 //IL_0718: Unknown result type (might be due to invalid IL or missing references)
42930 //IL_071d: Unknown result type (might be due to invalid IL or missing references)
42931 //IL_0722: Unknown result type (might be due to invalid IL or missing references)
42932 //IL_0726: Unknown result type (might be due to invalid IL or missing references)
42933 //IL_04a6: Unknown result type (might be due to invalid IL or missing references)
42934 //IL_04ab: Unknown result type (might be due to invalid IL or missing references)
42935 //IL_04b5: Unknown result type (might be due to invalid IL or missing references)
42936 //IL_04ba: Unknown result type (might be due to invalid IL or missing references)
42937 //IL_04c1: Unknown result type (might be due to invalid IL or missing references)
42938 //IL_04c6: Unknown result type (might be due to invalid IL or missing references)
42939 //IL_04d4: Unknown result type (might be due to invalid IL or missing references)
42940 //IL_04da: Unknown result type (might be due to invalid IL or missing references)
42941 //IL_0a15: Unknown result type (might be due to invalid IL or missing references)
42942 //IL_0a1f: Unknown result type (might be due to invalid IL or missing references)
42943 //IL_0a24: Unknown result type (might be due to invalid IL or missing references)
42944 //IL_0a64: Unknown result type (might be due to invalid IL or missing references)
42945 //IL_0a6b: Unknown result type (might be due to invalid IL or missing references)
42946 //IL_0a75: Unknown result type (might be due to invalid IL or missing references)
42947 //IL_0a80: Unknown result type (might be due to invalid IL or missing references)
42948 //IL_0a85: Unknown result type (might be due to invalid IL or missing references)
42949 //IL_0a8a: Unknown result type (might be due to invalid IL or missing references)
42950 //IL_0a8c: Unknown result type (might be due to invalid IL or missing references)
42951 //IL_0a8e: Unknown result type (might be due to invalid IL or missing references)
42952 //IL_0aac: Unknown result type (might be due to invalid IL or missing references)
42953 //IL_0ab1: Unknown result type (might be due to invalid IL or missing references)
42954 //IL_0ad2: Unknown result type (might be due to invalid IL or missing references)
42955 //IL_0ad7: Unknown result type (might be due to invalid IL or missing references)
42956 //IL_0aec: Unknown result type (might be due to invalid IL or missing references)
42957 //IL_0af2: Unknown result type (might be due to invalid IL or missing references)
42958 //IL_0af7: Unknown result type (might be due to invalid IL or missing references)
42959 //IL_0b07: Unknown result type (might be due to invalid IL or missing references)
42960 //IL_0b0d: Unknown result type (might be due to invalid IL or missing references)
42961 //IL_0b0f: Unknown result type (might be due to invalid IL or missing references)
42962 //IL_0b19: Unknown result type (might be due to invalid IL or missing references)
42963 //IL_0b28: Unknown result type (might be due to invalid IL or missing references)
42964 //IL_0b36: Unknown result type (might be due to invalid IL or missing references)
42965 //IL_0b3c: Unknown result type (might be due to invalid IL or missing references)
42966 //IL_0b50: Unknown result type (might be due to invalid IL or missing references)
42967 //IL_0b57: Unknown result type (might be due to invalid IL or missing references)
42968 //IL_0b61: Unknown result type (might be due to invalid IL or missing references)
42969 //IL_0b66: Unknown result type (might be due to invalid IL or missing references)
42970 //IL_0b6b: Unknown result type (might be due to invalid IL or missing references)
42971 //IL_0b73: Unknown result type (might be due to invalid IL or missing references)
42972 //IL_0b7a: Unknown result type (might be due to invalid IL or missing references)
42973 //IL_0b89: Unknown result type (might be due to invalid IL or missing references)
42974 //IL_0b93: Unknown result type (might be due to invalid IL or missing references)
42975 //IL_0b98: Unknown result type (might be due to invalid IL or missing references)
42976 //IL_0b9d: Unknown result type (might be due to invalid IL or missing references)
42977 float num = 50f;
42978 float num9 = 15f;
42979 float num10 = ai[1] + num;
42980 float num11 = num10 + num9;
42981 float num12 = 77f;
42982 if (type == 985)
42983 {
42984 num = 0f;
42985 num10 = ai[1];
42986 num11 = ai[1] + 25f;
42987 num12 = num11;
42988 }
42989 if (localAI[0] == 0f && type == 973)
42990 {
42992 }
42993 localAI[0] += 1f;
42994 if (type == 985 && localAI[1] == 1f)
42995 {
42996 localAI[0] += 2f;
42997 }
42998 if (type == 973 && damage == 0 && localAI[0] < MathHelper.Lerp(num10, num11, 0.5f))
42999 {
43000 localAI[0] += 6f;
43001 }
43002 Opacity = Utils.Remap(localAI[0], 0f, ai[1], 0f, 1f) * Utils.Remap(localAI[0], num10, num11, 1f, 0f);
43003 if (localAI[0] >= num11)
43004 {
43005 localAI[1] = 1f;
43006 Kill();
43007 return;
43008 }
43009 Player player = Main.player[owner];
43010 float fromValue = localAI[0] / ai[1];
43011 float num13 = Utils.Remap(localAI[0], ai[1] * 0.4f, num11, 0f, 1f);
43012 direction = (spriteDirection = (int)ai[0]);
43013 if (type == 973)
43014 {
43015 int num14 = 3;
43016 if (damage != 0 && localAI[0] >= num12 + (float)num14)
43017 {
43018 damage = 0;
43019 }
43020 if (damage != 0)
43021 {
43022 int num15 = 80;
43023 bool flag = false;
43024 float num16 = velocity.ToRotation();
43025 for (float num2 = -1f; num2 <= 1f; num2 += 0.5f)
43026 {
43027 Vector2 position = base.Center + (num16 + num2 * ((float)Math.PI / 4f) * 0.25f).ToRotationVector2() * (float)num15 * 0.5f * scale;
43028 Vector2 position2 = base.Center + (num16 + num2 * ((float)Math.PI / 4f) * 0.25f).ToRotationVector2() * (float)num15 * scale;
43029 if (!Collision.SolidTiles(base.Center, 0, 0) && Collision.CanHit(position, 0, 0, position2, 0, 0))
43030 {
43031 flag = true;
43032 break;
43033 }
43034 }
43035 if (!flag)
43036 {
43037 damage = 0;
43038 }
43039 }
43040 fromValue = localAI[0] / ai[1];
43041 localAI[1] += 1f;
43042 num13 = Utils.Remap(localAI[1], ai[1] * 0.4f, num11, 0f, 1f);
43043 base.Center = player.RotatedRelativePoint(player.MountedCenter) - velocity + velocity * num13 * num13 * num12;
43044 rotation += ai[0] * ((float)Math.PI * 2f) * (4f + Opacity * 4f) / 90f;
43045 scale = Utils.Remap(localAI[0], ai[1] + 2f, num11, 1.12f, 1f) * ai[2];
43046 float f = rotation + Main.rand.NextFloatDirection() * ((float)Math.PI / 2f) * 0.7f;
43047 Vector2 vector = base.Center + f.ToRotationVector2() * 84f * scale;
43048 if (Main.rand.Next(5) == 0)
43049 {
43050 Dust dust5 = Dust.NewDustPerfect(vector, 14, null, 150, default(Color), 1.4f);
43051 dust5.noLight = (dust5.noLightEmittence = true);
43052 }
43053 for (int i = 0; (float)i < 3f * Opacity; i++)
43054 {
43055 Vector2 vector2 = velocity.SafeNormalize(Vector2.UnitX);
43056 int num3 = ((Main.rand.NextFloat() < Opacity) ? 75 : 27);
43057 Dust dust6 = Dust.NewDustPerfect(vector, num3, velocity * 0.2f + vector2 * 3f, 100, default(Color), 1.4f);
43058 dust6.noGravity = true;
43059 dust6.customData = Opacity * 0.2f;
43060 }
43061 }
43062 if (type != 985)
43063 {
43064 return;
43065 }
43066 ownerHitCheck = localAI[0] <= 6f;
43067 if (localAI[0] >= MathHelper.Lerp(num10, num11, 0.65f))
43068 {
43069 damage = 0;
43070 }
43071 float fromValue2 = 1f - (1f - num13) * (1f - num13);
43072 rotation = velocity.ToRotation();
43073 scale = Utils.Remap(fromValue2, 0f, 1f, 1.5f, 1f) * ai[2];
43074 num13 = Utils.Remap(localAI[0], ai[1] / 2f, num11, 0f, 1f);
43075 Opacity = Utils.Remap(localAI[0], 0f, ai[1] * 0.5f, 0f, 1f) * Utils.Remap(localAI[0], num11 - 12f, num11, 1f, 0f);
43076 if (((Vector2)(ref velocity)).Length() > 8f)
43077 {
43078 velocity *= 0.94f;
43079 new Vector2(32f, 32f);
43080 float num4 = Utils.Remap(fromValue, 0.7f, 1f, 110f, 110f);
43081 if (localAI[1] == 0f)
43082 {
43083 bool flag2 = false;
43084 for (float num5 = -1f; num5 <= 1f; num5 += 0.5f)
43085 {
43086 Vector2 position4 = base.Center + (rotation + num5 * ((float)Math.PI / 4f) * 0.25f).ToRotationVector2() * num4 * 0.5f * scale;
43087 Vector2 position3 = base.Center + (rotation + num5 * ((float)Math.PI / 4f) * 0.25f).ToRotationVector2() * num4 * scale;
43088 if (Collision.CanHit(position4, 0, 0, position3, 0, 0))
43089 {
43090 flag2 = true;
43091 break;
43092 }
43093 }
43094 if (!flag2)
43095 {
43096 localAI[1] = 1f;
43097 }
43098 }
43099 if (localAI[1] == 1f && ((Vector2)(ref velocity)).Length() > 8f)
43100 {
43101 velocity *= 0.8f;
43102 }
43103 if (localAI[1] == 1f)
43104 {
43105 velocity *= 0.88f;
43106 }
43107 }
43108 float num6 = rotation + Main.rand.NextFloatDirection() * ((float)Math.PI / 2f) * 0.9f;
43109 Vector2 vector3 = base.Center + num6.ToRotationVector2() * 85f * scale;
43110 (num6 + ai[0] * ((float)Math.PI / 2f)).ToRotationVector2();
43111 Color value = default(Color);
43112 ((Color)(ref value))._002Ector(64, 220, 96);
43113 Color value2 = default(Color);
43114 ((Color)(ref value2))._002Ector(15, 84, 125);
43115 Lighting.AddLight(base.Center + rotation.ToRotationVector2() * 85f * scale, ((Color)(ref value)).ToVector3());
43116 for (int j = 0; j < 3; j++)
43117 {
43118 if (Main.rand.NextFloat() < Opacity + 0.1f)
43119 {
43120 Color.Lerp(Color.Lerp(Color.Lerp(value2, value, Utils.Remap(fromValue, 0f, 0.6f, 0f, 1f)), Color.White, Utils.Remap(fromValue, 0.6f, 0.8f, 0f, 0.5f)), Color.White, Main.rand.NextFloat() * 0.3f);
43121 Dust dust3 = Dust.NewDustPerfect(vector3, 107, velocity * 0.7f, 100, default(Color) * Opacity, 0.8f * Opacity);
43122 dust3.scale *= 0.7f;
43123 dust3.velocity += player.velocity * 0.1f;
43124 dust3.position -= dust3.velocity * 6f;
43125 }
43126 }
43127 if (damage == 0)
43128 {
43129 localAI[0] += 3f;
43130 velocity *= 0.76f;
43131 }
43132 if (localAI[0] < 10f && (localAI[1] == 1f || damage == 0))
43133 {
43134 localAI[0] += 1f;
43135 velocity *= 0.85f;
43136 for (int k = 0; k < 4; k++)
43137 {
43138 float num7 = Main.rand.NextFloatDirection();
43139 float num8 = 1f - Math.Abs(num7);
43140 num6 = rotation + num7 * ((float)Math.PI / 2f) * 0.9f;
43141 vector3 = base.Center + num6.ToRotationVector2() * 85f * scale;
43142 Color.Lerp(Color.Lerp(Color.Lerp(value2, value, Utils.Remap(fromValue, 0f, 0.6f, 0f, 1f)), Color.White, Utils.Remap(fromValue, 0.6f, 0.8f, 0f, 0.5f)), Color.White, Main.rand.NextFloat() * 0.3f);
43143 Dust dust4 = Dust.NewDustPerfect(vector3, 107, velocity.RotatedBy(num7 * ((float)Math.PI / 4f)) * 0.2f * Main.rand.NextFloat(), 100, default(Color), 1.4f * num8);
43144 dust4.velocity += player.velocity * 0.1f;
43145 dust4.position -= dust4.velocity * Main.rand.NextFloat() * 3f;
43146 }
43147 }
43148 }
static SlotId PlaySound(in SoundStyle? style, Vector2? position=null, SoundUpdateCallback? updateCallback=null)
Attempts to play a sound style with the provided sound style (if it's not null), and returns a valid ...
Vector2 velocity
The velocity of this Entity in world coordinates per tick.
Definition Entity.cs:33
Vector2 position
The position of this Entity in world coordinates.
Definition Entity.cs:28
static readonly SoundStyle Item8
Definition SoundID.cs:693
int owner
The index of the player who owns this projectile. In Multiplayer, Clients "own" projectiles that they...
int damage
This will always be set in Projectile.NewProjectile based on the weapons damage and player stat modif...
float[] ai
An array with 3 slots used for any sort of data storage, which is occasionally synced to the server....
float[] localAI
Acts like F:Terraria.Projectile.ai, but does not sync to the server. Many vanilla T:Terraria....
int type
The Projectile ID of this projectile. The Projectile ID is a unique number assigned to each Projectil...
bool ownerHitCheck
If true, then this projectile will only deal damage if its owner has line of sight to the hit....
float rotation
Rotation of the projectile. Radians not Degrees. Use T:Microsoft.Xna.Framework.MathHelper if you want...
float scale
Scales how large the projectile will be drawn. Will also affect the hitbox (F:Terraria....

References Terraria.Lighting.AddLight(), Terraria.Collision.CanHit(), Terraria.ID.SoundID.Item8, Terraria.Player.MountedCenter, Terraria.Dust.NewDustPerfect(), Terraria.Main.player, Terraria.Audio.SoundEngine.PlaySound(), Terraria.Main.rand, Terraria.Utils.Remap(), Terraria.Player.RotatedRelativePoint(), and Terraria.Collision.SolidTiles().

+ Here is the call graph for this function: