public BestiaryUICollectionInfo GetEntryUICollectionInfo() { BestiaryEntryUnlockState stateByKillCount = CommonEnemyUICollectionInfoProvider.GetUnlockStateByKillCount(Main.BestiaryTracker.Kills.GetKillCount(this._persistentIdentifierToCheck), this._quickUnlock); return(new BestiaryUICollectionInfo() { UnlockState = stateByKillCount }); }
public BestiaryUICollectionInfo GetEntryUICollectionInfo() { BestiaryEntryUnlockState unlockstatus = CommonEnemyUICollectionInfoProvider.GetUnlockStateByKillCount(Main.BestiaryTracker.Kills.GetKillCount(this._persistentIdentifierToCheck), false); if (!this.IsIncludedInCurrentWorld()) { unlockstatus = this.GetLowestAvailableUnlockStateFromEntriesThatAreInWorld(unlockstatus); } return(new BestiaryUICollectionInfo() { UnlockState = unlockstatus }); }
public BestiaryUICollectionInfo GetEntryUICollectionInfo() { BestiaryEntryUnlockState bestiaryEntryUnlockState = CommonEnemyUICollectionInfoProvider.GetUnlockStateByKillCount(Main.BestiaryTracker.Kills.GetKillCount(_persistentIdentifierToCheck), quickUnlock: false); if (!IsIncludedInCurrentWorld()) { bestiaryEntryUnlockState = GetLowestAvailableUnlockStateFromEntriesThatAreInWorld(bestiaryEntryUnlockState); } BestiaryUICollectionInfo result = default(BestiaryUICollectionInfo); result.UnlockState = bestiaryEntryUnlockState; return(result); }
public static BestiaryEntry Enemy(int npcNetId) { NPC nPC = ContentSamples.NpcsByNetId[npcNetId]; List <IBestiaryInfoElement> list = new List <IBestiaryInfoElement> { new NPCNetIdBestiaryInfoElement(npcNetId), new NamePlateInfoElement(Lang.GetNPCName(npcNetId).Key, npcNetId), new NPCPortraitInfoElement(ContentSamples.NpcBestiaryRarityStars[npcNetId]) }; foreach (int key2 in Main.RegisterdGameModes.Keys) { list.Add(new NPCStatsReportInfoElement(npcNetId, key2)); } if (nPC.rarity != 0) { list.Add(new RareSpawnBestiaryInfoElement(nPC.rarity)); } IBestiaryUICollectionInfoProvider uIInfoProvider; if (nPC.boss || NPCID.Sets.ShouldBeCountedAsBoss[nPC.type]) { list.Add(new BossBestiaryInfoElement()); uIInfoProvider = new CommonEnemyUICollectionInfoProvider(nPC.GetBestiaryCreditId(), quickUnlock: true); } else { uIInfoProvider = new CommonEnemyUICollectionInfoProvider(nPC.GetBestiaryCreditId(), quickUnlock: false); } string key = Lang.GetNPCName(nPC.netID).Key; key = key.Replace("NPCName.", ""); string text = "Bestiary_FlavorText.npc_" + key; if (Language.Exists(text)) { list.Add(new FlavorTextBestiaryInfoElement(text)); } return(new BestiaryEntry { Icon = new UnlockableNPCEntryIcon(npcNetId), Info = list, UIInfoProvider = uIInfoProvider }); }
private BestiaryEntryUnlockState GetLowestAvailableUnlockStateFromEntriesThatAreInWorld(BestiaryEntryUnlockState unlockstatus) { BestiaryEntryUnlockState bestiaryEntryUnlockState = BestiaryEntryUnlockState.CanShowDropsWithDropRates_4; int[,] cavernMonsterType = NPC.cavernMonsterType; for (int i = 0; i < cavernMonsterType.GetLength(0); i++) { for (int j = 0; j < cavernMonsterType.GetLength(1); j++) { string persistentId = ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[cavernMonsterType[i, j]]; BestiaryEntryUnlockState unlockStateByKillCount = CommonEnemyUICollectionInfoProvider.GetUnlockStateByKillCount(Main.BestiaryTracker.Kills.GetKillCount(persistentId), quickUnlock: false); if (bestiaryEntryUnlockState > unlockStateByKillCount) { bestiaryEntryUnlockState = unlockStateByKillCount; } } } unlockstatus = bestiaryEntryUnlockState; return(unlockstatus); }
private BestiaryEntryUnlockState GetLowestAvailableUnlockStateFromEntriesThatAreInWorld( BestiaryEntryUnlockState unlockstatus) { BestiaryEntryUnlockState entryUnlockState = BestiaryEntryUnlockState.CanShowDropsWithDropRates_4; int[,] cavernMonsterType = NPC.cavernMonsterType; for (int index1 = 0; index1 < cavernMonsterType.GetLength(0); ++index1) { for (int index2 = 0; index2 < cavernMonsterType.GetLength(1); ++index2) { string creditIdsByNpcNetId = ContentSamples.NpcBestiaryCreditIdsByNpcNetIds[cavernMonsterType[index1, index2]]; BestiaryEntryUnlockState stateByKillCount = CommonEnemyUICollectionInfoProvider.GetUnlockStateByKillCount(Main.BestiaryTracker.Kills.GetKillCount(creditIdsByNpcNetId), false); if (entryUnlockState > stateByKillCount) { entryUnlockState = stateByKillCount; } } } unlockstatus = entryUnlockState; return(unlockstatus); }