Terraria v1.4.4.9
Terraria 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 }
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.AddTownNPCs_Manual().