diff --git a/BiomeManagers/AbovegroundAstralBiome.cs b/BiomeManagers/AbovegroundAstralBiome.cs index 2593db3053..d3ce06a025 100644 --- a/BiomeManagers/AbovegroundAstralBiome.cs +++ b/BiomeManagers/AbovegroundAstralBiome.cs @@ -12,6 +12,7 @@ namespace CalamityMod.BiomeManagers public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh; public override string BestiaryIcon => "CalamityMod/BiomeManagers/AbovegroundAstralBiomeIcon"; public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG"; + public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG"; public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("Astral") ?? MusicID.Space; @@ -24,5 +25,11 @@ namespace CalamityMod.BiomeManagers { return !player.ZoneDungeon && BiomeTileCounterSystem.AstralTiles > 950 && !player.ZoneDesert && !player.ZoneSnow; } + + public override void SpecialVisuals(Player player, bool isActive) + { + player.ManageSpecialBiomeVisuals("CalamityMod:Astral", isActive); + } + } } diff --git a/BiomeManagers/AbovegroundAstralDesertBiome.cs b/BiomeManagers/AbovegroundAstralDesertBiome.cs index f2643dd50d..eaf59dfac0 100644 --- a/BiomeManagers/AbovegroundAstralDesertBiome.cs +++ b/BiomeManagers/AbovegroundAstralDesertBiome.cs @@ -13,6 +13,7 @@ namespace CalamityMod.BiomeManagers public override string BestiaryIcon => "CalamityMod/BiomeManagers/AstralDesertIcon"; // Could use its own unique background public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG"; + public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG"; public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("Astral") ?? MusicID.Space; public override void SetStaticDefaults() @@ -24,5 +25,10 @@ namespace CalamityMod.BiomeManagers { return !player.ZoneDungeon && BiomeTileCounterSystem.AstralTiles > 950 && player.ZoneDesert && !player.ZoneSnow; } + + public override void SpecialVisuals(Player player, bool isActive) + { + player.ManageSpecialBiomeVisuals("CalamityMod:Astral", isActive); + } } } diff --git a/BiomeManagers/AbovegroundAstralSnowBiome.cs b/BiomeManagers/AbovegroundAstralSnowBiome.cs index 2ea90b2cc6..7fc5fbb12c 100644 --- a/BiomeManagers/AbovegroundAstralSnowBiome.cs +++ b/BiomeManagers/AbovegroundAstralSnowBiome.cs @@ -10,6 +10,7 @@ namespace CalamityMod.BiomeManagers public override ModWaterStyle WaterStyle => ModContent.Find("CalamityMod/AstralWater"); public override ModSurfaceBackgroundStyle SurfaceBackgroundStyle => ModContent.Find("CalamityMod/AstralSnowSurfaceBGStyle"); public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh; + public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG"; public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("Astral") ?? MusicID.Space; @@ -22,5 +23,11 @@ namespace CalamityMod.BiomeManagers { return !player.ZoneDungeon && BiomeTileCounterSystem.AstralTiles > 950 && !player.ZoneDesert && player.ZoneSnow; } + + public override void SpecialVisuals(Player player, bool isActive) + { + player.ManageSpecialBiomeVisuals("CalamityMod:Astral", isActive); + } + } } diff --git a/BiomeManagers/AbyssLayer1Biome.cs b/BiomeManagers/AbyssLayer1Biome.cs index f71ab13944..9e299f96e9 100644 --- a/BiomeManagers/AbyssLayer1Biome.cs +++ b/BiomeManagers/AbyssLayer1Biome.cs @@ -47,6 +47,7 @@ namespace CalamityMod.BiomeManagers public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh; public override string BestiaryIcon => "CalamityMod/BiomeManagers/AbyssIcon"; public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer1"; + public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer1"; public override int Music { diff --git a/BiomeManagers/AbyssLayer2Biome.cs b/BiomeManagers/AbyssLayer2Biome.cs index e351d8c7f6..2b9ca90238 100644 --- a/BiomeManagers/AbyssLayer2Biome.cs +++ b/BiomeManagers/AbyssLayer2Biome.cs @@ -21,6 +21,7 @@ namespace CalamityMod.BiomeManagers public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh; public override string BestiaryIcon => "CalamityMod/BiomeManagers/AbyssIcon"; public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer23"; + public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer23"; public override void SetStaticDefaults() { diff --git a/BiomeManagers/AbyssLayer3Biome.cs b/BiomeManagers/AbyssLayer3Biome.cs index a47d3b5499..cbd29d5c81 100644 --- a/BiomeManagers/AbyssLayer3Biome.cs +++ b/BiomeManagers/AbyssLayer3Biome.cs @@ -21,6 +21,7 @@ namespace CalamityMod.BiomeManagers public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh; public override string BestiaryIcon => "CalamityMod/BiomeManagers/AbyssIcon"; public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer23"; + public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer23"; public override void SetStaticDefaults() { diff --git a/BiomeManagers/AbyssLayer4Biome.cs b/BiomeManagers/AbyssLayer4Biome.cs index fee96360a5..9368527844 100644 --- a/BiomeManagers/AbyssLayer4Biome.cs +++ b/BiomeManagers/AbyssLayer4Biome.cs @@ -21,6 +21,7 @@ namespace CalamityMod.BiomeManagers public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh; public override string BestiaryIcon => "CalamityMod/BiomeManagers/AbyssIcon"; public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer4"; + public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer4"; public override void SetStaticDefaults() { diff --git a/BiomeManagers/SulphurousSeaBiome.cs b/BiomeManagers/SulphurousSeaBiome.cs index 9a568e7102..92203cccf9 100644 --- a/BiomeManagers/SulphurousSeaBiome.cs +++ b/BiomeManagers/SulphurousSeaBiome.cs @@ -16,6 +16,7 @@ namespace CalamityMod.BiomeManagers public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh; public override string BestiaryIcon => "CalamityMod/BiomeManagers/SulphurousSeaIcon"; public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/SulphurBG"; + public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/SulphurBG"; public override int Music { diff --git a/BiomeManagers/SunkenSeaBiome.cs b/BiomeManagers/SunkenSeaBiome.cs index 485551010f..86dfd70fce 100644 --- a/BiomeManagers/SunkenSeaBiome.cs +++ b/BiomeManagers/SunkenSeaBiome.cs @@ -13,6 +13,7 @@ namespace CalamityMod.BiomeManagers public override string BestiaryIcon => "CalamityMod/BiomeManagers/SunkenSeaIcon"; // Placeholder until we get a dedicated Sunken Sea background public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer1"; + public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer1"; public override void SetStaticDefaults() { diff --git a/BiomeManagers/UndergroundAstralBiome.cs b/BiomeManagers/UndergroundAstralBiome.cs index 4dc46faa7d..c4165903d9 100644 --- a/BiomeManagers/UndergroundAstralBiome.cs +++ b/BiomeManagers/UndergroundAstralBiome.cs @@ -13,6 +13,7 @@ namespace CalamityMod.BiomeManagers public override string BestiaryIcon => "CalamityMod/BiomeManagers/UndergroundAstralIcon"; // Could use its own unique background public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG"; + public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG"; public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("AstralUnderground") ?? MusicID.Space; @@ -26,6 +27,11 @@ namespace CalamityMod.BiomeManagers return !player.ZoneDungeon && BiomeTileCounterSystem.AstralTiles > 950 && (player.ZoneDirtLayerHeight || player.ZoneRockLayerHeight || player.ZoneUnderworldHeight); } + public override void SpecialVisuals(Player player, bool isActive) + { + player.ManageSpecialBiomeVisuals("CalamityMod:Astral", isActive); + } + // Just slightly above the above-ground astral biomes. public override float GetWeight(Player player) => 0.51f; } diff --git a/Buffs/DamageOverTime/Dragonfire.png b/Buffs/DamageOverTime/Dragonfire.png index 59b09dcb89..0c84e72313 100644 Binary files a/Buffs/DamageOverTime/Dragonfire.png and b/Buffs/DamageOverTime/Dragonfire.png differ diff --git a/Buffs/Potions/BaguetteBuff.png b/Buffs/Potions/BaguetteBuff.png index e714108f42..431545d803 100644 Binary files a/Buffs/Potions/BaguetteBuff.png and b/Buffs/Potions/BaguetteBuff.png differ diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index f0c9928b56..33f737eaf4 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -33,6 +33,7 @@ using CalamityMod.Items.Mounts; using CalamityMod.Items.Mounts.Minecarts; using CalamityMod.Items.TreasureBags.MiscGrabBags; using CalamityMod.Items.VanillaArmorChanges; +using CalamityMod.Items.Weapons.DraedonsArsenal; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Rogue; @@ -250,6 +251,7 @@ namespace CalamityMod.CalPlayer public static readonly SoundStyle RogueStealthSound = new("CalamityMod/Sounds/Custom/RogueStealth"); public static readonly SoundStyle DefenseDamageSound = new("CalamityMod/Sounds/Custom/DefenseDamage"); + public static readonly SoundStyle IjiDeathSound = new("CalamityMod/Sounds/Custom/IjiDies"); #endregion #region Proficiency @@ -608,6 +610,8 @@ namespace CalamityMod.CalPlayer public bool silverMedkit = false; public int silverMedkitTimer = 0; public bool goldArmorGoldDrops = false; + public bool miningSet = false; + public int miningSetCooldown = 0; public bool desertProwler = false; public bool snowRuffianSet = false; public bool forbiddenCirclet = false; @@ -1102,6 +1106,8 @@ namespace CalamityMod.CalPlayer public FluidField ProfanedMoonlightAuroraDrawer; public Vector2 FireDrawerPosition; + + public int monolithAccursedShader = 0; #endregion Draw Effects #region Draedon Summoning @@ -1735,6 +1741,9 @@ namespace CalamityMod.CalPlayer silverMedkit = false; goldArmorGoldDrops = false; + miningSet = false; + miningSetCooldown = 0; + eskimoSet = false; //vanilla armor meteorSet = false; //vanilla armor, for Space Gun nerf @@ -2357,6 +2366,8 @@ namespace CalamityMod.CalPlayer silverMedkit = false; silverMedkitTimer = 0; goldArmorGoldDrops = false; + miningSet = false; + miningSetCooldown = 0; flamethrowerBoost = false; hoverboardBoost = false; //hoverboard + shroomite visage shadowSpeed = false; @@ -4373,12 +4384,6 @@ namespace CalamityMod.CalPlayer int defenseAdd = (int)(target.defense * 0.5); damage += defenseAdd; } - if (item.CountsAsClass() && badgeOfBravery) - { - int penetratableDefense = (int)Math.Max(target.defense - Player.GetArmorPenetration(), 0); - int penetratedDefense = Math.Min(penetratableDefense, 5); - damage += (int)(0.5f * penetratedDefense); - } #endregion if ((target.damage > 0 || target.boss) && !target.SpawnedFromStatue && Player.whoAmI == Main.myPlayer) @@ -4498,23 +4503,6 @@ namespace CalamityMod.CalPlayer } } } - - int penetrateAmt = 0; - if (proj.Calamity().stealthStrike && proj.CountsAsClass()) - { - // Nanotech is a total of 20 as it has all three bools - if (nanotech) - penetrateAmt += 10; - if (filthyGlove || bloodyGlove) - penetrateAmt += 10; - } - if (proj.CountsAsClass() && badgeOfBravery) - { - penetrateAmt += 5; - } - int penetratableDefense = (int)Math.Max(target.defense - Player.GetArmorPenetration(), 0); //if find how much defense we can penetrate - int penetratedDefense = Math.Min(penetratableDefense, penetrateAmt); //if we have more penetrate than enemy defense, use enemy defense - damage += (int)(0.5f * penetratedDefense); #endregion #region MultiplicativeReductions @@ -5400,7 +5388,7 @@ namespace CalamityMod.CalPlayer } } #endregion - + #region Shoot public override bool Shoot(Item item, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockBack) { @@ -8101,5 +8089,16 @@ namespace CalamityMod.CalPlayer CombatText.NewText(location, messageColor, Language.GetTextValue(text)); } #endregion + + #region Kill + public override void Kill(double damage, int hitDirection, bool pvp, PlayerDeathReason damageSource) + { + if (Player.whoAmI == Main.myPlayer && Player.ActiveItem().type == ModContent.ItemType()) + { + if (Main.rand.NextBool(20)) + SoundEngine.PlaySound(IjiDeathSound, Player.Center); + } + } + #endregion } } diff --git a/CalPlayer/CalamityPlayerFishing.cs b/CalPlayer/CalamityPlayerFishing.cs index dd3645bb85..3fb8c4749c 100644 --- a/CalPlayer/CalamityPlayerFishing.cs +++ b/CalPlayer/CalamityPlayerFishing.cs @@ -9,6 +9,8 @@ using CalamityMod.Items.Fishing.SunkenSeaCatches; using CalamityMod.Items.Placeables; using CalamityMod.Items.SummonItems; using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.NPCs; using CalamityMod.NPCs.OldDuke; using CalamityMod.World; diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index b6f9480777..3486e52654 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -107,7 +107,7 @@ namespace CalamityMod.CalPlayer OldPositions[0] = Player.position; // Hurt the nearest NPC to the mouse if using the burning mouse. - if (blazingCursorDamage) + if (blazingCursorDamage || blazingCursorVisuals) HandleBlazingMouseEffects(); // Revengeance effects @@ -505,6 +505,10 @@ namespace CalamityMod.CalPlayer // The sigil's brightness slowly fades away every frame if not incinerating anything. blazingMouseAuraFade = MathHelper.Clamp(blazingMouseAuraFade - 0.025f, 0.25f, 1f); + // Allows the blazing aura to display if the accessory is vanity, but it deals no damage + if (!blazingCursorDamage) + return; + // miscCounter is used to limit Calamity's hit rate. int framesPerHit = 60 / Calamity.HitsPerSecond; if (Player.miscCounter % framesPerHit != 1) @@ -516,7 +520,7 @@ namespace CalamityMod.CalPlayer for (int i = 0; i < Main.maxNPCs; i++) { NPC target = Main.npc[i]; - if (!target.active || !target.Hitbox.Intersects(sigilHitbox) || target.immortal || target.dontTakeDamage || target.townNPC) + if (!target.active || !target.Hitbox.Intersects(sigilHitbox) || target.immortal || target.dontTakeDamage || target.townNPC || NPCID.Sets.ActsLikeTownNPC[target.type] || NPCID.Sets.CountsAsCritter[target.type]) continue; // Brighten the sigil because it is dealing damage. This can only happen once per hit event. @@ -1227,6 +1231,10 @@ namespace CalamityMod.CalPlayer adamantiteSetDefenseBoostInterpolant = 0f; if (ChlorophyteHealDelay > 0) ChlorophyteHealDelay--; + if (monolithAccursedShader > 0) + monolithAccursedShader--; + if (miningSetCooldown > 0) + miningSetCooldown--; // God Slayer Armor dash debuff immunity if (DashID == GodSlayerDash.ID && Player.dashDelay < 0) @@ -3976,8 +3984,6 @@ namespace CalamityMod.CalPlayer CalamityUtils.ConsumeItemViaQuickBuff(Player, item, HadalStew.BuffType, HadalStew.BuffDuration, true); if (item.type == ModContent.ItemType()) CalamityUtils.ConsumeItemViaQuickBuff(Player, item, Margarita.BuffType, Margarita.BuffDuration, false); - if (item.type == ModContent.ItemType()) - CalamityUtils.ConsumeItemViaQuickBuff(Player, item, Bloodfin.BuffType, Bloodfin.BuffDuration, false); } } } diff --git a/CalamityMod.cs b/CalamityMod.cs index b1898362e9..d88137b105 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -281,6 +281,9 @@ namespace CalamityMod Filters.Scene["CalamityMod:ExoMechs"] = new Filter(new ExoMechsScreenShaderData("FilterMiniTower").UseColor(ExoMechsSky.DrawColor).UseOpacity(0.25f), EffectPriority.VeryHigh); SkyManager.Instance["CalamityMod:ExoMechs"] = new ExoMechsSky(); + Filters.Scene["CalamityMod:MonolithAccursed"] = new Filter(new MonolithScreenShaderData("FilterMiniTower").UseColor(1.1f, 0.3f, 0.3f).UseOpacity(0.65f), EffectPriority.VeryHigh); + SkyManager.Instance["CalamityMod:MonolithAccursed"] = new MonolithSky(); + SkyManager.Instance["CalamityMod:Astral"] = new AstralSky(); SkyManager.Instance["CalamityMod:Cryogen"] = new CryogenSky(); SkyManager.Instance["CalamityMod:StormWeaverFlash"] = new StormWeaverFlashSky(); diff --git a/Gores/Wulfrum/WulfrumPylonGore.png b/Gores/Wulfrum/WulfrumAmplifierGore.png similarity index 100% rename from Gores/Wulfrum/WulfrumPylonGore.png rename to Gores/Wulfrum/WulfrumAmplifierGore.png diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index 42d9223c71..49ca364754 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -546,7 +546,7 @@ namespace CalamityMod.ILEditing Vector2 desaturatedDrawPosition = drawPosition + Vector2.One; // If the blazing mouse is actually going to do damage, draw an indicator aura. - if (Main.LocalPlayer.Calamity().blazingCursorDamage && !Main.mapFullscreen) + if (!Main.mapFullscreen) { int size = 450; FluidFieldManager.AdjustSizeRelativeToGraphicsQuality(ref size); @@ -1035,6 +1035,7 @@ namespace CalamityMod.ILEditing { mp.hookCache = self.grappling[0]; self.grappling[0] = -1; + self.grapCount = 0; } } @@ -1051,6 +1052,7 @@ namespace CalamityMod.ILEditing { mp.hookCache = self.grappling[0]; self.grappling[0] = -1; + self.grapCount = 0; } } @@ -1063,7 +1065,10 @@ namespace CalamityMod.ILEditing WulfrumPackPlayer mp = self.GetModPlayer(); if (mp.hookCache > -1) + { self.grappling[0] = mp.hookCache; + self.grapCount = 1; + } mp.hookCache = -1; } diff --git a/Items/Accessories/Abaddon.cs b/Items/Accessories/Abaddon.cs index e905fc8cba..f14059a7a0 100644 --- a/Items/Accessories/Abaddon.cs +++ b/Items/Accessories/Abaddon.cs @@ -34,14 +34,7 @@ namespace CalamityMod.Items.Accessories public override void AddRecipes() { CreateRecipe(). - AddIngredient(ItemID.GoldCrown). - AddIngredient(5). - AddIngredient(10). - AddTile(TileID.MythrilAnvil). - Register(); - - CreateRecipe(). - AddIngredient(ItemID.PlatinumCrown). + AddRecipeGroup("AnyGoldCrown"). AddIngredient(5). AddIngredient(10). AddTile(TileID.MythrilAnvil). diff --git a/Items/Accessories/BadgeofBravery.cs b/Items/Accessories/BadgeofBravery.cs index 42bf380016..b7dd011858 100644 --- a/Items/Accessories/BadgeofBravery.cs +++ b/Items/Accessories/BadgeofBravery.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Accessories DisplayName.SetDefault("Badge of Bravery"); Tooltip.SetDefault("15% increased melee speed\n" + "Increases melee damage and melee crit by 5%\n" + - "+5 armor penetration"); + "+5 melee armor penetration"); } public override void SetDefaults() @@ -32,6 +32,7 @@ namespace CalamityMod.Items.Accessories CalamityPlayer modPlayer = player.Calamity(); modPlayer.badgeOfBravery = true; player.GetAttackSpeed() += 0.15f; + player.GetArmorPenetration() += 5; } public override void AddRecipes() diff --git a/Items/Accessories/FungalClump.cs b/Items/Accessories/FungalClump.cs index 49330c0c67..fcef579a53 100644 --- a/Items/Accessories/FungalClump.cs +++ b/Items/Accessories/FungalClump.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Items.Accessories if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { var source = player.GetSource_Accessory(Item); - int damage = (int)player.GetTotalDamage().ApplyTo(FungalClumpDamage); + int damage = (int)player.GetBestClassDamage().ApplyTo(FungalClumpDamage); int p = Projectile.NewProjectile(source, player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), damage, 1f, player.whoAmI, 0f, 0f); if (Main.projectile.IndexInRange(p)) Main.projectile[p].originalDamage = FungalClumpDamage; diff --git a/Items/Accessories/RoverDrive.cs b/Items/Accessories/RoverDrive.cs index f12e0be802..c97d4a384b 100644 --- a/Items/Accessories/RoverDrive.cs +++ b/Items/Accessories/RoverDrive.cs @@ -48,13 +48,17 @@ namespace CalamityMod.Items.Accessories continue; RoverDrivePlayer modPlayer = Main.player[i].GetModPlayer(); - if (!modPlayer.VisibleShield || modPlayer.ProtectionMatrixDurability <= 0) + bool forcedVisibility = !modPlayer.ShieldVisibility.HasValue ? false : modPlayer.ShieldVisibility.Value; + + //Skip if not forced, if it has a value (aka false since if it was true forced visibility would be true + if (!forcedVisibility && (modPlayer.ShieldVisibility.HasValue || (modPlayer.ProtectionMatrixDurability <= 0))) continue; float scale = 0.15f + 0.03f * (0.5f + 0.5f * (float)Math.Sin(Main.GlobalTimeWrappedHourly * 0.5f + i * 0.2f)); if (playerFound == false) { + float shieldStrentgh = forcedVisibility ? 1f : (float)Math.Pow(Main.LocalPlayer.GetModPlayer().ProtectionMatrixDurability / (float)ProtectionMatrixDurabilityMax, 0.5f); float noiseScale = MathHelper.Lerp(0.4f, 0.8f, (float)Math.Sin(Main.GlobalTimeWrappedHourly * 0.3f) * 0.5f + 0.5f); Effect shieldEffect = Filters.Scene["RoverDriveShield"].GetShader().Shader; @@ -65,17 +69,58 @@ namespace CalamityMod.Items.Accessories //shieldEffect.Parameters["resolution"].SetValue(resolution); float baseShieldOpacity = 0.9f + 0.1f * (float)Math.Sin(Main.GlobalTimeWrappedHourly * 2f); - shieldEffect.Parameters["shieldOpacity"].SetValue(baseShieldOpacity * (0.5f + 0.5f * (float)Math.Pow(Main.LocalPlayer.GetModPlayer().ProtectionMatrixDurability / (float)ProtectionMatrixDurabilityMax, 0.5f))); + shieldEffect.Parameters["shieldOpacity"].SetValue(baseShieldOpacity * (0.5f + 0.5f * shieldStrentgh)); shieldEffect.Parameters["shieldEdgeBlendStrenght"].SetValue(4f); - Color blueTint = new Color(51, 102, 255); - Color cyanTint = new Color(71, 202, 255); - Color wulfGreen = new Color(194, 255, 67) * 0.8f; - Color edgeColor = CalamityUtils.MulticolorLerp(Main.GlobalTimeWrappedHourly * 0.2f, blueTint, cyanTint, wulfGreen); - shieldEffect.Parameters["shieldColor"].SetValue(blueTint.ToVector3()); + Color edgeColor; + Color shieldColor; + + if (Main.netMode != NetmodeID.SinglePlayer && Main.player[i].team != 0) + { + switch (Main.player[i].team) + { + case 1: //Red team + shieldColor = new Color(178, 24, 31); + edgeColor = CalamityUtils.MulticolorLerp(Main.GlobalTimeWrappedHourly * 0.2f, Color.Tomato, Color.Crimson, shieldColor); + break; + case 2: //Green team + shieldColor = new Color(194, 255, 67) * 0.7f; + edgeColor = CalamityUtils.MulticolorLerp(Main.GlobalTimeWrappedHourly * 0.2f, Color.Chartreuse, Color.YellowGreen, new Color(194, 255, 67)); + break; + case 3: //Blue team + shieldColor = new Color(64, 207, 200); + edgeColor = CalamityUtils.MulticolorLerp(Main.GlobalTimeWrappedHourly * 0.2f, Color.MediumSpringGreen, Color.DeepSkyBlue, new Color(64, 207, 200)); + break; + case 4: //Yellow team + shieldColor = new Color(176, 156, 45); + edgeColor = CalamityUtils.MulticolorLerp(Main.GlobalTimeWrappedHourly * 0.2f, Color.Gold, Color.Coral, Color.LightGoldenrodYellow); + break; + case 5: //Purple team + default: + shieldColor = new Color(173, 111, 221); + edgeColor = CalamityUtils.MulticolorLerp(Main.GlobalTimeWrappedHourly * 0.2f, Color.DeepPink, Color.MediumOrchid, Color.MediumPurple); + break; + } + + } + + else + { + Color blueTint = new Color(51, 102, 255); + Color cyanTint = new Color(71, 202, 255); + Color wulfGreen = new Color(194, 255, 67) * 0.8f; + edgeColor = CalamityUtils.MulticolorLerp(Main.GlobalTimeWrappedHourly * 0.2f, blueTint, cyanTint, wulfGreen); + shieldColor = blueTint; + } + + + + shieldEffect.Parameters["shieldColor"].SetValue(shieldColor.ToVector3()); shieldEffect.Parameters["shieldEdgeColor"].SetValue(edgeColor.ToVector3()); + + Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, shieldEffect, Main.GameViewMatrix.TransformationMatrix); @@ -137,12 +182,17 @@ namespace CalamityMod.Items.Accessories //modPlayer.roverDrive = true; modPlayer.RoverDriveOn = true; - modPlayer.VisibleShield = !hideVisual; + modPlayer.ShieldVisibility = hideVisual ? false : null; if (modPlayer.ProtectionMatrixDurability > 0) player.statDefense += ProtectionMatrixDefenseBoost; } + public override void UpdateVanity(Player player) + { + player.GetModPlayer().ShieldVisibility = true; + } + //Scrappable for 3-6 wulfrum scrap or a 20% chance to get an energy core public override void ExtractinatorUse(ref int resultType, ref int resultStack) { @@ -160,7 +210,7 @@ namespace CalamityMod.Items.Accessories public class RoverDrivePlayer : ModPlayer { public bool RoverDriveOn; - public bool VisibleShield; + public bool? ShieldVisibility; //Null for default, false for never, true for always public int ProtectionMatrixDurability = 0; public int ProtectionMatrixCharge = 0; @@ -174,7 +224,7 @@ namespace CalamityMod.Items.Accessories ProtectionMatrixDurability = 0; RoverDriveOn = false; - VisibleShield = false; + ShieldVisibility = false; } public override void PostHurt(bool pvp, bool quiet, double damage, int hitDirection, bool crit, int cooldownCounter) diff --git a/Items/Accessories/WulfrumAcrobaticsPack.cs b/Items/Accessories/WulfrumAcrobaticsPack.cs index 79739a2f68..96ac181043 100644 --- a/Items/Accessories/WulfrumAcrobaticsPack.cs +++ b/Items/Accessories/WulfrumAcrobaticsPack.cs @@ -201,7 +201,10 @@ namespace CalamityMod.Items.Accessories public override void PostUpdateRunSpeeds() { if (hookCache != -1) + { Player.grappling[0] = hookCache; + Player.grapCount = 1; + } hookCache = -1; } @@ -211,7 +214,11 @@ namespace CalamityMod.Items.Accessories //If the hook cache was set from -1 in the part before the player stepped up,reset it. //Should this be detoured before the PlayerLoaders PreUpdateMovement call? In case another mod uses hooks in this call and their modplayer gets called before this one? if (hookCache > -1) + { Player.grappling[0] = hookCache; + Player.grapCount = 1; + } + hookCache = -1; if (Grappled) @@ -504,6 +511,7 @@ namespace CalamityMod.Items.Accessories { hookCache = Player.grappling[0]; Player.grappling[0] = -1; + Player.grapCount = 0; } } } diff --git a/Items/Armor/Reaver/ReaverHeadExplore.cs b/Items/Armor/Reaver/ReaverHeadExplore.cs index aa7ecbd9f6..698bd47417 100644 --- a/Items/Armor/Reaver/ReaverHeadExplore.cs +++ b/Items/Armor/Reaver/ReaverHeadExplore.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Armor.Reaver { SacrificeTotal = 1; DisplayName.SetDefault("Reaver Headgear"); - Tooltip.SetDefault("10% increased pick speed and 20% increased block/wall placement speed\n" + + Tooltip.SetDefault("40% increased pick speed and block/wall placement speed\n" + "Temporary immunity to lava and can move freely through liquids"); } @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Armor.Reaver public override void UpdateArmorSet(Player player) { - player.setBonus = "Causes nearby treasure to sparkle\n" + + player.setBonus = "Highlights all treasure nearby\n" + "Increased item grab range and block placement range\n" + "Mining tiles restores breath while underwater\n" + "Summons a reaver orb to light up the area around you\n" + @@ -53,7 +53,8 @@ namespace CalamityMod.Items.Armor.Reaver var modPlayer = player.Calamity(); modPlayer.reaverExplore = true; modPlayer.wearingRogueArmor = true; - player.blockRange += 2; + player.findTreasure = true; + player.blockRange += 4; player.aggro -= 200; if (player.whoAmI == Main.myPlayer) @@ -68,47 +69,14 @@ namespace CalamityMod.Items.Armor.Reaver Projectile.NewProjectile(source, player.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, player.whoAmI); } } - if (player.miscCounter % 10 == 0) - { - var searchDist = 17; - var x = (int)player.Center.X / 16; - var y = (int)player.Center.Y / 16; - for (var i = x - searchDist; i <= x + searchDist; ++i) - { - for (var j = y - searchDist; j <= y + searchDist; ++j) - { - if (Main.rand.NextBool(4) && new Vector2(x - i, y - j).Length() < searchDist && i > 0 && i < Main.maxTilesX - 1 && j > 0 && j < Main.maxTilesY - 1 && Main.tile[i, j] != null && Main.tile[i, j].HasTile) - { - var shouldSparkle = false; - //Check for the money piles - if (Main.tile[i, j].TileType == TileID.SmallPiles && Main.tile[i, j].TileFrameY == 18) - { - if (Main.tile[i, j].TileFrameX >= 576 && Main.tile[i, j].TileFrameX <= 882) - shouldSparkle = true; - } - else if (Main.tile[i, j].TileType == TileID.LargePiles && Main.tile[i, j].TileFrameX >= 864 && Main.tile[i, j].TileFrameX <= 1170) - shouldSparkle = true; - - if (shouldSparkle || Main.tileSpelunker[Main.tile[i, j].TileType] || Main.tileAlch[Main.tile[i, j].TileType] && Main.tile[i, j].TileType != TileID.ImmatureHerbs) - { - var sparkle = Dust.NewDust(new Vector2(i * 16, j * 16), 16, 16, 204, 0f, 0f, 150, new Color(), 0.3f); - var dust = Main.dust[sparkle]; - dust.fadeIn = 0.75f; - dust.velocity = dust.velocity * 0.1f; - dust.noLight = true; - } - } - } - } - } } public override void UpdateEquip(Player player) { player.ignoreWater = true; - player.pickSpeed -= 0.1f; - player.tileSpeed += 0.2f; - player.wallSpeed += 0.2f; + player.pickSpeed -= 0.4f; + player.tileSpeed += 0.4f; + player.wallSpeed += 0.4f; player.lavaMax += 420; } diff --git a/Items/Armor/Wulfrum/WulfrumFusionCannon.cs b/Items/Armor/Wulfrum/WulfrumFusionCannon.cs index cd154f1bec..e604fe89af 100644 --- a/Items/Armor/Wulfrum/WulfrumFusionCannon.cs +++ b/Items/Armor/Wulfrum/WulfrumFusionCannon.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Armor.Wulfrum public override void SetStaticDefaults() { DisplayName.SetDefault("Experimental Wulfrum Fusion Array"); - Tooltip.SetDefault("Fires quick bursts of medium-range pellets\n" + + Tooltip.SetDefault("Fires quick bursts of medium-range pellets\n" + "Ignores 10 points of enemy Defense\n" + "[c/878787:\"Who needs whips when you can simply become the summon yourself?\"]"); //Imaging hiding actually important/interesting/funny lore in there... :drool: that would be so dark souls } diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 7135286549..68bd4b2933 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -180,6 +180,7 @@ namespace CalamityMod.Items case ItemID.MechanicalWheelPiece: case ItemID.MinecartMech: case ItemID.SporeSac: + case ItemID.WitchBroom: case ItemID.EmpressFlightBooster: case ItemID.ShinyStone: case ItemID.ShrimpyTruffle: @@ -1566,12 +1567,6 @@ namespace CalamityMod.Items player.endurance += 0.01f; } - - // TODO -- make all prefixes relevant. Details in Ozz's todo. - /* - if (item.prefix == PrefixID.Precise || item.prefix == PrefixID.Lucky) - player.armorPenetration += 1; - */ } #endregion @@ -1743,23 +1738,8 @@ namespace CalamityMod.Items #region On Create public override void OnCreate(Item item, ItemCreationContext context) { - // Crafting a rogue weapon has a 75% chance for a random modifier - // Negative modifiers have a 66.66% chance of being voided - // Note, the modifier doesn't show up in the craft text (the one that indicates you got a new item) - if (context is RecipeCreationContext) - { - if (item.CanGetRoguePrefix()) - { - if (Main.rand.Next(4) < 3) - { - int prefix = CalamityUtils.RandomRoguePrefix(); - if (!CalamityUtils.NegativeRoguePrefix(prefix) || Main.rand.NextBool(3)) - { - item.Prefix(prefix); - } - } - } - } + // ChoosePrefix also happens on craft so go reset it here too + storedPrefix = -1; } #endregion @@ -1778,6 +1758,15 @@ namespace CalamityMod.Items // removed data saved on items; reforging is now a coalescing flowchart that has no RNG public override int ChoosePrefix(Item item, UnifiedRandom rand) { + if (storedPrefix == -1 && item.CanGetRoguePrefix()) + { + // Crafting (or first reforge of) a rogue weapon has a 75% chance for a random modifier, this check is done by vanilla + // Negative modifiers have a 66.66% chance of being voided, Annoying modifier is intentionally ignored by vanilla + int prefix = CalamityUtils.RandomRoguePrefix(); + bool keepPrefix = !CalamityUtils.NegativeRoguePrefix(prefix) || Main.rand.NextBool(3); + return keepPrefix ? prefix : 0; + } + if (!CalamityConfig.Instance.RemoveReforgeRNG || Main.gameMenu || storedPrefix == -1) return -1; diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index 8c7151e199..bdf7007167 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -485,7 +485,8 @@ namespace CalamityMod.Items // +1 to Abyss light level string abyssSmallLightLine = "\nProvides a small amount of light in the abyss"; - if (item.type == ItemID.CrimsonHeart || item.type == ItemID.ShadowOrb || item.type == ItemID.MagicLantern || item.type == ItemID.JellyfishNecklace || item.type == ItemID.MiningHelmet) + if (item.type == ItemID.CrimsonHeart || item.type == ItemID.ShadowOrb || item.type == ItemID.MagicLantern || item.type == ItemID.JellyfishNecklace || + item.type == ItemID.MiningHelmet || item.type == ItemID.UltrabrightHelmet) EditTooltipByNum(0, (line) => line.Text += abyssSmallLightLine); if (item.type == ItemID.JellyfishDivingGear) EditTooltipByNum(1, (line) => line.Text += abyssSmallLightLine); @@ -502,7 +503,7 @@ namespace CalamityMod.Items // +3 to Abyss light level string abyssLargeLightLine = "\nProvides a large amount of light in the abyss"; - if (item.type == ItemID.WispinaBottle) + if (item.type == ItemID.WispinaBottle || item.type == ItemID.PumpkingPetItem || item.type == ItemID.GolemPetItem || item.type == ItemID.FairyQueenPetItem) EditTooltipByNum(0, (line) => line.Text += abyssLargeLightLine); if (item.type == ItemID.SuspiciousLookingTentacle) EditTooltipByNum(1, (line) => line.Text += abyssLargeLightLine); @@ -840,7 +841,8 @@ namespace CalamityMod.Items if (item.type == ItemID.Picksaw) EditTooltipByNum(0, (line) => line.Text += "\nCan mine Scoria Ore located in the Abyss"); - if (item.type == ItemID.SolarFlarePickaxe || item.type == ItemID.VortexPickaxe || item.type == ItemID.NebulaPickaxe || item.type == ItemID.StardustPickaxe) + if (item.type == ItemID.SolarFlarePickaxe || item.type == ItemID.VortexPickaxe || item.type == ItemID.NebulaPickaxe || item.type == ItemID.StardustPickaxe + || item.type == ItemID.SolarFlareDrill || item.type == ItemID.VortexDrill || item.type == ItemID.NebulaDrill || item.type == ItemID.StardustDrill) EditTooltipByName("Knockback", (line) => line.Text += "\nCan mine Uelibloom Ore"); #endregion diff --git a/Items/Critters/BabyGhostBellItem.cs b/Items/Critters/BabyGhostBellItem.cs index 4d4ec92c1b..5fc03afa34 100644 --- a/Items/Critters/BabyGhostBellItem.cs +++ b/Items/Critters/BabyGhostBellItem.cs @@ -24,9 +24,9 @@ namespace CalamityMod.Items.Critters Item.consumable = true; Item.noUseGraphic = true; Item.value = Item.buyPrice(0, 0, 30, 0); - //item.CloneDefaults(2004); //Lightning Bug item Item.width = 26; Item.height = 24; + Item.bait = 20; Item.makeNPC = (short)ModContent.NPCType(); Item.rare = ItemRarityID.Green; } diff --git a/Items/Critters/RepairUnitItem.cs b/Items/Critters/RepairUnitItem.cs new file mode 100644 index 0000000000..02eb419b53 --- /dev/null +++ b/Items/Critters/RepairUnitItem.cs @@ -0,0 +1,34 @@ +using CalamityMod.NPCs.DraedonLabThings; +using CalamityMod.Rarities; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Critters +{ + public class RepairUnitItem : ModItem + { + public override void SetStaticDefaults() + { + SacrificeTotal = 5; + DisplayName.SetDefault("Repair Unit"); + } + + public override void SetDefaults() + { + Item.useStyle = ItemUseStyleID.Swing; + Item.autoReuse = true; + Item.useTurn = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.maxStack = 9999; + Item.consumable = true; + Item.noUseGraphic = true; + Item.value = Item.buyPrice(0, 0, 30, 0); + Item.width = 38; + Item.height = 24; + Item.makeNPC = (short)ModContent.NPCType(); + Item.rare = ModContent.RarityType(); + } + } +} diff --git a/Items/Critters/RepairUnitItem.png b/Items/Critters/RepairUnitItem.png new file mode 100644 index 0000000000..e91282c777 Binary files /dev/null and b/Items/Critters/RepairUnitItem.png differ diff --git a/Items/Critters/SeaMinnowItem.cs b/Items/Critters/SeaMinnowItem.cs index f3e8b9e63a..bca56b96b5 100644 --- a/Items/Critters/SeaMinnowItem.cs +++ b/Items/Critters/SeaMinnowItem.cs @@ -24,7 +24,6 @@ namespace CalamityMod.Items.Critters Item.consumable = true; Item.noUseGraphic = true; Item.value = Item.buyPrice(0, 0, 30, 0); - //item.CloneDefaults(2004); //Lightning Bug item Item.width = 26; Item.height = 24; Item.bait = 20; diff --git a/Items/Materials/AuricBar.cs b/Items/Materials/AuricBar.cs index 63e8a59bfc..80ebef063a 100644 --- a/Items/Materials/AuricBar.cs +++ b/Items/Materials/AuricBar.cs @@ -27,8 +27,8 @@ namespace CalamityMod.Items.Materials public override void SetDefaults() { Item.createTile = ModContent.TileType(); - Item.width = 50; - Item.height = 30; + Item.width = 62; + Item.height = 44; Item.maxStack = 999; Item.value = Item.sellPrice(gold: 60); Item.rare = ModContent.RarityType(); @@ -41,27 +41,27 @@ namespace CalamityMod.Items.Materials } public override void UseStyle(Player player, Rectangle heldItemFrame) { - player.itemLocation += new Vector2(-10f * player.direction, 10f * player.gravDir).RotatedBy(player.itemRotation); + player.itemLocation += new Vector2(-20f * player.direction, 15f * player.gravDir).RotatedBy(player.itemRotation); } public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frameI, Color drawColor, Color itemColor, Vector2 origin, float scale) { Texture2D texture = ModContent.Request("CalamityMod/Items/Materials/AuricBar_Animated").Value; - spriteBatch.Draw(texture, position, Item.GetCurrentFrame(ref frame, ref frameCounter, 5, 15), Color.White, 0f, origin, scale, SpriteEffects.None, 0); + spriteBatch.Draw(texture, position, Item.GetCurrentFrame(ref frame, ref frameCounter, 5, 12), Color.White, 0f, origin, scale, SpriteEffects.None, 0); return false; } public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) { Texture2D texture = ModContent.Request("CalamityMod/Items/Materials/AuricBar_Animated").Value; - spriteBatch.Draw(texture, Item.position - Main.screenPosition, Item.GetCurrentFrame(ref frame, ref frameCounter, 5, 15), lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); + spriteBatch.Draw(texture, Item.position - Main.screenPosition, Item.GetCurrentFrame(ref frame, ref frameCounter, 5, 12), lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); return false; } public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { Texture2D texture = ModContent.Request("CalamityMod/Items/Materials/AuricBarGlow").Value; - spriteBatch.Draw(texture, Item.position - Main.screenPosition, Item.GetCurrentFrame(ref frame, ref frameCounter, 5, 15, false), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); + spriteBatch.Draw(texture, Item.position - Main.screenPosition, Item.GetCurrentFrame(ref frame, ref frameCounter, 5, 12, false), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); } public override void Update(ref float gravity, ref float maxFallSpeed) diff --git a/Items/Materials/AuricBar.png b/Items/Materials/AuricBar.png index 2d3c447a88..b25eab570d 100644 Binary files a/Items/Materials/AuricBar.png and b/Items/Materials/AuricBar.png differ diff --git a/Items/Materials/AuricBarGlow.png b/Items/Materials/AuricBarGlow.png index 837248c74e..d80546d13a 100644 Binary files a/Items/Materials/AuricBarGlow.png and b/Items/Materials/AuricBarGlow.png differ diff --git a/Items/Materials/AuricBar_Animated.png b/Items/Materials/AuricBar_Animated.png index 38a8c159a1..3f6b3f271a 100644 Binary files a/Items/Materials/AuricBar_Animated.png and b/Items/Materials/AuricBar_Animated.png differ diff --git a/Items/Placeables/Banners/WulfrumPylonBanner.cs b/Items/Placeables/Banners/WulfrumAmplifierBanner.cs similarity index 88% rename from Items/Placeables/Banners/WulfrumPylonBanner.cs rename to Items/Placeables/Banners/WulfrumAmplifierBanner.cs index 93a31975e9..75e8bc424d 100644 --- a/Items/Placeables/Banners/WulfrumPylonBanner.cs +++ b/Items/Placeables/Banners/WulfrumAmplifierBanner.cs @@ -4,12 +4,13 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Banners { - public class WulfrumPylonBanner : ModItem + [LegacyName("WulfrumPylonBanner")] + public class WulfrumAmplifierBanner : ModItem { public override void SetStaticDefaults() { SacrificeTotal = 1; - Tooltip.SetDefault("{$CommonItemTooltip.BannerBonus}Wulfrum Pylon"); + Tooltip.SetDefault("{$CommonItemTooltip.BannerBonus}Wulfrum Amplifier"); } public override void SetDefaults() diff --git a/Items/Placeables/Banners/WulfrumPylonBanner.png b/Items/Placeables/Banners/WulfrumAmplifierBanner.png similarity index 100% rename from Items/Placeables/Banners/WulfrumPylonBanner.png rename to Items/Placeables/Banners/WulfrumAmplifierBanner.png diff --git a/Items/Placeables/Furniture/AltarOfTheAccursedItem.png b/Items/Placeables/Furniture/AltarOfTheAccursedItem.png deleted file mode 100644 index c4bb03cb8b..0000000000 Binary files a/Items/Placeables/Furniture/AltarOfTheAccursedItem.png and /dev/null differ diff --git a/Items/Placeables/Furniture/AltarOfTheAccursedItem.cs b/Items/Placeables/Furniture/CraftingStations/AltarOfTheAccursedItem.cs similarity index 65% rename from Items/Placeables/Furniture/AltarOfTheAccursedItem.cs rename to Items/Placeables/Furniture/CraftingStations/AltarOfTheAccursedItem.cs index f9467a4f2f..234703f2dd 100644 --- a/Items/Placeables/Furniture/AltarOfTheAccursedItem.cs +++ b/Items/Placeables/Furniture/CraftingStations/AltarOfTheAccursedItem.cs @@ -1,11 +1,10 @@ using CalamityMod.Items.Materials; using CalamityMod.Rarities; -using CalamityMod.Tiles.Furniture; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.Furniture +namespace CalamityMod.Items.Placeables.Furniture.CraftingStations { [LegacyName("SCalAltarItem")] public class AltarOfTheAccursedItem : ModItem @@ -17,7 +16,8 @@ namespace CalamityMod.Items.Placeables.Furniture Tooltip.SetDefault("Offer Ashes of Calamity at this altar to summon the Witch\n" + "Doing so will create a square arena of blocks, with the altar at its center\n" + "During the battle, heart pickups only heal for half as much\n" + - "The Witch enrages while you are outside of the arena"); + "The Witch enrages while you are outside of the arena\n" + + "Used for special crafting"); } public override void SetDefaults() @@ -28,16 +28,26 @@ namespace CalamityMod.Items.Placeables.Furniture Item.useTime = 10; Item.autoReuse = true; Item.consumable = true; - Item.width = 60; - Item.height = 48; - Item.maxStack = 999; + Item.width = 38; + Item.height = 32; + Item.maxStack = 9999; Item.useStyle = ItemUseStyleID.Swing; Item.rare = ModContent.RarityType(); } + public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) + { + itemGroup = ContentSamples.CreativeHelper.ItemGroup.CraftingObjects; + } + public override void AddRecipes() { - CreateRecipe(1).AddIngredient(ModContent.ItemType(), 30).AddIngredient(ModContent.ItemType(), 5).AddIngredient(ModContent.ItemType(), 1).AddTile(ModContent.TileType()).Register(); + CreateRecipe(1). + AddIngredient(ModContent.ItemType(), 30). + AddIngredient(ModContent.ItemType(), 5). + AddIngredient(ModContent.ItemType(), 1). + AddTile(ModContent.TileType()). + Register(); } } } diff --git a/Items/Placeables/Furniture/CraftingStations/AltarOfTheAccursedItem.png b/Items/Placeables/Furniture/CraftingStations/AltarOfTheAccursedItem.png new file mode 100644 index 0000000000..1948408b29 Binary files /dev/null and b/Items/Placeables/Furniture/CraftingStations/AltarOfTheAccursedItem.png differ diff --git a/Items/Placeables/FurnitureSacrilegious/EyeOfTheAccursedBanner.cs b/Items/Placeables/FurnitureSacrilegious/EyeOfTheAccursedBanner.cs new file mode 100644 index 0000000000..3032495ebe --- /dev/null +++ b/Items/Placeables/FurnitureSacrilegious/EyeOfTheAccursedBanner.cs @@ -0,0 +1,43 @@ +using CalamityMod.Rarities; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureSacrilegious; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureSacrilegious +{ + public class EyeOfTheAccursedBanner : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Eye of the Accursed Banner"); + SacrificeTotal = 1; + } + + public override void SetDefaults() + { + Item.width = 26; + Item.height = 36; + Item.maxStack = 9999; + Item.useTurn = true; + Item.autoReuse = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.useStyle = ItemUseStyleID.Swing; + Item.consumable = true; + Item.rare = ModContent.RarityType(); + Item.value = Item.buyPrice(0, 0, 10, 0); + Item.createTile = ModContent.TileType(); + } + + public override void AddRecipes() + { + CreateRecipe(1). + AddIngredient(ModContent.ItemType(), 3). + AddIngredient(ItemID.Silk, 5). + AddTile(ModContent.TileType()). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureSacrilegious/EyeOfTheAccursedBanner.png b/Items/Placeables/FurnitureSacrilegious/EyeOfTheAccursedBanner.png new file mode 100644 index 0000000000..12c80f260d Binary files /dev/null and b/Items/Placeables/FurnitureSacrilegious/EyeOfTheAccursedBanner.png differ diff --git a/Items/Placeables/FurnitureSacrilegious/LargeRitualCandle.cs b/Items/Placeables/FurnitureSacrilegious/LargeRitualCandle.cs new file mode 100644 index 0000000000..2fc4de6aee --- /dev/null +++ b/Items/Placeables/FurnitureSacrilegious/LargeRitualCandle.cs @@ -0,0 +1,59 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Rarities; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureSacrilegious; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureSacrilegious +{ + public class LargeRitualCandle : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Large Ritual Candle"); + Tooltip.SetDefault("Right click to place in a different style"); + SacrificeTotal = 1; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + } + + public override void SetDefaults() + { + Item.width = 24; + Item.height = 50; + Item.maxStack = 9999; + Item.useTurn = true; + Item.autoReuse = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.useStyle = ItemUseStyleID.Swing; + Item.consumable = true; + Item.createTile = ModContent.TileType(); + Item.rare = ModContent.RarityType(); + } + + public override bool AltFunctionUse(Player player) => true; + + public override bool CanUseItem(Player player) + { + if (player.altFunctionUse == ItemAlternativeFunctionID.ActivatedAndUsed) + { + Item.placeStyle = 1; + } + else + { + Item.placeStyle = 0; + } + return base.CanUseItem(player); + } + + public override void AddRecipes() + { + CreateRecipe(1). + AddIngredient(ModContent.ItemType(), 6). + AddIngredient(ModContent.ItemType()). + AddTile(ModContent.TileType()). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureSacrilegious/LargeRitualCandle.png b/Items/Placeables/FurnitureSacrilegious/LargeRitualCandle.png new file mode 100644 index 0000000000..8dd248c204 Binary files /dev/null and b/Items/Placeables/FurnitureSacrilegious/LargeRitualCandle.png differ diff --git a/Items/Placeables/FurnitureSacrilegious/MonolithOfTheAccursed.cs b/Items/Placeables/FurnitureSacrilegious/MonolithOfTheAccursed.cs new file mode 100644 index 0000000000..a8701618bd --- /dev/null +++ b/Items/Placeables/FurnitureSacrilegious/MonolithOfTheAccursed.cs @@ -0,0 +1,41 @@ +using CalamityMod.Rarities; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureSacrilegious; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureSacrilegious +{ + public class MonolithOfTheAccursed : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Monolith of the Accursed"); + Tooltip.SetDefault("Let the sky burn a blazing red\n" + + "The monolith has two different modes"); + SacrificeTotal = 1; + } + + public override void SetDefaults() + { + Item.width = 24; + Item.height = 28; + Item.maxStack = 9999; + Item.useTurn = true; + Item.autoReuse = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.useStyle = ItemUseStyleID.Swing; + Item.consumable = true; + Item.createTile = ModContent.TileType(); + Item.rare = ModContent.RarityType(); + } + + public override void AddRecipes() + { + CreateRecipe(1). + AddIngredient(ModContent.ItemType(), 15). + AddTile(ModContent.TileType()). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureSacrilegious/MonolithOfTheAccursed.png b/Items/Placeables/FurnitureSacrilegious/MonolithOfTheAccursed.png new file mode 100644 index 0000000000..df000f64de Binary files /dev/null and b/Items/Placeables/FurnitureSacrilegious/MonolithOfTheAccursed.png differ diff --git a/Items/Placeables/FurnitureSacrilegious/OccultBrickItem.cs b/Items/Placeables/FurnitureSacrilegious/OccultBrickItem.cs new file mode 100644 index 0000000000..4723c0ab11 --- /dev/null +++ b/Items/Placeables/FurnitureSacrilegious/OccultBrickItem.cs @@ -0,0 +1,51 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables.Walls; +using CalamityMod.Rarities; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureSacrilegious; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureSacrilegious +{ + public class OccultBrickItem : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Occult Brick"); + SacrificeTotal = 1; + } + + public override void SetDefaults() + { + Item.width = 16; + Item.height = 16; + Item.maxStack = 9999; + Item.useTurn = true; + Item.autoReuse = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.useStyle = ItemUseStyleID.Swing; + Item.consumable = true; + Item.createTile = ModContent.TileType(); + Item.rare = ModContent.RarityType(); + } + + public override void AddRecipes() + { + CreateRecipe(200). + AddRecipeGroup("AnyStoneBlock", 200). + AddIngredient(ModContent.ItemType()). + AddTile(ModContent.TileType()). + Register(); + + CreateRecipe(1). + AddIngredient(ModContent.ItemType(), 2). + Register(); + + CreateRecipe(1). + AddIngredient(ModContent.ItemType(), 4). + AddTile(TileID.WorkBenches). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureSacrilegious/OccultBrickItem.png b/Items/Placeables/FurnitureSacrilegious/OccultBrickItem.png new file mode 100644 index 0000000000..504d8fdbe2 Binary files /dev/null and b/Items/Placeables/FurnitureSacrilegious/OccultBrickItem.png differ diff --git a/Items/Placeables/FurnitureSacrilegious/OccultLegionnaireBanner.cs b/Items/Placeables/FurnitureSacrilegious/OccultLegionnaireBanner.cs new file mode 100644 index 0000000000..fed2da07ec --- /dev/null +++ b/Items/Placeables/FurnitureSacrilegious/OccultLegionnaireBanner.cs @@ -0,0 +1,43 @@ +using CalamityMod.Rarities; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureSacrilegious; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureSacrilegious +{ + public class OccultLegionnaireBanner : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Occult Legionnaire Banner"); + SacrificeTotal = 1; + } + + public override void SetDefaults() + { + Item.width = 26; + Item.height = 36; + Item.maxStack = 9999; + Item.useTurn = true; + Item.autoReuse = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.useStyle = ItemUseStyleID.Swing; + Item.consumable = true; + Item.rare = ModContent.RarityType(); + Item.value = Item.buyPrice(0, 0, 10, 0); + Item.createTile = ModContent.TileType(); + } + + public override void AddRecipes() + { + CreateRecipe(1). + AddIngredient(ModContent.ItemType(), 3). + AddIngredient(ItemID.Silk, 5). + AddTile(ModContent.TileType()). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureSacrilegious/OccultLegionnaireBanner.png b/Items/Placeables/FurnitureSacrilegious/OccultLegionnaireBanner.png new file mode 100644 index 0000000000..bfba3998ef Binary files /dev/null and b/Items/Placeables/FurnitureSacrilegious/OccultLegionnaireBanner.png differ diff --git a/Items/Placeables/FurnitureSacrilegious/OccultPlatformItem.cs b/Items/Placeables/FurnitureSacrilegious/OccultPlatformItem.cs new file mode 100644 index 0000000000..9484dffd1b --- /dev/null +++ b/Items/Placeables/FurnitureSacrilegious/OccultPlatformItem.cs @@ -0,0 +1,36 @@ +using CalamityMod.Rarities; +using CalamityMod.Tiles.FurnitureSacrilegious; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureSacrilegious +{ + public class OccultPlatformItem : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Occult Platform"); + SacrificeTotal = 200; + } + + public override void SetDefaults() + { + Item.width = 22; + Item.height = 18; + Item.maxStack = 9999; + Item.useTurn = true; + Item.autoReuse = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.useStyle = ItemUseStyleID.Swing; + Item.consumable = true; + Item.createTile = ModContent.TileType(); + Item.rare = ModContent.RarityType(); + } + + public override void AddRecipes() + { + CreateRecipe(2).AddIngredient(ModContent.ItemType()).Register(); + } + } +} diff --git a/Items/Placeables/FurnitureSacrilegious/OccultPlatformItem.png b/Items/Placeables/FurnitureSacrilegious/OccultPlatformItem.png new file mode 100644 index 0000000000..b1cc3cd2aa Binary files /dev/null and b/Items/Placeables/FurnitureSacrilegious/OccultPlatformItem.png differ diff --git a/Items/Placeables/FurnitureSacrilegious/RitualCandle.cs b/Items/Placeables/FurnitureSacrilegious/RitualCandle.cs new file mode 100644 index 0000000000..f87066e165 --- /dev/null +++ b/Items/Placeables/FurnitureSacrilegious/RitualCandle.cs @@ -0,0 +1,59 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Rarities; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureSacrilegious; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureSacrilegious +{ + public class RitualCandle : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ritual Candle"); + Tooltip.SetDefault("Right click to place in a different style"); + SacrificeTotal = 1; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; + } + + public override void SetDefaults() + { + Item.width = 22; + Item.height = 28; + Item.maxStack = 9999; + Item.useTurn = true; + Item.autoReuse = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.useStyle = ItemUseStyleID.Swing; + Item.consumable = true; + Item.createTile = ModContent.TileType(); + Item.rare = ModContent.RarityType(); + } + + public override bool AltFunctionUse(Player player) => true; + + public override bool CanUseItem(Player player) + { + if (player.altFunctionUse == ItemAlternativeFunctionID.ActivatedAndUsed) + { + Item.placeStyle = 1; + } + else + { + Item.placeStyle = 0; + } + return base.CanUseItem(player); + } + + public override void AddRecipes() + { + CreateRecipe(1). + AddIngredient(ModContent.ItemType(), 5). + AddIngredient(ModContent.ItemType()). + AddTile(ModContent.TileType()). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureSacrilegious/RitualCandle.png b/Items/Placeables/FurnitureSacrilegious/RitualCandle.png new file mode 100644 index 0000000000..9abbb5ace5 Binary files /dev/null and b/Items/Placeables/FurnitureSacrilegious/RitualCandle.png differ diff --git a/Items/Placeables/FurnitureSacrilegious/SacrilegiousBathtub.cs b/Items/Placeables/FurnitureSacrilegious/SacrilegiousBathtub.cs new file mode 100644 index 0000000000..7e319beea1 --- /dev/null +++ b/Items/Placeables/FurnitureSacrilegious/SacrilegiousBathtub.cs @@ -0,0 +1,39 @@ +using CalamityMod.Rarities; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureSacrilegious; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureSacrilegious +{ + public class SacrilegiousBathtub : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sacrilegious Bathtub"); + SacrificeTotal = 1; + } + + public override void SetDefaults() + { + Item.width = 38; + Item.height = 22; + Item.maxStack = 9999; + Item.useTurn = true; + Item.autoReuse = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.useStyle = ItemUseStyleID.Swing; + Item.consumable = true; + Item.createTile = ModContent.TileType(); + Item.rare = ModContent.RarityType(); + } + + public override void AddRecipes() + { + CreateRecipe(1). + AddIngredient(ModContent.ItemType(), 14). + AddTile(ModContent.TileType()). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureSacrilegious/SacrilegiousBathtub.png b/Items/Placeables/FurnitureSacrilegious/SacrilegiousBathtub.png new file mode 100644 index 0000000000..efad1bb149 Binary files /dev/null and b/Items/Placeables/FurnitureSacrilegious/SacrilegiousBathtub.png differ diff --git a/Items/Placeables/FurnitureSacrilegious/SacrilegiousBed.cs b/Items/Placeables/FurnitureSacrilegious/SacrilegiousBed.cs new file mode 100644 index 0000000000..0190b2464c --- /dev/null +++ b/Items/Placeables/FurnitureSacrilegious/SacrilegiousBed.cs @@ -0,0 +1,40 @@ +using CalamityMod.Rarities; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureSacrilegious; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureSacrilegious +{ + public class SacrilegiousBed : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sacrilegious Bed"); + SacrificeTotal = 1; + } + + public override void SetDefaults() + { + Item.width = 38; + Item.height = 18; + Item.maxStack = 9999; + Item.useTurn = true; + Item.autoReuse = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.useStyle = ItemUseStyleID.Swing; + Item.consumable = true; + Item.createTile = ModContent.TileType(); + Item.rare = ModContent.RarityType(); + } + + public override void AddRecipes() + { + CreateRecipe(1). + AddIngredient(ModContent.ItemType(), 15). + AddIngredient(ItemID.Silk, 5). + AddTile(ModContent.TileType()). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureSacrilegious/SacrilegiousBed.png b/Items/Placeables/FurnitureSacrilegious/SacrilegiousBed.png new file mode 100644 index 0000000000..41597cef8c Binary files /dev/null and b/Items/Placeables/FurnitureSacrilegious/SacrilegiousBed.png differ diff --git a/Items/Placeables/FurnitureSacrilegious/SacrilegiousBench.cs b/Items/Placeables/FurnitureSacrilegious/SacrilegiousBench.cs new file mode 100644 index 0000000000..e00b7b3b72 --- /dev/null +++ b/Items/Placeables/FurnitureSacrilegious/SacrilegiousBench.cs @@ -0,0 +1,40 @@ +using CalamityMod.Rarities; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureSacrilegious; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureSacrilegious +{ + public class SacrilegiousBench : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sacrilegious Bench"); + SacrificeTotal = 1; + } + + public override void SetDefaults() + { + Item.width = 42; + Item.height = 26; + Item.maxStack = 9999; + Item.useTurn = true; + Item.autoReuse = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.useStyle = ItemUseStyleID.Swing; + Item.consumable = true; + Item.createTile = ModContent.TileType(); + Item.rare = ModContent.RarityType(); + } + + public override void AddRecipes() + { + CreateRecipe(1). + AddIngredient(ModContent.ItemType(), 5). + AddIngredient(ItemID.Silk, 2). + AddTile(ModContent.TileType()). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureSacrilegious/SacrilegiousBench.png b/Items/Placeables/FurnitureSacrilegious/SacrilegiousBench.png new file mode 100644 index 0000000000..ae9ab31f52 Binary files /dev/null and b/Items/Placeables/FurnitureSacrilegious/SacrilegiousBench.png differ diff --git a/Items/Placeables/FurnitureSacrilegious/SacrilegiousBookcase.cs b/Items/Placeables/FurnitureSacrilegious/SacrilegiousBookcase.cs new file mode 100644 index 0000000000..1504f3c73a --- /dev/null +++ b/Items/Placeables/FurnitureSacrilegious/SacrilegiousBookcase.cs @@ -0,0 +1,40 @@ +using CalamityMod.Rarities; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureSacrilegious; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureSacrilegious +{ + public class SacrilegiousBookcase : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sacrilegious Bookcase"); + SacrificeTotal = 1; + } + + public override void SetDefaults() + { + Item.width = 26; + Item.height = 36; + Item.maxStack = 9999; + Item.useTurn = true; + Item.autoReuse = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.useStyle = ItemUseStyleID.Swing; + Item.consumable = true; + Item.createTile = ModContent.TileType(); + Item.rare = ModContent.RarityType(); + } + + public override void AddRecipes() + { + CreateRecipe(1). + AddIngredient(ModContent.ItemType(), 20). + AddIngredient(ItemID.Book, 10). + AddTile(ModContent.TileType()). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureSacrilegious/SacrilegiousBookcase.png b/Items/Placeables/FurnitureSacrilegious/SacrilegiousBookcase.png new file mode 100644 index 0000000000..9c876b60bd Binary files /dev/null and b/Items/Placeables/FurnitureSacrilegious/SacrilegiousBookcase.png differ diff --git a/Items/Placeables/FurnitureSacrilegious/SacrilegiousCandelabra.cs b/Items/Placeables/FurnitureSacrilegious/SacrilegiousCandelabra.cs new file mode 100644 index 0000000000..d2802b61d0 --- /dev/null +++ b/Items/Placeables/FurnitureSacrilegious/SacrilegiousCandelabra.cs @@ -0,0 +1,41 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Rarities; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureSacrilegious; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureSacrilegious +{ + public class SacrilegiousCandelabra : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sacrilegious Candelabra"); + SacrificeTotal = 1; + } + + public override void SetDefaults() + { + Item.width = 32; + Item.height = 28; + Item.maxStack = 9999; + Item.useTurn = true; + Item.autoReuse = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.useStyle = ItemUseStyleID.Swing; + Item.consumable = true; + Item.createTile = ModContent.TileType(); + Item.rare = ModContent.RarityType(); + } + + public override void AddRecipes() + { + CreateRecipe(1). + AddIngredient(ModContent.ItemType(), 5). + AddIngredient(ModContent.ItemType(), 3). + AddTile(ModContent.TileType()). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureSacrilegious/SacrilegiousCandelabra.png b/Items/Placeables/FurnitureSacrilegious/SacrilegiousCandelabra.png new file mode 100644 index 0000000000..2fc69692f1 Binary files /dev/null and b/Items/Placeables/FurnitureSacrilegious/SacrilegiousCandelabra.png differ diff --git a/Items/Placeables/FurnitureSacrilegious/SacrilegiousCandle.cs b/Items/Placeables/FurnitureSacrilegious/SacrilegiousCandle.cs new file mode 100644 index 0000000000..8f2b813e39 --- /dev/null +++ b/Items/Placeables/FurnitureSacrilegious/SacrilegiousCandle.cs @@ -0,0 +1,41 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Rarities; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureSacrilegious; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureSacrilegious +{ + public class SacrilegiousCandle : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sacrilegious Candle"); + SacrificeTotal = 1; + } + + public override void SetDefaults() + { + Item.width = 16; + Item.height = 16; + Item.maxStack = 9999; + Item.useTurn = true; + Item.autoReuse = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.useStyle = ItemUseStyleID.Swing; + Item.consumable = true; + Item.createTile = ModContent.TileType(); + Item.rare = ModContent.RarityType(); + } + + public override void AddRecipes() + { + CreateRecipe(1). + AddIngredient(ModContent.ItemType(), 4). + AddIngredient(ModContent.ItemType()). + AddTile(ModContent.TileType()). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureSacrilegious/SacrilegiousCandle.png b/Items/Placeables/FurnitureSacrilegious/SacrilegiousCandle.png new file mode 100644 index 0000000000..5ba4801307 Binary files /dev/null and b/Items/Placeables/FurnitureSacrilegious/SacrilegiousCandle.png differ diff --git a/Items/Placeables/FurnitureSacrilegious/SacrilegiousChair.cs b/Items/Placeables/FurnitureSacrilegious/SacrilegiousChair.cs new file mode 100644 index 0000000000..b829e0f039 --- /dev/null +++ b/Items/Placeables/FurnitureSacrilegious/SacrilegiousChair.cs @@ -0,0 +1,39 @@ +using CalamityMod.Rarities; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureSacrilegious; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureSacrilegious +{ + public class SacrilegiousChair : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sacrilegious Chair"); + SacrificeTotal = 1; + } + + public override void SetDefaults() + { + Item.width = 16; + Item.height = 20; + Item.maxStack = 9999; + Item.useTurn = true; + Item.autoReuse = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.useStyle = ItemUseStyleID.Swing; + Item.consumable = true; + Item.createTile = ModContent.TileType(); + Item.rare = ModContent.RarityType(); + } + + public override void AddRecipes() + { + CreateRecipe(1). + AddIngredient(ModContent.ItemType(), 4). + AddTile(ModContent.TileType()). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureSacrilegious/SacrilegiousChair.png b/Items/Placeables/FurnitureSacrilegious/SacrilegiousChair.png new file mode 100644 index 0000000000..83328a4124 Binary files /dev/null and b/Items/Placeables/FurnitureSacrilegious/SacrilegiousChair.png differ diff --git a/Items/Placeables/FurnitureSacrilegious/SacrilegiousChandelier.cs b/Items/Placeables/FurnitureSacrilegious/SacrilegiousChandelier.cs new file mode 100644 index 0000000000..a16d406872 --- /dev/null +++ b/Items/Placeables/FurnitureSacrilegious/SacrilegiousChandelier.cs @@ -0,0 +1,42 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Rarities; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureSacrilegious; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureSacrilegious +{ + public class SacrilegiousChandelier : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sacrilegious Chandelier"); + SacrificeTotal = 1; + } + + public override void SetDefaults() + { + Item.width = 40; + Item.height = 32; + Item.maxStack = 9999; + Item.useTurn = true; + Item.autoReuse = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.useStyle = ItemUseStyleID.Swing; + Item.consumable = true; + Item.createTile = ModContent.TileType(); + Item.rare = ModContent.RarityType(); + } + + public override void AddRecipes() + { + CreateRecipe(1). + AddIngredient(ModContent.ItemType(), 4). + AddIngredient(ModContent.ItemType(), 4). + AddIngredient(ItemID.Chain). + AddTile(ModContent.TileType()). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureSacrilegious/SacrilegiousChandelier.png b/Items/Placeables/FurnitureSacrilegious/SacrilegiousChandelier.png new file mode 100644 index 0000000000..58414098e5 Binary files /dev/null and b/Items/Placeables/FurnitureSacrilegious/SacrilegiousChandelier.png differ diff --git a/Items/Placeables/FurnitureSacrilegious/SacrilegiousChest.cs b/Items/Placeables/FurnitureSacrilegious/SacrilegiousChest.cs new file mode 100644 index 0000000000..74b410833e --- /dev/null +++ b/Items/Placeables/FurnitureSacrilegious/SacrilegiousChest.cs @@ -0,0 +1,40 @@ +using CalamityMod.Rarities; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureSacrilegious; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureSacrilegious +{ + public class SacrilegiousChest : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sacrilegious Chest"); + SacrificeTotal = 1; + } + + public override void SetDefaults() + { + Item.width = 32; + Item.height = 32; + Item.maxStack = 9999; + Item.useTurn = true; + Item.autoReuse = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.useStyle = ItemUseStyleID.Swing; + Item.consumable = true; + Item.createTile = ModContent.TileType(); + Item.rare = ModContent.RarityType(); + } + + public override void AddRecipes() + { + CreateRecipe(1). + AddIngredient(ModContent.ItemType(), 8). + AddRecipeGroup("IronBar", 2). + AddTile(ModContent.TileType()). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureSacrilegious/SacrilegiousChest.png b/Items/Placeables/FurnitureSacrilegious/SacrilegiousChest.png new file mode 100644 index 0000000000..baae2fcf2e Binary files /dev/null and b/Items/Placeables/FurnitureSacrilegious/SacrilegiousChest.png differ diff --git a/Items/Placeables/FurnitureSacrilegious/SacrilegiousClock.cs b/Items/Placeables/FurnitureSacrilegious/SacrilegiousClock.cs new file mode 100644 index 0000000000..d0faa0e54d --- /dev/null +++ b/Items/Placeables/FurnitureSacrilegious/SacrilegiousClock.cs @@ -0,0 +1,41 @@ +using CalamityMod.Rarities; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureSacrilegious; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureSacrilegious +{ + public class SacrilegiousClock : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sacrilegious Clock"); + SacrificeTotal = 1; + } + + public override void SetDefaults() + { + Item.width = 20; + Item.height = 34; + Item.maxStack = 9999; + Item.useTurn = true; + Item.autoReuse = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.useStyle = ItemUseStyleID.Swing; + Item.consumable = true; + Item.createTile = ModContent.TileType(); + Item.rare = ModContent.RarityType(); + } + + public override void AddRecipes() + { + CreateRecipe(1). + AddRecipeGroup("IronBar", 3). + AddIngredient(ItemID.Glass, 6). + AddIngredient(ModContent.ItemType(), 10). + AddTile(ModContent.TileType()). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureSacrilegious/SacrilegiousClock.png b/Items/Placeables/FurnitureSacrilegious/SacrilegiousClock.png new file mode 100644 index 0000000000..43807523e0 Binary files /dev/null and b/Items/Placeables/FurnitureSacrilegious/SacrilegiousClock.png differ diff --git a/Items/Placeables/FurnitureSacrilegious/SacrilegiousDoor.cs b/Items/Placeables/FurnitureSacrilegious/SacrilegiousDoor.cs new file mode 100644 index 0000000000..c77294848a --- /dev/null +++ b/Items/Placeables/FurnitureSacrilegious/SacrilegiousDoor.cs @@ -0,0 +1,39 @@ +using CalamityMod.Rarities; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureSacrilegious; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureSacrilegious +{ + public class SacrilegiousDoor : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sacrilegious Door"); + SacrificeTotal = 1; + } + + public override void SetDefaults() + { + Item.width = 22; + Item.height = 32; + Item.maxStack = 9999; + Item.useTurn = true; + Item.autoReuse = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.useStyle = ItemUseStyleID.Swing; + Item.consumable = true; + Item.createTile = ModContent.TileType(); + Item.rare = ModContent.RarityType(); + } + + public override void AddRecipes() + { + CreateRecipe(1). + AddIngredient(ModContent.ItemType(), 8). + AddTile(ModContent.TileType()). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureSacrilegious/SacrilegiousDoor.png b/Items/Placeables/FurnitureSacrilegious/SacrilegiousDoor.png new file mode 100644 index 0000000000..79b3abff27 Binary files /dev/null and b/Items/Placeables/FurnitureSacrilegious/SacrilegiousDoor.png differ diff --git a/Items/Placeables/FurnitureSacrilegious/SacrilegiousDresser.cs b/Items/Placeables/FurnitureSacrilegious/SacrilegiousDresser.cs new file mode 100644 index 0000000000..70b917a7a8 --- /dev/null +++ b/Items/Placeables/FurnitureSacrilegious/SacrilegiousDresser.cs @@ -0,0 +1,39 @@ +using CalamityMod.Rarities; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureSacrilegious; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureSacrilegious +{ + public class SacrilegiousDresser : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sacrilegious Dresser"); + SacrificeTotal = 1; + } + + public override void SetDefaults() + { + Item.width = 32; + Item.height = 24; + Item.maxStack = 9999; + Item.useTurn = true; + Item.autoReuse = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.useStyle = ItemUseStyleID.Swing; + Item.consumable = true; + Item.createTile = ModContent.TileType(); + Item.rare = ModContent.RarityType(); + } + + public override void AddRecipes() + { + CreateRecipe(1). + AddIngredient(ModContent.ItemType(), 16). + AddTile(ModContent.TileType()). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureSacrilegious/SacrilegiousDresser.png b/Items/Placeables/FurnitureSacrilegious/SacrilegiousDresser.png new file mode 100644 index 0000000000..c892ea613e Binary files /dev/null and b/Items/Placeables/FurnitureSacrilegious/SacrilegiousDresser.png differ diff --git a/Items/Placeables/FurnitureSacrilegious/SacrilegiousLamp.cs b/Items/Placeables/FurnitureSacrilegious/SacrilegiousLamp.cs new file mode 100644 index 0000000000..92818c4a4d --- /dev/null +++ b/Items/Placeables/FurnitureSacrilegious/SacrilegiousLamp.cs @@ -0,0 +1,41 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Rarities; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureSacrilegious; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureSacrilegious +{ + public class SacrilegiousLamp : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sacrilegious Lamp"); + SacrificeTotal = 1; + } + + public override void SetDefaults() + { + Item.width = 16; + Item.height = 38; + Item.maxStack = 9999; + Item.useTurn = true; + Item.autoReuse = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.useStyle = ItemUseStyleID.Swing; + Item.consumable = true; + Item.createTile = ModContent.TileType(); + Item.rare = ModContent.RarityType(); + } + + public override void AddRecipes() + { + CreateRecipe(1). + AddIngredient(ModContent.ItemType(), 3). + AddIngredient(ModContent.ItemType()). + AddTile(ModContent.TileType()). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureSacrilegious/SacrilegiousLamp.png b/Items/Placeables/FurnitureSacrilegious/SacrilegiousLamp.png new file mode 100644 index 0000000000..7876628ef0 Binary files /dev/null and b/Items/Placeables/FurnitureSacrilegious/SacrilegiousLamp.png differ diff --git a/Items/Placeables/FurnitureSacrilegious/SacrilegiousLantern.cs b/Items/Placeables/FurnitureSacrilegious/SacrilegiousLantern.cs new file mode 100644 index 0000000000..245b63fdae --- /dev/null +++ b/Items/Placeables/FurnitureSacrilegious/SacrilegiousLantern.cs @@ -0,0 +1,41 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Rarities; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureSacrilegious; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureSacrilegious +{ + public class SacrilegiousLantern : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sacrilegious Lantern"); + SacrificeTotal = 1; + } + + public override void SetDefaults() + { + Item.width = 16; + Item.height = 30; + Item.maxStack = 9999; + Item.useTurn = true; + Item.autoReuse = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.useStyle = ItemUseStyleID.Swing; + Item.consumable = true; + Item.createTile = ModContent.TileType(); + Item.rare = ModContent.RarityType(); + } + + public override void AddRecipes() + { + CreateRecipe(1). + AddIngredient(ModContent.ItemType(), 6). + AddIngredient(ModContent.ItemType()). + AddTile(ModContent.TileType()). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureSacrilegious/SacrilegiousLantern.png b/Items/Placeables/FurnitureSacrilegious/SacrilegiousLantern.png new file mode 100644 index 0000000000..59ee6bea36 Binary files /dev/null and b/Items/Placeables/FurnitureSacrilegious/SacrilegiousLantern.png differ diff --git a/Items/Placeables/FurnitureSacrilegious/SacrilegiousOrgan.cs b/Items/Placeables/FurnitureSacrilegious/SacrilegiousOrgan.cs new file mode 100644 index 0000000000..f341d2ab3d --- /dev/null +++ b/Items/Placeables/FurnitureSacrilegious/SacrilegiousOrgan.cs @@ -0,0 +1,41 @@ +using CalamityMod.Rarities; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureSacrilegious; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureSacrilegious +{ + public class SacrilegiousOrgan : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sacrilegious Organ"); + SacrificeTotal = 1; + } + + public override void SetDefaults() + { + Item.width = 24; + Item.height = 34; + Item.maxStack = 9999; + Item.useTurn = true; + Item.autoReuse = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.useStyle = ItemUseStyleID.Swing; + Item.consumable = true; + Item.createTile = ModContent.TileType(); + Item.rare = ModContent.RarityType(); + } + + public override void AddRecipes() + { + CreateRecipe(1). + AddIngredient(ItemID.Bone, 4). + AddIngredient(ModContent.ItemType(), 15). + AddIngredient(ItemID.Book). + AddTile(ModContent.TileType()). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureSacrilegious/SacrilegiousOrgan.png b/Items/Placeables/FurnitureSacrilegious/SacrilegiousOrgan.png new file mode 100644 index 0000000000..2e1c5371da Binary files /dev/null and b/Items/Placeables/FurnitureSacrilegious/SacrilegiousOrgan.png differ diff --git a/Items/Placeables/FurnitureSacrilegious/SacrilegiousSink.cs b/Items/Placeables/FurnitureSacrilegious/SacrilegiousSink.cs new file mode 100644 index 0000000000..f0f22083d3 --- /dev/null +++ b/Items/Placeables/FurnitureSacrilegious/SacrilegiousSink.cs @@ -0,0 +1,43 @@ +using CalamityMod.Rarities; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureSacrilegious; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureSacrilegious +{ + public class SacrilegiousSink : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sacrilegious Sink"); + SacrificeTotal = 1; + Tooltip.SetDefault("Counts as a water, honey, and lava source"); + } + + public override void SetDefaults() + { + Item.width = 32; + Item.height = 32; + Item.maxStack = 9999; + Item.useTurn = true; + Item.autoReuse = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.useStyle = ItemUseStyleID.Swing; + Item.consumable = true; + Item.createTile = ModContent.TileType(); + Item.rare = ModContent.RarityType(); + } + + public override void AddRecipes() + { + CreateRecipe(1). + AddIngredient(ModContent.ItemType(), 6). + AddIngredient(ItemID.WaterBucket). + AddIngredient(ItemID.HoneyBucket). + AddIngredient(ItemID.LavaBucket). + AddTile(ModContent.TileType()). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureSacrilegious/SacrilegiousSink.png b/Items/Placeables/FurnitureSacrilegious/SacrilegiousSink.png new file mode 100644 index 0000000000..620a0b3071 Binary files /dev/null and b/Items/Placeables/FurnitureSacrilegious/SacrilegiousSink.png differ diff --git a/Items/Placeables/FurnitureSacrilegious/SacrilegiousTable.cs b/Items/Placeables/FurnitureSacrilegious/SacrilegiousTable.cs new file mode 100644 index 0000000000..29f89efbcc --- /dev/null +++ b/Items/Placeables/FurnitureSacrilegious/SacrilegiousTable.cs @@ -0,0 +1,39 @@ +using CalamityMod.Rarities; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureSacrilegious; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureSacrilegious +{ + public class SacrilegiousTable : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sacrilegious Table"); + SacrificeTotal = 1; + } + + public override void SetDefaults() + { + Item.width = 38; + Item.height = 26; + Item.maxStack = 9999; + Item.useTurn = true; + Item.autoReuse = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.useStyle = ItemUseStyleID.Swing; + Item.consumable = true; + Item.createTile = ModContent.TileType(); + Item.rare = ModContent.RarityType(); + } + + public override void AddRecipes() + { + CreateRecipe(1). + AddIngredient(ModContent.ItemType(), 8). + AddTile(ModContent.TileType()). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureSacrilegious/SacrilegiousTable.png b/Items/Placeables/FurnitureSacrilegious/SacrilegiousTable.png new file mode 100644 index 0000000000..c1544b286b Binary files /dev/null and b/Items/Placeables/FurnitureSacrilegious/SacrilegiousTable.png differ diff --git a/Items/Placeables/FurnitureSacrilegious/SacrilegiousWorkBench.cs b/Items/Placeables/FurnitureSacrilegious/SacrilegiousWorkBench.cs new file mode 100644 index 0000000000..17130c5d63 --- /dev/null +++ b/Items/Placeables/FurnitureSacrilegious/SacrilegiousWorkBench.cs @@ -0,0 +1,35 @@ +using CalamityMod.Rarities; +using CalamityMod.Tiles.FurnitureSacrilegious; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureSacrilegious +{ + public class SacrilegiousWorkBench : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sacrilegious Work Bench"); + SacrificeTotal = 1; + } + + public override void SetDefaults() + { + Item.width = 32; + Item.height = 16; + Item.maxStack = 9999; + Item.useTurn = true; + Item.autoReuse = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.useStyle = ItemUseStyleID.Swing; + Item.consumable = true; + Item.createTile = ModContent.TileType(); + Item.rare = ModContent.RarityType(); + } + + public override void AddRecipes() + { + CreateRecipe(1).AddIngredient(ModContent.ItemType(), 10).Register(); + } + } +} diff --git a/Items/Placeables/FurnitureSacrilegious/SacrilegiousWorkBench.png b/Items/Placeables/FurnitureSacrilegious/SacrilegiousWorkBench.png new file mode 100644 index 0000000000..f504652ac0 Binary files /dev/null and b/Items/Placeables/FurnitureSacrilegious/SacrilegiousWorkBench.png differ diff --git a/Items/Placeables/Walls/CosmiliteBrickWall.cs b/Items/Placeables/Walls/CosmiliteBrickWall.cs index cfff7ecaac..68a556ecd4 100644 --- a/Items/Placeables/Walls/CosmiliteBrickWall.cs +++ b/Items/Placeables/Walls/CosmiliteBrickWall.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Items.Placeables.Walls public override void SetDefaults() { - Item.width = 12; - Item.height = 12; + Item.width = 32; + Item.height = 32; Item.maxStack = 999; Item.useTurn = true; Item.autoReuse = true; diff --git a/Items/Placeables/Walls/CosmiliteBrickWall.png b/Items/Placeables/Walls/CosmiliteBrickWall.png index 37ea4bf2f7..387338878f 100644 Binary files a/Items/Placeables/Walls/CosmiliteBrickWall.png and b/Items/Placeables/Walls/CosmiliteBrickWall.png differ diff --git a/Items/Placeables/Walls/OccultBrickWallItem.cs b/Items/Placeables/Walls/OccultBrickWallItem.cs new file mode 100644 index 0000000000..81e61702ca --- /dev/null +++ b/Items/Placeables/Walls/OccultBrickWallItem.cs @@ -0,0 +1,40 @@ +using CalamityMod.Items.Placeables.FurnitureSacrilegious; +using CalamityMod.Rarities; +using CalamityMod.Walls; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Walls +{ + public class OccultBrickWallItem : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Occult Brick Wall"); + SacrificeTotal = 400; + } + + public override void SetDefaults() + { + Item.width = 18; + Item.height = 18; + Item.maxStack = 999; + Item.useTurn = true; + Item.autoReuse = true; + Item.useAnimation = 15; + Item.useTime = 7; + Item.useStyle = ItemUseStyleID.Swing; + Item.consumable = true; + Item.createWall = ModContent.WallType(); + Item.rare = ModContent.RarityType(); + } + + public override void AddRecipes() + { + CreateRecipe(4). + AddIngredient(ModContent.ItemType()). + AddTile(TileID.WorkBenches). + Register(); + } + } +} diff --git a/Items/Placeables/Walls/OccultBrickWallItem.png b/Items/Placeables/Walls/OccultBrickWallItem.png new file mode 100644 index 0000000000..fdc1340a06 Binary files /dev/null and b/Items/Placeables/Walls/OccultBrickWallItem.png differ diff --git a/Items/SummonItems/CeremonialUrn.cs b/Items/SummonItems/CeremonialUrn.cs index 1281f8401b..346c80f17c 100644 --- a/Items/SummonItems/CeremonialUrn.cs +++ b/Items/SummonItems/CeremonialUrn.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Items.SummonItems CreateRecipe(). AddIngredient(5). AddIngredient(15). - AddTile(). + AddTile(). Register(); } } diff --git a/Items/Tools/MarniteDeconstructor.cs b/Items/Tools/MarniteDeconstructor.cs index a54513e8ac..901b2ffa32 100644 --- a/Items/Tools/MarniteDeconstructor.cs +++ b/Items/Tools/MarniteDeconstructor.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Tools { SacrificeTotal = 1; DisplayName.SetDefault("Marnite Deconstructor"); - Tooltip.SetDefault("Its engine generates hardlight rays capable of excavating walls from a long distance"); + Tooltip.SetDefault("Its engine generates hardlight rays capable of excavating walls from a long distance\n" + "Ignores 10 points of enemy Defense"); } public override void SetDefaults() diff --git a/Items/Tools/MarniteObliterator.cs b/Items/Tools/MarniteObliterator.cs index 21ffdb2011..bdeb8e7aa6 100644 --- a/Items/Tools/MarniteObliterator.cs +++ b/Items/Tools/MarniteObliterator.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Tools { SacrificeTotal = 1; DisplayName.SetDefault("Marnite Obliterator"); - Tooltip.SetDefault("It uses its diamond focus to project a long-range digging beam of light"); + Tooltip.SetDefault("Uses a diamond focus to project a long-range digging beam of light\n" + "Ignores 5 points of enemy Defense"); } public override void SetDefaults() diff --git a/Items/TreasureBags/AquaticScourgeBag.cs b/Items/TreasureBags/AquaticScourgeBag.cs index 38b41076f7..a9a1b865a4 100644 --- a/Items/TreasureBags/AquaticScourgeBag.cs +++ b/Items/TreasureBags/AquaticScourgeBag.cs @@ -68,14 +68,14 @@ namespace CalamityMod.Items.TreasureBags ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType() + ModContent.ItemType() })); itemLoot.Add(ModContent.ItemType(), 10); // Equipment itemLoot.Add(ModContent.ItemType()); itemLoot.Add(ModContent.ItemType(), 10); + itemLoot.Add(ModContent.ItemType(), DropHelper.BagWeaponDropRateFraction); itemLoot.AddRevBagAccessories(); // Vanity diff --git a/Items/TreasureBags/OldDukeBag.cs b/Items/TreasureBags/OldDukeBag.cs index c20b3ad548..37e73160b0 100644 --- a/Items/TreasureBags/OldDukeBag.cs +++ b/Items/TreasureBags/OldDukeBag.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Items.TreasureBags itemLoot.Add(ModContent.ItemType(), 10); // Equipment - itemLoot.Add(ModContent.ItemType()); + itemLoot.Add(ModContent.ItemType(), DropHelper.BagWeaponDropRateFraction); itemLoot.Add(ModContent.ItemType()); itemLoot.AddRevBagAccessories(); diff --git a/Items/VanillaArmorChanges/MiningArmorSetChange.cs b/Items/VanillaArmorChanges/MiningArmorSetChange.cs new file mode 100644 index 0000000000..4d1cb47a71 --- /dev/null +++ b/Items/VanillaArmorChanges/MiningArmorSetChange.cs @@ -0,0 +1,36 @@ +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.VanillaArmorChanges +{ + public class MiningArmorSetChange : VanillaArmorChange + { + public override int? HeadPieceID => ItemID.MiningHelmet; + public override int[] AlternativeHeadPieceIDs => new int[] { ItemID.UltrabrightHelmet }; + + public override int? BodyPieceID => ItemID.MiningShirt; + + public override int? LegPieceID => ItemID.MiningPants; + + public override string ArmorSetName => "Mining"; + + public const float MiningSpeed = 0.4f; + public const int BonusOreChance = 4; + public const int CooldownMin = 180; + public const int CooldownMax = 360; + + public override void UpdateSetBonusText(ref string setBonusText) + { + setBonusText = setBonusText.Replace("30%", "40%"); + setBonusText += "\nMining ore will sometimes have additional yield"; + } + + public override void ApplyArmorSetBonus(Player player) + { + // Remove the vanilla +30% pick speed and add (subtract?) the new pick speed value at the same time + player.pickSpeed -= MiningSpeed + 0.3f; + player.Calamity().miningSet = true; + } + } +} diff --git a/Items/Weapons/DraedonsArsenal/FrequencyManipulator.cs b/Items/Weapons/DraedonsArsenal/FrequencyManipulator.cs index 155fb77dc8..4d4f266105 100644 --- a/Items/Weapons/DraedonsArsenal/FrequencyManipulator.cs +++ b/Items/Weapons/DraedonsArsenal/FrequencyManipulator.cs @@ -1,5 +1,6 @@ using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.DraedonsArsenal; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -12,7 +13,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.DraedonsArsenal { - public class FrequencyManipulator : ModItem + public class FrequencyManipulator : RogueWeapon { public override void SetStaticDefaults() { diff --git a/Items/Weapons/DraedonsArsenal/PlasmaGrenade.cs b/Items/Weapons/DraedonsArsenal/PlasmaGrenade.cs index 174780c28f..bd485e11da 100644 --- a/Items/Weapons/DraedonsArsenal/PlasmaGrenade.cs +++ b/Items/Weapons/DraedonsArsenal/PlasmaGrenade.cs @@ -1,5 +1,6 @@ using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.DraedonsArsenal; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; @@ -14,7 +15,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.DraedonsArsenal { - public class PlasmaGrenade : ModItem + public class PlasmaGrenade : RogueWeapon { public static readonly SoundStyle ExplosionSound = new("CalamityMod/Sounds/Item/PlasmaGrenadeExplosion"); diff --git a/Items/Weapons/DraedonsArsenal/SystemBane.cs b/Items/Weapons/DraedonsArsenal/SystemBane.cs index 2a1cc2758a..ac4955559c 100644 --- a/Items/Weapons/DraedonsArsenal/SystemBane.cs +++ b/Items/Weapons/DraedonsArsenal/SystemBane.cs @@ -1,5 +1,6 @@ using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.DraedonsArsenal; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -12,7 +13,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.DraedonsArsenal { - public class SystemBane : ModItem + public class SystemBane : RogueWeapon { public const int MaxDeployedProjectiles = 5; diff --git a/Items/Weapons/DraedonsArsenal/TeslaCannon.cs b/Items/Weapons/DraedonsArsenal/TeslaCannon.cs index 6b1acf602e..481107a939 100644 --- a/Items/Weapons/DraedonsArsenal/TeslaCannon.cs +++ b/Items/Weapons/DraedonsArsenal/TeslaCannon.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal { public class TeslaCannon : ModItem { - private int BaseDamage = 1050; + private int BaseDamage = 1360; public static readonly SoundStyle FireSound = new("CalamityMod/Sounds/Item/TeslaCannonFire"); diff --git a/Items/Weapons/DraedonsArsenal/TheAnomalysNanogun.cs b/Items/Weapons/DraedonsArsenal/TheAnomalysNanogun.cs new file mode 100644 index 0000000000..b2415c2fb7 --- /dev/null +++ b/Items/Weapons/DraedonsArsenal/TheAnomalysNanogun.cs @@ -0,0 +1,119 @@ +using Terraria.DataStructures; +using CalamityMod.Projectiles.Ranged; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.Audio; +using CalamityMod.Projectiles.DraedonsArsenal; +using System.Collections.Generic; +using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.CustomRecipes; +using System; +using CalamityMod.Rarities; + +namespace CalamityMod.Items.Weapons.DraedonsArsenal +{ + public class TheAnomalysNanogun : ModItem + { + public static readonly SoundStyle PlasmaChargeSFX = new("CalamityMod/Sounds/Item/AnomalysNanogunPlasmaCharge"); + public static readonly SoundStyle MPFBShotSFX = new("CalamityMod/Sounds/Item/AnomalysNanogunMPFBShot"); + public static readonly SoundStyle PlasmaShotSFX = new("CalamityMod/Sounds/Item/AnomalysNanogunPlasmaShot"); + public bool PlasmaChargeSelected = true; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("The Anomaly's Nanogun"); + Tooltip.SetDefault("'Welcome to the party, pal'\n" + + "Left click to charge up 5 rapid-fire plasma beams\n" + + "Right click to launch 3 fission bombs"); + SacrificeTotal = 1; + } + + public override void SetDefaults() + { + CalamityGlobalItem modItem = Item.Calamity(); + + Item.damage = 500; + Item.knockBack = 4.5f; + Item.useTime = Item.useAnimation = AnomalysNanogunHoldout.PlasmaFireTimer; + Item.shootSpeed = 5f; + Item.width = 102; + Item.height = 44; + Item.DamageType = DamageClass.Ranged; + Item.useStyle = ItemUseStyleID.Shoot; + Item.shoot = ModContent.ProjectileType(); + Item.UseSound = null; + + Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; + Item.rare = ModContent.RarityType(); + modItem.donorItem = true; + + modItem.UsesCharge = true; + modItem.MaxCharge = 250f; + modItem.ChargePerUse = 0.2f; + modItem.ChargePerAltUse = 0.125f; + } + + public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 4); + public override Vector2? HoldoutOffset() => new(-30f, 0f); + public override bool AltFunctionUse(Player player) => true; + public override void UseItemFrame(Player player) + { + // Thank you Mr. IbanPlay (CoralSprout.cs) + // Calculate the dirction in which the players arms should be pointing at. + float armPointingDirection = player.itemRotation; + if (player.direction < 0) + armPointingDirection += MathHelper.Pi; + + player.SetCompositeArmBack(true, Player.CompositeArmStretchAmount.Full, armPointingDirection - MathHelper.PiOver2); + player.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, armPointingDirection - MathHelper.PiOver2); + } + + // Adjust based on right or left click + public override void ModifyShootStats(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback) + { + Vector2 rotationVector = velocity.SafeNormalize(Vector2.UnitX); + position = player.MountedCenter + rotationVector * AnomalysNanogunHoldout.GunLength; + velocity = rotationVector * 5f; + + // Right click is the MPBF Devastator + if (player.altFunctionUse == 2) + { + damage = (int)(damage * 0.5f); + knockback *= 0.8f; + velocity = rotationVector * 13f; + } + } + + // The clicks have different use times + public override float UseSpeedMultiplier(Player player) + { + if (player.altFunctionUse == 2) + return (float)AnomalysNanogunHoldout.PlasmaFireTimer / AnomalysNanogunHoldout.MPFBFireTimer; + + return 1f; + } + + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) + { + // The shooting mode is stored inside the holdout projectile + Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, player.altFunctionUse, 0f); + return false; + } + + public override void AddRecipes() + { + CreateRecipe() + .AddIngredient() + .AddIngredient(8) + .AddIngredient(16) + .AddIngredient(16) + .AddIngredient(2) + .AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(4, out Predicate condition), condition) + .AddTile() + .Register(); + } + } +} diff --git a/Items/Weapons/DraedonsArsenal/TheAnomalysNanogun.png b/Items/Weapons/DraedonsArsenal/TheAnomalysNanogun.png new file mode 100644 index 0000000000..b874d63a36 Binary files /dev/null and b/Items/Weapons/DraedonsArsenal/TheAnomalysNanogun.png differ diff --git a/Items/Weapons/DraedonsArsenal/TrackingDisk.cs b/Items/Weapons/DraedonsArsenal/TrackingDisk.cs index 2a1f456456..66156dd7fc 100644 --- a/Items/Weapons/DraedonsArsenal/TrackingDisk.cs +++ b/Items/Weapons/DraedonsArsenal/TrackingDisk.cs @@ -1,6 +1,7 @@ using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.DraedonsArsenal; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -13,7 +14,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.DraedonsArsenal { - public class TrackingDisk : ModItem + public class TrackingDisk : RogueWeapon { public override void SetStaticDefaults() { diff --git a/Items/Weapons/DraedonsArsenal/WavePounder.cs b/Items/Weapons/DraedonsArsenal/WavePounder.cs index da0ebabd99..91414f9c1a 100644 --- a/Items/Weapons/DraedonsArsenal/WavePounder.cs +++ b/Items/Weapons/DraedonsArsenal/WavePounder.cs @@ -1,5 +1,6 @@ using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.DraedonsArsenal; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -12,7 +13,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.DraedonsArsenal { - public class WavePounder : ModItem + public class WavePounder : RogueWeapon { public override void SetStaticDefaults() { diff --git a/Items/Weapons/Magic/Apotheosis.cs b/Items/Weapons/Magic/Apotheosis.cs index eebc001bdc..7a18b1022b 100644 --- a/Items/Weapons/Magic/Apotheosis.cs +++ b/Items/Weapons/Magic/Apotheosis.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - Item.damage = 77; + Item.damage = 230; Item.DamageType = DamageClass.Magic; Item.mana = 42; Item.width = 30; diff --git a/Items/Weapons/Magic/InfernalRift.cs b/Items/Weapons/Magic/InfernalRift.cs index 99ff5c8ffd..fac765f344 100644 --- a/Items/Weapons/Magic/InfernalRift.cs +++ b/Items/Weapons/Magic/InfernalRift.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.noMelee = true; Item.knockBack = 7f; Item.value = CalamityGlobalItem.Rarity6BuyPrice; - Item.rare = ItemRarityID.Pink; + Item.rare = ItemRarityID.Yellow; Item.UseSound = SoundID.Item9; Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Melee/ArkoftheCosmos.cs b/Items/Weapons/Melee/ArkoftheCosmos.cs index 1b124c621d..ee69aa556b 100644 --- a/Items/Weapons/Melee/ArkoftheCosmos.cs +++ b/Items/Weapons/Melee/ArkoftheCosmos.cs @@ -96,7 +96,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { Item.width = Item.height = 136; - Item.damage = 1300; + Item.damage = 1670; Item.DamageType = DamageClass.MeleeNoSpeed; Item.noMelee = true; Item.noUseGraphic = true; diff --git a/Items/Weapons/Melee/Azathoth.cs b/Items/Weapons/Melee/Azathoth.cs index cc821c1d58..baf36ddeda 100644 --- a/Items/Weapons/Melee/Azathoth.cs +++ b/Items/Weapons/Melee/Azathoth.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 40; Item.height = 54; Item.DamageType = DamageClass.MeleeNoSpeed; - Item.damage = 50; + Item.damage = 80; Item.knockBack = 6f; Item.useTime = 20; Item.useAnimation = 20; diff --git a/Items/Weapons/Melee/DarklightGreatsword.cs b/Items/Weapons/Melee/DarklightGreatsword.cs index d427f2ca3b..14c74c7473 100644 --- a/Items/Weapons/Melee/DarklightGreatsword.cs +++ b/Items/Weapons/Melee/DarklightGreatsword.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - Item.width = 58; + Item.width = 92; Item.damage = 123; Item.DamageType = DamageClass.Melee; Item.useAnimation = 36; @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.knockBack = 5; Item.UseSound = SoundID.Item1; Item.autoReuse = true; - Item.height = 60; + Item.height = 100; Item.scale = 1.5f; Item.value = CalamityGlobalItem.Rarity6BuyPrice; Item.rare = ItemRarityID.Pink; diff --git a/Items/Weapons/Melee/DarklightGreatsword.png b/Items/Weapons/Melee/DarklightGreatsword.png index e8cbb61103..00c1204d21 100644 Binary files a/Items/Weapons/Melee/DarklightGreatsword.png and b/Items/Weapons/Melee/DarklightGreatsword.png differ diff --git a/Items/Weapons/Melee/DraconicDestruction.cs b/Items/Weapons/Melee/DraconicDestruction.cs index 19babcca9e..ca3a715aff 100644 --- a/Items/Weapons/Melee/DraconicDestruction.cs +++ b/Items/Weapons/Melee/DraconicDestruction.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { Item.width = 90; - Item.damage = 80; + Item.damage = 250; Item.DamageType = DamageClass.Melee; Item.useAnimation = 24; Item.useStyle = ItemUseStyleID.Swing; diff --git a/Items/Weapons/Melee/GaelsGreatsword.cs b/Items/Weapons/Melee/GaelsGreatsword.cs index 994aa0e66c..dafd20b49e 100644 --- a/Items/Weapons/Melee/GaelsGreatsword.cs +++ b/Items/Weapons/Melee/GaelsGreatsword.cs @@ -42,8 +42,8 @@ namespace CalamityMod.Items.Weapons.Melee //NOTE: GetWeaponDamage is in the CalamityPlayer file public override void SetDefaults() { - Item.width = 86; - Item.height = 94; + Item.width = 112; + Item.height = 102; Item.damage = BaseDamage; Item.DamageType = DamageClass.Melee; Item.useAnimation = Item.useTime = 12; diff --git a/Items/Weapons/Melee/GaelsGreatsword.png b/Items/Weapons/Melee/GaelsGreatsword.png index 06379a5eb7..5af2cc305c 100644 Binary files a/Items/Weapons/Melee/GaelsGreatsword.png and b/Items/Weapons/Melee/GaelsGreatsword.png differ diff --git a/Items/Weapons/Melee/GalaxySmasher.cs b/Items/Weapons/Melee/GalaxySmasher.cs index da3413af98..e5b99e2fc6 100644 --- a/Items/Weapons/Melee/GalaxySmasher.cs +++ b/Items/Weapons/Melee/GalaxySmasher.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Melee [LegacyName("GalaxySmasherMelee", "GalaxySmasherRogue")] public class GalaxySmasher : ModItem { - public static int BaseDamage = 264; + public static int BaseDamage = 300; public static float Speed = 18f; public override void SetStaticDefaults() diff --git a/Items/Weapons/Melee/IllustriousKnives.cs b/Items/Weapons/Melee/IllustriousKnives.cs index ea81ac1be3..5295614fec 100644 --- a/Items/Weapons/Melee/IllustriousKnives.cs +++ b/Items/Weapons/Melee/IllustriousKnives.cs @@ -28,9 +28,9 @@ namespace CalamityMod.Items.Weapons.Melee Item.DamageType = DamageClass.MeleeNoSpeed; Item.noMelee = true; Item.noUseGraphic = true; - Item.useAnimation = 12; + Item.useAnimation = 10; Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = 12; + Item.useTime = 10; Item.knockBack = 3f; Item.UseSound = SoundID.Item39; Item.autoReuse = true; diff --git a/Items/Weapons/Ranged/AntiMaterielRifle.cs b/Items/Weapons/Ranged/AntiMaterielRifle.cs index 466d4445b3..15c74e9da4 100644 --- a/Items/Weapons/Ranged/AntiMaterielRifle.cs +++ b/Items/Weapons/Ranged/AntiMaterielRifle.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - Item.damage = 3240; + Item.damage = 1800; Item.DamageType = DamageClass.Ranged; Item.width = 154; Item.height = 40; diff --git a/Items/Weapons/Ranged/HavocsBreath.cs b/Items/Weapons/Ranged/HavocsBreath.cs index 2ff6b2cc0b..0e356e5aed 100644 --- a/Items/Weapons/Ranged/HavocsBreath.cs +++ b/Items/Weapons/Ranged/HavocsBreath.cs @@ -12,6 +12,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetStaticDefaults() { DisplayName.SetDefault("Havoc's Breath"); + Tooltip.SetDefault("50% chance to not consume gel"); SacrificeTotal = 1; } diff --git a/Items/Weapons/Ranged/Meowthrower.cs b/Items/Weapons/Ranged/Meowthrower.cs index ff6b824873..d3edddcd89 100644 --- a/Items/Weapons/Ranged/Meowthrower.cs +++ b/Items/Weapons/Ranged/Meowthrower.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetStaticDefaults() { DisplayName.SetDefault("Meowthrower"); - Tooltip.SetDefault("50% chance to not consume gel\n" + + Tooltip.SetDefault("85% chance to not consume gel\n" + "Fires blue and pink flames that emit meows on enemy hits"); SacrificeTotal = 1; } diff --git a/Items/Weapons/Ranged/OpalStriker.cs b/Items/Weapons/Ranged/OpalStriker.cs index 86ae118423..9c4ff812f8 100644 --- a/Items/Weapons/Ranged/OpalStriker.cs +++ b/Items/Weapons/Ranged/OpalStriker.cs @@ -15,7 +15,8 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetStaticDefaults() { DisplayName.SetDefault("Opal Striker"); - Tooltip.SetDefault("Fires a string of opal strikes"); + Tooltip.SetDefault("50% chance to not consume ammo\n" + + "Fires a string of opal strikes"); SacrificeTotal = 1; } diff --git a/Items/Fishing/AstralCatches/PolarisParrotfish.cs b/Items/Weapons/Ranged/PolarisParrotfish.cs similarity index 97% rename from Items/Fishing/AstralCatches/PolarisParrotfish.cs rename to Items/Weapons/Ranged/PolarisParrotfish.cs index c8851bfa3e..c0827bea69 100644 --- a/Items/Fishing/AstralCatches/PolarisParrotfish.cs +++ b/Items/Weapons/Ranged/PolarisParrotfish.cs @@ -7,7 +7,7 @@ using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Sounds; -namespace CalamityMod.Items.Fishing.AstralCatches +namespace CalamityMod.Items.Weapons.Ranged { public class PolarisParrotfish : ModItem { diff --git a/Items/Fishing/AstralCatches/PolarisParrotfish.png b/Items/Weapons/Ranged/PolarisParrotfish.png similarity index 100% rename from Items/Fishing/AstralCatches/PolarisParrotfish.png rename to Items/Weapons/Ranged/PolarisParrotfish.png diff --git a/Items/Weapons/Ranged/Scorpio.cs b/Items/Weapons/Ranged/Scorpio.cs index d01f8196fd..d88f0de65e 100644 --- a/Items/Weapons/Ranged/Scorpio.cs +++ b/Items/Weapons/Ranged/Scorpio.cs @@ -83,7 +83,7 @@ namespace CalamityMod.Items.Weapons.Ranged AddIngredient(ItemID.GrenadeLauncher). AddIngredient(ItemID.RocketLauncher). AddIngredient(ItemID.FragmentVortex, 20). - AddTile(TileID.MythrilAnvil). + AddTile(TileID.LunarCraftingStation). Register(); } } diff --git a/Items/Weapons/Ranged/SomaPrime.cs b/Items/Weapons/Ranged/SomaPrime.cs index 8e0483eb53..742416b9b5 100644 --- a/Items/Weapons/Ranged/SomaPrime.cs +++ b/Items/Weapons/Ranged/SomaPrime.cs @@ -28,7 +28,7 @@ Replaces standard bullets with High Velocity Bullets public override void SetDefaults() { - Item.damage = 252; + Item.damage = 370; Item.DamageType = DamageClass.Ranged; Item.width = 94; Item.height = 34; diff --git a/Items/Weapons/Ranged/TheMaelstrom.cs b/Items/Weapons/Ranged/TheMaelstrom.cs index 615cf153fd..1a23c2cc2d 100644 --- a/Items/Weapons/Ranged/TheMaelstrom.cs +++ b/Items/Weapons/Ranged/TheMaelstrom.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - Item.damage = 397; + Item.damage = 530; Item.width = 20; Item.height = 12; Item.useTime = 45; diff --git a/Items/Weapons/Ranged/WulfrumBlunderbuss.cs b/Items/Weapons/Ranged/WulfrumBlunderbuss.cs index 05bc21531f..35ca114d55 100644 --- a/Items/Weapons/Ranged/WulfrumBlunderbuss.cs +++ b/Items/Weapons/Ranged/WulfrumBlunderbuss.cs @@ -35,6 +35,7 @@ namespace CalamityMod.Items.Weapons.Ranged DisplayName.SetDefault("Wulfrum Blunderbuss"); Tooltip.SetDefault("Consumes wulfrum scrap or silver coins to fire\n" + "The shot's spread can be diminished by aiming further away, at the cost of less damage\n" + + "Ignores 3 points of enemy Defense\n" + "[c/83B87E:\"The good thing about Wulfrum is that while it breaks fast, it can be reused even faster\"]\n" + "[c/83B87E:\"In fact, it is quite common for a robot to be turned into ammo right after it stops functioning\"]"); //Funny lore quip about how it can perform ecgologically be recyling the scrap parts of the faulty robots youre forced to shoot at as new ammo. diff --git a/Items/Weapons/Rogue/AcidicRainBarrel.cs b/Items/Weapons/Rogue/AcidicRainBarrel.cs index 99574318c2..8c3c149906 100644 --- a/Items/Weapons/Rogue/AcidicRainBarrel.cs +++ b/Items/Weapons/Rogue/AcidicRainBarrel.cs @@ -8,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class AcidicRainBarrel : ModItem + public class AcidicRainBarrel : RogueWeapon { public override void SetStaticDefaults() { @@ -38,11 +38,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { velocity.Y *= 0.667f; diff --git a/Items/Weapons/Rogue/AdamantiteThrowingAxe.cs b/Items/Weapons/Rogue/AdamantiteThrowingAxe.cs index 09c5582efc..c98dc683ab 100644 --- a/Items/Weapons/Rogue/AdamantiteThrowingAxe.cs +++ b/Items/Weapons/Rogue/AdamantiteThrowingAxe.cs @@ -6,7 +6,7 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class AdamantiteThrowingAxe : ModItem + public class AdamantiteThrowingAxe : RogueWeapon { public override void SetStaticDefaults() { @@ -37,11 +37,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/AlphaVirus.cs b/Items/Weapons/Rogue/AlphaVirus.cs index e7749cf061..0190e5ea0b 100644 --- a/Items/Weapons/Rogue/AlphaVirus.cs +++ b/Items/Weapons/Rogue/AlphaVirus.cs @@ -9,7 +9,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class AlphaVirus : ModItem + public class AlphaVirus : RogueWeapon { public override void SetStaticDefaults() { @@ -40,11 +40,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/Apoctolith.cs b/Items/Weapons/Rogue/Apoctolith.cs index c90329a643..e66dd63d18 100644 --- a/Items/Weapons/Rogue/Apoctolith.cs +++ b/Items/Weapons/Rogue/Apoctolith.cs @@ -10,7 +10,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class Apoctolith : ModItem + public class Apoctolith : RogueWeapon { public override void SetStaticDefaults() { @@ -44,11 +44,6 @@ namespace CalamityMod.Items.Weapons.Rogue // Terraria seems to really dislike high crit values in SetDefaults public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 20; - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { //Check if stealth is full diff --git a/Items/Weapons/Rogue/AshenStalactite.cs b/Items/Weapons/Rogue/AshenStalactite.cs index fa40e51f7e..c06cdf6031 100644 --- a/Items/Weapons/Rogue/AshenStalactite.cs +++ b/Items/Weapons/Rogue/AshenStalactite.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class AshenStalactite : ModItem + public class AshenStalactite : RogueWeapon { public override void SetStaticDefaults() { @@ -38,11 +38,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/AuroradicalThrow.cs b/Items/Weapons/Rogue/AuroradicalThrow.cs index 16529e85df..83f6233d7c 100644 --- a/Items/Weapons/Rogue/AuroradicalThrow.cs +++ b/Items/Weapons/Rogue/AuroradicalThrow.cs @@ -9,7 +9,7 @@ using Terraria.GameContent; namespace CalamityMod.Items.Weapons.Rogue { - public class AuroradicalThrow : ModItem + public class AuroradicalThrow : RogueWeapon { public override void SetStaticDefaults() { @@ -40,11 +40,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/BallisticPoisonBomb.cs b/Items/Weapons/Rogue/BallisticPoisonBomb.cs index 055e2711b7..b764e0565f 100644 --- a/Items/Weapons/Rogue/BallisticPoisonBomb.cs +++ b/Items/Weapons/Rogue/BallisticPoisonBomb.cs @@ -10,7 +10,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class BallisticPoisonBomb : ModItem + public class BallisticPoisonBomb : RogueWeapon { public override void SetStaticDefaults() { @@ -40,11 +40,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike diff --git a/Items/Weapons/Rogue/BlastBarrel.cs b/Items/Weapons/Rogue/BlastBarrel.cs index 4c5d7c11e1..be8094d0bd 100644 --- a/Items/Weapons/Rogue/BlastBarrel.cs +++ b/Items/Weapons/Rogue/BlastBarrel.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class BlastBarrel : ModItem + public class BlastBarrel : RogueWeapon { public const int BaseDamage = 32; public override void SetStaticDefaults() @@ -39,11 +39,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { velocity.Y *= 0.85f; diff --git a/Items/Weapons/Rogue/BlazingStar.cs b/Items/Weapons/Rogue/BlazingStar.cs index 7230d19372..92eee0aaf4 100644 --- a/Items/Weapons/Rogue/BlazingStar.cs +++ b/Items/Weapons/Rogue/BlazingStar.cs @@ -8,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class BlazingStar : ModItem + public class BlazingStar : RogueWeapon { public const float Speed = 13f; public override void SetStaticDefaults() @@ -43,11 +43,6 @@ namespace CalamityMod.Items.Weapons.Rogue // Terraria seems to really dislike high crit values in SetDefaults public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 4; - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/BloodsoakedCrasher.cs b/Items/Weapons/Rogue/BloodsoakedCrasher.cs index e5e74a2f6b..8ced1713b8 100644 --- a/Items/Weapons/Rogue/BloodsoakedCrasher.cs +++ b/Items/Weapons/Rogue/BloodsoakedCrasher.cs @@ -9,7 +9,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class BloodsoakedCrasher : ModItem //This weapon has been coded by Ben || Termi + public class BloodsoakedCrasher : RogueWeapon //This weapon has been coded by Ben || Termi { public override void SetStaticDefaults() { @@ -40,11 +40,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.rare = ModContent.RarityType(); } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { int proj = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); diff --git a/Items/Weapons/Rogue/BouncingEyeball.cs b/Items/Weapons/Rogue/BouncingEyeball.cs index c0f653e40f..be85a8698e 100644 --- a/Items/Weapons/Rogue/BouncingEyeball.cs +++ b/Items/Weapons/Rogue/BouncingEyeball.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class BouncingEyeball : ModItem + public class BouncingEyeball : RogueWeapon { public const int BaseDamage = 15; public override void SetStaticDefaults() @@ -37,11 +37,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.autoReuse = true; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { bool bloodMoon = Main.bloodMoon; diff --git a/Items/Weapons/Rogue/BouncySpikyBall.cs b/Items/Weapons/Rogue/BouncySpikyBall.cs index cb13937116..51f1d9d016 100644 --- a/Items/Weapons/Rogue/BouncySpikyBall.cs +++ b/Items/Weapons/Rogue/BouncySpikyBall.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class BouncySpikyBall : ModItem + public class BouncySpikyBall : RogueWeapon { public override void SetStaticDefaults() { @@ -40,11 +40,6 @@ Stealth strikes provide a bigger boost after ricocheting"); Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike diff --git a/Items/Weapons/Rogue/BrackishFlask.cs b/Items/Weapons/Rogue/BrackishFlask.cs index 634cc76a8d..f075ea1c9c 100644 --- a/Items/Weapons/Rogue/BrackishFlask.cs +++ b/Items/Weapons/Rogue/BrackishFlask.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class BrackishFlask : ModItem + public class BrackishFlask : RogueWeapon { public override void SetStaticDefaults() { @@ -37,11 +37,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike diff --git a/Items/Weapons/Rogue/Brimblade.cs b/Items/Weapons/Rogue/Brimblade.cs index efb7a389dc..2a93c4d3e0 100644 --- a/Items/Weapons/Rogue/Brimblade.cs +++ b/Items/Weapons/Rogue/Brimblade.cs @@ -9,7 +9,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class Brimblade : ModItem + public class Brimblade : RogueWeapon { public override void SetStaticDefaults() { @@ -39,11 +39,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/BurningStrife.cs b/Items/Weapons/Rogue/BurningStrife.cs index a1162e84c4..82b99bc32d 100644 --- a/Items/Weapons/Rogue/BurningStrife.cs +++ b/Items/Weapons/Rogue/BurningStrife.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class BurningStrife : ModItem + public class BurningStrife : RogueWeapon { public override void SetStaticDefaults() { @@ -42,11 +42,6 @@ namespace CalamityMod.Items.Weapons.Rogue // Terraria seems to really dislike high crit values in SetDefaults public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 8; - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { float speedMult = 1f; diff --git a/Items/Weapons/Rogue/CelestialReaper.cs b/Items/Weapons/Rogue/CelestialReaper.cs index 363df8e6f7..61c46f04d6 100644 --- a/Items/Weapons/Rogue/CelestialReaper.cs +++ b/Items/Weapons/Rogue/CelestialReaper.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class CelestialReaper : ModItem + public class CelestialReaper : RogueWeapon { public const int BaseDamage = 140; @@ -40,11 +40,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { bool usingStealth = player.Calamity().StealthStrikeAvailable(); diff --git a/Items/Weapons/Rogue/Celestus.cs b/Items/Weapons/Rogue/Celestus.cs index ee18768d03..bbdc909203 100644 --- a/Items/Weapons/Rogue/Celestus.cs +++ b/Items/Weapons/Rogue/Celestus.cs @@ -10,7 +10,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class Celestus : ModItem + public class Celestus : RogueWeapon { public override void SetStaticDefaults() { @@ -39,11 +39,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.rare = ModContent.RarityType(); } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike diff --git a/Items/Weapons/Rogue/Cinquedea.cs b/Items/Weapons/Rogue/Cinquedea.cs index ab7404ef18..a6d4bcf3c1 100644 --- a/Items/Weapons/Rogue/Cinquedea.cs +++ b/Items/Weapons/Rogue/Cinquedea.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class Cinquedea : ModItem + public class Cinquedea : RogueWeapon { public static int BaseDamage = 36; public static float Knockback = 5f; @@ -43,11 +43,6 @@ namespace CalamityMod.Items.Weapons.Rogue // Terraria seems to really dislike high crit values in SetDefaults public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 8; - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/CobaltKunai.cs b/Items/Weapons/Rogue/CobaltKunai.cs index f8b1b61ad1..942afd6af6 100644 --- a/Items/Weapons/Rogue/CobaltKunai.cs +++ b/Items/Weapons/Rogue/CobaltKunai.cs @@ -6,7 +6,7 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class CobaltKunai : ModItem + public class CobaltKunai : RogueWeapon { public override void SetStaticDefaults() { @@ -37,11 +37,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/ConsecratedWater.cs b/Items/Weapons/Rogue/ConsecratedWater.cs index 5283b05a89..c116bdd535 100644 --- a/Items/Weapons/Rogue/ConsecratedWater.cs +++ b/Items/Weapons/Rogue/ConsecratedWater.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class ConsecratedWater : ModItem + public class ConsecratedWater : RogueWeapon { public const int BaseDamage = 48; @@ -41,11 +41,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { diff --git a/Items/Weapons/Rogue/ContaminatedBile.cs b/Items/Weapons/Rogue/ContaminatedBile.cs index 87ee8f3168..4919bf14ac 100644 --- a/Items/Weapons/Rogue/ContaminatedBile.cs +++ b/Items/Weapons/Rogue/ContaminatedBile.cs @@ -8,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class ContaminatedBile : ModItem + public class ContaminatedBile : RogueWeapon { public override void SetStaticDefaults() { @@ -36,11 +36,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { int p = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); diff --git a/Items/Weapons/Rogue/CorpusAvertor.cs b/Items/Weapons/Rogue/CorpusAvertor.cs index a19392114d..48cac4eb3a 100644 --- a/Items/Weapons/Rogue/CorpusAvertor.cs +++ b/Items/Weapons/Rogue/CorpusAvertor.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class CorpusAvertor : ModItem + public class CorpusAvertor : RogueWeapon { public override void SetStaticDefaults() { @@ -49,11 +49,6 @@ namespace CalamityMod.Items.Weapons.Rogue damage.Base += lifeAmount * 0.1f; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/CosmicKunai.cs b/Items/Weapons/Rogue/CosmicKunai.cs index 2b4ac9bbad..73fef73163 100644 --- a/Items/Weapons/Rogue/CosmicKunai.cs +++ b/Items/Weapons/Rogue/CosmicKunai.cs @@ -9,7 +9,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class CosmicKunai : ModItem + public class CosmicKunai : RogueWeapon { private int counter = 0; @@ -42,11 +42,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { int stealth = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); diff --git a/Items/Weapons/Rogue/CraniumSmasher.cs b/Items/Weapons/Rogue/CraniumSmasher.cs index 8e64efeb2f..5893cad1a9 100644 --- a/Items/Weapons/Rogue/CraniumSmasher.cs +++ b/Items/Weapons/Rogue/CraniumSmasher.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class CraniumSmasher : ModItem + public class CraniumSmasher : RogueWeapon { public override void SetStaticDefaults() { @@ -37,11 +37,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/CrushsawCrasher.cs b/Items/Weapons/Rogue/CrushsawCrasher.cs index 25d572bae2..85bc15f8c9 100644 --- a/Items/Weapons/Rogue/CrushsawCrasher.cs +++ b/Items/Weapons/Rogue/CrushsawCrasher.cs @@ -9,7 +9,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class CrushsawCrasher : ModItem + public class CrushsawCrasher : RogueWeapon { public override void SetStaticDefaults() { @@ -37,11 +37,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike diff --git a/Items/Weapons/Rogue/CrystalPiercer.cs b/Items/Weapons/Rogue/CrystalPiercer.cs index 0a84a77b09..3dd373c484 100644 --- a/Items/Weapons/Rogue/CrystalPiercer.cs +++ b/Items/Weapons/Rogue/CrystalPiercer.cs @@ -8,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class CrystalPiercer : ModItem + public class CrystalPiercer : RogueWeapon { public override void SetStaticDefaults() { @@ -40,11 +40,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike diff --git a/Items/Weapons/Rogue/Crystalline.cs b/Items/Weapons/Rogue/Crystalline.cs index 51f16b2bfe..c0e463d9b4 100644 --- a/Items/Weapons/Rogue/Crystalline.cs +++ b/Items/Weapons/Rogue/Crystalline.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class Crystalline : ModItem + public class Crystalline : RogueWeapon { public override void SetStaticDefaults() { @@ -41,11 +41,6 @@ namespace CalamityMod.Items.Weapons.Rogue public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 4; - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/CursedDagger.cs b/Items/Weapons/Rogue/CursedDagger.cs index d8d546063b..4ab5ef7025 100644 --- a/Items/Weapons/Rogue/CursedDagger.cs +++ b/Items/Weapons/Rogue/CursedDagger.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class CursedDagger : ModItem + public class CursedDagger : RogueWeapon { public override void SetStaticDefaults() { @@ -37,11 +37,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike diff --git a/Items/Weapons/Rogue/DeepSeaDumbbell.cs b/Items/Weapons/Rogue/DeepSeaDumbbell.cs index 753974a6d4..a59ef81729 100644 --- a/Items/Weapons/Rogue/DeepSeaDumbbell.cs +++ b/Items/Weapons/Rogue/DeepSeaDumbbell.cs @@ -8,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class DeepSeaDumbbell : ModItem + public class DeepSeaDumbbell : RogueWeapon { private const float FlexMultMax = 5f; private float flexMult = 1f; @@ -80,11 +80,6 @@ namespace CalamityMod.Items.Weapons.Rogue public override void OnHitPvp(Player player, Player target, int damage, bool crit) => flexMult = 1f; - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { // Alt fire doesn't actually shoot anything. It flexes, increasing the damage of the next attack. diff --git a/Items/Weapons/Rogue/DeepWounder.cs b/Items/Weapons/Rogue/DeepWounder.cs index c89e182450..c50c9a9c51 100644 --- a/Items/Weapons/Rogue/DeepWounder.cs +++ b/Items/Weapons/Rogue/DeepWounder.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class DeepWounder : ModItem + public class DeepWounder : RogueWeapon { public override void SetStaticDefaults() { @@ -38,11 +38,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/DefectiveSphere.cs b/Items/Weapons/Rogue/DefectiveSphere.cs index 8f2835b257..ffcb44a4c5 100644 --- a/Items/Weapons/Rogue/DefectiveSphere.cs +++ b/Items/Weapons/Rogue/DefectiveSphere.cs @@ -8,7 +8,7 @@ using static Terraria.ModLoader.ModContent; namespace CalamityMod.Items.Weapons.Rogue { - public class DefectiveSphere : ModItem + public class DefectiveSphere : RogueWeapon { public static int BaseDamage = 130; public static float Speed = 15f; @@ -64,11 +64,6 @@ Stealth strikes launch all 4 sphere types at once"); } } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { int sphereType = Utils.SelectRandom(Main.rand, new int[] diff --git a/Items/Weapons/Rogue/DeificThunderbolt.cs b/Items/Weapons/Rogue/DeificThunderbolt.cs index c62d4cb355..f113ee2f23 100644 --- a/Items/Weapons/Rogue/DeificThunderbolt.cs +++ b/Items/Weapons/Rogue/DeificThunderbolt.cs @@ -9,7 +9,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class DeificThunderbolt : ModItem + public class DeificThunderbolt : RogueWeapon { public override void SetStaticDefaults() { @@ -46,11 +46,6 @@ Stealth strikes summon more lightning and travel faster"); // Terraria seems to really dislike high crit values in SetDefaults public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 12; - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { float stealthSpeedMult = 1f; diff --git a/Items/Weapons/Rogue/DesecratedWater.cs b/Items/Weapons/Rogue/DesecratedWater.cs index 3772aa71c4..9e740aaf8b 100644 --- a/Items/Weapons/Rogue/DesecratedWater.cs +++ b/Items/Weapons/Rogue/DesecratedWater.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class DesecratedWater : ModItem + public class DesecratedWater : RogueWeapon { public const int BaseDamage = 55; public override void SetStaticDefaults() @@ -38,11 +38,6 @@ Stealth strikes spawn additional bubbles that inflict Ichor and Cursed Inferno") Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike diff --git a/Items/Weapons/Rogue/DukesDecapitator.cs b/Items/Weapons/Rogue/DukesDecapitator.cs index 04e8eb3069..1ca5ed059d 100644 --- a/Items/Weapons/Rogue/DukesDecapitator.cs +++ b/Items/Weapons/Rogue/DukesDecapitator.cs @@ -7,7 +7,7 @@ using Microsoft.Xna.Framework; namespace CalamityMod.Items.Weapons.Rogue { - public class DukesDecapitator : ModItem + public class DukesDecapitator : RogueWeapon { public override void SetStaticDefaults() { @@ -38,11 +38,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/DuststormInABottle.cs b/Items/Weapons/Rogue/DuststormInABottle.cs index 2773b30d66..a76b3373c2 100644 --- a/Items/Weapons/Rogue/DuststormInABottle.cs +++ b/Items/Weapons/Rogue/DuststormInABottle.cs @@ -8,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class DuststormInABottle : ModItem + public class DuststormInABottle : RogueWeapon { public override void SetStaticDefaults() { @@ -38,11 +38,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/DynamicPursuer.cs b/Items/Weapons/Rogue/DynamicPursuer.cs index 129627f38b..10e311b62d 100644 --- a/Items/Weapons/Rogue/DynamicPursuer.cs +++ b/Items/Weapons/Rogue/DynamicPursuer.cs @@ -15,7 +15,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class DynamicPursuer : ModItem + public class DynamicPursuer : RogueWeapon { public override void SetStaticDefaults() { diff --git a/Items/Weapons/Rogue/EclipsesFall.cs b/Items/Weapons/Rogue/EclipsesFall.cs index e7e33d5c0e..b70ca6c9ec 100644 --- a/Items/Weapons/Rogue/EclipsesFall.cs +++ b/Items/Weapons/Rogue/EclipsesFall.cs @@ -10,7 +10,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class EclipsesFall : ModItem + public class EclipsesFall : RogueWeapon { public override void SetStaticDefaults() { @@ -40,11 +40,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.rare = ModContent.RarityType(); } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/ElementalDisk.cs b/Items/Weapons/Rogue/ElementalDisk.cs index dc0fba083a..36fe42ada4 100644 --- a/Items/Weapons/Rogue/ElementalDisk.cs +++ b/Items/Weapons/Rogue/ElementalDisk.cs @@ -9,7 +9,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { [LegacyName("AccretionDisk")] - public class ElementalDisk : ModItem + public class ElementalDisk : RogueWeapon { public override void SetStaticDefaults() { @@ -39,11 +39,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/EnchantedAxe.cs b/Items/Weapons/Rogue/EnchantedAxe.cs index 6deb1532ac..d87d0c09c2 100644 --- a/Items/Weapons/Rogue/EnchantedAxe.cs +++ b/Items/Weapons/Rogue/EnchantedAxe.cs @@ -8,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class EnchantedAxe : ModItem + public class EnchantedAxe : RogueWeapon { public override void SetStaticDefaults() { @@ -41,11 +41,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/EpidemicShredder.cs b/Items/Weapons/Rogue/EpidemicShredder.cs index b45a202e31..339fabf5d3 100644 --- a/Items/Weapons/Rogue/EpidemicShredder.cs +++ b/Items/Weapons/Rogue/EpidemicShredder.cs @@ -8,7 +8,7 @@ using Microsoft.Xna.Framework; namespace CalamityMod.Items.Weapons.Rogue { - public class EpidemicShredder : ModItem + public class EpidemicShredder : RogueWeapon { public override void SetStaticDefaults() { diff --git a/Items/Weapons/Rogue/Equanimity.cs b/Items/Weapons/Rogue/Equanimity.cs index afea15d084..79a8b4be30 100644 --- a/Items/Weapons/Rogue/Equanimity.cs +++ b/Items/Weapons/Rogue/Equanimity.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class Equanimity : ModItem + public class Equanimity : RogueWeapon { public override void SetStaticDefaults() { @@ -39,11 +39,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/Eradicator.cs b/Items/Weapons/Rogue/Eradicator.cs index ce3b77b5ea..da3bd27dd1 100644 --- a/Items/Weapons/Rogue/Eradicator.cs +++ b/Items/Weapons/Rogue/Eradicator.cs @@ -9,7 +9,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class Eradicator : ModItem + public class Eradicator : RogueWeapon { public static float Speed = 10.5f; @@ -41,11 +41,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/ExecutionersBlade.cs b/Items/Weapons/Rogue/ExecutionersBlade.cs index 67afce8211..41aaa81ff3 100644 --- a/Items/Weapons/Rogue/ExecutionersBlade.cs +++ b/Items/Weapons/Rogue/ExecutionersBlade.cs @@ -11,7 +11,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class ExecutionersBlade : ModItem + public class ExecutionersBlade : RogueWeapon { private int counter = 0; @@ -49,11 +49,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request("CalamityMod/Items/Weapons/Rogue/ExecutionersBladeGlow").Value); } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { bool usingStealth = player.Calamity().StealthStrikeAvailable() && counter == 0; diff --git a/Items/Weapons/Rogue/Exorcism.cs b/Items/Weapons/Rogue/Exorcism.cs index 5baf0b6b66..ab6588b120 100644 --- a/Items/Weapons/Rogue/Exorcism.cs +++ b/Items/Weapons/Rogue/Exorcism.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class Exorcism : ModItem + public class Exorcism : RogueWeapon { public override void SetStaticDefaults() { @@ -39,11 +39,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/FantasyTalisman.cs b/Items/Weapons/Rogue/FantasyTalisman.cs index 82c9964a9d..62c5ba7c74 100644 --- a/Items/Weapons/Rogue/FantasyTalisman.cs +++ b/Items/Weapons/Rogue/FantasyTalisman.cs @@ -8,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class FantasyTalisman : ModItem + public class FantasyTalisman : RogueWeapon { public override void SetStaticDefaults() { @@ -41,11 +41,6 @@ Stealth strikes release more souls and leave behind souls as they travel"); Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike diff --git a/Items/Weapons/Rogue/FeatherKnife.cs b/Items/Weapons/Rogue/FeatherKnife.cs index af60e0b5a4..2c31495cd1 100644 --- a/Items/Weapons/Rogue/FeatherKnife.cs +++ b/Items/Weapons/Rogue/FeatherKnife.cs @@ -8,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class FeatherKnife : ModItem + public class FeatherKnife : RogueWeapon { public override void SetStaticDefaults() { @@ -41,11 +41,6 @@ Stealth strike throws a volley of knives"); Item.rare = ItemRarityID.Orange; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike diff --git a/Items/Weapons/Rogue/FinalDawn.cs b/Items/Weapons/Rogue/FinalDawn.cs index b5452020e2..3c367cea84 100644 --- a/Items/Weapons/Rogue/FinalDawn.cs +++ b/Items/Weapons/Rogue/FinalDawn.cs @@ -7,7 +7,7 @@ using static Terraria.ModLoader.ModContent; namespace CalamityMod.Items.Weapons.Rogue { - public class FinalDawn : ModItem + public class FinalDawn : RogueWeapon { public override void SetStaticDefaults() { @@ -43,11 +43,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.noUseGraphic = true; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] + player.ownedProjectileCounts[ProjectileType()] + player.ownedProjectileCounts[ProjectileType()] + diff --git a/Items/Weapons/Rogue/FishboneBoomerang.cs b/Items/Weapons/Rogue/FishboneBoomerang.cs index 2c42f8aeed..6b0c30ad48 100644 --- a/Items/Weapons/Rogue/FishboneBoomerang.cs +++ b/Items/Weapons/Rogue/FishboneBoomerang.cs @@ -10,7 +10,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { [LegacyName("SeashellBoomerang")] - public class FishboneBoomerang : ModItem + public class FishboneBoomerang : RogueWeapon { public override void SetStaticDefaults() { @@ -43,11 +43,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.autoReuse = true; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool CanUseItem(Player player) { return !Main.projectile.Any(n => n.active && n.owner == player.whoAmI && n.type == ModContent.ProjectileType()); diff --git a/Items/Weapons/Rogue/FrostcrushValari.cs b/Items/Weapons/Rogue/FrostcrushValari.cs index b5ab9ffaf3..7ce3f000f5 100644 --- a/Items/Weapons/Rogue/FrostcrushValari.cs +++ b/Items/Weapons/Rogue/FrostcrushValari.cs @@ -11,7 +11,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class FrostcrushValari : ModItem + public class FrostcrushValari : RogueWeapon { public static float Speed = 15f; public override void SetStaticDefaults() @@ -46,11 +46,6 @@ Stealth strikes throw three short ranged boomerangs along with a spread of icicl // Terraria seems to really dislike high crit values in SetDefaults public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 16; - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { CalamityPlayer modPlayer = Main.player[Main.myPlayer].Calamity(); diff --git a/Items/Weapons/Rogue/FrostyFlare.cs b/Items/Weapons/Rogue/FrostyFlare.cs index 5901057788..1cf368e7cc 100644 --- a/Items/Weapons/Rogue/FrostyFlare.cs +++ b/Items/Weapons/Rogue/FrostyFlare.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class FrostyFlare : ModItem + public class FrostyFlare : RogueWeapon { public override void SetStaticDefaults() { @@ -42,11 +42,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Fishing/AstralCatches/GacruxianMollusk.cs b/Items/Weapons/Rogue/GacruxianMollusk.cs similarity index 83% rename from Items/Fishing/AstralCatches/GacruxianMollusk.cs rename to Items/Weapons/Rogue/GacruxianMollusk.cs index 8f9e37c023..92189c974d 100644 --- a/Items/Fishing/AstralCatches/GacruxianMollusk.cs +++ b/Items/Weapons/Rogue/GacruxianMollusk.cs @@ -5,10 +5,9 @@ using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Fishing.AstralCatches +namespace CalamityMod.Items.Weapons.Rogue { - // TODO -- This is a rogue weapon. It should be in Items/Weapons/Rogue. I do not care if it comes from fishing. - public class GacruxianMollusk : ModItem + public class GacruxianMollusk : RogueWeapon { public static int BaseDamage = 36; public static float Knockback = 5f; @@ -42,11 +41,6 @@ namespace CalamityMod.Items.Fishing.AstralCatches Item.rare = ItemRarityID.LightRed; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike diff --git a/Items/Fishing/AstralCatches/GacruxianMollusk.png b/Items/Weapons/Rogue/GacruxianMollusk.png similarity index 100% rename from Items/Fishing/AstralCatches/GacruxianMollusk.png rename to Items/Weapons/Rogue/GacruxianMollusk.png diff --git a/Items/Weapons/Rogue/GelDart.cs b/Items/Weapons/Rogue/GelDart.cs index 0a9628763b..bfb35fc67a 100644 --- a/Items/Weapons/Rogue/GelDart.cs +++ b/Items/Weapons/Rogue/GelDart.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class GelDart : ModItem + public class GelDart : RogueWeapon { public override void SetStaticDefaults() { @@ -40,11 +40,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike diff --git a/Items/Weapons/Rogue/GhoulishGouger.cs b/Items/Weapons/Rogue/GhoulishGouger.cs index 369eb1692b..d6b4acf8be 100644 --- a/Items/Weapons/Rogue/GhoulishGouger.cs +++ b/Items/Weapons/Rogue/GhoulishGouger.cs @@ -9,7 +9,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class GhoulishGouger : ModItem + public class GhoulishGouger : RogueWeapon { public override void SetStaticDefaults() { @@ -47,11 +47,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request("CalamityMod/Items/Weapons/Rogue/GhoulishGougerGlow").Value); } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { int proj = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); diff --git a/Items/Weapons/Rogue/GildedDagger.cs b/Items/Weapons/Rogue/GildedDagger.cs index f9fb13e8b9..9b392526f2 100644 --- a/Items/Weapons/Rogue/GildedDagger.cs +++ b/Items/Weapons/Rogue/GildedDagger.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class GildedDagger : ModItem + public class GildedDagger : RogueWeapon { public override void SetStaticDefaults() { @@ -39,11 +39,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/Glaive.cs b/Items/Weapons/Rogue/Glaive.cs index b31dbcc000..86740191ca 100644 --- a/Items/Weapons/Rogue/Glaive.cs +++ b/Items/Weapons/Rogue/Glaive.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class Glaive : ModItem + public class Glaive : RogueWeapon { public static int BaseDamage = 45; public static float Knockback = 3f; @@ -46,11 +46,6 @@ Stealth strikes are super fast and pierce infinitely"); // Terraria seems to really dislike high crit values in SetDefaults public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 4; - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { float ai1 = 0f; diff --git a/Items/Weapons/Rogue/GleamingDagger.cs b/Items/Weapons/Rogue/GleamingDagger.cs index 1ed1946538..194b60fb93 100644 --- a/Items/Weapons/Rogue/GleamingDagger.cs +++ b/Items/Weapons/Rogue/GleamingDagger.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class GleamingDagger : ModItem + public class GleamingDagger : RogueWeapon { public override void SetStaticDefaults() { @@ -39,11 +39,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/GodsParanoia.cs b/Items/Weapons/Rogue/GodsParanoia.cs index 2d2f624e63..f18caf3c50 100644 --- a/Items/Weapons/Rogue/GodsParanoia.cs +++ b/Items/Weapons/Rogue/GodsParanoia.cs @@ -11,7 +11,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class GodsParanoia : ModItem + public class GodsParanoia : RogueWeapon { private static int damage = 98; private static int knockBack = 5; @@ -66,11 +66,6 @@ Right click to delete all existing spiky balls"); } } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { CalamityPlayer modPlayer = player.Calamity(); diff --git a/Items/Weapons/Rogue/GraveGrimreaver.cs b/Items/Weapons/Rogue/GraveGrimreaver.cs index 5fa47821d0..1910a18ca9 100644 --- a/Items/Weapons/Rogue/GraveGrimreaver.cs +++ b/Items/Weapons/Rogue/GraveGrimreaver.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class GraveGrimreaver : ModItem + public class GraveGrimreaver : RogueWeapon { public override void SetStaticDefaults() { @@ -41,11 +41,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.Calamity().donorItem = true; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike diff --git a/Items/Weapons/Rogue/HardenedHoneycomb.cs b/Items/Weapons/Rogue/HardenedHoneycomb.cs index 53879f30f7..f6d6283d88 100644 --- a/Items/Weapons/Rogue/HardenedHoneycomb.cs +++ b/Items/Weapons/Rogue/HardenedHoneycomb.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class HardenedHoneycomb : ModItem + public class HardenedHoneycomb : RogueWeapon { public override void SetStaticDefaults() { @@ -40,11 +40,6 @@ Stealth strikes can bounce off walls and enemies"); Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike diff --git a/Items/Weapons/Rogue/HeavenfallenStardisk.cs b/Items/Weapons/Rogue/HeavenfallenStardisk.cs index 8c284e94bd..d9c6dd1617 100644 --- a/Items/Weapons/Rogue/HeavenfallenStardisk.cs +++ b/Items/Weapons/Rogue/HeavenfallenStardisk.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class HeavenfallenStardisk : ModItem + public class HeavenfallenStardisk : RogueWeapon { public override void SetStaticDefaults() { @@ -41,11 +41,6 @@ namespace CalamityMod.Items.Weapons.Rogue // Terraria seems to really dislike high crit values in SetDefaults public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 20; - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/HellsSun.cs b/Items/Weapons/Rogue/HellsSun.cs index ba7fe25291..e99cf98bfb 100644 --- a/Items/Weapons/Rogue/HellsSun.cs +++ b/Items/Weapons/Rogue/HellsSun.cs @@ -9,7 +9,7 @@ using CalamityMod.CalPlayer; namespace CalamityMod.Items.Weapons.Rogue { - public class HellsSun : ModItem + public class HellsSun : RogueWeapon { private static int damage = 85; private static int knockBack = 5; @@ -65,11 +65,6 @@ namespace CalamityMod.Items.Weapons.Rogue } } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { CalamityPlayer modPlayer = player.Calamity(); diff --git a/Items/Weapons/Rogue/Hypothermia.cs b/Items/Weapons/Rogue/Hypothermia.cs index b5ba92489d..19e9f2e093 100644 --- a/Items/Weapons/Rogue/Hypothermia.cs +++ b/Items/Weapons/Rogue/Hypothermia.cs @@ -10,7 +10,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class Hypothermia : ModItem + public class Hypothermia : RogueWeapon { // For more consistent DPS, always alternates between throwing 1 and 2 instead of picking randomly private bool throwTwo = true; @@ -49,11 +49,6 @@ namespace CalamityMod.Items.Weapons.Rogue // Terraria seems to really dislike high crit values in SetDefaults public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 16; - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/IceStar.cs b/Items/Weapons/Rogue/IceStar.cs index b622fa798a..560f30e084 100644 --- a/Items/Weapons/Rogue/IceStar.cs +++ b/Items/Weapons/Rogue/IceStar.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class IceStar : ModItem + public class IceStar : RogueWeapon { public override void SetStaticDefaults() { @@ -42,11 +42,6 @@ namespace CalamityMod.Items.Weapons.Rogue // Terraria seems to really dislike high crit values in SetDefaults public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 7; - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/Icebreaker.cs b/Items/Weapons/Rogue/Icebreaker.cs index 1c57766aac..0c5f089ec1 100644 --- a/Items/Weapons/Rogue/Icebreaker.cs +++ b/Items/Weapons/Rogue/Icebreaker.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class Icebreaker : ModItem + public class Icebreaker : RogueWeapon { public override void SetStaticDefaults() { @@ -37,11 +37,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike diff --git a/Items/Weapons/Rogue/IchorSpear.cs b/Items/Weapons/Rogue/IchorSpear.cs index d5f12acfb2..96dc09d51a 100644 --- a/Items/Weapons/Rogue/IchorSpear.cs +++ b/Items/Weapons/Rogue/IchorSpear.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class IchorSpear : ModItem + public class IchorSpear : RogueWeapon { public override void SetStaticDefaults() { @@ -37,11 +37,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike diff --git a/Items/Weapons/Rogue/InfernalKris.cs b/Items/Weapons/Rogue/InfernalKris.cs index 6793e24b1e..8309c66e92 100644 --- a/Items/Weapons/Rogue/InfernalKris.cs +++ b/Items/Weapons/Rogue/InfernalKris.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class InfernalKris : ModItem + public class InfernalKris : RogueWeapon { public override void SetStaticDefaults() { @@ -39,11 +39,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/InfestedClawmerang.cs b/Items/Weapons/Rogue/InfestedClawmerang.cs index db1593c959..d3856431f2 100644 --- a/Items/Weapons/Rogue/InfestedClawmerang.cs +++ b/Items/Weapons/Rogue/InfestedClawmerang.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Items.Weapons.Rogue { // only renamed because vanilla added a Shroomerang [LegacyName("Shroomerang")] - public class InfestedClawmerang : ModItem + public class InfestedClawmerang : RogueWeapon { public override void SetStaticDefaults() { @@ -38,11 +38,6 @@ Stealth strikes grant the Mushy buff to the user on enemy hits and summon homing Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike diff --git a/Items/Weapons/Rogue/IronFrancisca.cs b/Items/Weapons/Rogue/IronFrancisca.cs index 4fc2699bfd..cdc5a15591 100644 --- a/Items/Weapons/Rogue/IronFrancisca.cs +++ b/Items/Weapons/Rogue/IronFrancisca.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class IronFrancisca : ModItem + public class IronFrancisca : RogueWeapon { public override void SetStaticDefaults() { @@ -39,11 +39,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/JawsOfOblivion.cs b/Items/Weapons/Rogue/JawsOfOblivion.cs index 9dbbff2a07..1a2834e2b3 100644 --- a/Items/Weapons/Rogue/JawsOfOblivion.cs +++ b/Items/Weapons/Rogue/JawsOfOblivion.cs @@ -9,7 +9,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class JawsOfOblivion : ModItem + public class JawsOfOblivion : RogueWeapon { public override void SetStaticDefaults() { @@ -41,11 +41,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.rare = ModContent.RarityType(); } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { float spreadAngle = MathHelper.ToRadians(2.5f); diff --git a/Items/Weapons/Rogue/KelvinCatalyst.cs b/Items/Weapons/Rogue/KelvinCatalyst.cs index 8ff90144a5..e3f9564a1b 100644 --- a/Items/Weapons/Rogue/KelvinCatalyst.cs +++ b/Items/Weapons/Rogue/KelvinCatalyst.cs @@ -11,7 +11,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class KelvinCatalyst : ModItem + public class KelvinCatalyst : RogueWeapon { public override void SetStaticDefaults() { @@ -42,11 +42,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { int proj = Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI); diff --git a/Items/Weapons/Rogue/Kylie.cs b/Items/Weapons/Rogue/Kylie.cs index 49168646de..58f7506044 100644 --- a/Items/Weapons/Rogue/Kylie.cs +++ b/Items/Weapons/Rogue/Kylie.cs @@ -9,7 +9,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class Kylie : ModItem + public class Kylie : RogueWeapon { public static float Speed = 11f; public override void SetStaticDefaults() @@ -42,11 +42,6 @@ namespace CalamityMod.Items.Weapons.Rogue // Terraria seems to really dislike high crit values in SetDefaults public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 16; - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { CalamityPlayer p = Main.player[Main.myPlayer].Calamity(); diff --git a/Items/Weapons/Rogue/LeadTomahawk.cs b/Items/Weapons/Rogue/LeadTomahawk.cs index 2de419cde7..e786d46b36 100644 --- a/Items/Weapons/Rogue/LeadTomahawk.cs +++ b/Items/Weapons/Rogue/LeadTomahawk.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class LeadTomahawk : ModItem + public class LeadTomahawk : RogueWeapon { public override void SetStaticDefaults() { @@ -39,11 +39,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/LeonidProgenitor.cs b/Items/Weapons/Rogue/LeonidProgenitor.cs index 61e2f40583..f2bde4ba13 100644 --- a/Items/Weapons/Rogue/LeonidProgenitor.cs +++ b/Items/Weapons/Rogue/LeonidProgenitor.cs @@ -8,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class LeonidProgenitor : ModItem + public class LeonidProgenitor : RogueWeapon { public static readonly Color blueColor = new Color(48, 208, 255); public static readonly Color purpleColor = new Color(208, 125, 218); @@ -68,11 +68,6 @@ namespace CalamityMod.Items.Weapons.Rogue return 0.8f; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { float stealthDamageFactor = player.Calamity().StealthStrikeAvailable() ? 1.25f : 1f; diff --git a/Items/Weapons/Rogue/LeviathanTeeth.cs b/Items/Weapons/Rogue/LeviathanTeeth.cs index f02c3c6fd7..8b491446df 100644 --- a/Items/Weapons/Rogue/LeviathanTeeth.cs +++ b/Items/Weapons/Rogue/LeviathanTeeth.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class LeviathanTeeth : ModItem + public class LeviathanTeeth : RogueWeapon { public override void SetStaticDefaults() { @@ -38,11 +38,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { bool stealthStrike = false; diff --git a/Items/Weapons/Rogue/Lionfish.cs b/Items/Weapons/Rogue/Lionfish.cs index 79d6041b96..fab062fe35 100644 --- a/Items/Weapons/Rogue/Lionfish.cs +++ b/Items/Weapons/Rogue/Lionfish.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class Lionfish : ModItem + public class Lionfish : RogueWeapon { public override void SetStaticDefaults() { @@ -37,11 +37,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike diff --git a/Items/Weapons/Rogue/LuminousStriker.cs b/Items/Weapons/Rogue/LuminousStriker.cs index 8657d9e752..926e570b7d 100644 --- a/Items/Weapons/Rogue/LuminousStriker.cs +++ b/Items/Weapons/Rogue/LuminousStriker.cs @@ -8,7 +8,7 @@ using Microsoft.Xna.Framework; namespace CalamityMod.Items.Weapons.Rogue { - public class LuminousStriker : ModItem + public class LuminousStriker : RogueWeapon { public override void SetStaticDefaults() { @@ -40,11 +40,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { int proj = Projectile.NewProjectile(source, position, velocity, type, (int)(damage * 1.25f), knockback, player.whoAmI); diff --git a/Items/Weapons/Rogue/LunarKunai.cs b/Items/Weapons/Rogue/LunarKunai.cs index 0da690df55..dceeecbc34 100644 --- a/Items/Weapons/Rogue/LunarKunai.cs +++ b/Items/Weapons/Rogue/LunarKunai.cs @@ -8,7 +8,7 @@ using CalamityMod.Projectiles.Rogue; namespace CalamityMod.Items.Weapons.Rogue { - public class LunarKunai : ModItem + public class LunarKunai : RogueWeapon { public override void SetStaticDefaults() { @@ -41,11 +41,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { float num72 = Item.shootSpeed; diff --git a/Items/Weapons/Rogue/Malachite.cs b/Items/Weapons/Rogue/Malachite.cs index c2e1667368..80ea64f05e 100644 --- a/Items/Weapons/Rogue/Malachite.cs +++ b/Items/Weapons/Rogue/Malachite.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class Malachite : ModItem + public class Malachite : RogueWeapon { public override void SetStaticDefaults() { @@ -68,11 +68,6 @@ namespace CalamityMod.Items.Weapons.Rogue return 2f; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { float dmgMult = 1f; diff --git a/Items/Weapons/Rogue/MangroveChakram.cs b/Items/Weapons/Rogue/MangroveChakram.cs index 065b0cbe94..2cf2daec4a 100644 --- a/Items/Weapons/Rogue/MangroveChakram.cs +++ b/Items/Weapons/Rogue/MangroveChakram.cs @@ -8,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class MangroveChakram : ModItem + public class MangroveChakram : RogueWeapon { public override void SetStaticDefaults() { @@ -37,11 +37,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/MetalMonstrosity.cs b/Items/Weapons/Rogue/MetalMonstrosity.cs index 1090cd6c11..6983d31850 100644 --- a/Items/Weapons/Rogue/MetalMonstrosity.cs +++ b/Items/Weapons/Rogue/MetalMonstrosity.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class MetalMonstrosity : ModItem + public class MetalMonstrosity : RogueWeapon { public override void SetStaticDefaults() { @@ -40,11 +40,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { int proj = Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI); diff --git a/Items/Weapons/Rogue/MeteorFist.cs b/Items/Weapons/Rogue/MeteorFist.cs index efa0163d74..f9fb0bb411 100644 --- a/Items/Weapons/Rogue/MeteorFist.cs +++ b/Items/Weapons/Rogue/MeteorFist.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class MeteorFist : ModItem + public class MeteorFist : RogueWeapon { public override void SetStaticDefaults() { @@ -38,11 +38,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/MoltenAmputator.cs b/Items/Weapons/Rogue/MoltenAmputator.cs index a4360e21ad..1a058971b4 100644 --- a/Items/Weapons/Rogue/MoltenAmputator.cs +++ b/Items/Weapons/Rogue/MoltenAmputator.cs @@ -8,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class MoltenAmputator : ModItem + public class MoltenAmputator : RogueWeapon { public const float Speed = 21f; @@ -40,11 +40,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/MonkeyDarts.cs b/Items/Weapons/Rogue/MonkeyDarts.cs index faef5468c4..9408a71556 100644 --- a/Items/Weapons/Rogue/MonkeyDarts.cs +++ b/Items/Weapons/Rogue/MonkeyDarts.cs @@ -8,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class MonkeyDarts : ModItem + public class MonkeyDarts : RogueWeapon { public override void SetStaticDefaults() { @@ -42,11 +42,6 @@ namespace CalamityMod.Items.Weapons.Rogue // Terraria seems to really dislike high crit values in SetDefaults public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 18; - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { //Checks if stealth is avalaible to shoot a spread of 3 darts diff --git a/Items/Weapons/Rogue/Mycoroot.cs b/Items/Weapons/Rogue/Mycoroot.cs index 8b455edac4..9a1ee27983 100644 --- a/Items/Weapons/Rogue/Mycoroot.cs +++ b/Items/Weapons/Rogue/Mycoroot.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class Mycoroot : ModItem + public class Mycoroot : RogueWeapon { public override void SetStaticDefaults() { @@ -37,11 +37,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { int stealth = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, 0f, 0f); diff --git a/Items/Weapons/Rogue/MythrilKnife.cs b/Items/Weapons/Rogue/MythrilKnife.cs index 71e74eec5a..0a5a243d27 100644 --- a/Items/Weapons/Rogue/MythrilKnife.cs +++ b/Items/Weapons/Rogue/MythrilKnife.cs @@ -6,7 +6,7 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class MythrilKnife : ModItem + public class MythrilKnife : RogueWeapon { public override void SetStaticDefaults() { @@ -37,11 +37,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/NanoblackReaper.cs b/Items/Weapons/Rogue/NanoblackReaper.cs index 5247147bcd..0709ef2d95 100644 --- a/Items/Weapons/Rogue/NanoblackReaper.cs +++ b/Items/Weapons/Rogue/NanoblackReaper.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Rogue { // Deny me no longer! [LegacyName("NanoblackReaperMelee", "NanoblackReaperRogue")] - public class NanoblackReaper : ModItem + public class NanoblackReaper : RogueWeapon { public static int BaseDamage = 130; public static float Knockback = 9f; @@ -52,11 +52,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.shootSpeed = Speed; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/NastyCholla.cs b/Items/Weapons/Rogue/NastyCholla.cs index fdec5d56e8..392bc5dfaa 100644 --- a/Items/Weapons/Rogue/NastyCholla.cs +++ b/Items/Weapons/Rogue/NastyCholla.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class NastyCholla : ModItem + public class NastyCholla : RogueWeapon { public static int BaseDamage = 9; @@ -42,11 +42,6 @@ Stealth strikes throw five at once"); Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike diff --git a/Items/Weapons/Rogue/NightsGaze.cs b/Items/Weapons/Rogue/NightsGaze.cs index 859c1cae76..6ff2c3df15 100644 --- a/Items/Weapons/Rogue/NightsGaze.cs +++ b/Items/Weapons/Rogue/NightsGaze.cs @@ -11,7 +11,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class NightsGaze : ModItem + public class NightsGaze : RogueWeapon { public override void SetStaticDefaults() { @@ -43,11 +43,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/Nychthemeron.cs b/Items/Weapons/Rogue/Nychthemeron.cs index ab85e47620..85cb07d3bb 100644 --- a/Items/Weapons/Rogue/Nychthemeron.cs +++ b/Items/Weapons/Rogue/Nychthemeron.cs @@ -8,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class Nychthemeron : ModItem + public class Nychthemeron : RogueWeapon { public override void SetStaticDefaults() { @@ -55,11 +55,6 @@ namespace CalamityMod.Items.Weapons.Rogue return true; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { int orbDamage = (int)(damage * 0.75f); diff --git a/Items/Weapons/Rogue/OrichalcumSpikedGemstone.cs b/Items/Weapons/Rogue/OrichalcumSpikedGemstone.cs index b4b039a503..be727d5988 100644 --- a/Items/Weapons/Rogue/OrichalcumSpikedGemstone.cs +++ b/Items/Weapons/Rogue/OrichalcumSpikedGemstone.cs @@ -6,7 +6,7 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class OrichalcumSpikedGemstone : ModItem + public class OrichalcumSpikedGemstone : RogueWeapon { public override void SetStaticDefaults() { @@ -38,11 +38,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/PalladiumJavelin.cs b/Items/Weapons/Rogue/PalladiumJavelin.cs index cb838174e5..cd3e3943f3 100644 --- a/Items/Weapons/Rogue/PalladiumJavelin.cs +++ b/Items/Weapons/Rogue/PalladiumJavelin.cs @@ -6,7 +6,7 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class PalladiumJavelin : ModItem + public class PalladiumJavelin : RogueWeapon { public override void SetStaticDefaults() { @@ -38,11 +38,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/Penumbra.cs b/Items/Weapons/Rogue/Penumbra.cs index bb252c95e7..72beb71f0b 100644 --- a/Items/Weapons/Rogue/Penumbra.cs +++ b/Items/Weapons/Rogue/Penumbra.cs @@ -10,7 +10,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class Penumbra : ModItem + public class Penumbra : RogueWeapon { public static float ShootSpeed = 8f; public override void SetStaticDefaults() @@ -46,11 +46,6 @@ namespace CalamityMod.Items.Weapons.Rogue // Terraria seems to really dislike high crit values in SetDefaults public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 16; - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/PhantasmalRuin.cs b/Items/Weapons/Rogue/PhantasmalRuin.cs index 221904967e..b0ae83b4e3 100644 --- a/Items/Weapons/Rogue/PhantasmalRuin.cs +++ b/Items/Weapons/Rogue/PhantasmalRuin.cs @@ -9,7 +9,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class PhantasmalRuin : ModItem + public class PhantasmalRuin : RogueWeapon { public override void SetStaticDefaults() { @@ -42,11 +42,6 @@ Stealth strikes continuously leave spectral clones in their wake"); Item.rare = ModContent.RarityType(); } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/PhantomLance.cs b/Items/Weapons/Rogue/PhantomLance.cs index b1a7f5a757..2ccb83658f 100644 --- a/Items/Weapons/Rogue/PhantomLance.cs +++ b/Items/Weapons/Rogue/PhantomLance.cs @@ -8,7 +8,7 @@ using Microsoft.Xna.Framework; namespace CalamityMod.Items.Weapons.Rogue { - public class PhantomLance : ModItem + public class PhantomLance : RogueWeapon { public override void SetStaticDefaults() { @@ -45,11 +45,6 @@ Stealth strikes don't slow down and souls always deal full damage"); Item.shoot = ModContent.ProjectileType(); } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike diff --git a/Items/Weapons/Rogue/Plaguenade.cs b/Items/Weapons/Rogue/Plaguenade.cs index 52e85e99ce..88faa2b065 100644 --- a/Items/Weapons/Rogue/Plaguenade.cs +++ b/Items/Weapons/Rogue/Plaguenade.cs @@ -8,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class Plaguenade : ModItem + public class Plaguenade : RogueWeapon { public override void SetStaticDefaults() { @@ -41,11 +41,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/PoisonPack.cs b/Items/Weapons/Rogue/PoisonPack.cs index bcd48c8230..cb5ab022c5 100644 --- a/Items/Weapons/Rogue/PoisonPack.cs +++ b/Items/Weapons/Rogue/PoisonPack.cs @@ -8,7 +8,7 @@ using CalamityMod.CalPlayer; namespace CalamityMod.Items.Weapons.Rogue { - public class PoisonPack : ModItem + public class PoisonPack : RogueWeapon { private static int baseDamage = 20; private static float baseKnockback = 1.8f; @@ -63,11 +63,6 @@ namespace CalamityMod.Items.Weapons.Rogue } } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { CalamityPlayer modPlayer = player.Calamity(); diff --git a/Items/Weapons/Rogue/Prismalline.cs b/Items/Weapons/Rogue/Prismalline.cs index d532c1dce1..38c5d74a52 100644 --- a/Items/Weapons/Rogue/Prismalline.cs +++ b/Items/Weapons/Rogue/Prismalline.cs @@ -9,7 +9,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class Prismalline : ModItem + public class Prismalline : RogueWeapon { public override void SetStaticDefaults() { @@ -42,11 +42,6 @@ namespace CalamityMod.Items.Weapons.Rogue // Terraria seems to really dislike high crit values in SetDefaults public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 4; - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/ProfanedPartisan.cs b/Items/Weapons/Rogue/ProfanedPartisan.cs index 9344191a5b..04aaebe0c1 100644 --- a/Items/Weapons/Rogue/ProfanedPartisan.cs +++ b/Items/Weapons/Rogue/ProfanedPartisan.cs @@ -9,7 +9,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class ProfanedPartisan : ModItem + public class ProfanedPartisan : RogueWeapon { public override void SetStaticDefaults() { @@ -45,11 +45,6 @@ Stealth strikes spawn smaller spears to fly along side it"); // Terraria seems to really dislike high crit values in SetDefaults public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 15; - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike diff --git a/Items/Weapons/Rogue/RadiantStar.cs b/Items/Weapons/Rogue/RadiantStar.cs index 85ff8007c1..f4282fe01d 100644 --- a/Items/Weapons/Rogue/RadiantStar.cs +++ b/Items/Weapons/Rogue/RadiantStar.cs @@ -9,7 +9,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class RadiantStar : ModItem + public class RadiantStar : RogueWeapon { public override void SetStaticDefaults() { @@ -42,11 +42,6 @@ namespace CalamityMod.Items.Weapons.Rogue // Terraria seems to really dislike high crit values in SetDefaults public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 8; - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/RefractionRotor.cs b/Items/Weapons/Rogue/RefractionRotor.cs index 67aadc8a89..726643515f 100644 --- a/Items/Weapons/Rogue/RefractionRotor.cs +++ b/Items/Weapons/Rogue/RefractionRotor.cs @@ -8,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class RefractionRotor : ModItem + public class RefractionRotor : RogueWeapon { public override void SetStaticDefaults() { @@ -38,11 +38,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.rare = ModContent.RarityType(); } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/RegulusRiot.cs b/Items/Weapons/Rogue/RegulusRiot.cs index 92c2ad8f3a..ee83e53200 100644 --- a/Items/Weapons/Rogue/RegulusRiot.cs +++ b/Items/Weapons/Rogue/RegulusRiot.cs @@ -7,7 +7,7 @@ using Microsoft.Xna.Framework; namespace CalamityMod.Items.Weapons.Rogue { - public class RegulusRiot : ModItem + public class RegulusRiot : RogueWeapon { public override void SetStaticDefaults() { @@ -40,11 +40,6 @@ Stealth strikes explode into energy stars"); Item.shoot = ModContent.ProjectileType(); } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike diff --git a/Items/Weapons/Rogue/RogueWeapon.cs b/Items/Weapons/Rogue/RogueWeapon.cs new file mode 100644 index 0000000000..d71dcde21e --- /dev/null +++ b/Items/Weapons/Rogue/RogueWeapon.cs @@ -0,0 +1,12 @@ +using Terraria.ModLoader; +using static Terraria.ID.ContentSamples.CreativeHelper; + +namespace CalamityMod.Items.Weapons.Rogue +{ + public abstract class RogueWeapon : ModItem + { + public override bool RangedPrefix() => false; + + public override void ModifyResearchSorting(ref ItemGroup itemGroup) => itemGroup = (ItemGroup)CalamityResearchSorting.RogueWeapon; + } +} diff --git a/Items/Weapons/Rogue/RotBall.cs b/Items/Weapons/Rogue/RotBall.cs index ccb39b572b..57ee8fdfae 100644 --- a/Items/Weapons/Rogue/RotBall.cs +++ b/Items/Weapons/Rogue/RotBall.cs @@ -8,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class RotBall : ModItem + public class RotBall : RogueWeapon { public override void SetStaticDefaults() { @@ -42,11 +42,6 @@ namespace CalamityMod.Items.Weapons.Rogue // Terraria seems to really dislike high crit values in SetDefaults public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 8; - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike diff --git a/Items/Weapons/Rogue/Sacrifice.cs b/Items/Weapons/Rogue/Sacrifice.cs index cf47f2724b..ce46989ca0 100644 --- a/Items/Weapons/Rogue/Sacrifice.cs +++ b/Items/Weapons/Rogue/Sacrifice.cs @@ -9,7 +9,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class Sacrifice : ModItem + public class Sacrifice : RogueWeapon { public override void SetStaticDefaults() { @@ -42,11 +42,6 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool AltFunctionUse(Player player) => player.ownedProjectileCounts[Item.shoot] > 0; - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.altFunctionUse == 2) diff --git a/Items/Weapons/Rogue/SandDollar.cs b/Items/Weapons/Rogue/SandDollar.cs index 0c0b51ae5a..f302998958 100644 --- a/Items/Weapons/Rogue/SandDollar.cs +++ b/Items/Weapons/Rogue/SandDollar.cs @@ -8,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class SandDollar : ModItem + public class SandDollar : RogueWeapon { public override void SetStaticDefaults() { @@ -53,11 +53,6 @@ namespace CalamityMod.Items.Weapons.Rogue } } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike diff --git a/Items/Weapons/Rogue/Sandslasher.cs b/Items/Weapons/Rogue/Sandslasher.cs index aaa9baf17b..c497629e31 100644 --- a/Items/Weapons/Rogue/Sandslasher.cs +++ b/Items/Weapons/Rogue/Sandslasher.cs @@ -8,7 +8,7 @@ using CalamityMod.Projectiles.Rogue; namespace CalamityMod.Items.Weapons.Rogue { - public class Sandslasher : ModItem + public class Sandslasher : RogueWeapon { public override void SetStaticDefaults() { @@ -39,11 +39,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/ScarletDevil.cs b/Items/Weapons/Rogue/ScarletDevil.cs index ce9b23830b..b96c8c32fe 100644 --- a/Items/Weapons/Rogue/ScarletDevil.cs +++ b/Items/Weapons/Rogue/ScarletDevil.cs @@ -10,7 +10,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class ScarletDevil : ModItem + public class ScarletDevil : RogueWeapon { public override void SetStaticDefaults() { @@ -43,11 +43,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.Calamity().devItem = true; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { int proj = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); diff --git a/Items/Weapons/Rogue/ScourgeoftheDesert.cs b/Items/Weapons/Rogue/ScourgeoftheDesert.cs index 6e17f316fe..85d47c5273 100644 --- a/Items/Weapons/Rogue/ScourgeoftheDesert.cs +++ b/Items/Weapons/Rogue/ScourgeoftheDesert.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class ScourgeoftheDesert : ModItem + public class ScourgeoftheDesert : RogueWeapon { public override void SetStaticDefaults() { @@ -37,11 +37,6 @@ Stealth strikes gain damage as they damage enemies"); Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/ScourgeoftheSeas.cs b/Items/Weapons/Rogue/ScourgeoftheSeas.cs index 62ec6607f6..5589b801b1 100644 --- a/Items/Weapons/Rogue/ScourgeoftheSeas.cs +++ b/Items/Weapons/Rogue/ScourgeoftheSeas.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class ScourgeoftheSeas : ModItem + public class ScourgeoftheSeas : RogueWeapon { public override void SetStaticDefaults() { @@ -37,11 +37,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.value = CalamityGlobalItem.Rarity6BuyPrice; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike diff --git a/Items/Weapons/Rogue/SeafoamBomb.cs b/Items/Weapons/Rogue/SeafoamBomb.cs index 33e45aac82..75fbec3e64 100644 --- a/Items/Weapons/Rogue/SeafoamBomb.cs +++ b/Items/Weapons/Rogue/SeafoamBomb.cs @@ -9,7 +9,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class SeafoamBomb : ModItem + public class SeafoamBomb : RogueWeapon { public override void SetStaticDefaults() { @@ -39,11 +39,6 @@ Stealth strikes are faster and explode into 5 bubbles"); Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/SealedSingularity.cs b/Items/Weapons/Rogue/SealedSingularity.cs index 91ee0d2bea..0ba8dc410c 100644 --- a/Items/Weapons/Rogue/SealedSingularity.cs +++ b/Items/Weapons/Rogue/SealedSingularity.cs @@ -9,7 +9,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class SealedSingularity : ModItem + public class SealedSingularity : RogueWeapon { public override void SetStaticDefaults() { @@ -39,11 +39,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.Calamity().donorItem = true; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/SearedPan.cs b/Items/Weapons/Rogue/SearedPan.cs index c797383a3d..a2c6dfad58 100644 --- a/Items/Weapons/Rogue/SearedPan.cs +++ b/Items/Weapons/Rogue/SearedPan.cs @@ -11,7 +11,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class SearedPan : ModItem + public class SearedPan : RogueWeapon { public static readonly SoundStyle SmashSound = new("CalamityMod/Sounds/Item/SearedPanSmash"); @@ -52,11 +52,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.Calamity().donorItem = true; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { float mode = 1f; diff --git a/Items/Weapons/Rogue/Seraphim.cs b/Items/Weapons/Rogue/Seraphim.cs index 4f5acac6cc..02d55dc82a 100644 --- a/Items/Weapons/Rogue/Seraphim.cs +++ b/Items/Weapons/Rogue/Seraphim.cs @@ -10,7 +10,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class Seraphim : ModItem + public class Seraphim : RogueWeapon { public const int SplitDaggerCount = 6; public const int StealthStrikeLightCount = 7; @@ -44,11 +44,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { diff --git a/Items/Weapons/Rogue/ShardofAntumbra.cs b/Items/Weapons/Rogue/ShardofAntumbra.cs index ebe6449b9e..fafe0939a6 100644 --- a/Items/Weapons/Rogue/ShardofAntumbra.cs +++ b/Items/Weapons/Rogue/ShardofAntumbra.cs @@ -9,7 +9,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { [LegacyName("XerocPitchfork")] - public class ShardofAntumbra : ModItem + public class ShardofAntumbra : RogueWeapon { public override void SetStaticDefaults() { @@ -40,11 +40,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/ShatteredSun.cs b/Items/Weapons/Rogue/ShatteredSun.cs index 21dbeb9e8d..dd340640b7 100644 --- a/Items/Weapons/Rogue/ShatteredSun.cs +++ b/Items/Weapons/Rogue/ShatteredSun.cs @@ -9,7 +9,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class ShatteredSun : ModItem + public class ShatteredSun : RogueWeapon { public override void SetStaticDefaults() { @@ -42,11 +42,6 @@ namespace CalamityMod.Items.Weapons.Rogue // Terraria seems to really dislike high crit values in SetDefaults public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 10; - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/ShinobiBlade.cs b/Items/Weapons/Rogue/ShinobiBlade.cs index 86e4c6f356..0abf32a92b 100644 --- a/Items/Weapons/Rogue/ShinobiBlade.cs +++ b/Items/Weapons/Rogue/ShinobiBlade.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class ShinobiBlade : ModItem + public class ShinobiBlade : RogueWeapon { public override void SetStaticDefaults() { @@ -38,11 +38,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/ShockGrenade.cs b/Items/Weapons/Rogue/ShockGrenade.cs index 6e98feb736..2eb5f7dab5 100644 --- a/Items/Weapons/Rogue/ShockGrenade.cs +++ b/Items/Weapons/Rogue/ShockGrenade.cs @@ -8,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class ShockGrenade : ModItem + public class ShockGrenade : RogueWeapon { public override void SetStaticDefaults() { @@ -39,11 +39,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/SkyStabber.cs b/Items/Weapons/Rogue/SkyStabber.cs index 0226142e51..ebf8aeb7ac 100644 --- a/Items/Weapons/Rogue/SkyStabber.cs +++ b/Items/Weapons/Rogue/SkyStabber.cs @@ -9,7 +9,7 @@ using CalamityMod.CalPlayer; namespace CalamityMod.Items.Weapons.Rogue { - public class SkyStabber : ModItem + public class SkyStabber : RogueWeapon { private static int damage = 50; private static int knockBack = 2; @@ -64,11 +64,6 @@ namespace CalamityMod.Items.Weapons.Rogue } } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { CalamityPlayer modPlayer = player.Calamity(); diff --git a/Items/Weapons/Rogue/SkyfinBombers.cs b/Items/Weapons/Rogue/SkyfinBombers.cs index 860f3f4c73..b96eacf2a1 100644 --- a/Items/Weapons/Rogue/SkyfinBombers.cs +++ b/Items/Weapons/Rogue/SkyfinBombers.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class SkyfinBombers : ModItem + public class SkyfinBombers : RogueWeapon { public override void SetStaticDefaults() { @@ -38,11 +38,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike diff --git a/Items/Weapons/Rogue/SlickCane.cs b/Items/Weapons/Rogue/SlickCane.cs index 9ec8d1bb93..99c9eb505e 100644 --- a/Items/Weapons/Rogue/SlickCane.cs +++ b/Items/Weapons/Rogue/SlickCane.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class SlickCane : ModItem + public class SlickCane : RogueWeapon { public override void SetStaticDefaults() { @@ -42,11 +42,6 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { float ai0 = Main.rand.NextFloat() * Item.shootSpeed * 0.75f * (float)player.direction; diff --git a/Items/Weapons/Rogue/SludgeSplotch.cs b/Items/Weapons/Rogue/SludgeSplotch.cs index 10f723addd..3422597972 100644 --- a/Items/Weapons/Rogue/SludgeSplotch.cs +++ b/Items/Weapons/Rogue/SludgeSplotch.cs @@ -9,7 +9,7 @@ using Terraria.Audio; namespace CalamityMod.Items.Weapons.Rogue { - public class SludgeSplotch : ModItem + public class SludgeSplotch : RogueWeapon { public override void SetStaticDefaults() { @@ -40,11 +40,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { SoundEngine.PlaySound(SoundID.NPCDeath9 with { Volume = SoundID.NPCDeath9.Volume * 2f }, player.position); diff --git a/Items/Weapons/Rogue/SnapClam.cs b/Items/Weapons/Rogue/SnapClam.cs index e3e888d814..5c85fb5587 100644 --- a/Items/Weapons/Rogue/SnapClam.cs +++ b/Items/Weapons/Rogue/SnapClam.cs @@ -8,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class SnapClam : ModItem + public class SnapClam : RogueWeapon { public override void SetStaticDefaults() { @@ -39,11 +39,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike diff --git a/Items/Weapons/Rogue/SpearofDestiny.cs b/Items/Weapons/Rogue/SpearofDestiny.cs index a2d4aa14f6..6b8edaee9c 100644 --- a/Items/Weapons/Rogue/SpearofDestiny.cs +++ b/Items/Weapons/Rogue/SpearofDestiny.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class SpearofDestiny : ModItem + public class SpearofDestiny : RogueWeapon { public override void SetStaticDefaults() { @@ -37,11 +37,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { int index = 7; diff --git a/Items/Weapons/Rogue/SpearofPaleolith.cs b/Items/Weapons/Rogue/SpearofPaleolith.cs index e0c10e550e..f4cc535cbf 100644 --- a/Items/Weapons/Rogue/SpearofPaleolith.cs +++ b/Items/Weapons/Rogue/SpearofPaleolith.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class SpearofPaleolith : ModItem + public class SpearofPaleolith : RogueWeapon { public override void SetStaticDefaults() { @@ -38,11 +38,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/SpentFuelContainer.cs b/Items/Weapons/Rogue/SpentFuelContainer.cs index 1cd5995900..35d4d1a36b 100644 --- a/Items/Weapons/Rogue/SpentFuelContainer.cs +++ b/Items/Weapons/Rogue/SpentFuelContainer.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class SpentFuelContainer : ModItem + public class SpentFuelContainer : RogueWeapon { public override void SetStaticDefaults() diff --git a/Items/Weapons/Rogue/StarofDestruction.cs b/Items/Weapons/Rogue/StarofDestruction.cs index 6de5bc1555..c22cd95956 100644 --- a/Items/Weapons/Rogue/StarofDestruction.cs +++ b/Items/Weapons/Rogue/StarofDestruction.cs @@ -8,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class StarofDestruction : ModItem + public class StarofDestruction : RogueWeapon { public override void SetStaticDefaults() { @@ -38,11 +38,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike diff --git a/Items/Weapons/Rogue/StellarKnife.cs b/Items/Weapons/Rogue/StellarKnife.cs index 75c460ab65..96ddb566f0 100644 --- a/Items/Weapons/Rogue/StellarKnife.cs +++ b/Items/Weapons/Rogue/StellarKnife.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class StellarKnife : ModItem + public class StellarKnife : RogueWeapon { int knifeCount = 10; int knifeLimit = 20; @@ -43,11 +43,6 @@ namespace CalamityMod.Items.Weapons.Rogue // Terraria seems to really dislike high crit values in SetDefaults public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 4; - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable() && player.ownedProjectileCounts[Item.shoot] < knifeLimit) diff --git a/Items/Weapons/Rogue/StickySpikyBall.cs b/Items/Weapons/Rogue/StickySpikyBall.cs index 0b23593664..035ed78b17 100644 --- a/Items/Weapons/Rogue/StickySpikyBall.cs +++ b/Items/Weapons/Rogue/StickySpikyBall.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class StickySpikyBall : ModItem + public class StickySpikyBall : RogueWeapon { public override void SetStaticDefaults() { @@ -38,11 +38,6 @@ Stealth strikes throw seven at once and last a lot longer"); Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike diff --git a/Items/Weapons/Rogue/StormfrontRazor.cs b/Items/Weapons/Rogue/StormfrontRazor.cs index c5179b6433..91bad534fe 100644 --- a/Items/Weapons/Rogue/StormfrontRazor.cs +++ b/Items/Weapons/Rogue/StormfrontRazor.cs @@ -9,7 +9,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class StormfrontRazor : ModItem + public class StormfrontRazor : RogueWeapon { public override void SetStaticDefaults() { @@ -44,11 +44,6 @@ namespace CalamityMod.Items.Weapons.Rogue // Terraria seems to really dislike high crit values in SetDefaults public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 8; - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/SubductionSlicer.cs b/Items/Weapons/Rogue/SubductionSlicer.cs index ca814c534a..a1f87c1880 100644 --- a/Items/Weapons/Rogue/SubductionSlicer.cs +++ b/Items/Weapons/Rogue/SubductionSlicer.cs @@ -9,7 +9,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { [LegacyName("FlameScythe")] - public class SubductionSlicer : ModItem + public class SubductionSlicer : RogueWeapon { public override void SetStaticDefaults() { @@ -39,11 +39,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { int proj = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); diff --git a/Items/Weapons/Rogue/Supernova.cs b/Items/Weapons/Rogue/Supernova.cs index abd2b0a60c..17f4d80575 100644 --- a/Items/Weapons/Rogue/Supernova.cs +++ b/Items/Weapons/Rogue/Supernova.cs @@ -10,7 +10,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class Supernova : ModItem + public class Supernova : RogueWeapon { public override void SetStaticDefaults() { @@ -41,11 +41,6 @@ Stealth strikes release energy as they fly"); Item.rare = ModContent.RarityType(); } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike diff --git a/Items/Weapons/Rogue/TarragonThrowingDart.cs b/Items/Weapons/Rogue/TarragonThrowingDart.cs index aa1705f4a0..f6795961be 100644 --- a/Items/Weapons/Rogue/TarragonThrowingDart.cs +++ b/Items/Weapons/Rogue/TarragonThrowingDart.cs @@ -9,7 +9,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class TarragonThrowingDart : ModItem + public class TarragonThrowingDart : RogueWeapon { public override void SetStaticDefaults() { @@ -41,11 +41,6 @@ Stealth strikes erupt into thorns on enemy hits"); Item.rare = ModContent.RarityType(); } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike diff --git a/Items/Weapons/Rogue/TerraDisk.cs b/Items/Weapons/Rogue/TerraDisk.cs index 46d0ea996d..9d446ffac8 100644 --- a/Items/Weapons/Rogue/TerraDisk.cs +++ b/Items/Weapons/Rogue/TerraDisk.cs @@ -8,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class TerraDisk : ModItem + public class TerraDisk : RogueWeapon { public static int BaseDamage = 100; public static float Speed = 12f; @@ -64,11 +64,6 @@ Stealth strikes travel slower and are rapidly orbited by the smaller disks"); return terraDiskCount < 3; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/TerrorTalons.cs b/Items/Weapons/Rogue/TerrorTalons.cs index 99f1c7e092..111d3a800f 100644 --- a/Items/Weapons/Rogue/TerrorTalons.cs +++ b/Items/Weapons/Rogue/TerrorTalons.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class TerrorTalons : ModItem + public class TerrorTalons : RogueWeapon { private float sign = 1f; @@ -39,11 +39,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike diff --git a/Items/Weapons/Rogue/TheAtomSplitter.cs b/Items/Weapons/Rogue/TheAtomSplitter.cs index 229b67a6bd..67a9f5a602 100644 --- a/Items/Weapons/Rogue/TheAtomSplitter.cs +++ b/Items/Weapons/Rogue/TheAtomSplitter.cs @@ -8,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class TheAtomSplitter : ModItem + public class TheAtomSplitter : RogueWeapon { public override void SetStaticDefaults() { @@ -37,11 +37,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.rare = ModContent.RarityType(); } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { int javelin = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, -1f); diff --git a/Items/Weapons/Rogue/TheReaper.cs b/Items/Weapons/Rogue/TheReaper.cs index e7fbf0d1f4..50871c2ef4 100644 --- a/Items/Weapons/Rogue/TheReaper.cs +++ b/Items/Weapons/Rogue/TheReaper.cs @@ -8,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class TheReaper : ModItem + public class TheReaper : RogueWeapon { public override void SetStaticDefaults() { @@ -39,11 +39,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.rare = ModContent.RarityType(); } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike diff --git a/Items/Weapons/Rogue/TheSyringe.cs b/Items/Weapons/Rogue/TheSyringe.cs index 85ac17ebf5..ddb6601bf5 100644 --- a/Items/Weapons/Rogue/TheSyringe.cs +++ b/Items/Weapons/Rogue/TheSyringe.cs @@ -7,7 +7,7 @@ using CalamityMod.Projectiles.Rogue; namespace CalamityMod.Items.Weapons.Rogue { - public class TheSyringe : ModItem + public class TheSyringe : RogueWeapon { public static int BaseDamage = 60; public static float Knockback = 5f; @@ -43,11 +43,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/ThrowingBrick.cs b/Items/Weapons/Rogue/ThrowingBrick.cs index 2f47f8cb0c..648743b81f 100644 --- a/Items/Weapons/Rogue/ThrowingBrick.cs +++ b/Items/Weapons/Rogue/ThrowingBrick.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class ThrowingBrick : ModItem + public class ThrowingBrick : RogueWeapon { public override void SetStaticDefaults() { @@ -39,11 +39,6 @@ namespace CalamityMod.Items.Weapons.Rogue // Terraria seems to really dislike high crit values in SetDefaults public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 20; - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { //Check if stealth is full diff --git a/Items/Weapons/Rogue/TimeBolt.cs b/Items/Weapons/Rogue/TimeBolt.cs index ae67c0491f..e5a281b8e5 100644 --- a/Items/Weapons/Rogue/TimeBolt.cs +++ b/Items/Weapons/Rogue/TimeBolt.cs @@ -9,7 +9,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class TimeBolt : ModItem + public class TimeBolt : RogueWeapon { public override void SetStaticDefaults() { @@ -40,11 +40,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/TitaniumShuriken.cs b/Items/Weapons/Rogue/TitaniumShuriken.cs index 2f13acfd72..d6ac51147c 100644 --- a/Items/Weapons/Rogue/TitaniumShuriken.cs +++ b/Items/Weapons/Rogue/TitaniumShuriken.cs @@ -6,7 +6,7 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class TitaniumShuriken : ModItem + public class TitaniumShuriken : RogueWeapon { public override void SetStaticDefaults() { @@ -40,11 +40,6 @@ namespace CalamityMod.Items.Weapons.Rogue // Terraria seems to really dislike high crit values in SetDefaults public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 10; - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike diff --git a/Items/Weapons/Rogue/ToothBall.cs b/Items/Weapons/Rogue/ToothBall.cs index 281ab14910..31b10ebe31 100644 --- a/Items/Weapons/Rogue/ToothBall.cs +++ b/Items/Weapons/Rogue/ToothBall.cs @@ -8,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class ToothBall : ModItem + public class ToothBall : RogueWeapon { public override void SetStaticDefaults() { @@ -42,11 +42,6 @@ namespace CalamityMod.Items.Weapons.Rogue // Terraria seems to really dislike high crit values in SetDefaults public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 8; - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike diff --git a/Items/Weapons/Rogue/TotalityBreakers.cs b/Items/Weapons/Rogue/TotalityBreakers.cs index c82ccfcfc3..61504c22d5 100644 --- a/Items/Weapons/Rogue/TotalityBreakers.cs +++ b/Items/Weapons/Rogue/TotalityBreakers.cs @@ -8,7 +8,7 @@ using Microsoft.Xna.Framework; namespace CalamityMod.Items.Weapons.Rogue { - public class TotalityBreakers : ModItem + public class TotalityBreakers : RogueWeapon { public override void SetStaticDefaults() { @@ -39,11 +39,6 @@ Stealth strikes leak tar as they fly"); Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike diff --git a/Items/Weapons/Rogue/ToxicantTwister.cs b/Items/Weapons/Rogue/ToxicantTwister.cs index 3ed271c903..256c89cb22 100644 --- a/Items/Weapons/Rogue/ToxicantTwister.cs +++ b/Items/Weapons/Rogue/ToxicantTwister.cs @@ -8,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class ToxicantTwister : ModItem + public class ToxicantTwister : RogueWeapon { public override void SetStaticDefaults() { @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 42; Item.height = 46; - Item.damage = 323; + Item.damage = 300; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = Item.useTime = 20; @@ -39,17 +39,17 @@ namespace CalamityMod.Items.Weapons.Rogue Item.rare = ModContent.RarityType(); } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - int boomer = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); - if (boomer.WithinBounds(Main.maxProjectiles)) - Main.projectile[boomer].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); - return false; + if (player.Calamity().StealthStrikeAvailable()) + { + damage = (int)(damage * 1.35f); + int boomer = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); + if (boomer.WithinBounds(Main.maxProjectiles)) + Main.projectile[boomer].Calamity().stealthStrike = true; + return false; + } + return true; } } } diff --git a/Items/Weapons/Rogue/Turbulance.cs b/Items/Weapons/Rogue/Turbulance.cs index b979404bc5..44fab4f7a7 100644 --- a/Items/Weapons/Rogue/Turbulance.cs +++ b/Items/Weapons/Rogue/Turbulance.cs @@ -8,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class Turbulance : ModItem + public class Turbulance : RogueWeapon { public override void SetStaticDefaults() { @@ -39,11 +39,6 @@ Stealth strikes are trailed by homing wind slashes"); Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike diff --git a/Items/Weapons/Rogue/UrchinStinger.cs b/Items/Weapons/Rogue/UrchinStinger.cs index 6881a39f19..cd630d1c6c 100644 --- a/Items/Weapons/Rogue/UrchinStinger.cs +++ b/Items/Weapons/Rogue/UrchinStinger.cs @@ -6,7 +6,7 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class UrchinStinger : ModItem + public class UrchinStinger : RogueWeapon { public override void SetStaticDefaults() { @@ -37,11 +37,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { int proj = Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0f, 0f); diff --git a/Items/Weapons/Rogue/UtensilPoker.cs b/Items/Weapons/Rogue/UtensilPoker.cs index a2f066a471..9a7c697f59 100644 --- a/Items/Weapons/Rogue/UtensilPoker.cs +++ b/Items/Weapons/Rogue/UtensilPoker.cs @@ -8,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class UtensilPoker : ModItem + public class UtensilPoker : RogueWeapon { private int counter = 0; public override void SetStaticDefaults() @@ -42,11 +42,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.shootSpeed = 12f; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { CalamityPlayer mp = player.Calamity(); diff --git a/Items/Weapons/Rogue/Valediction.cs b/Items/Weapons/Rogue/Valediction.cs index 3baebf3abe..840a1f6ca2 100644 --- a/Items/Weapons/Rogue/Valediction.cs +++ b/Items/Weapons/Rogue/Valediction.cs @@ -8,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class Valediction : ModItem + public class Valediction : RogueWeapon { public override void SetStaticDefaults() { @@ -39,11 +39,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.rare = ModContent.RarityType(); } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike diff --git a/Items/Weapons/Rogue/WaveSkipper.cs b/Items/Weapons/Rogue/WaveSkipper.cs index ac0c5f02ce..4185cee9f4 100644 --- a/Items/Weapons/Rogue/WaveSkipper.cs +++ b/Items/Weapons/Rogue/WaveSkipper.cs @@ -11,7 +11,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { [LegacyName("DuneHopper")] - public class WaveSkipper : ModItem + public class WaveSkipper : RogueWeapon { public override void SetStaticDefaults() { @@ -41,11 +41,6 @@ Stealth strikes throw three high speed spears"); Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/WebBall.cs b/Items/Weapons/Rogue/WebBall.cs index 9e4cdee347..bf5e2688de 100644 --- a/Items/Weapons/Rogue/WebBall.cs +++ b/Items/Weapons/Rogue/WebBall.cs @@ -7,7 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class WebBall : ModItem + public class WebBall : RogueWeapon { public override void SetStaticDefaults() { @@ -38,11 +38,6 @@ Stealth strikes slow enemies down longer"); Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike diff --git a/Items/Weapons/Rogue/Wrathwing.cs b/Items/Weapons/Rogue/Wrathwing.cs index 811032b856..ffe90f43ce 100644 --- a/Items/Weapons/Rogue/Wrathwing.cs +++ b/Items/Weapons/Rogue/Wrathwing.cs @@ -9,7 +9,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { [LegacyName("ProfanedTrident")] - public class Wrathwing : ModItem + public class Wrathwing : RogueWeapon { public override void SetStaticDefaults() { @@ -38,11 +38,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) diff --git a/Items/Weapons/Rogue/WulfrumKnife.cs b/Items/Weapons/Rogue/WulfrumKnife.cs index 9abc5b2de8..f0e5217d69 100644 --- a/Items/Weapons/Rogue/WulfrumKnife.cs +++ b/Items/Weapons/Rogue/WulfrumKnife.cs @@ -10,7 +10,7 @@ using CalamityMod.Particles; namespace CalamityMod.Items.Weapons.Rogue { - public class WulfrumKnife : ModItem + public class WulfrumKnife : RogueWeapon { public static readonly SoundStyle Throw3Sound = new("CalamityMod/Sounds/Item/WulfrumKnifeThrowFull") { PitchVariance = 0.4f }; public static readonly SoundStyle Throw2Sound = new("CalamityMod/Sounds/Item/WulfrumKnifeThrowTwo") { PitchVariance = 0.4f }; @@ -54,11 +54,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.RogueWeapon; - } - //Magnetization public override void HoldItem(Player player) { diff --git a/Localization/CalamityLocalization.cs b/Localization/CalamityLocalization.cs index f0fa24c013..fa9610dd42 100644 --- a/Localization/CalamityLocalization.cs +++ b/Localization/CalamityLocalization.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Localization new [] { "PlagueBossText", "PLAGUE NUKE BARRAGE ARMED, PREPARING FOR LAUNCH!!!" }, new [] { "PlagueBossText2", "MISSILES LAUNCHED, TARGETING ROUTINE INITIATED!!!" }, - new [] { "ProfanedBossText", "The air is burning..." }, + new [] { "ProfanedBossText", "Holy flames burn away at your wings..." }, new [] { "ProfanedBossText2", "Shrieks are echoing from the dungeon." }, new [] { "ProfanedBossText3", "The calamitous beings have been inundated with bloodstone." }, new [] { "ProfanedBossText4", "The Profaned Goddess has recognised your devotion to purity!" }, @@ -216,6 +216,8 @@ namespace CalamityMod.Localization new [] { "CometShardText", "You have already used a Comet Shard. Using more would make you nauseous." }, new [] { "EtherealCoreText", "You have already used an Ethereal Core. It's best to not use more than you are able to." }, new [] { "PhantomHeartText", "You have already used a Phantom Heart. It's probably good that you can't use another." }, + + new [] { "SlimeGodRun", "The Slime God flees to fight another day..." }, }; } diff --git a/Localization/enUS.hjson b/Localization/enUS.hjson index de7ab5f61f..18667e034e 100644 --- a/Localization/enUS.hjson +++ b/Localization/enUS.hjson @@ -158,7 +158,7 @@ ItemTooltip: ''' CragsPylon: ''' - Teleport to another pylon when 2 villagers are nearby + Teleport to another pylon The nature of the Crags allows you to teleport to this pylon without nearby villagers You can only place one per type and in the matching biome ''' diff --git a/ModSupport/ModCalls.cs b/ModSupport/ModCalls.cs index 0ccb3875e2..d8d8d371cc 100644 --- a/ModSupport/ModCalls.cs +++ b/ModSupport/ModCalls.cs @@ -1379,6 +1379,36 @@ namespace CalamityMod public static bool DisableAllDodges(bool disable) => Main.LocalPlayer.Calamity().disableAllDodges = disable; #endregion + #region Can Fire Point Blank Shots + /// + /// Gets whether the given item can fire point blank shots. + /// + /// The item which is being checked. + /// Whether the item can fire point blank shots. + public static bool CanFirePointBlank(Item it) + { + if (it is null || it.Calamity() is null) + return false; + CalamityGlobalItem cgi = it.Calamity(); + return cgi.canFirePointBlankShots; + } + + /// + /// Sets whether the given item can fire point blank shots. + /// + /// The item whose point blank capabilities is being toggled. + /// The value to apply. + /// Whether the item can fire point blank shots. + public static bool SetFirePointBlank(Item it, bool enabled) + { + if (it is null || it.Calamity() is null) + return false; + CalamityGlobalItem cgi = it.Calamity(); + cgi.canFirePointBlankShots = enabled; + return cgi.canFirePointBlankShots; + } + #endregion + #region Summoner Cross Class Nerf Disabling public static bool SetSummonerNerfDisabledByMinion(int type, bool disableNerf) { @@ -1625,6 +1655,26 @@ namespace CalamityMod return new ArgumentNullException("ERROR: Must specify a bool."); return SetBossHealthBarVisible(bossBarEnabled); + case "CanFirePointBlank": + case "CanFirePointBlankShots": + if (args.Length < 2) + return new ArgumentNullException("ERROR: Must specify an Item object (or int index of an Item in the Main.item array).");; + if (!isValidItemArg(args[1])) + return new ArgumentException("ERROR: The first argument to \"CanFirePointBlank\" must be an Item or an int."); + return CanFirePointBlank(castItem(args[1])); + + case "SetFirePointBlank": + case "SetFirePointBlankShots": + if (args.Length < 2) + return new ArgumentNullException("ERROR: Must specify both an Item object (or int index of an Item in the Main.item array) and a bool."); + if (args.Length < 3) + return new ArgumentNullException("ERROR: Must specify whether the item can fire point blank as a bool."); + if (!(args[2] is bool firePointBlank)) + return new ArgumentException("ERROR: The second argument to \"SetFirePointBlank\" must be a bool."); + if (!isValidItemArg(args[1])) + return new ArgumentException("ERROR: The first argument to \"SetFirePointBlank\" must be an Item or an int."); + return SetFirePointBlank(castItem(args[1]), firePointBlank); + case "NoDodges": case "DodgesDisabled": case "GetDodgesDisabled": diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index dfc5dfc5f4..5ff4fb1358 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -12,6 +12,7 @@ using CalamityMod.Items.PermanentBoosters; using CalamityMod.Items.Pets; using CalamityMod.Items.Placeables; using CalamityMod.Items.Placeables.Furniture; +using CalamityMod.Items.Placeables.Furniture.CraftingStations; using CalamityMod.Items.Placeables.Furniture.Trophies; using CalamityMod.Items.Placeables.FurnitureCosmilite; using CalamityMod.Items.Potions; diff --git a/NPCs/Abyss/Bloatfish.cs b/NPCs/Abyss/Bloatfish.cs index 2414af484a..23ed228f7e 100644 --- a/NPCs/Abyss/Bloatfish.cs +++ b/NPCs/Abyss/Bloatfish.cs @@ -192,7 +192,7 @@ namespace CalamityMod.NPCs.Abyss public override void ModifyNPCLoot(NPCLoot npcLoot) { npcLoot.Add(ModContent.ItemType(), 1, 10, 20); - var postClone = npcLoot.DefineConditionalDropSet(() => DownedBossSystem.downedCalamitas); + var postClone = npcLoot.DefineConditionalDropSet(DropHelper.PostCal()); postClone.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 2, 5, 7, 7, 10)); } diff --git a/NPCs/Abyss/BobbitWormHead.cs b/NPCs/Abyss/BobbitWormHead.cs index cb004a0784..993409e589 100644 --- a/NPCs/Abyss/BobbitWormHead.cs +++ b/NPCs/Abyss/BobbitWormHead.cs @@ -255,9 +255,9 @@ namespace CalamityMod.NPCs.Abyss public override void ModifyNPCLoot(NPCLoot npcLoot) { - var postClone = npcLoot.DefineConditionalDropSet(() => DownedBossSystem.downedCalamitas); + var postClone = npcLoot.DefineConditionalDropSet(DropHelper.PostCal()); postClone.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 2, 5, 7, 7, 10)); - npcLoot.AddIf(() => DownedBossSystem.downedPolterghast, ModContent.ItemType(), 3); + npcLoot.AddIf(DropHelper.PostPolter(), ModContent.ItemType(), 3); } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/Abyss/ColossalSquid.cs b/NPCs/Abyss/ColossalSquid.cs index cf7939ef10..9df209582f 100644 --- a/NPCs/Abyss/ColossalSquid.cs +++ b/NPCs/Abyss/ColossalSquid.cs @@ -556,10 +556,10 @@ namespace CalamityMod.NPCs.Abyss npcLoot.Add(ItemID.BlackInk, 1, 3, 5); npcLoot.Add(ModContent.ItemType(), 5); - var postClone = npcLoot.DefineConditionalDropSet(() => DownedBossSystem.downedCalamitas); + var postClone = npcLoot.DefineConditionalDropSet(DropHelper.PostCal()); postClone.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 2, 26, 38, 31, 45)); - npcLoot.AddIf(() => DownedBossSystem.downedPolterghast, ModContent.ItemType(), 3); + npcLoot.AddIf(DropHelper.PostPolter(), ModContent.ItemType(), 3); } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/Abyss/DevilFish.cs b/NPCs/Abyss/DevilFish.cs index ff79ca84d0..80958b0100 100644 --- a/NPCs/Abyss/DevilFish.cs +++ b/NPCs/Abyss/DevilFish.cs @@ -316,7 +316,7 @@ namespace CalamityMod.NPCs.Abyss public static void DefineDevilFishLoot(NPCLoot npcLoot) { - var postClone = npcLoot.DefineConditionalDropSet(() => DownedBossSystem.downedCalamitas); + var postClone = npcLoot.DefineConditionalDropSet(DropHelper.PostCal()); postClone.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 2, 1, 2, 2, 3)); postClone.Add(ModContent.ItemType(), 2); npcLoot.AddIf(() => NPC.downedGolemBoss, ModContent.ItemType(), 1, 3, 9); diff --git a/NPCs/Abyss/EidolonWyrmHead.cs b/NPCs/Abyss/EidolonWyrmHead.cs index a5a1e163e5..183e35563a 100644 --- a/NPCs/Abyss/EidolonWyrmHead.cs +++ b/NPCs/Abyss/EidolonWyrmHead.cs @@ -513,14 +513,14 @@ namespace CalamityMod.NPCs.Abyss aewMinionCondition.Add(ModContent.ItemType(), 1, 30, 40); // Post-Polterghast: Soul Edge, Eidolic Wail, Stardust Staff - LeadingConditionRule postPolter = new(DropHelper.If(() => DownedBossSystem.downedPolterghast)); + LeadingConditionRule postPolter = npcLoot.DefineConditionalDropSet(DropHelper.PostPolter()); aewMinionCondition.Add(postPolter); postPolter.Add(ModContent.ItemType(), 3); postPolter.Add(ModContent.ItemType(), 3); postPolter.Add(ModContent.ItemType(), 3); // Post-Clone: 6-8 Lumenyl (8-11 on Expert) - LeadingConditionRule postClone = new(DropHelper.If(() => DownedBossSystem.downedCalamitas)); + LeadingConditionRule postClone = npcLoot.DefineConditionalDropSet(DropHelper.PostCal()); aewMinionCondition.Add(postClone); postClone.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 1, 6, 8, 8, 11)); diff --git a/NPCs/Abyss/GiantSquid.cs b/NPCs/Abyss/GiantSquid.cs index 972851896a..19686776b8 100644 --- a/NPCs/Abyss/GiantSquid.cs +++ b/NPCs/Abyss/GiantSquid.cs @@ -247,7 +247,7 @@ namespace CalamityMod.NPCs.Abyss public override void ModifyNPCLoot(NPCLoot npcLoot) { - var postClone = npcLoot.DefineConditionalDropSet(() => DownedBossSystem.downedCalamitas); + var postClone = npcLoot.DefineConditionalDropSet(DropHelper.PostCal()); postClone.Add(ModContent.ItemType(), 2); postClone.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 2, 2, 4, 3, 6)); } diff --git a/NPCs/Abyss/GulperEelHead.cs b/NPCs/Abyss/GulperEelHead.cs index 2d06a3c83d..616a40f299 100644 --- a/NPCs/Abyss/GulperEelHead.cs +++ b/NPCs/Abyss/GulperEelHead.cs @@ -355,7 +355,7 @@ namespace CalamityMod.NPCs.Abyss public override void ModifyNPCLoot(NPCLoot npcLoot) { - var postClone = npcLoot.DefineConditionalDropSet(() => DownedBossSystem.downedCalamitas); + var postClone = npcLoot.DefineConditionalDropSet(DropHelper.PostCal()); postClone.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 2, 2, 3, 3, 4)); postClone.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 2, 6, 8, 8, 11)); } diff --git a/NPCs/Abyss/Laserfish.cs b/NPCs/Abyss/Laserfish.cs index b9505f1ac5..1d6127b1c8 100644 --- a/NPCs/Abyss/Laserfish.cs +++ b/NPCs/Abyss/Laserfish.cs @@ -126,7 +126,7 @@ namespace CalamityMod.NPCs.Abyss public override void ModifyNPCLoot(NPCLoot npcLoot) { - npcLoot.AddIf(() => DownedBossSystem.downedCalamitas, ModContent.ItemType(), 2); + npcLoot.AddIf(DropHelper.PostCal(), ModContent.ItemType(), 2); } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/Abyss/LuminousCorvina.cs b/NPCs/Abyss/LuminousCorvina.cs index 68e642fef1..a95a52bf38 100644 --- a/NPCs/Abyss/LuminousCorvina.cs +++ b/NPCs/Abyss/LuminousCorvina.cs @@ -308,7 +308,7 @@ namespace CalamityMod.NPCs.Abyss public override void ModifyNPCLoot(NPCLoot npcLoot) { npcLoot.Add(ModContent.ItemType(), 1, 8, 15); - var postClone = npcLoot.DefineConditionalDropSet(() => DownedBossSystem.downedCalamitas); + var postClone = npcLoot.DefineConditionalDropSet(DropHelper.PostCal()); postClone.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 2, 1, 2, 2, 3)); postClone.Add(ModContent.ItemType(), 2); } diff --git a/NPCs/Abyss/MirageJelly.cs b/NPCs/Abyss/MirageJelly.cs index 547877527b..dd373ec3e3 100644 --- a/NPCs/Abyss/MirageJelly.cs +++ b/NPCs/Abyss/MirageJelly.cs @@ -225,7 +225,7 @@ namespace CalamityMod.NPCs.Abyss { npcLoot.AddIf(() => NPC.downedBoss3, ModContent.ItemType(), 10); - var postClone = npcLoot.DefineConditionalDropSet(() => DownedBossSystem.downedCalamitas); + var postClone = npcLoot.DefineConditionalDropSet(DropHelper.PostCal()); postClone.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 2, 5, 7, 10, 14)); npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 7, 5)); diff --git a/NPCs/Abyss/OarfishHead.cs b/NPCs/Abyss/OarfishHead.cs index f1d098851d..37cfcd374e 100644 --- a/NPCs/Abyss/OarfishHead.cs +++ b/NPCs/Abyss/OarfishHead.cs @@ -319,7 +319,7 @@ namespace CalamityMod.NPCs.Abyss public override void ModifyNPCLoot(NPCLoot npcLoot) { - var postClone = npcLoot.DefineConditionalDropSet(() => DownedBossSystem.downedCalamitas); + var postClone = npcLoot.DefineConditionalDropSet(DropHelper.PostCal()); postClone.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 2, 3, 5, 4, 7)); } diff --git a/NPCs/Abyss/ReaperShark.cs b/NPCs/Abyss/ReaperShark.cs index e934b190b6..adb27a2c24 100644 --- a/NPCs/Abyss/ReaperShark.cs +++ b/NPCs/Abyss/ReaperShark.cs @@ -664,12 +664,12 @@ namespace CalamityMod.NPCs.Abyss npcLoot.Add(ModContent.ItemType(), 1, 40, 50); npcLoot.Add(ModContent.ItemType(), 1, 2, 3); - var postPolter = npcLoot.DefineConditionalDropSet(() => DownedBossSystem.downedPolterghast); + var postPolter = npcLoot.DefineConditionalDropSet(DropHelper.PostPolter()); postPolter.Add(ModContent.ItemType(), 1, 3, 4); postPolter.Add(ModContent.ItemType(), 3); postPolter.Add(ModContent.ItemType(), 3); - var postClone = npcLoot.DefineConditionalDropSet(() => DownedBossSystem.downedCalamitas); + var postClone = npcLoot.DefineConditionalDropSet(DropHelper.PostCal()); postClone.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 2, 10, 17, 14, 22)); } diff --git a/NPCs/Abyss/ToxicMinnow.cs b/NPCs/Abyss/ToxicMinnow.cs index 7197837a56..bbfc36e434 100644 --- a/NPCs/Abyss/ToxicMinnow.cs +++ b/NPCs/Abyss/ToxicMinnow.cs @@ -188,7 +188,7 @@ namespace CalamityMod.NPCs.Abyss public override void ModifyNPCLoot(NPCLoot npcLoot) { - var postClone = npcLoot.DefineConditionalDropSet(() => DownedBossSystem.downedCalamitas); + var postClone = npcLoot.DefineConditionalDropSet(DropHelper.PostCal()); postClone.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 2, 2, 3, 4, 6)); } diff --git a/NPCs/Abyss/Viperfish.cs b/NPCs/Abyss/Viperfish.cs index 6b9617e5e2..7d0b5e22e4 100644 --- a/NPCs/Abyss/Viperfish.cs +++ b/NPCs/Abyss/Viperfish.cs @@ -151,7 +151,7 @@ namespace CalamityMod.NPCs.Abyss public override void ModifyNPCLoot(NPCLoot npcLoot) { - var postClone = npcLoot.DefineConditionalDropSet(() => DownedBossSystem.downedCalamitas); + var postClone = npcLoot.DefineConditionalDropSet(DropHelper.PostCal()); postClone.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 2, 1, 2, 2, 3)); postClone.Add(ModContent.ItemType(), 4); } diff --git a/NPCs/AcidRain/AcidEel.cs b/NPCs/AcidRain/AcidEel.cs index 79cff8592f..fa5a26f639 100644 --- a/NPCs/AcidRain/AcidEel.cs +++ b/NPCs/AcidRain/AcidEel.cs @@ -6,12 +6,13 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Weapons.Magic; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using System; using Terraria; +using Terraria.Audio; using Terraria.GameContent.Bestiary; +using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.ModLoader; -using System; -using Terraria.Audio; namespace CalamityMod.NPCs.AcidRain { @@ -153,7 +154,8 @@ namespace CalamityMod.NPCs.AcidRain public override void ModifyNPCLoot(NPCLoot npcLoot) { npcLoot.Add(ModContent.ItemType(), 2, 1, 3); - npcLoot.AddIf(() => DownedBossSystem.downedAquaticScourge, ModContent.ItemType(), 20); + LeadingConditionRule postAS = npcLoot.DefineConditionalDropSet(DropHelper.PostAS()); + postAS.Add(ModContent.ItemType(), 20); } public override void FindFrame(int frameHeight) diff --git a/NPCs/AcidRain/BabyFlakCrab.cs b/NPCs/AcidRain/BabyFlakCrab.cs index 72986238bf..de1a577a42 100644 --- a/NPCs/AcidRain/BabyFlakCrab.cs +++ b/NPCs/AcidRain/BabyFlakCrab.cs @@ -138,17 +138,6 @@ namespace CalamityMod.NPCs.AcidRain return 0.15f; } - public override void OnCaughtBy(Player player, Item item, bool failed) - { - try - { - } - catch - { - return; - } - } - public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 5; k++) diff --git a/NPCs/AcidRain/BloodwormNormal.cs b/NPCs/AcidRain/BloodwormNormal.cs index f8cdd80779..b50fcd1421 100644 --- a/NPCs/AcidRain/BloodwormNormal.cs +++ b/NPCs/AcidRain/BloodwormNormal.cs @@ -124,17 +124,5 @@ namespace CalamityMod.NPCs.AcidRain return spawnRate; } - - public override void OnCaughtBy(Player player, Item item, bool failed) - { - try - { - - } - catch - { - return; - } - } } } diff --git a/NPCs/AcidRain/CragmawMire.cs b/NPCs/AcidRain/CragmawMire.cs index e13795d8da..f4c5e4a0ff 100644 --- a/NPCs/AcidRain/CragmawMire.cs +++ b/NPCs/AcidRain/CragmawMire.cs @@ -1,22 +1,22 @@ using CalamityMod.BiomeManagers; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using CalamityMod.Items.Accessories; using CalamityMod.Items.Placeables.Furniture.BossRelics; using CalamityMod.Items.Placeables.Furniture.Trophies; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Enemy; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.Audio; using Terraria.GameContent.Bestiary; using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.ModLoader; -using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.Items.Weapons.Rogue; using Terraria.Utilities; using Terraria.WorldBuilding; -using Terraria.Audio; namespace CalamityMod.NPCs.AcidRain { @@ -502,14 +502,15 @@ namespace CalamityMod.NPCs.AcidRain public override void ModifyNPCLoot(NPCLoot npcLoot) { // If post-Polter, the drop rates are 10%. Otherwise they're 100%. - // This is accomplished by adding rules if the CONDITION "Post-Polter" fails. + // This is accomplished by adding rules if the CONDITION "Post-Polter" fails. LeadingConditionRule postPolter = npcLoot.DefineConditionalDropSet(() => DownedBossSystem.downedPolterghast); - postPolter.Add(ModContent.ItemType(), 10); - postPolter.Add(ModContent.ItemType(), 10); - postPolter.OnFailedConditions(ItemDropRule.Common(ModContent.ItemType())); - postPolter.OnFailedConditions(ItemDropRule.Common(ModContent.ItemType())); + postPolter.Add(ModContent.ItemType(), 10, hideLootReport: !DownedBossSystem.downedPolterghast); + postPolter.Add(ModContent.ItemType(), 10, hideLootReport: !DownedBossSystem.downedPolterghast); + postPolter.AddFail(ModContent.ItemType(), hideLootReport: DownedBossSystem.downedPolterghast); + postPolter.AddFail(ModContent.ItemType(), hideLootReport: DownedBossSystem.downedPolterghast); + npcLoot.Add(ModContent.ItemType(), 10); - npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType(), 4); + npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType(), 4); } } } diff --git a/NPCs/AcidRain/FlakCrab.cs b/NPCs/AcidRain/FlakCrab.cs index 8aeec6b197..3e779f5f34 100644 --- a/NPCs/AcidRain/FlakCrab.cs +++ b/NPCs/AcidRain/FlakCrab.cs @@ -9,6 +9,7 @@ using System; using System.IO; using Terraria; using Terraria.GameContent.Bestiary; +using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.ModLoader; @@ -181,8 +182,9 @@ namespace CalamityMod.NPCs.AcidRain public override void ModifyNPCLoot(NPCLoot npcLoot) { npcLoot.Add(ModContent.ItemType(), 20); - npcLoot.AddIf(() => !DownedBossSystem.downedPolterghast, ModContent.ItemType(), 3, 1, 3); - npcLoot.AddIf(() => DownedBossSystem.downedPolterghast, ModContent.ItemType(), 15, 1, 3); + LeadingConditionRule postPolter = npcLoot.DefineConditionalDropSet(() => DownedBossSystem.downedPolterghast); + postPolter.Add(ModContent.ItemType(), 15, 1, 3, !DownedBossSystem.downedPolterghast); + postPolter.AddFail(ModContent.ItemType(), 3, 1, 3, DownedBossSystem.downedPolterghast); } public override void FindFrame(int frameHeight) diff --git a/NPCs/AcidRain/Mauler.cs b/NPCs/AcidRain/Mauler.cs index 11d7595f23..136b6db703 100644 --- a/NPCs/AcidRain/Mauler.cs +++ b/NPCs/AcidRain/Mauler.cs @@ -452,7 +452,7 @@ namespace CalamityMod.NPCs.AcidRain npcLoot.Add(ItemID.SharkFin, 1, 2, 4); npcLoot.Add(ModContent.ItemType(), 3); npcLoot.Add(ModContent.ItemType(), 10); - npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType(), 4); + npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType(), 4); } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/AcidRain/NuclearTerror.cs b/NPCs/AcidRain/NuclearTerror.cs index b4184720c8..a7330ec9ef 100644 --- a/NPCs/AcidRain/NuclearTerror.cs +++ b/NPCs/AcidRain/NuclearTerror.cs @@ -525,7 +525,7 @@ namespace CalamityMod.NPCs.AcidRain npcLoot.Add(ModContent.ItemType(), 3); npcLoot.Add(ModContent.ItemType(), 3); npcLoot.Add(ModContent.ItemType(), 10); - npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType(), 4); + npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType(), 4); } } } diff --git a/NPCs/AcidRain/NuclearToad.cs b/NPCs/AcidRain/NuclearToad.cs index eb7249ddd3..c0d59415b5 100644 --- a/NPCs/AcidRain/NuclearToad.cs +++ b/NPCs/AcidRain/NuclearToad.cs @@ -8,10 +8,11 @@ using CalamityMod.Items.Weapons.Summon; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.Audio; using Terraria.GameContent.Bestiary; +using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.ModLoader; -using Terraria.Audio; namespace CalamityMod.NPCs.AcidRain { @@ -165,8 +166,9 @@ namespace CalamityMod.NPCs.AcidRain public override void ModifyNPCLoot(NPCLoot npcLoot) { npcLoot.Add(ModContent.ItemType(), 2, 1, 3); - npcLoot.AddIf(() => !DownedBossSystem.downedAquaticScourge, ModContent.ItemType(), 20); - npcLoot.AddIf(() => DownedBossSystem.downedAquaticScourge, ModContent.ItemType(), 100); + LeadingConditionRule postAS = npcLoot.DefineConditionalDropSet(() => DownedBossSystem.downedAquaticScourge); + postAS.Add(ModContent.ItemType(), 100, hideLootReport: !DownedBossSystem.downedAquaticScourge); + postAS.AddFail(ModContent.ItemType(), 20, hideLootReport: DownedBossSystem.downedAquaticScourge); } public override void OnHitPlayer(Player target, int damage, bool crit) => target.AddBuff(ModContent.BuffType(), 120); diff --git a/NPCs/AcidRain/Orthocera.cs b/NPCs/AcidRain/Orthocera.cs index 7845706bfe..72f15c1292 100644 --- a/NPCs/AcidRain/Orthocera.cs +++ b/NPCs/AcidRain/Orthocera.cs @@ -5,12 +5,13 @@ using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Materials; using CalamityMod.Items.Weapons.Summon; using CalamityMod.Projectiles.Enemy; +using Microsoft.Xna.Framework; using System; using Terraria; using Terraria.GameContent.Bestiary; +using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; namespace CalamityMod.NPCs.AcidRain { @@ -196,8 +197,9 @@ namespace CalamityMod.NPCs.AcidRain public override void ModifyNPCLoot(NPCLoot npcLoot) { npcLoot.Add(ModContent.ItemType(), 20); - npcLoot.AddIf(() => !DownedBossSystem.downedPolterghast, ModContent.ItemType(), 3, 1, 3); - npcLoot.AddIf(() => DownedBossSystem.downedPolterghast, ModContent.ItemType(), 15, 1, 3); + LeadingConditionRule postPolter = npcLoot.DefineConditionalDropSet(() => DownedBossSystem.downedPolterghast); + postPolter.Add(ModContent.ItemType(), 15, 1, 3, !DownedBossSystem.downedPolterghast); + postPolter.AddFail(ModContent.ItemType(), 3, 1, 3, DownedBossSystem.downedPolterghast); } public override void FindFrame(int frameHeight) diff --git a/NPCs/AcidRain/Radiator.cs b/NPCs/AcidRain/Radiator.cs index 33121ec935..5797f56044 100644 --- a/NPCs/AcidRain/Radiator.cs +++ b/NPCs/AcidRain/Radiator.cs @@ -108,17 +108,6 @@ namespace CalamityMod.NPCs.AcidRain } } - public override void OnCaughtBy(Player player, Item item, bool failed) - { - try - { - } - catch - { - return; - } - } - public override void ModifyNPCLoot(NPCLoot npcLoot) { npcLoot.Add(ModContent.ItemType(), 2, 1, 3); diff --git a/NPCs/AcidRain/Skyfin.cs b/NPCs/AcidRain/Skyfin.cs index 9426d88164..238dbca283 100644 --- a/NPCs/AcidRain/Skyfin.cs +++ b/NPCs/AcidRain/Skyfin.cs @@ -7,6 +7,7 @@ using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Terraria; using Terraria.GameContent.Bestiary; +using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; @@ -178,7 +179,8 @@ namespace CalamityMod.NPCs.AcidRain public override void ModifyNPCLoot(NPCLoot npcLoot) { npcLoot.Add(ModContent.ItemType(), 2, 1, 3); - npcLoot.AddIf(() => DownedBossSystem.downedAquaticScourge, ModContent.ItemType(), 20); + LeadingConditionRule postAS = npcLoot.DefineConditionalDropSet(DropHelper.PostAS()); + postAS.Add(ModContent.ItemType(), 20); } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/AcidRain/SulphurousSkater.cs b/NPCs/AcidRain/SulphurousSkater.cs index b309a79cd4..ac5be2d616 100644 --- a/NPCs/AcidRain/SulphurousSkater.cs +++ b/NPCs/AcidRain/SulphurousSkater.cs @@ -11,6 +11,7 @@ using System; using System.IO; using Terraria; using Terraria.GameContent.Bestiary; +using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.ModLoader; @@ -246,8 +247,9 @@ namespace CalamityMod.NPCs.AcidRain public override void ModifyNPCLoot(NPCLoot npcLoot) { npcLoot.Add(ModContent.ItemType(), 20); - npcLoot.AddIf(() => !DownedBossSystem.downedPolterghast, ModContent.ItemType(), 3, 1, 3); - npcLoot.AddIf(() => DownedBossSystem.downedPolterghast, ModContent.ItemType(), 15, 1, 3); + LeadingConditionRule postPolter = npcLoot.DefineConditionalDropSet(() => DownedBossSystem.downedPolterghast); + postPolter.Add(ModContent.ItemType(), 15, 1, 3, !DownedBossSystem.downedPolterghast); + postPolter.AddFail(ModContent.ItemType(), 3, 1, 3, DownedBossSystem.downedPolterghast); } public override void OnHitPlayer(Player target, int damage, bool crit) => target.AddBuff(ModContent.BuffType(), 120); diff --git a/NPCs/AcidRain/Trilobite.cs b/NPCs/AcidRain/Trilobite.cs index 7789b81264..5431914084 100644 --- a/NPCs/AcidRain/Trilobite.cs +++ b/NPCs/AcidRain/Trilobite.cs @@ -1,4 +1,5 @@ using CalamityMod.BiomeManagers; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Materials; @@ -7,11 +8,11 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; +using Terraria.Audio; using Terraria.GameContent.Bestiary; +using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.ModLoader; -using CalamityMod.Buffs.StatDebuffs; -using Terraria.Audio; namespace CalamityMod.NPCs.AcidRain { public class Trilobite : ModNPC @@ -145,8 +146,9 @@ namespace CalamityMod.NPCs.AcidRain public override void ModifyNPCLoot(NPCLoot npcLoot) { - npcLoot.AddIf(() => !DownedBossSystem.downedPolterghast, ModContent.ItemType(), 3, 1, 3); - npcLoot.AddIf(() => DownedBossSystem.downedPolterghast, ModContent.ItemType(), 15, 1, 3); + LeadingConditionRule postPolter = npcLoot.DefineConditionalDropSet(() => DownedBossSystem.downedPolterghast); + postPolter.Add(ModContent.ItemType(), 15, 1, 3, !DownedBossSystem.downedPolterghast); + postPolter.AddFail(ModContent.ItemType(), 3, 1, 3, DownedBossSystem.downedPolterghast); } public override void PostDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) diff --git a/NPCs/AcidRain/WaterLeech.cs b/NPCs/AcidRain/WaterLeech.cs index 7d98b1483e..0592722621 100644 --- a/NPCs/AcidRain/WaterLeech.cs +++ b/NPCs/AcidRain/WaterLeech.cs @@ -1,14 +1,15 @@ using CalamityMod.BiomeManagers; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Weapons.Magic; using Microsoft.Xna.Framework; +using System.IO; using Terraria; using Terraria.GameContent.Bestiary; +using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.ModLoader; -using System.IO; -using CalamityMod.Buffs.DamageOverTime; namespace CalamityMod.NPCs.AcidRain { @@ -219,8 +220,9 @@ namespace CalamityMod.NPCs.AcidRain public override void ModifyNPCLoot(NPCLoot npcLoot) { - npcLoot.AddIf(() => !DownedBossSystem.downedAquaticScourge, ModContent.ItemType(), 20); - npcLoot.AddIf(() => DownedBossSystem.downedAquaticScourge, ModContent.ItemType(), 100); + LeadingConditionRule postAS = npcLoot.DefineConditionalDropSet(() => DownedBossSystem.downedAquaticScourge); + postAS.Add(ModContent.ItemType(), 100, hideLootReport: !DownedBossSystem.downedAquaticScourge); + postAS.AddFail(ModContent.ItemType(), 20, hideLootReport: DownedBossSystem.downedAquaticScourge); } } } diff --git a/NPCs/AdultEidolonWyrm/AdultEidolonWyrmHead.cs b/NPCs/AdultEidolonWyrm/AdultEidolonWyrmHead.cs index b464914e1d..1735258949 100644 --- a/NPCs/AdultEidolonWyrm/AdultEidolonWyrmHead.cs +++ b/NPCs/AdultEidolonWyrm/AdultEidolonWyrmHead.cs @@ -121,7 +121,6 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm NPC.DeathSound = SoundID.NPCDeath6; NPC.netAlways = true; NPC.boss = true; - Music = CalamityMod.Instance.GetMusicFromMusicMod("AdultEidolonWyrm") ?? MusicID.Boss3; NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/AquaticScourge/AquaticScourgeHead.cs b/NPCs/AquaticScourge/AquaticScourgeHead.cs index d1544514a7..8e630cf744 100644 --- a/NPCs/AquaticScourge/AquaticScourgeHead.cs +++ b/NPCs/AquaticScourge/AquaticScourgeHead.cs @@ -123,9 +123,6 @@ namespace CalamityMod.NPCs.AquaticScourge public override void AI() { - if (NPC.justHit || NPC.life <= NPC.lifeMax * 0.999 || BossRushEvent.BossRushActive || Main.getGoodWorld) - Music = CalamityMod.Instance.GetMusicFromMusicMod("AquaticScourge") ?? MusicID.Boss2; - CalamityAI.AquaticScourgeAI(NPC, Mod, true); } @@ -232,8 +229,7 @@ namespace CalamityMod.NPCs.AquaticScourge ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType() + ModContent.ItemType() }; normalOnly.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, weapons)); @@ -242,6 +238,7 @@ namespace CalamityMod.NPCs.AquaticScourge // Equipment normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); + normalOnly.Add(ModContent.ItemType(), DropHelper.NormalWeaponDropRateFraction); normalOnly.Add(ModContent.ItemType(), 10); normalOnly.Add(ModContent.ItemType(), 10); @@ -249,14 +246,14 @@ namespace CalamityMod.NPCs.AquaticScourge normalOnly.Add(ModContent.ItemType()); } - npcLoot.Add(DropHelper.PerPlayer(ItemID.GreaterHealingPotion, 1, 8, 14)); + npcLoot.DefineConditionalDropSet(() => true).Add(DropHelper.PerPlayer(ItemID.GreaterHealingPotion, 1, 5, 15), hideLootReport: true); // Healing Potions don't show up in the Bestiary npcLoot.Add(ModContent.ItemType(), 10); - npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType()); + npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType()); // Lore bool firstASKill() => !DownedBossSystem.downedAquaticScourge; - npcLoot.AddConditionalPerPlayer(firstASKill, ModContent.ItemType()); - npcLoot.AddConditionalPerPlayer(firstASKill, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(firstASKill, ModContent.ItemType(), desc: DropHelper.FirstKillText); + npcLoot.AddConditionalPerPlayer(firstASKill, ModContent.ItemType(), desc: DropHelper.FirstKillText); } public override void OnKill() diff --git a/NPCs/Astral/Atlas.cs b/NPCs/Astral/Atlas.cs index 3c94da74d7..907fcc9be5 100644 --- a/NPCs/Astral/Atlas.cs +++ b/NPCs/Astral/Atlas.cs @@ -141,13 +141,6 @@ namespace CalamityMod.NPCs.Astral NPC.knockBackResist = 0.04f; NPC.lifeMax = 1600; } - if (NPC.downedAncientCultist) - { - NPC.damage = 150; - NPC.defense = 75; - NPC.knockBackResist = 0f; - NPC.lifeMax = 2400; - } if (CalamityWorld.death) { target_walkAcceleration = 0.18f; @@ -637,10 +630,6 @@ namespace CalamityMod.NPCs.Astral { return 0f; } - else if (spawnInfo.Player.InAstral(1) && NPC.downedAncientCultist && !DownedBossSystem.downedAstrumDeus) - { - return 0.27f; - } else if (spawnInfo.Player.InAstral(1)) { return 0.09f; diff --git a/NPCs/Astral/Twinkler.cs b/NPCs/Astral/Twinkler.cs index ed60b0e1ec..97a7810b6f 100644 --- a/NPCs/Astral/Twinkler.cs +++ b/NPCs/Astral/Twinkler.cs @@ -75,15 +75,5 @@ namespace CalamityMod.NPCs.Astral } return 0f; } - - public override void OnCaughtBy(Player player, Item item, bool failed) - { - try - { - } catch - { - return; - } - } } } diff --git a/NPCs/AstrumAureus/AstrumAureus.cs b/NPCs/AstrumAureus/AstrumAureus.cs index 70147cc3d9..af7fb9c0aa 100644 --- a/NPCs/AstrumAureus/AstrumAureus.cs +++ b/NPCs/AstrumAureus/AstrumAureus.cs @@ -73,7 +73,6 @@ namespace CalamityMod.NPCs.AstrumAureus NPC.value = Item.buyPrice(0, 60, 0, 0); NPC.boss = true; NPC.DeathSound = SoundID.NPCDeath14; - Music = CalamityMod.Instance.GetMusicFromMusicMod("AstrumAureus") ?? MusicID.Boss3; double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.Calamity().VulnerableToHeat = true; @@ -362,10 +361,10 @@ namespace CalamityMod.NPCs.AstrumAureus npcLoot.Add(ModContent.ItemType(), 10); // Relic - npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType()); + npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType()); // Lore - npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedAstrumAureus, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedAstrumAureus, ModContent.ItemType(), desc: DropHelper.FirstKillText); } public override void OnKill() diff --git a/NPCs/AstrumDeus/AstrumDeusBody.cs b/NPCs/AstrumDeus/AstrumDeusBody.cs index 004282884a..a42d307278 100644 --- a/NPCs/AstrumDeus/AstrumDeusBody.cs +++ b/NPCs/AstrumDeus/AstrumDeusBody.cs @@ -54,7 +54,6 @@ namespace CalamityMod.NPCs.AstrumDeus NPC.DeathSound = AstrumDeusHead.DeathSound; NPC.netAlways = true; NPC.boss = true; - Music = CalamityMod.Instance.GetMusicFromMusicMod("AstrumDeus") ?? MusicID.Boss3; NPC.dontCountMe = true; NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; diff --git a/NPCs/AstrumDeus/AstrumDeusHead.cs b/NPCs/AstrumDeus/AstrumDeusHead.cs index 7dd98aad0d..aee14ba70c 100644 --- a/NPCs/AstrumDeus/AstrumDeusHead.cs +++ b/NPCs/AstrumDeus/AstrumDeusHead.cs @@ -86,7 +86,6 @@ namespace CalamityMod.NPCs.AstrumDeus NPC.HitSound = SoundID.NPCHit4; NPC.DeathSound = DeathSound; NPC.netAlways = true; - Music = CalamityMod.Instance.GetMusicFromMusicMod("AstrumDeus") ?? MusicID.Boss3; NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; @@ -319,12 +318,11 @@ namespace CalamityMod.NPCs.AstrumDeus normalOnly.Add(ModContent.ItemType(), 1, 50, 80); } - npcLoot.Add(DropHelper.PerPlayer(ItemID.GreaterHealingPotion, 1, 8, 14)); + npcLoot.DefineConditionalDropSet(() => true).Add(DropHelper.PerPlayer(ItemID.GreaterHealingPotion, 1, 5, 15), hideLootReport: true); // Healing Potions don't show up in the Bestiary lastWorm.Add(ModContent.ItemType(), 10); // Relic - bool shouldDropRelic(DropAttemptInfo info) => (CalamityWorld.revenge || Main.masterMode) && !ShouldNotDropThings(info.npc); - npcLoot.AddIf(shouldDropRelic, ModContent.ItemType()); + npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).AddIf((info) => !ShouldNotDropThings(info.npc), ModContent.ItemType()); // Fragments lastWorm.Add(DropHelper.NormalVsExpertQuantity(ItemID.FragmentSolar, 1, 16, 24, 20, 32)); @@ -334,8 +332,8 @@ namespace CalamityMod.NPCs.AstrumDeus // Lore bool firstDeusKill(DropAttemptInfo info) => !DownedBossSystem.downedAstrumDeus && !ShouldNotDropThings(info.npc); - npcLoot.AddConditionalPerPlayer(firstDeusKill, ModContent.ItemType()); - npcLoot.AddConditionalPerPlayer(firstDeusKill, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(firstDeusKill, ModContent.ItemType(), desc: DropHelper.FirstKillText); + npcLoot.AddConditionalPerPlayer(firstDeusKill, ModContent.ItemType(), desc: DropHelper.FirstKillText); } public override void OnHitPlayer(Player player, int damage, bool crit) diff --git a/NPCs/AstrumDeus/AstrumDeusTail.cs b/NPCs/AstrumDeus/AstrumDeusTail.cs index cff2ce0fc0..74e82b0357 100644 --- a/NPCs/AstrumDeus/AstrumDeusTail.cs +++ b/NPCs/AstrumDeus/AstrumDeusTail.cs @@ -54,7 +54,6 @@ namespace CalamityMod.NPCs.AstrumDeus NPC.DeathSound = AstrumDeusHead.DeathSound; NPC.netAlways = true; NPC.boss = true; - Music = CalamityMod.Instance.GetMusicFromMusicMod("AstrumDeus") ?? MusicID.Boss3; NPC.dontCountMe = true; NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; diff --git a/NPCs/BrimstoneElemental/BrimstoneElemental.cs b/NPCs/BrimstoneElemental/BrimstoneElemental.cs index a280272269..24c5a13125 100644 --- a/NPCs/BrimstoneElemental/BrimstoneElemental.cs +++ b/NPCs/BrimstoneElemental/BrimstoneElemental.cs @@ -65,7 +65,6 @@ namespace CalamityMod.NPCs.BrimstoneElemental NPC.netAlways = true; NPC.HitSound = SoundID.NPCHit23; NPC.DeathSound = SoundID.NPCDeath39; - Music = CalamityMod.Instance.GetMusicFromMusicMod("BrimstoneElemental") ?? MusicID.Boss4; NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToWater = true; @@ -183,8 +182,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental { ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), + ModContent.ItemType() }; normalOnly.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, weapons)); normalOnly.Add(ModContent.ItemType(), 10); @@ -193,8 +191,13 @@ namespace CalamityMod.NPCs.BrimstoneElemental normalOnly.Add(ModContent.ItemType(), 1, 4, 8); // Equipment - normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); - normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); + int[] accs = new int[] + { + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType() + }; + normalOnly.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, accs)); normalOnly.Add(ModContent.ItemType(), 10); // Vanity @@ -206,10 +209,10 @@ namespace CalamityMod.NPCs.BrimstoneElemental npcLoot.Add(ModContent.ItemType(), 10); // Relic - npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType()); + npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType()); // Lore - npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedBrimstoneElemental, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedBrimstoneElemental, ModContent.ItemType(), desc: DropHelper.FirstKillText); } public override void OnKill() diff --git a/NPCs/Bumblebirb/Bumblefuck.cs b/NPCs/Bumblebirb/Bumblefuck.cs index a4825d1024..efda3e49c4 100644 --- a/NPCs/Bumblebirb/Bumblefuck.cs +++ b/NPCs/Bumblebirb/Bumblefuck.cs @@ -66,7 +66,6 @@ namespace CalamityMod.NPCs.Bumblebirb NPC.knockBackResist = 0f; NPC.boss = true; NPC.noTileCollide = true; - Music = CalamityMod.Instance.GetMusicFromMusicMod("Dragonfolly") ?? MusicID.Boss4; NPC.lavaImmune = true; NPC.noGravity = true; NPC.value = Item.buyPrice(1, 25, 0, 0); @@ -420,8 +419,7 @@ namespace CalamityMod.NPCs.Bumblebirb { ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), + ModContent.ItemType() }; normalOnly.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, items)); normalOnly.Add(ModContent.ItemType(), 10); @@ -431,6 +429,7 @@ namespace CalamityMod.NPCs.Bumblebirb // Equipment normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); + normalOnly.Add(ModContent.ItemType(), DropHelper.NormalWeaponDropRateFraction); // Vanity normalOnly.Add(ModContent.ItemType(), 7); @@ -439,10 +438,10 @@ namespace CalamityMod.NPCs.Bumblebirb npcLoot.Add(ModContent.ItemType(), 10); // Relic - npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType()); + npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType()); // Lore - npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedDragonfolly, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedDragonfolly, ModContent.ItemType(), desc: DropHelper.FirstKillText); } public override void OnKill() diff --git a/NPCs/Calamitas/CalamitasClone.cs b/NPCs/Calamitas/CalamitasClone.cs index 735bf9fd73..ff495ac8ba 100644 --- a/NPCs/Calamitas/CalamitasClone.cs +++ b/NPCs/Calamitas/CalamitasClone.cs @@ -72,7 +72,6 @@ namespace CalamityMod.NPCs.Calamitas NPC.noTileCollide = true; NPC.HitSound = SoundID.NPCHit4; NPC.DeathSound = SoundID.NPCDeath14; - Music = CalamityMod.Instance.GetMusicFromMusicMod("Calamitas") ?? MusicID.Boss2; NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToWater = true; @@ -192,13 +191,13 @@ namespace CalamityMod.NPCs.Calamitas ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), + ModContent.ItemType() }; normalOnly.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, items)); // Equipment normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); + normalOnly.Add(ModContent.ItemType(), DropHelper.NormalWeaponDropRateFraction); normalOnly.Add(ModContent.ItemType(), 10); // Materials @@ -207,16 +206,18 @@ namespace CalamityMod.NPCs.Calamitas // Vanity normalOnly.Add(ModContent.ItemType(), 7); - normalOnly.Add(ItemDropRule.Common(ModContent.ItemType(), 10).OnSuccess(ItemDropRule.Common(ModContent.ItemType()))); + var calVanity = ItemDropRule.Common(ModContent.ItemType(), 10); + calVanity.OnSuccess(ItemDropRule.Common(ModContent.ItemType())); + normalOnly.Add(calVanity); } npcLoot.Add(ModContent.ItemType(), 10); // Relic - npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType()); + npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType()); // Lore - npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedCalamitas, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedCalamitas, ModContent.ItemType(), desc: DropHelper.FirstKillText); } public override void OnKill() diff --git a/NPCs/Calamitas/Cataclysm.cs b/NPCs/Calamitas/Cataclysm.cs index 041aabf6b5..0a40a8c369 100644 --- a/NPCs/Calamitas/Cataclysm.cs +++ b/NPCs/Calamitas/Cataclysm.cs @@ -56,7 +56,6 @@ namespace CalamityMod.NPCs.Calamitas NPC.noTileCollide = true; NPC.HitSound = SoundID.NPCHit4; NPC.DeathSound = SoundID.NPCDeath14; - Music = CalamityMod.Instance.GetMusicFromMusicMod("Calamitas") ?? MusicID.Boss2; NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToWater = true; diff --git a/NPCs/Calamitas/Catastrophe.cs b/NPCs/Calamitas/Catastrophe.cs index 1f1e361773..fa32372ba4 100644 --- a/NPCs/Calamitas/Catastrophe.cs +++ b/NPCs/Calamitas/Catastrophe.cs @@ -56,7 +56,6 @@ namespace CalamityMod.NPCs.Calamitas NPC.noTileCollide = true; NPC.HitSound = SoundID.NPCHit4; NPC.DeathSound = SoundID.NPCDeath14; - Music = CalamityMod.Instance.GetMusicFromMusicMod("Calamitas") ?? MusicID.Boss2; NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToWater = true; diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index addb046f88..6b264022bd 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -39,6 +39,9 @@ namespace CalamityMod.NPCs bool revenge = CalamityWorld.revenge || bossRush; bool death = CalamityWorld.death || bossRush; + if (head) + CalamityGlobalNPC.aquaticScourge = npc.whoAmI; + // Adjust hostility and stats if (npc.justHit || npc.life <= npc.lifeMax * 0.999 || bossRush || Main.getGoodWorld) { diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 6e33548faa..972f454685 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -253,6 +253,7 @@ namespace CalamityMod.NPCs public static int primeCannon = -1; public static int primeVice = -1; public static int primeSaw = -1; + public static int aquaticScourge = -1; public static int brimstoneElemental = -1; public static int cataclysm = -1; public static int catastrophe = -1; @@ -273,11 +274,19 @@ namespace CalamityMod.NPCs public static int ghostBossClone = -1; public static int ghostBoss = -1; public static int DoGHead = -1; + public static int DoGP2 = -1; + public static int yharon = -1; + public static int yharonP2 = -1; public static int SCalCataclysm = -1; public static int SCalCatastrophe = -1; public static int SCal = -1; public static int SCalWorm = -1; + public static int SCalGrief = -1; + public static int SCalLament = -1; + public static int SCalEpiphany = -1; + public static int SCalAcceptance = -1; public static int draedon = -1; + public static int draedonAmbience = -1; public static int draedonExoMechWorm = -1; public static int draedonExoMechTwinRed = -1; public static int draedonExoMechTwinGreen = -1; @@ -477,6 +486,7 @@ namespace CalamityMod.NPCs ResetSavedIndex(ref primeCannon, NPCID.PrimeCannon); ResetSavedIndex(ref primeVice, NPCID.PrimeVice); ResetSavedIndex(ref primeSaw, NPCID.PrimeSaw); + ResetSavedIndex(ref aquaticScourge, NPCType()); ResetSavedIndex(ref brimstoneElemental, NPCType()); ResetSavedIndex(ref cataclysm, NPCType()); ResetSavedIndex(ref catastrophe, NPCType()); @@ -497,12 +507,20 @@ namespace CalamityMod.NPCs ResetSavedIndex(ref ghostBossClone, NPCType()); ResetSavedIndex(ref ghostBoss, NPCType()); ResetSavedIndex(ref DoGHead, NPCType()); + ResetSavedIndex(ref DoGP2, NPCType()); + ResetSavedIndex(ref yharon, NPCType()); + ResetSavedIndex(ref yharonP2, NPCType()); ResetSavedIndex(ref SCalCataclysm, NPCType()); ResetSavedIndex(ref SCalCatastrophe, NPCType()); ResetSavedIndex(ref SCal, NPCType()); + ResetSavedIndex(ref SCalGrief, NPCType()); + ResetSavedIndex(ref SCalLament, NPCType()); + ResetSavedIndex(ref SCalEpiphany, NPCType()); + ResetSavedIndex(ref SCalAcceptance, NPCType()); ResetSavedIndex(ref SCalWorm, NPCType()); ResetSavedIndex(ref draedon, NPCType()); + ResetSavedIndex(ref draedonAmbience, NPCType()); ResetSavedIndex(ref draedonExoMechWorm, NPCType()); ResetSavedIndex(ref draedonExoMechTwinRed, NPCType()); ResetSavedIndex(ref draedonExoMechTwinGreen, NPCType()); @@ -3648,14 +3666,14 @@ namespace CalamityMod.NPCs // Sets certain vanilla NPCs and all town NPCs to be immune to most debuffs. if (CalamityLists.DestroyerIDs.Contains(npc.type) || npc.type == NPCID.SkeletronHead || npc.type == NPCID.SpikeBall || npc.type == NPCID.BlazingWheel || - (CalamityLists.EaterofWorldsIDs.Contains(npc.type) && BossRushEvent.BossRushActive) || npc.type == NPCID.DD2EterniaCrystal || npc.townNPC) + (CalamityLists.EaterofWorldsIDs.Contains(npc.type) && BossRushEvent.BossRushActive) || npc.type == NPCID.DD2EterniaCrystal || npc.townNPC || NPCID.Sets.ActsLikeTownNPC[npc.type]) { for (int k = 0; k < npc.buffImmune.Length; k++) { npc.buffImmune[k] = true; } - if (npc.townNPC) + if (npc.townNPC || NPCID.Sets.ActsLikeTownNPC[npc.type]) { npc.buffImmune[BuffID.Wet] = false; npc.buffImmune[BuffID.Slimed] = false; @@ -4594,7 +4612,7 @@ namespace CalamityMod.NPCs spawnRate = (int)(spawnRate * 0.2); maxSpawns = (int)(maxSpawns * 5f); } - if (NPC.AnyNPCs(NPCType())) + if (NPC.AnyNPCs(NPCType())) { int otherWulfrumEnemies = NPC.CountNPCS(NPCType()) + NPC.CountNPCS(NPCType()) + NPC.CountNPCS(NPCType()) + NPC.CountNPCS(NPCType()); if (otherWulfrumEnemies < 4) diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index de655bba33..627db3ca44 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -57,7 +57,17 @@ namespace CalamityMod.NPCs } // Convenient shortcut for all Master drops moved to Revengeance - LeadingConditionRule rev = new LeadingConditionRule(DropHelper.RevNoMaster); + LeadingConditionRule rev = npcLoot.DefineConditionalDropSet(DropHelper.RevNoMaster); + + LeadingConditionRule pMoon = new LeadingConditionRule(new Conditions.PumpkinMoonDropGatingChance()); + LeadingConditionRule fMoon = new LeadingConditionRule(new Conditions.FrostMoonDropGatingChance()); + + // Progression shortcuts + LeadingConditionRule postEoC = npcLoot.DefineConditionalDropSet(DropHelper.PostEoC()); + LeadingConditionRule hardmode = npcLoot.DefineConditionalDropSet(DropHelper.Hardmode()); + LeadingConditionRule postCalPlant = npcLoot.DefineConditionalDropSet(DropHelper.PostCalPlant()); + LeadingConditionRule postLevi = npcLoot.DefineConditionalDropSet(DropHelper.PostLevi()); + LeadingConditionRule postDoG = npcLoot.DefineConditionalDropSet(DropHelper.PostDoG()); switch (npc.type) { @@ -81,8 +91,8 @@ namespace CalamityMod.NPCs // Sky Glaze @ 3.33% IF Eye of Cthulhu dead // Essence of Cinder @ 50% IF Hardmode and not statue spawned case NPCID.Harpy: - npcLoot.AddIf(() => NPC.downedBoss1, ModContent.ItemType(), 30); - npcLoot.AddIf(() => Main.hardMode && !npc.SpawnedFromStatue, ModContent.ItemType(), 2); + postEoC.Add(ModContent.ItemType(), 30); + hardmode.AddIf(() => !npc.SpawnedFromStatue, ModContent.ItemType(), 2); break; // Angry Nimbus @@ -365,7 +375,7 @@ namespace CalamityMod.NPCs // Giant Cursed Skull // Keelhaul @ 6.67% IF Leviathan dead case NPCID.GiantCursedSkull: - npcLoot.AddIf(() => DownedBossSystem.downedLeviathan, ModContent.ItemType(), 15); + postLevi.Add(ModContent.ItemType(), 15); break; // Bone Lee @@ -468,7 +478,6 @@ namespace CalamityMod.NPCs case NPCID.DD2DarkMageT1: rev.Add(ItemID.DarkMageMasterTrophy); rev.Add(ItemID.DarkMageBookMountItem, 4); - npcLoot.Add(rev); break; // Dark Mage T3 @@ -476,7 +485,6 @@ namespace CalamityMod.NPCs case NPCID.DD2DarkMageT3: rev.Add(ItemID.DarkMageMasterTrophy); rev.Add(ItemID.DarkMageBookMountItem, 4); - npcLoot.Add(rev); break; // Ogre T3 @@ -484,7 +492,6 @@ namespace CalamityMod.NPCs case NPCID.DD2OgreT3: rev.Add(ItemID.OgreMasterTrophy); rev.Add(ItemID.DD2OgrePetItem, 4); - npcLoot.Add(rev); break; #endregion @@ -500,7 +507,6 @@ namespace CalamityMod.NPCs case NPCID.PirateShip: rev.Add(ItemID.FlyingDutchmanMasterTrophy); rev.Add(ItemID.PirateShipMountItem, 4); - npcLoot.Add(rev); break; #endregion @@ -511,7 +517,7 @@ namespace CalamityMod.NPCs case NPCID.SwampThing: case NPCID.Fritz: case NPCID.CreatureFromTheDeep: - npcLoot.AddIf(() => DownedBossSystem.downedDoG, ModContent.ItemType(), 10); + postDoG.Add(ModContent.ItemType(), 10); break; // Medium Solar Eclipse Enemies: The Possessed, Butcher, Dr. Man Fly @@ -519,7 +525,7 @@ namespace CalamityMod.NPCs case NPCID.ThePossessed: case NPCID.Butcher: case NPCID.DrManFly: - npcLoot.AddIf(() => DownedBossSystem.downedDoG, ModContent.ItemType(), 2); + postDoG.Add(ModContent.ItemType(), 2); break; // Reaper, Psycho @@ -527,8 +533,8 @@ namespace CalamityMod.NPCs // Darksun Fragment @ 50% IF Devourer of Gods dead case NPCID.Reaper: case NPCID.Psycho: - npcLoot.AddIf(() => DownedBossSystem.downedCalamitas || NPC.downedPlantBoss, ModContent.ItemType(), 2, 2, 4); - npcLoot.AddIf(() => DownedBossSystem.downedDoG, ModContent.ItemType(), 2); + postCalPlant.Add(ModContent.ItemType(), 2, 2, 4); + postDoG.Add(ModContent.ItemType(), 2); break; // Vampire / Vampire Bat (same enemy) @@ -540,26 +546,26 @@ namespace CalamityMod.NPCs case NPCID.Vampire: npcLoot.ChangeDropRate(ItemID.MoonStone, 3, 20); npcLoot.Add(ItemDropRule.NormalvsExpert(ItemID.BatHook, 40, 20)); - npcLoot.AddIf(() => DownedBossSystem.downedCalamitas || NPC.downedPlantBoss, ModContent.ItemType(), 2, 2, 4); - npcLoot.AddIf(() => DownedBossSystem.downedDoG, ModContent.ItemType(), 2); + postCalPlant.Add(ModContent.ItemType(), 2, 2, 4); + postDoG.Add(ModContent.ItemType(), 2); break; // Eyezor // 1-2 Darksun Fragment @ 100% IF Devourer of Gods dead case NPCID.Eyezor: - npcLoot.AddIf(() => DownedBossSystem.downedDoG, ModContent.ItemType(), 1, 1, 2); + postDoG.Add(ModContent.ItemType(), 1, 1, 2); break; // Nailhead // 3-5 Darksun Fragment @ 100% IF Devourer of Gods dead case NPCID.Nailhead: - npcLoot.AddIf(() => DownedBossSystem.downedDoG, ModContent.ItemType(), 1, 3, 5); + postDoG.Add(ModContent.ItemType(), 1, 3, 5); break; // Mothron // 20-30 Darksun Fragment @ 100% IF Devourer of Gods dead case NPCID.Mothron: - npcLoot.AddIf(() => DownedBossSystem.downedDoG, ModContent.ItemType(), 1, 20, 30); + postDoG.Add(ModContent.ItemType(), 1, 20, 30); break; // Deadly Sphere @@ -567,7 +573,7 @@ namespace CalamityMod.NPCs // Darksun Fragment @ 50% IF Devourer of Gods dead case NPCID.DeadlySphere: npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 5, 3)); - npcLoot.AddIf(() => DownedBossSystem.downedDoG, ModContent.ItemType(), 2); + postDoG.Add(ModContent.ItemType(), 2); break; #endregion @@ -575,41 +581,44 @@ namespace CalamityMod.NPCs // Splinterling // Nightmare Fuel @ 50% IF Devourer of Gods dead case NPCID.Splinterling: - npcLoot.AddIf(() => DownedBossSystem.downedDoG, ModContent.ItemType(), 2); + postDoG.Add(ModContent.ItemType(), 2); break; // Hellhound, Poltergeist // 1-2 Nightmare Fuel @ 50% IF Devourer of Gods dead case NPCID.Hellhound: case NPCID.Poltergeist: - npcLoot.AddIf(() => DownedBossSystem.downedDoG, ModContent.ItemType(), 2, 1, 2); + postDoG.Add(ModContent.ItemType(), 2, 1, 2); break; // Headless Horseman // 3-5 Nightmare Fuel @ 100% IF Devourer of Gods dead case NPCID.HeadlessHorseman: - npcLoot.AddIf(() => DownedBossSystem.downedDoG, ModContent.ItemType(), 1, 3, 5); + postDoG.Add(ModContent.ItemType(), 1, 3, 5); break; // Mourning Wood case NPCID.MourningWood: // 5-10 Nightmare Fuel @ 100% IF Devourer of Gods dead - npcLoot.AddIf(() => DownedBossSystem.downedDoG, ModContent.ItemType(), 1, 5, 10); + postDoG.Add(ModContent.ItemType(), 1, 5, 10); + + pMoon.OnSuccess(ItemDropRule.ByCondition(new Conditions.NotExpert(), ItemID.WitchBroom, 5)); // Master items drop in Revengeance - rev.Add(ItemID.MourningWoodMasterTrophy, 4); - npcLoot.Add(rev); + pMoon.OnSuccess(ItemDropRule.ByCondition(DropHelper.RevNoMaster, ItemID.MourningWoodMasterTrophy)); + pMoon.OnSuccess(ItemDropRule.ByCondition(DropHelper.RevNoMaster, ItemID.SpookyWoodMountItem, 4)); + npcLoot.Add(pMoon); break; // Pumpking case NPCID.Pumpking: // 10-20 Nightmare Fuel @ 100% IF Devourer of Gods dead - npcLoot.AddIf(() => DownedBossSystem.downedDoG, ModContent.ItemType(), 1, 10, 20); + postDoG.Add(ModContent.ItemType(), 1, 10, 20); // Master items drop in Revengeance - rev.Add(ItemID.PumpkingMasterTrophy, 4); - rev.Add(ItemID.PumpkingPetItem, 20); - npcLoot.Add(rev); + pMoon.OnSuccess(ItemDropRule.ByCondition(DropHelper.RevNoMaster, ItemID.PumpkingMasterTrophy)); + pMoon.OnSuccess(ItemDropRule.ByCondition(DropHelper.RevNoMaster, ItemID.PumpkingPetItem, 4)); + npcLoot.Add(pMoon); break; #endregion @@ -620,7 +629,7 @@ namespace CalamityMod.NPCs case NPCID.NutcrackerSpinning: case NPCID.ElfCopter: case NPCID.Flocko: - npcLoot.AddIf(() => DownedBossSystem.downedDoG, ModContent.ItemType(), 2); + postDoG.Add(ModContent.ItemType(), 2); break; // Medium Frost Moon Enemies: Krampus, Yeti, Present Mimic @@ -628,40 +637,40 @@ namespace CalamityMod.NPCs case NPCID.Krampus: case NPCID.Yeti: case NPCID.PresentMimic: - npcLoot.AddIf(() => DownedBossSystem.downedDoG, ModContent.ItemType(), 2, 1, 2); + postDoG.Add(ModContent.ItemType(), 2, 1, 2); break; // Everscream case NPCID.Everscream: // 3-5 Endothermic Energy @ 100% IF Devourer of Gods dead - npcLoot.AddIf(() => DownedBossSystem.downedDoG, ModContent.ItemType(), 1, 3, 5); + postDoG.Add(ModContent.ItemType(), 1, 3, 5); // Master items drop in Revengeance - rev.Add(ItemID.EverscreamMasterTrophy, 4); - rev.Add(ItemID.EverscreamPetItem, 20); - npcLoot.Add(rev); + fMoon.OnSuccess(ItemDropRule.ByCondition(DropHelper.RevNoMaster, ItemID.EverscreamMasterTrophy)); + fMoon.OnSuccess(ItemDropRule.ByCondition(DropHelper.RevNoMaster, ItemID.EverscreamPetItem, 4)); + npcLoot.Add(fMoon); break; // Santa-NK1 case NPCID.SantaNK1: // 5-10 Endothermic Energy @ 100% IF Devourer of Gods dead - npcLoot.AddIf(() => DownedBossSystem.downedDoG, ModContent.ItemType(), 1, 5, 10); + postDoG.Add(ModContent.ItemType(), 1, 5, 10); // Master items drop in Revengeance - rev.Add(ItemID.SantankMasterTrophy, 4); - rev.Add(ItemID.SantankMountItem, 20); - npcLoot.Add(rev); + fMoon.OnSuccess(ItemDropRule.ByCondition(DropHelper.RevNoMaster, ItemID.SantankMasterTrophy)); + fMoon.OnSuccess(ItemDropRule.ByCondition(DropHelper.RevNoMaster, ItemID.SantankMountItem, 4)); + npcLoot.Add(fMoon); break; // Ice Queen case NPCID.IceQueen: // 10-20 Endothermic Energy @ 100% IF Devourer of Gods dead - npcLoot.AddIf(() => DownedBossSystem.downedDoG, ModContent.ItemType(), 1, 10, 20); + postDoG.Add(ModContent.ItemType(), 1, 10, 20); // Master items drop in Revengeance - rev.Add(ItemID.IceQueenMasterTrophy, 4); - rev.Add(ItemID.IceQueenPetItem, 20); - npcLoot.Add(rev); + fMoon.OnSuccess(ItemDropRule.ByCondition(DropHelper.RevNoMaster, ItemID.IceQueenMasterTrophy)); + fMoon.OnSuccess(ItemDropRule.ByCondition(DropHelper.RevNoMaster, ItemID.IceQueenPetItem, 4)); + npcLoot.Add(fMoon); break; #endregion @@ -697,7 +706,6 @@ namespace CalamityMod.NPCs // Master items drop in Revengeance rev.Add(ItemID.UFOMasterTrophy); rev.Add(ItemID.MartianPetItem, 4); - npcLoot.Add(rev); break; #endregion @@ -756,7 +764,7 @@ namespace CalamityMod.NPCs // Clothier // Clothiers Wrath @ 100% IF Hardmode case NPCID.Clothier: - npcLoot.AddIf(() => Main.hardMode, ModContent.ItemType()); + hardmode.Add(ModContent.ItemType()); break; // Angler @@ -764,9 +772,10 @@ namespace CalamityMod.NPCs // OTHERWISE, // Golden Fishing Rod @ 8.33% IF Hardmode case NPCID.Angler: - LeadingConditionRule trasherLCR = new(DropHelper.AnglerFedToTrasherCondition); - trasherLCR.Add(ItemID.GoldenFishingRod); - trasherLCR.OnFailedConditions(ItemDropRule.ByCondition(new Conditions.IsHardmode(), ItemID.GoldenFishingRod, 12)); + LeadingConditionRule trasherLCR = new LeadingConditionRule(DropHelper.AnglerFedToTrasherCondition); + trasherLCR.Add(ItemDropRule.ByCondition(DropHelper.TrasherText, ItemID.GoldenFishingRod)); + trasherLCR.OnFailedConditions(ItemDropRule.ByCondition(DropHelper.Hardmode(), ItemID.GoldenFishingRod, 12)); + npcLoot.Add(trasherLCR); break; #endregion @@ -794,10 +803,9 @@ namespace CalamityMod.NPCs // Master items drop in Revengeance rev.Add(ItemID.KingSlimeMasterTrophy); rev.Add(ItemID.KingSlimePetItem, 4); - npcLoot.Add(rev); // Lore - npcLoot.AddConditionalPerPlayer(() => !NPC.downedSlimeKing, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !NPC.downedSlimeKing, ModContent.ItemType(), desc: DropHelper.FirstKillText); break; case NPCID.EyeofCthulhu: @@ -811,10 +819,9 @@ namespace CalamityMod.NPCs // Master items drop in Revengeance rev.Add(ItemID.EyeofCthulhuMasterTrophy); rev.Add(ItemID.EyeOfCthulhuPetItem, 4); - npcLoot.Add(rev); // Lore - npcLoot.AddConditionalPerPlayer(() => !NPC.downedBoss1, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !NPC.downedBoss1, ModContent.ItemType(), desc: DropHelper.FirstKillText); break; case NPCID.EaterofWorldsHead: @@ -824,21 +831,19 @@ namespace CalamityMod.NPCs npcLoot.AddNormalOnly(EoWKill); // Master items drop in Revengeance - LeadingConditionRule RevEoW = new(DropHelper.If((info) => info.npc.boss && !Main.masterMode && CalamityWorld.revenge)); - RevEoW.Add(ItemID.EaterofWorldsMasterTrophy); - RevEoW.Add(ItemID.EaterOfWorldsPetItem, 4); - npcLoot.Add(RevEoW); + rev.AddIf((info) => info.npc.boss, ItemID.EaterofWorldsMasterTrophy); + rev.AddIf((info) => info.npc.boss, ItemID.EaterOfWorldsPetItem, 4); // Corruption World OR Drunk World: Corruption Lore - LeadingConditionRule eowCorruptionLore = new(DropHelper.If((info) => info.npc.boss && (!WorldGen.crimson || WorldGen.drunkWorldGen) && !NPC.downedBoss2)); - eowCorruptionLore.Add(ModContent.ItemType()); - eowCorruptionLore.Add(ModContent.ItemType()); + LeadingConditionRule eowCorruptionLore = new(DropHelper.If((info) => info.npc.boss && (!WorldGen.crimson || WorldGen.drunkWorldGen) && !NPC.downedBoss2, desc: DropHelper.FirstKillText)); + eowCorruptionLore.Add(ModContent.ItemType(), hideLootReport: WorldGen.crimson && !WorldGen.drunkWorldGen); + eowCorruptionLore.Add(ModContent.ItemType(), hideLootReport: WorldGen.crimson && !WorldGen.drunkWorldGen); npcLoot.Add(eowCorruptionLore); // Crimson World OR Drunk World: Crimson Lore - LeadingConditionRule eowCrimsonLore = new(DropHelper.If((info) => info.npc.boss && (WorldGen.crimson || WorldGen.drunkWorldGen) && !NPC.downedBoss2)); - eowCrimsonLore.Add(ModContent.ItemType()); - eowCrimsonLore.Add(ModContent.ItemType()); + LeadingConditionRule eowCrimsonLore = new(DropHelper.If((info) => info.npc.boss && (WorldGen.crimson || WorldGen.drunkWorldGen) && !NPC.downedBoss2, desc: DropHelper.FirstKillText)); + eowCrimsonLore.Add(ModContent.ItemType(), hideLootReport: !WorldGen.crimson && !WorldGen.drunkWorldGen); + eowCrimsonLore.Add(ModContent.ItemType(), hideLootReport: !WorldGen.crimson && !WorldGen.drunkWorldGen); npcLoot.Add(eowCrimsonLore); break; @@ -849,37 +854,47 @@ namespace CalamityMod.NPCs // Master items drop in Revengeance rev.Add(ItemID.BrainofCthulhuMasterTrophy); rev.Add(ItemID.BrainOfCthulhuPetItem, 4); - npcLoot.Add(rev); // Corruption World OR Drunk World: Corruption Lore - LeadingConditionRule bocCorruptionLore = new(DropHelper.If(() => (!WorldGen.crimson || WorldGen.drunkWorldGen) && !NPC.downedBoss2)); - bocCorruptionLore.Add(ModContent.ItemType()); - bocCorruptionLore.Add(ModContent.ItemType()); + LeadingConditionRule bocCorruptionLore = new(DropHelper.If(() => (!WorldGen.crimson || WorldGen.drunkWorldGen) && !NPC.downedBoss2, desc: DropHelper.FirstKillText)); + bocCorruptionLore.Add(ModContent.ItemType(), hideLootReport: WorldGen.crimson && !WorldGen.drunkWorldGen); + bocCorruptionLore.Add(ModContent.ItemType(), hideLootReport: WorldGen.crimson && !WorldGen.drunkWorldGen); npcLoot.Add(bocCorruptionLore); // Crimson World OR Drunk World: Crimson Lore - LeadingConditionRule bocCrimsonLore = new(DropHelper.If(() => (WorldGen.crimson || WorldGen.drunkWorldGen) && !NPC.downedBoss2)); - bocCrimsonLore.Add(ModContent.ItemType()); - bocCrimsonLore.Add(ModContent.ItemType()); + LeadingConditionRule bocCrimsonLore = new(DropHelper.If(() => (WorldGen.crimson || WorldGen.drunkWorldGen) && !NPC.downedBoss2, desc: DropHelper.FirstKillText)); + bocCrimsonLore.Add(ModContent.ItemType(), hideLootReport: !WorldGen.crimson && !WorldGen.drunkWorldGen); + bocCrimsonLore.Add(ModContent.ItemType(), hideLootReport: !WorldGen.crimson && !WorldGen.drunkWorldGen); npcLoot.Add(bocCrimsonLore); break; case NPCID.Deerclops: // Remove the vanilla loot rule for Deerclops' weapon drops. - npcLoot.RemoveWhere((rule) => + try { - if (rule is LeadingConditionRule deerLCR) - return deerLCR.ChainedRules[0] is OneFromRulesRule uselessMediary; - return false; - }); + var deerRootRules = npcLoot.Get(false); + IItemDropRule notExpert = deerRootRules.Find((rule) => rule is LeadingConditionRule deerLCR && deerLCR.condition is Conditions.NotExpert); + if (notExpert is LeadingConditionRule LCR_NotExpert) + { + LCR_NotExpert.ChainedRules.RemoveAll((chainAttempt) => + chainAttempt is Chains.TryIfSucceeded c && c.RuleToChain is OneFromOptionsNotScaledWithLuckDropRule weapons && weapons.dropIds[0] == ItemID.LucyTheAxe); - // Define a replacement rule which drops the weapons Calamity style. - npcLoot.AddNormalOnly(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, ItemID.LucyTheAxe, ItemID.PewMaticHorn, ItemID.WeatherPain, ItemID.HoundiusShootius)); + // Define a replacement rule which drops the weapons Calamity style. + var deerWeapons = new int[] + { + ItemID.LucyTheAxe, + ItemID.PewMaticHorn, + ItemID.WeatherPain, + ItemID.HoundiusShootius + }; + LCR_NotExpert.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, deerWeapons)); + } + } + catch (ArgumentNullException) { } // Master items drop in Revengeance rev.Add(ItemID.DeerclopsMasterTrophy); rev.Add(ItemID.DeerclopsPetItem, 4); - npcLoot.Add(rev); break; case NPCID.QueenBee: @@ -907,10 +922,9 @@ namespace CalamityMod.NPCs // Master items drop in Revengeance rev.Add(ItemID.QueenBeeMasterTrophy); rev.Add(ItemID.QueenBeePetItem, 4); - npcLoot.Add(rev); // Lore - npcLoot.AddConditionalPerPlayer(() => !NPC.downedQueenBee, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !NPC.downedQueenBee, ModContent.ItemType(), desc: DropHelper.FirstKillText); break; case NPCID.SkeletronHead: @@ -932,59 +946,70 @@ namespace CalamityMod.NPCs // Master items drop in Revengeance rev.Add(ItemID.SkeletronMasterTrophy); rev.Add(ItemID.SkeletronPetItem, 4); - npcLoot.Add(rev); // Lore - npcLoot.AddConditionalPerPlayer(() => !NPC.downedBoss3, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !NPC.downedBoss3, ModContent.ItemType(), desc: DropHelper.FirstKillText); break; case NPCID.WallofFlesh: // Remove the vanilla loot rule for Wall of Flesh's weapon drops. - npcLoot.RemoveWhere((rule) => + try { - if (rule is LeadingConditionRule wofLCR) - return wofLCR.ChainedRules[0] is OneFromOptionsNotScaledWithLuckDropRule weapons && weapons.dropIds[0] == ItemID.BreakerBlade; - return false; - }); + var wofRootRules = npcLoot.Get(false); + // Emblem rule happens first, so use FindLast + IItemDropRule notExpert = wofRootRules.FindLast((rule) => rule is LeadingConditionRule wofLCR && wofLCR.condition is Conditions.NotExpert); + if (notExpert is LeadingConditionRule LCR_NotExpert) + { + LCR_NotExpert.ChainedRules.RemoveAll((chainAttempt) => + chainAttempt is Chains.TryIfSucceeded c && c.RuleToChain is OneFromOptionsNotScaledWithLuckDropRule weapons && weapons.dropIds[0] == ItemID.BreakerBlade); - // Define a replacement rule which drops the weapons Calamity style. - var wofWeapons = new int[] - { - ItemID.BreakerBlade, - ItemID.ClockworkAssaultRifle, - ModContent.ItemType(), - ItemID.LaserRifle, - ModContent.ItemType(), - ItemID.FireWhip, // Firecracker - ModContent.ItemType(), - }; - npcLoot.AddNormalOnly(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, wofWeapons)); + // Define a replacement rule which drops the weapons Calamity style. + var wofWeapons = new int[] + { + ItemID.BreakerBlade, + ItemID.ClockworkAssaultRifle, + ModContent.ItemType(), + ItemID.LaserRifle, + ModContent.ItemType(), + ItemID.FireWhip, // Firecracker + ModContent.ItemType(), + }; + LCR_NotExpert.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, wofWeapons)); + } + } + catch (ArgumentNullException) { } // Remove the vanilla loot rule for Wall of Flesh's emblem drops. - npcLoot.RemoveWhere((rule) => + try { - if (rule is LeadingConditionRule wofLCR) - return wofLCR.ChainedRules[0] is OneFromOptionsNotScaledWithLuckDropRule emblems && emblems.dropIds[0] == ItemID.WarriorEmblem; - return false; - }); + var wofRootRules = npcLoot.Get(false); + IItemDropRule notExpert = wofRootRules.Find((rule) => rule is LeadingConditionRule wofLCR && wofLCR.condition is Conditions.NotExpert); + if (notExpert is LeadingConditionRule LCR_NotExpert) + { + LCR_NotExpert.ChainedRules.RemoveAll((chainAttempt) => + chainAttempt is Chains.TryIfSucceeded c && c.RuleToChain is OneFromOptionsNotScaledWithLuckDropRule emblems && emblems.dropIds[0] == ItemID.WarriorEmblem); - // Define a replacement rule which drops the emblems Calamity style. - var wofEmblems = new int[] - { - ItemID.WarriorEmblem, - ItemID.RangerEmblem, - ItemID.SorcererEmblem, - ItemID.SummonerEmblem, - ModContent.ItemType(), - }; - npcLoot.AddNormalOnly(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, wofEmblems)); + // Define a replacement rule which drops the emblems Calamity style. + var wofEmblems = new int[] + { + ItemID.WarriorEmblem, + ItemID.RangerEmblem, + ItemID.SorcererEmblem, + ItemID.SummonerEmblem, + ModContent.ItemType(), + }; + LCR_NotExpert.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, wofEmblems)); + } + } + catch (ArgumentNullException) { } // Would be in the bag otherwise npcLoot.AddNormalOnly(ModContent.ItemType(), 10); // Drop Hermit's Box directly for EACH player, regardles of Expert or not. 100% chance on first kill, 10% chance afterwards. + // The special first kill rule is unlisted in the Bestiary LeadingConditionRule firstWoFKill = new(DropHelper.If(() => !Main.hardMode)); - firstWoFKill.Add(DropHelper.PerPlayer(ModContent.ItemType())); + firstWoFKill.Add(DropHelper.PerPlayer(ModContent.ItemType()), hideLootReport: true); npcLoot.Add(firstWoFKill); LeadingConditionRule subsequentWoFKills = new(DropHelper.If(() => Main.hardMode)); subsequentWoFKills.Add(DropHelper.PerPlayer(ModContent.ItemType(), 10)); @@ -1001,11 +1026,10 @@ namespace CalamityMod.NPCs // Master items drop in Revengeance rev.Add(ItemID.WallofFleshMasterTrophy); rev.Add(ItemID.WallOfFleshGoatMountItem, 4); - npcLoot.Add(rev); // Lore - LeadingConditionRule wofLore = npcLoot.AddConditionalPerPlayer(() => !Main.hardMode, ModContent.ItemType()); - wofLore.Add(DropHelper.PerPlayer(ModContent.ItemType())); + npcLoot.AddConditionalPerPlayer(() => !Main.hardMode, ModContent.ItemType(), desc: DropHelper.FirstKillText); + npcLoot.AddConditionalPerPlayer(() => !Main.hardMode, ModContent.ItemType(), desc: DropHelper.FirstKillText); break; case NPCID.QueenSlimeBoss: @@ -1019,7 +1043,6 @@ namespace CalamityMod.NPCs // Master items drop in Revengeance rev.Add(ItemID.QueenSlimeMasterTrophy); rev.Add(ItemID.QueenSlimePetItem, 4); - npcLoot.Add(rev); break; @@ -1036,11 +1059,10 @@ namespace CalamityMod.NPCs // Master items drop in Revengeance rev.Add(ItemID.DestroyerMasterTrophy); rev.Add(ItemID.DestroyerPetItem, 4); - npcLoot.Add(rev); // Lore - npcLoot.AddConditionalPerPlayer(() => !NPC.downedMechBoss1, ModContent.ItemType()); - npcLoot.AddConditionalPerPlayer(ShouldDropMechLore, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !NPC.downedMechBoss1, ModContent.ItemType(), desc: DropHelper.FirstKillText); + npcLoot.AddConditionalPerPlayer(ShouldDropMechLore, ModContent.ItemType(), desc: DropHelper.MechBossText); break; case NPCID.Retinazer: @@ -1071,12 +1093,12 @@ namespace CalamityMod.NPCs npcLoot.AddIf((info) => !Main.expertMode && IsLastTwinStanding(info), ModContent.ItemType(), 10); // Master items drop in Revengeance - npcLoot.AddIf((info) => !Main.masterMode && CalamityWorld.revenge && IsLastTwinStanding(info), ItemID.TwinsMasterTrophy); - npcLoot.AddIf((info) => !Main.masterMode && CalamityWorld.revenge && IsLastTwinStanding(info), ItemID.TwinsPetItem, 4); + rev.AddIf((info) => IsLastTwinStanding(info), ItemID.TwinsMasterTrophy); + rev.AddIf((info) => IsLastTwinStanding(info), ItemID.TwinsPetItem, 4); // Lore - npcLoot.AddConditionalPerPlayer((info) => !NPC.downedMechBoss2 && IsLastTwinStanding(info), ModContent.ItemType()); - npcLoot.AddConditionalPerPlayer(ShouldDropMechLore, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer((info) => !NPC.downedMechBoss2 && IsLastTwinStanding(info), ModContent.ItemType(), desc: DropHelper.FirstKillText); + npcLoot.AddConditionalPerPlayer(ShouldDropMechLore, ModContent.ItemType(), desc: DropHelper.MechBossText); break; case NPCID.SkeletronPrime: @@ -1092,11 +1114,10 @@ namespace CalamityMod.NPCs // Master items drop in Revengeance rev.Add(ItemID.SkeletronPrimeMasterTrophy); rev.Add(ItemID.SkeletronPrimePetItem, 4); - npcLoot.Add(rev); // Lore - npcLoot.AddConditionalPerPlayer(() => !NPC.downedMechBoss3, ModContent.ItemType()); - npcLoot.AddConditionalPerPlayer(ShouldDropMechLore, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !NPC.downedMechBoss3, ModContent.ItemType(), desc: DropHelper.FirstKillText); + npcLoot.AddConditionalPerPlayer(ShouldDropMechLore, ModContent.ItemType(), desc: DropHelper.MechBossText); break; case NPCID.Plantera: @@ -1153,10 +1174,9 @@ namespace CalamityMod.NPCs // Master items drop in Revengeance rev.Add(ItemID.PlanteraMasterTrophy); rev.Add(ItemID.PlanteraPetItem, 4); - npcLoot.Add(rev); // Lore - npcLoot.AddConditionalPerPlayer(() => !NPC.downedPlantBoss, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !NPC.downedPlantBoss, ModContent.ItemType(), desc: DropHelper.FirstKillText); break; case NPCID.Golem: @@ -1208,10 +1228,9 @@ namespace CalamityMod.NPCs // Master items drop in Revengeance rev.Add(ItemID.GolemMasterTrophy); rev.Add(ItemID.GolemPetItem, 4); - npcLoot.Add(rev); // Lore - npcLoot.AddConditionalPerPlayer(() => !NPC.downedGolemBoss, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !NPC.downedGolemBoss, ModContent.ItemType(), desc: DropHelper.FirstKillText); break; case NPCID.DD2Betsy: @@ -1241,7 +1260,6 @@ namespace CalamityMod.NPCs // Master items drop in Revengeance rev.Add(ItemID.BetsyMasterTrophy); rev.Add(ItemID.DD2BetsyPetItem, 4); - npcLoot.Add(rev); break; @@ -1286,10 +1304,9 @@ namespace CalamityMod.NPCs // Master items drop in Revengeance rev.Add(ItemID.DukeFishronMasterTrophy); rev.Add(ItemID.DukeFishronPetItem, 4); - npcLoot.Add(rev); // Lore - npcLoot.AddConditionalPerPlayer(() => !NPC.downedFishron, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !NPC.downedFishron, ModContent.ItemType(), desc: DropHelper.FirstKillText); break; case NPCID.HallowBoss: @@ -1333,7 +1350,6 @@ namespace CalamityMod.NPCs // Master items drop in Revengeance rev.Add(ItemID.FairyQueenMasterTrophy); rev.Add(ItemID.FairyQueenPetItem, 4); - npcLoot.Add(rev); break; @@ -1341,13 +1357,12 @@ namespace CalamityMod.NPCs // Master items drop in Revengeance rev.Add(ItemID.LunaticCultistMasterTrophy); rev.Add(ItemID.LunaticCultistPetItem, 4); - npcLoot.Add(rev); // Lore - npcLoot.AddConditionalPerPlayer(() => !NPC.downedAncientCultist, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !NPC.downedAncientCultist, ModContent.ItemType(), desc: DropHelper.FirstKillText); // Special Blood Moon Lore - npcLoot.AddConditionalPerPlayer(() => Main.bloodMoon, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => Main.bloodMoon, ModContent.ItemType(), desc: DropHelper.BloodMoonText); break; case NPCID.MoonLordCore: @@ -1391,10 +1406,9 @@ namespace CalamityMod.NPCs // Master items drop in Revengeance rev.Add(ItemID.MoonLordMasterTrophy); rev.Add(ItemID.MoonLordPetItem, 4); - npcLoot.Add(rev); // Lore - npcLoot.AddConditionalPerPlayer(() => !NPC.downedMoonlord, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !NPC.downedMoonlord, ModContent.ItemType(), desc: DropHelper.FirstKillText); break; default: @@ -1653,15 +1667,6 @@ namespace CalamityMod.NPCs case NPCID.CultistBoss: SetNewBossJustDowned(npc); - - // Deus text (this is not a loot function) - if (!NPC.downedAncientCultist) - { - string key4 = "Mods.CalamityMod.DeusText"; - Color messageColor4 = Color.Gold; - - CalamityUtils.DisplayLocalizedText(key4, messageColor4); - } break; case NPCID.LunarTowerSolar: diff --git a/NPCs/CalamityGlobalTownNPC.cs b/NPCs/CalamityGlobalTownNPC.cs index 43cf7b92c7..ac9b47bc4c 100644 --- a/NPCs/CalamityGlobalTownNPC.cs +++ b/NPCs/CalamityGlobalTownNPC.cs @@ -72,6 +72,7 @@ namespace CalamityMod.NPCs "Fire", // <@!354362326947856384> (fire#0692) "Barney Calhoun", // <@!634462901431697410> (Potato Power#6578) "XiaoEn0426", // <@!440448864772816896> (XiaoEn0426#9157) + "Jeffred", // <@!295362230038560768> (Knight Solaire#0873) }; private static readonly string[] ClothierNames = { diff --git a/NPCs/CeaselessVoid/CeaselessVoid.cs b/NPCs/CeaselessVoid/CeaselessVoid.cs index 72043baf3c..8da7a61967 100644 --- a/NPCs/CeaselessVoid/CeaselessVoid.cs +++ b/NPCs/CeaselessVoid/CeaselessVoid.cs @@ -53,7 +53,6 @@ namespace CalamityMod.NPCs.CeaselessVoid global.DR = 0.5f; NPC.LifeMaxNERB(64400, 77280, 72000); NPC.value = Item.buyPrice(2, 0, 0, 0); - Music = CalamityMod.Instance.GetMusicFromMusicMod("CeaselessVoid") ?? MusicID.Boss3; double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.aiStyle = -1; @@ -218,18 +217,19 @@ namespace CalamityMod.NPCs.CeaselessVoid // Vanity normalOnly.Add(ModContent.ItemType(), 7); - normalOnly.Add(ItemDropRule.Common(ModContent.ItemType(), 20). - OnSuccess(ItemDropRule.Common(ModContent.ItemType())). - OnSuccess(ItemDropRule.Common(ModContent.ItemType()))); + var godSlayerVanity = ItemDropRule.Common(ModContent.ItemType(), 20); + godSlayerVanity.OnSuccess(ItemDropRule.Common(ModContent.ItemType())); + godSlayerVanity.OnSuccess(ItemDropRule.Common(ModContent.ItemType())); + normalOnly.Add(godSlayerVanity); } npcLoot.Add(ModContent.ItemType(), 10); // Relic - npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType()); + npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType()); // Lore - npcLoot.AddConditionalPerPlayer(LastSentinelKilled, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(LastSentinelKilled, ModContent.ItemType(), desc: DropHelper.SentinelText); } public override void ScaleExpertStats(int numPlayers, float bossLifeScale) diff --git a/NPCs/Crabulon/Crabulon.cs b/NPCs/Crabulon/Crabulon.cs index fb6ddd012f..1f9491ffa0 100644 --- a/NPCs/Crabulon/Crabulon.cs +++ b/NPCs/Crabulon/Crabulon.cs @@ -63,7 +63,6 @@ namespace CalamityMod.NPCs.Crabulon AIType = -1; NPC.noGravity = false; NPC.noTileCollide = false; - Music = CalamityMod.Instance.GetMusicFromMusicMod("Crabulon") ?? MusicID.Boss4; NPC.boss = true; NPC.knockBackResist = 0f; NPC.value = Item.buyPrice(0, 10, 0, 0); @@ -836,10 +835,10 @@ namespace CalamityMod.NPCs.Crabulon npcLoot.Add(ModContent.ItemType(), 10); // Relic - npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType()); + npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType()); // Lore - npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedCrabulon, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedCrabulon, ModContent.ItemType(), desc: DropHelper.FirstKillText); } public override void OnKill() diff --git a/NPCs/Crags/CalamityEye.cs b/NPCs/Crags/CalamityEye.cs index 5dd763a2e0..7f430dd35c 100644 --- a/NPCs/Crags/CalamityEye.cs +++ b/NPCs/Crags/CalamityEye.cs @@ -5,6 +5,7 @@ using CalamityMod.Items.Placeables.Banners; using Microsoft.Xna.Framework; using Terraria; using Terraria.GameContent.Bestiary; +using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.Crags @@ -135,8 +136,10 @@ namespace CalamityMod.NPCs.Crags public override void ModifyNPCLoot(NPCLoot npcLoot) { npcLoot.Add(ItemID.Lens, 2); - npcLoot.AddIf(() => Main.hardMode, ModContent.ItemType(), 3); - npcLoot.AddIf(() => DownedBossSystem.downedProvidence, ModContent.ItemType(), 4); + LeadingConditionRule hardmode = npcLoot.DefineConditionalDropSet(DropHelper.Hardmode()); + LeadingConditionRule postProv = npcLoot.DefineConditionalDropSet(DropHelper.PostProv()); + hardmode.Add(ModContent.ItemType(), 3); + postProv.Add(ModContent.ItemType(), 4); } } } diff --git a/NPCs/Crags/CharredSlime.cs b/NPCs/Crags/CharredSlime.cs index 1d69635ec8..2ea43b2278 100644 --- a/NPCs/Crags/CharredSlime.cs +++ b/NPCs/Crags/CharredSlime.cs @@ -6,6 +6,7 @@ using CalamityMod.Items.Placeables.Ores; using CalamityMod.Items.Materials; using Terraria; using Terraria.GameContent.Bestiary; +using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.Crags @@ -91,8 +92,9 @@ namespace CalamityMod.NPCs.Crags public override void ModifyNPCLoot(NPCLoot npcLoot) { npcLoot.Add(ModContent.ItemType(), 1, 10, 26); - npcLoot.AddIf(() => Main.hardMode, ModContent.ItemType(), 3); - npcLoot.AddIf(() => DownedBossSystem.downedProvidence, ModContent.ItemType(), 4); + npcLoot.Add(ModContent.ItemType(), 3); + LeadingConditionRule postProv = npcLoot.DefineConditionalDropSet(DropHelper.PostProv()); + postProv.Add(ModContent.ItemType(), 4); } } } diff --git a/NPCs/Crags/CultistAssassin.cs b/NPCs/Crags/CultistAssassin.cs index 9a119622fc..82c0eb59cf 100644 --- a/NPCs/Crags/CultistAssassin.cs +++ b/NPCs/Crags/CultistAssassin.cs @@ -4,6 +4,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using Terraria; using Terraria.GameContent.Bestiary; +using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.Crags @@ -89,8 +90,9 @@ namespace CalamityMod.NPCs.Crags public override void ModifyNPCLoot(NPCLoot npcLoot) { - npcLoot.AddIf(() => Main.hardMode, ModContent.ItemType(), 3); - npcLoot.AddIf(() => DownedBossSystem.downedProvidence, ModContent.ItemType(), 4); + npcLoot.Add(ModContent.ItemType(), 3); + LeadingConditionRule postProv = npcLoot.DefineConditionalDropSet(DropHelper.PostProv()); + postProv.Add(ModContent.ItemType(), 4); } } } diff --git a/NPCs/Crags/DespairStone.cs b/NPCs/Crags/DespairStone.cs index 71573783ff..be199f9ab7 100644 --- a/NPCs/Crags/DespairStone.cs +++ b/NPCs/Crags/DespairStone.cs @@ -6,6 +6,7 @@ using CalamityMod.Items.Placeables.Banners; using CalamityMod.World; using Terraria; using Terraria.GameContent.Bestiary; +using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.Crags @@ -68,8 +69,10 @@ namespace CalamityMod.NPCs.Crags public override void ModifyNPCLoot(NPCLoot npcLoot) { - npcLoot.AddIf(() => Main.hardMode, ModContent.ItemType(), 3); - npcLoot.AddIf(() => DownedBossSystem.downedProvidence, ModContent.ItemType(), 4); + LeadingConditionRule hardmode = npcLoot.DefineConditionalDropSet(DropHelper.Hardmode()); + LeadingConditionRule postProv = npcLoot.DefineConditionalDropSet(DropHelper.PostProv()); + hardmode.Add(ModContent.ItemType(), 3); + postProv.Add(ModContent.ItemType(), 4); } public override void OnHitPlayer(Player player, int damage, bool crit) diff --git a/NPCs/Crags/HeatSpirit.cs b/NPCs/Crags/HeatSpirit.cs index 0bf06cc321..b0a6c67802 100644 --- a/NPCs/Crags/HeatSpirit.cs +++ b/NPCs/Crags/HeatSpirit.cs @@ -6,6 +6,7 @@ using CalamityMod.Items.Placeables.Banners; using System; using Terraria; using Terraria.GameContent.Bestiary; +using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.Crags @@ -114,7 +115,8 @@ namespace CalamityMod.NPCs.Crags public override void ModifyNPCLoot(NPCLoot npcLoot) { - npcLoot.AddIf(() => Main.hardMode, ModContent.ItemType(), 4); + LeadingConditionRule hardmode = npcLoot.DefineConditionalDropSet(DropHelper.Hardmode()); + hardmode.Add(ModContent.ItemType(), 3); } } } diff --git a/NPCs/Crags/Scryllar.cs b/NPCs/Crags/Scryllar.cs index 97112a38a7..665395a864 100644 --- a/NPCs/Crags/Scryllar.cs +++ b/NPCs/Crags/Scryllar.cs @@ -6,6 +6,7 @@ using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Weapons.Summon; using Terraria; using Terraria.GameContent.Bestiary; +using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.ModLoader; @@ -266,10 +267,11 @@ namespace CalamityMod.NPCs.Crags public static void DefineScryllarLoot(NPCLoot npcLoot) { - npcLoot.AddIf(() => Main.hardMode, ModContent.ItemType(), 3); - var postProvidence = npcLoot.DefineConditionalDropSet(() => DownedBossSystem.downedProvidence); - postProvidence.Add(ModContent.ItemType(), 4); - postProvidence.Add(ModContent.ItemType(), 20); + LeadingConditionRule hardmode = npcLoot.DefineConditionalDropSet(DropHelper.Hardmode()); + LeadingConditionRule postProv = npcLoot.DefineConditionalDropSet(DropHelper.PostProv()); + hardmode.Add(ModContent.ItemType(), 3); + postProv.Add(ModContent.ItemType(), 4); + postProv.Add(ModContent.ItemType(), 20); } public override void ModifyNPCLoot(NPCLoot npcLoot) => DefineScryllarLoot(npcLoot); diff --git a/NPCs/Crags/SoulSlurper.cs b/NPCs/Crags/SoulSlurper.cs index c92bc2e85d..109e553561 100644 --- a/NPCs/Crags/SoulSlurper.cs +++ b/NPCs/Crags/SoulSlurper.cs @@ -11,6 +11,7 @@ using System; using Terraria; using Terraria.GameContent; using Terraria.GameContent.Bestiary; +using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.Crags @@ -290,10 +291,14 @@ namespace CalamityMod.NPCs.Crags public override void ModifyNPCLoot(NPCLoot npcLoot) { - npcLoot.AddIf(() => !Main.hardMode, ModContent.ItemType(), 10); - npcLoot.AddIf(() => Main.hardMode, ModContent.ItemType(), 30); - npcLoot.AddIf(() => Main.hardMode, ModContent.ItemType(), 3); - npcLoot.AddIf(() => DownedBossSystem.downedProvidence, ModContent.ItemType(), 4); + LeadingConditionRule fishing = npcLoot.DefineConditionalDropSet(() => Main.hardMode); + fishing.Add(ModContent.ItemType(), 30, hideLootReport: !Main.hardMode); + fishing.AddFail(ModContent.ItemType(), 10, hideLootReport: Main.hardMode); + + LeadingConditionRule hardmode = npcLoot.DefineConditionalDropSet(DropHelper.Hardmode()); + LeadingConditionRule postProv = npcLoot.DefineConditionalDropSet(DropHelper.PostProv()); + hardmode.Add(ModContent.ItemType(), 3); + postProv.Add(ModContent.ItemType(), 4); } public override void OnHitPlayer(Player player, int damage, bool crit) diff --git a/NPCs/Cryogen/Cryogen.cs b/NPCs/Cryogen/Cryogen.cs index 027444e143..c0bfe3f49c 100644 --- a/NPCs/Cryogen/Cryogen.cs +++ b/NPCs/Cryogen/Cryogen.cs @@ -69,7 +69,6 @@ namespace CalamityMod.NPCs.Cryogen NPC.coldDamage = true; NPC.HitSound = SoundID.NPCHit5; NPC.DeathSound = SoundID.NPCDeath15; - Music = CalamityMod.Instance.GetMusicFromMusicMod("Cryogen") ?? MusicID.FrostMoon; NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = false; NPC.Calamity().VulnerableToSickness = false; @@ -1162,9 +1161,7 @@ namespace CalamityMod.NPCs.Cryogen ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType() + ModContent.ItemType() }; normalOnly.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, weapons)); normalOnly.Add(ModContent.ItemType(), 10); @@ -1177,6 +1174,8 @@ namespace CalamityMod.NPCs.Cryogen // Equipment normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); + normalOnly.Add(ModContent.ItemType(), DropHelper.NormalWeaponDropRateFraction); + normalOnly.Add(ModContent.ItemType(), DropHelper.NormalWeaponDropRateFraction); } npcLoot.Add(ItemID.FrozenKey, 3); @@ -1185,10 +1184,10 @@ namespace CalamityMod.NPCs.Cryogen npcLoot.Add(ModContent.ItemType(), 10); // Relic - npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType()); + npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType()); // Lore - npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedCryogen, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedCryogen, ModContent.ItemType(), desc: DropHelper.FirstKillText); } public override void OnKill() diff --git a/NPCs/DesertScourge/DesertScourgeBody.cs b/NPCs/DesertScourge/DesertScourgeBody.cs index 4dbffff7c1..a46b777189 100644 --- a/NPCs/DesertScourge/DesertScourgeBody.cs +++ b/NPCs/DesertScourge/DesertScourgeBody.cs @@ -34,7 +34,6 @@ namespace CalamityMod.NPCs.DesertScourge NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.boss = true; - Music = CalamityMod.Instance.GetMusicFromMusicMod("DesertScourge") ?? MusicID.Boss1; NPC.behindTiles = true; NPC.noGravity = true; NPC.noTileCollide = true; diff --git a/NPCs/DesertScourge/DesertScourgeHead.cs b/NPCs/DesertScourge/DesertScourgeHead.cs index b0d1c5567e..7a29cc7adb 100644 --- a/NPCs/DesertScourge/DesertScourgeHead.cs +++ b/NPCs/DesertScourge/DesertScourgeHead.cs @@ -81,7 +81,6 @@ namespace CalamityMod.NPCs.DesertScourge NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; NPC.netAlways = true; - Music = CalamityMod.Instance.GetMusicFromMusicMod("DesertScourge") ?? MusicID.Boss1; if (BossRushEvent.BossRushActive) NPC.scale *= 1.25f; @@ -690,7 +689,7 @@ namespace CalamityMod.NPCs.DesertScourge npcLoot.Add(ItemDropRule.BossBag(ModContent.ItemType())); // Extraneous potions - npcLoot.Add(DropHelper.PerPlayer(ItemID.LesserHealingPotion, 1, 8, 14)); + npcLoot.DefineConditionalDropSet(() => true).Add(DropHelper.PerPlayer(ItemID.LesserHealingPotion, 1, 5, 15), hideLootReport: true); // Healing Potions don't show up in the Bestiary // Normal drops: Everything that would otherwise be in the bag var normalOnly = npcLoot.DefineNormalOnlyDropSet(); @@ -702,9 +701,7 @@ namespace CalamityMod.NPCs.DesertScourge ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType() + ModContent.ItemType() }; normalOnly.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, items)); @@ -719,6 +716,8 @@ namespace CalamityMod.NPCs.DesertScourge // Equipment normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); + normalOnly.Add(ModContent.ItemType(), DropHelper.NormalWeaponDropRateFraction); + normalOnly.Add(ModContent.ItemType(), DropHelper.NormalWeaponDropRateFraction); // Fishing normalOnly.Add(ModContent.ItemType()); @@ -728,10 +727,10 @@ namespace CalamityMod.NPCs.DesertScourge npcLoot.Add(ModContent.ItemType(), 10); // Relic - npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType()); + npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType()); // Lore - npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedDesertScourge, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedDesertScourge, ModContent.ItemType(), desc: DropHelper.FirstKillText); } #endregion diff --git a/NPCs/DesertScourge/DesertScourgeTail.cs b/NPCs/DesertScourge/DesertScourgeTail.cs index 4001f0a311..09281ff983 100644 --- a/NPCs/DesertScourge/DesertScourgeTail.cs +++ b/NPCs/DesertScourge/DesertScourgeTail.cs @@ -34,7 +34,6 @@ namespace CalamityMod.NPCs.DesertScourge NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.boss = true; - Music = CalamityMod.Instance.GetMusicFromMusicMod("DesertScourge") ?? MusicID.Boss1; NPC.behindTiles = true; NPC.noGravity = true; NPC.noTileCollide = true; diff --git a/NPCs/DevourerofGods/DevourerofGodsBody.cs b/NPCs/DevourerofGods/DevourerofGodsBody.cs index 5b70fc0287..21f5319803 100644 --- a/NPCs/DevourerofGods/DevourerofGodsBody.cs +++ b/NPCs/DevourerofGods/DevourerofGodsBody.cs @@ -67,7 +67,6 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.DeathSound = SoundID.NPCDeath14; NPC.netAlways = true; NPC.boss = true; - Music = CalamityMod.Instance.GetMusicFromMusicMod("DevourerOfGodsP1") ?? MusicID.Boss3; NPC.dontCountMe = true; if (Main.getGoodWorld) @@ -146,10 +145,6 @@ namespace CalamityMod.NPCs.DevourerofGods { phase2Started = true; - // Play music after the transiton BS - if (Main.npc[(int)NPC.ai[2]].localAI[2] == 530f) - Music = CalamityMod.Instance.GetMusicFromMusicMod("DevourerOfGodsP2") ?? MusicID.LunarBoss; - // Once before DoG spawns, set new size if (Main.npc[(int)NPC.ai[2]].localAI[2] == 60f) { diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index 4973104760..bbb3621966 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -196,7 +196,6 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.noTileCollide = true; NPC.DeathSound = SoundID.NPCDeath14; NPC.netAlways = true; - Music = CalamityMod.Instance.GetMusicFromMusicMod("DevourerOfGodsP1") ?? MusicID.Boss3; if (Main.getGoodWorld) NPC.scale *= 1.5f; @@ -322,6 +321,7 @@ namespace CalamityMod.NPCs.DevourerofGods // whoAmI variable CalamityGlobalNPC.DoGHead = NPC.whoAmI; + CalamityGlobalNPC.DoGP2 = -1; // Stop rain CalamityMod.StopRain(); @@ -499,8 +499,8 @@ namespace CalamityMod.NPCs.DevourerofGods } // Play music after the transiton BS - if (NPC.localAI[2] == 530f) - Music = CalamityMod.Instance.GetMusicFromMusicMod("DevourerOfGodsP2") ?? MusicID.LunarBoss; + if (NPC.localAI[2] <= 530f) + CalamityGlobalNPC.DoGP2 = NPC.whoAmI; // Once before DoG spawns, set new size and become visible again. if (NPC.localAI[2] == 60f) @@ -2365,7 +2365,7 @@ namespace CalamityMod.NPCs.DevourerofGods npcLoot.Add(ItemDropRule.BossBag(ModContent.ItemType())); // Extraneous potions - npcLoot.Add(DropHelper.PerPlayer(ModContent.ItemType(), 1, 5, 15)); + npcLoot.DefineConditionalDropSet(() => true).Add(DropHelper.PerPlayer(ModContent.ItemType(), 1, 5, 15), hideLootReport: true); // Healing Potions don't show up in the Bestiary // Fabsol Mount npcLoot.AddIf((info) => info.player.Calamity().fabsolVodka, ModContent.ItemType()); @@ -2399,13 +2399,13 @@ namespace CalamityMod.NPCs.DevourerofGods } // Relic - npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType()); + npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType()); // Trophy (always directly from boss, never in bag) npcLoot.Add(ModContent.ItemType(), 10); // Lore - npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedDoG, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedDoG, ModContent.ItemType(), desc: DropHelper.FirstKillText); } // Can only hit the target if within certain distance diff --git a/NPCs/DevourerofGods/DevourerofGodsTail.cs b/NPCs/DevourerofGods/DevourerofGodsTail.cs index 13a04766de..678c49de21 100644 --- a/NPCs/DevourerofGods/DevourerofGodsTail.cs +++ b/NPCs/DevourerofGods/DevourerofGodsTail.cs @@ -70,7 +70,6 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.netAlways = true; NPC.boss = true; NPC.takenDamageMultiplier = 1.25f; - Music = CalamityMod.Instance.GetMusicFromMusicMod("DevourerOfGodsP1") ?? MusicID.Boss3; NPC.dontCountMe = true; if (Main.getGoodWorld) @@ -148,10 +147,6 @@ namespace CalamityMod.NPCs.DevourerofGods { phase2Started = true; - // Play music after the transiton BS - if (Main.npc[(int)NPC.ai[2]].localAI[2] == 530f) - Music = CalamityMod.Instance.GetMusicFromMusicMod("DevourerOfGodsP2") ?? MusicID.LunarBoss; - // Once before DoG spawns, set new size if (Main.npc[(int)NPC.ai[2]].localAI[2] == 60f) { diff --git a/NPCs/DraedonLabThings/RepairUnitCritter.cs b/NPCs/DraedonLabThings/RepairUnitCritter.cs index faa37208d7..efc179de13 100644 --- a/NPCs/DraedonLabThings/RepairUnitCritter.cs +++ b/NPCs/DraedonLabThings/RepairUnitCritter.cs @@ -1,4 +1,5 @@ using CalamityMod.BiomeManagers; +using CalamityMod.Items.Critters; using CalamityMod.Items.DraedonMisc; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -52,6 +53,7 @@ namespace CalamityMod.NPCs.DraedonLabThings { DisplayName.SetDefault("Repair Unit"); Main.npcFrameCount[NPC.type] = 17; + Main.npcCatchable[NPC.type] = true; NPCID.Sets.CountsAsCritter[NPC.type] = true; NPCID.Sets.NormalGoldCritterBestiaryPriority.Add(Type); } @@ -70,6 +72,7 @@ namespace CalamityMod.NPCs.DraedonLabThings NPC.chaseable = false; NPC.HitSound = SoundID.NPCHit4; NPC.DeathSound = SoundID.NPCDeath44; + NPC.catchItem = (short)ModContent.ItemType(); SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; } diff --git a/NPCs/ExoMechs/Apollo/Apollo.cs b/NPCs/ExoMechs/Apollo/Apollo.cs index 8446023200..54499788ba 100644 --- a/NPCs/ExoMechs/Apollo/Apollo.cs +++ b/NPCs/ExoMechs/Apollo/Apollo.cs @@ -161,7 +161,6 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo NPC.DeathSound = SoundID.NPCDeath14; NPC.netAlways = true; NPC.boss = true; - Music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; } diff --git a/NPCs/ExoMechs/Ares/AresBody.cs b/NPCs/ExoMechs/Ares/AresBody.cs index 8825a3ddc7..5222e1a8b5 100644 --- a/NPCs/ExoMechs/Ares/AresBody.cs +++ b/NPCs/ExoMechs/Ares/AresBody.cs @@ -175,7 +175,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares NPC.DeathSound = SoundID.NPCDeath14; NPC.netAlways = true; NPC.boss = true; - Music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; } @@ -1347,10 +1346,10 @@ namespace CalamityMod.NPCs.ExoMechs.Ares mainDrops.Add(ItemDropRule.ByCondition(DropHelper.If(info => info.npc.type == ModContent.NPCType()), ModContent.ItemType())); // Relic - mainDrops.Add(ItemDropRule.ByCondition(DropHelper.If(() => Main.masterMode || CalamityWorld.revenge), ModContent.ItemType())); + npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).AddIf(CanDropLoot, ModContent.ItemType()); // Lore item - mainDrops.Add(ItemDropRule.ByCondition(DropHelper.If(() => !DownedBossSystem.downedExoMechs), ModContent.ItemType())); + mainDrops.Add(ItemDropRule.ByCondition(DropHelper.If(() => !DownedBossSystem.downedExoMechs, desc: DropHelper.FirstKillText), ModContent.ItemType())); // Treasure bag npcLoot.Add(ItemDropRule.BossBagByCondition(DropHelper.If(CanDropLoot), ModContent.ItemType())); diff --git a/NPCs/ExoMechs/Ares/AresGaussNuke.cs b/NPCs/ExoMechs/Ares/AresGaussNuke.cs index 676e87ff56..5c193af9c6 100644 --- a/NPCs/ExoMechs/Ares/AresGaussNuke.cs +++ b/NPCs/ExoMechs/Ares/AresGaussNuke.cs @@ -91,7 +91,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares NPC.netAlways = true; NPC.boss = true; NPC.hide = true; - Music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; } diff --git a/NPCs/ExoMechs/Ares/AresLaserCannon.cs b/NPCs/ExoMechs/Ares/AresLaserCannon.cs index 9be9af1181..cb6ff11dbb 100644 --- a/NPCs/ExoMechs/Ares/AresLaserCannon.cs +++ b/NPCs/ExoMechs/Ares/AresLaserCannon.cs @@ -94,7 +94,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares NPC.netAlways = true; NPC.boss = true; NPC.hide = true; - Music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; } diff --git a/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs b/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs index cd97aef04d..56ec12c7db 100644 --- a/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs +++ b/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs @@ -89,7 +89,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares NPC.netAlways = true; NPC.boss = true; NPC.hide = true; - Music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; } diff --git a/NPCs/ExoMechs/Ares/AresTeslaCannon.cs b/NPCs/ExoMechs/Ares/AresTeslaCannon.cs index 6e343e0abf..5a7032df76 100644 --- a/NPCs/ExoMechs/Ares/AresTeslaCannon.cs +++ b/NPCs/ExoMechs/Ares/AresTeslaCannon.cs @@ -89,7 +89,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares NPC.netAlways = true; NPC.boss = true; NPC.hide = true; - Music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; } diff --git a/NPCs/ExoMechs/Artemis/Artemis.cs b/NPCs/ExoMechs/Artemis/Artemis.cs index d40cb4b990..c67b8d8804 100644 --- a/NPCs/ExoMechs/Artemis/Artemis.cs +++ b/NPCs/ExoMechs/Artemis/Artemis.cs @@ -177,7 +177,6 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis NPC.DeathSound = SoundID.NPCDeath14; NPC.netAlways = true; NPC.boss = true; - Music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; } diff --git a/NPCs/ExoMechs/Draedon.cs b/NPCs/ExoMechs/Draedon.cs index a0f65ca720..a3434fbec1 100644 --- a/NPCs/ExoMechs/Draedon.cs +++ b/NPCs/ExoMechs/Draedon.cs @@ -100,8 +100,6 @@ namespace CalamityMod.NPCs.ExoMechs NPC.aiStyle = AIType = -1; NPC.knockBackResist = 0f; NPC.DeathSound = SoundID.NPCDeath14; - // This is required for Draedon to be able to play his ambience. - NPC.boss = true; NPC.Calamity().ProvidesProximityRage = false; } @@ -140,23 +138,16 @@ namespace CalamityMod.NPCs.ExoMechs { // Set the whoAmI variable. CalamityGlobalNPC.draedon = NPC.whoAmI; + CalamityGlobalNPC.draedonAmbience = -1; // Prevent stupid natural despawns. NPC.timeLeft = 3600; // Emit music. If the battle is ongoing, Draedon emits the battle theme. - if (ExoMechIsPresent) - { - Music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; - SceneEffectPriority = SceneEffectPriority.BossLow; - } // Otherwise, he emits his trademark ambience. // This takes priority over anything except Moon Lord's music fadeout. - else - { - Music = MusicLoader.GetMusicSlot(Mod, "Sounds/Music/DraedonAmbience"); - SceneEffectPriority = SceneEffectPriority.BossMedium; - } + if (!ExoMechIsPresent) + CalamityGlobalNPC.draedonAmbience = NPC.whoAmI; // Decide an initial target and play a teleport sound on the first frame. if (TalkTimer == 0f) diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs index 6368cb68c2..4624fd8689 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs @@ -80,7 +80,6 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos NPC.dontCountMe = true; NPC.chaseable = false; NPC.boss = true; - Music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; } diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs index 0873eb1d4c..a2a4fdd8e8 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs @@ -80,7 +80,6 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos NPC.dontCountMe = true; NPC.chaseable = false; NPC.boss = true; - Music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; } diff --git a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs index 1a09fb9830..b754ba711d 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs @@ -158,7 +158,6 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos NPC.netAlways = true; NPC.boss = true; NPC.chaseable = false; - Music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; } diff --git a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs index b02a12252a..1b482a61d9 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs @@ -80,7 +80,6 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos NPC.dontCountMe = true; NPC.chaseable = false; NPC.boss = true; - Music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; } diff --git a/NPCs/GreatSandShark/GreatSandShark.cs b/NPCs/GreatSandShark/GreatSandShark.cs index 4aceb2b677..6819585f38 100644 --- a/NPCs/GreatSandShark/GreatSandShark.cs +++ b/NPCs/GreatSandShark/GreatSandShark.cs @@ -639,7 +639,7 @@ namespace CalamityMod.NPCs.GreatSandShark npcLoot.Add(ModContent.ItemType(), 10); // Relic - npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType(), 4); + npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType(), 4); } public override void OnKill() diff --git a/NPCs/HiveMind/HiveMind.cs b/NPCs/HiveMind/HiveMind.cs index d4b5edbb37..c13bab4306 100644 --- a/NPCs/HiveMind/HiveMind.cs +++ b/NPCs/HiveMind/HiveMind.cs @@ -118,7 +118,6 @@ namespace CalamityMod.NPCs.HiveMind NPC.boss = true; NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; - Music = CalamityMod.Instance.GetMusicFromMusicMod("HiveMind") ?? MusicID.Boss2; if (Main.expertMode) { @@ -1150,7 +1149,7 @@ namespace CalamityMod.NPCs.HiveMind normalOnly.Add(ItemID.RottenChunk, 1, 10, 15); normalOnly.Add(ItemID.CorruptSeeds, 1, 10, 15); normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType(), 1, 25, 30)); - normalOnly.Add(ItemDropRule.ByCondition(new Conditions.IsHardmode(), ItemID.CursedFlame, 1, 10, 20)); + normalOnly.Add(ItemDropRule.ByCondition(DropHelper.Hardmode(), ItemID.CursedFlame, 1, 10, 20)); // Equipment normalOnly.Add(ModContent.ItemType(), DropHelper.NormalWeaponDropRateFraction); @@ -1164,10 +1163,10 @@ namespace CalamityMod.NPCs.HiveMind npcLoot.Add(ModContent.ItemType(), 10); // Relic - npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType()); + npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType()); // Lore - npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedHiveMind, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedHiveMind, ModContent.ItemType(), desc: DropHelper.FirstKillText); } } } diff --git a/NPCs/Leviathan/Anahita.cs b/NPCs/Leviathan/Anahita.cs index 0d0efb9800..4dabce363c 100644 --- a/NPCs/Leviathan/Anahita.cs +++ b/NPCs/Leviathan/Anahita.cs @@ -68,7 +68,6 @@ namespace CalamityMod.NPCs.Leviathan NPC.noTileCollide = true; NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; - Music = CalamityMod.Instance.GetMusicFromMusicMod("Anahita") ?? MusicID.Boss3; NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; @@ -233,10 +232,6 @@ namespace CalamityMod.NPCs.Leviathan } } - // Change music. - if (leviAlive) - Music = CalamityMod.Instance.GetMusicFromMusicMod("LeviathanAndAnahita") ?? MusicID.Boss3; - // Ice Shield if (NPC.localAI[2] < 3f) { @@ -852,6 +847,12 @@ namespace CalamityMod.NPCs.Leviathan potionType = ItemID.GreaterHealingPotion; } + public override void OnKill() + { + if (Leviathan.LastAnLStanding()) + Leviathan.RealOnKill(NPC); + } + public override void ModifyNPCLoot(NPCLoot npcLoot) { Leviathan.DefineAnahitaLeviathanLoot(npcLoot); diff --git a/NPCs/Leviathan/Leviathan.cs b/NPCs/Leviathan/Leviathan.cs index 8b157e4119..0f3a5dc94c 100644 --- a/NPCs/Leviathan/Leviathan.cs +++ b/NPCs/Leviathan/Leviathan.cs @@ -74,7 +74,6 @@ namespace CalamityMod.NPCs.Leviathan NPC.noGravity = true; NPC.boss = true; NPC.netAlways = true; - Music = CalamityMod.Instance.GetMusicFromMusicMod("LeviathanAndAnahita") ?? MusicID.Boss3; NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; @@ -778,8 +777,7 @@ namespace CalamityMod.NPCs.Leviathan ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType() + ModContent.ItemType() }; normalOnly.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, items)); @@ -789,6 +787,7 @@ namespace CalamityMod.NPCs.Leviathan // Equipment normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); + normalOnly.Add(ModContent.ItemType(), DropHelper.NormalWeaponDropRateFraction); normalOnly.Add(ModContent.ItemType(), 10); // Fishing @@ -801,12 +800,12 @@ namespace CalamityMod.NPCs.Leviathan } // Relic - npcLoot.AddIf(() => (Main.masterMode || CalamityWorld.revenge) && LastAnLStanding(), ModContent.ItemType()); + npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).AddIf((info) => LastAnLStanding(), ModContent.ItemType()); // Lore bool shouldDropLore(DropAttemptInfo info) => !DownedBossSystem.downedLeviathan && LastAnLStanding(); - npcLoot.AddConditionalPerPlayer(shouldDropLore, ModContent.ItemType()); - npcLoot.AddConditionalPerPlayer(shouldDropLore, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(shouldDropLore, ModContent.ItemType(), desc: DropHelper.FirstKillText); + npcLoot.AddConditionalPerPlayer(shouldDropLore, ModContent.ItemType(), desc: DropHelper.FirstKillText); } public override void ModifyNPCLoot(NPCLoot npcLoot) diff --git a/NPCs/Leviathan/LeviathanStart.cs b/NPCs/Leviathan/LeviathanStart.cs index bacce37cca..02373e1f0e 100644 --- a/NPCs/Leviathan/LeviathanStart.cs +++ b/NPCs/Leviathan/LeviathanStart.cs @@ -44,7 +44,6 @@ namespace CalamityMod.NPCs.Leviathan NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = null; NPC.rarity = 2; - Music = CalamityMod.Instance.GetMusicFromMusicMod("AnahitaPreboss") ?? -1; NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/NormalNPCs/Eidolist.cs b/NPCs/NormalNPCs/Eidolist.cs index c580018389..d5eb2da337 100644 --- a/NPCs/NormalNPCs/Eidolist.cs +++ b/NPCs/NormalNPCs/Eidolist.cs @@ -352,11 +352,11 @@ namespace CalamityMod.NPCs.NormalNPCs notDuringCultistFight.Add(ModContent.ItemType(), 4); aewMinionCondition.Add(notDuringCultistFight); - LeadingConditionRule postClone = new LeadingConditionRule(DropHelper.If(() => DownedBossSystem.downedCalamitas)); + LeadingConditionRule postClone = new LeadingConditionRule(DropHelper.PostCal()); postClone.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 1, 8, 10, 10, 14)); aewMinionCondition.Add(postClone); - LeadingConditionRule postPlant = new LeadingConditionRule(new Conditions.DownedPlantera()); + LeadingConditionRule postPlant = new LeadingConditionRule(DropHelper.PostPlant()); postPlant.Add(ItemID.Ectoplasm, 1, 3, 5); aewMinionCondition.Add(postPlant); } diff --git a/NPCs/NormalNPCs/OverloadedSoldier.cs b/NPCs/NormalNPCs/OverloadedSoldier.cs index e3199e8502..54125c4cf4 100644 --- a/NPCs/NormalNPCs/OverloadedSoldier.cs +++ b/NPCs/NormalNPCs/OverloadedSoldier.cs @@ -7,6 +7,7 @@ using CalamityMod.Items.Placeables.Banners; using CalamityMod.World; using Terraria; using Terraria.GameContent.Bestiary; +using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.ModLoader; using Terraria.ModLoader.Utilities; @@ -404,7 +405,8 @@ namespace CalamityMod.NPCs.NormalNPCs public override void ModifyNPCLoot(NPCLoot npcLoot) { npcLoot.Add(ModContent.ItemType()); - npcLoot.AddIf(() => NPC.downedMoonlord, ModContent.ItemType()); + LeadingConditionRule postML = npcLoot.DefineConditionalDropSet(DropHelper.PostML()); + postML.Add(ModContent.ItemType()); } } } diff --git a/NPCs/NormalNPCs/Piggy.cs b/NPCs/NormalNPCs/Piggy.cs index 5e76864452..ed38f0d9a4 100644 --- a/NPCs/NormalNPCs/Piggy.cs +++ b/NPCs/NormalNPCs/Piggy.cs @@ -123,15 +123,5 @@ namespace CalamityMod.NPCs.NormalNPCs } } } - - public override void OnCaughtBy(Player player, Item item, bool failed) - { - try - { - } catch - { - return; - } - } } } diff --git a/NPCs/NormalNPCs/Rimehound.cs b/NPCs/NormalNPCs/Rimehound.cs index 34a8ce21e5..2fc1b77a8d 100644 --- a/NPCs/NormalNPCs/Rimehound.cs +++ b/NPCs/NormalNPCs/Rimehound.cs @@ -3,10 +3,11 @@ using CalamityMod.Items.Materials; using CalamityMod.World; using System.IO; using Terraria; +using Terraria.Audio; using Terraria.GameContent.Bestiary; +using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.ModLoader; -using Terraria.Audio; namespace CalamityMod.NPCs.NormalNPCs { public class Rimehound : ModNPC @@ -171,7 +172,8 @@ namespace CalamityMod.NPCs.NormalNPCs public override void ModifyNPCLoot(NPCLoot npcLoot) { npcLoot.Add(ItemID.Leather, 1, 1, 2); // 100% chance of 1-2 leather - npcLoot.AddIf(() => DownedBossSystem.downedCryogen, ModContent.ItemType(), 3); + LeadingConditionRule postCryo = npcLoot.DefineConditionalDropSet(DropHelper.PostCryo()); + postCryo.Add(ModContent.ItemType(), 3); } } } diff --git a/NPCs/NormalNPCs/WulfrumPylon.cs b/NPCs/NormalNPCs/WulfrumAmplifier.cs similarity index 88% rename from NPCs/NormalNPCs/WulfrumPylon.cs rename to NPCs/NormalNPCs/WulfrumAmplifier.cs index 8d98169cb4..a04abe97b0 100644 --- a/NPCs/NormalNPCs/WulfrumPylon.cs +++ b/NPCs/NormalNPCs/WulfrumAmplifier.cs @@ -14,7 +14,7 @@ using CalamityMod.Sounds; namespace CalamityMod.NPCs.NormalNPCs { - public class WulfrumPylon : ModNPC + public class WulfrumAmplifier : ModNPC { public bool Charging { @@ -26,17 +26,11 @@ namespace CalamityMod.NPCs.NormalNPCs get => NPC.ai[1]; set => NPC.ai[1] = value; } - public static List SuperchargableEnemies = new List() - { - ModContent.NPCType(), - ModContent.NPCType(), - ModContent.NPCType() - }; public const float ChargeRadiusMax = 495f; public const float SuperchargeTime = 720f; public override void SetStaticDefaults() { - DisplayName.SetDefault("Wulfrum Pylon"); + DisplayName.SetDefault("Wulfrum Amplifier"); Main.npcFrameCount[NPC.type] = 6; NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers(0) { @@ -61,7 +55,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.HitSound = SoundID.NPCHit4; NPC.DeathSound = CommonCalamitySounds.WulfrumNPCDeathSound; Banner = NPC.type; - BannerItem = ModContent.ItemType(); + BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; } @@ -79,6 +73,14 @@ namespace CalamityMod.NPCs.NormalNPCs public override void AI() { + List SuperchargableEnemies = new List() + { + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType() + }; + NPC.TargetClosest(false); Player player = Main.player[NPC.target]; @@ -129,15 +131,14 @@ namespace CalamityMod.NPCs.NormalNPCs } } - for (int i = 0; i < Main.npc.Length; i++) + for (int i = 0; i < Main.maxNPCs; i++) { NPC npcAtIndex = Main.npc[i]; if (!npcAtIndex.active) continue; - // For some strange reason, the Wulfrum Rover is not counted when it's added to a static list. - // What I assume is going on is that it hasn't been loaded yet since it's later alphabetically (Pylon is before Rover). - // As a result, they are checked separately. + // For some strange reason, the Wulfrum enemies are not counted when SuperchargableEnemies is a static list declared up front. + // What I assume is going on is that it hasn't been loaded yet since it's later alphabetically (Amplifier is before the other enemies). if (!SuperchargableEnemies.Contains(npcAtIndex.type) && npcAtIndex.type != ModContent.NPCType()) continue; if (npcAtIndex.ai[3] > 0f) @@ -172,16 +173,16 @@ namespace CalamityMod.NPCs.NormalNPCs public override float SpawnChance(NPCSpawnInfo spawnInfo) { - float pylonMult = !NPC.AnyNPCs(ModContent.NPCType()) ? 1.3f : 1f; + float amplifierMult = !NPC.AnyNPCs(ModContent.NPCType()) ? 1.3f : 1f; if (spawnInfo.PlayerSafe || spawnInfo.Player.Calamity().ZoneSulphur) return 0f; // Spawn less frequently in the inner third of the world. if (spawnInfo.PlayerFloorX > Main.maxTilesX * 0.333f && spawnInfo.PlayerFloorX < Main.maxTilesX - Main.maxTilesX * 0.333f) - return SpawnCondition.OverworldDaySlime.Chance * (Main.hardMode ? 0.01f : 0.06f) * pylonMult; + return SpawnCondition.OverworldDaySlime.Chance * (Main.hardMode ? 0.01f : 0.06f) * amplifierMult; - return SpawnCondition.OverworldDaySlime.Chance * (Main.hardMode ? 0.033f : 0.15f) * pylonMult; + return SpawnCondition.OverworldDaySlime.Chance * (Main.hardMode ? 0.033f : 0.15f) * amplifierMult; } public override void HitEffect(int hitDirection, double damage) @@ -199,7 +200,7 @@ namespace CalamityMod.NPCs.NormalNPCs if (!Main.dedServ) { - Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("WulfrumPylonGore").Type, 1f); + Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("WulfrumAmplifierGore").Type, 1f); int randomGoreCount = Main.rand.Next(1, 4); for (int i = 0; i < randomGoreCount; i++) diff --git a/NPCs/NormalNPCs/WulfrumPylon.png b/NPCs/NormalNPCs/WulfrumAmplifier.png similarity index 100% rename from NPCs/NormalNPCs/WulfrumPylon.png rename to NPCs/NormalNPCs/WulfrumAmplifier.png diff --git a/NPCs/NormalNPCs/WulfrumDrone.cs b/NPCs/NormalNPCs/WulfrumDrone.cs index cc8c140f3d..e51feb5ea8 100644 --- a/NPCs/NormalNPCs/WulfrumDrone.cs +++ b/NPCs/NormalNPCs/WulfrumDrone.cs @@ -198,7 +198,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override float SpawnChance(NPCSpawnInfo spawnInfo) { - float pylonMult = NPC.AnyNPCs(ModContent.NPCType()) ? 5.5f : 1f; + float pylonMult = NPC.AnyNPCs(ModContent.NPCType()) ? 5.5f : 1f; if (spawnInfo.PlayerSafe || spawnInfo.Player.Calamity().ZoneSulphur) return 0f; diff --git a/NPCs/NormalNPCs/WulfrumGyrator.cs b/NPCs/NormalNPCs/WulfrumGyrator.cs index ce07a5f501..905ebcc267 100644 --- a/NPCs/NormalNPCs/WulfrumGyrator.cs +++ b/NPCs/NormalNPCs/WulfrumGyrator.cs @@ -176,7 +176,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override float SpawnChance(NPCSpawnInfo spawnInfo) { - float pylonMult = NPC.AnyNPCs(ModContent.NPCType()) ? 5.5f : 1f; + float pylonMult = NPC.AnyNPCs(ModContent.NPCType()) ? 5.5f : 1f; if (spawnInfo.PlayerSafe || spawnInfo.Player.Calamity().ZoneSulphur) return 0f; return SpawnCondition.OverworldDaySlime.Chance * (Main.hardMode ? 0.020f : 0.115f) * pylonMult; diff --git a/NPCs/NormalNPCs/WulfrumHovercraft.cs b/NPCs/NormalNPCs/WulfrumHovercraft.cs index b47b25c475..1e99f1a5c5 100644 --- a/NPCs/NormalNPCs/WulfrumHovercraft.cs +++ b/NPCs/NormalNPCs/WulfrumHovercraft.cs @@ -265,7 +265,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override float SpawnChance(NPCSpawnInfo spawnInfo) { - float pylonMult = NPC.AnyNPCs(ModContent.NPCType()) ? 5.5f : 1f; + float pylonMult = NPC.AnyNPCs(ModContent.NPCType()) ? 5.5f : 1f; if (spawnInfo.PlayerSafe || spawnInfo.Player.Calamity().ZoneSulphur) return 0f; diff --git a/NPCs/NormalNPCs/WulfrumRover.cs b/NPCs/NormalNPCs/WulfrumRover.cs index 021f76770e..f311386932 100644 --- a/NPCs/NormalNPCs/WulfrumRover.cs +++ b/NPCs/NormalNPCs/WulfrumRover.cs @@ -137,7 +137,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override float SpawnChance(NPCSpawnInfo spawnInfo) { - float pylonMult = NPC.AnyNPCs(ModContent.NPCType()) ? 5.5f : 1f; + float pylonMult = NPC.AnyNPCs(ModContent.NPCType()) ? 5.5f : 1f; if (spawnInfo.PlayerSafe || spawnInfo.Player.Calamity().ZoneSulphur) return 0f; return SpawnCondition.OverworldDaySlime.Chance * (Main.hardMode ? 0.010f : 0.135f) * pylonMult; diff --git a/NPCs/OldDuke/OldDuke.cs b/NPCs/OldDuke/OldDuke.cs index 54766e5862..ce78d06e5b 100644 --- a/NPCs/OldDuke/OldDuke.cs +++ b/NPCs/OldDuke/OldDuke.cs @@ -77,7 +77,6 @@ namespace CalamityMod.NPCs.OldDuke NPC.boss = true; NPC.netAlways = true; NPC.timeLeft = NPC.activeTime * 30; - Music = CalamityMod.Instance.GetMusicFromMusicMod("BoomerDuke") ?? MusicID.DukeFishron; NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; @@ -432,14 +431,14 @@ namespace CalamityMod.NPCs.OldDuke ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType(), + ModContent.ItemType() }; normalOnly.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, items)); normalOnly.Add(ModContent.ItemType(), 10); // Equipment normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); + normalOnly.Add(ModContent.ItemType(), DropHelper.NormalWeaponDropRateFraction); // Vanity normalOnly.Add(ModContent.ItemType(), 7); @@ -448,10 +447,10 @@ namespace CalamityMod.NPCs.OldDuke npcLoot.Add(ModContent.ItemType(), 10); // Relic - npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType()); + npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType()); // Lore - npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedBoomerDuke, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedBoomerDuke, ModContent.ItemType(), desc: DropHelper.FirstKillText); } public override bool CanHitPlayer(Player target, ref int cooldownSlot) diff --git a/NPCs/Perforator/PerforatorHive.cs b/NPCs/Perforator/PerforatorHive.cs index b940f09055..53dae86623 100644 --- a/NPCs/Perforator/PerforatorHive.cs +++ b/NPCs/Perforator/PerforatorHive.cs @@ -69,7 +69,6 @@ namespace CalamityMod.NPCs.Perforator NPC.noTileCollide = true; NPC.HitSound = SoundID.NPCHit13; NPC.DeathSound = SoundID.NPCDeath19; - Music = CalamityMod.Instance.GetMusicFromMusicMod("Perforators") ?? MusicID.Boss2; NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; @@ -528,7 +527,7 @@ namespace CalamityMod.NPCs.Perforator normalOnly.Add(ItemID.Vertebrae, 1, 10, 15); normalOnly.Add(ItemID.CrimsonSeeds, 1, 10, 15); normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType(), 1, 25, 30)); - normalOnly.Add(ItemDropRule.ByCondition(new Conditions.IsHardmode(), ItemID.Ichor, 1, 10, 20)); + normalOnly.Add(ItemDropRule.ByCondition(DropHelper.Hardmode(), ItemID.Ichor, 1, 10, 20)); // Equipment normalOnly.Add(ModContent.ItemType(), DropHelper.NormalWeaponDropRateFraction); @@ -542,10 +541,10 @@ namespace CalamityMod.NPCs.Perforator npcLoot.Add(ModContent.ItemType(), 10); // Relic - npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType()); + npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType()); // Lore - npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedPerforator, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedPerforator, ModContent.ItemType(), desc: DropHelper.FirstKillText); } public override void OnHitPlayer(Player player, int damage, bool crit) diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs index 16c62034b2..5de143f425 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs @@ -91,7 +91,6 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath NPC.noTileCollide = true; NPC.HitSound = SoundID.NPCHit4; NPC.DeathSound = SoundID.NPCDeath14; - Music = CalamityMod.Instance.GetMusicFromMusicMod("PlaguebringerGoliath") ?? MusicID.Boss3; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; } @@ -1280,10 +1279,10 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npcLoot.Add(ModContent.ItemType(), 10); // Relic - npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType()); + npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType()); // Lore - npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedPlaguebringer, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedPlaguebringer, ModContent.ItemType(), desc: DropHelper.FirstKillText); } public override void ScaleExpertStats(int numPlayers, float bossLifeScale) diff --git a/NPCs/Polterghast/Polterghast.cs b/NPCs/Polterghast/Polterghast.cs index 956402f34f..b27dcfa5fe 100644 --- a/NPCs/Polterghast/Polterghast.cs +++ b/NPCs/Polterghast/Polterghast.cs @@ -80,7 +80,6 @@ namespace CalamityMod.NPCs.Polterghast NPC.noGravity = true; NPC.noTileCollide = true; NPC.netAlways = true; - Music = CalamityMod.Instance.GetMusicFromMusicMod("Polterghast") ?? MusicID.Plantera; NPC.HitSound = SoundID.NPCHit7; NPC.DeathSound = SoundID.NPCDeath39; NPC.Calamity().VulnerableToSickness = false; @@ -1049,10 +1048,10 @@ namespace CalamityMod.NPCs.Polterghast npcLoot.Add(ModContent.ItemType(), 10); // Relic - npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType()); + npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType()); // Lore - npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedPolterghast, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedPolterghast, ModContent.ItemType(), desc: DropHelper.FirstKillText); } public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs index 98d0e20255..15179aafbc 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs @@ -66,7 +66,6 @@ namespace CalamityMod.NPCs.ProfanedGuardians NPC.noTileCollide = true; AIType = -1; NPC.boss = true; - Music = CalamityMod.Instance.GetMusicFromMusicMod("Guardians") ?? MusicID.Boss1; NPC.value = Item.buyPrice(1, 0, 0, 0); NPC.HitSound = SoundID.NPCHit52; NPC.DeathSound = SoundID.NPCDeath55; @@ -513,10 +512,10 @@ namespace CalamityMod.NPCs.ProfanedGuardians npcLoot.Add(ModContent.ItemType()); // Relic - npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType()); + npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType()); // Lore - npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedGuardians, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedGuardians, ModContent.ItemType(), desc: DropHelper.FirstKillText); } public override void OnKill() diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index a12dbe83d3..5141294361 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -124,7 +124,6 @@ namespace CalamityMod.NPCs.Providence NPC.noGravity = true; NPC.noTileCollide = true; NPC.netAlways = true; - Music = CalamityMod.Instance.GetMusicFromMusicMod("Providence") ?? MusicID.LunarBoss; NPC.DeathSound = DeathSound; NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToCold = true; @@ -1550,28 +1549,28 @@ namespace CalamityMod.NPCs.Providence npcLoot.Add(ItemDropRule.BossBag(ModContent.ItemType())); // Drops Rune of Cos on first kill - npcLoot.AddIf(() => !DownedBossSystem.downedProvidence, ModContent.ItemType()); + npcLoot.AddIf(() => !DownedBossSystem.downedProvidence, ModContent.ItemType(), desc: DropHelper.FirstKillText); npcLoot.AddIf(info => { Providence prov = info.npc.ModNPC(); return prov.biomeType != 2 || !prov.hasTakenDaytimeDamage; - }, ModContent.ItemType()); + }, ModContent.ItemType(), desc: DropHelper.ProvidenceHallowText); npcLoot.AddIf(info => { Providence prov = info.npc.ModNPC(); return prov.biomeType == 2 || !prov.hasTakenDaytimeDamage; - }, ModContent.ItemType()); + }, ModContent.ItemType(), desc: DropHelper.ProvidenceUnderworldText); npcLoot.AddIf(info => { Providence prov = info.npc.ModNPC(); return prov.challenge; - }, ModContent.ItemType()); + }, ModContent.ItemType(), desc: DropHelper.ProvidenceChallengeText); npcLoot.AddIf(info => { Providence prov = info.npc.ModNPC(); return !prov.hasTakenDaytimeDamage; - }, ModContent.ItemType(), 1, 4, 4); + }, ModContent.ItemType(), 1, 4, 4, desc: DropHelper.ProvidenceNightText); // Normal drops: Everything that would otherwise be in the bag var normalOnly = npcLoot.DefineNormalOnlyDropSet(); @@ -1604,10 +1603,10 @@ namespace CalamityMod.NPCs.Providence npcLoot.Add(ModContent.ItemType(), 10); // Relic - npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType()); + npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType()); // Lore - npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedProvidence, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedProvidence, ModContent.ItemType(), desc: DropHelper.FirstKillText); } private void SpawnLootBox() diff --git a/NPCs/Ravager/RavagerBody.cs b/NPCs/Ravager/RavagerBody.cs index f3b611baf3..496bff3615 100644 --- a/NPCs/Ravager/RavagerBody.cs +++ b/NPCs/Ravager/RavagerBody.cs @@ -78,7 +78,6 @@ namespace CalamityMod.NPCs.Ravager NPC.alpha = 255; NPC.HitSound = SoundID.NPCHit41; NPC.DeathSound = SoundID.NPCDeath14; - Music = CalamityMod.Instance.GetMusicFromMusicMod("Ravager") ?? MusicID.Boss4; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; } @@ -867,13 +866,13 @@ namespace CalamityMod.NPCs.Ravager normalOnly.Add(ModContent.ItemType(), 20); // Materials - normalOnly.Add(ItemDropRule.ByCondition(DropHelper.If(() => !DownedBossSystem.downedProvidence), ModContent.ItemType())); - normalOnly.Add(ItemDropRule.ByCondition(DropHelper.If(() => DownedBossSystem.downedProvidence), ModContent.ItemType())); + normalOnly.Add(ItemDropRule.ByCondition(DropHelper.If(() => !DownedBossSystem.downedProvidence), ModContent.ItemType()), hideLootReport: DownedBossSystem.downedProvidence); + normalOnly.Add(ItemDropRule.ByCondition(DropHelper.If(() => DownedBossSystem.downedProvidence), ModContent.ItemType()), hideLootReport: !DownedBossSystem.downedProvidence); // Equipment normalOnly.Add(ModContent.ItemType(), 3); normalOnly.Add(ModContent.ItemType(), 3); - normalOnly.Add(ItemDropRule.ByCondition(DropHelper.If(() => DownedBossSystem.downedProvidence), ModContent.ItemType())); + normalOnly.Add(ItemDropRule.ByCondition(DropHelper.PostProv(), ModContent.ItemType())); // Vanity normalOnly.Add(ModContent.ItemType(), 7); @@ -882,10 +881,10 @@ namespace CalamityMod.NPCs.Ravager npcLoot.Add(ModContent.ItemType(), 10); // Relic - npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType()); + npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType()); // Lore - npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedRavager, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedRavager, ModContent.ItemType(), desc: DropHelper.FirstKillText); } } } diff --git a/NPCs/Signus/Signus.cs b/NPCs/Signus/Signus.cs index 2e2a7cc3ee..8b258e2c40 100644 --- a/NPCs/Signus/Signus.cs +++ b/NPCs/Signus/Signus.cs @@ -62,7 +62,6 @@ namespace CalamityMod.NPCs.Signus NPC.defense = 60; NPC.LifeMaxNERB(297000, 356400, 240000); NPC.value = Item.buyPrice(2, 0, 0, 0); - Music = CalamityMod.Instance.GetMusicFromMusicMod("Signus") ?? MusicID.Boss4; double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); NPC.knockBackResist = 0f; @@ -798,18 +797,19 @@ namespace CalamityMod.NPCs.Signus // Vanity normalOnly.Add(ModContent.ItemType(), 7); - normalOnly.Add(ItemDropRule.Common(ModContent.ItemType(), 20). - OnSuccess(ItemDropRule.Common(ModContent.ItemType())). - OnSuccess(ItemDropRule.Common(ModContent.ItemType()))); + var godSlayerVanity = ItemDropRule.Common(ModContent.ItemType(), 20); + godSlayerVanity.OnSuccess(ItemDropRule.Common(ModContent.ItemType())); + godSlayerVanity.OnSuccess(ItemDropRule.Common(ModContent.ItemType())); + normalOnly.Add(godSlayerVanity); } npcLoot.Add(ModContent.ItemType(), 10); // Relic - npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType()); + npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType()); // Lore - npcLoot.AddConditionalPerPlayer(LastSentinelKilled, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(LastSentinelKilled, ModContent.ItemType(), desc: DropHelper.SentinelText); } public override void ScaleExpertStats(int numPlayers, float bossLifeScale) diff --git a/NPCs/SlimeGod/CrimulanSlimeGod.cs b/NPCs/SlimeGod/CrimulanSlimeGod.cs index fa808cbb46..64113a28ef 100644 --- a/NPCs/SlimeGod/CrimulanSlimeGod.cs +++ b/NPCs/SlimeGod/CrimulanSlimeGod.cs @@ -44,7 +44,6 @@ namespace CalamityMod.NPCs.SlimeGod NPC.noTileCollide = false; NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; - Music = CalamityMod.Instance.GetMusicFromMusicMod("SlimeGod") ?? MusicID.Boss1; NPC.aiStyle = -1; AIType = -1; NPC.Calamity().VulnerableToHeat = true; @@ -695,5 +694,25 @@ namespace CalamityMod.NPCs.SlimeGod { player.AddBuff(BuffID.Darkness, 300, true); } + + public override void OnHitByItem(Player player, Item item, int damage, float knockback, bool crit) + { + if (CalamityGlobalNPC.slimeGod == -1) + return; + + NPC slimeGod = Main.npc[CalamityGlobalNPC.slimeGod]; + slimeGod.playerInteraction[player.whoAmI] = true; + } + + public override void OnHitByProjectile(Projectile projectile, int damage, float knockback, bool crit) + { + if (projectile.npcProj || projectile.trap) + return; + if (CalamityGlobalNPC.slimeGod == -1) + return; + + NPC slimeGod = Main.npc[CalamityGlobalNPC.slimeGod]; + slimeGod.playerInteraction[projectile.owner] = true; + } } } diff --git a/NPCs/SlimeGod/EbonianSlimeGod.cs b/NPCs/SlimeGod/EbonianSlimeGod.cs index 8bbfaf5be5..bb24953a86 100644 --- a/NPCs/SlimeGod/EbonianSlimeGod.cs +++ b/NPCs/SlimeGod/EbonianSlimeGod.cs @@ -43,7 +43,6 @@ namespace CalamityMod.NPCs.SlimeGod NPC.Opacity = 0.8f; NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; - Music = CalamityMod.Instance.GetMusicFromMusicMod("SlimeGod") ?? MusicID.Boss1; NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; } @@ -708,5 +707,25 @@ namespace CalamityMod.NPCs.SlimeGod { player.AddBuff(BuffID.Weak, 300, true); } + + public override void OnHitByItem(Player player, Item item, int damage, float knockback, bool crit) + { + if (CalamityGlobalNPC.slimeGod == -1) + return; + + NPC slimeGod = Main.npc[CalamityGlobalNPC.slimeGod]; + slimeGod.playerInteraction[player.whoAmI] = true; + } + + public override void OnHitByProjectile(Projectile projectile, int damage, float knockback, bool crit) + { + if (projectile.npcProj || projectile.trap) + return; + if (CalamityGlobalNPC.slimeGod == -1) + return; + + NPC slimeGod = Main.npc[CalamityGlobalNPC.slimeGod]; + slimeGod.playerInteraction[projectile.owner] = true; + } } } diff --git a/NPCs/SlimeGod/SlimeGodCore.cs b/NPCs/SlimeGod/SlimeGodCore.cs index a57f819291..30d3bbfa16 100644 --- a/NPCs/SlimeGod/SlimeGodCore.cs +++ b/NPCs/SlimeGod/SlimeGodCore.cs @@ -70,7 +70,6 @@ namespace CalamityMod.NPCs.SlimeGod NPC.dontTakeDamage = true; NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; - Music = CalamityMod.Instance.GetMusicFromMusicMod("SlimeGod") ?? MusicID.Boss1; NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; } @@ -236,6 +235,15 @@ namespace CalamityMod.NPCs.SlimeGod Main.dust[num624].velocity *= 2f; } + // Let the player know that the Slime God isn't dead fr + if (!DownedBossSystem.downedSlimeGod) + { + string key = "Mods.CalamityMod.SlimeGodRun"; + Color messageColor = Color.Magenta; + + CalamityUtils.DisplayLocalizedText(key, messageColor); + } + NPC.active = false; NPC.HitEffect(); NPC.NPCLoot(); @@ -605,10 +613,10 @@ namespace CalamityMod.NPCs.SlimeGod npcLoot.Add(ModContent.ItemType(), 10); // Relic - npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType()); + npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType()); // Lore - npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedSlimeGod, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedSlimeGod, ModContent.ItemType(), desc: DropHelper.FirstKillText); } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/SlimeGod/SplitCrimulanSlimeGod.cs b/NPCs/SlimeGod/SplitCrimulanSlimeGod.cs index efa1b7731f..002a00439e 100644 --- a/NPCs/SlimeGod/SplitCrimulanSlimeGod.cs +++ b/NPCs/SlimeGod/SplitCrimulanSlimeGod.cs @@ -53,7 +53,6 @@ namespace CalamityMod.NPCs.SlimeGod NPC.noTileCollide = false; NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; - Music = CalamityMod.Instance.GetMusicFromMusicMod("SlimeGod") ?? MusicID.Boss1; NPC.aiStyle = -1; AIType = -1; NPC.Calamity().VulnerableToHeat = true; @@ -728,5 +727,25 @@ namespace CalamityMod.NPCs.SlimeGod { player.AddBuff(BuffID.Darkness, 240, true); } + + public override void OnHitByItem(Player player, Item item, int damage, float knockback, bool crit) + { + if (CalamityGlobalNPC.slimeGod == -1) + return; + + NPC slimeGod = Main.npc[CalamityGlobalNPC.slimeGod]; + slimeGod.playerInteraction[player.whoAmI] = true; + } + + public override void OnHitByProjectile(Projectile projectile, int damage, float knockback, bool crit) + { + if (projectile.npcProj || projectile.trap) + return; + if (CalamityGlobalNPC.slimeGod == -1) + return; + + NPC slimeGod = Main.npc[CalamityGlobalNPC.slimeGod]; + slimeGod.playerInteraction[projectile.owner] = true; + } } } diff --git a/NPCs/SlimeGod/SplitEbonianSlimeGod.cs b/NPCs/SlimeGod/SplitEbonianSlimeGod.cs index c66bab8fc8..b251c2cc4d 100644 --- a/NPCs/SlimeGod/SplitEbonianSlimeGod.cs +++ b/NPCs/SlimeGod/SplitEbonianSlimeGod.cs @@ -55,7 +55,6 @@ namespace CalamityMod.NPCs.SlimeGod NPC.noTileCollide = false; NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; - Music = CalamityMod.Instance.GetMusicFromMusicMod("SlimeGod") ?? MusicID.Boss1; NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; } @@ -741,5 +740,25 @@ namespace CalamityMod.NPCs.SlimeGod { player.AddBuff(BuffID.Weak, 240, true); } + + public override void OnHitByItem(Player player, Item item, int damage, float knockback, bool crit) + { + if (CalamityGlobalNPC.slimeGod == -1) + return; + + NPC slimeGod = Main.npc[CalamityGlobalNPC.slimeGod]; + slimeGod.playerInteraction[player.whoAmI] = true; + } + + public override void OnHitByProjectile(Projectile projectile, int damage, float knockback, bool crit) + { + if (projectile.npcProj || projectile.trap) + return; + if (CalamityGlobalNPC.slimeGod == -1) + return; + + NPC slimeGod = Main.npc[CalamityGlobalNPC.slimeGod]; + slimeGod.playerInteraction[projectile.owner] = true; + } } } diff --git a/NPCs/StormWeaver/StormWeaverBody.cs b/NPCs/StormWeaver/StormWeaverBody.cs index 2a88e73285..c332e4966e 100644 --- a/NPCs/StormWeaver/StormWeaverBody.cs +++ b/NPCs/StormWeaver/StormWeaverBody.cs @@ -29,7 +29,6 @@ namespace CalamityMod.NPCs.StormWeaver NPC.height = 40; NPC.lifeMax = 825500; NPC.LifeMaxNERB(NPC.lifeMax, NPC.lifeMax, 475000); - Music = CalamityMod.Instance.GetMusicFromMusicMod("Weaver") ?? MusicID.Boss3; // Phase one settings CalamityGlobalNPC global = NPC.Calamity(); diff --git a/NPCs/StormWeaver/StormWeaverHead.cs b/NPCs/StormWeaver/StormWeaverHead.cs index d9dca6f869..67f60c0c05 100644 --- a/NPCs/StormWeaver/StormWeaverHead.cs +++ b/NPCs/StormWeaver/StormWeaverHead.cs @@ -82,7 +82,6 @@ namespace CalamityMod.NPCs.StormWeaver NPC.lifeMax = 825500; NPC.LifeMaxNERB(NPC.lifeMax, NPC.lifeMax, 475000); NPC.value = Item.buyPrice(2, 0, 0, 0); - Music = CalamityMod.Instance.GetMusicFromMusicMod("Weaver") ?? MusicID.Boss3; // Phase one settings CalamityGlobalNPC global = NPC.Calamity(); @@ -964,18 +963,19 @@ namespace CalamityMod.NPCs.StormWeaver // Vanity normalOnly.Add(ModContent.ItemType(), 7); normalOnly.Add(ModContent.ItemType(), 10); - normalOnly.Add(ItemDropRule.Common(ModContent.ItemType(), 20). - OnSuccess(ItemDropRule.Common(ModContent.ItemType())). - OnSuccess(ItemDropRule.Common(ModContent.ItemType()))); + var godSlayerVanity = ItemDropRule.Common(ModContent.ItemType(), 20); + godSlayerVanity.OnSuccess(ItemDropRule.Common(ModContent.ItemType())); + godSlayerVanity.OnSuccess(ItemDropRule.Common(ModContent.ItemType())); + normalOnly.Add(godSlayerVanity); } npcLoot.Add(ModContent.ItemType(), 10); // Relic - npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType()); + npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType()); // Lore - npcLoot.AddConditionalPerPlayer(LastSentinelKilled, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(LastSentinelKilled, ModContent.ItemType(), desc: DropHelper.SentinelText); } public override void ScaleExpertStats(int numPlayers, float bossLifeScale) diff --git a/NPCs/StormWeaver/StormWeaverTail.cs b/NPCs/StormWeaver/StormWeaverTail.cs index 2971101580..8eab7e8be1 100644 --- a/NPCs/StormWeaver/StormWeaverTail.cs +++ b/NPCs/StormWeaver/StormWeaverTail.cs @@ -30,7 +30,6 @@ namespace CalamityMod.NPCs.StormWeaver NPC.height = 80; NPC.lifeMax = 825500; NPC.LifeMaxNERB(NPC.lifeMax, NPC.lifeMax, 475000); - Music = CalamityMod.Instance.GetMusicFromMusicMod("Weaver") ?? MusicID.Boss3; // Phase one settings NPC.takenDamageMultiplier = 2f; diff --git a/NPCs/SunkenSea/BabyGhostBell.cs b/NPCs/SunkenSea/BabyGhostBell.cs index 34c2dcffa2..78d168666c 100644 --- a/NPCs/SunkenSea/BabyGhostBell.cs +++ b/NPCs/SunkenSea/BabyGhostBell.cs @@ -167,15 +167,5 @@ namespace CalamityMod.NPCs.SunkenSea } } } - - public override void OnCaughtBy(Player player, Item item, bool failed) - { - try - { - } catch - { - return; - } - } } } diff --git a/NPCs/SunkenSea/GhostBell.cs b/NPCs/SunkenSea/GhostBell.cs index 330ad98ec7..5966a43c57 100644 --- a/NPCs/SunkenSea/GhostBell.cs +++ b/NPCs/SunkenSea/GhostBell.cs @@ -7,6 +7,7 @@ using System.IO; using Terraria; using Terraria.GameContent; using Terraria.GameContent.Bestiary; +using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.ModLoader; using Terraria.ModLoader.Utilities; @@ -172,7 +173,8 @@ namespace CalamityMod.NPCs.SunkenSea public override void ModifyNPCLoot(NPCLoot npcLoot) { npcLoot.Add(ItemID.JellyfishNecklace, 100); - npcLoot.AddIf(() => DownedBossSystem.downedDesertScourge, ModContent.ItemType(), 5); + LeadingConditionRule postDS = npcLoot.DefineConditionalDropSet(DropHelper.PostDS()); + postDS.Add(ModContent.ItemType(), 5); } } } diff --git a/NPCs/SunkenSea/GiantClam.cs b/NPCs/SunkenSea/GiantClam.cs index 354071942d..d7ff09e973 100644 --- a/NPCs/SunkenSea/GiantClam.cs +++ b/NPCs/SunkenSea/GiantClam.cs @@ -450,8 +450,7 @@ namespace CalamityMod.NPCs.SunkenSea public override void ModifyNPCLoot(NPCLoot npcLoot) { - var hardmode = npcLoot.DefineConditionalDropSet(new Conditions.IsHardmode()); - var postDesertScourge = npcLoot.DefineConditionalDropSet(() => DownedBossSystem.downedDesertScourge); + var hardmode = npcLoot.DefineConditionalDropSet(DropHelper.Hardmode()); // Materials npcLoot.Add(ModContent.ItemType(), 1, 30, 40); @@ -468,14 +467,14 @@ namespace CalamityMod.NPCs.SunkenSea hardmode.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, weapons)); // Equipment - postDesertScourge.Add(ModContent.ItemType(), 3); - postDesertScourge.Add(ModContent.ItemType(), 3); + npcLoot.Add(ModContent.ItemType(), 3); + npcLoot.Add(ModContent.ItemType(), 3); // Trophy npcLoot.Add(ModContent.ItemType(), 10); // Relic - npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType(), 4); + npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType(), 4); } } } diff --git a/NPCs/SunkenSea/PrismBack.cs b/NPCs/SunkenSea/PrismBack.cs index 61fd340c05..69f5d6ed2b 100644 --- a/NPCs/SunkenSea/PrismBack.cs +++ b/NPCs/SunkenSea/PrismBack.cs @@ -8,6 +8,7 @@ using System.IO; using Terraria; using Terraria.GameContent; using Terraria.GameContent.Bestiary; +using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.ModLoader; using Terraria.ModLoader.Utilities; @@ -158,7 +159,11 @@ namespace CalamityMod.NPCs.SunkenSea return 0f; } - public override void ModifyNPCLoot(NPCLoot npcLoot) => npcLoot.AddIf(() => DownedBossSystem.downedDesertScourge, ModContent.ItemType(), 1, 1, 3); + public override void ModifyNPCLoot(NPCLoot npcLoot) + { + LeadingConditionRule postDS = npcLoot.DefineConditionalDropSet(DropHelper.PostDS()); + postDS.Add(ModContent.ItemType(), 1, 1, 3); + } public override void HitEffect(int hitDirection, double damage) { diff --git a/NPCs/SunkenSea/SeaMinnow.cs b/NPCs/SunkenSea/SeaMinnow.cs index 2dc14ff924..9a86ca572f 100644 --- a/NPCs/SunkenSea/SeaMinnow.cs +++ b/NPCs/SunkenSea/SeaMinnow.cs @@ -218,15 +218,5 @@ namespace CalamityMod.NPCs.SunkenSea Dust.NewDust(NPC.position, NPC.width, NPC.height, 68, hitDirection, -1f, 0, default, 1f); } } - - public override void OnCaughtBy(Player player, Item item, bool failed) - { - try - { - } catch - { - return; - } - } } } diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index e302530c2c..f54fccca03 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -219,7 +219,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas NPC.canGhostHeal = false; NPC.noGravity = true; NPC.noTileCollide = true; - Music = CalamityMod.Instance.GetMusicFromMusicMod("SupremeCalamitas1") ?? MusicID.Boss2; NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; @@ -355,6 +354,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas #region StartUp CalamityGlobalNPC.SCal = NPC.whoAmI; + HandleMusicVariables(); bool wormAlive = false; if (CalamityGlobalNPC.SCalWorm != -1) @@ -871,9 +871,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas } if (!startThirdAttack && lifeRatio <= 0.5f) { - // Switch from the Grief section of Stained, Brutal Calamity to the Lament section. - Music = CalamityMod.Instance.GetMusicFromMusicMod("SupremeCalamitas2") ?? MusicID.Boss3; - if (!bossRush) { string key = "Mods.CalamityMod.SCalBH3Text"; @@ -944,9 +941,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas } if (!startFourthAttack && lifeRatio <= 0.3f) { - // Switch from the Lament section of Stained, Brutal Calamity to the Epiphany section. - Music = CalamityMod.Instance.GetMusicFromMusicMod("SupremeCalamitas3") ?? MusicID.LunarBoss; - if (!bossRush) { string key = "Mods.CalamityMod.SCalBH4Text"; @@ -1034,15 +1028,19 @@ namespace CalamityMod.NPCs.SupremeCalamitas { if (gettingTired5) { - // Switch from the Epiphany section of Stained, Brutal Calamity to the Acceptance section. - Music = CalamityMod.Instance.GetMusicFromMusicMod("SupremeCalamitas4") ?? MusicID.Eerie; - if (NPC.velocity.Y < 9f) NPC.velocity.Y += 0.185f; NPC.noTileCollide = false; NPC.noGravity = false; NPC.damage = 0; + // Teleport back to the arena on defeat + if (giveUpCounter == 1200) + { + Dust.QuickDustLine(NPC.Center, initialRitualPosition, 500f, Color.Red); + NPC.Center = initialRitualPosition; + } + if (!canDespawn) NPC.velocity.X *= 0.96f; @@ -2521,6 +2519,25 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } + public void HandleMusicVariables() + { + float lifeRatio = NPC.life / (float)NPC.lifeMax; + + CalamityGlobalNPC.SCalGrief = -1; + CalamityGlobalNPC.SCalLament = -1; + CalamityGlobalNPC.SCalEpiphany = -1; + CalamityGlobalNPC.SCalAcceptance = -1; + + if (startFifthAttack && gettingTired5) + CalamityGlobalNPC.SCalAcceptance = NPC.whoAmI; + else if (lifeRatio <= 0.3f) + CalamityGlobalNPC.SCalEpiphany = NPC.whoAmI; + else if (lifeRatio <= 0.5f) + CalamityGlobalNPC.SCalLament = NPC.whoAmI; + else + CalamityGlobalNPC.SCalGrief = NPC.whoAmI; + } + #region Loot public override void BossLoot(ref string name, ref int potionType) { @@ -2529,10 +2546,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas public override void OnKill() { - // Create a teleport line effect - Dust.QuickDustLine(NPC.Center, initialRitualPosition, 500f, Color.Red); - NPC.Center = initialRitualPosition; - CalamityGlobalNPC.SetNewBossJustDowned(NPC); // Increase the player's SCal kill count @@ -2574,10 +2587,11 @@ namespace CalamityMod.NPCs.SupremeCalamitas normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); // SCal vanity set (This drops all at once, or not at all) - normalOnly.Add(ItemDropRule.Common(ModContent.ItemType(), 7). - OnSuccess(ItemDropRule.Common(ModContent.ItemType())). - OnSuccess(ItemDropRule.Common(ModContent.ItemType())). - OnSuccess(ItemDropRule.Common(ModContent.ItemType()))); + var scalVanitySet = ItemDropRule.Common(ModContent.ItemType(), 7); + scalVanitySet.OnSuccess(ItemDropRule.Common(ModContent.ItemType())); + scalVanitySet.OnSuccess(ItemDropRule.Common(ModContent.ItemType())); + scalVanitySet.OnSuccess(ItemDropRule.Common(ModContent.ItemType())); + normalOnly.Add(scalVanitySet); } // One of the only Death-exclusive drops in the mod, as requested by Leviathan: Levi pet and Gael's Greatsword @@ -2587,10 +2601,10 @@ namespace CalamityMod.NPCs.SupremeCalamitas npcLoot.Add(ModContent.ItemType(), 10); // Relic - npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType()); + npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType()); // Lore - npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedSCal, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedSCal, ModContent.ItemType(), desc: DropHelper.FirstKillText); } #endregion @@ -2849,7 +2863,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas NPC.position.Y = NPC.position.Y - (NPC.height / 2); for (int num621 = 0; num621 < 40; num621++) { - int num622 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); Main.dust[num622].velocity *= 3f; if (Main.rand.NextBool(2)) { @@ -2859,10 +2873,10 @@ namespace CalamityMod.NPCs.SupremeCalamitas } for (int num623 = 0; num623 < 70; num623++) { - int num624 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 3f); + int num624 = Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 3f); Main.dust[num624].noGravity = true; Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); + num624 = Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); Main.dust[num624].velocity *= 2f; } } diff --git a/NPCs/Yharon/Yharon.cs b/NPCs/Yharon/Yharon.cs index 33f8c9e58b..5ae6fb5172 100644 --- a/NPCs/Yharon/Yharon.cs +++ b/NPCs/Yharon/Yharon.cs @@ -108,8 +108,6 @@ namespace CalamityMod.NPCs.Yharon NPC.noTileCollide = true; NPC.netAlways = true; - Music = CalamityMod.Instance.GetMusicFromMusicMod("YharonP1") ?? MusicID.Boss3; - NPC.DeathSound = DeathSound; NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToCold = true; @@ -191,6 +189,9 @@ namespace CalamityMod.NPCs.Yharon float pie = (float)Math.PI; + CalamityGlobalNPC.yharon = NPC.whoAmI; + CalamityGlobalNPC.yharonP2 = -1; + // Start phase 2 or not if (startSecondAI) { @@ -1524,6 +1525,8 @@ namespace CalamityMod.NPCs.Yharon #region AI2 public void Yharon_AI2(bool expertMode, bool revenge, bool death, bool bossRush, float pie, float lifeRatio, CalamityGlobalNPC calamityGlobalNPC) { + CalamityGlobalNPC.yharonP2 = NPC.whoAmI; + float phase2GateValue = revenge ? 0.44f : expertMode ? 0.385f : 0.275f; bool phase2 = death || lifeRatio <= phase2GateValue; float phase3GateValue = death ? 0.358f : revenge ? 0.275f : expertMode ? 0.22f : 0.138f; @@ -1540,9 +1543,6 @@ namespace CalamityMod.NPCs.Yharon if (!moveCloser) { - // When Yharon begins Phase 2, switch music to Roar of the Jungle Dragon. - Music = CalamityMod.Instance.GetMusicFromMusicMod("YharonP2") ?? MusicID.LunarBoss; - moveCloser = true; string key = "Mods.CalamityMod.FlameText"; @@ -2841,10 +2841,10 @@ namespace CalamityMod.NPCs.Yharon npcLoot.Add(ModContent.ItemType(), 10); // Relic - npcLoot.AddIf(() => Main.masterMode || CalamityWorld.revenge, ModContent.ItemType()); + npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType()); // Lore - npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedYharon, ModContent.ItemType()); + npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedYharon, ModContent.ItemType(), desc: DropHelper.FirstKillText); } public override void BossLoot(ref string name, ref int potionType) diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index ac667b709a..a74d5504f5 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -46,8 +46,9 @@ namespace CalamityMod.Projectiles // Damage Adjusters public const float PierceResistHarshness = 0.12f; public const float PierceResistCap = 0.8f; - // TODO -- Remove this. Vanilla originalDamage now applies to all projectiles. - public int defDamage = 0; + + // defDamage was being used for frame1 hacks. this stands in as the replacement for that logic. + private bool frameOneHacksExecuted = false; // Enables "supercrits". When crit is over 100%, projectiles with this bool enabled can "supercrit". // For every 100% critical strike chance over 100%, "supercrit" projectiles do a guaranteed +100% damage. @@ -133,6 +134,9 @@ namespace CalamityMod.Projectiles public override void OnSpawn(Projectile projectile, IEntitySource source) { CreatedByPlayerDash = source is ProjectileSource_PlayerDashHit; + + // TODO -- it would be nice to move frame one hacks here, but this runs in the middle of NewProjectile + // which is way too early, the projectile's own initialization isn't even done yet } #endregion On Spawn @@ -163,9 +167,7 @@ namespace CalamityMod.Projectiles if (projectile.minion && ExplosiveEnchantCountdown > 0) { ExplosiveEnchantCountdown--; - if (defDamage == 0) - defDamage = projectile.damage; - projectile.damage = (int)(defDamage * MathHelper.SmoothStep(1f, 1.6f, 1f - ExplosiveEnchantCountdown / (float)ExplosiveEnchantTime)); + projectile.damage = (int)(projectile.originalDamage * MathHelper.SmoothStep(1f, 1.6f, 1f - ExplosiveEnchantCountdown / (float)ExplosiveEnchantTime)); // Make fizzle sounds and fire dust to indicate the impending explosion. if (ExplosiveEnchantCountdown <= 300) @@ -1062,7 +1064,9 @@ namespace CalamityMod.Projectiles else if (projectile.type == ProjectileID.DeathLaser && projectile.ai[0] == 1f) { - if (defDamage == 0) + // Unlikely that vanilla sets originalDamage for hostile projectiles. + // TODO -- this might not work and mech boss projectiles might deal too much damage again. + if (projectile.originalDamage == 0) { // Reduce mech boss projectile damage depending on the new ore progression changes if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) @@ -1073,7 +1077,7 @@ namespace CalamityMod.Projectiles projectile.damage = (int)(projectile.damage * 0.9); } - defDamage = projectile.damage; + projectile.originalDamage = projectile.damage; } projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + MathHelper.PiOver2; @@ -1943,7 +1947,7 @@ namespace CalamityMod.Projectiles Player player = Main.player[projectile.owner]; CalamityPlayer modPlayer = player.Calamity(); - if (defDamage == 0) + if (!frameOneHacksExecuted) { if (projectile.hostile) { @@ -1989,57 +1993,62 @@ namespace CalamityMod.Projectiles if (modPlayer.camper && !player.StandingStill()) projectile.damage = (int)(projectile.damage * 0.1); - } - defDamage = projectile.damage; - } - - // Setting this in SetDefaults didn't work - switch (projectile.type) - { - case ProjectileID.Bee: - case ProjectileID.Wasp: - case ProjectileID.TinyEater: - case ProjectileID.GiantBee: - case ProjectileID.Bat: - projectile.extraUpdates = 1; - break; - } - - if (NPC.downedMoonlord) - { - if (CalamityLists.dungeonProjectileBuffList.Contains(projectile.type)) - { - //Prevents them being buffed in Skeletron, Skeletron Prime, or Golem fights - if (((projectile.type == ProjectileID.RocketSkeleton || projectile.type == ProjectileID.Shadowflames) && projectile.ai[1] == 1f) || - (NPC.golemBoss > 0 && (projectile.type == ProjectileID.InfernoHostileBolt || projectile.type == ProjectileID.InfernoHostileBlast))) + if (projectile.CountsAsClass() && stealthStrike) { - projectile.damage = defDamage; - } - else - projectile.damage = defDamage + 30; - } - } - - if (DownedBossSystem.downedDoG && (Main.pumpkinMoon || Main.snowMoon || Main.eclipse)) - { - if (CalamityLists.eventProjectileBuffList.Contains(projectile.type)) - projectile.damage = defDamage + 15; - } - - if (projectile.type == ProjectileID.GiantBee || projectile.type == ProjectileID.Bee) - { - if (projectile.timeLeft > 570) //all of these have a time left of 600 or 660 - { - if (player.ActiveItem().type == ItemID.BeesKnees) - { - // projectile.magic = false /* tModPorter - this is redundant, for more info see https://github.com/tModLoader/tModLoader/wiki/Update-Migration-Guide#damage-classes */ ; - projectile.DamageType = DamageClass.Ranged; + if (modPlayer.filthyGlove || modPlayer.bloodyGlove) + projectile.ArmorPenetration += 10; + if (modPlayer.nanotech) + projectile.ArmorPenetration += 10; // 20 total } } + + if (NPC.downedMoonlord) + { + if (CalamityLists.dungeonProjectileBuffList.Contains(projectile.type)) + { + // ai[1] being set to 1 is done only by the Calamity usages of these projectiles in Skeletron and Skeletron Prime boss fights + bool isSkeletronBossProjectile = (projectile.type == ProjectileID.RocketSkeleton || projectile.type == ProjectileID.Shadowflames) && projectile.ai[1] == 1f; + + // These projectiles will not be buffed if Golem is alive + bool isGolemBossProjectile = NPC.golemBoss > 0 && (projectile.type == ProjectileID.InfernoHostileBolt || projectile.type == ProjectileID.InfernoHostileBlast); + + if (!isSkeletronBossProjectile && !isGolemBossProjectile) + projectile.damage += 30; + } + } + + if (DownedBossSystem.downedDoG && (Main.pumpkinMoon || Main.snowMoon || Main.eclipse)) + { + if (CalamityLists.eventProjectileBuffList.Contains(projectile.type)) + projectile.damage += 15; + } + + // Setting this in SetDefaults didn't work + switch (projectile.type) + { + case ProjectileID.Bee: + case ProjectileID.Wasp: + case ProjectileID.TinyEater: + case ProjectileID.GiantBee: + case ProjectileID.Bat: + projectile.extraUpdates = 1; + break; + } + + if (projectile.type == ProjectileID.GiantBee || projectile.type == ProjectileID.Bee) + { + if (projectile.timeLeft > 570) //all of these have a time left of 600 or 660 + { + if (player.ActiveItem().type == ItemID.BeesKnees) + projectile.DamageType = DamageClass.Ranged; + } + } + else if (projectile.type == ProjectileID.SoulDrain) + projectile.DamageType = DamageClass.Magic; + + frameOneHacksExecuted = true; } - else if (projectile.type == ProjectileID.SoulDrain) - projectile.DamageType = DamageClass.Magic; // Accelerate for 1.5 seconds to full velocity if (projectile.type == ProjectileID.HallowBossLastingRainbow && (CalamityWorld.revenge || BossRushEvent.BossRushActive)) diff --git a/Projectiles/DraedonsArsenal/AnomalysNanogunHoldout.cs b/Projectiles/DraedonsArsenal/AnomalysNanogunHoldout.cs new file mode 100644 index 0000000000..b938b1d7ec --- /dev/null +++ b/Projectiles/DraedonsArsenal/AnomalysNanogunHoldout.cs @@ -0,0 +1,210 @@ +using System; +using CalamityMod.Projectiles.BaseProjectiles; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items.Weapons.DraedonsArsenal; +using Microsoft.Xna.Framework.Graphics; +using CalamityMod.Particles; + +namespace CalamityMod.Projectiles.DraedonsArsenal +{ + public class AnomalysNanogunHoldout : ModProjectile + { + #region Properties + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public static Texture2D ScopeTexture = ModContent.Request("CalamityMod/Projectiles/DraedonsArsenal/AnomalysNanogunScope", ReLogic.Content.AssetRequestMode.ImmediateLoad).Value; + public ref float AITimer => ref Projectile.ai[1]; + public Player Owner => Main.player[Projectile.owner]; + public Vector2 MouseDistance => Owner.Calamity().mouseWorld - Owner.MountedCenter; + public ref float ScopeRotation => ref Projectile.localAI[0]; + public ref float ScopeScale => ref Projectile.localAI[1]; + public ref float TargetRecoil => ref Projectile.localAI[0]; + public bool UseMPFBAI { get => Projectile.ai[0] == MPFBAIType; } + #endregion + + #region Weapon Attributes + public const float GunLength = 64f; + public const float MPFBAIType = 2f; + + public const int MPFBFireTimer = 59; + public const float MPFBRecoil = MathHelper.Pi - MathHelper.PiOver4; + public const float MPFBScreenShakePower = 5f; + public const float MPFBPushback = 15f; + + public const int PlasmaChargeupTimer = 40; + public const int PlasmaCooldownTimer = 20; + public const int PlasmaShotCooldown = 16; + public const int PlasmaShotCount = 5; + public static int PlasmaFireTimer + { + get => PlasmaChargeupTimer + PlasmaCooldownTimer + (PlasmaShotCooldown * PlasmaShotCount); + } + #endregion + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("The Anomaly's Nanogun"); + } + + public override void SetDefaults() + { + Projectile.width = Projectile.height = 1; + Projectile.friendly = true; + Projectile.DamageType = DamageClass.Ranged; + Projectile.ignoreWater = true; + Projectile.tileCollide = false; + } + + public override void AI() + { + // Reset the holdout rotation and position + Owner.Calamity().mouseWorldListener = true; + Projectile.rotation = (Owner.Calamity().mouseWorld - Owner.MountedCenter).ToRotation(); + Projectile.Center = Owner.MountedCenter; + Owner.heldProj = Projectile.whoAmI; + + if (UseMPFBAI) + UpdateMPFB(); + else + UpdatePlasmaBeam(); + + AITimer++; + } + + // AI for the right click + public void UpdateMPFB() + { + // Make sure the player faces the right way + if (Projectile.velocity.X != 0f) + Owner.ChangeDir(Math.Sign(Projectile.velocity.X)); + else + Owner.ChangeDir(1); + + if (AITimer == 0) + { + SoundEngine.PlaySound(TheAnomalysNanogun.MPFBShotSFX, Projectile.Center); + + // Shoot 3 MPFBs with varying speeds and randomized animation starting placement + for (int i = 0; i < 3; i++) + { + int proj = Projectile.NewProjectile(new EntitySource_ItemUse_WithAmmo(Owner, Owner.HeldItem, -1), + Projectile.Center + Projectile.rotation.ToRotationVector2() * GunLength, + Projectile.velocity * (1f - i * 0.18f), + ModContent.ProjectileType(), + Projectile.damage, + Projectile.knockBack, + Projectile.owner); + + if (Main.projectile.IndexInRange(proj)) + { + Main.projectile[proj].frame = Main.rand.Next(0, 4); + Main.projectile[proj].frameCounter = Main.rand.Next(0, 3); + } + } + + // Make it POWERFUL + Owner.Calamity().GeneralScreenShakePower = MPFBScreenShakePower; + Owner.velocity += Projectile.velocity.SafeNormalize(Vector2.UnitX) * -MPFBPushback; + + // Assign target recoil + Vector2 direction = MouseDistance.SafeNormalize(Vector2.UnitX); + float recoil = direction.RotatedBy(-MathHelper.PiOver2 * 1.3f * Owner.direction).ToRotation(); + TargetRecoil = recoil; + + // Shooty ring + Particle pulse = new DirectionalPulseRing(Owner.MountedCenter + direction * GunLength, Vector2.Zero, Color.DeepSkyBlue, new Vector2(0.5f, 1f), direction.ToRotation(), 0.2f, 1f, 30); + GeneralParticleHandler.SpawnParticle(pulse); + return; + } + + // Apply recoil for the first 22 frames + if (AITimer < 22) + { + float newRotation = UpdateAimPostShotRecoil(TargetRecoil.ToRotationVector2()); + Owner.itemRotation = newRotation; + } + + // Then play a reload sound + else if (AITimer == 22) + { + SoundEngine.PlaySound(SoundID.Item149, Projectile.Center); + } + + // And finally move the gun back down as the reload sound plays + else if (MPFBFireTimer - AITimer < 30) + { + float newRotation = UpdateAimPostShotRecoil((TargetRecoil + MathHelper.PiOver2 * 1.3f * Owner.direction).ToRotationVector2()); + Owner.itemRotation = newRotation; + } + + if (AITimer >= MPFBFireTimer) + { + Projectile.Kill(); + } + } + + // VIOLENTLY adjusts the aim vector of the cannon to point towards the target recoil + // Then point back down as it reloads + private float UpdateAimPostShotRecoil(Vector2 target) => Vector2.Lerp(target * Owner.direction, Owner.itemRotation.ToRotationVector2(), 0.795f).ToRotation(); + + // AI for the left click + public void UpdatePlasmaBeam() + { + // Randomize the scope starting rotation + if (AITimer == 0) + { + SoundEngine.PlaySound(TheAnomalysNanogun.PlasmaChargeSFX, Projectile.Center); + ScopeRotation = Main.rand.NextFloat(MathHelper.Pi * 0.5f, MathHelper.Pi * 0.75f) * Main.rand.NextBool().ToDirectionInt(); + ScopeScale = 2.5f; + } + + // Set rotation and player direction + Owner.itemRotation = Projectile.rotation; + int dir = Math.Sign(Projectile.rotation.ToRotationVector2().X); + Owner.ChangeDir(dir == 0 ? 1 : dir); + Owner.itemRotation = ((Owner.Calamity().mouseWorld - Owner.MountedCenter) * Owner.direction).ToRotation(); + + if (AITimer - PlasmaChargeupTimer > 0) + { + // Fire a laser at the correct moments + if (AITimer % PlasmaShotCooldown == 0 && (AITimer - PlasmaChargeupTimer) / PlasmaShotCooldown <= PlasmaShotCount) + { + Projectile.NewProjectile(new EntitySource_ItemUse_WithAmmo(Owner, Owner.HeldItem, -1), + Projectile.Center + Projectile.rotation.ToRotationVector2() * GunLength, + Projectile.rotation.ToRotationVector2(), + ModContent.ProjectileType(), + Projectile.damage, + Projectile.knockBack, + Projectile.owner); + + SoundEngine.PlaySound(TheAnomalysNanogun.PlasmaShotSFX, Projectile.Center); + } + } + + // Shrink the scope + else + { + ScopeRotation = MathHelper.Lerp(ScopeRotation, 0f, 0.08f); + ScopeScale -= 0.0625f; + } + + if (AITimer >= PlasmaFireTimer) + Projectile.Kill(); + } + + public override void PostDraw(Color lightColor) + { + if (!UseMPFBAI && AITimer - PlasmaChargeupTimer <= 0) + { + Vector2 drawCenter = (Projectile.Center + Projectile.rotation.ToRotationVector2() * GunLength) - Main.screenPosition; + Main.EntitySpriteDraw(ScopeTexture, drawCenter, null, Color.White, ScopeRotation, ScopeTexture.Bounds.Size() / 2f, ScopeScale, SpriteEffects.None, 0); + } + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => false; + } +} diff --git a/Projectiles/DraedonsArsenal/AnomalysNanogunMPFBBoom.cs b/Projectiles/DraedonsArsenal/AnomalysNanogunMPFBBoom.cs new file mode 100644 index 0000000000..06d7236c0f --- /dev/null +++ b/Projectiles/DraedonsArsenal/AnomalysNanogunMPFBBoom.cs @@ -0,0 +1,32 @@ +using CalamityMod.Projectiles.BaseProjectiles; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.DraedonsArsenal +{ + public class AnomalysNanogunMPFBBoom : BaseMassiveExplosionProjectile + { + public static readonly SoundStyle MPFBExplosion = new("CalamityMod/Sounds/Item/AnomalysNanogunMPFBExplosion"); + public override int Lifetime => 40; + public override bool UsesScreenshake => true; + public override float GetScreenshakePower(float pulseCompletionRatio) => CalamityUtils.Convert01To010(pulseCompletionRatio) * 3f; + public override Color GetCurrentExplosionColor(float pulseCompletionRatio) => Color.Lerp(Color.Blue, Color.CornflowerBlue, MathHelper.Clamp(pulseCompletionRatio * 2.2f, 0f, 1f)); + public override void SetStaticDefaults() => DisplayName.SetDefault("MPFB Explosion"); + + public override void SetDefaults() + { + Projectile.width = Projectile.height = 2; + Projectile.friendly = true; + Projectile.tileCollide = false; + Projectile.penetrate = -1; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 10; + Projectile.timeLeft = Lifetime; + Projectile.DamageType = DamageClass.Ranged; + } + + public override void PostAI() => Lighting.AddLight(Projectile.Center, 0, Projectile.Opacity * 0.7f / 255f, Projectile.Opacity); + } +} diff --git a/Projectiles/DraedonsArsenal/AnomalysNanogunMPFBDevastator.cs b/Projectiles/DraedonsArsenal/AnomalysNanogunMPFBDevastator.cs new file mode 100644 index 0000000000..2f76acf7cc --- /dev/null +++ b/Projectiles/DraedonsArsenal/AnomalysNanogunMPFBDevastator.cs @@ -0,0 +1,90 @@ +using System; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items.Weapons.DraedonsArsenal; + +namespace CalamityMod.Projectiles.DraedonsArsenal +{ + public class AnomalysNanogunMPFBDevastator : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("MPFB Devastator"); + Main.projFrames[Type] = 4; + } + + public override void SetDefaults() + { + Projectile.width = 42; + Projectile.height = 44; + Projectile.friendly = true; + Projectile.DamageType = DamageClass.Ranged; + Projectile.timeLeft = 300; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + Projectile.ignoreWater = true; + } + + public override void AI() + { + // All of AI is visual + if (Main.dedServ) + return; + + // Spawn dusts in a helix-style pattern + float sine = (float)Math.Sin(Projectile.timeLeft * 0.375f / MathHelper.Pi); + + Vector2 offset = Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedBy(MathHelper.PiOver2) * sine * 16f; + Dust dust = Dust.NewDustPerfect(Projectile.Center + offset, 267, Vector2.Zero); + dust.color = Color.Cyan; + dust.noGravity = true; + + dust = Dust.NewDustPerfect(Projectile.Center - offset, 267, Vector2.Zero); + dust.color = Color.Cyan; + dust.noGravity = true; + + // Add light + Lighting.AddLight(Projectile.Center, 0, Projectile.Opacity * 0.7f / 255f, Projectile.Opacity); + + // Animate the projectile + Projectile.frameCounter++; + Projectile.frame = Projectile.frameCounter / 3 % Main.projFrames[Projectile.type]; + } + + public override bool PreDraw(ref Color lightColor) + { + Texture2D texture = ModContent.Request(Texture).Value; + int yPos = texture.Height / Main.projFrames[Type] * Projectile.frame; + Main.EntitySpriteDraw(texture, + Projectile.position - Main.screenPosition, + new Rectangle(0, yPos, texture.Width, texture.Height / Main.projFrames[Type]), + lightColor, + 0f, + Vector2.Zero, + 1f, + SpriteEffects.None, + 0); + + return false; + } + + public override void Kill(int timeLeft) + { + SoundEngine.PlaySound(AnomalysNanogunMPFBBoom.MPFBExplosion, Projectile.Center); + if (Main.myPlayer == Projectile.owner) + { + for (int i = 0; i < 5; i++) + { + Projectile explosion = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + explosion.ai[1] = Main.rand.NextFloat(110f, 200f) + i * 20f; // Randomize the maximum radius. + explosion.localAI[1] = Main.rand.NextFloat(0.18f, 0.3f); // And the interpolation step. + explosion.netUpdate = true; + } + } + } + } +} diff --git a/Projectiles/DraedonsArsenal/AnomalysNanogunMPFBDevastator.png b/Projectiles/DraedonsArsenal/AnomalysNanogunMPFBDevastator.png new file mode 100644 index 0000000000..da3fb1f2fa Binary files /dev/null and b/Projectiles/DraedonsArsenal/AnomalysNanogunMPFBDevastator.png differ diff --git a/Projectiles/DraedonsArsenal/AnomalysNanogunPlasmaBeam.cs b/Projectiles/DraedonsArsenal/AnomalysNanogunPlasmaBeam.cs new file mode 100644 index 0000000000..8b6cac0637 --- /dev/null +++ b/Projectiles/DraedonsArsenal/AnomalysNanogunPlasmaBeam.cs @@ -0,0 +1,167 @@ +using CalamityMod.Projectiles.BaseProjectiles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using Terraria; +using Terraria.Enums; +using Terraria.ModLoader; +using CalamityMod.Particles; +using System; + +namespace CalamityMod.Projectiles.DraedonsArsenal +{ + public class AnomalysNanogunPlasmaBeam : BaseLaserbeamProjectile + { + public override string Texture => "CalamityMod/Projectiles/Magic/YharimsCrystalBeam"; + + // All 3 point to the same so that BaseLaserbeamProjectile can still be used with an animated laser + public override Texture2D LaserBeginTexture => ModContent.Request("CalamityMod/Projectiles/DraedonsArsenal/AnomalysNanogunPlasmaBeam", AssetRequestMode.ImmediateLoad).Value; + public override Texture2D LaserMiddleTexture => LaserBeginTexture; + public override Texture2D LaserEndTexture => LaserBeginTexture; + + public override float MaxScale => 1f; + public override float Lifetime => 12f; + public override float MaxLaserLength => 2200f; + public override Color LaserOverlayColor => Color.White; + public override Color LightCastColor => Color.OrangeRed; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Plasma Beam"); + } + + public override void SetDefaults() + { + Projectile.width = 6; + Projectile.height = 6; + Projectile.friendly = true; + Projectile.DamageType = DamageClass.Ranged; + Projectile.scale = MaxScale; + Projectile.penetrate = -1; + Projectile.tileCollide = false; + Projectile.timeLeft = 12; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + Main.projFrames[Projectile.type] = 18; + } + + public override void AI() + { + Projectile.rotation = Projectile.velocity.ToRotation(); + base.AI(); + } + + public override void ExtraBehavior() + { + if (Projectile.timeLeft == 12) + { + Vector2 beamVector = Projectile.velocity; + float beamLength = DetermineLaserLength_CollideWithTiles(12); + + //Rapid dust + int dustCount = Main.rand.Next(10, 30); + for (int i = 0; i < dustCount; i++) + { + float dustProgressAlongBeam = beamLength * Main.rand.NextFloat(0f, 0.8f); + Vector2 dustPosition = Projectile.Center + dustProgressAlongBeam * beamVector + beamVector.RotatedBy(MathHelper.PiOver2) * Main.rand.NextFloat(-6f, 6f) * Projectile.scale; + + Dust dust = Dust.NewDustPerfect(dustPosition, 187, beamVector * Main.rand.NextFloat(5f, 26f), 0, Color.OrangeRed, 2.2f); + dust.noGravity = true; + } + + // Energy rings around the laser + int step = 10; + while (step < LaserLength) + { + Particle pulse = new DirectionalPulseRing(Projectile.Center + MathHelper.WrapAngle(Projectile.rotation + MathHelper.PiOver2).ToRotationVector2() * step, Vector2.Zero, Color.Red, new Vector2(0.5f, 1f), MathHelper.WrapAngle(Projectile.rotation + MathHelper.PiOver2), 0.1f, 1f, 12); + GeneralParticleHandler.SpawnParticle(pulse); + step += 100; + } + } + + else + Projectile.frameCounter++; + } + + public override void DetermineScale() => Projectile.scale = 1f; + + public override float DetermineLaserLength() => DetermineLaserLength_CollideWithTiles(5); + + public override bool ShouldUpdatePosition() => false; + + public override void CutTiles() + { + DelegateMethods.tilecut_0 = TileCuttingContext.AttackProjectile; + Vector2 unit = Projectile.velocity; + Utils.PlotTileLine(Projectile.Center, Projectile.Center + unit * LaserLength, Projectile.width + 16, DelegateMethods.CutTiles); + } + + // Animated laser + public override bool PreDraw(ref Color lightColor) + { + int frame = Projectile.frameCounter / 2; + DrawPlasmaBeam(Color.White, 1f, frame + 12, frame + 6, frame); + return false; + } + + private void DrawPlasmaBeam(Color beamColor, float scale, int startFrame = 0, int middleFrame = 0, int endFrame = 0) + { + Rectangle startFrameArea = LaserBeginTexture.Frame(1, Main.projFrames[Projectile.type], 0, startFrame); + Rectangle middleFrameArea = LaserMiddleTexture.Frame(1, Main.projFrames[Projectile.type], 0, middleFrame); + Rectangle endFrameArea = LaserEndTexture.Frame(1, Main.projFrames[Projectile.type], 0, endFrame); + + // Start texture drawing. + Main.EntitySpriteDraw(LaserBeginTexture, + Projectile.Center - Main.screenPosition, + startFrameArea, + beamColor, + MathHelper.WrapAngle(Projectile.rotation + MathHelper.Pi), + startFrameArea.Size() / 2f, + scale, + SpriteEffects.None, + 0); + + // Prepare things for body drawing. + float laserBodyLength = LaserLength; + laserBodyLength -= (startFrameArea.Height / 2 + endFrameArea.Height) * scale; + Vector2 centerOnLaser = Projectile.Center; + centerOnLaser += Projectile.velocity * scale * startFrameArea.Height / 2f; + + // Body drawing. + if (laserBodyLength > 0f) + { + float laserOffset = middleFrameArea.Height * scale; + float incrementalBodyLength = 0f; + while (incrementalBodyLength + 1f < laserBodyLength) + { + Main.EntitySpriteDraw(LaserMiddleTexture, + centerOnLaser - Main.screenPosition, + middleFrameArea, + beamColor, + Projectile.rotation, + LaserMiddleTexture.Width * 0.5f * Vector2.UnitX, + scale, + SpriteEffects.None, + 0); + incrementalBodyLength += laserOffset; + centerOnLaser += Projectile.velocity * laserOffset; + } + } + + // End texture drawing. + if (Math.Abs(LaserLength - DetermineLaserLength()) < 30f) + { + Vector2 laserEndCenter = centerOnLaser - Main.screenPosition; + Main.EntitySpriteDraw(LaserEndTexture, + laserEndCenter, + endFrameArea, + beamColor, + MathHelper.WrapAngle(Projectile.rotation + MathHelper.Pi), + endFrameArea.Size() / 2f, + scale, + SpriteEffects.None, + 0); + } + } + } +} diff --git a/Projectiles/DraedonsArsenal/AnomalysNanogunPlasmaBeam.png b/Projectiles/DraedonsArsenal/AnomalysNanogunPlasmaBeam.png new file mode 100644 index 0000000000..7763672e3c Binary files /dev/null and b/Projectiles/DraedonsArsenal/AnomalysNanogunPlasmaBeam.png differ diff --git a/Projectiles/DraedonsArsenal/AnomalysNanogunScope.png b/Projectiles/DraedonsArsenal/AnomalysNanogunScope.png new file mode 100644 index 0000000000..685fc59c6a Binary files /dev/null and b/Projectiles/DraedonsArsenal/AnomalysNanogunScope.png differ diff --git a/Projectiles/Healing/FungalHeal.cs b/Projectiles/Healing/FungalHeal.cs index f464d1a4cd..f00044fb24 100644 --- a/Projectiles/Healing/FungalHeal.cs +++ b/Projectiles/Healing/FungalHeal.cs @@ -18,21 +18,11 @@ namespace CalamityMod.Projectiles.Healing Projectile.alpha = 255; Projectile.tileCollide = false; Projectile.extraUpdates = 10; - Projectile.timeLeft = 300; + Projectile.timeLeft = 600; } public override void AI() { - if (Projectile.localAI[0] == 0f) - { - Player player = Main.player[Projectile.owner]; - Item item = player.ActiveItem(); - bool summonNotWhip = item.CountsAsClass() && !item.CountsAsClass(); - if (summonNotWhip || item.hammer > 0 || item.pick > 0 || item.axe > 0) - Projectile.timeLeft = 600; - Projectile.localAI[0] += 1f; - } - Projectile.HealingProjectile((int)Projectile.ai[1], (int)Projectile.ai[0], 5f, 15f); float num494 = Projectile.velocity.X * 0.334f; float num495 = -(Projectile.velocity.Y * 0.334f); diff --git a/Projectiles/Magic/AetherBeam.cs b/Projectiles/Magic/AetherBeam.cs index e15a2a0d9b..8a9efb3bb5 100644 --- a/Projectiles/Magic/AetherBeam.cs +++ b/Projectiles/Magic/AetherBeam.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.ai[1] = 0f; } - Projectile.damage += Projectile.Calamity().defDamage / 200; + Projectile.damage += Projectile.originalDamage / 200; Projectile.alpha = Utils.Clamp(Projectile.alpha - 25, 0, 255); Lighting.AddLight((int)Projectile.Center.X / 16, (int)Projectile.Center.Y / 16, 1f, 0f, 0.7f); diff --git a/Projectiles/Melee/DarkBeam.cs b/Projectiles/Melee/DarkBeam.cs index d7c1904707..8736df5813 100644 --- a/Projectiles/Melee/DarkBeam.cs +++ b/Projectiles/Melee/DarkBeam.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetDefaults() { - Projectile.width = 56; - Projectile.height = 56; + Projectile.width = 74; + Projectile.height = 74; Projectile.aiStyle = ProjAIStyleID.Sickle; AIType = ProjectileID.DeathSickle; Projectile.friendly = true; diff --git a/Projectiles/Melee/DarkBeam.png b/Projectiles/Melee/DarkBeam.png index ba27b2821d..5869f94796 100644 Binary files a/Projectiles/Melee/DarkBeam.png and b/Projectiles/Melee/DarkBeam.png differ diff --git a/Projectiles/Melee/DevilsSunriseCyclone.cs b/Projectiles/Melee/DevilsSunriseCyclone.cs index a415593ea9..1613469e1b 100644 --- a/Projectiles/Melee/DevilsSunriseCyclone.cs +++ b/Projectiles/Melee/DevilsSunriseCyclone.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using System; using Terraria; @@ -42,12 +42,12 @@ namespace CalamityMod.Projectiles.Melee if (!Main.player[Projectile.owner].channel) { Projectile.ai[1] = -1f; - Projectile.damage = Projectile.Calamity().defDamage; + Projectile.damage = Projectile.originalDamage; } } if (Projectile.ai[1] >= 255f) - Projectile.damage = (int)((double)Projectile.Calamity().defDamage * 2.0); + Projectile.damage = 2 * Projectile.originalDamage; red = 64 + (int)(Projectile.ai[1] * 0.75f); if (red > 255) diff --git a/Projectiles/Melee/DevilsSunriseProj.cs b/Projectiles/Melee/DevilsSunriseProj.cs index 9c0711df2f..d718726627 100644 --- a/Projectiles/Melee/DevilsSunriseProj.cs +++ b/Projectiles/Melee/DevilsSunriseProj.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.ai[1] += 1f; if (Projectile.ai[1] == 255f) - Projectile.damage = (int)((double)Projectile.Calamity().defDamage * 2.0); + Projectile.damage = 2 * Projectile.originalDamage; red = 64 + (int)(Projectile.ai[1] * 0.75f); if (red > 255) diff --git a/Projectiles/Melee/IllustriousKnife.cs b/Projectiles/Melee/IllustriousKnife.cs index c8dfb5385d..0e930aa032 100644 --- a/Projectiles/Melee/IllustriousKnife.cs +++ b/Projectiles/Melee/IllustriousKnife.cs @@ -25,6 +25,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.DamageType = DamageClass.MeleeNoSpeed; Projectile.penetrate = 1; Projectile.timeLeft = 300; + Projectile.extraUpdates = 1; } public override void AI() diff --git a/Projectiles/Melee/LightBeam.cs b/Projectiles/Melee/LightBeam.cs index f6f43f12de..53324964cf 100644 --- a/Projectiles/Melee/LightBeam.cs +++ b/Projectiles/Melee/LightBeam.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetDefaults() { - Projectile.width = 56; - Projectile.height = 56; + Projectile.width = 74; + Projectile.height = 74; Projectile.aiStyle = ProjAIStyleID.Sickle; AIType = ProjectileID.DeathSickle; Projectile.friendly = true; diff --git a/Projectiles/Melee/LightBeam.png b/Projectiles/Melee/LightBeam.png index 5d95d6961b..ff726ed466 100644 Binary files a/Projectiles/Melee/LightBeam.png and b/Projectiles/Melee/LightBeam.png differ diff --git a/Projectiles/Rogue/GacruxianHome.cs b/Projectiles/Rogue/GacruxianHome.cs index a3eb3d6d94..80a5f14bbf 100644 --- a/Projectiles/Rogue/GacruxianHome.cs +++ b/Projectiles/Rogue/GacruxianHome.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Projectiles.Rogue { public class GacruxianHome : ModProjectile { - public override string Texture => "CalamityMod/Items/Fishing/AstralCatches/GacruxianMollusk"; + public override string Texture => "CalamityMod/Items/Weapons/Rogue/GacruxianMollusk"; public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/GacruxianProj.cs b/Projectiles/Rogue/GacruxianProj.cs index 924d31b366..ed075fd414 100644 --- a/Projectiles/Rogue/GacruxianProj.cs +++ b/Projectiles/Rogue/GacruxianProj.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Projectiles.Rogue { public class GacruxianProj : ModProjectile { - public override string Texture => "CalamityMod/Items/Fishing/AstralCatches/GacruxianMollusk"; + public override string Texture => "CalamityMod/Items/Weapons/Rogue/GacruxianMollusk"; public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/ReaperProjectile.cs b/Projectiles/Rogue/ReaperProjectile.cs index 85a7b7a695..09aeeaa58e 100644 --- a/Projectiles/Rogue/ReaperProjectile.cs +++ b/Projectiles/Rogue/ReaperProjectile.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.extraUpdates = 3; Projectile.timeLeft = Projectile.MaxUpdates * 90; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 32; // can't hit too fast, but can hit many many times + Projectile.localNPCHitCooldown = 26; // can't hit too fast, but can hit many many times Projectile.DamageType = RogueDamageClass.Instance; } diff --git a/Projectiles/Rogue/TheSyringeProj.cs b/Projectiles/Rogue/TheSyringeProj.cs index 0f2c5af338..6522fcea76 100644 --- a/Projectiles/Rogue/TheSyringeProj.cs +++ b/Projectiles/Rogue/TheSyringeProj.cs @@ -38,7 +38,8 @@ namespace CalamityMod.Projectiles.Rogue if (Main.rand.NextBool(8)) Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, Main.rand.Next(2) == 1 ? 107 : 89, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f); - Projectile.damage += Projectile.Calamity().defDamage / 200; + // TODO -- This will almost never work due to the base damage being too low, and will round down. + Projectile.damage += Projectile.originalDamage / 200; } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Summon/DeathstareBeam.cs b/Projectiles/Summon/DeathstareBeam.cs index 0d84849565..801f8d774f 100644 --- a/Projectiles/Summon/DeathstareBeam.cs +++ b/Projectiles/Summon/DeathstareBeam.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Summon } Projectile.Opacity = Utils.GetLerpValue(1f, 0f, 1f - Projectile.timeLeft / 10f, true); - Projectile.Center = Main.projectile[(int)OwnerUUID].Center - Projectile.velocity; + Projectile.Center = CalamityUtils.FindProjectileByIdentity((int)OwnerUUID, Projectile.owner).Center - Projectile.velocity; Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Summon/DeathstareEyeball.cs b/Projectiles/Summon/DeathstareEyeball.cs index 31d801ae1c..9c4a9e5a2a 100644 --- a/Projectiles/Summon/DeathstareEyeball.cs +++ b/Projectiles/Summon/DeathstareEyeball.cs @@ -119,7 +119,7 @@ namespace CalamityMod.Projectiles.Summon if (Main.projectile.IndexInRange(beam)) { Main.projectile[beam].originalDamage = Projectile.originalDamage; - Main.projectile[beam].ai[0] = Projectile.GetByUUID(Projectile.owner, Projectile.whoAmI); + Main.projectile[beam].ai[0] = Projectile.identity; Main.projectile[beam].Damage(); } } diff --git a/Projectiles/Summon/FungalClumpMinion.cs b/Projectiles/Summon/FungalClumpMinion.cs index c5eedf42a4..aa5799513f 100644 --- a/Projectiles/Summon/FungalClumpMinion.cs +++ b/Projectiles/Summon/FungalClumpMinion.cs @@ -34,7 +34,6 @@ namespace CalamityMod.Projectiles.Summon Projectile.timeLeft *= 5; Projectile.minion = true; Projectile.tileCollide = false; - Projectile.DamageType = DamageClass.Summon; } public override void AI() diff --git a/Scenes/AbyssLayer1Scene.cs b/Scenes/AbyssLayer1Scene.cs deleted file mode 100644 index fa41a9722d..0000000000 --- a/Scenes/AbyssLayer1Scene.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Systems -{ - public class AbyssLayer1Scene : ModSceneEffect - { - public override bool IsSceneEffectActive(Player player) => player.Calamity().ZoneAbyssLayer1 || player.Calamity().ZoneSunkenSea; // Placeholder for the Sunken Sea - - public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer1"; - } -} diff --git a/Scenes/AbyssLayer23Scene.cs b/Scenes/AbyssLayer23Scene.cs deleted file mode 100644 index 840780bee5..0000000000 --- a/Scenes/AbyssLayer23Scene.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Systems -{ - public class AbyssLayer23Scene : ModSceneEffect - { - public override bool IsSceneEffectActive(Player player) => player.Calamity().ZoneAbyssLayer2 || player.Calamity().ZoneAbyssLayer3; - - public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer23"; - } -} diff --git a/Scenes/AbyssLayer4Scene.cs b/Scenes/AbyssLayer4Scene.cs deleted file mode 100644 index 80f58d1042..0000000000 --- a/Scenes/AbyssLayer4Scene.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Systems -{ - public class AbyssLayer4Scene : ModSceneEffect - { - public override bool IsSceneEffectActive(Player player) => player.Calamity().ZoneAbyssLayer4; - - public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer4"; - } -} diff --git a/Scenes/AstralScene.cs b/Scenes/AstralScene.cs deleted file mode 100644 index d1ca639599..0000000000 --- a/Scenes/AstralScene.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Systems -{ - public class AstralScene : ModSceneEffect - { - public override SceneEffectPriority Priority => SceneEffectPriority.BiomeHigh; - - public override bool IsSceneEffectActive(Player player) => player.Calamity().ZoneAstral; - - public override void SpecialVisuals(Player player, bool isActive) - { - player.ManageSpecialBiomeVisuals("CalamityMod:Astral", isActive); - } - - public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/AstralBG"; - } -} diff --git a/Scenes/AEWBackgroundScene.cs b/Scenes/BossBackgroundScenes/AEWBackgroundScene.cs similarity index 100% rename from Scenes/AEWBackgroundScene.cs rename to Scenes/BossBackgroundScenes/AEWBackgroundScene.cs diff --git a/Scenes/CalamitasCloneBackgroundScene.cs b/Scenes/BossBackgroundScenes/CalamitasCloneBackgroundScene.cs similarity index 100% rename from Scenes/CalamitasCloneBackgroundScene.cs rename to Scenes/BossBackgroundScenes/CalamitasCloneBackgroundScene.cs diff --git a/Scenes/CryogenBackgroundScene.cs b/Scenes/BossBackgroundScenes/CryogenBackgroundScene.cs similarity index 100% rename from Scenes/CryogenBackgroundScene.cs rename to Scenes/BossBackgroundScenes/CryogenBackgroundScene.cs diff --git a/Scenes/DoGBackgroundScene.cs b/Scenes/BossBackgroundScenes/DoGBackgroundScene.cs similarity index 100% rename from Scenes/DoGBackgroundScene.cs rename to Scenes/BossBackgroundScenes/DoGBackgroundScene.cs diff --git a/Scenes/ExoMechBackgroundScene.cs b/Scenes/BossBackgroundScenes/ExoMechBackgroundScene.cs similarity index 100% rename from Scenes/ExoMechBackgroundScene.cs rename to Scenes/BossBackgroundScenes/ExoMechBackgroundScene.cs diff --git a/Scenes/LeviathanBackgroundScene.cs b/Scenes/BossBackgroundScenes/LeviathanBackgroundScene.cs similarity index 100% rename from Scenes/LeviathanBackgroundScene.cs rename to Scenes/BossBackgroundScenes/LeviathanBackgroundScene.cs diff --git a/Scenes/PBGBackgroundScene.cs b/Scenes/BossBackgroundScenes/PBGBackgroundScene.cs similarity index 100% rename from Scenes/PBGBackgroundScene.cs rename to Scenes/BossBackgroundScenes/PBGBackgroundScene.cs diff --git a/Scenes/ProvBackgroundScene.cs b/Scenes/BossBackgroundScenes/ProvBackgroundScene.cs similarity index 100% rename from Scenes/ProvBackgroundScene.cs rename to Scenes/BossBackgroundScenes/ProvBackgroundScene.cs diff --git a/Scenes/SCalBackgroundScene.cs b/Scenes/BossBackgroundScenes/SCalBackgroundScene.cs similarity index 100% rename from Scenes/SCalBackgroundScene.cs rename to Scenes/BossBackgroundScenes/SCalBackgroundScene.cs diff --git a/Scenes/StormWeaverBackgroundScene.cs b/Scenes/BossBackgroundScenes/StormWeaverBackgroundScene.cs similarity index 100% rename from Scenes/StormWeaverBackgroundScene.cs rename to Scenes/BossBackgroundScenes/StormWeaverBackgroundScene.cs diff --git a/Scenes/YharonBackgroundScene.cs b/Scenes/BossBackgroundScenes/YharonBackgroundScene.cs similarity index 100% rename from Scenes/YharonBackgroundScene.cs rename to Scenes/BossBackgroundScenes/YharonBackgroundScene.cs diff --git a/Scenes/BossRushScene.cs b/Scenes/MiscScenes/BossRushScene.cs similarity index 100% rename from Scenes/BossRushScene.cs rename to Scenes/MiscScenes/BossRushScene.cs diff --git a/Scenes/DoGPhase2DelayScene.cs b/Scenes/MiscScenes/DoGPhase2DelayScene.cs similarity index 100% rename from Scenes/DoGPhase2DelayScene.cs rename to Scenes/MiscScenes/DoGPhase2DelayScene.cs diff --git a/Scenes/MiscScenes/MonolithAccursedScene.cs b/Scenes/MiscScenes/MonolithAccursedScene.cs new file mode 100644 index 0000000000..bc6cb839f4 --- /dev/null +++ b/Scenes/MiscScenes/MonolithAccursedScene.cs @@ -0,0 +1,17 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + public class MonolithAccursedScene : ModSceneEffect + { + public override SceneEffectPriority Priority => SceneEffectPriority.Environment; + + public override bool IsSceneEffectActive(Player player) => player.Calamity().monolithAccursedShader > 0; + + public override void SpecialVisuals(Player player, bool isActive) + { + player.ManageSpecialBiomeVisuals("CalamityMod:MonolithAccursed", isActive); + } + } +} diff --git a/Scenes/MusicScenes/AEWMusicScene.cs b/Scenes/MusicScenes/AEWMusicScene.cs new file mode 100644 index 0000000000..6857a08cc3 --- /dev/null +++ b/Scenes/MusicScenes/AEWMusicScene.cs @@ -0,0 +1,17 @@ +using CalamityMod.NPCs.AdultEidolonWyrm; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + public class AEWMusicScene : BaseMusicSceneEffect + { + public override SceneEffectPriority Priority => SceneEffectPriority.BossHigh; + + public override int NPCType => ModContent.NPCType(); + public override int? MusicModMusic => CalamityMod.Instance.GetMusicFromMusicMod("AdultEidolonWyrm"); + public override int VanillaMusic => MusicID.Boss3; + public override int OtherworldMusic => MusicID.OtherworldlyBoss2; + } +} diff --git a/Scenes/MusicScenes/AnahitaMusicScene.cs b/Scenes/MusicScenes/AnahitaMusicScene.cs new file mode 100644 index 0000000000..41746a90af --- /dev/null +++ b/Scenes/MusicScenes/AnahitaMusicScene.cs @@ -0,0 +1,20 @@ +using CalamityMod.NPCs; +using CalamityMod.NPCs.Leviathan; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + public class AnahitaMusicScene : BaseMusicSceneEffect + { + public override SceneEffectPriority Priority => SceneEffectPriority.BossMedium; + + public override int NPCType => ModContent.NPCType(); + public override int? MusicModMusic => CalamityMod.Instance.GetMusicFromMusicMod("Anahita"); + public override int VanillaMusic => MusicID.Boss3; + public override int OtherworldMusic => MusicID.OtherworldlyBoss2; + + public override bool AdditionalCheck() => CalamityGlobalNPC.leviathan == -1; + } +} diff --git a/Scenes/MusicScenes/AquaticScourgeMusicScene.cs b/Scenes/MusicScenes/AquaticScourgeMusicScene.cs new file mode 100644 index 0000000000..bb227adf0e --- /dev/null +++ b/Scenes/MusicScenes/AquaticScourgeMusicScene.cs @@ -0,0 +1,26 @@ +using CalamityMod.Events; +using CalamityMod.NPCs; +using CalamityMod.NPCs.AquaticScourge; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + public class AquaticScourgeMusicScene : BaseMusicSceneEffect + { + public override SceneEffectPriority Priority => SceneEffectPriority.BossMedium; + + public override int NPCType => ModContent.NPCType(); + public override int? MusicModMusic => CalamityMod.Instance.GetMusicFromMusicMod("AquaticScourge"); + public override int VanillaMusic => MusicID.Boss2; + public override int OtherworldMusic => MusicID.OtherworldlyBoss2; + + public override bool AdditionalCheck() + { + if (CalamityGlobalNPC.aquaticScourge == -1) + return false; + return Main.npc[CalamityGlobalNPC.aquaticScourge].justHit || Main.npc[CalamityGlobalNPC.aquaticScourge].life <= Main.npc[CalamityGlobalNPC.aquaticScourge].lifeMax * 0.999 || BossRushEvent.BossRushActive || Main.getGoodWorld; + } + } +} diff --git a/Scenes/MusicScenes/AstrumAureusMusicScene.cs b/Scenes/MusicScenes/AstrumAureusMusicScene.cs new file mode 100644 index 0000000000..da9be0e2c0 --- /dev/null +++ b/Scenes/MusicScenes/AstrumAureusMusicScene.cs @@ -0,0 +1,17 @@ +using CalamityMod.NPCs.AstrumAureus; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + public class AstrumAureusMusicScene : BaseMusicSceneEffect + { + public override SceneEffectPriority Priority => SceneEffectPriority.BossMedium; + + public override int NPCType => ModContent.NPCType(); + public override int? MusicModMusic => CalamityMod.Instance.GetMusicFromMusicMod("AstrumAureus"); + public override int VanillaMusic => MusicID.Boss3; + public override int OtherworldMusic => MusicID.OtherworldlyBoss2; + } +} diff --git a/Scenes/MusicScenes/AstrumDeusMusicScene.cs b/Scenes/MusicScenes/AstrumDeusMusicScene.cs new file mode 100644 index 0000000000..340c785036 --- /dev/null +++ b/Scenes/MusicScenes/AstrumDeusMusicScene.cs @@ -0,0 +1,22 @@ +using CalamityMod.NPCs.AstrumDeus; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + public class AstrumDeusMusicScene : BaseMusicSceneEffect + { + public override SceneEffectPriority Priority => SceneEffectPriority.BossMedium; + + public override int NPCType => ModContent.NPCType(); + public override int? MusicModMusic => CalamityMod.Instance.GetMusicFromMusicMod("AstrumDeus"); + public override int VanillaMusic => MusicID.Boss3; + public override int OtherworldMusic => MusicID.OtherworldlyBoss2; + public override int[] AdditionalNPCs => new int[] + { + ModContent.NPCType(), + ModContent.NPCType() + }; + } +} diff --git a/Scenes/MusicScenes/BaseMusicSceneEffect.cs b/Scenes/MusicScenes/BaseMusicSceneEffect.cs new file mode 100644 index 0000000000..6f157d50a5 --- /dev/null +++ b/Scenes/MusicScenes/BaseMusicSceneEffect.cs @@ -0,0 +1,107 @@ +using Microsoft.Xna.Framework; +//using System.Reflection; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + public abstract class BaseMusicSceneEffect : ModSceneEffect + { + // Scene Effect Priorities + // ??? (Anahita Lure): SceneEffectPriority.BossLow + // Most Bosses: SceneEffectPriority.BossMedium + // Major Post-ML Bosses: SceneEffectPriority.BossHigh + // + // BossLow = default for modded bosses but has a bug where Boss 1 is queued for 1 frame + // BossMedium = overrides all vanilla boss music, including events + // BossHigh = overrides even ML's pre-spawning music fadeout + + #region Overridable Properties + public abstract int NPCType { get; } + public abstract int? MusicModMusic { get; } + public abstract int VanillaMusic { get; } + public abstract int OtherworldMusic { get; } + public virtual int MusicDistance => 5000; + public virtual int[] AdditionalNPCs => new int[] { }; + #endregion + + #region Overridable Methods + public virtual bool AdditionalCheck() => true; + #endregion + + public virtual int SetMusic() + { + if (MusicModMusic is not null) + return (int)MusicModMusic; + + return VanillaMusic; + + // You can't even edit music if the game has Otherworld toggle on lol. Have fun with Boss 1 + /* + FieldInfo swapMusicField = typeof(Main).GetField("swapMusic", BindingFlags.Static | BindingFlags.NonPublic); + bool musicSwapped = (bool)swapMusicField.GetValue(null); + bool playingOtherworld = (!Main.drunkWorld && musicSwapped) || (Main.drunkWorld && !musicSwapped); + // Main.swapMusic is private. Todo: bug tmod devs to avoid reflection + return playingOtherworld ? OtherworldMusic : VanillaMusic; + */ + } + + public virtual bool SetSceneEffect(Player player) + { + if (!AdditionalCheck()) + return false; + + if (MusicModMusic is null && VanillaMusic == -1) + return false; + + /* + // You can't even edit music if the game has Otherworld toggle on lol. + // Theoretically, reflection would only occur if the music mod is disabled + if (MusicModMusic is null) + { + FieldInfo swapMusicField = typeof(Main).GetField("swapMusic", BindingFlags.Static | BindingFlags.NonPublic); + bool musicSwapped = (bool)swapMusicField.GetValue(null); + bool playingOtherworld = (!Main.drunkWorld && musicSwapped) || (Main.drunkWorld && !musicSwapped); + if (VanillaMusic == -1 && !playingOtherworld) + return false; + if (OtherworldMusic == -1 && playingOtherworld) + return false; + } + */ + + for (int j = 0; j < Main.maxNPCs; j++) + { + NPC npc = Main.npc[j]; + if (!npc.active) + continue; + + bool inList = false; + if (npc.type == NPCType) + inList = true; + else + { + for (int i = 0; i < AdditionalNPCs.Length; i++) + { + if (npc.type == AdditionalNPCs[i]) + { + inList = true; + break; + } + } + } + if (!inList) + continue; + + Rectangle screenRect = new Rectangle((int)Main.screenPosition.X, (int)Main.screenPosition.Y, Main.screenWidth, Main.screenHeight); + Rectangle npcBox = new Rectangle((int)npc.Center.X - MusicDistance, (int)npc.Center.Y - MusicDistance, MusicDistance * 2, MusicDistance * 2); + if (screenRect.Intersects(npcBox)) + return true; + } + return false; + } + + public override int Music => SetMusic(); + + public override bool IsSceneEffectActive(Player player) => SetSceneEffect(player); + } +} diff --git a/Scenes/MusicScenes/BrimstoneElementalMusicScene.cs b/Scenes/MusicScenes/BrimstoneElementalMusicScene.cs new file mode 100644 index 0000000000..e08256546a --- /dev/null +++ b/Scenes/MusicScenes/BrimstoneElementalMusicScene.cs @@ -0,0 +1,17 @@ +using CalamityMod.NPCs.BrimstoneElemental; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + public class BrimstoneElementalMusicScene : BaseMusicSceneEffect + { + public override SceneEffectPriority Priority => SceneEffectPriority.BossMedium; + + public override int NPCType => ModContent.NPCType(); + public override int? MusicModMusic => CalamityMod.Instance.GetMusicFromMusicMod("BrimstoneElemental"); + public override int VanillaMusic => MusicID.Boss4; + public override int OtherworldMusic => MusicID.OtherworldlyBoss2; + } +} diff --git a/Scenes/MusicScenes/CalamitasMusicScene.cs b/Scenes/MusicScenes/CalamitasMusicScene.cs new file mode 100644 index 0000000000..e697339078 --- /dev/null +++ b/Scenes/MusicScenes/CalamitasMusicScene.cs @@ -0,0 +1,22 @@ +using CalamityMod.NPCs.Calamitas; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + public class CalamitasMusicScene : BaseMusicSceneEffect + { + public override SceneEffectPriority Priority => SceneEffectPriority.BossMedium; + + public override int NPCType => ModContent.NPCType(); + public override int? MusicModMusic => CalamityMod.Instance.GetMusicFromMusicMod("Calamitas"); + public override int VanillaMusic => MusicID.Boss2; + public override int OtherworldMusic => MusicID.OtherworldlyBoss2; + public override int[] AdditionalNPCs => new int[] + { + ModContent.NPCType(), + ModContent.NPCType() + }; + } +} diff --git a/Scenes/MusicScenes/CeaselessVoidMusicScene.cs b/Scenes/MusicScenes/CeaselessVoidMusicScene.cs new file mode 100644 index 0000000000..3747c5ae14 --- /dev/null +++ b/Scenes/MusicScenes/CeaselessVoidMusicScene.cs @@ -0,0 +1,17 @@ +using CalamityMod.NPCs.CeaselessVoid; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + public class CeaselessVoidMusicScene : BaseMusicSceneEffect + { + public override SceneEffectPriority Priority => SceneEffectPriority.BossMedium; + + public override int NPCType => ModContent.NPCType(); + public override int? MusicModMusic => CalamityMod.Instance.GetMusicFromMusicMod("CeaselessVoid"); + public override int VanillaMusic => MusicID.Boss3; + public override int OtherworldMusic => MusicID.OtherworldlyBoss2; + } +} diff --git a/Scenes/MusicScenes/CrabulonMusicScene.cs b/Scenes/MusicScenes/CrabulonMusicScene.cs new file mode 100644 index 0000000000..b21c95d1ef --- /dev/null +++ b/Scenes/MusicScenes/CrabulonMusicScene.cs @@ -0,0 +1,17 @@ +using CalamityMod.NPCs.Crabulon; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + public class CrabulonMusicScene : BaseMusicSceneEffect + { + public override SceneEffectPriority Priority => SceneEffectPriority.BossMedium; + + public override int NPCType => ModContent.NPCType(); + public override int? MusicModMusic => CalamityMod.Instance.GetMusicFromMusicMod("Crabulon"); + public override int VanillaMusic => MusicID.Boss4; + public override int OtherworldMusic => MusicID.OtherworldlyBoss1; + } +} diff --git a/Scenes/MusicScenes/CryogenMusicScene.cs b/Scenes/MusicScenes/CryogenMusicScene.cs new file mode 100644 index 0000000000..6aa01cd208 --- /dev/null +++ b/Scenes/MusicScenes/CryogenMusicScene.cs @@ -0,0 +1,17 @@ +using CalamityMod.NPCs.Cryogen; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + public class CryogenMusicScene : BaseMusicSceneEffect + { + public override SceneEffectPriority Priority => SceneEffectPriority.BossMedium; + + public override int NPCType => ModContent.NPCType(); + public override int? MusicModMusic => CalamityMod.Instance.GetMusicFromMusicMod("Cryogen"); + public override int VanillaMusic => MusicID.FrostMoon; + public override int OtherworldMusic => MusicID.OtherworldlyIce; + } +} diff --git a/Scenes/MusicScenes/DesertScourgeMusicScene.cs b/Scenes/MusicScenes/DesertScourgeMusicScene.cs new file mode 100644 index 0000000000..58f95ff854 --- /dev/null +++ b/Scenes/MusicScenes/DesertScourgeMusicScene.cs @@ -0,0 +1,22 @@ +using CalamityMod.NPCs.DesertScourge; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + public class DesertScourgeMusicScene : BaseMusicSceneEffect + { + public override SceneEffectPriority Priority => SceneEffectPriority.BossMedium; + + public override int NPCType => ModContent.NPCType(); + public override int? MusicModMusic => CalamityMod.Instance.GetMusicFromMusicMod("DesertScourge"); + public override int VanillaMusic => MusicID.Boss1; + public override int OtherworldMusic => MusicID.OtherworldlyBoss1; + public override int[] AdditionalNPCs => new int[] + { + ModContent.NPCType(), + ModContent.NPCType() + }; + } +} diff --git a/Scenes/MusicScenes/DevourerofGodsMusicScene.cs b/Scenes/MusicScenes/DevourerofGodsMusicScene.cs new file mode 100644 index 0000000000..42acfa2c2c --- /dev/null +++ b/Scenes/MusicScenes/DevourerofGodsMusicScene.cs @@ -0,0 +1,25 @@ +using CalamityMod.NPCs; +using CalamityMod.NPCs.DevourerofGods; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + public class DevourerofGodsMusicScene : BaseMusicSceneEffect + { + public override SceneEffectPriority Priority => SceneEffectPriority.BossHigh; + + public override int NPCType => ModContent.NPCType(); + public override int? MusicModMusic => CalamityMod.Instance.GetMusicFromMusicMod("DevourerOfGodsP1"); + public override int VanillaMusic => MusicID.Boss3; + public override int OtherworldMusic => MusicID.OtherworldlyBoss2; + public override int[] AdditionalNPCs => new int[] + { + ModContent.NPCType(), + ModContent.NPCType() + }; + + public override bool AdditionalCheck() => CalamityGlobalNPC.DoGHead != -1 && CalamityGlobalNPC.DoGP2 == -1; + } +} diff --git a/Scenes/MusicScenes/DevourerofGodsPhase2MusicScene.cs b/Scenes/MusicScenes/DevourerofGodsPhase2MusicScene.cs new file mode 100644 index 0000000000..3ef0ad5663 --- /dev/null +++ b/Scenes/MusicScenes/DevourerofGodsPhase2MusicScene.cs @@ -0,0 +1,25 @@ +using CalamityMod.NPCs; +using CalamityMod.NPCs.DevourerofGods; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + public class DevourerofGodsPhase2MusicScene : BaseMusicSceneEffect + { + public override SceneEffectPriority Priority => SceneEffectPriority.BossHigh; + + public override int NPCType => ModContent.NPCType(); + public override int? MusicModMusic => CalamityMod.Instance.GetMusicFromMusicMod("DevourerOfGodsP2"); + public override int VanillaMusic => MusicID.LunarBoss; + public override int OtherworldMusic => MusicID.OtherworldlyLunarBoss; + public override int[] AdditionalNPCs => new int[] + { + ModContent.NPCType(), + ModContent.NPCType() + }; + + public override bool AdditionalCheck() => CalamityGlobalNPC.DoGP2 != -1; + } +} diff --git a/Scenes/MusicScenes/DraedonMusicScene.cs b/Scenes/MusicScenes/DraedonMusicScene.cs new file mode 100644 index 0000000000..5f1571e221 --- /dev/null +++ b/Scenes/MusicScenes/DraedonMusicScene.cs @@ -0,0 +1,20 @@ +using CalamityMod.NPCs; +using CalamityMod.NPCs.ExoMechs; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + public class DraedonMusicScene : BaseMusicSceneEffect + { + public override SceneEffectPriority Priority => SceneEffectPriority.BossMedium; + + public override int NPCType => ModContent.NPCType(); + public override int? MusicModMusic => MusicLoader.GetMusicSlot(Mod, "Sounds/Music/DraedonAmbience"); + public override int VanillaMusic => -1; + public override int OtherworldMusic => -1; + + public override bool AdditionalCheck() => CalamityGlobalNPC.draedonAmbience != -1; + } +} diff --git a/Scenes/MusicScenes/DragonfollyMusicScene.cs b/Scenes/MusicScenes/DragonfollyMusicScene.cs new file mode 100644 index 0000000000..e18a49bc8f --- /dev/null +++ b/Scenes/MusicScenes/DragonfollyMusicScene.cs @@ -0,0 +1,17 @@ +using CalamityMod.NPCs.Bumblebirb; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + public class DragonfollyMusicScene : BaseMusicSceneEffect + { + public override SceneEffectPriority Priority => SceneEffectPriority.BossMedium; + + public override int NPCType => ModContent.NPCType(); + public override int? MusicModMusic => CalamityMod.Instance.GetMusicFromMusicMod("Dragonfolly"); + public override int VanillaMusic => MusicID.Boss4; + public override int OtherworldMusic => MusicID.OtherworldlyBoss2; + } +} diff --git a/Scenes/MusicScenes/ExoMechsMusicScene.cs b/Scenes/MusicScenes/ExoMechsMusicScene.cs new file mode 100644 index 0000000000..97a9e11e4b --- /dev/null +++ b/Scenes/MusicScenes/ExoMechsMusicScene.cs @@ -0,0 +1,34 @@ +using CalamityMod.NPCs; +using CalamityMod.NPCs.ExoMechs; +using CalamityMod.NPCs.ExoMechs.Apollo; +using CalamityMod.NPCs.ExoMechs.Ares; +using CalamityMod.NPCs.ExoMechs.Artemis; +using CalamityMod.NPCs.ExoMechs.Thanatos; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + public class ExoMechsMusicScene : BaseMusicSceneEffect + { + public override SceneEffectPriority Priority => SceneEffectPriority.BossHigh; + + public override int NPCType => ModContent.NPCType(); + public override int? MusicModMusic => CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs"); + public override int VanillaMusic => MusicID.Boss3; + public override int OtherworldMusic => MusicID.OtherworldlyBoss2; + public override int[] AdditionalNPCs => new int[] + { + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType() + }; + + public override bool AdditionalCheck() => CalamityGlobalNPC.draedonAmbience == -1; + } +} diff --git a/Scenes/MusicScenes/HiveMindMusicScene.cs b/Scenes/MusicScenes/HiveMindMusicScene.cs new file mode 100644 index 0000000000..00662ace7c --- /dev/null +++ b/Scenes/MusicScenes/HiveMindMusicScene.cs @@ -0,0 +1,17 @@ +using CalamityMod.NPCs.HiveMind; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + public class HiveMindMusicScene : BaseMusicSceneEffect + { + public override SceneEffectPriority Priority => SceneEffectPriority.BossMedium; + + public override int NPCType => ModContent.NPCType(); + public override int? MusicModMusic => CalamityMod.Instance.GetMusicFromMusicMod("HiveMind"); + public override int VanillaMusic => MusicID.Boss2; + public override int OtherworldMusic => MusicID.OtherworldlyWoF; + } +} diff --git a/Scenes/MusicScenes/LeviathanMusicScene.cs b/Scenes/MusicScenes/LeviathanMusicScene.cs new file mode 100644 index 0000000000..5875d37c7c --- /dev/null +++ b/Scenes/MusicScenes/LeviathanMusicScene.cs @@ -0,0 +1,17 @@ +using CalamityMod.NPCs.Leviathan; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + public class LeviathanMusicScene : BaseMusicSceneEffect + { + public override SceneEffectPriority Priority => SceneEffectPriority.BossMedium; + + public override int NPCType => ModContent.NPCType(); + public override int? MusicModMusic => CalamityMod.Instance.GetMusicFromMusicMod("LeviathanAndAnahita"); + public override int VanillaMusic => MusicID.Boss3; + public override int OtherworldMusic => MusicID.OtherworldlyBoss2; + } +} diff --git a/Scenes/MusicScenes/LeviathanStartMusicScene.cs b/Scenes/MusicScenes/LeviathanStartMusicScene.cs new file mode 100644 index 0000000000..6e970b27a0 --- /dev/null +++ b/Scenes/MusicScenes/LeviathanStartMusicScene.cs @@ -0,0 +1,18 @@ +using CalamityMod.NPCs.Leviathan; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + public class LeviathanStartMusicScene : BaseMusicSceneEffect + { + public override SceneEffectPriority Priority => SceneEffectPriority.BossLow; + + public override int NPCType => ModContent.NPCType(); + public override int? MusicModMusic => CalamityMod.Instance.GetMusicFromMusicMod("AnahitaPreboss"); + public override int VanillaMusic => -1; + public override int OtherworldMusic => -1; + public override int MusicDistance => 1600; + } +} diff --git a/Scenes/MusicScenes/OldDukeMusicScene.cs b/Scenes/MusicScenes/OldDukeMusicScene.cs new file mode 100644 index 0000000000..af357c9af3 --- /dev/null +++ b/Scenes/MusicScenes/OldDukeMusicScene.cs @@ -0,0 +1,17 @@ +using CalamityMod.NPCs.OldDuke; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + public class OldDukeMusicScene : BaseMusicSceneEffect + { + public override SceneEffectPriority Priority => SceneEffectPriority.BossHigh; + + public override int NPCType => ModContent.NPCType(); + public override int? MusicModMusic => CalamityMod.Instance.GetMusicFromMusicMod("BoomerDuke"); + public override int VanillaMusic => MusicID.DukeFishron; + public override int OtherworldMusic => MusicID.OtherworldlyBoss2; + } +} diff --git a/Scenes/MusicScenes/PerforatorMusicScene.cs b/Scenes/MusicScenes/PerforatorMusicScene.cs new file mode 100644 index 0000000000..cb33b7d2f6 --- /dev/null +++ b/Scenes/MusicScenes/PerforatorMusicScene.cs @@ -0,0 +1,17 @@ +using CalamityMod.NPCs.Perforator; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + public class PerforatorMusicScene : BaseMusicSceneEffect + { + public override SceneEffectPriority Priority => SceneEffectPriority.BossMedium; + + public override int NPCType => ModContent.NPCType(); + public override int? MusicModMusic => CalamityMod.Instance.GetMusicFromMusicMod("Perforators"); + public override int VanillaMusic => MusicID.Boss2; + public override int OtherworldMusic => MusicID.OtherworldlyWoF; + } +} diff --git a/Scenes/MusicScenes/PlaguebringerGoliathMusicScene.cs b/Scenes/MusicScenes/PlaguebringerGoliathMusicScene.cs new file mode 100644 index 0000000000..3058ce51e9 --- /dev/null +++ b/Scenes/MusicScenes/PlaguebringerGoliathMusicScene.cs @@ -0,0 +1,17 @@ +using CalamityMod.NPCs.PlaguebringerGoliath; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + public class PlaguebringerGoliathMusicScene : BaseMusicSceneEffect + { + public override SceneEffectPriority Priority => SceneEffectPriority.BossMedium; + + public override int NPCType => ModContent.NPCType(); + public override int? MusicModMusic => CalamityMod.Instance.GetMusicFromMusicMod("PlaguebringerGoliath"); + public override int VanillaMusic => MusicID.Boss3; + public override int OtherworldMusic => MusicID.OtherworldlyPlantera; + } +} diff --git a/Scenes/MusicScenes/PolterghastMusicScene.cs b/Scenes/MusicScenes/PolterghastMusicScene.cs new file mode 100644 index 0000000000..6c2ff15eba --- /dev/null +++ b/Scenes/MusicScenes/PolterghastMusicScene.cs @@ -0,0 +1,17 @@ +using CalamityMod.NPCs.Polterghast; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + public class PolterghastMusicScene : BaseMusicSceneEffect + { + public override SceneEffectPriority Priority => SceneEffectPriority.BossHigh; + + public override int NPCType => ModContent.NPCType(); + public override int? MusicModMusic => CalamityMod.Instance.GetMusicFromMusicMod("Polterghast"); + public override int VanillaMusic => MusicID.Plantera; + public override int OtherworldMusic => MusicID.OtherworldlyPlantera; + } +} diff --git a/Scenes/MusicScenes/ProfanedGuardiansMusicScene.cs b/Scenes/MusicScenes/ProfanedGuardiansMusicScene.cs new file mode 100644 index 0000000000..23b69ad91b --- /dev/null +++ b/Scenes/MusicScenes/ProfanedGuardiansMusicScene.cs @@ -0,0 +1,17 @@ +using CalamityMod.NPCs.ProfanedGuardians; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + public class ProfanedGuardiansMusicScene : BaseMusicSceneEffect + { + public override SceneEffectPriority Priority => SceneEffectPriority.BossMedium; + + public override int NPCType => ModContent.NPCType(); + public override int? MusicModMusic => CalamityMod.Instance.GetMusicFromMusicMod("Guardians"); + public override int VanillaMusic => MusicID.Boss1; + public override int OtherworldMusic => MusicID.OtherworldlyBoss1; + } +} diff --git a/Scenes/MusicScenes/ProvidenceMusicScene.cs b/Scenes/MusicScenes/ProvidenceMusicScene.cs new file mode 100644 index 0000000000..3b94309145 --- /dev/null +++ b/Scenes/MusicScenes/ProvidenceMusicScene.cs @@ -0,0 +1,17 @@ +using CalamityMod.NPCs.Providence; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + public class ProvidenceMusicScene : BaseMusicSceneEffect + { + public override SceneEffectPriority Priority => SceneEffectPriority.BossHigh; + + public override int NPCType => ModContent.NPCType(); + public override int? MusicModMusic => CalamityMod.Instance.GetMusicFromMusicMod("Providence"); + public override int VanillaMusic => MusicID.LunarBoss; + public override int OtherworldMusic => MusicID.OtherworldlyLunarBoss; + } +} diff --git a/Scenes/MusicScenes/RavagerMusicScene.cs b/Scenes/MusicScenes/RavagerMusicScene.cs new file mode 100644 index 0000000000..8e46296ab4 --- /dev/null +++ b/Scenes/MusicScenes/RavagerMusicScene.cs @@ -0,0 +1,17 @@ +using CalamityMod.NPCs.Ravager; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + public class RavagerMusicScene : BaseMusicSceneEffect + { + public override SceneEffectPriority Priority => SceneEffectPriority.BossMedium; + + public override int NPCType => ModContent.NPCType(); + public override int? MusicModMusic => CalamityMod.Instance.GetMusicFromMusicMod("Ravager"); + public override int VanillaMusic => MusicID.Boss4; + public override int OtherworldMusic => MusicID.OtherworldlyBoss2; + } +} diff --git a/Scenes/MusicScenes/SCalAcceptanceMusicScene.cs b/Scenes/MusicScenes/SCalAcceptanceMusicScene.cs new file mode 100644 index 0000000000..1770301199 --- /dev/null +++ b/Scenes/MusicScenes/SCalAcceptanceMusicScene.cs @@ -0,0 +1,20 @@ +using CalamityMod.NPCs; +using CalamityMod.NPCs.SupremeCalamitas; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + public class SCalAcceptanceMusicScene : BaseMusicSceneEffect + { + public override SceneEffectPriority Priority => SceneEffectPriority.BossHigh; + + public override int NPCType => ModContent.NPCType(); + public override int? MusicModMusic => CalamityMod.Instance.GetMusicFromMusicMod("SupremeCalamitas4"); + public override int VanillaMusic => MusicID.Eerie; + public override int OtherworldMusic => MusicID.OtherworldlyEerie; + + public override bool AdditionalCheck() => CalamityGlobalNPC.SCalAcceptance != -1; + } +} diff --git a/Scenes/MusicScenes/SCalEpiphanyMusicScene.cs b/Scenes/MusicScenes/SCalEpiphanyMusicScene.cs new file mode 100644 index 0000000000..284e05f40e --- /dev/null +++ b/Scenes/MusicScenes/SCalEpiphanyMusicScene.cs @@ -0,0 +1,20 @@ +using CalamityMod.NPCs; +using CalamityMod.NPCs.SupremeCalamitas; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + public class SCalEpiphanyMusicScene : BaseMusicSceneEffect + { + public override SceneEffectPriority Priority => SceneEffectPriority.BossHigh; + + public override int NPCType => ModContent.NPCType(); + public override int? MusicModMusic => CalamityMod.Instance.GetMusicFromMusicMod("SupremeCalamitas3"); + public override int VanillaMusic => MusicID.LunarBoss; + public override int OtherworldMusic => MusicID.OtherworldlyLunarBoss; + + public override bool AdditionalCheck() => CalamityGlobalNPC.SCalEpiphany != -1; + } +} diff --git a/Scenes/MusicScenes/SCalGriefMusicScene.cs b/Scenes/MusicScenes/SCalGriefMusicScene.cs new file mode 100644 index 0000000000..4dacaecf57 --- /dev/null +++ b/Scenes/MusicScenes/SCalGriefMusicScene.cs @@ -0,0 +1,20 @@ +using CalamityMod.NPCs; +using CalamityMod.NPCs.SupremeCalamitas; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + public class SCalGriefMusicScene : BaseMusicSceneEffect + { + public override SceneEffectPriority Priority => SceneEffectPriority.BossHigh; + + public override int NPCType => ModContent.NPCType(); + public override int? MusicModMusic => CalamityMod.Instance.GetMusicFromMusicMod("SupremeCalamitas1"); + public override int VanillaMusic => MusicID.Boss2; + public override int OtherworldMusic => MusicID.OtherworldlyBoss2; + + public override bool AdditionalCheck() => CalamityGlobalNPC.SCalGrief != -1; + } +} diff --git a/Scenes/MusicScenes/SCalLamentMusicScene.cs b/Scenes/MusicScenes/SCalLamentMusicScene.cs new file mode 100644 index 0000000000..17c749010a --- /dev/null +++ b/Scenes/MusicScenes/SCalLamentMusicScene.cs @@ -0,0 +1,20 @@ +using CalamityMod.NPCs; +using CalamityMod.NPCs.SupremeCalamitas; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + public class SCalLamentMusicScene : BaseMusicSceneEffect + { + public override SceneEffectPriority Priority => SceneEffectPriority.BossHigh; + + public override int NPCType => ModContent.NPCType(); + public override int? MusicModMusic => CalamityMod.Instance.GetMusicFromMusicMod("SupremeCalamitas2"); + public override int VanillaMusic => MusicID.Boss3; + public override int OtherworldMusic => MusicID.OtherworldlyWoF; + + public override bool AdditionalCheck() => CalamityGlobalNPC.SCalLament != -1; + } +} diff --git a/Scenes/MusicScenes/SignusMusicScene.cs b/Scenes/MusicScenes/SignusMusicScene.cs new file mode 100644 index 0000000000..8fef7b42f7 --- /dev/null +++ b/Scenes/MusicScenes/SignusMusicScene.cs @@ -0,0 +1,17 @@ +using CalamityMod.NPCs.Signus; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + public class SignusMusicScene : BaseMusicSceneEffect + { + public override SceneEffectPriority Priority => SceneEffectPriority.BossMedium; + + public override int NPCType => ModContent.NPCType(); + public override int? MusicModMusic => CalamityMod.Instance.GetMusicFromMusicMod("Signus"); + public override int VanillaMusic => MusicID.Boss4; + public override int OtherworldMusic => MusicID.OtherworldlyBoss2; + } +} diff --git a/Scenes/MusicScenes/SlimeGodMusicScene.cs b/Scenes/MusicScenes/SlimeGodMusicScene.cs new file mode 100644 index 0000000000..11aeb12d14 --- /dev/null +++ b/Scenes/MusicScenes/SlimeGodMusicScene.cs @@ -0,0 +1,17 @@ +using CalamityMod.NPCs.SlimeGod; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + public class SlimeGodMusicScene : BaseMusicSceneEffect + { + public override SceneEffectPriority Priority => SceneEffectPriority.BossMedium; + + public override int NPCType => ModContent.NPCType(); + public override int? MusicModMusic => CalamityMod.Instance.GetMusicFromMusicMod("SlimeGod"); + public override int VanillaMusic => MusicID.Boss1; + public override int OtherworldMusic => MusicID.OtherworldlyBoss1; + } +} diff --git a/Scenes/MusicScenes/StormWeaverMusicScene.cs b/Scenes/MusicScenes/StormWeaverMusicScene.cs new file mode 100644 index 0000000000..65ebb299b1 --- /dev/null +++ b/Scenes/MusicScenes/StormWeaverMusicScene.cs @@ -0,0 +1,22 @@ +using CalamityMod.NPCs.StormWeaver; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + public class StormWeaverMusicScene : BaseMusicSceneEffect + { + public override SceneEffectPriority Priority => SceneEffectPriority.BossMedium; + + public override int NPCType => ModContent.NPCType(); + public override int? MusicModMusic => CalamityMod.Instance.GetMusicFromMusicMod("Weaver"); + public override int VanillaMusic => MusicID.Boss3; + public override int OtherworldMusic => MusicID.OtherworldlyBoss2; + public override int[] AdditionalNPCs => new int[] + { + ModContent.NPCType(), + ModContent.NPCType() + }; + } +} diff --git a/Scenes/MusicScenes/YharonPhase1MusicScene.cs b/Scenes/MusicScenes/YharonPhase1MusicScene.cs new file mode 100644 index 0000000000..7cee1b0a40 --- /dev/null +++ b/Scenes/MusicScenes/YharonPhase1MusicScene.cs @@ -0,0 +1,20 @@ +using CalamityMod.NPCs; +using CalamityMod.NPCs.Yharon; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + public class YharonPhase1MusicScene : BaseMusicSceneEffect + { + public override SceneEffectPriority Priority => SceneEffectPriority.BossHigh; + + public override int NPCType => ModContent.NPCType(); + public override int? MusicModMusic => CalamityMod.Instance.GetMusicFromMusicMod("YharonP1"); + public override int VanillaMusic => MusicID.Boss3; + public override int OtherworldMusic => MusicID.OtherworldlyBoss2; + + public override bool AdditionalCheck() => CalamityGlobalNPC.yharon != -1 && CalamityGlobalNPC.yharonP2 == -1; + } +} diff --git a/Scenes/MusicScenes/YharonPhase2MusicScene.cs b/Scenes/MusicScenes/YharonPhase2MusicScene.cs new file mode 100644 index 0000000000..7379c7d9cf --- /dev/null +++ b/Scenes/MusicScenes/YharonPhase2MusicScene.cs @@ -0,0 +1,20 @@ +using CalamityMod.NPCs; +using CalamityMod.NPCs.Yharon; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Systems +{ + public class YharonPhase2MusicScene : BaseMusicSceneEffect + { + public override SceneEffectPriority Priority => SceneEffectPriority.BossHigh; + + public override int NPCType => ModContent.NPCType(); + public override int? MusicModMusic => CalamityMod.Instance.GetMusicFromMusicMod("YharonP2"); + public override int VanillaMusic => MusicID.LunarBoss; + public override int OtherworldMusic => MusicID.OtherworldlyLunarBoss; + + public override bool AdditionalCheck() => CalamityGlobalNPC.yharonP2 != -1; + } +} diff --git a/Scenes/SulphurousSeaScene.cs b/Scenes/SulphurousSeaScene.cs deleted file mode 100644 index c8e26256c8..0000000000 --- a/Scenes/SulphurousSeaScene.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Systems -{ - public class SulphurousSeaScene : ModSceneEffect - { - public override bool IsSceneEffectActive(Player player) => player.Calamity().ZoneSulphur; - - public override string MapBackground => "CalamityMod/Backgrounds/MapBackgrounds/SulphurBG"; - } -} diff --git a/Skies/MonolithScreenShaderData.cs b/Skies/MonolithScreenShaderData.cs new file mode 100644 index 0000000000..51f3666345 --- /dev/null +++ b/Skies/MonolithScreenShaderData.cs @@ -0,0 +1,31 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.Graphics.Effects; +using Terraria.Graphics.Shaders; + +namespace CalamityMod.Skies +{ + public class MonolithScreenShaderData : ScreenShaderData + { + public MonolithScreenShaderData(string passName) + : base(passName) + { + } + + public override void Apply() + { + Vector3 vec = Main.ColorOfTheSkies.ToVector3(); + vec *= 0.4f; + base.UseOpacity(Math.Max(vec.X, Math.Max(vec.Y, vec.Z))); + base.Apply(); + } + + public override void Update(GameTime gameTime) + { + if (Main.LocalPlayer.Calamity().monolithAccursedShader < 1) + Filters.Scene["CalamityMod:MonolithAccursed"].Deactivate(Array.Empty()); + } + } +} diff --git a/Skies/MonolithSky.cs b/Skies/MonolithSky.cs new file mode 100644 index 0000000000..17c3cf6d43 --- /dev/null +++ b/Skies/MonolithSky.cs @@ -0,0 +1,135 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using System.Collections.Generic; +using Terraria; +using Terraria.GameContent; +using Terraria.Graphics.Effects; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Skies +{ + public class MonolithSky : CustomSky + { + public class Cinder + { + public int Time; + public int Lifetime; + public int IdentityIndex; + public float Scale; + public float Depth; + public Color DrawColor; + public Vector2 Velocity; + public Vector2 Center; + public Cinder(int lifetime, int identity, float depth, Color color, Vector2 startingPosition, Vector2 startingVelocity) + { + Lifetime = lifetime; + IdentityIndex = identity; + Depth = depth; + DrawColor = color; + Center = startingPosition; + Velocity = startingVelocity; + } + } + + private bool skyActive; + private float opacity; + public List Cinders = new List(); + + public override void Deactivate(params object[] args) => skyActive = false; + + public override void Reset() => skyActive = false; + + public override bool IsActive() => skyActive || opacity > 0f; + + public override void Activate(Vector2 position, params object[] args) => skyActive = true; + + public override void Update(GameTime gameTime) + { + if (Main.LocalPlayer.Calamity().monolithAccursedShader < 1) + skyActive = false; + + if (skyActive && opacity < 1f) + { + opacity += 0.02f; + } + else if (!skyActive && opacity > 0f) + { + opacity -= 0.02f; + } + + static Color selectCinderColor() + { + if (Main.rand.NextBool(3)) + return Color.Lerp(Color.DarkGray, Color.LightGray, Main.rand.NextFloat()); + + return Color.Lerp(Color.Red, Color.Yellow, Main.rand.NextFloat(0.9f)); + } + + // Randomly add cinders. + if (Main.rand.NextBool(12) && skyActive) + { + int lifetime = Main.rand.Next(285, 445); + float depth = Main.rand.NextFloat(1.8f, 5f); + Vector2 startingPosition = Main.screenPosition + new Vector2(Main.screenWidth * Main.rand.NextFloat(-0.1f, 1.1f), Main.screenHeight * 1.05f); + Vector2 startingVelocity = -Vector2.UnitY.RotatedByRandom(0.91f); + Cinders.Add(new Cinder(lifetime, Cinders.Count, depth, selectCinderColor(), startingPosition, startingVelocity)); + } + + // Update all cinders. + if (skyActive) + { + float cinderSpeed = 5.6f; + for (int i = 0; i < Cinders.Count; i++) + { + Cinders[i].Scale = Utils.GetLerpValue(Cinders[i].Lifetime, Cinders[i].Lifetime / 3, Cinders[i].Time, true); + Cinders[i].Scale *= MathHelper.Lerp(0.6f, 0.9f, Cinders[i].IdentityIndex % 6f / 6f); + + Vector2 idealVelocity = -Vector2.UnitY.RotatedBy(MathHelper.Lerp(-0.94f, 0.94f, (float)Math.Sin(Cinders[i].Time / 36f + Cinders[i].IdentityIndex) * 0.5f + 0.5f)) * cinderSpeed; + float movementInterpolant = MathHelper.Lerp(0.01f, 0.08f, Utils.GetLerpValue(45f, 145f, Cinders[i].Time, true)); + Cinders[i].Velocity = Vector2.Lerp(Cinders[i].Velocity, idealVelocity, movementInterpolant); + Cinders[i].Velocity = Cinders[i].Velocity.SafeNormalize(-Vector2.UnitY) * cinderSpeed; + Cinders[i].Time++; + + Cinders[i].Center += Cinders[i].Velocity; + } + } + + // Clear away all dead cinders. + Cinders.RemoveAll(c => c.Time >= c.Lifetime); + } + + public override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDepth) + { + if (Main.LocalPlayer.Calamity().monolithAccursedShader < 1) + return; + + if (maxDepth >= float.MaxValue && minDepth < float.MaxValue && Main.LocalPlayer.Calamity().monolithAccursedShader > 21) + { + Texture2D texture = ModContent.Request("CalamityMod/MainMenu/MenuBackground").Value; + int offset = Main.BackgroundEnabled ? 200 : 0; + spriteBatch.Draw(texture, new Rectangle(0, Math.Max(0, (int)((Main.worldSurface * 16 - Main.screenPosition.Y - texture.Height * 2) * 0.1f)) - offset, Main.screenWidth, Main.screenHeight), Color.White * Math.Min(1f, (Main.screenPosition.Y - 800f) / 1000f * opacity)); + } + + // Draw cinders. + Texture2D cinderTexture = ModContent.Request("CalamityMod/ExtraTextures/CalamitasCinder").Value; + for (int i = 0; i < Cinders.Count; i++) + { + Vector2 drawPosition = Cinders[i].Center - Main.screenPosition; + for (int j = 0; j < 3; j++) + { + Vector2 offsetDrawPosition = drawPosition + (MathHelper.TwoPi * j / 3f).ToRotationVector2() * 1.4f; + Color offsetDrawColor = Color.Red * 0.56f; + offsetDrawColor.A = 0; + spriteBatch.Draw(cinderTexture, offsetDrawPosition, null, offsetDrawColor, 0f, cinderTexture.Size() * 0.5f, Cinders[i].Scale * 1.5f, SpriteEffects.None, 0f); + } + spriteBatch.Draw(cinderTexture, drawPosition, null, Cinders[i].DrawColor, 0f, cinderTexture.Size() * 0.5f, Cinders[i].Scale, SpriteEffects.None, 0f); + } + } + + public override Color OnTileColor(Color color) => Color.Lerp(color, new Color(205, 100, 100), opacity); + + public override float GetCloudAlpha() => (1f - opacity) * 0.3f + 0.7f; + } +} diff --git a/Sounds/Custom/IjiDies.ogg b/Sounds/Custom/IjiDies.ogg new file mode 100644 index 0000000000..c8af0e0dae Binary files /dev/null and b/Sounds/Custom/IjiDies.ogg differ diff --git a/Sounds/Item/AnomalysNanogunMPFBExplosion.ogg b/Sounds/Item/AnomalysNanogunMPFBExplosion.ogg new file mode 100644 index 0000000000..b3a4460831 Binary files /dev/null and b/Sounds/Item/AnomalysNanogunMPFBExplosion.ogg differ diff --git a/Sounds/Item/AnomalysNanogunMPFBShot.ogg b/Sounds/Item/AnomalysNanogunMPFBShot.ogg new file mode 100644 index 0000000000..aa20115ba8 Binary files /dev/null and b/Sounds/Item/AnomalysNanogunMPFBShot.ogg differ diff --git a/Sounds/Item/AnomalysNanogunPlasmaCharge.ogg b/Sounds/Item/AnomalysNanogunPlasmaCharge.ogg new file mode 100644 index 0000000000..b0a24bc813 Binary files /dev/null and b/Sounds/Item/AnomalysNanogunPlasmaCharge.ogg differ diff --git a/Sounds/Item/AnomalysNanogunPlasmaShot.ogg b/Sounds/Item/AnomalysNanogunPlasmaShot.ogg new file mode 100644 index 0000000000..a9324c6546 Binary files /dev/null and b/Sounds/Item/AnomalysNanogunPlasmaShot.ogg differ diff --git a/Sounds/Music/DraedonAmbience.ogg b/Sounds/Music/DraedonAmbience.ogg index 8f4ee71426..7269bd6383 100644 Binary files a/Sounds/Music/DraedonAmbience.ogg and b/Sounds/Music/DraedonAmbience.ogg differ diff --git a/Systems/WorldMiscUpdateSystem.cs b/Systems/WorldMiscUpdateSystem.cs index ceb188a0b2..c8a983e6e4 100644 --- a/Systems/WorldMiscUpdateSystem.cs +++ b/Systems/WorldMiscUpdateSystem.cs @@ -405,10 +405,14 @@ namespace CalamityMod.Systems #region Handle Dungeon Guardian Spawns public static void TrySpawnDungeonGuardian(Player player) { - if (Main.netMode == NetmodeID.MultiplayerClient || !player.ZoneDungeon || NPC.downedBoss3 || player.dead) + if (Main.netMode == NetmodeID.MultiplayerClient || !player.ZoneDungeon || player.dead) return; - if (!NPC.AnyNPCs(NPCID.DungeonGuardian)) + bool spawn = !NPC.downedBoss3; + if (Main.drunkWorld && player.position.Y / 16f < (float)(Main.dungeonY + 40)) + spawn = false; + + if (!NPC.AnyNPCs(NPCID.DungeonGuardian) && spawn) NPC.SpawnOnPlayer(player.whoAmI, NPCID.DungeonGuardian); //your hell is as vast as my bonergrin, pray your life ends quickly } #endregion diff --git a/Tiles/Abyss/AcidWoodTreeSapling.cs b/Tiles/Abyss/AcidWoodTreeSapling.cs index 5c0ee57062..f663acb9af 100644 --- a/Tiles/Abyss/AcidWoodTreeSapling.cs +++ b/Tiles/Abyss/AcidWoodTreeSapling.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Tiles.Abyss TileObjectData.newTile.RandomStyleRange = 3; TileObjectData.addTile(Type); ModTranslation name = CreateMapEntryName(); - name.SetDefault("Sapling"); + name.SetDefault("MapObject.Sapling"); AddMapEntry(new Color(113, 90, 71), name); DustType = (int)CalamityDusts.SulfurousSeaAcid; AdjTiles = new int[] { TileID.Saplings }; diff --git a/Tiles/Abyss/SulphurousSand.cs b/Tiles/Abyss/SulphurousSand.cs index 9624c119af..72836b8cfa 100644 --- a/Tiles/Abyss/SulphurousSand.cs +++ b/Tiles/Abyss/SulphurousSand.cs @@ -19,6 +19,8 @@ namespace CalamityMod.Tiles.Abyss CalamityUtils.MergeWithGeneral(Type); CalamityUtils.MergeWithAbyss(Type); + TileID.Sets.CanBeDugByShovel[Type] = true; + DustType = 32; ItemDrop = ModContent.ItemType(); AddMapEntry(new Color(150, 100, 50)); diff --git a/Tiles/Abyss/SulphurousSandNoWater.cs b/Tiles/Abyss/SulphurousSandNoWater.cs index f267ac4af9..76edcb0598 100644 --- a/Tiles/Abyss/SulphurousSandNoWater.cs +++ b/Tiles/Abyss/SulphurousSandNoWater.cs @@ -15,6 +15,8 @@ namespace CalamityMod.Tiles.Abyss CalamityUtils.MergeWithGeneral(Type); CalamityUtils.MergeWithAbyss(Type); + TileID.Sets.CanBeDugByShovel[Type] = true; + DustType = 32; ItemDrop = ModContent.ItemType(); AddMapEntry(new Color(150, 100, 50)); diff --git a/Tiles/Astral/AstralClay.cs b/Tiles/Astral/AstralClay.cs index 2d0523f6e3..92e8eb708f 100644 --- a/Tiles/Astral/AstralClay.cs +++ b/Tiles/Astral/AstralClay.cs @@ -25,6 +25,7 @@ namespace CalamityMod.Tiles.Astral TileID.Sets.ChecksForMerge[Type] = true; TileID.Sets.CanBeClearedDuringOreRunner[Type] = true; + TileID.Sets.CanBeDugByShovel[Type] = true; } public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) diff --git a/Tiles/Astral/AstralGrass.cs b/Tiles/Astral/AstralGrass.cs index 66e93720fd..8fd26c3032 100644 --- a/Tiles/Astral/AstralGrass.cs +++ b/Tiles/Astral/AstralGrass.cs @@ -33,6 +33,7 @@ namespace CalamityMod.Tiles.Astral //Grass framing (<3 terraria devs) TileID.Sets.NeedsGrassFraming[Type] = true; TileID.Sets.NeedsGrassFramingDirt[Type] = ModContent.TileType(); + TileID.Sets.CanBeDugByShovel[Type] = true; } public override void NumDust(int i, int j, bool fail, ref int Type) diff --git a/Tiles/Astral/AstralTreeSapling.cs b/Tiles/Astral/AstralTreeSapling.cs index f6ad962339..a8c4ab9ed3 100644 --- a/Tiles/Astral/AstralTreeSapling.cs +++ b/Tiles/Astral/AstralTreeSapling.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Tiles.Astral TileObjectData.newTile.RandomStyleRange = 3; TileObjectData.addTile(Type); ModTranslation name = CreateMapEntryName(); - name.SetDefault("Sapling"); + name.SetDefault("MapObject.Sapling"); AddMapEntry(new Color(200, 200, 200), name); DustType = ModContent.DustType(); AdjTiles = new int[] { TileID.Saplings }; diff --git a/Tiles/Astral/NovaeSlag.cs b/Tiles/Astral/NovaeSlag.cs index 8f0fba779a..f2cad769e7 100644 --- a/Tiles/Astral/NovaeSlag.cs +++ b/Tiles/Astral/NovaeSlag.cs @@ -27,6 +27,7 @@ namespace CalamityMod.Tiles.Astral TileID.Sets.ChecksForMerge[Type] = true; TileID.Sets.CanBeClearedDuringOreRunner[Type] = true; + TileID.Sets.CanBeDugByShovel[Type] = true; } public override bool CreateDust(int i, int j, ref int type) diff --git a/Tiles/AstralDesert/AstralPalmSapling.cs b/Tiles/AstralDesert/AstralPalmSapling.cs index a83a1fe80c..7a0f2f685f 100644 --- a/Tiles/AstralDesert/AstralPalmSapling.cs +++ b/Tiles/AstralDesert/AstralPalmSapling.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Tiles.AstralDesert TileObjectData.newTile.RandomStyleRange = 3; TileObjectData.addTile(Type); ModTranslation name = CreateMapEntryName(); - name.SetDefault("Sapling"); + name.SetDefault("MapObject.Sapling"); AddMapEntry(new Color(200, 200, 200), name); DustType = ModContent.DustType(); AdjTiles = new int[] { TileID.Saplings }; diff --git a/Tiles/AstralSnow/AstralSnowTreeSapling.cs b/Tiles/AstralSnow/AstralSnowTreeSapling.cs index 574947c5e6..b1e81074c2 100644 --- a/Tiles/AstralSnow/AstralSnowTreeSapling.cs +++ b/Tiles/AstralSnow/AstralSnowTreeSapling.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Tiles.AstralSnow TileObjectData.newTile.RandomStyleRange = 3; TileObjectData.addTile(Type); ModTranslation name = CreateMapEntryName(); - name.SetDefault("Sapling"); + name.SetDefault("MapObject.Sapling"); AddMapEntry(new Color(200, 200, 200), name); DustType = ModContent.DustType(); AdjTiles = new int[] { TileID.Saplings }; diff --git a/Tiles/CalamityGlobalTile.cs b/Tiles/CalamityGlobalTile.cs index 182a68cfdb..dae30c6521 100644 --- a/Tiles/CalamityGlobalTile.cs +++ b/Tiles/CalamityGlobalTile.cs @@ -1,13 +1,13 @@ using CalamityMod.Events; using CalamityMod.Items.TreasureBags.MiscGrabBags; +using CalamityMod.Items.VanillaArmorChanges; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Tiles.Abyss; using CalamityMod.Tiles.Astral; using CalamityMod.Tiles.AstralDesert; using CalamityMod.Tiles.DraedonStructures; using CalamityMod.Tiles.DraedonSummoner; -using CalamityMod.Tiles.Furniture; -using CalamityMod.Tiles.FurnitureExo; +using CalamityMod.Tiles.Furniture.CraftingStations; using CalamityMod.Tiles.SunkenSea; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -232,6 +232,19 @@ namespace CalamityMod.Tiles player.breath += 20; if (player.breath > player.breathMax) player.breath = player.breathMax; + } + // Mining set gives a chance for additional ore. This can be abused for infinite ore but it has a cooldown to prevent too much abuse + if (player.Calamity().miningSet && player.Calamity().miningSetCooldown <= 0 && !fail) + { + int item = tile.GetOreItemID(); + Vector2 pos = new Vector2(i, j) * 16; + // 25% chance for additional ore + if (Main.rand.NextBool(MiningArmorSetChange.BonusOreChance) && item != -1) + { + Item.NewItem(new EntitySource_TileBreak(i, j), pos, item); + // Cooldown varies between 3 and 6 seconds + player.Calamity().miningSetCooldown = Main.rand.Next(MiningArmorSetChange.CooldownMin, MiningArmorSetChange.CooldownMax + 1); + } } } @@ -289,27 +302,6 @@ namespace CalamityMod.Tiles return true; } - public override int[] AdjTiles (int type) - { - // Ashen, Ancient and Profaned Sinks all count as a lava source instead of a water source - // Exo Sinks count as a water, lava, and honey source - if (type == ModContent.TileType() || - type == ModContent.TileType() || - type == ModContent.TileType() || - type == ModContent.TileType()) - { - Main.LocalPlayer.adjLava = true; - } - // Botanic Sink counts as a honey source instead of a water source - if (type == ModContent.TileType() || - type == ModContent.TileType()) - { - Main.LocalPlayer.adjHoney = true; - } - - return new int[0]; - } - public static bool ShouldNotBreakDueToAboveTile(int x, int y) { int[] invincibleTiles = new int[] diff --git a/Tiles/Furniture/SCalAltar.cs b/Tiles/Furniture/CraftingStations/SCalAltar.cs similarity index 95% rename from Tiles/Furniture/SCalAltar.cs rename to Tiles/Furniture/CraftingStations/SCalAltar.cs index 6399d21565..d3556eacf5 100644 --- a/Tiles/Furniture/SCalAltar.cs +++ b/Tiles/Furniture/CraftingStations/SCalAltar.cs @@ -1,6 +1,6 @@ using CalamityMod.Events; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.Furniture; +using CalamityMod.Items.Placeables.Furniture.CraftingStations; using CalamityMod.Items.SummonItems; using CalamityMod.NPCs.SupremeCalamitas; using CalamityMod.Projectiles.Boss; @@ -13,7 +13,7 @@ using Terraria.ModLoader; using Terraria.ObjectData; using Terraria.Audio; -namespace CalamityMod.Tiles.Furniture +namespace CalamityMod.Tiles.Furniture.CraftingStations { public class SCalAltar : ModTile { @@ -23,7 +23,7 @@ namespace CalamityMod.Tiles.Furniture { Main.tileFrameImportant[Type] = true; Main.tileNoAttach[Type] = true; - Main.tileSpelunker[Type] = true; + Main.tileLavaDeath[Type] = false; TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); TileObjectData.newTile.Width = 4; TileObjectData.newTile.Height = 3; @@ -44,8 +44,8 @@ namespace CalamityMod.Tiles.Furniture public override bool CreateDust(int i, int j, ref int type) { - // Fire dust. - type = 6; + // Red torch dust. + type = 60; return true; } diff --git a/Tiles/Furniture/CraftingStations/SCalAltar.png b/Tiles/Furniture/CraftingStations/SCalAltar.png new file mode 100644 index 0000000000..02c8df7cfc Binary files /dev/null and b/Tiles/Furniture/CraftingStations/SCalAltar.png differ diff --git a/Tiles/Furniture/SCalAltar.png b/Tiles/Furniture/SCalAltar.png deleted file mode 100644 index 430144741e..0000000000 Binary files a/Tiles/Furniture/SCalAltar.png and /dev/null differ diff --git a/Tiles/FurnitureAbyss/AbyssBed.cs b/Tiles/FurnitureAbyss/AbyssBed.cs index 5c85937788..6e785b4e3d 100644 --- a/Tiles/FurnitureAbyss/AbyssBed.cs +++ b/Tiles/FurnitureAbyss/AbyssBed.cs @@ -37,17 +37,8 @@ namespace CalamityMod.Tiles.FurnitureAbyss Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 64, 32, ModContent.ItemType()); } - public override bool RightClick(int i, int j) - { - return CalamityUtils.BedRightClick(i, j); - } + public override bool RightClick(int i, int j) => CalamityUtils.BedRightClick(i, j); - public override void MouseOver(int i, int j) - { - Player player = Main.LocalPlayer; - player.noThrow = 2; - player.cursorItemIconEnabled = true; - player.cursorItemIconID = ModContent.ItemType(); - } + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); } } diff --git a/Tiles/FurnitureAbyss/AbyssClock.cs b/Tiles/FurnitureAbyss/AbyssClock.cs index ad477f2be9..3adc610c5d 100644 --- a/Tiles/FurnitureAbyss/AbyssClock.cs +++ b/Tiles/FurnitureAbyss/AbyssClock.cs @@ -49,5 +49,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss { Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 48, 32, ModContent.ItemType()); } + + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); } } diff --git a/Tiles/FurnitureAbyss/AbyssSofa.cs b/Tiles/FurnitureAbyss/AbyssSofa.cs index 6a5f38aa5f..c35814641d 100644 --- a/Tiles/FurnitureAbyss/AbyssSofa.cs +++ b/Tiles/FurnitureAbyss/AbyssSofa.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Tiles.FurnitureAbyss public override void SetStaticDefaults() { this.SetUpSofa(true); - AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Bench")); + AddMapEntry(new Color(191, 142, 111), Language.GetText("Bench")); } public override bool CreateDust(int i, int j, ref int type) diff --git a/Tiles/FurnitureAcidwood/AcidwoodBedTile.cs b/Tiles/FurnitureAcidwood/AcidwoodBedTile.cs index ca69e359b3..ba3f5ee33a 100644 --- a/Tiles/FurnitureAcidwood/AcidwoodBedTile.cs +++ b/Tiles/FurnitureAcidwood/AcidwoodBedTile.cs @@ -40,12 +40,6 @@ namespace CalamityMod.Tiles.FurnitureAcidwood public override bool RightClick(int i, int j) => CalamityUtils.BedRightClick(i, j); - public override void MouseOver(int i, int j) - { - Player player = Main.LocalPlayer; - player.noThrow = 2; - player.cursorItemIconEnabled = true; - player.cursorItemIconID = ModContent.ItemType(); - } + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); } } diff --git a/Tiles/FurnitureAcidwood/AcidwoodBenchTile.cs b/Tiles/FurnitureAcidwood/AcidwoodBenchTile.cs index c8bf12f26b..9a267fe469 100644 --- a/Tiles/FurnitureAcidwood/AcidwoodBenchTile.cs +++ b/Tiles/FurnitureAcidwood/AcidwoodBenchTile.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Tiles.FurnitureAcidwood public override void SetStaticDefaults() { this.SetUpSofa(); - AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Bench")); + AddMapEntry(new Color(191, 142, 111), Language.GetText("Bench")); } public override bool CreateDust(int i, int j, ref int type) diff --git a/Tiles/FurnitureAcidwood/AcidwoodClockTile.cs b/Tiles/FurnitureAcidwood/AcidwoodClockTile.cs index 4c1949a85e..d8ffef1e95 100644 --- a/Tiles/FurnitureAcidwood/AcidwoodClockTile.cs +++ b/Tiles/FurnitureAcidwood/AcidwoodClockTile.cs @@ -46,5 +46,7 @@ namespace CalamityMod.Tiles.FurnitureAcidwood { Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 48, 32, ModContent.ItemType()); } + + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); } } diff --git a/Tiles/FurnitureAncient/AncientBed.cs b/Tiles/FurnitureAncient/AncientBed.cs index c39f27be28..3b6d6b6dfb 100644 --- a/Tiles/FurnitureAncient/AncientBed.cs +++ b/Tiles/FurnitureAncient/AncientBed.cs @@ -76,12 +76,7 @@ namespace CalamityMod.Tiles.FurnitureAncient return true; } - public override void MouseOver(int i, int j) - { - Player player = Main.LocalPlayer; - player.noThrow = 2; - player.cursorItemIconEnabled = true; - player.cursorItemIconID = ModContent.ItemType(); - } + + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); } } diff --git a/Tiles/FurnitureAncient/AncientMonolith.cs b/Tiles/FurnitureAncient/AncientMonolith.cs index e93e2d2535..4ff2a04a19 100644 --- a/Tiles/FurnitureAncient/AncientMonolith.cs +++ b/Tiles/FurnitureAncient/AncientMonolith.cs @@ -79,5 +79,7 @@ namespace CalamityMod.Tiles.FurnitureAncient { Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 48, 32, ModContent.ItemType()); } + + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); } } diff --git a/Tiles/FurnitureAncient/AncientSink.cs b/Tiles/FurnitureAncient/AncientSink.cs index b709d366b6..8f9c6106ac 100644 --- a/Tiles/FurnitureAncient/AncientSink.cs +++ b/Tiles/FurnitureAncient/AncientSink.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureAncient { public override void SetStaticDefaults() { - this.SetUpSink(true); + this.SetUpSink(true, false, true); AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Sink")); } diff --git a/Tiles/FurnitureAncient/AncientSofa.cs b/Tiles/FurnitureAncient/AncientSofa.cs index 506fe89b26..066cd21198 100644 --- a/Tiles/FurnitureAncient/AncientSofa.cs +++ b/Tiles/FurnitureAncient/AncientSofa.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Tiles.FurnitureAncient public override void SetStaticDefaults() { this.SetUpSofa(true); - AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Bench")); + AddMapEntry(new Color(191, 142, 111), Language.GetText("Bench")); } public override bool CreateDust(int i, int j, ref int type) diff --git a/Tiles/FurnitureAshen/AshenBed.cs b/Tiles/FurnitureAshen/AshenBed.cs index e4eeaa1d92..036a65a297 100644 --- a/Tiles/FurnitureAshen/AshenBed.cs +++ b/Tiles/FurnitureAshen/AshenBed.cs @@ -37,17 +37,8 @@ namespace CalamityMod.Tiles.FurnitureAshen Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 64, 32, ModContent.ItemType()); } - public override bool RightClick(int i, int j) - { - return CalamityUtils.BedRightClick(i, j); - } + public override bool RightClick(int i, int j) => CalamityUtils.BedRightClick(i, j); - public override void MouseOver(int i, int j) - { - Player player = Main.LocalPlayer; - player.noThrow = 2; - player.cursorItemIconEnabled = true; - player.cursorItemIconID = ModContent.ItemType(); - } + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); } } diff --git a/Tiles/FurnitureAshen/AshenMonolith.cs b/Tiles/FurnitureAshen/AshenMonolith.cs index cef99afa49..32930c6588 100644 --- a/Tiles/FurnitureAshen/AshenMonolith.cs +++ b/Tiles/FurnitureAshen/AshenMonolith.cs @@ -60,6 +60,8 @@ namespace CalamityMod.Tiles.FurnitureAshen Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 48, 32, ModContent.ItemType()); } + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { //This is used to draw the eye, where the frame is changed depending on the player's position relative to the eye's centre. diff --git a/Tiles/FurnitureAshen/AshenSink.cs b/Tiles/FurnitureAshen/AshenSink.cs index 9445cd2a97..4625eecc17 100644 --- a/Tiles/FurnitureAshen/AshenSink.cs +++ b/Tiles/FurnitureAshen/AshenSink.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Tiles.FurnitureAshen { public override void SetStaticDefaults() { - this.SetUpSink(true); + this.SetUpSink(true, false, true); AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Sink")); } diff --git a/Tiles/FurnitureAshen/AshenSofa.cs b/Tiles/FurnitureAshen/AshenSofa.cs index 2c01e38682..8ffe4cfd8d 100644 --- a/Tiles/FurnitureAshen/AshenSofa.cs +++ b/Tiles/FurnitureAshen/AshenSofa.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Tiles.FurnitureAshen public override void SetStaticDefaults() { this.SetUpSofa(true); - AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Bench")); + AddMapEntry(new Color(191, 142, 111), Language.GetText("Bench")); } public override bool CreateDust(int i, int j, ref int type) diff --git a/Tiles/FurnitureBotanic/BotanicBed.cs b/Tiles/FurnitureBotanic/BotanicBed.cs index 751a0557c3..eda0b417a8 100644 --- a/Tiles/FurnitureBotanic/BotanicBed.cs +++ b/Tiles/FurnitureBotanic/BotanicBed.cs @@ -38,17 +38,8 @@ namespace CalamityMod.Tiles.FurnitureBotanic Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 64, 32, ModContent.ItemType()); } - public override bool RightClick(int i, int j) - { - return CalamityUtils.BedRightClick(i, j); - } + public override bool RightClick(int i, int j) => CalamityUtils.BedRightClick(i, j); - public override void MouseOver(int i, int j) - { - Player player = Main.LocalPlayer; - player.noThrow = 2; - player.cursorItemIconEnabled = true; - player.cursorItemIconID = ModContent.ItemType(); - } + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); } } diff --git a/Tiles/FurnitureBotanic/BotanicBench.cs b/Tiles/FurnitureBotanic/BotanicBench.cs index 3299303077..764f026e1c 100644 --- a/Tiles/FurnitureBotanic/BotanicBench.cs +++ b/Tiles/FurnitureBotanic/BotanicBench.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic public override void SetStaticDefaults() { this.SetUpSofa(true); - AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Bench")); + AddMapEntry(new Color(191, 142, 111), Language.GetText("Bench")); } public override bool CreateDust(int i, int j, ref int type) diff --git a/Tiles/FurnitureBotanic/BotanicClock.cs b/Tiles/FurnitureBotanic/BotanicClock.cs index e9fae82c19..43db20d5b2 100644 --- a/Tiles/FurnitureBotanic/BotanicClock.cs +++ b/Tiles/FurnitureBotanic/BotanicClock.cs @@ -50,5 +50,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic { Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 48, 32, ModContent.ItemType()); } + + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); } } diff --git a/Tiles/FurnitureBotanic/BotanicSink.cs b/Tiles/FurnitureBotanic/BotanicSink.cs index 397972b7c1..3f7b8b8cc8 100644 --- a/Tiles/FurnitureBotanic/BotanicSink.cs +++ b/Tiles/FurnitureBotanic/BotanicSink.cs @@ -2,6 +2,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; +using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; @@ -11,7 +12,7 @@ namespace CalamityMod.Tiles.FurnitureBotanic { public override void SetStaticDefaults() { - this.SetUpSink(true); + this.SetUpSink(true, false, false, true); AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Sink")); } diff --git a/Tiles/FurnitureCosmilite/CosmiliteBed.cs b/Tiles/FurnitureCosmilite/CosmiliteBed.cs index 70d170905e..fad2dbc4a8 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteBed.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteBed.cs @@ -37,17 +37,8 @@ namespace CalamityMod.Tiles.FurnitureCosmilite Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 64, 32, ModContent.ItemType()); } - public override bool RightClick(int i, int j) - { - return CalamityUtils.BedRightClick(i, j); - } + public override bool RightClick(int i, int j) => CalamityUtils.BedRightClick(i, j); - public override void MouseOver(int i, int j) - { - Player player = Main.LocalPlayer; - player.noThrow = 2; - player.cursorItemIconEnabled = true; - player.cursorItemIconID = ModContent.ItemType(); - } + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); } } diff --git a/Tiles/FurnitureCosmilite/CosmiliteClock.cs b/Tiles/FurnitureCosmilite/CosmiliteClock.cs index e129f4909c..a1185223d3 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteClock.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteClock.cs @@ -49,5 +49,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite { Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 48, 32, ModContent.ItemType()); } + + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); } } diff --git a/Tiles/FurnitureCosmilite/CosmiliteSofa.cs b/Tiles/FurnitureCosmilite/CosmiliteSofa.cs index d3a4b7c1ec..e95f4eeb8e 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteSofa.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteSofa.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Tiles.FurnitureCosmilite public override void SetStaticDefaults() { this.SetUpSofa(true); - AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Bench")); + AddMapEntry(new Color(191, 142, 111), Language.GetText("Bench")); } public override bool CreateDust(int i, int j, ref int type) diff --git a/Tiles/FurnitureEutrophic/EutrophicBed.cs b/Tiles/FurnitureEutrophic/EutrophicBed.cs index d857e825db..cd1f2d0d20 100644 --- a/Tiles/FurnitureEutrophic/EutrophicBed.cs +++ b/Tiles/FurnitureEutrophic/EutrophicBed.cs @@ -36,17 +36,8 @@ namespace CalamityMod.Tiles.FurnitureEutrophic Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 64, 32, ModContent.ItemType()); } - public override bool RightClick(int i, int j) - { - return CalamityUtils.BedRightClick(i, j); - } + public override bool RightClick(int i, int j) => CalamityUtils.BedRightClick(i, j); - public override void MouseOver(int i, int j) - { - Player player = Main.LocalPlayer; - player.noThrow = 2; - player.cursorItemIconEnabled = true; - player.cursorItemIconID = ModContent.ItemType(); - } + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); } } diff --git a/Tiles/FurnitureEutrophic/EutrophicBench.cs b/Tiles/FurnitureEutrophic/EutrophicBench.cs index 95bd8a8843..03f1f0fc47 100644 --- a/Tiles/FurnitureEutrophic/EutrophicBench.cs +++ b/Tiles/FurnitureEutrophic/EutrophicBench.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic public override void SetStaticDefaults() { this.SetUpSofa(); - AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Bench")); + AddMapEntry(new Color(191, 142, 111), Language.GetText("Bench")); } public override bool CreateDust(int i, int j, ref int type) diff --git a/Tiles/FurnitureEutrophic/EutrophicClock.cs b/Tiles/FurnitureEutrophic/EutrophicClock.cs index 7504e24c39..d6c6af3bc6 100644 --- a/Tiles/FurnitureEutrophic/EutrophicClock.cs +++ b/Tiles/FurnitureEutrophic/EutrophicClock.cs @@ -64,5 +64,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic { Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 48, 32, ModContent.ItemType()); } + + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); } } diff --git a/Tiles/FurnitureExo/ExoBedTile.cs b/Tiles/FurnitureExo/ExoBedTile.cs index 467db41a76..c064364c17 100644 --- a/Tiles/FurnitureExo/ExoBedTile.cs +++ b/Tiles/FurnitureExo/ExoBedTile.cs @@ -42,13 +42,7 @@ namespace CalamityMod.Tiles.FurnitureExo public override bool RightClick(int i, int j) => CalamityUtils.BedRightClick(i, j); - public override void MouseOver(int i, int j) - { - Player player = Main.LocalPlayer; - player.noThrow = 2; - player.cursorItemIconEnabled = true; - player.cursorItemIconID = ModContent.ItemType(); - } + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { diff --git a/Tiles/FurnitureExo/ExoChestTile.cs b/Tiles/FurnitureExo/ExoChestTile.cs index ed2c623aa7..ad82e471af 100644 --- a/Tiles/FurnitureExo/ExoChestTile.cs +++ b/Tiles/FurnitureExo/ExoChestTile.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Tiles.FurnitureExo { public override void SetStaticDefaults() { - this.SetUpChest(true); + this.SetUpChest(true, 2); ModTranslation name = CreateMapEntryName(); name.SetDefault("Exo Chest"); AddMapEntry(new Color(71, 95, 114), name, MapChestName); @@ -59,7 +59,7 @@ namespace CalamityMod.Tiles.FurnitureExo int yOffset = TileObjectData.GetTileData(tile).DrawYOffset; Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureExo/ExoChestGlow").Value; Vector2 drawOffset = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange); - Vector2 drawPosition = new Vector2(i * 16 - (int)Main.screenPosition.X / 2f, j * 16 - (int)Main.screenPosition.Y + yOffset) + drawOffset; + Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y + yOffset) + drawOffset; Color drawColour = Color.White; Main.spriteBatch.Draw(glowmask, drawPosition, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), drawColour, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); } diff --git a/Tiles/FurnitureExo/ExoClockTile.cs b/Tiles/FurnitureExo/ExoClockTile.cs index 823e49cede..6e5972a454 100644 --- a/Tiles/FurnitureExo/ExoClockTile.cs +++ b/Tiles/FurnitureExo/ExoClockTile.cs @@ -50,6 +50,8 @@ namespace CalamityMod.Tiles.FurnitureExo Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 48, 32, ModContent.ItemType()); } + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { int xFrameOffset = Main.tile[i, j].TileFrameX; diff --git a/Tiles/FurnitureExo/ExoSinkTile.cs b/Tiles/FurnitureExo/ExoSinkTile.cs index 0cf7245dee..84da9931af 100644 --- a/Tiles/FurnitureExo/ExoSinkTile.cs +++ b/Tiles/FurnitureExo/ExoSinkTile.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Tiles.FurnitureExo { public override void SetStaticDefaults() { - this.SetUpSink(true); + this.SetUpSink(true, true, true, true); AddMapEntry(new Color(71, 95, 114), Language.GetText("MapObject.Sink")); AdjTiles = new int[] { TileID.Sinks }; } diff --git a/Tiles/FurnitureExo/ExoSofaTile.cs b/Tiles/FurnitureExo/ExoSofaTile.cs index e5d8843869..3b61d8bf6c 100644 --- a/Tiles/FurnitureExo/ExoSofaTile.cs +++ b/Tiles/FurnitureExo/ExoSofaTile.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Tiles.FurnitureExo public override void SetStaticDefaults() { this.SetUpSofa(true); - AddMapEntry(new Color(71, 95, 114), Language.GetText("MapObject.Bench")); + AddMapEntry(new Color(71, 95, 114), Language.GetText("Bench")); } public override bool CanExplode(int i, int j) => false; diff --git a/Tiles/FurnitureMonolith/MonolithBed.cs b/Tiles/FurnitureMonolith/MonolithBed.cs index def60a15ef..5cbe4675b2 100644 --- a/Tiles/FurnitureMonolith/MonolithBed.cs +++ b/Tiles/FurnitureMonolith/MonolithBed.cs @@ -62,17 +62,8 @@ namespace CalamityMod.Tiles.FurnitureMonolith Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 64, 32, ModContent.ItemType()); } - public override bool RightClick(int i, int j) - { - return CalamityUtils.BedRightClick(i, j); - } + public override bool RightClick(int i, int j) => CalamityUtils.BedRightClick(i, j); - public override void MouseOver(int i, int j) - { - Player player = Main.LocalPlayer; - player.noThrow = 2; - player.cursorItemIconEnabled = true; - player.cursorItemIconID = ModContent.ItemType(); - } + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); } } diff --git a/Tiles/FurnitureMonolith/MonolithBench.cs b/Tiles/FurnitureMonolith/MonolithBench.cs index 151652d58f..0f913ba24d 100644 --- a/Tiles/FurnitureMonolith/MonolithBench.cs +++ b/Tiles/FurnitureMonolith/MonolithBench.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Tiles.FurnitureMonolith public override void SetStaticDefaults() { this.SetUpSofa(true); - AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Bench")); + AddMapEntry(new Color(191, 142, 111), Language.GetText("Bench")); } public override bool CreateDust(int i, int j, ref int type) diff --git a/Tiles/FurnitureMonolith/MonolithClock.cs b/Tiles/FurnitureMonolith/MonolithClock.cs index 9054628e6d..77d2d292d6 100644 --- a/Tiles/FurnitureMonolith/MonolithClock.cs +++ b/Tiles/FurnitureMonolith/MonolithClock.cs @@ -74,5 +74,7 @@ namespace CalamityMod.Tiles.FurnitureMonolith { Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 48, 32, ModContent.ItemType()); } + + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); } } diff --git a/Tiles/FurnitureOtherworldly/OtherworldlyBed.cs b/Tiles/FurnitureOtherworldly/OtherworldlyBed.cs index f059ff6074..73b23ca817 100644 --- a/Tiles/FurnitureOtherworldly/OtherworldlyBed.cs +++ b/Tiles/FurnitureOtherworldly/OtherworldlyBed.cs @@ -39,17 +39,8 @@ namespace CalamityMod.Tiles.FurnitureOtherworldly Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 64, 32, ModContent.ItemType()); } - public override bool RightClick(int i, int j) - { - return CalamityUtils.BedRightClick(i, j); - } + public override bool RightClick(int i, int j) => CalamityUtils.BedRightClick(i, j); - public override void MouseOver(int i, int j) - { - Player player = Main.LocalPlayer; - player.noThrow = 2; - player.cursorItemIconEnabled = true; - player.cursorItemIconID = ModContent.ItemType(); - } + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); } } diff --git a/Tiles/FurnitureOtherworldly/OtherworldlyClock.cs b/Tiles/FurnitureOtherworldly/OtherworldlyClock.cs index c90e810974..52f031ff6d 100644 --- a/Tiles/FurnitureOtherworldly/OtherworldlyClock.cs +++ b/Tiles/FurnitureOtherworldly/OtherworldlyClock.cs @@ -51,5 +51,7 @@ namespace CalamityMod.Tiles.FurnitureOtherworldly { Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 48, 32, ModContent.ItemType()); } + + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); } } diff --git a/Tiles/FurnitureOtherworldly/OtherworldlySofa.cs b/Tiles/FurnitureOtherworldly/OtherworldlySofa.cs index 02f80459b8..22e085dbb1 100644 --- a/Tiles/FurnitureOtherworldly/OtherworldlySofa.cs +++ b/Tiles/FurnitureOtherworldly/OtherworldlySofa.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Tiles.FurnitureOtherworldly public override void SetStaticDefaults() { this.SetUpSofa(true); - AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Bench")); + AddMapEntry(new Color(191, 142, 111), Language.GetText("Bench")); } public override bool CreateDust(int i, int j, ref int type) diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateBed.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateBed.cs index aee73b111d..a6b52e25f3 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateBed.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateBed.cs @@ -67,12 +67,6 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate return true; } - public override void MouseOver(int i, int j) - { - Player player = Main.LocalPlayer; - player.noThrow = 2; - player.cursorItemIconEnabled = true; - player.cursorItemIconID = ModContent.ItemType(); - } + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); } } diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateClock.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateClock.cs index a59e425a38..81fbb25b45 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateClock.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateClock.cs @@ -48,5 +48,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate { Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 48, 32, ModContent.ItemType()); } + + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); } } diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateSofa.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateSofa.cs index 39a5b8102a..e4429b34fc 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateSofa.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateSofa.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate public override void SetStaticDefaults() { this.SetUpSofa(true); - AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Bench")); + AddMapEntry(new Color(191, 142, 111), Language.GetText("Bench")); } public override bool CreateDust(int i, int j, ref int type) diff --git a/Tiles/FurnitureProfaned/ProfanedBed.cs b/Tiles/FurnitureProfaned/ProfanedBed.cs index fb9e7c3f6c..5574cc4a55 100644 --- a/Tiles/FurnitureProfaned/ProfanedBed.cs +++ b/Tiles/FurnitureProfaned/ProfanedBed.cs @@ -38,17 +38,8 @@ namespace CalamityMod.Tiles.FurnitureProfaned Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 64, 32, ModContent.ItemType()); } - public override bool RightClick(int i, int j) - { - return CalamityUtils.BedRightClick(i, j); - } + public override bool RightClick(int i, int j) => CalamityUtils.BedRightClick(i, j); - public override void MouseOver(int i, int j) - { - Player player = Main.LocalPlayer; - player.noThrow = 2; - player.cursorItemIconEnabled = true; - player.cursorItemIconID = ModContent.ItemType(); - } + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); } } diff --git a/Tiles/FurnitureProfaned/ProfanedBench.cs b/Tiles/FurnitureProfaned/ProfanedBench.cs index 4718cfbd8b..8e048511a5 100644 --- a/Tiles/FurnitureProfaned/ProfanedBench.cs +++ b/Tiles/FurnitureProfaned/ProfanedBench.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned public override void SetStaticDefaults() { this.SetUpSofa(true); - AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Bench")); + AddMapEntry(new Color(191, 142, 111), Language.GetText("Bench")); } public override bool CreateDust(int i, int j, ref int type) diff --git a/Tiles/FurnitureProfaned/ProfanedClock.cs b/Tiles/FurnitureProfaned/ProfanedClock.cs index f4982c16fd..5fd839688d 100644 --- a/Tiles/FurnitureProfaned/ProfanedClock.cs +++ b/Tiles/FurnitureProfaned/ProfanedClock.cs @@ -50,5 +50,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned { Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 48, 32, ModContent.ItemType()); } + + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); } } diff --git a/Tiles/FurnitureProfaned/ProfanedSink.cs b/Tiles/FurnitureProfaned/ProfanedSink.cs index 99eedebcf5..f25f06992a 100644 --- a/Tiles/FurnitureProfaned/ProfanedSink.cs +++ b/Tiles/FurnitureProfaned/ProfanedSink.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Tiles.FurnitureProfaned { public override void SetStaticDefaults() { - this.SetUpSink(true); + this.SetUpSink(true, false, true); AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Sink")); } diff --git a/Tiles/FurnitureSacrilegious/EyeOfTheAccursedBannerTile.cs b/Tiles/FurnitureSacrilegious/EyeOfTheAccursedBannerTile.cs new file mode 100644 index 0000000000..dd845815b6 --- /dev/null +++ b/Tiles/FurnitureSacrilegious/EyeOfTheAccursedBannerTile.cs @@ -0,0 +1,41 @@ +using CalamityMod.Items.Placeables.FurnitureSacrilegious; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.Enums; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.FurnitureSacrilegious +{ + public class EyeOfTheAccursedBannerTile : ModTile + { + public override void SetStaticDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileNoAttach[Type] = true; + Main.tileLavaDeath[Type] = false; + + TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); + TileObjectData.newTile.Height = 3; + TileObjectData.newTile.Origin = new Point16(0, 0); + TileObjectData.newTile.AnchorBottom = default(AnchorData); + TileObjectData.newTile.AnchorTop = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide | AnchorType.SolidBottom, TileObjectData.newTile.Width, 0); + TileObjectData.newTile.LavaDeath = false; + TileObjectData.newTile.DrawYOffset = -2; + TileObjectData.addTile(Type); + + DustType = -1; + TileID.Sets.DisableSmartCursor[Type] = true; + AddMapEntry(new Color(43, 19, 42), Language.GetText("MapObject.Banner")); + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 16, ModContent.ItemType()); + } + } +} diff --git a/Tiles/FurnitureSacrilegious/EyeOfTheAccursedBannerTile.png b/Tiles/FurnitureSacrilegious/EyeOfTheAccursedBannerTile.png new file mode 100644 index 0000000000..78c35ff08a Binary files /dev/null and b/Tiles/FurnitureSacrilegious/EyeOfTheAccursedBannerTile.png differ diff --git a/Tiles/FurnitureSacrilegious/LargeRitualCandleTile.cs b/Tiles/FurnitureSacrilegious/LargeRitualCandleTile.cs new file mode 100644 index 0000000000..3f31abe58d --- /dev/null +++ b/Tiles/FurnitureSacrilegious/LargeRitualCandleTile.cs @@ -0,0 +1,86 @@ +using CalamityMod.Items.Placeables.FurnitureSacrilegious; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.FurnitureSacrilegious +{ + public class LargeRitualCandleTile : ModTile + { + public override void SetStaticDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileNoAttach[Type] = true; + Main.tileLavaDeath[Type] = false; + TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); + TileObjectData.newTile.Height = 6; + TileObjectData.newTile.CoordinateHeights = new int[] + { + 16, + 16, + 16, + 16, + 16, + 16 + }; + TileObjectData.newTile.Origin = new Point16(0, 4); + TileObjectData.newTile.UsesCustomCanPlace = true; + TileObjectData.newTile.LavaDeath = false; + TileObjectData.addTile(Type); + + AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); + AddMapEntry(new Color(43, 19, 42), Language.GetText("Large Ritual Candle")); + + TileID.Sets.DisableSmartCursor[Type] = true; + AdjTiles = new int[] { TileID.Lamps }; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 60, 0f, 0f, 1, new Color(255, 255, 255), 1f); + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 8, 0f, 0f, 1, new Color(100, 100, 100), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 32, ModContent.ItemType()); + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].TileFrameX < 54) + { + r = 3f; + g = 0.6f; + b = 0.6f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 4, 6); + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + CalamityUtils.DrawFlameEffect(ModContent.Request("CalamityMod/Tiles/FurnitureSacrilegious/LargeRitualCandleTileFlame").Value, i, j); + } + } +} diff --git a/Tiles/FurnitureSacrilegious/LargeRitualCandleTile.png b/Tiles/FurnitureSacrilegious/LargeRitualCandleTile.png new file mode 100644 index 0000000000..c308ab6c18 Binary files /dev/null and b/Tiles/FurnitureSacrilegious/LargeRitualCandleTile.png differ diff --git a/Tiles/FurnitureSacrilegious/LargeRitualCandleTileFlame.png b/Tiles/FurnitureSacrilegious/LargeRitualCandleTileFlame.png new file mode 100644 index 0000000000..a2af2ce410 Binary files /dev/null and b/Tiles/FurnitureSacrilegious/LargeRitualCandleTileFlame.png differ diff --git a/Tiles/FurnitureSacrilegious/MonolithOfTheAccursedTile.cs b/Tiles/FurnitureSacrilegious/MonolithOfTheAccursedTile.cs new file mode 100644 index 0000000000..927638cdad --- /dev/null +++ b/Tiles/FurnitureSacrilegious/MonolithOfTheAccursedTile.cs @@ -0,0 +1,167 @@ +using CalamityMod.Items.Placeables.FurnitureSacrilegious; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.FurnitureSacrilegious +{ + public class MonolithOfTheAccursedTile : ModTile + { + public override void SetStaticDefaults() + { + Main.tileLighted[Type] = true; + Main.tileFrameImportant[Type] = true; + Main.tileNoAttach[Type] = true; + Main.tileLavaDeath[Type] = false; + TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); + TileObjectData.newTile.Height = 3; + TileObjectData.newTile.CoordinateHeights = new int[] + { + 16, + 16, + 16 + }; + TileObjectData.newTile.Origin = new Point16(0, 1); + TileObjectData.newTile.UsesCustomCanPlace = true; + TileObjectData.newTile.LavaDeath = false; + TileObjectData.addTile(Type); + + TileID.Sets.HasOutlines[Type] = true; + AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Monolith of the Accursed"); + AddMapEntry(new Color(43, 19, 42), name); + } + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 60, 0f, 0f, 1, new Color(255, 255, 255), 1f); + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 8, 0f, 0f, 1, new Color(100, 100, 100), 1f); + return false; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].TileFrameX > 36) + { + r = 1.2f; + g = 0.2f; + b = 0.2f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + private void ToggleMode(int i, int j) + { + int tileX = 2; + int tileY = 3; + + int x = i - Main.tile[i, j].TileFrameX / 18 % tileX; + int y = j - Main.tile[i, j].TileFrameY / 18 % tileY; + for (int l = x; l < x + tileX; l++) + { + for (int m = y; m < y + tileY; m++) + { + if (Main.tile[l, m].HasTile && Main.tile[l, m].TileType == Type) + { + if (Main.tile[l, m].TileFrameX < (36 * tileX)) + { + Main.tile[l, m].TileFrameX += (short)(18 * tileX); + } + else + { + Main.tile[l, m].TileFrameX -= (short)(36 * tileX); + } + } + } + } + if (Wiring.running) + { + for (int k = 0; k < tileX; k++) + { + for (int l = 0; l < tileY; l++) + { + Wiring.SkipWire(x + k, y + l); + } + } + } + } + + public override bool RightClick(int i, int j) + { + ToggleMode(i, j); + SoundEngine.PlaySound(SoundID.MenuTick); + return true; + } + + public override void HitWire(int i, int j) => ToggleMode(i, j); + + public override void NearbyEffects(int i, int j, bool closer) + { + if (Main.tile[i, j].TileFrameX < 36) + return; + + Player player = Main.LocalPlayer; + if (player is null) + return; + if (player.active) + { + int resetAmt = Main.tile[i, j].TileFrameX < 72 ? 20 : 40; + player.Calamity().monolithAccursedShader = resetAmt; + } + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 48, 32, ModContent.ItemType()); + } + + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); + + // For drawing the floating icon + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + if (Main.tile[i, j].TileFrameX < 36) + return; + + Texture2D texture = ModContent.Request("CalamityMod/Tiles/FurnitureSacrilegious/MonolithOfTheAccursedTile_IconRight").Value; + Tile tile = Main.tile[i, j]; + int xPos = tile.TileFrameX; + int yPos = tile.TileFrameY; + + Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + float xOffset = Main.tile[i, j].TileFrameX > 70 ? 52f : 16f; + Vector2 correction = new Vector2(xOffset , -10f); + float yOffset = (float)Math.Sin(Main.GlobalTimeWrappedHourly * MathHelper.TwoPi / 5f) * 2f; + Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y + yOffset) + zero + correction; + + Rectangle rect = new Rectangle(xPos, yPos, texture.Width, texture.Height); + Color color = new Color(100, 100, 100, 0); + Vector2 origin = rect.Size() / 2f; + + for (int c = 0; c < 5; c++) + { + spriteBatch.Draw(texture, drawOffset, rect, color, 0f, origin, 1f, SpriteEffects.None, 0f); + } + } + } +} diff --git a/Tiles/FurnitureSacrilegious/MonolithOfTheAccursedTile.png b/Tiles/FurnitureSacrilegious/MonolithOfTheAccursedTile.png new file mode 100644 index 0000000000..819f66a0ee Binary files /dev/null and b/Tiles/FurnitureSacrilegious/MonolithOfTheAccursedTile.png differ diff --git a/Tiles/FurnitureSacrilegious/MonolithOfTheAccursedTile_Highlight.png b/Tiles/FurnitureSacrilegious/MonolithOfTheAccursedTile_Highlight.png new file mode 100644 index 0000000000..d9cd089629 Binary files /dev/null and b/Tiles/FurnitureSacrilegious/MonolithOfTheAccursedTile_Highlight.png differ diff --git a/Tiles/FurnitureSacrilegious/MonolithOfTheAccursedTile_IconRight.png b/Tiles/FurnitureSacrilegious/MonolithOfTheAccursedTile_IconRight.png new file mode 100644 index 0000000000..6d6471f1d9 Binary files /dev/null and b/Tiles/FurnitureSacrilegious/MonolithOfTheAccursedTile_IconRight.png differ diff --git a/Tiles/FurnitureSacrilegious/OccultBrickTile.cs b/Tiles/FurnitureSacrilegious/OccultBrickTile.cs new file mode 100644 index 0000000000..c3bb487acd --- /dev/null +++ b/Tiles/FurnitureSacrilegious/OccultBrickTile.cs @@ -0,0 +1,27 @@ +using CalamityMod.Items.Placeables.FurnitureSacrilegious; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureSacrilegious +{ + public class OccultBrickTile : ModTile + { + public override void SetStaticDefaults() + { + Main.tileLighted[Type] = true; + Main.tileSolid[Type] = true; + Main.tileBlockLight[Type] = true; + DustType = 8; + ItemDrop = ModContent.ItemType(); + AddMapEntry(new Color(63, 69, 71)); + HitSound = SoundID.Tink; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/FurnitureSacrilegious/OccultBrickTile.png b/Tiles/FurnitureSacrilegious/OccultBrickTile.png new file mode 100644 index 0000000000..4038ab1a68 Binary files /dev/null and b/Tiles/FurnitureSacrilegious/OccultBrickTile.png differ diff --git a/Tiles/FurnitureSacrilegious/OccultLegionnaireBannerTile.cs b/Tiles/FurnitureSacrilegious/OccultLegionnaireBannerTile.cs new file mode 100644 index 0000000000..76ccb2288b --- /dev/null +++ b/Tiles/FurnitureSacrilegious/OccultLegionnaireBannerTile.cs @@ -0,0 +1,41 @@ +using CalamityMod.Items.Placeables.FurnitureSacrilegious; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.Enums; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.FurnitureSacrilegious +{ + public class OccultLegionnaireBannerTile : ModTile + { + public override void SetStaticDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileNoAttach[Type] = true; + Main.tileLavaDeath[Type] = false; + + TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); + TileObjectData.newTile.Height = 3; + TileObjectData.newTile.Origin = new Point16(0, 0); + TileObjectData.newTile.AnchorBottom = default(AnchorData); + TileObjectData.newTile.AnchorTop = new AnchorData(AnchorType.SolidTile | AnchorType.SolidSide | AnchorType.SolidBottom, TileObjectData.newTile.Width, 0); + TileObjectData.newTile.LavaDeath = false; + TileObjectData.newTile.DrawYOffset = -2; + TileObjectData.addTile(Type); + + DustType = -1; + TileID.Sets.DisableSmartCursor[Type] = true; + AddMapEntry(new Color(43, 19, 42), Language.GetText("MapObject.Banner")); + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 16, ModContent.ItemType()); + } + } +} diff --git a/Tiles/FurnitureSacrilegious/OccultLegionnaireBannerTile.png b/Tiles/FurnitureSacrilegious/OccultLegionnaireBannerTile.png new file mode 100644 index 0000000000..591b5fe233 Binary files /dev/null and b/Tiles/FurnitureSacrilegious/OccultLegionnaireBannerTile.png differ diff --git a/Tiles/FurnitureSacrilegious/OccultPlatformTile.cs b/Tiles/FurnitureSacrilegious/OccultPlatformTile.cs new file mode 100644 index 0000000000..9812ffea07 --- /dev/null +++ b/Tiles/FurnitureSacrilegious/OccultPlatformTile.cs @@ -0,0 +1,36 @@ +using CalamityMod.Items.Placeables.FurnitureSacrilegious; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureSacrilegious +{ + public class OccultPlatformTile : ModTile + { + public override void SetStaticDefaults() + { + this.SetUpPlatform(true); + AddMapEntry(new Color(85, 98, 99)); + ItemDrop = ModContent.ItemType(); + TileID.Sets.DisableSmartCursor[Type] = true; + AdjTiles = new int[] { TileID.Platforms }; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 8, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void PostSetDefaults() + { + Main.tileNoSunLight[Type] = false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/FurnitureSacrilegious/OccultPlatformTile.png b/Tiles/FurnitureSacrilegious/OccultPlatformTile.png new file mode 100644 index 0000000000..3d7b0ffc17 Binary files /dev/null and b/Tiles/FurnitureSacrilegious/OccultPlatformTile.png differ diff --git a/Tiles/FurnitureSacrilegious/RitualCandleTile.cs b/Tiles/FurnitureSacrilegious/RitualCandleTile.cs new file mode 100644 index 0000000000..2c6c0c5ee4 --- /dev/null +++ b/Tiles/FurnitureSacrilegious/RitualCandleTile.cs @@ -0,0 +1,83 @@ +using CalamityMod.Items.Placeables.FurnitureSacrilegious; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.Enums; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.FurnitureSacrilegious +{ + public class RitualCandleTile : ModTile + { + public override void SetStaticDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileNoAttach[Type] = true; + Main.tileLavaDeath[Type] = false; + TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); + TileObjectData.newTile.Height = 2; + TileObjectData.newTile.CoordinateHeights = new int[] + { + 16, + 16 + }; + TileObjectData.newTile.Origin = new Point16(0, 1); + TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.Table | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); + TileObjectData.newTile.UsesCustomCanPlace = true; + TileObjectData.newTile.LavaDeath = false; + TileObjectData.addTile(Type); + + AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); + AddMapEntry(new Color(43, 19, 42), Language.GetText("Ritual Candle")); + + TileID.Sets.DisableSmartCursor[Type] = true; + AdjTiles = new int[] { TileID.Candles }; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 60, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 32, ModContent.ItemType()); + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].TileFrameX < 54) + { + r = 3f; + g = 0.6f; + b = 0.6f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 4, 2); + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + CalamityUtils.DrawFlameEffect(ModContent.Request("CalamityMod/Tiles/FurnitureSacrilegious/RitualCandleTileFlame").Value, i, j); + } + } +} diff --git a/Tiles/FurnitureSacrilegious/RitualCandleTile.png b/Tiles/FurnitureSacrilegious/RitualCandleTile.png new file mode 100644 index 0000000000..79a1010eeb Binary files /dev/null and b/Tiles/FurnitureSacrilegious/RitualCandleTile.png differ diff --git a/Tiles/FurnitureSacrilegious/RitualCandleTileFlame.png b/Tiles/FurnitureSacrilegious/RitualCandleTileFlame.png new file mode 100644 index 0000000000..2136a81be0 Binary files /dev/null and b/Tiles/FurnitureSacrilegious/RitualCandleTileFlame.png differ diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousBathtubTile.cs b/Tiles/FurnitureSacrilegious/SacrilegiousBathtubTile.cs new file mode 100644 index 0000000000..f0eb7e9324 --- /dev/null +++ b/Tiles/FurnitureSacrilegious/SacrilegiousBathtubTile.cs @@ -0,0 +1,34 @@ +using CalamityMod.Items.Placeables.FurnitureSacrilegious; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ModLoader; +namespace CalamityMod.Tiles.FurnitureSacrilegious +{ + public class SacrilegiousBathtubTile : ModTile + { + public override void SetStaticDefaults() + { + this.SetUpBathtub(true); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Bathtub"); + AddMapEntry(new Color(43, 19, 42), name); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 8, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 32, ModContent.ItemType()); + } + } +} diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousBathtubTile.png b/Tiles/FurnitureSacrilegious/SacrilegiousBathtubTile.png new file mode 100644 index 0000000000..b68ea5c586 Binary files /dev/null and b/Tiles/FurnitureSacrilegious/SacrilegiousBathtubTile.png differ diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousBedTile.cs b/Tiles/FurnitureSacrilegious/SacrilegiousBedTile.cs new file mode 100644 index 0000000000..afe6aaba99 --- /dev/null +++ b/Tiles/FurnitureSacrilegious/SacrilegiousBedTile.cs @@ -0,0 +1,45 @@ +using CalamityMod.Items.Placeables.FurnitureSacrilegious; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureSacrilegious +{ + public class SacrilegiousBedTile : ModTile + { + public override void SetStaticDefaults() + { + this.SetUpBed(true); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Bed"); + AddMapEntry(new Color(43, 19, 42), name); + TileID.Sets.DisableSmartCursor[Type] = true; + AdjTiles = new int[] { TileID.Beds }; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 8, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 64, 32, ModContent.ItemType()); + } + + public override bool RightClick(int i, int j) => CalamityUtils.BedRightClick(i, j); + + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); + } +} diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousBedTile.png b/Tiles/FurnitureSacrilegious/SacrilegiousBedTile.png new file mode 100644 index 0000000000..151d90beeb Binary files /dev/null and b/Tiles/FurnitureSacrilegious/SacrilegiousBedTile.png differ diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousBedTile_Highlight.png b/Tiles/FurnitureSacrilegious/SacrilegiousBedTile_Highlight.png new file mode 100644 index 0000000000..5db6792cae Binary files /dev/null and b/Tiles/FurnitureSacrilegious/SacrilegiousBedTile_Highlight.png differ diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousBenchTile.cs b/Tiles/FurnitureSacrilegious/SacrilegiousBenchTile.cs new file mode 100644 index 0000000000..8a18eacc80 --- /dev/null +++ b/Tiles/FurnitureSacrilegious/SacrilegiousBenchTile.cs @@ -0,0 +1,47 @@ +using CalamityMod.Items.Placeables.FurnitureSacrilegious; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.GameContent; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; +namespace CalamityMod.Tiles.FurnitureSacrilegious +{ + public class SacrilegiousBenchTile : ModTile + { + public override void SetStaticDefaults() + { + this.SetUpSofa(true); + AddMapEntry(new Color(43, 19, 42), Language.GetText("Bench")); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 8, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 32, ModContent.ItemType()); + } + + public override void ModifySittingTargetInfo(int i, int j, ref TileRestingInfo info) => CalamityUtils.BenchSitInfo(i, j, ref info); + + public override bool RightClick(int i, int j) => CalamityUtils.ChairRightClick(i, j); + + public override void MouseOver(int i, int j) => CalamityUtils.BenchMouseOver(i, j, ModContent.ItemType()); + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) + { + return settings.player.IsWithinSnappngRangeToTile(i, j, PlayerSittingHelper.ChairSittingMaxDistance); + } + } +} diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousBenchTile.png b/Tiles/FurnitureSacrilegious/SacrilegiousBenchTile.png new file mode 100644 index 0000000000..a76bcc4862 Binary files /dev/null and b/Tiles/FurnitureSacrilegious/SacrilegiousBenchTile.png differ diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousBenchTile_Highlight.png b/Tiles/FurnitureSacrilegious/SacrilegiousBenchTile_Highlight.png new file mode 100644 index 0000000000..ce9a22ed6c Binary files /dev/null and b/Tiles/FurnitureSacrilegious/SacrilegiousBenchTile_Highlight.png differ diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousBookcaseTile.cs b/Tiles/FurnitureSacrilegious/SacrilegiousBookcaseTile.cs new file mode 100644 index 0000000000..ec4a805eaf --- /dev/null +++ b/Tiles/FurnitureSacrilegious/SacrilegiousBookcaseTile.cs @@ -0,0 +1,38 @@ +using CalamityMod.Items.Placeables.FurnitureSacrilegious; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureSacrilegious +{ + public class SacrilegiousBookcaseTile : ModTile + { + public override void SetStaticDefaults() + { + this.SetUpBookcase(true); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Bookcase"); + AddMapEntry(new Color(43, 19, 42), name); + AnimationFrameHeight = 54; + AdjTiles = new int[] { TileID.Bookcases }; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 8, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 32, ModContent.ItemType()); + } + } +} diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousBookcaseTile.png b/Tiles/FurnitureSacrilegious/SacrilegiousBookcaseTile.png new file mode 100644 index 0000000000..c0ce0cca32 Binary files /dev/null and b/Tiles/FurnitureSacrilegious/SacrilegiousBookcaseTile.png differ diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousCandelabraTile.cs b/Tiles/FurnitureSacrilegious/SacrilegiousCandelabraTile.cs new file mode 100644 index 0000000000..31aae3a65c --- /dev/null +++ b/Tiles/FurnitureSacrilegious/SacrilegiousCandelabraTile.cs @@ -0,0 +1,65 @@ +using CalamityMod.Items.Placeables.FurnitureSacrilegious; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureSacrilegious +{ + public class SacrilegiousCandelabraTile : ModTile + { + public override void SetStaticDefaults() + { + this.SetUpCandelabra(true); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Candelabra"); + AddMapEntry(new Color(43, 19, 42), name); + TileID.Sets.DisableSmartCursor[Type] = true; + AdjTiles = new int[] { TileID.Candelabras }; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 8, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].TileFrameX < 18) + { + r = 3f; + g = 0.6f; + b = 0.6f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 16, ModContent.ItemType()); + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 2, 2); + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + CalamityUtils.DrawFlameEffect(ModContent.Request("CalamityMod/Tiles/FurnitureSacrilegious/SacrilegiousCandelabraTileFlame").Value, i, j); + } + } +} diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousCandelabraTile.png b/Tiles/FurnitureSacrilegious/SacrilegiousCandelabraTile.png new file mode 100644 index 0000000000..f4db27c005 Binary files /dev/null and b/Tiles/FurnitureSacrilegious/SacrilegiousCandelabraTile.png differ diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousCandelabraTileFlame.png b/Tiles/FurnitureSacrilegious/SacrilegiousCandelabraTileFlame.png new file mode 100644 index 0000000000..db4ebe3a0d Binary files /dev/null and b/Tiles/FurnitureSacrilegious/SacrilegiousCandelabraTileFlame.png differ diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousCandleTile.cs b/Tiles/FurnitureSacrilegious/SacrilegiousCandleTile.cs new file mode 100644 index 0000000000..beff17db54 --- /dev/null +++ b/Tiles/FurnitureSacrilegious/SacrilegiousCandleTile.cs @@ -0,0 +1,75 @@ +using CalamityMod.Items.Placeables.FurnitureSacrilegious; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureSacrilegious +{ + public class SacrilegiousCandleTile : ModTile + { + public override void SetStaticDefaults() + { + this.SetUpCandle(true); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Candle"); + AddMapEntry(new Color(43, 19, 42), name); + TileID.Sets.DisableSmartCursor[Type] = true; + AdjTiles = new int[] { TileID.Candles }; + ItemDrop = ModContent.ItemType(); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 60, 0f, 0f, 1, new Color(255, 255, 255), 1f); + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 8, 0f, 0f, 1, new Color(100, 100, 100), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].TileFrameX < 18) + { + r = 3f; + g = 0.6f; + b = 0.6f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 1, 1); + } + + public override void MouseOver(int i, int j) + { + Player player = Main.LocalPlayer; + player.noThrow = 2; + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); + } + + public override bool RightClick(int i, int j) + { + CalamityUtils.RightClickBreak(i, j); + return true; + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + CalamityUtils.DrawFlameEffect(ModContent.Request("CalamityMod/Tiles/FurnitureSacrilegious/SacrilegiousCandleTileFlame").Value, i, j); + } + } +} diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousCandleTile.png b/Tiles/FurnitureSacrilegious/SacrilegiousCandleTile.png new file mode 100644 index 0000000000..99e7f4a8eb Binary files /dev/null and b/Tiles/FurnitureSacrilegious/SacrilegiousCandleTile.png differ diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousCandleTileFlame.png b/Tiles/FurnitureSacrilegious/SacrilegiousCandleTileFlame.png new file mode 100644 index 0000000000..438655e52d Binary files /dev/null and b/Tiles/FurnitureSacrilegious/SacrilegiousCandleTileFlame.png differ diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousChairTile.cs b/Tiles/FurnitureSacrilegious/SacrilegiousChairTile.cs new file mode 100644 index 0000000000..63b1dd860a --- /dev/null +++ b/Tiles/FurnitureSacrilegious/SacrilegiousChairTile.cs @@ -0,0 +1,49 @@ +using CalamityMod.Items.Placeables.FurnitureSacrilegious; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.GameContent; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureSacrilegious +{ + public class SacrilegiousChairTile : ModTile + { + public override void SetStaticDefaults() + { + this.SetUpChair(true); + AddMapEntry(new Color(43, 19, 42), Language.GetText("MapObject.Chair")); + AdjTiles = new int[] { TileID.Chairs }; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 8, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 32, ModContent.ItemType()); + } + + public override void ModifySittingTargetInfo(int i, int j, ref TileRestingInfo info) => CalamityUtils.ChairSitInfo(i, j, ref info); + + public override bool RightClick(int i, int j) => CalamityUtils.ChairRightClick(i, j); + + public override void MouseOver(int i, int j) => CalamityUtils.ChairMouseOver(i, j, ModContent.ItemType()); + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) + { + return settings.player.IsWithinSnappngRangeToTile(i, j, PlayerSittingHelper.ChairSittingMaxDistance); + } + } +} diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousChairTile.png b/Tiles/FurnitureSacrilegious/SacrilegiousChairTile.png new file mode 100644 index 0000000000..ee259ac301 Binary files /dev/null and b/Tiles/FurnitureSacrilegious/SacrilegiousChairTile.png differ diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousChairTile_Highlight.png b/Tiles/FurnitureSacrilegious/SacrilegiousChairTile_Highlight.png new file mode 100644 index 0000000000..75e9322bc7 Binary files /dev/null and b/Tiles/FurnitureSacrilegious/SacrilegiousChairTile_Highlight.png differ diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousChandelierTile.cs b/Tiles/FurnitureSacrilegious/SacrilegiousChandelierTile.cs new file mode 100644 index 0000000000..0461e20c8e --- /dev/null +++ b/Tiles/FurnitureSacrilegious/SacrilegiousChandelierTile.cs @@ -0,0 +1,64 @@ +using CalamityMod.Items.Placeables.FurnitureSacrilegious; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureSacrilegious +{ + public class SacrilegiousChandelierTile : ModTile + { + public override void SetStaticDefaults() + { + this.SetUpChandelier(true); + AddMapEntry(new Color(43, 19, 42), Language.GetText("MapObject.Chandelier")); + AdjTiles = new int[] { TileID.Chandeliers }; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 60, 0f, 0f, 1, new Color(255, 255, 255), 1f); + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 8, 0f, 0f, 1, new Color(100, 100, 100), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].TileFrameX < 18) + { + r = 3f; + g = 0.6f; + b = 0.6f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 48, 48, ModContent.ItemType()); + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 3, 3); + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + CalamityUtils.DrawFlameEffect(ModContent.Request("CalamityMod/Tiles/FurnitureSacrilegious/SacrilegiousChandelierTileFlame").Value, i, j); + } + } +} diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousChandelierTile.png b/Tiles/FurnitureSacrilegious/SacrilegiousChandelierTile.png new file mode 100644 index 0000000000..e6de2c0e0f Binary files /dev/null and b/Tiles/FurnitureSacrilegious/SacrilegiousChandelierTile.png differ diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousChandelierTileFlame.png b/Tiles/FurnitureSacrilegious/SacrilegiousChandelierTileFlame.png new file mode 100644 index 0000000000..011ab51438 Binary files /dev/null and b/Tiles/FurnitureSacrilegious/SacrilegiousChandelierTileFlame.png differ diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousChestTile.cs b/Tiles/FurnitureSacrilegious/SacrilegiousChestTile.cs new file mode 100644 index 0000000000..d23538635e --- /dev/null +++ b/Tiles/FurnitureSacrilegious/SacrilegiousChestTile.cs @@ -0,0 +1,142 @@ +using CalamityMod.Items.Placeables.FurnitureSacrilegious; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.FurnitureSacrilegious +{ + public class SacrilegiousChestTile : ModTile + { + public override void SetStaticDefaults() + { + this.SetUpChest(true); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Sacrilegious Chest"); + AddMapEntry(new Color(43, 19, 42), name, MapChestName); + TileID.Sets.DisableSmartCursor[Type] = true; + AdjTiles = new int[] { TileID.Containers }; + ContainerName.SetDefault("Sacrilegious Chest"); + ChestDrop = ModContent.ItemType(); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 8, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + + public string MapChestName(string name, int i, int j) => CalamityUtils.GetMapChestName(name, i, j); + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 32, 32, ChestDrop); + Chest.DestroyChest(i, j); + } + + public override bool RightClick(int i, int j) => CalamityUtils.ChestRightClick(i, j); + + public override void MouseOver(int i, int j) => CalamityUtils.ChestMouseOver("Sacrilegious Chest", i, j); + + public override void MouseOverFar(int i, int j) => CalamityUtils.ChestMouseFar("Sacrilegious Chest", i, j); + + // Make the chest brighter the more stuff it has + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + int seed = 1; + int itemAmt = 0; + int index = FindChestIndex(i, j, ref seed); + if (index >= 0) + itemAmt = CountItems(Main.chest[index]); + + Tile tile = Main.tile[i, j]; + Texture2D texture = ModContent.Request("CalamityMod/Tiles/FurnitureSacrilegious/SacrilegiousChestTileGlow").Value; + + int x = i; + int y = j; + switch (seed) + { + case 2: + y = j - 1; + break; + case 3: + x = i - 1; + break; + case 4: + x = i - 1; + y = j - 1; + break; + } + ulong seeding = Main.TileFrameSeed ^ (ulong)((long)y << 32 | (long)(uint)x); + + int yOffset = TileObjectData.GetTileData(tile).DrawYOffset; + Vector2 drawOffset = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange, Main.offScreenRange); + Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y + yOffset) + drawOffset; + + int alpha = 255 - (int)(MathHelper.Lerp(0, 7, itemAmt / 40f) * 15); + Color color = new Color(120, 100, 100, alpha); + + int loopAmt = itemAmt > 0 ? (itemAmt - 1) / 10 + 4 : 4; + float shakeAmt = MathHelper.Lerp(0f, 0.3f, itemAmt / 40f); + if (itemAmt == 0) + loopAmt = 0; + + for (int c = 0; c < loopAmt; c++) + { + float shakeX = Utils.RandomInt(ref seeding, -5, 5) * shakeAmt; + float shakeY = Utils.RandomInt(ref seeding, -5, 5) * shakeAmt; + Vector2 shake = new Vector2(shakeX, shakeY); + spriteBatch.Draw(texture, drawPosition + shake, new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16), color, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + } + } + + private int FindChestIndex(int i, int j, ref int seed) + { + int index = Chest.FindChest(i, j); + if (index < 0 && Main.tile[i, j - 1].TileType == ModContent.TileType()) + { + index = Chest.FindChest(i, j - 1); + seed = 2; + } + if (index < 0 && Main.tile[i - 1, j].TileType == ModContent.TileType()) + { + index = Chest.FindChest(i - 1, j); + seed = 3; + } + if (index < 0 && Main.tile[i - 1, j - 1].TileType == ModContent.TileType()) + { + index = Chest.FindChest(i - 1, j - 1); + seed = 4; + } + return index; + } + + private int CountItems(Chest chest) + { + if (chest is null) + return -1; + int amt = 0; + for (int i = 0; i < Chest.maxItems; i++) + { + if (chest.item[i].IsAir) + continue; + if (chest.item[i].stack > 0) + amt++; + } + return amt; + } + + byte Average(byte a, byte b) => (byte)((a + b) / 2); + } +} diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousChestTile.png b/Tiles/FurnitureSacrilegious/SacrilegiousChestTile.png new file mode 100644 index 0000000000..75819eef0a Binary files /dev/null and b/Tiles/FurnitureSacrilegious/SacrilegiousChestTile.png differ diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousChestTileGlow.png b/Tiles/FurnitureSacrilegious/SacrilegiousChestTileGlow.png new file mode 100644 index 0000000000..ca0b29c687 Binary files /dev/null and b/Tiles/FurnitureSacrilegious/SacrilegiousChestTileGlow.png differ diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousChestTile_Highlight.png b/Tiles/FurnitureSacrilegious/SacrilegiousChestTile_Highlight.png new file mode 100644 index 0000000000..8d35eb3fc0 Binary files /dev/null and b/Tiles/FurnitureSacrilegious/SacrilegiousChestTile_Highlight.png differ diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousClockTile.cs b/Tiles/FurnitureSacrilegious/SacrilegiousClockTile.cs new file mode 100644 index 0000000000..f05b6000f6 --- /dev/null +++ b/Tiles/FurnitureSacrilegious/SacrilegiousClockTile.cs @@ -0,0 +1,89 @@ +using CalamityMod.Items.Placeables.FurnitureSacrilegious; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.DataStructures; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureSacrilegious +{ + public class SacrilegiousClockTile : ModTile + { + public override void SetStaticDefaults() + { + // This particular clock emits light + Main.tileLighted[Type] = true; + AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); + + this.SetUpClock(true); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Grandfather Clock"); + AddMapEntry(new Color(43, 19, 42), name); + AdjTiles = new int[] { TileID.GrandfatherClocks }; + } + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 60, 0f, 0f, 1, new Color(255, 255, 255), 1f); + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 8, 0f, 0f, 1, new Color(100, 100, 100), 1f); + return false; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + r = 1.2f; + g = 0.2f; + b = 0.2f; + } + + public override bool RightClick(int x, int y) => CalamityUtils.ClockRightClick(); + + public override void NearbyEffects(int i, int j, bool closer) + { + if (closer) + { + Main.SceneMetrics.HasClock = true; + } + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 48, 32, ModContent.ItemType()); + } + + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); + + // For drawing the floating clock icon + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + Texture2D texture = ModContent.Request("CalamityMod/Tiles/FurnitureSacrilegious/SacrilegiousClockTile_Icon").Value; + Tile tile = Main.tile[i, j]; + int xPos = tile.TileFrameX; + int yPos = tile.TileFrameY; + + Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + float yOffset = (float)Math.Sin(Main.GlobalTimeWrappedHourly * MathHelper.TwoPi / 5f) * 2f; + Vector2 correction = new Vector2(16f , -10f); + Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y + yOffset) + zero + correction; + + Rectangle rect = new Rectangle(xPos, yPos, texture.Width, texture.Height); + Color color = new Color(100, 100, 100, 0); + Vector2 origin = rect.Size() / 2f; + + for (int c = 0; c < 5; c++) + { + spriteBatch.Draw(texture, drawOffset, rect, color, 0f, origin, 1f, SpriteEffects.None, 0f); + } + } + } +} diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousClockTile.png b/Tiles/FurnitureSacrilegious/SacrilegiousClockTile.png new file mode 100644 index 0000000000..c93b433bb5 Binary files /dev/null and b/Tiles/FurnitureSacrilegious/SacrilegiousClockTile.png differ diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousClockTile_Highlight.png b/Tiles/FurnitureSacrilegious/SacrilegiousClockTile_Highlight.png new file mode 100644 index 0000000000..c2c3327463 Binary files /dev/null and b/Tiles/FurnitureSacrilegious/SacrilegiousClockTile_Highlight.png differ diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousClockTile_Icon.png b/Tiles/FurnitureSacrilegious/SacrilegiousClockTile_Icon.png new file mode 100644 index 0000000000..9ecc8b875a Binary files /dev/null and b/Tiles/FurnitureSacrilegious/SacrilegiousClockTile_Icon.png differ diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousDoorClosed.cs b/Tiles/FurnitureSacrilegious/SacrilegiousDoorClosed.cs new file mode 100644 index 0000000000..93ba36bb19 --- /dev/null +++ b/Tiles/FurnitureSacrilegious/SacrilegiousDoorClosed.cs @@ -0,0 +1,49 @@ +using CalamityMod.Items.Placeables.FurnitureSacrilegious; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureSacrilegious +{ + public class SacrilegiousDoorClosed : ModTile + { + public override void SetStaticDefaults() + { + this.SetUpDoorClosed(true); + AddMapEntry(new Color(43, 19, 42), Language.GetText("MapObject.Door")); + TileID.Sets.DisableSmartCursor[Type] = true; + AdjTiles = new int[] { TileID.ClosedDoor }; + OpenDoorID = ModContent.TileType(); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 8, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 48, ModContent.ItemType()); + } + + public override void MouseOver(int i, int j) + { + Player player = Main.LocalPlayer; + player.noThrow = 2; + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); + } + } +} diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousDoorClosed.png b/Tiles/FurnitureSacrilegious/SacrilegiousDoorClosed.png new file mode 100644 index 0000000000..654eb795a6 Binary files /dev/null and b/Tiles/FurnitureSacrilegious/SacrilegiousDoorClosed.png differ diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousDoorClosed_Highlight.png b/Tiles/FurnitureSacrilegious/SacrilegiousDoorClosed_Highlight.png new file mode 100644 index 0000000000..ec755e7d84 Binary files /dev/null and b/Tiles/FurnitureSacrilegious/SacrilegiousDoorClosed_Highlight.png differ diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousDoorOpen.cs b/Tiles/FurnitureSacrilegious/SacrilegiousDoorOpen.cs new file mode 100644 index 0000000000..f46fba7130 --- /dev/null +++ b/Tiles/FurnitureSacrilegious/SacrilegiousDoorOpen.cs @@ -0,0 +1,49 @@ +using CalamityMod.Items.Placeables.FurnitureSacrilegious; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureSacrilegious +{ + public class SacrilegiousDoorOpen : ModTile + { + public override void SetStaticDefaults() + { + this.SetUpDoorOpen(true); + AddMapEntry(new Color(43, 19, 42), Language.GetText("MapObject.Door")); + TileID.Sets.DisableSmartCursor[Type] = true; + AdjTiles = new int[] { TileID.OpenDoor }; + CloseDoorID = ModContent.TileType(); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 8, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 32, 48, ModContent.ItemType()); + } + + public override void MouseOver(int i, int j) + { + Player player = Main.LocalPlayer; + player.noThrow = 2; + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); + } + } +} diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousDoorOpen.png b/Tiles/FurnitureSacrilegious/SacrilegiousDoorOpen.png new file mode 100644 index 0000000000..9062c72eba Binary files /dev/null and b/Tiles/FurnitureSacrilegious/SacrilegiousDoorOpen.png differ diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousDoorOpen_Highlight.png b/Tiles/FurnitureSacrilegious/SacrilegiousDoorOpen_Highlight.png new file mode 100644 index 0000000000..be4f5e487d Binary files /dev/null and b/Tiles/FurnitureSacrilegious/SacrilegiousDoorOpen_Highlight.png differ diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousDresserTile.cs b/Tiles/FurnitureSacrilegious/SacrilegiousDresserTile.cs new file mode 100644 index 0000000000..745f60cc53 --- /dev/null +++ b/Tiles/FurnitureSacrilegious/SacrilegiousDresserTile.cs @@ -0,0 +1,50 @@ +using CalamityMod.Items.Placeables.FurnitureSacrilegious; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureSacrilegious +{ + public class SacrilegiousDresserTile : ModTile + { + public override void SetStaticDefaults() + { + this.SetUpDresser(); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Sacrilegious Dresser"); + AddMapEntry(new Color(43, 19, 42), name); + TileID.Sets.DisableSmartCursor[Type] = true; + AdjTiles = new int[] { TileID.Dressers }; + ContainerName.SetDefault("Sacrilegious Dresser"); + DresserDrop = ModContent.ItemType(); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 8, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + + public override bool RightClick(int i, int j) => CalamityUtils.DresserRightClick(); + + public override void MouseOverFar(int i, int j) => CalamityUtils.DresserMouseFar(ContainerName.GetDefault()); + + public override void MouseOver(int i, int j) => CalamityUtils.DresserMouseOver(ContainerName.GetDefault()); + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 48, 32, DresserDrop); + Chest.DestroyChest(i, j); + } + } +} diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousDresserTile.png b/Tiles/FurnitureSacrilegious/SacrilegiousDresserTile.png new file mode 100644 index 0000000000..14960e9c94 Binary files /dev/null and b/Tiles/FurnitureSacrilegious/SacrilegiousDresserTile.png differ diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousDresserTile_Highlight.png b/Tiles/FurnitureSacrilegious/SacrilegiousDresserTile_Highlight.png new file mode 100644 index 0000000000..04c961ac2e Binary files /dev/null and b/Tiles/FurnitureSacrilegious/SacrilegiousDresserTile_Highlight.png differ diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousLampTile.cs b/Tiles/FurnitureSacrilegious/SacrilegiousLampTile.cs new file mode 100644 index 0000000000..23ec23c32c --- /dev/null +++ b/Tiles/FurnitureSacrilegious/SacrilegiousLampTile.cs @@ -0,0 +1,66 @@ +using CalamityMod.Items.Placeables.FurnitureSacrilegious; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureSacrilegious +{ + public class SacrilegiousLampTile : ModTile + { + public override void SetStaticDefaults() + { + this.SetUpLamp(true); + AddMapEntry(new Color(43, 19, 42), Language.GetText("MapObject.FloorLamp")); + + TileID.Sets.DisableSmartCursor[Type] = true; + AdjTiles = new int[] { TileID.Lamps }; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 60, 0f, 0f, 1, new Color(255, 255, 255), 1f); + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 8, 0f, 0f, 1, new Color(100, 100, 100), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 32, ModContent.ItemType()); + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].TileFrameX < 18) + { + r = 3f; + g = 0.6f; + b = 0.6f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 1, 3); + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + CalamityUtils.DrawFlameEffect(ModContent.Request("CalamityMod/Tiles/FurnitureSacrilegious/SacrilegiousLampTileFlame").Value, i, j); + } + } +} diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousLampTile.png b/Tiles/FurnitureSacrilegious/SacrilegiousLampTile.png new file mode 100644 index 0000000000..8b5026f797 Binary files /dev/null and b/Tiles/FurnitureSacrilegious/SacrilegiousLampTile.png differ diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousLampTileFlame.png b/Tiles/FurnitureSacrilegious/SacrilegiousLampTileFlame.png new file mode 100644 index 0000000000..541962150f Binary files /dev/null and b/Tiles/FurnitureSacrilegious/SacrilegiousLampTileFlame.png differ diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousLanternTile.cs b/Tiles/FurnitureSacrilegious/SacrilegiousLanternTile.cs new file mode 100644 index 0000000000..670f63ac24 --- /dev/null +++ b/Tiles/FurnitureSacrilegious/SacrilegiousLanternTile.cs @@ -0,0 +1,66 @@ +using CalamityMod.Items.Placeables.FurnitureSacrilegious; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureSacrilegious +{ + public class SacrilegiousLanternTile : ModTile + { + public override void SetStaticDefaults() + { + this.SetUpLantern(true); + AddMapEntry(new Color(43, 19, 42), Language.GetText("MapObject.Lantern")); + + TileID.Sets.DisableSmartCursor[Type] = true; + AdjTiles = new int[] { TileID.HangingLanterns }; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 60, 0f, 0f, 1, new Color(255, 255, 255), 1f); + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 8, 0f, 0f, 1, new Color(100, 100, 100), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 32, ModContent.ItemType()); + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].TileFrameX < 18) + { + r = 3f; + g = 0.6f; + b = 0.6f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 1, 2); + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + CalamityUtils.DrawFlameEffect(ModContent.Request("CalamityMod/Tiles/FurnitureSacrilegious/SacrilegiousLanternTileFlame").Value, i, j); + } + } +} diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousLanternTile.png b/Tiles/FurnitureSacrilegious/SacrilegiousLanternTile.png new file mode 100644 index 0000000000..452adc7ba9 Binary files /dev/null and b/Tiles/FurnitureSacrilegious/SacrilegiousLanternTile.png differ diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousLanternTileFlame.png b/Tiles/FurnitureSacrilegious/SacrilegiousLanternTileFlame.png new file mode 100644 index 0000000000..07a92d066e Binary files /dev/null and b/Tiles/FurnitureSacrilegious/SacrilegiousLanternTileFlame.png differ diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousOrganTile.cs b/Tiles/FurnitureSacrilegious/SacrilegiousOrganTile.cs new file mode 100644 index 0000000000..54fed773ba --- /dev/null +++ b/Tiles/FurnitureSacrilegious/SacrilegiousOrganTile.cs @@ -0,0 +1,43 @@ +using CalamityMod.Items.Placeables.FurnitureSacrilegious; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.FurnitureSacrilegious +{ + public class SacrilegiousOrganTile : ModTile + { + public override void SetStaticDefaults() + { + Main.tileLighted[Type] = true; + Main.tileFrameImportant[Type] = true; + Main.tileLavaDeath[Type] = false; + TileObjectData.newTile.CopyFrom(TileObjectData.Style3x4); //This piano has bookcase dimensions + TileObjectData.newTile.LavaDeath = false; + TileObjectData.addTile(Type); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Piano"); + AddMapEntry(new Color(43, 19, 42), name); + AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 8, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 32, ModContent.ItemType()); + } + } +} diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousOrganTile.png b/Tiles/FurnitureSacrilegious/SacrilegiousOrganTile.png new file mode 100644 index 0000000000..f73bf03b47 Binary files /dev/null and b/Tiles/FurnitureSacrilegious/SacrilegiousOrganTile.png differ diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousSinkTile.cs b/Tiles/FurnitureSacrilegious/SacrilegiousSinkTile.cs new file mode 100644 index 0000000000..11f0066b67 --- /dev/null +++ b/Tiles/FurnitureSacrilegious/SacrilegiousSinkTile.cs @@ -0,0 +1,36 @@ +using CalamityMod.Items.Placeables.FurnitureSacrilegious; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureSacrilegious +{ + public class SacrilegiousSinkTile : ModTile + { + public override void SetStaticDefaults() + { + this.SetUpSink(true, true, true, true); + AddMapEntry(new Color(43, 19, 42), Language.GetText("MapObject.Sink")); + AdjTiles = new int[] { TileID.Sinks }; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 8, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 32, ModContent.ItemType()); + } + } +} diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousSinkTile.png b/Tiles/FurnitureSacrilegious/SacrilegiousSinkTile.png new file mode 100644 index 0000000000..20c78423fb Binary files /dev/null and b/Tiles/FurnitureSacrilegious/SacrilegiousSinkTile.png differ diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousTableTile.cs b/Tiles/FurnitureSacrilegious/SacrilegiousTableTile.cs new file mode 100644 index 0000000000..bde5bec3bf --- /dev/null +++ b/Tiles/FurnitureSacrilegious/SacrilegiousTableTile.cs @@ -0,0 +1,36 @@ +using CalamityMod.Items.Placeables.FurnitureSacrilegious; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureSacrilegious +{ + public class SacrilegiousTableTile : ModTile + { + public override void SetStaticDefaults() + { + this.SetUpTable(true); + AddMapEntry(new Color(43, 19, 42), Language.GetText("MapObject.Table")); + AdjTiles = new int[] { TileID.Tables }; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 8, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 16, 32, ModContent.ItemType()); + } + } +} diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousTableTile.png b/Tiles/FurnitureSacrilegious/SacrilegiousTableTile.png new file mode 100644 index 0000000000..c692ef71b7 Binary files /dev/null and b/Tiles/FurnitureSacrilegious/SacrilegiousTableTile.png differ diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousWorkBenchTile.cs b/Tiles/FurnitureSacrilegious/SacrilegiousWorkBenchTile.cs new file mode 100644 index 0000000000..389f316257 --- /dev/null +++ b/Tiles/FurnitureSacrilegious/SacrilegiousWorkBenchTile.cs @@ -0,0 +1,38 @@ +using CalamityMod.Items.Placeables.FurnitureSacrilegious; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureSacrilegious +{ + public class SacrilegiousWorkBenchTile : ModTile + { + public override void SetStaticDefaults() + { + this.SetUpWorkBench(true); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Work Bench"); + AddMapEntry(new Color(43, 19, 42), name); + TileID.Sets.DisableSmartCursor[Type] = true; + AdjTiles = new int[] { TileID.WorkBenches }; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 8, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 32, 16, ModContent.ItemType()); + } + } +} diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousWorkBenchTile.png b/Tiles/FurnitureSacrilegious/SacrilegiousWorkBenchTile.png new file mode 100644 index 0000000000..63317869ba Binary files /dev/null and b/Tiles/FurnitureSacrilegious/SacrilegiousWorkBenchTile.png differ diff --git a/Tiles/FurnitureSilva/SilvaBed.cs b/Tiles/FurnitureSilva/SilvaBed.cs index fee7a8b199..41d4f99f46 100644 --- a/Tiles/FurnitureSilva/SilvaBed.cs +++ b/Tiles/FurnitureSilva/SilvaBed.cs @@ -38,17 +38,8 @@ namespace CalamityMod.Tiles.FurnitureSilva Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 64, 32, ModContent.ItemType()); } - public override bool RightClick(int i, int j) - { - return CalamityUtils.BedRightClick(i, j); - } + public override bool RightClick(int i, int j) => CalamityUtils.BedRightClick(i, j); - public override void MouseOver(int i, int j) - { - Player player = Main.LocalPlayer; - player.noThrow = 2; - player.cursorItemIconEnabled = true; - player.cursorItemIconID = ModContent.ItemType(); - } + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); } } diff --git a/Tiles/FurnitureSilva/SilvaBench.cs b/Tiles/FurnitureSilva/SilvaBench.cs index 15703a5ee3..353e3ca104 100644 --- a/Tiles/FurnitureSilva/SilvaBench.cs +++ b/Tiles/FurnitureSilva/SilvaBench.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Tiles.FurnitureSilva public override void SetStaticDefaults() { this.SetUpSofa(true); - AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Bench")); + AddMapEntry(new Color(191, 142, 111), Language.GetText("Bench")); } public override bool CreateDust(int i, int j, ref int type) diff --git a/Tiles/FurnitureSilva/SilvaClock.cs b/Tiles/FurnitureSilva/SilvaClock.cs index 107891e975..4540d2e446 100644 --- a/Tiles/FurnitureSilva/SilvaClock.cs +++ b/Tiles/FurnitureSilva/SilvaClock.cs @@ -50,5 +50,7 @@ namespace CalamityMod.Tiles.FurnitureSilva { Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 48, 32, ModContent.ItemType()); } + + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); } } diff --git a/Tiles/FurnitureStatigel/StatigelBed.cs b/Tiles/FurnitureStatigel/StatigelBed.cs index d786759cc1..8fa445c1f7 100644 --- a/Tiles/FurnitureStatigel/StatigelBed.cs +++ b/Tiles/FurnitureStatigel/StatigelBed.cs @@ -36,17 +36,8 @@ namespace CalamityMod.Tiles.FurnitureStatigel Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 64, 32, ModContent.ItemType()); } - public override bool RightClick(int i, int j) - { - return CalamityUtils.BedRightClick(i, j); - } + public override bool RightClick(int i, int j) => CalamityUtils.BedRightClick(i, j); - public override void MouseOver(int i, int j) - { - Player player = Main.LocalPlayer; - player.noThrow = 2; - player.cursorItemIconEnabled = true; - player.cursorItemIconID = ModContent.ItemType(); - } + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); } } diff --git a/Tiles/FurnitureStatigel/StatigelClock.cs b/Tiles/FurnitureStatigel/StatigelClock.cs index a9dfc73347..f0d184e781 100644 --- a/Tiles/FurnitureStatigel/StatigelClock.cs +++ b/Tiles/FurnitureStatigel/StatigelClock.cs @@ -48,5 +48,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel { Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 48, 32, ModContent.ItemType()); } + + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); } } diff --git a/Tiles/FurnitureStatigel/StatigelSofa.cs b/Tiles/FurnitureStatigel/StatigelSofa.cs index 64cdfea4e2..47a7651ead 100644 --- a/Tiles/FurnitureStatigel/StatigelSofa.cs +++ b/Tiles/FurnitureStatigel/StatigelSofa.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Tiles.FurnitureStatigel public override void SetStaticDefaults() { this.SetUpSofa(); - AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Bench")); + AddMapEntry(new Color(191, 142, 111), Language.GetText("Bench")); } public override bool CreateDust(int i, int j, ref int type) diff --git a/Tiles/FurnitureStratus/StratusBed.cs b/Tiles/FurnitureStratus/StratusBed.cs index 74a3044499..58a3a0ee4d 100644 --- a/Tiles/FurnitureStratus/StratusBed.cs +++ b/Tiles/FurnitureStratus/StratusBed.cs @@ -37,17 +37,8 @@ namespace CalamityMod.Tiles.FurnitureStratus Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 64, 32, ModContent.ItemType()); } - public override bool RightClick(int i, int j) - { - return CalamityUtils.BedRightClick(i, j); - } + public override bool RightClick(int i, int j) => CalamityUtils.BedRightClick(i, j); - public override void MouseOver(int i, int j) - { - Player player = Main.LocalPlayer; - player.noThrow = 2; - player.cursorItemIconEnabled = true; - player.cursorItemIconID = ModContent.ItemType(); - } + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); } } diff --git a/Tiles/FurnitureStratus/StratusClock.cs b/Tiles/FurnitureStratus/StratusClock.cs index 808455dd45..9a5bc0db6e 100644 --- a/Tiles/FurnitureStratus/StratusClock.cs +++ b/Tiles/FurnitureStratus/StratusClock.cs @@ -49,5 +49,7 @@ namespace CalamityMod.Tiles.FurnitureStratus { Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 48, 32, ModContent.ItemType()); } + + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); } } diff --git a/Tiles/FurnitureStratus/StratusSofa.cs b/Tiles/FurnitureStratus/StratusSofa.cs index 3297431bb4..b73764ffb3 100644 --- a/Tiles/FurnitureStratus/StratusSofa.cs +++ b/Tiles/FurnitureStratus/StratusSofa.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Tiles.FurnitureStratus public override void SetStaticDefaults() { this.SetUpSofa(true); - AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Bench")); + AddMapEntry(new Color(191, 142, 111), Language.GetText("Bench")); } public override bool CreateDust(int i, int j, ref int type) diff --git a/Tiles/FurnitureVoid/VoidBed.cs b/Tiles/FurnitureVoid/VoidBed.cs index 06acc713cf..5cf6656fb7 100644 --- a/Tiles/FurnitureVoid/VoidBed.cs +++ b/Tiles/FurnitureVoid/VoidBed.cs @@ -36,17 +36,8 @@ namespace CalamityMod.Tiles.FurnitureVoid Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 64, 32, ModContent.ItemType()); } - public override bool RightClick(int i, int j) - { - return CalamityUtils.BedRightClick(i, j); - } + public override bool RightClick(int i, int j) => CalamityUtils.BedRightClick(i, j); - public override void MouseOver(int i, int j) - { - Player player = Main.LocalPlayer; - player.noThrow = 2; - player.cursorItemIconEnabled = true; - player.cursorItemIconID = ModContent.ItemType(); - } + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); } } diff --git a/Tiles/FurnitureVoid/VoidClock.cs b/Tiles/FurnitureVoid/VoidClock.cs index de424aee3e..4991c370de 100644 --- a/Tiles/FurnitureVoid/VoidClock.cs +++ b/Tiles/FurnitureVoid/VoidClock.cs @@ -59,5 +59,7 @@ namespace CalamityMod.Tiles.FurnitureVoid { Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 48, 32, ModContent.ItemType()); } + + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); } } diff --git a/Tiles/FurnitureVoid/VoidSofa.cs b/Tiles/FurnitureVoid/VoidSofa.cs index c3fc8deb1e..a1a206c145 100644 --- a/Tiles/FurnitureVoid/VoidSofa.cs +++ b/Tiles/FurnitureVoid/VoidSofa.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Tiles.FurnitureVoid public override void SetStaticDefaults() { this.SetUpSofa(true); - AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Bench")); + AddMapEntry(new Color(191, 142, 111), Language.GetText("Bench")); } public override bool CreateDust(int i, int j, ref int type) diff --git a/Tiles/Ores/AerialiteOre.cs b/Tiles/Ores/AerialiteOre.cs index 52a4d08ac2..b35e5024cd 100644 --- a/Tiles/Ores/AerialiteOre.cs +++ b/Tiles/Ores/AerialiteOre.cs @@ -15,6 +15,9 @@ namespace CalamityMod.Tiles.Ores Main.tileMergeDirt[Type] = true; Main.tileBlockLight[Type] = true; + TileID.Sets.Ore[Type] = true; + TileID.Sets.OreMergesWithMud[Type] = true; + CalamityUtils.MergeWithGeneral(Type); ItemDrop = ModContent.ItemType(); ModTranslation name = CreateMapEntryName(); diff --git a/Tiles/Ores/AstralOre.cs b/Tiles/Ores/AstralOre.cs index 78b2eb5e33..3237365afd 100644 --- a/Tiles/Ores/AstralOre.cs +++ b/Tiles/Ores/AstralOre.cs @@ -21,6 +21,9 @@ namespace CalamityMod.Tiles.Ores CalamityUtils.MergeWithGeneral(Type); CalamityUtils.MergeAstralTiles(Type); + TileID.Sets.Ore[Type] = true; + TileID.Sets.OreMergesWithMud[Type] = true; + MinPick = 210; DustType = 173; ItemDrop = ModContent.ItemType(); diff --git a/Tiles/Ores/AuricOre.cs b/Tiles/Ores/AuricOre.cs index e11e894063..632b616dc0 100644 --- a/Tiles/Ores/AuricOre.cs +++ b/Tiles/Ores/AuricOre.cs @@ -18,6 +18,9 @@ namespace CalamityMod.Tiles.Ores CalamityUtils.MergeWithGeneral(Type); + TileID.Sets.Ore[Type] = true; + TileID.Sets.OreMergesWithMud[Type] = true; + DustType = 55; ItemDrop = ModContent.ItemType(); ModTranslation name = CreateMapEntryName(); diff --git a/Tiles/Ores/ChaoticOre.cs b/Tiles/Ores/ChaoticOre.cs index 774a192afd..a78a100c17 100644 --- a/Tiles/Ores/ChaoticOre.cs +++ b/Tiles/Ores/ChaoticOre.cs @@ -20,6 +20,8 @@ namespace CalamityMod.Tiles.Ores CalamityUtils.MergeWithGeneral(Type); CalamityUtils.MergeWithAbyss(Type); + TileID.Sets.Ore[Type] = true; + DustType = 105; ItemDrop = ModContent.ItemType(); ModTranslation name = CreateMapEntryName(); diff --git a/Tiles/Ores/CharredOre.cs b/Tiles/Ores/CharredOre.cs index 7fac5544ed..532653c361 100644 --- a/Tiles/Ores/CharredOre.cs +++ b/Tiles/Ores/CharredOre.cs @@ -21,6 +21,8 @@ namespace CalamityMod.Tiles.Ores CalamityUtils.MergeWithGeneral(Type); CalamityUtils.MergeWithHell(Type); + TileID.Sets.Ore[Type] = true; + ItemDrop = ModContent.ItemType(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Charred Ore"); diff --git a/Tiles/Ores/CryonicOre.cs b/Tiles/Ores/CryonicOre.cs index 3029781827..456e23b51e 100644 --- a/Tiles/Ores/CryonicOre.cs +++ b/Tiles/Ores/CryonicOre.cs @@ -17,6 +17,8 @@ namespace CalamityMod.Tiles.Ores CalamityUtils.MergeWithGeneral(Type); CalamityUtils.MergeWithSnow(Type); + TileID.Sets.Ore[Type] = true; + ItemDrop = ModContent.ItemType(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Cryonic"); diff --git a/Tiles/Ores/ExodiumOre.cs b/Tiles/Ores/ExodiumOre.cs index 8a6a892d06..6238cb575f 100644 --- a/Tiles/Ores/ExodiumOre.cs +++ b/Tiles/Ores/ExodiumOre.cs @@ -17,6 +17,9 @@ namespace CalamityMod.Tiles.Ores CalamityUtils.MergeWithGeneral(Type); CalamityUtils.MergeWithSet(Type, TileID.LunarOre); + TileID.Sets.Ore[Type] = true; + TileID.Sets.OreMergesWithMud[Type] = true; + ModTranslation name = CreateMapEntryName(); name.SetDefault("Exodium"); AddMapEntry(new Color(51, 48, 68), name); diff --git a/Tiles/Ores/HallowedOre.cs b/Tiles/Ores/HallowedOre.cs index 1f78592ca8..889a46d151 100644 --- a/Tiles/Ores/HallowedOre.cs +++ b/Tiles/Ores/HallowedOre.cs @@ -15,6 +15,9 @@ namespace CalamityMod.Tiles.Ores Main.tileBlockLight[Type] = true; Main.tileOreFinderPriority[Type] = 690; + TileID.Sets.Ore[Type] = true; + TileID.Sets.OreMergesWithMud[Type] = true; + CalamityUtils.MergeWithGeneral(Type); ItemDrop = ModContent.ItemType(); ModTranslation name = CreateMapEntryName(); diff --git a/Tiles/Ores/PerennialOre.cs b/Tiles/Ores/PerennialOre.cs index eea95a35de..20c7dec5ee 100644 --- a/Tiles/Ores/PerennialOre.cs +++ b/Tiles/Ores/PerennialOre.cs @@ -18,6 +18,9 @@ namespace CalamityMod.Tiles.Ores CalamityUtils.MergeWithGeneral(Type); + TileID.Sets.Ore[Type] = true; + TileID.Sets.OreMergesWithMud[Type] = true; + ItemDrop = ModContent.ItemType(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Perennial Ore"); diff --git a/Tiles/Ores/UelibloomOre.cs b/Tiles/Ores/UelibloomOre.cs index c4b99b9a00..a71244560b 100644 --- a/Tiles/Ores/UelibloomOre.cs +++ b/Tiles/Ores/UelibloomOre.cs @@ -16,6 +16,9 @@ namespace CalamityMod.Tiles.Ores CalamityUtils.MergeWithGeneral(Type); + TileID.Sets.Ore[Type] = true; + TileID.Sets.OreMergesWithMud[Type] = true; + ItemDrop = ModContent.ItemType(); ModTranslation name = CreateMapEntryName(); name.SetDefault("Uelibloom"); diff --git a/UI/CalamitasEnchantments/EnchantmentManager.cs b/UI/CalamitasEnchantments/EnchantmentManager.cs index cd7ebf8c6d..ca9924f527 100644 --- a/UI/CalamitasEnchantments/EnchantmentManager.cs +++ b/UI/CalamitasEnchantments/EnchantmentManager.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Accessories; using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Summon; using CalamityMod.NPCs.Other; using CalamityMod.Projectiles.Melee; @@ -196,7 +197,8 @@ namespace CalamityMod.UI.CalamitasEnchants "CalamityMod/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Ephemeral", null, player => player.Calamity().dischargingItemEnchant = true, - item => item.IsEnchantable() && item.damage > 0 && !item.CountsAsClass() && !item.channel && !item.CountsAsClass()), + item => item.IsEnchantable() && item.damage > 0 && !item.CountsAsClass() && !item.CountsAsClass() && + !item.channel && item.type != ModContent.ItemType()), new Enchantment("Hellbound", "Causes minions to be created with a 40 second timer.\nOnce it runs out, they explode violently. Minions do more damage the longer they live and idly explode as well.", 700, diff --git a/Utilities/DropHelper.cs b/Utilities/DropHelper.cs index d4eba69434..fef4dc5ebf 100644 --- a/Utilities/DropHelper.cs +++ b/Utilities/DropHelper.cs @@ -9,6 +9,7 @@ using Terraria; using Terraria.DataStructures; using Terraria.GameContent.ItemDropRules; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; using Terraria.Utilities; @@ -110,6 +111,17 @@ namespace CalamityMod public static readonly Fraction BagWeaponDropRateFraction = new(1, BagWeaponDropRateInt); #endregion + #region Bestiary Text + public static string FirstKillText = "Drops only on the first kill"; + public static string BloodMoonText = "Drops during the Blood Moon"; + public static string MechBossText = "Drops on the first kill of the final Mechanical Boss"; + public static string SentinelText = "Drops on the first kill of the final Sentinel of the Devourer"; + public static string ProvidenceHallowText = "Drops if Providence was summoned in the Hallow\nor if Providence is only attacked during nighttime"; + public static string ProvidenceUnderworldText = "Drops if Providence was summoned in the Underworld\nor if Providence is only attacked during nighttime"; + public static string ProvidenceNightText = "Drops if Providence is only attacked during nighttime"; + public static string ProvidenceChallengeText = "Drops if Providence was defeated only with the Profaned Soul Artifact"; + #endregion + #region Block Drops private static int[] AllLoadedItemIDs = null; @@ -222,10 +234,12 @@ namespace CalamityMod /// The ILoot interface for the loot table. /// A lambda which evaluates in real-time to the condition that needs to be checked. /// The item ID to drop. + /// Whether drops registered with this condition appear in the Bestiary. Defaults to true. + /// The description of this condition in the Bestiary. Defaults to null. /// A LeadingConditionRule which you can attach more PerPlayer or other rules to as you want. - public static LeadingConditionRule AddConditionalPerPlayer(this ILoot loot, Func lambda, int itemID) + public static LeadingConditionRule AddConditionalPerPlayer(this ILoot loot, Func lambda, int itemID, bool ui = true, string desc = null) { - LeadingConditionRule lcr = new(If(lambda)); + LeadingConditionRule lcr = new(If(lambda, ui, desc)); lcr.Add(PerPlayer(itemID)); loot.Add(lcr); return lcr; @@ -238,10 +252,12 @@ namespace CalamityMod /// The ILoot interface for the loot table. /// A lambda which evaluates in real-time to the condition that needs to be checked. /// The item ID to drop. + /// Whether drops registered with this condition appear in the Bestiary. Defaults to true. + /// The description of this condition in the Bestiary. Defaults to null. /// A LeadingConditionRule which you can attach more PerPlayer or other rules to as you want. - public static LeadingConditionRule AddConditionalPerPlayer(this ILoot loot, Func lambda, int itemID) + public static LeadingConditionRule AddConditionalPerPlayer(this ILoot loot, Func lambda, int itemID, bool ui = true, string desc = null) { - LeadingConditionRule lcr = new(If(lambda)); + LeadingConditionRule lcr = new(If(lambda, ui, desc)); lcr.Add(PerPlayer(itemID)); loot.Add(lcr); return lcr; @@ -357,6 +373,42 @@ namespace CalamityMod public string GetConditionDescription() => description; } + internal class LambdaDropRuleCondition2 : IItemDropRuleCondition + { + private readonly Func conditionLambda; + private readonly Func visibleInUI; + private readonly string description; + + internal LambdaDropRuleCondition2(Func lambda, Func ui, string desc = null) + { + conditionLambda = lambda; + visibleInUI = ui; + description = desc; + } + + public bool CanDrop(DropAttemptInfo info) => conditionLambda(info); + public bool CanShowItemDropInUI() => visibleInUI(); + public string GetConditionDescription() => description; + } + + internal class LambdaDropRuleCondition3 : IItemDropRuleCondition + { + private readonly Func conditionLambda; + private readonly Func visibleInUI; + private readonly Func description; + + internal LambdaDropRuleCondition3(Func lambda, Func ui, Func desc) + { + conditionLambda = lambda; + visibleInUI = ui; + description = desc; + } + + public bool CanDrop(DropAttemptInfo info) => conditionLambda(info); + public bool CanShowItemDropInUI() => visibleInUI(); + public string GetConditionDescription() => description(); + } + /// /// Creates a new LambdaDropRuleCondition which executes the code of your choosing to decide whether this item drop should occur.
/// This version of "If" does NOT use the DropAttemptInfo struct that is available.
@@ -380,6 +432,16 @@ namespace CalamityMod bool LambdaInfoWrapper(DropAttemptInfo _) => lambda(); return new LambdaDropRuleCondition(LambdaInfoWrapper, ui, desc); } + public static IItemDropRuleCondition If(Func lambda, Func ui, string desc = null) + { + bool LambdaInfoWrapper(DropAttemptInfo _) => lambda(); + return new LambdaDropRuleCondition2(LambdaInfoWrapper, ui, desc); + } + public static IItemDropRuleCondition If(Func lambda, Func ui, Func desc) + { + bool LambdaInfoWrapper(DropAttemptInfo _) => lambda(); + return new LambdaDropRuleCondition3(LambdaInfoWrapper, ui, desc); + } /// /// Creates a new LambdaDropRuleCondition which executes the code of your choosing to decide whether this item drop should occur.
@@ -401,6 +463,14 @@ namespace CalamityMod { return new LambdaDropRuleCondition(lambda, ui, desc); } + public static IItemDropRuleCondition If(Func lambda, Func ui, string desc = null) + { + return new LambdaDropRuleCondition2(lambda, ui, desc); + } + public static IItemDropRuleCondition If(Func lambda, Func ui, Func desc) + { + return new LambdaDropRuleCondition3(lambda, ui, desc); + } #endregion #region Drop Rule Conditions @@ -468,14 +538,6 @@ namespace CalamityMod return p.Calamity().tarraSet; }); - public static IItemDropRuleCondition RevNoMaster = If((info) => - { - if (Main.masterMode) - return false; - - return CalamityWorld.revenge; - }); - private static bool CanDropBloodOrbs(DropAttemptInfo info) { // Blood Orbs do not drop unless it's a Blood Moon. @@ -533,6 +595,71 @@ namespace CalamityMod } return trasherNearby; }); + // The text is a separate rule so it doesn't show up on the non-Trasher Fishing Rod drop which only occurs if the Angler is not fed to a Trasher + public static IItemDropRuleCondition TrasherText = If((info) => true, true, "Drops if fed to a Trasher"); + + public static IItemDropRuleCondition RevNoMaster = If((info) => !Main.masterMode && CalamityWorld.revenge, () => !Main.masterMode && CalamityWorld.revenge, "This is a Revengeance Mode drop rate"); + public static IItemDropRuleCondition RevAndMaster = If((info) => Main.masterMode || CalamityWorld.revenge, () => Main.masterMode || CalamityWorld.revenge, () => + { + return Main.masterMode ? Language.GetTextValue("Bestiary_ItemDropConditions.IsMasterMode") : "This is a Revengeance Mode drop rate"; + }); + + #region Boss Defeat Conditionals + public static IItemDropRuleCondition PostKS(bool ui = true) => If(() => NPC.downedSlimeKing, ui, "Drops after defeating King Slime"); + public static IItemDropRuleCondition PostDS(bool ui = true) => If(() => DownedBossSystem.downedDesertScourge, ui, "Drops after defeating the Desert Scourge"); + public static IItemDropRuleCondition PostEoC(bool ui = true) => If(() => NPC.downedBoss1, ui, "Drops after defeating the Eye of Cthulhu"); + public static IItemDropRuleCondition PostCrab(bool ui = true) => If(() => DownedBossSystem.downedCrabulon, ui, "Drops after defeating Crabulon"); + public static IItemDropRuleCondition PostEvil1(bool ui = true) => If(() => NPC.downedBoss2, ui, "Drops after defeating the " + (WorldGen.crimson ? "Brain of Cthulhu" : "Eater of Worlds")); + public static IItemDropRuleCondition PostHM(bool ui = true) => If(() => DownedBossSystem.downedHiveMind, ui, "Drops after defeating the Hive Mind"); + public static IItemDropRuleCondition PostPerfs(bool ui = true) => If(() => DownedBossSystem.downedPerforator, ui, "Drops after defeating the Perforators"); + public static IItemDropRuleCondition PostEvil2(bool ui = true) => If(() => DownedBossSystem.downedHiveMind || DownedBossSystem.downedPerforator, ui, "Drops after defeating the " + (WorldGen.crimson ? "Perforators" : "Hive Mind")); + public static IItemDropRuleCondition PostQB(bool ui = true) => If(() => NPC.downedQueenBee, ui, "Drops after defeating the Queen Bee"); + public static IItemDropRuleCondition PostDeer(bool ui = true) => If(() => NPC.downedDeerclops, ui, "Drops after defeating Deerclops"); + public static IItemDropRuleCondition PostSkele(bool ui = true) => If(() => NPC.downedBoss3, ui, "Drops after defeating Skeletron"); + public static IItemDropRuleCondition PostSG(bool ui = true) => If(() => DownedBossSystem.downedSlimeGod, ui, "Drops after defeating the Slime God"); + public static IItemDropRuleCondition Hardmode(bool ui = true) => If(() => Main.hardMode, ui, "Drops in Hardmode"); + public static IItemDropRuleCondition PostQS(bool ui = true) => If(() => NPC.downedQueenSlime, ui, "Drops after defeating Queen Slime"); + public static IItemDropRuleCondition PostCryo(bool ui = true) => If(() => DownedBossSystem.downedCryogen, ui, "Drops after defeating Cryogen"); + public static IItemDropRuleCondition PostAS(bool ui = true) => If(() => DownedBossSystem.downedAquaticScourge, ui, "Drops after defeating the Aquatic Scourge"); + public static IItemDropRuleCondition PostBrim(bool ui = true) => If(() => DownedBossSystem.downedBrimstoneElemental, ui, "Drops after defeating the Brimstone Elemental"); + public static IItemDropRuleCondition PostDest(bool ui = true) => If(() => NPC.downedMechBoss1, ui, "Drops after defeating the Destroyer"); + public static IItemDropRuleCondition PostTwins(bool ui = true) => If(() => NPC.downedMechBoss2, ui, "Drops after defeating the Twins"); + public static IItemDropRuleCondition PostSP(bool ui = true) => If(() => NPC.downedMechBoss3, ui, "Drops after defeating Skeletron Prime"); + public static IItemDropRuleCondition Post1Mech(bool ui = true) => If(() => NPC.downedMechBossAny, ui, "Drops after defeating a Mechanical Boss"); + public static IItemDropRuleCondition Post3Mechs(bool ui = true) => If(() => NPC.downedMechBoss1 && NPC.downedMechBoss2 && NPC.downedMechBoss3, ui, "Drops after defeating all three Mechanical Bosses"); + public static IItemDropRuleCondition PostCal(bool ui = true) => If(() => DownedBossSystem.downedCalamitas, ui, "Drops after defeating Calamitas"); + public static IItemDropRuleCondition PostPlant(bool ui = true) => If(() => NPC.downedPlantBoss, ui, "Drops after defeating Plantera"); + public static IItemDropRuleCondition PostCalPlant(bool ui = true) => If(() => DownedBossSystem.downedCalamitas || NPC.downedPlantBoss, ui, "Drops after defeating Calamitas or Plantera"); + public static IItemDropRuleCondition PostLevi(bool ui = true) => If(() => DownedBossSystem.downedLeviathan, ui, "Drops after defeating the Leviathan and Anahita"); + public static IItemDropRuleCondition PostAureus(bool ui = true) => If(() => DownedBossSystem.downedAstrumAureus, ui, "Drops after defeating Astrum Aureus"); + public static IItemDropRuleCondition PostGolem(bool ui = true) => If(() => NPC.downedGolemBoss, ui, "Drops after defeating Golem"); + public static IItemDropRuleCondition PostPBG(bool ui = true) => If(() => DownedBossSystem.downedPlaguebringer, ui, "Drops after defeating the Plaguebringer Goliath"); + public static IItemDropRuleCondition PostEoL(bool ui = true) => If(() => NPC.downedEmpressOfLight, ui, "Drops after defeating the Empress of Light"); + public static IItemDropRuleCondition PostFish(bool ui = true) => If(() => NPC.downedFishron, ui, "Drops after defeating Duke Fishron"); + public static IItemDropRuleCondition PostRav(bool ui = true) => If(() => DownedBossSystem.downedRavager, ui, "Drops after defeating the Ravager"); + public static IItemDropRuleCondition PostLC(bool ui = true) => If(() => NPC.downedAncientCultist, ui, "Drops after defeating the Lunatic Cultist"); + public static IItemDropRuleCondition PostAD(bool ui = true) => If(() => DownedBossSystem.downedAstrumDeus, ui, "Drops after defeating Astrum Deus"); + public static IItemDropRuleCondition PostML(bool ui = true) => If(() => NPC.downedMoonlord, ui, "Drops after defeating the Moon Lord"); + public static IItemDropRuleCondition PostGuard(bool ui = true) => If(() => DownedBossSystem.downedGuardians, ui, "Drops after defeating the Profaned Guardian"); + public static IItemDropRuleCondition PostBirb(bool ui = true) => If(() => DownedBossSystem.downedDragonfolly, ui, "Drops after defeating the Dragonfolly"); + public static IItemDropRuleCondition PostProv(bool ui = true) => If(() => DownedBossSystem.downedProvidence, ui, "Drops after defeating Providence"); + public static IItemDropRuleCondition PostSig(bool ui = true) => If(() => DownedBossSystem.downedSignus, ui, "Drops after defeating Signus"); + public static IItemDropRuleCondition PostSW(bool ui = true) => If(() => DownedBossSystem.downedStormWeaver, ui, "Drops after defeating the Storm Weaver"); + public static IItemDropRuleCondition PostCV(bool ui = true) => If(() => DownedBossSystem.downedCeaselessVoid, ui, "Drops after defeating the Ceaseless Void"); + public static IItemDropRuleCondition PostPolter(bool ui = true) => If(() => DownedBossSystem.downedPolterghast, ui, "Drops after defeating the Polterghast"); + public static IItemDropRuleCondition PostOD(bool ui = true) => If(() => DownedBossSystem.downedBoomerDuke, ui, "Drops after defeating the Old Duke"); + public static IItemDropRuleCondition PostDoG(bool ui = true) => If(() => DownedBossSystem.downedDoG, ui, "Drops after defeating the Devourer of Gods"); + public static IItemDropRuleCondition PostYharon(bool ui = true) => If(() => DownedBossSystem.downedYharon, ui, "Drops after defeating Yharon"); + public static IItemDropRuleCondition PostExos(bool ui = true) => If(() => DownedBossSystem.downedExoMechs, ui, "Drops after defeating the Exo Mechs"); + public static IItemDropRuleCondition PostSCal(bool ui = true) => If(() => DownedBossSystem.downedSCal, ui, "Drops after defeating Supreme Calamitas"); + public static IItemDropRuleCondition PostAEW(bool ui = true) => If(() => DownedBossSystem.downedAdultEidolonWyrm, ui, "Drops after defeating the Adult Eidolon Wyrm"); + public static IItemDropRuleCondition PostClam(bool ui = true) => If(() => DownedBossSystem.downedCLAM, ui, "Drops after defeating the Giant Clam"); + public static IItemDropRuleCondition PostClamHM(bool ui = true) => If(() => DownedBossSystem.downedCLAMHardMode, ui, "Drops after defeating the Giant Clam in Hardmode"); + public static IItemDropRuleCondition PostGSS(bool ui = true) => If(() => DownedBossSystem.downedGSS, ui, "Drops after defeating the Great Sand Shark"); + public static IItemDropRuleCondition PostBetsy(bool ui = true) => If(() => DownedBossSystem.downedBetsy, ui, "Drops after defeating Betsy"); + public static IItemDropRuleCondition PostT1AR(bool ui = true) => If(() => DownedBossSystem.downedEoCAcidRain, ui, "Drops after defeating the first tier of Acid Rain"); + public static IItemDropRuleCondition PostT2AR(bool ui = true) => If(() => DownedBossSystem.downedAquaticScourgeAcidRain, ui, "Drops after defeating the second tier of Acid Rain"); + #endregion #endregion #region Leading Condition Rule Extensions @@ -588,10 +715,11 @@ namespace CalamityMod /// The minimum number of items to drop. Defaults to 1. /// The maximum number of items to drop. Defaults to 1. /// Set to true for this drop to not appear in the Bestiary. + /// The description of this condition in the Bestiary. Defaults to null. /// The item drop rule registered. - public static IItemDropRule AddIf(this LeadingConditionRule mainRule, Func lambda, int itemID, int dropRateInt = 1, int minQuantity = 1, int maxQuantity = 1, bool hideLootReport = false) + public static IItemDropRule AddIf(this LeadingConditionRule mainRule, Func lambda, int itemID, int dropRateInt = 1, int minQuantity = 1, int maxQuantity = 1, bool hideLootReport = false, string desc = null) { - return mainRule.OnSuccess(ItemDropRule.ByCondition(If(lambda), itemID, dropRateInt, minQuantity, maxQuantity), hideLootReport); + return mainRule.OnSuccess(ItemDropRule.ByCondition(If(lambda, true, desc), itemID, dropRateInt, minQuantity, maxQuantity), hideLootReport); } /// @@ -604,10 +732,11 @@ namespace CalamityMod /// The minimum number of items to drop. Defaults to 1. /// The maximum number of items to drop. Defaults to 1. /// Set to true for this drop to not appear in the Bestiary. + /// The description of this condition in the Bestiary. Defaults to null. /// The item drop rule registered. - public static IItemDropRule AddIf(this LeadingConditionRule mainRule, Func lambda, int itemID, Fraction dropRate, int minQuantity = 1, int maxQuantity = 1, bool hideLootReport = false) + public static IItemDropRule AddIf(this LeadingConditionRule mainRule, Func lambda, int itemID, Fraction dropRate, int minQuantity = 1, int maxQuantity = 1, bool hideLootReport = false, string desc = null) { - return mainRule.OnSuccess(ItemDropRule.ByCondition(If(lambda), itemID, dropRate.denominator, minQuantity, maxQuantity, dropRate.numerator), hideLootReport); + return mainRule.OnSuccess(ItemDropRule.ByCondition(If(lambda, true, desc), itemID, dropRate.denominator, minQuantity, maxQuantity, dropRate.numerator), hideLootReport); } /// @@ -620,10 +749,12 @@ namespace CalamityMod /// The chance that the item will drop is 1 in this number. For example, 5 gives a 1 in 5 chance. /// The minimum number of items to drop. Defaults to 1. /// The maximum number of items to drop. Defaults to 1. + /// Set to true for this drop to not appear in the Bestiary. + /// The description of this condition in the Bestiary. Defaults to null. /// The item drop rule registered. - public static IItemDropRule AddIf(this LeadingConditionRule mainRule, Func lambda, int itemID, int dropRateInt = 1, int minQuantity = 1, int maxQuantity = 1, bool hideLootReport = false) + public static IItemDropRule AddIf(this LeadingConditionRule mainRule, Func lambda, int itemID, int dropRateInt = 1, int minQuantity = 1, int maxQuantity = 1, bool hideLootReport = false, string desc = null) { - return mainRule.OnSuccess(ItemDropRule.ByCondition(If(lambda), itemID, dropRateInt, minQuantity, maxQuantity), hideLootReport); + return mainRule.OnSuccess(ItemDropRule.ByCondition(If(lambda, true, desc), itemID, dropRateInt, minQuantity, maxQuantity), hideLootReport); } /// @@ -637,10 +768,53 @@ namespace CalamityMod /// The minimum number of items to drop. Defaults to 1. /// The maximum number of items to drop. Defaults to 1. /// Set to true for this drop to not appear in the Bestiary. + /// The description of this condition in the Bestiary. Defaults to null. /// The item drop rule registered. - public static IItemDropRule AddIf(this LeadingConditionRule mainRule, Func lambda, int itemID, Fraction dropRate, int minQuantity = 1, int maxQuantity = 1, bool hideLootReport = false) + public static IItemDropRule AddIf(this LeadingConditionRule mainRule, Func lambda, int itemID, Fraction dropRate, int minQuantity = 1, int maxQuantity = 1, bool hideLootReport = false, string desc = null) { - return mainRule.OnSuccess(ItemDropRule.ByCondition(If(lambda), itemID, dropRate.denominator, minQuantity, maxQuantity, dropRate.numerator), hideLootReport); + return mainRule.OnSuccess(ItemDropRule.ByCondition(If(lambda, true, desc), itemID, dropRate.denominator, minQuantity, maxQuantity, dropRate.numerator), hideLootReport); + } + + /// + /// Adds any given drop rule as a chained rule to the given LeadingConditionRule. + /// + /// The LeadingConditionRule which should have another drop rule registered as one of its chains. + /// The drop rule which should occur given this leading condition. + /// Set to true for this drop to not appear in the Bestiary. + /// The LeadingConditionRule (first parameter). + public static IItemDropRule AddFail(this LeadingConditionRule mainRule, IItemDropRule chainedRule, bool hideLootReport = false) + { + return mainRule.OnFailedConditions(chainedRule, hideLootReport); + } + + /// + /// Shorthand to add a simple drop to the given LeadingConditionRule. + /// + /// The LeadingConditionRule which should drop this item as one of its chains. + /// The item to drop. + /// The chance that the item will drop is 1 in this number. For example, 5 gives a 1 in 5 chance. + /// The minimum number of items to drop. Defaults to 1. + /// The maximum number of items to drop. Defaults to 1. + /// Set to true for this drop to not appear in the Bestiary. + /// The LeadingConditionRule (first parameter). + public static IItemDropRule AddFail(this LeadingConditionRule mainRule, int itemID, int dropRateInt = 1, int minQuantity = 1, int maxQuantity = 1, bool hideLootReport = false) + { + return mainRule.OnFailedConditions(ItemDropRule.Common(itemID, dropRateInt, minQuantity, maxQuantity), hideLootReport); + } + + /// + /// Shorthand to add a simple drop to the given LeadingConditionRule using a Fraction drop rate. + /// + /// The LeadingConditionRule which should drop this item as one of its chains. + /// The item to drop. + /// The chance that the item will drop as a DropHelper Fraction. + /// The minimum number of items to drop. Defaults to 1. + /// The maximum number of items to drop. Defaults to 1. + /// Set to true for this drop to not appear in the Bestiary. + /// The LeadingConditionRule (first parameter). + public static IItemDropRule AddFail(this LeadingConditionRule mainRule, int itemID, Fraction dropRate, int minQuantity = 1, int maxQuantity = 1, bool hideLootReport = false) + { + return mainRule.OnFailedConditions(new CommonDrop(itemID, dropRate.denominator, minQuantity, maxQuantity, dropRate.numerator), hideLootReport); } #endregion @@ -712,10 +886,12 @@ namespace CalamityMod /// The chance that the item will drop is 1 in this number. For example, 5 gives a 1 in 5 chance. /// The minimum number of items to drop. Defaults to 1. /// The maximum number of items to drop. Defaults to 1. + /// Whether drops registered with this condition appear in the Bestiary. Defaults to true. + /// The description of this condition in the Bestiary. Defaults to null. /// The item drop rule registered. - public static IItemDropRule AddIf(this ILoot loot, Func lambda, int itemID, int dropRateInt = 1, int minQuantity = 1, int maxQuantity = 1) + public static IItemDropRule AddIf(this ILoot loot, Func lambda, int itemID, int dropRateInt = 1, int minQuantity = 1, int maxQuantity = 1, bool ui = true, string desc = null) { - return loot.Add(ItemDropRule.ByCondition(If(lambda), itemID, dropRateInt, minQuantity, maxQuantity)); + return loot.Add(ItemDropRule.ByCondition(If(lambda, ui, desc), itemID, dropRateInt, minQuantity, maxQuantity)); } /// @@ -727,10 +903,12 @@ namespace CalamityMod /// The chance that the item will drop as a DropHelper Fraction. /// The minimum number of items to drop. Defaults to 1. /// The maximum number of items to drop. Defaults to 1. + /// Whether drops registered with this condition appear in the Bestiary. Defaults to true. + /// The description of this condition in the Bestiary. Defaults to null. /// The item drop rule registered. - public static IItemDropRule AddIf(this ILoot loot, Func lambda, int itemID, Fraction dropRate, int minQuantity = 1, int maxQuantity = 1) + public static IItemDropRule AddIf(this ILoot loot, Func lambda, int itemID, Fraction dropRate, int minQuantity = 1, int maxQuantity = 1, bool ui = true, string desc = null) { - return loot.Add(ItemDropRule.ByCondition(If(lambda), itemID, dropRate.denominator, minQuantity, maxQuantity, dropRate.numerator)); + return loot.Add(ItemDropRule.ByCondition(If(lambda, ui, desc), itemID, dropRate.denominator, minQuantity, maxQuantity, dropRate.numerator)); } /// @@ -743,10 +921,12 @@ namespace CalamityMod /// The chance that the item will drop is 1 in this number. For example, 5 gives a 1 in 5 chance. /// The minimum number of items to drop. Defaults to 1. /// The maximum number of items to drop. Defaults to 1. + /// Whether drops registered with this condition appear in the Bestiary. Defaults to true. + /// The description of this condition in the Bestiary. Defaults to null. /// The item drop rule registered. - public static IItemDropRule AddIf(this ILoot loot, Func lambda, int itemID, int dropRateInt = 1, int minQuantity = 1, int maxQuantity = 1) + public static IItemDropRule AddIf(this ILoot loot, Func lambda, int itemID, int dropRateInt = 1, int minQuantity = 1, int maxQuantity = 1, bool ui = true, string desc = null) { - return loot.Add(ItemDropRule.ByCondition(If(lambda), itemID, dropRateInt, minQuantity, maxQuantity)); + return loot.Add(ItemDropRule.ByCondition(If(lambda, ui, desc), itemID, dropRateInt, minQuantity, maxQuantity)); } /// @@ -759,10 +939,12 @@ namespace CalamityMod /// The chance that the item will drop as a DropHelper Fraction. /// The minimum number of items to drop. Defaults to 1. /// The maximum number of items to drop. Defaults to 1. + /// Whether drops registered with this condition appear in the Bestiary. Defaults to true. + /// The description of this condition in the Bestiary. Defaults to null. /// The item drop rule registered. - public static IItemDropRule AddIf(this ILoot loot, Func lambda, int itemID, Fraction dropRate, int minQuantity = 1, int maxQuantity = 1) + public static IItemDropRule AddIf(this ILoot loot, Func lambda, int itemID, Fraction dropRate, int minQuantity = 1, int maxQuantity = 1, bool ui = true, string desc = null) { - return loot.Add(ItemDropRule.ByCondition(If(lambda), itemID, dropRate.denominator, minQuantity, maxQuantity, dropRate.numerator)); + return loot.Add(ItemDropRule.ByCondition(If(lambda, ui, desc), itemID, dropRate.denominator, minQuantity, maxQuantity, dropRate.numerator)); } /// diff --git a/Utilities/FurnitureSetupUtils.cs b/Utilities/FurnitureSetupUtils.cs index 7ec306dbda..6ce690284e 100644 --- a/Utilities/FurnitureSetupUtils.cs +++ b/Utilities/FurnitureSetupUtils.cs @@ -1,16 +1,16 @@ using Microsoft.Xna.Framework; using System; using Terraria; +using Terraria.Audio; using Terraria.DataStructures; using Terraria.Enums; +using Terraria.GameContent; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; using Terraria.ModLoader.Default; using Terraria.ObjectData; using static Terraria.ModLoader.ModContent; -using Terraria.Audio; -using Terraria.GameContent; namespace CalamityMod { @@ -128,12 +128,20 @@ namespace CalamityMod player.cursorItemIconEnabled = true; player.cursorItemIconID = itemID; - bool frameCheck = fat ? Main.tile[i, j].TileFrameX < 35 : Main.tile[i, j].TileFrameX / 18 < 1; + bool frameCheck = fat ? Main.tile[i, j].TileFrameX <= 35 : Main.tile[i, j].TileFrameX / 18 < 0; if (frameCheck) { player.cursorItemIconReversed = true; } } + + public static void MouseOver(int i, int j, int itemID) + { + Player player = Main.LocalPlayer; + player.noThrow = 2; + player.cursorItemIconEnabled = true; + player.cursorItemIconID = itemID; + } #endregion #region Sitting in Sofas/Benches @@ -858,7 +866,7 @@ namespace CalamityMod /// Extension which initializes a ModTile to be a chest. /// /// The ModTile which is being initialized. - internal static void SetUpChest(this ModTile mt, bool offset = false) + internal static void SetUpChest(this ModTile mt, bool offset = false, int offsetAmt = 4) { Main.tileSpelunker[mt.Type] = true; Main.tileContainer[mt.Type] = true; @@ -872,7 +880,7 @@ namespace CalamityMod TileID.Sets.DisableSmartCursor[mt.Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); if (offset) - TileObjectData.newTile.DrawYOffset = 4; + TileObjectData.newTile.DrawYOffset = offsetAmt; TileObjectData.newTile.Origin = new Point16(0, 1); TileObjectData.newTile.CoordinateHeights = new int[] { 16, 18 }; TileObjectData.newTile.HookCheckIfCanPlace = new PlacementHook(new Func(Chest.FindEmptyChest), -1, 0, true); @@ -1164,12 +1172,18 @@ namespace CalamityMod /// /// The ModTile which is being initialized. /// Whether this tile is supposed to be immune to lava. Defaults to false. - internal static void SetUpSink(this ModTile mt, bool lavaImmune = false) + /// Whether this tile counts as a water source. Defaults to true. + /// Whether this tile counts as a lava source. Defaults to false. + /// Whether this tile counts as a honey source. Defaults to false. + internal static void SetUpSink(this ModTile mt, bool lavaImmune = false, bool water = true, bool lava = false, bool honey = false) { Main.tileLighted[mt.Type] = true; Main.tileFrameImportant[mt.Type] = true; Main.tileLavaDeath[mt.Type] = !lavaImmune; Main.tileWaterDeath[mt.Type] = false; + TileID.Sets.CountsAsWaterSource[mt.Type] = water; + TileID.Sets.CountsAsHoneySource[mt.Type] = lava; + TileID.Sets.CountsAsLavaSource[mt.Type] = honey; TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); TileObjectData.newTile.LavaDeath = !lavaImmune; TileObjectData.addTile(mt.Type); diff --git a/Utilities/ItemUtils.cs b/Utilities/ItemUtils.cs index 7dcb400111..9f998a7363 100644 --- a/Utilities/ItemUtils.cs +++ b/Utilities/ItemUtils.cs @@ -692,7 +692,30 @@ namespace CalamityMod mod.Find("Blunt").Type, mod.Find("Flimsy").Type, mod.Find("Unbalanced").Type, - mod.Find("Atrocious").Type + mod.Find("Atrocious").Type, + PrefixID.Keen, + PrefixID.Superior, + PrefixID.Forceful, + PrefixID.Broken, + PrefixID.Damaged, + PrefixID.Hurtful, + PrefixID.Strong, + PrefixID.Unpleasant, + PrefixID.Weak, + PrefixID.Ruthless, + PrefixID.Godly, + PrefixID.Demonic, + PrefixID.Zealous, + PrefixID.Quick, + PrefixID.Deadly2, + PrefixID.Agile, + PrefixID.Nimble, + PrefixID.Murderous, + PrefixID.Slow, + PrefixID.Sluggish, + PrefixID.Lazy, + PrefixID.Annoying, + PrefixID.Nasty }); return roguePrefix; } diff --git a/Utilities/MiscUtils.cs b/Utilities/MiscUtils.cs index 853884cdac..5e1d1d60d8 100644 --- a/Utilities/MiscUtils.cs +++ b/Utilities/MiscUtils.cs @@ -725,7 +725,7 @@ namespace CalamityMod item = ModContent.ItemType(); break; case 126: - item = ModContent.ItemType(); + item = ModContent.ItemType(); break; default: break; @@ -1084,7 +1084,7 @@ namespace CalamityMod npc = ModContent.NPCType(); break; case 126: - npc = ModContent.NPCType(); + npc = ModContent.NPCType(); break; default: break; diff --git a/Utilities/PlayerUtils.cs b/Utilities/PlayerUtils.cs index b03abda8b6..801256db73 100644 --- a/Utilities/PlayerUtils.cs +++ b/Utilities/PlayerUtils.cs @@ -98,7 +98,7 @@ namespace CalamityMod CalamityPlayer mp = player.Calamity(); int light = mp.externalAbyssLight; bool underwater = player.IsUnderwater(); - bool miningHelmet = player.head == ArmorIDs.Head.MiningHelmet; + bool miningHelmet = player.head == ArmorIDs.Head.MiningHelmet || player.head == ArmorIDs.Head.UltraBrightHelmet; // The campfire bonus does not apply while in the Abyss. if (!mp.ZoneAbyss && (player.HasBuff(BuffID.Campfire) || Main.SceneMetrics.HasCampfire)) @@ -149,6 +149,12 @@ namespace CalamityMod light += 2; if (mp.sirenPet) light += underwater ? 3 : 1; + if (player.petFlagPumpkingPet) + light += 3; + if (player.petFlagGolemPet) + light += 3; + if (player.petFlagFairyQueenPet) + light += 3; if (player.wisp) light += 3; if (player.suspiciouslookingTentacle) @@ -303,6 +309,8 @@ namespace CalamityMod hasItem = true; if (player.bank3.item.Any(item => items.Contains(item.type))) hasItem = true; + if (player.bank4.item.Any(item => items.Contains(item.type))) + hasItem = true; return hasItem; } #endregion diff --git a/Utilities/TileUtils.cs b/Utilities/TileUtils.cs index c5e7b3b261..5739e95233 100644 --- a/Utilities/TileUtils.cs +++ b/Utilities/TileUtils.cs @@ -643,5 +643,100 @@ namespace CalamityMod return !Main.tileContainer[tile.TileType] && !tileExcludeList.Contains(tile.TileType); } + + /// + /// Gets the item drop of an ore tile + /// + /// + /// The item a tile breaks when drops if it's an ore + public static int GetOreItemID(this Tile tile) + { + int item = -1; + + // If it's not ore, then return + if (!TileID.Sets.Ore[tile.TileType]) + return item; + + ModTile moddedTile = TileLoader.GetTile(tile.TileType); + + //Getting the item drop of a modded tile is pretty easy. + if (moddedTile != null) + item = moddedTile.ItemDrop; + + //There is no easy way for getting vanilla item drops :( + else + { + switch (tile.TileType) + { + case TileID.LunarOre: + item = ItemID.LunarOre; + break; + case TileID.Chlorophyte: + item = ItemID.ChlorophyteOre; + break; + case TileID.Titanium: + item = ItemID.TitaniumOre; + break; + case TileID.Adamantite: + item = ItemID.AdamantiteOre; + break; + case TileID.Orichalcum: + item = ItemID.OrichalcumOre; + break; + case TileID.Mythril: + item = ItemID.MythrilOre; + break; + case TileID.Palladium: + item = ItemID.PalladiumOre; + break; + case TileID.Cobalt: + item = ItemID.CobaltOre; + break; + case TileID.Hellstone: + item = ItemID.Hellstone; + break; + case TileID.Obsidian: + item = ItemID.Obsidian; + break; + case TileID.Meteorite: + item = ItemID.Meteorite; + break; + case TileID.Demonite: + item = ItemID.DemoniteOre; + break; + case TileID.Crimtane: + item = ItemID.CrimtaneOre; + break; + case TileID.Platinum: + item = ItemID.PlatinumOre; + break; + case TileID.Gold: + item = ItemID.GoldOre; + break; + case TileID.Tungsten: + item = ItemID.TungstenOre; + break; + case TileID.Silver: + item = ItemID.SilverOre; + break; + case TileID.Lead: + item = ItemID.LeadOre; + break; + case TileID.Iron: + item = ItemID.IronOre; + break; + case TileID.Tin: + item = ItemID.TinOre; + break; + case TileID.Copper: + item = ItemID.CopperOre; + break; + default: + break; + } + } + + return item; + } } } diff --git a/Walls/CosmiliteBrickWall.png b/Walls/CosmiliteBrickWall.png index 5568c2f184..8e174c541a 100644 Binary files a/Walls/CosmiliteBrickWall.png and b/Walls/CosmiliteBrickWall.png differ diff --git a/Walls/OccultBrickWall.cs b/Walls/OccultBrickWall.cs new file mode 100644 index 0000000000..8806079020 --- /dev/null +++ b/Walls/OccultBrickWall.cs @@ -0,0 +1,27 @@ +using Microsoft.Xna.Framework; +using Terraria.ModLoader; +using CalamityMod.Items.Placeables.Walls; +using Terraria; +using Terraria.ID; + +namespace CalamityMod.Walls +{ + public class OccultBrickWall : ModWall + { + public override void SetStaticDefaults() + { + Main.wallHouse[Type] = true; + ItemDrop = ModContent.ItemType(); + HitSound = SoundID.Dig; + AddMapEntry(new Color(111, 95, 110)); + } + + public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 7, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + } +} diff --git a/Walls/OccultBrickWall.png b/Walls/OccultBrickWall.png new file mode 100644 index 0000000000..e8a9e167fd Binary files /dev/null and b/Walls/OccultBrickWall.png differ diff --git a/World/AstralBiome.cs b/World/AstralBiome.cs index a8f1f99a75..602a5185ce 100644 --- a/World/AstralBiome.cs +++ b/World/AstralBiome.cs @@ -215,7 +215,7 @@ namespace CalamityMod.World } int num = 35; Rectangle rectangle = new Rectangle((i - num) * 16, (j - num) * 16, num * 2 * 16, num * 2 * 16); - for (int k = 0; k < 255; k++) + for (int k = 0; k < Main.maxPlayers; k++) { if (Main.player[k].active) { @@ -226,7 +226,7 @@ namespace CalamityMod.World } } } - for (int l = 0; l < 200; l++) + for (int l = 0; l < Main.maxNPCs; l++) { if (Main.npc[l].active) { @@ -491,30 +491,30 @@ namespace CalamityMod.World float outerEdgePercent = (percent - blurPercent) / (1f - blurPercent); if (rand.NextFloat(1f) > outerEdgePercent) { - ConvertToAstral(x, y); + ConvertToAstral(x, y, true); } } else { - ConvertToAstral(x, y); + ConvertToAstral(x, y, true); } } } } } - public static void ConvertToAstral(int startX, int endX, int startY, int endY) + public static void ConvertToAstral(int startX, int endX, int startY, int endY, bool convertOre = false) { for (int x = startX; x <= endX; x++) { for (int y = startY; y <= endY; y++) { - ConvertToAstral(x, y); + ConvertToAstral(x, y, convertOre); } } } - public static void ConvertToAstral(int x, int y) + public static void ConvertToAstral(int x, int y, bool convertOre = false) { if (WorldGen.InWorld(x, y, 1)) { @@ -661,6 +661,21 @@ namespace CalamityMod.World WorldGen.SquareTileFrame(x, y, true); NetMessage.SendTileSquare(-1, x, y, 1); break; + case TileID.Copper: + case TileID.Iron: + case TileID.Silver: + case TileID.Gold: + case TileID.Tin: + case TileID.Lead: + case TileID.Tungsten: + case TileID.Platinum: + if (convertOre) + { + Main.tile[x, y].TileType = (ushort)ModContent.TileType(); + WorldGen.SquareTileFrame(x, y, true); + NetMessage.SendTileSquare(-1, x, y, 1); + } + break; case TileID.LeafBlock: case TileID.Sunflower: WorldGen.KillTile(x, y);