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

◆ AI_177_IceWhipSlicer()

void Terraria.Projectile.AI_177_IceWhipSlicer ( )
inlineprivate

Definition at line 47365 of file Projectile.cs.

47366 {
47367 //IL_0080: Unknown result type (might be due to invalid IL or missing references)
47368 //IL_00b4: Unknown result type (might be due to invalid IL or missing references)
47369 //IL_02d9: Unknown result type (might be due to invalid IL or missing references)
47370 //IL_0377: Unknown result type (might be due to invalid IL or missing references)
47371 //IL_0381: Unknown result type (might be due to invalid IL or missing references)
47372 //IL_0386: Unknown result type (might be due to invalid IL or missing references)
47373 //IL_0339: Unknown result type (might be due to invalid IL or missing references)
47374 //IL_033f: Unknown result type (might be due to invalid IL or missing references)
47375 //IL_0344: Unknown result type (might be due to invalid IL or missing references)
47376 //IL_0349: Unknown result type (might be due to invalid IL or missing references)
47377 //IL_034e: Unknown result type (might be due to invalid IL or missing references)
47378 //IL_0350: Unknown result type (might be due to invalid IL or missing references)
47379 //IL_02f0: Unknown result type (might be due to invalid IL or missing references)
47380 //IL_02f5: Unknown result type (might be due to invalid IL or missing references)
47381 //IL_02fa: Unknown result type (might be due to invalid IL or missing references)
47382 //IL_02fc: Unknown result type (might be due to invalid IL or missing references)
47383 //IL_035b: Unknown result type (might be due to invalid IL or missing references)
47384 //IL_0360: Unknown result type (might be due to invalid IL or missing references)
47385 //IL_0363: Unknown result type (might be due to invalid IL or missing references)
47386 //IL_0369: Unknown result type (might be due to invalid IL or missing references)
47387 //IL_036e: Unknown result type (might be due to invalid IL or missing references)
47388 //IL_0310: Unknown result type (might be due to invalid IL or missing references)
47389 //IL_0315: Unknown result type (might be due to invalid IL or missing references)
47390 //IL_0318: Unknown result type (might be due to invalid IL or missing references)
47391 //IL_031e: Unknown result type (might be due to invalid IL or missing references)
47392 //IL_0323: Unknown result type (might be due to invalid IL or missing references)
47393 //IL_05bf: Unknown result type (might be due to invalid IL or missing references)
47394 //IL_05e3: Unknown result type (might be due to invalid IL or missing references)
47395 //IL_0601: Unknown result type (might be due to invalid IL or missing references)
47396 //IL_0606: Unknown result type (might be due to invalid IL or missing references)
47397 //IL_060a: Unknown result type (might be due to invalid IL or missing references)
47398 //IL_060f: Unknown result type (might be due to invalid IL or missing references)
47399 //IL_0616: Unknown result type (might be due to invalid IL or missing references)
47400 //IL_061b: Unknown result type (might be due to invalid IL or missing references)
47401 //IL_0620: Unknown result type (might be due to invalid IL or missing references)
47402 //IL_0625: Unknown result type (might be due to invalid IL or missing references)
47403 //IL_0627: Unknown result type (might be due to invalid IL or missing references)
47404 //IL_0407: Unknown result type (might be due to invalid IL or missing references)
47405 //IL_0434: Unknown result type (might be due to invalid IL or missing references)
47406 //IL_043a: Unknown result type (might be due to invalid IL or missing references)
47407 //IL_047f: Unknown result type (might be due to invalid IL or missing references)
47408 //IL_048e: Unknown result type (might be due to invalid IL or missing references)
47409 //IL_0493: Unknown result type (might be due to invalid IL or missing references)
47410 //IL_0499: Unknown result type (might be due to invalid IL or missing references)
47411 //IL_04a3: Unknown result type (might be due to invalid IL or missing references)
47412 //IL_04a8: Unknown result type (might be due to invalid IL or missing references)
47413 //IL_04ad: Unknown result type (might be due to invalid IL or missing references)
47414 //IL_04bb: Unknown result type (might be due to invalid IL or missing references)
47415 //IL_04e8: Unknown result type (might be due to invalid IL or missing references)
47416 //IL_04ee: Unknown result type (might be due to invalid IL or missing references)
47417 //IL_051c: Unknown result type (might be due to invalid IL or missing references)
47418 //IL_0526: Unknown result type (might be due to invalid IL or missing references)
47419 //IL_0535: Unknown result type (might be due to invalid IL or missing references)
47420 //IL_053a: Unknown result type (might be due to invalid IL or missing references)
47421 //IL_0540: Unknown result type (might be due to invalid IL or missing references)
47422 //IL_054a: Unknown result type (might be due to invalid IL or missing references)
47423 //IL_054f: Unknown result type (might be due to invalid IL or missing references)
47424 //IL_0554: Unknown result type (might be due to invalid IL or missing references)
47425 //IL_055a: Unknown result type (might be due to invalid IL or missing references)
47426 //IL_0560: Unknown result type (might be due to invalid IL or missing references)
47427 //IL_056a: Unknown result type (might be due to invalid IL or missing references)
47428 //IL_056f: Unknown result type (might be due to invalid IL or missing references)
47429 //IL_0574: Unknown result type (might be due to invalid IL or missing references)
47430 Player player = Main.player[owner];
47431 if (type == 917 && (!player.active || player.dead))
47432 {
47433 player.coolWhipBuff = false;
47434 Kill();
47435 return;
47436 }
47437 if (type == 917 && player.coolWhipBuff)
47438 {
47439 timeLeft = 2;
47440 }
47441 if (type == 969)
47442 {
47443 if (soundDelay == 0)
47444 {
47445 soundDelay = -1;
47447 }
47449 if (activeSound != null)
47450 {
47451 activeSound.Position = base.Center;
47452 activeSound.Volume = 1f - Math.Max(ai[1] - 555f, 0f) / 15f;
47453 }
47454 else
47455 {
47456 localAI[1] = SlotId.Invalid.ToFloat();
47457 }
47458 ai[1] += 1f;
47459 if (ai[1] > 560f)
47460 {
47461 alpha = (int)MathHelper.Lerp(0f, 250f, (ai[1] - 560f) / 10f);
47462 }
47463 if (ai[1] >= 570f)
47464 {
47465 Kill();
47466 }
47467 float num = 555f;
47468 for (int i = 0; i < 1000; i++)
47469 {
47470 if (i != whoAmI && Main.projectile[i].active && Main.projectile[i].owner == owner && Main.projectile[i].type == type && timeLeft > Main.projectile[i].timeLeft && Main.projectile[i].ai[1] < num)
47471 {
47472 Main.projectile[i].ai[1] = num;
47473 Main.projectile[i].netUpdate = true;
47474 }
47475 }
47476 }
47477 int num2 = (int)ai[0] - 1;
47478 if (num2 != -1 && (!Main.npc[num2].CanBeChasedBy(this) || localNPCImmunity[num2] > 0))
47479 {
47480 ai[0] = 0f;
47481 num2 = -1;
47482 }
47483 if (num2 == -1)
47484 {
47485 bool checkCanHit = false;
47486 if (type == 969)
47487 {
47488 checkCanHit = true;
47489 }
47491 if (nPC != null)
47492 {
47493 num2 = nPC.whoAmI;
47494 ai[0] = num2 + 1;
47495 netUpdate = true;
47496 }
47497 }
47498 float num3 = 18f;
47499 float amount = 0.1f;
47500 float num4 = 0f;
47501 if (type == 969)
47502 {
47503 num3 = 8f;
47504 amount = 0.075f;
47505 num4 = 25f;
47506 }
47507 if (num2 != -1)
47508 {
47509 NPC nPC2 = Main.npc[num2];
47510 float num5 = Distance(nPC2.Center);
47511 if (num3 > num5)
47512 {
47513 num3 = num5;
47514 }
47515 Vector2 vector = DirectionTo(nPC2.Center);
47516 if (!vector.HasNaNs() && num5 >= num4)
47517 {
47518 velocity = Vector2.Lerp(velocity, vector * num3, amount);
47519 }
47520 }
47521 else if (type == 969)
47522 {
47523 Vector2 vector2 = DirectionTo(base.Center + velocity);
47524 if (!vector2.HasNaNs())
47525 {
47526 velocity = Vector2.Lerp(velocity, vector2 * num3, amount);
47527 }
47528 }
47529 else
47530 {
47531 velocity *= 0.92f;
47532 }
47533 if (type == 969)
47534 {
47535 rotation = velocity.X * 0.0125f;
47536 if (++frameCounter > 4)
47537 {
47538 frameCounter = 0;
47539 frame++;
47540 if (frame >= Main.projFrames[type])
47541 {
47542 frame = 0;
47543 }
47544 }
47545 if (timeLeft % 3 == 0)
47546 {
47547 int num6 = Dust.NewDust(position, width, height, 16, velocity.X, velocity.Y, 120, default(Color), 0.5f);
47548 Main.dust[num6].noGravity = true;
47549 Main.dust[num6].fadeIn = 0.9f;
47550 Main.dust[num6].velocity = Main.rand.NextVector2Circular(2f, 2f) + new Vector2(0f, -2f) + velocity * 0.75f;
47551 for (int j = 0; j < 2; j++)
47552 {
47553 Dust dust = Dust.NewDustDirect(position, width, height, 16, velocity.X, velocity.Y, 60, default(Color), 0.5f);
47554 dust.noGravity = true;
47555 dust.fadeIn = 0.7f;
47556 dust.velocity = Main.rand.NextVector2Circular(2f, 2f) * 0.2f + new Vector2(0f, -0.4f) + velocity * 1.5f;
47557 dust.position -= velocity * 3f;
47558 }
47559 }
47560 }
47561 else
47562 {
47563 rotation += 0.020943953f + Math.Abs(velocity.X) * 0.2f;
47564 if (Main.rand.Next(3) == 0)
47565 {
47566 Dust dust2 = Dust.NewDustDirect(base.Center, 0, 0, 43, velocity.X, velocity.Y, 254, Color.White, 0.5f);
47567 Vector2 vector3 = Main.rand.NextVector2Circular(1f, 1f);
47568 dust2.position = base.Center + vector3 * 10f;
47569 dust2.velocity = vector3;
47570 }
47571 }
47572 }
static ? ActiveSound GetActiveSound(SlotId slotId)
static SlotId PlayTrackedSound(in SoundStyle style, Vector2? position=null)
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
float Distance(Vector2 Other)
Definition Entity.cs:275
Vector2 position
The position of this Entity in world coordinates.
Definition Entity.cs:28
int width
The width of this Entity's hitbox, in pixels.
Definition Entity.cs:46
Vector2 DirectionTo(Vector2 Destination)
Definition Entity.cs:289
int height
The height of this Entity's hitbox, in pixels.
Definition Entity.cs:51
static readonly SoundStyle DD2_BookStaffTwisterLoop
Definition SoundID.cs:207
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....
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...
float[] localAI
Acts like F:Terraria.Projectile.ai, but does not sync to the server. Many vanilla T:Terraria....
NPC FindTargetWithinRange(float maxRange, bool checkCanHit=false)
int frame
The frame number in the spritesheet that this projectile will be drawn with. Assign in M:Terraria....
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...
int frameCounter
Used as a timer to decide when to change F:Terraria.Projectile.frame. Defaults to 0.

References Terraria.Entity.active, Terraria.Player.coolWhipBuff, Terraria.ID.SoundID.DD2_BookStaffTwisterLoop, Terraria.Player.dead, Terraria.Main.dust, Terraria.Audio.SoundEngine.GetActiveSound(), Terraria.Dust.NewDust(), Terraria.Dust.NewDustDirect(), Terraria.Main.npc, Terraria.Main.player, Terraria.Audio.SoundEngine.PlayTrackedSound(), Terraria.Main.projectile, Terraria.Main.projFrames, and Terraria.Main.rand.

+ Here is the call graph for this function: