Several CalPlayer summary comments

Also removed several unused variables, and fixed Pwnagehammer using Stellar Contempt's variable instead of its own
This commit is contained in:
CongratsIsTrash committed 2024-12-08 19:52:49 -05:00
1 parent 0cf21296f0
commit c8d87b5ef0
10 files changed
+320 -100

No files matched your search

+312 -81
View File
@@ -77,20 +77,30 @@ namespace CalamityMod.CalPlayer
#region Variables
#region No Category
/// <summary> If true, there is a boss NPC active in the world. Primary bool for checking effects that only occur if a boss is alive. </summary>
public static bool areThereAnyDamnBosses = false;
/// <summary> If true, there is an event actively occuring near the player. Solely used for preventing Silva Revive's cooldown from decreasing. </summary>
public static bool areThereAnyDamnEvents = false;
public float calamityBonusLuck = 0f;
/// <summary> Custom variable for tracking if the player has Potion Sickness. Used for adding Potion Sickness to the Cooldown Rack. </summary>
public bool potionSick = false;
/// <summary> Custom variable for tracking how long the player has had Potion Sickness. Solely used for triggering the aura effects of Life Jelly and its upgrades. </summary>
public int timePotionSick;
public bool drawBossHPBar = true;
public float stealthUIAlpha = 1f;
public float SulphWaterUIOpacity = 1f;
/// <summary> Used to determine whether or not extra information should be displayed on the Boss Health Bar. </summary>
public bool shouldDrawSmallText = true;
/// <summary> Used by The Evolution to store the type of the projectile that hit the player when its reflect is triggered. </summary>
public int projTypeJustHitBy;
/// <summary> Unused variable, formerly used for displaying special SCal dialogue. </summary>
public int sCalDeathCount = 0;
/// <summary> <inheritdoc cref="sCalDeathCount"/> </summary>
public int sCalKillCount = 0;
public int actualMaxLife = 0;
/// <summary> Constant variable used for how long Chaos State is inflicted by Rod of Discord while a boss is alive. </summary>
public static int chaosStateDuration = 900;
/// <summary> Constant variable used for how long Chaos State is inflicted by Normality Relocator while a boss is alive. </summary>
public static int chaosStateDuration_NR = 1200;
public bool killSpikyBalls = false;
public float KameiTrailXScale = 0.1f;
@@ -98,22 +108,38 @@ namespace CalamityMod.CalPlayer
public Vector2[] OldPositions = new Vector2[4];
public double contactDamageReduction = 0D;
public double projectileDamageReduction = 0D;
public const float projectileMeleeWeaponMeleeSpeedMultiplier = 0f;
/// <summary>
/// How many stacks of Evil Smasher's boost the player has. This increases the weapon's damage, use speed, and knockback.<br/>
/// Getting hit decreases this by 1. Switching to a different item resets this to 0.
/// </summary>
public int evilSmasherBoost = 0;
/// <summary> Cooldown variable which prevents using Burning Sea during its "burn-out" mechanic. </summary>
public int burningSeaBurnOut = 0;
public int hellbornShots = 0;
public int searedPanCounter = 0;
public int searedPanTimer = 0;
/// <summary> Used to get around the hardcoded Potion Sickness duration to allow Hadal Stew's reduced duration. </summary>
public int potionTimer = 0;
public bool cirrusDress = false;
/// <summary> If set to true, prevents all player dashes. Used by Ball and Chain and Stygian Shield. </summary>
public bool blockAllDashes = false;
/// <summary> Used by Flamsteed Ring to reset the player's hitbox size after dismounting. </summary>
public bool resetHeightandWidth = false;
/// <summary> If set to true, completely disables ALL life regeneration effects. Used by Omega Blue armor. </summary>
public bool noLifeRegen = false;
public bool reducedDaybrokenDamage = false;
public bool reducedNightwitherDamage = false;
public float rangedAmmoCost = 1f;
public float healingPotionMultiplier = 1f;
/// <summary>
/// Tracks whether or not the player is currently holding Gael's Greatsword.<br/>
/// Used to toggle the ability to use its unique Rage attack.
/// </summary>
public bool heldGaelsLastFrame = false;
/// <summary>
/// Tracks whether or not the player currently has Draedon's Heart equipped.<br/>
/// Used to reset Adrenaline when (un)equipped to prevent exploits.
/// </summary>
internal bool hadNanomachinesLastFrame = false;
public bool combHair;
public bool disableVoodooSpawns = false;
@@ -121,19 +147,36 @@ namespace CalamityMod.CalPlayer
public bool disableHiveCystSpawns = false;
public bool disableNaturalScourgeSpawns = false;
public bool disableAnahitaSpawns = false;
/// <summary> Used for toggling Calamity's blazing cursor effect. </summary>
public bool blazingCursorDamage = false;
/// <summary>
/// <inheritdoc cref="blazingCursorDamage"/><br/>
/// This variable is enabled if the accessory is in vanity, granting only the visuals.
/// </summary>
public bool blazingCursorVisuals = false;
public float blazingMouseAuraFade = 0f;
/// <summary> General variable used for controlling how much screenshake this player is experiencing. Smoothly scales down over time. </summary>
public float GeneralScreenShakePower = 0f;
/// <summary> Set to true when this player receives the Brimstone Locus from speaking to the Brimstone Witch for the first time. </summary>
public bool GivenBrimstoneLocus = false;
public DoGCartSegment[] DoGCartSegments = new DoGCartSegment[DoGCartMount.SegmentCount];
public float SmoothenedMinecartRotation;
/// <summary>
/// Set to true when a weapon performs a lunge attack, such as Biome Blade's Pure Clarity attunement.<br/>
/// Massively increases the player's max fall speed, and prevents fall damage.
/// </summary>
public bool LungingDown = false;
/// <summary>
/// Variable set before the player is teleported to the Underworld for Wall of Flesh in Boss Rush.<br/>
/// Used to teleport them back to their previous position after Wall of Flesh is defeated.
/// </summary>
public Vector2? BossRushReturnPosition = null;
public float moveSpeedBonus = 0f;
public int momentumCapacitorTime = 0;
/// <summary> A multiplier on the player's movement speed applied while using Momentum Capacitor. </summary>
public float momentumCapacitorBoost = 0f;
/// <summary> Cooldown variable for spawning Plague Tainted SMG's drones from left-click bullets. </summary>
public int plagueTaintedSMGDroneCooldown = 0;
#endregion
@@ -202,54 +245,93 @@ namespace CalamityMod.CalPlayer
#region Timer and Counter
public int gaelSwipes = 0;
public int arsenalCooldown = 0;
/// <summary>
/// Tracks Dragoon Drizzlefish's "gel feed" mechanic in Get fixed boi.<br/>
/// Consuming Gel adds 1 to this counter, up to a maximum of 6, and using the weapon has a random chance to decrement the counter.<br/>
/// The weapon's damage is multiplied by the value in this counter.
/// </summary>
public int dragoonDrizzlefishGelBoost = 1;
public int deadSunCounter = 6;
public int DragonsBreathAudioCooldown = 0;
public int DragonsBreathAudioCooldown2 = 0;
public int PhotoAudioCooldown = 0;
public int PhotoTimer = 90;
/// <summary> Cooldown variable used to add a delay between Anahita's Arpeggio uses. </summary>
public int arpeggioCooldown = 0;
/// <summary>
/// If true, this player's Brittle Star Staff minions are in their orbiting mode.<br/>
/// While in this mode, they orbit around the player, do not break on hits, and increase defense.
/// </summary>
public bool brittleStarBuffMode = false;
/// <summary> If set to true, initiates the dash ability of Speed Blaster or Superradiant Slaughterer. </summary>
public bool sBlasterDashActivated = false;
public int saharaSlicersBolts = 0;
public int oceanCrestTimer = 0;
/// <summary> Pwnagehammer's hit counter, used to track when to spawn its empowered hammer. </summary>
public int Holyhammer = 0;
/// <summary> Fallen Paladin's Hammer's hit counter, used to track when to spawn its empowered hammer. </summary>
public int PHAThammer = 0;
/// <summary> Stellar Contempt's hit counter, used to track when to spawn its empowered hammer. </summary>
public int StellarHammer = 0;
/// <summary> Galaxy Smasher's hit counter, used to track when to spawn its empowered hammer. </summary>
public int GalaxyHammer = 0;
/// <summary> Variable used to apply Ontological Despoiler's nerfs when continuously using a single firing mode. </summary>
public bool despoilerNerf = false;
public int amputatorBuff = 0;
public int rOfResilienceCooldown = 0;
public int rOfResilienceEffect = 0;
public int rOfResilienceOrbitOffset = 0;
/// <summary>
/// Variable which tracks how many shots Norfleet has fired. Used to determine when to recharge.<br/>
/// Also used to trigger its "cheater" easter egg when attempting to fire more than 3 consecutive shots.
/// </summary>
public int NorfleetCounter = 0;
public int hideOfDeusMeleeBoostTimer = 0;
/// <summary>
/// The player's alcohol level. Increased by 1 for each alcohol the player has drank, 2 for Everclear.<br/>
/// Is this value is greater than 3, the player is inflicted with Alcohol Poisoning.
/// </summary>
public int alcoholPoisonLevel = 0;
public int modStealthTimer;
public int dashTimeMod;
/// <summary>
/// Timer variable which tracks how long the player has spent outside of Providence's border radius, in frames.<br/>
/// Used to scale the damage of the Holy Inferno debuff.
/// </summary>
public int hInfernoBoost = 0;
public int packetTimer = 0;
public int navyRodAuraTimer = 0;
public int brimLoreInfernoTimer = 0;
/// <summary> Timer variable used to time when Hydrothermic armor's set bonus inferno ring deals damage to targets. </summary>
public int hydrothermicInfernoTimer = 0;
/// <summary> Timer variable used to time when Tarragon armor's set bonus life aura deals damage to targets. </summary>
public int tarraLifeAuraTimer = 0;
public int bloodflareHeartTimer = 300;
/// <summary> Counter variable used to determine when to spawn Dragon Rage's fireballs. Fireballs are spawned after 10 hits. </summary>
public int dragonRageHits = 0;
/// <summary> Cooldown variable for Dragon Rage's fireball spawning to prevent spamming projectiles when hitting multiple enemies simultaneously. </summary>
public int dragonRageCooldown = 0;
public float modStealth = 1f;
public float aquaticBoostMax = 10000f;
/// <summary>
/// Counter variable which controls Aquatic Emblem's stat boosts while underwater.<br/>
/// This counter starts at <see cref="aquaticBoostMax"/>, and is decremented by 2 for every frame the player remains underwater, reaching maximum boosts when it hits 0.
/// </summary>
public float aquaticBoost = 0f;
public int galileoCooldown = 0;
public int soundCooldown = 0;
/// <summary> Used to track Prideful Hunter's Planar Ripper's movement speed boost, along with its visual effects. </summary>
public int planarSpeedBoost = 0;
public int profanedSoulWeaponUsage = 0;
public int profanedSoulWeaponType = 0;
public int hurtSoundTimer = 0;
/// <summary> Counter variable used to track how many hits have been landed with The Dance of Light, for the purposes of triggering its blinding flash attack. </summary>
public int danceOfLightCharge = 0;
/// <summary> Cooldown variable used to prevent DoG from spamming combat text messages when hitting the player. </summary>
public int dogTextCooldown = 0;
public float auralisStealthCounter = 0f;
public int auralisAuroraCounter = 0;
public int auralisAuroraCooldown = 0;
public int auralisAurora = 0;
/// <summary>
/// Counter variable used to track Necro armor's set bonus temporary revive.<br/>
/// When the player receives fatal damage, this value is set to 0, and then increments on each frame.
/// </summary>
public int necroReviveCounter = -1;
public int hideOfDeusTimer = 0;
public int murasamaHitCooldown = 0;
@@ -277,6 +359,9 @@ namespace CalamityMod.CalPlayer
#endregion
#region Sound
/// <summary> General sound cooldown variable. Used by The Microwave and Gastric Belcher Staff. </summary>
public int soundCooldown = 0;
public int hurtSoundTimer = 0;
public bool playRogueStealthSound = false;
public int fullRageSoundCountdownTimer = 0;
private const int FullRageSoundDelay = 300; // The "Rage full" sound cannot play for 5 seconds after Rage has filled. This stops it from jittering.
@@ -304,25 +389,52 @@ namespace CalamityMod.CalPlayer
#endregion
#region Rogue
/// <summary> The player's current rogue stealth value.<br/>
/// Note that the player's displayed stealth value is 100x the internal value. For example, a value of 0.1f means having 10 stealth.
/// </summary>
public float rogueStealth = 0f;
/// <summary>
/// The player's maximum rogue stealth value, from armor and accessories.<br/>
/// Note that the player's displayed stealth value is 100x the internal value. For example, a value of 0.1f means having 10 max stealth.
/// </summary>
public float rogueStealthMax = 0f;
/// <summary> A multiplier to the player's stealth generation when standing still. </summary>
public float stealthGenStandstill = 1f;
/// <summary> A multiplier to the player's stealth generation when moving. </summary>
public float stealthGenMoving = 1f;
public int flatStealthLossReduction = 0;
public const float StealthAccelerationCap = 1.5f;
public float stealthAcceleration = 1f;
public bool stealthStrikeThisFrame = false;
/// <summary>
/// If true, stealth strikes only require 50% of the player's max stealth to perform.<br/>
/// Used by Dark Matter Sheath and Eclipse Mirror.
/// </summary>
public bool stealthStrikeHalfCost = false;
/// <summary>
/// If true, stealth strikes only require 75% of the player's max stealth to perform.<br/>
/// Used by Ruin Medallion.
/// </summary>
public bool stealthStrike75Cost = false;
/// <summary>
/// If true, stealth strikes only require 85% of the player's max stealth to perform.<br/>
/// Used by Coin of Deceit.
/// </summary>
public bool stealthStrike85Cost = false;
/// <summary> If true, this player is wearing a rogue or all-class armor set. This bool is required in order to use rogue stealth. </summary>
public bool wearingRogueArmor = false;
/// <summary> The sum of the player's stealth generation boosts from accessory modifiers. </summary>
public float accStealthGenBoost = 0f;
// TODO -- Stealth needs to be its own damage class so that stealth bonuses only apply to stealth strikes
public float stealthDamage = 0f; // This is extra Rogue Damage that is only added for stealth strikes.
/// <summary>
/// The extra damage boost for rogue stealth strikes.<br/>
/// This is obtained from a formula derived from the player's current stealth, the weapon's use time, and the player's stealth generation boosts.
/// </summary>
public float stealthDamage = 0f;
/// <summary> An additional damage multiplier applied to rogue stealth strikes. Used by Filthy Glove and its upgrades, and Rotten Dogtooth. </summary>
public double bonusStealthDamage = 0;
public float rogueVelocity = 1f;
public float rogueAmmoCost = 1f;
#endregion
#region Mount
@@ -332,6 +444,10 @@ namespace CalamityMod.CalPlayer
public bool crysthamyr = false;
public bool ExoChair = false;
public AndromedaPlayerState andromedaState;
/// <summary>
/// Andromeda Cripple is inflicted on the player if they dismount Flamsteed Ring while a boss is alive.<br/>
/// This severely slows movement and prevents the weapon from being used for its duration.
/// </summary>
public int andromedaCripple;
#endregion
@@ -369,77 +485,106 @@ namespace CalamityMod.CalPlayer
#endregion
#region Rage
/// <summary>
/// If true, enables the Rage mechanic. This is normally Revengeance-exclusive, but can also be enabled by Shattered Community.<br/>
/// Rage is gained from staying close to enemies, or passively by using certain accessories.<br/>
/// When the bar is filled, Rage can be activated to provide a small damage boost over a longer duration.
/// </summary>
public bool RageEnabled => CalamityWorld.revenge || shatteredCommunity;
public bool rageModeActive = false;
/// <summary> The player's current Rage level. Expressed as a percentage of maximum Rage. </summary>
public float rage = 0f;
public float rageMax = 100f; // 0 to 100% by default
/// <summary>
/// The duration which Rage Mode lasts.<br/>
/// Starts at 9 seconds, and is increased by 1 second for each upgrade, up to a maximum of 12 seconds.
/// </summary>
public int RageDuration = BalancingConstants.DefaultRageDuration;
/// <summary> Used by Shattered Community as a short cooldown for gaining Rage when taking damage. </summary>
public int rageGainCooldown = 0;
/// <summary>
/// Counter variable used as a delay before the player starts losing Rage.<br/>
/// The player will start losing Rage if they do not generate Rage, hit an enemy, or take damage for 10 seconds.
/// </summary>
public int rageCombatFrames = 0;
public float RageDamageBoost = BalancingConstants.DefaultRageDamageBoost;
#endregion
#region Adrenaline
/// <summary>
/// If true, enables the Adrenaline mechanic. This is normally Revengeance-exclusive, but can also be enabled by Draedon's Heart.<br/>
/// Adrenaline is gained by avoiding taking damage while a boss is alive.<br/>
/// When the bar is filled, Adrenaline can be activated to provide a large damage boost over a short duration.
/// </summary>
public bool AdrenalineEnabled => CalamityWorld.revenge || draedonsHeart;
public bool adrenalineModeActive = false;
public bool AdrenalineTrail = false;
/// <summary> The player's current Adrenaline level. Expressed as a percentage of maximum Adrenaline. </summary>
public float adrenaline = 0f;
public float adrenalineMax = 100f; // 0 to 100% by default
/// <summary> Used as a short cooldown when the player takes damage before Adrenaline can begin charging again. </summary>
public int adrenalinePauseTimer = 0;
/// <summary> Constant variable representing the duration which Adrenaline Mode lasts. </summary>
public int AdrenalineDuration = CalamityUtils.SecondsToFrames(5);
/// <summary> Constant variable representing the duration it takes to fully charge Adrenaline. </summary>
public int AdrenalineChargeTime = CalamityUtils.SecondsToFrames(30);
/// <summary> Constant variable representing the duration it takes for Adrenaline to empty if no boss is alive. </summary>
public int AdrenalineFadeTime = CalamityUtils.SecondsToFrames(2);
#endregion
#region Defense Damage
// Ratio at which mitigated damage is converted into defense damage.
// This is a significant rework, so the ratio is much higher than the previous 0.1 / 10%.
// The net difference between incoming damage and final taken damage is what is multiplied by this ratio.
//
// Example: You have 200 defense and 25% DR and get hit for 576, on Expert.
//
// Incoming damage = 576
// Defense reduction = 0.75 * 200 = 150
// Damage after defense = 426
// DR reduction = 0.25 * 426 = 106.5
// Damage after DR = 319.5 (rounds down to 319)
//
// Net Difference = 576 - 319 = 257
// Defense Damage = 257 * 0.3333 = 85.6581 (rounds up to 86)
//
// The player then loses 86 defense.
// DR is lost according to the ratio of defense lost versus total defense.
// In this case, that ratio is 86 / 200 = 0.43.
// The player loses 0.43 * 0.25 = 10.75% DR.
/// <summary>
/// Ratio at which mitigated damage is converted into defense damage.<br/>
/// The net difference between incoming damage and final taken damage is what is multiplied by this ratio.<br/>
///
/// For example, if the player has 200 defense and 25% DR and gets hit for 576 damage, on Expert:
///
/// <para>Incoming damage = 576</para>
/// <para>Defense reduction = 0.75 * 200 = 150</para>
/// <para>Damage after defense = 426</para>
/// <para>DR reduction = 0.25 * 426 = 106.5</para>
/// <para>Damage after DR = 319.5 (rounds down to 319)</para>
///
/// <para>Net Difference = 576 - 319 = 257</para>
/// <para>Defense Damage = 257 * 0.3333 = <b>85.6581</b> (rounds up to 86)</para>
///
/// The player then loses 86 defense.<br/>
/// DR is lost according to the ratio of defense lost versus total defense.<br/>
/// In this case, that ratio is 86 / 200 = 0.43. The player loses 0.43 * 0.25 = <b>10.75% DR</b>.
/// </summary>
public double defenseDamageRatio = BalancingConstants.DefaultDefenseDamageRatio;
// Current effect of defense damage, calculated as total defense damage lerped to zero over the recovery time.
/// <summary> Current effect of defense damage, calculated as total defense damage lerped to zero over the recovery time. </summary>
public int CurrentDefenseDamage => (int)(totalDefenseDamage * ((float)defenseDamageRecoveryFrames / totalDefenseDamageRecoveryFrames));
// Total defense damage inflicted. This number keeps increasing if the player is repeatedly hit during the recovery period.
/// <summary> Total defense damage inflicted. This number keeps increasing if the player is repeatedly hit during the recovery period. </summary>
internal int totalDefenseDamage = 0;
// Defense damage from a single hit recovers in 60 frames, no matter how big the hit was.
// If you get hit AGAIN before you have fully recovered, 60 more frames are added to your recovery timer!
/// <summary>
/// Defense damage from a single hit recovers in 60 frames, no matter how big the hit was.<br/>
/// If you get hit AGAIN before you have fully recovered, 60 more frames are added to your recovery timer.
/// </summary>
internal const int DefenseDamageBaseRecoveryTime = 60;
// The maximum possible recovery time is 15 seconds. This is to prevent annoyance where godmode defense damage never goes away.
/// <summary>
/// The maximum possible recovery time is 15 seconds.<br/>
/// This is to prevent annoyance where godmode defense damage never goes away.
/// </summary>
internal const int DefenseDamageMaxRecoveryTime = 900;
// How many frames the player will continue to be recovering from defense damage.
/// <summary> How many frames the player will continue to be recovering from defense damage. </summary>
internal int defenseDamageRecoveryFrames = 0;
// The total timer of defense damage recovery that the player is currently suffering from.
/// <summary> The total timer of defense damage recovery that the player is currently suffering from. </summary>
internal int totalDefenseDamageRecoveryFrames = DefenseDamageBaseRecoveryTime;
// Defense damage does not start recovering for a certain number of frames after iframes end.
/// <summary> The number of frames after immunity frames end before defense damage can start recovering. </summary>
internal const int DefenseDamageRecoveryDelay = 10;
// The current timer for how long the player must wait before defense damage begins recovering.
/// <summary> The current timer for how long the player must wait before defense damage begins recovering. </summary>
internal int defenseDamageDelayFrames = 0;
// Temporary bool for whether the current instance of incoming damage to the player is one that inflicts defense damage.
// Bloodflare Core ignores this and makes every single instance of incoming damage apply defense damage.
/// <summary>
/// Temporary bool for whether the current instance of incoming damage to the player is one that inflicts defense damage.<br/>
/// Bloodflare Core ignores this and makes every single instance of incoming damage apply defense damage.
/// </summary>
public bool nextHitDealsDefenseDamage = false;
#endregion
@@ -464,7 +609,7 @@ namespace CalamityMod.CalPlayer
internal float lunicCorpsShieldPartialRechargeProgress = 0f;
internal bool playedLunicCorpsShieldSound = false;
//Profaned soul shield applies to psa and psc, with differing max hps for each
// 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;
@@ -477,30 +622,51 @@ namespace CalamityMod.CalPlayer
#endregion
#region Abyss
/// <summary> The amount of breath lost on each tick while in the Abyss. </summary>
public float abyssBreathLossStat = 0;
/// <summary> The rate at which breath is lost while in the Abyss. </summary>
public float abyssBreathLossRateStat = 0;
/// <summary> The rate at which health is decreased after running out of breath while in the Abyss. </summary>
public int abyssLifeLostAtZeroBreathStat = 0;
/// <summary> The amount which defense is reduced while in the Abyss. </summary>
public int abyssDefenseLossStat = 0;
#endregion
#region Permanent Buff
public bool spawnedPunchCard = false; // not exactly a buff, but is once per player permanent
/// <summary> If true, the player has spawned in Punch Card through its one-time chat easter egg. </summary>
public bool spawnedPunchCard = false;
/// <summary> If true, the player has consumed Celestial Onion. </summary>
public bool extraAccessoryML = false;
/// <summary> If true, the player has consumed Ethereal Core. </summary>
public bool eCore = false;
/// <summary> If true, the player has consumed Phantom Heart. </summary>
public bool pHeart = false;
/// <summary> If true, the player has consumed Comet Shard. </summary>
public bool cShard = false;
/// <summary> If true, the player has consumed Miracle Fruit. </summary>
public bool mFruit = false;
/// <summary> If true, the player has consumed Sanguine Tangerine. </summary>
public bool sTangerine = false;
/// <summary> If true, the player has consumed Tainted Cloudberry. </summary>
public bool tCloudberry = false;
/// <summary> If true, the player has consumed Sacred Strawberry. </summary>
public bool sStrawberry = false;
/// <summary> If true, the player has consumed Nimble Bounder. </summary>
public bool nimbleBounderBoost = false;
public bool revJamDrop = false;
/// <summary> If true, the player has consumed Mushroom Plasma Root. </summary>
public bool rageBoostOne = false;
/// <summary> If true, the player has consumed Infernal Blood. </summary>
public bool rageBoostTwo = false;
/// <summary> If true, the player has consumed Red Lightning Container. </summary>
public bool rageBoostThree = false;
/// <summary> If true, the player has consumed Electrolyte Gel Pack. </summary>
public bool adrenalineBoostOne = false;
/// <summary> If true, the player has consumed Starlight Fuel Cell. </summary>
public bool adrenalineBoostTwo = false;
/// <summary> If true, the player has consumed Ectoheart. </summary>
public bool adrenalineBoostThree = false;
/// <summary> Used to heal the player to full health on respawn. </summary>
public bool healToFull = false;
#endregion
@@ -515,6 +681,7 @@ namespace CalamityMod.CalPlayer
public bool theBee = false;
public bool arcFlashRing = false;
public bool arcFlashRingVisual = false;
/// <summary> Used to prevent dodges from triggering The Bee's full health damage reduction cooldown. </summary>
public bool shouldTriggerBeeCooldown = false;
public int theBeeCooldown = 0;
public bool alluringBait = false;
@@ -528,6 +695,7 @@ namespace CalamityMod.CalPlayer
public bool stressPills = false;
public bool laudanum = false;
public bool heartOfDarkness = false;
/// <summary> Used to buff the Profaned Guardian Relic drops while using Profaned Soul Crystal. </summary>
public bool profanedSoulRelicBuff = false;
public bool draedonsHeart = false;
public bool vexation = false;
@@ -545,12 +713,19 @@ namespace CalamityMod.CalPlayer
public bool ascendantTrail = false;
public bool frozenWingsCold = false;
public bool flameWingsHeat = false;
/// <summary> Used to toggle dust spawned while swinging, through accessory visibility. </summary>
public bool magmaStoneVisuals = true;
public bool eGauntlet = false;
public bool eGauntletVisuals = true; // Used to control dust spawned when swinging
public int gloveLevel = 0; // Used to prevent glove stacking
public bool alreadyHasFrogLeg = false; // Used to prevent Frog Leg tinker stacking
/// <summary> <inheritdoc cref="magmaStoneVisuals"/> </summary>
public bool eGauntletVisuals = true;
/// <summary>
/// Used to prevent melee speed stacking with Feral Claws and its upgrades.<br/>
/// Feral Claws = 1, Power Glove = 2, Mechanical Glove = 3, Fire Gauntlet = 4, Elemental Gauntlet = 5
/// </summary>
public int gloveLevel = 0;
public bool alreadyHasFrogLeg = false; // Unused, intended to prevent Frog Leg tinker stacking
public bool eTalisman = false;
/// <summary> Counter variable used for spawning Statis' Void Sash's scythes when dashing. </summary>
public int statisTimer = 0;
public bool nucleogenesis = false;
public bool nuclearFuelRod = false;
@@ -574,11 +749,18 @@ namespace CalamityMod.CalPlayer
public bool honeyDewHalveDebuffs = false;
public bool livingDewHalveDebuffs = false;
public int jewelBonusDefense = 0;
public float pulseCounter = 0; // Toxic Heart
public float pulseRate = 1; // Toxic Heart
/// <summary>
/// Counter variable for spawning Toxic Heart's pulses.<br/>
/// Incremented on every frame by <see cref="pulseRate"/>, and when it reaches 420, it is reset and a pulse is spawned.
/// </summary>
public float pulseCounter = 0;
/// <summary>
/// The rate at which <see cref="pulseCounter"/> is incremented, and thus how often Toxic Heart's pulses are spawned.<br/>
/// This value scales with how low the player's life regeneration is.
/// </summary>
public float pulseRate = 1;
public bool aAmpoule = false;
public bool rOoze = false;
public bool JustWasDebuffed = false;
public bool fBarrier = false;
public bool aBrain = false;
public bool amalgam = false;
@@ -599,7 +781,6 @@ namespace CalamityMod.CalPlayer
public bool tracersElysian = false;
public bool tracersSeraph = false;
public bool frostFlare = false;
public bool uberBees = false;
public bool evolution = false;
public int evolutionLifeRegenCounter = 0;
public bool nanotech = false;
@@ -634,20 +815,27 @@ namespace CalamityMod.CalPlayer
public bool crownJewel = false;
public bool infectedJewel = false;
public bool purity = false;
/// <summary> If true, reduces the damage of electricity debuffs by 50%. </summary>
public bool eleResist = false;
public int PurityHealSlowdownFrames = 0;
public bool harpyRing = false;
public bool angelTreads = false;
public bool harpyWingBoost = false; //harpy wings + harpy ring
public int harpyWingFeatherCooldown = 0;
/// <summary> Synergy effect while wearing Harpy Wings with Harpy Ring or Angel Treads, allowing attacks to be accompanied by feathers. </summary>
public bool harpyWingBoost = false;
/// <summary> Makes Flesh Knuckles and its upgrades increase the player's max health by 45. </summary>
public bool fleshKnuckles = false;
public bool ironBoots = false;
public bool depthCharm = false;
public bool anechoicPlating = false;
/// <summary> Used for increasing light level in the Abyss. </summary>
public bool jellyfishNecklace = false;
public bool fairyBoots = false;
public bool flameWakerBoots = false;
public int bootLevel = 0; //Used to prevent Flame Waker and Hellfire Treads stacking
/// <summary>
/// Used to prevent heat debuff damage stacking with Flame Waker Boots and Hellfire Treads.<br/>
/// Flame Waker Boots = 1, Hellfire Treads = 2
/// </summary>
public int bootLevel = 0;
public bool hellfireTreads = false;
public bool abyssalAmulet = false;
public bool lumenousAmulet = false;
@@ -677,7 +865,9 @@ namespace CalamityMod.CalPlayer
public bool XykVisualsBlue = false;
public bool XykVisualsOrange = false;
public bool manaOverloader = false;
/// <summary> Used for allowing Calamity slimes to be affected by Royal Gel. </summary>
public bool royalGel = false;
/// <summary> Used for implementing its synergy with Snow armor. </summary>
public bool handWarmer = false;
public bool ursaSergeant = false;
public bool ursaSergeantVisual = false;
@@ -692,6 +882,7 @@ namespace CalamityMod.CalPlayer
public bool blazingCoreEmpoweredParry = false;
public bool voltaicJelly = false;
public bool jellyChargedBattery = false;
/// <summary> General cooldown for accessories which spawn projectiles on minion hits. </summary>
public float summonProjCooldown;
public bool sandWaifu = false;
public bool sandWaifuVanity = false;
@@ -741,14 +932,21 @@ namespace CalamityMod.CalPlayer
public int hallowedRuneCooldown = 0;
public bool phantomicArtifact = false;
public int phantomicBulwarkCooldown = 0;
public int phantomicHeartRegen = 0; // 0 = can spawn, 720 = regen applied, 600 = regen stops and 10 sec cd before it can spawn again
/// <summary>
/// Controls the state of Phantomic Artifact's Phantomic Regen boost.<br/>
/// When the heart is spawned, this variable is set to 1000. When the heart is touched, it is set to 720 and decrements every frame.<br/>
/// Life regeneration is increased while between 600 and 720, with a 10 second cooldown afterwards when below 600.
/// </summary>
public int phantomicHeartRegen = 0;
public bool silvaWings = false;
public int silvaWingsLifeRegenTimer = 0;
public int wingProjectileCooldown = 0;
public bool RustyMedallionDroplets = false;
public bool MiniSwarmers = false;
public bool noStupidNaturalARSpawns = false;
/// <summary> Used for animating Void Concentration Staff's draw layer. </summary>
public int voidFrameCounter = 0;
/// <summary> <inheritdoc cref="voidFrameCounter"/> </summary>
public int voidFrame = 0;
public bool rottenDogTooth = false;
public bool angelicAlliance = false;
@@ -757,14 +955,18 @@ namespace CalamityMod.CalPlayer
public bool ChaosStone = false;
public bool CryoStone = false;
public bool CryoStoneVanity = false;
/// <summary> Used for spawning Quiver of Nihility's void fields. </summary>
public bool voidField = false;
public bool copyrightInfringementShield = false;
#endregion
#region Armor Set
/// <summary> Calamity's Silver armor set bonus; taking over 20 damage heals 10 health if you avoid damage for 2 seconds. </summary>
public bool silverMedkit = false;
public int silverMedkitTimer = 0;
/// <summary> Calamity's Gold armor set bonus; makes enemies drop Gold Coins. </summary>
public bool goldArmorGoldDrops = false;
/// <summary> Calamity's Mining armor set bonus; gives a chance for extra items to drop when mining ores. </summary>
public bool miningSet = false;
public int miningSetCooldown = 0;
public bool desertProwler = false;
@@ -772,10 +974,14 @@ namespace CalamityMod.CalPlayer
public bool forbiddenCirclet = false;
public int forbiddenCooldown = 0;
public int tornadoCooldown = 0;
public bool eskimoSet = false; //vanilla armor
public bool meteorSet = false; //vanilla armor, for space gun nerf
public bool necroSet = false; //vanilla armor
public bool frostSet = false; //vanilla armor
/// <summary> Calamity's Snow armor set bonus; reduces cold enemy damage and increases cold debuff damage. </summary>
public bool eskimoSet = false;
/// <summary> Calamity's Meteor armor set bonus; makes all magic guns cost 33% mana instead of Space Gun costing 0 mana. </summary>
public bool meteorSet = false;
/// <summary> Calamity's Necro armor set bonus; gives a temporary 10 second revive when the player is killed before actually dying. </summary>
public bool necroSet = false;
/// <summary> Calamity's Frost armor set bonus; gives a combined 20% damage boost split between melee and ranged based on distance from the closest enemy. </summary>
public bool frostSet = false;
public bool victideSet = false;
public bool victideSummoner = false;
public bool sulphurSet = false;
@@ -822,7 +1028,9 @@ namespace CalamityMod.CalPlayer
public bool brimflameFrenzy = false;
public bool lunicCorpsSet = false;
public bool lunicCorpsLegs = false;
/// <summary> Demonshade Breastplate's life regeneration boost. </summary>
public bool shadeRegen = false;
/// <summary> Demonshade Greaves' movement speed boost. </summary>
public bool shadowSpeed = false;
public bool dsSetBonus = false;
public bool auricBoost = false;
@@ -843,7 +1051,9 @@ namespace CalamityMod.CalPlayer
public bool fathomSwarmerVisage = false;
public bool fathomSwarmerBreastplate = false;
public bool fathomSwarmerTail = false;
/// <summary> Used for animating Fathom Swarmer armor's tail layer. </summary>
public int tailFrameUp = 0;
/// <summary> <inheritdoc cref="tailFrameUp"/> </summary>
public int tailFrame = 0;
public bool astralStarRain = false;
public int astralStarRainCooldown = 0;
@@ -884,12 +1094,19 @@ namespace CalamityMod.CalPlayer
public bool chaosSpirit = false;
public bool redDevil = false;
public bool GemTechSet = false;
/// <summary> Calamity's Cobalt armor set bonus; increases damage and crit chance based on how fast the player is moving. </summary>
public bool CobaltSet = false;
/// <summary> Calamity's Mythril armor set bonus; hits spawn additional homing mythril flares. </summary>
public bool MythrilSet = false;
public int MythrilFlareSpawnCountdown = 0;
/// <summary> Calamity's Adamantite armor set bonus; adds half of DR to crit chance, and makes landing hits give a stacking defense boost. </summary>
public bool AdamantiteSet = false;
public int AdamantiteSetDecayDelay = 0;
public int ChlorophyteHealDelay = 0;
/// <summary>
/// If true, the player is wearing a post-Moon Lord summoner armor set.<br/>
/// Currently unused.
/// </summary>
public bool WearingPostMLSummonerSet = false;
private float adamantiteSetDefenseBoostInterpolant;
@@ -1231,24 +1448,44 @@ namespace CalamityMod.CalPlayer
#endregion
#region Calamitas Enchant Effects
/// <summary> If true, the player is holding an item with the Indignant enchantment. </summary>
public bool cursedSummonsEnchant = false;
/// <summary> If true, the player is holding an item with the Aflame enchantment. </summary>
public bool flamingItemEnchant = false;
/// <summary> If true, the player is holding an item with the Oblatory enchantment. </summary>
public bool lifeManaEnchant = false;
/// <summary> If true, the player is holding an item with the Resentful enchantment. </summary>
public bool farProximityRewardEnchant = false;
/// <summary> If true, the player is holding an item with the Bloodthirsty enchantment. </summary>
public bool closeProximityRewardEnchant = false;
/// <summary> If true, the player is holding an item with the Ephemeral enchantment. </summary>
public bool dischargingItemEnchant = false;
/// <summary> If true, the player is holding an item with the Hellbound enchantment. </summary>
public bool explosiveMinionsEnchant = false;
/// <summary> If true, the player is holding an item with the Tainted enchantment. </summary>
public bool bladeArmEnchant = false;
/// <summary> If true, the player is holding an item with the Traitorous enchantment. </summary>
public bool manaMonsterEnchant = false;
/// <summary> If true, the player is holding an item with the Withering enchantment. </summary>
public bool witheringWeaponEnchant = false;
public bool witheredDebuff = false;
/// <summary>
/// Counter variable which controls negative life regeneration from the Withered debuff.<br/>
/// Increments every frame a weapon with the Withering enchantment is held, and decrements vice versa.
/// </summary>
public int witheredWeaponHoldTime = 0;
/// <summary>
/// How much damage was dealt by a weapon with the Withering enchantment.<br/>
/// Used to determine what percentage of the hit to heal back.
/// </summary>
public int witheringDamageDone = 0;
/// <summary> If true, the player is holding an item with the Persecuted enchantment. </summary>
public bool persecutedEnchant = false;
public int persecutedEnchantSummonTimer = 0;
/// <summary> If true, the player is holding an item with the Lecherous enchantment. </summary>
public bool lecherousOrbEnchant = false;
public bool awaitingLecherousOrbSpawn = false;
#endregion Calamitas Enchant Effects
@@ -1303,19 +1540,19 @@ namespace CalamityMod.CalPlayer
private Vector2 oldMouseWorld;
/// <summary>
/// Set this to true if you need to recieve updates on right clicks from players and sync them in mp.
/// Automatically resets itself after sending an update
/// <\summary>
/// Set this to true if you need to receive updates on right clicks from players and sync them in multiplayer.<br/>
/// Automatically resets itself after sending an update.
/// </summary>
public bool rightClickListener = false;
/// <summary>
/// Set this to true if you need to recieve updates on the position of the player's mouse and sync them in mp.
/// Automatically resets itself after sending an update
/// <\summary>
/// Set this to true if you need to receive updates on the position of the player's mouse and sync them in multiplayer.<br/>
/// Automatically resets itself after sending an update.
/// </summary>
public bool mouseWorldListener = false;
/// <summary>
/// Set this to true if you need to recieve updates on the rotation of the mouse to the player. This sends updates less frequently than the more tight tolerance mouseWorldListener
/// Automatically resets itself after sending an update
/// <\summary>
/// Set this to true if you need to receive updates on the rotation of the mouse to the player. This sends updates less frequently the tighter the tolerance of mouseWorldListener.<br/>
/// Automatically resets itself after sending an update.
/// </summary>
public bool mouseRotationListener = false;
public bool syncMouseControls = false;
@@ -1630,7 +1867,6 @@ namespace CalamityMod.CalPlayer
contactDamageReduction = 0D;
projectileDamageReduction = 0D;
rogueVelocity = 1f;
rogueAmmoCost = 1f;
accStealthGenBoost = 0f;
DashID = string.Empty;
@@ -1796,7 +2032,6 @@ namespace CalamityMod.CalPlayer
aBrain = false;
amalgam = false;
frostFlare = false;
uberBees = false;
evolution = false;
nanotech = false;
deadshotBrooch = false;
@@ -1958,10 +2193,10 @@ namespace CalamityMod.CalPlayer
miningSet = false;
miningSetCooldown = 0;
eskimoSet = false; //vanilla armor
meteorSet = false; //vanilla armor, for Space Gun nerf
necroSet = false; //vanilla armor
frostSet = false; //vanilla armor
eskimoSet = false;
meteorSet = false;
necroSet = false;
frostSet = false;
victideSet = false;
victideSummoner = false;
@@ -2540,7 +2775,6 @@ namespace CalamityMod.CalPlayer
stealthDamage = 0f;
bonusStealthDamage = 0;
rogueVelocity = 1f;
rogueAmmoCost = 1f;
#endregion
#region UI
@@ -2727,10 +2961,10 @@ namespace CalamityMod.CalPlayer
forbiddenCirclet = false;
forbiddenCooldown = 0;
tornadoCooldown = 0;
eskimoSet = false; //vanilla armor
meteorSet = false; //vanilla armor, for Space Gun nerf
necroSet = false; //vanilla armor
frostSet = false; //vanilla armor
eskimoSet = false;
meteorSet = false;
necroSet = false;
frostSet = false;
victideSet = false;
aeroSet = false;
sulphurSet = false;
@@ -2794,7 +3028,6 @@ namespace CalamityMod.CalPlayer
persecutedEnchantSummonTimer = 0;
momentumCapacitorTime = 0;
momentumCapacitorBoost = 0f;
harpyWingFeatherCooldown = 0;
silvaWingsLifeRegenTimer = 0;
LungingDown = false;
@@ -3984,8 +4217,6 @@ namespace CalamityMod.CalPlayer
{
// Adding to StatModifier adds to the additive multiplier
bool rogue = item.CountsAsClass<RogueDamageClass>();
if (auricBoost)
knockback += ((1f - modStealth) * 0.5f);
if (whiskey)
knockback += Whiskey.KnockbackBoost;
-2
View File
@@ -2245,8 +2245,6 @@ namespace CalamityMod.CalPlayer
}
#endregion
modStealth = 1f;
// Give Rage combat frames because being hurt counts as combat.
if (RageEnabled)
rageCombatFrames = BalancingConstants.RageCombatDelayTime;
+3 -5
View File
@@ -1725,8 +1725,6 @@ namespace CalamityMod.CalPlayer
hideOfDeusTimer--;
if (murasamaHitCooldown > 0)
murasamaHitCooldown--;
if (harpyWingFeatherCooldown > 0)
harpyWingFeatherCooldown--;
if (burningSeaBurnOut > 0)
{
burningSeaBurnOut--;
@@ -2755,7 +2753,7 @@ namespace CalamityMod.CalPlayer
Player.moveSpeed -= (1f - aquaticBoost * 0.0001f) * 0.1f;
}
else
aquaticBoost = aquaticBoostMax; modStealth = 1f;
aquaticBoost = aquaticBoostMax;
if (Player.ActiveItem().type == ModContent.ItemType<Auralis>() && Player.StandingStill(0.1f))
{
@@ -3532,7 +3530,7 @@ namespace CalamityMod.CalPlayer
const int FramesPerHit = 30;
// Constantly increment the timer every frame.
brimLoreInfernoTimer = (brimLoreInfernoTimer + 1) % FramesPerHit;
hydrothermicInfernoTimer = (hydrothermicInfernoTimer + 1) % FramesPerHit;
// Only run this code for the client which is wearing the armor.
// Brimstone flames is applied every single frame, but direct damage is only dealt twice per second.
@@ -3552,7 +3550,7 @@ namespace CalamityMod.CalPlayer
if (Vector2.Distance(Player.Center, npc.Center) <= range)
{
npc.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 120);
if (brimLoreInfernoTimer == 0)
if (hydrothermicInfernoTimer == 0)
Projectile.NewProjectile(source, npc.Center, Vector2.Zero, ModContent.ProjectileType<DirectStrike>(), damage, 0f, Player.whoAmI, npc.whoAmI);
}
}
+1 -1
View File
@@ -308,7 +308,7 @@ namespace CalamityMod.CalPlayer
if (!proj.npcProj && !proj.trap && proj.friendly)
{
if ((plaguebringerCarapace || uberBees) && FriendlyBeesList.Includes(proj.type))
if (plaguebringerCarapace && FriendlyBeesList.Includes(proj.type))
target.AddBuff(BuffType<Plague>(), 300);
// All projectiles fired from Soma Prime are marked using CalamityGlobalProjectile
-4
View File
@@ -179,10 +179,6 @@ namespace CalamityMod.Items.Accessories
TwoPlaces(60f * player.GetStandingStealthRegen()),
TwoPlaces(60f * player.GetMovingStealthRegen()),
Sign(rogueVelocity) + TwoPlaces(100f * rogueVelocity));
// Rogue consumable chance only if item is consumable
if (heldItem.consumable)
stats2 += this.GetLocalization("RogueConsumption").Format(100f * modPlayer.rogueAmmoCost);
}
// If tool, add tool range
+2 -2
View File
@@ -558,9 +558,9 @@ namespace CalamityMod.Items
}
if (modPlayer.harpyWingBoost && (modPlayer.harpyRing || modPlayer.angelTreads))
{
if (Main.rand.NextBool(5) && modPlayer.harpyWingFeatherCooldown == 0 && !item.channel)
if (Main.rand.NextBool(5) && modPlayer.wingProjectileCooldown == 0 && !item.channel)
{
modPlayer.harpyWingFeatherCooldown = 20;
modPlayer.wingProjectileCooldown = 20;
if (player.whoAmI == Main.myPlayer)
{
float spreadX = velocity.X + Main.rand.NextFloat(-0.75f, 0.75f);
-2
View File
@@ -37,7 +37,5 @@ namespace CalamityMod.Items.Weapons.Rogue
public virtual void ModifyStatsExtra(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback)
{
}
public override bool ConsumeItem(Player player) => Main.rand.NextFloat() < player.Calamity().rogueAmmoCost;
}
}
@@ -1732,7 +1732,6 @@ StatMeter: {
Max Stealth: {0} | Standing Regen: {1} / sec | Moving Regen: {2} / sec
Rogue Velocity Boost: {3}%
'''
RogueConsumption: " | Rogue Weapon Consumption Chance: {0}%"
// Utility stats
ToolRange: Tool Range Bonus: ({0}, {1})
MiningSpeed: " | Mining Speed: {0}%"
+1 -1
View File
@@ -204,7 +204,7 @@ namespace CalamityMod.Projectiles
/// <summary> Timer for how long a projectile's damage is reduced by the value in <see cref="flatDR"/>. </summary>
public int flatDRTimer = 0;
/// <summary> A temporary flat amount substracted from the projectile's damage when hitting the player. Resets to 0 if <see cref="flatDRTimer"/> drops to 0. </summary>
/// <summary> A temporary flat amount subtracted from the projectile's damage when hitting the player. Resets to 0 if <see cref="flatDRTimer"/> drops to 0. </summary>
public int flatDR = 0;
/// <summary> If true, allows hostile projectiles to deal defense damage to the player. Used mostly for hard-hitting bosses. </summary>
+1 -1
View File
@@ -15,7 +15,7 @@ namespace CalamityMod.Projectiles.Melee
public static readonly SoundStyle UseSoundFunny = new("CalamityMod/Sounds/Item/CalamityBell") { Volume = 1.5f };
public static int HighBong = 0;
public int time = 0;
public ref int EmpoweredHammer => ref Main.player[Projectile.owner].Calamity().StellarHammer;
public ref int EmpoweredHammer => ref Main.player[Projectile.owner].Calamity().Holyhammer;
public override void SetStaticDefaults()
{