TModLoader v1.4.4.9
TModLoader 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 }
IBestiaryUICollectionInfoProvider UIInfoProvider
static Dictionary< int, int > NpcBestiaryRarityStars
The number of stars a given NPC type (F:Terraria.NPC.type) shows in the Bestiary. Set in M:Terraria...
static Dictionary< int, NPC > NpcsByNetId
The default T:Terraria.NPC for a given NPC type (F:Terraria.NPC.type). Note that these entries do n...
This class stores instances of various content types in a number of dictionaries. These instances ser...
static bool Exists(string key)
Checks if a LocalizedText with the provided key has been registered or not. This can be used to avoid...
Definition Language.cs:76
Contains methods to access or retrieve localization values. The Localization Guideteaches more about ...
Definition Language.cs:12

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

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

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