diff --git a/AdventureBuff.cs b/AdventureBuff.cs index a97e136d..2b897438 100644 --- a/AdventureBuff.cs +++ b/AdventureBuff.cs @@ -1,4 +1,6 @@ +using System; using Terraria; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; @@ -19,8 +21,8 @@ public override void Update(int type, Player player, ref int buffIndex) if (player.beetleOrbs >= 1) { - damage += 0.15f; - attackSpeed += 0.15f; + damage += 0.10f; + attackSpeed += 0.10f; } if (player.beetleOrbs >= 2) @@ -31,8 +33,8 @@ public override void Update(int type, Player player, ref int buffIndex) if (player.beetleOrbs >= 3) { - damage += 0.05f; - attackSpeed += 0.20f; + damage += 0.10f; + attackSpeed += 0.10f; } player.GetDamage() += damage; @@ -48,4 +50,30 @@ public override bool RightClick(int type, int buffIndex) return true; } + + public class RemoveFlaskBuffsOnDeath : ModPlayer + { + // Array of buff IDs to remove on death + private readonly int[] buffsToRemove = { 71, 73, 74, 75, 76, 77, 78, 79 }; //Every single Flask buff that doesn't go away on death for some reason + + public override void Kill(double damage, int hitDirection, bool pvp, PlayerDeathReason damageSource) + { + + for (int i = 0; i < Player.MaxBuffs; i++) + { + int buffType = Player.buffType[i]; + + + foreach (int buffId in buffsToRemove) + { + if (buffType == buffId) + { + Player.DelBuff(i); // Remove the buff + i--; // Adjust index since we removed a buff + break; + } + } + } + } + } } \ No newline at end of file diff --git a/AdventureConfig.cs b/AdventureConfig.cs index 34789840..ce8226ad 100644 --- a/AdventureConfig.cs +++ b/AdventureConfig.cs @@ -313,6 +313,12 @@ public class WorldGenerationConfig [DefaultValue(30)] public int PlanteraBulbChanceDenominator { get; set; } = 30; [DefaultValue(8)] public int ChlorophyteSpreadChanceModifier { get; set; } = 8; + + [Range(1, 1000)] + [DefaultValue(300)] public int ChlorophyteGrowChanceModifier { get; set; } = 300; + + [Range(1, 999999)] + [DefaultValue(300)] public int ChlorophyteGrowLimitModifier { get; set; } = 300; } public WorldGenerationConfig WorldGeneration { get; set; } = new(); diff --git a/AdventureDropDatabase.cs b/AdventureDropDatabase.cs index a336aa10..c78255aa 100644 --- a/AdventureDropDatabase.cs +++ b/AdventureDropDatabase.cs @@ -1,8 +1,12 @@ using System.Linq; +using MonoMod.Cil; +using MonoMod.RuntimeDetour; +using System.Reflection; using Terraria; using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.ModLoader; +using Mono.Cecil.Cil; namespace PvPAdventure; @@ -63,6 +67,11 @@ public static void ModifyNPCLoot(NPC npc, NPCLoot npcLoot) ModifyDropRate(drop, ItemID.Stinger, 1, 1); break; + case NPCID.GiantTortoise: + foreach (var drop in drops) + ModifyDropRate(drop, ItemID.TurtleShell, 1, 4); + break; + case NPCID.Necromancer: case NPCID.NecromancerArmored: foreach (var drop in drops) @@ -139,6 +148,11 @@ public static void ModifyNPCLoot(NPC npc, NPCLoot npcLoot) ModifyDropRate(drop, ItemID.ButterflyDust, 1, 1); break; + case NPCID.GiantCursedSkull: + foreach (var drop in drops) + ModifyDropRate(drop, ItemID.ShadowJoustingLance, 1, 12); + break; + case NPCID.Mothron: foreach (var drop in drops) ModifyDropRate(drop, ItemID.BrokenHeroSword, 1, 2); @@ -149,6 +163,11 @@ public static void ModifyNPCLoot(NPC npc, NPCLoot npcLoot) ModifyDropRate(drop, ItemID.MagicQuiver, 1, 30); break; + case NPCID.RedDevil: + foreach (var drop in drops) + ModifyDropRate(drop, ItemID.UnholyTrident, 1, 10); + break; + case NPCID.Lihzahrd: case NPCID.LihzahrdCrawler: case NPCID.FlyingSnake: @@ -263,15 +282,6 @@ public static void ModifyNPCLoot(NPC npc, NPCLoot npcLoot) ])); break; - case NPCID.GiantTortoise: - foreach (var drop in drops) - ModifyDropRate(drop, ItemID.TurtleShell, 1, 5); - break; - - case NPCID.GiantCursedSkull: - foreach (var drop in drops) - ModifyDropRate(drop, ItemID.ShadowJoustingLance, 1, 12); - break; } } @@ -295,4 +305,43 @@ public static IItemDropRule OnItemDropDatabaseRegisterToGlobal(On_ItemDropDataba return entry; } + public class PlanteraDropEdit : ModSystem + { + private static ILHook planteraHook; + + public override void PostSetupContent() + { + // Apply the IL edit to change Plantera's first-time drop from item 758 to 1255 + MethodInfo method = typeof(Terraria.GameContent.ItemDropRules.ItemDropDatabase).GetMethod("RegisterBoss_Plantera", + BindingFlags.NonPublic | BindingFlags.Instance); + + planteraHook = new ILHook(method, PlanteraDropILEdit); + } + + public override void Unload() + { + planteraHook?.Dispose(); + } + + private static void PlanteraDropILEdit(ILContext il) + { + ILCursor cursor = new ILCursor(il); + + // Look for the instruction that loads the value 758 (Grenade Launcher ID) + // This should be: ldc.i4 758 (or ldc.i4.s 758 if it's a short form) + if (cursor.TryGotoNext(MoveType.Before, + i => i.MatchLdcI4(758))) // Match loading the constant 758 + { + // Replace the 758 with 1255 + cursor.Remove(); // Remove the ldc.i4 758 instruction + cursor.Emit(OpCodes.Ldc_I4, 1255); // Emit ldc.i4 1255 instead + + ModContent.GetInstance().Logger.Info("Successfully changed Plantera's first-time drop from item 758 to 1255"); + } + else + { + ModContent.GetInstance().Logger.Error("Failed to find item ID 758 in RegisterBoss_Plantera method"); + } + } + } } \ No newline at end of file diff --git a/AdventureItem.cs b/AdventureItem.cs index aeb57c7c..2616a9a4 100644 --- a/AdventureItem.cs +++ b/AdventureItem.cs @@ -16,10 +16,61 @@ public class AdventureItem : GlobalItem ItemID.Sets.Factory.CreateBoolSet(ItemID.MagicMirror, ItemID.CellPhone, ItemID.IceMirror, ItemID.Shellphone, ItemID.ShellphoneSpawn); + public class GelatinCrystalRestriction : GlobalItem + { + public override bool CanUseItem(Item item, Player player) + { + if (item.type == ItemID.QueenSlimeCrystal) + { + bool isUnderground = player.position.Y > Main.worldSurface * 16; + bool inUndergroundHallow = isUnderground && player.ZoneHallow; + + if (inUndergroundHallow) + { + Main.NewText("Queen Slime refuses to emerge in the corrupted crystals here!", 255, 50, 50); + return false; + } + + // Still block summon in other underground areas but without message + if (isUnderground) + { + return false; + } + } + return base.CanUseItem(item, player); + } + } + public class PrismaticLacewingRestriction : GlobalItem + { + public override bool CanUseItem(Item item, Player player) + { + // Target Prismatic Lacewing (Empress summon item) + if (item.type == ItemID.EmpressButterfly) + { + // Check if player is below surface level + bool isUnderground = player.position.Y > Main.worldSurface * 16; + bool inUndergroundHallow = isUnderground && player.ZoneHallow; + + if (isUnderground) + { + Main.NewText("The sacred light refuses to manifest in these corrupted depths!", 200, 150, 255); + return false; + } + } + return base.CanUseItem(item, player); + } + } + public override void SetDefaults(Item item) { var adventureConfig = ModContent.GetInstance(); + if (item.type == ItemID.LihzahrdPowerCell) + { + + item.rare = ItemRarityID.Yellow; + } + if (RecallItems[item.type]) { var recallTime = adventureConfig.RecallFrames; @@ -50,7 +101,6 @@ public override void SetDefaults(Item item) if (statistics.Value != null) item.value = statistics.Value.Value; } - if (item.type == ItemID.SpectrePickaxe || item.type == ItemID.ShroomiteDiggingClaw) item.pick = 210; } diff --git a/AdventurePlayer.cs b/AdventurePlayer.cs index 9a0ec51a..ea67ace0 100644 --- a/AdventurePlayer.cs +++ b/AdventurePlayer.cs @@ -590,6 +590,77 @@ public override bool PreKill(double damage, int hitDirection, bool pvp, ref bool return true; } + private bool hadShinyStoneLastFrame; + + public override void PostUpdateEquips() + { + // Check if Shiny Stone is equipped + bool hasShinyStone = IsShinyStoneEquipped(); + + // Apply debuff when first equipped or after respawn + if (hasShinyStone && !hadShinyStoneLastFrame) + { + Player.AddBuff(ModContent.BuffType(), 3600); // 60 seconds + } + + // Disable Shiny Stone effects while debuffed + if (Player.HasBuff(ModContent.BuffType())) + { + Player.shinyStone = false; + } + + hadShinyStoneLastFrame = hasShinyStone; + + if (Player.beetleOffense) + { + Player.GetDamage() += 0; + Player.GetAttackSpeed() += 0; + } + else + { + // If we don't have the beetle offense set bonus, remove all possible buffs. + Player.ClearBuff(BuffID.BeetleMight1); + Player.ClearBuff(BuffID.BeetleMight2); + Player.ClearBuff(BuffID.BeetleMight3); + } + + if (Player.HasBuff(BuffID.BeetleMight3)) + { + // we apply the glowing eye effect from Yoraiz0rsSpell item + Player.yoraiz0rEye = 33; + } + + // Check if wearing full Tiki Armor + if (Player.armor[0].type == ItemID.TikiMask && + Player.armor[1].type == ItemID.TikiShirt && + Player.armor[2].type == ItemID.TikiPants) + { + Player.noKnockback = true; + } + + } + public override void OnRespawn() + { + // Re-apply debuff if equipped during respawn + if (IsShinyStoneEquipped()) + { + Player.AddBuff(ModContent.BuffType(), 900); + } + } + + private bool IsShinyStoneEquipped() + { + for (int i = 3; i < 10; i++) // Check all accessory slots + { + if (Player.armor[i].type == ItemID.ShinyStone && + (i < 7 || !Player.hideVisibleAccessory[i - 3])) + { + return true; + } + } + return false; + } + public override void Kill(double damage, int hitDirection, bool pvp, PlayerDeathReason damageSource) { // Only play kill markers on clients that we hurt that aren't ourselves @@ -874,16 +945,7 @@ public override void UpdateBadLifeRegen() } } - public override void PostUpdateEquips() - { - if (!Player.beetleOffense) - { - // If we don't have the beetle offense set bonus, remove all possible buffs. - Player.ClearBuff(BuffID.BeetleMight1); - Player.ClearBuff(BuffID.BeetleMight2); - Player.ClearBuff(BuffID.BeetleMight3); - } - } + private void SendPingPong() { @@ -957,4 +1019,15 @@ public override string ToString() { return $"{Player.whoAmI}/{Player.name}/{DiscordUser?.Id}"; } +} +public class ShinyStoneHotswap : ModBuff +{ + public override string Texture => $"PvPAdventure/Assets/Buff/ShinyStoneHotswap"; + + public override void SetStaticDefaults() + { + Main.debuff[Type] = true; + Main.buffNoSave[Type] = true; + Main.buffNoTimeDisplay[Type] = false; // Show timer + } } \ No newline at end of file diff --git a/AdventureProjectile.cs b/AdventureProjectile.cs index 5385b1be..388ace88 100644 --- a/AdventureProjectile.cs +++ b/AdventureProjectile.cs @@ -152,4 +152,373 @@ private void OnProjectileghostHeal(On_Projectile.orig_ghostHeal orig, Projectile ); } } -} \ No newline at end of file + + public class SpiderStaffGlobalProjectile : GlobalProjectile + { + public override bool AppliesToEntity(Projectile entity, bool lateInstantiation) + { + return entity.type == ProjectileID.VenomSpider || + entity.type == ProjectileID.JumperSpider || // Note: Fix typo here + entity.type == ProjectileID.DangerousSpider; + } + + public override void PostAI(Projectile projectile) + { + Player owner = Main.player[projectile.owner]; + + // Check inventory (including equipped items) AND mouse slot + bool hasStaff = owner.HasItem(ItemID.SpiderStaff); + bool mouseHasStaff = owner.inventory[58].type == ItemID.SpiderStaff && owner.inventory[58].stack > 0; + + if (!hasStaff && !mouseHasStaff) + { + projectile.Kill(); + } + } + } + + public class ClingerStaffGlobalProjectile : GlobalProjectile + { + public override bool AppliesToEntity(Projectile entity, bool lateInstantiation) + { + return entity.type == ProjectileID.ClingerStaff; + } + + public override void PostAI(Projectile projectile) + { + Player owner = Main.player[projectile.owner]; + + // Check inventory (including equipped items) AND mouse slot + bool hasStaff = owner.HasItem(ItemID.ClingerStaff); + bool mouseHasStaff = owner.inventory[58].type == ItemID.ClingerStaff && owner.inventory[58].stack > 0; + + if (!hasStaff && !mouseHasStaff) + { + projectile.Kill(); + } + } + } + + public class QueenSpiderStaffGlobalProjectile : GlobalProjectile + { + public override bool AppliesToEntity(Projectile entity, bool lateInstantiation) + { + return entity.type == ProjectileID.SpiderHiver; + } + + public override void PostAI(Projectile projectile) + { + Player owner = Main.player[projectile.owner]; + + // Check inventory (including equipped items) AND mouse slot + bool hasStaff = owner.HasItem(ItemID.QueenSpiderStaff); + bool mouseHasStaff = owner.inventory[58].type == ItemID.QueenSpiderStaff && owner.inventory[58].stack > 0; + + if (!hasStaff && !mouseHasStaff) + { + projectile.Kill(); + } + } + } + + public class NimbusRodGlobalProjectile : GlobalProjectile + { + public override bool AppliesToEntity(Projectile entity, bool lateInstantiation) + { + return entity.type == ProjectileID.RainNimbus; + } + + public override void PostAI(Projectile projectile) + { + Player owner = Main.player[projectile.owner]; + + // Check inventory (including equipped items) AND mouse slot + bool hasStaff = owner.HasItem(ItemID.NimbusRod); + bool mouseHasStaff = owner.inventory[58].type == ItemID.NimbusRod && owner.inventory[58].stack > 0; + + if (!hasStaff && !mouseHasStaff) + { + + projectile.Kill(); + } + } + } + + public class XenoStaffGlobalProjectile : GlobalProjectile + { + public override bool AppliesToEntity(Projectile entity, bool lateInstantiation) + { + return entity.type == ProjectileID.UFOMinion; + } + + public override void PostAI(Projectile projectile) + { + Player owner = Main.player[projectile.owner]; + + // Check inventory (including equipped items) AND mouse slot + bool hasStaff = owner.HasItem(ItemID.XenoStaff); + bool mouseHasStaff = owner.inventory[58].type == ItemID.XenoStaff && owner.inventory[58].stack > 0; + + if (!hasStaff && !mouseHasStaff) + { + projectile.Kill(); + } + } + } + + public class BladeStaffGlobalProjectile : GlobalProjectile + { + public override bool AppliesToEntity(Projectile entity, bool lateInstantiation) + { + return entity.type == ProjectileID.Smolstar; + } + + public override void PostAI(Projectile projectile) + { + Player owner = Main.player[projectile.owner]; + + // Check inventory (including equipped items) AND mouse slot + bool hasStaff = owner.HasItem(ItemID.Smolstar); + bool mouseHasStaff = owner.inventory[58].type == ItemID.Smolstar && owner.inventory[58].stack > 0; + + if (!hasStaff && !mouseHasStaff) + { + projectile.Kill(); + } + } + } + + public class HornetStaffGlobalProjectile : GlobalProjectile + { + public override bool AppliesToEntity(Projectile entity, bool lateInstantiation) + { + return entity.type == ProjectileID.Hornet; + } + + public override void PostAI(Projectile projectile) + { + Player owner = Main.player[projectile.owner]; + + // Check inventory (including equipped items) AND mouse slot + bool hasStaff = owner.HasItem(ItemID.HornetStaff); + bool mouseHasStaff = owner.inventory[58].type == ItemID.HornetStaff && owner.inventory[58].stack > 0; + + if (!hasStaff && !mouseHasStaff) + { + projectile.Kill(); + } + } + } + + public class ImpStaffGlobalProjectile : GlobalProjectile + { + public override bool AppliesToEntity(Projectile entity, bool lateInstantiation) + { + return entity.type == ProjectileID.FlyingImp; + } + + public override void PostAI(Projectile projectile) + { + Player owner = Main.player[projectile.owner]; + + // Check inventory (including equipped items) AND mouse slot + bool hasStaff = owner.HasItem(ItemID.ImpStaff); + bool mouseHasStaff = owner.inventory[58].type == ItemID.ImpStaff && owner.inventory[58].stack > 0; + + if (!hasStaff && !mouseHasStaff) + { + projectile.Kill(); + } + } + } + + public class PygmyStaffGlobalProjectile : GlobalProjectile + { + public override bool AppliesToEntity(Projectile entity, bool lateInstantiation) + { + return entity.type == ProjectileID.Pygmy || + entity.type == ProjectileID.Pygmy2 || + entity.type == ProjectileID.Pygmy3 || + entity.type == ProjectileID.Pygmy4; + } + + public override void PostAI(Projectile projectile) + { + Player owner = Main.player[projectile.owner]; + + // Check inventory (including equipped items) AND mouse slot + bool hasStaff = owner.HasItem(ItemID.PygmyStaff); + bool mouseHasStaff = owner.inventory[58].type == ItemID.PygmyStaff && owner.inventory[58].stack > 0; + + if (!hasStaff && !mouseHasStaff) + { + projectile.Kill(); + } + } + } + + public class DeadlySphereGlobalProjectile : GlobalProjectile + { + public override bool AppliesToEntity(Projectile entity, bool lateInstantiation) + { + return entity.type == ProjectileID.DeadlySphere; + } + + public override void PostAI(Projectile projectile) + { + Player owner = Main.player[projectile.owner]; + + // Check inventory (including equipped items) AND mouse slot + bool hasStaff = owner.HasItem(ItemID.DeadlySphereStaff); + bool mouseHasStaff = owner.inventory[58].type == ItemID.DeadlySphereStaff && owner.inventory[58].stack > 0; + + if (!hasStaff && !mouseHasStaff) + { + projectile.Kill(); + } + } + } + + public class PirateStaffGlobalProjectile : GlobalProjectile + { + public override bool AppliesToEntity(Projectile entity, bool lateInstantiation) + { + return entity.type == ProjectileID.OneEyedPirate || + entity.type == ProjectileID.SoulscourgePirate || + entity.type == ProjectileID.PirateCaptain; + } + + public override void PostAI(Projectile projectile) + { + Player owner = Main.player[projectile.owner]; + + // Check inventory (including equipped items) AND mouse slot + bool hasStaff = owner.HasItem(ItemID.PirateStaff); + bool mouseHasStaff = owner.inventory[58].type == ItemID.PirateStaff && owner.inventory[58].stack > 0; + + if (!hasStaff && !mouseHasStaff) + { + projectile.Kill(); + } + } + } + + public class TempestStaffGlobalProjectile : GlobalProjectile + { + public override bool AppliesToEntity(Projectile entity, bool lateInstantiation) + { + return entity.type == ProjectileID.Tempest; + } + + public override void PostAI(Projectile projectile) + { + Player owner = Main.player[projectile.owner]; + + // Check inventory (including equipped items) AND mouse slot + bool hasStaff = owner.HasItem(ItemID.TempestStaff); + bool mouseHasStaff = owner.inventory[58].type == ItemID.TempestStaff && owner.inventory[58].stack > 0; + + if (!hasStaff && !mouseHasStaff) + { + projectile.Kill(); + } + } + } + + public class TerraprismaGlobalProjectile : GlobalProjectile + { + public override bool AppliesToEntity(Projectile entity, bool lateInstantiation) + { + return entity.type == ProjectileID.EmpressBlade; + } + + public override void PostAI(Projectile projectile) + { + Player owner = Main.player[projectile.owner]; + + // Check inventory (including equipped items) AND mouse slot + bool hasStaff = owner.HasItem(ItemID.EmpressBlade); + bool mouseHasStaff = owner.inventory[58].type == ItemID.EmpressBlade && owner.inventory[58].stack > 0; + + if (!hasStaff && !mouseHasStaff) + { + projectile.Kill(); + } + } + } + + public class DeadProjectileList : GlobalProjectile + { + public override bool AppliesToEntity(Projectile entity, bool lateInstantiation) + { + return entity.type == ProjectileID.ClingerStaff || + entity.type == ProjectileID.SporeTrap || + entity.type == ProjectileID.SporeTrap2 || + entity.type == ProjectileID.SporeGas || + entity.type == ProjectileID.SporeGas2 || + entity.type == ProjectileID.RainCloudRaining || + entity.type == ProjectileID.BloodCloudRaining || + entity.type == ProjectileID.SporeGas3; + } + + public override void PostAI(Projectile projectile) + { + // Ensure owner index is valid + if (projectile.owner < 0 || projectile.owner >= Main.maxPlayers) + return; + + Player owner = Main.player[projectile.owner]; + + // Kill projectile if owner is dead or inactive + if (owner.dead || !owner.active) + { + projectile.Kill(); + } + } + } + public class AdventureNightglow : GlobalProjectile + { + public override bool AppliesToEntity(Projectile entity, bool lateInstantiation) => + entity.type == ProjectileID.FairyQueenMagicItemShot; + + public override void SetDefaults(Projectile entity) + { + entity.localAI[0] = 0; + } + + public override void AI(Projectile projectile) + { + if (projectile.localAI[0] <= 60) + { + projectile.localAI[0]++; + return; + } + + if (!projectile.TryGetOwner(out var owner)) + return; + + if (owner.whoAmI != Main.myPlayer) + return; + + if (owner.itemAnimation > 0 && owner.HeldItem.type == ItemID.FairyQueenMagicItem) + { + var cursorPosition = Main.MouseWorld; + var toCursor = cursorPosition - projectile.Center; + + var baseSpeed = 20.0f; + var accelerationFactor = 1.5f; + var turnStrength = 0.035f; + + var direction = toCursor.SafeNormalize(Vector2.Zero); + var targetVelocity = direction * baseSpeed * accelerationFactor; + + projectile.velocity = Vector2.Lerp(projectile.velocity, targetVelocity, turnStrength); + projectile.rotation = projectile.velocity.ToRotation() * MathHelper.PiOver2; + projectile.netUpdate = true; + } + } + } +} + + + \ No newline at end of file diff --git a/Assets/Buff/ShinyStoneHotswap.png b/Assets/Buff/ShinyStoneHotswap.png new file mode 100644 index 00000000..ec96c433 Binary files /dev/null and b/Assets/Buff/ShinyStoneHotswap.png differ diff --git a/Localization/en-US.hjson b/Localization/en-US.hjson index 8d8adbe9..4dff9902 100644 --- a/Localization/en-US.hjson +++ b/Localization/en-US.hjson @@ -599,6 +599,16 @@ Mods: { Label: Chlorophyte Spread Chance Modifier Tooltip: "" } + + ChlorophyteGrowChanceModifier: { + Label: Chlorophyte Grow Chance Modifier + Tooltip: "" + } + + ChlorophyteGrowLimitModifier: { + Label: Chlorophyte Grow Limit Modifier + Tooltip: "" + } } NpcBalanceConfig: { @@ -695,17 +705,25 @@ Mods: { True: "[c/FF0000:The game has been paused.]" False: "[c/00FF00:The game has been resumed.]" } + + Buffs: { + ShinyStoneHotswap: { + DisplayName: Shiny Stone Hotswap + Description: Shiny Stone is charging up! + } + } } } BuffDescription: { BeetleMight1: Melee damage and speed increase by 15% BeetleMight2: Melee damage and speed increase by 25% - BeetleMight3: Melee damage increase by 30% and melee speed increase by 50% + BeetleMight3: Melee damage increase by 30% and melee speed increase by 45% } ArmorSetBonus.BeetleDamage: ''' + Gain Beetles from player kills Beetles increase your melee damage and attack speed ''' diff --git a/PvPAdventure_AdventureConfig.json b/PvPAdventure_AdventureConfig.json new file mode 100644 index 00000000..4c8401cf --- /dev/null +++ b/PvPAdventure_AdventureConfig.json @@ -0,0 +1,1199 @@ +{ + "Points": { + "Npc": { + "Terraria/Golem": { + "First": 1, + "Additional": 1, + "Repeatable": true + }, + "Terraria/CultistBoss": { + "First": 4, + "Additional": 4, + "Repeatable": true + }, + "Terraria/DukeFishron": { + "First": 3, + "Additional": 3, + "Repeatable": true + }, + "Terraria/HallowBoss": { + "First": 4, + "Additional": 4, + "Repeatable": true + }, + "Terraria/BigMimicCorruption": { + "First": 1, + "Additional": 1 + }, + "Terraria/BigMimicHallow": { + "First": 1, + "Additional": 1 + }, + "Terraria/BigMimicCrimson": { + "First": 1, + "Additional": 1 + }, + "Terraria/DD2Betsy": { + "First": 10, + "Additional": 8, + "Repeatable": true + }, + "Terraria/EyeofCthulhu": { + "First": 1, + "Additional": 1 + }, + "Terraria/SkeletronHead": { + "First": 1, + "Additional": 1 + }, + "Terraria/KingSlime": { + "First": 1, + "Additional": 1 + }, + "Terraria/MartianSaucerCore": { + "First": 1, + "Additional": 1, + "Repeatable": true + } + }, + "Boss": { + "First": 2, + "Additional": 2 + }, + "PlayerKill": 1 + }, + "Bounties": [ + { + "Items": [ + { + "Item": { + "Name": "GoldWorm", + "DisplayName": "Gold Worm" + }, + "Stack": 3 + } + ], + "Conditions": { + "WorldProgression": 1 + } + }, + { + "Items": [ + { + "Item": { + "Name": "HermesBoots", + "DisplayName": "Hermes Boots" + }, + "Stack": 1 + }, + { + "Item": { + "Name": "CloudinaBottle", + "DisplayName": "Cloud in a Bottle" + }, + "Stack": 1 + }, + { + "Item": { + "Name": "SapphireHook", + "DisplayName": "Sapphire Hook" + }, + "Stack": 1 + } + ], + "Conditions": {} + }, + { + "Items": [ + { + "Item": { + "Name": "LifeCrystal", + "DisplayName": "Life Crystal" + }, + "Stack": 3 + } + ], + "Conditions": {} + }, + { + "Items": [ + { + "Item": { + "Name": "WormholePotion", + "DisplayName": "Wormhole Potion" + }, + "Stack": 3 + } + ], + "Conditions": {} + }, + { + "Items": [ + { + "Item": { + "Name": "GoldWorm", + "DisplayName": "Gold Worm" + }, + "Stack": 5 + } + ], + "Conditions": { + "WorldProgression": 2 + } + }, + { + "Items": [ + { + "Item": { + "Name": "GuideVoodooDoll", + "DisplayName": "Guide Voodoo Doll" + }, + "Stack": 1 + } + ], + "Conditions": { + "WorldProgression": 2 + } + }, + { + "Items": [ + { + "Item": { + "Name": "Hellforge", + "DisplayName": "Hellforge" + }, + "Prefix": { + "Name": "Precise", + "DisplayName": "Precise" + }, + "Stack": 1 + } + ], + "Conditions": { + "WorldProgression": 2 + } + }, + { + "Items": [ + { + "Item": { + "Name": "FallenStar", + "DisplayName": "Fallen Star" + }, + "Stack": 20 + } + ], + "Conditions": { + "WorldProgression": 2 + } + }, + { + "Items": [ + { + "Item": { + "Name": "SoulofFlight", + "DisplayName": "Soul of Flight" + }, + "Stack": 18 + }, + { + "Item": { + "Name": "Feather", + "DisplayName": "Feather" + }, + "Stack": 20 + } + ], + "Conditions": { + "WorldProgression": 2 + } + }, + { + "Items": [ + { + "Item": { + "Name": "SoulofLight", + "DisplayName": "Soul of Light" + }, + "Stack": 6 + }, + { + "Item": { + "Name": "CrystalShard", + "DisplayName": "Crystal Shard" + }, + "Stack": 40 + }, + { + "Item": { + "Name": "LightShard", + "DisplayName": "Light Shard" + }, + "Stack": 2 + } + ], + "Conditions": { + "WorldProgression": 2 + } + }, + { + "Items": [ + { + "Item": { + "Name": "SoulofNight", + "DisplayName": "Soul of Night" + }, + "Stack": 6 + }, + { + "Item": { + "Name": "CursedFlame", + "DisplayName": "Cursed Flame" + }, + "Stack": 40 + }, + { + "Item": { + "Name": "DarkShard", + "DisplayName": "Dark Shard" + }, + "Stack": 2 + } + ], + "Conditions": { + "WorldProgression": 2 + } + }, + { + "Items": [ + { + "Item": { + "Name": "PixieDust", + "DisplayName": "Pixie Dust" + }, + "Stack": 90 + }, + { + "Item": { + "Name": "UnicornHorn", + "DisplayName": "Unicorn Horn" + }, + "Stack": 2 + } + ], + "Conditions": { + "WorldProgression": 2 + } + }, + { + "Items": [ + { + "Item": { + "Name": "Ichor", + "DisplayName": "Ichor" + }, + "Stack": 40 + } + ], + "Conditions": { + "WorldProgression": 2 + } + }, + { + "Items": [ + { + "Item": { + "Name": "TurtleShell", + "DisplayName": "Turtle Shell" + }, + "Stack": 1 + } + ], + "Conditions": { + "WorldProgression": 2 + } + }, + { + "Items": [ + { + "Item": { + "Name": "SoulofSight", + "DisplayName": "Soul of Sight" + }, + "Stack": 6 + } + ], + "Conditions": { + "WorldProgression": 2, + "CollectedAllMechanicalBossSouls": true + } + }, + { + "Items": [ + { + "Item": { + "Name": "SoulofMight", + "DisplayName": "Soul of Might" + }, + "Stack": 26 + } + ], + "Conditions": { + "WorldProgression": 2, + "CollectedAllMechanicalBossSouls": true + } + }, + { + "Items": [ + { + "Item": { + "Name": "SoulofFright", + "DisplayName": "Soul of Fright" + }, + "Stack": 46 + } + ], + "Conditions": { + "WorldProgression": 2, + "CollectedAllMechanicalBossSouls": true + } + }, + { + "Items": [ + { + "Item": { + "Name": "LihzahrdPowerCell", + "DisplayName": "Lihzahrd Power Cell" + }, + "Prefix": { + "Name": "Powerful", + "DisplayName": "Powerful" + }, + "Stack": 1 + } + ], + "Conditions": { + "WorldProgression": 2, + "PlanteraDefeated": true + } + }, + { + "Items": [ + { + "Item": { + "Name": "LifeFruit", + "DisplayName": "Life Fruit" + }, + "Stack": 4 + } + ], + "Conditions": { + "WorldProgression": 2, + "SkeletronPrimeDefeated": true, + "TwinsDefeated": true, + "DestroyerDefeated": true + } + }, + { + "Items": [ + { + "Item": { + "Name": "LockBox", + "DisplayName": "Golden Lock Box" + }, + "Stack": 1 + }, + { + "Item": { + "Name": "ObsidianLockbox", + "DisplayName": "Obsidian Lock Box" + }, + "Stack": 1 + } + ], + "Conditions": { + "SkeletronDefeated": true + } + }, + { + "Items": [ + { + "Item": { + "Name": "RottenChunk", + "DisplayName": "Rotten Chunk" + }, + "Stack": 20 + }, + { + "Item": { + "Name": "VileMushroom", + "DisplayName": "Vile Mushroom" + }, + "Stack": 5 + }, + { + "Item": { + "Name": "Lens", + "DisplayName": "Lens" + }, + "Stack": 3 + }, + { + "Item": { + "Name": "Bone", + "DisplayName": "Bone" + }, + "Stack": 30 + }, + { + "Item": { + "Name": "IronBar", + "DisplayName": "Iron Bar" + }, + "Stack": 15 + } + ], + "Conditions": { + "WorldProgression": 2, + "SkeletronDefeated": true + } + }, + { + "Items": [ + { + "Item": { + "Name": "BottledWater", + "DisplayName": "Bottled Water" + }, + "Stack": 30 + }, + { + "Item": { + "Name": "Blinkroot", + "DisplayName": "Blinkroot" + }, + "Stack": 6 + }, + { + "Item": { + "Name": "Daybloom", + "DisplayName": "Daybloom" + }, + "Stack": 8 + }, + { + "Item": { + "Name": "Moonglow", + "DisplayName": "Moonglow" + }, + "Stack": 4 + }, + { + "Item": { + "Name": "Deathweed", + "DisplayName": "Deathweed" + }, + "Stack": 1 + }, + { + "Item": { + "Name": "Waterleaf", + "DisplayName": "Waterleaf" + }, + "Stack": 4 + }, + { + "Item": { + "Name": "AntlionMandible", + "DisplayName": "Antlion Mandible" + }, + "Stack": 4 + }, + { + "Item": { + "Name": "SharkFin", + "DisplayName": "Shark Fin" + }, + "Stack": 4 + } + ], + "Conditions": { + "WorldProgression": 2 + } + }, + { + "Items": [ + { + "Item": { + "Name": "Blinkroot", + "DisplayName": "Blinkroot" + }, + "Stack": 3 + }, + { + "Item": { + "Name": "Daybloom", + "DisplayName": "Daybloom" + }, + "Stack": 4 + }, + { + "Item": { + "Name": "Moonglow", + "DisplayName": "Moonglow" + }, + "Stack": 1 + }, + { + "Item": { + "Name": "Deathweed", + "DisplayName": "Deathweed" + }, + "Stack": 1 + }, + { + "Item": { + "Name": "Shiverthorn", + "DisplayName": "Shiverthorn" + }, + "Stack": 2 + }, + { + "Item": { + "Name": "AntlionMandible", + "DisplayName": "Antlion Mandible" + }, + "Stack": 2 + }, + { + "Item": { + "Name": "BottledWater", + "DisplayName": "Bottled Water" + }, + "Stack": 15 + }, + { + "Item": { + "Name": "Waterleaf", + "DisplayName": "Waterleaf" + }, + "Stack": 1 + } + ], + "Conditions": { + "WorldProgression": 1 + } + }, + { + "Items": [ + { + "Item": { + "Name": "TruffleWorm", + "DisplayName": "Truffle Worm" + }, + "Prefix": { + "Name": "Nimble", + "DisplayName": "Nimble" + }, + "Stack": 1 + } + ], + "Conditions": { + "WorldProgression": 2, + "GolemDefeated": true + } + }, + { + "Items": [ + { + "Item": { + "Name": "QueenSlimeCrystal", + "DisplayName": "Gelatin Crystal" + }, + "Stack": 2 + } + ], + "Conditions": { + "WorldProgression": 2 + } + } + ], + "Combat": { + "MeleeInvincibilityFrames": 0, + "PlayerDamageBalance": { + "ItemDamageMultipliers": { + "Terraria/Tsunami": 1.0, + "Terraria/StaffofEarth": 0.87, + "Terraria/ChlorophyteShotbow": 1.0, + "Terraria/FairyQueenRangedItem": 0.75, + "Terraria/MaceWhip": 0.55, + "Terraria/HeatRay": 0.5, + "Terraria/SniperRifle": 0.55, + "Terraria/ShadowbeamStaff": 0.6, + "Terraria/ToxicFlask": 1.0, + "Terraria/LaserMachinegun": 0.79999995, + "Terraria/Xenopopper": 1.75, + "Terraria/ProximityMineLauncher": 0.11, + "Terraria/ChargedBlasterCannon": 0.45, + "Terraria/TheEyeOfCthulhu": 0.7, + "Terraria/Kraken": 0.75, + "Terraria/VenusMagnum": 0.84999996, + "Terraria/PirateStaff": 0.79999995, + "Terraria/DaedalusStormbow": 0.65, + "Terraria/SoulDrain": 0.0, + "Terraria/MeteorStaff": 0.39999998, + "Terraria/DD2SquireBetsySword": 1.0, + "Terraria/StaffoftheFrostHydra": 0.0, + "Terraria/DD2BallistraTowerT3Popper": 0.0, + "Terraria/DD2BallistraTowerT2Popper": 0.0, + "Terraria/DD2BallistraTowerT1Popper": 0.0, + "Terraria/DD2FlameburstTowerT3Popper": 0.0, + "Terraria/DD2FlameburstTowerT2Popper": 0.0, + "Terraria/DD2FlameburstTowerT1Popper": 0.0, + "Terraria/RainbowRod": 1.0, + "Terraria/TempestStaff": 0.61, + "Terraria/DirtRod": 1000.0, + "Terraria/CursedFlames": 1.0, + "Terraria/FlyingKnife": 0.65, + "Terraria/RainbowWhip": 0.5, + "Terraria/TacticalShotgun": 2.0, + "Terraria/VenomStaff": 3.0, + "Terraria/PearlwoodSword": 1.1, + "Terraria/MagicMissile": 0.85999995, + "Terraria/Gungnir": 1.0, + "Terraria/TrueNightsEdge": 1.0, + "Terraria/RocketLauncher": 0.79999995, + "Terraria/OnyxBlaster": 1.5, + "Terraria/ScourgeoftheCorruptor": 0.9 + }, + "ProjectileDamageMultipliers": { + "Terraria/TinyEater": 0.5, + "Terraria/ClusterFragmentsI": 1.0, + "Terraria/ClusterFragmentsII": 0.96, + "Terraria/ClusterSnowmanFragmentsI": 1.0, + "Terraria/ClusterSnowmanFragmentsII": 1.0, + "Terraria/StyngerShrapnel": 1.0, + "Terraria/CrystalShard": 1.0, + "Terraria/TerraBlade2Shot": 0.5, + "Terraria/Starfury": 0.0, + "Terraria/SporeCloud": 1.0, + "Terraria/CursedDartFlame": 1.0, + "Terraria/ChlorophyteArrow": 0.0, + "Terraria/DD2SquireSonicBoom": 0.0, + "Terraria/ChargedBlasterLaser": 0.0 + }, + "ItemFalloff": { + "Terraria/SniperRifle": { + "Coefficient": 0.5, + "Forward": 100.0 + }, + "Terraria/ChlorophyteShotbow": { + "Coefficient": 1.5, + "Forward": 40.0 + }, + "Terraria/TacticalShotgun": { + "Coefficient": 1.75, + "Forward": 25.0 + }, + "Terraria/VenomStaff": { + "Coefficient": 1.7321, + "Forward": 8.95 + }, + "Terraria/OnyxBlaster": { + "Coefficient": 1.5, + "Forward": 25.0 + }, + "Terraria/Xenopopper": { + "Coefficient": 1.5, + "Forward": 25.0 + } + }, + "DefaultFalloff": { + "Coefficient": 1.0, + "Forward": 58.350002 + } + }, + "GhostHealMultiplier": 0.79999995, + "GhostHealMultiplierWearers": 0.5, + "GhostHealMaxDistance": 1500.0 + }, + "PreventUse": [ + { + "Name": "RecallPotion", + "DisplayName": "Recall Potion" + }, + { + "Name": "InvisibilityPotion", + "DisplayName": "Invisibility Potion" + }, + { + "Name": "PumpkinMoonMedallion", + "DisplayName": "Pumpkin Moon Medallion" + }, + { + "Name": "NaughtyPresent", + "DisplayName": "Naughty Present" + }, + { + "Name": "FlaskofNanites", + "DisplayName": "Flask of Nanites" + }, + { + "Name": "BeetleShell", + "DisplayName": "Beetle Shell" + }, + { + "Name": "PotionOfReturn", + "DisplayName": "Potion of Return" + }, + { + "Name": "TeleportationPotion", + "DisplayName": "Teleportation Potion" + }, + { + "Name": "FrozenShield", + "DisplayName": "Frozen Shield" + } + ], + "NpcSpawnAnnouncements": [ + { + "Name": "CultistBoss", + "DisplayName": "Lunatic Cultist" + }, + { + "Name": "RuneWizard", + "DisplayName": "Rune Wizard" + }, + { + "Name": "GoldMouse", + "DisplayName": "Gold Mouse" + }, + { + "Name": "MartianSaucer", + "DisplayName": "Martian Saucer" + }, + { + "Name": "CultistTablet", + "DisplayName": "Mysterious Tablet" + }, + { + "Name": "DoctorBones", + "DisplayName": "Doctor Bones" + }, + { + "Name": "SandElemental", + "DisplayName": "Sand Elemental" + }, + { + "Name": "IceGolem", + "DisplayName": "Ice Golem" + } + ], + "BossInvulnerableProjectiles": [ + { + "Name": "Dynamite", + "DisplayName": "Dynamite" + }, + { + "Name": "StickyDynamite", + "DisplayName": "Sticky Dynamite" + }, + { + "Name": "BouncyDynamite", + "DisplayName": "Bouncy Dynamite" + }, + { + "Name": "Bomb", + "DisplayName": "Bomb" + }, + { + "Name": "StickyBomb", + "DisplayName": "Sticky Bomb" + }, + { + "Name": "BouncyBomb", + "DisplayName": "Bouncy Bomb" + } + ], + "InvasionSizes": { + "1": { + "Value": 250 + }, + "3": { + "Value": 150 + }, + "4": { + "Value": 320 + } + }, + "SpawnImmuneFrames": 90, + "ShareWorldMap": false, + "AllowConfigModification": [ + "168209541136121856" + ], + "RemovePrefixes": true, + "ItemStatistics": { + "Terraria/Tsunami": { + "Damage": { + "Value": 45 + } + }, + "Terraria/Flairon": { + "Damage": { + "Value": 60 + } + }, + "Terraria/BubbleGun": { + "Mana": { + "Value": 10 + } + }, + "Terraria/DaedalusStormbow": { + "Damage": { + "Value": 34 + } + }, + "Terraria/TrueNightsEdge": { + "Damage": { + "Value": 250 + }, + "UseTime": { + "Value": 54 + }, + "UseAnimation": { + "Value": 54 + }, + "ShootSpeed": { + "Value": 22.6 + }, + "Scale": { + "Value": 0.6 + } + }, + "Terraria/Jetpack": { + "Value": { + "Value": 1000000 + } + }, + "Terraria/Megashark": { + "Damage": { + "Value": 30 + }, + "UseTime": { + "Value": 8 + }, + "UseAnimation": { + "Value": 8 + } + }, + "Terraria/ClockworkAssaultRifle": { + "UseTime": { + "Value": 10 + }, + "UseAnimation": { + "Value": 40 + } + }, + "Terraria/XenoStaff": {}, + "Terraria/MoneyTrough": { + "Value": { + "Value": 10000 + } + } + }, + "WorldGeneration": { + "PlanteraBulbChanceDenominator": 20, + "ChlorophyteSpreadChanceModifier": 100 + }, + "PreventAutoReuse": [ + { + "Name": "MagicMissile", + "DisplayName": "Magic Missile" + }, + { + "Name": "Flamelash", + "DisplayName": "Flamelash" + }, + { + "Name": "RainbowRod", + "DisplayName": "Rainbow Rod" + } + ], + "NpcBalance": { + "LifeMaxMultipliers": { + "Terraria/SkeletronHead": { + "Value": 1.49 + }, + "Terraria/SkeletronHand": { + "Value": 1.52 + }, + "Terraria/WallofFlesh": { + "Value": 1.49 + }, + "Terraria/Plantera": { + "Value": 1.52 + }, + "Terraria/HallowBoss": { + "Value": 1.49 + }, + "Terraria/Golem": { + "Value": 1.31 + }, + "Terraria/GolemFistLeft": { + "Value": 1.31 + }, + "Terraria/GolemFistRight": { + "Value": 1.31 + }, + "Terraria/CultistBoss": { + "Value": 1.49 + }, + "Terraria/MartianSaucerCore": { + "Value": 1.25 + }, + "Terraria/DukeFishron": { + "Value": 1.49 + } + } + }, + "ChestItemReplacements": { + "Terraria/MagicMirror": { + "Items": [ + { + "Item": { + "Name": "HermesBoots", + "DisplayName": "Hermes Boots" + }, + "Stack": 1 + }, + { + "Item": { + "Name": "CloudinaBottle", + "DisplayName": "Cloud in a Bottle" + }, + "Stack": 1 + }, + { + "Item": { + "Name": "Mace", + "DisplayName": "Mace" + }, + "Stack": 1 + }, + { + "Item": { + "Name": "BandofRegeneration", + "DisplayName": "Band of Regeneration" + }, + "Stack": 1 + }, + { + "Item": { + "Name": "ShoeSpikes", + "DisplayName": "Shoe Spikes" + }, + "Stack": 1 + } + ] + }, + "Terraria/PiranhaGun": { + "Items": [ + { + "Item": { + "Name": "VenusMagnum", + "DisplayName": "Venus Magnum" + }, + "Stack": 1 + } + ] + }, + "Terraria/StaffoftheFrostHydra": { + "Items": [ + { + "Item": { + "Name": "FrozenTurtleShell", + "DisplayName": "Frozen Turtle Shell" + }, + "Stack": 1 + } + ] + }, + "Terraria/LihzahrdPowerCell": { + "Items": [ + { + "Item": { + "Name": "LihzahrdPowerCell", + "DisplayName": "Lihzahrd Power Cell" + }, + "Stack": 2 + } + ] + }, + "Terraria/MagicConch": { + "Items": [ + { + "Item": { + "Name": "AncientChisel", + "DisplayName": "Ancient Chisel" + }, + "Stack": 1 + }, + { + "Item": { + "Name": "SandBoots", + "DisplayName": "Dunerider Boots" + }, + "Stack": 1 + } + ] + }, + "Terraria/Seaweed": { + "Items": [ + { + "Item": { + "Name": "FeralClaws", + "DisplayName": "Feral Claws" + }, + "Stack": 1 + } + ] + }, + "Terraria/Fish": { + "Items": [ + { + "Item": { + "Name": "BlizzardinaBottle", + "DisplayName": "Blizzard in a Bottle" + }, + "Stack": 1 + } + ] + }, + "Terraria/CatBast": { + "Items": [ + { + "Item": { + "Name": "SandstorminaBottle", + "DisplayName": "Sandstorm in a Bottle" + }, + "Stack": 1 + } + ] + }, + "Terraria/Extractinator": { + "Items": [ + { + "Item": { + "Name": "HermesBoots", + "DisplayName": "Hermes Boots" + }, + "Stack": 1 + }, + { + "Item": { + "Name": "CloudinaBottle", + "DisplayName": "Cloud in a Bottle" + }, + "Stack": 1 + }, + { + "Item": { + "Name": "Mace", + "DisplayName": "Mace" + }, + "Stack": 1 + }, + { + "Item": { + "Name": "BandofRegeneration", + "DisplayName": "Band of Regeneration" + }, + "Stack": 1 + } + ] + }, + "Terraria/TeleportationPotion": { + "Items": [ + { + "Item": { + "Name": "ThornsPotion", + "DisplayName": "Thorns Potion" + }, + "Stack": 2 + }, + { + "Item": { + "Name": "WaterWalkingPotion", + "DisplayName": "Water Walking Potion" + }, + "Stack": 2 + }, + { + "Item": { + "Name": "HunterPotion", + "DisplayName": "Hunter Potion" + }, + "Stack": 2 + }, + { + "Item": { + "Name": "TrapsightPotion", + "DisplayName": "Dangersense Potion" + }, + "Stack": 2 + } + ] + }, + "Terraria/PotionOfReturn": { + "Items": [ + { + "Item": { + "Name": "RecallPotion", + "DisplayName": "Recall Potion" + }, + "Stack": 1 + } + ] + }, + "Terraria/CordageGuide": { + "Items": [ + { + "Item": { + "Name": "Blowpipe", + "DisplayName": "Blowpipe" + }, + "Stack": 1 + }, + { + "Item": { + "Name": "ClimbingClaws", + "DisplayName": "Climbing Claws" + }, + "Stack": 1 + }, + { + "Item": { + "Name": "Aglet", + "DisplayName": "Aglet" + }, + "Stack": 1 + }, + { + "Item": { + "Name": "Umbrella", + "DisplayName": "Umbrella" + }, + "Stack": 1 + }, + { + "Item": { + "Name": "MoonLordLegs", + "DisplayName": "Moon Lord Legs" + }, + "Stack": 1 + } + ] + } + }, + "MinimumDamageReceivedByPlayersFromPlayer": 5 +} \ No newline at end of file diff --git a/System/AdventureInventory.cs b/System/AdventureInventory.cs index 89aca844..c28be53e 100644 --- a/System/AdventureInventory.cs +++ b/System/AdventureInventory.cs @@ -45,13 +45,10 @@ public override void Load() private static bool IsPlayerDyeContext(int context) => context is ItemSlot.Context.EquipDye or ItemSlot.Context.EquipMiscDye or ItemSlot.Context.ModdedDyeSlot; - private static bool IsUnusableContext(int context) => - IsPlayerDyeContext(context) || context == ItemSlot.Context.EquipArmorVanity; - private void OnAccessorySlotLoaderDrawSlot(AccessorySlotLoaderDrawSlotDelegate orig, AccessorySlotLoader self, Item[] items, int context, int slot, bool flag3, int xLoc, int yLoc, bool skipCheck) { - if (IsUnusableContext(context)) + if (IsPlayerDyeContext(context)) return; orig(self, items, context, slot, flag3, xLoc, yLoc, skipCheck); @@ -60,7 +57,7 @@ private void OnAccessorySlotLoaderDrawSlot(AccessorySlotLoaderDrawSlotDelegate o private void OnItemSlotDraw(On_ItemSlot.orig_Draw_SpriteBatch_ItemArray_int_int_Vector2_Color orig, SpriteBatch spriteBatch, Item[] inv, int context, int slot, Vector2 position, Color lightColor) { - if (IsUnusableContext(context)) + if (IsPlayerDyeContext(context)) return; orig(spriteBatch, inv, context, slot, position, lightColor); @@ -68,7 +65,7 @@ private void OnItemSlotDraw(On_ItemSlot.orig_Draw_SpriteBatch_ItemArray_int_int_ private void OnItemSlotHandle(On_ItemSlot.orig_Handle_ItemArray_int_int orig, Item[] inv, int context, int slot) { - if (IsUnusableContext(context)) + if (IsPlayerDyeContext(context)) return; orig(inv, context, slot); @@ -77,7 +74,7 @@ private void OnItemSlotHandle(On_ItemSlot.orig_Handle_ItemArray_int_int orig, It private void OnItemSlotOverrideHover(On_ItemSlot.orig_OverrideHover_ItemArray_int_int orig, Item[] inv, int context, int slot) { - if (IsUnusableContext(context)) + if (IsPlayerDyeContext(context)) return; orig(inv, context, slot); @@ -86,7 +83,7 @@ private void OnItemSlotOverrideHover(On_ItemSlot.orig_OverrideHover_ItemArray_in private void OnItemSlotRightClick(On_ItemSlot.orig_RightClick_ItemArray_int_int orig, Item[] inv, int context, int slot) { - if (IsUnusableContext(context)) + if (IsPlayerDyeContext(context)) return; orig(inv, context, slot); @@ -95,7 +92,7 @@ private void OnItemSlotRightClick(On_ItemSlot.orig_RightClick_ItemArray_int_int private void OnItemSlotLeftClick(On_ItemSlot.orig_LeftClick_ItemArray_int_int orig, Item[] inv, int context, int slot) { - if (IsUnusableContext(context)) + if (IsPlayerDyeContext(context)) return; orig(inv, context, slot); @@ -104,7 +101,7 @@ private void OnItemSlotLeftClick(On_ItemSlot.orig_LeftClick_ItemArray_int_int or private void OnItemSlotMouseHover(On_ItemSlot.orig_MouseHover_ItemArray_int_int orig, Item[] inv, int context, int slot) { - if (IsUnusableContext(context)) + if (IsPlayerDyeContext(context)) return; orig(inv, context, slot); diff --git a/System/DiscordIdentification.cs b/System/DiscordIdentification.cs index 4be689a1..47bb501f 100644 --- a/System/DiscordIdentification.cs +++ b/System/DiscordIdentification.cs @@ -15,7 +15,7 @@ namespace PvPAdventure.System; [Autoload(Side = ModSide.Both)] public class DiscordIdentification : ModSystem { - private const bool Enabled = true; + private const bool Enabled = false; public delegate void PlayerJoinEventHandler(DiscordIdentification source, PlayerJoinArgs args); diff --git a/System/RecipeManager.cs b/System/RecipeManager.cs index 2db8ccb4..28b16e3d 100644 --- a/System/RecipeManager.cs +++ b/System/RecipeManager.cs @@ -1,6 +1,8 @@ -using System.Collections.Generic; +using System.Collections.Generic; +using System.Linq; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace PvPAdventure.System; @@ -8,6 +10,7 @@ namespace PvPAdventure.System; [Autoload(Side = ModSide.Both)] public class RecipeManager : ModSystem { + public override void AddRecipes() { CreateDuplicateDropRecipe([ @@ -79,6 +82,37 @@ public override void AddRecipes() .AddIngredient(ItemID.StoneBlock, 50) .AddTile(TileID.HeavyWorkBench) .Register(); + + + + + int[] itemsToRemove = new int[] + { + ItemID.TrueNightsEdge, + ItemID.MoonlordArrow + }; + + for (int i = 0; i < Main.recipe.Length; i++) + { + Recipe recipe = Main.recipe[i]; + if (recipe.createItem.type != ItemID.None && itemsToRemove.Contains(recipe.createItem.type)) + { + recipe.DisableRecipe(); + } + } + + //temp sudo terrablade + Recipe.Create(ItemID.TrueNightsEdge) + .AddIngredient(ItemID.SoulofFright, 20) + .AddIngredient(ItemID.SoulofMight, 20) + .AddIngredient(ItemID.SoulofSight, 20) + .AddIngredient(ItemID.NightsEdge) + .AddIngredient(ItemID.TrueExcalibur) + .AddIngredient(ItemID.BrokenHeroSword) + .AddTile(TileID.MythrilAnvil) + .Register(); + + } private static void CreateDuplicateDropRecipe(List lootTable, int amountOfMaterial) @@ -97,4 +131,551 @@ private static void CreateDuplicateDropRecipe(List lootTable, int amountOfM } } } + + public class AnyGolem1 : ModSystem + { + public static RecipeGroup AnyGolemPrimary; + public static int[] PrimaryItems => new int[] { + ItemID.GolemMasterTrophy, + ItemID.Stynger, + ItemID.PossessedHatchet, + ItemID.HeatRay, + ItemID.GolemFist, + ItemID.StaffofEarth + }; + + public override void AddRecipeGroups() + { + // Main group with trophy as first item (for icon) + AnyGolemPrimary = new RecipeGroup(() => Language.GetTextValue("Any Golem Primary"), PrimaryItems); + RecipeGroup.RegisterGroup("PvPAdventure:AnyGolemPrimary", AnyGolemPrimary); + + // Create exclude subgroups while maintaining trophy as first item + foreach (int itemID in PrimaryItems.Where(id => id != ItemID.GolemMasterTrophy)) + { + var validItems = PrimaryItems + .Where(id => id != itemID && id != ItemID.GolemMasterTrophy) + .Prepend(ItemID.GolemMasterTrophy) // Keep trophy first for icon + .ToArray(); + + RecipeGroup group = new RecipeGroup( + () => Language.GetTextValue("Any Golem Primary"), + validItems + ); + RecipeGroup.RegisterGroup($"PvPAdventure:AnyGolemPrimaryExclude{itemID}", group); + } + } + } + + public class AnyGolem2 : ModSystem + { + public static RecipeGroup AnyGolemSecondary; + public static int[] SecondaryItems => new int[] { + ItemID.GolemBossBag, + ItemID.SunStone, + ItemID.ShinyStone, + ItemID.EyeoftheGolem, + ItemID.Picksaw + }; + + public override void AddRecipeGroups() + { + // Main group with boss bag as first item (for icon) + AnyGolemSecondary = new RecipeGroup(() => Language.GetTextValue("Any Golem Secondary"), SecondaryItems); + RecipeGroup.RegisterGroup("PvPAdventure:AnyGolemSecondary", AnyGolemSecondary); + + // Create exclude subgroups while maintaining boss bag as first item + foreach (int itemID in SecondaryItems.Where(id => id != ItemID.GolemBossBag)) + { + var validItems = SecondaryItems + .Where(id => id != itemID && id != ItemID.GolemBossBag) + .Prepend(ItemID.GolemBossBag) // Keep boss bag first for icon + .ToArray(); + + RecipeGroup group = new RecipeGroup( + () => Language.GetTextValue("Any Golem Secondary"), + validItems + ); + RecipeGroup.RegisterGroup($"PvPAdventure:AnyGolemSecondaryExclude{itemID}", group); + } + } + } + + public class AnyQueenSlime1 : ModSystem + { + public static RecipeGroup AnyQueenSlimePrimary; + public static int[] PrimaryItems => new int[] { + ItemID.QueenSlimeMasterTrophy, + ItemID.Smolstar, + ItemID.QueenSlimeHook, + ItemID.QueenSlimeMountSaddle, + }; + + public override void AddRecipeGroups() + { + // Main group with trophy as first item (for icon) + AnyQueenSlimePrimary = new RecipeGroup(() => Language.GetTextValue("Any Queen Slime Primary"), PrimaryItems); + RecipeGroup.RegisterGroup("PvPAdventure:AnyQueenSlimePrimary", AnyQueenSlimePrimary); + + // Create exclude subgroups while maintaining icon as first item + foreach (int itemID in PrimaryItems.Where(id => id != ItemID.QueenSlimeMasterTrophy)) + { + var validItems = PrimaryItems + .Where(id => id != itemID && id != ItemID.QueenSlimeMasterTrophy) + .Prepend(ItemID.QueenSlimeMasterTrophy) // Keep item first for icon + .ToArray(); + + RecipeGroup group = new RecipeGroup( + () => Language.GetTextValue("Any Queen Slime Primary"), + validItems + ); + RecipeGroup.RegisterGroup($"PvPAdventure:AnyQueenSlimePrimaryExclude{itemID}", group); + } + } + } + + public class AnyPlantera1 : ModSystem + { + public static RecipeGroup AnyPlanteraPrimary; + public static int[] PrimaryItems => new int[] { + ItemID.PlanteraMasterTrophy, + ItemID.GrenadeLauncher, + ItemID.LeafBlower, + ItemID.WaspGun, + ItemID.NettleBurst, + ItemID.FlowerPow, + ItemID.VenusMagnum, + ItemID.Seedler, + }; + + public override void AddRecipeGroups() + { + // Main group with trophy as first item (for icon) + AnyPlanteraPrimary = new RecipeGroup(() => Language.GetTextValue("Any Plantera Drop"), PrimaryItems); + RecipeGroup.RegisterGroup("PvPAdventure:AnyPlanteraPrimary", AnyPlanteraPrimary); + + // Create exclude subgroups while maintaining icon as first item + foreach (int itemID in PrimaryItems.Where(id => id != ItemID.PlanteraMasterTrophy)) + { + var validItems = PrimaryItems + .Where(id => id != itemID && id != ItemID.PlanteraMasterTrophy) + .Prepend(ItemID.PlanteraMasterTrophy) // Keep item first for icon + .ToArray(); + + RecipeGroup group = new RecipeGroup( + () => Language.GetTextValue("Any Plantera Drop"), + validItems + ); + RecipeGroup.RegisterGroup($"PvPAdventure:AnyPlanteraPrimaryExclude{itemID}", group); + } + } + } + + public class AnyDuke1 : ModSystem + { + public static RecipeGroup AnyDukePrimary; + public static int[] PrimaryItems => new int[] { + ItemID.DukeFishronMasterTrophy, + ItemID.RazorbladeTyphoon, + ItemID.BubbleGun, + ItemID.Flairon, + ItemID.Tsunami, + ItemID.TempestStaff, + }; + + public override void AddRecipeGroups() + { + // Main group with trophy as first item (for icon) + AnyDukePrimary = new RecipeGroup(() => Language.GetTextValue("Any Duke Primary"), PrimaryItems); + RecipeGroup.RegisterGroup("PvPAdventure:AnyDukePrimary", AnyDukePrimary); + + // Create exclude subgroups while maintaining icon as first item + foreach (int itemID in PrimaryItems.Where(id => id != ItemID.DukeFishronMasterTrophy)) + { + var validItems = PrimaryItems + .Where(id => id != itemID && id != ItemID.DukeFishronMasterTrophy) + .Prepend(ItemID.DukeFishronMasterTrophy) // Keep item first for icon + .ToArray(); + + RecipeGroup group = new RecipeGroup( + () => Language.GetTextValue("Any Duke Primary"), + validItems + ); + RecipeGroup.RegisterGroup($"PvPAdventure:AnyDukePrimaryExclude{itemID}", group); + } + } + } + + public class AnyEmpress1 : ModSystem + { + public static RecipeGroup AnyEmpressPrimary; + public static int[] PrimaryItems => new int[] { + ItemID.FairyQueenMasterTrophy, + ItemID.FairyQueenMagicItem, + ItemID.FairyQueenRangedItem, + ItemID.PiercingStarlight, + ItemID.RainbowWhip, + ItemID.EmpressBlade, + }; + + public override void AddRecipeGroups() + { + // Main group with trophy as first item (for icon) + AnyEmpressPrimary = new RecipeGroup(() => Language.GetTextValue("Any Empress Primary"), PrimaryItems); + RecipeGroup.RegisterGroup("PvPAdventure:AnyEmpressPrimary", AnyEmpressPrimary); + + // Create exclude subgroups while maintaining icon as first item + foreach (int itemID in PrimaryItems.Where(id => id != ItemID.FairyQueenMasterTrophy)) + { + var validItems = PrimaryItems + .Where(id => id != itemID && id != ItemID.FairyQueenMasterTrophy) + .Prepend(ItemID.FairyQueenMasterTrophy) // Keep item first for icon + .ToArray(); + + RecipeGroup group = new RecipeGroup( + () => Language.GetTextValue("Any Empress Primary"), + validItems + ); + RecipeGroup.RegisterGroup($"PvPAdventure:AnyEmpressPrimaryExclude{itemID}", group); + } + } + } + + public class AnyWall1 : ModSystem + { + public static RecipeGroup AnyWallPrimary; + public static int[] PrimaryItems => new int[] { + ItemID.WallofFleshMasterTrophy, + ItemID.FireWhip, + ItemID.ClockworkAssaultRifle, + ItemID.BreakerBlade, + ItemID.LaserRifle, + }; + + public override void AddRecipeGroups() + { + // Main group with trophy as first item (for icon) + AnyWallPrimary = new RecipeGroup(() => Language.GetTextValue("Any Wall of Flesh Primary"), PrimaryItems); + RecipeGroup.RegisterGroup("PvPAdventure:AnyWallPrimary", AnyWallPrimary); + + // Create exclude subgroups while maintaining icon as first item + foreach (int itemID in PrimaryItems.Where(id => id != ItemID.WallofFleshMasterTrophy)) + { + var validItems = PrimaryItems + .Where(id => id != itemID && id != ItemID.WallofFleshMasterTrophy) + .Prepend(ItemID.WallofFleshMasterTrophy) // Keep item first for icon + .ToArray(); + + RecipeGroup group = new RecipeGroup( + () => Language.GetTextValue("Any Wall of Flesh Primary"), + validItems + ); + RecipeGroup.RegisterGroup($"PvPAdventure:AnyWallPrimaryExclude{itemID}", group); + } + } + } + + public class AnySaucer1 : ModSystem + { + public static RecipeGroup AnySaucerPrimary; + public static int[] PrimaryItems => new int[] { + ItemID.UFOMasterTrophy, + ItemID.XenoStaff, + ItemID.LaserMachinegun, + ItemID.InfluxWaver, + ItemID.ElectrosphereLauncher, + ItemID.Xenopopper, + }; + + public override void AddRecipeGroups() + { + // Main group with trophy as first item (for icon) + AnySaucerPrimary = new RecipeGroup(() => Language.GetTextValue("Any Saucer Primary"), PrimaryItems); + RecipeGroup.RegisterGroup("PvPAdventure:AnySaucerPrimary", AnySaucerPrimary); + + // Create exclude subgroups while maintaining icon as first item + foreach (int itemID in PrimaryItems.Where(id => id != ItemID.UFOMasterTrophy)) + { + var validItems = PrimaryItems + .Where(id => id != itemID && id != ItemID.UFOMasterTrophy) + .Prepend(ItemID.UFOMasterTrophy) // Keep item first for icon + .ToArray(); + + RecipeGroup group = new RecipeGroup( + () => Language.GetTextValue("Any Saucer Primary"), + validItems + ); + RecipeGroup.RegisterGroup($"PvPAdventure:AnySaucerPrimaryExclude{itemID}", group); + } + } + } + + public class AnyCorruptionMimic1 : ModSystem + { + public static RecipeGroup AnyCorruptionMimicPrimary; + public static int[] PrimaryItems => new int[] { + ItemID.Fake_CorruptionChest, + ItemID.PutridScent, + ItemID.DartRifle, + ItemID.ClingerStaff, + ItemID.ChainGuillotines, + ItemID.WormHook, + }; + + public override void AddRecipeGroups() + { + // Main group with trophy as first item (for icon) + AnyCorruptionMimicPrimary = new RecipeGroup(() => Language.GetTextValue("Any Corrupt Mimic Primary"), PrimaryItems); + RecipeGroup.RegisterGroup("PvPAdventure:AnyCorruptionMimicPrimary", AnyCorruptionMimicPrimary); + + // Create exclude subgroups while maintaining icon as first item + foreach (int itemID in PrimaryItems.Where(id => id != ItemID.Fake_CorruptionChest)) + { + var validItems = PrimaryItems + .Where(id => id != itemID && id != ItemID.Fake_CorruptionChest) + .Prepend(ItemID.Fake_CorruptionChest) // Keep item first for icon + .ToArray(); + + RecipeGroup group = new RecipeGroup( + () => Language.GetTextValue("Any Corrupt Mimic Primary"), + validItems + ); + RecipeGroup.RegisterGroup($"PvPAdventure:AnyCorruptionMimicPrimaryExclude{itemID}", group); + } + } + } + + public class AnyHallowedMimic1 : ModSystem + { + public static RecipeGroup AnyHallowedMimicPrimary; + public static int[] PrimaryItems => new int[] { + ItemID.Fake_HallowedChest, + ItemID.DaedalusStormbow, + ItemID.CrystalVileShard, + ItemID.FlyingKnife, + ItemID.IlluminantHook, + }; + + public override void AddRecipeGroups() + { + // Main group with trophy as first item (for icon) + AnyHallowedMimicPrimary = new RecipeGroup(() => Language.GetTextValue("Any Hallowed Mimic Primary"), PrimaryItems); + RecipeGroup.RegisterGroup("PvPAdventure:AnyHallowedMimicPrimary", AnyHallowedMimicPrimary); + + // Create exclude subgroups while maintaining icon as first item + foreach (int itemID in PrimaryItems.Where(id => id != ItemID.Fake_HallowedChest)) + { + var validItems = PrimaryItems + .Where(id => id != itemID && id != ItemID.Fake_HallowedChest) + .Prepend(ItemID.Fake_HallowedChest) // Keep item first for icon + .ToArray(); + + RecipeGroup group = new RecipeGroup( + () => Language.GetTextValue("Any Hallowed Mimic Primary"), + validItems + ); + RecipeGroup.RegisterGroup($"PvPAdventure:AnyHallowedMimicPrimaryExclude{itemID}", group); + } + } + + public class AnyMimic1 : ModSystem + { + public static RecipeGroup AnyMimicPrimary; + public static int[] PrimaryItems => new int[] { + ItemID.DeadMansChest, + ItemID.TitanGlove, + ItemID.CrossNecklace, + ItemID.StarCloak, + ItemID.PhilosophersStone, + ItemID.MagicDagger, + ItemID.DualHook, + }; + + public override void AddRecipeGroups() + { + // Main group with trophy as first item (for icon) + AnyMimicPrimary = new RecipeGroup(() => Language.GetTextValue("Any Mimic Primary"), PrimaryItems); + RecipeGroup.RegisterGroup("PvPAdventure:AnyMimicPrimary", AnyMimicPrimary); + + // Create exclude subgroups while maintaining icon as first item + foreach (int itemID in PrimaryItems.Where(id => id != ItemID.DeadMansChest)) + { + var validItems = PrimaryItems + .Where(id => id != itemID && id != ItemID.DeadMansChest) + .Prepend(ItemID.DeadMansChest) // Keep item first for icon + .ToArray(); + + RecipeGroup group = new RecipeGroup( + () => Language.GetTextValue("Any Mimic Primary"), + validItems + ); + RecipeGroup.RegisterGroup($"PvPAdventure:AnyMimicPrimaryExclude{itemID}", group); + } + } + } + + public class AnyBrickwall1: ModSystem + { + public static RecipeGroup AnyBrickwall; + public static int[] PrimaryItems => new int[] { + ItemID.NecromanticSign, + ItemID.ShadowbeamStaff, + ItemID.RocketLauncher, + ItemID.PaladinsHammer + }; + + public override void AddRecipeGroups() + { + // Main group with trophy as first item (for icon) + AnyBrickwall = new RecipeGroup(() => Language.GetTextValue("Any Brick Wall"), PrimaryItems); + RecipeGroup.RegisterGroup("PvPAdventure:AnyBrickWall", AnyBrickwall); + + // Create exclude subgroups while maintaining icon as first item + foreach (int itemID in PrimaryItems.Where(id => id != ItemID.NecromanticSign)) + { + var validItems = PrimaryItems + .Where(id => id != itemID && id != ItemID.NecromanticSign) + .Prepend(ItemID.NecromanticSign) // Keep item first for icon + .ToArray(); + + RecipeGroup group = new RecipeGroup( + () => Language.GetTextValue("Any Brick Wall"), + validItems + ); + RecipeGroup.RegisterGroup($"PvPAdventure:AnyBrickWallExclude{itemID}", group); + } + } + } + + public class RecipeSystem : ModSystem + { + public override void AddRecipes() + { + var shimmerCondition = new Condition( + Language.GetText("Mods.PvPAdventure.Conditions.NearShimmer"), + () => Main.LocalPlayer.adjShimmer + ); + + // Primary recipes (trophy remains icon) + foreach (int itemID in AnyGolem1.PrimaryItems.Where(id => id != ItemID.GolemMasterTrophy)) + { + Recipe.Create(itemID) + .AddRecipeGroup($"PvPAdventure:AnyGolemPrimaryExclude{itemID}", 3) + .AddCondition(shimmerCondition) + .DisableDecraft() + .Register(); + } + + // Secondary recipes (boss bag remains icon) + foreach (int itemID in AnyGolem2.SecondaryItems.Where(id => id != ItemID.GolemBossBag)) + { + Recipe.Create(itemID) + .AddRecipeGroup($"PvPAdventure:AnyGolemSecondaryExclude{itemID}", 3) + .AddCondition(shimmerCondition) + .DisableDecraft() + .Register(); + } + + // Primary QS recipes (Relic remains icon) + foreach (int itemID in AnyQueenSlime1.PrimaryItems.Where(id => id != ItemID.QueenSlimeMasterTrophy)) + { + Recipe.Create(itemID) + .AddRecipeGroup($"PvPAdventure:AnyQueenSlimePrimaryExclude{itemID}", 3) + .AddCondition(shimmerCondition) + .DisableDecraft() + .Register(); + } + + // Primary Plantera recipes (Relic remains icon) + foreach (int itemID in AnyPlantera1.PrimaryItems.Where(id => id != ItemID.PlanteraMasterTrophy)) + { + Recipe.Create(itemID) + .AddRecipeGroup($"PvPAdventure:AnyPlanteraPrimaryExclude{itemID}", 3) + .AddCondition(shimmerCondition) + .DisableDecraft() + .Register(); + } + + // Primary Duke recipes (Relic remains icon) + foreach (int itemID in AnyDuke1.PrimaryItems.Where(id => id != ItemID.DukeFishronMasterTrophy)) + { + Recipe.Create(itemID) + .AddRecipeGroup($"PvPAdventure:AnyDukePrimaryExclude{itemID}", 3) + .AddCondition(shimmerCondition) + .DisableDecraft() + .Register(); + } + + // Primary Empress recipes (Relic remains icon) + foreach (int itemID in AnyEmpress1.PrimaryItems.Where(id => id != ItemID.FairyQueenMasterTrophy)) + { + Recipe.Create(itemID) + .AddRecipeGroup($"PvPAdventure:AnyEmpressPrimaryExclude{itemID}", 2) + .AddCondition(shimmerCondition) + .DisableDecraft() + .Register(); + } + + // Primary Wall recipes (Relic remains icon) + foreach (int itemID in AnyWall1.PrimaryItems.Where(id => id != ItemID.WallofFleshMasterTrophy)) + { + Recipe.Create(itemID) + .AddRecipeGroup($"PvPAdventure:AnyWallPrimaryExclude{itemID}", 2) + .AddCondition(shimmerCondition) + .DisableDecraft() + .Register(); + } + + // Primary UFO recipes (Relic remains icon) + foreach (int itemID in AnySaucer1.PrimaryItems.Where(id => id != ItemID.UFOMasterTrophy)) + { + Recipe.Create(itemID) + .AddRecipeGroup($"PvPAdventure:AnySaucerPrimaryExclude{itemID}", 3) + .AddCondition(shimmerCondition) + .DisableDecraft() + .Register(); + } + + // Primary Corro mimic recipes (Relic remains icon) + foreach (int itemID in AnyCorruptionMimic1.PrimaryItems.Where(id => id != ItemID.Fake_CorruptionChest)) + { + Recipe.Create(itemID) + .AddRecipeGroup($"PvPAdventure:AnyCorruptionMimicPrimaryExclude{itemID}", 3) + .AddCondition(shimmerCondition) + .DisableDecraft() + .Register(); + } + + // Primary Hallow mimic recipes (Relic remains icon) + foreach (int itemID in AnyHallowedMimic1.PrimaryItems.Where(id => id != ItemID.Fake_HallowedChest)) + { + Recipe.Create(itemID) + .AddRecipeGroup($"PvPAdventure:AnyHallowedMimicPrimaryExclude{itemID}", 2) + .AddCondition(shimmerCondition) + .DisableDecraft() + .Register(); + } + + // Primary Mimic recipes (Relic remains icon) + foreach (int itemID in AnyMimic1.PrimaryItems.Where(id => id != ItemID.DeadMansChest)) + { + Recipe.Create(itemID) + .AddRecipeGroup($"PvPAdventure:AnyMimicPrimaryExclude{itemID}", 3) + .AddCondition(shimmerCondition) + .DisableDecraft() + .Register(); + } + // Primary Mimic recipes (Relic remains icon) + foreach (int itemID in AnyBrickwall1.PrimaryItems.Where(id => id != ItemID.NecromanticSign)) + { + Recipe.Create(itemID) + .AddRecipeGroup($"PvPAdventure:AnyBrickWallExclude{itemID}", 3) + .AddCondition(shimmerCondition) + .DisableDecraft() + .Register(); + } + + } + } + } } \ No newline at end of file diff --git a/System/WorldGenerationManager.cs b/System/WorldGenerationManager.cs index 6fa3e1fa..3823ed77 100644 --- a/System/WorldGenerationManager.cs +++ b/System/WorldGenerationManager.cs @@ -12,6 +12,7 @@ public override void Load() IL_WorldGen.UpdateWorld_GrassGrowth += EditWorldGenUpdateWorld_GrassGrowth; IL_WorldGen.hardUpdateWorld += OnWorldGenhardUpdateWorld; IL_WorldGen.AddBuriedChest_int_int_int_bool_int_bool_ushort += EditWorldGenAddBuriedChest; + IL_WorldGen.Chlorophyte += OnWorldGenChlorophyte; } private void EditWorldGenUpdateWorld_GrassGrowth(ILContext il) @@ -66,6 +67,16 @@ private void OnWorldGenhardUpdateWorld(ILContext il) { var cursor = new ILCursor(il); + // Find the call to WorldGen.genRand.Next(300)... + cursor.GotoNext(i => i.MatchCallvirt("Next") && i.Previous.MatchLdcI4(300)); + // ...and go back to the constant load... + cursor.Index -= 1; + // ... to remove it... + cursor.Remove() + // ...and replace it with a delegate that loads from our config instance. + .EmitDelegate(() => + ModContent.GetInstance().WorldGeneration.ChlorophyteGrowChanceModifier); + // Find the call to WorldGen.genRand.Next(3)... cursor.GotoNext(i => i.MatchCallvirt("Next") && i.Previous.MatchLdcI4(3)); // ...and go back to the constant load... @@ -77,6 +88,28 @@ private void OnWorldGenhardUpdateWorld(ILContext il) ModContent.GetInstance().WorldGeneration.ChlorophyteSpreadChanceModifier); } + private void OnWorldGenChlorophyte(ILContext il) + { + var cursor = new ILCursor(il); + + // Find the call to WorldGen.genRand.Next(300)... + cursor.GotoNext(i => i.MatchLdcI4(40)); + // ... to remove it... + cursor.Remove() + // ...and replace it with a delegate that loads from our config instance. + .EmitDelegate(() => + ModContent.GetInstance().WorldGeneration.ChlorophyteGrowLimitModifier); + cursor.Index = 0; + + cursor.GotoNext(i => i.MatchLdcI4(130)); + // ... to remove it... + cursor.Remove() + // ...and replace it with a delegate that loads from our config instance. + .EmitDelegate(() => + ModContent.GetInstance().WorldGeneration.ChlorophyteGrowLimitModifier); + + } + private void EditWorldGenAddBuriedChest(ILContext il) { var cursor = new ILCursor(il); diff --git a/icon.png b/icon.png index e18d0f43..2619499b 100644 Binary files a/icon.png and b/icon.png differ