diff --git a/Buffs/Alcohol/BloodyMaryBuff.cs b/Buffs/Alcohol/BloodyMaryBuff.cs index fab06df0f3..af35461b47 100644 --- a/Buffs/Alcohol/BloodyMaryBuff.cs +++ b/Buffs/Alcohol/BloodyMaryBuff.cs @@ -11,6 +11,7 @@ namespace CalamityMod.Buffs.Alcohol Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; + Main.persistentBuff[Type] = true; BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } diff --git a/Buffs/Alcohol/CaribbeanRumBuff.cs b/Buffs/Alcohol/CaribbeanRumBuff.cs index f20c460c74..fcdb6422b6 100644 --- a/Buffs/Alcohol/CaribbeanRumBuff.cs +++ b/Buffs/Alcohol/CaribbeanRumBuff.cs @@ -11,6 +11,7 @@ namespace CalamityMod.Buffs.Alcohol Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; + Main.persistentBuff[Type] = true; BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } diff --git a/Buffs/Alcohol/CinnamonRollBuff.cs b/Buffs/Alcohol/CinnamonRollBuff.cs index 8daceae89a..bb724a3a52 100644 --- a/Buffs/Alcohol/CinnamonRollBuff.cs +++ b/Buffs/Alcohol/CinnamonRollBuff.cs @@ -11,13 +11,13 @@ namespace CalamityMod.Buffs.Alcohol Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; + Main.persistentBuff[Type] = true; BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } public override void Update(Player player, ref int buffIndex) { player.Calamity().cinnamonRoll = true; - player.Calamity().HeatDebuffMultiplier += 0.5f; } } } diff --git a/Buffs/Alcohol/EverclearBuff.cs b/Buffs/Alcohol/EverclearBuff.cs index eed852d449..1629143a7f 100644 --- a/Buffs/Alcohol/EverclearBuff.cs +++ b/Buffs/Alcohol/EverclearBuff.cs @@ -11,6 +11,7 @@ namespace CalamityMod.Buffs.Alcohol Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; + Main.persistentBuff[Type] = true; BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } diff --git a/Buffs/Alcohol/EvergreenGinBuff.cs b/Buffs/Alcohol/EvergreenGinBuff.cs index fd9ae4a227..1821638bad 100644 --- a/Buffs/Alcohol/EvergreenGinBuff.cs +++ b/Buffs/Alcohol/EvergreenGinBuff.cs @@ -12,6 +12,7 @@ namespace CalamityMod.Buffs.Alcohol Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; + Main.persistentBuff[Type] = true; BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } diff --git a/Buffs/Alcohol/FireballBuff.cs b/Buffs/Alcohol/FireballBuff.cs index 17a16d6784..99c877dc50 100644 --- a/Buffs/Alcohol/FireballBuff.cs +++ b/Buffs/Alcohol/FireballBuff.cs @@ -12,6 +12,7 @@ namespace CalamityMod.Buffs.Alcohol Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; + Main.persistentBuff[Type] = true; BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } diff --git a/Buffs/Alcohol/GrapeBeerBuff.cs b/Buffs/Alcohol/GrapeBeerBuff.cs index cf2f1bf0f4..83504af851 100644 --- a/Buffs/Alcohol/GrapeBeerBuff.cs +++ b/Buffs/Alcohol/GrapeBeerBuff.cs @@ -12,6 +12,7 @@ namespace CalamityMod.Buffs.Alcohol Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; + Main.persistentBuff[Type] = true; BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } diff --git a/Buffs/Alcohol/ManhattanBuff.cs b/Buffs/Alcohol/ManhattanBuff.cs index d67bf91dcc..e724375c25 100644 --- a/Buffs/Alcohol/ManhattanBuff.cs +++ b/Buffs/Alcohol/ManhattanBuff.cs @@ -12,6 +12,7 @@ namespace CalamityMod.Buffs.Alcohol Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; + Main.persistentBuff[Type] = true; BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } diff --git a/Buffs/Alcohol/MargaritaBuff.cs b/Buffs/Alcohol/MargaritaBuff.cs index da30dd849b..37299b4fb8 100644 --- a/Buffs/Alcohol/MargaritaBuff.cs +++ b/Buffs/Alcohol/MargaritaBuff.cs @@ -12,6 +12,7 @@ namespace CalamityMod.Buffs.Alcohol Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; + Main.persistentBuff[Type] = true; BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } diff --git a/Buffs/Alcohol/MoonshineBuff.cs b/Buffs/Alcohol/MoonshineBuff.cs index d9ce511042..03faabe66d 100644 --- a/Buffs/Alcohol/MoonshineBuff.cs +++ b/Buffs/Alcohol/MoonshineBuff.cs @@ -11,6 +11,7 @@ namespace CalamityMod.Buffs.Alcohol Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; + Main.persistentBuff[Type] = true; BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } diff --git a/Buffs/Alcohol/MoscowMuleBuff.cs b/Buffs/Alcohol/MoscowMuleBuff.cs index 577fe35a1c..21f7569480 100644 --- a/Buffs/Alcohol/MoscowMuleBuff.cs +++ b/Buffs/Alcohol/MoscowMuleBuff.cs @@ -11,6 +11,7 @@ namespace CalamityMod.Buffs.Alcohol Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; + Main.persistentBuff[Type] = true; BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } diff --git a/Buffs/Alcohol/OldFashionedBuff.cs b/Buffs/Alcohol/OldFashionedBuff.cs index 1f059a26d5..68820059d4 100644 --- a/Buffs/Alcohol/OldFashionedBuff.cs +++ b/Buffs/Alcohol/OldFashionedBuff.cs @@ -11,6 +11,7 @@ namespace CalamityMod.Buffs.Alcohol Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; + Main.persistentBuff[Type] = true; BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } diff --git a/Buffs/Alcohol/PurpleHazeBuff.cs b/Buffs/Alcohol/PurpleHazeBuff.cs index 9ef31ce2b1..16aa30d53f 100644 --- a/Buffs/Alcohol/PurpleHazeBuff.cs +++ b/Buffs/Alcohol/PurpleHazeBuff.cs @@ -11,6 +11,7 @@ namespace CalamityMod.Buffs.Alcohol Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; + Main.persistentBuff[Type] = true; BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } diff --git a/Buffs/Alcohol/RedWineBuff.cs b/Buffs/Alcohol/RedWineBuff.cs index bad080168d..087086ca68 100644 --- a/Buffs/Alcohol/RedWineBuff.cs +++ b/Buffs/Alcohol/RedWineBuff.cs @@ -11,6 +11,7 @@ namespace CalamityMod.Buffs.Alcohol Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; + Main.persistentBuff[Type] = true; BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } diff --git a/Buffs/Alcohol/RumBuff.cs b/Buffs/Alcohol/RumBuff.cs index dac1bd0d2a..ab842e0649 100644 --- a/Buffs/Alcohol/RumBuff.cs +++ b/Buffs/Alcohol/RumBuff.cs @@ -11,6 +11,7 @@ namespace CalamityMod.Buffs.Alcohol Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; + Main.persistentBuff[Type] = true; BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } diff --git a/Buffs/Alcohol/ScrewdriverBuff.cs b/Buffs/Alcohol/ScrewdriverBuff.cs index 663626f5b2..f8f97cd0fe 100644 --- a/Buffs/Alcohol/ScrewdriverBuff.cs +++ b/Buffs/Alcohol/ScrewdriverBuff.cs @@ -12,6 +12,7 @@ namespace CalamityMod.Buffs.Alcohol Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; + Main.persistentBuff[Type] = true; BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } diff --git a/Buffs/Alcohol/StarBeamRyeBuff.cs b/Buffs/Alcohol/StarBeamRyeBuff.cs index e8dde8ea60..50d6ac0bc8 100644 --- a/Buffs/Alcohol/StarBeamRyeBuff.cs +++ b/Buffs/Alcohol/StarBeamRyeBuff.cs @@ -11,6 +11,7 @@ namespace CalamityMod.Buffs.Alcohol Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; + Main.persistentBuff[Type] = true; BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } diff --git a/Buffs/Alcohol/TequilaBuff.cs b/Buffs/Alcohol/TequilaBuff.cs index 4014fcad49..a2b307c605 100644 --- a/Buffs/Alcohol/TequilaBuff.cs +++ b/Buffs/Alcohol/TequilaBuff.cs @@ -12,6 +12,7 @@ namespace CalamityMod.Buffs.Alcohol Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; + Main.persistentBuff[Type] = true; BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } diff --git a/Buffs/Alcohol/TequilaSunriseBuff.cs b/Buffs/Alcohol/TequilaSunriseBuff.cs index 1fd115ce63..af5a5f174a 100644 --- a/Buffs/Alcohol/TequilaSunriseBuff.cs +++ b/Buffs/Alcohol/TequilaSunriseBuff.cs @@ -11,6 +11,7 @@ namespace CalamityMod.Buffs.Alcohol Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; + Main.persistentBuff[Type] = true; BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } diff --git a/Buffs/Alcohol/VodkaBuff.cs b/Buffs/Alcohol/VodkaBuff.cs index b7844903ef..46eaee8329 100644 --- a/Buffs/Alcohol/VodkaBuff.cs +++ b/Buffs/Alcohol/VodkaBuff.cs @@ -12,6 +12,7 @@ namespace CalamityMod.Buffs.Alcohol Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; + Main.persistentBuff[Type] = true; BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } diff --git a/Buffs/Alcohol/WhiskeyBuff.cs b/Buffs/Alcohol/WhiskeyBuff.cs index a496f75f18..66be5a8a0c 100644 --- a/Buffs/Alcohol/WhiskeyBuff.cs +++ b/Buffs/Alcohol/WhiskeyBuff.cs @@ -11,6 +11,7 @@ namespace CalamityMod.Buffs.Alcohol Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; + Main.persistentBuff[Type] = true; BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } diff --git a/Buffs/Alcohol/WhiteWineBuff.cs b/Buffs/Alcohol/WhiteWineBuff.cs index c4781b20ef..eb47a1056f 100644 --- a/Buffs/Alcohol/WhiteWineBuff.cs +++ b/Buffs/Alcohol/WhiteWineBuff.cs @@ -11,6 +11,7 @@ namespace CalamityMod.Buffs.Alcohol Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; + Main.persistentBuff[Type] = true; BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; } diff --git a/Buffs/Pets/BurrowerBuff.cs b/Buffs/Pets/BurrowerBuff.cs new file mode 100644 index 0000000000..f582024ac6 --- /dev/null +++ b/Buffs/Pets/BurrowerBuff.cs @@ -0,0 +1,27 @@ +using CalamityMod.Projectiles.Pets; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.Pets +{ + public class BurrowerBuff : ModBuff + { + public override void SetStaticDefaults() + { + Main.buffNoTimeDisplay[Type] = true; + Main.lightPet[Type] = true; + } + + public override void Update(Player player, ref int buffIndex) + { + player.buffTime[buffIndex] = 18000; + player.Calamity().burrowerPet = true; + bool petProjectileNotSpawned = player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0; + if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer) + { + Projectile.NewProjectile(player.GetSource_Buff(buffIndex), player.Top, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, player.whoAmI, 1f); + } + } + } +} diff --git a/Buffs/Pets/BurrowerBuff.png b/Buffs/Pets/BurrowerBuff.png new file mode 100644 index 0000000000..81bd98ffb1 Binary files /dev/null and b/Buffs/Pets/BurrowerBuff.png differ diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 942954b678..394b655aeb 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -546,6 +546,7 @@ namespace CalamityMod.CalPlayer #endregion #region Pet + public bool burrowerPet = false; public bool thirdSage = false; public bool perfmini = false; public bool akato = false; @@ -2212,6 +2213,7 @@ namespace CalamityMod.CalPlayer perfmini = false; akato = false; yharonPet = false; + burrowerPet = false; leviPet = false; plaguebringerBab = false; rotomPet = false; @@ -5668,13 +5670,6 @@ namespace CalamityMod.CalPlayer return false; } - - if ((CalamityWorld.death || BossRushEvent.BossRushActive) && areThereAnyDamnBosses) - { - chatText = CalamityUtils.GetTextValue("Vanilla.NurseChat.HealNotAllowed"); - return false; - } - return true; } @@ -5691,6 +5686,8 @@ namespace CalamityMod.CalPlayer if (price > 0) { + if (CalamityWorld.death) + price *= 2; if (areThereAnyDamnBosses) price *= 5; diff --git a/CalPlayer/CalamityPlayerDrawEffects.cs b/CalPlayer/CalamityPlayerDrawEffects.cs index 2b71af8555..536764f571 100644 --- a/CalPlayer/CalamityPlayerDrawEffects.cs +++ b/CalPlayer/CalamityPlayerDrawEffects.cs @@ -125,7 +125,7 @@ namespace CalamityMod.CalPlayer else { var dis = Player.Distance(DoG.NPC.Center); - if ((DoG.NPC.ai[3] < 3 || !DoG.Phase2Started) && DoG.NPC.Opacity > 0.5f && !DoG.Dying) + if ((DoG.NPC.ai[3] < 3 || !DoG.Phase2Started) && DoG.NPC.Opacity > 0.5f && !DoG.Dying && !drawInfo.drawPlayer.isDisplayDollOrInanimate) { string phase1IconPath = "CalamityMod/NPCs/DevourerofGods/DevourerofGodsHead_Head_Boss"; string phase2IconPath = "CalamityMod/NPCs/DevourerofGods/DevourerofGodsHead_P2_Head_Boss"; diff --git a/DataStructures/Attunement.cs b/DataStructures/Attunement.cs index e42d5eaa60..9599aea147 100644 --- a/DataStructures/Attunement.cs +++ b/DataStructures/Attunement.cs @@ -570,7 +570,7 @@ namespace CalamityMod.DataStructures item.shootSpeed = 12f; item.UseSound = null; item.noMelee = true; - item.reuseDelay = 30; + item.reuseDelay = 12; } } @@ -595,7 +595,7 @@ namespace CalamityMod.DataStructures item.shootSpeed = 12f; item.UseSound = null; item.noMelee = true; - item.reuseDelay = 30; + item.reuseDelay = 12; } } @@ -646,7 +646,7 @@ namespace CalamityMod.DataStructures item.shootSpeed = 12f; item.UseSound = null; item.noMelee = true; - item.reuseDelay = 30; + item.reuseDelay = 12; } } diff --git a/Effects/OtherworldBarrierDistortion.fx b/Effects/OtherworldBarrierDistortion.fx index ead46908fe..9f854ad59a 100644 --- a/Effects/OtherworldBarrierDistortion.fx +++ b/Effects/OtherworldBarrierDistortion.fx @@ -17,7 +17,7 @@ float4 uShaderSpecificData; float4 AdjustPixelPosition(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0 { // Drift to offset the noisemap. X multiplier is a prime number to ensure the "loop time" of this is very high, it takes 100 uTime to return to the original state - float2 drift = float2(uTime * uRotation, uTime * uSaturation); + float2 drift = float2(0.23 * uTime * uSaturation, uTime * uSaturation); //This is the uv distance from the center of the texture float2 uvOffsetFromCenter = (coords - 0.5); @@ -38,16 +38,8 @@ float4 AdjustPixelPosition(float4 sampleColor : COLOR0, float2 coords : TEXCOORD // I would like to be able to draw directly additive, but I have been unable to make that work and this has worked well. float4 distortedColor = tex2D(uImage0, modifiedCoords); distortedColor.a = distortedColor.x; - distortedColor *= uDirection; - - float4 drawColor = sampleColor; - float4 borderColor = sampleColor; - borderColor.rgb = uSecondaryColor; - - if(dist > 0.4) - drawColor = lerp(sampleColor, borderColor, (dist - 0.4) / 0.1); - return distortedColor * drawColor * mask; + return distortedColor * sampleColor * mask; } diff --git a/Effects/OtherworldBarrierDistortion.xnb b/Effects/OtherworldBarrierDistortion.xnb index ad3fa23439..d933cce2e5 100644 Binary files a/Effects/OtherworldBarrierDistortion.xnb and b/Effects/OtherworldBarrierDistortion.xnb differ diff --git a/ExtraTextures/Bestiary/DesertNuisance_Bestiary.png b/ExtraTextures/Bestiary/DesertNuisance_Bestiary.png deleted file mode 100644 index c592bad6ce..0000000000 Binary files a/ExtraTextures/Bestiary/DesertNuisance_Bestiary.png and /dev/null differ diff --git a/ExtraTextures/Bestiary/DesertPest_Bestiary.png b/ExtraTextures/Bestiary/DesertPest_Bestiary.png deleted file mode 100644 index a2641ce82d..0000000000 Binary files a/ExtraTextures/Bestiary/DesertPest_Bestiary.png and /dev/null differ diff --git a/ExtraTextures/Bestiary/DesertScourge_Bestiary.png b/ExtraTextures/Bestiary/DesertScourge_Bestiary.png deleted file mode 100644 index 4b36bd6565..0000000000 Binary files a/ExtraTextures/Bestiary/DesertScourge_Bestiary.png and /dev/null differ diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index e4a6d4f40e..26e0ae5164 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -28,6 +28,7 @@ using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; using Terraria.UI.Chat; +using static CalamityMod.CalamityUtils; namespace CalamityMod.Items { @@ -1635,7 +1636,35 @@ namespace CalamityMod.Items return false; } + // IV Drip tooltip FX + if (line.Mod == "Terraria" && item.type == ModContent.ItemType() && line.Name == "Tooltip4") + { + Vector2 basePosition = new Vector2(line.X, line.Y); + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, null, null, null, null, Main.UIScaleMatrix); + + for (int i = 0; i < 3; i++) // Draw 3 lines of differing opacity, color, and displacement. + { + float timer = (float)Math.Sin(Main.GlobalTimeWrappedHourly + 1f) / 2f; + + float angle = (Main.GlobalTimeWrappedHourly * 2f) + (i * MathHelper.TwoPi / 3f); + float radius = timer * (3f + i * 6f); + Vector2 offset = new Vector2((float)Math.Cos(angle) * 1.7f, (float)Math.Sin(angle) * 1f) * radius; // Offset in an elliptical pattern + Vector2 pos = basePosition + offset; + + Color color = MulticolorLerp(Math.Abs(timer + (i * 0.2f)) % 1f, Color.LightBlue, Color.LightGreen, (i == 3) ? Color.Blue : (i == 2) ? Color.Red : Color.White); + float opacity = 1f - (i * 0.2f); + float rotation = line.Rotation + (timer * (Main.GlobalTimeWrappedHourly * 0.00001f)); // This precision is intended + + ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, line.Font, line.Text, pos, color * opacity, rotation, line.Origin, line.BaseScale, line.MaxWidth, line.Spread); + } + + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, null, null, Main.UIScaleMatrix); + + return false; + } if (line.Mod == "Terraria" && item.type == ModContent.ItemType() && (line.Name == "Tooltip1" || line.Name == "Tooltip2" || line.Name == "Tooltip4" || line.Name == "Tooltip5" || line.Name == "Tooltip7")) { Color rarityColor = Color.Black; diff --git a/Items/Pets/BurrowerController.cs b/Items/Pets/BurrowerController.cs new file mode 100644 index 0000000000..2a84238557 --- /dev/null +++ b/Items/Pets/BurrowerController.cs @@ -0,0 +1,48 @@ +using CalamityMod.Buffs.Pets; +using CalamityMod.NPCs.ExoMechs.Thanatos; +using CalamityMod.Projectiles.Pets; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.GameContent; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Pets +{ + public class BurrowerController : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Pets"; + public override void SetDefaults() + { + Item.DefaultToVanitypet(ModContent.ProjectileType(), ModContent.BuffType()); + Item.rare = ItemRarityID.Green; + Item.value = Item.sellPrice(gold: 3); + Item.UseSound = ThanatosHead.ThanatosHitSoundClosed; + } + + public override void UseStyle(Player player, Rectangle heldItemFrame) + { + if (player.whoAmI == Main.myPlayer && player.itemTime == 0) + { + player.AddBuff(Item.buffType, 3600, true); + } + } + public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale) + { + CalamityUtils.DrawInventoryCustomScale( + spriteBatch, + texture: TextureAssets.Item[Type].Value, + position, + frame, + drawColor, + itemColor, + origin, + scale, + wantedScale: 0.8f, + drawOffset: new(0f, 0f) + ); + return false; + } + } +} diff --git a/Items/Pets/BurrowerController.png b/Items/Pets/BurrowerController.png new file mode 100644 index 0000000000..10e9b1849b Binary files /dev/null and b/Items/Pets/BurrowerController.png differ diff --git a/Items/Placeables/SunkenSea/EutrophicGlass.cs b/Items/Placeables/SunkenSea/EutrophicGlass.cs index 85343008aa..9d4d5ebd5c 100644 --- a/Items/Placeables/SunkenSea/EutrophicGlass.cs +++ b/Items/Placeables/SunkenSea/EutrophicGlass.cs @@ -1,4 +1,5 @@ -using Terraria.ID; +using CalamityMod.Items.Placeables.Walls; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.SunkenSea @@ -19,6 +20,12 @@ namespace CalamityMod.Items.Placeables.SunkenSea AddIngredient(2). AddTile(TileID.Furnaces). Register(); + + CreateRecipe(). + AddIngredient(4). + AddTile(TileID.WorkBenches). + DisableDecraft(). + Register(); } } } diff --git a/Items/Potions/Alcohol/GrapeBeer.cs b/Items/Potions/Alcohol/GrapeBeer.cs index 1370471392..d34f5d2866 100644 --- a/Items/Potions/Alcohol/GrapeBeer.cs +++ b/Items/Potions/Alcohol/GrapeBeer.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Potions.Alcohol public override void SetStaticDefaults() { - Item.ResearchUnlockCount = 30; + Item.ResearchUnlockCount = 20; ItemID.Sets.DrinkParticleColors[Type] = new Color[3] { new Color(36, 2, 41), new Color(56, 0, 64), diff --git a/Items/Potions/Alcohol/Margarita.cs b/Items/Potions/Alcohol/Margarita.cs index bfe464f655..540564af49 100644 --- a/Items/Potions/Alcohol/Margarita.cs +++ b/Items/Potions/Alcohol/Margarita.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Potions.Alcohol public override void SetStaticDefaults() { - Item.ResearchUnlockCount = 30; + Item.ResearchUnlockCount = 20; ItemID.Sets.DrinkParticleColors[Type] = new Color[3] { new Color(219, 227, 191), new Color(186, 189, 147), diff --git a/Items/Potions/Alcohol/RedWine.cs b/Items/Potions/Alcohol/RedWine.cs index dd9a8c55f3..cfbb26c2e8 100644 --- a/Items/Potions/Alcohol/RedWine.cs +++ b/Items/Potions/Alcohol/RedWine.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Potions.Alcohol public override void SetStaticDefaults() { - Item.ResearchUnlockCount = 30; + Item.ResearchUnlockCount = 20; ItemID.Sets.DrinkParticleColors[Type] = new Color[3] { new Color(54, 5, 21), new Color(82, 9, 36), diff --git a/Items/Potions/Alcohol/Vodka.cs b/Items/Potions/Alcohol/Vodka.cs index 625c737ae5..df6d812501 100644 --- a/Items/Potions/Alcohol/Vodka.cs +++ b/Items/Potions/Alcohol/Vodka.cs @@ -36,8 +36,8 @@ namespace CalamityMod.Items.Potions.Alcohol } public override void AddRecipes() { - CreateRecipe(6). - AddIngredient(ItemID.BottledWater, 6). + CreateRecipe(10). + AddIngredient(ItemID.Bottle, 10). AddIngredient(10). AddIngredient(10). AddTile(TileID.Kegs). diff --git a/Items/Potions/Alcohol/WhiteWine.cs b/Items/Potions/Alcohol/WhiteWine.cs index 9e0be6cb45..7c6c6a26eb 100644 --- a/Items/Potions/Alcohol/WhiteWine.cs +++ b/Items/Potions/Alcohol/WhiteWine.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Potions.Alcohol public override void SetStaticDefaults() { - Item.ResearchUnlockCount = 30; + Item.ResearchUnlockCount = 20; // Clear, yellow-green ItemID.Sets.DrinkParticleColors[Type] = new Color[3] { new Color(242, 252, 177, 180), diff --git a/Items/Weapons/Melee/FourSeasonsGalaxia.cs b/Items/Weapons/Melee/FourSeasonsGalaxia.cs index 13f1c4c48c..681c4a05ce 100644 --- a/Items/Weapons/Melee/FourSeasonsGalaxia.cs +++ b/Items/Weapons/Melee/FourSeasonsGalaxia.cs @@ -120,7 +120,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.rare = RarityType(); Item.shoot = ProjectileID.PurificationPowder; Item.shootSpeed = 24f; - Item.reuseDelay = 30; + Item.reuseDelay = 12; } #region saving and syncing attunements diff --git a/Items/Weapons/Ranged/SuperradiantSlaughterer.cs b/Items/Weapons/Ranged/SuperradiantSlaughterer.cs index c80cdcde83..9685412233 100644 --- a/Items/Weapons/Ranged/SuperradiantSlaughterer.cs +++ b/Items/Weapons/Ranged/SuperradiantSlaughterer.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 84; Item.height = 46; - Item.damage = 97; + Item.damage = 100; Item.DamageType = DamageClass.Ranged; Item.useTime = 10; Item.useAnimation = 10; diff --git a/Items/Weapons/Rogue/HardenedHoneycomb.cs b/Items/Weapons/Rogue/HardenedHoneycomb.cs index 175a7f3c36..6e34fb3c3e 100644 --- a/Items/Weapons/Rogue/HardenedHoneycomb.cs +++ b/Items/Weapons/Rogue/HardenedHoneycomb.cs @@ -9,11 +9,6 @@ namespace CalamityMod.Items.Weapons.Rogue { public class HardenedHoneycomb : RogueWeapon { - public override void SetStaticDefaults() - { - Item.ResearchUnlockCount = 99; - } - public override void SetDefaults() { Item.width = 30; diff --git a/Items/Weapons/Rogue/KelvinCatalyst.cs b/Items/Weapons/Rogue/KelvinCatalyst.cs index cfcd7844f7..bdb23f1f1c 100644 --- a/Items/Weapons/Rogue/KelvinCatalyst.cs +++ b/Items/Weapons/Rogue/KelvinCatalyst.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 20; Item.height = 20; - Item.damage = 60; + Item.damage = 50; Item.noMelee = true; Item.noUseGraphic = true; Item.autoReuse = true; diff --git a/Items/Weapons/Summon/UniverseSplitter.cs b/Items/Weapons/Summon/UniverseSplitter.cs index cf89a19fdb..6eb2272ea5 100644 --- a/Items/Weapons/Summon/UniverseSplitter.cs +++ b/Items/Weapons/Summon/UniverseSplitter.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using CalamityMod.Items.Pets; using CalamityMod.Items.SummonItems; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; @@ -75,6 +76,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void AddRecipes() { CreateRecipe(). + AddIngredient(). AddIngredient(). AddIngredient(5). AddTile(). diff --git a/Localization/en-US/Mods.CalamityMod.Bestiary.Vanilla.hjson b/Localization/en-US/Mods.CalamityMod.Bestiary.Vanilla.hjson index 6eb062ab99..1b8d3e82f5 100644 --- a/Localization/en-US/Mods.CalamityMod.Bestiary.Vanilla.hjson +++ b/Localization/en-US/Mods.CalamityMod.Bestiary.Vanilla.hjson @@ -1,6 +1,6 @@ // Put their internal name here NPCName: { - Guide: Once tasked with shepherding the Wall of Flesh, the Guide is a godlike figure in Demon folklore. However, the former warlock apprentice now savors a humble life, mentoring adventurers with his sharp intuition. + Guide: Once tasked with shepherding the Wall of Flesh, the Guide is a godlike figure in Demon folklore. However, the former warlock apprentice now savors a humble life, offering useful advice and crafting recipes. Dryad: The Dryad practices the art of Life Magic, pioneered by Silva. She is connected with nature and can analyze its purity worldwide. She sells seeds, too! Mechanic: The Mechanic was imprisoned for sticking her nose where she shouldn't. She sells wiring and tools for putting together anything imaginable. EmpressButterfly: These familiars conjured by the Empress draw power from their surroundings and later bring it to their master. They remind her of a lost loved one, and should one perish in the chaos of night, she shall unleash her full fury upon the attacker. @@ -56,13 +56,12 @@ NPCName: { RaggedCaster: "{$CommonEntries.RaggedCaster}" RaggedCasterOpenCoat: "{$CommonEntries.RaggedCaster}" DungeonGuardian: The Old Man is cursed to never leave nor enter the Dungeon, much less die. Whoever crosses paths with him and dares to descend into those halls shall not pass! - BoneSerpentHead: Mighty serpentine beasts ruled hell since before history, later led by the exiled Flame Dragon. For said alliance, their obsidian scales were turned to Ash shortly after his demise. Now their skeletal husks remain, forced to protect the demonic territory using stolen Azafurian spells. + BoneSerpentHead: Mighty serpentine beasts ruled hell since before history, but after the demise of their liege, godly wrath had their obsidian scales immolated. Now only their skeletal husks remain, forced by stolen spells to protect demonic territory. Demon: Despite being a primitive civilization, demons populate most of the underworld. Unlike their lesser brothers, they cast shadow magic rather than hell magic. VoodooDemon: Demons have several religious practices, especially sacrifices. They worship the Wall of Flesh ever since it started roaming the underworld, using offerings to draw it closer. - RedDevil: Conjuring potent spears of dark magic, these elite demons look after the adventurer that destroyed their perceived deity. + RedDevil: Conjuring potent spears of dark magic, these elite demons hunt after the adventurer that destroyed their perceived deity. WyvernHead: Deeply in tune with the magic of the world, these serpentine dragons guard the skyward ruins of Chrysadia on behalf of the Storm Dragon. Now, their duty calls louder as divine essence surges through the land. - Harpy: Winged, demi-human creatures from distant southward mountains who came to inhabit Chrysadia after its tragic downfall. They defend their new territory fiercely against invaders with their razor-sharp feathers. - Scutlix: One of the few creatures left in the Martian homeworld, these creatures function similarly to horses. That is, if horses could fire lasers from their eyes. + Harpy: Winged, demi-human creatures from distant southward mountains who came to inhabit the sky archipelago after the ruin of its old civilization. They defend their new territory fiercely against invaders with their razor-sharp feathers. MartianProbe: Sensing growing power on the planet, otherworldly beings send space-age technology to scan for valuable resources. SeekerHead: Godly magicks have unleashed the dark influences that gave birth to the Eater of Worlds, producing smaller, but just as deadly worms. DesertDjinn: Buried in these caves lie cryptic artifacts older than Ilmeris, their origins swept away by the sands of time. Corrupted by divine magicks, the once friendly djinns within them now reemerge, full of hostility. @@ -82,7 +81,7 @@ NPCName: { Spazmatism: A pair of mechanical eyes built by Draedon for reconnaissance and assassination, Spazmatism chases at high speed, exhaling cursed flames. TheDestroyer: Despite being made with repurposed mining equipment, the Destroyer was built for fighting other deities in single combat, decorated in laser-armed probes, which detach from its body when damaged. SkeletronPrime: Built with the express purpose of inciting fear into the hearts of any god worshiper, this machine has more arms than ever before, and a variety of fierce weapons. - Plantera: A creation of the Vernal Pass meant to replace Braelor in his absence. They harnessed dead animal souls to give it life, but the span of such magic was far larger than anticipated. It didn't take long for the Plantera to grow out of control and slaughter its masters. + Plantera: A dormant, yet powerful floral guardian grown by the elders of the Vernal Pass, using volatile animal souls as nourishment. Unshackled in a fit of herbage carnage, its reach now spans the entire jungle. HallowBoss: Despite their parentage, children of gods do not inherit a shred of their power. The Empress chose to claim power for herself by siphoning it from other places and beings. She found a perfect candidate in the Hallow due to its unstable nature, and is now transformed into a mighty fae. Golem: A remarkable display of ingenuity constructed by the Lihzahrd race. Seeking light after they hid away in their temple out of shame for driving their goddess away, they built this construct. Powered by solar energy cells, it is ready to guard the Temple. DukeFishron: An aquatic-evolved species which lives in isolation in the depths of the ocean. Despite their shortcomings, they still share blood with the dragons of old, claiming near complete dominion over the oceans. Legends claim it only surfaces in search of a rare, savory type of worm. diff --git a/Localization/en-US/Mods.CalamityMod.Buffs.hjson b/Localization/en-US/Mods.CalamityMod.Buffs.hjson index ae385a7afb..911c78facb 100644 --- a/Localization/en-US/Mods.CalamityMod.Buffs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Buffs.hjson @@ -1195,6 +1195,11 @@ BrittleStar: { Description: The brittle star will protect you } +BurrowerBuff: { + DisplayName: Burrower + Description: A friendly burrower answered your call +} + CalamarisLamentBuff: { DisplayName: Calamari Description: Time to transport all of your foes to stupid squid jail! diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index caa00403e6..4f2edd1b4f 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -434,7 +434,7 @@ CorrosiveSpine: { Tooltip: ''' 5% increased movement speed - Multiplies all sickness and water-related debuff damage by 1.25x + 25% increased Sickness and Water debuff damage All attacks irradiate enemies and reduces the severity of the sulphuric waters You burst into radioactive clouds when struck ''' @@ -490,7 +490,7 @@ CryoStone: { DisplayName: Cryo Stone Tooltip: ''' - Multiplies all cold-based debuff damage by 1.5x + 50% increased Cold debuff damage Creates a rotating ice shield around you that damages and slows down enemies on contact 'One of the ancient relics' ''' @@ -593,7 +593,7 @@ DiamondOfTheDeep: { DisplayName: Diamond of the Deep Tooltip: ''' - Multiplies all water debuff damage by 1.6x + 60% increased Water debuff damage Slowly accrue up to three different abyssal spirits Dash to disperse the spirits and have them attack enemies When dispersed [c/CB7AD7:below 50% life], the spirits support you instead @@ -1575,7 +1575,7 @@ SeaSpiritAmulet: { Slowly accumulate up to eight spirit orbs that follow you Spirits disperse when dashing If below 50% life, they will heal you, otherwise they will attack nearby enemies - Multiplies all water debuff damage by 1.35x + 35% increased Water debuff damage Spirit orbs are transparent and silent if visibility is disabled ''' } @@ -1877,7 +1877,7 @@ TheAmalgam: { Tooltip: ''' 10% increased damage - All attacks inflict a variety of debuffs and multiplies all elemental debuff damage by 3x + All attacks inflict a variety of debuffs, 200% increased elemental debuff damage Most buffs last twice as long, and persist after dying Taking damage confuses nearby enemies and spawns a dank creeper The dank creeper flies above you, exploding into several shaderain clouds @@ -1990,7 +1990,7 @@ ToxicHeart: { ''' Your heart beats with the plague, pulsing outside of your body Pulse frequency scale with regen, and pulses that kill enemies pulse again to heal you - Multiplies all sickness debuff damage by 1.5x + 50% increased Sickness debuff damage Effects are transparent and silent if visibility is disabled ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Pets.hjson b/Localization/en-US/Mods.CalamityMod.Items.Pets.hjson index 12e02b0929..d8d310e8b3 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Pets.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Pets.hjson @@ -26,6 +26,15 @@ BrimstoneJewel: { ''' } +BurrowerController: { + DisplayName: Burrower Beacon + Tooltip: + ''' + Requests a friendly burrower to follow you around and illuminate ores + Counts as a light pet + ''' +} + CharredRelic: { DisplayName: Charred Relic Tooltip: Contains a small amount of brimstone diff --git a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson index 76aec6fc70..4cad6c3aea 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson @@ -166,7 +166,6 @@ ZergPotion: { Tooltip: Vastly increases enemy spawn rate } -// Very normal Keg crafts BloodyMary: { DisplayName: Bloody Mary Tooltip: @@ -376,7 +375,7 @@ Vodka: { Tooltip: ''' {0}% increased Typeless debuff damage - {1}% decreased other debuff damage + {1}% decreased elemental debuff damage {$Common.AlcoholWarning} ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson b/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson index 3aa5e40fbb..dd5573460f 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson @@ -415,6 +415,7 @@ WulfrumDiggingTurtle: { ''' Throws a rickety mining contraption to dig out a small tunnel In case of an emergency, press to instantly detonate all your digging turtles + The turtle scales with your pickaxe power ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Pets.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Pets.hjson index c9d79d855f..1578f2adc3 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Pets.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Pets.hjson @@ -31,3 +31,4 @@ Sparks.DisplayName: Sparks ThirdSage.DisplayName: Third Sage ToastyBatPet.DisplayName: Toasty Bat Friend YharonSonPet.DisplayName: Son of Yharon +BurrowerPet.DisplayName: Burrower diff --git a/Localization/en-US/Mods.CalamityMod.UI.hjson b/Localization/en-US/Mods.CalamityMod.UI.hjson index 72f7906a3d..150728ab41 100644 --- a/Localization/en-US/Mods.CalamityMod.UI.hjson +++ b/Localization/en-US/Mods.CalamityMod.UI.hjson @@ -1,4 +1,4 @@ -SmallWorldWarning: "[c/FF0000:SMALL WORLDS NOT SUPPORTED BY CALAMITY]" +SmallWorldWarning: "[c/FF0000:SMALL WORLDS NOT SUPPORTED BY CALAMITY]" // Main Menu Name MainMenu: Calamity Style MainMenuClassic: Calamity Style - Classic @@ -34,47 +34,52 @@ DifficultyClickText: "[c/919191:Click to select a difficulty mode]" ExpertDifficultyLock: "[c/919191:Higher difficulty modes can only be toggled in Expert Mode or above]" ChangingTheRules: "[c/919191:You cannot change the rules now!]" DifficultySwitch: Difficulty changed from [c/{0}:{1}] to [c/{2}:{3}]. -ClassicInfo: Your Adventure Begins... A far more relaxed Terraria experience -ExpertShortInfo: "[c/FFBA75:Fortune & Glory, Kid. For those looking for a more difficult vanilla experience]" +ClassicInfo: Your Adventure Begins... A relaxed, casual Terraria experience +ExpertShortInfo: "[c/FF9900:Fortune & Glory, Kid. For those looking for a more difficult vanilla experience]" ExpertExpandedInfo: ''' [c/A87A07:Most bosses gain new attacks and more difficult attack patterns] [c/A87A07:Most enemies have twice as much health, deal twice as much damage and receive 10% less knockback] [c/A87A07:Certain enemies have new attacks, can inflict new debuffs or have a higher chance of inflicting debuffs they already had] - [c/A87A07:Enemies drop more loot, as well as having higher chances] + [c/A87A07:Enemies drop more loot and have higher drop rates for their items] + [c/A87A07:Bosses have exclusive, signature "Expert drop" items] [c/A87A07:Players drop more of their coins on death] ''' -MasterShortInfo: "[c/1CFFAA:Game over man, game over! A tougher step up in stats from Expert Mode]" +MasterShortInfo: "[c/FF2619:Game over man, game over! A tough step up in stats from Expert Mode]" MasterExpandedInfo: ''' - [c/029C6D:Most enemies have even more health and knockback resistance added on from Expert Mode] - [c/029C6D:Bosses have new exclusive vanity rewards] - [c/029C6D:Players drop ALL their coins on death] - [c/029C6D:Players gain an additional accessory slot at the start of the game] + [c/bd5e6e:Most enemies have even more health and knockback resistance than in Expert Mode] + [c/bd5e6e:All foes deal even more damage than in Expert Mode] + [c/bd5e6e:Bosses have new exclusive vanity rewards] + [c/bd5e6e:Players drop ALL their coins on death] + [c/bd5e6e:Players gain an additional accessory slot at the start of the game] ''' +LegendaryShortInfo: "[c/32CD32:For those who are worthy... Even higher stats than Master Mode]" +LegendaryExpandedInfo: "[c/0b870b:Enemies have further increased health and contact damage from Master Mode]" Revengeance: Revengeance -RevengeanceShortInfo: "[c/F54254:The intended Calamity experience! Can only be enabled in Expert Mode!]" +RevengeanceShortInfo: "[c/F54254:The intended Calamity experience. Can only be enabled in Expert Mode]" RevengeanceExpandedInfo: ''' [c/B55362:Enables the] [c/85FFE9:Adrenaline] [c/B55362:mechanic. You gain Adrenaline while fighting bosses. Getting hit drops Adrenaline back to 0] [c/B55362: When Adrenaline is maxed, press] {1} [c/B55362:for a large damage boost] [c/B55362:Enables the] [c/FF8B54:Rage] [c/B55362:mechanic. You gain Rage when in proximity of enemies or by using certain items] [c/B55362: When Rage is maxed, press] {0} [c/B55362:for a temporary damage boost] - [c/B55362:Most foes have higher stats and more aggressive AIs] - [c/B55362:Bosses have new AI mechanics, new phases, and will drop Master Mode loot. Enemies spawn more frequently] - [c/F7342A:This mode is more difficult than Expert. Be sure to prepare for the challenge] + [c/B55362:Many enemies have new, more aggressive behavior patterns. Enemies spawn more frequently] + [c/B55362:All bosses have new attacks and patterns. Some are completely changed] + [c/B55362:Bosses will drop both "Expert drop" items and Master Mode's vanity rewards] ''' Death: Death -DeathShortInfo: "[c/E066F7:A far more difficult challenge than Revengeance Mode! Can only be enabled in Master Mode!]" +DeathShortInfo: "[c/E066F7:A far greater challenge than Revengeance! Can only be enabled in Master Mode]" DeathExpandedInfo: ''' - [c/B834E0:All foes will pose a much larger threat with highly aggressive AIs] - [c/B834E0:Bosses have substantially harder AI changes. Enemies are even more numerous and can easily overwhelm you] + [c/B834E0:Most basic enemies pose a much larger threat with highly aggressive behavior] + [c/B834E0:Blood Moons spawn unending waves of foes which can quickly overwhelm you] + [c/B834E0:Bosses are substantially faster and much more difficult than in Revengeance Mode] [c/B834E0:Debuffs are especially lethal and the Abyss is significantly more dangerous] - [c/E945FF:Vigilance and tenacity are crucial to survival] ''' -// Legendary (FTW + Master) + Death Mode Malice: Malice +MaliceShortInfo: "[c/f08080:For those who wish for suffering. Can only be enabled in Legendary Mode]" +MaliceExpandedInfo: "[c/a34e4e:Enemies have Death Mode and For The Worthy behavior with Legendary Mode stats]" // Calamity Health Bar ExoTwinsNameNormal: XS-01 Artemis and XS-03 Apollo ExoTwinsNameHekate: Eyes of XB-∞ Hekate diff --git a/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson b/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson index edd4c8b9e2..4fe4d6f239 100644 --- a/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson +++ b/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson @@ -28,7 +28,7 @@ SetBonus: { ''' Eskimo: ''' - Multiplies all cold-based debuff damage by 1.25x + 25% increased Cold debuff damage Provides immunity to the Chilled, Frozen, and Frostburn debuffs ''' Rain: diff --git a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson index fdfc10a0fc..dabf9366a9 100644 --- a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson +++ b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson @@ -19,7 +19,7 @@ AddedTooltip: { ArcaneFlower: 5% increased magic damage HellfireTreads: ''' - Multiplies all fire-based debuff damage by 1.5x, does not stack with downgrades + 50% increased Heat debuff damage, does not stack with downgrades All attacks inflict Hellfire ''' FairyBoots: @@ -200,7 +200,7 @@ EditedTooltip: { ''' FlameWakerBoots: ''' - Multiplies all fire-based debuff damage by 1.25x + 25% increased Heat debuff damage All attacks light enemies on fire 'Never get cold feet again' ''' @@ -341,8 +341,6 @@ MerchantChat: { Bandit: I happen to have several Angel Statues at the moment, a truely rare commodity. Want one? } -NurseChat.HealNotAllowed: Now is not the time! - PainterChat: { Corruption: A little sickness isn't going to stop me from doing my work as an artist! Crimson: There's a surprising art to this area. A sort of horrifying, eldritch feeling. It inspires me! diff --git a/NPCs/Abyss/BoxJellyfish.cs b/NPCs/Abyss/BoxJellyfish.cs index 255c805081..77b456c045 100644 --- a/NPCs/Abyss/BoxJellyfish.cs +++ b/NPCs/Abyss/BoxJellyfish.cs @@ -220,7 +220,7 @@ namespace CalamityMod.NPCs.Abyss public override void ModifyNPCLoot(NPCLoot npcLoot) { - npcLoot.Add(ItemID.JellyfishNecklace, 25); + npcLoot.Add(ItemID.JellyfishNecklace, 30); var postSkeletron = npcLoot.DefineConditionalDropSet(() => NPC.downedBoss3); postSkeletron.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 50, 40)); } diff --git a/NPCs/Abyss/CannonballJellyfish.cs b/NPCs/Abyss/CannonballJellyfish.cs index 972a6e20d6..4ac27bd126 100644 --- a/NPCs/Abyss/CannonballJellyfish.cs +++ b/NPCs/Abyss/CannonballJellyfish.cs @@ -321,7 +321,7 @@ namespace CalamityMod.NPCs.Abyss { npcLoot.Add(ItemID.Bomb); npcLoot.Add(ItemDropRule.NormalvsExpert(ItemID.Bezoar, 100, 50)); - npcLoot.Add(ItemID.JellyfishNecklace, 25); + npcLoot.Add(ItemID.JellyfishNecklace, 30); } } } diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 03362a764a..9928e95540 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -76,6 +76,7 @@ using Terraria.GameContent; using Terraria.GameContent.Achievements; using Terraria.GameContent.Bestiary; using Terraria.GameContent.Events; +using Terraria.GameContent.UI.BigProgressBar; using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; @@ -1213,9 +1214,13 @@ namespace CalamityMod.NPCs VulnerabilitiesAndResistances(npc); - //Gives Brain of Cthulhu a unique boss bar in Rev+ where Creepers contribute to a Shield rather than additional Health + // Gives Brain of Cthulhu a unique boss bar in Rev+ where Creepers contribute to a Shield rather than additional Health if (npc.type == NPCID.BrainofCthulhu && CalamityWorld.revenge) npc.BossBar = GetInstance(); + // Replaces Moon Lord's boss bar in Rev+ to fix a health counting bug with the eyes after being killed + bool hasBar = Main.BigBossProgressBar.TryGetSpecialVanillaBossBar(npc.type, out IBigProgressBar bar); + if (hasBar && bar is MoonLordProgressBar && CalamityWorld.revenge) + npc.BossBar = GetInstance(); } public override bool? CanFallThroughPlatforms(NPC npc) @@ -6204,7 +6209,6 @@ namespace CalamityMod.NPCs case NPCID.GoblinSummoner: case NPCID.GoblinSorcerer: case NPCID.PirateCaptain: - case NPCID.Scutlix: case NPCID.MartianSaucerCore: case NPCID.TorchGod: case NPCID.EyeofCthulhu: diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index 44daaf0bc4..a2f1b61a2d 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -104,11 +104,9 @@ namespace CalamityMod.NPCs #region Sky / Space // Harpy // Sky Glaze @ 3.33% IF Eye of Cthulhu dead - // Giant Harpy Feather @ 1.25% (0.67% in Vanilla) // Essence of Sunlight @ 50% IF Hardmode and not statue spawned case NPCID.Harpy: postEoC.Add(ModContent.ItemType(), 30); - npcLoot.ChangeDropRate(ItemID.GiantHarpyFeather, 1, 80); hardmode.AddIf(() => !npc.SpawnedFromStatue, ModContent.ItemType(), 2); break; @@ -150,13 +148,13 @@ namespace CalamityMod.NPCs break; // Medusa - // Pocket Mirror @ 10% Normal, 20% Expert+ + // Pocket Mirror @ 7.14% Normal, 14.29% Expert+ (2.5% Normal, 5% Expert+ in vanilla) case NPCID.Medusa: // Remove the vanilla loot rule for Pocket Mirror. npcLoot.RemoveWhere((rule) => rule is CommonDrop conditionalRule && conditionalRule.itemId == ItemID.PocketMirror); // Define a replacement rule which has an increased chance. - npcLoot.Add(ItemDropRule.NormalvsExpert(ItemID.PocketMirror, 10, 5)); + npcLoot.Add(ItemDropRule.NormalvsExpert(ItemID.PocketMirror, 14, 7)); break; // Tim @@ -167,23 +165,16 @@ namespace CalamityMod.NPCs // Skeleton Archer // Magic Quiver @ 5% (2.5% in Vanilla) - // Marrow @ 2.5% (0.5% in Vanilla) + // Marrow @ 2% (0.5% in Vanilla) case NPCID.SkeletonArcher: npcLoot.ChangeDropRate(ItemID.MagicQuiver, 1, 20); - npcLoot.ChangeDropRate(ItemID.Marrow, 1, 40); + npcLoot.ChangeDropRate(ItemID.Marrow, 1, 50); break; // Armored Skeleton - // Beam Sword @ 2.5% (0.67% in Vanilla) + // Beam Sword @ 2% (0.67% in Vanilla) case NPCID.ArmoredSkeleton: - npcLoot.ChangeDropRate(ItemID.BeamSword, 1, 40); - break; - - // Black Recluse - // Poison Staff @ 5% (2.5% in Vanilla) - case NPCID.BlackRecluse: - case NPCID.BlackRecluseWall: - npcLoot.ChangeDropRate(ItemID.PoisonStaff, 1, 20); + npcLoot.ChangeDropRate(ItemID.BeamSword, 1, 50); break; // Mimic @@ -397,23 +388,24 @@ namespace CalamityMod.NPCs #region Aquatic / Ocean // Pink Jellyfish // Life Jelly @ 10% Normal, 14.29% Expert+ + // Jellyfish Necklace @ 3.33% (1% in vanilla) case NPCID.PinkJellyfish: npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 10, 7)); - npcLoot.ChangeDropRate(ItemID.JellyfishNecklace, 1, 25); + npcLoot.ChangeDropRate(ItemID.JellyfishNecklace, 1, 30); break; // Blue Jellyfish // Cleansing Jelly @ 10% Normal, 14.29% Expert+ case NPCID.BlueJellyfish: npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 10, 7)); - npcLoot.ChangeDropRate(ItemID.JellyfishNecklace, 1, 25); + npcLoot.ChangeDropRate(ItemID.JellyfishNecklace, 1, 30); break; // Green Jellyfish // Vital Jelly @ 12.5% Normal, 20% Expert+ case NPCID.GreenJellyfish: npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 8, 5)); - npcLoot.ChangeDropRate(ItemID.JellyfishNecklace, 1, 25); + npcLoot.ChangeDropRate(ItemID.JellyfishNecklace, 1, 30); break; // Piranha, Arapaima, Blood Feeder @@ -435,10 +427,10 @@ namespace CalamityMod.NPCs break; // Blood Jelly, Fungo Fish - // Jellyfish Necklace @ 1% + // Jellyfish Necklace @ 3.33% case NPCID.BloodJelly: case NPCID.FungoFish: - npcLoot.Add(ItemID.JellyfishNecklace, 25); + npcLoot.Add(ItemID.JellyfishNecklace, 30); break; #endregion diff --git a/NPCs/CalamityGlobalTownNPC.cs b/NPCs/CalamityGlobalTownNPC.cs index 270fa3b959..860f5d76fe 100644 --- a/NPCs/CalamityGlobalTownNPC.cs +++ b/NPCs/CalamityGlobalTownNPC.cs @@ -184,6 +184,7 @@ namespace CalamityMod.NPCs "Robin", // <@!654737510030639112> (altzeus) "Curly", // <@!673092101780668416> (curly4830) "Cobalt", // <@!132962828922388481> (cobalt_44) + "Dizzetriya", // <@!719818245665980517> (dizzykbity) ]; private static readonly string[] MerchantNames = [ @@ -206,6 +207,7 @@ namespace CalamityMod.NPCs [ "Arin", // <@!268169458302976012> (kiyotu) "Typhäne", // <@!222064016107896832> (typhane.) + "Charlotte Linlin", // <@!563406464522125323> (vixcalibur) ]; private static readonly string[] PirateNames = [ @@ -307,6 +309,7 @@ namespace CalamityMod.NPCs "Nextdoor Psycho", // <@!173261518572486656> (nextdoorpsycho) "Mike Cyclops", // <@!702327497475227741> (seichoseicho) "Derin", // <@!466703979695308820> (god_15) + "Umbara", // <@!450062421294579712> (umbaraeclipse) ]; private static readonly string[] ZoologistNames = [ @@ -1230,10 +1233,7 @@ namespace CalamityMod.NPCs shop.AddWithCustomValue(ItemType(), Item.buyPrice(gold: 20), Condition.DownedSkeletron) .Add(Condition.Hardmode) .AddWithCustomValue(ItemID.Boomstick, Item.buyPrice(gold: 25), Condition.DownedQueenBee) - .AddWithCustomValue(ItemID.Uzi, Item.buyPrice(gold: 50), Condition.DownedPlantera) - .AddWithCustomValue(ItemID.TacticalShotgun, Item.buyPrice(platinum: 1), Condition.DownedGolem) - .AddWithCustomValue(ItemID.SniperRifle, Item.buyPrice(platinum: 1), Condition.DownedGolem) - .AddWithCustomValue(ItemID.RifleScope, Item.buyPrice(platinum: 1), Condition.DownedGolem); + .AddWithCustomValue(ItemID.Uzi, Item.buyPrice(gold: 50), Condition.DownedPlantera); } if (type == NPCID.Stylist) @@ -1247,8 +1247,7 @@ namespace CalamityMod.NPCs if (type == NPCID.Cyborg) { - shop.AddWithCustomValue(ItemID.RocketLauncher, Item.buyPrice(platinum: 1), Condition.DownedGolem) - .Add(Condition.DownedGolem) + shop.Add(Condition.DownedGolem) .Add(CalamityConditions.DownedPolterghast); } @@ -1309,10 +1308,6 @@ namespace CalamityMod.NPCs { shop.Add() .AddWithCustomValue(ItemID.MagicMissile, Item.buyPrice(gold: 25)) - .AddWithCustomValue(ItemID.SpectreStaff, Item.buyPrice(platinum: 1), Condition.DownedGolem) - .AddWithCustomValue(ItemID.InfernoFork, Item.buyPrice(platinum: 1), Condition.DownedGolem) - .AddWithCustomValue(ItemID.ShadowbeamStaff, Item.buyPrice(platinum: 1), Condition.DownedGolem) - .AddWithCustomValue(ItemID.MagnetSphere, Item.buyPrice(platinum: 1), Condition.DownedGolem) .Add() .Add() .Add() @@ -1325,8 +1320,7 @@ namespace CalamityMod.NPCs .InsertAfter(ItemID.OasisFountain, ItemType()) .InsertAfter(ItemID.OasisFountain, ItemType()) .InsertAfter(ItemID.OasisFountain, ItemType()) - .InsertAfter(ItemID.OasisFountain, ItemType()) - .AddWithCustomValue(ItemID.ButterflyDust, Item.buyPrice(gold: 25), Condition.DownedGolem); + .InsertAfter(ItemID.OasisFountain, ItemType()); } if (type == NPCID.PartyGirl) diff --git a/NPCs/Deconstructors/Burrower.cs b/NPCs/Deconstructors/Burrower.cs index 48bab815a8..e5d3a05607 100644 --- a/NPCs/Deconstructors/Burrower.cs +++ b/NPCs/Deconstructors/Burrower.cs @@ -4,6 +4,7 @@ using System.Linq; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Effects; using CalamityMod.Items.Materials; +using CalamityMod.Items.Pets; using CalamityMod.Items.Placeables.Banners; using CalamityMod.NPCs.ExoMechs.Thanatos; using CalamityMod.Particles; @@ -190,26 +191,6 @@ namespace CalamityMod.NPCs.Deconstructors public Vector2 TargetVector = Vector2.Zero; public Vector2 SecondaryVector = Vector2.Zero; public float StoredValue = 0; - void TurnTowards(Vector2 goal, float offset = 0, float maxSpeed = 1) - { - float goal2 = (goal - NPC.Center).ToRotation() + offset; - maxSpeed *= (float)Math.PI / 180f; - var dif = MathF.Atan2(MathF.Sin(goal2 - VelocityRotation), MathF.Cos(goal2 - VelocityRotation)); - if (dif < 0) - { - if (-dif > maxSpeed) - VelocityRotation -= maxSpeed; - else - VelocityRotation += dif; - } - else - { - if (dif > maxSpeed) - VelocityRotation += maxSpeed; - else - VelocityRotation += dif; - } - } #endregion public void SwitchAttackState(AttackState State, float Substate = 0, bool resetVector = true) @@ -227,10 +208,9 @@ namespace CalamityMod.NPCs.Deconstructors MainTimer++; UpdateSegments(); } - public List> FindOreVeins() + public static List> FindOreVeins(Point wormTile) { List> oreVeins = new(); - var wormTile = NPC.Center.ToTileCoordinates(); HashSet visited = new(); for (int x = -30; x <= 30; x++) @@ -355,7 +335,7 @@ namespace CalamityMod.NPCs.Deconstructors { if (Main.rand.NextBool()) { - var veins = FindOreVeins(); + var veins = FindOreVeins(NPC.Center.ToTileCoordinates()); while (veins.Count > 0) { var targetVein = veins[Main.rand.Next(veins.Count)]; @@ -533,6 +513,7 @@ namespace CalamityMod.NPCs.Deconstructors { npcLoot.Add(ModContent.ItemType(), 1, 4, 8); npcLoot.Add(ModContent.ItemType(), 1, 4, 8); + npcLoot.Add(ModContent.ItemType(), 10); npcLoot.Add(ItemID.CopperOre, 2, 6, 32); npcLoot.Add(ItemID.TinOre, 2, 6, 32); npcLoot.Add(ItemID.IronOre, 2, 6, 32); diff --git a/NPCs/DesertScourge/DesertNuisanceHead.cs b/NPCs/DesertScourge/DesertNuisanceHead.cs index 71acc1e9b1..3eb9cecc4b 100644 --- a/NPCs/DesertScourge/DesertNuisanceHead.cs +++ b/NPCs/DesertScourge/DesertNuisanceHead.cs @@ -3,8 +3,10 @@ using System.IO; using CalamityMod.Events; using CalamityMod.World; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; +using Terraria.GameContent; using Terraria.GameContent.Bestiary; using Terraria.ID; using Terraria.ModLoader; @@ -36,14 +38,13 @@ namespace CalamityMod.NPCs.DesertScourge NPCID.Sets.BossBestiaryPriority.Add(Type); NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() { - Scale = 0.6f, - PortraitScale = 0.6f, - CustomTexturePath = "CalamityMod/ExtraTextures/Bestiary/DesertNuisance_Bestiary", - PortraitPositionXOverride = 40, - PortraitPositionYOverride = 40 + Scale = 0.65f, + PortraitScale = 0.7f, + PortraitPositionXOverride = 0, + PortraitPositionYOverride = 0 }; - value.Position.X += 45; - value.Position.Y += 30; + value.Position.X += 0; + value.Position.Y -= 20; NPCID.Sets.NPCBestiaryDrawOffset[Type] = value; NPCID.Sets.MPAllowedEnemies[Type] = true; NPCID.Sets.CantTakeLunchMoney[Type] = true; @@ -574,6 +575,40 @@ namespace CalamityMod.NPCs.DesertScourge } } + public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) + { + if (NPC.IsABestiaryIconDummy) + { + Texture2D texture = TextureAssets.Npc[NPC.type].Value; + NPC.Opacity = 1f; + // Reimplementation of CalamityUtils.DrawAnimatedBestiaryWorm but tweaked due to this entity' animations + NPC.frame = texture.Frame(); + // Buffers the segment position and rotations + float offset = -0.2f; + float startX = 60; + float startY = 70; + int segmentSpacing = 50; + int animationSpeed = 8; + float wormTimer = NPC.Calamity().bestiaryWormTimer; + int segCount = 3; + // Draw the body segments + for (int i = segCount; i > 0; i--) + { + // The first segment is slightly closer to keep up with the head + float bodyOffset = i * segmentSpacing - segmentSpacing * 0.5f; + + Texture2D toUse = i == 1 ? TextureAssets.Npc[ModContent.NPCType()].Value : DesertNuisanceBody.BodyTexture2.Value; + int frameCount = i == 1 ? 7 : 1; + spriteBatch.Draw(toUse, NPC.position + new Vector2(startX + bodyOffset, MathF.Sin((wormTimer + offset * i) * animationSpeed) * 2 + startY), toUse.Frame(1, frameCount, 0, 0), NPC.GetAlpha(drawColor), NPC.rotation - MathHelper.PiOver2 - MathF.Cos((wormTimer + offset * i) * animationSpeed) * MathHelper.PiOver4 * 0.075f, new Vector2(toUse.Width / 2, toUse.Height / (frameCount * 2)), NPC.scale, SpriteEffects.None, 0f); + } + // Draw the head + spriteBatch.Draw(texture, NPC.position + new Vector2(startX + 18, MathF.Sin(wormTimer * animationSpeed) * 2 + startY), texture.Frame(1, 7, 0, 0), NPC.GetAlpha(drawColor), NPC.rotation - MathHelper.PiOver2 - MathF.Cos(wormTimer * animationSpeed) * MathHelper.PiOver4 * 0.075f, new Vector2(texture.Width * 0.5f, texture.Height / 7), NPC.scale, SpriteEffects.None, 0f); + + return false; + } + return true; + } + public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.7f * balance); diff --git a/NPCs/DesertScourge/DesertScourgeHead.cs b/NPCs/DesertScourge/DesertScourgeHead.cs index d7f1499c1f..ae7a2ac6fb 100644 --- a/NPCs/DesertScourge/DesertScourgeHead.cs +++ b/NPCs/DesertScourge/DesertScourgeHead.cs @@ -16,12 +16,14 @@ using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Items.Weapons.Summon; using CalamityMod.NPCs.AquaticScourge; +using CalamityMod.NPCs.ExoMechs.Thanatos; using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; +using Terraria.GameContent; using Terraria.GameContent.Bestiary; using Terraria.GameContent.ItemDropRules; using Terraria.ID; @@ -72,12 +74,11 @@ namespace CalamityMod.NPCs.DesertScourge { Scale = 0.65f, PortraitScale = 0.7f, - CustomTexturePath = "CalamityMod/ExtraTextures/Bestiary/DesertScourge_Bestiary", - PortraitPositionXOverride = 40, - PortraitPositionYOverride = 40 + PortraitPositionXOverride = 0, + PortraitPositionYOverride = 0 }; - value.Position.X += 65; - value.Position.Y += 35; + value.Position.X += 20; + value.Position.Y -= 15; NPCID.Sets.NPCBestiaryDrawOffset[Type] = value; NPCID.Sets.MPAllowedEnemies[Type] = true; } @@ -1033,8 +1034,34 @@ namespace CalamityMod.NPCs.DesertScourge public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { if (NPC.IsABestiaryIconDummy) + { + Texture2D texture = TextureAssets.Npc[NPC.type].Value; NPC.Opacity = 1f; + // Reimplementation of CalamityUtils.DrawAnimatedBestiaryWorm but tweaked due to this entity' animations + NPC.frame = texture.Frame(); + // Buffers the segment position and rotations + float offset = -0.2f; + float startX = 60; + float startY = 70; + int segmentSpacing = 50; + int animationSpeed = 4; + float wormTimer = NPC.Calamity().bestiaryWormTimer; + int segCount = 3; + // Draw the body segments + for (int i = segCount; i > 0; i--) + { + // The first segment is slightly closer to keep up with the head + float bodyOffset = i * segmentSpacing - segmentSpacing * 0.5f; + Texture2D toUse = i == 1 ? TextureAssets.Npc[ModContent.NPCType()].Value : DesertScourgeBody.BodyTexture2.Value; + int frameCount = i == 1 ? 7 : 1; + spriteBatch.Draw(toUse, NPC.position + new Vector2(startX + bodyOffset, MathF.Sin((wormTimer + offset * i) * animationSpeed) * 2 + startY), toUse.Frame(1, frameCount, 0, 0), NPC.GetAlpha(drawColor), NPC.rotation - MathHelper.PiOver2 - MathF.Cos((wormTimer + offset * i) * animationSpeed) * MathHelper.PiOver4 * 0.075f, new Vector2(toUse.Width / 2, toUse.Height / (frameCount * 2)), NPC.scale, SpriteEffects.None, 0f); + } + // Draw the head + spriteBatch.Draw(texture, NPC.position + new Vector2(startX + 18, MathF.Sin(wormTimer * animationSpeed) * 2 + startY), texture.Frame(1, 7, 0, 0), NPC.GetAlpha(drawColor), NPC.rotation - MathHelper.PiOver2 - MathF.Cos(wormTimer * animationSpeed) * MathHelper.PiOver4 * 0.075f, new Vector2(texture.Width * 0.5f, texture.Height / 7), NPC.scale, SpriteEffects.None, 0f); + + return false; + } return true; } diff --git a/NPCs/NormalNPCs/MantisShrimp.cs b/NPCs/NormalNPCs/MantisShrimp.cs index 6d8f03f37b..5a5b41e7b8 100644 --- a/NPCs/NormalNPCs/MantisShrimp.cs +++ b/NPCs/NormalNPCs/MantisShrimp.cs @@ -103,7 +103,7 @@ namespace CalamityMod.NPCs.NormalNPCs // Ouch, don't get hit twice in a row :) if (hurtInfo.Damage > 0) - target.AddBuff(BuffID.BrokenArmor, 300, true); + target.AddBuff(BuffID.BrokenArmor, 600, true); } public override void FindFrame(int frameHeight) diff --git a/NPCs/NormalNPCs/Shroomble.cs b/NPCs/NormalNPCs/Shroomble.cs index def5849bf4..2b1abdee1b 100644 --- a/NPCs/NormalNPCs/Shroomble.cs +++ b/NPCs/NormalNPCs/Shroomble.cs @@ -105,7 +105,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (spawnInfo.Player.Calamity().ZoneSulphur || spawnInfo.Player.Calamity().ZoneSunkenSea) + if (!spawnInfo.Player.ZonePurity) { return 0f; } @@ -153,7 +153,7 @@ namespace CalamityMod.NPCs.NormalNPCs } } - public override void ModifyNPCLoot(NPCLoot npcLoot) => npcLoot.Add(ItemID.Mushroom, 1, 1, 4); + public override void ModifyNPCLoot(NPCLoot npcLoot) => npcLoot.Add(ItemID.Mushroom); public override void HitEffect(NPC.HitInfo hit) { diff --git a/NPCs/SunkenSea/GhostBell.cs b/NPCs/SunkenSea/GhostBell.cs index e8cf3a5ec0..0b69067b9f 100644 --- a/NPCs/SunkenSea/GhostBell.cs +++ b/NPCs/SunkenSea/GhostBell.cs @@ -190,7 +190,7 @@ namespace CalamityMod.NPCs.SunkenSea public override void ModifyNPCLoot(NPCLoot npcLoot) { - npcLoot.Add(ItemID.JellyfishNecklace, 25); + npcLoot.Add(ItemID.JellyfishNecklace, 30); LeadingConditionRule postDS = npcLoot.DefineConditionalDropSet(DropHelper.PostDS()); postDS.Add(ModContent.ItemType(), 5); } diff --git a/NPCs/TownNPCs/Bandit.cs b/NPCs/TownNPCs/Bandit.cs index 2c83ed448c..8f4766b4cc 100644 --- a/NPCs/TownNPCs/Bandit.cs +++ b/NPCs/TownNPCs/Bandit.cs @@ -120,6 +120,7 @@ namespace CalamityMod.NPCs.TownNPCs "Ishmael", // <@!840416568000381046> (vanillaoyster) "Ariallis", // <@!518231218806980609> (ariallis) "Shade", // <@!613133259563466755> (shade__storm) + "Orion", // <@!119164557657636865> (canacx) // Original names this.GetLocalizedValue("Name.Laura"), diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs index 146798a36a..e5ffa7b8ab 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs @@ -508,57 +508,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses return false; } - public override void FindFrame(Mod mod, int frameHeight) - { - // Used to force the head to look to the sides for the laser spread attack - if (NPC.ai[0] == 2f || NPC.ai[0] == 3f) - { - if (NPC.localAI[1] == 1f) - NPC.frame.Y = frameHeight * 2; - else - NPC.frame.Y = frameHeight * 4; - } - } - - public override bool PreDraw(Mod mod, SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) - { - // Draw the head as usual. - Texture2D golemHeadTexture = TextureAssets.Npc[NPC.type].Value; - Vector2 headDrawPosition = NPC.Center - screenPos; - spriteBatch.Draw(golemHeadTexture, headDrawPosition, NPC.frame, NPC.GetAlpha(drawColor), 0f, NPC.frame.Size() * 0.5f, NPC.scale, SpriteEffects.None, 0f); - - // Draw the eyes. The way vanilla handles this is hardcoded bullshit that cannot handle different hitboxes and thus requires rewriting. - Color eyeColor = new Color(Main.mouseTextColor, Main.mouseTextColor, Main.mouseTextColor, 0); - Vector2 eyesDrawPosition = headDrawPosition - NPC.scale * new Vector2(1f, 12f); - Rectangle eyesFrame = new Rectangle(0, 0, TextureAssets.Golem[1].Value.Width, TextureAssets.Golem[1].Value.Height / 2); - spriteBatch.Draw(TextureAssets.Golem[1].Value, eyesDrawPosition, eyesFrame, eyeColor, 0f, eyesFrame.Size() * 0.5f, NPC.scale, SpriteEffects.None, 0f); - - // Draw the glowmasks. - int frameCounter = (int)NPC.frameCounter / 4; - Rectangle frame = TextureAssets.Extra[ExtrasID.GolemLights4].Value.Frame(1, 8); - frame.Y += frame.Height * 2 * frameCounter + NPC.frame.Y; - Rectangle glowFrame = frame; - spriteBatch.Draw(TextureAssets.Extra[ExtrasID.GolemLights4].Value, eyesDrawPosition, glowFrame, eyeColor, 0f, glowFrame.Size() * 0.5f, NPC.scale, SpriteEffects.None, 0f); - frame = NPC.frame; - Rectangle glowFrame2 = frame; - spriteBatch.Draw(TextureAssets.Extra[ExtrasID.GolemLights5].Value, eyesDrawPosition, glowFrame2, eyeColor, 0f, glowFrame2.Size() * 0.5f, NPC.scale, SpriteEffects.None, 0f); - - // Draw the sparkle telegraphs for the laser spread attack if applicable. - if (NPC.ai[0] == 3f && NPC.ai[1] <= 60f) - { - spriteBatch.SetBlendState(BlendState.Additive); - for (int i = -1; i <= 1; i += 2) - { - Texture2D sparkle = ModContent.Request("CalamityMod/Particles/Sparkle2").Value; - Vector2 sparkleDraw = headDrawPosition + new Vector2(14f * i, -15f) * NPC.scale; - var drawFade = Color.Yellow * Utils.GetLerpValue(0, 30, 60f - NPC.ai[1], true); - spriteBatch.Draw(sparkle, sparkleDraw, null, drawFade, MathHelper.Pi * 0.02f * NPC.ai[1] * i, sparkle.Size() / 2f, 1.25f * NPC.scale, SpriteEffects.None, 0f); - } - spriteBatch.SetBlendState(BlendState.AlphaBlend); - } - return false; - } - public class FistAI : VanillaAIOverride { public override bool AI(Mod mod) @@ -1152,6 +1101,18 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses return false; } + + public override void FindFrame(Mod mod, int frameHeight) + { + // Used to force the head to look to the sides for the laser spread attack + if (NPC.ai[0] == 2f || NPC.ai[0] == 3f) + { + if (NPC.localAI[1] == 1f) + NPC.frame.Y = frameHeight * 2; + else + NPC.frame.Y = frameHeight * 4; + } + } } public class HeadFreeAI : VanillaAIOverride @@ -1428,6 +1389,45 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses return false; } + + public override bool PreDraw(Mod mod, SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) + { + // Draw the head as usual. + Texture2D golemHeadTexture = TextureAssets.Npc[NPC.type].Value; + Vector2 headDrawPosition = NPC.Center - screenPos; + spriteBatch.Draw(golemHeadTexture, headDrawPosition, NPC.frame, NPC.GetAlpha(drawColor), 0f, NPC.frame.Size() * 0.5f, NPC.scale, SpriteEffects.None, 0f); + + // Draw the eyes. The way vanilla handles this is hardcoded bullshit that cannot handle different hitboxes and thus requires rewriting. + Color eyeColor = new Color(Main.mouseTextColor, Main.mouseTextColor, Main.mouseTextColor, 0); + Vector2 eyesDrawPosition = headDrawPosition - NPC.scale * new Vector2(1f, 12f); + Rectangle eyesFrame = new Rectangle(0, 0, TextureAssets.Golem[1].Value.Width, TextureAssets.Golem[1].Value.Height / 2); + spriteBatch.Draw(TextureAssets.Golem[1].Value, eyesDrawPosition, eyesFrame, eyeColor, 0f, eyesFrame.Size() * 0.5f, NPC.scale, SpriteEffects.None, 0f); + + // Draw the glowmasks. + int frameCounter = (int)NPC.frameCounter / 4; + Rectangle frame = TextureAssets.Extra[ExtrasID.GolemLights4].Value.Frame(1, 8); + frame.Y += frame.Height * 2 * frameCounter + NPC.frame.Y; + Rectangle glowFrame = frame; + spriteBatch.Draw(TextureAssets.Extra[ExtrasID.GolemLights4].Value, eyesDrawPosition, glowFrame, eyeColor, 0f, glowFrame.Size() * 0.5f, NPC.scale, SpriteEffects.None, 0f); + frame = NPC.frame; + Rectangle glowFrame2 = frame; + spriteBatch.Draw(TextureAssets.Extra[ExtrasID.GolemLights5].Value, eyesDrawPosition, glowFrame2, eyeColor, 0f, glowFrame2.Size() * 0.5f, NPC.scale, SpriteEffects.None, 0f); + + // Draw the sparkle telegraphs for the laser spread attack if applicable. + if (NPC.ai[0] == 3f && NPC.ai[1] <= 60f) + { + spriteBatch.SetBlendState(BlendState.Additive); + for (int i = -1; i <= 1; i += 2) + { + Texture2D sparkle = ModContent.Request("CalamityMod/Particles/Sparkle2").Value; + Vector2 sparkleDraw = headDrawPosition + new Vector2(14f * i, -15f) * NPC.scale; + var drawFade = Color.Yellow * Utils.GetLerpValue(0, 30, 60f - NPC.ai[1], true); + spriteBatch.Draw(sparkle, sparkleDraw, null, drawFade, MathHelper.Pi * 0.02f * NPC.ai[1] * i, sparkle.Size() / 2f, 1.25f * NPC.scale, SpriteEffects.None, 0f); + } + spriteBatch.SetBlendState(BlendState.AlphaBlend); + } + return false; + } } } } diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs index 9a3b183b73..f30880b7a5 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs @@ -100,9 +100,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float finalPhaseLifeRatio = death ? 0.4f : 0.25f; // Movement variables - float phase1MaxSpeedIncrease = death ? 2f : 4f; - float phase1MaxAccelerationIncrease = death ? 0.025f : 0.05f; - float phase1MaxChargeSpeedIncrease = death ? 3f : 6f; + float phase1MaxSpeedIncrease = 1f; + float phase1MaxChargeSpeedIncrease = 1.5f; // Phase duration variables float phase1MaxLaserPhaseDurationDecrease = death ? 120f : 300f; @@ -140,13 +139,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { if (NPC.ai[1] == 0f) { - float maxVelocity = (death ? 9.45f : 8.25f); - float acceleration = (death ? 0.13f : 0.115f); + float maxVelocity = death ? 9.25f : 8.25f; + float acceleration = death ? 0.13f : 0.115f; if (death) { - maxVelocity += phase1MaxSpeedIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)) / 2; - acceleration += phase1MaxAccelerationIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)) / 2; + maxVelocity += phase1MaxSpeedIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)); } if (Main.getGoodWorld) @@ -213,7 +211,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { - float laserSpeed = death ? 11.4f : 10.5f; + float laserSpeed = death ? 11.25f : 10.5f; int type = ProjectileID.EyeLaser; int damage = LaserDamage.CalculateMechDamage(); @@ -228,9 +226,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { NPC.rotation = hoverRotation; - float chargeSpeed = death ? 18f : 15f; + float chargeSpeed = death ? 17.5f : 15f; if (death) - chargeSpeed += phase1MaxChargeSpeedIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)) / 2; + chargeSpeed += phase1MaxChargeSpeedIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)); if (Main.getGoodWorld) chargeSpeed += 2f; @@ -241,7 +239,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else if (NPC.ai[1] == 2f) { NPC.ai[2] += 1f; - float decelerateGateValue = (death ? 36f : 32f) + (death ? 6f * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 0f); + float decelerateGateValue = (death ? 36f : 32f) + (death ? 4f * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 0f); if (NPC.ai[2] >= decelerateGateValue) { float decelerationMultiplier = (death ? 0.84f : 0.92f) - (death ? 0.16f * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 0f); @@ -255,7 +253,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else NPC.rotation = NPC.velocity.ToRotation() - MathHelper.PiOver2; - float delayBeforeChargingAgain = (death ? 48f : 56f) - (death ? 1.5f * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 0f); + float delayBeforeChargingAgain = death ? 48f : 56f; if (NPC.ai[2] >= delayBeforeChargingAgain) { NPC.ai[3] += 1f; @@ -391,8 +389,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (NPC.ai[1] == 0f) { - float maxVelocity = death ? 10.85f + 1.75f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 9.5f; - float acceleration = death ? 0.1975f + 0.025f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0.175f; + float maxVelocity = death ? 10.65f + (1.5f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio)) : 9.5f; + float acceleration = death ? 0.1975f : 0.175f; if (Main.getGoodWorld) { @@ -461,8 +459,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { if (NPC.ai[1] == 1f) { - float maxVelocity = death ? 10.85f + 1.75f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 9.5f; - float acceleration = death ? 0.295f + 0.075f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0.25f; + float maxVelocity = death ? 10.65f + (1.5f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio)) : 9.5f; + float acceleration = death ? 0.295f : 0.25f; if (Main.getGoodWorld) { @@ -518,7 +516,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Set rotation and velocity NPC.rotation = hoverRotation; - float chargeSpeed = (death ? 25f : 22f) + (death ? 3.25f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); + float chargeSpeed = (death ? 25f : 22f) + (death ? 3f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); if (!spazAlive) chargeSpeed += 2f; if (Main.getGoodWorld) @@ -562,7 +560,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses SoundEngine.PlaySound(SoundID.Item33, NPC.Center); if (Main.netMode != NetmodeID.MultiplayerClient) { - float laserDartSpeed = (death ? 7.5f : 6f) * (spazAlive ? 1f : 1.5f); + float laserDartSpeed = (death ? 7.25f : 6f) * (spazAlive ? 1f : 1.5f); int type = ModContent.ProjectileType(); int damage = HomingDartDamage.CalculateMechDamage(); @@ -622,8 +620,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else if (NPC.ai[1] == 4f) { float chargeLineUpDistance = spazAlive ? 600f : 500f; - float chargeSpeed = (death ? 19.8f : 18f) + (death ? 2.5f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); - float chargeAcceleration = (death ? 0.495f : 0.45f) + (death ? 0.1f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); + float chargeSpeed = (death ? 20f : 18f) + (death ? 1.5f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); + float chargeAcceleration = death ? 0.495f : 0.45f; if (spazAlive) { @@ -724,13 +722,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float finalPhaseLifeRatio = death ? 0.4f : 0.25f; // Movement variables - float phase1MaxSpeedIncrease = death ? 2.25f : 4.5f; - float phase1MaxAccelerationIncrease = death ? 0.075f : 0.15f; - float phase1MaxChargeSpeedIncrease = death ? 3f : 6f; + float phase1MaxSpeedIncrease = 1.125f; + float phase1MaxChargeSpeedIncrease = 1.4f; // Phase duration variables float phase1MaxCursedFlamePhaseDurationDecrease = death ? 80f : 200f; - float phase1MaxChargesDecrease = death ? 2f : 4f; + float phase1MaxChargesDecrease = 2f; // Phase checks bool phase2 = lifeRatio < phase2LifeRatio; @@ -768,13 +765,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (NPC.ai[1] == 0f) { // Velocity - float maxVelocity = death ? 13.8f : 12f; + float maxVelocity = death ? 13.5f : 12f; float acceleration = death ? 0.46f : 0.4f; if (death) { - maxVelocity += phase1MaxSpeedIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)) / 2; - acceleration += phase1MaxAccelerationIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)) / 2; + maxVelocity += phase1MaxSpeedIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)); } if (Main.getGoodWorld) @@ -848,7 +844,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Rotation and velocity NPC.rotation = hoverRotation; - float chargeSpeed = death ? 20.4f + phase1MaxChargeSpeedIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 18f; + float chargeSpeed = death ? 19.25f + (phase1MaxChargeSpeedIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio))) : 18f; if (Main.getGoodWorld) chargeSpeed *= 1.2f; @@ -860,7 +856,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { NPC.ai[2] += 1f; - float timeBeforeSlowDown = death ? 18f : 10f; + float timeBeforeSlowDown = death ? 14f : 10f; if (NPC.ai[2] >= timeBeforeSlowDown) { // Slow down @@ -1019,8 +1015,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Shadowflamethrower phase if (NPC.ai[1] == 0f) { - float maxVelocity = 7.1f + (death ? 0.8f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); - float acceleration = 0.118f + (death ? 0.02f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); + float maxVelocity = 7.1f + (death ? 0.7f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); + float acceleration = 0.118f + (death ? 0.0175f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); float distanceFromTarget = 180f; Vector2 destination = Main.player[NPC.target].Center + Vector2.UnitX * distanceFromTarget * direction; @@ -1121,7 +1117,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Set rotation and velocity NPC.rotation = hoverRotation; - float chargeSpeed = (death ? 22.8f : 18f) + (death ? 1.5f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); + float chargeSpeed = death ? 19.25f + (phase1MaxChargeSpeedIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio))) : 18f; if (Main.getGoodWorld) chargeSpeed *= 1.2f; @@ -1193,7 +1189,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else if (Main.netMode != NetmodeID.MultiplayerClient) { // Velocity - float spazmatismPhase3ChargeSpeed = (death ? 23f : 20f) + (death ? 3f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); + float spazmatismPhase3ChargeSpeed = (death ? 22.5f : 20f) + (death ? 3f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); if (NPC.ai[2] == -1f || (!retAlive && NPC.ai[3] == secondFastCharge)) spazmatismPhase3ChargeSpeed *= 1.3f; if (Main.getGoodWorld) diff --git a/Projectiles/BaseProjectiles/BaseWormProjectile.cs b/Projectiles/BaseProjectiles/BaseWormProjectile.cs index cbf0e5e291..b7c1765bb6 100644 --- a/Projectiles/BaseProjectiles/BaseWormProjectile.cs +++ b/Projectiles/BaseProjectiles/BaseWormProjectile.cs @@ -38,6 +38,12 @@ namespace CalamityMod.Projectiles.BaseProjectiles /// public List SegmentTypeDrawOffsets = new List(); + /// + /// A list of all glow textures for the segments to draw with + /// DOES include the head + /// + public virtual List GlowTextures { get; } + /// /// How far through the current animation this worm is /// @@ -73,6 +79,29 @@ namespace CalamityMod.Projectiles.BaseProjectiles /// Use SegmentTextureAssets to get the data stored here. /// private List> internalTexAssets = new List>(); + /// + /// The textures for each glow type of this worm. Works like getting a texture from TextureAssets + /// + public List> GlowTextureAssets + { + get + { + if (internalGlowAssets.Count == 0) + for (var i = 0; i < GlowTextures.Count; i++) + { + if (GlowTextures[i] is not null) + internalGlowAssets.Add(ModContent.Request(GlowTextures[i])); + else internalGlowAssets.Add(ModContent.Request("CalamityMod/Projectiles/InvisibleProj")); + } + return internalGlowAssets; + } + } + + /// + /// Internal list that stores the glow textureassets. + /// Use SegmentTextureAssets to get the data stored here. + /// + private List> internalGlowAssets = new List>(); public List Segments = new(); @@ -93,6 +122,11 @@ namespace CalamityMod.Projectiles.BaseProjectiles /// public float SegmentRigidity = 0.2f; + /// + /// The max rotational offset from the direction of the previous segment + /// + public float SegmentMaxRotation = MathHelper.TwoPi; + /// /// The points used by ExactSegmentLogic to exactly follow the head /// @@ -158,7 +192,9 @@ namespace CalamityMod.Projectiles.BaseProjectiles nexSegDir = nexSegDir.MoveTowards((aheadSeg.rotation - thisSeg.rotation).ToRotationVector2(), 1f); } thisSeg.rotation = nexSegDir.ToRotation() + MathHelper.PiOver2; - thisSeg.Center = aheadSeg.Center - nexSegDir.SafeNormalize(Vector2.Zero) * segmentDistance; + float angledif = MathHelper.WrapAngle(thisSeg.rotation - aheadSeg.rotation); + thisSeg.rotation = thisSeg.rotation.AngleLerp(aheadSeg.rotation + MathHelper.Clamp(angledif, -SegmentMaxRotation * 0.5f, SegmentMaxRotation * 0.5f), 0.25f); + thisSeg.Center = aheadSeg.Center - (thisSeg.rotation - MathHelper.PiOver2).ToRotationVector2() * segmentDistance; } } @@ -243,6 +279,9 @@ namespace CalamityMod.Projectiles.BaseProjectiles DrawSegment(ref lightColor, Segments[i]); } Main.spriteBatch.Draw(TextureAssets.Projectile[Type].Value, Projectile.Center - Main.screenPosition, null, lightColor * Projectile.Opacity, Projectile.rotation, TextureAssets.Projectile[Type].Value.Size() / 2, Projectile.scale, SpriteEffects.None, 1); + + if (GlowTextures.Count > 0 && GlowTextures[0] is not null) + Main.spriteBatch.Draw(GlowTextureAssets[0].Value, Projectile.Center - Main.screenPosition, null, Color.White * Projectile.Opacity, Projectile.rotation, GlowTextureAssets[0].Size() / 2, Projectile.scale, SpriteEffects.None, 1); return false; } @@ -255,6 +294,12 @@ namespace CalamityMod.Projectiles.BaseProjectiles } var tex = SegmentTextureAssets[segment.segmentType].Value; Main.spriteBatch.Draw(tex, segment.Center - Main.screenPosition, null, color *segment.Opacity, segment.rotation, tex.Size() / 2 + (SegmentTypeDrawOffsets[segment.segmentType]), Projectile.scale, SpriteEffects.None, 1); + if (GlowTextures is null || !GlowTextures.IndexInRange(segment.segmentType + 1) || GlowTextures[segment.segmentType + 1] is null) + { + return; + } + tex = GlowTextureAssets[segment.segmentType + 1].Value; + Main.spriteBatch.Draw(tex, segment.Center - Main.screenPosition, null, Color.White * segment.Opacity, segment.rotation, tex.Size() / 2 + (SegmentTypeDrawOffsets[segment.segmentType]), Projectile.scale, SpriteEffects.None, 1); } #endregion diff --git a/Projectiles/Boss/GolemInfernoBlast.cs b/Projectiles/Boss/GolemInfernoBlast.cs index 24c308ac5b..cdced38b80 100644 --- a/Projectiles/Boss/GolemInfernoBlast.cs +++ b/Projectiles/Boss/GolemInfernoBlast.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.timeLeft % 3 == 0) { - FlameExplosion blast = new(Projectile.Center, Vector2.Zero, Color.Orange, Vector2.One, Main.rand.NextFloat(MathHelper.TwoPi), 0.1f, 0.17f, 15, 0.7f); + FlameExplosion blast = new(Projectile.Center, Vector2.Zero, Color.Orange, Vector2.One, Main.rand.NextFloat(MathHelper.TwoPi), 0.1f, 0.25f, 15, 0.7f); GeneralParticleHandler.SpawnParticle(blast); } diff --git a/Projectiles/Magic/DracoConstellation.cs b/Projectiles/Magic/DracoConstellation.cs index c71ee5fa60..90e20daa46 100644 --- a/Projectiles/Magic/DracoConstellation.cs +++ b/Projectiles/Magic/DracoConstellation.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Utilities.Daybreak; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; @@ -206,41 +207,46 @@ namespace CalamityMod.Projectiles.Magic } public override bool PreDraw(ref Color lightColor) { - var tex = TextureAssets.Projectile[Type].Value; - var connectioncolor = Color.SkyBlue * ((MathF.Sin(Main.GlobalTimeWrappedHourly) + 1) * 0.125f + 0.75f); - for (var i = 0; i < Segments.Count; i++) + using (Main.spriteBatch.Scope()) { - if (i == 0) + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive,SamplerState.PointClamp,DepthStencilState.None,Main.Rasterizer,null,Main.Transform); + var tex = TextureAssets.Projectile[Type].Value; + var connectioncolor = Color.SkyBlue * ((MathF.Sin(Main.GlobalTimeWrappedHourly) + 1) * 0.125f + 0.75f); + for (var i = 0; i < Segments.Count; i++) { - CalamityUtils.DrawLineBetter(Main.spriteBatch, Projectile.Center, Segments[i].Center, connectioncolor, 2 * Projectile.scale); + if (i == 0) + { + CalamityUtils.DrawLineBetter(Main.spriteBatch, Projectile.Center, Segments[i].Center, connectioncolor, 2 * Projectile.scale); + } + if (Segments.IndexInRange(i + 1)) + { + var nextSegment = Segments[i + 1]; + CalamityUtils.DrawLineBetter(Main.spriteBatch, Segments[i].Center, nextSegment.Center, connectioncolor, 2 * Projectile.scale); + } + Main.spriteBatch.Draw(GetGlowTex(), Segments[i].Center - Main.screenPosition, null, Color.SkyBlue, 0, GetGlowTex().Size() * 0.5f, 0.2f * Projectile.scale, SpriteEffects.None, 0); + + Main.spriteBatch.Draw(tex, Segments[i].Center - Main.screenPosition, null, Color.White, 0 * Segments[i].followDistance * 5f * Main.GlobalTimeWrappedHourly, tex.Size() * 0.5f, 0.75f * Projectile.scale, SpriteEffects.None, 0); } - if (Segments.IndexInRange(i + 1)) + void DrawHeadStar(Vector2 offsetPercentage) { - var nextSegment = Segments[i + 1]; - CalamityUtils.DrawLineBetter(Main.spriteBatch, Segments[i].Center, nextSegment.Center, connectioncolor, 2 * Projectile.scale); + Main.spriteBatch.Draw(GetGlowTex(), Projectile.Center + offsetPercentage.RotatedBy(Projectile.rotation - MathHelper.PiOver2) * TailLength - Main.screenPosition, null, Color.SkyBlue, 0, GetGlowTex().Size() * 0.5f, 0.2f * Projectile.scale, SpriteEffects.None, 0); + Main.spriteBatch.Draw(tex, Projectile.Center + offsetPercentage.RotatedBy(Projectile.rotation - MathHelper.PiOver2) * TailLength - Main.screenPosition, null, Color.White, 0 * Math.Abs(offsetPercentage.X) * 5f * Main.GlobalTimeWrappedHourly, tex.Size() * 0.5f, 0.75f * Projectile.scale, SpriteEffects.None, 0); } - Main.spriteBatch.Draw(GetGlowTex(), Segments[i].Center - Main.screenPosition, null, Color.SkyBlue, 0, GetGlowTex().Size() * 0.5f, 0.2f * Projectile.scale, SpriteEffects.None, 0); + void connectOffsets(Vector2 offset1, Vector2 offset2) + { + CalamityUtils.DrawLineBetter(Main.spriteBatch, Projectile.Center + offset1.RotatedBy(Projectile.rotation - MathHelper.PiOver2) * TailLength, Projectile.Center + offset2.RotatedBy(Projectile.rotation - MathHelper.PiOver2) * TailLength, connectioncolor, 2 * Projectile.scale); - Main.spriteBatch.Draw(tex, Segments[i].Center - Main.screenPosition, null, Color.White, 0 * Segments[i].followDistance * 5f * Main.GlobalTimeWrappedHourly, tex.Size() * 0.5f, 0.75f * Projectile.scale, SpriteEffects.None, 0); + } + connectOffsets(new(), new(-0.0425f, 0.0637f)); + connectOffsets(new(), new(0.0307f, 0.0418f)); + connectOffsets(new(-0.0425f, 0.0637f), new(0.0168f, 0.0791f)); + connectOffsets(new(0.0307f, 0.0418f), new(0.0168f, 0.0791f)); + DrawHeadStar(new()); + DrawHeadStar(new(-0.0425f, 0.0637f)); + DrawHeadStar(new(0.0307f, 0.0418f)); + DrawHeadStar(new(0.0168f, 0.0791f)); + Main.spriteBatch.End(); } - void DrawHeadStar(Vector2 offsetPercentage) - { - Main.spriteBatch.Draw(GetGlowTex(), Projectile.Center + offsetPercentage.RotatedBy(Projectile.rotation - MathHelper.PiOver2) * TailLength - Main.screenPosition, null, Color.SkyBlue, 0, GetGlowTex().Size() * 0.5f, 0.2f * Projectile.scale, SpriteEffects.None, 0); - Main.spriteBatch.Draw(tex, Projectile.Center + offsetPercentage.RotatedBy(Projectile.rotation - MathHelper.PiOver2) * TailLength - Main.screenPosition, null, Color.White, 0 * Math.Abs(offsetPercentage.X) * 5f * Main.GlobalTimeWrappedHourly, tex.Size() * 0.5f, 0.75f * Projectile.scale, SpriteEffects.None, 0); - } - void connectOffsets(Vector2 offset1, Vector2 offset2) - { - CalamityUtils.DrawLineBetter(Main.spriteBatch, Projectile.Center + offset1.RotatedBy(Projectile.rotation - MathHelper.PiOver2) * TailLength, Projectile.Center + offset2.RotatedBy(Projectile.rotation - MathHelper.PiOver2) * TailLength, connectioncolor, 2 * Projectile.scale); - - } - connectOffsets(new(), new(-0.0425f, 0.0637f)); - connectOffsets(new(), new(0.0307f, 0.0418f)); - connectOffsets(new(-0.0425f, 0.0637f), new(0.0168f, 0.0791f)); - connectOffsets(new(0.0307f, 0.0418f), new(0.0168f, 0.0791f)); - DrawHeadStar(new()); - DrawHeadStar(new(-0.0425f, 0.0637f)); - DrawHeadStar(new(0.0307f, 0.0418f)); - DrawHeadStar(new(0.0168f, 0.0791f)); return false; } diff --git a/Projectiles/Magic/FlareBoltProjectile.cs b/Projectiles/Magic/FlareBoltProjectile.cs index b4580ad539..3bf2727b31 100644 --- a/Projectiles/Magic/FlareBoltProjectile.cs +++ b/Projectiles/Magic/FlareBoltProjectile.cs @@ -16,6 +16,8 @@ namespace CalamityMod.Projectiles.Magic public float fadeIn = 0; public bool launch = true; public Color bColor = Color.OrangeRed; + public int launchTime = 0; + public Vector2 endPoint; public new string LocalizationCategory => "Projectiles.Magic"; public override void SetDefaults() { @@ -23,7 +25,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.height = 16; Projectile.friendly = true; Projectile.penetrate = -1; - Projectile.timeLeft = 240; + Projectile.timeLeft = 500; Projectile.extraUpdates = 2; Projectile.tileCollide = false; Projectile.DamageType = DamageClass.Magic; @@ -37,7 +39,7 @@ namespace CalamityMod.Projectiles.Magic Vector2 mouse = Owner.Calamity().mouseWorld; fadeIn = Utils.GetLerpValue(0, Owner.itemAnimationMax * 0.5f * Projectile.MaxUpdates, time, true); float velFade = Utils.GetLerpValue(1.5f, 6.5f, Projectile.velocity.Length(), true); - Vector2 velocity = Utils.DirectionTo(Owner.Center, mouse) * Owner.HeldItem.shootSpeed; + Vector2 velocity = Utils.DirectionTo(Owner.Center, mouse) * 8f; Projectile.scale = fadeIn * 1.5f; if (fadeIn < 1) // Hold the projectile in front of the player while they case the spell { @@ -49,8 +51,9 @@ namespace CalamityMod.Projectiles.Magic { Projectile.tileCollide = true; - Vector2 staticSpeed = Utils.DirectionTo(Owner.Center, mouse) * Utils.Distance(Owner.Center, Owner.ClampedMouseWorld()) * 0.0165f; + Vector2 staticSpeed = Utils.DirectionTo(Owner.Center, mouse) * Utils.Distance(Projectile.Center, Owner.ClampedMouseWorld()) * 0.0165f; Projectile.velocity = staticSpeed; + endPoint = Owner.ClampedMouseWorld(); SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/HalleysInfernoShoot") with { Volume = 0.45f, Pitch = 0.3f }, Projectile.Center); for (int i = 0; i < 20; i++) @@ -73,7 +76,7 @@ namespace CalamityMod.Projectiles.Magic launch = false; } - if (Main.rand.NextBool(10) && velFade > 0.1f) + if (Main.rand.NextBool(8) && launchTime < 56) { Particle fx = new CustomSpark(Projectile.Center + Main.rand.NextVector2Circular(8, 8), -Projectile.velocity * 0.9f, "CalamityMod/Particles/FireTypeParticle", false, 32, 1.15f, Color.Lerp(bColor, Color.Red, 0.5f), new Vector2(0.8f, 1f), true, false); GeneralParticleHandler.SpawnParticle(fx); @@ -91,13 +94,16 @@ namespace CalamityMod.Projectiles.Magic GeneralParticleHandler.SpawnParticle(trail); } - if (Projectile.timeLeft < 120) - { - Projectile.velocity *= 0.98f; - } - Projectile.rotation += 0.3f * Projectile.direction; time++; + if (!launch) + { + Projectile.Center = Vector2.Lerp(Projectile.Center, endPoint, 0.035f); + Projectile.velocity *= 0.9f; + launchTime++; + if (launchTime >= (Owner.itemAnimationMax + 28)) + Projectile.Kill(); + } } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { diff --git a/Projectiles/Magic/FrigidflashBoltProjectile.cs b/Projectiles/Magic/FrigidflashBoltProjectile.cs index 36fd403635..19899c4f4f 100644 --- a/Projectiles/Magic/FrigidflashBoltProjectile.cs +++ b/Projectiles/Magic/FrigidflashBoltProjectile.cs @@ -1,4 +1,5 @@ using System; +using System.Net; using CalamityMod.Dusts; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Particles; @@ -23,6 +24,8 @@ namespace CalamityMod.Projectiles.Magic public Color fireColor = Color.OrangeRed; public Color iceColor = Color.DeepSkyBlue; public SlotId chargeSound; + public int launchTime = 0; + public Vector2 endPoint; public override void SetDefaults() { Projectile.width = 20; @@ -43,7 +46,7 @@ namespace CalamityMod.Projectiles.Magic Lighting.AddLight(Projectile.Center, lightColor.ToVector3()); Vector2 mouse = Owner.Calamity().mouseWorld; fadeIn = launch ? Utils.GetLerpValue(0, Owner.itemAnimationMax * 0.5f * Projectile.MaxUpdates, time, true) : 1; - Vector2 velocity = Utils.DirectionTo(Owner.Center, mouse) * Owner.HeldItem.shootSpeed; + Vector2 velocity = Utils.DirectionTo(Owner.Center, mouse) * 10; Projectile.scale = fadeIn * (bigMagic ? 1.3f : 1); if (fadeIn < 1) // Hold the projectile in front of the player while they case the spell { @@ -71,6 +74,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.tileCollide = true; Vector2 staticSpeed = Utils.DirectionTo(Owner.Center, mouse) * Utils.Distance(Owner.Center, Owner.ClampedMouseWorld()) * 0.01f; Projectile.velocity = (bigMagic ? staticSpeed : velocity); + endPoint = Owner.ClampedMouseWorld(); SoundEngine.PlaySound(FrigidflashBolt.UseSound with { Volume = 1f, Pitch = (bigMagic ? -0.15f : 0.15f) }, Projectile.Center); if (bigMagic) @@ -97,7 +101,7 @@ namespace CalamityMod.Projectiles.Magic launch = false; } - if (Main.rand.NextBool(8)) + if (Main.rand.NextBool(bigMagic ? 3 : 8) && launchTime < 56) { bool type = Main.rand.NextBool(); Particle fx = new CustomSpark(Projectile.Center + Main.rand.NextVector2Circular(12, 12), -Projectile.velocity * 0.3f, type ? "CalamityMod/Particles/FireTypeParticle" : "CalamityMod/Particles/IceTypeParticle", false, 32, 0.9f, type ? fireColor : iceColor, new Vector2(0.8f, 1f), true, false, shrinkSpeed: type ? 0.2f : 0); @@ -112,9 +116,13 @@ namespace CalamityMod.Projectiles.Magic } if (bigMagic) { - if (Projectile.timeLeft < 145) + if (!launch) { - Projectile.velocity *= 0.98f; + Projectile.Center = Vector2.Lerp(Projectile.Center, endPoint, 0.035f); + Projectile.velocity *= 0.9f; + launchTime++; + if (launchTime >= (Owner.itemAnimationMax * 2.5f + 28)) + Projectile.Kill(); } } else diff --git a/Projectiles/Magic/WingmanGrenade.cs b/Projectiles/Magic/WingmanGrenade.cs index ed92403696..16e2a6667b 100644 --- a/Projectiles/Magic/WingmanGrenade.cs +++ b/Projectiles/Magic/WingmanGrenade.cs @@ -48,8 +48,10 @@ namespace CalamityMod.Projectiles.Magic if (mainColor == Color.White) { Projectile.scale = 0.4f; + if (Projectile.ai[1] == -1) + mainColor = Color.Turquoise; if (Projectile.ai[1] == 0) - mainColor = Color.HotPink; + mainColor = Color.Orchid; if (Projectile.ai[1] == 2) { diff --git a/Projectiles/Magic/WingmanHoldout.cs b/Projectiles/Magic/WingmanHoldout.cs index 84838a0c8d..9b83bbff90 100644 --- a/Projectiles/Magic/WingmanHoldout.cs +++ b/Projectiles/Magic/WingmanHoldout.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Projectiles.Magic public override LocalizedText DisplayName => CalamityUtils.GetItemName(); public override string Texture => "CalamityMod/Items/Weapons/Magic/Wingman"; - public Color StaticEffectsColor = Color.HotPink; + public Color StaticEffectsColor = Color.Orchid; private ref float ShootingTimer => ref Projectile.ai[0]; private ref float PostFireCooldown => ref Projectile.ai[1]; public float yOffset; @@ -50,6 +50,8 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { Owner ??= Main.player[Projectile.owner]; + if (Projectile.ai[2] == 1) + StaticEffectsColor = Color.Turquoise; Lighting.AddLight(Projectile.Center, StaticEffectsColor.ToVector3() * 0.2f); @@ -192,13 +194,13 @@ namespace CalamityMod.Projectiles.Magic { SoundStyle fire = new("CalamityMod/Sounds/Item/DeadSunExplosion"); SoundEngine.PlaySound(fire with { Volume = 0.35f, Pitch = -0.4f, PitchVariance = 0.2f }, Projectile.Center); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), tipPosition, (firingVelocity * 1.3f) * Utils.GetLerpValue(60, 10, FiringTime, true), ModContent.ProjectileType(), (int)(Projectile.damage * 6), Projectile.knockBack * 5, Projectile.owner, 0); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), tipPosition, (firingVelocity * 1.3f) * Utils.GetLerpValue(60, 10, FiringTime, true), ModContent.ProjectileType(), (int)(Projectile.damage * 6), Projectile.knockBack * 5, Projectile.owner, 0, (Projectile.ai[2] == 1 ? -1 : 0)); } else { SoundStyle fire = new("CalamityMod/Sounds/Item/MagnaCannonShot"); SoundEngine.PlaySound(fire with { Volume = 0.25f, Pitch = 1f, PitchVariance = 0.35f }, Projectile.Center); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), tipPosition, firingVelocity * Utils.GetLerpValue(80, 10, FiringTime, true), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), tipPosition, firingVelocity * Utils.GetLerpValue(80, 10, FiringTime, true), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0, (Projectile.ai[2] == 1 ? -1 : 0)); } // Inside here go all the things that dedicated servers shouldn't spend resources on. diff --git a/Projectiles/Magic/WingmanShot.cs b/Projectiles/Magic/WingmanShot.cs index 51341c80ce..b33efa4379 100644 --- a/Projectiles/Magic/WingmanShot.cs +++ b/Projectiles/Magic/WingmanShot.cs @@ -36,8 +36,10 @@ namespace CalamityMod.Projectiles.Magic { if (mainColor == Color.White) { + if (Projectile.ai[1] == -1) + mainColor = Color.Turquoise; if (Projectile.ai[1] == 0) - mainColor = Color.HotPink; + mainColor = Color.Orchid; if (Projectile.ai[1] == 1) mainColor = Color.MediumSlateBlue; if (Projectile.ai[1] == 2) diff --git a/Projectiles/Pets/BurrowerPet.cs b/Projectiles/Pets/BurrowerPet.cs new file mode 100644 index 0000000000..6c75a9f13d --- /dev/null +++ b/Projectiles/Pets/BurrowerPet.cs @@ -0,0 +1,324 @@ +using System; +using System.Collections.Generic; +using CalamityMod.Effects; +using CalamityMod.NPCs; +using CalamityMod.NPCs.Deconstructors; +using CalamityMod.Particles; +using CalamityMod.Projectiles.BaseProjectiles; +using CalamityMod.Systems; +using CalamityMod.Systems.Mechanic; +using CalamityMod.Tiles.Ores; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Pets +{ + public class BurrowerPet : BaseWormProjectile, ILocalizedModType + { + public override string Texture => "CalamityMod/NPCs/Deconstructors/DeconstructorMK1Head"; + public override List SegmentTextures => new() + { + "CalamityMod/NPCs/Deconstructors/DeconstructorMK1Body", + "CalamityMod/NPCs/Deconstructors/DeconstructorMK1BodyAlt1", + "CalamityMod/NPCs/Deconstructors/DeconstructorMK1BodyAlt2", + "CalamityMod/NPCs/Deconstructors/DeconstructorMK1Tail" + }; + + public override List GlowTextures => new() + { + null, + "CalamityMod/NPCs/Deconstructors/DeconstructorMK1BodyGlow", + "CalamityMod/NPCs/Deconstructors/DeconstructorMK1BodyAlt1Glow", + "CalamityMod/NPCs/Deconstructors/DeconstructorMK1BodyAlt2Glow" + }; + public override int SegmentCount => 3; + + public override List SegmentTypePositionOffsets => new() + { + 32, + 32, + 32, + 32, + 32 + }; + public new string LocalizationCategory => "Projectiles.Pets"; + public Player Owner => Main.player[Projectile.owner]; + public override void SetStaticDefaults() + { + Main.projPet[Type] = true; + ProjectileID.Sets.LightPet[Type] = true; + base.SetStaticDefaults(); + } + + public override void SetDefaults() + { + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 1600; //100 tiles offscreen + Projectile.width = 38; + Projectile.height = 38; + Projectile.friendly = true; + Projectile.netImportant = true; + Projectile.penetrate = -1; + Projectile.tileCollide = false; + Projectile.ignoreWater = true; + for (var i = 0; i < SegmentCount - 1; i++) + { + Segments.Add(new BaseWormSegment(this, i % 3)); + } + Segments.Add(new BaseWormSegment(this, 3)); + } + + public bool VerifyOwnerIsPresent() + { + // No logic should be run if the player is no longer active in the game. + if (!Owner.active) + { + Projectile.Kill(); + return true; + } + + if (Owner.dead) + Owner.Calamity().burrowerPet = false; + if (Owner.Calamity().burrowerPet) + Projectile.timeLeft = 2; + + return false; + } + #region AI Variables + + public enum AttackState + { + Idle, + Mining, + Shocked + } + public AttackState ActiveAttackState + { + get { return (AttackState)Projectile.ai[1]; } + set { Projectile.ai[1] = (float)value; } + } + public float MainTimer + { + get { return Projectile.ai[0]; } + set { Projectile.ai[0] = value; } + } + + public float AttackSubstate + { + get { return Projectile.ai[2]; } + set { Projectile.ai[2] = value; } + } + + public float StateChangeCounter + { + get { return Projectile.ai[3]; } + set { Projectile.ai[3] = value; } + } + public float VelocityRotation + { + + get { return Projectile.velocity.ToRotation(); } + set { Projectile.velocity = value.ToRotationVector2() * Projectile.velocity.Length(); } + } + + public Vector2 TargetVector = Vector2.Zero; + public Vector2 SecondaryVector = Vector2.Zero; + public float StoredValue = 0; + #endregion + + public void SwitchAttackState(AttackState State, float Substate = 0, bool resetVector = true) + { + Projectile.netUpdate = true; + ActiveAttackState = State; + AttackSubstate = Substate; + MainTimer = 0; + if (resetVector) + TargetVector = Vector2.Zero; + } + + public override void AI() + { + if (VerifyOwnerIsPresent()) + return; + + HandleAIStates(); + MainTimer++; + UpdateSegments(); + } + private void LowerTargetToGround() + { + var pointToCheck = TargetVector.ToTileCoordinates(); + for (var i = 0; i < 50; i++) + { + if (pointToCheck.X < 0 || pointToCheck.X >= Main.maxTilesX || pointToCheck.Y < 0 || pointToCheck.Y >= Main.maxTilesY) + return; + var targetTile = Main.tile[pointToCheck]; + if (targetTile == null || !targetTile.HasTile || !targetTile.IsTileSolidGround()) + pointToCheck.Y += 1; + else + { + TargetVector = pointToCheck.ToWorldCoordinates() - new Vector2(0, 16); + return; + } + } + } + + public void HandleAIStates() + { + Player player = Main.player[Projectile.owner]; + SegmentMaxRotation = 0.65f; + SegmentRigidity = 0.2f; + var distanceToPlayer = Projectile.Distance(player.Center); + bool onScreen = true; + if (Main.netMode == NetmodeID.SinglePlayer) //In singleplayer we base the "off screen" check on the actual screen. In multiplayer, we base it off the maximum zoom size. + { + onScreen = Collision.CheckAABBvAABBCollision(Projectile.position, Projectile.Size, Main.screenPosition, Main.ScreenSize.ToVector2()); + } + else + { + //Terraria forces the game view to never go above 1920x1200px, regardless of actual resolution. This code marks the "off screen box" to match that maximum size game viewport. (960x600 is half of 1920x1200) + onScreen = Collision.CheckAABBvAABBCollision(Projectile.position, Projectile.Size, player.Center - new Vector2(960, 600), new Vector2(1920, 1200)); + } + bool noGravity = (!onScreen || Projectile.wet || Collision.SolidCollision(Projectile.position, Projectile.width, Projectile.height, true)); + switch (ActiveAttackState) + { + case AttackState.Idle: + { + if (TargetVector == Vector2.Zero || MainTimer > 300 || (MainTimer > 120 && Projectile.Distance(TargetVector) < 64)) + { + if (Main.rand.NextBool()) + { + var veins = Burrower.FindOreVeins(Projectile.Center.ToTileCoordinates()); + while (veins.Count > 0) + { + var targetVein = veins[Main.rand.Next(veins.Count)]; + var foundTarget = Burrower.FindTargetFromVein(targetVein); + if (foundTarget is not null) + { + TargetVector = foundTarget.Value.Item1.ToWorldCoordinates(); + SecondaryVector = foundTarget.Value.Item2.ToWorldCoordinates(); + if (Projectile.Distance(TargetVector) > 160) + GeneralParticleHandler.SpawnParticle(new EmoteExpressionParticle(Projectile.Top, -Vector2.UnitY * 5, 2, ArsenalEffects.ArsenalGaussColor, 60, EmoteExpressionParticle.EmoteType.Exclamation)); + SwitchAttackState(AttackState.Mining, resetVector: false); + return; + } + else + veins.Remove(targetVein); + } + } + TargetVector = player.Center; + LowerTargetToGround(); + MainTimer = 0; + } + + var playerDistance = Projectile.Distance(Owner.Center); + float speed = 0.06f; + if (playerDistance > CalamityUtils.TilesToPixels(150)) + { + Projectile.Center = Owner.Center - Projectile.velocity.SafeNormalize(-Vector2.UnitY) * 200; + Projectile.velocity = Projectile.velocity.ClampMagnitude(1, 8); + } + else + { + if (playerDistance < 600 && !noGravity) + Projectile.velocity.Y += 0.5f; + if (playerDistance > 600) + speed = 0.5f; + if (playerDistance > 200f) + speed = 0.4f; + else if (playerDistance > 140f) + speed = 0.2f; + if (playerDistance > 100) + Projectile.velocity += Projectile.DirectionTo(Owner.Center) * speed; + else if (Projectile.velocity.Length() > 2) + Projectile.velocity *= 0.9f; + + Projectile.velocity = Projectile.velocity.ClampMagnitude(0, 16); + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; + } + break; + } + case AttackState.Mining: + { + Projectile.velocity += Projectile.DirectionTo(SecondaryVector).SafeNormalize(Vector2.UnitY); + Projectile.velocity *= 0.9f; + if (MainTimer > 600) + SwitchAttackState(AttackState.Idle); + if (Projectile.Distance(SecondaryVector) < 4) + { + var dir = SecondaryVector.DirectionTo(TargetVector); + + if (Main.tile[TargetVector.ToTileCoordinates()].TileType == ModContent.TileType()) + { + Projectile.velocity = -Projectile.DirectionTo(TargetVector) * 16; + Projectile.Center = SecondaryVector + Projectile.velocity; + Projectile.rotation = Projectile.velocity.ToRotation() - MathHelper.PiOver2; + SwitchAttackState(AttackState.Shocked, 300); //Shock for 5 seconds + AuricOre.Animate = true; + SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/ExoMechs/TeslaShoot1"), Projectile.Center); + return; + } + SegmentRigidity = 0f; + Projectile.velocity = Vector2.Zero; + Projectile.rotation = SecondaryVector.DirectionTo(TargetVector).ToRotation() + MathHelper.PiOver2; + + if (Main.netMode != NetmodeID.Server && !(BurrowerPingTileEffect.Instance.Active)) + TilePingerSystem.AddPing(BurrowerPingTileEffect.Instance, Projectile.Center, player); + for (int i = 0; i < 1; i++) + { + int sparkLifetime = Main.rand.Next(10, 20); + float sparkScale = Main.rand.NextFloat(0.8f, 1f); + Color sparkColor = Color.Lerp(Color.Silver, Color.Gold, Main.rand.NextFloat(0.7f)); + sparkColor = Color.Lerp(sparkColor, Color.Orange, Main.rand.NextFloat()); + + if (Main.rand.NextBool(10)) + sparkScale *= 2f; + + Vector2 sparkVelocity = dir.RotatedByRandom(0.6f) * Main.rand.NextFloat(6f, 16f); + SparkParticle spark = new SparkParticle((TargetVector + SecondaryVector) * 0.5f, -sparkVelocity, true, sparkLifetime, sparkScale, sparkColor); + GeneralParticleHandler.SpawnParticle(spark); + + if (MainTimer < 520) + MainTimer = 520; + } + SoundEngine.PlaySound(SoundID.NPCHit18 with { Volume = 0.2f }, Projectile.Center); + } + else + Projectile.rotation = (float)Math.Atan2(Projectile.velocity.Y, Projectile.velocity.X) + MathHelper.PiOver2; + break; + } + case AttackState.Shocked: + { + + if (AttackSubstate > 0) + AttackSubstate--; + else + { + SwitchAttackState(AttackState.Idle); + break; + } + if (noGravity) + { + SegmentRigidity = 0; + if (AttackSubstate < 295) //5 frames to get out of the auric ore that rejected it before it slows down from tiles + Projectile.velocity *= 0.55f; + foreach (var item in Segments) + { + if (!Collision.SolidCollision(item.Center - new Vector2(19, 17), 38, 38, true)) + item.Center.Y += 2f; + } + } + else + { + Projectile.velocity.Y += 0.5f; + Projectile.rotation = (float)Math.Atan2(Projectile.velocity.Y, Projectile.velocity.X) + MathHelper.PiOver2; + } + break; + } + } + } + + } +} diff --git a/Projectiles/Ranged/HalleysInfernoHoldout.cs b/Projectiles/Ranged/HalleysInfernoHoldout.cs index 8789dca7e2..f609bcb2e5 100644 --- a/Projectiles/Ranged/HalleysInfernoHoldout.cs +++ b/Projectiles/Ranged/HalleysInfernoHoldout.cs @@ -74,7 +74,29 @@ namespace CalamityMod.Projectiles.Ranged ShotTimer = 4; var spawnpos = Projectile.Center; var dir = spawnpos.DirectionTo(Main.MouseWorld); - Projectile.NewProjectile(Owner.GetSource_ItemUse_WithPotentialAmmo(Halley, AmmoID.Gel), spawnpos + dir * 16,dir * Halley.shootSpeed * 0.75f, ModContent.ProjectileType(), (int)Owner.GetDamage(DamageClass.Ranged).ApplyTo(Halley.damage), Halley.knockBack, Projectile.owner); + var color = Main.rand.Next(1, 7); + Color drawColor = Color.White; + switch (color) + { + case 1: + drawColor = Color.HotPink; + break; + case 2: + drawColor = Color.Yellow; + break; + case 3: + drawColor = Color.LimeGreen; + break; + case 4: + drawColor = Color.SkyBlue; + break; + case 5: + drawColor = Color.Lavender; + break; + } + for (var i = 0; i < 5; i++) + GeneralParticleHandler.SpawnParticle(new GlowSparkParticle(spawnpos + dir * 36, (dir * Halley.shootSpeed).RotatedByRandom(0.75f) * Main.rand.NextFloat(0.5f, 1.5f), false, 7, 0.02f, drawColor, new Vector2(0.5f, 1f))); + Projectile.NewProjectile(Owner.GetSource_ItemUse_WithPotentialAmmo(Halley, AmmoID.Gel), spawnpos + dir * 16,dir * Halley.shootSpeed * 0.75f, ModContent.ProjectileType(), (int)Owner.GetDamage(DamageClass.Ranged).ApplyTo(Halley.damage), Halley.knockBack, Projectile.owner, color); Owner.Calamity().StratusStarburst--; SoundEngine.PlaySound(HalleysInferno.ShootSound); RecoilAmount = 4; diff --git a/Projectiles/Ranged/HalleysStarburst.cs b/Projectiles/Ranged/HalleysStarburst.cs index d86551b2e9..6fe09d78be 100644 --- a/Projectiles/Ranged/HalleysStarburst.cs +++ b/Projectiles/Ranged/HalleysStarburst.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.ignoreWater = true; Projectile.DamageType = DamageClass.Ranged; Projectile.penetrate = 1; - Projectile.MaxUpdates = 4; + Projectile.MaxUpdates = 6; Projectile.timeLeft = 60 * Projectile.MaxUpdates; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; @@ -42,28 +42,7 @@ namespace CalamityMod.Projectiles.Ranged { if (drawColor == Color.Black) { - switch (Main.rand.Next(1, 7)) - { - case 1: - drawColor = Color.HotPink; - break; - case 2: - drawColor = Color.Yellow; - break; - case 3: - drawColor = Color.LimeGreen; - break; - case 4: - drawColor = Color.SkyBlue; - break; - case 5: - drawColor = Color.Lavender; - break; - case 6: - - drawColor = Color.White; - break; - } + } Projectile.rotation += Projectile.direction * 0.05f; if (Projectile.FinalExtraUpdate()) @@ -90,7 +69,7 @@ namespace CalamityMod.Projectiles.Ranged { if (drawColor == Color.Black) { - switch (Main.rand.Next(1, 7)) + switch (Projectile.ai[0]) { case 1: drawColor = Color.HotPink; diff --git a/Projectiles/Rogue/DoomsdayDeviceProjectile.cs b/Projectiles/Rogue/DoomsdayDeviceProjectile.cs index bfa00975f4..265b3e9638 100644 --- a/Projectiles/Rogue/DoomsdayDeviceProjectile.cs +++ b/Projectiles/Rogue/DoomsdayDeviceProjectile.cs @@ -33,8 +33,8 @@ namespace CalamityMod.Projectiles.Rogue public int maxStealthHits = 5; // How many bounces the stealth strike has. This does not include the inital and final hit, so be sure to take those into account if you adjust this. public Color mainColor = Color.White; - public Color c1 = new Color(121, 240, 17); - public Color c2 = new Color(0, 208, 240); + public Color c1 = Color.Turquoise; + public Color c2 = Color.Orchid; public NPC lastHitTarget; public override void SetDefaults() diff --git a/Projectiles/Typeless/WulfrumDiggingTurtleProjectile.cs b/Projectiles/Typeless/WulfrumDiggingTurtleProjectile.cs index ac0f53a210..a4679e0163 100644 --- a/Projectiles/Typeless/WulfrumDiggingTurtleProjectile.cs +++ b/Projectiles/Typeless/WulfrumDiggingTurtleProjectile.cs @@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Typeless public override void AI() { - Lighting.AddLight(Projectile.Center, Color.GreenYellow.ToVector3()); + Lighting.AddLight(Projectile.Center, Color.GreenYellow.ToVector3()*0.75f); //Idle chainsaw sounds if ((!SoundEngine.TryGetActiveSound(IdlingSoundSlot, out var idleSoundOut))) diff --git a/Sounds/Custom/DoGFireball.ogg b/Sounds/Custom/DoGFireball.ogg index 54b891b040..a52798a895 100644 Binary files a/Sounds/Custom/DoGFireball.ogg and b/Sounds/Custom/DoGFireball.ogg differ diff --git a/Systems/Mechanic/DifficultyModeSystem.cs b/Systems/Mechanic/DifficultyModeSystem.cs index 72ddc7fa36..db1c5345bd 100644 --- a/Systems/Mechanic/DifficultyModeSystem.cs +++ b/Systems/Mechanic/DifficultyModeSystem.cs @@ -35,15 +35,19 @@ namespace CalamityMod.Systems MostAlternateDifficulties = 1; //Initialize base mod difficulties Difficulties = new List() { ModContent.GetInstance(), - ModContent.GetInstance(), - ModContent.GetInstance(), ModContent.GetInstance(), - ModContent.GetInstance() }; + ModContent.GetInstance(),ModContent.GetInstance(), + ModContent.GetInstance(), ModContent.GetInstance(), + ModContent.GetInstance(), ModContent.GetInstance() }; journeyDifficultyUpdateMethod = typeof(CreativePowers.DifficultySliderPower).GetMethod("UpdateInfoFromSliderValueCache", BindingFlags.Instance | BindingFlags.NonPublic); CalculateDifficultyData(); } + public override void PostWorldLoad() + { + CalculateDifficultyData(); //Reload difficulties upon loading a world to adjust for FTW. + } public override void OnModUnload() { Difficulties = null; @@ -58,6 +62,16 @@ namespace CalamityMod.Systems { case GameModeID.Normal: { + if (Main.getGoodWorld) + { + // if death was activated, change it to revengence + if (GetCurrentDifficulty.CountAs()) + { + ModeIndicatorUI.SwitchToDifficulty(ModContent.GetInstance(), broadcast: true); + } + break; + } + // vanilla game mode in classic, but cal difficulty >= expert if (GetCurrentDifficulty.CountAs() || GetCurrentDifficulty.CountAs()) { @@ -67,6 +81,15 @@ namespace CalamityMod.Systems } case GameModeID.Expert: { + if (Main.getGoodWorld) + { + if (GetCurrentDifficulty.CountAs()) + { + ModeIndicatorUI.SwitchToDifficulty(ModContent.GetInstance(), broadcast: true); + } + break; + } + // if death was activated, change it to revengence if (GetCurrentDifficulty.CountAs()) { @@ -76,6 +99,14 @@ namespace CalamityMod.Systems } case GameModeID.Master: { + if (Main.getGoodWorld) + { + if (!GetCurrentDifficulty.CountAs() && CalamityWorld.revenge) + { + ModeIndicatorUI.SwitchToDifficulty(ModContent.GetInstance(), broadcast: true); + } + break; + } // if revengence and master both activated, change it to death if (!GetCurrentDifficulty.CountAs() && CalamityWorld.revenge) { @@ -143,6 +174,10 @@ namespace CalamityMod.Systems for (int i = 0; i < Difficulties.Count; i++) { + //Only add difficulties that are allowed in the current world type; + if ((Main.getGoodWorld && Difficulties[i].GetForTheWorthyDisplay == DifficultyMode.FTWDisplayMode.NotForTheWorthy) + || (!Main.getGoodWorld && Difficulties[i].GetForTheWorthyDisplay == DifficultyMode.FTWDisplayMode.OnlyForTheWorthy)) + continue; //if we are at a new tier, create a new list of difficulties at that tier. if (currentTier != Difficulties[i].DifficultyScale) { @@ -235,6 +270,12 @@ namespace CalamityMod.Systems public abstract class DifficultyMode : ModType { + public enum FTWDisplayMode + { + Always, + OnlyForTheWorthy, + NotForTheWorthy, + } protected sealed override void Register() { ModTypeLookup.Register(this); @@ -251,6 +292,11 @@ namespace CalamityMod.Systems public abstract Asset Texture { get; } protected Asset _textureDisabled; public abstract Asset TextureDisabled { get; } + + protected Asset _outlineTexture; + public abstract Asset OutlineTexture { get; } + public virtual FTWDisplayMode GetForTheWorthyDisplay { get; } = FTWDisplayMode.Always; + protected SoundStyle? _activationSound; public abstract SoundStyle ActivationSound { get; } public abstract int BackBoneGameModeID { get; } @@ -262,8 +308,8 @@ namespace CalamityMod.Systems public abstract LocalizedText ShortDescription { get; } public virtual LocalizedText ExpandedDescription => LocalizedText.Empty; - public abstract LocalizedText FTWName { get; } - public abstract Color FTWTextColor { get; } + public virtual LocalizedText FTWName { get; } = null; + public virtual Color? FTWTextColor { get; } = null; /// @@ -304,6 +350,8 @@ namespace CalamityMod.Systems public override Asset Texture => _texture ??= ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Classic"); + public override Asset OutlineTexture => _outlineTexture ??= ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Classic_Border"); + public override Asset TextureDisabled => _textureDisabled ??= ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Classic_Off"); public override SoundStyle ActivationSound => _activationSound ??= SoundID.MenuTick with { Volume = 1f }; @@ -317,17 +365,14 @@ namespace CalamityMod.Systems public override Color ChatTextColor => Color.White; public override LocalizedText ShortDescription => GetText("UI.ClassicInfo"); - - public override LocalizedText FTWName => Language.GetText("UI.Expert"); - - public override Color FTWTextColor => new Color(255, 186, 117); // World display: Main.mcColor + public override FTWDisplayMode GetForTheWorthyDisplay => FTWDisplayMode.NotForTheWorthy; } public class ExpertDifficulty : DifficultyMode { public override bool Enabled { - get => Main.getGoodWorld ? Main.masterMode : Main.expertMode; + get => Main.expertMode; set { if (!Main.GameModeInfo.IsJourneyMode) @@ -342,32 +387,29 @@ namespace CalamityMod.Systems } public override Asset Texture => _texture ??= ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Expert"); + public override Asset OutlineTexture => _outlineTexture ??= ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Expert_Border"); public override Asset TextureDisabled => _textureDisabled ??= ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Expert_Off"); public override SoundStyle ActivationSound => _activationSound ??= SoundID.ForceRoarPitched; - public override int BackBoneGameModeID => GameModeID.Expert; + public override int BackBoneGameModeID => Main.getGoodWorld ? GameModeID.Normal : GameModeID.Expert; public override float DifficultyScale => 0.1f; public override LocalizedText Name => Language.GetText("UI.Expert"); - public override Color ChatTextColor => new Color(255, 186, 117); // World display: Main.mcColor + public override Color ChatTextColor => Main.mcColor; public override LocalizedText ShortDescription => GetText("UI.ExpertShortInfo"); public override LocalizedText ExpandedDescription => GetText("UI.ExpertExpandedInfo"); - - public override LocalizedText FTWName => Language.GetText("UI.Master"); - - public override Color FTWTextColor => new Color(28, 255, 170); // World display: Main.hcColor } public class MasterDifficulty : DifficultyMode { public override bool Enabled { - get => Main.getGoodWorld ? CalamityWorld.LegendaryMode : Main.masterMode; + get => Main.masterMode; set { if (!Main.GameModeInfo.IsJourneyMode) @@ -382,26 +424,63 @@ namespace CalamityMod.Systems } public override Asset Texture => _texture ??= ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Master"); + public override Asset OutlineTexture => _outlineTexture ??= ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Master_Border"); public override Asset TextureDisabled => _textureDisabled ??= ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Master_Off"); public override SoundStyle ActivationSound => _activationSound ??= SoundID.NPCDeath10; - public override int BackBoneGameModeID => GameModeID.Master; + public override int BackBoneGameModeID => Main.getGoodWorld ? GameModeID.Expert : GameModeID.Master; public override float DifficultyScale => 0.25f; public override LocalizedText Name => Language.GetText("UI.Master"); - public override Color ChatTextColor => new Color(28, 255, 170); // World display: Main.hcColor + public override Color ChatTextColor => Main.hcColor; public override LocalizedText ShortDescription => GetText("UI.MasterShortInfo"); public override LocalizedText ExpandedDescription => GetText("UI.MasterExpandedInfo"); - public override LocalizedText FTWName => Language.GetText("UI.Legendary"); + } - public override Color FTWTextColor => Main.legendaryModeColor; + public class LegendaryDifficulty : DifficultyMode + { + public override bool Enabled + { + get => CalamityWorld.LegendaryMode; + set + { + if (!Main.GameModeInfo.IsJourneyMode) + { + Main.GameMode = value == true ? GameModeID.Master : GameModeID.Expert; + } + else + { + DifficultyModeSystem.AlignJourneyDifficultySlider(); + } + } + } + + public override Asset Texture => _texture ??= ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Legendary"); + public override Asset OutlineTexture => _outlineTexture ??= ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Legendary_Border"); + + public override Asset TextureDisabled => _textureDisabled ??= ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Legendary_Off"); + + public override SoundStyle ActivationSound => _activationSound ??= SoundID.NPCDeath10; + + public override int BackBoneGameModeID => GameModeID.Master; + + public override float DifficultyScale => 0.5f; + + public override LocalizedText Name => Language.GetText("UI.Legendary"); + + public override Color ChatTextColor => Main.legendaryModeColor; + + public override LocalizedText ShortDescription => GetText("UI.LegendaryShortInfo"); + + public override LocalizedText ExpandedDescription => GetText("UI.LegendaryExpandedInfo"); + public override FTWDisplayMode GetForTheWorthyDisplay => FTWDisplayMode.OnlyForTheWorthy; } @@ -412,25 +491,22 @@ namespace CalamityMod.Systems get => CalamityWorld.revenge; set { - if (Main.getGoodWorld) - { - CalamityWorld.revenge = value; - CalamityWorld.death = value; - } - else - CalamityWorld.revenge = value; + CalamityWorld.revenge = value; + if (value && !Main.GameModeInfo.IsJourneyMode) + Main.GameMode = BackBoneGameModeID; } } public override Asset Texture => _texture ??= ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Rev"); + public override Asset OutlineTexture => _outlineTexture ??= ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Rev_Border"); public override Asset TextureDisabled => _textureDisabled ??= ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Rev_Off"); public override SoundStyle ActivationSound => _activationSound ??= SoundID.Item119; - public override int BackBoneGameModeID => GameModeID.Expert; + public override int BackBoneGameModeID => Main.getGoodWorld ? GameModeID.Normal : GameModeID.Expert; - public override float DifficultyScale => 0.25f; + public override float DifficultyScale => 0.1f; public override LocalizedText Name => GetText("UI.Revengeance"); @@ -447,24 +523,20 @@ namespace CalamityMod.Systems return GetText("UI.RevengeanceExpandedInfo").WithFormatArgs(rageKey, adrenKey); } } - - public override LocalizedText FTWName => GetText("UI.Death"); - - public override Color FTWTextColor => new Color(192, 64, 219); } public class DeathDifficulty : DifficultyMode { public override bool Enabled { - get => Main.getGoodWorld ? CalamityWorld.death && CalamityWorld.LegendaryMode : CalamityWorld.death; + get => CalamityWorld.death; set { if (Main.getGoodWorld) { if (!Main.GameModeInfo.IsJourneyMode) { - Main.GameMode = value == true ? GameModeID.Master : GameModeID.Expert; + Main.GameMode = value == true ? GameModeID.Expert : GameModeID.Normal; } else { @@ -473,19 +545,24 @@ namespace CalamityMod.Systems CalamityWorld.death = value; } else + { CalamityWorld.death = value; + if (value && !Main.GameModeInfo.IsJourneyMode) + Main.GameMode = BackBoneGameModeID; + } } } public override Asset Texture => _texture ??= ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Death"); + public override Asset OutlineTexture => _outlineTexture ??= ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Death_Border"); public override Asset TextureDisabled => _textureDisabled ??= ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Death_Off"); public override SoundStyle ActivationSound => _activationSound ??= DemonshadeHelm.ActivationSound; - public override int BackBoneGameModeID => GameModeID.Master; + public override int BackBoneGameModeID => Main.getGoodWorld ? GameModeID.Expert : GameModeID.Master; - public override float DifficultyScale => 0.5f; + public override float DifficultyScale => 0.25f; public override LocalizedText Name => GetText("UI.Death"); @@ -495,11 +572,6 @@ namespace CalamityMod.Systems public override LocalizedText ExpandedDescription => GetText("UI.DeathExpandedInfo"); - - public override LocalizedText FTWName => GetText("UI.Malice"); - - public override Color FTWTextColor => new Color(240, 128, 128); - public override int[] FavoredDifficultyAtTier(int tier) { DifficultyMode[] tierList = DifficultyModeSystem.DifficultyTiers[tier]; @@ -518,4 +590,66 @@ namespace CalamityMod.Systems return difficulties.ToArray(); } } + + public class MaliceDifficulty : DifficultyMode + { + public override bool Enabled + { + get => Main.getGoodWorld ? CalamityWorld.death && CalamityWorld.LegendaryMode : false; + set + { + if (Main.getGoodWorld) + { + if (!Main.GameModeInfo.IsJourneyMode) + { + Main.GameMode = value == true ? GameModeID.Master : GameModeID.Expert; + } + else + { + DifficultyModeSystem.AlignJourneyDifficultySlider(); + } + CalamityWorld.revenge = value; + CalamityWorld.death = value; + } + } + } + + public override Asset Texture => _texture ??= ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Malice"); + public override Asset OutlineTexture => _outlineTexture ??= ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Malice_Border"); + + public override Asset TextureDisabled => _textureDisabled ??= ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Malice_Off"); + + public override SoundStyle ActivationSound => _activationSound ??= DemonshadeHelm.ActivationSound; + + public override int BackBoneGameModeID => GameModeID.Master; + + public override float DifficultyScale => 0.5f; + + public override LocalizedText Name => GetText("UI.Malice"); + + public override Color ChatTextColor => new Color(240, 128, 128); + + public override LocalizedText ShortDescription => GetText("UI.MaliceShortInfo"); + + public override LocalizedText ExpandedDescription => GetText("UI.MaliceExpandedInfo"); + public override FTWDisplayMode GetForTheWorthyDisplay => FTWDisplayMode.OnlyForTheWorthy; + + public override int[] FavoredDifficultyAtTier(int tier) + { + DifficultyMode[] tierList = DifficultyModeSystem.DifficultyTiers[tier]; + + List difficulties = new List(); + + for (int i = 0; i < tierList.Length; i++) + { + if (tierList[i] is MasterDifficulty || tierList[i] is DeathDifficulty) + difficulties.Add(i); + } + + if (difficulties.Count <= 0) + difficulties.Add(0); + + return difficulties.ToArray(); + } + } } diff --git a/Systems/World/WorldgenManagementSystem.cs b/Systems/World/WorldgenManagementSystem.cs index 4548a81a72..ecef513c1c 100644 --- a/Systems/World/WorldgenManagementSystem.cs +++ b/Systems/World/WorldgenManagementSystem.cs @@ -153,7 +153,7 @@ namespace CalamityMod.Systems // Move spawn point in Celebrationmk10 to not be in the Sulphurous Sea int spawnPointIndex = tasks.FindIndex(genpass => genpass.Name.Equals("Spawn Point")); - if (spawnPointIndex != -1 && WorldGen.tenthAnniversaryWorldGen && !WorldGen.getGoodWorldGen) + if (spawnPointIndex != -1 && WorldGen.tenthAnniversaryWorldGen && !WorldGen.remixWorldGen) { tasks.Insert(spawnPointIndex + 1, new PassLegacy("Fix Tenth Anniversary Spawn", (progress, config) => { @@ -499,111 +499,6 @@ namespace CalamityMod.Systems } } - // Give Dead Man's Chests better loot. - if (isDeadManChest) - { - for (int inventoryIndex = 0; inventoryIndex < 40; inventoryIndex++) - { - // Cavern Dead Man's Chests - if (chest.y > GenVars.lavaLine || (chest.y <= GenVars.lavaLine && Main.remixWorld)) - { - if (chest.item[inventoryIndex].type == ItemID.Dynamite) - chest.item[inventoryIndex].SetDefaults(ItemID.StickyDynamite); - - if (chest.item[inventoryIndex].type == ItemID.JestersArrow) - { - chest.item[inventoryIndex].SetDefaults(ItemID.HolyArrow); - chest.item[inventoryIndex].stack = WorldGen.genRand.Next(25, 51); - } - - if (chest.item[inventoryIndex].type == ItemID.SilverBar || - chest.item[inventoryIndex].type == ItemID.TungstenBar || - chest.item[inventoryIndex].type == ItemID.GoldBar || - chest.item[inventoryIndex].type == ItemID.PlatinumBar) - chest.item[inventoryIndex].stack = WorldGen.genRand.Next(6, 16); - - if (chest.item[inventoryIndex].type == ItemID.FlamingArrow) - { - chest.item[inventoryIndex].SetDefaults(ItemID.HellfireArrow); - chest.item[inventoryIndex].stack = WorldGen.genRand.Next(25, 51); - } - - if (chest.item[inventoryIndex].type == ItemID.ThrowingKnife) - { - chest.item[inventoryIndex].SetDefaults(ItemID.PoisonedKnife); - chest.item[inventoryIndex].stack = WorldGen.genRand.Next(25, 51); - } - - if (chest.item[inventoryIndex].type == ItemID.HealingPotion) - { - chest.item[inventoryIndex].SetDefaults(ItemID.RestorationPotion); - chest.item[inventoryIndex].stack = WorldGen.genRand.Next(3, 6); - } - - if (chest.item[inventoryIndex].type == ItemID.RecallPotion) - chest.item[inventoryIndex].SetDefaults(ItemID.PotionOfReturn); - - if (chest.item[inventoryIndex].type == ItemID.Torch) - { - chest.item[inventoryIndex].SetDefaults(ItemID.UltrabrightTorch); - chest.item[inventoryIndex].stack = WorldGen.genRand.Next(15, 30); - } - - if (chest.item[inventoryIndex].type == ItemID.Glowstick) - { - chest.item[inventoryIndex].SetDefaults(ItemID.SpelunkerGlowstick); - chest.item[inventoryIndex].stack = WorldGen.genRand.Next(15, 30); - } - - if (chest.item[inventoryIndex].type == ItemID.GoldCoin) - chest.item[inventoryIndex].stack = WorldGen.genRand.Next(2, 4); - } - - // Underground Dead Man's Chests - else - { - if (chest.item[inventoryIndex].type == ItemID.Bomb) - { - chest.item[inventoryIndex].SetDefaults(ItemID.StickyBomb); - chest.item[inventoryIndex].stack = WorldGen.genRand.Next(10, 20); - } - - if (chest.item[inventoryIndex].type == ItemID.Rope) - chest.item[inventoryIndex].stack = WorldGen.genRand.Next(100, 201); - - if (chest.item[inventoryIndex].type == ItemID.IronBar || - chest.item[inventoryIndex].type == ItemID.LeadBar || - chest.item[inventoryIndex].type == ItemID.SilverBar || - chest.item[inventoryIndex].type == ItemID.TungstenBar) - chest.item[inventoryIndex].stack = WorldGen.genRand.Next(10, 20); - - if (chest.item[inventoryIndex].type == ItemID.WoodenArrow) - { - chest.item[inventoryIndex].SetDefaults(ItemID.FlamingArrow); - chest.item[inventoryIndex].stack = WorldGen.genRand.Next(25, 50); - } - - if (chest.item[inventoryIndex].type == ItemID.Shuriken) - { - chest.item[inventoryIndex].SetDefaults(ItemID.ThrowingKnife); - chest.item[inventoryIndex].stack = WorldGen.genRand.Next(25, 50); - } - - if (chest.item[inventoryIndex].type == ItemID.LesserHealingPotion) - { - chest.item[inventoryIndex].SetDefaults(ItemID.HealingPotion); - chest.item[inventoryIndex].stack = WorldGen.genRand.Next(3, 6); - } - - if (chest.item[inventoryIndex].type == ItemID.SilverCoin) - { - chest.item[inventoryIndex].SetDefaults(ItemID.GoldCoin); - chest.item[inventoryIndex].stack = WorldGen.genRand.Next(1, 3); - } - } - } - } - // Adds Desert Medallion and The Comb to Sandstone Chests, each at a 20% chance if (isSandstoneChest) { diff --git a/UI/ModeIndicator/ModeIndicatorOutline.png b/UI/ModeIndicator/ModeIndicatorOutline.png deleted file mode 100644 index 8cfff31c70..0000000000 Binary files a/UI/ModeIndicator/ModeIndicatorOutline.png and /dev/null differ diff --git a/UI/ModeIndicator/ModeIndicatorUI.cs b/UI/ModeIndicator/ModeIndicatorUI.cs index f18f516d30..139848fb68 100644 --- a/UI/ModeIndicator/ModeIndicatorUI.cs +++ b/UI/ModeIndicator/ModeIndicatorUI.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using CalamityMod.CalPlayer; @@ -7,6 +8,7 @@ using CalamityMod.Packets; using CalamityMod.Systems; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.Audio; using Terraria.ID; @@ -23,15 +25,15 @@ namespace CalamityMod.UI.ModeIndicator { public static Rectangle MouseScreenArea => Utils.CenteredRectangle(Main.MouseScreen, Vector2.One * 2f); - public static Vector2 FrameSize => new Vector2(30f, 38f); + public static Vector2 FrameSize => new Vector2(74f, 74f); public static Rectangle MainClickArea => Utils.CenteredRectangle(DrawCenter, FrameSize * MainIconScale); public static bool ClickingMouse => Main.mouseLeft && Main.mouseLeftRelease; public static Vector2 DrawCenter => new Vector2(Main.screenWidth - 400f - WidthForTier(MostAlternateDifficulties) * 0.5f, 82f) + FrameSize * 0.5f; - private static int GlowFadeAnimLength = 40; + private static int GlowFadeAnimLength = 20; public static int GlowFadeTime = 0; //Lock icon - internal const int LockAnimLength = 30; + internal const int LockAnimLength = 15; private static int lockClickTime = 0; private static bool previousLockStatus = false; //Expand and shrink on hover @@ -43,10 +45,10 @@ namespace CalamityMod.UI.ModeIndicator public static float MainIconScale => 1f + iconHoverScaleBoost; //Menu state private static bool menuOpen = false; - internal static int MenuAnimLength => MostAlternateDifficulties > 1 ? 60 : 40; + internal static int MenuAnimLength => MostAlternateDifficulties > 1 ? 30 : 20; private static int menuOpenTransitionTime = 0; private static DifficultyMode previouslyHoveredMode = null; - public static float WidthForTier(int alts) => (alts - 1) * 44f; + public static float WidthForTier(int alts) => (alts - 1) * 76f; private static void ClearVariables() { @@ -204,14 +206,14 @@ namespace CalamityMod.UI.ModeIndicator if (MouseScreenArea.Intersects(MainClickArea)) { //Display the first non-none difficulty by default - string modeToDisplay = Main.getGoodWorld ? Difficulties[0].FTWName.ToString() : Difficulties[1].Name.ToString(); + string modeToDisplay = Main.getGoodWorld && Difficulties[0].FTWName is not null ? Difficulties[0].FTWName.ToString() : Difficulties[1].Name.ToString(); bool anyActiveMode = Main.getGoodWorld ? true : false; for (int i = 1; i < Difficulties.Count; i++) { if (GetCurrentDifficulty == Difficulties[i]) { - modeToDisplay = Main.getGoodWorld ? Difficulties[i].FTWName.ToString() : Difficulties[i].Name.ToString(); + modeToDisplay = Main.getGoodWorld && Difficulties[i].FTWName is not null ? Difficulties[i].FTWName.ToString() : Difficulties[i].Name.ToString(); anyActiveMode = true; } } @@ -295,12 +297,10 @@ namespace CalamityMod.UI.ModeIndicator public static void ManageHexIcons(SpriteBatch spriteBatch, out string text) { int tiers = DifficultyTiers.Count(); - float barLength = 68 * tiers * BarExpansionProgress; + float barLength = 90 * tiers * BarExpansionProgress; float progress = menuOpen ? 1 - menuOpenTransitionTime / (float)MenuAnimLength : menuOpenTransitionTime / (float)MenuAnimLength; Vector2 basePosition = DrawCenter + (barLength / (float)(tiers + 1f)) * Vector2.UnitY; - Texture2D outlineTexture = ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicatorOutline").Value; - text = string.Empty; bool modeHovered = false; Vector2 positionOffset = (barLength / (float)(tiers + 1f)) * Vector2.UnitY; @@ -332,6 +332,7 @@ namespace CalamityMod.UI.ModeIndicator if (mode == GetCurrentDifficulty) { usedOpacity = 1f; + Texture2D outlineTexture = mode.OutlineTexture.Value; spriteBatch.Draw(outlineTexture, iconPosition, null, mode.ChatTextColor * progressMult, 0f, outlineTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0f); } @@ -368,9 +369,10 @@ namespace CalamityMod.UI.ModeIndicator #region Difficulty toggling public static string GetDifficultyText(DifficultyMode mode) { - LocalizedText preface = Main.getGoodWorld ? mode.FTWName : mode.Name; + bool useFTWName = mode.FTWName is not null && Main.getGoodWorld; + LocalizedText preface = useFTWName ? mode.FTWName : mode.Name; if (mode == GetCurrentDifficulty) - preface = CalamityUtils.GetText("UI.CurrentlySelected").WithFormatArgs(Main.getGoodWorld ? mode.FTWName.ToString() : mode.Name.ToString()); + preface = CalamityUtils.GetText("UI.CurrentlySelected").WithFormatArgs(useFTWName ? mode.FTWName.ToString() : mode.Name.ToString()); string text = "\n" + mode.ShortDescription.ToString(); @@ -396,8 +398,8 @@ namespace CalamityMod.UI.ModeIndicator return; // This has to be put before difficulties change as to not disrupt GetCurrentDifficulty - BroadcastFormattedText("Mods.CalamityMod.UI.DifficultySwitch", Color.White, Main.getGoodWorld ? GetCurrentDifficulty.FTWTextColor.Hex3() : GetCurrentDifficulty.ChatTextColor.Hex3(), Main.getGoodWorld ? GetCurrentDifficulty.FTWName : GetCurrentDifficulty.Name - , Main.getGoodWorld ? mode.FTWTextColor.Hex3() : mode.ChatTextColor.Hex3(), Main.getGoodWorld ? mode.FTWName : mode.Name); + BroadcastFormattedText("Mods.CalamityMod.UI.DifficultySwitch", Color.White, Main.getGoodWorld && GetCurrentDifficulty.FTWTextColor is not null ? GetCurrentDifficulty.FTWTextColor.Value.Hex3() : GetCurrentDifficulty.ChatTextColor.Hex3(), Main.getGoodWorld && GetCurrentDifficulty.FTWName is not null ? GetCurrentDifficulty.FTWName : GetCurrentDifficulty.Name + , Main.getGoodWorld && GetCurrentDifficulty.FTWTextColor is not null ? mode.FTWTextColor.Value.Hex3() : mode.ChatTextColor.Hex3(), Main.getGoodWorld && GetCurrentDifficulty.FTWName is not null ? mode.FTWName : mode.Name); // Todo, maybe in the future having a way to have multiple difficulty options on the same tier that can coexist, and it works in branching pathes? Not very necessary for cal & addons. // But would be super useful so other mods can let their own difficulties go there. diff --git a/UI/ModeIndicator/ModeIndicator_Classic.png b/UI/ModeIndicator/ModeIndicator_Classic.png index cec6bfee9b..311087fb85 100644 Binary files a/UI/ModeIndicator/ModeIndicator_Classic.png and b/UI/ModeIndicator/ModeIndicator_Classic.png differ diff --git a/UI/ModeIndicator/ModeIndicator_Classic_Border.png b/UI/ModeIndicator/ModeIndicator_Classic_Border.png new file mode 100644 index 0000000000..4b7745f447 Binary files /dev/null and b/UI/ModeIndicator/ModeIndicator_Classic_Border.png differ diff --git a/UI/ModeIndicator/ModeIndicator_Classic_Off.png b/UI/ModeIndicator/ModeIndicator_Classic_Off.png index ccf4bfccbc..1ce7e3aef4 100644 Binary files a/UI/ModeIndicator/ModeIndicator_Classic_Off.png and b/UI/ModeIndicator/ModeIndicator_Classic_Off.png differ diff --git a/UI/ModeIndicator/ModeIndicator_Death.png b/UI/ModeIndicator/ModeIndicator_Death.png index 3407bf8f8d..0604833c59 100644 Binary files a/UI/ModeIndicator/ModeIndicator_Death.png and b/UI/ModeIndicator/ModeIndicator_Death.png differ diff --git a/UI/ModeIndicator/ModeIndicator_Death_Border.png b/UI/ModeIndicator/ModeIndicator_Death_Border.png new file mode 100644 index 0000000000..6c3f3df9c1 Binary files /dev/null and b/UI/ModeIndicator/ModeIndicator_Death_Border.png differ diff --git a/UI/ModeIndicator/ModeIndicator_Death_Off.png b/UI/ModeIndicator/ModeIndicator_Death_Off.png index 2a3f7cc3d5..d5cacd72c8 100644 Binary files a/UI/ModeIndicator/ModeIndicator_Death_Off.png and b/UI/ModeIndicator/ModeIndicator_Death_Off.png differ diff --git a/UI/ModeIndicator/ModeIndicator_Expert.png b/UI/ModeIndicator/ModeIndicator_Expert.png index 7f16d0f576..893cbd39d6 100644 Binary files a/UI/ModeIndicator/ModeIndicator_Expert.png and b/UI/ModeIndicator/ModeIndicator_Expert.png differ diff --git a/UI/ModeIndicator/ModeIndicator_Expert_Border.png b/UI/ModeIndicator/ModeIndicator_Expert_Border.png new file mode 100644 index 0000000000..a795897508 Binary files /dev/null and b/UI/ModeIndicator/ModeIndicator_Expert_Border.png differ diff --git a/UI/ModeIndicator/ModeIndicator_Expert_Off.png b/UI/ModeIndicator/ModeIndicator_Expert_Off.png index 1ade0d9fd6..6aeff8c0d7 100644 Binary files a/UI/ModeIndicator/ModeIndicator_Expert_Off.png and b/UI/ModeIndicator/ModeIndicator_Expert_Off.png differ diff --git a/UI/ModeIndicator/ModeIndicator_Legendary.png b/UI/ModeIndicator/ModeIndicator_Legendary.png new file mode 100644 index 0000000000..5a8789f90a Binary files /dev/null and b/UI/ModeIndicator/ModeIndicator_Legendary.png differ diff --git a/UI/ModeIndicator/ModeIndicator_Legendary_Border.png b/UI/ModeIndicator/ModeIndicator_Legendary_Border.png new file mode 100644 index 0000000000..3dc61a1448 Binary files /dev/null and b/UI/ModeIndicator/ModeIndicator_Legendary_Border.png differ diff --git a/UI/ModeIndicator/ModeIndicator_Legendary_Off.png b/UI/ModeIndicator/ModeIndicator_Legendary_Off.png new file mode 100644 index 0000000000..5261ecc7c4 Binary files /dev/null and b/UI/ModeIndicator/ModeIndicator_Legendary_Off.png differ diff --git a/UI/ModeIndicator/ModeIndicator_Malice.png b/UI/ModeIndicator/ModeIndicator_Malice.png new file mode 100644 index 0000000000..f6ad0a7a8a Binary files /dev/null and b/UI/ModeIndicator/ModeIndicator_Malice.png differ diff --git a/UI/ModeIndicator/ModeIndicator_Malice_Border.png b/UI/ModeIndicator/ModeIndicator_Malice_Border.png new file mode 100644 index 0000000000..7ddffeae4c Binary files /dev/null and b/UI/ModeIndicator/ModeIndicator_Malice_Border.png differ diff --git a/UI/ModeIndicator/ModeIndicator_Malice_Off.png b/UI/ModeIndicator/ModeIndicator_Malice_Off.png new file mode 100644 index 0000000000..e74ba288b9 Binary files /dev/null and b/UI/ModeIndicator/ModeIndicator_Malice_Off.png differ diff --git a/UI/ModeIndicator/ModeIndicator_Master.png b/UI/ModeIndicator/ModeIndicator_Master.png index c69fcfaa6e..655f9c13d0 100644 Binary files a/UI/ModeIndicator/ModeIndicator_Master.png and b/UI/ModeIndicator/ModeIndicator_Master.png differ diff --git a/UI/ModeIndicator/ModeIndicator_Master_Border.png b/UI/ModeIndicator/ModeIndicator_Master_Border.png new file mode 100644 index 0000000000..65ee802bcb Binary files /dev/null and b/UI/ModeIndicator/ModeIndicator_Master_Border.png differ diff --git a/UI/ModeIndicator/ModeIndicator_Master_Off.png b/UI/ModeIndicator/ModeIndicator_Master_Off.png index 91817fbfd1..cfb119a7ea 100644 Binary files a/UI/ModeIndicator/ModeIndicator_Master_Off.png and b/UI/ModeIndicator/ModeIndicator_Master_Off.png differ diff --git a/UI/ModeIndicator/ModeIndicator_Rev.png b/UI/ModeIndicator/ModeIndicator_Rev.png index 5b21cfd0fa..9c29e362e0 100644 Binary files a/UI/ModeIndicator/ModeIndicator_Rev.png and b/UI/ModeIndicator/ModeIndicator_Rev.png differ diff --git a/UI/ModeIndicator/ModeIndicator_Rev_Border.png b/UI/ModeIndicator/ModeIndicator_Rev_Border.png new file mode 100644 index 0000000000..3f59e2ad7d Binary files /dev/null and b/UI/ModeIndicator/ModeIndicator_Rev_Border.png differ diff --git a/UI/ModeIndicator/ModeIndicator_Rev_Off.png b/UI/ModeIndicator/ModeIndicator_Rev_Off.png index 3f8cc887fa..1aba896d33 100644 Binary files a/UI/ModeIndicator/ModeIndicator_Rev_Off.png and b/UI/ModeIndicator/ModeIndicator_Rev_Off.png differ diff --git a/UI/VanillaBossBars/RevMoonLordBossBar.cs b/UI/VanillaBossBars/RevMoonLordBossBar.cs new file mode 100644 index 0000000000..d90123097e --- /dev/null +++ b/UI/VanillaBossBars/RevMoonLordBossBar.cs @@ -0,0 +1,81 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using System.Collections.Generic; +using Terraria; +using Terraria.GameContent; +using Terraria.GameContent.UI.BigProgressBar; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.UI.VanillaBossBars +{ + internal class RevMoonLordBossBar : ModBossBar + { + private List MoonLordPartIDs = [NPCID.MoonLordCore, NPCID.MoonLordHead, NPCID.MoonLordHand]; + private NPC _dummy; + + public override void SetStaticDefaults() + { + _dummy = new NPC(); + } + public override Asset GetIconTexture(ref Rectangle? iconFrame) => TextureAssets.NpcHeadBoss[NPCID.Sets.BossHeadTextures[NPCID.MoonLordHead]]; + + public override bool? ModifyInfo(ref BigProgressBarInfo info, ref float life, ref float lifeMax, ref float shield, ref float shieldMax) + { + NPC target = Main.npc[info.npcIndexToAimAt]; + if ((!target.active || InBadAI(target)) && !TryFindingAnotherMoonLordPiece(ref info)) + return false; + + life = 0f; + lifeMax = 0f; + shield = 0f; + shieldMax = 0f; + + NPCSpawnParams dummy = default; + dummy.strengthMultiplierOverride = target.strengthMultiplier; + dummy.playerCountForMultiplayerDifficultyOverride = target.statsAreScaledForThisManyPlayers; + _dummy.SetDefaults(NPCID.MoonLordCore, dummy); + lifeMax += _dummy.lifeMax; + _dummy.SetDefaults(NPCID.MoonLordHead, dummy); + lifeMax += _dummy.lifeMax; + _dummy.SetDefaults(NPCID.MoonLordHand, dummy); + lifeMax += _dummy.lifeMax * 2; + + // Find all the Moon Lord parts, and add their totals. Do not add them if in a "bad AI" state. + foreach (NPC n in Main.ActiveNPCs) + { + if (MoonLordPartIDs.Contains(n.type) && !InBadAI(n)) + { + life += n.life; + } + } + + return true; + } + + private static bool InBadAI(NPC n) + { + // If in death animation, or in initial startup state + if (n.type == NPCID.MoonLordCore && (n.ai[0] == 2f || n.ai[0] == -1f || n.localAI[3] == 0f)) + return true; + // If in death animation, or this eye has been "killed" + if (n.ai[0] == -2f || n.ai[0] == -3f || n.Calamity().newAI[0] == 1f) + return true; + return false; + } + + private bool TryFindingAnotherMoonLordPiece(ref BigProgressBarInfo info) + { + foreach (NPC n in Main.ActiveNPCs) + { + if (MoonLordPartIDs.Contains(n.type) && !InBadAI(n)) + { + info.npcIndexToAimAt = n.whoAmI; + return true; + } + } + return false; + } + } +} diff --git a/World/ShimmerShrine.cs b/World/ShimmerShrine.cs index b499d5f361..7beb14fd6c 100644 --- a/World/ShimmerShrine.cs +++ b/World/ShimmerShrine.cs @@ -17,7 +17,7 @@ namespace CalamityMod.World var schematic = TileMaps[mapKey]; int placementPositionX = (int)GenVars.shimmerPosition.X; - int placementPositionY = (int)Main.worldSurface - 250; + int placementPositionY = (int)Main.worldSurface - 300; int offset = 28; while (!Main.tile[placementPositionX, placementPositionY].HasTile) @@ -39,7 +39,7 @@ namespace CalamityMod.World { new ChestItem(ItemID.AngelStatue, 1), new ChestItem(WorldGen.genRand.NextBool() ? ItemID.LifeCrystal : ItemID.ManaCrystal, 1), - new ChestItem(GenVars.goldBar == TileID.Gold ? ItemID.GoldBar : ItemID.PlatinumBar, WorldGen.genRand.Next(5, 16)), + new ChestItem(GenVars.gold == TileID.Gold ? ItemID.GoldBar : ItemID.PlatinumBar, WorldGen.genRand.Next(5, 16)), new ChestItem(ItemID.CanOfWorms, WorldGen.genRand.Next(3, 5)), new ChestItem(ItemID.HealingPotion, WorldGen.genRand.Next(5, 11)), new ChestItem(ItemID.LuckPotionGreater, WorldGen.genRand.Next(1, 3)), diff --git a/World/UndergroundShrines.cs b/World/UndergroundShrines.cs index e1a6354983..2ecd592b96 100644 --- a/World/UndergroundShrines.cs +++ b/World/UndergroundShrines.cs @@ -882,36 +882,27 @@ namespace CalamityMod.World { int tries = 0; string mapKey = Main.rand.NextBool() ? RoxcaliburShrineKey1 : RoxcaliburShrineKey2; + Vector2 schematicSize = new Vector2(TileMaps[mapKey].GetLength(0), TileMaps[mapKey].GetLength(1)); do { int placementPositionX = WorldGen.genRand.Next((int)(Main.maxTilesX * 0.15f), (int)(Main.maxTilesX * 0.85f)); - // Ensure that the shrine doesn't generate too close to the center of the world - do - { - placementPositionX = WorldGen.genRand.Next((int)(Main.maxTilesX * 0.15f), (int)(Main.maxTilesX * 0.85f)); - } - while (placementPositionX > (int)(Main.maxTilesX * 0.4f) && placementPositionX < (int)(Main.maxTilesX * 0.6f)); - int placementPositionY = WorldGen.genRand.Next((int)(Main.maxTilesY * 0.75f), Main.UnderworldLayer-50); //Lava layer Point placementPoint = new Point(placementPositionX, placementPositionY); - - Vector2 schematicSize = new Vector2(TileMaps[mapKey].GetLength(0), TileMaps[mapKey].GetLength(1)); - int extraArea = 0; int yExtraArea = 10; bool canGenerateInLocation = true; - for (int x = placementPoint.X - extraArea; x < placementPoint.X + schematicSize.X + extraArea; x++) + for (int x = placementPoint.X; x < placementPoint.X + schematicSize.X; x++) { for (int y = placementPoint.Y; y < placementPoint.Y + schematicSize.Y + yExtraArea; y++) { Tile tile = CalamityUtils.ParanoidTileRetrieval(x, y); //Avoid shacks, jungle and mushroom biomes - if (tile.TileType == TileID.WoodBlock || tile.TileType == TileID.Mud || tile.TileType == ModContent.TileType()) + if (tile.TileType == TileID.WoodBlock || tile.TileType == TileID.Mud || tile.TileType == TileType()) canGenerateInLocation = false; - + //Try to not be in a place with lava on the top half or above the shrine if (ShouldAvoidLocation(new Point(x, y-20), true)) canGenerateInLocation = false; @@ -919,7 +910,6 @@ namespace CalamityMod.World //Check for the rest of the structure if (ShouldAvoidLocation(new Point(x, y), false)) canGenerateInLocation = false; - } } if ((!canGenerateInLocation || !structures.CanPlace(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y))) && !Main.remixWorld) @@ -933,7 +923,7 @@ namespace CalamityMod.World PlaceSchematic>(mapKey, new Point(placementPoint.X, placementPoint.Y), SchematicAnchor.TopLeft, ref _); //Do not get eaten by other structures or Fargo's instabridge CalamityUtils.AddProtectedStructure(new Rectangle(placementPoint.X, placementPoint.Y, (int)schematicSize.X, (int)schematicSize.Y), 4); - break; + return; } } while (tries <= 100000); CalamityMod.Log.Debug("Rox Shrine failed to generate");