diff --git a/Balancing/BalancingChangesManager.cs b/Balancing/BalancingChangesManager.cs index 58f265f0f7..0748603c73 100644 --- a/Balancing/BalancingChangesManager.cs +++ b/Balancing/BalancingChangesManager.cs @@ -95,8 +95,8 @@ namespace CalamityMod.Balancing #endregion #region Wall of Flesh - // 40% resist to Corro/Crimslime Staff. - NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.WallofFleshEye, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType(), ProjectileType())))); + // 50% resist to Staff of Necrosteocytes. + NPCSpecificBalancingChanges.AddRange(Bundle(new List { NPCID.WallofFlesh, NPCID.WallofFleshEye }, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); #endregion #region Aquatic Scourge diff --git a/Buffs/Summon/BabySlimeGodBuff.cs b/Buffs/Summon/BabyPaladinBuff.cs similarity index 62% rename from Buffs/Summon/BabySlimeGodBuff.cs rename to Buffs/Summon/BabyPaladinBuff.cs index c596e06060..41a9ed1b88 100644 --- a/Buffs/Summon/BabySlimeGodBuff.cs +++ b/Buffs/Summon/BabyPaladinBuff.cs @@ -1,11 +1,11 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Projectiles.Summon; using Terraria.ModLoader; namespace CalamityMod.Buffs.Summon { - public class BabySlimeGodBuff : BaseSummonBuff + public class BabyPaladinBuff : BaseSummonBuff { - protected override int MinionProjectileType => ModContent.ProjectileType(); + protected override int MinionProjectileType => ModContent.ProjectileType(); protected override ref bool MinionBool => ref BuffModdedOwner.sGod; } diff --git a/Buffs/Summon/BabySlimeGodBuff.png b/Buffs/Summon/BabyPaladinBuff.png similarity index 100% rename from Buffs/Summon/BabySlimeGodBuff.png rename to Buffs/Summon/BabyPaladinBuff.png diff --git a/Buffs/Summon/Corroslime.cs b/Buffs/Summon/BlightedSlime.cs similarity index 57% rename from Buffs/Summon/Corroslime.cs rename to Buffs/Summon/BlightedSlime.cs index ca5b6d02ee..1455f3f3b1 100644 --- a/Buffs/Summon/Corroslime.cs +++ b/Buffs/Summon/BlightedSlime.cs @@ -1,12 +1,12 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Projectiles.Summon; using Terraria.ModLoader; namespace CalamityMod.Buffs.Summon { - public class Corroslime : BaseSummonBuff + public class BlightedSlime : BaseSummonBuff { - protected override int MinionProjectileType => ModContent.ProjectileType(); + protected override int MinionProjectileType => ModContent.ProjectileType(); - protected override ref bool MinionBool => ref BuffModdedOwner.cSlime; + protected override ref bool MinionBool => ref BuffModdedOwner.blightedSlime; } } diff --git a/Buffs/Summon/Corroslime.png b/Buffs/Summon/BlightedSlime.png similarity index 100% rename from Buffs/Summon/Corroslime.png rename to Buffs/Summon/BlightedSlime.png diff --git a/Buffs/Summon/Crimslime.png b/Buffs/Summon/BlightedSlimeCrimson.png similarity index 100% rename from Buffs/Summon/Crimslime.png rename to Buffs/Summon/BlightedSlimeCrimson.png diff --git a/Buffs/Summon/Crimslime.cs b/Buffs/Summon/Crimslime.cs deleted file mode 100644 index dc08297928..0000000000 --- a/Buffs/Summon/Crimslime.cs +++ /dev/null @@ -1,12 +0,0 @@ -using CalamityMod.Projectiles.Summon; -using Terraria.ModLoader; - -namespace CalamityMod.Buffs.Summon -{ - public class Crimslime : BaseSummonBuff - { - protected override int MinionProjectileType => ModContent.ProjectileType(); - - protected override ref bool MinionBool => ref BuffModdedOwner.cSlime2; - } -} diff --git a/Buffs/Summon/HotE.cs b/Buffs/Summon/HotE.cs index 3e8eae1f10..18f70d5b7a 100644 --- a/Buffs/Summon/HotE.cs +++ b/Buffs/Summon/HotE.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Buffs.Summon { CalamityPlayer modPlayer = player.Calamity(); - if (!modPlayer.allElementals) + if (!modPlayer.allElementals.HasValue) { player.DelBuff(buffIndex); buffIndex--; diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 0ee05b38fa..4a53e1304f 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -1077,15 +1077,15 @@ namespace CalamityMod.CalPlayer public bool jellyChargedBattery = false; /// General cooldown for accessories which spawn projectiles on minion hits. public float summonProjCooldown; - public bool sandElemental = false; + public bool? sandElemental = null; public bool sandElementalVanity = false; - public bool oasisElemental = false; + public bool? oasisElemental = null; public bool oasisElementalVanity = false; - public bool cloudElemental = false; + public bool? cloudElemental = null; public bool cloudElementalVanity = false; - public bool brimElemental = false; + public bool? brimElemental = null; public bool brimElementalVanity = false; - public bool waterElemental = false; + public bool? waterElemental = null; public bool waterElementalVanity = false; public bool fungalClump = false; public bool fungalClumpVanity = false; @@ -1227,7 +1227,6 @@ namespace CalamityMod.CalPlayer public bool bloodflareFrenzy = false; public int bloodflareMeleeHits = 0; public bool bloodflareRanged = false; - public bool bloodflareThrowing = false; public bool bloodflareMage = false; public int bloodflareMageCooldown = 0; public bool bloodflareSummon = false; @@ -1516,10 +1515,8 @@ namespace CalamityMod.CalPlayer public bool CalamarisLament = false; /// Entropy's Vigil. public bool cEyes = false; - /// Corroslime Staff. - public bool cSlime = false; - /// Crimslime Staff. - public bool cSlime2 = false; + /// Blighted Slime Staff. + public bool blightedSlime = false; /// Abandoned Slime Staff. public bool aSlime = false; public bool brittleStar = false; @@ -1550,7 +1547,7 @@ namespace CalamityMod.CalPlayer /// Enchanted Conch. public bool hCrab = false; /// Heart of the Elements. - public bool allElementals = false; + public bool? allElementals = null; /// Heart of the Elements; however, the minions will not attack. public bool allElementalsVanity = false; /// Silva armor's Silva Crystal. @@ -2592,7 +2589,6 @@ namespace CalamityMod.CalPlayer bloodflareMelee = false; bloodflareFrenzy = false; bloodflareRanged = false; - bloodflareThrowing = false; bloodflareMage = false; bloodflareSummon = false; @@ -2775,8 +2771,7 @@ namespace CalamityMod.CalPlayer cosmicViper = false; CalamarisLament = false; cEyes = false; - cSlime = false; - cSlime2 = false; + blightedSlime = false; aSlime = false; brittleStar = false; aquaticStar = false; @@ -2811,17 +2806,17 @@ namespace CalamityMod.CalPlayer cSpirit = false; dCrystal = false; MutatedTruffleBool = false; - sandElemental = false; + sandElemental = null; sandElementalVanity = false; - oasisElemental = false; + oasisElemental = null; oasisElementalVanity = false; - cloudElemental = false; + cloudElemental = null; cloudElementalVanity = false; - brimElemental = false; + brimElemental = null; brimElementalVanity = false; - waterElemental = false; + waterElemental = null; waterElementalVanity = false; - allElementals = false; + allElementals = null; allElementalsVanity = false; fungalClump = false; fungalClumpVanity = false; @@ -3375,7 +3370,6 @@ namespace CalamityMod.CalPlayer bloodflareFrenzy = false; bloodflareMeleeHits = 0; bloodflareRanged = false; - bloodflareThrowing = false; bloodflareMage = false; bloodflareSummon = false; bloodflareSummonTimer = 0; @@ -5327,7 +5321,7 @@ namespace CalamityMod.CalPlayer EnhancedDarknessSystem.lights.Add(new(lastDeerclopsPosition.Value, scale: DeerclopsAI.borderScale, texture: DeerclopsAI.ArenaTex.Value)); //we draw light around the player when far away so they have some visibility, although very small. This is especially nice in multiplayer. we scale opacity with distance bc it looks better - EnhancedDarknessSystem.lights.Add(new EnhancedDarknessSystem.LightSource(scale: 0.75f, opacity: MathHelper.Clamp(Main.LocalPlayer.DistanceSQ(lastDeerclopsPosition.Value) / (409600 /*640^2*/), 0, 1))); + EnhancedDarknessSystem.lights.Add(new EnhancedDarknessSystem.LightSource(scale: 0.75f, opacity: MathHelper.Clamp(Main.LocalPlayer.DistanceSQ(lastDeerclopsPosition.Value) / 409600, 0, 1))); if (darknessIntensity == 0) { diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index 5579e5a77b..3f03418614 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -556,7 +556,7 @@ namespace CalamityMod.CalPlayer } } - public override void ModifyHitNPCWithProj(Projectile proj, NPC target, ref NPC.HitModifiers modifiers)/* tModPorter If you don't need the Projectile, consider using ModifyHitNPC instead */ + public override void ModifyHitNPCWithProj(Projectile proj, NPC target, ref NPC.HitModifiers modifiers) { if (proj.npcProj || proj.trap) return; diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index bfab622c1c..4eeef63f01 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -1138,6 +1138,7 @@ namespace CalamityMod.CalPlayer Asset carpetAuric = ExtraTextureRefs.FlyingCarpetAuric; Asset carpetOriginal = ExtraTextureRefs.FlyingCarpetVanilla; TextureAssets.FlyingCarpet = (auricSet ? carpetAuric : carpetOriginal); + TextureAssets.Buff[ModContent.BuffType()] = WorldGen.crimson ? ExtraTextureRefs.BlightedSlimeCrimIcon : ExtraTextureRefs.BlightedSlimeCorroIcon; for (int l = 0; l < Player.MaxBuffs; l++) { @@ -2764,9 +2765,6 @@ namespace CalamityMod.CalPlayer if (Player.buffTime[l] <= 2 && buffID == ModContent.BuffType()) if (Player.whoAmI == Main.myPlayer) Player.AddCooldown(Cooldowns.TarragonImmunity.ID, TarragonHeadRogue.ImmunityCooldown); - - if (CalamityBuffSets.IsDebuff[buffID]) - Player.GetDamage() += TarragonHeadRogue.RogueDamageBoostWhileDebuffed; } } @@ -2832,6 +2830,10 @@ namespace CalamityMod.CalPlayer if (Player.ichor) Player.statDefense += 5; + // Holding Walking Cane increases movement speed + if (Player.HeldItem.type == ModContent.ItemType()) + Player.moveSpeed += WalkingCane.MoveSpeedBoost; + // Fairy Boots bonus if (fairyBoots) { @@ -3637,8 +3639,7 @@ namespace CalamityMod.CalPlayer --bloodflareCoreRemainingHealOverTime; } - - // Reduce how slow Chilled makes the player, because it's cancerous right now + // Reduce how slow Chilled makes the player // The moveSpeed multiplier for Chilled in vanilla is 0.75, so we just multiply by 1.166667 here to make it 0.875, effectively cutting the reduction in half if (Player.chilled) Player.moveSpeed *= 1f + (1f / 6f); @@ -3937,12 +3938,6 @@ namespace CalamityMod.CalPlayer Player.AddBuff(BuffID.Inferno, 2); } - if (bloodflareThrowing) - { - if (Player.statLife > (int)(Player.statLifeMax2 * BloodflareHeadRogue.DefenseBoostHealthThreshold)) - Player.statDefense += BloodflareHeadRogue.DefenseBoostAboveHealthThreshold; - } - if (bloodflareSummon) { if (Player.statLife <= (int)(Player.statLifeMax2 * BloodflareHeadSummon.DefenseBoostHealthThreshold)) diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index f80ed26df4..2839ac6342 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -62,7 +62,7 @@ namespace CalamityMod.CalPlayer #endregion #region On Hit NPC - public override void OnHitNPCWithItem(Item item, NPC target, NPC.HitInfo hit, int damageDone)/* tModPorter If you don't need the Item, consider using OnHitNPC instead */ + public override void OnHitNPCWithItem(Item item, NPC target, NPC.HitInfo hit, int damageDone) { if (Player.whoAmI != Main.myPlayer) return; @@ -207,7 +207,7 @@ namespace CalamityMod.CalPlayer #endregion #region On Hit NPC With Proj - public override void OnHitNPCWithProj(Projectile proj, NPC target, NPC.HitInfo hit, int damageDone)/* tModPorter If you don't need the Projectile, consider using OnHitNPC instead */ + public override void OnHitNPCWithProj(Projectile proj, NPC target, NPC.HitInfo hit, int damageDone) { if (Player.whoAmI != Main.myPlayer) return; diff --git a/Effects/BasicTint.fx b/Effects/BasicTint.fx index 8b3b2268c2..ca360c3e68 100644 --- a/Effects/BasicTint.fx +++ b/Effects/BasicTint.fx @@ -3,7 +3,7 @@ sampler uImage1 : register(s1); float3 uColor; float3 uSecondaryColor; float uOpacity; -float uSaturation; +float uSaturation; // Saturation gets used as a "true" opacity float uRotation; float uTime; float4 uSourceRect; @@ -20,7 +20,7 @@ float4 Recolor(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0 float4 color = tex2D(uImage0, coords); float originalAlpha = color.a; color.rbg = lerp(color.rbg, uColor, uOpacity); - return color * originalAlpha; + return color * originalAlpha * uSaturation; } diff --git a/Effects/BasicTint.xnb b/Effects/BasicTint.xnb index 4b02bc2bdc..3fe8964653 100644 Binary files a/Effects/BasicTint.xnb and b/Effects/BasicTint.xnb differ diff --git a/ExtraTextures/ExtraTextureRefs.cs b/ExtraTextures/ExtraTextureRefs.cs index 7eaf854a40..de46254b15 100644 --- a/ExtraTextures/ExtraTextureRefs.cs +++ b/ExtraTextures/ExtraTextureRefs.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework.Graphics; +using CalamityMod.Buffs.Summon; +using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; using Terraria; using Terraria.GameContent; @@ -15,8 +16,7 @@ namespace CalamityMod.ExtraTextures public static Asset DestroyerBodyGlowmask; public static Asset DestroyerTailGlowmask; - // WoF, These are not "exactly" the ExtraTextures. But - public static Asset WallOfFleshEyeGlowmask; + // WoF, These are not "exactly" the ExtraTextures public static Asset WallOfFleshDemonSickleTexture; // Flying Carpet Replacements @@ -28,6 +28,10 @@ namespace CalamityMod.ExtraTextures public static Asset LuckIconVanilla; public static Asset LuckIconLesser; + // Blighted Slime Buff icons + public static Asset BlightedSlimeCorroIcon; + public static Asset BlightedSlimeCrimIcon; + // Particles public static Asset CircularSmear; public static Asset CircularSmearFire1; @@ -42,7 +46,6 @@ namespace CalamityMod.ExtraTextures DestroyerBodyGlowmask = ModContent.Request("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerBodyGlow", AssetRequestMode.AsyncLoad); DestroyerTailGlowmask = ModContent.Request("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerTailGlow", AssetRequestMode.AsyncLoad); - WallOfFleshEyeGlowmask = ModContent.Request("CalamityMod/ExtraTextures/VanillaBossGlowmasks/WallOfFleshEyeTelegraphGlow", AssetRequestMode.AsyncLoad); WallOfFleshDemonSickleTexture = ModContent.Request("CalamityMod/Projectiles/Melee/ForbiddenOathbladeProjectile", AssetRequestMode.AsyncLoad); FlyingCarpetVanilla = TextureAssets.FlyingCarpet; @@ -52,6 +55,9 @@ namespace CalamityMod.ExtraTextures LuckIconVanilla = TextureAssets.Buff[BuffID.Lucky]; LuckIconLesser = ModContent.Request("CalamityMod/ExtraTextures/VanillaBuffs/LuckyLesser", AssetRequestMode.AsyncLoad); + BlightedSlimeCorroIcon = ModContent.Request("CalamityMod/Buffs/Summon/BlightedSlime"); + BlightedSlimeCrimIcon = ModContent.Request("CalamityMod/Buffs/Summon/BlightedSlimeCrimson"); + CircularSmear = ModContent.Request("CalamityMod/Particles/CircularSmear", AssetRequestMode.AsyncLoad); CircularSmearFire1 = ModContent.Request("CalamityMod/Particles/CircularSmearFire1", AssetRequestMode.AsyncLoad); CircularSmearFire2 = ModContent.Request("CalamityMod/Particles/CircularSmearFire2", AssetRequestMode.AsyncLoad); diff --git a/ExtraTextures/VanillaBossGlowmasks/WallOfFleshEyeTelegraphGlow.png b/ExtraTextures/VanillaBossGlowmasks/WallOfFleshEyeTelegraphGlow.png deleted file mode 100644 index 2f52bdb33a..0000000000 Binary files a/ExtraTextures/VanillaBossGlowmasks/WallOfFleshEyeTelegraphGlow.png and /dev/null differ diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index f621447cce..b25b3a0648 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -237,14 +237,6 @@ namespace CalamityMod.ILEditing dir = self.direction; dashing = true; - // CIT 16OCT2024: Commented this code out, as there's no reason for custom dash hotkey to use Player.dashTime - // and was causing the return of Celestial Starboard's dash bug from early 1.4 versions - /*if ((self.dashTime <= 0 && self.direction == -1) || (self.dashTime >= 0 && self.direction == 1)) - { - self.dashTime = 15; - return; - }*/ - dashing = true; self.dashTime = 0; self.timeSinceLastDashStarted = 0; diff --git a/Items/Accessories/ElementalinaBottle.cs b/Items/Accessories/ElementalinaBottle.cs index 6d3e214701..cd7d33b0d4 100644 --- a/Items/Accessories/ElementalinaBottle.cs +++ b/Items/Accessories/ElementalinaBottle.cs @@ -23,12 +23,12 @@ namespace CalamityMod.Items.Accessories Item.accessory = true; } - public override bool CanEquipAccessory(Player player, int slot, bool modded) => !player.Calamity().allElementals; + public override bool CanEquipAccessory(Player player, int slot, bool modded) => !player.Calamity().allElementals.HasValue; public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.sandElemental = true; + modPlayer.sandElemental = !hideVisual; SpawnElemental(player); } diff --git a/Items/Accessories/EyeoftheStorm.cs b/Items/Accessories/EyeoftheStorm.cs index 1b011f82d9..83227565ad 100644 --- a/Items/Accessories/EyeoftheStorm.cs +++ b/Items/Accessories/EyeoftheStorm.cs @@ -26,12 +26,12 @@ namespace CalamityMod.Items.Accessories Item.accessory = true; } - public override bool CanEquipAccessory(Player player, int slot, bool modded) => !player.Calamity().allElementals; + public override bool CanEquipAccessory(Player player, int slot, bool modded) => !player.Calamity().allElementals.HasValue; public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.cloudElemental = true; + modPlayer.cloudElemental = !hideVisual; if (player.whoAmI == Main.myPlayer) { if (player.FindBuffIndex(ModContent.BuffType()) == -1) diff --git a/Items/Accessories/HeartoftheElements.cs b/Items/Accessories/HeartoftheElements.cs index 718c929754..45437ee6e9 100644 --- a/Items/Accessories/HeartoftheElements.cs +++ b/Items/Accessories/HeartoftheElements.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Items.Accessories public override bool CanEquipAccessory(Player player, int slot, bool modded) { CalamityPlayer modPlayer = player.Calamity(); - if (modPlayer.brimElemental || modPlayer.sandElemental || modPlayer.oasisElemental || modPlayer.cloudElemental || modPlayer.waterElemental) + if (modPlayer.brimElemental.HasValue || modPlayer.sandElemental.HasValue || modPlayer.oasisElemental.HasValue || modPlayer.cloudElemental.HasValue || modPlayer.waterElemental.HasValue) { return false; } @@ -50,7 +50,7 @@ namespace CalamityMod.Items.Accessories Lighting.AddLight((int)player.Center.X / 16, (int)player.Center.Y / 16, Main.DiscoR / 255f, Main.DiscoG / 255f, Main.DiscoB / 255f); CalamityPlayer modPlayer = player.Calamity(); - modPlayer.allElementals = true; + modPlayer.allElementals = !hideVisual; int brimmy = ProjectileType(); int siren = ProjectileType(); diff --git a/Items/Accessories/OasisElementalinaBottle.cs b/Items/Accessories/OasisElementalinaBottle.cs index ac3b466f00..fbdc11ce02 100644 --- a/Items/Accessories/OasisElementalinaBottle.cs +++ b/Items/Accessories/OasisElementalinaBottle.cs @@ -26,12 +26,12 @@ namespace CalamityMod.Items.Accessories Item.accessory = true; } - public override bool CanEquipAccessory(Player player, int slot, bool modded) => !player.Calamity().allElementals; + public override bool CanEquipAccessory(Player player, int slot, bool modded) => !player.Calamity().allElementals.HasValue; public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.oasisElemental = true; + modPlayer.oasisElemental = !hideVisual; if (player.whoAmI == Main.myPlayer) { if (player.FindBuffIndex(ModContent.BuffType()) == -1) diff --git a/Items/Accessories/PearlofEnthrallment.cs b/Items/Accessories/PearlofEnthrallment.cs index e739630aae..03aa737e0a 100644 --- a/Items/Accessories/PearlofEnthrallment.cs +++ b/Items/Accessories/PearlofEnthrallment.cs @@ -29,12 +29,12 @@ namespace CalamityMod.Items.Accessories Item.accessory = true; } - public override bool CanEquipAccessory(Player player, int slot, bool modded) => !player.Calamity().allElementals; + public override bool CanEquipAccessory(Player player, int slot, bool modded) => !player.Calamity().allElementals.HasValue; public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.waterElemental = true; + modPlayer.waterElemental = !hideVisual; if (player.whoAmI == Main.myPlayer) { var source = player.GetSource_Accessory(Item); diff --git a/Items/Accessories/RoseStone.cs b/Items/Accessories/RoseStone.cs index e27ceb86df..3d63327597 100644 --- a/Items/Accessories/RoseStone.cs +++ b/Items/Accessories/RoseStone.cs @@ -26,12 +26,12 @@ namespace CalamityMod.Items.Accessories Item.accessory = true; } - public override bool CanEquipAccessory(Player player, int slot, bool modded) => !player.Calamity().allElementals; + public override bool CanEquipAccessory(Player player, int slot, bool modded) => !player.Calamity().allElementals.HasValue; public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.brimElemental = true; + modPlayer.brimElemental = !hideVisual; if (player.whoAmI == Main.myPlayer) { var source = player.GetSource_Accessory(Item); diff --git a/Items/Armor/Auric/AuricTeslaHeadRogue.cs b/Items/Armor/Auric/AuricTeslaHeadRogue.cs index ffe8c73ddf..7283be269e 100644 --- a/Items/Armor/Auric/AuricTeslaHeadRogue.cs +++ b/Items/Armor/Auric/AuricTeslaHeadRogue.cs @@ -50,7 +50,6 @@ namespace CalamityMod.Items.Armor.Auric modPlayer.tarraSet = true; modPlayer.tarraThrowing = true; modPlayer.bloodflareSet = true; - modPlayer.bloodflareThrowing = true; modPlayer.godSlayer = true; modPlayer.godSlayerThrowing = true; modPlayer.auricSet = true; @@ -87,8 +86,8 @@ namespace CalamityMod.Items.Armor.Auric Color[] armorColors = { AuricTeslaBodyArmor.tooltipTarragonColor, AuricTeslaBodyArmor.tooltipBloodflareColor, AuricTeslaBodyArmor.tooltipGodslayerColor }; var LocalizedText = CalamityUtils.GetTextFromModItem(Type, $"SetBonus{setBonusTooltipNumber}"); line.Text = (setBonusTooltipNumber == 3 ? LocalizedText.Format(RogueDamageBoostAtFullHealth.ToPercent(), SetBonusHurtDamageThreshold, CalamityKeybinds.GodSlayerDashHotKey.TooltipHotkeyString(), GodSlayerChestplate.DashCooldown.FramesToSeconds()) - : setBonusTooltipNumber == 2 ? LocalizedText.Format(DefenseBoostAboveHealthThreshold, DefenseBoostHealthThreshold.ToPercent()) - : LocalizedText.Format(CritsToActivateImmunity, ImmunityDuration.FramesToSeconds(), ImmunityCooldown.FramesToSeconds(), RogueDamageBoostWhileDebuffed.ToPercent())); + : setBonusTooltipNumber == 2 ? LocalizedText.ToString() + : LocalizedText.Format(CritsToActivateImmunity, ImmunityDuration.FramesToSeconds(), ImmunityCooldown.FramesToSeconds())); line.OverrideColor = armorColors[setBonusTooltipNumber - 1]; } } diff --git a/Items/Armor/Bloodflare/BloodflareHeadRogue.cs b/Items/Armor/Bloodflare/BloodflareHeadRogue.cs index 230ad7fed4..53e92279dc 100644 --- a/Items/Armor/Bloodflare/BloodflareHeadRogue.cs +++ b/Items/Armor/Bloodflare/BloodflareHeadRogue.cs @@ -21,8 +21,6 @@ namespace CalamityMod.Items.Armor.Bloodflare // Set Bonus public static float SetBonusRogueStealth = 1.2f; - public static int DefenseBoostAboveHealthThreshold = 30; - public static float DefenseBoostHealthThreshold = 0.8f; public override void SetDefaults() { @@ -41,10 +39,9 @@ namespace CalamityMod.Items.Armor.Bloodflare { var modPlayer = player.Calamity(); modPlayer.bloodflareSet = true; - modPlayer.bloodflareThrowing = true; modPlayer.rogueStealthMax += SetBonusRogueStealth; modPlayer.wearingRogueArmor = true; - player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth(), DefenseBoostAboveHealthThreshold, DefenseBoostHealthThreshold.ToPercent()); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth()); } public override void UpdateEquip(Player player) diff --git a/Items/Armor/Demonshade/DemonshadeGreaves.cs b/Items/Armor/Demonshade/DemonshadeGreaves.cs index 1afb8f1d2c..153c39dc9d 100644 --- a/Items/Armor/Demonshade/DemonshadeGreaves.cs +++ b/Items/Armor/Demonshade/DemonshadeGreaves.cs @@ -2,6 +2,7 @@ using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Demonshade @@ -14,6 +15,7 @@ namespace CalamityMod.Items.Armor.Demonshade // Shadow Speed... (elusive) public static float MoveSpeedBoost = 0.3f; public static float AccelerationBoost = 0.5f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MoveSpeedBoost.ToPercent(), AccelerationBoost.ToPercent()); public override void SetDefaults() { diff --git a/Items/Armor/Statigel/StatigelHeadSummon.cs b/Items/Armor/Statigel/StatigelHeadSummon.cs index 508f21ec18..b237a888d9 100644 --- a/Items/Armor/Statigel/StatigelHeadSummon.cs +++ b/Items/Armor/Statigel/StatigelHeadSummon.cs @@ -47,18 +47,13 @@ namespace CalamityMod.Items.Armor.Statigel if (player.whoAmI == Main.myPlayer) { var source = player.GetSource_Accessory(Item); - if (player.FindBuffIndex(ModContent.BuffType()) == -1) - { - player.AddBuff(ModContent.BuffType(), 3600, true); - } + if (player.FindBuffIndex(ModContent.BuffType()) == -1) + player.AddBuff(ModContent.BuffType(), 3600, true); int minionID = -1; int minionDamage = (int)player.GetTotalDamage().ApplyTo(SlimeDamage); - - if (WorldGen.crimson && player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) - minionID = Projectile.NewProjectile(source, player.Center, -Vector2.UnitY, ModContent.ProjectileType(), minionDamage, 0f, Main.myPlayer); - else if (!WorldGen.crimson && player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) - minionID = Projectile.NewProjectile(source, player.Center, -Vector2.UnitY, ModContent.ProjectileType(), minionDamage, 0f, Main.myPlayer); + if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) + minionID = Projectile.NewProjectile(source, player.Center, -Vector2.UnitY, ModContent.ProjectileType(), minionDamage, 0f, Main.myPlayer); if (Main.projectile.IndexInRange(minionID)) Main.projectile[minionID].originalDamage = SlimeDamage; diff --git a/Items/Armor/Tarragon/TarragonHeadRogue.cs b/Items/Armor/Tarragon/TarragonHeadRogue.cs index 70adc74719..4144fe0ee4 100644 --- a/Items/Armor/Tarragon/TarragonHeadRogue.cs +++ b/Items/Armor/Tarragon/TarragonHeadRogue.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Items.Armor.Tarragon modPlayer.tarraThrowing = true; modPlayer.rogueStealthMax += SetBonusRogueStealth; modPlayer.wearingRogueArmor = true; - player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth(), CritsToActivateImmunity, ImmunityDuration.FramesToSeconds(), ImmunityCooldown.FramesToSeconds(), RogueDamageBoostWhileDebuffed.ToPercent()); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth(), CritsToActivateImmunity, ImmunityDuration.FramesToSeconds(), ImmunityCooldown.FramesToSeconds()); } public override void UpdateEquip(Player player) diff --git a/Items/CalamityGlobalItemLoot.cs b/Items/CalamityGlobalItemLoot.cs index a3bf25dbd3..3d3ed8176e 100644 --- a/Items/CalamityGlobalItemLoot.cs +++ b/Items/CalamityGlobalItemLoot.cs @@ -76,7 +76,8 @@ namespace CalamityMod.Items ItemID.LucyTheAxe, ItemID.PewMaticHorn, ItemID.WeatherPain, - ItemID.HoundiusShootius + ItemID.HoundiusShootius, + ModContent.ItemType() }; loot.Add(DropHelper.CalamityStyle(DropHelper.BagWeaponDropRateFraction, deerclopsWeapons)); loot.AddRevBagAccessories(); diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index ed39fe7901..1ff8523654 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -1669,14 +1669,6 @@ namespace CalamityMod.Items return false; } - - // Rainbow effect originally made for Orderbringer because it used to have a special rarity - // But why did it have one in the first place?? - // Might be used for Miracle stuff later or something idk - /*if (line.Name == "ItemName" && line.Mod == "Terraria" && item.type == ModContent.ItemType()) - { - - }*/ return true; } #endregion diff --git a/Items/Fishing/StuffedFish.cs b/Items/Fishing/StuffedFish.cs index 658d83fb17..4ee77f6e42 100644 --- a/Items/Fishing/StuffedFish.cs +++ b/Items/Fishing/StuffedFish.cs @@ -112,31 +112,6 @@ namespace CalamityMod.Items.Fishing } else CalamityMod.Log.Warn("Could not find either Marine Kelp or Marine Kelp Seeds from Thorium. These items will not be added to Stuffed Fish."); - - // Ozzatron 30DEC2022: It is unlikely SoA will ever be ported to 1.4 and beyond. Commenting this out indefinitely. - /* - Mod soa = CalamityMod.Instance.soa; - if (soa is not null) - { - try - { - itemLoot.Add(soa.Find("Welkinbell").Type, 4, herbMin, herbMax); - itemLoot.Add(soa.Find("WelkinbellSeeds").Type, 10, seedMin, seedMax); - - itemLoot.AddIf(() => Main.hardMode, soa.Find("Illumifern").Type, 4, herbMin, herbMax); - itemLoot.AddIf(() => Main.hardMode, soa.Find("IllumifernSeeds").Type, 10, seedMin, seedMax); - - // TODO -- There is no way to determine if SoA's Abaddon is dead without reflection. - // Dan Yami has confirmed that downed calls will be added to SoA eventually. - //itemLoot.AddIf(() => SacredTools.ModdedWorld.downedAbaddon, soa.Find("Enduflora").Type, 4, herbMin, herbMax); - //itemLoot.AddIf(() => SacredTools.ModdedWorld.downedAbaddon, soa.Find("EndufloraSeeds").Type, 10, seedMin, seedMax); - } - catch - { - CalamityMod.Log.Debug("One of the items in this file got renamed internally. Please report this in the #bugs-read-pins channel of the official Calamity discord server."); - } - } - */ } public override void ModifyTooltips(List list) diff --git a/Items/Placeables/Pylons/CragsPylon.cs b/Items/Placeables/Pylons/CragsPylon.cs index 43631e2f86..ffa871b73e 100644 --- a/Items/Placeables/Pylons/CragsPylon.cs +++ b/Items/Placeables/Pylons/CragsPylon.cs @@ -16,15 +16,5 @@ namespace CalamityMod.Items.Placeables.Pylons Item.value = Item.sellPrice(gold: 2); Item.rare = ItemRarityID.Blue; } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(15). - AddIngredient(10). - AddIngredient(ItemID.Hellstone, 15). - AddTile(TileID.Anvils). - Register(); - } } } diff --git a/Items/Tools/AbyssalWarhammer.cs b/Items/Tools/AbyssalWarhammer.cs index 9339432c58..678cc439c1 100644 --- a/Items/Tools/AbyssalWarhammer.cs +++ b/Items/Tools/AbyssalWarhammer.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Tools Item.DamageType = DamageClass.Melee; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; - Item.value = CalamityGlobalItem.RarityPinkBuyPrice; + Item.value = Item.sellPrice(gold: 3); Item.rare = ItemRarityID.Pink; Item.UseSound = SoundID.Item1; Item.autoReuse = true; diff --git a/Items/Tools/AcidwoodHammer.cs b/Items/Tools/AcidwoodHammer.cs index 4bd66b4d49..e658cafe7d 100644 --- a/Items/Tools/AcidwoodHammer.cs +++ b/Items/Tools/AcidwoodHammer.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Placeables.FurnitureAcidwood; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -20,7 +21,7 @@ namespace CalamityMod.Items.Tools Item.height = 40; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; - Item.value = CalamityGlobalItem.RarityWhiteBuyPrice; + Item.value = Item.sellPrice(copper: 10); Item.rare = ItemRarityID.White; Item.UseSound = SoundID.Item1; Item.autoReuse = true; diff --git a/Items/Tools/AerialHamaxe.cs b/Items/Tools/AerialHamaxe.cs index 844958f74b..c3ae9180cc 100644 --- a/Items/Tools/AerialHamaxe.cs +++ b/Items/Tools/AerialHamaxe.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Tools Item.DamageType = DamageClass.Melee; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; - Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; + Item.value = Item.sellPrice(silver: 60); Item.rare = ItemRarityID.Orange; Item.UseSound = SoundID.Item1; Item.autoReuse = true; diff --git a/Items/Tools/AstralHamaxe.cs b/Items/Tools/AstralHamaxe.cs index 0caf445b78..67e8841a37 100644 --- a/Items/Tools/AstralHamaxe.cs +++ b/Items/Tools/AstralHamaxe.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Tools Item.DamageType = DamageClass.Melee; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; - Item.value = CalamityGlobalItem.RarityCyanBuyPrice; + Item.value = Item.sellPrice(gold: 4, silver: 50); Item.rare = ItemRarityID.Cyan; Item.UseSound = SoundID.Item1; Item.autoReuse = true; diff --git a/Items/Tools/AstralPickaxe.cs b/Items/Tools/AstralPickaxe.cs index a0fc904380..057b95af8e 100644 --- a/Items/Tools/AstralPickaxe.cs +++ b/Items/Tools/AstralPickaxe.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Tools Item.DamageType = DamageClass.Melee; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; - Item.value = CalamityGlobalItem.RarityCyanBuyPrice; + Item.value = Item.sellPrice(gold: 6); Item.rare = ItemRarityID.Cyan; Item.UseSound = SoundID.Item1; Item.autoReuse = true; diff --git a/Items/Tools/BeastialPickaxe.cs b/Items/Tools/BeastialPickaxe.cs index 9269689fc5..79ca39fa45 100644 --- a/Items/Tools/BeastialPickaxe.cs +++ b/Items/Tools/BeastialPickaxe.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Tools Item.DamageType = DamageClass.Melee; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; - Item.value = CalamityGlobalItem.RarityLimeBuyPrice; + Item.value = Item.sellPrice(gold: 4, silver: 35); Item.rare = ItemRarityID.Lime; Item.UseSound = SoundID.Item1; Item.autoReuse = true; diff --git a/Items/Tools/BerserkerWaraxe.cs b/Items/Tools/BerserkerWaraxe.cs index 9f08128517..fc796fc844 100644 --- a/Items/Tools/BerserkerWaraxe.cs +++ b/Items/Tools/BerserkerWaraxe.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Tools Item.DamageType = DamageClass.Melee; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; - Item.value = CalamityGlobalItem.RarityLimeBuyPrice; + Item.value = Item.sellPrice(gold: 4, silver: 35); Item.rare = ItemRarityID.Lime; Item.UseSound = SoundID.Item1; Item.autoReuse = true; diff --git a/Items/Tools/BlossomPickaxe.cs b/Items/Tools/BlossomPickaxe.cs index 3af6f63a84..6735a14072 100644 --- a/Items/Tools/BlossomPickaxe.cs +++ b/Items/Tools/BlossomPickaxe.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Tools Item.DamageType = DamageClass.Melee; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; - Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; + Item.value = Item.sellPrice(gold: 10); Item.UseSound = SoundID.Item1; Item.autoReuse = true; Item.rare = ModContent.RarityType(); diff --git a/Items/Tools/DriftwoodHammer.cs b/Items/Tools/DriftwoodHammer.cs index 4db3883330..068c0cb4c4 100644 --- a/Items/Tools/DriftwoodHammer.cs +++ b/Items/Tools/DriftwoodHammer.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Tools Item.height = 42; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; - Item.value = CalamityGlobalItem.RarityWhiteBuyPrice; + Item.value = Item.sellPrice(copper: 10); Item.rare = ItemRarityID.White; Item.UseSound = SoundID.Item1; Item.autoReuse = true; diff --git a/Items/Tools/Gelpick.cs b/Items/Tools/Gelpick.cs index fc35ce49da..8b55543de4 100644 --- a/Items/Tools/Gelpick.cs +++ b/Items/Tools/Gelpick.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Tools Item.DamageType = DamageClass.Melee; Item.useStyle = ItemUseStyleID.Swing; - Item.value = CalamityGlobalItem.RarityLightRedBuyPrice; + Item.value = Item.sellPrice(silver: 75); Item.rare = ItemRarityID.LightRed; Item.UseSound = SoundID.Item1; Item.autoReuse = true; diff --git a/Items/Tools/GenesisPickaxe.cs b/Items/Tools/GenesisPickaxe.cs index 444ac16aac..6672362d5d 100644 --- a/Items/Tools/GenesisPickaxe.cs +++ b/Items/Tools/GenesisPickaxe.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Tools Item.DamageType = DamageClass.Melee; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; - Item.value = CalamityGlobalItem.RarityRedBuyPrice; + Item.value = Item.sellPrice(gold: 7); Item.rare = ItemRarityID.Red; Item.UseSound = SoundID.Item1; Item.autoReuse = true; diff --git a/Items/Tools/GreatbayPickaxe.cs b/Items/Tools/GreatbayPickaxe.cs index ca95c84031..bd7f066dfb 100644 --- a/Items/Tools/GreatbayPickaxe.cs +++ b/Items/Tools/GreatbayPickaxe.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -20,7 +21,7 @@ namespace CalamityMod.Items.Tools Item.DamageType = DamageClass.Melee; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; - Item.value = CalamityGlobalItem.RarityGreenBuyPrice; + Item.value = Item.sellPrice(silver: 30); Item.rare = ItemRarityID.Green; Item.UseSound = SoundID.Item1; Item.autoReuse = true; diff --git a/Items/Tools/MarniteDeconstructor.cs b/Items/Tools/MarniteDeconstructor.cs index 25f1c986f9..38d4bc78d6 100644 --- a/Items/Tools/MarniteDeconstructor.cs +++ b/Items/Tools/MarniteDeconstructor.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Items.Tools Item.noMelee = true; Item.noUseGraphic = true; - Item.value = CalamityGlobalItem.RarityBlueBuyPrice; + Item.value = Item.sellPrice(silver: 30); Item.rare = ItemRarityID.Blue; } diff --git a/Items/Tools/MarniteObliterator.cs b/Items/Tools/MarniteObliterator.cs index 4e8ffccdb8..3ee7960dd3 100644 --- a/Items/Tools/MarniteObliterator.cs +++ b/Items/Tools/MarniteObliterator.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Items.Tools Item.noMelee = true; Item.noUseGraphic = true; - Item.value = CalamityGlobalItem.RarityBlueBuyPrice; + Item.value = Item.sellPrice(silver: 30); Item.rare = ItemRarityID.Blue; } diff --git a/Items/Tools/MonolithHammer.cs b/Items/Tools/MonolithHammer.cs index 0280dc5695..1f8cca426d 100644 --- a/Items/Tools/MonolithHammer.cs +++ b/Items/Tools/MonolithHammer.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Tools Item.height = 44; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; - Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; + Item.value = Item.sellPrice(silver: 75); Item.rare = ItemRarityID.Orange; Item.UseSound = SoundID.Item1; Item.autoReuse = true; diff --git a/Items/Tools/ReefclawHamaxe.cs b/Items/Tools/ReefclawHamaxe.cs index 366d49d15d..d896019c96 100644 --- a/Items/Tools/ReefclawHamaxe.cs +++ b/Items/Tools/ReefclawHamaxe.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -21,7 +22,7 @@ namespace CalamityMod.Items.Tools Item.DamageType = DamageClass.Melee; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; - Item.value = CalamityGlobalItem.RarityGreenBuyPrice; + Item.value = Item.sellPrice(silver: 30); Item.rare = ItemRarityID.Green; Item.UseSound = SoundID.Item1; Item.autoReuse = true; diff --git a/Items/Tools/SeismicHampick.cs b/Items/Tools/SeismicHampick.cs index 626b208649..2c2afae96a 100644 --- a/Items/Tools/SeismicHampick.cs +++ b/Items/Tools/SeismicHampick.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Tools Item.DamageType = DamageClass.Melee; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; - Item.value = CalamityGlobalItem.RarityYellowBuyPrice; + Item.value = Item.sellPrice(gold: 4, silver: 35); Item.rare = ItemRarityID.Yellow; Item.UseSound = SoundID.Item1; Item.autoReuse = true; diff --git a/Items/Tools/ShardlightPickaxe.cs b/Items/Tools/ShardlightPickaxe.cs index 019d52c300..07cf62c106 100644 --- a/Items/Tools/ShardlightPickaxe.cs +++ b/Items/Tools/ShardlightPickaxe.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Tools Item.DamageType = DamageClass.Melee; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; - Item.value = CalamityGlobalItem.RarityPinkBuyPrice; + Item.value = Item.sellPrice(gold: 3); Item.rare = ItemRarityID.Pink; Item.UseSound = SoundID.Item1; Item.autoReuse = true; diff --git a/Items/Tools/SkyfringePickaxe.cs b/Items/Tools/SkyfringePickaxe.cs index f92338d42d..6075a10ee8 100644 --- a/Items/Tools/SkyfringePickaxe.cs +++ b/Items/Tools/SkyfringePickaxe.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Tools Item.DamageType = DamageClass.Melee; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; - Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; + Item.value = Item.sellPrice(silver: 60); Item.rare = ItemRarityID.Orange; Item.UseSound = SoundID.Item1; Item.autoReuse = true; diff --git a/Items/Tools/SpawnBlocker/AntiCystOintment.cs b/Items/Tools/SpawnBlocker/AntiCystOintment.cs index 08abe17ffe..113db25d9e 100644 --- a/Items/Tools/SpawnBlocker/AntiCystOintment.cs +++ b/Items/Tools/SpawnBlocker/AntiCystOintment.cs @@ -60,45 +60,6 @@ namespace CalamityMod.Items.Tools.SpawnBlocker player.Calamity().disablePerfCystSpawns |= Enabled; } - /* - public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frameI, Color drawColor, Color itemColor, Vector2 origin, float scale) - { - Texture2D texture; - - if (state) - { - //Replace with enabled texture - texture = ModContent.Request("CalamityMod/Items/AntiCystOintment").Value; - spriteBatch.Draw(texture, position, null, Color.White, 0f, origin, scale, SpriteEffects.None, 0); - } - else - { - texture = ModContent.Request("CalamityMod/Items/AntiCystOintment").Value; - spriteBatch.Draw(texture, position, null, 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; - - if (state) - { - //Replace with enabled texture - texture = ModContent.Request("CalamityMod/Items/AntiCystOintment").Value; - spriteBatch.Draw(texture, Item.position - Main.screenPosition, null, lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - } - else - { - texture = ModContent.Request("CalamityMod/Items/AntiCystOintment").Value; - spriteBatch.Draw(texture, Item.position - Main.screenPosition, null, lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - } - return false; - } - */ - public override void ModifyTooltips(List tooltips) { string text; diff --git a/Items/Tools/SpawnBlocker/AntiTumorOintment.cs b/Items/Tools/SpawnBlocker/AntiTumorOintment.cs index 564dc8d4c3..97b59f6657 100644 --- a/Items/Tools/SpawnBlocker/AntiTumorOintment.cs +++ b/Items/Tools/SpawnBlocker/AntiTumorOintment.cs @@ -60,45 +60,6 @@ namespace CalamityMod.Items.Tools.SpawnBlocker player.Calamity().disableHiveCystSpawns |= Enabled; } - /* - public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frameI, Color drawColor, Color itemColor, Vector2 origin, float scale) - { - Texture2D texture; - - if (state) - { - //Replace with enabled texture - texture = ModContent.Request("CalamityMod/Items/AntiTumorOintment").Value; - spriteBatch.Draw(texture, position, null, Color.White, 0f, origin, scale, SpriteEffects.None, 0); - } - else - { - texture = ModContent.Request("CalamityMod/Items/AntiTumorOintment").Value; - spriteBatch.Draw(texture, position, null, 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; - - if (state) - { - //Replace with enabled texture - texture = ModContent.Request("CalamityMod/Items/AntiTumorOintment").Value; - spriteBatch.Draw(texture, Item.position - Main.screenPosition, null, lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - } - else - { - texture = ModContent.Request("CalamityMod/Items/AntiTumorOintment").Value; - spriteBatch.Draw(texture, Item.position - Main.screenPosition, null, lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - } - return false; - } - */ - public override void ModifyTooltips(List tooltips) { string text; diff --git a/Items/Tools/SpawnBlocker/BleachBall.cs b/Items/Tools/SpawnBlocker/BleachBall.cs index c2c6df1948..1cf4051fc4 100644 --- a/Items/Tools/SpawnBlocker/BleachBall.cs +++ b/Items/Tools/SpawnBlocker/BleachBall.cs @@ -61,45 +61,6 @@ namespace CalamityMod.Items.Tools.SpawnBlocker player.Calamity().disableNaturalScourgeSpawns |= Enabled; } - /* - public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frameI, Color drawColor, Color itemColor, Vector2 origin, float scale) - { - Texture2D texture; - - if (state) - { - //Replace with enabled texture - texture = ModContent.Request("CalamityMod/Items/BleachBall").Value; - spriteBatch.Draw(texture, position, null, Color.White, 0f, origin, scale, SpriteEffects.None, 0); - } - else - { - texture = ModContent.Request("CalamityMod/Items/BleachBall").Value; - spriteBatch.Draw(texture, position, null, 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; - - if (state) - { - //Replace with enabled texture - texture = ModContent.Request("CalamityMod/Items/BleachBall").Value; - spriteBatch.Draw(texture, Item.position - Main.screenPosition, null, lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - } - else - { - texture = ModContent.Request("CalamityMod/Items/BleachBall").Value; - spriteBatch.Draw(texture, Item.position - Main.screenPosition, null, lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - } - return false; - } - */ - public override void ModifyTooltips(List tooltips) { string text; diff --git a/Items/Tools/SpawnBlocker/BrokenWaterFilter.cs b/Items/Tools/SpawnBlocker/BrokenWaterFilter.cs index 9740d03c89..5efb08dac3 100644 --- a/Items/Tools/SpawnBlocker/BrokenWaterFilter.cs +++ b/Items/Tools/SpawnBlocker/BrokenWaterFilter.cs @@ -60,45 +60,6 @@ namespace CalamityMod.Items.Tools.SpawnBlocker player.Calamity().noStupidNaturalARSpawns |= Enabled; } - /* - public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frameI, Color drawColor, Color itemColor, Vector2 origin, float scale) - { - Texture2D texture; - - if (state) - { - //Replace with enabled texture - texture = ModContent.Request("CalamityMod/Items/BrokenWaterFilter").Value; - spriteBatch.Draw(texture, position, null, Color.White, 0f, origin, scale, SpriteEffects.None, 0); - } - else - { - texture = ModContent.Request("CalamityMod/Items/BrokenWaterFilter").Value; - spriteBatch.Draw(texture, position, null, 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; - - if (state) - { - //Replace with enabled texture - texture = ModContent.Request("CalamityMod/Items/BrokenWaterFilter").Value; - spriteBatch.Draw(texture, Item.position - Main.screenPosition, null, lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - } - else - { - texture = ModContent.Request("CalamityMod/Items/BrokenWaterFilter").Value; - spriteBatch.Draw(texture, Item.position - Main.screenPosition, null, lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - } - return false; - } - */ - public override void ModifyTooltips(List tooltips) { string text; diff --git a/Items/Tools/SpawnBlocker/SirenproofEarMuffs.cs b/Items/Tools/SpawnBlocker/SirenproofEarMuffs.cs index 29c1e1e10d..f467ff0e9c 100644 --- a/Items/Tools/SpawnBlocker/SirenproofEarMuffs.cs +++ b/Items/Tools/SpawnBlocker/SirenproofEarMuffs.cs @@ -60,45 +60,6 @@ namespace CalamityMod.Items.Tools.SpawnBlocker player.Calamity().disableAnahitaSpawns |= Enabled; } - /* - public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frameI, Color drawColor, Color itemColor, Vector2 origin, float scale) - { - Texture2D texture; - - if (state) - { - //Replace with enabled texture - texture = ModContent.Request("CalamityMod/Items/SirenproofEarMuffs").Value; - spriteBatch.Draw(texture, position, null, Color.White, 0f, origin, scale, SpriteEffects.None, 0); - } - else - { - texture = ModContent.Request("CalamityMod/Items/SirenproofEarMuffs").Value; - spriteBatch.Draw(texture, position, null, 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; - - if (state) - { - //Replace with enabled texture - texture = ModContent.Request("CalamityMod/Items/SirenproofEarMuffs").Value; - spriteBatch.Draw(texture, Item.position - Main.screenPosition, null, lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - } - else - { - texture = ModContent.Request("CalamityMod/Items/SirenproofEarMuffs").Value; - spriteBatch.Draw(texture, Item.position - Main.screenPosition, null, lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - } - return false; - } - */ - public override void ModifyTooltips(List tooltips) { string text; diff --git a/Items/Tools/SpawnBlocker/VoodooDemonVoodooDoll.cs b/Items/Tools/SpawnBlocker/VoodooDemonVoodooDoll.cs index dd57546bb3..910e38e235 100644 --- a/Items/Tools/SpawnBlocker/VoodooDemonVoodooDoll.cs +++ b/Items/Tools/SpawnBlocker/VoodooDemonVoodooDoll.cs @@ -62,45 +62,6 @@ namespace CalamityMod.Items.Tools.SpawnBlocker player.Calamity().disableVoodooSpawns |= Enabled; } - /* - public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frameI, Color drawColor, Color itemColor, Vector2 origin, float scale) - { - Texture2D texture; - - if (state) - { - //Replace with enabled texture - texture = ModContent.Request("CalamityMod/Items/VoodooDemonVoodooDoll").Value; - spriteBatch.Draw(texture, position, null, Color.White, 0f, origin, scale, SpriteEffects.None, 0); - } - else - { - texture = ModContent.Request("CalamityMod/Items/VoodooDemonVoodooDoll").Value; - spriteBatch.Draw(texture, position, null, 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; - - if (state) - { - //Replace with enabled texture - texture = ModContent.Request("CalamityMod/Items/VoodooDemonVoodooDoll").Value; - spriteBatch.Draw(texture, Item.position - Main.screenPosition, null, lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - } - else - { - texture = ModContent.Request("CalamityMod/Items/VoodooDemonVoodooDoll").Value; - spriteBatch.Draw(texture, Item.position - Main.screenPosition, null, lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); - } - return false; - } - */ - public override void ModifyTooltips(List tooltips) { string text; diff --git a/Items/Tools/TectonicTruncator.cs b/Items/Tools/TectonicTruncator.cs index 8e56a87c84..bd96781b42 100644 --- a/Items/Tools/TectonicTruncator.cs +++ b/Items/Tools/TectonicTruncator.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Tools Item.DamageType = DamageClass.Melee; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; - Item.value = CalamityGlobalItem.RarityYellowBuyPrice; + Item.value = Item.sellPrice(gold: 4, silver: 35); Item.rare = ItemRarityID.Yellow; Item.UseSound = SoundID.Item1; Item.autoReuse = true; diff --git a/Items/Tools/WulfrumDrill.cs b/Items/Tools/WulfrumDrill.cs index a7e47e03ea..62114d39e4 100644 --- a/Items/Tools/WulfrumDrill.cs +++ b/Items/Tools/WulfrumDrill.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Items.Tools Item.noMelee = true; Item.noUseGraphic = true; - Item.value = CalamityGlobalItem.RarityBlueBuyPrice; + Item.value = Item.sellPrice(silver: 5); Item.rare = ItemRarityID.Blue; } diff --git a/Items/TreasureBags/SlimeGodBag.cs b/Items/TreasureBags/SlimeGodBag.cs index 9889e3fbe4..44657ccb8d 100644 --- a/Items/TreasureBags/SlimeGodBag.cs +++ b/Items/TreasureBags/SlimeGodBag.cs @@ -68,8 +68,7 @@ namespace CalamityMod.Items.TreasureBags ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType() + ModContent.ItemType() })); // Equipment diff --git a/Items/Weapons/Magic/UndinesRetribution.cs b/Items/Weapons/Magic/UndinesRetribution.cs index 2213a85c36..24d5d80277 100644 --- a/Items/Weapons/Magic/UndinesRetribution.cs +++ b/Items/Weapons/Magic/UndinesRetribution.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Items.Weapons.Magic } for (int i = 0; i < 3; i++) { - realPlayerPos = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(51) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - /* - */ player.position.X), player.MountedCenter.Y + 600f); //- + realPlayerPos = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(51) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y + 600f); //- realPlayerPos.X = (realPlayerPos.X + player.Center.X) / 2f + (float)Main.rand.Next(-50, 51); //200 realPlayerPos.Y += (float)(100 * i); //-= mouseXDist = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X; //+ - diff --git a/Items/Weapons/Melee/ForsakenSaber.cs b/Items/Weapons/Melee/ForsakenSaber.cs index bc4f7501e2..8c1b78c6dc 100644 --- a/Items/Weapons/Melee/ForsakenSaber.cs +++ b/Items/Weapons/Melee/ForsakenSaber.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetDefaults() { - Item.width = 46; - Item.height = 56; + Item.width = 66; + Item.height = 74; Item.damage = 80; Item.DamageType = DamageClass.Melee; Item.useAnimation = Item.useTime = 15; diff --git a/Items/Weapons/Melee/ForsakenSaber.png b/Items/Weapons/Melee/ForsakenSaber.png index 950f44264d..50b0db511a 100644 Binary files a/Items/Weapons/Melee/ForsakenSaber.png and b/Items/Weapons/Melee/ForsakenSaber.png differ diff --git a/Items/Weapons/Melee/MawOfInfinity.cs b/Items/Weapons/Melee/MawOfInfinity.cs index 5d1f55e272..5c68403adf 100644 --- a/Items/Weapons/Melee/MawOfInfinity.cs +++ b/Items/Weapons/Melee/MawOfInfinity.cs @@ -25,8 +25,8 @@ namespace CalamityMod.Items.Weapons.Melee } public override void SetDefaults() { - Item.width = 78; - Item.height = 94; + Item.width = 74; + Item.height = 84; Item.damage = 2080; Item.DamageType = DamageClass.Melee; Item.useTime = Item.useAnimation = 33; diff --git a/Items/Weapons/Melee/MawOfInfinity.png b/Items/Weapons/Melee/MawOfInfinity.png index 077d762192..849fc2a04a 100644 Binary files a/Items/Weapons/Melee/MawOfInfinity.png and b/Items/Weapons/Melee/MawOfInfinity.png differ diff --git a/Items/Weapons/Melee/MawOfInfinityGlow.png b/Items/Weapons/Melee/MawOfInfinityGlow.png index 6525db49f3..0fa16f3476 100644 Binary files a/Items/Weapons/Melee/MawOfInfinityGlow.png and b/Items/Weapons/Melee/MawOfInfinityGlow.png differ diff --git a/Items/Weapons/Ranged/TheBallista.png b/Items/Weapons/Ranged/TheBallista.png index 5ab9abf9ef..2857b1f82e 100644 Binary files a/Items/Weapons/Ranged/TheBallista.png and b/Items/Weapons/Ranged/TheBallista.png differ diff --git a/Items/Weapons/Rogue/SlickCane.png b/Items/Weapons/Rogue/SlickCane.png deleted file mode 100644 index 1aadfccbb4..0000000000 Binary files a/Items/Weapons/Rogue/SlickCane.png and /dev/null differ diff --git a/Items/Weapons/Rogue/SpearofPaleolith.png b/Items/Weapons/Rogue/SpearofPaleolith.png index a5d6a7b8cd..b292d5d958 100644 Binary files a/Items/Weapons/Rogue/SpearofPaleolith.png and b/Items/Weapons/Rogue/SpearofPaleolith.png differ diff --git a/Items/Weapons/Rogue/SlickCane.cs b/Items/Weapons/Rogue/WalkingCane.cs similarity index 67% rename from Items/Weapons/Rogue/SlickCane.cs rename to Items/Weapons/Rogue/WalkingCane.cs index 0331d03098..c2ec80ffb4 100644 --- a/Items/Weapons/Rogue/SlickCane.cs +++ b/Items/Weapons/Rogue/WalkingCane.cs @@ -3,17 +3,22 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class SlickCane : RogueWeapon + [LegacyName("SlickCane")] + public class WalkingCane : RogueWeapon { + public static float MoveSpeedBoost = 0.2f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MoveSpeedBoost.ToPercent()); + public override void SetDefaults() { - Item.width = 42; - Item.height = 36; - Item.damage = 50; + Item.width = 48; + Item.height = 44; + Item.damage = 40; Item.noMelee = true; Item.noUseGraphic = true; Item.channel = true; @@ -22,10 +27,10 @@ namespace CalamityMod.Items.Weapons.Rogue Item.knockBack = 6f; Item.UseSound = SoundID.DD2_GhastlyGlaivePierce; Item.autoReuse = true; - Item.value = Item.buyPrice(gold: 35); // Sold by Bandit + Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; Item.rare = ItemRarityID.Orange; - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 16f; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 20f; Item.DamageType = RogueDamageClass.Instance; } @@ -33,8 +38,8 @@ namespace CalamityMod.Items.Weapons.Rogue 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 * 1.5f * (float)player.direction; - int projectileIndex = Projectile.NewProjectile(source, position.X, position.Y+100, velocity.X*2f, velocity.Y*2f, type, damage, knockback, player.whoAmI, ai0, 0f); + float ai0 = Main.rand.NextFloat() * Item.shootSpeed * 1.5f * player.direction; + int projectileIndex = Projectile.NewProjectile(source, position + Vector2.UnitY * 100f, velocity * 2f, type, damage, knockback, player.whoAmI, ai0); if (projectileIndex.WithinBounds(Main.maxProjectiles)) Main.projectile[projectileIndex].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); return false; diff --git a/Items/Weapons/Rogue/WalkingCane.png b/Items/Weapons/Rogue/WalkingCane.png new file mode 100644 index 0000000000..9bf218ea8f Binary files /dev/null and b/Items/Weapons/Rogue/WalkingCane.png differ diff --git a/Items/Weapons/Summon/CorroslimeStaff.cs b/Items/Weapons/Summon/BlightedSlimeStaff.cs similarity index 82% rename from Items/Weapons/Summon/CorroslimeStaff.cs rename to Items/Weapons/Summon/BlightedSlimeStaff.cs index 4708a0d420..412247aad7 100644 --- a/Items/Weapons/Summon/CorroslimeStaff.cs +++ b/Items/Weapons/Summon/BlightedSlimeStaff.cs @@ -8,14 +8,15 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Summon { - public class CorroslimeStaff : ModItem, ILocalizedModType + [LegacyName("CorroslimeStaff", "CrimslimeStaff")] + public class BlightedSlimeStaff : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; public override void SetDefaults() { Item.width = 52; Item.height = 54; - Item.damage = 24; + Item.damage = 18; Item.mana = 10; Item.useAnimation = Item.useTime = 36; Item.useStyle = ItemUseStyleID.Swing; @@ -25,8 +26,8 @@ namespace CalamityMod.Items.Weapons.Summon Item.rare = ItemRarityID.LightRed; Item.UseSound = SoundID.Item44; Item.autoReuse = true; - Item.buffType = ModContent.BuffType(); - Item.shoot = ModContent.ProjectileType(); + Item.buffType = ModContent.BuffType(); + Item.shoot = ModContent.ProjectileType(); Item.DamageType = DamageClass.Summon; } diff --git a/Items/Weapons/Summon/CorroslimeStaff.png b/Items/Weapons/Summon/BlightedSlimeStaff.png similarity index 100% rename from Items/Weapons/Summon/CorroslimeStaff.png rename to Items/Weapons/Summon/BlightedSlimeStaff.png diff --git a/Items/Weapons/Summon/CrimslimeStaff.cs b/Items/Weapons/Summon/CrimslimeStaff.cs deleted file mode 100644 index fcef51fb1b..0000000000 --- a/Items/Weapons/Summon/CrimslimeStaff.cs +++ /dev/null @@ -1,42 +0,0 @@ -using CalamityMod.Items.Weapons.Ranged; -using CalamityMod.Buffs.Summon; -using CalamityMod.Projectiles.Summon; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.Summon -{ - public class CrimslimeStaff : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Weapons.Summon"; - public override void SetDefaults() - { - Item.width = 52; - Item.height = 52; - Item.damage = 24; - Item.mana = 10; - Item.useAnimation = Item.useTime = 36; - Item.useStyle = ItemUseStyleID.Swing; - Item.noMelee = true; - Item.knockBack = 2f; - Item.value = CalamityGlobalItem.RarityLightRedBuyPrice; - Item.rare = ItemRarityID.LightRed; - Item.UseSound = SoundID.Item44; - Item.autoReuse = true; - Item.buffType = ModContent.BuffType(); - Item.shoot = ModContent.ProjectileType(); - Item.DamageType = DamageClass.Summon; - } - - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) - { - player.AddBuff(Item.buffType, 2); - var minion = Projectile.NewProjectileDirect(source, player.ClampedMouseWorld(), Vector2.Zero, type, damage, knockback, player.whoAmI); - minion.originalDamage = Item.damage; - return false; - } - } -} diff --git a/Items/Weapons/Summon/CrimslimeStaff.png b/Items/Weapons/Summon/CrimslimeStaff.png deleted file mode 100644 index 3e40afc20b..0000000000 Binary files a/Items/Weapons/Summon/CrimslimeStaff.png and /dev/null differ diff --git a/Items/Weapons/Summon/DankStaff.cs b/Items/Weapons/Summon/DankStaff.cs index 744d8c80d3..9595289417 100644 --- a/Items/Weapons/Summon/DankStaff.cs +++ b/Items/Weapons/Summon/DankStaff.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 58; Item.height = 58; - Item.damage = 14; + Item.damage = 10; Item.mana = 10; Item.useAnimation = Item.useTime = 36; Item.useStyle = ItemUseStyleID.Swing; diff --git a/Items/Weapons/Summon/FleshOfInfidelity.cs b/Items/Weapons/Summon/FleshOfInfidelity.cs index 75b31facef..37ee050f6a 100644 --- a/Items/Weapons/Summon/FleshOfInfidelity.cs +++ b/Items/Weapons/Summon/FleshOfInfidelity.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 42; Item.height = 42; - Item.damage = 20; + Item.damage = 16; Item.DamageType = DamageClass.Summon; Item.buffType = ModContent.BuffType(); Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Summon/StaffOfNecrosteocytes.cs b/Items/Weapons/Summon/StaffOfNecrosteocytes.cs index 46d99f5fd5..c53423819a 100644 --- a/Items/Weapons/Summon/StaffOfNecrosteocytes.cs +++ b/Items/Weapons/Summon/StaffOfNecrosteocytes.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 52; Item.height = 54; - Item.damage = 31; + Item.damage = 25; Item.mana = 10; Item.useAnimation = Item.useTime = 36; Item.useStyle = ItemUseStyleID.Swing; diff --git a/Localization/en-US/Mods.CalamityMod.Buffs.hjson b/Localization/en-US/Mods.CalamityMod.Buffs.hjson index 4c04ee824d..f9c0f4336c 100644 --- a/Localization/en-US/Mods.CalamityMod.Buffs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Buffs.hjson @@ -1274,9 +1274,9 @@ BabyBloodCrawlerBuff: { Description: The baby blood crawler will protect you } -BabySlimeGodBuff: { - DisplayName: Baby Slime God - Description: The Slime God will protect you +BabyPaladinBuff: { + DisplayName: Baby Paladin + Description: The blighted paladin will protect you } BabyStormlionBuff: { @@ -1294,6 +1294,11 @@ BlackHawkBuff: { Description: The fighter jet will protect you } +BlightedSlime: { + DisplayName: Blighted Slime + Description: The blighted slime will protect you +} + BrimseekerBuff: { DisplayName: Brimseeker Description: Does it want something from you? @@ -1334,11 +1339,6 @@ CloudElemental: { Description: The Cloud Elemental will protect you } -Corroslime: { - DisplayName: Corroslime - Description: The corroslime will protect you -} - CorvidHarbringerBuff: { DisplayName: Raven Description: The powerful raven will protect you @@ -1359,11 +1359,6 @@ CosmilampBuff: { Description: The cosmilamp will protect you } -Crimslime: { - DisplayName: Crimslime - Description: The crimslime will protect you -} - DaedalusCrystalBuff: { DisplayName: Daedalus Crystal Description: The Daedalus crystal will protect you diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index 630795df12..44b5fad3b0 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -701,7 +701,11 @@ ElementalGauntlet: { ElementalinaBottle: { DisplayName: Elemental in a Bottle - Tooltip: Summons a sand elemental to fight for you + Tooltip: + ''' + Summons a sand elemental to fight for you + The elemental has reduced opacity if visibility is disabled + ''' } ElysianAegis: { @@ -758,7 +762,11 @@ EvasionScarf: { EyeoftheStorm: { DisplayName: Eye of the Storm - Tooltip: Summons a Cloud Elemental to fight for you + Tooltip: + ''' + Summons a Cloud Elemental to fight for you + The elemental has reduced opacity if visibility is disabled + ''' } FeatherCrown: { @@ -983,6 +991,7 @@ HeartoftheElements: { Tooltip: ''' Summons all elementals to protect you + The elementals have reduced opacity if visibility is disabled 'The heart of the world' ''' } @@ -1320,6 +1329,7 @@ PearlofEnthrallment: { ''' Summons a water elemental to fight for you The elemental stays above you, shooting water spears, ice mist, and treble clefs at nearby enemies + The elemental has reduced opacity if visibility is disabled ''' } @@ -1487,6 +1497,7 @@ OasisElementalinaBottle: { ''' Summons an oasis elemental to assist you The elemental fires healing orbs that restore 10 health while you are damaged + The elemental has reduced opacity if visibility is disabled ''' } @@ -1519,7 +1530,11 @@ RogueEmblem: { RoseStone: { DisplayName: Rose Stone - Tooltip: Summons a Brimstone Elemental to fight for you + Tooltip: + ''' + Summons a Brimstone Elemental to fight for you + The elemental has reduced opacity if visibility is disabled + ''' } RottenBrain: { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson b/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson index e7a6ec4fc8..9be46a57ac 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson @@ -249,11 +249,7 @@ BloodflareHeadRogue: { {$Common.RogueStealth} {$BloodflareHeadRogue.SetBonusEffect@1} ''' - SetBonusEffect: - ''' - Grants {0} defense when above {1}% life - {$BloodflareBodyArmor.CommonSetBonus} - ''' + SetBonusEffect: "{$BloodflareBodyArmor.CommonSetBonus}" } BloodflareHeadSummon: { @@ -285,13 +281,13 @@ DemonshadeBreastplate: { {$CommonItemTooltip.PercentIncreasedDamageCritChance@1} {$CommonItemTooltip.PercentIncreasedMeleeSpeed@2} {$CommonItemTooltip.PercentChanceToSaveAmmo@3} - Standing still absorbs shadows to grant exponentially accelerating life regen + Standing still grants exponentially accelerating life regen ''' } DemonshadeGreaves: { DisplayName: Demonshade Greaves - Tooltip: Shadow speed + Tooltip: "{$CommonItemTooltip.PercentIncreasedMovementSpeed} and {1}% increased acceleration" } DemonshadeHelm: { @@ -705,7 +701,6 @@ TarragonHeadRogue: { ''' After every {0} rogue critical hits you will gain {1} seconds of damage immunity This effect has a cooldown of {2} seconds - While under the effects of a debuff you gain {3}% increased rogue damage {$TarragonBreastplate.CommonSetBonus} ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson index a717d882de..172e65e32b 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson @@ -1245,7 +1245,7 @@ StygianShield: { DisplayName: Stygian Shield Tooltip: ''' - Hold to charge an omni-directional dash which slams through enemies + Hold to charge an omni-directional dash which grants immunity to damage and can slam through enemies to throw a buckler which bounces towards a nearby foe upon collision Grants knockback immunity and {0} defense while held However, dashes are disabled until you stop holding this weapon for {1} seconds diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson index 51e11a5e97..419a2e7967 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson @@ -1069,17 +1069,6 @@ SkyfinBombers: { ''' } -SlickCane: { - DisplayName: Slick Cane - Tooltip: - ''' - Swipes a cane that steals money from enemies - Stealth strikes give a 1 in 20 chance for enemies to drop 1-2 gold coins when hit - Stealth strikes boost damage in proportion to money in the inventory, up to 1 Platinum - 'Economy at its finest' - ''' -} - SludgeSplotch: { DisplayName: Sludge Splotch Tooltip: Stealth strikes cause the main ball of sludge to split on hit, inflicting more damage @@ -1359,6 +1348,17 @@ Vega: { ''' } +WalkingCane: { + DisplayName: Walking Cane + Tooltip: + ''' + Swipes a pointed walking cane + Stealth strikes drain the sanity of foes, causing shadow hands to be summoned when attacked + While held, increases movement speed by {0}% + 'Is it walking me, or am I walking it?' + ''' +} + WaveSkipper: { DisplayName: Wave Skipper Tooltip: diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson index a20ae74792..8292bc329c 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson @@ -85,6 +85,11 @@ BlackHawkRemote: { ''' } +BlightedSlimeStaff: { + DisplayName: Blighted Slime Staff + Tooltip: Summons a blighted slime to fight for you +} + BorealisBomber: { DisplayName: Borealis Bomber Tooltip: @@ -191,11 +196,6 @@ Cnidarian: { ''' } -CorroslimeStaff: { - DisplayName: Corroslime Staff - Tooltip: Summons a corro slime to fight for you -} - CorvidHarbringerStaff: { DisplayName: Corvid Harbinger Staff Tooltip: @@ -233,11 +233,6 @@ Cosmilamp: { Tooltip: Summons a cosmic lantern above your head to fight for you } -CrimslimeStaff: { - DisplayName: Crimslime Staff - Tooltip: Summons a crim slime to fight for you -} - CryogenicStaff: { DisplayName: Cryogenic Staff Tooltip: diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson index 6016a1e096..0701c2066f 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson @@ -19,6 +19,7 @@ AuralisBullet.DisplayName: Auralis Bullet AuricBullet.DisplayName: Auric Bullet AuroraFire.DisplayName: Aurora Blaze BallistaGreatArrow.DisplayName: Ballista Great Arrow +BallistaShard.DisplayName: Ballista Shard BarinadeArrow.DisplayName: Fin Arrow BlightFlames.DisplayName: Blight Flames BlissfulBombardierSplitProjectile.DisplayName: Profaned Mini-Rocket diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson index f4b7fda204..da54d5ac0c 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Summon.hjson @@ -35,11 +35,10 @@ BlackDragonHead.DisplayName: Black Celestial Dragon BlackDragonTail.DisplayName: Black Celestial Dragon BlackHawkBullet.DisplayName: Black Hawk Bullet BlackHawkSummon.DisplayName: Black Hawk +BlightedSlimeMinion.DisplayName: Blighted Slime BloodBreath.DisplayName: Blood Dragon Fire BloodRain.DisplayName: Blood Rain BloodSpit.DisplayName: Blood Spit -BoneMatter.DisplayName: Bone Matter -BoneMatter2.DisplayName: Bone Matter BrimseekerAuraBall.DisplayName: Seeker BrimstoneDartMinion.DisplayName: Brimfire BrimstoneDartSummon.DisplayName: Brimstone Dart @@ -64,8 +63,6 @@ CinderBlossom.DisplayName: Cinder Blossom CloudElementalMinion.DisplayName: Cloud Elemental CnidarianJellyfishOnTheString.DisplayName: Cnidarian CnidarianSpark.DisplayName: Cnidarian Spark -CorroslimeMinion.DisplayName: Corroslime -CorruptionSlimeGodMinion.DisplayName: Slime God CosmicBlast.DisplayName: Cosmic Blast CosmicBlastBig.DisplayName: Cosmic Blast CosmicEnergySpiral.DisplayName: Cosmic Energy @@ -76,8 +73,6 @@ CosmicViperSplittingRocket.DisplayName: Splitting Rocket CosmicViperSummon.DisplayName: Cosmic Viper CosmilampBeam.DisplayName: Cosmic Beam CosmilampMinion.DisplayName: Cosmilamp -CrimslimeMinion.DisplayName: Crimslime -CrimsonSlimeGodMinion.DisplayName: Slime God DaedalusCrystal.DisplayName: Daedalus Crystal DaedalusCrystalShot.DisplayName: Crystal Shot DaedalusGolem.DisplayName: Daedalus Golem @@ -284,6 +279,7 @@ SquirrelSquireAcorn.DisplayName: Squirrel Acorn SquirrelSquireMinion.DisplayName: Squirrel Squire Starforge.DisplayName: Starforge StarforgeBlast.DisplayName: Starforge Blast +StatigelBlightedSlime.DisplayName: Blighted Paladin StellarTorusBeam.DisplayName: Stellar Torus Beam StellarTorusSummon.DisplayName: Stellar Torus Summon StormjawBaby.DisplayName: Stormjaw Baby diff --git a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson index 4ce439ea10..74d6beff22 100644 --- a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson +++ b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson @@ -400,7 +400,7 @@ TavernkeepChat.FullMoon: Care for a little Moonshine? TaxCollectorChat: { DoGDefeated: Devourer of what, you said? Devourer of Funds, if its payroll is anything to go by! PreBrimmy: So those punks on Azafure think they can live for free on my lands? Tell you what, do my job there and I might give you a bonus. - HasSlickCane: Goodness! That cane has swagger! + HasWalkingCane: Goodness! That cane has swagger! Has100Plat: BAH! Doesn't seem like I'll ever be able to quarrel with the debts of the town again! Has500Plat: Where and how are you getting all of this money?! Scram, you have no need for me! } diff --git a/ModSupport/ModCalls.cs b/ModSupport/ModCalls.cs index f8e3246eb3..237ee67bae 100644 --- a/ModSupport/ModCalls.cs +++ b/ModSupport/ModCalls.cs @@ -877,90 +877,6 @@ namespace CalamityMod public static bool DisableAllDodges(bool disable) => Main.LocalPlayer.Calamity().disableAllDodges = disable; #endregion - #region Amalgam Potion Buff List - public static bool SetAmalgamBuffList(int type, bool shouldBeListed) - { - if (shouldBeListed && !CalamityBuffSets.BuffedByAmalgam[type]) - { - CalamityBuffSets.BuffedByAmalgam[type] = true; - return true; - } - else if (!shouldBeListed) - { - CalamityBuffSets.BuffedByAmalgam[type] = false; - return false; - } - - return false; - } - public static bool SetPersistentBuffList(int type, bool isPersistent) - { - if (isPersistent && !CalamityBuffSets.IsPersistentBuff[type]) - { - CalamityBuffSets.IsPersistentBuff[type] = true; - return true; - } - else if (!isPersistent) - { - CalamityBuffSets.IsPersistentBuff[type] = false; - return false; - } - - return false; - } - - public static bool IsOnAmalgamBuffList(int type) => CalamityBuffSets.BuffedByAmalgam[type]; - public static bool IsOnPersistentBuffList(int type) => CalamityBuffSets.IsPersistentBuff[type]; - #endregion - - #region Venerated Locket Bans - public static bool AddToVeneratedLocketBanlist(int type) - { - if (!CalamityItemSets.DisablesVeneratedLocketEffect[type]) - { - CalamityItemSets.DisablesVeneratedLocketEffect[type] = true; - return true; - } - return false; - } - #endregion - - #region Summoner Cross Class Nerf Disabling - public static bool SetSummonerNerfDisabledByMinion(int type, bool disableNerf) - { - if (disableNerf && !CalamityProjectileSets.MinionWhichIgnoresSummonerNerf[type]) - { - CalamityProjectileSets.MinionWhichIgnoresSummonerNerf[type] = true; - return true; - } - else if (!disableNerf) - { - CalamityProjectileSets.MinionWhichIgnoresSummonerNerf[type] = false; - return false; - } - - return false; - } - public static bool SetSummonerNerfDisabledByItem(int type, bool disableNerf) - { - if (disableNerf && !CalamityItemSets.ItemWhichDisablesSummonerNerf[type]) - { - CalamityItemSets.ItemWhichDisablesSummonerNerf[type] = true; - return true; - } - else if (!disableNerf) - { - CalamityItemSets.ItemWhichDisablesSummonerNerf[type] = false; - return false; - } - - return false; - } - - public static bool GetSummonerNerfDisabledByMinion(int type) => CalamityProjectileSets.MinionWhichIgnoresSummonerNerf[type]; - public static bool GetSummonerNerfDisabledByItem(int type) => CalamityItemSets.ItemWhichDisablesSummonerNerf[type]; - #endregion - #region Debuff Display support public static void RegisterDebuff(string texturePath, Predicate debuffCheck) { @@ -1038,19 +954,6 @@ namespace CalamityMod } #endregion - #region Adding minions to boss hp scaling config - //This is to add minions to the hp scaling config - public static bool AddToHPScaling(int type) - { - if (!CalamityNPCSets.ScalesHealthLikeBoss[type]) - { - CalamityNPCSets.ScalesHealthLikeBoss[type] = true; - return true; - } - return false; - } - #endregion - #region Call public static object Call(params object[] args) @@ -2075,55 +1978,6 @@ namespace CalamityMod CalamityMod.Log.Warn("This mod call is deprecated. Calamity automatically registers cooldowns."); return null; - case "GetSummonerNerfDisabledByItem": - if (args.Length != 2 || !isValidItemArg(args[1])) - return new ArgumentException("ERROR: Must specify a valid item to check status of."); - return GetSummonerNerfDisabledByItem(castItem(args[1]).type); - - case "GetSummonerNerfDisabledByMinion": - if (args.Length != 2 || !isValidProjectileArg(args[1])) - return new ArgumentException("ERROR: Must specify a valid projectile to check status of."); - return GetSummonerNerfDisabledByMinion(castProjectile(args[1]).type); - - case "SetSummonerNerfDisabledByItem": - if (args.Length < 2 || !isValidItemArg(args[1])) - return new ArgumentException("ERROR: Must specify a valid item to set the status of."); - if (args.Length != 3 || args[2] is not bool disableNerf) - return new ArgumentException("ERROR: Must specify a bool that determines whether the summoner nerf is disabled."); - return SetSummonerNerfDisabledByItem(castItem(args[1]).type, disableNerf); - - case "SetSummonerNerfDisabledByMinion": - if (args.Length < 2 || !isValidItemArg(args[1])) - return new ArgumentException("ERROR: Must specify a valid projectile to set the status of."); - if (args.Length != 3 || args[2] is not bool disableNerf2) - return new ArgumentException("ERROR: Must specify a bool that determines whether the summoner nerf is disabled."); - return SetSummonerNerfDisabledByItem(castItem(args[1]).type, disableNerf2); - - case "IsOnAmalgamBuffList": - if (args.Length != 2 || !castID(args[1], out int buffType)) - return new ArgumentException("ERROR: Must specify a valid buff ID to check status of."); - return IsOnAmalgamBuffList(buffType); - - case "IsOnPersistentBuffList": - case "IsPersistentBuff": - if (args.Length != 2 || !castID(args[1], out int buffType2)) - return new ArgumentException("ERROR: Must specify a valid buff ID to check status of."); - return IsOnPersistentBuffList(buffType2); - - case "SetAmalgamBuffList": - if (args.Length < 2 || !castID(args[1], out int buffType3)) - return new ArgumentException("ERROR: Must specify a valid buff ID to set the status of."); - if (args.Length != 3 || args[2] is not bool shouldBeListed) - return new ArgumentException("ERROR: Must specify a bool that determines whether the amalgam should enable extend the duration of this buff."); - return SetAmalgamBuffList(buffType3, shouldBeListed); - - case "SetPersistentBuffList": - if (args.Length < 2 || !castID(args[1], out int buffType4)) - return new ArgumentException("ERROR: Must specify a valid buff ID to set the status of."); - if (args.Length != 3 || args[2] is not bool isPersistent) - return new ArgumentException("ERROR: Must specify a bool that determines whether the buff is persistent after death for the Amalgam to properly reset."); - return SetPersistentBuffList(buffType4, isPersistent); - case "CreateCodebreakerDialogOption": // NOTE: This is a legacy variant of this call. The variant with three arguments is the standard. if (args.Length == 4) @@ -2143,13 +1997,6 @@ namespace CalamityMod return null; - case "AddToVeneratedLocketBanlist": - if (args.Length < 2) - return new ArgumentException("ERROR: Not enough arguments!"); - if (args[1] is not int itemType) - return new ArgumentException("ERROR: Must specify a valid item type as an int index of the item."); - return AddToVeneratedLocketBanlist(itemType); - case "RegisterDebuff": case "AddToDebuffDisplay": case "AddDebuffDisplay": @@ -2247,16 +2094,6 @@ namespace CalamityMod AndroombaFriendly.customConversionTypes.Add((itemID, texturePath, NPCaction)); return null; } - case "AddMinibossToHPScalingConfig": - case "AddMinionToHPScalingConfig": - case "AddToBossHPScalingConfig": - { - if (args.Length < 2) - return new ArgumentNullException("ERROR: Must specify an NPC id/type as an int or short ID. Example: NPCType()"); - if (!castID(args[1], out int npcType6)) - return new ArgumentException("ERROR: The first argument to \"AddToBossHPScalingConfig\" must be an int or short ID."); - return AddToHPScaling(npcType6); - } case "GetDebuffDamage": { if (args.Length < 2) @@ -2268,7 +2105,10 @@ namespace CalamityMod case "GetDebuffDamageFunction": //This exists because Calamity's Mod Call lookup is slow due to this string switch, and this method may be called hundreds of times per frame by some addons. return (object)DebuffData.GetDebuffRegenValue; default: - return new ArgumentException("ERROR: Invalid method name."); + { + CalamityMod.Log.Warn($"{methodName} is an invalid method name for Calamity Mod. Are you calling a method which no longer exists?"); + return null; + } } } #endregion diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 6aec151c76..deff3f2114 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -1173,8 +1173,7 @@ namespace CalamityMod RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); - RegisterSummon(ItemType(), BuffType(), ProjectileType()); - RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); RegisterSummon(ItemType(), BuffType(), ProjectileType()); diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index bfd43316ca..009ac238f8 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -288,6 +288,7 @@ namespace CalamityMod.NPCs public bool crumble = false; public int antlionCloudDebuffTimer = 0; + public int caneInsanityTimer = 0; public bool scionsCurioEffected = false; public bool abaddonEffected = false; public bool apollyonEffected = false; @@ -569,6 +570,7 @@ namespace CalamityMod.NPCs myClone.crumble = crumble; myClone.antlionCloudDebuffTimer = antlionCloudDebuffTimer; + myClone.caneInsanityTimer = caneInsanityTimer; myClone.scionsCurioEffected = scionsCurioEffected; myClone.abaddonEffected = abaddonEffected; myClone.apollyonEffected = apollyonEffected; @@ -799,6 +801,8 @@ namespace CalamityMod.NPCs if (antlionCloudDebuffTimer > 0) antlionCloudDebuffTimer--; + if (caneInsanityTimer > 0) + caneInsanityTimer--; if (cursorFocus > 0 && cursorFocus < cursorFocusMax) cursorFocus--; relicOfResilienceWeakness = false; @@ -4865,6 +4869,29 @@ namespace CalamityMod.NPCs return DrawVanillaBestiaryWorms(spriteBatch, npc, drawColor); } } + + if (caneInsanityTimer > 0) + { + Texture2D tex = TextureAssets.Npc[npc.type].Value; + Rectangle frame = npc.frame; + float fadeInAmt = caneInsanityTimer > 570 ? Utils.GetLerpValue(600, 570, caneInsanityTimer) : caneInsanityTimer < 30 ? Utils.GetLerpValue(0, 30, caneInsanityTimer) : 1f; + Vector2 origin = new Vector2(tex.Width / 2, tex.Height / Main.npcFrameCount[npc.type] / 2); + SpriteEffects sp = npc.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + Vector3 colorHSL = Main.rgbToHsl(Color.Violet); + + CalamityUtils.EnterShaderRegion(spriteBatch); + GameShaders.Misc["CalamityMod:BasicTint"].UseOpacity(1f); + GameShaders.Misc["CalamityMod:BasicTint"].UseSaturation(fadeInAmt * 0.35f); + GameShaders.Misc["CalamityMod:BasicTint"].UseColor(Main.hslToRgb(1f - colorHSL.X, colorHSL.Y, colorHSL.Z)); + GameShaders.Misc["CalamityMod:BasicTint"].Apply(); + for (int i = 0; i < 4; i++) + { + Vector2 offset = Vector2.UnitX.RotatedBy(Main.GlobalTimeWrappedHourly * MathHelper.TwoPi * 2f + (MathHelper.TwoPi * i / 4f)) * 6f * fadeInAmt; + Main.EntitySpriteDraw(tex, npc.Center - screenPos - Vector2.UnitY * (npc.gfxOffY) + offset, frame, Color.Violet, npc.rotation, origin, npc.scale, sp); + } + CalamityUtils.ExitShaderRegion(spriteBatch); + } + if (npc.type != NPCID.BrainofCthulhu && (npc.type != NPCID.DukeFishron || npc.ai[0] <= 9f) && npc.active) { if (CalamityClientConfig.Instance.DebuffDisplay && (npc.boss || BossHealthBarManager.MinibossHPBarList.Contains(npc.type) || BossHealthBarManager.OneToMany.ContainsKey(npc.type) || CalamityNPCSets.ForceDrawDebuffDisplay[npc.type])) diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index 1ffdf110b5..e2a793417f 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -1196,7 +1196,8 @@ namespace CalamityMod.NPCs ItemID.LucyTheAxe, ItemID.PewMaticHorn, ItemID.WeatherPain, - ItemID.HoundiusShootius + ItemID.HoundiusShootius, + ModContent.ItemType() }; LCR_NotExpert.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, deerWeapons)); } diff --git a/NPCs/CalamityGlobalTownNPC.cs b/NPCs/CalamityGlobalTownNPC.cs index f02551ccd6..18ca4435e9 100644 --- a/NPCs/CalamityGlobalTownNPC.cs +++ b/NPCs/CalamityGlobalTownNPC.cs @@ -1234,8 +1234,8 @@ namespace CalamityMod.NPCs chat = CalamityUtils.GetTextValue("Vanilla.TaxCollectorChat.DoGDefeated"); else if (Main.rand.NextBool(5) && !DownedBossSystem.downedBrimstoneElemental) chat = CalamityUtils.GetTextValue("Vanilla.TaxCollectorChat.PreBrimmy"); - else if (Main.rand.NextBool(10) && CalamityUtils.InventoryHas(Main.LocalPlayer, ItemType())) - chat = CalamityUtils.GetTextValue("Vanilla.TaxCollectorChat.HasSlickCane"); + else if (Main.rand.NextBool(10) && CalamityUtils.InventoryHas(Main.LocalPlayer, ItemType())) + chat = CalamityUtils.GetTextValue("Vanilla.TaxCollectorChat.HasWalkingCane"); else if (Main.rand.NextBool(5) && platinumCoins >= 500) chat = CalamityUtils.GetTextValue("Vanilla.TaxCollectorChat.Has500Plat"); else if (Main.rand.NextBool(5) && platinumCoins >= 100) @@ -1315,14 +1315,6 @@ namespace CalamityMod.NPCs defense += 20; } } - - public override bool? CanBeHitByProjectile(NPC npc, Projectile projectile) - { - // Not an axe but close enough - if (npc.type == NPCID.TaxCollector && projectile.type == ProjectileType()) - return true; - return base.CanBeHitByProjectile(npc, projectile); - } #endregion #region Shop Stuff @@ -1359,7 +1351,7 @@ namespace CalamityMod.NPCs { shop.Add(Condition.DownedSkeletron) .Add(Condition.Hardmode) - .AddWithCustomValue(ItemID.Boomstick, Item.buyPrice(gold: 25), Condition.DownedQueenBee) + .AddWithCustomValue(ItemID.Revolver, Item.buyPrice(gold: 35), Condition.Hardmode) .AddWithCustomValue(ItemID.Uzi, Item.buyPrice(gold: 50), Condition.DownedPlantera); } diff --git a/NPCs/Crabulon/Crabulon.cs b/NPCs/Crabulon/Crabulon.cs index 3ecd980cd7..b921f02609 100644 --- a/NPCs/Crabulon/Crabulon.cs +++ b/NPCs/Crabulon/Crabulon.cs @@ -178,40 +178,6 @@ namespace CalamityMod.NPCs.Crabulon else if (NPC.timeLeft < 1800) NPC.timeLeft = 1800; - if (NPC.ai[0] < 2f) - { - int mushBombAmt = phase4 ? 6 : phase3 ? 3 : phase2 ? 2 : 1; - float fireRate = phase4 ? 6f : phase3 ? 3f : phase2 ? 2f : 1f; - NPC.localAI[3] += fireRate; - if (NPC.ai[3] == 0f) - { - float shootMushroomsGateValue = revenge ? 120f : expertMode ? 200f : 300f; - if (NPC.localAI[3] > shootMushroomsGateValue) - { - NPC.ai[3] = 1f; - NPC.localAI[3] = 0f; - } - } - else if (NPC.localAI[3] > 30f) - { - NPC.localAI[3] = 0f; - NPC.ai[3] += 1f; - if (NPC.ai[3] >= mushBombAmt) - NPC.ai[3] = 0f; - - float mushBombSpeed = phase4 ? 16f : phase3 ? 14f : phase2 ? 12f : 10f; - int type = ModContent.ProjectileType(); - SoundEngine.PlaySound(SoundID.Item42, NPC.Center); - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - float yVelocity = death ? 1f : expertMode ? 2.5f : 4f; - Vector2 projectileVelocity = (Vector2.Normalize(player.Center - NPC.Center) * mushBombSpeed) - Vector2.UnitY * yVelocity; - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileVelocity, type, MushroomShotDamage, 0f, Main.myPlayer, 0f, player.Center.Y); - } - } - } - if (NPC.ai[0] == 0f) { // Avoid cheap bullshit @@ -245,7 +211,40 @@ namespace CalamityMod.NPCs.Crabulon // Avoid cheap bullshit NPC.damage = 0; - float walkingVelocity = death ? (5f + 1f * (1f - lifeRatio)) : expertMode ? 5f : 3.5f; + // Fire mushroom projectiles at the player + int mushBombAmt = phase4 ? 6 : phase3 ? 3 : phase2 ? 2 : 1; + float fireRate = phase4 ? 6f : phase3 ? 3f : phase2 ? 2f : 1f; + NPC.localAI[3] += fireRate; + if (NPC.ai[3] == 0f) + { + float shootMushroomsGateValue = revenge ? 120f : expertMode ? 200f : 300f; + if (NPC.localAI[3] > shootMushroomsGateValue) + { + NPC.ai[3] = 1f; + NPC.localAI[3] = 0f; + } + } + else if (NPC.localAI[3] > 30f) + { + NPC.localAI[3] = 0f; + NPC.ai[3] += 1f; + if (NPC.ai[3] >= mushBombAmt) + NPC.ai[3] = 0f; + + float mushBombSpeed = phase4 ? 16f : phase3 ? 14f : phase2 ? 12f : 10f; + int type = ModContent.ProjectileType(); + SoundEngine.PlaySound(SoundID.Item42, NPC.Center); + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + float yVelocity = death ? 1f : expertMode ? 2.5f : 4f; + Vector2 projectileVelocity = (Vector2.Normalize(player.Center - NPC.Center) * mushBombSpeed) - Vector2.UnitY * yVelocity; + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileVelocity, type, MushroomShotDamage, 0f, Main.myPlayer, 0f, player.Center.Y); + } + } + + // Walking + float walkingVelocity = expertMode ? 4.5f : 3.5f; if (phase2) walkingVelocity += 0.5f; if (phase3) @@ -330,6 +329,7 @@ namespace CalamityMod.NPCs.Crabulon NPC.noTileCollide = false; NPC.ai[0] = (Main.rand.NextBool() && revenge && phase2) ? 4f : 2f; NPC.ai[1] = 0f; + NPC.ai[3] = 0f; NPC.ForceNetUpdate(); } @@ -485,7 +485,7 @@ namespace CalamityMod.NPCs.Crabulon int type = ModContent.ProjectileType(); - if ((NPC.ai[2] % 2f == 0f || death) && ((phase2 && revenge) || (phase3 && expertMode))) + if (NPC.ai[2] % 2f == 0f && ((phase2 && revenge) || (phase3 && expertMode))) { SoundEngine.PlaySound(SoundID.Item42, NPC.Center); if (Main.netMode != NetmodeID.MultiplayerClient) @@ -495,8 +495,7 @@ namespace CalamityMod.NPCs.Crabulon destination.Normalize(); destination *= projectileVelocity; - // Less mushrooms in Death Mode phase 3 because otherwise it's an absolute shitshow. - int numProj = phase4 ? 14 : CalamityWorld.death ? (phase3 ? 10 : 16) : 12; + int numProj = phase4 ? 14 : CalamityWorld.death ? 16 : 12; float rotation = MathHelper.ToRadians(90); for (int i = 0; i < numProj; i++) { @@ -520,8 +519,7 @@ namespace CalamityMod.NPCs.Crabulon destination.Normalize(); destination *= projectileVelocity; - // Less mushrooms in Death Mode phase 3 because otherwise it's an absolute shitshow. - int numProj = phase4 ? 8 : (phase3 && death) ? 6 : 8; + int numProj = 8; float rotation = MathHelper.ToRadians(60); for (int i = 0; i < numProj; i++) { @@ -621,42 +619,19 @@ namespace CalamityMod.NPCs.Crabulon if (revenge) { float velocityXAdjustment = maxVelocityX; - - if (lifeRatio < 0.5f && death) + switch ((int)NPC.ai[3]) { - // Mega velocity - switch ((int)NPC.ai[3]) - { - case 0: // Normal - case 1: // High - case 2: // Low - maxVelocityX += velocityXAdjustment * 0.5f; - break; + case 0: // Normal + case 1: // High + case 2: // Low + break; - case 3: // Long and low - maxVelocityX += velocityXAdjustment * 1.5f; - break; + case 3: // Long and low + maxVelocityX += velocityXAdjustment * (lifeRatio < 0.5f && death ? 1.5f : 1f); + break; - default: - break; - } - } - else - { - switch ((int)NPC.ai[3]) - { - case 0: // Normal - case 1: // High - case 2: // Low - break; - - case 3: // Long and low - maxVelocityX += velocityXAdjustment; - break; - - default: - break; - } + default: + break; } } @@ -728,31 +703,30 @@ namespace CalamityMod.NPCs.Crabulon if (NPC.velocity.Y >= 0f && NPC.Bottom.Y >= NPC.ai[3] - NPC.height) NPC.noTileCollide = false; - // Impact and create lines of mushrooms that spread out along the ground (similar to an old Providence attack) if (NPC.Bottom.Y >= NPC.ai[3] || NPC.velocity.Y == 0f) { SoundEngine.PlaySound(SlamSound, NPC.Center); + NPC.velocity.X *= 0.5f; NPC.ai[0] = 0f; NPC.ai[1] = 0f; NPC.ai[2] = 0f; NPC.ai[3] = 0f; NPC.netUpdate = true; - int type = ModContent.ProjectileType(); - - if (Main.netMode != NetmodeID.MultiplayerClient) + // Create lines of mushrooms that spread out along the ground in Death Mode + if (death && Main.netMode != NetmodeID.MultiplayerClient) { - float xVelocity = death ? 2f : 1f; - int numProj = death ? 5 : 3; - Vector2 initialVelocity = Vector2.UnitX * xVelocity; + int numProj = 3; + int type = ModContent.ProjectileType(); + Vector2 initialVelocity = Vector2.UnitX; Vector2 initialSpawnLocation = NPC.Bottom - new Vector2(0f, 8f); - for (int i = 0; i < numProj; i++) - Projectile.NewProjectile(NPC.GetSource_FromAI(), initialSpawnLocation + new Vector2(Main.rand.Next(0, 81), Main.rand.Next(-20, 1)), initialVelocity - (i / (float)numProj * initialVelocity), type, MushroomShotDamage, 0f, Main.myPlayer); + for (int i = 1; i <= numProj; i++) + Projectile.NewProjectile(NPC.GetSource_FromAI(), initialSpawnLocation + new Vector2(Main.rand.Next(0, 81), Main.rand.Next(-20, 1)), initialVelocity * (i / (float)numProj), type, MushroomShotDamage, 0f, Main.myPlayer); - for (int i = 0; i < numProj; i++) - Projectile.NewProjectile(NPC.GetSource_FromAI(), initialSpawnLocation + new Vector2(Main.rand.Next(-81, 0), Main.rand.Next(-20, 1)), -(initialVelocity - (i / (float)numProj * initialVelocity)), type, MushroomShotDamage, 0f, Main.myPlayer); + for (int i = 1; i <= numProj; i++) + Projectile.NewProjectile(NPC.GetSource_FromAI(), initialSpawnLocation + new Vector2(Main.rand.Next(-81, 0), Main.rand.Next(-20, 1)), -(initialVelocity * (i / (float)numProj)), type, MushroomShotDamage, 0f, Main.myPlayer); } for (int j = (int)NPC.position.X - 20; j < (int)NPC.position.X + NPC.width + 40; j += 20) @@ -949,7 +923,7 @@ namespace CalamityMod.NPCs.Crabulon if ((NPC.life + crabShroomSpawnFreq) < NPC.localAI[0]) { NPC.localAI[0] = NPC.life; - int crabShroomAmt = death ? 4 : expertMode ? 3 : 2; + int crabShroomAmt = expertMode ? 3 : 2; for (int mush = 0; mush < crabShroomAmt; mush++) { int x = (int)(NPC.position.X + Main.rand.Next(NPC.width - 32)); diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index fed2affc2e..ce811e5e71 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -640,12 +640,6 @@ namespace CalamityMod.NPCs.DevourerofGods string key = "Mods.CalamityMod.Status.Boss.DoGPhase2"; Color messageColor = Color.Cyan; CalamityUtils.BroadcastLocalizedText(key, messageColor); - /* - var ctid = CombatText.NewText(NPC.Hitbox, messageColor, Language.GetTextValue(key), true); - if (ctid < Main.maxCombatText) - player.Calamity().subtitletext = Main.combatText[ctid]; - player.Calamity().subtitleColors = new Color[] { Color.Cyan, Color.Fuchsia }; - */ DialogueDisplaySystem.StartDialogue("Mods.CalamityMod.DevourerOfGods.Phases", NPC, 2, 120, false, new BossText()); } } @@ -1477,13 +1471,6 @@ namespace CalamityMod.NPCs.DevourerofGods string key = "Mods.CalamityMod.Status.Boss.DoGSubphase1"; Color messageColor = Color.Cyan; CalamityUtils.BroadcastLocalizedText(key, messageColor); - - /* - int ctid = CombatText.NewText(NPC.Hitbox, messageColor, Language.GetTextValue(key), true); - if (ctid < Main.maxCombatText) - player.Calamity().subtitletext = Main.combatText[ctid]; - player.Calamity().subtitleColors = new Color[] { Color.Cyan, Color.Fuchsia }; - */ DialogueDisplaySystem.StartDialogue("Mods.CalamityMod.DevourerOfGods.Phases", NPC, 1, 120, false, new BossText()); } diff --git a/NPCs/DevourerofGods/DevourerofGodsTail.cs b/NPCs/DevourerofGods/DevourerofGodsTail.cs index 76374999e1..6da831b412 100644 --- a/NPCs/DevourerofGods/DevourerofGodsTail.cs +++ b/NPCs/DevourerofGods/DevourerofGodsTail.cs @@ -82,10 +82,10 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.dontCountMe = true; if (Main.zenithWorld) + { NPC.scale *= 1.5f; - - if (Main.getGoodWorld) NPC.takenDamageMultiplier = 2; + } } public override void BossHeadSlot(ref int index) diff --git a/NPCs/ExoMechs/Ares/AresBody.cs b/NPCs/ExoMechs/Ares/AresBody.cs index a254f33078..724c6f8fa0 100644 --- a/NPCs/ExoMechs/Ares/AresBody.cs +++ b/NPCs/ExoMechs/Ares/AresBody.cs @@ -504,14 +504,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares draedonAlive = true; } - // Prevent mechs from being respawned - // CIT 08JUN2025: This code is pointless and makes me unable to work swapping the laser arm position. Commenting it out. - /*if (otherExoMechWasFirst) - { - if (NPC.ai[3] < 1f) - NPC.ai[3] = 1f; - }*/ - // Phases bool spawnOtherExoMechs = lifeRatio < 0.7f && NPC.ai[3] == 0f; bool berserk = lifeRatio < 0.4f || (otherExoMechsAlive == 0 && lifeRatio < 0.7f); diff --git a/NPCs/NormalNPCs/WulfrumRover.cs b/NPCs/NormalNPCs/WulfrumRover.cs index 592183f14f..3d2a46c076 100644 --- a/NPCs/NormalNPCs/WulfrumRover.cs +++ b/NPCs/NormalNPCs/WulfrumRover.cs @@ -194,21 +194,6 @@ namespace CalamityMod.NPCs.NormalNPCs { if (Supercharged) { - //old - /* - Texture2D shieldTexture = ModContent.Request("CalamityMod/NPCs/NormalNPCs/WulfrumRoverShield").Value; - Rectangle frame = shieldTexture.Frame(1, 11, 0, (int)(Main.GlobalTimeWrappedHourly * 8) % 11); - spriteBatch.Draw(shieldTexture, - NPC.Center - screenPos + Vector2.UnitY * (NPC.gfxOffY + 6f), - frame, - Color.White * 0.625f, - NPC.rotation, - shieldTexture.Size() * 0.5f / new Vector2(1f, 11f), - NPC.scale + (float)Math.Cos(Main.GlobalTimeWrappedHourly) * 0.1f, - SpriteEffects.None, - 0f); - */ - //0.6 : The noise upscale //0.15 the scale its drawn at usually, 0.2 on Zenith float scale = (Main.zenithWorld ? 0.2f : 0.15f) + 0.03f * (0.5f + 0.5f * (float)Math.Sin(Main.GlobalTimeWrappedHourly * 0.5f + NPC.whoAmI * 0.2f)); diff --git a/NPCs/SlimeGod/SlimeGodCore.cs b/NPCs/SlimeGod/SlimeGodCore.cs index 7b0da70ac2..2674daac13 100644 --- a/NPCs/SlimeGod/SlimeGodCore.cs +++ b/NPCs/SlimeGod/SlimeGodCore.cs @@ -50,6 +50,7 @@ namespace CalamityMod.NPCs.SlimeGod { NPCID.Sets.BossBestiaryPriority.Add(Type); NPCID.Sets.MPAllowedEnemies[Type] = true; + NPCID.Sets.NeedsExpertScaling[Type] = true; NPCID.Sets.TrailCacheLength[Type] = 8; NPCID.Sets.TrailingMode[Type] = 1; if (!Main.dedServ) @@ -63,7 +64,7 @@ namespace CalamityMod.NPCs.SlimeGod public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.damage = 40; // 80 + NPC.damage = 0; NPC.npcSlots = 10f; NPC.width = 44; NPC.height = 44; @@ -195,9 +196,6 @@ namespace CalamityMod.NPCs.SlimeGod // Vanish phase if ((!purpleSlimeAlive && !redSlimeAlive) || calamityGlobalNPC.newAI[3] == 1f || NPC.ai[3] == 1f) { - // Avoid cheap bullshit - NPC.damage = 0; - // Make sure Opacity is set to 0.8f if it's below that when the vanish phase starts if (NPC.ai[3] == 0f) { @@ -354,9 +352,6 @@ namespace CalamityMod.NPCs.SlimeGod calamityGlobalNPC.newAI[2] += 1f; if (calamityGlobalNPC.newAI[2] >= hideInsideLargeSlimePhaseGateValue) { - // Avoid cheap bullshit - NPC.damage = 0; - NPC.rotation += NPC.direction * 0.3f; if (buffedSlime == 0) @@ -427,9 +422,6 @@ namespace CalamityMod.NPCs.SlimeGod return; } - // Avoid cheap bullshit - NPC.damage = 0; - if (expertMode) { float divisor = death ? 180f : revenge ? 240f : 300f; @@ -482,9 +474,6 @@ namespace CalamityMod.NPCs.SlimeGod NPC.ai[0] -= 1f; if (distanceFromFlyDestination < 200f || NPC.ai[0] > 0f) { - // Set damage - NPC.damage = NPC.defDamage; - if (distanceFromFlyDestination < 200f) NPC.ai[0] = 20f; @@ -655,8 +644,7 @@ IL_6899: ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType() + ModContent.ItemType() }; normalOnly.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, weapons)); diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index 01165da0e4..5117b1748a 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -1805,83 +1805,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas NPC.noTileCollide = false; NPC.noGravity = false; NPC.damage = 0; - - /* - // Teleport back to the arena on defeat - if (giveUpCounter == GiveUpCounterMax) - { - Dust.QuickDustLine(NPC.Center, initialRitualPosition + new Vector2(0, -30), 500f, permafrost ? Color.Cyan : Color.Red); - NPC.Center = initialRitualPosition + new Vector2(0, -30); - NPC.noTileCollide = false; - NPC.noGravity = false; - NPC.damage = 0; - SoundEngine.PlaySound(GiveUpSound with { Volume = 1.7f }, NPC.Center); - } - if (giveUpCounter == 1010) - { - Particle pulse2 = new StaticPulseRing(NPC.Center, Vector2.Zero, Color.Red * 0.55f, new Vector2(1f, 1f), 0f, 5f, 0f, 47); - GeneralParticleHandler.SpawnParticle(pulse2); - } - - if (shieldOpacity > 0f) - shieldOpacity = 0; - if (giveUpCounter > 1000) - forcefieldScale = MathHelper.Lerp(forcefieldScale, 1.55f, 0.045f); - else if (giveUpCounter > 960) - forcefieldScale = MathHelper.Lerp(forcefieldScale, 0.4f, 0.085f); - - if (giveUpCounter > 960) - { - for (int i = 0; i < 2; i++) - { - Vector2 sparkVel = new Vector2(15, 15).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 1.1f); - GlowOrbParticle orb = new GlowOrbParticle(NPC.Center + sparkVel * (8 * forcefieldScale), sparkVel * Utils.GetLerpValue(1200, 960, giveUpCounter, true), false, 60, Main.rand.NextFloat(0.7f, 1.7f) * Utils.GetLerpValue(1200, 960, giveUpCounter), Main.rand.NextBool() ? Color.Red : Color.Lerp(Color.Red, Color.Magenta, 0.5f), true, true); - GeneralParticleHandler.SpawnParticle(orb); - } - - float vibrate = 15 * Utils.GetLerpValue(1200, 960, giveUpCounter, true); - NPC.Center = (initialRitualPosition + new Vector2(0, -30)) + Main.rand.NextVector2Circular(vibrate, vibrate); - } - else - { - if (giveUpCounter == 960) - { - NPC.Center = initialRitualPosition + new Vector2(0, -30); - - Vector2 BurstFXDirection = new Vector2(0, 15); - for (int i = 0; i < 4; i++) - { - SparkParticle spark = new SparkParticle(NPC.Center, (BurstFXDirection) * (i + 1), false, 11, (5f - i * 0.6f) * 3, Color.Lerp(Color.Red, Color.Magenta, Utils.GetLerpValue(-3, 3, i)) * 0.8f); - GeneralParticleHandler.SpawnParticle(spark); - } - for (int i = 0; i < 4; i++) - { - SparkParticle spark = new SparkParticle(NPC.Center, (-BurstFXDirection) * (i + 1), false, 11, (5f - i * 0.6f) * 3, Color.Lerp(Color.Red, Color.Magenta, Utils.GetLerpValue(-3, 3, i)) * 0.8f); - GeneralParticleHandler.SpawnParticle(spark); - } - - Particle orb = new CustomPulse(NPC.Center, Vector2.Zero, Color.Red, "CalamityMod/Particles/LargeBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 1.2f, 1.1f, 13); - GeneralParticleHandler.SpawnParticle(orb); - Particle orb2 = new CustomPulse(NPC.Center, Vector2.Zero, Color.Lerp(Color.Red, Color.Magenta, 0.5f), "CalamityMod/Particles/LargeBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 1f, 0.9f, 13); - GeneralParticleHandler.SpawnParticle(orb2); - for (int i = 0; i < 4; i++) - { - Particle orb3 = new CustomPulse(NPC.Center, Vector2.Zero, Color.White, "CalamityMod/Particles/LargeBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0.9f, 0.8f, 13); - GeneralParticleHandler.SpawnParticle(orb3); - } - - for (int i = 0; i < 30; i++) - { - GlowOrbParticle burst = new GlowOrbParticle(NPC.Center, (new Vector2(30, 30).RotatedByRandom(100) + new Vector2(0, -2)) * Main.rand.NextFloat(0.1f, 1.2f), true, 120, Main.rand.NextFloat(1.7f, 2.7f), Main.rand.NextBool() ? Color.Red : Color.Lerp(Color.Red, Color.Magenta, 0.5f), true, true); - GeneralParticleHandler.SpawnParticle(burst); - } - - NPC.velocity = new Vector2(18 * NPC.spriteDirection, -12); - giveUpCounter = GiveUpCounterMax; - hasDoneDeathAnim = true; - } - } - */ } else { diff --git a/NPCs/TownNPCs/Bandit.cs b/NPCs/TownNPCs/Bandit.cs index 0398c06522..001595d331 100644 --- a/NPCs/TownNPCs/Bandit.cs +++ b/NPCs/TownNPCs/Bandit.cs @@ -307,7 +307,6 @@ namespace CalamityMod.NPCs.TownNPCs NPCShop shop = new(Type); shop.Add() .Add() - .Add() .Add() .Add(ItemID.TigerClimbingGear) .Add(Condition.DownedPirates) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhu/BrainOfCthulhuAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhu/BrainOfCthulhuAI.cs index a41c9c6511..675782e8c2 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhu/BrainOfCthulhuAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhu/BrainOfCthulhuAI.cs @@ -2,27 +2,19 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using CalamityMod.Buffs.DamageOverTime; using CalamityMod.DataStructures; using CalamityMod.Enums; using CalamityMod.Events; -using CalamityMod.NPCs; using CalamityMod.Particles; using CalamityMod.Projectiles.Boss.BrainOfCthulhu; -using CalamityMod.Utilities.Daybreak; using CalamityMod.World; using Microsoft.CodeAnalysis; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using Microsoft.Xna.Framework.Graphics.PackedVector; -using ReLogic.Content; using Terraria; using Terraria.Audio; using Terraria.Chat; -using Terraria.DataStructures; using Terraria.GameContent; -using Terraria.Graphics.Effects; -using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; @@ -67,7 +59,8 @@ public class BrainOfCthulhuAI : VanillaAIOverride #region Health Gates internal static float DesperateOnslaughtCreeperHealthGate => 0.1f; //When the cumulative health % of all creepers falls below this value, BoC will begin its pre-stun attack upon entering its idle phase. - internal static float Phase2HealthGate => 0.5f; //When BoC's health % falls below this value, it will begin entering Phase 2 + internal static float Phase2HealthGate => 0.7f; //When BoC's health % falls below this value, it will begin entering Phase 2 + internal static float ForcedIllusionHealthGate => 0.25f; //When BoC's health % falls below this value, the next attack is forced to be the Illusion Trick #endregion internal static float DespawnRangeSQ => 36000000f; @@ -83,7 +76,7 @@ public class BrainOfCthulhuAI : VanillaAIOverride internal static int CreeperChargeWindUpTime => 22; #endregion - internal static int StunDuration => 480; + internal static int StunDuration => 360; #region Creeper Swipes internal static int SwipesStartupDuration => 120; @@ -253,6 +246,7 @@ public class BrainOfCthulhuAI : VanillaAIOverride internal float SpawnTime = 0; internal int SpawnDelay = 0; internal bool OnSecondCreeperPhase = false; + internal bool ForcedIllusionAttack = false; private bool isNegative = false; internal int AttackSign { get => isNegative ? -1 : 1; set => isNegative = value == -1; } @@ -1672,12 +1666,15 @@ public class BrainOfCthulhuAI : VanillaAIOverride float angleChange = MathHelper.Lerp(MathHelper.Pi / 24f, 0f, MathHelper.Clamp(Time / (ChaseTime * 0.666f), 0f, 1f)); NPC.velocity = NPC.velocity.RotateDirectionTowards(NPC.DirectionTo(Target.Center).ToRotation(), angleChange) * (MathHelper.Lerp(ChaseMinSpeed, ChaseMaxSpeed, Time / ChaseTime) * speedUp * slowDown); + // Teleport ahead of the player's movement if (Time == ChaseTime) { if (Main.netMode != NetmodeID.SinglePlayer) SelectNewTarget(); - Vector2 direction = Target.velocity.SafeNormalize(Vector2.UnitX * Target.direction).RotatedBy(Main.rand.NextFloat(-MathHelper.Pi / 3f, MathHelper.Pi / 3f)); - AttackPosition = Target.Center + (direction * DefaultTeleportDistance); + Vector2 direction = Target.velocity.RotatedByRandom(MathHelper.Pi * 0.1f); + if (direction.Length() < 3.5f) + direction = direction.SafeNormalize(Vector2.UnitX * Target.direction) * 3.5f; + AttackPosition = Target.Center + (direction * IdleTeleportDuration * 1.8f); BoCAfterImages = []; NPC.damage = 0; NPC.netUpdate = true; @@ -1741,26 +1738,35 @@ public class BrainOfCthulhuAI : VanillaAIOverride NPC.rotation = 0; ResetAttackValues(); - if (availableAttacks.Count == 0) + if (!ForcedIllusionAttack && (NPC.life / (float)NPC.lifeMax) <= ForcedIllusionHealthGate) { - bool quickChoice = Main.rand.NextBool(); - availableAttacks = [ - BrainAIState.Bloodletting, + ForcedIllusionAttack = true; + AIState = BrainAIState.IllusionTrick; + PreviousAttack = AIState; + } + else + { + if (availableAttacks.Count == 0) + { + bool quickChoice = Main.rand.NextBool(); + availableAttacks = [ + BrainAIState.Bloodletting, quickChoice ? BrainAIState.SanguineScythes : BrainAIState.IllusionDash, Main.rand.NextBool() ? BrainAIState.Phase2Idle : BrainAIState.Bloodletting, quickChoice ? BrainAIState.IllusionDash : BrainAIState.SanguineScythes, BrainAIState.IllusionTrick - ]; - } + ]; + } - AIState = availableAttacks[0]; - availableAttacks.RemoveAt(0); - PreviousAttack = AIState; + AIState = availableAttacks[0]; + availableAttacks.RemoveAt(0); + PreviousAttack = AIState; - if (AIState == BrainAIState.SanguineScythes) - { - Time = -31; - BoCAfterImages = []; + if (AIState == BrainAIState.SanguineScythes) + { + Time = -31; + BoCAfterImages = []; + } } NPC.netUpdate = true; @@ -2855,7 +2861,7 @@ public class BrainOfCthulhuAI : VanillaAIOverride binaryWriter.Write(SpawnDelay); } - binaryWriter.WriteFlags(OnSecondCreeperPhase, isNegative, AttackFlag); + binaryWriter.WriteFlags(OnSecondCreeperPhase, ForcedIllusionAttack, isNegative, AttackFlag); binaryWriter.Write(AttackRotation); binaryWriter.Write(AttackTime); @@ -2887,7 +2893,7 @@ public class BrainOfCthulhuAI : VanillaAIOverride SpawnDelay = binaryReader.ReadInt32(); } - binaryReader.ReadFlags(out OnSecondCreeperPhase, out isNegative, out AttackFlag); + binaryReader.ReadFlags(out OnSecondCreeperPhase, out ForcedIllusionAttack, out isNegative, out AttackFlag); AttackRotation = binaryReader.ReadSingle(); AttackTime = binaryReader.ReadSingle(); diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs index e5ffa7b8ab..00969c8e2e 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs @@ -190,7 +190,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.getGoodWorld) NPC.ai[1] += 100f; - if (enrage || death) + if (enrage) { NPC.ai[1] += 18f; } @@ -239,8 +239,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (!jump) return; - float velocityBoost = (death ? 5f : 3.8f) * (1f - (lifeRatio / 2)); - float velocityX = (death ? 6f : 4f) + velocityBoost; + float velocityBoost = (death ? 3f : 2f) * (1f - (lifeRatio / 2)); + float velocityX = 4f + velocityBoost; if (enrage) velocityX *= 1.5f; @@ -280,7 +280,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses NPC.noTileCollide = true; NPC.ai[2] += 1f; - float jumpVelocity = death ? 26f : 21f; + float jumpVelocity = death ? 21f : 18f; if (enrage) jumpVelocity *= 1.25f; if (turboEnrage) @@ -393,7 +393,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Main.dust[fiery2].velocity.X *= 2f; } - float projectileVelocity = death ? 7.5f : 4.75f; + float projectileVelocity = 4.75f; if (enrage) projectileVelocity *= 1.5f; if (turboEnrage) @@ -1060,7 +1060,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (NPC.ai[1] % 10f == 0f) SoundEngine.PlaySound(SoundID.Item33, spawnLocation); - float laserFireAngle = MathHelper.ToRadians((NPC.ai[1] - telegraphTime + 20) * (death ? 2.45f : 2f)); + float laserFireAngle = MathHelper.ToRadians((NPC.ai[1] - telegraphTime + 20) * (death ? 2.35f : 2f)); Vector2 laserVelocity = Vector2.UnitY.RotatedBy(laserFireAngle * -NPC.localAI[1]) * (death ? 15f : 12f); if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -1300,7 +1300,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses for (int i = -1; i <= 1; i += 2) { Vector2 spawnLocation = new Vector2(NPC.Center.X + 14f * NPC.scale * i, NPC.Center.Y - 20f * NPC.scale); - float laserFireAngle = MathHelper.ToRadians((NPC.ai[1] - telegraphTime + 20) * (death ? 2.1f : 2f)); + float laserFireAngle = MathHelper.ToRadians((NPC.ai[1] - telegraphTime + 20) * 2f); Vector2 laserVelocity = -Vector2.UnitY.RotatedBy(laserFireAngle * i) * (death ? 15f : 12f); if (Main.netMode != NetmodeID.MultiplayerClient) { diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/QueenBeeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/QueenBeeAI.cs index 437d1b4969..eb39b7dd28 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/QueenBeeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/QueenBeeAI.cs @@ -189,7 +189,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { int phase; - int maxRandom = phase4 ? (death ? 5 : 4) : 4; + int maxRandom = phase4 ? 5 : 4; do phase = Main.rand.Next(maxRandom); while (phase == NPC.ai[1] || phase == 1 || (phase == 2 && phase4) || (death && phase6 && phase == 3)); @@ -200,7 +200,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (stingerArcs) phase = 5; - CalamityUtils.CalamityTargeting(NPC, CalamityTargetingParameters.BossDefaults); NPC.ai[0] = phase; NPC.ai[1] = 0f; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs index 0dca2a085f..9d7c19f24d 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs @@ -892,7 +892,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float eyeTelegraphGateValue = LaserShootGateValue - LaserShootTelegraphTime; if (NPC.localAI[1] > eyeTelegraphGateValue || NPC.localAI[2] > 0f || enraged) { - Texture2D glowTexture = CalamityClientConfig.Instance.EnableVanillaTextureEdits ? ExtraTextureRefs.WallOfFleshEyeGlowmask.Value : TextureAssets.Npc[NPC.type].Value; var halfSize = NPC.frame.Size() / 2; SpriteEffects spriteEffects = NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; @@ -900,12 +899,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses NPC.localAI[2] > 0f ? 1f - ((NPC.localAI[2] - 1f) / TotalLasersPerBarrage) : MathHelper.Clamp((NPC.localAI[1] - eyeTelegraphGateValue) / LaserShootTelegraphTime, 0f, 1f); - Color drawColor2 = new Color(100, 0, 200, 192) * colorScale; - for (int i = 0; i < 2; i++) - { - spriteBatch.Draw(glowTexture, NPC.Center - screenPos + new Vector2(0, NPC.gfxOffY), NPC.frame, - drawColor2, NPC.rotation, halfSize, NPC.scale, spriteEffects, 0f); - } + Color drawColor2 = new Color(128, 0, 255) * colorScale; + spriteBatch.Draw(TextureAssets.Npc[NPC.type].Value, NPC.Center - screenPos + new Vector2(0, NPC.gfxOffY), NPC.frame, + drawColor2, NPC.rotation, halfSize, NPC.scale, spriteEffects, 0f); } } } diff --git a/Projectiles/Boss/BrainOfCthulhu/CrimsonEye.cs b/Projectiles/Boss/BrainOfCthulhu/CrimsonEye.cs index 59747e4788..5459c7f056 100644 --- a/Projectiles/Boss/BrainOfCthulhu/CrimsonEye.cs +++ b/Projectiles/Boss/BrainOfCthulhu/CrimsonEye.cs @@ -158,22 +158,6 @@ public class CrimsonEye : ModProjectile, ILocalizedModType if (DistanceRatio > 0) { - /* - Main.spriteBatch.SetBlendState(BlendState.Additive); - - Texture2D tex = ModContent.Request("CalamityMod/Particles/HollowCircleHardEdge").Value; - Color color = Color.Red * DistanceRatio; - if (Time <= 65) - color *= (Time - 45) / 20f; - - if (Projectile.timeLeft <= 20) - color *= Projectile.timeLeft / 20f; - - Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, color, 0f, tex.Size() * 0.5f, 1.75f, 0); - - Main.spriteBatch.SetBlendState(BlendState.AlphaBlend); - */ - float opacity = DistanceRatio; if (Time <= 65) opacity *= (Time - 45) / 20f; diff --git a/Projectiles/Boss/CalamitousFireball.cs b/Projectiles/Boss/CalamitousFireball.cs index 03c0f5dcb0..3de7c71ac7 100644 --- a/Projectiles/Boss/CalamitousFireball.cs +++ b/Projectiles/Boss/CalamitousFireball.cs @@ -91,14 +91,6 @@ namespace CalamityMod.Projectiles.Boss target.AddBuff(ModContent.BuffType(), 240); } - public override bool PreDraw(ref Color lightColor) - { - return false; - - /* - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); - return false; - */ - } + public override bool PreDraw(ref Color lightColor) => false; } } diff --git a/Projectiles/Boss/CataclysmicFlame.cs b/Projectiles/Boss/CataclysmicFlame.cs index 60179713e4..59ecbb93b0 100644 --- a/Projectiles/Boss/CataclysmicFlame.cs +++ b/Projectiles/Boss/CataclysmicFlame.cs @@ -106,60 +106,6 @@ namespace CalamityMod.Projectiles.Boss } } - public override bool PreDraw(ref Color lightColor) - { - return false; - - /* - Texture2D fire = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - Texture2D mist = ModContent.Request("CalamityMod/Particles/MediumMist").Value; - - // The conga line of colors to sift through - Color color1 = new Color(255, 110, 100, 200); - Color color2 = new Color(255, 50, 50, 70); - Color color3 = new Color(255, 100, 100, 100); - Color color4 = new Color(200, 35, 30, 100); - float length = ((Time > Fadetime - 10f) ? 0.1f : 0.15f); - float vOffset = Math.Min(Time, 20f); - float timeRatio = Utils.GetLerpValue(0f, Lifetime, Time); - float fireSize = Utils.Remap(timeRatio, 0.2f, 0.5f, 0.25f, 1f); - - if (timeRatio >= 1f) - return false; - - for (float j = 1f; j >= 0f; j -= length) - { - // Color - Color fireColor = ((timeRatio < 0.1f) ? Color.Lerp(Color.Transparent, color1, Utils.GetLerpValue(0f, 0.1f, timeRatio)) : - ((timeRatio < 0.2f) ? Color.Lerp(color1, color2, Utils.GetLerpValue(0.1f, 0.2f, timeRatio)) : - ((timeRatio < 0.35f) ? color2 : - ((timeRatio < 0.7f) ? Color.Lerp(color2, color3, Utils.GetLerpValue(0.35f, 0.7f, timeRatio)) : - ((timeRatio < 0.85f) ? Color.Lerp(color3, color4, Utils.GetLerpValue(0.7f, 0.85f, timeRatio)) : - Color.Lerp(color4, Color.Transparent, Utils.GetLerpValue(0.85f, 1f, timeRatio))))))); - fireColor *= (1f - j) * Utils.GetLerpValue(0f, 0.2f, timeRatio, true); - Color innerColor = Color.Lerp(fireColor, Color.Black, 0.3f); - - // Positions and rotations - Vector2 firePos = Projectile.Center - Main.screenPosition - Projectile.velocity * vOffset * j; - float mainRot = -j * MathHelper.PiOver2 - Main.GlobalTimeWrappedHourly * (j + 1f) * 2f / length; - float trailRot = MathHelper.PiOver4 - mainRot; - - // Draw one backtrail - Vector2 trailOffset = Projectile.velocity * vOffset * length * 0.5f; - Main.EntitySpriteDraw(fire, firePos - trailOffset, null, innerColor * 0.25f, trailRot, fire.Size() * 0.5f, fireSize, SpriteEffects.None); - - // Draw the main fire - Main.EntitySpriteDraw(fire, firePos, null, innerColor, mainRot, fire.Size() * 0.5f, fireSize, SpriteEffects.None); - - // Draw the masking smoke - Main.spriteBatch.SetBlendState(BlendState.Additive); - Rectangle frame = mist.Frame(1, 3, 0, MistType); - Main.EntitySpriteDraw(mist, firePos, frame, Color.Lerp(fireColor, Color.White, 0.3f), mainRot, frame.Size() * 0.5f, fireSize, SpriteEffects.None); - Main.EntitySpriteDraw(mist, firePos, frame, fireColor, mainRot, frame.Size() * 0.5f, fireSize * 3f, SpriteEffects.None); - Main.spriteBatch.SetBlendState(BlendState.AlphaBlend); - } - return false; - */ - } + public override bool PreDraw(ref Color lightColor) => false; } } diff --git a/Projectiles/DraedonsArsenal/AerialTrackerLaser.cs b/Projectiles/DraedonsArsenal/AerialTrackerLaser.cs index 22e3b48d87..e3b3d53418 100644 --- a/Projectiles/DraedonsArsenal/AerialTrackerLaser.cs +++ b/Projectiles/DraedonsArsenal/AerialTrackerLaser.cs @@ -88,19 +88,6 @@ namespace CalamityMod.Projectiles.DraedonsArsenal modifiers.HideCombatText(); } - public override void OnKill(int timeLeft) - { - /* - for (int i = 0; i < 7; i++) - { - Dust dust = Dust.NewDustPerfect(Projectile.Center, 267); - dust.velocity = (Projectile.velocity * 3 * Projectile.scale).RotatedByRandom(0.3f) * Main.rand.NextFloat(0.3f, 1f); - dust.scale = Main.rand.NextFloat(0.4f, 0.7f) * Projectile.scale; - dust.noGravity = true; - dust.color = Color.Red; - } - */ - } public override void DrawBehind(int index, List behindNPCsAndTiles, List behindNPCs, List behindProjectiles, List overPlayers, List overWiresUI) { overPlayers.Add(index); diff --git a/Projectiles/Enemy/JellyghoulBolt.cs b/Projectiles/Enemy/JellyghoulBolt.cs index d023799517..b9d14552b4 100644 --- a/Projectiles/Enemy/JellyghoulBolt.cs +++ b/Projectiles/Enemy/JellyghoulBolt.cs @@ -89,17 +89,6 @@ namespace CalamityMod.Projectiles.Enemy Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; int projFrame = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; int y6 = projFrame * Projectile.frame; - - /*Main.spriteBatch.EnterShaderRegion(BlendState.Additive); - Texture2D ring = ModContent.Request("CalamityMod/Particles/HollowCircleHardEdge").Value; - for (int j = 0; j < 2; j++) - { - for (int i = 2; i < 7; i += 2) - { - Main.spriteBatch.Draw(ring, Projectile.oldPos[i] + Projectile.Size / 2 - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), null, Color.Red * Projectile.Opacity, Projectile.velocity.ToRotation(), ring.Size() / 2, new Vector2(0.5f, 1) * 0.2f * MathHelper.Lerp(1f, 0.5f, (i - 2) / 3f), SpriteEffects.None, 0); - } - } - Main.spriteBatch.ExitShaderRegion();*/ return false; } public float SlashWidthFunction(float _, Vector2 vertexPos) => 16 * Utils.GetLerpValue(0f, 0.1f, _, true); diff --git a/Projectiles/Magic/ClimaxBeam.cs b/Projectiles/Magic/ClimaxBeam.cs index aec84744d8..3c11255b6c 100644 --- a/Projectiles/Magic/ClimaxBeam.cs +++ b/Projectiles/Magic/ClimaxBeam.cs @@ -29,15 +29,6 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { - /* - Vector2 projPos = Projectile.position; - projPos -= Projectile.velocity * 0.25f; - int boltDust = Dust.NewDust(projPos, 1, 1, DustID.UnusedWhiteBluePurple, 0f, 0f, 0, default, 1.25f); - Main.dust[boltDust].position = projPos; - Main.dust[boltDust].scale = (float)Main.rand.Next(70, 110) * 0.013f; - Main.dust[boltDust].velocity *= 0.1f; - */ - if (Projectile.timeLeft == 500) { Particle orb = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Aqua, "CalamityMod/Particles/LargeBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0.2f, 0.2f, 3); diff --git a/Projectiles/Magic/LightningArc.cs b/Projectiles/Magic/LightningArc.cs index 8f43f46666..9c367924a7 100644 --- a/Projectiles/Magic/LightningArc.cs +++ b/Projectiles/Magic/LightningArc.cs @@ -85,7 +85,6 @@ namespace CalamityMod.Projectiles.Magic } } - // Main.dust[dust].velocity /= 2f; Vector2 current = Projectile.Center; if (target) { @@ -115,33 +114,6 @@ namespace CalamityMod.Projectiles.Magic } Projectile.position = current; - - /*int tx = (int)(projectile.position.X / 16f); - int ty = (int)(projectile.position.Y / 16f); - - if (tx < 0) - { - tx = 0; - } - if (tx > Main.maxTilesX) - { - tx = Main.maxTilesX; - } - if (ty < 0) - { - ty = 0; - } - if (ty > Main.maxTilesY) - { - ty = Main.maxTilesY; - } - - if (Main.tile[tx, ty] != null && Main.tileSolid[(int)Main.tile[tx,ty].type] && Main.tile[tx, ty].wall == 0) - { - projectile.timeLeft -= 12; - }*/ - - } public override bool OnTileCollide(Vector2 oldVelocity) { diff --git a/Projectiles/Magic/LuxorsGiftMagic.cs b/Projectiles/Magic/LuxorsGiftMagic.cs index 53d96f1139..8056df5a3e 100644 --- a/Projectiles/Magic/LuxorsGiftMagic.cs +++ b/Projectiles/Magic/LuxorsGiftMagic.cs @@ -39,14 +39,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.velocity *= 0.1f; if (Projectile.velocity.Length() < 8) Projectile.velocity *= 1.01f; - /* - Vector2 dustVel = (Projectile.rotation - MathHelper.PiOver2).ToRotationVector2().RotatedByRandom(0.5f) * Main.rand.NextFloat(0.8f, 1.3f); - Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(4, 4), ModContent.DustType(), dustVel * Main.rand.NextFloat(0.5f, 1.2f)); - dust.noGravity = !Main.rand.NextBool(3); - dust.scale = Main.rand.NextFloat(0.45f, 0.6f); - dust.color = Color.Gold; - dust.noLightEmittence = true; - */ + if (Projectile.timeLeft > 30) { for (int i = 0; i < 2; i++) diff --git a/Projectiles/Magic/NightOrb.cs b/Projectiles/Magic/NightOrb.cs index 0bfd8ae7cc..906529f68b 100644 --- a/Projectiles/Magic/NightOrb.cs +++ b/Projectiles/Magic/NightOrb.cs @@ -24,5 +24,6 @@ namespace CalamityMod.Projectiles.Magic { CalamityUtils.MagnetSphereHitscan(Projectile, 300f, 6f, 24f, 5, ModContent.ProjectileType()); } + public override bool? CanDamage() => false; } } diff --git a/Projectiles/Melee/CosmicIceBurst.cs b/Projectiles/Melee/CosmicIceBurst.cs index 379f8d6c13..6318cf0643 100644 --- a/Projectiles/Melee/CosmicIceBurst.cs +++ b/Projectiles/Melee/CosmicIceBurst.cs @@ -110,11 +110,6 @@ namespace CalamityMod.Projectiles.Melee return true; } - /*public override Color? GetAlpha(Color lightColor) - { - return new Color(150, Main.DiscoG, 255, 127); - }*/ - // Only inflict Nightwither if not spawned from Icebreaker public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { diff --git a/Projectiles/Melee/CrystylCrusherRay.cs b/Projectiles/Melee/CrystylCrusherRay.cs index 9e308d1d6f..65c0577e3d 100644 --- a/Projectiles/Melee/CrystylCrusherRay.cs +++ b/Projectiles/Melee/CrystylCrusherRay.cs @@ -144,9 +144,7 @@ namespace CalamityMod.Projectiles.Melee DestroyTiles(); } - /* - * Sets the end of the laser position based on where it collides with something - */ + // Sets the end of the laser position based on where it collides with something private void SetLaserPosition(Player player) { Distance = MathHelper.Max(player.Distance(player.ClampedMouseWorld()) - 20f, MOVE_DISTANCE + 5f); @@ -228,9 +226,7 @@ namespace CalamityMod.Projectiles.Melee public override bool ShouldUpdatePosition() => false; - /* - * Update CutTiles so the laser will cut tiles (like grass) - */ + // Update CutTiles so the laser will cut tiles (like grass) public override bool? CanCutTiles() => IsAtMaxCharge ? null : false; public override void CutTiles() { diff --git a/Projectiles/Melee/ExaltedOathbladeThrownBlade.cs b/Projectiles/Melee/ExaltedOathbladeThrownBlade.cs index b50aac643e..becc25a285 100644 --- a/Projectiles/Melee/ExaltedOathbladeThrownBlade.cs +++ b/Projectiles/Melee/ExaltedOathbladeThrownBlade.cs @@ -368,25 +368,5 @@ namespace CalamityMod.Projectiles.Melee return false; } - /* - public override void SendExtraAI(BinaryWriter writer) - { - writer.Write(Projectile.timeLeft); - writer.Write(Projectile.rotation); - writer.Write(Projectile.localAI[2]); - writer.Write(Projectile.localAI[0]); - - writer.WriteFlags(stuckInTarget, thrown); - } - public override void ReceiveExtraAI(BinaryReader reader) - { - Projectile.timeLeft = reader.Read(); - Projectile.rotation = reader.ReadSingle(); - Projectile.localAI[2] = reader.ReadSingle(); - Projectile.localAI[0] = reader.ReadSingle(); - - reader.ReadFlags(out stuckInTarget, out thrown); - } - */ } } diff --git a/Projectiles/Melee/ExobladeProj.cs b/Projectiles/Melee/ExobladeProj.cs index 4eeb944925..5f55b2ea97 100644 --- a/Projectiles/Melee/ExobladeProj.cs +++ b/Projectiles/Melee/ExobladeProj.cs @@ -530,23 +530,6 @@ namespace CalamityMod.Projectiles.Melee Main.EntitySpriteDraw(texture, Owner.MountedCenter - Main.screenPosition, null, Color.White, BaseRotation, texture.Size() / 2f, SquishVector * 3f * Projectile.scale, direction, 0); - /* - if (PerformingPowerfulSlash) - { - Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, swingFX, Main.GameViewMatrix.TransformationMatrix); - - float bouncyProgression = (float)Math.Sin(Progression * MathHelper.Pi); - swingFX.Parameters["color"].SetValue(Color.MediumSpringGreen.ToVector4() with { W = bouncyProgression * 0.5f }); - - for (int i = 0; i < 4; i++) - { - Vector2 offset = (i / 4f * MathHelper.TwoPi + SwingAngleShift + MathHelper.PiOver4).ToRotationVector2() * 2f * Projectile.scale; - Main.EntitySpriteDraw(texture, Owner.MountedCenter - Main.screenPosition + offset, null, Color.White, BaseRotation, texture.Size() / 2f, SquishVector * 3f * Projectile.scale, direction, 0); - } - } - */ - Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); diff --git a/Projectiles/Melee/MawOfInfinityHoldout.cs b/Projectiles/Melee/MawOfInfinityHoldout.cs index 48323eefee..4cc5afab86 100644 --- a/Projectiles/Melee/MawOfInfinityHoldout.cs +++ b/Projectiles/Melee/MawOfInfinityHoldout.cs @@ -149,7 +149,7 @@ namespace CalamityMod.Projectiles.Melee jawScaleMult = 1-CooldownCompletion; jawScaleMult = MathF.Pow(jawScaleMult, 3); float rotation = Projectile.rotation - (Projectile.spriteDirection == -1 ? MathHelper.PiOver2: 0); - Vector2 DrawPos = Projectile.Center + Projectile.scale * new Vector2(50,10 * Projectile.spriteDirection).RotatedBy(Projectile.rotation - MathHelper.PiOver2 + (Projectile.spriteDirection == -1 ? -MathHelper.PiOver4 : MathHelper.PiOver4)); + Vector2 DrawPos = Projectile.Center + Projectile.scale * new Vector2(50,-10 * Projectile.spriteDirection).RotatedBy(Projectile.rotation - MathHelper.PiOver2 + (Projectile.spriteDirection == -1 ? -MathHelper.PiOver4 : MathHelper.PiOver4)); Main.spriteBatch.SetBlendState(BlendState.Additive); Main.spriteBatch.Draw(tex, DrawPos - Main.screenPosition, tex.Frame(2,1,0,0), modplayer.swingNum == 1 ? Color.Fuchsia : Color.Cyan, rotation + MathHelper.PiOver4, new Vector2(tex.Width * 0.25f,tex.Height * 0.5f), Projectile.scale * jawScaleMult, Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0); diff --git a/Projectiles/Melee/RoxcaliburProj.cs b/Projectiles/Melee/RoxcaliburProj.cs index 3b9034c5f4..e68a091c84 100644 --- a/Projectiles/Melee/RoxcaliburProj.cs +++ b/Projectiles/Melee/RoxcaliburProj.cs @@ -55,18 +55,18 @@ namespace CalamityMod.Projectiles.Melee //more precise hitbox. makes the weapon harder to use but looks visually better: use it if you want. /* - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) - { - if (HitTimer <= 0) - { - float size = Projectile.Size.Length(); - Vector2 hiltPos = Projectile.Center - Projectile.velocity * size / 2; - Vector2 endPos = Projectile.Center + Projectile.velocity * size / 2; - float useless = 0f; - return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), hiltPos, endPos, size / 2, ref useless); - } - return base.Colliding(projHitbox, targetHitbox); - } + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + if (HitTimer <= 0) + { + float size = Projectile.Size.Length(); + Vector2 hiltPos = Projectile.Center - Projectile.velocity * size / 2; + Vector2 endPos = Projectile.Center + Projectile.velocity * size / 2; + float useless = 0f; + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), hiltPos, endPos, size / 2, ref useless); + } + return base.Colliding(projHitbox, targetHitbox); + } */ public override void AI() diff --git a/Projectiles/Melee/SandBlade.cs b/Projectiles/Melee/SandBlade.cs index 1ff0f70ab3..184bb4b4dc 100644 --- a/Projectiles/Melee/SandBlade.cs +++ b/Projectiles/Melee/SandBlade.cs @@ -16,8 +16,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetDefaults() { - Projectile.width = 20; - Projectile.height = 20; + Projectile.width = 26; + Projectile.height = 26; Projectile.friendly = true; Projectile.penetrate = 1; Projectile.timeLeft = 300; diff --git a/Projectiles/Melee/SandBlade.png b/Projectiles/Melee/SandBlade.png index fccc308168..69b4d66e1a 100644 Binary files a/Projectiles/Melee/SandBlade.png and b/Projectiles/Melee/SandBlade.png differ diff --git a/Projectiles/Melee/Yoyos/BurningRevelationYoyo.cs b/Projectiles/Melee/Yoyos/BurningRevelationYoyo.cs index c88f451f81..a20df2e91d 100644 --- a/Projectiles/Melee/Yoyos/BurningRevelationYoyo.cs +++ b/Projectiles/Melee/Yoyos/BurningRevelationYoyo.cs @@ -108,18 +108,6 @@ namespace CalamityMod.Projectiles.Melee.Yoyos SoundEngine.PlaySound(fire with { Volume = 0.6f, PitchVariance = 0.2f }, Projectile.Center); } - // Technically scrapped because the weapon is complex enough, but we might want to use this in the future - /* - if (timer % 60 == 0) // Fire Heal Stars at player (slightly predictive) - { - Vector2 vel = ((Projectile.Center - Owner.Center) - Owner.velocity * 8).SafeNormalize(Vector2.UnitX) * -10; - Projectile healStar = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, vel, ModContent.ProjectileType(), 0, Projectile.knockBack, Projectile.owner, 0, cloneYoyo ? 3 : 10, 5); - healStar.extraUpdates = 2; - SoundStyle fireHeal = new("CalamityMod/Sounds/Custom/ProfanedGuardians/GuardianDash"); - SoundEngine.PlaySound(fireHeal with { Volume = 0.9f, Pitch = 0.3f }, Projectile.Center); - } - */ - if (timer > 0) { timer--; diff --git a/Projectiles/Pets/ChibiiDoggo.cs b/Projectiles/Pets/ChibiiDoggo.cs index 9bcfc40ee6..87cca66150 100644 --- a/Projectiles/Pets/ChibiiDoggo.cs +++ b/Projectiles/Pets/ChibiiDoggo.cs @@ -153,21 +153,11 @@ IL_6899: if (Projectile.tileCollide) { Projectile.hide = false; - - //if (projectile.extraUpdates == 1) PreventFastfall(); - - /*Vector2 distance = Main.player[projectile.owner].Center - projectile.Center; - if (distance.Length() < 100) - projectile.extraUpdates = 0; - else - projectile.extraUpdates = 1;*/ } else { Projectile.hide = true; - //projectile.extraUpdates = 1; - if (player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0) Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.position.X, Projectile.position.Y, 0f, 0f, ModContent.ProjectileType(), 0, 0f, Projectile.owner, (float)Projectile.identity); } diff --git a/Projectiles/Pets/DannyDevitoPet.cs b/Projectiles/Pets/DannyDevitoPet.cs index a57bd3e2d5..5a0fd9662a 100644 --- a/Projectiles/Pets/DannyDevitoPet.cs +++ b/Projectiles/Pets/DannyDevitoPet.cs @@ -249,53 +249,6 @@ namespace CalamityMod.Projectiles.Pets } } - /*public override void PostDraw(Color lightColor) - { - if (!Main.gamePaused || Main.gameMenu) - { - Vector2 projDirect = projectile.position - Main.screenPosition; - if ((float)Main.mouseX > projDirect.X && (float)Main.mouseX < projDirect.X + (float)projectile.width && (float)Main.mouseY > projDirect.Y && (float)Main.mouseY < projDirect.Y + (float)projectile.height) - { - int playerTileX = (int)(Main.player[projectile.owner].Center.X / 16f); - int playerTileY = (int)(Main.player[projectile.owner].Center.Y / 16f); - int projTileX = (int)projectile.Center.X / 16; - int projTileY = (int)projectile.Center.Y / 16; - int lastTileRangeX = Main.player[projectile.owner].lastTileRangeX; - int lastTileRangeY = Main.player[projectile.owner].lastTileRangeY; - if (playerTileX >= projTileX - lastTileRangeX && playerTileX <= projTileX + lastTileRangeX + 1 && playerTileY >= projTileY - lastTileRangeY && playerTileY <= projTileY + lastTileRangeY + 1) - { - Main.player[projectile.owner].noThrow = 2; - Main.player[projectile.owner].cursorItemIconEnabled = true; - Main.player[projectile.owner].cursorItemIconID = 3213; - if (PlayerInput.UsingGamepad) - { - Main.player[projectile.owner].GamepadEnableGrappleCooldown(); - } - if (Main.mouseRight && Main.mouseRightRelease && Player.StopMoneyTroughFromWorking == 0) - { - Main.mouseRightRelease = false; - if (Main.player[projectile.owner].chest == -2) - { - Main.PlaySound(SoundID.Item11, -1, -1); - Main.player[projectile.owner].chest = -1; - Recipe.FindRecipes(); - return; - } - Main.player[projectile.owner].GetCalamityPlayer().trashManChest = projectile.type; - Main.player[projectile.owner].chest = -2; - Main.player[projectile.owner].chestX = (int)(projectile.Center.X / 16f); - Main.player[projectile.owner].chestY = (int)(projectile.Center.Y / 16f); - Main.player[projectile.owner].talkNPC = -1; - Main.npcShop = 0; - Main.playerInventory = true; - Main.PlaySound(SoundID.Item10, -1, -1); - Recipe.FindRecipes(); - } - } - } - } - }*/ - private bool HoleBelow() //pretty much the same as the one used in mantis { int tileWidth = 4; diff --git a/Projectiles/Ranged/BallistaGreatArrow.cs b/Projectiles/Ranged/BallistaGreatArrow.cs index 33f3b8a93f..19be95a743 100644 --- a/Projectiles/Ranged/BallistaGreatArrow.cs +++ b/Projectiles/Ranged/BallistaGreatArrow.cs @@ -9,11 +9,6 @@ namespace CalamityMod.Projectiles.Ranged public class BallistaGreatArrow : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Ranged"; - public override void SetStaticDefaults() - { - ProjectileID.Sets.TrailCacheLength[Type] = 10; - ProjectileID.Sets.TrailingMode[Type] = 1; - } public override void SetDefaults() { @@ -43,16 +38,10 @@ namespace CalamityMod.Projectiles.Ranged for (int i = 0; i < 2; i++) // Burst into 2 shards upwards { Vector2 baseVelocity = Vector2.UnitY * -12f; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Top, baseVelocity.RotatedByRandom(MathHelper.Pi * 0.1f), ModContent.ProjectileType(), Projectile.damage / 4, Projectile.knockBack * 0.25f, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Top, baseVelocity.RotatedByRandom(MathHelper.Pi * 0.1f), ModContent.ProjectileType(), Projectile.damage / 4, Projectile.knockBack * 0.25f, Projectile.owner); } } public override void OnKill(int timeLeft) => SoundEngine.PlaySound(SoundID.Item14, Projectile.position); - - public override bool PreDraw(ref Color lightColor) - { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2); - return false; - } } } diff --git a/Projectiles/Ranged/BallistaGreatArrow.png b/Projectiles/Ranged/BallistaGreatArrow.png index 2883016d90..a359a261e9 100644 Binary files a/Projectiles/Ranged/BallistaGreatArrow.png and b/Projectiles/Ranged/BallistaGreatArrow.png differ diff --git a/Projectiles/Ranged/BallistaShard.cs b/Projectiles/Ranged/BallistaShard.cs new file mode 100644 index 0000000000..8032d79a8f --- /dev/null +++ b/Projectiles/Ranged/BallistaShard.cs @@ -0,0 +1,61 @@ +using CalamityMod.Buffs.StatDebuffs; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.GameContent; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Ranged +{ + public class BallistaShard : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Ranged"; + public override void SetStaticDefaults() + { + Main.projFrames[Type] = 3; + } + public override void SetDefaults() + { + Projectile.width = 10; + Projectile.height = 10; + Projectile.friendly = true; + Projectile.DamageType = DamageClass.Ranged; + Projectile.penetrate = 1; + Projectile.aiStyle = ProjAIStyleID.Arrow; + Projectile.timeLeft = 120; + AIType = ProjectileID.WoodenArrowFriendly; + } + + public override void AI() + { + if (Projectile.timeLeft == 120) + Projectile.frame = Main.rand.Next(3); + + if (Projectile.velocity.Y <= -2f) + Projectile.velocity.Y = -2f; + Projectile.velocity.Y += 0.025f; + Projectile.rotation += Projectile.velocity.Y; + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(ModContent.BuffType(), 60); + } + + public override void OnKill(int timeLeft) + { + for (int i = 0; i <= 2; i++) + { + Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.Sand, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f); + } + } + + public override bool PreDraw(ref Color lightColor) + { + Texture2D tex = TextureAssets.Projectile[Type].Value; + Rectangle frame = tex.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, frame, lightColor, Projectile.rotation, frame.Size() * 0.5f, Projectile.scale, SpriteEffects.None); + return false; + } + } +} diff --git a/Projectiles/Ranged/BallistaShard.png b/Projectiles/Ranged/BallistaShard.png new file mode 100644 index 0000000000..aba2ba5a10 Binary files /dev/null and b/Projectiles/Ranged/BallistaShard.png differ diff --git a/Projectiles/Ranged/FossilShard.cs b/Projectiles/Ranged/FossilShard.cs index 03a853f3db..ddf2cd0cea 100644 --- a/Projectiles/Ranged/FossilShard.cs +++ b/Projectiles/Ranged/FossilShard.cs @@ -1,5 +1,8 @@ using CalamityMod.Buffs.StatDebuffs; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged @@ -7,6 +10,10 @@ namespace CalamityMod.Projectiles.Ranged public class FossilShard : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Ranged"; + public override void SetStaticDefaults() + { + Main.projFrames[Type] = 5; + } public override void SetDefaults() { Projectile.width = 10; @@ -21,6 +28,9 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { + if (Projectile.timeLeft == 120) + Projectile.frame = Main.rand.Next(5); + if (Projectile.ai[1] != 1f) { if (Projectile.velocity.Y <= -2f) @@ -42,5 +52,13 @@ namespace CalamityMod.Projectiles.Ranged Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.Sand, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f); } } + + public override bool PreDraw(ref Color lightColor) + { + Texture2D tex = TextureAssets.Projectile[Type].Value; + Rectangle frame = tex.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, frame, lightColor, Projectile.rotation, frame.Size() * 0.5f, Projectile.scale, SpriteEffects.None); + return false; + } } } diff --git a/Projectiles/Ranged/FossilShard.png b/Projectiles/Ranged/FossilShard.png index 9af9080d48..cb51af8250 100644 Binary files a/Projectiles/Ranged/FossilShard.png and b/Projectiles/Ranged/FossilShard.png differ diff --git a/Projectiles/Rogue/FossilShardThrown.cs b/Projectiles/Rogue/FossilShardThrown.cs index 7ba53c3140..adfd05797a 100644 --- a/Projectiles/Rogue/FossilShardThrown.cs +++ b/Projectiles/Rogue/FossilShardThrown.cs @@ -1,7 +1,9 @@ using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Weapons.Rogue; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue @@ -11,6 +13,10 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public override string Texture => "CalamityMod/Projectiles/Ranged/FossilShard"; + public override void SetStaticDefaults() + { + Main.projFrames[Type] = 5; + } public override void SetDefaults() { Projectile.width = 10; @@ -31,6 +37,7 @@ namespace CalamityMod.Projectiles.Rogue { Projectile.originalDamage = SpearofPaleolith.ShardBaseDamage; Projectile.ContinuouslyUpdateDamageStats = true; + Projectile.frame = Main.rand.Next(5); } Projectile.velocity.X *= 0.975f; @@ -59,5 +66,13 @@ namespace CalamityMod.Projectiles.Rogue { Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.Sand, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f); } + + public override bool PreDraw(ref Color lightColor) + { + Texture2D tex = TextureAssets.Projectile[Type].Value; + Rectangle frame = tex.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, frame, lightColor, Projectile.rotation, frame.Size() * 0.5f, Projectile.scale, SpriteEffects.None); + return false; + } } } diff --git a/Projectiles/Rogue/SlickCaneProjectile.cs b/Projectiles/Rogue/SlickCaneProjectile.cs deleted file mode 100644 index a9584f036a..0000000000 --- a/Projectiles/Rogue/SlickCaneProjectile.cs +++ /dev/null @@ -1,167 +0,0 @@ -using System; -using CalamityMod.Items.Weapons.Ranged; -using CalamityMod.Items.Weapons.Rogue; -using CalamityMod.Projectiles.BaseProjectiles; -using CalamityMod.Systems.Collections; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.Audio; -using Terraria.ID; -using Terraria.Localization; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Rogue -{ - public class SlickCaneProjectile : BaseSpearProjectile - { - public override LocalizedText DisplayName => CalamityUtils.GetItemName(); - public override string Texture => "CalamityMod/Items/Weapons/Rogue/SlickCane"; - - private bool initialized = false; - public override void SetDefaults() - { - Projectile.width = 40; - Projectile.height = 36; - Projectile.DamageType = RogueDamageClass.Instance; - Projectile.timeLeft = 120; - Projectile.friendly = true; - Projectile.hostile = false; - Projectile.tileCollide = false; - Projectile.ignoreWater = true; - Projectile.penetrate = -1; - Projectile.ownerHitCheck = true; - Projectile.hide = true; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = -1; - Projectile.alpha = 180; - Projectile.scale = 1.25f; - } - public override SpearType SpearAiType => SpearType.GhastlyGlaiveSpear; - public override float TravelSpeed => 8f; - - public override bool PreAI() - { - // Initialization. Using the AI hook would override the base spear's code, and we don't want that. - if (!initialized) - { - Main.player[Projectile.owner].Calamity().ConsumeStealthByAttacking(); - initialized = true; - } - return true; - } - - public override bool PreDraw(ref Color lightColor) - { - Vector2 drawPosition = Projectile.position + new Vector2(Projectile.width, Projectile.height) / 2f + Vector2.UnitY * Projectile.gfxOffY - Main.screenPosition; - Texture2D alternateHookTexture = Projectile.spriteDirection == -1 ? ModContent.Request("CalamityMod/Projectiles/Rogue/SlickCaneProjectileAlt").Value : Terraria.GameContent.TextureAssets.Projectile[Type].Value; - Vector2 origin = new Vector2(Projectile.spriteDirection == 1 ? alternateHookTexture.Width + 8f : -8f, -8f); - Main.EntitySpriteDraw(alternateHookTexture, drawPosition, null, - lightColor, Projectile.rotation, - origin, Projectile.scale, SpriteEffects.None, 0); - return false; - } - - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) - { - float spearLengthMult = 2.5f; - float velocityMagnitude = 0f; - if (Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), - Main.player[Projectile.owner].Center, Main.player[Projectile.owner].Center + Projectile.velocity * spearLengthMult, - (TravelSpeed + 1f) * Projectile.scale, ref velocityMagnitude)) - { - return true; - } - return false; - } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - Player player = Main.player[Projectile.owner]; - //Dont drop money from Dummies, WoF eyes and worm segments to make grinding money a bit harder and not give money from Dummies since that was apparently happening - if (Projectile.owner == Main.myPlayer && target.IsAnEnemy(false) && !target.dontCountMe && !CalamityNPCSets.ForceDrawDebuffDisplay[target.type]) - { - float moneyValueToDrop = target.value / Main.rand.NextFloat(15f, 35f); - // Maximum of 50 silver, not counting steath strikes - moneyValueToDrop = (int)MathHelper.Clamp(moneyValueToDrop, 0, 5000f); - if (Projectile.Calamity().stealthStrike && Main.rand.NextBool(20)) - { - moneyValueToDrop += Item.buyPrice(0, Main.rand.Next(1, 3), Main.rand.Next(0, 100), Main.rand.Next(0, 100)); - SoundEngine.PlaySound(TheSevensStriker.TriplesSound, Projectile.Center); - } - else if (moneyValueToDrop > 0f) - SoundEngine.PlaySound(TheSevensStriker.DoublesSound, Projectile.Center); - while (moneyValueToDrop > 10000f) - { - int modifiedMoneyValue = (int)(moneyValueToDrop / 10000f); - if (modifiedMoneyValue > 50 && Main.rand.NextBool(5)) - { - modifiedMoneyValue /= Main.rand.Next(3) + 1; - } - if (Main.rand.NextBool(5)) - { - modifiedMoneyValue /= Main.rand.Next(3) + 1; - } - moneyValueToDrop -= 10000 * modifiedMoneyValue; - Item.NewItem(target.GetSource_Loot(), target.Hitbox, ItemID.GoldCoin, modifiedMoneyValue); - } - while (moneyValueToDrop > 100f) - { - int modifiedMoneyValue = (int)(moneyValueToDrop / 100f); - if (modifiedMoneyValue > 50 && Main.rand.NextBool(5)) - { - modifiedMoneyValue /= Main.rand.Next(3) + 1; - } - if (Main.rand.NextBool(5)) - { - modifiedMoneyValue /= Main.rand.Next(3) + 1; - } - moneyValueToDrop -= 100 * modifiedMoneyValue; - Item.NewItem(target.GetSource_Loot(), target.Hitbox, ItemID.SilverCoin, modifiedMoneyValue); - } - while (moneyValueToDrop > 0f) - { - int modifiedMoneyValue = (int)moneyValueToDrop; - if (modifiedMoneyValue > 50 && Main.rand.NextBool(5)) - { - modifiedMoneyValue /= Main.rand.Next(3) + 1; - } - if (Main.rand.NextBool(5)) - { - modifiedMoneyValue /= Main.rand.Next(4) + 1; - } - if (modifiedMoneyValue < 1) - { - modifiedMoneyValue = 1; - } - moneyValueToDrop -= modifiedMoneyValue; - Item.NewItem(target.GetSource_Loot(), target.Hitbox, ItemID.CopperCoin, modifiedMoneyValue); - } - } - } - public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) - { - // Boost dmg in proportion to money, caps at 1 plat. - if (Projectile.Calamity().stealthStrike) - { - Player player = Main.player[Projectile.owner]; - double money = Utils.CoinsCount(out bool overflow, player.inventory); - double cap = 1000000; - if (money >= cap) - money = cap; - if (money != 0) - { - modifiers.SourceDamage *= (float)(money / 1000000 + 1); - SoundEngine.PlaySound(TheSevensStriker.JackpotSound, Projectile.Center); - for (int j = 0; j < 8; j++) - { - int dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.GoldCoin, 0f, 0f, 100, default, 3f); - Main.dust[dust2].noGravity = true; - Main.dust[dust2].velocity *= 5f; - dust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.GoldCoin, 0f, 0f, 100, default, 2f); - Main.dust[dust2].velocity *= 2f; - } - } - } - } - } -} diff --git a/Projectiles/Rogue/SlickCaneProjectileAlt.png b/Projectiles/Rogue/SlickCaneProjectileAlt.png deleted file mode 100644 index 1453d66510..0000000000 Binary files a/Projectiles/Rogue/SlickCaneProjectileAlt.png and /dev/null differ diff --git a/Projectiles/Rogue/WalkingCaneProjectile.cs b/Projectiles/Rogue/WalkingCaneProjectile.cs new file mode 100644 index 0000000000..833f863e5e --- /dev/null +++ b/Projectiles/Rogue/WalkingCaneProjectile.cs @@ -0,0 +1,94 @@ +using System; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.BaseProjectiles; +using CalamityMod.Systems.Collections; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class WalkingCaneProjectile : BaseSpearProjectile + { + public override LocalizedText DisplayName => CalamityUtils.GetItemName(); + public static Asset AltTexture; + + private bool initialized = false; + + public override void SetStaticDefaults() + { + if (!Main.dedServ) + AltTexture = ModContent.Request("CalamityMod/Projectiles/Rogue/WalkingCaneProjectileAlt"); + } + public override void SetDefaults() + { + Projectile.width = 80; + Projectile.height = 80; + Projectile.DamageType = RogueDamageClass.Instance; + Projectile.timeLeft = 120; + Projectile.friendly = true; + Projectile.hostile = false; + Projectile.tileCollide = false; + Projectile.ignoreWater = true; + Projectile.penetrate = -1; + Projectile.ownerHitCheck = true; + Projectile.hide = true; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + Projectile.alpha = 180; + Projectile.scale = 1.25f; + } + public override SpearType SpearAiType => SpearType.GhastlyGlaiveSpear; + public override float TravelSpeed => 35f; + + public override bool PreAI() + { + // Initialization. Using the AI hook would override the base spear's code, and we don't want that. + if (!initialized) + { + Main.player[Projectile.owner].Calamity().ConsumeStealthByAttacking(); + initialized = true; + } + return true; + } + + public override bool PreDraw(ref Color lightColor) + { + Vector2 drawPosition = Projectile.position + new Vector2(Projectile.width, Projectile.height) / 2f + Vector2.UnitY * Projectile.gfxOffY - Main.screenPosition; + Texture2D alternateHookTexture = Projectile.spriteDirection == -1 ? AltTexture.Value : Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Vector2 origin = new Vector2(Projectile.spriteDirection == 1 ? alternateHookTexture.Width + 8f : -8f, -8f); + + Main.EntitySpriteDraw(alternateHookTexture, drawPosition, null, lightColor, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); + return false; + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + float spearLengthMult = 3.2f; + float velocityMagnitude = 0f; + // For whatever fucking reason CheckAABBvLineCollision fails when you're completely inside a hitbox, so check for that too + return targetHitbox.Contains(Main.LocalPlayer.Center.ToPoint()) || Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), + Main.player[Projectile.owner].Center, Main.player[Projectile.owner].Center + Projectile.velocity * spearLengthMult, (TravelSpeed + 1f) * Projectile.scale, ref velocityMagnitude); + } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + if (Projectile.Calamity().stealthStrike) + { + target.Calamity().caneInsanityTimer = 600; + } + else if (target.Calamity().caneInsanityTimer > 0) + { + Vector2 position = target.Center + Main.rand.NextVector2CircularEdge(100f, 100f); + Vector2 velocity = (target.Center - position).SafeNormalize(Vector2.Zero) * 6f; + // Friendly shadow hands normally have four different behaviors, but Walking Cane only spawns shadow hands that immediately lunge + Projectile.NewProjectile(Projectile.GetSource_FromThis(), position, velocity, ProjectileID.InsanityShadowFriendly, (int)(Projectile.damage * 0.75f), Projectile.knockBack, Projectile.owner); + } + } + } +} diff --git a/Projectiles/Rogue/WalkingCaneProjectile.png b/Projectiles/Rogue/WalkingCaneProjectile.png new file mode 100644 index 0000000000..da54397462 Binary files /dev/null and b/Projectiles/Rogue/WalkingCaneProjectile.png differ diff --git a/Projectiles/Rogue/WalkingCaneProjectileAlt.png b/Projectiles/Rogue/WalkingCaneProjectileAlt.png new file mode 100644 index 0000000000..fe31c83a51 Binary files /dev/null and b/Projectiles/Rogue/WalkingCaneProjectileAlt.png differ diff --git a/Projectiles/Rogue/WrathwingCinder.cs b/Projectiles/Rogue/WrathwingCinder.cs index ab70362863..844aa62b7c 100644 --- a/Projectiles/Rogue/WrathwingCinder.cs +++ b/Projectiles/Rogue/WrathwingCinder.cs @@ -78,15 +78,6 @@ namespace CalamityMod.Projectiles.Rogue Projectile.velocity.X *= 0.995f; Projectile.rotation = Projectile.velocity.ToRotation() - MathHelper.PiOver2; - // commented out sound because it was way too loud - /* - if (projectile.localAI[0] == 0f) - { - projectile.localAI[0] = 1f; - Main.PlayTrackedSound(SoundID.DD2_BetsyFireballShot, projectile.Center); - } - */ - if (Projectile.ai[0] >= 2f) { Projectile.alpha -= 25; diff --git a/Projectiles/Summon/CorroslimeMinion.png b/Projectiles/Summon/BlightedSlimeCorro.png similarity index 100% rename from Projectiles/Summon/CorroslimeMinion.png rename to Projectiles/Summon/BlightedSlimeCorro.png diff --git a/Projectiles/Summon/CrimslimeMinion.png b/Projectiles/Summon/BlightedSlimeCrim.png similarity index 100% rename from Projectiles/Summon/CrimslimeMinion.png rename to Projectiles/Summon/BlightedSlimeCrim.png diff --git a/Projectiles/Summon/CrimslimeMinion.cs b/Projectiles/Summon/BlightedSlimeMinion.cs similarity index 69% rename from Projectiles/Summon/CrimslimeMinion.cs rename to Projectiles/Summon/BlightedSlimeMinion.cs index 934db01829..5871046865 100644 --- a/Projectiles/Summon/CrimslimeMinion.cs +++ b/Projectiles/Summon/BlightedSlimeMinion.cs @@ -2,23 +2,34 @@ using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class CrimslimeMinion : ModProjectile, ILocalizedModType + public class BlightedSlimeMinion : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Summon"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; public float dust = 0f; + public static Asset Corroslime; + public static Asset Crimslime; + public override void SetStaticDefaults() { Main.projFrames[Type] = 6; Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; + + if (!Main.dedServ) + { + Corroslime = ModContent.Request("CalamityMod/Projectiles/Summon/BlightedSlimeCorro"); + Crimslime = ModContent.Request("CalamityMod/Projectiles/Summon/BlightedSlimeCrim"); + } } public override void SetDefaults() @@ -34,47 +45,41 @@ namespace CalamityMod.Projectiles.Summon Projectile.penetrate = -1; Projectile.timeLeft *= 5; Projectile.minion = true; + AIType = ProjectileID.BabySlime; Projectile.tileCollide = false; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 23; - AIType = ProjectileID.BabySlime; + Projectile.localNPCHitCooldown = 30; Projectile.DamageType = DamageClass.Summon; } - public override bool TileCollideStyle(ref int width, ref int height, ref bool fallThrough, ref Vector2 hitboxCenterFrac) - { - fallThrough = false; - return true; - } - public override void AI() { Player player = Main.player[Projectile.owner]; CalamityPlayer modPlayer = player.Calamity(); if (dust == 0f) { - int constant = 16; - for (int i = 0; i < constant; i++) + int dustAmt = 16; + for (int i = 0; i < dustAmt; i++) { - Vector2 rotate = Vector2.Normalize(Projectile.velocity) * new Vector2((float)Projectile.width / 2f, (float)Projectile.height) * 0.75f; - rotate = rotate.RotatedBy((double)((float)(i - (constant / 2 - 1)) * 6.28318548f / (float)constant), default) + Projectile.Center; + Vector2 rotate = Vector2.Normalize(Projectile.velocity) * new Vector2(Projectile.width / 2f, Projectile.height) * 0.75f; + rotate = rotate.RotatedBy((i - (dustAmt / 2 - 1)) * MathHelper.TwoPi / (float)dustAmt) + Projectile.Center; Vector2 faceDirection = rotate - Projectile.Center; - int dust = Dust.NewDust(rotate + faceDirection, 0, 0, DustID.Blood, faceDirection.X * 1f, faceDirection.Y * 1f, 100, default, 1.1f); + int dust = Dust.NewDust(rotate + faceDirection, 0, 0, WorldGen.crimson ? DustID.Blood : DustID.Demonite, faceDirection.X, faceDirection.Y, 100, default, 1.1f); Main.dust[dust].noGravity = true; Main.dust[dust].noLight = true; Main.dust[dust].velocity = faceDirection; } dust += 1f; } - bool isMinion = Projectile.type == ModContent.ProjectileType(); - player.AddBuff(ModContent.BuffType(), 3600); + bool isMinion = Projectile.type == ModContent.ProjectileType(); + player.AddBuff(ModContent.BuffType(), 3600); if (isMinion) { if (player.dead) { - modPlayer.cSlime2 = false; + modPlayer.blightedSlime = false; } - if (modPlayer.cSlime2) + if (modPlayer.blightedSlime) { Projectile.timeLeft = 2; } @@ -85,7 +90,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Texture2D texture2D13 = (WorldGen.crimson ? Crimslime : Corroslime).Value; int framing = texture2D13.Height / Main.projFrames[Type]; int y6 = framing * Projectile.frame; Main.EntitySpriteDraw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)framing / 2f), Projectile.scale, SpriteEffects.None, 0); diff --git a/Projectiles/Summon/BoneMatter.cs b/Projectiles/Summon/BoneMatter.cs deleted file mode 100644 index 5b86428a3d..0000000000 --- a/Projectiles/Summon/BoneMatter.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Summon -{ - public class BoneMatter : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Summon"; - public override void SetStaticDefaults() - { - Main.projFrames[Type] = 6; - ProjectileID.Sets.MinionShot[Type] = true; - } - - public override void SetDefaults() - { - Projectile.width = 26; - Projectile.height = 32; - Projectile.friendly = true; - Projectile.tileCollide = true; - Projectile.DamageType = DamageClass.Summon; - } - - public override void AI() - { - if (Projectile.frameCounter++ % 9 == 8) - { - Projectile.frame++; - if (Projectile.frame >= Main.projFrames[Type]) - Projectile.Kill(); - } - } - } -} diff --git a/Projectiles/Summon/BoneMatter.png b/Projectiles/Summon/BoneMatter.png deleted file mode 100644 index 2f28b1ab30..0000000000 Binary files a/Projectiles/Summon/BoneMatter.png and /dev/null differ diff --git a/Projectiles/Summon/BoneMatter2.cs b/Projectiles/Summon/BoneMatter2.cs deleted file mode 100644 index f13ef7e259..0000000000 --- a/Projectiles/Summon/BoneMatter2.cs +++ /dev/null @@ -1,35 +0,0 @@ -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Summon -{ - public class BoneMatter2 : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Summon"; - public override void SetStaticDefaults() - { - Main.projFrames[Type] = 6; - ProjectileID.Sets.MinionShot[Type] = true; - } - - public override void SetDefaults() - { - Projectile.width = 26; - Projectile.height = 28; - Projectile.friendly = true; - Projectile.tileCollide = true; - Projectile.DamageType = DamageClass.Summon; - } - - public override void AI() - { - Projectile.frameCounter++; - if (Projectile.frameCounter % 9 == 8) - { - Projectile.frame++; - if (Projectile.frame >= Main.projFrames[Type]) - Projectile.Kill(); - } - } - } -} diff --git a/Projectiles/Summon/BoneMatter2.png b/Projectiles/Summon/BoneMatter2.png deleted file mode 100644 index 277aedabfd..0000000000 Binary files a/Projectiles/Summon/BoneMatter2.png and /dev/null differ diff --git a/Projectiles/Summon/BrimstoneElementalMinion.cs b/Projectiles/Summon/BrimstoneElementalMinion.cs index 81f4e960a3..b906f1c827 100644 --- a/Projectiles/Summon/BrimstoneElementalMinion.cs +++ b/Projectiles/Summon/BrimstoneElementalMinion.cs @@ -2,7 +2,10 @@ using CalamityMod.CalPlayer; using CalamityMod.Dusts; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.GameContent; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; @@ -43,7 +46,7 @@ namespace CalamityMod.Projectiles.Summon bool isActive = Projectile.type == ModContent.ProjectileType(); Player player = Main.player[Projectile.owner]; CalamityPlayer modPlayer = player.Calamity(); - if (!modPlayer.brimElemental && !modPlayer.allElementals && !modPlayer.brimElementalVanity && !modPlayer.allElementalsVanity) + if (modPlayer.brimElemental is null && modPlayer.allElementals is null && !modPlayer.brimElementalVanity && !modPlayer.allElementalsVanity) { Projectile.active = false; return; @@ -219,5 +222,29 @@ namespace CalamityMod.Projectiles.Summon return null; } } + + public override bool PreDraw(ref Color lightColor) + { + Texture2D tex = TextureAssets.Projectile[Type].Value; + Rectangle frame = tex.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + SpriteEffects sp = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + var cplayer = Main.player[Projectile.owner].Calamity(); + + if ((cplayer.brimElemental.HasValue && !cplayer.brimElemental.Value) || (cplayer.allElementals.HasValue && !cplayer.allElementals.Value)) + { + Vector3 hsl = Main.rgbToHsl(Color.Red); + CalamityUtils.EnterShaderRegion(Main.spriteBatch); + GameShaders.Misc["CalamityMod:BasicTint"].UseOpacity(1f); + GameShaders.Misc["CalamityMod:BasicTint"].UseSaturation(0.25f); + GameShaders.Misc["CalamityMod:BasicTint"].UseColor(Main.hslToRgb(1 - hsl.X, hsl.Y, hsl.Z)); + GameShaders.Misc["CalamityMod:BasicTint"].Apply(); + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, frame, lightColor, Projectile.rotation, frame.Size() * 0.5f, Projectile.scale, sp); + CalamityUtils.ExitShaderRegion(Main.spriteBatch); + } + else + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, frame, lightColor, Projectile.rotation, frame.Size() * 0.5f, Projectile.scale, sp); + + return false; + } } } diff --git a/Projectiles/Summon/CloudElementalMinion.cs b/Projectiles/Summon/CloudElementalMinion.cs index 4346b826ea..0b2b9ef16c 100644 --- a/Projectiles/Summon/CloudElementalMinion.cs +++ b/Projectiles/Summon/CloudElementalMinion.cs @@ -2,7 +2,10 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.GameContent; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; @@ -42,7 +45,7 @@ namespace CalamityMod.Projectiles.Summon { Player player = Main.player[Projectile.owner]; CalamityPlayer modPlayer = player.Calamity(); - if (!modPlayer.cloudElemental && !modPlayer.allElementals && !modPlayer.cloudElementalVanity && !modPlayer.allElementalsVanity) + if (!modPlayer.cloudElemental.HasValue && modPlayer.allElementals is null && !modPlayer.cloudElementalVanity && !modPlayer.allElementalsVanity) { Projectile.active = false; return; @@ -166,5 +169,28 @@ namespace CalamityMod.Projectiles.Summon return null; } } + + public override bool PreDraw(ref Color lightColor) + { + Texture2D tex = TextureAssets.Projectile[Type].Value; + Rectangle frame = tex.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + SpriteEffects sp = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + var cplayer = Main.player[Projectile.owner].Calamity(); + + if ((cplayer.cloudElemental.HasValue && !cplayer.cloudElemental.Value) || (cplayer.allElementals.HasValue && !cplayer.allElementals.Value)) + { + CalamityUtils.EnterShaderRegion(Main.spriteBatch); + GameShaders.Misc["CalamityMod:BasicTint"].UseOpacity(1f); + GameShaders.Misc["CalamityMod:BasicTint"].UseSaturation(0.25f); + GameShaders.Misc["CalamityMod:BasicTint"].UseColor(Color.White); + GameShaders.Misc["CalamityMod:BasicTint"].Apply(); + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, frame, lightColor, Projectile.rotation, frame.Size() * 0.5f, Projectile.scale, sp); + CalamityUtils.ExitShaderRegion(Main.spriteBatch); + } + else + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, frame, lightColor, Projectile.rotation, frame.Size() * 0.5f, Projectile.scale, sp); + + return false; + } } } diff --git a/Projectiles/Summon/CorroslimeMinion.cs b/Projectiles/Summon/CorroslimeMinion.cs deleted file mode 100644 index 9fd7296ef8..0000000000 --- a/Projectiles/Summon/CorroslimeMinion.cs +++ /dev/null @@ -1,97 +0,0 @@ -using CalamityMod.Buffs.Summon; -using CalamityMod.CalPlayer; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Summon -{ - public class CorroslimeMinion : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Summon"; - public float dust = 0f; - - public override void SetStaticDefaults() - { - Main.projFrames[Type] = 6; - Main.projPet[Type] = true; - ProjectileID.Sets.MinionSacrificable[Type] = true; - ProjectileID.Sets.MinionTargettingFeature[Type] = true; - } - - public override void SetDefaults() - { - Projectile.width = 26; - Projectile.height = 26; - Projectile.netImportant = true; - Projectile.friendly = true; - Projectile.minionSlots = 1; - Projectile.alpha = 75; - Projectile.aiStyle = ProjAIStyleID.Pet; - Projectile.timeLeft = 18000; - Projectile.penetrate = -1; - Projectile.timeLeft *= 5; - Projectile.minion = true; - AIType = ProjectileID.BabySlime; - Projectile.tileCollide = false; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 23; - Projectile.DamageType = DamageClass.Summon; - } - - public override bool TileCollideStyle(ref int width, ref int height, ref bool fallThrough, ref Vector2 hitboxCenterFrac) - { - fallThrough = false; - return true; - } - - public override void AI() - { - Player player = Main.player[Projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); - if (dust == 0f) - { - int constant = 16; - for (int i = 0; i < constant; i++) - { - Vector2 rotate = Vector2.Normalize(Projectile.velocity) * new Vector2((float)Projectile.width / 2f, (float)Projectile.height) * 0.75f; - rotate = rotate.RotatedBy((double)((float)(i - (constant / 2 - 1)) * 6.28318548f / (float)constant), default) + Projectile.Center; - Vector2 faceDirection = rotate - Projectile.Center; - int dust = Dust.NewDust(rotate + faceDirection, 0, 0, DustID.Demonite, faceDirection.X * 1f, faceDirection.Y * 1f, 100, default, 1.1f); - Main.dust[dust].noGravity = true; - Main.dust[dust].noLight = true; - Main.dust[dust].velocity = faceDirection; - } - dust += 1f; - } - bool isMinion = Projectile.type == ModContent.ProjectileType(); - player.AddBuff(ModContent.BuffType(), 3600); - if (isMinion) - { - if (player.dead) - { - modPlayer.cSlime = false; - } - if (modPlayer.cSlime) - { - Projectile.timeLeft = 2; - } - } - } - - public override bool MinionContactDamage() => true; - - public override bool PreDraw(ref Color lightColor) - { - Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - int framing = Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height / Main.projFrames[Type]; - int y6 = framing * Projectile.frame; - Main.EntitySpriteDraw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)framing / 2f), Projectile.scale, SpriteEffects.None, 0); - return false; - } - - public override bool OnTileCollide(Vector2 oldVelocity) => false; - } -} diff --git a/Projectiles/Summon/CorruptionSlimeGodMinion.png b/Projectiles/Summon/CorruptionSlimeGodMinion.png deleted file mode 100644 index 70d4fe5869..0000000000 Binary files a/Projectiles/Summon/CorruptionSlimeGodMinion.png and /dev/null differ diff --git a/Projectiles/Summon/CrimsonSlimeGodMinion.cs b/Projectiles/Summon/CrimsonSlimeGodMinion.cs deleted file mode 100644 index 3199f82bbc..0000000000 --- a/Projectiles/Summon/CrimsonSlimeGodMinion.cs +++ /dev/null @@ -1,99 +0,0 @@ -using CalamityMod.Buffs.Summon; -using CalamityMod.CalPlayer; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.GameContent; -using Terraria.ID; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Summon -{ - public class CrimsonSlimeGodMinion : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Summon"; - public override string Texture => "CalamityMod/Projectiles/Summon/CrimslimeMinion"; - public float dust = 0f; - - public override void SetStaticDefaults() - { - Main.projFrames[Type] = 6; - ProjectileID.Sets.MinionSacrificable[Type] = true; - ProjectileID.Sets.MinionTargettingFeature[Type] = true; - } - - public override void SetDefaults() - { - Projectile.width = 26; - Projectile.height = 26; - Projectile.netImportant = true; - Projectile.friendly = true; - Projectile.minionSlots = 0f; - Projectile.alpha = 75; - Projectile.aiStyle = ProjAIStyleID.Pet; - Projectile.timeLeft = 18000; - Projectile.penetrate = -1; - Projectile.timeLeft *= 5; - Projectile.minion = true; - Projectile.tileCollide = false; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 23; - AIType = ProjectileID.BabySlime; - Projectile.DamageType = DamageClass.Summon; - } - - public override bool TileCollideStyle(ref int width, ref int height, ref bool fallThrough, ref Vector2 hitboxCenterFrac) - { - fallThrough = false; - return true; - } - - public override void AI() - { - Player player = Main.player[Projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); - if (dust == 0f) - { - int constant = 16; - for (int i = 0; i < constant; i++) - { - Vector2 rotate = Vector2.Normalize(Projectile.velocity) * new Vector2((float)Projectile.width / 2f, (float)Projectile.height) * 0.75f; - rotate = rotate.RotatedBy((double)((float)(i - (constant / 2 - 1)) * 6.28318548f / (float)constant), default) + Projectile.Center; - Vector2 faceDirection = rotate - Projectile.Center; - int dust = Dust.NewDust(rotate + faceDirection, 0, 0, DustID.Blood, faceDirection.X * 1f, faceDirection.Y * 1f, 100, default, 1.1f); - Main.dust[dust].noGravity = true; - Main.dust[dust].noLight = true; - Main.dust[dust].velocity = faceDirection; - } - dust += 1f; - } - bool isMinion = Projectile.type == ModContent.ProjectileType(); - player.AddBuff(ModContent.BuffType(), 3600); - if (!modPlayer.slimeGod) - { - Projectile.active = false; - return; - } - if (isMinion) - { - if (player.dead) - { - modPlayer.sGod = false; - } - if (modPlayer.sGod) - { - Projectile.timeLeft = 2; - } - } - } - - public override bool OnTileCollide(Vector2 oldVelocity) => false; - - public override bool PreDraw(ref Color lightColor) - { - Texture2D slom = TextureAssets.Projectile[Type].Value; - Rectangle frame = slom.Frame(1, Main.projFrames[Type], 0, Projectile.frame); - Main.EntitySpriteDraw(slom, Projectile.Center - Main.screenPosition, frame, Projectile.GetAlpha(lightColor), Projectile.rotation, frame.Size() / 2f, Projectile.scale, SpriteEffects.None); - return false; - } - } -} diff --git a/Projectiles/Summon/CrimsonSlimeGodMinion.png b/Projectiles/Summon/CrimsonSlimeGodMinion.png deleted file mode 100644 index e4e1a4620f..0000000000 Binary files a/Projectiles/Summon/CrimsonSlimeGodMinion.png and /dev/null differ diff --git a/Projectiles/Summon/HydrothermicVent.cs b/Projectiles/Summon/HydrothermicVent.cs index a90d0b2d32..fdd82f6bb5 100644 --- a/Projectiles/Summon/HydrothermicVent.cs +++ b/Projectiles/Summon/HydrothermicVent.cs @@ -173,15 +173,6 @@ namespace CalamityMod.Projectiles.Summon Projectile.ai[0] = 20f; } } - - //doesn't look good - /*Vector2 goreVec = new Vector2(projectile.Center.X, projectile.Center.Y - yAdjust - 10f); - Vector2 goreVec = new Vector2(projectile.Center.X + projectile.velocity.X, projectile.Center.Y + projectile.velocity.Y); - if (Main.rand.NextBool(8)) - { - int smoke = Gore.NewGore(goreVec, default, Main.rand.Next(375, 378), 0.5f); - Main.gore[smoke].behindTiles = true; - }*/ } } diff --git a/Projectiles/Summon/SandElementalHealer.cs b/Projectiles/Summon/SandElementalHealer.cs index aa69a548bf..df2e86ec86 100644 --- a/Projectiles/Summon/SandElementalHealer.cs +++ b/Projectiles/Summon/SandElementalHealer.cs @@ -2,8 +2,11 @@ using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Healing; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; +using Terraria.GameContent; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; @@ -44,7 +47,7 @@ namespace CalamityMod.Projectiles.Summon Player player = Main.player[Projectile.owner]; CalamityPlayer modPlayer = player.Calamity(); - if (!modPlayer.oasisElemental && !modPlayer.allElementals && !modPlayer.oasisElementalVanity && !modPlayer.allElementalsVanity) + if (!modPlayer.oasisElemental.HasValue && modPlayer.allElementals is null && !modPlayer.oasisElementalVanity && !modPlayer.allElementalsVanity) { Projectile.active = false; return; @@ -198,5 +201,29 @@ namespace CalamityMod.Projectiles.Summon return null; } } + + public override bool PreDraw(ref Color lightColor) + { + Texture2D tex = TextureAssets.Projectile[Type].Value; + Rectangle frame = tex.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + SpriteEffects sp = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + var cplayer = Main.player[Projectile.owner].Calamity(); + + if ((cplayer.oasisElemental.HasValue && !cplayer.oasisElemental.Value) || (cplayer.allElementals.HasValue && !cplayer.allElementals.Value)) + { + Vector3 hsl = Main.rgbToHsl(Color.LawnGreen); + CalamityUtils.EnterShaderRegion(Main.spriteBatch); + GameShaders.Misc["CalamityMod:BasicTint"].UseOpacity(1f); + GameShaders.Misc["CalamityMod:BasicTint"].UseSaturation(0.25f); + GameShaders.Misc["CalamityMod:BasicTint"].UseColor(Main.hslToRgb(1 - hsl.X, hsl.Y, hsl.Z)); + GameShaders.Misc["CalamityMod:BasicTint"].Apply(); + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, frame, Color.White, Projectile.rotation, frame.Size() * 0.5f, Projectile.scale, sp); + CalamityUtils.ExitShaderRegion(Main.spriteBatch); + } + else + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, frame, lightColor, Projectile.rotation, frame.Size() * 0.5f, Projectile.scale, sp); + + return false; + } } } diff --git a/Projectiles/Summon/SandElementalMinion.cs b/Projectiles/Summon/SandElementalMinion.cs index 397f3481cd..267d778619 100644 --- a/Projectiles/Summon/SandElementalMinion.cs +++ b/Projectiles/Summon/SandElementalMinion.cs @@ -1,7 +1,10 @@ using System; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.GameContent; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; @@ -41,7 +44,7 @@ namespace CalamityMod.Projectiles.Summon { Player player = Main.player[Projectile.owner]; CalamityPlayer modPlayer = player.Calamity(); - if (!modPlayer.sandElemental && !modPlayer.allElementals && !modPlayer.sandElementalVanity && !modPlayer.allElementalsVanity) + if (!modPlayer.sandElemental.HasValue && modPlayer.allElementals is null && !modPlayer.sandElementalVanity && !modPlayer.allElementalsVanity) { Projectile.active = false; return; @@ -250,5 +253,29 @@ namespace CalamityMod.Projectiles.Summon } } public override bool? CanDamage() => false; + + public override bool PreDraw(ref Color lightColor) + { + Texture2D tex = TextureAssets.Projectile[Type].Value; + Rectangle frame = tex.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + SpriteEffects sp = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + var cplayer = Main.player[Projectile.owner].Calamity(); + + if ((cplayer.sandElemental.HasValue && !cplayer.sandElemental.Value) || (cplayer.allElementals.HasValue && !cplayer.allElementals.Value)) + { + Vector3 hsl = Main.rgbToHsl(Color.SandyBrown); + CalamityUtils.EnterShaderRegion(Main.spriteBatch); + GameShaders.Misc["CalamityMod:BasicTint"].UseOpacity(1f); + GameShaders.Misc["CalamityMod:BasicTint"].UseSaturation(0.25f); + GameShaders.Misc["CalamityMod:BasicTint"].UseColor(Main.hslToRgb(1 - hsl.X, hsl.Y, hsl.Z)); + GameShaders.Misc["CalamityMod:BasicTint"].Apply(); + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, frame, lightColor, Projectile.rotation, frame.Size() * 0.5f, Projectile.scale, sp); + CalamityUtils.ExitShaderRegion(Main.spriteBatch); + } + else + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, frame, lightColor, Projectile.rotation, frame.Size() * 0.5f, Projectile.scale, sp); + + return false; + } } } diff --git a/Projectiles/Summon/SmallSkeletonMinion.cs b/Projectiles/Summon/SmallSkeletonMinion.cs index d5be045715..5aaa5133c0 100644 --- a/Projectiles/Summon/SmallSkeletonMinion.cs +++ b/Projectiles/Summon/SmallSkeletonMinion.cs @@ -36,9 +36,8 @@ namespace CalamityMod.Projectiles.Summon Projectile.timeLeft *= 5; Projectile.minion = true; Projectile.DamageType = DamageClass.Summon; - Projectile.MaxUpdates = 2; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = Projectile.MaxUpdates * 15; + Projectile.localNPCHitCooldown = 20; } public override void SendExtraAI(BinaryWriter writer) { @@ -66,82 +65,61 @@ namespace CalamityMod.Projectiles.Summon Projectile.frameCounter = 0; } if (Projectile.frame < 1) - { Projectile.frame = 1; - } if (Projectile.frame >= Main.projFrames[Type]) - { Projectile.frame = 1; - } bool isCorrectProjectile = Projectile.type == ModContent.ProjectileType(); player.AddBuff(ModContent.BuffType(), 3600); if (isCorrectProjectile) { if (player.dead) - { modPlayer.necrosteocytesDudes = false; - } if (modPlayer.necrosteocytesDudes) - { Projectile.timeLeft = 2; - } } NPC potentialTarget = Projectile.Center.MinionHoming(900f, player); - if (Projectile.velocity.Y == 0 && (HoleBelow() || (Projectile.Distance(player.Center) > 205f && Projectile.position.X == Projectile.oldPosition.X))) - { + if (Projectile.velocity.Y == 0 && (HoleBelow() || (Projectile.Distance(player.Center) > 320f && Projectile.position.X == Projectile.oldPosition.X) || (potentialTarget is not null && Projectile.Top.Y > potentialTarget.Bottom.Y))) Projectile.velocity.Y = -10f; - } else if (Projectile.velocity.Y != 0f) - { Projectile.frame = 2; - } - if (Projectile.velocity.Y > -16f) - { + if (Projectile.velocity.Y < 16f) Projectile.velocity.Y += 0.3f; - } - Projectile.ai[0]++; - if (Projectile.ai[0] % 60f == 59f && Main.myPlayer == Projectile.owner) - { - int type = Utils.SelectRandom(Main.rand, ModContent.ProjectileType(), ModContent.ProjectileType()); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, type, Projectile.damage, Projectile.knockBack, Projectile.owner); - } if (potentialTarget is null) { - if (Math.Abs(player.Center.X - Projectile.Center.X + 40f * Projectile.minionPos) > 160f) + if (Math.Abs(player.Center.X - Projectile.Center.X - 30f * Projectile.minionPos * player.direction) > 80f) { - Projectile.velocity.X += Main.rand.NextFloat(0.11f, 0.16f) * (player.Center.X - Projectile.Center.X + 40f * Projectile.minionPos > 0f).ToDirectionInt(); + Projectile.velocity.X += Main.rand.NextFloat(0.1f, 0.13f) * (player.Center.X - Projectile.Center.X + 40f * Projectile.minionPos > 0f).ToDirectionInt(); Projectile.velocity.X = MathHelper.Clamp(Projectile.velocity.X, -13f, 13f); } else { - Projectile.velocity.X *= 0.95f; + Projectile.velocity.X *= 0.925f; + if (MathF.Abs(Projectile.velocity.X) < 0.05f) + Projectile.velocity.X = 0f; } - if (Projectile.Distance(player.Center) <= 150f) - { + + if (Projectile.velocity.X == 0f) Projectile.frame = 0; - } if (Projectile.Distance(player.Center) > 1600f) { Projectile.Center = player.Center; + Projectile.velocity = Vector2.Zero; Projectile.netUpdate = true; } } else { - if (Math.Abs(potentialTarget.Center.X - Projectile.Center.X + (int)MathHelper.Min(potentialTarget.width / 2, 40f)) > (int)MathHelper.Min(potentialTarget.width / 2, 40f)) - { - Projectile.velocity.X += Main.rand.NextFloat(0.08f, 0.15f) * (potentialTarget.Center.X - Projectile.Center.X > 0f).ToDirectionInt(); - Projectile.velocity.X = MathHelper.Clamp(Projectile.velocity.X, -16f, 16f); - } - else - { + Projectile.velocity.X += Main.rand.NextFloat(0.1f, 0.13f) * (potentialTarget.Center.X > Projectile.Center.X).ToDirectionInt(); + Projectile.velocity.X = MathHelper.Clamp(Projectile.velocity.X, -13f, 13f); + if (Math.Sign(Projectile.velocity.X) != (potentialTarget.Center.X > Projectile.Center.X).ToDirectionInt()) Projectile.velocity.X *= 0.95f; - } + if (Projectile.Distance(player.Center) > 1400f) { Projectile.Center = player.Center; + Projectile.velocity = Vector2.Zero; Projectile.netUpdate = true; } Projectile.MinionAntiClump(0.075f); diff --git a/Projectiles/Summon/CorruptionSlimeGodMinion.cs b/Projectiles/Summon/StatigelBlightedSlime.cs similarity index 82% rename from Projectiles/Summon/CorruptionSlimeGodMinion.cs rename to Projectiles/Summon/StatigelBlightedSlime.cs index e627103010..3b7e1f44a3 100644 --- a/Projectiles/Summon/CorruptionSlimeGodMinion.cs +++ b/Projectiles/Summon/StatigelBlightedSlime.cs @@ -2,23 +2,33 @@ using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class CorruptionSlimeGodMinion : ModProjectile, ILocalizedModType + public class StatigelBlightedSlime : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Summon"; - public override string Texture => "CalamityMod/Projectiles/Summon/CorroslimeMinion"; + public override string Texture => "CalamityMod/Projectiles/Summon/BlightedSlimeCorro"; public float dust = 0f; + public static Asset Corroslime; + public static Asset Crimslime; + public override void SetStaticDefaults() { Main.projFrames[Type] = 6; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; + + if (!Main.dedServ) + { + Corroslime = ModContent.Request("CalamityMod/Projectiles/Summon/BlightedSlimeCorro"); + Crimslime = ModContent.Request("CalamityMod/Projectiles/Summon/BlightedSlimeCrim"); + } } public override void SetDefaults() @@ -37,7 +47,7 @@ namespace CalamityMod.Projectiles.Summon AIType = ProjectileID.BabySlime; Projectile.tileCollide = false; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 23; + Projectile.localNPCHitCooldown = 30; Projectile.DamageType = DamageClass.Summon; } @@ -66,8 +76,8 @@ namespace CalamityMod.Projectiles.Summon } dust += 1f; } - bool isMinion = Projectile.type == ModContent.ProjectileType(); - player.AddBuff(ModContent.BuffType(), 3600); + bool isMinion = Projectile.type == ModContent.ProjectileType(); + player.AddBuff(ModContent.BuffType(), 3600); if (!modPlayer.slimeGod) { Projectile.active = false; @@ -90,7 +100,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { - Texture2D slom = TextureAssets.Projectile[Type].Value; + Texture2D slom = (WorldGen.crimson ? Crimslime : Corroslime).Value; Rectangle frame = slom.Frame(1, Main.projFrames[Type], 0, Projectile.frame); Main.EntitySpriteDraw(slom, Projectile.Center - Main.screenPosition, frame, Projectile.GetAlpha(lightColor), Projectile.rotation, frame.Size() / 2f, Projectile.scale, SpriteEffects.None); return false; diff --git a/Projectiles/Summon/WaterElementalMinion.cs b/Projectiles/Summon/WaterElementalMinion.cs index e04dd72736..918346f7c3 100644 --- a/Projectiles/Summon/WaterElementalMinion.cs +++ b/Projectiles/Summon/WaterElementalMinion.cs @@ -1,7 +1,10 @@ using System; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.GameContent; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; @@ -40,7 +43,7 @@ namespace CalamityMod.Projectiles.Summon bool isMinion = Projectile.type == ModContent.ProjectileType(); Player player = Main.player[Projectile.owner]; CalamityPlayer modPlayer = player.Calamity(); - if (!modPlayer.waterElemental && !modPlayer.allElementals && !modPlayer.waterElementalVanity && !modPlayer.allElementalsVanity) + if (!modPlayer.waterElemental.HasValue && modPlayer.allElementals is null && !modPlayer.waterElementalVanity && !modPlayer.allElementalsVanity) { Projectile.active = false; return; @@ -185,5 +188,29 @@ namespace CalamityMod.Projectiles.Summon } public override bool? CanDamage() => false; + + public override bool PreDraw(ref Color lightColor) + { + Texture2D tex = TextureAssets.Projectile[Type].Value; + Rectangle frame = tex.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + SpriteEffects sp = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + var cplayer = Main.player[Projectile.owner].Calamity(); + + if ((cplayer.waterElemental.HasValue && !cplayer.waterElemental.Value) || (cplayer.allElementals.HasValue && !cplayer.allElementals.Value)) + { + Vector3 hsl = Main.rgbToHsl(Color.CornflowerBlue); + CalamityUtils.EnterShaderRegion(Main.spriteBatch); + GameShaders.Misc["CalamityMod:BasicTint"].UseOpacity(1f); + GameShaders.Misc["CalamityMod:BasicTint"].UseSaturation(0.25f); + GameShaders.Misc["CalamityMod:BasicTint"].UseColor(Main.hslToRgb(1 - hsl.X, hsl.Y, hsl.Z)); + GameShaders.Misc["CalamityMod:BasicTint"].Apply(); + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, frame, lightColor, Projectile.rotation, frame.Size() * 0.5f, Projectile.scale, sp); + CalamityUtils.ExitShaderRegion(Main.spriteBatch); + } + else + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, frame, lightColor, Projectile.rotation, frame.Size() * 0.5f, Projectile.scale, sp); + + return false; + } } } diff --git a/Projectiles/Typeless/AscendantAura.cs b/Projectiles/Typeless/AscendantAura.cs index 36a18030fa..1d3b8c7af3 100644 --- a/Projectiles/Typeless/AscendantAura.cs +++ b/Projectiles/Typeless/AscendantAura.cs @@ -63,25 +63,6 @@ namespace CalamityMod.Projectiles.Typeless // Stay on the player's head Projectile.Center = (Owner.MountedCenter + new Vector2(0, -45)); - Vector2 spawnPos = Projectile.Center + Main.rand.NextVector2Circular(5, 5); - int lifetime = Main.rand.Next(3, 6); - float scale = Main.rand.NextFloat(0.5f, 0.9f); - Color color = Main.rand.NextBool(3) ? Color.LightGreen : Color.Khaki; - /* - SparkParticle spark1 = new SparkParticle(spawnPos, new Vector2(Main.rand.NextFloat(7, 12), Main.rand.NextFloat(7, 12)), false, lifetime, scale, color); - GeneralParticleHandler.SpawnParticle(spark1); - SparkParticle spark2 = new SparkParticle(spawnPos, new Vector2(Main.rand.NextFloat(-7, -12), Main.rand.NextFloat(7, 12)), false, lifetime, scale, color); - GeneralParticleHandler.SpawnParticle(spark2); - SparkParticle spark3 = new SparkParticle(spawnPos, new Vector2(Main.rand.NextFloat(7, 12), Main.rand.NextFloat(-7, -12)), false, lifetime, scale, color); - GeneralParticleHandler.SpawnParticle(spark3); - SparkParticle spark4 = new SparkParticle(spawnPos, new Vector2(Main.rand.NextFloat(-7, -12), Main.rand.NextFloat(-7, -12)), false, lifetime, scale, color); - GeneralParticleHandler.SpawnParticle(spark4); - SparkParticle spark5 = new SparkParticle(Projectile.Center + new Vector2(20, 0), new Vector2(Main.rand.NextFloat(7, 12), 0), false, lifetime, scale, color); - GeneralParticleHandler.SpawnParticle(spark5); - SparkParticle spark6 = new SparkParticle(Projectile.Center + new Vector2(-20, 0), new Vector2(Main.rand.NextFloat(-7, -12), 0), false, lifetime, scale - 0.3f, color); - GeneralParticleHandler.SpawnParticle(spark6); - */ - // Emit some light Vector3 Light = new Vector3(0.251f, 0.255f, 0.219f); Lighting.AddLight(Projectile.Center, Light * 5); diff --git a/Systems/Collections/CalamityItemSets.cs b/Systems/Collections/CalamityItemSets.cs index 8dc2c08734..ed6c771f1f 100644 --- a/Systems/Collections/CalamityItemSets.cs +++ b/Systems/Collections/CalamityItemSets.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Systems.Collections public static bool[] WeaponWithToolPowerAffectedBySummonPenalty = Factory.CreateNamedSet("WeaponWithToolPowerAffectedBySummonPenalty") .Description("Makes items with tool power still trigger the summon damage penalty.") .RegisterBoolSet(ItemID.ButchersChainsaw, ItemID.LucyTheAxe, ItemID.Rockfish, ItemType(), ItemType(), ItemType(), - ItemType(), ItemType()); + ItemType(), ItemType(), ItemType()); /// /// If for an item type, manually disables Calamity's summon damage penalty mechanic while that item type is held.
@@ -60,7 +60,7 @@ namespace CalamityMod.Systems.Collections ///
public static bool[] DisablesVeneratedLocketEffect = Factory.CreateNamedSet("DisablesVeneratedLocketEffect") .Description("Prevents this item from triggering Venerated Locket's clone projectiles.") - .RegisterBoolSet(ItemType(), ItemType(), ItemType()); + .RegisterBoolSet(ItemType(), ItemType(), ItemType()); /// /// If for an item type, this item is considered to be a magic gun.
diff --git a/Systems/Mechanic/TilePingerSystem.PingEffects.cs b/Systems/Mechanic/TilePingerSystem.PingEffects.cs index 0627884742..6217aef3d7 100644 --- a/Systems/Mechanic/TilePingerSystem.PingEffects.cs +++ b/Systems/Mechanic/TilePingerSystem.PingEffects.cs @@ -142,33 +142,6 @@ public class WulfrumPingTileEffect : IPingedTileEffect, ILoadable Main.spriteBatch.Draw(emptyFrame, pos.ToWorldCoordinates() - Main.screenPosition, null, Color.White, 0, new Vector2(emptyFrame.Width / 2f, emptyFrame.Height / 2f), 16f, 0, 0); } - // CIT 16JUL2025: Tile lighting override is now applied via an On edit; this code is duplicated there, and thus is no longer needed here. - /*public void EditDrawData(int i, int j, ref TileDrawInfo drawData) - { - float distanceFromCenter = (new Point(i, j).ToWorldCoordinates() - PingCenter).Length(); - float currentExpansion = MathHelper.Clamp(PingProgress * MaxPingLife / (float)MaxPingTravelTime, 0f, 1f) * MaxPingRadius; - - if (distanceFromCenter - 8 > currentExpansion) - return; - - float brightness = 1f; - Tile tile = Framing.GetTileSafely(i, j); - //Counteracts slopes and half tiles being too bright - if (tile.Slope != SlopeType.Solid || tile.IsHalfBlock) - brightness = 0.64f; - - //Fade on the edges - if (distanceFromCenter + 8 > currentExpansion) - brightness *= 1 - (distanceFromCenter - currentExpansion + 8f) / 16f; - - //Fade away with the effect - brightness *= 1 - Math.Max(PingProgress - 0.9f, 0) / (0.1f); - - if (drawData.tileLight.R < 200 * brightness) drawData.tileLight.R = (byte)(200 * brightness); - if (drawData.tileLight.G < 200 * brightness) drawData.tileLight.G = (byte)(200 * brightness); - if (drawData.tileLight.B < 200 * brightness) drawData.tileLight.B = (byte)(200 * brightness); - }*/ - public void UpdateEffect() { if (PingTimer > 0) diff --git a/Tiles/Crags/ScorchedRemainsGrass.cs b/Tiles/Crags/ScorchedRemainsGrass.cs index 728a96dc12..fc184afc16 100644 --- a/Tiles/Crags/ScorchedRemainsGrass.cs +++ b/Tiles/Crags/ScorchedRemainsGrass.cs @@ -177,9 +177,7 @@ namespace CalamityMod.Tiles.Crags #region 'Extra Drapes' Drawing private void DrawExtraTop(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) { - /* - If the tile directly above this tile is not otherworldly stone, or if it is, there is air to both sides of that tile, draw the Extra surface - */ + // If the tile directly above this tile is not otherworldly stone, or if it is, there is air to both sides of that tile, draw the Extra surface if ( CheckTile(Type, false, 0, 1, i, j) || (CheckTile(Type, true, 0, 1, i, j) && CheckTile(Type, false, 1, 1, i, j) && CheckTile(Type, false, -1, 1, i, j) && CheckTile(Type, true, 1, 0, i, j) && CheckTile(Type, true, -1, 0, i, j)) @@ -194,9 +192,7 @@ namespace CalamityMod.Tiles.Crags private void DrawExtraWallEnds(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) { - /* - Ending the Extra when a wall is reached - */ + // Ending the Extra when a wall is reached //Left if ( @@ -220,9 +216,7 @@ namespace CalamityMod.Tiles.Crags private void DrawExtraOverhang(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) { - /* - Called from DrawExtraTop(). Ending the Extra when the edge of the tile is reached - */ + // Called from DrawExtraTop(). Ending the Extra when the edge of the tile is reached //Left if ( @@ -244,9 +238,7 @@ namespace CalamityMod.Tiles.Crags private void DrawExtraDrapes(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) { - /* - Hanging 'drapes' of the extra element - */ + // Hanging 'drapes' of the extra element //Base if ( @@ -325,113 +317,6 @@ namespace CalamityMod.Tiles.Crags { return Main.tile[i, j].TileFrameNumber * extraFrameWidth; } - - /* - private int GetTileVariant(int i, int j) - { - int variant = 0; //Default to using variant 1 - Tile sourceTile = Main.tile[i, j]; - //Now to get the particular 'variant group' to use, which is used to take the frameX/frameY of the tile and convert it to the variant the tile is using - int frameX = sourceTile.frameX / 18; - int frameY = sourceTile.frameY / 18; - if (frameY < 3 && !(frameX >= 6 && frameX < 9)) - { - int group = 0; - int[] group1XPos = new int[] { 1, 2, 3 }; - int[] group2XPos = new int[] { 0, 4, 5, 9, 10, 11, 12 }; - foreach (int k in group1XPos) - { - if (frameX < k + 1 && frameX >= k) - { - group = 1; - } - } - foreach (int k in group2XPos) - { - if (frameX < k + 1 && frameX >= k) - { - group = 2; - } - } - if (group == 1) - { - if (frameX < 2) - { - variant = 0; - } - else if (frameX < 3) - { - variant = 1; - } - else - { - variant = 2; - } - } - else if (group == 2) - { - if (frameY < 1) - { - variant = 0; - } - else if (frameY < 2) - { - variant = 1; - } - else - { - variant = 2; - } - } - } - else if (frameX < 6 && frameY >= 3) - { - if (frameX < 2) - { - variant = 0; - } - else if (frameX < 4) - { - variant = 1; - } - else - { - variant = 2; - } - } - else if (frameX >= 6 && frameX < 9) - { - if (frameX < 7) - { - variant = 0; - } - else if (frameX < 8) - { - variant = 1; - } - else - { - variant = 2; - } - } - else if (frameX >= 9 && frameY >= 3) - { - if (frameX < 10) - { - variant = 0; - } - else if (frameX < 11) - { - variant = 1; - } - else - { - variant = 2; - } - } - return (variant); - } - */ #endregion } } diff --git a/Tiles/FurnitureAshen/AshenAccentSlab.cs b/Tiles/FurnitureAshen/AshenAccentSlab.cs index 7eb8b524e2..6935d176e5 100644 --- a/Tiles/FurnitureAshen/AshenAccentSlab.cs +++ b/Tiles/FurnitureAshen/AshenAccentSlab.cs @@ -532,122 +532,5 @@ namespace CalamityMod.Tiles.FurnitureAshen Main.spriteBatch.Draw(glowmask, drawOffset + new Vector2(0f, 8f), new Rectangle?(new Rectangle(xDrawPos, yDrawPos, 18, 8)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); } } - - /* - /// - /// Gets the tile variant to use. Returns -1 by default - /// - /// - /// - /// - public int GetTileVariant(int i, int j) - { - int variant = 0; //Default to using variant 1 - if (j % 3 < 2) - { - //We need to get the particular tile to refer to. This is the top left tile in each iteration of the pattern (large slab above the small rune bricks - Tile sourceTile = Main.tile[i - (i % 2), j - (j % 3)]; //Gets the tile for this iteration by taking the current position of the tile minus this tile's position in the pattern - //Now to get the particular 'variant group' to use, which is used to take the frameX/frameY of the tile and convert it to the variant the tile is using - int frameX = sourceTile.frameX / 18; - int frameY = sourceTile.frameY / 18; - if (frameY < 3 && !(frameX >= 6 && frameX < 9)) - { - int group = 0; - int[] group1XPos = new int[] { 1, 2, 3 }; - int[] group2XPos = new int[] { 0, 4, 5, 9, 10, 11, 12 }; - foreach (int k in group1XPos) - { - if (frameX < k + 1 && frameX >= k) - { - group = 1; - } - } - foreach (int k in group2XPos) - { - if (frameX < k + 1 && frameX >= k) - { - group = 2; - } - } - if (group == 1) - { - if (frameX < 2) - { - variant = 0; - } - else if (frameX < 3) - { - variant = 1; - } - else - { - variant = 2; - } - } - else if (group == 2) - { - if (frameY < 1) - { - variant = 0; - } - else if (frameY < 2) - { - variant = 1; - } - else - { - variant = 2; - } - } - } - else if (frameX < 6 && frameY >= 3) - { - if (frameX < 2) - { - variant = 0; - } - else if (frameX < 4) - { - variant = 1; - } - else - { - variant = 2; - } - } - else if (frameX >= 6 && frameX < 9) - { - if (frameX < 7) - { - variant = 0; - } - else if (frameX < 8) - { - variant = 1; - } - else - { - variant = 2; - } - } - else if (frameX >= 9 && frameY >= 3) - { - if (frameX < 10) - { - variant = 0; - } - else if (frameX < 11) - { - variant = 1; - } - else - { - variant = 2; - } - } - } - return (variant); - } - */ } } diff --git a/Tiles/FurnitureAshen/AshenSlab.cs b/Tiles/FurnitureAshen/AshenSlab.cs index 809dbd3bc7..88cb5bc72b 100644 --- a/Tiles/FurnitureAshen/AshenSlab.cs +++ b/Tiles/FurnitureAshen/AshenSlab.cs @@ -532,122 +532,5 @@ namespace CalamityMod.Tiles.FurnitureAshen Main.spriteBatch.Draw(glowmask, drawOffset + new Vector2(0f, 8f), new Rectangle?(new Rectangle(xDrawPos, yDrawPos, 18, 8)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); } } - - /* - /// - /// Gets the tile variant to use. Returns -1 by default - /// - /// - /// - /// - public int GetTileVariant(int i, int j) - { - int variant = 0; //Default to using variant 1 - if (j % 3 < 2) - { - //We need to get the particular tile to refer to. This is the top left tile in each iteration of the pattern (large slab above the small rune bricks - Tile sourceTile = Main.tile[i - (i % 2), j - (j % 3)]; //Gets the tile for this iteration by taking the current position of the tile minus this tile's position in the pattern - //Now to get the particular 'variant group' to use, which is used to take the frameX/frameY of the tile and convert it to the variant the tile is using - int frameX = sourceTile.frameX / 18; - int frameY = sourceTile.frameY / 18; - if (frameY < 3 && !(frameX >= 6 && frameX < 9)) - { - int group = 0; - int[] group1XPos = new int[] { 1, 2, 3 }; - int[] group2XPos = new int[] { 0, 4, 5, 9, 10, 11, 12 }; - foreach (int k in group1XPos) - { - if (frameX < k + 1 && frameX >= k) - { - group = 1; - } - } - foreach (int k in group2XPos) - { - if (frameX < k + 1 && frameX >= k) - { - group = 2; - } - } - if (group == 1) - { - if (frameX < 2) - { - variant = 0; - } - else if (frameX < 3) - { - variant = 1; - } - else - { - variant = 2; - } - } - else if (group == 2) - { - if (frameY < 1) - { - variant = 0; - } - else if (frameY < 2) - { - variant = 1; - } - else - { - variant = 2; - } - } - } - else if (frameX < 6 && frameY >= 3) - { - if (frameX < 2) - { - variant = 0; - } - else if (frameX < 4) - { - variant = 1; - } - else - { - variant = 2; - } - } - else if (frameX >= 6 && frameX < 9) - { - if (frameX < 7) - { - variant = 0; - } - else if (frameX < 8) - { - variant = 1; - } - else - { - variant = 2; - } - } - else if (frameX >= 9 && frameY >= 3) - { - if (frameX < 10) - { - variant = 0; - } - else if (frameX < 11) - { - variant = 1; - } - else - { - variant = 2; - } - } - } - return (variant); - } - */ } } diff --git a/Tiles/FurnitureOtherworldly/OtherworldlyStone.cs b/Tiles/FurnitureOtherworldly/OtherworldlyStone.cs index 1d736949b8..b8f9142d04 100644 --- a/Tiles/FurnitureOtherworldly/OtherworldlyStone.cs +++ b/Tiles/FurnitureOtherworldly/OtherworldlyStone.cs @@ -82,9 +82,7 @@ namespace CalamityMod.Tiles.FurnitureOtherworldly #region 'Extra Drapes' Drawing private void DrawExtraTop(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) { - /* - If the tile directly above this tile is not otherworldly stone, or if it is, there is air to both sides of that tile, draw the Extra surface - */ + // If the tile directly above this tile is not otherworldly stone, or if it is, there is air to both sides of that tile, draw the Extra surface if ( CheckTile(Type, false, 0, 1, i, j) || (CheckTile(Type, true, 0, 1, i, j) && CheckTile(Type, false, 1, 1, i, j) && CheckTile(Type, false, -1, 1, i, j) && CheckTile(Type, true, 1, 0, i, j) && CheckTile(Type, true, -1, 0, i, j)) @@ -99,9 +97,7 @@ namespace CalamityMod.Tiles.FurnitureOtherworldly private void DrawExtraWallEnds(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) { - /* - Ending the Extra when a wall is reached - */ + // Ending the Extra when a wall is reached //Left if ( @@ -125,9 +121,7 @@ namespace CalamityMod.Tiles.FurnitureOtherworldly private void DrawExtraOverhang(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) { - /* - Called from DrawExtraTop(). Ending the Extra when the edge of the tile is reached - */ + // Called from DrawExtraTop(). Ending the Extra when the edge of the tile is reached //Left if ( @@ -149,9 +143,7 @@ namespace CalamityMod.Tiles.FurnitureOtherworldly private void DrawExtraDrapes(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) { - /* - Hanging 'drapes' of the extra element - */ + // Hanging 'drapes' of the extra element //Base if ( @@ -230,113 +222,6 @@ namespace CalamityMod.Tiles.FurnitureOtherworldly { return Main.tile[i, j].TileFrameNumber * extraFrameWidth; } - - /* - private int GetTileVariant(int i, int j) - { - int variant = 0; //Default to using variant 1 - Tile sourceTile = Main.tile[i, j]; - //Now to get the particular 'variant group' to use, which is used to take the frameX/frameY of the tile and convert it to the variant the tile is using - int frameX = sourceTile.frameX / 18; - int frameY = sourceTile.frameY / 18; - if (frameY < 3 && !(frameX >= 6 && frameX < 9)) - { - int group = 0; - int[] group1XPos = new int[] { 1, 2, 3 }; - int[] group2XPos = new int[] { 0, 4, 5, 9, 10, 11, 12 }; - foreach (int k in group1XPos) - { - if (frameX < k + 1 && frameX >= k) - { - group = 1; - } - } - foreach (int k in group2XPos) - { - if (frameX < k + 1 && frameX >= k) - { - group = 2; - } - } - if (group == 1) - { - if (frameX < 2) - { - variant = 0; - } - else if (frameX < 3) - { - variant = 1; - } - else - { - variant = 2; - } - } - else if (group == 2) - { - if (frameY < 1) - { - variant = 0; - } - else if (frameY < 2) - { - variant = 1; - } - else - { - variant = 2; - } - } - } - else if (frameX < 6 && frameY >= 3) - { - if (frameX < 2) - { - variant = 0; - } - else if (frameX < 4) - { - variant = 1; - } - else - { - variant = 2; - } - } - else if (frameX >= 6 && frameX < 9) - { - if (frameX < 7) - { - variant = 0; - } - else if (frameX < 8) - { - variant = 1; - } - else - { - variant = 2; - } - } - else if (frameX >= 9 && frameY >= 3) - { - if (frameX < 10) - { - variant = 0; - } - else if (frameX < 11) - { - variant = 1; - } - else - { - variant = 2; - } - } - return (variant); - } - */ #endregion } } diff --git a/Tiles/Pylons/CragsPylonBrokenTile.cs b/Tiles/Pylons/CragsPylonBrokenTile.cs new file mode 100644 index 0000000000..71e0ce16e8 --- /dev/null +++ b/Tiles/Pylons/CragsPylonBrokenTile.cs @@ -0,0 +1,35 @@ +using CalamityMod.Items.Placeables.Pylons; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Enums; +using Terraria.GameContent; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.Pylons +{ + public class CragsPylonBrokenTile : ModTile + { + public override string Texture => "CalamityMod/Tiles/Pylons/CragsPylonTile"; + + public override void SetStaticDefaults() + { + Main.tileLavaDeath[Type] = false; + Main.tileFrameImportant[Type] = true; + TileObjectData.newTile.CopyFrom(TileObjectData.Style3x4); + TileObjectData.newTile.StyleHorizontal = true; + TileObjectData.newTile.LavaDeath = false; + TileObjectData.newTile.LavaPlacement = LiquidPlacement.Allowed; + TileObjectData.newTile.DrawYOffset = 2; + TileObjectData.addTile(Type); + + RegisterItemDrop(ModContent.ItemType()); + FlexibleTileWand.RubblePlacementLarge.AddVariations(ModContent.ItemType(), Type, 0); + + AddMapEntry(Color.OrangeRed, CalamityUtils.GetItemName(ModContent.ItemType())); + TileID.Sets.PreventsSandfall[Type] = true; + } + public override bool CreateDust(int i, int j, ref int type) => false; + } +} diff --git a/Tiles/UelibloomBrick.cs b/Tiles/UelibloomBrick.cs index d4f08a90bf..a12b232265 100644 --- a/Tiles/UelibloomBrick.cs +++ b/Tiles/UelibloomBrick.cs @@ -90,9 +90,7 @@ namespace CalamityMod.Tiles #region 'Extra Drapes' Drawing private void DrawExtraTop(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) { - /* - If the tile directly above this tile is not otherworldly stone, or if it is, there is air to both sides of that tile, draw the Extra surface - */ + // If the tile directly above this tile is not otherworldly stone, or if it is, there is air to both sides of that tile, draw the Extra surface if ( CheckTile(Type, false, 0, 1, i, j) || (CheckTile(Type, true, 0, 1, i, j) && CheckTile(Type, false, 1, 1, i, j) && CheckTile(Type, false, -1, 1, i, j) && CheckTile(Type, true, 1, 0, i, j) && CheckTile(Type, true, -1, 0, i, j)) @@ -107,9 +105,7 @@ namespace CalamityMod.Tiles private void DrawExtraWallEnds(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) { - /* - Ending the Extra when a wall is reached - */ + // Ending the Extra when a wall is reached //Left if ( @@ -133,9 +129,7 @@ namespace CalamityMod.Tiles private void DrawExtraOverhang(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) { - /* - Called from DrawExtraTop(). Ending the Extra when the edge of the tile is reached - */ + // Called from DrawExtraTop(). Ending the Extra when the edge of the tile is reached //Left if ( @@ -157,9 +151,7 @@ namespace CalamityMod.Tiles private void DrawExtraDrapes(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) { - /* - Hanging 'drapes' of the extra element - */ + // Hanging 'drapes' of the extra element //Base if ( @@ -238,113 +230,6 @@ namespace CalamityMod.Tiles { return Main.tile[i, j].TileFrameNumber * extraFrameWidth; } - - /* - private int GetTileVariant(int i, int j) - { - int variant = 0; //Default to using variant 1 - Tile sourceTile = Main.tile[i, j]; - //Now to get the particular 'variant group' to use, which is used to take the frameX/frameY of the tile and convert it to the variant the tile is using - int frameX = sourceTile.frameX / 18; - int frameY = sourceTile.frameY / 18; - if (frameY < 3 && !(frameX >= 6 && frameX < 9)) - { - int group = 0; - int[] group1XPos = new int[] { 1, 2, 3 }; - int[] group2XPos = new int[] { 0, 4, 5, 9, 10, 11, 12 }; - foreach (int k in group1XPos) - { - if (frameX < k + 1 && frameX >= k) - { - group = 1; - } - } - foreach (int k in group2XPos) - { - if (frameX < k + 1 && frameX >= k) - { - group = 2; - } - } - if (group == 1) - { - if (frameX < 2) - { - variant = 0; - } - else if (frameX < 3) - { - variant = 1; - } - else - { - variant = 2; - } - } - else if (group == 2) - { - if (frameY < 1) - { - variant = 0; - } - else if (frameY < 2) - { - variant = 1; - } - else - { - variant = 2; - } - } - } - else if (frameX < 6 && frameY >= 3) - { - if (frameX < 2) - { - variant = 0; - } - else if (frameX < 4) - { - variant = 1; - } - else - { - variant = 2; - } - } - else if (frameX >= 6 && frameX < 9) - { - if (frameX < 7) - { - variant = 0; - } - else if (frameX < 8) - { - variant = 1; - } - else - { - variant = 2; - } - } - else if (frameX >= 9 && frameY >= 3) - { - if (frameX < 10) - { - variant = 0; - } - else if (frameX < 11) - { - variant = 1; - } - else - { - variant = 2; - } - } - return (variant); - } - */ #endregion } } diff --git a/Tiles/VernalSoil.cs b/Tiles/VernalSoil.cs index 729d05c74c..4826424766 100644 --- a/Tiles/VernalSoil.cs +++ b/Tiles/VernalSoil.cs @@ -199,9 +199,7 @@ namespace CalamityMod.Tiles #region 'Extra Drapes' Drawing private void DrawExtraTop(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) { - /* - If the tile directly above this tile is not otherworldly stone, or if it is, there is air to both sides of that tile, draw the Extra surface - */ + // If the tile directly above this tile is not otherworldly stone, or if it is, there is air to both sides of that tile, draw the Extra surface if ( CheckTile(Type, false, 0, 1, i, j) || (CheckTile(Type, true, 0, 1, i, j) && CheckTile(Type, false, 1, 1, i, j) && CheckTile(Type, false, -1, 1, i, j) && CheckTile(Type, true, 1, 0, i, j) && CheckTile(Type, true, -1, 0, i, j)) @@ -216,9 +214,7 @@ namespace CalamityMod.Tiles private void DrawExtraWallEnds(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) { - /* - Ending the Extra when a wall is reached - */ + // Ending the Extra when a wall is reached //Left if ( @@ -242,9 +238,7 @@ namespace CalamityMod.Tiles private void DrawExtraOverhang(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) { - /* - Called from DrawExtraTop(). Ending the Extra when the edge of the tile is reached - */ + // Called from DrawExtraTop(). Ending the Extra when the edge of the tile is reached //Left if ( @@ -266,9 +260,7 @@ namespace CalamityMod.Tiles private void DrawExtraDrapes(int i, int j, Texture2D extras, Vector2 drawOffset, Color drawColour) { - /* - Hanging 'drapes' of the extra element - */ + // Hanging 'drapes' of the extra element //Base if ( @@ -347,113 +339,6 @@ namespace CalamityMod.Tiles { return Main.tile[i, j].TileFrameNumber * extraFrameWidth; } - - /* - private int GetTileVariant(int i, int j) - { - int variant = 0; //Default to using variant 1 - Tile sourceTile = Main.tile[i, j]; - //Now to get the particular 'variant group' to use, which is used to take the frameX/frameY of the tile and convert it to the variant the tile is using - int frameX = sourceTile.frameX / 18; - int frameY = sourceTile.frameY / 18; - if (frameY < 3 && !(frameX >= 6 && frameX < 9)) - { - int group = 0; - int[] group1XPos = new int[] { 1, 2, 3 }; - int[] group2XPos = new int[] { 0, 4, 5, 9, 10, 11, 12 }; - foreach (int k in group1XPos) - { - if (frameX < k + 1 && frameX >= k) - { - group = 1; - } - } - foreach (int k in group2XPos) - { - if (frameX < k + 1 && frameX >= k) - { - group = 2; - } - } - if (group == 1) - { - if (frameX < 2) - { - variant = 0; - } - else if (frameX < 3) - { - variant = 1; - } - else - { - variant = 2; - } - } - else if (group == 2) - { - if (frameY < 1) - { - variant = 0; - } - else if (frameY < 2) - { - variant = 1; - } - else - { - variant = 2; - } - } - } - else if (frameX < 6 && frameY >= 3) - { - if (frameX < 2) - { - variant = 0; - } - else if (frameX < 4) - { - variant = 1; - } - else - { - variant = 2; - } - } - else if (frameX >= 6 && frameX < 9) - { - if (frameX < 7) - { - variant = 0; - } - else if (frameX < 8) - { - variant = 1; - } - else - { - variant = 2; - } - } - else if (frameX >= 9 && frameY >= 3) - { - if (frameX < 10) - { - variant = 0; - } - else if (frameX < 11) - { - variant = 1; - } - else - { - variant = 2; - } - } - return (variant); - } - */ #endregion public override void NumDust(int i, int j, bool fail, ref int num) { diff --git a/Walls/UnsafeWalls/UnsafeAstralGrassWall.cs b/Walls/UnsafeWalls/UnsafeAstralGrassWall.cs index a543900c4e..70952ffd8b 100644 --- a/Walls/UnsafeWalls/UnsafeAstralGrassWall.cs +++ b/Walls/UnsafeWalls/UnsafeAstralGrassWall.cs @@ -15,11 +15,6 @@ namespace CalamityMod.Walls.UnsafeWalls public static Asset leafTexture = null; public static Vector2 TileAdj => (Lighting.Mode == Terraria.Graphics.Light.LightMode.Retro || Lighting.Mode == Terraria.Graphics.Light.LightMode.Trippy) ? Vector2.Zero : Vector2.One * 12; - /*public override bool Autoload(ref string name, ref string texture) - { - mod.AddWall("AstralGrassWallUnsafe", this, texture); - return base.Autoload(ref name, ref texture); - }*/ public override void SetStaticDefaults() { diff --git a/World/BrimstoneCrag.cs b/World/BrimstoneCrag.cs index 611b17cbc0..314132b000 100644 --- a/World/BrimstoneCrag.cs +++ b/World/BrimstoneCrag.cs @@ -6,6 +6,7 @@ using CalamityMod.Tiles.Crags.Lily; using CalamityMod.Tiles.Crags.Spike; using CalamityMod.Tiles.Crags.Tree; using CalamityMod.Tiles.Ores; +using CalamityMod.Tiles.Pylons; using CalamityMod.Walls.UnsafeWalls; using Microsoft.Xna.Framework; using Terraria; @@ -266,6 +267,26 @@ namespace CalamityMod.World SchematicManager.PlaceSchematic>(SchematicManager.CragRuinKey2, new Point(biomeEdge - 150 + house4Offset, Main.maxTilesY - 125), SchematicAnchor.BottomCenter, ref place); + //place the broken Crags Pylon + Point pylonPlace = new Point(GenVars.dungeonSide == 1 ? (biomeStart + biomeMiddle) / 2 : (biomeMiddle + biomeEdge) / 2, Main.maxTilesY - 150); + while (!Main.tile[pylonPlace].HasTile && pylonPlace.Y < Main.maxTilesY - 75) + pylonPlace.Y++; + if (!Main.tile[pylonPlace].HasTile) + Main.tile[pylonPlace].TileType = (ushort)ModContent.TileType(); + //make sure there's space to place it + for (int i = pylonPlace.X - 1; i <= pylonPlace.X + 1; i++) + { + for (int j = pylonPlace.Y - 4; j <= pylonPlace.Y; j++) + { + Tile t = Main.tile[i, j]; + if (j == pylonPlace.Y) + t.ResetToType(Main.tile[pylonPlace].TileType); + else + WorldGen.KillTile(i, j); + } + } + WorldGen.PlaceObject(pylonPlace.X, pylonPlace.Y - 1, ModContent.TileType()); + //lava clean up again for (int x = biomeStart; x <= biomeEdge; x++) { diff --git a/World/SunkenSea.cs b/World/SunkenSea.cs index 786fcb8bf9..0bcb66de9c 100644 --- a/World/SunkenSea.cs +++ b/World/SunkenSea.cs @@ -774,66 +774,5 @@ namespace CalamityMod.World return false; } - - /* - public static void PlaceTit(int x, int y, ushort type = 165) - { - if (WorldGen.SolidTile(x, y - 1) && !Main.tile[x, y].HasTile && !Main.tile[x, y + 1].HasTile) - { - if (Main.tile[x, y - 1].TileType == (ushort)ModContent.TileType()) - { - if (WorldGen.genRand.Next(2) == 0 || Main.tile[x, y + 2].HasTile) - { - int num2 = WorldGen.genRand.Next(3) * 18; - Main.tile[x, y].TileType = type; - Main.tile[x, y].Get().HasTile = true; - Main.tile[x, y].TileFrameX = (short)num2; - Main.tile[x, y].TileFrameY = 72; - } - else - { - int num3 = WorldGen.genRand.Next(3) * 18; - Main.tile[x, y].TileType = type; - Main.tile[x, y].Get().HasTile = true; - Main.tile[x, y].TileFrameX = (short)num3; - Main.tile[x, y].TileFrameY = 0; - Main.tile[x, y + 1].TileType = type; - Main.tile[x, y + 1].Get().HasTile = true; - Main.tile[x, y + 1].TileFrameX = (short)num3; - Main.tile[x, y + 1].TileFrameY = 18; - } - } - } - else - { - if (WorldGen.SolidTile(x, y + 1) && !Main.tile[x, y].HasTile && !Main.tile[x, y - 1].HasTile) - { - if (Main.tile[x, y + 1].TileType == (ushort)ModContent.TileType()) - { - if (WorldGen.genRand.Next(2) == 0 || Main.tile[x, y - 2].HasTile) - { - int num13 = WorldGen.genRand.Next(3) * 18; - Main.tile[x, y].TileType = type; - Main.tile[x, y].Get().HasTile = true; - Main.tile[x, y].TileFrameX = (short)num13; - Main.tile[x, y].TileFrameY = 90; - } - else - { - int num14 = WorldGen.genRand.Next(3) * 18; - Main.tile[x, y - 1].TileType = type; - Main.tile[x, y - 1].Get().HasTile = true; - Main.tile[x, y - 1].TileFrameX = (short)num14; - Main.tile[x, y - 1].TileFrameY = 36; - Main.tile[x, y].TileType = type; - Main.tile[x, y].Get().HasTile = true; - Main.tile[x, y].TileFrameX = (short)num14; - Main.tile[x, y].TileFrameY = 54; - } - } - } - } - } - */ } }