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

◆ EmitEnchantmentVisualsAt()

void Terraria.Projectile.EmitEnchantmentVisualsAt ( Vector2 boxPosition,
int boxWidth,
int boxHeight )
inline

Definition at line 16475 of file Projectile.cs.

16476 {
16477 //IL_0123: Unknown result type (might be due to invalid IL or missing references)
16478 //IL_012f: Unknown result type (might be due to invalid IL or missing references)
16479 //IL_013b: Unknown result type (might be due to invalid IL or missing references)
16480 //IL_016d: Unknown result type (might be due to invalid IL or missing references)
16481 //IL_0173: Unknown result type (might be due to invalid IL or missing references)
16482 //IL_0065: Unknown result type (might be due to invalid IL or missing references)
16483 //IL_009d: Unknown result type (might be due to invalid IL or missing references)
16484 //IL_00a3: Unknown result type (might be due to invalid IL or missing references)
16485 //IL_00c4: Unknown result type (might be due to invalid IL or missing references)
16486 //IL_00ce: Unknown result type (might be due to invalid IL or missing references)
16487 //IL_00d3: Unknown result type (might be due to invalid IL or missing references)
16488 //IL_021c: Unknown result type (might be due to invalid IL or missing references)
16489 //IL_0232: Unknown result type (might be due to invalid IL or missing references)
16490 //IL_0238: Unknown result type (might be due to invalid IL or missing references)
16491 //IL_026e: Unknown result type (might be due to invalid IL or missing references)
16492 //IL_0278: Unknown result type (might be due to invalid IL or missing references)
16493 //IL_027d: Unknown result type (might be due to invalid IL or missing references)
16494 //IL_029b: Unknown result type (might be due to invalid IL or missing references)
16495 //IL_02b1: Unknown result type (might be due to invalid IL or missing references)
16496 //IL_02b7: Unknown result type (might be due to invalid IL or missing references)
16497 //IL_02ed: Unknown result type (might be due to invalid IL or missing references)
16498 //IL_02f7: Unknown result type (might be due to invalid IL or missing references)
16499 //IL_02fc: Unknown result type (might be due to invalid IL or missing references)
16500 //IL_031e: Unknown result type (might be due to invalid IL or missing references)
16501 //IL_0353: Unknown result type (might be due to invalid IL or missing references)
16502 //IL_0359: Unknown result type (might be due to invalid IL or missing references)
16503 //IL_037d: Unknown result type (might be due to invalid IL or missing references)
16504 //IL_0387: Unknown result type (might be due to invalid IL or missing references)
16505 //IL_038c: Unknown result type (might be due to invalid IL or missing references)
16506 //IL_03c9: Unknown result type (might be due to invalid IL or missing references)
16507 //IL_03fd: Unknown result type (might be due to invalid IL or missing references)
16508 //IL_0403: Unknown result type (might be due to invalid IL or missing references)
16509 //IL_0427: Unknown result type (might be due to invalid IL or missing references)
16510 //IL_0431: Unknown result type (might be due to invalid IL or missing references)
16511 //IL_0436: Unknown result type (might be due to invalid IL or missing references)
16512 //IL_0476: Unknown result type (might be due to invalid IL or missing references)
16513 //IL_04ab: Unknown result type (might be due to invalid IL or missing references)
16514 //IL_04b1: Unknown result type (might be due to invalid IL or missing references)
16515 //IL_051f: Unknown result type (might be due to invalid IL or missing references)
16516 //IL_0535: Unknown result type (might be due to invalid IL or missing references)
16517 //IL_053b: Unknown result type (might be due to invalid IL or missing references)
16518 //IL_0628: Unknown result type (might be due to invalid IL or missing references)
16519 //IL_062d: Unknown result type (might be due to invalid IL or missing references)
16520 //IL_05ab: Unknown result type (might be due to invalid IL or missing references)
16521 //IL_05c1: Unknown result type (might be due to invalid IL or missing references)
16522 //IL_05c7: Unknown result type (might be due to invalid IL or missing references)
16523 //IL_063d: Unknown result type (might be due to invalid IL or missing references)
16524 //IL_064c: Unknown result type (might be due to invalid IL or missing references)
16525 //IL_0651: Unknown result type (might be due to invalid IL or missing references)
16526 //IL_08c5: Unknown result type (might be due to invalid IL or missing references)
16527 //IL_08d8: Unknown result type (might be due to invalid IL or missing references)
16528 //IL_08de: Unknown result type (might be due to invalid IL or missing references)
16529 //IL_0914: Unknown result type (might be due to invalid IL or missing references)
16530 //IL_091e: Unknown result type (might be due to invalid IL or missing references)
16531 //IL_0923: Unknown result type (might be due to invalid IL or missing references)
16532 //IL_067a: Unknown result type (might be due to invalid IL or missing references)
16533 //IL_067f: Unknown result type (might be due to invalid IL or missing references)
16534 //IL_0686: Unknown result type (might be due to invalid IL or missing references)
16535 //IL_0690: Unknown result type (might be due to invalid IL or missing references)
16536 //IL_0696: Unknown result type (might be due to invalid IL or missing references)
16537 //IL_07b2: Unknown result type (might be due to invalid IL or missing references)
16538 //IL_07b7: Unknown result type (might be due to invalid IL or missing references)
16539 Player player = Main.player[owner];
16540 if (player.frostBurn && (melee || ranged) && friendly && !hostile && !noEnchantments && Main.rand.Next(2 * (1 + extraUpdates)) == 0)
16541 {
16542 int num = Dust.NewDust(boxPosition, boxWidth, boxHeight, 135, velocity.X * 0.2f + (float)(direction * 3), velocity.Y * 0.2f, 100, default(Color), 2f);
16543 Main.dust[num].noGravity = true;
16544 Dust obj = Main.dust[num];
16545 obj.velocity *= 0.7f;
16546 Main.dust[num].velocity.Y -= 0.5f;
16547 }
16548 if (melee && player.magmaStone && !noEnchantments && Main.rand.Next(3) != 0)
16549 {
16550 int num7 = Dust.NewDust(new Vector2(boxPosition.X - 4f, boxPosition.Y - 4f), boxWidth + 8, boxHeight + 8, 6, velocity.X * 0.2f, velocity.Y * 0.2f, 100, default(Color), 2f);
16551 if (Main.rand.Next(2) == 0)
16552 {
16553 Main.dust[num7].scale = 1.5f;
16554 }
16555 Main.dust[num7].noGravity = true;
16556 Main.dust[num7].velocity.X *= 2f;
16557 Main.dust[num7].velocity.Y *= 2f;
16558 }
16559 if ((!melee && !ProjectileID.Sets.IsAWhip[type]) || player.meleeEnchant <= 0 || noEnchantments)
16560 {
16561 return;
16562 }
16563 if (player.meleeEnchant == 1 && Main.rand.Next(3) == 0)
16564 {
16565 int num8 = Dust.NewDust(boxPosition, boxWidth, boxHeight, 171, 0f, 0f, 100);
16566 Main.dust[num8].noGravity = true;
16567 Main.dust[num8].fadeIn = 1.5f;
16568 Dust obj2 = Main.dust[num8];
16569 obj2.velocity *= 0.25f;
16570 }
16571 if (player.meleeEnchant == 1)
16572 {
16573 if (Main.rand.Next(3) == 0)
16574 {
16575 int num9 = Dust.NewDust(boxPosition, boxWidth, boxHeight, 171, 0f, 0f, 100);
16576 Main.dust[num9].noGravity = true;
16577 Main.dust[num9].fadeIn = 1.5f;
16578 Dust obj3 = Main.dust[num9];
16579 obj3.velocity *= 0.25f;
16580 }
16581 }
16582 else if (player.meleeEnchant == 2)
16583 {
16584 if (Main.rand.Next(2) == 0)
16585 {
16586 int num10 = Dust.NewDust(boxPosition, boxWidth, boxHeight, 75, velocity.X * 0.2f + (float)(direction * 3), velocity.Y * 0.2f, 100, default(Color), 2.5f);
16587 Main.dust[num10].noGravity = true;
16588 Dust obj4 = Main.dust[num10];
16589 obj4.velocity *= 0.7f;
16590 Main.dust[num10].velocity.Y -= 0.5f;
16591 }
16592 }
16593 else if (player.meleeEnchant == 3)
16594 {
16595 if (Main.rand.Next(2) == 0)
16596 {
16597 int num11 = Dust.NewDust(boxPosition, boxWidth, boxHeight, 6, velocity.X * 0.2f + (float)(direction * 3), velocity.Y * 0.2f, 100, default(Color), 2.5f);
16598 Main.dust[num11].noGravity = true;
16599 Dust obj5 = Main.dust[num11];
16600 obj5.velocity *= 0.7f;
16601 Main.dust[num11].velocity.Y -= 0.5f;
16602 }
16603 }
16604 else if (player.meleeEnchant == 4)
16605 {
16606 int num12 = 0;
16607 if (Main.rand.Next(2) == 0)
16608 {
16609 num12 = Dust.NewDust(boxPosition, boxWidth, boxHeight, 57, velocity.X * 0.2f + (float)(direction * 3), velocity.Y * 0.2f, 100, default(Color), 1.1f);
16610 Main.dust[num12].noGravity = true;
16611 Main.dust[num12].velocity.X /= 2f;
16612 Main.dust[num12].velocity.Y /= 2f;
16613 }
16614 }
16615 else if (player.meleeEnchant == 5)
16616 {
16617 if (Main.rand.Next(2) == 0)
16618 {
16619 int num13 = Dust.NewDust(boxPosition, boxWidth, boxHeight, 169, 0f, 0f, 100);
16620 Main.dust[num13].velocity.X += direction;
16621 Main.dust[num13].velocity.Y += 0.2f;
16622 Main.dust[num13].noGravity = true;
16623 }
16624 }
16625 else if (player.meleeEnchant == 6)
16626 {
16627 if (Main.rand.Next(2) == 0)
16628 {
16629 int num14 = Dust.NewDust(boxPosition, boxWidth, boxHeight, 135, 0f, 0f, 100);
16630 Main.dust[num14].velocity.X += direction;
16631 Main.dust[num14].velocity.Y += 0.2f;
16632 Main.dust[num14].noGravity = true;
16633 }
16634 }
16635 else if (player.meleeEnchant == 7)
16636 {
16637 Vector2 vector = velocity;
16638 if (((Vector2)(ref vector)).Length() > 4f)
16639 {
16640 vector *= 4f / ((Vector2)(ref vector)).Length();
16641 }
16642 if (Main.rand.Next(20) == 0)
16643 {
16644 int num2 = Main.rand.Next(139, 143);
16645 int num3 = Dust.NewDust(boxPosition, boxWidth, boxHeight, num2, vector.X, vector.Y, 0, default(Color), 1.2f);
16646 Main.dust[num3].velocity.X *= 1f + (float)Main.rand.Next(-50, 51) * 0.01f;
16647 Main.dust[num3].velocity.Y *= 1f + (float)Main.rand.Next(-50, 51) * 0.01f;
16648 Main.dust[num3].velocity.X += (float)Main.rand.Next(-50, 51) * 0.05f;
16649 Main.dust[num3].velocity.Y += (float)Main.rand.Next(-50, 51) * 0.05f;
16650 Main.dust[num3].scale *= 1f + (float)Main.rand.Next(-30, 31) * 0.01f;
16651 }
16652 if (Main.rand.Next(40) == 0)
16653 {
16654 int num4 = Main.rand.Next(276, 283);
16655 int num5 = Gore.NewGore(position, vector, num4);
16656 Main.gore[num5].velocity.X *= 1f + (float)Main.rand.Next(-50, 51) * 0.01f;
16657 Main.gore[num5].velocity.Y *= 1f + (float)Main.rand.Next(-50, 51) * 0.01f;
16658 Main.gore[num5].scale *= 1f + (float)Main.rand.Next(-20, 21) * 0.01f;
16659 Main.gore[num5].velocity.X += (float)Main.rand.Next(-50, 51) * 0.05f;
16660 Main.gore[num5].velocity.Y += (float)Main.rand.Next(-50, 51) * 0.05f;
16661 }
16662 }
16663 else if (player.meleeEnchant == 8 && Main.rand.Next(4) == 0)
16664 {
16665 int num6 = Dust.NewDust(boxPosition, boxWidth, boxHeight, 46, 0f, 0f, 100);
16666 Main.dust[num6].noGravity = true;
16667 Main.dust[num6].fadeIn = 1.5f;
16668 Dust obj6 = Main.dust[num6];
16669 obj6.velocity *= 0.25f;
16670 }
16671 }
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 bool[] IsAWhip
If true for a given projectile type (F:Terraria.Projectile.type), then that projectile will use whip ...
int owner
The index of the player who owns this projectile. In Multiplayer, Clients "own" projectiles that they...
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 extraUpdates
Additional update steps per tick. Useful for really fast projectiles such as Shadowbeam Staff....
bool hostile
If True, this projectile will hurt players and friendly NPCs (F:Terraria.NPC.friendly) Defaults to ...

References Terraria.Entity.direction, Terraria.Main.dust, Terraria.Projectile.extraUpdates, Terraria.Projectile.friendly, Terraria.Player.frostBurn, Terraria.Main.gore, Terraria.Projectile.hostile, Terraria.ID.ProjectileID.Sets.IsAWhip, Terraria.Player.magmaStone, Terraria.Projectile.melee, Terraria.Player.meleeEnchant, Terraria.Dust.NewDust(), Terraria.Gore.NewGore(), Terraria.Projectile.noEnchantments, Terraria.Projectile.owner, Terraria.Main.player, Terraria.Entity.position, Terraria.Main.rand, Terraria.Projectile.ranged, Terraria.Projectile.type, and Terraria.Entity.velocity.

Referenced by Terraria.Projectile.UpdateEnchantmentVisuals().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: