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

◆ BannerToItem()

static int Terraria.Item.BannerToItem ( int banner)
inlinestatic

Converts a banner ID into the equivalent item type (F:Terraria.Item.type).

Parameters
bannerThe banner ID to convert.
Returns
The item type associated with the given banner ID.
This method will return the wrong item type if banner is not a valid banner ID.

You can get the banner ID of an NPC using M:Terraria.Item.NPCtoBanner(System.Int32).

Definition at line 2094 of file Item.cs.

2095 {
2096 if (NPCLoader.bannerToItem.TryGetValue(banner, out var result))
2097 {
2098 return result;
2099 }
2100 if (banner == 289)
2101 {
2102 return 5352;
2103 }
2104 if (banner >= 276)
2105 {
2106 return 4965 + banner - 276;
2107 }
2108 if (banner >= 274)
2109 {
2110 return 4687 + banner - 274;
2111 }
2112 if (banner == 273)
2113 {
2114 return 4602;
2115 }
2116 if (banner >= 267)
2117 {
2118 return 4541 + banner - 267;
2119 }
2120 if (banner >= 257)
2121 {
2122 return 3837 + banner - 257;
2123 }
2124 if (banner >= 252)
2125 {
2126 return 3789 + banner - 252;
2127 }
2128 if (banner == 251)
2129 {
2130 return 3780;
2131 }
2132 if (banner >= 249)
2133 {
2134 return 3593 + banner - 249;
2135 }
2136 if (banner >= 186)
2137 {
2138 return 3390 + banner - 186;
2139 }
2140 if (banner >= 88)
2141 {
2142 return 2897 + banner - 88;
2143 }
2144 return 1615 + banner - 1;
2145 }
static readonly IDictionary< int, int > bannerToItem
Definition NPCLoader.cs:103
This serves as the central class from which NPC-related functions are carried out....
Definition NPCLoader.cs:26

References Terraria.ModLoader.NPCLoader.bannerToItem.

Referenced by Terraria.Player.ApplyBannerDefenseBuff(), Terraria.Player.ApplyBannerOffenseBuff(), Terraria.NPC.CountKillForBannersAndDropThem(), Terraria.GameContent.Bestiary.CommonEnemyUICollectionInfoProvider.GetKillCountNeeded(), and Terraria.SceneMetrics.ScanAndExportToMain().

+ Here is the caller graph for this function: