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

◆ Critter()

static BestiaryEntry Terraria.GameContent.Bestiary.BestiaryEntry.Critter ( int npcNetId)
inlinestatic

Definition at line 86 of file BestiaryEntry.cs.

87 {
90 {
91 new NPCNetIdBestiaryInfoElement(npcNetId),
92 new NamePlateInfoElement(Lang.GetNPCName(npcNetId).Key, npcNetId),
93 new NPCPortraitInfoElement(ContentSamples.NpcBestiaryRarityStars[npcNetId]),
94 new NPCKillCounterInfoElement(npcNetId)
95 };
96 string key = Lang.GetNPCName(nPC.netID).Key;
97 key = key.Replace("NPCName.", "");
98 string text = "Bestiary_FlavorText.npc_" + key;
99 if (Language.Exists(text))
100 {
101 list.Add(new FlavorTextBestiaryInfoElement(text));
102 }
103 return new BestiaryEntry
104 {
105 Icon = new UnlockableNPCEntryIcon(npcNetId),
106 Info = list,
107 UIInfoProvider = new CritterUICollectionInfoProvider(nPC.GetBestiaryCreditId())
108 };
109 }
void Add(TKey key, TValue value)
IBestiaryUICollectionInfoProvider UIInfoProvider
static Dictionary< int, int > NpcBestiaryRarityStars
static Dictionary< int, NPC > NpcsByNetId
static bool Exists(string key)
Definition Language.cs:45

References Terraria.Localization.Language.Exists(), Terraria.Lang.GetNPCName(), Terraria.GameContent.Bestiary.BestiaryEntry.Icon, Terraria.GameContent.Bestiary.BestiaryEntry.Info, System.key, System.list, Terraria.ID.ContentSamples.NpcBestiaryRarityStars, Terraria.ID.ContentSamples.NpcsByNetId, System.text, and Terraria.GameContent.Bestiary.BestiaryEntry.UIInfoProvider.

Referenced by Terraria.GameContent.Bestiary.BestiaryDatabaseNPCsPopulator.AddEmptyEntries_CrittersAndEnemies_Automated().