Terraria v1.4.4.9
Terraria 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 }
void Add(TKey key, TValue value)
IBestiaryUICollectionInfoProvider UIInfoProvider
static Dictionary< int, int > NpcBestiaryRarityStars
static Dictionary< int, NPC > NpcsByNetId
static bool[] ShouldBeCountedAsBoss
Definition NPCID.cs:4244
static bool Exists(string key)
Definition Language.cs:45

References System.Collections.Generic.Dictionary< TKey, TValue >.Add(), 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, Terraria.ID.NPCID.Sets.ShouldBeCountedAsBoss, System.text, and Terraria.GameContent.Bestiary.BestiaryEntry.UIInfoProvider.

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