Merge branch '1.4.4' into MageAccessories

This commit is contained in:
mochi-angel committed 2025-04-26 15:26:29 -07:00
commit 509a0d3695
1148 files changed
+22357 -7126

No files matched your search

+4 -4
View File
@@ -15,10 +15,10 @@ namespace CalamityMod.Backgrounds
if (Main.dedServ)
return;
SSBG0 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/SunkenSeaBG0");
SSBG1 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/SunkenSeaBG1");
SSBG2 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/SunkenSeaBG2");
SSBG3 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/SunkenSeaBG3");
SSBG0 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel");
SSBG1 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel");
SSBG2 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel");
SSBG3 = BackgroundTextureLoader.GetBackgroundSlot("CalamityMod/Backgrounds/BlankPixel");
}
public override void FillTextureArray(int[] textureSlots)
+10 -18
View File
@@ -92,13 +92,8 @@ namespace CalamityMod.Balancing
NPCSpecificBalancingChanges = new List<NPCBalancingChange>();
#region Desert Scourge
// 25% resist to true melee.
NPCSpecificBalancingChanges.AddRange(Bundle(DesertScourgeIDList.List, Do(ResistTrueMelee(0.8f))));
#endregion
#region Crabulon
// 25% resist to true melee.
// 20% resist to true melee.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<Crabulon>(), ResistTrueMelee(0.8f)));
#endregion
@@ -185,9 +180,6 @@ namespace CalamityMod.Balancing
#region Astrum Aureus
// 30% resist to The Ballista's greatarrows.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<AstrumAureus>(), Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<BallistaGreatArrow>()))));
// 30% resist to Whitewater.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<AstrumAureus>(), Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<WhitewaterProj>(), ProjectileType<WhitewaterAura>(), ProjectileType<WhitewaterSpear>()))));
#endregion
#region Duke Fishron
@@ -216,9 +208,6 @@ namespace CalamityMod.Balancing
// 50% resist to Icicle Arrows.
NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<IcicleArrowProj>()))));
// 50% resist to Whitewater.
NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<WhitewaterAura>(), ProjectileType<WhitewaterProj>(), ProjectileType<WhitewaterSpear>()))));
// 35% resist to Flying Dragon.
NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.65f, ProjectileID.DD2SquireSonicBoom))));
@@ -259,15 +248,15 @@ namespace CalamityMod.Balancing
// 70% resist to Stardust Dragon Staff.
NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.3f, ProjectileID.StardustDragon1, ProjectileID.StardustDragon2, ProjectileID.StardustDragon3, ProjectileID.StardustDragon4))));
// 65% resist to Atlantis (Atlantis gaming!).
NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.35f, ProjectileType<AtlantisSpear>()))));
// 55% resist to Flak Kraken.
NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.45f, ProjectileType<FlakKrakenProjectile>()))));
// 50% resist to true melee.
NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(ResistTrueMelee(0.5f))));
// 50% resist to Atlantis (Atlantis gaming!).
NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<AtlantisSpear>()))));
// 50% resist to Aurora Blazer.
NPCSpecificBalancingChanges.AddRange(Bundle(AstrumDeusIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<AuroraFire>()))));
@@ -306,6 +295,9 @@ namespace CalamityMod.Balancing
// 50% resist to Galactus Blade.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<DarkEnergy>(), new ProjectileResistBalancingRule(0.5f, ProjectileType<GalacticaComet>())));
// 40% resist to Pristine Fury's alt fire.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<DarkEnergy>(), new ProjectileResistBalancingRule(0.6f, ProjectileType<PristineSecondary>())));
// 40% resist to Stellar Torus Staff.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<DarkEnergy>(), new ProjectileResistBalancingRule(0.6f, ProjectileType<StellarTorusBeam>())));
#endregion
@@ -370,6 +362,9 @@ namespace CalamityMod.Balancing
#endregion
#region Exo Mechs: Ares
// 35% resist to Devil's Devastation's slash.
NPCSpecificBalancingChanges.AddRange(Bundle(AresIDList.List, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType<DevilsDevastationHoldout>()))));
// 30% resist to Dynamic Pursuer.
NPCSpecificBalancingChanges.AddRange(Bundle(AresIDList.List, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<DynamicPursuerProjectile>(), ProjectileType<DynamicPursuerLaser>(), ProjectileType<DynamicPursuerElectricity>()))));
@@ -487,9 +482,6 @@ namespace CalamityMod.Balancing
// 15% resist to The Final Dawn's AoE sweep flames.
NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.85f, ProjectileType<FinalDawnFlame>()))));
// 15% resist to Dragon's Breath's beam of fire.
NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.85f, ProjectileType<DragonsBreathBurst>()))));
// 15% resist to God Slayer Slugs.
NPCSpecificBalancingChanges.AddRange(Bundle(ThanatosIDList.List, Do(new ProjectileResistBalancingRule(0.85f, ProjectileType<GodSlayerSlugProj>()))));
+20 -1
View File
@@ -21,7 +21,8 @@
internal const float VanillaFrogLegJumpSpeedBoost = 1.6f;
// Altered jump speed boost provided by Amphibian Boots via global item UpdateAccessory
internal static readonly float AmphibianBootsJumpSpeedBoost = 1f;
//doze 23apr2025 - Undid nerf, it's now the same as frog leg. If it's a problem, maybe retier it?
internal static readonly float AmphibianBootsJumpSpeedBoost = 1.6f;
// Altered movement stats provided by Shadow Armor via IL edit
// This item is modified to not stack with Magiluminescence if on the ground. If in the air, it still functions.
@@ -50,6 +51,7 @@
#region Dashes and Dodges
// Dash cooldowns (in frames)
internal const int UniversalDashCooldown = 30;
internal const int UniversalSashDashCooldown = 30;
internal const int UniversalShieldSlamCooldown = 30;
internal const int UniversalShieldBonkCooldown = 30;
internal const int OnShieldBonkCooldown = 30;
@@ -241,6 +243,16 @@
internal static readonly float TrueMeleeRipperReductionFactor = 0.5f; // True melee benefits less from rippers to prevent excessive melting.
#endregion
#region Pierce Resistance
// Both of the below variables only apply when an NPC has universal pierce resistance enabled via attribute.
// Projectiles may be marked as exempt from this pierce resistance by using an attribute.
/// <summary> Constant variable used to determine the percentage a projectile's damage is reduced by pierce resist on each hit. </summary>
public const float PierceResistHarshness = 0.12f;
/// <summary> Constant variable used to determine the maximum percentage a projectile's damage can be reduced by pierce resist. </summary>
public const float PierceResistCap = 0.8f;
#endregion
// TODO -- NPC classification is not done consistently with predictable thresholds.
// These variables should be used in general to classify "enemies" vs "non-enemies" as well.
// See NPCUtils.IsAnEnemy
@@ -252,6 +264,13 @@
internal const int UnreasonableHealthThreshold = 25000000; // 25 million
#endregion
#region Multiplayer Boss Health Scaling Overrides
// These values are used to replace the vanilla 1.35f and 1.9166666666666666f for the 2-player and 3-player cases, respectively.
// Editing them via reflection or otherwise will apply to newly spawned bosses during gameplay.
public static float ExpertHealthScalingOverride_2Players = 1.75f;
public static float ExpertHealthScalingOverride_3Players = 2.25f;
#endregion
// TODO -- Add all balance related constants here that don't belong in other files.
// Review all constants and static readonlys in the entire mod to find things to add.
}
+2 -2
View File
@@ -1,5 +1,5 @@
using CalamityMod.CalPlayer;
using CalamityMod.Items.Placeables.FurnitureAbyss;
using CalamityMod.Items.Placeables.Furniture;
using CalamityMod.Systems;
using CalamityMod.Waters;
using CalamityMod.World;
@@ -48,7 +48,7 @@ namespace CalamityMod.BiomeManagers
// Temporarily use sulphur for now
public override ModWaterStyle WaterStyle => SulphuricDepthsWater.Instance;
public override int BiomeTorchItemType => ModContent.ItemType<AbyssTorch>();
public override int BiomeTorchItemType => ModContent.ItemType<CausticTorch>();
public override SceneEffectPriority Priority => SceneEffectPriority.Environment;
public override string BestiaryIcon => "CalamityMod/BiomeManagers/AbyssLayer1Icon";
public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer1";
+2 -2
View File
@@ -1,5 +1,5 @@
using CalamityMod.CalPlayer;
using CalamityMod.Items.Placeables.FurnitureAbyss;
using CalamityMod.Items.Placeables.Furniture;
using CalamityMod.Systems;
using CalamityMod.Waters;
using CalamityMod.World;
@@ -22,7 +22,7 @@ namespace CalamityMod.BiomeManagers
}
public override ModWaterStyle WaterStyle => UpperAbyssWater.Instance;
public override int BiomeTorchItemType => ModContent.ItemType<AbyssTorch>();
public override int BiomeTorchItemType => ModContent.ItemType<KelpTorch>();
public override SceneEffectPriority Priority => SceneEffectPriority.Environment;
public override string BestiaryIcon => "CalamityMod/BiomeManagers/AbyssLayer2Icon";
public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer23";
+2 -2
View File
@@ -1,5 +1,5 @@
using CalamityMod.CalPlayer;
using CalamityMod.Items.Placeables.FurnitureAbyss;
using CalamityMod.Items.Placeables.Furniture;
using CalamityMod.Systems;
using CalamityMod.Waters;
using CalamityMod.World;
@@ -22,7 +22,7 @@ namespace CalamityMod.BiomeManagers
}
public override ModWaterStyle WaterStyle => MiddleAbyssWater.Instance;
public override int BiomeTorchItemType => ModContent.ItemType<AbyssTorch>();
public override int BiomeTorchItemType => ModContent.ItemType<ThermalTorch>();
public override SceneEffectPriority Priority => SceneEffectPriority.Environment;
public override string BestiaryIcon => "CalamityMod/BiomeManagers/AbyssLayer3Icon";
public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer23";
+2 -2
View File
@@ -1,5 +1,5 @@
using CalamityMod.CalPlayer;
using CalamityMod.Items.Placeables.FurnitureAbyss;
using CalamityMod.Items.Placeables.Furniture;
using CalamityMod.Systems;
using CalamityMod.Waters;
using CalamityMod.World;
@@ -22,7 +22,7 @@ namespace CalamityMod.BiomeManagers
}
public override ModWaterStyle WaterStyle => VoidWater.Instance;
public override int BiomeTorchItemType => ModContent.ItemType<AbyssTorch>();
public override int BiomeTorchItemType => ModContent.ItemType<VoidTorch>();
public override SceneEffectPriority Priority => SceneEffectPriority.Environment;
public override string BestiaryIcon => "CalamityMod/BiomeManagers/AbyssLayer4Icon";
public override string BackgroundPath => "CalamityMod/Backgrounds/MapBackgrounds/AbyssBGLayer4";
+4 -1
View File
@@ -21,12 +21,15 @@ namespace CalamityMod.Buffs.StatBuffs
if (modPlayer.abyssalDivingSuitPrevious)
{
if (player.IsUnderwater())
{
if (player.maxFallSpeed < 9f)
player.maxFallSpeed = 9f;
player.gills = true;
}
modPlayer.abyssalDivingSuitPower = true;
modPlayer.depthCharm = true;
modPlayer.jellyfishNecklace = true;
modPlayer.anechoicPlating = true;
modPlayer.ironBoots = true;
player.arcticDivingGear = true;
player.accFlipper = true;
player.accDivingHelm = true;
+1 -1
View File
@@ -16,7 +16,7 @@ namespace CalamityMod.Buffs.StatBuffs
public override void Update(Player player, ref int buffIndex)
{
player.Calamity().omegaBlueHentai = true;
player.Calamity().omegaBlueAbyssalMadness = true;
}
}
}
+12
View File
@@ -0,0 +1,12 @@
using CalamityMod.Projectiles.Summon;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Summon
{
public class SeashineSwordBuff : BaseSummonBuff
{
protected override int MinionProjectileType => ModContent.ProjectileType<SeashineSwordProj>();
protected override ref bool MinionBool => ref BuffModdedOwner.seashineSwordBuff;
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 693 B

+176 -40
View File
@@ -61,9 +61,11 @@ using CalamityMod.Systems;
using CalamityMod.Systems.Collections;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.Audio;
using Terraria.DataStructures;
using Terraria.GameContent;
using Terraria.GameInput;
using Terraria.Graphics.Shaders;
using Terraria.ID;
@@ -143,6 +145,7 @@ namespace CalamityMod.CalPlayer
public bool disableHiveCystSpawns = false;
public bool disableNaturalScourgeSpawns = false;
public bool disableAnahitaSpawns = false;
public int whitewaterHeal = 0;
/// <summary> Used for toggling Calamity's blazing cursor effect. </summary>
public bool blazingCursorDamage = false;
/// <summary>
@@ -297,7 +300,12 @@ namespace CalamityMod.CalPlayer
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;
/// <summary> Variable used to trigger Molten Amputator's stealth effect on right-click. </summary>
public int amputatorBuff = 0;
/// <summary> Variable used to track the fuel of Pristine Fury right click </summary>
public int furyFuelMax = 1800;
public int furyFuel = 1800;
public float furyRefuelTimer = 0;
public int rOfResilienceCooldown = 0;
public int rOfResilienceEffect = 0;
public int rOfResilienceOrbitOffset = 0;
@@ -309,7 +317,7 @@ namespace CalamityMod.CalPlayer
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.
/// If this value is greater than 3, the player is inflicted with Alcohol Poisoning.
/// </summary>
public int alcoholPoisonLevel = 0;
public int dashTimeMod;
@@ -358,7 +366,7 @@ namespace CalamityMod.CalPlayer
public int giantShellPostHit = 0;
public int tortShellPostHit = 0;
public int RustyMedallionCooldown = 0;
public int MiniSwamerCooldown = 0;
public int MiniSwarmerCooldown = 0;
public float SulphWaterPoisoningLevel;
public float holyInfernoFadeIntensity;
public NPC unstableSelectedTarget;
@@ -710,9 +718,11 @@ namespace CalamityMod.CalPlayer
public bool shieldOfTheHighRulerDashVelocityBoosted = false;
public bool luxorsGift = false;
public bool luxorHit = false;
public bool luxorsGiftVanity = false;
public bool fungalSymbiote = false;
public bool trinketOfChi = false;
public bool gladiatorSword = false;
public int gladiatorTimer = 0;
public bool unstableGraniteCore = false;
public bool regenator = false;
public float regenatorDamage = 0;
@@ -731,6 +741,10 @@ namespace CalamityMod.CalPlayer
/// <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 aFossil = false;
public bool aPowder = false;
public bool fallingBlockProtection = false;
public bool trapProtection = false;
public bool alluringBait = false;
public bool enchantedPearl = false;
public bool fishingStation = false;
@@ -773,8 +787,13 @@ namespace CalamityMod.CalPlayer
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 statisNinjaBelt = false;
/// <summary> Used to keep track of how many dashes in the same direction you make to prevent dashing away from bosses forever at max efficency. </summary>
public int statisPenaltyTimer = 0;
public int statisAnticheese = 0;
public int statisTimerMax => (int)(Utils.Remap(statisAnticheese, 1, 6, 120, 50, true));
public bool voidSashVisuals = true;
public bool statisVoidSash = false;
public bool nucleogenesis = false;
public bool nuclearFuelRod = false;
public bool nebulousCore = false;
@@ -794,9 +813,11 @@ namespace CalamityMod.CalPlayer
public bool rampartOfDeities = false;
public bool gShell = false;
public bool lAmbergris = false;
public bool lAmbergrisVisual = false;
public bool tortShell = false;
public bool absorber = false;
public bool alwaysHoneyRegen = false;
public float alwaysHoneyRegenAmount = 0;
public bool honeyTurboRegen = false;
public bool honeyDewHalveDebuffs = false;
public bool livingDewHalveDebuffs = false;
@@ -813,11 +834,14 @@ namespace CalamityMod.CalPlayer
public float pulseRate = 1;
public bool aAmpoule = false;
public bool rOoze = false;
public float radiantOozeRegen = 0;
public float ambrosialAmpouleRegen = 0;
public float purityRegen = 0;
public bool fBarrier = false;
public bool aBrain = false;
public bool amalgam = false;
public bool raiderTalisman = false;
public float raiderCritLifespan = 0f;
public int raiderCritLifespan = 0;
public int raiderSoundCooldown = 0;
public bool gSabaton = false;
public int gSabatonHotkeyHoldTime = 0;
@@ -873,8 +897,6 @@ namespace CalamityMod.CalPlayer
public int PurityHealSlowdownFrames = 0;
public bool harpyRing = false;
public bool angelTreads = false;
/// <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> Counter variable used for automatically re-engaging Vortex armor's stealth with Vortex Booster. </summary>
public int vortexBoosterStealthDelay = 0;
/// <summary> Makes Flesh Knuckles and its upgrades increase the player's max health by 45. </summary>
@@ -884,7 +906,7 @@ namespace CalamityMod.CalPlayer
public bool anechoicPlating = false;
/// <summary> Used for increasing light level in the Abyss. </summary>
public bool jellyfishNecklace = false;
/// <summary> Calamity's Fairy Boots effect; makes fairies spawn around you which give stats. </summary>
/// <summary> Calamity's Fairy Boots effect; makes fairies spawn around the player which give stats. </summary>
public bool fairyBoots = false;
/// <summary> Calamity's Flame Waker Boots effect; multiplies heat debuff damage and makes attacks inflict On Fire. </summary>
public bool flameWakerBoots = false;
@@ -909,6 +931,7 @@ namespace CalamityMod.CalPlayer
public bool baroclaw = false;
public bool HasIncreasedDashFirstFrame = false;
public bool IsFirstDashFrame = true;
public int fallingBootVelCheckTimer = 0;
public bool voidOfCalamity = false;
public bool voidOfExtinction = false;
public bool eArtifact = false;
@@ -916,11 +939,15 @@ namespace CalamityMod.CalPlayer
public bool auricSArtifact = false;
public bool pSoulArtifact = false;
public bool giantPearl = false;
public bool shieldOfTheOcean = false;
public int shieldOfTheOceanParry = 0;
public bool shieldOfTheOceanEmpoweredParry = false;
public bool normalityRelocator = false;
public bool flameLickedShell = false;
public int flameLickedShellParry = 0;
public bool flameLickedShellEmpoweredParry = false;
public bool Pauldron = false;
public bool sPauldron = false;
public bool sPauldronVisual = false;
public bool XykVisualsBlue = false;
public bool XykVisualsOrange = false;
public bool manaOverloader = false;
@@ -1002,7 +1029,7 @@ namespace CalamityMod.CalPlayer
public int phantomicHeartRegen = 0;
public bool silvaWings = false;
public int silvaWingsLifeRegenTimer = 0;
/// <summary> General cooldown variable for spawning projectiles from wing bonus effects. Used by Soul of Cryogen, Harpy Wings, Tattered Fairy Wings, and Festive Wings. </summary>
/// <summary> General cooldown variable for spawning projectiles from wing bonus effects. Used by Soul of Cryogen, Tattered Fairy Wings, and Festive Wings. </summary>
public int wingProjectileCooldown = 0;
public bool RustyMedallionDroplets = false;
public bool noStupidNaturalARSpawns = false;
@@ -1024,7 +1051,7 @@ namespace CalamityMod.CalPlayer
#region Armor Set
public int ArmorSetBonusKeyHeldTimer;
/// <summary> Calamity's Silver armor set bonus; taking over 20 damage heals 10 health if you avoid damage for 2 seconds. </summary>
/// <summary> Calamity's Silver armor set bonus; taking over 20 damage heals 10 health if the player avoids 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>
@@ -1039,7 +1066,7 @@ namespace CalamityMod.CalPlayer
public int tornadoCooldown = 0;
/// <summary> Calamity's Snow armor set bonus; reduces cold enemy damage and increases cold debuff damage. </summary>
public bool eskimoSet = false;
/// <summary> Calamity's Rain armor set bonus; gives jump speed and makes jumps create a splash </summary>
/// <summary> Calamity's Rain armor set bonus; increases jump speed and makes jumps create a damaging splash. </summary>
public bool rainSet = 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;
@@ -1151,12 +1178,14 @@ namespace CalamityMod.CalPlayer
public bool auricSet = false;
public bool omegaBlueChestplate = false;
public bool omegaBlueSet = false;
public bool omegaBlueHentai = false;
public bool omegaBlueAbyssalMadness = false;
/// <summary> Aerospec armor's summoner set bonus minion. </summary>
public bool valkyrie = false;
/// <summary> Statigel armor's summoner set bonus minion. </summary>
public bool slimeGod = false;
public bool molluskSet = false;
public bool molluskHelmet = false;
public bool molluskChest = false;
public bool molluskLegs = false;
public bool fearmongerSet = false;
public int fearmongerRegenFrames = 0;
public bool daedalusCrystal = false;
@@ -1388,7 +1417,6 @@ namespace CalamityMod.CalPlayer
/// <summary> Sun Spirit Staff. </summary>
public bool SP = false;
public bool dCreeper = false;
public bool bClot = false;
public bool eAxe = false;
public bool endoCooper = false;
/// <summary> Vengeful Sun Staff. </summary>
@@ -1451,6 +1479,7 @@ namespace CalamityMod.CalPlayer
/// <summary> Dragonblood Disgorger. </summary>
public bool dragonFamily = false;
public bool providenceStabber = false;
public bool seashineSwordBuff = false;
public bool saros = false;
/// <summary> Fuel Cell Bundle. </summary>
public bool plaguebringerMK2 = false;
@@ -2097,9 +2126,11 @@ namespace CalamityMod.CalPlayer
omegaBlueChestplate = false;
omegaBlueSet = false;
omegaBlueHentai = false;
omegaBlueAbyssalMadness = false;
molluskSet = false;
molluskHelmet = false;
molluskChest = false;
molluskLegs = false;
fearmongerSet = false;
ataxiaBolt = false;
@@ -2121,6 +2152,7 @@ namespace CalamityMod.CalPlayer
blazingCursorVisuals = false;
luxorsGift = false;
luxorsGiftVanity = false;
fungalSymbiote = false;
trinketOfChi = false;
gladiatorSword = false;
@@ -2132,6 +2164,10 @@ namespace CalamityMod.CalPlayer
arcFlashRingVisual = false;
bGlassBand = false;
bGlassBandVisual = false;
aFossil = false;
aPowder = false;
fallingBlockProtection = false;
trapProtection = false;
alluringBait = false;
enchantedPearl = false;
fishingStation = false;
@@ -2152,11 +2188,15 @@ namespace CalamityMod.CalPlayer
tortShell = false;
absorber = false;
alwaysHoneyRegen = false;
alwaysHoneyRegenAmount = 0;
honeyTurboRegen = false;
honeyDewHalveDebuffs = false;
livingDewHalveDebuffs = false;
aAmpoule = false;
rOoze = false;
radiantOozeRegen = 0;
ambrosialAmpouleRegen = 0;
purityRegen = 0;
fBarrier = false;
aBrain = false;
amalgam = false;
@@ -2175,6 +2215,8 @@ namespace CalamityMod.CalPlayer
eGauntlet = false;
eGauntletVisuals = true;
gloveLevel = 0;
statisNinjaBelt = false;
statisVoidSash = false;
alreadyHasFrogLeg = false;
eTalisman = false;
nucleogenesis = false;
@@ -2206,14 +2248,10 @@ namespace CalamityMod.CalPlayer
purity = false;
harpyRing = false;
angelTreads = false;
harpyWingBoost = false; //harpy wings + harpy ring
fleshKnuckles = false;
darkSunRing = false;
crawCarapace = false;
baroclaw = false;
gShell = false;
lAmbergris = false;
tortShell = false;
voidOfCalamity = false;
voidOfExtinction = false;
eArtifact = false;
@@ -2221,9 +2259,10 @@ namespace CalamityMod.CalPlayer
auricSArtifact = false;
pSoulArtifact = false;
giantPearl = false;
shieldOfTheOcean = false;
normalityRelocator = false;
flameLickedShell = false;
Pauldron = false;
sPauldron = false;
XykVisualsBlue = false;
XykVisualsOrange = false;
manaOverloader = false;
@@ -2538,7 +2577,6 @@ namespace CalamityMod.CalPlayer
aquaticStar = false;
SP = false;
dCreeper = false;
bClot = false;
eAxe = false;
endoCooper = false;
apexShark = false;
@@ -2597,6 +2635,7 @@ namespace CalamityMod.CalPlayer
powerfulRaven = false;
dragonFamily = false;
providenceStabber = false;
seashineSwordBuff = false;
plaguebringerMK2 = false;
igneousExaltation = false;
GlacialEmbrace = false;
@@ -2783,6 +2822,7 @@ namespace CalamityMod.CalPlayer
#region Buffs, Debuffs, Counters, and Nonsense
heldGaelsLastFrame = false;
gaelSwipes = 0;
whitewaterHeal = 0;
luxorHit = false;
arsenalCooldown = 0;
andromedaState = AndromedaPlayerState.Inactive;
@@ -2803,7 +2843,7 @@ namespace CalamityMod.CalPlayer
spiritOriginCritBoost = 0;
rage = 0f;
adrenaline = 0f;
raiderCritLifespan = 0f;
raiderCritLifespan = 0;
raiderSoundCooldown = 0;
gSabatonHotkeyHoldTime = 0;
gSabatonFall = 0;
@@ -2844,7 +2884,7 @@ namespace CalamityMod.CalPlayer
scuttlerCooldown = 0;
rogueCrownCooldown = 0;
wingProjectileCooldown = 0;
statisTimer = 0;
statisPenaltyTimer = -1;
hallowedRuneCooldown = 0;
sulphurBubbleCooldown = 0;
ladHearts = 0;
@@ -3055,7 +3095,9 @@ namespace CalamityMod.CalPlayer
ChlorophyteHealDelay = 0;
omegaBlueChestplate = false;
omegaBlueSet = false;
molluskSet = false;
molluskHelmet = false;
molluskChest = false;
molluskLegs = false;
fearmongerSet = false;
daedalusReflect = false;
daedalusSplit = false;
@@ -3136,6 +3178,8 @@ namespace CalamityMod.CalPlayer
tracersDust = false;
elysianWingsDust = false;
GemTechState.OnDeathEffects();
shieldOfTheOceanParry = 0;
shieldOfTheOceanEmpoweredParry = false;
blazingCoreParry = 0;
blazingCoreEmpoweredParry = false;
blazingCoreSuccessfulParry = 0;
@@ -3265,7 +3309,7 @@ namespace CalamityMod.CalPlayer
}
//Only increment hotkey holdtime if not on ground, not mounted, not on rope, not hooked, not tongued, otherwise reset hold time to zero
if (CalamityKeybinds.GravistarSabatonHotkey.Current && gSabaton && Main.myPlayer == Player.whoAmI && (Player.velocity.Y != Player.oldVelocity.Y) && !Player.pulley && !Player.mount.Active && Player.grappling[0] == -1 && !Player.tongued)
if (CalamityKeybinds.GravistarSabatonHotkey.Current && gSabaton && Main.myPlayer == Player.whoAmI && (Player.velocity.Y != 0) && !Player.pulley && !Player.mount.Active && Player.grappling[0] == -1 && !Player.tongued)
{
gSabatonHotkeyHoldTime++;
if (gSabatonHotkeyHoldTime < 30 && gSabatonHotkeyHoldTime % 3f == 0)
@@ -3394,20 +3438,97 @@ namespace CalamityMod.CalPlayer
SoundEngine.PlaySound(SoundID.Item34, Player.Center);
}
if (CalamityKeybinds.AmmoCycleHotkey.JustPressed && deadshotBrooch)
{
SoundEngine.PlaySound(SoundID.Item149, Player.Center);
// I could've made this so simple on myself, but no, I felt the need to make things convenient for the users...
// First we need to determine the bounds for what we're swapping.
int ammoType = Player.HeldItem.useAmmo;
int lastSlot, firstSlot;
for (lastSlot = 57; lastSlot >= 54; lastSlot--)
{
if (!Player.inventory[lastSlot].IsAir && Player.inventory[lastSlot].ammo == ammoType)
break;
}
for (firstSlot = 54; firstSlot <= 57; firstSlot++)
{
if (!Player.inventory[firstSlot].IsAir && Player.inventory[firstSlot].ammo == ammoType)
break;
}
// If firstSlot = lastSlot, then there is only one ammo in ammo slots, so don't do anything.
if (firstSlot != lastSlot)
{
int tempType = Player.inventory[lastSlot].type;
int tempStack = Player.inventory[lastSlot].stack;
// This list tracks the favorited status of the ammo slots. Since swapping the slots around fucks with the favorite status it must be manually set.
List<bool> favorited = [];
for (int z = 54; z <= 57; z++)
favorited.Add(!Player.inventory[z].IsAir && Player.inventory[z].favorited);
// It is impossible for lastSlot to equal 54 and firstSlot to not equal 54.
for (int i = lastSlot; i >= 55; i--)
{
if (Player.inventory[i].IsAir || Player.inventory[i].ammo != ammoType)
continue;
// If the slot we're interested in is the lower bound of our ammos, set it to the temp values and don't run anything else.
if (i == firstSlot)
{
Player.inventory[i].SetDefaults(tempType);
Player.inventory[i].stack = tempStack;
Player.inventory[i].favorited = favorited[lastSlot - 54];
continue;
}
// Find the next slot that has ammo in it.
int nextSlot;
for (nextSlot = i - 1; nextSlot >= 54; nextSlot--)
{
if (!Player.inventory[nextSlot].IsAir && Player.inventory[nextSlot].ammo == ammoType)
break;
}
// Set this slot to what is in that slot.
Player.inventory[i].SetDefaults(Player.inventory[nextSlot].type);
Player.inventory[i].stack = Player.inventory[nextSlot].stack;
Player.inventory[i].favorited = favorited[nextSlot - 54];
}
// Handles swapping the ammo that is in the first slot.
if (firstSlot == 54)
{
Player.inventory[54].SetDefaults(tempType);
Player.inventory[54].stack = tempStack;
Player.inventory[54].favorited = favorited[lastSlot - 54];
}
// Produce a visual effect showing the top ammo that you swapped to.
int visualType = Player.inventory[firstSlot].type;
Texture2D ammoTex = TextureAssets.Item[visualType].Value;
int frameAmt = Main.itemAnimations[visualType] == null ? 1 : ammoTex.Height / Main.itemAnimations[visualType].GetFrame(ammoTex).Height;
CustomSprite ammoVisual = new(Player.Center - Vector2.UnitY * 20f, -Vector2.UnitY * 7f, 30, ammoTex, 1f, Color.White, 0f, false, false, frameAmt);
GeneralParticleHandler.SpawnParticle(ammoVisual);
}
}
if (CalamityKeybinds.ArmorSetBonusHotKey.JustPressed)
{
PlayerLoader.ArmorSetBonusActivated(Player);
// Activate vanilla set bonuses
if (Player.setVortex && !Player.mount.Active)
Player.vortexStealthActive = !Player.vortexStealthActive;
if (Player.setForbidden)
if (CalamityClientConfig.Instance.CalamityArmorSetBonusDoubleTap)
{
Player.MinionRestTargetAim();
// Activate vanilla set bonuses
if (Player.setVortex && !Player.mount.Active)
Player.vortexStealthActive = !Player.vortexStealthActive;
if (!Player.setForbiddenCooldownLocked)
Player.CommandForbiddenStorm();
if (Player.setForbidden)
{
Player.MinionRestTargetAim();
if (!Player.setForbiddenCooldownLocked)
Player.CommandForbiddenStorm();
}
}
}
@@ -3447,6 +3568,12 @@ namespace CalamityMod.CalPlayer
flameLickedShellParry = FlameLickedShell.flameLickedParry;
}
}
else if (shieldOfTheOcean && shieldOfTheOceanParry == 0)
{
GeneralScreenShakePower = 2f;
SoundEngine.PlaySound(ShieldoftheOcean.TriggerSound, Player.Center);
shieldOfTheOceanParry = ShieldoftheOcean.ParryTime;
}
}
// Trigger for pressing the God Slayer dash key
@@ -3614,6 +3741,10 @@ namespace CalamityMod.CalPlayer
public override void ArmorSetBonusActivated()
{
// Don't trigger set bonuses if the config is disabled and the double-tap hotkey was triggered
if (!(CalamityKeybinds.ArmorSetBonusHotKey.JustPressed || CalamityClientConfig.Instance.CalamityArmorSetBonusDoubleTap))
return;
// TODO -- It would be nice if triggerable set bonuses used interfaces instead of having to go through this large if chain.
if (brimflameSet && !Player.HasCooldown(BrimflameFrenzy.ID))
{
@@ -3990,7 +4121,7 @@ namespace CalamityMod.CalPlayer
}
// Cancel fall and don't give 'on ground' effects if on rope, on mount, grappled, or tongued
// Also cancel fall if the player has upwards Y velocity (Goodbye Inner Tube cheese)
if (Player.velocity.Y < 0f || Player.pulley || Player.mount.Active || Player.grappling[0] != -1 || Player.tongued)
if ((Player.gravDir == 1 && Player.velocity.Y < 0f) || (Player.gravDir == -1 && Player.velocity.Y > 1f) || Player.pulley || Player.mount.Active || Player.grappling[0] != -1 || Player.tongued)
{
gSabatonFall = 0;
gSabatonFalling = false;
@@ -4009,7 +4140,7 @@ namespace CalamityMod.CalPlayer
Player.controlJump = false;
// Check if player hit some form of solid resistance (the ground)
if (Player.oldVelocity.Y == Player.velocity.Y)
if (0 == Player.velocity.Y)
{
var source = Player.GetSource_Accessory(FindAccessory(ItemType<InterstellarStompers>()));
//Spawn explosion. ai[0] is used for transferring the recorded falling time
@@ -4303,6 +4434,8 @@ namespace CalamityMod.CalPlayer
(getSandCloakAccelBoost ? 0.75f : 0f) +
(nimbleBounderBoost ? NimbleBounder.AccelerationBoost : 0f) +
(ascendantInsignia ? 0.25f : 0f ) + // Added to Soaring Insignia's 1.25x multiplier to get 1.5x
(statisNinjaBelt ? 0.6f : 0f) +
(statisVoidSash ? 0.85f : 0f) +
(blueCandle ? WeightlessCandle.AccelerationBoost : 0f) +
(planarSpeedBoost > 0 ? (0.01f * planarSpeedBoost) : 0f) +
//(exaltedKillMode ? 7f : devilsDevastationKillMode ? 11f : 0) +
@@ -4364,6 +4497,8 @@ namespace CalamityMod.CalPlayer
ModDashMovement();
}
#endregion
Player.oldVelocity = Player.velocity; // Apparently this value is not updated on its own, so we do it
}
#endregion
@@ -5524,6 +5659,9 @@ namespace CalamityMod.CalPlayer
// It also starts the speedrun timer if applicable.
public override void OnEnterWorld()
{
if (CalamityClientConfig.Instance.StutterFix)
WorldGen.SectionTileFrameWithCheck(0, 0, Main.maxTilesX, Main.maxTilesY);
if (Main.netMode == NetmodeID.MultiplayerClient)
EnterWorldSync();
@@ -5538,9 +5676,7 @@ namespace CalamityMod.CalPlayer
// Set a random delay between 12 and 20 seconds. When this delay hits zero, startup messages display
if (showStartupMessages)
{
startMessageDisplayDelay = Main.rand.Next(CalamityUtils.SecondsToFrames(12), CalamityUtils.SecondsToFrames(20) + 1);
}
}
/// <summary>
@@ -5587,7 +5723,7 @@ namespace CalamityMod.CalPlayer
Player.HealEffect(-5);
Player.statLife -= 5;
if (Player.statLife <= 0)
Player.KillMe(PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.ManaConversionEnchant").Format(Player.name)), 1000, -1);
Player.KillMe(PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.ManaConversionEnchant").ToNetworkText(Player.name)), 1000, -1);
}
for (int i = 0; i < 8; i++)
+2
View File
@@ -120,6 +120,8 @@ namespace CalamityMod.CalPlayer
dashDelayToApply = BalancingConstants.UniversalShieldBonkCooldown;
if (DashID == DeepDiverDash.ID)
dashDelayToApply = 23;
if (DashID == StatisNinjaBeltDash.ID || DashID == StatisVoidSashDash.ID || Player.dashType == 1)
dashDelayToApply = BalancingConstants.UniversalSashDashCooldown;
float dashSpeed = 12f;
float dashSpeedDecelerationFactor = 0.985f;
+47 -1
View File
@@ -442,7 +442,7 @@ namespace CalamityMod.CalPlayer
}
#endregion Profaned Moonlight Dye Colors
#region Tanks/Backpacks
#region Vanity Accessories and Tanks/Backpacks
public override void ModifyDrawInfo(ref PlayerDrawSet drawInfo)
{
if (drawInfo.shadow != 0f)
@@ -451,6 +451,52 @@ namespace CalamityMod.CalPlayer
Player drawPlayer = drawInfo.drawPlayer;
Item item = drawPlayer.ActiveItem();
// Vanity accessory effects, allows them to draw while the game is paused
if (drawPlayer.Calamity().ghostBracelet)
{
drawPlayer.legs = EquipLoader.GetEquipSlot(Mod, "GhostBracelet", EquipType.Legs);
drawPlayer.body = EquipLoader.GetEquipSlot(Mod, "GhostBracelet", EquipType.Body);
drawPlayer.head = EquipLoader.GetEquipSlot(Mod, "GhostBracelet", EquipType.Head);
}
else if ((drawPlayer.Calamity().snowmanPower || drawPlayer.Calamity().snowmanForce) && !drawPlayer.Calamity().snowmanHide)
{
drawPlayer.legs = EquipLoader.GetEquipSlot(Mod, "Popo", EquipType.Legs);
drawPlayer.body = EquipLoader.GetEquipSlot(Mod, "Popo", EquipType.Body);
drawPlayer.head = EquipLoader.GetEquipSlot(Mod, snowmanNoseless ? "PopoNoseless" : "Popo", EquipType.Head);
drawPlayer.face = -1;
}
else if (drawPlayer.Calamity().punchCard)
{
drawPlayer.legs = EquipLoader.GetEquipSlot(Mod, "PunchCard", EquipType.Legs);
drawPlayer.body = EquipLoader.GetEquipSlot(Mod, "PunchCard", EquipType.Body);
drawPlayer.head = EquipLoader.GetEquipSlot(Mod, "PunchCard", EquipType.Head);
}
else if ((drawPlayer.Calamity().abyssalDivingSuitPower || drawPlayer.Calamity().abyssalDivingSuitForce) && !drawPlayer.Calamity().abyssalDivingSuitHide)
{
drawPlayer.legs = EquipLoader.GetEquipSlot(Mod, "AbyssalDivingSuit", EquipType.Legs);
drawPlayer.body = EquipLoader.GetEquipSlot(Mod, "AbyssalDivingSuit", EquipType.Body);
drawPlayer.head = EquipLoader.GetEquipSlot(Mod, "AbyssalDivingSuit", EquipType.Head);
drawPlayer.face = -1;
}
else if ((drawPlayer.Calamity().aquaticHeartPower || drawPlayer.Calamity().aquaticHeartForce) && !drawPlayer.Calamity().aquaticHeartHide)
{
drawPlayer.legs = EquipLoader.GetEquipSlot(Mod, "AquaticHeart", EquipType.Legs);
drawPlayer.body = EquipLoader.GetEquipSlot(Mod, "AquaticHeart", EquipType.Body);
drawPlayer.head = EquipLoader.GetEquipSlot(Mod, "AquaticHeart", EquipType.Head);
drawPlayer.face = -1;
}
// Need to set all of these so that certain vanity pieces like Capricorn Tail don't screw it up
if (drawPlayer.Calamity().ghostBracelet || ((drawPlayer.Calamity().snowmanPower || drawPlayer.Calamity().snowmanForce) && !drawPlayer.Calamity().snowmanHide) ||
drawPlayer.Calamity().punchCard || ((drawPlayer.Calamity().abyssalDivingSuitPower || drawPlayer.Calamity().abyssalDivingSuitForce) && !drawPlayer.Calamity().abyssalDivingSuitHide) ||
((drawPlayer.Calamity().aquaticHeartPower || drawPlayer.Calamity().aquaticHeartForce) && !drawPlayer.Calamity().aquaticHeartHide))
{
drawInfo.legsGlowMask = -1;
drawInfo.legsOffset = Vector2.Zero;
drawInfo.bodyGlowMask = -1;
drawInfo.headGlowMask = -1;
drawInfo.helmetOffset = Vector2.Zero;
}
if (!drawPlayer.frozen &&
(item.IsAir || item.type > ItemID.None) &&
!drawPlayer.dead &&
+73 -38
View File
@@ -352,7 +352,7 @@ namespace CalamityMod.CalPlayer
{
if (alcoholPoisoning)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.AlcoholBig" + Main.rand.Next(1, 2 + 1)).Format(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.AlcoholBig" + Main.rand.Next(1, 2 + 1)).ToNetworkText(Player.name));
}
if (vHex)
{
@@ -372,123 +372,123 @@ namespace CalamityMod.CalPlayer
// if none of SCal's phases are detected somehow then it just uses the normal messages all the time
}
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText(vHexKeyToUse).Format(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText(vHexKeyToUse).ToNetworkText(Player.name));
}
if (ZoneCalamity && Player.lavaWet)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.SearingLava" + Main.rand.Next(1, 2 + 1)).Format(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.SearingLava" + Main.rand.Next(1, 2 + 1)).ToNetworkText(Player.name));
}
if (gsInferno)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.GodSlayerInferno" + Main.rand.Next(1, 3 + 1)).Format(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.GodSlayerInferno" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
}
if (sulphurPoison)
{
if (!Main.rand.NextBool(4)) // 75% custom
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.SulphuricPoisoning" + Main.rand.Next(1, 3 + 1)).Format(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.SulphuricPoisoning" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
else
damageSource = PlayerDeathReason.ByOther(9); // 25% generic Poisoned death text
}
if (dragonFire)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Dragonfire" + Main.rand.Next(1, 4 + 1)).Format(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Dragonfire" + Main.rand.Next(1, 4 + 1)).ToNetworkText(Player.name));
}
if (vermillionFlux)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.VermillionFlux" + Main.rand.Next(1, 3 + 1)).Format(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.VermillionFlux" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
}
if (auricRebuke)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.AuricRebuke" + Main.rand.Next(1, 3 + 1)).Format(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.AuricRebuke" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
}
if (staticDischarge)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.StaticDischarge" + Main.rand.Next(1, 3 + 1)).Format(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.StaticDischarge" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
}
if (miracleBlight)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.MiracleBlight" + Main.rand.Next(1, 3 + 1)).Format(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.MiracleBlight" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
}
if (hInferno)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.HolyInferno").Format(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.HolyInferno").ToNetworkText(Player.name));
}
if (hFlames || banishingFire)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.HolyFlames" + Main.rand.Next(1, 3 + 1)).Format(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.HolyFlames" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
}
if (shadowflame)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Shadowflame").Format(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Shadowflame").ToNetworkText(Player.name));
}
if (daybroken)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Daybroken").Format(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Daybroken").ToNetworkText(Player.name));
}
if (bBlood)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.BurningBlood" + Main.rand.Next(1, 2 + 1)).Format(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.BurningBlood" + Main.rand.Next(1, 2 + 1)).ToNetworkText(Player.name));
}
if (brainRot)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.BrainRot" + Main.rand.Next(1, 3 + 1)).Format(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.BrainRot" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
}
if (heavybleeding)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.HeavyBleeding" + Main.rand.Next(1, 3 + 1)).Format(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.HeavyBleeding" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
}
if (laceration)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Laceration" + Main.rand.Next(1, 3 + 1)).Format(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Laceration" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
}
if (elementalMix)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.ElementalMix" + Main.rand.Next(1, 2 + 1)).Format(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.ElementalMix" + Main.rand.Next(1, 2 + 1)).ToNetworkText(Player.name));
}
if (cDepth)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.CrushDepth" + Main.rand.Next(1, 3 + 1)).Format(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.CrushDepth" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
}
if (rTide)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Riptide" + Main.rand.Next(1, 2 + 1)).Format(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Riptide" + Main.rand.Next(1, 2 + 1)).ToNetworkText(Player.name));
}
if (hPressure)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.HadopelagicPressure" + Main.rand.Next(1, 3 + 1)).Format(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.HadopelagicPressure" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
}
if (bFlames || weakBrimstoneFlames || demonicFlames)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.BrimstoneFlames" + Main.rand.Next(1, 3 + 1)).Format(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.BrimstoneFlames" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
}
if (pFlames)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Plague" + Main.rand.Next(1, 3 + 1)).Format(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Plague" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
}
if (astralInfection)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.AstralInfection" + Main.rand.Next(1, 3 + 1)).Format(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.AstralInfection" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
}
if (nightwither)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Nightwither").Format(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Nightwither").ToNetworkText(Player.name));
}
if (vaporfied)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Vaporfied").Format(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Vaporfied").ToNetworkText(Player.name));
}
if (manaOverloader || ManaBurn)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.ManaBurn").Format(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.ManaBurn").ToNetworkText(Player.name));
}
if (witheredDebuff)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Withered").Format(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Withered").ToNetworkText(Player.name));
}
}
if (profanedCrystalBuffs && !profanedCrystalHide)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.ProfanedSoulCrystal").Format(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.ProfanedSoulCrystal").ToNetworkText(Player.name));
}
// Leon Death Noise RE4
@@ -496,7 +496,7 @@ namespace CalamityMod.CalPlayer
SoundEngine.PlaySound(LeonDeathNoiseRE4_ForGFB, Player.Center);
if (NorfleetCounter > 3 && NorfleetCounter < 1000)
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Norfleet").Format(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Norfleet").ToNetworkText(Player.name));
NorfleetCounter = 0;
if (NPC.AnyNPCs(ModContent.NPCType<SupremeCalamitas>()))
@@ -812,7 +812,7 @@ namespace CalamityMod.CalPlayer
}
if (trinketOfChiBuff)
contactDamageReduction += 0.04;
contactDamageReduction += 0.08;
// Fearmonger set provides 15% multiplicative DR that ignores caps during the Holiday Moons.
// To prevent abuse, this effect does not work if there are any bosses alive.
@@ -938,7 +938,7 @@ namespace CalamityMod.CalPlayer
Player.GiveUniversalIFrames(evolutionIFrames, true);
modifiers.Cancel();
evolutionLifeRegenCounter = 300;
evolutionLifeRegenCounter = 600;
projTypeJustHitBy = proj.type;
int cooldownDuration = (int)MathHelper.Lerp(BalancingConstants.EvolutionReflectCooldownMin, BalancingConstants.EvolutionReflectCooldownMax, cooldownDurationScalar);
@@ -993,7 +993,7 @@ namespace CalamityMod.CalPlayer
modifiers.SourceDamage *= 0.65f;
// 80 in normal, 100 in expert, 150 in master
else if (proj.type == ProjectileID.SpikyBallTrap || proj.type == ProjectileID.FlamethrowerTrap || proj.type == ProjectileID.PoisonDartTrap)
else if (proj.type == ProjectileID.SpikyBallTrap || proj.type == ProjectileID.FlamethrowerTrap || proj.type == ProjectileID.FlamesTrap || proj.type == ProjectileID.PoisonDartTrap)
modifiers.SourceDamage *= 0.625f;
// 120 in normal, 144 in expert, 216 in master
@@ -1001,6 +1001,20 @@ namespace CalamityMod.CalPlayer
modifiers.SourceDamage *= 0.6f;
}
bool isFallingBlock = (proj.type == ProjectileID.SandBallFalling) || (proj.type == ProjectileID.SiltBall) || (proj.type == ProjectileID.AshBallFalling) ||
(proj.type == ProjectileID.CrimsandBallFalling) || (proj.type == ProjectileID.EbonsandBallFalling) || (proj.type == ProjectileID.PearlSandBallFalling) ||
(proj.type == ProjectileID.ShellPileFalling) || (proj.type == ProjectileID.SlushBall) || (proj.type == ModContent.ProjectileType<AstralSandBallFalling>());
if (Player.Calamity().fallingBlockProtection && isFallingBlock)
modifiers.Cancel();
bool isIgnoredTrap = (proj.type == ProjectileID.PoisonDartTrap) || (proj.type == ProjectileID.VenomDartTrap) || (proj.type == ProjectileID.PoisonDart);
if (Player.Calamity().trapProtection && isIgnoredTrap)
modifiers.Cancel();
bool isReducedTrap = (proj.trap || proj.type == ProjectileID.RollingCactusSpike || proj.type == ProjectileID.Landmine) && !isIgnoredTrap;
if (Player.Calamity().trapProtection && isReducedTrap)
modifiers.SourceDamage *= 0.35f;
// Reduce damage dealt by rainbow trails depending on how faded they are.
if (proj.type == ProjectileID.HallowBossLastingRainbow)
{
@@ -1036,7 +1050,7 @@ namespace CalamityMod.CalPlayer
if (evolution)
{
if (proj.type == projTypeJustHitBy)
projectileDamageReduction += 0.2;
projectileDamageReduction += 0.25;
}
if (!ProjectileDestroyExceptionsList.Includes(proj.type) && proj.active && !proj.friendly && proj.hostile && proj.damage > 0)
@@ -1047,7 +1061,7 @@ namespace CalamityMod.CalPlayer
}
if (trinketOfChiBuff)
projectileDamageReduction += 0.04;
projectileDamageReduction += 0.08;
// Fearmonger set provides 15% multiplicative DR that ignores caps during the Holiday Moons.
// To prevent abuse, this effect does not work if there are any bosses alive.
@@ -1361,6 +1375,10 @@ namespace CalamityMod.CalPlayer
// Guaranteed Cursed Inferno for 1 second (vanilla also has a 68.75% chance of Cursed Inferno for 2 to 3 seconds)
Player.AddBuff(BuffID.CursedInferno, 60);
}
else if (proj.type == ProjectileID.DesertDjinnCurse)
{
Player.AddBuff(BuffID.Cursed, 180);
}
else if (proj.type == ProjectileID.Stinger || proj.type == ProjectileID.QueenBeeStinger)
{
// 66.6% chance of Poison for 3 seconds, 1 guaranteed second of Poison otherwise (vanilla also has a 33.3% chance of Poison for 10 seconds)
@@ -1875,6 +1893,23 @@ namespace CalamityMod.CalPlayer
FlameLickedShell.handleParry(Player);
}
}
else if (shieldOfTheOceanParry >= 12)
{
if (!Player.HasCooldown(ParryCooldown.ID))
{
// Shield of the Ocean is a parry. It uses vanilla parry iframes and benefits from Cross Necklace.
int shieldParryIFrames = Player.ComputeParryIFrames();
Player.GiveUniversalIFrames(shieldParryIFrames, true);
shieldOfTheOceanEmpoweredParry = true;
modifiers.FinalDamage *= 0.4f; // 60% DR
modifiers.DisableSound();
}
SoundEngine.PlaySound(Main.zenithWorld ? ShieldoftheOcean.ParrySoundGFB : ShieldoftheOcean.ParrySound, Player.Center);
Player.AddCooldown(ParryCooldown.ID, 1200, false, "shieldoftheocean");
ShieldoftheOcean.ActivateParry(Player);
}
}
private void ModifyHurtInfo_Calamity(ref Player.HurtInfo info)
@@ -2874,11 +2909,11 @@ namespace CalamityMod.CalPlayer
if (abyssDeath)
{
SoundEngine.PlaySound(DrownSound, Player.Center);
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.AbyssDrown" + Main.rand.Next(1, 3 + 1)).Format(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.AbyssDrown" + Main.rand.Next(1, 3 + 1)).ToNetworkText(Player.name));
}
else if (CalamityWorld.armageddon && areThereAnyDamnBosses)
{
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Armageddon").Format(Player.name));
damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Armageddon").ToNetworkText(Player.name));
}
NetworkText deathText = damageSource.GetDeathText(Player.name);
+17 -10
View File
@@ -178,7 +178,7 @@ namespace CalamityMod.CalPlayer
if (SulphWaterPoisoningLevel >= 1f)
{
SulphWaterPoisoningLevel = 0f;
Player.Hurt(PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.SulphurMeter").Format(Player.name)), Math.Min(Player.statLifeMax2 / 4, 150), 0);
Player.Hurt(PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.SulphurMeter").ToNetworkText(Player.name)), Math.Min(Player.statLifeMax2 / 4, 150), 0);
}
}
else
@@ -310,6 +310,7 @@ namespace CalamityMod.CalPlayer
// Exact copy of vanilla Honey behavior, but does not stack with actually standing in Honey
if (!Player.honey)
{
alwaysHoneyRegenAmount += 1;
Player.lifeRegen += 2;
Player.lifeRegenTime += 1;
@@ -317,6 +318,7 @@ namespace CalamityMod.CalPlayer
// However, this can't bring regen into the positives.
if (Player.lifeRegen < 0)
{
alwaysHoneyRegenAmount += Math.Min(1f, 0 - Player.lifeRegen/2f);
Player.lifeRegen += 2;
if (Player.lifeRegen > 0)
Player.lifeRegen = 0;
@@ -392,10 +394,13 @@ namespace CalamityMod.CalPlayer
// 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;
float missingLifeRatio = (Player.statLifeMax2 - Player.statLife) / (float)Player.statLifeMax2;
//Ambrosial Ampule and ooze give between 2 and 6 hp/s
float lifeRegenToGive = MathHelper.Lerp(4f, 12f, missingLifeRatio);
Player.lifeRegen += (int)lifeRegenToGive;
int lifeRegenToGive = (int)Math.Round(MathHelper.Lerp((purity || aAmpoule? 2f : 4f), (purity || aAmpoule ? 8f : 12f), missingLifeRatio));//Rounding is needed for it to ever actually give +6 hp/s, as the integer conversion would otherwise floor it.
Player.lifeRegen += lifeRegenToGive;
radiantOozeRegen += lifeRegenToGive / 2f;
ambrosialAmpouleRegen += lifeRegenToGive / 2f;
purityRegen += lifeRegenToGive / 2f;
}
if (purity)
@@ -409,10 +414,10 @@ namespace CalamityMod.CalPlayer
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
// The upper limit to how slow it can get is after 15 seconds (900 frames)
int punishmentFrames = PurityHealSlowdownFrames - 300;
//lowest punishment is three full seconds between the one health heal
if (healFrameCadence < 180)
//lowest punishment is a little under a second between the one health heal
if (healFrameCadence < 52)
healFrameCadence += (punishmentFrames < 0) ? 0 : punishmentFrames / 15;
if (Player.miscCounter % healFrameCadence == healFrameCadence - 1)
@@ -426,7 +431,9 @@ namespace CalamityMod.CalPlayer
jewelBonusDefense = intendedPurityDefense;
// Count up total frames spent healing for slowdown.
++PurityHealSlowdownFrames;
if (PurityHealSlowdownFrames < 900)
++PurityHealSlowdownFrames;
purityRegen += (60 / (float)healFrameCadence);
}
// If the defense should be ticking down to some lower value, do that.
@@ -610,10 +617,8 @@ namespace CalamityMod.CalPlayer
if (trinketOfChi || chiRegen)
Player.lifeRegen += 2;
// Remember this is for 5 seconds after triggering a reflect with a long cooldown
if (evolutionLifeRegenCounter > 0)
{
Player.lifeRegen += 12;
if (Player.lifeRegenTime < 3600f)
Player.lifeRegenTime = 3600f;
}
@@ -770,6 +775,8 @@ namespace CalamityMod.CalPlayer
Player.lifeRegen += turboRegenPower;
Player.lifeRegenTime += turboRegenPower;
purityRegen += turboRegenPower/2f;
if (!shadeRegen || cFreeze || purity) ambrosialAmpouleRegen += turboRegenPower/2f;
}
}
+153 -94
View File
@@ -203,6 +203,16 @@ namespace CalamityMod.CalPlayer
rage = 0f;
}
if (furyFuel < furyFuelMax && furyRefuelTimer >= 0)
{
furyFuel += (int)furyRefuelTimer;
furyRefuelTimer = MathHelper.Lerp(furyRefuelTimer, 25, 0.01f);
if (furyFuel > furyFuelMax)
furyFuel = furyFuelMax;
}
else if (furyRefuelTimer < 0)
furyRefuelTimer++;
// De-equipping Draedon's Heart deletes all Adrenaline.
if (!draedonsHeart && hadNanomachinesLastFrame)
{
@@ -227,6 +237,17 @@ namespace CalamityMod.CalPlayer
Player.velocity.X *= 0.9f;
}
// Tabi/Master Ninja Gear dash change
if (Player.dashType == 1)
{
if (dashStart)
Player.velocity.X *= 3.5f;
if (Player.dashDelay == -1)
{
Player.velocity.X *= 0.9f;
}
}
if ((devilsDevastationKillMode || exaltedKillMode) && !Player.mount.Active)
{
float fxScale = 1;
@@ -296,49 +317,19 @@ namespace CalamityMod.CalPlayer
{
if (dashStart)
{
Player.velocity.X *= 1.2f;
Player.velocity.X *= 2.2f; // +120% dash speed
int damage = (int)Player.GetBestClassDamage().ApplyTo(LeviathanAmbergris.ambergrisDashDamage);
Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center + Player.velocity * 1.5f, Vector2.Zero, ModContent.ProjectileType<LeviAmberDash>(), damage, 0f, Player.whoAmI);
Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ModContent.ProjectileType<LeviAmberDash>(), damage, 0f, Player.whoAmI);
}
if (Player.miscCounter % 3 == 2 && Player.dashDelay > 0) // Reduced dash cooldown by 33%
Player.dashDelay--;
if (Player.dashDelay == -1)// TODO: prevent working with special dashes, this was inconsitent with my old solution so I didn't keep it. not huge deal)
{
float numberOfDusts = 10f;
float rotFactor = 180f / numberOfDusts;
for (int i = 0; i < numberOfDusts; i++)
{
float rot = MathHelper.ToRadians(i * rotFactor);
Vector2 offset = new Vector2(Player.velocity.X * dir * 0.7f + 6f, 0).RotatedBy(rot * Main.rand.NextFloat(4f, 5f));
Vector2 velOffset = Vector2.Zero;
Dust dust = Dust.NewDustPerfect(Player.Center + offset + Player.velocity, Main.rand.NextBool() ? 160 : 307, new Vector2(velOffset.X, velOffset.Y));
dust.noGravity = true;
dust.velocity = velOffset;
dust.alpha = 100;
dust.scale = (Player.velocity.X * dir * 0.08f);
}
if (Player.miscCounter % 4 == 0)
{
float sparkscale = (Player.velocity.X * dir * 0.07f);
Vector2 SparkVelocity1 = Player.velocity.RotatedBy(dir * 2, default) * 0.1f - Player.velocity / 2f;
LineParticle spark = new LineParticle(Player.Center + Player.velocity.RotatedBy(2f * dir) * 1.5f, SparkVelocity1, false, Main.rand.Next(11, 13), sparkscale, Main.rand.NextBool() ? Color.DarkTurquoise : Color.DodgerBlue);
GeneralParticleHandler.SpawnParticle(spark);
Vector2 SparkVelocity2 = Player.velocity.RotatedBy(dir * -2, default) * 0.1f - Player.velocity / 2f;
LineParticle spark2 = new LineParticle(Player.Center + Player.velocity.RotatedBy(-2f * dir) * 1.5f, SparkVelocity2, false, Main.rand.Next(11, 13), sparkscale, Main.rand.NextBool() ? Color.DarkTurquoise : Color.DodgerBlue);
GeneralParticleHandler.SpawnParticle(spark2);
}
if (Player.miscCounter % 4 == 0 && Player.velocity != Vector2.Zero) //every other frame spawn the hitbox
{
int damage = (int)Player.GetBestClassDamage().ApplyTo(LeviathanAmbergris.ambergrisDashDamage);
Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center + Player.velocity * 1.5f, Vector2.Zero, ModContent.ProjectileType<LeviAmberDash>(), damage, 0f, Player.whoAmI);
}
}
if (Player.dashDelay == -1)
Player.velocity.X *= 0.9f;
}
if (Pauldron)
if (sPauldron)
{
if (dashStart)
{
@@ -346,37 +337,9 @@ namespace CalamityMod.CalPlayer
int damage = (int)Player.GetBestClassDamage().ApplyTo(SlagsplitterPauldron.PauldronSlamDamage);
Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center + Player.velocity * 1.5f, Vector2.Zero, ModContent.ProjectileType<PauldronDash>(), damage, 0, Player.whoAmI);
}
if (Player.dashDelay == -1)// TODO: prevent working with special dashes, this was inconsitent with my old solution so I didn't keep it. not huge deal)
{
int damage = (int)Player.GetBestClassDamage().ApplyTo(SlagsplitterPauldron.PauldronSlamDamage);
if (Player.dashDelay == -1)
Player.endurance += 0.1f;
float numberOfDusts = 10f;
float rotFactor = 180f / numberOfDusts;
for (int i = 0; i < numberOfDusts; i++)
{
float rot = MathHelper.ToRadians(i * rotFactor);
Vector2 offset = new Vector2(MathF.Min(Player.velocity.X * dir * 0.7f + 8f, 20f), 0).RotatedBy(rot * Main.rand.NextFloat(4f, 5f));
Vector2 velOffset = Vector2.Zero;
Dust dust = Dust.NewDustPerfect(Player.Center + offset + Player.velocity, Main.rand.NextBool() ? 35 : 127, new Vector2(velOffset.X, velOffset.Y));
dust.noGravity = true;
dust.velocity = velOffset;
dust.alpha = 100;
dust.scale = MathF.Min(Player.velocity.X * dir * 0.08f, 1.2f);
}
float sparkscale = MathF.Min(Player.velocity.X * dir * 0.08f, 1.2f);
Vector2 SparkVelocity1 = Player.velocity.RotatedBy(dir * -3, default) * 0.1f - Player.velocity / 2f;
SparkParticle spark = new SparkParticle(Player.Center + Player.velocity.RotatedBy(2f * dir) * 1.5f, SparkVelocity1, false, Main.rand.Next(11, 13), sparkscale, Main.rand.NextBool() ? Color.DarkOrange : Color.OrangeRed);
GeneralParticleHandler.SpawnParticle(spark);
Vector2 SparkVelocity2 = Player.velocity.RotatedBy(dir * 3, default) * 0.1f - Player.velocity / 2f;
SparkParticle spark2 = new SparkParticle(Player.Center + Player.velocity.RotatedBy(-2f * dir) * 1.5f, SparkVelocity2, false, Main.rand.Next(11, 13), sparkscale, Main.rand.NextBool() ? Color.DarkOrange : Color.OrangeRed);
GeneralParticleHandler.SpawnParticle(spark2);
if (Player.miscCounter % 6 == 0 && Player.velocity != Vector2.Zero)
{
Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center + Player.velocity * 1.5f, Vector2.Zero, ModContent.ProjectileType<PauldronDash>(), SlagsplitterPauldron.PauldronSlamDamage, 0, Player.whoAmI);
}
}
}
if (XykVisualsBlue || XykVisualsOrange)
@@ -467,12 +430,6 @@ namespace CalamityMod.CalPlayer
}
}
// Solar Wings increase dash velocity of Solar Flare armor dash
if (Player.wingsLogic == (int)VanillaWingID.WingsSolar && Player.dash == 3 && dashStart)
{
Player.velocity.X *= 1.25f;
}
if (Player.dashDelay == -1)
IsFirstDashFrame = false;
else
@@ -538,13 +495,17 @@ namespace CalamityMod.CalPlayer
{
float rageGen = 0f;
// Shattered Community provides constant rage generation (stronger than Heart of Darkness).
// Shattered Community provides constant rage generation and overrides the value from Heart of Darkness.
if (shatteredCommunity)
{
float scRageGen = rageMax * ShatteredCommunity.RagePerSecond / 60f;
if (rageGen < scRageGen)
rageGen = scRageGen;
}
// 26MAR2025: Ozzatron: Shattered Community and Heart of Darkness have equal rage generation now.
// It's easier to not change the code here to unify the cases, because there is no reason to.
//
// Heart of Darkness grants constant rage generation.
else if (heartOfDarkness)
{
@@ -820,7 +781,7 @@ namespace CalamityMod.CalPlayer
Player.velocity += yeetVec * auricRejectionKB;
if (tile.TileType == auricOreID)
{
Player.Hurt(PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.AuricRejection").Format(Player.name)), auricRejectionDamage, 0);
Player.Hurt(PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.AuricRejection").ToNetworkText(Player.name)), auricRejectionDamage, 0);
Player.AddBuff(ModContent.BuffType<AuricRebuke>(), 120);
}
SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/ExoMechs/TeslaShoot1"), Player.Center);
@@ -1276,9 +1237,6 @@ namespace CalamityMod.CalPlayer
// Increase fall speed
if (!Player.mount.Active)
{
if (Player.IsUnderwater() && ironBoots)
Player.maxFallSpeed = 9f;
if (!Player.wet)
{
if (cirrusDress)
@@ -1289,6 +1247,15 @@ namespace CalamityMod.CalPlayer
Player.maxFallSpeed = 20f;
}
if (Player.controlDown && ironBoots)
{
Player.maxFallSpeed = 23f; // This is slightly faster than slimy saddle (so it can be viable)
if (Player.gravDir == 1 ? Player.velocity.Y <= 0 : Player.velocity.Y >= 0)
Player.velocity.Y *= 0.7f;
else if (Player.gravDir == 1 ? Player.velocity.Y < Player.maxFallSpeed : Player.velocity.Y > Player.maxFallSpeed)
Player.velocity.Y = MathHelper.Lerp(Player.velocity.Y, Player.maxFallSpeed, 0.1f);
}
if (LungingDown)
{
Player.maxFallSpeed = 80f;
@@ -1307,7 +1274,7 @@ namespace CalamityMod.CalPlayer
if (holdingDown && Player.ControlsEnabled() && notInLiquid && notOnRope && notGrappling && airborne && !Player.Calamity().gSabatonFalling) //Player cannot further increase their ridiculous gravity during a Gravistar Slam
{
Player.velocity.Y += Player.gravity * Player.gravDir * (BalancingConstants.HoldingDownGravityMultiplier - 1f);
if (Player.Calamity().gSabaton)
if (Player.Calamity().gSabaton && !Player.gravControl2)
{
Player.maxFallSpeed *= 1.5f;
}
@@ -1409,7 +1376,7 @@ namespace CalamityMod.CalPlayer
{
if (!tentaclesPresent[i])
{
int damage = (int)Player.GetBestClassDamage().ApplyTo(390);
int damage = (int)Player.GetBestClassDamage().ApplyTo(350);
var source = Player.GetSource_FromThis(OmegaBlueHelmet.TentacleEntitySourceContext);
Vector2 vel = new Vector2(Main.rand.Next(-13, 14), Main.rand.Next(-13, 14)) * 0.25f;
@@ -1420,10 +1387,10 @@ namespace CalamityMod.CalPlayer
float damageUp = 0.1f;
int critUp = 10;
if (omegaBlueHentai)
if (omegaBlueAbyssalMadness)
{
damageUp *= 2f;
critUp *= 2;
damageUp += 0.1f;
critUp += 10;
}
Player.GetDamage<GenericDamageClass>() += damageUp;
Player.GetCritChance<GenericDamageClass>() += critUp;
@@ -1732,6 +1699,49 @@ namespace CalamityMod.CalPlayer
}
}
if (ironBoots)
{
if (Player.controlDown)
{
if (Player.gravDir == 1 ? Player.velocity.Y > 0 : Player.velocity.Y < 0)
fallingBootVelCheckTimer++;
if (Player.velocity.Y == 0 && fallingBootVelCheckTimer > 10)
{
float power = Utils.Remap(fallingBootVelCheckTimer, 10, 40, 0.1f, 1);
float scaledPower = (float)Math.Pow(power, 3);
int damage = (int)Player.GetBestClassDamage().ApplyTo(1500 * scaledPower); // Damage scales down thrice
Vector2 playerFeet = Player.Center + Vector2.UnitY * 26 * Player.gravDir;
float blastSize = 120 * power;
float minMultiplier = 0.1f;
int hitsToMinMult = 6;
int debuff = ModContent.BuffType<ArmorCrunch>();
int debuffTime = (int)(300 * power);
Projectile blast = Projectile.NewProjectileDirect(Player.GetSource_FromThis(), playerFeet, Vector2.Zero, ModContent.ProjectileType<BasicBurst>(), (int)(damage), -25 * power, Player.whoAmI, blastSize, minMultiplier, hitsToMinMult);
blast.localAI[0] = debuff;
blast.localAI[1] = debuffTime;
blast.timeLeft = 5;
int particleNumber = (int)Math.Max(15 * power, 2);
for (int i = -particleNumber; i <= particleNumber; i++)
{
Particle sparks = new AltSparkParticle(playerFeet, (Vector2.UnitX * (5 + Math.Abs(i)) * Math.Sign(i)).RotatedByRandom(0.25f) * Main.rand.NextFloat(0.5f, 1) * power, false, Main.rand.Next(17, 30 + 1), Main.rand.NextFloat(0.2f, 0.8f), Main.rand.NextBool() ? Color.Lerp(Color.Gold, Color.Silver, 0.3f) : Color.Silver);
GeneralParticleHandler.SpawnParticle(sparks);
}
SoundStyle sound = new("CalamityMod/Sounds/NPCHit/ExoHit3");
SoundEngine.PlaySound(sound with { Volume = 0.6f * power, Pitch = Main.rand.NextFloat(0.6f, 0.8f) }, playerFeet);
Player.Calamity().GeneralScreenShakePower = 4 * scaledPower;
fallingBootVelCheckTimer = 0;
}
}
if (Player.gravDir == 1 ? Player.velocity.Y <= 0 : Player.velocity.Y >= 0)
fallingBootVelCheckTimer = 0;
}
if (unstableGraniteCore)
{
zapActivity += 1;
@@ -1794,6 +1804,25 @@ namespace CalamityMod.CalPlayer
}
}
if (whitewaterHeal > 0)
{
if (whitewaterHeal % 15 == 0)
Player.HealPlayer(1);
whitewaterHeal--;
Vector2 vel = (MathHelper.TwoPi * whitewaterHeal * Player.direction / 25).ToRotationVector2() * 3f;
for (int i = -1; i <= 1; i += 2)
{
Dust c = Dust.NewDustPerfect(Player.Center + vel * 4 * i, ModContent.DustType<LightDust>());
c.velocity = vel * i;
c.scale = Main.rand.NextFloat(0.9f, 1f);
c.noGravity = true;
c.alpha = 150;
c.color = Color.SkyBlue;
c.noLightEmittence = true;
}
}
// Tick all cooldowns.
// Depending on the code for each individual cooldown, this isn't guaranteed to do anything.
// It may not tick down the timer or not do anything at all.
@@ -1848,6 +1877,8 @@ namespace CalamityMod.CalPlayer
if (arsenalCooldown > 0)
arsenalCooldown--;
if (Main.zenithWorld)
arsenalCooldown = 0;
if (killModeCooldown > 0)
killModeCooldown--;
if (ascendantInsigniaCooldown > 0 && ascendantInsigniaBuffTime <= 0)
@@ -1876,6 +1907,8 @@ namespace CalamityMod.CalPlayer
KameiBladeUseDelay--;
if (galileoCooldown > 0)
galileoCooldown--;
if (gladiatorTimer > 0)
gladiatorTimer--;
if (dragonRageCooldown > 0)
dragonRageCooldown--;
if (soundCooldown > 0)
@@ -1937,11 +1970,16 @@ namespace CalamityMod.CalPlayer
if (vortexBoosterStealthDelay > 0)
{
vortexBoosterStealthDelay--;
if (vortexBoosterStealthDelay == 1)
if (vortexBoosterStealthDelay == 1 && Player.setVortex)
Player.vortexStealthActive = true;
}
if (statisTimer > 0 && Player.dashDelay >= 0)
statisTimer = 0;
if (statisPenaltyTimer > 0)
statisPenaltyTimer--;
if (statisPenaltyTimer == 0 && statisAnticheese > 0)
{
statisAnticheese--;
statisPenaltyTimer = statisTimerMax;
}
if (hallowedRuneCooldown > 0)
hallowedRuneCooldown--;
if (sulphurBubbleCooldown > 0)
@@ -2022,9 +2060,21 @@ namespace CalamityMod.CalPlayer
else if (blazingCoreParry > 0)
BlazingCore.HandleParryCountdown(Player);
}
else if (flameLickedShell && flameLickedShellParry > 0)
else if (blazingCoreParry > 0)
blazingCoreParry--;
else if (flameLickedShellParry > 0)
{
FlameLickedShell.HandleParryCountdown(Player);
if (flameLickedShell)
FlameLickedShell.HandleParryCountdown(Player);
else
flameLickedShellParry--;
}
if (shieldOfTheOceanParry > 0)
{
if (shieldOfTheOcean)
ShieldoftheOcean.HandleParryCountdown(Player);
else
shieldOfTheOceanParry--;
}
if (!flameLickedShell && flameLickedShellParry > 0)
@@ -2082,8 +2132,8 @@ namespace CalamityMod.CalPlayer
miningSetCooldown--;
if (RustyMedallionCooldown > 0)
RustyMedallionCooldown--;
if (MiniSwamerCooldown > 0)
MiniSwamerCooldown--;
if (MiniSwarmerCooldown > 0)
MiniSwarmerCooldown--;
// God Slayer Armor dash debuff immunity
if (DashID == GodSlayerDash.ID && Player.dashDelay < 0)
@@ -2149,7 +2199,7 @@ namespace CalamityMod.CalPlayer
if (necroReviveCounter >= NecroArmorSetChange.PostMortemDuration * 60)
{
Player.KillMe(PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.NecroRevive").Format(Player.name)), 1000, -1);
Player.KillMe(PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.NecroRevive").ToNetworkText(Player.name)), 1000, -1);
necroReviveCounter = -1;
}
else if (necroReviveCounter % 60 == 59)
@@ -2291,8 +2341,10 @@ namespace CalamityMod.CalPlayer
}
// Raider Talisman bonus
if (raiderTalisman && !StealthStrikeAvailable() && raiderCritLifespan > 0f)
if (raiderTalisman && !vampiricTalisman && !StealthStrikeAvailable() && raiderCritLifespan > 0f)
Player.GetCritChance<ThrowingDamageClass>() += RaidersTalisman.RaiderBonus;
if (vampiricTalisman && !StealthStrikeAvailable() && raiderCritLifespan > 0f)
Player.GetCritChance<ThrowingDamageClass>() += VampiricTalisman.RaiderBonus;
if (kamiBoost)
Player.GetDamage<GenericDamageClass>() += YanmeisKnife.DamageBoost;
@@ -3552,8 +3604,12 @@ namespace CalamityMod.CalPlayer
if ((vaporfied && !purity) || galvanicCorrosion)
Player.velocity *= 0.98f;
if (molluskSet)
Player.velocity.X *= 0.985f;
if (molluskHelmet)
Player.velocity.X *= 0.995f;
if (molluskChest)
Player.velocity.X *= 0.995f;
if (molluskLegs)
Player.velocity.X *= 0.995f;
if ((warped || caribbeanRum) && !Player.slowFall && !Player.mount.Active)
{
@@ -3621,8 +3677,7 @@ namespace CalamityMod.CalPlayer
if (vexation)
{
if (Player.statLife <= (int)(Player.statLifeMax2 * 0.5))
Player.GetDamage<GenericDamageClass>() += 0.2f;
Player.GetDamage<GenericDamageClass>() += 0.3f* (1 - Player.statLife / (float)Player.statLifeMax2);
}
if (ataxiaBlaze)
@@ -4169,6 +4224,10 @@ namespace CalamityMod.CalPlayer
Player.GetCritChance<MeleeDamageClass>() += 10;
}
if (Player.portableStoolInfo.IsInUse)
Player.GetCritChance(DamageClass.Generic) += 5;
// Amalgam boosts
if (Main.myPlayer == Player.whoAmI)
{
+27 -13
View File
@@ -755,7 +755,7 @@ namespace CalamityMod.CalPlayer
for (int l = 0; l < 2; l++)
{
Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f);
int leafDamage = (int)(0.25f * proj.damage);
int leafDamage = CalamityUtils.DamageSoftCap((int)(0.25f * proj.damage), 150);
int leaf = Projectile.NewProjectile(source, position, velocity, ProjectileID.Leaf, leafDamage, 0f, Player.whoAmI);
if (leaf.WithinBounds(Main.maxProjectiles))
{
@@ -768,15 +768,15 @@ namespace CalamityMod.CalPlayer
for (int projCount = 0; projCount < 2; projCount++)
{
Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f);
int energyDamage = (int)(0.33f * proj.damage);
int energyDamage = CalamityUtils.DamageSoftCap((int)(0.33f * proj.damage), 200);
Projectile.NewProjectile(source, proj.Center, velocity, ProjectileType<TarraEnergy>(), energyDamage, 0f, proj.owner);
}
}
}
}
if (dynamoStemCells && MiniSwamerCooldown <= 0 && proj.CountsAsClass<RangedDamageClass>())
if (dynamoStemCells && MiniSwarmerCooldown <= 0 && proj.CountsAsClass<RangedDamageClass>())
{
MiniSwamerCooldown = DynamoStemCells.MiniSwamerCooldown;
MiniSwarmerCooldown = DynamoStemCells.MiniSwarmerCooldown;
Vector2 velocity = proj.velocity.SafeNormalize(Vector2.UnitY) * 19;
int MiniSwamerDamage = (int)Player.GetTotalDamage<RangedDamageClass>().ApplyTo(DynamoStemCells.MiniSwamerDamage);
@@ -1099,6 +1099,7 @@ namespace CalamityMod.CalPlayer
if (raiderTalisman && modProj.stealthStrike)
{
raiderCritLifespan = CalamityUtils.SecondsToFrames(RaidersTalisman.RaiderCooldown);
Player.AddCooldown(RaiderBoost.ID, raiderCritLifespan, true, vampiricTalisman ? "Bloodfeast" : "default");
if (raiderSoundCooldown <= 0)
{
SoundEngine.PlaySound(RaidersTalisman.StealthHitSound, Player.Center);
@@ -1256,12 +1257,7 @@ namespace CalamityMod.CalPlayer
}
if (vexation)
{
if ((Player.armor[0].type == ItemType<ReaverHeadTank>() || Player.armor[0].type == ItemType<ReaverHeadExplore>() ||
Player.armor[0].type == ItemType<ReaverHeadMobility>()) && Player.armor[1].type == ItemType<ReaverScaleMail>() &&
Player.armor[2].type == ItemType<ReaverCuisses>())
{
target.AddBuff(BuffID.Venom, 120, false);
}
}
}
#endregion
@@ -1282,8 +1278,13 @@ namespace CalamityMod.CalPlayer
if (gladiatorSword && target.IsAnEnemy(false) && target.life <= 0 && target.Calamity().gladiatorOnKill && target.lifeMax > 5)
{
float healPower = 10 * Utils.GetLerpValue(300, 0, gladiatorTimer, true);
target.Calamity().gladiatorOnKill = false;
Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center.X, target.Center.Y, target.velocity.X / 2, target.velocity.Y / 2, ProjectileType<GladiatorHealOrb>(), 0, 0f);
if (healPower >= 1)
{
Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center, target.velocity * 0.5f, ProjectileType<GladiatorHealOrb>(), 0, 0, -1, (int)healPower);
gladiatorTimer = 300;
}
}
if (Main.LocalPlayer.lifeSteal > 0f && !Player.moonLeech && target.lifeMax > 5)
@@ -1303,11 +1304,19 @@ namespace CalamityMod.CalPlayer
if (vampiricTalisman && proj.CountsAsClass<RogueDamageClass>() && crit)
{
int heal = (int)Math.Round(damage * 0.015);
int heal = (int)Math.Round(damage * (Main.zenithWorld ? 0.01 : 0.008));
if (proj.Calamity().stealthStrike)
{
heal /= 2; //stealth strikes heal half due to generally dealing far more dmg
if (Main.zenithWorld)
heal *= -2; // IT YEARNS FOR MORE BLOOD
}
if (heal > BalancingConstants.LifeStealCap)
heal = BalancingConstants.LifeStealCap;
if (CalamityGlobalProjectile.CanSpawnLifeStealProjectile(1f, heal))
// Heals more if the ability is active
if (CalamityGlobalProjectile.CanSpawnLifeStealProjectile((raiderCritLifespan > 0) ? 1.5f : 1f, heal))
CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange, BalancingConstants.LifeStealAccessoryCooldownMultiplier);
}
@@ -1448,8 +1457,13 @@ namespace CalamityMod.CalPlayer
if (gladiatorSword && target.IsAnEnemy(false) && target.life <= 0 && target.Calamity().gladiatorOnKill && target.lifeMax > 5)
{
float healPower = 10 * Utils.GetLerpValue(300, 0, gladiatorTimer, true);
target.Calamity().gladiatorOnKill = false;
Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center, target.velocity * 0.5f, ProjectileType<GladiatorHealOrb>(), 0, 0f);
if (healPower >= 1)
{
Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center, target.velocity * 0.5f, ProjectileType<GladiatorHealOrb>(), 0, 0, -1, (int)healPower);
gladiatorTimer = 300;
}
}
if (reaverDefense)
+2 -2
View File
@@ -32,7 +32,7 @@ namespace CalamityMod.CalPlayer.Dashes
public float Size = 2.2f;
public bool SoundOnce = true;
public override float CalculateDashSpeed(Player player) => 40f;
public override float CalculateDashSpeed(Player player) => 32f;
public override void OnDashEffects(Player player)
{
@@ -110,7 +110,7 @@ namespace CalamityMod.CalPlayer.Dashes
}
// Dash at a much, much faster speed than the default value.
dashSpeed = 40f;
dashSpeed = 32f;
runSpeedDecelerationFactor = 0.8f;
// Cooldown for God Slayer Armor dash.
+44 -27
View File
@@ -1,8 +1,11 @@
using CalamityMod.Enums;
using System;
using CalamityMod.Dusts;
using CalamityMod.Enums;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.CalPlayer.Dashes
{
@@ -12,46 +15,60 @@ namespace CalamityMod.CalPlayer.Dashes
public override DashCollisionType CollisionType => DashCollisionType.NoCollision;
public override bool IsOmnidirectional => false;
public int Time = 0;
public int lastDashDir = 0;
public override float CalculateDashSpeed(Player player) => 20f;
public override float CalculateDashSpeed(Player player) => (50f * player.moveSpeed);
public override void OnDashEffects(Player player)
{
Time = 0;
for (int i = 0; i < 12; i++)
if (Math.Sign(player.velocity.X) == lastDashDir && lastDashDir != 0)
{
Vector2 smokePos = player.Center + new Vector2(Main.rand.Next(-player.width, player.width), Main.rand.Next(-player.height, player.height)) * 0.8f;
Vector2 smokeVel = Vector2.UnitY.RotatedByRandom(MathHelper.Pi) * Main.rand.NextFloat(1.25f, 1.75f);
HeavySmokeParticle onDashSmoke = new(smokePos, smokeVel, Color.Gray, 30, 0.5f, 0.75f, 0.2f * Main.rand.NextFloatDirection());
GeneralParticleHandler.SpawnParticle(onDashSmoke);
player.Calamity().statisPenaltyTimer = player.Calamity().statisTimerMax;
if (player.Calamity().statisAnticheese < 6)
player.Calamity().statisAnticheese++;
}
else
player.Calamity().statisAnticheese = 0;
if (player.Calamity().statisAnticheese > 1)
player.velocity.X *= Utils.Remap(player.Calamity().statisAnticheese, 1, 6, 0.9f, 0.3f, true);
lastDashDir = Math.Sign(player.velocity.X);
lastDashDir = Math.Sign(player.velocity.X);
Time = 0;
for (int i = 0; i < 15; i++)
{
Vector2 intenededVel = (MathHelper.TwoPi * i / 15f).ToRotationVector2() * 1.5f;
Vector2 fxVel = new Vector2(intenededVel.X, intenededVel.Y * 2.3f).RotatedBy(player.velocity.ToRotation());
Vector2 fxPlace = player.Center + fxVel.RotatedBy(player.velocity.ToRotation()) + player.velocity.SafeNormalize(Vector2.UnitX) * 60;
Color dustColor = Main.rand.NextBool() ? Color.Purple : Color.DarkSlateBlue;
int dustStyle = ModContent.DustType<SquashDust>();
Dust dust2 = Dust.NewDustPerfect(fxPlace, dustStyle, (fxVel - player.velocity.SafeNormalize(Vector2.UnitX) * Main.rand.NextFloat(4, 5)) * Main.rand.NextFloat(1.2f, 1.5f));
dust2.scale = Main.rand.NextFloat(1.6f, 2.3f) * 1.8f;
dust2.color = dustColor;
dust2.noGravity = true;
dust2.fadeIn = 1.5f;
}
}
public override void MidDashEffects(Player player, ref float dashSpeed, ref float dashSpeedDecelerationFactor, ref float runSpeedDecelerationFactor)
{
Time++;
if (Time % 3 == 0)
for (int i = 0; i < 2; i++)
{
int colorType = Main.rand.Next(3);
Color smokeColor = Color.White;
switch (colorType)
{
case 0:
smokeColor = Color.Gray;
break;
case 1:
smokeColor = new Color(28, 75, 163);
break;
case 2:
smokeColor = new Color(195, 0, 255);
break;
}
Vector2 smokePos = player.Center - (player.velocity * 1.25f) + Main.rand.NextVector2Circular(10, 20);
float smokeScale = player.velocity.X * 0.045f;
HeavySmokeParticle midDashSmoke = new(smokePos, player.velocity * 0.2f, smokeColor, 20, smokeScale, 0.75f, 0.2f * Main.rand.NextFloatDirection(), true);
HeavySmokeParticle midDashSmoke = new(player.Center + Main.rand.NextVector2Circular(15, 15), -player.velocity.SafeNormalize(Vector2.UnitX) * Main.rand.NextFloat(5, 9), Main.rand.NextBool() ? Color.Purple : Color.DarkSlateBlue, 16, Main.rand.NextFloat(0.7f, 0.9f), 0.55f, 0.2f * Main.rand.NextFloatDirection(), true);
GeneralParticleHandler.SpawnParticle(midDashSmoke);
}
int dustStyle = ModContent.DustType<SquashDust>();
Dust dust2 = Dust.NewDustPerfect(player.Center + Main.rand.NextVector2Circular(15, 15), dustStyle, player.velocity.SafeNormalize(Vector2.UnitX) * Main.rand.NextFloat(5, 9));
dust2.scale = Main.rand.NextFloat(0.9f, 1.7f);
dust2.color = Main.rand.NextBool() ? Color.Purple : Color.DarkSlateBlue;
dust2.noGravity = true;
dust2.fadeIn = 0.5f;
player.velocity.X *= 0.93f;
}
}
}
+80 -27
View File
@@ -1,8 +1,14 @@
using CalamityMod.Enums;
using System;
using System.Security.Policy;
using CalamityMod.Dusts;
using CalamityMod.Enums;
using CalamityMod.Graphics.Metaballs;
using CalamityMod.Particles;
using CalamityMod.Projectiles.Rogue;
using Microsoft.Xna.Framework;
using rail;
using Terraria;
using Terraria.Audio;
using Terraria.ModLoader;
namespace CalamityMod.CalPlayer.Dashes
@@ -15,47 +21,94 @@ namespace CalamityMod.CalPlayer.Dashes
public override bool IsOmnidirectional => false;
public int Time = 0;
public bool AngleSwap = true;
public Vector2 aimVel;
public bool strongVisuals = true;
public int lastDashDir = 0;
public override float CalculateDashSpeed(Player player) => 25.4f;
public override float CalculateDashSpeed(Player player) => (70f * player.moveSpeed);
public override void OnDashEffects(Player player)
{
if (Math.Sign(player.velocity.X) == lastDashDir && lastDashDir != 0)
{
player.Calamity().statisPenaltyTimer = player.Calamity().statisTimerMax;
if (player.Calamity().statisAnticheese < 6)
player.Calamity().statisAnticheese++;
}
else
player.Calamity().statisAnticheese = 0;
if (player.Calamity().statisAnticheese > 1)
player.velocity.X *= Utils.Remap(player.Calamity().statisAnticheese, 1, 6, 0.9f, 0.3f, true);
lastDashDir = Math.Sign(player.velocity.X);
strongVisuals = player.Calamity().voidSashVisuals;
Time = 0;
aimVel = player.velocity;
if (strongVisuals)
{
SoundStyle sound = new("CalamityMod/Sounds/Item/VoidDash");
SoundEngine.PlaySound(sound with { Volume = 0.7f, Pitch = Main.rand.NextFloat(-0.15f, 0.15f) }, player.Center);
for (int i = 0; i < 40; i++)
{
Vector2 intenededVel = (MathHelper.TwoPi * i / 40f).ToRotationVector2() * 5.5f;
Vector2 fxVel = new Vector2(intenededVel.X, intenededVel.Y * 2.3f).RotatedBy(player.velocity.ToRotation());
Vector2 fxPlace = player.Center + fxVel.RotatedBy(player.velocity.ToRotation()) + player.velocity.SafeNormalize(Vector2.UnitX) * 60;
SignusMetaball.SpawnParticle(fxPlace, fxVel - player.velocity.SafeNormalize(Vector2.UnitX) * Main.rand.NextFloat(6, 9), 60f * Main.rand.NextFloat(0.7f, 1), 60, new Vector2(1.8f, 0.9f), 0.06f, 0);
}
}
for (int i = 0; i < 30; i++)
{
Vector2 intenededVel = (MathHelper.TwoPi * i / 30f).ToRotationVector2() * 5.5f;
Vector2 fxVel = new Vector2(intenededVel.X, intenededVel.Y * 2.3f).RotatedBy(player.velocity.ToRotation());
Vector2 fxPlace = player.Center + fxVel.RotatedBy(player.velocity.ToRotation()) + player.velocity.SafeNormalize(Vector2.UnitX) * 60;
Color dustColor = Main.rand.NextBool(3) ? Color.Indigo : Color.DarkOrchid;
int dustStyle = ModContent.DustType<SquashDust>();
Dust dust2 = Dust.NewDustPerfect(fxPlace, dustStyle, (fxVel - player.velocity.SafeNormalize(Vector2.UnitX) * Main.rand.NextFloat(6, 9)) * Main.rand.NextFloat(1.2f, 1.5f));
dust2.scale = Main.rand.NextFloat(1.6f, 2.3f) * 2.3f;
dust2.color = dustColor;
dust2.noGravity = true;
dust2.fadeIn = 1.5f;
}
}
public override void MidDashEffects(Player player, ref float dashSpeed, ref float dashSpeedDecelerationFactor, ref float runSpeedDecelerationFactor)
{
Time++;
if (Time % 3 == 0)
{
Vector2 trailPos = player.Center - (player.velocity * 2) + Main.rand.NextVector2Circular(10, 20);
float trailScale = player.velocity.X * player.direction * 0.08f;
Color trailColor = Main.rand.NextBool(3) ? Color.Indigo : Color.DarkOrchid;
Particle Trail = new SparkParticle(trailPos, player.velocity * 0.2f, false, 35, trailScale, trailColor);
GeneralParticleHandler.SpawnParticle(Trail);
}
aimVel = Vector2.Lerp(aimVel, player.velocity, 0.2f);
// Periodically release scythes.
player.Calamity().statisTimer++;
if (Main.myPlayer == player.whoAmI && player.Calamity().statisTimer % 5 == 0)
{
int scytheDamage = (int)player.GetBestClassDamage().ApplyTo(250);
float fxFade = Utils.GetLerpValue(5, 15, Math.Abs(aimVel.X), true);
int scythe = Projectile.NewProjectile(player.GetSource_FromAI(), player.Center, player.velocity.RotatedBy(player.direction * (AngleSwap ? 30 : -30), default) * 0.1f - player.velocity / 2f, ModContent.ProjectileType<CosmicScythe>(), scytheDamage, 5f, player.whoAmI); ;
if (scythe.WithinBounds(Main.maxProjectiles))
Vector2 trailPos = player.Center - (aimVel * 2) + Main.rand.NextVector2Circular(10, 20);
float trailScale = 1 * fxFade;
Color trailColor = Main.rand.NextBool(3) ? Color.Indigo : Color.DarkOrchid;
int dustStyle = ModContent.DustType<SquashDust>();
Dust dust2 = Dust.NewDustPerfect(trailPos, dustStyle, aimVel.SafeNormalize(Vector2.UnitX) * Main.rand.NextFloat(9, 15));
dust2.scale = Main.rand.NextFloat(0.9f, 1.7f);
dust2.color = trailColor;
dust2.noGravity = true;
dust2.fadeIn = 0.5f;
if (strongVisuals)
{
SignusMetaball.SpawnParticle(player.Center + Main.rand.NextVector2Circular(20, 20), -aimVel.SafeNormalize(Vector2.UnitX) * Main.rand.NextFloat(5, 15), 120f * Main.rand.NextFloat(0.7f, 1f), 60, new Vector2(0.8f, 1.2f), 0.08f, 0);
int dir = MathF.Sign(aimVel.X);
Vector2 safeVel = aimVel.SafeNormalize(Vector2.UnitX);
float sparkscale2 = 0.35f * Math.Max(fxFade, 0.5f);
for (int i = -1; i <= 1; i += 2)
{
Main.projectile[scythe].DamageType = DamageClass.Generic;
Main.projectile[scythe].usesIDStaticNPCImmunity = true;
Main.projectile[scythe].idStaticNPCHitCooldown = 10;
Vector2 fxVelocity = safeVel.RotatedBy(dir * MathHelper.ToRadians(75) * -i) - safeVel * 3;
Vector2 fxPlace = player.Center + (safeVel * 35).RotatedBy(-0.2f * dir * i) * 1.5f;
SignusMetaball.SpawnParticle(fxPlace, fxVelocity * Main.rand.NextFloat(5, 8), 50f * Main.rand.NextFloat(0.7f, 1f), 8, new Vector2(0.8f, 1.2f), 0.18f, 0);
}
AngleSwap = !AngleSwap;
}
// Dash at a faster speed than the default value.
dashSpeed = 14f;
player.velocity.X *= 0.912f;
}
}
}
+12 -4
View File
@@ -12,11 +12,12 @@ namespace CalamityMod.CalPlayer.DrawLayers
public enum EncasementType
{
BlazingCore,
FlameLickedShell
FlameLickedShell,
ShieldoftheOcean
}
public override Position GetDefaultPosition() => new BeforeParent(PlayerDrawLayers.FrontAccFront); //me when the player layer is called front acc front :skull:
public EncasementType GetEncasementTypeFor(CalamityPlayer modPlayer) => modPlayer.blazingCore ? EncasementType.BlazingCore : EncasementType.FlameLickedShell;
public EncasementType GetEncasementTypeFor(CalamityPlayer modPlayer) => modPlayer.blazingCore ? EncasementType.BlazingCore : modPlayer.flameLickedShell ? EncasementType.FlameLickedShell : EncasementType.ShieldoftheOcean;
public override bool GetDefaultVisibility(PlayerDrawSet drawInfo)
{
@@ -28,6 +29,7 @@ namespace CalamityMod.CalPlayer.DrawLayers
{
EncasementType.BlazingCore => visible && modPlayer.blazingCoreParry > 0,
EncasementType.FlameLickedShell => visible && modPlayer.flameLickedShellParry > 0,
EncasementType.ShieldoftheOcean => visible && modPlayer.shieldOfTheOceanParry > 0,
_ => false
};
return visible;
@@ -56,6 +58,12 @@ namespace CalamityMod.CalPlayer.DrawLayers
defaultOpacity = 0.875f;
scale = 1.2f;
break;
case EncasementType.ShieldoftheOcean:
tex += "OceanShieldBubble";
currentParry = calPlayer.shieldOfTheOceanParry;
defaultOpacity = 0.7f;
scale = 1.3f;
break;
default: //should never be this option
tex += "BlazingCoreCrystal";
currentParry = 0;
@@ -70,8 +78,8 @@ namespace CalamityMod.CalPlayer.DrawLayers
drawPos.X += 15f;
int maxParry = 30; //all parries use thirty seconds as a max at this point in time, if this changes, this too should change
float colorIntensity = currentParry >= 18 ? defaultOpacity : 1f - Utils.GetLerpValue(maxParry, 0f, currentParry, true);
int maxParry = 30; // All parries currently last 30 frames. If this changes, this too should change.
float colorIntensity = currentParry >= 12 ? defaultOpacity : 1f - Utils.GetLerpValue(maxParry, 0f, currentParry, true);
SpriteEffects spriteEffects = drawPlayer.direction != -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally;
drawInfo.DrawDataCache.Add(new DrawData(texture, drawPos, null, Color.White * colorIntensity, 0f, texture.Size() * 0.75f, scale, spriteEffects, 0));
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

+8
View File
@@ -281,6 +281,14 @@ namespace CalamityMod
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
public bool FasterFallHotkey { get; set; }
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
public bool CalamityArmorSetBonusDoubleTap { get; set; }
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(false)]
public bool StutterFix { get; set; }
#endregion
}
+3
View File
@@ -6,6 +6,7 @@ namespace CalamityMod
{
public static ModKeybind AccessoryParryHotKey { get; private set; }
public static ModKeybind AdrenalineHotKey { get; private set; }
public static ModKeybind AmmoCycleHotkey { get; private set; }
public static ModKeybind AngelicAllianceHotKey { get; private set; }
public static ModKeybind ArmorSetBonusHotKey { get; private set; }
public static ModKeybind AscendantInsigniaHotKey { get; private set; }
@@ -24,6 +25,7 @@ namespace CalamityMod
// Register keybinds
AccessoryParryHotKey = KeybindLoader.RegisterKeybind(Mod, "ActivateAccessoryParry", "N");
AdrenalineHotKey = KeybindLoader.RegisterKeybind(Mod, "AdrenalineMode", "B");
AmmoCycleHotkey = KeybindLoader.RegisterKeybind(Mod, "AmmoCycle", "Mouse3");
AngelicAllianceHotKey = KeybindLoader.RegisterKeybind(Mod, "AngelicAllianceBlessing", "G");
ArmorSetBonusHotKey = KeybindLoader.RegisterKeybind(Mod, "ArmorSetBonus", "Y");
AscendantInsigniaHotKey = KeybindLoader.RegisterKeybind(Mod, "AscendantInsigniaHotKey", "K");
@@ -42,6 +44,7 @@ namespace CalamityMod
{
AccessoryParryHotKey = null;
AdrenalineHotKey = null;
AmmoCycleHotkey = null;
AngelicAllianceHotKey = null;
ArmorSetBonusHotKey = null;
AscendantInsigniaHotKey = null;
+1 -1
View File
@@ -10,4 +10,4 @@
<ItemGroup>
<PackageReference Include="tModLoader.CodeAssist" Version="0.1.5" />
</ItemGroup>
</Project>
</Project>
+7 -2
View File
@@ -2,7 +2,6 @@
using Terraria;
using Terraria.Audio;
using Terraria.Localization;
using static CalamityMod.CalamityUtils;
namespace CalamityMod.Cooldowns
{
@@ -15,7 +14,13 @@ namespace CalamityMod.Cooldowns
public override Color OutlineColor => Color.White;
public override Color CooldownStartColor => Color.Sienna;
public override Color CooldownEndColor => Color.LightSlateGray;
public override void Tick()
{
if (Main.zenithWorld)
instance.timeLeft = -1;
}
public override SoundStyle? EndSound => new("CalamityMod/Sounds/Item/ArsenalOffCooldown");
public override SoundStyle? EndSound => (Main.zenithWorld ? null : new("CalamityMod/Sounds/Item/ArsenalOffCooldown"));
}
}
+3 -2
View File
@@ -1,4 +1,5 @@
using CalamityMod.CalPlayer;
using System;
using CalamityMod.CalPlayer;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
@@ -15,7 +16,7 @@ namespace CalamityMod.Cooldowns
// If the player doesn't have DSO, this cooldown should not appear.
public override bool ShouldDisplay => instance.player.GetModPlayer<CalamityPlayer>().spiritOrigin;
private float ExtraCritChance => instance.player.GetModPlayer<CalamityPlayer>().spiritOriginCritBoost;
private float ExtraCritChance => Math.Min(instance.player.GetModPlayer<CalamityPlayer>().spiritOriginCritBoost, CritHardCap);
private float TextXOffset => (ExtraCritChance > 99 ? -24 : ExtraCritChance > 9 ? -20 : -16) * TextScale;
private Vector2 TextPosition => new(TextXOffset , 25);
+45
View File
@@ -0,0 +1,45 @@
using System;
using CalamityMod.Items.Accessories;
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Items.Weapons.Ranged;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.Localization;
using static Terraria.ModLoader.ModContent;
namespace CalamityMod.Cooldowns
{
public class FuryFuel : CooldownHandler
{
public float CompletionPercentage => MathF.Round(instance.Completion * 100);
private bool IsEmpty => CompletionPercentage == 100;
private float TextXOffset => -5.4f;
private Vector2 TextPosition => new(TextXOffset, 15);
private Color TextColor => Color.White;
private Color TextBorderColor = Color.Violet;
public static new string ID => "FuryFuel";
public override bool CanTickDown => false;
public override LocalizedText DisplayName => CalamityUtils.GetText($"UI.Cooldowns.{ID}");
public override bool ShouldDisplay => instance.player.HeldItem.type == ItemType<PristineFury>();
public override string Texture => "CalamityMod/Cooldowns/" + ID;
public override Color CooldownStartColor => IsEmpty ? Color.DimGray : Color.Lerp(Color.Purple, Color.SlateGray, instance.Completion);
public override Color CooldownEndColor => IsEmpty ? Color.DimGray : Color.Lerp(Color.Orchid, Color.SlateGray, instance.Completion);
public override void DrawExpanded(SpriteBatch spriteBatch, Vector2 position, float opacity, float scale)
{
base.DrawExpanded(spriteBatch, position, opacity, scale);
}
public override void DrawCompact(SpriteBatch spriteBatch, Vector2 position, float opacity, float scale)
{
base.DrawCompact(spriteBatch, position, opacity, scale);
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 368 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

+7
View File
@@ -38,6 +38,13 @@ namespace CalamityMod.Cooldowns
cooldownColorStart = Color.Lerp(new Color(107, 6, 6), new Color(228, 78, 78), 1 - (instance?.Completion ?? 0));
cooldownColorEnd = Color.Lerp(new Color(107, 6, 6), new Color(228, 78, 78), 1 - (instance?.Completion ?? 0));
break;*/
case "shieldoftheocean":
// skinTexture = "ShieldOfTheOceanParry";
skinTexture = "ParryCooldown";
outlineColor = Color.White;
cooldownColorStart = new Color(233, 111, 165);
cooldownColorEnd = new Color(105, 139, 148);
break;
default:
skinTexture = "ParryCooldown";
outlineColor = Color.White;
+45
View File
@@ -0,0 +1,45 @@
using Microsoft.Xna.Framework;
using Terraria.Localization;
namespace CalamityMod.Cooldowns
{
public class RaiderBoost : CooldownHandler
{
public static new string ID => "RaidersBoost";
public override bool ShouldDisplay => true;
public override LocalizedText DisplayName => CalamityUtils.GetText($"UI.Cooldowns.{ID}");
public override string Texture => "CalamityMod/Cooldowns/" + skinTexture;
public override Color OutlineColor => outlineColor;
public override Color CooldownStartColor => Color.Lerp(cooldownColorStart, cooldownColorEnd, 1 - instance.Completion);
public override Color CooldownEndColor => Color.Lerp(cooldownColorStart, cooldownColorEnd, 1 - instance.Completion);
//It's the same cooldown with different skins each time, basically.
public string skinTexture;
public Color outlineColor;
public Color cooldownColorStart;
public Color cooldownColorEnd;
public RaiderBoost() : this("") { }
public RaiderBoost(string skin)
{
switch (skin)
{
case "Bloodfeast":
skinTexture = "VampiricTalismanBoost";
outlineColor = new Color(143, 27, 27);
cooldownColorStart = new Color(133, 5, 5);
cooldownColorEnd = new Color(255, 0, 0);
break;
default:
skinTexture = "RaiderBoost";
outlineColor = new Color(122, 97, 77);
cooldownColorStart = new Color(168, 122, 86);
cooldownColorEnd = new Color(74, 60, 49);
break;
}
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 437 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 B

+8 -4
View File
@@ -575,6 +575,7 @@ namespace CalamityMod
{ new Tuple<int, int>(ModContent.NPCType<Crabulon>(), ModContent.ProjectileType<MushBomb>()), new int[] { 32, 48, 60, 72, 108 } },
{ new Tuple<int, int>(ModContent.NPCType<Crabulon>(), ModContent.ProjectileType<MushBombFall>()), new int[] { 32, 48, 60, 72, 108 } },
{ new Tuple<int, int>(ModContent.NPCType<Crabulon>(), ModContent.ProjectileType<MushBombGround>()), new int[] { 32, 48, 60, 72, 108 } },
{ new Tuple<int, int>(NPCID.EaterofWorldsHead, ProjectileID.CursedFlameHostile), new int[] { 26, 44, 60, 76, 114 } },
{ new Tuple<int, int>(NPCID.EaterofWorldsHead, ModContent.ProjectileType<ShadowflameFireball>()), new int[] { 26, 36, 44, 52, 84 } },
@@ -595,9 +596,13 @@ namespace CalamityMod
{ new Tuple<int, int>(ModContent.NPCType<PerforatorHeadMedium>(), ModContent.ProjectileType<IchorBlob>()), new int[] { 36, 56, 68, 80, 120 } },
{ new Tuple<int, int>(ModContent.NPCType<PerforatorBodyMedium>(), ModContent.ProjectileType<IchorBlob>()), new int[] { 36, 56, 68, 80, 120 } },
{ new Tuple<int, int>(ModContent.NPCType<PerforatorTailMedium>(), ModContent.ProjectileType<IchorBlob>()), new int[] { 36, 56, 68, 80, 120 } },
{ new Tuple<int, int>(ModContent.NPCType<PerforatorHeadLarge>(), ModContent.ProjectileType<BloodGeyser>()), new int[] { 36, 56, 68, 80, 120 } },
{ new Tuple<int, int>(ModContent.NPCType<PerforatorHeadLarge>(), ModContent.ProjectileType<IchorShot>()), new int[] { 36, 56, 68, 80, 120 } },
{ new Tuple<int, int>(ModContent.NPCType<PerforatorHeadLarge>(), ModContent.ProjectileType<IchorBlob>()), new int[] { 36, 56, 68, 80, 120 } },
{ new Tuple<int, int>(ModContent.NPCType<PerforatorHeadLarge>(), ModContent.ProjectileType<DoGDeath>()), new int[] { 22, 36, 44, 52, 84 } },
{ new Tuple<int, int>(NPCID.QueenBee, ProjectileID.QueenBeeStinger), new int[] { 22, 44, 64, 84, 126 } },
{ new Tuple<int, int>(NPCID.QueenBee, ModContent.ProjectileType<QueenBeenade>()), new int[] { 46, 72, 84, 96, 144 } }, // Beenade Bees: 122 (death mode-exclusive)
{ new Tuple<int, int>(NPCID.SkeletronHead, ProjectileID.Skull), new int[] { 46, 72, 84, 96, 144 } },
{ new Tuple<int, int>(NPCID.SkeletronHead, ProjectileID.Shadowflames), new int[] { 36, 72, 88, 104, 156 } },
@@ -707,13 +712,13 @@ namespace CalamityMod
{ new Tuple<int, int>(ModContent.NPCType<AstrumAureus>(), ModContent.ProjectileType<AstralFlame>()), new int[] { 100, 172, 208, 244, 366 } },
{ new Tuple<int, int>(ModContent.NPCType<AureusSpawn>(), ModContent.ProjectileType<AstralLaser>()), new int[] { 88, 156, 184, 212, 318 } },
{ new Tuple<int, int>(NPCID.Golem, ProjectileID.Fireball), new int[] { 72, 132, 160, 188, 282 } },
{ new Tuple<int, int>(NPCID.Golem, ProjectileID.Fireball), new int[] { 60, 120, 140, 180, 270 } },
{ new Tuple<int, int>(NPCID.Golem, ProjectileID.EyeBeam), new int[] { 80, 140, 172, 204, 306 } },
{ new Tuple<int, int>(NPCID.GolemHead, ProjectileID.Fireball), new int[] { 60, 120, 160, 200, 300 } },
{ new Tuple<int, int>(NPCID.GolemHead, ProjectileID.Fireball), new int[] { 60, 120, 140, 180, 270 } },
{ new Tuple<int, int>(NPCID.GolemHead, ProjectileID.EyeBeam), new int[] { 80, 140, 172, 204, 306 } },
{ new Tuple<int, int>(NPCID.GolemFistLeft, ProjectileID.InfernoHostileBolt), new int[] { 88, 156, 184, 212, 318 } },
{ new Tuple<int, int>(NPCID.GolemFistRight, ProjectileID.InfernoHostileBolt), new int[] { 88, 156, 184, 212, 318 } },
{ new Tuple<int, int>(NPCID.GolemHeadFree, ProjectileID.Fireball), new int[] { 60, 120, 160, 200, 300 } },
{ new Tuple<int, int>(NPCID.GolemHeadFree, ProjectileID.Fireball), new int[] { 60, 120, 140, 180, 270 } },
{ new Tuple<int, int>(NPCID.GolemHeadFree, ProjectileID.EyeBeam), new int[] { 80, 140, 172, 204, 306 } },
{ new Tuple<int, int>(NPCID.GolemHeadFree, ProjectileID.InfernoHostileBolt), new int[] { 88, 156, 184, 212, 318 } },
@@ -813,7 +818,6 @@ namespace CalamityMod
{ new Tuple<int, int>(ModContent.NPCType<DevourerofGodsHead>(), ModContent.ProjectileType<DoGDeath>()), new int[] { 180, 316, 348, 380, 540 } },
{ new Tuple<int, int>(ModContent.NPCType<DevourerofGodsHead>(), ModContent.ProjectileType<DoGFire>()), new int[] { 200, 340, 376, 412, 600 } },
{ new Tuple<int, int>(ModContent.NPCType<DevourerofGodsBody>(), ModContent.ProjectileType<DoGDeath>()), new int[] { 180, 316, 348, 380, 540 } },
{ new Tuple<int, int>(ModContent.NPCType<Yharon>(), ModContent.ProjectileType<SkyFlareRevenge>()), new int[] { 300, 520, 548, 576, 900 } },
{ new Tuple<int, int>(ModContent.NPCType<Yharon>(), ModContent.ProjectileType<FlareBomb>()), new int[] { 220, 384, 424, 464, 660 } },
+63
View File
@@ -0,0 +1,63 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Dusts
{
public class DiamondDust : ModDust
{
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public override void OnSpawn(Dust dust)
{
dust.scale *= Main.rand.NextFloat(0.8f, 1f);
}
public override bool Update(Dust dust)
{
dust.rotation = dust.velocity.ToRotation() + MathHelper.PiOver2;
dust.velocity *= 0.96f;
if (dust.noGravity)
dust.scale -= 0.045f;
else
{
dust.scale -= 0.03f;
dust.velocity.Y += Main.rand.NextFloat(0.1f, 0.35f);
}
float light = MathHelper.Clamp(dust.scale * 0.8f, 0f, 1f);
if (!dust.noLightEmittence)
Lighting.AddLight(dust.position, dust.color.ToVector3() * light);
if (dust.scale <= 0)
dust.active = false;
dust.position += dust.velocity;
dust.fadeIn++; // Fade in is used for the time strech instead
return false;
}
public override bool PreDraw(Dust dust)
{
Vector2 dustCenter = dust.position + new Vector2(0.25f, 0.25f);
Texture2D bloom = ModContent.Request<Texture2D>("CalamityMod/Particles/SquareRotated").Value;
// dust.fadeIn is used to determine how intense the squash is, 1 is no squash, 0 is normal squash
float squashLerp = Utils.GetLerpValue(10, 25, dust.fadeIn, true);
Vector2 squash = new Vector2(MathHelper.Lerp(1, 0.3f, squashLerp), MathHelper.Lerp(1, 7f, squashLerp));
// Glow Orb
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0);
if (dust.alpha < 1)
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.2f) with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.09f, SpriteEffects.None, 0);
if (!dust.noLight)
{
for (int i = 0; i < 2; i++)
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.4f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha) * (i == 0 ? 1f : 0.7f), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.08f * (i == 0 ? 0.7f : 1), SpriteEffects.None, 0);
}
return false;
}
}
}
+63
View File
@@ -0,0 +1,63 @@
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Dusts
{
public class SquareDust : ModDust
{
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public override void OnSpawn(Dust dust)
{
dust.scale *= Main.rand.NextFloat(0.8f, 1f);
dust.rotation = Main.rand.NextFloat(-5, 5);
}
public override bool Update(Dust dust)
{
float fadeSpeed = (dust.fadeIn + 1);
float rotDir = Math.Sign(dust.rotation);
dust.rotation += 0.04f * dust.scale * rotDir;
dust.velocity *= 0.96f * fadeSpeed;
if (dust.noGravity)
dust.scale -= 0.045f * fadeSpeed;
else
{
dust.scale -= 0.03f * fadeSpeed;
dust.velocity.Y += Main.rand.NextFloat(0.1f, 0.35f) * fadeSpeed;
}
float light = MathHelper.Clamp(dust.scale * 0.8f, 0f, 1f);
if (!dust.noLightEmittence)
Lighting.AddLight(dust.position, dust.color.ToVector3() * light);
if (dust.scale <= 0)
dust.active = false;
dust.position += dust.velocity;
return false;
}
public override bool PreDraw(Dust dust)
{
Vector2 dustCenter = dust.position + new Vector2(0.25f, 0.25f);
Texture2D bloom = ModContent.Request<Texture2D>("CalamityMod/Particles/GlowSquareParticleThick").Value;
Vector2 squash = Vector2.One;
// Glow Orb
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0);
if (dust.alpha < 1)
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.095f, SpriteEffects.None, 0);
if (!dust.noLight)
{
for (int i = 0; i < 2; i++)
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.09f, SpriteEffects.None, 0);
}
return false;
}
}
}
+60
View File
@@ -0,0 +1,60 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Dusts
{
public class SquashDust : ModDust
{
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public override void OnSpawn(Dust dust)
{
dust.scale *= Main.rand.NextFloat(0.8f, 1f);
}
public override bool Update(Dust dust)
{
float fadeSpeed = (dust.fadeIn + 1);
dust.rotation = dust.velocity.ToRotation() + MathHelper.PiOver2;
dust.velocity *= 0.96f;
if (dust.noGravity)
dust.scale -= 0.045f * fadeSpeed;
else
{
dust.scale -= 0.03f * fadeSpeed;
dust.velocity.Y += Main.rand.NextFloat(0.1f, 0.35f) * fadeSpeed;
}
float light = MathHelper.Clamp(dust.scale * 0.8f, 0f, 1f);
if (!dust.noLightEmittence)
Lighting.AddLight(dust.position, dust.color.ToVector3() * light);
if (dust.scale <= 0)
dust.active = false;
dust.position += dust.velocity;
return false;
}
public override bool PreDraw(Dust dust)
{
Vector2 dustCenter = dust.position + new Vector2(0.25f, 0.25f);
Texture2D solidCenter = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/BasicCircle").Value;
Texture2D bloom = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle").Value;
Vector2 squash = new Vector2(Utils.Remap(dust.velocity.Length(), 2, 7, 1, 0.5f), Utils.Remap(dust.velocity.Length(), 2, 7, 1, 2.5f));
// Glow Orb
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0);
if (dust.alpha < 1)
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.04f, SpriteEffects.None, 0);
if (!dust.noLight)
{
Main.EntitySpriteDraw(solidCenter, dustCenter - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, solidCenter.Size() * 0.5f, squash * dust.scale * 0.075f, SpriteEffects.None, 0);
}
return false;
}
}
}
+60
View File
@@ -0,0 +1,60 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Dusts
{
public class SquashDustHollow : ModDust
{
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public override void OnSpawn(Dust dust)
{
dust.scale *= Main.rand.NextFloat(0.8f, 1f);
}
public override bool Update(Dust dust)
{
dust.rotation = dust.velocity.ToRotation() + MathHelper.PiOver2;
dust.velocity *= 0.96f;
if (dust.noGravity)
dust.scale -= 0.045f;
else
{
dust.scale -= 0.03f;
dust.velocity.Y += Main.rand.NextFloat(0.1f, 0.35f);
}
float light = MathHelper.Clamp(dust.scale * 0.8f, 0f, 1f);
if (!dust.noLightEmittence)
Lighting.AddLight(dust.position, dust.color.ToVector3() * light);
if (dust.scale <= 0)
dust.active = false;
dust.position += dust.velocity;
return false;
}
public override bool PreDraw(Dust dust)
{
Vector2 dustCenter = dust.position + new Vector2(0.25f, 0.25f);
Texture2D bloom = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomRing").Value;
// dust.fadeIn is used to determine how intense the squash is, 1 is no squash, 0 is normal squash
Vector2 squash = Vector2.Lerp(new Vector2(Utils.Remap(dust.velocity.Length(), 2, 7, 1, 0.5f), Utils.Remap(dust.velocity.Length(), 2, 7, 1, 2.5f)), Vector2.One, dust.fadeIn);
// Glow Orb
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0);
if (dust.alpha < 1)
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.2f) with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.09f, SpriteEffects.None, 0);
if (!dust.noLight)
{
for (int i = 0; i < 2; i++)
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.4f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.075f, SpriteEffects.None, 0);
}
return false;
}
}
}
+68
View File
@@ -0,0 +1,68 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Dusts
{
public class SquashDustTileTouch : ModDust
{
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public override void OnSpawn(Dust dust)
{
dust.scale *= Main.rand.NextFloat(0.8f, 1f);
}
public override bool Update(Dust dust)
{
bool touchedTiles = false;
int size = (int)(2);
if (Collision.SolidCollision(dust.position, size, size))
{
touchedTiles = true;
dust.velocity = Vector2.Zero;
}
float fadeSpeed = (dust.fadeIn + 1); // For this dust, fadeIn is used to increase the power of gravity if it's active, otherwise it makes it's lifetime change
dust.rotation = dust.velocity.ToRotation() + MathHelper.PiOver2;
dust.velocity *= 0.96f;
if (dust.noGravity)
dust.scale -= 0.045f * (touchedTiles ? 0.4f : 1) * fadeSpeed;
else
{
dust.scale -= 0.03f * (touchedTiles ? 0.4f : 1);
dust.velocity.Y += Main.rand.NextFloat(0.1f, 0.35f) * fadeSpeed;
}
float light = MathHelper.Clamp(dust.scale * 0.8f, 0f, 1f);
if (!dust.noLightEmittence)
Lighting.AddLight(dust.position, dust.color.ToVector3() * light);
if (dust.scale <= 0)
dust.active = false;
if (!touchedTiles)
dust.position += dust.velocity;
return false;
}
public override bool PreDraw(Dust dust)
{
Vector2 dustCenter = dust.position + new Vector2(0.25f, 0.25f);
Texture2D solidCenter = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/BasicCircle").Value;
Texture2D bloom = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle").Value;
Vector2 squash = new Vector2(Utils.Remap(dust.velocity.Length(), 2, 7, 1, 0.5f), Utils.Remap(dust.velocity.Length(), 2, 7, 1, 2.5f));
// Glow Orb
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.1f, SpriteEffects.None, 0);
if (dust.alpha < 1)
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.04f, SpriteEffects.None, 0);
if (!dust.noLight)
{
Main.EntitySpriteDraw(solidCenter, dustCenter - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, solidCenter.Size() * 0.5f, squash * dust.scale * 0.075f, SpriteEffects.None, 0);
}
return false;
}
}
}
+63
View File
@@ -0,0 +1,63 @@
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Dusts
{
public class UnstableDust : ModDust
{
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public override void OnSpawn(Dust dust)
{
dust.scale *= Main.rand.NextFloat(0.8f, 1f);
dust.rotation = Main.rand.NextFloat(-5, 5);
}
public override bool Update(Dust dust)
{
float rotDir = Math.Sign(dust.rotation);
dust.rotation += 0.5f * dust.scale * rotDir;
dust.velocity *= 0.96f;
if (dust.noGravity)
dust.scale -= 0.045f;
else
{
dust.scale -= 0.03f;
dust.velocity.Y += Main.rand.NextFloat(0.1f, 0.35f);
}
float light = MathHelper.Clamp(dust.scale * 0.8f, 0f, 1f);
if (!dust.noLightEmittence)
Lighting.AddLight(dust.position, dust.color.ToVector3() * light);
if (dust.scale <= 0)
dust.active = false;
dust.position += dust.velocity;
// dust.fadeIn is used to change the shake intensity, -2 will negate it
dust.position += Main.rand.NextVector2Circular(dust.fadeIn + 2, dust.fadeIn + 2);
return false;
}
public override bool PreDraw(Dust dust)
{
Vector2 dustCenter = dust.position + new Vector2(0.25f, 0.25f);
Texture2D bloom = ModContent.Request<Texture2D>("CalamityMod/Particles/FullStar").Value;
Vector2 squash = new Vector2(0.4f, 1);
float texScaling = 6;
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.1f * texScaling, SpriteEffects.None, 0);
if (dust.alpha < 1)
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, dust.color with { A = 0 } * 0.85f * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.04f * texScaling, SpriteEffects.None, 0);
if (!dust.noLight)
{
Main.EntitySpriteDraw(bloom, dustCenter - Main.screenPosition, null, Color.Lerp(dust.color, Color.White, 0.3f) with { A = 0 } * Utils.GetLerpValue(255, 0, dust.alpha), dust.rotation, bloom.Size() * 0.5f, squash * dust.scale * 0.025f * texScaling, SpriteEffects.None, 0);
}
return false;
}
}
}
+27
View File
@@ -0,0 +1,27 @@
using CalamityMod.Dusts;
using Microsoft.Xna.Framework;
using Terraria.ModLoader;
namespace CalamityMod.Effects
{
public class ArsenalEffects
{
public static int ArsenalDust = 278; // Colorable firework dust, simple and effective. Most visuals use a mix of the energy respective dust and this
// Plasma
public static int ArsenalPlasmaDust = ModContent.DustType<SquashDustTileTouch>();
public static Color ArsenalPlasmaColor = Color.Lerp(Color.Green, Color.Chartreuse, 0.45f);
// Laser
public static int ArsenalLaserDust = ModContent.DustType<DiamondDust>();
public static Color ArsenalLaserColor = Color.Lerp(Color.Crimson, Color.Red, 0.45f);
// Pulse
public static int ArsenalPulseDust = ModContent.DustType<SquashDustHollow>();
public static Color ArsenalPulseColor = Color.Lerp(Color.DarkOrchid, Color.Magenta, 0.35f);
// Electric
public static int ArsenalElectricDust = ModContent.DustType<UnstableDust>();
public static Color ArsenalElectricColor = Color.Lerp(Color.Aqua, Color.Aquamarine, 0.35f);
// Gauss
public static int ArsenalGaussDust = ModContent.DustType<SquareDust>();
public static Color ArsenalGaussColor = Color.Lerp(Color.Yellow, Color.Goldenrod, 0.25f);
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

+1 -1
View File
@@ -13,7 +13,7 @@ using Terraria.ModLoader;
namespace CalamityMod.ExtraTextures
{
[Autoload(Side = ModSide.Client)]
internal sealed class ExtraTextureRefs : ModSystem
public class ExtraTextureRefs : ModSystem
{
// Destroyer glowmasks
public static Asset<Texture2D> DestroyerHeadGlowmask;
Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 286 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 245 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 275 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 220 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

+144
View File
@@ -0,0 +1,144 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Graphics.Metaballs
{
public class SignusMetaball : Metaball
{
public Color borderColor = Color.Purple;
public Vector2 goalDir = Vector2.Zero;
public Vector2 scrollDir = Vector2.Zero;
public class CosmicParticle
{
public float Size;
public Vector2 Velocity;
public Vector2 Center;
public Vector2 BaseSquash = Vector2.One;
public float Rotation;
public float ShrinkSpeed = 0;
public int Lifetime;
public float SquashPower = 0;
public int time = 0;
public CosmicParticle(Vector2 center, Vector2 velocity, float size, int lifetime, Vector2 squash, float shrinkSpeed = 0, float velocitySquash = 0)
{
Center = center;
Velocity = velocity;
Size = size;
Rotation = Velocity.ToRotation() + MathHelper.PiOver2;
BaseSquash = squash;
Lifetime = lifetime;
ShrinkSpeed = shrinkSpeed;
SquashPower = velocitySquash;
}
public void Update()
{
Center += Velocity;
Velocity *= 0.95f;
if ((float)time / (float)Lifetime > 0.5f)
{
Size *= 0.94f;
}
BaseSquash.X *= (1 - 0.2f * ShrinkSpeed);
BaseSquash.Y *= (1 + 0.2f * ShrinkSpeed);
Rotation = Velocity.ToRotation() + MathHelper.PiOver2;
time++;
}
}
public static Asset<Texture2D> LayerAsset
{
get;
private set;
}
public static List<CosmicParticle> Particles
{
get;
private set;
} = new();
public override bool AnythingToDraw => Particles.Any();
public override IEnumerable<Texture2D> Layers
{
get
{
yield return LayerAsset.Value;
}
}
public override MetaballDrawLayer DrawContext => MetaballDrawLayer.BeforeNPCs;
public override void Load()
{
if (Main.dedServ)
return;
// Load the layer asset wrapper.
LayerAsset = ModContent.Request<Texture2D>($"CalamityMod/Graphics/Metaballs/SignusLayer", AssetRequestMode.ImmediateLoad);
}
public override void Update()
{
if (goalDir == Vector2.Zero)
goalDir = Vector2.One.RotatedByRandom(Math.PI);
if ((int)(Main.GlobalTimeWrappedHourly * 50) % 5 == 0)
{
goalDir = goalDir.RotatedByRandom(0.13f);
}
scrollDir = Vector2.Lerp(scrollDir, goalDir, 0.01f);
float rate = Main.GlobalTimeWrappedHourly * 19;
List<Color> colors = new List<Color>()
{
Color.Purple,
Color.BlueViolet,
Color.DarkViolet
};
int colorIndex = (int)(rate / 2 % colors.Count);
Color currentColor = colors[colorIndex];
Color nextColor = colors[(colorIndex + 1) % colors.Count];
borderColor = Color.Lerp(currentColor, nextColor, rate % 2f > 1f ? 1f : rate % 1f);
// Update all particle instances.
// Once sufficiently small, they vanish.
for (int i = 0; i < Particles.Count; i++)
Particles[i].Update();
Particles.RemoveAll(p => p.Size <= 2f);
}
public override Color EdgeColor => borderColor with { A = 0 };
public static void SpawnParticle(Vector2 position, Vector2 velocity, float size, int lifetime, Vector2 squash, float shrinkSpeed = 0, float velocitySquash = 0) =>
Particles.Add(new(position, velocity, size, lifetime, squash, shrinkSpeed, velocitySquash));
// Make the texture scroll.
public override Vector2 CalculateManualOffsetForLayer(int layerIndex)
{
return scrollDir * 0.5f;
}
public override void DrawInstances()
{
Texture2D tex = ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/BasicMess").Value;
foreach (CosmicParticle particle in Particles)
{
Vector2 squash = Vector2.Lerp(particle.BaseSquash, new Vector2(Utils.Remap(particle.Velocity.Length(), 2, 7, 1, 0.5f), Utils.Remap(particle.Velocity.Length(), 2, 7, 1, 2.5f)), particle.SquashPower);
Vector2 drawPosition = particle.Center - Main.screenPosition;
Vector2 origin = tex.Size() * 0.5f;
Vector2 scale = Vector2.One * particle.Size / tex.Size();
Main.spriteBatch.Draw(tex, drawPosition, null, Color.White, particle.Rotation, origin, squash * scale, SpriteEffects.None, 0f);
}
}
}
}
@@ -65,7 +65,7 @@ namespace CalamityMod.Graphics.Renderers.CalamityRenderers
}
var shader = GameShaders.Misc["CalamityMod:HolyInfernoShader"].Shader;
shader.Parameters["colorMult"].SetValue(Main.IsItDay() ? 7.35f : 7.65f); //I want you to know it took considerable restraint to deliberately misspell colour.
shader.Parameters["colorMult"].SetValue(prov.hasBeenGivenFullPower ? 7.65f : 7.35f); //I want you to know it took considerable restraint to deliberately misspell colour.
shader.Parameters["time"].SetValue(Main.GlobalTimeWrappedHourly);
shader.Parameters["radius"].SetValue(borderDistance);
shader.Parameters["anchorPoint"].SetValue(npc.Center);
@@ -74,7 +74,7 @@ namespace CalamityMod.Graphics.Renderers.CalamityRenderers
shader.Parameters["burnIntensity"].SetValue(holyInfernoIntensity);
shader.Parameters["playerPosition"].SetValue(target.Center);
shader.Parameters["maxOpacity"].SetValue(maxOpacity);
shader.Parameters["day"].SetValue(Main.IsItDay());
shader.Parameters["day"].SetValue(!prov.hasBeenGivenFullPower);
spriteBatch.GraphicsDevice.Textures[1] = diagonalNoise.Value;
spriteBatch.GraphicsDevice.Textures[2] = upwardNoise.Value;
+23
View File
@@ -719,6 +719,29 @@ namespace CalamityMod.ILEditing
}
#endregion
#region Solar Wings Change to Solar Flare Armor Dash
private static void SolarWingsDashChange(ILContext il)
{
// Make Solar Wings always allow using Solar Flare armor's dash.
var cursor = new ILCursor(il);
// Genuinely how the fuck is this the only OR opcode in the entire method
if (!cursor.TryGotoNext(MoveType.After, i => i.MatchOr()))
{
LogFailure("Solar Dash Change", "Could not locate the OR opcode.");
return;
}
// Add an additional check for if the player is wearing Solar Wings.
cursor.Emit(OpCodes.Ldarg_0);
cursor.Emit(OpCodes.Ldfld, typeof(Player).GetField("wingsLogic"));
cursor.Emit(OpCodes.Ldc_I4, (int)VanillaWingID.WingsSolar);
cursor.EmitCeq();
// Then OR it.
cursor.EmitOr();
}
#endregion
#region Remove Melee Armor (Beetle Shell + Solar Flare) Multiplicative DR
private static void RemoveBeetleAndSolarFlareMultiplicativeDR(ILContext il)
{
+4 -1
View File
@@ -92,6 +92,7 @@ namespace CalamityMod.ILEditing
On_TileDrawing.DrawSingleTile += GlowMaskTileRender;
On_Main.DoUpdate_HandleChat += SpawnPunchCard;
On_Player.PlaceThing_CannonBall += AllowCannonJellyfishUse;
On_Player.IsItemSlotUnlockedAndUsable += MasterModeCelestialOnionCheck;
// Mana Burn (Chaos Stone) and Chalice of the Blood God
IL_Player.ApplyLifeAndOrMana += ManaSicknessAndChaliceBufferHeal;
@@ -147,6 +148,7 @@ namespace CalamityMod.ILEditing
IL_Projectile.Damage += VanillaBossResistChanges;
IL_Projectile.AI_099_2 += LimitTerrarianProjectiles;
IL_Projectile.AI_120_StardustGuardian += StardustGuardianAttackBuffs;
IL_Player.UpdateArmorSets += SolarWingsDashChange;
IL_Player.UpdateBuffs += UpdateBuffsBalancingChanges;
IL_Player.ApplyVanillaHurtEffectModifiers += RemoveBeetleAndSolarFlareMultiplicativeDR;
@@ -176,7 +178,6 @@ namespace CalamityMod.ILEditing
IL_WorldGen.Chlorophyte += AdjustChlorophyteSpawnLimits;
IL_UIWorldCreation.SetDefaultOptions += ChangeDefaultWorldSize;
IL_UIWorldCreation.AddWorldSizeOptions += SwapSmallDescriptionKey;
IL_UIWorldCreation.AddWorldDifficultyOptions += SwapMasterModeDescriptionKey;
Terraria.IO.On_WorldFile.ClearTempTiles += ClearModdedTempTiles;
On_WorldGen.MakeDungeon += LimitDungeonEntranceXPosition;
IL_WorldGen.DungeonHalls += LimitDungeonHallsXPosition;
@@ -188,6 +189,7 @@ namespace CalamityMod.ILEditing
IL_Player.ItemCheck_EmitUseVisuals += MakeMagmaStoneFireGauntletDustToggleable;
IL_Projectile.EmitEnchantmentVisualsAt += MakeMagmaStoneFireGauntletProjectileDustToggleable;
IL_Sandstorm.HasSufficientWind += DecreaseSandstormWindSpeedRequirement;
IL_Player.ItemCheck_Shoot += RemoveForcedInaccuracyFromChainGunAndGatligator;
IL_Item.TryGetPrefixStatMultipliersForItem += RelaxPrefixRequirements;
On_NPC.SlimeRainSpawns += PreventBossSlimeRainSpawns;
On_ShimmerTransforms.IsItemTransformLocked += AdjustShimmerRequirements;
@@ -205,6 +207,7 @@ namespace CalamityMod.ILEditing
On_Player.ItemCheck_CheckCanUse += RemoveUseLocks;
On_Player.ItemCheck_UseEventItems += ApplyCelestialSigilChanges;
IL_Main.DrawInfoAccs += RemoveDamageConditionFromRadar;
On_ShopHelper.ApplyNpcRelationshipEffect += AllowMultipleLikedNPCs;
// Fix vanilla bugs exposed by Calamity mechanics
IL_NPC.NPCLoot += FixSplittingWormBannerDrops;
+14 -3
View File
@@ -1868,7 +1868,7 @@ namespace CalamityMod.ILEditing
#region Revengeance Master Mode Twins Shenanigans
public static void TripletsSpawnTextOverride(Terraria.On_NPC.orig_SpawnBoss orig, int x, int y, int type, int targetPlayerIndex)
{
if (Main.masterMode && CalamityWorld.revenge && type == NPCID.Retinazer)
if (CalamityWorld.death && type == NPCID.Retinazer)
{
int retinazerIndex = NPC.NewNPC(NPC.GetBossSpawnSource(targetPlayerIndex), x, y, type, 1);
if (retinazerIndex == 200)
@@ -1896,7 +1896,7 @@ namespace CalamityMod.ILEditing
public static void PreventFoveanatorDefeatMessageIfNotKilledLast(On_NPC.orig_DoDeathEvents_BeforeLoot orig, NPC self, Player closestPlayer)
{
if (Main.masterMode && CalamityWorld.revenge && self.type == ModContent.NPCType<Foveanator>() && (NPC.AnyNPCs(NPCID.Spazmatism) || NPC.AnyNPCs(NPCID.Retinazer)))
if (CalamityWorld.death && self.type == ModContent.NPCType<Foveanator>() && (NPC.AnyNPCs(NPCID.Spazmatism) || NPC.AnyNPCs(NPCID.Retinazer)))
{
self.value = 0f;
self.boss = false;
@@ -1911,7 +1911,7 @@ namespace CalamityMod.ILEditing
public static void TripletsDefeatTextOverride(On_NPC.orig_DoDeathEvents_CelebrateBossDeath orig, NPC self, string typeName)
{
bool correctNPCType = self.type == NPCID.Retinazer || self.type == NPCID.Spazmatism || self.type == ModContent.NPCType<Foveanator>();
if (Main.masterMode && CalamityWorld.revenge && correctNPCType)
if (CalamityWorld.death && correctNPCType)
{
if (Main.netMode == NetmodeID.SinglePlayer)
Main.NewText(Language.GetTextValue("Announcement.HasBeenDefeated_Plural", CalamityUtils.GetTextValue("Status.Boss.TripletsDefeatName")), 175, 75, 255);
@@ -2485,5 +2485,16 @@ namespace CalamityMod.ILEditing
#endregion
#endregion
#region Make Celestial Onion give the Master Mode slot
public static bool MasterModeCelestialOnionCheck(Terraria.On_Player.orig_IsItemSlotUnlockedAndUsable orig, Player self, int slot)
{
if ((slot == 9 || slot == 19) && self.Calamity().extraAccessoryML && !Main.gameMenu)
{
return true;
}
return orig(self, slot);
}
#endregion
}
}
@@ -7,6 +7,7 @@ using CalamityMod.Items.Materials;
using CalamityMod.Items.TreasureBags.MiscGrabBags;
using CalamityMod.NPCs.AcidRain;
using CalamityMod.NPCs.NormalNPCs;
using CalamityMod.NPCs.TownNPCs;
using CalamityMod.Walls;
using Microsoft.Xna.Framework;
using Mono.Cecil.Cil;
@@ -14,7 +15,9 @@ using MonoMod.Cil;
using Terraria;
using Terraria.Audio;
using Terraria.DataStructures;
using Terraria.GameContent;
using Terraria.GameContent.Drawing;
using Terraria.GameContent.Personalities;
using Terraria.ID;
using Terraria.ModLoader;
@@ -120,6 +123,33 @@ namespace CalamityMod.ILEditing
}
#endregion Reforge Requirement Relaxation
#region Remove Forced Inaccuracy from Chain Gun and Gatligator
private static void RemoveForcedInaccuracyFromChainGunAndGatligator(ILContext il)
{
var cursor = new ILCursor(il);
// Go to the load of the Chain Gun's item ID (1929).
if (!cursor.TryGotoNext(MoveType.AfterLabel, i => i.MatchLdcI4(1929)))
{
LogFailure("Remove Chain Gun and Gatligator Inaccuracy", "Could not locate the ID of the Chain Gun.");
return;
}
// Change this item ID check to check for -1048576. This will never occur.
cursor.Next.Operand = -1048576;
// Go to the load of the Gatligator's item ID (2270).
if (!cursor.TryGotoNext(MoveType.AfterLabel, i => i.MatchLdcI4(2270)))
{
LogFailure("Remove Chain Gun and Gatligator Inaccuracy", "Could not locate the ID of the Gatligator.");
return;
}
// Change this item ID check to check for -1048576. This will never occur.
cursor.Next.Operand = -1048576;
}
#endregion
#region Prevention of Slime Rain Spawns When Near Bosses
private static void PreventBossSlimeRainSpawns(Terraria.On_NPC.orig_SlimeRainSpawns orig, int plr)
{
@@ -1121,6 +1151,38 @@ namespace CalamityMod.ILEditing
}
#endregion
#region Multiple NPC Happiness support for Cirrus
private static void AllowMultipleLikedNPCs(On_ShopHelper.orig_ApplyNpcRelationshipEffect orig, ShopHelper self, int npcType, AffectionLevel affectionLevel)
{
FieldInfo npcTalkField = typeof(ShopHelper).GetField("_currentNPCBeingTalkedTo", BindingFlags.Instance | BindingFlags.NonPublic);
NPC talkedNPC = (NPC)npcTalkField.GetValue(self);
// Allow Cirrus to have things to say about multiple NPCs with the same happiness level
if (talkedNPC.type == ModContent.NPCType<Cirrus>())
{
MethodInfo addReportField = typeof(ShopHelper).GetMethod("AddHappinessReportText", BindingFlags.Instance | BindingFlags.NonPublic);
FieldInfo happinessField = typeof(ShopHelper).GetField("_currentPriceAdjustment", BindingFlags.Instance | BindingFlags.NonPublic);
float currentPriceAdjustment = (float)happinessField.GetValue(self);
if (affectionLevel != 0 && Enum.IsDefined(affectionLevel))
{
// Add a suffix to the localization key which specifies the NPC's name
addReportField.Invoke(self, [ $"{affectionLevel}NPC_" + NPCID.Search.GetName(npcType), new
{
NPCName = NPC.GetFullnameByID(npcType)
}, 0]);
currentPriceAdjustment *= NPCHappiness.AffectionLevelToPriceMultiplier[affectionLevel];
happinessField.SetValue(self, currentPriceAdjustment);
}
}
else
{
orig(self, npcType, affectionLevel);
}
}
#endregion
// 02JUN2024: Ozzatron: The below code is being kept in its initial state for historic value.
#region Store The Stupid Fucking Private Wind Map In Public Property
[/*TotallyNot*/Obsolete("This function serves no purpose and is included in the Calamity source code for historic value.", error: true)]
+1 -21
View File
@@ -161,7 +161,7 @@ namespace CalamityMod.ILEditing
}
#endregion
#region Change World Generation Descriptions
#region Change Small World Description
/// <summary>
/// Changes the description of Small worlds to serve as a warning.
/// </summary>
@@ -184,26 +184,6 @@ namespace CalamityMod.ILEditing
}
/// <summary>
/// Changes the description of Master Mode to mention boss changes.
/// </summary>
private static void SwapMasterModeDescriptionKey(ILContext il)
{
// Swap vanilla's Master Mode description string (UI.WorldDescriptionMaster) with Calamity's edited version (Mods.CalamityMod.UI.WorldMaster).
var cursor = new ILCursor(il);
// Move to after the string.
if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdstr("UI.WorldDescriptionMaster")))
{
LogFailure("Change Master Mode Description", "Could not match string \"UI.WorldDescriptionMaster\".");
return;
}
// Pop this value off, then replace it with Calamity's new string.
cursor.EmitPop();
cursor.Emit(OpCodes.Ldstr, "Mods.CalamityMod.UI.WorldMaster");
}
#endregion
#region Clear temporary modded tiles
-1
View File
@@ -65,7 +65,6 @@ namespace CalamityMod.Items.Accessories
CreateRecipe().
AddIngredient<AbyssalDivingGear>().
AddIngredient<AnechoicPlating>().
AddIngredient<IronBoots>().
AddIngredient(ItemID.LunarBar, 5).
AddIngredient<MolluskHusk>(15).
AddTile(TileID.LunarCraftingStation).
+11 -1
View File
@@ -1,4 +1,5 @@
using CalamityMod.CalPlayer;
using System.Collections.Generic;
using CalamityMod.CalPlayer;
using CalamityMod.Items.Materials;
using Microsoft.Xna.Framework;
using Terraria;
@@ -37,6 +38,15 @@ namespace CalamityMod.Items.Accessories
Lighting.AddLight(player.Center, new Vector3(1.2f, 1.2f, 0.72f));
}
public override void ModifyTooltips(List<TooltipLine> list)
{
var player = Main.LocalPlayer;
if (player != null)
{
list.FindAndReplace("[REGEN]", (player.Calamity().ambrosialAmpouleRegen + player.Calamity().alwaysHoneyRegenAmount).ToString("0.##"));
}
}
public override void AddRecipes()
{
CreateRecipe().
+2
View File
@@ -19,6 +19,8 @@ namespace CalamityMod.Items.Accessories
public override void UpdateAccessory(Player player, bool hideVisual)
{
player.pickSpeed -= 0.1f;
player.Calamity().aFossil = true;
player.Calamity().fallingBlockProtection = true;
}
public override void AddRecipes()
+14 -9
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 = 20;
Item.width = 56;
Item.height = 34;
Item.value = CalamityGlobalItem.RarityOrangeBuyPrice;
Item.rare = ItemRarityID.Orange;
Item.accessory = true;
@@ -20,20 +20,25 @@ namespace CalamityMod.Items.Accessories
public override void UpdateAccessory(Player player, bool hideVisual)
{
player.pickSpeed -= 0.15f;
if (player.ZoneDirtLayerHeight || player.ZoneRockLayerHeight || player.ZoneUnderworldHeight)
{
player.statDefense += 10;
player.endurance += 0.05f;
}
player.pickSpeed -= 0.3f;
player.Calamity().aPowder = true;
player.Calamity().fallingBlockProtection = true;
player.Calamity().trapProtection = true;
// Doesn't stack with downgrades
if (player.chiselSpeed)
player.pickSpeed += 0.15f;
if (player.Calamity().aFossil)
player.pickSpeed += 0.1f;
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<AncientFossil>().
AddIngredient(ItemID.AncientChisel).
AddIngredient<AncientBoneDust>(3).
AddIngredient<ScorchedBone>(15).
AddIngredient<ScorchedBone>(10).
AddIngredient(ItemID.Bone, 15).
AddTile(TileID.Anvils).
Register();
Binary file not shown.

Before

Width:  |  Height:  |  Size: 645 B

After

Width:  |  Height:  |  Size: 1.1 KiB

+2
View File
@@ -30,6 +30,8 @@ namespace CalamityMod.Items.Accessories
CalamityPlayer modPlayer = player.Calamity();
modPlayer.ascendantInsignia = true;
player.empressBrooch = true;
player.moveSpeed += 0.05f;
player.jumpSpeedBoost += 0.25f;
}
public override void AddRecipes()
+2 -2
View File
@@ -19,11 +19,11 @@ namespace CalamityMod.Items.Accessories
public Color? TooltipExtensionColor => new(195, 223, 255);
public const int ShieldSlamDamage = 900;
public const int ShieldSlamDamage = 1000;
public const float ShieldSlamKnockback = 15f;
public const int ShieldSlamIFrames = 12;
public const int RamExplosionDamage = 450;
public const int RamExplosionDamage = 300;
public const float RamExplosionKnockback = 20f;
public override void SetDefaults()
+2 -2
View File
@@ -99,7 +99,7 @@ namespace CalamityMod.Items.Accessories
// If this reduces the player's health to zero, make sure they actually die.
if (player.statLife <= 0)
{
player.KillMe(PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.ChaliceOfTheBloodGod" + Main.rand.Next(1, 18 + 1)).Format(player.name)), modPlayer.chaliceBleedoutBuffer, 0, false);
player.KillMe(PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.ChaliceOfTheBloodGod" + Main.rand.Next(1, 18 + 1)).ToNetworkText(player.name)), modPlayer.chaliceBleedoutBuffer, 0, false);
}
}
@@ -137,7 +137,7 @@ namespace CalamityMod.Items.Accessories
{
// Death message changes depending on whether it was the last few drips of an "honored" bleed, or attempting to cheat by removing the accessory.
string deathMessageKey = modPlayer.chaliceOfTheBloodGod ? "Status.Death.ChaliceOfTheBloodGodClose" : "Status.Death.ChaliceOfTheBloodGodUnequip";
player.KillMe(PlayerDeathReason.ByCustomReason(CalamityUtils.GetText(deathMessageKey).Format(player.name)), modPlayer.chaliceBleedoutBuffer, 0, false);
player.KillMe(PlayerDeathReason.ByCustomReason(CalamityUtils.GetText(deathMessageKey).ToNetworkText(player.name)), modPlayer.chaliceBleedoutBuffer, 0, false);
}
}
+6 -1
View File
@@ -58,6 +58,11 @@ namespace CalamityMod.Items.Accessories
// Special search radius for coin ricoshots that only applies to DSO targets.
public static readonly float RicoshotSearchDistance = 2800f;
/// <summary>
/// The maximum amount of extra critical strike chance you can get from this accessory.
/// </summary>
public static readonly int CritHardCap = 100;
#endregion
public override void SetDefaults()
@@ -115,7 +120,7 @@ namespace CalamityMod.Items.Accessories
modPlayer.spiritOriginCritBoost = currentCritBoost;
// Actually give the crit boost as a direct increase to ranged critical strike chance.
player.GetCritChance<RangedDamageClass>() += modPlayer.spiritOriginCritBoost;
player.GetCritChance<RangedDamageClass>() += Math.Min(modPlayer.spiritOriginCritBoost, CritHardCap);
// Display the current crit boost on a cooldown.
if (modPlayer.cooldowns.TryGetValue(DaawnlightSpiritOriginExtraCrit.ID, out var cooldown))
+6 -3
View File
@@ -1,4 +1,5 @@
using CalamityMod.Items.Materials;
using System.Collections.Generic;
using CalamityMod.Items.Materials;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -22,10 +23,12 @@ namespace CalamityMod.Items.Accessories
{
player.Calamity().deadshotBrooch = true;
player.Calamity().rangedAmmoCost *= 0.8f;
player.GetDamage<RangedDamageClass>() += 0.1f;
player.GetCritChance<RangedDamageClass>() += 5;
player.GetDamage<RangedDamageClass>() += 0.12f;
player.GetCritChance<RangedDamageClass>() += 7;
}
public override void ModifyTooltips(List<TooltipLine> tooltips) => tooltips.IntegrateHotkey(CalamityKeybinds.AmmoCycleHotkey);
public override void AddRecipes()
{
CreateRecipe().
+1 -1
View File
@@ -13,7 +13,7 @@ namespace CalamityMod.Items.Accessories
public class DynamoStemCells : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
public const int MiniSwamerCooldown = 180;
public const int MiniSwarmerCooldown = 180;
public static int MiniSwamerDamage = 1000;
public override void SetStaticDefaults()
{
+2 -2
View File
@@ -16,11 +16,11 @@ namespace CalamityMod.Items.Accessories
public bool HasFlavorTooltip => true;
public Color? TooltipExtensionColor => new(195, 223, 255);
public const int ShieldSlamDamage = 400;
public const int ShieldSlamDamage = 500;
public const float ShieldSlamKnockback = 12f;
public const int ShieldSlamIFrames = 12;
public const int RamExplosionDamage = 200;
public const int RamExplosionDamage = 100;
public const float RamExplosionKnockback = 15f;
public override void SetDefaults()
+1 -1
View File
@@ -42,7 +42,7 @@ namespace CalamityMod.Items.Accessories
AddRecipeGroup("AnyGoldCrown").
AddIngredient<AerialiteBar>(6).
AddIngredient(ItemID.Feather, 8).
AddTile(TileID.SkyMill).
AddTile(TileID.Anvils).
Register();
}
}
+5 -6
View File
@@ -1,4 +1,5 @@
using CalamityMod.Buffs.Summon;
using System;
using CalamityMod.Buffs.Summon;
using CalamityMod.CalPlayer;
using CalamityMod.Projectiles.Typeless;
using Microsoft.Xna.Framework;
@@ -17,17 +18,15 @@ namespace CalamityMod.Items.Accessories
Item.height = 36;
Item.value = CalamityGlobalItem.RarityOrangeBuyPrice;
Item.rare = ItemRarityID.Orange;
Item.defense = 5;
Item.accessory = true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
float damageIncrease = 0.2f;
float moveSpeedIncrease = 0.2f;
float statPower = (float)Math.Round(0.2f * Utils.GetLerpValue(1, 0.5f, ((float)player.statLife / (float)player.statLifeMax2), true), 2);
player.Calamity().gladiatorSword = true;
player.GetDamage<GenericDamageClass>() += damageIncrease - (damageIncrease * player.statLife / player.statLifeMax2);
player.moveSpeed += moveSpeedIncrease - (moveSpeedIncrease * player.statLife / player.statLifeMax2);
player.GetDamage<GenericDamageClass>() += statPower;
player.moveSpeed += statPower;
}
}
}
+1 -1
View File
@@ -31,7 +31,7 @@ namespace CalamityMod.Items.Accessories
AddIngredient<AerialiteBar>(2).
AddIngredient(ItemID.SunplateBlock, 2).
AddIngredient(ItemID.Feather, 5).
AddTile(TileID.SkyMill).
AddTile(TileID.Anvils).
Register();
}
}
+1 -4
View File
@@ -1,9 +1,6 @@
using CalamityMod.CalPlayer;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.DataStructures;
using Terraria.GameContent;
using Terraria.ID;
using Terraria.ModLoader;
@@ -13,7 +10,7 @@ namespace CalamityMod.Items.Accessories
{
public new string LocalizationCategory => "Items.Accessories";
// The percentage of a full Rage bar that is gained every second with Heart of Darkness equipped.
public const float RagePerSecond = 0.01f;
public const float RagePerSecond = 0.02f;
public override void SetStaticDefaults()
{
+1
View File
@@ -26,6 +26,7 @@ namespace CalamityMod.Items.Accessories
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.ironBoots = true;
player.noFallDmg = true;
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 522 B

After

Width:  |  Height:  |  Size: 672 B

+2 -1
View File
@@ -10,7 +10,7 @@ namespace CalamityMod.Items.Accessories
public class LeviathanAmbergris : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
public static int ambergrisDashDamage = 90;
public static int ambergrisDashDamage = 650;
public override void SetDefaults()
{
Item.width = 20;
@@ -24,6 +24,7 @@ namespace CalamityMod.Items.Accessories
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.lAmbergris = true;
modPlayer.lAmbergrisVisual = !hideVisual;
}
}
}
+12 -1
View File
@@ -50,7 +50,18 @@ namespace CalamityMod.Items.Accessories
if (player.ownedProjectileCounts[ProjectileType<Luxor>()] < 1 && !player.dead)
{
Projectile lux = Projectile.NewProjectileDirect(player.GetSource_FromThis(), player.Center, Vector2.Zero, ProjectileType<Luxor>(), 0, 0f, player.whoAmI);
Projectile.NewProjectileDirect(player.GetSource_FromThis(), player.Center, Vector2.Zero, ProjectileType<Luxor>(), 0, 0f, player.whoAmI);
}
}
public override void UpdateVanity(Player player)
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.luxorsGiftVanity = true;
if (player.ownedProjectileCounts[ProjectileType<Luxor>()] < 1 && !player.dead)
{
Projectile.NewProjectileDirect(player.GetSource_FromThis(), player.Center, Vector2.Zero, ProjectileType<Luxor>(), 0, 0f, player.whoAmI);
}
}
}
@@ -92,6 +92,8 @@ namespace CalamityMod.Items.Accessories
Projectile.tileCollide = false;
Projectile.ArmorPenetration = 20;
Projectile.netImportant = true;
Projectile.usesIDStaticNPCImmunity = true;
Projectile.idStaticNPCHitCooldown = 10;
}
public override void AI()
-2
View File
@@ -24,7 +24,6 @@ namespace CalamityMod.Items.Accessories
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.nanotech = true;
modPlayer.raiderTalisman = true;
modPlayer.electricianGlove = true;
modPlayer.filthyGlove = true;
modPlayer.bloodyGlove = true;
@@ -36,7 +35,6 @@ namespace CalamityMod.Items.Accessories
{
CreateRecipe().
AddIngredient<RogueEmblem>().
AddIngredient<RaidersTalisman>().
AddIngredient<MoonstoneCrown>().
AddIngredient<ElectriciansGlove>().
AddIngredient<AscendantSpiritEssence>(4).
+9 -1
View File
@@ -1,4 +1,5 @@
using CalamityMod.CalPlayer;
using System.Collections.Generic;
using CalamityMod.CalPlayer;
using CalamityMod.Items.Materials;
using Terraria;
using Terraria.ID;
@@ -32,5 +33,12 @@ namespace CalamityMod.Items.Accessories
AddTile(TileID.MythrilAnvil).
Register();
}
public override void ModifyTooltips(List<TooltipLine> list)
{
var player = Main.LocalPlayer;
if (player != null)
list.FindAndReplace("[DAMAGE]", (0.3f * (1 - player.statLife / (float)player.statLifeMax2)).ToPercent());
}
}
}
Loaded 100 of 1148 files, more files were not shown because too many files have changed in this diff. Show more