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

◆ GetShimmered()

void Terraria.Item.GetShimmered ( )
inlineprivate

Definition at line 49643 of file Item.cs.

49644 {
49645 //IL_0038: Unknown result type (might be due to invalid IL or missing references)
49646 //IL_0052: Unknown result type (might be due to invalid IL or missing references)
49647 //IL_005f: Unknown result type (might be due to invalid IL or missing references)
49648 //IL_06eb: Unknown result type (might be due to invalid IL or missing references)
49649 //IL_06f5: Unknown result type (might be due to invalid IL or missing references)
49650 //IL_06fa: Unknown result type (might be due to invalid IL or missing references)
49651 //IL_071d: Unknown result type (might be due to invalid IL or missing references)
49652 //IL_072a: Unknown result type (might be due to invalid IL or missing references)
49653 //IL_0707: Unknown result type (might be due to invalid IL or missing references)
49654 //IL_02b3: Unknown result type (might be due to invalid IL or missing references)
49655 //IL_02c1: Unknown result type (might be due to invalid IL or missing references)
49656 //IL_0301: Unknown result type (might be due to invalid IL or missing references)
49657 //IL_0306: Unknown result type (might be due to invalid IL or missing references)
49658 //IL_03ee: Unknown result type (might be due to invalid IL or missing references)
49659 //IL_03fa: Unknown result type (might be due to invalid IL or missing references)
49660 //IL_03bd: Unknown result type (might be due to invalid IL or missing references)
49661 //IL_03c9: Unknown result type (might be due to invalid IL or missing references)
49662 //IL_05d1: Unknown result type (might be due to invalid IL or missing references)
49663 //IL_05db: Unknown result type (might be due to invalid IL or missing references)
49664 //IL_05e0: Unknown result type (might be due to invalid IL or missing references)
49668 {
49670 Main.player[Main.myPlayer].AddCoinLuck(base.Center, stack);
49671 NetMessage.SendData(146, -1, -1, null, 1, (int)base.Center.X, (int)base.Center.Y, stack);
49672 type = 0;
49673 stack = 0;
49674 }
49675 else if (shimmerEquivalentType == 1326 && NPC.downedMoonlord)
49676 {
49677 int num = stack;
49678 SetDefaults(5335);
49679 stack = num;
49680 shimmered = true;
49681 }
49682 else if (shimmerEquivalentType == 779 && NPC.downedMoonlord)
49683 {
49684 int num12 = stack;
49685 SetDefaults(5134);
49686 stack = num12;
49687 shimmered = true;
49688 }
49689 else if (shimmerEquivalentType == 3031 && NPC.downedMoonlord)
49690 {
49691 int num13 = stack;
49692 SetDefaults(5364);
49693 stack = num13;
49694 shimmered = true;
49695 }
49696 else if (shimmerEquivalentType == 5364 && NPC.downedMoonlord)
49697 {
49698 int num14 = stack;
49699 SetDefaults(3031);
49700 stack = num14;
49701 shimmered = true;
49702 }
49703 else if (shimmerEquivalentType == 3461)
49704 {
49705 short num15 = 3461;
49706 num15 = Main.GetMoonPhase() switch
49707 {
49708 MoonPhase.QuarterAtRight => 5407,
49709 MoonPhase.HalfAtRight => 5405,
49710 MoonPhase.ThreeQuartersAtRight => 5404,
49711 MoonPhase.Full => 5408,
49712 MoonPhase.ThreeQuartersAtLeft => 5401,
49713 MoonPhase.HalfAtLeft => 5403,
49714 MoonPhase.QuarterAtLeft => 5402,
49715 _ => 5406,
49716 };
49717 int num16 = stack;
49719 stack = num16;
49720 shimmered = true;
49721 }
49722 else if (createTile == 139)
49723 {
49724 int num17 = stack;
49725 SetDefaults(576);
49726 stack = num17;
49727 shimmered = true;
49728 }
49730 {
49731 int num18 = stack;
49733 stack = num18;
49734 shimmered = true;
49735 }
49736 else if (type == 4986)
49737 {
49738 if (NPC.unlockedSlimeRainbowSpawn)
49739 {
49740 return;
49741 }
49742 NPC.unlockedSlimeRainbowSpawn = true;
49743 NetMessage.SendData(7);
49744 int num19 = NPC.NewNPC(GetNPCSource_FromThis(), (int)base.Center.X + 4, (int)base.Center.Y, 681);
49745 if (num19 >= 0)
49746 {
49747 NPC obj = Main.npc[num19];
49748 obj.velocity = velocity;
49749 obj.netUpdate = true;
49750 obj.shimmerTransparency = 1f;
49751 NetMessage.SendData(146, -1, -1, null, 2, num19);
49752 }
49753 WorldGen.CheckAchievement_RealEstateAndTownSlimes();
49754 stack--;
49755 if (stack <= 0)
49756 {
49757 type = 0;
49758 }
49759 }
49760 else if (makeNPC > 0)
49761 {
49762 int num2 = 50;
49764 int num3 = NPC.GetAvailableAmountOfNPCsToSpawnUpToSlot(stack, highestNPCSlotIndexWeWillPick);
49765 while (num2 > 0 && num3 > 0 && stack > 0)
49766 {
49767 num2--;
49768 num3--;
49769 stack--;
49770 int num4 = -1;
49771 num4 = ((NPCID.Sets.ShimmerTransformToNPC[makeNPC] < 0) ? NPC.ReleaseNPC((int)base.Center.X, (int)base.Bottom.Y, makeNPC, placeStyle, Main.myPlayer) : NPC.ReleaseNPC((int)base.Center.X, (int)base.Bottom.Y, NPCID.Sets.ShimmerTransformToNPC[makeNPC], 0, Main.myPlayer));
49772 if (num4 >= 0)
49773 {
49774 Main.npc[num4].shimmerTransparency = 1f;
49775 NetMessage.SendData(146, -1, -1, null, 2, num4);
49776 }
49777 }
49778 shimmered = true;
49779 if (stack <= 0)
49780 {
49781 type = 0;
49782 }
49783 }
49784 else if (decraftingRecipeIndex >= 0)
49785 {
49786 int num5 = FindDecraftAmount();
49787 Recipe recipe = Main.recipe[decraftingRecipeIndex];
49788 int num6 = 0;
49789 bool flag = recipe.requiredItem.Count > 1;
49790 IEnumerable<Item> enumerable = recipe.requiredItem;
49791 if (recipe.customShimmerResults != null)
49792 {
49793 enumerable = recipe.customShimmerResults;
49794 }
49795 int num7 = 0;
49796 foreach (Item item2 in enumerable)
49797 {
49798 if (item2.type <= 0)
49799 {
49800 break;
49801 }
49802 num7++;
49803 int num8 = num5 * item2.stack;
49804 if (recipe.alchemy)
49805 {
49806 for (int num9 = num8; num9 > 0; num9--)
49807 {
49808 if (Main.rand.Next(3) == 0)
49809 {
49810 num8--;
49811 }
49812 }
49813 }
49814 while (num8 > 0)
49815 {
49816 int num10 = num8;
49817 if (num10 > 9999)
49818 {
49819 num10 = 9999;
49820 }
49821 num8 -= num10;
49822 int num11 = NewItem(GetItemSource_Misc(8), (int)position.X, (int)position.Y, width, height, item2.type);
49823 Item item = Main.item[num11];
49824 item.stack = num10;
49825 item.shimmerTime = 1f;
49826 item.shimmered = true;
49827 item.shimmerWet = true;
49828 item.wet = true;
49829 item.velocity *= 0.1f;
49830 item.playerIndexTheItemIsReservedFor = Main.myPlayer;
49831 if (flag)
49832 {
49833 item.velocity.X = 1f * (float)num7;
49834 item.velocity.X *= 1f + (float)num7 * 0.05f;
49835 if (num6 % 2 == 0)
49836 {
49837 item.velocity.X *= -1f;
49838 }
49839 }
49840 NetMessage.SendData(145, -1, -1, null, num11, 1f);
49841 }
49842 }
49843 stack -= num5 * recipe.createItem.stack;
49844 if (stack <= 0)
49845 {
49846 stack = 0;
49847 type = 0;
49848 }
49849 }
49850 if (stack > 0)
49851 {
49852 shimmerTime = 1f;
49853 }
49854 else
49855 {
49856 shimmerTime = 0f;
49857 }
49858 shimmerWet = true;
49859 wet = true;
49860 velocity *= 0.1f;
49861 if (Main.netMode == 0)
49862 {
49863 ShimmerEffect(base.Center);
49864 }
49865 else
49866 {
49867 NetMessage.SendData(146, -1, -1, null, 0, (int)base.Center.X, (int)base.Center.Y);
49868 NetMessage.SendData(145, -1, -1, null, whoAmI, 1f);
49869 }
49871 if (stack == 0)
49872 {
49873 makeNPC = -1;
49874 active = false;
49875 }
49876 }
bool wet
The Entity is currently in water. Projectile: Affects movement speed and some projectiles die when ...
Definition Entity.cs:57
bool shimmerWet
Definition Entity.cs:59
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
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
bool active
If true, the Entity actually exists within the game world. Within the specific entity array,...
Definition Entity.cs:21
int height
The height of this Entity's hitbox, in pixels.
Definition Entity.cs:51
static int[] CoinLuckValue
Set for defining how much coin luck according to its stack this item gives to nearby players when thr...
Definition ItemID.cs:1613
static int[] ShimmerTransformToItem
If > 0 for a given item type (F:Terraria.Item.type), then that item will transform into the retrieved...
Definition ItemID.cs:151
static int[] ShimmerTransformToNPC
Associates an NPC type (F:Terraria.NPC.type) with the NPC type it will turn into when submerged in sh...
Definition NPCID.cs:490
static void ShimmerEffect(Vector2 shimmerPositon)
Definition Item.cs:49878
int stack
The current stack of the item. F:Terraria.Item.maxStack indicates the max possible stack.
Definition Item.cs:396
int makeNPC
The numerical ID of the NPC that this item creates when used. Mainly used for caught critters as ite...
Definition Item.cs:270
int GetShimmerEquivalentType()
Definition Item.cs:49634
int createTile
The ID of the tile this item places on use. Either a T:Terraria.ID.TileID entry or M:Terraria....
Definition Item.cs:435
IEntitySource GetNPCSource_FromThis()
Definition Item.cs:1224
int FindDecraftAmount()
Definition Item.cs:49624
int placeStyle
The style of the tile being placed. Used for tiles that have a different look depending on the item u...
Definition Item.cs:448
float shimmerTime
Definition Item.cs:781
IEntitySource GetItemSource_Misc(int itemSourceId)
Definition Item.cs:1229
bool shimmered
Definition Item.cs:779
void SetDefaults(int Type=0)
Definition Item.cs:48800
static int NewItem(IEntitySource source, Vector2 pos, Vector2 randomBox, int Type, int Stack=1, bool noBroadcast=false, int prefixGiven=0, bool noGrabDelay=false, bool reverseLookup=false)
This particular overload uses two Vector2 to determine the actual spawn position.
Definition Item.cs:51478
int type
The Item ID of this item. The Item ID is a unique number assigned to each Item loaded into the game....
Definition Item.cs:345

References Terraria.Entity.active, Terraria.WorldGen.CheckAchievement_RealEstateAndTownSlimes(), Terraria.ID.ItemID.Sets.CoinLuckValue, Terraria.Item.createTile, Terraria.Recipe.customShimmerResults, Terraria.NPC.downedMoonlord, Terraria.Item.FindDecraftAmount(), Terraria.NPC.GetAvailableAmountOfNPCsToSpawnUpToSlot(), Terraria.GameContent.ShimmerTransforms.GetDecraftingRecipeIndex(), Terraria.Item.GetItemSource_Misc(), Terraria.Main.GetMoonPhase(), Terraria.Item.GetNPCSource_FromThis(), Terraria.Item.GetShimmerEquivalentType(), Terraria.Entity.height, Terraria.Main.item, Terraria.Item.makeNPC, Terraria.Main.myPlayer, Terraria.Main.netMode, Terraria.Item.NewItem(), Terraria.NPC.NewNPC(), Terraria.GameContent.Achievements.AchievementsHelper.NotifyProgressionEvent(), Terraria.Main.npc, Terraria.Item.placeStyle, Terraria.Main.player, Terraria.Entity.position, Terraria.Main.rand, Terraria.Main.recipe, Terraria.NPC.ReleaseNPC(), Terraria.Recipe.requiredItem, Terraria.NetMessage.SendData(), Terraria.Item.SetDefaults(), Terraria.Item.shimmered, Terraria.Item.ShimmerEffect(), Terraria.Item.shimmerTime, Terraria.ID.ItemID.Sets.ShimmerTransformToItem, Terraria.ID.NPCID.Sets.ShimmerTransformToNPC, Terraria.Entity.shimmerWet, Terraria.Item.stack, Terraria.Item.type, Terraria.NPC.unlockedSlimeRainbowSpawn, Terraria.Entity.velocity, Terraria.Entity.wet, Terraria.Entity.whoAmI, and Terraria.Entity.width.

Referenced by Terraria.Item.Shimmering().

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