From 63dd68e8bf36b7a6de90a37f5844b8f14ea1efec Mon Sep 17 00:00:00 2001 From: Mishiro Usui Date: Mon, 25 Sep 2023 17:42:45 +0100 Subject: [PATCH] Reworked the cooldown + further tweaks --- CalPlayer/CalamityPlayerHitHurt.cs | 6 +-- ...ParryCooldown.png => BlazingCoreParry.png} | Bin ...utline.png => BlazingCoreParryOutline.png} | Bin ...verlay.png => BlazingCoreParryOverlay.png} | Bin Cooldowns/FlameLickedShellParry.png | Bin 0 -> 465 bytes Cooldowns/FlameLickedShellParryOutline.png | Bin 0 -> 215 bytes Cooldowns/FlameLickedShellParryOverlay.png | Bin 0 -> 200 bytes Cooldowns/ParryCooldown.cs | 37 +++++++++++++++--- Items/Accessories/FlameLickedShell.cs | 2 +- 9 files changed, 36 insertions(+), 9 deletions(-) rename Cooldowns/{ParryCooldown.png => BlazingCoreParry.png} (100%) rename Cooldowns/{ParryCooldownOutline.png => BlazingCoreParryOutline.png} (100%) rename Cooldowns/{ParryCooldownOverlay.png => BlazingCoreParryOverlay.png} (100%) create mode 100644 Cooldowns/FlameLickedShellParry.png create mode 100644 Cooldowns/FlameLickedShellParryOutline.png create mode 100644 Cooldowns/FlameLickedShellParryOverlay.png diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index 3b60e7ed03..bccf0c91a6 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -1617,7 +1617,7 @@ namespace CalamityMod.CalPlayer SoundEngine.PlaySound(BlazingCore.ParrySuccessSound, Player.Center); blazingCoreSuccessfulParry = 60; - Player.AddCooldown(ParryCooldown.ID, 60 * 30, false); //cooldown is frames in seconds multiplied by the desired amount of seconds + Player.AddCooldown(ParryCooldown.ID, 60 * 30, false, "blazingcore"); //cooldown is frames in seconds multiplied by the desired amount of seconds } if (blazingCoreParry > 1) @@ -1631,12 +1631,12 @@ namespace CalamityMod.CalPlayer { Player.GiveIFrames(60, true); flameLickedShellEmpoweredParry = true; - modifiers.SourceDamage *= 0.1f; //90% dr + modifiers.SourceDamage.Flat *= 0.1f; //90% dr modifiers.DisableSound(); } SoundEngine.PlaySound(ProfanedGuardianDefender.ShieldDeathSound, Player.Center); - Player.AddCooldown(ParryCooldown.ID, 60 * 20, false); + Player.AddCooldown(ParryCooldown.ID, 60 * 20, false, "flamelickedshell"); FlameLickedShell.handleParry(Player); } } diff --git a/Cooldowns/ParryCooldown.png b/Cooldowns/BlazingCoreParry.png similarity index 100% rename from Cooldowns/ParryCooldown.png rename to Cooldowns/BlazingCoreParry.png diff --git a/Cooldowns/ParryCooldownOutline.png b/Cooldowns/BlazingCoreParryOutline.png similarity index 100% rename from Cooldowns/ParryCooldownOutline.png rename to Cooldowns/BlazingCoreParryOutline.png diff --git a/Cooldowns/ParryCooldownOverlay.png b/Cooldowns/BlazingCoreParryOverlay.png similarity index 100% rename from Cooldowns/ParryCooldownOverlay.png rename to Cooldowns/BlazingCoreParryOverlay.png diff --git a/Cooldowns/FlameLickedShellParry.png b/Cooldowns/FlameLickedShellParry.png new file mode 100644 index 0000000000000000000000000000000000000000..b8325b15dbd4dec4a8cc679492c77427af20e4a9 GIT binary patch literal 465 zcmV;?0WSWDP)Px$aY;l$R5*>rlrcy`Q51&17a>MNkdq-qLk$*0Lt#ooL157mI441CZjDV%(N^FT zNXSDmmslT3V~5WBrdn%y@S5X8*F&>FZZ5%&bfT|+;cDVDW$SXsjTWZ zexTpL-)c}_h=oR6R5$rJ0Gad~0IImA02WiGE3e%8GkciF!&{*04AZcC#P_nK7*j!$4#b4ju z`%EmiSvM;RAYnCtZf)1&A2zX*Aaz^8F_k>7??Kc2h|JPVxny`%-ms(ccrxZObnwznE@I7yKWw zE;)fNoluu=#6L-lh>sOx{Bi&Q01jnXNoGw=04e|g00;m8000000Mb*F00000NkvXX Hu0mjf=@Zo "ParryCooldown"; public override bool ShouldDisplay => true; - public override bool SavedWithPlayer => false; public override LocalizedText DisplayName => CalamityUtils.GetText($"UI.Cooldowns.{ID}"); - public override string Texture => "CalamityMod/Cooldowns/ParryCooldown"; - public override Color OutlineColor => new Color(255, 191, 73); - public override Color CooldownStartColor => new Color(181, 136, 177); - public override Color CooldownEndColor => new Color(255, 194, 161); + public override string Texture => "CalamityMod/Cooldowns/" + skinTexture; + public override Color OutlineColor => outlineColor; + public override Color CooldownStartColor => cooldownColorStart; + public override Color CooldownEndColor => cooldownColorEnd; + + //It's the same cooldown with different skins each time, basically. + public string skinTexture; + public Color outlineColor; + public Color cooldownColorStart; + public Color cooldownColorEnd; + + public ParryCooldown() : this("") { } + public ParryCooldown(string skin) + { + switch (skin) + { + case "blazingcore": + skinTexture = "BlazingCoreParry"; + outlineColor = new Color(255, 191, 73); + cooldownColorStart = new Color(181, 136, 177); + cooldownColorEnd = new Color(255, 194, 161); + break; + + case "flamelickedshell": + skinTexture = "FlameLickedShellParry"; + outlineColor = new Color(211, 124, 93); + cooldownColorStart = Color.Lerp(new Color(107, 6, 6), new Color(228, 78, 78), 1 - (instance?.Completion ?? 0)); + cooldownColorEnd = Color.Lerp(new Color(107, 6, 6), new Color(228, 78, 78), 1 - (instance?.Completion ?? 0)); + break; + } + } } } diff --git a/Items/Accessories/FlameLickedShell.cs b/Items/Accessories/FlameLickedShell.cs index 61d9d47c7b..a54c62dff8 100644 --- a/Items/Accessories/FlameLickedShell.cs +++ b/Items/Accessories/FlameLickedShell.cs @@ -64,7 +64,7 @@ namespace CalamityMod.Items.Accessories { float radians = j - (totalProjectiles - 1f) / 2f; Vector2 offset = velocity.RotatedBy(offsetAngle * radians); - int proj = Projectile.NewProjectile(player.GetSource_FromThis(), player.Center + offset, projectileVelocity * 1.05f, type, damage, 2f, Main.myPlayer); + Projectile.NewProjectile(player.GetSource_FromThis(), player.Center + offset, projectileVelocity * 1.5f, type, damage, 2f, Main.myPlayer); } } totalProjectiles = 12;