Parries cancel hits

Note that Cancelled HurtInfo automatically do not run hooks
This commit is contained in:
Altixal committed 2024-12-04 18:05:20 +07:00
1 parent e58286afee
commit d002e1c95e
3 files changed
+8 -8

No files matched your search

+3 -6
View File
@@ -896,8 +896,6 @@ namespace CalamityMod.CalPlayer
#region Modify Hit By Proj
public override void ModifyHitByProjectile(Projectile proj, ref Player.HurtModifiers modifiers)
{
// TODO -- Evolution dodge isn't actually a dodge and you'll still get hit for 1.
// This should probably be changed so that when the evolution reflects it gives you 1 frame of guaranteed free dodging everything.
if (!ProjectileDestroyExceptionsList.Includes(proj.type) && proj.active && !proj.friendly && proj.hostile && proj.damage > 0)
{
double dodgeDamageGateValuePercent = 0.05;
@@ -929,7 +927,7 @@ namespace CalamityMod.CalPlayer
int evolutionIFrames = Player.ComputeReflectIFrames();
Player.GiveUniversalIFrames(evolutionIFrames, true);
modifiers.SetMaxDamage(1);
modifiers.Cancel();
evolutionLifeRegenCounter = 300;
projTypeJustHitBy = proj.type;
@@ -1506,8 +1504,7 @@ namespace CalamityMod.CalPlayer
theBeeCooldown = TheBee.CooldownLength;
}
// TODO: If possible, find a way to make it so parries don't activate the hit
if (rOfResilienceCooldown == 0 && rOfResilienceEffect > 0 && hurtInfo.Damage > 1)
if (rOfResilienceCooldown == 0 && rOfResilienceEffect > 0)
{
int cooldownTime = (Player.Calamity().profanedSoulRelicBuff ? 300 : 600);
rOfResilienceCooldown = cooldownTime;
@@ -1812,7 +1809,7 @@ namespace CalamityMod.CalPlayer
blazingCoreEmpoweredParry = true;
modifiers.SetMaxDamage(1); //ONLY REDUCE DAMAGE IF NOT ON COOLDOWN
modifiers.Cancel();
modifiers.DisableSound(); //prevents hurt sound from playing, had no idea this was a thing
}
@@ -310,7 +310,7 @@ BlazingCore: {
The searing core of the Profaned Goddess
Pressing [KEY] will activate a parry, encasing you in luminous profaned crystal
Being hit shortly after encasement will shatter the crystal
Upon shattering, holy stars spiral outwards and you only take 1 damage
Upon shattering, holy stars spiral outwards and damage taken is negated
After shattering, this damage reduction effect goes on cooldown
Damage parried whilst on cooldown summons additional healing stars, and will not be reduced
{$Common.AbyssLightLevel2}
@@ -1863,7 +1863,7 @@ TheEvolution: {
DisplayName: The Evolution
Tooltip:
'''
Reflects projectiles that hit you, reducing their damage to 1 and dealing 10x damage to enemies
Reflects projectiles that hit you, negating their damage and dealing 10x damage to enemies
Projectiles that deal less than 5% of your max life in damage will not be reflected
The reflect has a cooldown that ranges between 15 and 90 seconds depending on the reflected projectile's damage
This cooldown is shared with all other dodges and reflects
+3
View File
@@ -2929,6 +2929,9 @@ namespace CalamityMod.NPCs.Providence
// Shortcut function for applying Burden Breaker-like negative healing to GFB Providence
public static void ApplyGFBDamage(Projectile proj, int BaseDuration, int NegativeHealValue)
{
if (!Main.zenithWorld)
return;
int index = Player.FindClosest(proj.position, proj.width, proj.height);
Player player = Main.player[index];
if (player is null)