Sweeping changes to crate loot

Including removal of most biome-specific material drops
Includes the Hardmode ore crate bug fix at long last
Also adds alternative Auric Ore obtainment method
This commit is contained in:
CongratsIsTrash committed 2025-11-26 14:16:59 -05:00
1 parent 1eff672eaa
commit 5d15472cb7
12 files changed
+507 -447

No files matched your search

+9
View File
@@ -0,0 +1,9 @@
namespace CalamityMod.Enums
{
public enum HardmodeCrateType
{
Biome,
Mythril,
Titanium
}
}
+83 -68
View File
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using CalamityMod.Enums;
using CalamityMod.Items.Accessories;
using CalamityMod.Items.Materials;
using CalamityMod.Items.PermanentBoosters;
@@ -25,12 +26,6 @@ namespace CalamityMod.Items
public override void ModifyItemLoot(Item item, ItemLoot loot)
{
Fraction fifteenPercent = new Fraction(15, 100);
static bool CryonicAvailable()
{
if (!DownedBossSystem.downedCryogen)
return false;
return (NPC.downedMechBoss1.ToInt() + NPC.downedMechBoss2.ToInt() + NPC.downedMechBoss3.ToInt()) >= 2;
}
switch (item.type)
{
@@ -270,91 +265,47 @@ namespace CalamityMod.Items
#endregion
#region Fishing Crates
// TODO -- What is all this shit?
case ItemID.WoodenCrate:
case ItemID.WoodenCrateHard:
loot.Add(ModContent.ItemType<WulfrumMetalScrap>(), 4, 3, 5); // 25% 3-5 Wulfrum Scrap
// We do not need to pop Hardmode ores out of Pearlwood Crates. They do not drop higher tier ores.
break;
case ItemID.IronCrate:
case ItemID.IronCrateHard:
loot.Add(ModContent.ItemType<WulfrumMetalScrap>(), 4, 5, 8); // 25% 5-8 Wulfrum Scrap
loot.Add(ModContent.ItemType<AncientBoneDust>(), 4, 5, 8); // 25% 5-8 Ancient Bone Dust
RemoveHardmodeOresFromStandardCrates(loot);
loot.AddHardmodeOresToCrates(HardmodeCrateType.Mythril);
break;
// these drops are not available in hardmode because this crate will stop dropping
// Non-crafted underground Gold Chest loot @ 20%; Individually 5%
case ItemID.GoldenCrate:
loot.Add(ItemID.FlareGun, 10); // 10% Flare Gun
loot.Add(ItemID.ShoeSpikes, 10); // 10% Shoe Spikes (BUT NOT CLIMBING CLAWS?)
loot.Add(ItemID.BandofRegeneration, 10); // 10% Band of Regeneration
loot.Add(new OneFromOptionsNotScaledWithLuckDropRule(5, 1,
ItemID.FlareGun,
ItemID.Mace,
ItemID.BandofRegeneration,
ItemID.ShoeSpikes)); // Climbing Claws is in Wooden/Pearlwood (vanilla) in case you're curious
break;
case ItemID.GoldenCrateHard:
// Post-Yharon: 15% 30-40 Auric Ore
loot.AddIf(() => DownedBossSystem.downedYharon, ModContent.ItemType<AuricOre>(), fifteenPercent, 30, 40);
RemoveHardmodeOresFromStandardCrates(loot);
loot.AddHardmodeOresToCrates(HardmodeCrateType.Titanium);
loot.Add(new OneFromOptionsNotScaledWithLuckDropRule(5, 1,
ItemID.FlareGun,
ItemID.Mace,
ItemID.BandofRegeneration,
ItemID.ShoeSpikes));
break;
case ItemID.CorruptFishingCrate:
case ItemID.CrimsonFishingCrate:
case ItemID.CorruptFishingCrateHard:
case ItemID.CrimsonFishingCrateHard:
loot.Add(ModContent.ItemType<BlightedGel>(), fifteenPercent, 5, 8); // 15% 5-8 Blighted Gel
break;
case ItemID.HallowedFishingCrate: // WHY
case ItemID.HallowedFishingCrateHard:
var postProv = loot.DefineConditionalDropSet(() => DownedBossSystem.downedProvidence);
postProv.Add(ModContent.ItemType<UnholyEssence>(), fifteenPercent, 5, 10); // 15% 5-10 Unholy Essence
break;
case ItemID.DungeonFishingCrate:
case ItemID.DungeonFishingCrateHard:
loot.AddIf(() => NPC.downedPlantBoss, ItemID.Ectoplasm, 10, 1, 5); // 10% 1-5 Ectoplasm
loot.AddIf(() => DownedBossSystem.downedPolterghast, ModContent.ItemType<Necroplasm>(), 10, 1, 5); // 10% 1-5 Necroplasm
break;
case ItemID.JungleFishingCrate:
case ItemID.JungleFishingCrateHard:
loot.Add(ModContent.ItemType<MurkyPaste>(), new Fraction(1, 5), 1, 3); // 20% 1-3 Murky Paste
var postPlant = loot.DefineConditionalDropSet(() => NPC.downedPlantBoss);
postPlant.Add(ModContent.ItemType<PerennialOre>(), 5, 16, 28); // 20% 16-28 Perennial Ore
postPlant.Add(ModContent.ItemType<PerennialBar>(), fifteenPercent, 4, 7); // 15% 4-7 Perennial Bar
loot.AddIf(() => NPC.downedGolemBoss, ModContent.ItemType<PlagueCellCanister>(), 5, 3, 6); // 20% 3-6 Plague Cell Canister
var uelibloom = loot.DefineConditionalDropSet(() => DownedBossSystem.downedProvidence);
uelibloom.Add(ModContent.ItemType<UelibloomOre>(), 5, 16, 28); // 20% 16-28 Uelibloom Ore
uelibloom.Add(ModContent.ItemType<UelibloomBar>(), fifteenPercent, 4, 7); // 15% 4-7 Uelibloom Bar
break;
case ItemID.FloatingIslandFishingCrate:
case ItemID.FloatingIslandFishingCrateHard:
var evilBossTwo = loot.DefineConditionalDropSet(() => DownedBossSystem.downedHiveMind || DownedBossSystem.downedPerforator);
evilBossTwo.Add(ModContent.ItemType<AerialiteOre>(), 5, 16, 28); // 20% 16-28 Aerialite Ore
evilBossTwo.Add(ModContent.ItemType<AerialiteBar>(), fifteenPercent, 4, 7); // 15% 4-7 Aerialite Bar
loot.AddIf(() => Main.hardMode, ModContent.ItemType<EssenceofSunlight>(), 5, 2, 4); // 20% 2-4 Essence of Sunlight
loot.AddIf(() => NPC.downedMoonlord, ModContent.ItemType<ExodiumCluster>(), 5, 16, 28); // 20% 16-28 Exodium Clusters
break;
case ItemID.FrozenCrate:
case ItemID.FrozenCrateHard:
var cryonic = loot.DefineConditionalDropSet(CryonicAvailable);
cryonic.Add(ModContent.ItemType<CryonicOre>(), 5, 16, 28); // 20% 16-28 Cryonic Ore
cryonic.Add(ModContent.ItemType<CryonicBar>(), fifteenPercent, 4, 7); // 15% 4-7 Cryonic Bar
loot.AddIf(() => Main.hardMode, ModContent.ItemType<EssenceofEleum>(), 5, 2, 4); // 20% 2-4 Essence of Eleum
break;
case ItemID.LavaCrate:
case ItemID.LavaCrateHard:
loot.AddIf(() => Main.hardMode, ModContent.ItemType<EssenceofHavoc>(), 5, 2, 4); // 20% 2-4 Essence of Havoc
break;
// Calamity does not touch Oasis Crates yet
case ItemID.OasisCrate:
case ItemID.OasisCrateHard:
break;
// Calamity does not touch Ocean Crates yet
case ItemID.OceanCrate:
case ItemID.OceanCrateHard:
RemoveHardmodeOresFromBiomeCrates(loot);
loot.AddHardmodeOresToCrates(HardmodeCrateType.Biome);
break;
#endregion
@@ -525,6 +476,70 @@ namespace CalamityMod.Items
}
#endregion
#region Fishing Crate Loot Rule Manipulation
private static void RemoveHardmodeOresFromStandardCrates(ItemLoot loot)
{
List<IItemDropRule> rules = loot.Get(false);
// This is the primary rule which contains every drop
AlwaysAtleastOneSuccessDropRule mainRule = null;
foreach (IItemDropRule rule in rules)
if (rule is AlwaysAtleastOneSuccessDropRule a)
mainRule = a;
if (mainRule is null)
return;
// Find ones that are supposed to be for the ore and not the other loot
foreach (IItemDropRule rule in mainRule.rules)
{
// Hardmode ores/bars are both nested within *another* nested rule
if (rule is SequentialRulesNotScalingWithLuckRule oreRule)
{
// Confirm that this is for the ore/bar then pop the numerator for the big rule
foreach (IItemDropRule nestedRule in oreRule.rules)
{
if (nestedRule is SequentialRulesNotScalingWithLuckRule s)
{
oreRule.chanceNumerator = 0;
return;
}
}
}
}
}
private static void RemoveHardmodeOresFromBiomeCrates(ItemLoot loot)
{
List<IItemDropRule> rules = loot.Get(false);
// This is the primary rule which contains every drop
AlwaysAtleastOneSuccessDropRule mainRule = null;
foreach (IItemDropRule rule in rules)
if (rule is AlwaysAtleastOneSuccessDropRule a)
mainRule = a;
if (mainRule is null)
return;
// Find ones that are supposed to be for the ore and not the other loot
foreach (IItemDropRule rule in mainRule.rules)
{
// Hardmode ores/bars are both nested within *another* nested rule
if (rule is SequentialRulesNotScalingWithLuckRule oreRule)
{
// Confirm that this is for the ore/bar then pop the numerator for the big rule
foreach (IItemDropRule nestedRule in oreRule.rules)
{
if (nestedRule is OneFromRulesRule o)
{
oreRule.chanceNumerator = 0;
return;
}
}
}
}
}
#endregion
#region Goodie Bag Bat Hook
private static void RemoveBatHookFromGoodieBag(ItemLoot loot)
{
+9 -60
View File
@@ -1,16 +1,6 @@
using CalamityMod.Items.Accessories;
using CalamityMod.Items.Critters;
using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables.Ores;
using CalamityMod.Items.Potions;
using CalamityMod.Items.Weapons.Magic;
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Items.Weapons.Ranged;
using CalamityMod.Items.Weapons.Rogue;
using CalamityMod.Items.Weapons.Summon;
using CalamityMod.Items.Materials;
using CalamityMod.Tiles.Astral;
using Terraria;
using Terraria.GameContent.ItemDropRules;
using Terraria.ID;
using Terraria.ModLoader;
@@ -29,18 +19,11 @@ namespace CalamityMod.Items.Fishing.AstralCatches
public override void SetDefaults()
{
Item.DefaultToPlaceableTile(ModContent.TileType<AstralCrateTile>());
Item.width = 32;
Item.height = 32;
Item.maxStack = 9999;
Item.consumable = true;
Item.rare = ItemRarityID.Green;
Item.value = Item.sellPrice(gold: 1);
Item.createTile = ModContent.TileType<AstralCrateTile>();
Item.useTurn = true;
Item.autoReuse = true;
Item.useAnimation = 15;
Item.useTime = 10;
Item.useStyle = ItemUseStyleID.Swing;
Item.rare = ItemRarityID.Green;
}
public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup)
@@ -51,48 +34,14 @@ namespace CalamityMod.Items.Fishing.AstralCatches
public override bool CanRightClick() => true;
public override void ModifyItemLoot(ItemLoot itemLoot)
{
var postAstrumAureus = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedAstrumAureus);
var postAstrumDeus = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedAstrumDeus);
// 4-10 Starblight Soot @ 50%
// This is our equivalent to Crystal Shards/Ichor
itemLoot.Add(ModContent.ItemType<StarblightSoot>(), 2, 4, 10);
// Materials
itemLoot.Add(ModContent.ItemType<StarblightSoot>(), 1, 5, 10);
itemLoot.Add(ItemID.FallenStar, 1, 5, 10);
itemLoot.Add(ItemID.Meteorite, 5, 10, 20);
itemLoot.Add(ItemID.MeteoriteBar, 10, 1, 3);
// Astrophage @ 5%
itemLoot.Add(ModContent.ItemType<AstrophageItem>(), 20);
postAstrumAureus.Add(ModContent.ItemType<AureusCell>(), 5, 2, 5);
postAstrumDeus.Add(ModContent.ItemType<AstralOre>(), 5, 10, 20);
postAstrumDeus.Add(ModContent.ItemType<AstralBar>(), 10, 1, 3);
postAstrumDeus.Add(ModContent.ItemType<MeldBlob>(), 4, 5, 10);
// Weapons (and Starburster Core)
postAstrumAureus.Add(new OneFromOptionsDropRule(10, 1,
ModContent.ItemType<AstralScythe>(),
ModContent.ItemType<TitanArm>(),
ModContent.ItemType<StellarCannon>(),
ModContent.ItemType<AstralachneaStaff>(),
ModContent.ItemType<HivePod>(),
ModContent.ItemType<StellarKnife>(),
ModContent.ItemType<StarbusterCore>()
));
// Pet
itemLoot.Add(ModContent.ItemType<AstrophageItem>(), 10);
// Bait
itemLoot.Add(ModContent.ItemType<TwinklerItem>(), 5, 1, 3);
itemLoot.Add(ItemID.EnchantedNightcrawler, 5, 1, 3);
itemLoot.Add(ModContent.ItemType<ArcturusAstroidean>(), 5, 1, 3);
itemLoot.Add(ItemID.Firefly, 3, 1, 3);
// Potions
postAstrumAureus.Add(ModContent.ItemType<AstralInjection>(), 10, 1, 3);
postAstrumAureus.Add(ModContent.ItemType<GravityNormalizerPotion>(), 10, 1, 3);
itemLoot.AddCratePotionRules();
// Money
itemLoot.Add(ItemID.SilverCoin, 1, 10, 90);
itemLoot.Add(ItemID.GoldCoin, 2, 1, 5);
itemLoot.AddBiomeCrateLootRules();
}
}
}
+6 -31
View File
@@ -1,5 +1,4 @@
using CalamityMod.Items.Critters;
using CalamityMod.Tiles.Astral;
using CalamityMod.Tiles.Astral;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -17,18 +16,11 @@ namespace CalamityMod.Items.Fishing.AstralCatches
public override void SetDefaults()
{
Item.DefaultToPlaceableTile(ModContent.TileType<MonolithCrateTile>());
Item.width = 32;
Item.height = 32;
Item.maxStack = 9999;
Item.consumable = true;
Item.rare = ItemRarityID.Green;
Item.value = Item.sellPrice(gold: 1);
Item.createTile = ModContent.TileType<MonolithCrateTile>();
Item.useTurn = true;
Item.autoReuse = true;
Item.useAnimation = 15;
Item.useTime = 10;
Item.useStyle = ItemUseStyleID.Swing;
Item.rare = ItemRarityID.Green;
}
public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup)
@@ -39,27 +31,10 @@ namespace CalamityMod.Items.Fishing.AstralCatches
public override bool CanRightClick() => true;
public override void ModifyItemLoot(ItemLoot itemLoot)
{
// Materials
itemLoot.Add(ItemID.FallenStar, 1, 5, 10);
itemLoot.Add(ItemID.Meteorite, 5, 10, 20);
itemLoot.Add(ItemID.MeteoriteBar, 10, 1, 3);
// Astrophage @ 5%
itemLoot.Add(ModContent.ItemType<AstrophageItem>(), 20);
// Pet
itemLoot.Add(ModContent.ItemType<AstrophageItem>(), 10);
// Bait
itemLoot.Add(ModContent.ItemType<TwinklerItem>(), 5, 1, 3);
itemLoot.Add(ItemID.EnchantedNightcrawler, 5, 1, 3);
itemLoot.Add(ModContent.ItemType<ArcturusAstroidean>(), 5, 1, 3);
itemLoot.Add(ItemID.Firefly, 3, 1, 3);
// Potions
itemLoot.AddCratePotionRules(false);
// Money
itemLoot.Add(ItemID.SilverCoin, 1, 10, 90);
itemLoot.Add(ItemID.GoldCoin, 2, 1, 5);
itemLoot.AddBiomeCrateLootRules(false);
}
}
}
@@ -1,6 +1,4 @@
using CalamityMod.Items.Materials;
using CalamityMod.Items.Potions;
using CalamityMod.Tiles.Crags;
using CalamityMod.Tiles.Crags;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -42,28 +40,7 @@ namespace CalamityMod.Items.Fishing.BrimstoneCragCatches
public override bool CanRightClick() => true;
public override void ModifyItemLoot(ItemLoot itemLoot)
{
// Materials
itemLoot.Add(ItemID.Obsidian, 1, 2, 5);
itemLoot.Add(ItemID.Hellstone, 4, 2, 5);
itemLoot.Add(ItemID.HellstoneBar, 10, 1, 3);
itemLoot.Add(ModContent.ItemType<DemonicBoneAsh>(), 1, 1, 4);
itemLoot.AddIf(() => DownedBossSystem.downedBrimstoneElemental, ModContent.ItemType<UnholyCore>(), 10, 1, 3);
itemLoot.AddIf(() => DownedBossSystem.downedProvidence, ModContent.ItemType<Bloodstone>(), 2, 1, 3);
// Weapons (none)
// Bait
itemLoot.Add(ItemID.MasterBait, 10, 1, 2);
itemLoot.Add(ItemID.JourneymanBait, 5, 1, 3);
itemLoot.Add(ItemID.ApprenticeBait, 3, 2, 3);
// Potions
itemLoot.Add(ItemID.InfernoPotion, 10, 1, 3);
itemLoot.AddCratePotionRules();
// Money
itemLoot.Add(ItemID.SilverCoin, 1, 10, 90);
itemLoot.Add(ItemID.GoldCoin, 2, 1, 5);
itemLoot.AddBiomeCrateLootRules();
}
}
}
@@ -1,5 +1,4 @@
using CalamityMod.Items.Materials;
using CalamityMod.Tiles.Crags;
using CalamityMod.Tiles.Crags;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -17,18 +16,11 @@ namespace CalamityMod.Items.Fishing.BrimstoneCragCatches
public override void SetDefaults()
{
Item.DefaultToPlaceableTile(ModContent.TileType<SlagCrateTile>());
Item.width = 32;
Item.height = 32;
Item.maxStack = 9999;
Item.consumable = true;
Item.rare = ItemRarityID.Green;
Item.value = Item.sellPrice(gold: 1);
Item.createTile = ModContent.TileType<SlagCrateTile>();
Item.useTurn = true;
Item.autoReuse = true;
Item.useAnimation = 15;
Item.useTime = 10;
Item.useStyle = ItemUseStyleID.Swing;
Item.rare = ItemRarityID.Green;
}
public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup)
@@ -39,26 +31,7 @@ namespace CalamityMod.Items.Fishing.BrimstoneCragCatches
public override bool CanRightClick() => true;
public override void ModifyItemLoot(ItemLoot itemLoot)
{
// Materials
itemLoot.Add(ItemID.Obsidian, 1, 2, 5);
itemLoot.Add(ItemID.Hellstone, 4, 2, 5);
itemLoot.Add(ItemID.HellstoneBar, 10, 1, 3);
itemLoot.Add(ModContent.ItemType<DemonicBoneAsh>(), 1, 1, 4);
// Weapons (none)
// Bait
itemLoot.Add(ItemID.MasterBait, 10, 1, 2);
itemLoot.Add(ItemID.JourneymanBait, 5, 1, 3);
itemLoot.Add(ItemID.ApprenticeBait, 3, 2, 3);
// Potions
itemLoot.Add(ItemID.InfernoPotion, 10, 1, 3);
itemLoot.AddCratePotionRules(false);
// Money
itemLoot.Add(ItemID.SilverCoin, 1, 10, 90);
itemLoot.Add(ItemID.GoldCoin, 2, 1, 5);
itemLoot.AddBiomeCrateLootRules(false);
}
}
}
@@ -1,9 +1,6 @@
using CalamityMod.Items.Accessories;
using CalamityMod.Items.Materials;
using CalamityMod.Items.Pets;
using CalamityMod.Items.Placeables;
using CalamityMod.Items.Placeables.Ores;
using CalamityMod.Items.Potions;
using CalamityMod.Items.Placeables.Furniture;
using CalamityMod.Items.Tools.ClimateChange;
using CalamityMod.Items.Weapons.Magic;
using CalamityMod.Items.Weapons.Melee;
@@ -31,18 +28,11 @@ namespace CalamityMod.Items.Fishing.SulphurCatches
public override void SetDefaults()
{
Item.DefaultToPlaceableTile(ModContent.TileType<HydrothermalCrateTile>());
Item.width = 32;
Item.height = 32;
Item.maxStack = 9999;
Item.consumable = true;
Item.rare = ItemRarityID.Green;
Item.value = Item.sellPrice(gold: 1);
Item.createTile = ModContent.TileType<HydrothermalCrateTile>();
Item.useTurn = true;
Item.autoReuse = true;
Item.useAnimation = 15;
Item.useTime = 10;
Item.useStyle = ItemUseStyleID.Swing;
Item.rare = ItemRarityID.Green;
}
public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup)
@@ -53,51 +43,29 @@ namespace CalamityMod.Items.Fishing.SulphurCatches
public override bool CanRightClick() => true;
public override void ModifyItemLoot(ItemLoot itemLoot)
{
// The contents of this crate depend massively on progression, so it uses a large number of LeadingConditionRules.
var tier1AbyssAvailable = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedSlimeGod || Main.hardMode);
var tier2AbyssAvailable = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedLeviathan);
var scoriaAvailable = itemLoot.DefineConditionalDropSet(() => NPC.downedGolemBoss);
var tier1AcidRain = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedEoCAcidRain);
var tier2AcidRain = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedAquaticScourgeAcidRain);
var tier3AcidRain = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedPolterghast && DownedBossSystem.downedBoomerDuke);
// 20-50 Blocks @ 100%; Individually 33.33%
itemLoot.Add(new OneFromRulesRule(1, new IItemDropRule[3]
{
ItemDropRule.NotScalingWithLuck(ModContent.ItemType<Placeables.SulphurousSand>(), 1, 20, 50),
ItemDropRule.NotScalingWithLuck(ModContent.ItemType<Placeables.SulphurousSandstone>(), 1, 20, 50),
ItemDropRule.NotScalingWithLuck(ModContent.ItemType<Placeables.HardenedSulphurousSandstone>(), 1, 20, 50)
}));
// Materials
itemLoot.Add(ModContent.ItemType<Items.Placeables.SulphurousSand>(), 1, 5, 10);
itemLoot.Add(ModContent.ItemType<Items.Placeables.SulphurousSandstone>(), 1, 5, 10);
itemLoot.Add(ModContent.ItemType<Items.Placeables.HardenedSulphurousSandstone>(), 1, 5, 10);
itemLoot.Add(ModContent.ItemType<Acidwood>(), 1, 5, 10);
tier1AcidRain.Add(ModContent.ItemType<SulphuricScale>(), 10, 1, 3);
tier2AcidRain.Add(ModContent.ItemType<CorrodedFossil>(), 10, 1, 3);
tier2AbyssAvailable.Add(ModContent.ItemType<DepthCells>(), 5, 2, 5);
tier2AbyssAvailable.Add(ModContent.ItemType<Lumenyl>(), 5, 2, 5);
tier2AbyssAvailable.Add(ModContent.ItemType<Items.Placeables.PlantyMush>(), 5, 2, 5);
scoriaAvailable.Add(ModContent.ItemType<ScoriaOre>(), 5, 16, 28);
scoriaAvailable.Add(ModContent.ItemType<ScoriaBar>(), new Fraction(15, 100), 4, 7);
tier3AcidRain.Add(ModContent.ItemType<ReaperTooth>(), 10, 1, 5);
// Rusty Chest Loot @ 100%; Individually 25%
itemLoot.Add(new OneFromOptionsNotScaledWithLuckDropRule(1, 1,
ModContent.ItemType<BrokenWaterFilter>(),
ModContent.ItemType<EffigyOfDecay>(),
ModContent.ItemType<RustyBeaconPrototype>(),
ModContent.ItemType<RustyMedallion>()
));
// Pre-HM Abyss Weapons
tier1AbyssAvailable.Add(new OneFromOptionsDropRule(10, 1,
itemLoot.Add(new OneFromOptionsDropRule(10, 1,
ModContent.ItemType<BallOFugu>(),
ModContent.ItemType<Archerfish>(),
ModContent.ItemType<BlackAnurian>(),
ModContent.ItemType<HerringStaff>(),
ModContent.ItemType<Lionfish>()
));
// Post-AS Acid Rain Weapons (and Nuclear Rod)
tier2AcidRain.Add(new OneFromOptionsDropRule(10, 1,
ModContent.ItemType<SulphurousGrabber>(),
ModContent.ItemType<FlakToxicannon>(),
ModContent.ItemType<BelchingSaxophone>(),
ModContent.ItemType<SlitheringEels>(),
ModContent.ItemType<SkyfinBombers>(),
ModContent.ItemType<SpentFuelContainer>(),
ModContent.ItemType<NuclearFuelRod>()
));
// Pre-HM Abyss Equipment (and Torrential Tear)
tier1AbyssAvailable.Add(new OneFromOptionsDropRule(4, 1,
ModContent.ItemType<Lionfish>(),
ModContent.ItemType<AnechoicPlating>(),
ModContent.ItemType<DepthCharm>(),
ModContent.ItemType<IronBoots>(),
@@ -105,18 +73,7 @@ namespace CalamityMod.Items.Fishing.SulphurCatches
ModContent.ItemType<TorrentialTear>()
));
// Bait
itemLoot.Add(ItemID.MasterBait, 10, 1, 2);
itemLoot.Add(ItemID.JourneymanBait, 5, 1, 3);
itemLoot.Add(ItemID.ApprenticeBait, 3, 2, 3);
// Potions
itemLoot.Add(ModContent.ItemType<AnechoicCoating>(), 10, 1, 3);
itemLoot.AddCratePotionRules();
// Money
itemLoot.Add(ItemID.SilverCoin, 1, 10, 90);
itemLoot.Add(ItemID.GoldCoin, 2, 1, 5);
itemLoot.AddBiomeCrateLootRules();
}
}
}
+18 -57
View File
@@ -1,19 +1,11 @@
using CalamityMod.Items.Accessories;
using CalamityMod.Items.Materials;
using CalamityMod.Items.Pets;
using CalamityMod.Items.Placeables;
using CalamityMod.Items.Potions;
using CalamityMod.Items.Tools.ClimateChange;
using CalamityMod.Items.Weapons.Magic;
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Items.Weapons.Ranged;
using CalamityMod.Items.Weapons.Rogue;
using CalamityMod.Items.Placeables.Furniture;
using CalamityMod.Items.Weapons.Summon;
using CalamityMod.Tiles.Abyss;
using Terraria;
using Terraria.GameContent.ItemDropRules;
using Terraria.ID;
using Terraria.ModLoader;
using CrateTile = CalamityMod.Tiles.Abyss.SulphurousCrateTile;
namespace CalamityMod.Items.Fishing.SulphurCatches
{
@@ -29,18 +21,11 @@ namespace CalamityMod.Items.Fishing.SulphurCatches
public override void SetDefaults()
{
Item.DefaultToPlaceableTile(ModContent.TileType<SulphurousCrateTile>());
Item.width = 32;
Item.height = 32;
Item.maxStack = 9999;
Item.consumable = true;
Item.rare = ItemRarityID.Green;
Item.value = Item.sellPrice(gold: 1);
Item.createTile = ModContent.TileType<CrateTile>();
Item.useTurn = true;
Item.autoReuse = true;
Item.useAnimation = 15;
Item.useTime = 10;
Item.useStyle = ItemUseStyleID.Swing;
Item.rare = ItemRarityID.Green;
}
public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup)
@@ -51,47 +36,23 @@ namespace CalamityMod.Items.Fishing.SulphurCatches
public override bool CanRightClick() => true;
public override void ModifyItemLoot(ItemLoot itemLoot)
{
var tier1AbyssAvailable = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedSlimeGod || Main.hardMode);
var tier1AcidRain = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedEoCAcidRain);
// 20-50 Blocks @ 100%; Individually 33.33%
itemLoot.Add(new OneFromRulesRule(1, new IItemDropRule[3]
{
ItemDropRule.NotScalingWithLuck(ModContent.ItemType<Placeables.SulphurousSand>(), 1, 20, 50),
ItemDropRule.NotScalingWithLuck(ModContent.ItemType<Placeables.SulphurousSandstone>(), 1, 20, 50),
ItemDropRule.NotScalingWithLuck(ModContent.ItemType<Placeables.HardenedSulphurousSandstone>(), 1, 20, 50)
}));
// Materials
itemLoot.Add(ModContent.ItemType<SulphurousSand>(), 1, 5, 10);
itemLoot.Add(ModContent.ItemType<SulphurousSandstone>(), 1, 5, 10);
itemLoot.Add(ModContent.ItemType<HardenedSulphurousSandstone>(), 1, 5, 10);
itemLoot.Add(ModContent.ItemType<Acidwood>(), 1, 5, 10);
tier1AcidRain.Add(ModContent.ItemType<SulphuricScale>(), 10, 1, 3);
// Pre-HM Abyss Weapons
tier1AbyssAvailable.Add(new OneFromOptionsDropRule(10, 1,
ModContent.ItemType<BallOFugu>(),
ModContent.ItemType<Archerfish>(),
ModContent.ItemType<BlackAnurian>(),
ModContent.ItemType<HerringStaff>(),
ModContent.ItemType<Lionfish>()
// Rusty Chest Loot @ 100%; Individually 25%
itemLoot.Add(new OneFromOptionsNotScaledWithLuckDropRule(1, 1,
ModContent.ItemType<BrokenWaterFilter>(),
ModContent.ItemType<EffigyOfDecay>(),
ModContent.ItemType<RustyBeaconPrototype>(),
ModContent.ItemType<RustyMedallion>()
));
// Pre-HM Abyss Equipment (and Torrential Tear)
tier1AbyssAvailable.Add(new OneFromOptionsDropRule(4, 1,
ModContent.ItemType<AnechoicPlating>(),
ModContent.ItemType<DepthCharm>(),
ModContent.ItemType<IronBoots>(),
ModContent.ItemType<StrangeOrb>(),
ModContent.ItemType<TorrentialTear>()
));
// Bait
itemLoot.Add(ItemID.MasterBait, 10, 1, 2);
itemLoot.Add(ItemID.JourneymanBait, 5, 1, 3);
itemLoot.Add(ItemID.ApprenticeBait, 3, 2, 3);
// Potions
itemLoot.Add(ModContent.ItemType<AnechoicCoating>(), 10, 1, 3);
itemLoot.AddCratePotionRules(false);
// Money
itemLoot.Add(ItemID.SilverCoin, 1, 10, 90);
itemLoot.Add(ItemID.GoldCoin, 2, 1, 5);
itemLoot.AddBiomeCrateLootRules(false);
}
}
}
@@ -1,10 +1,4 @@
using CalamityMod.Items.Critters;
using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables;
using CalamityMod.Items.Weapons.Magic;
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Items.Weapons.Ranged;
using CalamityMod.Items.Weapons.Summon;
using CalamityMod.Tiles.SunkenSea;
using Terraria;
using Terraria.GameContent.ItemDropRules;
using Terraria.ID;
@@ -24,18 +18,11 @@ namespace CalamityMod.Items.Fishing.SunkenSeaCatches
public override void SetDefaults()
{
Item.DefaultToPlaceableTile(ModContent.TileType<EutrophicCrateTile>());
Item.width = 32;
Item.height = 32;
Item.maxStack = 9999;
Item.consumable = true;
Item.rare = ItemRarityID.Green;
Item.value = Item.sellPrice(gold: 1);
Item.createTile = ModContent.TileType<Tiles.SunkenSea.EutrophicCrateTile>();
Item.useTurn = true;
Item.autoReuse = true;
Item.useAnimation = 15;
Item.useTime = 10;
Item.useStyle = ItemUseStyleID.Swing;
Item.rare = ItemRarityID.Green;
}
public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup)
@@ -46,26 +33,14 @@ namespace CalamityMod.Items.Fishing.SunkenSeaCatches
public override bool CanRightClick() => true;
public override void ModifyItemLoot(ItemLoot itemLoot)
{
var postDesertScourge = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedDesertScourge);
// 20-50 Blocks @ 100%; Individually 50%
itemLoot.Add(new OneFromRulesRule(1, new IItemDropRule[2]
{
ItemDropRule.NotScalingWithLuck(ModContent.ItemType<Placeables.Navystone>(), 1, 20, 50),
ItemDropRule.NotScalingWithLuck(ModContent.ItemType<Placeables.EutrophicSand>(), 1, 20, 50)
}));
// Materials
itemLoot.Add(ModContent.ItemType<Navystone>(), 1, 10, 30);
itemLoot.Add(ModContent.ItemType<EutrophicSand>(), 1, 10, 30);
postDesertScourge.Add(ModContent.ItemType<PrismShard>(), 1, 5, 10);
postDesertScourge.Add(ModContent.ItemType<SeaPrism>(), 5, 2, 5);
// Bait
itemLoot.Add(ItemID.MasterBait, 10, 1, 2);
itemLoot.Add(ItemID.JourneymanBait, 5, 1, 3);
itemLoot.Add(ModContent.ItemType<SeaMinnowItem>(), 5, 1, 3);
itemLoot.Add(ItemID.ApprenticeBait, 3, 2, 3);
// Potions
itemLoot.AddCratePotionRules(false);
// Money
itemLoot.Add(ItemID.SilverCoin, 1, 10, 90);
itemLoot.Add(ItemID.GoldCoin, 2, 1, 5);
itemLoot.AddBiomeCrateLootRules(false);
}
}
}
+10 -38
View File
@@ -6,6 +6,7 @@ using CalamityMod.Items.Weapons.Magic;
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Items.Weapons.Ranged;
using CalamityMod.Items.Weapons.Summon;
using CalamityMod.Tiles.SunkenSea;
using Terraria;
using Terraria.GameContent.ItemDropRules;
using Terraria.ID;
@@ -26,18 +27,11 @@ namespace CalamityMod.Items.Fishing.SunkenSeaCatches
public override void SetDefaults()
{
Item.DefaultToPlaceableTile(ModContent.TileType<PrismCrateTile>());
Item.width = 32;
Item.height = 32;
Item.maxStack = 9999;
Item.consumable = true;
Item.rare = ItemRarityID.Green;
Item.value = Item.sellPrice(gold: 1);
Item.createTile = ModContent.TileType<Tiles.SunkenSea.PrismCrateTile>();
Item.useTurn = true;
Item.autoReuse = true;
Item.useAnimation = 15;
Item.useTime = 10;
Item.useStyle = ItemUseStyleID.Swing;
Item.rare = ItemRarityID.Green;
}
public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup)
@@ -48,36 +42,14 @@ namespace CalamityMod.Items.Fishing.SunkenSeaCatches
public override bool CanRightClick() => true;
public override void ModifyItemLoot(ItemLoot itemLoot)
{
var postDesertScourge = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedDesertScourge);
var postHardmodeClam = itemLoot.DefineConditionalDropSet(() => DownedBossSystem.downedCLAMHardMode);
// 20-50 Blocks @ 100%; Individually 50%
itemLoot.Add(new OneFromRulesRule(1, new IItemDropRule[2]
{
ItemDropRule.NotScalingWithLuck(ModContent.ItemType<Placeables.Navystone>(), 1, 20, 50),
ItemDropRule.NotScalingWithLuck(ModContent.ItemType<Placeables.EutrophicSand>(), 1, 20, 50)
}));
// Materials
itemLoot.Add(ModContent.ItemType<Navystone>(), 1, 10, 30);
itemLoot.Add(ModContent.ItemType<EutrophicSand>(), 1, 10, 30);
postDesertScourge.Add(ModContent.ItemType<PrismShard>(), 1, 5, 10);
postDesertScourge.Add(ModContent.ItemType<SeaPrism>(), 5, 2, 5);
postHardmodeClam.Add(ModContent.ItemType<MolluskHusk>(), new Fraction(12, 100), 2, 5);
// Weapons
postHardmodeClam.Add(new OneFromOptionsNotScaledWithLuckDropRule(7, 100,
ModContent.ItemType<ClamCrusher>(),
ModContent.ItemType<ClamorRifle>(),
ModContent.ItemType<Poseidon>(),
ModContent.ItemType<ShellfishStaff>()
));
// Bait
itemLoot.Add(ItemID.MasterBait, 10, 1, 2);
itemLoot.Add(ItemID.JourneymanBait, 5, 1, 3);
itemLoot.Add(ModContent.ItemType<SeaMinnowItem>(), 5, 1, 3);
itemLoot.Add(ItemID.ApprenticeBait, 3, 2, 3);
// Potions
itemLoot.AddCratePotionRules();
// Money
itemLoot.Add(ItemID.SilverCoin, 1, 10, 90);
itemLoot.Add(ItemID.GoldCoin, 2, 1, 5);
itemLoot.AddBiomeCrateLootRules();
}
}
}
+10 -1
View File
@@ -1,4 +1,5 @@
using CalamityMod.Rarities;
using CalamityMod.Items.Materials;
using CalamityMod.Rarities;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -29,5 +30,13 @@ namespace CalamityMod.Items.Placeables.Ores
Item.value = Item.sellPrice(gold: 4);
Item.rare = ModContent.RarityType<Violet>();
}
public override void AddRecipes()
{
CreateRecipe(10).
AddIngredient<YharonSoulFragment>().
AddCondition(Condition.NearShimmer).
Register();
}
}
}
+326 -38
View File
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using CalamityMod.Enums;
using CalamityMod.Items.Accessories;
using CalamityMod.Items.Potions;
using CalamityMod.NPCs.SulphurousSea;
@@ -281,52 +282,320 @@ namespace CalamityMod
loot.Add(lcr);
}
public static void AddBiomeCrateLootRules(this ILoot loot, bool hardMode = true)
{
if (hardMode)
loot.AddHardmodeOresToCrates(HardmodeCrateType.Biome);
else
{
// Pre-Hardmode Ore/Bar loot pools
// 20-35 Ores @ 14.29%; Individually 1.79%
IItemDropRule[] phmOres = new IItemDropRule[8]
{
ItemDropRule.NotScalingWithLuck(ItemID.CopperOre, 1, 20, 35),
ItemDropRule.NotScalingWithLuck(ItemID.TinOre, 1, 20, 35),
ItemDropRule.NotScalingWithLuck(ItemID.IronOre, 1, 20, 35),
ItemDropRule.NotScalingWithLuck(ItemID.LeadOre, 1, 20, 35),
ItemDropRule.NotScalingWithLuck(ItemID.SilverOre, 1, 20, 35),
ItemDropRule.NotScalingWithLuck(ItemID.TungstenOre, 1, 20, 35),
ItemDropRule.NotScalingWithLuck(ItemID.GoldOre, 1, 20, 35),
ItemDropRule.NotScalingWithLuck(ItemID.PlatinumOre, 1, 20, 35)
};
loot.Add(new OneFromRulesRule(7, phmOres));
// 6-16 Bars @ 25%; Individually 4.17%
IItemDropRule[] phmBars = new IItemDropRule[6]
{
ItemDropRule.NotScalingWithLuck(ItemID.IronBar, 1, 6, 16),
ItemDropRule.NotScalingWithLuck(ItemID.LeadBar, 1, 6, 16),
ItemDropRule.NotScalingWithLuck(ItemID.SilverBar, 1, 6, 16),
ItemDropRule.NotScalingWithLuck(ItemID.TungstenBar, 1, 6, 16),
ItemDropRule.NotScalingWithLuck(ItemID.GoldBar, 1, 6, 16),
ItemDropRule.NotScalingWithLuck(ItemID.PlatinumBar, 1, 6, 16)
};
loot.Add(new OneFromRulesRule(4, phmBars));
}
// 2-4 Buff Potions @ 25%; Individually 4.17%
loot.Add(new OneFromRulesRule(4, new IItemDropRule[6]
{
ItemDropRule.NotScalingWithLuck(ItemID.ObsidianSkinPotion, 1, 2, 4),
ItemDropRule.NotScalingWithLuck(ItemID.SpelunkerPotion, 1, 2, 4),
ItemDropRule.NotScalingWithLuck(ItemID.HunterPotion, 1, 2, 4),
ItemDropRule.NotScalingWithLuck(ItemID.GravitationPotion, 1, 2, 4),
ItemDropRule.NotScalingWithLuck(ItemID.MiningPotion, 1, 2, 4),
ItemDropRule.NotScalingWithLuck(ItemID.HeartreachPotion, 1, 2, 4)
}));
// 5-17 (Regular) Recovery Potions @ 50%; 25% Healing 25% Mana
loot.Add(new OneFromRulesRule(2, new IItemDropRule[2]
{
ItemDropRule.NotScalingWithLuck(ItemID.HealingPotion, 1, 5, 17),
ItemDropRule.NotScalingWithLuck(ItemID.ManaPotion, 1, 5, 17)
}));
// 2-6 Bait @ 50%; 25% Master 25% Apprentice
loot.Add(new OneFromRulesRule(2, new IItemDropRule[2]
{
ItemDropRule.NotScalingWithLuck(ItemID.MasterBait, 1, 2, 6),
ItemDropRule.NotScalingWithLuck(ItemID.ApprenticeBait, 1, 2, 6)
}));
// 5-12 Gold Coin @ 25%
loot.Add(ItemID.GoldCoin, 4, 5, 12);
}
/// <summary>
/// Adds all the common potions for fishing crates, alongside scaling mana and regen potions
/// Adds (or re-adds) Hardmode Ores to crates with respect to Hardmode Progression rework<br/>
/// Drop rules replicate vanilla's rules.
/// </summary>
/// <param name="loot">The ILoot interface for the loot table.</param>
/// <param name="hardMode">Whether or not the crate is considered a hardmode crate.</param>
public static void AddCratePotionRules(this ILoot loot, bool hardMode = true)
/// <param name="type">Type of crate: Mythril, Titanium, Biome</param>
public static void AddHardmodeOresToCrates(this ILoot loot, HardmodeCrateType type)
{
loot.Add(ItemID.ObsidianSkinPotion, 10, 1, 3);
loot.Add(ItemID.SwiftnessPotion, 10, 1, 3);
loot.Add(ItemID.IronskinPotion, 10, 1, 3);
loot.Add(ItemID.NightOwlPotion, 10, 1, 3);
loot.Add(ItemID.ShinePotion, 10, 1, 3);
loot.Add(ItemID.MiningPotion, 10, 1, 3);
loot.Add(ItemID.HeartreachPotion, 10, 1, 3);
loot.Add(ItemID.TrapsightPotion, 10, 1, 3); // Dangersense Potion
var adamantiteLCR = loot.DefineConditionalDropSet(AdamantiteCondition);
var mythrilLCR = new LeadingConditionRule(MythrilCondition);
// Define all the loot rules for the potion types
var supremePots = new OneFromOptionsNotScaledWithLuckDropRule(1, 1, ModContent.ItemType<SupremeHealingPotion>(), ModContent.ItemType<SupremeManaPotion>());
var superPots = new OneFromOptionsNotScaledWithLuckDropRule(1, 1, ItemID.SuperHealingPotion, ItemID.SuperManaPotion);
var greaterPots = new OneFromOptionsNotScaledWithLuckDropRule(1, 1, ItemID.GreaterHealingPotion, ItemID.GreaterManaPotion);
var regularPots = new OneFromOptionsNotScaledWithLuckDropRule(1, 1, ItemID.HealingPotion, ItemID.ManaPotion);
var lesserPots = new OneFromOptionsNotScaledWithLuckDropRule(1, 1, ItemID.LesserHealingPotion, ItemID.LesserManaPotion);
// Chained LeadingConditionRules achieve the equivalent of "if killed X, else if killed Y, else if killed Z, else..."
var lcrSupremePotion = loot.DefineConditionalDropSet(() => DownedBossSystem.downedDoG);
var lcrSuperPotion = new LeadingConditionRule(If(() => DownedBossSystem.downedProvidence));
var lcrGreaterPotion = new LeadingConditionRule(If(() => NPC.downedMechBossAny));
var lcrRegularPotion = new LeadingConditionRule(If(() => NPC.downedBoss3));
// Actually chain all the LCRs together
// Greater potions upwards are only chained if the crate is marked as Hardmode
if (hardMode)
if (type == HardmodeCrateType.Biome)
{
lcrSupremePotion.Add(supremePots);
lcrSupremePotion.OnFailedConditions(lcrSuperPotion);
lcrSuperPotion.Add(superPots);
lcrSuperPotion.OnFailedConditions(lcrGreaterPotion);
lcrGreaterPotion.Add(greaterPots);
lcrGreaterPotion.OnFailedConditions(lcrRegularPotion);
// Pre-Hardmode loot pools
// 20-35 Ores @ 7.14%; Individually 0.89%
IItemDropRule[] phmOres = new IItemDropRule[8]
{
ItemDropRule.NotScalingWithLuck(ItemID.CopperOre, 1, 20, 35),
ItemDropRule.NotScalingWithLuck(ItemID.TinOre, 1, 20, 35),
ItemDropRule.NotScalingWithLuck(ItemID.IronOre, 1, 20, 35),
ItemDropRule.NotScalingWithLuck(ItemID.LeadOre, 1, 20, 35),
ItemDropRule.NotScalingWithLuck(ItemID.SilverOre, 1, 20, 35),
ItemDropRule.NotScalingWithLuck(ItemID.TungstenOre, 1, 20, 35),
ItemDropRule.NotScalingWithLuck(ItemID.GoldOre, 1, 20, 35),
ItemDropRule.NotScalingWithLuck(ItemID.PlatinumOre, 1, 20, 35)
};
// 6-16 Bars @ 8.33%; Individually 1.39%
IItemDropRule[] phmBars = new IItemDropRule[6]
{
ItemDropRule.NotScalingWithLuck(ItemID.IronBar, 1, 6, 16),
ItemDropRule.NotScalingWithLuck(ItemID.LeadBar, 1, 6, 16),
ItemDropRule.NotScalingWithLuck(ItemID.SilverBar, 1, 6, 16),
ItemDropRule.NotScalingWithLuck(ItemID.TungstenBar, 1, 6, 16),
ItemDropRule.NotScalingWithLuck(ItemID.GoldBar, 1, 6, 16),
ItemDropRule.NotScalingWithLuck(ItemID.PlatinumBar, 1, 6, 16)
};
// Tier 3 loot pools
// 20-35 Ores @ 7.14%; Individually 1.19%
IItemDropRule[] hmOresThree = new IItemDropRule[6]
{
ItemDropRule.NotScalingWithLuck(ItemID.CobaltOre, 1, 20, 35),
ItemDropRule.NotScalingWithLuck(ItemID.PalladiumOre, 1, 20, 35),
ItemDropRule.NotScalingWithLuck(ItemID.MythrilOre, 1, 20, 35),
ItemDropRule.NotScalingWithLuck(ItemID.OrichalcumOre, 1, 20, 35),
ItemDropRule.NotScalingWithLuck(ItemID.AdamantiteOre, 1, 20, 35),
ItemDropRule.NotScalingWithLuck(ItemID.TitaniumOre, 1, 20, 35)
};
// 5-16 Bars @ 16.67%; Individually 2.78%
IItemDropRule[] hmBarsThree = new IItemDropRule[6]
{
ItemDropRule.NotScalingWithLuck(ItemID.CobaltBar, 1, 5, 16),
ItemDropRule.NotScalingWithLuck(ItemID.PalladiumBar, 1, 5, 16),
ItemDropRule.NotScalingWithLuck(ItemID.MythrilBar, 1, 5, 16),
ItemDropRule.NotScalingWithLuck(ItemID.OrichalcumBar, 1, 5, 16),
ItemDropRule.NotScalingWithLuck(ItemID.AdamantiteBar, 1, 5, 16),
ItemDropRule.NotScalingWithLuck(ItemID.TitaniumBar, 1, 5, 16)
};
var adamantiteDropsOres = new SequentialRulesNotScalingWithLuckRule(7, new OneFromRulesRule(2, hmOresThree), new OneFromRulesRule(1, phmOres));
var adamantiteDropsBars = new SequentialRulesNotScalingWithLuckRule(4, new OneFromRulesRule(3, 2, hmBarsThree), new OneFromRulesRule(1, phmBars));
// Tier 2 loot pools
// 20-35 Ores @ 7.14%; Individually 1.79%
IItemDropRule[] hmOresTwo = new IItemDropRule[4]
{
ItemDropRule.NotScalingWithLuck(ItemID.CobaltOre, 1, 20, 35),
ItemDropRule.NotScalingWithLuck(ItemID.PalladiumOre, 1, 20, 35),
ItemDropRule.NotScalingWithLuck(ItemID.MythrilOre, 1, 20, 35),
ItemDropRule.NotScalingWithLuck(ItemID.OrichalcumOre, 1, 20, 35)
};
// 5-16 Bars @ 16.67%; Individually 4.17%
IItemDropRule[] hmBarsTwo = new IItemDropRule[4]
{
ItemDropRule.NotScalingWithLuck(ItemID.CobaltBar, 1, 5, 16),
ItemDropRule.NotScalingWithLuck(ItemID.PalladiumBar, 1, 5, 16),
ItemDropRule.NotScalingWithLuck(ItemID.MythrilBar, 1, 5, 16),
ItemDropRule.NotScalingWithLuck(ItemID.OrichalcumBar, 1, 5, 16)
};
var mythrilDropsOres = new SequentialRulesNotScalingWithLuckRule(7, new OneFromRulesRule(2, hmOresTwo), new OneFromRulesRule(1, phmOres));
var mythrilDropsBars = new SequentialRulesNotScalingWithLuckRule(4, new OneFromRulesRule(3, 2, hmBarsTwo), new OneFromRulesRule(1, phmBars));
// Tier 1 loot pools
// 20-35 Ores @ 7.14%; Individually 3.57%
IItemDropRule[] hmOresOne = new IItemDropRule[2]
{
ItemDropRule.NotScalingWithLuck(ItemID.CobaltOre, 1, 20, 35),
ItemDropRule.NotScalingWithLuck(ItemID.PalladiumOre, 1, 20, 35)
};
// 5-16 Bars @ 16.67%; Individually 8.33%
IItemDropRule[] hmBarsOne = new IItemDropRule[2]
{
ItemDropRule.NotScalingWithLuck(ItemID.CobaltBar, 1, 5, 16),
ItemDropRule.NotScalingWithLuck(ItemID.PalladiumBar, 1, 5, 16)
};
var cobaltDropsOres = new SequentialRulesNotScalingWithLuckRule(7, new OneFromRulesRule(2, hmOresOne), new OneFromRulesRule(1, phmOres));
var cobaltDropsBars = new SequentialRulesNotScalingWithLuckRule(4, new OneFromRulesRule(3, 2, hmBarsOne), new OneFromRulesRule(1, phmBars));
adamantiteLCR.Add(adamantiteDropsOres);
adamantiteLCR.Add(adamantiteDropsBars);
adamantiteLCR.OnFailedConditions(mythrilLCR);
mythrilLCR.Add(mythrilDropsOres);
mythrilLCR.Add(mythrilDropsBars);
mythrilLCR.OnFailedConditions(cobaltDropsOres);
mythrilLCR.OnFailedConditions(cobaltDropsBars);
}
lcrRegularPotion.Add(regularPots);
lcrRegularPotion.OnFailedConditions(lesserPots);
// Add the chain starting from regular potions if marked as a Pre-Hardmode crate
if (!hardMode)
else if (type == HardmodeCrateType.Mythril)
{
loot.Add(lcrRegularPotion);
// Pre-Hardmode loot pools
// 12-21 Ores @ 8.33%; Individually 1.39%
IItemDropRule[] phmOres = new IItemDropRule[6]
{
ItemDropRule.NotScalingWithLuck(ItemID.CopperOre, 1, 12, 21),
ItemDropRule.NotScalingWithLuck(ItemID.TinOre, 1, 12, 21),
ItemDropRule.NotScalingWithLuck(ItemID.IronOre, 1, 12, 21),
ItemDropRule.NotScalingWithLuck(ItemID.LeadOre, 1, 12, 21),
ItemDropRule.NotScalingWithLuck(ItemID.SilverOre, 1, 12, 21),
ItemDropRule.NotScalingWithLuck(ItemID.TungstenOre, 1, 12, 21),
};
// 4-7 Bars @ 6.94%; Individually 1.16%
IItemDropRule[] phmBars = new IItemDropRule[6]
{
ItemDropRule.NotScalingWithLuck(ItemID.CopperBar, 1, 4, 7),
ItemDropRule.NotScalingWithLuck(ItemID.TinBar, 1, 4, 7),
ItemDropRule.NotScalingWithLuck(ItemID.IronBar, 1, 4, 7),
ItemDropRule.NotScalingWithLuck(ItemID.LeadBar, 1, 4, 7),
ItemDropRule.NotScalingWithLuck(ItemID.SilverBar, 1, 4, 7),
ItemDropRule.NotScalingWithLuck(ItemID.TungstenBar, 1, 4, 7),
};
// Tier 2 loot pools
// 12-21 Ores @ 8.33%; Individually 2.08%
IItemDropRule[] hmOresTwo = new IItemDropRule[4]
{
ItemDropRule.NotScalingWithLuck(ItemID.CobaltOre, 1, 12, 21),
ItemDropRule.NotScalingWithLuck(ItemID.PalladiumOre, 1, 12, 21),
ItemDropRule.NotScalingWithLuck(ItemID.MythrilOre, 1, 12, 21),
ItemDropRule.NotScalingWithLuck(ItemID.OrichalcumOre, 1, 12, 21)
};
// 3-7 Bars @ 13.89%; Individually 3.47%
IItemDropRule[] hmBarsTwo = new IItemDropRule[4]
{
ItemDropRule.NotScalingWithLuck(ItemID.CobaltBar, 1, 3, 7),
ItemDropRule.NotScalingWithLuck(ItemID.PalladiumBar, 1, 3, 7),
ItemDropRule.NotScalingWithLuck(ItemID.MythrilBar, 1, 3, 7),
ItemDropRule.NotScalingWithLuck(ItemID.OrichalcumBar, 1, 3, 7)
};
var mythrilDropsOres = new SequentialRulesNotScalingWithLuckRule(6, new OneFromRulesRule(2, hmOresTwo), new OneFromRulesRule(1, phmOres));
var mythrilDropsBars = new SequentialRulesNotScalingWithLuckRule(4, new OneFromRulesRule(3, 2, hmBarsTwo), new OneFromRulesRule(1, phmBars));
var mythrilDrops = new SequentialRulesNotScalingWithLuckRule(1, mythrilDropsOres, mythrilDropsBars);
// Tier 1 loot pools
// 12-21 Ores @ 8.33%; Individually 4.17%
IItemDropRule[] hmOresOne = new IItemDropRule[2]
{
ItemDropRule.NotScalingWithLuck(ItemID.CobaltOre, 1, 12, 21),
ItemDropRule.NotScalingWithLuck(ItemID.PalladiumOre, 1, 12, 21)
};
// 3-7 Bars @ 13.89%; Individually 6.94%
IItemDropRule[] hmBarsOne = new IItemDropRule[2]
{
ItemDropRule.NotScalingWithLuck(ItemID.CobaltBar, 1, 3, 7),
ItemDropRule.NotScalingWithLuck(ItemID.PalladiumBar, 1, 3, 7)
};
var cobaltDropsOres = new SequentialRulesNotScalingWithLuckRule(6, new OneFromRulesRule(2, hmOresOne), new OneFromRulesRule(1, phmOres));
var cobaltDropsBars = new SequentialRulesNotScalingWithLuckRule(4, new OneFromRulesRule(3, 2, hmBarsOne), new OneFromRulesRule(1, phmBars));
var cobaltDrops = new SequentialRulesNotScalingWithLuckRule(1, cobaltDropsOres, cobaltDropsBars);
mythrilLCR.Add(mythrilDrops);
mythrilLCR.OnFailedConditions(cobaltDrops);
loot.Add(mythrilLCR); // No Adamantite LCR here so we need to add this in
}
else if (type == HardmodeCrateType.Titanium)
{
// Pre-Hardmode loot pools
// 25-34 Ores @ 10%; Individually 2.5%
IItemDropRule[] phmOres = new IItemDropRule[4]
{
ItemDropRule.NotScalingWithLuck(ItemID.SilverOre, 1, 25, 34),
ItemDropRule.NotScalingWithLuck(ItemID.TungstenOre, 1, 25, 34),
ItemDropRule.NotScalingWithLuck(ItemID.GoldOre, 1, 25, 34),
ItemDropRule.NotScalingWithLuck(ItemID.PlatinumOre, 1, 25, 34)
};
// 8-11 Bars @ 8.89%; Individually 2.22%
IItemDropRule[] phmBars = new IItemDropRule[4]
{
ItemDropRule.NotScalingWithLuck(ItemID.SilverBar, 1, 8, 11),
ItemDropRule.NotScalingWithLuck(ItemID.TungstenBar, 1, 8, 11),
ItemDropRule.NotScalingWithLuck(ItemID.GoldBar, 1, 8, 11),
ItemDropRule.NotScalingWithLuck(ItemID.PlatinumBar, 1, 8, 11)
};
// Tier 3 loot pools
// 25-34 Ores @ 10%; Individually 2.5%
IItemDropRule[] hmOresThree = new IItemDropRule[4]
{
ItemDropRule.NotScalingWithLuck(ItemID.MythrilOre, 1, 25, 34),
ItemDropRule.NotScalingWithLuck(ItemID.OrichalcumOre, 1, 25, 34),
ItemDropRule.NotScalingWithLuck(ItemID.AdamantiteOre, 1, 25, 34),
ItemDropRule.NotScalingWithLuck(ItemID.TitaniumOre, 1, 25, 34)
};
// 8-11 Bars @ 17.78%; Individually 4.44%
IItemDropRule[] hmBarsThree = new IItemDropRule[4]
{
ItemDropRule.NotScalingWithLuck(ItemID.MythrilBar, 1, 8, 11),
ItemDropRule.NotScalingWithLuck(ItemID.OrichalcumBar, 1, 8, 11),
ItemDropRule.NotScalingWithLuck(ItemID.AdamantiteBar, 1, 8, 11),
ItemDropRule.NotScalingWithLuck(ItemID.TitaniumBar, 1, 8, 11)
};
var adamantiteDropsOres = new SequentialRulesNotScalingWithLuckRule(5, new OneFromRulesRule(2, hmOresThree), new OneFromRulesRule(1, phmOres));
var adamantiteDropsBars = new SequentialRulesNotScalingWithLuckRule(3, new OneFromRulesRule(3, 2, hmBarsThree), new OneFromRulesRule(1, phmBars));
var adamantiteDrops = new SequentialRulesNotScalingWithLuckRule(1, adamantiteDropsOres, adamantiteDropsBars);
// Tier 2 loot pools
// 25-34 Ores @ 10%; Individually 5%
IItemDropRule[] hmOresTwo = new IItemDropRule[2]
{
ItemDropRule.NotScalingWithLuck(ItemID.MythrilOre, 1, 25, 34),
ItemDropRule.NotScalingWithLuck(ItemID.OrichalcumOre, 1, 25, 34)
};
// 8-11 Bars @ 17.78%; Individually 8.89%
IItemDropRule[] hmBarsTwo = new IItemDropRule[2]
{
ItemDropRule.NotScalingWithLuck(ItemID.MythrilBar, 1, 8, 11),
ItemDropRule.NotScalingWithLuck(ItemID.OrichalcumBar, 1, 8, 11)
};
var mythrilDropsOres = new SequentialRulesNotScalingWithLuckRule(5, new OneFromRulesRule(2, hmOresTwo), new OneFromRulesRule(1, phmOres));
var mythrilDropsBars = new SequentialRulesNotScalingWithLuckRule(3, new OneFromRulesRule(3, 2, hmBarsTwo), new OneFromRulesRule(1, phmBars));
var mythrilDrops = new SequentialRulesNotScalingWithLuckRule(1, mythrilDropsOres, mythrilDropsBars);
// Tier 1 loot pools
// EXCEPTION: Titanium Crates do not drop Cobalt. This is added to make it not entirely useless to get early.
// 25-34 Ores @ 10%; Individually 5%
IItemDropRule[] hmOresOne = new IItemDropRule[2]
{
ItemDropRule.NotScalingWithLuck(ItemID.CobaltOre, 1, 25, 34),
ItemDropRule.NotScalingWithLuck(ItemID.PalladiumOre, 1, 25, 34)
};
// 8-11 Bars @ 17.78%; Individually 8.89%
IItemDropRule[] hmBarsOne = new IItemDropRule[2]
{
ItemDropRule.NotScalingWithLuck(ItemID.CobaltBar, 1, 8, 11),
ItemDropRule.NotScalingWithLuck(ItemID.PalladiumBar, 1, 8, 11)
};
var cobaltDropsOres = new SequentialRulesNotScalingWithLuckRule(5, new OneFromRulesRule(2, hmOresOne), new OneFromRulesRule(1, phmOres));
var cobaltDropsBars = new SequentialRulesNotScalingWithLuckRule(3, new OneFromRulesRule(3, 2, hmBarsOne), new OneFromRulesRule(1, phmBars));
var cobaltDrops = new SequentialRulesNotScalingWithLuckRule(1, cobaltDropsOres, cobaltDropsBars);
adamantiteLCR.Add(adamantiteDrops);
adamantiteLCR.OnFailedConditions(mythrilLCR);
mythrilLCR.Add(mythrilDrops);
mythrilLCR.OnFailedConditions(cobaltDrops);
}
}
#endregion
@@ -484,6 +753,25 @@ namespace CalamityMod
#endregion
#region Drop Rule Conditions
public static IItemDropRuleCondition MythrilCondition = If((info) =>
{
// If the Early Hardmode Progression Rework is not enabled, then Mythril/Orichalcum can always drop.
if (!CalamityServerConfig.Instance.EarlyHardmodeProgressionRework)
return true;
// If the Early Hardmode Progression Rework is enabled, then any Mechanical Boss must be defeated for Mythril/Orichalcum to drop.
return NPC.downedMechBossAny;
});
public static IItemDropRuleCondition AdamantiteCondition = If((info) =>
{
// If the Early Hardmode Progression Rework is not enabled, then Adamantite/Titanium can always drop.
if (!CalamityServerConfig.Instance.EarlyHardmodeProgressionRework)
return true;
// If the Early Hardmode Progression Rework is enabled, then 2 of the Mechanical Bosses must be defeated for Adamantite/Titanium to drop.
return (NPC.downedMechBoss1 && NPC.downedMechBoss2) || (NPC.downedMechBoss2 && NPC.downedMechBoss3) || (NPC.downedMechBoss1 && NPC.downedMechBoss3);
});
public static IItemDropRuleCondition HallowedBarsCondition = If((info) =>
{
// If the Early Hardmode Progression Rework is not enabled, then Hallowed Bars can always drop from Mechanical Bosses.