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

◆ Enemy()

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

Definition at line 21 of file BestiaryEntry.cs.

22 {
25 {
26 new NPCNetIdBestiaryInfoElement(npcNetId),
27 new NamePlateInfoElement(Lang.GetNPCName(npcNetId).Key, npcNetId),
28 new NPCPortraitInfoElement(ContentSamples.NpcBestiaryRarityStars[npcNetId]),
29 new NPCKillCounterInfoElement(npcNetId)
30 };
31 list.Add(new NPCStatsReportInfoElement(npcNetId));
32 if (nPC.rarity != 0)
33 {
34 list.Add(new RareSpawnBestiaryInfoElement(nPC.rarity));
35 }
36 IBestiaryUICollectionInfoProvider uIInfoProvider;
37 if (nPC.boss || NPCID.Sets.ShouldBeCountedAsBoss[nPC.type])
38 {
39 list.Add(new BossBestiaryInfoElement());
40 uIInfoProvider = new CommonEnemyUICollectionInfoProvider(nPC.GetBestiaryCreditId(), quickUnlock: true);
41 }
42 else
43 {
44 uIInfoProvider = new CommonEnemyUICollectionInfoProvider(nPC.GetBestiaryCreditId(), quickUnlock: false);
45 }
46 string key = Lang.GetNPCName(nPC.netID).Key;
47 key = key.Replace("NPCName.", "");
48 string text = "Bestiary_FlavorText.npc_" + key;
49 if (Language.Exists(text))
50 {
51 list.Add(new FlavorTextBestiaryInfoElement(text));
52 }
53 return new BestiaryEntry
54 {
55 Icon = new UnlockableNPCEntryIcon(npcNetId),
56 Info = list,
58 };
59 }
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[] ShouldBeCountedAsBoss
If true for a given NPC type (F:Terraria.NPC.type), then that NPC is sorted with bosses despite F:Ter...
Definition NPCID.cs:577
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, Terraria.ID.NPCID.Sets.ShouldBeCountedAsBoss, and Terraria.GameContent.Bestiary.BestiaryEntry.UIInfoProvider.

Referenced by Terraria.GameContent.Bestiary.BestiaryDatabaseNPCsPopulator.AddEmptyEntries_CrittersAndEnemies_Automated(), and Terraria.GameContent.Bestiary.BestiaryDatabaseNPCsPopulator.AddMultiEntryNPCS_Manual().

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