diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 4d79a77200..c70096f76f 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -153,6 +153,8 @@ namespace CalamityMod.CalPlayer #region Town NPC Shop Variables public bool newMerchantInventory = false; public bool newPainterInventory = false; + public bool newGolferInventory = false; + public bool newZoologistInventory = false; public bool newDyeTraderInventory = false; public bool newPartyGirlInventory = false; public bool newStylistInventory = false; @@ -169,6 +171,7 @@ namespace CalamityMod.CalPlayer public bool newWizardInventory = false; public bool newSteampunkerInventory = false; public bool newCyborgInventory = false; + public bool newPrincessInventory = false; public bool newSkeletonMerchantInventory = false; public bool newPermafrostInventory = false; public bool newCirrusInventory = false; @@ -333,6 +336,7 @@ namespace CalamityMod.CalPlayer #endregion #region Rage + public bool RageEnabled => CalamityWorld.revenge || shatteredCommunity; public bool rageModeActive = false; public float rage = 0f; public float rageMax = 100f; // 0 to 100% by default @@ -349,6 +353,7 @@ namespace CalamityMod.CalPlayer #endregion #region Adrenaline + public bool AdrenalineEnabled => CalamityWorld.revenge || draedonsHeart; public bool adrenalineModeActive = false; public float adrenaline = 0f; public float adrenalineMax = 100f; // 0 to 100% by default @@ -432,6 +437,7 @@ namespace CalamityMod.CalPlayer public bool laudanum = false; public bool heartOfDarkness = false; public bool draedonsHeart = false; + public int nanomachinesLockoutTimer = 0; public bool vexation = false; public bool dodgeScarf = false; public bool evasionScarf = false; @@ -469,7 +475,6 @@ namespace CalamityMod.CalPlayer public bool fBarrier = false; public bool aBrain = false; public bool amalgam = false; - public bool lol = false; public bool raiderTalisman = false; public int raiderStack = 0; public int raiderCooldown = 0; @@ -489,7 +494,7 @@ namespace CalamityMod.CalPlayer public bool projRefRare = false; public int projRefRareLifeRegenCounter = 0; public bool nanotech = false; - public bool artemisEmblem = false; + public bool deadshotBrooch = false; public bool shadowMinions = false; public bool holyMinions = false; public bool alchFlask = false; @@ -1156,6 +1161,8 @@ namespace CalamityMod.CalPlayer newMerchantInventory = false; newPainterInventory = false; + newGolferInventory = false; + newZoologistInventory = false; newDyeTraderInventory = false; newPartyGirlInventory = false; newStylistInventory = false; @@ -1172,6 +1179,7 @@ namespace CalamityMod.CalPlayer newWizardInventory = false; newSteampunkerInventory = false; newCyborgInventory = false; + newPrincessInventory = false; newSkeletonMerchantInventory = false; newPermafrostInventory = false; newCirrusInventory = false; @@ -1207,6 +1215,8 @@ namespace CalamityMod.CalPlayer boost.AddWithCondition("newMerchantInventory", newMerchantInventory); boost.AddWithCondition("newPainterInventory", newPainterInventory); + boost.AddWithCondition("newGolferInventory", newGolferInventory); + boost.AddWithCondition("newZoologistInventory", newZoologistInventory); boost.AddWithCondition("newDyeTraderInventory", newDyeTraderInventory); boost.AddWithCondition("newPartyGirlInventory", newPartyGirlInventory); boost.AddWithCondition("newStylistInventory", newStylistInventory); @@ -1223,6 +1233,7 @@ namespace CalamityMod.CalPlayer boost.AddWithCondition("newWizardInventory", newWizardInventory); boost.AddWithCondition("newSteampunkerInventory", newSteampunkerInventory); boost.AddWithCondition("newCyborgInventory", newCyborgInventory); + boost.AddWithCondition("newPrincessInventory", newPrincessInventory); boost.AddWithCondition("newSkeletonMerchantInventory", newSkeletonMerchantInventory); boost.AddWithCondition("newPermafrostInventory", newPermafrostInventory); boost.AddWithCondition("newCirrusInventory", newCirrusInventory); @@ -1310,6 +1321,8 @@ namespace CalamityMod.CalPlayer newMerchantInventory = boost.Contains("newMerchantInventory"); newPainterInventory = boost.Contains("newPainterInventory"); + newGolferInventory = boost.Contains("newGolferInventory"); + newZoologistInventory = boost.Contains("newZoologistInventory"); newDyeTraderInventory = boost.Contains("newDyeTraderInventory"); newPartyGirlInventory = boost.Contains("newPartyGirlInventory"); newStylistInventory = boost.Contains("newStylistInventory"); @@ -1326,6 +1339,7 @@ namespace CalamityMod.CalPlayer newWizardInventory = boost.Contains("newWizardInventory"); newSteampunkerInventory = boost.Contains("newSteampunkerInventory"); newCyborgInventory = boost.Contains("newCyborgInventory"); + newPrincessInventory = boost.Contains("newPrincessInventory"); newSkeletonMerchantInventory = boost.Contains("newSkeletonMerchantInventory"); newPermafrostInventory = boost.Contains("newPermafrostInventory"); newCirrusInventory = boost.Contains("newCirrusInventory"); @@ -1471,6 +1485,9 @@ namespace CalamityMod.CalPlayer ResetRogueStealth(); + // Reset adrenaline duration to default. If Draedon's Heart is equipped, it'll change itself every frame. + AdrenalineDuration = CalamityUtils.SecondsToFrames(5); + contactDamageReduction = 0D; projectileDamageReduction = 0D; rogueVelocity = 1f; @@ -1627,7 +1644,7 @@ namespace CalamityMod.CalPlayer uberBees = false; projRefRare = false; nanotech = false; - artemisEmblem = false; + deadshotBrooch = false; cryogenSoul = false; yInsignia = false; eGauntlet = false; @@ -1670,7 +1687,6 @@ namespace CalamityMod.CalPlayer manaOverloader = false; royalGel = false; handWarmer = false; - lol = false; raiderTalisman = false; gSabaton = false; sGlyph = false; @@ -2312,6 +2328,7 @@ namespace CalamityMod.CalPlayer triumph = false; penumbra = false; shadow = false; + nanomachinesLockoutTimer = 0; photosynthesis = false; astralInjection = false; gravityNormalizer = false; @@ -2978,31 +2995,28 @@ namespace CalamityMod.CalPlayer Player.AddBuff(ModContent.BuffType(), 2); // Play Rage Activation sound - SoundEngine.PlaySound( RageActivationSound, Player.position); + SoundEngine.PlaySound(RageActivationSound, Player.position); - // TODO -- improve Rage activation visuals - for (int num502 = 0; num502 < 64; num502++) + // TODO -- Rage should provide glowy red afterimages to the player for the duration. + // If Shattered Community is equipped, the afterimages are magenta instead. + int rageDustID = 235; + int dustCount = 132; + float minSpeed = 4f; + float maxSpeed = 11f; + for (int i = 0; i < dustCount; ++i) { - int dust = Dust.NewDust(new Vector2(Player.position.X, Player.position.Y + 16f), Player.width, Player.height - 16, (int)CalamityDusts.Brimstone, 0f, 0f, 0, default, 1f); - Main.dust[dust].velocity *= 3f; - Main.dust[dust].scale *= 1.15f; - } - int num226 = 36; - for (int num227 = 0; num227 < num226; num227++) - { - Vector2 vector6 = Vector2.Normalize(Player.velocity) * new Vector2((float)Player.width / 2f, (float)Player.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + Player.Center; - Vector2 vector7 = vector6 - Player.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, (int)CalamityDusts.Brimstone, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default, 1.4f); - Main.dust[num228].noGravity = true; - Main.dust[num228].noLight = true; - Main.dust[num228].velocity = vector7; + float speed = (float)Math.Sqrt(Main.rand.NextFloat(minSpeed * minSpeed, maxSpeed * maxSpeed)); + Vector2 dustVel = Main.rand.NextVector2Unit() * speed; + Dust d = Dust.NewDustPerfect(Player.Center, rageDustID, dustVel); + d.noGravity = !Main.rand.NextBool(4); // 25% of dust has gravity + d.noLight = false; + d.scale = Main.rand.NextFloat(0.9f, 2.1f); } } } // Trigger for pressing the Adrenaline hotkey. - if (CalamityKeybinds.AdrenalineHotKey.JustPressed && CalamityWorld.revenge) + if (CalamityKeybinds.AdrenalineHotKey.JustPressed && AdrenalineEnabled) { if (adrenaline == adrenalineMax && !adrenalineModeActive) { @@ -3011,23 +3025,53 @@ namespace CalamityMod.CalPlayer // Play Adrenaline Activation sound SoundEngine.PlaySound(AdrenalineActivationSound, Player.position); - // TODO -- improve Adrenaline activation visuals - for (int num502 = 0; num502 < 64; num502++) + // TODO -- Adrenaline should provide bright green vibrating afterimages on the player for the duration. + int dustPerSegment = 96; + + // Parametric segment 1: y = 3x + 120 + Vector2 segmentOneStart = new Vector2(0f, -120f); + Vector2 segmentOneEnd = new Vector2(-48f, 24f); + Vector2 segmentOneIncrement = (segmentOneEnd - segmentOneStart) / dustPerSegment; + + // Parametric segment 2: y = 0.5x + Vector2 segmentTwoStart = segmentOneEnd; + Vector2 segmentTwoEnd = new Vector2(48f, -24f); + Vector2 segmentTwoIncrement = (segmentTwoEnd - segmentTwoStart) / dustPerSegment; + + // Parametric segment 3: y = 3x - 120 + Vector2 segmentThreeStart = segmentTwoEnd; + Vector2 segmentThreeEnd = new Vector2(0f, 120f); + Vector2 segmentThreeIncrement = (segmentThreeEnd - segmentThreeStart) / dustPerSegment; + + float maxDustVelSpread = 1.2f; + for (int i = 0; i < dustPerSegment; ++i) { - int dust = Dust.NewDust(new Vector2(Player.position.X, Player.position.Y + 16f), Player.width, Player.height - 16, 206, 0f, 0f, 0, default, 1f); - Main.dust[dust].velocity *= 3f; - Main.dust[dust].scale *= 2f; - } - int num226 = 36; - for (int num227 = 0; num227 < num226; num227++) - { - Vector2 vector6 = Vector2.Normalize(Player.velocity) * new Vector2((float)Player.width / 2f, (float)Player.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + Player.Center; - Vector2 vector7 = vector6 - Player.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 206, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default, 1.4f); - Main.dust[num228].noGravity = true; - Main.dust[num228].noLight = true; - Main.dust[num228].velocity = vector7; + bool electricity = Main.rand.NextBool(4); + int dustID = electricity ? 132 : DustID.TerraBlade; + + float interpolant = i + 0.5f; + float spreadSpeed = Main.rand.NextFloat(0.5f, maxDustVelSpread); + if (electricity) + spreadSpeed *= 4f; + + Vector2 segmentOnePos = Player.Center + segmentOneStart + segmentOneIncrement * interpolant; + Dust d = Dust.NewDustPerfect(segmentOnePos, dustID, Vector2.Zero); + if (electricity) + d.noGravity = false; + d.scale = Main.rand.NextFloat(0.8f, 1.4f); + d.velocity = Main.rand.NextVector2Unit() * spreadSpeed; + + Vector2 segmentTwoPos = Player.Center + segmentTwoStart + segmentTwoIncrement * interpolant; + d = Dust.CloneDust(d); + d.position = segmentTwoPos; + d.scale = Main.rand.NextFloat(0.8f, 1.4f); + d.velocity = Main.rand.NextVector2Unit() * spreadSpeed; + + Vector2 segmentThreePos = Player.Center + segmentThreeStart + segmentThreeIncrement * interpolant; + d = Dust.CloneDust(d); + d.position = segmentThreePos; + d.scale = Main.rand.NextFloat(0.8f, 1.4f); + d.velocity = Main.rand.NextVector2Unit() * spreadSpeed; } } } @@ -4503,8 +4547,8 @@ namespace CalamityMod.CalPlayer if (witheredDebuff && witheringWeaponEnchant) damageMult += 0.6; - if (CalamityWorld.revenge) - CalamityUtils.ApplyRippersToDamage(this, isTrueMelee, ref damageMult); + // Rippers are always checked for application, because there are ways to get rippers outside of Rev now + CalamityUtils.ApplyRippersToDamage(this, isTrueMelee, ref damageMult); damage = (int)(damage * damageMult); #endregion @@ -4538,12 +4582,6 @@ namespace CalamityMod.CalPlayer } #endregion - if (draedonsHeart) - { - if (Player.StandingStill() && Player.itemAnimation == 0) - damage = (int)(damage * 0.5); - } - if ((target.damage > 0 || target.boss) && !target.SpawnedFromStatue && Player.whoAmI == Main.myPlayer) { if (CalamityConfig.Instance.Proficiency) @@ -4614,8 +4652,8 @@ namespace CalamityMod.CalPlayer if (witheredDebuff) damageMult += 0.6; - if (CalamityWorld.revenge) - CalamityUtils.ApplyRippersToDamage(this, isTrueMelee, ref damageMult); + // Rippers are always checked for application, because there are ways to get rippers outside of Rev now + CalamityUtils.ApplyRippersToDamage(this, isTrueMelee, ref damageMult); if (filthyGlove && proj.Calamity().stealthStrike && proj.CountsAsClass()) { @@ -4724,12 +4762,6 @@ namespace CalamityMod.CalPlayer if (proj.type == ProjectileID.SpectreWrath && Player.ghostHurt) damage = (int)(damage * 0.7); - if (draedonsHeart) - { - if (Player.StandingStill() && Player.itemAnimation == 0) - damage = (int)(damage * 0.5); - } - #endregion // Handle on-hit ranged effects for the gem tech armor set. @@ -4939,8 +4971,8 @@ namespace CalamityMod.CalPlayer hasIFrames = true; // If this NPC deals defense damage with contact damage, then apply defense damage. - // Defense damage is not applied if the player has iframes, is otherwise invincible, or has Lul equipped. - if (npc.Calamity().canBreakPlayerDefense && !hasIFrames && !invincible && !lol) + // Defense damage is not applied if the player has iframes or is otherwise invincible. + if (npc.Calamity().canBreakPlayerDefense && !hasIFrames && !invincible) DealDefenseDamage(damage); if (areThereAnyDamnBosses && CalamityMod.bossVelocityDamageScaleValues.ContainsKey(npc.type)) @@ -5037,9 +5069,13 @@ namespace CalamityMod.CalPlayer theBeeCooldown = 600; } - if (CalamityWorld.revenge) + // Full Adrenaline DR does not apply when using Draedon's Heart + // Instead, nanomachine accumulation is stopped for a while + if (AdrenalineEnabled) { - if (adrenaline == adrenalineMax && !adrenalineModeActive) + if (draedonsHeart) + nanomachinesLockoutTimer = DraedonsHeart.NanomachinePauseAfterDamage; + else if (adrenaline == adrenalineMax && !adrenalineModeActive) { double adrenalineDRBoost = 0D + (adrenalineBoostOne ? 0.05 : 0D) + @@ -5225,8 +5261,8 @@ namespace CalamityMod.CalPlayer hasIFrames = true; // If this projectile is capable of dealing defense damage, then apply defense damage. - // Defense damage is not applied if the player has iframes, is otherwise invincible, or has Lul equipped. - if (proj.Calamity().canBreakPlayerDefense && !hasIFrames && !invincible && !lol) + // Defense damage is not applied if the player has iframes or is otherwise invincible. + if (proj.Calamity().canBreakPlayerDefense && !hasIFrames && !invincible) DealDefenseDamage(damage); if (projRefRare) @@ -5281,7 +5317,8 @@ namespace CalamityMod.CalPlayer theBeeCooldown = 600; } - if (CalamityWorld.revenge) + // Full Adrenaline DR does not apply when using Draedon's Heart + if (AdrenalineEnabled && !draedonsHeart) { if (adrenaline == adrenalineMax && !adrenalineModeActive) { @@ -5774,7 +5811,7 @@ namespace CalamityMod.CalPlayer Player.eocDash = 0; } - if (lol || (silvaCountdown > 0 && hasSilvaEffect && silvaSet) || (DashID == GodslayerArmorDash.ID && Player.dashDelay < 0)) + if ((silvaCountdown > 0 && hasSilvaEffect && silvaSet) || (DashID == GodslayerArmorDash.ID && Player.dashDelay < 0)) { if (Player.lifeRegen < 0) Player.lifeRegen = 0; @@ -5872,10 +5909,6 @@ namespace CalamityMod.CalPlayer if (HandleDodges()) return false; - // Lul makes the player completely invincible. - if (lol) - return false; - // Unless holding Coldheart Icicle, the Purified Jam makes you completely invincible. if (invincible && Player.ActiveItem().type != ModContent.ItemType()) return false; @@ -5960,7 +5993,7 @@ namespace CalamityMod.CalPlayer // Shattered Community makes the player gain rage based on the amount of damage taken. // Also set the Rage gain cooldown to prevent bizarre abuse cases. - if (CalamityWorld.revenge && shatteredCommunity && rageGainCooldown == 0) + if (shatteredCommunity && rageGainCooldown == 0) { float HPRatio = (float)damage / Player.statLifeMax2; float rageConversionRatio = 0.8f; @@ -5991,7 +6024,7 @@ namespace CalamityMod.CalPlayer modStealth = 1f; // Give Rage combat frames because being hurt counts as combat. - if (CalamityWorld.revenge) + if (RageEnabled) rageCombatFrames = RageCombatDelayTime; if (Player.whoAmI == Main.myPlayer) @@ -6043,7 +6076,8 @@ namespace CalamityMod.CalPlayer witheringDamageDone = 0; } - if (CalamityWorld.revenge) + // Lose adrenaline on hit, unless using Draedon's Heart. + if (AdrenalineEnabled && !draedonsHeart) { if (!adrenalineModeActive && damage > 0) // To prevent paladin's shield ruining adren even with 0 dmg taken { @@ -8147,7 +8181,20 @@ namespace CalamityMod.CalPlayer defenseDamageTaken = cap; // Apply defense damage to the adamantite armor set boost. - AdamantiteSetDefenseBoost -= defenseDamageTaken; + if (AdamantiteSetDefenseBoost > 0) + { + int defenseDamageToAdamantite = Math.Min(AdamantiteSetDefenseBoost, defenseDamageTaken); + AdamantiteSetDefenseBoost -= defenseDamageToAdamantite; + defenseDamageTaken -= defenseDamageToAdamantite; + + // If Adamantite Armor's set bonus entirely absorbed the defense damage, then display the number and play the sound, + // but don't actually reduce defense or trigger the defense damage recovery cooldown. + if (defenseDamageTaken <= 0) + { + ShowDefenseDamageEffects(defenseDamageToAdamantite); + return; + } + } // Apply that defense damage on top of whatever defense damage the player currently has. int previousDefenseDamage = CurrentDefenseDamage; @@ -8168,6 +8215,12 @@ namespace CalamityMod.CalPlayer // Reset the delay between iframes and being able to recover from defense damage. defenseDamageDelayFrames = DefenseDamageRecoveryDelay; + // Audiovisual effects + ShowDefenseDamageEffects(defenseDamageTaken); + } + + private void ShowDefenseDamageEffects(int defDamage) + { // Play a sound from taking defense damage. if (hurtSoundTimer == 0) { @@ -8176,7 +8229,7 @@ namespace CalamityMod.CalPlayer } // Display text indicating that defense damage was taken. - string text = (-defenseDamageTaken).ToString(); + string text = (-defDamage).ToString(); Color messageColor = Color.LightGray; Rectangle location = new Rectangle((int)Player.position.X, (int)Player.position.Y - 16, Player.width, Player.height); CombatText.NewText(location, messageColor, Language.GetTextValue(text)); diff --git a/CalPlayer/CalamityPlayerDrawEffects.cs b/CalPlayer/CalamityPlayerDrawEffects.cs index 8a195b38e8..7d1caf1c15 100644 --- a/CalPlayer/CalamityPlayerDrawEffects.cs +++ b/CalPlayer/CalamityPlayerDrawEffects.cs @@ -51,6 +51,15 @@ namespace CalamityMod.CalPlayer { PlayerDrawLayers.Shoes.Hide(); } + + if (drawInfo.drawPlayer.Calamity().andromedaState != AndromedaPlayerState.Inactive) + { + foreach (var layer in PlayerDrawLayerLoader.Layers) + { + if (layer != PlayerDrawLayers.BackAcc) + layer.Hide(); + } + } } public override void DrawEffects(PlayerDrawSet drawInfo, ref float r, ref float g, ref float b, ref float a, ref bool fullBright) @@ -485,7 +494,7 @@ namespace CalamityMod.CalPlayer } } } - if (calamityPlayer.bFlames || calamityPlayer.aFlames || calamityPlayer.rageModeActive) + if (calamityPlayer.bFlames || calamityPlayer.aFlames) { if (Main.rand.NextBool(4) && drawInfo.shadow == 0f) { @@ -541,23 +550,48 @@ namespace CalamityMod.CalPlayer fullBright = true; } } - if (calamityPlayer.adrenalineModeActive) + + // Dust while Rage Mode is active + if (calamityPlayer.rageModeActive) { - if (Main.rand.NextBool(4) && drawInfo.shadow == 0f) + if (drawInfo.shadow == 0f) { - int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, 206, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 3f); - Main.dust[dust].velocity *= 1.8f; - Main.dust[dust].velocity.Y -= 0.5f; - drawInfo.DustCache.Add(dust); - } - if (noRogueStealth) - { - r *= 0.01f; - g *= 0.15f; - b *= 0.1f; - fullBright = true; + int dustCount = Main.rand.NextBool() ? 2 : 3; + for (int i = 0; i < dustCount; ++i) + { + int dustID = ModContent.DustType(); + if (shatteredCommunity && Main.rand.NextBool(3)) + dustID = DustID.DemonTorch; + + Vector2 dustVel = Player.velocity * 0.5f; + int idx = Dust.NewDust(drawInfo.Position, Player.width, Player.height, dustID, dustVel.X, dustVel.Y); + Dust d = Main.dust[idx]; + d.fadeIn = 0.4f; + d.scale = Main.rand.NextFloat(0.8f, 1.5f); + d.noGravity = true; + d.noLight = false; + drawInfo.DustCache.Add(idx); + } } } + + // Dust while Adrenaline Mode is active + if (calamityPlayer.adrenalineModeActive) + { + if (drawInfo.shadow == 0f) + { + int dustID = 132; + Vector2 dustVel = Player.velocity * 0.5f; + int idx = Dust.NewDust(drawInfo.Position, Player.width, Player.height, dustID, dustVel.X, dustVel.Y); + Dust d = Main.dust[idx]; + d.fadeIn = 1.1f; + d.scale = Main.rand.NextFloat(0.8f, 1.5f); + d.noGravity = Main.rand.NextBool(4); + d.noLight = false; + drawInfo.DustCache.Add(idx); + } + } + if (calamityPlayer.gsInferno) { if (Main.rand.NextBool(4) && drawInfo.shadow == 0f) @@ -697,16 +731,6 @@ namespace CalamityMod.CalPlayer fullBright = true; } } - if (calamityPlayer.draedonsHeart && !calamityPlayer.shadeRegen && !calamityPlayer.cFreeze && Player.StandingStill() && Player.itemAnimation == 0) - { - if (noRogueStealth) - { - r *= 0f; - g *= 0.5f; - b *= 0f; - fullBright = true; - } - } if (calamityPlayer.bBlood) { if (Main.rand.NextBool(6) && drawInfo.shadow == 0f) @@ -844,7 +868,7 @@ namespace CalamityMod.CalPlayer List tankItems = new List() { ModContent.ItemType(), - ModContent.ItemType(), + ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 020b0c2646..c128ed481b 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -601,7 +601,7 @@ namespace CalamityMod.CalPlayer Player.mount.Dismount(Player); } - if (lol || (silvaCountdown > 0 && hasSilvaEffect && silvaSet) || (DashID == GodSlayerDash.ID && Player.dashDelay < 0)) + if ((silvaCountdown > 0 && hasSilvaEffect && silvaSet) || (DashID == GodSlayerDash.ID && Player.dashDelay < 0)) { if (Player.lifeRegen < 0) Player.lifeRegen = 0; @@ -871,24 +871,6 @@ namespace CalamityMod.CalPlayer } } } - else if (draedonsHeart) - { - boostedRegen = true; - if (Player.lifeRegen > 0 && Player.statLife < actualMaxLife) - { - if (Main.rand.Next(30000) < Player.lifeRegenTime || Main.rand.NextBool(2)) - { - int regen = Dust.NewDust(Player.position, Player.width, Player.height, 107, 0f, 0f, 200, default, 1f); - Main.dust[regen].noGravity = true; - Main.dust[regen].fadeIn = 1.3f; - Vector2 velocity = CalamityUtils.RandomVelocity(100f, 50f, 100f, 0.04f); - Main.dust[regen].velocity = velocity; - velocity.Normalize(); - velocity *= 34f; - Main.dust[regen].position = Player.Center - velocity; - } - } - } else if (photosynthesis) { boostedRegen = true; @@ -962,8 +944,8 @@ namespace CalamityMod.CalPlayer if (Player.statLife < actualMaxLife) { // The soft cap doesn't apply if the player is not moving and not using a weapon while having any of the following: - // Shiny Stone, Draedon's Heart, Cosmic Freeze buff from the Cosmic Discharge, Demonshade Armor, Photosynthesis Potion buff or The Camper. - bool noLifeRegenCap = (Player.shinyStone || draedonsHeart || cFreeze || shadeRegen || photosynthesis || camper) && + // Shiny Stone, Cosmic Freeze buff from the Cosmic Discharge, Demonshade Armor, Photosynthesis Potion buff or The Camper. + bool noLifeRegenCap = (Player.shinyStone || cFreeze || shadeRegen || photosynthesis || camper) && Player.StandingStill() && Player.itemAnimation == 0; if (!noLifeRegenCap) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 6d898078cb..9ba4e9fed6 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -1,4 +1,7 @@ -using CalamityMod.Balancing; +using System; +using System.Collections.Generic; +using System.Linq; +using CalamityMod.Balancing; using CalamityMod.Buffs.Alcohol; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.Potions; @@ -9,6 +12,7 @@ using CalamityMod.Cooldowns; using CalamityMod.CustomRecipes; using CalamityMod.DataStructures; using CalamityMod.Dusts; +using CalamityMod.EntitySources; using CalamityMod.Events; using CalamityMod.Items; using CalamityMod.Items.Accessories; @@ -42,22 +46,17 @@ using CalamityMod.UI; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; -using System.Collections.Generic; -using System.Linq; +using ReLogic.Content; using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.GameContent; using Terraria.GameContent.Events; using Terraria.GameInput; using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; using ProvidenceBoss = CalamityMod.NPCs.Providence.Providence; -using Terraria.Audio; -using Terraria.DataStructures; -using CalamityMod.EntitySources; -using ReLogic.Content; -using Terraria.GameContent; -using CalamityMod.Systems; namespace CalamityMod.CalPlayer { @@ -172,8 +171,8 @@ namespace CalamityMod.CalPlayer { // player.rangedCrit already contains the crit stat of the held item, no need to grab it separately. // Don't store the base 4% because you're not removing it. - spiritOriginConvertedCrit = (int)(Player.GetCritChance() - 4); - Player.GetCritChance() = 4; + spiritOriginConvertedCrit = (int)(Player.GetTotalCritChance() - 4); + Player.GetCritChance() = -spiritOriginConvertedCrit; } if (Player.ActiveItem().type == ModContent.ItemType()) @@ -191,7 +190,7 @@ namespace CalamityMod.CalPlayer #region Revengeance Effects private void RevengeanceModeMiscEffects() { - if (CalamityWorld.revenge || BossRushEvent.BossRushActive) + if (CalamityWorld.revenge) { // Adjusts the life steal cap in rev/death float lifeStealCap = (CalamityWorld.malice || BossRushEvent.BossRushActive) ? 30f : CalamityWorld.death ? 45f : 60f; @@ -221,23 +220,16 @@ namespace CalamityMod.CalPlayer if (Player.hurtCooldowns[k] > immuneTimeLimit) Player.hurtCooldowns[k] = immuneTimeLimit; } - - // Adrenaline and Rage - if (CalamityWorld.revenge) - UpdateRippers(); } } - // If Revengeance Mode is not active, then set rippers to zero - else if (Player.whoAmI == Main.myPlayer) - { - rage = 0; - adrenaline = 0; - } + // Adrenaline and Rage + UpdateRippers(); } private void UpdateRippers() { + #region Rage // Figure out Rage's current duration based on boosts. if (rageBoostOne) RageDuration += RageDurationPerBooster; @@ -364,31 +356,37 @@ namespace CalamityMod.CalPlayer rageDiff -= rageMax / RageFadeTime; // Apply the rage change and cap rage in both directions. - rage += rageDiff; - if (rage < 0) - rage = 0; - - if (rage >= rageMax) + // Changes are only applied if the Rage mechanic is available. + if (RageEnabled) { - // If Rage is not active, it is capped at 100%. - if (!rageModeActive) - rage = rageMax; + rage += rageDiff; + if (rage < 0) + rage = 0; - // If using the Shattered Community, Rage is capped at 200% while it's active. - // This prevents infinitely stacking rage before a fight by standing on spikes/lava with a regen build or the Nurse handy. - else if (shatteredCommunity && rage >= 2f * rageMax) - rage = 2f * rageMax; - - // Play a sound when the Rage Meter is full - if (playFullRageSound) + if (rage >= rageMax) { - playFullRageSound = false; - SoundEngine.PlaySound(RageFilledSound, Player.position); - } - } - else - playFullRageSound = true; + // If Rage is not active, it is capped at 100%. + if (!rageModeActive) + rage = rageMax; + // If using the Shattered Community, Rage is capped at 200% while it's active. + // This prevents infinitely stacking rage before a fight by standing on spikes/lava with a regen build or the Nurse handy. + else if (shatteredCommunity && rage >= 2f * rageMax) + rage = 2f * rageMax; + + // Play a sound when the Rage Meter is full + if (playFullRageSound) + { + playFullRageSound = false; + SoundEngine.PlaySound(RageFilledSound, Player.position); + } + } + else + playFullRageSound = true; + } + #endregion + + #region Adrenaline // This is how much Adrenaline will be changed by this frame. float adrenalineDiff = 0; bool SCalAlive = NPC.AnyNPCs(ModContent.NPCType()); @@ -396,7 +394,30 @@ namespace CalamityMod.CalPlayer // If Adrenaline Mode is currently active, you smoothly lose all adrenaline over the duration. if (adrenalineModeActive) + { adrenalineDiff = -adrenalineMax / AdrenalineDuration; + + // If using Draedon's Heart, you get healing instead of damage. + if (draedonsHeart) + { + Player.statLife += DraedonsHeart.NanomachinesHeal / DraedonsHeart.NanomachinesDuration; + if (Player.statLife >= Player.statLifeMax2) + Player.statLife = Player.statLifeMax2; + + // Old Draedon's Heart dust effect from its standing still regen. Works just fine. + int dustID = DustID.TerraBlade; + { + int regen = Dust.NewDust(Player.position, Player.width, Player.height, dustID, 0f, 0f, 200, default, 1f); + Main.dust[regen].noGravity = true; + Main.dust[regen].fadeIn = 1.3f; + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 50f, 100f, 0.04f); + Main.dust[regen].velocity = velocity; + velocity.Normalize(); + velocity *= 34f; + Main.dust[regen].position = Player.Center - velocity; + } + } + } else { // If any boss is alive (or you are between DoG phases or Boss Rush is active), you gain adrenaline smoothly. @@ -414,28 +435,35 @@ namespace CalamityMod.CalPlayer adrenalineDiff *= 0.67f; // Apply the adrenaline change and cap adrenaline in both directions. - adrenaline += adrenalineDiff; - if (adrenaline < 0) - adrenaline = 0; - - if (adrenaline >= adrenalineMax) + // Changes are only applied if the Adrenaline mechanic is available. + if (AdrenalineEnabled && nanomachinesLockoutTimer == 0) { - adrenaline = adrenalineMax; + adrenaline += adrenalineDiff; + if (adrenaline < 0) + adrenaline = 0; - // Play a sound when the Adrenaline Meter is full - if (playFullAdrenalineSound) + if (adrenaline >= adrenalineMax) { - playFullAdrenalineSound = false; - SoundEngine.PlaySound(AdrenalineFilledSound, Player.position); + adrenaline = adrenalineMax; + + // Play a sound when the Adrenaline Meter is full + if (playFullAdrenalineSound) + { + playFullAdrenalineSound = false; + SoundEngine.PlaySound(AdrenalineFilledSound, Player.position); + } } + else + playFullAdrenalineSound = true; } - else - playFullAdrenalineSound = true; + + if (nanomachinesLockoutTimer > 0) + nanomachinesLockoutTimer--; + #endregion } #endregion #region Misc Effects - private void HandleBlazingMouseEffects() { // The sigil's brightness slowly fades away every frame if not incinerating anything. @@ -1477,8 +1505,8 @@ namespace CalamityMod.CalPlayer } } - // Remove Purified Jam and Lul accessory thorn damage exploits - if (invincible || lol) + // Remove Purified Jam thorn damage exploits + if (invincible) { Player.thorns = 0f; Player.turtleThorns = false; @@ -3682,13 +3710,6 @@ namespace CalamityMod.CalPlayer } } - // Draedon's Heart bonus - if (draedonsHeart) - { - if (Player.StandingStill() && Player.itemAnimation == 0) - Player.statDefense += (int)(Player.statDefense * 0.75); - } - // Endurance reductions EnduranceReductions(); diff --git a/CalPlayer/Dashes/StatisBeltOfCursesDash.cs b/CalPlayer/Dashes/StatisVoidSashDash.cs similarity index 96% rename from CalPlayer/Dashes/StatisBeltOfCursesDash.cs rename to CalPlayer/Dashes/StatisVoidSashDash.cs index 8bc2bcb4c0..4b8b437867 100644 --- a/CalPlayer/Dashes/StatisBeltOfCursesDash.cs +++ b/CalPlayer/Dashes/StatisVoidSashDash.cs @@ -7,9 +7,9 @@ using Terraria.ModLoader; namespace CalamityMod.CalPlayer.Dashes { - public class StatisBeltOfCursesDash : PlayerDashEffect + public class StatisVoidSashDash : PlayerDashEffect { - public static new string ID => "Statis' Belt of Curses"; + public static new string ID => "Statis' Void Sash"; public override DashCollisionType CollisionType => DashCollisionType.NoCollision; diff --git a/CalPlayer/DrawLayers/AndromedaMechLayer.cs b/CalPlayer/DrawLayers/AndromedaMechLayer.cs index dd3d4e3f68..0a11aaed4b 100644 --- a/CalPlayer/DrawLayers/AndromedaMechLayer.cs +++ b/CalPlayer/DrawLayers/AndromedaMechLayer.cs @@ -1,6 +1,4 @@ -using System.Linq; -using CalamityMod.Items.Dyes; -using CalamityMod.Projectiles.Summon; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -11,7 +9,7 @@ namespace CalamityMod.CalPlayer.DrawLayers { public class AndromedaMechLayer : PlayerDrawLayer { - public override Position GetDefaultPosition() => new AfterParent(PlayerDrawLayers.Skin); + public override Position GetDefaultPosition() => new AfterParent(PlayerDrawLayers.BackAcc); public override bool GetDefaultVisibility(PlayerDrawSet drawInfo) { diff --git a/Effects/Dyes/AerialiteDyeShader.fx b/Effects/Dyes/AerialiteDyeShader.fx index fbe1872edd..22b2b4ee27 100644 --- a/Effects/Dyes/AerialiteDyeShader.fx +++ b/Effects/Dyes/AerialiteDyeShader.fx @@ -29,7 +29,7 @@ float2 InverseLerp(float2 start, float2 end, float2 x) return saturate((x - start) / (end - start)); } -float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0 +float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0 { float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw; @@ -52,7 +52,7 @@ float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOO float4 metalColor = lerp(color, float4(BlendColor(color.rgb * 0.6, uColor), 1), 0.7); // And mix it all together. - return (color * 0.35 + metalColor * 0.65 + updraftColor * 0.8 + cloudColor * 0.3) * color.a * 0.85; + return (color * 0.35 + metalColor * 0.65 + updraftColor * 0.8 + cloudColor * 0.3) * color.a * sampleColor * 0.85; } technique Technique1 { diff --git a/Effects/Dyes/AerialiteDyeShader.xnb b/Effects/Dyes/AerialiteDyeShader.xnb index 38221656d5..079c6f5f7b 100644 Binary files a/Effects/Dyes/AerialiteDyeShader.xnb and b/Effects/Dyes/AerialiteDyeShader.xnb differ diff --git a/Effects/Dyes/AstralBlueDyeShader.fx b/Effects/Dyes/AstralBlueDyeShader.fx index ec1ff1b145..d1b7a0f077 100644 --- a/Effects/Dyes/AstralBlueDyeShader.fx +++ b/Effects/Dyes/AstralBlueDyeShader.fx @@ -21,13 +21,13 @@ float2 InverseLerp(float2 start, float2 end, float2 x) return saturate((x - start) / (end - start)); } -float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0 +float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0 { float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw; float4 color = tex2D(uImage0, coords); float interval = cos(uTime * 7 + framedCoords.x * 4) / 2 + 0.5; float4 returnColor = float4(lerp(uColor, uSecondaryColor, interval), 1); // Fade between two colors depending on the time and x position on the texture in a 0-1 cosine linear interpolation. The color can vary. - return returnColor * color; // And multiply by the original color to give it a blend effect. + return returnColor * sampleColor * color; // And multiply by the original color to give it a blend effect. } technique Technique1 { diff --git a/Effects/Dyes/AstralBlueDyeShader.xnb b/Effects/Dyes/AstralBlueDyeShader.xnb index f78dd3b877..785e1e3220 100644 Binary files a/Effects/Dyes/AstralBlueDyeShader.xnb and b/Effects/Dyes/AstralBlueDyeShader.xnb differ diff --git a/Effects/Dyes/AstralDyeShader.fx b/Effects/Dyes/AstralDyeShader.fx index d894a8dd54..d3539b40f6 100644 --- a/Effects/Dyes/AstralDyeShader.fx +++ b/Effects/Dyes/AstralDyeShader.fx @@ -21,7 +21,7 @@ float2 InverseLerp(float2 start, float2 end, float2 x) return saturate((x - start) / (end - start)); } -float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0 +float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0 { float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw; @@ -42,7 +42,7 @@ float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOO // Become notably darker to reinforce the stone aesthetic. stoneColor.rgb *= 0.2 + noiseColor.r * 0.65; - return (stoneColor + flameColor * 0.4) * color.a; + return (stoneColor + flameColor * 0.4) * sampleColor * color.a; } technique Technique1 { diff --git a/Effects/Dyes/AstralDyeShader.xnb b/Effects/Dyes/AstralDyeShader.xnb index 49f8351acc..0f7330cf1b 100644 Binary files a/Effects/Dyes/AstralDyeShader.xnb and b/Effects/Dyes/AstralDyeShader.xnb differ diff --git a/Effects/Dyes/AstralOrangeDyeShader.fx b/Effects/Dyes/AstralOrangeDyeShader.fx index f7e61dc67e..22edad0fae 100644 --- a/Effects/Dyes/AstralOrangeDyeShader.fx +++ b/Effects/Dyes/AstralOrangeDyeShader.fx @@ -21,14 +21,14 @@ float2 InverseLerp(float2 start, float2 end, float2 x) return saturate((x - start) / (end - start)); } -float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0 +float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0 { float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw; float4 color = tex2D(uImage0, coords); - float interval = (cos((uTime - 0.5) * 17 + framedCoords.y * 8) / 2 + 0.5); + float interval = (sin((uTime - 0.5) * 17 + framedCoords.y * 8) / 2 + 0.5); float4 returnColor = float4(lerp(uColor, uSecondaryColor, interval), 1); // One again, use a cosine lerp based on position and time, but this time, with the Y position. - return returnColor * color; + return returnColor * color * sampleColor; } technique Technique1 { diff --git a/Effects/Dyes/AstralOrangeDyeShader.xnb b/Effects/Dyes/AstralOrangeDyeShader.xnb index 0b50ee3f1b..de89577f2d 100644 Binary files a/Effects/Dyes/AstralOrangeDyeShader.xnb and b/Effects/Dyes/AstralOrangeDyeShader.xnb differ diff --git a/Effects/Dyes/AstralSwirlDyeShader.fx b/Effects/Dyes/AstralSwirlDyeShader.fx index 33f9cb17f5..861b345b3b 100644 --- a/Effects/Dyes/AstralSwirlDyeShader.fx +++ b/Effects/Dyes/AstralSwirlDyeShader.fx @@ -18,7 +18,7 @@ float2 uLegacyArmorSheetSize; float2 RotatedBy(float2 xy, float theta) { - return float2(xy.x * cos(theta) + xy.y * sin(theta), xy.x * sin(theta) - xy.y * cos(theta)); + return float2(xy.x * sin(theta + 1.57) + xy.y * sin(theta), xy.x * sin(theta) - xy.y * sin(theta + 1.57)); } float2 InverseLerp(float2 start, float2 end, float2 x) @@ -26,18 +26,18 @@ float2 InverseLerp(float2 start, float2 end, float2 x) return saturate((x - start) / (end - start)); } -float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0 +float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0 { float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw; float4 color = tex2D(uImage0, coords); - float interval = (cos(uTime * 2.2 + framedCoords.x * framedCoords.y * 1.55) * 0.5 + 0.5) * 0.6 + 0.2; // A complex function that works based on the X and Y coords with a 0.2-0.8 range. + float interval = (sin(uTime * 2.2 + framedCoords.x * framedCoords.y * 1.55 + 1.57) * 0.5 + 0.5) * 0.6 + 0.2; // A complex function that works based on the X and Y coords with a 0.2-0.8 range. float brightness = 1.35; float3 returnColor = uColor; // Rotate the colors around and adjust the brightness. for (int i = 0; i < 4; i++) { float2 positionAt = float2(interval, 1 - interval); - positionAt = (RotatedBy(float2(cos(uTime * 1.7 + i / 4 * 6.283), cos(uTime * 1.9 + i / 4 * 6.283)), uTime + i / 4 * 6.283) * 0.5 + 0.5) - positionAt; + positionAt = (RotatedBy(float2(sin(uTime * 1.7 + i / 4 * 6.283), sin(uTime * 1.9 + i / 4 * 6.283)), uTime + i / 4 * 6.283) * 0.5 + 0.5) - positionAt; float dist = distance(coords, positionAt); if (dist < 0.35) { @@ -52,12 +52,12 @@ float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOO returnColor = lerp(returnColor, uSecondaryColor, (framedCoords.y - 0.5) * 3); } - return float4(returnColor, 1) * color * brightness; + return float4(returnColor, 1) * color * sampleColor * brightness; } technique Technique1 { pass DyePass { - PixelShader = compile ps_2_0 PixelShaderFunction(); + PixelShader = compile ps_3_0 PixelShaderFunction(); } } \ No newline at end of file diff --git a/Effects/Dyes/AstralSwirlDyeShader.xnb b/Effects/Dyes/AstralSwirlDyeShader.xnb index 3149938b49..85a3f66030 100644 Binary files a/Effects/Dyes/AstralSwirlDyeShader.xnb and b/Effects/Dyes/AstralSwirlDyeShader.xnb differ diff --git a/Effects/Dyes/AuricDyeShader.fx b/Effects/Dyes/AuricDyeShader.fx index 48af60bd46..187ab5463e 100644 --- a/Effects/Dyes/AuricDyeShader.fx +++ b/Effects/Dyes/AuricDyeShader.fx @@ -21,7 +21,7 @@ float2 InverseLerp(float2 start, float2 end, float2 x) return saturate((x - start) / (end - start)); } -float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0 +float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0 { float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw; @@ -42,12 +42,12 @@ float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOO // Use a specialized blend method to create the shine effect. color.rgb = (length(color.rgb) <= 0.5) ? 2 * color.rgb * goldColor : 1 - 2 * (1 - color.rgb) * (1 - goldColor); - return (color + noiseColor * 0.45) * color.a; + return (color + noiseColor * 0.45) * sampleColor * color.a; } technique Technique1 { pass DyePass { - PixelShader = compile ps_2_0 PixelShaderFunction(); + PixelShader = compile ps_3_0 PixelShaderFunction(); } } \ No newline at end of file diff --git a/Effects/Dyes/AuricDyeShader.xnb b/Effects/Dyes/AuricDyeShader.xnb index d58ab23c08..123b7a573d 100644 Binary files a/Effects/Dyes/AuricDyeShader.xnb and b/Effects/Dyes/AuricDyeShader.xnb differ diff --git a/Effects/Dyes/BloodflareDyeShader.fx b/Effects/Dyes/BloodflareDyeShader.fx index 8714257fab..ca68a699db 100644 --- a/Effects/Dyes/BloodflareDyeShader.fx +++ b/Effects/Dyes/BloodflareDyeShader.fx @@ -21,7 +21,7 @@ float2 InverseLerp(float2 start, float2 end, float2 x) return saturate((x - start) / (end - start)); } -float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0 +float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0 { float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw; float4 pixelBelow = tex2D(uImage0, coords); @@ -41,7 +41,7 @@ float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOO // Handle red fades based on noise. color = lerp(color, float4(1, 0, 0, 1), pow(noiseColor.r, 3) * 0.3 + verticalFlowMovement * 0.3 + 0.16) * color.a; - return color * (1 + (1 - outlineFade) * 0.25); + return color * (1 + (1 - outlineFade) * 0.25) * sampleColor; } technique Technique1 { diff --git a/Effects/Dyes/BloodflareDyeShader.xnb b/Effects/Dyes/BloodflareDyeShader.xnb index 9164223900..66eef1b7b3 100644 Binary files a/Effects/Dyes/BloodflareDyeShader.xnb and b/Effects/Dyes/BloodflareDyeShader.xnb differ diff --git a/Effects/Dyes/BrimflameDyeShader.fx b/Effects/Dyes/BrimflameDyeShader.fx index 76224fb027..069956a418 100644 --- a/Effects/Dyes/BrimflameDyeShader.fx +++ b/Effects/Dyes/BrimflameDyeShader.fx @@ -21,7 +21,7 @@ float2 InverseLerp(float2 start, float2 end, float2 x) return saturate((x - start) / (end - start)); } -float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0 +float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0 { float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw; float4 color = tex2D(uImage0, coords); @@ -36,7 +36,7 @@ float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOO float3 flameColor = lerp(alteredColor, alteredSecondaryColor, fadeToRed); flameColor.r = 0.6 + sqrt(fadeToRed) * 0.4; color = lerp(color, float4(flameColor, 1), 0.45) * color.a; - return color * lerp(1.3, 5.4, pow(flameStreakBrightness, 4.44)); + return color * lerp(1.3, 5.4, pow(flameStreakBrightness, 4.44)) * sampleColor; } technique Technique1 { diff --git a/Effects/Dyes/BrimflameDyeShader.xnb b/Effects/Dyes/BrimflameDyeShader.xnb index 6e1bf8331b..74666725e8 100644 Binary files a/Effects/Dyes/BrimflameDyeShader.xnb and b/Effects/Dyes/BrimflameDyeShader.xnb differ diff --git a/Effects/Dyes/CalamitousDyeShader.fx b/Effects/Dyes/CalamitousDyeShader.fx index b3e13de81a..12c826bd2b 100644 --- a/Effects/Dyes/CalamitousDyeShader.fx +++ b/Effects/Dyes/CalamitousDyeShader.fx @@ -21,7 +21,7 @@ float2 InverseLerp(float2 start, float2 end, float2 x) return saturate((x - start) / (end - start)); } -float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0 +float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0 { float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw; float4 noiseColor = tex2D(uImage1, framedCoords); @@ -40,12 +40,12 @@ float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOO blendFactor *= framedCoords.y / 0.2; } float4 colorBlendMultiplier = lerp(float4(blendColor, 1), float4(1, 1, 1, 1), saturate(pow(blendFactor * 1.5, 2))); - return (lerp(color, float4(blendColor, 1), blendFactor * 0.5 + 0.2) * color.a) * colorBlendMultiplier * (1 + brightness); + return (lerp(color, float4(blendColor, 1), blendFactor * 0.5 + 0.2) * color.a) * colorBlendMultiplier * (1 + brightness) * sampleColor; } technique Technique1 { pass DyePass { - PixelShader = compile ps_2_0 PixelShaderFunction(); + PixelShader = compile ps_3_0 PixelShaderFunction(); } } \ No newline at end of file diff --git a/Effects/Dyes/CalamitousDyeShader.xnb b/Effects/Dyes/CalamitousDyeShader.xnb index a9ad15843b..98ff4d7091 100644 Binary files a/Effects/Dyes/CalamitousDyeShader.xnb and b/Effects/Dyes/CalamitousDyeShader.xnb differ diff --git a/Effects/Dyes/CeaselessDyeShader.fx b/Effects/Dyes/CeaselessDyeShader.fx index 8b6b8554af..0fbb61a21a 100644 --- a/Effects/Dyes/CeaselessDyeShader.fx +++ b/Effects/Dyes/CeaselessDyeShader.fx @@ -27,14 +27,14 @@ float2 InverseLerp(float2 start, float2 end, float2 x) return saturate((x - start) / (end - start)); } -float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0 +float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0 { float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw; coords.x += randomness(uTime + framedCoords.y).x * (1 - framedCoords.y) * 6 / uImageSize0.x; // Add an X offset based on a noise function, giving a moon lord void-esque shader effect. float4 color = tex2D(uImage0, coords); float4 returnColor = color * 0.1; returnColor.a = color.a; - return returnColor; + return returnColor * sampleColor; } technique Technique1 { diff --git a/Effects/Dyes/CeaselessDyeShader.xnb b/Effects/Dyes/CeaselessDyeShader.xnb index 2d2971eff7..02571b5f18 100644 Binary files a/Effects/Dyes/CeaselessDyeShader.xnb and b/Effects/Dyes/CeaselessDyeShader.xnb differ diff --git a/Effects/Dyes/CosmicFlameShader.fx b/Effects/Dyes/CosmicFlameShader.fx index 624511762c..5ecb960b59 100644 --- a/Effects/Dyes/CosmicFlameShader.fx +++ b/Effects/Dyes/CosmicFlameShader.fx @@ -21,7 +21,7 @@ float2 InverseLerp(float2 start, float2 end, float2 x) return saturate((x - start) / (end - start)); } -float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0 +float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0 { float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw; float2 swirlOffset = float2(sin(uTime * 0.26 + 1.754) * 0.31, sin(uTime * 0.26) * 0.16) * uSaturation; @@ -46,12 +46,12 @@ float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOO // And create stars based on a noise texture that rise upward. color = lerp(color, float4(starColor, 1) * color.a, fadeToNormal * pow(brightnessFactor, 6) * 0.15); - return color * (1 + brightnessFactor); + return color * (1 + brightnessFactor) * sampleColor; } technique Technique1 { pass DyePass { - PixelShader = compile ps_2_0 PixelShaderFunction(); + PixelShader = compile ps_3_0 PixelShaderFunction(); } } \ No newline at end of file diff --git a/Effects/Dyes/CosmicFlameShader.xnb b/Effects/Dyes/CosmicFlameShader.xnb index b2851d2938..77399b244c 100644 Binary files a/Effects/Dyes/CosmicFlameShader.xnb and b/Effects/Dyes/CosmicFlameShader.xnb differ diff --git a/Effects/Dyes/CosmiliteDyeShader.fx b/Effects/Dyes/CosmiliteDyeShader.fx index 34d100a222..d21a65fd1f 100644 --- a/Effects/Dyes/CosmiliteDyeShader.fx +++ b/Effects/Dyes/CosmiliteDyeShader.fx @@ -21,7 +21,7 @@ float2 InverseLerp(float2 start, float2 end, float2 x) return saturate((x - start) / (end - start)); } -float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0 +float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0 { float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw; float4 color = tex2D(uImage0, coords); @@ -35,7 +35,7 @@ float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOO baseColor *= 1 + pow(baseColor, 5).r * 8 - noiseColor2.r * 1.25; baseColor = lerp(baseColor, uSecondaryColor * 2, pow(noiseColor.r, 2)); - return float4(baseColor, 1) * opacity; + return float4(baseColor, 1) * sampleColor * opacity; } technique Technique1 { diff --git a/Effects/Dyes/CosmiliteDyeShader.xnb b/Effects/Dyes/CosmiliteDyeShader.xnb index 04e0b4554f..1d2ae49391 100644 Binary files a/Effects/Dyes/CosmiliteDyeShader.xnb and b/Effects/Dyes/CosmiliteDyeShader.xnb differ diff --git a/Effects/Dyes/CryonicDyeShader.fx b/Effects/Dyes/CryonicDyeShader.fx index cdd28b50c5..cc73f53ef9 100644 --- a/Effects/Dyes/CryonicDyeShader.fx +++ b/Effects/Dyes/CryonicDyeShader.fx @@ -21,7 +21,7 @@ float2 InverseLerp(float2 start, float2 end, float2 x) return saturate((x - start) / (end - start)); } -float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0 +float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0 { float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw; float4 noiseColor = tex2D(uImage1, float2(frac(framedCoords.x + uTime * 0.1), framedCoords.y)); @@ -39,7 +39,7 @@ float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOO if (normalizedDistanceFromCenter > 0.7) fadeToSecondaryColor *= saturate(1 - (normalizedDistanceFromCenter - 0.7) / 0.2); float4 endFadeColor = lerp(float4(uColor, 1), float4(uSecondaryColor, 1), 0.5); - return (lerp(color, endFadeColor, 0.3 + fadeToSecondaryColor * 0.6) * color.a) * (1 + brightness); + return (lerp(color, endFadeColor, 0.3 + fadeToSecondaryColor * 0.6) * color.a) * sampleColor * (1 + brightness); } technique Technique1 { diff --git a/Effects/Dyes/CryonicDyeShader.xnb b/Effects/Dyes/CryonicDyeShader.xnb index e7e3077218..b2bbcb543a 100644 Binary files a/Effects/Dyes/CryonicDyeShader.xnb and b/Effects/Dyes/CryonicDyeShader.xnb differ diff --git a/Effects/Dyes/DefiledFlameDyeShader.fx b/Effects/Dyes/DefiledFlameDyeShader.fx index 360c393701..d2a82133cd 100644 --- a/Effects/Dyes/DefiledFlameDyeShader.fx +++ b/Effects/Dyes/DefiledFlameDyeShader.fx @@ -25,22 +25,22 @@ float2 InverseLerp(float2 start, float2 end, float2 x) return saturate((x - start) / (end - start)); } -float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0 +float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0 { float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw; float4 color = tex2D(uImage0, coords); float4 noiseColor = tex2D(uImage1, coords); - float interval = cos(uTime * 7 + framedCoords.y * 6) * 0.5 + 0.5; + float interval = sin(uTime * 7 + framedCoords.y * 6 + 1.57) * 0.5 + 0.5; - float brightness = pow((interval + sin(uTime + framedCoords.x * uTime * framedCoords.y * cos(uTime)) * 0.5 + 0.5) * 0.5, 2); // Force the brightness to rise to 1 more quickly + float brightness = pow((interval + sin(uTime + framedCoords.x * uTime * framedCoords.y * sin(uTime)) * 0.5 + 0.5) * 0.5, 2); // Force the brightness to rise to 1 more quickly brightness = brightness * (MaxBrightness - MinBrightness) + MinBrightness; // And bring it to a specified range float4 colorMap = float4(lerp(uColor, uSecondaryColor, interval) + noiseColor.rgb * 0.4, 1); colorMap.rgb *= brightness; colorMap.rgb = colorMap.rgb - colorMap.rgb % Variance; // Slice the return color map to make pixels appear less varied and more extreme - return colorMap * color; + return colorMap * color * sampleColor * sampleColor.a; } technique Technique1 { diff --git a/Effects/Dyes/DefiledFlameDyeShader.xnb b/Effects/Dyes/DefiledFlameDyeShader.xnb index b0bbe6d038..9ad552827d 100644 Binary files a/Effects/Dyes/DefiledFlameDyeShader.xnb and b/Effects/Dyes/DefiledFlameDyeShader.xnb differ diff --git a/Effects/Dyes/DragonSoulDyeShader.fx b/Effects/Dyes/DragonSoulDyeShader.fx index ff9c9c6dc7..82db5d09cf 100644 --- a/Effects/Dyes/DragonSoulDyeShader.fx +++ b/Effects/Dyes/DragonSoulDyeShader.fx @@ -29,20 +29,20 @@ float2 InverseLerp(float2 start, float2 end, float2 x) return saturate((x - start) / (end - start)); } -float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0 +float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0 { float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw; float4 color = tex2D(uImage0, coords); - float interval = (cos(framedCoords.x * 6.283 + uTime * 3.141) * 2 + sin(uTime * 7 + framedCoords.y * 6)) * 0.125 + 0.5; + float interval = (sin(framedCoords.x * 6.283 + uTime * 3.141) * 2 + sin(uTime * 7 + framedCoords.y * 6)) * 0.125 + 0.5; interval *= 2; // Exaggerate the interval. float4 returnColor = float4(lerp(colors[floor(interval) % 4], colors[floor(interval + 1) % 4], interval % 1), 1); // But clamp it to a 0-1 range. - return returnColor * color * 1.95; + return returnColor * color * sampleColor * 1.95; } technique Technique1 { pass DyePass { - PixelShader = compile ps_2_0 PixelShaderFunction(); + PixelShader = compile ps_3_0 PixelShaderFunction(); } } \ No newline at end of file diff --git a/Effects/Dyes/DragonSoulDyeShader.xnb b/Effects/Dyes/DragonSoulDyeShader.xnb index 25e328a9f6..51016279ce 100644 Binary files a/Effects/Dyes/DragonSoulDyeShader.xnb and b/Effects/Dyes/DragonSoulDyeShader.xnb differ diff --git a/Effects/Dyes/ElementalDyeShader.fx b/Effects/Dyes/ElementalDyeShader.fx index 67c13b2af3..1bce69bfa1 100644 --- a/Effects/Dyes/ElementalDyeShader.fx +++ b/Effects/Dyes/ElementalDyeShader.fx @@ -21,11 +21,11 @@ float2 InverseLerp(float2 start, float2 end, float2 x) return saturate((x - start) / (end - start)); } -float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0 +float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0 { float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw; float4 color = tex2D(uImage0, coords); - float time = (sin(uTime + framedCoords.x * cos(uTime + 3.141 * framedCoords.x) + 1.5707 * framedCoords.y) * 0.5 + 0.5) * 6; + float time = (sin(uTime + framedCoords.x * sin(uTime + 3.141 * framedCoords.x) + 1.5707 * framedCoords.y) * 0.5 + 0.5) * 6; float timeFloored = floor(time); float3 colors[6] = @@ -40,12 +40,12 @@ float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOO // Use a multi-lerp to fade between colors and then base them on a trig-based time step. color.rgb *= lerp(colors[timeFloored] / 255.0, colors[(timeFloored + 1) % 6] / 255.0, time / 6) * 1.6; - return color; + return color * sampleColor; } technique Technique1 { pass DyePass { - PixelShader = compile ps_2_0 PixelShaderFunction(); + PixelShader = compile ps_3_0 PixelShaderFunction(); } } \ No newline at end of file diff --git a/Effects/Dyes/ElementalDyeShader.xnb b/Effects/Dyes/ElementalDyeShader.xnb index 17e00fdb00..a058d35d1e 100644 Binary files a/Effects/Dyes/ElementalDyeShader.xnb and b/Effects/Dyes/ElementalDyeShader.xnb differ diff --git a/Effects/Dyes/EndothermicDyeShader.fx b/Effects/Dyes/EndothermicDyeShader.fx index 71da951320..1ee81b9098 100644 --- a/Effects/Dyes/EndothermicDyeShader.fx +++ b/Effects/Dyes/EndothermicDyeShader.fx @@ -21,7 +21,7 @@ float2 InverseLerp(float2 start, float2 end, float2 x) return saturate((x - start) / (end - start)); } -float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0 +float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0 { float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw; @@ -30,7 +30,7 @@ float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOO float4 color = tex2D(uImage0, coords); float luminosity = (color.r + color.g + color.b) / 3; color.rgb = luminosity * idealColor * 1.3; // Average out the colors. - return color; + return color * sampleColor; } technique Technique1 { diff --git a/Effects/Dyes/EndothermicDyeShader.xnb b/Effects/Dyes/EndothermicDyeShader.xnb index ac4bca77c8..d3745d6622 100644 Binary files a/Effects/Dyes/EndothermicDyeShader.xnb and b/Effects/Dyes/EndothermicDyeShader.xnb differ diff --git a/Effects/Dyes/ExoDyeShader.fx b/Effects/Dyes/ExoDyeShader.fx index fd5de42c32..66df3bc5fc 100644 --- a/Effects/Dyes/ExoDyeShader.fx +++ b/Effects/Dyes/ExoDyeShader.fx @@ -56,7 +56,7 @@ float2 InverseLerp(float2 start, float2 end, float2 x) return saturate((x - start) / (end - start)); } -float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0 +float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0 { float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw; float4 noiseColor = tex2D(uImage1, float2(framedCoords.x, framedCoords.y - uTime * 0.45) * 0.1); @@ -66,12 +66,12 @@ float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOO float brightness = (blendFactor * 0.4 + noiseColor.r * 0.9) * 1.2; float4 colorBlendMultiplier = lerp(float4(blendColor, 1), float4(1, 1, 1, 1), saturate(blendFactor * 1.5)); - return (lerp(color, float4(blendColor, 1), blendFactor * 0.5 + 0.2) * color.a) * colorBlendMultiplier * (1 + brightness); + return (lerp(color, float4(blendColor, 1), blendFactor * 0.5 + 0.2) * color.a) * sampleColor * colorBlendMultiplier * (1 + brightness); } technique Technique1 { pass DyePass { - PixelShader = compile ps_2_0 PixelShaderFunction(); + PixelShader = compile ps_3_0 PixelShaderFunction(); } } \ No newline at end of file diff --git a/Effects/Dyes/ExoDyeShader.xnb b/Effects/Dyes/ExoDyeShader.xnb index c78cad0aef..46d12eb074 100644 Binary files a/Effects/Dyes/ExoDyeShader.xnb and b/Effects/Dyes/ExoDyeShader.xnb differ diff --git a/Effects/Dyes/NightmareDyeShader.fx b/Effects/Dyes/NightmareDyeShader.fx index ad9abbe471..a05e8e504f 100644 --- a/Effects/Dyes/NightmareDyeShader.fx +++ b/Effects/Dyes/NightmareDyeShader.fx @@ -21,7 +21,7 @@ float2 InverseLerp(float2 start, float2 end, float2 x) return saturate((x - start) / (end - start)); } -float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0 +float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0 { float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw; float3 idealColor = uColor; @@ -33,7 +33,7 @@ float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOO float4 color = tex2D(uImage0, coords); float luminosity = (color.r + color.g + color.b) / 3; color.rgb = luminosity * idealColor * 1.6; // Average out the colors. - return color; + return color * sampleColor; } technique Technique1 { diff --git a/Effects/Dyes/NightmareDyeShader.xnb b/Effects/Dyes/NightmareDyeShader.xnb index 4e52fc32ec..5cf941877a 100644 Binary files a/Effects/Dyes/NightmareDyeShader.xnb and b/Effects/Dyes/NightmareDyeShader.xnb differ diff --git a/Effects/Dyes/PhantoplasmDyeShader.fx b/Effects/Dyes/PhantoplasmDyeShader.fx index 5e48cfc31e..dc937ddf26 100644 --- a/Effects/Dyes/PhantoplasmDyeShader.fx +++ b/Effects/Dyes/PhantoplasmDyeShader.fx @@ -21,7 +21,7 @@ float2 InverseLerp(float2 start, float2 end, float2 x) return saturate((x - start) / (end - start)); } -float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0 +float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0 { float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw; float4 noiseColor = tex2D(uImage1, float2(framedCoords.x, frac(framedCoords.y + uTime * 0.7))); @@ -39,7 +39,7 @@ float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOO float4 blendedColor = (color + endFadeColor) * 0.5 - 0.05; blendedColor *= 1.4; blendedColor.a = 1; - return blendedColor * color.a * (1 + lerp(0.07, 0.3, fadeToSecondaryColor) + noiseColor.g * 0.1); + return blendedColor * color.a * (1 + lerp(0.07, 0.3, fadeToSecondaryColor) + noiseColor.g * 0.1) * sampleColor; } technique Technique1 { diff --git a/Effects/Dyes/PhantoplasmDyeShader.xnb b/Effects/Dyes/PhantoplasmDyeShader.xnb index 40f81c156e..d49d7dcf29 100644 Binary files a/Effects/Dyes/PhantoplasmDyeShader.xnb and b/Effects/Dyes/PhantoplasmDyeShader.xnb differ diff --git a/Effects/Dyes/ProfanedFlameDyeShader.fx b/Effects/Dyes/ProfanedFlameDyeShader.fx index 9c47314e41..8c4ecb6817 100644 --- a/Effects/Dyes/ProfanedFlameDyeShader.fx +++ b/Effects/Dyes/ProfanedFlameDyeShader.fx @@ -21,13 +21,13 @@ float2 InverseLerp(float2 start, float2 end, float2 x) return saturate((x - start) / (end - start)); } -float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0 +float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0 { float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw; float4 color = tex2D(uImage0, coords); // Read the fade map as a streak. - float4 fadeMapColor = tex2D(uImage1, float2(frac(framedCoords.x * 0.18 + cos(uTime * 0.9) * 0.021), frac(framedCoords.y * 0.32 + uTime * 0.2))); + float4 fadeMapColor = tex2D(uImage1, float2(frac(framedCoords.x * 0.18 + sin(uTime * 0.9) * 0.021), frac(framedCoords.y * 0.32 + uTime * 0.2))); fadeMapColor.r *= pow(framedCoords.x, 0.2); float opacity = lerp(1.05, 1.95, fadeMapColor.r); @@ -41,7 +41,7 @@ float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOO transformColor = lerp(transformColor, float3(206 / 255, 116 / 255, 59 / 255), orangeFade); color.rgb = lerp(color.rgb, transformColor, fadeMapColor.r); opacity *= color.a; - return color * opacity; + return color * sampleColor * opacity; } technique Technique1 { diff --git a/Effects/Dyes/ProfanedFlameDyeShader.xnb b/Effects/Dyes/ProfanedFlameDyeShader.xnb index 5e2e87ffde..6312ce8a11 100644 Binary files a/Effects/Dyes/ProfanedFlameDyeShader.xnb and b/Effects/Dyes/ProfanedFlameDyeShader.xnb differ diff --git a/Effects/Dyes/ProfanedMoonlightDye.fx b/Effects/Dyes/ProfanedMoonlightDye.fx index bec949f33b..75894ab43c 100644 --- a/Effects/Dyes/ProfanedMoonlightDye.fx +++ b/Effects/Dyes/ProfanedMoonlightDye.fx @@ -19,8 +19,8 @@ float2 uLegacyArmorSheetSize; float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0 { float4 returnColor = tex2D(uImage0, coords); - returnColor.rgb *= uColor * max(1, (cos(uTime) * 0.5 + 0.5) * 0.3 + 1.3); - return returnColor; + returnColor.rgb *= uColor * max(1, (sin(uTime) * 0.5 + 0.5) * 0.3 + 1.3); + return returnColor * sampleColor; } technique Technique1 { diff --git a/Effects/Dyes/ProfanedMoonlightDye.xnb b/Effects/Dyes/ProfanedMoonlightDye.xnb index 38f1f59433..b404745683 100644 Binary files a/Effects/Dyes/ProfanedMoonlightDye.xnb and b/Effects/Dyes/ProfanedMoonlightDye.xnb differ diff --git a/Effects/Dyes/ReaverDyeShader.fx b/Effects/Dyes/ReaverDyeShader.fx index db0966aafd..fd945f8736 100644 --- a/Effects/Dyes/ReaverDyeShader.fx +++ b/Effects/Dyes/ReaverDyeShader.fx @@ -21,7 +21,7 @@ float2 InverseLerp(float2 start, float2 end, float2 x) return saturate((x - start) / (end - start)); } -float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0 +float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0 { float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw; float4 color = tex2D(uImage0, coords); @@ -30,7 +30,7 @@ float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOO color.rgb *= ((framedCoords.x * uColor * (1 - yMultiplier) * 1.4) + ((1 - framedCoords.x) * uSecondaryColor * yMultiplier * 1.7)) * luminosity * 2.1; color.rgb *= clamp(1.6 * saturate(distance((0.5, 0.5), framedCoords)), 0.8, 1.6); // Intensify the colors based on how far they are from the center of the sprite. - return color; + return color * sampleColor; } technique Technique1 { diff --git a/Effects/Dyes/ReaverDyeShader.xnb b/Effects/Dyes/ReaverDyeShader.xnb index 877b808101..9265449b00 100644 Binary files a/Effects/Dyes/ReaverDyeShader.xnb and b/Effects/Dyes/ReaverDyeShader.xnb differ diff --git a/Effects/Dyes/ShadowspecDyeShader.fx b/Effects/Dyes/ShadowspecDyeShader.fx index c501691ea2..18db9000d3 100644 --- a/Effects/Dyes/ShadowspecDyeShader.fx +++ b/Effects/Dyes/ShadowspecDyeShader.fx @@ -18,14 +18,14 @@ float2 uLegacyArmorSheetSize; float2 RotatedBy(float theta, float x, float y) { - return float2(x * cos(theta) + y * sin(theta), x * sin(theta) - y * cos(theta)); + return float2(x * sin(theta + 1.57) + y * sin(theta), x * sin(theta) - y * sin(theta + 1.57)); } float2 InverseLerp(float2 start, float2 end, float2 x) { return saturate((x - start) / (end - start)); } -float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0 +float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0 { float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw; float sineTime = sin(uTime); // Saved so that I don't have the compute this multiple times. Shaders have a limited number of mathematical instructions you can use - 64. @@ -35,7 +35,7 @@ float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOO modifiedCoords = RotatedBy(uTime + 0.4 * sineTime, modifiedCoords.y, modifiedCoords.x); float4 noiseColor = tex2D(uImage1, modifiedCoords); - float xMultiplier = cos(framedCoords.x * 2.3 + uTime) + 1; + float xMultiplier = sin(framedCoords.x * 2.3 + uTime + 1.57) + 1; float yMultiplier = sin(framedCoords.y * 2 + uTime * 1.4) + 1; float interpolationValue = saturate(xMultiplier * yMultiplier) * 0.7 + 0.3; // Range of 0-1. Depends on the current coordinates and the time. @@ -43,12 +43,12 @@ float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOO color.rgb *= 0.2 + pow(noiseColor.rgb, 3); // Squash the color to the upper and lower bounds and add a bit of lightness to it. color.rgb *= lerp(uColor, uSecondaryColor, interpolationValue); // Blend with the secondary color. color.rgb *= 1.7 + (sineTime * 0.5 + 1.5) * interpolationValue; // Range of 1.7 to 3.7, can cause certain spots to become very bright. - return color; + return color * sampleColor; } technique Technique1 { pass DyePass { - PixelShader = compile ps_2_0 PixelShaderFunction(); + PixelShader = compile ps_3_0 PixelShaderFunction(); } } \ No newline at end of file diff --git a/Effects/Dyes/ShadowspecDyeShader.xnb b/Effects/Dyes/ShadowspecDyeShader.xnb index f95f233945..73f535eaf2 100644 Binary files a/Effects/Dyes/ShadowspecDyeShader.xnb and b/Effects/Dyes/ShadowspecDyeShader.xnb differ diff --git a/Effects/Dyes/SlimeGodDyeShader.fx b/Effects/Dyes/SlimeGodDyeShader.fx index 458d4f26fa..20a64cc51f 100644 --- a/Effects/Dyes/SlimeGodDyeShader.fx +++ b/Effects/Dyes/SlimeGodDyeShader.fx @@ -21,7 +21,7 @@ float2 InverseLerp(float2 start, float2 end, float2 x) return saturate((x - start) / (end - start)); } -float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0 +float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0 { float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw; float4 color = tex2D(uImage0, coords); @@ -42,7 +42,7 @@ float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOO // Handle sludge fades based on noise. color = lerp(color, float4(uSecondaryColor * 0.375, 1), pow(noiseColor.r, 3) * 0.3 + verticalFlowMovement * 0.3 + 0.13) * color.a; - return color * (1 + (1 - outlineFade) * 0.1); + return color * sampleColor * (1 + (1 - outlineFade) * 0.1); } technique Technique1 { diff --git a/Effects/Dyes/SlimeGodDyeShader.xnb b/Effects/Dyes/SlimeGodDyeShader.xnb index dd68e84f6b..5cb258832c 100644 Binary files a/Effects/Dyes/SlimeGodDyeShader.xnb and b/Effects/Dyes/SlimeGodDyeShader.xnb differ diff --git a/Effects/Dyes/StratusDyeShader.fx b/Effects/Dyes/StratusDyeShader.fx index 6a8ce34270..f9b8c23901 100644 --- a/Effects/Dyes/StratusDyeShader.fx +++ b/Effects/Dyes/StratusDyeShader.fx @@ -22,17 +22,17 @@ float2 InverseLerp(float2 start, float2 end, float2 x) return saturate((x - start) / (end - start)); } -float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0 +float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0 { float2 framedCoords = (coords * uImageSize0 - uSourceRect.xy) / uSourceRect.zw; float4 color = tex2D(uImage0, coords); float sineTime = sin(uTime); // Saved so that I don't have the compute this multiple times. Shaders have a limited number of mathematical instructions you can use - 64. float2 modifiedCoords = coords; - modifiedCoords.x += cos(uTime + framedCoords.y) * 0.5 + 0.5; // Cause the effect to sway around a bit with time. + modifiedCoords.x += sin(uTime + framedCoords.y + 1.57) * 0.5 + 0.5; // Cause the effect to sway around a bit with time. float4 noiseColor = tex2D(uImage1, frac(modifiedCoords)); - float xMultiplier = cos(framedCoords.x * 2.3 + uTime * 1.15) + 0.5; + float xMultiplier = sin(framedCoords.x * 2.3 + uTime * 1.15 + 1.57) + 0.5; float yMultiplier = (sin(framedCoords.y * 2 + uTime * 1.4) + 1) * 0.5; color.rgb *= lerp(uColor, uSecondaryColor, saturate(xMultiplier * yMultiplier * 1.6)); @@ -41,7 +41,7 @@ float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOO color.rgb *= 1.6; // Sometimes give light "patches" depending on the swaying noise image. } color.rgb *= 1.6; // Brighten the shader over time. - return color; + return color * sampleColor; } technique Technique1 { diff --git a/Effects/Dyes/StratusDyeShader.xnb b/Effects/Dyes/StratusDyeShader.xnb index b7107324ff..f2d450e689 100644 Binary files a/Effects/Dyes/StratusDyeShader.xnb and b/Effects/Dyes/StratusDyeShader.xnb differ diff --git a/Effects/IntersectionClipShader.fx b/Effects/IntersectionClipShader.fx index cce7b32bee..21c6aa4fa4 100644 --- a/Effects/IntersectionClipShader.fx +++ b/Effects/IntersectionClipShader.fx @@ -20,12 +20,12 @@ float4 uShaderSpecificData; float2 RotatedBy(float2 xy, float theta) { - return float2(xy.x * cos(theta) + xy.y * sin(theta), xy.x * sin(theta) - xy.y * cos(theta)); + return float2(xy.x * sin(theta + 1.57) - xy.y * sin(theta), xy.x * sin(theta) + xy.y * sin(theta + 1.57)); } float4 PixelShaderFunction(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0 { - float2 worldPos = uWorldPosition + RotatedBy(coords - 0.5, uRotation - 1.57) * uSize; - if (sign(dot(uIntersectionNormal, worldPos - uIntersectionPosition)) == uIntersectionCutoffDirection) + float2 worldPos = uWorldPosition + RotatedBy(coords - 0.5, uRotation) * uSize; + if (sign(dot(uIntersectionNormal, normalize(worldPos - uIntersectionPosition))) == uIntersectionCutoffDirection) return 0; return tex2D(uImage0, coords) * sampleColor; diff --git a/Effects/IntersectionClipShader.xnb b/Effects/IntersectionClipShader.xnb index 39031b6a83..8fc86f0147 100644 Binary files a/Effects/IntersectionClipShader.xnb and b/Effects/IntersectionClipShader.xnb differ diff --git a/Effects/RancorMagicCircle.fx b/Effects/RancorMagicCircle.fx index 17e809a437..c8250bb7b8 100644 --- a/Effects/RancorMagicCircle.fx +++ b/Effects/RancorMagicCircle.fx @@ -36,9 +36,9 @@ VertexShaderOutput VertexShaderFunction(in VertexShaderInput input) VertexShaderOutput output = (VertexShaderOutput) 0; float2 coords = input.Coordinates - 0.5; float rotationSine = sin(uSaturation); - float rotationCosine = cos(uSaturation); + float rotationCosine = sin(uSaturation + 1.57); float rotationOriginSine = sin(uCircularRotation); - float rotationOriginCosine = cos(uCircularRotation); + float rotationOriginCosine = sin(uCircularRotation + 1.57); float2x2 rotationMatrix = float2x2(rotationCosine, -rotationSine, rotationSine, rotationCosine); float2x2 circularRotationMatrix = float2x2(rotationOriginCosine, -rotationOriginSine, rotationOriginSine, rotationOriginCosine); float2x2 scalingMatrix = float2x2(2, 0, 0, 1); diff --git a/Effects/RancorMagicCircle.xnb b/Effects/RancorMagicCircle.xnb index 19b478d5d5..6f89e648c3 100644 Binary files a/Effects/RancorMagicCircle.xnb and b/Effects/RancorMagicCircle.xnb differ diff --git a/Items/Accessories/AquaticHeart.cs b/Items/Accessories/AquaticHeart.cs index c2e23bb6b1..803bb83f19 100644 --- a/Items/Accessories/AquaticHeart.cs +++ b/Items/Accessories/AquaticHeart.cs @@ -5,6 +5,7 @@ using Terraria.ID; namespace CalamityMod.Items.Accessories { + [LegacyName("SirensHeart")] public class AquaticHeart : ModItem { public override void Load() diff --git a/Items/Accessories/CheatTestThing.cs b/Items/Accessories/CheatTestThing.cs deleted file mode 100644 index c47300a4a3..0000000000 --- a/Items/Accessories/CheatTestThing.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Accessories -{ - public class CheatTestThing : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("lul"); - Tooltip.SetDefault("Grants complete invulnerability to almost everything"); - } - - public override void SetDefaults() - { - Item.width = 26; - Item.height = 26; - Item.value = 0; // lul intentionally has zero value - Item.Calamity().customRarity = CalamityRarity.HotPink; - Item.accessory = true; // lul cannot be duplicated in Journey Mode - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.Calamity().lol = true; - } - } -} diff --git a/Items/Accessories/CheatTestThing.png b/Items/Accessories/CheatTestThing.png deleted file mode 100644 index a3aaf9f07f..0000000000 Binary files a/Items/Accessories/CheatTestThing.png and /dev/null differ diff --git a/Items/Accessories/DaawnlightSpiritOrigin.cs b/Items/Accessories/DaawnlightSpiritOrigin.cs index 24dc2e381e..d0810fbbfc 100644 --- a/Items/Accessories/DaawnlightSpiritOrigin.cs +++ b/Items/Accessories/DaawnlightSpiritOrigin.cs @@ -87,7 +87,7 @@ namespace CalamityMod.Items.Accessories public override void AddRecipes() { CreateRecipe(). - AddIngredient(). + AddIngredient(). AddIngredient(ItemID.LunarBar). AddIngredient(15). AddIngredient(15). diff --git a/Items/Accessories/ArtemisEmblem.cs b/Items/Accessories/DeadshotBrooch.cs similarity index 87% rename from Items/Accessories/ArtemisEmblem.cs rename to Items/Accessories/DeadshotBrooch.cs index 2c69a9eb9e..73f041347d 100644 --- a/Items/Accessories/ArtemisEmblem.cs +++ b/Items/Accessories/DeadshotBrooch.cs @@ -5,12 +5,13 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - public class ArtemisEmblem : ModItem + [LegacyName("DaedalusEmblem")] + public class DeadshotBrooch : ModItem { public override void SetStaticDefaults() { SacrificeTotal = 1; - DisplayName.SetDefault("Artemis Emblem"); + DisplayName.SetDefault("Deadshot Brooch"); Tooltip.SetDefault("10% increased ranged damage, 5% increased ranged critical strike chance and 20% reduced ammo usage\n" + "Greatly increases all ranged projectile velocity"); } @@ -26,7 +27,7 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { - player.Calamity().artemisEmblem = true; + player.Calamity().deadshotBrooch = true; player.Calamity().rangedAmmoCost *= 0.8f; player.GetDamage() += 0.1f; player.GetCritChance() += 5; diff --git a/Items/Accessories/ArtemisEmblem.png b/Items/Accessories/DeadshotBrooch.png similarity index 100% rename from Items/Accessories/ArtemisEmblem.png rename to Items/Accessories/DeadshotBrooch.png diff --git a/Items/Accessories/DraedonsHeart.cs b/Items/Accessories/DraedonsHeart.cs index f026431b6c..de265c33bc 100644 --- a/Items/Accessories/DraedonsHeart.cs +++ b/Items/Accessories/DraedonsHeart.cs @@ -3,18 +3,34 @@ using Terraria; using Terraria.ID; using Terraria.DataStructures; using Terraria.ModLoader; +using System.Collections.Generic; +using System.Linq; +using CalamityMod.World; namespace CalamityMod.Items.Accessories { public class DraedonsHeart : ModItem { + private const double ContactDamageReduction = 0.15D; + + // Duration of Nanomachines in frames. + internal static readonly int NanomachinesDuration = 120; + + // Duration of time where Nanomachines won't accumulate after taking damage, in frames. + internal static readonly int NanomachinePauseAfterDamage = 240; + + internal static readonly int NanomachinesHeal = 240; + public override void SetStaticDefaults() { SacrificeTotal = 1; DisplayName.SetDefault("Draedon's Heart"); - Tooltip.SetDefault("Reduces the amount of defense damage you take by 50%\n" + - "Standing still regenerates your life quickly, reduces your damage by 50% and boosts your defense by 75%\n" + - "Nanomachines, son"); + Tooltip.SetDefault("15% reduced contact damage from enemies\n" + + "Reduces defense damage taken by 50%\n" + "Replaces Adrenaline with the Nanomachines meter\n" + + $"Unlike Adrenaline, you lose no Nanomachines when you take damage, but they stop accumulating for {NanomachinePauseAfterDamage / 60} seconds\n" + + $"With full Nanomachines, press & to heal {NanomachinesHeal} health over {NanomachinesDuration / 60} seconds\n" + + "While healing, wings are disabled and your mobility is crippled\n" + + "'Nanomachines, son.'"); Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 11)); } @@ -23,15 +39,43 @@ namespace CalamityMod.Items.Accessories Item.width = 52; Item.height = 68; Item.accessory = true; + Item.defense = 48; Item.rare = ItemRarityID.Red; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; Item.Calamity().customRarity = CalamityRarity.Violet; } + // TODO -- If you unequip Draedon's Heart, you should lose all Adrenaline. + // TODO -- You should not be able to equip or unequip Draedon's Heart while Adrenaline is active. public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); modPlayer.draedonsHeart = true; + modPlayer.AdrenalineDuration = NanomachinesDuration; + modPlayer.contactDamageReduction += ContactDamageReduction; + } + + public override void ModifyTooltips(List list) + { + // The 3rd tooltip line "Replaces Adrenaline..." is replaced on Normal or Expert + TooltipLine nanomachineMeterLine = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip2"); + if (nanomachineMeterLine != null && !CalamityWorld.revenge) + nanomachineMeterLine.Text = "Adds the Nanomachines meter"; + + // The 4th tooltip line "Unlike Adrenaline..." is replaced on Normal or Expert + TooltipLine doesntStopOnDamageLine = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip3"); + if (doesntStopOnDamageLine != null && !CalamityWorld.revenge) + doesntStopOnDamageLine.Text = "Nanomachines accumulate over time while fighting bosses\n" + + $"Taking damage stops the accumulation for {NanomachinePauseAfterDamage / 60} seconds"; + + // The 5th tooltip line "With full Nanomachines" has the & replaced with the hotkey. + string adrenKey = CalamityKeybinds.AdrenalineHotKey.TooltipHotkeyString(); + TooltipLine hotkeyLine = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip4"); + if (hotkeyLine != null) + { + string tooltipWithHotkey = hotkeyLine.Text.Replace("&", adrenKey); + hotkeyLine.Text = tooltipWithHotkey; + } } } } diff --git a/Items/Accessories/ElementalQuiver.cs b/Items/Accessories/ElementalQuiver.cs index aeecaab4a5..40e9a723a8 100644 --- a/Items/Accessories/ElementalQuiver.cs +++ b/Items/Accessories/ElementalQuiver.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Accessories player.GetCritChance() += 5; player.magicQuiver = true; CalamityPlayer modPlayer = player.Calamity(); - modPlayer.artemisEmblem = true; + modPlayer.deadshotBrooch = true; modPlayer.rangedAmmoCost *= 0.8f; } @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Accessories { CreateRecipe(). AddRecipeGroup("QuiversGroup"). - AddIngredient(). + AddIngredient(). AddIngredient(ItemID.LunarBar, 8). AddIngredient(4). AddIngredient(4). diff --git a/Items/Accessories/FlameLickedShell.cs b/Items/Accessories/FlameLickedShell.cs index 5685a25882..9e99720081 100644 --- a/Items/Accessories/FlameLickedShell.cs +++ b/Items/Accessories/FlameLickedShell.cs @@ -6,6 +6,7 @@ using Terraria.ID; namespace CalamityMod.Items.Accessories { + [LegacyName("FabledTortoiseShell")] public class FlameLickedShell : ModItem { public override void SetStaticDefaults() diff --git a/Items/Accessories/OldDukeScales.cs b/Items/Accessories/OldDukeScales.cs index fbcde0ff12..24496581bc 100644 --- a/Items/Accessories/OldDukeScales.cs +++ b/Items/Accessories/OldDukeScales.cs @@ -4,6 +4,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { + [LegacyName("DukeScales")] public class OldDukeScales : ModItem { public override void SetStaticDefaults() diff --git a/Items/Accessories/OrnateShield.cs b/Items/Accessories/OrnateShield.cs index 746be83076..82dcffd96a 100644 --- a/Items/Accessories/OrnateShield.cs +++ b/Items/Accessories/OrnateShield.cs @@ -32,9 +32,9 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { - if ((player.armor[0].type == ModContent.ItemType() || player.armor[0].type == ModContent.ItemType() || - player.armor[0].type == ModContent.ItemType() || player.armor[0].type == ModContent.ItemType() || - player.armor[0].type == ModContent.ItemType()) && + if ((player.armor[0].type == ModContent.ItemType() || player.armor[0].type == ModContent.ItemType() || + player.armor[0].type == ModContent.ItemType() || player.armor[0].type == ModContent.ItemType() || + player.armor[0].type == ModContent.ItemType()) && player.armor[1].type == ModContent.ItemType() && player.armor[2].type == ModContent.ItemType()) { player.endurance += 0.08f; diff --git a/Items/Accessories/ShatteredCommunity.cs b/Items/Accessories/ShatteredCommunity.cs index 2f9fb0e317..c1bbda5f7e 100644 --- a/Items/Accessories/ShatteredCommunity.cs +++ b/Items/Accessories/ShatteredCommunity.cs @@ -1,14 +1,16 @@ -using CalamityMod.CalPlayer; -using Microsoft.Xna.Framework; -using System.Collections.Generic; +using System.Collections.Generic; using System.IO; +using System.Linq; using System.Text; +using CalamityMod.CalPlayer; +using CalamityMod.World; +using Microsoft.Xna.Framework; using Terraria; +using Terraria.Audio; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; using Terraria.ModLoader.IO; -using Terraria.Audio; namespace CalamityMod.Items.Accessories { @@ -155,6 +157,11 @@ namespace CalamityMod.Items.Accessories // Stat tooltips are added dynamically. StringBuilder sb = new StringBuilder(256); + // Line 1: If not on Rev+, note that the accessory enables Rage. + TooltipLine rageOverTimeLine = tooltips.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip1"); + if (rageOverTimeLine != null && !CalamityWorld.revenge) + rageOverTimeLine.Text = "Adds the Rage meter\n" + rageOverTimeLine.Text; + // Line 6: Current level sb.Append("Current level: "); sb.Append(level); diff --git a/Items/Accessories/SpelunkersAmulet.cs b/Items/Accessories/SpelunkersAmulet.cs index 786ca988cb..c047503d4e 100644 --- a/Items/Accessories/SpelunkersAmulet.cs +++ b/Items/Accessories/SpelunkersAmulet.cs @@ -4,6 +4,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { + [LegacyName("ChaosAmulet")] public class SpelunkersAmulet : ModItem { public override void SetStaticDefaults() diff --git a/Items/Accessories/SpiritGlyph.cs b/Items/Accessories/SpiritGlyph.cs index 6a54cbf97a..e571d4e325 100644 --- a/Items/Accessories/SpiritGlyph.cs +++ b/Items/Accessories/SpiritGlyph.cs @@ -5,6 +5,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { + [LegacyName("SpiritGenerator")] public class SpiritGlyph : ModItem { public override void SetStaticDefaults() diff --git a/Items/Accessories/StatisVoidSash.cs b/Items/Accessories/StatisVoidSash.cs index dd61fffbb6..3254f647ba 100644 --- a/Items/Accessories/StatisVoidSash.cs +++ b/Items/Accessories/StatisVoidSash.cs @@ -8,6 +8,7 @@ using CalamityMod.CalPlayer.Dashes; namespace CalamityMod.Items.Accessories { + [LegacyName("StatisBeltofCurses")] public class StatisVoidSash : ModItem { public override void SetStaticDefaults() @@ -39,7 +40,7 @@ namespace CalamityMod.Items.Accessories player.jumpSpeedBoost += 0.6f; player.noFallDmg = true; player.blackBelt = true; - modPlayer.DashID = StatisBeltOfCursesDash.ID; + modPlayer.DashID = StatisVoidSashDash.ID; player.dash = 0; player.spikedBoots = 2; } diff --git a/Items/Accessories/TheSponge.cs b/Items/Accessories/TheSponge.cs index 95c5e97f11..84f07088ac 100644 --- a/Items/Accessories/TheSponge.cs +++ b/Items/Accessories/TheSponge.cs @@ -11,6 +11,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { + [LegacyName("Sponge")] public class TheSponge : ModItem { public override string Texture => (DateTime.Now.Month == 4 && DateTime.Now.Day == 1) ? "CalamityMod/Items/Accessories/TheSpongeReal" : "CalamityMod/Items/Accessories/TheSponge"; diff --git a/Items/Accessories/UnstableGraniteCore.cs b/Items/Accessories/UnstableGraniteCore.cs index acb52ceaae..a378f243a4 100644 --- a/Items/Accessories/UnstableGraniteCore.cs +++ b/Items/Accessories/UnstableGraniteCore.cs @@ -6,6 +6,7 @@ using Terraria.DataStructures; namespace CalamityMod.Items.Accessories { + [LegacyName("UnstablePrism")] public class UnstableGraniteCore : ModItem { public override void SetStaticDefaults() diff --git a/Items/Accessories/VoidofCalamity.cs b/Items/Accessories/VoidofCalamity.cs index b6ce55bac5..f1b953e39a 100644 --- a/Items/Accessories/VoidofCalamity.cs +++ b/Items/Accessories/VoidofCalamity.cs @@ -6,6 +6,7 @@ using Terraria.ID; namespace CalamityMod.Items.Accessories { + [LegacyName("CalamityRing")] public class VoidofCalamity : ModItem { public override void SetStaticDefaults() diff --git a/Items/Accessories/WarbanneroftheSun.cs b/Items/Accessories/WarbanneroftheSun.cs index 17a164d58d..643d30801b 100644 --- a/Items/Accessories/WarbanneroftheSun.cs +++ b/Items/Accessories/WarbanneroftheSun.cs @@ -9,6 +9,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { [AutoloadEquip(EquipType.Balloon)] + [LegacyName("SamuraiBadge")] public class WarbanneroftheSun : ModItem { internal const float MaxBonus = 0.2f; diff --git a/Items/Accessories/Wings/AureateBooster.cs b/Items/Accessories/Wings/AureateBooster.cs index f73d293c3c..c88f54c59c 100644 --- a/Items/Accessories/Wings/AureateBooster.cs +++ b/Items/Accessories/Wings/AureateBooster.cs @@ -10,6 +10,7 @@ using Terraria.DataStructures; namespace CalamityMod.Items.Accessories.Wings { [AutoloadEquip(EquipType.Wings)] + [LegacyName("AureateWings")] public class AureateBooster : ModItem { public override void SetStaticDefaults() diff --git a/Items/Accessories/Wings/HadalMantle.cs b/Items/Accessories/Wings/HadalMantle.cs index 63738c735c..f2d6504d18 100644 --- a/Items/Accessories/Wings/HadalMantle.cs +++ b/Items/Accessories/Wings/HadalMantle.cs @@ -10,6 +10,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Accessories.Wings { [AutoloadEquip(EquipType.Wings)] + [LegacyName("DiscordianWings")] public class HadalMantle : ModItem { public override void SetStaticDefaults() @@ -36,10 +37,10 @@ namespace CalamityMod.Items.Accessories.Wings public override void UpdateAccessory(Player player, bool hideVisual) { - if ((player.armor[0].type == ModContent.ItemType() || player.armor[0].type == ModContent.ItemType() || - player.armor[0].type == ModContent.ItemType() || player.armor[0].type == ModContent.ItemType() || - player.armor[0].type == ModContent.ItemType()) && - player.armor[1].type == ModContent.ItemType() && player.armor[2].type == ModContent.ItemType()) + if ((player.armor[0].type == ModContent.ItemType() || player.armor[0].type == ModContent.ItemType() || + player.armor[0].type == ModContent.ItemType() || player.armor[0].type == ModContent.ItemType() || + player.armor[0].type == ModContent.ItemType()) && + player.armor[1].type == ModContent.ItemType() && player.armor[2].type == ModContent.ItemType()) { player.GetDamage() += 0.05f; } diff --git a/Items/Accessories/Wings/SeraphTracers.cs b/Items/Accessories/Wings/SeraphTracers.cs index a80a788a08..f8d81e3968 100644 --- a/Items/Accessories/Wings/SeraphTracers.cs +++ b/Items/Accessories/Wings/SeraphTracers.cs @@ -10,6 +10,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Accessories.Wings { [AutoloadEquip(EquipType.Wings, EquipType.Shoes)] + [LegacyName("InfinityBoots")] public class SeraphTracers : ModItem { public override void SetStaticDefaults() diff --git a/Items/Accessories/Wings/StarlightWings.cs b/Items/Accessories/Wings/StarlightWings.cs index 5bdb79e494..ab44067b33 100644 --- a/Items/Accessories/Wings/StarlightWings.cs +++ b/Items/Accessories/Wings/StarlightWings.cs @@ -36,9 +36,9 @@ namespace CalamityMod.Items.Accessories.Wings public override void UpdateAccessory(Player player, bool hideVisual) { - if ((player.armor[0].type == ModContent.ItemType() || player.armor[0].type == ModContent.ItemType() || - player.armor[0].type == ModContent.ItemType() || player.armor[0].type == ModContent.ItemType() || - player.armor[0].type == ModContent.ItemType()) && + if ((player.armor[0].type == ModContent.ItemType() || player.armor[0].type == ModContent.ItemType() || + player.armor[0].type == ModContent.ItemType() || player.armor[0].type == ModContent.ItemType() || + player.armor[0].type == ModContent.ItemType()) && player.armor[1].type == ModContent.ItemType() && player.armor[2].type == ModContent.ItemType()) { player.GetDamage() += 0.05f; diff --git a/Items/Ammo/AccelerationRound.cs b/Items/Ammo/AccelerationRound.cs index 6ab873cdff..0a6aa526ea 100644 --- a/Items/Ammo/AccelerationRound.cs +++ b/Items/Ammo/AccelerationRound.cs @@ -6,6 +6,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Ammo { + [LegacyName("AccelerationBullet")] public class AccelerationRound : ModItem { public override void SetStaticDefaults() diff --git a/Items/Ammo/AcidRound.cs b/Items/Ammo/AcidRound.cs index 016ece855b..9f74c0d4ef 100644 --- a/Items/Ammo/AcidRound.cs +++ b/Items/Ammo/AcidRound.cs @@ -6,6 +6,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Ammo { + [LegacyName("AcidBullet")] public class AcidRound : ModItem { public override void SetStaticDefaults() diff --git a/Items/Ammo/FlashRound.cs b/Items/Ammo/FlashRound.cs index 12faf976a7..c6d16ff54d 100644 --- a/Items/Ammo/FlashRound.cs +++ b/Items/Ammo/FlashRound.cs @@ -5,6 +5,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Ammo { + [LegacyName("FlashBullet")] public class FlashRound : ModItem { public override void SetStaticDefaults() diff --git a/Items/Armor/AuricTeslaHelm.cs b/Items/Armor/AuricTeslaRoyalHelm.cs similarity index 97% rename from Items/Armor/AuricTeslaHelm.cs rename to Items/Armor/AuricTeslaRoyalHelm.cs index eb97251128..1367b890db 100644 --- a/Items/Armor/AuricTeslaHelm.cs +++ b/Items/Armor/AuricTeslaRoyalHelm.cs @@ -9,7 +9,8 @@ using CalamityMod.CalPlayer.Dashes; namespace CalamityMod.Items.Armor { [AutoloadEquip(EquipType.Head)] - public class AuricTeslaHelm : ModItem + [LegacyName("AuricTeslaHelm")] + public class AuricTeslaRoyalHelm : ModItem { public override void SetStaticDefaults() { diff --git a/Items/Armor/AuricTeslaHelm.png b/Items/Armor/AuricTeslaRoyalHelm.png similarity index 100% rename from Items/Armor/AuricTeslaHelm.png rename to Items/Armor/AuricTeslaRoyalHelm.png diff --git a/Items/Armor/AuricTeslaHelm_Head.png b/Items/Armor/AuricTeslaRoyalHelm_Head.png similarity index 100% rename from Items/Armor/AuricTeslaHelm_Head.png rename to Items/Armor/AuricTeslaRoyalHelm_Head.png diff --git a/Items/Armor/DaedalusHat.cs b/Items/Armor/DaedalusHeadMagic.cs similarity index 96% rename from Items/Armor/DaedalusHat.cs rename to Items/Armor/DaedalusHeadMagic.cs index d78d2ccdd4..c95c731b2d 100644 --- a/Items/Armor/DaedalusHat.cs +++ b/Items/Armor/DaedalusHeadMagic.cs @@ -7,7 +7,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Armor { [AutoloadEquip(EquipType.Head)] - public class DaedalusHat : ModItem + [LegacyName("DaedalusHat")] + public class DaedalusHeadMagic : ModItem { public override void SetStaticDefaults() { diff --git a/Items/Armor/DaedalusHat.png b/Items/Armor/DaedalusHeadMagic.png similarity index 100% rename from Items/Armor/DaedalusHat.png rename to Items/Armor/DaedalusHeadMagic.png diff --git a/Items/Armor/DaedalusHat_Head.png b/Items/Armor/DaedalusHeadMagic_Head.png similarity index 100% rename from Items/Armor/DaedalusHat_Head.png rename to Items/Armor/DaedalusHeadMagic_Head.png diff --git a/Items/Armor/DaedalusHelm.cs b/Items/Armor/DaedalusHeadMelee.cs similarity index 96% rename from Items/Armor/DaedalusHelm.cs rename to Items/Armor/DaedalusHeadMelee.cs index c85b51fa15..0eb1c5af30 100644 --- a/Items/Armor/DaedalusHelm.cs +++ b/Items/Armor/DaedalusHeadMelee.cs @@ -7,7 +7,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Armor { [AutoloadEquip(EquipType.Head)] - public class DaedalusHelm : ModItem + [LegacyName("DaedalusHelm")] + public class DaedalusHeadMelee : ModItem { public override void SetStaticDefaults() { diff --git a/Items/Armor/DaedalusHelm.png b/Items/Armor/DaedalusHeadMelee.png similarity index 100% rename from Items/Armor/DaedalusHelm.png rename to Items/Armor/DaedalusHeadMelee.png diff --git a/Items/Armor/DaedalusHelm_Head.png b/Items/Armor/DaedalusHeadMelee_Head.png similarity index 100% rename from Items/Armor/DaedalusHelm_Head.png rename to Items/Armor/DaedalusHeadMelee_Head.png diff --git a/Items/Armor/DaedalusHelmet.cs b/Items/Armor/DaedalusHeadRanged.cs similarity index 96% rename from Items/Armor/DaedalusHelmet.cs rename to Items/Armor/DaedalusHeadRanged.cs index 39c7af4a53..3f2e878d1a 100644 --- a/Items/Armor/DaedalusHelmet.cs +++ b/Items/Armor/DaedalusHeadRanged.cs @@ -7,7 +7,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Armor { [AutoloadEquip(EquipType.Head)] - public class DaedalusHelmet : ModItem + [LegacyName("DaedalusHelmet")] + public class DaedalusHeadRanged : ModItem { public override void SetStaticDefaults() { diff --git a/Items/Armor/DaedalusHelmet.png b/Items/Armor/DaedalusHeadRanged.png similarity index 100% rename from Items/Armor/DaedalusHelmet.png rename to Items/Armor/DaedalusHeadRanged.png diff --git a/Items/Armor/DaedalusHelmet_Head.png b/Items/Armor/DaedalusHeadRanged_Head.png similarity index 100% rename from Items/Armor/DaedalusHelmet_Head.png rename to Items/Armor/DaedalusHeadRanged_Head.png diff --git a/Items/Armor/DaedalusVisor.cs b/Items/Armor/DaedalusHeadRogue.cs similarity index 97% rename from Items/Armor/DaedalusVisor.cs rename to Items/Armor/DaedalusHeadRogue.cs index 4da76e7576..09296affeb 100644 --- a/Items/Armor/DaedalusVisor.cs +++ b/Items/Armor/DaedalusHeadRogue.cs @@ -7,7 +7,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Armor { [AutoloadEquip(EquipType.Head)] - public class DaedalusVisor : ModItem + [LegacyName("DaedalusVisor")] + public class DaedalusHeadRogue : ModItem { public override void SetStaticDefaults() { diff --git a/Items/Armor/DaedalusVisor.png b/Items/Armor/DaedalusHeadRogue.png similarity index 100% rename from Items/Armor/DaedalusVisor.png rename to Items/Armor/DaedalusHeadRogue.png diff --git a/Items/Armor/DaedalusVisor_Head.png b/Items/Armor/DaedalusHeadRogue_Head.png similarity index 100% rename from Items/Armor/DaedalusVisor_Head.png rename to Items/Armor/DaedalusHeadRogue_Head.png diff --git a/Items/Armor/DaedalusHeadgear.cs b/Items/Armor/DaedalusHeadSummon.cs similarity index 97% rename from Items/Armor/DaedalusHeadgear.cs rename to Items/Armor/DaedalusHeadSummon.cs index 80d7a62216..fb30c969d6 100644 --- a/Items/Armor/DaedalusHeadgear.cs +++ b/Items/Armor/DaedalusHeadSummon.cs @@ -10,7 +10,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Armor { [AutoloadEquip(EquipType.Head)] - public class DaedalusHeadgear : ModItem + [LegacyName("DaedalusHeadgear")] + public class DaedalusHeadSummon : ModItem { public override void SetStaticDefaults() { diff --git a/Items/Armor/DaedalusHeadgear.png b/Items/Armor/DaedalusHeadSummon.png similarity index 100% rename from Items/Armor/DaedalusHeadgear.png rename to Items/Armor/DaedalusHeadSummon.png diff --git a/Items/Armor/DaedalusHeadgear_Head.png b/Items/Armor/DaedalusHeadSummon_Head.png similarity index 100% rename from Items/Armor/DaedalusHeadgear_Head.png rename to Items/Armor/DaedalusHeadSummon_Head.png diff --git a/Items/Armor/AtaxiaArmor.cs b/Items/Armor/HydrothermicArmor.cs similarity index 94% rename from Items/Armor/AtaxiaArmor.cs rename to Items/Armor/HydrothermicArmor.cs index 48742ab5d2..c150c03481 100644 --- a/Items/Armor/AtaxiaArmor.cs +++ b/Items/Armor/HydrothermicArmor.cs @@ -6,7 +6,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Armor { [AutoloadEquip(EquipType.Body)] - public class AtaxiaArmor : ModItem + [LegacyName("AtaxiaArmor")] + public class HydrothermicArmor : ModItem { public override void SetStaticDefaults() { diff --git a/Items/Armor/AtaxiaArmor.png b/Items/Armor/HydrothermicArmor.png similarity index 100% rename from Items/Armor/AtaxiaArmor.png rename to Items/Armor/HydrothermicArmor.png diff --git a/Items/Armor/AtaxiaArmor_Body.png b/Items/Armor/HydrothermicArmor_Body.png similarity index 100% rename from Items/Armor/AtaxiaArmor_Body.png rename to Items/Armor/HydrothermicArmor_Body.png diff --git a/Items/Armor/AtaxiaMask.cs b/Items/Armor/HydrothermicHeadMagic.cs similarity index 91% rename from Items/Armor/AtaxiaMask.cs rename to Items/Armor/HydrothermicHeadMagic.cs index 2095d45546..4a62e56a61 100644 --- a/Items/Armor/AtaxiaMask.cs +++ b/Items/Armor/HydrothermicHeadMagic.cs @@ -7,7 +7,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Armor { [AutoloadEquip(EquipType.Head)] - public class AtaxiaMask : ModItem + [LegacyName("AtaxiaMask")] + public class HydrothermicHeadMagic : ModItem { public override void SetStaticDefaults() { @@ -28,7 +29,7 @@ namespace CalamityMod.Items.Armor public override bool IsArmorSet(Item head, Item body, Item legs) { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); + return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); } public override void ArmorSetShadows(Player player) diff --git a/Items/Armor/AtaxiaMask.png b/Items/Armor/HydrothermicHeadMagic.png similarity index 100% rename from Items/Armor/AtaxiaMask.png rename to Items/Armor/HydrothermicHeadMagic.png diff --git a/Items/Armor/AtaxiaMask_Head.png b/Items/Armor/HydrothermicHeadMagic_Head.png similarity index 100% rename from Items/Armor/AtaxiaMask_Head.png rename to Items/Armor/HydrothermicHeadMagic_Head.png diff --git a/Items/Armor/AtaxiaHelm.cs b/Items/Armor/HydrothermicHeadMelee.cs similarity index 92% rename from Items/Armor/AtaxiaHelm.cs rename to Items/Armor/HydrothermicHeadMelee.cs index 4f170a7003..a26611b0d2 100644 --- a/Items/Armor/AtaxiaHelm.cs +++ b/Items/Armor/HydrothermicHeadMelee.cs @@ -7,7 +7,9 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Armor { [AutoloadEquip(EquipType.Head)] - public class AtaxiaHelm : ModItem + [LegacyName("AtaxiaHelm")] + + public class HydrothermicHeadMelee : ModItem { public override void SetStaticDefaults() { @@ -30,7 +32,7 @@ namespace CalamityMod.Items.Armor public override bool IsArmorSet(Item head, Item body, Item legs) { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); + return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); } public override void ArmorSetShadows(Player player) diff --git a/Items/Armor/AtaxiaHelm.png b/Items/Armor/HydrothermicHeadMelee.png similarity index 100% rename from Items/Armor/AtaxiaHelm.png rename to Items/Armor/HydrothermicHeadMelee.png diff --git a/Items/Armor/AtaxiaHelm_Head.png b/Items/Armor/HydrothermicHeadMelee_Head.png similarity index 100% rename from Items/Armor/AtaxiaHelm_Head.png rename to Items/Armor/HydrothermicHeadMelee_Head.png diff --git a/Items/Armor/AtaxiaHeadgear.cs b/Items/Armor/HydrothermicHeadRanged.cs similarity index 91% rename from Items/Armor/AtaxiaHeadgear.cs rename to Items/Armor/HydrothermicHeadRanged.cs index 074f53ba72..8d6f142c0e 100644 --- a/Items/Armor/AtaxiaHeadgear.cs +++ b/Items/Armor/HydrothermicHeadRanged.cs @@ -7,7 +7,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Armor { [AutoloadEquip(EquipType.Head)] - public class AtaxiaHeadgear : ModItem + [LegacyName("AtaxiaHeadgear")] + public class HydrothermicHeadRanged : ModItem { public override void SetStaticDefaults() { @@ -28,7 +29,7 @@ namespace CalamityMod.Items.Armor public override bool IsArmorSet(Item head, Item body, Item legs) { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); + return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); } public override void ArmorSetShadows(Player player) diff --git a/Items/Armor/AtaxiaHeadgear.png b/Items/Armor/HydrothermicHeadRanged.png similarity index 100% rename from Items/Armor/AtaxiaHeadgear.png rename to Items/Armor/HydrothermicHeadRanged.png diff --git a/Items/Armor/AtaxiaHeadgear_Head.png b/Items/Armor/HydrothermicHeadRanged_Head.png similarity index 100% rename from Items/Armor/AtaxiaHeadgear_Head.png rename to Items/Armor/HydrothermicHeadRanged_Head.png diff --git a/Items/Armor/AtaxiaHood.cs b/Items/Armor/HydrothermicHeadRogue.cs similarity index 93% rename from Items/Armor/AtaxiaHood.cs rename to Items/Armor/HydrothermicHeadRogue.cs index e7ccbd7f2c..6b80031169 100644 --- a/Items/Armor/AtaxiaHood.cs +++ b/Items/Armor/HydrothermicHeadRogue.cs @@ -7,7 +7,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Armor { [AutoloadEquip(EquipType.Head)] - public class AtaxiaHood : ModItem + [LegacyName("AtaxiaHood")] + public class HydrothermicHeadRogue : ModItem { public override void SetStaticDefaults() { @@ -29,7 +30,7 @@ namespace CalamityMod.Items.Armor public override bool IsArmorSet(Item head, Item body, Item legs) { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); + return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); } public override void ArmorSetShadows(Player player) diff --git a/Items/Armor/AtaxiaHood.png b/Items/Armor/HydrothermicHeadRogue.png similarity index 100% rename from Items/Armor/AtaxiaHood.png rename to Items/Armor/HydrothermicHeadRogue.png diff --git a/Items/Armor/AtaxiaHood_Head.png b/Items/Armor/HydrothermicHeadRogue_Head.png similarity index 100% rename from Items/Armor/AtaxiaHood_Head.png rename to Items/Armor/HydrothermicHeadRogue_Head.png diff --git a/Items/Armor/AtaxiaHelmet.cs b/Items/Armor/HydrothermicHeadSummon.cs similarity index 93% rename from Items/Armor/AtaxiaHelmet.cs rename to Items/Armor/HydrothermicHeadSummon.cs index 5987f852bd..4c316bd6cb 100644 --- a/Items/Armor/AtaxiaHelmet.cs +++ b/Items/Armor/HydrothermicHeadSummon.cs @@ -9,7 +9,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Armor { [AutoloadEquip(EquipType.Head)] - public class AtaxiaHelmet : ModItem + [LegacyName("AtaxiaHelmet")] + public class HydrothermicHeadSummon : ModItem { public override void SetStaticDefaults() { @@ -30,7 +31,7 @@ namespace CalamityMod.Items.Armor public override bool IsArmorSet(Item head, Item body, Item legs) { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); + return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); } public override void ArmorSetShadows(Player player) diff --git a/Items/Armor/AtaxiaHelmet.png b/Items/Armor/HydrothermicHeadSummon.png similarity index 100% rename from Items/Armor/AtaxiaHelmet.png rename to Items/Armor/HydrothermicHeadSummon.png diff --git a/Items/Armor/AtaxiaHelmet_Head.png b/Items/Armor/HydrothermicHeadSummon_Head.png similarity index 100% rename from Items/Armor/AtaxiaHelmet_Head.png rename to Items/Armor/HydrothermicHeadSummon_Head.png diff --git a/Items/Armor/AtaxiaSubligar.cs b/Items/Armor/HydrothermicSubligar.cs similarity index 93% rename from Items/Armor/AtaxiaSubligar.cs rename to Items/Armor/HydrothermicSubligar.cs index 4639e1d5e2..cee2e99f1c 100644 --- a/Items/Armor/AtaxiaSubligar.cs +++ b/Items/Armor/HydrothermicSubligar.cs @@ -6,7 +6,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Armor { [AutoloadEquip(EquipType.Legs)] - public class AtaxiaSubligar : ModItem + [LegacyName("AtaxiaSubligar")] + public class HydrothermicSubligar : ModItem { public override void SetStaticDefaults() { diff --git a/Items/Armor/AtaxiaSubligar.png b/Items/Armor/HydrothermicSubligar.png similarity index 100% rename from Items/Armor/AtaxiaSubligar.png rename to Items/Armor/HydrothermicSubligar.png diff --git a/Items/Armor/AtaxiaSubligar_Legs.png b/Items/Armor/HydrothermicSubligar_Legs.png similarity index 100% rename from Items/Armor/AtaxiaSubligar_Legs.png rename to Items/Armor/HydrothermicSubligar_Legs.png diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 883be5ab78..539880775f 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -396,8 +396,8 @@ namespace CalamityMod.Items } if (modPlayer.victideSet) { - if ((item.CountsAsClass() || item.CountsAsClass() || item.CountsAsClass() || - item.CountsAsClass() || item.CountsAsClass()) && + if ((item.CountsAsClass() || item.CountsAsClass() || item.CountsAsClass() || + item.CountsAsClass() || item.CountsAsClass()) && Main.rand.NextBool(10)) { if (player.whoAmI == Main.myPlayer) @@ -505,7 +505,7 @@ namespace CalamityMod.Items tag.Add("canFirePointBlankShots", canFirePointBlankShots); tag.Add("trueMelee", trueMelee); } - + public override void LoadData(Item item, TagCompound tag) { canFirePointBlankShots = tag.GetBool("canFirePointBlankShots"); @@ -1733,678 +1733,277 @@ namespace CalamityMod.Items int prefix = -2; if (item.accessory) { - if (Main.player[Main.myPlayer].Calamity().finalTierAccessoryReforge) + if (Main.LocalPlayer.Calamity().finalTierAccessoryReforge) { // Warding = 18, Menacing = 19, Quick = 20, Violent = 21, Lucky = 22, Silent = 23 prefix = Main.rand.Next(18, 24); } else { - switch (reforgeTier) + prefix = reforgeTier switch { - case 0: - break; - case 1: - // Hard = 1, Jagged = 2, Brisk = 3, Wild = 4, Quiet = 5 - prefix = Main.rand.Next(1, 6); - break; - case 2: - // Guarding = 6, Spiked = 7, Fleeting = 8, Rash = 9, Cloaked = 10 - prefix = Main.rand.Next(6, 11); - break; - case 3: - // Precise = 11, Arcane = 12 - prefix = Main.rand.Next(11, 13); - break; - case 4: - // Armored = 13, Angry = 14, Hasty = 15, Intrepid = 16, Camouflaged = 17 - prefix = Main.rand.Next(13, 18); - break; - case 5: - case 6: - // Warding = 18, Menacing = 19, Quick = 20, Violent = 21, Lucky = 22, Silent = 23 - prefix = Main.rand.Next(18, 24); - break; - } + 1 => Main.rand.Next(1, 6), // Hard = 1, Jagged = 2, Brisk = 3, Wild = 4, Quiet = 5 + 2 => Main.rand.Next(6, 11), // Guarding = 6, Spiked = 7, Fleeting = 8, Rash = 9, Cloaked = 10 + 3 => Main.rand.Next(11, 13), // Precise = 11, Arcane = 12 + 4 => Main.rand.Next(13, 18), // Armored = 13, Angry = 14, Hasty = 15, Intrepid = 16, Camouflaged = 17 + 5 or 6 => Main.rand.Next(18, 24), // Warding = 18, Menacing = 19, Quick = 20, Violent = 21, Lucky = 22, Silent = 23 + _ => prefix + }; } - switch (prefix) + + prefix = prefix switch { - case -2: - break; - case 1: - prefix = PrefixID.Hard; - break; - case 2: - prefix = PrefixID.Jagged; - break; - case 3: - prefix = PrefixID.Brisk; - break; - case 4: - prefix = PrefixID.Wild; - break; - case 5: - prefix = Mod.Find("Quiet").Type; - break; - case 6: - prefix = PrefixID.Guarding; - break; - case 7: - prefix = PrefixID.Spiked; - break; - case 8: - prefix = PrefixID.Fleeting; - break; - case 9: - prefix = PrefixID.Rash; - break; - case 10: - prefix = Mod.Find("Cloaked").Type; - break; - case 11: - prefix = PrefixID.Precise; - break; - case 12: - prefix = PrefixID.Arcane; - break; - case 13: - prefix = PrefixID.Armored; - break; - case 14: - prefix = PrefixID.Angry; - break; - case 15: - prefix = PrefixID.Hasty2; - break; - case 16: - prefix = PrefixID.Intrepid; - break; - case 17: - prefix = Mod.Find("Camouflaged").Type; - break; - case 18: - prefix = PrefixID.Warding; - break; - case 19: - prefix = PrefixID.Menacing; - break; - case 20: - prefix = PrefixID.Quick2; - break; - case 21: - prefix = PrefixID.Violent; - break; - case 22: - prefix = PrefixID.Lucky; - break; - case 23: - prefix = Mod.Find("Silent").Type; - break; - } + 1 => PrefixID.Hard, + 2 => PrefixID.Jagged, + 3 => PrefixID.Brisk, + 4 => PrefixID.Wild, + 5 => Mod.Find("Quiet").Type, + 6 => PrefixID.Guarding, + 7 => PrefixID.Spiked, + 8 => PrefixID.Fleeting, + 9 => PrefixID.Rash, + 10 => Mod.Find("Cloaked").Type, + 11 => PrefixID.Precise, + 12 => PrefixID.Arcane, + 13 => PrefixID.Armored, + 14 => PrefixID.Angry, + 15 => PrefixID.Hasty2, + 16 => PrefixID.Intrepid, + 17 => Mod.Find("Camouflaged").Type, + 18 => PrefixID.Warding, + 19 => PrefixID.Menacing, + 20 => PrefixID.Quick2, + 21 => PrefixID.Violent, + 22 => PrefixID.Lucky, + 23 => Mod.Find("Silent").Type, + _ => prefix, + }; } else if (item.CountsAsClass()) { // Yoyos, Flails, Spears, etc. if (item.channel || item.noMelee) { - switch (reforgeTier) + prefix = reforgeTier switch { - case 0: - break; - case 1: - // Keen = 1, Ruthless = 2 - prefix = Main.rand.Next(1, 3); - break; - case 2: - // Hurtful = 3, Zealous = 4 - prefix = Main.rand.Next(3, 5); - break; - case 3: - // Forceful = 5, Strong = 6 - prefix = Main.rand.Next(5, 7); - break; - case 4: - // Demonic = 7 - prefix = 7; - break; - case 5: - // Superior = 8 - prefix = 8; - break; - case 6: - // Godly = 9 - prefix = 9; - break; - } - switch (prefix) + 1 => Main.rand.Next(1, 3),// Keen = 1, Ruthless = 2 + 2 => Main.rand.Next(3, 5),// Hurtful = 3, Zealous = 4 + 3 => Main.rand.Next(5, 7),// Forceful = 5, Strong = 6 + 4 => 7,// Demonic = 7 + 5 => 8,// Superior = 8 + 6 => 9,// Godly = 9 + _ => prefix, + }; + + prefix = prefix switch { - case -2: - break; - case 1: - prefix = PrefixID.Keen; - break; - case 2: - prefix = PrefixID.Ruthless; - break; - case 3: - prefix = PrefixID.Hurtful; - break; - case 4: - prefix = PrefixID.Zealous; - break; - case 5: - prefix = PrefixID.Forceful; - break; - case 6: - prefix = PrefixID.Strong; - break; - case 7: - prefix = PrefixID.Demonic; - break; - case 8: - prefix = PrefixID.Superior; - break; - case 9: - prefix = PrefixID.Godly; - break; - } + 1 => PrefixID.Keen, + 2 => PrefixID.Ruthless, + 3 => PrefixID.Hurtful, + 4 => PrefixID.Zealous, + 5 => PrefixID.Forceful, + 6 => PrefixID.Strong, + 7 => PrefixID.Demonic, + 8 => PrefixID.Superior, + 9 => PrefixID.Godly, + _ => prefix, + }; } // All other melee weapons else { - switch (reforgeTier) + prefix = reforgeTier switch { - case 0: - break; - case 1: - // Keen = 1, Ruthless = 2, Nimble = 3, Nasty = 4, Heavy = 5, Light = 6 - prefix = Main.rand.Next(1, 7); - break; - case 2: - // Hurtful = 7, Zealous = 8, Quick = 9, Pointy = 10, Bulky = 11 - prefix = Main.rand.Next(7, 12); - break; - case 3: - // Forceful = 12, Strong = 13, Agile = 14, Large = 15, Dangerous = 16, Sharp = 17 - prefix = Main.rand.Next(12, 18); - break; - case 4: - // Murderous = 18, Massive = 19, Unpleasant = 20, Deadly2 = 21 - prefix = Main.rand.Next(18, 22); - break; - case 5: - // Superior = 22, Demonic = 23, Savage = 24 - prefix = Main.rand.Next(22, 25); - break; - case 6: - // Legendary = 25, Light = 6 ~We are tool friendly (= - if (item.pick > 0 || item.axe > 0 || item.hammer > 0) - prefix = Main.rand.NextBool() ? 25 : 6; - else - prefix = 25; - break; - } - switch (prefix) + 1 => Main.rand.Next(1, 7),// Keen = 1, Ruthless = 2, Nimble = 3, Nasty = 4, Heavy = 5, Light = 6 + 2 => Main.rand.Next(7, 12),// Hurtful = 7, Zealous = 8, Quick = 9, Pointy = 10, Bulky = 11 + 3 => Main.rand.Next(12, 18),// Forceful = 12, Strong = 13, Agile = 14, Large = 15, Dangerous = 16, Sharp = 17 + 4 => Main.rand.Next(18, 22),// Murderous = 18, Massive = 19, Unpleasant = 20, Deadly2 = 21 + 5 => Main.rand.Next(22, 25),// Superior = 22, Demonic = 23, Savage = 24 + 6 => item.pick > 0 || item.axe > 0 || item.hammer > 0 ? (Main.rand.NextBool() ? 25 : 6) : 25,// Legendary = 25, Light = 6 ~We are tool friendly (= + _ => prefix, + }; + + prefix = prefix switch { - case -2: - break; - case 1: - prefix = PrefixID.Keen; - break; - case 2: - prefix = PrefixID.Ruthless; - break; - case 3: - prefix = PrefixID.Nimble; - break; - case 4: - prefix = PrefixID.Nasty; - break; - case 5: - prefix = PrefixID.Heavy; - break; - case 6: - prefix = PrefixID.Light; - break; - case 7: - prefix = PrefixID.Hurtful; - break; - case 8: - prefix = PrefixID.Zealous; - break; - case 9: - prefix = PrefixID.Quick; - break; - case 10: - prefix = PrefixID.Pointy; - break; - case 11: - prefix = PrefixID.Bulky; - break; - case 12: - prefix = PrefixID.Forceful; - break; - case 13: - prefix = PrefixID.Strong; - break; - case 14: - prefix = PrefixID.Agile; - break; - case 15: - prefix = PrefixID.Large; - break; - case 16: - prefix = PrefixID.Dangerous; - break; - case 17: - prefix = PrefixID.Sharp; - break; - case 18: - prefix = PrefixID.Murderous; - break; - case 19: - prefix = PrefixID.Massive; - break; - case 20: - prefix = PrefixID.Unpleasant; - break; - case 21: - prefix = PrefixID.Deadly2; - break; - case 22: - prefix = PrefixID.Superior; - break; - case 23: - prefix = PrefixID.Demonic; - break; - case 24: - prefix = PrefixID.Savage; - break; - case 25: - prefix = PrefixID.Legendary; - break; - } + 1 => PrefixID.Keen, + 2 => PrefixID.Ruthless, + 3 => PrefixID.Nimble, + 4 => PrefixID.Nasty, + 5 => PrefixID.Heavy, + 6 => PrefixID.Light, + 7 => PrefixID.Hurtful, + 8 => PrefixID.Zealous, + 9 => PrefixID.Quick, + 10 => PrefixID.Pointy, + 11 => PrefixID.Bulky, + 12 => PrefixID.Forceful, + 13 => PrefixID.Strong, + 14 => PrefixID.Agile, + 15 => PrefixID.Large, + 16 => PrefixID.Dangerous, + 17 => PrefixID.Sharp, + 18 => PrefixID.Murderous, + 19 => PrefixID.Massive, + 20 => PrefixID.Unpleasant, + 21 => PrefixID.Deadly2, + 22 => PrefixID.Superior, + 23 => PrefixID.Demonic, + 24 => PrefixID.Savage, + 25 => PrefixID.Legendary, + _ => prefix, + }; } } else if (item.CountsAsClass()) { - switch (reforgeTier) + prefix = reforgeTier switch { - case 0: - break; - case 1: - // Keen = 1, Ruthless = 2, Nimble = 3, Nasty = 4, Powerful = 5 - prefix = Main.rand.Next(1, 6); - break; - case 2: - // Hurtful = 6, Zealous = 7, Quick = 8 - prefix = Main.rand.Next(6, 9); - break; - case 3: - // Forceful = 9, Strong = 10, Agile = 11, Sighted = 12, Murderous = 13 - prefix = Main.rand.Next(9, 14); - break; - case 4: - // Superior = 14, Demonic = 15, Deadly2 = 16, Intimidating = 17, Unpleasant = 18 - prefix = Main.rand.Next(14, 19); - break; - case 5: - // Godly = 19, Rapid = 20, Hasty = 21, Deadly = 22, Staunch = 23 - prefix = Main.rand.Next(19, 24); - break; - case 6: - // Unreal = 24 - prefix = 24; - break; - } - switch (prefix) + 1 => Main.rand.Next(1, 6),// Keen = 1, Ruthless = 2, Nimble = 3, Nasty = 4, Powerful = 5 + 2 => Main.rand.Next(6, 9),// Hurtful = 6, Zealous = 7, Quick = 8 + 3 => Main.rand.Next(9, 14),// Forceful = 9, Strong = 10, Agile = 11, Sighted = 12, Murderous = 13 + 4 => Main.rand.Next(14, 19),// Superior = 14, Demonic = 15, Deadly2 = 16, Intimidating = 17, Unpleasant = 18 + 5 => Main.rand.Next(19, 24),// Godly = 19, Rapid = 20, Hasty = 21, Deadly = 22, Staunch = 23 + 6 => 24,// Unreal = 24 + _ => prefix, + }; + + prefix = prefix switch { - case -2: - break; - case 1: - prefix = PrefixID.Keen; - break; - case 2: - prefix = PrefixID.Ruthless; - break; - case 3: - prefix = PrefixID.Nimble; - break; - case 4: - prefix = PrefixID.Nasty; - break; - case 5: - prefix = PrefixID.Powerful; - break; - case 6: - prefix = PrefixID.Hurtful; - break; - case 7: - prefix = PrefixID.Zealous; - break; - case 8: - prefix = PrefixID.Quick; - break; - case 9: - prefix = PrefixID.Forceful; - break; - case 10: - prefix = PrefixID.Strong; - break; - case 11: - prefix = PrefixID.Agile; - break; - case 12: - prefix = PrefixID.Sighted; - break; - case 13: - prefix = PrefixID.Murderous; - break; - case 14: - prefix = PrefixID.Superior; - break; - case 15: - prefix = PrefixID.Demonic; - break; - case 16: - prefix = PrefixID.Deadly2; - break; - case 17: - prefix = PrefixID.Intimidating; - break; - case 18: - prefix = PrefixID.Unpleasant; - break; - case 19: - prefix = PrefixID.Godly; - break; - case 20: - prefix = PrefixID.Rapid; - break; - case 21: - prefix = PrefixID.Hasty; - break; - case 22: - prefix = PrefixID.Deadly; - break; - case 23: - prefix = PrefixID.Staunch; - break; - case 24: - prefix = PrefixID.Unreal; - break; - } + 1 => PrefixID.Keen, + 2 => PrefixID.Ruthless, + 3 => PrefixID.Nimble, + 4 => PrefixID.Nasty, + 5 => PrefixID.Powerful, + 6 => PrefixID.Hurtful, + 7 => PrefixID.Zealous, + 8 => PrefixID.Quick, + 9 => PrefixID.Forceful, + 10 => PrefixID.Strong, + 11 => PrefixID.Agile, + 12 => PrefixID.Sighted, + 13 => PrefixID.Murderous, + 14 => PrefixID.Superior, + 15 => PrefixID.Demonic, + 16 => PrefixID.Deadly2, + 17 => PrefixID.Intimidating, + 18 => PrefixID.Unpleasant, + 19 => PrefixID.Godly, + 20 => PrefixID.Rapid, + 21 => PrefixID.Hasty, + 22 => PrefixID.Deadly, + 23 => PrefixID.Staunch, + 24 => PrefixID.Unreal, + _ => prefix, + }; } else if (item.CountsAsClass()) { - switch (reforgeTier) + prefix = reforgeTier switch { - case 0: - break; - case 1: - // Keen = 1, Ruthless = 2, Nimble = 3, Nasty = 4, Furious = 5 - prefix = Main.rand.Next(1, 6); - break; - case 2: - // Hurtful = 6, Zealous = 7, Quick = 8, Taboo = 9, Manic = 10 - prefix = Main.rand.Next(6, 11); - break; - case 3: - // Forceful = 11, Strong = 12, Agile = 13, Murderous = 14, Adept = 15, Celestial = 16 - prefix = Main.rand.Next(11, 17); - break; - case 4: - // Superior = 17, Demonic = 18, Deadly2 = 19, Mystic = 20 - prefix = Main.rand.Next(17, 21); - break; - case 5: - // Godly = 21, Masterful = 22 - prefix = Main.rand.Next(21, 23); - break; - case 6: - // Mythical = 23 - prefix = 23; - break; - } - switch (prefix) + 1 => Main.rand.Next(1, 6),// Keen = 1, Ruthless = 2, Nimble = 3, Nasty = 4, Furious = 5 + 2 => Main.rand.Next(6, 11),// Hurtful = 6, Zealous = 7, Quick = 8, Taboo = 9, Manic = 10 + 3 => Main.rand.Next(11, 17),// Forceful = 11, Strong = 12, Agile = 13, Murderous = 14, Adept = 15, Celestial = 16 + 4 => Main.rand.Next(17, 21),// Superior = 17, Demonic = 18, Deadly2 = 19, Mystic = 20 + 5 => Main.rand.Next(21, 23),// Godly = 21, Masterful = 22 + 6 => 23,// Mythical = 23 + _ => prefix, + }; + + prefix = prefix switch { - case -2: - break; - case 1: - prefix = PrefixID.Keen; - break; - case 2: - prefix = PrefixID.Ruthless; - break; - case 3: - prefix = PrefixID.Nimble; - break; - case 4: - prefix = PrefixID.Nasty; - break; - case 5: - prefix = PrefixID.Furious; - break; - case 6: - prefix = PrefixID.Hurtful; - break; - case 7: - prefix = PrefixID.Zealous; - break; - case 8: - prefix = PrefixID.Quick; - break; - case 9: - prefix = PrefixID.Taboo; - break; - case 10: - prefix = PrefixID.Manic; - break; - case 11: - prefix = PrefixID.Forceful; - break; - case 12: - prefix = PrefixID.Strong; - break; - case 13: - prefix = PrefixID.Agile; - break; - case 14: - prefix = PrefixID.Murderous; - break; - case 15: - prefix = PrefixID.Adept; - break; - case 16: - prefix = PrefixID.Celestial; - break; - case 17: - prefix = PrefixID.Superior; - break; - case 18: - prefix = PrefixID.Demonic; - break; - case 19: - prefix = PrefixID.Deadly2; - break; - case 20: - prefix = PrefixID.Mystic; - break; - case 21: - prefix = PrefixID.Godly; - break; - case 22: - prefix = PrefixID.Masterful; - break; - case 23: - prefix = PrefixID.Mythical; - break; - } + 1 => PrefixID.Keen, + 2 => PrefixID.Ruthless, + 3 => PrefixID.Nimble, + 4 => PrefixID.Nasty, + 5 => PrefixID.Furious, + 6 => PrefixID.Hurtful, + 7 => PrefixID.Zealous, + 8 => PrefixID.Quick, + 9 => PrefixID.Taboo, + 10 => PrefixID.Manic, + 11 => PrefixID.Forceful, + 12 => PrefixID.Strong, + 13 => PrefixID.Agile, + 14 => PrefixID.Murderous, + 15 => PrefixID.Adept, + 16 => PrefixID.Celestial, + 17 => PrefixID.Superior, + 18 => PrefixID.Demonic, + 19 => PrefixID.Deadly2, + 20 => PrefixID.Mystic, + 21 => PrefixID.Godly, + 22 => PrefixID.Masterful, + 23 => PrefixID.Mythical, + _ => prefix, + }; } else if (item.CountsAsClass()) { - switch (reforgeTier) + prefix = reforgeTier switch { - case 0: - break; - case 1: - // Nimble = 1, Furious = 2 - prefix = Main.rand.Next(1, 3); - break; - case 2: - // Hurtful = 3, Quick = 4, Taboo = 5, Manic = 6 - prefix = Main.rand.Next(3, 7); - break; - case 3: - // Forceful = 7, Strong = 8, Adept = 9, Celestial = 10 - prefix = Main.rand.Next(7, 11); - break; - case 4: - // Deadly2 = 11, Mystic = 12, Superior = 13, Demonic = 14 - prefix = Main.rand.Next(11, 15); - break; - case 5: - // Masterful = 15, Mythical = 16, Godly = 17 - prefix = Main.rand.Next(15, 18); - break; - case 6: - // Ruthless = 18 - prefix = 18; - break; - } - switch (prefix) + 1 => Main.rand.Next(1, 3),// Nimble = 1, Furious = 2 + 2 => Main.rand.Next(3, 7),// Hurtful = 3, Quick = 4, Taboo = 5, Manic = 6 + 3 => Main.rand.Next(7, 11),// Forceful = 7, Strong = 8, Adept = 9, Celestial = 10 + 4 => Main.rand.Next(11, 15),// Deadly2 = 11, Mystic = 12, Superior = 13, Demonic = 14 + 5 => Main.rand.Next(15, 18),// Masterful = 15, Mythical = 16, Godly = 17 + 6 => 18,// Ruthless = 18 + _ => prefix, + }; + + prefix = prefix switch { - case -2: - break; - case 1: - prefix = PrefixID.Nimble; - break; - case 2: - prefix = PrefixID.Furious; - break; - case 3: - prefix = PrefixID.Hurtful; - break; - case 4: - prefix = PrefixID.Quick; - break; - case 5: - prefix = PrefixID.Taboo; - break; - case 6: - prefix = PrefixID.Manic; - break; - case 7: - prefix = PrefixID.Forceful; - break; - case 8: - prefix = PrefixID.Strong; - break; - case 9: - prefix = PrefixID.Adept; - break; - case 10: - prefix = PrefixID.Celestial; - break; - case 11: - prefix = PrefixID.Deadly2; - break; - case 12: - prefix = PrefixID.Mystic; - break; - case 13: - prefix = PrefixID.Superior; - break; - case 14: - prefix = PrefixID.Demonic; - break; - case 15: - prefix = PrefixID.Masterful; - break; - case 16: - prefix = PrefixID.Mythical; - break; - case 17: - prefix = PrefixID.Godly; - break; - case 18: - prefix = PrefixID.Ruthless; - break; - } + 1 => PrefixID.Nimble, + 2 => PrefixID.Furious, + 3 => PrefixID.Hurtful, + 4 => PrefixID.Quick, + 5 => PrefixID.Taboo, + 6 => PrefixID.Manic, + 7 => PrefixID.Forceful, + 8 => PrefixID.Strong, + 9 => PrefixID.Adept, + 10 => PrefixID.Celestial, + 11 => PrefixID.Deadly2, + 12 => PrefixID.Mystic, + 13 => PrefixID.Superior, + 14 => PrefixID.Demonic, + 15 => PrefixID.Masterful, + 16 => PrefixID.Mythical, + 17 => PrefixID.Godly, + 18 => PrefixID.Ruthless, + _ => prefix, + }; } else if (item.CountsAsClass()) { - switch (reforgeTier) + prefix = reforgeTier switch { - case 0: - break; - case 1: - // Radical = 1, Pointy = 2 - prefix = Main.rand.Next(1, 3); - break; - case 2: - // Sharp = 3, Glorious = 4 - prefix = Main.rand.Next(3, 5); - break; - case 3: - // Feathered = 5, Sleek = 6, Hefty = 7 - prefix = Main.rand.Next(5, 8); - break; - case 4: - // Mighty = 8, Serrated = 9 - prefix = Main.rand.Next(8, 10); - break; - case 5: - // Vicious = 10, Lethal = 11 - prefix = Main.rand.Next(10, 12); - break; - case 6: - // Flawless = 12 - prefix = 12; - break; - } - switch (prefix) + 1 => Main.rand.Next(1, 3),// Radical = 1, Pointy = 2 + 2 => Main.rand.Next(3, 5),// Sharp = 3, Glorious = 4 + 3 => Main.rand.Next(5, 8),// Feathered = 5, Sleek = 6, Hefty = 7 + 4 => Main.rand.Next(8, 10),// Mighty = 8, Serrated = 9 + 5 => Main.rand.Next(10, 12),// Vicious = 10, Lethal = 11 + 6 => 12,// Flawless = 12 + _ => prefix, + }; + + prefix = prefix switch { - case -2: - break; - case 1: - prefix = Mod.Find("Radical").Type; - break; - case 2: - prefix = Mod.Find("Pointy").Type; - break; - case 3: - prefix = Mod.Find("Sharp").Type; - break; - case 4: - prefix = Mod.Find("Glorious").Type; - break; - case 5: - prefix = Mod.Find("Feathered").Type; - break; - case 6: - prefix = Mod.Find("Sleek").Type; - break; - case 7: - prefix = Mod.Find("Hefty").Type; - break; - case 8: - prefix = Mod.Find("Mighty").Type; - break; - case 9: - prefix = Mod.Find("Serrated").Type; - break; - case 10: - prefix = Mod.Find("Vicious").Type; - break; - case 11: - prefix = Mod.Find("Lethal").Type; - break; - case 12: - prefix = Mod.Find("Flawless").Type; - break; - } + 1 => Mod.Find("Radical").Type, + 2 => Mod.Find("Pointy").Type, + 3 => Mod.Find("Sharp").Type, + 4 => Mod.Find("Glorious").Type, + 5 => Mod.Find("Feathered").Type, + 6 => Mod.Find("Sleek").Type, + 7 => Mod.Find("Hefty").Type, + 8 => Mod.Find("Mighty").Type, + 9 => Mod.Find("Serrated").Type, + 10 => Mod.Find("Vicious").Type, + 11 => Mod.Find("Lethal").Type, + 12 => Mod.Find("Flawless").Type, + _ => prefix, + }; } + return prefix; } @@ -2418,7 +2017,7 @@ namespace CalamityMod.Items // Get cash from dickhead goblin fuck public override void PostReforge(Item item) { - CalamityPlayer modPlayer = Main.player[Main.myPlayer].Calamity(); + CalamityPlayer modPlayer = Main.LocalPlayer.Calamity(); if (modPlayer.itemTypeLastReforged != item.type) { modPlayer.reforgeTierSafety = 0; @@ -2427,7 +2026,7 @@ namespace CalamityMod.Items modPlayer.itemTypeLastReforged = item.type; - if (modPlayer.reforgeTierSafety > 6) + if (modPlayer.reforgeTierSafety >= 6) { modPlayer.reforgeTierSafety = 0; modPlayer.finalTierAccessoryReforge = true; @@ -2440,7 +2039,7 @@ namespace CalamityMod.Items item.netDefaults(item.netID); item.Prefix(NewPrefixType(item)); - item.Center = Main.player[Main.myPlayer].Center; + item.Center = Main.LocalPlayer.Center; item.favorited = favorited; if (NPC.AnyNPCs(ModContent.NPCType())) @@ -2481,45 +2080,29 @@ namespace CalamityMod.Items public static int GetBuyPrice(int rarity) { - switch (rarity) + return rarity switch { - case 0: - return Rarity0BuyPrice; - case 1: - return Rarity1BuyPrice; - case 2: - return Rarity2BuyPrice; - case 3: - return Rarity3BuyPrice; - case 4: - return Rarity4BuyPrice; - case 5: - return Rarity5BuyPrice; - case 6: - return Rarity6BuyPrice; - case 7: - return Rarity7BuyPrice; - case 8: - return Rarity8BuyPrice; - case 9: - return Rarity9BuyPrice; - case 10: - return Rarity10BuyPrice; - case 11: - return Rarity11BuyPrice; - case (int)CalamityRarity.Turquoise: - return RarityTurquoiseBuyPrice; - case (int)CalamityRarity.PureGreen: - return RarityPureGreenBuyPrice; - case (int)CalamityRarity.DarkBlue: - return RarityDarkBlueBuyPrice; - case (int)CalamityRarity.Violet: - return RarityVioletBuyPrice; - case (int)CalamityRarity.HotPink: - return RarityHotPinkBuyPrice; - } - return 0; + 0 => Rarity0BuyPrice, + 1 => Rarity1BuyPrice, + 2 => Rarity2BuyPrice, + 3 => Rarity3BuyPrice, + 4 => Rarity4BuyPrice, + 5 => Rarity5BuyPrice, + 6 => Rarity6BuyPrice, + 7 => Rarity7BuyPrice, + 8 => Rarity8BuyPrice, + 9 => Rarity9BuyPrice, + 10 => Rarity10BuyPrice, + 11 => Rarity11BuyPrice, + (int)CalamityRarity.Turquoise => RarityTurquoiseBuyPrice, + (int)CalamityRarity.PureGreen => RarityPureGreenBuyPrice, + (int)CalamityRarity.DarkBlue => RarityDarkBlueBuyPrice, + (int)CalamityRarity.Violet => RarityVioletBuyPrice, + (int)CalamityRarity.HotPink => RarityHotPinkBuyPrice, + _ => 0, + }; } + public static int GetBuyPrice(Item item) { return GetBuyPrice(item.rare); diff --git a/Items/Placeables/CelestialRemains.cs b/Items/Placeables/CelestialRemains.cs index 87c4221f02..26165387c8 100644 --- a/Items/Placeables/CelestialRemains.cs +++ b/Items/Placeables/CelestialRemains.cs @@ -1,12 +1,12 @@ -using CalamityMod.Items.Placeables.Walls; -using CalamityMod.Items.Materials; -using Terraria.ID; +using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables.Walls; using Terraria; +using Terraria.ID; using Terraria.ModLoader; -using CalamityMod.World; namespace CalamityMod.Items.Placeables { + [LegacyName("AstralFossil")] public class CelestialRemains : ModItem { public override void SetStaticDefaults() diff --git a/Items/Placeables/Furniture/CraftingStations/EutrophicShelf.cs b/Items/Placeables/Furniture/CraftingStations/EutrophicShelf.cs index e3759814e6..6b6bcca0bf 100644 --- a/Items/Placeables/Furniture/CraftingStations/EutrophicShelf.cs +++ b/Items/Placeables/Furniture/CraftingStations/EutrophicShelf.cs @@ -2,6 +2,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Furniture.CraftingStations { + [LegacyName("EutrophicCrafting")] public class EutrophicShelf : ModItem { public override void SetStaticDefaults() diff --git a/Items/Placeables/Furniture/CraftingStations/MonolithAmalgam.cs b/Items/Placeables/Furniture/CraftingStations/MonolithAmalgam.cs index b3e89fffa2..3f4e2b99be 100644 --- a/Items/Placeables/Furniture/CraftingStations/MonolithAmalgam.cs +++ b/Items/Placeables/Furniture/CraftingStations/MonolithAmalgam.cs @@ -2,6 +2,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Furniture.CraftingStations { + [LegacyName("MonolithCrafting")] public class MonolithAmalgam : ModItem { public override void SetStaticDefaults() diff --git a/Items/Placeables/Furniture/CraftingStations/ProfanedCrucible.cs b/Items/Placeables/Furniture/CraftingStations/ProfanedCrucible.cs index 588a53c30f..2ccb4806ce 100644 --- a/Items/Placeables/Furniture/CraftingStations/ProfanedCrucible.cs +++ b/Items/Placeables/Furniture/CraftingStations/ProfanedCrucible.cs @@ -4,6 +4,7 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Furniture.CraftingStations { + [LegacyName("ProfanedBasin")] public class ProfanedCrucible : ModItem { public override void SetStaticDefaults() diff --git a/Items/Placeables/FurnitureAbyss/AbyssSynth.cs b/Items/Placeables/FurnitureAbyss/AbyssSynth.cs index b5bd33fbff..140218bc84 100644 --- a/Items/Placeables/FurnitureAbyss/AbyssSynth.cs +++ b/Items/Placeables/FurnitureAbyss/AbyssSynth.cs @@ -3,6 +3,7 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureAbyss { + [LegacyName("AbyssPiano")] public class AbyssSynth : ModItem { public override void SetStaticDefaults() diff --git a/Items/Placeables/FurnitureAbyss/AbyssWorkBench.cs b/Items/Placeables/FurnitureAbyss/AbyssWorkBench.cs index 21cbb681df..57a2b33211 100644 --- a/Items/Placeables/FurnitureAbyss/AbyssWorkBench.cs +++ b/Items/Placeables/FurnitureAbyss/AbyssWorkBench.cs @@ -4,6 +4,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureAbyss { + [LegacyName("AbyssWorkbench")] public class AbyssWorkBench : ModItem { public override void SetStaticDefaults() diff --git a/Items/Placeables/FurnitureAcidwood/AcidwoodWorkBench.cs b/Items/Placeables/FurnitureAcidwood/AcidwoodWorkBench.cs index f909d550c7..8a27d3a9f4 100644 --- a/Items/Placeables/FurnitureAcidwood/AcidwoodWorkBench.cs +++ b/Items/Placeables/FurnitureAcidwood/AcidwoodWorkBench.cs @@ -3,6 +3,7 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureAcidwood { + [LegacyName("AcidwoodWorkbench")] public class AcidwoodWorkBench : ModItem { public override void SetStaticDefaults() diff --git a/Items/Placeables/FurnitureAncient/AncientPipeOrgan.cs b/Items/Placeables/FurnitureAncient/AncientPipeOrgan.cs index 36a2f79970..15cd992fd6 100644 --- a/Items/Placeables/FurnitureAncient/AncientPipeOrgan.cs +++ b/Items/Placeables/FurnitureAncient/AncientPipeOrgan.cs @@ -3,6 +3,7 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureAncient { + [LegacyName("AncientPiano")] public class AncientPipeOrgan : ModItem { public override void SetStaticDefaults() diff --git a/Items/Placeables/FurnitureAncient/AncientWorkBench.cs b/Items/Placeables/FurnitureAncient/AncientWorkBench.cs index 3b6f88101f..9baf7218ea 100644 --- a/Items/Placeables/FurnitureAncient/AncientWorkBench.cs +++ b/Items/Placeables/FurnitureAncient/AncientWorkBench.cs @@ -4,6 +4,7 @@ using Terraria.ID; namespace CalamityMod.Items.Placeables.FurnitureAncient { + [LegacyName("AncientWorkbench")] public class AncientWorkBench : ModItem { public override void SetStaticDefaults() diff --git a/Items/Placeables/FurnitureAshen/AshenPipeOrgan.cs b/Items/Placeables/FurnitureAshen/AshenPipeOrgan.cs index a9032990f8..abec672873 100644 --- a/Items/Placeables/FurnitureAshen/AshenPipeOrgan.cs +++ b/Items/Placeables/FurnitureAshen/AshenPipeOrgan.cs @@ -3,6 +3,7 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureAshen { + [LegacyName("AshenPiano")] public class AshenPipeOrgan : ModItem { public override void SetStaticDefaults() diff --git a/Items/Placeables/FurnitureAshen/AshenWorkBench.cs b/Items/Placeables/FurnitureAshen/AshenWorkBench.cs index 89840efb8d..6fb9b7a851 100644 --- a/Items/Placeables/FurnitureAshen/AshenWorkBench.cs +++ b/Items/Placeables/FurnitureAshen/AshenWorkBench.cs @@ -4,6 +4,7 @@ using Terraria.ID; namespace CalamityMod.Items.Placeables.FurnitureAshen { + [LegacyName("AshenWorkbench")] public class AshenWorkBench : ModItem { public override void SetStaticDefaults() diff --git a/Items/Placeables/FurnitureCosmilite/CosmiliteWorkBench.cs b/Items/Placeables/FurnitureCosmilite/CosmiliteWorkBench.cs index e55c317ce1..5fd662aee0 100644 --- a/Items/Placeables/FurnitureCosmilite/CosmiliteWorkBench.cs +++ b/Items/Placeables/FurnitureCosmilite/CosmiliteWorkBench.cs @@ -4,6 +4,7 @@ using Terraria.ID; namespace CalamityMod.Items.Placeables.FurnitureCosmilite { + [LegacyName("CosmiliteWorkbench")] public class CosmiliteWorkBench : ModItem { public override void SetStaticDefaults() diff --git a/Items/Placeables/FurnitureOtherworldly/OtherworldlyBathtub.cs b/Items/Placeables/FurnitureOtherworldly/OtherworldlyBathtub.cs index f85cc0c957..1369d64de0 100644 --- a/Items/Placeables/FurnitureOtherworldly/OtherworldlyBathtub.cs +++ b/Items/Placeables/FurnitureOtherworldly/OtherworldlyBathtub.cs @@ -2,6 +2,7 @@ using Terraria.ID; namespace CalamityMod.Items.Placeables.FurnitureOtherworldly { + [LegacyName("OccultBathtub")] public class OtherworldlyBathtub : ModItem { public override void SetStaticDefaults() diff --git a/Items/Placeables/FurnitureOtherworldly/OtherworldlyBed.cs b/Items/Placeables/FurnitureOtherworldly/OtherworldlyBed.cs index d9639383de..83710edde7 100644 --- a/Items/Placeables/FurnitureOtherworldly/OtherworldlyBed.cs +++ b/Items/Placeables/FurnitureOtherworldly/OtherworldlyBed.cs @@ -1,7 +1,8 @@ -using Terraria.ID; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureOtherworldly { + [LegacyName("OccultBed")] public class OtherworldlyBed : ModItem { public override void SetStaticDefaults() diff --git a/Items/Placeables/FurnitureOtherworldly/OtherworldlyBookcase.cs b/Items/Placeables/FurnitureOtherworldly/OtherworldlyBookcase.cs index b50b25f69e..0467aa0fe0 100644 --- a/Items/Placeables/FurnitureOtherworldly/OtherworldlyBookcase.cs +++ b/Items/Placeables/FurnitureOtherworldly/OtherworldlyBookcase.cs @@ -1,7 +1,8 @@ -using Terraria.ID; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureOtherworldly { + [LegacyName("OccultBookcase")] public class OtherworldlyBookcase : ModItem { public override void SetStaticDefaults() diff --git a/Items/Placeables/FurnitureOtherworldly/OtherworldlyCandelabra.cs b/Items/Placeables/FurnitureOtherworldly/OtherworldlyCandelabra.cs index 0146407c46..5b1e1d0534 100644 --- a/Items/Placeables/FurnitureOtherworldly/OtherworldlyCandelabra.cs +++ b/Items/Placeables/FurnitureOtherworldly/OtherworldlyCandelabra.cs @@ -1,8 +1,9 @@ -using CalamityMod.Items.Placeables.FurnitureCosmilite; +using CalamityMod.Items.Placeables.FurnitureCosmilite; using Terraria.ModLoader; using Terraria.ID; namespace CalamityMod.Items.Placeables.FurnitureOtherworldly { + [LegacyName("OccultCandelabra")] public class OtherworldlyCandelabra : ModItem { public override void SetStaticDefaults() diff --git a/Items/Placeables/FurnitureOtherworldly/OtherworldlyCandle.cs b/Items/Placeables/FurnitureOtherworldly/OtherworldlyCandle.cs index af3380d849..ac4318b09b 100644 --- a/Items/Placeables/FurnitureOtherworldly/OtherworldlyCandle.cs +++ b/Items/Placeables/FurnitureOtherworldly/OtherworldlyCandle.cs @@ -1,8 +1,9 @@ -using CalamityMod.Items.Placeables.FurnitureCosmilite; +using CalamityMod.Items.Placeables.FurnitureCosmilite; using Terraria.ModLoader; using Terraria.ID; namespace CalamityMod.Items.Placeables.FurnitureOtherworldly { + [LegacyName("OccultCandle")] public class OtherworldlyCandle : ModItem { public override void SetStaticDefaults() diff --git a/Items/Placeables/FurnitureOtherworldly/OtherworldlyChair.cs b/Items/Placeables/FurnitureOtherworldly/OtherworldlyChair.cs index f460580949..cfcad6fccd 100644 --- a/Items/Placeables/FurnitureOtherworldly/OtherworldlyChair.cs +++ b/Items/Placeables/FurnitureOtherworldly/OtherworldlyChair.cs @@ -2,6 +2,7 @@ using Terraria.ID; namespace CalamityMod.Items.Placeables.FurnitureOtherworldly { + [LegacyName("OccultChair")] public class OtherworldlyChair : ModItem { public override void SetStaticDefaults() diff --git a/Items/Placeables/FurnitureOtherworldly/OtherworldlyChandelier.cs b/Items/Placeables/FurnitureOtherworldly/OtherworldlyChandelier.cs index fa62aad08a..a3f57a8e30 100644 --- a/Items/Placeables/FurnitureOtherworldly/OtherworldlyChandelier.cs +++ b/Items/Placeables/FurnitureOtherworldly/OtherworldlyChandelier.cs @@ -1,8 +1,9 @@ -using CalamityMod.Items.Placeables.FurnitureCosmilite; +using CalamityMod.Items.Placeables.FurnitureCosmilite; using Terraria.ModLoader; using Terraria.ID; namespace CalamityMod.Items.Placeables.FurnitureOtherworldly { + [LegacyName("OccultChandelier")] public class OtherworldlyChandelier : ModItem { public override void SetStaticDefaults() diff --git a/Items/Placeables/FurnitureOtherworldly/OtherworldlyChest.cs b/Items/Placeables/FurnitureOtherworldly/OtherworldlyChest.cs index c61b048fbc..19c8634ed9 100644 --- a/Items/Placeables/FurnitureOtherworldly/OtherworldlyChest.cs +++ b/Items/Placeables/FurnitureOtherworldly/OtherworldlyChest.cs @@ -1,8 +1,9 @@ -using CalamityMod.Items.Placeables.FurnitureCosmilite; +using CalamityMod.Items.Placeables.FurnitureCosmilite; using Terraria.ModLoader; using Terraria.ID; namespace CalamityMod.Items.Placeables.FurnitureOtherworldly { + [LegacyName("OccultChest")] public class OtherworldlyChest : ModItem { public override void SetStaticDefaults() diff --git a/Items/Placeables/FurnitureOtherworldly/OtherworldlyClock.cs b/Items/Placeables/FurnitureOtherworldly/OtherworldlyClock.cs index 4440a41e03..3c08890793 100644 --- a/Items/Placeables/FurnitureOtherworldly/OtherworldlyClock.cs +++ b/Items/Placeables/FurnitureOtherworldly/OtherworldlyClock.cs @@ -1,8 +1,9 @@ -using CalamityMod.Items.Placeables.FurnitureCosmilite; +using CalamityMod.Items.Placeables.FurnitureCosmilite; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureOtherworldly { + [LegacyName("OccultClock")] public class OtherworldlyClock : ModItem { public override void SetStaticDefaults() diff --git a/Items/Placeables/FurnitureOtherworldly/OtherworldlyDoor.cs b/Items/Placeables/FurnitureOtherworldly/OtherworldlyDoor.cs index 129c0135c4..29ab8d75b0 100644 --- a/Items/Placeables/FurnitureOtherworldly/OtherworldlyDoor.cs +++ b/Items/Placeables/FurnitureOtherworldly/OtherworldlyDoor.cs @@ -1,8 +1,9 @@ -using CalamityMod.Tiles.FurnitureOtherworldly; +using CalamityMod.Tiles.FurnitureOtherworldly; using Terraria.ModLoader; using Terraria.ID; namespace CalamityMod.Items.Placeables.FurnitureOtherworldly { + [LegacyName("OccultDoor")] public class OtherworldlyDoor : ModItem { public override void SetStaticDefaults() diff --git a/Items/Placeables/FurnitureOtherworldly/OtherworldlyDresser.cs b/Items/Placeables/FurnitureOtherworldly/OtherworldlyDresser.cs index 5cde375ea8..1be1c1a889 100644 --- a/Items/Placeables/FurnitureOtherworldly/OtherworldlyDresser.cs +++ b/Items/Placeables/FurnitureOtherworldly/OtherworldlyDresser.cs @@ -1,7 +1,8 @@ -using Terraria.ModLoader; +using Terraria.ModLoader; using Terraria.ID; namespace CalamityMod.Items.Placeables.FurnitureOtherworldly { + [LegacyName("OccultDresser")] public class OtherworldlyDresser : ModItem { public override void SetStaticDefaults() diff --git a/Items/Placeables/FurnitureOtherworldly/OtherworldlyLamp.cs b/Items/Placeables/FurnitureOtherworldly/OtherworldlyLamp.cs index 1000e13b48..f479897fad 100644 --- a/Items/Placeables/FurnitureOtherworldly/OtherworldlyLamp.cs +++ b/Items/Placeables/FurnitureOtherworldly/OtherworldlyLamp.cs @@ -1,8 +1,9 @@ -using CalamityMod.Items.Placeables.FurnitureCosmilite; +using CalamityMod.Items.Placeables.FurnitureCosmilite; using Terraria.ModLoader; using Terraria.ID; namespace CalamityMod.Items.Placeables.FurnitureOtherworldly { + [LegacyName("OccultLamp")] public class OtherworldlyLamp : ModItem { public override void SetStaticDefaults() diff --git a/Items/Placeables/FurnitureOtherworldly/OtherworldlyLantern.cs b/Items/Placeables/FurnitureOtherworldly/OtherworldlyLantern.cs index 33ab65cbbb..6aaaa3d28a 100644 --- a/Items/Placeables/FurnitureOtherworldly/OtherworldlyLantern.cs +++ b/Items/Placeables/FurnitureOtherworldly/OtherworldlyLantern.cs @@ -1,8 +1,9 @@ -using CalamityMod.Items.Placeables.FurnitureCosmilite; +using CalamityMod.Items.Placeables.FurnitureCosmilite; using Terraria.ModLoader; using Terraria.ID; namespace CalamityMod.Items.Placeables.FurnitureOtherworldly { + [LegacyName("OccultLantern")] public class OtherworldlyLantern : ModItem { public override void SetStaticDefaults() diff --git a/Items/Placeables/FurnitureOtherworldly/OtherworldlyPiano.cs b/Items/Placeables/FurnitureOtherworldly/OtherworldlyPiano.cs index 99c24d961e..755100f99c 100644 --- a/Items/Placeables/FurnitureOtherworldly/OtherworldlyPiano.cs +++ b/Items/Placeables/FurnitureOtherworldly/OtherworldlyPiano.cs @@ -1,7 +1,8 @@ -using Terraria.ID; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureOtherworldly { + [LegacyName("OccultPiano")] public class OtherworldlyPiano : ModItem { public override void SetStaticDefaults() diff --git a/Items/Placeables/FurnitureOtherworldly/OtherworldlyPlatform.cs b/Items/Placeables/FurnitureOtherworldly/OtherworldlyPlatform.cs index 885eff2609..4194361a98 100644 --- a/Items/Placeables/FurnitureOtherworldly/OtherworldlyPlatform.cs +++ b/Items/Placeables/FurnitureOtherworldly/OtherworldlyPlatform.cs @@ -2,6 +2,7 @@ using Terraria.ID; namespace CalamityMod.Items.Placeables.FurnitureOtherworldly { + [LegacyName("OccultPlatform")] public class OtherworldlyPlatform : ModItem { public override void SetStaticDefaults() diff --git a/Items/Placeables/FurnitureOtherworldly/OtherworldlySink.cs b/Items/Placeables/FurnitureOtherworldly/OtherworldlySink.cs index 46704aee31..4fed9728f3 100644 --- a/Items/Placeables/FurnitureOtherworldly/OtherworldlySink.cs +++ b/Items/Placeables/FurnitureOtherworldly/OtherworldlySink.cs @@ -1,7 +1,8 @@ -using Terraria.ID; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureOtherworldly { + [LegacyName("OccultSink")] public class OtherworldlySink : ModItem { public override void SetStaticDefaults() diff --git a/Items/Placeables/FurnitureOtherworldly/OtherworldlySofa.cs b/Items/Placeables/FurnitureOtherworldly/OtherworldlySofa.cs index 25e1f24ae4..65a380519a 100644 --- a/Items/Placeables/FurnitureOtherworldly/OtherworldlySofa.cs +++ b/Items/Placeables/FurnitureOtherworldly/OtherworldlySofa.cs @@ -1,7 +1,8 @@ -using Terraria.ID; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureOtherworldly { + [LegacyName("OccultSofa")] public class OtherworldlySofa : ModItem { public override void SetStaticDefaults() diff --git a/Items/Placeables/FurnitureOtherworldly/OtherworldlyStone.cs b/Items/Placeables/FurnitureOtherworldly/OtherworldlyStone.cs index 271bcdc39e..d8ddcbc6b9 100644 --- a/Items/Placeables/FurnitureOtherworldly/OtherworldlyStone.cs +++ b/Items/Placeables/FurnitureOtherworldly/OtherworldlyStone.cs @@ -5,6 +5,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureOtherworldly { + [LegacyName("OccultStone")] public class OtherworldlyStone : ModItem { public override void SetStaticDefaults() diff --git a/Items/Placeables/FurnitureOtherworldly/OtherworldlyTable.cs b/Items/Placeables/FurnitureOtherworldly/OtherworldlyTable.cs index 7e2e5df1c5..dc42a92a5f 100644 --- a/Items/Placeables/FurnitureOtherworldly/OtherworldlyTable.cs +++ b/Items/Placeables/FurnitureOtherworldly/OtherworldlyTable.cs @@ -1,7 +1,8 @@ -using Terraria.ID; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureOtherworldly { + [LegacyName("OccultTable")] public class OtherworldlyTable : ModItem { public override void SetStaticDefaults() diff --git a/Items/Placeables/FurnitureOtherworldly/OtherworldlyWorkBench.cs b/Items/Placeables/FurnitureOtherworldly/OtherworldlyWorkBench.cs index 994e3fea56..55b6505f3b 100644 --- a/Items/Placeables/FurnitureOtherworldly/OtherworldlyWorkBench.cs +++ b/Items/Placeables/FurnitureOtherworldly/OtherworldlyWorkBench.cs @@ -1,7 +1,8 @@ -using Terraria.ID; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.FurnitureOtherworldly { + [LegacyName("OccultWorkbench", "OccultWorkBench")] public class OtherworldlyWorkBench : ModItem { public override void SetStaticDefaults() diff --git a/Items/Placeables/NovaeSlag.cs b/Items/Placeables/NovaeSlag.cs index 9b10cf98e4..e664eee567 100644 --- a/Items/Placeables/NovaeSlag.cs +++ b/Items/Placeables/NovaeSlag.cs @@ -1,11 +1,11 @@ using CalamityMod.Items.Materials; -using Terraria.ID; using Terraria; +using Terraria.ID; using Terraria.ModLoader; -using CalamityMod.World; namespace CalamityMod.Items.Placeables { + [LegacyName("AstralSilt")] public class NovaeSlag : ModItem { public override void SetStaticDefaults() diff --git a/Items/Placeables/Walls/CelestialRemainsWall.cs b/Items/Placeables/Walls/CelestialRemainsWall.cs index 218b88cdbc..af02d8c0a5 100644 --- a/Items/Placeables/Walls/CelestialRemainsWall.cs +++ b/Items/Placeables/Walls/CelestialRemainsWall.cs @@ -4,6 +4,7 @@ using Terraria.ID; namespace CalamityMod.Items.Placeables.Walls { + [LegacyName("AstralFossilWall")] public class CelestialRemainsWall : ModItem { public override void SetStaticDefaults() diff --git a/Items/TreasureBags/PlaguebringerGoliathBag.cs b/Items/TreasureBags/PlaguebringerGoliathBag.cs index 47ef2401c0..59dbd78990 100644 --- a/Items/TreasureBags/PlaguebringerGoliathBag.cs +++ b/Items/TreasureBags/PlaguebringerGoliathBag.cs @@ -65,7 +65,7 @@ namespace CalamityMod.Items.TreasureBags DropHelper.WeightStack(w), DropHelper.WeightStack(w), DropHelper.WeightStack(w), - DropHelper.WeightStack(w), // Blight Spewer + DropHelper.WeightStack(w), // Blight Spewer DropHelper.WeightStack(w), DropHelper.WeightStack(w), DropHelper.WeightStack(w), diff --git a/Items/Weapons/Magic/StardustStaff.cs b/Items/Weapons/Magic/EidolonStaff.cs similarity index 98% rename from Items/Weapons/Magic/StardustStaff.cs rename to Items/Weapons/Magic/EidolonStaff.cs index 304ed3b168..da3fb6d1e2 100644 --- a/Items/Weapons/Magic/StardustStaff.cs +++ b/Items/Weapons/Magic/EidolonStaff.cs @@ -8,7 +8,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Magic { - public class StardustStaff : ModItem + [LegacyName("StardustStaff")] + public class EidolonStaff : ModItem { public override void SetStaticDefaults() { diff --git a/Items/Weapons/Magic/StardustStaff.png b/Items/Weapons/Magic/EidolonStaff.png similarity index 100% rename from Items/Weapons/Magic/StardustStaff.png rename to Items/Weapons/Magic/EidolonStaff.png diff --git a/Items/Weapons/Ranged/MepheticSprayer.cs b/Items/Weapons/Ranged/BlightSpewer.cs similarity index 93% rename from Items/Weapons/Ranged/MepheticSprayer.cs rename to Items/Weapons/Ranged/BlightSpewer.cs index e5b1a4c732..4f50043171 100644 --- a/Items/Weapons/Ranged/MepheticSprayer.cs +++ b/Items/Weapons/Ranged/BlightSpewer.cs @@ -6,7 +6,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Ranged { - public class MepheticSprayer : ModItem + [LegacyName("MepheticSprayer")] + public class BlightSpewer : ModItem { public override void SetStaticDefaults() { diff --git a/Items/Weapons/Ranged/MepheticSprayer.png b/Items/Weapons/Ranged/BlightSpewer.png similarity index 100% rename from Items/Weapons/Ranged/MepheticSprayer.png rename to Items/Weapons/Ranged/BlightSpewer.png diff --git a/Items/Weapons/Ranged/ElementalEruption.cs b/Items/Weapons/Ranged/ElementalEruption.cs index 68dee3591d..848d2bf240 100644 --- a/Items/Weapons/Ranged/ElementalEruption.cs +++ b/Items/Weapons/Ranged/ElementalEruption.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Items.Weapons.Ranged CreateRecipe(). AddIngredient(). AddIngredient(). - AddIngredient(). + AddIngredient(). AddIngredient(). AddIngredient(5). AddIngredient(ItemID.LunarBar, 5). diff --git a/MainMenu/CalamityMainMenu.cs b/MainMenu/CalamityMainMenu.cs index 154f7c6a00..ec4d1c9d16 100644 --- a/MainMenu/CalamityMainMenu.cs +++ b/MainMenu/CalamityMainMenu.cs @@ -4,6 +4,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.MainMenu @@ -44,6 +45,8 @@ namespace CalamityMod.MainMenu public override Asset SunTexture => ModContent.Request("CalamityMod/Backgrounds/BlankPixel"); public override Asset MoonTexture => ModContent.Request("CalamityMod/Backgrounds/BlankPixel"); + public override int Music => CalamityMod.Instance.GetMusicFromMusicMod("Calamity") ?? MusicID.Title; + public override ModSurfaceBackgroundStyle MenuBackgroundStyle => ModContent.GetInstance(); // Before drawing the logo, draw the entire Calamity background. This way, the typical parallax background is skipped entirely. diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 544e749ab5..6f1cb3c2dc 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -412,7 +412,7 @@ namespace CalamityMod BossDifficulty.TryGetValue("PlaguebringerGoliath", out float order); int type = NPCType(); int summon = ItemType(); - List loot = new List() { ItemType(), ItemType(), ItemType(), ItemID.Stinger, ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.GreaterHealingPotion }; + List loot = new List() { ItemType(), ItemType(), ItemType(), ItemID.Stinger, ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.GreaterHealingPotion }; List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType() }; string instructions = $"Use an [i:{summon}] in the Jungle Biome"; string despawn = CalamityUtils.ColorMessage("HOSTILE SPECIMENS TERMINATED. INITIATE RECALL TO HOME BASE.", new Color(0x00, 0xFF, 0x00)); diff --git a/NPCs/Abyss/EidolonWyrmHead.cs b/NPCs/Abyss/EidolonWyrmHead.cs index 80842bd210..552fac7b53 100644 --- a/NPCs/Abyss/EidolonWyrmHead.cs +++ b/NPCs/Abyss/EidolonWyrmHead.cs @@ -511,7 +511,7 @@ namespace CalamityMod.NPCs.Abyss aewMinionCondition.Add(postPolter); postPolter.Add(ModContent.ItemType(), 3); postPolter.Add(ModContent.ItemType(), 3); - postPolter.Add(ModContent.ItemType(), 3); + postPolter.Add(ModContent.ItemType(), 3); // Post-Clone: 6-8 Lumenyl (8-11 on Expert) LeadingConditionRule postClone = new(DropHelper.If(() => DownedBossSystem.downedCalamitas)); diff --git a/NPCs/CalamityGlobalTownNPC.cs b/NPCs/CalamityGlobalTownNPC.cs index 4c0f588078..c6a1e35c44 100644 --- a/NPCs/CalamityGlobalTownNPC.cs +++ b/NPCs/CalamityGlobalTownNPC.cs @@ -401,6 +401,14 @@ namespace CalamityMod.NPCs if (Main.LocalPlayer.Calamity().newPainterInventory) DrawNewInventoryAlert(npc); break; + case NPCID.Golfer: + if (Main.LocalPlayer.Calamity().newGolferInventory) + DrawNewInventoryAlert(npc); + break; + case NPCID.BestiaryGirl: + if (Main.LocalPlayer.Calamity().newZoologistInventory) + DrawNewInventoryAlert(npc); + break; case NPCID.DyeTrader: if (Main.LocalPlayer.Calamity().newDyeTraderInventory) DrawNewInventoryAlert(npc); @@ -465,6 +473,10 @@ namespace CalamityMod.NPCs if (Main.LocalPlayer.Calamity().newCyborgInventory) DrawNewInventoryAlert(npc); break; + case NPCID.Princess: + if (Main.LocalPlayer.Calamity().newPrincessInventory) + DrawNewInventoryAlert(npc); + break; case NPCID.SkeletonMerchant: if (Main.LocalPlayer.Calamity().newSkeletonMerchantInventory) DrawNewInventoryAlert(npc); @@ -516,6 +528,12 @@ namespace CalamityMod.NPCs case NPCID.Painter: Main.LocalPlayer.Calamity().newPainterInventory = false; break; + case NPCID.Golfer: + Main.LocalPlayer.Calamity().newGolferInventory = false; + break; + case NPCID.BestiaryGirl: + Main.LocalPlayer.Calamity().newZoologistInventory = false; + break; case NPCID.DyeTrader: Main.LocalPlayer.Calamity().newDyeTraderInventory = false; break; @@ -564,6 +582,9 @@ namespace CalamityMod.NPCs case NPCID.Cyborg: Main.LocalPlayer.Calamity().newCyborgInventory = false; break; + case NPCID.Princess: + Main.LocalPlayer.Calamity().newPrincessInventory = false; + break; case NPCID.SkeletonMerchant: Main.LocalPlayer.Calamity().newSkeletonMerchantInventory = false; break; @@ -605,6 +626,12 @@ namespace CalamityMod.NPCs case NPCID.Painter: Main.LocalPlayer.Calamity().newPainterInventory = true; break; + case NPCID.Golfer: + Main.LocalPlayer.Calamity().newGolferInventory = true; + break; + case NPCID.BestiaryGirl: + Main.LocalPlayer.Calamity().newZoologistInventory = true; + break; case NPCID.DyeTrader: Main.LocalPlayer.Calamity().newDyeTraderInventory = true; break; @@ -653,6 +680,9 @@ namespace CalamityMod.NPCs case NPCID.Cyborg: Main.LocalPlayer.Calamity().newCyborgInventory = true; break; + case NPCID.Princess: + Main.LocalPlayer.Calamity().newPrincessInventory = true; + break; case NPCID.SkeletonMerchant: Main.LocalPlayer.Calamity().newSkeletonMerchantInventory = true; break; diff --git a/NPCs/DevourerofGods/DoGSky.cs b/NPCs/DevourerofGods/DoGSky.cs index 06434f1260..3f4d412c3e 100644 --- a/NPCs/DevourerofGods/DoGSky.cs +++ b/NPCs/DevourerofGods/DoGSky.cs @@ -84,12 +84,12 @@ namespace CalamityMod.NPCs.DevourerofGods double blackScreenLife_GateValue = (lifeRatio < 0.6f && Main.npc[DoGIndex].localAI[2] <= 2f) ? 0.15 : 0.75; if (Main.npc[DoGIndex].life < Main.npc[DoGIndex].lifeMax * blackScreenLife_GateValue || CalamityWorld.death || BossRushEvent.BossRushActive) { - spriteBatch.Draw(TextureAssets.BlackTile.Value, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), + spriteBatch.Draw(TextureAssets.BlackTile.Value, new Rectangle(0, 0, Main.screenWidth * 2, Main.screenHeight * 2), Color.Black * (intensity + 0.5f)); } else { - spriteBatch.Draw(TextureAssets.BlackTile.Value, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), + spriteBatch.Draw(TextureAssets.BlackTile.Value, new Rectangle(0, 0, Main.screenWidth * 2, Main.screenHeight * 2), (Main.npc[DoGIndex].ai[3] == 0f ? Color.Cyan : Color.Fuchsia) * intensity); } } diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs index 0a98e0b274..43f294a884 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs @@ -1232,7 +1232,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), // Blight Spewer + ModContent.ItemType(), // Blight Spewer ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 8e4a626028..fc392ab319 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -446,10 +446,7 @@ namespace CalamityMod.Projectiles // Chlorophyte Crystal AI rework. if (projectile.type == ProjectileID.CrystalLeaf) - { - ChlorophyteCrystalAI.DoChlorophyteCrystalAI(projectile); - return false; - } + return ChlorophyteCrystalAI.DoChlorophyteCrystalAI(projectile); // WHY DOES THE CYRSTAL STILL SHOOT THESE FUCKING THINGS??? if (projectile.type == ProjectileID.CrystalLeafShot) @@ -2036,7 +2033,7 @@ namespace CalamityMod.Projectiles } else { - if (modPlayer.artemisEmblem && projectile.CountsAsClass() && player.heldProj != projectile.whoAmI) + if (modPlayer.deadshotBrooch && projectile.CountsAsClass() && player.heldProj != projectile.whoAmI) projectile.extraUpdates += 1; if (modPlayer.camper && !player.StandingStill()) diff --git a/Projectiles/Melee/Spears/StreamGougeProj.cs b/Projectiles/Melee/Spears/StreamGougeProj.cs index ce4c43fa86..f7d8803fc4 100644 --- a/Projectiles/Melee/Spears/StreamGougeProj.cs +++ b/Projectiles/Melee/Spears/StreamGougeProj.cs @@ -161,11 +161,11 @@ namespace CalamityMod.Projectiles.Melee.Spears { Main.spriteBatch.EnterShaderRegion(); Vector2 intersectionNormal = portalDrawPosition + Main.screenPosition - Projectile.Center; - Vector2 worldOffset = Projectile.rotation.ToRotationVector2() * -45f; + Vector2 worldOffset = Projectile.rotation.ToRotationVector2() * Utils.GetLerpValue(0f, StreamGouge.SpearFireTime, Time - StreamGouge.SpinTime, true) * 80f; Vector2 intersectionOffset = (portalDrawPosition + Main.screenPosition - Projectile.Center) * -1.5f; GameShaders.Misc["CalamityMod:IntersectionClip"].Shader.Parameters["uIntersectionPosition"].SetValue(portalDrawPosition + intersectionOffset); GameShaders.Misc["CalamityMod:IntersectionClip"].Shader.Parameters["uIntersectionNormal"].SetValue(intersectionNormal); - GameShaders.Misc["CalamityMod:IntersectionClip"].Shader.Parameters["uIntersectionCutoffDirection"].SetValue(-1f); + GameShaders.Misc["CalamityMod:IntersectionClip"].Shader.Parameters["uIntersectionCutoffDirection"].SetValue(1f); GameShaders.Misc["CalamityMod:IntersectionClip"].Shader.Parameters["uWorldPosition"].SetValue(Projectile.Center - Main.screenPosition + worldOffset); GameShaders.Misc["CalamityMod:IntersectionClip"].Shader.Parameters["uSize"].SetValue(texture.Size()); GameShaders.Misc["CalamityMod:IntersectionClip"].Shader.Parameters["uRotation"].SetValue(Projectile.rotation); diff --git a/Projectiles/Summon/AndromedaDeathRay.cs b/Projectiles/Summon/AndromedaDeathRay.cs index acb43562d4..3433c59a0e 100644 --- a/Projectiles/Summon/AndromedaDeathRay.cs +++ b/Projectiles/Summon/AndromedaDeathRay.cs @@ -161,7 +161,7 @@ namespace CalamityMod.Projectiles.Summon // Laser tail logic - Main.spriteBatch.Draw(laserTailTexture, Projectile.Center - Main.screenPosition, null, drawColor, Projectile.rotation, laserTailTexture.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(laserTailTexture, Projectile.Center - Main.screenPosition, null, drawColor, Projectile.rotation, laserTailTexture.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); // Laser body logic @@ -178,7 +178,7 @@ namespace CalamityMod.Projectiles.Summon { sourceRectangle.Height = (int)(laserLength - laserLengthDelta); } - Main.spriteBatch.Draw(laserBodyTexture, centerDelta - Main.screenPosition, new Rectangle?(sourceRectangle), drawColor, Projectile.rotation, new Vector2(sourceRectangle.Width / 2f, 0f), Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(laserBodyTexture, centerDelta - Main.screenPosition, new Rectangle?(sourceRectangle), drawColor, Projectile.rotation, new Vector2(sourceRectangle.Width / 2f, 0f), Projectile.scale, SpriteEffects.None, 0); laserLengthDelta += sourceRectangle.Height * Projectile.scale; centerDelta += Projectile.velocity * sourceRectangle.Height * Projectile.scale; sourceRectangle.Y += 16; @@ -191,7 +191,7 @@ namespace CalamityMod.Projectiles.Summon // Laser head logic - Main.spriteBatch.Draw(laserHeadTexture, centerDelta - Main.screenPosition, null, drawColor, Projectile.rotation, laserHeadTexture.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(laserHeadTexture, centerDelta - Main.screenPosition, null, drawColor, Projectile.rotation, laserHeadTexture.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Summon/AndromedaRegislash.cs b/Projectiles/Summon/AndromedaRegislash.cs index a40ead9b3d..2e43c67237 100644 --- a/Projectiles/Summon/AndromedaRegislash.cs +++ b/Projectiles/Summon/AndromedaRegislash.cs @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Summon if (Projectile.spriteDirection == -1) spriteEffects = SpriteEffects.FlipVertically; - Main.spriteBatch.Draw(texture, startPos, rectangle, Projectile.GetAlpha(lightColor), rotation, origin, scale, spriteEffects, 0); + Main.EntitySpriteDraw(texture, startPos, rectangle, Projectile.GetAlpha(lightColor), rotation, origin, scale, spriteEffects, 0); return false; } } diff --git a/Projectiles/Summon/AngelicAllianceArchangel.cs b/Projectiles/Summon/AngelicAllianceArchangel.cs index 43e4f65ad5..0df93ef0f2 100644 --- a/Projectiles/Summon/AngelicAllianceArchangel.cs +++ b/Projectiles/Summon/AngelicAllianceArchangel.cs @@ -151,7 +151,7 @@ namespace CalamityMod.Projectiles.Summon Texture2D texture = ModContent.Request(Texture).Value; int frameHeight = texture.Height / Main.projFrames[Projectile.type]; int frameY = frameHeight * Projectile.frame; - Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, frameY, texture.Width, frameHeight)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture.Width / 2f, (float)frameHeight / 2f), Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, frameY, texture.Width, frameHeight)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture.Width / 2f, (float)frameHeight / 2f), Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Summon/AstrageldonSummon.cs b/Projectiles/Summon/AstrageldonSummon.cs index aace28f86d..a288773e20 100644 --- a/Projectiles/Summon/AstrageldonSummon.cs +++ b/Projectiles/Summon/AstrageldonSummon.cs @@ -224,7 +224,7 @@ namespace CalamityMod.Projectiles.Summon Texture2D texture = ModContent.Request(Texture).Value; int height = texture.Height / Main.projFrames[Projectile.type]; int y6 = height * Projectile.frame; - Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, height)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture.Width / 2f, (float)height / 2f), Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, height)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture.Width / 2f, (float)height / 2f), Projectile.scale, SpriteEffects.None, 0); return false; } } diff --git a/Projectiles/Summon/BabyPlaguebringer.cs b/Projectiles/Summon/BabyPlaguebringer.cs index 6d33cceed7..86f1669d05 100644 --- a/Projectiles/Summon/BabyPlaguebringer.cs +++ b/Projectiles/Summon/BabyPlaguebringer.cs @@ -238,7 +238,7 @@ namespace CalamityMod.Projectiles.Summon int num214 = texture.Height / Main.projFrames[Projectile.type]; int y6 = num214 * Projectile.frame; Vector2 origin = new Vector2(texture.Width / 2f, num214 / 2f); - Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Rectangle(0, y6, texture.Width, num214), Projectile.GetAlpha(lightColor), Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Rectangle(0, y6, texture.Width, num214), Projectile.GetAlpha(lightColor), Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Summon/CalamariInk.cs b/Projectiles/Summon/CalamariInk.cs index f9f2621139..2398177e1c 100644 --- a/Projectiles/Summon/CalamariInk.cs +++ b/Projectiles/Summon/CalamariInk.cs @@ -111,7 +111,7 @@ namespace CalamityMod.Projectiles.Summon Texture2D texture2D13 = ModContent.Request(Texture).Value; int num214 = texture2D13.Height / Main.projFrames[Projectile.type]; int y6 = num214 * Projectile.frame; - Main.spriteBatch.Draw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Summon/CalamariMinion.cs b/Projectiles/Summon/CalamariMinion.cs index cc6d765370..1a59f94642 100644 --- a/Projectiles/Summon/CalamariMinion.cs +++ b/Projectiles/Summon/CalamariMinion.cs @@ -329,7 +329,7 @@ namespace CalamityMod.Projectiles.Summon Texture2D texture2D13 = ModContent.Request(Texture).Value; int num214 = texture2D13.Height / Main.projFrames[Projectile.type]; int y6 = num214 * Projectile.frame; - Main.spriteBatch.Draw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Summon/Calamitamini.cs b/Projectiles/Summon/Calamitamini.cs index cbd41d7ff3..be4bf017a1 100644 --- a/Projectiles/Summon/Calamitamini.cs +++ b/Projectiles/Summon/Calamitamini.cs @@ -242,7 +242,7 @@ namespace CalamityMod.Projectiles.Summon Texture2D texture = ModContent.Request(Texture).Value; int frameHeight = texture.Height / Main.projFrames[Projectile.type]; int yStart = frameHeight * Projectile.frame; - Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, yStart, texture.Width, frameHeight)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, frameHeight / 2f), Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, yStart, texture.Width, frameHeight)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, frameHeight / 2f), Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Summon/Cataclymini.cs b/Projectiles/Summon/Cataclymini.cs index 052aaa539f..52923d3b86 100644 --- a/Projectiles/Summon/Cataclymini.cs +++ b/Projectiles/Summon/Cataclymini.cs @@ -236,7 +236,7 @@ namespace CalamityMod.Projectiles.Summon Texture2D texture = ModContent.Request(Texture).Value; int frameHeight = texture.Height / Main.projFrames[Projectile.type]; int yStart = frameHeight * Projectile.frame; - Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, yStart, texture.Width, frameHeight)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, frameHeight / 2f), Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, yStart, texture.Width, frameHeight)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, frameHeight / 2f), Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Summon/CataclysmSummon.cs b/Projectiles/Summon/CataclysmSummon.cs index 0b57338b9d..71076acea3 100644 --- a/Projectiles/Summon/CataclysmSummon.cs +++ b/Projectiles/Summon/CataclysmSummon.cs @@ -113,11 +113,11 @@ namespace CalamityMod.Projectiles.Summon Vector2 drawPos = Projectile.oldPos[i] + Projectile.Size * 0.5f - Main.screenPosition + Vector2.UnitY * Projectile.gfxOffY; Color color = Projectile.GetAlpha(lightColor) * ((float)(Projectile.oldPos.Length - i) / Projectile.oldPos.Length); - Main.spriteBatch.Draw(texture, drawPos, frame, color, afterimageRot, origin, Projectile.scale, sfxForThisAfterimage, 0f); + Main.EntitySpriteDraw(texture, drawPos, frame, color, afterimageRot, origin, Projectile.scale, sfxForThisAfterimage, 0); } SpriteEffects direction = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; - Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, frame, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, Projectile.scale, direction, 0f); + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, frame, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, Projectile.scale, direction, 0); return false; } diff --git a/Projectiles/Summon/Catastromini.cs b/Projectiles/Summon/Catastromini.cs index 635aa72e1e..c0155235f4 100644 --- a/Projectiles/Summon/Catastromini.cs +++ b/Projectiles/Summon/Catastromini.cs @@ -86,7 +86,7 @@ namespace CalamityMod.Projectiles.Summon Texture2D texture = ModContent.Request(Texture).Value; int frameHeight = texture.Height / Main.projFrames[Projectile.type]; int yStart = frameHeight * Projectile.frame; - Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, yStart, texture.Width, frameHeight)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, frameHeight / 2f), Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, yStart, texture.Width, frameHeight)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, frameHeight / 2f), Projectile.scale, SpriteEffects.None, 0); return false; } } diff --git a/Projectiles/Summon/CatastropheSummon.cs b/Projectiles/Summon/CatastropheSummon.cs index f414efbd18..8afec3f1a1 100644 --- a/Projectiles/Summon/CatastropheSummon.cs +++ b/Projectiles/Summon/CatastropheSummon.cs @@ -61,11 +61,11 @@ namespace CalamityMod.Projectiles.Summon Vector2 drawPos = Projectile.oldPos[i] + Projectile.Size * 0.5f - Main.screenPosition + Vector2.UnitY * Projectile.gfxOffY; Color color = Projectile.GetAlpha(lightColor) * ((float)(Projectile.oldPos.Length - i) / Projectile.oldPos.Length); - Main.spriteBatch.Draw(texture, drawPos, frame, color, afterimageRot, origin, Projectile.scale, sfxForThisAfterimage, 0f); + Main.EntitySpriteDraw(texture, drawPos, frame, color, afterimageRot, origin, Projectile.scale, sfxForThisAfterimage, 0); } SpriteEffects direction = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; - Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, frame, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, Projectile.scale, direction, 0f); + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, frame, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, Projectile.scale, direction, 0); return false; } diff --git a/Projectiles/Summon/CorroslimeMinion.cs b/Projectiles/Summon/CorroslimeMinion.cs index 6dde422a6c..be15e95005 100644 --- a/Projectiles/Summon/CorroslimeMinion.cs +++ b/Projectiles/Summon/CorroslimeMinion.cs @@ -84,7 +84,7 @@ namespace CalamityMod.Projectiles.Summon Texture2D texture2D13 = ModContent.Request(Texture).Value; int num214 = ModContent.Request(Texture).Value.Height / Main.projFrames[Projectile.type]; int y6 = num214 * Projectile.frame; - Main.spriteBatch.Draw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Summon/CosmicBlast.cs b/Projectiles/Summon/CosmicBlast.cs index 6c4dc951b8..b0437b1e3f 100644 --- a/Projectiles/Summon/CosmicBlast.cs +++ b/Projectiles/Summon/CosmicBlast.cs @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.Summon Texture2D texture2D13 = ModContent.Request(Texture).Value; int num214 = ModContent.Request(Texture).Value.Height / Main.projFrames[Projectile.type]; int y6 = num214 * Projectile.frame; - Main.spriteBatch.Draw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Summon/CosmicViperSplitRocket1.cs b/Projectiles/Summon/CosmicViperSplitRocket1.cs index 1ce0426aeb..c7b935969b 100644 --- a/Projectiles/Summon/CosmicViperSplitRocket1.cs +++ b/Projectiles/Summon/CosmicViperSplitRocket1.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Summon if (Projectile.ai[0] == 1f) { Texture2D texture = ModContent.Request("CalamityMod/Projectiles/Summon/CosmicViperSplitRocket2").Value; - Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, new Rectangle?(new Rectangle(0, 0, texture.Width, texture.Height)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, texture.Height / 2f), Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, new Rectangle?(new Rectangle(0, 0, texture.Width, texture.Height)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, texture.Height / 2f), Projectile.scale, SpriteEffects.None, 0); return false; } return true; diff --git a/Projectiles/Summon/CosmicViperSummon.cs b/Projectiles/Summon/CosmicViperSummon.cs index 917f6fe491..8488a8e47d 100644 --- a/Projectiles/Summon/CosmicViperSummon.cs +++ b/Projectiles/Summon/CosmicViperSummon.cs @@ -276,7 +276,7 @@ namespace CalamityMod.Projectiles.Summon if (Projectile.spriteDirection == -1) spriteEffects = SpriteEffects.FlipHorizontally; - Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, frameHeight)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, frameHeight / 2f), Projectile.scale, spriteEffects, 0); + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, frameHeight)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, frameHeight / 2f), Projectile.scale, spriteEffects, 0); return false; } @@ -290,7 +290,7 @@ namespace CalamityMod.Projectiles.Summon if (Projectile.spriteDirection == -1) spriteEffects = SpriteEffects.FlipHorizontally; - Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, frameHeight)), Color.White, Projectile.rotation, new Vector2(texture.Width / 2f, frameHeight / 2f), Projectile.scale, spriteEffects, 0); + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, frameHeight)), Color.White, Projectile.rotation, new Vector2(texture.Width / 2f, frameHeight / 2f), Projectile.scale, spriteEffects, 0); } } } diff --git a/Projectiles/Summon/CrimslimeMinion.cs b/Projectiles/Summon/CrimslimeMinion.cs index 955c66c1e0..740f74ceca 100644 --- a/Projectiles/Summon/CrimslimeMinion.cs +++ b/Projectiles/Summon/CrimslimeMinion.cs @@ -84,7 +84,7 @@ namespace CalamityMod.Projectiles.Summon Texture2D texture2D13 = ModContent.Request(Texture).Value; int num214 = texture2D13.Height / Main.projFrames[Projectile.type]; int y6 = num214 * Projectile.frame; - Main.spriteBatch.Draw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Summon/DankCreeperMinion.cs b/Projectiles/Summon/DankCreeperMinion.cs index 53150ca0b1..e190ad9d4a 100644 --- a/Projectiles/Summon/DankCreeperMinion.cs +++ b/Projectiles/Summon/DankCreeperMinion.cs @@ -217,7 +217,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { Texture2D tex = ModContent.Request(Texture).Value; - Main.spriteBatch.Draw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } } diff --git a/Projectiles/Summon/DazzlingStabber.cs b/Projectiles/Summon/DazzlingStabber.cs index 4a1ebc47f0..eae0446506 100644 --- a/Projectiles/Summon/DazzlingStabber.cs +++ b/Projectiles/Summon/DazzlingStabber.cs @@ -143,7 +143,7 @@ namespace CalamityMod.Projectiles.Summon // As well as how close the projectile is to pointing away from its rotation. color *= Utils.GetLerpValue(0.65f, 0.45f, Projectile.velocity.AngleBetween(-(Projectile.rotation + MathHelper.PiOver2).ToRotationVector2()) / MathHelper.Pi, true); - Main.spriteBatch.Draw(trailSegmentTexture, + Main.EntitySpriteDraw(trailSegmentTexture, Projectile.oldPos[i] + Projectile.Size * 0.5f + new Vector2(0f, 8f).RotatedBy(Projectile.rotation) - Main.screenPosition, null, color, @@ -151,7 +151,7 @@ namespace CalamityMod.Projectiles.Summon trailSegmentTexture.Size() * 0.5f, scale, SpriteEffects.None, - 0f); + 0); } } diff --git a/Projectiles/Summon/DeathstareEyeball.cs b/Projectiles/Summon/DeathstareEyeball.cs index 51bca756e8..4f9c37bb22 100644 --- a/Projectiles/Summon/DeathstareEyeball.cs +++ b/Projectiles/Summon/DeathstareEyeball.cs @@ -159,13 +159,13 @@ namespace CalamityMod.Projectiles.Summon Rectangle frame = eyeTexture.Frame(1, 4, 0, Projectile.frame); Vector2 origin = frame.Size() * 0.5f; SpriteEffects spriteEffects = Owner.gravDir == 1 ? SpriteEffects.None : SpriteEffects.FlipVertically; - Main.spriteBatch.Draw(eyeTexture, Projectile.Center - Main.screenPosition, frame, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(eyeTexture, Projectile.Center - Main.screenPosition, frame, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); // Pupil drawing. Texture2D pupilTexture = ModContent.Request("CalamityMod/Projectiles/Summon/DeathstareEyePupil").Value; Vector2 pupilDrawPosition = Projectile.Center - Main.screenPosition + PupilAngle.ToRotationVector2() * PupilOutwardness; pupilDrawPosition -= Vector2.UnitY * 4f; - Main.spriteBatch.Draw(pupilTexture, pupilDrawPosition, null, Projectile.GetAlpha(lightColor), PupilAngle, pupilTexture.Size() * 0.5f, PupilScale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(pupilTexture, pupilDrawPosition, null, Projectile.GetAlpha(lightColor), PupilAngle, pupilTexture.Size() * 0.5f, PupilScale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Summon/DormantBrimseekerBab.cs b/Projectiles/Summon/DormantBrimseekerBab.cs index 4948e881c7..acc04c7c5f 100644 --- a/Projectiles/Summon/DormantBrimseekerBab.cs +++ b/Projectiles/Summon/DormantBrimseekerBab.cs @@ -184,7 +184,7 @@ namespace CalamityMod.Projectiles.Summon } Rectangle flameFrameRectangle = flameTexture.Frame(1, 4, 0, yFrame); Vector2 flameOrigin = new Vector2(flameTexture.Width / 2, flameTexture.Height / 8 + 14); - Main.spriteBatch.Draw(flameTexture, + Main.EntitySpriteDraw(flameTexture, new Vector2(Projectile.oldPos[oldPositionDrawIndex].X - Main.screenPosition.X + Projectile.width / 2 - projectileTexture.Width * Projectile.scale / 2f + modifiedProjectileTexture.X * Projectile.scale, Projectile.oldPos[oldPositionDrawIndex].Y - Main.screenPosition.Y + Projectile.height - projectileTexture.Height * Projectile.scale / Main.projFrames[Projectile.type] + 4f + modifiedProjectileTexture.Y * Projectile.scale + Projectile.gfxOffY), new Rectangle?(flameFrameRectangle), drawColor, @@ -192,7 +192,7 @@ namespace CalamityMod.Projectiles.Summon flameOrigin, MathHelper.Lerp(0.1f, 1.2f, (10f - oldPositionDrawIndex) / 10f), spriteEffects, - 0f); + 0); } } } diff --git a/Projectiles/Summon/ElementalAxeMinion.cs b/Projectiles/Summon/ElementalAxeMinion.cs index 8f3850b45f..17db7ea70f 100644 --- a/Projectiles/Summon/ElementalAxeMinion.cs +++ b/Projectiles/Summon/ElementalAxeMinion.cs @@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { Texture2D tex = ModContent.Request(Texture).Value; - Main.spriteBatch.Draw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Summon/EndoBeam.cs b/Projectiles/Summon/EndoBeam.cs index 734bcab70b..12f89ebcca 100644 --- a/Projectiles/Summon/EndoBeam.cs +++ b/Projectiles/Summon/EndoBeam.cs @@ -149,7 +149,7 @@ namespace CalamityMod.Projectiles.Summon // Laser tail logic - Main.spriteBatch.Draw(laserTailTexture, Projectile.Center - Main.screenPosition, null, drawColor, Projectile.rotation, laserTailTexture.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(laserTailTexture, Projectile.Center - Main.screenPosition, null, drawColor, Projectile.rotation, laserTailTexture.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); // Laser body logic @@ -166,7 +166,7 @@ namespace CalamityMod.Projectiles.Summon { sourceRectangle.Height = (int)(laserLength - laserLengthDelta); } - Main.spriteBatch.Draw(laserBodyTexture, centerDelta - Main.screenPosition, new Rectangle?(sourceRectangle), drawColor, Projectile.rotation, new Vector2((float)(sourceRectangle.Width / 2), 0f), Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(laserBodyTexture, centerDelta - Main.screenPosition, new Rectangle?(sourceRectangle), drawColor, Projectile.rotation, new Vector2((float)(sourceRectangle.Width / 2), 0f), Projectile.scale, SpriteEffects.None, 0); laserLengthDelta += (float)sourceRectangle.Height * Projectile.scale; centerDelta += Projectile.velocity * (float)sourceRectangle.Height * Projectile.scale; sourceRectangle.Y += 16; @@ -179,7 +179,7 @@ namespace CalamityMod.Projectiles.Summon // Laser head logic - Main.spriteBatch.Draw(laserHeadTexture, centerDelta - Main.screenPosition, null, drawColor, Projectile.rotation, laserHeadTexture.Frame(1, 1, 0, 0).Top(), Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(laserHeadTexture, centerDelta - Main.screenPosition, null, drawColor, Projectile.rotation, laserHeadTexture.Frame(1, 1, 0, 0).Top(), Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Summon/EndoCooperBody.cs b/Projectiles/Summon/EndoCooperBody.cs index 83f235202a..ef8563085b 100644 --- a/Projectiles/Summon/EndoCooperBody.cs +++ b/Projectiles/Summon/EndoCooperBody.cs @@ -341,7 +341,7 @@ namespace CalamityMod.Projectiles.Summon { Texture2D texture = ModContent.Request("CalamityMod/Projectiles/Summon/EndoCooperBody_Glow").Value; Rectangle frame = new Rectangle(0, 0, texture.Width, texture.Height); - Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, frame, Color.LightSkyBlue, Projectile.rotation, Projectile.Size / 2, 1f, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, frame, Color.LightSkyBlue, Projectile.rotation, Projectile.Size / 2, 1f, SpriteEffects.None, 0); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Summon/EndoCooperLimbs.cs b/Projectiles/Summon/EndoCooperLimbs.cs index 9c499acc5c..1288676c57 100644 --- a/Projectiles/Summon/EndoCooperLimbs.cs +++ b/Projectiles/Summon/EndoCooperLimbs.cs @@ -138,7 +138,7 @@ namespace CalamityMod.Projectiles.Summon Texture2D texture = ModContent.Request("CalamityMod/Projectiles/Summon/EndoCooperBody_Glow").Value; Rectangle frame = new Rectangle(0, 0, texture.Width, texture.Height); - Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, frame, Color.LightSkyBlue, Projectile.rotation, Projectile.Size / 2, 1f, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, frame, Color.LightSkyBlue, Projectile.rotation, Projectile.Size / 2, 1f, SpriteEffects.None, 0); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Summon/EndoHydraHead.cs b/Projectiles/Summon/EndoHydraHead.cs index 08e2418964..33877ad532 100644 --- a/Projectiles/Summon/EndoHydraHead.cs +++ b/Projectiles/Summon/EndoHydraHead.cs @@ -217,7 +217,7 @@ namespace CalamityMod.Projectiles.Summon continue; float angleAtPoint = i == chainPoints.Count - 1 ? (end - chainPoints[i]).ToRotation() : (chainPoints[i + 1] - chainPoints[i]).ToRotation(); angleAtPoint += MathHelper.PiOver2; - Main.spriteBatch.Draw(chain, + Main.EntitySpriteDraw(chain, positionAtPoint - Main.screenPosition, null, Color.Lerp(Color.White, Color.Transparent, 0.6f), @@ -225,13 +225,13 @@ namespace CalamityMod.Projectiles.Summon chain.Size() / 2f, 1f, SpriteEffects.None, - 0f); + 0); } // PreDraw is used instead of PostDraw because of draw order. Drawing the chains after the head // would cause them to be drawn on top of the head, which we do not want. Texture2D headTexture = ModContent.Request(Texture).Value; - Main.spriteBatch.Draw(headTexture, + Main.EntitySpriteDraw(headTexture, Projectile.Center - Main.screenPosition + Vector2.UnitY * Projectile.gfxOffY, headTexture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame), lightColor, @@ -239,7 +239,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.Size * 0.5f, Projectile.scale, Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, - 0f); + 0); return false; } public override bool? CanDamage() => false; diff --git a/Projectiles/Summon/FlowersOfMortalityPetal.cs b/Projectiles/Summon/FlowersOfMortalityPetal.cs index e47d75814e..0d4bded368 100644 --- a/Projectiles/Summon/FlowersOfMortalityPetal.cs +++ b/Projectiles/Summon/FlowersOfMortalityPetal.cs @@ -88,8 +88,8 @@ namespace CalamityMod.Projectiles.Summon Color drawColor = Main.hslToRgb(Hue, 0.95f, 0.5f) * 2.3f; Vector2 drawPosition = Projectile.Center - Main.screenPosition; - Main.spriteBatch.Draw(petalTexture, drawPosition, null, Projectile.GetAlpha(drawColor), Projectile.rotation, petalTexture.Size() * 0.5f, Projectile.scale, SpriteEffects.None, 0); - Main.spriteBatch.Draw(coreTexture, drawPosition, null, Projectile.GetAlpha(lightColor), 0f, coreTexture.Size() * 0.5f, Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(petalTexture, drawPosition, null, Projectile.GetAlpha(drawColor), Projectile.rotation, petalTexture.Size() * 0.5f, Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(coreTexture, drawPosition, null, Projectile.GetAlpha(lightColor), 0f, coreTexture.Size() * 0.5f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Summon/FrostMistFriendly.cs b/Projectiles/Summon/FrostMistFriendly.cs index 6f9d64a854..58c17ceb66 100644 --- a/Projectiles/Summon/FrostMistFriendly.cs +++ b/Projectiles/Summon/FrostMistFriendly.cs @@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Summon Texture2D texture2D13 = ModContent.Request(Texture).Value; int num214 = texture2D13.Height / Main.projFrames[Projectile.type]; int y6 = num214 * Projectile.frame; - Main.spriteBatch.Draw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Summon/GammaHead.cs b/Projectiles/Summon/GammaHead.cs index ba4de326b6..5d97f162b7 100644 --- a/Projectiles/Summon/GammaHead.cs +++ b/Projectiles/Summon/GammaHead.cs @@ -241,7 +241,7 @@ namespace CalamityMod.Projectiles.Summon continue; float angleAtPoint = i == chainPoints.Count - 1 ? (end - chainPoints[i]).ToRotation() : (chainPoints[i + 1] - chainPoints[i]).ToRotation(); angleAtPoint += MathHelper.PiOver2; - Main.spriteBatch.Draw(chain, + Main.EntitySpriteDraw(chain, positionAtPoint - Main.screenPosition, null, Color.Lerp(Color.White, Color.Transparent, 0.6f), @@ -249,11 +249,11 @@ namespace CalamityMod.Projectiles.Summon chain.Size() / 2f, 1f, SpriteEffects.None, - 0f); + 0); } Texture2D headTexture = ModContent.Request(Texture).Value; - Main.spriteBatch.Draw(headTexture, + Main.EntitySpriteDraw(headTexture, Projectile.Center - Main.screenPosition + Vector2.UnitY * Projectile.gfxOffY, headTexture.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame), lightColor, @@ -261,7 +261,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.Size * 0.5f, Projectile.scale, Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, - 0f); + 0); return false; } diff --git a/Projectiles/Summon/HerringMinion.cs b/Projectiles/Summon/HerringMinion.cs index 3ce4042494..137fa312de 100644 --- a/Projectiles/Summon/HerringMinion.cs +++ b/Projectiles/Summon/HerringMinion.cs @@ -93,7 +93,7 @@ namespace CalamityMod.Projectiles.Summon Texture2D texture2D13 = ModContent.Request(Texture).Value; int num214 = texture2D13.Height / Main.projFrames[Projectile.type]; int y6 = num214 * Projectile.frame; - Main.spriteBatch.Draw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Summon/IceClasperMinion.cs b/Projectiles/Summon/IceClasperMinion.cs index 6cda1e8c30..cca625285e 100644 --- a/Projectiles/Summon/IceClasperMinion.cs +++ b/Projectiles/Summon/IceClasperMinion.cs @@ -90,7 +90,7 @@ namespace CalamityMod.Projectiles.Summon Texture2D texture2D13 = ModContent.Request(Texture).Value; int num214 = texture2D13.Height / Main.projFrames[Projectile.type]; int y6 = num214 * Projectile.frame; - Main.spriteBatch.Draw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Summon/IgneousBlade.cs b/Projectiles/Summon/IgneousBlade.cs index 765d72a531..a8c3ad8692 100644 --- a/Projectiles/Summon/IgneousBlade.cs +++ b/Projectiles/Summon/IgneousBlade.cs @@ -141,12 +141,12 @@ namespace CalamityMod.Projectiles.Summon Color color = Color.Lerp(Color.White, Color.Red, i / (float)Projectile.oldPos.Length) * ((Projectile.oldPos.Length - i) / (float)Projectile.oldPos.Length); float scale = MathHelper.Lerp(Projectile.scale * 1.35f, Projectile.scale * 0.6f, i / (float)Projectile.oldPos.Length); - Main.spriteBatch.Draw(texture, drawPos, new Rectangle?(rectangle), color, + Main.EntitySpriteDraw(texture, drawPos, new Rectangle?(rectangle), color, Projectile.rotation, rectangle.Size() / 2f, scale, SpriteEffects.None, 0); } } - Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Rectangle?(rectangle), Color.White, + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Rectangle?(rectangle), Color.White, Projectile.rotation, rectangle.Size() / 2f, 1.35f, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Summon/LostSoulGiant.cs b/Projectiles/Summon/LostSoulGiant.cs index f0fba47dcd..b4f5df8a06 100644 --- a/Projectiles/Summon/LostSoulGiant.cs +++ b/Projectiles/Summon/LostSoulGiant.cs @@ -82,7 +82,7 @@ namespace CalamityMod.Projectiles.Summon Vector2 drawPosition = Projectile.oldPos[j] + Projectile.Size * 0.5f + (MathHelper.TwoPi * i / 4f).ToRotationVector2() * 1.5f - Main.screenPosition; float rotation = Projectile.oldRot[j]; - Main.spriteBatch.Draw(texture, drawPosition, frame, drawColor, rotation, frame.Size() * 0.5f, Projectile.scale, direction, 0f); + Main.EntitySpriteDraw(texture, drawPosition, frame, drawColor, rotation, frame.Size() * 0.5f, Projectile.scale, direction, 0); } } diff --git a/Projectiles/Summon/LostSoulGold.cs b/Projectiles/Summon/LostSoulGold.cs index d0d78bc3c8..6ef69c1fda 100644 --- a/Projectiles/Summon/LostSoulGold.cs +++ b/Projectiles/Summon/LostSoulGold.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Summon Vector2 drawPosition = Projectile.oldPos[j] + Projectile.Size * 0.5f + (MathHelper.TwoPi * i / 4f).ToRotationVector2() * 0.8f - Main.screenPosition; float rotation = Projectile.oldRot[j]; - Main.spriteBatch.Draw(texture, drawPosition, frame, drawColor, rotation, frame.Size() * 0.5f, Projectile.scale, direction, 0f); + Main.EntitySpriteDraw(texture, drawPosition, frame, drawColor, rotation, frame.Size() * 0.5f, Projectile.scale, direction, 0); } } diff --git a/Projectiles/Summon/LostSoulLarge.cs b/Projectiles/Summon/LostSoulLarge.cs index 3c99949de8..3019e30bad 100644 --- a/Projectiles/Summon/LostSoulLarge.cs +++ b/Projectiles/Summon/LostSoulLarge.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Projectiles.Summon Vector2 drawPosition = Projectile.oldPos[j] + Projectile.Size * 0.5f + (MathHelper.TwoPi * i / 4f).ToRotationVector2() * 1.25f - Main.screenPosition; float rotation = Projectile.oldRot[j]; - Main.spriteBatch.Draw(texture, drawPosition, frame, drawColor, rotation, frame.Size() * 0.5f, Projectile.scale, direction, 0f); + Main.EntitySpriteDraw(texture, drawPosition, frame, drawColor, rotation, frame.Size() * 0.5f, Projectile.scale, direction, 0); } } diff --git a/Projectiles/Summon/LostSoulSmall.cs b/Projectiles/Summon/LostSoulSmall.cs index fe24660f40..5ba4d93582 100644 --- a/Projectiles/Summon/LostSoulSmall.cs +++ b/Projectiles/Summon/LostSoulSmall.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Summon Vector2 drawPosition = Projectile.oldPos[j] + Projectile.Size * 0.5f + (MathHelper.TwoPi * i / 4f).ToRotationVector2() * 0.8f - Main.screenPosition; float rotation = Projectile.oldRot[j]; - Main.spriteBatch.Draw(texture, drawPosition, frame, drawColor, rotation, frame.Size() * 0.5f, Projectile.scale, direction, 0f); + Main.EntitySpriteDraw(texture, drawPosition, frame, drawColor, rotation, frame.Size() * 0.5f, Projectile.scale, direction, 0); } } diff --git a/Projectiles/Summon/MagicBat.cs b/Projectiles/Summon/MagicBat.cs index bf9ed7c0af..618db67ee6 100644 --- a/Projectiles/Summon/MagicBat.cs +++ b/Projectiles/Summon/MagicBat.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { Texture2D tex = ModContent.Request(Texture).Value; - Main.spriteBatch.Draw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } } diff --git a/Projectiles/Summon/MechwormBody.cs b/Projectiles/Summon/MechwormBody.cs index ebebb134eb..41f213b321 100644 --- a/Projectiles/Summon/MechwormBody.cs +++ b/Projectiles/Summon/MechwormBody.cs @@ -189,7 +189,7 @@ namespace CalamityMod.Projectiles.Summon { Texture2D tex = ModContent.Request(Texture).Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition; - Main.spriteBatch.Draw(tex, drawPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(tex, drawPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Summon/MechwormHead.cs b/Projectiles/Summon/MechwormHead.cs index d6e51bb3ac..5207fd3008 100644 --- a/Projectiles/Summon/MechwormHead.cs +++ b/Projectiles/Summon/MechwormHead.cs @@ -417,7 +417,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(ref Color lightColor) { Texture2D tex = ModContent.Request(Texture).Value; - Main.spriteBatch.Draw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } @@ -427,7 +427,7 @@ namespace CalamityMod.Projectiles.Summon return; Vector2 origin = new Vector2(21f, 25f); - Main.spriteBatch.Draw(ModContent.Request("CalamityMod/Projectiles/Summon/MechwormHeadGlow").Value, Projectile.Center - Main.screenPosition, null, Color.White, Projectile.rotation, origin, 1f, SpriteEffects.None, 0); + Main.EntitySpriteDraw(ModContent.Request("CalamityMod/Projectiles/Summon/MechwormHeadGlow").Value, Projectile.Center - Main.screenPosition, null, Color.White, Projectile.rotation, origin, 1f, SpriteEffects.None, 0); } public override void DrawBehind(int index, List behindNPCsAndTiles, List behindNPCs, List behindProjectiles, List overPlayers, List overWiresUI) diff --git a/Projectiles/Summon/MechwormTail.cs b/Projectiles/Summon/MechwormTail.cs index d89ed799f7..6f084ff56a 100644 --- a/Projectiles/Summon/MechwormTail.cs +++ b/Projectiles/Summon/MechwormTail.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Summon { Texture2D tex = ModContent.Request(Texture).Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition; - Main.spriteBatch.Draw(tex, drawPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(tex, drawPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Summon/MechwormTeleportRift.cs b/Projectiles/Summon/MechwormTeleportRift.cs index ebcd975663..284ede4892 100644 --- a/Projectiles/Summon/MechwormTeleportRift.cs +++ b/Projectiles/Summon/MechwormTeleportRift.cs @@ -71,25 +71,25 @@ namespace CalamityMod.Projectiles.Summon if (Projectile.spriteDirection == -1) spriteEffects = SpriteEffects.FlipHorizontally; - Main.spriteBatch.Draw(texture, drawPos, null, colorA, MathHelper.PiOver2, origin, scale, spriteEffects, 0); - Main.spriteBatch.Draw(texture, drawPos, null, colorA, 0f, origin, scale, spriteEffects, 0); - Main.spriteBatch.Draw(texture, drawPos, null, colorB, MathHelper.PiOver2, origin, scale * 0.8f, spriteEffects, 0); - Main.spriteBatch.Draw(texture, drawPos, null, colorB, 0f, origin, scale * 0.8f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, colorA, MathHelper.PiOver2, origin, scale, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, colorA, 0f, origin, scale, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, colorB, MathHelper.PiOver2, origin, scale * 0.8f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, colorB, 0f, origin, scale * 0.8f, spriteEffects, 0); - Main.spriteBatch.Draw(texture, drawPos, null, colorA, MathHelper.PiOver2 + GeneralRotationalOffset * 0.25f, origin, scale, spriteEffects, 0); - Main.spriteBatch.Draw(texture, drawPos, null, colorA, GeneralRotationalOffset * 0.25f, origin, scale, spriteEffects, 0); - Main.spriteBatch.Draw(texture, drawPos, null, colorB, MathHelper.PiOver2 + GeneralRotationalOffset * 0.5f, origin, scale * 0.8f, spriteEffects, 0); - Main.spriteBatch.Draw(texture, drawPos, null, colorB, GeneralRotationalOffset * 0.5f, origin, scale * 0.8f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, colorA, MathHelper.PiOver2 + GeneralRotationalOffset * 0.25f, origin, scale, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, colorA, GeneralRotationalOffset * 0.25f, origin, scale, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, colorB, MathHelper.PiOver2 + GeneralRotationalOffset * 0.5f, origin, scale * 0.8f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, colorB, GeneralRotationalOffset * 0.5f, origin, scale * 0.8f, spriteEffects, 0); - Main.spriteBatch.Draw(texture, drawPos, null, colorA, MathHelper.PiOver4, origin, scale * 0.6f, spriteEffects, 0); - Main.spriteBatch.Draw(texture, drawPos, null, colorA, MathHelper.PiOver4 * 3f, origin, scale * 0.6f, spriteEffects, 0); - Main.spriteBatch.Draw(texture, drawPos, null, colorB, MathHelper.PiOver4, origin, scale * 0.4f, spriteEffects, 0); - Main.spriteBatch.Draw(texture, drawPos, null, colorB, MathHelper.PiOver4 * 3f, origin, scale * 0.4f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, colorA, MathHelper.PiOver4, origin, scale * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, colorA, MathHelper.PiOver4 * 3f, origin, scale * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, colorB, MathHelper.PiOver4, origin, scale * 0.4f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, colorB, MathHelper.PiOver4 * 3f, origin, scale * 0.4f, spriteEffects, 0); - Main.spriteBatch.Draw(texture, drawPos, null, colorA, MathHelper.PiOver4 + GeneralRotationalOffset * 0.75f, origin, scale * 0.6f, spriteEffects, 0); - Main.spriteBatch.Draw(texture, drawPos, null, colorA, MathHelper.PiOver4 * 3f + GeneralRotationalOffset * 0.75f, origin, scale * 0.6f, spriteEffects, 0); - Main.spriteBatch.Draw(texture, drawPos, null, colorB, MathHelper.PiOver4 + GeneralRotationalOffset, origin, scale * 0.4f, spriteEffects, 0); - Main.spriteBatch.Draw(texture, drawPos, null, colorB, MathHelper.PiOver4 * 3f + GeneralRotationalOffset, origin, scale * 0.4f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, colorA, MathHelper.PiOver4 + GeneralRotationalOffset * 0.75f, origin, scale * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, colorA, MathHelper.PiOver4 * 3f + GeneralRotationalOffset * 0.75f, origin, scale * 0.6f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, colorB, MathHelper.PiOver4 + GeneralRotationalOffset, origin, scale * 0.4f, spriteEffects, 0); + Main.EntitySpriteDraw(texture, drawPos, null, colorB, MathHelper.PiOver4 * 3f + GeneralRotationalOffset, origin, scale * 0.4f, spriteEffects, 0); return false; } diff --git a/Projectiles/Summon/MidnightSunBeam.cs b/Projectiles/Summon/MidnightSunBeam.cs index 7bff9a5bbf..93d050a24c 100644 --- a/Projectiles/Summon/MidnightSunBeam.cs +++ b/Projectiles/Summon/MidnightSunBeam.cs @@ -120,7 +120,7 @@ namespace CalamityMod.Projectiles.Summon // Laser tail logic - Main.spriteBatch.Draw(laserTailTexture, Projectile.Center - Main.screenPosition, null, drawColor, Projectile.rotation, laserTailTexture.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(laserTailTexture, Projectile.Center - Main.screenPosition, null, drawColor, Projectile.rotation, laserTailTexture.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); // Laser body logic @@ -137,7 +137,7 @@ namespace CalamityMod.Projectiles.Summon { sourceRectangle.Height = (int)(laserLength - laserLengthDelta); } - Main.spriteBatch.Draw(laserBodyTexture, centerDelta - Main.screenPosition, new Rectangle?(sourceRectangle), drawColor, Projectile.rotation, new Vector2(sourceRectangle.Width / 2f, 0f), Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(laserBodyTexture, centerDelta - Main.screenPosition, new Rectangle?(sourceRectangle), drawColor, Projectile.rotation, new Vector2(sourceRectangle.Width / 2f, 0f), Projectile.scale, SpriteEffects.None, 0); laserLengthDelta += sourceRectangle.Height * Projectile.scale; centerDelta += Projectile.velocity * sourceRectangle.Height * Projectile.scale; sourceRectangle.Y += 16; @@ -150,7 +150,7 @@ namespace CalamityMod.Projectiles.Summon // Laser head logic - Main.spriteBatch.Draw(laserHeadTexture, centerDelta - Main.screenPosition, null, drawColor, Projectile.rotation, laserHeadTexture.Frame(1, 1, 0, 0).Top(), Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(laserHeadTexture, centerDelta - Main.screenPosition, null, drawColor, Projectile.rotation, laserHeadTexture.Frame(1, 1, 0, 0).Top(), Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Summon/MiniSandShark.cs b/Projectiles/Summon/MiniSandShark.cs index f4a831cfdc..08c8841a73 100644 --- a/Projectiles/Summon/MiniSandShark.cs +++ b/Projectiles/Summon/MiniSandShark.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Summon { SpriteEffects spriteEffects = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; Texture2D texture = ModContent.Request(Texture).Value; - Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, 0, texture.Width, texture.Height)), Projectile.GetAlpha(lightColor), Projectile.rotation, texture.Size() / 2f, Projectile.scale, spriteEffects, 0); + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, 0, texture.Width, texture.Height)), Projectile.GetAlpha(lightColor), Projectile.rotation, texture.Size() / 2f, Projectile.scale, spriteEffects, 0); return false; } diff --git a/Projectiles/Summon/OldDukeSharkVomit.cs b/Projectiles/Summon/OldDukeSharkVomit.cs index 0dc292b570..943c10e080 100644 --- a/Projectiles/Summon/OldDukeSharkVomit.cs +++ b/Projectiles/Summon/OldDukeSharkVomit.cs @@ -106,7 +106,7 @@ namespace CalamityMod.Projectiles.Summon { SpriteEffects spriteEffects = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; Texture2D texture = ModContent.Request(Texture).Value; - Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, 0, texture.Width, texture.Height)), Projectile.GetAlpha(lightColor), Projectile.rotation, texture.Size() / 2f, Projectile.scale, spriteEffects, 0); + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, 0, texture.Width, texture.Height)), Projectile.GetAlpha(lightColor), Projectile.rotation, texture.Size() / 2f, Projectile.scale, spriteEffects, 0); return false; } diff --git a/Projectiles/Summon/PerditionBeacon.cs b/Projectiles/Summon/PerditionBeacon.cs index 25f1e0d07e..cb0752680d 100644 --- a/Projectiles/Summon/PerditionBeacon.cs +++ b/Projectiles/Summon/PerditionBeacon.cs @@ -160,7 +160,7 @@ namespace CalamityMod.Projectiles.Summon Vector2 drawPosition = Target.Bottom - Main.screenPosition; drawPosition.Y -= 12f; Color drawColor = Color.White * DownwardCrossFade; - Main.spriteBatch.Draw(crossTexture, drawPosition, null, drawColor, Projectile.rotation, crossTexture.Size() * 0.5f, Projectile.scale * 0.85f, SpriteEffects.None, 0); + Main.EntitySpriteDraw(crossTexture, drawPosition, null, drawColor, Projectile.rotation, crossTexture.Size() * 0.5f, Projectile.scale * 0.85f, SpriteEffects.None, 0); } public override bool? CanDamage() => false; diff --git a/Projectiles/Summon/PinkButterfly.cs b/Projectiles/Summon/PinkButterfly.cs index fd2b9cb4f7..3499f5e579 100644 --- a/Projectiles/Summon/PinkButterfly.cs +++ b/Projectiles/Summon/PinkButterfly.cs @@ -246,7 +246,7 @@ namespace CalamityMod.Projectiles.Summon Texture2D texture2D13 = ModContent.Request(Texture).Value; int num214 = ModContent.Request(Texture).Value.Height / Main.projFrames[Projectile.type]; int y6 = num214 * Projectile.frame; - Main.spriteBatch.Draw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), Projectile.scale, spriteEffects, 0); + Main.EntitySpriteDraw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), Projectile.scale, spriteEffects, 0); return false; } diff --git a/Projectiles/Summon/PlagueBeeSmall.cs b/Projectiles/Summon/PlagueBeeSmall.cs index 59e064945f..6be4e0d844 100644 --- a/Projectiles/Summon/PlagueBeeSmall.cs +++ b/Projectiles/Summon/PlagueBeeSmall.cs @@ -163,7 +163,7 @@ namespace CalamityMod.Projectiles.Summon SpriteEffects spriteEffects = SpriteEffects.None; if (Projectile.spriteDirection == -1) spriteEffects = SpriteEffects.FlipHorizontally; - Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, drawStart, texture.Width, frameHeight)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture.Width / 2f, (float)frameHeight / 2f), Projectile.scale, spriteEffects, 0); + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, drawStart, texture.Width, frameHeight)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture.Width / 2f, (float)frameHeight / 2f), Projectile.scale, spriteEffects, 0); return false; } diff --git a/Projectiles/Summon/PlantSummon.cs b/Projectiles/Summon/PlantSummon.cs index db2df809af..61f73c64c5 100644 --- a/Projectiles/Summon/PlantSummon.cs +++ b/Projectiles/Summon/PlantSummon.cs @@ -493,7 +493,7 @@ namespace CalamityMod.Projectiles.Summon if (Projectile.spriteDirection == -1) spriteEffects = SpriteEffects.FlipHorizontally; - Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, frameHeight, texture.Width, height)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture.Width / 2f, (float)height / 2f), Projectile.scale, spriteEffects, 0); + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, frameHeight, texture.Width, height)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture.Width / 2f, (float)height / 2f), Projectile.scale, spriteEffects, 0); return false; } } diff --git a/Projectiles/Summon/PlantTentacle.cs b/Projectiles/Summon/PlantTentacle.cs index ff7d962a23..8a2bae95dd 100644 --- a/Projectiles/Summon/PlantTentacle.cs +++ b/Projectiles/Summon/PlantTentacle.cs @@ -183,7 +183,7 @@ namespace CalamityMod.Projectiles.Summon goal += value2 * textureHeight; drawVector = source - goal; Color color = Lighting.GetColor((int)goal.X / 16, (int)(goal.Y / 16f)); - Main.spriteBatch.Draw(chain, goal - Main.screenPosition, sourceRectangle, color, rotation, chain.Size() / 2f, 1f, SpriteEffects.None, 0); + Main.EntitySpriteDraw(chain, goal - Main.screenPosition, sourceRectangle, color, rotation, chain.Size() / 2f, 1f, SpriteEffects.None, 0); } } return true; @@ -218,7 +218,7 @@ namespace CalamityMod.Projectiles.Summon spriteEffects = SpriteEffects.FlipHorizontally; Color color = Lighting.GetColor((int)hostPlant.Center.X / 16, (int)(hostPlant.Center.Y / 16f)); - Main.spriteBatch.Draw(texture, hostPlant.Center - Main.screenPosition + new Vector2(0f, hostPlant.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, frameHeight, texture.Width, height)), color, hostPlant.rotation, new Vector2((float)texture.Width / 2f, (float)height / 2f), hostPlant.scale, spriteEffects, 0); + Main.EntitySpriteDraw(texture, hostPlant.Center - Main.screenPosition + new Vector2(0f, hostPlant.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, frameHeight, texture.Width, height)), color, hostPlant.rotation, new Vector2((float)texture.Width / 2f, (float)height / 2f), hostPlant.scale, spriteEffects, 0); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Summon/PolypLauncherShrapnel.cs b/Projectiles/Summon/PolypLauncherShrapnel.cs index 7229d636cf..00fbb6c653 100644 --- a/Projectiles/Summon/PolypLauncherShrapnel.cs +++ b/Projectiles/Summon/PolypLauncherShrapnel.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Summon { texture = ModContent.Request("CalamityMod/Projectiles/Summon/PolypLauncherShrapnel3").Value; } - Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, new Rectangle?(new Rectangle(0, 0, texture.Width, texture.Height)), Projectile.GetAlpha(lightColor), Projectile.rotation, texture.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, new Rectangle?(new Rectangle(0, 0, texture.Width, texture.Height)), Projectile.GetAlpha(lightColor), Projectile.rotation, texture.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } } diff --git a/Projectiles/Summon/ProfanedSoulCrystalProjectiles.cs b/Projectiles/Summon/ProfanedSoulCrystalProjectiles.cs index 81ce0e37f1..ad996db2bd 100644 --- a/Projectiles/Summon/ProfanedSoulCrystalProjectiles.cs +++ b/Projectiles/Summon/ProfanedSoulCrystalProjectiles.cs @@ -127,7 +127,7 @@ namespace CalamityMod.Projectiles.Summon Texture2D texture2D13 = ModContent.Request(Texture).Value; int num214 = ModContent.Request(Texture).Value.Height / Main.projFrames[Projectile.type]; int y6 = num214 * Projectile.frame; - Main.spriteBatch.Draw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), Projectile.scale, SpriteEffects.None, 0); CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 3, texture2D13); return false; } diff --git a/Projectiles/Summon/PurpleButterfly.cs b/Projectiles/Summon/PurpleButterfly.cs index e25f4c5811..8443681b48 100644 --- a/Projectiles/Summon/PurpleButterfly.cs +++ b/Projectiles/Summon/PurpleButterfly.cs @@ -90,7 +90,7 @@ namespace CalamityMod.Projectiles.Summon Texture2D texture2D13 = ModContent.Request(Texture).Value; int num214 = ModContent.Request(Texture).Value.Height / Main.projFrames[Projectile.type]; int y6 = num214 * Projectile.frame; - Main.spriteBatch.Draw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), Projectile.scale, spriteEffects, 0); + Main.EntitySpriteDraw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), Projectile.scale, spriteEffects, 0); return false; } diff --git a/Projectiles/Summon/SandMark.cs b/Projectiles/Summon/SandMark.cs index 74d5c37441..bbfd3a07ba 100644 --- a/Projectiles/Summon/SandMark.cs +++ b/Projectiles/Summon/SandMark.cs @@ -149,9 +149,9 @@ namespace CalamityMod.Projectiles.Summon Color alpha5 = Projectile.GetAlpha(color25); Vector2 origin7 = rectangle11.Size() / 2f; Color color47 = Main.hslToRgb(0.25f, 1f, 1f).MultiplyRGBA(new Color(255, 255, 255, 0)); - Main.spriteBatch.Draw(texture2D27, vector38, new Microsoft.Xna.Framework.Rectangle?(rectangle11), color47, 0f, origin7, new Vector2(1f, 5f) * Projectile.scale * 2f, SpriteEffects.None, 0); - Main.spriteBatch.Draw(texture2D27, vector38, new Microsoft.Xna.Framework.Rectangle?(rectangle11), alpha5, Projectile.rotation, origin7, Projectile.scale, SpriteEffects.None, 0); - Main.spriteBatch.Draw(texture2D27, vector38, new Microsoft.Xna.Framework.Rectangle?(rectangle11), alpha5, 0f, origin7, new Vector2(1f, 8f) * Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture2D27, vector38, new Microsoft.Xna.Framework.Rectangle?(rectangle11), color47, 0f, origin7, new Vector2(1f, 5f) * Projectile.scale * 2f, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture2D27, vector38, new Microsoft.Xna.Framework.Rectangle?(rectangle11), alpha5, Projectile.rotation, origin7, Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture2D27, vector38, new Microsoft.Xna.Framework.Rectangle?(rectangle11), alpha5, 0f, origin7, new Vector2(1f, 8f) * Projectile.scale, SpriteEffects.None, 0); return false; } } diff --git a/Projectiles/Summon/SandTornado.cs b/Projectiles/Summon/SandTornado.cs index 727bb1a00c..de78247c67 100644 --- a/Projectiles/Summon/SandTornado.cs +++ b/Projectiles/Summon/SandTornado.cs @@ -147,7 +147,7 @@ namespace CalamityMod.Projectiles.Summon vector34.Y = 0f; vector34.X = 0f; vector34 += new Vector2(value33.X, num236) - Main.screenPosition; - Main.spriteBatch.Draw(texture2D23, vector34, new Microsoft.Xna.Framework.Rectangle?(rectangle9), color39, num233 + num238, origin3, 1f + num239, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture2D23, vector34, new Microsoft.Xna.Framework.Rectangle?(rectangle9), color39, num233 + num238, origin3, 1f + num239, SpriteEffects.None, 0); } return false; } diff --git a/Projectiles/Summon/SandnadoMinion.cs b/Projectiles/Summon/SandnadoMinion.cs index 79218e662a..1a26afd25c 100644 --- a/Projectiles/Summon/SandnadoMinion.cs +++ b/Projectiles/Summon/SandnadoMinion.cs @@ -262,7 +262,7 @@ namespace CalamityMod.Projectiles.Summon Texture2D texture = ModContent.Request(Texture).Value; int frameHeight = texture.Height / Main.projFrames[Projectile.type]; int frame = frameHeight * Projectile.frame; - Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, frame, texture.Width, frameHeight)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture.Width / 2f, (float)frameHeight / 2f), Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, frame, texture.Width, frameHeight)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture.Width / 2f, (float)frameHeight / 2f), Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Summon/SilvaCrystalExplosion.cs b/Projectiles/Summon/SilvaCrystalExplosion.cs index bdc827c71f..c0b0a494be 100644 --- a/Projectiles/Summon/SilvaCrystalExplosion.cs +++ b/Projectiles/Summon/SilvaCrystalExplosion.cs @@ -144,8 +144,8 @@ namespace CalamityMod.Projectiles.Summon Color alpha5 = Projectile.GetAlpha(color25); Vector2 origin11 = rectangle17.Size() / 2f; Color color60 = Main.hslToRgb(Projectile.ai[0], 1f, 0.5f).MultiplyRGBA(new Color(255, 255, 255, 0)); - Main.spriteBatch.Draw(texture2D34, vector59, new Microsoft.Xna.Framework.Rectangle?(rectangle17), color60, Projectile.rotation, origin11, Projectile.scale * 2f, SpriteEffects.None, 0); - Main.spriteBatch.Draw(texture2D34, vector59, new Microsoft.Xna.Framework.Rectangle?(rectangle17), color60, 0f, origin11, Projectile.scale * 2f, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture2D34, vector59, new Microsoft.Xna.Framework.Rectangle?(rectangle17), color60, Projectile.rotation, origin11, Projectile.scale * 2f, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture2D34, vector59, new Microsoft.Xna.Framework.Rectangle?(rectangle17), color60, 0f, origin11, Projectile.scale * 2f, SpriteEffects.None, 0); if (Projectile.ai[1] != -1f && Projectile.Opacity > 0.3f) { Vector2 vector61 = Main.projectile[(int)Projectile.ai[1]].Center - Projectile.Center; @@ -155,8 +155,8 @@ namespace CalamityMod.Projectiles.Summon num279 = MathHelper.Clamp(num279, 0f, 1f); if (num279 > 0f) { - Main.spriteBatch.Draw(texture2D34, vector59 + vector61 / 2f, new Microsoft.Xna.Framework.Rectangle?(rectangle17), color60 * num279, rotation27, origin11, vector62, SpriteEffects.None, 0); - Main.spriteBatch.Draw(texture2D34, vector59 + vector61 / 2f, new Microsoft.Xna.Framework.Rectangle?(rectangle17), alpha5 * num279, rotation27, origin11, vector62 / 2f, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture2D34, vector59 + vector61 / 2f, new Microsoft.Xna.Framework.Rectangle?(rectangle17), color60 * num279, rotation27, origin11, vector62, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture2D34, vector59 + vector61 / 2f, new Microsoft.Xna.Framework.Rectangle?(rectangle17), alpha5 * num279, rotation27, origin11, vector62 / 2f, SpriteEffects.None, 0); } } return false; diff --git a/Projectiles/Summon/SiriusExplosion.cs b/Projectiles/Summon/SiriusExplosion.cs index 9abb9823a5..a40b0f7de5 100644 --- a/Projectiles/Summon/SiriusExplosion.cs +++ b/Projectiles/Summon/SiriusExplosion.cs @@ -146,8 +146,8 @@ namespace CalamityMod.Projectiles.Summon Color alpha5 = Projectile.GetAlpha(color25); Vector2 origin11 = rectangle17.Size() / 2f; Color color60 = Main.hslToRgb(0.5f, 1f, Projectile.ai[0]).MultiplyRGBA(new Color(255, 255, 255, 0)); - Main.spriteBatch.Draw(texture2D34, vector59, new Microsoft.Xna.Framework.Rectangle?(rectangle17), color60, Projectile.rotation, origin11, Projectile.scale * 2f, SpriteEffects.None, 0); - Main.spriteBatch.Draw(texture2D34, vector59, new Microsoft.Xna.Framework.Rectangle?(rectangle17), color60, 0f, origin11, Projectile.scale * 2f, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture2D34, vector59, new Microsoft.Xna.Framework.Rectangle?(rectangle17), color60, Projectile.rotation, origin11, Projectile.scale * 2f, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture2D34, vector59, new Microsoft.Xna.Framework.Rectangle?(rectangle17), color60, 0f, origin11, Projectile.scale * 2f, SpriteEffects.None, 0); if (Projectile.ai[1] != -1f && Projectile.Opacity > 0.3f) { Vector2 vector61 = Main.projectile[(int)Projectile.ai[1]].Center - Projectile.Center; @@ -157,8 +157,8 @@ namespace CalamityMod.Projectiles.Summon num279 = MathHelper.Clamp(num279, 0f, 1f); if (num279 > 0f) { - Main.spriteBatch.Draw(texture2D34, vector59 + vector61 / 2f, new Microsoft.Xna.Framework.Rectangle?(rectangle17), color60 * num279, rotation27, origin11, vector62, SpriteEffects.None, 0); - Main.spriteBatch.Draw(texture2D34, vector59 + vector61 / 2f, new Microsoft.Xna.Framework.Rectangle?(rectangle17), alpha5 * num279, rotation27, origin11, vector62 / 2f, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture2D34, vector59 + vector61 / 2f, new Microsoft.Xna.Framework.Rectangle?(rectangle17), color60 * num279, rotation27, origin11, vector62, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture2D34, vector59 + vector61 / 2f, new Microsoft.Xna.Framework.Rectangle?(rectangle17), alpha5 * num279, rotation27, origin11, vector62 / 2f, SpriteEffects.None, 0); } } return false; diff --git a/Projectiles/Summon/SonOfYharon.cs b/Projectiles/Summon/SonOfYharon.cs index 9dbad68088..0fc7c23a68 100644 --- a/Projectiles/Summon/SonOfYharon.cs +++ b/Projectiles/Summon/SonOfYharon.cs @@ -239,7 +239,7 @@ namespace CalamityMod.Projectiles.Summon Texture2D texture2D13 = ModContent.Request(Texture).Value; int num214 = ModContent.Request(Texture).Value.Height / Main.projFrames[Projectile.type]; int y6 = num214 * Projectile.frame; - Main.spriteBatch.Draw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Rectangle(0, y6, texture2D13.Width, num214), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture2D13.Width / 2f, num214 / 2f), Projectile.scale, spriteEffects, 0); + Main.EntitySpriteDraw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Rectangle(0, y6, texture2D13.Width, num214), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture2D13.Width / 2f, num214 / 2f), Projectile.scale, spriteEffects, 0); return false; } } diff --git a/Projectiles/Summon/StormMarkSummon.cs b/Projectiles/Summon/StormMarkSummon.cs index ea6c8dae39..76521a73bd 100644 --- a/Projectiles/Summon/StormMarkSummon.cs +++ b/Projectiles/Summon/StormMarkSummon.cs @@ -149,9 +149,9 @@ namespace CalamityMod.Projectiles.Summon Color alpha5 = Projectile.GetAlpha(color25); Vector2 origin7 = rectangle11.Size() / 2f; Color color47 = Main.hslToRgb(0.25f, 1f, 1f).MultiplyRGBA(new Color(255, 255, 255, 0)); - Main.spriteBatch.Draw(texture2D27, vector38, new Microsoft.Xna.Framework.Rectangle?(rectangle11), color47, 0f, origin7, new Vector2(1f, 5f) * Projectile.scale * 2f, SpriteEffects.None, 0); - Main.spriteBatch.Draw(texture2D27, vector38, new Microsoft.Xna.Framework.Rectangle?(rectangle11), alpha5, Projectile.rotation, origin7, Projectile.scale, SpriteEffects.None, 0); - Main.spriteBatch.Draw(texture2D27, vector38, new Microsoft.Xna.Framework.Rectangle?(rectangle11), alpha5, 0f, origin7, new Vector2(1f, 8f) * Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture2D27, vector38, new Microsoft.Xna.Framework.Rectangle?(rectangle11), color47, 0f, origin7, new Vector2(1f, 5f) * Projectile.scale * 2f, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture2D27, vector38, new Microsoft.Xna.Framework.Rectangle?(rectangle11), alpha5, Projectile.rotation, origin7, Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture2D27, vector38, new Microsoft.Xna.Framework.Rectangle?(rectangle11), alpha5, 0f, origin7, new Vector2(1f, 8f) * Projectile.scale, SpriteEffects.None, 0); return false; } } diff --git a/Projectiles/Summon/UniverseSplitterHugeBeam.cs b/Projectiles/Summon/UniverseSplitterHugeBeam.cs index b602ee51f6..f8c0db655f 100644 --- a/Projectiles/Summon/UniverseSplitterHugeBeam.cs +++ b/Projectiles/Summon/UniverseSplitterHugeBeam.cs @@ -154,7 +154,7 @@ namespace CalamityMod.Projectiles.Summon { sourceRectangle.Height = (int)(laserLength - laserLengthDelta); } - Main.spriteBatch.Draw(laserBodyTexture, centerDelta - Main.screenPosition, new Rectangle?(sourceRectangle), drawColor, Projectile.rotation, new Vector2(sourceRectangle.Width / 2f, 0f), Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(laserBodyTexture, centerDelta - Main.screenPosition, new Rectangle?(sourceRectangle), drawColor, Projectile.rotation, new Vector2(sourceRectangle.Width / 2f, 0f), Projectile.scale, SpriteEffects.None, 0); laserLengthDelta += sourceRectangle.Height * Projectile.scale; centerDelta += Projectile.velocity * sourceRectangle.Height * Projectile.scale; sourceRectangle.Y += (int)(76 * Projectile.scale); @@ -168,7 +168,7 @@ namespace CalamityMod.Projectiles.Summon // Laser tail logic centerDelta += Projectile.velocity * Projectile.scale * 38f; Rectangle tailFrameRectangle = new Rectangle(0, 76 * (Projectile.timeLeft / 3 % 5), laserTailTexture.Width, 76); - Main.spriteBatch.Draw(laserTailTexture, centerDelta - Main.screenPosition, tailFrameRectangle, drawColor, Projectile.rotation, new Vector2(148f, 76f) / 2f, Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(laserTailTexture, centerDelta - Main.screenPosition, tailFrameRectangle, drawColor, Projectile.rotation, new Vector2(148f, 76f) / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Summon/UniverseSplitterSmallBeam.cs b/Projectiles/Summon/UniverseSplitterSmallBeam.cs index b868312156..5bd3e80127 100644 --- a/Projectiles/Summon/UniverseSplitterSmallBeam.cs +++ b/Projectiles/Summon/UniverseSplitterSmallBeam.cs @@ -109,7 +109,7 @@ namespace CalamityMod.Projectiles.Summon // Laser tail logic - Main.spriteBatch.Draw(laserTailTexture, Projectile.Center - Main.screenPosition, null, drawColor, Projectile.rotation, laserTailTexture.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(laserTailTexture, Projectile.Center - Main.screenPosition, null, drawColor, Projectile.rotation, laserTailTexture.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); // Laser body logic @@ -126,7 +126,7 @@ namespace CalamityMod.Projectiles.Summon { sourceRectangle.Height = (int)(laserLength - laserLengthDelta); } - Main.spriteBatch.Draw(laserBodyTexture, centerDelta - Main.screenPosition, new Rectangle?(sourceRectangle), drawColor, Projectile.rotation, new Vector2(sourceRectangle.Width / 2f, 0f), Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(laserBodyTexture, centerDelta - Main.screenPosition, new Rectangle?(sourceRectangle), drawColor, Projectile.rotation, new Vector2(sourceRectangle.Width / 2f, 0f), Projectile.scale, SpriteEffects.None, 0); laserLengthDelta += sourceRectangle.Height * Projectile.scale; centerDelta += Projectile.velocity * sourceRectangle.Height * Projectile.scale; sourceRectangle.Y += 14; @@ -139,7 +139,7 @@ namespace CalamityMod.Projectiles.Summon // Laser head logic - Main.spriteBatch.Draw(laserHeadTexture, centerDelta - Main.screenPosition, null, drawColor, Projectile.rotation, laserHeadTexture.Frame(1, 1, 0, 0).Top(), Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(laserHeadTexture, centerDelta - Main.screenPosition, null, drawColor, Projectile.rotation, laserHeadTexture.Frame(1, 1, 0, 0).Top(), Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Summon/Valkyrie.cs b/Projectiles/Summon/Valkyrie.cs index 7f8c8190ce..60743c9447 100644 --- a/Projectiles/Summon/Valkyrie.cs +++ b/Projectiles/Summon/Valkyrie.cs @@ -100,7 +100,7 @@ namespace CalamityMod.Projectiles.Summon Texture2D texture2D13 = ModContent.Request(Texture).Value; int num214 = ModContent.Request(Texture).Value.Height / Main.projFrames[Projectile.type]; int y6 = num214 * Projectile.frame; - Main.spriteBatch.Draw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), Projectile.scale, spriteEffects, 0); + Main.EntitySpriteDraw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), Projectile.scale, spriteEffects, 0); return false; } } diff --git a/Projectiles/Summon/VileFeederSummon.cs b/Projectiles/Summon/VileFeederSummon.cs index 9b283e37ee..9214d3ea76 100644 --- a/Projectiles/Summon/VileFeederSummon.cs +++ b/Projectiles/Summon/VileFeederSummon.cs @@ -262,7 +262,7 @@ namespace CalamityMod.Projectiles.Summon Texture2D texture = ModContent.Request(Texture).Value; int num214 = texture.Height / Main.projFrames[Projectile.type]; int y6 = num214 * Projectile.frame; - Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture.Width / 2f, (float)num214 / 2f), Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture.Width / 2f, (float)num214 / 2f), Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Summon/ViridVanguardBlade.cs b/Projectiles/Summon/ViridVanguardBlade.cs index 1f4c2447c1..5f11fe742c 100644 --- a/Projectiles/Summon/ViridVanguardBlade.cs +++ b/Projectiles/Summon/ViridVanguardBlade.cs @@ -171,12 +171,12 @@ namespace CalamityMod.Projectiles.Summon Color color = Color.Lerp(Color.White, Color.DarkOliveGreen, i / (float)Projectile.oldPos.Length) * ((Projectile.oldPos.Length - i) / (float)Projectile.oldPos.Length); float scale = MathHelper.Lerp(Projectile.scale * 1f, Projectile.scale * 0.5f, i / (float)Projectile.oldPos.Length); - Main.spriteBatch.Draw(texture, drawPos, new Rectangle?(rectangle), color, + Main.EntitySpriteDraw(texture, drawPos, new Rectangle?(rectangle), color, Projectile.rotation, rectangle.Size() / 2f, scale, SpriteEffects.None, 0); } } - Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Rectangle?(rectangle), Color.White, + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Rectangle?(rectangle), Color.White, Projectile.rotation, rectangle.Size() / 2f, 1f, spriteEffects, 0); return false; diff --git a/Projectiles/VanillaProjectileOverrides/ChlorophyteCrystalAI.cs b/Projectiles/VanillaProjectileOverrides/ChlorophyteCrystalAI.cs index 3de3e1f1d8..2c6382f863 100644 --- a/Projectiles/VanillaProjectileOverrides/ChlorophyteCrystalAI.cs +++ b/Projectiles/VanillaProjectileOverrides/ChlorophyteCrystalAI.cs @@ -10,6 +10,7 @@ using Terraria.GameContent; namespace CalamityMod.Projectiles.VanillaProjectileOverrides { + // TODO -- Finish this armor rework eventually. public static class ChlorophyteCrystalAI { public const int AmountToHealPerPulse = 10; @@ -17,6 +18,8 @@ namespace CalamityMod.Projectiles.VanillaProjectileOverrides public const int DelayBetweenHeals = 150; public static bool DoChlorophyteCrystalAI(Projectile projectile) { + return true; + Player owner = Main.player[projectile.owner]; ref float timer = ref projectile.ai[1]; @@ -58,7 +61,9 @@ namespace CalamityMod.Projectiles.VanillaProjectileOverrides public static bool DoChlorophyteCrystalDrawing(SpriteBatch spriteBatch, Projectile projectile) { - //Why doesn't this work? How does one access the texture path of a vanilla projectile? Left bugged for someone else to figure out :) + return true; + + // Why doesn't this work? How does one access the texture path of a vanilla projectile? Left bugged for someone else to figure out :) // It's me. I was that someone - Dominic // TextureAssets is the answer, along with Main.instance.LoadProjectile(projID), to ensure that the texture is loaded into memory. // In this instance, however, that should happen already on vanilla's end. diff --git a/Systems/LightingEffectsSystem.cs b/Systems/LightingEffectsSystem.cs index 760cac8850..6a4a8bcd41 100644 --- a/Systems/LightingEffectsSystem.cs +++ b/Systems/LightingEffectsSystem.cs @@ -76,9 +76,13 @@ namespace CalamityMod.Systems if (BossRushEvent.BossRushActive || BossRushEvent.StartTimer > 0 || BossRushSky.ShouldDrawRegularly) { + float fadeToBlack = BossRushEvent.WhiteDimness; backgroundColor = Color.Lerp(backgroundColor, Color.LightGray, bossRushWhiteFade); + backgroundColor = Color.Lerp(backgroundColor, Color.Black, fadeToBlack); tileColor = Color.Lerp(tileColor, Color.LightGray, bossRushWhiteFade); + tileColor = Color.Lerp(tileColor, Color.Black, fadeToBlack); Main.ColorOfTheSkies = Color.Lerp(Main.ColorOfTheSkies, Color.Gray, bossRushWhiteFade); + Main.ColorOfTheSkies = Color.Lerp(Main.ColorOfTheSkies, Color.Black, fadeToBlack); } else if (SkyManager.Instance["CalamityMod:ExoMechs"].IsActive()) { diff --git a/Tiles/Astral/NovaeSlag.cs b/Tiles/Astral/NovaeSlag.cs index 1a79e67511..8f0fba779a 100644 --- a/Tiles/Astral/NovaeSlag.cs +++ b/Tiles/Astral/NovaeSlag.cs @@ -1,5 +1,4 @@ - -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -7,6 +6,7 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.Astral { + [LegacyName("AstralSilt")] public class NovaeSlag : ModTile { public override void SetStaticDefaults() diff --git a/Tiles/AstralDesert/CelestialRemains.cs b/Tiles/AstralDesert/CelestialRemains.cs index d0ffeb1573..979f464b58 100644 --- a/Tiles/AstralDesert/CelestialRemains.cs +++ b/Tiles/AstralDesert/CelestialRemains.cs @@ -6,6 +6,7 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.AstralDesert { + [LegacyName("AstralFossil")] public class CelestialRemains : ModTile { public override void SetStaticDefaults() diff --git a/Tiles/Furniture/CraftingStations/EutrophicShelf.cs b/Tiles/Furniture/CraftingStations/EutrophicShelf.cs index ac559b9d42..f79d43bd9d 100644 --- a/Tiles/Furniture/CraftingStations/EutrophicShelf.cs +++ b/Tiles/Furniture/CraftingStations/EutrophicShelf.cs @@ -8,6 +8,7 @@ using Terraria.ObjectData; namespace CalamityMod.Tiles.Furniture.CraftingStations { + [LegacyName("EutrophicCrafting")] public class EutrophicShelf : ModTile { // diff --git a/Tiles/Furniture/CraftingStations/MonolithAmalgam.cs b/Tiles/Furniture/CraftingStations/MonolithAmalgam.cs index 583868d181..569034652c 100644 --- a/Tiles/Furniture/CraftingStations/MonolithAmalgam.cs +++ b/Tiles/Furniture/CraftingStations/MonolithAmalgam.cs @@ -7,6 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.Furniture.CraftingStations { + [LegacyName("MonolithCrafting")] public class MonolithAmalgam : ModTile { public override void SetStaticDefaults() diff --git a/Tiles/Furniture/CraftingStations/ProfanedCrucible.cs b/Tiles/Furniture/CraftingStations/ProfanedCrucible.cs index 80215b2e45..e54d354c74 100644 --- a/Tiles/Furniture/CraftingStations/ProfanedCrucible.cs +++ b/Tiles/Furniture/CraftingStations/ProfanedCrucible.cs @@ -8,6 +8,7 @@ using Terraria.ObjectData; namespace CalamityMod.Tiles.Furniture.CraftingStations { + [LegacyName("ProfanedBasin")] public class ProfanedCrucible : ModTile { public override void SetStaticDefaults() diff --git a/Tiles/FurnitureAbyss/AbyssSynth.cs b/Tiles/FurnitureAbyss/AbyssSynth.cs index 504f6523f0..1db862205a 100644 --- a/Tiles/FurnitureAbyss/AbyssSynth.cs +++ b/Tiles/FurnitureAbyss/AbyssSynth.cs @@ -4,6 +4,7 @@ using Terraria.DataStructures; using Terraria.ModLoader; namespace CalamityMod.Tiles.FurnitureAbyss { + [LegacyName("AbyssPiano")] public class AbyssSynth : ModTile { public override void SetStaticDefaults() diff --git a/Tiles/FurnitureAbyss/AbyssWorkBench.cs b/Tiles/FurnitureAbyss/AbyssWorkBench.cs index c4830b9aa6..1c910c151d 100644 --- a/Tiles/FurnitureAbyss/AbyssWorkBench.cs +++ b/Tiles/FurnitureAbyss/AbyssWorkBench.cs @@ -6,6 +6,7 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.FurnitureAbyss { + [LegacyName("AbyssWorkbench")] public class AbyssWorkBench : ModTile { public override void SetStaticDefaults() diff --git a/Tiles/FurnitureAcidwood/AcidwoodWorkBenchTile.cs b/Tiles/FurnitureAcidwood/AcidwoodWorkBenchTile.cs index 8ddb87a534..1f5d475923 100644 --- a/Tiles/FurnitureAcidwood/AcidwoodWorkBenchTile.cs +++ b/Tiles/FurnitureAcidwood/AcidwoodWorkBenchTile.cs @@ -7,6 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.FurnitureAcidwood { + [LegacyName("AcidwoodWorkbenchTile")] public class AcidwoodWorkBenchTile : ModTile { public override void SetStaticDefaults() diff --git a/Tiles/FurnitureAncient/AncientPipeOrgan.cs b/Tiles/FurnitureAncient/AncientPipeOrgan.cs index b5a53d6b35..89aabfbafe 100644 --- a/Tiles/FurnitureAncient/AncientPipeOrgan.cs +++ b/Tiles/FurnitureAncient/AncientPipeOrgan.cs @@ -6,6 +6,7 @@ using Terraria.ObjectData; namespace CalamityMod.Tiles.FurnitureAncient { + [LegacyName("AncientPiano")] public class AncientPipeOrgan : ModTile { public override void SetStaticDefaults() diff --git a/Tiles/FurnitureAncient/AncientWorkBench.cs b/Tiles/FurnitureAncient/AncientWorkBench.cs index 07f03e6c74..9430a3d26c 100644 --- a/Tiles/FurnitureAncient/AncientWorkBench.cs +++ b/Tiles/FurnitureAncient/AncientWorkBench.cs @@ -6,6 +6,7 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.FurnitureAncient { + [LegacyName("AncientWorkbench")] public class AncientWorkBench : ModTile { public override void SetStaticDefaults() diff --git a/Tiles/FurnitureAshen/AshenPipeOrgan.cs b/Tiles/FurnitureAshen/AshenPipeOrgan.cs index 00ae6d2de0..d74ff56901 100644 --- a/Tiles/FurnitureAshen/AshenPipeOrgan.cs +++ b/Tiles/FurnitureAshen/AshenPipeOrgan.cs @@ -6,6 +6,7 @@ using Terraria.ObjectData; namespace CalamityMod.Tiles.FurnitureAshen { + [LegacyName("AshenPiano")] public class AshenPipeOrgan : ModTile { public override void SetStaticDefaults() diff --git a/Tiles/FurnitureAshen/AshenWorkBench.cs b/Tiles/FurnitureAshen/AshenWorkBench.cs index a706d45812..aa8adb7278 100644 --- a/Tiles/FurnitureAshen/AshenWorkBench.cs +++ b/Tiles/FurnitureAshen/AshenWorkBench.cs @@ -6,6 +6,7 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.FurnitureAshen { + [LegacyName("AshenWorkbench")] public class AshenWorkBench : ModTile { public override void SetStaticDefaults() diff --git a/Tiles/FurnitureCosmilite/CosmiliteWorkBench.cs b/Tiles/FurnitureCosmilite/CosmiliteWorkBench.cs index c9d2cb4337..5e67fb2585 100644 --- a/Tiles/FurnitureCosmilite/CosmiliteWorkBench.cs +++ b/Tiles/FurnitureCosmilite/CosmiliteWorkBench.cs @@ -6,6 +6,7 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.FurnitureCosmilite { + [LegacyName("CosmiliteWorkbench")] public class CosmiliteWorkBench : ModTile { public override void SetStaticDefaults() diff --git a/Tiles/FurnitureOtherworldly/OtherworldlyBathtub.cs b/Tiles/FurnitureOtherworldly/OtherworldlyBathtub.cs index 7c3126708e..c9798b3d55 100644 --- a/Tiles/FurnitureOtherworldly/OtherworldlyBathtub.cs +++ b/Tiles/FurnitureOtherworldly/OtherworldlyBathtub.cs @@ -5,6 +5,7 @@ using Terraria.DataStructures; using Terraria.ModLoader; namespace CalamityMod.Tiles.FurnitureOtherworldly { + [LegacyName("OccultBathtub")] public class OtherworldlyBathtub : ModTile { public override void SetStaticDefaults() diff --git a/Tiles/FurnitureOtherworldly/OtherworldlyBed.cs b/Tiles/FurnitureOtherworldly/OtherworldlyBed.cs index 822d5ddae4..f059ff6074 100644 --- a/Tiles/FurnitureOtherworldly/OtherworldlyBed.cs +++ b/Tiles/FurnitureOtherworldly/OtherworldlyBed.cs @@ -8,6 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.FurnitureOtherworldly { + [LegacyName("OccultBed")] public class OtherworldlyBed : ModTile { public override void SetStaticDefaults() diff --git a/Tiles/FurnitureOtherworldly/OtherworldlyBookcase.cs b/Tiles/FurnitureOtherworldly/OtherworldlyBookcase.cs index ee44499a0b..c687a7d0cf 100644 --- a/Tiles/FurnitureOtherworldly/OtherworldlyBookcase.cs +++ b/Tiles/FurnitureOtherworldly/OtherworldlyBookcase.cs @@ -7,6 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.FurnitureOtherworldly { + [LegacyName("OccultBookcase")] public class OtherworldlyBookcase : ModTile { public override void SetStaticDefaults() diff --git a/Tiles/FurnitureOtherworldly/OtherworldlyCandelabra.cs b/Tiles/FurnitureOtherworldly/OtherworldlyCandelabra.cs index 212387a356..3fb8a578b3 100644 --- a/Tiles/FurnitureOtherworldly/OtherworldlyCandelabra.cs +++ b/Tiles/FurnitureOtherworldly/OtherworldlyCandelabra.cs @@ -7,6 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.FurnitureOtherworldly { + [LegacyName("OccultCandelabra")] public class OtherworldlyCandelabra : ModTile { public override void SetStaticDefaults() diff --git a/Tiles/FurnitureOtherworldly/OtherworldlyCandle.cs b/Tiles/FurnitureOtherworldly/OtherworldlyCandle.cs index fa5ef79a08..8d774d8858 100644 --- a/Tiles/FurnitureOtherworldly/OtherworldlyCandle.cs +++ b/Tiles/FurnitureOtherworldly/OtherworldlyCandle.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts.Furniture; +using CalamityMod.Dusts.Furniture; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -6,6 +6,7 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.FurnitureOtherworldly { + [LegacyName("OccultCandle")] public class OtherworldlyCandle : ModTile { public override void SetStaticDefaults() diff --git a/Tiles/FurnitureOtherworldly/OtherworldlyChair.cs b/Tiles/FurnitureOtherworldly/OtherworldlyChair.cs index 6e361cdf71..2d59ac791a 100644 --- a/Tiles/FurnitureOtherworldly/OtherworldlyChair.cs +++ b/Tiles/FurnitureOtherworldly/OtherworldlyChair.cs @@ -10,6 +10,7 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.FurnitureOtherworldly { + [LegacyName("OccultChair")] public class OtherworldlyChair : ModTile { public const int NextStyleHeight = 40; diff --git a/Tiles/FurnitureOtherworldly/OtherworldlyChandelier.cs b/Tiles/FurnitureOtherworldly/OtherworldlyChandelier.cs index 3507fd59b6..8d7e712c30 100644 --- a/Tiles/FurnitureOtherworldly/OtherworldlyChandelier.cs +++ b/Tiles/FurnitureOtherworldly/OtherworldlyChandelier.cs @@ -8,6 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.FurnitureOtherworldly { + [LegacyName("OccultChandelier")] public class OtherworldlyChandelier : ModTile { public override void SetStaticDefaults() diff --git a/Tiles/FurnitureOtherworldly/OtherworldlyChest.cs b/Tiles/FurnitureOtherworldly/OtherworldlyChest.cs index c256871577..9b6adc433b 100644 --- a/Tiles/FurnitureOtherworldly/OtherworldlyChest.cs +++ b/Tiles/FurnitureOtherworldly/OtherworldlyChest.cs @@ -8,6 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.FurnitureOtherworldly { + [LegacyName("OccultChest")] public class OtherworldlyChest : ModTile { public override void SetStaticDefaults() diff --git a/Tiles/FurnitureOtherworldly/OtherworldlyClock.cs b/Tiles/FurnitureOtherworldly/OtherworldlyClock.cs index b9b80d531a..c90e810974 100644 --- a/Tiles/FurnitureOtherworldly/OtherworldlyClock.cs +++ b/Tiles/FurnitureOtherworldly/OtherworldlyClock.cs @@ -8,6 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.FurnitureOtherworldly { + [LegacyName("OccultClock")] public class OtherworldlyClock : ModTile { public override void SetStaticDefaults() diff --git a/Tiles/FurnitureOtherworldly/OtherworldlyDoorClosed.cs b/Tiles/FurnitureOtherworldly/OtherworldlyDoorClosed.cs index 76f4eeab53..371aaeb6ab 100644 --- a/Tiles/FurnitureOtherworldly/OtherworldlyDoorClosed.cs +++ b/Tiles/FurnitureOtherworldly/OtherworldlyDoorClosed.cs @@ -9,6 +9,7 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.FurnitureOtherworldly { + [LegacyName("OccultDoorClosed")] public class OtherworldlyDoorClosed : ModTile { public override void SetStaticDefaults() diff --git a/Tiles/FurnitureOtherworldly/OtherworldlyDoorOpen.cs b/Tiles/FurnitureOtherworldly/OtherworldlyDoorOpen.cs index 9d703af5db..0cc23c09cf 100644 --- a/Tiles/FurnitureOtherworldly/OtherworldlyDoorOpen.cs +++ b/Tiles/FurnitureOtherworldly/OtherworldlyDoorOpen.cs @@ -9,6 +9,7 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.FurnitureOtherworldly { + [LegacyName("OccultDoorOpen")] public class OtherworldlyDoorOpen : ModTile { public override void SetStaticDefaults() diff --git a/Tiles/FurnitureOtherworldly/OtherworldlyDresser.cs b/Tiles/FurnitureOtherworldly/OtherworldlyDresser.cs index 0105c24c21..6a05eb81c0 100644 --- a/Tiles/FurnitureOtherworldly/OtherworldlyDresser.cs +++ b/Tiles/FurnitureOtherworldly/OtherworldlyDresser.cs @@ -8,6 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.FurnitureOtherworldly { + [LegacyName("OccultDresser")] public class OtherworldlyDresser : ModTile { public override void SetStaticDefaults() diff --git a/Tiles/FurnitureOtherworldly/OtherworldlyLamp.cs b/Tiles/FurnitureOtherworldly/OtherworldlyLamp.cs index 005c5c80f8..187b4558df 100644 --- a/Tiles/FurnitureOtherworldly/OtherworldlyLamp.cs +++ b/Tiles/FurnitureOtherworldly/OtherworldlyLamp.cs @@ -8,6 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.FurnitureOtherworldly { + [LegacyName("OccultLamp")] public class OtherworldlyLamp : ModTile { public override void SetStaticDefaults() diff --git a/Tiles/FurnitureOtherworldly/OtherworldlyLantern.cs b/Tiles/FurnitureOtherworldly/OtherworldlyLantern.cs index 9d9a400661..2b971fe0bd 100644 --- a/Tiles/FurnitureOtherworldly/OtherworldlyLantern.cs +++ b/Tiles/FurnitureOtherworldly/OtherworldlyLantern.cs @@ -8,6 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.FurnitureOtherworldly { + [LegacyName("OccultLantern")] public class OtherworldlyLantern : ModTile { public override void SetStaticDefaults() diff --git a/Tiles/FurnitureOtherworldly/OtherworldlyPiano.cs b/Tiles/FurnitureOtherworldly/OtherworldlyPiano.cs index 702988e866..4fd7a717f8 100644 --- a/Tiles/FurnitureOtherworldly/OtherworldlyPiano.cs +++ b/Tiles/FurnitureOtherworldly/OtherworldlyPiano.cs @@ -5,6 +5,7 @@ using Terraria.DataStructures; using Terraria.ModLoader; namespace CalamityMod.Tiles.FurnitureOtherworldly { + [LegacyName("OccultPiano")] public class OtherworldlyPiano : ModTile { public override void SetStaticDefaults() diff --git a/Tiles/FurnitureOtherworldly/OtherworldlyPlatform.cs b/Tiles/FurnitureOtherworldly/OtherworldlyPlatform.cs index d89ef6bb63..b54ef2fcec 100644 --- a/Tiles/FurnitureOtherworldly/OtherworldlyPlatform.cs +++ b/Tiles/FurnitureOtherworldly/OtherworldlyPlatform.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts.Furniture; +using CalamityMod.Dusts.Furniture; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -6,6 +6,7 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.FurnitureOtherworldly { + [LegacyName("OccultPlatform")] public class OtherworldlyPlatform : ModTile { public override void SetStaticDefaults() diff --git a/Tiles/FurnitureOtherworldly/OtherworldlySink.cs b/Tiles/FurnitureOtherworldly/OtherworldlySink.cs index 205685963b..08da863263 100644 --- a/Tiles/FurnitureOtherworldly/OtherworldlySink.cs +++ b/Tiles/FurnitureOtherworldly/OtherworldlySink.cs @@ -8,6 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.FurnitureOtherworldly { + [LegacyName("OccultSink")] public class OtherworldlySink : ModTile { public override void SetStaticDefaults() diff --git a/Tiles/FurnitureOtherworldly/OtherworldlySofa.cs b/Tiles/FurnitureOtherworldly/OtherworldlySofa.cs index 403440e4a1..11c124f3a1 100644 --- a/Tiles/FurnitureOtherworldly/OtherworldlySofa.cs +++ b/Tiles/FurnitureOtherworldly/OtherworldlySofa.cs @@ -5,6 +5,7 @@ using Terraria.DataStructures; using Terraria.ModLoader; namespace CalamityMod.Tiles.FurnitureOtherworldly { + [LegacyName("OccultSofa")] public class OtherworldlySofa : ModTile { public override void SetStaticDefaults() diff --git a/Tiles/FurnitureOtherworldly/OtherworldlyStone.cs b/Tiles/FurnitureOtherworldly/OtherworldlyStone.cs index 2afb78e65c..dd5f32d86d 100644 --- a/Tiles/FurnitureOtherworldly/OtherworldlyStone.cs +++ b/Tiles/FurnitureOtherworldly/OtherworldlyStone.cs @@ -7,6 +7,7 @@ using Terraria.ID; namespace CalamityMod.Tiles.FurnitureOtherworldly { + [LegacyName("OccultStone")] public class OtherworldlyStone : ModTile { private int extraFrameHeight = 36; diff --git a/Tiles/FurnitureOtherworldly/OtherworldlyTable.cs b/Tiles/FurnitureOtherworldly/OtherworldlyTable.cs index 05a6f3ab9f..96fd69ae88 100644 --- a/Tiles/FurnitureOtherworldly/OtherworldlyTable.cs +++ b/Tiles/FurnitureOtherworldly/OtherworldlyTable.cs @@ -8,6 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.FurnitureOtherworldly { + [LegacyName("OccultTable")] public class OtherworldlyTable : ModTile { public override void SetStaticDefaults() diff --git a/Tiles/FurnitureOtherworldly/OtherworldlyWorkbench.cs b/Tiles/FurnitureOtherworldly/OtherworldlyWorkBench.cs similarity index 96% rename from Tiles/FurnitureOtherworldly/OtherworldlyWorkbench.cs rename to Tiles/FurnitureOtherworldly/OtherworldlyWorkBench.cs index 9828b343a0..d0d5882fa5 100644 --- a/Tiles/FurnitureOtherworldly/OtherworldlyWorkbench.cs +++ b/Tiles/FurnitureOtherworldly/OtherworldlyWorkBench.cs @@ -7,6 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.FurnitureOtherworldly { + [LegacyName("OccultWorkbench", "OccultWorkBench")] public class OtherworldlyWorkBench : ModTile { public override void SetStaticDefaults() diff --git a/UI/RipperUI.cs b/UI/RipperUI.cs index b751417d83..c402cc3185 100644 --- a/UI/RipperUI.cs +++ b/UI/RipperUI.cs @@ -96,10 +96,6 @@ namespace CalamityMod.UI public static void Draw(SpriteBatch spriteBatch, Player player) { - // If Revengeance isn't on, or Rage and Adrenaline are turned off, don't draw anything. - if (!CalamityWorld.revenge) - return; - // If for some reason either of the bars has been thrown into the corner (likely to 0,0 by default), put them at their default positions CheckGarbageCornerPos(); @@ -111,8 +107,10 @@ namespace CalamityMod.UI // Grab the ModPlayer object and then start drawing CalamityPlayer modPlayer = player.Calamity(); - DrawRageBar(spriteBatch, modPlayer); - DrawAdrenalineBar(spriteBatch, modPlayer); + if (modPlayer.RageEnabled) + DrawRageBar(spriteBatch, modPlayer); + if (modPlayer.AdrenalineEnabled) + DrawAdrenalineBar(spriteBatch, modPlayer); HandleMouseInteraction(modPlayer, rageBorderTex.Size(), adrenBorderTex.Size()); } @@ -150,7 +148,7 @@ namespace CalamityMod.UI // The amount of the bar to draw depends on the player's current Rage level // offset calculates the deadspace that is the border and not the bar. Bar is 24 pixels tall int barWidth = rageBarTex.Width; - float offset = (rageBorderTex.Width - rageBarTex.Width) * 0.5f; + float offset = (rageBorderTex.Width - rageBarTex.Width) * 0.5f; Rectangle cropRect = new Rectangle(0, 0, (int)(barWidth * rageRatio), rageBarTex.Height); spriteBatch.Draw(rageBarTex, rageDrawPos + shakeOffset + new Vector2(offset * uiScale, 0), cropRect, Color.White, 0f, rageBorderTex.Size() * 0.5f, uiScale, SpriteEffects.None, 0); @@ -216,7 +214,7 @@ namespace CalamityMod.UI // The amount of the bar to draw depends on the player's current Adrenaline level // offset calculates the deadspace that is the border and not the bar. Bar is 24 pixels tall int barWidth = adrenBarTex.Width; - float offset = (adrenBorderTex.Width - adrenBarTex.Width) * 0.5f; + float offset = (adrenBorderTex.Width - adrenBarTex.Width) * 0.5f; Rectangle cropRect = new Rectangle(0, 0, (int)(barWidth * adrenRatio), adrenBarTex.Height); spriteBatch.Draw(adrenBarTex, adrenDrawPos + shakeOffset + new Vector2(offset * uiScale, 0), cropRect, Color.White, 0f, adrenBorderTex.Size() * 0.5f, uiScale, SpriteEffects.None, 0); @@ -254,8 +252,8 @@ namespace CalamityMod.UI Rectangle rageBar = Utils.CenteredRectangle(rageDrawPos, rageBarSize * uiScale); Rectangle adrenBar = Utils.CenteredRectangle(adrenDrawPos, adrenBarSize * uiScale); - bool rageHover = mouse.Intersects(rageBar); - bool adrenHover = mouse.Intersects(adrenBar); + bool rageHover = mouse.Intersects(rageBar) && modPlayer.RageEnabled; + bool adrenHover = mouse.Intersects(adrenBar) && modPlayer.AdrenalineEnabled; MouseState mouseInput = Mouse.GetState(); Vector2 mousePos = Main.MouseScreen; @@ -282,8 +280,9 @@ namespace CalamityMod.UI // Add hover text if the mouse is over the bar if (!CalamityConfig.Instance.MeterPosLock) Main.LocalPlayer.mouseInterface = true; - string adrenStr = MakeRipperPercentString(modPlayer.adrenaline, modPlayer.adrenalineMax); - Main.instance.MouseText($"Adrenaline: {adrenStr}"); + string adrenNameStr = modPlayer.draedonsHeart ? "Nanomachines" : "Adrenaline"; + string adrenAmountStr = MakeRipperPercentString(modPlayer.adrenaline, modPlayer.adrenalineMax); + Main.instance.MouseText($"{adrenNameStr}: {adrenAmountStr}"); // The bar is draggable if enabled in config. if (!CalamityConfig.Instance.MeterPosLock && mouseInput.LeftButton == ButtonState.Pressed) diff --git a/Utilities/PlayerUtils.cs b/Utilities/PlayerUtils.cs index 1be0f23266..a11d6e43b2 100644 --- a/Utilities/PlayerUtils.cs +++ b/Utilities/PlayerUtils.cs @@ -357,7 +357,8 @@ namespace CalamityMod // Rage and Adrenaline now stack additively with no special cases. if (mp.rageModeActive) damageMult += trueMelee ? mp.RageDamageBoost * rageAndAdrenalineTrueMeleeDamageMult : mp.RageDamageBoost; - if (mp.adrenalineModeActive) + // Draedon's Heart disables Adrenaline damage. + if (mp.adrenalineModeActive && !mp.draedonsHeart) damageMult += trueMelee ? mp.GetAdrenalineDamage() * rageAndAdrenalineTrueMeleeDamageMult : mp.GetAdrenalineDamage(); } #endregion diff --git a/Walls/CelestialRemainsWall.cs b/Walls/CelestialRemainsWall.cs index 516a305a7a..67fc2ec7ca 100644 --- a/Walls/CelestialRemainsWall.cs +++ b/Walls/CelestialRemainsWall.cs @@ -1,11 +1,12 @@ using Terraria; using Microsoft.Xna.Framework; using Terraria.ModLoader; + namespace CalamityMod.Walls { + [LegacyName("AstralFossilWall")] public class CelestialRemainsWall : ModWall { - public override void SetStaticDefaults() { DustType = ModContent.DustType();