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

◆ TownNPC()

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

Definition at line 61 of file BestiaryEntry.cs.

62 {
65 {
66 new NPCNetIdBestiaryInfoElement(npcNetId),
67 new NamePlateInfoElement(Lang.GetNPCName(npcNetId).Key, npcNetId),
68 new NPCPortraitInfoElement(ContentSamples.NpcBestiaryRarityStars[npcNetId]),
69 new NPCKillCounterInfoElement(npcNetId)
70 };
71 string key = Lang.GetNPCName(nPC.netID).Key;
72 key = key.Replace("NPCName.", "");
73 string text = "Bestiary_FlavorText.npc_" + key;
74 if (Language.Exists(text))
75 {
76 list.Add(new FlavorTextBestiaryInfoElement(text));
77 }
78 return new BestiaryEntry
79 {
80 Icon = new UnlockableNPCEntryIcon(npcNetId),
81 Info = list,
82 UIInfoProvider = new TownNPCUICollectionInfoProvider(nPC.GetBestiaryCreditId())
83 };
84 }
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: