Raider Boost now works properly
This commit is contained in:
1 parent
4e2b00fe8a
commit
545b656d74
7 files changed
+41
-17
No files matched your search
@@ -595,7 +595,19 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
if (proj.npcProj || proj.trap)
|
||||
return;
|
||||
|
||||
|
||||
//Add raider crit before hit
|
||||
if (!proj.Calamity().stealthStrike && !proj.Calamity().stealthStrikeSubProjectile && raiderCritLifespan > 0f)
|
||||
{
|
||||
if (nanotech)
|
||||
proj.CritChance += Items.Accessories.Nanotech.RaiderBonus;
|
||||
else if (vampiricTalisman)
|
||||
proj.CritChance += VampiricTalisman.RaiderBonus;
|
||||
else if (raiderTalisman)
|
||||
proj.CritChance += RaidersTalisman.RaiderBonus;
|
||||
}
|
||||
|
||||
|
||||
modifiers.CritDamage += critDamage;
|
||||
|
||||
// All Calamity multipliers are added together to prevent insane exponential stacking
|
||||
|
||||
@@ -2705,16 +2705,6 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
}
|
||||
|
||||
// Raider Talisman bonus
|
||||
if (!StealthStrikeAvailable() && raiderCritLifespan > 0f)
|
||||
{
|
||||
if (nanotech)
|
||||
Player.GetCritChance<GenericDamageClass>() += Items.Accessories.Nanotech.RaiderBonus;
|
||||
else if (vampiricTalisman)
|
||||
Player.GetCritChance<GenericDamageClass>() += VampiricTalisman.RaiderBonus;
|
||||
else if (raiderTalisman)
|
||||
Player.GetCritChance<GenericDamageClass>() += RaidersTalisman.RaiderBonus;
|
||||
}
|
||||
if (avertorBonus)
|
||||
Player.GetDamage<GenericDamageClass>() += 0.1f;
|
||||
|
||||
|
||||
@@ -226,6 +226,17 @@ namespace CalamityMod.CalPlayer
|
||||
if (Player.whoAmI != Main.myPlayer)
|
||||
return;
|
||||
|
||||
//Undo raider crit after hit
|
||||
if (!proj.Calamity().stealthStrike && !proj.Calamity().stealthStrikeSubProjectile && raiderCritLifespan > 0f)
|
||||
{
|
||||
if (nanotech)
|
||||
proj.CritChance -= Items.Accessories.Nanotech.RaiderBonus;
|
||||
else if (vampiricTalisman)
|
||||
proj.CritChance -= VampiricTalisman.RaiderBonus;
|
||||
else if (raiderTalisman)
|
||||
proj.CritChance -= RaidersTalisman.RaiderBonus;
|
||||
}
|
||||
|
||||
// Apply this to player equippable sources ie. Orichalcum set bonus petal spawns
|
||||
// Do not apply if this effect is an extension of a weapon ie. Pearl God round effect as it will mess up Old Fashioned
|
||||
var source = Player.GetSource_OnHit(target);
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
//The stealth damage boost is handled in CalamityPlayer for some reason, maybe someone didn't want em to stack?
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
public const float RaiderBonus = 10f;
|
||||
public static int RaiderBonus => 10;
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 46;
|
||||
|
||||
@@ -9,8 +9,8 @@ namespace CalamityMod.Items.Accessories
|
||||
public class RaidersTalisman : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
public const float RaiderBonus = 15f;
|
||||
public const int RaiderCooldown = 10; //seconds
|
||||
public static int RaiderBonus => 15;
|
||||
public static int RaiderCooldown => 10; //seconds
|
||||
public static readonly SoundStyle StealthHitSound = new("CalamityMod/Sounds/Custom/RaidersTalismanStealthHit");
|
||||
|
||||
public override void SetDefaults()
|
||||
|
||||
@@ -9,9 +9,9 @@ namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
public class VampiricTalisman : ModItem, ILocalizedModType, IHoldShiftTooltipItem
|
||||
{
|
||||
internal const int ArmorCrunchDebuffTime = 150;
|
||||
internal const int HeavyBleedingDebuffTime = 300;
|
||||
public const float RaiderBonus = 15f;
|
||||
internal static int ArmorCrunchDebuffTime => 150;
|
||||
internal static int HeavyBleedingDebuffTime => 300;
|
||||
public static int RaiderBonus => 15;
|
||||
|
||||
public bool ShowExtensionIndicator => false;
|
||||
|
||||
|
||||
@@ -260,6 +260,10 @@ namespace CalamityMod.Projectiles
|
||||
/// <summary> If true, this projectile is from a rogue stealth strike. The primary variable responsible for triggering stealth strike effects. </summary>
|
||||
public bool stealthStrike = false;
|
||||
/// <summary>
|
||||
/// If true, this projectile is spawned from a stealth strike, but is not a primary projectile. Used to avoid proccing things like Raiders Talisman.
|
||||
/// </summary>
|
||||
public bool stealthStrikeSubProjectile = false;
|
||||
/// <summary>
|
||||
/// Number of times this stealth strike projectile has pierced an enemy.<br/>
|
||||
/// Used to limit the number of times a projectile can proc certain effects from rogue accessories.
|
||||
/// </summary>
|
||||
@@ -407,6 +411,13 @@ namespace CalamityMod.Projectiles
|
||||
if (e.Context == "SetBonus_GhostHurt")
|
||||
projectile.damage /= 2;
|
||||
}
|
||||
|
||||
if (source is EntitySource_Parent { Entity: Projectile parent })
|
||||
{
|
||||
if (parent.Calamity().stealthStrike || parent.Calamity().stealthStrikeSubProjectile)
|
||||
stealthStrikeSubProjectile = true;
|
||||
}
|
||||
|
||||
}
|
||||
public override void SendExtraAI(Projectile projectile, BitWriter bitWriter, BinaryWriter binaryWriter) => binaryWriter.Write(ParentNPCIndex);
|
||||
public override void ReceiveExtraAI(Projectile projectile, BitReader bitReader, BinaryReader binaryReader) => ParentNPCIndex = binaryReader.ReadInt32();
|
||||
|
||||
Reference in new issue
Block a user