Reimplementation of Feral Bite random debuffs
Applied on a consistent 10 second timer Can inflict one of Weak, Darkness, Bleeding, or Broken Armor for 1.5-3.5 seconds
This commit is contained in:
1 parent
e522adcbab
commit
e4887efd63
2 files changed
+16
-2
No files matched your search
@@ -115,6 +115,19 @@ namespace CalamityMod.Buffs
|
||||
else if (type == BuffID.Rabies)
|
||||
{
|
||||
player.GetDamage<GenericDamageClass>() -= 0.2f;
|
||||
|
||||
// Reimplementation of random debuff infliction; now occurs on a consistent timer and with a different debuff list
|
||||
if (player.buffTime[buffIndex] % 600 == 300)
|
||||
{
|
||||
int debuffType = Main.rand.Next(4) switch
|
||||
{
|
||||
0 => BuffID.Weak,
|
||||
1 => BuffID.Bleeding,
|
||||
2 => BuffID.Darkness,
|
||||
_ => BuffID.BrokenArmor,
|
||||
};
|
||||
player.AddBuff(debuffType, Main.rand.Next(90, 211));
|
||||
}
|
||||
}
|
||||
else if (type == BuffID.Werewolf)
|
||||
{
|
||||
|
||||
@@ -452,7 +452,7 @@ namespace CalamityMod.ILEditing
|
||||
// This IL edit accomplishes three things:
|
||||
// 1. Nerf Beetle Scale Mail's set bonus Beetle Might melee speed from 10% per stack to 5%.
|
||||
// 2. Nerf Nebula armor's Damage and Life Boosters (Mana Boosters are not handled in this method).
|
||||
// 3. Remove the ability for Feral Bite to randomly inflict debuffs.
|
||||
// 3. Remove the vanilla implementation of Feral Bite inflicting random debuffs.
|
||||
var cursor = new ILCursor(il);
|
||||
|
||||
// First, move to Beetle Scale Mail's melee speed boost from Beetle Might buff.
|
||||
@@ -511,7 +511,7 @@ namespace CalamityMod.ILEditing
|
||||
// There are multiple branches pointing to this instruction, so it cannot be removed. Instead, swap its value directly.
|
||||
cursor.Next.Operand = BalancingConstants.NebulaDamagePerBooster;
|
||||
|
||||
// Finally, removing Feral Bite's debuffs.
|
||||
// Finally, removing Feral Bite's vanilla debuff infliction.
|
||||
// Find the random debuff duration multiplier for the debuffs inflicted by Feral Bite.
|
||||
if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcR4(0.01f))) // The 0.01f random debuff duration multiplier.
|
||||
{
|
||||
@@ -520,6 +520,7 @@ namespace CalamityMod.ILEditing
|
||||
}
|
||||
|
||||
// Remove and change to 0f, this makes the random debuffs from Feral Bite have 0 duration.
|
||||
// Calamity reimplements a different version of this in CalamityGlobalBuff.Update
|
||||
cursor.Remove();
|
||||
cursor.Emit(OpCodes.Ldc_R4, 0f);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user