From 25bf55d69634875b0e5a69dec093b95bb2d5ccf0 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Mon, 23 Jan 2023 21:02:12 -0500 Subject: [PATCH 1/3] 1 - Added Marksman Rounds. These enable any gun to ricoshot with Midas Prime. 2 - Tyranny's End changed to work identically to AMR: it can use regular bullets. --- Items/Ammo/MarksmanRound.cs | 42 ++++++++++++++++++++++ Items/Ammo/MarksmanRound.png | Bin 0 -> 251 bytes Items/Weapons/Ranged/AntiMaterielRifle.cs | 9 ++--- Items/Weapons/Ranged/TyrannysEnd.cs | 9 +++-- Projectiles/Ranged/CrackshotBlast.cs | 3 +- Projectiles/Ranged/MidasBlast.cs | 2 +- 6 files changed, 50 insertions(+), 15 deletions(-) create mode 100644 Items/Ammo/MarksmanRound.cs create mode 100644 Items/Ammo/MarksmanRound.png diff --git a/Items/Ammo/MarksmanRound.cs b/Items/Ammo/MarksmanRound.cs new file mode 100644 index 0000000000..eda2d7d86a --- /dev/null +++ b/Items/Ammo/MarksmanRound.cs @@ -0,0 +1,42 @@ +using CalamityMod.Projectiles.Ranged; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Ammo +{ + public class MarksmanRound : ModItem + { + public override void SetStaticDefaults() + { + SacrificeTotal = 99; + DisplayName.SetDefault("Marksman Round"); + Tooltip.SetDefault("A carefully crafted round which can be ricocheted off of midair coins\nAny gun firing this weapon can perform Ricoshots with coins from Crackshot Colt or Midas Prime"); + } + + public override void SetDefaults() + { + Item.damage = 12; + Item.DamageType = DamageClass.Ranged; + Item.width = 12; + Item.height = 26; + Item.maxStack = 999; + Item.consumable = true; + Item.knockBack = 2.25f; + Item.value = Item.sellPrice(copper: 10); + Item.rare = ItemRarityID.LightRed; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 1f; + Item.ammo = AmmoID.Bullet; + } + + public override void AddRecipes() + { + CreateRecipe(999). + AddIngredient(ItemID.GoldenBullet, 999). + AddIngredient(ItemID.GoldCoin). + AddTile(TileID.Anvils). + Register(); + } + } +} diff --git a/Items/Ammo/MarksmanRound.png b/Items/Ammo/MarksmanRound.png new file mode 100644 index 0000000000000000000000000000000000000000..de0c458f7a7e9b70528e3fe1db2ab6bde1774d0c GIT binary patch literal 251 zcmeAS@N?(olHy`uVBq!ia0vp^JU}eP!3HFof9*{KQk(@Ik;M!QVyYm_=ozH)0Vp`x z)5S5Q;#RW7o!Q424i#?uW$;J7rS!><0}`?G8dG@J>!mgr`aC>8d-lN{<_9@@5~Y-L zL?s<&l<*p?PT*>|)@-=z@`>vVDh_l0?-q|}FuYKiz$5(r)J3-B8OIK;VO;j%|9R^K zo?s5+jv8JAHXo+8LaWXc-ouJ=2`8m(B`%sW7<%wBzm&?5zx?HLLti4-1;dk43`r@4 n?GL9|X#t(bmm1-j=IhG(), damage, knockback, player.whoAmI); - else - Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); - - return false; + type = ModContent.ProjectileType(); } } } diff --git a/Items/Weapons/Ranged/TyrannysEnd.cs b/Items/Weapons/Ranged/TyrannysEnd.cs index c3e83ca955..4196eccab0 100644 --- a/Items/Weapons/Ranged/TyrannysEnd.cs +++ b/Items/Weapons/Ranged/TyrannysEnd.cs @@ -5,7 +5,6 @@ using CalamityMod.Sounds; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using Terraria; -using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; @@ -17,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Ranged { DisplayName.SetDefault("Tyranny's End"); Tooltip.SetDefault("Pierce the heart of even the most heavily-armored foe\n" + - "Fires a .70 caliber sniper round that bypasses enemy defense and DR\n" + + "Converts musket balls into .70 caliber sniper rounds that bypass enemy defense and DR\n" + "Rounds mark enemies for death and summon a swarm of additional bullets on crits"); SacrificeTotal = 1; } @@ -61,10 +60,10 @@ namespace CalamityMod.Items.Weapons.Ranged Register(); } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) + public override void ModifyShootStats(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback) { - Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0f, 0f); - return false; + if (type == ProjectileID.Bullet) + type = ModContent.ProjectileType(); } } } diff --git a/Projectiles/Ranged/CrackshotBlast.cs b/Projectiles/Ranged/CrackshotBlast.cs index abb9c21869..811767179f 100644 --- a/Projectiles/Ranged/CrackshotBlast.cs +++ b/Projectiles/Ranged/CrackshotBlast.cs @@ -1,6 +1,5 @@ using System; using CalamityMod.Items.Weapons.Ranged; -using CalamityMod.Systems; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -21,7 +20,7 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { - DisplayName.SetDefault("Blast"); + DisplayName.SetDefault("Crack Shot"); ProjectileID.Sets.TrailCacheLength[Projectile.type] = TrailLenght; ProjectileID.Sets.TrailingMode[Projectile.type] = 0; ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 4000; diff --git a/Projectiles/Ranged/MidasBlast.cs b/Projectiles/Ranged/MidasBlast.cs index c4fb4b7897..079a41756f 100644 --- a/Projectiles/Ranged/MidasBlast.cs +++ b/Projectiles/Ranged/MidasBlast.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Ranged public override void SetStaticDefaults() { - DisplayName.SetDefault("Blast"); + DisplayName.SetDefault("Marksman Shot"); ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 4000; } From 2ef1c35912ae6b27204c9838ad6d1619e8b63bb4 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Mon, 23 Jan 2023 20:12:23 -0600 Subject: [PATCH 2/3] 1 - Guardian funyun shields and balancing. 2 - Astrum Aureus jump sound fix. --- ExtraTextures/GreyscaleOpenCircle.png | Bin 0 -> 1424 bytes NPCs/AstrumAureus/AstrumAureus.cs | 4 +- NPCs/AstrumAureus/AureusSpawn.cs | 2 +- .../ProfanedGuardianCommander.cs | 111 ++++++++++++++++-- .../ProfanedGuardianDefender.cs | 98 ++++++++++++++-- NPCs/ProfanedGuardians/ProfanedRocks.cs | 7 +- NPCs/Providence/Providence.cs | 2 +- Projectiles/Boss/HolyFire.cs | 6 +- Sounds/Custom/{ => AstrumAureus}/LegStomp.ogg | Bin 9 files changed, 202 insertions(+), 28 deletions(-) create mode 100644 ExtraTextures/GreyscaleOpenCircle.png rename Sounds/Custom/{ => AstrumAureus}/LegStomp.ogg (100%) diff --git a/ExtraTextures/GreyscaleOpenCircle.png b/ExtraTextures/GreyscaleOpenCircle.png new file mode 100644 index 0000000000000000000000000000000000000000..ced20e4e4cdad85b706b8be65343e31bab54df63 GIT binary patch literal 1424 zcmXw3dpO%y7(S82U86PXl2)`UkCqlmQMZIL3+1V>j;dP~s}vQw8J2`;jq8Aj;66D06>TQ zwI>By=K4@qh4WLlC_XfZ6pFV8XzImE;RY4w?&l7`-Cwj6QE0f|a`;e?7qt5N`g`~8 z4GRlvY;0UvSqX3;vH?J2$)4^(Y2kBKV}2*Rzwol%Viws+X6{R_V)EL@_Tj*g~Ik1 zQvoz%BHB`o3ige3WbU-zI>~o9zKG0?*EC{QN_8R&WxEs$3k$=qu}}DXKJo4ng8K7F z4-Uz~S0PxRhU!G)cm*8RZLqyv%c0qXgyEkv%h>qj)*lc!3 zG(NA$?3PiiZMHV4_cXG|+|5B+uaUHCShxB!XoGw$88)Y<4)~JG%wlq0nX?eQka5r; z$+(c@w=56{rj%{%?d_-9uS>*Yv0bJckvKmgniiKmHjZl1I00w|c+$xQs-9?%w7#Vr zg4TLGAW3!LQaU3bR8$_7umRvn^Ab}ZaiHY02f?KF+l6_VY)!oegTXKo+8rs0NlClq0PThr?$(-o4iMz~&JN!eI!bmxO#(skt6ydJJma&bt;<`T{ro$F$)YgArWBH=M+28O7BPLcK9M}zLK|pdH@B$F5YbrQzG$~*6 z|AXJPaO1g&^IlsQ1DyQV<0m^e*Y}mIR=-1Oxjgr{bgflnD}(r09O`QM+bh>T#&4Ow z7wf8X%8FCH-5heUX1*gdkQ9Mf%jD8~e_L&^i^}J^+{Gl-G)!;}+vxstN>1_>1W$Sd zOp=RRlLicyKFH!Ay#z#>MRt_wNqNC>dRubyMsP}c?xUR3YL@=0oE84tPMj=Qu$ukT z<1SIJQrKlGec5H2!Jz&KgJtO239g-$;P!?F{ZxnA!pCk!AERZnrtnD#9eDK_r>q#> z>V&DJX$_V~ekgzfPwJGWY5m4yw}^bE>99QtD{C?u(H}NVy7-8Uv_E4UkC)+uGXfiy zM%Q$GRyGXQq(+cRQB1{+Em3+}XNSW(Na5~Rhgg&0_B z4^6;eIT$oXe6Tx69mpz4vvFF2RS{>4WFFBAKH77K&`=lpUo>n-T#U-$c$Cekc0F0m z{(WTX0_53ig9KES{xS7p%E3YN@d6(g!>aY9@Z+GEvXdDeJ9Dli)y7wB4O6;l!WA1K z>bgO?$&M?hBMUdhlH0uCZBEGGNK}9P`S7}eO|iZkP&zU#7!Ue%Id?SFnk^;{s^X?2 pby#_E7msb)Kk|SF1}iHSY7IXzo{V`uFo1tgK=$(YZ1RZA{ula9g>wJ^ literal 0 HcmV?d00001 diff --git a/NPCs/AstrumAureus/AstrumAureus.cs b/NPCs/AstrumAureus/AstrumAureus.cs index eaf1f8a35a..cf9e250b90 100644 --- a/NPCs/AstrumAureus/AstrumAureus.cs +++ b/NPCs/AstrumAureus/AstrumAureus.cs @@ -35,8 +35,8 @@ namespace CalamityMod.NPCs.AstrumAureus public class AstrumAureus : ModNPC { public static readonly SoundStyle HitSound = new("CalamityMod/Sounds/NPCHit/AureusHit", 4); - public static readonly SoundStyle StompSound = new("CalamityMod/Sounds/Custom/LegStomp"); - public static readonly SoundStyle JumpSound = new("CalamityMod/Sounds/Custom/AureusJump"); + public static readonly SoundStyle StompSound = new("CalamityMod/Sounds/Custom/AstrumAureus/LegStomp"); + public static readonly SoundStyle JumpSound = new("CalamityMod/Sounds/Custom/AstrumAureus/AureusJump"); private bool stomping = false; public int slimeProjCounter = 0; diff --git a/NPCs/AstrumAureus/AureusSpawn.cs b/NPCs/AstrumAureus/AureusSpawn.cs index 55eb5d0ad4..9d4177cd7c 100644 --- a/NPCs/AstrumAureus/AureusSpawn.cs +++ b/NPCs/AstrumAureus/AureusSpawn.cs @@ -236,7 +236,7 @@ namespace CalamityMod.NPCs.AstrumAureus spriteEffects = SpriteEffects.FlipHorizontally; if (NPC.ai[0] >= 60f) - NPC.DrawBackglow(Color.Lerp(Color.Cyan, Color.Orange, (float)Math.Sin(Main.GlobalTimeWrappedHourly) / 2f + 1f) with { A = 0 }, 2f + 8f * ((float)Math.Sin(Main.GlobalTimeWrappedHourly * (float)Math.PI * 2f) + 1f), spriteEffects, NPC.frame, screenPos); + NPC.DrawBackglow(Color.Lerp(Color.Cyan, Color.Orange, (float)Math.Sin(Main.GlobalTimeWrappedHourly) / 2f + 1f) with { A = 0 }, 2f + 8f * ((float)Math.Sin(Main.GlobalTimeWrappedHourly * MathHelper.TwoPi) + 1f), spriteEffects, NPC.frame, screenPos); Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; Vector2 vector11 = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2); diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs index 43c8e50db7..2bd3053b3a 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs @@ -92,6 +92,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians writer.Write(spearType); writer.Write(healTimer); writer.Write(biomeEnrageTimer); + writer.Write(NPC.localAI[1]); + writer.Write(NPC.localAI[2]); } public override void ReceiveExtraAI(BinaryReader reader) @@ -99,6 +101,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians spearType = reader.ReadInt32(); healTimer = reader.ReadInt32(); biomeEnrageTimer = reader.ReadInt32(); + NPC.localAI[1] = reader.ReadSingle(); + NPC.localAI[2] = reader.ReadSingle(); } public override void FindFrame(int frameHeight) @@ -302,7 +306,35 @@ namespace CalamityMod.NPCs.ProfanedGuardians bool biomeEnraged = biomeEnrageTimer <= 0; bool phase1 = healerAlive || defenderAlive; - + + if (!phase1) + { + // Spawn particles when the defender dies to indicate the shield has broken apart + if (NPC.localAI[2] == 0f) + { + // Star Wrath use sound and dust circles + NPC.localAI[2] += 1f; + SoundEngine.PlaySound(SoundID.Item105, NPC.Center); + int shieldRings = 4; + int totalDust = 36; + for (int j = 0; j < shieldRings; j++) + { + for (int k = 0; k < totalDust; k++) + { + Vector2 dustSpawnPos = NPC.velocity.SafeNormalize(Vector2.UnitY) * new Vector2(320f, 320f); + dustSpawnPos = dustSpawnPos.RotatedBy((double)((k - (totalDust / 2 - 1)) * MathHelper.TwoPi / totalDust), default) + NPC.Center; + Vector2 dustVelocity = dustSpawnPos - NPC.Center; + Color dustColor = Main.hslToRgb(Main.rgbToHsl(Color.OrangeRed).X, 1f, 0.5f); + dustColor.A = 255; + int dust = Dust.NewDust(dustSpawnPos + dustVelocity, 0, 0, 267, dustVelocity.X, dustVelocity.Y, 0, dustColor, 1.4f); + Main.dust[dust].noGravity = true; + Main.dust[dust].noLight = true; + Main.dust[dust].velocity = dustVelocity * (j * 0.1f + 0.1f); + } + } + } + } + float inertia = (bossRush || biomeEnraged) ? 50f : death ? 60f : revenge ? 65f : expertMode ? 70f : 80f; if (lifeRatio < 0.5f) inertia *= 0.8f; @@ -352,11 +384,19 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Alternate between firing profaned spears and holy fire NPC.ai[3] += 1f; float projectileShootGateValue = (bossRush || biomeEnraged) ? 50f : death ? 66f : revenge ? 75f : expertMode ? 83f : 100f; + if (healerAlive) + projectileShootGateValue *= 2; + if (NPC.ai[3] % projectileShootGateValue == 0f) { bool shootSpears = NPC.ai[3] % (projectileShootGateValue * 2f) == 0f; float spearVelocity = (bossRush || biomeEnraged) ? 11f : death ? 10f : revenge ? 9.5f : expertMode ? 9f : 8f; Vector2 finalSpearVelocity = Vector2.Normalize(player.Center - shootFrom) * spearVelocity; + + int totalDustPerProjectile = 15; + for (int k = 0; k < totalDustPerProjectile; k++) + Dust.NewDust(shootFrom, 30, 30, (int)CalamityDusts.ProfanedFire, finalSpearVelocity.X, finalSpearVelocity.Y, 0, default, 1f); + if (Main.netMode != NetmodeID.MultiplayerClient) { int type = shootSpears ? ModContent.ProjectileType() : ModContent.ProjectileType(); @@ -370,7 +410,11 @@ namespace CalamityMod.NPCs.ProfanedGuardians for (int i = 0; i < baseProjectileAmt; i++) { Vector2 perturbedSpeed = finalSpearVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(baseProjectileAmt - 1))); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(perturbedSpeed) * 5f, perturbedSpeed, type, damage, 0f, Main.myPlayer); + + for (int k = 0; k < totalDustPerProjectile; k++) + Dust.NewDust(shootFrom, 30, 30, (int)CalamityDusts.ProfanedFire, perturbedSpeed.X, perturbedSpeed.Y, 0, default, 1f); + + Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, perturbedSpeed, type, damage, 0f, Main.myPlayer); } } } @@ -488,6 +532,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians spriteEffects = SpriteEffects.FlipHorizontally; Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; + Vector2 drawPos = NPC.Center - screenPos; Vector2 vector11 = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2); Color color36 = Color.White; float amount9 = 0.5f; @@ -510,7 +555,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians } } - Vector2 vector43 = NPC.Center - screenPos; + Vector2 vector43 = drawPos; vector43 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; vector43 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, vector43, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, vector11, NPC.scale, spriteEffects, 0f); @@ -540,6 +585,60 @@ namespace CalamityMod.NPCs.ProfanedGuardians spriteBatch.Draw(texture2D15, vector43, NPC.frame, color37, NPC.rotation, vector11, NPC.scale, spriteEffects, 0f); + bool defenderAlive = false; + bool healerAlive = false; + if (CalamityGlobalNPC.doughnutBossDefender != -1) + { + if (Main.npc[CalamityGlobalNPC.doughnutBossDefender].active) + defenderAlive = true; + } + if (CalamityGlobalNPC.doughnutBossHealer != -1) + { + if (Main.npc[CalamityGlobalNPC.doughnutBossHealer].active) + healerAlive = true; + } + + // Draw shields while healer or defender are alive + if (defenderAlive || healerAlive) + { + float maxOscillation = 60f; + float minScale = 0.8f; + float maxPulseScale = 1f - minScale; + float minOpacity = 0.5f; + float maxOpacityScale = 1f - minOpacity; + float currentOscillation = MathHelper.Lerp(0f, maxOscillation, ((float)Math.Sin(Main.GlobalTimeWrappedHourly * MathHelper.Pi) + 1f) * 0.5f); + float shieldOpacity = minOpacity + maxOpacityScale * Utils.Remap(currentOscillation, 0f, maxOscillation, 1f, 0f); + float oscillationRatio = currentOscillation / maxOscillation; + float invertedOscillationRatio = 1f - (1f - oscillationRatio) * (1f - oscillationRatio); + float oscillationScale = 1f - (1f - invertedOscillationRatio) * (1f - invertedOscillationRatio); + float remappedOscillation = Utils.Remap(currentOscillation, maxOscillation - 15f, maxOscillation, 0f, 1f); + float twoOscillationsMultipliedTogetherForScaleCalculation = remappedOscillation * remappedOscillation; + float invertedOscillationUsedForScale = MathHelper.Lerp(minScale, 1f, 1f - twoOscillationsMultipliedTogetherForScaleCalculation); + float shieldScale = (minScale + maxPulseScale * oscillationScale) * invertedOscillationUsedForScale; + float smallerRemappedOscillation = Utils.Remap(currentOscillation, 20f, maxOscillation, 0f, 1f); + float invertedSmallerOscillationRatio = 1f - (1f - smallerRemappedOscillation) * (1f - smallerRemappedOscillation); + float smallerOscillationScale = 1f - (1f - invertedSmallerOscillationRatio) * (1f - invertedSmallerOscillationRatio); + float shieldScale2 = (minScale + maxPulseScale * smallerOscillationScale) * invertedOscillationUsedForScale; + Texture2D shieldTexture = ModContent.Request("CalamityMod/ExtraTextures/GreyscaleOpenCircle").Value; + Rectangle shieldFrame = shieldTexture.Frame(); + Vector2 origin = shieldFrame.Size() * 0.5f; + Vector2 shieldDrawPos = NPC.Center - screenPos; + shieldDrawPos -= new Vector2(shieldTexture.Width, shieldTexture.Height) * NPC.scale / 2f; + shieldDrawPos += origin * NPC.scale + new Vector2(0f, NPC.gfxOffY); + float minHue = (defenderAlive && healerAlive) ? 0.18f : 0.06f; + float maxHue = minHue + 0.12f; + Color color = Main.hslToRgb(MathHelper.Lerp(maxHue - minHue, maxHue, ((float)Math.Sin(Main.GlobalTimeWrappedHourly * MathHelper.TwoPi) + 1f) * 0.5f), 1f, 0.5f) * shieldOpacity; + Color color2 = Main.hslToRgb(MathHelper.Lerp(minHue, maxHue - minHue, ((float)Math.Sin(Main.GlobalTimeWrappedHourly * MathHelper.Pi * 3f) + 1f) * 0.5f), 1f, 0.5f) * shieldOpacity; + color2.A = 0; + color *= 0.6f; + color2 *= 0.6f; + float scaleMult = 3f; + spriteBatch.Draw(shieldTexture, shieldDrawPos, shieldFrame, color, NPC.rotation, origin, shieldScale2 * scaleMult, SpriteEffects.None, 0f); + spriteBatch.Draw(shieldTexture, shieldDrawPos, shieldFrame, color2, NPC.rotation, origin, shieldScale2 * scaleMult * 0.95f, SpriteEffects.None, 0f); + spriteBatch.Draw(shieldTexture, shieldDrawPos, shieldFrame, color, NPC.rotation, origin, shieldScale * scaleMult, SpriteEffects.None, 0f); + spriteBatch.Draw(shieldTexture, shieldDrawPos, shieldFrame, color2, NPC.rotation, origin, shieldScale * scaleMult * 0.95f, SpriteEffects.None, 0f); + } + return false; } @@ -591,9 +690,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 5; k++) - { Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f); - } + if (NPC.life <= 0) { if (Main.netMode != NetmodeID.Server) @@ -603,10 +701,9 @@ namespace CalamityMod.NPCs.ProfanedGuardians Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ProfanedGuardianBossA3").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ProfanedGuardianBossA4").Type, 1f); } + for (int k = 0; k < 50; k++) - { Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f); - } } } } diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs b/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs index cd3155b38f..a9d0748b7e 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs @@ -11,6 +11,8 @@ using System.IO; using Terraria; using Terraria.GameContent; using Terraria.GameContent.Bestiary; +using Terraria.GameContent.Drawing; +using Terraria.Graphics.Renderers; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; @@ -85,6 +87,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians writer.Write(healTimer); writer.Write(biomeEnrageTimer); writer.Write(NPC.localAI[0]); + writer.Write(NPC.localAI[1]); } public override void ReceiveExtraAI(BinaryReader reader) @@ -92,6 +95,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians healTimer = reader.ReadInt32(); biomeEnrageTimer = reader.ReadInt32(); NPC.localAI[0] = reader.ReadSingle(); + NPC.localAI[1] = reader.ReadSingle(); } public override void FindFrame(int frameHeight) @@ -255,7 +259,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians int rockRings = 3; int totalRocksPerRing = maxRocks / rockRings; int spacing = 360 / totalRocksPerRing; - int distance2 = 80; + int distance2 = 200; bool justSpawnedRocks = false; if (NPC.localAI[0] == 0f || respawnRocksInPhase2) { @@ -300,6 +304,34 @@ namespace CalamityMod.NPCs.ProfanedGuardians } } + // Spawn particles when the healer dies to indicate the shield has broken apart + else + { + if (NPC.localAI[1] == 0f) + { + // Star Wrath use sound and dust circles + NPC.localAI[1] += 1f; + SoundEngine.PlaySound(SoundID.Item105, NPC.Center); + int shieldRings = 4; + int totalDust = 36; + for (int j = 0; j < shieldRings; j++) + { + for (int k = 0; k < totalDust; k++) + { + Vector2 dustSpawnPos = NPC.velocity.SafeNormalize(Vector2.UnitY) * new Vector2(320f, 320f); + dustSpawnPos = dustSpawnPos.RotatedBy((double)((k - (totalDust / 2 - 1)) * MathHelper.TwoPi / totalDust), default) + NPC.Center; + Vector2 dustVelocity = dustSpawnPos - NPC.Center; + Color dustColor = Main.hslToRgb(Main.rgbToHsl(Color.OrangeRed).X, 1f, 0.5f); + dustColor.A = 255; + int dust = Dust.NewDust(dustSpawnPos + dustVelocity, 0, 0, 267, dustVelocity.X, dustVelocity.Y, 0, dustColor, 1.4f); + Main.dust[dust].noGravity = true; + Main.dust[dust].noLight = true; + Main.dust[dust].velocity = dustVelocity * (j * 0.1f + 0.1f); + } + } + } + } + // Spawn three dust circles and play noise whenever rock shields are spawned if (justSpawnedRocks) { @@ -310,7 +342,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians { for (int k = 0; k < totalDust; k++) { - Vector2 dustSpawnPos = NPC.velocity.SafeNormalize(Vector2.UnitY) * new Vector2(80f, 160f) * 0.75f; + Vector2 dustSpawnPos = NPC.velocity.SafeNormalize(Vector2.UnitY) * new Vector2(distance2, distance2); dustSpawnPos = dustSpawnPos.RotatedBy((double)((k - (totalDust / 2 - 1)) * MathHelper.TwoPi / totalDust), default) + NPC.Center; Vector2 dustVelocity = dustSpawnPos - NPC.Center; Color dustColor = Main.hslToRgb(Main.rgbToHsl(Color.Orange).X, 1f, 0.5f); @@ -371,10 +403,11 @@ namespace CalamityMod.NPCs.ProfanedGuardians } // Lay a holy bomb every once in a while in phase 1 - float projectileShootGateValue = (bossRush || biomeEnraged) ? 360f : death ? 400f : revenge ? 420f : expertMode ? 440f : 480f; + float projectileShootGateValue = (bossRush || biomeEnraged) ? 480f : death ? 520f : revenge ? 540f : expertMode ? 560f : 600f; NPC.ai[1] += 1f; if (NPC.ai[1] >= projectileShootGateValue) { + NPC.ai[1] = 0f; if (Main.netMode != NetmodeID.MultiplayerClient) { float projectileVelocityY = NPC.velocity.Y; @@ -513,7 +546,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians int totalDust = 36; for (int k = 0; k < totalDust; k++) { - Vector2 dustSpawnPos = NPC.velocity.SafeNormalize(Vector2.UnitY) * new Vector2(80f, 160f) * 0.75f; + Vector2 dustSpawnPos = NPC.velocity.SafeNormalize(Vector2.UnitY) * new Vector2(160f, 160f); dustSpawnPos = dustSpawnPos.RotatedBy((double)((k - (totalDust / 2 - 1)) * MathHelper.TwoPi / totalDust), default) + shootFrom; Vector2 dustVelocity = dustSpawnPos - shootFrom; int dust = Dust.NewDust(dustSpawnPos + dustVelocity, 0, 0, (int)CalamityDusts.ProfanedFire, dustVelocity.X, dustVelocity.Y, 0, default, 1f); @@ -603,6 +636,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians spriteEffects = SpriteEffects.FlipHorizontally; Texture2D texture2D15 = TextureAssets.Npc[NPC.type].Value; + Vector2 drawPos = NPC.Center - screenPos; Vector2 vector11 = new Vector2(TextureAssets.Npc[NPC.type].Value.Width / 2, TextureAssets.Npc[NPC.type].Value.Height / Main.npcFrameCount[NPC.type] / 2); Color color36 = Color.White; float amount9 = 0.5f; @@ -625,7 +659,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians } } - Vector2 vector43 = NPC.Center - screenPos; + Vector2 vector43 = drawPos; vector43 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[NPC.type]) * NPC.scale / 2f; vector43 += vector11 * NPC.scale + new Vector2(0f, NPC.gfxOffY); spriteBatch.Draw(texture2D15, vector43, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, vector11, NPC.scale, spriteEffects, 0f); @@ -655,6 +689,54 @@ namespace CalamityMod.NPCs.ProfanedGuardians spriteBatch.Draw(texture2D15, vector43, NPC.frame, color37, NPC.rotation, vector11, NPC.scale, spriteEffects, 0f); + bool healerAlive = false; + if (CalamityGlobalNPC.doughnutBossHealer != -1) + { + if (Main.npc[CalamityGlobalNPC.doughnutBossHealer].active) + healerAlive = true; + } + + // Draw shields while healer is alive + if (healerAlive) + { + float maxOscillation = 60f; + float minScale = 0.8f; + float maxPulseScale = 1f - minScale; + float minOpacity = 0.5f; + float maxOpacityScale = 1f - minOpacity; + float currentOscillation = MathHelper.Lerp(0f, maxOscillation, ((float)Math.Sin(Main.GlobalTimeWrappedHourly * MathHelper.Pi) + 1f) * 0.5f); + float shieldOpacity = minOpacity + maxOpacityScale * Utils.Remap(currentOscillation, 0f, maxOscillation, 1f, 0f); + float oscillationRatio = currentOscillation / maxOscillation; + float invertedOscillationRatio = 1f - (1f - oscillationRatio) * (1f - oscillationRatio); + float oscillationScale = 1f - (1f - invertedOscillationRatio) * (1f - invertedOscillationRatio); + float remappedOscillation = Utils.Remap(currentOscillation, maxOscillation - 15f, maxOscillation, 0f, 1f); + float twoOscillationsMultipliedTogetherForScaleCalculation = remappedOscillation * remappedOscillation; + float invertedOscillationUsedForScale = MathHelper.Lerp(minScale, 1f, 1f - twoOscillationsMultipliedTogetherForScaleCalculation); + float shieldScale = (minScale + maxPulseScale * oscillationScale) * invertedOscillationUsedForScale; + float smallerRemappedOscillation = Utils.Remap(currentOscillation, 20f, maxOscillation, 0f, 1f); + float invertedSmallerOscillationRatio = 1f - (1f - smallerRemappedOscillation) * (1f - smallerRemappedOscillation); + float smallerOscillationScale = 1f - (1f - invertedSmallerOscillationRatio) * (1f - invertedSmallerOscillationRatio); + float shieldScale2 = (minScale + maxPulseScale * smallerOscillationScale) * invertedOscillationUsedForScale; + Texture2D shieldTexture = ModContent.Request("CalamityMod/ExtraTextures/GreyscaleOpenCircle").Value; + Rectangle shieldFrame = shieldTexture.Frame(); + Vector2 origin = shieldFrame.Size() * 0.5f; + Vector2 shieldDrawPos = NPC.Center - screenPos; + shieldDrawPos -= new Vector2(shieldTexture.Width, shieldTexture.Height) * NPC.scale / 2f; + shieldDrawPos += origin * NPC.scale + new Vector2(0f, NPC.gfxOffY); + float minHue = 0.06f; + float maxHue = 0.18f; + Color color = Main.hslToRgb(MathHelper.Lerp(maxHue - minHue, maxHue, ((float)Math.Sin(Main.GlobalTimeWrappedHourly * MathHelper.TwoPi) + 1f) * 0.5f), 1f, 0.5f) * shieldOpacity; + Color color2 = Main.hslToRgb(MathHelper.Lerp(minHue, maxHue - minHue, ((float)Math.Sin(Main.GlobalTimeWrappedHourly * MathHelper.Pi * 3f) + 1f) * 0.5f), 1f, 0.5f) * shieldOpacity; + color2.A = 0; + color *= 0.6f; + color2 *= 0.6f; + float scaleMult = 3f; + spriteBatch.Draw(shieldTexture, shieldDrawPos, shieldFrame, color, NPC.rotation, origin, shieldScale2 * scaleMult, SpriteEffects.None, 0f); + spriteBatch.Draw(shieldTexture, shieldDrawPos, shieldFrame, color2, NPC.rotation, origin, shieldScale2 * scaleMult * 0.95f, SpriteEffects.None, 0f); + spriteBatch.Draw(shieldTexture, shieldDrawPos, shieldFrame, color, NPC.rotation, origin, shieldScale * scaleMult, SpriteEffects.None, 0f); + spriteBatch.Draw(shieldTexture, shieldDrawPos, shieldFrame, color2, NPC.rotation, origin, shieldScale * scaleMult * 0.95f, SpriteEffects.None, 0f); + } + return false; } @@ -692,9 +774,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 5; k++) - { Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f); - } + if (NPC.life <= 0) { if (Main.netMode != NetmodeID.Server) @@ -704,10 +785,9 @@ namespace CalamityMod.NPCs.ProfanedGuardians Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ProfanedGuardianBossT3").Type, 1f); Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ProfanedGuardianBossT4").Type, 1f); } + for (int k = 0; k < 50; k++) - { Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f); - } } } } diff --git a/NPCs/ProfanedGuardians/ProfanedRocks.cs b/NPCs/ProfanedGuardians/ProfanedRocks.cs index 9589b33571..9ea03aa735 100644 --- a/NPCs/ProfanedGuardians/ProfanedRocks.cs +++ b/NPCs/ProfanedGuardians/ProfanedRocks.cs @@ -8,7 +8,6 @@ using System; using System.IO; using Terraria; using Terraria.Audio; -using Terraria.GameContent; using Terraria.GameContent.Bestiary; using Terraria.ID; using Terraria.ModLoader; @@ -19,9 +18,9 @@ namespace CalamityMod.NPCs.ProfanedGuardians { private int invinceTime = 180; private bool start = true; - private const double MinDistance = 80D; + private const double MinDistance = 200D; private double distance = MinDistance; - private const double MinMaxDistance = 320D; + private const double MinMaxDistance = 300D; public const int MaxHP = 12000; public const int MaxBossRushHP = 20000; @@ -252,7 +251,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians } // Distance from Defender Guardian - double maxDistance = bossRush ? 380D : death ? 360D : revenge ? 350D : expertMode ? 340D : MinMaxDistance; + double maxDistance = bossRush ? 360D : death ? 340D : revenge ? 330D : expertMode ? 320D : MinMaxDistance; double rateOfChangeIncrease = (maxDistance / MinMaxDistance) - 1D; double rateOfChange = (NPC.ai[1] * 0.5f) + 2D + rateOfChangeIncrease; if (NPC.Calamity().newAI[0] == 0f) diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index 2c565cff36..587d678787 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -1525,7 +1525,7 @@ namespace CalamityMod.NPCs.Providence int circleDustSpawned = 0; for (int k = 0; k < totalDust; k++) { - Vector2 dustSpawnPos = Vector2.Normalize(NPC.velocity) * new Vector2(80f, 160f) * 0.75f; + Vector2 dustSpawnPos = Vector2.Normalize(NPC.velocity) * new Vector2(80f, 160f); dustSpawnPos = dustSpawnPos.RotatedBy((double)((k - (totalDust / 2 - 1)) * MathHelper.TwoPi / totalDust), default) + dustLineEnd; Vector2 dustVelocity = dustSpawnPos - dustLineEnd; Color dustColor = Main.hslToRgb(Main.rgbToHsl(nightAI ? new Color(100, 200, 250) : new Color(255, 200, Math.Abs(Math.Abs(blue) - (int)(circleDustSpawned * 7.08f)))).X, 1f, 0.5f); diff --git a/Projectiles/Boss/HolyFire.cs b/Projectiles/Boss/HolyFire.cs index 3d8c836c96..879d7ad87a 100644 --- a/Projectiles/Boss/HolyFire.cs +++ b/Projectiles/Boss/HolyFire.cs @@ -48,11 +48,11 @@ namespace CalamityMod.Projectiles.Boss Projectile.ai[1] = 1f; SoundEngine.PlaySound(SoundID.Item20, Projectile.position); } + Projectile.alpha -= (Projectile.maxPenetrate != (int)Providence.BossMode.Day) ? 10 : 5; if (Projectile.alpha <= 0) - { Projectile.Kill(); - } + Projectile.frameCounter++; if (Projectile.frameCounter > 6) { @@ -60,9 +60,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.frameCounter = 0; } if (Projectile.frame > 3) - { Projectile.frame = 0; - } } public override Color? GetAlpha(Color lightColor) diff --git a/Sounds/Custom/LegStomp.ogg b/Sounds/Custom/AstrumAureus/LegStomp.ogg similarity index 100% rename from Sounds/Custom/LegStomp.ogg rename to Sounds/Custom/AstrumAureus/LegStomp.ogg From 026ba75fc672f46e40579512757d7a03451556a1 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Mon, 23 Jan 2023 21:14:02 -0500 Subject: [PATCH 3/3] fixed description errata --- Items/Ammo/MarksmanRound.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Ammo/MarksmanRound.cs b/Items/Ammo/MarksmanRound.cs index eda2d7d86a..8938576984 100644 --- a/Items/Ammo/MarksmanRound.cs +++ b/Items/Ammo/MarksmanRound.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Ammo { SacrificeTotal = 99; DisplayName.SetDefault("Marksman Round"); - Tooltip.SetDefault("A carefully crafted round which can be ricocheted off of midair coins\nAny gun firing this weapon can perform Ricoshots with coins from Crackshot Colt or Midas Prime"); + Tooltip.SetDefault("A carefully crafted round which can be ricocheted off of midair coins\nAny gun firing this bullet can perform Ricoshots with coins tossed using Midas Prime"); } public override void SetDefaults()