diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs
index 3ad266c8db..1f7e29d431 100644
--- a/CalPlayer/CalamityPlayer.cs
+++ b/CalPlayer/CalamityPlayer.cs
@@ -957,6 +957,8 @@ namespace CalamityMod.CalPlayer
public bool XykVisualsBlue = false;
public bool XykVisualsOrange = false;
public Color XykFXColor = Color.Black;
+ public int XykWingTimer = 0;
+ public Color lightRGB = Color.Black;
public bool manaOverloader = false;
/// Used for allowing Calamity slimes to be affected by Royal Gel.
public bool royalGel = false;
diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs
index 51a94a1d11..fa96a6410f 100644
--- a/CalPlayer/CalamityPlayerHitHurt.cs
+++ b/CalPlayer/CalamityPlayerHitHurt.cs
@@ -885,7 +885,7 @@ namespace CalamityMod.CalPlayer
contactDamageReduction *= (double)Crumbling.MultiplicativeDamageReductionPlayer;
// Contact damage reduction is reduced by DR Damage, which itself is proportional to defense damage
- // In GFB, as defense damage is uncapped, DR damage is also uncapped.
+ // In FTW, as defense damage is uncapped, DR damage is also uncapped.
int currentDefense = Player.GetCurrentDefense(false);
if (totalDefenseDamage > 0 && currentDefense > 0)
{
diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs
index bbbc40946b..ab4c0fe82c 100644
--- a/CalPlayer/CalamityPlayerMiscEffects.cs
+++ b/CalPlayer/CalamityPlayerMiscEffects.cs
@@ -254,12 +254,21 @@ namespace CalamityMod.CalPlayer
foreach (Projectile p in Main.ActiveProjectiles)
if (p.type == ModContent.ProjectileType() && p.owner == Player.whoAmI && p.ai[1] == 0)
numOfActiveWings++;
- bool spawnWings = numOfActiveWings < maxWingPieces && !Player.dead && Player.wingsLogic > 0 && !(Player.wingTime == Player.wingTimeMax && Player.velocity.Y == 0) && Player.wingTime > 0;
+ bool spawnWings = numOfActiveWings < maxWingPieces && !Player.dead && Player.wingsLogic > 0 && ((!(Player.wingTime == Player.wingTimeMax && Player.velocity.Y == 0) && Player.wingTime > 0) || XykWingTimer >= 3);
if (spawnWings)
{
- int wingCount = numOfActiveWings;
- Projectile wings = Projectile.NewProjectileDirect(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, Player.whoAmI, wingCount);
+ if (XykWingTimer >= 3)
+ {
+ int wingCount = numOfActiveWings;
+ Projectile wings = Projectile.NewProjectileDirect(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, Player.whoAmI, wingCount);
+ if (numOfActiveWings + 1 == maxWingPieces)
+ XykWingTimer = 0;
+ }
+ else
+ XykWingTimer++;
}
+ else
+ XykWingTimer = 0;
}
// First Frame dash effects
@@ -568,6 +577,22 @@ namespace CalamityMod.CalPlayer
if (heldGaelsLastFrame)
rageDiff += rageMax * GaelsGreatsword.RagePerSecond / 60f;
+ float rate = Main.GlobalTimeWrappedHourly * 29;
+ List eColors = new List()
+ {
+ Color.PaleVioletRed,
+ Color.Coral,
+ Color.Khaki,
+ Color.PaleGreen,
+ Color.Turquoise,
+ Color.Violet
+ };
+
+ int colorIndex = (int)(rate / 2 % eColors.Count);
+ Color currentColor = eColors[colorIndex];
+ Color nextColor = eColors[(colorIndex + 1) % eColors.Count];
+ lightRGB = Color.Lerp(currentColor, nextColor, rate % 2f > 1f ? 1f : rate % 1f);
+
// Calculate and grant proximity rage.
// Regular enemies can give up to 1x proximity rage. Bosses can give up to 3x. Multiple regular enemies don't stack.
// Proximity rage is maxed out when within 10 blocks (160 pixels) of the enemy's hitbox.
@@ -3092,7 +3117,7 @@ namespace CalamityMod.CalPlayer
abyssDeath = false;
// Signus headcrab darkness
- if (CalamityWorld.LegendaryMode && CalamityWorld.revenge)
+ if (CalamityWorld.LegendaryMode)
{
if (CalamityGlobalNPC.signus != -1)
{
@@ -3804,11 +3829,15 @@ namespace CalamityMod.CalPlayer
{
Player.GetDamage() += PrimordialEarth.BuffDamageBoost;
Player.statDefense += PrimordialEarth.BuffDefenseBoost;
+ Player.manaRegenDelayBonus += 1;
+ Player.manaRegenBonus += 50 + (int)(400 * (float)Math.Pow((1 - ((float)Player.statMana / (float)Player.statManaMax2)), 2));
}
if (aeolianEarthBuff)
{
Player.GetDamage() += PrimordialAncient.BuffDamageBoost;
Player.endurance += PrimordialAncient.BuffDamageReductionBoost;
+ Player.manaRegenDelayBonus += 1;
+ Player.manaRegenBonus += 75 + (int)(600 * (float)Math.Pow((1 - ((float)Player.statMana / (float)Player.statManaMax2)), 2));
}
if (frostFlare)
diff --git a/CalPlayer/DrawLayers/HeldItemGlowMaskLayer.cs b/CalPlayer/DrawLayers/HeldItemGlowMaskLayer.cs
index d5a92f8bfc..74577bfced 100644
--- a/CalPlayer/DrawLayers/HeldItemGlowMaskLayer.cs
+++ b/CalPlayer/DrawLayers/HeldItemGlowMaskLayer.cs
@@ -35,6 +35,8 @@ namespace CalamityMod.CalPlayer.DrawLayers
if (itemType < ItemID.Count)
return;
+ Color color = new Color(250, 250, 250, heldItem.alpha);
+
// This is ugly and I don't give a fuck.
// If you want it to look better, do it yourself.
Texture2D glowMask = default;
@@ -62,8 +64,6 @@ namespace CalamityMod.CalPlayer.DrawLayers
glowMask = ModContent.Request("CalamityMod/Items/Weapons/Summon/EtherealSubjugatorGlow").Value;
else if (itemType == ModContent.ItemType())
glowMask = ModContent.Request("CalamityMod/Items/Weapons/Melee/ExcelsusGlow").Value;
- else if (itemType == ModContent.ItemType())
- glowMask = ModContent.Request("CalamityMod/Items/Weapons/Melee/IridescentExcaliburGlow").Value;
else if (itemType == ModContent.ItemType())
glowMask = ModContent.Request("CalamityMod/Items/Weapons/Magic/FatesRevealGlow").Value;
else if (itemType == ModContent.ItemType())
@@ -75,7 +75,10 @@ namespace CalamityMod.CalPlayer.DrawLayers
else if (itemType == ModContent.ItemType())
glowMask = ModContent.Request("CalamityMod/Items/SummonItems/NecroplasmicBeaconGlow").Value;
else if (itemType == ModContent.ItemType())
+ {
+ color = Color.Lerp(Color.White, drawPlayer.Calamity().lightRGB, 0.75f) with { A = 0 };
glowMask = ModContent.Request("CalamityMod/Items/Weapons/Melee/OrderbringerGlow").Value;
+ }
else if (itemType == ModContent.ItemType())
glowMask = ModContent.Request("CalamityMod/Items/Weapons/Magic/PhotosynthesisGlow").Value;
else if (itemType == ModContent.ItemType())
@@ -140,7 +143,6 @@ namespace CalamityMod.CalPlayer.DrawLayers
if (drawInfo.shadow != 0f || drawPlayer.frozen || !(inUse || visuallyHeld) || itemType <= 0 || drawPlayer.dead || heldItem.noUseGraphic || (drawPlayer.wet && heldItem.noWet) || (drawPlayer.happyFunTorchTime && drawPlayer.inventory[drawPlayer.selectedItem].createTile == TileID.Torches && drawPlayer.itemAnimation == 0))
return;
- Color color = new Color(250, 250, 250, heldItem.alpha);
Vector2 originOffset = Vector2.Zero;
// Use to adjust glow mask draw offset and color.
diff --git a/DataStructures/NPCStats.cs b/DataStructures/NPCStats.cs
index 18cef5a312..c346d23677 100644
--- a/DataStructures/NPCStats.cs
+++ b/DataStructures/NPCStats.cs
@@ -261,7 +261,7 @@ namespace CalamityMod
{ ModContent.NPCType(), 0.8 },
- { ModContent.NPCType(), 0.8 },
+ { ModContent.NPCType(), 0.8 },
{ ModContent.NPCType(), 0.8 },
{ ModContent.NPCType(), 0.8 },
@@ -510,8 +510,8 @@ namespace CalamityMod
{ ModContent.NPCType(), new int[] { 100, 200, 220, 240, 300 } },
{ ModContent.NPCType(), new int[] { 100, 200, 220, 232, 300 } },
- { ModContent.NPCType(), new int[] { 170, 256, 288, 320, 504 } },
- { ModContent.NPCType(), new int[] { 145, 220, 242, 264, 435 } },
+ { ModContent.NPCType(), new int[] { 170, 256, 288, 320, 504 } },
+ { ModContent.NPCType(), new int[] { 145, 220, 242, 264, 435 } },
{ ModContent.NPCType(), new int[] { 240, 360, 396, 432, 720 } },
{ ModContent.NPCType(), new int[] { 175, 260, 288, 316, 525 } },
@@ -769,8 +769,8 @@ namespace CalamityMod
{ new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 192, 220, 248, 360 } },
{ new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 35, 50, 50, 0, 0 } },
- { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 220, 244, 268, 420 } },
- { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 200, 300, 332, 364, 600 } },
+ { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 220, 244, 268, 420 } },
+ { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 200, 300, 332, 364, 600 } },
{ new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 150, 264, 288, 312, 450 } }, // Split holy fire does: 113, 198, 216, 234, 338
{ new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 192, 220, 248, 360 } },
diff --git a/Events/BossRushEvent.cs b/Events/BossRushEvent.cs
index d3bf603ee5..42f0556052 100644
--- a/Events/BossRushEvent.cs
+++ b/Events/BossRushEvent.cs
@@ -309,7 +309,7 @@ namespace CalamityMod.Events
NPC.SpawnOnPlayer(ClosestPlayerToWorldCenter, type);
}, permittedNPCs: new int[] { ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType() }),
- new Boss(ModContent.NPCType(), permittedNPCs: new int[] { ModContent.NPCType() }),
+ new Boss(ModContent.NPCType(), permittedNPCs: new int[] { ModContent.NPCType() }),
new Boss(ModContent.NPCType(), TimeChangeContext.Day, type =>
{
diff --git a/ExtraTextures/ExtraTextureRefs.cs b/ExtraTextures/ExtraTextureRefs.cs
index bc86cb89a7..ab359512cb 100644
--- a/ExtraTextures/ExtraTextureRefs.cs
+++ b/ExtraTextures/ExtraTextureRefs.cs
@@ -19,7 +19,6 @@ namespace CalamityMod.ExtraTextures
public static Asset DestroyerHeadGlowmask;
public static Asset DestroyerBodyGlowmask;
public static Asset DestroyerTailGlowmask;
- public static Asset ProbeGlowmask;
// Master Rev+ Skeletron Prime
public static Asset ChadPrime;
@@ -62,8 +61,6 @@ namespace CalamityMod.ExtraTextures
DestroyerBodyGlowmask = ModContent.Request("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerBodyGlow", AssetRequestMode.AsyncLoad);
DestroyerTailGlowmask = ModContent.Request("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerTailGlow", AssetRequestMode.AsyncLoad);
- ProbeGlowmask = ModContent.Request("CalamityMod/ExtraTextures/VanillaBossGlowmasks/ProbeGlow", AssetRequestMode.AsyncLoad);
-
ChadPrime = ModContent.Request("CalamityMod/ExtraTextures/ChadPrime", AssetRequestMode.AsyncLoad);
ChadPrimeEyeGlowmask = ModContent.Request("CalamityMod/ExtraTextures/ChadPrimeHeadGlow", AssetRequestMode.AsyncLoad);
diff --git a/ExtraTextures/VanillaBossGlowmasks/ProbeGlow.png b/ExtraTextures/VanillaBossGlowmasks/ProbeGlow.png
deleted file mode 100644
index c0105e82e4..0000000000
Binary files a/ExtraTextures/VanillaBossGlowmasks/ProbeGlow.png and /dev/null differ
diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs
index e8dd980253..f972954fa5 100644
--- a/ILEditing/ILChangesLoading.cs
+++ b/ILEditing/ILChangesLoading.cs
@@ -192,6 +192,7 @@ namespace CalamityMod.ILEditing
// Removal of vanilla stupidity
IL_Player.StatusFromNPC += RemoveExpertBrainRandomDebuffs;
+ IL_NPC.StrikeNPC_HitInfo_bool_bool += LetDetonatingBubblesTakeDamage;
IL_Player.ItemCheck_EmitUseVisuals += MakeMagmaStoneFireGauntletDustToggleable;
IL_Projectile.EmitEnchantmentVisualsAt += MakeMagmaStoneFireGauntletProjectileDustToggleable;
IL_Sandstorm.HasSufficientWind += DecreaseSandstormWindSpeedRequirement;
diff --git a/ILEditing/VanillaStupidityFixingILChanges.cs b/ILEditing/VanillaStupidityFixingILChanges.cs
index 80c15173f8..d3f3c0cc40 100644
--- a/ILEditing/VanillaStupidityFixingILChanges.cs
+++ b/ILEditing/VanillaStupidityFixingILChanges.cs
@@ -9,6 +9,7 @@ using CalamityMod.NPCs.AcidRain;
using CalamityMod.NPCs.NormalNPCs;
using CalamityMod.NPCs.TownNPCs;
using CalamityMod.Walls;
+using CalamityMod.World;
using Microsoft.Xna.Framework;
using Mono.Cecil.Cil;
using MonoMod.Cil;
@@ -174,12 +175,47 @@ namespace CalamityMod.ILEditing
}
// Remove the Expert Mode check, and in its place put a check for the Zenith seed (Get fixed boi).
- // Note from CIT: I originally removed these entirely;
cursor.Emit(OpCodes.Pop);
cursor.Emit(OpCodes.Ldsfld, typeof(Main).GetField("zenithWorld"));
}
#endregion
+ #region Disable Detonating Bubble StrikeNPC Hardcoded Override
+ private static void LetDetonatingBubblesTakeDamage(ILContext il)
+ {
+ // In vanilla's StrikeNPC function, Detonating Bubbles have a hardcoded type check which sets the damage of the strike to 0.
+ // This IL edit disables that type check in Death Mode.
+ var cursor = new ILCursor(il);
+
+ // Go to the point after the check for the Detonating Bubble NPC ID.
+ if (!cursor.TryGotoNext(MoveType.AfterLabel, i => i.MatchLdcR8(0.0)))
+ {
+ LogFailure("Let Detonating Bubbles Take Damage in Death", "Could not move after the NPC type check.");
+ return;
+ }
+
+ // Define the label.
+ var label = il.DefineLabel();
+
+ // Add a branch if it is Death Mode.
+ cursor.Emit(OpCodes.Ldsfld, typeof(CalamityWorld).GetField("death"));
+ cursor.Emit(OpCodes.Brtrue, label);
+
+ // Move to the point after Detonating Bubble changes are implemented to place the branch label.
+ if (!cursor.TryGotoNext(MoveType.After, i => i.MatchStfld("dontTakeDamage")))
+ {
+ LogFailure("Let Detonating Bubbles Take Damage in Death", "Could not move to after the Detonating Bubble logic.");
+ return;
+ }
+ if (!cursor.TryGotoNext(MoveType.AfterLabel, i => i.MatchLdarg0()))
+ {
+ LogFailure("Let Detonating Bubbles Take Damage in Death", "Could not move to after the Detonating Bubble logic.");
+ return;
+ }
+ cursor.MarkLabel(label);
+ }
+ #endregion
+
#region Make Meteorite Explodable
private static void MakeMeteoriteExplodable(ILContext il)
{
diff --git a/Items/Accessories/Vanity/LucisSight.cs b/Items/Accessories/Vanity/LucisSight.cs
new file mode 100644
index 0000000000..0afdc9724c
--- /dev/null
+++ b/Items/Accessories/Vanity/LucisSight.cs
@@ -0,0 +1,32 @@
+using Terraria;
+using Terraria.ID;
+using Terraria.ModLoader;
+
+namespace CalamityMod.Items.Accessories.Vanity
+{
+ [AutoloadEquip(EquipType.Face)]
+ public class LucisSight : ModItem, ILocalizedModType
+ {
+ public new string LocalizationCategory => "Items.Accessories";
+
+ public override void SetStaticDefaults()
+ {
+ if (!Main.dedServ)
+ {
+ int equipSlot = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Face);
+ ArmorIDs.Face.Sets.DrawInFaceUnderHairLayer[equipSlot] = true;
+ }
+ }
+
+ public override void SetDefaults()
+ {
+ Item.width = 28;
+ Item.height = 18;
+ Item.value = Item.buyPrice(gold: 10); // Sold by Steampunker
+ Item.rare = ItemRarityID.Pink;
+ Item.accessory = true;
+ Item.vanity = true;
+ Item.Calamity().donorItem = true;
+ }
+ }
+}
diff --git a/Items/Accessories/Vanity/LucisSight.png b/Items/Accessories/Vanity/LucisSight.png
new file mode 100644
index 0000000000..47aa49c9a1
Binary files /dev/null and b/Items/Accessories/Vanity/LucisSight.png differ
diff --git a/Items/Accessories/Vanity/LucisSight_Face.png b/Items/Accessories/Vanity/LucisSight_Face.png
new file mode 100644
index 0000000000..b56c28cf6e
Binary files /dev/null and b/Items/Accessories/Vanity/LucisSight_Face.png differ
diff --git a/Items/Accessories/Vanity/XyksBlessingBlue.cs b/Items/Accessories/Vanity/XyksBlessingBlue.cs
index 7df7a6b928..0ebe73db84 100644
--- a/Items/Accessories/Vanity/XyksBlessingBlue.cs
+++ b/Items/Accessories/Vanity/XyksBlessingBlue.cs
@@ -22,7 +22,6 @@ namespace CalamityMod.Items.Accessories.Vanity
EquipLoader.AddEquipTexture(Mod, "CalamityMod/Projectiles/InvisibleProj", EquipType.Wings, this);
}
}
-
public override void SetStaticDefaults()
{
if (Main.dedServ)
@@ -44,17 +43,15 @@ namespace CalamityMod.Items.Accessories.Vanity
Item.width = 36;
Item.height = 34;
Item.accessory = true;
- Item.consumable = true;
Item.vanity = true;
Item.rare = ModContent.RarityType();
Item.value = CalamityGlobalItem.RarityBlueBuyPrice;
Item.Calamity().devItem = true;
}
public override bool CanRightClick() => true;
-
- public override void ModifyItemLoot(ItemLoot itemLoot)
+ public override void RightClick(Player player)
{
- itemLoot.Add(ModContent.ItemType());
+ player.PutItemInInventoryFromItemUsage(ModContent.ItemType(), 1);
}
public override void UpdateVanity(Player player)
{
diff --git a/Items/Accessories/Vanity/XyksBlessingOrange.cs b/Items/Accessories/Vanity/XyksBlessingOrange.cs
index 29f2d69f89..9e20a49940 100644
--- a/Items/Accessories/Vanity/XyksBlessingOrange.cs
+++ b/Items/Accessories/Vanity/XyksBlessingOrange.cs
@@ -44,17 +44,15 @@ namespace CalamityMod.Items.Accessories.Vanity
Item.width = 36;
Item.height = 34;
Item.accessory = true;
- Item.consumable = true;
Item.vanity = true;
Item.rare = ModContent.RarityType();
Item.value = CalamityGlobalItem.RarityBlueBuyPrice;
Item.Calamity().devItem = true;
}
public override bool CanRightClick() => true;
-
- public override void ModifyItemLoot(ItemLoot itemLoot)
+ public override void RightClick(Player player)
{
- itemLoot.Add(ModContent.ItemType());
+ player.PutItemInInventoryFromItemUsage(ModContent.ItemType(), 1);
}
public override void UpdateVanity(Player player)
{
diff --git a/Items/Armor/Aerospec/AerospecHat.cs b/Items/Armor/Aerospec/AerospecHeadMagic.cs
similarity index 95%
rename from Items/Armor/Aerospec/AerospecHat.cs
rename to Items/Armor/Aerospec/AerospecHeadMagic.cs
index 5b81c6206c..084d548d20 100644
--- a/Items/Armor/Aerospec/AerospecHat.cs
+++ b/Items/Armor/Aerospec/AerospecHeadMagic.cs
@@ -7,7 +7,8 @@ using Terraria.ModLoader;
namespace CalamityMod.Items.Armor.Aerospec
{
[AutoloadEquip(EquipType.Head)]
- public class AerospecHat : ModItem, ILocalizedModType
+ [LegacyName("AerospecHat")]
+ public class AerospecHeadMagic : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Armor.PreHardmode";
public override void SetDefaults()
diff --git a/Items/Armor/Aerospec/AerospecHat.png b/Items/Armor/Aerospec/AerospecHeadMagic.png
similarity index 100%
rename from Items/Armor/Aerospec/AerospecHat.png
rename to Items/Armor/Aerospec/AerospecHeadMagic.png
diff --git a/Items/Armor/Aerospec/AerospecHat_Head.png b/Items/Armor/Aerospec/AerospecHeadMagic_Head.png
similarity index 100%
rename from Items/Armor/Aerospec/AerospecHat_Head.png
rename to Items/Armor/Aerospec/AerospecHeadMagic_Head.png
diff --git a/Items/Armor/Aerospec/AerospecHelm.cs b/Items/Armor/Aerospec/AerospecHeadMelee.cs
similarity index 94%
rename from Items/Armor/Aerospec/AerospecHelm.cs
rename to Items/Armor/Aerospec/AerospecHeadMelee.cs
index 0a8e39c35d..1d7b21e058 100644
--- a/Items/Armor/Aerospec/AerospecHelm.cs
+++ b/Items/Armor/Aerospec/AerospecHeadMelee.cs
@@ -7,7 +7,8 @@ using Terraria.ModLoader;
namespace CalamityMod.Items.Armor.Aerospec
{
[AutoloadEquip(EquipType.Head)]
- public class AerospecHelm : ModItem, ILocalizedModType
+ [LegacyName("AerospecHelm")]
+ public class AerospecHeadMelee : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Armor.PreHardmode";
public override void SetDefaults()
@@ -52,7 +53,7 @@ namespace CalamityMod.Items.Armor.Aerospec
AddIngredient(ItemID.SunplateBlock, 3).
AddIngredient(ItemID.Feather).
AddTile(TileID.Anvils).
- SortBeforeFirstRecipesOf(ModContent.ItemType()).
+ SortBeforeFirstRecipesOf(ModContent.ItemType()).
Register();
}
}
diff --git a/Items/Armor/Aerospec/AerospecHelm.png b/Items/Armor/Aerospec/AerospecHeadMelee.png
similarity index 100%
rename from Items/Armor/Aerospec/AerospecHelm.png
rename to Items/Armor/Aerospec/AerospecHeadMelee.png
diff --git a/Items/Armor/Aerospec/AerospecHelm_Head.png b/Items/Armor/Aerospec/AerospecHeadMelee_Head.png
similarity index 100%
rename from Items/Armor/Aerospec/AerospecHelm_Head.png
rename to Items/Armor/Aerospec/AerospecHeadMelee_Head.png
diff --git a/Items/Armor/Aerospec/AerospecHood.cs b/Items/Armor/Aerospec/AerospecHeadRanged.cs
similarity index 94%
rename from Items/Armor/Aerospec/AerospecHood.cs
rename to Items/Armor/Aerospec/AerospecHeadRanged.cs
index 6b41319026..01fc45869d 100644
--- a/Items/Armor/Aerospec/AerospecHood.cs
+++ b/Items/Armor/Aerospec/AerospecHeadRanged.cs
@@ -7,7 +7,8 @@ using Terraria.ModLoader;
namespace CalamityMod.Items.Armor.Aerospec
{
[AutoloadEquip(EquipType.Head)]
- public class AerospecHood : ModItem, ILocalizedModType
+ [LegacyName("AerospecHood")]
+ public class AerospecHeadRanged : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Armor.PreHardmode";
public override void SetDefaults()
@@ -51,7 +52,7 @@ namespace CalamityMod.Items.Armor.Aerospec
AddIngredient(ItemID.SunplateBlock, 3).
AddIngredient(ItemID.Feather).
AddTile(TileID.Anvils).
- SortAfterFirstRecipesOf(ModContent.ItemType()).
+ SortAfterFirstRecipesOf(ModContent.ItemType()).
Register();
}
}
diff --git a/Items/Armor/Aerospec/AerospecHood.png b/Items/Armor/Aerospec/AerospecHeadRanged.png
similarity index 100%
rename from Items/Armor/Aerospec/AerospecHood.png
rename to Items/Armor/Aerospec/AerospecHeadRanged.png
diff --git a/Items/Armor/Aerospec/AerospecHood_Head.png b/Items/Armor/Aerospec/AerospecHeadRanged_Head.png
similarity index 100%
rename from Items/Armor/Aerospec/AerospecHood_Head.png
rename to Items/Armor/Aerospec/AerospecHeadRanged_Head.png
diff --git a/Items/Armor/Aerospec/AerospecHeadgear.cs b/Items/Armor/Aerospec/AerospecHeadRogue.cs
similarity index 94%
rename from Items/Armor/Aerospec/AerospecHeadgear.cs
rename to Items/Armor/Aerospec/AerospecHeadRogue.cs
index e4e6d096d3..be4a49a3d4 100644
--- a/Items/Armor/Aerospec/AerospecHeadgear.cs
+++ b/Items/Armor/Aerospec/AerospecHeadRogue.cs
@@ -7,7 +7,8 @@ using Terraria.ModLoader;
namespace CalamityMod.Items.Armor.Aerospec
{
[AutoloadEquip(EquipType.Head)]
- public class AerospecHeadgear : ModItem, ILocalizedModType
+ [LegacyName("AerospecHeadgear")]
+ public class AerospecHeadRogue : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Armor.PreHardmode";
public override void SetStaticDefaults()
@@ -60,7 +61,7 @@ namespace CalamityMod.Items.Armor.Aerospec
AddIngredient(ItemID.SunplateBlock, 3).
AddIngredient(ItemID.Feather).
AddTile(TileID.Anvils).
- SortAfterFirstRecipesOf(ModContent.ItemType()).
+ SortAfterFirstRecipesOf(ModContent.ItemType()).
Register();
}
}
diff --git a/Items/Armor/Aerospec/AerospecHeadgear.png b/Items/Armor/Aerospec/AerospecHeadRogue.png
similarity index 100%
rename from Items/Armor/Aerospec/AerospecHeadgear.png
rename to Items/Armor/Aerospec/AerospecHeadRogue.png
diff --git a/Items/Armor/Aerospec/AerospecHeadgear_Head.png b/Items/Armor/Aerospec/AerospecHeadRogue_Head.png
similarity index 100%
rename from Items/Armor/Aerospec/AerospecHeadgear_Head.png
rename to Items/Armor/Aerospec/AerospecHeadRogue_Head.png
diff --git a/Items/Armor/Aerospec/AerospecHelmet.cs b/Items/Armor/Aerospec/AerospecHeadSummon.cs
similarity index 96%
rename from Items/Armor/Aerospec/AerospecHelmet.cs
rename to Items/Armor/Aerospec/AerospecHeadSummon.cs
index 2ab7b3fd09..b54a722b93 100644
--- a/Items/Armor/Aerospec/AerospecHelmet.cs
+++ b/Items/Armor/Aerospec/AerospecHeadSummon.cs
@@ -10,7 +10,8 @@ using Terraria.ModLoader;
namespace CalamityMod.Items.Armor.Aerospec
{
[AutoloadEquip(EquipType.Head)]
- public class AerospecHelmet : ModItem, ILocalizedModType
+ [LegacyName("AerospecHelmet")]
+ public class AerospecHeadSummon : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Armor.PreHardmode";
public static int ValkyrieDamage = 20;
@@ -74,7 +75,7 @@ namespace CalamityMod.Items.Armor.Aerospec
AddIngredient(ItemID.SunplateBlock, 3).
AddIngredient(ItemID.Feather).
AddTile(TileID.Anvils).
- SortBeforeFirstRecipesOf(ModContent.ItemType()).
+ SortBeforeFirstRecipesOf(ModContent.ItemType()).
Register();
}
}
diff --git a/Items/Armor/Aerospec/AerospecHelmet.png b/Items/Armor/Aerospec/AerospecHeadSummon.png
similarity index 100%
rename from Items/Armor/Aerospec/AerospecHelmet.png
rename to Items/Armor/Aerospec/AerospecHeadSummon.png
diff --git a/Items/Armor/Aerospec/AerospecHelmet_Head.png b/Items/Armor/Aerospec/AerospecHeadSummon_Head.png
similarity index 100%
rename from Items/Armor/Aerospec/AerospecHelmet_Head.png
rename to Items/Armor/Aerospec/AerospecHeadSummon_Head.png
diff --git a/Items/Armor/Auric/AuricTeslaWireHemmedVisage.cs b/Items/Armor/Auric/AuricTeslaHeadMagic.cs
similarity index 96%
rename from Items/Armor/Auric/AuricTeslaWireHemmedVisage.cs
rename to Items/Armor/Auric/AuricTeslaHeadMagic.cs
index aa367ba49a..6c932422b7 100644
--- a/Items/Armor/Auric/AuricTeslaWireHemmedVisage.cs
+++ b/Items/Armor/Auric/AuricTeslaHeadMagic.cs
@@ -12,7 +12,8 @@ using Terraria.ModLoader;
namespace CalamityMod.Items.Armor.Auric
{
[AutoloadEquip(EquipType.Head)]
- public class AuricTeslaWireHemmedVisage : ModItem, ILocalizedModType
+ [LegacyName("AuricTeslaWireHemmedVisage")]
+ public class AuricTeslaHeadMagic : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Armor.PostMoonLord";
public override void SetDefaults()
@@ -95,7 +96,7 @@ namespace CalamityMod.Items.Armor.Auric
AddIngredient().
AddIngredient(12).
AddTile().
- SortBeforeFirstRecipesOf(ModContent.ItemType()).
+ SortBeforeFirstRecipesOf(ModContent.ItemType()).
Register();
}
}
diff --git a/Items/Armor/Auric/AuricTeslaWireHemmedVisage.png b/Items/Armor/Auric/AuricTeslaHeadMagic.png
similarity index 100%
rename from Items/Armor/Auric/AuricTeslaWireHemmedVisage.png
rename to Items/Armor/Auric/AuricTeslaHeadMagic.png
diff --git a/Items/Armor/Auric/AuricTeslaWireHemmedVisage_Head.png b/Items/Armor/Auric/AuricTeslaHeadMagic_Head.png
similarity index 100%
rename from Items/Armor/Auric/AuricTeslaWireHemmedVisage_Head.png
rename to Items/Armor/Auric/AuricTeslaHeadMagic_Head.png
diff --git a/Items/Armor/Auric/AuricTeslaRoyalHelm.cs b/Items/Armor/Auric/AuricTeslaHeadMelee.cs
similarity index 97%
rename from Items/Armor/Auric/AuricTeslaRoyalHelm.cs
rename to Items/Armor/Auric/AuricTeslaHeadMelee.cs
index ce0b3e9aae..bb5430ef7a 100644
--- a/Items/Armor/Auric/AuricTeslaRoyalHelm.cs
+++ b/Items/Armor/Auric/AuricTeslaHeadMelee.cs
@@ -15,7 +15,8 @@ namespace CalamityMod.Items.Armor.Auric
{
[AutoloadEquip(EquipType.Head)]
[LegacyName("AuricTeslaHelm")]
- public class AuricTeslaRoyalHelm : ModItem, ILocalizedModType
+ [LegacyName("AuricTeslaRoyalHelm")]
+ public class AuricTeslaHeadMelee : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Armor.PostMoonLord";
public override void SetDefaults()
@@ -103,7 +104,7 @@ namespace CalamityMod.Items.Armor.Auric
AddIngredient().
AddIngredient(12).
AddTile().
- SortBeforeFirstRecipesOf(ModContent.ItemType()).
+ SortBeforeFirstRecipesOf(ModContent.ItemType()).
Register();
}
}
diff --git a/Items/Armor/Auric/AuricTeslaRoyalHelm.png b/Items/Armor/Auric/AuricTeslaHeadMelee.png
similarity index 100%
rename from Items/Armor/Auric/AuricTeslaRoyalHelm.png
rename to Items/Armor/Auric/AuricTeslaHeadMelee.png
diff --git a/Items/Armor/Auric/AuricTeslaRoyalHelm_Head.png b/Items/Armor/Auric/AuricTeslaHeadMelee_Head.png
similarity index 100%
rename from Items/Armor/Auric/AuricTeslaRoyalHelm_Head.png
rename to Items/Armor/Auric/AuricTeslaHeadMelee_Head.png
diff --git a/Items/Armor/Auric/AuricTeslaHoodedFacemask.cs b/Items/Armor/Auric/AuricTeslaHeadRanged.cs
similarity index 96%
rename from Items/Armor/Auric/AuricTeslaHoodedFacemask.cs
rename to Items/Armor/Auric/AuricTeslaHeadRanged.cs
index 061585b631..27e6e250ed 100644
--- a/Items/Armor/Auric/AuricTeslaHoodedFacemask.cs
+++ b/Items/Armor/Auric/AuricTeslaHeadRanged.cs
@@ -13,7 +13,8 @@ using Terraria.ModLoader;
namespace CalamityMod.Items.Armor.Auric
{
[AutoloadEquip(EquipType.Head)]
- public class AuricTeslaHoodedFacemask : ModItem, ILocalizedModType
+ [LegacyName("AuricTeslaHoodedFacemask")]
+ public class AuricTeslaHeadRanged : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Armor.PostMoonLord";
public override void SetDefaults()
@@ -98,7 +99,7 @@ namespace CalamityMod.Items.Armor.Auric
AddIngredient().
AddIngredient(12).
AddTile().
- SortBeforeFirstRecipesOf(ModContent.ItemType()).
+ SortBeforeFirstRecipesOf(ModContent.ItemType()).
Register();
}
}
diff --git a/Items/Armor/Auric/AuricTeslaHoodedFacemask.png b/Items/Armor/Auric/AuricTeslaHeadRanged.png
similarity index 100%
rename from Items/Armor/Auric/AuricTeslaHoodedFacemask.png
rename to Items/Armor/Auric/AuricTeslaHeadRanged.png
diff --git a/Items/Armor/Auric/AuricTeslaHoodedFacemask_Head.png b/Items/Armor/Auric/AuricTeslaHeadRanged_Head.png
similarity index 100%
rename from Items/Armor/Auric/AuricTeslaHoodedFacemask_Head.png
rename to Items/Armor/Auric/AuricTeslaHeadRanged_Head.png
diff --git a/Items/Armor/Auric/AuricTeslaPlumedHelm.cs b/Items/Armor/Auric/AuricTeslaHeadRogue.cs
similarity index 97%
rename from Items/Armor/Auric/AuricTeslaPlumedHelm.cs
rename to Items/Armor/Auric/AuricTeslaHeadRogue.cs
index e7bc207d37..bab13f54b6 100644
--- a/Items/Armor/Auric/AuricTeslaPlumedHelm.cs
+++ b/Items/Armor/Auric/AuricTeslaHeadRogue.cs
@@ -13,7 +13,8 @@ using Terraria.ModLoader;
namespace CalamityMod.Items.Armor.Auric
{
[AutoloadEquip(EquipType.Head)]
- public class AuricTeslaPlumedHelm : ModItem, ILocalizedModType
+ [LegacyName("AuricTeslaPlumedHelm")]
+ public class AuricTeslaHeadRogue : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Armor.PostMoonLord";
public override void SetDefaults()
diff --git a/Items/Armor/Auric/AuricTeslaPlumedHelm.png b/Items/Armor/Auric/AuricTeslaHeadRogue.png
similarity index 100%
rename from Items/Armor/Auric/AuricTeslaPlumedHelm.png
rename to Items/Armor/Auric/AuricTeslaHeadRogue.png
diff --git a/Items/Armor/Auric/AuricTeslaPlumedHelm_Head.png b/Items/Armor/Auric/AuricTeslaHeadRogue_Head.png
similarity index 100%
rename from Items/Armor/Auric/AuricTeslaPlumedHelm_Head.png
rename to Items/Armor/Auric/AuricTeslaHeadRogue_Head.png
diff --git a/Items/Armor/Auric/AuricTeslaSpaceHelmet.cs b/Items/Armor/Auric/AuricTeslaHeadSummon.cs
similarity index 96%
rename from Items/Armor/Auric/AuricTeslaSpaceHelmet.cs
rename to Items/Armor/Auric/AuricTeslaHeadSummon.cs
index b15fc1f6fd..44c56a3720 100644
--- a/Items/Armor/Auric/AuricTeslaSpaceHelmet.cs
+++ b/Items/Armor/Auric/AuricTeslaHeadSummon.cs
@@ -12,7 +12,8 @@ using Terraria.ModLoader;
namespace CalamityMod.Items.Armor.Auric
{
[AutoloadEquip(EquipType.Head)]
- public class AuricTeslaSpaceHelmet : ModItem, ILocalizedModType
+ [LegacyName("AuricTeslaSpaceHelmet")]
+ public class AuricTeslaHeadSummon : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Armor.PostMoonLord";
public override void SetDefaults()
@@ -95,7 +96,7 @@ namespace CalamityMod.Items.Armor.Auric
AddIngredient().
AddIngredient(12).
AddTile().
- SortBeforeFirstRecipesOf(ModContent.ItemType()).
+ SortBeforeFirstRecipesOf(ModContent.ItemType()).
Register();
}
}
diff --git a/Items/Armor/Auric/AuricTeslaSpaceHelmet.png b/Items/Armor/Auric/AuricTeslaHeadSummon.png
similarity index 100%
rename from Items/Armor/Auric/AuricTeslaSpaceHelmet.png
rename to Items/Armor/Auric/AuricTeslaHeadSummon.png
diff --git a/Items/Armor/Auric/AuricTeslaSpaceHelmet_Head.png b/Items/Armor/Auric/AuricTeslaHeadSummon_Head.png
similarity index 100%
rename from Items/Armor/Auric/AuricTeslaSpaceHelmet_Head.png
rename to Items/Armor/Auric/AuricTeslaHeadSummon_Head.png
diff --git a/Items/Armor/Vanity/LucisBoots.cs b/Items/Armor/Vanity/LucisBoots.cs
new file mode 100644
index 0000000000..da9ce01a0c
--- /dev/null
+++ b/Items/Armor/Vanity/LucisBoots.cs
@@ -0,0 +1,22 @@
+using Terraria;
+using Terraria.ID;
+using Terraria.ModLoader;
+
+namespace CalamityMod.Items.Armor.Vanity
+{
+ [AutoloadEquip(EquipType.Legs)]
+ public class LucisBoots : ModItem, ILocalizedModType
+ {
+ public new string LocalizationCategory => "Items.Armor.Vanity";
+
+ public override void SetDefaults()
+ {
+ Item.width = 28;
+ Item.height = 20;
+ Item.value = Item.buyPrice(gold: 10); // Sold by Steampunker
+ Item.rare = ItemRarityID.Pink;
+ Item.vanity = true;
+ Item.Calamity().donorItem = true;
+ }
+ }
+}
diff --git a/Items/Armor/Vanity/LucisBoots.png b/Items/Armor/Vanity/LucisBoots.png
new file mode 100644
index 0000000000..2b91e15ca4
Binary files /dev/null and b/Items/Armor/Vanity/LucisBoots.png differ
diff --git a/Items/Armor/Vanity/LucisBoots_Legs.png b/Items/Armor/Vanity/LucisBoots_Legs.png
new file mode 100644
index 0000000000..cb73585b17
Binary files /dev/null and b/Items/Armor/Vanity/LucisBoots_Legs.png differ
diff --git a/Items/Armor/Vanity/LucisHairstyle.cs b/Items/Armor/Vanity/LucisHairstyle.cs
new file mode 100644
index 0000000000..6af1251c18
--- /dev/null
+++ b/Items/Armor/Vanity/LucisHairstyle.cs
@@ -0,0 +1,22 @@
+using Terraria;
+using Terraria.ID;
+using Terraria.ModLoader;
+
+namespace CalamityMod.Items.Armor.Vanity
+{
+ [AutoloadEquip(EquipType.Head)]
+ public class LucisHairstyle : ModItem, ILocalizedModType
+ {
+ public new string LocalizationCategory => "Items.Armor.Vanity";
+
+ public override void SetDefaults()
+ {
+ Item.width = 28;
+ Item.height = 20;
+ Item.value = Item.buyPrice(gold: 10); // Sold by Steampunker
+ Item.rare = ItemRarityID.Pink;
+ Item.vanity = true;
+ Item.Calamity().donorItem = true; // Donor: xAqult (Sprites made by Gote)
+ }
+ }
+}
diff --git a/Items/Armor/Vanity/LucisHairstyle.png b/Items/Armor/Vanity/LucisHairstyle.png
new file mode 100644
index 0000000000..5808d53012
Binary files /dev/null and b/Items/Armor/Vanity/LucisHairstyle.png differ
diff --git a/Items/Armor/Vanity/LucisHairstyle_Head.png b/Items/Armor/Vanity/LucisHairstyle_Head.png
new file mode 100644
index 0000000000..682ad154ba
Binary files /dev/null and b/Items/Armor/Vanity/LucisHairstyle_Head.png differ
diff --git a/Items/Armor/Vanity/LucisMilitaryUniform.cs b/Items/Armor/Vanity/LucisMilitaryUniform.cs
new file mode 100644
index 0000000000..c2fde13007
--- /dev/null
+++ b/Items/Armor/Vanity/LucisMilitaryUniform.cs
@@ -0,0 +1,22 @@
+using Terraria;
+using Terraria.ID;
+using Terraria.ModLoader;
+
+namespace CalamityMod.Items.Armor.Vanity
+{
+ [AutoloadEquip(EquipType.Body)]
+ public class LucisMilitaryUniform : ModItem, ILocalizedModType
+ {
+ public new string LocalizationCategory => "Items.Armor.Vanity";
+
+ public override void SetDefaults()
+ {
+ Item.width = 26;
+ Item.height = 20;
+ Item.value = Item.buyPrice(gold: 10); // Sold by Steampunker
+ Item.rare = ItemRarityID.Pink;
+ Item.vanity = true;
+ Item.Calamity().donorItem = true;
+ }
+ }
+}
diff --git a/Items/Armor/Vanity/LucisMilitaryUniform.png b/Items/Armor/Vanity/LucisMilitaryUniform.png
new file mode 100644
index 0000000000..d8017d98d0
Binary files /dev/null and b/Items/Armor/Vanity/LucisMilitaryUniform.png differ
diff --git a/Items/Armor/Vanity/LucisMilitaryUniform_Body.png b/Items/Armor/Vanity/LucisMilitaryUniform_Body.png
new file mode 100644
index 0000000000..dcdee4ba2a
Binary files /dev/null and b/Items/Armor/Vanity/LucisMilitaryUniform_Body.png differ
diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs
index 2a35ce43b4..860b98a4e5 100644
--- a/Items/CalamityGlobalItemTooltip.cs
+++ b/Items/CalamityGlobalItemTooltip.cs
@@ -6,6 +6,7 @@ using CalamityMod.Balancing;
using CalamityMod.CustomRecipes;
using CalamityMod.DataStructures;
using CalamityMod.Items.Accessories;
+using CalamityMod.Items.Accessories.Vanity;
using CalamityMod.Items.Armor.Demonshade;
using CalamityMod.Items.PermanentBoosters;
using CalamityMod.Items.Tools;
@@ -289,7 +290,7 @@ namespace CalamityMod.Items
#region Rarity Coloration
private static void ApplyRarityColor(Item item, TooltipLine nameLine)
{
- if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || item.type == ModContent.ItemType())
+ if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType())
nameLine.OverrideColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB);
// Developer items
@@ -1633,6 +1634,128 @@ namespace CalamityMod.Items
#region Enchanted Rarity Text Drawing
public override bool PreDrawTooltipLine(Item item, DrawableTooltipLine line, ref int yOffset)
{
+ if (line.Name == "ItemName" && line.Mod == "Terraria" && item.type == ModContent.ItemType())
+ {
+ Color rarityColor = Color.White;
+ Vector2 basePosition = new Vector2(line.X, line.Y);
+
+ float rate = Main.GlobalTimeWrappedHourly * 6;
+ List eColors = new List()
+ {
+ Color.DodgerBlue,
+ Color.Cyan,
+ Color.RoyalBlue
+ };
+ 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);
+
+ Vector2 backScale = line.BaseScale;
+ Color backColor = usedColor;
+
+ Main.spriteBatch.End();
+ Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, null, null, null, null, Main.UIScaleMatrix);
+
+ int draws = 20;
+ for (int i = 0; i < draws; i++)
+ {
+ Vector2 backPosition = basePosition + (MathHelper.TwoPi * i / 20f).ToRotationVector2() * (3.5f);
+ ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, line.Font, line.Text, backPosition, backColor, line.Rotation, line.Origin, backScale, line.MaxWidth, line.Spread);
+ }
+ Texture2D texture = ModContent.Request("CalamityMod/Particles/BloomCircle").Value;
+ Texture2D square = ModContent.Request("CalamityMod/Particles/BloomRing").Value;
+
+ Vector2 drawPosition = basePosition;
+ Color drawColor = backColor;
+ Vector2 rotationPoint = texture.Size() * 0.5f;
+ int length = line.Text.Length;
+ for (int i = 0; i < 8; i++)
+ {
+ Main.EntitySpriteDraw(texture, basePosition + Vector2.UnitX * length * 4 + Vector2.UnitY * 23 + Vector2.UnitX * (i % 2 == 0 ? -10 * i : 10 * i), null, drawColor, (MathHelper.PiOver2), rotationPoint, new Vector2(0.3f - 0.02f * i, 1 + 0.35f * i) * 0.3f * Main.rand.NextFloat(0.9f, 1f), SpriteEffects.None);
+ }
+ for (int i = 0; i < 10; i++)
+ {
+ float sine = (float)Math.Sin(Main.GlobalTimeWrappedHourly * (0 + i * 0.8f) / MathHelper.Pi);
+ float sine2 = (float)Math.Sin(Main.GlobalTimeWrappedHourly * (5) / MathHelper.Pi);
+ float squareSine = (float)Math.Sin(i * 2.5f / MathHelper.Pi);
+ float clockSine = (float)Math.Sin((float)Math.Pow(Utils.GetLerpValue(0, 110, ((int)(Main.GlobalTimeWrappedHourly * (60 + i * 2)) % 120)), 5));
+ Vector2 weirdPos = Vector2.UnitX * 53 * i * (Utils.GetLerpValue(20, 0, i, true)) + Vector2.UnitY * -23 * squareSine * sine2 + new Vector2(5, 10);
+ for (int t = 0; t < 3; t++)
+ Main.EntitySpriteDraw(square, basePosition + weirdPos, null, drawColor * (1 - 0.03f * i), 0, square.Size() * 0.5f, (1.2f - 0.07f * t) * new Vector2(1, 1) * (0.25f * ((float)Math.Pow(Utils.GetLerpValue(11, 0, i, true), 3) + 0.2f)), SpriteEffects.None);
+ for (int t = 0; t < 3; t++)
+ Main.EntitySpriteDraw(texture, basePosition + weirdPos, null, drawColor * (1 - 0.03f * i), 0, texture.Size() * 0.5f, (0.65f - 0.07f * t) * new Vector2(1, 1) * (0.25f * ((float)Math.Pow(Utils.GetLerpValue(11, 0, i, true), 3) + 0.2f)), SpriteEffects.None);
+ }
+
+ Main.spriteBatch.End();
+ Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, null, null, Main.UIScaleMatrix);
+
+ // Draw the front text as usual.
+ ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, line.Font, line.Text, basePosition, rarityColor, line.Rotation, line.Origin, line.BaseScale, line.MaxWidth, line.Spread);
+
+ return false;
+ }
+ if (line.Name == "ItemName" && line.Mod == "Terraria" && item.type == ModContent.ItemType())
+ {
+ Color rarityColor = Color.White;
+ Vector2 basePosition = new Vector2(line.X, line.Y);
+
+ float rate = Main.GlobalTimeWrappedHourly * 6;
+ List eColors = new List()
+ {
+ new Color(248, 117, 52),
+ Color.Gold,
+ Color.Orange
+ };
+ 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);
+
+ Vector2 backScale = line.BaseScale;
+ Color backColor = usedColor;
+
+ Main.spriteBatch.End();
+ Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, null, null, null, null, Main.UIScaleMatrix);
+
+ int draws = 20;
+ for (int i = 0; i < draws; i++)
+ {
+ Vector2 backPosition = basePosition + (MathHelper.TwoPi * i / 20f).ToRotationVector2() * (3.5f);
+ ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, line.Font, line.Text, backPosition, backColor, line.Rotation, line.Origin, backScale, line.MaxWidth, line.Spread);
+ }
+ Texture2D texture = ModContent.Request("CalamityMod/Particles/BloomCircle").Value;
+ Texture2D texture2 = ModContent.Request("CalamityMod/Particles/SquareRotated").Value;
+ Texture2D square = ModContent.Request("CalamityMod/Particles/GlowSquareParticleThick").Value;
+
+ Vector2 drawPosition = basePosition;
+ Color drawColor = backColor;
+ Vector2 rotationPoint = texture.Size() * 0.5f;
+ int length = line.Text.Length;
+ for (int i = 0; i < 8; i++)
+ {
+ Main.EntitySpriteDraw(texture, basePosition + Vector2.UnitX * length * 4 + Vector2.UnitY * 23 + Vector2.UnitX * (i % 2 == 0 ? -10 * i : 10 * i), null, drawColor, (MathHelper.PiOver2), rotationPoint, new Vector2(0.3f - 0.02f * i, 1 + 0.35f * i) * 0.3f * Main.rand.NextFloat(0.9f, 1f), SpriteEffects.None);
+ }
+ for (int i = 0; i < 10; i++)
+ {
+ float sine = (float)Math.Sin(Main.GlobalTimeWrappedHourly * (0 + i * 0.8f) / MathHelper.Pi);
+ float squareSine = (float)Math.Sin(i * 2.5f / MathHelper.Pi);
+ float clockSine = (float)Math.Sin((float)Math.Pow(Utils.GetLerpValue(0, 110, ((int)(Main.GlobalTimeWrappedHourly * (60 + i * 2)) % 120)), 5));
+ Vector2 weirdPos = Vector2.UnitX * 53 * i * (Utils.GetLerpValue(20, 0, i, true)) + Vector2.UnitY * 23 * squareSine + Vector2.UnitY * 5.5f * sine + new Vector2(5, 10);
+ for (int t = 0; t < 3; t++)
+ Main.EntitySpriteDraw(square, basePosition + weirdPos, null, drawColor * (1 - 0.03f * i), clockSine * MathHelper.PiOver2 + MathHelper.PiOver4, square.Size() * 0.5f, (1 - 0.07f * t) * new Vector2(1, 1) * (0.25f * ((float)Math.Pow(Utils.GetLerpValue(11, 0, i, true), 3) + 0.2f)), SpriteEffects.None);
+ for (int t = 0; t < 3; t++)
+ Main.EntitySpriteDraw(texture2, basePosition + weirdPos, null, drawColor * (1 - 0.03f * i), clockSine * MathHelper.PiOver2, texture2.Size() * 0.5f, (0.6f - 0.07f * t) * new Vector2(1, 1) * (0.25f * ((float)Math.Pow(Utils.GetLerpValue(11, 0, i, true), 3) + 0.2f)), SpriteEffects.None);
+ }
+
+ Main.spriteBatch.End();
+ Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, null, null, Main.UIScaleMatrix);
+
+ // Draw the front text as usual.
+ ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, line.Font, line.Text, basePosition, rarityColor, line.Rotation, line.Origin, line.BaseScale, line.MaxWidth, line.Spread);
+
+ return false;
+ }
// Special enchantment line color.
if (line.Name == "ItemName" && line.Mod == "Terraria" && item.IsEnchanted())
{
@@ -1659,6 +1782,64 @@ namespace CalamityMod.Items
return false;
}
+
+ if (line.Name == "ItemName" && line.Mod == "Terraria" && item.type == ModContent.ItemType())
+ {
+ Color rarityColor = Color.White;
+ Vector2 basePosition = new Vector2(line.X, line.Y);
+
+ float rate = Main.GlobalTimeWrappedHourly * 29;
+ List eColors = new List()
+ {
+ Color.PaleVioletRed,
+ Color.Coral,
+ Color.Khaki,
+ Color.PaleGreen,
+ Color.Turquoise,
+ Color.Violet
+ };
+
+ 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);
+
+
+ float sine = (float)Math.Sin(Main.GlobalTimeWrappedHourly * 3 / MathHelper.Pi);
+ sine = (float)Math.Pow(MathHelper.Lerp(sine, 0, 0.35f), 5);
+ Vector2 backScale = line.BaseScale;
+ Color backColor = usedColor;
+ Vector2 shake = Main.rand.NextVector2Circular(15, 15) * sine;
+
+ Main.spriteBatch.End();
+ Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, null, null, null, null, Main.UIScaleMatrix);
+
+ int draws = 20;
+ for (int i = 0; i < draws; i++)
+ {
+ shake = Main.rand.NextVector2Circular(15, 15) * sine;
+ Vector2 backPosition = basePosition + (MathHelper.TwoPi * i / 20f).ToRotationVector2() * (5 + 0.5f * sine);
+ ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, line.Font, line.Text, shake * 4 + backPosition, backColor, line.Rotation, line.Origin, backScale, line.MaxWidth, line.Spread);
+ }
+ Texture2D texture = ModContent.Request("CalamityMod/Particles/BloomCircle").Value;
+
+ Vector2 drawPosition = basePosition;
+ Color drawColor = backColor;
+ Vector2 rotationPoint = texture.Size() * 0.5f;
+ for (int i = 0; i < 6; i++)
+ {
+ int length = line.Text.Length;
+ Main.EntitySpriteDraw(texture, basePosition + Vector2.UnitX * length * 4 + Vector2.UnitY * 10 + Vector2.UnitX * (i % 2 == 0 ? -7 * i : 7 * i), null, drawColor, (MathHelper.PiOver2), rotationPoint, new Vector2(1 - 0.05f * i * (1 + 0.2f * -sine), 1 + 0.75f * i * (1 + 0.2f * sine) * 1f) * 0.3f * Main.rand.NextFloat(0.9f, 1f), SpriteEffects.None);
+ }
+
+ Main.spriteBatch.End();
+ Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, null, null, Main.UIScaleMatrix);
+
+ // Draw the front text as usual.
+ ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, line.Font, line.Text, shake + basePosition, rarityColor, line.Rotation, line.Origin, line.BaseScale, line.MaxWidth, line.Spread);
+
+ return false;
+ }
return true;
}
#endregion
diff --git a/Items/DisgustingMeat.cs b/Items/DisgustingMeat.cs
new file mode 100644
index 0000000000..e383ac2bbe
--- /dev/null
+++ b/Items/DisgustingMeat.cs
@@ -0,0 +1,60 @@
+using CalamityMod.CalPlayer;
+using CalamityMod.Items.PermanentBoosters;
+using Terraria;
+using Terraria.ID;
+using Terraria.ModLoader;
+
+namespace CalamityMod.Items
+{
+ public class DisgustingMeat : ModItem, ILocalizedModType
+ {
+ public new string LocalizationCategory => "Items.Misc";
+
+ public override void SetDefaults()
+ {
+ Item.DefaultToFood(32, 30, 0, 0);
+ Item.value = 0;
+ Item.UseSound = SoundID.NPCDeath13;
+ Item.maxStack = 1;
+ Item.consumable = false;
+ }
+
+ public override bool AltFunctionUse(Player player) => true;
+ public override bool? UseItem(Player player)
+ {
+ var calPlayer = player.Calamity();
+ if (player.altFunctionUse == 2)
+ {
+ TryDropBoosterItem(player, ref calPlayer.rageBoostOne, ModContent.ItemType());
+ TryDropBoosterItem(player, ref calPlayer.rageBoostTwo, ModContent.ItemType());
+ TryDropBoosterItem(player, ref calPlayer.rageBoostThree, ModContent.ItemType());
+ TryDropBoosterItem(player, ref calPlayer.adrenalineBoostOne, ModContent.ItemType());
+ TryDropBoosterItem(player, ref calPlayer.adrenalineBoostTwo, ModContent.ItemType());
+ TryDropBoosterItem(player, ref calPlayer.adrenalineBoostThree, ModContent.ItemType());
+ TryDropBoosterItem(player, ref calPlayer.nimbleBounderBoost, ModContent.ItemType());
+ }
+ else
+ {
+ TryDropBoosterItem(player, ref calPlayer.sTangerine, ModContent.ItemType());
+ TryDropBoosterItem(player, ref calPlayer.mFruit, ModContent.ItemType());
+ TryDropBoosterItem(player, ref calPlayer.tCloudberry, ModContent.ItemType());
+ TryDropBoosterItem(player, ref calPlayer.sStrawberry, ModContent.ItemType());
+ TryDropBoosterItem(player, ref calPlayer.cShard, ModContent.ItemType());
+ TryDropBoosterItem(player, ref calPlayer.eCore, ModContent.ItemType());
+ TryDropBoosterItem(player, ref calPlayer.pHeart, ModContent.ItemType());
+ }
+
+ return null;
+ }
+
+ private static void TryDropBoosterItem(Player player, ref bool condition, int itemType)
+ {
+ if (condition)
+ {
+ condition = false;
+ int drop = Item.NewItem(player.GetSource_DropAsItem(), player.Hitbox, itemType);
+ Main.item[drop].noGrabDelay = 100;
+ }
+ }
+ }
+}
diff --git a/Items/DisgustingMeat.png b/Items/DisgustingMeat.png
new file mode 100644
index 0000000000..6d743191e2
Binary files /dev/null and b/Items/DisgustingMeat.png differ
diff --git a/Items/Materials/WulfrumMetalScrap.cs b/Items/Materials/WulfrumMetalScrap.cs
index 29df19b121..1f1031014f 100644
--- a/Items/Materials/WulfrumMetalScrap.cs
+++ b/Items/Materials/WulfrumMetalScrap.cs
@@ -60,7 +60,7 @@ namespace CalamityMod.Items.Materials
return true;
else
{
- spriteBatch.Draw(altTexture.Value, position, null, drawColor, 0, origin, altTexture.Size() / 2, SpriteEffects.None, 0);
+ spriteBatch.Draw(altTexture.Value, position, null, drawColor, 0, altTexture.Size() / 2, scale, SpriteEffects.None, 0);
return false;
}
}
diff --git a/Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs b/Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs
index 073307f246..3d465cc42d 100644
--- a/Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs
+++ b/Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs
@@ -91,6 +91,7 @@ namespace CalamityMod.Items.Placeables.Furniture.DevPaintings
"Spider Prov",
"StipulateVenus",
"Tobias",
+ "Tomat",
"Triangle",
"TYESKI (Universe)",
"Uncle Danny",
@@ -189,7 +190,6 @@ namespace CalamityMod.Items.Placeables.Furniture.DevPaintings
"ThousandFields",
"TikiWiki",
"Tinymanx",
- "Tomat",
"Trivaxy",
"Uberransy",
"Vaikyia",
diff --git a/Items/SummonItems/ExoticPheromones.cs b/Items/SummonItems/ExoticPheromones.cs
index 995118804c..6c6504bc90 100644
--- a/Items/SummonItems/ExoticPheromones.cs
+++ b/Items/SummonItems/ExoticPheromones.cs
@@ -34,12 +34,12 @@ namespace CalamityMod.Items.SummonItems
public override bool CanUseItem(Player player)
{
- return player.ZoneJungle && !NPC.AnyNPCs(ModContent.NPCType()) && !BossRushEvent.BossRushActive;
+ return player.ZoneJungle && !NPC.AnyNPCs(ModContent.NPCType()) && !BossRushEvent.BossRushActive;
}
public override bool? UseItem(Player player)
{
- CalamityUtils.SpawnBossUsingItem(player, SoundID.Roar);
+ CalamityUtils.SpawnBossUsingItem(player, SoundID.Roar);
return true;
}
diff --git a/Items/TreasureBags/DragonfollyBag.cs b/Items/TreasureBags/DragonfollyBag.cs
index bdbc785757..ac6f05ebad 100644
--- a/Items/TreasureBags/DragonfollyBag.cs
+++ b/Items/TreasureBags/DragonfollyBag.cs
@@ -57,7 +57,7 @@ namespace CalamityMod.Items.TreasureBags
public override void ModifyItemLoot(ItemLoot itemLoot)
{
// Money
- itemLoot.Add(ItemDropRule.CoinsBasedOnNPCValue(ModContent.NPCType()));
+ itemLoot.Add(ItemDropRule.CoinsBasedOnNPCValue(ModContent.NPCType()));
// Materials
itemLoot.Add(ModContent.ItemType(), 1, 30, 35);
diff --git a/Items/Weapons/Magic/DeathValleyDuster.cs b/Items/Weapons/Magic/DeathValleyDuster.cs
index 1067e27f81..0a19d54c0c 100644
--- a/Items/Weapons/Magic/DeathValleyDuster.cs
+++ b/Items/Weapons/Magic/DeathValleyDuster.cs
@@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Magic
Item.height = 40;
Item.damage = 159;
Item.DamageType = DamageClass.Magic;
- Item.mana = 38;
+ Item.mana = 45;
Item.useTime = 50;
Item.useAnimation = 50;
Item.useStyle = ItemUseStyleID.Shoot;
@@ -33,6 +33,8 @@ namespace CalamityMod.Items.Weapons.Magic
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
+ if (player.velocity.Length() <= 12)
+ player.velocity += -velocity.SafeNormalize(Vector2.UnitX) * 5f;
bool MaxMana = player.statMana >= (player.statManaMax2 - ((int)(Item.mana * player.manaCost))) && !player.HasBuff(BuffID.ManaSickness);
Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, 0f, 0f, MaxMana ? 1f : 0f);
diff --git a/Items/Weapons/Magic/PrimordialAncient.cs b/Items/Weapons/Magic/PrimordialAncient.cs
index 8da0f86ef4..0e5ae09073 100644
--- a/Items/Weapons/Magic/PrimordialAncient.cs
+++ b/Items/Weapons/Magic/PrimordialAncient.cs
@@ -24,9 +24,9 @@ namespace CalamityMod.Items.Weapons.Magic
{
Item.width = 40;
Item.height = 56;
- Item.damage = 3900;
+ Item.damage = 5000;
Item.DamageType = DamageClass.Magic;
- Item.mana = 85;
+ Item.mana = 95;
Item.useTime = 78;
Item.useAnimation = 78;
Item.useStyle = ItemUseStyleID.Shoot;
@@ -41,6 +41,9 @@ namespace CalamityMod.Items.Weapons.Magic
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
+ if (player.velocity.Length() <= 16)
+ player.velocity += -velocity.SafeNormalize(Vector2.UnitX) * 7.5f;
+
bool MaxMana = player.statMana >= (player.statManaMax2 - ((int)(Item.mana * player.manaCost))) && !player.HasBuff(BuffID.ManaSickness);
for (int i = -2; i <= 2; i++)
{
diff --git a/Items/Weapons/Magic/PrimordialEarth.cs b/Items/Weapons/Magic/PrimordialEarth.cs
index bfe7b3b5d2..55fcdc89a0 100644
--- a/Items/Weapons/Magic/PrimordialEarth.cs
+++ b/Items/Weapons/Magic/PrimordialEarth.cs
@@ -38,10 +38,14 @@ namespace CalamityMod.Items.Weapons.Magic
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
+ if (player.velocity.Length() <= 14)
+ player.velocity += -velocity.SafeNormalize(Vector2.UnitX) * 6f;
+
+ Vector2 staticSpeed = Utils.DirectionTo(player.Center, player.Calamity().mouseWorld) * Utils.Distance(player.Center, player.ClampedMouseWorld()) * 0.008f;
bool MaxMana = player.statMana >= (player.statManaMax2 - ((int)(Item.mana * player.manaCost))) && !player.HasBuff(BuffID.ManaSickness);
float rotation = 0.4f;
- Projectile.NewProjectile(source, position, velocity.RotatedBy(-rotation), type, damage / 2, knockback, player.whoAmI, 0f, 1f, MaxMana ? 1f : 0f);
- Projectile.NewProjectile(source, position, velocity.RotatedBy(rotation), type, damage / 2, knockback, player.whoAmI, 0f, 0f, MaxMana ? 1f : 0f);
+ Projectile.NewProjectile(source, position, staticSpeed.RotatedBy(-rotation), type, damage / 2, knockback, player.whoAmI, 0f, 1f, MaxMana ? 1f : 0f);
+ Projectile.NewProjectile(source, position, staticSpeed.RotatedBy(rotation), type, damage / 2, knockback, player.whoAmI, 0f, 0f, MaxMana ? 1f : 0f);
return false;
}
diff --git a/Items/Weapons/Melee/GreatswordofJudgement.cs b/Items/Weapons/Melee/GreatswordofJudgement.cs
index 19486833cb..5b0b5fb1a8 100644
--- a/Items/Weapons/Melee/GreatswordofJudgement.cs
+++ b/Items/Weapons/Melee/GreatswordofJudgement.cs
@@ -1,85 +1,144 @@
-using CalamityMod.Dusts;
+using System;
+using CalamityMod.Items.Materials;
using CalamityMod.Particles;
using CalamityMod.Projectiles.Melee;
-using Terraria;
-using Terraria.ID;
-using Terraria.ModLoader;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
+using Terraria;
using Terraria.Audio;
+using Terraria.DataStructures;
+using Terraria.ID;
+using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Melee
{
public class GreatswordofJudgement : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Melee";
- private float swingRoatation = 0;
- private int time = 0;
- private Color mainColor;
- private int swordDirection;
- private int useTime = 20;
- private int opacityAdjust = 0;
- private float smearOpacity = 0;
+ public int time = 0;
+ public Vector2 bladeHitboxPos;
+ public float bladeRotation = 0;
+ public int bladeDirection = 0;
+ public float completion = 0;
+ public bool canHit => (completion >= 0.35f && completion <= 0.8f);
+ public int swingCount = 0;
+ public bool spawnProj = true;
+ public bool playSound = true;
+
+ public Color clr = Color.MediumOrchid;
+
public override void SetDefaults()
{
Item.width = 78;
Item.height = 78;
- Item.damage = 155;
+ Item.damage = 240;
Item.DamageType = DamageClass.Melee;
Item.useStyle = ItemUseStyleID.Swing;
- Item.useAnimation = Item.useTime = useTime;
+ Item.useAnimation = Item.useTime = 20;
Item.useTurn = true;
Item.knockBack = 7f;
- Item.UseSound = SoundID.Item60;
Item.autoReuse = true;
Item.value = CalamityGlobalItem.RarityPurpleBuyPrice;
Item.rare = ItemRarityID.Purple;
Item.shoot = ModContent.ProjectileType();
- Item.shootSpeed = 5f;
+ Item.shootSpeed = 5.5f;
+ }
+ public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
+ {
+ return false;
}
public override void UseItemHitbox(Player player, ref Rectangle hitbox, ref bool noHitbox)
{
- float scale = 1.1f;
+ // Basically just insures the enemy is always able to be hit if they're in range, the actual collision check is done in CanHitNPC
+ float scale = 8f;
Vector2 newSize = new Point(hitbox.Width, hitbox.Height).ToVector2() * scale;
- hitbox = new Rectangle(hitbox.X - (int)((newSize.X - hitbox.Width) / 2f), hitbox.Y - (int)((newSize.Y - hitbox.Height) / 2f), (int)newSize.X, (int)newSize.Y);
+ hitbox = new Rectangle((int)(bladeHitboxPos.X - newSize.X / 2f), (int)(bladeHitboxPos.Y - newSize.Y / 2f), (int)newSize.X, (int)newSize.Y);
+ }
+ public override bool? CanHitNPC(Player player, NPC target)
+ {
+ Vector2 mPos = player.Calamity().mouseWorld;
+ Vector2 shootDir = player.Center.DirectionTo(mPos);
+ float _ = float.NaN;
+ bool hitCheck = Collision.CheckAABBvLineCollision(target.Hitbox.TopLeft(), target.Hitbox.Size(), player.Center - shootDir * 30, player.Center + shootDir * 145, Item.width * 3f, ref _);
+ return ((canHit && hitCheck) ? null : false);
}
public override void UseAnimation(Player player)
{
- swordDirection = player.direction;
+ swingCount++;
time = 0;
- swingRoatation = 0;
- mainColor = Main.rand.NextBool() ? Color.MediumPurple : Color.MediumOrchid;
- opacityAdjust = 0;
- smearOpacity = 0;
+ bladeDirection = player.direction;
+ bladeHitboxPos = player.Center;
+ bladeRotation = 0;
+ spawnProj = true;
+ playSound = true;
+ int dir = -Math.Sign(player.Center.X - player.Calamity().mouseWorld.X);
+ float startRot = MathHelper.ToRadians(-90) * dir * (swingCount % 2 == 0 ? 1 : -1);
+
+ clr = Main.rand.NextBool() ? Color.MediumPurple : Color.MediumOrchid;
}
public override void MeleeEffects(Player player, Rectangle hitbox)
{
- opacityAdjust++;
- if (opacityAdjust >= 5 && opacityAdjust <= 15 && smearOpacity < 0.9f)
- smearOpacity += 0.1f;
- else if (smearOpacity > 0)
- smearOpacity -= 0.2f;
+ Vector2 mPos = player.Calamity().mouseWorld;
+ completion = (float)((float)time / ((float)(Item.useAnimation / player.GetAttackSpeed(DamageClass.Melee))));
+ int dir = -Math.Sign(player.Center.X - mPos.X);
+
+ float startRot = MathHelper.ToRadians(-110) * dir * (swingCount % 2 == 0 ? 1 : -1);
+ float endRot = MathHelper.ToRadians(-110) * dir * (swingCount % 2 == 0 ? -1 : 1);
+ float minRot = MathHelper.ToRadians(-150) * dir * (swingCount % 2 == 0 ? 1 : -1);
+ float cutoff = 0.2f;
+ float cutoff2 = 0.95f;
+
+ Vector2 shootDir = player.Center.DirectionTo(mPos) * Item.shootSpeed;
+
+ if (completion <= cutoff)
+ {
+ float lerp = Utils.GetLerpValue(0, cutoff, completion, true);
+ player.itemRotation = player.Center.DirectionTo(mPos).ToRotation() + MathHelper.Lerp(startRot, minRot, CalamityUtils.EaseInOutExp(lerp, 4f, 4f));
+ player.itemRotation += (MathHelper.Pi) * (dir == 1 ? 0 : 1) + MathHelper.PiOver4 * dir;
+ }
+ else
+ {
+ if (playSound)
+ {
+ SoundStyle swing = new("CalamityMod/Sounds/Item/SwooshMid");
+ SoundEngine.PlaySound(swing with { Pitch = Main.rand.NextFloat(0.1f, 0.3f), Volume = 1f }, player.Center);
+ playSound = false;
+ }
+ if (completion >= 0.65f && spawnProj)
+ {
+ Projectile.NewProjectile(player.GetSource_FromThis(), player.Center, shootDir, Item.shoot, Item.damage, Item.knockBack, player.whoAmI, 0f);
+
+ Particle swipe = new CustomSpark(player.Center - shootDir * 5, shootDir.RotatedBy(0.4f * (dir * (swingCount % 2 == 0 ? 1 : -1))) * 2.5f, "CalamityMod/Particles/VerticalSmearLarge", false, (int)(14 / player.GetAttackSpeed(DamageClass.Melee)), 0.6f, clr, new Vector2(1f, 1f), true, false, 0, false, false);
+ GeneralParticleHandler.SpawnParticle(swipe);
+
+ SoundEngine.PlaySound(SoundID.Item60, player.Center);
+ spawnProj = false;
+ }
+ float lerp = Utils.GetLerpValue(cutoff, cutoff2, completion, true);
+ player.itemRotation = player.Center.DirectionTo(mPos).ToRotation() + MathHelper.Lerp(minRot, endRot, CalamityUtils.EaseInOutExp(lerp, 6f, 2f));
+ player.itemRotation += (MathHelper.Pi) * (dir == 1 ? 0 : 1) + MathHelper.PiOver4 * dir;
+ }
+
+ float extraRot = (dir == 1 ? -MathHelper.PiOver4 : MathHelper.ToRadians(225));
+ bladeHitboxPos = player.Center + (player.itemRotation + extraRot).ToRotationVector2() * 180;
+
+ player.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, player.itemRotation + MathHelper.ToRadians(-130) * dir);
+ player.SetCompositeArmBack(true, Player.CompositeArmStretchAmount.Full, player.itemRotation + MathHelper.ToRadians(-130) * dir);
+
+ player.itemLocation = player.Center;
+ player.direction = dir;
time++;
- swingRoatation += swordDirection == 1 ? 0.13f : -0.13f;
-
- float Rot = (swordDirection == -1 ? 1.8f : -1.8f) + swingRoatation;
- if (swordDirection != player.direction)
+ }
+ public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone)
+ {
+ int beamDamage = player.CalcIntDamage(Item.damage * 0.4f);
+ Vector2 mouseClamped = player.ClampedMouseWorld();
+ SoundEngine.PlaySound(SoundID.Item84 with { Volume = 1f, Pitch = Main.rand.NextFloat(0.5f, 0.7f) }, player.Center);
+ for (int i = 0; i < 2; i++)
{
- swingRoatation *= -1;
- swordDirection = player.direction;
- }
- Particle Smear = new SemiCircularSmearFade(player.Center, Vector2.Zero, mainColor * smearOpacity, Rot, Main.rand.NextFloat(1.95f, 2.2f), new Vector2(1, 1), 2, true, false, true, player.direction);
- GeneralParticleHandler.SpawnParticle(Smear);
-
- if (Main.rand.NextBool(3))
- {
- Vector2 dustVel = new Vector2(5 * swordDirection, -5).RotatedByRandom(1.55f) * Main.rand.NextFloat(0.7f, 1.3f);
- Dust dust = Dust.NewDustPerfect(player.Center + dustVel * 9, 278);
- dust.scale = Main.rand.NextFloat(0.4f, 0.55f);
- dust.velocity = dustVel * 0.55f;
- dust.color = Main.rand.NextBool() ? Color.MediumPurple : Color.MediumOrchid;
- dust.noGravity = true;
+ Vector2 vel = player.Center.DirectionFrom(target.Center).RotatedByRandom(0.7f) * Main.rand.NextFloat(18, 20);
+ Projectile.NewProjectile(player.GetSource_ItemUse(Item), player.Center, vel, ModContent.ProjectileType(), beamDamage, 0, player.whoAmI, 0, (i == 0 ? -1 : 1), 1);
}
}
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
@@ -90,6 +149,8 @@ namespace CalamityMod.Items.Weapons.Melee
{
CreateRecipe().
AddIngredient(ItemID.LunarBar, 7).
+ AddIngredient().
+ AddIngredient(5).
AddTile(TileID.LunarCraftingStation).
Register();
}
diff --git a/Items/Weapons/Melee/IridescentExcalibur.cs b/Items/Weapons/Melee/IridescentExcalibur.cs
deleted file mode 100644
index 76c749add9..0000000000
--- a/Items/Weapons/Melee/IridescentExcalibur.cs
+++ /dev/null
@@ -1,193 +0,0 @@
-using System;
-using CalamityMod.Buffs.DamageOverTime;
-using CalamityMod.Buffs.StatDebuffs;
-using CalamityMod.Items.Materials;
-using CalamityMod.Projectiles.Melee;
-using CalamityMod.Rarities;
-using CalamityMod.Tiles.Furniture.CraftingStations;
-using Microsoft.Xna.Framework;
-using Microsoft.Xna.Framework.Graphics;
-using Terraria;
-using Terraria.DataStructures;
-using Terraria.ID;
-using Terraria.ModLoader;
-
-namespace CalamityMod.Items.Weapons.Melee
-{
- [LegacyName("ElementalExcalibur")]
- public class IridescentExcalibur : ModItem, ILocalizedModType
- {
- public new string LocalizationCategory => "Items.Weapons.Melee";
-
- private int MaxBeamTypes = 12;
-
- private int BeamType = 0;
-
- private const int Alpha = 100;
-
- private const float ShootSpeed = 16f;
-
- public override void SetStaticDefaults()
- {
- ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true;
- }
-
- public override void SetDefaults()
- {
- Item.width = 112;
- Item.height = 112;
- Item.damage = 3000;
- Item.useAnimation = Item.useTime = 15;
- Item.useStyle = ItemUseStyleID.Swing;
- Item.useTurn = true;
- Item.DamageType = DamageClass.Melee;
- Item.knockBack = 8f;
- Item.UseSound = SoundID.Item1;
- Item.autoReuse = true;
- Item.value = CalamityGlobalItem.RarityHotPinkBuyPrice;
- Item.shoot = ModContent.ProjectileType();
- Item.shootSpeed = ShootSpeed;
- Item.rare = ModContent.RarityType();
- Item.shootsEveryUse = true;
- }
-
- public override void UseStyle(Player player, Rectangle heldItemFrame)
- {
- player.itemLocation += new Vector2(-12f * player.direction, 2f * player.gravDir).RotatedBy(player.itemRotation);
- }
-
- public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
- {
- Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request("CalamityMod/Items/Weapons/Melee/IridescentExcaliburGlow").Value);
- }
-
- // Terraria seems to really dislike high crit values in SetDefaults
- public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 10;
-
- public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
- {
- if (player.altFunctionUse == 2)
- {
- float adjustedItemScale = player.GetAdjustedItemScale(Item);
- Projectile.NewProjectile(source, player.MountedCenter, new Vector2(player.direction, 0f), ModContent.ProjectileType(), damage, knockback, player.whoAmI, (float)player.direction * player.gravDir, player.itemAnimationMax, adjustedItemScale);
- Projectile.NewProjectile(source, player.MountedCenter, new Vector2(player.direction, 0f), ModContent.ProjectileType(), 0, knockback, player.whoAmI, (float)player.direction * player.gravDir, player.itemAnimationMax, adjustedItemScale);
- Projectile.NewProjectile(source, player.MountedCenter, new Vector2(player.direction, 0f), ModContent.ProjectileType(), 0, knockback, player.whoAmI, (float)player.direction * player.gravDir, player.itemAnimationMax, adjustedItemScale);
- NetMessage.SendData(MessageID.PlayerControls, -1, -1, null, player.whoAmI);
- }
- else
- {
- int proj = Projectile.NewProjectile(source, position, velocity, type, (int)Math.Round(damage * 0.5), knockback * 0.5f, player.whoAmI, (float)BeamType);
- if (BeamType == 7)
- Main.projectile[proj].penetrate = 3;
-
- BeamType++;
- if (BeamType >= MaxBeamTypes)
- BeamType = 0;
- }
-
- return false;
- }
-
- public override bool AltFunctionUse(Player player) => true;
-
- public override bool? UseItem(Player player)
- {
- Item.noMelee = player.altFunctionUse == 2;
- return base.UseItem(player);
- }
-
- public override void ModifyHitNPC(Player player, NPC target, ref NPC.HitModifiers modifiers)
- {
- if (player.altFunctionUse == 2)
- modifiers.SourceDamage *= 2;
- }
-
- public override void ModifyHitPvp(Player player, Player target, ref Player.HurtModifiers modifiers)
- {
- if (player.altFunctionUse == 2)
- modifiers.SourceDamage *= 2;
- }
-
- public override void MeleeEffects(Player player, Rectangle hitbox)
- {
- if (Main.rand.NextBool())
- {
- Color rainbowColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, Alpha);
- Color color = Color.White;
- int dustChoice = player.altFunctionUse == 2 ? Main.rand.Next(12) : BeamType;
- switch (dustChoice)
- {
- case 0: // Red
- color = new Color(255, 0, 0, Alpha);
- break;
- case 1: // Orange
- color = new Color(255, 128, 0, Alpha);
- break;
- case 2: // Yellow
- color = new Color(255, 255, 0, Alpha);
- break;
- case 3: // Lime
- color = new Color(128, 255, 0, Alpha);
- break;
- case 4: // Green
- color = new Color(0, 255, 0, Alpha);
- break;
- case 5: // Turquoise
- color = new Color(0, 255, 128, Alpha);
- break;
- case 6: // Cyan
- color = new Color(0, 255, 255, Alpha);
- break;
- case 7: // Light Blue
- color = new Color(0, 128, 255, Alpha);
- break;
- case 8: // Blue
- color = new Color(0, 0, 255, Alpha);
- break;
- case 9: // Purple
- color = new Color(128, 0, 255, Alpha);
- break;
- case 10: // Fuschia
- color = new Color(255, 0, 255, Alpha);
- break;
- case 11: // Hot Pink
- color = new Color(255, 0, 128, Alpha);
- break;
- default:
- break;
- }
-
- Dust rainbow = Main.dust[Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, DustID.RainbowMk2)];
- rainbow.velocity *= 0f;
- rainbow.color = Color.Lerp(rainbowColor, color, (float)Math.Sqrt((MathF.Cos(Main.GlobalTimeWrappedHourly / 60f) + 1f) * 0.5f));
- rainbow.color.A = 100;
- rainbow.scale = Main.rand.NextFloat(1.2f, 1.6f);
- rainbow.fadeIn = Main.rand.NextFloat(0.4f, 1f);
- rainbow.noGravity = true;
- }
- }
-
- public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone)
- {
- target.AddBuff(ModContent.BuffType(), 600);
- target.AddBuff(ModContent.BuffType(), 60);
- }
-
- public override void OnHitPvp(Player player, Player target, Player.HurtInfo hurtInfo)
- {
- target.AddBuff(ModContent.BuffType(), 600);
- target.AddBuff(ModContent.BuffType(), 60);
- }
-
- public override void AddRecipes()
- {
- CreateRecipe().
- AddIngredient(ItemID.TrueExcalibur).
- AddIngredient().
- AddIngredient(3).
- AddIngredient(15).
- AddTile().
- Register();
- }
- }
-}
diff --git a/Items/Weapons/Melee/IridescentExcalibur.png b/Items/Weapons/Melee/IridescentExcalibur.png
deleted file mode 100644
index 5ff82d5ac7..0000000000
Binary files a/Items/Weapons/Melee/IridescentExcalibur.png and /dev/null differ
diff --git a/Items/Weapons/Melee/IridescentExcaliburGlow.png b/Items/Weapons/Melee/IridescentExcaliburGlow.png
deleted file mode 100644
index e122aef76b..0000000000
Binary files a/Items/Weapons/Melee/IridescentExcaliburGlow.png and /dev/null differ
diff --git a/Items/Weapons/Melee/Orderbringer.cs b/Items/Weapons/Melee/Orderbringer.cs
index 4bcfb4b25b..2a05c47c20 100644
--- a/Items/Weapons/Melee/Orderbringer.cs
+++ b/Items/Weapons/Melee/Orderbringer.cs
@@ -1,42 +1,44 @@
-using CalamityMod.Items.Materials;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using CalamityMod.Items.Materials;
+using CalamityMod.Particles;
using CalamityMod.Projectiles.Melee;
using CalamityMod.Rarities;
using CalamityMod.Tiles.Furniture.CraftingStations;
-using Terraria.Audio;
-using Terraria.ID;
using Microsoft.Xna.Framework;
-using Terraria.ModLoader;
-using CalamityMod.Particles;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
+using Terraria.Audio;
using Terraria.DataStructures;
-using Basic.Reference.Assemblies;
-using System;
-using Mono.Cecil;
+using Terraria.ID;
+using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Melee
{
[LegacyName("GreatswordofBlah")]
+ [LegacyName("IridescentExcalibur")]
public class Orderbringer : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Melee";
- private float swingRoatation = 0;
- private int time = 0;
- private Color mainColor;
- private int swordDirection;
- private int useTime = 18;
- private int opacityAdjust = 0;
- private float smearOpacity = 0;
+ public int time = 0;
+ public Vector2 bladeHitboxPos;
+ public float bladeRotation = 0;
+ public int bladeDirection = 0;
+ public float completion = 0;
+ public bool canHit => (completion >= 0.35f && completion <= 0.8f);
+ public int swingCount = 0;
+ public bool spawnProj = true;
+ public bool playSound = true;
public override void SetDefaults()
{
- Item.width = Item.height = 108;
- Item.damage = 445;
+ Item.width = Item.height = 112;
+ Item.damage = 840;
Item.DamageType = DamageClass.Melee;
- Item.useAnimation = Item.useTime = useTime;
+ Item.useAnimation = Item.useTime = 16;
Item.useStyle = ItemUseStyleID.Swing;
Item.useTurn = true;
Item.knockBack = 8f;
- Item.UseSound = SoundID.Item60;
Item.autoReuse = true;
Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice;
Item.rare = ModContent.RarityType();
@@ -45,87 +47,149 @@ namespace CalamityMod.Items.Weapons.Melee
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
- Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, 0f);
-
- for (int i = 0; i < 4; i++)
- {
- Vector2 vel = (velocity * 2.5f).RotatedByRandom(0.6f);
- Projectile.NewProjectile(source, player.ClampedMouseWorld() - (velocity * 40) + Main.rand.NextVector2Circular(130, 130), vel * Main.rand.NextFloat(0.8f, 1.2f), ModContent.ProjectileType(), (int)(damage * 0.1f), knockback * 0.2f, player.whoAmI, 0, 0, 1);
- }
return false;
}
public override void UseItemHitbox(Player player, ref Rectangle hitbox, ref bool noHitbox)
{
- float scale = 1.2f;
+ // Basically just insures the enemy is always able to be hit if they're in range, the actual collision check is done in CanHitNPC
+ float scale = 8f;
Vector2 newSize = new Point(hitbox.Width, hitbox.Height).ToVector2() * scale;
- hitbox = new Rectangle(hitbox.X - (int)((newSize.X - hitbox.Width) / 2f), hitbox.Y - (int)((newSize.Y - hitbox.Height) / 2f), (int)newSize.X, (int)newSize.Y);
+ hitbox = new Rectangle((int)(bladeHitboxPos.X - newSize.X / 2f), (int)(bladeHitboxPos.Y - newSize.Y / 2f), (int)newSize.X, (int)newSize.Y);
+ }
+ public override bool? CanHitNPC(Player player, NPC target)
+ {
+ Vector2 mPos = player.Calamity().mouseWorld;
+ Vector2 shootDir = player.Center.DirectionTo(mPos);
+ float _ = float.NaN;
+ bool hitCheck = Collision.CheckAABBvLineCollision(target.Hitbox.TopLeft(), target.Hitbox.Size(), player.Center - shootDir * 30, player.Center + shootDir * 245, Item.width * 3f, ref _);
+ return ((canHit && hitCheck) ? null : false);
}
public override void UseAnimation(Player player)
{
- swordDirection = player.direction;
+ swingCount++;
time = 0;
- swingRoatation = 0;
- mainColor = Main.rand.NextBool() ? Color.MediumPurple : Color.MediumOrchid;
- opacityAdjust = 0;
- smearOpacity = 0;
+ bladeDirection = player.direction;
+ bladeHitboxPos = player.Center;
+ bladeRotation = 0;
+ spawnProj = true;
+ playSound = true;
+ int dir = -Math.Sign(player.Center.X - player.Calamity().mouseWorld.X);
+ float startRot = MathHelper.ToRadians(-90) * dir * (swingCount % 2 == 0 ? 1 : -1);
}
public override void MeleeEffects(Player player, Rectangle hitbox)
{
- opacityAdjust++;
- if (opacityAdjust >= 5 && opacityAdjust <= 15 && smearOpacity < 0.9f)
- smearOpacity += 0.1f;
- else if (smearOpacity > 0)
- smearOpacity -= 0.2f;
+ Vector2 mPos = player.Calamity().mouseWorld;
+ completion = (float)((float)time / ((float)(Item.useAnimation / player.GetAttackSpeed(DamageClass.Melee))));
+ int dir = -Math.Sign(player.Center.X - mPos.X);
+
+ float startRot = MathHelper.ToRadians(-110) * dir * (swingCount % 2 == 0 ? 1 : -1);
+ float endRot = MathHelper.ToRadians(-110) * dir * (swingCount % 2 == 0 ? -1 : 1);
+ float minRot = MathHelper.ToRadians(-150) * dir * (swingCount % 2 == 0 ? 1 : -1);
+ float cutoff = 0.2f;
+ float cutoff2 = 0.95f;
+
+ Vector2 shootDir = player.Center.DirectionTo(mPos) * Item.shootSpeed;
+
+ if (completion <= cutoff)
+ {
+ float lerp = Utils.GetLerpValue(0, cutoff, completion, true);
+ player.itemRotation = player.Center.DirectionTo(mPos).ToRotation() + MathHelper.Lerp(startRot, minRot, CalamityUtils.EaseInOutExp(lerp, 4f, 4f));
+ player.itemRotation += (MathHelper.Pi) * (dir == 1 ? 0 : 1) + MathHelper.PiOver4 * dir;
+ }
+ else
+ {
+ if (playSound)
+ {
+ SoundStyle swing = new("CalamityMod/Sounds/Item/SwooshMid");
+ SoundEngine.PlaySound(swing with { Pitch = Main.rand.NextFloat(0.1f, 0.3f), Volume = 1f }, player.Center);
+ playSound = false;
+ }
+ if (completion >= 0.65f && spawnProj)
+ {
+ Projectile.NewProjectile(player.GetSource_FromThis(), player.Center, shootDir, Item.shoot, Item.damage, Item.knockBack, player.whoAmI, 0f);
+
+ for (int i = 0; i < 4; i++)
+ {
+ float rot = Main.rand.NextFloat(0.5f, 0.65f) * (Main.rand.NextBool() ? 1 : -1);
+ Vector2 vel = (shootDir * 2.5f).RotatedByRandom(0.6f);
+ Projectile.NewProjectile(player.GetSource_FromThis(), player.ClampedMouseWorld() - (shootDir * 40) + Main.rand.NextVector2Circular(130, 130), vel.RotatedBy(rot) * Main.rand.NextFloat(0.9f, 1.2f), ModContent.ProjectileType(), (int)(Item.damage * 0.12f), (int)(Item.knockBack * 0.2f), player.whoAmI, 0, rot, 1);
+ }
+
+ Particle swipe = new CustomSpark(player.Center - shootDir * 5, shootDir.RotatedBy(0.4f * (dir * (swingCount % 2 == 0 ? 1 : -1))) * 2.5f, "CalamityMod/Particles/VerticalSmearLarge", false, (int)(14 / player.GetAttackSpeed(DamageClass.Melee)), 0.8f, player.Calamity().lightRGB, new Vector2(1f, 1f), true, false, 0, false, false);
+ GeneralParticleHandler.SpawnParticle(swipe);
+
+ SoundEngine.PlaySound(SoundID.Item60, player.Center);
+ spawnProj = false;
+ }
+ float lerp = Utils.GetLerpValue(cutoff, cutoff2, completion, true);
+ player.itemRotation = player.Center.DirectionTo(mPos).ToRotation() + MathHelper.Lerp(minRot, endRot, CalamityUtils.EaseInOutExp(lerp, 6f, 2f));
+ player.itemRotation += (MathHelper.Pi) * (dir == 1 ? 0 : 1) + MathHelper.PiOver4 * dir;
+ }
+
+ float extraRot = (dir == 1 ? -MathHelper.PiOver4 : MathHelper.ToRadians(225));
+ bladeHitboxPos = player.Center + (player.itemRotation + extraRot).ToRotationVector2() * 240;
+ Vector2 tipPos = player.Center + (player.itemRotation + extraRot).ToRotationVector2() * 180;
+
+ player.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, player.itemRotation + MathHelper.ToRadians(-130) * dir);
+ player.SetCompositeArmBack(true, Player.CompositeArmStretchAmount.Full, player.itemRotation + MathHelper.ToRadians(-130) * dir);
+
+ player.itemLocation = player.Center;
+ player.direction = dir;
time++;
- swingRoatation += swordDirection == 1 ? 0.17f : -0.17f;
-
- float Rot = (swordDirection == -1 ? 1.8f : -1.8f) + swingRoatation;
- if (swordDirection != player.direction)
- {
- swingRoatation *= -1;
- swordDirection = player.direction;
- }
- Particle Smear = new SemiCircularSmearFade(player.Center, Vector2.Zero, mainColor * smearOpacity, Rot, Main.rand.NextFloat(2.8f, 3.2f), new Vector2(1, 1), 2, true, false, true, player.direction);
- GeneralParticleHandler.SpawnParticle(Smear);
-
- if (Main.rand.NextBool())
- {
- Vector2 dustVel = new Vector2(5 * swordDirection, -5).RotatedByRandom(1.55f) * Main.rand.NextFloat(0.7f, 1.3f) * 2;
- Dust dust = Dust.NewDustPerfect(player.Center + dustVel * 9, 278);
- dust.scale = Main.rand.NextFloat(0.5f, 0.75f);
- dust.velocity = dustVel * 0.55f;
- dust.color = Main.rand.NextBool() ? Color.MediumPurple : Color.MediumOrchid;
- dust.noGravity = true;
- }
}
public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone)
{
- int beamDamage = player.CalcIntDamage(Item.damage * 0.5f);
+ int beamDamage = player.CalcIntDamage(Item.damage * 0.4f);
Vector2 mouseClamped = player.ClampedMouseWorld();
+ SoundEngine.PlaySound(SoundID.Item84 with { Volume = 1f, Pitch = Main.rand.NextFloat(0.5f, 0.7f)}, player.Center);
for (int i = 0; i < 2; i++)
{
Vector2 targetPos = Main.MouseWorld;
NPC target2 = Main.MouseWorld.ClosestNPCAt(650);
if (target2 != null)
- targetPos = target2.Center + target2.velocity * 14;
+ targetPos = target2.Center;
Vector2 spawnPos = mouseClamped + new Vector2(Main.rand.NextFloat(-300, 300), -900);
Vector2 vel = (targetPos - spawnPos).SafeNormalize(Vector2.UnitY) * 10;
Projectile.NewProjectile(player.GetSource_ItemUse(Item), spawnPos, vel, ModContent.ProjectileType(), beamDamage, 0, player.whoAmI);
}
}
+ public override void ModifyTooltips(List list)
+ {
+ Player Owner = Main.LocalPlayer;
+ if (Owner is null)
+ return;
+
+ float rate = Main.GlobalTimeWrappedHourly * 7;
+ List eColors = new List()
+ {
+ Color.PaleVioletRed,
+ Color.Coral,
+ Color.Khaki,
+ Color.PaleGreen,
+ Color.Turquoise,
+ Color.Violet
+ };
+
+ int colorIndex = (int)(rate / 2 % eColors.Count);
+ Color currentColor = eColors[colorIndex];
+ Color nextColor = eColors[(colorIndex + 1) % eColors.Count];
+ Color finalColor = Color.Lerp(currentColor, nextColor, rate % 2f > 1f ? 1f : rate % 1f);
+ TooltipLine line = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip2");
+ if (line != null)
+ line.OverrideColor = Color.Lerp(finalColor, Color.White, 0.3f);
+ }
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request("CalamityMod/Items/Weapons/Melee/OrderbringerGlow").Value);
}
-
public override void AddRecipes()
{
CreateRecipe().
AddIngredient().
- AddIngredient(8).
- AddIngredient(20).
+ AddIngredient(5).
+ AddIngredient(5).
AddTile().
Register();
}
diff --git a/Items/Weapons/Melee/Orderbringer.png b/Items/Weapons/Melee/Orderbringer.png
index ade13f44bf..5ff82d5ac7 100644
Binary files a/Items/Weapons/Melee/Orderbringer.png and b/Items/Weapons/Melee/Orderbringer.png differ
diff --git a/Items/Weapons/Melee/OrderbringerGlow.png b/Items/Weapons/Melee/OrderbringerGlow.png
index 8c6448103a..e122aef76b 100644
Binary files a/Items/Weapons/Melee/OrderbringerGlow.png and b/Items/Weapons/Melee/OrderbringerGlow.png differ
diff --git a/Items/Weapons/Melee/UltimusCleaver.cs b/Items/Weapons/Melee/UltimusCleaver.cs
index f9128f195b..d910cee78b 100644
--- a/Items/Weapons/Melee/UltimusCleaver.cs
+++ b/Items/Weapons/Melee/UltimusCleaver.cs
@@ -36,51 +36,34 @@ namespace CalamityMod.Items.Weapons.Melee
public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(BuffID.OnFire3, 360);
+ SoundEngine.PlaySound(SoundID.Item14, target.Center);
int onHitDamage = player.CalcIntDamage(Item.damage);
Projectile blast = Projectile.NewProjectileDirect(Item.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType(), onHitDamage, 0f, player.whoAmI, target.whoAmI);
blast.DamageType = Item.DamageType;
- float firstDustScale = 1.7f;
- float secondDustScale = 0.8f;
- float thirdDustScale = 2f;
- Vector2 dustRotation = (target.rotation - 1.57079637f).ToRotationVector2();
+
+ Vector2 dustRotation = (target.rotation - MathHelper.PiOver2).ToRotationVector2();
Vector2 dustVelocity = dustRotation * target.velocity.Length();
- SoundEngine.PlaySound(SoundID.Item14, target.Center);
- int increment;
- for (int i = 0; i < 40; i = increment + 1)
+ for (int i = 0; i < 40; i++)
{
- int swingDust = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, DustID.InfernoFork, 0f, 0f, 200, default, firstDustScale);
- Dust dust = Main.dust[swingDust];
- dust.position = target.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)target.width / 2f;
- dust.noGravity = true;
- dust.velocity.Y -= 6f;
- dust.velocity *= 3f;
- dust.velocity += dustVelocity * Main.rand.NextFloat();
- swingDust = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, DustID.InfernoFork, 0f, 0f, 100, default, secondDustScale);
- dust.position = target.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)target.width / 2f;
- dust.velocity.Y -= 6f;
- dust.velocity *= 2f;
- dust.noGravity = true;
- dust.fadeIn = 1f;
- dust.color = Color.Crimson * 0.5f;
- dust.velocity += dustVelocity * Main.rand.NextFloat();
- increment = i;
+ Vector2 mainDustPos = target.Center + Main.rand.NextVector2Circular(target.width / 2, target.width / 2);
+ Dust swingDust = Dust.NewDustPerfect(mainDustPos, DustID.InfernoFork, dustVelocity * Main.rand.NextFloat() - Vector2.UnitY * 18f, 200, Scale: 1.7f);
+ swingDust.noGravity = true;
+
+ Dust swingDust2 = Dust.NewDustPerfect(mainDustPos, DustID.InfernoFork, dustVelocity * Main.rand.NextFloat() - Vector2.UnitY * 12f, 100, Color.Crimson * 0.5f, 0.8f);
+ swingDust2.noGravity = true;
+ swingDust2.fadeIn = 1f;
}
- for (int j = 0; j < 20; j = increment + 1)
+ for (int j = 0; j < 20; j++)
{
- int swingDust2 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, DustID.InfernoFork, 0f, 0f, 0, default, thirdDustScale);
- Dust dust = Main.dust[swingDust2];
- dust.position = target.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)target.velocity.ToRotation(), default) * (float)target.width / 3f;
- dust.noGravity = true;
- dust.velocity.Y -= 6f;
- dust.velocity *= 0.5f;
- dust.velocity += dustVelocity * (0.6f + 0.6f * Main.rand.NextFloat());
- increment = j;
+ Vector2 dustPos = target.Center + Vector2.UnitX.RotatedByRandom(MathHelper.Pi).RotatedBy(target.velocity.ToRotation()) * (target.width / 3f);
+ Dust moreDust = Dust.NewDustPerfect(dustPos, DustID.InfernoFork, dustVelocity * (0.6f + 0.6f * Main.rand.NextFloat()) - Vector2.UnitY * 3f, Scale: 2f);
+ moreDust.noGravity = true;
}
}
public override void MeleeEffects(Player player, Rectangle hitbox)
{
- if (player.whoAmI == Main.myPlayer)
+ if (player.whoAmI == Main.myPlayer && !player.Calamity().bladeArmEnchant)
{
if (player.itemAnimation == (int)(player.itemAnimationMax * 0.1) ||
player.itemAnimation == (int)(player.itemAnimationMax * 0.3) ||
@@ -88,65 +71,48 @@ namespace CalamityMod.Items.Weapons.Melee
player.itemAnimation == (int)(player.itemAnimationMax * 0.7) ||
player.itemAnimation == (int)(player.itemAnimationMax * 0.9))
{
- float sparkYVel = 0f;
float sparkXVel = 0f;
- float sparkYSpawn = 0f;
+ float sparkYVel = 0f;
float sparkXSpawn = 0f;
+ float sparkYSpawn = 0f;
+
if (player.itemAnimation == (int)(player.itemAnimationMax * 0.9))
{
- sparkYVel = -7f;
+ sparkYVel = -10.5f;
+ if (player.direction == -1)
+ sparkXSpawn = -8f;
}
if (player.itemAnimation == (int)(player.itemAnimationMax * 0.7))
{
- sparkYVel = -6f;
- sparkXVel = 2f;
+ sparkYVel = -9f;
+ sparkXVel = 3f;
+ sparkXSpawn = player.direction == -1 ? 20f : 26f;
}
if (player.itemAnimation == (int)(player.itemAnimationMax * 0.5))
{
- sparkYVel = -4f;
- sparkXVel = 4f;
- }
- if (player.itemAnimation == (int)(player.itemAnimationMax * 0.3))
- {
- sparkYVel = -2f;
+ sparkYVel = -6f;
sparkXVel = 6f;
}
- if (player.itemAnimation == (int)(player.itemAnimationMax * 0.1))
- {
- sparkXVel = 7f;
- }
- if (player.itemAnimation == (int)(player.itemAnimationMax * 0.7))
- {
- sparkXSpawn = 26f;
- }
if (player.itemAnimation == (int)(player.itemAnimationMax * 0.3))
{
- sparkXSpawn -= 4f;
- sparkYSpawn -= 20f;
+ sparkXVel = 9f;
+ sparkYVel = -3f;
+ sparkXSpawn = -4f;
+ sparkYSpawn = -20f;
}
if (player.itemAnimation == (int)(player.itemAnimationMax * 0.1))
{
- sparkYSpawn += 6f;
+ sparkXVel = 10.5f;
+ sparkYSpawn = 6f;
}
- if (player.direction == -1)
- {
- if (player.itemAnimation == (int)(player.itemAnimationMax * 0.9))
- {
- sparkXSpawn -= 8f;
- }
- if (player.itemAnimation == (int)(player.itemAnimationMax * 0.7))
- {
- sparkXSpawn -= 6f;
- }
- }
- sparkYVel *= 1.5f;
- sparkXVel *= 1.5f;
- sparkXSpawn *= (float)player.direction;
+
+ sparkXVel *= player.direction;
+ sparkYVel *= player.gravDir;
+ sparkXSpawn *= player.direction;
sparkYSpawn *= player.gravDir;
var source = player.GetSource_ItemUse(Item);
int damage = (int)player.GetTotalDamage().ApplyTo(Item.damage * 0.1f);
- Projectile.NewProjectile(source, (float)(hitbox.X + hitbox.Width / 2) + sparkXSpawn, (float)(hitbox.Y + hitbox.Height / 2) + sparkYSpawn,
- (float)player.direction * sparkXVel, sparkYVel * player.gravDir, ModContent.ProjectileType(), damage, 0f, player.whoAmI, 0f, 0f);
+ Projectile.NewProjectile(source, hitbox.X + hitbox.Width / 2 + sparkXSpawn, hitbox.Y + hitbox.Height / 2 + sparkYSpawn, sparkXVel, sparkYVel, ModContent.ProjectileType(), damage, 0f, player.whoAmI);
}
}
}
diff --git a/Items/Weapons/Ranged/Infinity.cs b/Items/Weapons/Ranged/Infinity.cs
index 8a164a88ae..f2f5ffe8ec 100644
--- a/Items/Weapons/Ranged/Infinity.cs
+++ b/Items/Weapons/Ranged/Infinity.cs
@@ -64,8 +64,8 @@ namespace CalamityMod.Items.Weapons.Ranged
{
Vector2 helixVel1 = (velocity * Main.rand.NextFloat(0.9f, 1.1f)).RotatedBy(MathHelper.ToRadians(sine));
Vector2 helixVel2 = (velocity * Main.rand.NextFloat(0.9f, 1.1f)).RotatedBy(MathHelper.ToRadians(-sine));
- int shot1 = Projectile.NewProjectile(source, position.X, position.Y, helixVel1.X, helixVel1.Y, shotType, damage, knockback, player.whoAmI, 0f, 0, 1f);
- int shot2 = Projectile.NewProjectile(source, position.X, position.Y, helixVel2.X, helixVel2.Y, shotType, damage, knockback, player.whoAmI, 0f, 0, 1f);
+ int shot1 = Projectile.NewProjectile(source, position.X, position.Y, helixVel1.X, helixVel1.Y, shotType, damage, knockback, player.whoAmI, 0f, 0, player.altFunctionUse != 2 ? 1 : 0);
+ int shot2 = Projectile.NewProjectile(source, position.X, position.Y, helixVel2.X, helixVel2.Y, shotType, damage, knockback, player.whoAmI, 0f, 0, player.altFunctionUse != 2 ? 1 : 0);
}
else if (player.altFunctionUse != 2)
{
diff --git a/Items/Weapons/Ranged/Svantechnical.cs b/Items/Weapons/Ranged/Svantechnical.cs
index 2261b93f72..d8f1d3de75 100644
--- a/Items/Weapons/Ranged/Svantechnical.cs
+++ b/Items/Weapons/Ranged/Svantechnical.cs
@@ -65,9 +65,9 @@ namespace CalamityMod.Items.Weapons.Ranged
Vector2 helixVel1 = (velocity * Main.rand.NextFloat(0.9f, 1.1f)).RotatedBy(MathHelper.ToRadians(sine));
Vector2 helixVel2 = (velocity * Main.rand.NextFloat(0.9f, 1.1f)).RotatedBy(MathHelper.ToRadians(-sine));
Vector2 helixVel3 = (velocity * Main.rand.NextFloat(0.9f, 1.1f)).RotatedBy(MathHelper.ToRadians(sine2));
- int shot1 = Projectile.NewProjectile(source, position.X, position.Y, helixVel1.X, helixVel1.Y, shotType, damage, knockback, player.whoAmI, 0f, 0, 2f);
- int shot2 = Projectile.NewProjectile(source, position.X, position.Y, helixVel2.X, helixVel2.Y, shotType, damage, knockback, player.whoAmI, 0f, 0, 4f);
- int shot3 = Projectile.NewProjectile(source, position.X, position.Y, helixVel3.X, helixVel3.Y, shotType, damage, knockback, player.whoAmI, 0f, 0, 3f);
+ int shot1 = Projectile.NewProjectile(source, position.X, position.Y, helixVel1.X, helixVel1.Y, shotType, damage, knockback, player.whoAmI, 0f, 0, player.altFunctionUse != 2 ? 2f : 0);
+ int shot2 = Projectile.NewProjectile(source, position.X, position.Y, helixVel2.X, helixVel2.Y, shotType, damage, knockback, player.whoAmI, 0f, 0, player.altFunctionUse != 2 ? 4f : 0);
+ int shot3 = Projectile.NewProjectile(source, position.X, position.Y, helixVel3.X, helixVel3.Y, shotType, damage, knockback, player.whoAmI, 0f, 0, player.altFunctionUse != 2 ? 3f : 0);
}
else if (player.altFunctionUse != 2)
{
diff --git a/Localization/en-US/Mods.CalamityMod.Buffs.hjson b/Localization/en-US/Mods.CalamityMod.Buffs.hjson
index cbc1e06da4..971ac6e917 100644
--- a/Localization/en-US/Mods.CalamityMod.Buffs.hjson
+++ b/Localization/en-US/Mods.CalamityMod.Buffs.hjson
@@ -675,7 +675,7 @@ AeolianEarthBuff: {
Description:
'''
You are strengthened by primordial powers
- Damage reduction increased by {0}%, damage increased by {1}%
+ Damage reduction increased by {0}%, damage increased by {1}%, and massively buffed mana regen
'''
}
@@ -885,7 +885,7 @@ SandsWindBuff: {
Description:
'''
You are strengthened by the powers of sand
- Defense increased by {0}, damage increased by {1}%
+ Defense increased by {0}, damage increased by {1}%, and greatly buffed mana regen
'''
}
diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson
index fe2992f93b..ef1dc5d284 100644
--- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson
+++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson
@@ -2161,6 +2161,11 @@ HapuFruit: {
Tooltip: "'A fruit that calms your nerves (may have unintended side effects)'"
}
+LucisSight: {
+ DisplayName: Luci's Sight
+ Tooltip: "'Fashionable glasses? In Earthia's current economy?!'"
+}
+
OracleHeadphones: {
DisplayName: Oracle Headphones
Tooltip: "'Hey game's over!'"
@@ -2203,7 +2208,7 @@ XyksBlessingBlue: {
DisplayName: Xyk's Blessing (Blue)
Tooltip:
'''
- Applies visual effects to your dashes and deaths
+ Applies visual effects to your dashes, wings, and deaths
to transform
'It's simply too much to turn back now; passion and time have long since stained it.
[c/5f8ae1:Have I always been so selfish?']
@@ -2214,7 +2219,7 @@ XyksBlessingOrange: {
DisplayName: Xyk's Blessing (Orange)
Tooltip:
'''
- Applies visual effects to your dashes and deaths
+ Applies visual effects to your dashes, wings, and deaths
to transform
'Even so, the march of time waits for none. Recall that feeling of fulfillment, and show it to the world.
[c/E1B65F:Prove that it was never a waste.']
diff --git a/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson b/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson
index 3f5b3eb4a3..645abad5d7 100644
--- a/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson
+++ b/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson
@@ -17,7 +17,7 @@ AuricTeslaCuisses: {
'''
}
-AuricTeslaHoodedFacemask: {
+AuricTeslaHeadRanged: {
DisplayName: Auric Tesla Hooded Facemask
Tooltip: 30% increased ranged damage and critical strike chance
SetBonus:
@@ -45,7 +45,7 @@ AuricTeslaHoodedFacemask: {
'''
}
-AuricTeslaPlumedHelm: {
+AuricTeslaHeadRogue: {
DisplayName: Auric Tesla Plumed Helm
Tooltip:
'''
@@ -78,7 +78,7 @@ AuricTeslaPlumedHelm: {
'''
}
-AuricTeslaRoyalHelm: {
+AuricTeslaHeadMelee: {
DisplayName: Auric Tesla Royal Helm
Tooltip:
'''
@@ -112,7 +112,7 @@ AuricTeslaRoyalHelm: {
'''
}
-AuricTeslaSpaceHelmet: {
+AuricTeslaHeadSummon: {
DisplayName: Auric Tesla Space Helmet
Tooltip: 15% increased summon damage
SetBonus:
@@ -142,7 +142,7 @@ AuricTeslaSpaceHelmet: {
'''
}
-AuricTeslaWireHemmedVisage: {
+AuricTeslaHeadMagic: {
DisplayName: Auric Tesla Wire-Hemmed Visage
Tooltip: 30% increased magic damage, 20% increased magic critical strike chance, +100 max mana and 20% reduced mana usage
SetBonus:
diff --git a/Localization/en-US/Mods.CalamityMod.Items.Armor.PreHardmode.hjson b/Localization/en-US/Mods.CalamityMod.Items.Armor.PreHardmode.hjson
index 3095f99502..19a3b8ddc3 100644
--- a/Localization/en-US/Mods.CalamityMod.Items.Armor.PreHardmode.hjson
+++ b/Localization/en-US/Mods.CalamityMod.Items.Armor.PreHardmode.hjson
@@ -8,7 +8,7 @@ AerospecBreastplate: {
'''
}
-AerospecHat: {
+AerospecHeadMagic: {
DisplayName: Aerospec Hat
Tooltip: 10% increased magic damage and +30 max mana
SetBonus:
@@ -18,7 +18,7 @@ AerospecHat: {
'''
}
-AerospecHeadgear: {
+AerospecHeadRogue: {
DisplayName: Aerospec Headgear
Tooltip: 10% increased rogue damage and 5% increased movement speed
SetBonus:
@@ -28,7 +28,7 @@ AerospecHeadgear: {
'''
}
-AerospecHelm: {
+AerospecHeadMelee: {
DisplayName: Aerospec Helm
Tooltip: 10% increased melee damage
SetBonus:
@@ -38,7 +38,7 @@ AerospecHelm: {
'''
}
-AerospecHelmet: {
+AerospecHeadSummon: {
DisplayName: Aerospec Helmet
Tooltip: 10% increased summon damage and 5% increased movement speed
SetBonus:
@@ -48,7 +48,7 @@ AerospecHelmet: {
'''
}
-AerospecHood: {
+AerospecHeadRanged: {
DisplayName: Aerospec Hood
Tooltip: 10% increased ranged damage
SetBonus: 5% increased movement speed and ranged critical strike chance
diff --git a/Localization/en-US/Mods.CalamityMod.Items.Armor.Vanity.hjson b/Localization/en-US/Mods.CalamityMod.Items.Armor.Vanity.hjson
index 7ac8dddb6c..dbcac168c2 100644
--- a/Localization/en-US/Mods.CalamityMod.Items.Armor.Vanity.hjson
+++ b/Localization/en-US/Mods.CalamityMod.Items.Armor.Vanity.hjson
@@ -128,6 +128,21 @@ LeviathanMask: {
Tooltip: ""
}
+LucisBoots: {
+ DisplayName: Luci's Boots
+ Tooltip: "'One small step a time, you can do this.'"
+}
+
+LucisHairstyle: {
+ DisplayName: Luci's Hairstyle
+ Tooltip: "'Hero of Light, Luci Skyshot.'"
+}
+
+LucisMilitaryUniform: {
+ DisplayName: Luci's Military Uniform
+ Tooltip: "'Bearing the iconic Liberation Army insignia of freedom.'"
+}
+
OldDukeMask: {
DisplayName: Old Duke Mask
Tooltip: ""
diff --git a/Localization/en-US/Mods.CalamityMod.Items.Misc.hjson b/Localization/en-US/Mods.CalamityMod.Items.Misc.hjson
index 670ed554a6..3700ac4fa9 100644
--- a/Localization/en-US/Mods.CalamityMod.Items.Misc.hjson
+++ b/Localization/en-US/Mods.CalamityMod.Items.Misc.hjson
@@ -415,6 +415,17 @@ ColdheartIcicle: {
Tooltip: "'N(ice) work'"
}
+DisgustingMeat: {
+ DisplayName: Disgusting Meat
+ Tooltip:
+ '''
+ Debug item, spawn and use to remove permanent upgrades
+ will remove health and mana upgrades
+ will remove rage and adrenaline upgrades, plus other miscellaneous boosters
+ Removed boosters will be vomited out of you as items
+ '''
+}
+
MomentumCapacitor: {
DisplayName: Momentum Capacitor
GFBName: Burden Breaker
diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson
index 427c9585ef..89d5f7e200 100644
--- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson
+++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson
@@ -246,7 +246,7 @@ DeathValleyDuster: {
'''
Casts an enchanted blast of sand that passes through enemies and tiles
Casting this spell at max mana while without mana sickness will cause it to give you and any player it hits the Sand's Wind Buff
- The Sand's Wind Buff increases your defense by 10 and damage by 12%
+ The Sand's Wind Buff increases your defense by 10, damage by 12%, and greatly buffs mana regen
'''
}
@@ -654,7 +654,7 @@ PrimordialAncient: {
'''
Casts five primordial sand blasts that converge at your cursor after a moment and create a giant explosion
Casting this spell at max mana while without mana sickness will cause it to give you and any player it hits the {$Buffs.AeolianEarthBuff.DisplayName} buff
- The {$Buffs.AeolianEarthBuff.DisplayName} buff increases your damage reduction by {0}% and damage by {1}%
+ The {$Buffs.AeolianEarthBuff.DisplayName} buff increases your damage reduction by {0}%, damage by {1}%, and massively buffs mana regen
'''
}
@@ -664,7 +664,7 @@ PrimordialEarth: {
'''
Casts two enchanted blasts of sand that coverge with each other and explode
Casting this spell at max mana while without mana sickness will cause it to give you and any player it hits the {$Buffs.SandsWindBuff.DisplayName} buff
- The {$Buffs.SandsWindBuff.DisplayName} buff increases your defense by {0} and damage by {1}%
+ The {$Buffs.SandsWindBuff.DisplayName} buff increases your defense by {0}, damage by {1}%, and greatly buffs mana regen
'''
}
diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson
index 223e79060f..a7f7715998 100644
--- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson
+++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson
@@ -695,7 +695,11 @@ GrandGuardian: {
GreatswordofJudgement: {
DisplayName: Greatsword of Judgement
- Tooltip: Fires a piercing energy wave that releases homing stars as it flies
+ Tooltip:
+ '''
+ Fires a piercing energy wave that releases homing stars as it flies
+ Hits with the blade summon two stronger stars from behind you
+ '''
}
Greentide: {
@@ -768,16 +772,6 @@ InsidiousImpaler: {
'''
}
-IridescentExcalibur: {
- DisplayName: Iridescent Excalibur
- Tooltip:
- '''
- True melee strikes freeze enemies
- Fires rainbow beams that change their behavior based on their color
- Press for true melee
- '''
-}
-
Lacerator: {
DisplayName: Lacerator
Tooltip:
@@ -958,7 +952,6 @@ Orderbringer: {
Tooltip:
'''
Fires piercing energy waves and summons four homing stars near your cursor
- Energy waves deal more damage with each consecutive hit
Hits with the blade summon two beams from the sky
'No matter where you may be you are never alone'
'''
diff --git a/Localization/en-US/Mods.CalamityMod.NPCs.hjson b/Localization/en-US/Mods.CalamityMod.NPCs.hjson
index ca33d6a044..125f690431 100644
--- a/Localization/en-US/Mods.CalamityMod.NPCs.hjson
+++ b/Localization/en-US/Mods.CalamityMod.NPCs.hjson
@@ -189,12 +189,7 @@ Rotdog.DisplayName: Rotdog
ScornEater.DisplayName: Scorn Eater
ShockstormShuttle.DisplayName: Shockstorm Shuttle
Shroomble.DisplayName: Shroomble
-SkeletronOmega.DisplayName: Skeletron Omega
-OmegaSaw.DisplayName: Omega Saw
-OmegaLaser.DisplayName: Omega Laser
-SkeletronPrime2.DisplayName: Skeletron Alpha
-AlphaVice.DisplayName: Alpha Vice
-AlphaCannon.DisplayName: Alpha Cannon
+SkeletronPrime2.DisplayName: Skeletron Prime
Stormlion.DisplayName: Stormlion
StormlionSentry.DisplayName: Stormlion Sentry
Sunskater.DisplayName: Sunskater
@@ -568,3 +563,7 @@ SeaKing: {
Princess_LovesNPC: "{NPCName} always smiles when I'm nearby, I like being around him just for that!"
}
}
+
+WildBumblebirb.DisplayName: Wild Bumblebirb
+DraconicSwarmer.DisplayName: Draconic Swarmer
+Dragonfolly.DisplayName: Dragonfolly
diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Healing.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Healing.hjson
index 211c3eb65d..dfd1dd43af 100644
--- a/Localization/en-US/Mods.CalamityMod.Projectiles.Healing.hjson
+++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Healing.hjson
@@ -10,7 +10,6 @@ FungalHeal.DisplayName: Heal
GladiatorHealOrb.DisplayName: Heal
GreenJellyAura.DisplayName: Green Jelly Aura
HydrothermicHealOrb.DisplayName: Hydrothermic Rejuvenation
-IridescentExcaliburHeal.DisplayName: Iridescent Excalibur Heal
ManaPolarizerHealOrb.DisplayName: Mana Polarizer Heal Orb
PhantomicHeart.DisplayName: Phantomic Heart
PinkJellyAura.DisplayName: Pink Jelly Aura
diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Magic.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Magic.hjson
index c3c7de4c15..16d495a2de 100644
--- a/Localization/en-US/Mods.CalamityMod.Projectiles.Magic.hjson
+++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Magic.hjson
@@ -214,8 +214,8 @@ SpiritDust.DisplayName: Spirit Dust
Starblast.DisplayName: Star
StardustElementalBeam.DisplayName: Stardust Beam
StickyFeather.DisplayName: Feather
-SylveBolt.DisplayName: Sylv Bolt
-SylveRay.DisplayName: Sylv Ray
+SylvBolt.DisplayName: Sylv Bolt
+SylvRay.DisplayName: Sylv Ray
TacticiansElectricBoom.DisplayName: Electric Explosion
TacticiansTrumpCardProj.DisplayName: Trump Beam
TearsofHeavenProjectile.DisplayName: Tears of Heaven
@@ -261,5 +261,3 @@ WyvernFeatherPurple.DisplayName: Feather
WyvernProjectile.DisplayName: Wyvern
YharimsCrystalBeam.DisplayName: Yharim's Beam
YharimsCrystalPrism.DisplayName: Yermes Christal
-SylvBolt.DisplayName: Sylv Bolt
-SylvRay.DisplayName: Sylv Ray
diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson
index fcf84f80e5..53e09e1f92 100644
--- a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson
+++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson
@@ -154,9 +154,6 @@ HolyColliderHolyFire.DisplayName: Holy Collider Fire
IceBombFriendly.DisplayName: Ice Bomb
IllustriousKnife.DisplayName: Illustrious Knife
InsidiousHarpoon.DisplayName: Insidious Harpoon
-IridescentExcaliburSlash.DisplayName: Iridescent Excalibur Slash
-IridescentExcaliburSlash2.DisplayName: Iridescent Excalibur Slash
-IridescentExcaliburSlash3.DisplayName: Iridescent Excalibur Slash
JudgementProj.DisplayName: JUDGEMENT
LamentationsOfTheChained.DisplayName: Lamentations of the Chained
LaserFountain.DisplayName: Laser Fountain
@@ -237,6 +234,7 @@ StarburstBeam.DisplayName: Star Shiv
StarburstSHIV.DisplayName: SHIV
StarnightBeam.DisplayName: Starnight Beam
StarofJudgement.DisplayName: Star of Judgement
+StarofOrder.DisplayName: Star of Order
StellarContemptBlast.DisplayName: Stellar Blast
StellarContemptEcho.DisplayName: Echoes of Contempt
StellarContemptHammer.DisplayName: Stellar Contempt
diff --git a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson
index b037db0068..eb9bbf4fc6 100644
--- a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson
+++ b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson
@@ -339,7 +339,6 @@ DemolitionistChat: {
DryadChat: {
DarksunEclipse: There's a dark solar energy emanating from the moths that appear during this time. What's up with moths getting stronger as you do too?
Hardmode: That starborne illness sits upon this land like a blister. Do even more vile forces of corruption exist in worlds beyond?
- DrunkPrincessShroom: "{0} put me up to this."
Mushroom: I'm not here for any reason! Just picking up mushrooms for uh, later use.
SulphurSea: My Goddess is resting deep below this sea. If you may excuse me, I wish to pay my respects to her alone.
}
@@ -377,7 +376,6 @@ MechanicChat: {
MoonLordDefeated: What do you mean your traps aren't making the cut? Don't look at me!
Eclipse: Um... should my nightlight be on?
AcidRain: Maybe I should've waterproofed my gadgets... They're starting to corrode.
- DrunkPrincess: Well, I like {0}, but I, ah... I have my eyes on someone else.
}
MerchantChat: {
@@ -407,7 +405,6 @@ PainterChat: {
}
PartyGirlChat: {
- DrunkPrincess: I have a feeling we're going to have absolutely fantastic parties with {0} around!
Eclipse1: I think my light display is turning into an accidental bug zapper. At least the monsters are enjoying it.
Eclipse2: Ooh! I love parties where everyone wears a scary costume!
}
@@ -415,7 +412,6 @@ PartyGirlChat: {
PirateChat: {
PreLeviathan: Aye, I've heard of a mythical creature in the oceans, singing with an alluring voice. Careful when yer fishin out there.
WetScourgeDefeated: I have to thank ye again for takin' care of that sea serpent. Or was that another one...
- DrunkPrincess: Twenty-nine bottles of beer on the wall...
SeaKing: I remember legends about that {0}. He ain't quite how the stories make him out to be though.
Ocean: Now this is a scene that I can admire any time! I feel like something is watching me though.
SulphurSea1: It ain't much of a sight, but there's still life living in these waters.
@@ -442,18 +438,12 @@ SteampunkerChat: {
StylistChat: {
Hardmode: Please don't catch space lice. Or {0} lice. Or just lice in general.
- DrunkPrincess1: "{0} is always trying to brighten my mood... even though, deep down, I know she's sad..."
- DrunkPrincess2: Sometimes I catch {0} sneaking up from behind me.
- DrunkPrincess3: "{0} has been smiling more often lately, even without alcohol. I think I can thank you for that, at least somewhat."
ProfanedSoulCrystal1: They look so cute and yet, I can feel their immense power just by being near them. What are you?
ProfanedSoulCrystal2: I hate to break it to you, but you don't have hair to cut or style, hun.
ProfanedDonuts: Aww, they're so cute, do they have names?
}
-TavernkeepChat: {
- FullMoon: Care for a little Moonshine?
- DrunkPrincess: Sheesh, {0} is a little cruel, isn't she? I never claimed to be an expert on anything but ale!
-}
+TavernkeepChat.FullMoon: Care for a little Moonshine?
TaxCollectorChat: {
DoGDefeated: Devourer of what, you said? Devourer of Funds, if its payroll is anything to go by!
@@ -463,12 +453,7 @@ TaxCollectorChat: {
Has100Plat: BAH! Doesn't seem like I'll ever be able to quarrel with the debts of the town again!
}
-TravellingMerchantChat.DrunkPrincessMerchant: Tell {0} I'll take up her offer and meet with her at the back of {1}'s house.
-
-TruffleChat: {
- Normal: I don't feel very safe; I think there's pigs following me around and it frightens me.
- DrunkPrincess: Sometimes, {0} just looks at me funny and I'm not sure how I feel about that.
-}
+TruffleChat.Normal: I don't feel very safe; I think there's pigs following me around and it frightens me.
WitchDoctorChat: {
BloodMoon: This is as good a time as any to pick up the best ingredients for potions.
diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs
index e5aaf5bc23..65c8470dcf 100644
--- a/ModSupport/WeakReferenceSupport.cs
+++ b/ModSupport/WeakReferenceSupport.cs
@@ -741,7 +741,7 @@ namespace CalamityMod
{
string entryName = "Dragonfolly";
BossChecklistProgressionValues.TryGetValue(entryName, out float order);
- int type = NPCType();
+ int type = NPCType();
List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType() };
AddBoss(bossChecklist, calamity, entryName, order, DownedDragonfolly, type, new Dictionary()
{
diff --git a/NPCs/Abyss/Laserfish.cs b/NPCs/Abyss/Laserfish.cs
index e15e91f222..04906775dd 100644
--- a/NPCs/Abyss/Laserfish.cs
+++ b/NPCs/Abyss/Laserfish.cs
@@ -2,7 +2,7 @@
using CalamityMod.BiomeManagers;
using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables.Banners;
-using CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs;
+using CalamityMod.NPCs.NormalNPCs;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
diff --git a/NPCs/Abyss/MorayEel.cs b/NPCs/Abyss/MorayEel.cs
index 69c7dc7c72..4cbaa373e4 100644
--- a/NPCs/Abyss/MorayEel.cs
+++ b/NPCs/Abyss/MorayEel.cs
@@ -2,7 +2,7 @@
using CalamityMod.BiomeManagers;
using CalamityMod.Items.Placeables.Banners;
using CalamityMod.Items.Weapons.Melee;
-using CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs;
+using CalamityMod.NPCs.NormalNPCs;
using Terraria;
using Terraria.GameContent.Bestiary;
using Terraria.GameContent.ItemDropRules;
diff --git a/NPCs/Abyss/ToxicMinnow.cs b/NPCs/Abyss/ToxicMinnow.cs
index 3fbf5c0ef8..5f54401431 100644
--- a/NPCs/Abyss/ToxicMinnow.cs
+++ b/NPCs/Abyss/ToxicMinnow.cs
@@ -3,7 +3,7 @@ using System.IO;
using CalamityMod.BiomeManagers;
using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables.Banners;
-using CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs;
+using CalamityMod.NPCs.NormalNPCs;
using CalamityMod.Projectiles.Enemy;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
diff --git a/NPCs/Abyss/Viperfish.cs b/NPCs/Abyss/Viperfish.cs
index 2fed796aaa..8e5d0c06e6 100644
--- a/NPCs/Abyss/Viperfish.cs
+++ b/NPCs/Abyss/Viperfish.cs
@@ -4,7 +4,7 @@ using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables.Banners;
using CalamityMod.Items.Weapons.Melee;
-using CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs;
+using CalamityMod.NPCs.NormalNPCs;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
diff --git a/NPCs/AquaticScourge/AquaticScourgeBody.cs b/NPCs/AquaticScourge/AquaticScourgeBody.cs
index b0db3298e4..b7f421f08c 100644
--- a/NPCs/AquaticScourge/AquaticScourgeBody.cs
+++ b/NPCs/AquaticScourge/AquaticScourgeBody.cs
@@ -1,15 +1,19 @@
using System.IO;
+using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.Events;
-using CalamityMod.NPCs.CalamityAIs.CalamityBossAIs;
+using CalamityMod.Projectiles.Boss;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
+using System;
using Terraria;
+using Terraria.Audio;
using Terraria.GameContent;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
+using CalamityMod.Systems.Collections;
namespace CalamityMod.NPCs.AquaticScourge
{
@@ -36,7 +40,7 @@ namespace CalamityMod.NPCs.AquaticScourge
NPC.knockBackResist = 0f;
NPC.alpha = 255;
NPC.LifeMaxNERB(80000, 96000, 1000000);
- if (CalamityWorld.LegendaryMode && CalamityWorld.revenge)
+ if (CalamityWorld.LegendaryMode)
NPC.lifeMax *= 2;
NPC.behindTiles = true;
NPC.noGravity = true;
@@ -56,7 +60,7 @@ namespace CalamityMod.NPCs.AquaticScourge
else if (Main.expertMode)
NPC.scale *= 1.1f;
- if (Main.getGoodWorld)
+ if (CalamityWorld.LegendaryMode)
NPC.scale *= 1.25f;
NPC.Calamity().VulnerableToHeat = false;
@@ -89,7 +93,248 @@ namespace CalamityMod.NPCs.AquaticScourge
public override void AI()
{
- AquaticScourgeAI.VanillaAquaticScourgeAI(NPC, Mod, false);
+ CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity();
+ bool bossRush = BossRushEvent.BossRushActive;
+ bool expertMode = Main.expertMode || bossRush;
+ bool revenge = CalamityWorld.revenge || bossRush;
+ bool death = CalamityWorld.death || bossRush;
+
+ bool getFuckedAI = Main.zenithWorld;
+
+ // Adjust hostility and stats
+ bool nonHostile = calamityGlobalNPC.newAI[0] == 0f;
+ if (NPC.justHit || NPC.life <= NPC.lifeMax * 0.999 || bossRush || CalamityWorld.LegendaryMode)
+ {
+ if (nonHostile)
+ {
+ // Kiss my motherfucking ass you piece of shit game
+ NPC.timeLeft *= 20;
+ NPC.npcSlots = 16f;
+ CalamityGlobalNPC.BossKillTimes.TryGetValue(NPC.type, out int revKillTime);
+ calamityGlobalNPC.KillTime = revKillTime;
+ calamityGlobalNPC.newAI[0] = 1f;
+ nonHostile = false;
+ NPC.chaseable = true;
+ NPC.netUpdate = true;
+ }
+ }
+ else
+ NPC.damage = 0;
+
+ // Percent life remaining
+ float lifeRatio = NPC.life / (float)NPC.lifeMax;
+
+ // Phases
+ bool phase2 = lifeRatio < 0.75f;
+ bool phase3 = lifeRatio < 0.5f;
+ bool phase4 = lifeRatio < 0.25f;
+
+ // Set worm variable
+ if (NPC.ai[2] > 0f)
+ NPC.realLife = (int)NPC.ai[2];
+ if (NPC.life > Main.npc[(int)NPC.ai[1]].life)
+ NPC.life = Main.npc[(int)NPC.ai[1]].life;
+
+ // Get a target
+ if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active)
+ NPC.TargetClosest();
+
+ Player player = Main.player[NPC.target];
+
+ bool notOcean = player.position.Y < 300f ||
+ player.position.Y > Main.worldSurface * 16.0 ||
+ (player.position.X > 7680f && player.position.X < (Main.maxTilesX * 16 - 7680));
+
+ // Check for the flipped Abyss
+ if (Main.remixWorld)
+ {
+ notOcean = player.position.Y < Main.UnderworldLayer * 0.8f || player.position.Y > Main.UnderworldLayer ||
+ (player.position.X > 7680f && player.position.X < (Main.maxTilesX * 16 - 7680));
+ }
+
+ bool biomeEnraged = NPC.localAI[2] <= 0f || bossRush;
+ float enrageScale = bossRush ? 1f : 0f;
+ if (biomeEnraged)
+ {
+ NPC.Calamity().CurrentlyEnraged = !bossRush;
+ enrageScale += 2f;
+ }
+
+ // Adjust slowing debuff immunity
+ bool immuneToSlowingDebuffs = getFuckedAI;
+ NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs;
+ NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs;
+ NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs;
+ NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs;
+ NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs;
+ NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs;
+ NPC.buffImmune[BuffID.Slow] = immuneToSlowingDebuffs;
+ NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs;
+
+ // Fire teeth
+ if (calamityGlobalNPC.newAI[0] == 1f && (!phase3 || phase4))
+ {
+ NPC.localAI[0] += 1f;
+ float shootProjectile = 300;
+ float timer = NPC.ai[0] + 15f;
+ float divisor = timer + shootProjectile;
+
+ if (NPC.localAI[0] % divisor == 0f && (NPC.ai[0] % 3f == 0f || getFuckedAI || !death))
+ {
+ NPC.TargetClosest();
+ if (Collision.CanHit(NPC.position, NPC.width, NPC.height, player.position, player.width, player.height))
+ {
+ SoundEngine.PlaySound(SoundID.Item17, NPC.Center);
+
+ if (Main.netMode != NetmodeID.MultiplayerClient)
+ {
+ float toothVelocity = death ? 9f : 8f;
+ Vector2 projectileVelocity = (player.Center - NPC.Center).SafeNormalize(Vector2.UnitY);
+ int type = ModContent.ProjectileType();
+ int damage = NPC.GetProjectileDamage(type);
+ float accelerate = phase4 ? 1f : 0f;
+ Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + projectileVelocity * 5f, projectileVelocity * toothVelocity, type, damage, 0f, Main.myPlayer, accelerate, 0f);
+ }
+
+ NPC.netUpdate = true;
+ }
+ }
+ }
+
+ // Kill body and tail
+ bool shouldDespawn = true;
+ for (int i = 0; i < Main.maxNPCs; i++)
+ {
+ if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType())
+ {
+ shouldDespawn = false;
+ break;
+ }
+ }
+ if (!shouldDespawn)
+ {
+ if (NPC.ai[1] <= 0f)
+ shouldDespawn = true;
+ else if (Main.npc[(int)NPC.ai[1]].life <= 0)
+ shouldDespawn = true;
+ }
+ if (shouldDespawn)
+ {
+ NPC.life = 0;
+ NPC.HitEffect(0, 10.0);
+ NPC.checkDead();
+ NPC.active = false;
+ }
+
+ float maxDistance = calamityGlobalNPC.newAI[0] == 1f ? 12800f : 6400f;
+ if (player.dead || Vector2.Distance(NPC.Center, player.Center) > maxDistance || (nonHostile && biomeEnraged))
+ {
+ calamityGlobalNPC.newAI[1] = 1f;
+ NPC.TargetClosest(false);
+ NPC.velocity.Y += 2f;
+
+ if (NPC.position.Y > Main.worldSurface * 16D)
+ NPC.velocity.Y += 2f;
+
+ if (NPC.position.Y > Main.worldSurface * 16D)
+ {
+ for (int a = 0; a < Main.npc.Length; a++)
+ {
+ int type = Main.npc[a].type;
+ if (AquaticScourgeIDList.Includes(type))
+ Main.npc[a].active = false;
+ }
+ }
+ }
+ else
+ calamityGlobalNPC.newAI[1] = 0f;
+
+ // Change direction
+ if (NPC.velocity.X < 0f)
+ NPC.spriteDirection = -1;
+ else if (NPC.velocity.X > 0f)
+ NPC.spriteDirection = 1;
+
+ // Alpha changes
+ if (Main.npc[(int)NPC.ai[1]].alpha < 128)
+ {
+ NPC.alpha -= 42;
+ if (NPC.alpha < 0)
+ NPC.alpha = 0;
+ }
+
+ Vector2 scourgePosition = NPC.Center;
+ Vector2 predictionVector = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? Main.player[NPC.target].velocity * 20f : Vector2.Zero;
+ float scourgeTargetX = player.Center.X + predictionVector.X;
+ float scourgeTargetY = player.Center.Y + predictionVector.Y;
+
+ // Velocity and movement
+ float scourgeMaxSpeed = 5f;
+ if (calamityGlobalNPC.newAI[0] == 1f)
+ {
+ scourgeMaxSpeed = revenge ? 14.4f : 12f;
+ if (expertMode)
+ scourgeMaxSpeed += 2.4f * (1f - lifeRatio);
+ scourgeMaxSpeed += 3f * enrageScale;
+ if (death || getFuckedAI)
+ {
+ scourgeMaxSpeed += 5f;
+ scourgeMaxSpeed += Vector2.Distance(player.Center, NPC.Center) * 0.001f;
+ }
+
+ if (CalamityWorld.LegendaryMode)
+ scourgeMaxSpeed *= 1.15f;
+ }
+
+ scourgeTargetX = (int)(scourgeTargetX / 16f) * 16;
+ scourgeTargetY = (int)(scourgeTargetY / 16f) * 16;
+ scourgePosition.X = (int)(scourgePosition.X / 16f) * 16;
+ scourgePosition.Y = (int)(scourgePosition.Y / 16f) * 16;
+ scourgeTargetX -= scourgePosition.X;
+ scourgeTargetY -= scourgePosition.Y;
+
+ if (NPC.ai[1] > 0f && NPC.ai[1] < Main.npc.Length)
+ {
+ try
+ {
+ scourgePosition = NPC.Center;
+ scourgeTargetX = Main.npc[(int)NPC.ai[1]].Center.X - scourgePosition.X;
+ scourgeTargetY = Main.npc[(int)NPC.ai[1]].Center.Y - scourgePosition.Y;
+ }
+ catch
+ {
+ }
+
+ NPC.rotation = (float)Math.Atan2(scourgeTargetY, scourgeTargetX) + MathHelper.PiOver2;
+ float scourgeTargetDist = (float)Math.Sqrt(scourgeTargetX * scourgeTargetX + scourgeTargetY * scourgeTargetY);
+ int scourgeWidth = NPC.width;
+ scourgeTargetDist = (scourgeTargetDist - scourgeWidth) / scourgeTargetDist;
+ scourgeTargetX *= scourgeTargetDist;
+ scourgeTargetY *= scourgeTargetDist;
+ NPC.velocity = Vector2.Zero;
+ NPC.position.X = NPC.position.X + scourgeTargetX;
+ NPC.position.Y = NPC.position.Y + scourgeTargetY;
+
+ if (scourgeTargetX < 0f)
+ NPC.spriteDirection = -1;
+ else if (scourgeTargetX > 0f)
+ NPC.spriteDirection = 1;
+ }
+
+ // Calculate contact damage based on velocity
+ if (!nonHostile)
+ {
+ float minimalContactDamageVelocity = scourgeMaxSpeed * 0.25f;
+ float minimalDamageVelocity = scourgeMaxSpeed * 0.5f;
+ float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length();
+ if (bodyAndTailVelocity <= minimalContactDamageVelocity)
+ NPC.damage = 0;
+ else
+ {
+ float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f);
+ NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar);
+ }
+ }
}
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
diff --git a/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs b/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs
index ae65703e57..39a070170d 100644
--- a/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs
+++ b/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs
@@ -1,11 +1,15 @@
-using System.IO;
+using System;
+using System.IO;
+using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.Events;
-using CalamityMod.NPCs.CalamityAIs.CalamityBossAIs;
+using CalamityMod.Projectiles.Boss;
+using CalamityMod.Systems.Collections;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
+using Terraria.Audio;
using Terraria.GameContent;
using Terraria.ID;
using Terraria.Localization;
@@ -35,7 +39,7 @@ namespace CalamityMod.NPCs.AquaticScourge
NPC.knockBackResist = 0f;
NPC.alpha = 255;
NPC.LifeMaxNERB(80000, 96000, 1000000);
- if (CalamityWorld.LegendaryMode && CalamityWorld.revenge)
+ if (CalamityWorld.LegendaryMode)
NPC.lifeMax *= 2;
NPC.behindTiles = true;
NPC.noGravity = true;
@@ -55,7 +59,7 @@ namespace CalamityMod.NPCs.AquaticScourge
else if (Main.expertMode)
NPC.scale *= 1.1f;
- if (Main.getGoodWorld)
+ if (CalamityWorld.LegendaryMode)
NPC.scale *= 1.25f;
NPC.Calamity().VulnerableToHeat = false;
@@ -88,7 +92,218 @@ namespace CalamityMod.NPCs.AquaticScourge
public override void AI()
{
- AquaticScourgeAI.VanillaAquaticScourgeAI(NPC, Mod, false);
+ CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity();
+ bool bossRush = BossRushEvent.BossRushActive;
+ bool expertMode = Main.expertMode || bossRush;
+ bool revenge = CalamityWorld.revenge || bossRush;
+ bool death = CalamityWorld.death || bossRush;
+
+ bool getFuckedAI = Main.zenithWorld;
+
+ // Adjust hostility and stats
+ bool nonHostile = calamityGlobalNPC.newAI[0] == 0f;
+ if (NPC.justHit || NPC.life <= NPC.lifeMax * 0.999 || bossRush || CalamityWorld.LegendaryMode)
+ {
+ if (nonHostile)
+ {
+ // Kiss my motherfucking ass you piece of shit game
+ NPC.timeLeft *= 20;
+ NPC.npcSlots = 16f;
+ CalamityGlobalNPC.BossKillTimes.TryGetValue(NPC.type, out int revKillTime);
+ calamityGlobalNPC.KillTime = revKillTime;
+ calamityGlobalNPC.newAI[0] = 1f;
+ nonHostile = false;
+ NPC.chaseable = true;
+ NPC.netUpdate = true;
+ }
+ }
+ else
+ NPC.damage = 0;
+
+ // Percent life remaining
+ float lifeRatio = NPC.life / (float)NPC.lifeMax;
+
+ // Phases
+ bool phase2 = lifeRatio < 0.75f;
+ bool phase3 = lifeRatio < 0.5f;
+ bool phase4 = lifeRatio < 0.25f;
+
+ // Set worm variable
+ if (NPC.ai[2] > 0f)
+ NPC.realLife = (int)NPC.ai[2];
+ if (NPC.life > Main.npc[(int)NPC.ai[1]].life)
+ NPC.life = Main.npc[(int)NPC.ai[1]].life;
+
+ // Get a target
+ if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active)
+ NPC.TargetClosest();
+
+ Player player = Main.player[NPC.target];
+
+ bool notOcean = player.position.Y < 300f ||
+ player.position.Y > Main.worldSurface * 16.0 ||
+ (player.position.X > 7680f && player.position.X < (Main.maxTilesX * 16 - 7680));
+
+ // Check for the flipped Abyss
+ if (Main.remixWorld)
+ {
+ notOcean = player.position.Y < Main.UnderworldLayer * 0.8f || player.position.Y > Main.UnderworldLayer ||
+ (player.position.X > 7680f && player.position.X < (Main.maxTilesX * 16 - 7680));
+ }
+
+ bool biomeEnraged = NPC.localAI[2] <= 0f || bossRush;
+ float enrageScale = bossRush ? 1f : 0f;
+ if (biomeEnraged)
+ {
+ NPC.Calamity().CurrentlyEnraged = !bossRush;
+ enrageScale += 2f;
+ }
+
+ // Adjust slowing debuff immunity
+ bool immuneToSlowingDebuffs = getFuckedAI;
+ NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs;
+ NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs;
+ NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs;
+ NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs;
+ NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs;
+ NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs;
+ NPC.buffImmune[BuffID.Slow] = immuneToSlowingDebuffs;
+ NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs;
+
+ // Kill body and tail
+ bool shouldDespawn = true;
+ for (int i = 0; i < Main.maxNPCs; i++)
+ {
+ if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType())
+ {
+ shouldDespawn = false;
+ break;
+ }
+ }
+ if (!shouldDespawn)
+ {
+ if (NPC.ai[1] <= 0f)
+ shouldDespawn = true;
+ else if (Main.npc[(int)NPC.ai[1]].life <= 0)
+ shouldDespawn = true;
+ }
+ if (shouldDespawn)
+ {
+ NPC.life = 0;
+ NPC.HitEffect(0, 10.0);
+ NPC.checkDead();
+ NPC.active = false;
+ }
+
+ float maxDistance = calamityGlobalNPC.newAI[0] == 1f ? 12800f : 6400f;
+ if (player.dead || Vector2.Distance(NPC.Center, player.Center) > maxDistance || (nonHostile && biomeEnraged))
+ {
+ calamityGlobalNPC.newAI[1] = 1f;
+ NPC.TargetClosest(false);
+ NPC.velocity.Y += 2f;
+
+ if (NPC.position.Y > Main.worldSurface * 16D)
+ NPC.velocity.Y += 2f;
+
+ if (NPC.position.Y > Main.worldSurface * 16D)
+ {
+ for (int a = 0; a < Main.npc.Length; a++)
+ {
+ int type = Main.npc[a].type;
+ if (AquaticScourgeIDList.Includes(type))
+ Main.npc[a].active = false;
+ }
+ }
+ }
+ else
+ calamityGlobalNPC.newAI[1] = 0f;
+
+ // Change direction
+ if (NPC.velocity.X < 0f)
+ NPC.spriteDirection = -1;
+ else if (NPC.velocity.X > 0f)
+ NPC.spriteDirection = 1;
+
+ // Alpha changes
+ if (Main.npc[(int)NPC.ai[1]].alpha < 128)
+ {
+ NPC.alpha -= 42;
+ if (NPC.alpha < 0)
+ NPC.alpha = 0;
+ }
+
+ Vector2 scourgePosition = NPC.Center;
+ Vector2 predictionVector = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? Main.player[NPC.target].velocity * 20f : Vector2.Zero;
+ float scourgeTargetX = player.Center.X + predictionVector.X;
+ float scourgeTargetY = player.Center.Y + predictionVector.Y;
+
+ // Velocity and movement
+ float scourgeMaxSpeed = 5f;
+ if (calamityGlobalNPC.newAI[0] == 1f)
+ {
+ scourgeMaxSpeed = revenge ? 14.4f : 12f;
+ if (expertMode)
+ scourgeMaxSpeed += 2.4f * (1f - lifeRatio);
+ scourgeMaxSpeed += 3f * enrageScale;
+ if (death || getFuckedAI)
+ {
+ scourgeMaxSpeed += 5f;
+ scourgeMaxSpeed += Vector2.Distance(player.Center, NPC.Center) * 0.001f;
+ }
+
+ if (CalamityWorld.LegendaryMode)
+ scourgeMaxSpeed *= 1.15f;
+ }
+
+ scourgeTargetX = (int)(scourgeTargetX / 16f) * 16;
+ scourgeTargetY = (int)(scourgeTargetY / 16f) * 16;
+ scourgePosition.X = (int)(scourgePosition.X / 16f) * 16;
+ scourgePosition.Y = (int)(scourgePosition.Y / 16f) * 16;
+ scourgeTargetX -= scourgePosition.X;
+ scourgeTargetY -= scourgePosition.Y;
+
+ if (NPC.ai[1] > 0f && NPC.ai[1] < Main.npc.Length)
+ {
+ try
+ {
+ scourgePosition = NPC.Center;
+ scourgeTargetX = Main.npc[(int)NPC.ai[1]].Center.X - scourgePosition.X;
+ scourgeTargetY = Main.npc[(int)NPC.ai[1]].Center.Y - scourgePosition.Y;
+ }
+ catch
+ {
+ }
+
+ NPC.rotation = (float)Math.Atan2(scourgeTargetY, scourgeTargetX) + MathHelper.PiOver2;
+ float scourgeTargetDist = (float)Math.Sqrt(scourgeTargetX * scourgeTargetX + scourgeTargetY * scourgeTargetY);
+ int scourgeWidth = NPC.width;
+ scourgeTargetDist = (scourgeTargetDist - scourgeWidth) / scourgeTargetDist;
+ scourgeTargetX *= scourgeTargetDist;
+ scourgeTargetY *= scourgeTargetDist;
+ NPC.velocity = Vector2.Zero;
+ NPC.position.X = NPC.position.X + scourgeTargetX;
+ NPC.position.Y = NPC.position.Y + scourgeTargetY;
+
+ if (scourgeTargetX < 0f)
+ NPC.spriteDirection = -1;
+ else if (scourgeTargetX > 0f)
+ NPC.spriteDirection = 1;
+ }
+
+ // Calculate contact damage based on velocity
+ if (!nonHostile)
+ {
+ float minimalContactDamageVelocity = scourgeMaxSpeed * 0.25f;
+ float minimalDamageVelocity = scourgeMaxSpeed * 0.5f;
+ float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length();
+ if (bodyAndTailVelocity <= minimalContactDamageVelocity)
+ NPC.damage = 0;
+ else
+ {
+ float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f);
+ NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar);
+ }
+ }
}
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
diff --git a/NPCs/AquaticScourge/AquaticScourgeHead.cs b/NPCs/AquaticScourge/AquaticScourgeHead.cs
index 4acad4c1dc..37f7762972 100644
--- a/NPCs/AquaticScourge/AquaticScourgeHead.cs
+++ b/NPCs/AquaticScourge/AquaticScourgeHead.cs
@@ -1,5 +1,6 @@
using System.IO;
using CalamityMod.BiomeManagers;
+using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.Events;
using CalamityMod.Items.Accessories;
@@ -16,13 +17,13 @@ using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Items.Weapons.Ranged;
using CalamityMod.Items.Weapons.Rogue;
using CalamityMod.Items.Weapons.Summon;
-using CalamityMod.NPCs.Abyss;
using CalamityMod.NPCs.AcidRain;
-using CalamityMod.NPCs.CalamityAIs.CalamityBossAIs;
-using CalamityMod.NPCs.TownNPCs;
+using CalamityMod.Projectiles.Boss;
+using CalamityMod.Projectiles.Enemy;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
+using System;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent;
@@ -30,6 +31,7 @@ using Terraria.GameContent.Bestiary;
using Terraria.GameContent.ItemDropRules;
using Terraria.ID;
using Terraria.ModLoader;
+using CalamityMod.Systems.Collections;
namespace CalamityMod.NPCs.AquaticScourge
{
@@ -63,7 +65,7 @@ namespace CalamityMod.NPCs.AquaticScourge
NPC.aiStyle = -1;
AIType = -1;
NPC.LifeMaxNERB(80000, 96000, 1000000);
- if (CalamityWorld.LegendaryMode && CalamityWorld.revenge)
+ if (CalamityWorld.LegendaryMode)
NPC.lifeMax *= 2;
NPC.knockBackResist = 0f;
NPC.value = Item.buyPrice(0, 16, 0, 0);
@@ -84,7 +86,7 @@ namespace CalamityMod.NPCs.AquaticScourge
else if (Main.expertMode)
NPC.scale *= 1.1f;
- if (Main.getGoodWorld)
+ if (CalamityWorld.LegendaryMode)
NPC.scale *= 1.25f;
NPC.Calamity().VulnerableToHeat = false;
@@ -131,7 +133,465 @@ namespace CalamityMod.NPCs.AquaticScourge
public override void AI()
{
- AquaticScourgeAI.VanillaAquaticScourgeAI(NPC, Mod, true);
+ CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity();
+ bool bossRush = BossRushEvent.BossRushActive;
+ bool expertMode = Main.expertMode || bossRush;
+ bool revenge = CalamityWorld.revenge || bossRush;
+ bool death = CalamityWorld.death || bossRush;
+
+ bool getFuckedAI = Main.zenithWorld;
+ CalamityGlobalNPC.aquaticScourge = NPC.whoAmI;
+
+ // Adjust hostility and stats
+ bool nonHostile = calamityGlobalNPC.newAI[0] == 0f;
+ if (NPC.justHit || NPC.life <= NPC.lifeMax * 0.999 || bossRush || CalamityWorld.LegendaryMode)
+ {
+ if (nonHostile)
+ {
+ // Kiss my motherfucking ass you piece of shit game
+ NPC.timeLeft *= 20;
+ NPC.npcSlots = 16f;
+ CalamityGlobalNPC.BossKillTimes.TryGetValue(NPC.type, out int revKillTime);
+ calamityGlobalNPC.KillTime = revKillTime;
+ calamityGlobalNPC.newAI[0] = 1f;
+ nonHostile = false;
+ NPC.boss = true;
+ NPC.chaseable = true;
+ NPC.netUpdate = true;
+ }
+ }
+ else
+ NPC.damage = 0;
+
+ // Percent life remaining
+ float lifeRatio = NPC.life / (float)NPC.lifeMax;
+
+ // Phases
+ bool phase2 = lifeRatio < 0.75f;
+ bool phase3 = lifeRatio < 0.5f;
+ bool phase4 = lifeRatio < 0.25f;
+
+ // Set worm variable
+ if (NPC.ai[2] > 0f)
+ NPC.realLife = (int)NPC.ai[2];
+
+ // Get a target
+ if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active)
+ NPC.TargetClosest();
+
+ Player player = Main.player[NPC.target];
+
+ bool notOcean = player.position.Y < 300f ||
+ player.position.Y > Main.worldSurface * 16.0 ||
+ (player.position.X > 7680f && player.position.X < (Main.maxTilesX * 16 - 7680));
+
+ // Check for the flipped Abyss
+ if (Main.remixWorld)
+ {
+ notOcean = player.position.Y < Main.UnderworldLayer * 0.8f || player.position.Y > Main.UnderworldLayer ||
+ (player.position.X > 7680f && player.position.X < (Main.maxTilesX * 16 - 7680));
+ }
+
+ // Enrage
+ if (notOcean && !player.Calamity().ZoneSulphur && !bossRush)
+ {
+ if (NPC.localAI[2] > 0f)
+ NPC.localAI[2] -= 1f;
+ }
+ else
+ NPC.localAI[2] = CalamityGlobalNPC.biomeEnrageTimerMax;
+
+ bool biomeEnraged = NPC.localAI[2] <= 0f || bossRush;
+
+ float enrageScale = bossRush ? 1f : 0f;
+ if (biomeEnraged)
+ {
+ NPC.Calamity().CurrentlyEnraged = !bossRush;
+ enrageScale += 2f;
+ }
+
+ // Circular movement
+ float colorFadeTimeAfterSpiral = 90f;
+ float spiralGateValue = 480f;
+ bool doSpiral = false;
+ if (calamityGlobalNPC.newAI[0] == 1f && calamityGlobalNPC.newAI[2] == 1f && (revenge || getFuckedAI))
+ {
+ doSpiral = calamityGlobalNPC.newAI[1] == 0f && calamityGlobalNPC.newAI[3] >= spiralGateValue;
+ if (Vector2.Distance(NPC.Center, player.Center) < (getFuckedAI ? 1600f : 1000f) || doSpiral)
+ calamityGlobalNPC.newAI[3] += 1f;
+
+ if (doSpiral)
+ {
+ NPC.localAI[3] = colorFadeTimeAfterSpiral;
+
+ // Vomit acid mist
+ float acidMistBarfDivisor = getFuckedAI ? 2f : ((float)Math.Floor(bossRush ? 4f : death ? 5f : 6f) * (phase3 ? 1.5f : 1f));
+ if (calamityGlobalNPC.newAI[3] % acidMistBarfDivisor == 0f)
+ {
+ if (Main.netMode != NetmodeID.MultiplayerClient)
+ {
+ float mistVelocity = death ? 10f : 8f;
+ Vector2 projectileVelocity = (NPC.Center + NPC.velocity * 10f - NPC.Center).SafeNormalize(Vector2.UnitY);
+ int type = ModContent.ProjectileType();
+ int damage = NPC.GetProjectileDamage(type);
+ int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + projectileVelocity * 5f, projectileVelocity * mistVelocity, type, damage, 0f, Main.myPlayer);
+ Main.projectile[proj].tileCollide = false;
+ Main.projectile[proj].timeLeft = getFuckedAI ? 240 : 600;
+ }
+ }
+
+ // Vomit circular spreads of acid clouds while in phase 3
+ float toxicCloudBarfDivisor = bossRush ? 20f : death ? 30f : 40f;
+ if (calamityGlobalNPC.newAI[3] % toxicCloudBarfDivisor == 0f && phase3)
+ {
+ if (Main.netMode != NetmodeID.MultiplayerClient)
+ {
+ int type = ModContent.ProjectileType();
+ int damage = NPC.GetProjectileDamage(type);
+ int totalProjectiles = (phase4 ? 6 : 9) + (getFuckedAI ? Main.rand.Next(-2, 3) : (int)((calamityGlobalNPC.newAI[3] - spiralGateValue) / toxicCloudBarfDivisor) * (phase4 ? 2 : 3));
+ float radians = MathHelper.TwoPi / totalProjectiles;
+ float cloudVelocity = 1f + enrageScale;
+ Vector2 spinningPoint = new Vector2(0f, -cloudVelocity);
+ for (int k = 0; k < totalProjectiles; k++)
+ {
+ Vector2 vector255 = spinningPoint.RotatedBy(radians * k);
+ Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + vector255.SafeNormalize(Vector2.UnitY) * 5f, vector255, type, damage, 0f, Main.myPlayer);
+ }
+ }
+ }
+
+ // Velocity boost
+ if (calamityGlobalNPC.newAI[3] == spiralGateValue)
+ {
+ NPC.velocity = NPC.velocity.SafeNormalize(Vector2.UnitY);
+ NPC.velocity *= 24f;
+ }
+
+ // Spin velocity
+ float velocity = (float)(MathHelper.Pi * 2D) / 120f;
+ // In GFB, contracts the radius as the fight progresses
+ if (getFuckedAI)
+ velocity *= phase3 ? 1.5f : phase2 ? 1.25f : 1f;
+ NPC.velocity = NPC.velocity.RotatedBy(-(double)velocity * NPC.localAI[1]);
+ // Speed up even more in GFB for more radius
+ if (getFuckedAI && NPC.velocity.Length() <= 32f)
+ NPC.velocity *= 1.1f;
+ NPC.rotation = (float)Math.Atan2(NPC.velocity.Y, NPC.velocity.X) + MathHelper.PiOver2;
+
+ // Reset and charge at target
+ // Don't reset in GFB
+ if (!getFuckedAI && calamityGlobalNPC.newAI[3] >= spiralGateValue + 120f)
+ {
+ calamityGlobalNPC.newAI[3] = 0f;
+ NPC.TargetClosest();
+ }
+ }
+ else
+ {
+ if (!Collision.CanHit(NPC.Center, 1, 1, player.position, player.width, player.height) && calamityGlobalNPC.newAI[3] > 300f)
+ calamityGlobalNPC.newAI[3] -= 2f;
+
+ if (NPC.localAI[3] > 0f)
+ NPC.localAI[3] -= 1f;
+
+ NPC.localAI[1] = NPC.Center.X - player.Center.X < 0 ? 1f : -1f;
+ }
+ }
+
+ // Adjust slowing debuff immunity
+ bool immuneToSlowingDebuffs = doSpiral || getFuckedAI;
+ NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs;
+ NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs;
+ NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs;
+ NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs;
+ NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs;
+ NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs;
+ NPC.buffImmune[BuffID.Slow] = immuneToSlowingDebuffs;
+ NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs;
+
+ // Spawn segments
+ if (calamityGlobalNPC.newAI[2] == 0f && NPC.ai[0] == 0f)
+ {
+ if (Main.netMode != NetmodeID.MultiplayerClient)
+ {
+ int maxLength = getFuckedAI ? 24 : death ? 80 : revenge ? 40 : expertMode ? 35 : 30;
+ int Previous = NPC.whoAmI;
+ for (int segments = 0; segments < maxLength; segments++)
+ {
+ int lol;
+ if (segments >= 0 && segments < maxLength - 1)
+ {
+ if (segments % 2 == 0)
+ lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType(), NPC.whoAmI);
+ else
+ lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType(), NPC.whoAmI);
+ }
+ else
+ lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType(), NPC.whoAmI);
+
+ Main.npc[lol].realLife = NPC.whoAmI;
+ Main.npc[lol].ai[2] = NPC.whoAmI;
+ Main.npc[lol].ai[1] = Previous;
+ Main.npc[Previous].ai[0] = lol;
+ NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, lol);
+ Previous = lol;
+ }
+ }
+
+ calamityGlobalNPC.newAI[2] = 1f;
+ }
+
+ // Big barf attack
+ if (calamityGlobalNPC.newAI[0] == 1f && (!doSpiral && phase2) || (getFuckedAI && !phase3))
+ {
+ NPC.localAI[0] += 1f;
+ if (NPC.localAI[0] >= (revenge ? 360f : 420f))
+ {
+ if (Vector2.Distance(player.Center, NPC.Center) > 320f)
+ {
+ NPC.localAI[0] = 0f;
+ NPC.netUpdate = true;
+ SoundEngine.PlaySound(SoundID.NPCDeath13, NPC.Center);
+
+ if (Main.netMode != NetmodeID.MultiplayerClient)
+ {
+ int totalProjectiles = bossRush ? 10 : expertMode ? 8 : 6;
+ if (phase3)
+ totalProjectiles *= 2;
+
+ int type = ModContent.ProjectileType();
+ int damage = NPC.GetProjectileDamage(type);
+ for (int i = 0; i < totalProjectiles; i++)
+ {
+ Vector2 velocity = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101));
+ velocity = velocity.SafeNormalize(Vector2.UnitY);
+ velocity *= Main.rand.Next(phase3 ? 300 : 100, 401) * 0.01f;
+
+ float maximumVelocityMult = death ? 0.75f : 0.5f;
+ if (expertMode)
+ velocity *= 1f + (maximumVelocityMult * (0.5f - lifeRatio));
+
+ Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + velocity.SafeNormalize(Vector2.UnitY) * 5f, velocity, type, damage, 0f, Main.myPlayer);
+ }
+ }
+ }
+ }
+ }
+
+ if (NPC.life > Main.npc[(int)NPC.ai[0]].life)
+ NPC.life = Main.npc[(int)NPC.ai[0]].life;
+
+ float maxDistance = calamityGlobalNPC.newAI[0] == 1f ? 12800f : 6400f;
+ if (player.dead || Vector2.Distance(NPC.Center, player.Center) > maxDistance || (nonHostile && biomeEnraged))
+ {
+ calamityGlobalNPC.newAI[1] = 1f;
+ NPC.TargetClosest(false);
+ NPC.velocity.Y += 2f;
+
+ if (NPC.position.Y > Main.worldSurface * 16D)
+ NPC.velocity.Y += 2f;
+
+ if (NPC.position.Y > Main.worldSurface * 16D)
+ {
+ for (int a = 0; a < Main.npc.Length; a++)
+ {
+ int type = Main.npc[a].type;
+ if (AquaticScourgeIDList.Includes(type))
+ Main.npc[a].active = false;
+ }
+ }
+ }
+ else
+ calamityGlobalNPC.newAI[1] = 0f;
+
+ // Change direction
+ if (NPC.velocity.X < 0f)
+ NPC.spriteDirection = -1;
+ else if (NPC.velocity.X > 0f)
+ NPC.spriteDirection = 1;
+
+ // Alpha changes
+ NPC.alpha -= 42;
+ if (NPC.alpha < 0)
+ NPC.alpha = 0;
+
+ Vector2 scourgePosition = NPC.Center;
+ Vector2 predictionVector = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? Main.player[NPC.target].velocity * 20f : Vector2.Zero;
+ float scourgeTargetX = player.Center.X + predictionVector.X;
+ float scourgeTargetY = player.Center.Y + predictionVector.Y;
+
+ // Velocity and movement
+ float scourgeMaxSpeed = 5f;
+ float scourgeAcceleration = 0.08f;
+ if (calamityGlobalNPC.newAI[0] == 1f)
+ {
+ scourgeMaxSpeed = revenge ? 14.4f : 12f;
+ scourgeAcceleration = revenge ? 0.18f : 0.15f;
+ if (expertMode)
+ {
+ scourgeMaxSpeed += 2.4f * (1f - lifeRatio);
+ scourgeAcceleration += 0.03f * (1f - lifeRatio);
+ }
+ scourgeMaxSpeed += 3f * enrageScale;
+ scourgeAcceleration += 0.06f * enrageScale;
+ if (death || getFuckedAI)
+ {
+ scourgeMaxSpeed += 5f;
+ scourgeAcceleration -= getFuckedAI ? 0f : 0.03f;
+ scourgeMaxSpeed += Vector2.Distance(player.Center, NPC.Center) * 0.001f;
+ scourgeAcceleration += Vector2.Distance(player.Center, NPC.Center) * 0.000045f;
+ }
+
+ // Increase acceleration after spiral attack
+ if (NPC.localAI[3] > 0f)
+ {
+ float accelerationMultiplier = MathHelper.Lerp(1f, 2f, NPC.localAI[3] / colorFadeTimeAfterSpiral);
+ scourgeAcceleration *= accelerationMultiplier;
+ }
+
+ if (CalamityWorld.LegendaryMode)
+ {
+ scourgeMaxSpeed *= 1.15f;
+ scourgeAcceleration *= 1.15f;
+ }
+ }
+
+ if (!doSpiral)
+ {
+ if (calamityGlobalNPC.newAI[0] != 1f)
+ {
+ scourgeTargetY += 400;
+ if (Math.Abs(NPC.Center.X - player.Center.X) < 500f)
+ {
+ if (NPC.velocity.X > 0f)
+ scourgeTargetX = player.Center.X + 600f;
+ else
+ scourgeTargetX = player.Center.X - 600f;
+ }
+ }
+
+ float scourgeHigherSpeed = scourgeMaxSpeed * 1.3f;
+ float scourgeLowerSpeed = scourgeMaxSpeed * 0.7f;
+ float scourgeSpeed = NPC.velocity.Length();
+ if (scourgeSpeed > 0f)
+ {
+ if (scourgeSpeed > scourgeHigherSpeed)
+ {
+ NPC.velocity = NPC.velocity.SafeNormalize(Vector2.UnitY);
+ NPC.velocity *= scourgeHigherSpeed;
+ }
+ else if (scourgeSpeed < scourgeLowerSpeed)
+ {
+ NPC.velocity = NPC.velocity.SafeNormalize(Vector2.UnitY);
+ NPC.velocity *= scourgeLowerSpeed;
+ }
+ }
+ }
+
+ scourgeTargetX = (int)(scourgeTargetX / 16f) * 16;
+ scourgeTargetY = (int)(scourgeTargetY / 16f) * 16;
+ scourgePosition.X = (int)(scourgePosition.X / 16f) * 16;
+ scourgePosition.Y = (int)(scourgePosition.Y / 16f) * 16;
+ scourgeTargetX -= scourgePosition.X;
+ scourgeTargetY -= scourgePosition.Y;
+ float scourgeTargetDist = (float)Math.Sqrt(scourgeTargetX * scourgeTargetX + scourgeTargetY * scourgeTargetY);
+
+ if (!doSpiral)
+ {
+ float scourgeAbsoluteTargetX = Math.Abs(scourgeTargetX);
+ float scourgeAbsoluteTargetY = Math.Abs(scourgeTargetY);
+ float scourgeTimeToReachTarget = scourgeMaxSpeed / scourgeTargetDist;
+ scourgeTargetX *= scourgeTimeToReachTarget;
+ scourgeTargetY *= scourgeTimeToReachTarget;
+
+ if ((NPC.velocity.X > 0f && scourgeTargetX > 0f) || (NPC.velocity.X < 0f && scourgeTargetX < 0f) || (NPC.velocity.Y > 0f && scourgeTargetY > 0f) || (NPC.velocity.Y < 0f && scourgeTargetY < 0f))
+ {
+ if (NPC.velocity.X < scourgeTargetX)
+ {
+ NPC.velocity.X += scourgeAcceleration;
+ }
+ else
+ {
+ if (NPC.velocity.X > scourgeTargetX)
+ NPC.velocity.X -= scourgeAcceleration;
+ }
+
+ if (NPC.velocity.Y < scourgeTargetY)
+ {
+ NPC.velocity.Y += scourgeAcceleration;
+ }
+ else
+ {
+ if (NPC.velocity.Y > scourgeTargetY)
+ NPC.velocity.Y -= scourgeAcceleration;
+ }
+
+ if (Math.Abs(scourgeTargetY) < scourgeMaxSpeed * 0.2 && ((NPC.velocity.X > 0f && scourgeTargetX < 0f) || (NPC.velocity.X < 0f && scourgeTargetX > 0f)))
+ {
+ if (NPC.velocity.Y > 0f)
+ NPC.velocity.Y += scourgeAcceleration * 2f;
+ else
+ NPC.velocity.Y -= scourgeAcceleration * 2f;
+ }
+
+ if (Math.Abs(scourgeTargetX) < scourgeMaxSpeed * 0.2 && ((NPC.velocity.Y > 0f && scourgeTargetY < 0f) || (NPC.velocity.Y < 0f && scourgeTargetY > 0f)))
+ {
+ if (NPC.velocity.X > 0f)
+ NPC.velocity.X += scourgeAcceleration * 2f;
+ else
+ NPC.velocity.X -= scourgeAcceleration * 2f;
+ }
+ }
+ else
+ {
+ if (scourgeAbsoluteTargetX > scourgeAbsoluteTargetY)
+ {
+ if (NPC.velocity.X < scourgeTargetX)
+ NPC.velocity.X += scourgeAcceleration * 1.1f;
+ else if (NPC.velocity.X > scourgeTargetX)
+ NPC.velocity.X -= scourgeAcceleration * 1.1f;
+
+ if ((Math.Abs(NPC.velocity.X) + Math.Abs(NPC.velocity.Y)) < scourgeMaxSpeed * 0.5)
+ {
+ if (NPC.velocity.Y > 0f)
+ NPC.velocity.Y += scourgeAcceleration;
+ else
+ NPC.velocity.Y -= scourgeAcceleration;
+ }
+ }
+ else
+ {
+ if (NPC.velocity.Y < scourgeTargetY)
+ NPC.velocity.Y += scourgeAcceleration * 1.1f;
+ else if (NPC.velocity.Y > scourgeTargetY)
+ NPC.velocity.Y -= scourgeAcceleration * 1.1f;
+
+ if ((Math.Abs(NPC.velocity.X) + Math.Abs(NPC.velocity.Y)) < scourgeMaxSpeed * 0.5)
+ {
+ if (NPC.velocity.X > 0f)
+ NPC.velocity.X += scourgeAcceleration;
+ else
+ NPC.velocity.X -= scourgeAcceleration;
+ }
+ }
+ }
+
+ NPC.rotation = (float)Math.Atan2(NPC.velocity.Y, NPC.velocity.X) + MathHelper.PiOver2;
+ }
+
+ // Calculate contact damage based on velocity
+ if (!nonHostile)
+ {
+ float minimalContactDamageVelocity = scourgeMaxSpeed * 0.25f;
+ float minimalDamageVelocity = scourgeMaxSpeed * 0.5f;
+ if (NPC.velocity.Length() <= minimalContactDamageVelocity)
+ NPC.damage = (int)Math.Round(NPC.defDamage * 0.5);
+ else
+ {
+ float velocityDamageScalar = MathHelper.Clamp((NPC.velocity.Length() - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f);
+ NPC.damage = (int)MathHelper.Lerp((float)Math.Round(NPC.defDamage * 0.5), NPC.defDamage, velocityDamageScalar);
+ }
+ }
}
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
@@ -205,7 +665,7 @@ namespace CalamityMod.NPCs.AquaticScourge
if (spawnInfo.Player.Calamity().ZoneSulphur && spawnInfo.Water)
{
if (!NPC.AnyNPCs(ModContent.NPCType()))
- return (Main.getGoodWorld ? 0.05f : 0.01f);
+ return (CalamityWorld.LegendaryMode ? 0.05f : 0.01f);
}
return 0f;
diff --git a/NPCs/AquaticScourge/AquaticScourgeTail.cs b/NPCs/AquaticScourge/AquaticScourgeTail.cs
index 989e090678..2b49366863 100644
--- a/NPCs/AquaticScourge/AquaticScourgeTail.cs
+++ b/NPCs/AquaticScourge/AquaticScourgeTail.cs
@@ -1,7 +1,9 @@
-using System.IO;
+using System;
+using System.IO;
+using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.Events;
-using CalamityMod.NPCs.CalamityAIs.CalamityBossAIs;
+using CalamityMod.Systems.Collections;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
@@ -35,7 +37,7 @@ namespace CalamityMod.NPCs.AquaticScourge
NPC.knockBackResist = 0f;
NPC.alpha = 255;
NPC.LifeMaxNERB(80000, 96000, 1000000);
- if (CalamityWorld.LegendaryMode && CalamityWorld.revenge)
+ if (CalamityWorld.LegendaryMode)
NPC.lifeMax *= 2;
NPC.behindTiles = true;
NPC.noGravity = true;
@@ -55,7 +57,7 @@ namespace CalamityMod.NPCs.AquaticScourge
else if (Main.expertMode)
NPC.scale *= 1.1f;
- if (Main.getGoodWorld)
+ if (CalamityWorld.LegendaryMode)
NPC.scale *= 1.25f;
NPC.Calamity().VulnerableToHeat = false;
@@ -88,7 +90,218 @@ namespace CalamityMod.NPCs.AquaticScourge
public override void AI()
{
- AquaticScourgeAI.VanillaAquaticScourgeAI(NPC, Mod, false);
+ CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity();
+ bool bossRush = BossRushEvent.BossRushActive;
+ bool expertMode = Main.expertMode || bossRush;
+ bool revenge = CalamityWorld.revenge || bossRush;
+ bool death = CalamityWorld.death || bossRush;
+
+ bool getFuckedAI = Main.zenithWorld;
+
+ // Adjust hostility and stats
+ bool nonHostile = calamityGlobalNPC.newAI[0] == 0f;
+ if (NPC.justHit || NPC.life <= NPC.lifeMax * 0.999 || bossRush || CalamityWorld.LegendaryMode)
+ {
+ if (nonHostile)
+ {
+ // Kiss my motherfucking ass you piece of shit game
+ NPC.timeLeft *= 20;
+ NPC.npcSlots = 16f;
+ CalamityGlobalNPC.BossKillTimes.TryGetValue(NPC.type, out int revKillTime);
+ calamityGlobalNPC.KillTime = revKillTime;
+ calamityGlobalNPC.newAI[0] = 1f;
+ nonHostile = false;
+ NPC.chaseable = true;
+ NPC.netUpdate = true;
+ }
+ }
+ else
+ NPC.damage = 0;
+
+ // Percent life remaining
+ float lifeRatio = NPC.life / (float)NPC.lifeMax;
+
+ // Phases
+ bool phase2 = lifeRatio < 0.75f;
+ bool phase3 = lifeRatio < 0.5f;
+ bool phase4 = lifeRatio < 0.25f;
+
+ // Set worm variable
+ if (NPC.ai[2] > 0f)
+ NPC.realLife = (int)NPC.ai[2];
+ if (NPC.life > Main.npc[(int)NPC.ai[1]].life)
+ NPC.life = Main.npc[(int)NPC.ai[1]].life;
+
+ // Get a target
+ if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active)
+ NPC.TargetClosest();
+
+ Player player = Main.player[NPC.target];
+
+ bool notOcean = player.position.Y < 300f ||
+ player.position.Y > Main.worldSurface * 16.0 ||
+ (player.position.X > 7680f && player.position.X < (Main.maxTilesX * 16 - 7680));
+
+ // Check for the flipped Abyss
+ if (Main.remixWorld)
+ {
+ notOcean = player.position.Y < Main.UnderworldLayer * 0.8f || player.position.Y > Main.UnderworldLayer ||
+ (player.position.X > 7680f && player.position.X < (Main.maxTilesX * 16 - 7680));
+ }
+
+ bool biomeEnraged = NPC.localAI[2] <= 0f || bossRush;
+ float enrageScale = bossRush ? 1f : 0f;
+ if (biomeEnraged)
+ {
+ NPC.Calamity().CurrentlyEnraged = !bossRush;
+ enrageScale += 2f;
+ }
+
+ // Adjust slowing debuff immunity
+ bool immuneToSlowingDebuffs = getFuckedAI;
+ NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs;
+ NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs;
+ NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs;
+ NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs;
+ NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs;
+ NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs;
+ NPC.buffImmune[BuffID.Slow] = immuneToSlowingDebuffs;
+ NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs;
+
+ // Kill body and tail
+ bool shouldDespawn = true;
+ for (int i = 0; i < Main.maxNPCs; i++)
+ {
+ if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType())
+ {
+ shouldDespawn = false;
+ break;
+ }
+ }
+ if (!shouldDespawn)
+ {
+ if (NPC.ai[1] <= 0f)
+ shouldDespawn = true;
+ else if (Main.npc[(int)NPC.ai[1]].life <= 0)
+ shouldDespawn = true;
+ }
+ if (shouldDespawn)
+ {
+ NPC.life = 0;
+ NPC.HitEffect(0, 10.0);
+ NPC.checkDead();
+ NPC.active = false;
+ }
+
+ float maxDistance = calamityGlobalNPC.newAI[0] == 1f ? 12800f : 6400f;
+ if (player.dead || Vector2.Distance(NPC.Center, player.Center) > maxDistance || (nonHostile && biomeEnraged))
+ {
+ calamityGlobalNPC.newAI[1] = 1f;
+ NPC.TargetClosest(false);
+ NPC.velocity.Y += 2f;
+
+ if (NPC.position.Y > Main.worldSurface * 16D)
+ NPC.velocity.Y += 2f;
+
+ if (NPC.position.Y > Main.worldSurface * 16D)
+ {
+ for (int a = 0; a < Main.npc.Length; a++)
+ {
+ int type = Main.npc[a].type;
+ if (AquaticScourgeIDList.Includes(type))
+ Main.npc[a].active = false;
+ }
+ }
+ }
+ else
+ calamityGlobalNPC.newAI[1] = 0f;
+
+ // Change direction
+ if (NPC.velocity.X < 0f)
+ NPC.spriteDirection = -1;
+ else if (NPC.velocity.X > 0f)
+ NPC.spriteDirection = 1;
+
+ // Alpha changes
+ if (Main.npc[(int)NPC.ai[1]].alpha < 128)
+ {
+ NPC.alpha -= 42;
+ if (NPC.alpha < 0)
+ NPC.alpha = 0;
+ }
+
+ Vector2 scourgePosition = NPC.Center;
+ Vector2 predictionVector = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? Main.player[NPC.target].velocity * 20f : Vector2.Zero;
+ float scourgeTargetX = player.Center.X + predictionVector.X;
+ float scourgeTargetY = player.Center.Y + predictionVector.Y;
+
+ // Velocity and movement
+ float scourgeMaxSpeed = 5f;
+ if (calamityGlobalNPC.newAI[0] == 1f)
+ {
+ scourgeMaxSpeed = revenge ? 14.4f : 12f;
+ if (expertMode)
+ scourgeMaxSpeed += 2.4f * (1f - lifeRatio);
+ scourgeMaxSpeed += 3f * enrageScale;
+ if (death || getFuckedAI)
+ {
+ scourgeMaxSpeed += 5f;
+ scourgeMaxSpeed += Vector2.Distance(player.Center, NPC.Center) * 0.001f;
+ }
+
+ if (CalamityWorld.LegendaryMode)
+ scourgeMaxSpeed *= 1.15f;
+ }
+
+ scourgeTargetX = (int)(scourgeTargetX / 16f) * 16;
+ scourgeTargetY = (int)(scourgeTargetY / 16f) * 16;
+ scourgePosition.X = (int)(scourgePosition.X / 16f) * 16;
+ scourgePosition.Y = (int)(scourgePosition.Y / 16f) * 16;
+ scourgeTargetX -= scourgePosition.X;
+ scourgeTargetY -= scourgePosition.Y;
+
+ if (NPC.ai[1] > 0f && NPC.ai[1] < Main.npc.Length)
+ {
+ try
+ {
+ scourgePosition = NPC.Center;
+ scourgeTargetX = Main.npc[(int)NPC.ai[1]].Center.X - scourgePosition.X;
+ scourgeTargetY = Main.npc[(int)NPC.ai[1]].Center.Y - scourgePosition.Y;
+ }
+ catch
+ {
+ }
+
+ NPC.rotation = (float)Math.Atan2(scourgeTargetY, scourgeTargetX) + MathHelper.PiOver2;
+ float scourgeTargetDist = (float)Math.Sqrt(scourgeTargetX * scourgeTargetX + scourgeTargetY * scourgeTargetY);
+ int scourgeWidth = NPC.width;
+ scourgeTargetDist = (scourgeTargetDist - scourgeWidth) / scourgeTargetDist;
+ scourgeTargetX *= scourgeTargetDist;
+ scourgeTargetY *= scourgeTargetDist;
+ NPC.velocity = Vector2.Zero;
+ NPC.position.X = NPC.position.X + scourgeTargetX;
+ NPC.position.Y = NPC.position.Y + scourgeTargetY;
+
+ if (scourgeTargetX < 0f)
+ NPC.spriteDirection = -1;
+ else if (scourgeTargetX > 0f)
+ NPC.spriteDirection = 1;
+ }
+
+ // Calculate contact damage based on velocity
+ if (!nonHostile)
+ {
+ float minimalContactDamageVelocity = scourgeMaxSpeed * 0.25f;
+ float minimalDamageVelocity = scourgeMaxSpeed * 0.5f;
+ float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length();
+ if (bodyAndTailVelocity <= minimalContactDamageVelocity)
+ NPC.damage = 0;
+ else
+ {
+ float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f);
+ NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar);
+ }
+ }
}
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
diff --git a/NPCs/AstrumAureus/AstrumAureus.cs b/NPCs/AstrumAureus/AstrumAureus.cs
index ceada7f56a..1dff906636 100644
--- a/NPCs/AstrumAureus/AstrumAureus.cs
+++ b/NPCs/AstrumAureus/AstrumAureus.cs
@@ -19,12 +19,13 @@ using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Items.Weapons.Ranged;
using CalamityMod.Items.Weapons.Rogue;
using CalamityMod.Items.Weapons.Summon;
-using CalamityMod.NPCs.CalamityAIs.CalamityBossAIs;
-using CalamityMod.NPCs.TownNPCs;
+using CalamityMod.NPCs.VanillaNPCAIOverrides.RegularEnemies;
+using CalamityMod.Projectiles.Boss;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
+using System;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent;
@@ -109,7 +110,7 @@ namespace CalamityMod.NPCs.AstrumAureus
NPC.Calamity().VulnerableToSickness = false;
SpawnModBiomes = new int[1] { ModContent.GetInstance().Type };
- if (Main.getGoodWorld)
+ if (CalamityWorld.LegendaryMode)
NPC.scale *= 0.8f;
if (Main.zenithWorld)
NPC.scale *= 1.5f;
@@ -153,7 +154,934 @@ namespace CalamityMod.NPCs.AstrumAureus
public override void AI()
{
- AstrumAureusAI.VanillaAstrumAureusAI(NPC, Mod);
+ CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity();
+ CalamityGlobalNPC.astrumAureus = NPC.whoAmI;
+
+ // Variables
+ bool bossRush = BossRushEvent.BossRushActive;
+ bool expertMode = Main.expertMode || bossRush;
+ bool revenge = CalamityWorld.revenge || bossRush;
+ bool death = CalamityWorld.death || bossRush;
+
+ // Percent life remaining
+ float lifeRatio = NPC.life / (float)NPC.lifeMax;
+
+ // Phases
+ bool phase2 = lifeRatio < (revenge ? 0.85f : expertMode ? 0.8f : 0.75f);
+ bool phase3 = lifeRatio < (revenge ? 0.7f : expertMode ? 0.6f : 0.5f);
+ bool phase4 = lifeRatio < (revenge ? 0.5f : 0.4f) && expertMode;
+ bool phase5 = lifeRatio < 0.3f && revenge;
+
+ // Exhaustion
+ bool exhausted = NPC.ai[2] >= (phase3 ? 2f : 1f);
+ calamityGlobalNPC.DR = exhausted ? 0.2f : 0.4f;
+ NPC.defense = exhausted ? NPC.defDefense / 2 : NPC.defDefense;
+
+ // Get a target
+ if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active)
+ NPC.TargetClosest();
+
+ // Despawn safety, make sure to target another player if the current player target is too far away
+ if (Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles)
+ NPC.TargetClosest();
+
+ Player player = Main.player[NPC.target];
+
+ // Don't fire projectiles and don't increment phase timers for 4 seconds after the teleport phase to avoid cheap bullshit
+ float noProjectileOrPhaseIncrementTime = 240f;
+
+ bool dontAttack = NPC.localAI[3] > 0f;
+ if (dontAttack)
+ {
+ NPC.localAI[3] -= 1f;
+ if (NPC.Distance(player.Center) < 240f)
+ NPC.localAI[3] -= death ? 4f : expertMode ? 2f : 1f;
+ }
+
+ float enrageScale = bossRush ? 1f : 0f;
+ if ((Main.IsItDay() && !player.Calamity().ZoneAstral) || bossRush)
+ {
+ NPC.Calamity().CurrentlyEnraged = !bossRush;
+ enrageScale += 1f;
+ }
+
+ float astralFlameBarrageTimerIncrement = 1f;
+ if (expertMode)
+ astralFlameBarrageTimerIncrement += death ? (float)Math.Round(3f * (1f - lifeRatio)) : (float)Math.Round(2f * (1f - lifeRatio));
+
+ float walkingVelocity = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 6f : 5f;
+ walkingVelocity += 3f * enrageScale;
+ if (phase5)
+ walkingVelocity += 2f;
+ if (expertMode)
+ walkingVelocity += 1.5f * (1f - lifeRatio);
+ if (revenge)
+ walkingVelocity += Math.Abs(NPC.Center.X - player.Center.X) * 0.0025f;
+ if (CalamityWorld.LegendaryMode)
+ walkingVelocity *= 1.15f;
+
+ float walkingProjectileVelocity = walkingVelocity * 0.8f;
+
+ // Direction
+ NPC.spriteDirection = (NPC.direction > 0) ? 1 : -1;
+
+ // Used to reduce Aureus' fall speed
+ bool reduceFallSpeed = NPC.velocity.Y > 0f && Collision.SolidCollision(NPC.position + Vector2.UnitY * 1.1f * NPC.velocity.Y, NPC.width, NPC.height) && NPC.ai[0] == 4f;
+
+ // Despawn
+ bool despawnDistance = Vector2.Distance(player.Center, NPC.Center) > CalamityGlobalNPC.CatchUpDistance350Tiles;
+ if (!player.active || player.dead || despawnDistance)
+ {
+ NPC.TargetClosest(false);
+ player = Main.player[NPC.target];
+ if (!player.active || player.dead || despawnDistance)
+ {
+ NPC.noTileCollide = true;
+
+ if (NPC.velocity.Y < -3f)
+ NPC.velocity.Y = -3f;
+ NPC.velocity.Y += 0.1f;
+ if (NPC.velocity.Y > 12f)
+ NPC.velocity.Y = 12f;
+
+ if (NPC.timeLeft > 60)
+ NPC.timeLeft = 60;
+
+ if (NPC.ai[0] != 0f)
+ {
+ NPC.ai[0] = 0f;
+ NPC.ai[1] = 0f;
+ NPC.ai[2] = 0f;
+ NPC.ai[3] = 0f;
+ NPC.localAI[2] = 0f;
+ NPC.localAI[3] = 0f;
+ calamityGlobalNPC.newAI[0] = 0f;
+ calamityGlobalNPC.newAI[1] = 0f;
+ NPC.netUpdate = true;
+ }
+ return;
+ }
+ }
+ else if (NPC.timeLeft < 1800)
+ NPC.timeLeft = 1800;
+
+ bool geldonPhase1 = lifeRatio > 0.6f && lifeRatio <= 0.7f;
+ bool geldonPhase2 = lifeRatio <= 0.1f;
+ if (Main.zenithWorld && (geldonPhase1 || geldonPhase2))
+ {
+ slimeProjCounter++;
+ if (slimeProjCounter % 180 == 0)
+ {
+ SoundEngine.PlaySound(SoundID.Item33, NPC.Center); // Intentionally keeping the old laser sound in GFB
+
+ if (slimePhase == 1)
+ {
+ if (Main.netMode != NetmodeID.MultiplayerClient)
+ {
+ int type = ModContent.ProjectileType();
+ int damage = NPC.GetProjectileDamage(type);
+ int totalProjectiles = bossRush ? 14 : death ? 12 : revenge ? 10 : expertMode ? 8 : 6;
+ float radians = MathHelper.TwoPi / totalProjectiles;
+ float velocity = 10f;
+ Vector2 spinningPoint = new Vector2(0f, -velocity);
+ for (int k = 0; k < totalProjectiles; k++)
+ {
+ Vector2 velocity2 = spinningPoint.RotatedBy(radians * k);
+ Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity2, type, damage, 0f, Main.myPlayer, 0f, 1f);
+ }
+ }
+ slimePhase = 0;
+ }
+ else
+ {
+ if (Main.netMode != NetmodeID.MultiplayerClient)
+ {
+ int type = ModContent.ProjectileType();
+ int damage = NPC.GetProjectileDamage(type);
+ float aureusLaserSpeed = 7f;
+ float aureusLaserTargetX = player.Center.X - NPC.Center.X;
+ float aureusLaserTargetY = player.Center.Y - NPC.Center.Y;
+ float aureusLaserTargetDist = (float)Math.Sqrt(aureusLaserTargetX * aureusLaserTargetX + aureusLaserTargetY * aureusLaserTargetY);
+ aureusLaserTargetDist = aureusLaserSpeed / aureusLaserTargetDist;
+ aureusLaserTargetX *= aureusLaserTargetDist;
+ aureusLaserTargetY *= aureusLaserTargetDist;
+ Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X, NPC.Center.Y, aureusLaserTargetX, aureusLaserTargetY, type, damage, 0f, Main.myPlayer);
+ for (int i = 0; i < 4; i++)
+ {
+ Vector2 offset = new Vector2(Main.rand.Next(-6, 7), Main.rand.Next(-6, 7));
+ Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X, NPC.Center.Y, aureusLaserTargetX + offset.X, aureusLaserTargetY + offset.Y, type, damage, 0f, Main.myPlayer);
+ }
+ }
+ slimePhase = 1;
+ }
+ }
+ RevengeanceAndDeathAI.BuffedMimicAI(NPC, Mod);
+ NPC.noGravity = false;
+ NPC.noTileCollide = false;
+ return;
+ }
+ else
+ {
+ NPC.noGravity = true;
+ }
+
+ // Emit light when not Idle
+ if (NPC.ai[0] != 1f)
+ Lighting.AddLight((int)((NPC.position.X + (NPC.width / 2)) / 16f), (int)((NPC.position.Y + (NPC.height / 2)) / 16f), 1.3f, 0.5f, 0f);
+
+ // Fire projectiles while walking, teleporting, or falling
+ if (NPC.ai[0] == 2f || NPC.ai[0] >= 5f)
+ {
+ if (!dontAttack)
+ NPC.localAI[0] += NPC.ai[0] == 2f ? 1f : astralFlameBarrageTimerIncrement;
+
+ float astralFlameBarrageGateValue = phase4 ? 30f : 60f;
+ if (NPC.localAI[0] >= astralFlameBarrageGateValue)
+ {
+ // Fire astral flames while teleporting
+ if (NPC.ai[0] >= 5f && NPC.ai[0] != 7)
+ {
+ NPC.localAI[0] = 0f;
+ SoundEngine.PlaySound(FlameCrystalSound, NPC.Center);
+
+ if (Main.netMode != NetmodeID.MultiplayerClient)
+ {
+ float velocity = death ? (8f + NPC.localAI[2] * 0.025f) : 7f;
+ int type = ModContent.ProjectileType();
+ int damage = NPC.GetProjectileDamage(type);
+ float spreadLimit = (phase4 ? 100f : 50f) + enrageScale * 50f;
+ float randomSpread = (Main.rand.NextFloat() - 0.5f) * spreadLimit;
+ Vector2 spawnVector = new Vector2(NPC.Center.X, NPC.Center.Y - 80f * NPC.scale);
+ Vector2 destination = new Vector2(spawnVector.X + randomSpread, spawnVector.Y - 100f * NPC.scale);
+ Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnVector, Vector2.Normalize(destination - spawnVector) * velocity, type, damage, 0f, Main.myPlayer);
+ }
+ }
+ }
+
+ float laserBarrageGateValue = phase5 ? 160f : phase3 ? 120f : phase2 ? 80f : 60f;
+ if (NPC.localAI[0] >= laserBarrageGateValue)
+ {
+ // Fire astral lasers while walking
+ if (NPC.ai[0] == 2f)
+ {
+ NPC.localAI[0] = 0f;
+
+ SoundEngine.PlaySound(LaserSound, NPC.Center);
+
+ if (calamityGlobalNPC.newAI[2] == 0f)
+ {
+ calamityGlobalNPC.newAI[2] = 1f;
+
+ if (Main.netMode != NetmodeID.MultiplayerClient)
+ {
+ int maxProjectiles = !phase2 ? (bossRush ? 5 : 3) : (bossRush ? 7 : 5);
+ int spread = !phase2 ? (bossRush ? 11 : 8) : (bossRush ? 12 : 10);
+
+ int type = ModContent.ProjectileType();
+ int damage = NPC.GetProjectileDamage(type);
+ Vector2 projectileVelocity = Vector2.Normalize(player.Center - NPC.Center) * walkingProjectileVelocity;
+ float rotation = MathHelper.ToRadians(spread);
+ for (int i = 0; i < maxProjectiles; i++)
+ {
+ Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(maxProjectiles - 1)));
+ Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, perturbedSpeed, type, damage, 0f, Main.myPlayer, 0f, walkingProjectileVelocity * 2f);
+ }
+
+ if (phase3)
+ {
+ float flameVelocity = walkingProjectileVelocity;
+ maxProjectiles = 2;
+ spread = 45;
+
+ type = ModContent.ProjectileType();
+ damage = NPC.GetProjectileDamage(type);
+ projectileVelocity = Vector2.Normalize(player.Center - NPC.Center) * flameVelocity;
+ rotation = MathHelper.ToRadians(spread);
+ for (int i = 0; i < maxProjectiles; i++)
+ {
+ Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(maxProjectiles - 1)));
+ Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, perturbedSpeed, type, damage, 0f, Main.myPlayer);
+ }
+ }
+ }
+ }
+ else
+ {
+ calamityGlobalNPC.newAI[2] = 0f;
+
+ if (Main.netMode != NetmodeID.MultiplayerClient)
+ {
+ int maxProjectiles = !phase3 ? (bossRush ? 13 : death ? 11 : 9) : (bossRush ? 19 : death ? 17 : 15);
+ int spread = !phase3 ? (bossRush ? 20 : death ? 18 : 16) : (bossRush ? 24 : death ? 22 : 20);
+
+ int type = ModContent.ProjectileType();
+ int damage = NPC.GetProjectileDamage(type);
+ int centralLaser = maxProjectiles / 2;
+ int[] lasersToNotFire = new int[6] { centralLaser - 3, centralLaser - 2, centralLaser - 1, centralLaser + 1, centralLaser + 2, centralLaser + 3 };
+ Vector2 projectileVelocity = Vector2.Normalize(player.Center - NPC.Center) * walkingProjectileVelocity;
+ float rotation = MathHelper.ToRadians(spread);
+ for (int i = 0; i < maxProjectiles; i++)
+ {
+ if (i != lasersToNotFire[0] && i != lasersToNotFire[1] && i != lasersToNotFire[2] && i != lasersToNotFire[3] && i != lasersToNotFire[4] && i != lasersToNotFire[5])
+ {
+ Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(maxProjectiles - 1)));
+ Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, perturbedSpeed, type, damage, 0f, Main.myPlayer, 0f, walkingProjectileVelocity * 2f);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ else
+ NPC.localAI[0] = 0f;
+
+ // Start up
+ if (NPC.ai[0] == 0f)
+ {
+ // Avoid cheap bullshit
+ NPC.damage = 0;
+
+ NPC.ai[0] = 1f;
+ NPC.netUpdate = true;
+ CustomGravity();
+ }
+
+ // Idle
+ else if (NPC.ai[0] == 1f)
+ {
+ // Avoid cheap bullshit
+ NPC.damage = 0;
+
+ // Slow down
+ NPC.velocity.X *= 0.8f;
+
+ // Stay vulnerable for 3 seconds
+ NPC.ai[1] += 1f;
+ if (NPC.Distance(player.Center) < 240f)
+ NPC.ai[1] += death ? 4f : expertMode ? 2f : 1f;
+
+ if (NPC.ai[1] >= 180f || bossRush)
+ {
+ // Set AI to random state and reset other AI arrays
+ NPC.TargetClosest();
+ switch (Main.rand.Next(phase3 ? 3 : 2))
+ {
+ case 0:
+ NPC.ai[0] = 2f;
+ break;
+
+ case 1:
+ NPC.ai[0] = 3f;
+ break;
+
+ case 2:
+ NPC.ai[0] = 5f;
+ break;
+
+ default:
+ break;
+ }
+ NPC.ai[1] = 0f;
+ NPC.ai[2] = 0f;
+
+ // Stop colliding with tiles if entering walking phase
+ NPC.noTileCollide = NPC.ai[0] == 2f;
+
+ NPC.netUpdate = true;
+ }
+ else
+ CustomGravity();
+ }
+
+ // Walk
+ else if (NPC.ai[0] == 2f)
+ {
+ // Avoid cheap bullshit
+ NPC.damage = 0;
+
+ // Set walking direction
+ if (Math.Abs(NPC.Center.X - player.Center.X) < 200f * NPC.scale)
+ {
+ NPC.velocity.X *= 0.8f;
+ if (NPC.velocity.X > -0.1 && NPC.velocity.X < 0.1)
+ NPC.velocity.X = 0f;
+ }
+ else
+ {
+ float playerLocation = NPC.Center.X - player.Center.X;
+ NPC.direction = playerLocation < 0 ? 1 : -1;
+
+ if (NPC.direction > 0)
+ NPC.velocity.X = (NPC.velocity.X * 20f + walkingVelocity) / 21f;
+ if (NPC.direction < 0)
+ NPC.velocity.X = (NPC.velocity.X * 20f - walkingVelocity) / 21f;
+ }
+
+ if (Collision.CanHit(NPC.position, NPC.width, NPC.height, player.Center, 1, 1) && !Collision.SolidCollision(NPC.position, NPC.width, NPC.height) && player.position.Y <= NPC.position.Y + NPC.height && !NPC.collideX)
+ {
+ CustomGravity();
+ NPC.noTileCollide = false;
+ }
+ else
+ {
+ NPC.noTileCollide = true;
+
+ // Walk through tiles if colliding with tiles and player is out of reach
+ int aureusHitboxWidth = 80;
+ int aureusHitboxHeight = 20;
+ Vector2 aureusHitboxTileCollideSize = new Vector2(NPC.Center.X - (aureusHitboxWidth / 2), NPC.position.Y + NPC.height - aureusHitboxHeight);
+
+ bool nearPlayerWalkingThroughTiles = false;
+ if (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)
+ nearPlayerWalkingThroughTiles = true;
+
+ if (nearPlayerWalkingThroughTiles)
+ {
+ NPC.velocity.Y += 0.5f;
+ }
+ else if (Collision.SolidCollision(aureusHitboxTileCollideSize, aureusHitboxWidth, aureusHitboxHeight))
+ {
+ if (NPC.velocity.Y > 0f)
+ NPC.velocity.Y = 0f;
+
+ if (NPC.velocity.Y > -0.2)
+ NPC.velocity.Y -= 0.025f;
+ else
+ NPC.velocity.Y -= 0.2f;
+
+ if (NPC.velocity.Y < -4f)
+ NPC.velocity.Y = -4f;
+ }
+ else
+ {
+ if (NPC.velocity.Y < 0f)
+ NPC.velocity.Y = 0f;
+
+ if (NPC.velocity.Y < 0.1)
+ NPC.velocity.Y += 0.025f;
+ else
+ NPC.velocity.Y += 0.5f;
+ }
+ }
+
+ // Walk for a maximum of 6 seconds
+ if (!dontAttack)
+ {
+ NPC.ai[1] += 1f;
+ if (NPC.Distance(player.Center) < 240f)
+ NPC.ai[1] += death ? 4f : expertMode ? 2f : 1f;
+ }
+
+ if (NPC.ai[1] >= ((bossRush ? 270f : 360f) - (death ? 90f * (1f - lifeRatio) : 0f)))
+ {
+ // Collide with tiles again
+ NPC.noTileCollide = false;
+
+ // Set AI to next phase (Jump) and reset other AI
+ NPC.TargetClosest();
+ NPC.ai[0] = exhausted ? 1f : 3f;
+ NPC.ai[1] = 0f;
+ NPC.ai[2] += 1f;
+ NPC.netUpdate = true;
+ }
+
+ // Limit downward velocity
+ if (NPC.velocity.Y > 10f)
+ NPC.velocity.Y = 10f;
+ }
+
+ // Jump
+ else if (NPC.ai[0] == 3f)
+ {
+ // Avoid cheap bullshit
+ NPC.damage = 0;
+
+ NPC.noTileCollide = false;
+
+ if (NPC.velocity.Y == 0f)
+ {
+ // Slow down
+ NPC.velocity.X *= 0.8f;
+
+ // Half second delay before jumping
+ if (!dontAttack)
+ NPC.ai[1] += 1f;
+
+ if (NPC.ai[1] >= 30f)
+ {
+ NPC.ai[1] = -20f;
+ }
+ else if (NPC.ai[1] == -1f)
+ {
+ // Set damage
+ NPC.damage = NPC.defDamage;
+
+ // Set jump velocity, reset and set AI to next phase (Stomp)
+ float distanceFromPlayerOnXAxis = NPC.Center.X - player.Center.X;
+ NPC.direction = distanceFromPlayerOnXAxis < 0 ? 1 : -1;
+ calamityGlobalNPC.newAI[3] = NPC.direction;
+
+ // The limit for how much Aureus can multiply its jump velocity
+ float speedMultLimit = 1f;
+
+ // Maxes out when the player is a full 2000 pixels away from or above Aureus
+ float multiplier = 1f / 2000f;
+
+ // Increase Aureus jump velocity X if it's far enough away from the player
+ float distanceAwayFromTarget = Math.Abs(distanceFromPlayerOnXAxis);
+ float distanceGateValue = 400f;
+ bool increaseJumpVelocityX = distanceAwayFromTarget > distanceGateValue && expertMode;
+ if (increaseJumpVelocityX)
+ {
+ calamityGlobalNPC.newAI[0] = (distanceAwayFromTarget - distanceGateValue) * multiplier;
+ if (calamityGlobalNPC.newAI[0] > speedMultLimit)
+ calamityGlobalNPC.newAI[0] = speedMultLimit;
+ }
+
+ // Increase Aureus jump velocity Y if it's far enough above the player
+ float distanceBelowTarget = NPC.position.Y - (player.position.Y + 80f);
+ bool increaseJumpVelocityY = distanceBelowTarget > 0f && revenge;
+ if (increaseJumpVelocityY)
+ {
+ calamityGlobalNPC.newAI[1] = distanceBelowTarget * multiplier;
+ if (calamityGlobalNPC.newAI[1] > speedMultLimit)
+ calamityGlobalNPC.newAI[1] = speedMultLimit;
+ }
+
+ float velocity = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 27f : 20f;
+ velocity += 6f * enrageScale;
+ if (expertMode)
+ velocity += death ? 6f * (1f - lifeRatio) : 4f * (1f - lifeRatio);
+ if (CalamityWorld.LegendaryMode)
+ velocity *= 1.15f;
+
+ NPC.velocity = (new Vector2(player.Center.X, player.Center.Y - 500f) - NPC.Center).SafeNormalize(Vector2.Zero) * velocity;
+ NPC.velocity *= new Vector2(calamityGlobalNPC.newAI[0] + 1f, calamityGlobalNPC.newAI[1] + 1f);
+
+ NPC.noTileCollide = true;
+
+ NPC.ai[0] = 4f;
+ NPC.ai[1] = 0f;
+
+ SoundEngine.PlaySound(JumpSound, NPC.Center);
+
+ NPC.netUpdate = true;
+ }
+ }
+
+ // Don't run custom gravity when starting a jump
+ if (NPC.ai[0] != 4f)
+ CustomGravity();
+ }
+
+ // Stomp
+ else if (NPC.ai[0] == 4f)
+ {
+ if (NPC.velocity.Y == 0f)
+ {
+ // Avoid cheap bullshit
+ NPC.damage = 0;
+
+ // Play stomp sound. Gotta specify the filepath to avoid confusion between the namespace and NPC
+ SoundStyle soundToPlay = Main.zenithWorld ? ExoMechs.Ares.AresGaussNuke.NukeExplosionSound : StompSound;
+ SoundEngine.PlaySound(soundToPlay, NPC.Center);
+
+ if (Main.zenithWorld)
+ {
+ float screenShakePower = 16 * Utils.GetLerpValue(1300f, 0f, NPC.Distance(Main.LocalPlayer.Center), true);
+ if (Main.LocalPlayer.Calamity().GeneralScreenShakePower < screenShakePower)
+ Main.LocalPlayer.Calamity().GeneralScreenShakePower = screenShakePower;
+ }
+
+ // Stomp and jump again, if stomped twice then reset and set AI to next phase (Teleport or Idle)
+ NPC.TargetClosest();
+ NPC.localAI[1] += 1f;
+ float maxStompAmt = phase5 ? 5f : phase3 ? 2f : 3f;
+ if (NPC.localAI[1] >= maxStompAmt)
+ {
+ NPC.ai[0] = exhausted ? 1f : (phase3 ? 5f : 2f);
+ NPC.localAI[1] = 0f;
+ NPC.ai[2] += 1f;
+ NPC.ai[3] = 0f;
+ NPC.noTileCollide = false;
+ NPC.netUpdate = true;
+ }
+ else
+ {
+ float playerLocation = NPC.Center.X - player.Center.X;
+ NPC.direction = playerLocation < 0 ? 1 : -1;
+ NPC.ai[0] = 3f;
+ NPC.ai[3] = 0f;
+ NPC.netUpdate = true;
+ }
+
+ calamityGlobalNPC.newAI[0] = 0f;
+ calamityGlobalNPC.newAI[1] = 0f;
+ calamityGlobalNPC.newAI[3] = 0f;
+
+ // Spawn dust for visual effect
+ for (int i = (int)NPC.position.X - 20; i < (int)NPC.position.X + NPC.width + 40; i += 20)
+ {
+ for (int j = 0; j < 4; j++)
+ {
+ int stompDust = Dust.NewDust(new Vector2(NPC.position.X - 20f, NPC.position.Y + NPC.height), NPC.width + 20, 4, ModContent.DustType(), 0f, 0f, 100, default, 1.5f);
+ Main.dust[stompDust].velocity *= 0.2f;
+ }
+ }
+
+ // Fire lasers or flames on stomp
+ SoundEngine.PlaySound(LaserSound, NPC.Center);
+
+ if (Main.zenithWorld)
+ {
+ if (Main.netMode != NetmodeID.MultiplayerClient)
+ {
+ int type = Main.rand.NextBool() ? ModContent.ProjectileType() : ModContent.ProjectileType();
+ int damage = NPC.GetProjectileDamage(type);
+ int totalProjectiles = bossRush ? 14 : death ? 12 : revenge ? 10 : expertMode ? 8 : 6;
+ float radians = MathHelper.TwoPi / totalProjectiles;
+ float velocity = 10f;
+ Vector2 spinningPoint = new Vector2(0f, -velocity);
+ for (int k = 0; k < totalProjectiles; k++)
+ {
+ Vector2 velocity2 = spinningPoint.RotatedBy(radians * k);
+ Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity2, type, damage, 0f, Main.myPlayer, 0f, 1f);
+ }
+ }
+ }
+ else if (calamityGlobalNPC.newAI[2] == 0f && phase2)
+ {
+ calamityGlobalNPC.newAI[2] = 1f;
+
+ if (Main.netMode != NetmodeID.MultiplayerClient)
+ {
+ float flameVelocity = 6f;
+ int maxProjectiles = bossRush ? 4 : death ? 3 : 2;
+ int spread = bossRush ? 36 : death ? 28 : 20;
+
+ int type = ModContent.ProjectileType();
+ int damage = NPC.GetProjectileDamage(type);
+ Vector2 spawnVector = new Vector2(NPC.Center.X, NPC.Center.Y - 80f * NPC.scale);
+ Vector2 destination = new Vector2(spawnVector.X, spawnVector.Y + 100f * NPC.scale);
+ Vector2 projectileVelocity = Vector2.Normalize(destination - spawnVector) * flameVelocity;
+ float rotation = MathHelper.ToRadians(spread);
+ for (int i = 0; i < maxProjectiles; i++)
+ {
+ Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(maxProjectiles - 1)));
+ Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnVector + Vector2.Normalize(perturbedSpeed) * 100f, perturbedSpeed, type, damage, 0f, Main.myPlayer);
+ }
+ }
+ }
+ else
+ {
+ calamityGlobalNPC.newAI[2] = 0f;
+
+ if (Main.netMode != NetmodeID.MultiplayerClient)
+ {
+ float laserVelocity = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 7f : death ? 6f : 5f;
+ int maxProjectiles = !phase3 ? (bossRush ? 13 : death ? 11 : 9) : (bossRush ? 17 : death ? 15 : 13);
+ int spread = !phase3 ? (bossRush ? 20 : death ? 18 : 16) : (bossRush ? 24 : death ? 22 : 20);
+
+ int type = ModContent.ProjectileType