Calamity Relics now only show in the Bestiary in Master/Rev
This commit is contained in:
1 parent
3c41f0d156
commit
86dc4cf67e
32 files changed
+63
-32
No files matched your search
@@ -510,7 +510,7 @@ namespace CalamityMod.NPCs.AcidRain
|
||||
postPolter.AddFail(ModContent.ItemType<SpentFuelContainer>(), hideLootReport: DownedBossSystem.downedPolterghast);
|
||||
|
||||
npcLoot.Add(ModContent.ItemType<CragmawMireTrophy>(), 10);
|
||||
npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType<CragmawMireRelic>(), 4);
|
||||
npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType<CragmawMireRelic>(), 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -452,7 +452,7 @@ namespace CalamityMod.NPCs.AcidRain
|
||||
npcLoot.Add(ItemID.SharkFin, 1, 2, 4);
|
||||
npcLoot.Add(ModContent.ItemType<SulphuricAcidCannon>(), 3);
|
||||
npcLoot.Add(ModContent.ItemType<MaulerTrophy>(), 10);
|
||||
npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType<MaulerRelic>(), 4);
|
||||
npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType<MaulerRelic>(), 4);
|
||||
}
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
|
||||
@@ -525,7 +525,7 @@ namespace CalamityMod.NPCs.AcidRain
|
||||
npcLoot.Add(ModContent.ItemType<GammaHeart>(), 3);
|
||||
npcLoot.Add(ModContent.ItemType<PhosphorescentGauntlet>(), 3);
|
||||
npcLoot.Add(ModContent.ItemType<NuclearTerrorTrophy>(), 10);
|
||||
npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType<NuclearTerrorRelic>(), 4);
|
||||
npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType<NuclearTerrorRelic>(), 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -248,7 +248,7 @@ namespace CalamityMod.NPCs.AquaticScourge
|
||||
|
||||
npcLoot.DefineConditionalDropSet(() => true).Add(DropHelper.PerPlayer(ItemID.GreaterHealingPotion, 1, 5, 15), hideLootReport: true); // Healing Potions don't show up in the Bestiary
|
||||
npcLoot.Add(ModContent.ItemType<AquaticScourgeTrophy>(), 10);
|
||||
npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType<AquaticScourgeRelic>());
|
||||
npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType<AquaticScourgeRelic>());
|
||||
|
||||
// Lore
|
||||
bool firstASKill() => !DownedBossSystem.downedAquaticScourge;
|
||||
|
||||
@@ -361,7 +361,7 @@ namespace CalamityMod.NPCs.AstrumAureus
|
||||
npcLoot.Add(ModContent.ItemType<AstrumAureusTrophy>(), 10);
|
||||
|
||||
// Relic
|
||||
npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType<AstrumAureusRelic>());
|
||||
npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType<AstrumAureusRelic>());
|
||||
|
||||
// Lore
|
||||
npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedAstrumAureus, ModContent.ItemType<KnowledgeAstrumAureus>(), desc: DropHelper.FirstKillText);
|
||||
|
||||
@@ -322,8 +322,7 @@ namespace CalamityMod.NPCs.AstrumDeus
|
||||
lastWorm.Add(ModContent.ItemType<AstrumDeusTrophy>(), 10);
|
||||
|
||||
// Relic
|
||||
bool shouldDropRelic(DropAttemptInfo info) => (CalamityWorld.revenge || Main.masterMode) && !ShouldNotDropThings(info.npc);
|
||||
npcLoot.AddIf(shouldDropRelic, ModContent.ItemType<AstrumDeusRelic>());
|
||||
npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).AddIf((info) => !ShouldNotDropThings(info.npc), ModContent.ItemType<AstrumDeusRelic>());
|
||||
|
||||
// Fragments
|
||||
lastWorm.Add(DropHelper.NormalVsExpertQuantity(ItemID.FragmentSolar, 1, 16, 24, 20, 32));
|
||||
|
||||
@@ -209,7 +209,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental
|
||||
npcLoot.Add(ModContent.ItemType<BrimstoneElementalTrophy>(), 10);
|
||||
|
||||
// Relic
|
||||
npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType<BrimstoneElementalRelic>());
|
||||
npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType<BrimstoneElementalRelic>());
|
||||
|
||||
// Lore
|
||||
npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedBrimstoneElemental, ModContent.ItemType<KnowledgeBrimstoneElemental>(), desc: DropHelper.FirstKillText);
|
||||
|
||||
@@ -438,7 +438,7 @@ namespace CalamityMod.NPCs.Bumblebirb
|
||||
npcLoot.Add(ModContent.ItemType<DragonfollyTrophy>(), 10);
|
||||
|
||||
// Relic
|
||||
npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType<DragonfollyRelic>());
|
||||
npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType<DragonfollyRelic>());
|
||||
|
||||
// Lore
|
||||
npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedDragonfolly, ModContent.ItemType<KnowledgeDragonfolly>(), desc: DropHelper.FirstKillText);
|
||||
|
||||
@@ -212,7 +212,7 @@ namespace CalamityMod.NPCs.Calamitas
|
||||
npcLoot.Add(ModContent.ItemType<CalamitasTrophy>(), 10);
|
||||
|
||||
// Relic
|
||||
npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType<CalamitasCloneRelic>());
|
||||
npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType<CalamitasCloneRelic>());
|
||||
|
||||
// Lore
|
||||
npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedCalamitas, ModContent.ItemType<KnowledgeCalamitasClone>(), desc: DropHelper.FirstKillText);
|
||||
|
||||
@@ -225,7 +225,7 @@ namespace CalamityMod.NPCs.CeaselessVoid
|
||||
npcLoot.Add(ModContent.ItemType<CeaselessVoidTrophy>(), 10);
|
||||
|
||||
// Relic
|
||||
npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType<CeaselessVoidRelic>());
|
||||
npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType<CeaselessVoidRelic>());
|
||||
|
||||
// Lore
|
||||
npcLoot.AddConditionalPerPlayer(LastSentinelKilled, ModContent.ItemType<KnowledgeSentinels>(), desc: DropHelper.SentinelText);
|
||||
|
||||
@@ -835,7 +835,7 @@ namespace CalamityMod.NPCs.Crabulon
|
||||
npcLoot.Add(ModContent.ItemType<CrabulonTrophy>(), 10);
|
||||
|
||||
// Relic
|
||||
npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType<CrabulonRelic>());
|
||||
npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType<CrabulonRelic>());
|
||||
|
||||
// Lore
|
||||
npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedCrabulon, ModContent.ItemType<KnowledgeCrabulon>(), desc: DropHelper.FirstKillText);
|
||||
|
||||
@@ -1184,7 +1184,7 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
npcLoot.Add(ModContent.ItemType<CryogenTrophy>(), 10);
|
||||
|
||||
// Relic
|
||||
npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType<CryogenRelic>());
|
||||
npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType<CryogenRelic>());
|
||||
|
||||
// Lore
|
||||
npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedCryogen, ModContent.ItemType<KnowledgeCryogen>(), desc: DropHelper.FirstKillText);
|
||||
|
||||
@@ -727,7 +727,7 @@ namespace CalamityMod.NPCs.DesertScourge
|
||||
npcLoot.Add(ModContent.ItemType<DesertScourgeTrophy>(), 10);
|
||||
|
||||
// Relic
|
||||
npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType<DesertScourgeRelic>());
|
||||
npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType<DesertScourgeRelic>());
|
||||
|
||||
// Lore
|
||||
npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedDesertScourge, ModContent.ItemType<KnowledgeDesertScourge>(), desc: DropHelper.FirstKillText);
|
||||
|
||||
@@ -2399,7 +2399,7 @@ namespace CalamityMod.NPCs.DevourerofGods
|
||||
}
|
||||
|
||||
// Relic
|
||||
npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType<DevourerOfGodsRelic>());
|
||||
npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType<DevourerOfGodsRelic>());
|
||||
|
||||
// Trophy (always directly from boss, never in bag)
|
||||
npcLoot.Add(ModContent.ItemType<DevourerofGodsTrophy>(), 10);
|
||||
|
||||
@@ -1346,7 +1346,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares
|
||||
mainDrops.Add(ItemDropRule.ByCondition(DropHelper.If(info => info.npc.type == ModContent.NPCType<Apollo.Apollo>()), ModContent.ItemType<ApolloTrophy>()));
|
||||
|
||||
// Relic
|
||||
mainDrops.Add(ItemDropRule.ByCondition(DropHelper.If(() => Main.masterMode || CalamityWorld.revenge), ModContent.ItemType<DraedonRelic>()));
|
||||
npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).AddIf(CanDropLoot, ModContent.ItemType<DraedonRelic>());
|
||||
|
||||
// Lore item
|
||||
mainDrops.Add(ItemDropRule.ByCondition(DropHelper.If(() => !DownedBossSystem.downedExoMechs, desc: DropHelper.FirstKillText), ModContent.ItemType<KnowledgeExoMechs>()));
|
||||
|
||||
@@ -639,7 +639,7 @@ namespace CalamityMod.NPCs.GreatSandShark
|
||||
npcLoot.Add(ModContent.ItemType<GreatSandSharkTrophy>(), 10);
|
||||
|
||||
// Relic
|
||||
npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType<GreatSandSharkRelic>(), 4);
|
||||
npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType<GreatSandSharkRelic>(), 4);
|
||||
}
|
||||
|
||||
public override void OnKill()
|
||||
|
||||
@@ -1163,7 +1163,7 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
npcLoot.Add(ModContent.ItemType<HiveMindTrophy>(), 10);
|
||||
|
||||
// Relic
|
||||
npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType<HiveMindRelic>());
|
||||
npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType<HiveMindRelic>());
|
||||
|
||||
// Lore
|
||||
npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedHiveMind, ModContent.ItemType<KnowledgeHiveMind>(), desc: DropHelper.FirstKillText);
|
||||
|
||||
@@ -800,7 +800,7 @@ namespace CalamityMod.NPCs.Leviathan
|
||||
}
|
||||
|
||||
// Relic
|
||||
npcLoot.AddIf(() => (Main.masterMode || CalamityWorld.revenge) && LastAnLStanding(), ModContent.ItemType<LeviathanAnahitaRelic>());
|
||||
npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).AddIf((info) => LastAnLStanding(), ModContent.ItemType<LeviathanAnahitaRelic>());
|
||||
|
||||
// Lore
|
||||
bool shouldDropLore(DropAttemptInfo info) => !DownedBossSystem.downedLeviathan && LastAnLStanding();
|
||||
|
||||
@@ -447,7 +447,7 @@ namespace CalamityMod.NPCs.OldDuke
|
||||
npcLoot.Add(ModContent.ItemType<OldDukeTrophy>(), 10);
|
||||
|
||||
// Relic
|
||||
npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType<OldDukeRelic>());
|
||||
npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType<OldDukeRelic>());
|
||||
|
||||
// Lore
|
||||
npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedBoomerDuke, ModContent.ItemType<KnowledgeOldDuke>(), desc: DropHelper.FirstKillText);
|
||||
|
||||
@@ -541,7 +541,7 @@ namespace CalamityMod.NPCs.Perforator
|
||||
npcLoot.Add(ModContent.ItemType<PerforatorTrophy>(), 10);
|
||||
|
||||
// Relic
|
||||
npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType<PerforatorsRelic>());
|
||||
npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType<PerforatorsRelic>());
|
||||
|
||||
// Lore
|
||||
npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedPerforator, ModContent.ItemType<KnowledgePerforators>(), desc: DropHelper.FirstKillText);
|
||||
|
||||
@@ -1279,7 +1279,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
|
||||
npcLoot.Add(ModContent.ItemType<PlaguebringerGoliathTrophy>(), 10);
|
||||
|
||||
// Relic
|
||||
npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType<PlaguebringerGoliathRelic>());
|
||||
npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType<PlaguebringerGoliathRelic>());
|
||||
|
||||
// Lore
|
||||
npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedPlaguebringer, ModContent.ItemType<KnowledgePlaguebringerGoliath>(), desc: DropHelper.FirstKillText);
|
||||
|
||||
@@ -1048,7 +1048,7 @@ namespace CalamityMod.NPCs.Polterghast
|
||||
npcLoot.Add(ModContent.ItemType<PolterghastTrophy>(), 10);
|
||||
|
||||
// Relic
|
||||
npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType<PolterghastRelic>());
|
||||
npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType<PolterghastRelic>());
|
||||
|
||||
// Lore
|
||||
npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedPolterghast, ModContent.ItemType<KnowledgePolterghast>(), desc: DropHelper.FirstKillText);
|
||||
|
||||
@@ -512,7 +512,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians
|
||||
npcLoot.Add(ModContent.ItemType<ProfanedCore>());
|
||||
|
||||
// Relic
|
||||
npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType<ProfanedGuardiansRelic>());
|
||||
npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType<ProfanedGuardiansRelic>());
|
||||
|
||||
// Lore
|
||||
npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedGuardians, ModContent.ItemType<KnowledgeProfanedGuardians>(), desc: DropHelper.FirstKillText);
|
||||
|
||||
@@ -1603,7 +1603,7 @@ namespace CalamityMod.NPCs.Providence
|
||||
npcLoot.Add(ModContent.ItemType<ProvidenceTrophy>(), 10);
|
||||
|
||||
// Relic
|
||||
npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType<ProvidenceRelic>());
|
||||
npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType<ProvidenceRelic>());
|
||||
|
||||
// Lore
|
||||
npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedProvidence, ModContent.ItemType<KnowledgeProvidence>(), desc: DropHelper.FirstKillText);
|
||||
|
||||
@@ -881,7 +881,7 @@ namespace CalamityMod.NPCs.Ravager
|
||||
npcLoot.Add(ModContent.ItemType<RavagerTrophy>(), 10);
|
||||
|
||||
// Relic
|
||||
npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType<RavagerRelic>());
|
||||
npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType<RavagerRelic>());
|
||||
|
||||
// Lore
|
||||
npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedRavager, ModContent.ItemType<KnowledgeRavager>(), desc: DropHelper.FirstKillText);
|
||||
|
||||
@@ -805,7 +805,7 @@ namespace CalamityMod.NPCs.Signus
|
||||
npcLoot.Add(ModContent.ItemType<SignusTrophy>(), 10);
|
||||
|
||||
// Relic
|
||||
npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType<SignusRelic>());
|
||||
npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType<SignusRelic>());
|
||||
|
||||
// Lore
|
||||
npcLoot.AddConditionalPerPlayer(LastSentinelKilled, ModContent.ItemType<KnowledgeSentinels>(), desc: DropHelper.SentinelText);
|
||||
|
||||
@@ -604,7 +604,7 @@ namespace CalamityMod.NPCs.SlimeGod
|
||||
npcLoot.Add(ModContent.ItemType<SlimeGodTrophy>(), 10);
|
||||
|
||||
// Relic
|
||||
npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType<SlimeGodRelic>());
|
||||
npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType<SlimeGodRelic>());
|
||||
|
||||
// Lore
|
||||
npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedSlimeGod, ModContent.ItemType<KnowledgeSlimeGod>(), desc: DropHelper.FirstKillText);
|
||||
|
||||
@@ -980,7 +980,7 @@ namespace CalamityMod.NPCs.StormWeaver
|
||||
npcLoot.Add(ModContent.ItemType<WeaverTrophy>(), 10);
|
||||
|
||||
// Relic
|
||||
npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType<StormWeaverRelic>());
|
||||
npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType<StormWeaverRelic>());
|
||||
|
||||
// Lore
|
||||
npcLoot.AddConditionalPerPlayer(LastSentinelKilled, ModContent.ItemType<KnowledgeSentinels>(), desc: DropHelper.SentinelText);
|
||||
|
||||
@@ -474,7 +474,7 @@ namespace CalamityMod.NPCs.SunkenSea
|
||||
npcLoot.Add(ModContent.ItemType<GiantClamTrophy>(), 10);
|
||||
|
||||
// Relic
|
||||
npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType<GiantClamRelic>(), 4);
|
||||
npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType<GiantClamRelic>(), 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2599,7 +2599,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
npcLoot.Add(ModContent.ItemType<SupremeCalamitasTrophy>(), 10);
|
||||
|
||||
// Relic
|
||||
npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType<CalamitasRelic>());
|
||||
npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType<CalamitasRelic>());
|
||||
|
||||
// Lore
|
||||
npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedSCal, ModContent.ItemType<KnowledgeCalamitas>(), desc: DropHelper.FirstKillText);
|
||||
|
||||
@@ -2841,7 +2841,7 @@ namespace CalamityMod.NPCs.Yharon
|
||||
npcLoot.Add(ModContent.ItemType<YharonTrophy>(), 10);
|
||||
|
||||
// Relic
|
||||
npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType<YharonRelic>());
|
||||
npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType<YharonRelic>());
|
||||
|
||||
// Lore
|
||||
npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedYharon, ModContent.ItemType<KnowledgeYharon>(), desc: DropHelper.FirstKillText);
|
||||
|
||||
@@ -9,6 +9,7 @@ using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.GameContent.ItemDropRules;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.Utilities;
|
||||
|
||||
@@ -390,6 +391,24 @@ namespace CalamityMod
|
||||
public string GetConditionDescription() => description;
|
||||
}
|
||||
|
||||
internal class LambdaDropRuleCondition3 : IItemDropRuleCondition
|
||||
{
|
||||
private readonly Func<DropAttemptInfo, bool> conditionLambda;
|
||||
private readonly Func<bool> visibleInUI;
|
||||
private readonly Func<string> description;
|
||||
|
||||
internal LambdaDropRuleCondition3(Func<DropAttemptInfo, bool> lambda, Func<bool> ui, Func<string> desc)
|
||||
{
|
||||
conditionLambda = lambda;
|
||||
visibleInUI = ui;
|
||||
description = desc;
|
||||
}
|
||||
|
||||
public bool CanDrop(DropAttemptInfo info) => conditionLambda(info);
|
||||
public bool CanShowItemDropInUI() => visibleInUI();
|
||||
public string GetConditionDescription() => description();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new LambdaDropRuleCondition which executes the code of your choosing to decide whether this item drop should occur.<br />
|
||||
/// This version of "If" does <b>NOT</b> use the DropAttemptInfo struct that is available.<br />
|
||||
@@ -418,6 +437,11 @@ namespace CalamityMod
|
||||
bool LambdaInfoWrapper(DropAttemptInfo _) => lambda();
|
||||
return new LambdaDropRuleCondition2(LambdaInfoWrapper, ui, desc);
|
||||
}
|
||||
public static IItemDropRuleCondition If(Func<bool> lambda, Func<bool> ui, Func<string> desc)
|
||||
{
|
||||
bool LambdaInfoWrapper(DropAttemptInfo _) => lambda();
|
||||
return new LambdaDropRuleCondition3(LambdaInfoWrapper, ui, desc);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new LambdaDropRuleCondition which executes the code of your choosing to decide whether this item drop should occur.<br />
|
||||
@@ -443,6 +467,10 @@ namespace CalamityMod
|
||||
{
|
||||
return new LambdaDropRuleCondition2(lambda, ui, desc);
|
||||
}
|
||||
public static IItemDropRuleCondition If(Func<DropAttemptInfo, bool> lambda, Func<bool> ui, Func<string> desc)
|
||||
{
|
||||
return new LambdaDropRuleCondition3(lambda, ui, desc);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Drop Rule Conditions
|
||||
@@ -571,6 +599,10 @@ namespace CalamityMod
|
||||
public static IItemDropRuleCondition TrasherText = If((info) => true, true, "Drops if fed to a Trasher");
|
||||
|
||||
public static IItemDropRuleCondition RevNoMaster = If((info) => !Main.masterMode && CalamityWorld.revenge, () => !Main.masterMode && CalamityWorld.revenge, "This is a Revengeance Mode drop rate");
|
||||
public static IItemDropRuleCondition RevAndMaster = If((info) => Main.masterMode || CalamityWorld.revenge, () => Main.masterMode || CalamityWorld.revenge, () =>
|
||||
{
|
||||
return Main.masterMode ? Language.GetTextValue("Bestiary_ItemDropConditions.IsMasterMode") : "This is a Revengeance Mode drop rate";
|
||||
});
|
||||
|
||||
#region Boss Defeat Conditionals
|
||||
public static IItemDropRuleCondition PostKS(bool ui = true) => If(() => NPC.downedSlimeKing, ui, "Drops after defeating King Slime");
|
||||
|
||||
Reference in new issue
Block a user