Fixed Deus loot duplication
This commit is contained in:
1 parent
c6b90f9af0
commit
48eee51b79
1 file changed
+10
-8
@@ -86,8 +86,8 @@ namespace CalamityMod.NPCs.AstrumDeus
|
||||
//BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.AstralSurface,
|
||||
BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime,
|
||||
|
||||
// Will move to localization whenever that is cleaned up.
|
||||
new FlavorTextBestiaryInfoElement("The fragments of the star god’s corpse still hold some of their former power, and even after succumbing to a dark infection, then being torn apart by an upstart worm, they willfully seek to return to the stars.")
|
||||
// Will move to localization whenever that is cleaned up.
|
||||
new FlavorTextBestiaryInfoElement("The fragments of the star god’s corpse still hold some of their former power, and even after succumbing to a dark infection, then being torn apart by an upstart worm, they willfully seek to return to the stars.")
|
||||
});
|
||||
}
|
||||
|
||||
@@ -228,11 +228,11 @@ namespace CalamityMod.NPCs.AstrumDeus
|
||||
|
||||
public override void BossLoot(ref string name, ref int potionType) => potionType = ModContent.ItemType<Stardust>();
|
||||
|
||||
public bool ShouldNotDropThings() => NPC.Calamity().newAI[0] == 0f || ((CalamityWorld.death || BossRushEvent.BossRushActive) && NPC.Calamity().newAI[0] != 3f);
|
||||
public static bool ShouldNotDropThings(NPC npc) => npc.Calamity().newAI[0] == 0f || ((CalamityWorld.death || BossRushEvent.BossRushActive) && npc.Calamity().newAI[0] != 3f);
|
||||
|
||||
public override bool SpecialOnKill()
|
||||
{
|
||||
if (ShouldNotDropThings())
|
||||
if (ShouldNotDropThings(NPC))
|
||||
return false;
|
||||
|
||||
int closestSegmentID = DropHelper.FindClosestWormSegment(NPC,
|
||||
@@ -246,7 +246,7 @@ namespace CalamityMod.NPCs.AstrumDeus
|
||||
|
||||
public override void OnKill()
|
||||
{
|
||||
if (ShouldNotDropThings())
|
||||
if (ShouldNotDropThings(NPC))
|
||||
return;
|
||||
|
||||
// Killing ANY split Deus makes all other Deus heads die immediately.
|
||||
@@ -280,10 +280,12 @@ namespace CalamityMod.NPCs.AstrumDeus
|
||||
|
||||
public override void ModifyNPCLoot(NPCLoot npcLoot)
|
||||
{
|
||||
npcLoot.Add(ItemDropRule.BossBag(ModContent.ItemType<AstrumDeusBag>()));
|
||||
var lastWorm = npcLoot.DefineConditionalDropSet(info => !ShouldNotDropThings(info.npc));
|
||||
lastWorm.Add(ItemDropRule.BossBag(ModContent.ItemType<AstrumDeusBag>()));
|
||||
|
||||
// Normal drops: Everything that would otherwise be in the bag
|
||||
var normalOnly = npcLoot.DefineNormalOnlyDropSet();
|
||||
var normalOnly = new LeadingConditionRule(new Conditions.NotExpert());
|
||||
lastWorm.Add(normalOnly);
|
||||
{
|
||||
// Weapons
|
||||
int[] weapons = new int[]
|
||||
@@ -316,7 +318,7 @@ namespace CalamityMod.NPCs.AstrumDeus
|
||||
npcLoot.Add(DropHelper.NormalVsExpertQuantity(ItemID.FragmentStardust, 1, 16, 24, 20, 32));
|
||||
|
||||
// Lore
|
||||
bool firstDeusKill() => !DownedBossSystem.downedAstrumDeus;
|
||||
bool firstDeusKill(DropAttemptInfo info) => !DownedBossSystem.downedAstrumDeus && !ShouldNotDropThings(info.npc);
|
||||
npcLoot.AddConditionalPerPlayer(firstDeusKill, ModContent.ItemType<KnowledgeAstrumDeus>());
|
||||
npcLoot.AddConditionalPerPlayer(firstDeusKill, ModContent.ItemType<KnowledgeAstralInfection>());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user