diff --git a/Buffs/Potions/TeslaBuff.cs b/Buffs/Potions/TeslaBuff.cs deleted file mode 100644 index e5a8fac63b..0000000000 --- a/Buffs/Potions/TeslaBuff.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Buffs.Potions -{ - public class TeslaBuff : ModBuff - { - public override void SetStaticDefaults() - { - Main.debuff[Type] = false; - Main.pvpBuff[Type] = true; - Main.buffNoSave[Type] = false; - } - - public override void Update(Player player, ref int buffIndex) - { - player.Calamity().tesla = true; - } - } -} diff --git a/Buffs/StatDebuffs/PearlAura.cs b/Buffs/StatDebuffs/PearlAura.cs index b7b27ee3df..ed0232c4b2 100644 --- a/Buffs/StatDebuffs/PearlAura.cs +++ b/Buffs/StatDebuffs/PearlAura.cs @@ -1,4 +1,6 @@ -using Terraria; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Buffs.StatDebuffs @@ -19,5 +21,16 @@ namespace CalamityMod.Buffs.StatDebuffs npc.DelBuff(buffIndex); buffIndex--; } + + internal static void DrawEffects(NPC npc, ref Color drawColor) + { + if (Main.rand.NextBool(4)) + { + int dustType = Main.rand.NextBool() ? DustID.GemSapphire : DustID.BlueCrystalShard; + Vector2 dustVelocity = Vector2.UnitX.RotatedBy(Main.rand.NextFloat(-MathHelper.Pi / 12f, 0f)) * (Main.rand.NextBool() ? -1f : 1f); + Dust theDust = Dust.NewDustDirect(npc.position, npc.width, npc.height, dustType, dustVelocity.X, dustVelocity.Y); + theDust.noGravity = true; + } + } } } diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index a804c194f1..5cfa57202d 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -179,6 +179,7 @@ namespace CalamityMod.CalPlayer #region Timer and Counter public int gaelSwipes = 0; + public int arsenalCooldown = 0; public int dragoonDrizzlefishGelBoost = 1; public int deadSunCounter = 6; public int DragonsBreathAudioCooldown = 0; @@ -507,6 +508,8 @@ namespace CalamityMod.CalPlayer public bool evasionScarf = false; public bool badgeOfBravery = false; public bool warbannerOfTheSun = false; + public bool tesla = false; + public bool teslaVisuals = true; public bool cryogenSoul = false; public bool ascendantInsignia = false; public int ascendantInsigniaBuffTime = 0; @@ -969,7 +972,6 @@ namespace CalamityMod.CalPlayer public bool astralInjection = false; public bool gravityNormalizer = false; public bool flaskHoly = false; - public bool tesla = false; public bool galvanicCorrosion = false; public bool sulphurskin = false; public bool baguette = false; @@ -1178,7 +1180,7 @@ namespace CalamityMod.CalPlayer public bool omegaBlueTransformation; public bool omegaBlueTransformationForce; public bool omegaBlueTransformationPower; - public bool redBow; + public bool ghostBracelet; #endregion #region Calamitas Enchant Effects @@ -1737,6 +1739,8 @@ namespace CalamityMod.CalPlayer evolution = false; nanotech = false; deadshotBrooch = false; + tesla = false; + teslaVisuals = true; cryogenSoul = false; ascendantInsignia = false; ascendantTrail = false; @@ -2034,7 +2038,6 @@ namespace CalamityMod.CalPlayer astralInjection = false; gravityNormalizer = false; flaskHoly = false; - tesla = false; galvanicCorrosion = false; sulphurskin = false; baguette = false; @@ -2233,7 +2236,7 @@ namespace CalamityMod.CalPlayer omegaBlueTransformationPrevious = omegaBlueTransformation; omegaBlueTransformation = omegaBlueTransformationForce = omegaBlueTransformationPower = false; - redBow = false; + ghostBracelet = false; rageModeActive = false; adrenalineModeActive = false; @@ -2336,6 +2339,7 @@ namespace CalamityMod.CalPlayer #region Debuffs heldGaelsLastFrame = false; gaelSwipes = 0; + arsenalCooldown = 0; andromedaState = AndromedaPlayerState.Inactive; planarSpeedBoost = 0; galileoCooldown = 0; @@ -2504,7 +2508,6 @@ namespace CalamityMod.CalPlayer astralInjection = false; gravityNormalizer = false; flaskHoly = false; - tesla = false; galvanicCorrosion = false; sulphurskin = false; baguette = false; @@ -3886,9 +3889,6 @@ namespace CalamityMod.CalPlayer #region Get Weapon Damage And KB public override void ModifyWeaponDamage(Item item, ref StatModifier damage) { - if (fungalSymbiote && CalamityLists.MushroomWeaponIDs.Contains(item.type)) - damage += 0.1f; - if (item.CountsAsClass()) { // Apply weapon modifier stealth strike damage bonus @@ -3976,7 +3976,7 @@ namespace CalamityMod.CalPlayer if (item.CountsAsClass()) { var source = Player.GetSource_ItemUse(item); - if (fungalSymbiote && CalamityLists.MushroomWeaponIDs.Contains(item.type) && Player.whoAmI == Main.myPlayer) + if (fungalSymbiote && Player.HasBuff(ModContent.BuffType()) && Player.whoAmI == Main.myPlayer) { if (Player.itemAnimation == (int)(Player.itemAnimationMax * 0.1) || Player.itemAnimation == (int)(Player.itemAnimationMax * 0.3) || @@ -4291,11 +4291,11 @@ namespace CalamityMod.CalPlayer profanedCrystalAnimCounter = new KeyValuePair(0, 10); } - if (redBow) + if (ghostBracelet) { - Player.legs = EquipLoader.GetEquipSlot(Mod, "RedBow", EquipType.Legs); - Player.body = EquipLoader.GetEquipSlot(Mod, "RedBow", EquipType.Body); - Player.head = EquipLoader.GetEquipSlot(Mod, "RedBow", EquipType.Head); + Player.legs = EquipLoader.GetEquipSlot(Mod, "GhostBracelet", EquipType.Legs); + Player.body = EquipLoader.GetEquipSlot(Mod, "GhostBracelet", EquipType.Body); + Player.head = EquipLoader.GetEquipSlot(Mod, "GhostBracelet", EquipType.Head); } if (snowRuffianSet) diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index 97b482764a..1f5724b055 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -41,12 +41,10 @@ using CalamityMod.Projectiles.Typeless; using CalamityMod.UI; using CalamityMod.World; using Microsoft.Xna.Framework; -using Mono.Cecil; using Terraria; using Terraria.Audio; using Terraria.Chat; using Terraria.DataStructures; -using Terraria.GameContent.Events; using Terraria.Graphics.Renderers; using Terraria.Graphics.Shaders; using Terraria.ID; @@ -498,10 +496,6 @@ namespace CalamityMod.CalPlayer { damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.ManaBurn").Format(Player.name)); } - if (alcoholPoisonLevel > (cirrusDress ? 5 : 3)) - { - damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.AlcoholSmall").Format(Player.name)); - } if (witheredDebuff) { damageSource = PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.Withered").Format(Player.name)); @@ -1041,12 +1035,6 @@ namespace CalamityMod.CalPlayer projectileDamageReduction += 0.15; } - if (transformer) - { - if (proj.type == ProjectileID.BulletSnowman || proj.type == ProjectileID.BulletDeadeye || proj.type == ProjectileID.SniperBullet) - projectileDamageReduction += 0.5; - } - if (CalamityLists.projectileDestroyExceptionList.TrueForAll(x => proj.type != x) && proj.active && !proj.friendly && proj.hostile && proj.damage > 0) { // Daedalus Reflect counts as a reflect but doesn't actually stop you from taking damage @@ -1292,20 +1280,36 @@ namespace CalamityMod.CalPlayer if (!hasIFrames && !Player.creativeGodMode) nextHitDealsDefenseDamage |= proj.Calamity().DealsDefenseDamage; - if (sulphurSet && !proj.friendly && hurtInfo.Damage > 0) + // CIT 22JUL2024: This entire code segment is bugged, so I'm disabling it. + // Very likely because it's trying to index into Main.npc using Projectile.owner. + /*if (!proj.friendly && hurtInfo.Damage > 0) { if (Main.player[proj.owner] is null) { if (!Main.npc[proj.owner].friendly) - Main.npc[proj.owner].AddBuff(BuffID.Poisoned, 60); + { + if (sulphurSet) + Main.npc[proj.owner].AddBuff(BuffID.Poisoned, 60); + if (aSpark) + { + if (transformer) + Main.npc[proj.owner].Calamity().transformerShocked = 120; + else + Main.npc[proj.owner].Calamity().shocked = 120; + } + } } else { Player p = Main.player[proj.owner]; if (p.hostile && Player.hostile && (Player.team != p.team || p.team == 0)) - p.AddBuff(BuffID.Poisoned, 60); + { + if (sulphurSet) + p.AddBuff(BuffID.Poisoned, 60); + } + } - } + }*/ // Apply The Bee cooldown, must be applied here so that it does not apply on dodges if (theBee && shouldTriggerBeeCooldown) @@ -1469,23 +1473,6 @@ namespace CalamityMod.CalPlayer // As these reflects do not cancel damage, they need to be in OnHit rather than ModifyHit if (CalamityLists.projectileDestroyExceptionList.TrueForAll(x => proj.type != x) && proj.active && !proj.friendly && proj.hostile && hurtInfo.Damage > 0) { - // The Transformer can reflect bullets - if (transformer) - { - if (proj.type == ProjectileID.BulletSnowman || proj.type == ProjectileID.BulletDeadeye || proj.type == ProjectileID.SniperBullet || proj.type == ProjectileID.VortexLaser) - { - proj.hostile = false; - proj.friendly = true; - proj.velocity *= -1f; - proj.damage = (int)Player.GetBestClassDamage().ApplyTo(proj.damage * 8); - proj.penetrate = 1; - - // 17APR2024: Ozzatron: The Transformer is a reflect which also functions as a dodge. It uses vanilla dodge iframes and benefits from Cross Necklace. - int transformerIFrames = Player.ComputeReflectIFrames(); - Player.GiveUniversalIFrames(transformerIFrames, true); - } - } - double dodgeDamageGateValuePercent = 0.05; int dodgeDamageGateValue = (int)Math.Round(Player.statLifeMax2 * dodgeDamageGateValuePercent); @@ -2527,33 +2514,23 @@ namespace CalamityMod.CalPlayer } if (aSpark) { - var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); - if (hurtInfo.Damage > 0) + SoundEngine.PlaySound(SoundID.Item93, Player.Center); + + // Only visual effects are done here + // The actual spark spawning is now handled with the shocked variable in CalamityGlobalNPC + + SeaFoamParticle boom = new(Player.Center, Vector2.Zero, new Color(89, 239, 247), new Color(56, 158, 209), 1f, 200f, Main.rand.NextBool() ? -1f : 1f); + GeneralParticleHandler.SpawnParticle(boom); + + for (int e = 0; e < 6; e++) { - SoundEngine.PlaySound(SoundID.Item93, Player.Center); - - // Start with base damage, then apply the best damage class you can - int sDamage = 6; + Vector2 dustVel = Main.rand.NextVector2CircularEdge(1f, 1f) * Main.rand.NextFloat(4.5f, 5.25f); + Dust electric = Dust.NewDustPerfect(Player.Center, DustID.Electric, dustVel, Scale: 0.75f); + electric.noGravity = true; if (transformer) - sDamage += 42; - sDamage = (int)Player.GetBestClassDamage().ApplyTo(sDamage); - sDamage = Player.ApplyArmorAccDamageBonusesTo(sDamage); - - if (Player.whoAmI == Main.myPlayer) { - float sparkCount = transformer ? 10f : 8f; - for (float i = 0f; i < sparkCount; i++) - { - Vector2 velocity = (MathHelper.TwoPi * i / sparkCount).ToRotationVector2() * 5f; - Projectile spark = Projectile.NewProjectileDirect(source, Player.Center, velocity, ModContent.ProjectileType(), sDamage, 1.25f, Player.whoAmI); - spark.timeLeft = 120; - if (transformer) - { - spark.timeLeft = 240; - spark.extraUpdates = 1; - spark.penetrate = 10; - } - } + NanoParticle nano = new(Player.Center, dustVel, new Color(0, 186, 242), 1f, 20, true, true); + GeneralParticleHandler.SpawnParticle(nano); } } } diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 60d08cc2ed..78d47cb55b 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -1414,6 +1414,8 @@ namespace CalamityMod.CalPlayer Player.buffImmune[ModContent.BuffType()] = true; } + if (arsenalCooldown > 0) + arsenalCooldown--; if (ascendantInsigniaCooldown > 0 && ascendantInsigniaBuffTime <= 0) ascendantInsigniaCooldown--; if (DragonsBreathAudioCooldown > 0) @@ -2912,7 +2914,7 @@ namespace CalamityMod.CalPlayer if (giantPearl) { - if (Main.netMode != NetmodeID.MultiplayerClient && !areThereAnyDamnBosses) + if (Main.netMode != NetmodeID.MultiplayerClient) { foreach (NPC npc in Main.ActiveNPCs) { @@ -3033,7 +3035,11 @@ namespace CalamityMod.CalPlayer } if (mushy) - Player.statDefense += 6; + { + Player.statDefense += 8; + if (fungalSymbiote) + Player.GetDamage() += 0.1f; + } if (omniscience) { @@ -3533,11 +3539,24 @@ namespace CalamityMod.CalPlayer if (check) { // https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list - var source = Player.GetSource_Buff(Player.FindBuffIndex(ModContent.BuffType())); - int damage = (int)Player.GetBestClassDamage().ApplyTo(10); + var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); + int damage = (int)Player.GetBestClassDamage().ApplyTo(12); if (Player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) Projectile.NewProjectile(source, Player.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, Player.whoAmI); } + + // Reduce duration of Static Discharge + for (int l = 0; l < Player.MaxBuffs; l++) + { + if (Player.buffType[l] == ModContent.BuffType()) + { + if (Player.buffTime[l] > 2) + { + Player.buffTime[l]--; + break; + } + } + } } } else if (Player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index 51520f3d58..99a4912340 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -7,9 +7,7 @@ using CalamityMod.Buffs.StatBuffs; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Cooldowns; using CalamityMod.Dusts; -using CalamityMod.EntitySources; using CalamityMod.Items.Accessories; -using CalamityMod.Items.Armor.Prismatic; using CalamityMod.Items.Armor.Reaver; using CalamityMod.Items.Potions.Alcohol; using CalamityMod.Items.VanillaArmorChanges; @@ -27,7 +25,6 @@ using CalamityMod.Projectiles.Summon; using CalamityMod.Projectiles.Typeless; using CalamityMod.Systems; using Microsoft.Xna.Framework; -using MonoMod.Cil; using Terraria; using Terraria.Audio; using Terraria.ID; @@ -202,11 +199,11 @@ namespace CalamityMod.CalPlayer GemTechState.MeleeOnHitEffects(target); // Handle on-hit ranged effects for the gem tech armor set. - if (proj.CountsAsClass() && proj.type != ModContent.ProjectileType()) + if (proj.CountsAsClass() && proj.type != ProjectileType()) GemTechState.RangedOnHitEffects(target, proj.damage); // Handle on-hit projectiles effects for the mythril armor set. - if (proj.type != ModContent.ProjectileType()) + if (proj.type != ProjectileType()) MythrilArmorSetChange.OnHitEffects(target, damageDone, Player); if (witheringWeaponEnchant) @@ -501,7 +498,7 @@ namespace CalamityMod.CalPlayer if (Main.player[Main.myPlayer].lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5) return; - CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Main.player[proj.owner], heal, ModContent.ProjectileType(), BalancingConstants.LifeStealRange); + CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Main.player[proj.owner], heal, ProjectileType(), BalancingConstants.LifeStealRange); } if ((cgp.betterLifeBullet1 || cgp.betterLifeBullet2) && proj.numHits == 0) @@ -523,7 +520,7 @@ namespace CalamityMod.CalPlayer for (int i = 0; i <= 2; i++) { - CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Main.player[proj.owner], heal, ModContent.ProjectileType(), BalancingConstants.LifeStealRange); + CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Main.player[proj.owner], heal, ProjectileType(), BalancingConstants.LifeStealRange); } } @@ -629,13 +626,13 @@ namespace CalamityMod.CalPlayer if (!proj.CountsAsClass() && !proj.CountsAsClass() && Player.meleeEnchant == 7) Projectile.NewProjectile(source, position, proj.velocity, ProjectileID.ConfettiMelee, 0, 0f, proj.owner); - if (alchFlask && AlchFlaskCooldown == 0 && proj.type != ModContent.ProjectileType()) + if (alchFlask && AlchFlaskCooldown == 0 && proj.type != ProjectileType()) { int seekerDamage = (int)Player.GetBestClassDamage().ApplyTo(10); seekerDamage = Player.ApplyArmorAccDamageBonusesTo(seekerDamage); Vector2 seekerVelocity = new Vector2(5, 5).RotatedByRandom(100) * Main.rand.NextFloat(0.5f, 1.2f); - Projectile bee = Projectile.NewProjectileDirect(source, position, seekerVelocity, ModContent.ProjectileType(), seekerDamage, 0f, Player.whoAmI, -20, 30, 2); + Projectile bee = Projectile.NewProjectileDirect(source, position, seekerVelocity, ProjectileType(), seekerDamage, 0f, Player.whoAmI, -20, 30, 2); bee.ArmorPenetration = 20; bee.penetrate = 2; bee.extraUpdates = 1; @@ -678,7 +675,7 @@ namespace CalamityMod.CalPlayer { AbaddonCooldown = 15; int AbaddonExploDamage = CalamityUtils.DamageSoftCap(proj.damage * 0.03f, 25); - Projectile.NewProjectile(source, position, Vector2.Zero, ModContent.ProjectileType(), AbaddonExploDamage, 0f, Player.whoAmI); + Projectile.NewProjectile(source, position, Vector2.Zero, ProjectileType(), AbaddonExploDamage, 0f, Player.whoAmI); } if (ursaSergeant && ursaSergeantCooldown <= 0) @@ -688,7 +685,7 @@ namespace CalamityMod.CalPlayer int ursaSlashdamage = (int)Player.GetBestClassDamage().ApplyTo(333); ursaSlashdamage = Player.ApplyArmorAccDamageBonusesTo(ursaSlashdamage); - Projectile.NewProjectile(source, position, Vector2.Zero, ModContent.ProjectileType(), ursaSlashdamage, 0f, Player.whoAmI); + Projectile.NewProjectile(source, position, Vector2.Zero, ProjectileType(), ursaSlashdamage, 0f, Player.whoAmI); } if (proj.CountsAsClass()) @@ -811,7 +808,7 @@ namespace CalamityMod.CalPlayer // Bloodflare Mage Explosion: 50%, softcap starts at 500 base damage to not overly punish slow weapons int bloodflareFireballDamage = Player.ApplyArmorAccDamageBonusesTo(CalamityUtils.DamageSoftCap(proj.damage * 0.5, 250)); - int fire = Projectile.NewProjectile(source, position, Vector2.Zero, ModContent.ProjectileType(), bloodflareFireballDamage, 0f, Player.whoAmI, 0f, 0f, 1f); + int fire = Projectile.NewProjectile(source, position, Vector2.Zero, ProjectileType(), bloodflareFireballDamage, 0f, Player.whoAmI, 0f, 0f, 1f); if (fire.WithinBounds(Main.maxProjectiles)) { Main.projectile[fire].DamageType = DamageClass.Generic; @@ -1206,7 +1203,7 @@ namespace CalamityMod.CalPlayer { if (eGauntlet) { - CalamityUtils.Inflict246DebuffsNPC(target, ModContent.BuffType()); + CalamityUtils.Inflict246DebuffsNPC(target, BuffType()); } if (ataxiaFire) { @@ -1287,7 +1284,7 @@ namespace CalamityMod.CalPlayer //20% chance for Voltaic Jelly if (Main.rand.NextBool(starTaintedGenerator ? 1 : 5)) { - target.AddBuff(ModContent.BuffType(), 60); + target.AddBuff(BuffType(), 60); } } @@ -1305,6 +1302,11 @@ namespace CalamityMod.CalPlayer target.AddBuff(BuffType(), 180); if (sulphurSet) target.AddBuff(BuffID.Poisoned, 60); + if (aSpark && Player.IsUnderwater()) + { + int duration = transformer ? 120 : 60; + target.AddBuff(BuffType(), duration); + } if (abyssalAmulet) { CalamityUtils.Inflict246DebuffsNPC(target, BuffType()); @@ -1346,7 +1348,7 @@ namespace CalamityMod.CalPlayer if (gladiatorSword && target.IsAnEnemy(false) && target.life <= 0 && target.Calamity().gladiatorOnKill && target.lifeMax > 5) { target.Calamity().gladiatorOnKill = false; - Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center.X, target.Center.Y, target.velocity.X / 2, target.velocity.Y / 2, ModContent.ProjectileType(), 0, 0f); + Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center.X, target.Center.Y, target.velocity.X / 2, target.velocity.Y / 2, ProjectileType(), 0, 0f); } if (Main.player[Main.myPlayer].lifeSteal > 0f && !Player.moonLeech && target.lifeMax > 5) @@ -1512,7 +1514,7 @@ namespace CalamityMod.CalPlayer if (gladiatorSword && target.IsAnEnemy(false) && target.life <= 0 && target.Calamity().gladiatorOnKill && target.lifeMax > 5) { target.Calamity().gladiatorOnKill = false; - Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center, target.velocity * 0.5f, ModContent.ProjectileType(), 0, 0f); + Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center, target.velocity * 0.5f, ProjectileType(), 0, 0f); } if (reaverDefense) diff --git a/CalamityLists.cs b/CalamityLists.cs index 45e4b359df..d6b2ebf712 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -106,8 +106,6 @@ namespace CalamityMod public static List amalgamBuffList; public static List persistentBuffList; public static List MagicGunIDs; - public static List MushroomWeaponIDs; - public static List MushroomProjectileIDs; public static List BlacklistedWeaponsWithToolPower; // Some of these lists of enemies are unused, but were difficult to create. Many of these common enemy types have a ton of variants. @@ -913,17 +911,17 @@ namespace CalamityMod NPCType(), NPCType(), NPCType(), + NPCID.EyeofCthulhu, + NPCType(), NPCID.EaterofWorldsHead, NPCID.EaterofWorldsBody, NPCID.EaterofWorldsTail, NPCID.BrainofCthulhu, NPCID.Creeper, - NPCID.EyeofCthulhu, - NPCType(), NPCID.QueenBee, + NPCID.Deerclops, NPCID.SkeletronHead, NPCID.SkeletronHand, - NPCID.Deerclops, NPCID.WallofFlesh, NPCID.WallofFleshEye, NPCID.PirateShipCannon, @@ -941,7 +939,6 @@ namespace CalamityMod NPCID.Plantera, NPCID.PlanterasTentacle, NPCType(), - NPCID.HallowBoss, NPCID.Everscream, NPCID.SantaNK1, NPCID.IceQueen, @@ -959,6 +956,7 @@ namespace CalamityMod NPCID.DukeFishron, NPCID.Sharkron, NPCID.Sharkron2, + NPCID.HallowBoss, NPCID.CultistBoss, NPCID.CultistDragonHead, NPCID.CultistDragonBody1, @@ -1566,6 +1564,7 @@ namespace CalamityMod TileType(), TileType(), TileType(), + TileType(), TileID.LivingFire, TileID.LivingCursedFire, TileID.LivingDemonFire, @@ -1589,7 +1588,6 @@ namespace CalamityMod BuffType(), BuffType(), BuffType(), - BuffType(), BuffType(), BuffType(), BuffType(), @@ -1727,34 +1725,6 @@ namespace CalamityMod ItemID.ZapinatorOrange }; - MushroomWeaponIDs = new List() - { - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemID.Hammush, - ItemID.MushroomSpear, - ItemID.Shroomerang - }; - - MushroomProjectileIDs = new List() - { - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileType(), - ProjectileID.TruffleSpore, - ProjectileID.MushroomSpear, - ProjectileID.Shroomerang - }; - // This list intentionally does not contain Grax. BlacklistedWeaponsWithToolPower = new List() { @@ -2764,8 +2734,6 @@ namespace CalamityMod amalgamBuffList = null; persistentBuffList = null; MagicGunIDs = null; - MushroomWeaponIDs = null; - MushroomProjectileIDs = null; BlacklistedWeaponsWithToolPower = null; zombieList = null; diff --git a/Cooldowns/ArsenalPower.cs b/Cooldowns/ArsenalPower.cs new file mode 100644 index 0000000000..d61c4bce55 --- /dev/null +++ b/Cooldowns/ArsenalPower.cs @@ -0,0 +1,21 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.Localization; +using static CalamityMod.CalamityUtils; + +namespace CalamityMod.Cooldowns +{ + public class ArsenalPower : CooldownHandler + { + public static new string ID => "ArsenalPower"; + public override bool ShouldDisplay => true; + public override LocalizedText DisplayName => CalamityUtils.GetText($"UI.Cooldowns.{ID}"); + public override string Texture => "CalamityMod/Cooldowns/ArsenalPower"; + public override Color OutlineColor => Color.White; + public override Color CooldownStartColor => Color.Sienna; + public override Color CooldownEndColor => Color.LightSlateGray; + + public override SoundStyle? EndSound => new("CalamityMod/Sounds/Item/ArsenalOffCooldown"); + } +} diff --git a/Cooldowns/ArsenalPower.png b/Cooldowns/ArsenalPower.png new file mode 100644 index 0000000000..72e59d3de1 Binary files /dev/null and b/Cooldowns/ArsenalPower.png differ diff --git a/Cooldowns/ArsenalPowerOutline.png b/Cooldowns/ArsenalPowerOutline.png new file mode 100644 index 0000000000..2378fee32c Binary files /dev/null and b/Cooldowns/ArsenalPowerOutline.png differ diff --git a/Cooldowns/ArsenalPowerOverlay.png b/Cooldowns/ArsenalPowerOverlay.png new file mode 100644 index 0000000000..92655b1c94 Binary files /dev/null and b/Cooldowns/ArsenalPowerOverlay.png differ diff --git a/ExtraTextures/Lasers/BirbAuraEnd.png b/ExtraTextures/Lasers/BirbAuraEnd.png deleted file mode 100644 index 4003d549d6..0000000000 Binary files a/ExtraTextures/Lasers/BirbAuraEnd.png and /dev/null differ diff --git a/ExtraTextures/Lasers/BirbAuraEndpoints.png b/ExtraTextures/Lasers/BirbAuraEndpoints.png new file mode 100644 index 0000000000..bf4bfa8594 Binary files /dev/null and b/ExtraTextures/Lasers/BirbAuraEndpoints.png differ diff --git a/ExtraTextures/Lasers/BirbAuraStart.png b/ExtraTextures/Lasers/BirbAuraStart.png deleted file mode 100644 index 1a999c374d..0000000000 Binary files a/ExtraTextures/Lasers/BirbAuraStart.png and /dev/null differ diff --git a/Items/Accessories/AmalgamatedBrain.cs b/Items/Accessories/AmalgamatedBrain.cs index e1c1a5f31e..c7ec538ef4 100644 --- a/Items/Accessories/AmalgamatedBrain.cs +++ b/Items/Accessories/AmalgamatedBrain.cs @@ -8,7 +8,6 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - // TODO -- this item includes a dodge accessory, Brain of Cthulhu public class AmalgamatedBrain : ModItem, ILocalizedModType, IHoldShiftTooltipItem { public new string LocalizationCategory => "Items.Accessories"; @@ -46,7 +45,7 @@ namespace CalamityMod.Items.Accessories } } } - player.GetDamage() += 0.1f; + player.GetDamage() += 0.05f; } public override void AddRecipes() diff --git a/Items/Accessories/AmidiasPendant.cs b/Items/Accessories/AmidiasPendant.cs deleted file mode 100644 index 12e0ce87ad..0000000000 --- a/Items/Accessories/AmidiasPendant.cs +++ /dev/null @@ -1,82 +0,0 @@ -using CalamityMod.Items.Potions.Alcohol; -using CalamityMod.Projectiles.Typeless; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Accessories -{ - public class AmidiasPendant : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Accessories"; - public const int ShardProjectiles = 2; - public const float ShardAngleSpread = 120; - public int ShardCountdown = 0; - - public override void SetDefaults() - { - Item.width = 26; - Item.height = 46; - Item.value = CalamityGlobalItem.RarityGreenBuyPrice; - Item.rare = ItemRarityID.Green; - Item.accessory = true; - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - if (ShardCountdown <= 0) - { - ShardCountdown = 140; - } - if (ShardCountdown > 0) - { - ShardCountdown -= Main.rand.Next(1, 4); - if (ShardCountdown <= 0) - { - if (player.whoAmI == Main.myPlayer) - { - var source = player.GetSource_Accessory(Item); - int speed2 = 25; - float spawnX = Main.rand.Next(1000) - 500 + player.Center.X; - float spawnY = -1000 + player.Center.Y; - Vector2 baseSpawn = new Vector2(spawnX, spawnY); - Vector2 baseVelocity = player.Center - baseSpawn; - baseVelocity.Normalize(); - baseVelocity *= speed2; - int spawnOffset = ShardProjectiles * 15; - float spread = -ShardAngleSpread / 2f; - for (int i = 0; i < ShardProjectiles; i++) - { - Vector2 spawn = baseSpawn; - spawn.X = spawn.X + i * 30 - spawnOffset; - Vector2 velocity = baseVelocity.RotatedBy(MathHelper.ToRadians(spread + (ShardAngleSpread * i / (float)ShardProjectiles))); - velocity.X = velocity.X + 3 * Main.rand.NextFloat() - 1.5f; - int type = 0; - int damage = 0; - switch (Main.rand.Next(3)) - { - case 0: - type = ModContent.ProjectileType(); - damage = 15; - break; - case 1: - type = ModContent.ProjectileType(); - damage = 15; - break; - case 2: - type = ModContent.ProjectileType(); - damage = 30; - break; - } - - int finalDamage = (int)player.GetBestClassDamage().ApplyTo(damage); - finalDamage = player.ApplyArmorAccDamageBonusesTo(finalDamage); - Projectile.NewProjectile(source, spawn.X, spawn.Y, velocity.X / 3, velocity.Y / 2, type, finalDamage, 5f, Main.myPlayer); - } - } - } - } - } - } -} diff --git a/Items/Accessories/AmidiasPendant.png b/Items/Accessories/AmidiasPendant.png deleted file mode 100644 index ff71e1fc5f..0000000000 Binary files a/Items/Accessories/AmidiasPendant.png and /dev/null differ diff --git a/Items/Accessories/AmidiasSpark.cs b/Items/Accessories/AmidiasSpark.cs index e15f15b358..e47f734736 100644 --- a/Items/Accessories/AmidiasSpark.cs +++ b/Items/Accessories/AmidiasSpark.cs @@ -17,6 +17,8 @@ namespace CalamityMod.Items.Accessories Item.accessory = true; } + public override bool CanEquipAccessory(Player player, int slot, bool modded) => !player.Calamity().transformer; + public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); diff --git a/Items/Accessories/AsgardsValor.cs b/Items/Accessories/AsgardsValor.cs index 1b6e0c3011..5478959941 100644 --- a/Items/Accessories/AsgardsValor.cs +++ b/Items/Accessories/AsgardsValor.cs @@ -22,8 +22,8 @@ namespace CalamityMod.Items.Accessories public override void SetDefaults() { - Item.width = 38; - Item.height = 44; + Item.width = 50; + Item.height = 48; Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; Item.defense = 8; // we buff Ankh Shield to 8 diff --git a/Items/Accessories/AsgardsValor.png b/Items/Accessories/AsgardsValor.png index 6a56bed385..316e59b4bd 100644 Binary files a/Items/Accessories/AsgardsValor.png and b/Items/Accessories/AsgardsValor.png differ diff --git a/Items/Accessories/GiantPearl.cs b/Items/Accessories/GiantPearl.cs index e1e9e339a4..c80f33d6a8 100644 --- a/Items/Accessories/GiantPearl.cs +++ b/Items/Accessories/GiantPearl.cs @@ -1,10 +1,14 @@ using CalamityMod.CalPlayer; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { + [LegacyName("AmidiasPendant")] public class GiantPearl : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; @@ -22,6 +26,32 @@ namespace CalamityMod.Items.Accessories CalamityPlayer modPlayer = player.Calamity(); modPlayer.giantPearl = true; Lighting.AddLight((int)player.Center.X / 16, (int)player.Center.Y / 16, 0.45f, 0.8f, 0.8f); + + // Draw the aura visual + float npcDistCompare = 1000f; + foreach (NPC n in Main.ActiveNPCs) + { + if (n.friendly || n.dontTakeDamage) + continue; + + float currentNPCDist = Vector2.Distance(n.Center, player.Center); + if (currentNPCDist < npcDistCompare) + npcDistCompare = currentNPCDist; + } + float opacity = Utils.Remap(npcDistCompare, 120f, 640f, 1f, 0f); + + if (opacity > 0.7f) + { + for (int d = 0; d < 3; d++) + { + Vector2 bubbleSpawn = player.Center + Vector2.UnitX.RotatedByRandom(MathHelper.Pi) * 120f; + GenericBubbleParticle bubble = new(bubbleSpawn, Main.rand.NextVector2CircularEdge(0.75f, 0.75f), 0.3f, Main.rand.NextFloat(MathHelper.TwoPi), 8); + GeneralParticleHandler.SpawnParticle(bubble); + } + } + + CustomPulse auraVisual = new(player.Center, Vector2.Zero, new Color(75, 164, 191), "CalamityMod/Particles/HighResFoggyCircleHardEdge", Vector2.One, 0f, 0.12f, 0.1175f, 3, true, opacity); + GeneralParticleHandler.SpawnParticle(auraVisual); } } } diff --git a/Items/Accessories/MarniteRepulsionShield.cs b/Items/Accessories/MarniteRepulsionShield.cs index 722a59065d..6786c4d73a 100644 --- a/Items/Accessories/MarniteRepulsionShield.cs +++ b/Items/Accessories/MarniteRepulsionShield.cs @@ -15,7 +15,7 @@ using static CalamityMod.CalamityUtils; namespace CalamityMod.Items.Accessories { [AutoloadEquip(EquipType.Back)] - //Its not like its a renamed version of the bayonet, but i put this here more as a way to "refund" the item, so it doesnt end up rotting as an unloaded item. + //It's not like it's a renamed version of the bayonet, but I put this here more as a way to "refund" the item, so it doesnt end up rotting as an unloaded item. [LegacyName("MarniteBayonet")] public class MarniteRepulsionShield : ModItem, ILocalizedModType { @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Accessories Item.rare = ItemRarityID.Blue; Item.value = CalamityGlobalItem.RarityBlueBuyPrice; Item.accessory = true; - Item.defense = 2; + Item.defense = 4; } public override void UpdateAccessory(Player player, bool hideVisual) @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Accessories var source = player.GetSource_Accessory(Item); if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - var hitbox = Projectile.NewProjectileDirect(source, player.Center, Vector2.Zero, ModContent.ProjectileType(), baseDamage, 10f, Main.myPlayer); + var hitbox = Projectile.NewProjectileDirect(source, player.Center, Vector2.Zero, ModContent.ProjectileType(), baseDamage, 12f, Main.myPlayer); hitbox.originalDamage = baseDamage; } } @@ -91,6 +91,7 @@ namespace CalamityMod.Items.Accessories Projectile.penetrate = -1; Projectile.timeLeft = 700; Projectile.tileCollide = false; + Projectile.ArmorPenetration = 20; Projectile.netImportant = true; } diff --git a/Items/Accessories/NebulousCore.cs b/Items/Accessories/NebulousCore.cs index a9ead56f4f..6c6c9be664 100644 --- a/Items/Accessories/NebulousCore.cs +++ b/Items/Accessories/NebulousCore.cs @@ -33,11 +33,11 @@ namespace CalamityMod.Items.Accessories CalamityPlayer modPlayer = player.Calamity(); modPlayer.nCore = true; player.GetDamage() += 0.1f; - int damage = (int)player.GetBestClassDamage().ApplyTo(250); - damage = player.ApplyArmorAccDamageBonusesTo(damage); - float knockBack = 3f; + + // Spawn nebula stars if (Main.rand.NextBool(15)) { + // Count the number of current active nebula stars; if this is at least 10, no more can spawn int numProj = 0; foreach (Projectile p in Main.ActiveProjectiles) { @@ -46,56 +46,32 @@ namespace CalamityMod.Items.Accessories numProj++; } } - var source = player.GetSource_Accessory(Item); if (Main.rand.Next(15) >= numProj && numProj < 10) { int spawnRadius = 24; - int backupSpawnRadius = 90; - for (int j = 0; j < 50; j++) + for (int j = 0; j < 50; j++) // Attempt to spawn the star randomly around the player { - int randomProjOffset = Main.rand.Next(200 - j * 2, 400 + j * 2); + float randomProjOffset = Main.rand.NextFloat(200 - j * 2, 400 + j * 2); Vector2 center = player.Center; - center.X += (float)Main.rand.Next(-randomProjOffset, randomProjOffset + 1); - center.Y += (float)Main.rand.Next(-randomProjOffset, randomProjOffset + 1); + center.X += Main.rand.NextFloat(-randomProjOffset, randomProjOffset + 1); + center.Y += Main.rand.NextFloat(-randomProjOffset, randomProjOffset + 1); + // Ensure we are not trying to spawn the star on top of a solid tile or liquid if (!Collision.SolidCollision(center, spawnRadius, spawnRadius) && !Collision.WetCollision(center, spawnRadius, spawnRadius)) { center.X += (float)(spawnRadius / 2); center.Y += (float)(spawnRadius / 2); - if (Collision.CanHit(new Vector2(player.Center.X, player.position.Y), 1, 1, center, 1, 1) || Collision.CanHit(new Vector2(player.Center.X, player.position.Y - 50f), 1, 1, center, 1, 1)) + // Ensure the star's spawn point has line-of-sight with the player + if (Collision.CanHit(player.Center, 1, 1, center, 1, 1) || Collision.CanHit(player.Center - new Vector2(0f, 50f), 1, 1, center, 1, 1)) { - int projTileX = (int)center.X / 16; - int projTileY = (int)center.Y / 16; - bool canSpawnProj = false; - if (Main.rand.NextBool(3) && Main.tile[projTileX, projTileY] != null && Main.tile[projTileX, projTileY].WallType > 0) + if (Main.rand.NextBool(3) && Main.myPlayer == player.whoAmI) { - canSpawnProj = true; - } - else - { - center.X -= (float)(backupSpawnRadius / 2); - center.Y -= (float)(backupSpawnRadius / 2); - if (Collision.SolidCollision(center, backupSpawnRadius, backupSpawnRadius)) - { - center.X += (float)(backupSpawnRadius / 2); - center.Y += (float)(backupSpawnRadius / 2); - canSpawnProj = true; - } - } - if (canSpawnProj) - { - for (int k = 0; k < Main.maxProjectiles; k++) - { - if (Main.projectile[k].active && Main.projectile[k].owner == player.whoAmI && Main.projectile[k].type == ModContent.ProjectileType() && (center - Main.projectile[k].Center).Length() < 48f) - { - canSpawnProj = false; - break; - } - } - if (canSpawnProj && Main.myPlayer == player.whoAmI) - { - Projectile.NewProjectile(source, center.X, center.Y, 0f, 0f, ModContent.ProjectileType(), damage, knockBack, player.whoAmI); - return; - } + var source = player.GetSource_Accessory(Item); + int damage = (int)player.GetBestClassDamage().ApplyTo(250); + damage = player.ApplyArmorAccDamageBonusesTo(damage); + float knockBack = 3f; + + Projectile.NewProjectile(source, center.X, center.Y, 0f, 0f, ModContent.ProjectileType(), damage, knockBack, player.whoAmI); + return; } } } diff --git a/Items/Accessories/TeslasAmulet.cs b/Items/Accessories/TeslasAmulet.cs new file mode 100644 index 0000000000..ee228c52b2 --- /dev/null +++ b/Items/Accessories/TeslasAmulet.cs @@ -0,0 +1,45 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Accessories +{ + public class TeslasAmulet : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Accessories"; + public override void SetStaticDefaults() + { + Main.RegisterItemAnimation(Type, new DrawAnimationVertical(5, 14)); + ItemID.Sets.AnimatesAsSoul[Type] = true; + } + + public override void SetDefaults() + { + Item.width = 32; + Item.height = 32; + Item.rare = ItemRarityID.Orange; + Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; + Item.accessory = true; + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.Calamity().tesla = true; + player.Calamity().teslaVisuals = !hideVisual; + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(ItemID.BottledWater). + AddIngredient(8). + AddIngredient(8). + AddIngredient(4). + AddTile(TileID.Anvils). + Register(); + } + } +} diff --git a/Items/Potions/TeslaPotion.png b/Items/Accessories/TeslasAmulet.png similarity index 100% rename from Items/Potions/TeslaPotion.png rename to Items/Accessories/TeslasAmulet.png diff --git a/Items/Accessories/TheTransformer.cs b/Items/Accessories/TheTransformer.cs index 6504109afd..a744261963 100644 --- a/Items/Accessories/TheTransformer.cs +++ b/Items/Accessories/TheTransformer.cs @@ -27,6 +27,8 @@ namespace CalamityMod.Items.Accessories Item.accessory = true; } + public override bool CanEquipAccessory(Player player, int slot, bool modded) => !player.Calamity().aSpark; + public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); diff --git a/Items/Accessories/Vanity/Apelusa_Body.png b/Items/Accessories/Vanity/Apelusa_Body.png deleted file mode 100644 index 501db51809..0000000000 Binary files a/Items/Accessories/Vanity/Apelusa_Body.png and /dev/null differ diff --git a/Items/Accessories/Vanity/Apelusa_Head.png b/Items/Accessories/Vanity/Apelusa_Head.png deleted file mode 100644 index df7384ea15..0000000000 Binary files a/Items/Accessories/Vanity/Apelusa_Head.png and /dev/null differ diff --git a/Items/Accessories/Vanity/Apelusa_Legs.png b/Items/Accessories/Vanity/Apelusa_Legs.png deleted file mode 100644 index 0e6cf7a844..0000000000 Binary files a/Items/Accessories/Vanity/Apelusa_Legs.png and /dev/null differ diff --git a/Items/Accessories/Vanity/Dandy_Body.png b/Items/Accessories/Vanity/Dandy_Body.png new file mode 100644 index 0000000000..d6778db86e Binary files /dev/null and b/Items/Accessories/Vanity/Dandy_Body.png differ diff --git a/Items/Accessories/Vanity/Dandy_Head.png b/Items/Accessories/Vanity/Dandy_Head.png new file mode 100644 index 0000000000..b107474d18 Binary files /dev/null and b/Items/Accessories/Vanity/Dandy_Head.png differ diff --git a/Items/Accessories/Vanity/Dandy_Legs.png b/Items/Accessories/Vanity/Dandy_Legs.png new file mode 100644 index 0000000000..364147d83b Binary files /dev/null and b/Items/Accessories/Vanity/Dandy_Legs.png differ diff --git a/Items/Accessories/Vanity/RedBow.cs b/Items/Accessories/Vanity/GhostBracelet.cs similarity index 79% rename from Items/Accessories/Vanity/RedBow.cs rename to Items/Accessories/Vanity/GhostBracelet.cs index a336b99bdf..b5087243a8 100644 --- a/Items/Accessories/Vanity/RedBow.cs +++ b/Items/Accessories/Vanity/GhostBracelet.cs @@ -4,23 +4,22 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Accessories.Vanity { - public class RedBow : ModItem, ILocalizedModType + [LegacyName("RedBow")] + public class GhostBracelet : ModItem, ILocalizedModType { - public new string LocalizationCategory => "Items.Accessories"; public override void Load() { if (Main.netMode != NetmodeID.Server) { - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Apelusa_Head", EquipType.Head, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Apelusa_Body", EquipType.Body, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Apelusa_Legs", EquipType.Legs, this); + EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Dandy_Head", EquipType.Head, this); + EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Dandy_Body", EquipType.Body, this); + EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Dandy_Legs", EquipType.Legs, this); } } public override void SetStaticDefaults() { - if (Main.netMode == NetmodeID.Server) return; @@ -37,8 +36,8 @@ namespace CalamityMod.Items.Accessories.Vanity public override void SetDefaults() { - Item.width = 22; - Item.height = 30; + Item.width = 42; + Item.height = 38; Item.accessory = true; Item.value = CalamityGlobalItem.RarityGreenBuyPrice; Item.rare = ItemRarityID.Green; @@ -48,21 +47,21 @@ namespace CalamityMod.Items.Accessories.Vanity public override void UpdateVanity(Player player) { - player.Calamity().redBow = true; + player.Calamity().ghostBracelet = true; } public override void UpdateAccessory(Player player, bool hideVisual) { if (!hideVisual) { - player.Calamity().redBow = true; + player.Calamity().ghostBracelet = true; } } public override void AddRecipes() { CreateRecipe(). - AddIngredient(ItemID.Silk, 5). + AddIngredient(ItemID.Silk, 20). AddTile(TileID.Loom). Register(); } diff --git a/Items/Accessories/Vanity/GhostBracelet.png b/Items/Accessories/Vanity/GhostBracelet.png new file mode 100644 index 0000000000..9ae96bca31 Binary files /dev/null and b/Items/Accessories/Vanity/GhostBracelet.png differ diff --git a/Items/Accessories/Vanity/RedBow.png b/Items/Accessories/Vanity/RedBow.png deleted file mode 100644 index 21ad13f679..0000000000 Binary files a/Items/Accessories/Vanity/RedBow.png and /dev/null differ diff --git a/Items/Armor/GemTech/GemTechHeadgear.cs b/Items/Armor/GemTech/GemTechHeadgear.cs index 006989a52d..1a7dd7e305 100644 --- a/Items/Armor/GemTech/GemTechHeadgear.cs +++ b/Items/Armor/GemTech/GemTechHeadgear.cs @@ -61,13 +61,13 @@ namespace CalamityMod.Items.Armor.GemTech Item.height = 32; Item.defense = 14; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.rare = ModContent.RarityType(); + Item.rare = RarityType(); Item.Calamity().donorItem = true; } public override bool IsArmorSet(Item head, Item body, Item legs) { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); + return body.type == ItemType() && legs.type == ItemType(); } public static bool HasArmorSet(Player player) => player.armor[0].type == ItemType() && player.armor[1].type == ItemType() && player.armor[2].type == ItemType(); diff --git a/Items/Armor/MarniteArchitect/MarniteArchitectSet.cs b/Items/Armor/MarniteArchitect/MarniteArchitectSet.cs index e2fae35316..34eb51bc23 100644 --- a/Items/Armor/MarniteArchitect/MarniteArchitectSet.cs +++ b/Items/Armor/MarniteArchitect/MarniteArchitectSet.cs @@ -79,7 +79,7 @@ namespace CalamityMod.Items.Armor.MarniteArchitect orig(self); } - public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType(); + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ItemType(); public static bool HasArmorSet(Player player) => player.armor[0].type == ItemType() && player.armor[1].type == ItemType(); public bool IsPartOfSet(Item item) => item.type == ItemType() || item.type == ItemType(); @@ -205,7 +205,7 @@ namespace CalamityMod.Items.Armor.MarniteArchitect public override void PostUpdateMiscEffects() { - if (!setEquipped && Player.mount.Type == ModContent.MountType() && Player.mount.Active) + if (!setEquipped && Player.mount.Type == MountType() && Player.mount.Active) Player.mount.Dismount(Player); if (mounted) @@ -368,7 +368,7 @@ namespace CalamityMod.Items.Armor.MarniteArchitect //Sprites if (Main.netMode != NetmodeID.Server) { - MountData.frontTextureGlow = ModContent.Request("CalamityMod/Items/Armor/MarniteArchitect/MarniteLiftFire"); + MountData.frontTextureGlow = Request("CalamityMod/Items/Armor/MarniteArchitect/MarniteLiftFire"); } } diff --git a/Items/Armor/Wulfrum/WulfrumSet.cs b/Items/Armor/Wulfrum/WulfrumSet.cs index 6d5858ea5e..0ed6f4412c 100644 --- a/Items/Armor/Wulfrum/WulfrumSet.cs +++ b/Items/Armor/Wulfrum/WulfrumSet.cs @@ -82,9 +82,9 @@ namespace CalamityMod.Items.Armor.Wulfrum } } - else if (player.HasItem(ModContent.ItemType())) + else if (player.HasItem(ItemType())) { - player.ConsumeItem(ModContent.ItemType()); + player.ConsumeItem(ItemType()); //I Thiiiinnnk there's no need to add mp syncing packets since cooldowns get auto synced right. player.AddCooldown(WulfrumBastion.ID, BastionCooldown + BastionTime); //Though do i need to sync that or is the player inventory auto synced? @@ -234,7 +234,7 @@ namespace CalamityMod.Items.Armor.Wulfrum setBonus1.OverrideColor = Color.Lerp(new Color(194, 255, 67), new Color(112, 244, 244), 0.5f + 0.5f * (float)Math.Sin(Main.GlobalTimeWrappedHourly * 3f)); tooltips.Insert(setBonusIndex + 1, setBonus1); - int AmmoItem = ModContent.ItemType(); + int AmmoItem = ItemType(); string AmmoDisplay = $"[i:{AmmoItem}] {CalamityUtils.GetItemName(AmmoItem)}"; TooltipLine setBonus2 = new TooltipLine(item.Mod, "CalamityMod:SetBonus2", CalamityUtils.GetTextFromModItem("AbilityDescription").Format(AmmoDisplay)); setBonus2.OverrideColor = new Color(110, 192, 93); diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index 0c4058647f..a1811f12a2 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -826,7 +826,7 @@ namespace CalamityMod.Items //Flame Waker Boots buff. if (item.type == ItemID.FlameWakerBoots) { - EditTooltipByNum(0, (line) => line.Text = "Multiplies all fire-based debuff damage by 1.25\n" + + EditTooltipByNum(0, (line) => line.Text = "Multiplies all fire-based debuff damage by 1.25x\n" + "All attacks light enemies on fire\n" + "'Never get cold feet again'"); } @@ -835,7 +835,7 @@ namespace CalamityMod.Items if (item.type == ItemID.HellfireTreads) { EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("fire blocks", "the Burning and On Fire! debuffs")); - EditTooltipByNum(2, (line) => line.Text += "\nMultiplies all fire-based debuff damage by 1.5, does not stack with downgrades\n" + + EditTooltipByNum(2, (line) => line.Text += "\nMultiplies all fire-based debuff damage by 1.5x, does not stack with downgrades\n" + "All attacks inflict Hellfire"); } diff --git a/Items/Placeables/LivingFire/LivingPlagueFireBlock.cs b/Items/Placeables/LivingFire/LivingPlagueFireBlock.cs new file mode 100644 index 0000000000..74c7b3f5a0 --- /dev/null +++ b/Items/Placeables/LivingFire/LivingPlagueFireBlock.cs @@ -0,0 +1,44 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Tiles.LivingFire; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.LivingFire +{ + public class LivingPlagueFireBlock : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetStaticDefaults() + { + Item.ResearchUnlockCount = 100; + } + + public override void SetDefaults() + { + Item.width = 10; + Item.height = 12; + Item.maxStack = 9999; + Item.useTurn = true; + Item.autoReuse = true; + Item.useAnimation = 15; + Item.useTime = 10; + Item.useStyle = ItemUseStyleID.Swing; + Item.consumable = true; + Item.createTile = ModContent.TileType(); + } + + public override void PostUpdate() + { + Lighting.AddLight((int)((Item.position.X + Item.width / 2) / 16f), (int)((Item.position.Y + Item.height / 2) / 16f), 0f, 1f, 0.2f); + } + + public override void AddRecipes() + { + CreateRecipe(20). + AddIngredient(ItemID.LivingFireBlock, 20). + AddIngredient(). + Register(); + } + } +} diff --git a/Items/Placeables/LivingFire/LivingPlagueFireBlock.png b/Items/Placeables/LivingFire/LivingPlagueFireBlock.png new file mode 100644 index 0000000000..8b7b3dd14b Binary files /dev/null and b/Items/Placeables/LivingFire/LivingPlagueFireBlock.png differ diff --git a/Items/Potions/TeslaPotion.cs b/Items/Potions/TeslaPotion.cs deleted file mode 100644 index 1fa1a540b3..0000000000 --- a/Items/Potions/TeslaPotion.cs +++ /dev/null @@ -1,60 +0,0 @@ -using CalamityMod.Buffs.Potions; -using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; -using CalamityMod.Items.Placeables.Ores; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Potions -{ - public class TeslaPotion : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Potions"; - public override void SetStaticDefaults() - { - Item.ResearchUnlockCount = 20; - Main.RegisterItemAnimation(Type, new DrawAnimationVertical(5, 14)); - ItemID.Sets.AnimatesAsSoul[Type] = true; - } - - public override void SetDefaults() - { - Item.width = 32; - Item.height = 32; - Item.useTurn = true; - Item.maxStack = 9999; - Item.rare = ItemRarityID.Orange; - Item.useAnimation = 17; - Item.useTime = 17; - Item.useStyle = ItemUseStyleID.DrinkLiquid; - Item.UseSound = SoundID.Item3; - Item.consumable = true; - Item.buffType = ModContent.BuffType(); - Item.buffTime = CalamityUtils.SecondsToFrames(480f); - Item.value = Item.buyPrice(0, 2, 0, 0); - } - - public override void AddRecipes() - { - CreateRecipe(5). - AddIngredient(ItemID.BottledWater). - AddIngredient(2). - AddIngredient(5). - AddIngredient(). - AddIngredient(). - AddTile(TileID.Bottles). - AddDecraftCondition(CalamityConditions.DownedHiveMindOrPerforator). - Register(); - - CreateRecipe(). - AddIngredient(ItemID.BottledWater). - AddIngredient(10). - AddIngredient(). - AddTile(TileID.AlchemyTable). - Register() - .DisableDecraft(); - } - } -} diff --git a/Items/SummonItems/Invasion/CausticTear.cs b/Items/SummonItems/Invasion/CausticTear.cs index 2de57c9d47..9e11870259 100644 --- a/Items/SummonItems/Invasion/CausticTear.cs +++ b/Items/SummonItems/Invasion/CausticTear.cs @@ -38,8 +38,8 @@ namespace CalamityMod.Items.SummonItems.Invasion public override bool? UseItem(Player player) { - CalamityNetcode.SyncWorld(); - AcidRainEvent.TryStartEvent(true); + AcidRainEvent.TryStartEvent(forceRain: true); + //CalamityNetcode.SyncWorld(); //TryStartEvent(forceRain: true) already sync the world data return true; } diff --git a/Items/SummonItems/Invasion/MartianDistressRemote.cs b/Items/SummonItems/Invasion/MartianDistressRemote.cs index 965b1b0ff3..0ec3bb1df7 100644 --- a/Items/SummonItems/Invasion/MartianDistressRemote.cs +++ b/Items/SummonItems/Invasion/MartianDistressRemote.cs @@ -39,7 +39,16 @@ namespace CalamityMod.Items.SummonItems.Invasion public override bool? UseItem(Player player) { - Main.StartInvasion(InvasionID.MartianMadness); + if (Main.netMode != NetmodeID.MultiplayerClient) + { + Main.invasionDelay = 0; + Main.StartInvasion(InvasionID.MartianMadness); + } + else + { + //-7.0 is hardcoded id for MartianMadness Event + NetMessage.SendData(MessageID.SpawnBossUseLicenseStartEvent, number: player.whoAmI, number2: -7.0f); + } return true; } diff --git a/Items/Tools/BobbitHook.cs b/Items/Tools/BobbitHook.cs index f67d9f7fe3..34c55f4352 100644 --- a/Items/Tools/BobbitHook.cs +++ b/Items/Tools/BobbitHook.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Tools Item.shootSpeed = BobbitHead.LaunchSpeed; // How quickly the hook is shot. Item.shoot = ProjectileType(); Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice; - Item.rare = ModContent.RarityType(); + Item.rare = RarityType(); } } } diff --git a/Items/Tools/ClimateChange/Cosmolight.cs b/Items/Tools/ClimateChange/Cosmolight.cs index 70705a1e1a..8f63502ece 100644 --- a/Items/Tools/ClimateChange/Cosmolight.cs +++ b/Items/Tools/ClimateChange/Cosmolight.cs @@ -34,9 +34,15 @@ namespace CalamityMod.Items.Tools.ClimateChange public override bool CanUseItem(Player player) { + //Only SinglePlayer or DedServ should change time to prevent unwanted race condition + if (Main.netMode == NetmodeID.MultiplayerClient) + return true; + if (CalamityPlayer.areThereAnyDamnBosses) return false; + + // Early Morning -> Noon if (Main.dayTime && Main.time < NoonCutoff) Main.SkipToTime(NoonCutoff, true); diff --git a/Items/TreasureBags/MiscGrabBags/StarterBag.cs b/Items/TreasureBags/MiscGrabBags/StarterBag.cs index 9423468e0d..03aabed864 100644 --- a/Items/TreasureBags/MiscGrabBags/StarterBag.cs +++ b/Items/TreasureBags/MiscGrabBags/StarterBag.cs @@ -90,15 +90,15 @@ namespace CalamityMod.Items.TreasureBags.MiscGrabBags }; itemLoot.AddIf(getsHapuFruit, ModContent.ItemType()); - // Apelusa dev item - // Name specific: "Pelusa" - static bool getsRedBow(DropAttemptInfo info) + // Dandy dev item + // Name specific: "Dandy" + static bool getsGhostBracelet(DropAttemptInfo info) { string playerName = info.player.name; - return playerName == "Pelusa"; + return playerName == "Dandy"; } - itemLoot.AddIf(getsRedBow, ModContent.ItemType()); + itemLoot.AddIf(getsGhostBracelet, ModContent.ItemType()); // Mishiro dev vanity // Name specific: "Amber" or "Mishiro" diff --git a/Items/Weapons/Magic/SeethingDischarge.cs b/Items/Weapons/Magic/SeethingDischarge.cs index ccb6632d8c..63aeac78ab 100644 --- a/Items/Weapons/Magic/SeethingDischarge.cs +++ b/Items/Weapons/Magic/SeethingDischarge.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Magic; +using CalamityMod.NPCs.BrimstoneElemental; +using CalamityMod.Projectiles.Magic; using CalamityMod.Sounds; using Microsoft.Xna.Framework; using Terraria; @@ -11,37 +12,61 @@ namespace CalamityMod.Items.Weapons.Magic public class SeethingDischarge : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Magic"; + + public int DartTimer = 0; public override void SetDefaults() { Item.width = 28; Item.height = 32; - Item.damage = 52; + Item.damage = 40; Item.DamageType = DamageClass.Magic; - Item.mana = 15; - Item.useTime = 24; - Item.useAnimation = 24; + Item.mana = 20; + Item.useTime = 60; + Item.useAnimation = 60; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 6.75f; - Item.UseSound = CommonCalamitySounds.FlareSound; + Item.UseSound = BrimstoneElemental.ShellFireSound; Item.value = CalamityGlobalItem.RarityPinkBuyPrice; Item.rare = ItemRarityID.Pink; Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 12f; + Item.shootSpeed = 10f; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - float SpeedX = velocity.X + 10f * 0.05f; - float SpeedY = velocity.Y + 10f * 0.05f; - float SpeedX2 = velocity.X - 10f * 0.05f; - float SpeedY2 = velocity.Y - 10f * 0.05f; - float SpeedX3 = velocity.X + 0f * 0.05f; - float SpeedY3 = velocity.Y + 0f * 0.05f; - Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, damage, knockback, player.whoAmI, 0f, 0f); - Projectile.NewProjectile(source, position.X, position.Y, SpeedX2, SpeedY2, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0f, 0f); - Projectile.NewProjectile(source, position.X, position.Y, SpeedX3, SpeedY3, type, damage, knockback, player.whoAmI, 0f, 0f); + DartTimer++; + + // Spawn hellblasts + float diameter = 50f; + Vector2 projVelocity = velocity.SafeNormalize(Vector2.UnitY); + projVelocity *= diameter; + + int totalProjectiles = 5; + float offsetAngle = MathHelper.Pi * 0.2f; + + for (int j = 0; j < totalProjectiles; j++) + { + float radians = j - (totalProjectiles - 1f) / 2f; + Vector2 offset = projVelocity.RotatedBy(offsetAngle * radians); + Projectile.NewProjectile(source, player.Center + offset, velocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI); + } + + // Every 3rd attack, spawn a ring of homing darts + if (DartTimer == 3) + { + DartTimer = 0; + + totalProjectiles = 8; + Vector2 initialOffset = Vector2.UnitX.RotatedBy(Main.rand.NextFloat(0f, MathHelper.PiOver4)); + for (int k = 0; k < totalProjectiles; k++) + { + velocity = initialOffset.RotatedBy(MathHelper.TwoPi * (k / (float)totalProjectiles)) * Item.shootSpeed; + Projectile.NewProjectile(source, player.Center, velocity, type, damage, 0f, player.whoAmI, 0f, 1f); + } + } + return false; } } diff --git a/Items/Weapons/Melee/ArkoftheCosmos.cs b/Items/Weapons/Melee/ArkoftheCosmos.cs index b2075df53f..7521476b79 100644 --- a/Items/Weapons/Melee/ArkoftheCosmos.cs +++ b/Items/Weapons/Melee/ArkoftheCosmos.cs @@ -89,7 +89,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.value = CalamityGlobalItem.RarityVioletBuyPrice; Item.shoot = ProjectileID.PurificationPowder; Item.shootSpeed = 28f; - Item.rare = ModContent.RarityType(); + Item.rare = RarityType(); } // Terraria seems to really dislike high crit values in SetDefaults diff --git a/Items/Weapons/Melee/BalefulHarvester.cs b/Items/Weapons/Melee/BalefulHarvester.cs index 81bb2411b5..b1b41f3c1a 100644 --- a/Items/Weapons/Melee/BalefulHarvester.cs +++ b/Items/Weapons/Melee/BalefulHarvester.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - Item.width = 74; - Item.height = 86; + Item.width = 86; + Item.height = 98; Item.damage = 105; Item.DamageType = DamageClass.Melee; Item.useAnimation = 22; diff --git a/Items/Weapons/Melee/BalefulHarvester.png b/Items/Weapons/Melee/BalefulHarvester.png index 7b97d34b12..360c99acaf 100644 Binary files a/Items/Weapons/Melee/BalefulHarvester.png and b/Items/Weapons/Melee/BalefulHarvester.png differ diff --git a/Items/Weapons/Melee/Exoblade.cs b/Items/Weapons/Melee/Exoblade.cs index 3b47ca0784..f531b3b86b 100644 --- a/Items/Weapons/Melee/Exoblade.cs +++ b/Items/Weapons/Melee/Exoblade.cs @@ -138,7 +138,7 @@ namespace CalamityMod.Items.Weapons.Melee 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/ExobladeGlow").Value); + Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, Request("CalamityMod/Items/Weapons/Melee/ExobladeGlow").Value); } public override void AddRecipes() diff --git a/Items/Weapons/Rogue/TheFinalDawn.cs b/Items/Weapons/Rogue/TheFinalDawn.cs index 45f45c9fe6..833894bfcf 100644 --- a/Items/Weapons/Rogue/TheFinalDawn.cs +++ b/Items/Weapons/Rogue/TheFinalDawn.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.knockBack = 4; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.rare = ModContent.RarityType(); + Item.rare = RarityType(); Item.Calamity().donorItem = true; Item.autoReuse = false; diff --git a/Items/Weapons/Summon/Cnidarian.cs b/Items/Weapons/Summon/Cnidarian.cs index 836c151c26..01f80f495b 100644 --- a/Items/Weapons/Summon/Cnidarian.cs +++ b/Items/Weapons/Summon/Cnidarian.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.channel = true; Item.noMelee = true; - Item.shoot = ModContent.ProjectileType(); + Item.shoot = ProjectileType(); Item.shootSpeed = 10f; Item.rare = ItemRarityID.Green; @@ -124,7 +124,7 @@ namespace CalamityMod.Items.Weapons.Summon public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale) { - Texture2D properSprite = ModContent.Request("CalamityMod/Items/Weapons/Summon/Cnidarian").Value; + Texture2D properSprite = Request("CalamityMod/Items/Weapons/Summon/Cnidarian").Value; spriteBatch.DrawNewInventorySprite(properSprite, new Vector2(42f, 34), position, drawColor, origin, scale); return false; @@ -132,7 +132,7 @@ namespace CalamityMod.Items.Weapons.Summon public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) { - Texture2D properSprite = ModContent.Request("CalamityMod/Items/Weapons/Summon/Cnidarian").Value; + Texture2D properSprite = Request("CalamityMod/Items/Weapons/Summon/Cnidarian").Value; spriteBatch.Draw(properSprite, Item.position - Main.screenPosition, null, lightColor, rotation, properSprite.Size() / 2f, scale, 0, 0); return false; diff --git a/Localization/en-US/Mods.CalamityMod.Buffs.hjson b/Localization/en-US/Mods.CalamityMod.Buffs.hjson index ea27c983df..70b4668f2e 100644 --- a/Localization/en-US/Mods.CalamityMod.Buffs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Buffs.hjson @@ -597,11 +597,6 @@ SulphurskinBuff: { Description: The sulphuric waters have a lesser effect on you } -TeslaBuff: { - DisplayName: Tesla's Electricity - Description: Summons an aura of electricity -} - WeaponImbueBrimstone: { DisplayName: Weapon Imbue: Brimstone Description: Melee, Whip, and Rogue attacks ignite enemies with brimstone flames @@ -785,7 +780,7 @@ KamiBuff: { Mushy: { DisplayName: Mushy - Description: Increased defense by 6 and life regen by 1HP/s + Description: Increased defense by 8 and life regen by 1HP/s } PhantomicEmpowerment: { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index 2d25735a42..fb7688267f 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -103,10 +103,10 @@ AmalgamatedBrain: { DisplayName: Amalgamated Brain Tooltip: ''' - 10% increased damage - Shade rains down and enemies are confused when hit, - and summon damage and crit chance are boosted by 10% + 5% increased damage + Shade rains down and enemies are confused when hit Grants the ability to dodge attacks + After dodging, summon damage and crit chance are boosted by 10% ''' HoldShiftTooltip: ''' @@ -129,14 +129,14 @@ AmbrosialAmpoule: { ''' } -AmidiasPendant: { - DisplayName: Amidias' Pendant - Tooltip: Periodically rains down prism shards that briefly stun enemies -} - AmidiasSpark: { DisplayName: Amidias' Spark - Tooltip: Taking damage releases a blast of sparks + Tooltip: + ''' + Attacks inflict Static Discharge while underwater + Taking damage causes the enemy to be shocked + Shocked enemies constantly release sparks + ''' } AncientFossil: { @@ -359,7 +359,7 @@ BlunderBooster: { 12% increased rogue damage and 15% increased rogue projectile velocity Stealth generates 10% faster Summons a red lightning aura around the player that electrifies nearby enemies - The aura's appearance can be toggled with visibility + The aura has reduced opacity if visibility is disabled Press [KEY] to consume 25% of your maximum stealth to perform a swift upwards diagonal dash This dash leaves a trail of red lightning bolts This effect has a 1 second cooldown before it can be used again @@ -808,8 +808,8 @@ FungalSymbiote: { Tooltip: ''' You grow mushrooms on the grass beneath you - Consuming mushrooms provides the Mushy buff, granting 6 defense and +1 HP/s life regen - All mushroom-based weapons deal 10% more damage and emit harmless mushrooms + Consuming mushrooms provides the Mushy buff, granting 8 defense and +1 HP/s life regen + 10% increased damage while you have the Mushy buff ''' } @@ -819,7 +819,7 @@ GiantPearl: { ''' You have a light aura around you Enemies within the aura are slowed down - Does not work while a boss is alive + You release homing prism shards while an enemy is slowed Provides a small amount of light in the abyss ''' } @@ -1754,6 +1754,16 @@ SupremeBaitTackleBoxFishingStation: { ''' } +TeslasAmulet: { + DisplayName: Tesla's Amulet + Tooltip: + ''' + Generates an electrifying field that slows enemies + The field has reduced opacity if visibility is disabled + Reduces the duration of the Static Discharge debuff + ''' +} + TheAbsorber: { DisplayName: The Absorber Tooltip: @@ -1863,10 +1873,11 @@ TheTransformer: { DisplayName: The Transformer Tooltip: ''' - Multiplies all electric debuff damage by 1.5 - Taking damage releases a blast of sparks - Complete immunity to Electrified and all electric attacks - You take halved damage from enemy bullets and reflect them for 800% damage + Multiplies all electricity debuff damage by 1.5x + Attacks inflict Static Discharge while underwater + Reduces the damage of all electricity debuffs by 50% + Taking damage causes the enemy to be shocked + Shocked enemies constantly release sparks ''' } @@ -2027,9 +2038,9 @@ CrystalHeartVodka: { Tooltip: "'Tastes like strawberry cream liqueur (and estrogen)'" } -CocosFeather: { - DisplayName: Coco's Feather - Tooltip: "" +GhostBracelet: { + DisplayName: Ghost Bracelet + Tooltip: Wow.... It looks at me with its hollow eyes full of curiosity } HapuFruit: { @@ -2050,8 +2061,3 @@ Popo: { 'Don't let the demons steal your nose' ''' } - -RedBow: { - DisplayName: Red Bow - Tooltip: "'Pelusa's favorite bow'" -} diff --git a/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson b/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson index 11566009ab..d3c1dfc482 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson @@ -46,7 +46,7 @@ UrsaSergeant: { Attacks maul enemies with astral claw swipes Taking damage reduces the cooldown, but inflicts you with Astral Infection Enemy kills also reduce the cooldown - Swipes will be opaque and produce no sound if visibility is disabled + Swipes will be translucent and silent if visibility is disabled ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson index 4a904bb8a6..b6c818e2e0 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson @@ -3095,6 +3095,11 @@ LivingHolyFireBlock: { Tooltip: "" } +LivingPlagueFireBlock: { + DisplayName: Living Plague Fire Block + Tooltip: "" +} + DraedonExoSelectMusicBox: { DisplayName: Music Box (Exo Mech Selection) Tooltip: Plays 'Signal Received' by CDMusic diff --git a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson index 295ba11731..bcbcf33076 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Potions.hjson @@ -155,15 +155,6 @@ SupremeManaPotion: { Tooltip: "" } -TeslaPotion: { - DisplayName: Tesla Potion - Tooltip: - ''' - Summons an aura of electricity that electrifies and slows enemies - Aura damage is reduced on bosses - ''' -} - ZenPotion: { DisplayName: Zen Potion Tooltip: Vastly decreases enemy spawn rate diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson index 8c4fbd7b25..ac617a0f5e 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson @@ -723,7 +723,11 @@ SanguineFlare: { SeethingDischarge: { DisplayName: Seething Discharge - Tooltip: Fires a barrage of brimstone blasts + Tooltip: + ''' + Fires an accelerating arc of brimstone hellblasts + Every third attack spawns a brimstone dart ring which chases after foes + ''' } Serpentine: { diff --git a/Localization/en-US/Mods.CalamityMod.NPCs.hjson b/Localization/en-US/Mods.CalamityMod.NPCs.hjson index 811944daa8..47396ea6f7 100644 --- a/Localization/en-US/Mods.CalamityMod.NPCs.hjson +++ b/Localization/en-US/Mods.CalamityMod.NPCs.hjson @@ -579,7 +579,7 @@ THIEF: { LikeNPC: "{NPCName} doesn't only keep spiky balls in his pockets, he keeps a ton of cash! He's too absentminded to notice I'm stealing from him too! I like that a lot!" DislikeNPC: What a goody two shoes, {NPCName} is! I dislike her out of principle! …And because she has almost no material goods. LikeNPC_Princess: I couldn't bear to steal anything from {NPCName}, she's so cute! - Princess_LovesNPC: "{NPCName} gifts me with nice exact replicas of other's things, I wonder how she does it!" + Princess_LovesNPC: "{NPCName} gifts me with nice exact replicas of other's things, I wonder how they do it!" } } diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Boss.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Boss.hjson index bfc7b09788..a457e9850c 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Boss.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Boss.hjson @@ -81,7 +81,7 @@ HolyFlare.DisplayName: Holy Flare HolyLight.DisplayName: Holy Light HolySpear.DisplayName: Holy Spear HomingGasBulb.DisplayName: Homing Gas Bulb -HomingGasBulbSporeGas.DisplayName: Homing Gas Bulb Spore Gas +HomingGasBulbSporeGas.DisplayName: Spore Bulb Gas IceBlast.DisplayName: Ice Blast IceBomb.DisplayName: Ice Bomb IceRain.DisplayName: Ice Rain diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson index 2ca20a426c..2a9058f92e 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson @@ -76,6 +76,7 @@ DeepWounderWater.DisplayName: Water Droplet DesecratedBubble.DisplayName: Desecrated Bubble DesecratedWaterProj.DisplayName: Desecrated Water DestructionBolt.DisplayName: Destruction Bolt +DestructionExplosion.DisplayName: Destruction Explosion DestructionStar.DisplayName: Star of Destruction DragonScalesInfernado.DisplayName: Infernado DragonShit.DisplayName: Fire @@ -328,4 +329,3 @@ WrathwingCinder.DisplayName: Wrathwing Eruption WrathwingFireball.DisplayName: Wrathwing Fireball WrathwingSpear.DisplayName: Wrathwing WulfrumKnifeProj.DisplayName: Wulfrum Knife -DestructionExplosion.DisplayName: Destruction Explosion diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson index 259341d807..8164b6f19c 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Typeless.hjson @@ -89,9 +89,7 @@ OmegaBlueTentacle.DisplayName: Omega Blue Tentacle OnyxLabSeeker.DisplayName: Seeking Mechanism PauldronDash.DisplayName: Pauldron Dash PauldronExplosion.DisplayName: Pauldron Explosion -PendantProjectile1.DisplayName: Prism Shard -PendantProjectile2.DisplayName: Prism Shard -PendantProjectile3.DisplayName: Prism Shard +PearlAuraShard.DisplayName: Prism Shard PlaguePulse.DisplayName: Plague Pulse PoisonousSeawater.DisplayName: Seawater PscTransformAnimation.DisplayName: Psc Transform Animation diff --git a/Localization/en-US/Mods.CalamityMod.Status.Death.hjson b/Localization/en-US/Mods.CalamityMod.Status.Death.hjson index 040a177b97..abbae0cd9d 100644 --- a/Localization/en-US/Mods.CalamityMod.Status.Death.hjson +++ b/Localization/en-US/Mods.CalamityMod.Status.Death.hjson @@ -3,7 +3,6 @@ AbyssDrown2: Oxygen failed to reach {0} from the depths of the Abyss. AbyssDrown3: "{0} faded away, lost in the dark waters." AlcoholBig1: "{0} downed too many shots." AlcoholBig2: "{0}'s liver failed." -AlcoholSmall: "{0} succumbed to alcohol sickness." Armageddon: "{0} failed the challenge at hand." AstralInfection1: "{0}'s infection spread too far." AstralInfection2: "{0}'s skin was replaced by the astral virus." diff --git a/Localization/en-US/Mods.CalamityMod.UI.hjson b/Localization/en-US/Mods.CalamityMod.UI.hjson index 190c786713..b52c15e978 100644 --- a/Localization/en-US/Mods.CalamityMod.UI.hjson +++ b/Localization/en-US/Mods.CalamityMod.UI.hjson @@ -80,6 +80,7 @@ ExtensionName: { // Cooldowns Cooldowns: { AquaticHeartIceShield: Ice Shield Cooldown + ArsenalPower: Arsenal Cooldown AscendEffect: Ascension Cooldown BloodflareFrenzy: Blood Frenzy Cooldown BloodflareRangedSet: Bloodflare Soul Cooldown diff --git a/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson b/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson index 3e221f5442..e7a5ceade6 100644 --- a/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson +++ b/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson @@ -37,7 +37,7 @@ SetBonus: { ''' Eskimo: ''' - Multiplies all cold-based debuff damage by 1.25 + Multiplies all cold-based debuff damage by 1.25x Cold enemies will deal reduced contact damage to the player Provides immunity to the Chilled, Frozen, Frostburn and Glacial State debuffs ''' diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 73ab93575a..1ec0ce7533 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -1074,8 +1074,8 @@ namespace CalamityMod double Damage(DamageClass damageClass) => Math.Round(Main.LocalPlayer.GetTotalDamage(damageClass).Additive * Main.LocalPlayer.GetTotalDamage(damageClass).Multiplicative * 100 - 100); int Crit(DamageClass damageClass) => (int)Main.LocalPlayer.GetTotalCritChance(damageClass); - int rogueItem = ModContent.ItemType(); - DamageClass rogueDamageClass = ModContent.GetInstance(); + int rogueItem = ItemType(); + DamageClass rogueDamageClass = GetInstance(); Func rogueDamage = () => $"Rogue Damage: {Damage(rogueDamageClass)}%"; Func rogueCrit = () => $"Rogue Critical: {Crit(rogueDamageClass)}%"; fargos.Call("AddStat", rogueItem, rogueDamage); diff --git a/NPCs/Abyss/SlabCrab.cs b/NPCs/Abyss/SlabCrab.cs index 14a0dbf9f7..1e5192ee43 100644 --- a/NPCs/Abyss/SlabCrab.cs +++ b/NPCs/Abyss/SlabCrab.cs @@ -91,8 +91,8 @@ namespace CalamityMod.NPCs.Abyss public override void SendExtraAI(BinaryWriter writer) { - writer.Write(NPC.localAI[0]); writer.Write(playerCrossed); + writer.Write(NPC.localAI[0]); } public override void ReceiveExtraAI(BinaryReader reader) diff --git a/NPCs/AcidRain/NuclearTerror.cs b/NPCs/AcidRain/NuclearTerror.cs index c3455067f5..40ebfeb51d 100644 --- a/NPCs/AcidRain/NuclearTerror.cs +++ b/NPCs/AcidRain/NuclearTerror.cs @@ -156,8 +156,8 @@ namespace CalamityMod.NPCs.AcidRain hasDoneDeathray = reader.ReadBoolean(); AttackIndex = reader.ReadInt32(); DelayTime = reader.ReadInt32(); - DeathrayTime = reader.ReadInt32(); JumpTimer = reader.ReadSingle(); + DeathrayTime = reader.ReadInt32(); ShootPosition = reader.ReadVector2(); } diff --git a/NPCs/BrimstoneElemental/BrimstoneElemental.cs b/NPCs/BrimstoneElemental/BrimstoneElemental.cs index 6931c0d21c..89f96d85b8 100644 --- a/NPCs/BrimstoneElemental/BrimstoneElemental.cs +++ b/NPCs/BrimstoneElemental/BrimstoneElemental.cs @@ -112,8 +112,8 @@ namespace CalamityMod.NPCs.BrimstoneElemental public override void ReceiveExtraAI(BinaryReader reader) { - NPC.chaseable = reader.ReadBoolean(); currentMode = reader.ReadInt32(); + NPC.chaseable = reader.ReadBoolean(); NPC.localAI[0] = reader.ReadSingle(); NPC.localAI[1] = reader.ReadSingle(); NPC.localAI[3] = reader.ReadSingle(); diff --git a/NPCs/CalClone/SoulSeeker.cs b/NPCs/CalClone/SoulSeeker.cs index 2896c962f3..40fa624d73 100644 --- a/NPCs/CalClone/SoulSeeker.cs +++ b/NPCs/CalClone/SoulSeeker.cs @@ -130,6 +130,7 @@ namespace CalamityMod.NPCs.CalClone double dist = death ? 180 : 150; NPC.position.X = parent.Center.X - (int)(Math.Cos(rad) * dist) - NPC.width / 2; NPC.position.Y = parent.Center.Y - (int)(Math.Sin(rad) * dist) - NPC.height / 2; + NPC.velocity = Vector2.Zero; NPC.ai[1] += death ? 0.5f : 2f; return false; } diff --git a/NPCs/CalamityAIs/CalamityBossAIs/OldDukeAI.cs b/NPCs/CalamityAIs/CalamityBossAIs/OldDukeAI.cs index 214a023c11..ad6d55af05 100644 --- a/NPCs/CalamityAIs/CalamityBossAIs/OldDukeAI.cs +++ b/NPCs/CalamityAIs/CalamityBossAIs/OldDukeAI.cs @@ -47,11 +47,12 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityBossAIs bool revenge = CalamityWorld.revenge || bossRush; bool death = CalamityWorld.death || bossRush; - float exhaustionGateValue = 300f; + float exhaustionGateValue = 360f; if (Main.getGoodWorld) exhaustionGateValue *= 0.5f; - float exhaustionIncreasePerAttack = exhaustionGateValue * 0.1f; + float numberOfAttacksBeforeExhaustion = 12f; + float exhaustionIncreasePerAttack = exhaustionGateValue * (1f / numberOfAttacksBeforeExhaustion); bool exhausted = calamityGlobalNPC.newAI[1] == 1f; bool phase2 = lifeRatio <= (death ? 0.8f : revenge ? 0.7f : 0.5f); bool phase3 = lifeRatio <= (death ? 0.5f : (revenge ? 0.35f : 0.2f)) && expertMode; diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 2622f4f05e..4ba4732196 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -246,6 +246,7 @@ namespace CalamityMod.NPCs public int slowed = 0; public int electrified = 0; public int pearlAura = 0; + public int pearlAuraCounter = 0; public int bBlood = 0; public int brainRot = 0; public int laceration = 0; @@ -282,6 +283,8 @@ namespace CalamityMod.NPCs public int astralInfection = 0; public int wDeath = 0; public int nightwither = 0; + public int shocked = 0; + public int transformerShocked = 0; public int voidfrost = 0; public int shellfishVore = 0; public int clamDebuff = 0; @@ -471,6 +474,7 @@ namespace CalamityMod.NPCs myClone.slowed = slowed; myClone.electrified = electrified; myClone.pearlAura = pearlAura; + myClone.pearlAuraCounter = pearlAuraCounter; myClone.bBlood = bBlood; myClone.brainRot = brainRot; myClone.laceration = laceration; @@ -503,6 +507,8 @@ namespace CalamityMod.NPCs myClone.astralInfection = astralInfection; myClone.wDeath = wDeath; myClone.nightwither = nightwither; + myClone.shocked = shocked; + myClone.transformerShocked = transformerShocked; myClone.voidfrost = voidfrost; myClone.shellfishVore = shellfishVore; myClone.clamDebuff = clamDebuff; @@ -1447,7 +1453,7 @@ namespace CalamityMod.NPCs npc.scale *= Main.zenithWorld ? 2f : CalamityWorld.death ? 1.4f : 1.2f; } - else if (npc.type == NPCID.SkeletronPrime || npc.type == ModContent.NPCType()) + else if (npc.type == NPCID.SkeletronPrime || npc.type == NPCType()) { // HP boosted in Master Mode due to having two heads (piercing can make them die faster than normal here since they share an HP bar) npc.lifeMax = (int)Math.Round(npc.lifeMax * (Main.masterMode ? 1.7 : 1.2)); @@ -1458,7 +1464,7 @@ namespace CalamityMod.NPCs npc.lifeMax = (int)Math.Round(npc.lifeMax * 0.65); npc.scale = 1.2f; } - else if (npc.type == NPCID.Retinazer || npc.type == NPCID.Spazmatism || npc.type == ModContent.NPCType()) + else if (npc.type == NPCID.Retinazer || npc.type == NPCID.Spazmatism || npc.type == NPCType()) { npc.lifeMax = (int)Math.Round(npc.lifeMax * 1.2); npc.npcSlots = 10f; @@ -2471,7 +2477,7 @@ namespace CalamityMod.NPCs { if (!NPC.downedMechBossAny) { - if (CalamityLists.DestroyerIDs.Contains(npc.type) || npc.type == NPCID.Probe || CalamityLists.SkeletronPrimeIDs.Contains(npc.type) || npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer || npc.type == ModContent.NPCType()) + if (CalamityLists.DestroyerIDs.Contains(npc.type) || npc.type == NPCID.Probe || CalamityLists.SkeletronPrimeIDs.Contains(npc.type) || npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer || npc.type == NPCType()) { double multiplier = Main.expertMode ? EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert : EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Classic; npc.lifeMax = (int)Math.Round(npc.lifeMax * multiplier); @@ -2481,7 +2487,7 @@ namespace CalamityMod.NPCs } else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) { - if (CalamityLists.DestroyerIDs.Contains(npc.type) || npc.type == NPCID.Probe || CalamityLists.SkeletronPrimeIDs.Contains(npc.type) || npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer || npc.type == ModContent.NPCType()) + if (CalamityLists.DestroyerIDs.Contains(npc.type) || npc.type == NPCID.Probe || CalamityLists.SkeletronPrimeIDs.Contains(npc.type) || npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer || npc.type == NPCType()) { double multiplier = Main.expertMode ? EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert : EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Classic; npc.lifeMax = (int)Math.Round(npc.lifeMax * multiplier); @@ -3432,7 +3438,7 @@ namespace CalamityMod.NPCs public override bool PreAI(NPC npc) { // Change Spaz and Ret weaknesses and resistances when phase 2 starts. - if (npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer || npc.type == ModContent.NPCType()) + if (npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer || npc.type == NPCType()) { if (npc.ai[0] >= 2f) { @@ -5142,6 +5148,9 @@ namespace CalamityMod.NPCs npc.ai[3] = 0f; } + // Incremement Giant Pearl's pearl shard counter + pearlAuraCounter++; + // Debuff decrements if (debuffResistanceTimer > 0) debuffResistanceTimer--; @@ -5220,6 +5229,10 @@ namespace CalamityMod.NPCs wDeath--; if (nightwither > 0) nightwither--; + if (shocked > 0) + shocked--; + if (transformerShocked > 0) + transformerShocked--; if (voidfrost > 0) voidfrost--; if (shellfishVore > 0) @@ -5230,8 +5243,6 @@ namespace CalamityMod.NPCs sulphurPoison--; if (sagePoisonTime > 0) sagePoisonTime--; - if (kamiFlu > 0) - kamiFlu--; if (relicOfResilienceCooldown > 0) relicOfResilienceCooldown--; if (relicOfResilienceWeakness > 0) @@ -5263,11 +5274,9 @@ namespace CalamityMod.NPCs Particle sparks = new LineParticle(npc.Center, new Vector2(Main.rand.NextFloat(-9f, 9f), Main.rand.NextFloat(-9f, 9f)), false, 45, 0.9f, Main.rand.NextBool() ? Color.Cyan : Color.SkyBlue); GeneralParticleHandler.SpawnParticle(sparks); } - //Particle boop = new CustomPulse(npc.Center, Vector2.Zero, new Color(233, 95, 212), "CalamityMod/Particles/Sparkle2", Vector2.One, Main.rand.NextFloat(-5f, 5f), 0.8f + (float)(0.04 * veriumDoomStacks), 1.6f + (float)(0.08 * veriumDoomStacks), 40); - //GeneralParticleHandler.SpawnParticle(boop); SoundEngine.PlaySound(new("CalamityMod/Sounds/NPCHit/CryogenHit", 3) { Volume = 0.6f }, npc.Center); - Projectile.NewProjectile(npc.GetSource_FromThis(), npc.Center, Vector2.Zero, ModContent.ProjectileType(), 100 + (15 * veriumDoomStacks), 0, Main.myPlayer, 200f); + Projectile.NewProjectile(npc.GetSource_FromThis(), npc.Center, Vector2.Zero, ProjectileType(), 100 + (15 * veriumDoomStacks), 0, Main.myPlayer, 200f); veriumDoomMarked = false; veriumDoomStacks = 0; @@ -5323,10 +5332,43 @@ namespace CalamityMod.NPCs } } - if (!CalamityPlayer.areThereAnyDamnBosses && !CalamityLists.enemyImmunityList.Contains(npc.type)) + if (pearlAura > 0) { - if (pearlAura > 0) - npc.velocity *= 0.9f; + // Slow the enemy + npc.velocity *= 0.9f; + + // Spawn pearl shards on a counter + if (pearlAuraCounter % 12 == 0) + { + SoundEngine.PlaySound(SoundID.Item49, Main.LocalPlayer.Center); + Vector2 shardVel = Vector2.UnitX.RotatedByRandom(MathHelper.Pi) * 7.5f; + int damage = 20; + Projectile.NewProjectile(npc.GetSource_FromThis(), Main.LocalPlayer.Center, shardVel, ProjectileType(), damage, 5f, Main.myPlayer); + } + } + + if (shocked > 0 || transformerShocked > 0) + { + var player = Main.LocalPlayer; + bool strongerShock = transformerShocked > 0; + + int frequency = strongerShock ? 10 : 12; + + // Spawn sparks from the enemy + if (player.miscCounter % frequency == 0) + { + int sDamage = strongerShock ? 50 : 10; + Vector2 velocity = Vector2.UnitX.RotatedByRandom(MathHelper.Pi) * 5f; + Projectile spark = Projectile.NewProjectileDirect(npc.GetSource_FromThis(), npc.Center, velocity, ProjectileType(), sDamage, 0f, player.whoAmI, 0f, 1f); + spark.timeLeft = 120; + spark.penetrate = 3; + if (strongerShock) + { + spark.timeLeft = 240; + spark.extraUpdates = 1; + spark.penetrate = 10; + } + } } // Auric Ore/Repulsers reject Town NPCs and dummies (Auric Land Mines work on them too) @@ -5391,7 +5433,7 @@ namespace CalamityMod.NPCs SoundEngine.PlaySound(explode with { Pitch = 0.8f }, touchedTile.ToWorldCoordinates()); GenericSparkle sparker = new GenericSparkle(touchedTile.ToWorldCoordinates(), Vector2.Zero, Color.Goldenrod, Color.Gold, 2.5f, 9, Main.rand.NextFloat(-0.01f, 0.01f), 2.68f); GeneralParticleHandler.SpawnParticle(sparker); - Projectile.NewProjectile(new EntitySource_TileInteraction(npc, touchedTile.X, touchedTile.Y), touchedTile.ToWorldCoordinates(), Vector2.Zero, ModContent.ProjectileType(), 40000, 0f); + Projectile.NewProjectile(new EntitySource_TileInteraction(npc, touchedTile.X, touchedTile.Y), touchedTile.ToWorldCoordinates(), Vector2.Zero, ProjectileType(), 40000, 0f); WorldGen.KillTile(touchedTile.X, touchedTile.Y, noItem: true); continue; } @@ -5413,7 +5455,7 @@ namespace CalamityMod.NPCs if (tile.TileType == auricOreID) { npc.SimpleStrikeNPC((int)(npc.lifeMax * 0.2f), 0); - npc.AddBuff(ModContent.BuffType(), 120); + npc.AddBuff(BuffType(), 120); } SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/ExoMechs/TeslaShoot1"), npc.Center); break; @@ -5431,6 +5473,14 @@ namespace CalamityMod.NPCs if (target.Calamity().sulphurSet) npc.AddBuff(BuffID.Poisoned, 60); + if (target.Calamity().aSpark) + { + if (target.Calamity().transformer) + transformerShocked = 120; + else + shocked = 120; + } + if (target.Calamity().snowman) { if (npc.type == NPCID.Demon || npc.type == NPCID.VoodooDemon || npc.type == NPCID.RedDevil) @@ -5870,7 +5920,7 @@ namespace CalamityMod.NPCs for (int i = 0; i < Main.maxNPCs; i++) { NPC nPC = Main.npc[i]; - if (nPC.active && nPC.type == ModContent.NPCType() && nPC.life > 0) + if (nPC.active && nPC.type == NPCType() && nPC.life > 0) { nPC.life = 0; nPC.HitEffect(); @@ -5935,7 +5985,7 @@ namespace CalamityMod.NPCs if (npc.life <= 0) { if (Main.netMode != NetmodeID.MultiplayerClient) - NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.position.X + (float)(npc.width / 2)), (int)(npc.position.Y + (float)npc.height), ModContent.NPCType()); + NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.position.X + (float)(npc.width / 2)), (int)(npc.position.Y + (float)npc.height), NPCType()); } break; @@ -6477,7 +6527,7 @@ namespace CalamityMod.NPCs { if (CalamityWorld.revenge || BossRushEvent.BossRushActive) { - if (npc.type == NPCID.SkeletronPrime || npc.type == ModContent.NPCType()) + if (npc.type == NPCID.SkeletronPrime || npc.type == NPCType()) npc.frameCounter = 0D; } } @@ -6541,6 +6591,9 @@ namespace CalamityMod.NPCs if (nightwither > 0) Nightwither.DrawEffects(npc, ref drawColor); + if (pearlAura > 0) + PearlAura.DrawEffects(npc, ref drawColor); + if (voidfrost > 0) Voidfrost.DrawEffects(npc, ref drawColor); @@ -6692,7 +6745,7 @@ namespace CalamityMod.NPCs drawColor = Color.Fuchsia; else if (pearlAura > 0) - drawColor = Color.White; + drawColor = new Color(185, 185, 255); else if (timeSlow > 0 || tesla > 0) drawColor = Color.Aquamarine; @@ -6708,7 +6761,7 @@ namespace CalamityMod.NPCs return new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, Main.DiscoR); if (npc.type == NPCID.KingSlime && Main.masterMode && CalamityWorld.revenge) - return NPC.AnyNPCs(ModContent.NPCType()) ? Color.Lerp(new Color(0, 0, 150, npc.alpha), new Color(125, 125, 255, npc.alpha), (float)Math.Sin(Main.GlobalTimeWrappedHourly) / 2f + 0.5f) : null; + return NPC.AnyNPCs(NPCType()) ? Color.Lerp(new Color(0, 0, 150, npc.alpha), new Color(125, 125, 255, npc.alpha), (float)Math.Sin(Main.GlobalTimeWrappedHourly) / 2f + 0.5f) : null; if (npc.type == NPCID.QueenBee && Main.zenithWorld) { @@ -6907,7 +6960,7 @@ namespace CalamityMod.NPCs if (CalamityWorld.revenge || BossRushEvent.BossRushActive) { - if (npc.type == NPCID.SkeletronPrime || npc.type == ModContent.NPCType() || CalamityLists.DestroyerIDs.Contains(npc.type)) + if (npc.type == NPCID.SkeletronPrime || npc.type == NPCType() || CalamityLists.DestroyerIDs.Contains(npc.type)) return false; } @@ -7681,7 +7734,7 @@ namespace CalamityMod.NPCs } // His afterimages I can't get to work, so fuck it - else if (npc.type == NPCID.SkeletronPrime || npc.type == ModContent.NPCType()) + else if (npc.type == NPCID.SkeletronPrime || npc.type == NPCType()) { Texture2D npcTexture = (masterMode && revenge && npc.type == NPCID.SkeletronPrime) ? CalamityMod.ChadPrime.Value : TextureAssets.Npc[npc.type].Value; int frameHeight = npcTexture.Height / Main.npcFrameCount[npc.type]; diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index ffd619919b..3e7777ce5d 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -465,6 +465,11 @@ namespace CalamityMod.NPCs case NPCID.TheGroom: npcLoot.Add(ModContent.ItemType(), 10); break; + + // Ghost Bracelet @ 10% (Dandy requests this drops at a "high chance" but inventory clutter is real so) + case NPCID.Ghost: + npcLoot.Add(ModContent.ItemType(), 10); + break; #endregion #region Blood Moon diff --git a/NPCs/CalamityGlobalTownNPC.cs b/NPCs/CalamityGlobalTownNPC.cs index abf91440b3..8048c24997 100644 --- a/NPCs/CalamityGlobalTownNPC.cs +++ b/NPCs/CalamityGlobalTownNPC.cs @@ -170,6 +170,7 @@ namespace CalamityMod.NPCs "Cap'n Deek", // "Alex N" on Patreon (No discord account) "Captain Billy Bones", // <@!699589229507772416> (djackv) "Captain J. Crackers", // <@!233232602994049024> (qyuuno) + "Gol D. Roger", // <@!256228859110752257> (xtra3678) }; private static readonly string[] PrincessNames = { @@ -1000,7 +1001,7 @@ namespace CalamityMod.NPCs break; case NPCID.Wizard: - if (Main.rand.NextBool(6) && !Main.LocalPlayer.InventoryHas(ItemID.RodofDiscord) && !Main.LocalPlayer.InventoryHas(ModContent.ItemType()) && !Main.LocalPlayer.ZoneHallow) + if (Main.rand.NextBool(6) && !Main.LocalPlayer.InventoryHas(ItemID.RodofDiscord) && !Main.LocalPlayer.InventoryHas(ItemType()) && !Main.LocalPlayer.ZoneHallow) chat = CalamityUtils.GetTextValue("Vanilla.WizardChat.MentionRoD"); if (Main.rand.NextBool(10) && Main.hardMode) chat = CalamityUtils.GetTextValue("Vanilla.WizardChat.Hardmode"); @@ -1070,7 +1071,7 @@ namespace CalamityMod.NPCs public override bool? CanBeHitByProjectile(NPC npc, Projectile projectile) { //Not an axe but close enough - if (npc.type == NPCID.TaxCollector && projectile.type == ModContent.ProjectileType()) + if (npc.type == NPCID.TaxCollector && projectile.type == ProjectileType()) return true; return base.CanBeHitByProjectile(npc, projectile); } @@ -1115,7 +1116,7 @@ namespace CalamityMod.NPCs if (type == NPCID.Demolitionist) { - shop.Add(ModContent.ItemType(), Condition.DownedMechBossAny); + shop.Add(ItemType(), Condition.DownedMechBossAny); } if (type == NPCID.ArmsDealer) diff --git a/NPCs/CeaselessVoid/CeaselessVoid.cs b/NPCs/CeaselessVoid/CeaselessVoid.cs index 929abfba7b..3561ac61c7 100644 --- a/NPCs/CeaselessVoid/CeaselessVoid.cs +++ b/NPCs/CeaselessVoid/CeaselessVoid.cs @@ -94,11 +94,11 @@ namespace CalamityMod.NPCs.CeaselessVoid public override void SendExtraAI(BinaryWriter writer) { writer.Write(NPC.dontTakeDamage); + writer.Write(playedbuildsound); writer.Write(NPC.localAI[0]); writer.Write(NPC.localAI[1]); writer.Write(NPC.localAI[2]); writer.Write(NPC.localAI[3]); - writer.Write(playedbuildsound); for (int i = 0; i < 4; i++) writer.Write(NPC.Calamity().newAI[i]); } diff --git a/NPCs/Cryogen/Cryogen.cs b/NPCs/Cryogen/Cryogen.cs index d77b5ef431..0a92d506bf 100644 --- a/NPCs/Cryogen/Cryogen.cs +++ b/NPCs/Cryogen/Cryogen.cs @@ -155,6 +155,7 @@ namespace CalamityMod.NPCs.Cryogen writer.Write(biomeEnrageTimer); writer.Write(teleportLocationX); writer.Write(NPC.dontTakeDamage); + writer.Write(NPC.localAI[1]); for (int i = 0; i < 4; i++) writer.Write(NPC.Calamity().newAI[i]); } @@ -164,6 +165,7 @@ namespace CalamityMod.NPCs.Cryogen biomeEnrageTimer = reader.ReadInt32(); teleportLocationX = reader.ReadInt32(); NPC.dontTakeDamage = reader.ReadBoolean(); + NPC.localAI[1] = reader.ReadSingle(); for (int i = 0; i < 4; i++) NPC.Calamity().newAI[i] = reader.ReadSingle(); } @@ -236,15 +238,18 @@ namespace CalamityMod.NPCs.Cryogen if ((int)NPC.ai[0] + 1 > currentPhase) HandlePhaseTransition((int)NPC.ai[0] + 1); - if (NPC.ai[2] == 0f && NPC.localAI[1] == 0f && Main.netMode != NetmodeID.MultiplayerClient && (NPC.ai[0] < 3f || bossRush || (death && NPC.ai[0] > 3f))) //spawn shield for phase 0 1 2, not 3 4 5 + if (NPC.ai[2] == 0f && NPC.localAI[1] == 0f) { + NPC.localAI[1] = 1f; SoundEngine.PlaySound(ShieldRegenSound, NPC.Center); - int shieldSpawn = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType(), NPC.whoAmI); - NPC.ai[2] = shieldSpawn + 1; - NPC.localAI[1] = -1f; - NPC.netUpdate = true; - Main.npc[shieldSpawn].ai[0] = NPC.whoAmI; - Main.npc[shieldSpawn].netUpdate = true; + if (Main.netMode != NetmodeID.MultiplayerClient) + { + int shieldSpawn = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType(), NPC.whoAmI); + NPC.ai[2] = shieldSpawn + 1; + NPC.netUpdate = true; + Main.npc[shieldSpawn].ai[0] = NPC.whoAmI; + Main.npc[shieldSpawn].netUpdate = true; + } } int shieldTracker = (int)NPC.ai[2] - 1; @@ -256,11 +261,6 @@ namespace CalamityMod.NPCs.Cryogen { NPC.dontTakeDamage = false; NPC.ai[2] = 0f; - - if (NPC.localAI[1] == -1f) - NPC.localAI[1] = death ? 540f : expertMode ? 720f : 1080f; - if (NPC.localAI[1] > 0f) - NPC.localAI[1] -= 1f; } if (CalamityConfig.Instance.BossesStopWeather) @@ -428,6 +428,15 @@ namespace CalamityMod.NPCs.Cryogen NPC.ai[0] = 1f; NPC.localAI[0] = 0f; NPC.netUpdate = true; + + SoundEngine.PlaySound(ShieldRegenSound, NPC.Center); + if (NPC.ai[2] == 0f && Main.netMode != NetmodeID.MultiplayerClient) + { + int shieldSpawn = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType(), NPC.whoAmI); + NPC.ai[2] = shieldSpawn + 1; + Main.npc[shieldSpawn].ai[0] = NPC.whoAmI; + Main.npc[shieldSpawn].netUpdate = true; + } } } else if (NPC.ai[0] == 1f) @@ -617,6 +626,15 @@ namespace CalamityMod.NPCs.Cryogen calamityGlobalNPC.newAI[0] = 0f; calamityGlobalNPC.newAI[2] = 0f; NPC.netUpdate = true; + + SoundEngine.PlaySound(ShieldRegenSound, NPC.Center); + if (NPC.ai[2] == 0f && Main.netMode != NetmodeID.MultiplayerClient) + { + int shieldSpawn = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType(), NPC.whoAmI); + NPC.ai[2] = shieldSpawn + 1; + Main.npc[shieldSpawn].ai[0] = NPC.whoAmI; + Main.npc[shieldSpawn].netUpdate = true; + } } } else if (NPC.ai[0] == 2f) @@ -968,6 +986,18 @@ namespace CalamityMod.NPCs.Cryogen calamityGlobalNPC.newAI[2] = 0f; NPC.netUpdate = true; + if (death) + { + SoundEngine.PlaySound(ShieldRegenSound, NPC.Center); + if (NPC.ai[2] == 0f && Main.netMode != NetmodeID.MultiplayerClient) + { + int shieldSpawn = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType(), NPC.whoAmI); + NPC.ai[2] = shieldSpawn + 1; + Main.npc[shieldSpawn].ai[0] = NPC.whoAmI; + Main.npc[shieldSpawn].netUpdate = true; + } + } + int chance = 100; if (DateTime.Now.Month == 4 && DateTime.Now.Day == 1) chance = 20; diff --git a/NPCs/Cryogen/CryogenShield.cs b/NPCs/Cryogen/CryogenShield.cs index 19e69bdb32..f1fd71ba5d 100644 --- a/NPCs/Cryogen/CryogenShield.cs +++ b/NPCs/Cryogen/CryogenShield.cs @@ -32,11 +32,7 @@ namespace CalamityMod.NPCs.Cryogen NPC.height = 216; NPC.scale *= (CalamityWorld.death || BossRushEvent.BossRushActive || Main.getGoodWorld) ? 0.8f : 1f; NPC.DR_NERD(0.4f); - NPC.lifeMax = CalamityWorld.death ? 700 : 1400; - if (BossRushEvent.BossRushActive) - { - NPC.lifeMax = 10000; - } + NPC.LifeMaxNERB(2800, 3360, 33600); NPC.Opacity = 0f; NPC.HitSound = Cryogen.HitSound; NPC.DeathSound = BreakSound; diff --git a/NPCs/SunkenSea/GiantClam.cs b/NPCs/SunkenSea/GiantClam.cs index 6e520e527b..77ca318ef2 100644 --- a/NPCs/SunkenSea/GiantClam.cs +++ b/NPCs/SunkenSea/GiantClam.cs @@ -574,7 +574,6 @@ namespace CalamityMod.NPCs.SunkenSea // Equipment npcLoot.Add(ModContent.ItemType(), 3); - npcLoot.Add(ModContent.ItemType(), 3); // Trophy npcLoot.Add(ModContent.ItemType(), 10); diff --git a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs index f3b693f785..a5a6484c86 100644 --- a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs +++ b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs @@ -206,6 +206,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float distanceFromSCal = Main.getGoodWorld ? 300f : 225f; NPC.position = SCal.Center - MathHelper.ToRadians(RotationalDegreeOffset).ToRotationVector2() * distanceFromSCal - NPC.Size * 0.5f; + NPC.velocity = Vector2.Zero; RotationalDegreeOffset += 0.5f; } diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs index 180e9d76c1..9321fc2333 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs @@ -622,8 +622,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.localAI[1] += 1f + (death ? (phase2LifeRatio - lifeRatio) / phase2LifeRatio : 0f); if (npc.localAI[1] >= (spazAlive ? (oblivionAlive ? 76f : 52f) : 26f)) { - bool canHit = Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height); - if (canHit || !spazAlive || finalPhase) + if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) { npc.localAI[1] = 0f; float retinazerPhase2LaserSpeed = 10f; @@ -648,16 +647,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses retinazerPhase2TargetY *= retinazerPhase2TargetDist; Vector2 laserVelocity = new Vector2(retinazerPhase2TargetX, retinazerPhase2TargetY); - if (canHit) - { - Projectile.NewProjectile(npc.GetSource_FromAI(), eyePosition + laserVelocity.SafeNormalize(Vector2.UnitY) * 150f, laserVelocity, type, damage, 0f, Main.myPlayer); - } - else - { - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), eyePosition + laserVelocity.SafeNormalize(Vector2.UnitY) * 150f, laserVelocity, type, damage, 0f, Main.myPlayer); - Main.projectile[proj].tileCollide = false; - Main.projectile[proj].timeLeft = 300; - } + Projectile.NewProjectile(npc.GetSource_FromAI(), eyePosition + laserVelocity.SafeNormalize(Vector2.UnitY) * 150f, laserVelocity, type, damage, 0f, Main.myPlayer); } } } @@ -728,8 +718,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.localAI[1] += 1f + (death ? (phase2LifeRatio - lifeRatio) / phase2LifeRatio : 0f); if (npc.localAI[1] > (spazAlive ? (oblivionAlive ? 30f : 20f) : 10f)) { - bool canHit = Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height); - if (canHit || !spazAlive || finalPhase) + if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) { npc.localAI[1] = 0f; int type = ProjectileID.DeathLaser; @@ -752,16 +741,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses retinazerPhase2RapidFireTargetY *= retinazerPhase2RapidFireTargetDist; Vector2 laserVelocity = new Vector2(retinazerPhase2RapidFireTargetX, retinazerPhase2RapidFireTargetY); - if (canHit) - { - Projectile.NewProjectile(npc.GetSource_FromAI(), retinazerPhase2RapidFirePos + laserVelocity.SafeNormalize(Vector2.UnitY) * 150f, laserVelocity, type, damage, 0f, Main.myPlayer); - } - else - { - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), retinazerPhase2RapidFirePos + laserVelocity.SafeNormalize(Vector2.UnitY) * 150f, laserVelocity, type, damage, 0f, Main.myPlayer); - Main.projectile[proj].tileCollide = false; - Main.projectile[proj].timeLeft = 300; - } + Projectile.NewProjectile(npc.GetSource_FromAI(), retinazerPhase2RapidFirePos + laserVelocity.SafeNormalize(Vector2.UnitY) * 150f, laserVelocity, type, damage, 0f, Main.myPlayer); } } } @@ -769,7 +749,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[2] += spazAlive ? 1f : 1.5f; if (npc.ai[2] >= (masterMode ? 150f : 180f) - (death ? (masterMode ? 60f : 90f) * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f)) { - npc.ai[1] = (!spazAlive || finalPhase) ? 4f : 0f; + npc.ai[1] = finalPhase ? 4f : 0f; npc.ai[2] = 0f; npc.ai[3] = 0f; @@ -1103,7 +1083,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Phase HP ratios float phase2LifeRatio = oblivionAlive ? 0.5f : masterMode ? 0.85f : 0.7f; - float finalPhaseLifeRatio = masterMode ? 0.4f : 0.25f; + float finalPhaseLifeRatio = masterMode ? 0.3f : 0.15f; // Movement variables float phase1MaxSpeedIncrease = masterMode ? 2.25f : 4.5f; @@ -1576,15 +1556,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float phaseGateValue = NPC.IsMechQueenUp ? 900f : 180f - (death ? 60f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); if (npc.ai[2] >= phaseGateValue) { - npc.ai[1] = (!retAlive || finalPhase) ? 5f : 1f; + npc.ai[1] = finalPhase ? 5f : 1f; npc.ai[2] = 0f; npc.ai[3] = 0f; npc.netUpdate = true; } // Fire fireballs and flamethrower - bool canHit = Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height); - if (canHit || !retAlive || finalPhase) + if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) { // Play flame sound on timer npc.localAI[2] += 1f; @@ -1642,20 +1621,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } Vector2 flamethrowerVelocity = new Vector2(spazmatismFlamethrowerTargetX, spazmatismFlamethrowerTargetY); - if (canHit) + Projectile.NewProjectile(npc.GetSource_FromAI(), spazmatismFlamethrowerPos + flamethrowerVelocity.SafeNormalize(Vector2.UnitY) * 25f, flamethrowerVelocity, type, damage, 0f, Main.myPlayer); + if (masterMode && npc.ai[3] % 30f == 0f) { - Projectile.NewProjectile(npc.GetSource_FromAI(), spazmatismFlamethrowerPos + flamethrowerVelocity.SafeNormalize(Vector2.UnitY) * 25f, flamethrowerVelocity, type, damage, 0f, Main.myPlayer); - if (masterMode && npc.ai[3] % 30f == 0f) - { - type = npc.ai[3] % 60f == 0f ? ModContent.ProjectileType() : ProjectileID.CursedFlameHostile; - damage = npc.GetProjectileDamage(type); - Projectile.NewProjectile(npc.GetSource_FromAI(), spazmatismFlamethrowerPos + flamethrowerVelocity.SafeNormalize(Vector2.UnitY) * 25f, flamethrowerVelocity * 2f, type, damage, 0f, Main.myPlayer); - } - } - else - { - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), spazmatismFlamethrowerPos + flamethrowerVelocity.SafeNormalize(Vector2.UnitY) * 25f, flamethrowerVelocity, type, damage, 0f, Main.myPlayer); - Main.projectile[proj].tileCollide = false; + type = npc.ai[3] % 60f == 0f ? ModContent.ProjectileType() : ProjectileID.CursedFlameHostile; + damage = npc.GetProjectileDamage(type); + Projectile.NewProjectile(npc.GetSource_FromAI(), spazmatismFlamethrowerPos + flamethrowerVelocity.SafeNormalize(Vector2.UnitY) * 25f, flamethrowerVelocity * 2f, type, damage, 0f, Main.myPlayer); } } } diff --git a/Particles/CustomPulse.cs b/Particles/CustomPulse.cs index a3072597f7..415faf1555 100644 --- a/Particles/CustomPulse.cs +++ b/Particles/CustomPulse.cs @@ -18,11 +18,12 @@ namespace CalamityMod.Particles private string NewTexture; private float OriginalScale; private float FinalScale; + private float BaseOpacity; private float opacity; private Vector2 Squish; private Color BaseColor; - public CustomPulse(Vector2 position, Vector2 velocity, Color color, string texture, Vector2 squish, float rotation, float originalScale, float finalScale, int lifeTime, bool UseAdditiveBlend = true) + public CustomPulse(Vector2 position, Vector2 velocity, Color color, string texture, Vector2 squish, float rotation, float originalScale, float finalScale, int lifeTime, bool UseAdditiveBlend = true, float baseOpacity = 1f) { Position = position; Velocity = velocity; @@ -32,6 +33,7 @@ namespace CalamityMod.Particles FinalScale = finalScale; Scale = originalScale; Lifetime = lifeTime; + BaseOpacity = baseOpacity; Squish = squish; Rotation = rotation; UseAltVisual = UseAdditiveBlend; @@ -42,7 +44,7 @@ namespace CalamityMod.Particles float pulseProgress = PiecewiseAnimation(LifetimeCompletion, new CurveSegment[] { new CurveSegment(EasingType.PolyOut, 0f, 0f, 1f, 4) }); Scale = MathHelper.Lerp(OriginalScale, FinalScale, pulseProgress); - opacity = (float)Math.Sin(MathHelper.PiOver2 + LifetimeCompletion * MathHelper.PiOver2); + opacity = (float)Math.Sin(MathHelper.PiOver2 + LifetimeCompletion * MathHelper.PiOver2) * BaseOpacity; Color = BaseColor * opacity; Lighting.AddLight(Position, Color.R / 255f, Color.G / 255f, Color.B / 255f); diff --git a/Particles/GlowSquareParticle.cs b/Particles/GlowSquareParticle.cs index 586c69e50e..971f7f1995 100644 --- a/Particles/GlowSquareParticle.cs +++ b/Particles/GlowSquareParticle.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Particles spriteBatch.Draw(texture, Position - Main.screenPosition, null, Color, Rotation, texture.Size() * 0.5f, scale, 0, 0f); if (glowCenter) - spriteBatch.Draw(texture, Position - Main.screenPosition, null, Color.White * fadeOut, Rotation, texture.Size() * 0.5f, scale * new Vector2(0.5f, 0.5f), 0, 0f); + spriteBatch.Draw(texture, Position - Main.screenPosition, null, Color.White * fadeOut * 0.7f, Rotation, texture.Size() * 0.5f, scale * new Vector2(0.9f, 0.9f), 0, 0f); } } } diff --git a/Particles/ThunderBoltVFX.cs b/Particles/ThunderBoltVFX.cs index 83b6461954..46aecc9660 100644 --- a/Particles/ThunderBoltVFX.cs +++ b/Particles/ThunderBoltVFX.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using System; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; @@ -12,26 +13,75 @@ namespace CalamityMod.Particles public override bool UseCustomDraw => true; public override bool SetLifetime => true; - public Vector2 Squish; - public float ShakePower; - public float Opacity; - public Projectile AttachedProjectile; - public float DisplacementFromProjectile; + /// + /// The function that decides to follow a specific . + /// + public Func FollowFunction; - public ThunderBoltVFX(Vector2 position, Color color, float rotation, float scale, Vector2 squish, float opacity = 1f, float shakePower = 20f, Projectile projectileToFollow = null, float displacementFromProjectile = 0f) + /// + /// The opacity of this particle, can only go from 0 to 1.
+ /// Defaults to 1. + ///
+ public float Opacity + { + get => opacity; + set => opacity = Math.Clamp(value, 0f, 1f); + } + private float opacity = 1f; + + /// + /// The amount of shaking this particle will have.
+ /// Will always be positive.
+ /// Defaults to 0. + ///
+ public float ShakePower + { + get => shakePower; + set => shakePower = Math.Abs(value); + } + private float shakePower; + + /// + /// The squish of this particle, how much is streched, widened, distorted, etc.
+ /// For standard purposes, it defaults to . + ///
+ public Vector2 Squish = Vector2.One; + + /// + /// A constructor that spawns a particle that does not move from where it spawns. + /// + public ThunderBoltVFX(Vector2 position, float rotation, float scale, Color color, int lifeTime, float shakePower, float opacity = 1f, Vector2? squish = null) { Position = position; - Velocity = Vector2.Zero; - Color = color; - Scale = scale; - Squish = squish; Rotation = rotation; + Scale = scale; + Color = color; Opacity = opacity; + Lifetime = lifeTime; ShakePower = shakePower; - if (projectileToFollow != null) - AttachedProjectile = projectileToFollow; - DisplacementFromProjectile = displacementFromProjectile; - Lifetime = 30; + if (squish != null) + Squish = (Vector2)squish; + } + + /// + /// A constructor that spawns a particle that follows a specific .
+ /// For simple one-line positions, you can just write in the argument, for example:
+ ///
+ /// () => Projectile.Center + /// For more complicated logic to decide which it should follow,
+ /// you'd just make your own function which returns a and give it as an argument. + ///
+ public ThunderBoltVFX(Func followFunction, float rotation, float scale, Color color, int lifeTime, float shakePower, float opacity = 1f, Vector2? squish = null) + { + FollowFunction = followFunction; + Rotation = rotation; + Scale = scale; + Color = color; + Opacity = opacity; + Lifetime = lifeTime; + ShakePower = shakePower; + if (squish != null) + Squish = (Vector2)squish; } public override void Update() @@ -40,9 +90,7 @@ namespace CalamityMod.Particles float fadeFactor = 1f - 0.05f * MathHelper.Clamp((Time - 10) / 10f, 0f, 1f); Opacity *= fadeFactor; Squish.X *= fadeFactor; - - if (AttachedProjectile != null && AttachedProjectile.active) - Position = AttachedProjectile.Center + Vector2.UnitY * DisplacementFromProjectile; + if (FollowFunction is not null) Position = FollowFunction.Invoke(); } public override void CustomDraw(SpriteBatch spriteBatch) diff --git a/Projectiles/Boss/BirbAura.cs b/Projectiles/Boss/BirbAura.cs index 0cf7e9e6ba..5f6e1b731e 100644 --- a/Projectiles/Boss/BirbAura.cs +++ b/Projectiles/Boss/BirbAura.cs @@ -25,8 +25,8 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.width = 80; - Projectile.height = 80; + Projectile.width = 32; + Projectile.height = 32; Projectile.hostile = true; Projectile.alpha = 255; Projectile.penetrate = -1; @@ -76,6 +76,8 @@ namespace CalamityMod.Projectiles.Boss Projectile.Kill(); return; } + if (Projectile.localAI[0] % 4 == 0) + Projectile.frameCounter++; Projectile.scale = (float)Math.Sin(Projectile.localAI[0] * Math.PI / timeBeforeVanish) * 10f * projScale; if (Projectile.scale > projScale) @@ -129,43 +131,47 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { if (Projectile.velocity == Vector2.Zero) - { return false; - } - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; - Texture2D texture2 = ModContent.Request("CalamityMod/ExtraTextures/Lasers/BirbAuraStart", AssetRequestMode.ImmediateLoad).Value; - Texture2D texture3 = ModContent.Request("CalamityMod/ExtraTextures/Lasers/BirbAuraEnd", AssetRequestMode.ImmediateLoad).Value; - float auraDrawLength = Projectile.localAI[1]; //length of laser + + Texture2D middleTex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; + Texture2D endpointTex = ModContent.Request("CalamityMod/ExtraTextures/Lasers/BirbAuraEndpoints", AssetRequestMode.ImmediateLoad).Value; + + // Used to track the animation of the segments + int middleFrame = Projectile.frameCounter % 12; + int endpointFrame = Projectile.frameCounter % 3; + float auraDrawLength = Projectile.localAI[1]; // Length of the laser Color grayColor = new Color(128, 128, 128, 0); - Vector2 vector = Projectile.Center - Main.screenPosition; - Rectangle? sourceRectangle2 = null; - Main.EntitySpriteDraw(texture2, vector, sourceRectangle2, grayColor, Projectile.rotation, texture2.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); - auraDrawLength -= (texture2.Height / 2 + texture3.Height) * Projectile.scale; + + // Draw the bottom endpoint segment + Rectangle? sourceRectangle2 = endpointTex.Frame(1, 3, 0, endpointFrame); + Vector2 endPosition = Projectile.Center - Main.screenPosition - new Vector2(0f, 22f); // Of course it's 22, this stupid fucking accursed number + Main.EntitySpriteDraw(endpointTex, endPosition, sourceRectangle2, grayColor, Projectile.rotation, endpointTex.Frame(1, 1, 0, 0).Top(), Projectile.scale, SpriteEffects.None, 0); + + // Draw the middle segments + auraDrawLength -= (endpointTex.Height / 2 + endpointTex.Height) * Projectile.scale; Vector2 projCenter = Projectile.Center; - projCenter += Projectile.velocity * Projectile.scale * texture2.Height / 2f; - if (auraDrawLength > 0f) + projCenter += Projectile.velocity * Projectile.scale * endpointTex.Height / 2f; + if (auraDrawLength > 0f) // Only draw a middle segment if there's enough height for one { float auraSegment = 0f; - Rectangle drawRectangle = new Rectangle(0, 0, texture.Width, texture.Height); + Rectangle drawRectangle = middleTex.Frame(12, 1, middleFrame, 0); while (auraSegment + 1f < auraDrawLength) { if (auraDrawLength - auraSegment < drawRectangle.Height) { drawRectangle.Height = (int)(auraDrawLength - auraSegment); } - Main.EntitySpriteDraw(texture, projCenter - Main.screenPosition, new Rectangle?(drawRectangle), grayColor, Projectile.rotation, new Vector2(drawRectangle.Width / 2, 0f), Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(middleTex, projCenter - Main.screenPosition, new Rectangle?(drawRectangle), grayColor, Projectile.rotation, new Vector2(drawRectangle.Width / 2, 0f), Projectile.scale, SpriteEffects.None, 0); auraSegment += drawRectangle.Height * Projectile.scale; projCenter += Projectile.velocity * drawRectangle.Height * Projectile.scale; - drawRectangle.Y += texture.Height; - if (drawRectangle.Y + drawRectangle.Height > texture.Height) + drawRectangle.Y += middleTex.Height; + if (drawRectangle.Y + drawRectangle.Height > middleTex.Height) { drawRectangle.Y = 0; } } } - Vector2 vector2 = projCenter - Main.screenPosition; - sourceRectangle2 = null; - Main.EntitySpriteDraw(texture3, vector2, sourceRectangle2, grayColor, Projectile.rotation, texture3.Frame(1, 1, 0, 0).Top(), Projectile.scale, SpriteEffects.None, 0); + // There is intentionally no top endpoint segment drawn return false; } diff --git a/Projectiles/Boss/BirbAura.png b/Projectiles/Boss/BirbAura.png index 3515f6998c..0b6f0a7026 100644 Binary files a/Projectiles/Boss/BirbAura.png and b/Projectiles/Boss/BirbAura.png differ diff --git a/Projectiles/Boss/BrimstoneHellblast2.cs b/Projectiles/Boss/BrimstoneHellblast2.cs index d34e761d03..2056239802 100644 --- a/Projectiles/Boss/BrimstoneHellblast2.cs +++ b/Projectiles/Boss/BrimstoneHellblast2.cs @@ -38,9 +38,9 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { // Cal Clone bullet hell projectiles accelerate after a certain time has passed - if (Projectile.ai[0] == 2f && Main.expertMode && Projectile.timeLeft < 1260) + if (Projectile.ai[0] == 2f && (Main.expertMode || BossRushEvent.BossRushActive) && Projectile.timeLeft < 1260) { - if (Projectile.velocity.Length() < (BossRushEvent.BossRushActive ? 15f : 10f)) + if (Projectile.velocity.Length() < (BossRushEvent.BossRushActive ? 12.5f : 10f)) Projectile.velocity *= 1.005f; } diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index b0f5b94fb5..083e4dcb55 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using CalamityMod.Buffs; using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatBuffs; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.CalPlayer; using CalamityMod.Dusts; @@ -2670,7 +2671,7 @@ namespace CalamityMod.Projectiles { int totalProjectiles = masterMode ? 12 : 8; float radians = MathHelper.TwoPi / totalProjectiles; - int type = ModContent.ProjectileType(); + int type = ProjectileType(); float velocity = 1f; Vector2 spinningPoint = new Vector2(0f, -velocity); for (int k = 0; k < totalProjectiles; k++) @@ -3639,7 +3640,7 @@ namespace CalamityMod.Projectiles if (!projectile.npcProj && !projectile.trap && projectile.friendly && projectile.damage > 0) { - if (modPlayer.fungalSymbiote && CalamityLists.MushroomProjectileIDs.Contains(projectile.type)) + if (modPlayer.fungalSymbiote && player.HasBuff(BuffType())) { if (Main.player[projectile.owner].miscCounter % 6 == 0 && projectile.FinalExtraUpdate()) { @@ -3810,7 +3811,7 @@ namespace CalamityMod.Projectiles } break; case CalamityGlobalBuff.ModdedFlaskEnchant: - int dustType = player.Calamity().flaskHoly ? (Main.rand.NextBool() ? 87 : (int)CalamityDusts.ProfanedFire) : player.Calamity().flaskBrimstone ? (Main.rand.NextBool() ? 114 : ModContent.DustType()) : (Main.rand.NextBool() ? 121 : DustID.Stone); + int dustType = player.Calamity().flaskHoly ? (Main.rand.NextBool() ? 87 : (int)CalamityDusts.ProfanedFire) : player.Calamity().flaskBrimstone ? (Main.rand.NextBool() ? 114 : DustType()) : (Main.rand.NextBool() ? 121 : DustID.Stone); if (Main.rand.NextBool(4)) { Dust dust = Dust.NewDustDirect(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 100, default, Main.rand.NextFloat(0.6f, 0.9f)); @@ -3830,7 +3831,7 @@ namespace CalamityMod.Projectiles { if ((player.Calamity().flaskBrimstone || player.Calamity().flaskCrumbling || player.Calamity().flaskHoly) && !projectile.noEnchantments && !projectile.noEnchantmentVisuals) { - int dustType = player.Calamity().flaskHoly ? (Main.rand.NextBool() ? 87 : (int)CalamityDusts.ProfanedFire) : player.Calamity().flaskBrimstone ? (Main.rand.NextBool() ? 114 : ModContent.DustType()) : (Main.rand.NextBool() ? 121 : DustID.Stone); + int dustType = player.Calamity().flaskHoly ? (Main.rand.NextBool() ? 87 : (int)CalamityDusts.ProfanedFire) : player.Calamity().flaskBrimstone ? (Main.rand.NextBool() ? 114 : DustType()) : (Main.rand.NextBool() ? 121 : DustID.Stone); if (Main.rand.NextBool(player.Calamity().flaskCrumbling ? 5 : 4)) { Dust dust = Dust.NewDustDirect(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 100, default, Main.rand.NextFloat(0.6f, 0.9f)); @@ -3897,7 +3898,7 @@ namespace CalamityMod.Projectiles PointParticle spark = new PointParticle(projectile.Center + projectile.velocity * 3, projectile.velocity, false, 2, 0.9f, Color.Crimson * 0.7f); GeneralParticleHandler.SpawnParticle(spark); - Dust dust = Dust.NewDustPerfect(projectile.Center - projectile.velocity, Main.rand.NextBool(3) ? 90 : ModContent.DustType(), projectile.velocity * Main.rand.NextFloat(0.05f, 0.9f)); + Dust dust = Dust.NewDustPerfect(projectile.Center - projectile.velocity, Main.rand.NextBool(3) ? 90 : DustType(), projectile.velocity * Main.rand.NextFloat(0.05f, 0.9f)); dust.noGravity = true; dust.scale = Main.rand.NextFloat(0.5f, 1f); } @@ -4805,7 +4806,7 @@ namespace CalamityMod.Projectiles int beeType = Main.rand.Next(NPCID.Bee, NPCID.BeeSmall + 1); if (Main.zenithWorld) { - beeType = Main.rand.NextBool(3) ? ModContent.NPCType() : ModContent.NPCType(); + beeType = Main.rand.NextBool(3) ? NPCType() : NPCType(); } else if (Main.masterMode || BossRushEvent.BossRushActive) { diff --git a/Projectiles/Magic/SeethingDischargeBrimstoneBarrage.cs b/Projectiles/Magic/SeethingDischargeBrimstoneBarrage.cs index 098ba4593b..bbd4f3a18e 100644 --- a/Projectiles/Magic/SeethingDischargeBrimstoneBarrage.cs +++ b/Projectiles/Magic/SeethingDischargeBrimstoneBarrage.cs @@ -35,13 +35,15 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { + // Play a sound upon spawning if (Projectile.ai[0] == 0f) { SoundEngine.PlaySound(BrimstoneElemental.DartSound, Projectile.Center); Projectile.ai[0] = 1f; } - if (Math.Abs(Projectile.velocity.X) + Math.Abs(Projectile.velocity.Y) < (Projectile.ai[1] == 1f ? 12f : 16f)) + // Accelerate over time + if ((Math.Abs(Projectile.velocity.X) + Math.Abs(Projectile.velocity.Y) < 16f) && Projectile.ai[1] != 1f) { Projectile.velocity *= 1.01f; } @@ -57,6 +59,30 @@ namespace CalamityMod.Projectiles.Magic Projectile.frame = 0; } Lighting.AddLight(Projectile.Center, 0.75f, 0f, 0f); + + // Seething Discharge darts have weak homing capabilities + if (Projectile.ai[1] == 1f && Projectile.timeLeft < 585) + { + float npcDistCompare = 480f; + int index = -1; + foreach (NPC n in Main.ActiveNPCs) + { + if (!n.CanBeChasedBy(Projectile, false)) + continue; + + float currentNPCDist = Vector2.Distance(n.Center, Projectile.Center); + if (currentNPCDist < npcDistCompare) + { + npcDistCompare = currentNPCDist; + index = n.whoAmI; + } + } + if (index != -1) + { + float homingStrength = Main.rand.NextFloat(0.075f, 0.085f); + Projectile.velocity = Projectile.velocity.ToRotation().AngleTowards(Projectile.SafeDirectionTo(Main.npc[index].Center).ToRotation(), homingStrength).ToRotationVector2() * 12f; + } + } } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 120); diff --git a/Projectiles/Magic/SeethingDischargeBrimstoneHellblast.cs b/Projectiles/Magic/SeethingDischargeBrimstoneHellblast.cs index f43a8400cc..2535e7ee60 100644 --- a/Projectiles/Magic/SeethingDischargeBrimstoneHellblast.cs +++ b/Projectiles/Magic/SeethingDischargeBrimstoneHellblast.cs @@ -30,11 +30,11 @@ namespace CalamityMod.Projectiles.Magic Projectile.DamageType = DamageClass.Magic; Projectile.ignoreWater = true; Projectile.tileCollide = false; - Projectile.penetrate = 4; + Projectile.penetrate = 3; Projectile.timeLeft = 255; Projectile.alpha = 0; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; + Projectile.localNPCHitCooldown = 20; } public override void AI() diff --git a/Projectiles/Magic/Teslabeam.cs b/Projectiles/Magic/Teslabeam.cs index ba7bb2f167..bc5f59087b 100644 --- a/Projectiles/Magic/Teslabeam.cs +++ b/Projectiles/Magic/Teslabeam.cs @@ -61,8 +61,8 @@ namespace CalamityMod.Projectiles.Magic public override void SendExtraAI(BinaryWriter writer) { writer.Write(damageMultiplier); - writer.Write(damageShouldDecay); writer.Write(decayGracePeriod); + writer.Write(damageShouldDecay); } public override void ReceiveExtraAI(BinaryReader reader) diff --git a/Projectiles/Melee/BalefulHarvesterProjectile.cs b/Projectiles/Melee/BalefulHarvesterProjectile.cs index 8855fed60a..f2e5c9157d 100644 --- a/Projectiles/Melee/BalefulHarvesterProjectile.cs +++ b/Projectiles/Melee/BalefulHarvesterProjectile.cs @@ -14,13 +14,11 @@ namespace CalamityMod.Projectiles.Melee { ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - Main.projFrames[Projectile.type] = 5; } public override void SetDefaults() { - Projectile.width = 46; - Projectile.height = 36; + Projectile.width = Projectile.height = 24; Projectile.friendly = true; Projectile.DamageType = DamageClass.Melee; Projectile.penetrate = 1; @@ -46,15 +44,6 @@ namespace CalamityMod.Projectiles.Melee Projectile.alpha = 0; } - Projectile.frameCounter++; - if (Projectile.frameCounter > 6) - { - Projectile.frame++; - Projectile.frameCounter = 0; - } - if (Projectile.frame > 4) - Projectile.frame = 0; - if (Projectile.ai[0] >= 0f && Projectile.ai[0] < 200f) { int npcTracker = (int)Projectile.ai[0]; diff --git a/Projectiles/Melee/BalefulHarvesterProjectile.png b/Projectiles/Melee/BalefulHarvesterProjectile.png index da20d1059b..ed73d2a5f7 100644 Binary files a/Projectiles/Melee/BalefulHarvesterProjectile.png and b/Projectiles/Melee/BalefulHarvesterProjectile.png differ diff --git a/Projectiles/Melee/BladecrestOathswordProj.cs b/Projectiles/Melee/BladecrestOathswordProj.cs index a7d2d28243..b962bf36c3 100644 --- a/Projectiles/Melee/BladecrestOathswordProj.cs +++ b/Projectiles/Melee/BladecrestOathswordProj.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Projectiles.Melee public class BladecrestOathswordProj : BaseIdleHoldoutProjectile { public override LocalizedText DisplayName => CalamityUtils.GetItemName(); - public enum SwingState + public enum SwingState : byte { Default, Swinging @@ -57,14 +57,14 @@ namespace CalamityMod.Projectiles.Melee { writer.Write(Direction); writer.Write(PostSwingRepositionDelay); - writer.Write((int)CurrentState); + writer.Write((byte)CurrentState); } public override void ReceiveExtraAI(BinaryReader reader) { Direction = reader.ReadInt32(); PostSwingRepositionDelay = reader.ReadSingle(); - CurrentState = (SwingState)reader.ReadInt32(); + CurrentState = (SwingState)reader.ReadByte(); } public override void SafeAI() diff --git a/Projectiles/Melee/EarthHoldout.cs b/Projectiles/Melee/EarthHoldout.cs index f7a99cea55..394182dcc3 100644 --- a/Projectiles/Melee/EarthHoldout.cs +++ b/Projectiles/Melee/EarthHoldout.cs @@ -1,17 +1,13 @@ using System; -using CalamityMod.CalPlayer; using CalamityMod.Items.Weapons.Melee; -using CalamityMod.NPCs.PrimordialWyrm; using CalamityMod.Particles; using CalamityMod.Projectiles.BaseProjectiles; -using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; using Terraria; using Terraria.Audio; using Terraria.DataStructures; -using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; @@ -23,7 +19,7 @@ namespace CalamityMod.Projectiles.Melee public override LocalizedText DisplayName => CalamityUtils.GetItemName(); public override string Texture => "CalamityMod/Items/Weapons/Melee/Earth"; - public override float HitboxOutset => 105; + public override float HitboxOutset => 135; public override Vector2 HitboxSize => new Vector2(255, 255); public override float HitboxRotationOffset => MathHelper.ToRadians(-45); diff --git a/Projectiles/Melee/GrandDadHoldout.cs b/Projectiles/Melee/GrandDadHoldout.cs index 7cbb06ac48..146d323354 100644 --- a/Projectiles/Melee/GrandDadHoldout.cs +++ b/Projectiles/Melee/GrandDadHoldout.cs @@ -4,6 +4,7 @@ using CalamityMod.Items.Weapons.Melee; using CalamityMod.NPCs.PrimordialWyrm; using CalamityMod.Particles; using CalamityMod.Projectiles.BaseProjectiles; +using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; @@ -154,9 +155,21 @@ namespace CalamityMod.Projectiles.Melee if (CanHit) { - for (int i = 0; i < 5; i++) + for (int i = 0; i < 6; i++) { - GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(Owner.Center + (new Vector2(185, 0).RotatedBy(FinalRotation + MathHelper.ToRadians(-45)).RotatedByRandom(0.3f)), Vector2.Zero, false, 19, Main.rand.NextFloat(0.5f, 1f), Main.rand.NextBool(4) ? Color.Gold : Color.Goldenrod)); + if (Main.rand.NextBool(4)) + GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(Owner.Center + (new Vector2(180, 0).RotatedBy(FinalRotation + MathHelper.ToRadians(-45)).RotatedByRandom(0.3f)), Vector2.Zero, false, 23, Main.rand.NextFloat(0.5f, 1f), Color.Black, false, false, false)); + else + GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(Owner.Center + (new Vector2(180, 0).RotatedBy(FinalRotation + MathHelper.ToRadians(-45)).RotatedByRandom(0.3f)), Vector2.Zero, false, 23, Main.rand.NextFloat(0.5f, 1f), Main.rand.NextBool(4) ? Color.DodgerBlue : Color.Blue)); + } + for (int i = 0; i < 3; i++) + { + float randRot = Main.rand.NextFloat(-30, -60); + Vector2 dustVel = (new Vector2(0, 15 * -Projectile.ai[1] * Owner.direction)).RotatedBy(FinalRotation + MathHelper.ToRadians(randRot)); + Dust dust2 = Dust.NewDustPerfect(Owner.Center + (new Vector2(185, 0).RotatedBy(FinalRotation + MathHelper.ToRadians(-45)).RotatedByRandom(0.3f)), 278, dustVel * Main.rand.NextFloat(0.1f, 0.5f)); + dust2.scale = Main.rand.NextFloat(0.45f, 0.95f); + dust2.noGravity = true; + dust2.color = Main.rand.NextBool(3) ? Color.Goldenrod : Color.Gold; } } } @@ -252,9 +265,9 @@ namespace CalamityMod.Projectiles.Melee float r = FlipAsSword ? MathHelper.ToRadians(90) : 0f; - for (int i = 0; i < 5; i++) + for (int i = 0; i < 6; i++) { - Color auraColor = Color.Lerp(Color.DarkGoldenrod, Color.Gold, Utils.GetLerpValue(0, 5, i)) * 0.5f * fadeIn; + Color auraColor = Color.Lerp(Color.Goldenrod, Color.Gold, Utils.GetLerpValue(0, 5, i)) * 0.5f * fadeIn; Texture2D centerTexture = ModContent.Request("CalamityMod/Projectiles/Melee/GrandDadGhost").Value; Vector2 rotationalDrawOffset = (MathHelper.TwoPi * i / 7f + Main.GlobalTimeWrappedHourly * 17f).ToRotationVector2(); rotationalDrawOffset *= MathHelper.Lerp(3f, 5.25f, (float)Math.Cos(Main.GlobalTimeWrappedHourly * 4f) * 0.5f + 1.5f); diff --git a/Projectiles/Melee/OldLordClaymoreProj.cs b/Projectiles/Melee/OldLordClaymoreProj.cs index e28a4fe8d1..2ad7609cef 100644 --- a/Projectiles/Melee/OldLordClaymoreProj.cs +++ b/Projectiles/Melee/OldLordClaymoreProj.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Projectiles.Melee public class OldLordClaymoreProj : BaseIdleHoldoutProjectile { public override LocalizedText DisplayName => CalamityUtils.GetItemName(); - public enum SwingState + public enum SwingState : byte { Default, Swinging, @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Melee writer.Write(Direction); writer.Write(PostSwingRepositionDelay); writer.Write(ChargePower); - writer.Write((int)CurrentState); + writer.Write((byte)CurrentState); } public override void ReceiveExtraAI(BinaryReader reader) @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Melee Direction = reader.ReadInt32(); PostSwingRepositionDelay = reader.ReadSingle(); ChargePower = reader.ReadSingle(); - CurrentState = (SwingState)reader.ReadInt32(); + CurrentState = (SwingState)reader.ReadByte(); } public override void SafeAI() diff --git a/Projectiles/Melee/TrueBiomeBladeHoldout.cs b/Projectiles/Melee/TrueBiomeBladeHoldout.cs index 672b2c4a28..2c3099f71d 100644 --- a/Projectiles/Melee/TrueBiomeBladeHoldout.cs +++ b/Projectiles/Melee/TrueBiomeBladeHoldout.cs @@ -161,7 +161,13 @@ namespace CalamityMod.Projectiles.Melee //Chunger var Sound = SoundEngine.PlaySound(CommonCalamitySounds.LightningSound with { Volume = CommonCalamitySounds.LightningSound.Volume * 0.4f }, Projectile.Center); - Particle thunder = new ThunderBoltVFX(Projectile.Center + Vector2.UnitY * 20f, Main.rand.NextBool() ? Main.rand.NextBool() ? Color.Goldenrod : Color.GreenYellow : Main.rand.NextBool() ? Color.Cyan : Color.Magenta, 0f, 1.5f, Vector2.One, 1f, 15f, Projectile, 20f); + Particle thunder = new ThunderBoltVFX( + () => Projectile.Center + Vector2.UnitY * 20f, + 0f, + 1.5f, + Main.rand.NextBool() ? Main.rand.NextBool() ? Color.Goldenrod : Color.GreenYellow : Main.rand.NextBool() ? Color.Cyan : Color.Magenta, + 30, + 15f); GeneralParticleHandler.SpawnParticle(thunder); if (Main.LocalPlayer.Calamity().GeneralScreenShakePower < 5) diff --git a/Projectiles/Ranged/PumplerHoldout.cs b/Projectiles/Ranged/PumplerHoldout.cs index 93522b1934..6dea938198 100644 --- a/Projectiles/Ranged/PumplerHoldout.cs +++ b/Projectiles/Ranged/PumplerHoldout.cs @@ -1,4 +1,5 @@ -using System.IO; +using System; +using System.IO; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Particles; using Microsoft.Xna.Framework; @@ -28,8 +29,13 @@ namespace CalamityMod.Projectiles.Ranged private ref float CurrentChargingFrames => ref Projectile.ai[0]; private ref float PumpkinsCharge => ref Projectile.ai[1]; + private ref float FramesToLoadNextPumpkin => ref Projectile.localAI[0]; + + //This possibly could moved to ai[2] ¯\_(ツ)_/¯ private ref float Overfilled => ref Projectile.localAI[1]; //This functionally is a "IsPlayingShootAnim" variable + + private bool IsOverfilled => (Overfilled >= 0.5f); private float angularSpread = MathHelper.ToRadians(15); public override void SetDefaults() @@ -49,10 +55,10 @@ namespace CalamityMod.Projectiles.Ranged Vector2 tipPosition = armPosition + Projectile.velocity * Projectile.width * 0.5f; // Unloads all pumpkins if you can't shoot/stop holding out the projectile or if the gun is overfilled - if (Owner.CantUseHoldout() || Overfilled == 1f) + if (Owner.CantUseHoldout() || IsOverfilled) { - if (PumpkinsCharge <= 0f && Overfilled == 0f) //If the projectile isnt playing its animation and if there arent any pumpkins loaded, kill it + if (PumpkinsCharge <= 0f && !IsOverfilled) //If the projectile isnt playing its animation and if there arent any pumpkins loaded, kill it { Projectile.Kill(); return; @@ -68,7 +74,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.frameCounter = 0; } // Shoot anim is done? Remove the shoot anim tag - if (Projectile.frame == 0 && Overfilled == 1f) + if (Projectile.frame == 0 && IsOverfilled) Overfilled = 0f; //Animation stuff end @@ -145,7 +151,7 @@ namespace CalamityMod.Projectiles.Ranged SmokeBurst(tipPosition); FramesToLoadNextPumpkin = Owner.ActiveItem().useAnimation; //reset the reload time PumpkinsCharge = 0; //Unload the barrel - if (!(Overfilled == 1f)) + if (!IsOverfilled) Overfilled = 1f; //Make the shoot anim play Projectile.frame = 6; //Initialize the animation } @@ -213,7 +219,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { Main.spriteBatch.EnterShaderRegion(); - if (PumpkinsCharge > 0 && Overfilled == 0f) + if (PumpkinsCharge > 0 && !IsOverfilled) { GameShaders.Misc["CalamityMod:BasicTint"].UseOpacity(MathHelper.Clamp(1f - 0.20f * CurrentChargingFrames - 0.1f * (5f - PumpkinsCharge), 0f, 1f)); //tint effect is visible if its charging. The more pumpkins are loaded, the more opacity @@ -240,12 +246,12 @@ namespace CalamityMod.Projectiles.Ranged //netcode hell public override void SendExtraAI(BinaryWriter writer) { - writer.Write(Overfilled); + writer.Write(IsOverfilled); } public override void ReceiveExtraAI(BinaryReader reader) { - Overfilled = reader.ReadInt32(); + Overfilled = reader.ReadBoolean() ? 1.0f : 0.0f; } } } diff --git a/Projectiles/Rogue/DestructionExplosion.cs b/Projectiles/Rogue/DestructionExplosion.cs index 6cff80c9fe..d20d58abca 100644 --- a/Projectiles/Rogue/DestructionExplosion.cs +++ b/Projectiles/Rogue/DestructionExplosion.cs @@ -1,12 +1,8 @@ -using System; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework; using Terraria; -using Terraria.Audio; -using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Melee +namespace CalamityMod.Projectiles.Rogue { public class DestructionExplosion : ModProjectile, ILocalizedModType { diff --git a/Projectiles/Rogue/DestructionStar.cs b/Projectiles/Rogue/DestructionStar.cs index 3e033f6ed7..308432534e 100644 --- a/Projectiles/Rogue/DestructionStar.cs +++ b/Projectiles/Rogue/DestructionStar.cs @@ -1,16 +1,11 @@ using System; using CalamityMod.Particles; -using CalamityMod.Projectiles.Magic; -using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using Microsoft.Xna.Framework.Graphics.PackedVector; using ReLogic.Content; using Terraria; using Terraria.Audio; -using Terraria.ID; using Terraria.ModLoader; -using static System.Net.Mime.MediaTypeNames; namespace CalamityMod.Projectiles.Rogue { diff --git a/Projectiles/Summon/GlacialEmbracePointyThing.cs b/Projectiles/Summon/GlacialEmbracePointyThing.cs index a06cefa7f5..a1535c1d7b 100644 --- a/Projectiles/Summon/GlacialEmbracePointyThing.cs +++ b/Projectiles/Summon/GlacialEmbracePointyThing.cs @@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.Summon writer.Write(recharging); writer.Write(circling); writer.Write(circlingPlayer); - writer.Write((double)floatyDistance); + writer.Write(floatyDistance); writer.Write(target is null ? -1 : target.whoAmI); } public override void ReceiveExtraAI(BinaryReader reader) @@ -84,7 +84,7 @@ namespace CalamityMod.Projectiles.Summon recharging = reader.ReadInt32(); circling = reader.ReadBoolean(); circlingPlayer = reader.ReadBoolean(); - floatyDistance = (float)reader.ReadDouble(); + floatyDistance = reader.ReadSingle(); int targ = reader.ReadInt32(); target = targ == -1 ? null : Main.npc[targ]; } diff --git a/Projectiles/Summon/MirrorofKalandraMinions/Paradoxica.cs b/Projectiles/Summon/MirrorofKalandraMinions/Paradoxica.cs index 2ac39278e4..a504571104 100644 --- a/Projectiles/Summon/MirrorofKalandraMinions/Paradoxica.cs +++ b/Projectiles/Summon/MirrorofKalandraMinions/Paradoxica.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Summon.MirrorofKalandraMinions public override void ReceiveExtraAI(BinaryReader reader) { hasTeleported = reader.ReadBoolean(); - ChargeStartingPosition = reader.ReadPackedVector2(); + ChargeStartingPosition = reader.ReadVector2(); } public override void AI() diff --git a/Projectiles/Summon/SmallAresArms/ExoskeletonCannon.cs b/Projectiles/Summon/SmallAresArms/ExoskeletonCannon.cs index 8518677727..bf709d1a85 100644 --- a/Projectiles/Summon/SmallAresArms/ExoskeletonCannon.cs +++ b/Projectiles/Summon/SmallAresArms/ExoskeletonCannon.cs @@ -83,6 +83,10 @@ namespace CalamityMod.Projectiles.Summon.SmallAresArms { Projectile.rotation = reader.ReadSingle(); + //limb count has passed from SendExtraAI + //therefore we should read this for packet aligns sake + _ = reader.ReadInt32(); + int limbCount = Limbs.Limbs.Length; for (int i = 0; i < limbCount; i++) { diff --git a/Projectiles/Typeless/AscendantAura.cs b/Projectiles/Typeless/AscendantAura.cs index 6e5b32dcc9..311dfd0c3d 100644 --- a/Projectiles/Typeless/AscendantAura.cs +++ b/Projectiles/Typeless/AscendantAura.cs @@ -3,6 +3,7 @@ using CalamityMod.CalPlayer; using CalamityMod.Dusts; using CalamityMod.Particles; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; using Terraria.ID; @@ -69,6 +70,7 @@ namespace CalamityMod.Projectiles.Typeless int lifetime = Main.rand.Next(3, 6); float scale = Main.rand.NextFloat(0.5f, 0.9f); Color color = Main.rand.NextBool(3) ? Color.LightGreen : Color.Khaki; + /* SparkParticle spark1 = new SparkParticle(spawnPos, new Vector2(Main.rand.NextFloat(7, 12), Main.rand.NextFloat(7, 12)), false, lifetime, scale, color); GeneralParticleHandler.SpawnParticle(spark1); SparkParticle spark2 = new SparkParticle(spawnPos, new Vector2(Main.rand.NextFloat(-7, -12), Main.rand.NextFloat(7, 12)), false, lifetime, scale, color); @@ -81,6 +83,7 @@ namespace CalamityMod.Projectiles.Typeless GeneralParticleHandler.SpawnParticle(spark5); SparkParticle spark6 = new SparkParticle(Projectile.Center + new Vector2(-20, 0), new Vector2(Main.rand.NextFloat(-7, -12), 0), false, lifetime, scale - 0.3f, color); GeneralParticleHandler.SpawnParticle(spark6); + */ // Emit some light Vector3 Light = new Vector3(0.251f, 0.255f, 0.219f); @@ -94,14 +97,42 @@ namespace CalamityMod.Projectiles.Typeless { float rot = MathHelper.ToRadians(i * rotFactor); Vector2 offset = new Vector2(8f, 0).RotatedBy(rot); - Vector2 velOffset = new Vector2(2.5f, 0).RotatedBy(rot); - Dust dust = Dust.NewDustPerfect(Projectile.Center + offset, 204, new Vector2(velOffset.X, velOffset.Y)); + Vector2 velOffset = new Vector2(10.5f, 0).RotatedBy(rot); + Dust dust = Dust.NewDustPerfect(Projectile.Center + offset, 278, new Vector2(velOffset.X, velOffset.Y)); dust.noGravity = true; - dust.velocity = velOffset * Main.rand.NextFloat(0.9f, 1.1f); - dust.scale = 2.5f; + dust.velocity = velOffset * Main.rand.NextFloat(0.2f, 1.1f); + dust.scale = Main.rand.NextFloat(0.3f, 0.8f); + dust.color = Main.rand.NextBool(3) ? Color.LightGreen : Color.Khaki; } + + SoundStyle s = new("CalamityMod/Sounds/Item/AscendantActivate"); + SoundEngine.PlaySound(s with { Volume = 0.3f, Pitch = -0.9f }, Projectile.Center); } + public override bool PreDraw(ref Color lightColor) + { + Texture2D rTexture = ModContent.Request("CalamityMod/Projectiles/Typeless/AscendantAura").Value; + Texture2D bTexture = ModContent.Request("CalamityMod/Particles/GlowSpark").Value; + Color drawColor = Color.Lerp(Color.Khaki, Color.LightGreen, Utils.GetLerpValue(240, -100, Projectile.timeLeft, true)); + + Vector2 bScale = new Vector2(Main.rand.NextFloat(0.15f, 0.2f), 0.5f) * Projectile.scale * 0.04f * Utils.GetLerpValue(0, 20, Projectile.timeLeft, true) * Main.rand.NextFloat(0.7f, 1.3f); + + Main.EntitySpriteDraw(bTexture, Projectile.Center - Main.screenPosition + new Vector2(-30 * Utils.GetLerpValue(0, 20, Projectile.timeLeft, true), 0) * Main.rand.NextFloat(0.6f, 1.3f), null, drawColor with { A = 0 } * Utils.GetLerpValue(0, 20, Projectile.timeLeft, true), MathHelper.ToRadians(90f), bTexture.Size() * 0.5f, bScale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(bTexture, Projectile.Center - Main.screenPosition + new Vector2(30 * Utils.GetLerpValue(0, 20, Projectile.timeLeft, true), 0) * Main.rand.NextFloat(0.6f, 1.3f), null, drawColor with { A = 0 } * Utils.GetLerpValue(0, 20, Projectile.timeLeft, true), MathHelper.ToRadians(-90f), bTexture.Size() * 0.5f, bScale, SpriteEffects.None, 0); + + Main.EntitySpriteDraw(bTexture, Projectile.Center - Main.screenPosition + new Vector2(0, -30 * Utils.GetLerpValue(0, 20, Projectile.timeLeft, true)) * Main.rand.NextFloat(0.6f, 1.3f), null, drawColor with { A = 0 } * Utils.GetLerpValue(0, 20, Projectile.timeLeft, true), 0, bTexture.Size() * 0.5f, bScale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(bTexture, Projectile.Center - Main.screenPosition + new Vector2(0, 30 * Utils.GetLerpValue(0, 20, Projectile.timeLeft, true)) * Main.rand.NextFloat(0.6f, 1.3f), null, drawColor with { A = 0 } * Utils.GetLerpValue(0, 20, Projectile.timeLeft, true), MathHelper.ToRadians(180f), bTexture.Size() * 0.5f, bScale, SpriteEffects.None, 0); + + for (int i = 0; i < 4; i++) + { + Vector2 bScale2 = new Vector2(0.1f, 0.8f) * Projectile.scale * 0.04f * Utils.GetLerpValue(0, 20, Projectile.timeLeft, true) * Main.rand.NextFloat(0.7f, 1.3f); + Vector2 bVel = new Vector2(20 * Utils.GetLerpValue(0, 20, Projectile.timeLeft, true), 0).RotatedBy(MathHelper.ToRadians(45f + (i * 90))) * Main.rand.NextFloat(0.6f, 1.3f); + Main.EntitySpriteDraw(bTexture, Projectile.Center - Main.screenPosition + bVel, null, drawColor with { A = 0 } * Utils.GetLerpValue(0, 20, Projectile.timeLeft, true), bVel.ToRotation() + MathHelper.ToRadians(90f), bTexture.Size() * 0.5f, bScale2, SpriteEffects.None, 0); + } + + Main.EntitySpriteDraw(rTexture, Projectile.Center - Main.screenPosition, null, drawColor with { A = 0 } * Utils.GetLerpValue(0, 20, Projectile.timeLeft, true), Projectile.rotation, rTexture.Size() * 0.5f, Projectile.scale * 0.4f * Utils.GetLerpValue(0, 20, Projectile.timeLeft, true), SpriteEffects.None, 0); + return false; + } public override bool? CanDamage() => false; } } diff --git a/Projectiles/Typeless/AscendantAura.png b/Projectiles/Typeless/AscendantAura.png index fb2bd6cc34..e48fd57ef6 100644 Binary files a/Projectiles/Typeless/AscendantAura.png and b/Projectiles/Typeless/AscendantAura.png differ diff --git a/Projectiles/Typeless/BlunderBoosterAura.cs b/Projectiles/Typeless/BlunderBoosterAura.cs index 61bf31726a..9ef3c27837 100644 --- a/Projectiles/Typeless/BlunderBoosterAura.cs +++ b/Projectiles/Typeless/BlunderBoosterAura.cs @@ -86,42 +86,13 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDraw(ref Color lightColor) { - // Don't draw the aura at all if visibility is toggled off - if (!Main.player[Projectile.owner].Calamity().blunderBoosterVisibility) - return false; - Texture2D sprite = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value; Color drawColour = Color.White; Rectangle sourceRect = new Rectangle(Projectile.width * (int)Projectile.localAI[1], Projectile.height * (int)Projectile.localAI[0], Projectile.width, Projectile.height); Vector2 origin = new Vector2(Projectile.width / 2, Projectile.height / 2); - float opacity = 1f; - int sparkCount = 0; - int fadeTime = 20; - - if (Projectile.timeLeft < fadeTime) - { - opacity = Projectile.timeLeft * (1f / fadeTime); - sparkCount = fadeTime - Projectile.timeLeft; - } - - for (int i = 0; i < sparkCount * 2; i++) - { - int dustType = 132; - if (Main.rand.NextBool()) - { - dustType = 264; - } - float rangeDiff = 2f; - - Vector2 dustPos = new Vector2(Main.rand.NextFloat(-1, 1), Main.rand.NextFloat(-1, 1)); - dustPos.Normalize(); - dustPos *= radius + Main.rand.NextFloat(-rangeDiff, rangeDiff); - - int dust = Dust.NewDust(Projectile.Center + dustPos, 1, 1, dustType, 0, 0, 0, default, 0.75f); - Main.dust[dust].noGravity = true; - } + float opacity = Main.player[Projectile.owner].Calamity().blunderBoosterVisibility ? 1f : 0.25f; Main.EntitySpriteDraw(sprite, Projectile.Center - Main.screenPosition, sourceRect, drawColour * opacity, Projectile.rotation, origin, 1f, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Typeless/GenericElectricSpark.cs b/Projectiles/Typeless/GenericElectricSpark.cs index 607550060d..869b6548cb 100644 --- a/Projectiles/Typeless/GenericElectricSpark.cs +++ b/Projectiles/Typeless/GenericElectricSpark.cs @@ -23,7 +23,12 @@ namespace CalamityMod.Projectiles.Typeless Projectile.localNPCHitCooldown = 15; } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 120); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + // Prevents Amidias' Spark sparks from inflicting it to not make its other effect worthless + if (Projectile.ai[1] != 1f) + target.AddBuff(ModContent.BuffType(), 120); + } public override void AI() { diff --git a/Projectiles/Typeless/PendantProjectile3.cs b/Projectiles/Typeless/PearlAuraShard.cs similarity index 70% rename from Projectiles/Typeless/PendantProjectile3.cs rename to Projectiles/Typeless/PearlAuraShard.cs index cf8165e20d..0732ddd80f 100644 --- a/Projectiles/Typeless/PendantProjectile3.cs +++ b/Projectiles/Typeless/PearlAuraShard.cs @@ -6,7 +6,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Typeless { - public class PendantProjectile3 : ModProjectile, ILocalizedModType + public class PearlAuraShard : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Typeless"; public override void SetDefaults() @@ -16,17 +16,17 @@ namespace CalamityMod.Projectiles.Typeless Projectile.friendly = true; Projectile.ignoreWater = true; Projectile.timeLeft = 220; - Projectile.penetrate = 1; Projectile.tileCollide = false; } public override void AI() { - CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 10f, 20f); + if (Projectile.timeLeft < 210) + CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 10f, 20f); Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0f / 255f, (255 - Projectile.alpha) * 0.2f / 255f, (255 - Projectile.alpha) * 0.2f / 255f); Projectile.rotation += Projectile.velocity.X * 1.25f; - for (int i = 0; i < 5; i++) + for (int i = 0; i < 4; i++) { int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Flare_Blue, 0f, 0f, 100, default, 0.6f); Main.dust[dust].noGravity = true; @@ -34,9 +34,5 @@ namespace CalamityMod.Projectiles.Typeless Main.dust[dust].velocity += Projectile.velocity * 0.1f; } } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 60); - - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 60); } } diff --git a/Projectiles/Typeless/PendantProjectile3.png b/Projectiles/Typeless/PearlAuraShard.png similarity index 100% rename from Projectiles/Typeless/PendantProjectile3.png rename to Projectiles/Typeless/PearlAuraShard.png diff --git a/Projectiles/Typeless/PendantProjectile1.cs b/Projectiles/Typeless/PendantProjectile1.cs deleted file mode 100644 index f04ae59970..0000000000 --- a/Projectiles/Typeless/PendantProjectile1.cs +++ /dev/null @@ -1,40 +0,0 @@ -using CalamityMod.Buffs.StatDebuffs; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Typeless -{ - public class PendantProjectile1 : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Typeless"; - public override void SetDefaults() - { - Projectile.width = 10; - Projectile.height = 10; - Projectile.friendly = true; - Projectile.ignoreWater = true; - Projectile.timeLeft = 220; - Projectile.penetrate = 1; - Projectile.tileCollide = false; - } - - public override void AI() - { - Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0f / 255f, (255 - Projectile.alpha) * 0.2f / 255f, (255 - Projectile.alpha) * 0.2f / 255f); - Projectile.rotation += Projectile.velocity.X * 1.25f; - for (int i = 0; i < 5; i++) - { - int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Flare_Blue, 0f, 0f, 100, default, 0.6f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 0.5f; - Main.dust[dust].velocity += Projectile.velocity * 0.1f; - } - } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 30); - - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 30); - } -} diff --git a/Projectiles/Typeless/PendantProjectile1.png b/Projectiles/Typeless/PendantProjectile1.png deleted file mode 100644 index df5a566c0b..0000000000 Binary files a/Projectiles/Typeless/PendantProjectile1.png and /dev/null differ diff --git a/Projectiles/Typeless/PendantProjectile2.cs b/Projectiles/Typeless/PendantProjectile2.cs deleted file mode 100644 index c50d8c358f..0000000000 --- a/Projectiles/Typeless/PendantProjectile2.cs +++ /dev/null @@ -1,40 +0,0 @@ -using CalamityMod.Buffs.StatDebuffs; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Typeless -{ - public class PendantProjectile2 : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Typeless"; - public override void SetDefaults() - { - Projectile.width = 10; - Projectile.height = 10; - Projectile.friendly = true; - Projectile.ignoreWater = true; - Projectile.timeLeft = 220; - Projectile.penetrate = 1; - Projectile.tileCollide = false; - } - - public override void AI() - { - Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0f / 255f, (255 - Projectile.alpha) * 0.2f / 255f, (255 - Projectile.alpha) * 0.2f / 255f); - Projectile.rotation += Projectile.velocity.X * 1.25f; - for (int i = 0; i < 5; i++) - { - int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Flare_Blue, 0f, 0f, 100, default, 0.6f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 0.5f; - Main.dust[dust].velocity += Projectile.velocity * 0.1f; - } - } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 30); - - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 30); - } -} diff --git a/Projectiles/Typeless/PendantProjectile2.png b/Projectiles/Typeless/PendantProjectile2.png deleted file mode 100644 index bcf5f2e978..0000000000 Binary files a/Projectiles/Typeless/PendantProjectile2.png and /dev/null differ diff --git a/Projectiles/Typeless/TeslaAura.cs b/Projectiles/Typeless/TeslaAura.cs index 64b1ae6879..1185a9aa11 100644 --- a/Projectiles/Typeless/TeslaAura.cs +++ b/Projectiles/Typeless/TeslaAura.cs @@ -60,12 +60,6 @@ namespace CalamityMod.Projectiles.Typeless Player player = Main.player[Projectile.owner]; Projectile.Center = player.Center; - if (player is null || player.dead) - { - player.ClearBuff(ModContent.BuffType()); - player.Calamity().tesla = false; - Projectile.Kill(); - } } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) @@ -100,32 +94,7 @@ namespace CalamityMod.Projectiles.Typeless Rectangle sourceRect = new Rectangle(Projectile.width * (int)Projectile.localAI[1], Projectile.height * (int)Projectile.localAI[0], Projectile.width, Projectile.height); Vector2 origin = new Vector2(Projectile.width / 2, Projectile.height / 2); - float opacity = 1f; - int sparkCount = 0; - int fadeTime = 20; - - if (Projectile.timeLeft < fadeTime) - { - opacity = Projectile.timeLeft * (1f / fadeTime); - sparkCount = fadeTime - Projectile.timeLeft; - } - - for (int i = 0; i < sparkCount * 2; i++) - { - int dustType = 132; - if (Main.rand.NextBool()) - { - dustType = 264; - } - float rangeDiff = 2f; - - Vector2 dustPos = new Vector2(Main.rand.NextFloat(-1, 1), Main.rand.NextFloat(-1, 1)); - dustPos.Normalize(); - dustPos *= radius + Main.rand.NextFloat(-rangeDiff, rangeDiff); - - int dust = Dust.NewDust(Projectile.Center + dustPos, 1, 1, dustType, 0, 0, 0, default, 0.75f); - Main.dust[dust].noGravity = true; - } + float opacity = Main.player[Projectile.owner].Calamity().teslaVisuals ? 1f : 0.25f; Main.EntitySpriteDraw(sprite, Projectile.Center - Main.screenPosition, sourceRect, drawColour * opacity, Projectile.rotation, origin, 1f, SpriteEffects.None, 0); return false; diff --git a/Sounds/Item/ArsenalOffCooldown.ogg b/Sounds/Item/ArsenalOffCooldown.ogg new file mode 100644 index 0000000000..3be62abb8b Binary files /dev/null and b/Sounds/Item/ArsenalOffCooldown.ogg differ diff --git a/Systems/WorldMiscUpdateSystem.cs b/Systems/WorldMiscUpdateSystem.cs index c172445a7b..cc580cd0d9 100644 --- a/Systems/WorldMiscUpdateSystem.cs +++ b/Systems/WorldMiscUpdateSystem.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Systems // Reset this int because it causes bugs with other mods if you delete Dr. Draedon through abnormal means. if (CalamityGlobalNPC.draedon != -1) { - if (!NPC.AnyNPCs(ModContent.NPCType())) + if (!NPC.AnyNPCs(NPCType())) CalamityGlobalNPC.draedon = -1; } @@ -132,13 +132,13 @@ namespace CalamityMod.Systems if (DraedonSummonCountdown == DraedonSummonCountdownMax - 45) { IEntitySource source = new EntitySource_WorldEvent(); - Projectile.NewProjectile(source, DraedonSummonPosition + Vector2.UnitY * 80f, Vector2.Zero, ModContent.ProjectileType(), 0, 0f); + Projectile.NewProjectile(source, DraedonSummonPosition + Vector2.UnitY * 80f, Vector2.Zero, ProjectileType(), 0, 0f); } if (DraedonSummonCountdown == 0) { IEntitySource source = new EntitySource_WorldEvent(); - NPC.NewNPC(source, (int)DraedonSummonPosition.X, (int)DraedonSummonPosition.Y, ModContent.NPCType()); + NPC.NewNPC(source, (int)DraedonSummonPosition.X, (int)DraedonSummonPosition.Y, NPCType()); } } #endregion Handle Draedon Summoning @@ -242,7 +242,7 @@ namespace CalamityMod.Systems if (CalamityGlobalTile.GrowthTiles.Contains(tileType) && growthTile.Slope == SlopeType.Solid && !growthTile.IsHalfBlock) { int growthChance = 2; - if (tileType == ModContent.TileType()) + if (tileType == TileType()) growthChance *= 5; if (Main.rand.NextBool(growthChance)) @@ -269,18 +269,18 @@ namespace CalamityMod.Systems { Tile tile = Main.tile[x, y]; bool growTile = !tile.HasTile && tile.LiquidAmount >= 128; - bool isSunkenSeaTile = tileType == ModContent.TileType() || tileType == ModContent.TileType(); + bool isSunkenSeaTile = tileType == TileType() || tileType == TileType(); bool meetsAdditionalGrowConditions = tile.Slope == SlopeType.Solid && !tile.IsHalfBlock && tile.LiquidType != LiquidID.Lava; if (growTile && meetsAdditionalGrowConditions) { - int tileType2 = ModContent.TileType(); + int tileType2 = TileType(); - if (tileType == ModContent.TileType()) - tileType2 = ModContent.TileType(); + if (tileType == TileType()) + tileType2 = TileType(); bool canPlaceBasedOnAttached = true; - if (tileType2 == ModContent.TileType() && !isSunkenSeaTile) + if (tileType2 == TileType() && !isSunkenSeaTile) canPlaceBasedOnAttached = false; if (canPlaceBasedOnAttached && CanPlaceBasedOnProximity(x, y, tileType2)) @@ -395,7 +395,7 @@ namespace CalamityMod.Systems public static bool CanPlaceBasedOnProximity(int x, int y, int tileType) { - if (tileType == ModContent.TileType() && !DownedBossSystem.downedLeviathan) + if (tileType == TileType() && !DownedBossSystem.downedLeviathan) return false; int minDistanceFromOtherTiles = 10; @@ -458,10 +458,10 @@ namespace CalamityMod.Systems int chance = (int)spawnRate; if (Main.rand.NextBool(chance)) { - if (!NPC.AnyNPCs(ModContent.NPCType()) && Main.netMode != NetmodeID.MultiplayerClient && + if (!NPC.AnyNPCs(NPCType()) && Main.netMode != NetmodeID.MultiplayerClient && ArmoredDiggerSpawnCooldown <= 0) { - NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); + NPC.SpawnOnPlayer(player.whoAmI, NPCType()); ArmoredDiggerSpawnCooldown = 36000; } } @@ -507,7 +507,7 @@ namespace CalamityMod.Systems bool adultWyrmAlive = CalamityGlobalNPC.adultEidolonWyrmHead != -1 && Main.npc[CalamityGlobalNPC.adultEidolonWyrmHead].active; if (!adultWyrmAlive) - NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); + NPC.SpawnOnPlayer(player.whoAmI, NPCType()); } #endregion } diff --git a/Tiles/LivingFire/LivingPlagueFireBlockTile.cs b/Tiles/LivingFire/LivingPlagueFireBlockTile.cs new file mode 100644 index 0000000000..10f9f299e6 --- /dev/null +++ b/Tiles/LivingFire/LivingPlagueFireBlockTile.cs @@ -0,0 +1,94 @@ +using System.Collections.Generic; +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; +namespace CalamityMod.Tiles.LivingFire +{ + public class LivingPlagueFireBlockTile : ModTile + { + //Thank you to Seraph for getting living fire blocks to work properly. + public override void SetStaticDefaults() + { + Main.tileLighted[Type] = true; + HitSound = SoundID.Dig; + AddMapEntry(new Color(0, 171, 31)); + AnimationFrameHeight = 90; + Main.tileSolid[Type] = false; + Main.tileNoAttach[Type] = false; + Main.tileFrameImportant[Type] = false; + TileObjectData.newTile.Width = 1; + TileObjectData.newTile.Height = 1; + TileObjectData.newTile.Origin = new Point16(0, 0); + TileObjectData.newTile.CoordinateHeights = new int[] { 16 }; + TileObjectData.newTile.CoordinateWidth = 16; + TileObjectData.newTile.CoordinatePadding = 2; + TileObjectData.newTile.HookCheckIfCanPlace = new PlacementHook(CanPlaceAlter, -1, 0, true); + TileObjectData.newTile.UsesCustomCanPlace = true; + TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(AfterPlacement, -1, 0, false); + + TileObjectData.addTile(Type); + } + + public int CanPlaceAlter(int i, int j, int type, int style, int direction, int alternate) => 1; + + public static int AfterPlacement(int i, int j, int type, int style, int direction, int alternate) + { + if (Main.netMode == NetmodeID.MultiplayerClient) + { + NetMessage.SendTileSquare(Main.myPlayer, i, j, 1, 1); + } + return 1; + } + + public override bool CanPlace(int i, int j) + { + List> around = new List> + { + new List() {i, j-1 }, + new List() {i-1, j }, + new List() {i+1, j }, + new List() {i, j+1 } + }; + //if (Main.tile[i, j]) || tile.type == Type + + //return true; //temporary for testing purposes + + if (Main.tile[i, j].WallType != WallID.None) + { + return true; + } + + for (int k = 0; k < around.Count; ++k) + { + Tile tile = Main.tile[around[k][0], around[k][1]]; + if (tile.HasTile && (Main.tileSolid[tile.TileType] || CalamityLists.livingFireBlockList.Contains(tile.TileType))) + { + return true; + } + } + return false; + } + + public override void AnimateTile(ref int frame, ref int frameCounter) + { + frame = Main.tileFrame[TileID.LivingFire]; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + r = 0f; + g = 1f; + b = 0.2f; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, (int)CalamityDusts.Plague, 0f, 0f, 1, default, 1f); + return false; + } + } +} diff --git a/Tiles/LivingFire/LivingPlagueFireBlockTile.png b/Tiles/LivingFire/LivingPlagueFireBlockTile.png new file mode 100644 index 0000000000..2282b3ce0a Binary files /dev/null and b/Tiles/LivingFire/LivingPlagueFireBlockTile.png differ diff --git a/Utilities/ProjectileUtils.cs b/Utilities/ProjectileUtils.cs index 5979a32adb..a9611366dd 100644 --- a/Utilities/ProjectileUtils.cs +++ b/Utilities/ProjectileUtils.cs @@ -707,7 +707,7 @@ namespace CalamityMod public static void DrawStarTrail(this Projectile projectile, Color outer, Color inner, float auraHeight = 10f) { - Texture2D aura = ModContent.Request("CalamityMod/Projectiles/StarTrail").Value; + Texture2D aura = Request("CalamityMod/Projectiles/StarTrail").Value; Vector2 offsets = new Vector2(0f, projectile.gfxOffY) - Main.screenPosition; Rectangle auraRec = aura.Frame(); float auraRotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; diff --git a/Utilities/TileEntityUtils.cs b/Utilities/TileEntityUtils.cs index 4508e9c84c..3e5fae0989 100644 --- a/Utilities/TileEntityUtils.cs +++ b/Utilities/TileEntityUtils.cs @@ -77,7 +77,7 @@ namespace CalamityMod // This check is done twice because the draw order matters. We want to draw the background icon before any text. if (item.stack > 0) { - if (item.type == ModContent.ItemType()) + if (item.type == ItemType()) { slotBackgroundTex = Request("CalamityMod/UI/DraedonsArsenal/PowerCellSlot_Blood").Value; } diff --git a/Utilities/TileUtils.cs b/Utilities/TileUtils.cs index 7f9f60001e..fa2cb36748 100644 --- a/Utilities/TileUtils.cs +++ b/Utilities/TileUtils.cs @@ -696,10 +696,10 @@ namespace CalamityMod if (ignoreAbyss) { - tileExcludeList.Add(ModContent.TileType()); - tileExcludeList.Add(ModContent.TileType()); - tileExcludeList.Add(ModContent.TileType()); - tileExcludeList.Add(ModContent.TileType()); + tileExcludeList.Add(TileType()); + tileExcludeList.Add(TileType()); + tileExcludeList.Add(TileType()); + tileExcludeList.Add(TileType()); } return !Main.tileContainer[tile.TileType] && !tileExcludeList.Contains(tile.TileType); diff --git a/World/BrimstoneCrag.cs b/World/BrimstoneCrag.cs index 10573d76b6..0f4734b77d 100644 --- a/World/BrimstoneCrag.cs +++ b/World/BrimstoneCrag.cs @@ -57,7 +57,7 @@ namespace CalamityMod.World for (int y = Main.maxTilesY - 90; y <= Main.maxTilesY - 5; y++) { WorldGen.PlaceTile(x, y, (ushort)ModContent.TileType()); - Main.tile[x, y + 5].WallType = (ushort)ModContent.WallType(); + Main.tile[x, y].WallType = (ushort)ModContent.WallType(); } }