Merge branch '1.4.4' into hugekraken-jellyfish

This commit is contained in:
Mishiro Usui committed 2023-09-08 18:38:03 +01:00
commit 0491b2f790
510 files changed
+5814 -4747

No files matched your search

+26 -21
View File
@@ -39,6 +39,9 @@ namespace CalamityMod.Balancing
IBalancingRule ResistTrueMelee(float f) => new ClassResistBalancingRule(f, TrueMeleeDamageClass.Instance);
// Declare specific filters.
bool BigGaelsSkullFilter(Projectile p) =>
p.type == ProjectileType<GaelSkull>() && p.ai[1] == 1;
bool DragonRageFilter(Projectile p) =>
p.type == ProjectileType<DragonRageStaff>() || p.type == ProjectileType<DragonRageFireball>() || (p.type == ProjectileType<FuckYou>() && p.CountsAsClass<MeleeDamageClass>());
@@ -48,12 +51,6 @@ namespace CalamityMod.Balancing
bool MushroomSpearFilter(Projectile p) =>
p.type == ProjectileID.Mushroom && Main.player[p.owner].ActiveItem().type == ItemID.MushroomSpear;
bool TrueNightsEdgeFilter(Projectile p) =>
p.type == ProjectileID.NightBeam && Main.player[p.owner].ActiveItem().type == ItemID.TrueNightsEdge;
bool TerraBladeFilter(Projectile p) =>
p.type == ProjectileID.TerraBeam && Main.player[p.owner].ActiveItem().type == ItemID.TerraBlade;
bool SpectreMaskSetBonusFilter(Projectile p) =>
p.type == ProjectileID.SpectreWrath && Main.player[p.owner].ghostHurt;
@@ -71,12 +68,6 @@ namespace CalamityMod.Balancing
// Nerf Cursed Dart flames by 50%.
Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.CursedDartFlame)),
// Nerf True Night's Edge projectiles by 33% to cancel out the 1.5x multiplier it gets.
Do(new ProjectileSpecificRequirementBalancingRule(1f / 3f * 2f, TrueNightsEdgeFilter)),
// Nerf Terra Blade projectiles by 33% to cancel out the 1.5x multiplier it gets.
Do(new ProjectileSpecificRequirementBalancingRule(1f / 3f * 2f, TerraBladeFilter)),
// Nerf Mushroom Spear projectiles by 50%.
Do(new ProjectileSpecificRequirementBalancingRule(0.5f, MushroomSpearFilter)),
@@ -158,6 +149,11 @@ namespace CalamityMod.Balancing
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.DukeFishron, Do(new ProjectileResistBalancingRule(1.35f, ProjectileType<SakuraBullet>(), ProjectileType<PurpleButterfly>()))));
#endregion
#region Empress of Light
// 30% resist to Plague Tainted SMG's drones.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.HallowBoss, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<PlagueTaintedDrone>()))));
#endregion
#region Lunatic Cultist
// 25% resist to Resurrection Butterfly.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.CultistBoss, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<SakuraBullet>(), ProjectileType<PurpleButterfly>()))));
@@ -241,8 +237,6 @@ namespace CalamityMod.Balancing
// 10% resist to Old Reaper.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.9f, ProjectileType<ReaperProjectile>()))));
// 5% resist to Phantasmal Ruin.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.95f, ProjectileType<PhantasmalSoul>(), ProjectileType<PhantasmalRuinProj>(), ProjectileType<PhantasmalRuinGhost>()))));
#endregion
#region Exo Mechs: Ares
@@ -264,9 +258,12 @@ namespace CalamityMod.Balancing
// 20% resist to Eclipse's Fall.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<EclipsesSmol>(), ProjectileType<EclipsesFallMain>()))));
// 20% resist to Yharim's Crystal
// 20% resist to Yharim's Crystal.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<YharimsCrystalBeam>()))));
// 20% resist to Zenith.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileID.FinalFractal))));
// 15% resist to Enforcer projectiles.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.85f, ProjectileType<EssenceFlame2>()))));
#endregion
@@ -276,8 +273,8 @@ namespace CalamityMod.Balancing
// TODO -- NPC sets (mostly worm bosses) should probably be their own holding class.
int[] exoTwins = new int[] { NPCType<Artemis>(), NPCType<Apollo>() };
// 20% resist to Dynamic Pursuer
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<DynamicPursuerProjectile>(), ProjectileType<DynamicPursuerLaser>(), ProjectileType<DynamicPursuerElectricity>()))));
// 20% resist to Dynamic Pursuer.
NPCSpecificBalancingChanges.AddRange(Bundle(exoTwins, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<DynamicPursuerProjectile>(), ProjectileType<DynamicPursuerLaser>(), ProjectileType<DynamicPursuerElectricity>()))));
// 10% resist to Eclipse's Fall stealth strike.
NPCSpecificBalancingChanges.AddRange(Bundle(exoTwins, Do(new ProjectileResistBalancingRule(0.9f, ProjectileType<EclipsesSmol>()))));
@@ -302,9 +299,6 @@ namespace CalamityMod.Balancing
// 50% resist to Chicken Cannon.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<ChickenExplosion>()))));
// 50% resist to Prismatic Breaker. (why is this more than BOTH Rancor and Yharim's Crystal? jesus fuck this weapon seriously)
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<PrismaticBeam>()))));
// 50% resist to Tarragon Throwing Darts Thorns. (LOL)
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<TarraThornRight>(), ProjectileType<TarraThornTip>()))));
@@ -320,6 +314,9 @@ namespace CalamityMod.Balancing
// 40% resist to Rancor.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType<RancorLaserbeam>()))));
// 35% resist to Zenith.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.65f, ProjectileID.FinalFractal))));
// 30% resist to the Spin Throw part of the Ark of the Cosmos' combo.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileSpecificRequirementBalancingRule(0.7f, AotCThrowCombo))));
@@ -335,9 +332,15 @@ namespace CalamityMod.Balancing
// 30% resist to Dragon Scales and The Wand's tornadoes
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<InfernadoFriendly>(), ProjectileType<DragonScalesInfernado>()))));
// 30% resist to Prismatic Breaker's laser beam.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<PrismaticBeam>()))));
// 25% resist to Dragon Rage projectiles.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileSpecificRequirementBalancingRule(0.75f, DragonRageFilter))));
// 25% resist to Gael's Greatsword's big skulls.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileSpecificRequirementBalancingRule(0.75f, BigGaelsSkullFilter))));
// 25% resist to Godslayer Slugs.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<GodSlayerSlugProj>()))));
@@ -347,7 +350,6 @@ namespace CalamityMod.Balancing
// 20% resist to Blood Boiler fire.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<BloodBoilerFire>()))));
// 20% resist to Eradicator beams.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.ThanatosIDs, Do(new ProjectileResistBalancingRule(0.8f, ProjectileType<NebulaShot>()))));
@@ -377,6 +379,9 @@ namespace CalamityMod.Balancing
// 85% resist to Chicken Cannon.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<SoulSeekerSupreme>(), new ProjectileResistBalancingRule(0.15f, ProjectileType<ChickenExplosion>())));
// 40% resist to Subsuming Vortex.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<SoulSeekerSupreme>(), new ProjectileResistBalancingRule(0.6f, ProjectileType<ExoVortex>(), ProjectileType<ExoVortex2>(), ProjectileType<EnormousConsumingVortex>())));
// 30% resist to Murasama.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<SoulSeekerSupreme>(), new ProjectileResistBalancingRule(0.7f, ProjectileType<MurasamaSlash>())));
+12 -1
View File
@@ -59,7 +59,18 @@
// Rogue stealth
// If stealth is too weak, increase this number. If stealth is too strong, decrease this number.
// This value is intentionally not readonly.
public static double UniversalStealthStrikeDamageFactor = 0.5;
public static double UniversalStealthStrikeDamageFactor = 0.41;
// Shade - 07/09/2023
// Universal Stealth dmg factor was nerfed to 0.41 from 0.5
// Stealth damage prefixes were bugged, causing that stealth strikes with the Mighty, Hefty and most importantly Flawless
// dealt less damage than intended; idk how long this thing has been for but looking at #bug-reports and #known-bugs its
// likely at least 7 months old, buried deep beneath a lot other bugs due to being in the port and forgotten about.
// Due to how impactful the fix was, the change had to happen and thus the nerf was made.
//
// This nerf should be reversed once the stealth -> focus rogue rework or rogue/stealth III or however you want to call it occurs,
// as of today summoner is the priority class now but once we're done with the Summoner minion culling and its Whip Hell we should
// probably start working on rogue afterwards.
internal static readonly float BaseStealthGenTime = 4f; // 4 seconds
internal static readonly float MovingStealthGenRatio = 0.5f;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 582 B

After

Width:  |  Height:  |  Size: 607 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 567 B

After

Width:  |  Height:  |  Size: 652 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 517 B

After

Width:  |  Height:  |  Size: 584 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 633 B

After

Width:  |  Height:  |  Size: 694 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 524 B

After

Width:  |  Height:  |  Size: 720 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 561 B

After

Width:  |  Height:  |  Size: 627 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 555 B

After

Width:  |  Height:  |  Size: 661 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 594 B

After

Width:  |  Height:  |  Size: 698 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 591 B

After

Width:  |  Height:  |  Size: 702 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 604 B

After

Width:  |  Height:  |  Size: 776 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 552 B

After

Width:  |  Height:  |  Size: 664 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 591 B

After

Width:  |  Height:  |  Size: 739 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 513 B

After

Width:  |  Height:  |  Size: 622 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 608 B

After

Width:  |  Height:  |  Size: 708 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 523 B

After

Width:  |  Height:  |  Size: 639 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 555 B

After

Width:  |  Height:  |  Size: 557 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 540 B

After

Width:  |  Height:  |  Size: 585 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 573 B

After

Width:  |  Height:  |  Size: 720 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 562 B

After

Width:  |  Height:  |  Size: 667 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 751 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 622 B

After

Width:  |  Height:  |  Size: 607 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 660 B

After

Width:  |  Height:  |  Size: 690 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 509 B

After

Width:  |  Height:  |  Size: 619 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 432 B

After

Width:  |  Height:  |  Size: 518 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 637 B

After

Width:  |  Height:  |  Size: 669 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 573 B

After

Width:  |  Height:  |  Size: 583 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 683 B

After

Width:  |  Height:  |  Size: 523 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 605 B

After

Width:  |  Height:  |  Size: 555 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 826 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 752 B

After

Width:  |  Height:  |  Size: 691 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 551 B

After

Width:  |  Height:  |  Size: 459 B

+1
View File
@@ -5,6 +5,7 @@ namespace CalamityMod.Buffs.StatBuffs
{
public class ChiRegenBuff : ModBuff
{
public override string Texture => "CalamityMod/Buffs/StatBuffs/ChiBuff";
public override void SetStaticDefaults()
{
Main.buffNoTimeDisplay[Type] = true;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 551 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 899 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 799 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 472 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 561 B

After

Width:  |  Height:  |  Size: 704 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 404 B

After

Width:  |  Height:  |  Size: 662 B

@@ -1,11 +1,12 @@
using CalamityMod.CalPlayer;
using CalamityMod.CalPlayer;
using CalamityMod.Projectiles.Summon;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Summon
{
public class PlantationBuff : ModBuff
[LegacyName("PlantationBuff")]
public class PlantationStaffBuff : ModBuff
{
public override void SetStaticDefaults()
{
@@ -17,11 +18,11 @@ namespace CalamityMod.Buffs.Summon
public override void Update(Player player, ref int buffIndex)
{
CalamityPlayer modPlayer = player.Calamity();
if (player.ownedProjectileCounts[ModContent.ProjectileType<PlantSummon>()] > 0)
if (player.ownedProjectileCounts[ModContent.ProjectileType<PlantationStaffSummon>()] > 0)
{
modPlayer.plantera = true;
modPlayer.PlantationSummon = true;
}
if (!modPlayer.plantera)
if (!modPlayer.PlantationSummon)
{
player.DelBuff(buffIndex);
buffIndex--;
File renamed without changes.

Before

Width:  |  Height:  |  Size: 621 B

After

Width:  |  Height:  |  Size: 621 B

@@ -4,7 +4,7 @@ using Terraria.ModLoader;
namespace CalamityMod.Buffs.Summon
{
public class ProfanedBabs : ModBuff //Buff name is reference to how I refer to the guardians as my babs ~Amber
public class ProfanedSoulGuardians : ModBuff
{
public override void SetStaticDefaults()
{
@@ -15,7 +15,7 @@ namespace CalamityMod.Buffs.Summon
public override void Update(Player player, ref int buffIndex)
{
CalamityPlayer modPlayer = player.Calamity();
if (!modPlayer.donutBabs || modPlayer.profanedCrystalBuffs)
if (!modPlayer.pSoulGuardians || modPlayer.profanedCrystalBuffs)
{
player.DelBuff(buffIndex);
buffIndex--;
File renamed without changes.

Before

Width:  |  Height:  |  Size: 684 B

After

Width:  |  Height:  |  Size: 684 B

+111 -139
View File
@@ -370,13 +370,13 @@ namespace CalamityMod.CalPlayer
#endregion
#region Energy Shields
public bool HasAnyEnergyShield => roverDrive || lunicCorpsSet || sponge;
public bool HasAnyEnergyShield => roverDrive || lunicCorpsSet || ((pSoulArtifact && !profanedCrystal) || profanedCrystalBuffs) || sponge;
public bool freeDodgeFromShieldAbsorption = false;
public bool drawnAnyShieldThisFrame = false;
// TODO -- Some way to show the player their total shield points.
public int TotalEnergyShielding => RoverDriveShieldDurability + LunicCorpsShieldDurability + SpongeShieldDurability;
public int TotalMaxShieldDurability => (roverDrive ? RoverDrive.ShieldDurabilityMax : 0) + (lunicCorpsSet ? LunicCorpsHelmet.ShieldDurabilityMax : 0) + (sponge ? TheSponge.ShieldDurabilityMax : 0);
public int TotalEnergyShielding => RoverDriveShieldDurability + LunicCorpsShieldDurability + pSoulShieldDurability + SpongeShieldDurability;
public int TotalMaxShieldDurability => (roverDrive ? RoverDrive.ShieldDurabilityMax : 0) + (lunicCorpsSet ? LunicCorpsHelmet.ShieldDurabilityMax : 0) + (profanedCrystalBuffs ? ProfanedSoulCrystal.ShieldDurabilityMax : ((pSoulArtifact && !profanedCrystal) ? ProfanedSoulArtifact.ShieldDurabilityMax : 0)) + (sponge ? TheSponge.ShieldDurabilityMax : 0);
public int RoverDriveShieldDurability = 0;
public int LunicCorpsShieldDurability = 0;
@@ -389,6 +389,12 @@ namespace CalamityMod.CalPlayer
// Lunic Corps shield comes from an armor set and its visibility is non optional
internal float lunicCorpsShieldPartialRechargeProgress = 0f;
internal bool playedLunicCorpsShieldSound = false;
//Profaned soul shield applies to psa and psc, with differing max hps for each
public int pSoulShieldDurability = 0;
public bool pSoulShieldVisible = false;
internal bool playedProfanedSoulShieldSound = false;
internal float pSoulShieldPartialRechargeProgress = 0f;
public bool sponge = false;
public bool spongeShieldVisible = false;
@@ -470,8 +476,14 @@ namespace CalamityMod.CalPlayer
public bool gShell = false;
public bool tortShell = false;
public bool absorber = false;
public bool alwaysHoneyRegen = false;
public bool honeyTurboRegen = false;
public bool honeyDewHalveDebuffs = false;
public bool livingDewHalveDebuffs = false;
public int jewelBonusDefense = 0;
public bool aAmpoule = false;
public bool rOoze = false;
public bool JustWasDebuffed = false;
public bool fBarrier = false;
public bool aBrain = false;
public bool amalgam = false;
@@ -491,7 +503,6 @@ namespace CalamityMod.CalPlayer
public bool tracersElysian = false;
public bool tracersSeraph = false;
public bool frostFlare = false;
public bool beeResist = false;
public bool uberBees = false;
public bool evolution = false;
public int evolutionLifeRegenCounter = 0;
@@ -517,8 +528,9 @@ namespace CalamityMod.CalPlayer
public bool coreOfTheBloodGod = false;
public bool elementalHeart = false;
public bool crownJewel = false;
public bool celestialJewel = false;
public bool astralArcanum = false;
public bool infectedJewel = false;
public bool purity = false;
public int PurityHealSlowdownFrames = 0;
public bool harpyRing = false;
public bool angelTreads = false;
public bool harpyWingBoost = false; //harpy wings + harpy ring
@@ -543,7 +555,7 @@ namespace CalamityMod.CalPlayer
public bool eArtifact = false;
public bool dArtifact = false;
public bool auricSArtifact = false;
public bool pArtifact = false;
public bool pSoulArtifact = false;
public bool giantPearl = false;
public bool normalityRelocator = false;
public bool flameLickedShell = false;
@@ -812,6 +824,7 @@ namespace CalamityMod.CalPlayer
public bool fishAlert = false;
public bool clamity = false;
public bool NOU = false;
public bool absorberAffliction = false;
public bool sulphurPoison = false;
public bool nightwither = false;
public bool eutrophication = false;
@@ -936,9 +949,9 @@ namespace CalamityMod.CalPlayer
public bool cLamp = false;
public bool pGuy = false;
public bool sandnado = false;
public bool plantera = false;
public bool PlantationSummon = false;
public bool astralProbe = false;
public bool donutBabs = false;
public bool pSoulGuardians = false;
public bool cEnergy = false;
public int healCounter = 300;
public bool shellfish = false;
@@ -1079,7 +1092,6 @@ namespace CalamityMod.CalPlayer
public bool witheringWeaponEnchant = false;
public bool witheredDebuff = false;
public bool absorberAffliction = false;
public int witheredWeaponHoldTime = 0;
public int witheringDamageDone = 0;
@@ -1446,6 +1458,9 @@ namespace CalamityMod.CalPlayer
LunicCorpsShieldDurability = 0;
if (!sponge)
SpongeShieldDurability = 0;
if (!pSoulArtifact)
pSoulShieldDurability = 0;
pSoulShieldVisible = false;
roverDrive = false;
roverDriveShieldVisible = false;
sponge = false;
@@ -1572,13 +1587,16 @@ namespace CalamityMod.CalPlayer
gShell = false;
tortShell = false;
absorber = false;
alwaysHoneyRegen = false;
honeyTurboRegen = false;
honeyDewHalveDebuffs = false;
livingDewHalveDebuffs = false;
aAmpoule = false;
rOoze = false;
fBarrier = false;
aBrain = false;
amalgam = false;
frostFlare = false;
beeResist = false;
uberBees = false;
evolution = false;
nanotech = false;
@@ -1609,8 +1627,8 @@ namespace CalamityMod.CalPlayer
coreOfTheBloodGod = false;
elementalHeart = false;
crownJewel = false;
celestialJewel = false;
astralArcanum = false;
infectedJewel = false;
purity = false;
harpyRing = false;
angelTreads = false;
harpyWingBoost = false; //harpy wings + harpy ring
@@ -1625,7 +1643,7 @@ namespace CalamityMod.CalPlayer
eArtifact = false;
dArtifact = false;
auricSArtifact = false;
pArtifact = false;
pSoulArtifact = false;
giantPearl = false;
normalityRelocator = false;
flameLickedShell = false;
@@ -1940,7 +1958,7 @@ namespace CalamityMod.CalPlayer
cLamp = false;
pGuy = false;
cEnergy = false;
donutBabs = false;
pSoulGuardians = false;
sWaifu = false;
dWaifu = false;
cWaifu = false;
@@ -1952,7 +1970,7 @@ namespace CalamityMod.CalPlayer
sCrystal = false;
sGod = false;
sandnado = false;
plantera = false;
PlantationSummon = false;
astralProbe = false;
victideSnail = false;
cSpirit = false;
@@ -2243,6 +2261,7 @@ namespace CalamityMod.CalPlayer
vaporfied = false;
banishingFire = false;
wither = false;
PurityHealSlowdownFrames = 0;
#endregion
#region Rogue
@@ -2489,6 +2508,7 @@ namespace CalamityMod.CalPlayer
RoverDriveShieldDurability = 0;
LunicCorpsShieldDurability = 0;
SpongeShieldDurability = 0;
pSoulShieldDurability = 0;
#endregion
#region UI
@@ -2575,7 +2595,7 @@ namespace CalamityMod.CalPlayer
{
gSabatonHotkeyHoldTime = 0;
}
if (CalamityKeybinds.NormalityRelocatorHotKey.JustPressed && normalityRelocator && Main.myPlayer == Player.whoAmI)
{
if (!Player.CCed && !Player.chaosState)
@@ -2882,25 +2902,7 @@ namespace CalamityMod.CalPlayer
if (prismaticSet && !Player.HasCooldown(PrismaticLaser.ID) && prismaticLasers <= 0)
prismaticLasers = CalamityUtils.SecondsToFrames(35f);
}
if (CalamityKeybinds.AstralArcanumUIHotkey.JustPressed && astralArcanum && !areThereAnyDamnBosses)
{
AstralArcanumUI.Toggle();
}
if (CalamityKeybinds.AstralTeleportHotKey.JustPressed)
{
if (celestialJewel && !areThereAnyDamnBosses)
{
if (Main.netMode == NetmodeID.SinglePlayer)
{
Player.TeleportationPotion();
SoundEngine.PlaySound(SoundID.Item6, Player.Center);
}
else if (Main.netMode == NetmodeID.MultiplayerClient && Player.whoAmI == Main.myPlayer)
{
NetMessage.SendData(MessageID.RequestTeleportationByServer, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0);
}
}
}
if (CalamityKeybinds.BlazingCoreHotKey.JustPressed)
{
if (blazingCore && blazingCoreParry == 0 && blazingCoreSuccessfulParry == 0)
@@ -2964,7 +2966,7 @@ namespace CalamityMod.CalPlayer
{
float angle = MathHelper.TwoPi * i / skullCount;
Vector2 initialVelocity = angle.ToRotationVector2().RotatedByRandom(MathHelper.ToRadians(12f)) * skullSpeed * new Vector2(0.82f, 1.5f) *
Main.rand.NextFloat(0.8f, 1.2f) * (i < skullCount / 2 ? 0.25f : 1f);
Main.rand.NextFloat(0.8f, 1.2f) * (i < skullCount / 2 ? 0.25f : 1f);
int projectileIndex = Projectile.NewProjectile(source, Player.Center + initialVelocity * 3f, initialVelocity, ModContent.ProjectileType<GaelSkull2>(), damage, 2f, Player.whoAmI);
Main.projectile[projectileIndex].tileCollide = false;
Main.projectile[projectileIndex].localAI[1] = (Main.projectile[projectileIndex].velocity.Y < 0f).ToInt();
@@ -3140,34 +3142,7 @@ namespace CalamityMod.CalPlayer
#endregion
#region TeleportMethods
public static Vector2? GetJunglePosition(Player player)
{
bool canSpawn = false;
int teleportStartX = Abyss.AtLeftSideOfWorld ? (int)(Main.maxTilesX * 0.65) : (int)(Main.maxTilesX * 0.2);
int teleportRangeX = (int)(Main.maxTilesX * 0.15);
int teleportStartY = (int)Main.worldSurface - 75;
int teleportRangeY = 50;
Player.RandomTeleportationAttemptSettings settings = new Player.RandomTeleportationAttemptSettings
{
mostlySolidFloor = true,
avoidAnyLiquid = true,
avoidLava = true,
avoidHurtTiles = true,
avoidWalls = true,
attemptsBeforeGivingUp = 1000,
maximumFallDistanceFromOrignalPoint = 30
};
Vector2 vector = player.CheckForGoodTeleportationSpot(ref canSpawn, teleportStartX, teleportRangeX, teleportStartY, teleportRangeY, settings);
if (canSpawn)
{
return (Vector2?)vector;
}
return null;
}
// Used for Boss Rush WoF
public static Vector2? GetUnderworldPosition(Player player)
{
bool canSpawn = false;
@@ -3285,7 +3260,7 @@ namespace CalamityMod.CalPlayer
//Life Jelly regen aura spawn when using a healing potion
if (timePotionSick == 1 && Player.whoAmI == Main.myPlayer && lifejelly && !GrandGelatin)
Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ModContent.ProjectileType<PinkJellyAura>(), 0, 0, Player.whoAmI);
Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ModContent.ProjectileType<PinkJellyAura>(), 0, 0, Player.whoAmI);
//Cleansing Jelly cleansing aura spawn when using a healing potion
if (timePotionSick == 1 && Player.whoAmI == Main.myPlayer && cleansingjelly && !GrandGelatin)
@@ -3351,7 +3326,7 @@ namespace CalamityMod.CalPlayer
//While holding hotkey, but before slam, bring Y velocity closer to 0
if (gSabatonHotkeyHoldTime < 60 && gSabatonHotkeyHoldTime != 0 && !gSabatonFalling)
{
Player.velocity.Y *= (60 - (gSabatonHotkeyHoldTime/4f))/60f;
Player.velocity.Y *= (60 - (gSabatonHotkeyHoldTime / 4f)) / 60f;
}
//Play sound a bit early so it goes in time with the fall
if (gSabatonHotkeyHoldTime == 45 && !gSabatonFalling)
@@ -3372,11 +3347,11 @@ namespace CalamityMod.CalPlayer
if (gSabatonFalling)
{
SpawnGravistarParticle();
//Cap time converted to damage at 2 seconds
if (gSabatonFall < 120)
gSabatonFall++;
Player.maxFallSpeed = 40f;
Player.gravity = 1.3f;
//If the player can fly during the fall, the physics gets a bit funky
@@ -3394,7 +3369,7 @@ namespace CalamityMod.CalPlayer
gSabatonTempJumpSpeed = 40;
}
}
}
}
#endregion
@@ -3405,7 +3380,7 @@ namespace CalamityMod.CalPlayer
//Infinite flight granted by some boss attacks
if (infiniteFlight)
Player.wingTime = Player.wingTimeMax;
// Reset the Calamity shader.
CalamityFireDyeShader = null;
@@ -3604,7 +3579,7 @@ namespace CalamityMod.CalPlayer
public override bool CanSellItem(NPC vendor, Item[] shopInventory, Item item)
{
if (item.type == ModContent.ItemType<ProfanedSoulCrystal>())
return DownedBossSystem.downedCalamitas; //no easy moneycoins for post doggo/yhar
return DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs; //no easy moneycoins for post doggo/yhar
return base.CanSellItem(vendor, shopInventory, item);
}
@@ -3715,7 +3690,7 @@ namespace CalamityMod.CalPlayer
{
// Apply weapon modifier stealth strike damage bonus
if (item.Calamity().StealthStrikePrefixBonus != 0f && StealthStrikeAvailable())
damage += 1f - item.Calamity().StealthStrikePrefixBonus;
damage += 1f + item.Calamity().StealthStrikePrefixBonus;
}
}
@@ -3774,7 +3749,7 @@ namespace CalamityMod.CalPlayer
if (Main.rand.NextBool(20))
{
int confettiDust = Main.rand.Next(139, 143);
int confetti = Dust.NewDust(new Vector2(hitbox.X,hitbox.Y), hitbox.Width, hitbox.Height, confettiDust, Player.velocity.X, Player.velocity.Y, 0, new Color(), 1.2f);
int confetti = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, confettiDust, Player.velocity.X, Player.velocity.Y, 0, new Color(), 1.2f);
Main.dust[confetti].velocity.X *= (float)(1.0 + Main.rand.Next(-50, 51) * 0.01);
Main.dust[confetti].velocity.Y *= (float)(1.0 + Main.rand.Next(-50, 51) * 0.01);
Main.dust[confetti].velocity.X += Main.rand.Next(-50, 51) * 0.05f;
@@ -3915,7 +3890,7 @@ namespace CalamityMod.CalPlayer
}
}
#endregion
#region Shoot
public override bool Shoot(Item item, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockBack)
{
@@ -3926,60 +3901,66 @@ namespace CalamityMod.CalPlayer
{
if (item.CountsAsClass<RogueDamageClass>())
{
float num72 = item.shootSpeed;
Vector2 vector2 = Player.RotatedRelativePoint(Player.MountedCenter, true);
float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X;
float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y;
if (Player.gravDir == -1f)
{
num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y;
}
float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79));
if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f))
{
num78 = (float)Player.direction;
num79 = 0f;
num80 = num72;
}
else
if (!CalamityLists.VeneratedLocketBanlist.Contains(item.type))
{
float num72 = item.shootSpeed;
Vector2 vector2 = Player.RotatedRelativePoint(Player.MountedCenter, true);
float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X;
float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y;
if (Player.gravDir == -1f)
{
num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y;
}
float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79));
if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f))
{
num78 = (float)Player.direction;
num79 = 0f;
num80 = num72;
}
else
{
num80 = num72 / num80;
}
vector2 = new Vector2(Player.position.X + (float)Player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)Player.direction) + ((float)Main.mouseX + Main.screenPosition.X - Player.position.X), Player.MountedCenter.Y - 600f);
vector2.X = (vector2.X + Player.Center.X) / 2f + (float)Main.rand.Next(-200, 201);
vector2.Y -= 100f;
num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X;
num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y;
if (num79 < 0f)
{
num79 *= -1f;
}
if (num79 < 20f)
{
num79 = 20f;
}
num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79));
num80 = num72 / num80;
}
num78 *= num80;
num79 *= num80;
float speedX4 = num78 + (float)Main.rand.Next(-30, 31) * 0.02f;
float speedY5 = num79 + (float)Main.rand.Next(-30, 31) * 0.02f;
int p = Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5, type, (int)(damage * 0.07), knockBack * 0.5f, Player.whoAmI);
vector2 = new Vector2(Player.position.X + (float)Player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)Player.direction) + ((float)Main.mouseX + Main.screenPosition.X - Player.position.X), Player.MountedCenter.Y - 600f);
vector2.X = (vector2.X + Player.Center.X) / 2f + (float)Main.rand.Next(-200, 201);
vector2.Y -= 100f;
num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X;
num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y;
if (num79 < 0f)
{
num79 *= -1f;
}
if (num79 < 20f)
{
num79 = 20f;
}
num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79));
num80 = num72 / num80;
num78 *= num80;
num79 *= num80;
float speedX4 = num78 + (float)Main.rand.Next(-30, 31) * 0.02f;
float speedY5 = num79 + (float)Main.rand.Next(-30, 31) * 0.02f;
int p = Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5, type, (int)(damage * 0.075), knockBack * 0.5f, Player.whoAmI);
if (p.WithinBounds(Main.maxProjectiles))
{
Main.projectile[p].DamageType = DamageClass.Generic; //Makes it not proc shit like nanotech, extorter and other stuff
Main.projectile[p].Calamity().LocketClone = true; //To not have clones trigger effects like Sacrifice's Lifesteal and Final Dawn's stealth generation
}
if (p.WithinBounds(Main.maxProjectiles))
Main.projectile[p].DamageType = DamageClass.Generic; //in case melee/rogue variants bug out
// Handle AI edge-cases.
if (item.type == ModContent.ItemType<FinalDawn>())
Main.projectile[p].ai[1] = 1f;
if (item.type == ModContent.ItemType<TheAtomSplitter>())
Main.projectile[p].ai[0] = -1f;
// Handle AI edge-cases. These are like overlapping projectiles and the projectile not spawning at all
if (item.type == ModContent.ItemType<FinalDawn>())
Main.projectile[p].ai[1] = 1f; //MUST BE 1 OTHERWISE CLONES GENERATE STEALTH AAAAAAAAAAA
if (item.type == ModContent.ItemType<TheAtomSplitter>())
Main.projectile[p].ai[0] = -1f;
}
if (StealthStrikeAvailable())
{
int knifeCount = 16;
int knifeDamage = (int)Player.GetTotalDamage<RogueDamageClass>().ApplyTo(60);
int knifeCount = 12;
int knifeDamage = (int)Player.GetTotalDamage<RogueDamageClass>().ApplyTo(70);
float angleStep = MathHelper.TwoPi / knifeCount;
float speed = 15f;
@@ -4063,7 +4044,7 @@ namespace CalamityMod.CalPlayer
}
else if (AresExoskeleton.ArmExists(Player))
Player.body = EquipLoader.GetEquipSlot(Mod, "AresExoskeleton", EquipType.Body);
else if ((abyssalDivingSuitPower || abyssalDivingSuitForce) && !abyssalDivingSuitHide)
{
Player.legs = EquipLoader.GetEquipSlot(Mod, "AbyssalDivingSuit", EquipType.Legs);
@@ -4657,6 +4638,7 @@ namespace CalamityMod.CalPlayer
if (Player.whoAmI == Main.myPlayer && !endoCooper && randAmt > 0 && Main.rand.NextBool(randAmt) && chaseable)
{
int spearsFired = 0;
for (int i = 0; i < Main.projectile.Length; i++)
{
if (spearsFired == 2)
@@ -4664,24 +4646,15 @@ namespace CalamityMod.CalPlayer
if (Main.projectile[i].owner == Player.whoAmI && Main.projectile[i].friendly)
{
bool attack = Main.projectile[i].owner == Player.whoAmI && Main.projectile[i].type == ModContent.ProjectileType<MiniGuardianAttack>();
bool defense = Main.projectile[i].owner == Player.whoAmI && Main.projectile[i].type == ModContent.ProjectileType<MiniGuardianDefense>();
if (attack || defense)
if (attack)
{
int numSpears = attack ? 12 : 6;
int dam = Main.projectile[i].originalDamage;
if (!attack)
dam = (int)(dam * 0.5f);
float angleVariance = MathHelper.TwoPi / (float)numSpears;
float spinOffsetAngle = MathHelper.Pi / (2f * numSpears);
int numSpears = profanedCrystalBuffs ? 12 : 6;
int dam = (int)(Main.projectile[i].originalDamage * (profanedCrystalBuffs ? 1f : 0.25f));
for (int x = 0; x < numSpears; x++)
{
Vector2 posVec = new Vector2(8f, 0f).RotatedByRandom(MathHelper.TwoPi);
posVec = posVec.RotatedBy(angleVariance);
Vector2 velocity = new Vector2(posVec.X, posVec.Y).RotatedBy(spinOffsetAngle);
velocity.Normalize();
velocity *= 8f;
int proj = Projectile.NewProjectile(source, Main.projectile[i].Center + posVec, velocity, ModContent.ProjectileType<MiniGuardianSpear>(), dam, 0f, Player.whoAmI, 0f, 0f);
float angle = MathHelper.TwoPi / numSpears * x;
int proj = Projectile.NewProjectile(source, Main.projectile[i].Center, angle.ToRotationVector2().RotatedBy(Math.Atan(-45f)) * 8f, ModContent.ProjectileType<MiniGuardianSpear>(), dam, 0f, Player.whoAmI, 0f, 0f);
Main.projectile[proj].originalDamage = dam;
}
spearsFired++;
@@ -4730,7 +4703,6 @@ namespace CalamityMod.CalPlayer
public override void PostUpdate() //needs to be here else it doesn't work properly, otherwise i'd have stuck it with the wing anim stuffs
{
ProfanedSoulCrystal.DetermineTransformationEligibility(Player);
if (!profanedCrystalHide && (profanedCrystal || profanedCrystalForce) && Player.legs == EquipLoader.GetEquipSlot(Mod, "ProfanedSoulCrystal", EquipType.Legs))
{
bool usingCarpet = Player.carpetTime > 0 && Player.controlJump; //doesn't make sense for carpet to use jump frame since you have solid ground
+1 -1
View File
@@ -666,7 +666,7 @@ namespace CalamityMod.CalPlayer
ModContent.ItemType<HalleysInferno>(),
ModContent.ItemType<CleansingBlaze>(),
ModContent.ItemType<ElementalEruption>(),
ModContent.ItemType<GodsBellows>(),
ModContent.ItemType<DeadSunsWind>(),
ModContent.ItemType<Meowthrower>(),
ModContent.ItemType<OverloadedBlaster>(),
ModContent.ItemType<TerraFlameburster>(),
+100 -53
View File
@@ -25,6 +25,7 @@ using CalamityMod.NPCs.Abyss;
using CalamityMod.NPCs.ExoMechs.Apollo;
using CalamityMod.NPCs.NormalNPCs;
using CalamityMod.NPCs.Other;
using CalamityMod.NPCs.ProfanedGuardians;
using CalamityMod.NPCs.Providence;
using CalamityMod.NPCs.SunkenSea;
using CalamityMod.NPCs.SupremeCalamitas;
@@ -330,7 +331,7 @@ namespace CalamityMod.CalPlayer
if (vHex)
{
// Unique messages appear half the time during each individual stage of SCal's fight
string vHexKeyToUse = "Status.Death.VulnerabilityHex";
string vHexKeyToUse = "Status.Death.VulnerabilityHex" + Main.rand.Next(1, 3 + 1);
if (Main.rand.NextBool() && CalamityGlobalNPC.SCal != -1)
{
if (CalamityGlobalNPC.SCalGrief != -1)
@@ -349,26 +350,26 @@ namespace CalamityMod.CalPlayer
}
if (ZoneCalamity && Player.lavaWet)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.SearingLava").Format(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.SearingLava" + Main.rand.Next(1, 2 + 1)).Format(Player.name));
}
if (gsInferno)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.GodSlayerInferno").Format(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.GodSlayerInferno" + Main.rand.Next(1, 3 + 1)).Format(Player.name));
}
if (sulphurPoison)
{
if (Main.rand.NextBool(2))
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.SulphuricPoisoning").Format(Player.name));
if (!Main.rand.NextBool(4)) // 75% custom
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.SulphuricPoisoning" + Main.rand.Next(1, 3 + 1)).Format(Player.name));
else
damageSource = PlayerDeathReason.ByOther(9);
damageSource = PlayerDeathReason.ByOther(9); // 25% generic Poisoned death text
}
if (dragonFire)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Dragonfire").Format(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Dragonfire" + Main.rand.Next(1, 4 + 1)).Format(Player.name));
}
if (miracleBlight)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.MiracleBlight" + Main.rand.Next(1, 2 + 1)).Format(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.MiracleBlight" + Main.rand.Next(1, 3 + 1)).Format(Player.name));
}
if (hInferno)
{
@@ -376,7 +377,7 @@ namespace CalamityMod.CalPlayer
}
if (hFlames || banishingFire)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.HolyFlames").Format(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.HolyFlames" + Main.rand.Next(1, 3 + 1)).Format(Player.name));
}
if (shadowflame)
{
@@ -384,27 +385,27 @@ namespace CalamityMod.CalPlayer
}
if (bBlood)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.BurningBlood").Format(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.BurningBlood" + Main.rand.Next(1, 2 + 1)).Format(Player.name));
}
if (cDepth)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.CrushDepth" + Main.rand.Next(1, 2 + 1)).Format(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.CrushDepth" + Main.rand.Next(1, 3 + 1)).Format(Player.name));
}
if (rTide)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Riptide").Format(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Riptide" + Main.rand.Next(1, 2 + 1)).Format(Player.name));
}
if (bFlames || weakBrimstoneFlames)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.BrimstoneFlames").Format(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.BrimstoneFlames" + Main.rand.Next(1, 3 + 1)).Format(Player.name));
}
if (pFlames)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Plague" + Main.rand.Next(1, 2 + 1)).Format(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Plague" + Main.rand.Next(1, 3 + 1)).Format(Player.name));
}
if (astralInfection)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.AstralInfection" + Main.rand.Next(1, 2 + 1)).Format(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.AstralInfection" + Main.rand.Next(1, 3 + 1)).Format(Player.name));
}
if (nightwither)
{
@@ -746,7 +747,7 @@ namespace CalamityMod.CalPlayer
}
// Can't have any cooldowns here because dodges grrrrr....
if (fleshTotem && !Player.HasCooldown(Cooldowns.FleshTotem.ID))
if (fleshTotem && !Player.HasCooldown(Cooldowns.FleshTotem.ID) && TotalEnergyShielding <= 0)
contactDamageReduction += 0.5;
if (tarragonCloak && tarraMelee && !Player.HasCooldown(Cooldowns.TarragonCloak.ID))
@@ -764,12 +765,6 @@ namespace CalamityMod.CalPlayer
npc.Calamity().relicOfResilienceWeakness = 0;
}
if (beeResist)
{
if (CalamityLists.beeEnemyList.Contains(npc.type))
contactDamageReduction += 0.25;
}
if (eskimoSet)
{
if (npc.coldDamage)
@@ -1027,12 +1022,6 @@ namespace CalamityMod.CalPlayer
projectileDamageReduction += 0.5;
}
if (beeResist)
{
if (CalamityLists.beeProjectileList.Contains(proj.type))
projectileDamageReduction += 0.25;
}
if (trinketOfChiBuff)
projectileDamageReduction += 0.1;
@@ -1157,20 +1146,20 @@ namespace CalamityMod.CalPlayer
// As such, to avoid cooldowns proccing from dodge hits, do it here
if (fleshTotem && !Player.HasCooldown(Cooldowns.FleshTotem.ID) && hurtInfo.Damage > 0)
Player.AddCooldown(Cooldowns.FleshTotem.ID, CalamityUtils.SecondsToFrames(20), true, coreOfTheBloodGod ? "bloodgod" : "default");
if (NPC.AnyNPCs(ModContent.NPCType<THELORDE>()))
{
Player.AddBuff(ModContent.BuffType<NOU>(), 15, true);
}
if (crawCarapace)
{
npc.AddBuff(ModContent.BuffType<Crumbling>(), 720);
npc.AddBuff(ModContent.BuffType<Crumbling>(), 900);
SoundEngine.PlaySound(SoundID.NPCHit33 with { Volume = 0.5f }, Player.Center);
}
if (baroclaw)
{
npc.AddBuff(ModContent.BuffType<ArmorCrunch>(), 1800);
npc.AddBuff(ModContent.BuffType<CrushDepth>(), 1800);
npc.AddBuff(ModContent.BuffType<ArmorCrunch>(), 900);
npc.AddBuff(ModContent.BuffType<CrushDepth>(), 900);
SoundEngine.PlaySound(BaroclawHit, Player.Center);
Vector2 bloodSpawnPosition = Player.Center + Main.rand.NextVector2Circular(Player.width, Player.height) * 0.04f;
Vector2 splatterDirection = (Player.Center - bloodSpawnPosition).SafeNormalize(Vector2.UnitY);
@@ -1189,7 +1178,7 @@ namespace CalamityMod.CalPlayer
if (absorber)
{
npc.AddBuff(ModContent.BuffType<AbsorberAffliction>(), 1800);
npc.AddBuff(ModContent.BuffType<AbsorberAffliction>(), 900);
SoundEngine.PlaySound(AbsorberHit, Player.Center);
Vector2 bloodSpawnPosition = Player.Center + Main.rand.NextVector2Circular(Player.width, Player.height) * 0.04f;
Vector2 splatterDirection = (Player.Center - bloodSpawnPosition).SafeNormalize(Vector2.UnitY);
@@ -1407,9 +1396,9 @@ namespace CalamityMod.CalPlayer
#region Free and Consumable Dodge Hooks
public override bool FreeDodge(Player.HurtInfo info)
{
// God Slayer Damage Resistance makes you ignore hits that came in as less than 80.
// Alternatively, if the incoming damage is somehow less than 1 (TML doesn't allow this, but...), the hit is completely ignored.
if (info.Damage < 1 || (godSlayerDamage && info.Damage <= 80))
// 22AUG2023: Ozzatron: god slayer damage resistance removed due to it being strong enough to godmode rev yharon
// If the incoming damage is somehow less than 1 (TML doesn't allow this, but...), the hit is completely ignored.
if (info.Damage < 1 /* || (godSlayerDamage && info.Damage <= 80) */)
return true;
// If this hit was marked to be completely ignored due to shield absorption, then ignore it.
@@ -1537,6 +1526,12 @@ namespace CalamityMod.CalPlayer
SoundEngine.PlaySound(TheSponge.ShieldHurtSound, Player.Center);
hurtSoundTimer = 20;
}
else if (((pSoulArtifact && !profanedCrystal) || profanedCrystalBuffs) && pSoulShieldDurability > 0)
{
modifiers.DisableSound();
SoundEngine.PlaySound(ProfanedGuardianDefender.ShieldDeathSound);
hurtSoundTimer = 20;
}
else if ((profanedCrystal || profanedCrystalForce) && !profanedCrystalHide)
{
modifiers.DisableSound();
@@ -1629,9 +1624,10 @@ namespace CalamityMod.CalPlayer
private void ModifyHurtInfo_Calamity(ref Player.HurtInfo info)
{
// Boss Rush's damage floor is implemented as a dirty modifier
// TODO -- implementing this correctly would require fully reimplementing all of DR and ADR
if (BossRushEvent.BossRushActive)
{
int bossRushDamageFloor = (Main.expertMode ? 400 : 240) + (BossRushEvent.BossRushStage * 2);
int bossRushDamageFloor = (Main.expertMode ? 160 : 100) + (BossRushEvent.BossRushStage * 2);
if (info.Damage < bossRushDamageFloor)
info.Damage += (bossRushDamageFloor - info.Damage);
}
@@ -1643,6 +1639,7 @@ namespace CalamityMod.CalPlayer
// Currently implemented energy shields:
// - Rover Drive
// - Lunic Corps Armor set bonus
// - Profaned Soul Artifact/Crystal
// - The Sponge
//
// If the shield(s) completely absorb the hit, iframes are granted on the spot and the hit is marked to be dodged.
@@ -1720,6 +1717,39 @@ namespace CalamityMod.CalPlayer
// Actually remove damage from the incoming hit, so that later shields have less damage incoming.
info.Damage -= masterChefDamageBlocked;
}
// PSA
if (pSoulArtifact && pSoulShieldDurability > 0 && !shieldsFullyAbsorbedHit)
{
// Check whether this shield can fully absorb the incoming hit (or what's left of it).
bool thisShieldCanFullyAbsorb = pSoulShieldDurability >= info.Damage;
// Tally up how much damage was blocked by this shield.
int pSoulDamageBlocked = Math.Min(pSoulShieldDurability, info.Damage);
totalDamageBlocked += pSoulDamageBlocked;
// Deal all incoming damage to this shield, because it is available.
pSoulShieldDurability -= info.Damage;
shieldsTookHit = true;
// Hits which break the PSA shield cause a sound and slight screen shake.
// Multiple shields breaking simultaneously has slightly stronger screen shake.
if (pSoulShieldDurability <= 0)
{
pSoulShieldDurability = 0;
SoundEngine.PlaySound(SoundID.Lavafall, Player.Center);
Player.Calamity().GeneralScreenShakePower += anyShieldBroke ? 0.5f : 2f;
anyShieldBroke = true;
}
// Mark the hit as being canceled if this shield has enough durability to fully absorb it.
// This prevents further shields from attempting to absorb the hit.
if (thisShieldCanFullyAbsorb)
shieldsFullyAbsorbedHit = true;
// Actually remove damage from the incoming hit, so that later shields have less damage incoming.
info.Damage -= pSoulDamageBlocked;
}
// THE SPONGE
if (sponge && SpongeShieldDurability > 0 && !shieldsFullyAbsorbedHit)
@@ -1767,20 +1797,33 @@ namespace CalamityMod.CalPlayer
// Spawn particles when hit with the shields up, regardless of whether or not the shields broke.
// More particles spawn if a shield broke.
int numParticles = Main.rand.Next(2, 6) + (anyShieldBroke ? 6 : 0);
for (int i = 0; i < numParticles; i++)
if (pSoulArtifact)
{
// Rover Drive has slightly higher particle velocity
float maxVelocity = roverDrive ? 14f : 7f;
Vector2 velocity = Main.rand.NextVector2CircularEdge(1f, 1f) * Main.rand.NextFloat(3f, maxVelocity);
velocity.X += 5f * info.HitDirection;
for (int i = 0; i < Main.rand.Next(4, 8); i++) //very light dust
{
Dust dust = Dust.NewDustDirect(Player.position, Player.width, Player.height, (int)CalamityDusts.ProfanedFire);
dust.velocity = Main.rand.NextVector2Circular(3.5f, 3.5f);
dust.velocity.Y -= Main.rand.NextFloat(1f, 3f);
dust.scale = Main.rand.NextFloat(1.15f, 1.45f);
}
}
else
{
int numParticles = Main.rand.Next(2, 6) + (anyShieldBroke ? 6 : 0);
for (int i = 0; i < numParticles; i++)
{
// Rover Drive has slightly higher particle velocity
float maxVelocity = roverDrive ? 14f : 7f;
Vector2 velocity = Main.rand.NextVector2CircularEdge(1f, 1f) * Main.rand.NextFloat(3f, maxVelocity);
velocity.X += 5f * info.HitDirection;
float scale = Main.rand.NextFloat(2.5f, 3f);
Color particleColor = Main.rand.NextBool() ? new Color(99, 255, 229) : new Color(25, 132, 247);
int lifetime = 25;
float scale = Main.rand.NextFloat(2.5f, 3f);
Color particleColor = Main.rand.NextBool() ? new Color(99, 255, 229) : new Color(25, 132, 247);
int lifetime = 25;
var shieldParticle = new TechyHoloysquareParticle(Player.Center, velocity, scale, particleColor, lifetime);
GeneralParticleHandler.SpawnParticle(shieldParticle);
var shieldParticle = new TechyHoloysquareParticle(Player.Center, velocity, scale, particleColor, lifetime);
GeneralParticleHandler.SpawnParticle(shieldParticle);
}
}
// Update Rover Drive durability on the cooldown rack.
@@ -1791,6 +1834,10 @@ namespace CalamityMod.CalPlayer
if (lunicCorpsSet && cooldowns.TryGetValue(Cooldowns.LunicCorpsShieldDurability.ID, out var masterChefDurabilityCD))
masterChefDurabilityCD.timeLeft = LunicCorpsShieldDurability;
// Update PSA/PSC durability on the cooldown rack
if ((pSoulArtifact && (!profanedCrystal || profanedCrystalBuffs)) && cooldowns.TryGetValue(Cooldowns.ProfanedSoulShield.ID, out var profanedSoulDurabilityCD))
profanedSoulDurabilityCD.timeLeft = pSoulShieldDurability;
// Update Sponge durability on the cooldown rack.
if (sponge && cooldowns.TryGetValue(SpongeDurability.ID, out var spongeDurabilityCD))
spongeDurabilityCD.timeLeft = SpongeShieldDurability;
@@ -1808,6 +1855,9 @@ namespace CalamityMod.CalPlayer
if (lunicCorpsSet)
Player.AddCooldown(LunicCorpsShieldRecharge.ID, LunicCorpsHelmet.ShieldRechargeDelay, true);
if (pSoulArtifact && (!profanedCrystal || profanedCrystalBuffs))
Player.AddCooldown(ProfanedSoulShieldRecharge.ID, profanedCrystalBuffs ? (60 * 5) : (60 * 10), true); // 5 seconds psc, 10 seconds psa
// Set The Sponge's recharge delay to full. Override any existing cooldown instance.
if (sponge)
Player.AddCooldown(SpongeRecharge.ID, TheSponge.ShieldRechargeDelay, true);
@@ -2185,9 +2235,6 @@ namespace CalamityMod.CalPlayer
#region Post Hurt
public override void PostHurt(Player.HurtInfo hurtInfo)
{
if (pArtifact && !profanedCrystal)
Player.AddCooldown(Cooldowns.ProfanedSoulArtifact.ID, CalamityUtils.SecondsToFrames(5));
// Silver Armor medkit timer
if (silverMedkit && hurtInfo.Damage >= SilverArmorSetChange.SetBonusMinimumDamageToHeal)
silverMedkitTimer = SilverArmorSetChange.SetBonusHealTime;
@@ -2542,7 +2589,7 @@ namespace CalamityMod.CalPlayer
if (abyssDeath)
{
SoundEngine.PlaySound(DrownSound, Player.Center);
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.AbyssDrown" + Main.rand.Next(1, 2 + 1)).Format(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.AbyssDrown" + Main.rand.Next(1, 3 + 1)).Format(Player.name));
}
else if (CalamityWorld.armageddon && areThereAnyDamnBosses)
{
+294 -379
View File
@@ -1,18 +1,19 @@
using CalamityMod.Items.Accessories;
using System;
using System.Linq;
using CalamityMod.Buffs.Alcohol;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Cooldowns;
using CalamityMod.Events;
using CalamityMod.Items.Accessories;
using CalamityMod.NPCs;
using CalamityMod.Projectiles.Ranged;
using CalamityMod.Systems;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.ModLoader;
using Terraria.DataStructures;
using CalamityMod.Systems;
using System.Linq;
using Terraria.GameContent.ItemDropRules;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.CalPlayer
{
@@ -24,141 +25,94 @@ namespace CalamityMod.CalPlayer
if (Player.ownedProjectileCounts[ModContent.ProjectileType<BloodBoilerFire>()] > 0)
noLifeRegen = true;
bool death = CalamityWorld.death || BossRushEvent.BossRushActive;
double lifeRegenMult = death ? 1.5 : 1D;
if (reaverDefense)
lifeRegenMult *= 0.8;
int lifeRegenLost = 0;
// Universal +50% increase to DoT debuff damage in Death Mode
float deathNegativeRegenBonus = 0.5f;
float calamityDebuffMultiplier = 1f + (CalamityWorld.death ? deathNegativeRegenBonus : 0f);
// Initial Debuffs
// Cumulative amount of DoT debuff negative life regen from Calamity debuffs (or changes to vanilla debuffs)
float totalNegativeLifeRegen = 0;
// Get fucked, Nebula Armor
Player.nebulaLevelLife = 0;
#region Damage over Time Debuffs (Negative Life Regen)
// Vanilla
if (death)
// Vanilla debuffs (+50% damage over time in Death Mode is applied here)
if (CalamityWorld.death)
{
if (Player.poisoned)
lifeRegenLost += 4;
int totalVanillaDoT = 0;
if (Player.onFire)
lifeRegenLost += 8;
if (Player.poisoned && !purity)
totalVanillaDoT += 4;
if (Player.onFire && !purity)
totalVanillaDoT += 8;
if (Player.tongued)
lifeRegenLost += 100;
totalVanillaDoT += 100;
if (Player.venom)
lifeRegenLost += 12;
if (Player.venom && !purity)
totalVanillaDoT += 12;
if (Player.onFrostBurn)
lifeRegenLost += 12;
if (Player.onFrostBurn && !purity)
totalVanillaDoT += 12;
if (Player.onFire2)
lifeRegenLost += 12;
if (Player.onFire2 && !purity)
totalVanillaDoT += 12;
if (Player.burned)
lifeRegenLost += 60;
totalVanillaDoT += 60;
if (Player.suffocating)
lifeRegenLost += 40;
totalVanillaDoT += 40;
if (Player.electrified)
if (Player.electrified && !purity)
{
lifeRegenLost += 8;
totalVanillaDoT += 8;
if (Player.controlLeft || Player.controlRight)
lifeRegenLost += 32;
totalVanillaDoT += 32;
}
// Tally up total current vanilla DoT so it can be added as extra DoT from Death Mode
totalNegativeLifeRegen += totalVanillaDoT * deathNegativeRegenBonus;
}
// Calamity
if (shadowflame)
//
// Calamity debuffs (Vanilla Shadowflame is added here)
//
void ApplyDoTDebuff(bool hasDebuff, int negativeLifeRegenToApply, bool immuneCondition = false)
{
if (!hasDebuff || immuneCondition)
return;
if (Player.lifeRegen > 0)
Player.lifeRegen = 0;
Player.lifeRegenTime = 0;
lifeRegenLost += 30;
totalNegativeLifeRegen += negativeLifeRegenToApply * calamityDebuffMultiplier;
}
if (wDeath)
{
if (Player.lifeRegen > 0)
Player.lifeRegen = 0;
// Whispering Death sets positive regen to zero but doesn't actually deal any damage
ApplyDoTDebuff(wDeath, 0);
Player.lifeRegenTime = 0;
}
if (weakBrimstoneFlames)
{
if (Player.lifeRegen > 0)
Player.lifeRegen = 0;
Player.lifeRegenTime = 0;
lifeRegenLost += 7;
}
if (bFlames)
{
if (Player.lifeRegen > 0)
Player.lifeRegen = 0;
Player.lifeRegenTime = 0;
lifeRegenLost += 16;
}
if (nightwither)
{
if (Player.lifeRegen > 0)
Player.lifeRegen = 0;
Player.lifeRegenTime = 0;
lifeRegenLost += 16;
}
if (vaporfied)
{
if (Player.lifeRegen > 0)
Player.lifeRegen = 0;
Player.lifeRegenTime = 0;
lifeRegenLost += 8;
}
if (cragsLava)
{
if (Player.lifeRegen > 0)
Player.lifeRegen = 0;
Player.lifeRegenTime = 0;
lifeRegenLost += 30;
}
if (gsInferno)
{
if (Player.lifeRegen > 0)
Player.lifeRegen = 0;
Player.lifeRegenTime = 0;
lifeRegenLost += profanedCrystalBuffs ? 35 : 30;
}
if (astralInfection)
{
if (Player.lifeRegen > 0)
Player.lifeRegen = 0;
Player.lifeRegenTime = 0;
lifeRegenLost += 20;
}
if (irradiated)
{
if (Player.lifeRegen > 0)
Player.lifeRegen = 0;
Player.lifeRegenTime = 0;
lifeRegenLost += 4;
}
ApplyDoTDebuff(irradiated, 4, purity);
int sulphurDoT = 6 - (sulfurSet ? 2 : 0) - (sulphurskin ? 2 : 0);
ApplyDoTDebuff(sulphurPoison, sulphurDoT, purity);
ApplyDoTDebuff(rTide, 6, purity);
ApplyDoTDebuff(weakBrimstoneFlames, 7);
ApplyDoTDebuff(bBlood, 8, purity);
ApplyDoTDebuff(vaporfied, 8, purity);
ApplyDoTDebuff(bFlames, 16, purity);
ApplyDoTDebuff(nightwither, 16, purity);
ApplyDoTDebuff(hFlames, 16, purity);
ApplyDoTDebuff(vHex, 16);
ApplyDoTDebuff(cDepth, 18, purity);
ApplyDoTDebuff(astralInfection, 20, infectedJewel || purity);
ApplyDoTDebuff(pFlames, 20, purity);
ApplyDoTDebuff(cragsLava, 30);
ApplyDoTDebuff(shadowflame, 30, purity);
// Profaned Soul Crystal turns you into Providence, a God, and you take more damage from God Slayer Inferno
ApplyDoTDebuff(gsInferno, profanedCrystalBuffs ? 35 : 30);
ApplyDoTDebuff(dragonFire, 36);
ApplyDoTDebuff(miracleBlight, 40);
ApplyDoTDebuff(banishingFire, 60);
// Slowly increase the sulphuric water poisoning effect. Once it's high enough, the player starts taking damage over time.
bool nearSafeZone = false;
@@ -199,116 +153,20 @@ namespace CalamityMod.CalPlayer
}
else
SulphWaterPoisoningLevel = MathHelper.Clamp(SulphWaterPoisoningLevel - 1f / SulphSeaWaterRecoveryTime, 0f, 1f);
#endregion
if (sulphurPoison)
{
if (Player.lifeRegen > 0)
Player.lifeRegen = 0;
Player.lifeRegenTime = 0;
lifeRegenLost += 6;
if (sulfurSet)
{
lifeRegenLost -= 2;
}
if (sulphurskin)
{
lifeRegenLost -= 2;
}
}
if (hFlames)
{
if (Player.lifeRegen > 0)
Player.lifeRegen = 0;
Player.lifeRegenTime = 0;
lifeRegenLost += 16;
}
if (banishingFire)
{
if (Player.lifeRegen > 0)
Player.lifeRegen = 0;
Player.lifeRegenTime = 0;
lifeRegenLost += 60;
}
if (pFlames)
{
if (Player.lifeRegen > 0)
Player.lifeRegen = 0;
Player.lifeRegenTime = 0;
lifeRegenLost += 20;
}
if (bBlood)
{
if (Player.lifeRegen > 0)
Player.lifeRegen = 0;
Player.lifeRegenTime = 0;
lifeRegenLost += 8;
}
if (vHex)
{
if (Player.lifeRegen > 0)
Player.lifeRegen = 0;
Player.lifeRegenTime = 0;
lifeRegenLost += 16;
}
if (dragonFire)
{
if (Player.lifeRegen > 0)
Player.lifeRegen = 0;
Player.lifeRegenTime = 0;
lifeRegenLost += 36;
}
if (miracleBlight)
{
if (Player.lifeRegen > 0)
Player.lifeRegen = 0;
Player.lifeRegenTime = 0;
lifeRegenLost += 40;
}
if (cDepth)
{
if (Player.lifeRegen > 0)
Player.lifeRegen = 0;
Player.lifeRegenTime = 0;
lifeRegenLost += 18;
}
if (rTide)
{
if (Player.lifeRegen > 0)
Player.lifeRegen = 0;
Player.lifeRegenTime = 0;
lifeRegenLost += 6;
}
#region Alcohol
if (vodka)
{
alcoholPoisonLevel++;
lifeRegenLost += 1;
totalNegativeLifeRegen += 1;
}
if (redWine)
{
alcoholPoisonLevel++;
lifeRegenLost += 1;
totalNegativeLifeRegen += 1;
if (baguette)
lifeRegenLost += 3;
totalNegativeLifeRegen += 3;
}
if (grapeBeer)
{
@@ -317,7 +175,7 @@ namespace CalamityMod.CalPlayer
if (moonshine)
{
alcoholPoisonLevel++;
lifeRegenLost += 1;
totalNegativeLifeRegen += 1;
}
if (rum)
{
@@ -330,7 +188,7 @@ namespace CalamityMod.CalPlayer
if (fireball)
{
alcoholPoisonLevel++;
lifeRegenLost += 1;
totalNegativeLifeRegen += 1;
}
if (whiskey)
{
@@ -339,27 +197,27 @@ namespace CalamityMod.CalPlayer
if (everclear)
{
alcoholPoisonLevel += 2;
lifeRegenLost += 10;
totalNegativeLifeRegen += 10;
}
if (bloodyMary)
{
alcoholPoisonLevel++;
lifeRegenLost += 4;
totalNegativeLifeRegen += 4;
}
if (tequila)
{
alcoholPoisonLevel++;
lifeRegenLost += 1;
totalNegativeLifeRegen += 1;
}
if (tequilaSunrise)
{
alcoholPoisonLevel++;
lifeRegenLost += 2;
totalNegativeLifeRegen += 2;
}
if (screwdriver)
{
alcoholPoisonLevel++;
lifeRegenLost += 1;
totalNegativeLifeRegen += 1;
}
if (caribbeanRum)
{
@@ -372,27 +230,27 @@ namespace CalamityMod.CalPlayer
if (margarita)
{
alcoholPoisonLevel++;
lifeRegenLost += 1;
totalNegativeLifeRegen += 1;
}
if (starBeamRye)
{
alcoholPoisonLevel++;
lifeRegenLost += 2;
totalNegativeLifeRegen += 2;
}
if (moscowMule)
{
alcoholPoisonLevel++;
lifeRegenLost += 4;
totalNegativeLifeRegen += 4;
}
if (whiteWine)
{
alcoholPoisonLevel++;
lifeRegenLost += 1;
totalNegativeLifeRegen += 1;
}
if (evergreenGin)
{
alcoholPoisonLevel++;
lifeRegenLost += 1;
totalNegativeLifeRegen += 1;
}
if (Player.tipsy)
{
@@ -410,14 +268,16 @@ namespace CalamityMod.CalPlayer
Player.lifeRegen = 0;
Player.lifeRegenTime = 0;
lifeRegenLost += 3 * alcoholPoisonLevel;
totalNegativeLifeRegen += 3 * alcoholPoisonLevel;
}
#endregion
if (manaOverloader)
{
if (Player.statMana > (int)(Player.statManaMax2 * 0.5))
lifeRegenLost += 3;
totalNegativeLifeRegen += 3;
}
if (brimflameFrenzy)
{
Player.manaRegen = 0;
@@ -425,7 +285,7 @@ namespace CalamityMod.CalPlayer
Player.manaRegenDelay = (int) Player.maxRegenDelay;
if (Player.lifeRegen > 0)
Player.lifeRegen = 0;
lifeRegenLost += 42; //the meaning of death
totalNegativeLifeRegen += 42; //the meaning of death
}
if (witheredDebuff)
@@ -437,7 +297,7 @@ namespace CalamityMod.CalPlayer
}
else
{
lifeRegenLost += (int)(5D * Math.Pow(1.5D, witheredWeaponHoldTime / 87D));
totalNegativeLifeRegen += (int)(5D * Math.Pow(1.5D, witheredWeaponHoldTime / 87D));
if (Player.lifeRegen > 0)
Player.lifeRegen = 0;
}
@@ -450,14 +310,62 @@ namespace CalamityMod.CalPlayer
int debuffIndex = Player.FindBuffIndex(ModContent.BuffType<ManaBurn>());
float debuffIntensity = debuffIndex == -1 ? 0f : Player.buffTime[debuffIndex] / (float)Player.manaSickTimeMax;
lifeRegenLost += (int)(Math.Sqrt(debuffIntensity) * Math.Pow(6D, debuffIntensity + 1f));
totalNegativeLifeRegen += (int)(Math.Sqrt(debuffIntensity) * Math.Pow(6D, debuffIntensity + 1f));
if (Player.lifeRegen > 0)
Player.lifeRegen = 0;
}
Player.lifeRegen -= (int)(lifeRegenLost * lifeRegenMult);
//
// ACTUALLY APPLY NEGATIVE LIFE REGEN
//
// Buffs
// At the last second, Reaver defense helm reduces DoT debuffs by 20%
if (reaverDefense)
totalNegativeLifeRegen = (int)(0.8f * totalNegativeLifeRegen);
Player.lifeRegen -= (int)totalNegativeLifeRegen;
#region Life Regen That Works Even During DoT Debuffs
// Honey Dew (and upgrades)
if (alwaysHoneyRegen)
{
// Exact copy of vanilla Honey behavior, but does not stack with actually standing in Honey
if (!Player.honey)
{
Player.lifeRegen += 2;
Player.lifeRegenTime += 1;
// Grants +2 life regen if negative life regen would otherwise occur.
// However, this can't bring regen into the positives.
if (Player.lifeRegen < 0)
{
Player.lifeRegen += 2;
if (Player.lifeRegen > 0)
Player.lifeRegen = 0;
}
}
}
if (honeyDewHalveDebuffs)
{
// Tick down all sickness debuffs; this makes them expire 2x faster
// Upgrades increase the sets of debuffs which expire faster
for (int l = 0; l < Player.MaxBuffs; ++l)
{
int buffID = Player.buffType[l];
if (Player.buffTime[l] <= 2)
continue;
bool shouldHalveDuration = CalamityLists.sicknessDebuffList.Contains(buffID);
if (livingDewHalveDebuffs)
shouldHalveDuration |= CalamityLists.fireDebuffList.Contains(buffID);
if (purity)
shouldHalveDuration |= CalamityLists.debuffList.Contains(buffID);
if (shouldHalveDuration)
--Player.buffTime[l];
}
}
if (divineBless)
{
@@ -496,76 +404,136 @@ namespace CalamityMod.CalPlayer
}
// Permafrost's Concoction increases life regen while afflicted with a fire debuff
if (permafrostsConcoction)
if (permafrostsConcoction && Player.buffType.Any(CalamityLists.fireDebuffList.Contains))
{
if (Player.onFire || Player.onFire2 || Player.onFire3 || Player.burned || shadowflame || weakBrimstoneFlames || bFlames || cragsLava || gsInferno || hFlames || banishingFire || dragonFire)
if (Player.lifeRegenTime < 1800)
Player.lifeRegenTime = 1800;
Player.lifeRegen += 6;
}
// Grant life regen based on missing health for Radiant Ooze, Ambrosial Ampule, and purity
if (rOoze || aAmpoule || purity)
{
float missingLifeRatio = (Player.statLifeMax2 - Player.statLife) / Player.statLifeMax2;
//Ambrosial Ampule and ooze give between 2 and 6 hp/s, Purity gives between 3 and 7 hp/s
float lifeRegenToGive = MathHelper.Lerp( purity ? 6f : 4f, purity ? 14f : 12f, missingLifeRatio);
Player.lifeRegen += (int)lifeRegenToGive;
}
if (purity)
{
int intendedPurityDefense = 0;
int currentDebuffs = Player.buffType.Count(CalamityLists.debuffList.Contains);
if (currentDebuffs > 0)
{
// Healing rate is normally 5 HP/s (+1 every 12 frames)
// However, that 12 frames can and will slowly increase if you try to abuse this accessory
int healFrameCadence = 12;
// Healing slows down after 5 seconds (300 frames) debuffed. For every 15 frames thereafter the cadence slows
// There is no upper limit to how slow it can get and it can take a very long time to reset to normal
int punishmentFrames = PurityHealSlowdownFrames - 300;
//lowest punishment is three full seconds between the one health heal
if (healFrameCadence < 180)
healFrameCadence += (punishmentFrames < 0) ? 0 : punishmentFrames / 15;
if (Player.miscCounter % healFrameCadence == healFrameCadence - 1)
Player.Heal(1);
if (Player.lifeRegenTime < 1800)
Player.lifeRegenTime = 1800;
Player.lifeRegen += 6;
intendedPurityDefense = 20 + (currentDebuffs - 1) * 8;
if (jewelBonusDefense < intendedPurityDefense)
jewelBonusDefense = intendedPurityDefense;
// Count up total frames spent healing for slowdown.
++PurityHealSlowdownFrames;
}
// If the defense should be ticking down to some lower value, do that.
// Purity loses 1 point of defense every second.
if (Player.miscCounter % 60 == 0 && jewelBonusDefense > intendedPurityDefense)
--jewelBonusDefense;
// If the player is clear of all debuffs then gradually reduce the slowdown frames
if (currentDebuffs <= 0)
{
--PurityHealSlowdownFrames;
if (PurityHealSlowdownFrames < 0)
PurityHealSlowdownFrames = 0;
}
// Actually apply defense bonus
Player.statDefense += jewelBonusDefense;
}
if (celestialJewel || astralArcanum)
// Infected Jewel does not stack with Purity
else if (infectedJewel)
{
bool lesserEffect = false;
for (int l = 0; l < Player.MaxBuffs; l++)
Player.lifeRegen += 2;
// If the player has any debuffs, give the extra life regen and defense
// More defense is given for each additional debuff
int intendedJewelDefense = 0;
int currentDebuffs = Player.buffType.Count(CalamityLists.debuffList.Contains);
if (currentDebuffs > 0)
{
int hasBuff = Player.buffType[l];
lesserEffect = CalamityLists.alcoholList.Contains(hasBuff);
Player.lifeRegen += 4;
if (Player.lifeRegenTime < 1800)
Player.lifeRegenTime = 1800;
intendedJewelDefense = 16 + (currentDebuffs - 1) * 5;
if (jewelBonusDefense < intendedJewelDefense)
jewelBonusDefense = intendedJewelDefense;
}
int defenseBoost = astralArcanum ? 15 : 11;
if (lesserEffect)
{
Player.lifeRegen += astralArcanum ? 2 : 1;
Player.statDefense += defenseBoost;
}
else
{
if (Player.lifeRegen < 0)
{
if (Player.lifeRegenTime < 1800)
Player.lifeRegenTime = 1800;
// If the defense should be ticking down to some lower value, do that.
// Infected Jewel loses 1 point of defense every 20 frames.
if (Player.miscCounter % 60 == 0 && jewelBonusDefense > intendedJewelDefense)
--jewelBonusDefense;
Player.lifeRegen += astralArcanum ? 6 : 4;
Player.statDefense += defenseBoost;
}
else
Player.lifeRegen += astralArcanum ? 3 : 2;
}
// Actually apply defense bonus
Player.statDefense += jewelBonusDefense;
}
// Crown Jewel does not stack with Purity or Infected Jewel
else if (crownJewel)
{
bool lesserEffect = false;
for (int l = 0; l < Player.MaxBuffs; l++)
{
int hasBuff = Player.buffType[l];
lesserEffect = CalamityLists.alcoholList.Contains(hasBuff);
}
Player.lifeRegen += 2;
if (lesserEffect)
Player.statDefense += 8;
else
// If any debuff is detected, provide even more life regen and massively accelerate it
if (Player.buffType.Any(CalamityLists.debuffList.Contains))
{
if (Player.lifeRegen < 0)
{
if (Player.lifeRegenTime < 1800)
Player.lifeRegenTime = 1800;
Player.lifeRegen += 4;
Player.statDefense += 8;
}
else
Player.lifeRegen += 2;
Player.lifeRegen += 3;
if (Player.lifeRegenTime < 1800)
Player.lifeRegenTime = 1800;
}
}
#endregion
// Last Debuffs
// During Silva revive or God Slayer dash, all negative life regen is canceled
if ((silvaCountdown > 0 && hasSilvaEffect && silvaSet) || (DashID == GodSlayerDash.ID && Player.dashDelay < 0))
{
if (Player.lifeRegen < 0)
Player.lifeRegen = 0;
}
#region Things That Disable Even That Life Regen
//
// Yes, really, there's a list of conditions under which life regen doesn't work
// even if it's life regen that normally works during a damage over time debuff.
//
// 1. No life regen bool (Blood Boiler usage or wearing Omega Blue armor)
// 2. Being too far from Providence cocoon ("Holy Inferno")
// 3. Air drowning in the Abyss
//
if (noLifeRegen)
{
Player.nebulaLevelLife = 0;
if (Player.lifeRegen > 0)
Player.lifeRegen = 0;
@@ -585,7 +553,7 @@ namespace CalamityMod.CalPlayer
Player.lifeRegen = 0;
Player.lifeRegenTime = 0;
Player.lifeRegen -= (int)(hInfernoBoost * lifeRegenMult);
Player.lifeRegen -= (int)(hInfernoBoost * calamityDebuffMultiplier);
if (Player.lifeRegen < -200)
Player.lifeRegen = -200;
@@ -605,22 +573,18 @@ namespace CalamityMod.CalPlayer
Player.lifeRegen = 0;
Player.lifeRegenTime = 0;
Player.lifeRegen -= (int)(160D * lifeRegenMult);
Player.lifeRegen -= (int)(160D * calamityDebuffMultiplier);
}
}
}
// TODO -- Why is this here?
if (weakPetrification)
{
if (Player.mount.Active)
Player.mount.Dismount(Player);
}
if ((silvaCountdown > 0 && hasSilvaEffect && silvaSet) || (DashID == GodSlayerDash.ID && Player.dashDelay < 0))
{
if (Player.lifeRegen < 0)
Player.lifeRegen = 0;
}
#endregion
}
#endregion
@@ -673,9 +637,6 @@ namespace CalamityMod.CalPlayer
if (trinketOfChi || chiRegen)
Player.lifeRegen += 2;
if (rOoze)
Player.lifeRegen += 4;
if (ursaSergeant)
{
@@ -810,101 +771,55 @@ namespace CalamityMod.CalPlayer
Player.lifeRegenTime += (int)MathHelper.Lerp(1f, 3f, regenBenefitFactor);
}
// Standing still healing bonuses (all exclusive with vanilla Shiny Stone)
if (!Player.shinyStone)
{
int lifeRegenTimeMaxBoost = areThereAnyDamnBosses ? 450 : 1800;
int lifeRegenMaxBoost = areThereAnyDamnBosses ? 1 : 4;
float lifeRegenLifeRegenTimeMaxBoost = areThereAnyDamnBosses ? 8f : 30f;
#region Standing Still Life Regen
// Standing still healing bonuses (all are exclusive with vanilla Shiny Stone, but all function similarly)
if (!Player.shinyStone && Player.StandingStill() && Player.velocity.Y == 0 && Player.itemAnimation == 0)
{
bool honeyDewWorking = honeyTurboRegen && Player.honeyWet;
bool anyStandingStillLifeRegen = shadeRegen || cFreeze || honeyDewWorking || photosynthesis || aAmpoule || purity;
bool onlyPhotosynthesisAtNight = !shadeRegen && !cFreeze && !honeyDewWorking && photosynthesis && !Main.dayTime;
if (Player.StandingStill() && Player.itemAnimation == 0)
// Divides all negative life regen by two before applying any other effects.
if (anyStandingStillLifeRegen && Player.lifeRegen < 0)
Player.lifeRegen /= 2;
// Spawn dust of some flavor while actually regenerating, aAmpule and purity have a slightly different looking style
if (Player.lifeRegen > 0 && Player.statLife < actualMaxLife)
{
bool boostedRegen = false;
bool noSunlight = false;
if (shadeRegen)
int dustType = shadeRegen ? 173 : cFreeze ? 67 : honeyDewWorking ? DustID.Honey2 : photosynthesis ? 244 : aAmpoule ? 228 : purity ? 187 : -1;
bool dustSpawnRolled = Main.rand.Next(30000) < Player.lifeRegenTime || purity ? Main.rand.NextBool(2) : aAmpoule ? Main.rand.NextBool(4) : Main.rand.NextBool(30);
if (dustType != -1 && dustSpawnRolled)
{
boostedRegen = true;
if (Player.lifeRegen > 0 && Player.statLife < actualMaxLife)
{
if (Main.rand.Next(30000) < Player.lifeRegenTime || Main.rand.NextBool(30))
{
int regen = Dust.NewDust(Player.position, Player.width, Player.height, 173, 0f, 0f, 200, default, 1f);
Main.dust[regen].noGravity = true;
Main.dust[regen].fadeIn = 1.3f;
Vector2 velocity = CalamityUtils.RandomVelocity(100f, 50f, 100f, 0.04f);
Main.dust[regen].velocity = velocity;
velocity.Normalize();
velocity *= 34f;
Main.dust[regen].position = Player.Center - velocity;
}
}
}
else if (cFreeze)
{
boostedRegen = true;
if (Player.lifeRegen > 0 && Player.statLife < actualMaxLife)
{
if (Main.rand.Next(30000) < Player.lifeRegenTime || Main.rand.NextBool(30))
{
int regen = Dust.NewDust(Player.position, Player.width, Player.height, 67, 0f, 0f, 200, new Color(150, Main.DiscoG, 255), 0.75f);
Main.dust[regen].noGravity = true;
Main.dust[regen].fadeIn = 1.3f;
Vector2 velocity = CalamityUtils.RandomVelocity(100f, 50f, 100f, 0.04f);
Main.dust[regen].velocity = velocity;
velocity.Normalize();
velocity *= 34f;
Main.dust[regen].position = Player.Center - velocity;
}
}
}
else if (photosynthesis)
{
boostedRegen = true;
if (!Main.dayTime)
noSunlight = true;
if (Player.lifeRegen > 0 && Player.statLife < actualMaxLife)
{
if (Main.rand.Next(30000) < Player.lifeRegenTime || Main.rand.NextBool(2))
{
int regen = Dust.NewDust(Player.position, Player.width, Player.height, 244, 0f, 0f, 200, default, 1f);
Main.dust[regen].noGravity = true;
Main.dust[regen].fadeIn = 1.3f;
Vector2 velocity = CalamityUtils.RandomVelocity(100f, 50f, 100f, 0.04f);
Main.dust[regen].velocity = velocity;
velocity.Normalize();
velocity *= 34f;
Main.dust[regen].position = Player.Center - velocity;
}
}
}
if (boostedRegen)
{
int lifeRegenTimeMaxBoost2 = !noSunlight ? lifeRegenTimeMaxBoost : (lifeRegenTimeMaxBoost / 5);
int lifeRegenMaxBoost2 = !noSunlight ? lifeRegenMaxBoost : (lifeRegenMaxBoost / 5);
float lifeRegenLifeRegenTimeMaxBoost2 = !noSunlight ? lifeRegenLifeRegenTimeMaxBoost : (lifeRegenLifeRegenTimeMaxBoost / 5);
if (Player.lifeRegenTime > 90 && Player.lifeRegenTime < lifeRegenTimeMaxBoost2)
Player.lifeRegenTime = lifeRegenTimeMaxBoost2;
Player.lifeRegenTime += lifeRegenMaxBoost2;
Player.lifeRegen += lifeRegenMaxBoost2;
float num3 = Player.lifeRegenTime * 2.5f; // lifeRegenTime max is 3600
num3 /= 300f;
if (num3 > 0f)
{
if (num3 > lifeRegenLifeRegenTimeMaxBoost2)
num3 = lifeRegenLifeRegenTimeMaxBoost2;
Player.lifeRegen += (int)num3;
}
if (Player.lifeRegen > 0 && Player.statLife < actualMaxLife)
{
Player.lifeRegenCount++;
}
int regen = Dust.NewDust(Player.position, Player.width, Player.height, dustType, 0f, 0f, purity || aAmpoule ? 80 : 200, default, purity || aAmpoule ? 0.5f : 1f);
Main.dust[regen].noGravity = true;
Main.dust[regen].fadeIn = 1.3f;
Vector2 velocity = CalamityUtils.RandomVelocity(100f, 50f, 100f, 0.04f);
Main.dust[regen].velocity = velocity;
velocity.Normalize();
velocity *= purity || aAmpoule ? 55f : 34f;
Main.dust[regen].position = Player.Center - velocity;
}
}
// Actually apply "standing still" regeneration (the stats are granted even at full health)
float regenTimeNeededForTurboRegen = shadeRegen ? 40f : cFreeze ? 60f : honeyDewWorking ? 90f : photosynthesis ? 90f : aAmpoule ? 90f : purity ? 60f : -1f;
// 4 = vanilla Shiny Stone
int turboRegenPower = shadeRegen || cFreeze || purity ? 4 : honeyDewWorking || aAmpoule ? 3 : photosynthesis ? 1 : -1;
if (turboRegenPower > 0)
{
// After a brief delay determined by your form of standing still regen, min-cap life regen time at 1800 / 3600.
// Photosynthesis Potion does not do this at night.
if (Player.lifeRegenTime > regenTimeNeededForTurboRegen && Player.lifeRegenTime < 1800f && !onlyPhotosynthesisAtNight)
Player.lifeRegenTime = 1800f;
Player.lifeRegen += turboRegenPower;
Player.lifeRegenTime += turboRegenPower;
}
}
#endregion
// The Camper counteracts the regen loss while moving horizontally
if (camper && (Player.velocity.X != 0 && Player.grappling[0] <= 0))
+82 -45
View File
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CalamityMod.Balancing;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.Potions;
@@ -1038,19 +1037,13 @@ namespace CalamityMod.CalPlayer
Player.GetCritChance<GenericDamageClass>() += critUp;
}
bool profanedSoulBuffs = profanedCrystalBuffs || (!profanedCrystal && pArtifact) || (profanedCrystal && DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs);
bool profanedSoulBuffs = profanedCrystalBuffs || (!profanedCrystal && pSoulArtifact) || (profanedCrystal && DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs);
// Offense bonus. You always get the max minions, even during the effect of the burnout debuff
// Guardian bonuses
if (profanedSoulBuffs)
Player.maxMinions++;
// Guardian bonuses if not burnt out
if (profanedSoulBuffs && !Player.HasCooldown(Cooldowns.ProfanedSoulArtifact.ID))
{
// Defender bonus
Player.moveSpeed += 0.1f;
Player.endurance += 0.05f;
// Offense bonus
Player.maxMinions++;
// Healer bonus
if (healCounter > 0)
healCounter--;
@@ -1153,7 +1146,7 @@ namespace CalamityMod.CalPlayer
if (instance.timeLeft < 0)
{
handler.OnCompleted();
if (handler.EndSound != null)
if (handler.EndSound != null && handler.ShouldPlayEndSound)
SoundEngine.PlaySound(handler.EndSound.GetValueOrDefault());
expiredCooldowns.Add(id);
}
@@ -1577,23 +1570,7 @@ namespace CalamityMod.CalPlayer
Player.GetDamage<GenericDamageClass>() += 0.1f;
}
// Ambrosial Ampoule bonus and other light-granting bonuses
float[] light = new float[3];
if ((rOoze && !Main.dayTime) || aAmpoule)
{
light[0] += 1f;
light[1] += 1f;
light[2] += 0.6f;
}
if (aAmpoule)
{
Player.endurance += 0.05f;
Player.buffImmune[BuffID.Frozen] = true;
Player.buffImmune[BuffID.Chilled] = true;
Player.buffImmune[BuffID.Frostburn] = true;
Player.buffImmune[BuffID.CursedInferno] = true;
Player.buffImmune[ModContent.BuffType<BurningBlood>()] = true;
}
if (cFreeze)
{
light[0] += 0.3f;
@@ -2383,8 +2360,8 @@ namespace CalamityMod.CalPlayer
if (AbsorberRegen)
{
Player.GetDamage<GenericDamageClass>() += 0.1f;
Player.endurance += 0.07f;
Player.GetDamage<GenericDamageClass>() += 0.08f;
Player.endurance += 0.05f;
}
if (crawCarapace)
@@ -2698,25 +2675,25 @@ namespace CalamityMod.CalPlayer
Player.lifeMagnet = true;
}
if (wDeath)
if (wDeath && !purity)
Player.GetDamage<GenericDamageClass>() -= 0.25f;
if (astralInfection)
if (astralInfection && !(infectedJewel || purity))
Player.GetDamage<GenericDamageClass>() -= 0.15f;
if (pFlames)
if (pFlames && !purity)
{
Player.blind = true;
Player.GetDamage<GenericDamageClass>() -= 0.15f;
}
if (aCrunch && !laudanum)
if (aCrunch && !laudanum && !purity)
{
Player.statDefense -= ArmorCrunch.DefenseReduction;
Player.endurance *= ArmorCrunch.MultiplicativeDamageReductionPlayer;
}
if (wither)
if (wither && !purity)
{
Player.statDefense -= WitherDebuff.DefenseReduction;
}
@@ -2729,10 +2706,10 @@ namespace CalamityMod.CalPlayer
Player.velocity.Y = 15f;
}
if (eutrophication)
if (eutrophication && !purity)
Player.velocity = Vector2.Zero;
if (vaporfied || galvanicCorrosion)
if ((vaporfied && !purity) || galvanicCorrosion)
Player.velocity *= 0.98f;
if (molluskSet)
@@ -3021,15 +2998,15 @@ namespace CalamityMod.CalPlayer
if (auricSArtifact && Player.FindBuffIndex(ModContent.BuffType<FieryDraconidBuff>()) != -1)
Player.maxMinions += Player.ownedProjectileCounts[ModContent.ProjectileType<FieryDraconid>()];
if (pArtifact)
if (pSoulArtifact)
{
if (Player.whoAmI == Main.myPlayer)
{
var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType<Items.Accessories.ProfanedSoulArtifact>()));
if (Player.FindBuffIndex(ModContent.BuffType<ProfanedBabs>()) == -1)
Player.AddBuff(ModContent.BuffType<ProfanedBabs>(), 3600, true);
var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType<ProfanedSoulArtifact>()));
if (Player.FindBuffIndex(ModContent.BuffType<ProfanedSoulGuardians>()) == -1)
Player.AddBuff(ModContent.BuffType<ProfanedSoulGuardians>(), 3600, true);
donutBabs = true;
pSoulGuardians = true;
int guardianAmt = 1;
float babCheck = profanedCrystal ? 1f : 0f;
@@ -3046,7 +3023,8 @@ namespace CalamityMod.CalPlayer
if (Player.ownedProjectileCounts[ModContent.ProjectileType<MiniGuardianAttack>()] < guardianAmt)
{
var babO = Projectile.NewProjectileDirect(source, Player.Center, Vector2.UnitY * -1f, ModContent.ProjectileType<MiniGuardianAttack>(), 1, 1f, Main.myPlayer, babCheck);
float spearCounter = profanedCrystal ? 0f : 15f;
var babO = Projectile.NewProjectileDirect(source, Player.Center, Vector2.UnitY * -1f, ModContent.ProjectileType<MiniGuardianAttack>(), 1, 1f, Main.myPlayer, babCheck, spearCounter);
babO.originalDamage = babDamage;
}
}
@@ -3085,7 +3063,7 @@ namespace CalamityMod.CalPlayer
Lighting.AddLight(Player.Center, enrage ? 1.2f : offenseBuffs ? 1f : 0.2f, enrage ? 0.21f : offenseBuffs ? 0.2f : 0.01f, 0);
if (enrage)
{
bool special = Player.name == "Amber" || Player.name == "Nincity" || Player.name == "IbanPlay" || Player.name == "Chen"; //People who either helped create the item or test it.
bool special = ProfanedSoulCrystal.testerNames.Any(name => name.Equals(Player.name));
for (int i = 0; i < 3; i++)
{
int fire = Dust.NewDust(Player.position, Player.width, Player.height, special ? 231 : (int)CalamityDusts.ProfanedFire, 0f, 0f, 100, special ? Color.DarkRed : default, 1f);
@@ -3550,6 +3528,66 @@ namespace CalamityMod.CalPlayer
}
}
// If PSA/PSC is not equipped, obliterate its durability cooldown.
// The recharge cooldown is intentionally left in place to prevent hot swapping to recharge the shield
if (!pSoulArtifact)
{
if (cooldowns.TryGetValue(Cooldowns.ProfanedSoulShield.ID, out var cdDurability))
cdDurability.timeLeft = 0;
// As PSA/PSC's shield can be left in a partially recharged state, this is for safety.
// If the player does not have the accessory equipped for even one frame, discharge all shields.
pSoulShieldDurability = 0;
}
// Stuff to do if PSA/PSC is equipped
else
{
//Force check if profaned crystal buffs are active
ProfanedSoulCrystal.DetermineTransformationEligibility(Player);
int maxDurability = profanedCrystalBuffs
? ProfanedSoulCrystal.ShieldDurabilityMax
: ProfanedSoulArtifact.ShieldDurabilityMax;
if (pSoulShieldDurability == 0 && !cooldowns.ContainsKey(Cooldowns.ProfanedSoulShieldRecharge.ID))
Player.AddCooldown(ProfanedSoulShieldRecharge.ID, ProfanedSoulArtifact.ShieldRechargeDelay);
// If the shield has greater than zero durability but that durability is not on the cooldown rack, add it to the cooldown rack.
if (pSoulShieldDurability > 0 && !cooldowns.ContainsKey(Cooldowns.ProfanedSoulShield.ID))
{
var durabilityCooldown = Player.AddCooldown(Cooldowns.ProfanedSoulShield.ID, maxDurability);
durabilityCooldown.timeLeft = pSoulShieldDurability;
}
// If the shield has greater than zero durability and isn't in its recharge delay, actively replenish shield points.
// Play a sound on the first frame this occurs.
if (pSoulShieldDurability > 0 && !cooldowns.ContainsKey(ProfanedSoulShieldRecharge.ID))
{
if (!playedProfanedSoulShieldSound)
SoundEngine.PlaySound(ProvidenceBoss.BurnStartSound, Player.Center);
playedProfanedSoulShieldSound = true;
// This number is not an integer, and stores exact per-frame recharge progress.
pSoulShieldPartialRechargeProgress += maxDurability / (float)ProfanedSoulArtifact.TotalShieldRechargeTime;
// Floor the value to get whole number of shield points recharged this frame.
int pointsActuallyRecharged = (int)MathF.Floor(pSoulShieldPartialRechargeProgress);
// Give those points to the real shield durability, capping the result. Then remove them from recharge progress.
pSoulShieldDurability = Math.Min(pSoulShieldDurability + pointsActuallyRecharged, maxDurability);
pSoulShieldPartialRechargeProgress -= pointsActuallyRecharged;
// Update the cooldown rack's durability indicator.
if (cooldowns.TryGetValue(Cooldowns.ProfanedSoulShield.ID, out var cdDurability))
cdDurability.timeLeft = pSoulShieldDurability;
}
// Add light if this shield is currently active
if (pSoulShieldDurability > 0 && !shieldAddedLight)
{
Lighting.AddLight(Player.Center, Color.Orange.ToVector3() * 0.4f);
shieldAddedLight = true;
}
}
// If the Lunic Corps armor is not equipped, obliterate its durability cooldown.
// The recharge cooldown is intentionally left in place to prevent hot swapping to recharge the shield
if (!lunicCorpsSet)
@@ -3629,7 +3667,6 @@ namespace CalamityMod.CalPlayer
{
CooldownInstance durabilityCooldown = Player.AddCooldown(WulfrumRoverDriveDurability.ID, RoverDrive.ShieldDurabilityMax);
durabilityCooldown.timeLeft = RoverDriveShieldDurability;
SoundEngine.PlaySound(RoverDrive.ActivationSound, Player.Center);
}
// Add light if this shield is currently active
+3 -17
View File
@@ -143,15 +143,6 @@ namespace CalamityMod.CalPlayer
target.AddBuff(BuffID.Poisoned, 240);
break;
case ItemID.NightsEdge:
target.AddBuff(BuffID.ShadowFlame, 120);
break;
case ItemID.TrueNightsEdge:
target.AddBuff(BuffID.CursedInferno, 60);
target.AddBuff(BuffID.ShadowFlame, 120);
break;
case ItemID.IceSickle:
case ItemID.Frostbrand:
target.AddBuff(BuffID.Frostburn, 300);
@@ -338,11 +329,6 @@ namespace CalamityMod.CalPlayer
if (Main.rand.NextBool())
target.AddBuff(BuffID.Frostburn, 60);
break;
case ProjectileID.NightBeam:
target.AddBuff(BuffID.CursedInferno, 60);
target.AddBuff(BuffID.ShadowFlame, 120);
break;
}
if ((proj.arrow && Player.hasMoltenQuiver) || hellfireTreads)
@@ -707,7 +693,7 @@ namespace CalamityMod.CalPlayer
}
}
// Fearmonger set's colossal life regeneration
// Fearmonger set gains +10 frames (max 90) of regen when any minion lands any hit
if (fearmongerSet)
{
fearmongerRegenFrames += 10;
@@ -840,7 +826,7 @@ namespace CalamityMod.CalPlayer
{
Vector2 source = new Vector2(position.X + Main.rand.Next(-201, 201), Main.screenPosition.Y - 600f - Main.rand.Next(50));
Vector2 velocity = (position - source) / 40f;
int damage = (int)Player.GetTotalDamage<RogueDamageClass>().ApplyTo(120);
int damage = (int)Player.GetTotalDamage<RogueDamageClass>().ApplyTo(125);
Projectile.NewProjectile(spawnSource, source, velocity, ProjectileType<NanoFlare>(), damage, 3f, proj.owner);
}
}
@@ -1065,7 +1051,7 @@ namespace CalamityMod.CalPlayer
}
if (summon)
{
if (pArtifact && !profanedCrystal)
if (pSoulArtifact && !profanedCrystal)
target.AddBuff(BuffType<HolyFlames>(), 300);
if (profanedCrystalBuffs)
-6
View File
@@ -9,8 +9,6 @@ namespace CalamityMod
public static ModKeybind SetBonusHotKey { get; private set; }
public static ModKeybind RageHotKey { get; private set; }
public static ModKeybind AdrenalineHotKey { get; private set; }
public static ModKeybind AstralTeleportHotKey { get; private set; }
public static ModKeybind AstralArcanumUIHotkey { get; private set; }
public static ModKeybind SandCloakHotkey { get; private set; }
public static ModKeybind SpectralVeilHotKey { get; private set; }
public static ModKeybind PlaguePackHotKey { get; private set; }
@@ -28,8 +26,6 @@ namespace CalamityMod
AdrenalineHotKey = KeybindLoader.RegisterKeybind(Mod, "AdrenalineMode", "B");
BlazingCoreHotKey = KeybindLoader.RegisterKeybind(Mod, "BlazingCoreParry", "N");
SetBonusHotKey = KeybindLoader.RegisterKeybind(Mod, "ArmorSetBonus", "Y");
AstralTeleportHotKey = KeybindLoader.RegisterKeybind(Mod, "AstralTeleport", "P");
AstralArcanumUIHotkey = KeybindLoader.RegisterKeybind(Mod, "AstralArcanumUIToggle", "O");
SandCloakHotkey = KeybindLoader.RegisterKeybind(Mod, "SandCloakEffect", "C");
SpectralVeilHotKey = KeybindLoader.RegisterKeybind(Mod, "SpectralVeilTeleport", "Z");
PlaguePackHotKey = KeybindLoader.RegisterKeybind(Mod, "BoosterDash", "Q");
@@ -47,8 +43,6 @@ namespace CalamityMod
AdrenalineHotKey = null;
BlazingCoreHotKey = null;
SetBonusHotKey = null;
AstralTeleportHotKey = null;
AstralArcanumUIHotkey = null;
SandCloakHotkey = null;
SpectralVeilHotKey = null;
PlaguePackHotKey = null;
+107 -68
View File
@@ -1,11 +1,13 @@
using CalamityMod.Buffs.Alcohol;
using System.Collections.Generic;
using CalamityMod.Buffs;
using CalamityMod.Buffs.Alcohol;
using CalamityMod.Buffs.Cooldowns;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.Potions;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.Items.Accessories;
using CalamityMod.Items.Armor.Vanity;
using CalamityMod.Items.DraedonMisc;
using CalamityMod.Items.Fishing.BrimstoneCragCatches;
using CalamityMod.Items.Fishing.FishingRods;
using CalamityMod.Items.LoreItems;
using CalamityMod.Items.Materials;
@@ -64,7 +66,6 @@ using CalamityMod.Projectiles.Rogue;
using CalamityMod.Projectiles.Summon;
using CalamityMod.Projectiles.Typeless;
using CalamityMod.Tiles.LivingFire;
using System.Collections.Generic;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -82,11 +83,11 @@ namespace CalamityMod
public static List<int> dungeonEnemyBuffList;
public static List<int> dungeonProjectileBuffList;
public static List<int> bossHPScaleList;
public static List<int> beeEnemyList;
public static List<int> beeProjectileList;
public static List<int> friendlyBeeList;
public static List<int> hardModeNerfList;
public static List<int> debuffList;
public static List<int> fireDebuffList;
public static List<int> sicknessDebuffList;
public static List<int> alcoholList;
public static List<int> spearAutoreuseList;
public static List<int> pumpkinMoonBuffList;
@@ -160,6 +161,8 @@ namespace CalamityMod
public static List<int> DisabledSummonerNerfItems;
public static List<int> DisabledSummonerNerfMinions;
public static List<int> VeneratedLocketBanlist; //To ban projectiles from locket, mainly spikeballs altho Toasty asked me to add mod calls for adding stuff like Dreamtastic
public static void LoadLists()
{
donatorList = new List<string>()
@@ -1046,33 +1049,6 @@ namespace CalamityMod
NPCID.MoonLordHand
};
beeEnemyList = new List<int>()
{
NPCID.GiantMossHornet,
NPCID.BigMossHornet,
NPCID.LittleMossHornet,
NPCID.TinyMossHornet,
NPCID.MossHornet,
NPCID.VortexHornetQueen,
NPCID.VortexHornet,
NPCID.Bee,
NPCID.BeeSmall,
NPCID.QueenBee,
NPCType<PlaguebringerGoliath>(),
NPCType<PlaguebringerMiniboss>(),
NPCType<PlagueChargerLarge>(),
NPCType<PlagueCharger>()
};
beeProjectileList = new List<int>()
{
ProjectileID.Stinger,
ProjectileID.HornetStinger,
ProjectileType<PlagueStingerGoliath>(),
ProjectileType<PlagueStingerGoliathV2>(),
ProjectileType<PlagueExplosion>()
};
friendlyBeeList = new List<int>()
{
ProjectileID.GiantBee,
@@ -1155,7 +1131,47 @@ namespace CalamityMod
BuffType<Dragonfire>(),
BuffType<Nightwither>(),
BuffType<VulnerabilityHex>(),
BuffType<MiracleBlight>()
BuffType<MiracleBlight>(),
BuffType<WhisperingDeath>(),
BuffType<FrozenLungs>(),
BuffType<FishAlert>(),
BuffType<HolyInferno>(),
BuffType<IcarusFolly>(),
BuffType<DoGExtremeGravity>(),
// BuffType<NOU>(),
BuffType<PopoNoselessBuff>(),
BuffType<SearingLava>(),
BuffType<WeakBrimstoneFlames>(),
BuffType<Withered>()
};
fireDebuffList = new List<int>()
{
BuffID.OnFire,
BuffID.OnFire3, // Hellfire
BuffID.Burning, // Touching meteorite ore or hellstone without obsidian skull
BuffID.CursedInferno,
BuffID.ShadowFlame, // Vanilla Shadowflame, can normally never be applied to players
BuffType<Shadowflame>(), // Calamity Shadowflame copy for players
BuffType<SearingLava>(), // Crags lava
BuffType<BrimstoneFlames>(),
BuffType<HolyFlames>(),
BuffType<GodSlayerInferno>(),
BuffType<Dragonfire>(),
BuffType<WeakBrimstoneFlames>(), // Aflame enchant self damage
BuffType<BanishingFire>(),
};
sicknessDebuffList = new List<int>()
{
BuffID.Poisoned,
BuffID.Venom,
BuffType<SulphuricPoisoning>(),
BuffType<AstralInfectionDebuff>(),
BuffType<Plague>(),
BuffType<AbsorberAffliction>(),
BuffType<WhisperingDeath>(),
BuffType<Irradiated>()
};
alcoholList = new List<int>()
@@ -1938,58 +1954,67 @@ namespace CalamityMod
pierceResistExceptionList = new List<int>()
{
ProjectileID.FlyingKnife,
ProjectileID.Arkhalis,
ProjectileID.Terragrim,
ProjectileID.MonkStaffT3,
ProjectileID.LastPrismLaser,
ProjectileID.ChargedBlasterLaser,
ProjectileType<FlakKrakenProj>(),
ProjectileType<MurasamaSlash>(),
ProjectileType<OmnibladeSwing>(),
ProjectileType<DragonRageStaff>(),
ProjectileType<YateveoBloomProj>(),
ProjectileType<UrchinBall>(),
ProjectileType<UrchinMaceProjectile>(),
ProjectileType<TyphonsGreedStaff>(),
ProjectileType<DevilsSunriseProj>(),
ProjectileType<DevilsSunriseCyclone>(),
ProjectileType<PhaseslayerProjectile>(),
ProjectileType<TaserHook>(),
ProjectileType<Snowflake>(),
ProjectileType<InsidiousHarpoon>(),
ProjectileType<PhotonRipperProjectile>(),
ProjectileID.FinalFractal,
ProjectileID.FlyingKnife,
ProjectileID.LastPrismLaser,
ProjectileID.MechanicalPiranha,
ProjectileID.MonkStaffT3,
ProjectileID.PiercingStarlight,
ProjectileID.Terragrim,
ProjectileType<AcidicSaxBubble>(),
ProjectileType<WaterLeechProj>(),
ProjectileType<BallisticPoisonCloud>(),
ProjectileType<BlushieStaffProj>(),
ProjectileType<BonebreakerProjectile>(),
ProjectileType<UrchinBallSpike>(),
ProjectileType<EmesisGore>(),
ProjectileType<ExoFlareCluster>(),
ProjectileType<SulphuricBlast>(),
ProjectileType<DarkSparkBeam>(),
ProjectileType<DevilsSunriseCyclone>(),
ProjectileType<DevilsSunriseProj>(),
ProjectileType<DragonRageStaff>(),
ProjectileType<DuststormCloudHitbox>(),
ProjectileType<EclipsesStealth>(),
ProjectileType<EidolicWailSoundwave>(),
ProjectileType<EmesisGore>(),
ProjectileType<EradicatorProjectile>(),
ProjectileType<ExoFlareCluster>(),
ProjectileType<EyeOfNightCell>(),
ProjectileType<FantasyTalismanProj>(),
ProjectileType<FantasyTalismanStealth>(),
ProjectileType<FlakKrakenProj>(),
ProjectileType<GodsParanoiaProj>(),
ProjectileType<InsidiousHarpoon>(),
ProjectileType<JawsProjectile>(),
ProjectileType<LeviathanTooth>(),
ProjectileType<LionfishProj>(),
ProjectileType<MechanicalBarracuda>(),
ProjectileType<MetalShard>(),
ProjectileType<MurasamaSlash>(),
ProjectileType<NastyChollaBol>(),
ProjectileType<OmnibladeSwing>(),
ProjectileType<PhaseslayerProjectile>(),
ProjectileType<PhotonRipperProjectile>(),
ProjectileType<PlantationStaffSporeCloud>(),
ProjectileType<PrismaticBeam>(),
ProjectileType<RancorLaserbeam>(),
ProjectileType<SacrificeProjectile>(),
ProjectileType<SnapClamProj>(),
ProjectileType<SnapClamStealth>(),
ProjectileType<StickyBol>(),
ProjectileType<UrchinStingerProj>(),
ProjectileType<EyeOfNightCell>(),
ProjectileType<ViolenceThrownProjectile>(),
ProjectileType<BlushieStaffProj>(),
ProjectileType<DarkSparkBeam>(),
ProjectileType<EidolicWailSoundwave>(),
ProjectileType<RancorLaserbeam>(),
ProjectileType<Snowflake>(),
ProjectileType<SparklingLaser>(),
ProjectileType<SpiritCongregation>(),
ProjectileType<StarmageddonBinaryStarCenter>(),
ProjectileType<StickyBol>(),
ProjectileType<SulphuricBlast>(),
ProjectileType<TaserHook>(),
ProjectileType<TyphonsGreedStaff>(),
ProjectileType<UrchinBall>(),
ProjectileType<UrchinBallSpike>(),
ProjectileType<UrchinMaceProjectile>(),
ProjectileType<UrchinStingerProj>(),
ProjectileType<ViolenceThrownProjectile>(),
ProjectileType<WaterLeechProj>(),
ProjectileType<YateveoBloomProj>(),
ProjectileType<YharimsCrystalBeam>(),
ProjectileType<PrismaticBeam>(),
};
// Lists of enemies that resist piercing to some extent (mostly worms).
@@ -2670,6 +2695,18 @@ namespace CalamityMod
DisabledSummonerNerfItems = new();
DisabledSummonerNerfMinions = new();
VeneratedLocketBanlist = new List<int>()
{
ItemType<PoisonPack>(),
ItemType<SkyStabber>(),
ItemType<Nychthemeron>(),
ItemType<HellsSun>(),
ItemType<GodsParanoia>(),
ItemType<SlickCane>(),
ItemType<Mycoroot>(),
ItemType<CosmicKunai>()
};
}
public static void UnloadLists()
@@ -2681,11 +2718,11 @@ namespace CalamityMod
dungeonEnemyBuffList = null;
dungeonProjectileBuffList = null;
bossHPScaleList = null;
beeEnemyList = null;
friendlyBeeList = null;
beeProjectileList = null;
hardModeNerfList = null;
debuffList = null;
fireDebuffList = null;
sicknessDebuffList = null;
alcoholList = null;
spearAutoreuseList = null;
pumpkinMoonBuffList = null;
@@ -2758,6 +2795,8 @@ namespace CalamityMod
DisabledSummonerNerfItems = null;
DisabledSummonerNerfMinions = null;
VeneratedLocketBanlist = null;
}
}
}
-2
View File
@@ -361,7 +361,6 @@ namespace CalamityMod
RipperUI.Load();
StealthUI.Load();
ChargeMeterUI.Load();
AstralArcanumUI.Load(this);
FlightBar.Load();
// TODO -- Is this not possible to place in ModNPC.Load or ModNPC.SetStaticDefaults ?
@@ -465,7 +464,6 @@ namespace CalamityMod
RipperUI.Unload();
StealthUI.Unload();
ChargeMeterUI.Unload();
AstralArcanumUI.Unload();
FlightBar.Unload();
if (!Main.dedServ)
+5
View File
@@ -49,6 +49,11 @@ namespace CalamityMod.Cooldowns
/// When the cooldown instance ends, this sound is played. Leave at <b>null</b> for no sound.
/// </summary>
public virtual SoundStyle? EndSound => null;
/// <summary>
/// Set this to true to have the cooldown instance end sound play upon expiration. Defaults to <b>true</b>
/// </summary>
public virtual bool ShouldPlayEndSound => true;
#endregion
#region Display & Rendering
+1 -1
View File
@@ -52,7 +52,7 @@ namespace CalamityMod.Cooldowns
//var permafrostConcoction = Register<PermafrostConcoction>(PermafrostConcoction.ID);
//var plagueBlackout = Register<PlagueBlackout>(PlagueBlackout.ID);
//var prismaticLaser = Register<PrismaticLaser>(PrismaticLaser.ID);
//var profanedSoulArtifact = Register<ProfanedSoulArtifact>(ProfanedSoulArtifact.ID);
//var profanedSoulArtifact = Register<ProfanedSoulShield>(ProfanedSoulShield.ID);
//var relicOfResilience = Register<RelicOfResilience>(RelicOfResilience.ID);
//var rogueBooster = Register<RogueBooster>(RogueBooster.ID);
//var sandCloak = Register<SandCloak>(SandCloak.ID);
+1
View File
@@ -90,6 +90,7 @@ namespace CalamityMod.Cooldowns
public override Color CooldownStartColor => Color.Lerp(ringColorLerpStart, ringColorLerpEnd, instance.Completion);
public override Color CooldownEndColor => Color.Lerp(ringColorLerpStart, ringColorLerpEnd, instance.Completion);
public override SoundStyle? EndSound => LunicCorpsHelmet.ActivationSound;
public override bool ShouldPlayEndSound => instance.player.Calamity().lunicCorpsSet;
public override void Tick() => instance.player.Calamity().playedLunicCorpsShieldSound = false;
// When the recharge period completes, grant 1 point of shielding immediately so the rest my refill normally.
-16
View File
@@ -1,16 +0,0 @@
using Microsoft.Xna.Framework;
using Terraria.Localization;
namespace CalamityMod.Cooldowns
{
public class ProfanedSoulArtifact : CooldownHandler
{
public static new string ID => "ProfanedSoulArtifact";
public override bool ShouldDisplay => true;
public override LocalizedText DisplayName => CalamityUtils.GetText($"UI.Cooldowns.{ID}");
public override string Texture => "CalamityMod/Cooldowns/ProfanedSoulArtifact";
public override Color OutlineColor => new Color(255, 191, 73);
public override Color CooldownStartColor => new Color(181, 136, 177);
public override Color CooldownEndColor => new Color(255, 194, 161);
}
}
+127
View File
@@ -0,0 +1,127 @@
using System;
using CalamityMod.CalPlayer;
using CalamityMod.Items.Accessories;
using CalamityMod.NPCs.Providence;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent;
using Terraria.Graphics.Shaders;
using Terraria.Localization;
using static CalamityMod.CalamityUtils;
using static Terraria.ModLoader.ModContent;
namespace CalamityMod.Cooldowns
{
public class ProfanedSoulShield : CooldownHandler
{
private CalamityPlayer CalPlayer => instance.player.Calamity();
private int CorrectMaxDurability => CalPlayer.profanedCrystalBuffs
? ProfanedSoulCrystal.ShieldDurabilityMax
: ProfanedSoulArtifact.ShieldDurabilityMax;
//Slightly more readable and actually works which is nice
private Color GetColor(bool start)
{
Color result;
if (start)
{
result = CalPlayer.profanedCrystalBuffs ? new Color(247, 172, 131) : new Color(235, 178, 96);
}
else
{
result = CalPlayer.profanedCrystalBuffs ? new Color(255, 194, 161) : new Color(219, 179, 121);
}
return result;
}
private float AdjustedCompletion => instance.timeLeft / (float)CorrectMaxDurability;
public static new string ID => "ProfanedSoulShieldDurability";
public override bool CanTickDown => !CalPlayer.pSoulArtifact || instance.timeLeft <= 0;
public override bool ShouldDisplay => (CalPlayer.pSoulArtifact && !CalPlayer.profanedCrystal) || CalPlayer.profanedCrystalBuffs;
public override LocalizedText DisplayName => GetText($"UI.Cooldowns.{ID}");
public override string Texture => "CalamityMod/Cooldowns/ProfanedSoulShieldActive";
public override string OutlineTexture => "CalamityMod/Cooldowns/ProfanedSoulShieldOutline";
public override string OverlayTexture => "CalamityMod/Cooldowns/ProfanedSoulShieldOverlay";
public override Color OutlineColor => new Color(255, 191, 73);
public override Color CooldownStartColor => Color.Lerp(GetColor(true), GetColor(false), instance.Completion);
public override Color CooldownEndColor => Color.Lerp(GetColor(true), GetColor(false), instance.Completion);
public override bool SavedWithPlayer => false;
public override bool PersistsThroughDeath => false;
public override void ApplyBarShaders(float opacity)
{
// Use the adjusted completion
GameShaders.Misc["CalamityMod:CircularBarShader"].UseOpacity(opacity);
GameShaders.Misc["CalamityMod:CircularBarShader"].UseSaturation(AdjustedCompletion);
GameShaders.Misc["CalamityMod:CircularBarShader"].UseColor(CooldownStartColor);
GameShaders.Misc["CalamityMod:CircularBarShader"].UseSecondaryColor(CooldownEndColor);
GameShaders.Misc["CalamityMod:CircularBarShader"].Apply();
}
public override void DrawExpanded(SpriteBatch spriteBatch, Vector2 position, float opacity, float scale)
{
base.DrawExpanded(spriteBatch, position, opacity, scale);
float Xoffset = instance.timeLeft > 9 ? -10f : -5;
DrawBorderStringEightWay(spriteBatch, FontAssets.MouseText.Value, instance.timeLeft.ToString(), position + new Vector2(Xoffset, 4) * scale, Color.Lerp(GetColor(true), Color.OrangeRed, 1 - instance.Completion), Color.Black, scale);
}
public override void DrawCompact(SpriteBatch spriteBatch, Vector2 position, float opacity, float scale)
{
Texture2D sprite = Request<Texture2D>(Texture).Value;
Texture2D outline = Request<Texture2D>(OutlineTexture).Value;
Texture2D overlay = Request<Texture2D>(OverlayTexture).Value;
// Draw the outline
spriteBatch.Draw(outline, position, null, OutlineColor * opacity, 0, outline.Size() * 0.5f, scale, SpriteEffects.None, 0f);
// Draw the icon
spriteBatch.Draw(sprite, position, null, Color.White * opacity, 0, sprite.Size() * 0.5f, scale, SpriteEffects.None, 0f);
// Draw the small overlay
int lostHeight = (int)Math.Ceiling(overlay.Height * AdjustedCompletion);
Rectangle crop = new Rectangle(0, lostHeight, overlay.Width, overlay.Height - lostHeight);
spriteBatch.Draw(overlay, position + Vector2.UnitY * lostHeight * scale, crop, OutlineColor * opacity * 0.9f, 0, sprite.Size() * 0.5f, scale, SpriteEffects.None, 0f);
float Xoffset = instance.timeLeft > 9 ? -10f : -5;
DrawBorderStringEightWay(spriteBatch, FontAssets.MouseText.Value, instance.timeLeft.ToString(), position + new Vector2(Xoffset, 4) * scale, Color.Lerp(GetColor(true), Color.OrangeRed, 1 - instance.Completion), Color.Black, scale);
}
}
public class ProfanedSoulShieldRecharge : CooldownHandler
{
private static Color ringColorLerpStart = new Color(217, 159, 78);
private static Color ringColorLerpEnd = new Color(214, 185, 144);
public static new string ID => "ProfanedSoulShieldRecharge";
public override bool ShouldDisplay => true;
public override LocalizedText DisplayName => GetText($"UI.Cooldowns.{ID}");
public override string Texture => "CalamityMod/Cooldowns/ProfanedSoulShieldRecharge";
public override string OutlineTexture => "CalamityMod/Cooldowns/ProfanedSoulShieldOutline";
public override string OverlayTexture => "CalamityMod/Cooldowns/ProfanedSoulShieldOverlay";
public override bool SavedWithPlayer => false;
public override bool PersistsThroughDeath => false;
public override Color OutlineColor => new Color(57, 195, 237);
public override Color CooldownStartColor => Color.Lerp(ringColorLerpStart, ringColorLerpEnd, instance.Completion);
public override Color CooldownEndColor => Color.Lerp(ringColorLerpStart, ringColorLerpEnd, instance.Completion);
public override void Tick() => instance.player.Calamity().playedProfanedSoulShieldSound = false;
public override SoundStyle? EndSound => Providence.BurnStartSound;
public override bool ShouldPlayEndSound => instance.player.Calamity().pSoulArtifact;
// When the recharge period completes, grant 1 point of shielding immediately so the rest my refill normally.
// The shield durability cooldown is added elsewhere, in Misc Effects.
public override void OnCompleted()
{
CalamityPlayer modPlayer = instance.player.Calamity();
if (modPlayer.pSoulShieldDurability <= 0)
modPlayer.pSoulShieldDurability = 1;
}
}
}
File renamed without changes.

Before

Width:  |  Height:  |  Size: 356 B

After

Width:  |  Height:  |  Size: 356 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 184 B

After

Width:  |  Height:  |  Size: 184 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 159 B

After

Width:  |  Height:  |  Size: 159 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 248 B

+1
View File
@@ -90,6 +90,7 @@ namespace CalamityMod.Cooldowns
public override Color CooldownStartColor => Color.Lerp(ringColorLerpStart, ringColorLerpEnd, instance.Completion);
public override Color CooldownEndColor => Color.Lerp(ringColorLerpStart, ringColorLerpEnd, instance.Completion);
public override SoundStyle? EndSound => TheSponge.ActivationSound;
public override bool ShouldPlayEndSound => instance.player.Calamity().sponge;
public override void Tick() => instance.player.Calamity().playedSpongeShieldSound = false;
// When the recharge period completes, grant 1 point of shielding immediately so the rest my refill normally.
+2 -1
View File
@@ -98,6 +98,7 @@ namespace CalamityMod.Cooldowns
if (modPlayer.roverDrive)
modPlayer.RoverDriveShieldDurability = RoverDrive.ShieldDurabilityMax;
}
public override SoundStyle? EndSound => null;
public override SoundStyle? EndSound => RoverDrive.ActivationSound;
public override bool ShouldPlayEndSound => instance.player.Calamity().roverDrive;
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

+5 -44
View File
@@ -1,6 +1,9 @@
using System;
using CalamityMod.Balancing;
using CalamityMod.Items.Accessories;
using CalamityMod.Items.Placeables.FurniturePlagued;
using CalamityMod.Items.Potions;
using CalamityMod.NPCs.DraedonLabThings;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using Terraria;
@@ -11,7 +14,7 @@ namespace CalamityMod.ILEditing
{
public partial class ILChanges
{
#region Rod of Harmony Changes
#region Shimmer Changes
private static bool AdjustShimmerRequirements(On_Item.orig_CanShimmer orig, Item item)
{
@@ -20,6 +23,7 @@ namespace CalamityMod.ILEditing
{
return DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs;
}
return orig(item);
}
@@ -70,49 +74,6 @@ namespace CalamityMod.ILEditing
}
#endregion
#region Magiluminescence Changes
private static void NerfMagiluminescence(ILContext il)
{
// Nerf the run acceleration boost from 1.75x to 1.25x.
var cursor = new ILCursor(il);
if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdfld<Player>("hasMagiluminescence")))
{
LogFailure("Magiluminescence Nerf", "Could not locate the Magiluminescence bool.");
return;
}
if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcR4(1.75f)))
{
LogFailure("Magiluminescence Nerf", "Could not locate the Magiluminescence run acceleration multiplier.");
return;
}
cursor.Next.Operand = 1.25f;
// Nerf the max run speed boost from 1.15x to 1.05x.
if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcR4(1.15f)))
{
LogFailure("Magiluminescence Nerf", "Could not locate the Magiluminescence max run speed multiplier.");
return;
}
cursor.Next.Operand = 1.05f;
// Nerf the acc run speed boost from 1.15x to 1.05x.
if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcR4(1.15f)))
{
LogFailure("Magiluminescence Nerf", "Could not locate the Magiluminescence acc run speed multiplier.");
return;
}
cursor.Next.Operand = 1.05f;
// Nerf the run slowdown boost from 1.75x to 1.25x.
if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcR4(1.75f)))
{
LogFailure("Magiluminescence Nerf", "Could not locate the Magiluminescence run slowdown multiplier.");
return;
}
cursor.Next.Operand = 1.25f;
}
#endregion
#region Jump Height Changes
private static void FixJumpHeightBoosts(ILContext il)
{
+1 -1
View File
@@ -55,6 +55,7 @@ namespace CalamityMod.ILEditing
// Please order these hooks in the ordering priority you want energy shields to have
On_Main.DrawInfernoRings += RoverDrive.DrawRoverDriveShields;
On_Main.DrawInfernoRings += LunicCorpsHelmet.DrawHaloShields;
On_Main.DrawInfernoRings += ProfanedSoulArtifact.DrawProfanedSoulShields; //both psa and psc
On_Main.DrawInfernoRings += TheSponge.DrawSpongeShields;
// NPC behavior
@@ -101,7 +102,6 @@ namespace CalamityMod.ILEditing
IL_Player.UpdateJumpHeight += FixJumpHeightBoosts;
IL_Player.Update += BaseJumpHeightAdjustment;
IL_Player.Update += RunSpeedAdjustments;
IL_Player.Update += NerfMagiluminescence;
IL_Player.Update += NerfSoaringInsigniaRunAcceleration;
IL_Player.WingMovement += RemoveSoaringInsigniaInfiniteWingTime;
+8 -2
View File
@@ -456,8 +456,14 @@ namespace CalamityMod.ILEditing
private static string IncorporateEnchantmentInAffix(Terraria.On_Item.orig_AffixName orig, Item self)
{
string result = orig(self);
if (!self.IsAir && self.Calamity().AppliedEnchantment.HasValue)
result = $"{self.Calamity().AppliedEnchantment.Value.Name} {result}";
// This hook could occur before CalamityGlobalItem is loaded and throw an error.
try
{
if (!self.IsAir && self.Calamity().AppliedEnchantment.HasValue)
result = $"{self.Calamity().AppliedEnchantment.Value.Name} {result}";
}
catch { }
return result;
}
#endregion
+18 -17
View File
@@ -1,6 +1,6 @@
using CalamityMod.CalPlayer;
using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -12,37 +12,38 @@ namespace CalamityMod.Items.Accessories
public new string LocalizationCategory => "Items.Accessories";
public override void SetDefaults()
{
Item.defense = 6;
Item.width = 20;
Item.height = 20;
Item.value = CalamityGlobalItem.Rarity5BuyPrice;
Item.rare = ItemRarityID.Pink;
Item.value = CalamityGlobalItem.Rarity9BuyPrice;
Item.rare = ItemRarityID.Cyan;
Item.accessory = true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
CalamityPlayer modPlayer = player.Calamity();
player.statLifeMax2 += 70;
// bool left in for abyss light purposes and life regen effects
modPlayer.aAmpoule = true;
modPlayer.rOoze = true;
// Inherits all effects of Honey Dew and Living Dew (except standing regen is not honey exclusive anymore)
modPlayer.alwaysHoneyRegen = true;
modPlayer.honeyDewHalveDebuffs = true;
modPlayer.livingDewHalveDebuffs = true;
// Add light if the other accessories aren't equipped and visibility is turned on
if (!(modPlayer.rOoze || modPlayer.purity) && !hideVisual)
Lighting.AddLight(player.Center, new Vector3(1.2f, 1.2f, 0.72f));
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<CorruptFlask>().
AddIngredient<LivingDew>().
AddIngredient<RadiantOoze>().
AddIngredient<CryonicBar>(5).
AddIngredient<SeaPrism>(10).
AddTile(TileID.MythrilAnvil).
Register();
CreateRecipe().
AddIngredient<CrimsonFlask>().
AddIngredient<RadiantOoze>().
AddIngredient<CryonicBar>(5).
AddIngredient<SeaPrism>(10).
AddTile(TileID.MythrilAnvil).
AddIngredient<LifeAlloy>(3).
AddTile(TileID.LunarCraftingStation).
Register();
}
}
+1 -1
View File
@@ -35,7 +35,7 @@ namespace CalamityMod.Items.Accessories
player.GetDamage<GenericDamageClass>() += 0.08f;
player.GetDamage<SummonDamageClass>() += 0.07f; //7% + 8% = 15%
player.maxMinions += 2;
if (player.controlJump)
if (player.wingTime < player.wingTimeMax)
player.lifeRegen += 4;
}
-44
View File
@@ -1,44 +0,0 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.CalPlayer;
using CalamityMod.Items.Materials;
using CalamityMod.Rarities;
using System.Collections.Generic;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories
{
public class AstralArcanum : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
public override void SetDefaults()
{
Item.defense = 12;
Item.width = 26;
Item.height = 26;
Item.accessory = true;
Item.value = CalamityGlobalItem.Rarity12BuyPrice;
Item.rare = ModContent.RarityType<Turquoise>();
}
public override void ModifyTooltips(List<TooltipLine> list) => list.IntegrateHotkey(CalamityKeybinds.AstralArcanumUIHotkey);
public override void UpdateAccessory(Player player, bool hideVisual)
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.astralArcanum = true;
player.buffImmune[ModContent.BuffType<AstralInfectionDebuff>()] = true;
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<CelestialJewel>().
AddIngredient<DarkPlasma>(3).
AddIngredient(ItemID.LunarBar, 5).
AddTile(TileID.LunarCraftingStation).
Register();
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

+1 -1
View File
@@ -21,7 +21,7 @@ namespace CalamityMod.Items.Accessories
public override void SetStaticDefaults()
{
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 6));
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 6));
ItemID.Sets.AnimatesAsSoul[Type] = true;
}
+1 -1
View File
@@ -10,7 +10,7 @@ namespace CalamityMod.Items.Accessories
public new string LocalizationCategory => "Items.Accessories";
public override void SetStaticDefaults()
{
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(8, 7));
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(8, 7));
ItemID.Sets.AnimatesAsSoul[Type] = true;
}
+2 -2
View File
@@ -12,8 +12,8 @@ namespace CalamityMod.Items.Accessories
public new string LocalizationCategory => "Items.Accessories";
public override void SetDefaults()
{
Item.width = 20;
Item.height = 24;
Item.width = 18;
Item.height = 40;
Item.value = CalamityGlobalItem.Rarity1BuyPrice;
Item.rare = ItemRarityID.Blue;
Item.accessory = true;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 749 B

+1 -1
View File
@@ -14,7 +14,7 @@ namespace CalamityMod.Items.Accessories
public new string LocalizationCategory => "Items.Accessories";
public override void SetStaticDefaults()
{
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 4));
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 4));
ItemID.Sets.AnimatesAsSoul[Type] = true;
}
+1 -1
View File
@@ -10,7 +10,7 @@ namespace CalamityMod.Items.Accessories
public new string LocalizationCategory => "Items.Accessories";
public override void SetDefaults()
{
Item.defense = 5;
Item.defense = 4;
Item.width = 26;
Item.height = 26;
Item.value = CalamityGlobalItem.Rarity1BuyPrice;
+1 -1
View File
@@ -10,7 +10,7 @@ namespace CalamityMod.Items.Accessories
public new string LocalizationCategory => "Items.Accessories";
public override void SetStaticDefaults()
{
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(4, 4));
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(4, 4));
ItemID.Sets.AnimatesAsSoul[Type] = true;
}
@@ -6,7 +6,8 @@ using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories
{
public class DarkGodsSheath : ModItem, ILocalizedModType
[LegacyName("DarkGodsSheath")]
public class DarkMatterSheath : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
public override void SetDefaults()
File renamed without changes.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

+1 -1
View File
@@ -36,7 +36,7 @@ namespace CalamityMod.Items.Accessories
{
CreateRecipe().
AddIngredient<AbyssalMirror>().
AddIngredient<DarkGodsSheath>().
AddIngredient<DarkMatterSheath>().
AddIngredient<DarksunFragment>(20).
AddTile<CosmicAnvil>().
Register();
+1 -1
View File
@@ -11,7 +11,7 @@ namespace CalamityMod.Items.Accessories
public new string LocalizationCategory => "Items.Accessories";
public override void SetStaticDefaults()
{
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 4));
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 4));
ItemID.Sets.AnimatesAsSoul[Type] = true;
}
+2 -1
View File
@@ -24,7 +24,8 @@ namespace CalamityMod.Items.Accessories
modPlayer.gloveOfRecklessness = true;
modPlayer.stealthGenStandstill += 0.15f;
modPlayer.stealthGenMoving += 0.15f;
player.GetDamage<RogueDamageClass>() -= 0.13f;
player.GetDamage<RogueDamageClass>() -= 0.10f;
player.GetCritChance<RogueDamageClass>() -= 10;
player.GetAttackSpeed<RogueDamageClass>() += 0.15f;
}
}
+2 -2
View File
@@ -22,9 +22,9 @@ namespace CalamityMod.Items.Accessories
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.gloveOfPrecision = true;
player.GetDamage<RogueDamageClass>() += 0.13f;
player.GetDamage<RogueDamageClass>() += 0.10f;
player.GetCritChance<RogueDamageClass>() += 15;
modPlayer.rogueVelocity += 0.25f;
modPlayer.rogueVelocity += 0.15f;
player.GetAttackSpeed<RogueDamageClass>() -= 0.15f;
}
}
+2 -2
View File
@@ -11,8 +11,8 @@ namespace CalamityMod.Items.Accessories
public new string LocalizationCategory => "Items.Accessories";
public override void SetDefaults()
{
Item.width = 20;
Item.height = 24;
Item.width = 34;
Item.height = 52;
Item.value = CalamityGlobalItem.Rarity5BuyPrice;
Item.rare = ItemRarityID.Pink;
Item.accessory = true;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

+1 -1
View File
@@ -17,7 +17,7 @@ namespace CalamityMod.Items.Accessories
public override void SetStaticDefaults()
{
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 4));
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 4));
ItemID.Sets.AnimatesAsSoul[Type] = true;
}
+1 -1
View File
@@ -17,7 +17,7 @@ namespace CalamityMod.Items.Accessories
public new string LocalizationCategory => "Items.Accessories";
public override void SetStaticDefaults()
{
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 8));
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 8));
ItemID.Sets.AnimatesAsSoul[Type] = true;
}
+9 -28
View File
@@ -13,46 +13,27 @@ namespace CalamityMod.Items.Accessories
{
Item.width = 20;
Item.height = 20;
Item.value = CalamityGlobalItem.Rarity5BuyPrice;
Item.rare = ItemRarityID.Pink;
Item.value = CalamityGlobalItem.Rarity2BuyPrice;
Item.rare = ItemRarityID.Green;
Item.accessory = true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
player.statLifeMax2 += 30;
CalamityPlayer modPlayer = player.Calamity();
modPlayer.beeResist = true;
if (player.ZoneJungle)
{
player.lifeRegen += 1;
player.statDefense += 9;
player.endurance += 0.05f;
}
player.buffImmune[BuffID.Venom] = true;
player.buffImmune[BuffID.Poisoned] = true;
if (!player.honey && player.lifeRegen < 0)
{
player.lifeRegen += 2;
if (player.lifeRegen > 0)
player.lifeRegen = 0;
}
player.lifeRegenTime += 1;
player.lifeRegen += 2;
modPlayer.alwaysHoneyRegen = true;
modPlayer.honeyTurboRegen = true;
modPlayer.honeyDewHalveDebuffs = true;
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<LivingDew>().
AddIngredient(ItemID.BottledHoney, 10).
AddIngredient<TrapperBulb>(2).
AddIngredient(ItemID.ButterflyDust).
AddIngredient<BeetleJuice>(3).
AddTile(TileID.MythrilAnvil).
AddIngredient(ItemID.BeeWax, 3).
AddIngredient<MurkyPaste>(3).
AddTile(TileID.Anvils).
Register();
}
}
+1 -1
View File
@@ -20,7 +20,7 @@ namespace CalamityMod.Items.Accessories
public override void SetStaticDefaults()
{
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 4));
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 4));
ItemID.Sets.AnimatesAsSoul[Type] = true;
}
@@ -1,19 +1,19 @@
using CalamityMod.Items.Placeables;
using CalamityMod.CalPlayer;
using CalamityMod.CalPlayer;
using CalamityMod.Items.Materials;
using CalamityMod.Items.Potions;
using System.Collections.Generic;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories
{
public class CelestialJewel : ModItem, ILocalizedModType
[LegacyName("CelestialJewel")]
public class InfectedJewel : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
public override void SetDefaults()
{
Item.defense = 8;
Item.defense = 6;
Item.width = 26;
Item.height = 26;
Item.value = CalamityGlobalItem.Rarity7BuyPrice;
@@ -21,21 +21,18 @@ namespace CalamityMod.Items.Accessories
Item.accessory = true;
}
public override void ModifyTooltips(List<TooltipLine> list) => list.IntegrateHotkey(CalamityKeybinds.AstralTeleportHotKey);
public override void UpdateAccessory(Player player, bool hideVisual)
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.celestialJewel = true;
modPlayer.infectedJewel = true;
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<CrownJewel>().
AddIngredient(ItemID.TeleportationPotion, 3).
AddIngredient<AureusCell>(15).
AddIngredient<SeaPrism>(15).
AddIngredient<AureusCell>(10).
AddIngredient<Stardust>(25).
AddTile(TileID.MythrilAnvil).
Register();
}
File renamed without changes.

