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

◆ DoSpawnDust()

void Terraria.Mount.DoSpawnDust ( Player mountedPlayer,
bool isDismounting )
inlineprivate

Definition at line 6493 of file Mount.cs.

6494 {
6495 //IL_0156: Unknown result type (might be due to invalid IL or missing references)
6496 //IL_015b: Unknown result type (might be due to invalid IL or missing references)
6497 //IL_0045: Unknown result type (might be due to invalid IL or missing references)
6498 //IL_0078: Unknown result type (might be due to invalid IL or missing references)
6499 //IL_00b3: Unknown result type (might be due to invalid IL or missing references)
6500 //IL_00b9: Unknown result type (might be due to invalid IL or missing references)
6501 //IL_00c3: Unknown result type (might be due to invalid IL or missing references)
6502 //IL_00c8: Unknown result type (might be due to invalid IL or missing references)
6503 //IL_00cd: Unknown result type (might be due to invalid IL or missing references)
6504 //IL_00d4: Unknown result type (might be due to invalid IL or missing references)
6505 //IL_00e3: Unknown result type (might be due to invalid IL or missing references)
6506 //IL_00e8: Unknown result type (might be due to invalid IL or missing references)
6507 //IL_0127: Unknown result type (might be due to invalid IL or missing references)
6508 //IL_012c: Unknown result type (might be due to invalid IL or missing references)
6509 //IL_01ca: Unknown result type (might be due to invalid IL or missing references)
6510 //IL_01cf: Unknown result type (might be due to invalid IL or missing references)
6511 //IL_0203: Unknown result type (might be due to invalid IL or missing references)
6512 //IL_021d: Unknown result type (might be due to invalid IL or missing references)
6513 //IL_0222: Unknown result type (might be due to invalid IL or missing references)
6514 //IL_0227: Unknown result type (might be due to invalid IL or missing references)
6515 //IL_02be: Unknown result type (might be due to invalid IL or missing references)
6516 //IL_02e0: Unknown result type (might be due to invalid IL or missing references)
6517 //IL_0487: Unknown result type (might be due to invalid IL or missing references)
6518 //IL_048c: Unknown result type (might be due to invalid IL or missing references)
6519 //IL_04c0: Unknown result type (might be due to invalid IL or missing references)
6520 //IL_04da: Unknown result type (might be due to invalid IL or missing references)
6521 //IL_04df: Unknown result type (might be due to invalid IL or missing references)
6522 //IL_04e9: Unknown result type (might be due to invalid IL or missing references)
6523 //IL_04ee: Unknown result type (might be due to invalid IL or missing references)
6524 //IL_036f: Unknown result type (might be due to invalid IL or missing references)
6525 //IL_0379: Unknown result type (might be due to invalid IL or missing references)
6526 //IL_037e: Unknown result type (might be due to invalid IL or missing references)
6527 //IL_038c: Unknown result type (might be due to invalid IL or missing references)
6528 //IL_0392: Unknown result type (might be due to invalid IL or missing references)
6529 //IL_039c: Unknown result type (might be due to invalid IL or missing references)
6530 //IL_03a1: Unknown result type (might be due to invalid IL or missing references)
6531 //IL_03a6: Unknown result type (might be due to invalid IL or missing references)
6532 //IL_0542: Unknown result type (might be due to invalid IL or missing references)
6533 //IL_0547: Unknown result type (might be due to invalid IL or missing references)
6534 //IL_057b: Unknown result type (might be due to invalid IL or missing references)
6535 //IL_0595: Unknown result type (might be due to invalid IL or missing references)
6536 //IL_059a: Unknown result type (might be due to invalid IL or missing references)
6537 //IL_059f: Unknown result type (might be due to invalid IL or missing references)
6538 //IL_03d2: Unknown result type (might be due to invalid IL or missing references)
6539 //IL_03e1: Unknown result type (might be due to invalid IL or missing references)
6540 //IL_03e6: Unknown result type (might be due to invalid IL or missing references)
6541 if (Main.netMode == 2)
6542 {
6543 return;
6544 }
6545 if (_type == 52)
6546 {
6547 for (int i = 0; i < 100; i++)
6548 {
6549 _ = _data.spawnDust;
6550 Dust dust = Dust.NewDustDirect(new Vector2(mountedPlayer.position.X - 20f, mountedPlayer.position.Y), mountedPlayer.width + 40, mountedPlayer.height, 267, 0f, 0f, 60, new Color(130, 60, 255, 70));
6551 dust.scale += (float)Main.rand.Next(-10, 21) * 0.01f;
6552 dust.noGravity = true;
6553 dust.velocity += mountedPlayer.velocity * 0.8f;
6554 dust.velocity *= Main.rand.NextFloat();
6555 dust.velocity.Y += 2f * Main.rand.NextFloatDirection();
6556 dust.noLight = true;
6557 if (Main.rand.Next(3) == 0)
6558 {
6559 Dust dust2 = Dust.CloneDust(dust);
6560 dust2.color = Color.White;
6561 dust2.scale *= 0.5f;
6562 dust2.alpha = 0;
6563 }
6564 }
6565 return;
6566 }
6567 Color newColor = Color.Transparent;
6568 if (_type == 23)
6569 {
6570 ((Color)(ref newColor))._002Ector(255, 255, 0, 255);
6571 }
6572 for (int j = 0; j < 100; j++)
6573 {
6574 if (MountID.Sets.Cart[_type])
6575 {
6576 if (j % 10 == 0)
6577 {
6578 int type = Main.rand.Next(61, 64);
6579 int num = Gore.NewGore(new Vector2(mountedPlayer.position.X - 20f, mountedPlayer.position.Y), Vector2.Zero, type);
6580 Main.gore[num].alpha = 100;
6581 Main.gore[num].velocity = Vector2.Transform(new Vector2(1f, 0f), Matrix.CreateRotationZ((float)(Main.rand.NextDouble() * 6.2831854820251465)));
6582 }
6583 continue;
6584 }
6585 int type2 = _data.spawnDust;
6586 float scale = 1f;
6587 int alpha = 0;
6588 if (_type == 40 || _type == 41 || _type == 42)
6589 {
6590 type2 = ((Main.rand.Next(2) != 0) ? 16 : 31);
6591 scale = 0.9f;
6592 alpha = 50;
6593 if (_type == 42)
6594 {
6595 type2 = 31;
6596 }
6597 if (_type == 41)
6598 {
6599 type2 = 16;
6600 }
6601 }
6602 int num2 = Dust.NewDust(new Vector2(mountedPlayer.position.X - 20f, mountedPlayer.position.Y), mountedPlayer.width + 40, mountedPlayer.height, type2, 0f, 0f, alpha, newColor, scale);
6603 Main.dust[num2].scale += (float)Main.rand.Next(-10, 21) * 0.01f;
6605 {
6606 Main.dust[num2].noGravity = true;
6607 }
6608 else if (Main.rand.Next(2) == 0)
6609 {
6610 Main.dust[num2].scale *= 1.3f;
6611 Main.dust[num2].noGravity = true;
6612 }
6613 else
6614 {
6615 Dust obj = Main.dust[num2];
6616 obj.velocity *= 0.5f;
6617 }
6618 Dust obj2 = Main.dust[num2];
6619 obj2.velocity += mountedPlayer.velocity * 0.8f;
6620 if (_type == 40 || _type == 41 || _type == 42)
6621 {
6622 Dust obj3 = Main.dust[num2];
6623 obj3.velocity *= Main.rand.NextFloat();
6624 }
6625 }
6626 if (_type == 40 || _type == 41 || _type == 42)
6627 {
6628 for (int k = 0; k < 5; k++)
6629 {
6630 int type3 = Main.rand.Next(61, 64);
6631 if (_type == 41 || (_type == 40 && Main.rand.Next(2) == 0))
6632 {
6633 type3 = Main.rand.Next(11, 14);
6634 }
6635 int num3 = Gore.NewGore(new Vector2(mountedPlayer.position.X + (float)(mountedPlayer.direction * 8), mountedPlayer.position.Y + 20f), Vector2.Zero, type3);
6636 Main.gore[num3].alpha = 100;
6637 Main.gore[num3].velocity = Vector2.Transform(new Vector2(1f, 0f), Matrix.CreateRotationZ((float)(Main.rand.NextDouble() * 6.2831854820251465))) * 1.4f;
6638 }
6639 }
6640 if (_type == 23)
6641 {
6642 for (int l = 0; l < 4; l++)
6643 {
6644 int type4 = Main.rand.Next(61, 64);
6645 int num4 = Gore.NewGore(new Vector2(mountedPlayer.position.X - 20f, mountedPlayer.position.Y), Vector2.Zero, type4);
6646 Main.gore[num4].alpha = 100;
6647 Main.gore[num4].velocity = Vector2.Transform(new Vector2(1f, 0f), Matrix.CreateRotationZ((float)(Main.rand.NextDouble() * 6.2831854820251465)));
6648 }
6649 }
6650 }
static bool[] Cart
If true for a given T:Terraria.ID.MountID, then that mount is categorized as a minecart....
Definition MountID.cs:16
MountData _data
Definition Mount.cs:290

References Terraria.Mount._data, Terraria.Mount._type, Terraria.ID.MountID.Sets.Cart, Terraria.Dust.CloneDust(), Terraria.Main.dust, Terraria.Main.gore, Terraria.Main.netMode, Terraria.Dust.NewDust(), Terraria.Dust.NewDustDirect(), Terraria.Gore.NewGore(), Terraria.Main.rand, Terraria.Mount.MountData.spawnDust, and Terraria.Mount.MountData.spawnDustNoGravity.

Referenced by Terraria.Mount.Dismount(), and Terraria.Mount.SetMount().

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