Bloodflare Core total rework

This commit is contained in:
Ozzatron committed 2020-10-28 18:35:25 -04:00
1 parent 2f422e6847
commit dfabe5e994
4 files changed
+58 -20

No files matched your search

+25
View File
@@ -497,6 +497,7 @@ namespace CalamityMod.CalPlayer
public bool bloodPact = false;
public bool bloodPactBoost = false;
public bool bloodflareCore = false;
public int bloodflareCoreLostDefense = 0;
public bool coreOfTheBloodGod = false;
public bool elementalHeart = false;
public bool crownJewel = false;
@@ -2383,6 +2384,7 @@ namespace CalamityMod.CalPlayer
brimlashBusterBoost = false;
animusBoost = 1f;
potionTimer = 0;
bloodflareCoreLostDefense = 0;
if (BossRushEvent.BossRushActive)
{
@@ -7804,6 +7806,29 @@ namespace CalamityMod.CalPlayer
{
player.AddBuff(ModContent.BuffType<BurntOut>(), 300, true);
}
// Bloodflare Core defense shattering
if (bloodflareCore)
{
// Shattered defense caps at half of total defense. Every hit adds its damage as shattered defense.
bloodflareCoreLostDefense = Math.Min(bloodflareCoreLostDefense + (int)damage, player.statDefense / 2);
// Play a sound and make dust to signify that defense has been shattered
Main.PlaySound(SoundID.DD2_MonkStaffGroundImpact, player.Center);
for (int i = 0; i < 36; ++i)
{
float speed = Main.rand.NextFloat(1.8f, 8f);
Vector2 dustVel = new Vector2(speed, speed);
Dust d = Dust.NewDustDirect(player.position, player.width, player.height, 90);
d.velocity = dustVel;
d.noGravity = true;
d.scale *= Main.rand.NextFloat(1.1f, 1.4f);
Dust.CloneDust(d).velocity = dustVel.RotatedBy(MathHelper.PiOver2);
Dust.CloneDust(d).velocity = dustVel.RotatedBy(MathHelper.Pi);
Dust.CloneDust(d).velocity = dustVel.RotatedBy(MathHelper.Pi * 1.5f);
}
}
bool hardMode = Main.hardMode;
int iFramesToAdd = 0;
if (player.whoAmI == Main.myPlayer)
+32 -16
View File
@@ -3415,22 +3415,6 @@ namespace CalamityMod.CalPlayer
player.endurance += 0.08f;
player.allDamage += 0.08f;
}
else if (modPlayer.bloodflareCore)
{
if (player.statDefense < 100)
player.allDamage += 0.15f;
if (player.statLife <= (int)(player.statLifeMax2 * 0.15))
{
player.endurance += 0.1f;
player.allDamage += 0.2f;
}
else if (player.statLife <= (int)(player.statLifeMax2 * 0.5))
{
player.endurance += 0.05f;
player.allDamage += 0.1f;
}
}
if (modPlayer.godSlayerThrowing)
{
@@ -3931,6 +3915,38 @@ namespace CalamityMod.CalPlayer
(modPlayer.yInsignia ? 0.1 : 0) +
(modPlayer.badgeOfBraveryRare ? 0.2 : 0);
modPlayer.trueMeleeDamage += damageAdd;
// Intentionally at the end: Bloodflare Core's defense reduction (after all other boosting effects and whatnot)
// This defense still comes back over time if you take off Bloodflare Core while you're missing defense.
// However, removing the item means you won't get healed as the defense comes back.
ref int lostDef = ref modPlayer.bloodflareCoreLostDefense;
if (lostDef > 0)
{
// Defense regeneration occurs every four frames while defense is missing
if (player.miscCounter % 4 == 0)
{
--lostDef;
if (modPlayer.bloodflareCore)
{
player.statLife += 1;
player.HealEffect(1, false);
// Produce an implosion of blood themed dust so it's obvious an effect is occurring
for (int i = 0; i < 3; ++i)
{
Vector2 offset = Main.rand.NextVector2Unit() * Main.rand.NextFloat(23f, 33f);
Vector2 dustPos = player.Center + offset;
Vector2 dustVel = offset * -0.08f;
Dust d = Dust.NewDustDirect(dustPos, 0, 0, 90, 0.08f, 0.08f);
d.velocity = dustVel;
d.noGravity = true;
}
}
}
// Actually apply the defense reduction
player.statDefense -= lostDef;
}
}
#endregion
+1 -3
View File
@@ -10,9 +10,7 @@ namespace CalamityMod.Items.Accessories
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Bloodflare Core");
Tooltip.SetDefault("When below 50% life you gain 5% increased damage reduction and 10% increased damage\n" +
"When below 15% life you gain 10% increased damage reduction and 20% increased damage\n" +
"When below 100 defense you gain 15% increased damage");
Tooltip.SetDefault("You lose up to half your defense after taking damage\n" + "Lost defense regenerates over time\n" + "You gain 1 health for every 1 defense gained as it regenerates");
}
public override void SetDefaults()
-1
View File
@@ -41,7 +41,6 @@ namespace CalamityMod.Items.Accessories
recipe.AddIngredient(ModContent.ItemType<BloodyWormScarf>());
recipe.AddIngredient(ModContent.ItemType<BloodPact>());
recipe.AddIngredient(ModContent.ItemType<FleshTotem>());
recipe.AddIngredient(ModContent.ItemType<BloodflareCore>());
recipe.AddIngredient(ModContent.ItemType<CosmiliteBar>(), 5);
recipe.AddIngredient(ModContent.ItemType<AscendantSpiritEssence>());
recipe.AddTile(ModContent.TileType<DraedonsForge>());