Before

Width:  |  Height:  |  Size: 947 B

After

Width:  |  Height:  |  Size: 947 B

+2 -2
View File
@@ -11,8 +11,8 @@ namespace CalamityMod.Items.Accessories
public new string LocalizationCategory => "Items.Accessories";
public override void SetDefaults()
{
Item.width = 20;
Item.height = 24;
Item.width = 18;
Item.height = 40;
Item.value = CalamityGlobalItem.Rarity1BuyPrice;
Item.rare = ItemRarityID.Blue;
Item.accessory = true;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 754 B

+19 -15
View File
@@ -1,4 +1,5 @@
using CalamityMod.Items.Materials;
using CalamityMod.CalPlayer;
using CalamityMod.Items.Materials;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -11,30 +12,33 @@ namespace CalamityMod.Items.Accessories
public override void SetDefaults()
{
Item.width = 34;
Item.height = 24;
Item.value = CalamityGlobalItem.Rarity3BuyPrice;
Item.rare = ItemRarityID.Orange;
Item.height = 22;
Item.value = CalamityGlobalItem.Rarity7BuyPrice;
Item.rare = ItemRarityID.Lime;
Item.accessory = true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
if (player.ZoneJungle)
{
player.lifeRegen += 1;
player.statDefense += 5;
player.endurance += 0.05f;
}
player.buffImmune[BuffID.Poisoned] = true;
player.statLifeMax2 += 50;
// Inherits all effects of Honey Dew
CalamityPlayer modPlayer = player.Calamity();
modPlayer.alwaysHoneyRegen = true;
modPlayer.honeyTurboRegen = true;
modPlayer.honeyDewHalveDebuffs = true;
modPlayer.livingDewHalveDebuffs = true;
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient(ItemID.Bezoar).
AddIngredient(ItemID.Vine, 2).
AddIngredient<MurkyPaste>(5).
AddTile(TileID.Anvils).
AddIngredient<HoneyDew>().
AddIngredient<TrapperBulb>(3).
AddIngredient<LivingShard>(6).
// TODO -- Replace with Water Essence
AddIngredient<EssenceofSunlight>(5).
AddTile(TileID.MythrilAnvil).
Register();
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 556 B

After

Width:  |  Height:  |  Size: 477 B

+1
View File
@@ -26,6 +26,7 @@ namespace CalamityMod.Items.Accessories
CalamityPlayer modPlayer = player.Calamity();
modPlayer.abyssalAmulet = true;
modPlayer.lumenousAmulet = true;
player.buffImmune[ModContent.BuffType<RiptideDebuff>()] = true;
player.buffImmune[ModContent.BuffType<CrushDepth>()] = true;
}
+1 -1
View File
@@ -17,7 +17,7 @@ namespace CalamityMod.Items.Accessories
public new string LocalizationCategory => "Items.Accessories";
public override void SetStaticDefaults()
{
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 7));
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 7));
ItemID.Sets.AnimatesAsSoul[Type] = true;
}
+135 -5
View File
@@ -1,24 +1,148 @@
using CalamityMod.CalPlayer;
using System;
using System.Linq;
using CalamityMod.CalPlayer;
using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables.Plates;
using CalamityMod.Items.Placeables.Ores;
using CalamityMod.Rarities;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.DataStructures;
using Terraria.Graphics.Effects;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories
{
public class ProfanedSoulArtifact : ModItem, ILocalizedModType //My precious babs <3 ~Amber
public class ProfanedSoulArtifact : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
public static Asset<Texture2D> HeatTex;
public static int ShieldRechargeDelay = CalamityUtils.SecondsToFrames(5);
public static int TotalShieldRechargeTime = CalamityUtils.SecondsToFrames(2);
public static int ShieldDurabilityMax = 25;
public override void SetStaticDefaults()
{
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 6));
ItemID.Sets.AnimatesAsSoul[Type] = true;
}
// Complex drawcode which draws Profaned Soul shields on ALL players who have it available. Supposedly.
// This is applied as IL (On hook) which draws right before Inferno Ring.
internal static void DrawProfanedSoulShields(On_Main.orig_DrawInfernoRings orig, Main mainObj)
{
// TODO -- Control flow analysis indicates that this hook is not stable (as it was copied from Rover Drive).
// Profaned Soul shields will be drawn for each player with the Profaned Soul artifact/crystal, yes.
// But there is no guarantee that the shields will be in the right condition for each player.
// Visibility is not net synced, for example.
bool alreadyDrawnShieldForPlayer = false;
for (int i = 0; i < Main.maxPlayers; i++)
{
Player player = Main.player[i];
if (player is null || !player.active || player.outOfRange || player.dead)
continue;
CalamityPlayer modPlayer = player.Calamity();
// Do not render the shield if its visibility is off (or it does not exist)
bool isVanityOnly = modPlayer.pSoulShieldVisible && !modPlayer.pSoulArtifact;
bool shieldExists = isVanityOnly || modPlayer.pSoulShieldDurability > 0;
if (!modPlayer.pSoulShieldVisible || modPlayer.drawnAnyShieldThisFrame || !shieldExists)
continue;
// Scale the shield is drawn at.
// The "i" parameter is to make different player's shields not be perfectly synced.
float scale = 0.15f + 0.03f * (0.5f + 0.5f * (float)Math.Sin(Main.GlobalTimeWrappedHourly * 0.5f + i * 0.2f));
if (!alreadyDrawnShieldForPlayer)
{
CalamityPlayer localModPlayer = Main.LocalPlayer.Calamity();
var psc = localModPlayer.profanedCrystalBuffs;
scale += psc ? 0.025f : 0f;
float visualShieldStrength = 1f;
if (!isVanityOnly)
{
float max = psc ? ProfanedSoulCrystal.ShieldDurabilityMax : ShieldDurabilityMax;
float shieldDurabilityRatio = localModPlayer.pSoulShieldDurability / (float)ShieldDurabilityMax;
visualShieldStrength = MathF.Pow(shieldDurabilityRatio, 0.5f);
}
// The scale used for the noise overlay polygons also grows and shrinks
// This is intentionally out of sync with the shield, and intentionally desynced per player
// Don't put this anywhere less than 0.25f or higher than 1f. The higher it is, the denser / more zoomed out the noise overlay is.
float noiseScale = MathHelper.Lerp(0.4f, 0.8f, (float)Math.Sin(Main.GlobalTimeWrappedHourly * 0.3f) * 0.5f + 0.5f);
// Define shader parameters
Effect shieldEffect = Filters.Scene["CalamityMod:RoverDriveShield"].GetShader().Shader;
shieldEffect.Parameters["time"].SetValue(Main.GlobalTimeWrappedHourly * 0.058f); // Scrolling speed of polygonal overlay
shieldEffect.Parameters["blowUpPower"].SetValue(2.8f);
shieldEffect.Parameters["blowUpSize"].SetValue(0.4f);
shieldEffect.Parameters["noiseScale"].SetValue(noiseScale);
// Shield opacity multiplier slightly changes, this is independent of current shield strength
float baseShieldOpacity = 0.9f + 0.1f * MathF.Sin(Main.GlobalTimeWrappedHourly * 1.95f);
float minShieldStrengthOpacityMultiplier = 0.5f;
float finalShieldOpacity = baseShieldOpacity * MathHelper.Lerp(minShieldStrengthOpacityMultiplier, 1f, visualShieldStrength);
shieldEffect.Parameters["shieldOpacity"].SetValue(finalShieldOpacity);
shieldEffect.Parameters["shieldEdgeBlendStrenght"].SetValue(4f);
// Profaned Soul shields are not team specific
Color shieldColor = new Color(231, 160, 56);
if (psc && ProfanedSoulCrystal.testerNames.Any(name => name.Equals(localModPlayer.Player.name)))
shieldColor = CalamityUtils.ColorSwap(new Color(255, 166, 0), new Color(25, 250, 25), 4f);
else if (psc)
shieldColor = new Color(255, 110, 56);
Color primaryEdgeColor = new Color(230, 199, 102) * 0.8f;
Color secondaryEdgeColor = new Color(249, 231, 217) * 0.8f;
Color edgeColor = CalamityUtils.MulticolorLerp(Main.GlobalTimeWrappedHourly * 0.2f, primaryEdgeColor, secondaryEdgeColor);
// Define shader parameters for shield color
shieldEffect.Parameters["shieldColor"].SetValue(shieldColor.ToVector3());
shieldEffect.Parameters["shieldEdgeColor"].SetValue(edgeColor.ToVector3());
// GOD I LOVE END BEGIN CAN THIS GAME PLEASE BE SWALLOWED BY THE FIRES OF HELL THANKS
// yes I copy pasted that comment, I hate end begin that much
// I also copy pasted that comment, this time for consistency :hdfailure:
Main.spriteBatch.End();
Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, shieldEffect, Main.GameViewMatrix.TransformationMatrix);
// Fetch shield heat overlay texture (this is the neutrons fed to the shader)
HeatTex ??= ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/GreyscaleGradients/Neurons2");
Vector2 pos = player.MountedCenter + player.gfxOffY * Vector2.UnitY - Main.screenPosition;
Texture2D tex = HeatTex.Value;
Main.spriteBatch.Draw(tex, pos, null, Color.White, 0, tex.Size() / 2f, scale, 0, 0);
//The border circle MUST be drawn after otherwise it becomes visually fucked.
float shieldScale = scale * 1.75f;
Texture2D shieldTexture = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/GreyscaleOpenCircle").Value;
Rectangle shieldFrame = shieldTexture.Frame();
Vector2 origin = shieldFrame.Size() * 0.5f;
Main.spriteBatch.End();
Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix);
Main.spriteBatch.Draw(shieldTexture, pos, shieldFrame, shieldColor * 0.5f, player.fullRotation, origin, shieldScale, SpriteEffects.None, 0f);
Main.spriteBatch.Draw(shieldTexture, pos, shieldFrame, secondaryEdgeColor * 0.5f, player.fullRotation, origin, shieldScale * 0.95f, SpriteEffects.None, 0f);
Main.spriteBatch.Draw(shieldTexture, pos, shieldFrame, shieldColor * 0.5f, player.fullRotation, origin, shieldScale, SpriteEffects.None, 0f);
Main.spriteBatch.Draw(shieldTexture, pos, shieldFrame, secondaryEdgeColor * 0.5f, player.fullRotation, origin, shieldScale * 0.95f, SpriteEffects.None, 0f);
}
alreadyDrawnShieldForPlayer = true;
modPlayer.drawnAnyShieldThisFrame = true;
}
if (alreadyDrawnShieldForPlayer)
{
Main.spriteBatch.End();
Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.Transform);
}
orig(mainObj);
}
public override void SetDefaults()
{
Item.width = 32;
@@ -29,15 +153,21 @@ namespace CalamityMod.Items.Accessories
Item.Calamity().donorItem = true;
}
public override bool CanEquipAccessory(Player player, int slot, bool modded)
public override bool CanAccessoryBeEquippedWith(Item equippedItem, Item incomingItem, Player player)
{
return !player.Calamity().pArtifact;
return incomingItem.type != ModContent.ItemType<ProfanedSoulCrystal>();
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.pArtifact = true;
modPlayer.pSoulArtifact = true;
modPlayer.pSoulShieldVisible = !hideVisual;
}
public override void UpdateVanity(Player player)
{
player.Calamity().pSoulShieldVisible = true;
}
public override void AddRecipes()
Loaded 100 of 510 files, more files were not shown because too many files have changed in this diff. Show more