npcs dont count

This commit is contained in:
Altixal committed 2024-10-23 23:19:28 +07:00
1 parent 36a97c2269
commit bb5d5cb9da
3 files changed
+12 -4

No files matched your search

+4
View File
@@ -563,6 +563,10 @@ namespace CalamityMod.ILEditing
if (item.type != ModContent.ItemType<WulfrumFusionCannon>())
projectile.Calamity().buffedByOldFashioned = false;
}
// Projectiles spawned by NPCs do not count
// It will neither be buffed nor debuffed
else if (parentSource.Entity is NPC parentNPC)
projectile.Calamity().buffedByOldFashioned = null;
// Projectiles spawned by other projectiles is determined by the state of the parent projectile
else if (parentSource.Entity is Projectile parentProj)
projectile.Calamity().buffedByOldFashioned = parentProj.Calamity().buffedByOldFashioned;
+5 -1
View File
@@ -5,6 +5,7 @@ using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Items.Placeables;
using CalamityMod.Items.Placeables.Banners;
using CalamityMod.Packets;
using CalamityMod.Projectiles.Typeless;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
@@ -405,7 +406,10 @@ namespace CalamityMod.NPCs.Abyss
if (player.ItemAnimationActive)
{
// ouch!
player.ApplyDamageToNPC(NPC, (int)player.GetDamage(DamageClass.MeleeNoSpeed).ApplyTo(player.HeldItem.damage), 0, player.direction);
Item pick = player.HeldItem;
int pickDamage = (int)player.GetDamage(pick.DamageType).ApplyTo(pick.damage);
Projectile hit = Projectile.NewProjectileDirect(pick.GetSource_FromThis(), NPC.Center, Vector2.Zero, ModContent.ProjectileType<DirectStrike>(), pickDamage, 0f, player.whoAmI, NPC.whoAmI);
hit.DamageType = pick.DamageType;
SoundEngine.PlaySound(SoundID.Dig, NPC.Center); // this is the dig sound that shale piles use
if (CurrentPhase < (int)AIState.Enraged)
{
+3 -3
View File
@@ -157,7 +157,7 @@ namespace CalamityMod.Projectiles
public bool DealsDefenseDamage = false;
// Old Fashioned buff. This is true by default but does not have effect unless the player has the buff consumed.
public bool buffedByOldFashioned = true;
public bool? buffedByOldFashioned = true;
// Nihility Quiver
public bool nihilicArrow = false;
@@ -4186,8 +4186,8 @@ namespace CalamityMod.Projectiles
CalamityPlayer modPlayer = player.Calamity();
// Old Fashioned buffs (or debuffs) apply if the player has Old Fashioned
if (modPlayer.oldFashioned)
modifiers.SourceDamage *= buffedByOldFashioned ? OldFashioned.DamageBoostMultiplier : OldFashioned.DamageReductionMultiplier;
if (modPlayer.oldFashioned && buffedByOldFashioned.HasValue)
modifiers.SourceDamage *= buffedByOldFashioned.Value ? OldFashioned.DamageBoostMultiplier : OldFashioned.DamageReductionMultiplier;
if (projectile.type == ProjectileID.JoustingLance || projectile.type == ProjectileID.HallowJoustingLance || projectile.type == ProjectileID.ShadowJoustingLance)
{