Tainted and Hellbound fixes hopefully
- Changed Hellbound's check to minions to allow multi-part minions like Entropy's Vigil to all be explodable - Damage scaling should now work properly on both enchants
This commit is contained in:
1 parent
ba3ff4e397
commit
7a416ff2fe
4 files changed
+27
-11
No files matched your search
@@ -553,15 +553,23 @@ namespace CalamityMod.ILEditing
|
||||
if (Main.gameMenu || !player.active)
|
||||
return proj;
|
||||
|
||||
// Do not apply Hellbound effects to minions not spawned by the item itself, if it came out of an item
|
||||
// This prevent minions like Luxor's Gift getting it, but minions spawned out of minions such as Temporal Umbrella will work fine
|
||||
if (spawnSource is EntitySource_ItemUse && player.ActiveItem().shoot != projectile.type)
|
||||
// Do not apply Hellbound effects to minions not spawned by weapons
|
||||
// This prevent minions like Luxor's Gift getting it
|
||||
if (spawnSource is EntitySource_ItemUse trueSource && trueSource.Item is Item weapon && weapon.damage <= 0)
|
||||
return proj;
|
||||
|
||||
CalamityPlayer.EnchantHeldItemEffects(player, player.Calamity(), player.ActiveItem());
|
||||
if (player.Calamity().explosiveMinionsEnchant)
|
||||
projectile.Calamity().ExplosiveEnchantCountdown = CalamityGlobalProjectile.ExplosiveEnchantTime;
|
||||
}
|
||||
// Minion shots inherit the "explode countdown" from the parent minion
|
||||
// This is only to inherit the damage scaling of the minion and does NOT mean the shot will explode too
|
||||
else if (ProjectileID.Sets.MinionShot[projectile.type])
|
||||
{
|
||||
// Going down the chain
|
||||
if (spawnSource is EntitySource_Parent trueSource && trueSource.Entity is Projectile parent)
|
||||
projectile.Calamity().ExplosiveEnchantCountdown = parent.Calamity().ExplosiveEnchantCountdown;
|
||||
}
|
||||
return proj;
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -302,7 +302,6 @@ namespace CalamityMod.Projectiles
|
||||
if (projectile.minion && ExplosiveEnchantCountdown > 0)
|
||||
{
|
||||
ExplosiveEnchantCountdown--;
|
||||
projectile.damage = (int)(projectile.originalDamage * MathHelper.SmoothStep(1f, 1.6f, 1f - ExplosiveEnchantCountdown / (float)ExplosiveEnchantTime));
|
||||
|
||||
// Make fizzle sounds and fire dust to indicate the impending explosion.
|
||||
if (ExplosiveEnchantCountdown <= 300)
|
||||
@@ -4307,6 +4306,10 @@ namespace CalamityMod.Projectiles
|
||||
if (modPlayer.flamingItemEnchant && !projectile.minion && !projectile.npcProj && !projectile.Calamity().CreatedByPlayerDash)
|
||||
target.AddBuff(BuffType<VulnerabilityHex>(), VulnerabilityHex.AflameDuration);
|
||||
|
||||
// This can apply to minions or minion shots
|
||||
if (ExplosiveEnchantCountdown > 0)
|
||||
modifiers.SourceDamage *= MathHelper.SmoothStep(1f, 1.6f, 1f - ExplosiveEnchantCountdown / (float)ExplosiveEnchantTime);
|
||||
|
||||
if (modPlayer.farProximityRewardEnchant)
|
||||
{
|
||||
float proximityDamageInterpolant = Utils.GetLerpValue(250f, 2400f, target.Distance(player.Center), true);
|
||||
|
||||
@@ -120,6 +120,7 @@ namespace CalamityMod.Projectiles.Melee
|
||||
Projectile.timeLeft = 90000;
|
||||
Projectile.usesLocalNPCImmunity = true;
|
||||
Projectile.noEnchantmentVisuals = true;
|
||||
Projectile.ContinuouslyUpdateDamageStats = true;
|
||||
}
|
||||
|
||||
public override void SendExtraAI(BinaryWriter writer) => writer.Write(VerticalOffset);
|
||||
|
||||
@@ -235,14 +235,18 @@ namespace CalamityMod.UI.CalamitasEnchants
|
||||
// Yes, this is a LOT of damage but given the limited range of this thing it needs to be extremely powerful when it does actually hit.
|
||||
var source = player.GetSource_ItemUse(player.ActiveItem());
|
||||
float taintedRatio = 5f;
|
||||
int damage = (int)player.GetTotalDamage<MeleeDamageClass>().ApplyTo(player.ActiveItem().damage * taintedRatio);
|
||||
int blade = Projectile.NewProjectile(source, player.Center, Vector2.Zero, ModContent.ProjectileType<TaintedBladeSlasher>(), damage, 0f, player.whoAmI, 0f, player.ActiveItem().type);
|
||||
if (Main.projectile.IndexInRange(blade))
|
||||
Main.projectile[blade].localAI[0] = 0f;
|
||||
int damage = (int)(player.ActiveItem().damage * taintedRatio);
|
||||
Projectile blade = Projectile.NewProjectileDirect(source, player.Center, Vector2.Zero, ModContent.ProjectileType<TaintedBladeSlasher>(), damage, 0f, player.whoAmI, 0f, player.ActiveItem().type);
|
||||
blade.localAI[0] = 0f;
|
||||
blade.originalDamage = damage;
|
||||
blade.OriginalArmorPenetration = player.ActiveItem().ArmorPenetration;
|
||||
blade.OriginalCritChance = player.ActiveItem().crit;
|
||||
|
||||
blade = Projectile.NewProjectile(source, player.Center, Vector2.Zero, ModContent.ProjectileType<TaintedBladeSlasher>(), damage, 0f, player.whoAmI, 1f, player.ActiveItem().type);
|
||||
if (Main.projectile.IndexInRange(blade))
|
||||
Main.projectile[blade].localAI[0] = -80f;
|
||||
blade = Projectile.NewProjectileDirect(source, player.Center, Vector2.Zero, ModContent.ProjectileType<TaintedBladeSlasher>(), damage, 0f, player.whoAmI, 1f, player.ActiveItem().type);
|
||||
blade.localAI[0] = -80f;
|
||||
blade.originalDamage = damage;
|
||||
blade.OriginalArmorPenetration = player.ActiveItem().ArmorPenetration;
|
||||
blade.OriginalCritChance = player.ActiveItem().crit;
|
||||
}
|
||||
},
|
||||
item => item.IsEnchantable() && item.damage > 0 && item.CountsAsClass<MeleeDamageClass>() && !item.noUseGraphic && item.shoot > ProjectileID.None),
|
||||
|
||||
Reference in new issue
Block a user