Merge branch '1.4.4' into evenmoressenemies

This commit is contained in:
GinYuH committed 2025-04-20 18:32:13 -07:00
commit 649f7ba53c
371 files changed
+5987 -1296

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)
-5
View File
@@ -92,11 +92,6 @@ namespace CalamityMod.Balancing
NPCSpecificBalancingChanges = new List<NPCBalancingChange>();
#region Desert Scourge
// 20% resist to true melee.
NPCSpecificBalancingChanges.AddRange(Bundle(DesertScourgeIDList.List, Do(ResistTrueMelee(0.8f))));
#endregion
#region Crabulon
// 20% resist to true melee.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<Crabulon>(), ResistTrueMelee(0.8f)));
+17
View File
@@ -242,6 +242,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
@@ -253,6 +263,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.
}
+6 -2
View File
@@ -302,6 +302,10 @@ namespace CalamityMod.CalPlayer
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;
@@ -837,7 +841,7 @@ namespace CalamityMod.CalPlayer
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;
@@ -2839,7 +2843,7 @@ namespace CalamityMod.CalPlayer
spiritOriginCritBoost = 0;
rage = 0f;
adrenaline = 0f;
raiderCritLifespan = 0f;
raiderCritLifespan = 0;
raiderSoundCooldown = 0;
gSabatonHotkeyHoldTime = 0;
gSabatonFall = 0;
+20 -4
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)
{
@@ -307,7 +317,7 @@ namespace CalamityMod.CalPlayer
{
if (dashStart)
{
Player.velocity.X *= 3f; // +200% dash speed
Player.velocity.X *= 2.2f; // +120% dash speed
int damage = (int)Player.GetBestClassDamage().ApplyTo(LeviathanAmbergris.ambergrisDashDamage);
Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ModContent.ProjectileType<LeviAmberDash>(), damage, 0f, Player.whoAmI);
}
@@ -1264,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;
}
@@ -1960,7 +1970,7 @@ namespace CalamityMod.CalPlayer
if (vortexBoosterStealthDelay > 0)
{
vortexBoosterStealthDelay--;
if (vortexBoosterStealthDelay == 1)
if (vortexBoosterStealthDelay == 1 && Player.setVortex)
Player.vortexStealthActive = true;
}
if (statisPenaltyTimer > 0)
@@ -2331,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;
@@ -4212,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)
{
+13 -4
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,7 +768,7 @@ 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);
}
}
@@ -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);
@@ -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);
}
+1 -1
View File
@@ -25,7 +25,7 @@ namespace CalamityMod.CalPlayer.Dashes
public bool strongVisuals = true;
public int lastDashDir = 0;
public override float CalculateDashSpeed(Player player) => (75f * player.moveSpeed);
public override float CalculateDashSpeed(Player player) => (70f * player.moveSpeed);
public override void OnDashEffects(Player player)
{
+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.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

+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

Binary file not shown.
@@ -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;
+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))
-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).
+2 -2
View File
@@ -9,8 +9,8 @@ namespace CalamityMod.Items.Accessories
public class RaidersTalisman : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
public const float RaiderBonus = 10f;
public const int RaiderCooldown = 10;
public const float RaiderBonus = 15f;
public const int RaiderCooldown = 10; //seconds
public static readonly SoundStyle StealthHitSound = new("CalamityMod/Sounds/Custom/RaidersTalismanStealthHit");
public override void SetDefaults()
+2 -2
View File
@@ -64,8 +64,8 @@ namespace CalamityMod.Items.Accessories
public override void SetDefaults()
{
Item.width = 38;
Item.height = 26;
Item.width = 34;
Item.height = 30;
Item.value = CalamityGlobalItem.RarityBlueBuyPrice;
Item.rare = ItemRarityID.Blue;
Item.accessory = true;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 730 B

After

Width:  |  Height:  |  Size: 741 B

+23 -3
View File
@@ -3,11 +3,23 @@ using CalamityMod.Items.Materials;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Microsoft.Xna.Framework;
namespace CalamityMod.Items.Accessories
{
public class VampiricTalisman : ModItem, ILocalizedModType
public class VampiricTalisman : ModItem, ILocalizedModType, IHoldShiftTooltipItem
{
internal const int ArmorCrunchDebuffTime = 150;
internal const int HeavyBleedingDebuffTime = 300;
internal const float StealthStrikeDamageMultiplier = 0.08f;
public const float RaiderBonus = 15f;
public bool ShowExtensionIndicator => false;
// Easter egg has a special tooltip key and color.
public string TooltipExtensionKey => "YearningForBlood";
public Color? TooltipExtensionColor => Color.Red;
public new string LocalizationCategory => "Items.Accessories";
public override void SetDefaults()
{
@@ -22,14 +34,22 @@ namespace CalamityMod.Items.Accessories
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.vampiricTalisman = true;
player.GetDamage<ThrowingDamageClass>() += 0.12f;
modPlayer.raiderTalisman = true;
modPlayer.rottenDogTooth = true;
player.Calamity().bonusStealthDamage += StealthStrikeDamageMultiplier;
//get fixed boi funny
if (Main.zenithWorld)
player.lifeRegen -= 10; //Never ending thirst
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<RogueEmblem>().
AddIngredient<RaidersTalisman>().
AddIngredient<RottenDogtooth>().
AddIngredient<SolarVeil>(10).
AddIngredient(ItemID.BrokenBatWing).
AddTile(TileID.MythrilAnvil).
Register();
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 497 B

After

Width:  |  Height:  |  Size: 519 B

+6 -7
View File
@@ -1,6 +1,7 @@
using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Ranged;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
@@ -8,20 +9,18 @@ namespace CalamityMod.Items.Ammo
{
public class HyperiusBullet : ModItem, ILocalizedModType
{
public static float overflowEfficency = 1.15f; // Multiplier applied to overflow damage done by other damage sources
public static readonly SoundStyle hit = new("CalamityMod/Sounds/Item/HyperiusOverflow");
public new string LocalizationCategory => "Items.Ammo";
public static int SplitBulletBonusDamage = 16;
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 99;
}
public override void SetDefaults()
{
Item.width = 24;
Item.height = 30;
Item.damage = 13;
Item.damage = 8;
Item.DamageType = DamageClass.Ranged;
Item.maxStack = Item.CommonMaxStack;
Item.consumable = true;
@@ -35,8 +34,8 @@ namespace CalamityMod.Items.Ammo
public override void AddRecipes()
{
CreateRecipe(150).
AddIngredient(ItemID.MusketBall, 150).
CreateRecipe(333).
AddIngredient(ItemID.MusketBall, 333).
AddIngredient<LifeAlloy>().
AddTile(TileID.MythrilAnvil).
Register();
+36 -1
View File
@@ -7,6 +7,7 @@ using CalamityMod.CalPlayer;
using CalamityMod.Enums;
using CalamityMod.Events;
using CalamityMod.Items.Accessories;
using CalamityMod.Items.Ammo;
using CalamityMod.Items.Potions;
using CalamityMod.Items.Potions.Alcohol;
using CalamityMod.Items.VanillaArmorChanges;
@@ -906,6 +907,31 @@ namespace CalamityMod.Items
}
#endregion
public override void OnHitNPC(Item item, Player player, NPC target, NPC.HitInfo hit, int damageDone)
{
// Hyperius Overflow
if (target.Calamity().hyperiusMarked)
{
int damage = 0;
if (target.Calamity().hyperiusDamage < damageDone)
damage = damageDone - target.Calamity().hyperiusDamage;
else
damage = damageDone;
target.Calamity().hyperiusDamage -= damage;
// Spawn overflow hit
Projectile overflow = Projectile.NewProjectileDirect(target.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType<HyperiusDamage>(), (int)(damage * HyperiusBullet.overflowEfficency), 0, player.whoAmI, target.whoAmI);
overflow.DamageType = item.DamageType;
overflow.ArmorPenetration = item.ArmorPenetration; // Takes the armor pen from what did the hit
if (target.Calamity().hyperiusDamage <= 0)
{
target.Calamity().hyperiusDamage = 0;
target.Calamity().hyperiusMarked = false;
}
}
}
#region Armor Set Changes
public override string IsArmorSet(Item head, Item body, Item legs)
{
@@ -1292,7 +1318,16 @@ namespace CalamityMod.Items
if (item.type == ItemID.TerrasparkBoots)
player.buffImmune[BuffID.OnFire] = true;
else if (item.type == ItemID.FinWings) // Boosted water abilities, faster fall in water
if (item.type == ItemID.GravityGlobe)
{
player.jumpSpeedBoost += 1.6f;
if (player.controlDown)
player.maxFallSpeed *= 1.5f;
else
player.maxFallSpeed *= 1.2f;
}
if (item.type == ItemID.FinWings) // Boosted water abilities, faster fall in water
{
if (player.IsUnderwater())
player.gills = true;
+7
View File
@@ -569,6 +569,13 @@ namespace CalamityMod.Items
if (item.healLife > 0 && Main.LocalPlayer.Calamity().healingPotionMultiplier != 1f)
EditTooltipByName("HealLife", (line) => line.Text = Language.GetOrRegister("CommonItemTooltip.RestoresLife").Format((int)(item.healLife * Main.LocalPlayer.Calamity().healingPotionMultiplier)));
if (item.type == ItemID.GravityGlobe)
EditTooltipByName("Tooltip1", (line) => line.Text = EditedTooltip("GravityGlobe"));
if (item.type == ItemID.PortableStool)
EditTooltipByName("Tooltip0", (line) => line.Text += AddedTooltip("Stepstool"));
#endregion
// For boss summon item clarity
@@ -0,0 +1,30 @@
using CalamityMod.Items.DraedonMisc;
using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables.Plates;
using CalamityMod.Tiles.DraedonStructures.CagedLights;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Placeables.FurnitureWulfrum
{
public class ChargedWulfrumWallMountedBulb : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Placeables";
public override void SetDefaults()
{
Item.DefaultToPlaceableTile(ModContent.TileType<Tiles.FurnitureWulfrum.ChargedWulfrumWallMountedBulb> ());
Item.value = Item.sellPrice(silver: 1);
}
public override void AddRecipes()
{
CreateRecipe(10).
AddIngredient<AnodizedWulfrumMetal>().
AddIngredient<WulfrumMetalScrap>().
AddIngredient<EnergyCore>().
AddTile(TileID.Anvils).
Register();
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 650 B

@@ -0,0 +1,30 @@
using CalamityMod.Items.DraedonMisc;
using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables.Plates;
using CalamityMod.Tiles.DraedonStructures.CagedLights;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Placeables.FurnitureWulfrum
{
public class WulfrumWallMountedBulb : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Placeables";
public override void SetDefaults()
{
Item.DefaultToPlaceableTile(ModContent.TileType<Tiles.FurnitureWulfrum.WulfrumWallMountedBulb> ());
Item.value = Item.sellPrice(silver: 1);
}
public override void AddRecipes()
{
CreateRecipe(10).
AddIngredient<AnodizedWulfrumMetal>().
AddIngredient<WulfrumMetalScrap>().
AddIngredient<EnergyCore>().
AddTile(TileID.Anvils).
Register();
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 668 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 241 B

After

Width:  |  Height:  |  Size: 233 B

@@ -3,7 +3,8 @@ using Terraria.ModLoader;
namespace CalamityMod.Items.Placeables.SunkenSea
{
public class RuneSand : ModItem, ILocalizedModType
[LegacyName("RuneSand")]
public class Dunesand : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Placeables";
public override void SetStaticDefaults()
@@ -12,6 +13,6 @@ namespace CalamityMod.Items.Placeables.SunkenSea
ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType<Shellstone>();
}
public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType<Tiles.SunkenSea.RuneSand>());
public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType<Tiles.SunkenSea.Dunesand>());
}
}
File renamed without changes.

Before

Width:  |  Height:  |  Size: 251 B

After

Width:  |  Height:  |  Size: 251 B

+1 -1
View File
@@ -10,7 +10,7 @@ namespace CalamityMod.Items.Placeables.SunkenSea
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 100;
ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType<RuneSand>();
ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType<Dunesand>();
}
public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType<Tiles.SunkenSea.Shellstone>());
@@ -0,0 +1,25 @@
using Terraria.ID;
using Terraria.ModLoader;
using WallTiles = CalamityMod.Walls;
namespace CalamityMod.Items.Placeables.Walls
{
public class EutrophicGlassWall : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Placeables";
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 400;
}
public override void SetDefaults() => Item.DefaultToPlaceableWall(ModContent.WallType<WallTiles.EutrophicGlassWall>());
public override void AddRecipes()
{
CreateRecipe(4).
AddIngredient<SunkenSea.EutrophicGlass>().
AddTile(TileID.WorkBenches).
Register();
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 235 B

@@ -1,5 +1,6 @@
using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables.FurnitureWulfrum;
using CalamityMod.Tiles.FurnitureWulfrum;
using Terraria.ID;
using Terraria.ModLoader;
using WallTiles = CalamityMod.Walls;
@@ -19,8 +20,7 @@ namespace CalamityMod.Items.Placeables.Walls
public override void AddRecipes()
{
CreateRecipe(8).
AddIngredient<WulfrumMetalScrap>().
AddIngredient<AnodizedWulfrumMetal>().
AddIngredient<Items.Placeables.FurnitureWulfrum.RoundedAnodizedWulfrumPanels>().
AddTile(TileID.WorkBenches).
Register();
}
@@ -0,0 +1,26 @@
using CalamityMod.Items.Placeables.FurnitureWulfrum;
using Terraria.ID;
using Terraria.ModLoader;
using WallTiles = CalamityMod.Walls;
namespace CalamityMod.Items.Placeables.Walls
{
public class WulfrumSheetWall : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Placeables";
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 400;
}
public override void SetDefaults() => Item.DefaultToPlaceableWall(ModContent.WallType<WallTiles.WulfrumSheetWall>());
public override void AddRecipes()
{
CreateRecipe(4).
AddIngredient<WulfrumSheets>().
AddTile(TileID.WorkBenches).
Register();
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 460 B

@@ -0,0 +1,26 @@
using CalamityMod.Items.Placeables.FurnitureWulfrum;
using Terraria.ID;
using Terraria.ModLoader;
using WallTiles = CalamityMod.Walls;
namespace CalamityMod.Items.Placeables.Walls
{
public class WulfrumSidingWall : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Placeables";
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 400;
}
public override void SetDefaults() => Item.DefaultToPlaceableWall(ModContent.WallType<WallTiles.WulfrumSidingWall>());
public override void AddRecipes()
{
CreateRecipe(4).
AddIngredient<WulfrumSiding>().
AddTile(TileID.WorkBenches).
Register();
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 320 B

@@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
Item.width = 70;
Item.height = 30;
Item.DamageType = DamageClass.Ranged;
Item.damage = 60;
Item.damage = 69;
Item.knockBack = 7f;
Item.useTime = Item.useAnimation = 8;
Item.autoReuse = true;
@@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
Item.width = 26;
Item.height = 78;
Item.DamageType = DamageClass.Ranged;
Item.damage = 57;
Item.damage = 50;
Item.knockBack = 0.8f;
Item.useTime = Item.useAnimation = 14;
Item.autoReuse = true;
+1 -2
View File
@@ -19,7 +19,6 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
public new string LocalizationCategory => "Items.Weapons.DraedonsArsenal";
public static readonly SoundStyle FireSound = new("CalamityMod/Sounds/Item/PulseRifleFire") { Volume = 0.8f };
private int BaseDamage = 990;
public int FiringTimer = 30;
public override void SetDefaults()
@@ -29,7 +28,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
Item.width = 100;
Item.height = 32;
Item.DamageType = DamageClass.Ranged;
Item.damage = BaseDamage;
Item.damage = 720;
Item.useAnimation = Item.useTime = 55;
Item.knockBack = 0.25f;
Item.shoot = ModContent.ProjectileType<PulseRifleShot>();
@@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
Item.width = 64;
Item.height = 36;
Item.DamageType = DamageClass.Ranged;
Item.damage = 135;
Item.damage = 150;
Item.knockBack = 4f;
Item.useTime = 30;
Item.useAnimation = 30;
+3 -3
View File
@@ -8,13 +8,13 @@ namespace CalamityMod.Items.Weapons.Magic
public class GloriousEnd : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Magic";
public static int PlayerExplosionDmgMin = 50;
public static int PlayerExplosionDmgMax = 60;
public static int PlayerExplosionDmgMin = 60;
public static int PlayerExplosionDmgMax = 80;
public override void SetDefaults()
{
Item.width = 30;
Item.height = 58;
Item.damage = 120;
Item.damage = 100;
Item.knockBack = 10f;
Item.useAnimation = Item.useTime = 30;
Item.mana = 20;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 919 B

After

Width:  |  Height:  |  Size: 723 B

+77 -7
View File
@@ -1,11 +1,14 @@
using CalamityMod.Items.BaseItems;
using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Melee;
using CalamityMod.Rarities;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using CalamityMod.Dusts;
using CalamityMod.Items.BaseItems;
using CalamityMod.Items.Materials;
using CalamityMod.Particles;
using CalamityMod.Projectiles.Melee;
using CalamityMod.Projectiles.Typeless;
using CalamityMod.Rarities;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.Audio;
using Terraria.DataStructures;
@@ -18,6 +21,10 @@ namespace CalamityMod.Items.Weapons.Melee
{
public new string LocalizationCategory => "Items.Weapons.Melee";
public static readonly SoundStyle GrandDadEasterEggSound = new("CalamityMod/Sounds/Custom/GFB/GrandDad");
public Vector2 oldVel = Vector2.Zero;
public int time = 0;
public float highestSpeed = 0;
public bool hitFloor = false;
public override void SetDefaults()
{
Item.width = 124;
@@ -57,7 +64,70 @@ namespace CalamityMod.Items.Weapons.Melee
AddTile(TileID.LunarCraftingStation).
Register();
}
public override void OnSpawn(IEntitySource source)
{
time = 0;
hitFloor = false;
}
public override void Update(ref float gravity, ref float maxFallSpeed)
{
Vector2 place = Item.Center + Vector2.UnitY * 48;
if (time == 0 && Item.velocity.Y != 0)
{
oldVel = Item.velocity;
Item.velocity = new Vector2(Math.Sign(Item.velocity.X) * 20, -10);
}
if (oldVel.Y != 0 && Item.velocity.Y == 0)
{
time = 0;
float power = Utils.GetLerpValue(35, 75, highestSpeed, true) * 2;
if (Main.LocalPlayer.Calamity().GeneralScreenShakePower < 3.5f * power)
Main.LocalPlayer.Calamity().GeneralScreenShakePower = 3.5f * power;
if (power > 0.25f)
{
float blastSize = 150 * power;
float minMultiplier = 0.3f;
int hitsToMinMult = 8;
Projectile blast = Projectile.NewProjectileDirect(Item.GetSource_FromThis(), place, Vector2.Zero, ModContent.ProjectileType<BasicBurst>(), (int)(Item.damage * 2 * power), -35 * power, -1, blastSize, minMultiplier, hitsToMinMult);
blast.timeLeft = 5;
int particleNumber = (int)Math.Max(15 * power, 2);
for (int i = -particleNumber; i <= particleNumber; i++)
{
Particle sparks = new AltSparkParticle(place, (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.Blue, Color.DodgerBlue, 0.3f) : Color.Gold);
GeneralParticleHandler.SpawnParticle(sparks);
Dust dust = Dust.NewDustPerfect(place, ModContent.DustType<VoidDust>(), (Vector2.UnitX * (5 + Math.Abs(i)) * Math.Sign(i)).RotatedByRandom(0.25f) * Main.rand.NextFloat(0.5f, 1) * power, 0, default, Main.rand.NextFloat(0.85f, 1.2f) * power);
dust.noGravity = true;
dust.color = Main.rand.NextBool() ? Color.Blue : Color.DodgerBlue;
}
SoundStyle sound = new("CalamityMod/Sounds/NPCHit/ExoHit3");
SoundEngine.PlaySound(sound with { Volume = 0.6f * power, Pitch = Main.rand.NextFloat(0.4f, 0.6f) }, Item.Center);
SoundStyle sound2 = new("CalamityMod/Sounds/NPCHit/ThanatosHitOpen1");
SoundEngine.PlaySound(sound2 with { Volume = 0.45f * power, Pitch = -0.2f }, Item.Center);
}
highestSpeed = 0;
}
if (Item.velocity.Y != 0)
{
if (Item.velocity.Y > 0 && Item.velocity.Y < 75)
{
Item.velocity.X *= 0.98f;
Item.velocity.Y += 0.35f;
Item.velocity.Y *= 1.15f;
}
else
Item.velocity.Y += 0.55f;
time++;
if (highestSpeed < Item.velocity.Y)
highestSpeed = Item.velocity.Y;
}
gravity = 0;
maxFallSpeed = 75;
oldVel = Item.velocity;
}
public override void OnCreated(ItemCreationContext context)
{
if (Main.zenithWorld)
+23 -7
View File
@@ -12,6 +12,7 @@ namespace CalamityMod.Items.Weapons.Ranged
{
public class AcesHigh : ModItem, ILocalizedModType
{
public int shots = 0;
public new string LocalizationCategory => "Items.Weapons.Ranged";
public override void SetDefaults()
{
@@ -42,7 +43,12 @@ namespace CalamityMod.Items.Weapons.Ranged
{
return new Vector2(-5, 0);
}
public override bool CanConsumeAmmo(Item ammo, Player player)
{
if (Main.rand.Next(0, 100) < 80)
return false;
return true;
}
public override void AddRecipes()
{
CreateRecipe().
@@ -56,13 +62,23 @@ namespace CalamityMod.Items.Weapons.Ranged
public override void ModifyShootStats(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback)
{
type = Utils.SelectRandom(Main.rand, new int[]
shots++;
switch (shots)
{
ModContent.ProjectileType<CardHeart>(),
ModContent.ProjectileType<CardSpade>(),
ModContent.ProjectileType<CardDiamond>(),
ModContent.ProjectileType<CardClub>()
});
case 4:
type = ModContent.ProjectileType<CardSpade>();
shots = 0;
break;
case 3:
type = ModContent.ProjectileType<CardDiamond>();
break;
case 2:
type = ModContent.ProjectileType<CardClub>();
break;
default:
type = ModContent.ProjectileType<CardHeart>();
break;
}
}
}
}
+1 -2
View File
@@ -21,8 +21,7 @@ namespace CalamityMod.Items.Weapons.Ranged
Item.DamageType = DamageClass.Ranged;
Item.damage = 740;
Item.knockBack = 16f;
Item.useTime = 84;
Item.useAnimation = 84;
Item.useTime = Item.useAnimation = 74;
Item.autoReuse = true;
Item.useStyle = ItemUseStyleID.Shoot;
+32 -10
View File
@@ -1,4 +1,5 @@
using CalamityMod.Dusts;
using CalamityMod.Cooldowns;
using CalamityMod.Dusts;
using CalamityMod.Particles;
using CalamityMod.Projectiles.Ranged;
using CalamityMod.Rarities;
@@ -8,6 +9,7 @@ using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.CalPlayer;
namespace CalamityMod.Items.Weapons.Ranged
{
@@ -19,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Ranged
public bool Trail = true;
public int shotCount = 0;
public static int boomTime = 60;
public static int boomTime = 6;
public override Color? TooltipExtensionColor => new Color(255, 140, 0);
@@ -56,20 +58,40 @@ namespace CalamityMod.Items.Weapons.Ranged
// Right click consumes ammo at the same rate but faster at spewing
public override float UseTimeMultiplier(Player player) => player.altFunctionUse == 2 ? 0.5f : 1f;
public override void HoldItem(Player player)
{
int max = player.Calamity().furyFuelMax;
if (player.Calamity().cooldowns.TryGetValue(FuryFuel.ID, out var cooldown))
{
cooldown.timeLeft = max - player.Calamity().furyFuel;
}
else
{
player.AddCooldown(FuryFuel.ID, max);
}
}
public override bool CanConsumeAmmo(Item ammo, Player player)
{
return (player.altFunctionUse != 2); // Right click doesn't use ammo, it's crystal powder not gel
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
if (player.altFunctionUse == 2)
{
Vector2 newVel = velocity.RotatedByRandom(MathHelper.ToRadians(5f));
Projectile.NewProjectile(source, position, newVel, ModContent.ProjectileType<PristineSecondary>(), (int) (damage * 0.7f), knockback, player.whoAmI); //.7x base damage
player.Calamity().furyRefuelTimer = -50;
if (player.Calamity().furyFuel > 0)
{
Vector2 newVel = velocity.RotatedByRandom(MathHelper.ToRadians(5f));
Projectile.NewProjectile(source, position, newVel, ModContent.ProjectileType<PristineSecondary>(), (int)(damage * 0.25f), knockback, player.whoAmI); //.25x base damage
Dust dust = Dust.NewDustPerfect(position + velocity * 3f + new Vector2(0, -3), ModContent.DustType<LightDust>(), velocity.RotatedBy(0.25f * player.direction).RotatedByRandom(0.35f) * Main.rand.NextFloat(0.5f, 2.5f), 0, default, Main.rand.NextFloat(0.4f, 0.8f));
dust.noGravity = true;
dust.color = Color.Orchid;
Dust dust = Dust.NewDustPerfect(position + velocity * 3f + new Vector2(0, -3), ModContent.DustType<LightDust>(), velocity.RotatedBy(0.25f * player.direction).RotatedByRandom(0.35f) * Main.rand.NextFloat(0.5f, 2.5f), 0, default, Main.rand.NextFloat(0.4f, 0.8f));
dust.noGravity = true;
dust.color = Color.Orchid;
CritSpark spark = new CritSpark(position + velocity * 3f + new Vector2(0, -3), velocity.RotatedBy(0.25f * player.direction).RotatedByRandom(0.25f) * Main.rand.NextFloat(0.2f, 1.8f), Color.White, Color.Orchid, 0.9f, 18, 2f, 2.2f);
GeneralParticleHandler.SpawnParticle(spark);
CritSpark spark = new CritSpark(position + velocity * 3f + new Vector2(0, -3), velocity.RotatedBy(0.25f * player.direction).RotatedByRandom(0.25f) * Main.rand.NextFloat(0.2f, 1.8f), Color.White, Color.Orchid, 0.9f, 18, 2f, 2.2f);
GeneralParticleHandler.SpawnParticle(spark);
player.Calamity().furyFuel -= 15;
}
}
else
{
+1 -1
View File
@@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Ranged
{
Item.width = 74;
Item.height = 126;
Item.damage = 116;
Item.damage = 101;
Item.DamageType = DamageClass.Ranged;
Item.useTime = 3;
Item.useAnimation = 25;
+1 -1
View File
@@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Ranged
{
Item.width = 150;
Item.height = 48;
Item.damage = 2000;
Item.damage = 2150;
Item.knockBack = 9.5f;
Item.DamageType = DamageClass.Ranged;
Item.useTime = 60;
@@ -1599,6 +1599,12 @@ YoungDukeBuff: {
}
// Misc
HyperiusCollapse: {
DisplayName: Hyperius Collapse
Description: You should never see this...
}
PopoBuff: {
DisplayName: Popo
Description: You are a snowman now!
@@ -1042,7 +1042,7 @@ LeviathanAmbergris: {
DisplayName: Leviathan Ambergris
Tooltip:
'''
200% increased initial dash velocity, 33% faster dash cooldown, and greatly increased dash deceleration
120% increased initial dash velocity, 33% faster dash cooldown, and greatly increased dash deceleration
Your dashes are empowered by water, knocking back and damaging nearby enemies with viscous currents
Visual effects are reduced if visibility is disabled
'''
@@ -1402,7 +1402,7 @@ RadiantOoze: {
RaidersTalisman: {
DisplayName: Raider's Talisman
Tooltip: Stealth strikes grant 10% critical strike chance to non-stealth strikes for 5 seconds
Tooltip: Stealth strikes grant 15% critical strike chance to non-stealth strikes for 10 seconds
}
RampartofDeities: {
@@ -1463,7 +1463,7 @@ RottenBrain: {
RottenDogtooth: {
DisplayName: Rotten Dogtooth
Tooltip: Stealth strikes inflict Crumbling and deal 8% more damage
Tooltip: Stealth strikes inflict Crumbling for 2.5 seconds and deal 8% more damage
}
RoverDrive: {
@@ -1975,8 +1975,11 @@ VampiricTalisman: {
Tooltip:
'''
Rogue critical strikes steal enemy life
12% increased rogue damage
Stealth strikes grant 15% critical strike chance and increased lifesteal to non-stealth strikes for 10 seconds
Stealth strikes inflict Heavy Bleeding and Armor Crunch, and deal 8% more damage
'Possessing the talisman makes you yearn for blood'
'''
YearningForBlood: THIS ENDLESS HUNGER WON'T END
}
VeneratedLocket: {
@@ -99,7 +99,14 @@ HolyFireBullet: {
HyperiusBullet: {
DisplayName: Hyperius Bullet
Tooltip: Dazzling multicolor bullets that split into swirling lights on impact
Tooltip:
'''
Dazzling multicolor bullets that split into swirling lights on impact
Damage that would be dealt from the bullets is instead stored on the target
As more damage is stored, it will begin to overflow, slowly releasing and damaging the enemy
Attacks from sources other than Hyperius Bullets will release some of the charge
Releasing charge in this way deals 15% more damage
'''
}
IcicleArrow: {
@@ -4283,3 +4283,33 @@ WulfrumPanelWall: {
DisplayName: Wulfrum Panel Wall
Tooltip: ""
}
ChargedWulfrumWallMountedBulb: {
DisplayName: Mods.CalamityMod.Items.Placeables.ChargedWulfrumWallMountedBulb.DisplayName
Tooltip: ""
}
WulfrumWallMountedBulb: {
DisplayName: Mods.CalamityMod.Items.Placeables.WulfrumWallMountedBulb.DisplayName
Tooltip: ""
}
WulfrumSheetWall: {
DisplayName: Wulfrum Sheet Wall
Tooltip: ""
}
WulfrumSidingWall: {
DisplayName: Wulfrum Siding Wall
Tooltip: ""
}
Dunesand: {
DisplayName: Dunesand
Tooltip: ""
}
EutrophicGlassWall: {
DisplayName: Eutrophic Glass Wall
Tooltip: ""
}
@@ -7,6 +7,7 @@ AcesHigh: {
Spades pierce enemies
Diamonds violently explode
Clubs split into three
80% chance to save ammo
'''
}
@@ -988,7 +989,7 @@ PristineFury: {
Tooltip:
'''
Fires an intense helix of flames that burst into a column of smoke
<right> to disperse flammable crystalline powder
<right> to disperse a limited supply of flammable crystalline powder that restores over time
Powder can be ignited, causuing it to explode for extra damage
Both helix flames and other nearby explosions can ignite the powder
Uses gel for ammo
@@ -107,7 +107,7 @@ HydraHead.DisplayName: Hydra Head
HydraHeadLaunch.DisplayName: Hydra Head
HydrasBlood.DisplayName: Hydra's Blood
HyperiusBulletProj.DisplayName: Hyperius Bullet
HyperiusSplit.DisplayName: Hyperius Bad Time
HyperiusSplit.DisplayName: Hyperius Fragment
IcicleArrowProj.DisplayName: Icicle Arrow
HailstormBulletProj.DisplayName: Hailstorm Bullet
HallowPointRoundProj.DisplayName: Hallow-Point Round
@@ -78,6 +78,8 @@ HydrothermalSmoke.DisplayName: Smoke
HydrothermicFlare.DisplayName: Hydrothermic Flare
HydrothermicFlareRogue.DisplayName: Hydrothermic Flare
HydrothermicSphere.DisplayName: Hydrothermic Sphere
HyperiusDamage.DisplayName: Hyperius Overflow
HyperiusBleed.DisplayName: Hyperius Bleed
JewelSpike.DisplayName: Spike
KelvinCatalystStar.DisplayName: Kelvin Catalyst Star
LeviAmberDash.DisplayName: Riptide Slam
+5 -1
View File
@@ -20,7 +20,7 @@ StealthInfoText:
'''
// Difficulty UI
DifficultyStatusText: "{0} is {1}."
ModeAppend: " Mode"
ModeAppend: "{0} Mode"
Active: Active
NotActive: Not active
DifficultyShiftText: "[c/737373:Hold the 'Shift' key for more information]"
@@ -92,6 +92,7 @@ Cooldowns: {
DSOCritCooldown: Extra Critical Strike Chance
ParryCooldown: Parry Ability Cooldown
FleshTotem: Contact Damage Halving Cooldown
FuryFuel: Crystal Powder
GaelsRage: Gael's Greatsword Rage Cooldown
GlobalDodge: Dodge Cooldown
GodSlayerDash: God Slayer Dash Cooldown
@@ -114,6 +115,7 @@ Cooldowns: {
PrismaticLaser: Prismatic Laser Barrage Cooldown
ProfanedSoulShieldDurability: Profaned Soul Shield Durability
ProfanedSoulShieldRecharge: Profaned Soul Shield Recharge
RaiderBoost: Extra Critical Chance
RelicOfResilienceCooldown: Relic of Resilience Cooldown
RogueBooster: Rogue Booster Cooldown
SandCloak: Sand Cloak Cooldown
@@ -587,6 +589,8 @@ Lecherous: {
Disenchant: Disenchant
// Worldgen Tasks
BetterUnderworld: Creating a smoother underworld
AshIslandLavaRemoval: Removing lava from ash island
EvilIslandCorrupt: Adding a putrid floating island
EvilIslandCrimson: Adding a grotesque floating island
AstralChest: Placing an astral chest
@@ -29,6 +29,7 @@ AddedTooltip: {
WarmthPotion: Greatly reduces the duration of Chilled, Frozen, and Glacial State
HandWarmer: Provides a regeneration boost while wearing the Snow armor
GoldenFishingRod: Its fishing line will never break
Stepstool: Standing on the stool grants 5% increased critical strike chance
Tombstones:
'''
13 of any tombstone turns the surrounding area into a graveyard
@@ -274,6 +275,12 @@ EditedTooltip: {
ApprenticeAltHead: 10% increased summon & magic damage
ApprenticeAltShirt: 15% increased summon damage and 10% increased magic damage
ApprenticeAltPants: 10% increased summon damage
GravityGlobe:
'''
Provides 32% increased jump speed and increased fall speed
Press UP to change gravity
Press DOWN to fall faster
'''
}
// Buff Descriptions
@@ -13,6 +13,7 @@ using Terraria.ModLoader;
namespace CalamityMod.NPCs.AquaticScourge
{
[HasPierceResist]
[LongDistanceNetSync(SyncWith = typeof(AquaticScourgeHead))]
public class AquaticScourgeBody : ModNPC
{
@@ -13,6 +13,7 @@ using Terraria.ModLoader;
namespace CalamityMod.NPCs.AquaticScourge
{
[HasPierceResist]
[LongDistanceNetSync(SyncWith = typeof(AquaticScourgeHead))]
public class AquaticScourgeBodyAlt : ModNPC
{
@@ -34,6 +34,7 @@ using Terraria.ModLoader;
namespace CalamityMod.NPCs.AquaticScourge
{
[AutoloadBossHead]
[HasPierceResist]
[LongDistanceNetSync]
public class AquaticScourgeHead : ModNPC
{
@@ -13,6 +13,7 @@ using Terraria.ModLoader;
namespace CalamityMod.NPCs.AquaticScourge
{
[HasPierceResist]
[LongDistanceNetSync(SyncWith = typeof(AquaticScourgeHead))]
public class AquaticScourgeTail : ModNPC
{
+6 -3
View File
@@ -121,9 +121,12 @@ namespace CalamityMod.NPCs.Astral
{
NPC.ai[1] = 0f;
int n = NPC.NewNPC(NPC.GetSource_FromAI(), (int)spawnPoint.X, (int)spawnPoint.Y, ModContent.NPCType<AstralSeekerSpit>());
Main.npc[n].Center = spawnPoint;
Main.npc[n].velocity = vector * (CalamityWorld.death ? 12f : CalamityWorld.revenge ? 11f : 10f);
if (Main.netMode != NetmodeID.MultiplayerClient)
{
int n = NPC.NewNPC(NPC.GetSource_FromAI(), (int)spawnPoint.X, (int)spawnPoint.Y, ModContent.NPCType<AstralSeekerSpit>());
Main.npc[n].Center = spawnPoint;
Main.npc[n].velocity = vector * (CalamityWorld.death ? 12f : CalamityWorld.revenge ? 11f : 10f);
}
}
else if (NPC.ai[1] >= 140f) //oozin dust at the "mouth"
{
+1
View File
@@ -35,6 +35,7 @@ using Terraria.ModLoader;
namespace CalamityMod.NPCs.AstrumAureus
{
[AutoloadBossHead]
[HasPierceResist(singleHitbox: true)]
public class AstrumAureus : ModNPC
{
public static readonly SoundStyle HitSound = new("CalamityMod/Sounds/NPCHit/AureusHit", 4);
+1
View File
@@ -15,6 +15,7 @@ using Terraria.ModLoader;
namespace CalamityMod.NPCs.AstrumDeus
{
[HasPierceResist]
[LongDistanceNetSync(SyncWith = typeof(AstrumDeusHead))]
public class AstrumDeusBody : ModNPC
{
+1
View File
@@ -35,6 +35,7 @@ using Terraria.ModLoader;
namespace CalamityMod.NPCs.AstrumDeus
{
[AutoloadBossHead]
[HasPierceResist]
[LongDistanceNetSync]
public class AstrumDeusHead : ModNPC
{
+1
View File
@@ -15,6 +15,7 @@ using Terraria.ModLoader;
namespace CalamityMod.NPCs.AstrumDeus
{
[HasPierceResist]
[LongDistanceNetSync(SyncWith = typeof(AstrumDeusHead))]
public class AstrumDeusTail : ModNPC
{
@@ -864,8 +864,15 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityBossAIs
}
}
// Play spawn sound on Deus on the first frame because otherwise the sound wouldn't play properly in multiplayer
if (calamityGlobalNPC.newAI[1] == 0f && !doubleWormPhase)
{
SoundEngine.PlaySound(AstrumDeusHead.SpawnSound, npc.Center);
calamityGlobalNPC.newAI[1] = 1f;
}
// 5 seconds of resistance in phase 2, 10 seconds in phase 1, to prevent spawn killing
if (calamityGlobalNPC.newAI[1] < resistanceTime && ((npc.position - npc.oldPosition).Length() > 2f || calamityGlobalNPC.newAI[1] > 0f))
if (calamityGlobalNPC.newAI[1] < resistanceTime && ((npc.position - npc.oldPosition).Length() > 2f || calamityGlobalNPC.newAI[1] > 1f))
calamityGlobalNPC.newAI[1] += 1f;
// Calculate contact damage based on velocity
+222 -86
View File
@@ -72,7 +72,9 @@ using CalamityMod.UI;
using CalamityMod.UI.DebuffSystem;
using CalamityMod.Walls.DraedonStructures;
using CalamityMod.World;
using Microsoft.Build.Evaluation;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Operations;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using MonoMod.Utils;
@@ -350,6 +352,13 @@ namespace CalamityMod.NPCs
public int laserBurnTimer = 0;
public int laserBurnStacks = 0;
public bool hyperiusMarked = false;
public int hyperiusDamage = 0;
public static int hyperiusOverflowTime = 100;
public int hyperiusOverflowTimer = hyperiusOverflowTime;
public static float hyperiusLifePercentThreshold = 0.07f; // The % of max life the damage stacks must reach before they start to overflow
public int hyperiusFxTimer = 0;
/// <summary>
/// Tracks the strength of Calamity's cursor effect; increments by 2 on every frame.<br/>
/// If this value reaches <see cref="cursorFocusMax"/>, the enemy is afflicted with True Vulnerability Hex.
@@ -616,6 +625,15 @@ namespace CalamityMod.NPCs
myClone.veriumDoomTimer = veriumDoomTimer;
myClone.veriumDoomStacks = veriumDoomStacks;
myClone.veriumDoomMarked = veriumDoomMarked;
myClone.laserBurnDamage = laserBurnDamage;
myClone.laserBurnMarked = laserBurnMarked;
myClone.laserBurnStacks = laserBurnStacks;
myClone.laserBurnTimer = laserBurnTimer;
myClone.laserBurnType = laserBurnType;
myClone.hyperiusDamage = hyperiusDamage;
myClone.hyperiusMarked = hyperiusMarked;
myClone.hyperiusOverflowTimer = hyperiusOverflowTimer;
myClone.hyperiusFxTimer = hyperiusFxTimer;
myClone.cursorFocus = cursorFocus;
myClone.demonSwordImpales = demonSwordImpales;
myClone.impalePacketTimer = impalePacketTimer;
@@ -3630,6 +3648,16 @@ namespace CalamityMod.NPCs
#endregion
#region Scale Expert Multiplayer Stats
private const float VanillaScalingFactor_2Players = 1.35f;
private const float VanillaScalingFactor_3Players = 1.9166666666666666f;
/// <summary>
/// Applies Calamity's adjustments to difficulty-based player count stat scaling for NPCs. Calamity only adjusts the health of NPCs and does not touch any other stats.
/// </summary>
/// <param name="npc">The NPC which is having its stats adjusted.</param>
/// <param name="numPlayers">The number of players considered active for the purposes of stat scaling.</param>
/// <param name="balance">The vanilla Expert+ multiplayer health scalar value.</param>
/// <param name="bossAdjustment">An arbitrary float to make Master Mode easier. On Master Mode, it is 0.85, otherwise it is 1.0.</param>
public override void ApplyDifficultyAndPlayerScaling(NPC npc, int numPlayers, float balance, float bossAdjustment)
{
// Do absolutely nothing in single player, or in multiplayer with only one player connected.
@@ -3640,43 +3668,72 @@ namespace CalamityMod.NPCs
bool scalesLikeBoss = countsAsBoss || BossHPScalingList.List.Contains(npc.type);
bool isCalamityNPC = npc.ModNPC != null && npc.ModNPC.Mod == CalamityMod.Instance;
// All bosses, NPCs that are supposed to scale like bosses, and Calamity NPCs follow these rules.
if (scalesLikeBoss || isCalamityNPC)
// 14APR2025: Ozzatron: Reworked how Calamity changes the health of Expert+ multiplayer bosses
// Non-boss enemies that receive scaling in Expert+ are still reduced via the old formula
//
// TL;DR:
// - 2 players goes from 135% health to 175% health
// - 3 players goes from 191.6% health to 225% health
// - 4 players and beyond are unedited (4 players is 262.8% for reference)
// This case applies to all bosses: vanilla, Calamity, and other mods, and anything that is supposed to scale like a boss.
if (countsAsBoss || scalesLikeBoss)
{
double scalar;
switch (numPlayers) // Decrease HP in multiplayer before vanilla scaling
{
case 1:
scalar = 1.0;
break;
double adjustmentFactor = 1.0;
case 2:
scalar = 0.9; // 1.8
break;
// The 2-player boss case is too easy; 1.35x health does not even come close to justify being able to respawn.
if (numPlayers == 2)
adjustmentFactor = BalancingConstants.ExpertHealthScalingOverride_2Players / VanillaScalingFactor_2Players;
case 3:
scalar = 0.82; // 2.46
break;
// Similarly, the 3-player boss case is too easy, given the considerably higher damage output available.
else if (numPlayers == 3)
adjustmentFactor = BalancingConstants.ExpertHealthScalingOverride_3Players / VanillaScalingFactor_3Players;
case 4:
scalar = 0.76; // 3.04
break;
// Cases beyond 3 players are already sufficiently scaled by vanilla and continue to scale harder with more players.
case 5:
scalar = 0.71; // 3.55
break;
case 6:
scalar = 0.67; // 4.02
break;
default:
scalar = 0.64; // 4.48 + 0.64 per player beyond 7
break;
}
npc.lifeMax = (int)Math.Round(npc.lifeMax * scalar);
// Apply the adjustment factor, if any. No other changes are made to bosses or boss-like NPCs.
npc.life = (int)Math.Round(npc.life * adjustmentFactor);
return;
}
// Do not touch non-boss NPCs from vanilla or other mods.
if (!isCalamityNPC)
return;
// Reduction to multiplayer HP scaling for non-boss Calamity enemies in Expert+
double scalar;
switch (numPlayers)
{
case 1:
scalar = 1.0;
break;
case 2:
scalar = 0.9; // 1.8
break;
case 3:
scalar = 0.82; // 2.46
break;
case 4:
scalar = 0.76; // 3.04
break;
case 5:
scalar = 0.71; // 3.55
break;
case 6:
scalar = 0.67; // 4.02
break;
default:
scalar = 0.64; // 4.48 + 0.64 per player beyond 7
break;
}
npc.lifeMax = (int)Math.Round(npc.lifeMax * scalar);
}
#endregion
@@ -5829,6 +5886,45 @@ namespace CalamityMod.NPCs
spark.penetrate = 3;
}
}
if (hyperiusMarked)
{
if (hyperiusFxTimer < 20)
hyperiusFxTimer++;
else if (hyperiusFxTimer > 20)
hyperiusFxTimer = (int)Utils.Lerp(hyperiusFxTimer, 20, 0.2f);
float threshold = ((float)(hyperiusDamage) / (float)(npc.lifeMax));
int overflowSpeed = (int)Utils.Remap(threshold, hyperiusLifePercentThreshold, 0.35f, 1, 34);
if (threshold > hyperiusLifePercentThreshold) // If the stored damage is greater than the life % cap of the target's max health, rapily deal a % of the stored damage to the enemy to drain it
{
bool enemyIsNotArmored = (npc.defense < 1000 && !unbreakableDR && DR <= 0.9f && !npc.dontTakeDamage && !npc.immortal);
if (enemyIsNotArmored)
hyperiusOverflowTimer -= overflowSpeed;
if (hyperiusOverflowTimer <= 0)
{
hyperiusOverflowTimer = hyperiusOverflowTime;
float damagePercent = 0.07f; // The % of stacks drained when you're over the cap
int damage = (int)Math.Max((int)((float)(hyperiusDamage) * damagePercent), 1);
hyperiusDamage -= damage;
// Spawn "bleed" hit
// Uses a seperate projectile so that the hit takes defense and DR into account
Projectile overflow = Projectile.NewProjectileDirect(npc.GetSource_FromThis(), npc.Center, Vector2.Zero, ProjectileType<HyperiusBleed>(), damage, 0, -1, npc.whoAmI);
overflow.DamageType = DamageClass.Ranged;
if (hyperiusFxTimer >= 20)
hyperiusFxTimer = 35;
if (hyperiusDamage <= 0)
{
hyperiusDamage = 0;
hyperiusMarked = false;
}
}
}
}
else if (hyperiusFxTimer > 0)
hyperiusFxTimer--;
if ((laserBurnTimer <= 0 || laserBurnDamage >= npc.life * 1.5f) && laserBurnMarked && laserBurnType > 0)
{
@@ -6508,9 +6604,6 @@ namespace CalamityMod.NPCs
modifiers.SourceDamage *= 0.4f;
}
if (PierceResistList.Includes(npc.type))
PierceResistGlobal(projectile, npc, ref modifiers);
if (modPlayer.camper && !player.StandingStill())
modifiers.SourceDamage *= 0.1f;
@@ -6520,29 +6613,8 @@ namespace CalamityMod.NPCs
if (projectile.minion || ProjectileID.Sets.MinionShot[projectile.type] || projectile.sentry || ProjectileID.Sets.SentryShot[projectile.type])
EditWhipTagDamage(projectile, npc, ref modifiers);
}
#endregion
// Generalized pierce resistance that stacks with all other resistances for some specific bosses defined in a list.
// The actual resistance formula isn't really a problem, but the implementation of this desperately needs refactoring.
private void PierceResistGlobal(Projectile projectile, NPC npc, ref NPC.HitModifiers modifiers)
{
// Thanatos segments do not trigger pierce resistance if they are closed
if (ThanatosIDList.Includes(npc.type) && unbreakableDR)
return;
// Isolates projectiles which ignore pierce resist only on Leviathan and Astrum Aureus
if ((npc.type == NPCType<Leviathan.Leviathan>() || npc.type == NPCType<AstrumAureus.AstrumAureus>()) && PierceResistExceptionLeviAureusList.Includes(projectile.type))
return;
float damageReduction = projectile.Calamity().timesPierced * CalamityGlobalProjectile.PierceResistHarshness;
if (damageReduction > CalamityGlobalProjectile.PierceResistCap)
damageReduction = CalamityGlobalProjectile.PierceResistCap;
modifiers.FinalDamage *= 1f - damageReduction;
if ((projectile.penetrate > 1 || projectile.penetrate == -1) && !PierceResistExceptionList.Includes(projectile.type) && !projectile.CountsAsClass<SummonDamageClass>() && projectile.aiStyle != ProjAIStyleID.Flail && projectile.aiStyle != ProjAIStyleID.MechanicalPiranha && projectile.aiStyle != ProjAIStyleID.Yoyo)
projectile.Calamity().timesPierced++;
}
#endregion
#region OnHitBy overrides
public override void OnHitByProjectile(NPC npc, Projectile projectile, NPC.HitInfo hit, int damagedone)
{
@@ -6550,17 +6622,29 @@ namespace CalamityMod.NPCs
{
CombatText.NewText(npc.Hitbox, Color.Gray, damagedone, hit.Crit);
}
}
public override void OnHitByItem(NPC npc, Player player, Item item, NPC.HitInfo hit, int damagedone)
{
if (IsArmored())
if (projectile.type == ProjectileType<HyperiusDamage>() || projectile.type == ProjectileType<HyperiusBleed>())
{
CombatText.NewText(npc.Hitbox, Color.Gray, damagedone, hit.Crit);
float rate = (Main.GlobalTimeWrappedHourly * 3f);
List<Color> eColors = new List<Color>()
{
Color.Yellow,
Color.Magenta,
Color.Red,
Color.Cyan,
Color.Lime
};
int colorIndex = (int)(rate / 2 % eColors.Count);
Color currentColor = eColors[colorIndex];
Color nextColor = eColors[(colorIndex + 1) % eColors.Count];
Color usedColor = Color.Lerp(currentColor, nextColor, rate % 2f > 1f ? 1f : rate % 1f);
CombatText.NewText(npc.Hitbox, usedColor, damagedone, hit.Crit, true);
}
}
#endregion
#region Whip Tag
#region Whip Tag
// Make whip tags multiplicative, by effectively reversing the process done to it
private void EditWhipTagDamage(Projectile proj, NPC npc, ref NPC.HitModifiers modifiers)
{
@@ -6677,7 +6761,8 @@ namespace CalamityMod.NPCs
NPCType<PhantomSpiritL>()
});
NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, randomType);
if (Main.netMode != NetmodeID.MultiplayerClient)
NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, randomType);
}
}
@@ -7261,6 +7346,19 @@ namespace CalamityMod.NPCs
DeerclopsAI.outerBorder = DeerclopsAI.maxDRIncreaseDistance * 5f;
}
// Despawn Blazing Wheels and Spike Balls when a boss spawns so they're not annoying and stay in the arena
if (npc.boss)
{
foreach (NPC n in Main.ActiveNPCs)
{
if (n.type == NPCID.BlazingWheel || n.type == NPCID.SpikeBall)
{
n.active = false;
n.netUpdate = true;
}
}
}
if (npc.type != NPCID.VoodooDemon)
return;
@@ -7384,9 +7482,69 @@ namespace CalamityMod.NPCs
if (heavybleeding > 0)
HeavyBleeding.DrawEffects(npc, ref drawColor);
if (hyperiusFxTimer > 0)
{
float rate = (Main.GlobalTimeWrappedHourly * 5);
List<Color> eColors = new List<Color>()
{
Color.Yellow,
Color.Magenta,
Color.Red,
Color.Cyan,
Color.Lime
};
int colorIndex = (int)(rate / 2 % eColors.Count);
Color currentColor = eColors[colorIndex];
Color nextColor = eColors[(colorIndex + 1) % eColors.Count];
Color usedColor = Color.Lerp(currentColor, nextColor, rate % 2f > 1f ? 1f : rate % 1f);
Texture2D tex2 = Request<Texture2D>("CalamityMod/Particles/BloomCircle").Value;
Texture2D sparkle = Request<Texture2D>("CalamityMod/Particles/BloomLineSoftEdge").Value;
Vector2 drawPosition = npc.Center - Main.screenPosition;
float drawRotation = npc.rotation + (npc.spriteDirection == -1 ? MathHelper.Pi : 0f);
float power = (float)(Math.Pow(Utils.GetLerpValue(0, 20, hyperiusFxTimer, true), 3)) * MathHelper.Lerp(Math.Max(npc.height, npc.width) / 100, 1.4f, 0.5f);
for (int i = 0; i < 4; i++)
{
float iMult = (1 + 0.25f * i);
Main.EntitySpriteDraw(tex2, drawPosition, null, Color.Lerp(usedColor, Color.White, i * 0.1f) with { A = 0 } * 0.6f, Main.rand.NextFloat(-5f, 5f), tex2.Size() * 0.5f, new Vector2(1f, 0.8f) * 0.35f * Main.rand.NextFloat(0.9f, 1.1f) * iMult * power * (Utils.GetLerpValue(0, 20, hyperiusFxTimer)), SpriteEffects.None);
for (int b = -1; b <= 1; b += 2)
{
float uncappedSine = (float)Math.Sin(Main.GlobalTimeWrappedHourly * 8f / MathHelper.Pi);
float sine = MathHelper.Lerp(Math.Abs(uncappedSine), 0.75f, 0.75f);
Vector2 scale = new Vector2((0.25f / iMult) + (0.7f * (1 - sine)), 1.1f * sine * iMult) * power * 0.05f;
float rotation = MathHelper.PiOver4 * b * uncappedSine;
Main.EntitySpriteDraw(sparkle, drawPosition, null, Color.Lerp(usedColor, Color.White, i * 0.1f) with { A = 0 }, rotation, sparkle.Size() * 0.5f, scale, SpriteEffects.None);
}
}
}
if (laceration > 0)
Laceration.DrawEffects(npc, ref drawColor);
if (laserBurnTimer > 0)
{
int particleChance = Math.Max(3, 10 - (laserBurnStacks / 3));
if (laserBurnTimer % particleChance == 0)
{
Vector2 randPosition = new Vector2(npc.position.X + Main.rand.Next(0, npc.width), npc.position.Y + Main.rand.Next(0, npc.height));
Dust dust = Dust.NewDustPerfect(randPosition, Effects.ArsenalEffects.ArsenalLaserDust);
dust.velocity = ((Vector2.UnitX * 3 * (laserBurnStacks * 0.03f)).RotatedByRandom(100) * Main.rand.NextFloat(0.85f, 1f)) + npc.velocity * 0.5f;
dust.scale = Main.rand.NextFloat(0.55f, 0.7f) + laserBurnStacks * 0.01f;
dust.noGravity = true;
dust.color = Color.Red;
dust.fadeIn = laserBurnStacks * 0.3f;
}
if (laserBurnType == 0)
{
Main.NewText("No Burn Type Set", Color.OrangeRed);
laserBurnMarked = false;
laserBurnTimer = 0;
}
}
// These draw effects do not include Miracle Blight's shader
if (miracleBlight > 0)
MiracleBlight.DrawEffects(npc, ref drawColor);
@@ -7430,28 +7588,6 @@ namespace CalamityMod.NPCs
}
}
if (laserBurnTimer > 0)
{
int particleChance = Math.Max(3, 10 - (laserBurnStacks / 3));
if (laserBurnTimer % particleChance == 0)
{
Vector2 randPosition = new Vector2(npc.position.X + Main.rand.Next(0, npc.width), npc.position.Y + Main.rand.Next(0, npc.height));
Dust dust = Dust.NewDustPerfect(randPosition, Effects.ArsenalEffects.ArsenalLaserDust);
dust.velocity = ((Vector2.UnitX * 3 * (laserBurnStacks * 0.03f)).RotatedByRandom(100) * Main.rand.NextFloat(0.85f, 1f)) + npc.velocity * 0.5f;
dust.scale = Main.rand.NextFloat(0.55f, 0.7f) + laserBurnStacks * 0.01f;
dust.noGravity = true;
dust.color = Color.Red;
dust.fadeIn = laserBurnStacks * 0.3f;
}
if (laserBurnType == 0)
{
Main.NewText("No Burn Type Set", Color.OrangeRed);
laserBurnMarked = false;
laserBurnTimer = 0;
}
}
if (voidfrost > 0)
Voidfrost.DrawEffects(npc, ref drawColor);
+2
View File
@@ -142,6 +142,7 @@ namespace CalamityMod.NPCs
"Mihai", // <@!373941893467209730> (cmihaii.)
"Cooler Kevin", // <@!614126424751603714> (exellent.)
"Dinkleberg", // <@!581993958037520404> (hyperionzx)
"Wamy",
};
private static readonly string[] MechanicNames =
{
@@ -225,6 +226,7 @@ namespace CalamityMod.NPCs
private static readonly string[] TaxCollectorNames =
{
"Emmett",
"Casino King Gray", // <@!555512087711973390> (eternalgrayson)
};
private static readonly string[] TravelingMerchantNames =
{
+161
View File
@@ -0,0 +1,161 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using CalamityMod.Balancing;
using CalamityMod.Items.Accessories;
using CalamityMod.Projectiles;
using CalamityMod.Systems.Collections;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.ModLoader.Core;
using static Terraria.ModLoader.ModContent;
namespace CalamityMod.NPCs
{
public sealed class PierceResistNPC : GlobalNPC
{
private static HashSet<int> exemptProjectiles;
private static HashSet<int> pierceResistNPC;
private static HashSet<int> singleHitboxNPC;
private static Dictionary<int, bool> singleHitboxExemptProjectiles;
public override void Load()
{
exemptProjectiles = new();
pierceResistNPC = new();
singleHitboxNPC = new();
singleHitboxExemptProjectiles = new();
}
public override void Unload()
{
exemptProjectiles?.Clear();
exemptProjectiles = null;
pierceResistNPC?.Clear();
pierceResistNPC = null;
singleHitboxNPC?.Clear();
singleHitboxNPC = null;
singleHitboxExemptProjectiles?.Clear();
singleHitboxExemptProjectiles = null;
}
public override void SetStaticDefaults()
{
// Specific vanilla NPC's with pierce resistance
pierceResistNPC.Add(NPCID.EaterofWorldsHead);
pierceResistNPC.Add(NPCID.EaterofWorldsBody);
pierceResistNPC.Add(NPCID.EaterofWorldsTail);
pierceResistNPC.Add(NPCID.Creeper);
pierceResistNPC.Add(NPCID.TheDestroyer);
pierceResistNPC.Add(NPCID.TheDestroyerBody);
pierceResistNPC.Add(NPCID.TheDestroyerTail);
// Specific vanilla projectile exemptions
exemptProjectiles.Add(ProjectileID.Arkhalis);
exemptProjectiles.Add(ProjectileID.ChargedBlasterLaser);
exemptProjectiles.Add(ProjectileID.ClingerStaff);
exemptProjectiles.Add(ProjectileID.FinalFractal);
exemptProjectiles.Add(ProjectileID.FlyingKnife);
exemptProjectiles.Add(ProjectileID.LastPrismLaser);
exemptProjectiles.Add(ProjectileType<MarniteRepulsionHitbox>()); // Included here as it does not have a projectile
exemptProjectiles.Add(ProjectileID.MonkStaffT3);
exemptProjectiles.Add(ProjectileID.PiercingStarlight);
exemptProjectiles.Add(ProjectileID.SandnadoFriendly);
exemptProjectiles.Add(ProjectileID.Terragrim);
// Specific vanilla projectile single hitbox exemptions
singleHitboxExemptProjectiles[ProjectileID.NettleBurstEnd] = true;
singleHitboxExemptProjectiles[ProjectileID.NettleBurstLeft] = true;
singleHitboxExemptProjectiles[ProjectileID.NettleBurstRight] = true;
singleHitboxExemptProjectiles[ProjectileID.PrincessWeapon] = true;
var projectileTypes = AssemblyManager.GetLoadableTypes(CalamityMod.Instance.Code)
.Where(type => !type.IsAbstract && type.IsSubclassOf(typeof(ModProjectile)));
foreach (var type in projectileTypes)
{
try
{
var pierceResistException = type.GetCustomAttribute<PierceResistExceptionAttribute>();
if (pierceResistException == null)
continue;
var projectileTypeMethod = typeof(ModContent).GetMethod(nameof(ModContent.ProjectileType));
var projectileTypeActualMethod = projectileTypeMethod.MakeGenericMethod(type);
int projectileType = (int)projectileTypeActualMethod.Invoke(null, null);
if (pierceResistException.OnlyForSingleHitbox)
{
singleHitboxExemptProjectiles[projectileType] = true;
continue;
}
else
{
exemptProjectiles.Add(projectileType);
}
}
catch (Exception e)
{
CalamityMod.Instance.Logger.Error($"Exception thrown while evaluating type \"{type.Name}\": {e}");
}
}
var npcTypes = AssemblyManager.GetLoadableTypes(CalamityMod.Instance.Code)
.Where(type => !type.IsAbstract && type.IsSubclassOf(typeof(ModNPC)));
foreach (var type in npcTypes)
{
try
{
var hasPierceResist = type.GetCustomAttribute<HasPierceResistAttribute>();
if (hasPierceResist == null)
continue;
var npcTypeMethod = typeof(ModContent).GetMethod(nameof(ModContent.NPCType));
var npcTypeActualMethod = npcTypeMethod.MakeGenericMethod(type);
int npcType = (int)npcTypeActualMethod.Invoke(null, null);
pierceResistNPC.Add(npcType);
if (hasPierceResist.SingleHitbox)
singleHitboxNPC.Add(npcType);
}
catch (Exception e)
{
CalamityMod.Instance.Logger.Error($"Exception thrown while evaluating type \"{type.Name}\": {e}");
}
}
}
public override void ModifyHitByProjectile(NPC npc, Projectile projectile, ref NPC.HitModifiers modifiers)
{
// Skip if NPC does not have pierce resistance or projectile is exempt
if (!pierceResistNPC.Contains(npc.type) || exemptProjectiles.Contains(projectile.type))
return;
// Skip if the projectile is exempt on single hitboxes and the NPC is a single hitbox
if (singleHitboxExemptProjectiles.TryGetValue(projectile.type, out bool isSingleHitboxExempt) && isSingleHitboxExempt && singleHitboxNPC.Contains(npc.type))
return;
PierceResistGlobal(projectile, npc, ref modifiers);
}
// Generalized pierce resistance that stacks with all other resistances for some specific bosses defined in a list.
private void PierceResistGlobal(Projectile projectile, NPC npc, ref NPC.HitModifiers modifiers)
{
// Thanatos segments do not trigger pierce resistance if they are closed
if (ThanatosIDList.Includes(npc.type) && npc.GetGlobalNPC<CalamityGlobalNPC>().unbreakableDR)
return;
float damageReduction = projectile.Calamity().timesPierced * BalancingConstants.PierceResistHarshness;
if (damageReduction > BalancingConstants.PierceResistCap)
damageReduction = BalancingConstants.PierceResistCap;
modifiers.FinalDamage *= 1f - damageReduction;
if ((projectile.penetrate > 1 || projectile.penetrate == -1) && !projectile.CountsAsClass<SummonDamageClass>() && projectile.aiStyle != ProjAIStyleID.Flail && projectile.aiStyle != ProjAIStyleID.MechanicalPiranha && projectile.aiStyle != ProjAIStyleID.Yoyo)
projectile.Calamity().timesPierced++;
}
}
}
+1
View File
@@ -14,6 +14,7 @@ using Terraria.ModLoader;
namespace CalamityMod.NPCs.CeaselessVoid
{
[HasPierceResist]
public class DarkEnergy : ModNPC
{
private bool start = true;
+34 -27
View File
@@ -214,8 +214,8 @@ namespace CalamityMod.NPCs.Crabulon
if (NPC.ai[0] < 2f)
{
int mushBombAmt = phase4 ? 12 : phase3 ? 6 : phase2 ? 3 : 1;
float fireRate = phase4 ? 6f : phase3 ? 4f : phase2 ? 2f : 1f;
int mushBombAmt = phase4 ? 6 : phase3 ? 3 : phase2 ? 2 : 1;
float fireRate = phase4 ? 6f : phase3 ? 3f : phase2 ? 2f : 1f;
NPC.localAI[3] += fireRate;
if (NPC.ai[3] == 0f)
{
@@ -239,7 +239,7 @@ namespace CalamityMod.NPCs.Crabulon
if (Main.netMode != NetmodeID.MultiplayerClient)
{
float yVelocity = death ? 1f : expertMode ? 2.5f : 5f;
float yVelocity = death ? 1f : expertMode ? 2.5f : 4f;
Vector2 projectileVelocity = (Vector2.Normalize(player.Center - NPC.Center) * mushBombSpeed) - Vector2.UnitY * yVelocity;
Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileVelocity, type, NPC.GetProjectileDamage(type), 0f, Main.myPlayer, 0f, player.Center.Y);
}
@@ -257,12 +257,12 @@ namespace CalamityMod.NPCs.Crabulon
if (phase2)
NPC.ai[1] += 1f;
if (phase3)
NPC.ai[1] += 2f;
NPC.ai[1] += 1f;
if (NPC.Distance(player.Center) < 160f)
NPC.ai[1] += masterMode ? 4f : expertMode ? 2f : 1f;
// Gets tired easily in final phase. - Fabsol
float idleTime = phase4 ? 480f : death ? 30f : expertMode ? 60f : 120f;
float idleTime = phase4 ? 480f : death ? 60f : expertMode ? 90f : 120f;
if (NPC.ai[1] >= idleTime)
{
bool deathModeTripleStomp = Main.rand.NextBool() && death && phase2;
@@ -283,9 +283,9 @@ namespace CalamityMod.NPCs.Crabulon
if (phase2)
walkingVelocity += 0.5f;
if (phase3)
walkingVelocity += 1f;
walkingVelocity += 0.75f;
if (phase4)
walkingVelocity += 1.5f;
walkingVelocity += 1f;
if (CalamityWorld.LegendaryMode && CalamityWorld.revenge)
walkingVelocity *= 2f;
@@ -320,11 +320,11 @@ namespace CalamityMod.NPCs.Crabulon
Vector2 collisionCheckPosition = new Vector2(NPC.Center.X - 40, NPC.position.Y + NPC.height - 20);
bool fallDownOnTopOfTarget = NPC.position.X < player.position.X && NPC.position.X + NPC.width > player.position.X + player.width && NPC.position.Y + NPC.height < player.position.Y + player.height - 16f;
float acceleration = death ? 0.1f : expertMode ? 0.05f : 0.025f;
float acceleration2 = death ? 0.8f : expertMode ? 0.4f : 0.2f;
float acceleration = death ? 0.075f : expertMode ? 0.05f : 0.03f;
float acceleration2 = death ? 0.6f : expertMode ? 0.4f : 0.25f;
if (fallDownOnTopOfTarget)
{
float fallSpeed = death ? 2f : expertMode ? 1f : 0.5f;
float fallSpeed = death ? 1.5f : expertMode ? 1f : 0.5f;
NPC.velocity.Y += fallSpeed;
}
else if (Collision.SolidCollision(collisionCheckPosition, 80, 20))
@@ -337,7 +337,7 @@ namespace CalamityMod.NPCs.Crabulon
else
NPC.velocity.Y -= acceleration2;
float upwardSpeedCap = death ? 16f : expertMode ? 8f : 4f;
float upwardSpeedCap = death ? 9f : expertMode ? 6f : 4f;
if (NPC.velocity.Y < -upwardSpeedCap)
NPC.velocity.Y = -upwardSpeedCap;
}
@@ -357,7 +357,7 @@ namespace CalamityMod.NPCs.Crabulon
if (NPC.Distance(player.Center) < 160f)
NPC.ai[1] += masterMode ? 4f : expertMode ? 2f : 1f;
float stompPhaseGateValue = (revenge ? 150f : expertMode ? 240f : 360f) - (death ? 120f * (1f - lifeRatio) : 0f);
float stompPhaseGateValue = (revenge ? 150f : expertMode ? 240f : 360f) - (death ? 90f * (1f - lifeRatio) : 0f);
if (NPC.ai[1] >= stompPhaseGateValue)
{
NPC.noGravity = false;
@@ -417,7 +417,7 @@ namespace CalamityMod.NPCs.Crabulon
}
else if (NPC.ai[1] == -1f)
{
float maxVelocityXIncrease = death ? 6f : 4f;
float maxVelocityXIncrease = death ? 4f : 3f;
float maxVelocityYIncrease = death ? 3f : 2f;
float velocityX = 6f + (expertMode ? (maxVelocityXIncrease * (1f - lifeRatio)) : 0f);
float velocityY = 12f + (expertMode ? (maxVelocityYIncrease * (1f - lifeRatio)) : 0f);
@@ -531,7 +531,7 @@ namespace CalamityMod.NPCs.Crabulon
destination *= projectileVelocity;
// Less mushrooms in Death Mode phase 3 because otherwise it's an absolute shitshow. - Fabsol
int numProj = bossRush ? 32 : phase4 ? 18 : CalamityWorld.death ? (phase3 ? 12 : 20) : 16;
int numProj = bossRush ? 24 : phase4 ? 14 : CalamityWorld.death ? (phase3 ? 10 : 16) : 12;
float rotation = MathHelper.ToRadians(90);
for (int i = 0; i < numProj; i++)
{
@@ -556,7 +556,7 @@ namespace CalamityMod.NPCs.Crabulon
destination *= projectileVelocity;
// Less mushrooms in Death Mode phase 3 because otherwise it's an absolute shitshow. - Fabsol
int numProj = bossRush ? 20 : phase4 ? 10 : (phase3 && death) ? 6 : 10;
int numProj = bossRush ? 16 : phase4 ? 8 : (phase3 && death) ? 6 : 8;
float rotation = MathHelper.ToRadians(60);
for (int i = 0; i < numProj; i++)
{
@@ -636,21 +636,21 @@ namespace CalamityMod.NPCs.Crabulon
if (NPC.position.X < player.position.X && NPC.position.X + NPC.width > player.position.X + player.width)
{
float slowDownMultiplier = death ? 0.84f : expertMode ? 0.92f : 0.96f;
float slowDownMultiplier = death ? 0.9f : expertMode ? 0.93f : 0.96f;
NPC.velocity.X *= slowDownMultiplier;
float fallSpeedIncrease = phase4 ? 0.36f : death ? 0.24f : expertMode ? 0.12f : 0.06f;
float fallSpeedIncrease = phase4 ? 0.2f : death ? 0.15f : expertMode ? 0.12f : 0.09f;
NPC.velocity.Y += fallSpeedIncrease;
}
else
{
float velocityX = (death ? 0.2f : expertMode ? 0.15f : 0.1f) + 0.05f * enrageScale;
float velocityX = (death ? 0.15f : expertMode ? 0.125f : 0.1f) + 0.05f * enrageScale;
if (NPC.direction < 0)
NPC.velocity.X -= velocityX;
else if (NPC.direction > 0)
NPC.velocity.X += velocityX;
float maxVelocityXIncrease = death ? 6f : 4f;
float maxVelocityXIncrease = death ? 4f : 3f;
float maxVelocityX = 6f + (expertMode ? (maxVelocityXIncrease * (1f - lifeRatio)) : 0f);
if (revenge)
@@ -713,19 +713,21 @@ namespace CalamityMod.NPCs.Crabulon
if (!player.dead && player.active && Math.Abs(NPC.Center.X - player.Center.X) / 16f <= despawnDistanceInTiles)
center = player.Center;
center.Y -= 480f;
center.Y -= 320f + Math.Abs(player.Center.Y - NPC.Center.Y);
center.X += Math.Abs(player.Center.X - NPC.Center.X) * ((player.Center.X - NPC.Center.X > 0f) ? 1 : -1);
NPC.ai[2] = 1f;
NPC.ai[3] = NPC.Bottom.Y;
NPC.noTileCollide = true;
float leapVelocity = bossRush ? 24f : death ? 18f : 16f;
NPC.velocity = center - NPC.Center;
NPC.velocity = NPC.velocity.SafeNormalize(Vector2.Zero);
NPC.velocity *= bossRush ? 24f : death ? 21f : 18f;
NPC.velocity *= leapVelocity;
float jumpVelocityMin = -12f;
if (NPC.velocity.Y > jumpVelocityMin)
NPC.velocity.Y = jumpVelocityMin;
float velocityMinY = -leapVelocity;
if (NPC.velocity.Y > velocityMinY)
NPC.velocity.Y = velocityMinY;
NPC.ForceNetUpdate();
}
@@ -757,8 +759,12 @@ namespace CalamityMod.NPCs.Crabulon
}
}
// Collide with tiles if falling and beyond a certain threshold
if (NPC.velocity.Y >= 0f && NPC.Bottom.Y >= NPC.ai[3] - NPC.height)
NPC.noTileCollide = false;
// Impact and create lines of mushrooms that spread out along the ground (similar to an old Providence attack)
if (NPC.Bottom.Y >= NPC.ai[3] - NPC.height && NPC.velocity.Y >= 0f)
if (NPC.Bottom.Y >= NPC.ai[3] || NPC.velocity.Y == 0f)
{
SoundEngine.PlaySound(SlamSound, NPC.Center);
@@ -766,7 +772,6 @@ namespace CalamityMod.NPCs.Crabulon
NPC.ai[1] = 0f;
NPC.ai[2] = 0f;
NPC.ai[3] = 0f;
NPC.noTileCollide = false;
NPC.netUpdate = true;
int type = ModContent.ProjectileType<MushBombGround>();
@@ -775,7 +780,7 @@ namespace CalamityMod.NPCs.Crabulon
if (Main.netMode != NetmodeID.MultiplayerClient)
{
float xVelocity = death ? 2f : 1f;
int numProj = 5;
int numProj = death ? 5 : 3;
Vector2 initialVelocity = Vector2.UnitX * xVelocity;
Vector2 initialSpawnLocation = NPC.Bottom - new Vector2(0f, 8f);
@@ -821,6 +826,8 @@ namespace CalamityMod.NPCs.Crabulon
}
}
}
else
NPC.velocity.X *= 0.8f;
}
// Stomp three times quickly, creating lines of mushrooms and a column of mushrooms that slowly fall down
+8 -8
View File
@@ -20,10 +20,10 @@ namespace CalamityMod.NPCs.DesertScourge
public bool flies = false;
private bool tailSpawned = false;
public const float SegmentVelocity_Expert = 14f;
public const float SegmentVelocity_Master = 16.5f;
public const float SegmentVelocity_Expert = 11f;
public const float SegmentVelocity_Master = 13.5f;
public const float SegmentVelocity_GoodWorld = 19f;
public const float SegmentVelocity_ZenithSeed = 21.5f;
public const float SegmentVelocity_ZenithSeed = 22f;
public const float OpenMouthForBiteDistance = 220f;
@@ -140,12 +140,12 @@ namespace CalamityMod.NPCs.DesertScourge
// Percent life remaining.
float lifeRatio = NPC.life / (float)NPC.lifeMax;
float speed = death ? 0.18f : 0.16f;
float turnSpeed = death ? 0.26f : 0.22f;
float speed = death ? 0.105f : 0.085f;
float turnSpeed = death ? 0.21f : 0.17f;
speed += speed * 0.4f * (1f - lifeRatio);
turnSpeed += turnSpeed * 0.4f * (1f - lifeRatio);
speed += 0.16f * enrageScale;
turnSpeed += 0.22f * enrageScale;
speed += 0.085f * enrageScale;
turnSpeed += 0.17f * enrageScale;
if (Main.getGoodWorld)
{
@@ -455,7 +455,7 @@ namespace CalamityMod.NPCs.DesertScourge
}
Vector2 destination = Main.player[NPC.target].Center;
if (NPC.Distance(destination) > 1000f)
if (NPC.Distance(destination) > (getMad ? 750f : 1000f))
NPC.velocity += (destination - NPC.Center).SafeNormalize(Vector2.UnitY) * turnSpeed;
// Calculate contact damage based on velocity
+11 -11
View File
@@ -22,8 +22,8 @@ namespace CalamityMod.NPCs.DesertScourge
public bool flies = false;
private bool tailSpawned = false;
public const float SegmentVelocity_Expert = 12f;
public const float SegmentVelocity_Master = 14f;
public const float SegmentVelocity_Expert = 10f;
public const float SegmentVelocity_Master = 12f;
public const float SegmentVelocity_GoodWorld = 16f;
public const float SegmentVelocity_ZenithSeed = 18f;
@@ -126,7 +126,7 @@ namespace CalamityMod.NPCs.DesertScourge
bool biomeEnraged = biomeEnrageTimer <= 0 || bossRush;
float enrageScale = bossRush ? 1f : getMad ? 0.25f : 0f;
float enrageScale = bossRush ? 1f : getMad ? 0.5f : 0f;
if (biomeEnraged)
{
NPC.Calamity().CurrentlyEnraged = !bossRush;
@@ -136,12 +136,12 @@ namespace CalamityMod.NPCs.DesertScourge
// Percent life remaining.
float lifeRatio = NPC.life / (float)NPC.lifeMax;
float speed = death ? 0.16f : 0.14f;
float turnSpeed = death ? 0.24f : 0.2f;
float speed = death ? 0.09f : 0.07f;
float turnSpeed = death ? 0.18f : 0.14f;
speed += speed * 0.4f * (1f - lifeRatio);
turnSpeed += turnSpeed * 0.4f * (1f - lifeRatio);
speed += 0.14f * enrageScale;
turnSpeed += 0.2f * enrageScale;
speed += 0.07f * enrageScale;
turnSpeed += 0.14f * enrageScale;
if (Main.getGoodWorld)
{
@@ -159,7 +159,7 @@ namespace CalamityMod.NPCs.DesertScourge
if (NPC.alpha < 0)
NPC.alpha = 0;
if (getMad && NPC.Distance(Main.player[NPC.target].Center) > 240f)
if (NPC.Distance(Main.player[NPC.target].Center) > 360f)
{
if ((Main.player[NPC.target].Center - NPC.Center).SafeNormalize(Vector2.UnitY).ToRotation().AngleTowards(NPC.velocity.ToRotation(), MathHelper.PiOver4) == NPC.velocity.ToRotation())
NPC.Calamity().newAI[0] += 1f;
@@ -171,8 +171,8 @@ namespace CalamityMod.NPCs.DesertScourge
if (Main.netMode != NetmodeID.MultiplayerClient)
{
Vector2 projectileVelocity = (Main.player[NPC.target].Center - NPC.Center).SafeNormalize(Vector2.UnitY) * (revenge ? 10f : 8f);
int numProj = death ? 6 : 4;
int spread = masterMode ? 28 : 20;
int numProj = death ? 6 : getMad ? 4 : 3;
int spread = masterMode ? 28 : getMad ? 22 : 20;
if (masterMode)
{
numProj += 2;
@@ -496,7 +496,7 @@ namespace CalamityMod.NPCs.DesertScourge
}
Vector2 destination = Main.player[NPC.target].Center;
if (NPC.Distance(destination) > 1000f)
if (NPC.Distance(destination) > (getMad ? 750f : 1000f))
NPC.velocity += (destination - NPC.Center).SafeNormalize(Vector2.UnitY) * turnSpeed;
// Calculate contact damage based on velocity
+1
View File
@@ -15,6 +15,7 @@ using Terraria.ModLoader;
namespace CalamityMod.NPCs.DesertScourge
{
[HasPierceResist]
[LongDistanceNetSync(SyncWith = typeof(DesertScourgeHead))]
public class DesertScourgeBody : ModNPC
{
+12 -11
View File
@@ -32,6 +32,7 @@ using Terraria.ModLoader;
namespace CalamityMod.NPCs.DesertScourge
{
[AutoloadBossHead]
[HasPierceResist]
[LongDistanceNetSync]
public class DesertScourgeHead : ModNPC
{
@@ -39,9 +40,9 @@ namespace CalamityMod.NPCs.DesertScourge
private bool tailSpawned = false;
public bool playRoarSound = false;
public const float SegmentVelocity_Normal = 12f;
public const float SegmentVelocity_Expert = 15f;
public const float SegmentVelocity_Master = 18f;
public const float SegmentVelocity_Normal = 10f;
public const float SegmentVelocity_Expert = 12.5f;
public const float SegmentVelocity_Master = 15f;
public const float SegmentVelocity_GoodWorld = 21f;
public const float SegmentVelocity_ZenithSeed = 24f;
@@ -239,23 +240,23 @@ namespace CalamityMod.NPCs.DesertScourge
float burrowDistance = hide ? BurrowDistance_Hide : bossRush ? BurrowDistance_BossRush : BurrowDistance;
float speed = death ? 0.15f : 0.12f;
float turnSpeed = death ? 0.3f : 0.24f;
float speed = death ? 0.105f : 0.085f;
float turnSpeed = death ? 0.21f : 0.17f;
if (expertMode)
{
speed += speed * 0.2f * (1f - lifeRatio);
turnSpeed += turnSpeed * 0.2f * (1f - lifeRatio);
speed += speed * 0.4f * (1f - lifeRatio);
turnSpeed += turnSpeed * 0.4f * (1f - lifeRatio);
}
if (revenge)
{
speed += (death ? 0.05f : 0.04f) * (1f - lifeRatio);
turnSpeed += (death ? 0.1f : 0.08f) * (1f - lifeRatio);
speed += (death ? 0.03f : 0.02f) * (1f - lifeRatio);
turnSpeed += (death ? 0.06f : 0.04f) * (1f - lifeRatio);
}
speed += 0.12f * enrageScale;
turnSpeed += 0.24f * enrageScale;
speed += 0.085f * enrageScale;
turnSpeed += 0.17f * enrageScale;
if (Main.getGoodWorld)
{
+1
View File
@@ -10,6 +10,7 @@ using Terraria.ModLoader;
namespace CalamityMod.NPCs.DesertScourge
{
[HasPierceResist]
[LongDistanceNetSync(SyncWith = typeof(DesertScourgeHead))]
public class DesertScourgeTail : ModNPC
{
@@ -13,6 +13,7 @@ using Terraria.Localization;
using Terraria.ModLoader;
namespace CalamityMod.NPCs.DevourerofGods
{
[HasPierceResist]
[LongDistanceNetSync(SyncWith = typeof(CosmicGuardianHead))]
public class CosmicGuardianBody : ModNPC
{
@@ -15,6 +15,7 @@ using Terraria.ModLoader;
namespace CalamityMod.NPCs.DevourerofGods
{
[HasPierceResist]
[LongDistanceNetSync]
public class CosmicGuardianHead : ModNPC
{
@@ -13,6 +13,7 @@ using Terraria.Localization;
using Terraria.ModLoader;
namespace CalamityMod.NPCs.DevourerofGods
{
[HasPierceResist]
[LongDistanceNetSync(SyncWith = typeof(CosmicGuardianHead))]
public class CosmicGuardianTail : ModNPC
{
+1
View File
@@ -41,6 +41,7 @@ using Terraria.ModLoader;
namespace CalamityMod.NPCs.ExoMechs.Ares
{
[AutoloadBossHead]
[HasPierceResist]
public class AresBody : ModNPC
{
// Used for loot
+1
View File
@@ -19,6 +19,7 @@ using Terraria.ModLoader;
namespace CalamityMod.NPCs.ExoMechs.Ares
{
[HasPierceResist]
public class AresGaussNuke : ModNPC
{
public enum Phase
+1
View File
@@ -21,6 +21,7 @@ using Terraria.ModLoader;
namespace CalamityMod.NPCs.ExoMechs.Ares
{
[HasPierceResist]
public class AresLaserCannon : ModNPC
{
public enum Phase
@@ -20,6 +20,7 @@ using Terraria.ModLoader;
namespace CalamityMod.NPCs.ExoMechs.Ares
{
[HasPierceResist]
public class AresPlasmaFlamethrower : ModNPC
{
public enum Phase
+1
View File
@@ -19,6 +19,7 @@ using Terraria.ModLoader;
namespace CalamityMod.NPCs.ExoMechs.Ares
{
[HasPierceResist]
public class AresTeslaCannon : ModNPC
{
public enum Phase
+1
View File
@@ -17,6 +17,7 @@ using Terraria.ModLoader;
namespace CalamityMod.NPCs.ExoMechs.Thanatos
{
[HasPierceResist]
[LongDistanceNetSync(SyncWith = typeof(ThanatosHead))]
public class ThanatosBody1 : ModNPC
{
+1
View File
@@ -17,6 +17,7 @@ using Terraria.ModLoader;
namespace CalamityMod.NPCs.ExoMechs.Thanatos
{
[HasPierceResist]
[LongDistanceNetSync(SyncWith = typeof(ThanatosHead))]
public class ThanatosBody2 : ModNPC
{
+1
View File
@@ -22,6 +22,7 @@ using Terraria.ModLoader;
namespace CalamityMod.NPCs.ExoMechs.Thanatos
{
[HasPierceResist]
[LongDistanceNetSync]
public class ThanatosHead : ModNPC
{
+1
View File
@@ -17,6 +17,7 @@ using Terraria.ModLoader;
namespace CalamityMod.NPCs.ExoMechs.Thanatos
{
[HasPierceResist]
[LongDistanceNetSync(SyncWith = typeof(ThanatosHead))]
public class ThanatosTail : ModNPC
{
+26
View File
@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Terraria.ModLoader;
namespace CalamityMod.NPCs
{
/// <summary>
/// This attribute gives an NPC universal pierce resistance
/// </summary>
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
public sealed class HasPierceResistAttribute : Attribute
{
/// <summary>
/// <para>Set this to true to indicate this NPC has a single large hitbox which typical piercing projectiles can hit multiple times. Certain weapons are exempt from pierce resistance on single-hitbox targets.</para>
/// </summary>
public bool SingleHitbox { get; }
public HasPierceResistAttribute(bool singleHitbox = false)
{
SingleHitbox = singleHitbox;
}
}
}
Loaded 100 of 371 files, more files were not shown because too many files have changed in this diff. Show more