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

◆ AI_190_NightsEdge()

void Terraria.Projectile.AI_190_NightsEdge ( )
inlineprivate

Definition at line 43150 of file Projectile.cs.

43151 {
43152 //IL_008d: Unknown result type (might be due to invalid IL or missing references)
43153 //IL_0027: Unknown result type (might be due to invalid IL or missing references)
43154 //IL_0122: Unknown result type (might be due to invalid IL or missing references)
43155 //IL_0129: Unknown result type (might be due to invalid IL or missing references)
43156 //IL_012f: Unknown result type (might be due to invalid IL or missing references)
43157 //IL_0134: Unknown result type (might be due to invalid IL or missing references)
43158 //IL_0327: Unknown result type (might be due to invalid IL or missing references)
43159 //IL_032e: Unknown result type (might be due to invalid IL or missing references)
43160 //IL_0338: Unknown result type (might be due to invalid IL or missing references)
43161 //IL_0343: Unknown result type (might be due to invalid IL or missing references)
43162 //IL_0348: Unknown result type (might be due to invalid IL or missing references)
43163 //IL_034d: Unknown result type (might be due to invalid IL or missing references)
43164 //IL_0360: Unknown result type (might be due to invalid IL or missing references)
43165 //IL_0365: Unknown result type (might be due to invalid IL or missing references)
43166 //IL_01b6: Unknown result type (might be due to invalid IL or missing references)
43167 //IL_01bc: Unknown result type (might be due to invalid IL or missing references)
43168 //IL_01c1: Unknown result type (might be due to invalid IL or missing references)
43169 //IL_01c6: Unknown result type (might be due to invalid IL or missing references)
43170 //IL_01d3: Unknown result type (might be due to invalid IL or missing references)
43171 //IL_01d8: Unknown result type (might be due to invalid IL or missing references)
43172 //IL_01dd: Unknown result type (might be due to invalid IL or missing references)
43173 //IL_04a1: Unknown result type (might be due to invalid IL or missing references)
43174 //IL_04a8: Unknown result type (might be due to invalid IL or missing references)
43175 //IL_04b2: Unknown result type (might be due to invalid IL or missing references)
43176 //IL_04bd: Unknown result type (might be due to invalid IL or missing references)
43177 //IL_04c2: Unknown result type (might be due to invalid IL or missing references)
43178 //IL_04d9: Unknown result type (might be due to invalid IL or missing references)
43179 //IL_04de: Unknown result type (might be due to invalid IL or missing references)
43180 //IL_0383: Unknown result type (might be due to invalid IL or missing references)
43181 //IL_038a: Unknown result type (might be due to invalid IL or missing references)
43182 //IL_03b3: Unknown result type (might be due to invalid IL or missing references)
43183 //IL_03b8: Unknown result type (might be due to invalid IL or missing references)
43184 //IL_03c2: Unknown result type (might be due to invalid IL or missing references)
43185 //IL_03c9: Unknown result type (might be due to invalid IL or missing references)
43186 //IL_03d5: Unknown result type (might be due to invalid IL or missing references)
43187 //IL_03da: Unknown result type (might be due to invalid IL or missing references)
43188 //IL_03ef: Unknown result type (might be due to invalid IL or missing references)
43189 //IL_0227: Unknown result type (might be due to invalid IL or missing references)
43190 //IL_022e: Unknown result type (might be due to invalid IL or missing references)
43191 //IL_0238: Unknown result type (might be due to invalid IL or missing references)
43192 //IL_0243: Unknown result type (might be due to invalid IL or missing references)
43193 //IL_0248: Unknown result type (might be due to invalid IL or missing references)
43194 //IL_024d: Unknown result type (might be due to invalid IL or missing references)
43195 //IL_059b: Unknown result type (might be due to invalid IL or missing references)
43196 //IL_05a2: Unknown result type (might be due to invalid IL or missing references)
43197 //IL_05ac: Unknown result type (might be due to invalid IL or missing references)
43198 //IL_05b7: Unknown result type (might be due to invalid IL or missing references)
43199 //IL_05bc: Unknown result type (might be due to invalid IL or missing references)
43200 //IL_05c1: Unknown result type (might be due to invalid IL or missing references)
43201 //IL_05d4: Unknown result type (might be due to invalid IL or missing references)
43202 //IL_05d9: Unknown result type (might be due to invalid IL or missing references)
43203 //IL_04f9: Unknown result type (might be due to invalid IL or missing references)
43204 //IL_0500: Unknown result type (might be due to invalid IL or missing references)
43205 //IL_0529: Unknown result type (might be due to invalid IL or missing references)
43206 //IL_052e: Unknown result type (might be due to invalid IL or missing references)
43207 //IL_0534: Unknown result type (might be due to invalid IL or missing references)
43208 //IL_053b: Unknown result type (might be due to invalid IL or missing references)
43209 //IL_0548: Unknown result type (might be due to invalid IL or missing references)
43210 //IL_054e: Unknown result type (might be due to invalid IL or missing references)
43211 //IL_0438: Unknown result type (might be due to invalid IL or missing references)
43212 //IL_043c: Unknown result type (might be due to invalid IL or missing references)
43213 //IL_0443: Unknown result type (might be due to invalid IL or missing references)
43214 //IL_044f: Unknown result type (might be due to invalid IL or missing references)
43215 //IL_045a: Unknown result type (might be due to invalid IL or missing references)
43216 //IL_025c: Unknown result type (might be due to invalid IL or missing references)
43217 //IL_0271: Unknown result type (might be due to invalid IL or missing references)
43218 //IL_0277: Unknown result type (might be due to invalid IL or missing references)
43219 //IL_070f: Unknown result type (might be due to invalid IL or missing references)
43220 //IL_0716: Unknown result type (might be due to invalid IL or missing references)
43221 //IL_0720: Unknown result type (might be due to invalid IL or missing references)
43222 //IL_072b: Unknown result type (might be due to invalid IL or missing references)
43223 //IL_0730: Unknown result type (might be due to invalid IL or missing references)
43224 //IL_0735: Unknown result type (might be due to invalid IL or missing references)
43225 //IL_0748: Unknown result type (might be due to invalid IL or missing references)
43226 //IL_074d: Unknown result type (might be due to invalid IL or missing references)
43227 //IL_076d: Unknown result type (might be due to invalid IL or missing references)
43228 //IL_0774: Unknown result type (might be due to invalid IL or missing references)
43229 //IL_05f1: Unknown result type (might be due to invalid IL or missing references)
43230 //IL_05f8: Unknown result type (might be due to invalid IL or missing references)
43231 //IL_0621: Unknown result type (might be due to invalid IL or missing references)
43232 //IL_0626: Unknown result type (might be due to invalid IL or missing references)
43233 //IL_0630: Unknown result type (might be due to invalid IL or missing references)
43234 //IL_0637: Unknown result type (might be due to invalid IL or missing references)
43235 //IL_0643: Unknown result type (might be due to invalid IL or missing references)
43236 //IL_0648: Unknown result type (might be due to invalid IL or missing references)
43237 //IL_065d: Unknown result type (might be due to invalid IL or missing references)
43238 //IL_02a1: Unknown result type (might be due to invalid IL or missing references)
43239 //IL_02d1: Unknown result type (might be due to invalid IL or missing references)
43240 //IL_02df: Unknown result type (might be due to invalid IL or missing references)
43241 //IL_02e5: Unknown result type (might be due to invalid IL or missing references)
43242 //IL_0799: Unknown result type (might be due to invalid IL or missing references)
43243 //IL_079b: Unknown result type (might be due to invalid IL or missing references)
43244 //IL_07b8: Unknown result type (might be due to invalid IL or missing references)
43245 //IL_07bd: Unknown result type (might be due to invalid IL or missing references)
43246 //IL_07bf: Unknown result type (might be due to invalid IL or missing references)
43247 //IL_07c1: Unknown result type (might be due to invalid IL or missing references)
43248 //IL_07e1: Unknown result type (might be due to invalid IL or missing references)
43249 //IL_07e6: Unknown result type (might be due to invalid IL or missing references)
43250 //IL_07e9: Unknown result type (might be due to invalid IL or missing references)
43251 //IL_07f0: Unknown result type (might be due to invalid IL or missing references)
43252 //IL_0819: Unknown result type (might be due to invalid IL or missing references)
43253 //IL_081e: Unknown result type (might be due to invalid IL or missing references)
43254 //IL_0828: Unknown result type (might be due to invalid IL or missing references)
43255 //IL_082f: Unknown result type (might be due to invalid IL or missing references)
43256 //IL_083b: Unknown result type (might be due to invalid IL or missing references)
43257 //IL_083d: Unknown result type (might be due to invalid IL or missing references)
43258 //IL_0852: Unknown result type (might be due to invalid IL or missing references)
43259 //IL_06a6: Unknown result type (might be due to invalid IL or missing references)
43260 //IL_06aa: Unknown result type (might be due to invalid IL or missing references)
43261 //IL_06b1: Unknown result type (might be due to invalid IL or missing references)
43262 //IL_06bd: Unknown result type (might be due to invalid IL or missing references)
43263 //IL_06c8: Unknown result type (might be due to invalid IL or missing references)
43264 //IL_0898: Unknown result type (might be due to invalid IL or missing references)
43265 //IL_089a: Unknown result type (might be due to invalid IL or missing references)
43266 //IL_08b7: Unknown result type (might be due to invalid IL or missing references)
43267 //IL_08bc: Unknown result type (might be due to invalid IL or missing references)
43268 //IL_08dc: Unknown result type (might be due to invalid IL or missing references)
43269 //IL_08e1: Unknown result type (might be due to invalid IL or missing references)
43270 //IL_08f6: Unknown result type (might be due to invalid IL or missing references)
43271 //IL_08fc: Unknown result type (might be due to invalid IL or missing references)
43272 //IL_0900: Unknown result type (might be due to invalid IL or missing references)
43273 //IL_0907: Unknown result type (might be due to invalid IL or missing references)
43274 //IL_0915: Unknown result type (might be due to invalid IL or missing references)
43275 //IL_091b: Unknown result type (might be due to invalid IL or missing references)
43276 //IL_0923: Unknown result type (might be due to invalid IL or missing references)
43277 //IL_093e: Unknown result type (might be due to invalid IL or missing references)
43278 //IL_0944: Unknown result type (might be due to invalid IL or missing references)
43279 //IL_094e: Unknown result type (might be due to invalid IL or missing references)
43280 //IL_0953: Unknown result type (might be due to invalid IL or missing references)
43281 //IL_0958: Unknown result type (might be due to invalid IL or missing references)
43282 //IL_0960: Unknown result type (might be due to invalid IL or missing references)
43283 //IL_0971: Unknown result type (might be due to invalid IL or missing references)
43284 //IL_0976: Unknown result type (might be due to invalid IL or missing references)
43285 //IL_097b: Unknown result type (might be due to invalid IL or missing references)
43286 //IL_0983: Unknown result type (might be due to invalid IL or missing references)
43287 //IL_098a: Unknown result type (might be due to invalid IL or missing references)
43288 //IL_0994: Unknown result type (might be due to invalid IL or missing references)
43289 //IL_0999: Unknown result type (might be due to invalid IL or missing references)
43290 //IL_099e: Unknown result type (might be due to invalid IL or missing references)
43291 if (localAI[0] == 0f && type == 984)
43292 {
43293 SoundEffectInstance soundEffectInstance = SoundEngine.PlaySound((SoundStyle?)SoundID.Item60, (Vector2?)position);
43294 if (soundEffectInstance != null)
43295 {
43296 soundEffectInstance.Volume *= 0.65f;
43297 }
43298 }
43299 localAI[0] += 1f;
43300 Player player = Main.player[owner];
43301 float num = localAI[0] / ai[1];
43302 float num4 = ai[0];
43303 float num5 = velocity.ToRotation();
43304 float num6 = (float)Math.PI * num4 * num + num5 + num4 * (float)Math.PI + player.fullRotation;
43305 rotation = num6;
43306 float num7 = 0.2f;
43307 float num8 = 1f;
43308 switch (type)
43309 {
43310 case 982:
43311 num7 = 0.6f;
43312 break;
43313 case 997:
43314 num7 = 0.6f;
43315 break;
43316 case 983:
43317 num7 = 1f;
43318 num8 = 1.2f;
43319 break;
43320 case 984:
43321 num7 = 0.6f;
43322 break;
43323 }
43324 base.Center = player.RotatedRelativePoint(player.MountedCenter) - velocity;
43325 scale = num8 + num * num7;
43326 if (type == 972)
43327 {
43328 if (Math.Abs(num4) < 0.2f)
43329 {
43330 rotation += (float)Math.PI * 4f * num4 * 10f * num;
43331 float num9 = Utils.Remap(localAI[0], 10f, ai[1] - 5f, 0f, 1f);
43332 position += velocity.SafeNormalize(Vector2.Zero) * (45f * num9);
43333 scale += num9 * 0.4f;
43334 }
43335 if (Main.rand.Next(2) == 0)
43336 {
43337 float f = rotation + Main.rand.NextFloatDirection() * ((float)Math.PI / 2f) * 0.7f;
43338 Vector2 vector = base.Center + f.ToRotationVector2() * 84f * scale;
43339 if (Main.rand.Next(5) == 0)
43340 {
43341 Dust dust7 = Dust.NewDustPerfect(vector, 14, null, 150, default(Color), 1.4f);
43342 dust7.noLight = (dust7.noLightEmittence = true);
43343 }
43344 if (Main.rand.Next(2) == 0)
43345 {
43346 Dust.NewDustPerfect(vector, 27, (Vector2?)new Vector2(player.velocity.X * 0.2f + (float)(player.direction * 3), player.velocity.Y * 0.2f), 100, default(Color), 1.4f).noGravity = true;
43347 }
43348 }
43349 }
43350 if (type == 982)
43351 {
43352 float num10 = rotation + Main.rand.NextFloatDirection() * ((float)Math.PI / 2f) * 0.7f;
43353 Vector2 vector2 = base.Center + num10.ToRotationVector2() * 84f * scale;
43354 Vector2 vector3 = (num10 + ai[0] * ((float)Math.PI / 2f)).ToRotationVector2();
43355 if (Main.rand.NextFloat() * 2f < Opacity)
43356 {
43357 Dust dust8 = Dust.NewDustPerfect(base.Center + num10.ToRotationVector2() * (Main.rand.NextFloat() * 80f * scale + 20f * scale), 278, vector3 * 1f, 100, Color.Lerp(Color.Gold, Color.White, Main.rand.NextFloat() * 0.3f), 0.4f);
43358 dust8.fadeIn = 0.4f + Main.rand.NextFloat() * 0.15f;
43359 dust8.noGravity = true;
43360 }
43361 if (Main.rand.NextFloat() * 1.5f < Opacity)
43362 {
43363 Dust.NewDustPerfect(vector2, 43, vector3 * 1f, 100, Color.White * Opacity, 1.2f * Opacity);
43364 }
43365 }
43366 if (type == 997)
43367 {
43368 float num11 = rotation + Main.rand.NextFloatDirection() * ((float)Math.PI / 2f) * 0.7f;
43369 _ = base.Center + num11.ToRotationVector2() * 84f * scale;
43370 Vector2 vector4 = (num11 + ai[0] * ((float)Math.PI / 2f)).ToRotationVector2();
43371 if (Main.rand.NextFloat() * 2f < Opacity)
43372 {
43373 Dust dust9 = Dust.NewDustPerfect(base.Center + num11.ToRotationVector2() * (Main.rand.NextFloat() * 80f * scale + 20f * scale), 6, vector4 * 4f, 0, default(Color), 0.4f);
43374 dust9.noGravity = true;
43375 dust9.scale = 1.4f;
43376 }
43377 }
43378 if (type == 983)
43379 {
43380 float num2 = rotation + Main.rand.NextFloatDirection() * ((float)Math.PI / 2f) * 0.7f;
43381 Vector2 vector5 = base.Center + num2.ToRotationVector2() * 84f * scale;
43382 Vector2 vector6 = (num2 + ai[0] * ((float)Math.PI / 2f)).ToRotationVector2();
43383 if (Main.rand.NextFloat() < Opacity)
43384 {
43385 Dust dust10 = Dust.NewDustPerfect(base.Center + num2.ToRotationVector2() * (Main.rand.NextFloat() * 80f * scale + 20f * scale), 278, vector6 * 1f, 100, Color.Lerp(Color.HotPink, Color.White, Main.rand.NextFloat() * 0.3f), 0.4f);
43386 dust10.fadeIn = 0.4f + Main.rand.NextFloat() * 0.15f;
43387 dust10.noGravity = true;
43388 }
43389 if (Main.rand.NextFloat() * 1.5f < Opacity)
43390 {
43391 Dust.NewDustPerfect(vector5, 43, vector6 * 1f, 100, Color.White * Opacity, 1.2f * Opacity);
43392 }
43393 }
43394 if (type == 984)
43395 {
43396 float num3 = rotation + Main.rand.NextFloatDirection() * ((float)Math.PI / 2f) * 0.7f;
43397 Vector2 vector7 = base.Center + num3.ToRotationVector2() * 85f * scale;
43398 Vector2 vector8 = (num3 + ai[0] * ((float)Math.PI / 2f)).ToRotationVector2();
43399 Color value = default(Color);
43400 ((Color)(ref value))._002Ector(64, 220, 96);
43401 Color value2 = default(Color);
43402 ((Color)(ref value2))._002Ector(15, 84, 125);
43403 Lighting.AddLight(base.Center, ((Color)(ref value2)).ToVector3());
43404 if (Main.rand.NextFloat() * 2f < Opacity)
43405 {
43406 Color value3 = Color.Lerp(value2, value, Utils.Remap(num, 0f, 0.6f, 0f, 1f));
43407 value3 = Color.Lerp(value3, Color.White, Utils.Remap(num, 0.6f, 0.8f, 0f, 0.5f));
43408 Dust dust11 = Dust.NewDustPerfect(base.Center + num3.ToRotationVector2() * (Main.rand.NextFloat() * 80f * scale + 20f * scale), 278, vector8 * 1f, 100, Color.Lerp(value3, Color.White, Main.rand.NextFloat() * 0.3f), 0.4f);
43409 dust11.fadeIn = 0.4f + Main.rand.NextFloat() * 0.15f;
43410 dust11.noGravity = true;
43411 }
43412 if (Main.rand.NextFloat() < Opacity)
43413 {
43414 Color.Lerp(Color.Lerp(Color.Lerp(value2, value, Utils.Remap(num, 0f, 0.6f, 0f, 1f)), Color.White, Utils.Remap(num, 0.6f, 0.8f, 0f, 0.5f)), Color.White, Main.rand.NextFloat() * 0.3f);
43415 Dust dust6 = Dust.NewDustPerfect(vector7, 107, vector8 * 3f, 100, default(Color) * Opacity, 0.8f * Opacity);
43416 dust6.velocity += player.velocity * 0.1f;
43417 dust6.velocity += new Vector2((float)player.direction, 0f);
43418 dust6.position -= dust6.velocity * 6f;
43419 }
43420 }
43421 scale *= ai[2];
43422 if (localAI[0] >= ai[1])
43423 {
43424 Kill();
43425 }
43426 }
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 Item60
Definition SoundID.cs:797
int owner
The index of the player who owns this projectile. In Multiplayer, Clients "own" projectiles that they...
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...
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....
This data type describes in detail how a sound should be played. Passable to the M:Terraria....
Definition SoundStyle.cs:19

References Terraria.Lighting.AddLight(), Terraria.Entity.direction, Terraria.Player.fullRotation, Terraria.ID.SoundID.Item60, Terraria.Player.MountedCenter, Terraria.Dust.NewDustPerfect(), Terraria.Main.player, Terraria.Audio.SoundEngine.PlaySound(), Terraria.Main.rand, Terraria.Utils.Remap(), Terraria.Player.RotatedRelativePoint(), and Terraria.Entity.velocity.

+ Here is the call graph for this function: