diff --git a/Buffs/DamageOverTime/TrueVulnerabilityHex.cs b/Buffs/DamageOverTime/TrueVulnerabilityHex.cs new file mode 100644 index 0000000000..ff9aeafec2 --- /dev/null +++ b/Buffs/DamageOverTime/TrueVulnerabilityHex.cs @@ -0,0 +1,79 @@ +using CalamityMod.Dusts; +using CalamityMod.NPCs; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.DamageOverTime +{ + public class TrueVulnerabilityHex : ModBuff + { + // The visual number displayed in ticks as the enemy takes damage. + public const int TickNumber = 666; + + // The exact amount True Vulnerability Hex reduces NPC life regen by. + public const int DPS = TickNumber * 6; // -3996 life regen, 1998 DPS + + public override void SetStaticDefaults() + { + Main.debuff[Type] = true; + Main.pvpBuff[Type] = true; + Main.buffNoSave[Type] = true; + BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; + BuffID.Sets.LongerExpertDebuff[Type] = true; + } + + public override void Update(Player player, ref int buffIndex) => player.Calamity().trueVHex = true; + + public override void Update(NPC npc, ref int buffIndex) + { + CalamityGlobalNPC cgn = npc.Calamity(); + if (cgn.trueVulnerabilityHex < npc.buffTime[buffIndex]) + { + cgn.trueVulnerabilityHex = npc.buffTime[buffIndex]; + // Set the remaining time of the fire drawer to be exactly right. + if (cgn.VulnerabilityHexFireDrawer != null) + cgn.VulnerabilityHexFireDrawer.SetLifetime = cgn.VulnerabilityHexFireDrawer.LocalTimer + cgn.trueVulnerabilityHex; + } + + // Apply immunity timer. + if ((CalamityLists.enemyImmunityList.Contains(npc.type) || npc.boss) && cgn.debuffResistanceTimer <= 0) + cgn.debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + cgn.trueVulnerabilityHex; + + // Destroy the vanilla buff, we don't use it. + npc.DelBuff(buffIndex); + buffIndex--; + } + + internal static void DrawEffects(NPC npc, ref Color drawColor) + { + if (Main.rand.NextBool()) + { + Vector2 position = new(npc.position.X + Main.rand.NextFloat(npc.width), npc.position.Y + Main.rand.NextFloat(npc.height)); + VoidSparkParticle voidSpark = new(position, -Vector2.UnitY.RotatedByRandom(MathHelper.Pi / 10f) * Main.rand.NextFloat(10f, 18f), false, 20, Main.rand.NextFloat(0.02f, 0.05f), Main.rand.NextBool() ? Color.Black : Color.Lerp(Color.Red, Color.Magenta, 0.35f)); + GeneralParticleHandler.SpawnParticle(voidSpark); + } + } + + internal static void DrawEffects(PlayerDrawSet drawInfo) + { + Player Player = drawInfo.drawPlayer; + + if (Main.rand.NextBool()) + { + VoidSparkParticle spark2 = new VoidSparkParticle(Player.Calamity().RandomDebuffVisualSpot, -Vector2.UnitY * Main.rand.NextFloat(6f, 10f), false, Main.rand.Next(18, 27), Main.rand.NextFloat(0.015f, 0.045f), Main.rand.NextBool() ? Color.Black : Color.Lerp(Color.Red, Color.Magenta, 0.65f)); + GeneralParticleHandler.SpawnParticle(spark2); + } + + Dust dust = Dust.NewDustPerfect(Player.Calamity().RandomDebuffVisualSpot, Main.rand.NextBool() ? 261 : (int)CalamityDusts.Brimstone); + dust.scale = Main.rand.NextFloat(0.6f, 0.7f); + dust.velocity = -Vector2.UnitY.RotatedByRandom(MathHelper.PiOver4) * Main.rand.NextFloat(0.5f, 2.5f); + if (dust.type == 261) + dust.color = Color.Lerp(Color.Orange, Color.White, Main.rand.NextFloat()); + + } + } +} diff --git a/Buffs/DamageOverTime/TrueVulnerabilityHex.png b/Buffs/DamageOverTime/TrueVulnerabilityHex.png new file mode 100644 index 0000000000..2793cfdc04 Binary files /dev/null and b/Buffs/DamageOverTime/TrueVulnerabilityHex.png differ diff --git a/Buffs/DamageOverTime/VulnerabilityHex.cs b/Buffs/DamageOverTime/VulnerabilityHex.cs index 6ea2f5c298..13cbad0a14 100644 --- a/Buffs/DamageOverTime/VulnerabilityHex.cs +++ b/Buffs/DamageOverTime/VulnerabilityHex.cs @@ -1,24 +1,23 @@ -using CalamityMod.NPCs; +using CalamityMod.Dusts; +using CalamityMod.NPCs; using CalamityMod.Particles; +using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; -using ReLogic.Utilities; -using CalamityMod.Dusts; namespace CalamityMod.Buffs.DamageOverTime { public class VulnerabilityHex : ModBuff { - // This is the visual number displayed in ticks as the enemy takes damage from this debuff. + // The visual number displayed in ticks as the enemy takes damage. public const int TickNumber = 666; - // This is the exact DPS dealt by Vulnerability Hex to NPCs. - public const int DPS = TickNumber * 4; // 2664 DPS + // The exact amount Vulnerability Hex reduces NPC life regen by. + public const int DPS = TickNumber * 4; // -2664 life regen, 1332 DPS - public const int CalamityDuration = 24; + public const int CalamityDuration = 60; public const int AflameDuration = 120; public override void SetStaticDefaults() diff --git a/Buffs/DamageOverTime/VulnerabilityHex.png b/Buffs/DamageOverTime/VulnerabilityHex.png index 2793cfdc04..c547bc2e18 100644 Binary files a/Buffs/DamageOverTime/VulnerabilityHex.png and b/Buffs/DamageOverTime/VulnerabilityHex.png differ diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index f6c2c62801..e24b2f9184 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -85,8 +85,8 @@ namespace CalamityMod.CalPlayer public double contactDamageReduction = 0D; public double projectileDamageReduction = 0D; public const float projectileMeleeWeaponMeleeSpeedMultiplier = 0f; - public bool brimlashBusterBoost = false; public int evilSmasherBoost = 0; + public int burningSeaBurnOut = 0; public int hellbornBoost = 0; public int searedPanCounter = 0; public int searedPanTimer = 0; @@ -906,6 +906,7 @@ namespace CalamityMod.CalPlayer public bool icarusFolly = false; public bool weakPetrification = false; public bool vHex = false; + public bool trueVHex = false; public bool DoGExtremeGravity = false; public bool warped = false; public bool cDepth = false; @@ -1991,6 +1992,7 @@ namespace CalamityMod.CalPlayer elementalMix = false; icarusFolly = false; vHex = false; + trueVHex = false; DoGExtremeGravity = false; warped = false; cDepth = false; @@ -2423,6 +2425,7 @@ namespace CalamityMod.CalPlayer elementalMix = false; icarusFolly = false; vHex = false; + trueVHex = false; DoGExtremeGravity = false; warped = false; cDepth = false; @@ -2698,10 +2701,10 @@ namespace CalamityMod.CalPlayer #endregion KameiBladeUseDelay = 0; - brimlashBusterBoost = false; AdrenalineTrail = false; ascendantTrail = false; evilSmasherBoost = 0; + burningSeaBurnOut = 0; hellbornBoost = 0; searedPanCounter = 0; searedPanTimer = 0; diff --git a/CalPlayer/CalamityPlayerDrawEffects.cs b/CalPlayer/CalamityPlayerDrawEffects.cs index 6d58bbba7b..fa9ae52cdf 100644 --- a/CalPlayer/CalamityPlayerDrawEffects.cs +++ b/CalPlayer/CalamityPlayerDrawEffects.cs @@ -291,6 +291,9 @@ namespace CalamityMod.CalPlayer if (calamityPlayer.tRegen && drawInfo.shadow == 0f) TarraLifeRegen.DrawEffects(drawInfo); + if (calamityPlayer.trueVHex && drawInfo.shadow == 0f) + TrueVulnerabilityHex.DrawEffects(drawInfo); + if (calamityPlayer.vaporfied && drawInfo.shadow == 0f) Vaporfied.DrawEffects(drawInfo); diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index 88116327e4..47e8360482 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -848,6 +848,9 @@ namespace CalamityMod.CalPlayer modifiers.SourceDamage *= damageReductionFromWhisperingDeath; } + if (trueVHex) + modifiers.SourceDamage *= 1.15f; + // // At this point, the player is guaranteed to be hit if there is no dodge. // The amount of damage that will be dealt is yet to be determined. @@ -1026,6 +1029,9 @@ namespace CalamityMod.CalPlayer projectileDamageReduction += 0.2; } + if (trueVHex) + modifiers.SourceDamage *= 1.15f; + if (auralisAuroraCounter >= 300) { modifiers.SourceDamage.Flat -= 100; diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 4859ca2c3f..6b913f7cee 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -109,6 +109,7 @@ namespace CalamityMod.CalPlayer ApplyDoTDebuff(hFlames, 40, purity); ApplyDoTDebuff(voidfrost, 40, purity); ApplyDoTDebuff(vHex, 35); + ApplyDoTDebuff(trueVHex, 50); ApplyDoTDebuff(cDepth, 18, purity); ApplyDoTDebuff(astralInfection, 24, infectedJewel || purity); ApplyDoTDebuff(pFlames, alchFlask ? 10 : 30, purity); diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 602f9c3a00..abb82966da 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -705,11 +705,6 @@ namespace CalamityMod.CalPlayer if (!blazingCursorDamage) return; - // miscCounter is used to limit Calamity's hit rate. - int framesPerHit = 5; - if (Player.miscCounter % framesPerHit != 1) - return; - Rectangle sigilHitbox = Utils.CenteredRectangle(Main.MouseWorld, new Vector2(35f, 62f)); int sigilDamage = (int)Player.GetBestClassDamage().ApplyTo(Calamity.BaseDamage); sigilDamage = Player.ApplyArmorAccDamageBonusesTo(sigilDamage); @@ -717,9 +712,39 @@ namespace CalamityMod.CalPlayer bool brightenedSigil = false; foreach (NPC target in Main.ActiveNPCs) { - if (!target.Hitbox.Intersects(sigilHitbox) || target.immortal || target.dontTakeDamage || target.townNPC || NPCID.Sets.ActsLikeTownNPC[target.type] || NPCID.Sets.CountsAsCritter[target.type]) + if (!target.Hitbox.Intersects(sigilHitbox) || target.immortal || target.dontTakeDamage || target.friendly || NPCID.Sets.CountsAsCritter[target.type]) continue; + // Increment the cursor focus counter. Note this actually has a net of increasing by 2 per frame, due to the 1 per frame falloff in GlobalNPC. + // If this counter reaches 300 (which takes 2.5 seconds without interruptions), True VHex is activated. + if (target.Calamity().cursorFocus < CalamityGlobalNPC.cursorFocusMax) + { + target.Calamity().cursorFocus += 3; + + // Draw an expanding orb effect on the cursor based on the cursor focus value. + float cursorFocusRatio = target.Calamity().cursorFocus / (float)CalamityGlobalNPC.cursorFocusMax; + StrongBloom indicator = new(Main.MouseWorld, Vector2.Zero, Color.Lerp(Color.Magenta, Color.Red, cursorFocusRatio), cursorFocusRatio * 0.7f, 2); + GeneralParticleHandler.SpawnParticle(indicator); + + if (target.Calamity().cursorFocus >= CalamityGlobalNPC.cursorFocusMax) + { + target.Calamity().trueVulnerabilityHex = target.Calamity().vulnerabilityHex >= 300 ? target.Calamity().vulnerabilityHex : 300; + target.Calamity().vulnerabilityHex = 0; + SoundEngine.PlaySound(new("CalamityMod/Sounds/Custom/WeaponEnchant"), target.Center); + + for (int i = 0; i < 18; i++) + { + Vector2 orbVel = new Vector2(15, 15).RotatedByRandom(MathHelper.Pi) * Main.rand.NextFloat(0.33f, 1f); + GlowOrbParticle orb = new(target.Center + orbVel, orbVel, false, 60, Main.rand.NextFloat(0.95f, 1.75f), Color.Lerp(Color.Red, Color.Magenta, 0.3f)); + GeneralParticleHandler.SpawnParticle(orb); + } + } + } + + // miscCounter is used to limit Calamity's hit rate. + if (Player.miscCounter % Calamity.FramesPerHit != 1) + return; + // Brighten the sigil because it is dealing damage. This can only happen once per hit event. if (!brightenedSigil) { @@ -729,13 +754,15 @@ namespace CalamityMod.CalPlayer // Create a direct strike to hit this specific NPC. var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); - Projectile sigilStrike = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), sigilDamage, 0f, Player.whoAmI, target.whoAmI); + Projectile sigilStrike = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), sigilDamage, 0f, Player.whoAmI, target.whoAmI, 1f); // Enable crits by setting the sigil's damage class to be whatever the player's strongest damage class is. sigilStrike.DamageType = Player.GetBestClass(); - // Incinerate the target with Vulnerability Hex. - target.AddBuff(ModContent.BuffType(), VulnerabilityHex.CalamityDuration); + // Incinerate the target with either Vulnerability Hex or True Vulnerability Hex, depending on current cursor focus. + // This adds 8 to the buff duration, which results in a net increase of 3 frames every time damage is dealt, due to damage occurring every 5 frames. + int buffToInflict = target.Calamity().trueVulnerabilityHex > 0 ? ModContent.BuffType() : ModContent.BuffType(); + target.AddBuff(buffToInflict, target.Calamity().trueVulnerabilityHex > 0 ? target.Calamity().trueVulnerabilityHex + 8 : target.Calamity().vulnerabilityHex < VulnerabilityHex.CalamityDuration ? VulnerabilityHex.CalamityDuration : target.Calamity().vulnerabilityHex + 8); // Make some fancy dust to indicate damage is being done. for (int j = 0; j < 12; j++) @@ -1515,6 +1542,17 @@ namespace CalamityMod.CalPlayer hideOfDeusTimer--; if (murasamaHitCooldown > 0) murasamaHitCooldown--; + if (burningSeaBurnOut > 0) + { + burningSeaBurnOut--; + if (Main.rand.NextBool()) + { + Vector2 dustSpawnPos = Player.position + new Vector2(Main.rand.NextFloat(Player.width), 0f); + Vector2 dustVelocity = -Vector2.UnitY * Main.rand.NextFloat(3f, 6f); + Dust burnOutDust = Dust.NewDustPerfect(dustSpawnPos, (int)CalamityDusts.Brimstone, dustVelocity); + burnOutDust.noGravity = true; + } + } if (hellbornBoost > 0) hellbornBoost--; if (persecutedEnchantSummonTimer < 1800) diff --git a/CalamityMod.cs b/CalamityMod.cs index a2417977f0..6c83147131 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -82,6 +82,9 @@ namespace CalamityMod public static int ghostKillCount = 0; public static int sharkKillCount = 0; + // Boss Head Icons + public static int chadPrimeIcon; + public static Asset carpetOriginal; // Astral Sky/BG @@ -374,6 +377,11 @@ namespace CalamityMod ThanatosBody2.LoadHeadIcons(); ThanatosTail.LoadHeadIcons(); + // All the head icon loading shit is done here, so I'm putting this here + string chadPrimeIconPath = "CalamityMod/ExtraTextures/ChadPrime_Head_Boss"; + CalamityMod.Instance.AddBossHeadTexture(chadPrimeIconPath, -1); + chadPrimeIcon = ModContent.GetModBossHeadSlot(chadPrimeIconPath); + // TODO -- Is this not possible to place in ModItem.Load or ModItem.SetStaticDefaults ? // Centralizing hair dye shaders like this seems absurdly stiff GameShaders.Hair.BindShader(ModContent.ItemType(), new LegacyHairShaderData().UseLegacyMethod((Player player, Color newColor, ref bool lighting) => Color.Lerp(player.hairColor, new Color(0, 255, 171), ((float)player.Calamity().adrenaline / (float)player.Calamity().adrenalineMax)))); diff --git a/CalamityNetcode.cs b/CalamityNetcode.cs index e5c72d13ab..5271a6b1d2 100644 --- a/CalamityNetcode.cs +++ b/CalamityNetcode.cs @@ -167,11 +167,6 @@ namespace CalamityMod CalamityUtils.SpawnOldDuke(playerIndex2); break; - case CalamityModMessageType.ArmoredDiggerCountdownSync: - int countdown5 = reader.ReadInt32(); - CalamityWorld.ArmoredDiggerSpawnCooldown = countdown5; - break; - case CalamityModMessageType.ProvidenceDyeConditionSync: byte npcIndex3 = reader.ReadByte(); (Main.npc[npcIndex3].ModNPC as Providence).hasTakenDaytimeDamage = reader.ReadBoolean(); @@ -412,7 +407,6 @@ namespace CalamityMod SyncSlabCrabAI, PlaceAltCritter, ServersideSpawnOldDuke, - ArmoredDiggerCountdownSync, // TODO -- remove this mechanic entirely ProvidenceDyeConditionSync, // TODO -- this packetstorms if you hit Provi with spam weapons. It should ONLY send a packet if the status changes. PSCChallengeSync, // TODO -- once you've failed the PSC challenge this packetstorms diff --git a/DataStructures/NPCStats.cs b/DataStructures/NPCStats.cs index 34e2e51c80..c1efad8a93 100644 --- a/DataStructures/NPCStats.cs +++ b/DataStructures/NPCStats.cs @@ -645,8 +645,7 @@ namespace CalamityMod { new Tuple(NPCID.Spazmatism, ModContent.ProjectileType()), new int[] { 60, 100, 128, 156, 234 } }, /*{ new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 50, 108, 132, 156, 234 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 70, 120, 148, 176, 264 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 70, 120, 148, 176, 264 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 100, 152, 172, 192, 300 } },*/ + { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 70, 120, 148, 176, 264 } },*/ { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 60, 100, 120, 140, 210 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 70, 120, 136, 152, 228 } }, diff --git a/Effects/CalamityShaders.cs b/Effects/CalamityShaders.cs index 10fef4e0ab..a8976ede23 100644 --- a/Effects/CalamityShaders.cs +++ b/Effects/CalamityShaders.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Effects // Scarlet Devil main spear glowing trail. BEWARE: Is reused by many other items! internal static Effect ScarletDevilShader; - // Yharon border suns (or flame pillars?) unsure. it's one or the other. maybe both + // Yharon border flame pillar trail. internal static Effect BordernadoFireShader; // Photon Ripper hardlight teeth trail shader @@ -99,13 +99,13 @@ namespace CalamityMod.Effects // Exoblade's melee slash trails. Also used by Terratomere internal static Effect ExobladeSlashShader; - // Exoblade's projectile on-hit "aniume slash marks". Also used by Terratomere + // Exoblade's projectile on-hit "anime slash marks". Also used by Terratomere internal static Effect ExobladePierceShader; - // Used by Subsuming Vortex's various vortices. Draws the main vortices + // Used by Subsuming Vortex's various vortices. Draws the main vortices. BEWARE: Reused by Burning Sea's fireball. internal static Effect ExoVortexShader; - // Used by Subsuming Vortex's side vortices. Draws the swirling energy tendrils. + // Used by Subsuming Vortex's small vortices. Draws the trailing energy tendrils. internal static Effect SideStreakTrailShader; // Used by Heavenly Gale's hardlight arrows. diff --git a/ExtraTextures/ChadPrime_Head_Boss.png b/ExtraTextures/ChadPrime_Head_Boss.png new file mode 100644 index 0000000000..313edebc2c Binary files /dev/null and b/ExtraTextures/ChadPrime_Head_Boss.png differ diff --git a/Gores/SkeletronPrimes_RevMaster/ChadPrime1.png b/Gores/SkeletronPrimes_RevMaster/ChadPrime1.png new file mode 100644 index 0000000000..07f2e01333 Binary files /dev/null and b/Gores/SkeletronPrimes_RevMaster/ChadPrime1.png differ diff --git a/Gores/SkeletronPrimes_RevMaster/ChadPrime2.png b/Gores/SkeletronPrimes_RevMaster/ChadPrime2.png new file mode 100644 index 0000000000..303ac4ccde Binary files /dev/null and b/Gores/SkeletronPrimes_RevMaster/ChadPrime2.png differ diff --git a/Gores/SkeletronPrimes_RevMaster/SkeletronPrime2_1.png b/Gores/SkeletronPrimes_RevMaster/SkeletronPrime2_1.png new file mode 100644 index 0000000000..860fd8b8c2 Binary files /dev/null and b/Gores/SkeletronPrimes_RevMaster/SkeletronPrime2_1.png differ diff --git a/Gores/SkeletronPrimes_RevMaster/SkeletronPrime2_2.png b/Gores/SkeletronPrimes_RevMaster/SkeletronPrime2_2.png new file mode 100644 index 0000000000..613ee6e5e1 Binary files /dev/null and b/Gores/SkeletronPrimes_RevMaster/SkeletronPrime2_2.png differ diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index 57937bc0c2..3ed952106c 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -86,8 +86,10 @@ namespace CalamityMod.ILEditing On_Player.UpdateItemDye += FindCalamityItemDyeShader; On_AWorldListItem.GetDifficulty += GetDifficultyOverride; On_Item.GetShimmered += ShimmerEffectEdits; - Terraria.On_Player.Teleport += TPOverride; + On_Player.Teleport += TPOverride; On_NPC.SpawnBoss += TripletsSpawnTextOverride; + On_NPC.DoDeathEvents_BeforeLoot += PreventFoveanatorDefeatMessageIfNotKilledLast; + On_NPC.DoDeathEvents_CelebrateBossDeath += TripletsDefeatTextOverride; // Mana Burn (Chaos Stone) and Chalice of the Blood God IL_Player.ApplyLifeAndOrMana += ManaSicknessAndChaliceBufferHeal; @@ -158,6 +160,9 @@ namespace CalamityMod.ILEditing On_Player.GetPickaxeDamage += RemoveHellforgePickaxeRequirement; On_Player.GetAnglerReward += ImproveAnglerRewards; + On_Player.ItemCheck_CheckCanUse += RemoveCelestialSigilUseLock; + On_Player.ItemCheck_UseEventItems += ApplyCelestialSigilChanges; + // Fix vanilla bugs exposed by Calamity mechanics IL_NPC.NPCLoot += FixSplittingWormBannerDrops; On_NPC.PlayerInteraction += FixSplittingWormInteraction; diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index 1565301674..c17cf1a6e1 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -16,6 +16,7 @@ using CalamityMod.NPCs; using CalamityMod.NPCs.Astral; using CalamityMod.NPCs.AstrumAureus; using CalamityMod.NPCs.Crabulon; +using CalamityMod.NPCs.NormalNPCs; using CalamityMod.NPCs.Ravager; using CalamityMod.Particles; using CalamityMod.Projectiles; @@ -32,6 +33,7 @@ using Mono.Cecil.Cil; using MonoMod.Cil; using ReLogic.Content; using Terraria; +using Terraria.Chat; using Terraria.DataStructures; using Terraria.GameContent; using Terraria.GameContent.Achievements; @@ -782,7 +784,7 @@ namespace CalamityMod.ILEditing private static void AdditiveDrawing(ILContext il) { ILCursor cursor = new(il); - if (!cursor.TryGotoNext(MoveType.After, i => i.MatchCall("DrawWhite"))) + if (!cursor.TryGotoNext(MoveType.After, i => i.MatchCall("Draw"))) return; cursor.EmitDelegate(() => @@ -1553,7 +1555,7 @@ namespace CalamityMod.ILEditing } #endregion - #region Change the Twins' announcement name in Revengeance Master Mode + #region Revengeance Master Mode Twins Shenanigans public static void TripletsSpawnTextOverride(Terraria.On_NPC.orig_SpawnBoss orig, int x, int y, int type, int targetPlayerIndex) { if (Main.masterMode && CalamityWorld.revenge && type == NPCID.Retinazer) @@ -1581,6 +1583,37 @@ namespace CalamityMod.ILEditing orig(x, y, type, targetPlayerIndex); } } + + public static void PreventFoveanatorDefeatMessageIfNotKilledLast(On_NPC.orig_DoDeathEvents_BeforeLoot orig, NPC self, Player closestPlayer) + { + if (Main.masterMode && CalamityWorld.revenge && self.type == ModContent.NPCType() && (NPC.AnyNPCs(NPCID.Spazmatism) || NPC.AnyNPCs(NPCID.Retinazer))) + { + self.value = 0f; + self.boss = false; + return; + } + else + { + orig(self, closestPlayer); + } + } + + public static void TripletsDefeatTextOverride(On_NPC.orig_DoDeathEvents_CelebrateBossDeath orig, NPC self, string typeName) + { + bool correctNPCType = self.type == NPCID.Retinazer || self.type == NPCID.Spazmatism || self.type == ModContent.NPCType(); + if (Main.masterMode && CalamityWorld.revenge && correctNPCType) + { + if (Main.netMode == NetmodeID.SinglePlayer) + Main.NewText(Language.GetTextValue("Announcement.HasBeenDefeated_Plural", CalamityUtils.GetTextValue("Status.Boss.TripletsDefeatName")), 175, 75, 255); + else if (Main.dedServ) + ChatHelper.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasBeenDefeated_Plural", NetworkText.FromKey("Mods.CalamityMod.Status.Boss.TripletsDefeatName")), new Color(175, 75, 255)); + return; + } + else + { + orig(self, typeName); + } + } #endregion } } diff --git a/ILEditing/VanillaStupidityFixingILChanges.cs b/ILEditing/VanillaStupidityFixingILChanges.cs index 284d9c44f0..9503ec198d 100644 --- a/ILEditing/VanillaStupidityFixingILChanges.cs +++ b/ILEditing/VanillaStupidityFixingILChanges.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Reflection; +using CalamityMod.Events; using CalamityMod.Items.Fishing; using CalamityMod.Items.Materials; using CalamityMod.Items.TreasureBags.MiscGrabBags; @@ -11,6 +12,7 @@ using Microsoft.Xna.Framework; using Mono.Cecil.Cil; using MonoMod.Cil; using Terraria; +using Terraria.Audio; using Terraria.DataStructures; using Terraria.GameContent.Drawing; using Terraria.ID; @@ -1002,6 +1004,35 @@ namespace CalamityMod.ILEditing #endregion Make Magma Stone & Fire Gauntlet Dust Toggleable + #region Celestial Sigil Non-Linearity Change + private static bool RemoveCelestialSigilUseLock(On_Player.orig_ItemCheck_CheckCanUse orig, Player self, Item sItem) + { + if (sItem.type == ItemID.CelestialSigil) + return !NPC.AnyNPCs(NPCID.MoonLordCore) && !BossRushEvent.BossRushActive; + + return orig(self, sItem); + } + + private static void ApplyCelestialSigilChanges(On_Player.orig_ItemCheck_UseEventItems orig, Player self, Item sItem) + { + if (self.ItemTimeIsZero && self.itemAnimation > 0 && sItem.type == ItemID.CelestialSigil) + { + if (NPC.AnyNPCs(NPCID.MoonLordCore) || BossRushEvent.BossRushActive) + return; + + SoundEngine.PlaySound(SoundID.Roar, self.Center); + self.ApplyItemTime(sItem); + + if (Main.netMode != NetmodeID.MultiplayerClient) + NPC.SpawnOnPlayer(self.whoAmI, NPCID.MoonLordCore); + else + NetMessage.SendData(MessageID.SpawnBossUseLicenseStartEvent, -1, -1, null, self.whoAmI, NPCID.MoonLordCore); + } + else + orig(self, sItem); + } + #endregion + // 02JUN2024: Ozzatron: The below code is being kept in its initial state for historic value. #region Store The Stupid Fucking Private Wind Map In Public Property private static void StoreWindGrid(On_TileDrawing.orig_Update orig, TileDrawing self) diff --git a/Items/Accessories/Calamity.cs b/Items/Accessories/Calamity.cs index e8e0be61e7..a510018c8f 100644 --- a/Items/Accessories/Calamity.cs +++ b/Items/Accessories/Calamity.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Accessories // This is ONLY the direct DPS of having the cursor over the enemy, not the damage from the flames debuff. // The debuff is VulnerabilityHex, check that file for its DPS. public const int BaseDamage = 320; - public const int HitsPerSecond = 12; + public const int FramesPerHit = 5; public override void SetStaticDefaults() { diff --git a/Items/Armor/Aerospec/AerospecHeadgear.cs b/Items/Armor/Aerospec/AerospecHeadgear.cs index ed6ec52e82..a922ea1698 100644 --- a/Items/Armor/Aerospec/AerospecHeadgear.cs +++ b/Items/Armor/Aerospec/AerospecHeadgear.cs @@ -12,7 +12,6 @@ namespace CalamityMod.Items.Armor.Aerospec public new string LocalizationCategory => "Items.Armor.PreHardmode"; public override void SetStaticDefaults() { - if (Main.netMode != NetmodeID.Server) ArmorIDs.Head.Sets.DrawFullHair[Item.headSlot] = true; } diff --git a/Items/Armor/ForbiddenCirclet.cs b/Items/Armor/ForbiddenCirclet.cs index b2969b7498..682e64538b 100644 --- a/Items/Armor/ForbiddenCirclet.cs +++ b/Items/Armor/ForbiddenCirclet.cs @@ -13,6 +13,12 @@ namespace CalamityMod.Items.Armor public const int tornadoBaseDmg = 80; public const float tornadoBaseKB = 1f; + public override void SetStaticDefaults() + { + if (Main.netMode != NetmodeID.Server) + ArmorIDs.Head.Sets.DrawFullHair[Item.headSlot] = true; + } + public override void SetDefaults() { Item.width = 18; diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 131e9d5158..1f5f64a2b6 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -645,13 +645,6 @@ namespace CalamityMod.Items if (item.type == ItemID.Mushroom && player.Calamity().fungalSymbiote) player.AddBuff(ModContent.BuffType(), 3600); - // Moon Lord instantly spawns when Celestial Sigil is used. - if (item.type == ItemID.CelestialSigil) - { - NPC.MoonLordCountdown = 1; - NetMessage.SendData(MessageID.MoonlordHorror, -1, -1, null, NPC.MoonLordCountdown); - } - // Staff/Axe of Regrowth growing Calamity grass if (item.type == ItemID.StaffofRegrowth || item.type == ItemID.AcornAxe) { diff --git a/Items/DraedonMisc/AdvancedDisplay.cs b/Items/DraedonMisc/AdvancedDisplay.cs index b0b9e79122..fddad17b75 100644 --- a/Items/DraedonMisc/AdvancedDisplay.cs +++ b/Items/DraedonMisc/AdvancedDisplay.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.DraedonMisc Item.consumable = true; Item.useStyle = ItemUseStyleID.Swing; Item.rare = ItemRarityID.Yellow; - Item.useTime = Item.useAnimation = 15; + Item.useAnimation = Item.useTime = 15; } public override bool? UseItem(Player player) => true; diff --git a/Items/DraedonMisc/AuricQuantumCoolingCell.cs b/Items/DraedonMisc/AuricQuantumCoolingCell.cs index 65bd24df8e..b752b5aa9e 100644 --- a/Items/DraedonMisc/AuricQuantumCoolingCell.cs +++ b/Items/DraedonMisc/AuricQuantumCoolingCell.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.DraedonMisc Item.maxStack = 9999; Item.consumable = true; Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = Item.useAnimation = 15; + Item.useAnimation = Item.useTime = 15; Item.rare = ModContent.RarityType(); } diff --git a/Items/DraedonMisc/DecryptionComputer.cs b/Items/DraedonMisc/DecryptionComputer.cs index 4fe0a20244..0359880964 100644 --- a/Items/DraedonMisc/DecryptionComputer.cs +++ b/Items/DraedonMisc/DecryptionComputer.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.DraedonMisc Item.consumable = true; Item.useStyle = ItemUseStyleID.Swing; Item.rare = ItemRarityID.Orange; - Item.useTime = Item.useAnimation = 15; + Item.useAnimation = Item.useTime = 15; } public override bool? UseItem(Player player) => true; diff --git a/Items/DraedonMisc/LongRangedSensorArray.cs b/Items/DraedonMisc/LongRangedSensorArray.cs index 3f0475db85..7fcb37eb7c 100644 --- a/Items/DraedonMisc/LongRangedSensorArray.cs +++ b/Items/DraedonMisc/LongRangedSensorArray.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.DraedonMisc Item.consumable = true; Item.useStyle = ItemUseStyleID.Swing; Item.rare = ItemRarityID.Pink; - Item.useTime = Item.useAnimation = 15; + Item.useAnimation = Item.useTime = 15; } public override bool? UseItem(Player player) => true; diff --git a/Items/DraedonMisc/VoltageRegulationSystem.cs b/Items/DraedonMisc/VoltageRegulationSystem.cs index 54508adb22..3f597ca9ae 100644 --- a/Items/DraedonMisc/VoltageRegulationSystem.cs +++ b/Items/DraedonMisc/VoltageRegulationSystem.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.DraedonMisc Item.consumable = true; Item.useStyle = ItemUseStyleID.Swing; Item.rare = ModContent.RarityType(); - Item.useTime = Item.useAnimation = 15; + Item.useAnimation = Item.useTime = 15; } public override bool? UseItem(Player player) => true; diff --git a/Items/Fishing/SunkenSeaCatches/SparklingEmpress.cs b/Items/Fishing/SunkenSeaCatches/SparklingEmpress.cs index 1688295a81..488478e39d 100644 --- a/Items/Fishing/SunkenSeaCatches/SparklingEmpress.cs +++ b/Items/Fishing/SunkenSeaCatches/SparklingEmpress.cs @@ -21,21 +21,20 @@ namespace CalamityMod.Items.Fishing.SunkenSeaCatches Item.width = 44; Item.height = 44; Item.damage = BaseDamage; - Item.noMelee = true; Item.DamageType = DamageClass.Magic; - Item.channel = true; //Channel so that you can hold the weapon [Important] - Item.rare = ItemRarityID.Green; Item.mana = 5; - Item.useTime = 20; - Item.useAnimation = 20; + Item.useAnimation = Item.useTime = 20; + Item.knockBack = 0.25f; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 14f; + Item.UseSound = SoundID.Item13; Item.useStyle = ItemUseStyleID.Shoot; - Item.shootSpeed = 14f; - Item.shoot = ModContent.ProjectileType(); + Item.channel = true; //Channel so that you can hold the weapon [Important] + Item.noMelee = true; + + Item.rare = ItemRarityID.Green; Item.value = CalamityGlobalItem.RarityGreenBuyPrice; } - - //Looks scuffed with the laser when there is offset - //public override Vector2? HoldoutOrigin() => new Vector2(10, 10); } } diff --git a/Items/LabFinders/CyanSeekingMechanism.cs b/Items/LabFinders/CyanSeekingMechanism.cs index d5103b32ab..f37e8d84cb 100644 --- a/Items/LabFinders/CyanSeekingMechanism.cs +++ b/Items/LabFinders/CyanSeekingMechanism.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.LabFinders Item.height = 26; Item.noUseGraphic = true; Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = Item.useAnimation = 36; + Item.useAnimation = Item.useTime = 36; Item.shoot = ModContent.ProjectileType(); Item.Calamity().MaxCharge = 100; Item.Calamity().ChargePerUse = 10; diff --git a/Items/LabFinders/GreenSeekingMechanism.cs b/Items/LabFinders/GreenSeekingMechanism.cs index 97aac930c6..47b7728999 100644 --- a/Items/LabFinders/GreenSeekingMechanism.cs +++ b/Items/LabFinders/GreenSeekingMechanism.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.LabFinders Item.height = 26; Item.noUseGraphic = true; Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = Item.useAnimation = 36; + Item.useAnimation = Item.useTime = 36; Item.shoot = ModContent.ProjectileType(); Item.Calamity().MaxCharge = 100; Item.Calamity().ChargePerUse = 10; diff --git a/Items/LabFinders/OnyxSeekingMechanism.cs b/Items/LabFinders/OnyxSeekingMechanism.cs index f07c064ebc..8e30cd31e1 100644 --- a/Items/LabFinders/OnyxSeekingMechanism.cs +++ b/Items/LabFinders/OnyxSeekingMechanism.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.LabFinders Item.height = 26; Item.noUseGraphic = true; Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = Item.useAnimation = 36; + Item.useAnimation = Item.useTime = 36; Item.shoot = ModContent.ProjectileType(); Item.Calamity().MaxCharge = 100; Item.Calamity().ChargePerUse = 10; diff --git a/Items/LabFinders/RedSeekingMechanism.cs b/Items/LabFinders/RedSeekingMechanism.cs index 0634c3d81c..98928ba1e7 100644 --- a/Items/LabFinders/RedSeekingMechanism.cs +++ b/Items/LabFinders/RedSeekingMechanism.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.LabFinders Item.height = 26; Item.noUseGraphic = true; Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = Item.useAnimation = 36; + Item.useAnimation = Item.useTime = 36; Item.shoot = ModContent.ProjectileType(); Item.Calamity().MaxCharge = 100; Item.Calamity().ChargePerUse = 10; diff --git a/Items/LabFinders/WhiteSeekingMechanism.cs b/Items/LabFinders/WhiteSeekingMechanism.cs index 10b2d4f39f..3bea74715c 100644 --- a/Items/LabFinders/WhiteSeekingMechanism.cs +++ b/Items/LabFinders/WhiteSeekingMechanism.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.LabFinders Item.height = 26; Item.noUseGraphic = true; Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = Item.useAnimation = 36; + Item.useAnimation = Item.useTime = 36; Item.shoot = ModContent.ProjectileType(); Item.Calamity().MaxCharge = 100; Item.Calamity().ChargePerUse = 10; diff --git a/Items/LabFinders/YellowSeekingMechanism.cs b/Items/LabFinders/YellowSeekingMechanism.cs index 42e6582111..101554b25b 100644 --- a/Items/LabFinders/YellowSeekingMechanism.cs +++ b/Items/LabFinders/YellowSeekingMechanism.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.LabFinders Item.height = 26; Item.noUseGraphic = true; Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = Item.useAnimation = 36; + Item.useAnimation = Item.useTime = 36; Item.shoot = ModContent.ProjectileType(); Item.Calamity().MaxCharge = 100; Item.Calamity().ChargePerUse = 10; diff --git a/Items/Materials/BloodSample.cs b/Items/Materials/BloodSample.cs index 81ab3ccdc8..616251b73c 100644 --- a/Items/Materials/BloodSample.cs +++ b/Items/Materials/BloodSample.cs @@ -1,4 +1,5 @@ using Terraria; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; @@ -11,6 +12,7 @@ namespace CalamityMod.Items.Materials { Item.ResearchUnlockCount = 25; ItemID.Sets.SortingPriorityMaterials[Type] = 68; // Sturdy Fossil + ItemTrader.ChlorophyteExtractinator.AddOption_OneWay(Type, 1, ModContent.ItemType(), 1); } public override void SetDefaults() @@ -20,6 +22,8 @@ namespace CalamityMod.Items.Materials Item.maxStack = 9999; Item.value = Item.buyPrice(0, 0, 50, 0); Item.rare = ItemRarityID.Orange; + + Item.MakeUsableWithChlorophyteExtractinator(); } } } diff --git a/Items/Materials/RottenMatter.cs b/Items/Materials/RottenMatter.cs index e47baf25b3..d2608cf3a3 100644 --- a/Items/Materials/RottenMatter.cs +++ b/Items/Materials/RottenMatter.cs @@ -1,4 +1,5 @@ using Terraria; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; @@ -12,6 +13,7 @@ namespace CalamityMod.Items.Materials { Item.ResearchUnlockCount = 25; ItemID.Sets.SortingPriorityMaterials[Type] = 65; // Crimtane Ore + ItemTrader.ChlorophyteExtractinator.AddOption_OneWay(Type, 1, ModContent.ItemType(), 1); } public override void SetDefaults() @@ -21,6 +23,8 @@ namespace CalamityMod.Items.Materials Item.maxStack = 9999; Item.value = Item.buyPrice(0, 0, 50, 0); Item.rare = ItemRarityID.Orange; + + Item.MakeUsableWithChlorophyteExtractinator(); } } } diff --git a/Items/MomentumCapacitor.cs b/Items/MomentumCapacitor.cs index 5f95ff78f8..047d0c2f01 100644 --- a/Items/MomentumCapacitor.cs +++ b/Items/MomentumCapacitor.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items Item.rare = ItemRarityID.Pink; Item.useStyle = ItemUseStyleID.HoldUp; - Item.useTime = Item.useAnimation = 2; + Item.useAnimation = Item.useTime = 2; Item.noMelee = true; Item.channel = true; Item.autoReuse = true; diff --git a/Items/Mounts/ExoThrone.cs b/Items/Mounts/ExoThrone.cs index e88ceae633..853723fa38 100644 --- a/Items/Mounts/ExoThrone.cs +++ b/Items/Mounts/ExoThrone.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Mounts { Item.width = 32; Item.height = 34; - Item.useTime = Item.useAnimation = 20; + Item.useAnimation = Item.useTime = 20; Item.useStyle = ItemUseStyleID.Shoot; Item.UseSound = SoundID.Item94; Item.noMelee = true; diff --git a/Items/Pets/PineapplePet.cs b/Items/Pets/PineapplePet.cs index 5340c86a40..9951fb4ae7 100644 --- a/Items/Pets/PineapplePet.cs +++ b/Items/Pets/PineapplePet.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Pets Item.width = 32; Item.height = 34; Item.damage = 0; - Item.useTime = Item.useAnimation = 20; + Item.useAnimation = Item.useTime = 20; Item.shoot = ModContent.ProjectileType(); Item.buffType = ModContent.BuffType(); diff --git a/Items/Pets/RottingEyeball.cs b/Items/Pets/RottingEyeball.cs index 2764494b8a..1b282d44e7 100644 --- a/Items/Pets/RottingEyeball.cs +++ b/Items/Pets/RottingEyeball.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Pets Item.height = 30; Item.value = Item.buyPrice(0, 4, 0, 0); Item.damage = 0; - Item.useTime = Item.useAnimation = 20; + Item.useAnimation = Item.useTime = 20; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.UseSound = SoundID.NPCHit2; diff --git a/Items/Pets/TheEtomer.cs b/Items/Pets/TheEtomer.cs index 355db1054d..31cda6968b 100644 --- a/Items/Pets/TheEtomer.cs +++ b/Items/Pets/TheEtomer.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Pets Item.width = 30; Item.height = 34; Item.damage = 0; - Item.useTime = Item.useAnimation = 20; + Item.useAnimation = Item.useTime = 20; Item.shoot = ModContent.ProjectileType(); Item.buffType = ModContent.BuffType(); diff --git a/Items/Placeables/AstralClay.cs b/Items/Placeables/AstralClay.cs index 3cb89b4062..0f3c7854ce 100644 --- a/Items/Placeables/AstralClay.cs +++ b/Items/Placeables/AstralClay.cs @@ -1,4 +1,5 @@ -using Terraria.ID; +using Terraria.GameContent; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables @@ -9,20 +10,9 @@ namespace CalamityMod.Items.Placeables public override void SetStaticDefaults() { Item.ResearchUnlockCount = 100; + ItemTrader.ChlorophyteExtractinator.AddOption_OneWay(Type, 1, ItemID.ClayBlock, 1); } - public override void SetDefaults() - { - Item.width = 16; - Item.height = 16; - Item.createTile = ModContent.TileType(); - Item.useStyle = ItemUseStyleID.Swing; - Item.useTurn = true; - Item.useAnimation = 15; - Item.useTime = 10; - Item.autoReuse = true; - Item.consumable = true; - Item.maxStack = 9999; - } + public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); } } diff --git a/Items/Placeables/AstralDirt.cs b/Items/Placeables/AstralDirt.cs index e182fd3bbf..dd7983486c 100644 --- a/Items/Placeables/AstralDirt.cs +++ b/Items/Placeables/AstralDirt.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Placeables.Walls; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; @@ -10,21 +11,10 @@ namespace CalamityMod.Items.Placeables public override void SetStaticDefaults() { Item.ResearchUnlockCount = 100; + ItemTrader.ChlorophyteExtractinator.AddOption_OneWay(Type, 1, ItemID.DirtBlock, 1); } - public override void SetDefaults() - { - Item.width = 16; - Item.height = 16; - Item.createTile = ModContent.TileType(); - Item.useStyle = ItemUseStyleID.Swing; - Item.useTurn = true; - Item.useAnimation = 15; - Item.useTime = 10; - Item.autoReuse = true; - Item.consumable = true; - Item.maxStack = 9999; - } + public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); public override void AddRecipes() { diff --git a/Items/Placeables/AstralIce.cs b/Items/Placeables/AstralIce.cs index 608a38ae5d..c4e2600255 100644 --- a/Items/Placeables/AstralIce.cs +++ b/Items/Placeables/AstralIce.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Placeables.Walls; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; @@ -10,22 +11,11 @@ namespace CalamityMod.Items.Placeables public override void SetStaticDefaults() { Item.ResearchUnlockCount = 100; + ItemTrader.ChlorophyteExtractinator.AddOption_OneWay(Type, 1, ItemID.IceBlock, 1); ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } - public override void SetDefaults() - { - Item.width = 16; - Item.height = 16; - Item.createTile = ModContent.TileType(); - Item.useStyle = ItemUseStyleID.Swing; - Item.useTurn = true; - Item.useAnimation = 15; - Item.useTime = 10; - Item.autoReuse = true; - Item.consumable = true; - Item.maxStack = 9999; - } + public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); public override void AddRecipes() { diff --git a/Items/Placeables/AstralSand.cs b/Items/Placeables/AstralSand.cs index 2a2e4f9987..2798bc9f2d 100644 --- a/Items/Placeables/AstralSand.cs +++ b/Items/Placeables/AstralSand.cs @@ -1,4 +1,5 @@ using CalamityMod.Projectiles.Typeless; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; @@ -10,6 +11,7 @@ namespace CalamityMod.Items.Placeables public override void SetStaticDefaults() { Item.ResearchUnlockCount = 100; + ItemTrader.ChlorophyteExtractinator.AddOption_OneWay(Type, 1, ItemID.SandBlock, 1); // +5 flat damage, equal to other sand variants ItemID.Sets.SandgunAmmoProjectileData[Type] = new(ModContent.ProjectileType(), 5); diff --git a/Items/Placeables/AstralSandstone.cs b/Items/Placeables/AstralSandstone.cs index 2537e7510e..34d23c4896 100644 --- a/Items/Placeables/AstralSandstone.cs +++ b/Items/Placeables/AstralSandstone.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Placeables.Walls; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; @@ -10,22 +11,11 @@ namespace CalamityMod.Items.Placeables public override void SetStaticDefaults() { Item.ResearchUnlockCount = 100; + ItemTrader.ChlorophyteExtractinator.AddOption_OneWay(Type, 1, ItemID.Sandstone, 1); ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } - public override void SetDefaults() - { - Item.width = 16; - Item.height = 16; - Item.createTile = ModContent.TileType(); - Item.useStyle = ItemUseStyleID.Swing; - Item.useTurn = true; - Item.useAnimation = 15; - Item.useTime = 10; - Item.autoReuse = true; - Item.consumable = true; - Item.maxStack = 9999; - } + public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); public override void AddRecipes() { diff --git a/Items/Placeables/AstralSnow.cs b/Items/Placeables/AstralSnow.cs index 1da3544eb5..897c56199e 100644 --- a/Items/Placeables/AstralSnow.cs +++ b/Items/Placeables/AstralSnow.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Placeables.Walls; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; @@ -10,21 +11,10 @@ namespace CalamityMod.Items.Placeables public override void SetStaticDefaults() { Item.ResearchUnlockCount = 100; + ItemTrader.ChlorophyteExtractinator.AddOption_OneWay(Type, 1, ItemID.SnowBlock, 1); } - public override void SetDefaults() - { - Item.width = 16; - Item.height = 16; - Item.createTile = ModContent.TileType(); - Item.useStyle = ItemUseStyleID.Swing; - Item.useTurn = true; - Item.useAnimation = 15; - Item.useTime = 10; - Item.autoReuse = true; - Item.consumable = true; - Item.maxStack = 9999; - } + public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); public override void AddRecipes() { diff --git a/Items/Placeables/AstralStone.cs b/Items/Placeables/AstralStone.cs index 81e70c31ad..61813bd8c0 100644 --- a/Items/Placeables/AstralStone.cs +++ b/Items/Placeables/AstralStone.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Placeables.Walls; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; @@ -10,21 +11,10 @@ namespace CalamityMod.Items.Placeables public override void SetStaticDefaults() { Item.ResearchUnlockCount = 100; + ItemTrader.ChlorophyteExtractinator.AddOption_OneWay(Type, 1, ItemID.StoneBlock, 1); } - public override void SetDefaults() - { - Item.width = 16; - Item.height = 16; - Item.createTile = ModContent.TileType(); - Item.useStyle = ItemUseStyleID.Swing; - Item.useTurn = true; - Item.useAnimation = 15; - Item.useTime = 10; - Item.autoReuse = true; - Item.consumable = true; - Item.maxStack = 9999; - } + public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); public override void AddRecipes() { diff --git a/Items/Placeables/Furniture/CorruptionEffigy.cs b/Items/Placeables/Furniture/CorruptionEffigy.cs index 952ae9d7ad..7e8b25b434 100644 --- a/Items/Placeables/Furniture/CorruptionEffigy.cs +++ b/Items/Placeables/Furniture/CorruptionEffigy.cs @@ -1,4 +1,5 @@ using Terraria; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; @@ -7,21 +8,9 @@ namespace CalamityMod.Items.Placeables.Furniture public class CorruptionEffigy : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; - public override void SetDefaults() - { - Item.width = 28; - Item.height = 32; - Item.maxStack = 9999; - Item.useTurn = true; - Item.autoReuse = true; - Item.useAnimation = 15; - Item.useTime = 10; - Item.useStyle = ItemUseStyleID.Swing; - Item.consumable = true; - Item.value = Item.buyPrice(0, 9, 0, 0); - Item.rare = ItemRarityID.Orange; - Item.createTile = ModContent.TileType(); - } + public override void SetStaticDefaults() => ItemTrader.ChlorophyteExtractinator.AddOption_OneWay(Type, 1, ModContent.ItemType(), 1); + + public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); public override void AddRecipes() { diff --git a/Items/Placeables/Furniture/CrimsonEffigy.cs b/Items/Placeables/Furniture/CrimsonEffigy.cs index bcd700ffa9..ce481299e8 100644 --- a/Items/Placeables/Furniture/CrimsonEffigy.cs +++ b/Items/Placeables/Furniture/CrimsonEffigy.cs @@ -1,4 +1,5 @@ using Terraria; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; @@ -7,21 +8,9 @@ namespace CalamityMod.Items.Placeables.Furniture public class CrimsonEffigy : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; - public override void SetDefaults() - { - Item.width = 22; - Item.height = 32; - Item.maxStack = 9999; - Item.useTurn = true; - Item.autoReuse = true; - Item.useAnimation = 15; - Item.useTime = 10; - Item.useStyle = ItemUseStyleID.Swing; - Item.consumable = true; - Item.value = Item.buyPrice(0, 9, 0, 0); - Item.rare = ItemRarityID.Orange; - Item.createTile = ModContent.TileType(); - } + public override void SetStaticDefaults() => ItemTrader.ChlorophyteExtractinator.AddOption_OneWay(Type, 1, ModContent.ItemType(), 1); + + public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); public override void AddRecipes() { diff --git a/Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs b/Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs index 17d54c85f6..9590db7966 100644 --- a/Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs +++ b/Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs @@ -155,7 +155,6 @@ namespace CalamityMod.Items.Placeables.Furniture.DevPaintings "MarieArk", "Minecat", "Mrrp", - "Mr.Small", "Nao", "Neverglide", "Nincity", diff --git a/Items/Placeables/Furniture/SunkenIdol.cs b/Items/Placeables/Furniture/SunkenIdol.cs new file mode 100644 index 0000000000..69c165a051 --- /dev/null +++ b/Items/Placeables/Furniture/SunkenIdol.cs @@ -0,0 +1,25 @@ +using CalamityMod.Tiles.Furniture; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.Furniture +{ + public class SunkenIdol : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.width = 34; + Item.height = 38; + 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(); + Item.Calamity().donorItem = true; + } + } +} diff --git a/Items/Placeables/Furniture/SunkenIdol.png b/Items/Placeables/Furniture/SunkenIdol.png new file mode 100644 index 0000000000..319fc574b4 Binary files /dev/null and b/Items/Placeables/Furniture/SunkenIdol.png differ diff --git a/Items/Placeables/HardenedAstralSand.cs b/Items/Placeables/HardenedAstralSand.cs index ba66ae62c3..6d58430974 100644 --- a/Items/Placeables/HardenedAstralSand.cs +++ b/Items/Placeables/HardenedAstralSand.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Placeables.Walls; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Placeables @@ -9,22 +10,11 @@ namespace CalamityMod.Items.Placeables public override void SetStaticDefaults() { Item.ResearchUnlockCount = 100; + ItemTrader.ChlorophyteExtractinator.AddOption_OneWay(Type, 1, ItemID.HardenedSand, 1); ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } - public override void SetDefaults() - { - Item.width = 16; - Item.height = 16; - Item.createTile = ModContent.TileType(); - Item.useStyle = ItemUseStyleID.Swing; - Item.useTurn = true; - Item.useAnimation = 15; - Item.useTime = 10; - Item.autoReuse = true; - Item.consumable = true; - Item.maxStack = 9999; - } + public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); public override void AddRecipes() { diff --git a/Items/RelicOfConvergence.cs b/Items/RelicOfConvergence.cs index 4ed4266d9f..8d433aca1a 100644 --- a/Items/RelicOfConvergence.cs +++ b/Items/RelicOfConvergence.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items { Item.width = 32; Item.height = 46; - Item.useTime = Item.useAnimation = 25; + Item.useAnimation = Item.useTime = 25; Item.useStyle = ItemUseStyleID.Shoot; Item.UseSound = SoundID.DD2_DarkMageCastHeal; Item.noMelee = true; diff --git a/Items/Tools/MarniteDeconstructor.cs b/Items/Tools/MarniteDeconstructor.cs index 6938d7deb3..e1164777f5 100644 --- a/Items/Tools/MarniteDeconstructor.cs +++ b/Items/Tools/MarniteDeconstructor.cs @@ -16,31 +16,28 @@ namespace CalamityMod.Items.Tools Item.width = 36; Item.height = 18; Item.damage = 6; - Item.ArmorPenetration = 10; - Item.knockBack = 0f; - Item.useTime = 4; - Item.useAnimation = 25; - Item.hammer = 59; - Item.DamageType = TrueMeleeNoSpeedDamageClass.Instance; - Item.channel = true; - Item.noUseGraphic = true; - Item.noMelee = true; - Item.useStyle = ItemUseStyleID.Shoot; - Item.value = CalamityGlobalItem.RarityBlueBuyPrice; - Item.rare = ItemRarityID.Blue; - Item.UseSound = SoundID.Item23; - Item.autoReuse = true; + Item.ArmorPenetration = 10; + Item.hammer = 59; + Item.tileBoost = 7; + Item.useAnimation = 25; + Item.useTime = 4; + Item.knockBack = 0.5f; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 40f; - Item.tileBoost = 7; - } - public override void HoldItem(Player player) - { - player.Calamity().mouseWorldListener = true; + Item.UseSound = SoundID.Item23; + Item.useStyle = ItemUseStyleID.Shoot; + Item.autoReuse = true; + Item.channel = true; + Item.noMelee = true; + Item.noUseGraphic = true; + + Item.value = CalamityGlobalItem.RarityBlueBuyPrice; + Item.rare = ItemRarityID.Blue; } + public override void HoldItem(Player player) => player.Calamity().mouseWorldListener = true; public override void AddRecipes() { diff --git a/Items/Tools/MarniteObliterator.cs b/Items/Tools/MarniteObliterator.cs index 9b7e9e0541..05f6735a85 100644 --- a/Items/Tools/MarniteObliterator.cs +++ b/Items/Tools/MarniteObliterator.cs @@ -16,31 +16,28 @@ namespace CalamityMod.Items.Tools Item.width = 36; Item.height = 18; Item.damage = 7; - Item.ArmorPenetration = 5; - Item.knockBack = 0f; - Item.useTime = 3; - Item.useAnimation = 25; - Item.pick = 59; - Item.DamageType = TrueMeleeNoSpeedDamageClass.Instance; - Item.channel = true; - Item.noUseGraphic = true; - Item.noMelee = true; - Item.useStyle = ItemUseStyleID.Shoot; - Item.value = CalamityGlobalItem.RarityBlueBuyPrice; - Item.rare = ItemRarityID.Blue; - Item.UseSound = SoundID.Item23; - Item.autoReuse = true; + Item.ArmorPenetration = 5; + Item.pick = 59; + Item.tileBoost = 7; + Item.useAnimation = 25; + Item.useTime = 3; + Item.knockBack = 0.5f; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 40f; - Item.tileBoost = 7; - } - public override void HoldItem(Player player) - { - player.Calamity().mouseWorldListener = true; + Item.UseSound = SoundID.Item23; + Item.useStyle = ItemUseStyleID.Shoot; + Item.autoReuse = true; + Item.channel = true; + Item.noMelee = true; + Item.noUseGraphic = true; + + Item.value = CalamityGlobalItem.RarityBlueBuyPrice; + Item.rare = ItemRarityID.Blue; } + public override void HoldItem(Player player) => player.Calamity().mouseWorldListener = true; public override void AddRecipes() { diff --git a/Items/Tools/WulfrumDiggingTurtle.cs b/Items/Tools/WulfrumDiggingTurtle.cs index f398ed1c3a..01a29ca84e 100644 --- a/Items/Tools/WulfrumDiggingTurtle.cs +++ b/Items/Tools/WulfrumDiggingTurtle.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Tools { Item.width = 30; Item.height = 38; - Item.useTime = Item.useAnimation = 8; + Item.useAnimation = Item.useTime = 8; Item.maxStack = 9999; Item.consumable = true; Item.shootSpeed = 20f; diff --git a/Items/Tools/WulfrumDrill.cs b/Items/Tools/WulfrumDrill.cs index 1a5508fe6d..0d829fad72 100644 --- a/Items/Tools/WulfrumDrill.cs +++ b/Items/Tools/WulfrumDrill.cs @@ -15,29 +15,26 @@ namespace CalamityMod.Items.Tools Item.width = 46; Item.height = 38; Item.damage = 5; - Item.knockBack = 0f; - Item.useTime = 5; - Item.useAnimation = 16; + Item.DamageType = DamageClass.Melee; Item.pick = 35; Item.tileBoost += 1; - - Item.DamageType = DamageClass.Melee; - Item.value = CalamityGlobalItem.RarityBlueBuyPrice; - Item.rare = ItemRarityID.Blue; - Item.UseSound = SoundID.Item23; - Item.autoReuse = true; + Item.useAnimation = 16; + Item.useTime = 5; + Item.knockBack = 0.5f; Item.shoot = ModContent.ProjectileType(); + Item.UseSound = SoundID.Item23; + Item.useStyle = ItemUseStyleID.Shoot; + Item.autoReuse = true; Item.channel = true; Item.noMelee = true; Item.noUseGraphic = true; - Item.useStyle = ItemUseStyleID.Shoot; + + Item.value = CalamityGlobalItem.RarityBlueBuyPrice; + Item.rare = ItemRarityID.Blue; } - public override void HoldItem(Player player) - { - player.Calamity().mouseWorldListener = true; - } + public override void HoldItem(Player player) => player.Calamity().mouseWorldListener = true; public override void AddRecipes() { diff --git a/Items/Tools/WulfrumScaffoldKit.cs b/Items/Tools/WulfrumScaffoldKit.cs index 5214589d07..926cb59b7d 100644 --- a/Items/Tools/WulfrumScaffoldKit.cs +++ b/Items/Tools/WulfrumScaffoldKit.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Tools { Item.width = 52; Item.height = 42; - Item.useTime = Item.useAnimation = 25; + Item.useAnimation = Item.useTime = 25; Item.autoReuse = false; Item.noUseGraphic = true; Item.useStyle = ItemUseStyleID.HiddenAnimation; diff --git a/Items/Tools/WulfrumTreasurePinger.cs b/Items/Tools/WulfrumTreasurePinger.cs index 8ccbada62e..188192ffa2 100644 --- a/Items/Tools/WulfrumTreasurePinger.cs +++ b/Items/Tools/WulfrumTreasurePinger.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Tools { Item.width = 52; Item.height = 42; - Item.useTime = Item.useAnimation = 25; + Item.useAnimation = Item.useTime = 25; Item.autoReuse = false; Item.holdStyle = 16; //Custom hold style Item.useStyle = ItemUseStyleID.Shoot; diff --git a/Items/Weapons/DraedonsArsenal/GaussPistol.cs b/Items/Weapons/DraedonsArsenal/GaussPistol.cs index 144e1db7c4..445df79e74 100644 --- a/Items/Weapons/DraedonsArsenal/GaussPistol.cs +++ b/Items/Weapons/DraedonsArsenal/GaussPistol.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.mana = 6; Item.damage = 150; Item.knockBack = 11f; - Item.useTime = Item.useAnimation = 20; + Item.useAnimation = Item.useTime = 20; Item.autoReuse = true; Item.useStyle = ItemUseStyleID.Shoot; diff --git a/Items/Weapons/DraedonsArsenal/GaussRifle.cs b/Items/Weapons/DraedonsArsenal/GaussRifle.cs index 7be5cf7369..a22932442c 100644 --- a/Items/Weapons/DraedonsArsenal/GaussRifle.cs +++ b/Items/Weapons/DraedonsArsenal/GaussRifle.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.DamageType = DamageClass.Ranged; Item.damage = 150; Item.knockBack = 30f; - Item.useTime = Item.useAnimation = 32; + Item.useAnimation = Item.useTime = 32; Item.autoReuse = true; Item.useStyle = ItemUseStyleID.Shoot; diff --git a/Items/Weapons/DraedonsArsenal/MatterModulator.cs b/Items/Weapons/DraedonsArsenal/MatterModulator.cs index 67952028d0..004fcf0338 100644 --- a/Items/Weapons/DraedonsArsenal/MatterModulator.cs +++ b/Items/Weapons/DraedonsArsenal/MatterModulator.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.DamageType = DamageClass.Ranged; Item.damage = 100; Item.knockBack = 11f; - Item.useTime = Item.useAnimation = 33; + Item.useAnimation = Item.useTime = 33; Item.autoReuse = true; Item.useStyle = ItemUseStyleID.Shoot; diff --git a/Items/Weapons/DraedonsArsenal/MountedScanner.cs b/Items/Weapons/DraedonsArsenal/MountedScanner.cs index 526fc38224..f6a07d25f4 100644 --- a/Items/Weapons/DraedonsArsenal/MountedScanner.cs +++ b/Items/Weapons/DraedonsArsenal/MountedScanner.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.damage = 24; Item.knockBack = 2f; Item.mana = 10; - Item.useTime = Item.useAnimation = 24; + Item.useAnimation = Item.useTime = 24; Item.autoReuse = true; Item.useStyle = ItemUseStyleID.HoldUp; diff --git a/Items/Weapons/DraedonsArsenal/PoleWarper.cs b/Items/Weapons/DraedonsArsenal/PoleWarper.cs index 857a3d038e..f0acad0d57 100644 --- a/Items/Weapons/DraedonsArsenal/PoleWarper.cs +++ b/Items/Weapons/DraedonsArsenal/PoleWarper.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.shootSpeed = 10f; Item.damage = 310; Item.mana = 12; - Item.useTime = Item.useAnimation = 9; + Item.useAnimation = Item.useTime = 9; Item.useStyle = ItemUseStyleID.HoldUp; Item.noMelee = true; Item.knockBack = 8f; diff --git a/Items/Weapons/DraedonsArsenal/PulsePistol.cs b/Items/Weapons/DraedonsArsenal/PulsePistol.cs index 99963fe2dc..14f91533ca 100644 --- a/Items/Weapons/DraedonsArsenal/PulsePistol.cs +++ b/Items/Weapons/DraedonsArsenal/PulsePistol.cs @@ -20,23 +20,22 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.width = 62; Item.height = 22; - Item.DamageType = DamageClass.Magic; Item.damage = 22; - Item.knockBack = 0f; - Item.useTime = Item.useAnimation = 23; - Item.autoReuse = true; + Item.DamageType = DamageClass.Magic; Item.mana = 6; + Item.useAnimation = Item.useTime = 23; + Item.knockBack = 0.25f; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 5.2f; // This may seem low but the shot has 10 extra updates. - Item.useStyle = ItemUseStyleID.Shoot; Item.UseSound = PulseRifle.FireSound; + Item.useStyle = ItemUseStyleID.Shoot; + Item.autoReuse = true; Item.noMelee = true; Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; Item.rare = ItemRarityID.Orange; - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 5.2f; // This may seem low but the shot has 10 extra updates. - modItem.UsesCharge = true; modItem.MaxCharge = 50f; modItem.ChargePerUse = 0.05f; diff --git a/Items/Weapons/DraedonsArsenal/PulseRifle.cs b/Items/Weapons/DraedonsArsenal/PulseRifle.cs index 2076ef309d..3d58c31b72 100644 --- a/Items/Weapons/DraedonsArsenal/PulseRifle.cs +++ b/Items/Weapons/DraedonsArsenal/PulseRifle.cs @@ -30,21 +30,19 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.height = 32; Item.DamageType = DamageClass.Ranged; Item.damage = BaseDamage; - Item.knockBack = 0f; - Item.useTime = 55; - Item.useAnimation = 55; - Item.autoReuse = true; + Item.useAnimation = Item.useTime = 55; + Item.knockBack = 0.25f; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 5f; - Item.useStyle = ItemUseStyleID.Shoot; Item.UseSound = FireSound; + Item.useStyle = ItemUseStyleID.Shoot; + Item.autoReuse = true; Item.noMelee = true; Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; Item.rare = ModContent.RarityType(); - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 5f; - modItem.UsesCharge = true; modItem.MaxCharge = 250f; modItem.ChargePerUse = 0.24f; diff --git a/Items/Weapons/DraedonsArsenal/PulseTurretRemote.cs b/Items/Weapons/DraedonsArsenal/PulseTurretRemote.cs index 15ca250bb3..9c189c6369 100644 --- a/Items/Weapons/DraedonsArsenal/PulseTurretRemote.cs +++ b/Items/Weapons/DraedonsArsenal/PulseTurretRemote.cs @@ -20,24 +20,23 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.width = 28; Item.height = 26; + Item.damage = 150; Item.DamageType = DamageClass.Summon; Item.sentry = true; - Item.damage = 150; - Item.knockBack = 0f; Item.mana = 10; - Item.useTime = Item.useAnimation = 24; - Item.autoReuse = true; + Item.useAnimation = Item.useTime = 24; + Item.knockBack = 0.25f; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 1f; - Item.useStyle = ItemUseStyleID.HoldUp; Item.UseSound = SoundID.Item15; + Item.useStyle = ItemUseStyleID.HoldUp; + Item.autoReuse = true; Item.noMelee = true; Item.value = CalamityGlobalItem.RarityYellowBuyPrice; Item.rare = ItemRarityID.Yellow; - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 1f; - modItem.UsesCharge = true; modItem.MaxCharge = 135f; modItem.ChargePerUse = 1f; diff --git a/Items/Weapons/DraedonsArsenal/SnakeEyes.cs b/Items/Weapons/DraedonsArsenal/SnakeEyes.cs index 7e1b3d2566..fded511217 100644 --- a/Items/Weapons/DraedonsArsenal/SnakeEyes.cs +++ b/Items/Weapons/DraedonsArsenal/SnakeEyes.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.height = 24; Item.damage = 200; Item.mana = 12; - Item.useTime = Item.useAnimation = 14; + Item.useAnimation = Item.useTime = 14; Item.useStyle = ItemUseStyleID.HoldUp; Item.noMelee = true; Item.knockBack = 3f; diff --git a/Items/Weapons/DraedonsArsenal/StarSwallowerContainmentUnit.cs b/Items/Weapons/DraedonsArsenal/StarSwallowerContainmentUnit.cs index 6ae3f691fd..a38dc3a714 100644 --- a/Items/Weapons/DraedonsArsenal/StarSwallowerContainmentUnit.cs +++ b/Items/Weapons/DraedonsArsenal/StarSwallowerContainmentUnit.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.shootSpeed = 10f; Item.damage = 24; Item.mana = 10; - Item.useTime = Item.useAnimation = 30; + Item.useAnimation = Item.useTime = 30; Item.useStyle = ItemUseStyleID.HoldUp; Item.noMelee = true; Item.knockBack = 2.25f; diff --git a/Items/Weapons/DraedonsArsenal/Taser.cs b/Items/Weapons/DraedonsArsenal/Taser.cs index 70f91a0b1e..5f6d56a6e0 100644 --- a/Items/Weapons/DraedonsArsenal/Taser.cs +++ b/Items/Weapons/DraedonsArsenal/Taser.cs @@ -20,22 +20,21 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.width = 50; Item.height = 26; - Item.DamageType = DamageClass.Ranged; Item.damage = 16; - Item.knockBack = 0f; - Item.useTime = Item.useAnimation = 28; - Item.autoReuse = true; + Item.DamageType = DamageClass.Ranged; + Item.useAnimation = Item.useTime = 28; + Item.knockBack = 0.25f; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 25f; - Item.useStyle = ItemUseStyleID.Shoot; Item.UseSound = CommonCalamitySounds.PlasmaBoltSound; + Item.useStyle = ItemUseStyleID.Shoot; + Item.autoReuse = true; Item.noMelee = true; Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; Item.rare = ItemRarityID.Orange; - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 25f; - modItem.UsesCharge = true; modItem.MaxCharge = 50f; modItem.ChargePerUse = 0.05f; diff --git a/Items/Weapons/DraedonsArsenal/TheAnomalysNanogun.cs b/Items/Weapons/DraedonsArsenal/TheAnomalysNanogun.cs index 4c7236b41d..475c24e69e 100644 --- a/Items/Weapons/DraedonsArsenal/TheAnomalysNanogun.cs +++ b/Items/Weapons/DraedonsArsenal/TheAnomalysNanogun.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.height = 44; Item.damage = 1675; Item.knockBack = 4.5f; - Item.useTime = Item.useAnimation = AnomalysNanogunHoldout.PlasmaFireTimer; + Item.useAnimation = Item.useTime = AnomalysNanogunHoldout.PlasmaFireTimer; Item.shootSpeed = 5f; Item.DamageType = DamageClass.Ranged; Item.useStyle = ItemUseStyleID.Shoot; diff --git a/Items/Weapons/DraedonsArsenal/WavePounder.cs b/Items/Weapons/DraedonsArsenal/WavePounder.cs index 96a3b2e987..cd2d2ec4c1 100644 --- a/Items/Weapons/DraedonsArsenal/WavePounder.cs +++ b/Items/Weapons/DraedonsArsenal/WavePounder.cs @@ -20,25 +20,23 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal { CalamityGlobalItem modItem = Item.Calamity(); - Item.damage = 75; - Item.DamageType = RogueDamageClass.Instance; - Item.noMelee = true; - Item.noUseGraphic = true; Item.width = 26; Item.height = 44; - Item.useTime = 56; - Item.useAnimation = 56; - Item.autoReuse = true; + Item.damage = 75; + Item.DamageType = RogueDamageClass.Instance; + Item.useAnimation = Item.useTime = 56; + Item.knockBack = 0.25f; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 16f; + + Item.UseSound = SoundID.Item1; Item.useStyle = ItemUseStyleID.Swing; - Item.knockBack = 0f; + Item.autoReuse = true; + Item.noMelee = true; + Item.noUseGraphic = true; Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; - Item.rare = ModContent.RarityType(); - Item.UseSound = SoundID.Item1; - - Item.shootSpeed = 16f; - Item.shoot = ModContent.ProjectileType(); modItem.UsesCharge = true; modItem.MaxCharge = 190f; diff --git a/Items/Weapons/Magic/AbyssShocker.cs b/Items/Weapons/Magic/AbyssShocker.cs index 399ba5cb99..5fca24ab40 100644 --- a/Items/Weapons/Magic/AbyssShocker.cs +++ b/Items/Weapons/Magic/AbyssShocker.cs @@ -16,30 +16,24 @@ namespace CalamityMod.Items.Weapons.Magic Item.width = 86; Item.height = 32; Item.damage = 27; - Item.noMelee = true; Item.DamageType = DamageClass.Magic; - Item.channel = true; - Item.useTime = 19; - Item.useAnimation = 19; + Item.mana = 10; + Item.useAnimation = Item.useTime = 19; + Item.knockBack = 0.25f; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 14f; + Item.UseSound = SoundID.Item13; Item.useStyle = ItemUseStyleID.Shoot; - Item.mana = 10; + Item.autoReuse = true; + Item.noMelee = true; Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; Item.rare = ItemRarityID.Orange; Item.Calamity().donorItem = true; - - Item.autoReuse = true; - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 14f; } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) - { - Projectile.NewProjectile(source, position + velocity * 4.5f, velocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI); - - return false; - } + public override void ModifyShootStats(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback) => position += velocity.SafeNormalize(Vector2.UnitX) * 56f; public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { diff --git a/Items/Weapons/Magic/AcidGun.cs b/Items/Weapons/Magic/AcidGun.cs index 712bb487fe..9594e9d994 100644 --- a/Items/Weapons/Magic/AcidGun.cs +++ b/Items/Weapons/Magic/AcidGun.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.damage = 28; Item.DamageType = DamageClass.Magic; Item.mana = 9; - Item.useTime = Item.useAnimation = 45; + Item.useAnimation = Item.useTime = 45; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 1.5f; diff --git a/Items/Weapons/Magic/AetherfluxCannon.cs b/Items/Weapons/Magic/AetherfluxCannon.cs index 782fffeba9..539b76b5c0 100644 --- a/Items/Weapons/Magic/AetherfluxCannon.cs +++ b/Items/Weapons/Magic/AetherfluxCannon.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.damage = 285; Item.DamageType = DamageClass.Magic; Item.mana = 7; - Item.useTime = Item.useAnimation = UseTime; + Item.useAnimation = Item.useTime = UseTime; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.noUseGraphic = true; diff --git a/Items/Weapons/Magic/AethersWhisper.cs b/Items/Weapons/Magic/AethersWhisper.cs index 84c70e6b73..f240be95f0 100644 --- a/Items/Weapons/Magic/AethersWhisper.cs +++ b/Items/Weapons/Magic/AethersWhisper.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 44; Item.damage = 504; Item.knockBack = 5.5f; - Item.useTime = Item.useAnimation = 24; + Item.useAnimation = Item.useTime = 24; Item.shootSpeed = 12f; Item.shoot = ModContent.ProjectileType(); Item.mana = 30; diff --git a/Items/Weapons/Magic/Apotheosis.cs b/Items/Weapons/Magic/Apotheosis.cs index 183b7f53cb..3cb104ca5a 100644 --- a/Items/Weapons/Magic/Apotheosis.cs +++ b/Items/Weapons/Magic/Apotheosis.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.damage = 230; Item.DamageType = DamageClass.Magic; Item.mana = 42; - Item.useTime = Item.useAnimation = 167; + Item.useAnimation = Item.useTime = 167; Item.useStyle = ItemUseStyleID.Shoot; Item.useTurn = false; Item.noMelee = true; diff --git a/Items/Weapons/Magic/ArtAttack.cs b/Items/Weapons/Magic/ArtAttack.cs index 45d5c5bd1f..b16f045350 100644 --- a/Items/Weapons/Magic/ArtAttack.cs +++ b/Items/Weapons/Magic/ArtAttack.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.damage = 80; Item.DamageType = DamageClass.Magic; Item.mana = 20; - Item.useTime = Item.useAnimation = 24; + Item.useAnimation = Item.useTime = 24; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 2f; diff --git a/Items/Weapons/Magic/BurningSea.cs b/Items/Weapons/Magic/BurningSea.cs index d08ab647d1..47b528c39f 100644 --- a/Items/Weapons/Magic/BurningSea.cs +++ b/Items/Weapons/Magic/BurningSea.cs @@ -9,26 +9,35 @@ namespace CalamityMod.Items.Weapons.Magic public class BurningSea : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Magic"; + + public const float ChargeTime = 240f; + public const float BurnOutTime = 560f; + public const int BurnOutReuseDelay = 150; + public const float FizzleOutTime = 40f; + public override void SetDefaults() { Item.width = 28; Item.height = 30; - Item.damage = 68; + Item.damage = 69; Item.DamageType = DamageClass.Magic; - Item.mana = 15; + Item.mana = 8; Item.useTime = 20; Item.useAnimation = 20; - Item.useStyle = ItemUseStyleID.Shoot; + Item.useStyle = ItemUseStyleID.HoldUp; Item.noMelee = true; - Item.knockBack = 6.5f; + Item.channel = true; + Item.knockBack = 3f; Item.value = CalamityGlobalItem.RarityPinkBuyPrice; Item.rare = ItemRarityID.Pink; Item.UseSound = SoundID.Item20; Item.autoReuse = true; - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 15f; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 5f; } + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0 && player.Calamity().burningSeaBurnOut <= 0; + public override void AddRecipes() { CreateRecipe(). diff --git a/Items/Weapons/Magic/CosmicRainbow.cs b/Items/Weapons/Magic/CosmicRainbow.cs index 7c9c432dc1..deb6294b54 100644 --- a/Items/Weapons/Magic/CosmicRainbow.cs +++ b/Items/Weapons/Magic/CosmicRainbow.cs @@ -18,17 +18,18 @@ namespace CalamityMod.Items.Weapons.Magic Item.damage = 105; Item.DamageType = DamageClass.Magic; Item.mana = 30; - Item.useTime = 35; - Item.useAnimation = 35; - Item.useStyle = ItemUseStyleID.Shoot; - Item.noMelee = true; - Item.knockBack = 0f; - Item.value = CalamityGlobalItem.RarityRedBuyPrice; - Item.rare = ItemRarityID.Red; - Item.UseSound = SoundID.Item67; - Item.autoReuse = true; + Item.useAnimation = Item.useTime = 35; + Item.knockBack = 0.25f; Item.shoot = ProjectileID.RainbowFront; Item.shootSpeed = 18f; + + Item.UseSound = SoundID.Item67; + Item.useStyle = ItemUseStyleID.Shoot; + Item.autoReuse = true; + Item.noMelee = true; + + Item.value = CalamityGlobalItem.RarityRedBuyPrice; + Item.rare = ItemRarityID.Red; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Magic/DarkSpark.cs b/Items/Weapons/Magic/DarkSpark.cs index 57fd0e96be..a865c3c00a 100644 --- a/Items/Weapons/Magic/DarkSpark.cs +++ b/Items/Weapons/Magic/DarkSpark.cs @@ -24,19 +24,20 @@ namespace CalamityMod.Items.Weapons.Magic Item.damage = 60; Item.DamageType = DamageClass.Magic; Item.mana = 10; - Item.useTime = 10; - Item.useAnimation = 10; - Item.useStyle = ItemUseStyleID.HoldUp; + Item.useAnimation = Item.useTime = 10; + Item.knockBack = 0.25f; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 30f; + Item.UseSound = SoundID.Item13; + Item.useStyle = ItemUseStyleID.HoldUp; + Item.channel = true; Item.noMelee = true; Item.noUseGraphic = true; - Item.channel = true; - Item.knockBack = 0f; + Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice; Item.rare = ModContent.RarityType(); Item.Calamity().donorItem = true; - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 30f; } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; diff --git a/Items/Weapons/Magic/Eternity.cs b/Items/Weapons/Magic/Eternity.cs index 0c119bc4cd..cff0b56d52 100644 --- a/Items/Weapons/Magic/Eternity.cs +++ b/Items/Weapons/Magic/Eternity.cs @@ -28,20 +28,20 @@ namespace CalamityMod.Items.Weapons.Magic Item.damage = BaseDamage; Item.DamageType = DamageClass.Magic; Item.mana = 30; - Item.useTime = Item.useAnimation = 120; + Item.useAnimation = Item.useTime = 120; + Item.knockBack = 0.25f; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 0f; + Item.useStyle = ItemUseStyleID.Shoot; + Item.autoReuse = true; + Item.channel = true; Item.noMelee = true; - Item.knockBack = 0f; + Item.noUseGraphic = true; Item.value = CalamityGlobalItem.RarityHotPinkBuyPrice; Item.rare = ModContent.RarityType(); Item.Calamity().devItem = true; - - Item.autoReuse = true; - Item.noUseGraphic = true; - Item.shoot = ModContent.ProjectileType(); - Item.channel = true; - Item.shootSpeed = 0f; } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; public override void ModifyTooltips(List list) diff --git a/Items/Weapons/Magic/EventHorizon.cs b/Items/Weapons/Magic/EventHorizon.cs index bb80dcc498..028b914ecd 100644 --- a/Items/Weapons/Magic/EventHorizon.cs +++ b/Items/Weapons/Magic/EventHorizon.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.DamageType = DamageClass.Magic; Item.mana = 12; - Item.useTime = Item.useAnimation = 32; + Item.useAnimation = Item.useTime = 32; Item.useStyle = ItemUseStyleID.Shoot; Item.autoReuse = true; diff --git a/Items/Weapons/Magic/Genesis.cs b/Items/Weapons/Magic/Genesis.cs index 8d63a9ee54..f1be1b7b33 100644 --- a/Items/Weapons/Magic/Genesis.cs +++ b/Items/Weapons/Magic/Genesis.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Items.Weapons.Magic Item.damage = 65; Item.DamageType = DamageClass.Magic; Item.mana = 20; - Item.useTime = 4; - Item.useAnimation = 4; + + Item.useAnimation = Item.useTime = 5; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 1.5f; diff --git a/Items/Weapons/Magic/GloriousEnd.cs b/Items/Weapons/Magic/GloriousEnd.cs index 59db80cd1d..61de44955a 100644 --- a/Items/Weapons/Magic/GloriousEnd.cs +++ b/Items/Weapons/Magic/GloriousEnd.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 58; Item.damage = 120; Item.knockBack = 10f; - Item.useTime = Item.useAnimation = 30; + Item.useAnimation = Item.useTime = 30; Item.mana = 20; Item.DamageType = DamageClass.Magic; Item.channel = true; diff --git a/Items/Weapons/Magic/HeliumFlash.cs b/Items/Weapons/Magic/HeliumFlash.cs index d8ef36ff1a..5b46315649 100644 --- a/Items/Weapons/Magic/HeliumFlash.cs +++ b/Items/Weapons/Magic/HeliumFlash.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.damage = 5000; Item.knockBack = 9.5f; Item.mana = 80; - Item.useTime = Item.useAnimation = AftershotCooldownFrames; + Item.useAnimation = Item.useTime = AftershotCooldownFrames; Item.autoReuse = true; Item.noMelee = true; Item.channel = true; diff --git a/Items/Weapons/Magic/Heresy.cs b/Items/Weapons/Magic/Heresy.cs index 77c4af47e3..2349832e9d 100644 --- a/Items/Weapons/Magic/Heresy.cs +++ b/Items/Weapons/Magic/Heresy.cs @@ -23,20 +23,20 @@ namespace CalamityMod.Items.Weapons.Magic Item.damage = 960; Item.DamageType = DamageClass.Magic; Item.mana = 15; - Item.useTime = Item.useAnimation = 120; - Item.useStyle = ItemUseStyleID.Shoot; - Item.noMelee = true; + Item.useAnimation = Item.useTime = 120; + Item.knockBack = 0.25f; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 0f; + Item.UseSound = SoundID.DD2_EtherianPortalDryadTouch; - Item.knockBack = 0f; + Item.useStyle = ItemUseStyleID.Shoot; + Item.autoReuse = true; + Item.channel = true; + Item.noMelee = true; + Item.noUseGraphic = true; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; Item.rare = ModContent.RarityType(); - - Item.autoReuse = true; - Item.noUseGraphic = true; - Item.shoot = ModContent.ProjectileType(); - Item.channel = true; - Item.shootSpeed = 0f; } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; diff --git a/Items/Weapons/Magic/IceBarrage.cs b/Items/Weapons/Magic/IceBarrage.cs index 4d17b2bd64..0e079e60fd 100644 --- a/Items/Weapons/Magic/IceBarrage.cs +++ b/Items/Weapons/Magic/IceBarrage.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.damage = 2250; Item.knockBack = 6f; - Item.useTime = Item.useAnimation = 300; + Item.useAnimation = Item.useTime = 300; Item.reuseDelay = 60; Item.useLimitPerAnimation = 1; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Magic/LightGodsBrilliance.cs b/Items/Weapons/Magic/LightGodsBrilliance.cs index a0ef23a3cb..1ab8bcc658 100644 --- a/Items/Weapons/Magic/LightGodsBrilliance.cs +++ b/Items/Weapons/Magic/LightGodsBrilliance.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.damage = 111; Item.DamageType = DamageClass.Magic; Item.mana = 6; - Item.useTime = Item.useAnimation = 4; + Item.useAnimation = Item.useTime = 4; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 3f; diff --git a/Items/Weapons/Magic/Miasma.cs b/Items/Weapons/Magic/Miasma.cs index 5a24f1a067..dc7200d341 100644 --- a/Items/Weapons/Magic/Miasma.cs +++ b/Items/Weapons/Magic/Miasma.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.damage = 40; Item.DamageType = DamageClass.Magic; Item.mana = 16; - Item.useTime = Item.useAnimation = 27; + Item.useAnimation = Item.useTime = 27; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 3f; diff --git a/Items/Weapons/Magic/NanoPurge.cs b/Items/Weapons/Magic/NanoPurge.cs index a0522394b9..f8b8229c06 100644 --- a/Items/Weapons/Magic/NanoPurge.cs +++ b/Items/Weapons/Magic/NanoPurge.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.damage = 60; Item.DamageType = DamageClass.Magic; Item.mana = 8; - Item.useTime = Item.useAnimation = UseTime; + Item.useAnimation = Item.useTime = UseTime; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.noUseGraphic = true; diff --git a/Items/Weapons/Magic/Omicron.cs b/Items/Weapons/Magic/Omicron.cs index e3fa3d8bdf..3eb1249adf 100644 --- a/Items/Weapons/Magic/Omicron.cs +++ b/Items/Weapons/Magic/Omicron.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.damage = 82; Item.DamageType = DamageClass.Magic; Item.mana = 8; - Item.useTime = Item.useAnimation = 4; + Item.useAnimation = Item.useTime = 4; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 1.5f; diff --git a/Items/Weapons/Magic/ParasiticSceptor.cs b/Items/Weapons/Magic/ParasiticSceptor.cs index 78c7903787..58da009461 100644 --- a/Items/Weapons/Magic/ParasiticSceptor.cs +++ b/Items/Weapons/Magic/ParasiticSceptor.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.damage = 12; Item.knockBack = 3f; Item.mana = 10; - Item.useTime = Item.useAnimation = 35; + Item.useAnimation = Item.useTime = 35; Item.autoReuse = true; Item.DamageType = DamageClass.Magic; Item.shootSpeed = 10f; diff --git a/Items/Weapons/Magic/PlasmaRifle.cs b/Items/Weapons/Magic/PlasmaRifle.cs index 24bb921c54..432207b5ff 100644 --- a/Items/Weapons/Magic/PlasmaRifle.cs +++ b/Items/Weapons/Magic/PlasmaRifle.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.damage = 150; Item.mana = 40; Item.DamageType = DamageClass.Magic; - Item.useTime = Item.useAnimation = 8; + Item.useAnimation = Item.useTime = 8; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 4f; diff --git a/Items/Weapons/Magic/RainbowPartyCannon.cs b/Items/Weapons/Magic/RainbowPartyCannon.cs index 6eddc1e9c8..b8883d9978 100644 --- a/Items/Weapons/Magic/RainbowPartyCannon.cs +++ b/Items/Weapons/Magic/RainbowPartyCannon.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.DamageType = DamageClass.Magic; Item.mana = 25; Item.crit += 4; - Item.useTime = Item.useAnimation = 24; + Item.useAnimation = Item.useTime = 24; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 3.5f; diff --git a/Items/Weapons/Magic/SHPC.cs b/Items/Weapons/Magic/SHPC.cs index c984d4a45c..2101b2da51 100644 --- a/Items/Weapons/Magic/SHPC.cs +++ b/Items/Weapons/Magic/SHPC.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.damage = 16; Item.DamageType = DamageClass.Magic; Item.mana = 20; - Item.useTime = Item.useAnimation = 7; + Item.useAnimation = Item.useTime = 7; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 3.25f; diff --git a/Items/Weapons/Magic/ShaderainStaff.cs b/Items/Weapons/Magic/ShaderainStaff.cs index 76e976a116..7fac680a1f 100644 --- a/Items/Weapons/Magic/ShaderainStaff.cs +++ b/Items/Weapons/Magic/ShaderainStaff.cs @@ -36,20 +36,20 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = Item.height = 42; Item.damage = 19; - Item.shootSpeed = 11f; - Item.useTime = Item.useAnimation = 34; - Item.mana = 10; - Item.knockBack = 0f; - - Item.shoot = ModContent.ProjectileType(); - Item.DamageType = DamageClass.Magic; - Item.useStyle = ItemUseStyleID.Shoot; + Item.mana = 10; + Item.useAnimation = Item.useTime = 34; + Item.knockBack = 0.25f; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 11f; + Item.UseSound = SoundID.Item66; - Item.rare = ItemRarityID.Orange; - Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; + Item.useStyle = ItemUseStyleID.Shoot; Item.autoReuse = true; Item.noMelee = true; + + Item.rare = ItemRarityID.Orange; + Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Magic/ShiftingSands.cs b/Items/Weapons/Magic/ShiftingSands.cs index ca5991c6f6..ad97b003f3 100644 --- a/Items/Weapons/Magic/ShiftingSands.cs +++ b/Items/Weapons/Magic/ShiftingSands.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.width = Item.height = 58; Item.damage = 76; Item.knockBack = 5f; - Item.useTime = Item.useAnimation = 30; + Item.useAnimation = Item.useTime = 30; Item.mana = 20; Item.DamageType = DamageClass.Magic; Item.channel = true; diff --git a/Items/Weapons/Magic/SoulPiercer.cs b/Items/Weapons/Magic/SoulPiercer.cs index a0789ea6c9..6fcc104cb2 100644 --- a/Items/Weapons/Magic/SoulPiercer.cs +++ b/Items/Weapons/Magic/SoulPiercer.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.damage = 310; Item.DamageType = DamageClass.Magic; Item.mana = 19; - Item.useTime = Item.useAnimation = 25; + Item.useAnimation = Item.useTime = 25; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 8f; diff --git a/Items/Weapons/Magic/SubsumingVortex.cs b/Items/Weapons/Magic/SubsumingVortex.cs index f699830afb..59d732f8ad 100644 --- a/Items/Weapons/Magic/SubsumingVortex.cs +++ b/Items/Weapons/Magic/SubsumingVortex.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.height = 104; Item.damage = 460; Item.DamageType = DamageClass.Magic; - Item.useTime = Item.useAnimation = 20; + Item.useAnimation = Item.useTime = 20; Item.shootSpeed = 7f; Item.mana = 22; Item.knockBack = 5f; diff --git a/Items/Weapons/Magic/Teslastaff.cs b/Items/Weapons/Magic/Teslastaff.cs index 2611504952..c3435c626c 100644 --- a/Items/Weapons/Magic/Teslastaff.cs +++ b/Items/Weapons/Magic/Teslastaff.cs @@ -23,19 +23,20 @@ namespace CalamityMod.Items.Weapons.Magic Item.damage = 166; Item.DamageType = DamageClass.Magic; Item.mana = 10; - Item.useTime = 10; - Item.useAnimation = 10; - Item.useStyle = ItemUseStyleID.Shoot; + Item.useAnimation = Item.useTime = 10; + Item.reuseDelay = 60; + Item.knockBack = 0.25f; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 30f; + Item.UseSound = CommonCalamitySounds.LightningSound with { Pitch = 1.1f }; + Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.channel = true; - Item.knockBack = 0f; + Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; Item.rare = ModContent.RarityType(); Item.Calamity().donorItem = true; - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 30f; - Item.reuseDelay = 60; } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; diff --git a/Items/Weapons/Magic/ThePrince.cs b/Items/Weapons/Magic/ThePrince.cs index d01a32eff6..5adda2791c 100644 --- a/Items/Weapons/Magic/ThePrince.cs +++ b/Items/Weapons/Magic/ThePrince.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.DamageType = DamageClass.Magic; Item.noMelee = true; Item.mana = 12; - Item.useTime = Item.useAnimation = 21; + Item.useAnimation = Item.useTime = 21; Item.useStyle = ItemUseStyleID.Shoot; Item.autoReuse = true; Item.UseSound = SoundID.DD2_FlameburstTowerShot; diff --git a/Items/Weapons/Magic/TheSwarmer.cs b/Items/Weapons/Magic/TheSwarmer.cs index 35d5d257f3..665c7963e1 100644 --- a/Items/Weapons/Magic/TheSwarmer.cs +++ b/Items/Weapons/Magic/TheSwarmer.cs @@ -26,6 +26,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.autoReuse = true; Item.shoot = ProjectileID.Wasp; Item.shootSpeed = 12f; + Item.knockBack = 0.25f; } public override Vector2? HoldoutOffset() => new Vector2(-15, -5); diff --git a/Items/Weapons/Magic/VeeringWind.cs b/Items/Weapons/Magic/VeeringWind.cs index 7adc9d4a4d..0e4705aa56 100644 --- a/Items/Weapons/Magic/VeeringWind.cs +++ b/Items/Weapons/Magic/VeeringWind.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.damage = 19; Item.DamageType = DamageClass.Magic; Item.mana = 14; - Item.useTime = Item.useAnimation = 36; + Item.useAnimation = Item.useTime = 36; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 10f; diff --git a/Items/Weapons/Magic/Vehemence.cs b/Items/Weapons/Magic/Vehemence.cs index f5304189d4..f32aa8b0bf 100644 --- a/Items/Weapons/Magic/Vehemence.cs +++ b/Items/Weapons/Magic/Vehemence.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.damage = 6666; Item.DamageType = DamageClass.Magic; Item.mana = 41; - Item.useTime = Item.useAnimation = 43; + Item.useAnimation = Item.useTime = 43; Item.noUseGraphic = true; Item.channel = true; Item.useStyle = ItemUseStyleID.Shoot; diff --git a/Items/Weapons/Magic/VoidVortex.cs b/Items/Weapons/Magic/VoidVortex.cs index c60e56b414..05b97f47e8 100644 --- a/Items/Weapons/Magic/VoidVortex.cs +++ b/Items/Weapons/Magic/VoidVortex.cs @@ -26,17 +26,18 @@ namespace CalamityMod.Items.Weapons.Magic Item.damage = 210; Item.DamageType = DamageClass.Magic; Item.mana = 60; - Item.useTime = 49; - Item.useAnimation = 49; - Item.useStyle = ItemUseStyleID.Shoot; - Item.noMelee = true; - Item.knockBack = 0f; - Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.rare = ModContent.RarityType(); - Item.UseSound = SoundID.Item20; - Item.autoReuse = true; + Item.useAnimation = Item.useTime = 49; + Item.knockBack = 0.25f; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 12f; + + Item.UseSound = SoundID.Item20; + Item.useStyle = ItemUseStyleID.Shoot; + Item.autoReuse = true; + Item.noMelee = true; + + Item.value = CalamityGlobalItem.RarityVioletBuyPrice; + Item.rare = ModContent.RarityType(); } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Magic/YharimsCrystal.cs b/Items/Weapons/Magic/YharimsCrystal.cs index d91a6096e9..a7cee17813 100644 --- a/Items/Weapons/Magic/YharimsCrystal.cs +++ b/Items/Weapons/Magic/YharimsCrystal.cs @@ -21,15 +21,16 @@ namespace CalamityMod.Items.Weapons.Magic Item.damage = 65; Item.DamageType = DamageClass.Magic; Item.mana = 10; - Item.useTime = Item.useAnimation = 10; - Item.useStyle = ItemUseStyleID.Shoot; + Item.useAnimation = Item.useTime = 10; + Item.knockBack = 0.25f; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 30f; + Item.UseSound = SoundID.Item13; + Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.noUseGraphic = true; Item.channel = true; - Item.knockBack = 0f; - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 30f; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; Item.rare = ModContent.RarityType(); diff --git a/Items/Weapons/Melee/DeathsAscension.cs b/Items/Weapons/Melee/DeathsAscension.cs index 248d4901fa..4c4c66b996 100644 --- a/Items/Weapons/Melee/DeathsAscension.cs +++ b/Items/Weapons/Melee/DeathsAscension.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.height = 70; Item.damage = 1200; Item.knockBack = 9f; - Item.useTime = Item.useAnimation = 24; + Item.useAnimation = Item.useTime = 24; Item.DamageType = DamageClass.Melee; Item.noMelee = true; Item.channel = true; diff --git a/Items/Weapons/Melee/GaelsGreatsword.cs b/Items/Weapons/Melee/GaelsGreatsword.cs index c4d9e656db..54745229f2 100644 --- a/Items/Weapons/Melee/GaelsGreatsword.cs +++ b/Items/Weapons/Melee/GaelsGreatsword.cs @@ -31,8 +31,8 @@ namespace CalamityMod.Items.Weapons.Melee //NOTE: GetWeaponDamage is in the CalamityPlayer file public override void SetDefaults() { - Item.width = 112; - Item.height = 102; + Item.width = 108; + Item.height = 100; Item.damage = BaseDamage; Item.DamageType = DamageClass.Melee; Item.useAnimation = Item.useTime = 13; diff --git a/Items/Weapons/Melee/GaelsGreatsword.png b/Items/Weapons/Melee/GaelsGreatsword.png index 5af2cc305c..246cda9d6c 100644 Binary files a/Items/Weapons/Melee/GaelsGreatsword.png and b/Items/Weapons/Melee/GaelsGreatsword.png differ diff --git a/Items/Weapons/Melee/GreatswordofJudgement.cs b/Items/Weapons/Melee/GreatswordofJudgement.cs index b2ded44e87..f05cd26e61 100644 --- a/Items/Weapons/Melee/GreatswordofJudgement.cs +++ b/Items/Weapons/Melee/GreatswordofJudgement.cs @@ -1,31 +1,92 @@ -using CalamityMod.Projectiles.Melee; +using CalamityMod.Dusts; +using CalamityMod.Particles; +using CalamityMod.Projectiles.Melee; +using Terraria; using Terraria.ID; using Terraria.ModLoader; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria.Audio; namespace CalamityMod.Items.Weapons.Melee { public class GreatswordofJudgement : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; + private float swingRoatation = 0; + private int time = 0; + private Color mainColor; + private int swordDirection; + private int useTime = 20; + private int opacityAdjust = 0; + private float smearOpacity = 0; + private bool smearGrowth = true; public override void SetDefaults() { Item.width = 78; Item.height = 78; - Item.damage = 85; + Item.damage = 155; Item.DamageType = DamageClass.Melee; - Item.useAnimation = 18; Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = 18; + Item.useAnimation = Item.useTime = useTime; Item.useTurn = true; Item.knockBack = 7f; - Item.UseSound = SoundID.Item1; + Item.UseSound = SoundID.Item60; Item.autoReuse = true; Item.value = CalamityGlobalItem.RarityPurpleBuyPrice; Item.rare = ItemRarityID.Purple; Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; + Item.shootSpeed = 5f; } + public override void UseItemHitbox(Player player, ref Rectangle hitbox, ref bool noHitbox) + { + float scale = 1.1f; + Vector2 newSize = new Point(hitbox.Width, hitbox.Height).ToVector2() * scale; + hitbox = new Rectangle(hitbox.X - (int)((newSize.X - hitbox.Width) / 2f), hitbox.Y - (int)((newSize.Y - hitbox.Height) / 2f), (int)newSize.X, (int)newSize.Y); + } + public override void UseAnimation(Player player) + { + swordDirection = player.direction; + time = 0; + swingRoatation = 0; + mainColor = Main.rand.NextBool() ? Color.MediumPurple : Color.MediumOrchid; + opacityAdjust = 0; + smearOpacity = 0; + } + public override void MeleeEffects(Player player, Rectangle hitbox) + { + opacityAdjust++; + if (opacityAdjust >= 5 && opacityAdjust <= 15 && smearOpacity < 0.9f) + smearOpacity += 0.1f; + else if (smearOpacity > 0) + smearOpacity -= 0.2f; + time++; + swingRoatation += swordDirection == 1 ? 0.13f : -0.13f; + + float Rot = (swordDirection == -1 ? 1.8f : -1.8f) + swingRoatation; + if (swordDirection != player.direction) + { + swingRoatation *= -1; + swordDirection = player.direction; + } + Particle Smear = new SemiCircularSmearFade(player.Center, Vector2.Zero, mainColor * smearOpacity, Rot, Main.rand.NextFloat(1.95f, 2.2f), new Vector2(1, 1), 2, true, false, true, player.direction); + GeneralParticleHandler.SpawnParticle(Smear); + + if (Main.rand.NextBool(3)) + { + Vector2 dustVel = new Vector2(5 * swordDirection, -5).RotatedByRandom(1.55f) * Main.rand.NextFloat(0.7f, 1.3f); + Dust dust = Dust.NewDustPerfect(player.Center + dustVel * 9, 278); + dust.scale = Main.rand.NextFloat(0.4f, 0.55f); + dust.velocity = dustVel * 0.55f; + dust.color = Main.rand.NextBool() ? Color.MediumPurple : Color.MediumOrchid; + dust.noGravity = true; + } + } + 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/GreatswordofJudgementGlow").Value); + } public override void AddRecipes() { CreateRecipe(). diff --git a/Items/Weapons/Melee/GreatswordofJudgementGlow.png b/Items/Weapons/Melee/GreatswordofJudgementGlow.png index fde78a59ec..346b28b3a3 100644 Binary files a/Items/Weapons/Melee/GreatswordofJudgementGlow.png and b/Items/Weapons/Melee/GreatswordofJudgementGlow.png differ diff --git a/Items/Weapons/Melee/Hellkite.cs b/Items/Weapons/Melee/Hellkite.cs index 9a42ae4f2e..abdee71ea0 100644 --- a/Items/Weapons/Melee/Hellkite.cs +++ b/Items/Weapons/Melee/Hellkite.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.height = 124; Item.damage = 795; Item.DamageType = TrueMeleeDamageClass.Instance; - Item.useTime = Item.useAnimation = 71; + Item.useAnimation = Item.useTime = 71; Item.useTurn = true; Item.knockBack = 13f; Item.autoReuse = true; diff --git a/Items/Weapons/Melee/MantisClaws.cs b/Items/Weapons/Melee/MantisClaws.cs index f7ff3190cb..e088461822 100644 --- a/Items/Weapons/Melee/MantisClaws.cs +++ b/Items/Weapons/Melee/MantisClaws.cs @@ -25,20 +25,19 @@ namespace CalamityMod.Items.Weapons.Melee Item.height = 20; Item.damage = 111; Item.DamageType = DamageClass.Melee; - Item.useStyle = ItemUseStyleID.HiddenAnimation; - Item.noUseGraphic = true; - Item.useAnimation = 25; - Item.noMelee = true; - Item.useTime = 25; + Item.useAnimation = Item.useTime = 25; + Item.knockBack = 0.25f; Item.shoot = ModContent.ProjectileType(); + + Item.useStyle = ItemUseStyleID.HiddenAnimation; Item.autoReuse = true; + Item.noMelee = true; + Item.noUseGraphic = true; + Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; } - public override bool AltFunctionUse(Player player) - { - return true; - } + public override bool AltFunctionUse(Player player) => true; } } diff --git a/Items/Weapons/Melee/Orderbringer.cs b/Items/Weapons/Melee/Orderbringer.cs index 01acc2a755..33a0d18226 100644 --- a/Items/Weapons/Melee/Orderbringer.cs +++ b/Items/Weapons/Melee/Orderbringer.cs @@ -2,8 +2,17 @@ using CalamityMod.Projectiles.Melee; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.Audio; using Terraria.ID; +using Microsoft.Xna.Framework; using Terraria.ModLoader; +using CalamityMod.Particles; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Basic.Reference.Assemblies; +using System; +using Mono.Cecil; namespace CalamityMod.Items.Weapons.Melee { @@ -11,23 +20,104 @@ namespace CalamityMod.Items.Weapons.Melee public class Orderbringer : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; - + private float swingRoatation = 0; + private int time = 0; + private Color mainColor; + private int swordDirection; + private int useTime = 18; + private int opacityAdjust = 0; + private float smearOpacity = 0; + private bool smearGrowth = true; public override void SetDefaults() { Item.width = Item.height = 108; - Item.damage = 128; + Item.damage = 400; Item.DamageType = DamageClass.Melee; - Item.useAnimation = 18; + Item.useAnimation = Item.useTime = useTime; Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = 18; Item.useTurn = true; - Item.knockBack = 7f; - Item.UseSound = SoundID.Item1; + Item.knockBack = 8f; + Item.UseSound = SoundID.Item60; Item.autoReuse = true; Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; Item.rare = ModContent.RarityType(); - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 6f; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 5.5f; + } + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) + { + Projectile.NewProjectile(source, position, velocity, type, (int)(damage * 0.5f), knockback, player.whoAmI, 0f); + + for (int i = 0; i < 4; i++) + { + Vector2 vel = (velocity * 2.5f).RotatedByRandom(0.6f); + Projectile.NewProjectile(source, Main.MouseWorld - (velocity * 40) + Main.rand.NextVector2Circular(130, 130), vel * Main.rand.NextFloat(0.8f, 1.2f), ModContent.ProjectileType(), (int)(damage * 0.25f), knockback * 0.2f, player.whoAmI, 0, 0, 1); + } + return false; + } + public override void UseItemHitbox(Player player, ref Rectangle hitbox, ref bool noHitbox) + { + float scale = 1.2f; + Vector2 newSize = new Point(hitbox.Width, hitbox.Height).ToVector2() * scale; + hitbox = new Rectangle(hitbox.X - (int)((newSize.X - hitbox.Width) / 2f), hitbox.Y - (int)((newSize.Y - hitbox.Height) / 2f), (int)newSize.X, (int)newSize.Y); + } + public override void UseAnimation(Player player) + { + swordDirection = player.direction; + time = 0; + swingRoatation = 0; + mainColor = Main.rand.NextBool() ? Color.MediumPurple : Color.MediumOrchid; + opacityAdjust = 0; + smearOpacity = 0; + } + public override void MeleeEffects(Player player, Rectangle hitbox) + { + opacityAdjust++; + if (opacityAdjust >= 5 && opacityAdjust <= 15 && smearOpacity < 0.9f) + smearOpacity += 0.1f; + else if (smearOpacity > 0) + smearOpacity -= 0.2f; + + time++; + swingRoatation += swordDirection == 1 ? 0.17f : -0.17f; + + float Rot = (swordDirection == -1 ? 1.8f : -1.8f) + swingRoatation; + if (swordDirection != player.direction) + { + swingRoatation *= -1; + swordDirection = player.direction; + } + Particle Smear = new SemiCircularSmearFade(player.Center, Vector2.Zero, mainColor * smearOpacity, Rot, Main.rand.NextFloat(2.8f, 3.2f), new Vector2(1, 1), 2, true, false, true, player.direction); + GeneralParticleHandler.SpawnParticle(Smear); + + if (Main.rand.NextBool()) + { + Vector2 dustVel = new Vector2(5 * swordDirection, -5).RotatedByRandom(1.55f) * Main.rand.NextFloat(0.7f, 1.3f) * 2; + Dust dust = Dust.NewDustPerfect(player.Center + dustVel * 9, 278); + dust.scale = Main.rand.NextFloat(0.5f, 0.75f); + dust.velocity = dustVel * 0.55f; + dust.color = Main.rand.NextBool() ? Color.MediumPurple : Color.MediumOrchid; + dust.noGravity = true; + } + } + public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone) + { + int beamDamage = player.CalcIntDamage(Item.damage * 1.5f); + for (int i = 0; i < 2; i++) + { + Vector2 targetPos = Main.MouseWorld; + NPC target2 = Main.MouseWorld.ClosestNPCAt(650); + if (target2 != null) + targetPos = target2.Center + target2.velocity * 14; + + Vector2 spawnPos = Main.MouseWorld + new Vector2(Main.rand.NextFloat(-300, 300), -900); + Vector2 vel = (targetPos - spawnPos).SafeNormalize(Vector2.UnitY) * 10; + Projectile.NewProjectile(player.GetSource_ItemUse(Item), spawnPos, vel, ModContent.ProjectileType(), beamDamage, 0, player.whoAmI); + } + } + public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) + { + Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request("CalamityMod/Items/Weapons/Melee/GreatswordofJudgementGlow").Value); } public override void AddRecipes() diff --git a/Items/Weapons/Melee/PrismaticBreaker.cs b/Items/Weapons/Melee/PrismaticBreaker.cs index 81ad513f31..64c63a9c01 100644 --- a/Items/Weapons/Melee/PrismaticBreaker.cs +++ b/Items/Weapons/Melee/PrismaticBreaker.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.height = 50; Item.damage = 699; Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = Item.useAnimation = 13; + Item.useAnimation = Item.useTime = 13; Item.useTurn = true; Item.DamageType = MeleeRangedHybridDamageClass.Instance; Item.knockBack = 7f; diff --git a/Items/Weapons/Ranged/ArcNovaDiffuser.cs b/Items/Weapons/Ranged/ArcNovaDiffuser.cs index 2ce192c482..18b34004c5 100644 --- a/Items/Weapons/Ranged/ArcNovaDiffuser.cs +++ b/Items/Weapons/Ranged/ArcNovaDiffuser.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 28; Item.damage = 172; Item.DamageType = DamageClass.Ranged; - Item.useTime = Item.useAnimation = AftershotCooldownFrames; + Item.useAnimation = Item.useTime = AftershotCooldownFrames; Item.noMelee = true; Item.noUseGraphic = true; Item.channel = true; diff --git a/Items/Weapons/Ranged/Auralis.cs b/Items/Weapons/Ranged/Auralis.cs index b65b6d0d34..1d5ca3004e 100644 --- a/Items/Weapons/Ranged/Auralis.cs +++ b/Items/Weapons/Ranged/Auralis.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 34; Item.damage = 695; Item.DamageType = DamageClass.Ranged; - Item.useTime = Item.useAnimation = 30; + Item.useAnimation = Item.useTime = 30; Item.knockBack = 10f; Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Ranged/BulletFilledShotgun.cs b/Items/Weapons/Ranged/BulletFilledShotgun.cs index a985c94a1d..4bee81bf6d 100644 --- a/Items/Weapons/Ranged/BulletFilledShotgun.cs +++ b/Items/Weapons/Ranged/BulletFilledShotgun.cs @@ -19,17 +19,18 @@ namespace CalamityMod.Items.Weapons.Ranged Item.width = 64; Item.height = 24; Item.damage = 1; - Item.knockBack = 0f; - Item.useTime = Item.useAnimation = 75; Item.DamageType = DamageClass.Ranged; - Item.noMelee = true; - Item.autoReuse = true; - Item.useAmmo = AmmoID.Bullet; - Item.shootSpeed = 9f; + Item.useAnimation = Item.useTime = 75; + Item.knockBack = 0.25f; Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 9f; - Item.useStyle = ItemUseStyleID.Shoot; + Item.useAmmo = AmmoID.Bullet; Item.UseSound = SoundID.Item38; + Item.useStyle = ItemUseStyleID.Shoot; + Item.autoReuse = true; + Item.noMelee = true; + Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; Item.rare = ItemRarityID.Orange; Item.Calamity().donorItem = true; diff --git a/Items/Weapons/Ranged/ChickenCannon.cs b/Items/Weapons/Ranged/ChickenCannon.cs index 3e803861ed..943a5d6da8 100644 --- a/Items/Weapons/Ranged/ChickenCannon.cs +++ b/Items/Weapons/Ranged/ChickenCannon.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 42; Item.damage = 277; Item.DamageType = DamageClass.Ranged; - Item.useTime = Item.useAnimation = 30; + Item.useAnimation = Item.useTime = 30; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 1.5f; diff --git a/Items/Weapons/Ranged/ClockworkBow.cs b/Items/Weapons/Ranged/ClockworkBow.cs index 64b5d58268..d2de85e06e 100644 --- a/Items/Weapons/Ranged/ClockworkBow.cs +++ b/Items/Weapons/Ranged/ClockworkBow.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 96; Item.damage = 770; Item.DamageType = DamageClass.Ranged; - Item.useTime = Item.useAnimation = 30; + Item.useAnimation = Item.useTime = 30; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.channel = true; diff --git a/Items/Weapons/Ranged/Condemnation.cs b/Items/Weapons/Ranged/Condemnation.cs index 8adb29a61a..e9397aeaca 100644 --- a/Items/Weapons/Ranged/Condemnation.cs +++ b/Items/Weapons/Ranged/Condemnation.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 42; Item.damage = 2130; Item.DamageType = DamageClass.Ranged; - Item.useTime = Item.useAnimation = 22; + Item.useAnimation = Item.useTime = 22; Item.useStyle = ItemUseStyleID.Shoot; Item.channel = true; Item.noMelee = true; diff --git a/Items/Weapons/Ranged/DeadSunsWind.cs b/Items/Weapons/Ranged/DeadSunsWind.cs index 8e81c00b99..c0d52dc602 100644 --- a/Items/Weapons/Ranged/DeadSunsWind.cs +++ b/Items/Weapons/Ranged/DeadSunsWind.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 24; Item.damage = 100; Item.DamageType = DamageClass.Ranged; - Item.useTime = Item.useAnimation = 22; + Item.useAnimation = Item.useTime = 22; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 3.5f; diff --git a/Items/Weapons/Ranged/DeepcoreGK2.cs b/Items/Weapons/Ranged/DeepcoreGK2.cs index b1f059e43b..cd98650a7f 100644 --- a/Items/Weapons/Ranged/DeepcoreGK2.cs +++ b/Items/Weapons/Ranged/DeepcoreGK2.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.ArmorPenetration = 10; Item.DamageType = DamageClass.Ranged; Item.noMelee = true; - Item.useTime = Item.useAnimation = 14; + Item.useAnimation = Item.useTime = 14; Item.useStyle = ItemUseStyleID.Shoot; Item.knockBack = 7f; Item.value = CalamityGlobalItem.RarityPinkBuyPrice; diff --git a/Items/Weapons/Ranged/FetidEmesis.cs b/Items/Weapons/Ranged/FetidEmesis.cs index 79febc9ceb..3d8c6bff62 100644 --- a/Items/Weapons/Ranged/FetidEmesis.cs +++ b/Items/Weapons/Ranged/FetidEmesis.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 46; Item.damage = 239; Item.DamageType = DamageClass.Ranged; - Item.useTime = Item.useAnimation = 6; + Item.useAnimation = Item.useTime = 6; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 5f; diff --git a/Items/Weapons/Ranged/FlakKraken.cs b/Items/Weapons/Ranged/FlakKraken.cs index 707d82448f..8f81cd8cff 100644 --- a/Items/Weapons/Ranged/FlakKraken.cs +++ b/Items/Weapons/Ranged/FlakKraken.cs @@ -37,22 +37,24 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { + Item.width = 152; + Item.height = 58; Item.damage = 124; Item.DamageType = DamageClass.Ranged; - Item.useTime = Item.useAnimation = OriginalUseTime; + Item.useAnimation = Item.useTime = OriginalUseTime; + Item.knockBack = 0.25f; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 15f; - Item.width = 152; - Item.height = 58; + Item.useAmmo = AmmoID.Rocket; + Item.UseSound = new SoundStyle("CalamityMod/Sounds/Item/DudFire") with { Volume = .4f, Pitch = -.95f, PitchVariance = 0.1f }; + Item.useStyle = ItemUseStyleID.Shoot; + Item.channel = true; Item.noMelee = true; Item.noUseGraphic = true; - Item.channel = true; - Item.useAmmo = AmmoID.Rocket; + Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; - Item.useStyle = ItemUseStyleID.Shoot; - Item.UseSound = new SoundStyle("CalamityMod/Sounds/Item/DudFire") with { Volume = .4f, Pitch = -.95f, PitchVariance = 0.1f }; } // Obviously we don't want multiple holdouts existing at the same time. diff --git a/Items/Weapons/Ranged/FlakToxicannon.cs b/Items/Weapons/Ranged/FlakToxicannon.cs index 78d2f57a2b..fc7d92f5ec 100644 --- a/Items/Weapons/Ranged/FlakToxicannon.cs +++ b/Items/Weapons/Ranged/FlakToxicannon.cs @@ -30,22 +30,24 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { + Item.width = 88; + Item.height = 28; Item.damage = 73; // Here you're modifying the shrapnel's damage. Item.DamageType = DamageClass.Ranged; - Item.useTime = Item.useAnimation = 44; + Item.useAnimation = Item.useTime = 44; + Item.knockBack = 0.25f; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 15f; - Item.width = 88; - Item.height = 28; + Item.useAmmo = AmmoID.Rocket; + Item.UseSound = new SoundStyle("CalamityMod/Sounds/Item/DudFire") with { Volume = .4f, Pitch = -.7f, PitchVariance = 0.1f }; + Item.useStyle = ItemUseStyleID.Shoot; + Item.channel = true; Item.noMelee = true; Item.noUseGraphic = true; - Item.channel = true; - Item.useAmmo = AmmoID.Rocket; + Item.value = CalamityGlobalItem.RarityPinkBuyPrice; Item.rare = ItemRarityID.Pink; - Item.useStyle = ItemUseStyleID.Shoot; - Item.UseSound = new SoundStyle("CalamityMod/Sounds/Item/DudFire") with { Volume = .4f, Pitch = -.7f, PitchVariance = 0.1f }; } // Obviously we don't want multiple holdouts existing at the same time. diff --git a/Items/Weapons/Ranged/MagnaCannon.cs b/Items/Weapons/Ranged/MagnaCannon.cs index aa926fe2ab..11c969a986 100644 --- a/Items/Weapons/Ranged/MagnaCannon.cs +++ b/Items/Weapons/Ranged/MagnaCannon.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 34; Item.damage = 30; Item.DamageType = DamageClass.Ranged; - Item.useTime = Item.useAnimation = AftershotCooldownFrames; + Item.useAnimation = Item.useTime = AftershotCooldownFrames; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.noUseGraphic = true; diff --git a/Items/Weapons/Ranged/MineralMortar.cs b/Items/Weapons/Ranged/MineralMortar.cs index 2b06fe3f35..65cb759423 100644 --- a/Items/Weapons/Ranged/MineralMortar.cs +++ b/Items/Weapons/Ranged/MineralMortar.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.damage = 85; Item.DamageType = DamageClass.Ranged; Item.shoot = ModContent.ProjectileType(); - Item.useTime = Item.useAnimation = 60; + Item.useAnimation = Item.useTime = 60; Item.shootSpeed = 25f; Item.knockBack = 20f; diff --git a/Items/Weapons/Ranged/Onyxia.cs b/Items/Weapons/Ranged/Onyxia.cs index 21a2e21bb0..175f3a44a0 100644 --- a/Items/Weapons/Ranged/Onyxia.cs +++ b/Items/Weapons/Ranged/Onyxia.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 34; Item.damage = 90; Item.DamageType = DamageClass.Ranged; - Item.useTime = Item.useAnimation = 10; + Item.useAnimation = Item.useTime = 10; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 4.5f; diff --git a/Items/Weapons/Ranged/OpalStriker.cs b/Items/Weapons/Ranged/OpalStriker.cs index 2367059962..44645c6aa9 100644 --- a/Items/Weapons/Ranged/OpalStriker.cs +++ b/Items/Weapons/Ranged/OpalStriker.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 24; Item.damage = 33; Item.DamageType = DamageClass.Ranged; - Item.useTime = Item.useAnimation = AftershotCooldownFrames; + Item.useAnimation = Item.useTime = AftershotCooldownFrames; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.noUseGraphic = true; diff --git a/Items/Weapons/Ranged/P90.cs b/Items/Weapons/Ranged/P90.cs index 4da198548a..c5874559cb 100644 --- a/Items/Weapons/Ranged/P90.cs +++ b/Items/Weapons/Ranged/P90.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 28; Item.damage = 5; Item.DamageType = DamageClass.Ranged; - Item.useTime = Item.useAnimation = 2; + Item.useAnimation = Item.useTime = 2; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 1.5f; diff --git a/Items/Weapons/Ranged/Photoviscerator.cs b/Items/Weapons/Ranged/Photoviscerator.cs index b9d4a58cf8..5448aaed46 100644 --- a/Items/Weapons/Ranged/Photoviscerator.cs +++ b/Items/Weapons/Ranged/Photoviscerator.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.damage = 495; Item.DamageType = DamageClass.Ranged; - Item.useTime = Item.useAnimation = LightBombCooldown; + Item.useAnimation = Item.useTime = LightBombCooldown; Item.shootSpeed = 6f; Item.knockBack = 2f; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Ranged/PlagueTaintedSMG.cs b/Items/Weapons/Ranged/PlagueTaintedSMG.cs index 1eb3e132a5..52362ce453 100644 --- a/Items/Weapons/Ranged/PlagueTaintedSMG.cs +++ b/Items/Weapons/Ranged/PlagueTaintedSMG.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 50; Item.damage = 78; Item.DamageType = DamageClass.Ranged; - Item.useTime = Item.useAnimation = 12; + Item.useAnimation = Item.useTime = 12; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 2f; diff --git a/Items/Weapons/Ranged/Scorpio.cs b/Items/Weapons/Ranged/Scorpio.cs index 3f01345339..250db8b8fa 100644 --- a/Items/Weapons/Ranged/Scorpio.cs +++ b/Items/Weapons/Ranged/Scorpio.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.damage = 33; Item.DamageType = DamageClass.Ranged; - Item.useTime = Item.useAnimation = OriginalUseTime; + Item.useAnimation = Item.useTime = OriginalUseTime; Item.shoot = ProjectileType(); Item.shootSpeed = 15f; Item.knockBack = 6.5f; diff --git a/Items/Weapons/Ranged/SomaPrime.cs b/Items/Weapons/Ranged/SomaPrime.cs index 95ac291e2e..f9ebdfcb3a 100644 --- a/Items/Weapons/Ranged/SomaPrime.cs +++ b/Items/Weapons/Ranged/SomaPrime.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 34; Item.damage = 400; Item.DamageType = DamageClass.Ranged; - Item.useTime = Item.useAnimation = 5; + Item.useAnimation = Item.useTime = 5; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 2f; diff --git a/Items/Weapons/Ranged/SpeedBlaster.cs b/Items/Weapons/Ranged/SpeedBlaster.cs index a146ae3b32..aca243757d 100644 --- a/Items/Weapons/Ranged/SpeedBlaster.cs +++ b/Items/Weapons/Ranged/SpeedBlaster.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 30; Item.damage = 40; Item.DamageType = DamageClass.Ranged; - Item.useTime = Item.useAnimation = 10; + Item.useAnimation = Item.useTime = 10; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 2.25f; diff --git a/Items/Weapons/Ranged/Starmada.cs b/Items/Weapons/Ranged/Starmada.cs index 7f6284533e..f7009e12de 100644 --- a/Items/Weapons/Ranged/Starmada.cs +++ b/Items/Weapons/Ranged/Starmada.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.knockBack = 15f; Item.shootSpeed = 16f; Item.useStyle = ItemUseStyleID.Shoot; - Item.useTime = Item.useAnimation = 27; + Item.useAnimation = Item.useTime = 27; Item.UseSound = SoundID.Item92; Item.shoot = ModContent.ProjectileType(); Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; diff --git a/Items/Weapons/Ranged/Starmageddon.cs b/Items/Weapons/Ranged/Starmageddon.cs index 0b704e77ac..217daa7cfd 100644 --- a/Items/Weapons/Ranged/Starmageddon.cs +++ b/Items/Weapons/Ranged/Starmageddon.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.knockBack = 4f; Item.shootSpeed = 16f; Item.useStyle = ItemUseStyleID.Shoot; - Item.useTime = Item.useAnimation = 30; + Item.useAnimation = Item.useTime = 30; Item.UseSound = null; Item.shoot = ModContent.ProjectileType(); Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; diff --git a/Items/Weapons/Ranged/SurgeDriver.cs b/Items/Weapons/Ranged/SurgeDriver.cs index 5dc40527ab..2f824d95de 100644 --- a/Items/Weapons/Ranged/SurgeDriver.cs +++ b/Items/Weapons/Ranged/SurgeDriver.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 58; Item.damage = 140; Item.DamageType = DamageClass.Ranged; - Item.useTime = Item.useAnimation = 28; + Item.useAnimation = Item.useTime = 28; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.channel = true; diff --git a/Items/Weapons/Ranged/TheHive.cs b/Items/Weapons/Ranged/TheHive.cs index 89e585472d..5acf4b8106 100644 --- a/Items/Weapons/Ranged/TheHive.cs +++ b/Items/Weapons/Ranged/TheHive.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.damage = 92; Item.DamageType = DamageClass.Ranged; - Item.useTime = Item.useAnimation = OriginalUseTime; + Item.useAnimation = Item.useTime = OriginalUseTime; Item.shoot = ProjectileType(); Item.shootSpeed = 13f; Item.knockBack = 3.5f; diff --git a/Items/Weapons/Ranged/TheJailor.cs b/Items/Weapons/Ranged/TheJailor.cs index 7cb4df516e..79bdaba8f6 100644 --- a/Items/Weapons/Ranged/TheJailor.cs +++ b/Items/Weapons/Ranged/TheJailor.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 70; Item.damage = 235; Item.DamageType = DamageClass.Ranged; - Item.useTime = Item.useAnimation = 28; + Item.useAnimation = Item.useTime = 28; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 8f; diff --git a/Items/Weapons/Ranged/Toxibow.cs b/Items/Weapons/Ranged/Toxibow.cs index 9ce6321955..66afabba19 100644 --- a/Items/Weapons/Ranged/Toxibow.cs +++ b/Items/Weapons/Ranged/Toxibow.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 54; Item.damage = 15; Item.DamageType = DamageClass.Ranged; - Item.useTime = Item.useAnimation = 28; + Item.useAnimation = Item.useTime = 28; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 3f; diff --git a/Items/Weapons/Ranged/Ultima.cs b/Items/Weapons/Ranged/Ultima.cs index 0565b2e6e6..7e03a54bcc 100644 --- a/Items/Weapons/Ranged/Ultima.cs +++ b/Items/Weapons/Ranged/Ultima.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 58; Item.damage = 150; Item.DamageType = DamageClass.Ranged; - Item.useTime = Item.useAnimation = 8; + Item.useAnimation = Item.useTime = 8; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 2f; diff --git a/Items/Weapons/Ranged/UniversalGenesis.cs b/Items/Weapons/Ranged/UniversalGenesis.cs index 0526d67ad4..bed3fa48e4 100644 --- a/Items/Weapons/Ranged/UniversalGenesis.cs +++ b/Items/Weapons/Ranged/UniversalGenesis.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 60; Item.damage = 192; Item.DamageType = DamageClass.Ranged; - Item.useTime = Item.useAnimation = 26; + Item.useAnimation = Item.useTime = 26; Item.knockBack = 6.5f; Item.useAmmo = AmmoID.Bullet; Item.shoot = ProjectileID.Bullet; diff --git a/Items/Weapons/Rogue/BurningStrife.cs b/Items/Weapons/Rogue/BurningStrife.cs index 592522b026..e4bda23aad 100644 --- a/Items/Weapons/Rogue/BurningStrife.cs +++ b/Items/Weapons/Rogue/BurningStrife.cs @@ -13,21 +13,21 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 16; Item.height = 28; + Item.damage = 96; + Item.DamageType = RogueDamageClass.Instance; + Item.useAnimation = Item.useTime = 25; + Item.knockBack = 0.25f; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 8f; + Item.UseSound = SoundID.Item1; Item.useStyle = ItemUseStyleID.Swing; + Item.autoReuse = true; + Item.noMelee = true; + Item.noUseGraphic = true; + Item.value = CalamityGlobalItem.RarityPinkBuyPrice; Item.rare = ItemRarityID.Pink; - Item.autoReuse = true; - Item.noUseGraphic = true; - Item.noMelee = true; - - Item.useAnimation = 25; - Item.useTime = 25; - Item.damage = 96; - Item.shootSpeed = 8f; - Item.shoot = ModContent.ProjectileType(); - - Item.DamageType = RogueDamageClass.Instance; } // Terraria seems to really dislike high crit values in SetDefaults diff --git a/Items/Weapons/Rogue/LeonidProgenitor.cs b/Items/Weapons/Rogue/LeonidProgenitor.cs index 46d509b1ad..16a3c08fb4 100644 --- a/Items/Weapons/Rogue/LeonidProgenitor.cs +++ b/Items/Weapons/Rogue/LeonidProgenitor.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.damage = 64; Item.DamageType = RogueDamageClass.Instance; Item.knockBack = 3f; - Item.useTime = Item.useAnimation = 15; + Item.useAnimation = Item.useTime = 15; Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 12f; diff --git a/Items/Weapons/Rogue/Lionfish.cs b/Items/Weapons/Rogue/Lionfish.cs index 8d692e8cb1..73a34dda76 100644 --- a/Items/Weapons/Rogue/Lionfish.cs +++ b/Items/Weapons/Rogue/Lionfish.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.damage = 45; Item.noMelee = true; Item.noUseGraphic = true; - Item.useTime = Item.useAnimation = 26; + Item.useAnimation = Item.useTime = 26; Item.useStyle = ItemUseStyleID.Swing; Item.knockBack = 2.5f; Item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/Malachite.cs b/Items/Weapons/Rogue/Malachite.cs index 30060d64a7..9c6d8c5165 100644 --- a/Items/Weapons/Rogue/Malachite.cs +++ b/Items/Weapons/Rogue/Malachite.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.damage = 52; Item.noMelee = true; Item.noUseGraphic = true; - Item.useTime = Item.useAnimation = 14; + Item.useAnimation = Item.useTime = 14; Item.useStyle = ItemUseStyleID.Swing; Item.knockBack = 1.25f; Item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/ScourgeoftheDesert.cs b/Items/Weapons/Rogue/ScourgeoftheDesert.cs index c39e7906bd..ff44eeb6a7 100644 --- a/Items/Weapons/Rogue/ScourgeoftheDesert.cs +++ b/Items/Weapons/Rogue/ScourgeoftheDesert.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.noMelee = true; Item.noUseGraphic = true; Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = Item.useAnimation = 24; + Item.useAnimation = Item.useTime = 24; Item.knockBack = 3.5f; Item.UseSound = SoundID.Item1; Item.autoReuse = true; diff --git a/Items/Weapons/Rogue/SearedPan.cs b/Items/Weapons/Rogue/SearedPan.cs index 411e55ba23..b7cc902959 100644 --- a/Items/Weapons/Rogue/SearedPan.cs +++ b/Items/Weapons/Rogue/SearedPan.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.noMelee = true; Item.noUseGraphic = true; Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = Item.useAnimation = 25; + Item.useAnimation = Item.useTime = 25; Item.reuseDelay = 1; Item.useLimitPerAnimation = 1; Item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/TheFinalDawn.cs b/Items/Weapons/Rogue/TheFinalDawn.cs index 833894bfcf..beb247c99c 100644 --- a/Items/Weapons/Rogue/TheFinalDawn.cs +++ b/Items/Weapons/Rogue/TheFinalDawn.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.damage = 2500; Item.DamageType = RogueDamageClass.Instance; Item.noMelee = true; - Item.useTime = Item.useAnimation = 15; + Item.useAnimation = Item.useTime = 15; Item.useStyle = ItemUseStyleID.Swing; Item.knockBack = 4; diff --git a/Items/Weapons/Rogue/ThrowingBrick.cs b/Items/Weapons/Rogue/ThrowingBrick.cs index caa53703e5..3d1f61c9c4 100644 --- a/Items/Weapons/Rogue/ThrowingBrick.cs +++ b/Items/Weapons/Rogue/ThrowingBrick.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.damage = 14; Item.shootSpeed = 15f; Item.shoot = ModContent.ProjectileType(); - Item.useTime = Item.useAnimation = 25; + Item.useAnimation = Item.useTime = 25; Item.useStyle = ItemUseStyleID.Swing; Item.knockBack = 5f; Item.value = Item.buyPrice(0, 0, 0, 50); diff --git a/Items/Weapons/Rogue/Wrathwing.cs b/Items/Weapons/Rogue/Wrathwing.cs index 6c295142e4..1e974a818b 100644 --- a/Items/Weapons/Rogue/Wrathwing.cs +++ b/Items/Weapons/Rogue/Wrathwing.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.noMelee = true; Item.noUseGraphic = true; Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = Item.useAnimation = 13; + Item.useAnimation = Item.useTime = 13; Item.autoReuse = true; Item.UseSound = SoundID.Item1; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; diff --git a/Items/Weapons/Summon/AbandonedSlimeStaff.cs b/Items/Weapons/Summon/AbandonedSlimeStaff.cs index b7c579b505..82b73bb53b 100644 --- a/Items/Weapons/Summon/AbandonedSlimeStaff.cs +++ b/Items/Weapons/Summon/AbandonedSlimeStaff.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.mana = 40; Item.damage = 56; Item.knockBack = 3f; - Item.useTime = Item.useAnimation = 20; + Item.useAnimation = Item.useTime = 20; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 10f; diff --git a/Items/Weapons/Summon/AncientIceChunk.cs b/Items/Weapons/Summon/AncientIceChunk.cs index 9554bd8e42..70b3cac8c0 100644 --- a/Items/Weapons/Summon/AncientIceChunk.cs +++ b/Items/Weapons/Summon/AncientIceChunk.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.shoot = ModContent.ProjectileType(); Item.knockBack = 2f; - Item.useTime = Item.useAnimation = 25; + Item.useAnimation = Item.useTime = 25; Item.mana = 10; Item.noMelee = true; Item.autoReuse = true; diff --git a/Items/Weapons/Summon/AresExoskeleton.cs b/Items/Weapons/Summon/AresExoskeleton.cs index 25c8513ee5..ebf42d1ca9 100644 --- a/Items/Weapons/Summon/AresExoskeleton.cs +++ b/Items/Weapons/Summon/AresExoskeleton.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.damage = 625; Item.useStyle = ItemUseStyleID.HoldUp; Item.noUseGraphic = true; - Item.useTime = Item.useAnimation = 9; + Item.useAnimation = Item.useTime = 9; Item.noMelee = true; Item.knockBack = 1f; diff --git a/Items/Weapons/Summon/AtlasMunitionsBeacon.cs b/Items/Weapons/Summon/AtlasMunitionsBeacon.cs index 118a21ec6c..deefde23b3 100644 --- a/Items/Weapons/Summon/AtlasMunitionsBeacon.cs +++ b/Items/Weapons/Summon/AtlasMunitionsBeacon.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 38; Item.damage = 200; Item.mana = 10; - Item.useTime = Item.useAnimation = 10; + Item.useAnimation = Item.useTime = 10; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.knockBack = 4.75f; diff --git a/Items/Weapons/Summon/BelladonnaSpiritStaff.cs b/Items/Weapons/Summon/BelladonnaSpiritStaff.cs index 43e4bb72cc..3feeafde1a 100644 --- a/Items/Weapons/Summon/BelladonnaSpiritStaff.cs +++ b/Items/Weapons/Summon/BelladonnaSpiritStaff.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.mana = 10; Item.shoot = ModContent.ProjectileType(); - Item.useTime = Item.useAnimation = 35; + Item.useAnimation = Item.useTime = 35; Item.DamageType = DamageClass.Summon; Item.useStyle = ItemUseStyleID.Swing; diff --git a/Items/Weapons/Summon/BlackHawkRemote.cs b/Items/Weapons/Summon/BlackHawkRemote.cs index 9900da3a9b..0e212d9636 100644 --- a/Items/Weapons/Summon/BlackHawkRemote.cs +++ b/Items/Weapons/Summon/BlackHawkRemote.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 40; Item.damage = 25; Item.mana = 10; - Item.useTime = Item.useAnimation = 24; + Item.useAnimation = Item.useTime = 24; Item.useStyle = ItemUseStyleID.HoldUp; Item.noMelee = true; Item.knockBack = 1f; diff --git a/Items/Weapons/Summon/BorealisBomber.cs b/Items/Weapons/Summon/BorealisBomber.cs index 05a197f598..d91e61997f 100644 --- a/Items/Weapons/Summon/BorealisBomber.cs +++ b/Items/Weapons/Summon/BorealisBomber.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 56; Item.damage = 35; Item.mana = 10; - Item.useTime = Item.useAnimation = 19; + Item.useAnimation = Item.useTime = 19; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 5f; diff --git a/Items/Weapons/Summon/BrittleStarStaff.cs b/Items/Weapons/Summon/BrittleStarStaff.cs index 4be7648fd2..fc1033d1ca 100644 --- a/Items/Weapons/Summon/BrittleStarStaff.cs +++ b/Items/Weapons/Summon/BrittleStarStaff.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.width = Item.height = 44; Item.damage = 10; Item.mana = 10; - Item.useTime = Item.useAnimation = 32; + Item.useAnimation = Item.useTime = 32; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = Knockback; diff --git a/Items/Weapons/Summon/CadaverousCarrion.cs b/Items/Weapons/Summon/CadaverousCarrion.cs index 6ae7b901f7..e2ff231070 100644 --- a/Items/Weapons/Summon/CadaverousCarrion.cs +++ b/Items/Weapons/Summon/CadaverousCarrion.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.mana = 10; Item.DamageType = DamageClass.Summon; Item.sentry = true; - Item.useTime = Item.useAnimation = 14; + Item.useAnimation = Item.useTime = 14; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.autoReuse = true; diff --git a/Items/Weapons/Summon/CalamarisLament.cs b/Items/Weapons/Summon/CalamarisLament.cs index c477f89bdc..5423a12cbb 100644 --- a/Items/Weapons/Summon/CalamarisLament.cs +++ b/Items/Weapons/Summon/CalamarisLament.cs @@ -41,20 +41,20 @@ namespace CalamityMod.Items.Weapons.Summon Item.width = 88; Item.height = 108; Item.damage = 110; - Item.shoot = ModContent.ProjectileType(); Item.DamageType = DamageClass.Summon; - - Item.useTime = Item.useAnimation = 10; Item.mana = 10; - Item.noMelee = true; - Item.autoReuse = true; + Item.useAnimation = Item.useTime = 10; + Item.knockBack = 0.25f; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 1f; // This does nothing, it's just here so it's able to act like a staff. + Item.UseSound = SoundID.Item85; Item.useStyle = ItemUseStyleID.Shoot; - Item.rare = ModContent.RarityType(); - Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice; + Item.autoReuse = true; + Item.noMelee = true; - // This does nothing, it's just here so it's able to act like a staff. - Item.shootSpeed = 1f; + Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice; + Item.rare = ModContent.RarityType(); } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Summon/CausticCroakerStaff.cs b/Items/Weapons/Summon/CausticCroakerStaff.cs index 4a4e8c1f0b..f9fc88fab2 100644 --- a/Items/Weapons/Summon/CausticCroakerStaff.cs +++ b/Items/Weapons/Summon/CausticCroakerStaff.cs @@ -15,19 +15,21 @@ namespace CalamityMod.Items.Weapons.Summon Item.width = 36; Item.height = 42; Item.damage = 8; + Item.DamageType = DamageClass.Summon; + Item.sentry = true; Item.mana = 10; - Item.useTime = Item.useAnimation = 35; - Item.useStyle = ItemUseStyleID.Swing; - Item.noMelee = true; - Item.knockBack = 0f; - Item.value = CalamityGlobalItem.RarityGreenBuyPrice; - Item.rare = ItemRarityID.Green; - Item.UseSound = SoundID.Item44; - Item.autoReuse = true; + Item.useAnimation = Item.useTime = 35; + Item.knockBack = 0.25f; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 10f; - Item.sentry = true; - Item.DamageType = DamageClass.Summon; + + Item.UseSound = SoundID.Item44; + Item.useStyle = ItemUseStyleID.Swing; + Item.autoReuse = true; + Item.noMelee = true; + + Item.value = CalamityGlobalItem.RarityGreenBuyPrice; + Item.rare = ItemRarityID.Green; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Summon/CinderBlossomStaff.cs b/Items/Weapons/Summon/CinderBlossomStaff.cs index a5df61b0da..f048621794 100644 --- a/Items/Weapons/Summon/CinderBlossomStaff.cs +++ b/Items/Weapons/Summon/CinderBlossomStaff.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.knockBack = 2f; Item.mana = 10; Item.shoot = ModContent.ProjectileType(); - Item.useTime = Item.useAnimation = 30; + Item.useAnimation = Item.useTime = 30; Item.DamageType = DamageClass.Summon; Item.useStyle = ItemUseStyleID.Swing; diff --git a/Items/Weapons/Summon/CindersOfLament.cs b/Items/Weapons/Summon/CindersOfLament.cs index f6ce0b83c8..9e10aeadf9 100644 --- a/Items/Weapons/Summon/CindersOfLament.cs +++ b/Items/Weapons/Summon/CindersOfLament.cs @@ -11,30 +11,33 @@ namespace CalamityMod.Items.Weapons.Summon public class CindersOfLament : ExhumedItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; - public override void SetDefaults() - { - Item.width = 86; - Item.height = 92; - Item.mana = 10; - Item.damage = 1666; - Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = Item.useAnimation = 80; // 79 because of useStyle 1 - Item.autoReuse = true; - Item.noMelee = true; - Item.knockBack = 0f; - Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.rare = ModContent.RarityType(); - Item.UseSound = SoundID.DD2_BetsySummon; - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; - Item.DamageType = DamageClass.Summon; - } public override void SetStaticDefaults() { ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } + public override void SetDefaults() + { + Item.width = 86; + Item.height = 92; + Item.damage = 1666; + Item.DamageType = DamageClass.Summon; + Item.mana = 10; + Item.useAnimation = Item.useTime = 80; // 79 because of useStyle 1 + Item.knockBack = 0.25f; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 10f; + + Item.UseSound = SoundID.DD2_BetsySummon; + Item.useStyle = ItemUseStyleID.Swing; + Item.autoReuse = true; + Item.noMelee = true; + + Item.value = CalamityGlobalItem.RarityVioletBuyPrice; + Item.rare = ModContent.RarityType(); + } + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.altFunctionUse != 2) diff --git a/Items/Weapons/Summon/CorroslimeStaff.cs b/Items/Weapons/Summon/CorroslimeStaff.cs index e2ac033267..afab2ce826 100644 --- a/Items/Weapons/Summon/CorroslimeStaff.cs +++ b/Items/Weapons/Summon/CorroslimeStaff.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 54; Item.damage = 24; Item.mana = 10; - Item.useTime = Item.useAnimation = 30; + Item.useAnimation = Item.useTime = 30; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.knockBack = 2f; diff --git a/Items/Weapons/Summon/CorvidHarbringerStaff.cs b/Items/Weapons/Summon/CorvidHarbringerStaff.cs index edb6f0390c..aedfb0014f 100644 --- a/Items/Weapons/Summon/CorvidHarbringerStaff.cs +++ b/Items/Weapons/Summon/CorvidHarbringerStaff.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.damage = 114; Item.knockBack = 2f; Item.autoReuse = true; - Item.useTime = Item.useAnimation = 10; + Item.useAnimation = Item.useTime = 10; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 13f; diff --git a/Items/Weapons/Summon/CosmicImmaterializer.cs b/Items/Weapons/Summon/CosmicImmaterializer.cs index 527584da5e..8a687bbb46 100644 --- a/Items/Weapons/Summon/CosmicImmaterializer.cs +++ b/Items/Weapons/Summon/CosmicImmaterializer.cs @@ -19,17 +19,19 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 170; Item.height = 164; - Item.mana = 10; Item.damage = 560; - Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = Item.useAnimation = 10; - Item.noMelee = true; - Item.knockBack = 0f; - Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.UseSound = SoundID.Item60; + Item.DamageType = DamageClass.Summon; + Item.mana = 10; + Item.useAnimation = Item.useTime = 10; + Item.knockBack = 0.25f; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 10f; - Item.DamageType = DamageClass.Summon; + + Item.UseSound = SoundID.Item60; + Item.useStyle = ItemUseStyleID.Swing; + Item.noMelee = true; + + Item.value = CalamityGlobalItem.RarityVioletBuyPrice; Item.rare = ModContent.RarityType(); } diff --git a/Items/Weapons/Summon/CosmicViperEngine.cs b/Items/Weapons/Summon/CosmicViperEngine.cs index 535ad630a2..ce0fd4f2de 100644 --- a/Items/Weapons/Summon/CosmicViperEngine.cs +++ b/Items/Weapons/Summon/CosmicViperEngine.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 28; Item.damage = 321; Item.mana = 10; - Item.useTime = Item.useAnimation = 9; + Item.useAnimation = Item.useTime = 9; Item.useStyle = ItemUseStyleID.HoldUp; Item.noMelee = true; Item.knockBack = 6f; diff --git a/Items/Weapons/Summon/Cosmilamp.cs b/Items/Weapons/Summon/Cosmilamp.cs index 13dc9b4d22..39955f8966 100644 --- a/Items/Weapons/Summon/Cosmilamp.cs +++ b/Items/Weapons/Summon/Cosmilamp.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 60; Item.damage = 127; Item.mana = 10; - Item.useTime = Item.useAnimation = 15; + Item.useAnimation = Item.useTime = 15; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.knockBack = 4f; diff --git a/Items/Weapons/Summon/CrimslimeStaff.cs b/Items/Weapons/Summon/CrimslimeStaff.cs index a76d4fb731..21a70f0f06 100644 --- a/Items/Weapons/Summon/CrimslimeStaff.cs +++ b/Items/Weapons/Summon/CrimslimeStaff.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 52; Item.damage = 24; Item.mana = 10; - Item.useTime = Item.useAnimation = 30; + Item.useAnimation = Item.useTime = 30; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.knockBack = 2f; diff --git a/Items/Weapons/Summon/CryogenicStaff.cs b/Items/Weapons/Summon/CryogenicStaff.cs index 3d189ee3b0..f1043a176f 100644 --- a/Items/Weapons/Summon/CryogenicStaff.cs +++ b/Items/Weapons/Summon/CryogenicStaff.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.mana = 10; Item.DamageType = DamageClass.Summon; Item.sentry = true; - Item.useTime = Item.useAnimation = 25; + Item.useAnimation = Item.useTime = 25; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.autoReuse = true; diff --git a/Items/Weapons/Summon/DaedalusGolemStaff.cs b/Items/Weapons/Summon/DaedalusGolemStaff.cs index 386de45059..8ac62eb209 100644 --- a/Items/Weapons/Summon/DaedalusGolemStaff.cs +++ b/Items/Weapons/Summon/DaedalusGolemStaff.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.width = Item.height = 32; Item.damage = 70; Item.mana = 10; - Item.useTime = Item.useAnimation = 25; + Item.useAnimation = Item.useTime = 25; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.knockBack = 3f; diff --git a/Items/Weapons/Summon/DankStaff.cs b/Items/Weapons/Summon/DankStaff.cs index ea24230f3f..82d990e57c 100644 --- a/Items/Weapons/Summon/DankStaff.cs +++ b/Items/Weapons/Summon/DankStaff.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 58; Item.damage = 14; Item.mana = 10; - Item.useTime = Item.useAnimation = 30; + Item.useAnimation = Item.useTime = 30; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.knockBack = 2.25f; diff --git a/Items/Weapons/Summon/DazzlingStabberStaff.cs b/Items/Weapons/Summon/DazzlingStabberStaff.cs index 3759fa322b..79afed4b59 100644 --- a/Items/Weapons/Summon/DazzlingStabberStaff.cs +++ b/Items/Weapons/Summon/DazzlingStabberStaff.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.damage = 127; Item.knockBack = 2f; Item.autoReuse = true; - Item.useTime = Item.useAnimation = 15; + Item.useAnimation = Item.useTime = 15; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 13f; diff --git a/Items/Weapons/Summon/DeathstareRod.cs b/Items/Weapons/Summon/DeathstareRod.cs index dd4127a587..8bd0029774 100644 --- a/Items/Weapons/Summon/DeathstareRod.cs +++ b/Items/Weapons/Summon/DeathstareRod.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.width = Item.height = 46; Item.damage = 20; Item.mana = 10; - Item.useTime = Item.useAnimation = 35; + Item.useAnimation = Item.useTime = 35; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.knockBack = 2f; diff --git a/Items/Weapons/Summon/DeepseaStaff.cs b/Items/Weapons/Summon/DeepseaStaff.cs index 86b85473b1..c66c813752 100644 --- a/Items/Weapons/Summon/DeepseaStaff.cs +++ b/Items/Weapons/Summon/DeepseaStaff.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.width = Item.height = 44; Item.damage = 40; Item.mana = 10; - Item.useTime = Item.useAnimation = 25; + Item.useAnimation = Item.useTime = 25; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.knockBack = 2f; diff --git a/Items/Weapons/Summon/DormantBrimseeker.cs b/Items/Weapons/Summon/DormantBrimseeker.cs index e45d4e9884..1dbc591245 100644 --- a/Items/Weapons/Summon/DormantBrimseeker.cs +++ b/Items/Weapons/Summon/DormantBrimseeker.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.width = Item.height = 32; Item.damage = 42; Item.mana = 10; - Item.useTime = Item.useAnimation = 25; + Item.useAnimation = Item.useTime = 25; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.noUseGraphic = true; diff --git a/Items/Weapons/Summon/DragonbloodDisgorger.cs b/Items/Weapons/Summon/DragonbloodDisgorger.cs index cd4ee73ef3..77b6556268 100644 --- a/Items/Weapons/Summon/DragonbloodDisgorger.cs +++ b/Items/Weapons/Summon/DragonbloodDisgorger.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 62; Item.damage = 215; Item.mana = 10; - Item.useTime = Item.useAnimation = 15; + Item.useAnimation = Item.useTime = 15; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.knockBack = 4f; diff --git a/Items/Weapons/Summon/DreadmineStaff.cs b/Items/Weapons/Summon/DreadmineStaff.cs index a2aa36d7e8..a60e17693d 100644 --- a/Items/Weapons/Summon/DreadmineStaff.cs +++ b/Items/Weapons/Summon/DreadmineStaff.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 44; Item.damage = 60; Item.mana = 10; - Item.useTime = Item.useAnimation = 25; + Item.useAnimation = Item.useTime = 25; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.knockBack = 4.5f; diff --git a/Items/Weapons/Summon/EnchantedConch.cs b/Items/Weapons/Summon/EnchantedConch.cs index 422f7c7233..0136a8d714 100644 --- a/Items/Weapons/Summon/EnchantedConch.cs +++ b/Items/Weapons/Summon/EnchantedConch.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.shoot = ModContent.ProjectileType(); Item.knockBack = 2f; - Item.useTime = Item.useAnimation = 35; + Item.useAnimation = Item.useTime = 35; Item.mana = 10; Item.noMelee = true; Item.autoReuse = true; diff --git a/Items/Weapons/Summon/EndoHydraStaff.cs b/Items/Weapons/Summon/EndoHydraStaff.cs index 6e96ca55f3..3b64d117d0 100644 --- a/Items/Weapons/Summon/EndoHydraStaff.cs +++ b/Items/Weapons/Summon/EndoHydraStaff.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.damage = 232; Item.knockBack = 3f; Item.autoReuse = true; - Item.useTime = Item.useAnimation = 10; + Item.useAnimation = Item.useTime = 10; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 10f; diff --git a/Items/Weapons/Summon/Endogenesis.cs b/Items/Weapons/Summon/Endogenesis.cs index 0cface095a..46f1f7eb7e 100644 --- a/Items/Weapons/Summon/Endogenesis.cs +++ b/Items/Weapons/Summon/Endogenesis.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.damage = 1300; Item.knockBack = 4f; Item.autoReuse = true; - Item.useTime = Item.useAnimation = 10; + Item.useAnimation = Item.useTime = 10; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 10f; diff --git a/Items/Weapons/Summon/EntropysVigil.cs b/Items/Weapons/Summon/EntropysVigil.cs index dd0c9287de..b71b6ba3ff 100644 --- a/Items/Weapons/Summon/EntropysVigil.cs +++ b/Items/Weapons/Summon/EntropysVigil.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.shoot = ModContent.ProjectileType(); Item.knockBack = 2f; - Item.useTime = Item.useAnimation = 25; + Item.useAnimation = Item.useTime = 25; Item.mana = 10; Item.noMelee = true; Item.autoReuse = true; diff --git a/Items/Weapons/Summon/EtherealSubjugator.cs b/Items/Weapons/Summon/EtherealSubjugator.cs index 9abf615c95..c5a5c460db 100644 --- a/Items/Weapons/Summon/EtherealSubjugator.cs +++ b/Items/Weapons/Summon/EtherealSubjugator.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.shoot = ModContent.ProjectileType(); Item.knockBack = 1f; - Item.useTime = Item.useAnimation = 10; + Item.useAnimation = Item.useTime = 10; Item.mana = 10; Item.noMelee = true; Item.autoReuse = true; diff --git a/Items/Weapons/Summon/EyeOfNight.cs b/Items/Weapons/Summon/EyeOfNight.cs index 009e3325a1..def86283ee 100644 --- a/Items/Weapons/Summon/EyeOfNight.cs +++ b/Items/Weapons/Summon/EyeOfNight.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.width = Item.height = 36; Item.damage = 24; Item.mana = 10; - Item.useTime = Item.useAnimation = 30; + Item.useAnimation = Item.useTime = 30; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.knockBack = 1f; diff --git a/Items/Weapons/Summon/FlamsteedRing.cs b/Items/Weapons/Summon/FlamsteedRing.cs index 697ee14482..e25a657073 100644 --- a/Items/Weapons/Summon/FlamsteedRing.cs +++ b/Items/Weapons/Summon/FlamsteedRing.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.mana = 200; Item.damage = 1999; Item.useStyle = ItemUseStyleID.HoldUp; - Item.useTime = Item.useAnimation = 9; + Item.useAnimation = Item.useTime = 9; Item.noMelee = true; Item.knockBack = 1f; diff --git a/Items/Weapons/Summon/FleshOfInfidelity.cs b/Items/Weapons/Summon/FleshOfInfidelity.cs index 1373817513..fae2871577 100644 --- a/Items/Weapons/Summon/FleshOfInfidelity.cs +++ b/Items/Weapons/Summon/FleshOfInfidelity.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.shoot = ModContent.ProjectileType(); Item.knockBack = 1f; - Item.useTime = Item.useAnimation = 10; + Item.useAnimation = Item.useTime = 10; Item.mana = 10; Item.noMelee = true; Item.autoReuse = true; diff --git a/Items/Weapons/Summon/FlowersOfMortality.cs b/Items/Weapons/Summon/FlowersOfMortality.cs index 47a968616d..2eeb08887d 100644 --- a/Items/Weapons/Summon/FlowersOfMortality.cs +++ b/Items/Weapons/Summon/FlowersOfMortality.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.damage = 72; Item.DamageType = DamageClass.Summon; Item.mana = 10; - Item.useTime = Item.useAnimation = 15; + Item.useAnimation = Item.useTime = 15; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.knockBack = 5f; diff --git a/Items/Weapons/Summon/ForgottenApexWand.cs b/Items/Weapons/Summon/ForgottenApexWand.cs index 3492dff4a4..4fb966f134 100644 --- a/Items/Weapons/Summon/ForgottenApexWand.cs +++ b/Items/Weapons/Summon/ForgottenApexWand.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.knockBack = 4f; Item.mana = 10; Item.damage = 28; - Item.useTime = Item.useAnimation = 25; + Item.useAnimation = Item.useTime = 25; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 12f; } diff --git a/Items/Weapons/Summon/FrostBlossomStaff.cs b/Items/Weapons/Summon/FrostBlossomStaff.cs index 5226cb9f34..852b6cd188 100644 --- a/Items/Weapons/Summon/FrostBlossomStaff.cs +++ b/Items/Weapons/Summon/FrostBlossomStaff.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 24; Item.damage = 10; Item.mana = 10; - Item.useTime = Item.useAnimation = 35; + Item.useAnimation = Item.useTime = 35; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.knockBack = 2f; diff --git a/Items/Weapons/Summon/FuelCellBundle.cs b/Items/Weapons/Summon/FuelCellBundle.cs index 1083ecfd3b..6e0f725d93 100644 --- a/Items/Weapons/Summon/FuelCellBundle.cs +++ b/Items/Weapons/Summon/FuelCellBundle.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.mana = 10; Item.damage = 25; Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = Item.useAnimation = 20; + Item.useAnimation = Item.useTime = 20; Item.noMelee = true; Item.knockBack = 7f; Item.value = CalamityGlobalItem.RarityYellowBuyPrice; diff --git a/Items/Weapons/Summon/GammaHeart.cs b/Items/Weapons/Summon/GammaHeart.cs index aafe020881..6ab12f05c7 100644 --- a/Items/Weapons/Summon/GammaHeart.cs +++ b/Items/Weapons/Summon/GammaHeart.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.damage = 85; Item.knockBack = 3f; Item.autoReuse = true; - Item.useTime = Item.useAnimation = 14; + Item.useAnimation = Item.useTime = 14; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 10f; Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice; diff --git a/Items/Weapons/Summon/GastricBelcherStaff.cs b/Items/Weapons/Summon/GastricBelcherStaff.cs index 6566d75dab..4d2796f9cd 100644 --- a/Items/Weapons/Summon/GastricBelcherStaff.cs +++ b/Items/Weapons/Summon/GastricBelcherStaff.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 70; Item.damage = 60; Item.mana = 10; - Item.useTime = Item.useAnimation = 20; + Item.useAnimation = Item.useTime = 20; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.knockBack = 1f; diff --git a/Items/Weapons/Summon/GlacialEmbrace.cs b/Items/Weapons/Summon/GlacialEmbrace.cs index 466e2ceb5e..a8ff856589 100644 --- a/Items/Weapons/Summon/GlacialEmbrace.cs +++ b/Items/Weapons/Summon/GlacialEmbrace.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 50; Item.damage = 48; Item.mana = 10; - Item.useTime = Item.useAnimation = 24; + Item.useAnimation = Item.useTime = 24; Item.useStyle = ItemUseStyleID.HoldUp; Item.noMelee = true; Item.knockBack = 4.5f; diff --git a/Items/Weapons/Summon/GuidelightofOblivion.cs b/Items/Weapons/Summon/GuidelightofOblivion.cs index 6525ba6f3e..554c3b6f8a 100644 --- a/Items/Weapons/Summon/GuidelightofOblivion.cs +++ b/Items/Weapons/Summon/GuidelightofOblivion.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.DamageType = DamageClass.Summon; Item.sentry = true; Item.mana = 10; - Item.useTime = Item.useAnimation = 15; + Item.useAnimation = Item.useTime = 15; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.knockBack = 5f; diff --git a/Items/Weapons/Summon/HarvestStaff.cs b/Items/Weapons/Summon/HarvestStaff.cs index 96da01b29c..fad959fad4 100644 --- a/Items/Weapons/Summon/HarvestStaff.cs +++ b/Items/Weapons/Summon/HarvestStaff.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.shoot = ModContent.ProjectileType(); Item.knockBack = 5f; - Item.useTime = Item.useAnimation = 15; + Item.useAnimation = Item.useTime = 15; Item.mana = 10; Item.width = 44; Item.height = 46; diff --git a/Items/Weapons/Summon/HauntedScroll.cs b/Items/Weapons/Summon/HauntedScroll.cs index 02a18d2b4f..a8a5bb8a06 100644 --- a/Items/Weapons/Summon/HauntedScroll.cs +++ b/Items/Weapons/Summon/HauntedScroll.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 48; Item.damage = 25; Item.mana = 10; - Item.useTime = Item.useAnimation = 24; + Item.useAnimation = Item.useTime = 24; Item.useStyle = ItemUseStyleID.HoldUp; Item.noMelee = true; Item.knockBack = 3f; diff --git a/Items/Weapons/Summon/HerringStaff.cs b/Items/Weapons/Summon/HerringStaff.cs index ba118cfcf5..8b2772c2e2 100644 --- a/Items/Weapons/Summon/HerringStaff.cs +++ b/Items/Weapons/Summon/HerringStaff.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.mana = 10; Item.shoot = ModContent.ProjectileType(); - Item.useTime = Item.useAnimation = 30; + Item.useAnimation = Item.useTime = 30; Item.DamageType = DamageClass.Summon; Item.useStyle = ItemUseStyleID.Swing; Item.UseSound = SoundID.Item21; diff --git a/Items/Weapons/Summon/HivePod.cs b/Items/Weapons/Summon/HivePod.cs index 849e2cdda0..8fdf65c7a8 100644 --- a/Items/Weapons/Summon/HivePod.cs +++ b/Items/Weapons/Summon/HivePod.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.DamageType = DamageClass.Summon; Item.sentry = true; Item.autoReuse = true; - Item.useTime = Item.useAnimation = 20; + Item.useAnimation = Item.useTime = 20; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.knockBack = 4f; diff --git a/Items/Weapons/Summon/IgneousExaltation.cs b/Items/Weapons/Summon/IgneousExaltation.cs index b00537081a..12ca3a20af 100644 --- a/Items/Weapons/Summon/IgneousExaltation.cs +++ b/Items/Weapons/Summon/IgneousExaltation.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 50; Item.damage = 34; Item.mana = 10; - Item.useTime = Item.useAnimation = 24; + Item.useAnimation = Item.useTime = 24; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 4.5f; diff --git a/Items/Weapons/Summon/InfectedRemote.cs b/Items/Weapons/Summon/InfectedRemote.cs index 080093f247..e4b8c63b6c 100644 --- a/Items/Weapons/Summon/InfectedRemote.cs +++ b/Items/Weapons/Summon/InfectedRemote.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 28; Item.damage = 50; Item.mana = 10; - Item.useTime = Item.useAnimation = 19; + Item.useAnimation = Item.useTime = 19; Item.useStyle = ItemUseStyleID.HoldUp; Item.noMelee = true; Item.knockBack = 5f; diff --git a/Items/Weapons/Summon/LegionofCelestia.cs b/Items/Weapons/Summon/LegionofCelestia.cs index a674e6a85c..76e3f857a6 100644 --- a/Items/Weapons/Summon/LegionofCelestia.cs +++ b/Items/Weapons/Summon/LegionofCelestia.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.damage = 57; Item.DamageType = DamageClass.Summon; Item.mana = 10; - Item.useTime = Item.useAnimation = 15; + Item.useAnimation = Item.useTime = 15; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.knockBack = 5f; diff --git a/Items/Weapons/Summon/LiliesOfFinality.cs b/Items/Weapons/Summon/LiliesOfFinality.cs index 7e441ab524..e33c5b02e3 100644 --- a/Items/Weapons/Summon/LiliesOfFinality.cs +++ b/Items/Weapons/Summon/LiliesOfFinality.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.knockBack = 5f; Item.mana = 10; - Item.useTime = Item.useAnimation = 15; + Item.useAnimation = Item.useTime = 15; Item.width = 36; Item.height = 50; Item.noMelee = true; diff --git a/Items/Weapons/Summon/Metastasis.cs b/Items/Weapons/Summon/Metastasis.cs index e27c0498ec..4d9e90ff7a 100644 --- a/Items/Weapons/Summon/Metastasis.cs +++ b/Items/Weapons/Summon/Metastasis.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 78; Item.damage = 400; Item.mana = 10; - Item.useTime = Item.useAnimation = 10; // 9 because of useStyle 1 + Item.useAnimation = Item.useTime = 10; // 9 because of useStyle 1 Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.knockBack = 2f; diff --git a/Items/Weapons/Summon/MidnightSunBeacon.cs b/Items/Weapons/Summon/MidnightSunBeacon.cs index 4367d0f1ac..431dfd4d0f 100644 --- a/Items/Weapons/Summon/MidnightSunBeacon.cs +++ b/Items/Weapons/Summon/MidnightSunBeacon.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.width = Item.height = 32; Item.damage = 176; Item.mana = 10; - Item.useTime = Item.useAnimation = 10; + Item.useAnimation = Item.useTime = 10; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.noUseGraphic = true; diff --git a/Items/Weapons/Summon/MirrorofKalandra.cs b/Items/Weapons/Summon/MirrorofKalandra.cs index be74192042..764c1af28f 100644 --- a/Items/Weapons/Summon/MirrorofKalandra.cs +++ b/Items/Weapons/Summon/MirrorofKalandra.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.width = 58; Item.height = 50; Item.damage = 317; - Item.useTime = Item.useAnimation = 30; + Item.useAnimation = Item.useTime = 30; Item.knockBack = 4f; Item.mana = 10; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Summon/MutatedTruffle.cs b/Items/Weapons/Summon/MutatedTruffle.cs index 8284dd30e0..c66a5e0099 100644 --- a/Items/Weapons/Summon/MutatedTruffle.cs +++ b/Items/Weapons/Summon/MutatedTruffle.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.shoot = ModContent.ProjectileType(); Item.knockBack = 5f; - Item.useTime = Item.useAnimation = 10; + Item.useAnimation = Item.useTime = 10; Item.mana = 10; Item.noMelee = true; Item.useStyle = ItemUseStyleID.HoldUp; diff --git a/Items/Weapons/Summon/OrthoceraShell.cs b/Items/Weapons/Summon/OrthoceraShell.cs index 0642fb536b..be58cba6f0 100644 --- a/Items/Weapons/Summon/OrthoceraShell.cs +++ b/Items/Weapons/Summon/OrthoceraShell.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 34; Item.damage = 53; Item.mana = 10; - Item.useTime = Item.useAnimation = 24; + Item.useAnimation = Item.useTime = 24; Item.useStyle = ItemUseStyleID.HoldUp; Item.noMelee = true; Item.knockBack = 2f; diff --git a/Items/Weapons/Summon/Perdition.cs b/Items/Weapons/Summon/Perdition.cs index a6129eab11..a25798a78f 100644 --- a/Items/Weapons/Summon/Perdition.cs +++ b/Items/Weapons/Summon/Perdition.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.shoot = ModContent.ProjectileType(); Item.knockBack = 4f; - Item.useTime = Item.useAnimation = 10; // 9 because of useStyle 1. + Item.useAnimation = Item.useTime = 10; // 9 because of useStyle 1. Item.mana = 10; Item.noMelee = true; Item.autoReuse = true; diff --git a/Items/Weapons/Summon/PlantationStaff.cs b/Items/Weapons/Summon/PlantationStaff.cs index 2fff600df2..b7a85aadd4 100644 --- a/Items/Weapons/Summon/PlantationStaff.cs +++ b/Items/Weapons/Summon/PlantationStaff.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.knockBack = 1f; Item.mana = 10; - Item.useTime = Item.useAnimation = 20; + Item.useAnimation = Item.useTime = 20; Item.noMelee = true; Item.value = CalamityGlobalItem.RarityYellowBuyPrice; Item.rare = ItemRarityID.Yellow; diff --git a/Items/Weapons/Summon/PolypLauncher.cs b/Items/Weapons/Summon/PolypLauncher.cs index 662d30304d..dd22edc4cd 100644 --- a/Items/Weapons/Summon/PolypLauncher.cs +++ b/Items/Weapons/Summon/PolypLauncher.cs @@ -15,19 +15,21 @@ namespace CalamityMod.Items.Weapons.Summon Item.width = 26; Item.height = 56; Item.damage = 12; - Item.mana = 10; - Item.useTime = Item.useAnimation = 35; - Item.useStyle = ItemUseStyleID.Swing; - Item.noMelee = true; - Item.knockBack = 0f; - Item.value = CalamityGlobalItem.RarityGreenBuyPrice; - Item.rare = ItemRarityID.Green; - Item.UseSound = SoundID.Item44; - Item.autoReuse = true; - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; Item.sentry = true; + Item.mana = 10; + Item.useAnimation = Item.useTime = 35; + Item.knockBack = 0.25f; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 10f; + + Item.UseSound = SoundID.Item44; + Item.useStyle = ItemUseStyleID.Swing; + Item.autoReuse = true; + Item.noMelee = true; + + Item.value = CalamityGlobalItem.RarityGreenBuyPrice; + Item.rare = ItemRarityID.Green; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Summon/PuffShroom.cs b/Items/Weapons/Summon/PuffShroom.cs index bee58b18d1..b2163f8e88 100644 --- a/Items/Weapons/Summon/PuffShroom.cs +++ b/Items/Weapons/Summon/PuffShroom.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 32; Item.damage = 14; Item.mana = 10; - Item.useTime = Item.useAnimation = 35; + Item.useAnimation = Item.useTime = 35; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.knockBack = 2f; diff --git a/Items/Weapons/Summon/ResurrectionButterfly.cs b/Items/Weapons/Summon/ResurrectionButterfly.cs index 67a1b45685..951e0ff7c9 100644 --- a/Items/Weapons/Summon/ResurrectionButterfly.cs +++ b/Items/Weapons/Summon/ResurrectionButterfly.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 46; Item.damage = 66; // clueless Item.mana = 10; - Item.useTime = Item.useAnimation = 20; + Item.useAnimation = Item.useTime = 20; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.knockBack = 1f; diff --git a/Items/Weapons/Summon/RustyBeaconPrototype.cs b/Items/Weapons/Summon/RustyBeaconPrototype.cs index c275a75dde..7568c46903 100644 --- a/Items/Weapons/Summon/RustyBeaconPrototype.cs +++ b/Items/Weapons/Summon/RustyBeaconPrototype.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 20; Item.mana = 10; Item.damage = 8; - Item.useTime = Item.useAnimation = 34; + Item.useAnimation = Item.useTime = 34; Item.useStyle = ItemUseStyleID.HoldUp; Item.noMelee = true; Item.knockBack = 0.5f; diff --git a/Items/Weapons/Summon/SanctifiedSpark.cs b/Items/Weapons/Summon/SanctifiedSpark.cs index c1d0f28176..b7c19db16a 100644 --- a/Items/Weapons/Summon/SanctifiedSpark.cs +++ b/Items/Weapons/Summon/SanctifiedSpark.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.DamageType = DamageClass.Summon; Item.sentry = true; Item.mana = 10; - Item.useTime = Item.useAnimation = 14; + Item.useAnimation = Item.useTime = 14; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 5f; diff --git a/Items/Weapons/Summon/SandSharknadoStaff.cs b/Items/Weapons/Summon/SandSharknadoStaff.cs index ff780b7dd0..a7da28d070 100644 --- a/Items/Weapons/Summon/SandSharknadoStaff.cs +++ b/Items/Weapons/Summon/SandSharknadoStaff.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.mana = 10; Item.shoot = ModContent.ProjectileType(); - Item.useTime = Item.useAnimation = 20; + Item.useAnimation = Item.useTime = 20; Item.DamageType = DamageClass.Summon; Item.useStyle = ItemUseStyleID.Swing; Item.UseSound = SoundID.Item44; diff --git a/Items/Weapons/Summon/SarosPossession.cs b/Items/Weapons/Summon/SarosPossession.cs index 8d6dbc6405..4f42ccce99 100644 --- a/Items/Weapons/Summon/SarosPossession.cs +++ b/Items/Weapons/Summon/SarosPossession.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.mana = 10; Item.shoot = ModContent.ProjectileType(); - Item.useTime = Item.useAnimation = 10; + Item.useAnimation = Item.useTime = 10; Item.DamageType = DamageClass.Summon; Item.useStyle = ItemUseStyleID.Swing; Item.UseSound = SoundID.DD2_BetsyFlameBreath; diff --git a/Items/Weapons/Summon/ScabRipper.cs b/Items/Weapons/Summon/ScabRipper.cs index cec2bf5b37..8a8c992ec4 100644 --- a/Items/Weapons/Summon/ScabRipper.cs +++ b/Items/Weapons/Summon/ScabRipper.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 70; Item.damage = 16; Item.mana = 10; - Item.useTime = Item.useAnimation = 30; + Item.useAnimation = Item.useTime = 30; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 0.5f; diff --git a/Items/Weapons/Summon/ShellfishStaff.cs b/Items/Weapons/Summon/ShellfishStaff.cs index 2487b3034c..1abaa418da 100644 --- a/Items/Weapons/Summon/ShellfishStaff.cs +++ b/Items/Weapons/Summon/ShellfishStaff.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 50; Item.damage = 70; Item.mana = 10; - Item.useTime = Item.useAnimation = 25; + Item.useAnimation = Item.useTime = 25; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.knockBack = 2f; diff --git a/Items/Weapons/Summon/Sirius.cs b/Items/Weapons/Summon/Sirius.cs index 3a178abe56..1ce98ef7c5 100644 --- a/Items/Weapons/Summon/Sirius.cs +++ b/Items/Weapons/Summon/Sirius.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = Item.height = 62; Item.damage = 600; - Item.useTime = Item.useAnimation = 10; + Item.useAnimation = Item.useTime = 10; Item.mana = 10; Item.knockBack = 10f; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Summon/SlimePuppetStaff.cs b/Items/Weapons/Summon/SlimePuppetStaff.cs index c00379c4e0..1e5a20341c 100644 --- a/Items/Weapons/Summon/SlimePuppetStaff.cs +++ b/Items/Weapons/Summon/SlimePuppetStaff.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 34; Item.damage = 10; Item.mana = 10; - Item.useTime = Item.useAnimation = 29; + Item.useAnimation = Item.useTime = 29; Item.useStyle = ItemUseStyleID.HoldUp; Item.noMelee = true; Item.knockBack = 3.6f; diff --git a/Items/Weapons/Summon/SpikecragStaff.cs b/Items/Weapons/Summon/SpikecragStaff.cs index 53691dfcaf..d9eb1fdafa 100644 --- a/Items/Weapons/Summon/SpikecragStaff.cs +++ b/Items/Weapons/Summon/SpikecragStaff.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.mana = 10; Item.DamageType = DamageClass.Summon; Item.sentry = true; - Item.useTime = Item.useAnimation = 20; + Item.useAnimation = Item.useTime = 20; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.knockBack = 2f; diff --git a/Items/Weapons/Summon/SquirrelSquireStaff.cs b/Items/Weapons/Summon/SquirrelSquireStaff.cs index 35ab8d8df6..1db1b3dde0 100644 --- a/Items/Weapons/Summon/SquirrelSquireStaff.cs +++ b/Items/Weapons/Summon/SquirrelSquireStaff.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.shoot = ModContent.ProjectileType(); Item.knockBack = 0.5f; - Item.useTime = Item.useAnimation = 15; + Item.useAnimation = Item.useTime = 15; Item.mana = 10; Item.width = 46; Item.height = 52; diff --git a/Items/Weapons/Summon/StaffOfNecrosteocytes.cs b/Items/Weapons/Summon/StaffOfNecrosteocytes.cs index 5c08cfc5bc..8de6f7b1af 100644 --- a/Items/Weapons/Summon/StaffOfNecrosteocytes.cs +++ b/Items/Weapons/Summon/StaffOfNecrosteocytes.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 54; Item.damage = 31; Item.mana = 10; - Item.useTime = Item.useAnimation = 30; + Item.useAnimation = Item.useTime = 30; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.knockBack = 3.5f; diff --git a/Items/Weapons/Summon/StaffoftheMechworm.cs b/Items/Weapons/Summon/StaffoftheMechworm.cs index 5a9a3a858f..aebe5b1a37 100644 --- a/Items/Weapons/Summon/StaffoftheMechworm.cs +++ b/Items/Weapons/Summon/StaffoftheMechworm.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 68; Item.damage = 100; Item.mana = 10; - Item.useTime = Item.useAnimation = 10; // 9 because of useStyle 1 + Item.useAnimation = Item.useTime = 10; // 9 because of useStyle 1 Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.knockBack = 2f; diff --git a/Items/Weapons/Summon/StarspawnHelixStaff.cs b/Items/Weapons/Summon/StarspawnHelixStaff.cs index ac6e306dcd..3d8c9f3def 100644 --- a/Items/Weapons/Summon/StarspawnHelixStaff.cs +++ b/Items/Weapons/Summon/StarspawnHelixStaff.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.mana = 10; Item.shoot = ModContent.ProjectileType(); - Item.useTime = Item.useAnimation = 20; + Item.useAnimation = Item.useTime = 20; Item.DamageType = DamageClass.Summon; Item.useStyle = ItemUseStyleID.Swing; Item.UseSound = SoundID.Item44; diff --git a/Items/Weapons/Summon/StellarTorusStaff.cs b/Items/Weapons/Summon/StellarTorusStaff.cs index 07741b3cad..5a6a9827e2 100644 --- a/Items/Weapons/Summon/StellarTorusStaff.cs +++ b/Items/Weapons/Summon/StellarTorusStaff.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.width = 42; Item.height = 42; Item.damage = 142; - Item.useTime = Item.useAnimation = 20; + Item.useAnimation = Item.useTime = 20; Item.knockBack = 4f; Item.mana = 10; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Summon/StormjawStaff.cs b/Items/Weapons/Summon/StormjawStaff.cs index 99f5a062b4..ab76bab5f6 100644 --- a/Items/Weapons/Summon/StormjawStaff.cs +++ b/Items/Weapons/Summon/StormjawStaff.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 32; Item.damage = 11; Item.mana = 10; - Item.useTime = Item.useAnimation = 35; + Item.useAnimation = Item.useTime = 35; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.knockBack = 2f; diff --git a/Items/Weapons/Summon/SunSpiritStaff.cs b/Items/Weapons/Summon/SunSpiritStaff.cs index 0c2c0315e1..fa04a52417 100644 --- a/Items/Weapons/Summon/SunSpiritStaff.cs +++ b/Items/Weapons/Summon/SunSpiritStaff.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 48; Item.damage = 12; Item.mana = 10; - Item.useTime = Item.useAnimation = 35; + Item.useAnimation = Item.useTime = 35; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.knockBack = 1.15f; diff --git a/Items/Weapons/Summon/TacticalPlagueEngine.cs b/Items/Weapons/Summon/TacticalPlagueEngine.cs index 9344691e4e..f29284f1c7 100644 --- a/Items/Weapons/Summon/TacticalPlagueEngine.cs +++ b/Items/Weapons/Summon/TacticalPlagueEngine.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 20; Item.damage = 140; Item.mana = 10; - Item.useTime = Item.useAnimation = 14; + Item.useAnimation = Item.useTime = 14; Item.useStyle = ItemUseStyleID.HoldUp; Item.noMelee = true; Item.knockBack = 0.5f; diff --git a/Items/Weapons/Summon/TemporalUmbrella.cs b/Items/Weapons/Summon/TemporalUmbrella.cs index 165a7abad0..78f850a6cf 100644 --- a/Items/Weapons/Summon/TemporalUmbrella.cs +++ b/Items/Weapons/Summon/TemporalUmbrella.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.damage = 193; Item.knockBack = 1f; Item.mana = 99; - Item.useTime = Item.useAnimation = 10; + Item.useAnimation = Item.useTime = 10; Item.DamageType = DamageClass.Summon; Item.shootSpeed = 0f; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Summon/TundraFlameBlossomsStaff.cs b/Items/Weapons/Summon/TundraFlameBlossomsStaff.cs index b341c9d77f..dcf2926b9a 100644 --- a/Items/Weapons/Summon/TundraFlameBlossomsStaff.cs +++ b/Items/Weapons/Summon/TundraFlameBlossomsStaff.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 60; Item.damage = 40; Item.mana = 10; - Item.useTime = Item.useAnimation = 25; + Item.useAnimation = Item.useTime = 25; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.knockBack = 3f; diff --git a/Items/Weapons/Summon/UniverseSplitter.cs b/Items/Weapons/Summon/UniverseSplitter.cs index 54cc6a4d9f..15932b763a 100644 --- a/Items/Weapons/Summon/UniverseSplitter.cs +++ b/Items/Weapons/Summon/UniverseSplitter.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.mana = 300; Item.damage = 9600; Item.knockBack = 7f; - Item.useTime = Item.useAnimation = 10; + Item.useAnimation = Item.useTime = 10; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 10f; Item.noUseGraphic = true; diff --git a/Items/Weapons/Summon/VengefulSunStaff.cs b/Items/Weapons/Summon/VengefulSunStaff.cs index 1638072b13..fc5250bf6d 100644 --- a/Items/Weapons/Summon/VengefulSunStaff.cs +++ b/Items/Weapons/Summon/VengefulSunStaff.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 72; Item.damage = 60; Item.mana = 10; - Item.useTime = Item.useAnimation = 25; + Item.useAnimation = Item.useTime = 25; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.knockBack = 1.25f; diff --git a/Items/Weapons/Summon/Vigilance.cs b/Items/Weapons/Summon/Vigilance.cs index 2ed2a9261d..916edd6388 100644 --- a/Items/Weapons/Summon/Vigilance.cs +++ b/Items/Weapons/Summon/Vigilance.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.width = Item.height = 32; Item.damage = 115; Item.mana = 10; - Item.useTime = Item.useAnimation = 10; + Item.useAnimation = Item.useTime = 10; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.knockBack = 4f; diff --git a/Items/Weapons/Summon/VileFeeder.cs b/Items/Weapons/Summon/VileFeeder.cs index 7e02720664..d3e5445a27 100644 --- a/Items/Weapons/Summon/VileFeeder.cs +++ b/Items/Weapons/Summon/VileFeeder.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.shoot = ModContent.ProjectileType(); Item.knockBack = 0.5f; - Item.useTime = Item.useAnimation = 30; + Item.useAnimation = Item.useTime = 30; Item.mana = 10; Item.noMelee = true; Item.autoReuse = true; diff --git a/Items/Weapons/Summon/ViralSprout.cs b/Items/Weapons/Summon/ViralSprout.cs index a15b2b4211..54ebb7c65e 100644 --- a/Items/Weapons/Summon/ViralSprout.cs +++ b/Items/Weapons/Summon/ViralSprout.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 56; Item.damage = 30; Item.mana = 10; - Item.useTime = Item.useAnimation = 19; + Item.useAnimation = Item.useTime = 19; Item.useStyle = ItemUseStyleID.HoldUp; Item.noMelee = true; Item.knockBack = 2f; diff --git a/Items/Weapons/Summon/ViridVanguard.cs b/Items/Weapons/Summon/ViridVanguard.cs index 2e30e7403b..70a121b995 100644 --- a/Items/Weapons/Summon/ViridVanguard.cs +++ b/Items/Weapons/Summon/ViridVanguard.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.damage = 73; Item.DamageType = DamageClass.Summon; Item.mana = 10; - Item.useTime = Item.useAnimation = 14; + Item.useAnimation = Item.useTime = 14; Item.useStyle = ItemUseStyleID.HoldUp; Item.noMelee = true; Item.knockBack = 5f; diff --git a/Items/Weapons/Summon/VoidConcentrationStaff.cs b/Items/Weapons/Summon/VoidConcentrationStaff.cs index 4d0ecae6ad..07c45ad056 100644 --- a/Items/Weapons/Summon/VoidConcentrationStaff.cs +++ b/Items/Weapons/Summon/VoidConcentrationStaff.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.mana = 10; Item.damage = 105; Item.knockBack = 4f; - Item.useTime = Item.useAnimation = 15; // 14 because of useStyle 1 + Item.useAnimation = Item.useTime = 15; // 14 because of useStyle 1 Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 10f; Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; diff --git a/Items/Weapons/Summon/WarloksMoonFist.cs b/Items/Weapons/Summon/WarloksMoonFist.cs index d1b4234ac0..acf57bc377 100644 --- a/Items/Weapons/Summon/WarloksMoonFist.cs +++ b/Items/Weapons/Summon/WarloksMoonFist.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 50; Item.damage = 450; Item.mana = 10; - Item.useTime = Item.useAnimation = 25; + Item.useAnimation = Item.useTime = 25; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.knockBack = 2f; diff --git a/Items/Weapons/Summon/WitherBlossomsStaff.cs b/Items/Weapons/Summon/WitherBlossomsStaff.cs index 41f37201aa..94ec6fab88 100644 --- a/Items/Weapons/Summon/WitherBlossomsStaff.cs +++ b/Items/Weapons/Summon/WitherBlossomsStaff.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 60; Item.damage = 50; Item.mana = 10; - Item.useTime = Item.useAnimation = 20; + Item.useAnimation = Item.useTime = 20; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.knockBack = 3f; diff --git a/Items/Weapons/Summon/WulfrumController.cs b/Items/Weapons/Summon/WulfrumController.cs index 82f79133b8..5f1337603a 100644 --- a/Items/Weapons/Summon/WulfrumController.cs +++ b/Items/Weapons/Summon/WulfrumController.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.height = 20; Item.damage = 16; Item.mana = 10; - Item.useTime = Item.useAnimation = 34; + Item.useAnimation = Item.useTime = 34; Item.useStyle = ItemUseStyleID.HoldUp; Item.noMelee = true; Item.knockBack = 0.5f; diff --git a/Items/Weapons/Summon/YharonsKindleStaff.cs b/Items/Weapons/Summon/YharonsKindleStaff.cs index 6dbd440111..35ddfb45f2 100644 --- a/Items/Weapons/Summon/YharonsKindleStaff.cs +++ b/Items/Weapons/Summon/YharonsKindleStaff.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.damage = 325; Item.mana = 10; Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = Item.useAnimation = 10; + Item.useAnimation = Item.useTime = 10; Item.noMelee = true; Item.knockBack = 7f; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; diff --git a/Items/Weapons/Typeless/RelicOfDeliverance.cs b/Items/Weapons/Typeless/RelicOfDeliverance.cs index 18fa4a63c8..b7eaf469db 100644 --- a/Items/Weapons/Typeless/RelicOfDeliverance.cs +++ b/Items/Weapons/Typeless/RelicOfDeliverance.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Typeless Item.width = 32; Item.height = 46; Item.damage = 1350; - Item.useTime = Item.useAnimation = 25; + Item.useAnimation = Item.useTime = 25; Item.reuseDelay = 15; Item.useStyle = ItemUseStyleID.Shoot; Item.UseSound = SoundID.Item46; diff --git a/Items/Weapons/Typeless/Skynamite.cs b/Items/Weapons/Typeless/Skynamite.cs index 351f6072f8..289b56d692 100644 --- a/Items/Weapons/Typeless/Skynamite.cs +++ b/Items/Weapons/Typeless/Skynamite.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Typeless { Item.width = 8; Item.height = 28; - Item.useTime = Item.useAnimation = 40; + Item.useAnimation = Item.useTime = 40; Item.maxStack = 9999; Item.consumable = true; Item.shootSpeed = 5f; diff --git a/Localization/en-US/Mods.CalamityMod.Buffs.hjson b/Localization/en-US/Mods.CalamityMod.Buffs.hjson index 546fec1f08..a31139fa47 100644 --- a/Localization/en-US/Mods.CalamityMod.Buffs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Buffs.hjson @@ -243,6 +243,11 @@ SulphuricPoisoning: { Description: The acidic water burns away your flesh } +TrueVulnerabilityHex: { + DisplayName: True Vulnerability Hex + Description: The end has come +} + Vaporfied: { DisplayName: Vaporfied Description: Vape diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index 06dc107259..adedcb5598 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -373,6 +373,9 @@ Calamity: { ''' Lights your cursor ablaze with the Witch's flames, engulfing it in a blazing aura Enemies touching the blaze take immense damage and are inflicted with Vulnerability Hex + Focusing an enemy for 2.5 seconds curses them, ascending Vulnerability Hex to its True form + Foes afflicted with True Vulnerability Hex take 1.15x damage from all sources + This effect is increased to 2.5x for the blazing cursor itself Equip in a vanity slot to change the cursor without dealing damage These changes work in conjunction with the Rainbow Cursor ''' diff --git a/Localization/en-US/Mods.CalamityMod.Items.Lore.hjson b/Localization/en-US/Mods.CalamityMod.Items.Lore.hjson index fad6ef1784..c148a105c5 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Lore.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Lore.hjson @@ -466,7 +466,7 @@ LorePerforators: { These creatures were unique. They wielded the slain Gods' power as purely as possible, veins flowing with spilt ichor. All that exists in the Crimson is truly the divine turned inside out; their gore now glistens with perverse treachery for all to bear witness. The mire reeks of centuries of vile manipulation and callous domination of the hapless. - Judgment has long passed and only extinction is left waiting. + Judgement has long passed and only extinction is left waiting. ''' Tooltip: "" } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson index b6c818e2e0..12b54a62da 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson @@ -762,6 +762,11 @@ SulphurousTorch: { Tooltip: Can be placed in water } +SunkenIdol: { + DisplayName: Sunken Idol + Tooltip: "" +} + ThaumaticChair: { DisplayName: Thaumatic Chair Tooltip: One of Chloe's finest creations diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson index 8842f6de97..4c2143070a 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson @@ -165,8 +165,9 @@ BurningSea: { DisplayName: Burning Sea Tooltip: ''' - Fires a bouncing brimstone fireball that splits into homing fireballs upon collision with liquid - Enemies inflicted with a water debuff also spawn homing fireballs on hit + Conjures a massive brimstone fireball that hovers near you and incinerates foes + Holding the fireball for too long causes it to burn out + This burns you with Brimstone Flames and gives a long delay before another can be cast ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson index 3431fac6be..65306a5767 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson @@ -674,14 +674,7 @@ GrandGuardian: { GreatswordofJudgement: { DisplayName: Greatsword of Judgement - Tooltip: - ''' - Fires a white orb that emits white rain from where it dissipates for a time - A pale white sword from a forgotten land - You can hear faint yet comforting whispers emanating from the blade - 'No matter where you may be you are never alone - I shall always be at your side, my lord' - ''' + Tooltip: Fires a piercing energy wave that releases homing stars as it flies } Greentide: { @@ -921,11 +914,10 @@ Orderbringer: { DisplayName: Orderbringer Tooltip: ''' - Fires a rainbow blade that emits rainbow rain from where it dissipated for a time - A pale white sword from a forgotten land - You can hear faint yet comforting whispers emanating from the blade - 'No matter where you may be you are never alone - I shall always be at your side, my lord' + Fires piercing energy waves and summons four homing stars near your cursor + Energy waves deal more damage with each consecutive hit + Hits with the blade summon two beams from the sky + 'No matter where you may be you are never alone' ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson index 006bd707f1..ffdd1f4286 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson @@ -348,7 +348,7 @@ EclipsesFall: { ''' Summons spears from the sky on hit Stealth strikes impale enemies and summon a constant barrage of spears over time - 'When the sun goes dark, you will know judgment' + 'When the sun goes dark, you will know judgement' ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Misc.hjson b/Localization/en-US/Mods.CalamityMod.Misc.hjson index 5bee99dffd..ca72be5b6f 100644 --- a/Localization/en-US/Mods.CalamityMod.Misc.hjson +++ b/Localization/en-US/Mods.CalamityMod.Misc.hjson @@ -40,6 +40,7 @@ CragmawVibeCheck: Vibe check. AutocannonHot: OUCH! HOT! NoComputer: No decryption computer installed ArkParry: Parry! +BurningSeaBurn: It burns... LightsWarning: I've gotta give you a flashing lights warning on this one ClockworkTick: Tick ClockworkTock: Tock diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Magic.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Magic.hjson index 5be0d801b9..c2d1a9da29 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Magic.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Magic.hjson @@ -34,10 +34,7 @@ BloodRay.DisplayName: Blood Ray BlueBubble.DisplayName: Bubble BlushieStaffProj.DisplayName: Staff of Blushie BrimroseBeam.DisplayName: Brimrose Beam -BrimstoneFireball.DisplayName: Brimstone Fireball BrimstoneHellfireballFriendly.DisplayName: Hellfireball -BrimstoneHomer.DisplayName: Brimstone Homer -BrimstoneTentacle.DisplayName: Brimstone Tentacle CauldronProj.DisplayName: Smauldron CauldronProjSmall.DisplayName: Smaullerdron ChronoIcicleLarge.DisplayName: Chrono Icicle @@ -103,6 +100,7 @@ IceBlockIcicle.DisplayName: Ice Barrage IceCluster.DisplayName: Ice Cluster Icicle.DisplayName: Icicle IcicleStaffProj.DisplayName: Furious Icicle +IncineratingFireball.DisplayName: Incinerating Fireball InfernadoFriendly.DisplayName: Infernado InfernadoMarkFriendly.DisplayName: Infernado Mark InfernalBlade.DisplayName: Infernal Blade diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson index 70ff268fe3..2286355f2b 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson @@ -188,10 +188,8 @@ NeptunesBountySplitProjectile.DisplayName: Neptune's Bounty Jet Oathblade.DisplayName: Oathblade OathswordFlame.DisplayName: Oathsword Flame Orbacle.DisplayName: Auric Orb -OrderbringerAura.DisplayName: Aura OrderbringerBeam.DisplayName: Orderbringer Beam -OrderbringerRain.DisplayName: Rain -OrderbringerWhiteOrb.DisplayName: Orderbringer Orb +OrderbringerWaveProj.DisplayName: Order-bringing Wave PhoenixsPride.DisplayName: Phoenix's Pride PhosphorescentGauntletPunches.DisplayName: Gauntlet Punch PhotonRipperProjectile.DisplayName: Extraordinarily Cost-Inefficient Chainsaw @@ -240,6 +238,7 @@ SpineOfThanatosProjectile.DisplayName: Spine of Thanatos StarburstBeam.DisplayName: Star Shiv StarburstSHIV.DisplayName: SHIV StarnightBeam.DisplayName: Starnight Beam +StarofJudgement.DisplayName: Star of Judgement StellarContemptBlast.DisplayName: Stellar Blast StellarContemptEcho.DisplayName: Echoes of Contempt StellarContemptHammer.DisplayName: Stellar Contempt @@ -300,9 +299,6 @@ VoidTentacle.DisplayName: Void Tentacle VolcanicFireball.DisplayName: Volcanic Fireball VolcanicFireballLarge.DisplayName: Volcanic Fireball Waterfall.DisplayName: Waterfall Beam -WhiteBoltAura.DisplayName: White Aura -WhiteOrb.DisplayName: White Orb -Whiterain.DisplayName: White Rain WulfrumScrew.DisplayName: Wulfrum Screw WulfrumScrewdriverProj.DisplayName: Wulfrum Screwdriver YinYoDark.DisplayName: Dark Shard diff --git a/Localization/en-US/Mods.CalamityMod.Status.Boss.hjson b/Localization/en-US/Mods.CalamityMod.Status.Boss.hjson index 735a20c834..05300a04a6 100644 --- a/Localization/en-US/Mods.CalamityMod.Status.Boss.hjson +++ b/Localization/en-US/Mods.CalamityMod.Status.Boss.hjson @@ -5,6 +5,7 @@ CryogenBossText: Cryogen is derping out! PyrogenBossText: Pyrogen is derping out! // Triplets TripletsBossText: The Triplets have awoken! +TripletsDefeatName: The Triplets // Calamitas Clone CalamitasBossText: You underestimate my power... CalamitasBossText2: Rise again, my siblings. diff --git a/NPCs/Abyss/Bloatfish.cs b/NPCs/Abyss/Bloatfish.cs index e1a0033532..443f800147 100644 --- a/NPCs/Abyss/Bloatfish.cs +++ b/NPCs/Abyss/Bloatfish.cs @@ -28,7 +28,7 @@ namespace CalamityMod.NPCs.Abyss NPC.width = 74; NPC.height = 94; NPC.defense = 100; - NPC.lifeMax = 7200; + NPC.lifeMax = 9000; NPC.aiStyle = -1; AIType = -1; NPC.value = Item.buyPrice(0, 0, 30, 0); diff --git a/NPCs/Abyss/BobbitWormHead.cs b/NPCs/Abyss/BobbitWormHead.cs index ce50cbf3a2..17c0ade294 100644 --- a/NPCs/Abyss/BobbitWormHead.cs +++ b/NPCs/Abyss/BobbitWormHead.cs @@ -37,7 +37,7 @@ namespace CalamityMod.NPCs.Abyss NPC.height = 40; NPC.defense = 50; NPC.DR_NERD(0.25f); - NPC.lifeMax = 6000; + NPC.lifeMax = 7500; NPC.knockBackResist = 0f; AIType = -1; NPC.noGravity = true; diff --git a/NPCs/Abyss/BoxJellyfish.cs b/NPCs/Abyss/BoxJellyfish.cs index c0a59b59c8..6019c96bf4 100644 --- a/NPCs/Abyss/BoxJellyfish.cs +++ b/NPCs/Abyss/BoxJellyfish.cs @@ -30,7 +30,7 @@ namespace CalamityMod.NPCs.Abyss NPC.width = 30; NPC.height = 33; NPC.defense = 5; - NPC.lifeMax = 90; + NPC.lifeMax = 115; NPC.alpha = 20; NPC.aiStyle = -1; AIType = -1; diff --git a/NPCs/Abyss/CannonballJellyfish.cs b/NPCs/Abyss/CannonballJellyfish.cs index 772500e4be..d8d03e3d06 100644 --- a/NPCs/Abyss/CannonballJellyfish.cs +++ b/NPCs/Abyss/CannonballJellyfish.cs @@ -41,7 +41,7 @@ namespace CalamityMod.NPCs.Abyss NPC.width = 54; NPC.height = 76; NPC.defense = 0; - NPC.lifeMax = 400; + NPC.lifeMax = 500; NPC.knockBackResist = 0f; NPC.alpha = 100; NPC.value = Item.buyPrice(0, 0, 1, 5); diff --git a/NPCs/Abyss/ChaoticPuffer.cs b/NPCs/Abyss/ChaoticPuffer.cs index e508bee9e5..30908f86b4 100644 --- a/NPCs/Abyss/ChaoticPuffer.cs +++ b/NPCs/Abyss/ChaoticPuffer.cs @@ -41,7 +41,7 @@ namespace CalamityMod.NPCs.Abyss NPC.width = 78; NPC.height = 78; NPC.defense = 50; - NPC.lifeMax = 5600; + NPC.lifeMax = 7000; NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; diff --git a/NPCs/Abyss/Cuttlefish.cs b/NPCs/Abyss/Cuttlefish.cs index fe588479a6..58f61f9a7b 100644 --- a/NPCs/Abyss/Cuttlefish.cs +++ b/NPCs/Abyss/Cuttlefish.cs @@ -36,7 +36,7 @@ namespace CalamityMod.NPCs.Abyss NPC.width = 58; NPC.height = 30; NPC.defense = 8; - NPC.lifeMax = 110; + NPC.lifeMax = 140; NPC.aiStyle = -1; AIType = -1; NPC.alpha = 150; diff --git a/NPCs/Abyss/DevilFish.cs b/NPCs/Abyss/DevilFish.cs index d8bb936e3b..343826c270 100644 --- a/NPCs/Abyss/DevilFish.cs +++ b/NPCs/Abyss/DevilFish.cs @@ -51,7 +51,7 @@ namespace CalamityMod.NPCs.Abyss NPC.width = 136; NPC.height = 62; NPC.defense = 999999; - NPC.lifeMax = 400; + NPC.lifeMax = 500; NPC.aiStyle = -1; AIType = -1; NPC.value = Item.buyPrice(0, 0, 10, 0); diff --git a/NPCs/Abyss/DevilFishAlt.cs b/NPCs/Abyss/DevilFishAlt.cs index 607e863a20..6219dbd31e 100644 --- a/NPCs/Abyss/DevilFishAlt.cs +++ b/NPCs/Abyss/DevilFishAlt.cs @@ -41,7 +41,7 @@ namespace CalamityMod.NPCs.Abyss NPC.width = 136; NPC.height = 62; NPC.defense = 999999; - NPC.lifeMax = 400; + NPC.lifeMax = 500; NPC.aiStyle = -1; AIType = -1; NPC.value = Item.buyPrice(0, 0, 10, 0); diff --git a/NPCs/Abyss/GiantSquid.cs b/NPCs/Abyss/GiantSquid.cs index c6e40661f5..5447f78ee1 100644 --- a/NPCs/Abyss/GiantSquid.cs +++ b/NPCs/Abyss/GiantSquid.cs @@ -38,7 +38,7 @@ namespace CalamityMod.NPCs.Abyss NPC.width = 62; NPC.height = 226; NPC.defense = 18; - NPC.lifeMax = 800; + NPC.lifeMax = 1000; NPC.aiStyle = -1; AIType = -1; NPC.value = Item.buyPrice(0, 0, 15, 0); diff --git a/NPCs/Abyss/Laserfish.cs b/NPCs/Abyss/Laserfish.cs index 2550cd0e7d..9e492a9e95 100644 --- a/NPCs/Abyss/Laserfish.cs +++ b/NPCs/Abyss/Laserfish.cs @@ -35,7 +35,7 @@ namespace CalamityMod.NPCs.Abyss NPC.width = 58; NPC.height = 32; NPC.defense = 15; - NPC.lifeMax = 480; + NPC.lifeMax = 600; NPC.aiStyle = -1; AIType = -1; NPC.value = Item.buyPrice(0, 0, 10, 0); diff --git a/NPCs/Abyss/LuminousCorvina.cs b/NPCs/Abyss/LuminousCorvina.cs index a729bdce48..b4e434120d 100644 --- a/NPCs/Abyss/LuminousCorvina.cs +++ b/NPCs/Abyss/LuminousCorvina.cs @@ -45,7 +45,7 @@ namespace CalamityMod.NPCs.Abyss NPC.width = 68; NPC.height = 58; NPC.defense = 12; - NPC.lifeMax = 800; + NPC.lifeMax = 1000; NPC.aiStyle = -1; AIType = -1; NPC.value = Item.buyPrice(0, 0, 15, 0); diff --git a/NPCs/Abyss/MirageJelly.cs b/NPCs/Abyss/MirageJelly.cs index c57b37a7d0..c6f9f4720e 100644 --- a/NPCs/Abyss/MirageJelly.cs +++ b/NPCs/Abyss/MirageJelly.cs @@ -47,7 +47,7 @@ namespace CalamityMod.NPCs.Abyss NPC.width = 78; NPC.height = 170; NPC.defense = 10; - NPC.lifeMax = 6000; + NPC.lifeMax = 7500; NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; diff --git a/NPCs/Abyss/MorayEel.cs b/NPCs/Abyss/MorayEel.cs index e67b588fb1..a014782a44 100644 --- a/NPCs/Abyss/MorayEel.cs +++ b/NPCs/Abyss/MorayEel.cs @@ -34,7 +34,7 @@ namespace CalamityMod.NPCs.Abyss NPC.width = 136; NPC.height = 40; NPC.defense = 8; - NPC.lifeMax = 360; + NPC.lifeMax = 450; NPC.aiStyle = -1; AIType = -1; NPC.value = Item.buyPrice(0, 0, 1, 0); diff --git a/NPCs/Abyss/OarfishBody.cs b/NPCs/Abyss/OarfishBody.cs index 2849ab2efa..4eed3b93b0 100644 --- a/NPCs/Abyss/OarfishBody.cs +++ b/NPCs/Abyss/OarfishBody.cs @@ -21,7 +21,7 @@ namespace CalamityMod.NPCs.Abyss NPC.width = 16; //28 NPC.height = 16; //28 NPC.defense = 20; - NPC.lifeMax = 4000; + NPC.lifeMax = 5000; NPC.aiStyle = -1; //new AIType = -1; //new NPC.knockBackResist = 0f; diff --git a/NPCs/Abyss/OarfishHead.cs b/NPCs/Abyss/OarfishHead.cs index 9459276e5a..87cec98b06 100644 --- a/NPCs/Abyss/OarfishHead.cs +++ b/NPCs/Abyss/OarfishHead.cs @@ -41,7 +41,7 @@ namespace CalamityMod.NPCs.Abyss NPC.width = 59; NPC.height = 38; NPC.defense = 10; - NPC.lifeMax = 4000; + NPC.lifeMax = 5000; NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; diff --git a/NPCs/Abyss/OarfishTail.cs b/NPCs/Abyss/OarfishTail.cs index eb0ce07f93..3cad7a666d 100644 --- a/NPCs/Abyss/OarfishTail.cs +++ b/NPCs/Abyss/OarfishTail.cs @@ -21,7 +21,7 @@ namespace CalamityMod.NPCs.Abyss NPC.width = 14; //28 NPC.height = 16; //28 NPC.defense = 30; - NPC.lifeMax = 4000; + NPC.lifeMax = 5000; NPC.aiStyle = -1; //new AIType = -1; //new NPC.knockBackResist = 0f; diff --git a/NPCs/Abyss/SlabCrab.cs b/NPCs/Abyss/SlabCrab.cs index 1e5192ee43..16962f9714 100644 --- a/NPCs/Abyss/SlabCrab.cs +++ b/NPCs/Abyss/SlabCrab.cs @@ -53,7 +53,7 @@ namespace CalamityMod.NPCs.Abyss NPC.height = 30; NPC.damage = BaseAttack; - NPC.lifeMax = 300; + NPC.lifeMax = 375; NPC.aiStyle = AIType = -1; diff --git a/NPCs/Abyss/ToxicMinnow.cs b/NPCs/Abyss/ToxicMinnow.cs index 02efa40f7b..7528545986 100644 --- a/NPCs/Abyss/ToxicMinnow.cs +++ b/NPCs/Abyss/ToxicMinnow.cs @@ -42,7 +42,7 @@ namespace CalamityMod.NPCs.Abyss NPC.width = 80; NPC.height = 40; NPC.defense = 20; - NPC.lifeMax = 240; + NPC.lifeMax = 300; NPC.aiStyle = -1; AIType = -1; NPC.value = Item.buyPrice(0, 0, 5, 0); diff --git a/NPCs/Abyss/Viperfish.cs b/NPCs/Abyss/Viperfish.cs index c81ad502c2..935c1a319f 100644 --- a/NPCs/Abyss/Viperfish.cs +++ b/NPCs/Abyss/Viperfish.cs @@ -43,7 +43,7 @@ namespace CalamityMod.NPCs.Abyss NPC.width = 76; NPC.height = 36; NPC.defense = 10; - NPC.lifeMax = 320; + NPC.lifeMax = 400; NPC.aiStyle = -1; AIType = -1; NPC.value = Item.buyPrice(0, 0, 5, 0); diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 70d09800df..7081bd9f1e 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -77,6 +77,7 @@ using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; using Terraria.ModLoader.Utilities; +using Terraria.UI.Chat; using Terraria.Utilities; using static Terraria.ModLoader.ModContent; @@ -264,6 +265,8 @@ namespace CalamityMod.NPCs public int veriumDoomTimer = 0; public int veriumDoomStacks = 0; public bool veriumDoomMarked = false; + public int cursorFocus = 0; + public const int cursorFocusMax = 300; // Soma Prime Shred deals damage with DirectStrikes instead of with direct debuff damage // It also stacks, scales with ranged damage, and can crit, meaning it needs to know who applied it most recently @@ -297,6 +300,7 @@ namespace CalamityMod.NPCs public int sagePoisonTime = 0; public int sagePoisonDamage = 0; public int vulnerabilityHex = 0; + public int trueVulnerabilityHex = 0; public int banishingFire = 0; public int wither = 0; public int ashesOnDeath = 0; @@ -491,6 +495,7 @@ namespace CalamityMod.NPCs myClone.veriumDoomTimer = veriumDoomTimer; myClone.veriumDoomStacks = veriumDoomStacks; myClone.veriumDoomMarked = veriumDoomMarked; + myClone.cursorFocus = cursorFocus; myClone.somaShredStacks = somaShredStacks; myClone.somaShredApplicator = somaShredApplicator; @@ -521,6 +526,7 @@ namespace CalamityMod.NPCs myClone.sagePoisonTime = sagePoisonTime; myClone.sagePoisonDamage = sagePoisonDamage; myClone.vulnerabilityHex = vulnerabilityHex; + myClone.trueVulnerabilityHex = trueVulnerabilityHex; myClone.banishingFire = banishingFire; myClone.wither = wither; myClone.ashesOnDeath = ashesOnDeath; @@ -986,6 +992,13 @@ namespace CalamityMod.NPCs ApplyDPSDebuff(baseVulnerabilityHexDoTValue, VulnerabilityHex.TickNumber, ref npc.lifeRegen, ref damage); } + // True Vulnerability Hex + if (trueVulnerabilityHex > 0) + { + int baseTrueVHexDoTValue = (int)(TrueVulnerabilityHex.DPS * heatDamageMult); + ApplyDPSDebuff(baseTrueVHexDoTValue, TrueVulnerabilityHex.TickNumber, ref npc.lifeRegen, ref damage); + } + // Frostburn if (npc.onFrostBurn) { @@ -1193,7 +1206,7 @@ namespace CalamityMod.NPCs if (elementalMix > 0) ApplyDPSDebuff(400, 80, ref npc.lifeRegen, ref damage); if (miracleBlight > 0) - ApplyDPSDebuff(2500, 500, ref npc.lifeRegen, ref damage); + ApplyDPSDebuff(3000, 500, ref npc.lifeRegen, ref damage); // Reduce DoT on worm bosses and Creepers by 75%. if ((wormBoss || npc.type == NPCID.Creeper) && npc.lifeRegen < 0) @@ -1226,6 +1239,10 @@ namespace CalamityMod.NPCs // Set Plantera to be able to update oldPos[x] // This is only used for her Rev+ AI charge attacks NPCID.Sets.TrailingMode[NPCID.Plantera] = 1; + + // Allow Moon Lord to directly be summoned in Multiplayer. + // This is used for the modified Celestial Sigil without Impending Doom. + NPCID.Sets.MPAllowedEnemies[NPCID.MoonLordCore] = true; } public override void SetDefaults(NPC npc) @@ -3459,11 +3476,14 @@ namespace CalamityMod.NPCs { if (CalamityWorld.revenge || BossRushEvent.BossRushActive) { + if (npc.type == NPCID.SkeletronPrime && (Main.masterMode || BossRushEvent.BossRushActive)) + index = CalamityMod.chadPrimeIcon; + if (npc.type == NPCID.DukeFishron && (CalamityWorld.death || BossRushEvent.BossRushActive)) { float lifeRatio = npc.life / (float)npc.lifeMax; float mapIconVanishValue = Main.masterMode ? 0.3f : 0.4f; - if (lifeRatio < mapIconVanishValue || (lifeRatio > 0.9f && Main.masterMode)) + if (lifeRatio < mapIconVanishValue || (lifeRatio > 0.9f && (Main.masterMode || BossRushEvent.BossRushActive))) index = -1; } } @@ -5224,6 +5244,13 @@ namespace CalamityMod.NPCs laceration--; if (elementalMix > 0) elementalMix--; + if (trueVulnerabilityHex > 0) + { + vulnerabilityHex = 0; // You cannot stack True VHex with its lesser counterpart. + trueVulnerabilityHex--; + if (trueVulnerabilityHex == 0) + cursorFocus = 0; + } if (vulnerabilityHex > 0) vulnerabilityHex--; if (marked > 0) @@ -5298,7 +5325,8 @@ namespace CalamityMod.NPCs cobaltNerfTimer--; if (mythrilNerfTimer > 0) mythrilNerfTimer--; - + if (cursorFocus > 0 && cursorFocus < cursorFocusMax) + cursorFocus--; if (veriumDoomTimer > 0) veriumDoomTimer--; if (veriumDoomTimer == 0 && veriumDoomMarked) @@ -5827,11 +5855,15 @@ namespace CalamityMod.NPCs modifiers.CritDamage += bonus; } - // Plague Reaper deals 1.1x damage to Plagued enemies if (!projectile.npcProj && !projectile.trap) { + // Plague Reaper deals 1.1x damage to Plagued enemies if (projectile.CountsAsClass() && modPlayer.plagueReaper && pFlames > 0) modifiers.SourceDamage *= 1.1f; + + // True Vulnerability Hex causes enemies to take 1.15x damage, 2.5x from Calamity itself + if (trueVulnerabilityHex > 0) + modifiers.SourceDamage *= (projectile.type == ProjectileType() && projectile.ai[1] == 1f) ? 2.5f : 1.15f; } // Any weapons that shoot projectiles from anywhere other than the player's center aren't affected by point-blank shot damage boost. @@ -6664,9 +6696,6 @@ namespace CalamityMod.NPCs if (pearlAura > 0) PearlAura.DrawEffects(npc, ref drawColor); - if (voidfrost > 0) - Voidfrost.DrawEffects(npc, ref drawColor); - if (pFlames > 0) // Plague debuff Plague.DrawEffects(npc, ref drawColor); @@ -6679,6 +6708,9 @@ namespace CalamityMod.NPCs if (sulphurPoison > 0) SulphuricPoisoning.DrawEffects(npc, ref drawColor); + if (trueVulnerabilityHex > 0) + TrueVulnerabilityHex.DrawEffects(npc, ref drawColor); + if (vaporfied > 0) Vaporfied.DrawEffects(npc, ref drawColor); @@ -6694,6 +6726,9 @@ namespace CalamityMod.NPCs } } + if (voidfrost > 0) + Voidfrost.DrawEffects(npc, ref drawColor); + // TODO -- These debuff visuals cannot be moved because they correspond to vanilla debuffs if (electrified > 0) { @@ -6879,6 +6914,7 @@ namespace CalamityMod.NPCs ("CalamityMod/Buffs/DamageOverTime/SnapClamDebuff", NPC => NPC.Calamity().clamDebuff > 0), ("CalamityMod/Buffs/DamageOverTime/StaticDischarge", NPC => NPC.Calamity().staticDischarge > 0), ("CalamityMod/Buffs/DamageOverTime/SulphuricPoisoning", NPC => NPC.Calamity().sulphurPoison > 0), + ("CalamityMod/Buffs/DamageOverTime/TrueVulnerabilityHex", NPC => NPC.Calamity().trueVulnerabilityHex > 0), ("CalamityMod/Buffs/DamageOverTime/Vaporfied", NPC => NPC.Calamity().vaporfied > 0), ("CalamityMod/Buffs/DamageOverTime/VermillionFlux", NPC => NPC.Calamity().vermillionFlux > 0), ("CalamityMod/Buffs/DamageOverTime/Voidfrost", NPC => NPC.Calamity().voidfrost > 0), @@ -7018,7 +7054,9 @@ namespace CalamityMod.NPCs var tex = currentDebuffs[i]; spriteBatch.Draw(tex, npc.Center - screenPos - new Vector2(drawPosX, drawPosY + additionalYOffset), null, Color.White, 0f, default, 0.5f, SpriteEffects.None, 0f); - // TODO -- Show number of Shred stacks (how?) + // Shred stack display + if (currentDebuffs[i] == TextureAssets.Buff[ModContent.BuffType()].Value) + ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, FontAssets.MouseText.Value, somaShredStacks.ToString(), npc.Center - screenPos - new Vector2(drawPosX, drawPosY + additionalYOffset) + Vector2.One * 4f, Color.Gold, 0f, Vector2.Zero, Vector2.One * Main.UIScale * 0.8f); } } } @@ -7193,7 +7231,7 @@ namespace CalamityMod.NPCs else { // VHex and Miracle Blight visuals do not appear if Odd Mushroom is in use for sanity reasons - if (npc.Calamity().vulnerabilityHex > 0) + if (npc.Calamity().vulnerabilityHex > 0 || npc.Calamity().trueVulnerabilityHex > 0) { float compactness = npc.width * 0.6f; if (compactness < 10f) @@ -7202,7 +7240,7 @@ namespace CalamityMod.NPCs if (power > 2.75f) power = 2.75f; if (VulnerabilityHexFireDrawer is null || VulnerabilityHexFireDrawer.LocalTimer >= VulnerabilityHexFireDrawer.SetLifetime) - VulnerabilityHexFireDrawer = new FireParticleSet(npc.Calamity().vulnerabilityHex, 1, Color.Red * 1.25f, Color.Red, compactness, power); + VulnerabilityHexFireDrawer = new FireParticleSet(npc.Calamity().trueVulnerabilityHex > 0 ? npc.Calamity().trueVulnerabilityHex : npc.Calamity().vulnerabilityHex, 1, Color.Red * 1.25f, Color.Red, compactness, power); else VulnerabilityHexFireDrawer.DrawSet(npc.Bottom - Vector2.UnitY * (12f - npc.gfxOffY)); } @@ -7214,31 +7252,6 @@ namespace CalamityMod.NPCs return MiracleBlightRenderer.ActuallyDoPreDraw; } - // Draw a pillar of light and fade the background as an animation when skipping things in the DD2 event. - if (npc.type == NPCID.DD2EterniaCrystal) - { - float animationTime = 120f - npc.ai[3]; - animationTime /= 120f; - - if (!Main.dedServ) - { - if (!Filters.Scene["CrystalDestructionColor"].IsActive()) - Filters.Scene.Activate("CrystalDestructionColor"); - - Filters.Scene["CrystalDestructionColor"].GetShader().UseIntensity((float)Math.Sin(animationTime * MathHelper.Pi) * 0.4f); - } - - Vector2 drawPosition = npc.Center - screenPos + Vector2.UnitY * 60f; - for (int i = 0; i < 4; i++) - { - float intensity = MathHelper.Clamp(animationTime * 2f - i / 3f, 0f, 1f); - Vector2 origin = new Vector2(TextureAssets.MagicPixel.Value.Width / 2f, TextureAssets.MagicPixel.Value.Height); - Vector2 scale = new Vector2((float)Math.Sqrt(intensity) * 50f, intensity * 4f); - Color beamColor = new Color(0.4f, 0.17f, 0.4f, 0f) * (intensity * (1f - MathHelper.Clamp((animationTime - 0.8f) / 0.2f, 0f, 1f))) * 0.5f; - spriteBatch.Draw(TextureAssets.MagicPixel.Value, drawPosition, null, beamColor, 0f, origin, scale, SpriteEffects.None, 0f); - } - } - if (Main.zenithWorld) { if (NPC.AnyNPCs(NPCType())) diff --git a/NPCs/CalamityGlobalTownNPC.cs b/NPCs/CalamityGlobalTownNPC.cs index 5f961afcc5..fa2a8f9e6a 100644 --- a/NPCs/CalamityGlobalTownNPC.cs +++ b/NPCs/CalamityGlobalTownNPC.cs @@ -159,6 +159,7 @@ namespace CalamityMod.NPCs private static readonly string[] PainterNames = { "Picasso", // <@!353316526306361347> (sconicboom -- for the late picassosbean2819) + "Bew", // <@!232291351167893505> (dmshi) }; private static readonly string[] PartyGirlNames = { @@ -180,6 +181,7 @@ namespace CalamityMod.NPCs "Nyavi Aceso", // <@!270260920888852480> (navigator.) "everquartz", // <@!451343554451865611> (everquartz) "Gwynevere", // <@!142752927348424704> (nuclearchaosazathoth) + "Hael", // <@!641747280944431156> (kalebtull) }; private static readonly string[] SantaClausNames = { diff --git a/NPCs/Crabulon/Crabulon.cs b/NPCs/Crabulon/Crabulon.cs index b34cac0c65..5f145cb61e 100644 --- a/NPCs/Crabulon/Crabulon.cs +++ b/NPCs/Crabulon/Crabulon.cs @@ -833,6 +833,21 @@ namespace CalamityMod.NPCs.Crabulon return false; } + // GFB removes map icon, hover text, and health bar + public override void BossHeadSlot(ref int index) + { + if (Main.zenithWorld) + index = -1; + } + + public override void ModifyHoverBoundingBox(ref Rectangle boundingBox) + { + if (Main.zenithWorld) + boundingBox = Rectangle.Empty; + } + + public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) => Main.zenithWorld ? false : base.DrawHealthBar(hbPosition, ref scale, ref position); + public override void ModifyNPCLoot(NPCLoot npcLoot) { npcLoot.Add(ItemDropRule.BossBag(ModContent.ItemType())); diff --git a/NPCs/NormalNPCs/AeroSlime.cs b/NPCs/NormalNPCs/AeroSlime.cs index 45ce3a6124..04bdff06b7 100644 --- a/NPCs/NormalNPCs/AeroSlime.cs +++ b/NPCs/NormalNPCs/AeroSlime.cs @@ -27,7 +27,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 40; NPC.height = 30; NPC.defense = 6; - NPC.lifeMax = 50; + NPC.lifeMax = 65; NPC.knockBackResist = 0.8f; AnimationType = NPCID.Slimer; NPC.value = Item.buyPrice(0, 0, 1, 0); diff --git a/NPCs/NormalNPCs/ArmoredDiggerHead.cs b/NPCs/NormalNPCs/ArmoredDiggerHead.cs index 1fc942cfb8..7ba9f71d66 100644 --- a/NPCs/NormalNPCs/ArmoredDiggerHead.cs +++ b/NPCs/NormalNPCs/ArmoredDiggerHead.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Weapons.Summon; @@ -429,6 +430,21 @@ namespace CalamityMod.NPCs.NormalNPCs } } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + Player player = spawnInfo.Player; + bool gfbCondition = Main.zenithWorld && (player.ZoneHallow || player.ZoneUnderworldHeight) && NPC.downedMoonlord; + if ((gfbCondition || (player.ZoneRockLayerHeight && !player.ZoneUnderworldHeight && !player.ZoneJungle)) && !player.ZoneDungeon && !player.Calamity().ZoneSunkenSea && !player.Calamity().ZoneAbyss) + { + if (!CalamityPlayer.areThereAnyDamnBosses && NPC.downedPlantBoss && !NPC.AnyNPCs(ModContent.NPCType())) + { + float spawnRateDivisor = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 125f : CalamityWorld.revenge ? 425f : 500f; + return 1 / spawnRateDivisor; + } + } + return 0f; + } + public override void BossLoot(ref string name, ref int potionType) { potionType = ItemID.GreaterHealingPotion; diff --git a/NPCs/NormalNPCs/AuroraSpirit.cs b/NPCs/NormalNPCs/AuroraSpirit.cs index 8052c470be..f6c88947ad 100644 --- a/NPCs/NormalNPCs/AuroraSpirit.cs +++ b/NPCs/NormalNPCs/AuroraSpirit.cs @@ -31,7 +31,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.height = 24; NPC.defense = 8; NPC.alpha = 100; - NPC.lifeMax = 50; + NPC.lifeMax = 65; NPC.value = Item.buyPrice(0, 0, 1, 0); NPC.knockBackResist = 0f; NPC.HitSound = SoundID.NPCHit5; diff --git a/NPCs/NormalNPCs/BloomSlime.cs b/NPCs/NormalNPCs/BloomSlime.cs index 881bde1018..0f47e44f5d 100644 --- a/NPCs/NormalNPCs/BloomSlime.cs +++ b/NPCs/NormalNPCs/BloomSlime.cs @@ -6,6 +6,7 @@ using Terraria.GameContent.Bestiary; using Terraria.ID; using Terraria.ModLoader; using Terraria.ModLoader.Utilities; + namespace CalamityMod.NPCs.NormalNPCs { public class BloomSlime : ModNPC @@ -23,7 +24,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 40; NPC.height = 30; NPC.defense = 25; - NPC.lifeMax = 1000; + NPC.lifeMax = 1250; NPC.knockBackResist = 0.3f; AnimationType = NPCID.CorruptSlime; NPC.value = Item.buyPrice(0, 0, 25, 0); diff --git a/NPCs/NormalNPCs/Bohldohr.cs b/NPCs/NormalNPCs/Bohldohr.cs index 68c3582f54..222b7849e5 100644 --- a/NPCs/NormalNPCs/Bohldohr.cs +++ b/NPCs/NormalNPCs/Bohldohr.cs @@ -22,7 +22,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 40; NPC.height = 40; NPC.defense = 18; - NPC.lifeMax = 300; + NPC.lifeMax = 375; NPC.knockBackResist = 0.95f; NPC.value = Item.buyPrice(0, 0, 10, 0); NPC.HitSound = SoundID.NPCHit7; diff --git a/NPCs/NormalNPCs/CrawlerAmber.cs b/NPCs/NormalNPCs/CrawlerAmber.cs index a2ac0b57eb..ca9d7305f2 100644 --- a/NPCs/NormalNPCs/CrawlerAmber.cs +++ b/NPCs/NormalNPCs/CrawlerAmber.cs @@ -27,7 +27,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 44; NPC.height = 34; NPC.defense = 10; - NPC.lifeMax = 90; + NPC.lifeMax = 115; NPC.knockBackResist = 0.3f; NPC.value = Item.buyPrice(0, 0, 0, 80); NPC.HitSound = SoundID.NPCHit33; diff --git a/NPCs/NormalNPCs/CrawlerAmethyst.cs b/NPCs/NormalNPCs/CrawlerAmethyst.cs index 6a432d29cf..7929f225fd 100644 --- a/NPCs/NormalNPCs/CrawlerAmethyst.cs +++ b/NPCs/NormalNPCs/CrawlerAmethyst.cs @@ -26,7 +26,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 44; NPC.height = 34; NPC.defense = 4; - NPC.lifeMax = 60; + NPC.lifeMax = 75; NPC.knockBackResist = 0.75f; AIType = -1; NPC.value = Item.buyPrice(0, 0, 0, 30); diff --git a/NPCs/NormalNPCs/CrawlerCrystal.cs b/NPCs/NormalNPCs/CrawlerCrystal.cs index aa32b01389..d337458bdc 100644 --- a/NPCs/NormalNPCs/CrawlerCrystal.cs +++ b/NPCs/NormalNPCs/CrawlerCrystal.cs @@ -27,7 +27,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 44; NPC.height = 34; NPC.defense = 12; - NPC.lifeMax = 300; + NPC.lifeMax = 375; NPC.knockBackResist = 0.15f; AIType = -1; NPC.value = Item.buyPrice(0, 0, 5, 0); diff --git a/NPCs/NormalNPCs/CrawlerDiamond.cs b/NPCs/NormalNPCs/CrawlerDiamond.cs index a53c26e4a7..47ef9d0440 100644 --- a/NPCs/NormalNPCs/CrawlerDiamond.cs +++ b/NPCs/NormalNPCs/CrawlerDiamond.cs @@ -26,7 +26,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 44; NPC.height = 34; NPC.defense = 8; - NPC.lifeMax = 150; + NPC.lifeMax = 190; NPC.knockBackResist = 0.35f; AIType = -1; NPC.value = Item.buyPrice(0, 0, 2, 0); diff --git a/NPCs/NormalNPCs/CrawlerEmerald.cs b/NPCs/NormalNPCs/CrawlerEmerald.cs index 187e18bbe4..2a9b2b889d 100644 --- a/NPCs/NormalNPCs/CrawlerEmerald.cs +++ b/NPCs/NormalNPCs/CrawlerEmerald.cs @@ -26,7 +26,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 44; NPC.height = 34; NPC.defense = 6; - NPC.lifeMax = 105; + NPC.lifeMax = 135; NPC.knockBackResist = 0.55f; AIType = -1; NPC.value = Item.buyPrice(0, 0, 1, 0); diff --git a/NPCs/NormalNPCs/CrawlerRuby.cs b/NPCs/NormalNPCs/CrawlerRuby.cs index 7a70aadd97..e04ca7bbb6 100644 --- a/NPCs/NormalNPCs/CrawlerRuby.cs +++ b/NPCs/NormalNPCs/CrawlerRuby.cs @@ -26,7 +26,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 44; NPC.height = 34; NPC.defense = 8; - NPC.lifeMax = 135; + NPC.lifeMax = 170; NPC.knockBackResist = 0.45f; AIType = -1; NPC.value = Item.buyPrice(0, 0, 1, 0); diff --git a/NPCs/NormalNPCs/CrawlerSapphire.cs b/NPCs/NormalNPCs/CrawlerSapphire.cs index 67894c8546..55fad05e87 100644 --- a/NPCs/NormalNPCs/CrawlerSapphire.cs +++ b/NPCs/NormalNPCs/CrawlerSapphire.cs @@ -26,7 +26,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 44; NPC.height = 34; NPC.defense = 6; - NPC.lifeMax = 90; + NPC.lifeMax = 115; NPC.knockBackResist = 0.65f; AIType = -1; NPC.value = Item.buyPrice(0, 0, 1, 0); diff --git a/NPCs/NormalNPCs/CrawlerTopaz.cs b/NPCs/NormalNPCs/CrawlerTopaz.cs index 36752b68e0..0d2e363b1b 100644 --- a/NPCs/NormalNPCs/CrawlerTopaz.cs +++ b/NPCs/NormalNPCs/CrawlerTopaz.cs @@ -26,7 +26,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 44; NPC.height = 34; NPC.defense = 4; - NPC.lifeMax = 45; + NPC.lifeMax = 60; NPC.knockBackResist = 0.85f; AIType = -1; NPC.value = Item.buyPrice(0, 0, 0, 30); diff --git a/NPCs/NormalNPCs/CrimulanBlightSlime.cs b/NPCs/NormalNPCs/CrimulanBlightSlime.cs index 17442a18d1..e1aa62dd99 100644 --- a/NPCs/NormalNPCs/CrimulanBlightSlime.cs +++ b/NPCs/NormalNPCs/CrimulanBlightSlime.cs @@ -22,7 +22,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 60; NPC.height = 42; NPC.defense = 8; - NPC.lifeMax = 130; + NPC.lifeMax = 165; NPC.knockBackResist = 0.3f; AnimationType = NPCID.RainbowSlime; NPC.value = Item.buyPrice(0, 0, 2, 0); diff --git a/NPCs/NormalNPCs/CryoSlime.cs b/NPCs/NormalNPCs/CryoSlime.cs index 7c5c2a66ed..372afeefa0 100644 --- a/NPCs/NormalNPCs/CryoSlime.cs +++ b/NPCs/NormalNPCs/CryoSlime.cs @@ -22,7 +22,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 40; NPC.height = 30; NPC.defense = 8; - NPC.lifeMax = 120; + NPC.lifeMax = 150; NPC.knockBackResist = 0.6f; AnimationType = NPCID.CorruptSlime; NPC.value = Item.buyPrice(0, 0, 5, 0); diff --git a/NPCs/NormalNPCs/Cryon.cs b/NPCs/NormalNPCs/Cryon.cs index 28a4efa960..a8dd2fb9ff 100644 --- a/NPCs/NormalNPCs/Cryon.cs +++ b/NPCs/NormalNPCs/Cryon.cs @@ -25,7 +25,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.height = 64; NPC.defense = 10; NPC.DR_NERD(0.1f); - NPC.lifeMax = 300; + NPC.lifeMax = 375; NPC.knockBackResist = 0.4f; NPC.value = Item.buyPrice(0, 0, 5, 0); NPC.HitSound = SoundID.NPCHit5; diff --git a/NPCs/NormalNPCs/EbonianBlightSlime.cs b/NPCs/NormalNPCs/EbonianBlightSlime.cs index 1cda527552..6f781aef23 100644 --- a/NPCs/NormalNPCs/EbonianBlightSlime.cs +++ b/NPCs/NormalNPCs/EbonianBlightSlime.cs @@ -22,7 +22,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 60; NPC.height = 42; NPC.defense = 8; - NPC.lifeMax = 130; + NPC.lifeMax = 165; NPC.knockBackResist = 0.3f; AnimationType = NPCID.RainbowSlime; NPC.value = Item.buyPrice(0, 0, 2, 0); diff --git a/NPCs/NormalNPCs/FearlessGoldfishWarrior.cs b/NPCs/NormalNPCs/FearlessGoldfishWarrior.cs index 6b730dc634..65cf22f33e 100644 --- a/NPCs/NormalNPCs/FearlessGoldfishWarrior.cs +++ b/NPCs/NormalNPCs/FearlessGoldfishWarrior.cs @@ -27,7 +27,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 36; NPC.height = 32; NPC.defense = Main.hardMode ? 10 : 2; - NPC.lifeMax = Main.hardMode ? 150 : 50; + NPC.lifeMax = Main.hardMode ? 190 : 65; NPC.knockBackResist = Main.hardMode ? 0.2f : 0.5f; NPC.value = Item.buyPrice(0, 0, 1, 0); NPC.HitSound = SoundID.NPCHit1; diff --git a/NPCs/NormalNPCs/Foveanator.cs b/NPCs/NormalNPCs/Foveanator.cs index b20ce40bf3..853bbd3c42 100644 --- a/NPCs/NormalNPCs/Foveanator.cs +++ b/NPCs/NormalNPCs/Foveanator.cs @@ -109,11 +109,7 @@ namespace CalamityMod.NPCs.NormalNPCs // Get a target if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) - { - CalamityTargetingParameters options = CalamityTargetingParameters.BossDefaults; - options.aggroRatio = -1f; - CalamityUtils.CalamityTargeting(NPC, options); - } + CalamityUtils.CalamityTargeting(NPC, default); float enrageScale = bossRush ? 0.5f : 0.3f; if (Main.IsItDay() || bossRush) @@ -211,6 +207,7 @@ namespace CalamityMod.NPCs.NormalNPCs float phase1MaxLaserPhaseDurationDecrease = 120f; // Go to phase 2 early if Spaz and Ret health total goes below 50% + // Go to final phase early if Spaz and Ret health total goes below 20% float retAndSpazHPRatio = 0f; if (CalamityGlobalNPC.fireEye != -1) { @@ -225,14 +222,14 @@ namespace CalamityMod.NPCs.NormalNPCs // Phase checks bool phase2 = lifeRatio < phase2LifeRatio || retAndSpazHPRatio < 0.5f; - bool finalPhase = lifeRatio < finalPhaseLifeRatio; + bool finalPhase = lifeRatio < finalPhaseLifeRatio || retAndSpazHPRatio < 0.2f; Vector2 mechQueenSpacing = Vector2.Zero; if (NPC.IsMechQueenUp) { NPC NPC = Main.npc[NPC.mechQueen]; Vector2 mechQueenCenter = NPC.GetMechQueenCenter(); - Vector2 eyePosition = new Vector2(-150f, -250f); + Vector2 eyePosition = new Vector2(0f, -300f); eyePosition *= 0.75f; float mechdusaRotation = NPC.velocity.X * 0.025f; mechQueenSpacing = mechQueenCenter + eyePosition; @@ -280,8 +277,9 @@ namespace CalamityMod.NPCs.NormalNPCs if (NPC.Center.X < Main.player[NPC.target].position.X + Main.player[NPC.target].width) foveanatorFaceDirection = -1; + // Foveanator stays further away from the player than Retinazer (Retinazer distance is 300, Foveanator distance is 450) Vector2 foveanatorPosition = NPC.Center; - float distanceFromTarget = 300f; + float distanceFromTarget = 450f; float foveanatorTargetX = Main.player[NPC.target].Center.X + (foveanatorFaceDirection * distanceFromTarget) - foveanatorPosition.X; float foveanatorTargetY = Main.player[NPC.target].Center.Y - distanceFromTarget - foveanatorPosition.Y; @@ -341,13 +339,15 @@ namespace CalamityMod.NPCs.NormalNPCs } } + // Foveanator stays in this phase longer than Retinazer (Foveanator time is 450, Retinazer time is 300) + // Foveanator has longer cooldown between firing projectiles than Retinazer (Foveanator cooldown is 60, Retinazer cooldown is 30) NPC.ai[2] += 1f; - float phaseGateValue = 300f - (death ? phase1MaxLaserPhaseDurationDecrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 0f); - float laserGateValue = 30f; + float phaseGateValue = 450f - (death ? phase1MaxLaserPhaseDurationDecrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 0f); + float laserGateValue = 60f; if (NPC.IsMechQueenUp) { - phaseGateValue = 900f; - laserGateValue = ((!NPC.npcsFoundForCheckActive[NPCID.TheDestroyerBody]) ? 60f : 90f); + phaseGateValue = 1350f; + laserGateValue = ((!NPC.npcsFoundForCheckActive[NPCID.TheDestroyerBody]) ? 120f : 180f); } if (NPC.ai[2] >= phaseGateValue) { @@ -355,13 +355,10 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.ai[2] = 0f; NPC.ai[3] = 0f; - CalamityTargetingParameters options = CalamityTargetingParameters.BossDefaults; - options.aggroRatio = -1f; - CalamityUtils.CalamityTargeting(NPC, options); + CalamityUtils.CalamityTargeting(NPC, default); NPC.netUpdate = true; } - else if (foveanatorTargetDistCopy < (death ? 960f : 800f)) { if (!Main.player[NPC.target].dead) @@ -374,14 +371,13 @@ namespace CalamityMod.NPCs.NormalNPCs if (NPC.ai[3] >= laserGateValue) { NPC.ai[3] = 0f; - foveanatorPosition = NPC.Center; - foveanatorTargetX = Main.player[NPC.target].Center.X - foveanatorPosition.X; - foveanatorTargetY = Main.player[NPC.target].Center.Y - foveanatorPosition.Y; if (Main.netMode != NetmodeID.MultiplayerClient) { - float foveanatorSpeed = 10.5f; - foveanatorSpeed += 3f * enrageScale; + float foveanatorLaserSpeed = 12f; + foveanatorLaserSpeed += 4f * enrageScale; + + // TODO - Change this to Foveanator's laser when it's implemented int type = ProjectileID.EyeLaser; int damage = NPC.GetProjectileDamage(type); @@ -396,12 +392,7 @@ namespace CalamityMod.NPCs.NormalNPCs damage = (int)(damage * secondMechMultiplier); } - foveanatorTargetDist = (float)Math.Sqrt(foveanatorTargetX * foveanatorTargetX + foveanatorTargetY * foveanatorTargetY); - foveanatorTargetDist = foveanatorSpeed / foveanatorTargetDist; - foveanatorTargetX *= foveanatorTargetDist; - foveanatorTargetY *= foveanatorTargetDist; - - Vector2 laserVelocity = new Vector2(foveanatorTargetX, foveanatorTargetY); + Vector2 laserVelocity = (Main.player[NPC.target].Center - NPC.Center).SafeNormalize(Vector2.UnitY) * foveanatorLaserSpeed; Projectile.NewProjectile(NPC.GetSource_FromAI(), foveanatorPosition + laserVelocity.SafeNormalize(Vector2.UnitY) * 150f, laserVelocity, type, damage, 0f, Main.myPlayer); } } @@ -414,20 +405,15 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.damage = NPC.defDamage; NPC.rotation = foveanatorHoverRotation; - float foveanatorChargeSpeed = 15f; - foveanatorChargeSpeed += 10f * enrageScale; + float foveanatorChargeSpeed = 8f; + foveanatorChargeSpeed += 5f * enrageScale; if (death) foveanatorChargeSpeed += phase1MaxChargeSpeedIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)); if (Main.getGoodWorld) - foveanatorChargeSpeed += 2f; + foveanatorChargeSpeed += 1f; - Vector2 foveanatorChargePos = NPC.Center; - float foveanatorChargeTargetX = Main.player[NPC.target].Center.X - foveanatorChargePos.X; - float foveanatorChargeTargetY = Main.player[NPC.target].Center.Y - foveanatorChargePos.Y; - float foveanatorChargeTargetDist = (float)Math.Sqrt(foveanatorChargeTargetX * foveanatorChargeTargetX + foveanatorChargeTargetY * foveanatorChargeTargetY); - foveanatorChargeTargetDist = foveanatorChargeSpeed / foveanatorChargeTargetDist; - NPC.velocity.X = foveanatorChargeTargetX * foveanatorChargeTargetDist; - NPC.velocity.Y = foveanatorChargeTargetY * foveanatorChargeTargetDist; + Vector2 chargeVelocity = (Main.player[NPC.target].Center - NPC.Center).SafeNormalize(Vector2.UnitY) * foveanatorChargeSpeed; + NPC.velocity = chargeVelocity; NPC.ai[1] = 2f; } else if (NPC.ai[1] == 2f) @@ -436,13 +422,13 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.damage = NPC.defDamage; NPC.ai[2] += 1f; - float decelerateGateValue = 36f + (death ? 6f * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 0f); + float decelerateGateValue = 72f + (death ? 12f * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 0f); if (NPC.ai[2] >= decelerateGateValue) { // Avoid cheap bullshit NPC.damage = 0; - float decelerationMultiplier = 0.84f - (death ? 0.16f * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 0f); + float decelerationMultiplier = 0.8f - (death ? 0.2f * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 0f); NPC.velocity *= decelerationMultiplier; if (NPC.velocity.X > -0.1 && NPC.velocity.X < 0.1) NPC.velocity.X = 0f; @@ -450,23 +436,25 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.velocity.Y = 0f; } else + { + // Accelerative charge + NPC.velocity *= 1.015f; NPC.rotation = (float)Math.Atan2(NPC.velocity.Y, NPC.velocity.X) - MathHelper.PiOver2; + } - float delayBeforeChargingAgain = 48f - (death ? 3f * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 0f); + float delayBeforeChargingAgain = 96f - (death ? 6f * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 0f); if (NPC.ai[2] >= delayBeforeChargingAgain) { NPC.ai[3] += 1f; NPC.ai[2] = 0f; NPC.rotation = foveanatorHoverRotation; - float totalCharges = death ? 6f : 5f; + float totalCharges = death ? 3f : 2f; if (NPC.ai[3] >= totalCharges) { NPC.ai[1] = 0f; NPC.ai[3] = 0f; - CalamityTargetingParameters options = CalamityTargetingParameters.BossDefaults; - options.aggroRatio = -1f; - CalamityUtils.CalamityTargeting(NPC, options); + CalamityUtils.CalamityTargeting(NPC, default); } else NPC.ai[1] = 1f; @@ -481,9 +469,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.ai[2] = 0f; NPC.ai[3] = 0f; - CalamityTargetingParameters options = CalamityTargetingParameters.BossDefaults; - options.aggroRatio = -1f; - CalamityUtils.CalamityTargeting(NPC, options); + CalamityUtils.CalamityTargeting(NPC, default); NPC.netUpdate = true; } @@ -521,6 +507,8 @@ namespace CalamityMod.NPCs.NormalNPCs if (Main.netMode != NetmodeID.MultiplayerClient) { bool shootLaser = NPC.ai[1] % 20f == 0f; + + // TODO - Change this to Foveanator's lasers and energy bombs when they're implemented int type = shootLaser ? ProjectileID.DeathLaser : ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); @@ -536,10 +524,10 @@ namespace CalamityMod.NPCs.NormalNPCs } Vector2 projectileVelocity = (Main.player[NPC.target].Center - NPC.Center).SafeNormalize(Vector2.UnitY) * 7f; - int numProj = shootLaser ? 6 : 2; - int spread = shootLaser ? 20 : 80; + int numProj = shootLaser ? 4 : 2; + int spread = shootLaser ? 15 : 30; float rotation = MathHelper.ToRadians(spread); - float offset = shootLaser ? 150f : 50f; + float offset = shootLaser ? 150f : 100f; for (int i = 0; i < numProj; i++) { Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); @@ -565,9 +553,9 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int i = 0; i < 2; i++) { - Gore.NewGore(NPC.GetSource_FromAI(), NPC.position, new Vector2(Main.rand.Next(-30, 31) * 0.2f, Main.rand.Next(-30, 31) * 0.2f), 143, 1f); - Gore.NewGore(NPC.GetSource_FromAI(), NPC.position, new Vector2(Main.rand.Next(-30, 31) * 0.2f, Main.rand.Next(-30, 31) * 0.2f), 7, 1f); - Gore.NewGore(NPC.GetSource_FromAI(), NPC.position, new Vector2(Main.rand.Next(-30, 31) * 0.2f, Main.rand.Next(-30, 31) * 0.2f), 6, 1f); + Gore.NewGore(NPC.GetSource_FromAI(), NPC.position, new Vector2(Main.rand.Next(-30, 31) * 0.2f, Main.rand.Next(-30, 31) * 0.2f), Mod.Find("Foveanator1").Type, NPC.scale); + Gore.NewGore(NPC.GetSource_FromAI(), NPC.position, new Vector2(Main.rand.Next(-30, 31) * 0.2f, Main.rand.Next(-30, 31) * 0.2f), 7, NPC.scale); + Gore.NewGore(NPC.GetSource_FromAI(), NPC.position, new Vector2(Main.rand.Next(-30, 31) * 0.2f, Main.rand.Next(-30, 31) * 0.2f), 6, NPC.scale); } } @@ -604,7 +592,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.chaseable = !spazOrRetInPhase1; int setDamage = (int)Math.Round(NPC.defDamage * 1.5); - NPC.defense = NPC.defDefense + 10; + NPC.defense = NPC.defDefense + 14; calamityGlobalNPC.DR = spazOrRetInPhase1 ? 0.9999f : 0.2f; calamityGlobalNPC.unbreakableDR = spazOrRetInPhase1; calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = spazOrRetInPhase1; @@ -616,109 +604,101 @@ namespace CalamityMod.NPCs.NormalNPCs // Avoid cheap bullshit NPC.damage = 0; - float foveanatorPhase2MaxSpeed = 9.5f + (death ? 3f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); - float foveanatorPhase2Accel = 0.175f + (death ? 0.05f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); - foveanatorPhase2MaxSpeed += 4.5f * enrageScale; - foveanatorPhase2Accel += 0.075f * enrageScale; + float foveanatorFlamethrowerMaxSpeed = 4f + (death ? 1.2f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); + float foveanatorFlamethrowerAccel = 0.06f + (death ? 0.02f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); + foveanatorFlamethrowerMaxSpeed += 2f * enrageScale; + foveanatorFlamethrowerAccel += 0.04f * enrageScale; - if (Main.getGoodWorld) + int foveanatorFlamethrowerFaceDirection = 1; + if (NPC.Center.X < Main.player[NPC.target].position.X + Main.player[NPC.target].width) + foveanatorFlamethrowerFaceDirection = -1; + + Vector2 foveanatorFlamethrowerPos = NPC.Center; + int flamethrowerDistance = 360; + float foveanatorFlamethrowerTargetX = Main.player[NPC.target].Center.X + (foveanatorFlamethrowerFaceDirection * flamethrowerDistance) - foveanatorFlamethrowerPos.X; + float foveanatorFlamethrowerTargetY = Main.player[NPC.target].Center.Y - foveanatorFlamethrowerPos.Y; + float foveanatorFlamethrowerTargetDist = (float)Math.Sqrt(foveanatorFlamethrowerTargetX * foveanatorFlamethrowerTargetX + foveanatorFlamethrowerTargetY * foveanatorFlamethrowerTargetY); + + if (!NPC.IsMechQueenUp) { - foveanatorPhase2MaxSpeed *= 1.15f; - foveanatorPhase2Accel *= 1.15f; - } + // Boost speed if too far from target + if (foveanatorFlamethrowerTargetDist > flamethrowerDistance) + foveanatorFlamethrowerMaxSpeed += MathHelper.Lerp(0f, 12f, MathHelper.Clamp((foveanatorFlamethrowerTargetDist - flamethrowerDistance) / 1000f, 0f, 1f)); - Vector2 eyePosition = NPC.Center; - float foveanatorPhase2TargetX = Main.player[NPC.target].Center.X - eyePosition.X; - float distanceFromTarget = 420f; - float foveanatorPhase2TargetY = Main.player[NPC.target].Center.Y - distanceFromTarget - eyePosition.Y; - - if (NPC.IsMechQueenUp) - { - foveanatorPhase2MaxSpeed = 14f; - foveanatorPhase2TargetX = mechQueenSpacing.X; - foveanatorPhase2TargetY = mechQueenSpacing.Y; - foveanatorPhase2TargetX -= eyePosition.X; - foveanatorPhase2TargetY -= eyePosition.Y; - } - - float foveanatorPhase2TargetDist = (float)Math.Sqrt(foveanatorPhase2TargetX * foveanatorPhase2TargetX + foveanatorPhase2TargetY * foveanatorPhase2TargetY); - - if (NPC.IsMechQueenUp) - { - if (foveanatorPhase2TargetDist > foveanatorPhase2MaxSpeed) + if (Main.getGoodWorld) { - foveanatorPhase2TargetDist = foveanatorPhase2MaxSpeed / foveanatorPhase2TargetDist; - foveanatorPhase2TargetX *= foveanatorPhase2TargetDist; - foveanatorPhase2TargetY *= foveanatorPhase2TargetDist; + foveanatorFlamethrowerMaxSpeed *= 1.15f; + foveanatorFlamethrowerAccel *= 1.15f; } - NPC.velocity.X = (NPC.velocity.X * 4f + foveanatorPhase2TargetX) / 5f; - NPC.velocity.Y = (NPC.velocity.Y * 4f + foveanatorPhase2TargetY) / 5f; - } - else - { - foveanatorPhase2TargetDist = foveanatorPhase2MaxSpeed / foveanatorPhase2TargetDist; - foveanatorPhase2TargetX *= foveanatorPhase2TargetDist; - foveanatorPhase2TargetY *= foveanatorPhase2TargetDist; + foveanatorFlamethrowerTargetDist = foveanatorFlamethrowerMaxSpeed / foveanatorFlamethrowerTargetDist; + foveanatorFlamethrowerTargetX *= foveanatorFlamethrowerTargetDist; + foveanatorFlamethrowerTargetY *= foveanatorFlamethrowerTargetDist; - if (NPC.velocity.X < foveanatorPhase2TargetX) + if (NPC.velocity.X < foveanatorFlamethrowerTargetX) { - NPC.velocity.X += foveanatorPhase2Accel; - if (NPC.velocity.X < 0f && foveanatorPhase2TargetX > 0f) - NPC.velocity.X += foveanatorPhase2Accel; + NPC.velocity.X += foveanatorFlamethrowerAccel; + if (NPC.velocity.X < 0f && foveanatorFlamethrowerTargetX > 0f) + NPC.velocity.X += foveanatorFlamethrowerAccel; } - else if (NPC.velocity.X > foveanatorPhase2TargetX) + else if (NPC.velocity.X > foveanatorFlamethrowerTargetX) { - NPC.velocity.X -= foveanatorPhase2Accel; - if (NPC.velocity.X > 0f && foveanatorPhase2TargetX < 0f) - NPC.velocity.X -= foveanatorPhase2Accel; + NPC.velocity.X -= foveanatorFlamethrowerAccel; + if (NPC.velocity.X > 0f && foveanatorFlamethrowerTargetX < 0f) + NPC.velocity.X -= foveanatorFlamethrowerAccel; } - if (NPC.velocity.Y < foveanatorPhase2TargetY) + if (NPC.velocity.Y < foveanatorFlamethrowerTargetY) { - NPC.velocity.Y += foveanatorPhase2Accel; - if (NPC.velocity.Y < 0f && foveanatorPhase2TargetY > 0f) - NPC.velocity.Y += foveanatorPhase2Accel; + NPC.velocity.Y += foveanatorFlamethrowerAccel; + if (NPC.velocity.Y < 0f && foveanatorFlamethrowerTargetY > 0f) + NPC.velocity.Y += foveanatorFlamethrowerAccel; } - else if (NPC.velocity.Y > foveanatorPhase2TargetY) + else if (NPC.velocity.Y > foveanatorFlamethrowerTargetY) { - NPC.velocity.Y -= foveanatorPhase2Accel; - if (NPC.velocity.Y > 0f && foveanatorPhase2TargetY < 0f) - NPC.velocity.Y -= foveanatorPhase2Accel; + NPC.velocity.Y -= foveanatorFlamethrowerAccel; + if (NPC.velocity.Y > 0f && foveanatorFlamethrowerTargetY < 0f) + NPC.velocity.Y -= foveanatorFlamethrowerAccel; } } - NPC.ai[2] += (!spazAlive || !retAlive) ? 1.5f : 1f; - float phaseGateValue = NPC.IsMechQueenUp ? 900f : 300f - (death ? 120f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); + // Fire flamethrower for x seconds + NPC.ai[2] += (retAlive && spazAlive) ? 1f : 2f; + float phaseGateValue = NPC.IsMechQueenUp ? 1350f : 270f - (death ? 90f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); if (NPC.ai[2] >= phaseGateValue) { - NPC.ai[1] = 1f; + // Go to charge phase or fire large barrage of lasers and energy bombs if in final phase + NPC.ai[1] = finalPhase ? 3f : 1f; NPC.ai[2] = 0f; NPC.ai[3] = 0f; - - CalamityTargetingParameters options = CalamityTargetingParameters.BossDefaults; - options.aggroRatio = -1f; - CalamityUtils.CalamityTargeting(NPC, options); - NPC.netUpdate = true; } - eyePosition = NPC.Center; - foveanatorPhase2TargetX = Main.player[NPC.target].Center.X - eyePosition.X; - foveanatorPhase2TargetY = Main.player[NPC.target].Center.Y - eyePosition.Y; - NPC.rotation = (float)Math.Atan2(foveanatorPhase2TargetY, foveanatorPhase2TargetX) - MathHelper.PiOver2; - - if (Main.netMode != NetmodeID.MultiplayerClient) + // Fire fireballs and flamethrower + 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] += 1f + (death ? (phase2LifeRatio - lifeRatio) / phase2LifeRatio : 0f); - if (NPC.localAI[1] >= ((spazAlive && retAlive) ? 52f : 26f)) + // Play flame sound on timer + NPC.localAI[2] += 1f; + if (NPC.localAI[2] > 22f) { - 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 || !retAlive || finalPhase) + NPC.localAI[2] = 0f; + SoundEngine.PlaySound(SoundID.Item34, NPC.Center); + } + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + NPC.localAI[1] += 1f; + if (NPC.localAI[1] > 4f) { NPC.localAI[1] = 0f; - float foveanatorPhase2LaserSpeed = 10f; - foveanatorPhase2LaserSpeed += enrageScale; - int type = ProjectileID.DeathLaser; + + float foveanatorFlamethrowerSpeed = 4f; + foveanatorFlamethrowerSpeed += 2f * enrageScale; + float timeForFlamethrowerToReachMaxVelocity = 60f; + float flamethrowerSpeedScalar = MathHelper.Clamp(NPC.ai[2] / timeForFlamethrowerToReachMaxVelocity, 0f, 1f); + foveanatorFlamethrowerSpeed = MathHelper.Lerp(0.1f, foveanatorFlamethrowerSpeed, flamethrowerSpeedScalar); + + // TODO - Change this to Foveanator's flamethrower when it's done + int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); // Reduce mech boss projectile damage depending on the new ore progression changes @@ -732,351 +712,110 @@ namespace CalamityMod.NPCs.NormalNPCs damage = (int)(damage * secondMechMultiplier); } - foveanatorPhase2TargetDist = (float)Math.Sqrt(foveanatorPhase2TargetX * foveanatorPhase2TargetX + foveanatorPhase2TargetY * foveanatorPhase2TargetY); - foveanatorPhase2TargetDist = foveanatorPhase2LaserSpeed / foveanatorPhase2TargetDist; - foveanatorPhase2TargetX *= foveanatorPhase2TargetDist; - foveanatorPhase2TargetY *= foveanatorPhase2TargetDist; + Vector2 flamethrowerVelocity = (Main.player[NPC.target].Center - NPC.Center).SafeNormalize(Vector2.UnitY) * foveanatorFlamethrowerSpeed + NPC.velocity * 0.5f; - Vector2 laserVelocity = new Vector2(foveanatorPhase2TargetX, foveanatorPhase2TargetY); - if (canHit) + if (NPC.IsMechQueenUp) { - 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; + Vector2 mechdusaFoveanatorShadowFireballPos = (NPC.rotation + MathHelper.PiOver2).ToRotationVector2() * foveanatorFlamethrowerSpeed + NPC.velocity * 0.5f; + foveanatorFlamethrowerTargetX = mechdusaFoveanatorShadowFireballPos.X; + foveanatorFlamethrowerTargetY = mechdusaFoveanatorShadowFireballPos.Y; + foveanatorFlamethrowerPos = NPC.Center - mechdusaFoveanatorShadowFireballPos * 3f; } + + Projectile.NewProjectile(NPC.GetSource_FromAI(), foveanatorFlamethrowerPos + flamethrowerVelocity.SafeNormalize(Vector2.UnitY) * 25f, flamethrowerVelocity, type, damage, 0f, Main.myPlayer); } } } + + if (NPC.IsMechQueenUp) + { + foveanatorFlamethrowerMaxSpeed = 14f; + Vector2 mechdusaFoveanatorFlamethrowerPos = mechQueenSpacing - foveanatorFlamethrowerPos; + Vector2 idealVelocity = new Vector2(foveanatorFlamethrowerTargetX, foveanatorFlamethrowerTargetY); + if (mechdusaFoveanatorFlamethrowerPos.Length() > foveanatorFlamethrowerMaxSpeed) + idealVelocity *= foveanatorFlamethrowerMaxSpeed / mechdusaFoveanatorFlamethrowerPos.Length(); + + float inertia = 60f; + NPC.velocity = (NPC.velocity * (inertia - 1f) + idealVelocity) / inertia; + } } - else + + // Charge + else if (NPC.ai[1] == 1f) { - if (NPC.ai[1] == 1f) + // Set damage + NPC.damage = setDamage; + + // Play charge sound + SoundEngine.PlaySound(SoundID.ForceRoar, NPC.Center); + + // Set rotation and velocity + NPC.rotation = foveanatorHoverRotation; + float foveanatorPhase2ChargeSpeed = 9f + (death ? 2.5f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); + foveanatorPhase2ChargeSpeed += 8f * enrageScale; + if (Main.getGoodWorld) + foveanatorPhase2ChargeSpeed *= 1.2f; + + Vector2 chargeVelocity = (Main.player[NPC.target].Center - NPC.Center).SafeNormalize(Vector2.UnitY) * foveanatorPhase2ChargeSpeed; + NPC.velocity = chargeVelocity; + + NPC.ai[1] = 2f; + } + + // Maintain charge velocity until deceleration + else if (NPC.ai[1] == 2f) + { + // Set damage + NPC.damage = setDamage; + + NPC.ai[2] += (retAlive || spazAlive) ? 1f : 1.25f; + + float chargeTime = 60f - (death ? 20f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); + + // Slow down + if (NPC.ai[2] >= chargeTime) { // Avoid cheap bullshit NPC.damage = 0; - int foveanatorPhase2FaceDirection = 1; - if (NPC.Center.X < Main.player[NPC.target].position.X + Main.player[NPC.target].width) - foveanatorPhase2FaceDirection = -1; - - float foveanatorPhase2RapidFireMaxSpeed = 9.5f + (death ? 3f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); - float foveanatorPhase2RapidFireAccel = 0.25f + (death ? 0.075f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); - foveanatorPhase2RapidFireMaxSpeed += 4.5f * enrageScale; - foveanatorPhase2RapidFireAccel += 0.15f * enrageScale; - - if (Main.getGoodWorld) - { - foveanatorPhase2RapidFireMaxSpeed *= 1.15f; - foveanatorPhase2RapidFireAccel *= 1.15f; - } - - Vector2 foveanatorPhase2RapidFirePos = NPC.Center; - float distanceFromTarget = 420f; - float foveanatorPhase2RapidFireTargetX = Main.player[NPC.target].Center.X + (foveanatorPhase2FaceDirection * distanceFromTarget) - foveanatorPhase2RapidFirePos.X; - float foveanatorPhase2RapidFireTargetY = Main.player[NPC.target].Center.Y - foveanatorPhase2RapidFirePos.Y; - float foveanatorPhase2RapidFireTargetDist = (float)Math.Sqrt(foveanatorPhase2RapidFireTargetX * foveanatorPhase2RapidFireTargetX + foveanatorPhase2RapidFireTargetY * foveanatorPhase2RapidFireTargetY); - foveanatorPhase2RapidFireTargetDist = foveanatorPhase2RapidFireMaxSpeed / foveanatorPhase2RapidFireTargetDist; - foveanatorPhase2RapidFireTargetX *= foveanatorPhase2RapidFireTargetDist; - foveanatorPhase2RapidFireTargetY *= foveanatorPhase2RapidFireTargetDist; - - if (NPC.velocity.X < foveanatorPhase2RapidFireTargetX) - { - NPC.velocity.X += foveanatorPhase2RapidFireAccel; - if (NPC.velocity.X < 0f && foveanatorPhase2RapidFireTargetX > 0f) - NPC.velocity.X += foveanatorPhase2RapidFireAccel; - } - else if (NPC.velocity.X > foveanatorPhase2RapidFireTargetX) - { - NPC.velocity.X -= foveanatorPhase2RapidFireAccel; - if (NPC.velocity.X > 0f && foveanatorPhase2RapidFireTargetX < 0f) - NPC.velocity.X -= foveanatorPhase2RapidFireAccel; - } - if (NPC.velocity.Y < foveanatorPhase2RapidFireTargetY) - { - NPC.velocity.Y += foveanatorPhase2RapidFireAccel; - if (NPC.velocity.Y < 0f && foveanatorPhase2RapidFireTargetY > 0f) - NPC.velocity.Y += foveanatorPhase2RapidFireAccel; - } - else if (NPC.velocity.Y > foveanatorPhase2RapidFireTargetY) - { - NPC.velocity.Y -= foveanatorPhase2RapidFireAccel; - if (NPC.velocity.Y > 0f && foveanatorPhase2RapidFireTargetY < 0f) - NPC.velocity.Y -= foveanatorPhase2RapidFireAccel; - } - - foveanatorPhase2RapidFirePos = NPC.Center; - foveanatorPhase2RapidFireTargetX = Main.player[NPC.target].Center.X - foveanatorPhase2RapidFirePos.X; - foveanatorPhase2RapidFireTargetY = Main.player[NPC.target].Center.Y - foveanatorPhase2RapidFirePos.Y; - NPC.rotation = (float)Math.Atan2(foveanatorPhase2RapidFireTargetY, foveanatorPhase2RapidFireTargetX) - MathHelper.PiOver2; - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - NPC.localAI[1] += 1f + (death ? (phase2LifeRatio - lifeRatio) / phase2LifeRatio : 0f); - if (NPC.localAI[1] > ((spazAlive && retAlive) ? 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 || !retAlive || finalPhase) - { - NPC.localAI[1] = 0f; - int type = ProjectileID.DeathLaser; - int damage = (int)Math.Round(NPC.GetProjectileDamage(type) * 0.75); - - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } - - foveanatorPhase2RapidFireTargetDist = (float)Math.Sqrt(foveanatorPhase2RapidFireTargetX * foveanatorPhase2RapidFireTargetX + foveanatorPhase2RapidFireTargetY * foveanatorPhase2RapidFireTargetY); - foveanatorPhase2RapidFireTargetDist = 9f / foveanatorPhase2RapidFireTargetDist; - foveanatorPhase2RapidFireTargetX *= foveanatorPhase2RapidFireTargetDist; - foveanatorPhase2RapidFireTargetY *= foveanatorPhase2RapidFireTargetDist; - - Vector2 laserVelocity = new Vector2(foveanatorPhase2RapidFireTargetX, foveanatorPhase2RapidFireTargetY); - if (canHit) - { - Projectile.NewProjectile(NPC.GetSource_FromAI(), foveanatorPhase2RapidFirePos + laserVelocity.SafeNormalize(Vector2.UnitY) * 150f, laserVelocity, type, damage, 0f, Main.myPlayer); - } - else - { - int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), foveanatorPhase2RapidFirePos + laserVelocity.SafeNormalize(Vector2.UnitY) * 150f, laserVelocity, type, damage, 0f, Main.myPlayer); - Main.projectile[proj].tileCollide = false; - Main.projectile[proj].timeLeft = 300; - } - } - } - } - - NPC.ai[2] += (spazAlive && retAlive) ? 1f : 1.5f; - if (NPC.ai[2] >= 150f - (death ? 60f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f)) - { - NPC.ai[1] = (!spazAlive || !retAlive || finalPhase) ? 4f : 0f; - NPC.ai[2] = 0f; - NPC.ai[3] = 0f; - - CalamityTargetingParameters options = CalamityTargetingParameters.BossDefaults; - options.aggroRatio = -1f; - CalamityUtils.CalamityTargeting(NPC, options); - - NPC.netUpdate = true; - } + float deceleration = 0.8f - (death ? 0.15f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); + NPC.velocity *= deceleration; + if (NPC.velocity.X > -0.1 && NPC.velocity.X < 0.1) + NPC.velocity.X = 0f; + if (NPC.velocity.Y > -0.1 && NPC.velocity.Y < 0.1) + NPC.velocity.Y = 0f; + } + else + { + // Accelerative charge + // TODO - Make the charge leave behind energy bomb projectiles when the projectiles are done + NPC.velocity *= 1.015f; + NPC.rotation = (float)Math.Atan2(NPC.velocity.Y, NPC.velocity.X) - MathHelper.PiOver2; } - // Charge - else if (NPC.ai[1] == 2f) + // Charge 2 times + if (NPC.ai[2] >= chargeTime * 1.3f) { - // Set damage - NPC.damage = setDamage; + NPC.ai[3] += 1f; + NPC.ai[2] = 0f; - // Set rotation and velocity NPC.rotation = foveanatorHoverRotation; - float foveanatorPhase3ChargeSpeed = 22f + (death ? 8f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); - foveanatorPhase3ChargeSpeed += 10f * enrageScale; - if (!spazAlive || !retAlive) - foveanatorPhase3ChargeSpeed += 2f; - - if (Main.getGoodWorld) - foveanatorPhase3ChargeSpeed += 2f; - - Vector2 foveanatorPhase3ChargePos = NPC.Center; - float foveanatorPhase3ChargeTargetX = Main.player[NPC.target].Center.X - foveanatorPhase3ChargePos.X; - float foveanatorPhase3ChargeTargetY = Main.player[NPC.target].Center.Y - foveanatorPhase3ChargePos.Y; - float foveanatorPhase3ChargeTargetDist = (float)Math.Sqrt(foveanatorPhase3ChargeTargetX * foveanatorPhase3ChargeTargetX + foveanatorPhase3ChargeTargetY * foveanatorPhase3ChargeTargetY); - foveanatorPhase3ChargeTargetDist = foveanatorPhase3ChargeSpeed / foveanatorPhase3ChargeTargetDist; - NPC.velocity.X = foveanatorPhase3ChargeTargetX * foveanatorPhase3ChargeTargetDist; - NPC.velocity.Y = foveanatorPhase3ChargeTargetY * foveanatorPhase3ChargeTargetDist; - NPC.ai[1] = 3f; - } - - else if (NPC.ai[1] == 3f) - { - // Set damage - NPC.damage = setDamage; - - NPC.ai[2] += 1f; - - float chargeTime = (spazAlive && retAlive) ? 45f : 30f; - if (NPC.ai[3] % 3f == 0f) - chargeTime = (spazAlive && retAlive) ? 90f : 60f; - if (death) - chargeTime -= chargeTime * 0.25f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio); - chargeTime -= chargeTime / 5 * enrageScale; - - // Slow down - if (NPC.ai[2] >= chargeTime) + float maxCharges = 2f; + if (NPC.ai[3] >= maxCharges) { - // Avoid cheap bullshit - NPC.damage = 0; - - NPC.velocity *= 0.93f; - if (NPC.velocity.X > -0.1 && NPC.velocity.X < 0.1) - NPC.velocity.X = 0f; - if (NPC.velocity.Y > -0.1 && NPC.velocity.Y < 0.1) - NPC.velocity.Y = 0f; + NPC.ai[1] = 0f; + NPC.ai[3] = 0f; } else - { - NPC.rotation = (float)Math.Atan2(NPC.velocity.Y, NPC.velocity.X) - MathHelper.PiOver2; - - if (NPC.ai[3] % 3f == 0f) - { - float fireRate = (spazAlive && retAlive) ? 13f : 9f; - - if (NPC.ai[2] % fireRate == 0f) - { - Vector2 foveanatorPhase3ChargeLaserPos = NPC.Center; - float foveanatorPhase3ChargeLaserTargetX = Main.player[NPC.target].Center.X - foveanatorPhase3ChargeLaserPos.X; - float foveanatorPhase3ChargeLaserTargetY = Main.player[NPC.target].Center.Y - foveanatorPhase3ChargeLaserPos.Y; - float foveanatorPhase3ChargeLaserTargetDist = (float)Math.Sqrt(foveanatorPhase3ChargeLaserTargetX * foveanatorPhase3ChargeLaserTargetX + foveanatorPhase3ChargeLaserTargetY * foveanatorPhase3ChargeLaserTargetY); - - SoundEngine.PlaySound(SoundID.Item33, NPC.Center); - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } - - float laserDartVelocity = (death ? 9f : 6f) * ((spazAlive && retAlive) ? 1f : 1.5f); - foveanatorPhase3ChargeLaserPos = NPC.Center; - foveanatorPhase3ChargeLaserTargetX = Main.player[NPC.target].Center.X - foveanatorPhase3ChargeLaserPos.X; - foveanatorPhase3ChargeLaserTargetY = Main.player[NPC.target].Center.Y - foveanatorPhase3ChargeLaserPos.Y; - foveanatorPhase3ChargeLaserTargetDist = (float)Math.Sqrt(foveanatorPhase3ChargeLaserTargetX * foveanatorPhase3ChargeLaserTargetX + foveanatorPhase3ChargeLaserTargetY * foveanatorPhase3ChargeLaserTargetY); - foveanatorPhase3ChargeLaserTargetDist = laserDartVelocity / foveanatorPhase3ChargeLaserTargetDist; - foveanatorPhase3ChargeLaserTargetX *= foveanatorPhase3ChargeLaserTargetDist; - foveanatorPhase3ChargeLaserTargetY *= foveanatorPhase3ChargeLaserTargetDist; - - Vector2 laserVelocity = new Vector2(foveanatorPhase3ChargeLaserTargetX, foveanatorPhase3ChargeLaserTargetY); - Projectile.NewProjectile(NPC.GetSource_FromAI(), foveanatorPhase3ChargeLaserPos + NPC.velocity.SafeNormalize(Vector2.UnitY) * 50f, laserVelocity, type, damage, 0f, Main.myPlayer); - } - } - } - } - - // Charge four times - float chargeGateValue = 30f; - chargeGateValue -= chargeGateValue / 4 * enrageScale; - if (NPC.ai[2] >= chargeTime + chargeGateValue) - { - NPC.ai[2] = 0f; - - float chargeIncrement = 1f; - if (Main.rand.NextBool() && NPC.ai[3] < ((spazAlive && retAlive) ? 1f : 3f)) - { - chargeIncrement = 2f; - - // Net update due to the randomness in Master Mode - NPC.netUpdate = true; - } - - NPC.ai[3] += chargeIncrement; - - NPC.rotation = foveanatorHoverRotation; - float maxChargeAmt = (spazAlive && retAlive) ? 2f : 4f; - if (NPC.ai[3] >= maxChargeAmt) - { - NPC.ai[1] = 0f; - NPC.ai[3] = 0f; - - CalamityTargetingParameters options = CalamityTargetingParameters.BossDefaults; - options.aggroRatio = -1f; - CalamityUtils.CalamityTargeting(NPC, options); - } - else - NPC.ai[1] = 4f; - } + NPC.ai[1] = 1f; } + } - // Get in position for charge - else if (NPC.ai[1] == 4f) - { - // Avoid cheap bullshit - NPC.damage = 0; + // Laser and energy bomb barrage + else if (NPC.ai[1] == 3f) + { - int chargeLineUpDist = (spazAlive && retAlive) ? 600 : 500; - float chargeSpeed = 18f + (death ? 6f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); - float chargeAccel = 0.45f + (death ? 0.15f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); - chargeSpeed += 6f * enrageScale; - chargeAccel += 0.15f * enrageScale; - - if (spazAlive && retAlive) - { - chargeSpeed *= 0.75f; - chargeAccel *= 0.75f; - } - - if (Main.getGoodWorld) - { - chargeSpeed *= 1.15f; - chargeAccel *= 1.15f; - } - - int foveanatorPhase2FaceDirection = 1; - if (NPC.Center.X < Main.player[NPC.target].position.X + Main.player[NPC.target].width) - foveanatorPhase2FaceDirection = -1; - - Vector2 spazmatismRetDeadChargePos = NPC.Center; - float chargeTargetX = Main.player[NPC.target].Center.X + (chargeLineUpDist * foveanatorPhase2FaceDirection) - spazmatismRetDeadChargePos.X; - float chargeTargetY = Main.player[NPC.target].Center.Y - spazmatismRetDeadChargePos.Y; - float chargeTargetDist = (float)Math.Sqrt(chargeTargetX * chargeTargetX + chargeTargetY * chargeTargetY); - - chargeTargetDist = chargeSpeed / chargeTargetDist; - chargeTargetX *= chargeTargetDist; - chargeTargetY *= chargeTargetDist; - - if (NPC.velocity.X < chargeTargetX) - { - NPC.velocity.X += chargeAccel; - if (NPC.velocity.X < 0f && chargeTargetX > 0f) - NPC.velocity.X += chargeAccel; - } - else if (NPC.velocity.X > chargeTargetX) - { - NPC.velocity.X -= chargeAccel; - if (NPC.velocity.X > 0f && chargeTargetX < 0f) - NPC.velocity.X -= chargeAccel; - } - if (NPC.velocity.Y < chargeTargetY) - { - NPC.velocity.Y += chargeAccel; - if (NPC.velocity.Y < 0f && chargeTargetY > 0f) - NPC.velocity.Y += chargeAccel; - } - else if (NPC.velocity.Y > chargeTargetY) - { - NPC.velocity.Y -= chargeAccel; - if (NPC.velocity.Y > 0f && chargeTargetY < 0f) - NPC.velocity.Y -= chargeAccel; - } - - // Take 1.25 or 1 second to get in position, then charge - NPC.ai[2] += 1f; - if (NPC.ai[2] >= ((spazAlive && retAlive) ? 75f : 60f) - (death ? 20f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f)) - { - NPC.ai[1] = 2f; - NPC.ai[2] = 0f; - NPC.netUpdate = true; - } - } } } } @@ -1119,10 +858,10 @@ namespace CalamityMod.NPCs.NormalNPCs { for (int i = 0; i < 2; i++) { - Gore.NewGore(NPC.GetSource_Death(), NPC.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 2); - Gore.NewGore(NPC.GetSource_Death(), NPC.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 7); - Gore.NewGore(NPC.GetSource_Death(), NPC.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 9); - Gore.NewGore(NPC.GetSource_Death(), NPC.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), Mod.Find("Foveanator2").Type); + Gore.NewGore(NPC.GetSource_Death(), NPC.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 2, NPC.scale); + Gore.NewGore(NPC.GetSource_Death(), NPC.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 7, NPC.scale); + Gore.NewGore(NPC.GetSource_Death(), NPC.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 9, NPC.scale); + Gore.NewGore(NPC.GetSource_Death(), NPC.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), Mod.Find("Foveanator2").Type, NPC.scale); } } diff --git a/NPCs/NormalNPCs/Frogfish.cs b/NPCs/NormalNPCs/Frogfish.cs index 2cabc312e1..76f580d016 100644 --- a/NPCs/NormalNPCs/Frogfish.cs +++ b/NPCs/NormalNPCs/Frogfish.cs @@ -23,7 +23,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 60; NPC.height = 50; NPC.defense = 10; - NPC.lifeMax = 80; + NPC.lifeMax = 100; NPC.aiStyle = -1; AIType = -1; NPC.value = Item.buyPrice(0, 0, 0, 80); diff --git a/NPCs/NormalNPCs/IceClasper.cs b/NPCs/NormalNPCs/IceClasper.cs index fca3afe2b1..675ddbfb27 100644 --- a/NPCs/NormalNPCs/IceClasper.cs +++ b/NPCs/NormalNPCs/IceClasper.cs @@ -81,7 +81,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 50; NPC.height = 50; NPC.defense = 12; - NPC.lifeMax = 500; + NPC.lifeMax = 625; NPC.knockBackResist = 0.25f; NPC.noTileCollide = true; NPC.aiStyle = -1; diff --git a/NPCs/NormalNPCs/ImpiousImmolator.cs b/NPCs/NormalNPCs/ImpiousImmolator.cs index f7bbddab06..ea826a9fb8 100644 --- a/NPCs/NormalNPCs/ImpiousImmolator.cs +++ b/NPCs/NormalNPCs/ImpiousImmolator.cs @@ -33,7 +33,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 60; NPC.height = 60; NPC.defense = 30; - NPC.lifeMax = 3000; + NPC.lifeMax = 3750; NPC.aiStyle = -1; AIType = -1; NPC.value = Item.buyPrice(0, 0, 50, 0); diff --git a/NPCs/NormalNPCs/MantisShrimp.cs b/NPCs/NormalNPCs/MantisShrimp.cs index 15eb09e912..c98429e6bd 100644 --- a/NPCs/NormalNPCs/MantisShrimp.cs +++ b/NPCs/NormalNPCs/MantisShrimp.cs @@ -29,7 +29,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.height = 24; NPC.defense = 10; NPC.DR_NERD(0.1f); - NPC.lifeMax = 30; + NPC.lifeMax = 40; NPC.aiStyle = NPCAIStyleID.Fighter; AIType = NPCID.Crab; NPC.value = Item.buyPrice(0, 0, 1, 0); diff --git a/NPCs/NormalNPCs/OverloadedSoldier.cs b/NPCs/NormalNPCs/OverloadedSoldier.cs index 0c9fe9bb28..bb1ec40ec3 100644 --- a/NPCs/NormalNPCs/OverloadedSoldier.cs +++ b/NPCs/NormalNPCs/OverloadedSoldier.cs @@ -30,7 +30,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.height = 40; NPC.defense = 18; NPC.DR_NERD(0.15f); - NPC.lifeMax = NPC.downedMoonlord ? 1350 : 135; + NPC.lifeMax = NPC.downedMoonlord ? 1700 : 170; NPC.knockBackResist = 0.3f; NPC.value = Item.buyPrice(0, 0, 2, 0); NPC.HitSound = SoundID.NPCHit2; diff --git a/NPCs/NormalNPCs/PerennialSlime.cs b/NPCs/NormalNPCs/PerennialSlime.cs index a4027c898b..98b8ef98a3 100644 --- a/NPCs/NormalNPCs/PerennialSlime.cs +++ b/NPCs/NormalNPCs/PerennialSlime.cs @@ -22,7 +22,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 40; NPC.height = 30; NPC.defense = 12; - NPC.lifeMax = 150; + NPC.lifeMax = 190; NPC.knockBackResist = 0.5f; AnimationType = NPCID.CorruptSlime; NPC.value = Item.buyPrice(0, 0, 10, 0); diff --git a/NPCs/NormalNPCs/PhantomSpirit.cs b/NPCs/NormalNPCs/PhantomSpirit.cs index 9f81e50f1d..8572ab6c32 100644 --- a/NPCs/NormalNPCs/PhantomSpirit.cs +++ b/NPCs/NormalNPCs/PhantomSpirit.cs @@ -24,7 +24,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 16; NPC.height = 16; NPC.defense = 10; - NPC.lifeMax = 1000; + NPC.lifeMax = 1250; NPC.knockBackResist = 0.2f; AnimationType = NPCID.DungeonSpirit; AIType = -1; diff --git a/NPCs/NormalNPCs/PhantomSpiritL.cs b/NPCs/NormalNPCs/PhantomSpiritL.cs index b6edcf000f..b9680816b4 100644 --- a/NPCs/NormalNPCs/PhantomSpiritL.cs +++ b/NPCs/NormalNPCs/PhantomSpiritL.cs @@ -31,7 +31,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.height = 80; NPC.scale *= 1.2f; NPC.defense = 30; - NPC.lifeMax = 3000; + NPC.lifeMax = 3750; NPC.knockBackResist = 0.1f; AIType = -1; NPC.value = Item.buyPrice(0, 0, 60, 0); diff --git a/NPCs/NormalNPCs/PhantomSpiritM.cs b/NPCs/NormalNPCs/PhantomSpiritM.cs index a018061991..d0f6151698 100644 --- a/NPCs/NormalNPCs/PhantomSpiritM.cs +++ b/NPCs/NormalNPCs/PhantomSpiritM.cs @@ -27,7 +27,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.height = 80; NPC.scale *= 1.1f; NPC.defense = 25; - NPC.lifeMax = 2000; + NPC.lifeMax = 2500; NPC.knockBackResist = 0.15f; AIType = -1; NPC.value = Item.buyPrice(0, 0, 40, 0); diff --git a/NPCs/NormalNPCs/PhantomSpiritS.cs b/NPCs/NormalNPCs/PhantomSpiritS.cs index 7d375805c5..997044d162 100644 --- a/NPCs/NormalNPCs/PhantomSpiritS.cs +++ b/NPCs/NormalNPCs/PhantomSpiritS.cs @@ -26,7 +26,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 32; NPC.height = 80; NPC.defense = 20; - NPC.lifeMax = 1500; + NPC.lifeMax = 1875; NPC.knockBackResist = 0.2f; AIType = -1; NPC.value = Item.buyPrice(0, 0, 30, 0); diff --git a/NPCs/NormalNPCs/ProfanedEnergyBody.cs b/NPCs/NormalNPCs/ProfanedEnergyBody.cs index d5f9bc16ec..57d57d41ac 100644 --- a/NPCs/NormalNPCs/ProfanedEnergyBody.cs +++ b/NPCs/NormalNPCs/ProfanedEnergyBody.cs @@ -32,7 +32,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.height = 36; NPC.defense = 50; NPC.DR_NERD(0.1f); - NPC.lifeMax = 2500; + NPC.lifeMax = 3125; NPC.knockBackResist = 0f; AIType = -1; NPC.value = Item.buyPrice(0, 0, 50, 0); diff --git a/NPCs/NormalNPCs/Rimehound.cs b/NPCs/NormalNPCs/Rimehound.cs index 62242cd86d..443827534c 100644 --- a/NPCs/NormalNPCs/Rimehound.cs +++ b/NPCs/NormalNPCs/Rimehound.cs @@ -38,12 +38,12 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 56; NPC.height = 56; NPC.defense = 4; - NPC.lifeMax = 50; + NPC.lifeMax = 65; if (DownedBossSystem.downedCryogen) { NPC.damage = 60; NPC.defense = 10; - NPC.lifeMax = 1000; + NPC.lifeMax = 1250; } NPC.knockBackResist = 0.3f; AnimationType = NPCID.Hellhound; diff --git a/NPCs/NormalNPCs/Rotdog.cs b/NPCs/NormalNPCs/Rotdog.cs index 4e800c0d76..3338f6c5b4 100644 --- a/NPCs/NormalNPCs/Rotdog.cs +++ b/NPCs/NormalNPCs/Rotdog.cs @@ -22,7 +22,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 46; NPC.height = 30; NPC.defense = 4; - NPC.lifeMax = 60; + NPC.lifeMax = 75; NPC.knockBackResist = 0.3f; AIType = NPCID.Wolf; NPC.value = Item.buyPrice(0, 0, 2, 0); diff --git a/NPCs/NormalNPCs/ScornEater.cs b/NPCs/NormalNPCs/ScornEater.cs index 477c6cd292..65bf7a0777 100644 --- a/NPCs/NormalNPCs/ScornEater.cs +++ b/NPCs/NormalNPCs/ScornEater.cs @@ -41,7 +41,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.height = 160; NPC.defense = 38; NPC.DR_NERD(0.05f); - NPC.lifeMax = 9000; + NPC.lifeMax = 11250; NPC.knockBackResist = 0.1f; AIType = -1; NPC.lavaImmune = true; diff --git a/NPCs/NormalNPCs/SeaUrchin.cs b/NPCs/NormalNPCs/SeaUrchin.cs index b031da27b0..e6185182d2 100644 --- a/NPCs/NormalNPCs/SeaUrchin.cs +++ b/NPCs/NormalNPCs/SeaUrchin.cs @@ -19,7 +19,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 40; NPC.height = 40; NPC.defense = 10; - NPC.lifeMax = 30; + NPC.lifeMax = 40; NPC.knockBackResist = 0.8f; NPC.value = Item.buyPrice(0, 0, 0, 80); NPC.HitSound = SoundID.NPCHit1; diff --git a/NPCs/NormalNPCs/ShockstormShuttle.cs b/NPCs/NormalNPCs/ShockstormShuttle.cs index 6c011593df..bd28e4214c 100644 --- a/NPCs/NormalNPCs/ShockstormShuttle.cs +++ b/NPCs/NormalNPCs/ShockstormShuttle.cs @@ -29,7 +29,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.height = 38; NPC.defense = 15; NPC.DR_NERD(0.15f); - NPC.lifeMax = 150; + NPC.lifeMax = 190; NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0.5f; diff --git a/NPCs/NormalNPCs/SkeletronPrime2.cs b/NPCs/NormalNPCs/SkeletronPrime2.cs index fa341f1775..b60a5c739e 100644 --- a/NPCs/NormalNPCs/SkeletronPrime2.cs +++ b/NPCs/NormalNPCs/SkeletronPrime2.cs @@ -19,6 +19,7 @@ using Terraria.ModLoader; namespace CalamityMod.NPCs.NormalNPCs { + [AutoloadBossHead] public class SkeletronPrime2 : ModNPC { public override string BossHeadTexture => $"Terraria/Images/NPC_Head_Boss_18"; @@ -877,50 +878,44 @@ namespace CalamityMod.NPCs.NormalNPCs { if (Main.netMode != NetmodeID.Server) { - Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, 149); - Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, 150); + Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("SkeletronPrime2_1").Type, NPC.scale); + Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("SkeletronPrime2_2").Type, NPC.scale); - int num802 = Gore.NewGore(NPC.GetSource_Death(), NPC.position, default(Vector2), Main.rand.Next(61, 64)); - Gore gore2 = Main.gore[num802]; - gore2.velocity *= 0.4f; - Main.gore[num802].velocity.X += 1f; - Main.gore[num802].velocity.Y += 1f; + int gore = Gore.NewGore(NPC.GetSource_Death(), NPC.position, default(Vector2), Main.rand.Next(61, 64)); + Main.gore[gore].velocity *= 0.4f; + Main.gore[gore].velocity.X += 1f; + Main.gore[gore].velocity.Y += 1f; - num802 = Gore.NewGore(NPC.GetSource_Death(), NPC.position, default(Vector2), Main.rand.Next(61, 64)); - gore2 = Main.gore[num802]; - gore2.velocity *= 0.4f; - Main.gore[num802].velocity.X -= 1f; - Main.gore[num802].velocity.Y += 1f; + gore = Gore.NewGore(NPC.GetSource_Death(), NPC.position, default(Vector2), Main.rand.Next(61, 64)); + Main.gore[gore].velocity *= 0.4f; + Main.gore[gore].velocity.X -= 1f; + Main.gore[gore].velocity.Y += 1f; - num802 = Gore.NewGore(NPC.GetSource_Death(), NPC.position, default(Vector2), Main.rand.Next(61, 64)); - gore2 = Main.gore[num802]; - gore2.velocity *= 0.4f; - Main.gore[num802].velocity.X += 1f; - Main.gore[num802].velocity.Y -= 1f; + gore = Gore.NewGore(NPC.GetSource_Death(), NPC.position, default(Vector2), Main.rand.Next(61, 64)); + Main.gore[gore].velocity *= 0.4f; + Main.gore[gore].velocity.X += 1f; + Main.gore[gore].velocity.Y -= 1f; - num802 = Gore.NewGore(NPC.GetSource_Death(), NPC.position, default(Vector2), Main.rand.Next(61, 64)); - gore2 = Main.gore[num802]; - gore2.velocity *= 0.4f; - Main.gore[num802].velocity.X -= 1f; - Main.gore[num802].velocity.Y -= 1f; + gore = Gore.NewGore(NPC.GetSource_Death(), NPC.position, default(Vector2), Main.rand.Next(61, 64)); + Main.gore[gore].velocity *= 0.4f; + Main.gore[gore].velocity.X -= 1f; + Main.gore[gore].velocity.Y -= 1f; } - for (int num798 = 0; num798 < 10; num798++) + for (int i = 0; i < 10; i++) { - int num799 = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Smoke, 0f, 0f, 100, default(Color), 1.5f); - Dust dust = Main.dust[num799]; - dust.velocity *= 1.4f; + int dust = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Smoke, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[dust].velocity *= 1.4f; } - for (int num800 = 0; num800 < 5; num800++) + for (int i = 0; i < 5; i++) { - int num801 = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Torch, 0f, 0f, 100, default(Color), 2.5f); - Main.dust[num801].noGravity = true; - Dust dust = Main.dust[num801]; - dust.velocity *= 5f; - num801 = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Torch, 0f, 0f, 100, default(Color), 1.5f); - dust = Main.dust[num801]; - dust.velocity *= 3f; + int dust = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Torch, 0f, 0f, 100, default(Color), 2.5f); + Main.dust[dust].noGravity = true; + Main.dust[dust].velocity *= 5f; + + dust = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Torch, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[dust].velocity *= 3f; } } } diff --git a/NPCs/NormalNPCs/SkeletronPrime2_Head_Boss.png b/NPCs/NormalNPCs/SkeletronPrime2_Head_Boss.png new file mode 100644 index 0000000000..38362cb253 Binary files /dev/null and b/NPCs/NormalNPCs/SkeletronPrime2_Head_Boss.png differ diff --git a/NPCs/NormalNPCs/Stormlion.cs b/NPCs/NormalNPCs/Stormlion.cs index e3ce948f29..d66dede29c 100644 --- a/NPCs/NormalNPCs/Stormlion.cs +++ b/NPCs/NormalNPCs/Stormlion.cs @@ -27,7 +27,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 33; NPC.height = 31; NPC.defense = 8; - NPC.lifeMax = 80; + NPC.lifeMax = 100; NPC.knockBackResist = 0.2f; AnimationType = NPCID.WalkingAntlion; NPC.value = Item.buyPrice(0, 0, 2, 0); diff --git a/NPCs/NormalNPCs/Sunskater.cs b/NPCs/NormalNPCs/Sunskater.cs index 055a41c4e5..f200b43453 100644 --- a/NPCs/NormalNPCs/Sunskater.cs +++ b/NPCs/NormalNPCs/Sunskater.cs @@ -34,7 +34,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 58; NPC.height = 22; NPC.defense = 4; - NPC.lifeMax = 100; + NPC.lifeMax = 125; NPC.aiStyle = -1; AIType = -1; NPC.value = Item.buyPrice(0, 0, 5, 0); diff --git a/NPCs/NormalNPCs/WulfrumAmplifier.cs b/NPCs/NormalNPCs/WulfrumAmplifier.cs index 24b60695c5..fba16b1bb2 100644 --- a/NPCs/NormalNPCs/WulfrumAmplifier.cs +++ b/NPCs/NormalNPCs/WulfrumAmplifier.cs @@ -49,7 +49,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 44; NPC.height = 44; NPC.defense = 4; - NPC.lifeMax = Main.zenithWorld ? 72 : 46; + NPC.lifeMax = Main.zenithWorld ? 90 : 58; NPC.knockBackResist = 0f; NPC.value = Item.buyPrice(0, 0, 1, 50); NPC.noGravity = false; diff --git a/NPCs/NormalNPCs/WulfrumDrone.cs b/NPCs/NormalNPCs/WulfrumDrone.cs index e3d97d8ecd..faa24fb261 100644 --- a/NPCs/NormalNPCs/WulfrumDrone.cs +++ b/NPCs/NormalNPCs/WulfrumDrone.cs @@ -70,7 +70,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 32; NPC.height = 32; NPC.defense = 4; - NPC.lifeMax = 21; + NPC.lifeMax = 27; NPC.knockBackResist = 0.35f; NPC.value = Item.buyPrice(0, 0, 1, 20); NPC.noGravity = true; diff --git a/NPCs/NormalNPCs/WulfrumGyrator.cs b/NPCs/NormalNPCs/WulfrumGyrator.cs index 6c40b1dd86..668d1438db 100644 --- a/NPCs/NormalNPCs/WulfrumGyrator.cs +++ b/NPCs/NormalNPCs/WulfrumGyrator.cs @@ -55,7 +55,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 40; NPC.height = 40; NPC.defense = 5; - NPC.lifeMax = 18; + NPC.lifeMax = 23; NPC.knockBackResist = 0.15f; NPC.value = Item.buyPrice(0, 0, 1, 15); NPC.HitSound = SoundID.NPCHit4; diff --git a/NPCs/NormalNPCs/WulfrumHovercraft.cs b/NPCs/NormalNPCs/WulfrumHovercraft.cs index a63b1c1fc8..16a03a6fee 100644 --- a/NPCs/NormalNPCs/WulfrumHovercraft.cs +++ b/NPCs/NormalNPCs/WulfrumHovercraft.cs @@ -78,7 +78,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 40; NPC.height = 38; NPC.defense = 4; - NPC.lifeMax = 20; + NPC.lifeMax = 25; NPC.value = Item.buyPrice(0, 0, 1, 50); NPC.HitSound = SoundID.NPCHit4; NPC.DeathSound = CommonCalamitySounds.WulfrumNPCDeathSound; diff --git a/NPCs/NormalNPCs/WulfrumRover.cs b/NPCs/NormalNPCs/WulfrumRover.cs index 52be53013a..4352bad89f 100644 --- a/NPCs/NormalNPCs/WulfrumRover.cs +++ b/NPCs/NormalNPCs/WulfrumRover.cs @@ -57,7 +57,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 40; NPC.height = 40; NPC.defense = 4; - NPC.lifeMax = 32; + NPC.lifeMax = 40; NPC.knockBackResist = Main.zenithWorld ? 0f : 0.15f; NPC.value = Item.buyPrice(0, 0, 1, 15); NPC.HitSound = SoundID.NPCHit4; diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index 567ad13fc1..385a05ebb1 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -34,7 +34,6 @@ using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics.PackedVector; -using rail; using ReLogic.Content; using ReLogic.Utilities; using Terraria; @@ -831,7 +830,9 @@ namespace CalamityMod.NPCs.Providence { // Slowly drift down when spawning if (spawnAnimation) + { NPC.velocity = Vector2.Zero; + } else { // Slows down while firing Holy Rays. It would've not slowed down for the Zenith seed but apparently it was too fast (shockers). @@ -1176,8 +1177,10 @@ namespace CalamityMod.NPCs.Providence Vector2 projectileFirePosition = new Vector2(NPC.Center.X + NPC.velocity.SafeNormalize(Vector2.UnitX).X * 120f, NPC.Center.Y); float velocityBoost = death ? 4f * (1f - lifeRatio) : 2.5f * (1f - lifeRatio); float projSpeed = (revenge ? 12f : expertMode ? 10.5f : 9f) + velocityBoost; - Vector2 projectileVelocity = (player.Center + (predictiveShots ? player.velocity * 50f : Vector2.Zero) - projectileFirePosition).SafeNormalize(Vector2.UnitY) * projSpeed * 0.1f; - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileFirePosition, projectileVelocity, ModContent.ProjectileType(), holyBlastDamage, 0f, Main.myPlayer, player.position.X, player.position.Y); + Vector2 predictionAmount = player.velocity * 100f; + Vector2 projectileVelocity = (player.Center + (predictiveShots ? predictionAmount : Vector2.Zero) - projectileFirePosition).SafeNormalize(Vector2.UnitY) * projSpeed * 0.1f; + Vector2 explodePosition = predictiveShots ? (player.position + predictionAmount) : player.position; + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileFirePosition, projectileVelocity, ModContent.ProjectileType(), holyBlastDamage, 0f, Main.myPlayer, explodePosition.X, explodePosition.Y); } } else if (NPC.ai[3] < 0f) @@ -1463,8 +1466,10 @@ namespace CalamityMod.NPCs.Providence Vector2 projectileFirePosition = new Vector2(NPC.Center.X + NPC.velocity.SafeNormalize(Vector2.UnitX).X * 120f, NPC.Center.Y); float velocityBoost = death ? 4f * (1f - lifeRatio) : 2.5f * (1f - lifeRatio); float projSpeed = (revenge ? 12f : expertMode ? 10.5f : 9f) + velocityBoost; - Vector2 projectileVelocity = (player.Center + (predictiveShots ? player.velocity * 50f : Vector2.Zero) - projectileFirePosition).SafeNormalize(Vector2.UnitY) * projSpeed * 0.1f; - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileFirePosition, projectileVelocity, ModContent.ProjectileType(), moltenBlastDamage, 0f, Main.myPlayer, player.position.X, player.position.Y); + Vector2 predictionAmount = player.velocity * 100f; + Vector2 projectileVelocity = (player.Center + (predictiveShots ? predictionAmount : Vector2.Zero) - projectileFirePosition).SafeNormalize(Vector2.UnitY) * projSpeed * 0.1f; + Vector2 explodePosition = predictiveShots ? (player.position + predictionAmount) : player.position; + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileFirePosition, projectileVelocity, ModContent.ProjectileType(), moltenBlastDamage, 0f, Main.myPlayer, explodePosition.X, explodePosition.Y); } } else if (NPC.ai[3] < 0f) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs index 9321fc2333..f1b49d5934 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs @@ -115,6 +115,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } + // Foveanator spawn + if (!oblivionAlive && masterMode && calamityGlobalNPC.newAI[0] == 0f && Main.netMode != NetmodeID.MultiplayerClient) + { + NPC.SpawnOnPlayer(npc.FindClosestPlayer(), ModContent.NPCType()); + calamityGlobalNPC.newAI[0] = 1f; + npc.SyncExtraAI(); + } + // Phase HP ratios float phase2LifeRatio = oblivionAlive ? 0.5f : masterMode ? 0.85f : 0.7f; float finalPhaseLifeRatio = masterMode ? 0.4f : 0.25f; diff --git a/Particles/SemiCircularSmearFade.cs b/Particles/SemiCircularSmearFade.cs index f7e3f0a425..fcff0bd3eb 100644 --- a/Particles/SemiCircularSmearFade.cs +++ b/Particles/SemiCircularSmearFade.cs @@ -19,7 +19,8 @@ namespace CalamityMod.Particles public bool RotateToVelocity; public Vector2 Squish; public bool ProduceLight; - public SemiCircularSmearFade(Vector2 position, Vector2 velocity, Color color, float rotation, float scale, Vector2 squish, int lifetime, bool playerCentered = false, bool rotateToVelocity = false, bool produceLight = true) + public int Direction = 1; + public SemiCircularSmearFade(Vector2 position, Vector2 velocity, Color color, float rotation, float scale, Vector2 squish, int lifetime, bool playerCentered = false, bool rotateToVelocity = false, bool produceLight = true, int direction = 1) { Position = position; Velocity = velocity; @@ -31,7 +32,7 @@ namespace CalamityMod.Particles PlayerCentered = playerCentered; RotateToVelocity = rotateToVelocity; ProduceLight = produceLight; - + Direction = direction; } public override void Update() { @@ -53,7 +54,7 @@ namespace CalamityMod.Particles public override void CustomDraw(SpriteBatch spriteBatch) { Texture2D tex = ModContent.Request(Texture).Value; - spriteBatch.Draw(tex, Position - Main.screenPosition, null, Color, Rotation, tex.Size() * 0.5f, Scale * Squish, 0, 0f); + spriteBatch.Draw(tex, Position - Main.screenPosition, null, Color, Rotation, tex.Size() * 0.5f, Scale * Squish, Direction == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally, 0f); } } } diff --git a/Particles/SemiCircularSmearSwipe.png b/Particles/SemiCircularSmearSwipe.png new file mode 100644 index 0000000000..cf9a7c4edc Binary files /dev/null and b/Particles/SemiCircularSmearSwipe.png differ diff --git a/Projectiles/Boss/HolyBlast.cs b/Projectiles/Boss/HolyBlast.cs index 3dde54ea10..235f07e767 100644 --- a/Projectiles/Boss/HolyBlast.cs +++ b/Projectiles/Boss/HolyBlast.cs @@ -110,6 +110,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.localAI[0] = 1f; SoundEngine.PlaySound(ShootSound, Projectile.Center); } + if (Math.Abs(Projectile.velocity.X) > 0.2) Projectile.spriteDirection = -Projectile.direction; @@ -122,10 +123,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.rotation = (float)Math.Atan2(Projectile.velocity.Y, Projectile.velocity.X); } - public override Color? GetAlpha(Color lightColor) - { - return ProvUtils.GetProjectileColor(lightColor); - } + public override Color? GetAlpha(Color lightColor) => ProvUtils.GetProjectileColor(lightColor); public override bool PreDraw(ref Color lightColor) { @@ -167,10 +165,11 @@ namespace CalamityMod.Projectiles.Boss int type = ModContent.ProjectileType(); float velocity = 5f; Vector2 spinningPoint = new Vector2(0f, -velocity); + Vector2 additionalVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitX) * 2.5f; for (int k = 0; k < totalProjectiles; k++) { Vector2 velocity2 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity2 + Projectile.velocity * 0.25f, type, (int)Math.Round(Projectile.damage * 0.75), 0f, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity2 + additionalVelocity, type, (int)Math.Round(Projectile.damage * 0.75), 0f, Projectile.owner); } } diff --git a/Projectiles/Boss/HolyFire.cs b/Projectiles/Boss/HolyFire.cs index c04e53c84b..612d6e1542 100644 --- a/Projectiles/Boss/HolyFire.cs +++ b/Projectiles/Boss/HolyFire.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Projectiles.Boss public class HolyFire : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Boss"; + public override void SetStaticDefaults() { Main.projFrames[Projectile.type] = 4; @@ -59,10 +60,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.frame = 0; } - public override Color? GetAlpha(Color lightColor) - { - return ProvUtils.GetProjectileColor(lightColor); - } + public override Color? GetAlpha(Color lightColor) => ProvUtils.GetProjectileColor(lightColor); public override bool PreDraw(ref Color lightColor) { @@ -81,16 +79,13 @@ namespace CalamityMod.Projectiles.Boss Color loColor = ProvUtils.GetProjectileColor(0, true); for (int i = 0; i < 25; i++) - { GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(Projectile.Center, new Vector2(Main.rand.NextFloat(10), 0).RotatedByRandom(MathHelper.TwoPi), false, 10, Main.rand.NextFloat(0.8f, 1.2f), hiColor)); - } GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center, Vector2.Zero, Color.White, "CalamityMod/Particles/BloomCircle", Vector2.One, 0f, 0.5f, 0.1f, 4)); for (float i = 0; i < 1; i += 0.25f) - { GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center, Vector2.Zero, hiColor, "CalamityMod/Particles/SoftRoundExplosion", Vector2.One, Main.rand.NextFloat(MathHelper.TwoPi), 0.02f * i, 0.125f * i, 8)); - } + GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center, Vector2.Zero, hiColor, "CalamityMod/Particles/ShatteredExplosion", Vector2.One, Main.rand.NextFloat(MathHelper.TwoPi), 0.02f, 0.045f, 5)); if (Main.rand.NextBool()) @@ -101,12 +96,12 @@ namespace CalamityMod.Projectiles.Boss if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) velocity *= Main.rand.NextFloat(1f, 2f); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 1f); if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) velocity *= Main.rand.NextFloat(1f, 2f); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, -velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, -velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 1f); } } else @@ -117,14 +112,15 @@ namespace CalamityMod.Projectiles.Boss if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) velocity *= Main.rand.NextFloat(1f, 2f); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 1f); if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) velocity *= Main.rand.NextFloat(1f, 2f); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, -velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, -velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 1f); } } + SoundEngine.PlaySound(SoundID.Item20, Projectile.Center); SoundEngine.PlaySound(SoundID.Item100.WithPitchOffset(0.4f), Projectile.Center); } diff --git a/Projectiles/Boss/HolyFire2.cs b/Projectiles/Boss/HolyFire2.cs index f85df4fe56..360f7796a4 100644 --- a/Projectiles/Boss/HolyFire2.cs +++ b/Projectiles/Boss/HolyFire2.cs @@ -1,5 +1,6 @@ using System; using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Events; using CalamityMod.NPCs; using CalamityMod.NPCs.Providence; using CalamityMod.Particles; @@ -16,6 +17,7 @@ namespace CalamityMod.Projectiles.Boss public class HolyFire2 : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Boss"; + public override void SetStaticDefaults() { Main.projFrames[Projectile.type] = 4; @@ -48,7 +50,8 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.frame > 3) Projectile.frame = 0; - if (Math.Abs(Projectile.velocity.X) < 7f) + float maxVelocity = Projectile.ai[0] == 0f ? 7f : (Main.masterMode || BossRushEvent.BossRushActive) ? 13f : CalamityWorld.death ? 11f : CalamityWorld.revenge ? 10f : Main.expertMode ? 9f : 7f; + if (Math.Abs(Projectile.velocity.X) < maxVelocity) Projectile.velocity.X *= 1.05f; int playerTracker = Player.FindClosest(Projectile.Center, 1, 1); @@ -74,17 +77,12 @@ namespace CalamityMod.Projectiles.Boss GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(Projectile.Center + new Vector2(Main.rand.NextFloat(15), 0).RotatedByRandom(MathHelper.TwoPi), Projectile.velocity.RotatedBy(Math.PI) * 0.2f, false, 10, Main.rand.NextFloat(0.8f, 1.2f), ProvUtils.GetProjectileColor(255))); if (Main.rand.NextBool()) - { GeneralParticleHandler.SpawnParticle(new MediumMistParticle(Projectile.Center, Vector2.Zero, Color.LightSlateGray, Color.DarkSlateGray, Main.rand.NextFloat(vel), 150, MathHelper.ToRadians(Main.rand.NextFloat(-1f, 1f)))); - } Projectile.rotation = MathHelper.Lerp(0f, MathHelper.WrapAngle(Vector2.Zero.AngleTo(Projectile.velocity) + MathHelper.ToRadians(-90f)), Math.Clamp(vel, 0f, 1f)); } - public override Color? GetAlpha(Color lightColor) - { - return ProvUtils.GetProjectileColor(lightColor); - } + public override Color? GetAlpha(Color lightColor) => ProvUtils.GetProjectileColor(lightColor); public override bool PreDraw(ref Color lightColor) { diff --git a/Projectiles/Boss/MoltenBlast.cs b/Projectiles/Boss/MoltenBlast.cs index ef0569297f..350853f561 100644 --- a/Projectiles/Boss/MoltenBlast.cs +++ b/Projectiles/Boss/MoltenBlast.cs @@ -86,6 +86,7 @@ namespace CalamityMod.Projectiles.Boss Main.dust[holyDust].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } + Projectile.localAI[1] = 1f; SoundEngine.PlaySound(SoundID.Item73, Projectile.Center); } @@ -115,15 +116,10 @@ namespace CalamityMod.Projectiles.Boss GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(Projectile.Center + new Vector2(Main.rand.NextFloat(15), 0).RotatedByRandom(MathHelper.TwoPi), Projectile.velocity.RotatedBy(Math.PI) * 0.5f, false, 10, Main.rand.NextFloat(0.8f, 1.2f), ProvUtils.GetProjectileColor(255))); if (Main.rand.NextBool()) - { GeneralParticleHandler.SpawnParticle(new MediumMistParticle(Projectile.Center, Vector2.Zero, Color.LightSlateGray, Color.DarkSlateGray, Main.rand.NextFloat(vel), 150, MathHelper.ToRadians(Main.rand.NextFloat(-1f, 1f)))); - } } - public override Color? GetAlpha(Color lightColor) - { - return ProvUtils.GetProjectileColor(0); - } + public override Color? GetAlpha(Color lightColor) => ProvUtils.GetProjectileColor(0); public override bool PreDraw(ref Color lightColor) { @@ -141,16 +137,13 @@ namespace CalamityMod.Projectiles.Boss Color loColor = ProvUtils.GetProjectileColor(0, true); for (int i = 0; i < 25; i++) - { GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(Projectile.Center, new Vector2(Main.rand.NextFloat(10), 0).RotatedByRandom(MathHelper.TwoPi), false, 10, Main.rand.NextFloat(0.8f, 1.2f), hiColor)); - } GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center, Vector2.Zero, Color.White, "CalamityMod/Particles/BloomCircle", Vector2.One, 0f, 0.5f, 0.1f, 4)); for (float i = 0; i < 1; i += 0.25f) - { GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center, Vector2.Zero, hiColor, "CalamityMod/Particles/SoftRoundExplosion", Vector2.One, Main.rand.NextFloat(MathHelper.TwoPi), 0.02f * i, 0.125f * i, 8)); - } + GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center, Vector2.Zero, hiColor, "CalamityMod/Particles/ShatteredExplosion", Vector2.One, Main.rand.NextFloat(MathHelper.TwoPi), 0.02f, 0.045f, 5)); int blobAmt = !ProvUtils.DayAI() ? 9 : 6; @@ -166,6 +159,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), (int)Math.Round(Projectile.damage * 0.75), 0f, Projectile.owner); } } + SoundEngine.PlaySound(SoundID.Item74, Projectile.Center); } diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 549113959b..a4dbe1a3f6 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -22,6 +22,11 @@ using CalamityMod.Projectiles.Rogue; using CalamityMod.Projectiles.Summon; using CalamityMod.Projectiles.Typeless; using CalamityMod.Projectiles.VanillaProjectileOverrides; +using CalamityMod.Tiles.Abyss; +using CalamityMod.Tiles.Astral; +using CalamityMod.Tiles.AstralDesert; +using CalamityMod.Tiles.AstralSnow; +using CalamityMod.Tiles.Crags.Tree; using CalamityMod.Tiles.FurnitureAuric; using CalamityMod.Tiles.Ores; using CalamityMod.World; @@ -4067,7 +4072,8 @@ namespace CalamityMod.Projectiles || projectile.type == ProjectileID.PureSpray || projectile.type == ProjectileID.CorruptSpray || projectile.type == ProjectileID.CrimsonSpray - || projectile.type == ProjectileID.HallowSpray; + || projectile.type == ProjectileID.HallowSpray + || projectile.type == ProjectileID.Fertilizer; if (!isConversionProjectile) return; @@ -4078,10 +4084,39 @@ namespace CalamityMod.Projectiles bool isPowder = projectile.type == ProjectileID.PurificationPowder || projectile.type == ProjectileID.VilePowder || projectile.type == ProjectileID.ViciousPowder; + if (!WorldGen.InWorld(x, y, 3)) + return; + for (int i = x - 1; i <= x + 1; i++) { for (int j = y - 1; j <= y + 1; j++) { + if (projectile.type == ProjectileID.Fertilizer) + { + Tile tile = Main.tile[i, j]; + + if (tile.TileType == ModContent.TileType() || tile.TileType == ModContent.TileType()) + { + bool isPlayerNear = WorldGen.PlayerLOS(i, j); + bool success = WorldGen.GrowTree(i, j); + if (success && isPlayerNear) + WorldGen.TreeGrowFXCheck(i, j); + } + else if (tile.TileType == ModContent.TileType() || tile.TileType == ModContent.TileType()) + { + bool isPlayerNear = WorldGen.PlayerLOS(i, j); + bool success = WorldGen.GrowPalmTree(i, j); + if (success && isPlayerNear) + WorldGen.TreeGrowFXCheck(i, j); + } + else if (tile.TileType == ModContent.TileType()) + { + bool isPlayerNear = WorldGen.PlayerLOS(i, j); + if (isPlayerNear && Main.tile[i, j + 1].TileType != ModContent.TileType()) + SpineTree.Spawn(i, j, 22, 28, true); + } + } + if (projectile.type == ProjectileID.PureSpray || projectile.type == ProjectileID.PurificationPowder) { AstralBiome.ConvertFromAstral(i, j, ConvertType.Pure, !isPowder); diff --git a/Projectiles/DraedonsArsenal/PoleWarperSummon.cs b/Projectiles/DraedonsArsenal/PoleWarperSummon.cs index 61308df0d2..2ef6443d46 100644 --- a/Projectiles/DraedonsArsenal/PoleWarperSummon.cs +++ b/Projectiles/DraedonsArsenal/PoleWarperSummon.cs @@ -1,7 +1,9 @@ using System; using CalamityMod.Buffs.Summon; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.DraedonsArsenal @@ -173,7 +175,23 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, 1, lightColor, 2); + Texture2D tex = TextureAssets.Projectile[Type].Value; + Color drawColor = Projectile.GetAlpha(lightColor); + + if (CalamityConfig.Instance.Afterimages) + { + for (int i = 0; i < Projectile.oldPos.Length; i++) + { + if (i % 2 == 0) + continue; + + Color trailColor = Color.Lerp(drawColor, Color.Transparent, i / (float)Projectile.oldPos.Length) * 0.67f; + Vector2 trailPos = Projectile.oldPos[i] + Projectile.Size * 0.5f - Main.screenPosition; + Main.EntitySpriteDraw(tex, trailPos, null, trailColor, Projectile.rotation, tex.Size() * 0.5f, Projectile.scale, SpriteEffects.None); + } + } + + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, drawColor, Projectile.rotation, tex.Size() * 0.5f, Projectile.scale, SpriteEffects.None); return false; } } diff --git a/Projectiles/Magic/BrimstoneFireball.cs b/Projectiles/Magic/BrimstoneFireball.cs deleted file mode 100644 index 1afd7066fb..0000000000 --- a/Projectiles/Magic/BrimstoneFireball.cs +++ /dev/null @@ -1,136 +0,0 @@ -using System; -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Dusts; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.Audio; -using Terraria.ID; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Magic -{ - public class BrimstoneFireball : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Magic"; - public override void SetStaticDefaults() - { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - } - - public override void SetDefaults() - { - Projectile.width = 20; - Projectile.height = 20; - Projectile.friendly = true; - Projectile.DamageType = DamageClass.Magic; - Projectile.penetrate = 3; - Projectile.timeLeft = 300; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 20; - } - - public override void AI() - { - Lighting.AddLight(Projectile.Center, 0.25f, 0f, 0f); - if (Projectile.wet) - { - Projectile.Kill(); - SpawnFireballs(true); - } - Projectile.localAI[0] += 1f; - if (Projectile.localAI[0] > 4f) - { - int brimstone = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); - Main.dust[brimstone].noGravity = true; - Main.dust[brimstone].velocity *= 0f; - } - Projectile.ai[0] += 1f; - if (Projectile.ai[0] > 5f) - { - Projectile.ai[0] = 5f; - if (Projectile.velocity.Y == 0.0 && Projectile.velocity.X != 0.0) - { - Projectile.velocity.X *= 0.97f; - if (Projectile.velocity.X > -0.01f && Projectile.velocity.X < 0.01f) - { - Projectile.velocity.X = 0f; - Projectile.netUpdate = true; - } - } - Projectile.velocity.Y += 0.2f; - Projectile.rotation += (Math.Abs(Projectile.velocity.X) + Math.Abs(Projectile.velocity.Y)) * 0.1f * Projectile.direction; - } - if (Projectile.velocity.Y <= 16f) - return; - Projectile.velocity.Y = 16f; - } - - public override bool OnTileCollide(Vector2 oldVelocity) - { - SoundEngine.PlaySound(SoundID.Item20, Projectile.Center); - Projectile.penetrate--; - if (Projectile.penetrate <= 0) - { - Projectile.Kill(); - } - else - { - Projectile.ai[0] += 0.1f; - if (Projectile.velocity.X != oldVelocity.X) - { - Projectile.velocity.X = -oldVelocity.X; - } - if (Projectile.velocity.Y != oldVelocity.Y) - { - Projectile.velocity.Y = -oldVelocity.Y; - } - Projectile.velocity *= 0.8f; - } - return false; - } - - public override bool PreDraw(ref Color lightColor) - { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); - return false; - } - - public override void OnKill(int timeLeft) - { - SoundEngine.PlaySound(SoundID.Item20, Projectile.Center); - } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(ModContent.BuffType(), 120); - - if (target.HasBuff(BuffID.Wet) || target.Calamity().eutrophication > 0 || target.Calamity().rTide > 0 || target.Calamity().cDepth > 0) - { - SpawnFireballs(false); - } - } - - public void SpawnFireballs(bool isFromLiquidHit) - { - if (Projectile.owner == Main.myPlayer) - { - int homerAmt = 2; - if (!isFromLiquidHit && Projectile.numHits > 0) - homerAmt = 1; - - for (int j = 0; j < homerAmt; j++) - { - Vector2 velocity = new Vector2(Main.rand.NextFloat(-100f, 100f), Main.rand.NextFloat(-100f, -50f)); - while (velocity.X == 0f) - { - velocity.X = (float)Main.rand.Next(-100, 101); - } - velocity.Normalize(); - velocity *= Main.rand.NextFloat(7f, 10f); - float damageMult = isFromLiquidHit ? 1f : 0.25f; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.oldPosition.X + (float)(Projectile.width / 2), Projectile.oldPosition.Y + (float)(Projectile.height / 2), velocity.X, velocity.Y, ModContent.ProjectileType(), (int)(Projectile.damage * damageMult), 0f, Projectile.owner, 0f, 0f); - } - } - } - } -} diff --git a/Projectiles/Magic/BrimstoneFireball.png b/Projectiles/Magic/BrimstoneFireball.png deleted file mode 100644 index 62d616a8c1..0000000000 Binary files a/Projectiles/Magic/BrimstoneFireball.png and /dev/null differ diff --git a/Projectiles/Magic/BrimstoneHomer.cs b/Projectiles/Magic/BrimstoneHomer.cs deleted file mode 100644 index a18d3379fd..0000000000 --- a/Projectiles/Magic/BrimstoneHomer.cs +++ /dev/null @@ -1,41 +0,0 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Dusts; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Magic -{ - public class BrimstoneHomer : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Magic"; - public override void SetDefaults() - { - Projectile.width = 8; - Projectile.height = 8; - Projectile.friendly = true; - Projectile.DamageType = DamageClass.Magic; - Projectile.ignoreWater = true; - Projectile.penetrate = 1; - Projectile.extraUpdates = 1; - Projectile.timeLeft = 180; - } - - public override bool? CanHitNPC(NPC target) => Projectile.timeLeft < 150 && target.CanBeChasedBy(Projectile); - - public override void AI() - { - Projectile.rotation += 0.7f * Projectile.direction; - - int brimstone = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 1f); - Main.dust[brimstone].noGravity = true; - - if (Projectile.timeLeft < 160) - CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 240f, 8f, 20f); - } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(ModContent.BuffType(), 120); - } - } -} diff --git a/Projectiles/Magic/BrimstoneHomer.png b/Projectiles/Magic/BrimstoneHomer.png deleted file mode 100644 index 282b689545..0000000000 Binary files a/Projectiles/Magic/BrimstoneHomer.png and /dev/null differ diff --git a/Projectiles/Magic/BrimstoneTentacle.cs b/Projectiles/Magic/BrimstoneTentacle.cs deleted file mode 100644 index d49ed65926..0000000000 --- a/Projectiles/Magic/BrimstoneTentacle.cs +++ /dev/null @@ -1,95 +0,0 @@ -using System; -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Dusts; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Magic -{ - public class BrimstoneTentacle : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Magic"; - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - - public override void SetDefaults() - { - Projectile.width = 40; - Projectile.height = 40; - Projectile.friendly = true; - Projectile.penetrate = 5; - Projectile.MaxUpdates = 3; - Projectile.DamageType = DamageClass.Magic; - Projectile.usesIDStaticNPCImmunity = true; - Projectile.idStaticNPCHitCooldown = 5; - } - - public override void AI() - { - Projectile.localAI[1]++; - if (Projectile.velocity.X != Projectile.velocity.X) - { - if (Math.Abs(Projectile.velocity.X) < 1f) - { - Projectile.velocity.X = -Projectile.velocity.X; - } - else - { - Projectile.Kill(); - } - } - if (Projectile.velocity.Y != Projectile.velocity.Y) - { - if (Math.Abs(Projectile.velocity.Y) < 1f) - { - Projectile.velocity.Y = -Projectile.velocity.Y; - } - else - { - Projectile.Kill(); - } - } - Vector2 center10 = Projectile.Center; - Projectile.scale = 1f - Projectile.localAI[0]; - Projectile.width = (int)(20f * Projectile.scale); - Projectile.height = Projectile.width; - Projectile.position.X = center10.X - (float)(Projectile.width / 2); - Projectile.position.Y = center10.Y - (float)(Projectile.height / 2); - if (Projectile.localAI[0] < 0.1f) - { - Projectile.localAI[0] += 0.01f; - } - else - { - Projectile.localAI[0] += 0.025f; - } - if (Projectile.localAI[0] >= 0.95f) - { - Projectile.Kill(); - } - Projectile.velocity.X = Projectile.velocity.X + Projectile.ai[0] * 1.5f; - Projectile.velocity.Y = Projectile.velocity.Y + Projectile.ai[1] * 1.5f; - if (Projectile.velocity.Length() > 16f) - { - Projectile.velocity.Normalize(); - Projectile.velocity *= 16f; - } - Projectile.ai[0] *= 1.05f; - Projectile.ai[1] *= 1.05f; - if (Projectile.scale < 1f && Projectile.localAI[1] > 5f) - { - int scaleLoopCheck = 0; - while ((float)scaleLoopCheck < Projectile.scale * 10f) - { - int brimDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, (int)CalamityDusts.Brimstone, Projectile.velocity.X, Projectile.velocity.Y, 100, default, 1.5f); - Main.dust[brimDust].position = (Main.dust[brimDust].position + Projectile.Center) / 2f; - Main.dust[brimDust].noGravity = true; - Main.dust[brimDust].velocity *= 0.1f; - Main.dust[brimDust].velocity -= Projectile.velocity * (1.3f - Projectile.scale); - Main.dust[brimDust].fadeIn = (float)(100 + Projectile.owner); - Main.dust[brimDust].scale += Projectile.scale * 0.75f; - scaleLoopCheck++; - } - } - } - } -} diff --git a/Projectiles/Magic/IncineratingFireball.cs b/Projectiles/Magic/IncineratingFireball.cs new file mode 100644 index 0000000000..7848a49ad0 --- /dev/null +++ b/Projectiles/Magic/IncineratingFireball.cs @@ -0,0 +1,188 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System.Collections.Generic; +using Terraria; +using Terraria.Audio; +using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Magic +{ + public class IncineratingFireball : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Magic"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public Player Owner => Main.player[Projectile.owner]; + public bool Released = false; + public bool TriggeredBurnOut = false; + public const float StartScale = 0.0004f; + public const float EndScale = 10.25f; + + public ref float Timer => ref Projectile.ai[0]; + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailCacheLength[Projectile.type] = 5; + ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + } + + public override void SetDefaults() + { + Projectile.width = 2; + Projectile.height = 2; + Projectile.alpha = 255; + Projectile.friendly = true; + Projectile.DamageType = DamageClass.Magic; + Projectile.penetrate = -1; + Projectile.timeLeft = 60000; + Projectile.tileCollide = false; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 12; + Projectile.hide = true; + } + + public override void AI() + { + Timer++; + Lighting.AddLight(Projectile.Center, Color.Red.ToVector3() * (Projectile.scale * 0.5f)); + + // This CalamityPlayer variable causes the weapon to be unusable while it's greater than 0. + // Yes, it's getting set every frame as soon as the fireball starts despawning. That's intentional. + // It's the delay for after the fireball despawns, and the burnout visual effects should appear immediately. + if (TriggeredBurnOut) + Owner.Calamity().burningSeaBurnOut = BurningSea.BurnOutReuseDelay; + + bool canUseMana = Owner.CheckMana(Owner.ActiveItem()); + // Use different behavior depending on if the player is channeling or not. + if (Owner.CantUseHoldout() || !canUseMana || Projectile.timeLeft <= 40) + { + Released = true; + + // Time spent fizzling out scales with how long the fireball was charged up. + if (Projectile.timeLeft > BurningSea.FizzleOutTime) + Projectile.timeLeft = (int)MathHelper.Clamp(MathHelper.Lerp(0f, BurningSea.FizzleOutTime, Timer / BurningSea.ChargeTime), 0f, BurningSea.FizzleOutTime); + + // Lose velocity sharply. + Projectile.velocity *= 0.965f; + + // Fizzle out. Once it's small enough, it dies. + Projectile.scale = Utils.Remap(Projectile.timeLeft, 0f, BurningSea.FizzleOutTime, StartScale, EndScale); + Projectile.ExpandHitboxBy((int)(Projectile.scale * 50f)); + } + else if (!Released) + { + // Follow the player's position. + if (Main.myPlayer == Projectile.owner) + { + Vector2 projLocation = Owner.Center; + float mouseDist = Vector2.Distance(Main.MouseWorld, projLocation); + Vector2 mouseDiff = Main.MouseWorld - projLocation; + if (mouseDist > 128f) + { + mouseDiff.Normalize(); + mouseDiff *= 128f; + } + projLocation += mouseDiff; + + Vector2 orbAttemptedVelocity = Vector2.Zero.MoveTowards(projLocation - Projectile.Center, 25f); + Projectile.velocity = Vector2.Lerp(Projectile.velocity, orbAttemptedVelocity, 0.08f); + } + + // Slowly increase in size as the fireball is charged up. + Projectile.scale = Utils.Remap(Timer, 0f, BurningSea.ChargeTime, StartScale, EndScale); + Projectile.ExpandHitboxBy((int)(Projectile.scale * 50f)); + + // Consume mana periodically. + if (Timer % 15 == 0f) + Owner.CheckMana(Owner.ActiveItem(), -1, true); + + // If channeled for a while, turns red (handled in PreDraw) and starts emitting smoke as a warning. + // The smoke only starts once the fireball is completely red. + if (Timer > BurningSea.BurnOutTime - 60f) + { + for (int s = 0; s < 2; s++) + { + Vector2 smokeLocation = Projectile.Center + Vector2.UnitX.RotatedByRandom(MathHelper.Pi) * 237f; + Vector2 smokeVel = smokeLocation - Projectile.Center; + smokeVel.Normalize(); + smokeVel *= 5f; + HeavySmokeParticle burningUp = new(smokeLocation, smokeVel, new Color(192, 192, 192), 10, 1f, 0.6f); + GeneralParticleHandler.SpawnParticle(burningUp); + } + } + // Holding it to this point triggers its burn-out mechanic. This has several effects: + // Spawn text, play a sound, immediately cause the fizzle out, inflict Brimstone Flames on the player, and set a long delay to the weapon. + if (Timer > BurningSea.BurnOutTime) + { + Projectile.timeLeft = (int)BurningSea.FizzleOutTime; + SoundEngine.PlaySound(new("CalamityMod/Sounds/Custom/WeaponEnchant"), Owner.Center); + CombatText.NewText(Owner.Hitbox, new Color(192, 0, 0), CalamityUtils.GetTextValue("Misc.BurningSeaBurn"), true); + + Owner.AddBuff(ModContent.BuffType(), (int)BurningSea.FizzleOutTime); + TriggeredBurnOut = true; + } + } + + AdjustPlayerValues(); + } + + public void AdjustPlayerValues() + { + Projectile.spriteDirection = Projectile.direction = Owner.direction; + Owner.heldProj = Projectile.whoAmI; + Owner.itemTime = 2; + Owner.itemAnimation = 2; + } + + // Can only deal damage while not fizzling out. + public override bool? CanDamage() => !Released; + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + SoundStyle Burn = new SoundStyle("CalamityMod/Sounds/Item/WeldingBurn") with { Volume = 0.25f }; + SoundEngine.PlaySound(Burn, target.Center); + target.AddBuff(ModContent.BuffType(), 180); + + // Whoa buddy no smoking allowed + for (int i = 0; i < 4; i++) + { + Vector2 smokeVel = Main.rand.NextVector2CircularEdge(1f, 1f) * Main.rand.NextFloat(2.5f, 5f); + HeavySmokeParticle smoke = new(target.Center, smokeVel, Color.Gray, 36, 0.7f, 0.625f, 0f, true); + GeneralParticleHandler.SpawnParticle(smoke); + } + } + + // We don't want this massive thing obstructing nearby projectiles. + public override void DrawBehind(int index, List behindNPCsAndTiles, List behindNPCs, List behindProjectiles, List overPlayers, List overWiresUI) + { + behindProjectiles.Add(index); + } + + public override bool PreDraw(ref Color lightColor) + { + Main.spriteBatch.EnterShaderRegion(BlendState.Additive); + Texture2D TheodoreJNoise = ModContent.Request("CalamityMod/ExtraTextures/GreyscaleGradients/MeltyNoise").Value; + Vector2 drawScale = Projectile.Size / TheodoreJNoise.Size() * 1.25f; + float rotation = Main.GlobalTimeWrappedHourly * 4.2f; + + GameShaders.Misc["CalamityMod:ExoVortex"].Apply(); + + // Big fucking fireball + for (int i = 0; i < 6; i++) + { + float direction = (i % 2f == 0f).ToDirectionInt(); + Color fireballColor = Color.Lerp(new Color(255, 200, 200), new Color(255, 30, 30), MathHelper.Clamp(Timer / BurningSea.ChargeTime, 0f, 1f)); + if (Timer > BurningSea.BurnOutTime - 120f) + fireballColor = Color.Lerp(new Color(255, 30, 30), Color.Red, MathHelper.Clamp((Timer - BurningSea.BurnOutTime + 120f) / 60f, 0f, 1f)); + + Main.spriteBatch.Draw(TheodoreJNoise, Projectile.Center - Main.screenPosition, null, fireballColor, direction * rotation, TheodoreJNoise.Size() / 2f, drawScale, SpriteEffects.None, 0f); + } + + Main.spriteBatch.ExitShaderRegion(); + return false; + } + } +} diff --git a/Projectiles/Melee/JudgementProj.cs b/Projectiles/Melee/JudgementProj.cs index 3570f7823a..583ad48e1e 100644 --- a/Projectiles/Melee/JudgementProj.cs +++ b/Projectiles/Melee/JudgementProj.cs @@ -1,81 +1,119 @@ -using System; -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Particles; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; -using Terraria.Audio; -using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Melee { public class JudgementProj : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Melee"; - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - - int whiteLightTimer = 15; - + public override string Texture => "CalamityMod/Projectiles/Melee/JudgementProj"; + public ref float time => ref Projectile.ai[0]; + public float hitboxSize = 10; + public Color mainColor; + public float fade = 1; + public float fadeOut = 1; public override void SetDefaults() { - Projectile.width = 12; - Projectile.height = 12; + Projectile.width = 336; + Projectile.height = 274; Projectile.friendly = true; Projectile.ignoreWater = true; Projectile.penetrate = -1; - Projectile.timeLeft = 90; + Projectile.tileCollide = false; + Projectile.timeLeft = 450; Projectile.DamageType = DamageClass.Melee; - Projectile.usesIDStaticNPCImmunity = true; - Projectile.idStaticNPCHitCooldown = 10; + Projectile.extraUpdates = 9; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; } public override void AI() { - whiteLightTimer--; - if (whiteLightTimer == 0) + Vector2 topCorner = Projectile.Center + (Projectile.velocity.SafeNormalize(Vector2.UnitY).RotatedBy(MathHelper.ToRadians(100f)) * Projectile.scale) * 137; + Vector2 bottomCorner = Projectile.Center + (Projectile.velocity.SafeNormalize(Vector2.UnitY).RotatedBy(MathHelper.ToRadians(-100f)) * Projectile.scale) * 137; + + if (time == 0) { - float spread = 180f * 0.0174f; - double startAngle = Math.Atan2(Projectile.velocity.X, Projectile.velocity.Y) - spread / 2; - double deltaAngle = spread / 8f; - double offsetAngle; - int i; - if (Projectile.owner == Main.myPlayer) + Projectile.scale = 0.0875f; + Projectile.velocity *= 0.9f; + mainColor = Main.rand.NextBool() ? Color.MediumPurple : Color.MediumOrchid; + } + + Projectile.rotation = Projectile.velocity.ToRotation() - MathHelper.PiOver2; + if (time < 200) + { + Projectile.scale += 0.0026f; + hitboxSize += 0.4525f; + Projectile.velocity *= 0.995f; + // Spawn 3 + if (time % 50 == 0 && time > 10) { - for (i = 0; i < 1; i++) + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center + Main.rand.NextVector2Circular(hitboxSize * 0.8f, hitboxSize * 0.8f) - Projectile.velocity * 2, (-Projectile.velocity * 3).RotatedByRandom(0.9f), ModContent.ProjectileType(), (int)(Projectile.damage * 0.2f), 3f, Projectile.owner, 0f); + } + } + else + { + Projectile.velocity *= 0.975f; + } + if (time > 300 && fade > 0) + fade -= 0.0065f; + + if (time < 250 && time > 20) + { + if (time < 200) + { + if (Projectile.timeLeft % 4 == 0) { - offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; - int projectile1 = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), Projectile.damage / 2, Projectile.knockBack * 0.5f, Projectile.owner); - int projectile2 = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), Projectile.damage / 2, Projectile.knockBack * 0.5f, Projectile.owner); - Main.projectile[projectile1].velocity.X *= 0.1f; - Main.projectile[projectile1].velocity.Y *= 0.1f; - Main.projectile[projectile2].velocity.X *= 0.1f; - Main.projectile[projectile2].velocity.Y *= 0.1f; + SparkParticle spark = new SparkParticle(topCorner, Projectile.velocity.SafeNormalize(Vector2.UnitY).RotatedBy(MathHelper.ToRadians(185f)), false, 15, 1f, mainColor * 0.25f); + GeneralParticleHandler.SpawnParticle(spark); + } + if (Projectile.timeLeft % 4 == 0) + { + SparkParticle spark = new SparkParticle(bottomCorner, Projectile.velocity.SafeNormalize(Vector2.UnitY).RotatedBy(MathHelper.ToRadians(-185f)), false, 15, 1f, mainColor * 0.25f); + GeneralParticleHandler.SpawnParticle(spark); } } - whiteLightTimer = 15; + + if (Main.rand.NextBool(3)) + { + Dust trailDust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(hitboxSize, hitboxSize) - Projectile.velocity * 2, 66); + trailDust.scale = Main.rand.NextFloat(0.7f, 0.85f) - (time < 150 ? 0 : time * 0.001f); + trailDust.velocity = -Projectile.velocity * Main.rand.NextFloat(0.85f, 1.5f); + trailDust.color = Main.rand.NextBool() ? Color.MediumPurple : Color.MediumOrchid; + trailDust.noGravity = true; + } + + if (Main.rand.NextBool(12)) + { + GlowOrbParticle orb = new GlowOrbParticle(topCorner, Projectile.velocity.SafeNormalize(Vector2.UnitY).RotatedBy(MathHelper.ToRadians(170f)) * Main.rand.NextFloat(10f, 30f), false, 17, Main.rand.NextFloat(0.4f, 0.75f), mainColor, true, true); + GeneralParticleHandler.SpawnParticle(orb); + GlowOrbParticle orb2 = new GlowOrbParticle(bottomCorner, Projectile.velocity.SafeNormalize(Vector2.UnitY).RotatedBy(MathHelper.ToRadians(-170f)) * Main.rand.NextFloat(10f, 30f), false, 17, Main.rand.NextFloat(0.4f, 0.75f), mainColor, true, true); + GeneralParticleHandler.SpawnParticle(orb2); + } } - - Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.5f / 255f, (255 - Projectile.alpha) * 0.5f / 255f, (255 - Projectile.alpha) * 0.5f / 255f); - - for (int i = 0; i < 2; i++) - { - int shinyDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.GemDiamond, 0f, 0f, 100, default, 1.25f); - Main.dust[shinyDust].noGravity = true; - Main.dust[shinyDust].velocity *= 0.5f; - Main.dust[shinyDust].velocity += Projectile.velocity * 0.1f; - } - - CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 10f, 20f); + fadeOut = Utils.GetLerpValue(0, 180, Projectile.timeLeft, true); + time++; } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + public override bool PreDraw(ref Color lightColor) { - target.AddBuff(ModContent.BuffType(), 180); + Texture2D tex = ModContent.Request(Texture).Value; + float waveFade = Utils.GetLerpValue(0, 300, Projectile.timeLeft); + Main.spriteBatch.Draw(tex, Projectile.Center - Main.screenPosition, null, mainColor with { A = 0 } * fadeOut, Projectile.rotation, tex.Size() / 2f, new Vector2(1 - (0.2f * waveFade), 1 + (0.45f * waveFade)) * Projectile.scale, SpriteEffects.None, 0); + return false; } - public override void OnKill(int timeLeft) + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 180); + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { - SoundEngine.PlaySound(SoundID.Item122, Projectile.position); - if (Projectile.owner == Main.myPlayer) - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y - 100, 0f, 0f, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + if (Projectile.numHits > 0) + Projectile.damage = (int)(Projectile.damage * 0.88f); + if (Projectile.damage < 1) + Projectile.damage = 1; } + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, hitboxSize, targetHitbox); } } diff --git a/Projectiles/Melee/JudgementProj.png b/Projectiles/Melee/JudgementProj.png new file mode 100644 index 0000000000..983f63e892 Binary files /dev/null and b/Projectiles/Melee/JudgementProj.png differ diff --git a/Projectiles/Melee/OrderbringerAura.cs b/Projectiles/Melee/OrderbringerAura.cs deleted file mode 100644 index bdc5e8c106..0000000000 --- a/Projectiles/Melee/OrderbringerAura.cs +++ /dev/null @@ -1,75 +0,0 @@ -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Melee -{ - public class OrderbringerAura : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Melee"; - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - - public override void SetDefaults() - { - Projectile.width = 100; - Projectile.height = 2; - Projectile.tileCollide = false; - Projectile.ignoreWater = true; - Projectile.penetrate = -1; - Projectile.timeLeft = 1200; - } - - public override void AI() - { - Projectile.ai[1] += 1f; - if (Projectile.ai[1] >= 7200f) - { - Projectile.alpha += 5; - if (Projectile.alpha > 255) - { - Projectile.alpha = 255; - Projectile.Kill(); - } - } - else - { - Projectile.ai[0] += 1f; - if (Projectile.ai[0] > 12f) - { - Projectile.ai[0] = 0f; - if (Projectile.owner == Main.myPlayer) - { - int randOrbXOffset = (int)(Projectile.position.X + 14f + (float)Main.rand.Next(Projectile.width - 28)); - int randOrbYOffset = (int)(Projectile.position.Y + (float)Projectile.height + 4f); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), (float)randOrbXOffset, (float)randOrbYOffset, 0f, 10f, ModContent.ProjectileType(), Projectile.damage, 0f, Projectile.owner, 0f, 0f); - } - } - } - Projectile.localAI[0] += 1f; - if (Projectile.localAI[0] >= 10f) - { - Projectile.localAI[0] = 0f; - int projTimer = 0; - int incTracker = 0; - float aiTracker = 0f; - int theProjectile = Projectile.type; - foreach (Projectile p in Main.ActiveProjectiles) - { - if (p.owner == Projectile.owner && p.type == theProjectile && p.ai[1] < 3600f) - { - projTimer++; - if (p.ai[1] > aiTracker) - { - incTracker = p.whoAmI; - aiTracker = p.ai[1]; - } - } - } - if (projTimer > 1) - { - Main.projectile[incTracker].netUpdate = true; - Main.projectile[incTracker].ai[1] = 36000f; - } - } - } - } -} diff --git a/Projectiles/Melee/OrderbringerBeam.cs b/Projectiles/Melee/OrderbringerBeam.cs index debffa2be8..0e1d762941 100644 --- a/Projectiles/Melee/OrderbringerBeam.cs +++ b/Projectiles/Melee/OrderbringerBeam.cs @@ -1,5 +1,6 @@ using System; using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -11,125 +12,62 @@ namespace CalamityMod.Projectiles.Melee public class OrderbringerBeam : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Melee"; + public override string Texture => "CalamityMod/Projectiles/Melee/OrderbringerBeam"; private int whiteLightTimer = 5; + public int time = 0; + public Color mainColor = Color.White; public override void SetStaticDefaults() { - ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; - ProjectileID.Sets.TrailingMode[Projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[Projectile.type] = 12; + ProjectileID.Sets.TrailingMode[Projectile.type] = 2; } public override void SetDefaults() { - Projectile.width = 20; - Projectile.height = 20; - Projectile.extraUpdates = 3; + Projectile.width = 100; + Projectile.height = 100; + Projectile.tileCollide = false; Projectile.friendly = true; Projectile.ignoreWater = true; - Projectile.penetrate = 1; - Projectile.timeLeft = 120; + Projectile.penetrate = -1; + Projectile.extraUpdates = 6; + Projectile.timeLeft = 180; Projectile.DamageType = DamageClass.Melee; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; } public override void AI() { + if (time == 0) + { + mainColor = Main.rand.NextBool() ? Color.MediumPurple : Color.MediumOrchid; + } Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4; - if (Projectile.ai[1] == 0f) + Player Owner = Main.player[Projectile.owner]; + float targetDist = Vector2.Distance(Owner.Center, Projectile.Center); + if (Projectile.timeLeft % 3 == 0 && targetDist < 1400f) { - Projectile.ai[1] = 1f; - SoundEngine.PlaySound(SoundID.Item60, Projectile.position); + Particle spark = new SparkParticle(Projectile.Center - Projectile.velocity * 3, -Projectile.velocity * 0.05f, false, 17, 1.5f, mainColor * 0.7f); + GeneralParticleHandler.SpawnParticle(spark); } - - if (Projectile.localAI[0] == 0f) - { - Projectile.scale -= 0.02f; - Projectile.alpha += 30; - if (Projectile.alpha >= 250) - { - Projectile.alpha = 255; - Projectile.localAI[0] = 1f; - } - } - else if (Projectile.localAI[0] == 1f) - { - Projectile.scale += 0.02f; - Projectile.alpha -= 30; - if (Projectile.alpha <= 0) - { - Projectile.alpha = 0; - Projectile.localAI[0] = 0f; - } - } - - Lighting.AddLight((int)Projectile.Center.X / 16, (int)Projectile.Center.Y / 16, (float)Main.DiscoR / 200f, (float)Main.DiscoG / 200f, (float)Main.DiscoB / 200f); - - whiteLightTimer--; - if (whiteLightTimer == 0) - { - float spread = 180f * 0.0174f; - double startAngle = Math.Atan2(Projectile.velocity.X, Projectile.velocity.Y) - spread / 2; - double deltaAngle = spread / 8f; - double offsetAngle; - int i; - if (Projectile.owner == Main.myPlayer) - { - for (i = 0; i < 1; i++) - { - offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 0.6f), (float)(Math.Cos(offsetAngle) * 0.6f), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 0.6f), (float)(-Math.Cos(offsetAngle) * 0.6f), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); - } - } - whiteLightTimer = 5; - } - - int rainbow = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.RainbowTorch, 0f, 0f, 100, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 0.6f); - Main.dust[rainbow].noGravity = true; - Main.dust[rainbow].velocity *= 0.5f; - Main.dust[rainbow].velocity += Projectile.velocity * 0.1f; - - CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 200f, 10f, 20f); + time++; } - - public override Color? GetAlpha(Color lightColor) - { - return new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, Projectile.alpha); - } - public override bool PreDraw(ref Color lightColor) { - if (Projectile.timeLeft > 115) - return false; - - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], Color.Lerp(mainColor, Color.White, 0.3f) with { A = 0 }, 1, null, true, true); return false; } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(ModContent.BuffType(), 800); - } - - public override void OnKill(int timeLeft) - { - SoundEngine.PlaySound(SoundID.Item122, Projectile.Center); - for (int i = 0; i < 2; i++) + target.AddBuff(ModContent.BuffType(), 180); + if (Projectile.numHits < 1) { - int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.RainbowTorch, 0f, 0f, 100, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1.5f); - Main.dust[dust].noGravity = true; - } - for (int j = 0; j < 20; j++) - { - int deathRainbow = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.RainbowTorch, 0f, 0f, 100, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 2.5f); - Main.dust[deathRainbow].noGravity = true; - Main.dust[deathRainbow].velocity *= 3f; - deathRainbow = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.RainbowTorch, 0f, 0f, 100, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1.5f); - Main.dust[deathRainbow].velocity *= 2f; - Main.dust[deathRainbow].noGravity = true; - } - if (Projectile.owner == Main.myPlayer) - { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y - 100, 0f, 0f, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, 0f); + Particle orb = new GlowSparkParticle(target.Center, Projectile.velocity.SafeNormalize(Vector2.UnitY), false, 12, 0.07f, mainColor, new Vector2(1.5f, 0.8f), true); + GeneralParticleHandler.SpawnParticle(orb); } } } diff --git a/Projectiles/Melee/OrderbringerBeam.png b/Projectiles/Melee/OrderbringerBeam.png index 615ff62268..48b2f67cde 100644 Binary files a/Projectiles/Melee/OrderbringerBeam.png and b/Projectiles/Melee/OrderbringerBeam.png differ diff --git a/Projectiles/Melee/OrderbringerRain.cs b/Projectiles/Melee/OrderbringerRain.cs deleted file mode 100644 index 193b334d26..0000000000 --- a/Projectiles/Melee/OrderbringerRain.cs +++ /dev/null @@ -1,53 +0,0 @@ -using CalamityMod.Buffs.DamageOverTime; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.Audio; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Melee -{ - public class OrderbringerRain : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Melee"; - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - - public override void SetDefaults() - { - Projectile.width = 4; - Projectile.height = 4; - Projectile.friendly = true; - Projectile.extraUpdates = 2; - Projectile.penetrate = 2; - Projectile.ignoreWater = true; - Projectile.tileCollide = false; - Projectile.timeLeft = 180; - Projectile.DamageType = DamageClass.Melee; - } - - public override void AI() - { - if (Projectile.ai[1] == 0f) - { - Projectile.ai[1] = 1f; - SoundEngine.PlaySound(SoundID.Item125, Projectile.Center); - } - - Lighting.AddLight((int)Projectile.Center.X / 16, (int)Projectile.Center.Y / 16, (float)Main.DiscoR / 200f, (float)Main.DiscoG / 200f, (float)Main.DiscoB / 200f); - - for (int i = 0; i < 2; i++) - { - int rainbow = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.RainbowTorch, 0f, 0f, 100, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1f); - Main.dust[rainbow].noGravity = true; - Main.dust[rainbow].velocity *= 0.5f; - Main.dust[rainbow].velocity += Projectile.velocity * 0.1f; - } - - CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 12f, 20f); - } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(ModContent.BuffType(), 80); - } - } -} diff --git a/Projectiles/Melee/OrderbringerWaveProj.cs b/Projectiles/Melee/OrderbringerWaveProj.cs new file mode 100644 index 0000000000..8a0bfbd937 --- /dev/null +++ b/Projectiles/Melee/OrderbringerWaveProj.cs @@ -0,0 +1,124 @@ +using System; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using CalamityMod.Particles; +using Terraria.ModLoader; +using CalamityMod.Projectiles.Ranged; +using Microsoft.Xna.Framework.Graphics; +using System.ComponentModel; +using CalamityMod.Buffs.DamageOverTime; + +namespace CalamityMod.Projectiles.Melee +{ + public class OrderbringerWaveProj : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Melee"; + public override string Texture => "CalamityMod/Projectiles/Melee/JudgementProj"; + public ref float time => ref Projectile.ai[0]; + public float hitboxSize = 10; + public Color mainColor; + public float fade = 1; + public float damageMult = 1; + public float fadeOut = 1; + public override void SetDefaults() + { + Projectile.width = 336; + Projectile.height = 274; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.penetrate = -1; + Projectile.tileCollide = false; + Projectile.timeLeft = 450; + Projectile.DamageType = DamageClass.Melee; + Projectile.extraUpdates = 10; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + } + + public override void AI() + { + Vector2 topCorner = Projectile.Center + (Projectile.velocity.SafeNormalize(Vector2.UnitY).RotatedBy(MathHelper.ToRadians(100f)) * Projectile.scale) * 157; + Vector2 bottomCorner = Projectile.Center + (Projectile.velocity.SafeNormalize(Vector2.UnitY).RotatedBy(MathHelper.ToRadians(-100f)) * Projectile.scale) * 157; + + if (time == 0) + { + Projectile.scale = 0.0875f; + Projectile.velocity *= 0.9f; + mainColor = Main.rand.NextBool() ? Color.MediumPurple : Color.MediumOrchid; + } + + Projectile.rotation = Projectile.velocity.ToRotation() - MathHelper.PiOver2; + if (time < 200) + { + Projectile.scale += 0.0026f; + hitboxSize += 0.4525f; + Projectile.velocity *= 0.995f; + + if (time % 50 == 0 && time > 10) + { + //Projectile stars = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center + Main.rand.NextVector2Circular(hitboxSize * 0.8f, hitboxSize * 0.8f) - Projectile.velocity * 2, (-Projectile.velocity * 3).RotatedByRandom(0.9f), ModContent.ProjectileType(), (int)(Projectile.damage * 0.2f), 3f, Projectile.owner, 0f); + //stars.penetrate = 1; + } + } + else + { + Projectile.velocity *= 0.975f; + } + if (time > 300 && fade > 0) + fade -= 0.0065f; + + if (time < 250 && time > 20) + { + if (Main.rand.NextBool(3)) + { + Dust trailDust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(hitboxSize, hitboxSize) - Projectile.velocity * 2, 66); + trailDust.scale = Main.rand.NextFloat(0.7f, 0.85f) - (time < 150 ? 0 : time * 0.001f); + trailDust.velocity = -Projectile.velocity * Main.rand.NextFloat(0.85f, 1.5f); + trailDust.color = Main.rand.NextBool() ? Color.MediumPurple : Color.MediumOrchid; + trailDust.noGravity = true; + } + + if (time % 9 == 0) + { + Particle orb = new GlowSparkParticle(topCorner, Projectile.velocity.SafeNormalize(Vector2.UnitY).RotatedBy(MathHelper.ToRadians(170f)), false, 15, Main.rand.NextFloat(0.03f, 0.055f) * Utils.GetLerpValue(250, 150, time, true), mainColor, new Vector2(1, 0.8f), true, false, 0.3f); + GeneralParticleHandler.SpawnParticle(orb); + Particle orb2 = new GlowSparkParticle(bottomCorner, Projectile.velocity.SafeNormalize(Vector2.UnitY).RotatedBy(MathHelper.ToRadians(-170f)), false, 15, Main.rand.NextFloat(0.03f, 0.055f) * Utils.GetLerpValue(250, 150, time, true), mainColor, new Vector2(1, 0.8f), true, false, 0.3f); + GeneralParticleHandler.SpawnParticle(orb2); + } + if (Main.rand.NextBool(12)) + { + Particle orb3 = new SparkParticle(topCorner, Projectile.velocity.SafeNormalize(Vector2.UnitY).RotatedBy(MathHelper.ToRadians(170f)) * Main.rand.NextFloat(5f, 20f), false, 15, Main.rand.NextFloat(0.8f, 1.35f), mainColor); + GeneralParticleHandler.SpawnParticle(orb3); + Particle orb4 = new SparkParticle(bottomCorner, Projectile.velocity.SafeNormalize(Vector2.UnitY).RotatedBy(MathHelper.ToRadians(-170f)) * Main.rand.NextFloat(5f, 20f), false, 15, Main.rand.NextFloat(0.8f, 1.35f), mainColor); + GeneralParticleHandler.SpawnParticle(orb4); + } + } + + fadeOut = Utils.GetLerpValue(0, 180, Projectile.timeLeft, true); + + time++; + } + public override bool PreDraw(ref Color lightColor) + { + Texture2D tex = ModContent.Request(Texture).Value; + + float waveFade = Utils.GetLerpValue(0, 300, Projectile.timeLeft); + for (int i = 1; i < 6; i++) // Weird for loop because of squash code + Main.spriteBatch.Draw(tex, Projectile.Center - Main.screenPosition, null, mainColor with { A = 0 } * fadeOut, Projectile.rotation, tex.Size() / 2f, new Vector2(1 - (i * 0.2f * waveFade), 1 + (i * 0.35f * waveFade)) * Projectile.scale * 1.1f, SpriteEffects.None, 0); + return false; + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 300); + + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + // Deal more damage on pierce + modifiers.SourceDamage *= damageMult; + if (damageMult < 2f) + damageMult += 0.25f; + } + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, hitboxSize, targetHitbox); + } +} diff --git a/Projectiles/Melee/OrderbringerWhiteOrb.cs b/Projectiles/Melee/OrderbringerWhiteOrb.cs deleted file mode 100644 index 10f687be16..0000000000 --- a/Projectiles/Melee/OrderbringerWhiteOrb.cs +++ /dev/null @@ -1,37 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Melee -{ - public class OrderbringerWhiteOrb : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Melee"; - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - - public override void SetDefaults() - { - Projectile.width = 8; - Projectile.height = 8; - Projectile.friendly = true; - Projectile.extraUpdates = 2; - Projectile.penetrate = 1; - Projectile.ignoreWater = true; - Projectile.timeLeft = 60; - Projectile.DamageType = DamageClass.Melee; - } - - public override void AI() - { - Lighting.AddLight((int)Projectile.Center.X / 16, (int)Projectile.Center.Y / 16, (float)Main.DiscoR / 200f, (float)Main.DiscoG / 200f, (float)Main.DiscoB / 200f); - for (int i = 0; i < 2; i++) - { - int rainbow = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.RainbowTorch, 0f, 0f, 100, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1f); - Main.dust[rainbow].noGravity = true; - Main.dust[rainbow].velocity *= 0.5f; - Main.dust[rainbow].velocity += Projectile.velocity * 0.1f; - } - } - } -} diff --git a/Projectiles/Melee/StarofJudgement.cs b/Projectiles/Melee/StarofJudgement.cs new file mode 100644 index 0000000000..4fac88070f --- /dev/null +++ b/Projectiles/Melee/StarofJudgement.cs @@ -0,0 +1,124 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using CalamityMod.Particles; +using Terraria.ModLoader; +using Microsoft.Xna.Framework.Graphics; +using System; +using CalamityMod.Buffs.DamageOverTime; + +namespace CalamityMod.Projectiles.Melee +{ + public class StarofJudgement : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Melee"; + public override string Texture => "CalamityMod/Projectiles/Melee/StarofJudgement"; + public ref float time => ref Projectile.ai[0]; + public Color mainColor; + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailCacheLength[Projectile.type] = 12; + ProjectileID.Sets.TrailingMode[Projectile.type] = 2; + } + public override void SetDefaults() + { + Projectile.width = 44; + Projectile.height = 44; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.penetrate = 2; + Projectile.tileCollide = false; + Projectile.timeLeft = 180; + Projectile.DamageType = DamageClass.Melee; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 20; + } + + public override void AI() + { + if (time == 0) + { + Projectile.scale = (Projectile.ai[2] == 1 ? 0.75f : 0.5f); + mainColor = Main.rand.NextBool() ? Color.MediumPurple : Color.MediumOrchid; + if (Projectile.ai[2] == 1) + { + Projectile.localNPCHitCooldown = 7; + Projectile.penetrate = 4; + } + } + Projectile.rotation += (Projectile.velocity.X + MathF.Abs(Projectile.velocity.Y) * Projectile.direction) * 0.01f; + + if (Projectile.ai[2] == 1) + { + CalamityUtils.HomeInOnNPC(Projectile, true, 900f, 25, MathHelper.Clamp(30 - time, 15, 30)); + if (Main.rand.NextBool(4) && Projectile.numHits < 1) + { + Particle spark = new GlowOrbParticle(Projectile.Center + Main.rand.NextVector2Circular(7, 7) - Projectile.velocity, -Projectile.velocity * Main.rand.NextFloat(0.5f, 0.8f), false, 13, 1f, mainColor * 0.5f); + GeneralParticleHandler.SpawnParticle(spark); + } + } + else if (time > 15) + { + CalamityUtils.HomeInOnNPC(Projectile, true, 700f * (Projectile.numHits > 1 ? 2 : 1), 20, 20f * (Projectile.numHits > 1 ? 5 : 1)); + if (Main.rand.NextBool(3)) + { + Dust trailDust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(5, 5) - Projectile.velocity, 66); + trailDust.scale = Main.rand.NextFloat(0.7f, 0.85f); + trailDust.velocity = -Projectile.velocity * Main.rand.NextFloat(0.3f, 0.5f); + trailDust.color = Main.rand.NextBool() ? Color.MediumPurple : Color.MediumOrchid; + trailDust.noGravity = true; + } + } + + time++; + } + public override bool PreDraw(ref Color lightColor) + { + Texture2D texture = ModContent.Request("CalamityMod/Projectiles/Melee/StarofJudgement").Value; + + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + Color drawColor = Color.Lerp(mainColor, Color.White, 0.2f) with { A = 0 }; + float drawRotation = Projectile.rotation; + Vector2 rotationPoint = texture.Size() * 0.5f; + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], drawColor * 0.5f, 1, texture, true, true); + Main.EntitySpriteDraw(texture, drawPosition, null, drawColor, drawRotation, rotationPoint, Projectile.scale, SpriteEffects.None); + return false; + } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + int buffType = Projectile.ai[2] == 1f ? ModContent.BuffType() : ModContent.BuffType(); + target.AddBuff(buffType, 60); + + if (Projectile.ai[2] == 0) + { + Projectile.timeLeft = 180; + time = 0; + Projectile.velocity *= 1.2f; + } + } + public override void OnKill(int timeLeft) + { + if (Projectile.ai[2] == 1) + { + int points = 5; + float radians = MathHelper.TwoPi / points; + Vector2 spinningPoint = Vector2.Normalize(new Vector2(-1f, -1f).RotatedByRandom(100)); + for (int k = 0; k < points; k++) + { + Vector2 velocity = spinningPoint.RotatedBy(radians * k).RotatedBy(-0.45f); + Particle spark = new PointParticle((Projectile.Center + velocity * 7.5f), velocity * 5.5f, false, 9, 1.2f, mainColor); + GeneralParticleHandler.SpawnParticle(spark); + } + } + else + { + for (int k = 0; k < 3; k++) + { + GlowOrbParticle orb = new GlowOrbParticle(Projectile.Center, new Vector2(4, 4).RotatedByRandom(100f) * Main.rand.NextFloat(0.3f, 0.8f), false, 15, Main.rand.NextFloat(0.6f, 0.95f), mainColor); + GeneralParticleHandler.SpawnParticle(orb); + } + } + } + } +} diff --git a/Projectiles/Melee/StarofJudgement.png b/Projectiles/Melee/StarofJudgement.png new file mode 100644 index 0000000000..d11469686b Binary files /dev/null and b/Projectiles/Melee/StarofJudgement.png differ diff --git a/Projectiles/Melee/WhiteBoltAura.cs b/Projectiles/Melee/WhiteBoltAura.cs deleted file mode 100644 index f6778cd633..0000000000 --- a/Projectiles/Melee/WhiteBoltAura.cs +++ /dev/null @@ -1,77 +0,0 @@ -using Terraria; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Melee -{ - public class WhiteBoltAura : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Melee"; - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - - public override void SetDefaults() - { - Projectile.width = 100; - Projectile.height = 2; - Projectile.tileCollide = false; - Projectile.ignoreWater = true; - Projectile.penetrate = -1; - Projectile.timeLeft = 600; - } - - public override void AI() - { - Projectile.ai[1] += 1f; - if (Projectile.ai[1] >= 7200f) - { - Projectile.alpha += 5; - if (Projectile.alpha > 255) - { - Projectile.alpha = 255; - Projectile.Kill(); - } - } - else - { - Projectile.ai[0] += 1f; - if (Projectile.ai[0] > 12f) - { - Projectile.ai[0] = 0f; - if (Projectile.owner == Main.myPlayer) - { - int randOrbXOffset = (int)(Projectile.position.X + 14f + (float)Main.rand.Next(Projectile.width - 28)); - int randOrbYOffset = (int)(Projectile.position.Y + (float)Projectile.height + 4f); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), (float)randOrbXOffset, (float)randOrbYOffset, 0f, 5f, ModContent.ProjectileType(), Projectile.damage, 0f, Projectile.owner, 0f, 0f); - } - } - } - - Projectile.localAI[0] += 1f; - if (Projectile.localAI[0] >= 20f) - { - Projectile.localAI[0] = 0f; - int projTimer = 0; - int incTracker = 0; - float aiTracker = 0f; - int theProjectile = Projectile.type; - foreach (Projectile p in Main.ActiveProjectiles) - { - if (p.owner == Projectile.owner && p.type == theProjectile && p.ai[1] < 3600f) - { - projTimer++; - if (p.ai[1] > aiTracker) - { - incTracker = p.whoAmI; - aiTracker = p.ai[1]; - } - } - } - if (projTimer > 1) - { - Main.projectile[incTracker].netUpdate = true; - Main.projectile[incTracker].ai[1] = 36000f; - } - } - } - - public override bool? CanDamage() => false; - } -} diff --git a/Projectiles/Melee/WhiteOrb.cs b/Projectiles/Melee/WhiteOrb.cs deleted file mode 100644 index 75df233253..0000000000 --- a/Projectiles/Melee/WhiteOrb.cs +++ /dev/null @@ -1,35 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Melee -{ - public class WhiteOrb : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Melee"; - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - - public override void SetDefaults() - { - Projectile.width = 8; - Projectile.height = 8; - Projectile.friendly = true; - Projectile.extraUpdates = 1; - Projectile.penetrate = 1; - Projectile.ignoreWater = true; - Projectile.timeLeft = 60; - Projectile.DamageType = DamageClass.Melee; - } - - public override void AI() - { - Lighting.AddLight(Projectile.Center, 0.2f, 0.2f, 0.2f); - - int shiny = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.GemDiamond, 0f, 0f, 100, default, 1.25f); - Main.dust[shiny].noGravity = true; - Main.dust[shiny].velocity *= 0.5f; - Main.dust[shiny].velocity += Projectile.velocity * 0.1f; - } - } -} diff --git a/Projectiles/Melee/Whiterain.cs b/Projectiles/Melee/Whiterain.cs deleted file mode 100644 index 4d415d6b34..0000000000 --- a/Projectiles/Melee/Whiterain.cs +++ /dev/null @@ -1,52 +0,0 @@ -using CalamityMod.Buffs.DamageOverTime; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.Audio; -using Terraria.ID; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Melee -{ - public class Whiterain : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Melee"; - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - - public override void SetDefaults() - { - Projectile.width = 4; - Projectile.height = 4; - Projectile.friendly = true; - Projectile.extraUpdates = 1; - Projectile.penetrate = 2; - Projectile.ignoreWater = true; - Projectile.tileCollide = false; - Projectile.timeLeft = 120; - Projectile.DamageType = DamageClass.Melee; - } - - public override void AI() - { - if (Projectile.ai[1] == 0f) - { - Projectile.ai[1] = 1f; - SoundEngine.PlaySound(SoundID.Item125 with { Volume = 0.7f }, Projectile.Center); - } - - Lighting.AddLight(Projectile.Center, 0.2f, 0.2f, 0.2f); - - for (int i = 0; i < 2; i++) - { - int shiny = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.GemDiamond, 0f, 0f, 100, default, 1.25f); - Main.dust[shiny].noGravity = true; - Main.dust[shiny].velocity *= 0.5f; - Main.dust[shiny].velocity += Projectile.velocity * 0.1f; - } - - CalamityUtils.HomeInOnNPC(Projectile, true, 320f, 14f, 20f); - } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(ModContent.BuffType(), 60); - } - } -} diff --git a/Projectiles/Ranged/MarksmanShot.cs b/Projectiles/Ranged/MarksmanShot.cs index 9ca1f1c94a..e3db98ad8c 100644 --- a/Projectiles/Ranged/MarksmanShot.cs +++ b/Projectiles/Ranged/MarksmanShot.cs @@ -173,7 +173,7 @@ namespace CalamityMod.Projectiles.Ranged { Player coinOwner = Main.player[struckCoin.owner]; if (coinOwner.name.ToLower() == "v1" || coinOwner.name.ToLower() == "v2" || coinOwner.name.ToLower() == "mirage") - ORDERSystem.JUDGMENT(); + ORDERSystem.JUDGEMENT(); } } diff --git a/Projectiles/Summon/MidnightSunUFO.cs b/Projectiles/Summon/MidnightSunUFO.cs index 0f3c40a5d9..78ac6024cb 100644 --- a/Projectiles/Summon/MidnightSunUFO.cs +++ b/Projectiles/Summon/MidnightSunUFO.cs @@ -3,8 +3,10 @@ using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using CalamityMod.Items.Weapons.Summon; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; @@ -20,7 +22,6 @@ namespace CalamityMod.Projectiles.Summon Main.projFrames[Projectile.type] = 4; ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4; ProjectileID.Sets.TrailingMode[Projectile.type] = 0; - ProjectileID.Sets.SentryShot[Projectile.type] = true; } public override void SetDefaults() @@ -137,7 +138,21 @@ namespace CalamityMod.Projectiles.Summon } public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); + Texture2D tex = TextureAssets.Projectile[Type].Value; + Rectangle frame = tex.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + Color drawColor = Projectile.GetAlpha(lightColor); + + if (CalamityConfig.Instance.Afterimages) + { + for (int i = 0; i < Projectile.oldPos.Length; i++) + { + Color trailColor = Color.Lerp(drawColor, Color.Transparent, i / (float)Projectile.oldPos.Length); + Vector2 trailPos = Projectile.oldPos[i] + Projectile.Size * 0.5f - Main.screenPosition; + Main.EntitySpriteDraw(tex, trailPos, frame, trailColor, Projectile.rotation, frame.Size() * 0.5f, Projectile.scale, SpriteEffects.None); + } + } + + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, frame, drawColor, Projectile.rotation, frame.Size() * 0.5f, Projectile.scale, SpriteEffects.None); return false; } } diff --git a/Sounds/Custom/GreatSandSharkRoar.ogg b/Sounds/Custom/GreatSandSharkRoar.ogg index a6761195bf..5b0a19e994 100644 Binary files a/Sounds/Custom/GreatSandSharkRoar.ogg and b/Sounds/Custom/GreatSandSharkRoar.ogg differ diff --git a/Sounds/NPCHit/GreatSandSharkHit.ogg b/Sounds/NPCHit/GreatSandSharkHit.ogg index 9f7db8deb5..8042ffaa81 100644 Binary files a/Sounds/NPCHit/GreatSandSharkHit.ogg and b/Sounds/NPCHit/GreatSandSharkHit.ogg differ diff --git a/Sounds/NPCKilled/GreatSandSharkDeath.ogg b/Sounds/NPCKilled/GreatSandSharkDeath.ogg index 19f1aac3ef..bf2471e824 100644 Binary files a/Sounds/NPCKilled/GreatSandSharkDeath.ogg and b/Sounds/NPCKilled/GreatSandSharkDeath.ogg differ diff --git a/Systems/MiscWorldStateSystem.cs b/Systems/MiscWorldStateSystem.cs index 897754c9a7..2b95101060 100644 --- a/Systems/MiscWorldStateSystem.cs +++ b/Systems/MiscWorldStateSystem.cs @@ -46,7 +46,6 @@ namespace CalamityMod CalamityGlobalNPC.draedonExoMechWorm = -1; CalamityGlobalNPC.adultEidolonWyrmHead = -1; BossRushEvent.BossRushStage = 0; - ArmoredDiggerSpawnCooldown = 0; BossRushEvent.BossRushActive = false; BossRushEvent.BossRushSpawnCountdown = 180; BossRushEvent.HostileProjectileKillCounter = 0; diff --git a/Systems/ORDERSystem.cs b/Systems/ORDERSystem.cs index 565546dbb0..d30877afca 100644 --- a/Systems/ORDERSystem.cs +++ b/Systems/ORDERSystem.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Systems } // DIE! - public static void JUDGMENT() + public static void JUDGEMENT() { if (!currentlyPlaying) orderSoundSlot = SoundEngine.PlaySound(ORDERTrack); diff --git a/Systems/Quests/AmidiasQuest.cs b/Systems/Quests/AmidiasQuest.cs new file mode 100644 index 0000000000..43d8e1642e --- /dev/null +++ b/Systems/Quests/AmidiasQuest.cs @@ -0,0 +1,15 @@ +namespace CalamityMod.Systems.Quests +{ + /// + /// The different progression points of Amidias' Quest. + /// + public enum AmidiasQuestProgression + { + KilledGiantClam, + } + + /// + /// A ModSystem which controls, progresses, saves, and loads the data necessary for Amidias' Quest. + /// + public class AmidiasQuest : Quest { } +} diff --git a/Systems/Quests/Quest.cs b/Systems/Quests/Quest.cs new file mode 100644 index 0000000000..e424ce291c --- /dev/null +++ b/Systems/Quests/Quest.cs @@ -0,0 +1,140 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Terraria.ModLoader; +using Terraria.ModLoader.IO; + +namespace CalamityMod.Systems.Quests +{ + /// + /// An that implements the foundation to make quests in Terraria
+ /// and making their data be saved and loaded accordingly. + ///
+ /// A which contains all the progression points of the quest + public abstract class Quest : ModSystem where TEnum : Enum + { + #region Data Saving & Loading + + public override void Unload() => QuestProgression = null; + + public override void ClearWorld() + { + // Resets all the properties when loading a world without a TagCompound. + + QuestStarted = false; + QuestFinished = false; + QuestProgression = ResetQuestProgression(); + } + + public override void LoadWorldData(TagCompound tag) + { + QuestStarted = tag.ContainsKey("questStarted"); + QuestFinished = tag.ContainsKey("questFinished"); + + QuestProgression = ResetQuestProgression(); + + // Although this method may seem weird, it's endorsed by tML on their guides for save & loading dictionaries. + if (tag.TryGet>("questProgression", out var value)) + QuestProgression = QuestProgression.Keys.Zip(value, (k, v) => new { Key = k, Value = v }).ToDictionary(x => x.Key, x => x.Value); + } + + public override void SaveWorldData(TagCompound tag) + { + // If any of them have modified values from the default value, we save them on the TagCompound. + + if (QuestStarted) + tag.Add("questStarted", QuestStarted); + + if (QuestFinished) + tag.Add("questFinished", QuestFinished); + + if (QuestProgression.ContainsValue(true)) + tag.Add("questProgression", QuestProgression.Values.ToList()); + } + + #endregion + + /// + /// Whether or not this quest has started. + /// + public static bool QuestStarted { get; private set; } + + /// + /// Whether or not this quest has finished. + /// + public static bool QuestFinished { get; private set; } + + /// + /// A dictionary that saves a boolean for each progression point, to state which one was completed and which one was not. + /// + public static Dictionary QuestProgression { get; private set; } = ResetQuestProgression(); + + /// + /// An event that is triggered when this quest starts. + /// + public static event Action OnQuestStarted; + + /// + /// An event that is triggered when this quest finishes. + /// + public static event Action OnQuestFinish; + + /// + /// An event that is triggered when this quest completes a new progression point. + /// + public static event Action OnQuestProgression; + + /// + /// A method that makes this quest start and trigger its corresponding event.
+ /// Does nothing if the quest has already started. + ///
+ public static void StartQuest() + { + if (!QuestStarted) + { + QuestStarted = true; + OnQuestStarted?.Invoke(); + } + } + + /// + /// A method that makes this quest finishes and trigger its corresponding event.
+ /// Does nothing if the quest has already finished. + ///
+ public static void FinishQuest() + { + if (!QuestFinished) + { + QuestFinished = true; + OnQuestFinish?.Invoke(); + } + } + + /// + /// A method that makes a progression point be counted as completed.
+ /// Does nothing if the progression point has already been completed. + ///
+ /// The progression point that has been completed. + public static void ProgressQuest(TEnum progressionPoint) + { + if (!QuestProgression[progressionPoint]) + { + QuestProgression[progressionPoint] = true; + OnQuestProgression?.Invoke(progressionPoint); + } + } + + /// + /// A quick method to resets the progression of Amidias' Quest.
+ /// Used for when changing worlds or initializing . + ///
+ private static Dictionary ResetQuestProgression() + { + Dictionary questProgression = new(); + var progressionPoints = Enum.GetValues(typeof(TEnum)); + foreach (TEnum progressionPoint in progressionPoints) + questProgression.Add(progressionPoint, false); + return questProgression; + } + } +} diff --git a/Systems/RecipeSystem.cs b/Systems/RecipeSystem.cs index fec870b7aa..22c09a7d10 100644 --- a/Systems/RecipeSystem.cs +++ b/Systems/RecipeSystem.cs @@ -1278,15 +1278,6 @@ namespace CalamityMod.Systems r.Register(); r.DisableDecraft(); - // Shadow Key - r = Recipe.Create(ItemID.ShadowKey); - r.AddIngredient(ItemID.GoldenKey); - r.AddIngredient(ItemID.Obsidian, 10); - r.AddIngredient(ItemID.Bone, 5); - r.AddTile(TileID.Anvils); - r.Register(); - r.DisableDecraft(); - // Sky Mill r = Recipe.Create(ItemID.SkyMill); r.AddIngredient(ItemID.SunplateBlock, 10); @@ -1700,14 +1691,6 @@ namespace CalamityMod.Systems r.Register(); r.DisableDecraft(); - // Shoe Spikes - r = Recipe.Create(ItemID.ShoeSpikes); - r.AddRecipeGroup("IronBar", 5); - r.AddIngredient(ItemID.Spike, 5); - r.AddTile(TileID.Anvils); - r.Register(); - r.DisableDecraft(); - // Flare Gun r = Recipe.Create(ItemID.FlareGun); r.AddRecipeGroup(AnyCopperBar, 5); diff --git a/Systems/WorldMiscUpdateSystem.cs b/Systems/WorldMiscUpdateSystem.cs index cc580cd0d9..eb8fc619f6 100644 --- a/Systems/WorldMiscUpdateSystem.cs +++ b/Systems/WorldMiscUpdateSystem.cs @@ -85,7 +85,6 @@ namespace CalamityMod.Systems if (player is not null && player.active) { CalamityPlayer modPlayer = player.Calamity(); - TrySpawnArmoredDigger(player, modPlayer); TrySpawnDungeonGuardian(player); TrySpawnAEoW(player, modPlayer); } @@ -417,70 +416,6 @@ namespace CalamityMod.Systems } #endregion - #region Handle Armored Digger Random Spawns - public static void TrySpawnArmoredDigger(Player player, CalamityPlayer modPlayer) - { - bool gfbCondition = Main.zenithWorld && (player.ZoneHallow || player.ZoneUnderworldHeight) && NPC.downedMoonlord; - if ((gfbCondition || (player.ZoneRockLayerHeight && !player.ZoneUnderworldHeight && !player.ZoneJungle)) && !player.ZoneDungeon && !modPlayer.ZoneSunkenSea && !modPlayer.ZoneAbyss && !CalamityPlayer.areThereAnyDamnBosses) - { - if (NPC.downedPlantBoss && player.townNPCs < 3f) - { - double spawnRate = 100000D; - - if (CalamityWorld.LegendaryMode && revenge) - spawnRate *= 0.25D; - - if (revenge) - spawnRate *= 0.85D; - - if (death && Main.bloodMoon) - spawnRate *= 0.2D; - if (modPlayer.zerg) - spawnRate *= 0.5D; - if (modPlayer.chaosCandle) - spawnRate *= 0.6D; - if (player.enemySpawns) - spawnRate *= 0.7D; - if (Main.SceneMetrics.WaterCandleCount > 0) - spawnRate *= 0.8D; - - if (modPlayer.isNearbyBoss && CalamityConfig.Instance.BossZen) - spawnRate *= 50D; - if (modPlayer.zen || (CalamityConfig.Instance.ForceTownSafety && player.townNPCs > 1f && Main.expertMode)) - spawnRate *= 2D; - if (modPlayer.tranquilityCandle) - spawnRate *= 1.67D; - if (player.calmed) - spawnRate *= 1.43D; - if (Main.SceneMetrics.PeaceCandleCount > 0) - spawnRate *= 1.25D; - - int chance = (int)spawnRate; - if (Main.rand.NextBool(chance)) - { - if (!NPC.AnyNPCs(NPCType()) && Main.netMode != NetmodeID.MultiplayerClient && - ArmoredDiggerSpawnCooldown <= 0) - { - NPC.SpawnOnPlayer(player.whoAmI, NPCType()); - ArmoredDiggerSpawnCooldown = 36000; - } - } - } - } - if (ArmoredDiggerSpawnCooldown > 0) - { - ArmoredDiggerSpawnCooldown--; - if (Main.netMode == NetmodeID.Server) - { - var netMessage = CalamityMod.Instance.GetPacket(); - netMessage.Write((byte)CalamityModMessageType.ArmoredDiggerCountdownSync); - netMessage.Write(ArmoredDiggerSpawnCooldown); - netMessage.Send(); - } - } - } - #endregion - #region Handle Dungeon Guardian Spawns public static void TrySpawnDungeonGuardian(Player player) { diff --git a/Tiles/Astral/AstralDirt.cs b/Tiles/Astral/AstralDirt.cs index 18ff19942a..43204bb557 100644 --- a/Tiles/Astral/AstralDirt.cs +++ b/Tiles/Astral/AstralDirt.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Tiles.Astral TileID.Sets.ChecksForMerge[Type] = true; TileID.Sets.CanBeDugByShovel[Type] = true; TileID.Sets.CanBeClearedDuringOreRunner[Type] = true; - + TileID.Sets.Conversion.Dirt[Type] = true; this.RegisterUniversalMerge(TileID.Dirt, "CalamityMod/Tiles/Merges/DirtMerge"); this.RegisterUniversalMerge(TileID.Stone, "CalamityMod/Tiles/Merges/StoneMerge"); diff --git a/Tiles/AstralSnow/AstralSnow.cs b/Tiles/AstralSnow/AstralSnow.cs index 27b8b2a29e..7fc6237c15 100644 --- a/Tiles/AstralSnow/AstralSnow.cs +++ b/Tiles/AstralSnow/AstralSnow.cs @@ -30,6 +30,7 @@ namespace CalamityMod.Tiles.AstralSnow AddMapEntry(new Color(189, 211, 221)); TileID.Sets.Snow[Type] = true; + TileID.Sets.Conversion.Snow[Type] = true; TileID.Sets.ChecksForMerge[Type] = true; TileID.Sets.CanBeClearedDuringOreRunner[Type] = true; diff --git a/Tiles/Crags/Tree/SpineSapling.cs b/Tiles/Crags/Tree/SpineSapling.cs index 140f46a145..e1af1f142c 100644 --- a/Tiles/Crags/Tree/SpineSapling.cs +++ b/Tiles/Crags/Tree/SpineSapling.cs @@ -57,5 +57,7 @@ namespace CalamityMod.Tiles.Crags.Tree } } } + + public override bool CanDrop(int i, int j) => false; } } diff --git a/Tiles/Furniture/BabyCannonballJellyfishBowlTile.cs b/Tiles/Furniture/BabyCannonballJellyfishBowlTile.cs index 28ecf21af7..b0c3781911 100644 --- a/Tiles/Furniture/BabyCannonballJellyfishBowlTile.cs +++ b/Tiles/Furniture/BabyCannonballJellyfishBowlTile.cs @@ -32,6 +32,8 @@ namespace CalamityMod.Tiles.Furniture num = fail ? 1 : 3; } + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => offsetY = 2; + public override void AnimateTile(ref int frame, ref int frameCounter) { int frameAmt = 8; diff --git a/Tiles/Furniture/BabyFlakCrabCageTile.cs b/Tiles/Furniture/BabyFlakCrabCageTile.cs index 2e1ad66170..79cf298931 100644 --- a/Tiles/Furniture/BabyFlakCrabCageTile.cs +++ b/Tiles/Furniture/BabyFlakCrabCageTile.cs @@ -13,9 +13,11 @@ namespace CalamityMod.Tiles.Furniture { public override void SetStaticDefaults() { - Main.tileLighted[Type] = true; Main.tileFrameImportant[Type] = true; Main.tileLavaDeath[Type] = true; + Main.tileSolidTop[Type] = true; + Main.tileTable[Type] = true; + TileID.Sets.CritterCageLidStyle[Type] = TileID.Sets.CritterCageLidStyle[TileID.BunnyCage]; // Big, gray lid TileObjectData.newTile.CopyFrom(TileObjectData.Style6x3); TileObjectData.addTile(Type); AnimationFrameHeight = 54; @@ -33,6 +35,8 @@ namespace CalamityMod.Tiles.Furniture num = fail ? 1 : 3; } + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => offsetY = 2; + public override void AnimateTile(ref int frame, ref int frameCounter) { int frameAmt = 34; diff --git a/Tiles/Furniture/BabyGhostBellJarTile.cs b/Tiles/Furniture/BabyGhostBellJarTile.cs index a7a504383a..5f29ee1dee 100644 --- a/Tiles/Furniture/BabyGhostBellJarTile.cs +++ b/Tiles/Furniture/BabyGhostBellJarTile.cs @@ -34,6 +34,8 @@ namespace CalamityMod.Tiles.Furniture num = fail ? 1 : 3; } + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => offsetY = 2; + public override void AnimateTile(ref int frame, ref int frameCounter) { int frameAmt = 8; diff --git a/Tiles/Furniture/CorruptionEffigy.cs b/Tiles/Furniture/CorruptionEffigy.cs index 55513d9acf..f0b28ff9f7 100644 --- a/Tiles/Furniture/CorruptionEffigy.cs +++ b/Tiles/Furniture/CorruptionEffigy.cs @@ -13,7 +13,6 @@ namespace CalamityMod.Tiles.Furniture { public override void SetStaticDefaults() { - Main.tileLighted[Type] = true; Main.tileFrameImportant[Type] = true; Main.tileLavaDeath[Type] = true; @@ -25,6 +24,12 @@ namespace CalamityMod.Tiles.Furniture TileObjectData.newTile.Origin = new Point16(0, 3); TileObjectData.newTile.UsesCustomCanPlace = true; TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop, 2, 0); + TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; + TileObjectData.newTile.StyleHorizontal = true; + TileObjectData.newTile.StyleMultiplier = 2; + TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); + TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceRight; + TileObjectData.addAlternate(1); TileObjectData.addTile(Type); AddMapEntry(new Color(126, 156, 134), CalamityUtils.GetItemName()); } diff --git a/Tiles/Furniture/CorruptionEffigy.png b/Tiles/Furniture/CorruptionEffigy.png index fef465f910..4389f81731 100644 Binary files a/Tiles/Furniture/CorruptionEffigy.png and b/Tiles/Furniture/CorruptionEffigy.png differ diff --git a/Tiles/Furniture/CrimsonEffigy.cs b/Tiles/Furniture/CrimsonEffigy.cs index 12d51122ad..c11e47db6c 100644 --- a/Tiles/Furniture/CrimsonEffigy.cs +++ b/Tiles/Furniture/CrimsonEffigy.cs @@ -13,7 +13,6 @@ namespace CalamityMod.Tiles.Furniture { public override void SetStaticDefaults() { - Main.tileLighted[Type] = true; Main.tileFrameImportant[Type] = true; Main.tileLavaDeath[Type] = true; @@ -25,6 +24,12 @@ namespace CalamityMod.Tiles.Furniture TileObjectData.newTile.Origin = new Point16(0, 3); TileObjectData.newTile.UsesCustomCanPlace = true; TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop, 2, 0); + TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; + TileObjectData.newTile.StyleHorizontal = true; + TileObjectData.newTile.StyleMultiplier = 2; + TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); + TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceRight; + TileObjectData.addAlternate(1); TileObjectData.addTile(Type); AddMapEntry(new Color(238, 145, 105), CalamityUtils.GetItemName()); } diff --git a/Tiles/Furniture/CrimsonEffigy.png b/Tiles/Furniture/CrimsonEffigy.png index ef06cd32e7..623df7c679 100644 Binary files a/Tiles/Furniture/CrimsonEffigy.png and b/Tiles/Furniture/CrimsonEffigy.png differ diff --git a/Tiles/Furniture/EffigyOfDecayPlaceable.cs b/Tiles/Furniture/EffigyOfDecayPlaceable.cs index 9bf1b0aefd..e8f70ad6d6 100644 --- a/Tiles/Furniture/EffigyOfDecayPlaceable.cs +++ b/Tiles/Furniture/EffigyOfDecayPlaceable.cs @@ -14,7 +14,6 @@ namespace CalamityMod.Tiles.Furniture { public override void SetStaticDefaults() { - Main.tileLighted[Type] = true; Main.tileFrameImportant[Type] = true; Main.tileLavaDeath[Type] = true; @@ -26,6 +25,12 @@ namespace CalamityMod.Tiles.Furniture TileObjectData.newTile.Origin = new Point16(0, 3); TileObjectData.newTile.UsesCustomCanPlace = true; TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop, 2, 0); + TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; + TileObjectData.newTile.StyleHorizontal = true; + TileObjectData.newTile.StyleMultiplier = 2; + TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); + TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceRight; + TileObjectData.addAlternate(1); TileObjectData.addTile(Type); AddMapEntry(new Color(113, 90, 71), CalamityUtils.GetItemName()); } diff --git a/Tiles/Furniture/EffigyOfDecayPlaceable.png b/Tiles/Furniture/EffigyOfDecayPlaceable.png index 61db8a5d83..375640636b 100644 Binary files a/Tiles/Furniture/EffigyOfDecayPlaceable.png and b/Tiles/Furniture/EffigyOfDecayPlaceable.png differ diff --git a/Tiles/Furniture/LanternCenterTile.cs b/Tiles/Furniture/LanternCenterTile.cs index 5d87d1aad6..6744a2c100 100644 --- a/Tiles/Furniture/LanternCenterTile.cs +++ b/Tiles/Furniture/LanternCenterTile.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Placeables.Furniture; using Microsoft.Xna.Framework; +using System; using Terraria; using Terraria.Audio; using Terraria.DataStructures; @@ -25,6 +26,8 @@ namespace CalamityMod.Tiles.Furniture TileObjectData.addTile(Type); AddMapEntry(new Color(99, 99, 99), CalamityUtils.GetItemName()); TileID.Sets.HasOutlines[Type] = true; + TileID.Sets.InteractibleByNPCs[Type] = true; + TileID.Sets.DisableSmartInteract[Type] = true; AnimationFrameHeight = 54; } @@ -35,12 +38,21 @@ namespace CalamityMod.Tiles.Furniture public override void AnimateTile(ref int frame, ref int frameCounter) { - frameCounter++; - if (frameCounter >= 6) + if (!LanternNight.LanternsUp) { - frame = (frame + 1) % 6; + frame = 0; frameCounter = 0; } + else + { + frameCounter++; + if (frameCounter >= 6) + { + frame = (frame + 1) % 7; + frameCounter = 0; + } + frame = Math.Clamp(frame, 1, 6); + } } public override void KillMultiTile(int i, int j, int frameX, int frameY) @@ -50,13 +62,11 @@ namespace CalamityMod.Tiles.Furniture public override void HitWire(int i, int j) { - CalamityUtils.LightHitWire(Type, i, j, 3, 3); LanternNight.ToggleManualLanterns(); } public override bool RightClick(int i, int j) { - CalamityUtils.LightHitWire(Type, i, j, 3, 3); LanternNight.ToggleManualLanterns(); SoundEngine.PlaySound(SoundID.Mech, new Vector2(i * 16, j * 16)); return true; diff --git a/Tiles/Furniture/LanternCenterTile.png b/Tiles/Furniture/LanternCenterTile.png index 1f8cc97ef3..fffbe3d12e 100644 Binary files a/Tiles/Furniture/LanternCenterTile.png and b/Tiles/Furniture/LanternCenterTile.png differ diff --git a/Tiles/Furniture/LanternCenterTile_Highlight.png b/Tiles/Furniture/LanternCenterTile_Highlight.png index 6e86215b5d..7c9e7546ef 100644 Binary files a/Tiles/Furniture/LanternCenterTile_Highlight.png and b/Tiles/Furniture/LanternCenterTile_Highlight.png differ diff --git a/Tiles/Furniture/PiggyCageTile.cs b/Tiles/Furniture/PiggyCageTile.cs index 517372277c..55aacb60f9 100644 --- a/Tiles/Furniture/PiggyCageTile.cs +++ b/Tiles/Furniture/PiggyCageTile.cs @@ -13,9 +13,11 @@ namespace CalamityMod.Tiles.Furniture { public override void SetStaticDefaults() { - Main.tileLighted[Type] = true; Main.tileFrameImportant[Type] = true; Main.tileLavaDeath[Type] = true; + Main.tileSolidTop[Type] = true; + Main.tileTable[Type] = true; + TileID.Sets.CritterCageLidStyle[Type] = TileID.Sets.CritterCageLidStyle[TileID.BunnyCage]; // Big, gray lid TileObjectData.newTile.CopyFrom(TileObjectData.Style6x3); TileObjectData.addTile(Type); AnimationFrameHeight = 54; @@ -33,6 +35,8 @@ namespace CalamityMod.Tiles.Furniture num = fail ? 1 : 3; } + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => offsetY = 2; + public override void AnimateTile(ref int frame, ref int frameCounter) { int frameAmt = 34; diff --git a/Tiles/Furniture/SeaMinnowJarTile.cs b/Tiles/Furniture/SeaMinnowJarTile.cs index d8f90548b8..6d8ae9201b 100644 --- a/Tiles/Furniture/SeaMinnowJarTile.cs +++ b/Tiles/Furniture/SeaMinnowJarTile.cs @@ -13,9 +13,9 @@ namespace CalamityMod.Tiles.Furniture { public override void SetStaticDefaults() { - Main.tileLighted[Type] = true; Main.tileFrameImportant[Type] = true; Main.tileLavaDeath[Type] = true; + TileID.Sets.InteractibleByNPCs[Type] = true; // Emulating Fish Bowl. NPCs do not interact with Jelly jars (probably because they're deadly or something) TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); TileObjectData.addTile(Type); AnimationFrameHeight = 36; @@ -33,6 +33,8 @@ namespace CalamityMod.Tiles.Furniture num = fail ? 1 : 3; } + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) => offsetY = 2; + public override void AnimateTile(ref int frame, ref int frameCounter) { int frameAmt = 12; diff --git a/Tiles/Furniture/SunkenIdolTile.cs b/Tiles/Furniture/SunkenIdolTile.cs new file mode 100644 index 0000000000..e3d5dadf61 --- /dev/null +++ b/Tiles/Furniture/SunkenIdolTile.cs @@ -0,0 +1,51 @@ +using CalamityMod.Items.Placeables.Furniture; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.Enums; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.Furniture +{ + public class SunkenIdolTile : ModTile + { + public override void SetStaticDefaults() + { + Main.tileLighted[Type] = true; + Main.tileFrameImportant[Type] = true; + Main.tileNoAttach[Type] = true; + Main.tileWaterDeath[Type] = false; + TileObjectData.newTile.CopyFrom(TileObjectData.Style3x4); + TileObjectData.newTile.Width = 3; + TileObjectData.newTile.Height = 5; + TileObjectData.newTile.Origin = new Point16(1, 4); + TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16, 16, 18 }; + TileObjectData.newTile.StyleWrapLimit = 2; + TileObjectData.newTile.StyleMultiplier = 2; + TileObjectData.newTile.StyleHorizontal = true; + + TileObjectData.newTile.Direction = TileObjectDirection.PlaceRight; + + TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); + TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceLeft; + TileObjectData.addAlternate(1); + + TileObjectData.addTile(Type); + AddMapEntry(new Color(113, 90, 71), CalamityUtils.GetItemName()); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.BlueMoss); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/Furniture/SunkenIdolTile.png b/Tiles/Furniture/SunkenIdolTile.png new file mode 100644 index 0000000000..5db73b921f Binary files /dev/null and b/Tiles/Furniture/SunkenIdolTile.png differ diff --git a/Tiles/FurniturePlaguedPlate/PlaguedPlateBed.cs b/Tiles/FurniturePlaguedPlate/PlaguedPlateBed.cs index 65721061b7..6e6dc45c34 100644 --- a/Tiles/FurniturePlaguedPlate/PlaguedPlateBed.cs +++ b/Tiles/FurniturePlaguedPlate/PlaguedPlateBed.cs @@ -16,14 +16,16 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate Main.tileFrameImportant[Type] = true; Main.tileLavaDeath[Type] = false; TileID.Sets.HasOutlines[Type] = true; + TileID.Sets.InteractibleByNPCs[Type] = true; + TileID.Sets.DisableSmartCursor[Type] = true; + TileID.Sets.IsValidSpawnPoint[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x4); //This bed has different dimensions to conventional beds, using bookcase dimentions instead TileObjectData.newTile.LavaDeath = false; TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16, 16 }; TileObjectData.addTile(Type); - AddMapEntry(new Color(191, 142, 111), CreateMapEntryName()); - TileID.Sets.DisableSmartCursor[Type] = true; - AdjTiles = new int[] { TileID.Beds }; AddToArray(ref TileID.Sets.RoomNeeds.CountsAsChair); + AddMapEntry(new Color(191, 142, 111), CreateMapEntryName()); + AdjTiles = new int[] { TileID.Beds }; } public override bool CreateDust(int i, int j, ref int type) @@ -51,12 +53,12 @@ namespace CalamityMod.Tiles.FurniturePlaguedPlate if (player.SpawnX == spawnX && player.SpawnY == spawnY) { player.RemoveSpawn(); - Main.NewText("Spawn point removed!", 255, 240, 20); + Main.NewText(Language.GetTextValue("Game.SpawnPointRemoved"), 255, 240, 20); } else if (Player.CheckSpawn(spawnX, spawnY)) { player.ChangeSpawn(spawnX, spawnY); - Main.NewText("Spawn point set!", 255, 240, 20); + Main.NewText(Language.GetTextValue("Game.SpawnPointSet"), 255, 240, 20); } return true; } diff --git a/UI/CalamitasEnchantments/EnchantmentManager.cs b/UI/CalamitasEnchantments/EnchantmentManager.cs index afbb994bc5..ea58ed2b90 100644 --- a/UI/CalamitasEnchantments/EnchantmentManager.cs +++ b/UI/CalamitasEnchantments/EnchantmentManager.cs @@ -213,7 +213,7 @@ namespace CalamityMod.UI.CalamitasEnchants new Enchantment(CalamityUtils.GetText("UI.Tainted.DisplayName"), CalamityUtils.GetText("UI.Tainted.Description"), 800, "CalamityMod/UI/CalamitasEnchantments/CurseIcon_Tainted", - item => item.useTime = item.useAnimation = 25, + item => item.useAnimation = item.useTime = 25, (Player player) => { if (Main.gameMenu) diff --git a/Utilities/DrawingUtils.cs b/Utilities/DrawingUtils.cs index 0b541aa8ec..fc1e6af50b 100644 --- a/Utilities/DrawingUtils.cs +++ b/Utilities/DrawingUtils.cs @@ -52,7 +52,7 @@ namespace CalamityMod /// If mode 1 is used, this controls the loop increment. Set it to more than 1 to skip afterimages. /// The texture to draw. Set to null to draw the projectile's own loaded texture. /// If false, the afterimages will be centered on the projectile's position instead of its own center. - public static void DrawAfterimagesCentered(Projectile proj, int mode, Color lightColor, int typeOneIncrement = 1, Texture2D texture = null, bool drawCentered = true) + public static void DrawAfterimagesCentered(Projectile proj, int mode, Color lightColor, int typeOneIncrement = 1, Texture2D texture = null, bool drawCentered = true, bool shrink = false) { if (texture is null) texture = TextureAssets.Projectile[proj.type].Value; @@ -85,8 +85,9 @@ namespace CalamityMod { Vector2 drawPos = proj.oldPos[i] + centerOffset - Main.screenPosition + new Vector2(0f, proj.gfxOffY); // DO NOT REMOVE THESE "UNNECESSARY" FLOAT CASTS. THIS WILL BREAK THE AFTERIMAGES. - Color color = alphaColor * ((float)(proj.oldPos.Length - i) / (float)proj.oldPos.Length); - Main.spriteBatch.Draw(texture, drawPos, new Rectangle?(rectangle), color, rotation, origin, scale, spriteEffects, 0f); + float interpolant = ((float)(proj.oldPos.Length - i) / (float)proj.oldPos.Length); + Color color = alphaColor * interpolant; + Main.spriteBatch.Draw(texture, drawPos, new Rectangle?(rectangle), color, rotation, origin, shrink ? scale * interpolant : scale, spriteEffects, 0f); } break; @@ -102,13 +103,14 @@ namespace CalamityMod while (k < afterimageCount) { Vector2 drawPos = proj.oldPos[k] + centerOffset - Main.screenPosition + new Vector2(0f, proj.gfxOffY); + float interpolant = ((float)(proj.oldPos.Length - k) / (float)proj.oldPos.Length); // DO NOT REMOVE THESE "UNNECESSARY" FLOAT CASTS EITHER. if (k > 0) { float colorMult = (float)(afterimageCount - k); drawColor *= colorMult / afterimageColorCount; } - Main.spriteBatch.Draw(texture, drawPos, new Rectangle?(rectangle), drawColor, rotation, origin, scale, spriteEffects, 0f); + Main.spriteBatch.Draw(texture, drawPos, new Rectangle?(rectangle), drawColor, rotation, origin, shrink ? scale * interpolant : scale, spriteEffects, 0f); k += increment; } break; @@ -123,8 +125,10 @@ namespace CalamityMod Vector2 drawPos = proj.oldPos[i] + centerOffset - Main.screenPosition + new Vector2(0f, proj.gfxOffY); // DO NOT REMOVE THESE "UNNECESSARY" FLOAT CASTS. THIS WILL BREAK THE AFTERIMAGES. - Color color = alphaColor * ((float)(proj.oldPos.Length - i) / (float)proj.oldPos.Length); - Main.spriteBatch.Draw(texture, drawPos, new Rectangle?(rectangle), color, afterimageRot, origin, scale, sfxForThisAfterimage, 0f); + float interpolant = ((float)(proj.oldPos.Length - i) / (float)proj.oldPos.Length); + Color color = alphaColor * interpolant; + + Main.spriteBatch.Draw(texture, drawPos, new Rectangle?(rectangle), color, afterimageRot, origin, shrink ? scale * interpolant : scale, sfxForThisAfterimage, 0f); } break; diff --git a/Utilities/NPCDebuffs.cs b/Utilities/NPCDebuffs.cs index baab6dd584..0fc8ef0947 100644 --- a/Utilities/NPCDebuffs.cs +++ b/Utilities/NPCDebuffs.cs @@ -254,6 +254,7 @@ namespace CalamityMod { ModContent.NPCType(), new(GeneralImmunityStatus.None, new int[] { ModContent.BuffType() }) }, { ModContent.NPCType(), new(GeneralImmunityStatus.None, new int[] { ModContent.BuffType() }) }, + { ModContent.NPCType(), new(GeneralImmunityStatus.None, new int[] { ModContent.BuffType() }) }, { ModContent.NPCType(), holy }, { ModContent.NPCType(), holy }, diff --git a/Walls/AstralDirtWall.cs b/Walls/AstralDirtWall.cs index 96a302952f..ae80a7a4dd 100644 --- a/Walls/AstralDirtWall.cs +++ b/Walls/AstralDirtWall.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Walls { // TODO -- Change this dust to be one more befitting Astral Dirt. DustType = DustID.Shadowflame; + WallID.Sets.Conversion.Dirt[Type] = true; AddMapEntry(new Color(26, 22, 32)); } diff --git a/Walls/AstralDirtWallSafe.cs b/Walls/AstralDirtWallSafe.cs index 90f3544a23..ad181c7504 100644 --- a/Walls/AstralDirtWallSafe.cs +++ b/Walls/AstralDirtWallSafe.cs @@ -13,6 +13,7 @@ namespace CalamityMod.Walls // TODO -- Change this dust to be one more befitting Astral Dirt. DustType = DustID.Shadowflame; Main.wallHouse[Type] = true; + WallID.Sets.Conversion.Dirt[Type] = true; AddMapEntry(new Color(26, 22, 32)); } diff --git a/Walls/AstralIceWall.cs b/Walls/AstralIceWall.cs index 400e8a51af..4c0802f5a5 100644 --- a/Walls/AstralIceWall.cs +++ b/Walls/AstralIceWall.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Walls { // TODO -- Change this dust to be one more befitting Astral Ice. DustType = DustID.Shadowflame; + WallID.Sets.Conversion.Ice[Type] = true; AddMapEntry(new Color(83, 76, 92)); } diff --git a/Walls/AstralIceWallSafe.cs b/Walls/AstralIceWallSafe.cs index 7edf50c851..cd32b73a99 100644 --- a/Walls/AstralIceWallSafe.cs +++ b/Walls/AstralIceWallSafe.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Walls // TODO -- Change this dust to be one more befitting Astral Ice. Main.wallHouse[Type] = true; DustType = DustID.Shadowflame; - + WallID.Sets.Conversion.Ice[Type] = true; AddMapEntry(new Color(83, 76, 92)); } diff --git a/Walls/AstralSnowWall.cs b/Walls/AstralSnowWall.cs index 0b0d852f7f..586060389a 100644 --- a/Walls/AstralSnowWall.cs +++ b/Walls/AstralSnowWall.cs @@ -1,5 +1,6 @@  using Microsoft.Xna.Framework; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Walls { @@ -8,7 +9,7 @@ namespace CalamityMod.Walls public override void SetStaticDefaults() { DustType = ModContent.DustType(); - + WallID.Sets.Conversion.Snow[Type] = true; AddMapEntry(new Color(135, 145, 149)); } diff --git a/Walls/AstralSnowWallSafe.cs b/Walls/AstralSnowWallSafe.cs index 5089358e68..933c29befd 100644 --- a/Walls/AstralSnowWallSafe.cs +++ b/Walls/AstralSnowWallSafe.cs @@ -1,5 +1,6 @@ using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Walls { @@ -10,7 +11,7 @@ namespace CalamityMod.Walls { DustType = ModContent.DustType(); Main.wallHouse[Type] = true; - + WallID.Sets.Conversion.Snow[Type] = true; AddMapEntry(new Color(135, 145, 149)); } diff --git a/World/CalamityWorld.cs b/World/CalamityWorld.cs index ae21089ff5..731bba40fd 100644 --- a/World/CalamityWorld.cs +++ b/World/CalamityWorld.cs @@ -16,7 +16,6 @@ namespace CalamityMod.World public static class CalamityWorld { #region Vars - public static int ArmoredDiggerSpawnCooldown = 0; public static int MoneyStolenByBandit = 0; public static int Reforges; public static bool IsWorldAfterDraedonUpdate = false; diff --git a/World/SunkenSea.cs b/World/SunkenSea.cs index 9459d720a1..4be60296e5 100644 --- a/World/SunkenSea.cs +++ b/World/SunkenSea.cs @@ -4,9 +4,8 @@ using CalamityMod.Tiles.SunkenSea; using CalamityMod.Tiles.SunkenSea.Ambient; using CalamityMod.Walls; using Microsoft.Xna.Framework; +using ReLogic.Threading; using Terraria; -using Terraria.DataStructures; -using Terraria.GameContent.Generation; using Terraria.ID; using Terraria.ModLoader; using Terraria.WorldBuilding; @@ -29,132 +28,368 @@ namespace CalamityMod.World { int biomeSize = 250 + (Main.maxTilesX / 180); - //place a box of circles to serve as the main "area" for the biome - for (int X = startPosX - biomeSize; X <= startPosX + biomeSize; X += 25) + // + // Places a trapezoid of circles to serve as the main area for the biome. + // + const float steepness = 15f; + static float trapezoidLateralSteep(float x) { - for (int Y = startPosY - 50; Y <= startPosY + 50; Y += 20) - { - ShapeData circle = new ShapeData(); - GenAction blotchMod = new Modifiers.Blotches(2, 0.4); - - WorldUtils.Gen(new Point(X, Y), new Shapes.Circle(25), Actions.Chain(new GenAction[] - { - blotchMod.Output(circle) - })); - WorldUtils.Gen(new Point(X, Y), new ModShapes.All(circle), Actions.Chain(new GenAction[] - { - new Actions.Clear(), - new Actions.PlaceTile((ushort)ModContent.TileType()) - })); - } + if (x <= 1f / steepness) + return steepness * x; + else if (x > 1f / steepness && x < 1f - 1f / steepness) + return 1f; + else + return -steepness * x + steepness; } + FastParallel.For(startPosX - biomeSize - 20, startPosX + biomeSize + 20, (start, end, _) => + { + for (int X = start; X <= end; X += 15) + { + float height = MathHelper.Lerp( + startPosY + 50, + startPosY - 35, + trapezoidLateralSteep(Utils.GetLerpValue(startPosX - biomeSize - 20, startPosX + biomeSize + 20, X))); + + for (int Y = startPosY + 50; Y >= height; Y -= 10) + { + ShapeData circle = new ShapeData(); + WorldUtils.Gen(new Point(X, Y), new Shapes.Circle(30), Actions.Chain(new GenAction[] + { + new Modifiers.RadialDither(1, 30).Output(circle), + new Modifiers.Blotches().Output(circle), + })); + WorldUtils.Gen(new Point(X, Y), new ModShapes.All(circle), new Actions.SetTile((ushort)ModContent.TileType())); + } + } + }); + + // + // Makes the bottom borders of the Timeless Shores curved downwards. + // + const int totalCuveDepth = 40; + FastParallel.For(startPosX - biomeSize - 20, startPosX - biomeSize + 200, (start, end, _) => + { + for (int x = start; x <= end; x += 10) + { + int curveDepth = (int)MathHelper.Lerp( + totalCuveDepth, + 0f, + MathF.Sqrt(Utils.GetLerpValue(startPosX - biomeSize - 17, startPosX - biomeSize + 200, x, true))); + + for (int y = startPosY + 50; y <= startPosY + 50 + curveDepth; y += 5) + { + ShapeData circle = new(); + WorldUtils.Gen(new Point(x, y), new Shapes.Circle(30), Actions.Chain(new GenAction[] + { + new Modifiers.RadialDither(1, 30).Output(circle), + new Modifiers.Blotches().Output(circle), + })); + WorldUtils.Gen(new Point(x, y), new ModShapes.All(circle), new Actions.SetTile((ushort)ModContent.TileType())); + } + } + }); + FastParallel.For(startPosX + biomeSize - 200, startPosX + biomeSize + 20, (start, end, _) => + { + for (int x = start; x <= end; x += 5) + { + int curveDepth = (int)MathHelper.Lerp( + totalCuveDepth, + 0f, + MathF.Sqrt(Utils.GetLerpValue(startPosX + biomeSize + 20, startPosX + biomeSize - 200, x, true))); + + for (int y = startPosY + 50; y <= startPosY + 50 + curveDepth; y += 5) + { + ShapeData circle = new(); + WorldUtils.Gen(new Point(x, y), new Shapes.Circle(30), Actions.Chain(new GenAction[] + { + new Modifiers.RadialDither(1, 30).Output(circle), + new Modifiers.Blotches().Output(circle), + })); + WorldUtils.Gen(new Point(x, y), new ModShapes.All(circle), new Actions.SetTile((ushort)ModContent.TileType())); + } + } + }); //clear a smaller square out of the center where the biomes stuff will be - for (int X = startPosX - biomeSize + 35; X <= startPosX + biomeSize - 35; X++) + FastParallel.For(startPosX - biomeSize + 35, startPosX + biomeSize - 35, (start, end, _) => { - for (int Y = startPosY - 50; Y <= startPosY + 50; Y++) + for (int X = start; X <= end; X++) { - ShapeData circle = new ShapeData(); - GenAction blotchMod = new Modifiers.Blotches(2, 0.4); - - WorldUtils.Gen(new Point(X, Y), new Shapes.Circle(WorldGen.genRand.Next(2, 5)), Actions.Chain(new GenAction[] + for (int Y = startPosY - 65; Y <= startPosY + 50; Y++) { - blotchMod.Output(circle) - })); - WorldUtils.Gen(new Point(X, Y), new ModShapes.All(circle), Actions.Chain(new GenAction[] - { - new Actions.Clear() - })); + ShapeData circle = new ShapeData(); + GenAction blotchMod = new Modifiers.Blotches(2, 0.4); + + WorldUtils.Gen(new Point(X, Y), new Shapes.Circle(WorldGen.genRand.Next(2, 5)), Actions.Chain(new GenAction[] + { + blotchMod.Output(circle) + })); + WorldUtils.Gen(new Point(X, Y), new ModShapes.All(circle), Actions.Chain(new GenAction[] + { + new Actions.Clear() + })); + } } - } + }); - //place little islands - for (int MoundX = startPosX - biomeSize + 35; MoundX <= startPosX + biomeSize - 35; MoundX += WorldGen.genRand.Next(60, 120)) + // + // Places slopes at the sides of the shores to actually make shores. + // + FastParallel.For(startPosX - biomeSize + 20, startPosX - biomeSize + 200, (start, end, _) => { - int MoundY = startPosY + 60; - - ShapeData mound = new ShapeData(); - GenAction blotchMod = new Modifiers.Blotches(2, 0.4); - WorldUtils.Gen(new Point(MoundX, MoundY), new Shapes.Mound(30, 45), Actions.Chain(new GenAction[] - { - blotchMod.Output(mound) - })); - WorldUtils.Gen(new Point(MoundX, MoundY), new ModShapes.All(mound), Actions.Chain(new GenAction[] - { - new Actions.Clear(), new Actions.PlaceTile((ushort)ModContent.TileType()) - })); - - //place a wall pillar above an island - PlaceShoresWallPillar(startPosY, MoundX); - } - - //clear the tops off of the mounds so they have flat surfaces the player can walk on - for (int MoundClearX = startPosX - biomeSize + 37; MoundClearX <= startPosX + biomeSize - 37; MoundClearX++) - { - for (int MoundClearY = startPosY - 35; MoundClearY <= startPosY + 35; MoundClearY++) + for (int moundX = start; moundX <= end; moundX += 20) { - WorldGen.KillTile(MoundClearX, MoundClearY); + ShapeData mound = new(); + GenAction blotchMod = new Modifiers.Blotches().Output(mound); + int moundY = startPosY + 60; + int moundHeight = (int)MathHelper.Lerp(60f, 5f, MathF.Sqrt(Utils.GetLerpValue(startPosX - biomeSize + 27, startPosX - biomeSize + 200, moundX))); + + WorldUtils.Gen(new Point(moundX, moundY), new Shapes.Mound(30, moundHeight), blotchMod); + WorldUtils.Gen(new Point(moundX, moundY), new ModShapes.All(mound), new Actions.SetTile((ushort)ModContent.TileType())); } - } + }); + FastParallel.For(startPosX + biomeSize - 200, startPosX + biomeSize - 20, (start, end, _) => + { + for (int moundX = start; moundX <= end; moundX += 20) + { + ShapeData mound = new(); + GenAction blotchMod = new Modifiers.Blotches().Output(mound); + int moundY = startPosY + 60; + int moundHeight = (int)MathHelper.Lerp(60f, 5f, MathF.Sqrt(Utils.GetLerpValue(startPosX + biomeSize - 27, startPosX + biomeSize - 200, moundX))); + + WorldUtils.Gen(new Point(moundX, moundY), new Shapes.Mound(30, moundHeight), blotchMod); + WorldUtils.Gen(new Point(moundX, moundY), new ModShapes.All(mound), new Actions.SetTile((ushort)ModContent.TileType())); + } + }); + + // + // Makes a large platform in the middle of the Timeless Shores. + // + const int platformSize = 130; + const int platformHeight = 35; // Remember that because of Terraria's coordinate system, making it lower actually makes it higher. + const int platformDepth = 20; // How deep it goes. Like above, the higher it is, the lower it goes. + FastParallel.For(startPosX - platformSize / 2, startPosX + platformSize / 2, (start, end, _) => + { + for (int platformX = start; platformX <= end; platformX += 5) + { + // This makes the "stem" of the platform be thinner towards the base and then expand on the top. + int thickness = (int)(MathF.Pow(CalamityUtils.Convert01To010(Utils.GetLerpValue(startPosX - platformSize / 2, startPosX + platformSize / 2, platformX)), 3f) * platformDepth) + platformHeight; + + for (int platformY = startPosY + platformHeight; platformY <= startPosY + thickness; platformY++) + { + WorldUtils.Gen(new Point(platformX, platformY), new Shapes.Circle(5), Actions.Chain(new GenAction[] + { + new Actions.Clear(), // Clears all tiles and walls. + new Actions.PlaceTile((ushort)ModContent.TileType()) // Places tiles. + })); + } + } + }); + FastParallel.For(startPosX - platformSize / 2, startPosX + platformSize / 2, (start, end, _) => + { + for (int x = start; x <= end; x++) + { + float interpolator = CalamityUtils.Convert01To010(Utils.GetLerpValue(startPosX - platformSize / 2, startPosX + platformSize / 2, x, true)); + int elevation = (int)MathHelper.Lerp(4f, 1f, interpolator); + WorldUtils.Gen(new Point(x, startPosY + platformHeight - 7), new Shapes.Circle(elevation), Actions.Chain(new GenAction[] { new Actions.Clear(), })); + } + }); + + // + // Makes a hole into the actual Sunken Sea at the botoom-left and bottom-right of the middle platform of the Timeless Shores. + // + const int furthestDistanceFromCenter = 80; + const int shortestDistanceFromCenter = 25; + const int holeStart = 53; + const int holeDepth = 37; + FastParallel.For(startPosX - furthestDistanceFromCenter, startPosX - shortestDistanceFromCenter, (start, end, _) => + { + for (int holeX = start; holeX <= end; holeX++) + { + for (int holeY = startPosY + holeStart; holeY <= startPosY + holeStart + holeDepth; holeY += 3) + { + ShapeData circle = new(); + + // As the hole gets deeper, we want the holes to be bigger and more blurry, so it's not so monotonous. + int sizeIncrement = (int)Utils.Remap(holeY, startPosY + holeStart, startPosY + holeStart + holeDepth, 1, 5); + + GenAction dither = new Modifiers.RadialDither(2 * sizeIncrement, 5 * sizeIncrement); + + // We set the shape to a circle with radial dithering. + WorldUtils.Gen(new Point(holeX, holeY), new Shapes.Circle(WorldGen.genRand.Next(4, 10) * sizeIncrement), Actions.Chain(new GenAction[] + { + dither.Output(circle) + })); + + WorldUtils.Gen(new Point(holeX, holeY), new ModShapes.All(circle), Actions.Chain(new GenAction[] + { + new Actions.ClearTile(), // The shape removes tiles. + new Actions.SetLiquid() // The shape adds liquid (Default to max water). + })); + } + } + }); + FastParallel.For(startPosX + shortestDistanceFromCenter, startPosX + furthestDistanceFromCenter, (start, end, _) => + { + for (int holeX = start; holeX <= end; holeX++) + { + for (int holeY = startPosY + holeStart; holeY <= startPosY + holeStart + holeDepth; holeY += 3) + { + ShapeData circle = new(); + + // As the hole gets deeper, we want the holes to be bigger and more blurry, so it's not so monotonous. + int sizeIncrement = (int)Utils.Remap(holeY, startPosY + holeStart, startPosY + holeStart + holeDepth, 1, 5); + + GenAction dither = new Modifiers.RadialDither(2 * sizeIncrement, 5 * sizeIncrement); + + // We set the shape to a circle with radial dithering. + WorldUtils.Gen(new Point(holeX, holeY), new Shapes.Circle(WorldGen.genRand.Next(4, 10) * sizeIncrement), Actions.Chain(new GenAction[] + { + dither.Output(circle) + })); + + WorldUtils.Gen(new Point(holeX, holeY), new ModShapes.All(circle), Actions.Chain(new GenAction[] + { + new Actions.ClearTile(), // The shape removes tiles. + new Actions.SetLiquid() // The shape adds liquid (Default to max water). + })); + } + } + }); //place water below the clear barrier for the islands so that theres water inbetween them - for (int WaterX = startPosX - biomeSize + 35; WaterX <= startPosX + biomeSize - 35; WaterX++) + FastParallel.For(startPosX - biomeSize + 35, startPosX + biomeSize - 35, (start, end, _) => { - for (int WaterY = startPosY + 37; WaterY <= startPosY + 50; WaterY++) + for (int WaterX = start; WaterX <= end; WaterX++) { - Main.tile[WaterX, WaterY].Get().LiquidType = LiquidID.Water; - Main.tile[WaterX, WaterY].LiquidAmount = byte.MaxValue; + for (int WaterY = startPosY + 37; WaterY <= startPosY + 60; WaterY++) + { + Main.tile[WaterX, WaterY].Get().LiquidType = LiquidID.Water; + Main.tile[WaterX, WaterY].LiquidAmount = byte.MaxValue; + } } - } + }); //slope tiles - for (int X = startPosX - biomeSize; X <= startPosX + biomeSize; X++) + FastParallel.For(startPosX - biomeSize, startPosX + biomeSize, (start, end, _) => { - for (int Y = startPosY - 50; Y <= startPosY + 50; Y++) + for (int X = start; X <= end; X++) { - Tile.SmoothSlope(X, Y); + for (int Y = startPosY - 50; Y <= startPosY + 50; Y++) + { + Tile.SmoothSlope(X, Y); + } } - } + }); //place layer of sand on valid runestone blocks - for (int X = startPosX - biomeSize; X <= startPosX + biomeSize; X++) + FastParallel.For(startPosX - biomeSize, startPosX + biomeSize, (start, end, _) => { - for (int Y = startPosY - 50; Y <= startPosY + 50; Y++) + for (int X = start; X <= end; X++) { - bool canPlaceSand = false; - - if (Main.tile[X, Y].TileType == ModContent.TileType() && !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y - 2].HasTile && - !Main.tile[X, Y - 3].HasTile && !Main.tile[X, Y - 4].HasTile && !Main.tile[X, Y - 5].HasTile) + for (int Y = startPosY - 50; Y <= startPosY + 50; Y++) { - canPlaceSand = true; - } + bool canPlaceSand = false; - if (canPlaceSand) - { - PlaceSand(X, Y, 5, ModContent.TileType()); + if (Main.tile[X, Y].TileType == ModContent.TileType() && !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y - 2].HasTile && + !Main.tile[X, Y - 3].HasTile && !Main.tile[X, Y - 4].HasTile && !Main.tile[X, Y - 5].HasTile) + { + canPlaceSand = true; + } + + if (canPlaceSand) + { + PlaceSand(X, Y, 5, ModContent.TileType()); + } } } - } - } + }); - //places a pillar of walls along the height of the timeless shores biome - public static void PlaceShoresWallPillar(int startPosY, int XPosition) - { - for (int Y = startPosY - 55; Y <= startPosY + 50; Y++) + // + // Generates pillars made out of walls at random points in the Timeless Shores. + // + FastParallel.For(startPosX - biomeSize, startPosX + biomeSize, (start, end, _) => { - int RandomX = + WorldGen.genRand.Next(-8, 8); + for (int wallPillarX = start; wallPillarX <= end; wallPillarX += 1000) + { + int randomDisplacementX = WorldGen.genRand.Next(-10, 30); - ShapeData circle = new ShapeData(); - GenAction blotchMod = new Modifiers.Blotches(2, 0.4); - WorldUtils.Gen(new Point(XPosition + RandomX, Y), new Shapes.Circle(WorldGen.genRand.Next(3, 7)), Actions.Chain(new GenAction[] + for (int wallPillarY = startPosY - 75; wallPillarY <= startPosY + 70; wallPillarY += 10) + { + // Along the height of the pillar, it becomes shorter the more closer to the center we get. + int pillarWidth = (int)(CalamityUtils.Convert01To010(Utils.GetLerpValue(startPosY - 75, startPosY + 50, wallPillarY)) * 25); + + ShapeData rectangle = new ShapeData(); + GenAction blotchFilter = new Modifiers.Blotches(2, 0.4); + GenAction ditherFilter = new Modifiers.Dither(Math.Min(Utils.GetLerpValue(startPosY + 40, startPosY + 70, wallPillarY) + 0.25, 1)); + + WorldUtils.Gen(new Point(randomDisplacementX + wallPillarX + pillarWidth / 2, wallPillarY), new Shapes.Rectangle(25 - pillarWidth + 3, 12), Actions.Chain(new GenAction[] + { + ditherFilter.Output(rectangle), // Applies a dithering filter to the rectangle. + blotchFilter.Output(rectangle), // Applies a blotch filter to the rectangle. + })); + + WorldUtils.Gen(new Point(randomDisplacementX + wallPillarX + pillarWidth / 2, wallPillarY), new ModShapes.All(rectangle), Actions.Chain(new GenAction[] + { + new Actions.PlaceWall((ushort)ModContent.WallType()) // The shape places walls. + })); + } + } + }); + + // + // Makes the transition area to the Timeless Shores. + // Replaces tiles, walls, and places some water spots. + // + FastParallel.For(startPosX - biomeSize - 25, startPosX + biomeSize + 25, (start, end, _) => + { + for (int x = start; x <= end; x += 20) { - blotchMod.Output(circle) - })); - WorldUtils.Gen(new Point(XPosition + RandomX, Y), new ModShapes.All(circle), Actions.Chain(new GenAction[] - { - new Actions.PlaceWall((ushort)ModContent.WallType()) - })); - } + for (int y = startPosY - 70; y >= startPosY - 320; y -= 15) + { + float interpolator = Utils.GetLerpValue(startPosY - 90, startPosY - 320, y, true); + float ditherStrength = MathHelper.Lerp(0f, 0.95f, interpolator); + + WorldUtils.Gen(new Point(x, y), new Shapes.Circle(15), Actions.Chain(new GenAction[] + { + new Modifiers.OnlyTiles(TileID.Sand, TileID.HardenedSand), + new Modifiers.Dither(ditherStrength), + new Actions.ClearTile(), + new Actions.PlaceTile((ushort)ModContent.TileType()), + })); + + WorldUtils.Gen(new Point(x, y), new Shapes.Circle(15), Actions.Chain(new GenAction[] + { + new Modifiers.OnlyWalls(WallID.Sandstone, WallID.HardenedSand), + new Modifiers.Dither(ditherStrength), + new Actions.ClearWall(), + new Actions.PlaceWall((ushort)ModContent.WallType()), + })); + + interpolator = Utils.GetLerpValue(startPosY - 90, startPosY - 220, y, true); + ditherStrength = MathHelper.Lerp(0f, 0.95f, interpolator); + WorldUtils.Gen(new Point(x, y), new Shapes.Circle(15), Actions.Chain(new GenAction[] + { + new Modifiers.OnlyTiles(TileID.Sandstone), + new Modifiers.Dither(ditherStrength), + new Actions.ClearTile(), + new Actions.PlaceTile((ushort)ModContent.TileType()), + })); + + if (Main.tile[x, y].Get().LiquidType == LiquidID.Lava) + WorldUtils.Gen(new Point(x, y), new Shapes.Rectangle(5, 5), new Actions.SetLiquid(LiquidID.Lava, 0)); + + if (WorldGen.genRand.NextBool(5) && y < startPosY - 100) + { + WorldUtils.Gen(new Point(x, y), new Shapes.Circle(WorldGen.genRand.Next(5, 7)), Actions.Chain(new GenAction[] + { + new Modifiers.IsNotSolid().Output(new()), + new Actions.SetLiquid(), + })); + } + } + } + }); } //sides of the sunken sea (radiant reefs) @@ -182,60 +417,63 @@ namespace CalamityMod.World Vector2 bottomFoci = center + fociOffset; //first, place a basalt barrier on the left and right of the biome - for (int X = origin.X - biomeSize - 3; X <= origin.X + biomeSize + 3; X++) + FastParallel.For(origin.X - biomeSize - 3, origin.X + biomeSize + 3, (start, end, _) => { - for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++) + for (int X = start; X <= end; X++) { - if (CheckInBiomeArea(new Point(X, Y), topFoci, bottomFoci, constant, center, out float dist, Y < origin.Y)) + for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++) { - float percent = dist / constant; - float blurPercent = 0.99f; - - if (percent > blurPercent) + if (CheckInBiomeArea(new Point(X, Y), topFoci, bottomFoci, constant, center, out float dist, Y < origin.Y)) { - if (Y > origin.Y - 60) - { - if (LeftSideBarrier) - { - if (X <= origin.X && Main.tile[X - 40, Y].TileType != ModContent.TileType()) - { - ShapeData circle = new ShapeData(); - GenAction blotchMod = new Modifiers.Blotches(2, 0.4); + float percent = dist / constant; + float blurPercent = 0.99f; - WorldUtils.Gen(new Point(X - 40, Y), new Shapes.Circle(60), Actions.Chain(new GenAction[] - { - blotchMod.Output(circle) - })); - WorldUtils.Gen(new Point(X - 40, Y), new ModShapes.All(circle), Actions.Chain(new GenAction[] - { - new Actions.Clear(), - new Actions.PlaceTile((ushort)ModContent.TileType()) - })); - } - } - else + if (percent > blurPercent) + { + if (Y > origin.Y - 60) { - if (X >= origin.X && Main.tile[X + 40, Y].TileType != ModContent.TileType()) + if (LeftSideBarrier) { - ShapeData circle = new ShapeData(); - GenAction blotchMod = new Modifiers.Blotches(2, 0.4); - - WorldUtils.Gen(new Point(X + 40, Y), new Shapes.Circle(60), Actions.Chain(new GenAction[] + if (X <= origin.X && Main.tile[X - 40, Y - 25].TileType != ModContent.TileType()) { - blotchMod.Output(circle) - })); - WorldUtils.Gen(new Point(X + 40, Y), new ModShapes.All(circle), Actions.Chain(new GenAction[] + ShapeData circle = new ShapeData(); + GenAction blotchMod = new Modifiers.Blotches(2, 0.4); + + WorldUtils.Gen(new Point(X - 40, Y - 25), new Shapes.Circle(60), Actions.Chain(new GenAction[] + { + blotchMod.Output(circle) + })); + WorldUtils.Gen(new Point(X - 40, Y - 25), new ModShapes.All(circle), Actions.Chain(new GenAction[] + { + new Actions.Clear(), + new Actions.PlaceTile((ushort)ModContent.TileType()) + })); + } + } + else + { + if (X >= origin.X && Main.tile[X + 40, Y - 25].TileType != ModContent.TileType()) { - new Actions.Clear(), - new Actions.PlaceTile((ushort)ModContent.TileType()) - })); + ShapeData circle = new ShapeData(); + GenAction blotchMod = new Modifiers.Blotches(2, 0.4); + + WorldUtils.Gen(new Point(X + 40, Y - 25), new Shapes.Circle(60), Actions.Chain(new GenAction[] + { + blotchMod.Output(circle) + })); + WorldUtils.Gen(new Point(X + 40, Y - 25), new ModShapes.All(circle), Actions.Chain(new GenAction[] + { + new Actions.Clear(), + new Actions.PlaceTile((ushort)ModContent.TileType()) + })); + } } } } } } } - } + }); //generate the actual caverns for (int X = origin.X - biomeSize - 3; X <= origin.X + biomeSize + 3; X++) @@ -295,91 +533,100 @@ namespace CalamityMod.World } //cleanup - for (int X = origin.X - biomeSize - 3; X <= origin.X + biomeSize + 3; X++) + FastParallel.For(origin.X - biomeSize - 3, origin.X + biomeSize + 3, (start, end, _) => { - for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++) + for (int X = start; X <= end; X++) { - if (CheckInBiomeArea(new Point(X, Y), topFoci, bottomFoci, constant, center, out float dist, Y < origin.Y)) + for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++) { - //clean tiles that are sticking out (aka tiles only attached to one tile on one side) - bool OnlyRight = !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile; - bool OnlyLeft = !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X + 1, Y].HasTile; - bool OnlyDown = !Main.tile[X, Y - 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile; - bool OnlyUp = !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile; - - if (OnlyRight || OnlyLeft || OnlyDown || OnlyUp) + if (CheckInBiomeArea(new Point(X, Y), topFoci, bottomFoci, constant, center, out float dist, Y < origin.Y)) { - WorldGen.KillTile(X, Y); - } + //clean tiles that are sticking out (aka tiles only attached to one tile on one side) + bool OnlyRight = !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile; + bool OnlyLeft = !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X + 1, Y].HasTile; + bool OnlyDown = !Main.tile[X, Y - 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile; + bool OnlyUp = !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile; - //kill random single floating tiles - if (!Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile) - { - WorldGen.KillTile(X, Y); + if (OnlyRight || OnlyLeft || OnlyDown || OnlyUp) + { + WorldGen.KillTile(X, Y); + } + + //kill random single floating tiles + if (!Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile) + { + WorldGen.KillTile(X, Y); + } } } } - } + }); //place layer of sand blocks on valid surfaces - for (int X = origin.X - biomeSize - 3; X <= origin.X + biomeSize + 3; X++) + FastParallel.For(origin.X - biomeSize - 3, origin.X + biomeSize + 3, (start, end, _) => { - for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++) + for (int X = start; X <= end; X++) { - if (CheckInBiomeArea(new Point(X, Y), topFoci, bottomFoci, constant, center, out float dist, Y < origin.Y)) + for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++) { - bool canPlaceSand = false; - - //place sand clumps on top of exposed shellstone - if (Main.tile[X, Y].TileType == ModContent.TileType() && !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y - 2].HasTile && - !Main.tile[X, Y - 3].HasTile && !Main.tile[X, Y - 4].HasTile && !Main.tile[X, Y - 5].HasTile) + if (CheckInBiomeArea(new Point(X, Y), topFoci, bottomFoci, constant, center, out float dist, Y < origin.Y)) { - canPlaceSand = true; - } + bool canPlaceSand = false; - if (canPlaceSand) - { - PlaceSand(X, Y, 5, ModContent.TileType()); + //place sand clumps on top of exposed shellstone + if (Main.tile[X, Y].TileType == ModContent.TileType() && !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y - 2].HasTile && + !Main.tile[X, Y - 3].HasTile && !Main.tile[X, Y - 4].HasTile && !Main.tile[X, Y - 5].HasTile) + { + canPlaceSand = true; + } + + if (canPlaceSand) + { + PlaceSand(X, Y, 5, ModContent.TileType()); + } } } } - } + }); //cleanup again - for (int X = origin.X - biomeSize - 3; X <= origin.X + biomeSize + 3; X++) + FastParallel.For(origin.X - biomeSize - 3, origin.X + biomeSize + 3, (start, end, _) => { - for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++) + for (int X = start; X <= end; X++) { - if (CheckInBiomeArea(new Point(X, Y), topFoci, bottomFoci, constant, center, out float dist, Y < origin.Y)) + for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++) { - //clean tiles that are sticking out (aka tiles only attached to one tile on one side) - bool OnlyRight = !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile; - bool OnlyLeft = !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X + 1, Y].HasTile; - bool OnlyDown = !Main.tile[X, Y - 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile; - bool OnlyUp = !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile; - - if (OnlyRight || OnlyLeft || OnlyDown || OnlyUp) + if (CheckInBiomeArea(new Point(X, Y), topFoci, bottomFoci, constant, center, out float dist, Y < origin.Y)) { - WorldGen.KillTile(X, Y); - } + //clean tiles that are sticking out (aka tiles only attached to one tile on one side) + bool OnlyRight = !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile; + bool OnlyLeft = !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X + 1, Y].HasTile; + bool OnlyDown = !Main.tile[X, Y - 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile; + bool OnlyUp = !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile; - //kill random single floating tiles - if (!Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile) - { - WorldGen.KillTile(X, Y); - } + if (OnlyRight || OnlyLeft || OnlyDown || OnlyUp) + { + WorldGen.KillTile(X, Y); + } - //if any sand is floating, put tiles below it - if (Main.tile[X, Y].TileType == ModContent.TileType() && !Main.tile[X, Y + 1].HasTile) - { - WorldGen.PlaceTile(X, Y + 1, (ushort)ModContent.TileType()); - Main.tile[X, Y].TileType = (ushort)ModContent.TileType(); - } + //kill random single floating tiles + if (!Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile) + { + WorldGen.KillTile(X, Y); + } - Tile.SmoothSlope(X, Y); + //if any sand is floating, put tiles below it + if (Main.tile[X, Y].TileType == ModContent.TileType() && !Main.tile[X, Y + 1].HasTile) + { + WorldGen.PlaceTile(X, Y + 1, (ushort)ModContent.TileType()); + Main.tile[X, Y].TileType = (ushort)ModContent.TileType(); + } + + Tile.SmoothSlope(X, Y); + } } } - } + }); } //middle of the sunken sea (polyp forest) @@ -477,91 +724,100 @@ namespace CalamityMod.World } //cleanup - for (int X = origin.X - biomeSize - 3; X <= origin.X + biomeSize + 3; X++) + FastParallel.For(origin.X - biomeSize - 3, origin.X + biomeSize + 3, (start, end, _) => { - for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++) + for (int X = start; X <= end; X++) { - if (CheckInBiomeArea(new Point(X, Y), topFoci, bottomFoci, constant, center, out float dist, Y < origin.Y)) + for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++) { - //clean tiles that are sticking out (aka tiles only attached to one tile on one side) - bool OnlyRight = !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile; - bool OnlyLeft = !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X + 1, Y].HasTile; - bool OnlyDown = !Main.tile[X, Y - 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile; - bool OnlyUp = !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile; - - if (OnlyRight || OnlyLeft || OnlyDown || OnlyUp) + if (CheckInBiomeArea(new Point(X, Y), topFoci, bottomFoci, constant, center, out float dist, Y < origin.Y)) { - WorldGen.KillTile(X, Y); - } + //clean tiles that are sticking out (aka tiles only attached to one tile on one side) + bool OnlyRight = !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile; + bool OnlyLeft = !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X + 1, Y].HasTile; + bool OnlyDown = !Main.tile[X, Y - 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile; + bool OnlyUp = !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile; - //kill random single floating tiles - if (!Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile) - { - WorldGen.KillTile(X, Y); + if (OnlyRight || OnlyLeft || OnlyDown || OnlyUp) + { + WorldGen.KillTile(X, Y); + } + + //kill random single floating tiles + if (!Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile) + { + WorldGen.KillTile(X, Y); + } } } } - } + }); //place extra tiles - for (int X = origin.X - biomeSize - 3; X <= origin.X + biomeSize + 3; X++) + FastParallel.For(origin.X - biomeSize - 3, origin.X + biomeSize + 3, (start, end, _) => { - for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++) + for (int X = start; X <= end; X++) { - if (CheckInBiomeArea(new Point(X, Y), topFoci, bottomFoci, constant, center, out float dist, Y < origin.Y)) + for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++) { - bool canPlaceSand = false; - - //place sand clumps on top of exposed limestone - if (Main.tile[X, Y].TileType == ModContent.TileType() && !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y - 2].HasTile && - !Main.tile[X, Y - 3].HasTile && !Main.tile[X, Y - 4].HasTile && !Main.tile[X, Y - 5].HasTile) + if (CheckInBiomeArea(new Point(X, Y), topFoci, bottomFoci, constant, center, out float dist, Y < origin.Y)) { - canPlaceSand = true; - } + bool canPlaceSand = false; - if (canPlaceSand) - { - PlaceSand(X, Y, 5, ModContent.TileType()); + //place sand clumps on top of exposed limestone + if (Main.tile[X, Y].TileType == ModContent.TileType() && !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y - 2].HasTile && + !Main.tile[X, Y - 3].HasTile && !Main.tile[X, Y - 4].HasTile && !Main.tile[X, Y - 5].HasTile) + { + canPlaceSand = true; + } + + if (canPlaceSand) + { + PlaceSand(X, Y, 5, ModContent.TileType()); + } } } } - } - + }); + //cleanup again - for (int X = origin.X - biomeSize - 3; X <= origin.X + biomeSize + 3; X++) + FastParallel.For(origin.X - biomeSize - 3, origin.X + biomeSize + 3, (start, end, _) => { - for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++) + for (int X = start; X <= end; X++) { - if (CheckInBiomeArea(new Point(X, Y), topFoci, bottomFoci, constant, center, out float dist, Y < origin.Y)) + for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++) { - //clean tiles that are sticking out (aka tiles only attached to one tile on one side) - bool OnlyRight = !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile; - bool OnlyLeft = !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X + 1, Y].HasTile; - bool OnlyDown = !Main.tile[X, Y - 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile; - bool OnlyUp = !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile; - - if (OnlyRight || OnlyLeft || OnlyDown || OnlyUp) + if (CheckInBiomeArea(new Point(X, Y), topFoci, bottomFoci, constant, center, out float dist, Y < origin.Y)) { - WorldGen.KillTile(X, Y); - } + //clean tiles that are sticking out (aka tiles only attached to one tile on one side) + bool OnlyRight = !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile; + bool OnlyLeft = !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X + 1, Y].HasTile; + bool OnlyDown = !Main.tile[X, Y - 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile; + bool OnlyUp = !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile; - //kill random single floating tiles - if (!Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile) - { - WorldGen.KillTile(X, Y); - } + if (OnlyRight || OnlyLeft || OnlyDown || OnlyUp) + { + WorldGen.KillTile(X, Y); + } - //if any sand is floating, put tiles below it - if (Main.tile[X, Y].TileType == ModContent.TileType() && !Main.tile[X, Y + 1].HasTile) - { - WorldGen.PlaceTile(X, Y + 1, (ushort)ModContent.TileType()); - Main.tile[X, Y].TileType = (ushort)ModContent.TileType(); - } + //kill random single floating tiles + if (!Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile) + { + WorldGen.KillTile(X, Y); + } - Tile.SmoothSlope(X, Y); + //if any sand is floating, put tiles below it + if (Main.tile[X, Y].TileType == ModContent.TileType() && !Main.tile[X, Y + 1].HasTile) + { + WorldGen.PlaceTile(X, Y + 1, (ushort)ModContent.TileType()); + Main.tile[X, Y].TileType = (ushort)ModContent.TileType(); + } + + Tile.SmoothSlope(X, Y); + } } } - } + }); } //bottom of the biome (gleaming burrows) @@ -588,36 +844,39 @@ namespace CalamityMod.World Vector2 bottomFoci = center + fociOffset; //place another barrier so the gleaming burrows doesnt just burst into the gully - for (int X = origin.X - biomeSize - 3; X <= origin.X + biomeSize + 3; X += 10) + FastParallel.For(origin.X - biomeSize - 3, origin.X + biomeSize + 3, (start, end, _) => { - for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y += 2) + for (int X = start; X <= end; X += 10) { - if (CheckInBiomeArea(new Point(X, Y), topFoci, bottomFoci, constant, center, out float dist, true)) + for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y += 2) { - float percent = dist / constant; - float blurPercent = 0.98f; - - if (percent > blurPercent) + if (CheckInBiomeArea(new Point(X, Y), topFoci, bottomFoci, constant, center, out float dist, true)) { - if (Y > origin.Y + 20) + float percent = dist / constant; + float blurPercent = 0.98f; + + if (percent > blurPercent) { - ShapeData circle = new ShapeData(); - GenAction blotchMod = new Modifiers.Blotches(2, 0.4); - - WorldUtils.Gen(new Point(X, Y + 10), new Shapes.Circle(20), Actions.Chain(new GenAction[] + if (Y > origin.Y + 20) { - blotchMod.Output(circle) - })); - WorldUtils.Gen(new Point(X, Y + 10), new ModShapes.All(circle), Actions.Chain(new GenAction[] - { - new Actions.Clear(), - new Actions.PlaceTile((ushort)ModContent.TileType()) - })); + ShapeData circle = new ShapeData(); + GenAction blotchMod = new Modifiers.Blotches(2, 0.4); + + WorldUtils.Gen(new Point(X, Y + 10), new Shapes.Circle(20), Actions.Chain(new GenAction[] + { + blotchMod.Output(circle) + })); + WorldUtils.Gen(new Point(X, Y + 10), new ModShapes.All(circle), Actions.Chain(new GenAction[] + { + new Actions.Clear(), + new Actions.PlaceTile((ushort)ModContent.TileType()) + })); + } } } } } - } + }); //place the gleaming burrows caverns for (int X = origin.X - biomeSize - 3; X <= origin.X + biomeSize + 3; X++) @@ -696,54 +955,60 @@ namespace CalamityMod.World } //cleanup the perlin caves - for (int X = origin.X - biomeSize - 3; X <= origin.X + biomeSize + 3; X++) + FastParallel.For(origin.X - biomeSize - 3, origin.X + biomeSize + 3, (start, end, _) => { - for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++) + for (int X = start; X <= end; X++) { - if (CheckInBiomeArea(new Point(X, Y), topFoci, bottomFoci, constant, center, out float dist, true)) + for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++) { - //clean tiles that are sticking out (aka tiles only attached to one tile on one side) - bool OnlyRight = !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile; - bool OnlyLeft = !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X + 1, Y].HasTile; - bool OnlyDown = !Main.tile[X, Y - 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile; - bool OnlyUp = !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile; - - if (OnlyRight || OnlyLeft || OnlyDown || OnlyUp) + if (CheckInBiomeArea(new Point(X, Y), topFoci, bottomFoci, constant, center, out float dist, true)) { - WorldGen.KillTile(X, Y); - } + //clean tiles that are sticking out (aka tiles only attached to one tile on one side) + bool OnlyRight = !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile; + bool OnlyLeft = !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X + 1, Y].HasTile; + bool OnlyDown = !Main.tile[X, Y - 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile; + bool OnlyUp = !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile; - //kill random single floating tiles - if (!Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile) - { - WorldGen.KillTile(X, Y); + if (OnlyRight || OnlyLeft || OnlyDown || OnlyUp) + { + WorldGen.KillTile(X, Y); + } + + //kill random single floating tiles + if (!Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile) + { + WorldGen.KillTile(X, Y); + } } } } - } + }); //place extra tiles - for (int X = origin.X - biomeSize - 3; X <= origin.X + biomeSize + 3; X++) + FastParallel.For(origin.X - biomeSize - 3, origin.X + biomeSize + 3, (start, end, _) => { - for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++) + for (int X = start; X <= end; X++) { - if (CheckInBiomeArea(new Point(X, Y), topFoci, bottomFoci, constant, center, out float dist, true)) + for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++) { - bool canPlaceSand = false; - - //place sand clumps on top of exposed navystone - if (Main.tile[X, Y].TileType == ModContent.TileType() && !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y - 2].HasTile && !Main.tile[X, Y - 3].HasTile) + if (CheckInBiomeArea(new Point(X, Y), topFoci, bottomFoci, constant, center, out float dist, true)) { - canPlaceSand = true; - } + bool canPlaceSand = false; - if (canPlaceSand) - { - PlaceSand(X, Y, 4, ModContent.TileType()); + //place sand clumps on top of exposed navystone + if (Main.tile[X, Y].TileType == ModContent.TileType() && !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y - 2].HasTile && !Main.tile[X, Y - 3].HasTile) + { + canPlaceSand = true; + } + + if (canPlaceSand) + { + PlaceSand(X, Y, 4, ModContent.TileType()); + } } } } - } + }); //cleanup again, also place geodes for (int X = origin.X - biomeSize - 3; X <= origin.X + biomeSize + 3; X++) @@ -804,7 +1069,7 @@ namespace CalamityMod.World int radius = WorldGen.genRand.Next(30, 45); int RandomX = Main.rand.Next(-25, 25); - + WorldUtils.Gen(new Point(XLeft, Y), new Shapes.Circle(radius), Actions.Chain(new GenAction[] { blotchMod.Output(circle) @@ -831,36 +1096,42 @@ namespace CalamityMod.World } //place blocks of basalt all the way down to hell, here it just places one block and wall so it doesnt hurt preformance - for (int X = startPosX - biomeSize - 25; X <= startPosX + biomeSize + 25; X++) + FastParallel.For(startPosX - biomeSize - 25, startPosX + biomeSize + 25, (start, end, _) => { - for (int Y = startPosY - 30; Y <= Main.maxTilesY - 250; Y++) + for (int X = start; X <= end; X++) { - Main.tile[X, Y].ClearEverything(); - WorldGen.PlaceTile(X, Y, (ushort)ModContent.TileType()); - WorldGen.PlaceWall(X, Y, WallID.LavaUnsafe1); + for (int Y = startPosY - 30; Y <= Main.maxTilesY - 250; Y++) + { + Main.tile[X, Y].ClearEverything(); + WorldGen.PlaceTile(X, Y, (ushort)ModContent.TileType()); + WorldGen.PlaceWall(X, Y, WallID.LavaUnsafe1); + } } - } + }); //place another wall of circles along the bottom of the biome so it doesnt just end unnaturally - for (int X = startPosX - biomeSize; X <= startPosX + biomeSize; X += 20) + FastParallel.For(startPosX - biomeSize, startPosX + biomeSize, (start, end, _) => { - int Y = Main.maxTilesY - 250; - - ShapeData circle = new ShapeData(); - GenAction blotchMod = new Modifiers.Blotches(2, 0.4); - - WorldUtils.Gen(new Point(X, Y), new Shapes.Circle(25), Actions.Chain(new GenAction[] + for (int X = start; X <= end; X += 20) { - blotchMod.Output(circle) - })); + int Y = Main.maxTilesY - 250; - WorldUtils.Gen(new Point(X, Y), new ModShapes.All(circle), Actions.Chain(new GenAction[] - { - new Actions.Clear(), - new Actions.PlaceTile((ushort)ModContent.TileType()), - new Actions.PlaceWall(WallID.LavaUnsafe1) - })); - } + ShapeData circle = new ShapeData(); + GenAction blotchMod = new Modifiers.Blotches(2, 0.4); + + WorldUtils.Gen(new Point(X, Y), new Shapes.Circle(25), Actions.Chain(new GenAction[] + { + blotchMod.Output(circle) + })); + + WorldUtils.Gen(new Point(X, Y), new ModShapes.All(circle), Actions.Chain(new GenAction[] + { + new Actions.Clear(), + new Actions.PlaceTile((ushort)ModContent.TileType()), + new Actions.PlaceWall(WallID.LavaUnsafe1) + })); + } + }); //place caverns and lava for (int X = startPosX - biomeSize - (Main.maxTilesX / 25); X <= startPosX + biomeSize + (Main.maxTilesX / 25); X++) @@ -887,55 +1158,61 @@ namespace CalamityMod.World } //place sand blocks - for (int X = startPosX - biomeSize - (Main.maxTilesX / 25); X <= startPosX + biomeSize + (Main.maxTilesX / 25); X++) + FastParallel.For(startPosX - biomeSize - (Main.maxTilesX / 25), startPosX + biomeSize + (Main.maxTilesX / 25), (start, end, _) => { - for (int Y = startPosY; Y <= Main.maxTilesY - 210; Y++) + for (int X = start; X <= end; X++) { - bool canPlaceSand = false; - - //place sand clumps on top of exposed basalt - if (Main.tile[X, Y].TileType == ModContent.TileType() && !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y - 2].HasTile) + for (int Y = startPosY; Y <= Main.maxTilesY - 210; Y++) { - canPlaceSand = true; - } + bool canPlaceSand = false; - if (canPlaceSand) - { - PlaceSand(X, Y, 3, ModContent.TileType()); + //place sand clumps on top of exposed basalt + if (Main.tile[X, Y].TileType == ModContent.TileType() && !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y - 2].HasTile) + { + canPlaceSand = true; + } + + if (canPlaceSand) + { + PlaceSand(X, Y, 3, ModContent.TileType()); + } } } - } + }); //cleanup - for (int X = startPosX - biomeSize - (Main.maxTilesX / 25); X <= startPosX + biomeSize + (Main.maxTilesX / 25); X++) + FastParallel.For(startPosX - biomeSize - (Main.maxTilesX / 25), startPosX + biomeSize + (Main.maxTilesX / 25), (start, end, _) => { - for (int Y = startPosY; Y <= Main.maxTilesY - 210; Y++) + for (int X = start; X <= end; X++) { - //clean tiles that are sticking out (aka tiles only attached to one tile on one side) - bool OnlyRight = !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile; - bool OnlyLeft = !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X + 1, Y].HasTile; - bool OnlyDown = !Main.tile[X, Y - 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile; - bool OnlyUp = !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile; - - if (OnlyRight || OnlyLeft || OnlyDown || OnlyUp) + for (int Y = startPosY; Y <= Main.maxTilesY - 210; Y++) { - WorldGen.KillTile(X, Y); - } + //clean tiles that are sticking out (aka tiles only attached to one tile on one side) + bool OnlyRight = !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile; + bool OnlyLeft = !Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X + 1, Y].HasTile; + bool OnlyDown = !Main.tile[X, Y - 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile; + bool OnlyUp = !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile; - //kill random single floating tiles - if (!Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile) - { - WorldGen.KillTile(X, Y); - } + if (OnlyRight || OnlyLeft || OnlyDown || OnlyUp) + { + WorldGen.KillTile(X, Y); + } - //if any sand is floating, put tiles below it - if (Main.tile[X, Y].TileType == ModContent.TileType() && !Main.tile[X, Y + 1].HasTile) - { - WorldGen.PlaceTile(X, Y + 1, (ushort)ModContent.TileType()); - Main.tile[X, Y].TileType = (ushort)ModContent.TileType(); + //kill random single floating tiles + if (!Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile) + { + WorldGen.KillTile(X, Y); + } + + //if any sand is floating, put tiles below it + if (Main.tile[X, Y].TileType == ModContent.TileType() && !Main.tile[X, Y + 1].HasTile) + { + WorldGen.PlaceTile(X, Y + 1, (ushort)ModContent.TileType()); + Main.tile[X, Y].TileType = (ushort)ModContent.TileType(); + } } } - } + }); } //cleanup is done separately because for whatever reason it keeps placing water inside of the gully if the cleanup is done before it @@ -1038,7 +1315,7 @@ namespace CalamityMod.World //small navystone piles if (WorldGen.genRand.NextBool(5)) { - ushort[] Piles = new ushort[] { (ushort)ModContent.TileType(), + ushort[] Piles = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(Piles)); @@ -1085,7 +1362,7 @@ namespace CalamityMod.World //small navystone piles if (WorldGen.genRand.NextBool()) { - ushort[] Piles = new ushort[] { (ushort)ModContent.TileType(), + ushort[] Piles = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(Piles)); @@ -1098,7 +1375,7 @@ namespace CalamityMod.World //multi-colored corals if (WorldGen.genRand.NextBool(3)) { - ushort[] ColoredCorals = new ushort[] { (ushort)ModContent.TileType(), + ushort[] ColoredCorals = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(ColoredCorals)); @@ -1129,7 +1406,7 @@ namespace CalamityMod.World //misc corals if (WorldGen.genRand.NextBool()) { - ushort[] MiscCorals = new ushort[] { (ushort)ModContent.TileType(), + ushort[] MiscCorals = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(MiscCorals)); @@ -1151,11 +1428,11 @@ namespace CalamityMod.World //wall corals if (Main.tile[X, Y].TileType == ModContent.TileType()) - { + { if (WorldGen.genRand.NextBool(5) && !Main.tile[X + 1, Y].HasTile) { - ushort[] WallCorals = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), - (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), + ushort[] WallCorals = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), + (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; WorldGen.PlaceTile(X + 2, Y, WorldGen.genRand.Next(WallCorals), true, false, -1, 0); @@ -1163,8 +1440,8 @@ namespace CalamityMod.World if (WorldGen.genRand.NextBool(5) && !Main.tile[X - 1, Y].HasTile) { - ushort[] WallCorals = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), - (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), + ushort[] WallCorals = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), + (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; WorldGen.PlaceTile(X - 2, Y, WorldGen.genRand.Next(WallCorals), true, false, -1, 0); @@ -1273,12 +1550,12 @@ namespace CalamityMod.World (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), }; - + void getAttachedPoints(int x, int y, List points) { Tile t = CalamityUtils.ParanoidTileRetrieval(x, y); Point p = new(x, y); - + if (!blockTileTypes.Contains(t.TileType) || !t.HasTile || points.Count > 75 || points.Contains(p)) { return; @@ -1292,27 +1569,30 @@ namespace CalamityMod.World getAttachedPoints(x, y - 1, points); } - for (int x = 20; x < Main.maxTilesX - 20; x++) + FastParallel.For(20, Main.maxTilesX - 20, (start, end, _) => { - for (int y = 20; y < Main.maxTilesY - 20; y++) + for (int x = start; x < end; x++) { - List chunkPoints = new(); - getAttachedPoints(x, y, chunkPoints); - - int cutoffLimit = 75; - if (chunkPoints.Count >= 1 && chunkPoints.Count < cutoffLimit) + for (int y = 20; y < Main.maxTilesY - 20; y++) { - foreach (Point p in chunkPoints) + List chunkPoints = new(); + getAttachedPoints(x, y, chunkPoints); + + int cutoffLimit = 75; + if (chunkPoints.Count >= 1 && chunkPoints.Count < cutoffLimit) { - WorldUtils.Gen(p, new Shapes.Rectangle(1, 1), Actions.Chain(new GenAction[] + foreach (Point p in chunkPoints) { + WorldUtils.Gen(p, new Shapes.Rectangle(1, 1), Actions.Chain(new GenAction[] + { new Actions.ClearTile(true), new Actions.SetLiquid() - })); + })); + } } } } - } + }); } //method to make sure things only generate in each biome circle