diff --git a/Buffs/Alcohol/CinnamonRollBuff.cs b/Buffs/Alcohol/CinnamonRollBuff.cs index feab7cda1e..734ffd5622 100644 --- a/Buffs/Alcohol/CinnamonRollBuff.cs +++ b/Buffs/Alcohol/CinnamonRollBuff.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Buffs.Alcohol public override void SetDefaults() { DisplayName.SetDefault("Cinnamon Roll"); - Description.SetDefault("Mana regen rate and fire weapon damage boosted, defense reduced"); + Description.SetDefault("Mana regen rate and fire debuff damage boosted, defense reduced"); Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; diff --git a/Buffs/Alcohol/EvergreenGinBuff.cs b/Buffs/Alcohol/EvergreenGinBuff.cs index ba5f17f12b..af8998adff 100644 --- a/Buffs/Alcohol/EvergreenGinBuff.cs +++ b/Buffs/Alcohol/EvergreenGinBuff.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Buffs.Alcohol public override void SetDefaults() { DisplayName.SetDefault("Evergreen Gin"); - Description.SetDefault("Nature-based weapon damage and damage reduction boosted, life regen reduced"); + Description.SetDefault("Sickness and water debuff damage and damage reduction boosted, life regen reduced"); Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; diff --git a/Buffs/Alcohol/FireballBuff.cs b/Buffs/Alcohol/FireballBuff.cs index 54c7c0aa0b..9dfd95e01d 100644 --- a/Buffs/Alcohol/FireballBuff.cs +++ b/Buffs/Alcohol/FireballBuff.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Buffs.Alcohol public override void SetDefaults() { DisplayName.SetDefault("Fireball"); - Description.SetDefault("Fire weapon damage boosted, life regen reduced"); + Description.SetDefault("Fire debuff damage boosted, life regen reduced"); Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; diff --git a/Buffs/DamageOverTime/Nightwither.png b/Buffs/DamageOverTime/Nightwither.png index b750e180e2..7a68497f9b 100644 Binary files a/Buffs/DamageOverTime/Nightwither.png and b/Buffs/DamageOverTime/Nightwither.png differ diff --git a/Buffs/Summon/BelladonnaSpiritBuff.png b/Buffs/Summon/BelladonnaSpiritBuff.png index 1e1c15157c..ee6006b58d 100644 Binary files a/Buffs/Summon/BelladonnaSpiritBuff.png and b/Buffs/Summon/BelladonnaSpiritBuff.png differ diff --git a/Buffs/Summon/SiriusBuff.png b/Buffs/Summon/SiriusBuff.png index 56f76ed72a..33c7e306b6 100644 Binary files a/Buffs/Summon/SiriusBuff.png and b/Buffs/Summon/SiriusBuff.png differ diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index c8dbefa58a..6b00c1c965 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -25,6 +25,7 @@ using CalamityMod.Items.Weapons.Typeless; using CalamityMod.NPCs; using CalamityMod.NPCs.Abyss; using CalamityMod.NPCs.AcidRain; +using CalamityMod.NPCs.AdultEidolonWyrm; using CalamityMod.NPCs.Astral; using CalamityMod.NPCs.BrimstoneElemental; using CalamityMod.NPCs.Calamitas; @@ -115,7 +116,6 @@ namespace CalamityMod.CalPlayer public int searedPanTimer = 0; public int potionTimer = 0; public bool cirrusDress = false; - public bool noWings = false; public bool blockAllDashes = false; public bool resetHeightandWidth = false; public bool noLifeRegen = false; @@ -514,7 +514,6 @@ namespace CalamityMod.CalPlayer public bool sirenIceCooldown = false; public bool aSpark = false; public bool aSparkRare = false; - public bool aBulwark = false; public bool aBulwarkRare = false; public bool dAmulet = false; public bool fCarapace = false; @@ -545,7 +544,6 @@ namespace CalamityMod.CalPlayer public bool frostFlare = false; public bool beeResist = false; public bool uberBees = false; - public bool projRef = false; public bool projRefRare = false; public int projRefRareLifeRegenCounter = 0; public bool nanotech = false; @@ -660,7 +658,6 @@ namespace CalamityMod.CalPlayer public int icicleCooldown = 0; public bool rustyMedal = false; public bool noStupidNaturalARSpawns = false; - public bool burdenBreakerYeet = false; public bool roverDrive = false; public int roverDriveTimer = 0; public int roverFrameCounter = 0; @@ -785,7 +782,9 @@ namespace CalamityMod.CalPlayer public int silvaMageCooldown = 0; public bool silvaSummon = false; public bool hasSilvaEffect = false; - public int silvaCountdown = 480; + public static int silvaReviveDuration = 480; + public int silvaCountdown = silvaReviveDuration; + public int silvaReviveCooldown = 0; public bool auricSet = false; public bool omegaBlueChestplate = false; public bool omegaBlueSet = false; @@ -1627,7 +1626,6 @@ namespace CalamityMod.CalPlayer wearingRogueArmor = false; cirrusDress = false; - noWings = false; blockAllDashes = false; blazingCursorDamage = false; blazingCursorVisuals = false; @@ -1652,7 +1650,6 @@ namespace CalamityMod.CalPlayer badgeOfBraveryRare = false; aSpark = false; aSparkRare = false; - aBulwark = false; aBulwarkRare = false; dAmulet = false; fCarapace = false; @@ -1669,7 +1666,6 @@ namespace CalamityMod.CalPlayer frostFlare = false; beeResist = false; uberBees = false; - projRef = false; projRefRare = false; nanotech = false; eQuiver = false; @@ -1749,7 +1745,6 @@ namespace CalamityMod.CalPlayer corrosiveSpine = false; rustyMedal = false; noStupidNaturalARSpawns = false; - burdenBreakerYeet = false; roverDrive = false; rottenDogTooth = false; angelicAlliance = false; @@ -2447,7 +2442,7 @@ namespace CalamityMod.CalPlayer silvaMage = false; silvaSummon = false; hasSilvaEffect = false; - silvaCountdown = 480; + silvaCountdown = silvaReviveDuration; auricSet = false; GemTechSet = false; omegaBlueChestplate = false; @@ -2586,10 +2581,7 @@ namespace CalamityMod.CalPlayer public override void UpdateBiomeVisuals() { - bool useBossRushBackground = BossRushEvent.BossRushActive && BossRushEvent.StartTimer > 100; - - player.ManageSpecialBiomeVisuals("CalamityMod:BossRush", useBossRushBackground); - if (useBossRushBackground) + if (BossRushSky.DetermineDrawEligibility()) { // Clear all other skies, including the vanilla ones. Dictionary skies = EffectsField.GetValue(SkyManager.Instance) as Dictionary; @@ -2667,15 +2659,7 @@ namespace CalamityMod.CalPlayer bool inAstral = ZoneAstral; player.ManageSpecialBiomeVisuals("CalamityMod:Astral", inAstral); - bool cryogenActive = NPC.AnyNPCs(ModContent.NPCType()); - - if (SkyManager.Instance["CalamityMod:Cryogen"] != null && cryogenActive != SkyManager.Instance["CalamityMod:Cryogen"].IsActive()) - { - if (cryogenActive) - SkyManager.Instance.Activate("CalamityMod:Cryogen"); - else - SkyManager.Instance.Deactivate("CalamityMod:Cryogen"); - } + CryogenSky.UpdateDrawEligibility(); if (SkyManager.Instance["CalamityMod:StormWeaverFlash"] != null && useFlash != SkyManager.Instance["CalamityMod:StormWeaverFlash"].IsActive()) { @@ -2844,8 +2828,6 @@ namespace CalamityMod.CalPlayer if (!mediumcoreDeath) { items.Add(createItem(ModContent.ItemType())); - items.Add(createItem(ModContent.ItemType())); - items.Add(createItem(ModContent.ItemType())); } } #endregion @@ -4490,11 +4472,11 @@ namespace CalamityMod.CalPlayer if (silvaSet && silvaCountdown > 0) { - if (silvaCountdown == 480 && !hasSilvaEffect) + if (silvaCountdown == silvaReviveDuration && !hasSilvaEffect) { Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/SilvaActivation"), (int)player.position.X, (int)player.position.Y); - player.AddBuff(ModContent.BuffType(), 480); + player.AddBuff(ModContent.BuffType(), silvaReviveDuration); if (draconicSurge && !draconicSurgeCooldown) { @@ -4671,12 +4653,6 @@ namespace CalamityMod.CalPlayer } } - if (CalamityWorld.ironHeart) - { - KillPlayer(); - return false; - } - deathCount++; if (player.whoAmI == Main.myPlayer && Main.netMode == NetmodeID.MultiplayerClient) { @@ -4731,8 +4707,6 @@ namespace CalamityMod.CalPlayer (coreOfTheBloodGod ? 0.15 : 0) + (bloodPactBoost ? 0.5 : 0); healValue = (int)(healValue * healMult); - if (CalamityWorld.ironHeart) - healValue = 0; } #endregion @@ -4745,25 +4719,6 @@ namespace CalamityMod.CalPlayer if (flamethrowerBoost && item.ranged && (item.useAmmo == AmmoID.Gel || CalamityLists.flamethrowerList.Contains(item.type))) mult += hoverboardBoost ? 0.35f : 0.25f; - if (fireball && cinnamonRoll && CalamityLists.fireWeaponList.Contains(item.type)) - { - mult += 0.125f; - } - else - { - if (fireball && CalamityLists.fireWeaponList.Contains(item.type)) - mult += 0.05f; - - if (cinnamonRoll && CalamityLists.fireWeaponList.Contains(item.type)) - mult += 0.1f; - } - - if (evergreenGin && CalamityLists.natureWeaponList.Contains(item.type)) - mult += 0.1f; - - if (eskimoSet && CalamityLists.iceWeaponList.Contains(item.type)) - mult += 0.1f; - if (item.ranged) acidRoundMultiplier = item.useTime / 20D; else @@ -5611,16 +5566,6 @@ namespace CalamityMod.CalPlayer } } - if (CalamityWorld.ironHeart) - { - int damageMin = 40 + (player.statLifeMax2 / 10); - if (damage < damageMin) - { - player.endurance = 0f; - damage = damageMin; - } - } - if (aBulwarkRare) { aBulwarkRareMeleeBoostTimer += 3 * damage; @@ -5654,25 +5599,6 @@ namespace CalamityMod.CalPlayer dodgeCooldownTimer = EvolutionReflectCooldown; // Send a Calamity dodge cooldown packet. - if (Main.netMode == NetmodeID.MultiplayerClient && player.whoAmI == Main.myPlayer) - SyncDodgeCooldown(false); - return; - } - - // Arcanum of the Void - else if (projRef) - { - proj.hostile = false; - proj.friendly = true; - proj.velocity *= -1f; - proj.extraUpdates += 1; - proj.penetrate = 1; - player.GiveIFrames(20, false); - - damage = 0; - - dodgeCooldownTimer = ArcanumReflectCooldown; - // Send a Calamity dodge cooldown packet. if (Main.netMode == NetmodeID.MultiplayerClient && player.whoAmI == Main.myPlayer) SyncDodgeCooldown(false); return; @@ -5793,6 +5719,17 @@ namespace CalamityMod.CalPlayer hasBanner = true; } } + if (tile.type == ModContent.TileType()) + { + int bannerType = tile.frameX / 18; + + int bannerItemType = CalamityUtils.GetBannerItem(bannerType); + if (ItemID.Sets.BannerStrength[bannerItemType].Enabled) + { + NPCBannerBuff[bannerType] = true; + hasBanner = true; + } + } } } @@ -5808,13 +5745,13 @@ namespace CalamityMod.CalPlayer if (aSparkRare) { - if (proj.type == ProjectileID.MartianTurretBolt || proj.type == ProjectileID.GigaZapperSpear || proj.type == ProjectileID.CultistBossLightningOrbArc || proj.type == ModContent.ProjectileType() || proj.type == ProjectileID.VortexLightning || + if (proj.type == ProjectileID.MartianTurretBolt || proj.type == ProjectileID.GigaZapperSpear || proj.type == ProjectileID.CultistBossLightningOrbArc || proj.type == ModContent.ProjectileType() || proj.type == ProjectileID.VortexLightning || proj.type == ModContent.ProjectileType() || proj.type == ProjectileID.BulletSnowman || proj.type == ProjectileID.BulletDeadeye || proj.type == ProjectileID.SniperBullet || proj.type == ProjectileID.VortexLaser) projectileDamageReduction += 0.5; } if (CalamityLists.projectileDestroyExceptionList.TrueForAll(x => proj.type != x) && proj.active && !proj.friendly && proj.hostile && damage > 0) { - if (dodgeCooldownTimer == 0 && !disableAllDodges && daedalusReflect && !projRef && !projRefRare) + if (dodgeCooldownTimer == 0 && !disableAllDodges && daedalusReflect && !projRefRare) { projectileDamageReduction += 0.5; } @@ -5909,16 +5846,6 @@ namespace CalamityMod.CalPlayer projectileDamageReduction = 1D / (1D + projectileDamageReduction); damage = (int)(damage * projectileDamageReduction); } - - if (CalamityWorld.ironHeart) - { - int damageMin = (Main.expertMode ? 10 : 20) + (player.statLifeMax2 / (Main.expertMode ? 40 : 20)); - if (damage < damageMin) - { - player.endurance = 0f; - damage = damageMin; - } - } } #endregion @@ -6575,7 +6502,7 @@ namespace CalamityMod.CalPlayer // Reflects count as dodges. They share the timer and can be disabled by Armageddon right click. if (dodgeCooldownTimer == 0 && !disableAllDodges) { - if (daedalusReflect && !projRef && !projRefRare) + if (daedalusReflect && !projRefRare) { proj.hostile = false; proj.friendly = true; @@ -6813,8 +6740,6 @@ namespace CalamityMod.CalPlayer #region Limitations private void ForceVariousEffects() { - if (noWings) - RemoveWingTime(); if (blockAllDashes || (CalamityConfig.Instance.BossRushDashCurse && BossRushEvent.BossRushActive)) DisableDashes(); if (weakPetrification) @@ -6842,10 +6767,6 @@ namespace CalamityMod.CalPlayer player.yoraiz0rEye = 0; } - private void RemoveWingTime() - { - player.wingTimeMax = 0; - } private void DisableDashes() { // Set the player to have no registered dashes. @@ -7021,17 +6942,6 @@ namespace CalamityMod.CalPlayer if (purpleCandle) damage = (int)(damage - (player.statDefense * 0.05)); - if (CalamityWorld.ironHeart) - { - int damageMin = 80 + (player.statLifeMax2 / 10); - playSound = false; - hurtSoundTimer = 20; - if (damage <= damageMin) - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/IronHeartHurt"), (int)player.position.X, (int)player.position.Y); - else - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/IronHeartBigHurt"), (int)player.position.X, (int)player.position.Y); - } - return true; } #endregion @@ -7385,15 +7295,11 @@ namespace CalamityMod.CalPlayer CalamityUtils.ProjectileRain(player.Center, 400f, 100f, 500f, 800f, 20f, ModContent.ProjectileType(), (int)(20 * player.AverageDamage()), 1f, player.whoAmI); } } - if (aBulwark) + if (aBulwarkRare) { - if (aBulwarkRare) - { - Main.PlaySound(SoundID.Item, (int)player.position.X, (int)player.position.Y, 74); - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)(25 * player.AverageDamage()), 5f, player.whoAmI, 0f, 1f); - } - int starAmt = aBulwarkRare ? 12 : 5; - for (int n = 0; n < starAmt; n++) + Main.PlaySound(SoundID.Item, (int)player.position.X, (int)player.position.Y, 74); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)(25 * player.AverageDamage()), 5f, player.whoAmI, 0f, 1f); + for (int n = 0; n < 12; n++) { CalamityUtils.ProjectileRain(player.Center, 400f, 100f, 500f, 800f, 29f, ModContent.ProjectileType(), (int)(320 * player.AverageDamage()), 5f, player.whoAmI); } @@ -7411,34 +7317,6 @@ namespace CalamityMod.CalPlayer } } } - if (theBee) - { - for (int n = 0; n < 3; n++) - { - Projectile star = CalamityUtils.ProjectileRain(player.Center, 400f, 100f, 500f, 800f, 29f, ProjectileID.HallowStar, (int)(150 * player.AverageDamage()), 4f, player.whoAmI); - if (star.whoAmI.WithinBounds(Main.maxProjectiles)) - { - star.Calamity().forceTypeless = true; - star.usesLocalNPCImmunity = true; - star.localNPCHitCooldown = 5; - } - } - int num = 1; - if (Main.rand.NextBool(3)) - ++num; - if (Main.rand.NextBool(3)) - ++num; - if (player.strongBees && Main.rand.NextBool(3)) - ++num; - for (int index = 0; index < num; ++index) - { - int bee = Projectile.NewProjectile(player.position.X, player.position.Y, Main.rand.Next(-35, 36) * 0.02f, Main.rand.Next(-35, 36) * 0.02f, Main.rand.NextBool(4) ? ModContent.ProjectileType() : player.beeType(), player.beeDamage(7), player.beeKB(0f), Main.myPlayer, 0f, 0f); - Main.projectile[bee].usesLocalNPCImmunity = true; - Main.projectile[bee].localNPCHitCooldown = 5; - if (bee.WithinBounds(Main.maxProjectiles)) - Main.projectile[bee].Calamity().forceTypeless = true; - } - } if (fCarapace) { if (damage > 0) @@ -7639,7 +7517,6 @@ namespace CalamityMod.CalPlayer player.lastDeathPostion = player.Center; player.lastDeathTime = DateTime.Now; player.showLastDeath = true; - bool specialDeath = CalamityWorld.ironHeart; int coinsOwned = (int)Utils.CoinsCount(out bool flag, player.inventory, new int[0]); if (Main.myPlayer == player.whoAmI) { @@ -7686,14 +7563,7 @@ namespace CalamityMod.CalPlayer player.KillMeForGood(); } } - if (specialDeath) - { - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/IronHeartDeath"), (int)player.position.X, (int)player.position.Y); - } - else - { - Main.PlaySound(SoundID.PlayerKilled, (int)player.position.X, (int)player.position.Y, 1, 1f, 0f); - } + Main.PlaySound(SoundID.PlayerKilled, (int)player.position.X, (int)player.position.Y, 1, 1f, 0f); player.headVelocity.Y = (float)Main.rand.Next(-40, -10) * 0.1f; player.bodyVelocity.Y = (float)Main.rand.Next(-40, -10) * 0.1f; player.legVelocity.Y = (float)Main.rand.Next(-40, -10) * 0.1f; @@ -7708,7 +7578,7 @@ namespace CalamityMod.CalPlayer } for (int j = 0; j < 100; j++) { - Dust.NewDust(player.position, player.width, player.height, specialDeath ? 91 : 235, (float)(2 * 0), -2f, 0, default, 1f); + Dust.NewDust(player.position, player.width, player.height, 235, (float)(2 * 0), -2f, 0, default, 1f); } player.mount.Dismount(player); player.dead = true; @@ -7734,10 +7604,6 @@ namespace CalamityMod.CalPlayer damageSource = PlayerDeathReason.ByCustomReason("Oxygen failed to reach " + player.name + " from the depths of the Abyss."); } } - else if (specialDeath) - { - damageSource = PlayerDeathReason.ByCustomReason(player.name + " was defeated."); - } else if (CalamityWorld.death && deathModeBlizzardTime > 1980) { deathModeBlizzardTime = 0; diff --git a/CalPlayer/CalamityPlayerDrawEffects.cs b/CalPlayer/CalamityPlayerDrawEffects.cs index 97a8dbd5ed..3461b51f64 100644 --- a/CalPlayer/CalamityPlayerDrawEffects.cs +++ b/CalPlayer/CalamityPlayerDrawEffects.cs @@ -6,7 +6,7 @@ using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Summon; -using CalamityMod.NPCs.Abyss; +using CalamityMod.NPCs.AdultEidolonWyrm; using CalamityMod.NPCs.AquaticScourge; using CalamityMod.NPCs.AstrumAureus; using CalamityMod.NPCs.AstrumDeus; @@ -879,731 +879,723 @@ namespace CalamityMod.CalPlayer list.Add(GemTechGems); } - public override void DrawEffects(PlayerDrawInfo drawInfo, ref float r, ref float g, ref float b, ref float a, ref bool fullBright) - { - CalamityPlayer calamityPlayer = player.Calamity(); - if (Main.myPlayer == player.whoAmI && !Main.gameMenu && CalamityConfig.Instance.SpeedrunTimer) - { - string formatStr = @"hh\:mm\:ss\.ff"; - string formatStrDays = @"d\:hh\:mm\:ss\.ff"; - TimeSpan totalTime = CalamityMod.SpeedrunTimer.Elapsed.Add(calamityPlayer.previousSessionTotal); - string text = totalTime.ToString(totalTime.Days > 0 ? formatStrDays : formatStr); - float scale = 2f; - float xOffset = CalamityConfig.Instance.SpeedrunTimerPosX; - float yOffset = CalamityConfig.Instance.SpeedrunTimerPosY; + public override void DrawEffects(PlayerDrawInfo drawInfo, ref float r, ref float g, ref float b, ref float a, ref bool fullBright) + { + CalamityPlayer calamityPlayer = player.Calamity(); + if (Main.myPlayer == player.whoAmI && !Main.gameMenu && CalamityConfig.Instance.SpeedrunTimer) + { + string formatStr = @"hh\:mm\:ss\.ff"; + string formatStrDays = @"d\:hh\:mm\:ss\.ff"; + TimeSpan totalTime = CalamityMod.SpeedrunTimer.Elapsed.Add(calamityPlayer.previousSessionTotal); + string text = totalTime.ToString(totalTime.Days > 0 ? formatStrDays : formatStr); + float scale = 2f; + float xOffset = CalamityConfig.Instance.SpeedrunTimerPosX; + float yOffset = CalamityConfig.Instance.SpeedrunTimerPosY; - Utils.DrawBorderStringFourWay(Main.spriteBatch, Main.fontMouseText, text, Main.screenWidth / 2f - xOffset, yOffset, Color.White, Color.Black, default, scale); + Utils.DrawBorderStringFourWay(Main.spriteBatch, Main.fontMouseText, text, Main.screenWidth / 2f - xOffset, yOffset, Color.White, Color.Black, default, scale); - if (calamityPlayer.lastSplitType > -1) - { - TimeSpan split = calamityPlayer.lastSplit; - text = split.ToString(split.Days > 0 ? formatStrDays : formatStr); - scale = 1f; - yOffset += 44f; + if (calamityPlayer.lastSplitType > -1) + { + TimeSpan split = calamityPlayer.lastSplit; + text = split.ToString(split.Days > 0 ? formatStrDays : formatStr); + scale = 1f; + yOffset += 44f; - Texture2D texture = null; - switch (calamityPlayer.lastSplitType) - { - // King Slime - case 1: - texture = Main.npcHeadBossTexture[7]; - break; + Texture2D texture = null; + switch (calamityPlayer.lastSplitType) + { + // King Slime + case 1: + texture = Main.npcHeadBossTexture[7]; + break; - case 2: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; - break; + case 2: + texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + break; - // Eye of Cthulhu - case 3: - texture = Main.npcHeadBossTexture[1]; - break; + // Eye of Cthulhu + case 3: + texture = Main.npcHeadBossTexture[1]; + break; - case 4: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; - break; + case 4: + texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + break; - // Eater of Worlds - case 5: - texture = Main.npcHeadBossTexture[2]; - break; + // Eater of Worlds + case 5: + texture = Main.npcHeadBossTexture[2]; + break; - // Brain of Cthulhu - case 6: - texture = Main.npcHeadBossTexture[23]; - break; + // Brain of Cthulhu + case 6: + texture = Main.npcHeadBossTexture[23]; + break; - case 7: - texture = ModContent.GetTexture("CalamityMod/NPCs/HiveMind/HiveMindP2_Head_Boss"); - break; + case 7: + texture = ModContent.GetTexture("CalamityMod/NPCs/HiveMind/HiveMindP2_Head_Boss"); + break; - case 8: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; - break; + case 8: + texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + break; - // Queen Bee - case 9: - texture = Main.npcHeadBossTexture[14]; - break; + // Queen Bee + case 9: + texture = Main.npcHeadBossTexture[14]; + break; - // Skeletron - case 10: - texture = Main.npcHeadBossTexture[19]; - break; + // Skeletron + case 10: + texture = Main.npcHeadBossTexture[19]; + break; - case 11: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; - break; + case 11: + texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + break; - // Wall of Flesh - case 12: - texture = Main.npcHeadBossTexture[22]; - break; + // Wall of Flesh + case 12: + texture = Main.npcHeadBossTexture[22]; + break; - case 13: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; - break; + case 13: + texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + break; - // The Twins - case 14: - texture = Main.npcHeadBossTexture[21]; - break; + // The Twins + case 14: + texture = Main.npcHeadBossTexture[21]; + break; - case 15: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; - break; + case 15: + texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + break; - // The Destroyer - case 16: - texture = Main.npcHeadBossTexture[25]; - break; + // The Destroyer + case 16: + texture = Main.npcHeadBossTexture[25]; + break; - case 17: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; - break; + case 17: + texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + break; - // Skeletron Prime - case 18: - texture = Main.npcHeadBossTexture[18]; - break; + // Skeletron Prime + case 18: + texture = Main.npcHeadBossTexture[18]; + break; - case 19: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; - break; + case 19: + texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + break; - // Plantera - case 20: - texture = Main.npcHeadBossTexture[12]; - break; + // Plantera + case 20: + texture = Main.npcHeadBossTexture[12]; + break; - case 21: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; - break; + case 21: + texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + break; - case 22: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; - break; + case 22: + texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + break; - // Golem - case 23: - texture = Main.npcHeadBossTexture[5]; - break; + // Golem + case 23: + texture = Main.npcHeadBossTexture[5]; + break; - case 24: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; - break; + case 24: + texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + break; - // Duke Fishron - case 25: - texture = Main.npcHeadBossTexture[4]; - break; + // Duke Fishron + case 25: + texture = Main.npcHeadBossTexture[4]; + break; - case 26: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; - break; + case 26: + texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + break; - // Lunatic Cultist - case 27: - texture = Main.npcHeadBossTexture[31]; - break; + // Lunatic Cultist + case 27: + texture = Main.npcHeadBossTexture[31]; + break; - case 28: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; - break; + case 28: + texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + break; - // Moon Lord - case 29: - texture = Main.npcHeadBossTexture[8]; - break; + // Moon Lord + case 29: + texture = Main.npcHeadBossTexture[8]; + break; - case 30: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; - break; + case 30: + texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + break; - case 31: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; - break; + case 31: + texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + break; - case 32: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; - break; + case 32: + texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + break; - case 33: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; - break; + case 33: + texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + break; - case 34: - texture = ModContent.GetTexture("CalamityMod/NPCs/StormWeaver/StormWeaverHeadNaked_Head_Boss"); - break; + case 34: + texture = ModContent.GetTexture("CalamityMod/NPCs/StormWeaver/StormWeaverHeadNaked_Head_Boss"); + break; - case 35: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; - break; + case 35: + texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + break; - case 36: - texture = ModContent.GetTexture("CalamityMod/NPCs/Polterghast/Necroplasm_Head_Boss"); - break; + case 36: + texture = ModContent.GetTexture("CalamityMod/NPCs/Polterghast/Necroplasm_Head_Boss"); + break; - case 37: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; - break; + case 37: + texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + break; - case 38: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; - break; + case 38: + texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + break; - case 39: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; - break; + case 39: + texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + break; - case 40: - texture = ModContent.GetTexture("CalamityMod/NPCs/SupremeCalamitas/HoodlessHeadIcon"); - break; + case 40: + texture = ModContent.GetTexture("CalamityMod/NPCs/SupremeCalamitas/HoodlessHeadIcon"); + break; - case 41: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; - break; + case 41: + texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + break; - case 42: - texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; - break; + case 42: + texture = Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]]; + break; - default: - break; - } + default: + break; + } - xOffset -= 58f; + xOffset -= 58f; - if (texture != null) - Main.spriteBatch.Draw(texture, new Vector2(Main.screenWidth / 2f - xOffset - texture.Width - 4f, yOffset), null, Color.White, 0f, default, 1f, SpriteEffects.None, 0f); + if (texture != null) + Main.spriteBatch.Draw(texture, new Vector2(Main.screenWidth / 2f - xOffset - texture.Width - 4f, yOffset), null, Color.White, 0f, default, 1f, SpriteEffects.None, 0f); - Utils.DrawBorderStringFourWay(Main.spriteBatch, Main.fontMouseText, text, Main.screenWidth / 2f - xOffset, yOffset, Color.White, Color.Black, default, scale); - } - } + Utils.DrawBorderStringFourWay(Main.spriteBatch, Main.fontMouseText, text, Main.screenWidth / 2f - xOffset, yOffset, Color.White, Color.Black, default, scale); + } + } - // Dust modifications while high. - if (calamityPlayer.trippy) - { - if (Main.myPlayer == player.whoAmI) - { - Rectangle screenArea = new Rectangle((int)Main.screenPosition.X - 500, (int)Main.screenPosition.Y - 50, Main.screenWidth + 1000, Main.screenHeight + 100); - int dustDrawn = 0; - float maxShroomDust = Main.maxDustToDraw / 2; - for (int i = 0; i < Main.maxDustToDraw; i++) - { - Dust dust = Main.dust[i]; - if (dust.active) - { - // Only draw dust near the screen, for performance reasons. - if (new Rectangle((int)dust.position.X, (int)dust.position.Y, 4, 4).Intersects(screenArea)) - { - dust.color = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, 0); - for (int j = 0; j < 4; j++) - { - Vector2 dustDrawPosition = dust.position; - Vector2 dustCenter = dustDrawPosition + new Vector2(4f); + // Dust modifications while high. + if (calamityPlayer.trippy) + { + if (Main.myPlayer == player.whoAmI) + { + Rectangle screenArea = new Rectangle((int)Main.screenPosition.X - 500, (int)Main.screenPosition.Y - 50, Main.screenWidth + 1000, Main.screenHeight + 100); + int dustDrawn = 0; + float maxShroomDust = Main.maxDustToDraw / 2; + for (int i = 0; i < Main.maxDustToDraw; i++) + { + Dust dust = Main.dust[i]; + if (dust.active) + { + // Only draw dust near the screen, for performance reasons. + if (new Rectangle((int)dust.position.X, (int)dust.position.Y, 4, 4).Intersects(screenArea)) + { + dust.color = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, 0); + for (int j = 0; j < 4; j++) + { + Vector2 dustDrawPosition = dust.position; + Vector2 dustCenter = dustDrawPosition + new Vector2(4f); - float distanceX = Math.Abs(dustCenter.X - player.Center.X); - float distanceY = Math.Abs(dustCenter.Y - player.Center.Y); - if (j == 0 || j == 2) - dustDrawPosition.X = player.Center.X + distanceX; - else dustDrawPosition.X = player.Center.X - distanceX; + float distanceX = Math.Abs(dustCenter.X - player.Center.X); + float distanceY = Math.Abs(dustCenter.Y - player.Center.Y); + if (j == 0 || j == 2) + dustDrawPosition.X = player.Center.X + distanceX; + else dustDrawPosition.X = player.Center.X - distanceX; - dustDrawPosition.X -= 4f; + dustDrawPosition.X -= 4f; - if (j == 0 || j == 1) - dustDrawPosition.Y = player.Center.Y + distanceY; + if (j == 0 || j == 1) + dustDrawPosition.Y = player.Center.Y + distanceY; - else dustDrawPosition.Y = player.Center.Y - distanceY; + else dustDrawPosition.Y = player.Center.Y - distanceY; - dustDrawPosition.Y -= 4f; - Main.spriteBatch.Draw(Main.dustTexture, dustDrawPosition - Main.screenPosition, dust.frame, dust.color, dust.rotation, new Vector2(4f), dust.scale, SpriteEffects.None, 0f); - dustDrawn++; - } + dustDrawPosition.Y -= 4f; + Main.spriteBatch.Draw(Main.dustTexture, dustDrawPosition - Main.screenPosition, dust.frame, dust.color, dust.rotation, new Vector2(4f), dust.scale, SpriteEffects.None, 0f); + dustDrawn++; + } - // Break if too many dust clones have been drawn - if (dustDrawn > maxShroomDust) - break; - } - } - } - } - } + // Break if too many dust clones have been drawn + if (dustDrawn > maxShroomDust) + break; + } + } + } + } + } - bool noRogueStealth = calamityPlayer.rogueStealth == 0f || player.townNPCs > 2f || !CalamityConfig.Instance.StealthInvisbility; - if (calamityPlayer.rogueStealth > 0f && calamityPlayer.rogueStealthMax > 0f && player.townNPCs < 3f && CalamityConfig.Instance.StealthInvisbility) - { - // A translucent orchid color, the rogue class color - float colorValue = calamityPlayer.rogueStealth / calamityPlayer.rogueStealthMax * 0.9f; //0 to 0.9 - r *= 1f - (colorValue * 0.89f); //255 to 50 - g *= 1f - colorValue; //255 to 25 - b *= 1f - (colorValue * 0.89f); //255 to 50 - a *= 1f - colorValue; //255 to 25 - player.armorEffectDrawOutlines = false; - player.armorEffectDrawShadow = false; - player.armorEffectDrawShadowSubtle = false; - } + bool noRogueStealth = calamityPlayer.rogueStealth == 0f || player.townNPCs > 2f || !CalamityConfig.Instance.StealthInvisbility; + if (calamityPlayer.rogueStealth > 0f && calamityPlayer.rogueStealthMax > 0f && player.townNPCs < 3f && CalamityConfig.Instance.StealthInvisbility) + { + // A translucent orchid color, the rogue class color + float colorValue = calamityPlayer.rogueStealth / calamityPlayer.rogueStealthMax * 0.9f; //0 to 0.9 + r *= 1f - (colorValue * 0.89f); //255 to 50 + g *= 1f - colorValue; //255 to 25 + b *= 1f - (colorValue * 0.89f); //255 to 50 + a *= 1f - colorValue; //255 to 25 + player.armorEffectDrawOutlines = false; + player.armorEffectDrawShadow = false; + player.armorEffectDrawShadowSubtle = false; + } - if (CalamityWorld.ironHeart && !Main.gameMenu) - { - Texture2D ironHeart = ModContent.GetTexture("CalamityMod/ExtraTextures/IronHeart"); - Main.heartTexture = Main.heart2Texture = ironHeart; - } - else - { - Texture2D heart3 = ModContent.GetTexture("CalamityMod/ExtraTextures/Heart3"); - Texture2D heart4 = ModContent.GetTexture("CalamityMod/ExtraTextures/Heart4"); - Texture2D heart5 = ModContent.GetTexture("CalamityMod/ExtraTextures/Heart5"); - Texture2D heart6 = ModContent.GetTexture("CalamityMod/ExtraTextures/Heart6"); - Texture2D heartOriginal = ModContent.GetTexture("CalamityMod/ExtraTextures/HeartOriginal"); // Life fruit - Texture2D heartOriginal2 = ModContent.GetTexture("CalamityMod/ExtraTextures/HeartOriginal2"); // Life crystal + Texture2D heart3 = ModContent.GetTexture("CalamityMod/ExtraTextures/Heart3"); + Texture2D heart4 = ModContent.GetTexture("CalamityMod/ExtraTextures/Heart4"); + Texture2D heart5 = ModContent.GetTexture("CalamityMod/ExtraTextures/Heart5"); + Texture2D heart6 = ModContent.GetTexture("CalamityMod/ExtraTextures/Heart6"); + Texture2D heartOriginal = ModContent.GetTexture("CalamityMod/ExtraTextures/HeartOriginal"); // Life fruit + Texture2D heartOriginal2 = ModContent.GetTexture("CalamityMod/ExtraTextures/HeartOriginal2"); // Life crystal - int totalFruit = - (calamityPlayer.mFruit ? 1 : 0) + - (calamityPlayer.bOrange ? 1 : 0) + - (calamityPlayer.eBerry ? 1 : 0) + - (calamityPlayer.dFruit ? 1 : 0); + int totalFruit = + (calamityPlayer.mFruit ? 1 : 0) + + (calamityPlayer.bOrange ? 1 : 0) + + (calamityPlayer.eBerry ? 1 : 0) + + (calamityPlayer.dFruit ? 1 : 0); - switch (totalFruit) - { - default: - Main.heart2Texture = heartOriginal; - break; - case 4: - Main.heart2Texture = heart6; - break; - case 3: - Main.heart2Texture = heart5; - break; - case 2: - Main.heart2Texture = heart4; - break; - case 1: - Main.heart2Texture = heart3; - break; - } + switch (totalFruit) + { + default: + Main.heart2Texture = heartOriginal; + break; + case 4: + Main.heart2Texture = heart6; + break; + case 3: + Main.heart2Texture = heart5; + break; + case 2: + Main.heart2Texture = heart4; + break; + case 1: + Main.heart2Texture = heart3; + break; + } - Main.heartTexture = heartOriginal2; - } - if (calamityPlayer.revivify) - { - if (Main.rand.NextBool(2) && drawInfo.shadow == 0f) - { - int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), player.width + 4, player.height + 4, 91, player.velocity.X * 0.2f, player.velocity.Y * 0.2f, 100, default, 1f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity.Y -= 0.5f; - Main.playerDrawDust.Add(dust); - } - } - if (calamityPlayer.tRegen) - { - if (Main.rand.NextBool(10) && drawInfo.shadow == 0f) - { - int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), player.width + 4, player.height + 4, 107, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 1f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 0.75f; - Main.dust[dust].velocity.Y -= 0.35f; - Main.playerDrawDust.Add(dust); - } - if (noRogueStealth) - { - r *= 0.025f; - g *= 0.15f; - b *= 0.035f; - fullBright = true; - } - } - if (calamityPlayer.IBoots) - { - if (!player.StandingStill() && !player.mount.Active) - { - if (Main.rand.NextBool(2) && drawInfo.shadow == 0f) - { - int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), player.width + 4, player.height + 4, 229, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 1f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 0.5f; - Main.playerDrawDust.Add(dust); - } - if (noRogueStealth) - { - r *= 0.05f; - g *= 0.05f; - b *= 0.05f; - fullBright = true; - } - } - } - if (calamityPlayer.elysianFire) - { - if (!player.StandingStill() && !player.mount.Active) - { - if (Main.rand.NextBool(2) && drawInfo.shadow == 0f) - { - int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), player.width + 4, player.height + 4, 246, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 1f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 0.5f; - Main.playerDrawDust.Add(dust); - } - if (noRogueStealth) - { - r *= 0.75f; - g *= 0.55f; - b *= 0f; - fullBright = true; - } - } - } - if (calamityPlayer.dsSetBonus) - { - if (!player.StandingStill() && !player.mount.Active) - { - if (Main.rand.NextBool(2) && drawInfo.shadow == 0f) - { - int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), player.width + 4, player.height + 4, 27, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 1.5f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 0.5f; - Main.playerDrawDust.Add(dust); - } - if (noRogueStealth) - { - r *= 0.15f; - g *= 0.025f; - b *= 0.1f; - fullBright = true; - } - } - } - if (calamityPlayer.auricSet) - { - if (!player.StandingStill() && !player.mount.Active) - { - if (drawInfo.shadow == 0f) - { - int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), player.width + 4, player.height + 4, Main.rand.NextBool(2) ? 57 : 244, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 1.5f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 0.5f; - Main.playerDrawDust.Add(dust); - } - if (noRogueStealth) - { - r *= 0.15f; - g *= 0.025f; - b *= 0.1f; - fullBright = true; - } - } - } - if (calamityPlayer.bFlames || calamityPlayer.aFlames || calamityPlayer.rageModeActive) - { - if (Main.rand.NextBool(4) && drawInfo.shadow == 0f) - { - int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), player.width + 4, player.height + 4, ModContent.DustType(), player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 3f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 1.8f; - Main.dust[dust].velocity.Y -= 0.5f; - Main.playerDrawDust.Add(dust); - } - if (noRogueStealth) - { - r *= 0.25f; - g *= 0.01f; - b *= 0.01f; - fullBright = true; - } - } - if (calamityPlayer.shadowflame) - { - if (Main.rand.Next(5) < 4 && drawInfo.shadow == 0f) - { - int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), player.width + 4, player.height + 4, 27, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 1.95f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 0.75f; - Main.dust[dust].velocity.X = Main.dust[dust].velocity.X * 0.75f; - Main.dust[dust].velocity.Y = Main.dust[dust].velocity.Y - 1f; - if (Main.rand.NextBool(4)) - { - Main.dust[dust].noGravity = false; - Main.dust[dust].scale *= 0.5f; - } - } - } - if (calamityPlayer.sulphurPoison) - { - if (Main.rand.Next(5) < 4 && drawInfo.shadow == 0f) - { - int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), player.width + 4, player.height + 4, 46, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 1.95f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 0.75f; - Main.dust[dust].velocity.X = Main.dust[dust].velocity.X * 0.75f; - Main.dust[dust].velocity.Y = Main.dust[dust].velocity.Y - 1f; - if (Main.rand.NextBool(4)) - { - Main.dust[dust].noGravity = false; - Main.dust[dust].scale *= 0.5f; - } - } - if (noRogueStealth) - { - r *= 0.65f; - b *= 0.75f; - fullBright = true; - } - } - if (calamityPlayer.adrenalineModeActive) - { - if (Main.rand.NextBool(4) && drawInfo.shadow == 0f) - { - int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), player.width + 4, player.height + 4, 206, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 3f); - Main.dust[dust].velocity *= 1.8f; - Main.dust[dust].velocity.Y -= 0.5f; - Main.playerDrawDust.Add(dust); - } - if (noRogueStealth) - { - r *= 0.01f; - g *= 0.15f; - b *= 0.1f; - fullBright = true; - } - } - if (calamityPlayer.gsInferno) - { - if (Main.rand.NextBool(4) && drawInfo.shadow == 0f) - { - int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), player.width + 4, player.height + 4, 173, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 3f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 1.8f; - Main.dust[dust].velocity.Y -= 0.5f; - Main.playerDrawDust.Add(dust); - } - if (noRogueStealth) - { - r *= 0.25f; - g *= 0.01f; - b *= 0.01f; - fullBright = true; - } - } - if (calamityPlayer.astralInfection) - { - if (Main.rand.NextBool(4) && drawInfo.shadow == 0f) - { - int dustType = Main.rand.NextBool(2) ? ModContent.DustType() : ModContent.DustType(); - int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), player.width + 4, player.height + 4, dustType, player.velocity.X * 0.2f, player.velocity.Y * 0.2f, 100, default, 0.7f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 1.2f; - Main.dust[dust].velocity.Y -= 0.5f; - Main.dust[dust].color = new Color(255, 255, 255, 0); - Main.playerDrawDust.Add(dust); - } - } - if (calamityPlayer.hFlames || calamityPlayer.hInferno || calamityPlayer.banishingFire) - { - if (Main.rand.NextBool(4) && drawInfo.shadow == 0f) - { - int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), player.width + 4, player.height + 4, ModContent.DustType(), player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 3f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 1.8f; - Main.dust[dust].velocity.Y -= 0.5f; - Main.playerDrawDust.Add(dust); - } - if (noRogueStealth) - { - r *= 0.25f; - g *= 0.25f; - b *= 0.1f; - fullBright = true; - } - } - else if (calamityPlayer.eGravity) - { - if (Main.rand.NextBool(12) && drawInfo.shadow == 0f) - { - int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), player.width + 4, player.height + 4, (int)CalamityDusts.ProfanedFire, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 3f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 1.8f; - Main.dust[dust].velocity.Y -= 0.5f; - Main.playerDrawDust.Add(dust); - } - } - if (calamityPlayer.pFlames) - { - if (Main.rand.NextBool(4) && drawInfo.shadow == 0f) - { - int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), player.width + 4, player.height + 4, 89, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 3f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 1.2f; - Main.dust[dust].velocity.Y -= 0.15f; - Main.playerDrawDust.Add(dust); - } - if (noRogueStealth) - { - r *= 0.07f; - g *= 0.15f; - b *= 0.01f; - fullBright = true; - } - } - if (calamityPlayer.nightwither) - { - if (Main.rand.NextBool(4) && drawInfo.shadow == 0f) - { - int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), player.width + 4, player.height + 4, 176, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 3f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 1.8f; - Main.dust[dust].velocity.Y -= 0.5f; - Main.playerDrawDust.Add(dust); - } - if (noRogueStealth) - { - r *= 0.25f; - g *= 0.25f; - b *= 0.1f; - fullBright = true; - } - } - if (calamityPlayer.vaporfied) - { - int dustType = Utils.SelectRandom(Main.rand, new int[] - { - 246, - 242, - 229, - 226, - 247, - 187, - 234 - }); - if (Main.rand.NextBool(4) && drawInfo.shadow == 0f) - { - int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), player.width + 4, player.height + 4, dustType, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 3f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 1.8f; - Main.dust[dust].velocity.Y -= 0.5f; - if (Main.rand.NextBool(4)) - { - Main.dust[dust].noGravity = false; - Main.dust[dust].scale *= 0.5f; - } - Main.playerDrawDust.Add(dust); - } - if (noRogueStealth) - { - r *= 0.25f; - g *= 0.25f; - b *= 0.1f; - fullBright = true; - } - } - if (calamityPlayer.eFreeze || calamityPlayer.gState || calamityPlayer.cDepth || calamityPlayer.eutrophication) - { - if (noRogueStealth) - { - r *= 0f; - g *= 0.05f; - b *= 0.3f; - fullBright = true; - } - } - if (calamityPlayer.draedonsHeart && !calamityPlayer.shadeRegen && !calamityPlayer.cFreeze && player.StandingStill() && player.itemAnimation == 0) - { - if (noRogueStealth) - { - r *= 0f; - g *= 0.5f; - b *= 0f; - fullBright = true; - } - } - if (calamityPlayer.bBlood) - { - if (Main.rand.NextBool(6) && drawInfo.shadow == 0f) - { - int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), player.width + 4, player.height + 4, 5, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 3f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 1.8f; - Main.dust[dust].velocity.Y -= 0.5f; - Main.playerDrawDust.Add(dust); - } - if (noRogueStealth) - { - r *= 0.15f; - g *= 0.01f; - b *= 0.01f; - fullBright = true; - } - } - if (calamityPlayer.mushy) - { - if (Main.rand.NextBool(6) && drawInfo.shadow == 0f) - { - int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), player.width + 4, player.height + 4, 56, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 2f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 0.5f; - Main.dust[dust].velocity.Y -= 0.1f; - Main.playerDrawDust.Add(dust); - } - if (noRogueStealth) - { - r *= 0.15f; - g *= 0.01f; - b *= 0.01f; - fullBright = true; - } - } - if (calamityPlayer.bloodfinBoost) - { - if (Main.rand.NextBool(6) && drawInfo.shadow == 0f) - { - int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), player.width + 4, player.height + 4, 5, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 3f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 1.8f; - Main.dust[dust].velocity.Y -= 0.5f; - Main.playerDrawDust.Add(dust); - } - if (noRogueStealth) - { - r *= 0.5f; - g *= 0f; - b *= 0f; - fullBright = true; - } - } - if ((calamityPlayer.cadence || calamityPlayer.ladHearts > 0) && !player.loveStruck) - { - if (Main.rand.NextBool(5) && drawInfo.shadow == 0f) - { - Vector2 velocity = Main.rand.NextVector2Unit(); - velocity.X *= 0.66f; - velocity *= Main.rand.NextFloat(1f, 2f); + Main.heartTexture = heartOriginal2; + if (calamityPlayer.revivify) + { + if (Main.rand.NextBool(2) && drawInfo.shadow == 0f) + { + int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), player.width + 4, player.height + 4, 91, player.velocity.X * 0.2f, player.velocity.Y * 0.2f, 100, default, 1f); + Main.dust[dust].noGravity = true; + Main.dust[dust].velocity.Y -= 0.5f; + Main.playerDrawDust.Add(dust); + } + } + if (calamityPlayer.tRegen) + { + if (Main.rand.NextBool(10) && drawInfo.shadow == 0f) + { + int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), player.width + 4, player.height + 4, 107, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 1f); + Main.dust[dust].noGravity = true; + Main.dust[dust].velocity *= 0.75f; + Main.dust[dust].velocity.Y -= 0.35f; + Main.playerDrawDust.Add(dust); + } + if (noRogueStealth) + { + r *= 0.025f; + g *= 0.15f; + b *= 0.035f; + fullBright = true; + } + } + if (calamityPlayer.IBoots) + { + if (!player.StandingStill() && !player.mount.Active) + { + if (Main.rand.NextBool(2) && drawInfo.shadow == 0f) + { + int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), player.width + 4, player.height + 4, 229, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 1f); + Main.dust[dust].noGravity = true; + Main.dust[dust].velocity *= 0.5f; + Main.playerDrawDust.Add(dust); + } + if (noRogueStealth) + { + r *= 0.05f; + g *= 0.05f; + b *= 0.05f; + fullBright = true; + } + } + } + if (calamityPlayer.elysianFire) + { + if (!player.StandingStill() && !player.mount.Active) + { + if (Main.rand.NextBool(2) && drawInfo.shadow == 0f) + { + int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), player.width + 4, player.height + 4, 246, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 1f); + Main.dust[dust].noGravity = true; + Main.dust[dust].velocity *= 0.5f; + Main.playerDrawDust.Add(dust); + } + if (noRogueStealth) + { + r *= 0.75f; + g *= 0.55f; + b *= 0f; + fullBright = true; + } + } + } + if (calamityPlayer.dsSetBonus) + { + if (!player.StandingStill() && !player.mount.Active) + { + if (Main.rand.NextBool(2) && drawInfo.shadow == 0f) + { + int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), player.width + 4, player.height + 4, 27, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 1.5f); + Main.dust[dust].noGravity = true; + Main.dust[dust].velocity *= 0.5f; + Main.playerDrawDust.Add(dust); + } + if (noRogueStealth) + { + r *= 0.15f; + g *= 0.025f; + b *= 0.1f; + fullBright = true; + } + } + } + if (calamityPlayer.auricSet) + { + if (!player.StandingStill() && !player.mount.Active) + { + if (drawInfo.shadow == 0f) + { + int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), player.width + 4, player.height + 4, Main.rand.NextBool(2) ? 57 : 244, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 1.5f); + Main.dust[dust].noGravity = true; + Main.dust[dust].velocity *= 0.5f; + Main.playerDrawDust.Add(dust); + } + if (noRogueStealth) + { + r *= 0.15f; + g *= 0.025f; + b *= 0.1f; + fullBright = true; + } + } + } + if (calamityPlayer.bFlames || calamityPlayer.aFlames || calamityPlayer.rageModeActive) + { + if (Main.rand.NextBool(4) && drawInfo.shadow == 0f) + { + int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), player.width + 4, player.height + 4, ModContent.DustType(), player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 3f); + Main.dust[dust].noGravity = true; + Main.dust[dust].velocity *= 1.8f; + Main.dust[dust].velocity.Y -= 0.5f; + Main.playerDrawDust.Add(dust); + } + if (noRogueStealth) + { + r *= 0.25f; + g *= 0.01f; + b *= 0.01f; + fullBright = true; + } + } + if (calamityPlayer.shadowflame) + { + if (Main.rand.Next(5) < 4 && drawInfo.shadow == 0f) + { + int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), player.width + 4, player.height + 4, 27, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 1.95f); + Main.dust[dust].noGravity = true; + Main.dust[dust].velocity *= 0.75f; + Main.dust[dust].velocity.X = Main.dust[dust].velocity.X * 0.75f; + Main.dust[dust].velocity.Y = Main.dust[dust].velocity.Y - 1f; + if (Main.rand.NextBool(4)) + { + Main.dust[dust].noGravity = false; + Main.dust[dust].scale *= 0.5f; + } + } + } + if (calamityPlayer.sulphurPoison) + { + if (Main.rand.Next(5) < 4 && drawInfo.shadow == 0f) + { + int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), player.width + 4, player.height + 4, 46, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 1.95f); + Main.dust[dust].noGravity = true; + Main.dust[dust].velocity *= 0.75f; + Main.dust[dust].velocity.X = Main.dust[dust].velocity.X * 0.75f; + Main.dust[dust].velocity.Y = Main.dust[dust].velocity.Y - 1f; + if (Main.rand.NextBool(4)) + { + Main.dust[dust].noGravity = false; + Main.dust[dust].scale *= 0.5f; + } + } + if (noRogueStealth) + { + r *= 0.65f; + b *= 0.75f; + fullBright = true; + } + } + if (calamityPlayer.adrenalineModeActive) + { + if (Main.rand.NextBool(4) && drawInfo.shadow == 0f) + { + int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), player.width + 4, player.height + 4, 206, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 3f); + Main.dust[dust].velocity *= 1.8f; + Main.dust[dust].velocity.Y -= 0.5f; + Main.playerDrawDust.Add(dust); + } + if (noRogueStealth) + { + r *= 0.01f; + g *= 0.15f; + b *= 0.1f; + fullBright = true; + } + } + if (calamityPlayer.gsInferno) + { + if (Main.rand.NextBool(4) && drawInfo.shadow == 0f) + { + int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), player.width + 4, player.height + 4, 173, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 3f); + Main.dust[dust].noGravity = true; + Main.dust[dust].velocity *= 1.8f; + Main.dust[dust].velocity.Y -= 0.5f; + Main.playerDrawDust.Add(dust); + } + if (noRogueStealth) + { + r *= 0.25f; + g *= 0.01f; + b *= 0.01f; + fullBright = true; + } + } + if (calamityPlayer.astralInfection) + { + if (Main.rand.NextBool(4) && drawInfo.shadow == 0f) + { + int dustType = Main.rand.NextBool(2) ? ModContent.DustType() : ModContent.DustType(); + int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), player.width + 4, player.height + 4, dustType, player.velocity.X * 0.2f, player.velocity.Y * 0.2f, 100, default, 0.7f); + Main.dust[dust].noGravity = true; + Main.dust[dust].velocity *= 1.2f; + Main.dust[dust].velocity.Y -= 0.5f; + Main.dust[dust].color = new Color(255, 255, 255, 0); + Main.playerDrawDust.Add(dust); + } + } + if (calamityPlayer.hFlames || calamityPlayer.hInferno || calamityPlayer.banishingFire) + { + if (Main.rand.NextBool(4) && drawInfo.shadow == 0f) + { + int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), player.width + 4, player.height + 4, ModContent.DustType(), player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 3f); + Main.dust[dust].noGravity = true; + Main.dust[dust].velocity *= 1.8f; + Main.dust[dust].velocity.Y -= 0.5f; + Main.playerDrawDust.Add(dust); + } + if (noRogueStealth) + { + r *= 0.25f; + g *= 0.25f; + b *= 0.1f; + fullBright = true; + } + } + else if (calamityPlayer.eGravity) + { + if (Main.rand.NextBool(12) && drawInfo.shadow == 0f) + { + int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), player.width + 4, player.height + 4, (int)CalamityDusts.ProfanedFire, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 3f); + Main.dust[dust].noGravity = true; + Main.dust[dust].velocity *= 1.8f; + Main.dust[dust].velocity.Y -= 0.5f; + Main.playerDrawDust.Add(dust); + } + } + if (calamityPlayer.pFlames) + { + if (Main.rand.NextBool(4) && drawInfo.shadow == 0f) + { + int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), player.width + 4, player.height + 4, 89, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 3f); + Main.dust[dust].noGravity = true; + Main.dust[dust].velocity *= 1.2f; + Main.dust[dust].velocity.Y -= 0.15f; + Main.playerDrawDust.Add(dust); + } + if (noRogueStealth) + { + r *= 0.07f; + g *= 0.15f; + b *= 0.01f; + fullBright = true; + } + } + if (calamityPlayer.nightwither) + { + if (Main.rand.NextBool(4) && drawInfo.shadow == 0f) + { + int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), player.width + 4, player.height + 4, 176, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 3f); + Main.dust[dust].noGravity = true; + Main.dust[dust].velocity *= 1.8f; + Main.dust[dust].velocity.Y -= 0.5f; + Main.playerDrawDust.Add(dust); + } + if (noRogueStealth) + { + r *= 0.25f; + g *= 0.25f; + b *= 0.1f; + fullBright = true; + } + } + if (calamityPlayer.vaporfied) + { + int dustType = Utils.SelectRandom(Main.rand, new int[] + { + 246, + 242, + 229, + 226, + 247, + 187, + 234 + }); + if (Main.rand.NextBool(4) && drawInfo.shadow == 0f) + { + int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), player.width + 4, player.height + 4, dustType, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 3f); + Main.dust[dust].noGravity = true; + Main.dust[dust].velocity *= 1.8f; + Main.dust[dust].velocity.Y -= 0.5f; + if (Main.rand.NextBool(4)) + { + Main.dust[dust].noGravity = false; + Main.dust[dust].scale *= 0.5f; + } + Main.playerDrawDust.Add(dust); + } + if (noRogueStealth) + { + r *= 0.25f; + g *= 0.25f; + b *= 0.1f; + fullBright = true; + } + } + if (calamityPlayer.eFreeze || calamityPlayer.gState || calamityPlayer.cDepth || calamityPlayer.eutrophication) + { + if (noRogueStealth) + { + r *= 0f; + g *= 0.05f; + b *= 0.3f; + fullBright = true; + } + } + if (calamityPlayer.draedonsHeart && !calamityPlayer.shadeRegen && !calamityPlayer.cFreeze && player.StandingStill() && player.itemAnimation == 0) + { + if (noRogueStealth) + { + r *= 0f; + g *= 0.5f; + b *= 0f; + fullBright = true; + } + } + if (calamityPlayer.bBlood) + { + if (Main.rand.NextBool(6) && drawInfo.shadow == 0f) + { + int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), player.width + 4, player.height + 4, 5, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 3f); + Main.dust[dust].noGravity = true; + Main.dust[dust].velocity *= 1.8f; + Main.dust[dust].velocity.Y -= 0.5f; + Main.playerDrawDust.Add(dust); + } + if (noRogueStealth) + { + r *= 0.15f; + g *= 0.01f; + b *= 0.01f; + fullBright = true; + } + } + if (calamityPlayer.mushy) + { + if (Main.rand.NextBool(6) && drawInfo.shadow == 0f) + { + int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), player.width + 4, player.height + 4, 56, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 2f); + Main.dust[dust].noGravity = true; + Main.dust[dust].velocity *= 0.5f; + Main.dust[dust].velocity.Y -= 0.1f; + Main.playerDrawDust.Add(dust); + } + if (noRogueStealth) + { + r *= 0.15f; + g *= 0.01f; + b *= 0.01f; + fullBright = true; + } + } + if (calamityPlayer.bloodfinBoost) + { + if (Main.rand.NextBool(6) && drawInfo.shadow == 0f) + { + int dust = Dust.NewDust(drawInfo.position - new Vector2(2f), player.width + 4, player.height + 4, 5, player.velocity.X * 0.4f, player.velocity.Y * 0.4f, 100, default, 3f); + Main.dust[dust].noGravity = true; + Main.dust[dust].velocity *= 1.8f; + Main.dust[dust].velocity.Y -= 0.5f; + Main.playerDrawDust.Add(dust); + } + if (noRogueStealth) + { + r *= 0.5f; + g *= 0f; + b *= 0f; + fullBright = true; + } + } + if ((calamityPlayer.cadence || calamityPlayer.ladHearts > 0) && !player.loveStruck) + { + if (Main.rand.NextBool(5) && drawInfo.shadow == 0f) + { + Vector2 velocity = Main.rand.NextVector2Unit(); + velocity.X *= 0.66f; + velocity *= Main.rand.NextFloat(1f, 2f); - int heart = Gore.NewGore(drawInfo.position + new Vector2(Main.rand.Next(player.width + 1), Main.rand.Next(player.height + 1)), velocity, 331, Main.rand.NextFloat(0.4f, 1.2f)); - Main.gore[heart].sticky = false; - Main.gore[heart].velocity *= 0.4f; - Main.gore[heart].velocity.Y -= 0.6f; - Main.playerDrawGore.Add(heart); - } - } - } + int heart = Gore.NewGore(drawInfo.position + new Vector2(Main.rand.Next(player.width + 1), Main.rand.Next(player.height + 1)), velocity, 331, Main.rand.NextFloat(0.4f, 1.2f)); + Main.gore[heart].sticky = false; + Main.gore[heart].velocity *= 0.4f; + Main.gore[heart].velocity.Y -= 0.6f; + Main.playerDrawGore.Add(heart); + } + } + } #endregion #region Tanks/Backpacks diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 3cc541c232..1efac1c9b6 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -18,7 +18,7 @@ namespace CalamityMod.CalPlayer { Point point = player.Center.ToTileCoordinates(); - if (CalamityWorld.ironHeart || player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) + if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) noLifeRegen = true; bool death = CalamityWorld.death || CalamityWorld.malice || BossRushEvent.BossRushActive; diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 09d7f446a6..1178dd67cc 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -68,36 +68,6 @@ namespace CalamityMod.CalPlayer if (player.wingsLogic > 0) player.jumpSpeedBoost += 1.2f; - // Defiled jump boosts - if (noWings) - { - /* 8% post-Skeletron - * 10% post-WoF - * 20% post-ML - */ - - float extraJumpSpeedBoost = 0f + - (NPC.downedBoss3 ? 0.4f : 0f) + - (Main.hardMode ? (!NPC.downedBoss3 ? 0.5f : 0.1f) : 0f) + - (NPC.downedMoonlord ? 0.5f : 0f); - - // 10% extra jump speed per extra jump - if (player.doubleJumpCloud) - player.jumpSpeedBoost += extraJumpSpeedBoost; - - if (player.doubleJumpBlizzard) - player.jumpSpeedBoost += extraJumpSpeedBoost; - - if (player.doubleJumpSandstorm) - player.jumpSpeedBoost += extraJumpSpeedBoost; - - if (player.doubleJumpFart) - player.jumpSpeedBoost += extraJumpSpeedBoost; - - if (player.doubleJumpSail) - player.jumpSpeedBoost += extraJumpSpeedBoost; - } - // Decrease the counter on Fearmonger set turbo regeneration if (fearmongerRegenFrames > 0) fearmongerRegenFrames--; @@ -1364,6 +1334,8 @@ namespace CalamityMod.CalPlayer auralisAurora--; if (auralisAuroraCooldown > 0) auralisAuroraCooldown--; + if (silvaReviveCooldown > 0 && !areThereAnyDamnBosses && !areThereAnyDamnEvents) + silvaReviveCooldown--; // God Slayer Armor dash debuff immunity if (dashMod == 9 && player.dashDelay < 0) @@ -1394,7 +1366,11 @@ namespace CalamityMod.CalPlayer silvaCountdown -= 1; if (silvaCountdown <= 0) + { Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/SilvaDispel"), player.Center); + // 5 minutes + silvaReviveCooldown = 18000; + } for (int j = 0; j < 2; j++) { @@ -1409,6 +1385,11 @@ namespace CalamityMod.CalPlayer Main.dust[green].scale *= 1f + (float)Main.rand.Next(40) * 0.01f; } } + if (silvaReviveCooldown <= 0 && hasSilvaEffect && silvaCountdown <= 0 && !areThereAnyDamnBosses && !areThereAnyDamnEvents) + { + silvaCountdown = 480; + hasSilvaEffect = false; + } // Tarragon cloak effects if (tarragonCloak) diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index 7cbe88af41..0d344cff30 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -46,7 +46,13 @@ namespace CalamityMod.CalPlayer witheringDamageDone += (int)(damage * (crit ? 2D : 1D)); if (flamingItemEnchant) - target.AddBuff(ModContent.BuffType(), VulnerabilityHex.AflameDuration); + target.AddBuff(BuffType(), VulnerabilityHex.AflameDuration); + + target.Calamity().IncreasedHeatEffects = fireball || cinnamonRoll; + + target.Calamity().IncreasedColdEffects = eskimoSet; + + target.Calamity().IncreasedSicknessAndWaterEffects = evergreenGin; switch (item.type) { @@ -96,12 +102,12 @@ namespace CalamityMod.CalPlayer break; case ItemID.DeathSickle: - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffType(), 120); break; case ItemID.Excalibur: case ItemID.TrueExcalibur: - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffType(), 120); break; case ItemID.FieryGreatsword: @@ -129,7 +135,7 @@ namespace CalamityMod.CalPlayer break; case ItemID.BloodButcherer: - target.AddBuff(ModContent.BuffType(), 60); + target.AddBuff(BuffType(), 60); break; case ItemID.IceSickle: @@ -147,7 +153,7 @@ namespace CalamityMod.CalPlayer NPCDebuffs(target, item.melee, item.ranged, item.magic, item.summon, item.Calamity().rogue, false); // Shattered Community tracks all damage dealt with Rage Mode (ignoring dummies). - if (target.type == NPCID.TargetDummy || target.type == ModContent.NPCType()) + if (target.type == NPCID.TargetDummy || target.type == NPCType()) return; if (rageModeActive && shatteredCommunity) ShatteredCommunity.AccumulateRageDamage(player, this, damage); @@ -167,7 +173,13 @@ namespace CalamityMod.CalPlayer if (witheringWeaponEnchant) witheringDamageDone += (int)(damage * (crit ? 2D : 1D)); - switch (proj.type) + target.Calamity().IncreasedHeatEffects = fireball || cinnamonRoll; + + target.Calamity().IncreasedColdEffects = eskimoSet; + + target.Calamity().IncreasedSicknessAndWaterEffects = evergreenGin; + + switch (proj.type) { case ProjectileID.CobaltNaginata: target.Calamity().miscDefenseLoss = (int)(target.defense * 0.25); @@ -207,7 +219,7 @@ namespace CalamityMod.CalPlayer case ProjectileID.CrimsonYoyo: case ProjectileID.BloodCloudRaining: case ProjectileID.BloodRain: - target.AddBuff(ModContent.BuffType(), 60); + target.AddBuff(BuffType(), 60); break; case ProjectileID.BallOHurt: @@ -239,17 +251,17 @@ namespace CalamityMod.CalPlayer break; case ProjectileID.GolemFist: - target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(BuffType(), 180); break; case ProjectileID.DeathSickle: - target.AddBuff(ModContent.BuffType(), 60); + target.AddBuff(BuffType(), 60); break; case ProjectileID.LightBeam: case ProjectileID.Gungnir: case ProjectileID.PaladinsHammerFriendly: - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffType(), 120); break; case ProjectileID.DarkLance: @@ -275,7 +287,7 @@ namespace CalamityMod.CalPlayer break; case ProjectileID.BoneArrow: - target.AddBuff(ModContent.BuffType(), 300); + target.AddBuff(BuffType(), 300); break; case ProjectileID.FrostBlastFriendly: @@ -317,9 +329,9 @@ namespace CalamityMod.CalPlayer if (!proj.npcProj && !proj.trap && proj.friendly) { if ((plaguebringerCarapace || uberBees) && CalamityLists.friendlyBeeList.Contains(proj.type)) - target.AddBuff(ModContent.BuffType(), 300); + target.AddBuff(BuffType(), 300); - if (proj.type == ProjectileID.IchorArrow && player.ActiveItem().type == ModContent.ItemType()) + if (proj.type == ProjectileID.IchorArrow && player.ActiveItem().type == ItemType()) target.AddBuff(BuffID.Midas, 300, false); ProjLifesteal(target, proj, damage, crit); @@ -327,7 +339,7 @@ namespace CalamityMod.CalPlayer NPCDebuffs(target, proj.melee, proj.ranged, proj.magic, proj.IsSummon(), proj.Calamity().rogue, true); // Shattered Community tracks all damage dealt with Rage Mode (ignoring dummies). - if (target.type == NPCID.TargetDummy || target.type == ModContent.NPCType()) + if (target.type == NPCID.TargetDummy || target.type == NPCType()) return; if (rageModeActive && shatteredCommunity) @@ -365,12 +377,12 @@ namespace CalamityMod.CalPlayer break; case ItemID.DeathSickle: - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffType(), 120); break; case ItemID.Excalibur: case ItemID.TrueExcalibur: - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffType(), 120); break; case ItemID.FieryGreatsword: @@ -389,16 +401,16 @@ namespace CalamityMod.CalPlayer case ItemID.LightsBane: case ItemID.NightsEdge: - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffType(), 120); break; case ItemID.TrueNightsEdge: target.AddBuff(BuffID.CursedInferno, 60); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffType(), 120); break; case ItemID.BloodButcherer: - target.AddBuff(ModContent.BuffType(), 60); + target.AddBuff(BuffType(), 60); break; case ItemID.IceSickle: @@ -440,7 +452,7 @@ namespace CalamityMod.CalPlayer break; case ProjectileID.TheRottedFork: - target.AddBuff(ModContent.BuffType(), 60); + target.AddBuff(BuffType(), 60); break; case ProjectileID.ObsidianSwordfish: @@ -467,21 +479,21 @@ namespace CalamityMod.CalPlayer break; case ProjectileID.GolemFist: - target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(BuffType(), 180); break; case ProjectileID.DeathSickle: - target.AddBuff(ModContent.BuffType(), 60); + target.AddBuff(BuffType(), 60); break; case ProjectileID.LightBeam: case ProjectileID.Gungnir: case ProjectileID.PaladinsHammerFriendly: - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffType(), 120); break; case ProjectileID.DarkLance: - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffType(), 120); break; case ProjectileID.PoisonedKnife: @@ -503,7 +515,7 @@ namespace CalamityMod.CalPlayer break; case ProjectileID.BoneArrow: - target.AddBuff(ModContent.BuffType(), 300); + target.AddBuff(BuffType(), 300); break; case ProjectileID.FrostBlastFriendly: @@ -535,7 +547,7 @@ namespace CalamityMod.CalPlayer case ProjectileID.NightBeam: target.AddBuff(BuffID.CursedInferno, 60); - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffType(), 120); break; } @@ -543,7 +555,7 @@ namespace CalamityMod.CalPlayer { if ((plaguebringerCarapace || uberBees) && CalamityLists.friendlyBeeList.Contains(proj.type)) { - target.AddBuff(ModContent.BuffType(), 300); + target.AddBuff(BuffType(), 300); } ProjOnHit(proj, target.Center, crit, true); PvpDebuffs(target, proj.melee, proj.ranged, proj.magic, proj.IsSummon(), proj.Calamity().rogue, true); @@ -1312,7 +1324,7 @@ namespace CalamityMod.CalPlayer } if (titanHeartMask) { - target.AddBuff(BuffType(), 60 * Main.rand.Next(1, 6), false); // 1 to 5 seconds + target.AddBuff(BuffType(), 120); } if (corrosiveSpine) { @@ -1456,7 +1468,7 @@ namespace CalamityMod.CalPlayer } if (titanHeartMask) { - target.AddBuff(BuffType(), 60 * Main.rand.Next(1, 6), false); // 1 to 5 seconds + target.AddBuff(BuffType(), 120); } if (corrosiveSpine) { diff --git a/CalamityLists.cs b/CalamityLists.cs index b0ecbda121..03445ee35d 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -24,6 +24,7 @@ using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Items.Weapons.Summon; using CalamityMod.NPCs.Abyss; using CalamityMod.NPCs.AcidRain; +using CalamityMod.NPCs.AdultEidolonWyrm; using CalamityMod.NPCs.AquaticScourge; using CalamityMod.NPCs.Astral; using CalamityMod.NPCs.AstrumAureus; @@ -94,9 +95,6 @@ namespace CalamityMod public static List friendlyBeeList; public static List hardModeNerfList; public static List debuffList; - public static List fireWeaponList; - public static List iceWeaponList; - public static List natureWeaponList; public static List alcoholList; public static List spearAutoreuseList; public static List pumpkinMoonBuffList; @@ -955,353 +953,6 @@ namespace CalamityMod BuffType() }; - fireWeaponList = new List() // Includes drops and crafts from the Betsy, Yharon, and Providence, listed A-Z. - { - ItemType(), - ItemID.ApprenticeStaffT3, - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemID.BookofSkulls, - ItemType(), - ItemType(), - ItemID.Cascade, - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemID.DayBreak, - ItemType(), - ItemID.DD2BetsyBow, - ItemID.DD2FlameburstTowerT1Popper, - ItemID.DD2FlameburstTowerT2Popper, - ItemID.DD2FlameburstTowerT3Popper, - ItemID.DD2PhoenixBow, - ItemID.DD2SquireDemonSword, - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemID.EldMelter, - ItemType(), - ItemType(), - ItemType(), - ItemID.FieryGreatsword, - ItemType(), - ItemID.Flamarang, - ItemType(), - ItemID.Flamelash, - ItemType(), - ItemID.Flamethrower, - ItemType(), - ItemID.FlareGun, - ItemType(), - ItemID.FlowerofFire, - ItemType(), - ItemType(), - ItemType(), - ItemID.HeatRay, - ItemID.HelFire, - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemID.HellwingBow, - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemID.TheHorsemansBlade, - ItemID.ImpStaff, - ItemType(), - ItemID.InfernoFork, - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemID.MeteorStaff, - ItemID.MolotovCocktail, - ItemType(), - ItemID.MoltenFury, - ItemType(), - ItemType(), - ItemID.PhoenixBlaster, - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemID.SolarEruption, - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemID.Sunfury, - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemID.WandofSparking - }; - - iceWeaponList = new List() // TODO: Fix this list. - { - ItemID.IceBlade, - ItemID.IceSickle, - ItemID.Frostbrand, - ItemID.Amarok, - ItemID.NorthPole, - ItemID.IceBoomerang, - ItemID.IceBow, - ItemID.SnowmanCannon, - ItemID.SnowballCannon, - ItemID.IceRod, - ItemID.FlowerofFrost, - ItemID.FrostStaff, - ItemID.BlizzardStaff, - ItemID.StaffoftheFrostHydra, - ItemID.Snowball, - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType() - }; - - natureWeaponList = new List() // Includes drops and crafts from the Scourges, Giant Clam, Fishrons, Crabulon, Queen Bee, Abyss minibosses, GSS, and Acid Rain, listed A-Z. - { - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemID.Bananarang, - ItemType(), - ItemType(), - ItemType(), - ItemID.BatScepter, - ItemID.BeeGun, - ItemID.BeeKeeper, - ItemID.Beenade, - ItemID.BeesKnees, - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemID.BladeofGrass, - ItemID.Bladetongue, - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemID.BubbleGun, - ItemType(), - ItemType(), - ItemID.ChlorophyteClaymore, - ItemID.ChlorophytePartisan, - ItemID.ChlorophyteSaber, - ItemID.ChlorophyteShotbow, - ItemID.ChristmasTreeSword, - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemID.CrystalSerpent, - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemID.Flairon, - ItemType(), - ItemType(), - ItemID.FlowerPow, - ItemType(), - ItemID.FrostDaggerfish, - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemID.HornetStaff, - ItemType(), - ItemID.JungleYoyo, - ItemType(), - ItemID.LeafBlower, - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemID.MushroomSpear, - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemID.PoisonStaff, - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemID.PygmyStaff, - ItemType(), - ItemID.QueenSpiderStaff, - ItemID.RavenStaff, - ItemID.RazorbladeTyphoon, - ItemID.Razorpine, - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemID.Seedler, - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemID.SlimeStaff, - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemID.SpiderStaff, - ItemType(), - ItemType(), - ItemID.StaffofEarth, - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemID.TempestStaff, - ItemType(), - ItemID.TerraBlade, - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemID.ThornChakram, - ItemType(), - ItemID.Toxikarp, - ItemType(), - ItemID.Tsunami, - ItemType(), - ItemType(), - ItemType(), - ItemType(), - ItemID.VenomStaff, - ItemType(), - ItemType(), - ItemType(), - ItemID.WaspGun, - ItemType(), - ItemType(), - ItemType(), - ItemID.Yelets - - }; - alcoholList = new List() { BuffType(), @@ -1641,7 +1292,6 @@ namespace CalamityMod ItemType(), ItemType(), ItemType(), - ItemType(), ItemType() }; @@ -1786,7 +1436,6 @@ namespace CalamityMod ItemType(), ItemType(), ItemType(), - ItemType(), ItemType(), ItemType(), ItemType(), @@ -1831,8 +1480,6 @@ namespace CalamityMod ProjectileType(), ProjectileType(), ProjectileType(), - ProjectileType(), - ProjectileType(), ProjectileType(), ProjectileType(), ProjectileType(), @@ -3005,7 +2652,8 @@ namespace CalamityMod ProjectileType(), ProjectileType(), ProjectileType(), - ProjectileType() + ProjectileType(), + ProjectileType() }; ZeroMinionSlotExceptionList = new List() @@ -3044,9 +2692,6 @@ namespace CalamityMod beeProjectileList = null; hardModeNerfList = null; debuffList = null; - fireWeaponList = null; - iceWeaponList = null; - natureWeaponList = null; alcoholList = null; spearAutoreuseList = null; pumpkinMoonBuffList = null; diff --git a/CalamityMod.cs b/CalamityMod.cs index 952280e2da..c8afc7179d 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -12,6 +12,7 @@ using CalamityMod.Items.Dyes.HairDye; using CalamityMod.Localization; using CalamityMod.NPCs; using CalamityMod.NPCs.Abyss; +using CalamityMod.NPCs.AdultEidolonWyrm; using CalamityMod.NPCs.AquaticScourge; using CalamityMod.NPCs.AstrumAureus; using CalamityMod.NPCs.AstrumDeus; @@ -259,6 +260,8 @@ namespace CalamityMod AddEquipTexture(new FeatherCrownHair(), null, EquipType.Head, "FeatherCrownHead", "CalamityMod/Items/Accessories/FeatherCrown_Face"); AddEquipTexture(new MoonstoneCrownHair(), null, EquipType.Head, "MoonstoneCrownHead", "CalamityMod/Items/Accessories/MoonstoneCrown_Face"); + AddEquipTexture(null, EquipType.Legs, "CirrusDress_Legs", "CalamityMod/Items/Armor/CirrusDress_Legs"); + AstralCactusTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/Tiles/AstralCactus"); AstralCactusGlowTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/Tiles/AstralCactusGlow"); AstralSky = ModContent.GetTexture("CalamityMod/ExtraTextures/AstralSky"); @@ -893,10 +896,14 @@ namespace CalamityMod if (Main.gameMenu) BossRushEvent.StartTimer = 0; - if (BossRushEvent.BossRushActive || BossRushEvent.StartTimer > 0) + float bossRushWhiteFade = BossRushEvent.StartTimer / (float)BossRushEvent.StartEffectTotalTime; + if (BossRushSky.ShouldDrawRegularly) + bossRushWhiteFade = 1f; + + if (BossRushEvent.BossRushActive || BossRushEvent.StartTimer > 0 || BossRushSky.ShouldDrawRegularly) { - backgroundColor = Color.Lerp(backgroundColor, Color.LightGray, BossRushEvent.StartTimer / (float)BossRushEvent.StartEffectTotalTime); - tileColor = Color.Lerp(tileColor, Color.LightGray, BossRushEvent.StartTimer / (float)BossRushEvent.StartEffectTotalTime); + backgroundColor = Color.Lerp(backgroundColor, Color.LightGray, bossRushWhiteFade); + tileColor = Color.Lerp(tileColor, Color.LightGray, bossRushWhiteFade); } else if (SkyManager.Instance["CalamityMod:ExoMechs"].IsActive()) { diff --git a/Effects/ArtAttackTrail.fx b/Effects/ArtAttackTrail.fx new file mode 100644 index 0000000000..61cb900fa9 --- /dev/null +++ b/Effects/ArtAttackTrail.fx @@ -0,0 +1,68 @@ +sampler uImage0 : register(s0); +sampler uImage1 : register(s1); +float3 uColor; +float3 uSecondaryColor; +float uOpacity; +float uSaturation; +float uRotation; +float uTime; +float4 uSourceRect; +float2 uWorldPosition; +float uDirection; +float3 uLightSource; +float2 uImageSize0; +float2 uImageSize1; +matrix uWorldViewProjection; +float shouldFlip; + +struct VertexShaderInput +{ + float4 Position : POSITION0; + float4 Color : COLOR0; + float2 TextureCoordinates : TEXCOORD0; +}; + +struct VertexShaderOutput +{ + float4 Position : SV_POSITION; + float4 Color : COLOR0; + float2 TextureCoordinates : TEXCOORD0; +}; + +VertexShaderOutput VertexShaderFunction(in VertexShaderInput input) +{ + VertexShaderOutput output = (VertexShaderOutput)0; + float4 pos = mul(input.Position, uWorldViewProjection); + output.Position = pos; + + output.Color = input.Color; + output.TextureCoordinates = input.TextureCoordinates; + + return output; +} + +float InverseLerp(float a, float b, float x) +{ + return saturate((x - a) / (b - a)); +} + +float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0 +{ + float4 color = input.Color; + float2 coords = input.TextureCoordinates; + + // Read the fade map as a streak. + float4 fadeMapColor = tex2D(uImage1, coords - float2(uTime * 0.6, 0)); + float opacity = fadeMapColor.r; + float bloomOpacity = sin(coords.y * 3.141) * 1.4; + return lerp(color * bloomOpacity, color * opacity, InverseLerp(0, 0.26, coords.x)); +} + +technique Technique1 +{ + pass TrailPass + { + VertexShader = compile vs_2_0 VertexShaderFunction(); + PixelShader = compile ps_2_0 PixelShaderFunction(); + } +} diff --git a/Effects/ArtAttackTrail.xnb b/Effects/ArtAttackTrail.xnb new file mode 100644 index 0000000000..4878feff50 Binary files /dev/null and b/Effects/ArtAttackTrail.xnb differ diff --git a/Effects/CalamityShaders.cs b/Effects/CalamityShaders.cs index 264936e182..e244ab9f98 100644 --- a/Effects/CalamityShaders.cs +++ b/Effects/CalamityShaders.cs @@ -26,6 +26,7 @@ namespace CalamityMod.Effects public static Effect RancorMagicCircleShader; public static Effect BasicTintShader; public static Effect DoGDisintegrationShader; + public static Effect ArtAttackTrailShader; public static Effect BaseFusableParticleEdgeShader; public static Effect AdditiveFusableParticleEdgeShader; @@ -55,6 +56,7 @@ namespace CalamityMod.Effects RancorMagicCircleShader = CalamityMod.Instance.GetEffect("Effects/RancorMagicCircle"); BasicTintShader = CalamityMod.Instance.GetEffect("Effects/BasicTint"); DoGDisintegrationShader = CalamityMod.Instance.GetEffect("Effects/DoGDisintegration"); + ArtAttackTrailShader = CalamityMod.Instance.GetEffect("Effects/ArtAttackTrail"); BaseFusableParticleEdgeShader = CalamityMod.Instance.GetEffect("Effects/ParticleFusion/BaseFusableParticleEdgeShader"); AdditiveFusableParticleEdgeShader = CalamityMod.Instance.GetEffect("Effects/ParticleFusion/AdditiveFusableParticleEdgeShader"); @@ -82,6 +84,7 @@ namespace CalamityMod.Effects GameShaders.Misc["CalamityMod:RancorMagicCircle"] = new MiscShaderData(new Ref(RancorMagicCircleShader), "ShieldPass"); GameShaders.Misc["CalamityMod:BasicTint"] = new MiscShaderData(new Ref(BasicTintShader), "TintPass"); GameShaders.Misc["CalamityMod:DoGDisintegration"] = new MiscShaderData(new Ref(DoGDisintegrationShader), "DisintegrationPass"); + GameShaders.Misc["CalamityMod:ArtAttack"] = new MiscShaderData(new Ref(ArtAttackTrailShader), "TrailPass"); GameShaders.Misc["CalamityMod:BaseFusableParticleEdge"] = new MiscShaderData(new Ref(BaseFusableParticleEdgeShader), "ParticlePass"); GameShaders.Misc["CalamityMod:AdditiveFusableParticleEdge"] = new MiscShaderData(new Ref(AdditiveFusableParticleEdgeShader), "ParticlePass"); diff --git a/Events/BossRushSky.cs b/Events/BossRushSky.cs index 9f8cb29231..e552385f28 100644 --- a/Events/BossRushSky.cs +++ b/Events/BossRushSky.cs @@ -9,14 +9,40 @@ namespace CalamityMod.Events { public class BossRushSky : CustomSky { - public bool CurrentlyActive = false; + public bool CurrentlyActive; public float Intensity = 0f; public static float IdleTimer = 0f; public static float CurrentInterest = 0f; public static float IncrementalInterest = 0f; public static float CurrentInterestMin = 0f; + public static bool ShouldDrawRegularly; public static Color GeneralColor => Color.Lerp(Color.LightGray, Color.Black, BossRushEvent.WhiteDimness) * 0.2f; + public static bool DetermineDrawEligibility() + { + bool useEffect = (BossRushEvent.BossRushActive && BossRushEvent.StartTimer > 100) || ShouldDrawRegularly; + + if (SkyManager.Instance["CalamityMod:BossRush"] != null && useEffect != SkyManager.Instance["CalamityMod:BossRush"].IsActive()) + { + if (useEffect) + SkyManager.Instance.Activate("CalamityMod:BossRush"); + + else + { + SkyManager.Instance.Deactivate("CalamityMod:BossRush", new object[0]); + } + } + if (useEffect != Filters.Scene["CalamityMod:BossRush"].IsActive()) + { + if (useEffect) + Filters.Scene.Activate("CalamityMod:BossRush"); + else + Filters.Scene["CalamityMod:BossRush"].Deactivate(new object[0]); + } + + return useEffect; + } + public override void Update(GameTime gameTime) { if (CurrentlyActive) @@ -37,7 +63,10 @@ namespace CalamityMod.Events } private float GetIntensity() - { + { + if (ShouldDrawRegularly) + return 1f; + float fadeRatio = BossRushEvent.StartTimer / (float)BossRushEvent.StartEffectTotalTime; return Utils.InverseLerp(0.57f, 1f, fadeRatio, true); } @@ -71,8 +100,8 @@ namespace CalamityMod.Events Main.spriteBatch.End(); Main.spriteBatch.Begin(); - // Draw the Xeroc eye at the back of the background. - if (maxDepth >= float.MaxValue && minDepth < float.MaxValue && BossRushEvent.EndTimer < BossRushEvent.EndVisualEffectTime - 40f) + // Draw the Xeroc eye at the back of the sky. + if (maxDepth >= float.MaxValue && minDepth < float.MaxValue && (BossRushEvent.EndTimer < BossRushEvent.EndVisualEffectTime - 40f || ShouldDrawRegularly)) { Vector2 screenCenter = Main.screenPosition + new Vector2(Main.screenWidth, Main.screenHeight) * 0.5f; float scale = MathHelper.Lerp(0.8f, 0.9f, IncrementalInterest) + (float)Math.Sin(IdleTimer) * 0.01f; @@ -94,6 +123,9 @@ namespace CalamityMod.Events spriteBatch.Draw(eyeTexture, drawPosition + drawOffset, null, fadedColor, 0f, eyeTexture.Size() * 0.5f, scale, SpriteEffects.None, 0f); } } + + if (ShouldDrawRegularly) + ShouldDrawRegularly = false; } public override float GetCloudAlpha() => 1f - GetIntensity(); diff --git a/ExtraTextures/IronHeart.png b/ExtraTextures/IronHeart.png deleted file mode 100644 index 02a90d27e2..0000000000 Binary files a/ExtraTextures/IronHeart.png and /dev/null differ diff --git a/ExtraTextures/Tanks/Backpack_HalleysInferno.png b/ExtraTextures/Tanks/Backpack_HalleysInferno.png index 9c7967d20c..cf380d95ed 100644 Binary files a/ExtraTextures/Tanks/Backpack_HalleysInferno.png and b/ExtraTextures/Tanks/Backpack_HalleysInferno.png differ diff --git a/Gores/WyvernWeapons/ClamorNoctusBody.png b/Gores/WyvernWeapons/ClamorNoctusBody.png index 20b5978107..fed1db2d2e 100644 Binary files a/Gores/WyvernWeapons/ClamorNoctusBody.png and b/Gores/WyvernWeapons/ClamorNoctusBody.png differ diff --git a/Gores/WyvernWeapons/ClamorNoctusHead.png b/Gores/WyvernWeapons/ClamorNoctusHead.png index 92308b8f97..7ab312edd3 100644 Binary files a/Gores/WyvernWeapons/ClamorNoctusHead.png and b/Gores/WyvernWeapons/ClamorNoctusHead.png differ diff --git a/Gores/WyvernWeapons/ClamorNoctusTail.png b/Gores/WyvernWeapons/ClamorNoctusTail.png index 9a3e618fe3..02d8c84a0c 100644 Binary files a/Gores/WyvernWeapons/ClamorNoctusTail.png and b/Gores/WyvernWeapons/ClamorNoctusTail.png differ diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index 0999877274..d164469225 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -48,8 +48,6 @@ namespace CalamityMod.ILEditing IL.Terraria.Player.QuickMana += ApplyManaBurnIfNeeded; IL.Terraria.Player.ItemCheck += ApplyManaBurnIfNeeded; IL.Terraria.Player.AddBuff += AllowBuffTimeStackingForManaBurn; - IL.Terraria.Main.DoDraw += DrawFusableParticles; - IL.Terraria.Main.DoDraw += DrawAshParticles; On.Terraria.Main.DrawInterface += DrawGeneralParticles; On.Terraria.Main.SetDisplayMode += ResetRenderTargetSizes; IL.Terraria.Main.DrawTiles += DrawCustomLava; @@ -123,8 +121,6 @@ namespace CalamityMod.ILEditing IL.Terraria.Player.QuickMana -= ApplyManaBurnIfNeeded; IL.Terraria.Player.ItemCheck -= ApplyManaBurnIfNeeded; IL.Terraria.Player.AddBuff -= AllowBuffTimeStackingForManaBurn; - IL.Terraria.Main.DoDraw -= DrawFusableParticles; - IL.Terraria.Main.DoDraw -= DrawAshParticles; On.Terraria.Main.DrawInterface -= DrawGeneralParticles; On.Terraria.Main.SetDisplayMode -= ResetRenderTargetSizes; IL.Terraria.Main.DrawTiles -= DrawCustomLava; diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index 031179cf16..c4532df202 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -492,58 +492,14 @@ namespace CalamityMod.ILEditing } #endregion Fire Cursor Effect for the Calamity Accessory - #region Fusable Particle Rendering - private static void DrawFusableParticles(ILContext il) - { - ILCursor cursor = new ILCursor(il); - - // Over NPCs but before Projectiles. - if (!cursor.TryGotoNext(c => c.MatchCallOrCallvirt
("SortDrawCacheWorms"))) - { - LogFailure("Fusable Particle Rendering", "Could not locate the SortDrawCacheWorms reference method to attach to."); - return; - } - cursor.EmitDelegate(() => FusableParticleManager.RenderAllFusableParticles(FusableParticleRenderLayer.OverNPCsBeforeProjectiles)); - - // Over Players. - if (!cursor.TryGotoNext(MoveType.After, c => c.MatchCallOrCallvirt
("DrawPlayers"))) - { - LogFailure("Fusable Particle Rendering", "Could not locate the DrawPlayers reference method to attach to."); - return; - } - cursor.EmitDelegate(() => FusableParticleManager.RenderAllFusableParticles(FusableParticleRenderLayer.OverPlayers)); - - // Over Water. - if (!cursor.TryGotoNext(c => c.MatchCallOrCallvirt("DrawWhite"))) - { - LogFailure("Fusable Particle Rendering", "Could not locate the DrawWhite reference method to attach to."); - return; - } - cursor.EmitDelegate(() => FusableParticleManager.RenderAllFusableParticles(FusableParticleRenderLayer.OverWater)); - } - #endregion Fusable Particle Rendering - - #region Ash Particle Rendering - private static void DrawAshParticles(ILContext il) - { - ILCursor cursor = new ILCursor(il); - - // Over NPCs but before Projectiles. - if (!cursor.TryGotoNext(c => c.MatchCallOrCallvirt
("DrawDust"))) - { - LogFailure("Ash Particle Rendering", "Could not locate the DrawDust reference method to attach to."); - return; - } - cursor.EmitDelegate(DeathAshParticle.DrawAll); - } - #endregion Ash Particle Rendering - #region General Particle Rendering private static void DrawGeneralParticles(On.Terraria.Main.orig_DrawInterface orig, Main self, GameTime gameTime) { + FusableParticleManager.RenderAllFusableParticles(); Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, default, null, null, Main.GameViewMatrix.ZoomMatrix); GeneralParticleHandler.DrawAllParticles(Main.spriteBatch); Main.spriteBatch.End(); + DeathAshParticle.DrawAll(); orig(self, gameTime); } diff --git a/ILEditing/VanillaBugfixingILChanges.cs b/ILEditing/VanillaBugfixingILChanges.cs index 6059f39ebd..be01253f8b 100644 --- a/ILEditing/VanillaBugfixingILChanges.cs +++ b/ILEditing/VanillaBugfixingILChanges.cs @@ -21,7 +21,7 @@ namespace CalamityMod.ILEditing } // This list should contain all vanilla NPCs present in Boss Rush which ARE NOT bosses and whose health is boosted over 32,767. - private static readonly List NeedsFourLifeBytes = new List() + private static List NeedsFourLifeBytes => new List() { // King Slime NPCID.BlueSlime, diff --git a/Items/Accessories/Affliction.cs b/Items/Accessories/Affliction.cs index 1b9e5f3273..0b75a7ce7b 100644 --- a/Items/Accessories/Affliction.cs +++ b/Items/Accessories/Affliction.cs @@ -23,7 +23,6 @@ namespace CalamityMod.Items.Accessories item.height = 44; item.value = CalamityGlobalItem.Rarity13BuyPrice; item.accessory = true; - item.expert = true; item.rare = ItemRarityID.Red; } diff --git a/Items/Accessories/AmalgamatedBrain.cs b/Items/Accessories/AmalgamatedBrain.cs index 86d3e0e426..9fe71e48db 100644 --- a/Items/Accessories/AmalgamatedBrain.cs +++ b/Items/Accessories/AmalgamatedBrain.cs @@ -23,7 +23,6 @@ namespace CalamityMod.Items.Accessories item.width = 34; item.height = 34; item.value = CalamityGlobalItem.Rarity4BuyPrice; - item.expert = true; item.rare = ItemRarityID.LightRed; item.accessory = true; } diff --git a/Items/Accessories/AngelTreads.cs b/Items/Accessories/AngelTreads.cs index 723b96c2af..109e396cde 100644 --- a/Items/Accessories/AngelTreads.cs +++ b/Items/Accessories/AngelTreads.cs @@ -19,6 +19,7 @@ namespace CalamityMod.Items.Accessories "Increased flight time\n" + "Greater mobility on ice\n" + "Water and lava walking\n" + + "Immunity to the On Fire! debuff\n" + "Temporary immunity to lava"); } @@ -57,6 +58,7 @@ namespace CalamityMod.Items.Accessories player.waterWalk = true; player.fireWalk = true; player.lavaMax += 240; + player.buffImmune[BuffID.OnFire] = true; } public override void AddRecipes() diff --git a/Items/Accessories/AquaticEmblem.cs b/Items/Accessories/AquaticEmblem.cs index 4b64313146..d3edff7aac 100644 --- a/Items/Accessories/AquaticEmblem.cs +++ b/Items/Accessories/AquaticEmblem.cs @@ -25,7 +25,6 @@ namespace CalamityMod.Items.Accessories item.value = CalamityGlobalItem.Rarity5BuyPrice; item.rare = ItemRarityID.Pink; item.accessory = true; - item.expert = true; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/ArcanumoftheVoid.cs b/Items/Accessories/ArcanumoftheVoid.cs deleted file mode 100644 index ef729c27f7..0000000000 --- a/Items/Accessories/ArcanumoftheVoid.cs +++ /dev/null @@ -1,35 +0,0 @@ -using CalamityMod.CalPlayer; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Accessories -{ - public class ArcanumoftheVoid : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Arcanum of the Void"); - Tooltip.SetDefault("You reflect projectiles when they hit you\n" + - "Reflected projectiles deal no damage to you\n" + - "This reflect has a 90 second cooldown which is shared with all other dodges and reflects\n"); - } - - public override void SetDefaults() - { - item.width = 26; - item.height = 26; - item.accessory = true; - item.value = CalamityGlobalItem.Rarity12BuyPrice; - item.rare = ItemRarityID.Purple; - item.Calamity().customRarity = CalamityRarity.Turquoise; - item.expert = true; - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - CalamityPlayer modPlayer = player.Calamity(); - modPlayer.projRef = true; - } - } -} diff --git a/Items/Accessories/ArcanumoftheVoid.png b/Items/Accessories/ArcanumoftheVoid.png deleted file mode 100644 index 0dea4e456d..0000000000 Binary files a/Items/Accessories/ArcanumoftheVoid.png and /dev/null differ diff --git a/Items/Accessories/AsgardianAegis.cs b/Items/Accessories/AsgardianAegis.cs index 224ff5ee72..3e860b30b3 100644 --- a/Items/Accessories/AsgardianAegis.cs +++ b/Items/Accessories/AsgardianAegis.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Accessories public override void SetStaticDefaults() { DisplayName.SetDefault("Asgardian Aegis"); - Tooltip.SetDefault("Grants immunity to fire blocks and knockback\n" + + Tooltip.SetDefault("Grants immunity to knockback\n" + "Immune to most debuffs\n" + "+40 max life and increased life regeneration\n" + "Grants a supreme holy flame dash\n" + @@ -59,6 +59,7 @@ namespace CalamityMod.Items.Accessories player.fireWalk = true; player.statLifeMax2 += 40; player.lifeRegen++; + player.buffImmune[BuffID.OnFire] = true; player.buffImmune[BuffID.Chilled] = true; player.buffImmune[BuffID.Frostburn] = true; player.buffImmune[BuffID.Weak] = true; diff --git a/Items/Accessories/AsgardsValor.cs b/Items/Accessories/AsgardsValor.cs index 1f2426e97a..a3825a44b7 100644 --- a/Items/Accessories/AsgardsValor.cs +++ b/Items/Accessories/AsgardsValor.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Accessories public override void SetStaticDefaults() { DisplayName.SetDefault("Asgard's Valor"); - Tooltip.SetDefault("Grants immunity to fire blocks and knockback\n" + + Tooltip.SetDefault("Grants immunity to knockback\n" + "Immune to most debuffs and reduces the damage caused by the Brimstone Flames debuff\n" + "+16 defense while submerged in liquid\n" + "+20 max life\n" + @@ -38,6 +38,7 @@ namespace CalamityMod.Items.Accessories player.noKnockback = true; player.fireWalk = true; modPlayer.abaddon = true; + player.buffImmune[BuffID.OnFire] = true; player.buffImmune[BuffID.Chilled] = true; player.buffImmune[BuffID.Frostburn] = true; player.buffImmune[BuffID.Weak] = true; diff --git a/Items/Accessories/AstralArcanum.cs b/Items/Accessories/AstralArcanum.cs index 3ef9954f87..f3c42667aa 100644 --- a/Items/Accessories/AstralArcanum.cs +++ b/Items/Accessories/AstralArcanum.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.CalPlayer; +using CalamityMod.Items.Materials; using System.Collections.Generic; using Terraria; using Terraria.ID; @@ -12,11 +13,7 @@ namespace CalamityMod.Items.Accessories public override void SetStaticDefaults() { DisplayName.SetDefault("Astral Arcanum"); - Tooltip.SetDefault("Taking damage drops astral stars from the sky\n" + - "Provides immunity to the astral infection debuff\n" + - "You reflect projectiles when they hit you\n" + - "Reflected projectiles deal no damage to you\n" + - "This reflect has a 90 second cooldown which is shared with all other dodges and reflects\n" + + Tooltip.SetDefault("Provides immunity to the astral infection debuff\n" + "Boosts life regen even while under the effects of a damaging debuff\n" + "While under the effects of a damaging debuff you will gain 15 defense\n" + "TOOLTIP LINE HERE"); @@ -29,7 +26,6 @@ namespace CalamityMod.Items.Accessories item.height = 26; item.value = CalamityGlobalItem.Rarity12BuyPrice; item.accessory = true; - item.expert = true; item.Calamity().customRarity = CalamityRarity.Turquoise; } @@ -49,8 +45,6 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer modPlayer = player.Calamity(); modPlayer.astralArcanum = true; - modPlayer.aBulwark = true; - modPlayer.projRef = true; player.buffImmune[ModContent.BuffType()] = true; } @@ -58,9 +52,9 @@ namespace CalamityMod.Items.Accessories { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddTile(TileID.LunarCraftingStation); + recipe.AddIngredient(ModContent.ItemType(), 3); + recipe.AddIngredient(ItemID.LunarBar, 5); + recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); recipe.AddRecipe(); } diff --git a/Items/Accessories/AstralBulwark.cs b/Items/Accessories/AstralBulwark.cs deleted file mode 100644 index 6d74e72ce3..0000000000 --- a/Items/Accessories/AstralBulwark.cs +++ /dev/null @@ -1,35 +0,0 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.CalPlayer; -using Terraria; -using Terraria.ModLoader; -using Terraria.ID; - -namespace CalamityMod.Items.Accessories -{ - public class AstralBulwark : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Astral Bulwark"); - Tooltip.SetDefault("Taking damage drops astral stars from the sky\n" + - "Provides immunity to the astral infection debuff"); - } - - public override void SetDefaults() - { - item.width = 26; - item.height = 26; - item.value = CalamityGlobalItem.Rarity9BuyPrice; - item.expert = true; - item.rare = ItemRarityID.Cyan; - item.accessory = true; - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - CalamityPlayer modPlayer = player.Calamity(); - modPlayer.aBulwark = true; - player.buffImmune[ModContent.BuffType()] = true; - } - } -} diff --git a/Items/Accessories/AstralBulwark.png b/Items/Accessories/AstralBulwark.png deleted file mode 100644 index 2b113c5362..0000000000 Binary files a/Items/Accessories/AstralBulwark.png and /dev/null differ diff --git a/Items/Accessories/BlazingCore.cs b/Items/Accessories/BlazingCore.cs index 4358680b98..8b6fe6460b 100644 --- a/Items/Accessories/BlazingCore.cs +++ b/Items/Accessories/BlazingCore.cs @@ -27,7 +27,6 @@ namespace CalamityMod.Items.Accessories item.width = 42; item.height = 46; item.accessory = true; - item.expert = true; item.rare = ItemRarityID.Purple; item.value = CalamityGlobalItem.Rarity12BuyPrice; } diff --git a/Items/Accessories/BloodflareCore.cs b/Items/Accessories/BloodflareCore.cs index ce0995e20b..f716fd3a73 100644 --- a/Items/Accessories/BloodflareCore.cs +++ b/Items/Accessories/BloodflareCore.cs @@ -18,7 +18,6 @@ namespace CalamityMod.Items.Accessories item.width = 26; item.height = 26; item.value = CalamityGlobalItem.Rarity13BuyPrice; - item.expert = true; item.rare = ItemRarityID.Red; item.accessory = true; } diff --git a/Items/Accessories/BloodyWormScarf.cs b/Items/Accessories/BloodyWormScarf.cs index abaeaa2f12..fd0843eb27 100644 --- a/Items/Accessories/BloodyWormScarf.cs +++ b/Items/Accessories/BloodyWormScarf.cs @@ -18,7 +18,6 @@ namespace CalamityMod.Items.Accessories item.width = 26; item.height = 42; item.value = CalamityGlobalItem.Rarity4BuyPrice; - item.expert = true; item.rare = ItemRarityID.LightRed; item.accessory = true; } diff --git a/Items/Accessories/BloodyWormTooth.cs b/Items/Accessories/BloodyWormTooth.cs index bdeba77c3d..d9a84740ff 100644 --- a/Items/Accessories/BloodyWormTooth.cs +++ b/Items/Accessories/BloodyWormTooth.cs @@ -19,7 +19,6 @@ namespace CalamityMod.Items.Accessories item.width = 12; item.height = 15; item.value = CalamityGlobalItem.Rarity3BuyPrice; - item.expert = true; item.rare = ItemRarityID.Orange; item.accessory = true; } diff --git a/Items/Accessories/Calamity.cs b/Items/Accessories/Calamity.cs index 4118551b08..3f412e455d 100644 --- a/Items/Accessories/Calamity.cs +++ b/Items/Accessories/Calamity.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Items.Accessories item.height = 108; item.rare = ItemRarityID.Purple; item.value = CalamityGlobalItem.RarityVioletBuyPrice; - item.expert = true; item.accessory = true; } diff --git a/Items/Accessories/CalamityRing.cs b/Items/Accessories/CalamityRing.cs index e6c0c802e5..0fc294bd77 100644 --- a/Items/Accessories/CalamityRing.cs +++ b/Items/Accessories/CalamityRing.cs @@ -25,7 +25,6 @@ namespace CalamityMod.Items.Accessories item.value = CalamityGlobalItem.Rarity7BuyPrice; item.rare = ItemRarityID.Lime; item.accessory = true; - item.expert = true; } public override bool CanEquipAccessory(Player player, int slot) => !player.Calamity().calamityRing; diff --git a/Items/Accessories/CelestialJewel.cs b/Items/Accessories/CelestialJewel.cs index 4bc94e17ec..f6ac5bd195 100644 --- a/Items/Accessories/CelestialJewel.cs +++ b/Items/Accessories/CelestialJewel.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Items.Accessories public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddRecipeGroup("AnyLargeGem"); + recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ItemID.TeleportationPotion, 3); recipe.AddIngredient(ModContent.ItemType(), 15); recipe.AddIngredient(ModContent.ItemType(), 15); diff --git a/Items/Accessories/CheatTestThing.cs b/Items/Accessories/CheatTestThing.cs index 053aba88e1..df462e70c1 100644 --- a/Items/Accessories/CheatTestThing.cs +++ b/Items/Accessories/CheatTestThing.cs @@ -10,8 +10,7 @@ namespace CalamityMod.Items.Accessories public override void SetStaticDefaults() { DisplayName.SetDefault("lul"); - Tooltip.SetDefault("Instantly kills you...\n" + - "Unless...?"); //This is mainly for the wiki, blank tooltips on accessories is bad. + Tooltip.SetDefault("Grants complete invulnerability to almost everything"); } public override void SetDefaults() @@ -25,16 +24,7 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { - CalamityPlayer modPlayer = player.Calamity(); - bool canUse = player.name == "Fabsol" || player.name == "Totalbiscuit" || player.name == "TotalBiscuit" || player.name == "Total Biscuit" || player.name == "Total biscuit"; - if (canUse) - { - modPlayer.lol = true; - } - else if (!player.immune) - { - player.KillMe(PlayerDeathReason.ByCustomReason(player.name + " isn't worthy."), 1000.0, 0, false); - } + player.Calamity().lol = true; } } } diff --git a/Items/Accessories/CoreOfTheBloodGod.cs b/Items/Accessories/CoreOfTheBloodGod.cs index e630de6917..d565bc6f28 100644 --- a/Items/Accessories/CoreOfTheBloodGod.cs +++ b/Items/Accessories/CoreOfTheBloodGod.cs @@ -25,7 +25,6 @@ namespace CalamityMod.Items.Accessories { item.width = item.height = 48; item.value = CalamityGlobalItem.Rarity14BuyPrice; - item.expert = true; item.rare = ItemRarityID.Red; item.accessory = true; } diff --git a/Items/Accessories/CounterScarf.cs b/Items/Accessories/CounterScarf.cs index 917c4667da..336e3c1d95 100644 --- a/Items/Accessories/CounterScarf.cs +++ b/Items/Accessories/CounterScarf.cs @@ -24,10 +24,9 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 26; - item.value = CalamityGlobalItem.Rarity2BuyPrice; - item.rare = ItemRarityID.Green; + item.value = CalamityGlobalItem.Rarity3BuyPrice; + item.rare = ItemRarityID.Orange; item.accessory = true; - item.Calamity().challengeDrop = true; } public override void ModifyTooltips(List list) diff --git a/Items/Accessories/CrownJewel.cs b/Items/Accessories/CrownJewel.cs index 069e501e51..2a95860269 100644 --- a/Items/Accessories/CrownJewel.cs +++ b/Items/Accessories/CrownJewel.cs @@ -22,7 +22,6 @@ namespace CalamityMod.Items.Accessories item.value = CalamityGlobalItem.Rarity1BuyPrice; item.rare = ItemRarityID.Blue; item.accessory = true; - item.Calamity().challengeDrop = true; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/DeepDiver.cs b/Items/Accessories/DeepDiver.cs index d44744634a..4440b7a495 100644 --- a/Items/Accessories/DeepDiver.cs +++ b/Items/Accessories/DeepDiver.cs @@ -22,7 +22,6 @@ namespace CalamityMod.Items.Accessories item.rare = ItemRarityID.Pink; item.defense = 8; item.accessory = true; - item.Calamity().challengeDrop = true; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/DeificAmulet.cs b/Items/Accessories/DeificAmulet.cs index b4f18b56df..af3790e499 100644 --- a/Items/Accessories/DeificAmulet.cs +++ b/Items/Accessories/DeificAmulet.cs @@ -19,8 +19,8 @@ namespace CalamityMod.Items.Accessories { item.width = 26; item.height = 26; - item.rare = ItemRarityID.Pink; - item.value = CalamityGlobalItem.Rarity5BuyPrice; + item.rare = ItemRarityID.Cyan; + item.value = CalamityGlobalItem.Rarity9BuyPrice; item.accessory = true; } diff --git a/Items/Accessories/DraedonsHeart.cs b/Items/Accessories/DraedonsHeart.cs index 4da62363ef..c8fdcbffa5 100644 --- a/Items/Accessories/DraedonsHeart.cs +++ b/Items/Accessories/DraedonsHeart.cs @@ -22,7 +22,6 @@ namespace CalamityMod.Items.Accessories item.width = 52; item.height = 68; item.accessory = true; - item.expert = true; item.rare = ItemRarityID.Red; item.value = CalamityGlobalItem.RarityVioletBuyPrice; item.Calamity().customRarity = CalamityRarity.Violet; diff --git a/Items/Accessories/DynamoStemCells.cs b/Items/Accessories/DynamoStemCells.cs index 5abcd03247..929eeb6837 100644 --- a/Items/Accessories/DynamoStemCells.cs +++ b/Items/Accessories/DynamoStemCells.cs @@ -22,7 +22,6 @@ Ranged weapons have a chance to fire mini swarmers"); item.value = CalamityGlobalItem.Rarity11BuyPrice; item.rare = ItemRarityID.Purple; item.accessory = true; - item.expert = true; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/ElysianAegis.cs b/Items/Accessories/ElysianAegis.cs index ae3f1fc771..c3e28f477e 100644 --- a/Items/Accessories/ElysianAegis.cs +++ b/Items/Accessories/ElysianAegis.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Accessories { DisplayName.SetDefault("Elysian Aegis"); Tooltip.SetDefault("Blessed by the Profaned Flame\n" + - "Grants immunity to fire blocks, knockback, and Holy Flames\n" + + "Grants immunity to knockback, and the Burning, On Fire!, and Holy Flames debuffs\n" + "+30 max life\n" + "Grants a supreme holy flame dash\n" + "Can be used to ram enemies\n" + @@ -52,6 +52,7 @@ namespace CalamityMod.Items.Accessories CalamityPlayer modPlayer = player.Calamity(); modPlayer.dashMod = 3; modPlayer.elysianAegis = true; + player.buffImmune[BuffID.OnFire] = true; player.buffImmune[ModContent.BuffType()] = true; player.noKnockback = true; player.fireWalk = true; diff --git a/Items/Accessories/EvasionScarf.cs b/Items/Accessories/EvasionScarf.cs index 84422b0010..fc6a945870 100644 --- a/Items/Accessories/EvasionScarf.cs +++ b/Items/Accessories/EvasionScarf.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Items.Accessories public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.RedandBlackDye); + recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ItemID.SoulofNight, 5); recipe.AddIngredient(ItemID.SoulofLight, 5); recipe.AddIngredient(ItemID.Silk, 15); diff --git a/Items/Accessories/FabledTortoiseShell.cs b/Items/Accessories/FabledTortoiseShell.cs index 6aa7ad1f5b..a7b92fd23f 100644 --- a/Items/Accessories/FabledTortoiseShell.cs +++ b/Items/Accessories/FabledTortoiseShell.cs @@ -26,7 +26,6 @@ namespace CalamityMod.Items.Accessories item.value = CalamityGlobalItem.Rarity5BuyPrice; item.rare = ItemRarityID.Pink; item.accessory = true; - item.Calamity().challengeDrop = true; } public override void ModifyTooltips(List list) diff --git a/Items/Accessories/FungalClump.cs b/Items/Accessories/FungalClump.cs index 471db96160..eb9d60b32a 100644 --- a/Items/Accessories/FungalClump.cs +++ b/Items/Accessories/FungalClump.cs @@ -23,7 +23,6 @@ namespace CalamityMod.Items.Accessories item.width = 20; item.height = 26; item.value = CalamityGlobalItem.Rarity2BuyPrice; - item.expert = true; item.rare = ItemRarityID.Green; item.accessory = true; } diff --git a/Items/Accessories/Gehenna.cs b/Items/Accessories/Gehenna.cs index c6cb8c73cf..877926c245 100644 --- a/Items/Accessories/Gehenna.cs +++ b/Items/Accessories/Gehenna.cs @@ -23,7 +23,6 @@ namespace CalamityMod.Items.Accessories item.width = 26; item.height = 26; item.value = CalamityGlobalItem.Rarity5BuyPrice; - item.expert = true; item.rare = ItemRarityID.Pink; item.accessory = true; } diff --git a/Items/Accessories/GoldBurdenBreaker.cs b/Items/Accessories/GoldBurdenBreaker.cs deleted file mode 100644 index cfc32f50c1..0000000000 --- a/Items/Accessories/GoldBurdenBreaker.cs +++ /dev/null @@ -1,60 +0,0 @@ -using CalamityMod.CalPlayer; -using CalamityMod.Projectiles.Typeless; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Accessories -{ - public class GoldBurdenBreaker : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Burden Breaker"); - Tooltip.SetDefault("The good time\n" + - "Go fast\n" + - "WARNING: May have disastrous results\n" + - "Increases horizontal movement speed beyond comprehension\n" + - "Does not work while a boss is alive"); - } - - public override void SetDefaults() - { - item.width = 28; - item.height = 28; - item.value = CalamityGlobalItem.Rarity5BuyPrice; - item.rare = ItemRarityID.Pink; - item.accessory = true; - item.Calamity().challengeDrop = true; - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - if (CalamityPlayer.areThereAnyDamnBosses) - { return; } - CalamityPlayer modPlayer = player.Calamity(); - modPlayer.dashMod = modPlayer.dashMod == 7 ? 0 : modPlayer.dashMod; //statis belt memes for projectile spam :feelsgreat: - modPlayer.burdenBreakerYeet = true; - // Completely remove movement restrictions if you're yeeting with the profaned spear - if (player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0) - { - if (player.velocity.X > 5f) - { - player.velocity.X *= 1.025f; - if (player.velocity.X >= 500f) - { - player.velocity.X = 0f; - } - } - else if (player.velocity.X < -5f) - { - player.velocity.X *= 1.025f; - if (player.velocity.X <= -500f) - { - player.velocity.X = 0f; - } - } - } - } - } -} diff --git a/Items/Accessories/GoldBurdenBreaker.png b/Items/Accessories/GoldBurdenBreaker.png deleted file mode 100644 index f8f2de910e..0000000000 Binary files a/Items/Accessories/GoldBurdenBreaker.png and /dev/null differ diff --git a/Items/Accessories/GravistarSabaton.cs b/Items/Accessories/GravistarSabaton.cs index 5d72a08f37..c366339a2f 100644 --- a/Items/Accessories/GravistarSabaton.cs +++ b/Items/Accessories/GravistarSabaton.cs @@ -20,7 +20,6 @@ namespace CalamityMod.Items.Accessories item.height = 22; item.value = CalamityGlobalItem.Rarity7BuyPrice; item.accessory = true; - item.expert = true; item.rare = ItemRarityID.Lime; } diff --git a/Items/Accessories/HideofAstrumDeus.cs b/Items/Accessories/HideofAstrumDeus.cs index 6df15b59ab..1ef11caead 100644 --- a/Items/Accessories/HideofAstrumDeus.cs +++ b/Items/Accessories/HideofAstrumDeus.cs @@ -25,13 +25,11 @@ namespace CalamityMod.Items.Accessories item.value = CalamityGlobalItem.Rarity9BuyPrice; item.rare = ItemRarityID.Cyan; item.accessory = true; - item.Calamity().challengeDrop = true; } public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.aBulwark = true; player.buffImmune[ModContent.BuffType()] = true; modPlayer.aBulwarkRare = true; player.buffImmune[BuffID.CursedInferno] = true; diff --git a/Items/Accessories/LeviathanAmbergris.cs b/Items/Accessories/LeviathanAmbergris.cs index 9f2a4050e0..ea9ba64621 100644 --- a/Items/Accessories/LeviathanAmbergris.cs +++ b/Items/Accessories/LeviathanAmbergris.cs @@ -24,7 +24,6 @@ namespace CalamityMod.Items.Accessories item.height = 22; item.value = CalamityGlobalItem.Rarity7BuyPrice; item.accessory = true; - item.expert = true; item.rare = ItemRarityID.Lime; } diff --git a/Items/Accessories/ManaOverloader.cs b/Items/Accessories/ManaOverloader.cs index ececdc1c4b..fc9f72b6b2 100644 --- a/Items/Accessories/ManaOverloader.cs +++ b/Items/Accessories/ManaOverloader.cs @@ -24,7 +24,6 @@ namespace CalamityMod.Items.Accessories item.value = CalamityGlobalItem.Rarity4BuyPrice; item.rare = ItemRarityID.LightRed; item.accessory = true; - item.expert = true; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/MutatedTruffle.cs b/Items/Accessories/MutatedTruffle.cs index 7a04a112ec..186cba8951 100644 --- a/Items/Accessories/MutatedTruffle.cs +++ b/Items/Accessories/MutatedTruffle.cs @@ -23,7 +23,6 @@ namespace CalamityMod.Items.Accessories item.height = 26; item.value = CalamityGlobalItem.Rarity13BuyPrice; item.rare = ItemRarityID.Red; - item.expert = true; item.accessory = true; } diff --git a/Items/Accessories/NebulousCore.cs b/Items/Accessories/NebulousCore.cs index 8164838826..4cd87e3fb6 100644 --- a/Items/Accessories/NebulousCore.cs +++ b/Items/Accessories/NebulousCore.cs @@ -24,7 +24,6 @@ namespace CalamityMod.Items.Accessories item.height = 14; item.value = CalamityGlobalItem.Rarity14BuyPrice; item.accessory = true; - item.expert = true; item.rare = ItemRarityID.Red; } diff --git a/Items/Accessories/OccultSkullCrown.cs b/Items/Accessories/OccultSkullCrown.cs index 94ec94d71b..0618e01010 100644 --- a/Items/Accessories/OccultSkullCrown.cs +++ b/Items/Accessories/OccultSkullCrown.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Accessories "Debuffs affected: Darkness, Blackout, Confused, Slow, Weak, Broken Armor,\n" + "Armor Crunch, War Cleave, Chilled, Ichor and Obstructed\n" + "Getting hit causes you to only lose half of your max adrenaline rather than all of it\n" + - "Boosts your defense by 5 and max movement speed and acceleration by 5%\n" + + "Increases your max movement speed and acceleration by 5%\n" + "Can also be worn as a helmet\n" + "Revengeance item"); } @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Accessories { item.width = 82; item.height = 62; - + item.defense = 5; item.rare = ItemRarityID.Purple; item.Calamity().customRarity = CalamityRarity.DarkBlue; item.value = CalamityGlobalItem.Rarity14BuyPrice; @@ -36,7 +36,6 @@ namespace CalamityMod.Items.Accessories public override void UpdateEquip(Player player) { - player.statDefense += 5; CalamityPlayer modPlayer = player.Calamity(); modPlayer.laudanum = true; modPlayer.heartOfDarkness = true; diff --git a/Items/Accessories/OceanCrest.cs b/Items/Accessories/OceanCrest.cs index bf28466789..ad594f0245 100644 --- a/Items/Accessories/OceanCrest.cs +++ b/Items/Accessories/OceanCrest.cs @@ -19,7 +19,6 @@ namespace CalamityMod.Items.Accessories item.value = CalamityGlobalItem.Rarity2BuyPrice; item.rare = ItemRarityID.Green; item.accessory = true; - item.expert = true; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/PlagueHive.cs b/Items/Accessories/PlagueHive.cs index c728de6a65..aad91a0120 100644 --- a/Items/Accessories/PlagueHive.cs +++ b/Items/Accessories/PlagueHive.cs @@ -13,8 +13,7 @@ namespace CalamityMod.Items.Accessories public override void SetStaticDefaults() { DisplayName.SetDefault("Plague Hive"); - Tooltip.SetDefault("The power of bees and wasps will rival the Moon Lord himself\n" + - "All attacks inflict the Plague debuff\n" + + Tooltip.SetDefault("All attacks inflict the Plague debuff\n" + "Releases bees when damaged that inflict the Plague\n" + "Projectiles spawn plague seekers on enemy hits"); } diff --git a/Items/Accessories/ReaperToothNecklace.cs b/Items/Accessories/ReaperToothNecklace.cs index df1cfcf6cc..468dd3a7c5 100644 --- a/Items/Accessories/ReaperToothNecklace.cs +++ b/Items/Accessories/ReaperToothNecklace.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Accessories public override void SetStaticDefaults() { DisplayName.SetDefault("Reaper Tooth Necklace"); - Tooltip.SetDefault("A grisly trophy from the ultimate predator\n" + "10% increased damage\n" + "Increases armor penetration by 15"); + Tooltip.SetDefault("A grisly trophy from the ultimate predator\n" + "15% increased damage\n" + "Increases armor penetration by 15"); } public override void SetDefaults() @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { - player.allDamage += 0.1f; + player.allDamage += 0.15f; player.armorPenetration += 15; } diff --git a/Items/Accessories/Regenator.cs b/Items/Accessories/Regenator.cs index 30aee17ddc..94575886e8 100644 --- a/Items/Accessories/Regenator.cs +++ b/Items/Accessories/Regenator.cs @@ -21,7 +21,6 @@ namespace CalamityMod.Items.Accessories item.rare = ItemRarityID.Lime; item.defense = 10; item.accessory = true; - item.Calamity().challengeDrop = true; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/RottenBrain.cs b/Items/Accessories/RottenBrain.cs index 7bfd7f5e34..d6d7a2373b 100644 --- a/Items/Accessories/RottenBrain.cs +++ b/Items/Accessories/RottenBrain.cs @@ -21,7 +21,6 @@ namespace CalamityMod.Items.Accessories item.width = 34; item.height = 34; item.value = CalamityGlobalItem.Rarity3BuyPrice; - item.expert = true; item.rare = ItemRarityID.Orange; item.accessory = true; } diff --git a/Items/Accessories/SamuraiBadge.cs b/Items/Accessories/SamuraiBadge.cs index 6afa2e4658..55718c4bd7 100644 --- a/Items/Accessories/SamuraiBadge.cs +++ b/Items/Accessories/SamuraiBadge.cs @@ -21,11 +21,9 @@ namespace CalamityMod.Items.Accessories { item.width = 32; item.height = 78; + item.value = CalamityGlobalItem.Rarity11BuyPrice; item.rare = ItemRarityID.Purple; - item.Calamity().customRarity = CalamityRarity.Turquoise; - item.value = CalamityGlobalItem.Rarity12BuyPrice; - item.accessory = true; - item.Calamity().challengeDrop = true; + item.accessory = true; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/SpectralVeil.cs b/Items/Accessories/SpectralVeil.cs index e85cfc9b89..88924b10b4 100644 --- a/Items/Accessories/SpectralVeil.cs +++ b/Items/Accessories/SpectralVeil.cs @@ -26,7 +26,6 @@ namespace CalamityMod.Items.Accessories item.value = CalamityGlobalItem.Rarity12BuyPrice; item.rare = ItemRarityID.Purple; item.Calamity().customRarity = CalamityRarity.Turquoise; - item.expert = true; item.accessory = true; } diff --git a/Items/Accessories/TheAmalgam.cs b/Items/Accessories/TheAmalgam.cs index 1073d93cd9..6600c15cd9 100644 --- a/Items/Accessories/TheAmalgam.cs +++ b/Items/Accessories/TheAmalgam.cs @@ -27,7 +27,6 @@ namespace CalamityMod.Items.Accessories item.width = 34; item.height = 34; item.value = CalamityGlobalItem.Rarity14BuyPrice; - item.expert = true; item.rare = ItemRarityID.Cyan; item.accessory = true; } @@ -61,7 +60,7 @@ namespace CalamityMod.Items.Accessories ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemType()); recipe.AddIngredient(ItemType(), 5); - recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddIngredient(ItemType(), 10); recipe.AddIngredient(ItemType(), 15); recipe.AddIngredient(ItemType(), 15); recipe.AddIngredient(ItemType(), 5); diff --git a/Items/Accessories/TheBee.cs b/Items/Accessories/TheBee.cs index 3137c65a59..6b5ff2be5b 100644 --- a/Items/Accessories/TheBee.cs +++ b/Items/Accessories/TheBee.cs @@ -10,8 +10,7 @@ namespace CalamityMod.Items.Accessories public override void SetStaticDefaults() { DisplayName.SetDefault("The Bee"); - Tooltip.SetDefault("Causes stars to fall and releases bees when injured\n" + - "When at full HP, your damage is increased based on your damage reduction\n" + + Tooltip.SetDefault("When at full HP, your damage is increased based on your damage reduction\n" + "Damage taken at full HP is halved\n" + "This has a 10 second cooldown"); } @@ -23,7 +22,6 @@ namespace CalamityMod.Items.Accessories item.value = CalamityGlobalItem.Rarity3BuyPrice; item.rare = ItemRarityID.Orange; item.accessory = true; - item.Calamity().challengeDrop = true; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/TheCamper.cs b/Items/Accessories/TheCamper.cs index eb65a179e4..e7f04bfd4e 100644 --- a/Items/Accessories/TheCamper.cs +++ b/Items/Accessories/TheCamper.cs @@ -33,7 +33,6 @@ namespace CalamityMod.Items.Accessories item.height = 26; item.value = CalamityGlobalItem.Rarity7BuyPrice; item.rare = ItemRarityID.Lime; - item.expert = true; item.accessory = true; item.defense = 10; } diff --git a/Items/Accessories/TheCommunity.cs b/Items/Accessories/TheCommunity.cs index cc0af1c17a..085d1ed227 100644 --- a/Items/Accessories/TheCommunity.cs +++ b/Items/Accessories/TheCommunity.cs @@ -28,7 +28,6 @@ namespace CalamityMod.Items.Accessories item.rare = ItemRarityID.Lime; item.accessory = true; item.Calamity().customRarity = CalamityRarity.Rainbow; - item.Calamity().challengeDrop = true; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/TheEvolution.cs b/Items/Accessories/TheEvolution.cs index 828da011d6..dd0af649bf 100644 --- a/Items/Accessories/TheEvolution.cs +++ b/Items/Accessories/TheEvolution.cs @@ -27,7 +27,6 @@ namespace CalamityMod.Items.Accessories item.Calamity().customRarity = CalamityRarity.Turquoise; item.rare = ItemRarityID.Purple; item.accessory = true; - item.Calamity().challengeDrop = true; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/TheTransformer.cs b/Items/Accessories/TheTransformer.cs index 3725386c1b..a284dc4062 100644 --- a/Items/Accessories/TheTransformer.cs +++ b/Items/Accessories/TheTransformer.cs @@ -22,10 +22,9 @@ namespace CalamityMod.Items.Accessories { item.width = 42; item.height = 56; - item.value = CalamityGlobalItem.Rarity2BuyPrice; - item.rare = ItemRarityID.Green; + item.value = CalamityGlobalItem.Rarity5BuyPrice; + item.rare = ItemRarityID.Pink; item.accessory = true; - item.Calamity().challengeDrop = true; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/ToxicHeart.cs b/Items/Accessories/ToxicHeart.cs index a8c739f7f5..8d2cf784c9 100644 --- a/Items/Accessories/ToxicHeart.cs +++ b/Items/Accessories/ToxicHeart.cs @@ -22,7 +22,6 @@ namespace CalamityMod.Items.Accessories item.width = 28; item.height = 32; item.value = CalamityGlobalItem.Rarity8BuyPrice; - item.expert = true; item.rare = ItemRarityID.Yellow; item.accessory = true; } diff --git a/Items/Accessories/VoidofExtinction.cs b/Items/Accessories/VoidofExtinction.cs index 6d6390dab0..a26786851e 100644 --- a/Items/Accessories/VoidofExtinction.cs +++ b/Items/Accessories/VoidofExtinction.cs @@ -31,7 +31,6 @@ namespace CalamityMod.Items.Accessories item.width = 26; item.height = 26; item.value = CalamityGlobalItem.Rarity8BuyPrice; - item.expert = true; item.rare = ItemRarityID.Yellow; item.accessory = true; } diff --git a/Items/Accessories/Wings/CelestialTracers.cs b/Items/Accessories/Wings/CelestialTracers.cs index 2f7639ed9e..8744beaefd 100644 --- a/Items/Accessories/Wings/CelestialTracers.cs +++ b/Items/Accessories/Wings/CelestialTracers.cs @@ -5,6 +5,7 @@ using CalamityMod.World; using Microsoft.Xna.Framework; using System.Collections.Generic; using Terraria; +using Terraria.ID; using Terraria.Graphics.Shaders; using Terraria.ModLoader; @@ -25,6 +26,7 @@ namespace CalamityMod.Items.Accessories.Wings "50% increased running acceleration\n" + "Greater mobility on ice\n" + "Water and lava walking\n" + + "Immunity to the On Fire! debuff\n" + "Temporary immunity to lava\n" + "Being hit for over 200 damage will make you immune for an extended period of time"); } @@ -78,6 +80,7 @@ namespace CalamityMod.Items.Accessories.Wings player.waterWalk = true; player.fireWalk = true; player.lavaMax += 240; + player.buffImmune[BuffID.OnFire] = true; player.wingTimeMax = 250; player.noFallDmg = true; modPlayer.IBoots = !hideVisual; diff --git a/Items/Accessories/Wings/ElysianTracers.cs b/Items/Accessories/Wings/ElysianTracers.cs index 82bda4fb23..c6eaf42acd 100644 --- a/Items/Accessories/Wings/ElysianTracers.cs +++ b/Items/Accessories/Wings/ElysianTracers.cs @@ -5,6 +5,7 @@ using CalamityMod.World; using Microsoft.Xna.Framework; using System.Collections.Generic; using Terraria; +using Terraria.ID; using Terraria.Graphics.Shaders; using Terraria.ModLoader; @@ -25,6 +26,7 @@ namespace CalamityMod.Items.Accessories.Wings "36% increased running acceleration\n" + "Greater mobility on ice\n" + "Water and lava walking\n" + + "Immunity to the On Fire! debuff\n" + "Temporary immunity to lava"); } @@ -77,6 +79,7 @@ namespace CalamityMod.Items.Accessories.Wings player.waterWalk = true; player.fireWalk = true; player.lavaMax += 240; + player.buffImmune[BuffID.OnFire] = true; player.wingTimeMax = 180; player.noFallDmg = true; modPlayer.IBoots = !hideVisual; diff --git a/Items/Accessories/Wings/InfinityBoots.cs b/Items/Accessories/Wings/InfinityBoots.cs index 0f3398dc86..8afce14b63 100644 --- a/Items/Accessories/Wings/InfinityBoots.cs +++ b/Items/Accessories/Wings/InfinityBoots.cs @@ -25,6 +25,7 @@ namespace CalamityMod.Items.Accessories.Wings "24% increased running acceleration\n" + "Greater mobility on ice\n" + "Water and lava walking\n" + + "Immunity to the On Fire! debuff\n" + "Temporary immunity to lava"); } @@ -77,6 +78,7 @@ namespace CalamityMod.Items.Accessories.Wings player.waterWalk = true; player.fireWalk = true; player.lavaMax += 240; + player.buffImmune[BuffID.OnFire] = true; player.wingTimeMax = 140; player.noFallDmg = true; modPlayer.IBoots = !hideVisual; diff --git a/Items/Accessories/Wings/SoulofCryogen.cs b/Items/Accessories/Wings/SoulofCryogen.cs index 1635b711df..2250d1a8ff 100644 --- a/Items/Accessories/Wings/SoulofCryogen.cs +++ b/Items/Accessories/Wings/SoulofCryogen.cs @@ -32,7 +32,6 @@ namespace CalamityMod.Items.Accessories.Wings item.width = 26; item.height = 26; item.value = CalamityGlobalItem.Rarity5BuyPrice; - item.expert = true; item.rare = ItemRarityID.Pink; item.accessory = true; } diff --git a/Items/Accessories/YharimsGift.cs b/Items/Accessories/YharimsGift.cs index a68fb9ded4..f1601968de 100644 --- a/Items/Accessories/YharimsGift.cs +++ b/Items/Accessories/YharimsGift.cs @@ -1,6 +1,5 @@ using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ModLoader; using Terraria.ID; @@ -27,7 +26,6 @@ namespace CalamityMod.Items.Accessories item.height = 22; item.value = CalamityGlobalItem.Rarity15BuyPrice; item.accessory = true; - item.expert = true; item.rare = ItemRarityID.Red; } diff --git a/Items/Armor/CirrusDress.cs b/Items/Armor/CirrusDress.cs index 079da1bea7..578980917f 100644 --- a/Items/Armor/CirrusDress.cs +++ b/Items/Armor/CirrusDress.cs @@ -4,7 +4,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Armor { - [AutoloadEquip(EquipType.Body, EquipType.Legs)] + [AutoloadEquip(EquipType.Body)] public class CirrusDress : ModItem { /* How to obtain @@ -37,5 +37,17 @@ namespace CalamityMod.Items.Armor player.magicDamage += 0.05f; player.magicCrit += 5; } + + public override void SetMatch(bool male, ref int equipSlot, ref bool robes) + { + robes = true; + // The equipSlot is added in CalamityMod.cs --> Load hook + equipSlot = mod.GetEquipSlot("CirrusDress_Legs", EquipType.Legs); + } + + public override void DrawHands(ref bool drawHands, ref bool drawArms) + { + drawHands = true; + } } } diff --git a/Items/Armor/SilvaHelmet.cs b/Items/Armor/SilvaHelmet.cs index 0036807e62..16eca8894c 100644 --- a/Items/Armor/SilvaHelmet.cs +++ b/Items/Armor/SilvaHelmet.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Items.Armor "All projectiles spawn healing leaf orbs on enemy hits\n" + "Max run speed and acceleration boosted by 5%\n" + "If you are reduced to 1 HP you will not die from any further damage for 8 seconds\n" + - "This effect only triggers once per life\n" + + "This effect has a 5 minute cooldown. The cooldown does not decrement if any bosses or events are active.\n" + "Summons an ancient leaf prism to blast your enemies with life energy"; if (player.whoAmI == Main.myPlayer) { diff --git a/Items/Armor/SilvaMaskedCap.cs b/Items/Armor/SilvaMaskedCap.cs index 5714cebda5..3090832094 100644 --- a/Items/Armor/SilvaMaskedCap.cs +++ b/Items/Armor/SilvaMaskedCap.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Items.Armor player.setBonus = "All projectiles spawn healing leaf orbs on enemy hits\n" + "Max run speed and acceleration boosted by 5%\n" + "If you are reduced to 1 HP you will not die from any further damage for 8 seconds\n" + - "This effect only triggers once per life\n" + + "This effect has a 5 minute cooldown. The cooldown does not decrement if any bosses or events are active.\n" + "Magic projectiles which cannot pierce will occasionally set off potent blasts of nature energy"; } diff --git a/Items/Armor/TitanHeartMask.cs b/Items/Armor/TitanHeartMask.cs index ddeb4c0101..f24d5510d7 100644 --- a/Items/Armor/TitanHeartMask.cs +++ b/Items/Armor/TitanHeartMask.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Armor { DisplayName.SetDefault("Titan Heart Mask"); Tooltip.SetDefault("5% increased rogue damage and knockback\n" + - "Rogue weapons spread the astral infection"); + "Rogue weapons inflict the Astral Infection debuff"); } public override void SetDefaults() diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index a9700fecc9..a013d48488 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -80,7 +80,6 @@ namespace CalamityMod.Items public int reforgeTier = 0; public bool donorItem = false; public bool devItem = false; - public bool challengeDrop = false; public bool canFirePointBlankShots = false; public bool trueMelee = false; @@ -130,10 +129,6 @@ namespace CalamityMod.Items if (item.type == ItemID.StarCannon) item.UseSound = null; - // Fix Suspicious Looking Tentacle not being marked as Expert - if (item.type == ItemID.SuspiciousLookingTentacle) - item.expert = true; - // Fix Bones being attracted to the player when you have open ammo slots if (item.type == ItemID.Bone) item.notAmmo = true; @@ -142,6 +137,27 @@ namespace CalamityMod.Items if (item.type == ItemID.PearlwoodBow || item.type == ItemID.PearlwoodHammer || item.type == ItemID.PearlwoodSword) item.rare = ItemRarityID.LightRed; + // Make most expert items no longer expert because they drop in all modes now. + switch (item.type) + { + case ItemID.RoyalGel: + case ItemID.EoCShield: + case ItemID.WormScarf: + case ItemID.BrainOfConfusion: + case ItemID.HiveBackpack: + case ItemID.BoneGlove: + case ItemID.MechanicalBatteryPiece: + case ItemID.MechanicalWagonPiece: + case ItemID.MechanicalWheelPiece: + case ItemID.SporeSac: + case ItemID.ShinyStone: + case ItemID.ShrimpyTruffle: + case ItemID.GravityGlobe: + case ItemID.SuspiciousLookingTentacle: + item.expert = false; + break; + } + SetDefaults_ApplyTweaks(item); // TODO -- these properties should be some sort of dictionary. @@ -1047,7 +1063,7 @@ namespace CalamityMod.Items player.buffImmune[BuffID.Frostburn] = true; player.buffImmune[ModContent.BuffType()] = true; string coldImmunity = CalamityWorld.death ? "\nProvides cold protection in Death Mode" : ""; - player.setBonus = "All ice-themed weapons receive a 10% damage bonus\n" + + player.setBonus = "All ice-themed damage over time debuffs receive a 50% damage bonus\n" + "Cold enemies will deal reduced contact damage to the player\n" + "Provides immunity to the Frostburn and Glacial State debuffs" + coldImmunity; } @@ -1235,7 +1251,11 @@ namespace CalamityMod.Items } } - if (item.type == ItemID.FrogLeg) + // Obsidian Skull and its upgrades make you immune to On Fire! + if (item.type == ItemID.ObsidianSkull || item.type == ItemID.ObsidianHorseshoe || item.type == ItemID.ObsidianShield || item.type == ItemID.AnkhShield || item.type == ItemID.ObsidianWaterWalkingBoots || item.type == ItemID.LavaWaders) + player.buffImmune[BuffID.OnFire] = true; + + if (item.type == ItemID.FrogLeg) player.jumpSpeedBoost -= 1.2f; if (item.type == ItemID.FireGauntlet) diff --git a/Items/CalamityGlobalItemLoot.cs b/Items/CalamityGlobalItemLoot.cs index ce88d54ad0..afe2540930 100644 --- a/Items/CalamityGlobalItemLoot.cs +++ b/Items/CalamityGlobalItemLoot.cs @@ -3,6 +3,8 @@ using CalamityMod.Items.DifficultyItems; using CalamityMod.Items.Materials; using CalamityMod.Items.PermanentBoosters; using CalamityMod.Items.Potions; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Items.Weapons.Summon; @@ -43,8 +45,13 @@ namespace CalamityMod.Items switch (itemID) { + case ItemID.KingSlimeBossBag: + DropHelper.DropItemChance(player, ModContent.ItemType(), DropHelper.BagWeaponDropRateFloat); + break; + case ItemID.EyeOfCthulhuBossBag: DropHelper.DropItemChance(player, ModContent.ItemType(), DropHelper.BagWeaponDropRateFloat); + DropHelper.DropItemChance(player, ModContent.ItemType(), DropHelper.BagWeaponDropRateFloat); break; case ItemID.QueenBeeBossBag: @@ -54,6 +61,7 @@ namespace CalamityMod.Items ItemID.BeeKeeper, ItemID.BeesKnees, ItemID.BeeGun, + ModContent.ItemType() }; DropHelper.DropEntireSet(player, DropHelper.BagWeaponDropRateFloat, queenBeeWeapons); DropHelper.BlockDrops(queenBeeWeapons); @@ -72,6 +80,7 @@ namespace CalamityMod.Items ItemID.LaserRifle, ModContent.ItemType(), ModContent.ItemType(), + ModContent.ItemType() }; DropHelper.DropEntireSet(player, DropHelper.BagWeaponDropRateFloat, wofWeapons); DropHelper.BlockDrops(wofWeapons); @@ -87,17 +96,29 @@ namespace CalamityMod.Items }; DropHelper.DropEntireSet(player, 0.25f, emblems); DropHelper.BlockDrops(emblems); - - DropHelper.DropItemFromSetChance(player, 0.2f, ItemID.CorruptionKey, ItemID.CrimsonKey); - DropHelper.DropItemCondition(player, ModContent.ItemType(), !CalamityWorld.demonMode); // Demon Trophy break; case ItemID.DestroyerBossBag: + // Only drop hallowed bars after all mechs are down. + if ((!NPC.downedMechBoss1 || !NPC.downedMechBoss2 || !NPC.downedMechBoss3) && CalamityConfig.Instance.EarlyHardmodeProgressionRework) + DropHelper.BlockDrops(ItemID.HallowedBar); + + DropHelper.DropItemChance(player, ModContent.ItemType(), DropHelper.BagWeaponDropRateFloat); + break; + case ItemID.TwinsBossBag: + // Only drop hallowed bars after all mechs are down. + if ((!NPC.downedMechBoss1 || !NPC.downedMechBoss2 || !NPC.downedMechBoss3) && CalamityConfig.Instance.EarlyHardmodeProgressionRework) + DropHelper.BlockDrops(ItemID.HallowedBar); + + DropHelper.DropItemChance(player, ModContent.ItemType(), DropHelper.BagWeaponDropRateFloat); + break; + case ItemID.SkeletronPrimeBossBag: // Only drop hallowed bars after all mechs are down. if ((!NPC.downedMechBoss1 || !NPC.downedMechBoss2 || !NPC.downedMechBoss3) && CalamityConfig.Instance.EarlyHardmodeProgressionRework) DropHelper.BlockDrops(ItemID.HallowedBar); + break; case ItemID.PlanteraBossBag: @@ -110,16 +131,14 @@ namespace CalamityMod.Items ItemID.VenusMagnum, ItemID.LeafBlower, ItemID.NettleBurst, - ItemID.WaspGun + ItemID.WaspGun, + ModContent.ItemType(), + ModContent.ItemType() }; DropHelper.DropEntireSet(player, DropHelper.BagWeaponDropRateFloat, planteraWeapons); DropHelper.BlockDrops(planteraWeapons); - // Equipment - DropHelper.DropItemChance(player, ModContent.ItemType(), 5); - DropHelper.DropItem(player, ModContent.ItemType(), 16, 22); - DropHelper.DropItemChance(player, ItemID.JungleKey, 5); break; case ItemID.GolemBossBag: @@ -133,6 +152,7 @@ namespace CalamityMod.Items ItemID.StaffofEarth, ItemID.EyeoftheGolem, ItemID.SunStone, + ModContent.ItemType() }; DropHelper.DropEntireSet(player, DropHelper.BagWeaponDropRateFloat, golemItems); DropHelper.BlockDrops(golemItems); @@ -166,7 +186,9 @@ namespace CalamityMod.Items ItemID.BubbleGun, ItemID.RazorbladeTyphoon, ItemID.TempestStaff, + ItemID.FishronWings, ModContent.ItemType(), + ModContent.ItemType() }; DropHelper.DropEntireSet(player, DropHelper.BagWeaponDropRateFloat, dukeWeapons); DropHelper.BlockDrops(dukeWeapons); diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index e0ed98421b..0b821942a1 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -50,9 +50,6 @@ namespace CalamityMod.Items tooltips.Add(line); } - // If an item has special tags (specifically Ice, Fire, and Nature), show that in the tooltip. - ElementTooltip(item, tooltips); - // If an item has an enchantment, show its prefix in the first tooltip line and append its description to the // tooltip list. EnchantmentTooltips(item, tooltips); @@ -82,11 +79,6 @@ namespace CalamityMod.Items TooltipLine line = new TooltipLine(mod, "CalamityDev", CalamityUtils.ColorMessage("- Developer Item -", CalamityUtils.HotPinkRarityColor)); tooltips.Add(line); } - - // Adds "Challenge Drop" or "Legendary Challenge Drop" to Malice Mode drops. - // For Legendary Challenge Drops, this tooltip matches their unique rarity color. - if (challengeDrop) - ChallengeDropTooltip(item, tooltips); } #endregion @@ -203,43 +195,6 @@ namespace CalamityMod.Items } #endregion - #region Challenge Drop Tooltip - private void ChallengeDropTooltip(Item item, IList tooltips) - { - Color? legendaryColor = null; - if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) - legendaryColor = new Color(255, Main.DiscoG, 53); - if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) - legendaryColor = new Color(Main.DiscoR, 203, 103); - if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) - legendaryColor = new Color(53, Main.DiscoG, 255); - if (item.type == ModContent.ItemType()) - legendaryColor = new Color(150, Main.DiscoG, 255); - if (item.type == ModContent.ItemType()) - legendaryColor = new Color(60, Main.DiscoG, 190); - if (item.type == ModContent.ItemType()) - legendaryColor = new Color(255, Main.DiscoG, 155); - if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) - legendaryColor = new Color(255, Main.DiscoG, 0); - if (item.type == ModContent.ItemType()) - legendaryColor = CalamityUtils.ColorSwap(new Color(255, 168, 53), new Color(255, 249, 0), 2f); - if (item.type == ModContent.ItemType()) - legendaryColor = CalamityUtils.ColorSwap(LeonidProgenitor.blueColor, LeonidProgenitor.purpleColor, 3f); - if (item.type == ModContent.ItemType()) - legendaryColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB); - if (item.type == ModContent.ItemType()) - legendaryColor = new Color(146, 0, 0); - - Color lineColor = legendaryColor.GetValueOrDefault(CalamityUtils.ChallengeDropColor); - string text = legendaryColor.HasValue ? "- Legendary Challenge Drop -" : "- Challenge Drop -"; - TooltipLine line = new TooltipLine(mod, "CalamityChallengeDrop", text) - { - overrideColor = lineColor - }; - tooltips.Add(line); - } - #endregion - #region Enchantment Tooltips private void EnchantmentTooltips(Item item, IList tooltips) { @@ -370,6 +325,34 @@ namespace CalamityMod.Items EditTooltipByNum(0, (line) => line.text = "Shoots splitting arrows"); #endregion + // For boss summon item clarity + #region Boss Summon Tooltip Edits + + if (item.type == ItemID.Abeemination) + EditTooltipByNum(0, (line) => line.text += " when used in the jungle"); + + if (item.type == ItemID.BloodySpine) + EditTooltipByNum(0, (line) => line.text += " when used in the crimson"); + + if (item.type == ItemID.ClothierVoodooDoll) + EditTooltipByNum(0, (line) => line.text += "\nWhile equipped, summons Skeletron when the Clothier is killed during nighttime"); + + if (item.type == ItemID.GuideVoodooDoll) + EditTooltipByNum(0, (line) => line.text += "\nSummons the Wall of Flesh if thrown into lava in the underworld while the Guide is alive"); + + if (item.type == ItemID.LihzahrdPowerCell) + EditTooltipByNum(0, (line) => line.text += " to summon the Golem"); + + if (item.type == ItemID.MechanicalEye || item.type == ItemID.MechanicalSkull || item.type == ItemID.MechanicalWorm || item.type == ItemID.SuspiciousLookingEye) + EditTooltipByNum(0, (line) => line.text += " when used during nighttime"); + + if (item.type == ItemID.TruffleWorm) + EditTooltipByName("Consumable", (line) => line.text += "\nSummons Duke Fishron if used as bait in the ocean"); + + if (item.type == ItemID.WormFood) + EditTooltipByNum(0, (line) => line.text += " when used in the corruption"); + #endregion + // Black Belt and Master Ninja Gear have guaranteed dodges on a 90 second cooldown. #region Dodging Belt Tooltips string beltDodgeLine = "Grants the ability to dodge attacks\n" + @@ -596,8 +579,15 @@ namespace CalamityMod.Items EditTooltipByNum(1, (line) => line.text = line.text.Replace("10%", "14%") + extraLine); } - // Spectre Hood's lifesteal is heavily nerfed, so it only reduces magic damage by 20% instead of 40% - if (item.type == ItemID.SpectreHood) + // On Fire! debuff immunities + if (item.type == ItemID.ObsidianSkull || item.type == ItemID.AnkhShield) + EditTooltipByNum(0, (line) => line.text = line.text.Replace("fire blocks", "the Burning and On Fire! debuffs")); + + if (item.type == ItemID.ObsidianHorseshoe || item.type == ItemID.ObsidianShield || item.type == ItemID.ObsidianWaterWalkingBoots || item.type == ItemID.LavaWaders) + EditTooltipByNum(1, (line) => line.text = line.text.Replace("fire blocks", "the Burning and On Fire! debuffs")); + + // Spectre Hood's lifesteal is heavily nerfed, so it only reduces magic damage by 20% instead of 40% + if (item.type == ItemID.SpectreHood) EditTooltipByNum(0, (line) => line.text = line.text.Replace("40%", "20%")); // Yoyo Glove/Bag apply a 0.66x damage multiplier on yoyos @@ -1039,38 +1029,6 @@ namespace CalamityMod.Items } #endregion - #region Element Tooltip - private void ElementTooltip(Item item, IList tooltips) - { - if (CalamityLists.fireWeaponList.Contains(item.type)) - { - TooltipLine fireTooltip = new TooltipLine(mod, "FireWeapon", "- Fire Weapon -") - { - overrideColor = new Color(255, 165, 0) - }; - tooltips.Add(fireTooltip); - } - - if (CalamityLists.iceWeaponList.Contains(item.type)) - { - TooltipLine iceTooltip = new TooltipLine(mod, "IceWeapon", "- Ice Weapon -") - { - overrideColor = new Color(94, 230, 255) - }; - tooltips.Add(iceTooltip); - } - - if (CalamityLists.natureWeaponList.Contains(item.type)) - { - TooltipLine natureTooltip = new TooltipLine(mod, "NatureWeapon", "- Nature Weapon -") - { - overrideColor = new Color(46, 165, 0) - }; - tooltips.Add(natureTooltip); - } - } - #endregion - #region Enchanted Rarity Text Drawing public override bool PreDrawTooltipLine(Item item, DrawableTooltipLine line, ref int yOffset) { diff --git a/Items/DifficultyItems/Armageddon.cs b/Items/DifficultyItems/Armageddon.cs deleted file mode 100644 index 0ebdb924cc..0000000000 --- a/Items/DifficultyItems/Armageddon.cs +++ /dev/null @@ -1,90 +0,0 @@ -using CalamityMod.CalPlayer; -using CalamityMod.Events; -using CalamityMod.World; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.DifficultyItems -{ - public class Armageddon : ModItem - { - private static readonly Color textColor = Color.Fuchsia; - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Armageddon"); - Tooltip.SetDefault("Enables/disables Armageddon, can be used in any difficulty mode\n" + - "While active, any hit while a boss is alive will instantly kill you\n" + - "If you defeat a boss for the first time with this mode active, they will drop 5 extra treasure bags\n" + - "These extra bags will drop even if you are not in Expert Mode\n" + - "Right click with this item to toggle whether your dodges are disabled\n" + - "Dodges can be disabled independently of whether or not Armageddon is not enabled"); - } - - public override void SetDefaults() - { - item.rare = ItemRarityID.Purple; - item.width = 28; - item.height = 28; - item.useAnimation = 45; - item.useTime = 45; - item.useStyle = ItemUseStyleID.HoldingUp; - item.UseSound = SoundID.Item123; - item.consumable = false; - } - - public override bool AltFunctionUse(Player player) => true; - - public override bool UseItem(Player player) - { - // Dodge toggling code is per-player and doesn't need any fancy netcode hedging. - if (player.altFunctionUse == 2) - { - // You still aren't allowed to toggle it during fights though. - if (CalamityPlayer.areThereAnyDamnBosses || CalamityWorld.DoGSecondStageCountdown > 0 || BossRushEvent.BossRushActive) - { - string key = "Mods.CalamityMod.ChangingTheRules"; - CalamityUtils.DisplayLocalizedText(key, textColor); - return true; - } - - CalamityPlayer mp = player.Calamity(); - mp.disableAllDodges = !mp.disableAllDodges; - string dodgeKey = mp.disableAllDodges ? "Mods.CalamityMod.ArmageddonDodgeDisable" : "Mods.CalamityMod.ArmageddonDodgeEnable"; - CalamityUtils.DisplayLocalizedText(dodgeKey, textColor); - return true; - } - - // This world syncing code should only be run by one entity- the server, to prevent a race condition - // with the packets. - if (Main.netMode == NetmodeID.MultiplayerClient) - return true; - - if (CalamityPlayer.areThereAnyDamnBosses || CalamityWorld.DoGSecondStageCountdown > 0 || BossRushEvent.BossRushActive) - { - string key = "Mods.CalamityMod.ChangingTheRules"; - CalamityUtils.DisplayLocalizedText(key, textColor); - return true; - } - CalamityWorld.armageddon = !CalamityWorld.armageddon; - CalamityWorld.DoGSecondStageCountdown = 0; - - string toggleKey = CalamityWorld.armageddon ? "Mods.CalamityMod.ArmageddonText" : "Mods.CalamityMod.ArmageddonText2"; - CalamityUtils.DisplayLocalizedText(toggleKey, textColor); - - CalamityNetcode.SyncWorld(); - - return true; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddTile(TileID.DemonAltar); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } -} diff --git a/Items/DifficultyItems/Armageddon.png b/Items/DifficultyItems/Armageddon.png deleted file mode 100644 index fb6b5e3810..0000000000 Binary files a/Items/DifficultyItems/Armageddon.png and /dev/null differ diff --git a/Items/DifficultyItems/DefiledRune.cs b/Items/DifficultyItems/DefiledRune.cs deleted file mode 100644 index d731b006fb..0000000000 --- a/Items/DifficultyItems/DefiledRune.cs +++ /dev/null @@ -1,42 +0,0 @@ -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.DifficultyItems -{ - public class DefiledRune : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Defiled Feather"); - Tooltip.SetDefault("It's a long way down from a mountain...\n" + - "Favorite this item to disable wings but increase the effectiveness of double jumps."); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(7, 8)); - } - - public override void SetDefaults() - { - item.width = 40; - item.height = 50; - item.rare = ItemRarityID.Green; - } - - public override bool CanUseItem(Player player) => false; - - public override void UpdateInventory(Player player) - { - if (item.favorited) - player.Calamity().noWings = true; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Feather); - recipe.AddTile(TileID.DemonAltar); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } -} diff --git a/Items/DifficultyItems/DefiledRune.png b/Items/DifficultyItems/DefiledRune.png deleted file mode 100644 index 3bf6af0e79..0000000000 Binary files a/Items/DifficultyItems/DefiledRune.png and /dev/null differ diff --git a/Items/DifficultyItems/IronHeart.cs b/Items/DifficultyItems/IronHeart.cs deleted file mode 100644 index 399dd5d86a..0000000000 --- a/Items/DifficultyItems/IronHeart.cs +++ /dev/null @@ -1,70 +0,0 @@ -using CalamityMod.CalPlayer; -using CalamityMod.Events; -using CalamityMod.World; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.Localization; -using Terraria.ModLoader; - -namespace CalamityMod.Items.DifficultyItems -{ - public class IronHeart : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Iron Heart"); - Tooltip.SetDefault("Healing with potions and all positive life regen is disabled.\n" + - "Enemy damage scales with your max health.\n" + - "Can be toggled on and off."); - } - - public override void SetDefaults() - { - item.width = 28; - item.height = 28; - item.expert = true; - item.rare = ItemRarityID.Cyan; - item.useAnimation = 45; - item.useTime = 45; - item.useStyle = ItemUseStyleID.HoldingUp; - item.UseSound = SoundID.Item119; - item.consumable = false; - } - - public override bool UseItem(Player player) - { - // This world syncing code should only be run by one entity- the server, to prevent a race condition - // with the packets. - if (Main.netMode == NetmodeID.MultiplayerClient) - return true; - - if (CalamityPlayer.areThereAnyDamnBosses || CalamityWorld.DoGSecondStageCountdown > 0 || BossRushEvent.BossRushActive) - { - string key = "Mods.CalamityMod.ChangingTheRules"; - Color messageColor = Color.LightSkyBlue; - CalamityUtils.DisplayLocalizedText(key, messageColor); - return true; - } - if (!CalamityWorld.ironHeart) - { - CalamityWorld.ironHeart = true; - string key = "Mods.CalamityMod.IronHeartText"; - Color messageColor = Color.LightSkyBlue; - CalamityUtils.DisplayLocalizedText(key, messageColor); - } - else - { - CalamityWorld.ironHeart = false; - string key = "Mods.CalamityMod.IronHeartText2"; - Color messageColor = Color.LightSkyBlue; - CalamityUtils.DisplayLocalizedText(key, messageColor); - } - CalamityWorld.DoGSecondStageCountdown = 0; - CalamityNetcode.SyncWorld(); - - return true; - } - } -} diff --git a/Items/DifficultyItems/IronHeart.png b/Items/DifficultyItems/IronHeart.png deleted file mode 100644 index ceff5f27ed..0000000000 Binary files a/Items/DifficultyItems/IronHeart.png and /dev/null differ diff --git a/Items/DifficultyItems/MLGRune.cs b/Items/DifficultyItems/MLGRune.cs deleted file mode 100644 index 7ff18f6cb8..0000000000 --- a/Items/DifficultyItems/MLGRune.cs +++ /dev/null @@ -1,46 +0,0 @@ -using CalamityMod.World; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.DifficultyItems -{ - public class MLGRune : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Demon Trophy"); - Tooltip.SetDefault("Boosts spawn rate by 1.25x\n" + - "Effects cannot be reversed"); - } - - public override void SetDefaults() - { - item.width = item.height = 54; - item.maxStack = 99; - item.rare = ItemRarityID.Blue; - item.useAnimation = 45; - item.useTime = 45; - item.useStyle = ItemUseStyleID.HoldingUp; - item.UseSound = SoundID.Item119; - item.consumable = true; - } - - public override bool CanUseItem(Player player) - { - return !CalamityWorld.demonMode; - } - - public override bool UseItem(Player player) - { - // This world syncing code should only be run by one entity- the server, to prevent a race condition - // with the packets. - if (Main.netMode == NetmodeID.MultiplayerClient) - return true; - - CalamityWorld.demonMode = true; - CalamityNetcode.SyncWorld(); - return true; - } - } -} diff --git a/Items/DifficultyItems/MLGRune.png b/Items/DifficultyItems/MLGRune.png deleted file mode 100644 index 511794c4e7..0000000000 Binary files a/Items/DifficultyItems/MLGRune.png and /dev/null differ diff --git a/Items/DifficultyItems/Malice.cs b/Items/DifficultyItems/Malice.cs index 833d644af0..bf8bda03f7 100644 --- a/Items/DifficultyItems/Malice.cs +++ b/Items/DifficultyItems/Malice.cs @@ -16,11 +16,9 @@ namespace CalamityMod.Items.DifficultyItems public override void SetStaticDefaults() { DisplayName.SetDefault("Malice"); - Tooltip.SetDefault("Enables/disables Malice Mode.\n" + + Tooltip.SetDefault("Enables/disables Malice Mode, can only be used in Revengeance Mode.\n" + // Overall description and warning lines "[c/c01818:This mode is subjective, play how you want, don't expect to live.]\n" + - "[c/c01818:This mode is intended as a boss rematch mode, however, bosses are still possible when fought on-tier.]\n" + - "While enabled, bosses will drop Challenge and Legendary Challenge items.\n" + // Misc lines "Greatly nerfs the effectiveness of life steal.\n" + diff --git a/Items/DifficultyItems/Revenge.cs b/Items/DifficultyItems/Revenge.cs index ca9b83ed0f..5660709f9e 100644 --- a/Items/DifficultyItems/Revenge.cs +++ b/Items/DifficultyItems/Revenge.cs @@ -107,7 +107,14 @@ namespace CalamityMod.Items.DifficultyItems messageColor = Color.Crimson; CalamityUtils.DisplayLocalizedText(key, messageColor); } - CalamityWorld.DoGSecondStageCountdown = 0; + if (CalamityWorld.malice) + { + CalamityWorld.malice = false; + key = "Mods.CalamityMod.MaliceText2"; + messageColor = Color.Crimson; + CalamityUtils.DisplayLocalizedText(key, messageColor); + } + CalamityWorld.DoGSecondStageCountdown = 0; CalamityNetcode.SyncWorld(); } return true; diff --git a/Items/Dyes/StratusDye.png b/Items/Dyes/StratusDye.png index c46981da43..415f190397 100644 Binary files a/Items/Dyes/StratusDye.png and b/Items/Dyes/StratusDye.png differ diff --git a/Items/Mounts/AlicornMountExtra.png b/Items/Mounts/AlicornMountExtra.png index 49bad1ec68..64fb381904 100644 Binary files a/Items/Mounts/AlicornMountExtra.png and b/Items/Mounts/AlicornMountExtra.png differ diff --git a/Items/Mounts/AlicornMount_Back.png b/Items/Mounts/AlicornMount_Back.png index ea6c2f5de6..fcb20c4308 100644 Binary files a/Items/Mounts/AlicornMount_Back.png and b/Items/Mounts/AlicornMount_Back.png differ diff --git a/Items/Mounts/AlicornMount_Front.png b/Items/Mounts/AlicornMount_Front.png index 1c35307537..821fd8bbfc 100644 Binary files a/Items/Mounts/AlicornMount_Front.png and b/Items/Mounts/AlicornMount_Front.png differ diff --git a/Items/Potions/Alcohol/CaribbeanRum.png b/Items/Potions/Alcohol/CaribbeanRum.png index dbbd84b161..834ce1a26a 100644 Binary files a/Items/Potions/Alcohol/CaribbeanRum.png and b/Items/Potions/Alcohol/CaribbeanRum.png differ diff --git a/Items/Potions/Alcohol/CinnamonRoll.cs b/Items/Potions/Alcohol/CinnamonRoll.cs index f90441a393..b76831034c 100644 --- a/Items/Potions/Alcohol/CinnamonRoll.cs +++ b/Items/Potions/Alcohol/CinnamonRoll.cs @@ -11,9 +11,7 @@ namespace CalamityMod.Items.Potions.Alcohol { DisplayName.SetDefault("Cinnamon Roll"); Tooltip.SetDefault(@"A great-tasting cinnamon whiskey with a touch of cream soda -Boosts mana regeneration rate and multiplies all fire-based weapon damage by 1.1 -Cursed flame, shadowflame, god slayer inferno, brimstone flame, and frostburn weapons will not receive this benefit -The weapon must be more fire-related than anything else +Boosts mana regeneration rate and multiplies all fire-based debuff damage by 1.5 Reduces defense by 10%"); } diff --git a/Items/Potions/Alcohol/Everclear.png b/Items/Potions/Alcohol/Everclear.png index 2c12189e6b..5e734af391 100644 Binary files a/Items/Potions/Alcohol/Everclear.png and b/Items/Potions/Alcohol/Everclear.png differ diff --git a/Items/Potions/Alcohol/EvergreenGin.cs b/Items/Potions/Alcohol/EvergreenGin.cs index 234647eb09..eaa719a6f5 100644 --- a/Items/Potions/Alcohol/EvergreenGin.cs +++ b/Items/Potions/Alcohol/EvergreenGin.cs @@ -10,8 +10,8 @@ namespace CalamityMod.Items.Potions.Alcohol public override void SetStaticDefaults() { DisplayName.SetDefault("Evergreen Gin"); - Tooltip.SetDefault(@"It tastes like a Christmas tree if you can imagine that -Multiplies nature-based weapon damage by 1.1 and increases damage reduction by 5% + Tooltip.SetDefault(@"It tastes like a Christmas tree, if you can imagine that +Multiplies all sickness and water-related debuff damage by 1.5 and increases damage reduction by 5% Reduces life regen by 1"); } diff --git a/Items/Potions/Alcohol/EvergreenGin.png b/Items/Potions/Alcohol/EvergreenGin.png index 82e4638877..5f1f9ae1ff 100644 Binary files a/Items/Potions/Alcohol/EvergreenGin.png and b/Items/Potions/Alcohol/EvergreenGin.png differ diff --git a/Items/Potions/Alcohol/Fireball.cs b/Items/Potions/Alcohol/Fireball.cs index 749c870248..f93d5c180d 100644 --- a/Items/Potions/Alcohol/Fireball.cs +++ b/Items/Potions/Alcohol/Fireball.cs @@ -11,9 +11,7 @@ namespace CalamityMod.Items.Potions.Alcohol { DisplayName.SetDefault("Fireball"); Tooltip.SetDefault(@"A great-tasting cinnamon whiskey -Multiplies all fire-based weapon damage by 1.05 -Cursed flame, shadowflame, god slayer inferno, brimstone flame, and frostburn weapons will not receive this benefit -The weapon must be more fire-related than anything else +Multiplies all fire-based debuff damage by 1.5 Reduces life regen by 1"); } diff --git a/Items/Potions/Alcohol/GrapeBeer.png b/Items/Potions/Alcohol/GrapeBeer.png index 27c0b23a27..1727991aa4 100644 Binary files a/Items/Potions/Alcohol/GrapeBeer.png and b/Items/Potions/Alcohol/GrapeBeer.png differ diff --git a/Items/Potions/Alcohol/Moonshine.png b/Items/Potions/Alcohol/Moonshine.png index a8721c640e..f4131089b9 100644 Binary files a/Items/Potions/Alcohol/Moonshine.png and b/Items/Potions/Alcohol/Moonshine.png differ diff --git a/Items/Potions/Alcohol/RedWine.png b/Items/Potions/Alcohol/RedWine.png index 3a05fd0de6..025a1ad4fa 100644 Binary files a/Items/Potions/Alcohol/RedWine.png and b/Items/Potions/Alcohol/RedWine.png differ diff --git a/Items/Potions/Alcohol/Rum.png b/Items/Potions/Alcohol/Rum.png index 3daa5a32f3..1f582e6294 100644 Binary files a/Items/Potions/Alcohol/Rum.png and b/Items/Potions/Alcohol/Rum.png differ diff --git a/Items/Potions/Alcohol/Whiskey.png b/Items/Potions/Alcohol/Whiskey.png index fd471d5275..351f288939 100644 Binary files a/Items/Potions/Alcohol/Whiskey.png and b/Items/Potions/Alcohol/Whiskey.png differ diff --git a/Items/Potions/Alcohol/WhiteWine.png b/Items/Potions/Alcohol/WhiteWine.png index 0c5132fa34..2341999a22 100644 Binary files a/Items/Potions/Alcohol/WhiteWine.png and b/Items/Potions/Alcohol/WhiteWine.png differ diff --git a/Items/Potions/DraconicElixir.cs b/Items/Potions/DraconicElixir.cs index 1749fd7577..5b04dd096f 100644 --- a/Items/Potions/DraconicElixir.cs +++ b/Items/Potions/DraconicElixir.cs @@ -22,8 +22,8 @@ namespace CalamityMod.Items.Potions public override void SetDefaults() { - item.width = 28; - item.height = 18; + item.width = 50; + item.height = 44; item.useTurn = true; item.maxStack = 30; item.rare = ItemRarityID.Orange; diff --git a/Items/Potions/SupremeManaPotion.png b/Items/Potions/SupremeManaPotion.png index ee77e5efa4..480fee56ef 100644 Binary files a/Items/Potions/SupremeManaPotion.png and b/Items/Potions/SupremeManaPotion.png differ diff --git a/Items/SummonItems/Abomination.cs b/Items/SummonItems/Abomination.cs index 6b5e54564d..884ffe950a 100644 --- a/Items/SummonItems/Abomination.cs +++ b/Items/SummonItems/Abomination.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Items.SummonItems public override void SetStaticDefaults() { DisplayName.SetDefault("Abombination"); - Tooltip.SetDefault("Calls in the airborne jungle abomination\n" + - "Summons the Plaguebringer Goliath\n" + + Tooltip.SetDefault("Calls in the airborne abomination\n" + + "Summons the Plaguebringer Goliath when used in the jungle\n" + "Not consumable"); } diff --git a/Items/SummonItems/AstralChunk.cs b/Items/SummonItems/AstralChunk.cs index 9a9e47bfd2..7bd2d0455e 100644 --- a/Items/SummonItems/AstralChunk.cs +++ b/Items/SummonItems/AstralChunk.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.SummonItems public override void SetStaticDefaults() { DisplayName.SetDefault("Astral Chunk"); - Tooltip.SetDefault("Summons Astrum Aureus\n" + + Tooltip.SetDefault("Summons Astrum Aureus when used in the astral infection during nighttime\n" + "Not consumable"); } diff --git a/Items/SummonItems/BirbPheromones.cs b/Items/SummonItems/BirbPheromones.cs index 3bb1185e25..15f3257cae 100644 --- a/Items/SummonItems/BirbPheromones.cs +++ b/Items/SummonItems/BirbPheromones.cs @@ -4,6 +4,7 @@ using CalamityMod.NPCs.Bumblebirb; using Terraria; using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Items.SummonItems { public class BirbPheromones : ModItem @@ -12,6 +13,7 @@ namespace CalamityMod.Items.SummonItems { DisplayName.SetDefault("Exotic Pheromones"); Tooltip.SetDefault("Attracts the failed draconic experiment\n" + + "Summon The Dragonfolly when used in the jungle\n" + "Not consumable"); } diff --git a/Items/SummonItems/BlightedEyeball.cs b/Items/SummonItems/BlightedEyeball.cs index c40fa5565a..e1fe94519f 100644 --- a/Items/SummonItems/BlightedEyeball.cs +++ b/Items/SummonItems/BlightedEyeball.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.SummonItems { DisplayName.SetDefault("Eye of Desolation"); Tooltip.SetDefault("Tonight is going to be a horrific night...\n" + - "Summons Calamitas\n" + + "Summons Calamitas when used during nighttime\n" + "Not consumable"); } diff --git a/Items/SummonItems/BloodwormItem.cs b/Items/SummonItems/BloodwormItem.cs index c516e6dc5b..ad5d227e85 100644 --- a/Items/SummonItems/BloodwormItem.cs +++ b/Items/SummonItems/BloodwormItem.cs @@ -9,6 +9,7 @@ namespace CalamityMod.Items.SummonItems public override void SetStaticDefaults() { DisplayName.SetDefault("Bloodworm"); + Tooltip.SetDefault("Summons The Old Duke if used as bait in the sulphur sea"); } public override void SetDefaults() diff --git a/Items/SummonItems/BloodyWormFood.cs b/Items/SummonItems/BloodyWormFood.cs index 183ece6d7a..24cc3bb6e1 100644 --- a/Items/SummonItems/BloodyWormFood.cs +++ b/Items/SummonItems/BloodyWormFood.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.SummonItems public override void SetStaticDefaults() { DisplayName.SetDefault("Bloody Worm Food"); - Tooltip.SetDefault("Summons the Perforator Hive\n" + + Tooltip.SetDefault("Summons the Perforator Hive when used in the crimson\n" + "Not consumable"); } diff --git a/Items/SummonItems/BulbofDoom.cs b/Items/SummonItems/BulbofDoom.cs index 4c4725179c..16ffa9695c 100644 --- a/Items/SummonItems/BulbofDoom.cs +++ b/Items/SummonItems/BulbofDoom.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.SummonItems public override void SetStaticDefaults() { DisplayName.SetDefault("Portabulb"); - Tooltip.SetDefault("Summons Plantera\n" + + Tooltip.SetDefault("Summons Plantera when used in the jungle\n" + "Not consumable"); } diff --git a/Items/SummonItems/CharredIdol.cs b/Items/SummonItems/CharredIdol.cs index 58e655601d..5b71c87e1a 100644 --- a/Items/SummonItems/CharredIdol.cs +++ b/Items/SummonItems/CharredIdol.cs @@ -13,8 +13,8 @@ namespace CalamityMod.Items.SummonItems public override void SetStaticDefaults() { DisplayName.SetDefault("Charred Idol"); - Tooltip.SetDefault("Use in the Brimstone Crag at your own risk\n" + - "Summons the Brimstone Elemental\n" + + Tooltip.SetDefault("Use at your own risk\n" + + "Summons the Brimstone Elemental when used in the brimstone crags\n" + "Not consumable"); } diff --git a/Items/SummonItems/ChickenEgg.cs b/Items/SummonItems/ChickenEgg.cs index 370a0b2e92..732b7ed9ac 100644 --- a/Items/SummonItems/ChickenEgg.cs +++ b/Items/SummonItems/ChickenEgg.cs @@ -12,8 +12,8 @@ namespace CalamityMod.Items.SummonItems public override void SetStaticDefaults() { DisplayName.SetDefault("Jungle Dragon Egg"); - Tooltip.SetDefault("Summons the loyal guardian of the tyrant king\n" + - "It yearns for the jungle\n" + + Tooltip.SetDefault("An imitation of the egg that bore the loyal guardian of the tyrant king\n" + + "Summons Jungle Dragon, Yharon when used in the jungle\n" + "Not consumable"); } diff --git a/Items/SummonItems/CryoKey.cs b/Items/SummonItems/CryoKey.cs index affa6f602b..8dca6885d8 100644 --- a/Items/SummonItems/CryoKey.cs +++ b/Items/SummonItems/CryoKey.cs @@ -12,8 +12,7 @@ namespace CalamityMod.Items.SummonItems public override void SetStaticDefaults() { DisplayName.SetDefault("Cryo Key"); - Tooltip.SetDefault("Summons Cryogen\n" + - "The boss enrages outside of the snowy tundra\n" + + Tooltip.SetDefault("Summons Cryogen when used in the tundra\n" + "Not consumable"); } diff --git a/Items/SummonItems/DecapoditaSprout.cs b/Items/SummonItems/DecapoditaSprout.cs index 77fe48d395..80bca9bb44 100644 --- a/Items/SummonItems/DecapoditaSprout.cs +++ b/Items/SummonItems/DecapoditaSprout.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.SummonItems public override void SetStaticDefaults() { DisplayName.SetDefault("Decapodita Sprout"); - Tooltip.SetDefault("Summons Crabulon\n" + + Tooltip.SetDefault("Summons Crabulon when used in the mushroom biome\n" + "Not consumable"); } diff --git a/Items/SummonItems/DriedSeafood.cs b/Items/SummonItems/DriedSeafood.cs index bd4491a667..cc2da70a12 100644 --- a/Items/SummonItems/DriedSeafood.cs +++ b/Items/SummonItems/DriedSeafood.cs @@ -13,8 +13,7 @@ namespace CalamityMod.Items.SummonItems public override void SetStaticDefaults() { DisplayName.SetDefault("Desert Medallion"); - Tooltip.SetDefault("The desert sand stirs...\n" + - "Summons the Desert Scourge\n" + + Tooltip.SetDefault("Summons the Desert Scourge when used in the desert\n" + "Not consumable"); } diff --git a/Items/SummonItems/EidolonTablet.cs b/Items/SummonItems/EidolonTablet.cs index 88dcbda00a..a4df7280b6 100644 --- a/Items/SummonItems/EidolonTablet.cs +++ b/Items/SummonItems/EidolonTablet.cs @@ -11,7 +11,8 @@ namespace CalamityMod.Items.SummonItems public override void SetStaticDefaults() { DisplayName.SetDefault("Eidolon Tablet"); - Tooltip.SetDefault("Not consumable"); + Tooltip.SetDefault("Summons the Lunatic Cultist\n" + + "Not consumable"); } public override void SetDefaults() diff --git a/Items/SummonItems/NecroplasmicBeacon.cs b/Items/SummonItems/NecroplasmicBeacon.cs index e9602bb459..3d0b7c5220 100644 --- a/Items/SummonItems/NecroplasmicBeacon.cs +++ b/Items/SummonItems/NecroplasmicBeacon.cs @@ -1,7 +1,6 @@ using CalamityMod.Events; using CalamityMod.Items.Materials; using CalamityMod.NPCs.Polterghast; -using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -16,7 +15,7 @@ namespace CalamityMod.Items.SummonItems { DisplayName.SetDefault("Necroplasmic Beacon"); Tooltip.SetDefault("It's spooky\n" + - "Summons Polterghast\n" + + "Summons Polterghast when used in the dungeon\n" + "Not consumable"); } diff --git a/Items/SummonItems/OldPowerCell.cs b/Items/SummonItems/OldPowerCell.cs index f83eee9f9c..9f0eae21d3 100644 --- a/Items/SummonItems/OldPowerCell.cs +++ b/Items/SummonItems/OldPowerCell.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.SummonItems public override void SetStaticDefaults() { DisplayName.SetDefault("Old Power Cell"); - Tooltip.SetDefault("Summons the Golem when used in the Temple\n" + + Tooltip.SetDefault("Summons the Golem when used in the temple\n" + "Not consumable"); } diff --git a/Items/SummonItems/ProfanedCoreUnlimited.cs b/Items/SummonItems/ProfanedCoreUnlimited.cs index 7641eead1c..fb8f732847 100644 --- a/Items/SummonItems/ProfanedCoreUnlimited.cs +++ b/Items/SummonItems/ProfanedCoreUnlimited.cs @@ -1,6 +1,5 @@ using CalamityMod.Events; using CalamityMod.NPCs.Providence; -using CalamityMod.World; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -13,7 +12,7 @@ namespace CalamityMod.Items.SummonItems { DisplayName.SetDefault("Profaned Core"); Tooltip.SetDefault("The core of the unholy flame\n" + - "Summons Providence\n" + + "Summons Providence when used in the hallow or underworld\n" + "Should be used during daytime\n" + "Not consumable"); } diff --git a/Items/SummonItems/ProfanedShard.cs b/Items/SummonItems/ProfanedShard.cs index 0215487ca1..6f507c1771 100644 --- a/Items/SummonItems/ProfanedShard.cs +++ b/Items/SummonItems/ProfanedShard.cs @@ -13,8 +13,7 @@ namespace CalamityMod.Items.SummonItems { DisplayName.SetDefault("Profaned Shard"); Tooltip.SetDefault("A shard of the unholy flame\n" + - "Summons the Profaned Guardians\n" + - "Can only be used during daytime\n" + + "Summons the Profaned Guardians when used in the hallow or underworld during daytime\n" + "Not consumable"); } diff --git a/Items/SummonItems/RuneofCos.cs b/Items/SummonItems/RuneofCos.cs index 6df3e95a55..1974eb290e 100644 --- a/Items/SummonItems/RuneofCos.cs +++ b/Items/SummonItems/RuneofCos.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.SummonItems DisplayName.SetDefault("Rune of Kos"); Tooltip.SetDefault("A relic of the profaned flame\n" + "Contains the power hunted relentlessly by the sentinels of the cosmic devourer\n" + - "When used in certain areas of the world it will unleash them\n" + + "When used in certain areas of the world, it will unleash them\n" + "Not consumable"); } diff --git a/Items/SummonItems/SandstormsCore.cs b/Items/SummonItems/SandstormsCore.cs index 88f5f894e7..f4b582c3e5 100644 --- a/Items/SummonItems/SandstormsCore.cs +++ b/Items/SummonItems/SandstormsCore.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Items.SummonItems public override void SetStaticDefaults() { DisplayName.SetDefault("Sandstorm's Core"); - Tooltip.SetDefault("Summons the Great Sand Shark\n" + + Tooltip.SetDefault("Summons the Great Sand Shark when used in the desert\n" + "Not consumable"); } diff --git a/Items/SummonItems/Seafood.cs b/Items/SummonItems/Seafood.cs index 0da71ae88e..98464205aa 100644 --- a/Items/SummonItems/Seafood.cs +++ b/Items/SummonItems/Seafood.cs @@ -13,8 +13,7 @@ namespace CalamityMod.Items.SummonItems public override void SetStaticDefaults() { DisplayName.SetDefault("Seafood"); - Tooltip.SetDefault("The sulphuric sand stirs...\n" + - "Summons the Aquatic Scourge\n" + + Tooltip.SetDefault("Summons the Aquatic Scourge when used in the sulphur sea\n" + "Not consumable"); } @@ -52,7 +51,7 @@ namespace CalamityMod.Items.SummonItems recipe.AddIngredient(ModContent.ItemType(), 20); recipe.AddIngredient(ItemID.Starfish, 10); recipe.AddIngredient(ItemID.SharkFin, 5); - recipe.AddTile(TileID.MythrilAnvil); + recipe.AddTile(TileID.Anvils); recipe.SetResult(this); recipe.AddRecipe(); } diff --git a/Items/SummonItems/Starcore.cs b/Items/SummonItems/Starcore.cs index cd42e24e96..18f8de8ca1 100644 --- a/Items/SummonItems/Starcore.cs +++ b/Items/SummonItems/Starcore.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.SummonItems { DisplayName.SetDefault("Starcore"); Tooltip.SetDefault("May the stars guide your way\n" + - "Summons Astrum Deus at the Astral Beacon but is not consumed."); + "Summons Astrum Deus at the Astral Beacon, but is not consumed"); } public override void SetDefaults() diff --git a/Items/SummonItems/Teratoma.cs b/Items/SummonItems/Teratoma.cs index 2afc05b597..daba67e955 100644 --- a/Items/SummonItems/Teratoma.cs +++ b/Items/SummonItems/Teratoma.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.SummonItems public override void SetStaticDefaults() { DisplayName.SetDefault("Teratoma"); - Tooltip.SetDefault("Summons the Hive Mind\n" + + Tooltip.SetDefault("Summons the Hive Mind when used in the corruption\n" + "Not consumable"); } diff --git a/Items/TreasureBags/AquaticScourgeBag.cs b/Items/TreasureBags/AquaticScourgeBag.cs index 6d3c4aeea8..c1f800b069 100644 --- a/Items/TreasureBags/AquaticScourgeBag.cs +++ b/Items/TreasureBags/AquaticScourgeBag.cs @@ -54,15 +54,17 @@ namespace CalamityMod.Items.TreasureBags DropHelper.WeightStack(w), DropHelper.WeightStack(w), DropHelper.WeightStack(w), - DropHelper.WeightStack(w) - ); + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w) + ); - // Equipment - DropHelper.DropItem(player, ModContent.ItemType()); - DropHelper.DropItemChance(player, ModContent.ItemType(), 8); + // Equipment + DropHelper.DropItem(player, ModContent.ItemType()); - // Vanity - DropHelper.DropItemChance(player, ModContent.ItemType(), 7); + // Vanity + DropHelper.DropItemChance(player, ModContent.ItemType(), 7); // Fishing DropHelper.DropItem(player, ModContent.ItemType()); diff --git a/Items/TreasureBags/AstrageldonBag.cs b/Items/TreasureBags/AstrageldonBag.cs index 5713875591..1372643266 100644 --- a/Items/TreasureBags/AstrageldonBag.cs +++ b/Items/TreasureBags/AstrageldonBag.cs @@ -55,11 +55,12 @@ namespace CalamityMod.Items.TreasureBags DropHelper.WeightStack(w), DropHelper.WeightStack(w), DropHelper.WeightStack(w), - DropHelper.WeightStack(w) - ); + DropHelper.WeightStack(w), + DropHelper.WeightStack(w) + ); - // Equipment - DropHelper.DropItemCondition(player, ModContent.ItemType(), NPC.downedMoonlord); + // Equipment + DropHelper.DropItemCondition(player, ModContent.ItemType(), NPC.downedMoonlord); DropHelper.DropItem(player, ModContent.ItemType()); // Vanity @@ -67,7 +68,6 @@ namespace CalamityMod.Items.TreasureBags // Other DropHelper.DropItemCondition(player, ModContent.ItemType(), CalamityWorld.revenge && !player.Calamity().adrenalineBoostTwo); - DropHelper.DropItemChance(player, ItemID.HallowedKey, 5); } } } diff --git a/Items/TreasureBags/AstrumDeusBag.cs b/Items/TreasureBags/AstrumDeusBag.cs index 42b6acb68d..d3e70a1eda 100644 --- a/Items/TreasureBags/AstrumDeusBag.cs +++ b/Items/TreasureBags/AstrumDeusBag.cs @@ -54,14 +54,14 @@ namespace CalamityMod.Items.TreasureBags DropHelper.WeightStack(w), DropHelper.WeightStack(w), DropHelper.WeightStack(w) - ); + ); - // Equipment - DropHelper.DropItem(player, ModContent.ItemType()); - DropHelper.DropItemChance(player, ModContent.ItemType(), 5); + // Equipment + DropHelper.DropItem(player, ModContent.ItemType()); + DropHelper.DropItemChance(player, ModContent.ItemType(), 5); - // Vanity - DropHelper.DropItemChance(player, ModContent.ItemType(), 7); + // Vanity + DropHelper.DropItemChance(player, ModContent.ItemType(), 7); } } } diff --git a/Items/TreasureBags/BrimstoneWaifuBag.cs b/Items/TreasureBags/BrimstoneWaifuBag.cs index aaa2dffc91..6c9d18168a 100644 --- a/Items/TreasureBags/BrimstoneWaifuBag.cs +++ b/Items/TreasureBags/BrimstoneWaifuBag.cs @@ -5,6 +5,7 @@ using CalamityMod.Items.Mounts; using CalamityMod.Items.Pets; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Summon; using CalamityMod.NPCs.BrimstoneElemental; using CalamityMod.World; @@ -52,17 +53,19 @@ namespace CalamityMod.Items.TreasureBags DropHelper.DropEntireWeightedSet(player, DropHelper.WeightStack(w), DropHelper.WeightStack(w), - DropHelper.WeightStack(w) - ); + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w) + ); - // Equipment - DropHelper.DropItem(player, ModContent.ItemType()); + // Equipment + DropHelper.DropItem(player, ModContent.ItemType()); DropHelper.DropItem(player, ModContent.ItemType()); - DropHelper.DropItemChance(player, ModContent.ItemType(), 5); DropHelper.DropItemCondition(player, ModContent.ItemType(), CalamityWorld.downedProvidence); - // Vanity - DropHelper.DropItemCondition(player, ModContent.ItemType(), CalamityWorld.revenge); + // Vanity + DropHelper.DropItemCondition(player, ModContent.ItemType(), CalamityWorld.revenge); DropHelper.DropItemChance(player, ModContent.ItemType(), 7); } } diff --git a/Items/TreasureBags/BumblebirbBag.cs b/Items/TreasureBags/BumblebirbBag.cs index 7f539e3f61..4fd83e246c 100644 --- a/Items/TreasureBags/BumblebirbBag.cs +++ b/Items/TreasureBags/BumblebirbBag.cs @@ -48,12 +48,13 @@ namespace CalamityMod.Items.TreasureBags DropHelper.DropEntireWeightedSet(player, DropHelper.WeightStack(w), DropHelper.WeightStack(w), - DropHelper.WeightStack(w) - ); + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w) + ); - // Equipment - DropHelper.DropItem(player, ModContent.ItemType()); - DropHelper.DropItemChance(player, ModContent.ItemType(), 3); + // Equipment + DropHelper.DropItem(player, ModContent.ItemType()); DropHelper.DropItemCondition(player, ModContent.ItemType(), CalamityWorld.revenge && !player.Calamity().rageBoostThree); // Vanity diff --git a/Items/TreasureBags/CalamitasBag.cs b/Items/TreasureBags/CalamitasBag.cs index 3784b188d6..eb3c15b88c 100644 --- a/Items/TreasureBags/CalamitasBag.cs +++ b/Items/TreasureBags/CalamitasBag.cs @@ -55,15 +55,16 @@ namespace CalamityMod.Items.TreasureBags DropHelper.WeightStack(w), DropHelper.WeightStack(w), DropHelper.WeightStack(w), - DropHelper.WeightStack(w) - ); + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w) + ); // Equipment DropHelper.DropItem(player, ModContent.ItemType()); - DropHelper.DropItemChance(player, ModContent.ItemType(), 5); - // Vanity - DropHelper.DropItemChance(player, ModContent.ItemType(), 7); + // Vanity + DropHelper.DropItemChance(player, ModContent.ItemType(), 7); if (Main.rand.NextBool(10)) { DropHelper.DropItem(player, ModContent.ItemType()); diff --git a/Items/TreasureBags/CeaselessVoidBag.cs b/Items/TreasureBags/CeaselessVoidBag.cs index a2d7a896d6..fc11d8cd16 100644 --- a/Items/TreasureBags/CeaselessVoidBag.cs +++ b/Items/TreasureBags/CeaselessVoidBag.cs @@ -42,9 +42,9 @@ namespace CalamityMod.Items.TreasureBags DropHelper.DropItemChance(player, ModContent.ItemType(), DropHelper.BagWeaponDropRateInt); // Equipment - DropHelper.DropItem(player, ModContent.ItemType()); + DropHelper.DropItem(player, ModContent.ItemType()); - // Vanity + // Vanity DropHelper.DropItemChance(player, ModContent.ItemType(), 7); if (Main.rand.NextBool(20)) { diff --git a/Items/TreasureBags/CrabulonBag.cs b/Items/TreasureBags/CrabulonBag.cs index a7c76ff9bc..7ad0e87be8 100644 --- a/Items/TreasureBags/CrabulonBag.cs +++ b/Items/TreasureBags/CrabulonBag.cs @@ -59,8 +59,8 @@ namespace CalamityMod.Items.TreasureBags DropHelper.DropItem(player, ModContent.ItemType()); DropHelper.DropItemCondition(player, ModContent.ItemType(), CalamityWorld.revenge && !player.Calamity().rageBoostOne); - // Vanity - DropHelper.DropItemChance(player, ModContent.ItemType(), 7); + // Vanity + DropHelper.DropItemChance(player, ModContent.ItemType(), 7); } } } diff --git a/Items/TreasureBags/CryogenBag.cs b/Items/TreasureBags/CryogenBag.cs index 70b732d33e..4d4e20f003 100644 --- a/Items/TreasureBags/CryogenBag.cs +++ b/Items/TreasureBags/CryogenBag.cs @@ -56,19 +56,17 @@ namespace CalamityMod.Items.TreasureBags DropHelper.WeightStack(w), DropHelper.WeightStack(w), DropHelper.WeightStack(w), - DropHelper.WeightStack(w) - ); + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w) + ); - // Equipment - DropHelper.DropItem(player, ModContent.ItemType()); - DropHelper.DropItemChance(player, ModContent.ItemType(), 5); - DropHelper.DropItemChance(player, ModContent.ItemType(), 5); + // Equipment + DropHelper.DropItem(player, ModContent.ItemType()); // Vanity DropHelper.DropItemChance(player, ModContent.ItemType(), 7); - - // Other - DropHelper.DropItemChance(player, ItemID.FrozenKey, 5); } } } diff --git a/Items/TreasureBags/DesertScourgeBag.cs b/Items/TreasureBags/DesertScourgeBag.cs index ca1f76c055..a73be72d85 100644 --- a/Items/TreasureBags/DesertScourgeBag.cs +++ b/Items/TreasureBags/DesertScourgeBag.cs @@ -54,13 +54,13 @@ namespace CalamityMod.Items.TreasureBags DropHelper.WeightStack(w), DropHelper.WeightStack(w), DropHelper.WeightStack(w), - DropHelper.WeightStack(w) - ); + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w) + ); - // Equipment - DropHelper.DropItem(player, ModContent.ItemType()); - DropHelper.DropItemChance(player, ModContent.ItemType(), 5); - DropHelper.DropItemChance(player, ModContent.ItemType(), 9); + // Equipment + DropHelper.DropItem(player, ModContent.ItemType()); // Vanity DropHelper.DropItemChance(player, ModContent.ItemType(), 7); diff --git a/Items/TreasureBags/DevourerofGodsBag.cs b/Items/TreasureBags/DevourerofGodsBag.cs index 6da413b414..d40d964cb3 100644 --- a/Items/TreasureBags/DevourerofGodsBag.cs +++ b/Items/TreasureBags/DevourerofGodsBag.cs @@ -64,11 +64,13 @@ namespace CalamityMod.Items.TreasureBags DropHelper.WeightStack(w), DropHelper.WeightStack(w), DropHelper.WeightStack(w), - DropHelper.WeightStack(w) - ); + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w) + ); - // Equipment - DropHelper.DropItem(player, ModContent.ItemType()); + // Equipment + DropHelper.DropItem(player, ModContent.ItemType()); // Vanity DropHelper.DropItemChance(player, ModContent.ItemType(), 7); diff --git a/Items/TreasureBags/HiveMindBag.cs b/Items/TreasureBags/HiveMindBag.cs index 9019f02574..8ab63bed70 100644 --- a/Items/TreasureBags/HiveMindBag.cs +++ b/Items/TreasureBags/HiveMindBag.cs @@ -57,12 +57,12 @@ namespace CalamityMod.Items.TreasureBags DropHelper.WeightStack(w), DropHelper.WeightStack(w), DropHelper.WeightStack(w), - DropHelper.WeightStack(w, 50, 75) - ); + DropHelper.WeightStack(w, 50, 75), + DropHelper.WeightStack(w) + ); - // Equipment - DropHelper.DropItem(player, ModContent.ItemType()); - DropHelper.DropItemChance(player, ModContent.ItemType(), 3); + // Equipment + DropHelper.DropItem(player, ModContent.ItemType()); // Vanity DropHelper.DropItemChance(player, ModContent.ItemType(), 7); diff --git a/Items/TreasureBags/LeviathanBag.cs b/Items/TreasureBags/LeviathanBag.cs index b3ae47cc8d..995a06116f 100644 --- a/Items/TreasureBags/LeviathanBag.cs +++ b/Items/TreasureBags/LeviathanBag.cs @@ -52,15 +52,16 @@ namespace CalamityMod.Items.TreasureBags DropHelper.WeightStack(w), DropHelper.WeightStack(w), DropHelper.WeightStack(w), - DropHelper.WeightStack(w) - ); + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w) + ); // Equipment DropHelper.DropItem(player, ModContent.ItemType()); - DropHelper.DropItemChance(player, ModContent.ItemType(), 3); - // Vanity - DropHelper.DropItemChance(player, ModContent.ItemType(), 7); + // Vanity + DropHelper.DropItemChance(player, ModContent.ItemType(), 7); DropHelper.DropItemChance(player, ModContent.ItemType(), 7); // Fishing diff --git a/Items/TreasureBags/OldDukeBag.cs b/Items/TreasureBags/OldDukeBag.cs index 7e9843b4c2..43a73ab822 100644 --- a/Items/TreasureBags/OldDukeBag.cs +++ b/Items/TreasureBags/OldDukeBag.cs @@ -51,11 +51,12 @@ namespace CalamityMod.Items.TreasureBags DropHelper.WeightStack(w), DropHelper.WeightStack(w), DropHelper.WeightStack(w), - DropHelper.WeightStack(w) - ); + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w) + ); - // Equipment - DropHelper.DropItemChance(player, ModContent.ItemType(), 10); + // Equipment DropHelper.DropItem(player, ModContent.ItemType()); // Vanity diff --git a/Items/TreasureBags/PerforatorBag.cs b/Items/TreasureBags/PerforatorBag.cs index fae71de909..fd7e50a36f 100644 --- a/Items/TreasureBags/PerforatorBag.cs +++ b/Items/TreasureBags/PerforatorBag.cs @@ -58,12 +58,12 @@ namespace CalamityMod.Items.TreasureBags DropHelper.WeightStack(w), DropHelper.WeightStack(w), DropHelper.WeightStack(w), - DropHelper.WeightStack(w, 50, 75) - ); + DropHelper.WeightStack(w, 50, 75), + DropHelper.WeightStack(w) + ); - // Equipment - DropHelper.DropItem(player, ModContent.ItemType()); - DropHelper.DropItemChance(player, ModContent.ItemType(), 3); + // Equipment + DropHelper.DropItem(player, ModContent.ItemType()); // Vanity DropHelper.DropItemChance(player, ModContent.ItemType(), 7); diff --git a/Items/TreasureBags/PlaguebringerGoliathBag.cs b/Items/TreasureBags/PlaguebringerGoliathBag.cs index 1540818f16..0e49a73b73 100644 --- a/Items/TreasureBags/PlaguebringerGoliathBag.cs +++ b/Items/TreasureBags/PlaguebringerGoliathBag.cs @@ -59,11 +59,12 @@ namespace CalamityMod.Items.TreasureBags DropHelper.WeightStack(w), DropHelper.WeightStack(w), DropHelper.WeightStack(w), - DropHelper.WeightStack(w) - ); + DropHelper.WeightStack(w), + DropHelper.WeightStack(w) + ); - // Equipment - DropHelper.DropItem(player, ModContent.ItemType()); + // Equipment + DropHelper.DropItem(player, ModContent.ItemType()); // Vanity DropHelper.DropItemChance(player, ModContent.ItemType(), 7); diff --git a/Items/TreasureBags/PolterghastBag.cs b/Items/TreasureBags/PolterghastBag.cs index e1d8bccec1..be28fa6e52 100644 --- a/Items/TreasureBags/PolterghastBag.cs +++ b/Items/TreasureBags/PolterghastBag.cs @@ -64,8 +64,8 @@ namespace CalamityMod.Items.TreasureBags DropHelper.WeightStack(w) ); - // Equipment - DropHelper.DropItem(player, ModContent.ItemType()); + // Equipment + DropHelper.DropItem(player, ModContent.ItemType()); DropHelper.DropItemCondition(player, ModContent.ItemType(), CalamityWorld.revenge && !player.Calamity().adrenalineBoostThree); // Vanity diff --git a/Items/TreasureBags/ProvidenceBag.cs b/Items/TreasureBags/ProvidenceBag.cs index 522112a14e..1057f31811 100644 --- a/Items/TreasureBags/ProvidenceBag.cs +++ b/Items/TreasureBags/ProvidenceBag.cs @@ -56,11 +56,12 @@ namespace CalamityMod.Items.TreasureBags DropHelper.WeightStack(w), DropHelper.WeightStack(w), DropHelper.WeightStack(w), - DropHelper.WeightStack(w) - ); + DropHelper.WeightStack(w), + DropHelper.WeightStack(w) + ); - // Equipment - DropHelper.DropItem(player, ModContent.ItemType()); + // Equipment + DropHelper.DropItem(player, ModContent.ItemType()); // Vanity DropHelper.DropItemChance(player, ModContent.ItemType(), 7); diff --git a/Items/TreasureBags/RavagerBag.cs b/Items/TreasureBags/RavagerBag.cs index c445e31111..e76055c257 100644 --- a/Items/TreasureBags/RavagerBag.cs +++ b/Items/TreasureBags/RavagerBag.cs @@ -55,12 +55,13 @@ namespace CalamityMod.Items.TreasureBags DropHelper.WeightStack(w), DropHelper.WeightStack(w), DropHelper.WeightStack(w), - DropHelper.WeightStack(w) - ); + DropHelper.WeightStack(w), + DropHelper.WeightStack(w) + ); DropHelper.DropItemChance(player, ModContent.ItemType(), 0.05f); - // Equipment - DropHelper.DropItemChance(player, ModContent.ItemType(), 0.5f); + // Equipment + DropHelper.DropItemChance(player, ModContent.ItemType(), 0.5f); DropHelper.DropItemChance(player, ModContent.ItemType(), 0.5f); DropHelper.DropItemCondition(player, ModContent.ItemType(), CalamityWorld.downedProvidence); DropHelper.DropItemCondition(player, ModContent.ItemType(), CalamityWorld.revenge && !player.Calamity().rageBoostTwo); diff --git a/Items/TreasureBags/SignusBag.cs b/Items/TreasureBags/SignusBag.cs index 51b20d87c7..e607bab4b4 100644 --- a/Items/TreasureBags/SignusBag.cs +++ b/Items/TreasureBags/SignusBag.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Items.TreasureBags DropHelper.DropItemChance(player, ModContent.ItemType(), DropHelper.BagWeaponDropRateInt); DropHelper.DropItemChance(player, ModContent.ItemType(), DropHelper.BagWeaponDropRateInt); - // Equipment + // Equipment DropHelper.DropItem(player, ModContent.ItemType()); // Vanity diff --git a/Items/TreasureBags/SlimeGodBag.cs b/Items/TreasureBags/SlimeGodBag.cs index 76b2a4071f..a0e2767e20 100644 --- a/Items/TreasureBags/SlimeGodBag.cs +++ b/Items/TreasureBags/SlimeGodBag.cs @@ -61,8 +61,6 @@ namespace CalamityMod.Items.TreasureBags // Vanity DropHelper.DropItemFromSetChance(player, 0.142857f, ModContent.ItemType(), ModContent.ItemType()); - - // Other } } } diff --git a/Items/TreasureBags/StarterBag.cs b/Items/TreasureBags/StarterBag.cs index 8177532520..c207d172bd 100644 --- a/Items/TreasureBags/StarterBag.cs +++ b/Items/TreasureBags/StarterBag.cs @@ -54,10 +54,9 @@ namespace CalamityMod.Items.TreasureBags // Malice item DropHelper.DropItem(player, ModContent.ItemType()); - // Difficulty items (Death doesn't drop in Normal) + // Difficulty items (Revengeance and Death don't drop in Normal) + DropHelper.DropItemCondition(player, ModContent.ItemType(), Main.expertMode); DropHelper.DropItemCondition(player, ModContent.ItemType(), Main.expertMode); - DropHelper.DropItem(player, ModContent.ItemType()); - DropHelper.DropItem(player, ModContent.ItemType()); // The Lad DropHelper.DropItemCondition(player, ModContent.ItemType(), player.name == "Aleksh" || player.name == "Shark Lad"); diff --git a/Items/TreasureBags/StormWeaverBag.cs b/Items/TreasureBags/StormWeaverBag.cs index 519561299e..d8b053d974 100644 --- a/Items/TreasureBags/StormWeaverBag.cs +++ b/Items/TreasureBags/StormWeaverBag.cs @@ -41,10 +41,11 @@ namespace CalamityMod.Items.TreasureBags // Weapons DropHelper.DropItemChance(player, ModContent.ItemType(), DropHelper.BagWeaponDropRateInt); DropHelper.DropItemChance(player, ModContent.ItemType(), DropHelper.BagWeaponDropRateInt); + DropHelper.DropItemChance(player, ModContent.ItemType(), DropHelper.BagWeaponDropRateInt); - // Equipment (None yet boohoo) + // Equipment (None yet boohoo) - // Vanity + // Vanity DropHelper.DropItemChance(player, ModContent.ItemType(), 7); if (Main.rand.NextBool(20)) { diff --git a/Items/TreasureBags/YharonBag.cs b/Items/TreasureBags/YharonBag.cs index 46f26046f9..c13086533a 100644 --- a/Items/TreasureBags/YharonBag.cs +++ b/Items/TreasureBags/YharonBag.cs @@ -52,11 +52,12 @@ namespace CalamityMod.Items.TreasureBags DropHelper.WeightStack(w), DropHelper.WeightStack(w), // Yharon Kindle Staff DropHelper.WeightStack(w), // Infernal Spear - DropHelper.WeightStack(w) - ); + DropHelper.WeightStack(w), + DropHelper.WeightStack(w) + ); - // Equipment - DropHelper.DropItem(player, ModContent.ItemType()); + // Equipment + DropHelper.DropItem(player, ModContent.ItemType()); DropHelper.DropItem(player, ModContent.ItemType()); int soulFragMin = 22; diff --git a/Items/Weapons/DraedonsArsenal/PulseDragon.cs b/Items/Weapons/DraedonsArsenal/PulseDragon.cs index 81eee4591f..5532e48117 100644 --- a/Items/Weapons/DraedonsArsenal/PulseDragon.cs +++ b/Items/Weapons/DraedonsArsenal/PulseDragon.cs @@ -14,9 +14,8 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void SetStaticDefaults() { DisplayName.SetDefault("Pulse Dragon"); - Tooltip.SetDefault("Heavy duty flails, each containing a powerful generator which is activated upon launch.\n" + - "Throws two dragon heads that emit electrical fields\n" + - "Especially effective against inorganic targets"); + Tooltip.SetDefault("Heavy duty flails, each containing a powerful generator which is activated upon launch\n" + + "Throws two dragon heads that emit electrical fields"); } public override void SetDefaults() diff --git a/Items/Weapons/DraedonsArsenal/PulsePistol.cs b/Items/Weapons/DraedonsArsenal/PulsePistol.cs index a455b6f8bd..d869be0ff3 100644 --- a/Items/Weapons/DraedonsArsenal/PulsePistol.cs +++ b/Items/Weapons/DraedonsArsenal/PulsePistol.cs @@ -15,8 +15,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void SetStaticDefaults() { DisplayName.SetDefault("Pulse Pistol"); - Tooltip.SetDefault("Fires a pulse that arcs to a new target on enemy hits\n" + - "Inflicts more damage to inorganic targets"); + Tooltip.SetDefault("Fires a pulse that arcs to a new target on enemy hits"); } public override void SetDefaults() diff --git a/Items/Weapons/DraedonsArsenal/PulseRifle.cs b/Items/Weapons/DraedonsArsenal/PulseRifle.cs index 54ec5f25c4..92d78c26a2 100644 --- a/Items/Weapons/DraedonsArsenal/PulseRifle.cs +++ b/Items/Weapons/DraedonsArsenal/PulseRifle.cs @@ -17,9 +17,8 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void SetStaticDefaults() { DisplayName.SetDefault("Pulse Rifle"); - Tooltip.SetDefault("Draedon's former pulse rifle, used in emergencies for creations which turned against him.\n" + - "When the pulse hits a target it will arc to another nearby target\n" + - "Inflicts exceptional damage against inorganic targets"); + Tooltip.SetDefault("Draedon's former pulse rifle, used in emergencies for creations which turned against him\n" + + "When the pulse hits a target it will arc to another nearby target"); } public override void SetDefaults() diff --git a/Items/Weapons/DraedonsArsenal/PulseTurretRemote.cs b/Items/Weapons/DraedonsArsenal/PulseTurretRemote.cs index bd20538e8e..38262d9360 100644 --- a/Items/Weapons/DraedonsArsenal/PulseTurretRemote.cs +++ b/Items/Weapons/DraedonsArsenal/PulseTurretRemote.cs @@ -14,9 +14,8 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void SetStaticDefaults() { DisplayName.SetDefault("Pulse Turret Remote"); - Tooltip.SetDefault("A device used to defend against the weaker, less cognizant rogue creations of Draedon.\n" + + Tooltip.SetDefault("A device used to defend against the weaker, less cognizant rogue creations of Draedon\n" + "Summons a pulse turret which eradicates nearby foes with focused energy blasts\n" + - "Especially effective against inorganic targets\n" + "Only one pulse turret may exist at a time"); } diff --git a/Items/Weapons/DraedonsArsenal/SystemBane.cs b/Items/Weapons/DraedonsArsenal/SystemBane.cs index b9e70bc98a..897eb303c3 100644 --- a/Items/Weapons/DraedonsArsenal/SystemBane.cs +++ b/Items/Weapons/DraedonsArsenal/SystemBane.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void SetStaticDefaults() { DisplayName.SetDefault("System Bane"); - Tooltip.SetDefault("Can be used to quickly send out an electromagnetic blast, strong enough to target organic nervous systems.\n" + + Tooltip.SetDefault("Can be used to quickly send out an electromagnetic blast\n" + "Hurls an unstable device which sticks to the ground and shocks nearby enemies with lightning\n" + "Stealth strikes make the device emit a large, damaging EMP field"); } diff --git a/Items/Weapons/DraedonsArsenal/TeslaCannon.cs b/Items/Weapons/DraedonsArsenal/TeslaCannon.cs index 14ab9d1ac1..434c6363a8 100644 --- a/Items/Weapons/DraedonsArsenal/TeslaCannon.cs +++ b/Items/Weapons/DraedonsArsenal/TeslaCannon.cs @@ -18,8 +18,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal { DisplayName.SetDefault("Tesla Cannon"); Tooltip.SetDefault("Lightweight energy cannon that blasts an intense electrical beam that explodes\n" + - "Beams can arc to nearby targets\n" + - "Inflicts severe nervous system damage to organic targets"); + "Beams can arc to nearby targets"); } public override void SetDefaults() diff --git a/Items/Weapons/Magic/ArtAttack.cs b/Items/Weapons/Magic/ArtAttack.cs new file mode 100644 index 0000000000..fb2e91527d --- /dev/null +++ b/Items/Weapons/Magic/ArtAttack.cs @@ -0,0 +1,54 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Magic; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Magic +{ + public class ArtAttack : ModItem + { + public const int MaxDamageBoostTime = 270; + public const float MaxDamageBoostFactor = 2.3f; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Art Attack"); + Tooltip.SetDefault("Casts a star that follows the mouse that creates a rainbow trail as it moves\n" + + "Once a full shape is created with the trail all enemies within it take damage proportional to how long it took to draw the shape\n" + + "And the audience goes wild!"); + } + + public override void SetDefaults() + { + item.damage = 52; + item.magic = true; + item.mana = 10; + item.width = 70; + item.height = 70; + item.useTime = item.useAnimation = 24; + item.useStyle = ItemUseStyleID.HoldingOut; + item.noMelee = true; + item.knockBack = 2f; + item.value = CalamityGlobalItem.Rarity6BuyPrice; + item.rare = ItemRarityID.LightPurple; + item.UseSound = SoundID.Item28; + item.autoReuse = true; + item.noUseGraphic = true; + item.shoot = ModContent.ProjectileType(); + item.channel = true; + item.shootSpeed = 12f; + item.Calamity().donorItem = true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.RainbowRod); + recipe.AddIngredient(ItemID.LargeRuby); + recipe.AddIngredient(ItemID.CrystalShard); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Weapons/Magic/ArtAttack.png b/Items/Weapons/Magic/ArtAttack.png new file mode 100644 index 0000000000..917ea9a492 Binary files /dev/null and b/Items/Weapons/Magic/ArtAttack.png differ diff --git a/Items/Weapons/Magic/ClamorNoctus.png b/Items/Weapons/Magic/ClamorNoctus.png index 3e3a523ae8..1dcf92a777 100644 Binary files a/Items/Weapons/Magic/ClamorNoctus.png and b/Items/Weapons/Magic/ClamorNoctus.png differ diff --git a/Items/Weapons/Magic/ClothiersWrath.cs b/Items/Weapons/Magic/ClothiersWrath.cs index 07a1d54859..7914e3b0a6 100644 --- a/Items/Weapons/Magic/ClothiersWrath.cs +++ b/Items/Weapons/Magic/ClothiersWrath.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 24; + item.damage = 19; item.magic = true; item.mana = 15; item.width = 28; @@ -31,7 +31,6 @@ namespace CalamityMod.Items.Weapons.Magic item.autoReuse = true; item.shoot = ProjectileID.ClothiersCurse; item.shootSpeed = 6f; - item.Calamity().challengeDrop = true; } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) diff --git a/Items/Weapons/Magic/Cryophobia.cs b/Items/Weapons/Magic/Cryophobia.cs index 48f8fbd671..3bc9f5140c 100644 --- a/Items/Weapons/Magic/Cryophobia.cs +++ b/Items/Weapons/Magic/Cryophobia.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 56; + item.damage = 55; item.magic = true; item.mana = 18; item.width = 56; @@ -26,13 +26,12 @@ namespace CalamityMod.Items.Weapons.Magic item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 1.5f; - item.value = CalamityGlobalItem.Rarity5BuyPrice; - item.rare = ItemRarityID.Pink; + item.value = CalamityGlobalItem.Rarity6BuyPrice; + item.rare = ItemRarityID.LightPurple; item.UseSound = SoundID.Item117; item.autoReuse = true; item.shootSpeed = 12f; item.shoot = ModContent.ProjectileType(); - item.Calamity().challengeDrop = true; } public override Vector2? HoldoutOffset() diff --git a/Items/Weapons/Magic/EidolicWail.cs b/Items/Weapons/Magic/EidolicWail.cs index 2bbb727c92..29524f1a11 100644 --- a/Items/Weapons/Magic/EidolicWail.cs +++ b/Items/Weapons/Magic/EidolicWail.cs @@ -29,10 +29,10 @@ namespace CalamityMod.Items.Weapons.Magic item.noMelee = true; item.knockBack = 1f; item.value = Item.buyPrice(1, 40, 0, 0); - item.rare = ItemRarityID.Red; + item.rare = ItemRarityID.Purple; item.UseSound = mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/WyrmScream"); item.autoReuse = true; - item.shootSpeed = 5f; + item.shootSpeed = 8f; item.shoot = ModContent.ProjectileType(); item.Calamity().customRarity = CalamityRarity.PureGreen; } diff --git a/Items/Weapons/Magic/EyeofMagnus.cs b/Items/Weapons/Magic/EyeofMagnus.cs deleted file mode 100644 index 9d44d4f827..0000000000 --- a/Items/Weapons/Magic/EyeofMagnus.cs +++ /dev/null @@ -1,44 +0,0 @@ -using CalamityMod.Projectiles.Magic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ModLoader; -using Terraria.ID; - -namespace CalamityMod.Items.Weapons.Magic -{ - public class EyeofMagnus : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Eye of Magnus"); - Tooltip.SetDefault("Fires powerful beams\n" + - "Heals mana and health on hit"); - } - - public override void SetDefaults() - { - item.width = 80; - item.damage = 80; - item.rare = ItemRarityID.Cyan; - item.useAnimation = 20; - item.useTime = 20; - item.useStyle = ItemUseStyleID.HoldingOut; - item.knockBack = 2f; - item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LaserCannon"); - item.magic = true; - item.mana = 7; - item.autoReuse = true; - item.noMelee = true; - item.height = 50; - item.value = CalamityGlobalItem.Rarity9BuyPrice; - item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 12f; - item.Calamity().challengeDrop = true; - } - - public override Vector2? HoldoutOffset() - { - return new Vector2(-15, 0); - } - } -} diff --git a/Items/Weapons/Magic/HadopelagicEcho.cs b/Items/Weapons/Magic/HadopelagicEcho.cs index 1725f7fa7b..566ad47f78 100644 --- a/Items/Weapons/Magic/HadopelagicEcho.cs +++ b/Items/Weapons/Magic/HadopelagicEcho.cs @@ -15,10 +15,8 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetStaticDefaults() { DisplayName.SetDefault("Hadopelagic Echo"); - Tooltip.SetDefault("Fires a string of bouncing sound waves\n" + - "Sound waves fired later in the chain deal more damage\n" + - "Sound waves echo additional sound waves on enemy hits\n" + - "Sound waves deal more damage the more they pierce"); + Tooltip.SetDefault("Fires a string of bouncing sound waves that become stronger as they travel\n" + + "Sound waves echo additional sound waves on enemy hits"); } public override void SetDefaults() @@ -37,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Magic item.value = Item.buyPrice(2, 50, 0, 0); item.rare = ItemRarityID.Red; item.autoReuse = true; - item.shootSpeed = 20f; + item.shootSpeed = 10f; item.shoot = ModContent.ProjectileType(); item.Calamity().customRarity = CalamityRarity.Violet; } @@ -49,16 +47,7 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - float damageMult = 1f; - if (counter == 1) - damageMult = 1.1f; - if (counter == 2) - damageMult = 1.2f; - if (counter == 3) - damageMult = 1.35f; - if (counter == 4) - damageMult = 1.5f; - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, (int)(damage * damageMult), knockBack, player.whoAmI, counter, 0f); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, counter); counter++; if (counter >= 5) counter = 0; diff --git a/Items/Weapons/Magic/PlasmaRifle.cs b/Items/Weapons/Magic/PlasmaRifle.cs index 4835bc027c..157177884f 100644 --- a/Items/Weapons/Magic/PlasmaRifle.cs +++ b/Items/Weapons/Magic/PlasmaRifle.cs @@ -21,8 +21,8 @@ namespace CalamityMod.Items.Weapons.Magic item.damage = 160; item.mana = 40; item.magic = true; - item.width = 48; - item.height = 22; + item.width = 72; + item.height = 20; item.useTime = item.useAnimation = 8; item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; diff --git a/Items/Weapons/Magic/PlasmaRifle.png b/Items/Weapons/Magic/PlasmaRifle.png index 7623823a35..3c01d80ac2 100644 Binary files a/Items/Weapons/Magic/PlasmaRifle.png and b/Items/Weapons/Magic/PlasmaRifle.png differ diff --git a/Items/Weapons/Magic/SHPC.cs b/Items/Weapons/Magic/SHPC.cs index f4902b57f6..9e4ae6a5a5 100644 --- a/Items/Weapons/Magic/SHPC.cs +++ b/Items/Weapons/Magic/SHPC.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 22; + item.damage = 18; item.magic = true; item.mana = 20; item.width = 90; @@ -33,7 +33,6 @@ namespace CalamityMod.Items.Weapons.Magic item.value = CalamityGlobalItem.Rarity5BuyPrice; item.rare = ItemRarityID.Pink; - item.Calamity().challengeDrop = true; } public override Vector2? HoldoutOffset() diff --git a/Items/Weapons/Magic/StardustStaff.cs b/Items/Weapons/Magic/StardustStaff.cs index ac30bb4936..611dd47c5f 100644 --- a/Items/Weapons/Magic/StardustStaff.cs +++ b/Items/Weapons/Magic/StardustStaff.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 90; + item.damage = 110; item.magic = true; item.mana = 20; item.width = 56; @@ -29,13 +29,13 @@ namespace CalamityMod.Items.Weapons.Magic item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 7f; - item.value = Item.buyPrice(0, 95, 0, 0); - item.rare = ItemRarityID.Cyan; - item.UseSound = SoundID.Item43; + item.value = Item.buyPrice(1, 40, 0, 0); + item.rare = ItemRarityID.Purple; + item.Calamity().customRarity = CalamityRarity.PureGreen; + item.UseSound = SoundID.Item43; item.autoReuse = true; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 12f; - item.Calamity().challengeDrop = true; } public override Vector2? HoldoutOrigin() => new Vector2(15, 15); diff --git a/Items/Weapons/Magic/StratusSphere.png b/Items/Weapons/Magic/StratusSphere.png index e0affc9ac3..b26cd057fc 100644 Binary files a/Items/Weapons/Magic/StratusSphere.png and b/Items/Weapons/Magic/StratusSphere.png differ diff --git a/Items/Weapons/Magic/TacticiansTrumpCard.cs b/Items/Weapons/Magic/TacticiansTrumpCard.cs index 8384c6f9c3..78fc1645e5 100644 --- a/Items/Weapons/Magic/TacticiansTrumpCard.cs +++ b/Items/Weapons/Magic/TacticiansTrumpCard.cs @@ -34,7 +34,8 @@ namespace CalamityMod.Items.Weapons.Magic item.value = CalamityGlobalItem.Rarity12BuyPrice; item.rare = ItemRarityID.Purple; item.Calamity().customRarity = CalamityRarity.Turquoise; - } + item.Calamity().donorItem = true; + } public override void MeleeEffects(Player player, Rectangle hitbox) { diff --git a/Items/Weapons/Magic/ThornBlossom.cs b/Items/Weapons/Magic/ThornBlossom.cs index 6d386a0c23..c5225e9042 100644 --- a/Items/Weapons/Magic/ThornBlossom.cs +++ b/Items/Weapons/Magic/ThornBlossom.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 35; + item.damage = 60; item.magic = true; item.mana = 10; item.width = 66; @@ -28,13 +28,13 @@ namespace CalamityMod.Items.Weapons.Magic item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 2f; - item.value = CalamityGlobalItem.Rarity7BuyPrice; - item.rare = ItemRarityID.Lime; + item.value = CalamityGlobalItem.Rarity12BuyPrice; + item.rare = ItemRarityID.Purple; + item.Calamity().customRarity = CalamityRarity.Turquoise; item.UseSound = SoundID.Item109; item.autoReuse = true; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 20f; - item.Calamity().challengeDrop = true; } public override Vector2? HoldoutOrigin() => new Vector2(15, 15); diff --git a/Items/Weapons/Magic/Thunderstorm.cs b/Items/Weapons/Magic/Thunderstorm.cs index 5c0ae7b490..5ca17d6ef9 100644 --- a/Items/Weapons/Magic/Thunderstorm.cs +++ b/Items/Weapons/Magic/Thunderstorm.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 165; + item.damage = 132; item.mana = 50; item.magic = true; item.width = 48; @@ -31,7 +31,6 @@ namespace CalamityMod.Items.Weapons.Magic item.autoReuse = true; item.shootSpeed = 6f; item.shoot = ModContent.ProjectileType(); - item.Calamity().challengeDrop = true; } public override Vector2? HoldoutOffset() diff --git a/Items/Weapons/Magic/Vesuvius.cs b/Items/Weapons/Magic/Vesuvius.cs index d94d2044b1..85da54edf2 100644 --- a/Items/Weapons/Magic/Vesuvius.cs +++ b/Items/Weapons/Magic/Vesuvius.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { item.width = 62; - item.damage = 75; + item.damage = 60; item.mana = 6; item.magic = true; item.useAnimation = item.useTime = 15; @@ -36,7 +36,6 @@ namespace CalamityMod.Items.Weapons.Magic item.value = CalamityGlobalItem.Rarity8BuyPrice; item.rare = ItemRarityID.Yellow; - item.Calamity().challengeDrop = true; } public override bool AltFunctionUse(Player player) diff --git a/Items/Weapons/Magic/VoidVortex.cs b/Items/Weapons/Magic/VoidVortex.cs index 3bc70f86c5..731f425bcf 100644 --- a/Items/Weapons/Magic/VoidVortex.cs +++ b/Items/Weapons/Magic/VoidVortex.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 140; + item.damage = 112; item.magic = true; item.mana = 60; item.width = 130; @@ -36,7 +36,6 @@ namespace CalamityMod.Items.Weapons.Magic item.autoReuse = true; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 12f; - item.Calamity().challengeDrop = true; } public override Vector2? HoldoutOrigin() diff --git a/Items/Weapons/Magic/YharimsCrystal.cs b/Items/Weapons/Magic/YharimsCrystal.cs index 220cde3e0e..a50b7439db 100644 --- a/Items/Weapons/Magic/YharimsCrystal.cs +++ b/Items/Weapons/Magic/YharimsCrystal.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 88; + item.damage = 70; item.magic = true; item.mana = 15; item.width = 16; @@ -35,7 +35,6 @@ namespace CalamityMod.Items.Weapons.Magic item.rare = ItemRarityID.Purple; item.value = CalamityGlobalItem.Rarity15BuyPrice; item.Calamity().customRarity = CalamityRarity.Violet; - item.Calamity().challengeDrop = true; } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; diff --git a/Items/Weapons/Melee/AegisBlade.cs b/Items/Weapons/Melee/AegisBlade.cs index b7cf42686c..4441229b8d 100644 --- a/Items/Weapons/Melee/AegisBlade.cs +++ b/Items/Weapons/Melee/AegisBlade.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Melee item.width = 58; item.height = 58; item.scale = 1.5f; - item.damage = 135; + item.damage = 108; item.melee = true; item.useAnimation = item.useTime = 15; item.useTurn = true; @@ -32,7 +32,6 @@ namespace CalamityMod.Items.Weapons.Melee item.value = CalamityGlobalItem.Rarity7BuyPrice; item.rare = ItemRarityID.Lime; - item.Calamity().challengeDrop = true; } public override bool AltFunctionUse(Player player) diff --git a/Items/Weapons/Melee/AncientCrusher.cs b/Items/Weapons/Melee/AncientCrusher.cs deleted file mode 100644 index cfa53755ed..0000000000 --- a/Items/Weapons/Melee/AncientCrusher.cs +++ /dev/null @@ -1,63 +0,0 @@ -using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Melee; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.Melee -{ - public class AncientCrusher : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ancient Crusher"); - Tooltip.SetDefault("Summons fossil spikes on enemy hits"); - } - - public override void SetDefaults() - { - item.width = 62; - item.height = 62; - item.scale = 2f; - item.damage = 55; - item.melee = true; - item.useAnimation = 30; - item.useStyle = ItemUseStyleID.SwingThrow; - item.useTime = 30; - item.useTurn = true; - item.knockBack = 8f; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.value = Item.buyPrice(0, 36, 0, 0); - item.rare = ItemRarityID.Pink; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Amber, 8); - recipe.AddIngredient(ItemID.FossilOre, 35); - recipe.AddIngredient(ModContent.ItemType(), 3); - recipe.AddTile(TileID.Anvils); - recipe.SetResult(this); - recipe.AddRecipe(); - } - - public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) - { - if (crit) - damage /= 2; - - Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, Main.myPlayer); - } - - public override void OnHitPvp(Player player, Player target, int damage, bool crit) - { - if (crit) - damage /= 2; - - Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), damage, item.knockBack, Main.myPlayer); - } - } -} diff --git a/Items/Weapons/Melee/AncientCrusher.png b/Items/Weapons/Melee/AncientCrusher.png deleted file mode 100644 index e5dfebb9b0..0000000000 Binary files a/Items/Weapons/Melee/AncientCrusher.png and /dev/null differ diff --git a/Items/Weapons/Melee/BrinyBaron.cs b/Items/Weapons/Melee/BrinyBaron.cs index 78a70c5a9c..5df0db9741 100644 --- a/Items/Weapons/Melee/BrinyBaron.cs +++ b/Items/Weapons/Melee/BrinyBaron.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.damage = 155; + item.damage = 124; item.knockBack = 4f; item.useAnimation = item.useTime = 15; item.melee = true; @@ -33,7 +33,6 @@ namespace CalamityMod.Items.Weapons.Melee item.value = CalamityGlobalItem.Rarity8BuyPrice; item.rare = ItemRarityID.Yellow; - item.Calamity().challengeDrop = true; } public override bool AltFunctionUse(Player player) => true; diff --git a/Items/Weapons/Melee/Carnage.cs b/Items/Weapons/Melee/Carnage.cs index 8e5ff4fa35..3e28c919d1 100644 --- a/Items/Weapons/Melee/Carnage.cs +++ b/Items/Weapons/Melee/Carnage.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = 46; - item.damage = 69; + item.damage = 70; item.melee = true; item.useAnimation = 21; item.useStyle = ItemUseStyleID.SwingThrow; @@ -28,9 +28,8 @@ namespace CalamityMod.Items.Weapons.Melee item.useTurn = true; item.height = 60; item.scale = 1.25f; - item.value = CalamityGlobalItem.Rarity3BuyPrice; - item.rare = ItemRarityID.Orange; - item.Calamity().challengeDrop = true; + item.value = CalamityGlobalItem.Rarity4BuyPrice; + item.rare = ItemRarityID.LightRed; } public override void MeleeEffects(Player player, Rectangle hitbox) diff --git a/Items/Weapons/Melee/CosmicDischarge.cs b/Items/Weapons/Melee/CosmicDischarge.cs index 05c22b177f..b9a90e6db8 100644 --- a/Items/Weapons/Melee/CosmicDischarge.cs +++ b/Items/Weapons/Melee/CosmicDischarge.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Melee { item.width = 50; item.height = 52; - item.damage = 500; + item.damage = 400; item.noMelee = true; item.noUseGraphic = true; item.channel = true; @@ -36,7 +36,6 @@ namespace CalamityMod.Items.Weapons.Melee item.rare = ItemRarityID.Purple; item.value = CalamityGlobalItem.Rarity14BuyPrice; item.Calamity().customRarity = CalamityRarity.DarkBlue; - item.Calamity().challengeDrop = true; } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) diff --git a/Items/Weapons/Melee/CrescentMoon.png b/Items/Weapons/Melee/CrescentMoon.png index 418d2481fd..7d78a850cf 100644 Binary files a/Items/Weapons/Melee/CrescentMoon.png and b/Items/Weapons/Melee/CrescentMoon.png differ diff --git a/Items/Weapons/Melee/EvilSmasher.cs b/Items/Weapons/Melee/EvilSmasher.cs index 091f7604dd..e4362e0c85 100644 --- a/Items/Weapons/Melee/EvilSmasher.cs +++ b/Items/Weapons/Melee/EvilSmasher.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee item.width = 64; item.height = 66; item.scale = 2f; - item.damage = 125; + item.damage = 100; item.melee = true; item.useAnimation = item.useTime = 38; item.useStyle = ItemUseStyleID.SwingThrow; @@ -33,7 +33,6 @@ namespace CalamityMod.Items.Weapons.Melee item.autoReuse = true; item.value = CalamityGlobalItem.Rarity4BuyPrice; item.rare = ItemRarityID.LightRed; - item.Calamity().challengeDrop = true; } public override float UseTimeMultiplier (Player player) => 1f + (player.Calamity().evilSmasherBoost * 0.1f); diff --git a/Items/Weapons/Melee/Floodtide.cs b/Items/Weapons/Melee/Floodtide.cs index 338bba2c98..a0b2733e6c 100644 --- a/Items/Weapons/Melee/Floodtide.cs +++ b/Items/Weapons/Melee/Floodtide.cs @@ -20,8 +20,8 @@ namespace CalamityMod.Items.Weapons.Melee { item.damage = 89; item.melee = true; - item.width = 60; - item.height = 64; + item.width = 80; + item.height = 92; item.useTime = 21; item.useAnimation = 21; item.useTurn = true; @@ -35,6 +35,11 @@ namespace CalamityMod.Items.Weapons.Melee item.shootSpeed = 18f; } + public override void UseStyle(Player player) + { + player.itemLocation += new Vector2(-4f * player.direction, 2f * player.gravDir).RotatedBy(player.itemRotation); + } + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { for (int i = 0; i < 2; i++) diff --git a/Items/Weapons/Melee/Floodtide.png b/Items/Weapons/Melee/Floodtide.png index 865c89cf71..ac2f6426c7 100644 Binary files a/Items/Weapons/Melee/Floodtide.png and b/Items/Weapons/Melee/Floodtide.png differ diff --git a/Items/Weapons/Melee/GaelsGreatsword.cs b/Items/Weapons/Melee/GaelsGreatsword.cs index 195974afa1..40d3770f96 100644 --- a/Items/Weapons/Melee/GaelsGreatsword.cs +++ b/Items/Weapons/Melee/GaelsGreatsword.cs @@ -54,7 +54,6 @@ namespace CalamityMod.Items.Weapons.Melee item.value = CalamityGlobalItem.Rarity15BuyPrice; item.Calamity().customRarity = CalamityRarity.Violet; item.Calamity().devItem = true; - item.Calamity().challengeDrop = true; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 15f; diff --git a/Items/Weapons/Melee/GalileoGladius.png b/Items/Weapons/Melee/GalileoGladius.png index e86d4d80e8..9fb7a43132 100644 Binary files a/Items/Weapons/Melee/GalileoGladius.png and b/Items/Weapons/Melee/GalileoGladius.png differ diff --git a/Items/Weapons/Melee/GrandDad.cs b/Items/Weapons/Melee/GrandDad.cs deleted file mode 100644 index afd17b61e0..0000000000 --- a/Items/Weapons/Melee/GrandDad.cs +++ /dev/null @@ -1,51 +0,0 @@ -using CalamityMod.NPCs; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.Melee -{ - public class GrandDad : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Grand Dad"); - Tooltip.SetDefault("Lowers enemy defense to 0 when they are struck\n" + - "Yeets enemies across space and time\n" + - "7"); - } - - public override void SetDefaults() - { - item.width = 124; - item.height = 124; - item.damage = 777; - item.melee = true; - item.useAnimation = 25; - item.useStyle = ItemUseStyleID.SwingThrow; - item.useTime = 25; - item.useTurn = true; - item.knockBack = 77f; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.value = CalamityGlobalItem.Rarity10BuyPrice; - item.rare = ItemRarityID.Red; - item.Calamity().challengeDrop = true; - } - - public override void UseStyle(Player player) - { - player.itemLocation += new Vector2(-12f * player.direction, 12f * player.gravDir).RotatedBy(player.itemRotation); - } - - public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) - { - if (CalamityGlobalNPC.ShouldAffectNPC(target)) - { - target.knockBackResist = 7f; - target.defense = 0; - } - } - } -} diff --git a/Items/Weapons/Melee/GrandDad.png b/Items/Weapons/Melee/GrandDad.png deleted file mode 100644 index 09d8d4c91b..0000000000 Binary files a/Items/Weapons/Melee/GrandDad.png and /dev/null differ diff --git a/Items/Weapons/Melee/OmegaBiomeBlade.cs b/Items/Weapons/Melee/OmegaBiomeBlade.cs index 350fa2b002..f4ae128c45 100644 --- a/Items/Weapons/Melee/OmegaBiomeBlade.cs +++ b/Items/Weapons/Melee/OmegaBiomeBlade.cs @@ -2,6 +2,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using CalamityMod.Particles; using CalamityMod.Projectiles.Melee; +using CalamityMod.Items.Placeables.Ores; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -229,11 +230,11 @@ namespace CalamityMod.Items.Weapons.Melee public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemType()); - recipe.AddIngredient(ItemType()); - recipe.AddIngredient(ItemType(), 3); - recipe.AddIngredient(ItemType(), 3); - recipe.AddIngredient(ItemID.LunarBar, 5); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 3); + recipe.AddIngredient(ModContent.ItemType(), 3); + recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Melee/RoyalKnivesMelee.cs b/Items/Weapons/Melee/RoyalKnivesMelee.cs index 4df0a352a5..a9eb098d25 100644 --- a/Items/Weapons/Melee/RoyalKnivesMelee.cs +++ b/Items/Weapons/Melee/RoyalKnivesMelee.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.width = 18; + item.width = 44; item.damage = 400; item.melee = true; item.noMelee = true; @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Melee item.knockBack = 3f; item.UseSound = SoundID.Item39; item.autoReuse = true; - item.height = 20; + item.height = 62; item.value = CalamityGlobalItem.Rarity16BuyPrice; item.Calamity().customRarity = CalamityRarity.HotPink; diff --git a/Items/Weapons/Melee/RoyalKnivesMelee.png b/Items/Weapons/Melee/RoyalKnivesMelee.png index 4d31893202..cfbcd39a66 100644 Binary files a/Items/Weapons/Melee/RoyalKnivesMelee.png and b/Items/Weapons/Melee/RoyalKnivesMelee.png differ diff --git a/Items/Weapons/Melee/Swordsplosion.cs b/Items/Weapons/Melee/Swordsplosion.cs index 54ba5db0bb..35d145944e 100644 --- a/Items/Weapons/Melee/Swordsplosion.cs +++ b/Items/Weapons/Melee/Swordsplosion.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = 88; - item.damage = 60; + item.damage = 48; item.melee = true; item.useAnimation = 30; item.useTime = 30; @@ -34,7 +34,6 @@ namespace CalamityMod.Items.Weapons.Melee item.rare = ItemRarityID.Purple; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 16f; - item.Calamity().challengeDrop = true; } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) diff --git a/Items/Weapons/Melee/TeardropCleaver.cs b/Items/Weapons/Melee/TeardropCleaver.cs index 10d49af2b4..2fc64c639b 100644 --- a/Items/Weapons/Melee/TeardropCleaver.cs +++ b/Items/Weapons/Melee/TeardropCleaver.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = 56; - item.damage = 30; + item.damage = 24; item.melee = true; item.useAnimation = 24; item.useStyle = ItemUseStyleID.SwingThrow; @@ -28,7 +28,6 @@ namespace CalamityMod.Items.Weapons.Melee item.height = 66; item.value = Item.buyPrice(0, 2, 0, 0); item.rare = ItemRarityID.Green; - item.Calamity().challengeDrop = true; } public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) diff --git a/Items/Weapons/Ranged/AMR.cs b/Items/Weapons/Ranged/AMR.cs index 4a4a709eec..ae124fa936 100644 --- a/Items/Weapons/Ranged/AMR.cs +++ b/Items/Weapons/Ranged/AMR.cs @@ -21,8 +21,8 @@ namespace CalamityMod.Items.Weapons.Ranged { item.damage = 3240; item.ranged = true; - item.width = 76; - item.height = 30; + item.width = 140; + item.height = 36; item.useTime = 60; item.useAnimation = 60; item.useStyle = ItemUseStyleID.HoldingOut; diff --git a/Items/Weapons/Ranged/AMR.png b/Items/Weapons/Ranged/AMR.png index d640a68464..a4a73a4a21 100644 Binary files a/Items/Weapons/Ranged/AMR.png and b/Items/Weapons/Ranged/AMR.png differ diff --git a/Items/Weapons/Ranged/Aeries.cs b/Items/Weapons/Ranged/Aeries.cs deleted file mode 100644 index 320286b261..0000000000 --- a/Items/Weapons/Ranged/Aeries.cs +++ /dev/null @@ -1,64 +0,0 @@ -using CalamityMod.Projectiles.Ranged; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.Ranged -{ - public class Aeries : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Aeries"); - Tooltip.SetDefault("Converts musket balls into shockblast rounds that steal enemy life"); - } - - public override void SetDefaults() - { - item.damage = 35; - item.ranged = true; - item.width = 56; - item.height = 30; - item.useTime = 10; - item.useAnimation = 10; - item.useStyle = ItemUseStyleID.HoldingOut; - item.noMelee = true; - item.knockBack = 5.5f; - item.value = Item.buyPrice(0, 80, 0, 0); - item.rare = ItemRarityID.Yellow; - item.UseSound = SoundID.Item41; - item.autoReuse = true; - item.shootSpeed = 12f; - item.shoot = ModContent.ProjectileType(); - item.useAmmo = AmmoID.Bullet; - item.Calamity().canFirePointBlankShots = true; - } - - public override Vector2? HoldoutOffset() - { - return new Vector2(-5, 0); - } - - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - if (type == ProjectileID.Bullet) - Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType(), damage, knockBack, player.whoAmI); - else - Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); - - return false; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ItemID.SpectreBar, 5); - recipe.AddIngredient(ItemID.ShroomiteBar, 5); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } -} diff --git a/Items/Weapons/Ranged/Aeries.png b/Items/Weapons/Ranged/Aeries.png deleted file mode 100644 index 1d1d592af0..0000000000 Binary files a/Items/Weapons/Ranged/Aeries.png and /dev/null differ diff --git a/Items/Weapons/Ranged/Alluvion.cs b/Items/Weapons/Ranged/Alluvion.cs index 4d55801a60..f6807a8172 100644 --- a/Items/Weapons/Ranged/Alluvion.cs +++ b/Items/Weapons/Ranged/Alluvion.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.noMelee = true; item.knockBack = 4f; item.value = Item.buyPrice(1, 80, 0, 0); - item.rare = ItemRarityID.Red; + item.rare = ItemRarityID.Purple; item.UseSound = SoundID.Item5; item.autoReuse = true; item.shoot = ProjectileID.WoodenArrowFriendly; diff --git a/Items/Weapons/Ranged/Arbalest.cs b/Items/Weapons/Ranged/Arbalest.cs index 39150ef06c..b31ca1afd7 100644 --- a/Items/Weapons/Ranged/Arbalest.cs +++ b/Items/Weapons/Ranged/Arbalest.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 36; + item.damage = 29; item.ranged = true; item.width = 82; item.height = 34; @@ -37,7 +37,6 @@ namespace CalamityMod.Items.Weapons.Ranged item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 12f; item.useAmmo = AmmoID.Arrow; - item.Calamity().challengeDrop = true; item.Calamity().canFirePointBlankShots = true; } diff --git a/Items/Weapons/Ranged/BlossomFlux.cs b/Items/Weapons/Ranged/BlossomFlux.cs index 6067fa792a..22bdc2550e 100644 --- a/Items/Weapons/Ranged/BlossomFlux.cs +++ b/Items/Weapons/Ranged/BlossomFlux.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 25; + item.damage = 20; item.ranged = true; item.width = 38; item.height = 68; @@ -34,7 +34,6 @@ namespace CalamityMod.Items.Weapons.Ranged item.value = CalamityGlobalItem.Rarity7BuyPrice; item.rare = ItemRarityID.Lime; - item.Calamity().challengeDrop = true; item.Calamity().canFirePointBlankShots = true; } diff --git a/Items/Weapons/Ranged/ClockworkBow.cs b/Items/Weapons/Ranged/ClockworkBow.cs index 5d12035a67..5e94eda5e5 100644 --- a/Items/Weapons/Ranged/ClockworkBow.cs +++ b/Items/Weapons/Ranged/ClockworkBow.cs @@ -1,12 +1,7 @@ using Microsoft.Xna.Framework; -using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Terraria.Graphics.Effects; -using System.Collections.Generic; -using Terraria.Graphics.Shaders; -using Microsoft.Xna.Framework.Graphics; using CalamityMod.Projectiles.Ranged; namespace CalamityMod.Items.Weapons.Ranged @@ -23,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 850; + item.damage = 808; item.ranged = true; item.width = 48; item.height = 96; diff --git a/Items/Weapons/Ranged/ConferenceCall.cs b/Items/Weapons/Ranged/ConferenceCall.cs deleted file mode 100644 index fbe8e1ec2f..0000000000 --- a/Items/Weapons/Ranged/ConferenceCall.cs +++ /dev/null @@ -1,115 +0,0 @@ -using Microsoft.Xna.Framework; -using System; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.Ranged -{ - public class ConferenceCall : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Conclave Crossfire"); - Tooltip.SetDefault("50% chance to not consume ammo\n" + - "Fires two spreads of bullets, one from the gun and one from the sky"); - } - - public override void SetDefaults() - { - item.damage = 35; - item.ranged = true; - item.width = 66; - item.height = 26; - item.useTime = 26; - item.useAnimation = 26; - item.useStyle = ItemUseStyleID.HoldingOut; - item.noMelee = true; - item.knockBack = 4.5f; - item.value = Item.buyPrice(0, 80, 0, 0); - item.rare = ItemRarityID.Yellow; - item.UseSound = SoundID.Item38; - item.autoReuse = true; - item.shootSpeed = 12f; - item.shoot = ProjectileID.PurificationPowder; - item.useAmmo = AmmoID.Bullet; - } - - public override Vector2? HoldoutOffset() - { - return new Vector2(-10, 0); - } - - public override bool ConsumeAmmo(Player player) - { - if (Main.rand.Next(0, 100) < 50) - return false; - return true; - } - - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - int num6 = Main.rand.Next(4, 6); - for (int index = 0; index < num6; ++index) - { - float SpeedX = speedX + (float)Main.rand.Next(-30, 31) * 0.05f; - float SpeedY = speedY + (float)Main.rand.Next(-30, 31) * 0.05f; - Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI); - } - float num72 = item.shootSpeed; - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (player.gravDir == -1f) - { - num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; - } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) - { - num78 = (float)player.direction; - num79 = 0f; - num80 = num72; - } - else - { - num80 = num72 / num80; - } - - for (int num108 = 0; num108 < num6; num108++) - { - vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); - vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201); - vector2.Y -= (float)(100 * num108); - num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (num79 < 0f) - { - num79 *= -1f; - } - if (num79 < 20f) - { - num79 = 20f; - } - num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - num80 = num72 / num80; - num78 *= num80; - num79 *= num80; - float speedX4 = num78 + (float)Main.rand.Next(-30, 31) * 0.02f; - float speedY5 = num79 + (float)Main.rand.Next(-30, 31) * 0.02f; - Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, type, damage, knockBack, player.whoAmI); - } - return false; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.TacticalShotgun); - recipe.AddIngredient(ItemID.FragmentVortex, 7); - recipe.AddTile(TileID.LunarCraftingStation); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } -} diff --git a/Items/Weapons/Ranged/ConferenceCall.png b/Items/Weapons/Ranged/ConferenceCall.png deleted file mode 100644 index 9e1e6c5032..0000000000 Binary files a/Items/Weapons/Ranged/ConferenceCall.png and /dev/null differ diff --git a/Items/Weapons/Ranged/DodusHandcannon.cs b/Items/Weapons/Ranged/DodusHandcannon.cs index 488888343d..bfd6545b47 100644 --- a/Items/Weapons/Ranged/DodusHandcannon.cs +++ b/Items/Weapons/Ranged/DodusHandcannon.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddIngredient(ItemID.LunarBar, 15); recipe.AddTile(TileID.LunarCraftingStation); diff --git a/Items/Weapons/Ranged/FetidEmesis.cs b/Items/Weapons/Ranged/FetidEmesis.cs index c504882bee..acdd07c794 100644 --- a/Items/Weapons/Ranged/FetidEmesis.cs +++ b/Items/Weapons/Ranged/FetidEmesis.cs @@ -11,7 +11,8 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetStaticDefaults() { DisplayName.SetDefault("Fetid Emesis"); - Tooltip.SetDefault("Has a chance to release rotten chunks instead of bullets"); + Tooltip.SetDefault("40% chance to not consume ammo\n" + + "Has a chance to release rotten chunks instead of bullets"); } public override void SetDefaults() @@ -35,6 +36,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.Calamity().canFirePointBlankShots = true; } + public override bool ConsumeAmmo(Player player) => Main.rand.Next(100) > 40; + public override Vector2? HoldoutOffset() => new Vector2(-5, 0); public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) diff --git a/Items/Weapons/Ranged/HalleysInferno.png b/Items/Weapons/Ranged/HalleysInferno.png index 8888f3609e..90cb0e593a 100644 Binary files a/Items/Weapons/Ranged/HalleysInferno.png and b/Items/Weapons/Ranged/HalleysInferno.png differ diff --git a/Items/Weapons/Ranged/Hellborn.cs b/Items/Weapons/Ranged/Hellborn.cs index bb73630b3b..551649502f 100644 --- a/Items/Weapons/Ranged/Hellborn.cs +++ b/Items/Weapons/Ranged/Hellborn.cs @@ -19,12 +19,12 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 14; + item.damage = 7; item.ranged = true; item.width = 66; item.height = 34; - item.useTime = 10; - item.useAnimation = 10; + item.useTime = 15; + item.useAnimation = 15; item.useStyle = ItemUseStyleID.HoldingOut; item.knockBack = 2f; item.value = CalamityGlobalItem.Rarity5BuyPrice; @@ -34,7 +34,6 @@ namespace CalamityMod.Items.Weapons.Ranged item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 12f; item.useAmmo = AmmoID.Bullet; - item.Calamity().challengeDrop = true; item.Calamity().canFirePointBlankShots = true; } diff --git a/Items/Weapons/Ranged/Infinity.cs b/Items/Weapons/Ranged/Infinity.cs index 2a3cbd3923..10f957303b 100644 --- a/Items/Weapons/Ranged/Infinity.cs +++ b/Items/Weapons/Ranged/Infinity.cs @@ -1,4 +1,6 @@ +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Ranged; +using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -13,32 +15,31 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetStaticDefaults() { DisplayName.SetDefault("Infinity"); - Tooltip.SetDefault("Bad PC\n" + - "Fires a barrage of energy bolts that split and bounce\n" + + Tooltip.SetDefault("Fires a barrage of energy bolts that split and bounce\n" + "Right click to fire a barrage of normal bullets\n" + "They say infinity is neverending, yet you hold it in your hands"); } public override void SetDefaults() { - item.damage = 22; + item.damage = 45; item.ranged = true; item.width = 56; item.height = 24; item.useTime = 2; item.reuseDelay = 6; - item.useAnimation = 1800; + item.useAnimation = 18; item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 1f; - item.value = CalamityGlobalItem.Rarity10BuyPrice; - item.rare = ItemRarityID.Red; - item.UseSound = SoundID.Item31; + item.value = Item.buyPrice(1, 80, 0, 0); + item.rare = ItemRarityID.Purple; + item.Calamity().customRarity = CalamityRarity.DarkBlue; + item.UseSound = SoundID.Item31; item.autoReuse = true; item.shoot = ProjectileID.PurificationPowder; item.shootSpeed = 12f; item.useAmmo = AmmoID.Bullet; - item.Calamity().challengeDrop = true; item.Calamity().canFirePointBlankShots = true; } @@ -54,7 +55,6 @@ namespace CalamityMod.Items.Weapons.Ranged public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - if (player.altFunctionUse == 2) { //If you right click, shoots an helix of normal bullets @@ -111,5 +111,15 @@ namespace CalamityMod.Items.Weapons.Ranged return false; } } - } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddTile(ModContent.TileType()); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } diff --git a/Items/Weapons/Ranged/Interfacer.cs b/Items/Weapons/Ranged/Interfacer.cs index 3a792d3a08..aa5fa611b6 100644 --- a/Items/Weapons/Ranged/Interfacer.cs +++ b/Items/Weapons/Ranged/Interfacer.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetStaticDefaults() { DisplayName.SetDefault("Disseminator"); - Tooltip.SetDefault("50% chance to not consume ammo\n" + - "Fires a spread of bullets from the gun, above, and below"); + Tooltip.SetDefault("@everyone\n" + + "50% chance to not consume ammo"); } public override void SetDefaults() @@ -49,92 +49,107 @@ namespace CalamityMod.Items.Weapons.Ranged public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - //shotgun spread - int num6 = Main.rand.Next(4, 6); - for (int index = 0; index < num6; ++index) - { - float SpeedX = speedX + Main.rand.Next(-30, 31) * 0.05f; - float SpeedY = speedY + Main.rand.Next(-30, 31) * 0.05f; - int bullet = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 0.0f, 0.0f); - Main.projectile[bullet].extraUpdates += 1; - } - float num72 = item.shootSpeed; - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - float num78 = Main.mouseX + Main.screenPosition.X - vector2.X; - float num79 = Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (player.gravDir == -1f) - { - num79 = Main.screenPosition.Y + Main.screenHeight - Main.mouseY - vector2.Y; - } - float num80 = (float)Math.Sqrt(num78 * num78 + num79 * num79); - if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) - { - num78 = player.direction; - } - else - { - num80 = num72 / num80; - } + Vector2 velocity = new Vector2(speedX, speedY); + int bulletAmt = 4; + for (int index = 0; index < bulletAmt; ++index) + { + velocity.X += Main.rand.Next(-15, 16) * 0.05f; + velocity.Y += Main.rand.Next(-15, 16) * 0.05f; + int proj = Projectile.NewProjectile(position, velocity, type, damage, knockBack, player.whoAmI); + Main.projectile[proj].extraUpdates += 2; + } - //bullets from above - int num107 = Main.rand.Next(4, 6); - int bulletDamage = (int)(damage * 0.7f); - for (int num108 = 0; num108 < num107; num108++) - { - vector2 = new Vector2(player.position.X + player.width * 0.5f + (Main.rand.Next(51) * -(float)player.direction) + (Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); - vector2.X = (vector2.X + player.Center.X) / 2f + Main.rand.Next(-50, 51); - vector2.Y -= 100 * num108; - num78 = Main.mouseX + Main.screenPosition.X - vector2.X; - num79 = Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (num79 < 0f) - { - num79 *= -1f; - } - if (num79 < 20f) - { - num79 = 20f; - } - num80 = (float)Math.Sqrt(num78 * num78 + num79 * num79); - num80 = num72 / num80; - num78 *= num80; - num79 *= num80; - float speedX4 = num78 + Main.rand.Next(-30, 31) * 0.02f; - float speedY5 = num79 + Main.rand.Next(-30, 31) * 0.02f; - int bullet = Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, type, bulletDamage, knockBack, player.whoAmI, 0.0f, 0.0f); - Main.projectile[bullet].extraUpdates += 1; - Main.projectile[bullet].tileCollide = false; + int maxTargets = 8; + int[] targets = new int[maxTargets]; + int targetArrayIndex = 0; + Rectangle rectangle = new Rectangle((int)player.Center.X - 960, (int)player.Center.Y - 540, 1920, 1080); + for (int i = 0; i < Main.maxNPCs; i++) + { + NPC npc = Main.npc[i]; + if (npc.active && npc.chaseable && npc.lifeMax > 5 && !npc.dontTakeDamage && !npc.friendly && !npc.immortal) + { + if (npc.Hitbox.Intersects(rectangle)) + { + if (targetArrayIndex < maxTargets) + { + targets[targetArrayIndex] = i; + targetArrayIndex++; + } + else + break; + } + } + } - //bullets from below - vector2 = new Vector2(player.position.X + player.width * 0.5f + (Main.rand.Next(51) * -(float)player.direction) + (Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y + 600f); - vector2.X = (vector2.X + player.Center.X) / 2f + Main.rand.Next(-50, 51); - vector2.Y += 100 * num108; - num78 = Main.mouseX + Main.screenPosition.X - vector2.X; - num79 = Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (num79 < 0f) - { - num79 *= -1f; - } - if (num79 < 20f) - { - num79 = 20f; - } - num80 = (float)Math.Sqrt(num78 * num78 + num79 * num79); - num80 = num72 / num80; - num78 *= num80; - num79 *= num80; - float speedX6 = num78 + Main.rand.Next(-30, 31) * 0.02f; - float speedY7 = num79 + Main.rand.Next(-30, 31) * 0.02f; - int bullet2 = Projectile.NewProjectile(vector2.X, vector2.Y, speedX6, -speedY7, type, bulletDamage, knockBack, player.whoAmI, 0.0f, 0.0f); - Main.projectile[bullet2].extraUpdates += 1; - Main.projectile[bullet2].tileCollide = false; - } - return false; + if (targetArrayIndex == 0) + return false; + + Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); + int extraBulletDamage = (int)(damage * 0.7); + + for (int j = 0; j < targetArrayIndex; j++) + { + vector2 = new Vector2(player.position.X + player.width * 0.5f + (Main.rand.Next(201) * -(float)player.direction) + (Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); + vector2.X = (vector2.X + player.Center.X) / 2f + Main.rand.Next(-200, 201); + vector2.Y -= 100 * j; + + Vector2 velocity2 = Vector2.Normalize(Main.npc[targets[j]].Center - vector2) * item.shootSpeed; + + int proj = Projectile.NewProjectile(vector2, velocity2, type, extraBulletDamage, knockBack, player.whoAmI); + Main.projectile[proj].extraUpdates += 2; + Main.projectile[proj].tileCollide = false; + Main.projectile[proj].timeLeft /= 2; + + vector2 = new Vector2(player.position.X + player.width * 0.5f + (Main.rand.Next(201) * -(float)player.direction) + (Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y + 600f); + vector2.X = (vector2.X + player.Center.X) / 2f + Main.rand.Next(-200, 201); + vector2.Y += 100 * j; + + velocity2 = Vector2.Normalize(Main.npc[targets[j]].Center - vector2) * item.shootSpeed; + + proj = Projectile.NewProjectile(vector2, velocity2, type, extraBulletDamage, knockBack, player.whoAmI); + Main.projectile[proj].extraUpdates += 2; + Main.projectile[proj].tileCollide = false; + Main.projectile[proj].timeLeft /= 2; + } + + if (targetArrayIndex == 12) + return false; + + // Fire bullets at the same targets if 12 unique targets aren't found + for (int k = 0; k < maxTargets - targetArrayIndex; k++) + { + int randomTarget = Main.rand.Next(targetArrayIndex); + + vector2 = new Vector2(player.position.X + player.width * 0.5f + (Main.rand.Next(201) * -(float)player.direction) + (Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); + vector2.X = (vector2.X + player.Center.X) / 2f + Main.rand.Next(-200, 201); + vector2.Y -= 100 * randomTarget; + + Vector2 velocity2 = Vector2.Normalize(Main.npc[targets[randomTarget]].Center - vector2) * item.shootSpeed; + + int proj = Projectile.NewProjectile(vector2, velocity2, type, extraBulletDamage, knockBack, player.whoAmI); + Main.projectile[proj].extraUpdates += 2; + Main.projectile[proj].tileCollide = false; + Main.projectile[proj].timeLeft /= 2; + + vector2 = new Vector2(player.position.X + player.width * 0.5f + (Main.rand.Next(201) * -(float)player.direction) + (Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y + 600f); + vector2.X = (vector2.X + player.Center.X) / 2f + Main.rand.Next(-200, 201); + vector2.Y += 100 * randomTarget; + + velocity2 = Vector2.Normalize(Main.npc[targets[randomTarget]].Center - vector2) * item.shootSpeed; + + proj = Projectile.NewProjectile(vector2, velocity2, type, extraBulletDamage, knockBack, player.whoAmI); + Main.projectile[proj].extraUpdates += 2; + Main.projectile[proj].tileCollide = false; + Main.projectile[proj].timeLeft /= 2; + } + + return false; } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ItemID.LunarBar, 5); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); diff --git a/Items/Weapons/Ranged/LeadWizard.cs b/Items/Weapons/Ranged/LeadWizard.cs deleted file mode 100644 index 9b22bf7de4..0000000000 --- a/Items/Weapons/Ranged/LeadWizard.cs +++ /dev/null @@ -1,63 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.Ranged -{ - public class LeadWizard : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Lead Wizard"); - Tooltip.SetDefault("Something's not right...\n" + - "33% chance to not consume ammo"); - } - - public override void SetDefaults() - { - item.damage = 58; - item.ranged = true; - item.width = 66; - item.height = 34; - item.useTime = 3; - item.reuseDelay = 12; - item.useAnimation = 9; - item.useStyle = ItemUseStyleID.HoldingOut; - item.noMelee = true; - item.knockBack = 5f; - item.value = CalamityGlobalItem.Rarity8BuyPrice; - item.rare = ItemRarityID.Yellow; - item.UseSound = SoundID.Item31; - item.autoReuse = true; - item.shoot = ProjectileID.BulletHighVelocity; - item.shootSpeed = 20f; - item.useAmmo = AmmoID.Bullet; - item.Calamity().challengeDrop = true; - item.Calamity().canFirePointBlankShots = true; - } - - // Terraria seems to really dislike high crit values in SetDefaults - public override void GetWeaponCrit(Player player, ref int crit) => crit += 30; - - public override Vector2? HoldoutOffset() => new Vector2(-5, 0); - - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - float rotation = MathHelper.ToRadians(6); - for (int i = 0; i < 2; i++) - { - Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedBy(MathHelper.Lerp(-rotation, rotation, i == 1 ? 0 : 2)); - Projectile.NewProjectile(position, perturbedSpeed, ProjectileID.BulletHighVelocity, damage, knockBack, player.whoAmI, 0f, 0f); - } - return false; - } - - public override bool ConsumeAmmo(Player player) - { - if (Main.rand.Next(0, 100) < 33) - return false; - return true; - } - } -} diff --git a/Items/Weapons/Ranged/LeadWizard.png b/Items/Weapons/Ranged/LeadWizard.png deleted file mode 100644 index e753f54061..0000000000 Binary files a/Items/Weapons/Ranged/LeadWizard.png and /dev/null differ diff --git a/Items/Weapons/Ranged/Norfleet.cs b/Items/Weapons/Ranged/Norfleet.cs index d92e8e0475..284b4ccc8c 100644 --- a/Items/Weapons/Ranged/Norfleet.cs +++ b/Items/Weapons/Ranged/Norfleet.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 442; + item.damage = 354; item.knockBack = 15f; item.shootSpeed = 30f; item.useStyle = ItemUseStyleID.HoldingOut; @@ -37,7 +37,6 @@ namespace CalamityMod.Items.Weapons.Ranged item.useTurn = false; item.useAmmo = AmmoID.FallenStar; item.autoReuse = true; - item.Calamity().challengeDrop = true; } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; diff --git a/Items/Weapons/Ranged/OnyxChainBlaster.cs b/Items/Weapons/Ranged/OnyxChainBlaster.cs index 2f36a63b0e..401fae9275 100644 --- a/Items/Weapons/Ranged/OnyxChainBlaster.cs +++ b/Items/Weapons/Ranged/OnyxChainBlaster.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 51; + item.damage = 40; item.ranged = true; item.width = 64; item.height = 32; diff --git a/Items/Weapons/Ranged/PearlGod.cs b/Items/Weapons/Ranged/PearlGod.cs index 3450057d44..80ec75b10f 100644 --- a/Items/Weapons/Ranged/PearlGod.cs +++ b/Items/Weapons/Ranged/PearlGod.cs @@ -22,24 +22,22 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 125; + item.damage = 32; item.ranged = true; item.width = 80; item.height = 46; - item.useTime = 12; - item.useAnimation = 12; + item.useTime = 20; + item.useAnimation = 20; item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 3f; - item.value = CalamityGlobalItem.Rarity13BuyPrice; - item.Calamity().customRarity = CalamityRarity.PureGreen; - item.rare = ItemRarityID.Purple; + item.value = CalamityGlobalItem.Rarity8BuyPrice; + item.rare = ItemRarityID.Yellow; item.UseSound = SoundID.Item41; item.autoReuse = true; item.shootSpeed = 12f; item.shoot = ModContent.ProjectileType(); item.useAmmo = AmmoID.Bullet; - item.Calamity().challengeDrop = true; item.Calamity().canFirePointBlankShots = true; } @@ -102,5 +100,16 @@ namespace CalamityMod.Items.Weapons.Ranged return false; } - } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ItemID.SpectreBar, 5); + recipe.AddIngredient(ItemID.ShroomiteBar, 5); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } diff --git a/Items/Weapons/Ranged/PrideHuntersPlanarRipper.cs b/Items/Weapons/Ranged/PrideHuntersPlanarRipper.cs index abbdea2d0c..5ce6a6ca45 100644 --- a/Items/Weapons/Ranged/PrideHuntersPlanarRipper.cs +++ b/Items/Weapons/Ranged/PrideHuntersPlanarRipper.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Items.Weapons.Ranged ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ItemID.Uzi); - recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ItemID.LunarBar, 5); recipe.AddIngredient(ItemID.FragmentVortex, 10); recipe.AddIngredient(ModContent.ItemType(), 6); diff --git a/Items/Weapons/Ranged/PristineFury.cs b/Items/Weapons/Ranged/PristineFury.cs index a3c02a7a95..4436a3ec29 100644 --- a/Items/Weapons/Ranged/PristineFury.cs +++ b/Items/Weapons/Ranged/PristineFury.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Weapons.Ranged { public int frameCounter = 0; public int frame = 0; - public static int BaseDamage = 96; + public static int BaseDamage = 77; public override void SetStaticDefaults() { @@ -40,7 +40,6 @@ namespace CalamityMod.Items.Weapons.Ranged item.rare = ItemRarityID.Purple; item.value = CalamityGlobalItem.Rarity12BuyPrice; item.Calamity().customRarity = CalamityRarity.Turquoise; - item.Calamity().challengeDrop = true; } public override Vector2? HoldoutOffset() => new Vector2(-25, -10); diff --git a/Items/Weapons/Ranged/ProporsePistol.cs b/Items/Weapons/Ranged/ProporsePistol.cs index 9e492d98cc..1d48562392 100644 --- a/Items/Weapons/Ranged/ProporsePistol.cs +++ b/Items/Weapons/Ranged/ProporsePistol.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged { item.damage = 90; item.ranged = true; - item.width = 36; + item.width = 40; item.height = 20; item.useTime = 25; item.useAnimation = 25; diff --git a/Items/Weapons/Ranged/ProporsePistol.png b/Items/Weapons/Ranged/ProporsePistol.png index f9f6d2561a..51de3902ad 100644 Binary files a/Items/Weapons/Ranged/ProporsePistol.png and b/Items/Weapons/Ranged/ProporsePistol.png differ diff --git a/Items/Weapons/Ranged/Pumpler.cs b/Items/Weapons/Ranged/Pumpler.cs index aa15758f76..ea58353508 100644 --- a/Items/Weapons/Ranged/Pumpler.cs +++ b/Items/Weapons/Ranged/Pumpler.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 20; + item.damage = 27; item.ranged = true; item.width = 72; item.height = 34; diff --git a/Items/Weapons/Ranged/RubicoPrime.cs b/Items/Weapons/Ranged/RubicoPrime.cs index c1f0a1a8de..27a6db10f2 100644 --- a/Items/Weapons/Ranged/RubicoPrime.cs +++ b/Items/Weapons/Ranged/RubicoPrime.cs @@ -14,8 +14,7 @@ namespace CalamityMod.Items.Weapons.Ranged { DisplayName.SetDefault("Rubico Prime"); Tooltip.SetDefault("Semi-automatic sniper that fires in 5 second bursts\n" + - "Fires impact rounds that have an increased crit multiplier and deal bonus damage to inorganic targets"); - //would do less to organic targets if like this wasn't meant to be used against yharon lole + "Fires impact rounds that have an increased crit multiplier"); } public override void SetDefaults() diff --git a/Items/Weapons/Ranged/SeasSearing.cs b/Items/Weapons/Ranged/SeasSearing.cs index d9e74117d2..97d16daf6c 100644 --- a/Items/Weapons/Ranged/SeasSearing.cs +++ b/Items/Weapons/Ranged/SeasSearing.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Items.Weapons.Ranged { public class SeasSearing : ModItem { - public static int BaseDamage = 60; + public static int BaseDamage = 48; public override void SetStaticDefaults() { @@ -36,7 +36,6 @@ namespace CalamityMod.Items.Weapons.Ranged item.value = CalamityGlobalItem.Rarity5BuyPrice; item.rare = ItemRarityID.Pink; - item.Calamity().challengeDrop = true; } public override Vector2? HoldoutOffset() diff --git a/Items/Weapons/Ranged/Skullmasher.cs b/Items/Weapons/Ranged/Skullmasher.cs deleted file mode 100644 index bbf4b19e9e..0000000000 --- a/Items/Weapons/Ranged/Skullmasher.cs +++ /dev/null @@ -1,56 +0,0 @@ -using CalamityMod.Projectiles.Ranged; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -namespace CalamityMod.Items.Weapons.Ranged -{ - public class Skullmasher : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Skullmasher"); - Tooltip.SetDefault("Makes their brain hurt\n" + - "Fires a spread of 4 high velocity bullets that split into additional bullets upon hitting an enemy"); - } - - public override void SetDefaults() - { - item.damage = 1100; - item.ranged = true; - item.width = 142; - item.height = 40; - item.useTime = 60; - item.useAnimation = 60; - item.useStyle = ItemUseStyleID.HoldingOut; - item.noMelee = true; - item.knockBack = 2f; - item.value = CalamityGlobalItem.Rarity14BuyPrice; - item.rare = ItemRarityID.Purple; - item.Calamity().customRarity = CalamityRarity.DarkBlue; - item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/PlasmaBlast"); - item.autoReuse = true; - item.shoot = ProjectileID.PurificationPowder; - item.shootSpeed = 12f; - item.useAmmo = AmmoID.Bullet; - item.Calamity().challengeDrop = true; - } - - // Terraria seems to really dislike high crit values in SetDefaults - public override void GetWeaponCrit(Player player, ref int crit) => crit += 5; - - public override Vector2? HoldoutOffset() => new Vector2(-50, 0); //beeg gun - - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - for (int index = 0; index < 4; ++index) - { - float SpeedX = speedX + Main.rand.Next(-15, 16) * 0.05f; - float SpeedY = speedY + Main.rand.Next(-15, 16) * 0.05f; - Projectile.NewProjectile(position, new Vector2(SpeedX, SpeedY), ModContent.ProjectileType(), damage, knockBack, player.whoAmI, type, 1f); - } - - return false; - } - } -} diff --git a/Items/Weapons/Ranged/Skullmasher.png b/Items/Weapons/Ranged/Skullmasher.png deleted file mode 100644 index a5ccd98f68..0000000000 Binary files a/Items/Weapons/Ranged/Skullmasher.png and /dev/null differ diff --git a/Items/Weapons/Ranged/TrueConferenceCall.cs b/Items/Weapons/Ranged/TrueConferenceCall.cs index b183ce77ed..0b3338c34f 100644 --- a/Items/Weapons/Ranged/TrueConferenceCall.cs +++ b/Items/Weapons/Ranged/TrueConferenceCall.cs @@ -11,17 +11,18 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetStaticDefaults() { DisplayName.SetDefault("Conference Call"); - Tooltip.SetDefault("@everyone"); + Tooltip.SetDefault("@everyone\n" + + "50% chance to not consume ammo"); } public override void SetDefaults() { - item.damage = 40; + item.damage = 32; item.ranged = true; item.width = 66; item.height = 26; - item.useTime = 26; - item.useAnimation = 26; + item.useTime = 32; + item.useAnimation = 32; item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 4.5f; @@ -32,7 +33,6 @@ namespace CalamityMod.Items.Weapons.Ranged item.shootSpeed = 12f; item.shoot = ProjectileID.PurificationPowder; item.useAmmo = AmmoID.Bullet; - item.Calamity().challengeDrop = true; } public override Vector2? HoldoutOffset() @@ -40,10 +40,17 @@ namespace CalamityMod.Items.Weapons.Ranged return new Vector2(-10, 0); } - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + public override bool ConsumeAmmo(Player player) + { + if (Main.rand.Next(0, 100) < 50) + return false; + return true; + } + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Vector2 velocity = new Vector2(speedX, speedY); - int bulletAmt = 5; + int bulletAmt = 4; for (int index = 0; index < bulletAmt; ++index) { velocity.X += Main.rand.Next(-15, 16) * 0.05f; @@ -116,5 +123,15 @@ namespace CalamityMod.Items.Weapons.Ranged return false; } - } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.TacticalShotgun); + recipe.AddIngredient(ItemID.FragmentVortex, 7); + recipe.AddTile(TileID.LunarCraftingStation); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } diff --git a/Items/Weapons/Rogue/AlphaVirus.cs b/Items/Weapons/Rogue/AlphaVirus.cs index 163e5e6fa7..938a5f388f 100644 --- a/Items/Weapons/Rogue/AlphaVirus.cs +++ b/Items/Weapons/Rogue/AlphaVirus.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SetStaticDefaults() { DisplayName.SetDefault("Alpha Virus"); - Tooltip.SetDefault("Throws a giant plague cell with a lethal aura that splits into 6 plague seekers in death\n" + + Tooltip.SetDefault("Throws a giant plague cell with a lethal aura that splits into 6 plague seekers on death\n" + "Stealth strikes cause the plague cell to move slower, accumulating an aura of swirling plague seekers as it flies"); } diff --git a/Items/Weapons/Rogue/DuneHopper.cs b/Items/Weapons/Rogue/DuneHopper.cs index 56e7f373ca..b901ce4733 100644 --- a/Items/Weapons/Rogue/DuneHopper.cs +++ b/Items/Weapons/Rogue/DuneHopper.cs @@ -1,3 +1,5 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables; using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using System; @@ -11,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Rogue { public override void SetStaticDefaults() { - DisplayName.SetDefault("Dune Hopper"); + DisplayName.SetDefault("Wave Skipper"); // This will drop from the Sunken Sea Scourge miniboss once it's implemented. Tooltip.SetDefault(@"Throws a spear that bounces a lot Stealth strikes throw three high speed spears"); } @@ -19,7 +21,7 @@ Stealth strikes throw three high speed spears"); public override void SafeSetDefaults() { item.width = 44; - item.damage = 18; + item.damage = 50; item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 22; @@ -29,12 +31,11 @@ Stealth strikes throw three high speed spears"); item.UseSound = SoundID.Item1; item.autoReuse = true; item.height = 44; - item.value = CalamityGlobalItem.Rarity2BuyPrice; - item.rare = ItemRarityID.Green; + item.value = CalamityGlobalItem.Rarity5BuyPrice; + item.rare = ItemRarityID.Pink; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 12f; item.Calamity().rogue = true; - item.Calamity().challengeDrop = true; } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) @@ -54,5 +55,17 @@ Stealth strikes throw three high speed spears"); } return true; } - } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ModContent.ItemType(), 15); + recipe.AddIngredient(ModContent.ItemType(), 20); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } diff --git a/Items/Weapons/Rogue/GildedDagger.cs b/Items/Weapons/Rogue/GildedDagger.cs index e595f23e2a..dc9c1efa04 100644 --- a/Items/Weapons/Rogue/GildedDagger.cs +++ b/Items/Weapons/Rogue/GildedDagger.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SafeSetDefaults() { - item.width = 40; + item.width = 32; item.damage = 14; item.noMelee = true; item.noUseGraphic = true; @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.knockBack = 1f; item.UseSound = SoundID.Item1; item.autoReuse = true; - item.height = 36; + item.height = 26; item.maxStack = 1; item.value = CalamityGlobalItem.Rarity1BuyPrice; item.rare = ItemRarityID.Blue; diff --git a/Items/Weapons/Rogue/GildedDagger.png b/Items/Weapons/Rogue/GildedDagger.png index 825cade719..efebcc8f6a 100644 Binary files a/Items/Weapons/Rogue/GildedDagger.png and b/Items/Weapons/Rogue/GildedDagger.png differ diff --git a/Items/Weapons/Rogue/GleamingDagger.cs b/Items/Weapons/Rogue/GleamingDagger.cs index 62111e83dd..beea3e7562 100644 --- a/Items/Weapons/Rogue/GleamingDagger.cs +++ b/Items/Weapons/Rogue/GleamingDagger.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SafeSetDefaults() { - item.width = 40; + item.width = 32; item.damage = 14; item.noMelee = true; item.noUseGraphic = true; @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.knockBack = 1f; item.UseSound = SoundID.Item1; item.autoReuse = true; - item.height = 36; + item.height = 26; item.maxStack = 1; item.value = CalamityGlobalItem.Rarity1BuyPrice; item.rare = ItemRarityID.Blue; diff --git a/Items/Weapons/Rogue/GleamingDagger.png b/Items/Weapons/Rogue/GleamingDagger.png index 74fa7601a8..c4ae494649 100644 Binary files a/Items/Weapons/Rogue/GleamingDagger.png and b/Items/Weapons/Rogue/GleamingDagger.png differ diff --git a/Items/Weapons/Rogue/KelvinCatalyst.cs b/Items/Weapons/Rogue/KelvinCatalyst.cs index 7107e71c3a..c2ed5de6a2 100644 --- a/Items/Weapons/Rogue/KelvinCatalyst.cs +++ b/Items/Weapons/Rogue/KelvinCatalyst.cs @@ -36,7 +36,6 @@ namespace CalamityMod.Items.Weapons.Rogue item.height = 20; item.value = Item.buyPrice(gold: 36); item.rare = ItemRarityID.Pink; - item.expert = true; item.Calamity().donorItem = true; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 8f; diff --git a/Items/Weapons/Rogue/LeonidProgenitor.cs b/Items/Weapons/Rogue/LeonidProgenitor.cs index 7f1ed8ac65..feafeb2a4c 100644 --- a/Items/Weapons/Rogue/LeonidProgenitor.cs +++ b/Items/Weapons/Rogue/LeonidProgenitor.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SafeSetDefaults() { - item.damage = 80; + item.damage = 64; item.Calamity().rogue = true; item.knockBack = 3f; item.useTime = item.useAnimation = 15; @@ -39,7 +39,6 @@ namespace CalamityMod.Items.Weapons.Rogue item.value = CalamityGlobalItem.Rarity7BuyPrice; item.rare = ItemRarityID.Lime; - item.Calamity().challengeDrop = true; } public override bool AltFunctionUse(Player player) => true; diff --git a/Items/Weapons/Rogue/Malachite.cs b/Items/Weapons/Rogue/Malachite.cs index a45d0f2d37..801be7a072 100644 --- a/Items/Weapons/Rogue/Malachite.cs +++ b/Items/Weapons/Rogue/Malachite.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SafeSetDefaults() { item.width = 26; - item.damage = 62; + item.damage = 50; item.noMelee = true; item.noUseGraphic = true; item.useTime = item.useAnimation = 10; @@ -34,7 +34,6 @@ namespace CalamityMod.Items.Weapons.Rogue item.value = CalamityGlobalItem.Rarity8BuyPrice; item.rare = ItemRarityID.Yellow; - item.Calamity().challengeDrop = true; } public override bool AltFunctionUse(Player player) => true; diff --git a/Items/Weapons/Rogue/NightsGaze.png b/Items/Weapons/Rogue/NightsGaze.png index 6b12c7754c..ee8352affa 100644 Binary files a/Items/Weapons/Rogue/NightsGaze.png and b/Items/Weapons/Rogue/NightsGaze.png differ diff --git a/Items/Weapons/Rogue/Quasar.cs b/Items/Weapons/Rogue/Quasar.cs deleted file mode 100644 index b8ca4a1802..0000000000 --- a/Items/Weapons/Rogue/Quasar.cs +++ /dev/null @@ -1,50 +0,0 @@ -using CalamityMod.Projectiles.Rogue; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.Rogue -{ - public class Quasar : RogueWeapon - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Quasar"); - Tooltip.SetDefault("Succ\n" + - "Stealth strikes spawn more explosions"); - } - - public override void SafeSetDefaults() - { - item.width = 52; - item.damage = 80; //50 - item.noMelee = true; - item.noUseGraphic = true; - item.useAnimation = 12; - item.useStyle = ItemUseStyleID.SwingThrow; - item.useTime = 12; - item.knockBack = 0f; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.height = 48; - item.value = CalamityGlobalItem.Rarity9BuyPrice; - item.rare = ItemRarityID.Cyan; - item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 20f; - item.Calamity().rogue = true; - item.Calamity().challengeDrop = true; - } - - // Terraria seems to really dislike high crit values in SetDefaults - public override void GetWeaponCrit(Player player, ref int crit) => crit += 12; - - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - int knife = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI); - if (knife.WithinBounds(Main.maxProjectiles)) - Main.projectile[knife].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); - return false; - } - } -} diff --git a/Items/Weapons/Rogue/Quasar.png b/Items/Weapons/Rogue/Quasar.png deleted file mode 100644 index ff391ecb50..0000000000 Binary files a/Items/Weapons/Rogue/Quasar.png and /dev/null differ diff --git a/Items/Weapons/Rogue/RadiantStar.cs b/Items/Weapons/Rogue/RadiantStar.cs index 5f30eb0029..cdba3b3bae 100644 --- a/Items/Weapons/Rogue/RadiantStar.cs +++ b/Items/Weapons/Rogue/RadiantStar.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Rogue { DisplayName.SetDefault("Radiant Star"); Tooltip.SetDefault("Throws daggers that explode and split after a while\n" + - "Stealth strike splits more with a devastating explosion"); + "Stealth strike splits more with a devastating explosion and sucks enemies in"); } public override void SafeSetDefaults() diff --git a/Items/Weapons/Rogue/SearedPan.cs b/Items/Weapons/Rogue/SearedPan.cs index fa5be6dd48..353ebb821c 100644 --- a/Items/Weapons/Rogue/SearedPan.cs +++ b/Items/Weapons/Rogue/SearedPan.cs @@ -10,31 +10,32 @@ namespace CalamityMod.Items.Weapons.Rogue { public class SearedPan : RogueWeapon { - // Attacks must be within 48 frames of each other to count as "consecutive" hits + // Attacks must be within 40 frames of each other to count as "consecutive" hits // This is a little less than double the use time - public static int ConsecutiveHitOpening = 48; + public static int ConsecutiveHitOpening = 40; public override void SetStaticDefaults() { DisplayName.SetDefault("Seared Pan"); Tooltip.SetDefault("dAMaGe iS rAthEr cOnSisTeNT\n" + "Fires a frying pan at high velocity\n" + "Enemy hits summon fireballs that linger around the target\n" + - "Landing three consecutive hits grants full stealth\n" + - "Stealth strikes explode into golden sparks, and after hitting an enemy,\n" + - "they cause all fireballs to aggressively home in on their target"); + "Landing three consecutive hits grants will launch a golden pan\n" + + "Golden pans cause all fireballs to aggressively home in on their target\n" + + "Stealth strikes act similar to golden pans but also explode into golden sparks\n" + + "Stealth strikes also summon additional fireballs on hit"); } public override void SafeSetDefaults() { item.width = 60; item.height = 36; - item.damage = 666; + item.damage = 777; item.Calamity().rogue = true; item.knockBack = 10f; item.noMelee = true; item.noUseGraphic = true; item.useStyle = ItemUseStyleID.SwingThrow; - item.useTime = item.useAnimation = 28; + item.useTime = item.useAnimation = 25; item.reuseDelay = 1; item.UseSound = SoundID.Item1; item.autoReuse = true; @@ -47,11 +48,23 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - int pan = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); - if (player.Calamity().StealthStrikeAvailable() && pan.WithinBounds(Main.maxProjectiles)) + float mode = 1f; + if (player.Calamity().searedPanCounter >= 3) + { + player.Calamity().searedPanCounter = 0; + mode = 2f; + } + if (player.Calamity().StealthStrikeAvailable()) + { + player.Calamity().searedPanCounter = 0; + mode = 3f; + } + int pan = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, mode); + if (mode > 1f && pan.WithinBounds(Main.maxProjectiles)) { - Main.projectile[pan].Calamity().stealthStrike = true; Main.projectile[pan].extraUpdates++; + if (mode == 3f) + Main.projectile[pan].Calamity().stealthStrike = true; } return false; } diff --git a/Items/Weapons/Rogue/ShatteredSun.cs b/Items/Weapons/Rogue/ShatteredSun.cs index f9468493fa..cab1b57b14 100644 --- a/Items/Weapons/Rogue/ShatteredSun.cs +++ b/Items/Weapons/Rogue/ShatteredSun.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Rogue { DisplayName.SetDefault("Shattered Sun"); Tooltip.SetDefault("Throws daggers that split into scorching homing daggers\n" + - "Stealth strikes fire volleys of homing daggers from the player on dagger hits"); + "Stealth strikes fire volleys of homing daggers from the player on dagger hits that suck enemies in"); } public override void SafeSetDefaults() diff --git a/Items/Weapons/Rogue/SpearofDestiny.cs b/Items/Weapons/Rogue/SpearofDestiny.cs index 4112908626..c572e6967f 100644 --- a/Items/Weapons/Rogue/SpearofDestiny.cs +++ b/Items/Weapons/Rogue/SpearofDestiny.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SafeSetDefaults() { item.width = 52; - item.damage = 32; + item.damage = 26; item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 20; @@ -28,9 +28,8 @@ namespace CalamityMod.Items.Weapons.Rogue item.UseSound = SoundID.Item1; item.autoReuse = true; item.height = 52; - item.value = CalamityGlobalItem.Rarity5BuyPrice; - item.rare = ItemRarityID.Pink; - item.Calamity().challengeDrop = true; + item.value = CalamityGlobalItem.Rarity6BuyPrice; + item.rare = ItemRarityID.LightPurple; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 20f; item.Calamity().rogue = true; @@ -49,5 +48,16 @@ namespace CalamityMod.Items.Weapons.Rogue } return false; } - } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.HallowedBar, 7); + recipe.AddIngredient(ItemID.SoulofLight, 5); + recipe.AddIngredient(ItemID.SoulofFright, 5); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } diff --git a/Items/Weapons/Rogue/TheReaper.cs b/Items/Weapons/Rogue/TheReaper.cs index 01eaa0217d..05b31a534a 100644 --- a/Items/Weapons/Rogue/TheReaper.cs +++ b/Items/Weapons/Rogue/TheReaper.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SafeSetDefaults() { item.width = 106; - item.damage = 153; + item.damage = 122; item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 22; @@ -35,7 +35,6 @@ namespace CalamityMod.Items.Weapons.Rogue item.value = CalamityGlobalItem.Rarity13BuyPrice; item.Calamity().customRarity = CalamityRarity.PureGreen; item.rare = ItemRarityID.Purple; - item.Calamity().challengeDrop = true; } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) diff --git a/Items/Weapons/Summon/BelladonnaSpiritStaff.cs b/Items/Weapons/Summon/BelladonnaSpiritStaff.cs index 717ff7121d..cbcbbe8c80 100644 --- a/Items/Weapons/Summon/BelladonnaSpiritStaff.cs +++ b/Items/Weapons/Summon/BelladonnaSpiritStaff.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Summon item.damage = 5; item.mana = 10; item.width = 40; - item.height = 40; + item.height = 42; item.useTime = item.useAnimation = 35; item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; diff --git a/Items/Weapons/Summon/BelladonnaSpiritStaff.png b/Items/Weapons/Summon/BelladonnaSpiritStaff.png index 93ed75fad4..95ff1f0ba5 100644 Binary files a/Items/Weapons/Summon/BelladonnaSpiritStaff.png and b/Items/Weapons/Summon/BelladonnaSpiritStaff.png differ diff --git a/Items/Weapons/Summon/ColdDivinity.cs b/Items/Weapons/Summon/ColdDivinity.cs index d48e00f93e..4238719e4e 100644 --- a/Items/Weapons/Summon/ColdDivinity.cs +++ b/Items/Weapons/Summon/ColdDivinity.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetDefaults() { - item.damage = 60; + item.damage = 48; item.mana = 10; item.width = 52; item.height = 50; @@ -39,7 +39,6 @@ namespace CalamityMod.Items.Weapons.Summon item.value = CalamityGlobalItem.Rarity5BuyPrice; item.rare = ItemRarityID.Pink; - item.Calamity().challengeDrop = true; } public override void ModifyTooltips(List list) diff --git a/Items/Weapons/Summon/CryogenicStaff.cs b/Items/Weapons/Summon/CryogenicStaff.cs index ce9f23f9a3..0b2dec1526 100644 --- a/Items/Weapons/Summon/CryogenicStaff.cs +++ b/Items/Weapons/Summon/CryogenicStaff.cs @@ -21,8 +21,8 @@ Fire rate and range increase the longer it targets an enemy"); item.mana = 10; item.summon = true; item.sentry = true; - item.width = 40; - item.height = 40; + item.width = 82; + item.height = 84; item.useTime = item.useAnimation = 25; item.useStyle = ItemUseStyleID.SwingThrow; item.noMelee = true; diff --git a/Items/Weapons/Summon/CryogenicStaff.png b/Items/Weapons/Summon/CryogenicStaff.png index 931b640cb7..5d8055a244 100644 Binary files a/Items/Weapons/Summon/CryogenicStaff.png and b/Items/Weapons/Summon/CryogenicStaff.png differ diff --git a/Items/Weapons/Summon/LanternoftheSoul.cs b/Items/Weapons/Summon/LanternoftheSoul.cs index 75733953e4..f7ecb0b817 100644 --- a/Items/Weapons/Summon/LanternoftheSoul.cs +++ b/Items/Weapons/Summon/LanternoftheSoul.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetDefaults() { - item.damage = 235; + item.damage = 188; item.summon = true; item.sentry = true; item.mana = 10; @@ -32,7 +32,6 @@ namespace CalamityMod.Items.Weapons.Summon item.rare = ItemRarityID.Purple; item.autoReuse = true; item.shoot = ModContent.ProjectileType(); - item.Calamity().challengeDrop = true; item.UseSound = SoundID.Item44; } diff --git a/Items/Weapons/Summon/Sirius.png b/Items/Weapons/Summon/Sirius.png index 14125d49e9..7acb80d481 100644 Binary files a/Items/Weapons/Summon/Sirius.png and b/Items/Weapons/Summon/Sirius.png differ diff --git a/Items/Weapons/Typeless/EyeofMagnus.cs b/Items/Weapons/Typeless/EyeofMagnus.cs new file mode 100644 index 0000000000..f81d830b40 --- /dev/null +++ b/Items/Weapons/Typeless/EyeofMagnus.cs @@ -0,0 +1,64 @@ +using CalamityMod.Projectiles.Magic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; +using Terraria.ID; + +namespace CalamityMod.Items.Weapons.Typeless +{ + public class EyeofMagnus : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Eye of Magnus"); + Tooltip.SetDefault("Fires powerful beams that reduce enemy protection\n" + + "This weapon scales with all your damage stats at once\n" + + "Heals mana and health on hit"); + } + + public override void SetDefaults() + { + item.width = 80; + item.damage = 32; + item.rare = ItemRarityID.Cyan; + item.useAnimation = 20; + item.useTime = 20; + item.useStyle = ItemUseStyleID.HoldingOut; + item.knockBack = 5f; + item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LaserCannon"); + item.autoReuse = true; + item.noMelee = true; + item.height = 50; + item.value = CalamityGlobalItem.Rarity9BuyPrice; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 12f; + } + + public override Vector2? HoldoutOffset() + { + return new Vector2(-15, 0); + } + + // Eye of Magnus scales off of all damage types simultaneously (meaning it scales 5x from universal damage boosts). + public override void ModifyWeaponDamage(Player player, ref float add, ref float mult, ref float flat) + { + float formula = 5f * (player.allDamage - 1f); + formula += player.meleeDamage - 1f; + formula += player.rangedDamage - 1f; + formula += player.magicDamage - 1f; + formula += player.minionDamage - 1f; + formula += player.Calamity().throwingDamage - 1f; + add += formula; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ItemID.FragmentNebula, 10); + recipe.AddTile(TileID.LunarCraftingStation); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Weapons/Magic/EyeofMagnus.png b/Items/Weapons/Typeless/EyeofMagnus.png similarity index 100% rename from Items/Weapons/Magic/EyeofMagnus.png rename to Items/Weapons/Typeless/EyeofMagnus.png diff --git a/Items/Weapons/Typeless/FiniteUse/Bazooka.cs b/Items/Weapons/Typeless/FiniteUse/Bazooka.cs index 4bbda299a5..1e986c349d 100644 --- a/Items/Weapons/Typeless/FiniteUse/Bazooka.cs +++ b/Items/Weapons/Typeless/FiniteUse/Bazooka.cs @@ -14,7 +14,6 @@ namespace CalamityMod.Items.Weapons.Typeless.FiniteUse { DisplayName.SetDefault("Bazooka"); Tooltip.SetDefault("Uses Grenade Shells\n" + - "Does more damage to inorganic enemies\n" + "Can be used twice per boss battle"); } diff --git a/Items/Weapons/Typeless/FiniteUse/ElephantKiller.cs b/Items/Weapons/Typeless/FiniteUse/ElephantKiller.cs index d47312e777..78a44f2f5b 100644 --- a/Items/Weapons/Typeless/FiniteUse/ElephantKiller.cs +++ b/Items/Weapons/Typeless/FiniteUse/ElephantKiller.cs @@ -14,7 +14,6 @@ namespace CalamityMod.Items.Weapons.Typeless.FiniteUse { DisplayName.SetDefault("Elephant Killer"); Tooltip.SetDefault("Uses Magnum Rounds\n" + - "Does more damage to organic enemies\n" + "Can be used thrice per boss battle"); } diff --git a/Items/Weapons/Typeless/FiniteUse/Hydra.cs b/Items/Weapons/Typeless/FiniteUse/Hydra.cs index e628f1e0a6..7bcabd7b57 100644 --- a/Items/Weapons/Typeless/FiniteUse/Hydra.cs +++ b/Items/Weapons/Typeless/FiniteUse/Hydra.cs @@ -14,7 +14,6 @@ namespace CalamityMod.Items.Weapons.Typeless.FiniteUse { DisplayName.SetDefault("Hydra"); Tooltip.SetDefault("Uses Explosive Shotgun Shells\n" + - "Does more damage to everything\n" + "Can be used once per boss battle"); } diff --git a/Items/Weapons/Typeless/FiniteUse/LightningHawk.cs b/Items/Weapons/Typeless/FiniteUse/LightningHawk.cs index 02c8b6c4bf..c49ec871c9 100644 --- a/Items/Weapons/Typeless/FiniteUse/LightningHawk.cs +++ b/Items/Weapons/Typeless/FiniteUse/LightningHawk.cs @@ -14,7 +14,6 @@ namespace CalamityMod.Items.Weapons.Typeless.FiniteUse { DisplayName.SetDefault("Lightning Hawk"); Tooltip.SetDefault("Uses Magnum Rounds\n" + - "Does more damage to organic enemies\n" + "Can be used thrice per boss battle"); } diff --git a/Items/Weapons/Typeless/FiniteUse/Magnum.cs b/Items/Weapons/Typeless/FiniteUse/Magnum.cs index 40baee1e7e..60994af987 100644 --- a/Items/Weapons/Typeless/FiniteUse/Magnum.cs +++ b/Items/Weapons/Typeless/FiniteUse/Magnum.cs @@ -14,7 +14,6 @@ namespace CalamityMod.Items.Weapons.Typeless.FiniteUse { DisplayName.SetDefault("Magnum"); Tooltip.SetDefault("Uses Magnum Rounds\n" + - "Does more damage to organic enemies\n" + "Can be used thrice per boss battle"); } diff --git a/Items/Weapons/Typeless/LunicEye.cs b/Items/Weapons/Typeless/LunicEye.cs index 3eae5e7508..4c2beac1b9 100644 --- a/Items/Weapons/Typeless/LunicEye.cs +++ b/Items/Weapons/Typeless/LunicEye.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Typeless item.height = 50; item.value = Item.buyPrice(0, 36, 0, 0); item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 13f; + item.shootSpeed = 12f; } public override Vector2? HoldoutOffset() @@ -52,12 +52,6 @@ namespace CalamityMod.Items.Weapons.Typeless add += formula; } - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f); - return false; - } - public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Localization/CalamityLocalization.cs b/Localization/CalamityLocalization.cs index 7085ecb07c..7c1c184ed2 100644 --- a/Localization/CalamityLocalization.cs +++ b/Localization/CalamityLocalization.cs @@ -78,10 +78,7 @@ namespace CalamityMod.Localization new [] { "SCalDesparationText3Rematch", "I trust you will not make the same mistakes he did." }, new [] { "SCalDesparationText4Rematch", "I can’t imagine what your future holds now." }, - new [] { "SCalFunnyCheatText", "Go to hell." }, - new [] { "EdgyBossText", "Don't get cocky, kid!" }, - new [] { "EdgyBossText2", "You think... you can butcher... ME!?" }, new [] { "EdgyBossText3", "A fatal mistake!" }, new [] { "EdgyBossText4", "Good luck recovering from that!" }, new [] { "EdgyBossText5", "Delicious..." }, @@ -167,12 +164,6 @@ namespace CalamityMod.Localization new [] { "ArmageddonDodgeDisable", "All of your dodges are now disabled." }, new [] { "ArmageddonDodgeEnable", "All of your dodges are now re-enabled." }, - new [] { "DefiledText", "Your soul is mine..." }, - new [] { "DefiledText2", "Your soul is yours once more..." }, - - new [] { "IronHeartText", "Iron Heart is active, healing is disabled." }, - new [] { "IronHeartText2", "Iron Heart is not active, healing is restored." }, - new [] { "ChangingTheRules", "You cannot change the rules now." }, new [] { "FlameText", "The air is getting warmer around you." }, diff --git a/ModSupport/ModCalls.cs b/ModSupport/ModCalls.cs index b9fc8b6d16..8e6efcb85a 100644 --- a/ModSupport/ModCalls.cs +++ b/ModSupport/ModCalls.cs @@ -439,10 +439,6 @@ namespace CalamityMod case "armageddonmode": case "armageddon mode": return CalamityWorld.armageddon; - - case "ironheart": - case "iron heart": - return CalamityWorld.ironHeart; } } @@ -490,13 +486,6 @@ namespace CalamityMod case "armageddonmode": case "armageddon mode": return CalamityWorld.armageddon = enabled; - - case "ironheart": - case "iron heart": - case "steelsoul": - case "steel soul": - case "permadeath": - return CalamityWorld.ironHeart = enabled; } } #endregion @@ -1477,6 +1466,12 @@ namespace CalamityMod public static bool SetBossHealthBarVisible(bool visible) => Main.LocalPlayer.Calamity().drawBossHPBar = visible; #endregion + #region Dodge Disabling + public static bool AreDodgesDisabled() => Main.LocalPlayer.Calamity().disableAllDodges; + + public static bool DisableAllDodges(bool disable) => Main.LocalPlayer.Calamity().disableAllDodges = disable; + #endregion + #region Item Rarity public static int GetCalamityRarity(Item item) { @@ -1813,6 +1808,18 @@ namespace CalamityMod return new ArgumentNullException("ERROR: Must specify a bool."); return SetBossHealthBarVisible(bossBarEnabled); + case "NoDodges": + case "DodgesDisabled": + case "GetDodgesDisabled": + return AreDodgesDisabled(); + + case "DisableDodges": + case "DisableAllDodges": + case "SetDodgesDisabled": + if (args.Length < 2 || !(args[1] is bool disableDodges)) + return new ArgumentNullException("ERROR: Must specify a bool."); + return DisableAllDodges(disableDodges); + case "GetRarity": case "GetItemRarity": case "GetCalamityRarity": diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 03982d1da0..e8c05a499a 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -29,8 +29,8 @@ using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Items.Weapons.Summon; using CalamityMod.Items.Weapons.Typeless; -using CalamityMod.NPCs.Abyss; using CalamityMod.NPCs.AcidRain; +using CalamityMod.NPCs.AdultEidolonWyrm; using CalamityMod.NPCs.AquaticScourge; using CalamityMod.NPCs.AstrumAureus; using CalamityMod.NPCs.AstrumDeus; @@ -256,7 +256,7 @@ namespace CalamityMod BossDifficulty.TryGetValue("DesertScourge", out float order); List segments = new List() { NPCType(), NPCType(), NPCType() }; int summon = ItemType(); - List loot = new List() { ItemType(), ItemID.SandBlock, ItemType(), ItemID.Coral, ItemID.Seashell, ItemID.Starfish, ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.LesserHealingPotion }; + List loot = new List() { ItemType(), ItemID.SandBlock, ItemType(), ItemID.Coral, ItemID.Seashell, ItemID.Starfish, ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.LesserHealingPotion }; List collection = new List() { ItemType(), ItemType(), ItemType() }; string instructions = $"Use a [i:{summon}] in the Desert Biome"; string despawn = CalamityUtils.ColorMessage("The scourge of the desert delved back into the sand.", new Color(0xEE, 0xE8, 0xAA)); @@ -279,7 +279,7 @@ namespace CalamityMod BossDifficulty.TryGetValue("Crabulon", out float order); int type = NPCType(); int summon = ItemType(); - List loot = new List() { ItemType(), ItemID.GlowingMushroom, ItemID.MushroomGrassSeeds, ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.LesserHealingPotion }; + List loot = new List() { ItemType(), ItemID.GlowingMushroom, ItemID.MushroomGrassSeeds, ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.LesserHealingPotion }; List collection = new List() { ItemType(), ItemType(), ItemType() }; string instructions = $"Use a [i:{summon}] in the Mushroom Biome"; string despawn = CalamityUtils.ColorMessage("The mycleium crab has lost interest.", new Color(0x64, 0x95, 0xED)); @@ -291,7 +291,7 @@ namespace CalamityMod BossDifficulty.TryGetValue("HiveMind", out float order); int type = NPCType(); int summon = ItemType(); - List loot = new List() { ItemType(), ItemType(), ItemID.DemoniteBar, ItemID.RottenChunk, ItemID.CorruptSeeds, ItemID.CursedFlame, ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.LesserHealingPotion }; + List loot = new List() { ItemType(), ItemType(), ItemID.DemoniteBar, ItemID.RottenChunk, ItemID.CorruptSeeds, ItemID.CursedFlame, ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.LesserHealingPotion }; List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType() }; string instructions = $"Kill a Cyst in the Corruption or use a [i:{summon}] in the Corruption"; string despawn = CalamityUtils.ColorMessage("The corrupted colony began searching for a new breeding ground.", new Color(0x94, 0x00, 0xD3)); @@ -303,7 +303,7 @@ namespace CalamityMod BossDifficulty.TryGetValue("Perforators", out float order); int type = NPCType(); int summon = ItemType(); - List loot = new List() { ItemType(), ItemType(), ItemID.CrimtaneBar, ItemID.Vertebrae, ItemID.CrimsonSeeds, ItemID.Ichor, ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.LesserHealingPotion }; + List loot = new List() { ItemType(), ItemType(), ItemID.CrimtaneBar, ItemID.Vertebrae, ItemID.CrimsonSeeds, ItemID.Ichor, ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.LesserHealingPotion }; List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType() }; string instructions = $"Kill a Cyst in the Crimson or use a [i:{summon}] in the Crimson"; string despawn = CalamityUtils.ColorMessage("The parasitic hive began searching for a new host.", new Color(0xDC, 0x14, 0x3C)); @@ -327,7 +327,7 @@ namespace CalamityMod BossDifficulty.TryGetValue("Cryogen", out float order); int type = NPCType(); int summon = ItemType(); - List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.FrozenKey, ItemID.GreaterHealingPotion }; + List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.FrozenKey, ItemID.GreaterHealingPotion }; List collection = new List() { ItemType(), ItemType(), ItemType() }; string instructions = $"Use a [i:{summon}] in the Snow Biome"; string despawn = CalamityUtils.ColorMessage("Cryogen drifts away, carried on a freezing wind.", new Color(0x00, 0xFF, 0xFF)); @@ -443,7 +443,7 @@ namespace CalamityMod int summon2 = ItemType(); int altar = ItemType(); List summons = new List() { summon1, summon2 }; - List loot = new List() { ItemType(), ItemType(), ItemID.FallenStar, ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.FragmentSolar, ItemID.FragmentVortex, ItemID.FragmentNebula, ItemID.FragmentStardust, ItemID.GreaterHealingPotion }; + List loot = new List() { ItemType(), ItemType(), ItemID.FallenStar, ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.FragmentSolar, ItemID.FragmentVortex, ItemID.FragmentNebula, ItemID.FragmentStardust, ItemID.GreaterHealingPotion }; List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; string instructions = $"Use a [i:{summon1}] or [i:{summon2}] as offering at an [i:{altar}]"; string despawn = CalamityUtils.ColorMessage("The infected deity retreats to the heavens.", new Color(0xFF, 0xD7, 0x00)); @@ -456,7 +456,7 @@ namespace CalamityMod BossDifficulty.TryGetValue("ProfanedGuardians", out float order); int type = NPCType(); int summon = ItemType(); - List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemID.SuperHealingPotion }; + List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.SuperHealingPotion }; List collection = new List() { ItemType(), ItemType(), ItemType() }; string instructions = $"Use a [i:{summon}] in the Hallow or Underworld Biomes"; string despawn = CalamityUtils.ColorMessage("The guardians must protect their goddess at all costs.", new Color(0xFF, 0xA5, 0x00)); @@ -481,7 +481,7 @@ namespace CalamityMod BossDifficulty.TryGetValue("Providence", out float order); int type = NPCType(); int summon = ItemType(); - List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; + List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; List collection = new List() { ItemType(), ItemType(), ItemType() }; string instructions = $"Use [i:{summon}] in the Hallow or Underworld Biomes"; string despawn = CalamityUtils.ColorMessage("The Profaned Goddess vanishes in a burning blaze.", new Color(0xFF, 0xA5, 0x00)); @@ -494,7 +494,7 @@ namespace CalamityMod BossDifficulty.TryGetValue("CeaselessVoid", out float order); List bosses = new List() { NPCType(), NPCType() }; int summon = ItemType(); - List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; + List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; string instructions = $"Use a [i:{summon}] in the Dungeon"; string despawn = CalamityUtils.ColorMessage("The rift in time and space has moved away from your reach.", new Color(0x4B, 0x00, 0x82)); @@ -519,7 +519,7 @@ namespace CalamityMod BossDifficulty.TryGetValue("Signus", out float order); int type = NPCType(); int summon = ItemType(); - List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; + List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; string instructions = $"Use a [i:{summon}] in the Underworld"; string despawn = CalamityUtils.ColorMessage("The Devourer's assassin has finished its easy task.", new Color(0xBA, 0x55, 0xD3)); @@ -531,7 +531,7 @@ namespace CalamityMod BossDifficulty.TryGetValue("Polterghast", out float order); List bosses = new List() { NPCType(), NPCType() }; int summon = ItemType(); - List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; + List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; List collection = new List() { ItemType(), ItemType(), ItemType() }; string instructions = $"Kill 30 phantom spirits or use a [i:{summon}] in the Dungeon"; string despawn = CalamityUtils.ColorMessage("The volatile spirits disperse throughout the depths of the dungeon.", new Color(0xB0, 0xE0, 0xE6)); @@ -555,7 +555,7 @@ namespace CalamityMod BossDifficulty.TryGetValue("DevourerOfGods", out float order); int type = NPCType(); int summon = ItemType(); - List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; + List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; string instructions = $"Use a [i:{summon}]"; string despawn = CalamityUtils.ColorMessage("The Devourer of Gods has slain everyone and feasted on their essence.", new Color(0x00, 0xFF, 0xFF)); @@ -569,7 +569,7 @@ namespace CalamityMod BossDifficulty.TryGetValue("Yharon", out float order); int type = NPCType(); int summon = ItemType(); - List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), /*ItemType(), */ItemType() }; + List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), /*ItemType(), */ItemType() }; List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; string instructions = $"Use a [i:{summon}] in the Jungle Biome"; string despawn = CalamityUtils.ColorMessage("Yharon found you too weak to stay near your gravestone.", new Color(0xFF, 0xA5, 0x00)); @@ -617,7 +617,7 @@ namespace CalamityMod List collection = new List() { }; string instructions = $"While in the Abyss, use an item that inflicts Chaos State"; string despawn = CalamityUtils.ColorMessage("...", new Color(0x7F, 0xFF, 0xD4)); - string bossLogTex = "CalamityMod/NPCs/Abyss/AdultEidolonWyrm_BossChecklist"; + string bossLogTex = "CalamityMod/NPCs/AdultEidolonWyrm/AdultEidolonWyrm_BossChecklist"; AddBoss(bossChecklist, calamity, "Adult Eidolon Wyrm", order, type, DownedAdultEidolonWyrm, summon, loot, collection, instructions, despawn, bossLogTex); } } @@ -678,7 +678,7 @@ namespace CalamityMod // Eye of Cthulhu AddLoot(bossChecklist, "EyeofCthulhu", - new List() { ItemType(), ItemType(), ItemType() }, + new List() { ItemType(), ItemType() }, new List() { ItemType() } ); @@ -702,13 +702,13 @@ namespace CalamityMod // Skeletron AddLoot(bossChecklist, "SkeletronHead", - new List() { ItemType() }, + null, new List() { ItemType() } ); // Wall of Flesh AddLoot(bossChecklist, "WallofFlesh", - new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.CorruptionKey, ItemID.CrimsonKey }, + new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemID.CorruptionKey, ItemID.CrimsonKey }, new List() { ItemType(), ItemType(), ItemType() } ); @@ -726,20 +726,20 @@ namespace CalamityMod // Skeletron Prime AddLoot(bossChecklist, "SkeletronPrime", - new List() { ItemType(), ItemType() }, + null, new List() { ItemType(), ItemType() } ); // Plantera AddLoot(bossChecklist, "Plantera", - new List() { ItemType(), ItemType(), ItemType(), ItemID.JungleKey, ItemType() }, + new List() { ItemType(), ItemType(), ItemType(), ItemID.JungleKey }, new List() { ItemType() } ); AddSummons(bossChecklist, "Plantera", new List() { ItemType() }); // Golem AddLoot(bossChecklist, "Golem", - new List() { ItemType(), ItemType(), ItemType() }, + new List() { ItemType(), ItemType() }, new List() { ItemType() } ); AddSummons(bossChecklist, "Golem", new List() { ItemType() }); @@ -758,14 +758,14 @@ namespace CalamityMod // Lunatic Cultist AddLoot(bossChecklist, "CultistBoss", - new List() { ItemType(), ItemType() }, + null, new List() { ItemType(), ItemType() } ); AddSummons(bossChecklist, "CultistBoss", new List() { ItemType() }); // Moon Lord AddLoot(bossChecklist, "MoonLord", - new List() { ItemType(), ItemType(), ItemType(), ItemType() }, + new List() { ItemType(), ItemType() }, new List() { ItemType() } ); } diff --git a/NPCs/Abyss/Bloatfish.cs b/NPCs/Abyss/Bloatfish.cs index 6bb196dfab..f0e0d15487 100644 --- a/NPCs/Abyss/Bloatfish.cs +++ b/NPCs/Abyss/Bloatfish.cs @@ -193,8 +193,9 @@ namespace CalamityMod.NPCs.Abyss public override void NPCLoot() { DropHelper.DropItem(npc, ModContent.ItemType(), 10, 20); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas, 2, 5, 7); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas && Main.expertMode, 2, 2, 3); + int minCells = Main.expertMode ? 7 : 5; + int maxCells = Main.expertMode ? 10 : 7; + DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas, 0.5f, minCells, maxCells); } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/Abyss/BobbitWormHead.cs b/NPCs/Abyss/BobbitWormHead.cs index 6c5a2714c7..b7bba67cb0 100644 --- a/NPCs/Abyss/BobbitWormHead.cs +++ b/NPCs/Abyss/BobbitWormHead.cs @@ -241,8 +241,9 @@ namespace CalamityMod.NPCs.Abyss public override void NPCLoot() { - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas, 2, 5, 7); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas && Main.expertMode, 2, 2, 3); + int minCells = Main.expertMode ? 7 : 5; + int maxCells = Main.expertMode ? 10 : 7; + DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas, 0.5f, minCells, maxCells); DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedPolterghast, 3, 1, 1); } diff --git a/NPCs/Abyss/ColossalSquid.cs b/NPCs/Abyss/ColossalSquid.cs index ea9690a90c..429ba540bc 100644 --- a/NPCs/Abyss/ColossalSquid.cs +++ b/NPCs/Abyss/ColossalSquid.cs @@ -35,7 +35,7 @@ namespace CalamityMod.NPCs.Abyss npc.width = 180; npc.height = 180; npc.defense = 50; - npc.DR_NERD(0.05f); + npc.DR_NERD(0.05f); npc.lifeMax = 130000; // Previously 220,000 npc.aiStyle = -1; aiType = -1; @@ -47,11 +47,11 @@ namespace CalamityMod.NPCs.Abyss npc.rarity = 2; banner = npc.type; bannerItem = ModContent.ItemType(); - npc.Calamity().VulnerableToHeat = false; - npc.Calamity().VulnerableToSickness = true; - npc.Calamity().VulnerableToElectricity = true; - npc.Calamity().VulnerableToWater = false; - } + npc.Calamity().VulnerableToHeat = false; + npc.Calamity().VulnerableToSickness = true; + npc.Calamity().VulnerableToElectricity = true; + npc.Calamity().VulnerableToWater = false; + } public override void SendExtraAI(BinaryWriter writer) { @@ -554,8 +554,9 @@ namespace CalamityMod.NPCs.Abyss public override void NPCLoot() { DropHelper.DropItem(npc, ItemID.BlackInk, 3, 5); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas, 2, 26, 38); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas && Main.expertMode, 2, 5, 7); + int minCells = Main.expertMode ? 31 : 26; + int maxCells = Main.expertMode ? 45 : 38; + DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas, 0.5f, minCells, maxCells); DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedPolterghast, 3, 1, 1); DropHelper.DropItemChance(npc, ModContent.ItemType(), 10, 1, 1); } diff --git a/NPCs/Abyss/DevilFish.cs b/NPCs/Abyss/DevilFish.cs index 5ce8932316..542e3505fe 100644 --- a/NPCs/Abyss/DevilFish.cs +++ b/NPCs/Abyss/DevilFish.cs @@ -305,8 +305,9 @@ namespace CalamityMod.NPCs.Abyss public override void NPCLoot() { DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas, 0.5f); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas, 0.5f, 1, 2); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas && Main.expertMode, 0.5f); + int minCells = Main.expertMode ? 2 : 1; + int maxCells = Main.expertMode ? 3 : 2; + DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas, 0.5f, minCells, maxCells); DropHelper.DropItemCondition(npc, ModContent.ItemType(), NPC.downedGolemBoss, 1f, 3, 9); } diff --git a/NPCs/Abyss/DevilFishAlt.cs b/NPCs/Abyss/DevilFishAlt.cs index 49decb0552..438e26a021 100644 --- a/NPCs/Abyss/DevilFishAlt.cs +++ b/NPCs/Abyss/DevilFishAlt.cs @@ -305,8 +305,9 @@ namespace CalamityMod.NPCs.Abyss public override void NPCLoot() { DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas, 0.5f); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas, 0.5f, 1, 2); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas && Main.expertMode, 0.5f); + int minCells = Main.expertMode ? 2 : 1; + int maxCells = Main.expertMode ? 3 : 2; + DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas, 0.5f, minCells, maxCells); DropHelper.DropItemCondition(npc, ModContent.ItemType(), NPC.downedGolemBoss, 1f, 3, 9); } diff --git a/NPCs/Abyss/EidolonWyrmHead.cs b/NPCs/Abyss/EidolonWyrmHead.cs index eba1325a0f..b123d9d77c 100644 --- a/NPCs/Abyss/EidolonWyrmHead.cs +++ b/NPCs/Abyss/EidolonWyrmHead.cs @@ -503,8 +503,10 @@ namespace CalamityMod.NPCs.Abyss DropHelper.DropItem(npc, ModContent.ItemType(), 30, 40); DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedPolterghast, 3, 1, 1); DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedPolterghast, 3, 1, 1); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas, 1, 6, 8); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas && Main.expertMode, 2, 2, 3); + DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); + int minLumenyl = Main.expertMode ? 8 : 6; + int maxLumenyl = Main.expertMode ? 11 : 8; + DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas, 1f, minLumenyl, maxLumenyl); DropHelper.DropItemCondition(npc, ItemID.Ectoplasm, NPC.downedPlantBoss, 1, 8, 12); } diff --git a/NPCs/Abyss/GiantSquid.cs b/NPCs/Abyss/GiantSquid.cs index bcb0ca4672..b441326652 100644 --- a/NPCs/Abyss/GiantSquid.cs +++ b/NPCs/Abyss/GiantSquid.cs @@ -252,8 +252,9 @@ namespace CalamityMod.NPCs.Abyss public override void NPCLoot() { DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas, 0.5f); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas, 0.5f, 2, 4); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas && Main.expertMode, 0.5f, 1, 2); + int minCells = Main.expertMode ? 3 : 2; + int maxCells = Main.expertMode ? 6 : 4; + DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas, 0.5f, minCells, maxCells); int inkBombDropRate = Main.expertMode ? 25 : 40; DropHelper.DropItemChance(npc, ModContent.ItemType(), inkBombDropRate, 1, 1); } diff --git a/NPCs/Abyss/GulperEelHead.cs b/NPCs/Abyss/GulperEelHead.cs index e3db6ddf6c..410081f2b0 100644 --- a/NPCs/Abyss/GulperEelHead.cs +++ b/NPCs/Abyss/GulperEelHead.cs @@ -339,10 +339,12 @@ namespace CalamityMod.NPCs.Abyss public override void NPCLoot() { - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas, 0.5f, 2, 3); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas && Main.expertMode, 0.5f); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas, 0.5f, 6, 8); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas && Main.expertMode, 0.5f, 2, 3); + int minLumenyl = Main.expertMode ? 3 : 2; + int maxLumenyl = Main.expertMode ? 4 : 3; + DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas, 0.5f, minLumenyl, maxLumenyl); + int minCells = Main.expertMode ? 8 : 6; + int maxCells = Main.expertMode ? 11 : 8; + DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas, 0.5f, minCells, maxCells); } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/Abyss/LuminousCorvina.cs b/NPCs/Abyss/LuminousCorvina.cs index e7aa828221..a1d56dbbd3 100644 --- a/NPCs/Abyss/LuminousCorvina.cs +++ b/NPCs/Abyss/LuminousCorvina.cs @@ -290,8 +290,9 @@ namespace CalamityMod.NPCs.Abyss { DropHelper.DropItem(npc, ModContent.ItemType(), 8, 15); DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas, 0.5f); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas, 0.5f, 1, 2); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas && Main.expertMode, 0.5f); + int minCells = Main.expertMode ? 2 : 1; + int maxCells = Main.expertMode ? 3 : 2; + DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas, 0.5f, minCells, maxCells); } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/Abyss/MirageJelly.cs b/NPCs/Abyss/MirageJelly.cs index 128a290c5f..c8c8beb469 100644 --- a/NPCs/Abyss/MirageJelly.cs +++ b/NPCs/Abyss/MirageJelly.cs @@ -206,8 +206,9 @@ namespace CalamityMod.NPCs.Abyss public override void NPCLoot() { DropHelper.DropItemCondition(npc, ModContent.ItemType(), NPC.downedBoss3, 10, 1, 1); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas, 2, 5, 7); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas && Main.expertMode, 2, 5, 7); + int minCells = Main.expertMode ? 10 : 5; + int maxCells = Main.expertMode ? 14 : 7; + DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas, 0.5f, minCells, maxCells); DropHelper.DropItemChance(npc, ModContent.ItemType(), Main.expertMode ? 5 : 7); DropHelper.DropItemChance(npc, ModContent.ItemType(), Main.expertMode ? 5 : 7); DropHelper.DropItemChance(npc, ModContent.ItemType(), Main.expertMode ? 5 : 7); diff --git a/NPCs/Abyss/OarfishHead.cs b/NPCs/Abyss/OarfishHead.cs index 443bbd62b3..cfb05d13c9 100644 --- a/NPCs/Abyss/OarfishHead.cs +++ b/NPCs/Abyss/OarfishHead.cs @@ -299,8 +299,9 @@ namespace CalamityMod.NPCs.Abyss public override void NPCLoot() { - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas, 0.5f, 3, 5); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas && Main.expertMode, 0.5f, 1, 2); + int minCells = Main.expertMode ? 4 : 3; + int maxCells = Main.expertMode ? 7 : 5; + DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas, 0.5f, minCells, maxCells); } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/Abyss/Reaper.cs b/NPCs/Abyss/Reaper.cs index 5df9959664..6d6d007b27 100644 --- a/NPCs/Abyss/Reaper.cs +++ b/NPCs/Abyss/Reaper.cs @@ -30,8 +30,8 @@ namespace CalamityMod.NPCs.Abyss public override void SetDefaults() { - npc.Calamity().canBreakPlayerDefense = true; - npc.npcSlots = 6f; + npc.Calamity().canBreakPlayerDefense = true; + npc.npcSlots = 6f; npc.noGravity = true; npc.lavaImmune = true; npc.damage = 160; @@ -49,11 +49,11 @@ namespace CalamityMod.NPCs.Abyss npc.rarity = 2; banner = npc.type; bannerItem = ModContent.ItemType(); - npc.Calamity().VulnerableToHeat = false; - npc.Calamity().VulnerableToSickness = true; - npc.Calamity().VulnerableToElectricity = true; - npc.Calamity().VulnerableToWater = false; - } + npc.Calamity().VulnerableToHeat = false; + npc.Calamity().VulnerableToSickness = true; + npc.Calamity().VulnerableToElectricity = true; + npc.Calamity().VulnerableToWater = false; + } public override void SendExtraAI(BinaryWriter writer) { @@ -130,7 +130,7 @@ namespace CalamityMod.NPCs.Abyss if (npc.ai[2] == 0f) { npc.ai[2] = 1f; - npc.velocity.X = npc.direction * 2; + npc.velocity.X = npc.direction * 2; } return; } @@ -652,14 +652,15 @@ namespace CalamityMod.NPCs.Abyss { DropHelper.DropItem(npc, ModContent.ItemType(), 40, 50); DropHelper.DropItem(npc, ModContent.ItemType(), 2, 3); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas, 2, 10, 17); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas && Main.expertMode, 2, 4, 5); + int minCells = Main.expertMode ? 14 : 10; + int maxCells = Main.expertMode ? 22 : 17; + DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas, 0.5f, minCells, maxCells); DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedPolterghast, 1f, 3, 4); DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedPolterghast, 3, 1, 1); - if (CalamityWorld.downedPolterghast) - { - DropHelper.DropItemChance(npc, ModContent.ItemType(), 3); - } + if (CalamityWorld.downedPolterghast) + { + DropHelper.DropItemChance(npc, ModContent.ItemType(), 3); + } } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/Abyss/ToxicMinnow.cs b/NPCs/Abyss/ToxicMinnow.cs index a85ac6e095..bdf4b154ca 100644 --- a/NPCs/Abyss/ToxicMinnow.cs +++ b/NPCs/Abyss/ToxicMinnow.cs @@ -152,8 +152,9 @@ namespace CalamityMod.NPCs.Abyss public override void NPCLoot() { - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas, 0.5f, 2, 3); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas && Main.expertMode, 0.5f, 2, 3); + int minCells = Main.expertMode ? 4 : 2; + int maxCells = Main.expertMode ? 6 : 3; + DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas, 0.5f, minCells, maxCells); } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/Abyss/Viperfish.cs b/NPCs/Abyss/Viperfish.cs index 23c278f003..d614835160 100644 --- a/NPCs/Abyss/Viperfish.cs +++ b/NPCs/Abyss/Viperfish.cs @@ -119,8 +119,9 @@ namespace CalamityMod.NPCs.Abyss public override void NPCLoot() { DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas, 0.25f); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas, 0.5f, 1, 2); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas && Main.expertMode, 0.5f); + int minCells = Main.expertMode ? 2 : 1; + int maxCells = Main.expertMode ? 3 : 2; + DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas, 0.5f, minCells, maxCells); } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/AcidRain/AcidEel.cs b/NPCs/AcidRain/AcidEel.cs index 78f57f12c5..ee2ceb95ed 100644 --- a/NPCs/AcidRain/AcidEel.cs +++ b/NPCs/AcidRain/AcidEel.cs @@ -9,6 +9,7 @@ using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using System; namespace CalamityMod.NPCs.AcidRain { @@ -66,6 +67,9 @@ namespace CalamityMod.NPCs.AcidRain { npc.TargetClosest(false); + // Fall through platforms. + npc.Calamity().ShouldFallThroughPlatforms = true; + // Play a slither sound from time to time. if (Main.rand.NextBool(480)) Main.PlaySound(SoundID.Zombie, npc.Center, 32); @@ -114,10 +118,14 @@ namespace CalamityMod.NPCs.AcidRain npc.netUpdate = true; } - // Rebound on impending collision. - if ((CalamityUtils.DistanceToTileCollisionHit(npc.Center, Vector2.UnitX * npc.direction, 20) ?? 20f) < 5f) + // Rebound on impending collision or when near the world edge. + bool nearWorldEdge = npc.Center.X < (Main.offLimitBorderTiles + 10f) * 16f || npc.Center.X > (Main.maxTilesX - Main.offLimitBorderTiles - 10f) * 16f; + if ((CalamityUtils.DistanceToTileCollisionHit(npc.Center, Vector2.UnitX * npc.direction, 20) ?? 20f) < 5f || nearWorldEdge) { npc.direction *= -1; + if (nearWorldEdge) + npc.position.X += Math.Sign(Main.maxTilesX * 8f - npc.position.X) * 12f; + npc.netUpdate = true; } diff --git a/NPCs/AcidRain/CragmawMire.cs b/NPCs/AcidRain/CragmawMire.cs index 73c61b3720..14dcea5b11 100644 --- a/NPCs/AcidRain/CragmawMire.cs +++ b/NPCs/AcidRain/CragmawMire.cs @@ -266,7 +266,7 @@ namespace CalamityMod.NPCs.AcidRain // Register ground collision from the slam. // Once it has been hit a nuke explosion projectile is created on the ground, along with homing nuclear drops. - if ((npc.Bottom.Y > Target.Bottom.Y && Collision.SolidCollision(npc.Bottom, 1, 1)) || AttackTimer > 180f) + if ((npc.Bottom.Y > Target.Bottom.Y && Collision.SolidCollision(npc.BottomLeft, npc.width, 1)) || AttackTimer > 180f) { npc.velocity = Vector2.Zero; diff --git a/NPCs/Abyss/AEWScreenShaderData.cs b/NPCs/AdultEidolonWyrm/AEWScreenShaderData.cs similarity index 96% rename from NPCs/Abyss/AEWScreenShaderData.cs rename to NPCs/AdultEidolonWyrm/AEWScreenShaderData.cs index 4d0c5fc4ab..99ba5112dd 100644 --- a/NPCs/Abyss/AEWScreenShaderData.cs +++ b/NPCs/AdultEidolonWyrm/AEWScreenShaderData.cs @@ -2,7 +2,7 @@ using Terraria; using Terraria.Graphics.Shaders; using Terraria.ModLoader; -namespace CalamityMod.NPCs.Abyss +namespace CalamityMod.NPCs.AdultEidolonWyrm { public class AEWScreenShaderData : ScreenShaderData { diff --git a/NPCs/Abyss/AEWSky.cs b/NPCs/AdultEidolonWyrm/AEWSky.cs similarity index 98% rename from NPCs/Abyss/AEWSky.cs rename to NPCs/AdultEidolonWyrm/AEWSky.cs index 074be772c1..aadf37d301 100644 --- a/NPCs/Abyss/AEWSky.cs +++ b/NPCs/AdultEidolonWyrm/AEWSky.cs @@ -4,7 +4,7 @@ using Terraria; using Terraria.Graphics.Effects; using Terraria.ModLoader; -namespace CalamityMod.NPCs.Abyss +namespace CalamityMod.NPCs.AdultEidolonWyrm { public class AEWSky : CustomSky { diff --git a/NPCs/Abyss/AdultEidolonWyrm_BossChecklist.png b/NPCs/AdultEidolonWyrm/AdultEidolonWyrm_BossChecklist.png similarity index 100% rename from NPCs/Abyss/AdultEidolonWyrm_BossChecklist.png rename to NPCs/AdultEidolonWyrm/AdultEidolonWyrm_BossChecklist.png diff --git a/NPCs/Abyss/EidolonWyrmBodyAltGlowHuge.png b/NPCs/AdultEidolonWyrm/EidolonWyrmBodyAltGlowHuge.png similarity index 100% rename from NPCs/Abyss/EidolonWyrmBodyAltGlowHuge.png rename to NPCs/AdultEidolonWyrm/EidolonWyrmBodyAltGlowHuge.png diff --git a/NPCs/Abyss/EidolonWyrmBodyAltHuge.cs b/NPCs/AdultEidolonWyrm/EidolonWyrmBodyAltHuge.cs similarity index 96% rename from NPCs/Abyss/EidolonWyrmBodyAltHuge.cs rename to NPCs/AdultEidolonWyrm/EidolonWyrmBodyAltHuge.cs index 6acca26867..764caf17c5 100644 --- a/NPCs/Abyss/EidolonWyrmBodyAltHuge.cs +++ b/NPCs/AdultEidolonWyrm/EidolonWyrmBodyAltHuge.cs @@ -7,13 +7,13 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.NPCs.Abyss +namespace CalamityMod.NPCs.AdultEidolonWyrm { public class EidolonWyrmBodyAltHuge : ModNPC { public override void SetStaticDefaults() { - DisplayName.SetDefault("Eidolon Wyrm"); + DisplayName.SetDefault("Adult Eidolon Wyrm"); } public override void SetDefaults() @@ -183,10 +183,10 @@ namespace CalamityMod.NPCs.Abyss Vector2 center = new Vector2(npc.Center.X, npc.Center.Y); Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / 2); Vector2 vector = center - Main.screenPosition; - vector -= new Vector2(ModContent.GetTexture("CalamityMod/NPCs/Abyss/EidolonWyrmBodyAltGlowHuge").Width, ModContent.GetTexture("CalamityMod/NPCs/Abyss/EidolonWyrmBodyAltGlowHuge").Height) * 0.5f; + vector -= new Vector2(ModContent.GetTexture("CalamityMod/NPCs/AdultEidolonWyrm/EidolonWyrmBodyAltGlowHuge").Width, ModContent.GetTexture("CalamityMod/NPCs/AdultEidolonWyrm/EidolonWyrmBodyAltGlowHuge").Height) * 0.5f; vector += vector11 * 1f + new Vector2(0f, 4f + npc.gfxOffY); Color color = new Color(127, 127, 127, 0).MultiplyRGBA(Color.LightYellow) * npc.Opacity; - Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/Abyss/EidolonWyrmBodyAltGlowHuge"), vector, + Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/AdultEidolonWyrm/EidolonWyrmBodyAltGlowHuge"), vector, new Microsoft.Xna.Framework.Rectangle?(npc.frame), color, npc.rotation, vector11, 1f, spriteEffects, 0f); } diff --git a/NPCs/Abyss/EidolonWyrmBodyAltHuge.png b/NPCs/AdultEidolonWyrm/EidolonWyrmBodyAltHuge.png similarity index 100% rename from NPCs/Abyss/EidolonWyrmBodyAltHuge.png rename to NPCs/AdultEidolonWyrm/EidolonWyrmBodyAltHuge.png diff --git a/NPCs/Abyss/EidolonWyrmBodyGlowHuge.png b/NPCs/AdultEidolonWyrm/EidolonWyrmBodyGlowHuge.png similarity index 100% rename from NPCs/Abyss/EidolonWyrmBodyGlowHuge.png rename to NPCs/AdultEidolonWyrm/EidolonWyrmBodyGlowHuge.png diff --git a/NPCs/Abyss/EidolonWyrmBodyHuge.cs b/NPCs/AdultEidolonWyrm/EidolonWyrmBodyHuge.cs similarity index 96% rename from NPCs/Abyss/EidolonWyrmBodyHuge.cs rename to NPCs/AdultEidolonWyrm/EidolonWyrmBodyHuge.cs index 72d2b159e1..e7db6ff9e9 100644 --- a/NPCs/Abyss/EidolonWyrmBodyHuge.cs +++ b/NPCs/AdultEidolonWyrm/EidolonWyrmBodyHuge.cs @@ -7,13 +7,13 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.NPCs.Abyss +namespace CalamityMod.NPCs.AdultEidolonWyrm { public class EidolonWyrmBodyHuge : ModNPC { public override void SetStaticDefaults() { - DisplayName.SetDefault("Eidolon Wyrm"); + DisplayName.SetDefault("Adult Eidolon Wyrm"); } public override void SetDefaults() @@ -183,10 +183,10 @@ namespace CalamityMod.NPCs.Abyss Vector2 center = new Vector2(npc.Center.X, npc.Center.Y); Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / 2); Vector2 vector = center - Main.screenPosition; - vector -= new Vector2(ModContent.GetTexture("CalamityMod/NPCs/Abyss/EidolonWyrmBodyGlowHuge").Width, ModContent.GetTexture("CalamityMod/NPCs/Abyss/EidolonWyrmBodyGlowHuge").Height) * 0.5f; + vector -= new Vector2(ModContent.GetTexture("CalamityMod/NPCs/AdultEidolonWyrm/EidolonWyrmBodyGlowHuge").Width, ModContent.GetTexture("CalamityMod/NPCs/AdultEidolonWyrm/EidolonWyrmBodyGlowHuge").Height) * 0.5f; vector += vector11 * 1f + new Vector2(0f, 4f + npc.gfxOffY); Color color = new Color(127, 127, 127, 0).MultiplyRGBA(Color.LightYellow) * npc.Opacity; - Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/Abyss/EidolonWyrmBodyGlowHuge"), vector, + Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/AdultEidolonWyrm/EidolonWyrmBodyGlowHuge"), vector, new Microsoft.Xna.Framework.Rectangle?(npc.frame), color, npc.rotation, vector11, 1f, spriteEffects, 0f); } diff --git a/NPCs/Abyss/EidolonWyrmBodyHuge.png b/NPCs/AdultEidolonWyrm/EidolonWyrmBodyHuge.png similarity index 100% rename from NPCs/Abyss/EidolonWyrmBodyHuge.png rename to NPCs/AdultEidolonWyrm/EidolonWyrmBodyHuge.png diff --git a/NPCs/Abyss/EidolonWyrmHeadGlowHuge.png b/NPCs/AdultEidolonWyrm/EidolonWyrmHeadGlowHuge.png similarity index 100% rename from NPCs/Abyss/EidolonWyrmHeadGlowHuge.png rename to NPCs/AdultEidolonWyrm/EidolonWyrmHeadGlowHuge.png diff --git a/NPCs/Abyss/EidolonWyrmHeadHuge.cs b/NPCs/AdultEidolonWyrm/EidolonWyrmHeadHuge.cs similarity index 98% rename from NPCs/Abyss/EidolonWyrmHeadHuge.cs rename to NPCs/AdultEidolonWyrm/EidolonWyrmHeadHuge.cs index cd61e37116..ebb4c5aaa8 100644 --- a/NPCs/Abyss/EidolonWyrmHeadHuge.cs +++ b/NPCs/AdultEidolonWyrm/EidolonWyrmHeadHuge.cs @@ -6,6 +6,7 @@ using CalamityMod.Items.Potions; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.NPCs.Abyss; using CalamityMod.NPCs.NormalNPCs; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -16,7 +17,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.NPCs.Abyss +namespace CalamityMod.NPCs.AdultEidolonWyrm { [AutoloadBossHead] public class EidolonWyrmHeadHuge : ModNPC @@ -72,7 +73,7 @@ namespace CalamityMod.NPCs.Abyss public override void SetStaticDefaults() { - DisplayName.SetDefault("Eidolon Wyrm"); + DisplayName.SetDefault("Adult Eidolon Wyrm"); } public override void SetDefaults() @@ -1322,11 +1323,6 @@ namespace CalamityMod.NPCs.Abyss return minDist <= 70f && npc.Opacity == 1f; } - public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) - { - return !CalamityUtils.AntiButcher(npc, ref damage, 0.1f); - } - public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) { scale = 1.5f; @@ -1339,10 +1335,10 @@ namespace CalamityMod.NPCs.Abyss Vector2 center = npc.Center; Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / 2); Vector2 vector = center - Main.screenPosition; - vector -= new Vector2(ModContent.GetTexture("CalamityMod/NPCs/Abyss/EidolonWyrmHeadGlowHuge").Width, ModContent.GetTexture("CalamityMod/NPCs/Abyss/EidolonWyrmHeadGlowHuge").Height) * 0.5f; + vector -= new Vector2(ModContent.GetTexture("CalamityMod/NPCs/AdultEidolonWyrm/EidolonWyrmHeadGlowHuge").Width, ModContent.GetTexture("CalamityMod/NPCs/AdultEidolonWyrm/EidolonWyrmHeadGlowHuge").Height) * 0.5f; vector += vector11 * 1f + new Vector2(0f, 4f + npc.gfxOffY); Color color = new Color(127, 127, 127, 0).MultiplyRGBA(Color.LightYellow) * npc.Opacity; - Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/Abyss/EidolonWyrmHeadGlowHuge"), vector, + Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/AdultEidolonWyrm/EidolonWyrmHeadGlowHuge"), vector, new Microsoft.Xna.Framework.Rectangle?(npc.frame), color, npc.rotation, vector11, 1f, spriteEffects, 0f); } @@ -1360,8 +1356,9 @@ namespace CalamityMod.NPCs.Abyss DropHelper.DropItem(npc, ModContent.ItemType()); DropHelper.DropItem(npc, ModContent.ItemType()); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas, 1, 50, 108); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas && Main.expertMode, 2, 15, 27); + int minLumenyl = Main.expertMode ? 65 : 50; + int maxLumenyl = Main.expertMode ? 135 : 108; + DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas, 1f, minLumenyl, maxLumenyl); DropHelper.DropItemCondition(npc, ItemID.Ectoplasm, NPC.downedPlantBoss, 1, 21, 32); // Mark Adult Eidolon Wyrm as defeated diff --git a/NPCs/Abyss/EidolonWyrmHeadHuge.png b/NPCs/AdultEidolonWyrm/EidolonWyrmHeadHuge.png similarity index 100% rename from NPCs/Abyss/EidolonWyrmHeadHuge.png rename to NPCs/AdultEidolonWyrm/EidolonWyrmHeadHuge.png diff --git a/NPCs/Abyss/EidolonWyrmHeadHuge_Head_Boss.png b/NPCs/AdultEidolonWyrm/EidolonWyrmHeadHuge_Head_Boss.png similarity index 100% rename from NPCs/Abyss/EidolonWyrmHeadHuge_Head_Boss.png rename to NPCs/AdultEidolonWyrm/EidolonWyrmHeadHuge_Head_Boss.png diff --git a/NPCs/Abyss/EidolonWyrmTailGlowHuge.png b/NPCs/AdultEidolonWyrm/EidolonWyrmTailGlowHuge.png similarity index 100% rename from NPCs/Abyss/EidolonWyrmTailGlowHuge.png rename to NPCs/AdultEidolonWyrm/EidolonWyrmTailGlowHuge.png diff --git a/NPCs/Abyss/EidolonWyrmTailHuge.cs b/NPCs/AdultEidolonWyrm/EidolonWyrmTailHuge.cs similarity index 95% rename from NPCs/Abyss/EidolonWyrmTailHuge.cs rename to NPCs/AdultEidolonWyrm/EidolonWyrmTailHuge.cs index 11f9b2e6be..2df85028f0 100644 --- a/NPCs/Abyss/EidolonWyrmTailHuge.cs +++ b/NPCs/AdultEidolonWyrm/EidolonWyrmTailHuge.cs @@ -6,13 +6,13 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.NPCs.Abyss +namespace CalamityMod.NPCs.AdultEidolonWyrm { public class EidolonWyrmTailHuge : ModNPC { public override void SetStaticDefaults() { - DisplayName.SetDefault("Eidolon Wyrm"); + DisplayName.SetDefault("Adult Eidolon Wyrm"); } public override void SetDefaults() @@ -148,10 +148,10 @@ namespace CalamityMod.NPCs.Abyss Vector2 center = new Vector2(npc.Center.X, npc.Center.Y); Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / 2); Vector2 vector = center - Main.screenPosition; - vector -= new Vector2(ModContent.GetTexture("CalamityMod/NPCs/Abyss/EidolonWyrmTailGlowHuge").Width, ModContent.GetTexture("CalamityMod/NPCs/Abyss/EidolonWyrmTailGlowHuge").Height) * 0.5f; + vector -= new Vector2(ModContent.GetTexture("CalamityMod/NPCs/AdultEidolonWyrm/EidolonWyrmTailGlowHuge").Width, ModContent.GetTexture("CalamityMod/NPCs/AdultEidolonWyrm/EidolonWyrmTailGlowHuge").Height) * 0.5f; vector += vector11 * 1f + new Vector2(0f, 4f + npc.gfxOffY); Color color = new Color(127, 127, 127, 0).MultiplyRGBA(Color.LightYellow) * npc.Opacity; - Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/Abyss/EidolonWyrmTailGlowHuge"), vector, + Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/AdultEidolonWyrm/EidolonWyrmTailGlowHuge"), vector, new Microsoft.Xna.Framework.Rectangle?(npc.frame), color, npc.rotation, vector11, 1f, spriteEffects, 0f); } diff --git a/NPCs/Abyss/EidolonWyrmTailHuge.png b/NPCs/AdultEidolonWyrm/EidolonWyrmTailHuge.png similarity index 100% rename from NPCs/Abyss/EidolonWyrmTailHuge.png rename to NPCs/AdultEidolonWyrm/EidolonWyrmTailHuge.png diff --git a/NPCs/AquaticScourge/AquaticScourgeHead.cs b/NPCs/AquaticScourge/AquaticScourgeHead.cs index fc48c1aa68..286e4041c8 100644 --- a/NPCs/AquaticScourge/AquaticScourgeHead.cs +++ b/NPCs/AquaticScourge/AquaticScourgeHead.cs @@ -2,7 +2,6 @@ using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Events; using CalamityMod.Items.Accessories; using CalamityMod.Items.LoreItems; -using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using CalamityMod.Items.Placeables.Furniture.Trophies; using CalamityMod.Items.TreasureBags; @@ -89,7 +88,7 @@ namespace CalamityMod.NPCs.AquaticScourge public override void AI() { - if (npc.justHit || npc.life <= npc.lifeMax * 0.99 || BossRushEvent.BossRushActive) + if (npc.justHit || npc.life <= npc.lifeMax * 0.999 || BossRushEvent.BossRushActive) music = CalamityMod.Instance.GetMusicFromMusicMod("AquaticScourge") ?? MusicID.Boss2; CalamityAI.AquaticScourgeAI(npc, mod, true); @@ -184,10 +183,6 @@ namespace CalamityMod.NPCs.AquaticScourge DropHelper.DropBags(npc); - // Legendary drops for Aquatic Scourge - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); - DropHelper.DropItem(npc, ItemID.GreaterHealingPotion, 8, 14); DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !CalamityWorld.downedAquaticScourge); @@ -205,11 +200,14 @@ namespace CalamityMod.NPCs.AquaticScourge DropHelper.WeightStack(w), DropHelper.WeightStack(w), DropHelper.WeightStack(w), - DropHelper.WeightStack(w) - ); + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w) + ); - // Equipment - DropHelper.DropItemChance(npc, ModContent.ItemType(), 9); + // Equipment + DropHelper.DropItem(npc, ModContent.ItemType(), true); // Vanity DropHelper.DropItemChance(npc, ModContent.ItemType(), 7); diff --git a/NPCs/AstrumAureus/AstrumAureus.cs b/NPCs/AstrumAureus/AstrumAureus.cs index a078c7c3b4..f6de8faaff 100644 --- a/NPCs/AstrumAureus/AstrumAureus.cs +++ b/NPCs/AstrumAureus/AstrumAureus.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; +using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; using CalamityMod.Items.Materials; @@ -46,7 +47,7 @@ namespace CalamityMod.NPCs.AstrumAureus npc.width = 374; npc.height = 374; npc.defense = 40; - npc.DR_NERD(0.15f); + npc.DR_NERD(0.4f); npc.LifeMaxNERB(NPC.downedMoonlord ? 243750 : 89200, NPC.downedMoonlord ? 292500 : 107000, 740000); // 30 seconds in boss rush npc.aiStyle = -1; aiType = -1; @@ -320,9 +321,6 @@ namespace CalamityMod.NPCs.AstrumAureus DropHelper.DropBags(npc); - // Legendary drop for Astrum Aureus - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); - DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !CalamityWorld.downedAstrageldon); @@ -342,10 +340,12 @@ namespace CalamityMod.NPCs.AstrumAureus DropHelper.WeightStack(w), DropHelper.WeightStack(w), DropHelper.WeightStack(w), - DropHelper.WeightStack(w) - ); + DropHelper.WeightStack(w), + DropHelper.WeightStack(w) + ); // Equipment + DropHelper.DropItem(npc, ModContent.ItemType(), true); DropHelper.DropItemCondition(npc, ModContent.ItemType(), NPC.downedMoonlord); // Vanity @@ -353,11 +353,13 @@ namespace CalamityMod.NPCs.AstrumAureus // Other DropHelper.DropItem(npc, ModContent.ItemType(), 9, 12); - DropHelper.DropItemChance(npc, ItemID.HallowedKey, 5); } - // Drop an Astral Meteor if applicable - ThreadPool.QueueUserWorkItem(_ => AstralBiome.PlaceAstralMeteor()); + // Other + DropHelper.DropItemChance(npc, ItemID.HallowedKey, 3); + + // Drop an Astral Meteor if applicable + ThreadPool.QueueUserWorkItem(_ => AstralBiome.PlaceAstralMeteor()); // If Astrum Aureus has not yet been killed, notify players of new Astral enemy drops if (!CalamityWorld.downedAstrageldon) diff --git a/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs b/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs index 75852d1daf..30b6357fc5 100644 --- a/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs +++ b/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs @@ -214,11 +214,11 @@ namespace CalamityMod.NPCs.AstrumDeus return false; } - public override void NPCLoot() + public override bool PreNPCLoot() { // Unsplit Deus does not drop anything when killed/despawned. - if (npc.Calamity().newAI[0] == 0f) - return; + if (npc.Calamity().newAI[0] == 0f) + return false; // Killing ANY split Deus makes all other Deus heads die immediately. for (int i = 0; i < Main.maxNPCs; ++i) @@ -233,16 +233,19 @@ namespace CalamityMod.NPCs.AstrumDeus otherWormHead.netUpdate = true; } } + return true; + } + + public override void NPCLoot() + { + // Unsplit Deus does not drop anything when killed/despawned. + if (npc.Calamity().newAI[0] == 0f) + return; CalamityGlobalNPC.SetNewBossJustDowned(npc); DropHelper.DropBags(npc); - // Legendary drops for Astrum Deus - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); - DropHelper.DropItem(npc, ItemID.GreaterHealingPotion, 8, 14); DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); DropHelper.DropItemCondition(npc, ModContent.ItemType(), !CalamityWorld.downedStarGod); @@ -270,9 +273,10 @@ namespace CalamityMod.NPCs.AstrumDeus DropHelper.WeightStack(w), DropHelper.WeightStack(w), DropHelper.WeightStack(w) - ); + ); - // Equipment + // Equipment + DropHelper.DropItem(npc, ModContent.ItemType(), true); DropHelper.DropItemChance(npc, ModContent.ItemType(), 5); // Vanity diff --git a/NPCs/BrimstoneElemental/BrimstoneElemental.cs b/NPCs/BrimstoneElemental/BrimstoneElemental.cs index 9df9e244cf..b2147e5417 100644 --- a/NPCs/BrimstoneElemental/BrimstoneElemental.cs +++ b/NPCs/BrimstoneElemental/BrimstoneElemental.cs @@ -155,10 +155,6 @@ namespace CalamityMod.NPCs.BrimstoneElemental DropHelper.DropBags(npc); - // Legendary drop for Brimstone Elemental - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); - DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !CalamityWorld.downedBrimstoneElemental); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !CalamityWorld.downedBrimstoneElemental); @@ -177,12 +173,15 @@ namespace CalamityMod.NPCs.BrimstoneElemental DropHelper.DropEntireWeightedSet(npc, DropHelper.WeightStack(w), DropHelper.WeightStack(w), - DropHelper.WeightStack(w) - ); + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w) + ); - // Equipment - DropHelper.DropItemChance(npc, ModContent.ItemType(), 5); - DropHelper.DropItemChance(npc, ModContent.ItemType(), 2); + // Equipment + DropHelper.DropItem(npc, ModContent.ItemType(), true); + DropHelper.DropItem(npc, ModContent.ItemType(), true); DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedProvidence); // Vanity diff --git a/NPCs/Bumblebirb/Bumblefuck.cs b/NPCs/Bumblebirb/Bumblefuck.cs index 89d54c322c..859677eafc 100644 --- a/NPCs/Bumblebirb/Bumblefuck.cs +++ b/NPCs/Bumblebirb/Bumblefuck.cs @@ -1,6 +1,5 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Events; +using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; using CalamityMod.Items.Materials; @@ -413,9 +412,6 @@ namespace CalamityMod.NPCs.Bumblebirb DropHelper.DropBags(npc); - // Legendary drop for Dragonfolly - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); - DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !CalamityWorld.downedBumble); @@ -430,11 +426,13 @@ namespace CalamityMod.NPCs.Bumblebirb DropHelper.DropEntireWeightedSet(npc, DropHelper.WeightStack(w), DropHelper.WeightStack(w), - DropHelper.WeightStack(w) + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w) ); - // Equipment - DropHelper.DropItemChance(npc, ModContent.ItemType(), 4); + // Equipment + DropHelper.DropItem(npc, ModContent.ItemType(), true); // Vanity DropHelper.DropItemChance(npc, ModContent.ItemType(), 7); diff --git a/NPCs/Calamitas/CalamitasRun3.cs b/NPCs/Calamitas/CalamitasRun3.cs index f028a19ef3..5b5f30bf34 100644 --- a/NPCs/Calamitas/CalamitasRun3.cs +++ b/NPCs/Calamitas/CalamitasRun3.cs @@ -158,9 +158,6 @@ namespace CalamityMod.NPCs.Calamitas DropHelper.DropBags(npc); - // Legendary drop for Cal Clone - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); - DropHelper.DropItem(npc, ItemID.BrokenHeroSword, true); DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); DropHelper.DropItemCondition(npc, ModContent.ItemType(), !CalamityWorld.downedCalamitas); @@ -181,11 +178,13 @@ namespace CalamityMod.NPCs.Calamitas DropHelper.WeightStack(w), DropHelper.WeightStack(w), DropHelper.WeightStack(w), - DropHelper.WeightStack(w) - ); + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w) + ); - // Equipment - DropHelper.DropItemChance(npc, ModContent.ItemType(), 5); + // Equipment + DropHelper.DropItem(npc, ModContent.ItemType(), true); // Vanity DropHelper.DropItemChance(npc, ModContent.ItemType(), 7); diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index 573da6aa4e..f611cc6a4a 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -30,8 +30,6 @@ namespace CalamityMod.NPCs { public class CalamityAI { - // Master Mode changes - // 1 - Sand clouds spread out far more and more are spawned in instead of sand blasts, 2 - Far longer and larger, 3 - Sand blasts accelerate #region Aquatic Scourge public static void AquaticScourgeAI(NPC npc, Mod mod, bool head) { @@ -43,12 +41,14 @@ namespace CalamityMod.NPCs bool death = CalamityWorld.death || malice; // Adjust hostility and stats - if (npc.justHit || npc.life <= npc.lifeMax * 0.99 || BossRushEvent.BossRushActive) + if (npc.justHit || npc.life <= npc.lifeMax * 0.999 || BossRushEvent.BossRushActive) { if (calamityGlobalNPC.newAI[0] == 0f) { // Kiss my motherfucking ass you piece of shit game npc.timeLeft *= 20; + CalamityMod.bossKillTimes.TryGetValue(npc.type, out int revKillTime); + calamityGlobalNPC.KillTime = revKillTime; calamityGlobalNPC.newAI[0] = 1f; npc.boss = head; npc.chaseable = true; @@ -72,6 +72,7 @@ namespace CalamityMod.NPCs // Phases bool phase2 = lifeRatio < 0.75f; bool phase3 = lifeRatio < 0.5f; + bool phase4 = lifeRatio < 0.25f; // Set worm variable if (npc.ai[2] > 0f) @@ -131,36 +132,56 @@ namespace CalamityMod.NPCs if (doSpiral) { // Barf - if (calamityGlobalNPC.newAI[3] % 40f == 0f) + float barfDivisor = malice ? 30f : expertMode ? 40f : 60f; + if (calamityGlobalNPC.newAI[3] % barfDivisor == 0f) { Main.PlaySound(SoundID.NPCKilled, (int)npc.position.X, (int)npc.position.Y, 13); if (Main.netMode != NetmodeID.MultiplayerClient) { - float num742 = death ? 10f : 8f; - float num743 = player.Center.X - vectorCenter.X; - float num744 = player.Center.Y - vectorCenter.Y; - float num745 = (float)Math.Sqrt(num743 * num743 + num744 * num744); - - num745 = num742 / num745; - num743 *= num745; - num744 *= num745; - - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - int numProj = death ? 5 : 3; - int spread = death ? 60 : 36; - float rotation = MathHelper.ToRadians(spread); - float baseSpeed = (float)Math.Sqrt(num743 * num743 + num744 * num744); - double startAngle = Math.Atan2(num743, num744) - rotation / 2; - double deltaAngle = rotation / numProj; - double offsetAngle; - - for (int i = 0; i < numProj; i++) + if (phase3) { - offsetAngle = startAngle + deltaAngle * i; - int proj = Projectile.NewProjectile(vectorCenter.X, vectorCenter.Y, baseSpeed * (float)Math.Sin(offsetAngle), baseSpeed * (float)Math.Cos(offsetAngle), type, damage, 0f, Main.myPlayer, 0f, 0f); - Main.projectile[proj].tileCollide = false; + // Circle of toxic clouds + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + int totalProjectiles = (phase4 ? 6 : 9) + (int)((calamityGlobalNPC.newAI[3] - ai3) / barfDivisor) * (phase4 ? 2 : 3); + float radians = MathHelper.TwoPi / totalProjectiles; + float cloudVelocity = 1f + enrageScale; + Vector2 spinningPoint = new Vector2(0f, -cloudVelocity); + for (int k = 0; k < totalProjectiles; k++) + { + Vector2 vector255 = spinningPoint.RotatedBy(radians * k); + Projectile.NewProjectile(vectorCenter, vector255, type, damage, 0f, Main.myPlayer); + } + } + else + { + // Spread of directed sand blasts + float num742 = death ? 10f : 8f; + float num743 = player.Center.X - vectorCenter.X; + float num744 = player.Center.Y - vectorCenter.Y; + float num745 = (float)Math.Sqrt(num743 * num743 + num744 * num744); + + num745 = num742 / num745; + num743 *= num745; + num744 *= num745; + + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + int numProj = death ? 5 : 3; + int spread = death ? 60 : 36; + float rotation = MathHelper.ToRadians(spread); + float baseSpeed = (float)Math.Sqrt(num743 * num743 + num744 * num744); + double startAngle = Math.Atan2(num743, num744) - rotation / 2; + double deltaAngle = rotation / numProj; + double offsetAngle; + + for (int i = 0; i < numProj; i++) + { + offsetAngle = startAngle + deltaAngle * i; + int proj = Projectile.NewProjectile(vectorCenter.X, vectorCenter.Y, baseSpeed * (float)Math.Sin(offsetAngle), baseSpeed * (float)Math.Cos(offsetAngle), type, damage, 0f, Main.myPlayer, 0f, 0f); + Main.projectile[proj].tileCollide = false; + } } } } @@ -260,10 +281,11 @@ namespace CalamityMod.NPCs float radians = MathHelper.TwoPi / totalProjectiles; int type = ModContent.ProjectileType(); int damage = npc.GetProjectileDamage(type); + float homing = phase4 ? 1f : 0f; for (int i = 0; i < totalProjectiles; i++) { Vector2 vector255 = new Vector2(0f, -velocity).RotatedBy(radians * i); - Projectile.NewProjectile(npc.Center, vector255, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.Center, vector255, type, damage, 0f, Main.myPlayer, homing, 0f); } if (phase3) @@ -277,8 +299,9 @@ namespace CalamityMod.NPCs vector15.Normalize(); vector15 *= Main.rand.Next(50, 401) * 0.01f; + float maximumVelocityMult = death ? 0.35f : 0.25f; if (expertMode) - vector15 *= 1f + (death ? 0.25f : 0.25f * (1f - lifeRatio)); + vector15 *= 1f + (maximumVelocityMult * (1f - lifeRatio)); Projectile.NewProjectile(npc.Center, vector15, type, damage, 0f, Main.myPlayer, 0f, Main.rand.Next(-45, 1)); } @@ -292,7 +315,7 @@ namespace CalamityMod.NPCs // Fire sand blasts or teeth depending on body type else { - if (calamityGlobalNPC.newAI[0] == 1f) + if (calamityGlobalNPC.newAI[0] == 1f && (!phase3 || phase4)) { npc.localAI[0] += 1f; float shootProjectile = 300; @@ -319,7 +342,8 @@ namespace CalamityMod.NPCs num943 *= num944; vector104.X += num942 * 5f; vector104.Y += num943 * 5f; - Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, type, damage, 0f, Main.myPlayer); + float accelerate = phase4 ? 1f : 0f; + Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, type, damage, 0f, Main.myPlayer, accelerate, 0f); npc.netUpdate = true; } } @@ -343,7 +367,8 @@ namespace CalamityMod.NPCs num943 *= num944; vector104.X += num942 * 5f; vector104.Y += num943 * 5f; - Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, type, damage, 0f, Main.myPlayer, 0f, 0f); + float homing = phase4 ? 1f : 0f; + Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, type, damage, 0f, Main.myPlayer, homing, 0f); npc.netUpdate = true; } } @@ -603,8 +628,6 @@ namespace CalamityMod.NPCs } #endregion - // Master Mode changes - // 1 - Cycles between attacks faster, 2 - Brimstone Ray splits off into brimstone darts when fired, 3 - Brimlings stay very close to their mother to act as meat shields #region Brimstone Elemental public static void BrimstoneElementalAI(NPC npc, Mod mod) { @@ -1212,8 +1235,6 @@ namespace CalamityMod.NPCs } #endregion - // Master Mode changes - // 1 - Brothers are midgets and faster, 2 - Calamitas no longer gains increased defense while brothers are alive, 3 - Calamitas moves far quicker and her fireballs split into brimstone darts on death #region Calamitas Clone public static void CalamitasCloneAI(NPC npc, Mod mod) { @@ -2584,8 +2605,6 @@ namespace CalamityMod.NPCs } #endregion - // Master Mode changes - // 1 - Smaller, 2 - Much faster, 3 - Aureus Spawns are bigger and are aggro immediately #region Astrum Aureus public static void AstrumAureusAI(NPC npc, Mod mod) { @@ -3246,8 +3265,6 @@ namespace CalamityMod.NPCs } #endregion - // Master Mode changes - // 1 - Deus worms in phase 2 gain DR proportional to the amount of HP the other worm has left (to force the player to damage both to around 10% to finish the fight) #region Astrum Deus public static void AstrumDeusAI(NPC npc, Mod mod, bool head) { @@ -3945,8 +3962,6 @@ namespace CalamityMod.NPCs } #endregion - // Master Mode changes - // 1 - Dark Energies are smaller and spread out from each other, 2 - Void accelerates quicker #region Ceaseless Void public static void CeaselessVoidAI(NPC npc, Mod mod) { @@ -4528,8 +4543,6 @@ namespace CalamityMod.NPCs } #endregion - // Master Mode changes - // 1 - Always has 1 added to its enraged scale, 2 - Lightning auras are horizontal instead of vertical #region Bumblebirb public static void BumblebirbAI(NPC npc, Mod mod) { @@ -5434,8 +5447,6 @@ namespace CalamityMod.NPCs } #endregion - // Master Mode changes - // 1 - Every NPC in the fight is bigger, 2 - Cycles between attacks quicker #region Old Duke public static void OldDukeAI(NPC npc, Mod mod) { diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index df286d9d56..524edb45db 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -9,6 +9,7 @@ using CalamityMod.Items.Accessories; using CalamityMod.Items.Tools; using CalamityMod.Items.Weapons.Melee; using CalamityMod.NPCs.Abyss; +using CalamityMod.NPCs.AdultEidolonWyrm; using CalamityMod.NPCs.AcidRain; using CalamityMod.NPCs.AquaticScourge; using CalamityMod.NPCs.Astral; @@ -101,6 +102,15 @@ namespace CalamityMod.NPCs public bool? VulnerableToElectricity = null; public bool? VulnerableToWater = null; + // Eskimo Set effect + public bool IncreasedColdEffects = false; + + // Fireball and Cinnamon Roll effect + public bool IncreasedHeatEffects = false; + + // Evergreen Gin effect + public bool IncreasedSicknessAndWaterEffects = false; + // Biome enrage timer max public const int biomeEnrageTimerMax = 300; @@ -176,6 +186,11 @@ namespace CalamityMod.NPCs public const int slowingDebuffResistanceMin = 1800; public int debuffResistanceTimer = 0; + // If a boss is affected by knockback and a timer for how long that boss is immune to knockback after being knocked back + public bool bossCanBeKnockedBack = false; + public const int knockbackResistanceMin = 180; + public int knockbackResistanceTimer = 0; + // Debuffs public int vaporfied = 0; public int timeSlow = 0; @@ -631,6 +646,18 @@ namespace CalamityMod.NPCs waterDamageMult *= 0.5; } + if (IncreasedHeatEffects) + heatDamageMult += 0.5; + + if (IncreasedColdEffects) + coldDamageMult += 0.5; + + if (IncreasedSicknessAndWaterEffects) + { + sicknessDamageMult += 0.5; + waterDamageMult += 0.5; + } + // Subtract 1 for the vanilla damage multiplier because it's already dealing DoT in the vanilla regen code. double vanillaHeatDamageMult = heatDamageMult - 1D; double vanillaColdDamageMult = coldDamageMult - 1D; @@ -840,7 +867,8 @@ namespace CalamityMod.NPCs DR = newDR; } - if (CalamityMod.bossKillTimes.ContainsKey(npc.type)) + // Aquatic Scourge sets kill time in AI, not here. + if (CalamityMod.bossKillTimes.ContainsKey(npc.type) && !CalamityLists.AquaticScourgeIDs.Contains(npc.type)) { CalamityMod.bossKillTimes.TryGetValue(npc.type, out int revKillTime); KillTime = revKillTime; @@ -1411,15 +1439,15 @@ namespace CalamityMod.NPCs case NPCID.SandsharkCorrupt: case NPCID.SandsharkCrimson: case NPCID.SandsharkHallow: - case NPCID.SandElemental: VulnerableToCold = true; VulnerableToSickness = true; VulnerableToWater = true; break; - // Scorpions. + // Scorpions and sand elemental. case NPCID.DesertScorpionWalk: case NPCID.DesertScorpionWall: + case NPCID.SandElemental: VulnerableToCold = true; VulnerableToSickness = false; VulnerableToWater = true; @@ -3777,6 +3805,8 @@ namespace CalamityMod.NPCs // Debuff decrements if (debuffResistanceTimer > 0) debuffResistanceTimer--; + if (knockbackResistanceTimer > 0) + knockbackResistanceTimer--; if (timeSlow > 0) timeSlow--; @@ -4035,16 +4065,6 @@ namespace CalamityMod.NPCs if (item.melee && item.type != ItemType() && item.type != ItemType()) damage = (int)(damage * damageMult); } - else if (npc.type == NPCType()) - { - if (item.type == ItemType()) - damage = (int)(damage * 0.75); - } - else if (npc.type == NPCType()) - { - if (item.type == ItemType()) - damage = (int)(damage * 0.75); - } } #endregion @@ -4598,9 +4618,6 @@ namespace CalamityMod.NPCs if (CalamityWorld.revenge) spawnRate = (int)(spawnRate * 0.85); - if (CalamityWorld.demonMode) - spawnRate = (int)(spawnRate * 0.75); - if (Main.waterCandles > 0) { spawnRate = (int)(spawnRate * 0.9); diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index 56e061400c..3da5edca2e 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -2,7 +2,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.CalPlayer; using CalamityMod.Events; using CalamityMod.Items.Accessories; -using CalamityMod.Items.DifficultyItems; using CalamityMod.Items.LoreItems; using CalamityMod.Items.Materials; using CalamityMod.Items.PermanentBoosters; @@ -75,9 +74,6 @@ namespace CalamityMod.NPCs bool mechLore = !NPC.downedMechBossAny && (lastTwinStanding || npc.type == NPCID.TheDestroyer || npc.type == NPCID.SkeletronPrime); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, mechLore); - if (CalamityWorld.armageddon) - ArmageddonLoot(npc); - if (npc.type == NPCID.KingSlime) { // Drop a huge spray of Gel items @@ -86,33 +82,34 @@ namespace CalamityMod.NPCs int maxGel = 100; DropHelper.DropItemSpray(npc, ItemID.Gel, minGel, maxGel, 4); - // Legendary drop for King Slime - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); + DropHelper.DropItemCondition(npc, ItemID.RoyalGel, true, !Main.expertMode); + DropHelper.DropItemCondition(npc, ModContent.ItemType(), !Main.expertMode, DropHelper.NormalWeaponDropRateFloat); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !NPC.downedSlimeKing); SetNewShopVariable(new int[] { NPCID.Dryad }, NPC.downedSlimeKing); - CalamityGlobalNPC.SetNewBossJustDowned(npc); + SetNewBossJustDowned(npc); } else if (npc.type == NPCID.EyeofCthulhu) { - // Legendary drops for Eye of Cthulhu - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); + DropHelper.DropItemCondition(npc, ItemID.EoCShield, true, !Main.expertMode); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), !Main.expertMode, DropHelper.NormalWeaponDropRateFloat, 1, 1); + DropHelper.DropItemCondition(npc, ModContent.ItemType(), !Main.expertMode, DropHelper.NormalWeaponDropRateFloat); + + DropHelper.DropItemCondition(npc, ModContent.ItemType(), !Main.expertMode, DropHelper.NormalWeaponDropRateFloat); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !NPC.downedBoss1); SetNewShopVariable(new int[] { NPCID.Merchant, NPCID.Dryad, NPCID.Demolitionist }, NPC.downedBoss1); - CalamityGlobalNPC.SetNewBossJustDowned(npc); + SetNewBossJustDowned(npc); } else if ((npc.boss && (npc.type == NPCID.EaterofWorldsHead || npc.type == NPCID.EaterofWorldsBody || npc.type == NPCID.EaterofWorldsTail)) || npc.type == NPCID.BrainofCthulhu) { + DropHelper.DropItemCondition(npc, npc.type == NPCID.BrainofCthulhu ? ItemID.BrainOfConfusion : ItemID.WormScarf, true, !Main.expertMode); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !WorldGen.crimson && !NPC.downedBoss2); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !WorldGen.crimson && !NPC.downedBoss2); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, WorldGen.crimson && !NPC.downedBoss2); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, WorldGen.crimson && !NPC.downedBoss2); SetNewShopVariable(new int[] { NPCID.Merchant, NPCID.ArmsDealer, NPCID.Dryad, NPCID.Demolitionist }, NPC.downedBoss2); - CalamityGlobalNPC.SetNewBossJustDowned(npc); + SetNewBossJustDowned(npc); } else if (npc.type == NPCID.QueenBee) { @@ -123,33 +120,33 @@ namespace CalamityMod.NPCs { ItemID.BeeKeeper, ItemID.BeesKnees, - ItemID.BeeGun, + ItemID.BeeGun }; // It's already 33.33% in vanilla normal, so we shouldn't lower the drop rate to 25% DropHelper.DropEntireSet(npc, DropHelper.BagWeaponDropRateFloat, queenBeeWeapons); DropHelper.BlockDrops(queenBeeWeapons); } + DropHelper.DropItemCondition(npc, ItemID.HiveBackpack, true, !Main.expertMode); + + DropHelper.DropItemCondition(npc, ModContent.ItemType(), !Main.expertMode, DropHelper.NormalWeaponDropRateFloat); + DropHelper.DropItemCondition(npc, ItemID.Stinger, !Main.expertMode, 5, 10); // Extra stingers DropHelper.DropItemCondition(npc, ModContent.ItemType(), !Main.expertMode, 30, 50); - // Legendary drop for Queen Bee - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !NPC.downedQueenBee); SetNewShopVariable(new int[] { NPCID.ArmsDealer, NPCID.Dryad }, NPC.downedQueenBee); - CalamityGlobalNPC.SetNewBossJustDowned(npc); + SetNewBossJustDowned(npc); } else if (npc.type == NPCID.SkeletronHead) { DropHelper.DropItemSpray(npc, ItemID.Bone, 70, 100, 5); - // Legendary drop for Skeletron - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); + DropHelper.DropItemCondition(npc, ItemID.BoneGlove, true, !Main.expertMode); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !NPC.downedBoss3); SetNewShopVariable(new int[] { NPCID.Merchant, NPCID.Dryad, NPCID.Demolitionist }, NPC.downedBoss3); - CalamityGlobalNPC.SetNewBossJustDowned(npc); + SetNewBossJustDowned(npc); } else if (npc.type == NPCID.WallofFlesh) { @@ -164,6 +161,7 @@ namespace CalamityMod.NPCs ItemID.LaserRifle, ModContent.ItemType(), ModContent.ItemType(), + ModContent.ItemType() }; DropHelper.DropEntireSet(npc, DropHelper.NormalWeaponDropRateFloat, wofWeapons); DropHelper.BlockDrops(wofWeapons); @@ -181,22 +179,16 @@ namespace CalamityMod.NPCs DropHelper.BlockDrops(emblems); } - // Drop Demon Trophy directly if it hasn't been used yet and Expert Mode is not active. - DropHelper.DropItemCondition(npc, ModContent.ItemType(), !Main.expertMode && !CalamityWorld.demonMode); - // Drop Hermit's Box directly for EACH player, regardles of Expert or not. 100% chance on first kill, 10% chance afterwards. float hermitBoxChance = Main.hardMode ? 1f : 0.1f; DropHelper.DropItemChance(npc, ModContent.ItemType(), true, hermitBoxChance); - DropHelper.DropItemFromSetCondition(npc, !Main.expertMode, 0.2f, ItemID.CorruptionKey, ItemID.CrimsonKey); - - // Legendary drop for Wall of Flesh - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); + DropHelper.DropItemFromSetChance(npc, DropHelper.BagWeaponDropRateFloat, ItemID.CorruptionKey, ItemID.CrimsonKey); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !Main.hardMode); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !Main.hardMode); SetNewShopVariable(new int[] { NPCID.Merchant, NPCID.ArmsDealer, NPCID.Dryad, NPCID.Painter, NPCID.WitchDoctor, NPCID.Stylist, NPCID.DyeTrader, NPCID.Demolitionist, NPCID.PartyGirl, NPCID.Clothier, NPCID.SkeletonMerchant, ModContent.NPCType() }, Main.hardMode); - CalamityGlobalNPC.SetNewBossJustDowned(npc); + SetNewBossJustDowned(npc); // First kill text (this is not a loot function) if (!Main.hardMode) @@ -225,16 +217,17 @@ namespace CalamityMod.NPCs if ((!NPC.downedMechBoss1 || !NPC.downedMechBoss2 || !NPC.downedMechBoss3) && CalamityConfig.Instance.EarlyHardmodeProgressionRework) DropHelper.BlockDrops(ItemID.HallowedBar); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), Main.expertMode, CalamityGlobalNPC.DraedonMayhem, 8, 16); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), Main.expertMode, CalamityGlobalNPC.DraedonMayhem, 8, 16); + DropHelper.DropItemCondition(npc, ItemID.MechanicalWheelPiece, true, !Main.expertMode); - // Legendary drop for Twins - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); + DropHelper.DropItemCondition(npc, ModContent.ItemType(), Main.expertMode, DraedonMayhem, 8, 16); + DropHelper.DropItemCondition(npc, ModContent.ItemType(), Main.expertMode, DraedonMayhem, 8, 16); + + DropHelper.DropItemCondition(npc, ModContent.ItemType(), !Main.expertMode, DropHelper.NormalWeaponDropRateFloat); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !NPC.downedMechBoss2); SetNewShopVariable(new int[] { NPCID.DD2Bartender, NPCID.Stylist, NPCID.Truffle, ModContent.NPCType() }, NPC.downedMechBossAny); SetNewShopVariable(new int[] { NPCID.Stylist, ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType() }, !NPC.downedMechBoss1 || NPC.downedMechBoss2 || !NPC.downedMechBoss3); - CalamityGlobalNPC.SetNewBossJustDowned(npc); + SetNewBossJustDowned(npc); if (!NPC.downedMechBoss2 && CalamityConfig.Instance.EarlyHardmodeProgressionRework) SpawnMechBossHardmodeOres(); @@ -245,16 +238,17 @@ namespace CalamityMod.NPCs if ((!NPC.downedMechBoss1 || !NPC.downedMechBoss2 || !NPC.downedMechBoss3) && CalamityConfig.Instance.EarlyHardmodeProgressionRework) DropHelper.BlockDrops(ItemID.HallowedBar); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), Main.expertMode, CalamityGlobalNPC.DraedonMayhem, 8, 16); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), Main.expertMode, CalamityGlobalNPC.DraedonMayhem, 8, 16); + DropHelper.DropItemCondition(npc, ItemID.MechanicalWagonPiece, true, !Main.expertMode); - // Legendary drop for Destroyer - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); + DropHelper.DropItemCondition(npc, ModContent.ItemType(), Main.expertMode, DraedonMayhem, 8, 16); + DropHelper.DropItemCondition(npc, ModContent.ItemType(), Main.expertMode, DraedonMayhem, 8, 16); + + DropHelper.DropItemCondition(npc, ModContent.ItemType(), !Main.expertMode, DropHelper.NormalWeaponDropRateFloat); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !NPC.downedMechBoss1); SetNewShopVariable(new int[] { NPCID.DD2Bartender, NPCID.Stylist, NPCID.Truffle, ModContent.NPCType() }, NPC.downedMechBossAny); SetNewShopVariable(new int[] { NPCID.Stylist, ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType() }, NPC.downedMechBoss1 || !NPC.downedMechBoss2 || !NPC.downedMechBoss3); - CalamityGlobalNPC.SetNewBossJustDowned(npc); + SetNewBossJustDowned(npc); if (!NPC.downedMechBoss1 && CalamityConfig.Instance.EarlyHardmodeProgressionRework) SpawnMechBossHardmodeOres(); @@ -265,17 +259,15 @@ namespace CalamityMod.NPCs if ((!NPC.downedMechBoss1 || !NPC.downedMechBoss2 || !NPC.downedMechBoss3) && CalamityConfig.Instance.EarlyHardmodeProgressionRework) DropHelper.BlockDrops(ItemID.HallowedBar); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), Main.expertMode, CalamityGlobalNPC.DraedonMayhem, 8, 16); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), Main.expertMode, CalamityGlobalNPC.DraedonMayhem, 8, 16); + DropHelper.DropItemCondition(npc, ItemID.MechanicalBatteryPiece, true, !Main.expertMode); - // Legendary drop for Skeletron Prime - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); + DropHelper.DropItemCondition(npc, ModContent.ItemType(), Main.expertMode, DraedonMayhem, 8, 16); + DropHelper.DropItemCondition(npc, ModContent.ItemType(), Main.expertMode, DraedonMayhem, 8, 16); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !NPC.downedMechBoss3); SetNewShopVariable(new int[] { NPCID.DD2Bartender, NPCID.Stylist, NPCID.Truffle, ModContent.NPCType() }, NPC.downedMechBossAny); SetNewShopVariable(new int[] { NPCID.Stylist, ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType() }, !NPC.downedMechBoss1 || !NPC.downedMechBoss2 || NPC.downedMechBoss3); - CalamityGlobalNPC.SetNewBossJustDowned(npc); + SetNewBossJustDowned(npc); if (!NPC.downedMechBoss3 && CalamityConfig.Instance.EarlyHardmodeProgressionRework) SpawnMechBossHardmodeOres(); @@ -293,25 +285,22 @@ namespace CalamityMod.NPCs ItemID.VenusMagnum, ItemID.LeafBlower, ItemID.NettleBurst, - ItemID.WaspGun + ItemID.WaspGun, + ModContent.ItemType(), + ModContent.ItemType() }; DropHelper.DropEntireSet(npc, DropHelper.NormalWeaponDropRateFloat, planteraWeapons); DropHelper.BlockDrops(planteraWeapons); - - // Equipment - DropHelper.DropItemChance(npc, ModContent.ItemType(), 5); } - DropHelper.DropItemCondition(npc, ModContent.ItemType(), !Main.expertMode, 12, 18); - DropHelper.DropItemCondition(npc, ItemID.JungleKey, !Main.expertMode, 5, 1, 1); + DropHelper.DropItemCondition(npc, ItemID.SporeSac, true, !Main.expertMode); - // Legendary drop for Plantera - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); + DropHelper.DropItemCondition(npc, ModContent.ItemType(), !Main.expertMode, 12, 18); + DropHelper.DropItemChance(npc, ItemID.JungleKey, 3); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !NPC.downedPlantBoss); SetNewShopVariable(new int[] { NPCID.WitchDoctor, NPCID.Truffle, ModContent.NPCType(), ModContent.NPCType() }, NPC.downedPlantBoss); - CalamityGlobalNPC.SetNewBossJustDowned(npc); + SetNewBossJustDowned(npc); // Spawn Perennial Ore if Plantera has never been killed if (!NPC.downedPlantBoss) @@ -356,6 +345,7 @@ namespace CalamityMod.NPCs ItemID.StaffofEarth, ItemID.EyeoftheGolem, ItemID.SunStone, + ModContent.ItemType() }; DropHelper.DropEntireSet(npc, DropHelper.NormalWeaponDropRateFloat, golemItems); DropHelper.BlockDrops(golemItems); @@ -365,15 +355,13 @@ namespace CalamityMod.NPCs // The Golem Treasure Bag is guaranteed to provide a Picksaw if one is not yet in the inventory. DropHelper.DropItemCondition(npc, ItemID.Picksaw, true, !Main.expertMode && !NPC.downedGolemBoss); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), !Main.expertMode, 5, 10); + DropHelper.DropItemCondition(npc, ItemID.ShinyStone, true, !Main.expertMode); - // Legendary drop for Golem - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); + DropHelper.DropItemCondition(npc, ModContent.ItemType(), !Main.expertMode, 5, 10); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !NPC.downedGolemBoss); SetNewShopVariable(new int[] { NPCID.ArmsDealer, NPCID.Cyborg, NPCID.Steampunker, NPCID.Wizard, NPCID.WitchDoctor, NPCID.DD2Bartender, ModContent.NPCType(), ModContent.NPCType() }, NPC.downedGolemBoss); - CalamityGlobalNPC.SetNewBossJustDowned(npc); + SetNewBossJustDowned(npc); // If Golem has never been killed, send a message about the Plague. if (!NPC.downedGolemBoss) @@ -416,27 +404,24 @@ namespace CalamityMod.NPCs ItemID.BubbleGun, ItemID.RazorbladeTyphoon, ItemID.TempestStaff, + ItemID.FishronWings, ModContent.ItemType(), + ModContent.ItemType() }; DropHelper.DropEntireSet(npc, DropHelper.NormalWeaponDropRateFloat, dukeWeapons); DropHelper.BlockDrops(dukeWeapons); } - // Legendary drop for Duke Fishron - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); + DropHelper.DropItemCondition(npc, ItemID.ShrimpyTruffle, true, !Main.expertMode); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !NPC.downedFishron); - CalamityGlobalNPC.SetNewBossJustDowned(npc); + SetNewBossJustDowned(npc); } else if (npc.type == NPCID.CultistBoss) { - // Legendary drops for Cultist - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !NPC.downedAncientCultist); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, Main.bloodMoon); - CalamityGlobalNPC.SetNewBossJustDowned(npc); + SetNewBossJustDowned(npc); // Deus text (this is not a loot function) if (!NPC.downedAncientCultist) @@ -470,19 +455,15 @@ namespace CalamityMod.NPCs DropHelper.BlockDrops(moonLordWeapons); } - // Gravity Globe is available to Normal players as well - DropHelper.DropItemCondition(npc, ItemID.GravityGlobe, !Main.expertMode); + DropHelper.DropItemCondition(npc, ItemID.GravityGlobe, true, !Main.expertMode); + DropHelper.DropItemCondition(npc, ItemID.SuspiciousLookingTentacle, true, !Main.expertMode); // One Celestial Onion is given to each player individually DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !Main.expertMode); - // Legendary drops for Moon Lord - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !NPC.downedMoonlord); SetNewShopVariable(new int[] { ModContent.NPCType() }, NPC.downedMoonlord); - CalamityGlobalNPC.SetNewBossJustDowned(npc); + SetNewBossJustDowned(npc); string key = "Mods.CalamityMod.MoonBossText"; Color messageColor = Color.Orange; @@ -518,6 +499,10 @@ namespace CalamityMod.NPCs CalamityUtils.DisplayLocalizedText(key4, messageColor4); } } + else if (npc.type == NPCID.Clothier) + { + DropHelper.DropItemCondition(npc, ModContent.ItemType(), Main.hardMode); + } else if (npc.type == NPCID.RedDevil) { DropHelper.DropItemChance(npc, ItemID.FireFeather, 0.1f); @@ -727,50 +712,6 @@ namespace CalamityMod.NPCs } #endregion - #region Armageddon Loot - private void ArmageddonLoot(NPC npc) - { - switch (npc.type) - { - case NPCID.EaterofWorldsHead: - case NPCID.EaterofWorldsBody: - case NPCID.EaterofWorldsTail: - if (npc.boss) // only drop from the 1 "boss" segment (redcode) - DropHelper.DropArmageddonBags(npc); - break; - - case NPCID.Retinazer: // only drop if spaz is already dead - if (!NPC.AnyNPCs(NPCID.Spazmatism)) - DropHelper.DropArmageddonBags(npc); - break; - - case NPCID.Spazmatism: // only drop if ret is already dead - if (!NPC.AnyNPCs(NPCID.Retinazer)) - DropHelper.DropArmageddonBags(npc); - break; - - case NPCID.KingSlime: - case NPCID.EyeofCthulhu: - case NPCID.BrainofCthulhu: - case NPCID.QueenBee: - case NPCID.SkeletronHead: - case NPCID.WallofFlesh: - case NPCID.TheDestroyer: - case NPCID.SkeletronPrime: - case NPCID.Plantera: - case NPCID.Golem: - case NPCID.DD2Betsy: - case NPCID.DukeFishron: - case NPCID.MoonLordCore: - DropHelper.DropArmageddonBags(npc); - break; - - default: - break; - } - } - #endregion - #region NPCLoot public override void NPCLoot(NPC npc) { diff --git a/NPCs/CalamityGlobalTownNPC.cs b/NPCs/CalamityGlobalTownNPC.cs index a5676f2278..7435d91ab9 100644 --- a/NPCs/CalamityGlobalTownNPC.cs +++ b/NPCs/CalamityGlobalTownNPC.cs @@ -1317,6 +1317,7 @@ namespace CalamityMod.NPCs SetShopItem(ref shop, ref nextSlot, ItemType(), price: Item.buyPrice(copper: 10)); SetShopItem(ref shop, ref nextSlot, ItemType(), price: Item.buyPrice(copper: 10)); SetShopItem(ref shop, ref nextSlot, ItemType(), price: Item.buyPrice(copper: 10)); + SetShopItem(ref shop, ref nextSlot, ItemType(), price: Item.buyPrice(gold: 10)); SetShopItem(ref shop, ref nextSlot, ItemID.GoldenKey, Main.hardMode, Item.buyPrice(0, 5)); } diff --git a/NPCs/CeaselessVoid/CeaselessVoid.cs b/NPCs/CeaselessVoid/CeaselessVoid.cs index 867be500db..0acff858ed 100644 --- a/NPCs/CeaselessVoid/CeaselessVoid.cs +++ b/NPCs/CeaselessVoid/CeaselessVoid.cs @@ -164,9 +164,6 @@ namespace CalamityMod.NPCs.CeaselessVoid DropHelper.DropBags(npc); - // Legendary drop for Ceaseless Void - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); - DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); bool lastSentinelKilled = !CalamityWorld.downedSentinel1 && CalamityWorld.downedSentinel2 && CalamityWorld.downedSentinel3; DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, lastSentinelKilled); @@ -181,6 +178,9 @@ namespace CalamityMod.NPCs.CeaselessVoid DropHelper.DropItemChance(npc, ModContent.ItemType(), dropChance); DropHelper.DropItemChance(npc, ModContent.ItemType(), dropChance); + // Equipment + DropHelper.DropItem(npc, ModContent.ItemType(), true); + // Vanity DropHelper.DropItemChance(npc, ModContent.ItemType(), 7); if (Main.rand.NextBool(20)) diff --git a/NPCs/Crabulon/CrabulonIdle.cs b/NPCs/Crabulon/CrabulonIdle.cs index 4c6b59cc12..aa0c332e85 100644 --- a/NPCs/Crabulon/CrabulonIdle.cs +++ b/NPCs/Crabulon/CrabulonIdle.cs @@ -731,9 +731,6 @@ namespace CalamityMod.NPCs.Crabulon DropHelper.DropBags(npc); - // Legendary drop for Crabulon - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); - DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !CalamityWorld.downedCrabulon); @@ -754,8 +751,11 @@ namespace CalamityMod.NPCs.Crabulon DropHelper.WeightStack(w) ); - // Vanity - DropHelper.DropItemChance(npc, ModContent.ItemType(), 7); + // Equipment + DropHelper.DropItem(npc, ModContent.ItemType(), true); + + // Vanity + DropHelper.DropItemChance(npc, ModContent.ItemType(), 7); } // Mark Crabulon as dead diff --git a/NPCs/Crags/Scryllar.cs b/NPCs/Crags/Scryllar.cs index 63d0b46ca0..a0a405db5e 100644 --- a/NPCs/Crags/Scryllar.cs +++ b/NPCs/Crags/Scryllar.cs @@ -2,10 +2,12 @@ using CalamityMod.Dusts; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; +using CalamityMod.Items.Weapons.Summon; using CalamityMod.World; using Terraria; using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.NPCs.Crags { public class Scryllar : ModNPC @@ -255,7 +257,8 @@ namespace CalamityMod.NPCs.Crags public override void NPCLoot() { - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedProvidence, 2, 1, 1); + DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedProvidence, 20, 1, 1); + DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedProvidence, 2, 1, 1); DropHelper.DropItemCondition(npc, ModContent.ItemType(), Main.hardMode, 3, 1, 1); } diff --git a/NPCs/Crags/ScryllarRage.cs b/NPCs/Crags/ScryllarRage.cs index b37fdedaa5..db8f0add26 100644 --- a/NPCs/Crags/ScryllarRage.cs +++ b/NPCs/Crags/ScryllarRage.cs @@ -2,10 +2,12 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; +using CalamityMod.Items.Weapons.Summon; using CalamityMod.World; using Terraria; using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.NPCs.Crags { public class ScryllarRage : ModNPC @@ -255,7 +257,8 @@ namespace CalamityMod.NPCs.Crags public override void NPCLoot() { - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedProvidence, 2, 1, 1); + DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedProvidence, 20, 1, 1); + DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedProvidence, 2, 1, 1); DropHelper.DropItemCondition(npc, ModContent.ItemType(), Main.hardMode, 3, 1, 1); } diff --git a/NPCs/Cryogen/Cryogen.cs b/NPCs/Cryogen/Cryogen.cs index 133e295fac..04a96d098c 100644 --- a/NPCs/Cryogen/Cryogen.cs +++ b/NPCs/Cryogen/Cryogen.cs @@ -1,5 +1,6 @@ using CalamityMod.Events; using CalamityMod.Items.Accessories; +using CalamityMod.Items.Accessories.Wings; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; using CalamityMod.Items.Materials; @@ -1053,10 +1054,6 @@ namespace CalamityMod.NPCs.Cryogen DropHelper.DropBags(npc); - // Legendary drops for Cryogen - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); - DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !CalamityWorld.downedCryogen); @@ -1073,22 +1070,24 @@ namespace CalamityMod.NPCs.Cryogen DropHelper.WeightStack(w), DropHelper.WeightStack(w), DropHelper.WeightStack(w), - DropHelper.WeightStack(w) - ); + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w) + ); // Equipment - DropHelper.DropItemChance(npc, ModContent.ItemType(), 5); - DropHelper.DropItemChance(npc, ModContent.ItemType(), 5); + DropHelper.DropItem(npc, ModContent.ItemType(), true); // Vanity DropHelper.DropItemChance(npc, ModContent.ItemType(), 7); - - // Other - DropHelper.DropItemChance(npc, ItemID.FrozenKey, 5); } - // Spawn Permafrost if he isn't in the world - int permafrostNPC = NPC.FindFirstNPC(ModContent.NPCType()); + // Other + DropHelper.DropItemChance(npc, ItemID.FrozenKey, 3); + + // Spawn Permafrost if he isn't in the world + int permafrostNPC = NPC.FindFirstNPC(ModContent.NPCType()); if (permafrostNPC == -1 && Main.netMode != NetmodeID.MultiplayerClient) { NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); diff --git a/NPCs/DesertScourge/DesertScourgeHead.cs b/NPCs/DesertScourge/DesertScourgeHead.cs index f001e4519b..19acf6793f 100644 --- a/NPCs/DesertScourge/DesertScourgeHead.cs +++ b/NPCs/DesertScourge/DesertScourgeHead.cs @@ -570,9 +570,6 @@ namespace CalamityMod.NPCs.DesertScourge DropHelper.DropBags(npc); - // Legendary drop for Desert Scourge - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); - DropHelper.DropItem(npc, ItemID.LesserHealingPotion, 8, 14); DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !CalamityWorld.downedDesertScourge); @@ -594,12 +591,13 @@ namespace CalamityMod.NPCs.DesertScourge DropHelper.WeightStack(w), DropHelper.WeightStack(w), DropHelper.WeightStack(w), - DropHelper.WeightStack(w) - ); + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w) + ); - // Equipment - DropHelper.DropItemChance(npc, ModContent.ItemType(), 5); - DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); + // Equipment + DropHelper.DropItem(npc, ModContent.ItemType(), true); // Vanity DropHelper.DropItemChance(npc, ModContent.ItemType(), 7); diff --git a/NPCs/DevourerofGods/DevourerofGodsBody.cs b/NPCs/DevourerofGods/DevourerofGodsBody.cs index 82f6c9fdfa..15a3d1de45 100644 --- a/NPCs/DevourerofGods/DevourerofGodsBody.cs +++ b/NPCs/DevourerofGods/DevourerofGodsBody.cs @@ -68,16 +68,24 @@ namespace CalamityMod.NPCs.DevourerofGods public override void BossHeadSlot(ref int index) { - if (phase2Started && CalamityWorld.DoGSecondStageCountdown <= 60) - index = phase2IconIndex; - else + NPC head = CalamityGlobalNPC.DoGHead >= 0 ? Main.npc[CalamityGlobalNPC.DoGHead] : null; + DevourerofGodsHead modNPC = head?.ModNPC() ?? null; + if (head is null || modNPC.AwaitingPhase2Teleport || !modNPC.Phase2Started) + { index = -1; + return; + } + index = phase2IconIndex; } public override void BossHeadRotation(ref float rotation) { - if (phase2Started && CalamityWorld.DoGSecondStageCountdown <= 60) - rotation = npc.rotation; + NPC head = CalamityGlobalNPC.DoGHead >= 0 ? Main.npc[CalamityGlobalNPC.DoGHead] : null; + DevourerofGodsHead modNPC = head?.ModNPC() ?? null; + if (head is null || modNPC.AwaitingPhase2Teleport || !modNPC.Phase2Started) + return; + + rotation = npc.rotation; } public override void SendExtraAI(BinaryWriter writer) @@ -339,7 +347,7 @@ namespace CalamityMod.NPCs.DevourerofGods } return false; } - return !CalamityUtils.AntiButcher(npc, ref damage, 0.5f); + return true; } public override bool CheckDead() diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index e5de8eed89..3375adc44d 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -3,6 +3,7 @@ using CalamityMod.Buffs.StatDebuffs; using CalamityMod.CalPlayer; using CalamityMod.Dusts; using CalamityMod.Events; +using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; using CalamityMod.Items.Materials; @@ -83,7 +84,8 @@ namespace CalamityMod.NPCs.DevourerofGods private bool spawnedGuardians2 = false; private int spawnDoGCountdown = 0; private bool hasCreatedPhase1Portal = false; - private bool phase2Started = false; + public bool Phase2Started = false; + public bool AwaitingPhase2Teleport = true; // Phase 2 variables @@ -161,9 +163,9 @@ namespace CalamityMod.NPCs.DevourerofGods public override void BossHeadSlot(ref int index) { - if (phase2Started && CalamityWorld.DoGSecondStageCountdown > 60) + if (Phase2Started && (CalamityWorld.DoGSecondStageCountdown > 60 || AwaitingPhase2Teleport)) index = -1; - else if (phase2Started) + else if (Phase2Started && !AwaitingPhase2Teleport) index = phase2IconIndex; else index = phase1IconIndex; @@ -171,7 +173,7 @@ namespace CalamityMod.NPCs.DevourerofGods public override void BossHeadRotation(ref float rotation) { - if (phase2Started && CalamityWorld.DoGSecondStageCountdown <= 60) + if (Phase2Started && CalamityWorld.DoGSecondStageCountdown <= 60) rotation = npc.rotation; } @@ -182,8 +184,9 @@ namespace CalamityMod.NPCs.DevourerofGods writer.Write(spawnedGuardians); writer.Write(spawnedGuardians2); writer.Write(spawnedGuardians3); - writer.Write(phase2Started); + writer.Write(Phase2Started); writer.Write(hasCreatedPhase1Portal); + writer.Write(AwaitingPhase2Teleport); writer.Write(spawnDoGCountdown); writer.Write(shotSpacing); writer.Write(laserWallType); @@ -217,8 +220,9 @@ namespace CalamityMod.NPCs.DevourerofGods spawnedGuardians = reader.ReadBoolean(); spawnedGuardians2 = reader.ReadBoolean(); spawnedGuardians3 = reader.ReadBoolean(); - phase2Started = reader.ReadBoolean(); + Phase2Started = reader.ReadBoolean(); hasCreatedPhase1Portal = reader.ReadBoolean(); + AwaitingPhase2Teleport = reader.ReadBoolean(); spawnDoGCountdown = reader.ReadInt32(); shotSpacing = reader.ReadInt32(); laserWallType = reader.ReadInt32(); @@ -347,12 +351,25 @@ namespace CalamityMod.NPCs.DevourerofGods if (CalamityWorld.DoGSecondStageCountdown > 0) npc.Calamity().ShouldCloseHPBar = true; + // Teleport after the Phase 2 animation. + if (CalamityWorld.DoGSecondStageCountdown == 61) + Teleport(player, false, false, false, false, false); + + // Be invincibile until the phase 2 teleport happens. + // This is done to prevent DoG from suddenly and weirdly re-appearing after entering the phase 1 portal. + // Once the teleport happens he will be in position and this effect stops. + if (Phase2Started && AwaitingPhase2Teleport && CalamityWorld.DoGSecondStageCountdown < 60) + { + npc.Opacity = 0f; + npc.dontTakeDamage = true; + } + // Start sentinel phases, only run things that have to happen once in here if (summonSentinels) { - if (!phase2Started) + if (!Phase2Started) { - phase2Started = true; + Phase2Started = true; // Timed DR and aggression calamityGlobalNPC.AITimer = CalamityGlobalNPC.DoGPhase1KillTime; @@ -387,7 +404,6 @@ namespace CalamityMod.NPCs.DevourerofGods npc.height = 186; npc.position -= npc.Size * 0.5f; npc.frame = new Rectangle(0, 0, 134, 196); - npc.alpha = 0; } // Dialogue the moment the second phase starts @@ -400,10 +416,10 @@ namespace CalamityMod.NPCs.DevourerofGods } // Begin phase 2 once all sentinels are down - if (phase2Started) + if (Phase2Started) { // Go immune and invisible if sentinels are alive - if (CalamityWorld.DoGSecondStageCountdown > 60) + if (CalamityWorld.DoGSecondStageCountdown > 5) { // Don't take damage npc.dontTakeDamage = true; @@ -437,6 +453,10 @@ namespace CalamityMod.NPCs.DevourerofGods Main.projectile[PortalIndex].Center = npc.Center + npc.SafeDirectionTo(Main.projectile[PortalIndex].Center) * npc.Distance(Main.projectile[PortalIndex].Center); } + // Remain invisible during the transition. + if (CalamityWorld.DoGSecondStageCountdown < 60) + npc.Opacity = 0f; + if (Main.netMode != NetmodeID.MultiplayerClient && !hasCreatedPhase1Portal) { Vector2 portalSpawnPosition = npc.Center + npc.velocity.SafeNormalize(-Vector2.UnitY) * 1000f; @@ -1984,8 +2004,8 @@ namespace CalamityMod.NPCs.DevourerofGods private void Teleport(Player player, bool malice, bool death, bool revenge, bool expertMode, bool phase5) { Vector2 newPosition = GetRiftLocation(true); - - if (player.dead || !player.active || newPosition == default) + + if ((!AwaitingPhase2Teleport && (player.dead || !player.active)) || newPosition == default) return; if (phase5) @@ -2022,6 +2042,7 @@ namespace CalamityMod.NPCs.DevourerofGods float chargeVelocity = malice ? 30f : death ? 26f : revenge ? 24f : expertMode ? 22f : 20f; float maxChargeDistance = 1600f; postTeleportTimer = (int)Math.Round(maxChargeDistance / chargeVelocity); + AwaitingPhase2Teleport = false; npc.alpha = postTeleportTimer; npc.velocity = Vector2.Normalize(player.Center + player.velocity * 40f - npc.Center) * chargeVelocity; npc.netUpdate = true; @@ -2155,7 +2176,7 @@ namespace CalamityMod.NPCs.DevourerofGods { for (int i = 0; i < Main.maxProjectiles; i++) { - if (Main.projectile[i].type == ModContent.ProjectileType() || Main.projectile[i].type == ModContent.ProjectileType()) + if (Main.projectile[i].type == ModContent.ProjectileType()) { if (!spawnDust) Main.projectile[i].ai[0] = -1f; @@ -2183,7 +2204,7 @@ namespace CalamityMod.NPCs.DevourerofGods if (npc.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - bool useOtherTextures = phase2Started && CalamityWorld.DoGSecondStageCountdown <= 60; + bool useOtherTextures = Phase2Started && CalamityWorld.DoGSecondStageCountdown <= 60; Texture2D texture2D15 = useOtherTextures ? ModContent.GetTexture("CalamityMod/NPCs/DevourerofGods/DevourerofGodsHeadS") : Main.npcTexture[npc.type]; Vector2 vector11 = new Vector2(texture2D15.Width / 2, texture2D15.Height / 2); @@ -2235,11 +2256,6 @@ namespace CalamityMod.NPCs.DevourerofGods DropHelper.DropBags(npc); - // Legendary drops for DoG - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); - DropHelper.DropItem(npc, ModContent.ItemType(), 5, 15); DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !CalamityWorld.downedDoG); @@ -2265,9 +2281,14 @@ namespace CalamityMod.NPCs.DevourerofGods DropHelper.WeightStack(w), DropHelper.WeightStack(w), DropHelper.WeightStack(w), - DropHelper.WeightStack(w) + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w) ); + // Equipment + DropHelper.DropItem(npc, ModContent.ItemType(), true); + // Vanity DropHelper.DropItemChance(npc, ModContent.ItemType(), 7); if (Main.rand.NextBool(5)) @@ -2317,19 +2338,11 @@ namespace CalamityMod.NPCs.DevourerofGods if (dist4 < minDist) minDist = dist4; - return minDist <= (phase2Started ? 80f : 55f) && (npc.alpha <= 0 || postTeleportTimer > 0) && preventBullshitHitsAtStartofFinalPhaseTimer <= 0; + return minDist <= (Phase2Started ? 80f : 55f) && (npc.alpha <= 0 || postTeleportTimer > 0) && preventBullshitHitsAtStartofFinalPhaseTimer <= 0; } public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) { - if (CalamityUtils.AntiButcher(npc, ref damage, 0.5f)) - { - string key = "Mods.CalamityMod.EdgyBossText2"; - Color messageColor = Color.Cyan; - CalamityUtils.DisplayLocalizedText(key, messageColor); - return false; - } - if (!Dying && (damage * (crit ? 2D : 1D)) >= npc.life) { damage = 0D; diff --git a/NPCs/DevourerofGods/DevourerofGodsTail.cs b/NPCs/DevourerofGods/DevourerofGodsTail.cs index e7196ee269..83297d6003 100644 --- a/NPCs/DevourerofGods/DevourerofGodsTail.cs +++ b/NPCs/DevourerofGods/DevourerofGodsTail.cs @@ -73,18 +73,31 @@ namespace CalamityMod.NPCs.DevourerofGods public override void BossHeadSlot(ref int index) { - if (phase2Started && CalamityWorld.DoGSecondStageCountdown > 60) - index = -1; - else if (phase2Started) - index = phase2IconIndex; - else + NPC head = CalamityGlobalNPC.DoGHead >= 0 ? Main.npc[CalamityGlobalNPC.DoGHead] : null; + DevourerofGodsHead modNPC = head?.ModNPC() ?? null; + + index = -1; + if (head is null) + return; + + if (!modNPC.Phase2Started) + { index = phase1IconIndex; + return; + } + + if (!modNPC.AwaitingPhase2Teleport) + index = phase2IconIndex; } public override void BossHeadRotation(ref float rotation) { - if (phase2Started && CalamityWorld.DoGSecondStageCountdown <= 60) - rotation = npc.rotation; + NPC head = CalamityGlobalNPC.DoGHead >= 0 ? Main.npc[CalamityGlobalNPC.DoGHead] : null; + DevourerofGodsHead modNPC = head?.ModNPC() ?? null; + if (head != null || modNPC.AwaitingPhase2Teleport || !modNPC.Phase2Started) + return; + + rotation = npc.rotation; } public override void SendExtraAI(BinaryWriter writer) @@ -387,7 +400,7 @@ namespace CalamityMod.NPCs.DevourerofGods } return false; } - return !CalamityUtils.AntiButcher(npc, ref damage, 0.5f); + return true; } public override bool CheckDead() diff --git a/NPCs/ExoMechs/Apollo/Apollo.cs b/NPCs/ExoMechs/Apollo/Apollo.cs index 56a9b33cf6..17ca36db2f 100644 --- a/NPCs/ExoMechs/Apollo/Apollo.cs +++ b/NPCs/ExoMechs/Apollo/Apollo.cs @@ -1367,8 +1367,6 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo return minDist <= 100f && npc.Opacity == 1f && AIState == (float)Phase.ChargeCombo; } - public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) => !CalamityUtils.AntiButcher(npc, ref damage, 0.5f); - public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) { scale = 2f; diff --git a/NPCs/ExoMechs/Ares/AresBody.cs b/NPCs/ExoMechs/Ares/AresBody.cs index c905ba89e7..1ad39aa60a 100644 --- a/NPCs/ExoMechs/Ares/AresBody.cs +++ b/NPCs/ExoMechs/Ares/AresBody.cs @@ -1,4 +1,5 @@ using CalamityMod.Events; +using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; using CalamityMod.Items.Materials; @@ -855,8 +856,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares public override bool CanHitPlayer(Player target, ref int cooldownSlot) => false; - public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) => !CalamityUtils.AntiButcher(npc, ref damage, 0.5f); - public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) { scale = 2f; @@ -1343,6 +1342,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } // Equipment + DropHelper.DropItem(npc, ModContent.ItemType(), true); DropHelper.DropItem(npc, ModContent.ItemType()); // Vanity diff --git a/NPCs/ExoMechs/Ares/AresGaussNuke.cs b/NPCs/ExoMechs/Ares/AresGaussNuke.cs index 7f47bfb0a3..888a209d5d 100644 --- a/NPCs/ExoMechs/Ares/AresGaussNuke.cs +++ b/NPCs/ExoMechs/Ares/AresGaussNuke.cs @@ -460,8 +460,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares public override bool CanHitPlayer(Player target, ref int cooldownSlot) => false; - public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) => !CalamityUtils.AntiButcher(npc, ref damage, 0.5f); - public override void FindFrame(int frameHeight) { // Use telegraph frames when using gauss nuke diff --git a/NPCs/ExoMechs/Ares/AresLaserCannon.cs b/NPCs/ExoMechs/Ares/AresLaserCannon.cs index f70aa5b909..7da5124e1c 100644 --- a/NPCs/ExoMechs/Ares/AresLaserCannon.cs +++ b/NPCs/ExoMechs/Ares/AresLaserCannon.cs @@ -531,8 +531,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares public override bool CanHitPlayer(Player target, ref int cooldownSlot) => false; - public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) => !CalamityUtils.AntiButcher(npc, ref damage, 0.5f); - public override void FindFrame(int frameHeight) { // Use telegraph frames when using deathrays diff --git a/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs b/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs index eee4351ff8..571913399a 100644 --- a/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs +++ b/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs @@ -459,8 +459,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares public override bool CanHitPlayer(Player target, ref int cooldownSlot) => false; - public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) => !CalamityUtils.AntiButcher(npc, ref damage, 0.5f); - public override void FindFrame(int frameHeight) { // Use telegraph frames when using plasma bolts diff --git a/NPCs/ExoMechs/Ares/AresTeslaCannon.cs b/NPCs/ExoMechs/Ares/AresTeslaCannon.cs index 30a96c4374..6d0a5e4ea3 100644 --- a/NPCs/ExoMechs/Ares/AresTeslaCannon.cs +++ b/NPCs/ExoMechs/Ares/AresTeslaCannon.cs @@ -453,8 +453,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares public override bool CanHitPlayer(Player target, ref int cooldownSlot) => false; - public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) => !CalamityUtils.AntiButcher(npc, ref damage, 0.5f); - public override void FindFrame(int frameHeight) { // Use telegraph frames when using tesla orbs diff --git a/NPCs/ExoMechs/Artemis/Artemis.cs b/NPCs/ExoMechs/Artemis/Artemis.cs index 5435b97c9c..4843c538a1 100644 --- a/NPCs/ExoMechs/Artemis/Artemis.cs +++ b/NPCs/ExoMechs/Artemis/Artemis.cs @@ -1173,8 +1173,6 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis return minDist <= 100f && npc.Opacity == 1f && AIState == (float)Phase.Charge; } - public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) => !CalamityUtils.AntiButcher(npc, ref damage, 0.5f); - public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) { scale = 2f; diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs index da401e926a..2fb64698d9 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs @@ -552,7 +552,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (npc.Calamity().newAI[2] < ThanatosHead.immunityTime) damage *= 0.01; - return !CalamityUtils.AntiButcher(npc, ref damage, 0.5f); + return true; } public override void FindFrame(int frameHeight) // 5 total frames diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs index 4f6372c794..3fc2e12074 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs @@ -553,7 +553,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (npc.Calamity().newAI[2] < ThanatosHead.immunityTime) damage *= 0.01; - return !CalamityUtils.AntiButcher(npc, ref damage, 0.5f); + return true; } public override void FindFrame(int frameHeight) // 5 total frames diff --git a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs index 0964bceebd..e9cf1bc2f3 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs @@ -983,7 +983,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (npc.localAI[3] < immunityTime) damage *= 0.01; - return !CalamityUtils.AntiButcher(npc, ref damage, 0.5f); + return true; } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) diff --git a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs index 57aea96272..6137a4f3cd 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs @@ -553,7 +553,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (npc.Calamity().newAI[2] < ThanatosHead.immunityTime) damage *= 0.01; - return !CalamityUtils.AntiButcher(npc, ref damage, 0.5f); + return true; } public override void FindFrame(int frameHeight) // 5 total frames diff --git a/NPCs/HiveMind/HiveMind.cs b/NPCs/HiveMind/HiveMind.cs index 60ad849140..04e69f8c0d 100644 --- a/NPCs/HiveMind/HiveMind.cs +++ b/NPCs/HiveMind/HiveMind.cs @@ -1097,9 +1097,6 @@ namespace CalamityMod.NPCs.HiveMind DropHelper.DropBags(npc); - // Legendary drop for Evil boss tier 2 - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); - DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !CalamityWorld.downedHiveMind); @@ -1125,11 +1122,12 @@ namespace CalamityMod.NPCs.HiveMind DropHelper.WeightStack(w), DropHelper.WeightStack(w), DropHelper.WeightStack(w), - DropHelper.WeightStack(w, 30, 50) - ); + DropHelper.WeightStack(w, 30, 50), + DropHelper.WeightStack(w) + ); - //Equipment - DropHelper.DropItemChance(npc, ModContent.ItemType(), 4); + // Equipment + DropHelper.DropItem(npc, ModContent.ItemType(), true); // Vanity DropHelper.DropItemChance(npc, ModContent.ItemType(), 7); diff --git a/NPCs/Leviathan/AquaticAberration.cs b/NPCs/Leviathan/AquaticAberration.cs index e467fa1457..306e81b406 100644 --- a/NPCs/Leviathan/AquaticAberration.cs +++ b/NPCs/Leviathan/AquaticAberration.cs @@ -26,7 +26,7 @@ namespace CalamityMod.NPCs.Leviathan npc.width = 50; npc.height = 50; npc.defense = 14; - npc.lifeMax = 1600; + npc.lifeMax = 800; if (BossRushEvent.BossRushActive) { npc.lifeMax = 10000; diff --git a/NPCs/Leviathan/Leviathan.cs b/NPCs/Leviathan/Leviathan.cs index 6c3734527d..b307847d36 100644 --- a/NPCs/Leviathan/Leviathan.cs +++ b/NPCs/Leviathan/Leviathan.cs @@ -731,9 +731,6 @@ namespace CalamityMod.NPCs.Leviathan DropHelper.DropBags(npc); - // Legendary drop for Leviathan and Anahita - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !CalamityWorld.downedLeviathan); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !CalamityWorld.downedLeviathan); @@ -749,11 +746,13 @@ namespace CalamityMod.NPCs.Leviathan DropHelper.WeightStack(w), DropHelper.WeightStack(w), DropHelper.WeightStack(w), - DropHelper.WeightStack(w) - ); + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w) + ); - // Equipment - DropHelper.DropItemChance(npc, ModContent.ItemType(), 4); + // Equipment + DropHelper.DropItem(npc, ModContent.ItemType(), true); // Vanity DropHelper.DropItemChance(npc, ModContent.ItemType(), 7); diff --git a/NPCs/NormalNPCs/Eidolist.cs b/NPCs/NormalNPCs/Eidolist.cs index a372a5f706..4cefbade13 100644 --- a/NPCs/NormalNPCs/Eidolist.cs +++ b/NPCs/NormalNPCs/Eidolist.cs @@ -334,8 +334,9 @@ namespace CalamityMod.NPCs.NormalNPCs DropHelper.DropItem(npc, ItemID.BlueLunaticRobe); } DropHelper.DropItemCondition(npc, ModContent.ItemType(), !NPC.LunarApocalypseIsUp, 0.25f); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas, 1f, 8, 10); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas && Main.expertMode, 0.5f, 2, 4); + int minLumenyl = Main.expertMode ? 10 : 8; + int maxLumenyl = Main.expertMode ? 14 : 10; + DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.downedCalamitas, 1f, minLumenyl, maxLumenyl); DropHelper.DropItemCondition(npc, ItemID.Ectoplasm, NPC.downedPlantBoss, 1f, 3, 5); } } diff --git a/NPCs/NormalNPCs/ShockstormShuttle.cs b/NPCs/NormalNPCs/ShockstormShuttle.cs index a183d5ff65..86d2984e19 100644 --- a/NPCs/NormalNPCs/ShockstormShuttle.cs +++ b/NPCs/NormalNPCs/ShockstormShuttle.cs @@ -1,3 +1,4 @@ +using CalamityMod.Items.Accessories; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using Microsoft.Xna.Framework; @@ -5,6 +6,7 @@ using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.NPCs.NormalNPCs { public class ShockstormShuttle : ModNPC @@ -392,6 +394,7 @@ namespace CalamityMod.NPCs.NormalNPCs { DropHelper.DropItemCondition(npc, ItemID.MartianConduitPlating, NPC.downedGolemBoss, 1, 10, 30); DropHelper.DropItemChance(npc, ModContent.ItemType(), 3); + DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); } } } diff --git a/NPCs/NormalNPCs/WulfrumDrone.cs b/NPCs/NormalNPCs/WulfrumDrone.cs index 484664297d..c7b79f9929 100644 --- a/NPCs/NormalNPCs/WulfrumDrone.cs +++ b/NPCs/NormalNPCs/WulfrumDrone.cs @@ -183,7 +183,7 @@ namespace CalamityMod.NPCs.NormalNPCs if (spawnInfo.playerSafe || spawnInfo.player.Calamity().ZoneSulphur) return 0f; - return SpawnCondition.OverworldDaySlime.Chance * (Main.hardMode ? 0.025f : 0.1f) * pylonMult; + return SpawnCondition.OverworldDaySlime.Chance * (Main.hardMode ? 0.010f : 0.1f) * pylonMult; } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/NormalNPCs/WulfrumGyrator.cs b/NPCs/NormalNPCs/WulfrumGyrator.cs index 3efa13cd5c..3190b0ae51 100644 --- a/NPCs/NormalNPCs/WulfrumGyrator.cs +++ b/NPCs/NormalNPCs/WulfrumGyrator.cs @@ -160,7 +160,7 @@ namespace CalamityMod.NPCs.NormalNPCs float pylonMult = NPC.AnyNPCs(ModContent.NPCType()) ? 5.5f : 1f; if (spawnInfo.playerSafe || spawnInfo.player.Calamity().ZoneSulphur) return 0f; - return SpawnCondition.OverworldDaySlime.Chance * (Main.hardMode ? 0.0333f : 0.115f) * pylonMult; + return SpawnCondition.OverworldDaySlime.Chance * (Main.hardMode ? 0.020f : 0.115f) * pylonMult; } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/NormalNPCs/WulfrumHovercraft.cs b/NPCs/NormalNPCs/WulfrumHovercraft.cs index 257f5e8666..ed1da85d81 100644 --- a/NPCs/NormalNPCs/WulfrumHovercraft.cs +++ b/NPCs/NormalNPCs/WulfrumHovercraft.cs @@ -251,7 +251,7 @@ namespace CalamityMod.NPCs.NormalNPCs if (spawnInfo.playerSafe || spawnInfo.player.Calamity().ZoneSulphur) return 0f; - return SpawnCondition.OverworldDaySlime.Chance * (Main.hardMode ? 0.025f : 0.1f) * pylonMult; + return SpawnCondition.OverworldDaySlime.Chance * (Main.hardMode ? 0.015f : 0.1f) * pylonMult; } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/NormalNPCs/WulfrumPylon.cs b/NPCs/NormalNPCs/WulfrumPylon.cs index 441fafd95b..2e7a44c638 100644 --- a/NPCs/NormalNPCs/WulfrumPylon.cs +++ b/NPCs/NormalNPCs/WulfrumPylon.cs @@ -161,7 +161,7 @@ namespace CalamityMod.NPCs.NormalNPCs if (spawnInfo.playerFloorX > Main.maxTilesX * 0.333f && spawnInfo.playerFloorX < Main.maxTilesX - Main.maxTilesX * 0.333f) return SpawnCondition.OverworldDaySlime.Chance * (Main.hardMode ? 0.01f : 0.06f) * pylonMult; - return SpawnCondition.OverworldDaySlime.Chance * (Main.hardMode ? 0.06f : 0.15f) * pylonMult; + return SpawnCondition.OverworldDaySlime.Chance * (Main.hardMode ? 0.033f : 0.15f) * pylonMult; } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/NormalNPCs/WulfrumRover.cs b/NPCs/NormalNPCs/WulfrumRover.cs index 4c2124e656..e00cbde270 100644 --- a/NPCs/NormalNPCs/WulfrumRover.cs +++ b/NPCs/NormalNPCs/WulfrumRover.cs @@ -120,7 +120,7 @@ namespace CalamityMod.NPCs.NormalNPCs float pylonMult = NPC.AnyNPCs(ModContent.NPCType()) ? 5.5f : 1f; if (spawnInfo.playerSafe || spawnInfo.player.Calamity().ZoneSulphur) return 0f; - return SpawnCondition.OverworldDaySlime.Chance * (Main.hardMode ? 0.05f : 0.135f) * pylonMult; + return SpawnCondition.OverworldDaySlime.Chance * (Main.hardMode ? 0.010f : 0.135f) * pylonMult; } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/OldDuke/OldDuke.cs b/NPCs/OldDuke/OldDuke.cs index 59793b6d1d..486ed3aa19 100644 --- a/NPCs/OldDuke/OldDuke.cs +++ b/NPCs/OldDuke/OldDuke.cs @@ -380,9 +380,6 @@ namespace CalamityMod.NPCs.OldDuke DropHelper.DropBags(npc); - // Legendary drop for Old Duke - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); - DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !CalamityWorld.downedBoomerDuke); @@ -399,11 +396,13 @@ namespace CalamityMod.NPCs.OldDuke DropHelper.WeightStack(w), DropHelper.WeightStack(w), DropHelper.WeightStack(w), - DropHelper.WeightStack(w) + DropHelper.WeightStack(w), + DropHelper.WeightStack(w), + DropHelper.WeightStack(w) ); - //Equipment - DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); + // Equipment + DropHelper.DropItem(npc, ModContent.ItemType(), true); // Vanity DropHelper.DropItemChance(npc, ModContent.ItemType(), 7); diff --git a/NPCs/Perforator/PerforatorHive.cs b/NPCs/Perforator/PerforatorHive.cs index ff20b160ad..c867e1efca 100644 --- a/NPCs/Perforator/PerforatorHive.cs +++ b/NPCs/Perforator/PerforatorHive.cs @@ -474,9 +474,6 @@ namespace CalamityMod.NPCs.Perforator DropHelper.DropBags(npc); - // Legendary drop for Evil boss tier 2 - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); - DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !CalamityWorld.downedPerforator); @@ -503,11 +500,12 @@ namespace CalamityMod.NPCs.Perforator DropHelper.WeightStack(w), DropHelper.WeightStack(w), DropHelper.WeightStack(w), - DropHelper.WeightStack(w, 30, 50) + DropHelper.WeightStack(w, 30, 50), + DropHelper.WeightStack(w) ); - //Equipment - DropHelper.DropItemChance(npc, ModContent.ItemType(), 4); + // Equipment + DropHelper.DropItem(npc, ModContent.ItemType(), true); // Vanity DropHelper.DropItemChance(npc, ModContent.ItemType(), 7); diff --git a/NPCs/PlagueEnemies/PlaguebringerShade.cs b/NPCs/PlagueEnemies/PlaguebringerShade.cs index 3e04e53420..993b9a9f9b 100644 --- a/NPCs/PlagueEnemies/PlaguebringerShade.cs +++ b/NPCs/PlagueEnemies/PlaguebringerShade.cs @@ -636,7 +636,7 @@ namespace CalamityMod.NPCs.PlagueEnemies DropHelper.DropItemChance(npc, ItemID.Stinger, Main.expertMode ? 0.5f : 0.25f, 2, 3); DropHelper.DropItem(npc, ModContent.ItemType(), 8, 12); DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); - DropHelper.DropItemChance(npc, ModContent.ItemType(), 50); //no, this isn't getting boosted by Defiled. Rover, I don't care. PBG also drops it + DropHelper.DropItemChance(npc, ModContent.ItemType(), 50); } public override void OnHitPlayer(Player player, int damage, bool crit) diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs index b4b25cd414..a9737cb891 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs @@ -1198,9 +1198,6 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath DropHelper.DropBags(npc); - // Legendary drop for PBG - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); - DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !CalamityWorld.downedPlaguebringer); @@ -1225,11 +1222,15 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath DropHelper.WeightStack(w), DropHelper.WeightStack(w), DropHelper.WeightStack(w), - DropHelper.WeightStack(w) - ); + DropHelper.WeightStack(w), + DropHelper.WeightStack(w) + ); - // Vanity - DropHelper.DropItemChance(npc, ModContent.ItemType(), 7); + // Equipment + DropHelper.DropItem(npc, ModContent.ItemType(), true); + + // Vanity + DropHelper.DropItemChance(npc, ModContent.ItemType(), 7); DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); } diff --git a/NPCs/Polterghast/Polterghast.cs b/NPCs/Polterghast/Polterghast.cs index ab9b1e76df..e467a755e0 100644 --- a/NPCs/Polterghast/Polterghast.cs +++ b/NPCs/Polterghast/Polterghast.cs @@ -1,6 +1,6 @@ -using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Events; +using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; using CalamityMod.Items.Materials; @@ -972,9 +972,6 @@ namespace CalamityMod.NPCs.Polterghast DropHelper.DropBags(npc); - // Legendary drop for Polterghast - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); - DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !CalamityWorld.downedPolterghast); @@ -1001,7 +998,10 @@ namespace CalamityMod.NPCs.Polterghast DropHelper.WeightStack(w), DropHelper.WeightStack(w) ); - } + + // Equipment + DropHelper.DropItem(npc, ModContent.ItemType(), true); + } // If Polterghast has not been killed, notify players about the Abyss minibosses now dropping items if (!CalamityWorld.downedPolterghast) diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianBoss.cs b/NPCs/ProfanedGuardians/ProfanedGuardianBoss.cs index 3c52ba1f47..14ea39e2e5 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianBoss.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianBoss.cs @@ -1,6 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; +using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; using CalamityMod.Items.SummonItems; @@ -445,7 +445,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians DropHelper.DropItemChance(npc, ModContent.ItemType(), 7); DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); DropHelper.DropItemChance(npc, ModContent.ItemType(), 4); - DropHelper.DropItem(npc, ModContent.ItemType()); + DropHelper.DropItem(npc, ModContent.ItemType(), true); + DropHelper.DropItem(npc, ModContent.ItemType()); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !CalamityWorld.downedGuardians); // Mark the Profaned Guardians as dead diff --git a/NPCs/Providence/ProvSpawnDefense.cs b/NPCs/Providence/ProvSpawnDefense.cs index 915e59584e..c84576a2b5 100644 --- a/NPCs/Providence/ProvSpawnDefense.cs +++ b/NPCs/Providence/ProvSpawnDefense.cs @@ -15,7 +15,9 @@ namespace CalamityMod.NPCs.Providence [AutoloadBossHead] public class ProvSpawnDefense : ModNPC { - public override void SetStaticDefaults() + private bool start = true; + + public override void SetStaticDefaults() { DisplayName.SetDefault("A Profaned Guardian"); Main.npcFrameCount[npc.type] = 6; @@ -32,7 +34,7 @@ namespace CalamityMod.NPCs.Providence npc.height = 80; npc.defense = 50; npc.DR_NERD(0.4f); - npc.lifeMax = 18750; // Old HP - 25000 + npc.lifeMax = 18750; if (BossRushEvent.BossRushActive) { npc.lifeMax = 30000; @@ -71,75 +73,41 @@ namespace CalamityMod.NPCs.Providence public override void AI() { - CalamityGlobalNPC.holyBossDefender = npc.whoAmI; - Vector2 vectorCenter = npc.Center; - Player player = Main.player[npc.target]; - npc.TargetClosest(false); - if (CalamityGlobalNPC.holyBoss < 0 || !Main.npc[CalamityGlobalNPC.holyBoss].active) + // Setting this in SetDefaults will disable expert mode scaling, so put it here instead + npc.damage = 0; + + CalamityGlobalNPC.holyBossDefender = npc.whoAmI; + + if (CalamityGlobalNPC.holyBoss < 0 || !Main.npc[CalamityGlobalNPC.holyBoss].active) { npc.active = false; npc.netUpdate = true; return; } + npc.dontTakeDamage = Main.npc[CalamityGlobalNPC.holyBoss].dontTakeDamage; - if (Math.Sign(npc.velocity.X) != 0) - { - npc.spriteDirection = -Math.Sign(npc.velocity.X); - } - npc.spriteDirection = Math.Sign(npc.velocity.X); - int num1009 = (npc.ai[0] == 0f) ? 1 : 2; - int num1010 = (npc.ai[0] == 0f) ? 60 : 80; - for (int num1011 = 0; num1011 < 2; num1011++) - { - if (Main.rand.Next(3) < num1009) - { - int dustType = Main.rand.Next(2); - if (dustType == 0) - { - dustType = (int)CalamityDusts.ProfanedFire; - } - else - { - dustType = 160; - } - int num1012 = Dust.NewDust(npc.Center - new Vector2((float)num1010), num1010 * 2, num1010 * 2, dustType, npc.velocity.X * 0.5f, npc.velocity.Y * 0.5f, 90, default, 0.5f); - Main.dust[num1012].noGravity = true; - Main.dust[num1012].velocity *= 0.2f; - Main.dust[num1012].fadeIn = 1f; - } - } - npc.TargetClosest(true); - float num1372 = 9f; - Vector2 vector167 = new Vector2(npc.Center.X + (float)(npc.direction * 20), npc.Center.Y + 6f); - float num1373 = player.position.X + (float)player.width * 0.5f - vector167.X; - float num1374 = player.Center.Y - vector167.Y; - float num1375 = (float)Math.Sqrt((double)(num1373 * num1373 + num1374 * num1374)); - float num1376 = num1372 / num1375; - num1373 *= num1376; - num1374 *= num1376; - npc.ai[1] -= 1f; - if (num1375 < 200f || npc.ai[1] > 0f) - { - if (num1375 < 200f) - { - npc.ai[1] = 20f; - } - return; - } - npc.velocity.X = (npc.velocity.X * 50f + num1373) / 51f; - npc.velocity.Y = (npc.velocity.Y * 50f + num1374) / 51f; - if (num1375 < 350f) - { - npc.velocity.X = (npc.velocity.X * 10f + num1373) / 11f; - npc.velocity.Y = (npc.velocity.Y * 10f + num1374) / 11f; - } - if (num1375 < 300f) - { - npc.velocity.X = (npc.velocity.X * 7f + num1373) / 8f; - npc.velocity.Y = (npc.velocity.Y * 7f + num1374) / 8f; - } - } + NPC parent = Main.npc[CalamityGlobalNPC.holyBoss]; + if (start) + { + for (int d = 0; d < 30; d++) + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.ProfanedFire, 0f, 0f, 100, default, 2f); + + npc.ai[1] = npc.ai[0]; + start = false; + } + + float playerLocation = npc.Center.X - Main.player[Main.npc[CalamityGlobalNPC.holyBoss].target].Center.X; + npc.direction = playerLocation < 0 ? 1 : -1; + npc.spriteDirection = npc.direction; + + double deg = npc.ai[1]; + double rad = deg * (Math.PI / 180); + double dist = 400; + npc.position.X = parent.Center.X - (int)(Math.Cos(rad) * dist) - npc.width / 2; + npc.position.Y = parent.Center.Y - (int)(Math.Sin(rad) * dist) - npc.height / 2; + npc.ai[1] += 1f; + } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { @@ -206,37 +174,21 @@ namespace CalamityMod.NPCs.Providence } } - public override bool CheckActive() - { - return false; - } - - public override bool CanHitPlayer(Player target, ref int cooldownSlot) - { - cooldownSlot = 1; - return true; - } - - public override void OnHitPlayer(Player player, int damage, bool crit) - { - player.AddBuff(ModContent.BuffType(), 240, true); - } + public override bool CheckActive() => false; public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 3; k++) - { Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f); - } + if (npc.life <= 0) { Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossT"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossT2"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossT3"), 1f); + for (int k = 0; k < 30; k++) - { Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f); - } } } } diff --git a/NPCs/Providence/ProvSpawnHealer.cs b/NPCs/Providence/ProvSpawnHealer.cs index 83df89baac..01fa2cec8e 100644 --- a/NPCs/Providence/ProvSpawnHealer.cs +++ b/NPCs/Providence/ProvSpawnHealer.cs @@ -14,7 +14,9 @@ namespace CalamityMod.NPCs.Providence [AutoloadBossHead] public class ProvSpawnHealer : ModNPC { - public override void SetStaticDefaults() + private bool start = true; + + public override void SetStaticDefaults() { DisplayName.SetDefault("A Profaned Guardian"); Main.npcFrameCount[npc.type] = 6; @@ -25,15 +27,15 @@ namespace CalamityMod.NPCs.Providence { npc.npcSlots = 1f; npc.aiStyle = -1; - npc.damage = 0; + npc.damage = 20; npc.width = 100; npc.height = 80; npc.defense = 30; npc.DR_NERD(0.2f); - npc.lifeMax = 30000; // Old HP - 40000 + npc.lifeMax = 15000; if (BossRushEvent.BossRushActive) { - npc.lifeMax = 40000; + npc.lifeMax = 20000; } double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); @@ -69,60 +71,40 @@ namespace CalamityMod.NPCs.Providence public override void AI() { + // Setting this in SetDefaults will disable expert mode scaling, so put it here instead + npc.damage = 0; + CalamityGlobalNPC.holyBossHealer = npc.whoAmI; - bool expertMode = Main.expertMode; - Vector2 vectorCenter = npc.Center; - Player player = Main.player[npc.target]; - npc.TargetClosest(false); + if (CalamityGlobalNPC.holyBoss < 0 || !Main.npc[CalamityGlobalNPC.holyBoss].active) { npc.active = false; npc.netUpdate = true; return; } + npc.dontTakeDamage = Main.npc[CalamityGlobalNPC.holyBoss].dontTakeDamage; - if (Math.Sign(npc.velocity.X) != 0) + NPC parent = Main.npc[CalamityGlobalNPC.holyBoss]; + if (start) { - npc.spriteDirection = -Math.Sign(npc.velocity.X); - } - npc.spriteDirection = Math.Sign(npc.velocity.X); - for (int num1011 = 0; num1011 < 2; num1011++) - { - if (Main.rand.Next(3) < 1) - { - int dustType = Main.rand.Next(2); - if (dustType == 0) - { - dustType = (int)CalamityDusts.ProfanedFire; - } - else - { - dustType = 107; - } - int num1012 = Dust.NewDust(npc.Center - new Vector2(60f), 120, 120, dustType, npc.velocity.X * 0.5f, npc.velocity.Y * 0.5f, 90, default, 0.5f); - Main.dust[num1012].noGravity = true; - Main.dust[num1012].velocity *= 0.2f; - Main.dust[num1012].fadeIn = 1f; - } - } - Vector2 vector96 = new Vector2(npc.Center.X, npc.Center.Y); - float num784 = Main.npc[CalamityGlobalNPC.holyBoss].Center.X - vector96.X; - float num785 = Main.npc[CalamityGlobalNPC.holyBoss].Center.Y - vector96.Y; - float num786 = (float)Math.Sqrt((double)(num784 * num784 + num785 * num785)); - if (num786 > 360f) - { - num786 = 8f / num786; //8f - num784 *= num786; - num785 *= num786; - npc.velocity.X = (npc.velocity.X * 15f + num784) / 16f; - npc.velocity.Y = (npc.velocity.Y * 15f + num785) / 16f; - return; - } - if (Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y) < 8f) //8f - { - npc.velocity *= 1.05f; //1.05f + for (int d = 0; d < 30; d++) + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.ProfanedFire, 0f, 0f, 100, default, 2f); + + npc.ai[1] = npc.ai[0]; + start = false; } + + float playerLocation = npc.Center.X - Main.player[Main.npc[CalamityGlobalNPC.holyBoss].target].Center.X; + npc.direction = playerLocation < 0 ? 1 : -1; + npc.spriteDirection = npc.direction; + + double deg = npc.ai[1]; + double rad = deg * (Math.PI / 180); + double dist = 400; + npc.position.X = parent.Center.X - (int)(Math.Cos(rad) * dist) - npc.width / 2; + npc.position.Y = parent.Center.Y - (int)(Math.Sin(rad) * dist) - npc.height / 2; + npc.ai[1] += 1f; } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) @@ -200,23 +182,13 @@ namespace CalamityMod.NPCs.Providence } } - public override bool CheckActive() - { - return false; - } - - public override bool CanHitPlayer(Player target, ref int cooldownSlot) - { - cooldownSlot = 1; - return true; - } + public override bool CheckActive() => false; public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 3; k++) - { Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f); - } + if (npc.life <= 0) { Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossH"), 1f); @@ -224,10 +196,9 @@ namespace CalamityMod.NPCs.Providence Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossH3"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossH4"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossH5"), 1f); + for (int k = 0; k < 50; k++) - { Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f); - } } } } diff --git a/NPCs/Providence/ProvSpawnOffense.cs b/NPCs/Providence/ProvSpawnOffense.cs index 4326321c0e..fcb7a5ae4d 100644 --- a/NPCs/Providence/ProvSpawnOffense.cs +++ b/NPCs/Providence/ProvSpawnOffense.cs @@ -16,9 +16,9 @@ namespace CalamityMod.NPCs.Providence [AutoloadBossHead] public class ProvSpawnOffense : ModNPC { - public int dustTimer = 3; + private bool start = true; - public override void SetStaticDefaults() + public override void SetStaticDefaults() { DisplayName.SetDefault("A Profaned Guardian"); Main.npcFrameCount[npc.type] = 6; @@ -35,7 +35,7 @@ namespace CalamityMod.NPCs.Providence npc.height = 80; npc.defense = 40; npc.DR_NERD(0.3f); - npc.lifeMax = 31875; // Old HP - 42500 + npc.lifeMax = 31875; if (BossRushEvent.BossRushActive) { npc.lifeMax = 40000; @@ -56,13 +56,11 @@ namespace CalamityMod.NPCs.Providence public override void SendExtraAI(BinaryWriter writer) { - writer.Write(dustTimer); writer.Write(npc.dontTakeDamage); } public override void ReceiveExtraAI(BinaryReader reader) { - dustTimer = reader.ReadInt32(); npc.dontTakeDamage = reader.ReadBoolean(); } @@ -76,147 +74,41 @@ namespace CalamityMod.NPCs.Providence public override void AI() { - CalamityGlobalNPC.holyBossAttacker = npc.whoAmI; - bool fireDust = npc.life <= npc.lifeMax * 0.5; - Vector2 vectorCenter = npc.Center; - npc.TargetClosest(false); - Player player = Main.player[npc.target]; + // Setting this in SetDefaults will disable expert mode scaling, so put it here instead + npc.damage = 0; + + CalamityGlobalNPC.holyBossAttacker = npc.whoAmI; + if (CalamityGlobalNPC.holyBoss < 0 || !Main.npc[CalamityGlobalNPC.holyBoss].active) { npc.active = false; npc.netUpdate = true; return; } + npc.dontTakeDamage = Main.npc[CalamityGlobalNPC.holyBoss].dontTakeDamage; - if (Math.Sign(npc.velocity.X) != 0) - { - npc.spriteDirection = -Math.Sign(npc.velocity.X); - } - npc.spriteDirection = Math.Sign(npc.velocity.X); - float num1005 = 20f; - float num1006 = 0.111111117f * num1005; - int num1009 = (npc.ai[0] == 2f) ? 2 : 1; - int num1010 = (npc.ai[0] == 2f) ? 80 : 60; - for (int num1011 = 0; num1011 < 2; num1011++) - { - if (Main.rand.Next(3) < num1009) - { - int num1012 = Dust.NewDust(vectorCenter - new Vector2((float)num1010), num1010 * 2, num1010 * 2, (int)CalamityDusts.ProfanedFire, npc.velocity.X * 0.5f, npc.velocity.Y * 0.5f, 90, default, 0.5f); - Main.dust[num1012].noGravity = true; - Main.dust[num1012].velocity *= 0.2f; - Main.dust[num1012].fadeIn = 1f; - } - } - if (npc.ai[0] == 0f) - { - float scaleFactor6 = 10f; - Vector2 center5 = player.Center; - Vector2 vector126 = center5 - vectorCenter; - Vector2 vector127 = vector126 - Vector2.UnitY * 300f; - float num1013 = vector126.Length(); - vector126 = Vector2.Normalize(vector126) * scaleFactor6; - vector127 = Vector2.Normalize(vector127) * scaleFactor6; - bool flag64 = Collision.CanHit(vectorCenter, 1, 1, player.Center, 1, 1); - if (npc.ai[3] >= 120f) - { - flag64 = true; - } - float num1014 = 8f; - flag64 = flag64 && vector126.ToRotation() > 3.14159274f / num1014 && vector126.ToRotation() < 3.14159274f - 3.14159274f / num1014; - if (num1013 > 800f || !flag64) - { - npc.velocity.X = (npc.velocity.X * (num1005 - 1f) + vector127.X) / num1005; - npc.velocity.Y = (npc.velocity.Y * (num1005 - 1f) + vector127.Y) / num1005; - if (!flag64) - { - npc.ai[3] += 1f; - if (npc.ai[3] == 120f) - { - npc.netUpdate = true; - } - } - else - { - npc.ai[3] = 0f; - } - } - else - { - npc.ai[0] = 1f; - npc.ai[2] = vector126.X; - npc.ai[3] = vector126.Y; - npc.netUpdate = true; - } - } - else if (npc.ai[0] == 1f) - { - npc.velocity *= 0.8f; - npc.ai[1] += 1f; - if (npc.ai[1] >= 5f) - { - npc.ai[0] = 2f; - npc.ai[1] = 0f; - npc.netUpdate = true; - Vector2 velocity = new Vector2(npc.ai[2], npc.ai[3]); - velocity.Normalize(); - velocity *= 10f; - npc.velocity = velocity; - } - } - else if (npc.ai[0] == 2f) - { - if (Main.netMode != NetmodeID.MultiplayerClient) - { - dustTimer--; - if (fireDust && dustTimer <= 0) - { - Main.PlaySound(SoundID.Item20, npc.position); - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - Vector2 vector173 = Vector2.Normalize(player.Center - vectorCenter) * (float)(npc.width + 20) / 2f + vectorCenter; - int projectile = Projectile.NewProjectile((int)vector173.X, (int)vector173.Y, (float)(npc.direction * 2), 4f, type, damage, 0f, Main.myPlayer, 2f, 0f); - Main.projectile[projectile].timeLeft = 120; - Main.projectile[projectile].velocity.X = 0f; - Main.projectile[projectile].velocity.Y = 0f; - dustTimer = 3; - } - } - npc.ai[1] += 1f; - bool flag65 = vectorCenter.Y + 50f > player.Center.Y; - if ((npc.ai[1] >= 90f && flag65) || npc.velocity.Length() < 8f) - { - npc.ai[0] = 3f; - npc.ai[1] = 45f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - npc.velocity /= 2f; - npc.netUpdate = true; - } - else - { - Vector2 center7 = player.Center; - Vector2 vec2 = center7 - vectorCenter; - vec2.Normalize(); - if (vec2.HasNaNs()) - { - vec2 = new Vector2((float)npc.direction, 0f); - } - npc.velocity = (npc.velocity * (num1005 - 1f) + vec2 * (npc.velocity.Length() + num1006)) / num1005; - } - } - else if (npc.ai[0] == 3f) - { - npc.ai[1] -= 1f; - if (npc.ai[1] <= 0f) - { - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.netUpdate = true; - } - npc.velocity *= 0.98f; - } - } + NPC parent = Main.npc[CalamityGlobalNPC.holyBoss]; + if (start) + { + for (int d = 0; d < 30; d++) + Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.ProfanedFire, 0f, 0f, 100, default, 2f); + + npc.ai[1] = npc.ai[0]; + start = false; + } + + float playerLocation = npc.Center.X - Main.player[Main.npc[CalamityGlobalNPC.holyBoss].target].Center.X; + npc.direction = playerLocation < 0 ? 1 : -1; + npc.spriteDirection = npc.direction; + + double deg = npc.ai[1]; + double rad = deg * (Math.PI / 180); + double dist = 400; + npc.position.X = parent.Center.X - (int)(Math.Cos(rad) * dist) - npc.width / 2; + npc.position.Y = parent.Center.Y - (int)(Math.Sin(rad) * dist) - npc.height / 2; + npc.ai[1] += 1f; + } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { @@ -285,38 +177,22 @@ namespace CalamityMod.NPCs.Providence } } - public override bool CheckActive() - { - return false; - } - - public override bool CanHitPlayer(Player target, ref int cooldownSlot) - { - cooldownSlot = 1; - return true; - } - - public override void OnHitPlayer(Player player, int damage, bool crit) - { - player.AddBuff(ModContent.BuffType(), 300, true); - } + public override bool CheckActive() => false; public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 3; k++) - { Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f); - } + if (npc.life <= 0) { Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossA"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossA2"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossA3"), 1f); Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfanedGuardianBossGores/ProfanedGuardianBossA4"), 1f); + for (int k = 0; k < 30; k++) - { Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.ProfanedFire, hitDirection, -1f, 0, default, 1f); - } } } } diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index 4f3313e69c..489df2337f 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -287,16 +287,24 @@ namespace CalamityMod.NPCs.Providence // Count the remaining Guardians, healer especially because it allows the boss to heal int guardianAmt = 0; + bool attackerAlive = false; + bool defenderAlive = false; bool healerAlive = false; if (CalamityGlobalNPC.holyBossAttacker != -1) { - if (Main.npc[CalamityGlobalNPC.holyBossAttacker].active) - guardianAmt++; + if (Main.npc[CalamityGlobalNPC.holyBossAttacker].active) + { + guardianAmt++; + attackerAlive = true; + } } if (CalamityGlobalNPC.holyBossDefender != -1) { - if (Main.npc[CalamityGlobalNPC.holyBossDefender].active) - guardianAmt++; + if (Main.npc[CalamityGlobalNPC.holyBossDefender].active) + { + guardianAmt++; + defenderAlive = true; + } } if (CalamityGlobalNPC.holyBossHealer != -1) { @@ -316,13 +324,13 @@ namespace CalamityMod.NPCs.Providence switch (guardianAmt) { case 1: - attackRateMult = 1.25; + attackRateMult = 1.15; break; case 2: - attackRateMult = 1.5; + attackRateMult = 1.3; break; case 3: - attackRateMult = 2D; + attackRateMult = 1.45; break; default: break; @@ -366,26 +374,32 @@ namespace CalamityMod.NPCs.Providence return; } - // Heal + // Damage + if (attackerAlive) + { + double damageMult = 1.25; + holyLaserDamage = (int)(holyLaserDamage * damageMult); + crystalDamage = (int)(crystalDamage * damageMult); + holySpearDamage = (int)(holySpearDamage * damageMult); + holyBombDamage = (int)(holyBombDamage * damageMult); + moltenBlastDamage = (int)(moltenBlastDamage * damageMult); + holyFireDamage = (int)(holyFireDamage * damageMult); + holyBlastDamage = (int)(holyBlastDamage * damageMult); + holyStarDamage = (int)(holyStarDamage * damageMult); + } + + // Defense + if (defenderAlive) + npc.defense = npc.defDefense * 2; + else + npc.defense = npc.defDefense; + + // Healing if (healerAlive) { - float heal = revenge ? 90f : 120f; - switch (guardianAmt) - { - case 1: - heal *= 2f; - break; - case 2: - break; - case 3: - heal *= 0.5f; - break; - default: - break; - } - + float healGateValue = revenge ? 60f : 90f; healTimer++; - if (healTimer >= heal) + if (healTimer >= healGateValue) { healTimer = 0; if (Main.netMode != NetmodeID.MultiplayerClient) @@ -436,6 +450,7 @@ namespace CalamityMod.NPCs.Providence { if (bossLife == 0f && npc.life > 0) bossLife = npc.lifeMax; + if (npc.life > 0) { if (Main.netMode != NetmodeID.MultiplayerClient) @@ -444,11 +459,16 @@ namespace CalamityMod.NPCs.Providence if ((npc.life + num660) < bossLife) { bossLife = npc.life; - int x = (int)(npc.position.X + Main.rand.Next(npc.width - 32)); - int y = (int)(npc.position.Y + Main.rand.Next(npc.height - 32)); - NPC.NewNPC(x - 100, y - 100, ModContent.NPCType()); - NPC.NewNPC(x + 100, y - 100, ModContent.NPCType()); - NPC.NewNPC(x, y + 100, ModContent.NPCType()); + Main.PlaySound(SoundID.Item, (int)npc.position.X, (int)npc.position.Y, 74); + int guardianRingAmt = 3; + int guardianSpread = 360 / guardianRingAmt; + int guardianDistance = 400; + for (int i = 0; i < guardianRingAmt; i++) + { + int type = i == 0 ? ModContent.NPCType() : i == 1 ? ModContent.NPCType() : ModContent.NPCType(); + int spawn = NPC.NewNPC((int)(npc.Center.X + (Math.Sin(i * guardianSpread) * guardianDistance)), (int)(npc.Center.Y + (Math.Cos(i * guardianSpread) * guardianDistance)), type, npc.whoAmI, 0, 0, 0, -1); + Main.npc[spawn].ai[0] = i * guardianSpread; + } } } } @@ -512,8 +532,8 @@ namespace CalamityMod.NPCs.Providence } if (firingLaser) { - acceleration *= normalAttackRate ? 0.4f : 0.2f; - velocity *= normalAttackRate ? 0.4f : 0.2f; + acceleration *= 0.4f; + velocity *= 0.4f; } else if (increaseSpeed) { @@ -538,7 +558,7 @@ namespace CalamityMod.NPCs.Providence if (num855 > (firingLaser ? 200f : 250f)) // 200 npc.velocity.Y += 0.2f; - float speedVariance = normalAttackRate ? 2f : 1f; + float speedVariance = 2f; if (npc.velocity.Y > (firingLaser ? speedVariance : 6f)) npc.velocity.Y = firingLaser ? speedVariance : 6f; if (npc.velocity.Y < (firingLaser ? -speedVariance : -6f)) @@ -943,8 +963,7 @@ namespace CalamityMod.NPCs.Providence } // Fire a flame towards every player, with a limit of 5 - // Only fired while the guardians aren't alive or if Providence is at low health - if (npc.ai[3] % 60f == 0f && expertMode && normalAttackRate) + if (npc.ai[3] % 60f == 0f && expertMode) { List targets = new List(); for (int p = 0; p < Main.maxPlayers; p++) @@ -1217,7 +1236,7 @@ namespace CalamityMod.NPCs.Providence Vector2 value19 = new Vector2(27f, 59f); - float rotation = (nightTime ? 435f : 450f) + (guardianAmt * 18); + float rotation = (nightTime ? 435f : 450f) + (guardianAmt * 5); npc.ai[2] += 1f; if (npc.ai[2] < 120f) @@ -1436,10 +1455,6 @@ namespace CalamityMod.NPCs.Providence DropHelper.DropBags(npc); - // Legendary drop for Providence - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice || !hasTakenDaytimeDamage); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice || !hasTakenDaytimeDamage); - DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !CalamityWorld.downedProvidence); @@ -1474,11 +1489,15 @@ namespace CalamityMod.NPCs.Providence DropHelper.WeightStack(w), DropHelper.WeightStack(w), DropHelper.WeightStack(w), - DropHelper.WeightStack(w) + DropHelper.WeightStack(w), + DropHelper.WeightStack(w) ); - // Vanity - DropHelper.DropItemChance(npc, ModContent.ItemType(), 7); + // Equipment + DropHelper.DropItem(npc, ModContent.ItemType(), true); + + // Vanity + DropHelper.DropItemChance(npc, ModContent.ItemType(), 7); } if (Main.netMode != NetmodeID.MultiplayerClient && npc.Top.Y >= (Main.maxTilesY - 240f) * 16f) diff --git a/NPCs/Ravager/FlamePillar.cs b/NPCs/Ravager/FlamePillar.cs index d9b6519c68..d229a49189 100644 --- a/NPCs/Ravager/FlamePillar.cs +++ b/NPCs/Ravager/FlamePillar.cs @@ -26,7 +26,7 @@ namespace CalamityMod.NPCs.Ravager npc.DR_NERD(0.2f); npc.chaseable = false; npc.canGhostHeal = false; - npc.lifeMax = CalamityWorld.downedProvidence ? 16000 : 3500; + npc.lifeMax = CalamityWorld.downedProvidence ? 14000 : 3500; npc.alpha = 255; npc.aiStyle = -1; aiType = -1; diff --git a/NPCs/Ravager/RavagerBody.cs b/NPCs/Ravager/RavagerBody.cs index 35703e4831..6bf7366949 100644 --- a/NPCs/Ravager/RavagerBody.cs +++ b/NPCs/Ravager/RavagerBody.cs @@ -51,7 +51,7 @@ namespace CalamityMod.NPCs.Ravager { npc.damage = (int)(npc.damage * 1.5); npc.defense *= 2; - npc.lifeMax *= 5; + npc.lifeMax *= 4; npc.value *= 1.5f; } double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; @@ -772,9 +772,6 @@ namespace CalamityMod.NPCs.Ravager DropHelper.DropBags(npc); - // Legendary drop for Ravager - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); - DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !CalamityWorld.downedScavenger); @@ -792,11 +789,13 @@ namespace CalamityMod.NPCs.Ravager DropHelper.WeightStack(w), DropHelper.WeightStack(w), DropHelper.WeightStack(w), - DropHelper.WeightStack(w) - ); + DropHelper.WeightStack(w), + DropHelper.WeightStack(w) + ); - // Equipment - DropHelper.DropItemChance(npc, ModContent.ItemType(), 3); + // Equipment + DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.downedProvidence); + DropHelper.DropItemChance(npc, ModContent.ItemType(), 3); DropHelper.DropItemChance(npc, ModContent.ItemType(), 3); // Vanity diff --git a/NPCs/Ravager/RavagerClawLeft.cs b/NPCs/Ravager/RavagerClawLeft.cs index 93fad90488..a0133c07b1 100644 --- a/NPCs/Ravager/RavagerClawLeft.cs +++ b/NPCs/Ravager/RavagerClawLeft.cs @@ -39,7 +39,7 @@ namespace CalamityMod.NPCs.Ravager { npc.damage = (int)(npc.damage * 1.5); npc.defense *= 2; - npc.lifeMax *= 5; + npc.lifeMax *= 4; } if (BossRushEvent.BossRushActive) { diff --git a/NPCs/Ravager/RavagerClawRight.cs b/NPCs/Ravager/RavagerClawRight.cs index 9ab6c1ea2f..ed70c39bbf 100644 --- a/NPCs/Ravager/RavagerClawRight.cs +++ b/NPCs/Ravager/RavagerClawRight.cs @@ -39,7 +39,7 @@ namespace CalamityMod.NPCs.Ravager { npc.damage = (int)(npc.damage * 1.5); npc.defense *= 2; - npc.lifeMax *= 5; + npc.lifeMax *= 4; } if (BossRushEvent.BossRushActive) { diff --git a/NPCs/Ravager/RavagerHead.cs b/NPCs/Ravager/RavagerHead.cs index a7eb7214a9..4cc851ec3d 100644 --- a/NPCs/Ravager/RavagerHead.cs +++ b/NPCs/Ravager/RavagerHead.cs @@ -35,7 +35,7 @@ namespace CalamityMod.NPCs.Ravager if (CalamityWorld.downedProvidence && !BossRushEvent.BossRushActive) { npc.defense *= 2; - npc.lifeMax *= 5; + npc.lifeMax *= 4; } if (BossRushEvent.BossRushActive) { diff --git a/NPCs/Ravager/RavagerHead2.cs b/NPCs/Ravager/RavagerHead2.cs index 7c32b2fcf2..2b3aa7dbbe 100644 --- a/NPCs/Ravager/RavagerHead2.cs +++ b/NPCs/Ravager/RavagerHead2.cs @@ -35,7 +35,7 @@ namespace CalamityMod.NPCs.Ravager if (CalamityWorld.downedProvidence && !BossRushEvent.BossRushActive) { npc.defense *= 2; - npc.lifeMax *= 5; + npc.lifeMax *= 4; } if (BossRushEvent.BossRushActive) { @@ -57,6 +57,8 @@ namespace CalamityMod.NPCs.Ravager return; } + Player player = Main.player[Main.npc[CalamityGlobalNPC.scavenger].target]; + bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; bool death = CalamityWorld.death || malice; bool provy = CalamityWorld.downedProvidence && !BossRushEvent.BossRushActive; @@ -64,17 +66,6 @@ namespace CalamityMod.NPCs.Ravager if (npc.timeLeft < 1800) npc.timeLeft = 1800; - // Get a target - if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) - npc.TargetClosest(); - - // Despawn safety, make sure to target another player if the current player target is too far away - if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) - npc.TargetClosest(); - - // Target variable - Player player = Main.player[npc.target]; - // Rotation float num801 = npc.position.X + (npc.width / 2) - player.position.X - (player.width / 2); float num802 = npc.position.Y + npc.height - 59f - player.position.Y - (player.height / 2); @@ -124,8 +115,10 @@ namespace CalamityMod.NPCs.Ravager if (Main.netMode != NetmodeID.MultiplayerClient) { - Main.PlaySound(SoundID.Item33, npc.position); - Projectile.NewProjectile(npc.Center, Vector2.Normalize(player.Center - npc.Center) * projectileVelocity, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, -1f); + Main.PlaySound(SoundID.Item62, npc.position); + type = ModContent.ProjectileType(); + damage = npc.GetProjectileDamage(type); + Projectile.NewProjectile(npc.Center, Vector2.Normalize(player.Center - npc.Center) * projectileVelocity * 0.25f, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, Main.npc[CalamityGlobalNPC.scavenger].target, 0f); } } else diff --git a/NPCs/Ravager/RavagerLegLeft.cs b/NPCs/Ravager/RavagerLegLeft.cs index 8c81de841f..cdf4857729 100644 --- a/NPCs/Ravager/RavagerLegLeft.cs +++ b/NPCs/Ravager/RavagerLegLeft.cs @@ -36,7 +36,7 @@ namespace CalamityMod.NPCs.Ravager if (CalamityWorld.downedProvidence && !BossRushEvent.BossRushActive) { npc.defense *= 2; - npc.lifeMax *= 5; + npc.lifeMax *= 4; } if (BossRushEvent.BossRushActive) { diff --git a/NPCs/Ravager/RavagerLegRight.cs b/NPCs/Ravager/RavagerLegRight.cs index a6c4a2dd45..f03585995f 100644 --- a/NPCs/Ravager/RavagerLegRight.cs +++ b/NPCs/Ravager/RavagerLegRight.cs @@ -36,7 +36,7 @@ namespace CalamityMod.NPCs.Ravager if (CalamityWorld.downedProvidence && !BossRushEvent.BossRushActive) { npc.defense *= 2; - npc.lifeMax *= 5; + npc.lifeMax *= 4; } if (BossRushEvent.BossRushActive) { diff --git a/NPCs/Ravager/RockPillar.cs b/NPCs/Ravager/RockPillar.cs index 67560d7975..d12c385545 100644 --- a/NPCs/Ravager/RockPillar.cs +++ b/NPCs/Ravager/RockPillar.cs @@ -25,7 +25,7 @@ namespace CalamityMod.NPCs.Ravager npc.DR_NERD(0.3f); npc.chaseable = false; npc.canGhostHeal = false; - npc.lifeMax = CalamityWorld.downedProvidence ? 22750 : 5000; + npc.lifeMax = CalamityWorld.downedProvidence ? 20000 : 5000; npc.alpha = 255; npc.aiStyle = -1; aiType = -1; diff --git a/NPCs/Signus/Signus.cs b/NPCs/Signus/Signus.cs index ebf7f92586..e0903c31ed 100644 --- a/NPCs/Signus/Signus.cs +++ b/NPCs/Signus/Signus.cs @@ -1,6 +1,7 @@ using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using CalamityMod.Events; +using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; using CalamityMod.Items.Materials; @@ -764,9 +765,6 @@ namespace CalamityMod.NPCs.Signus DropHelper.DropBags(npc); - // Legendary drop for Signus - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); - DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); bool lastSentinelKilled = CalamityWorld.downedSentinel1 && CalamityWorld.downedSentinel2 && !CalamityWorld.downedSentinel3; DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, lastSentinelKilled); @@ -780,7 +778,8 @@ namespace CalamityMod.NPCs.Signus DropHelper.DropItemChance(npc, ModContent.ItemType(), 4); DropHelper.DropItemChance(npc, ModContent.ItemType(), 4); - //Equipment (None in Normal) + // Equipment + DropHelper.DropItem(npc, ModContent.ItemType(), true); // Vanity DropHelper.DropItemChance(npc, ModContent.ItemType(), 7); diff --git a/NPCs/SlimeGod/SlimeGod.cs b/NPCs/SlimeGod/SlimeGod.cs index 49b86147a1..a6a0d1c132 100644 --- a/NPCs/SlimeGod/SlimeGod.cs +++ b/NPCs/SlimeGod/SlimeGod.cs @@ -168,63 +168,33 @@ namespace CalamityMod.NPCs.SlimeGod if (npc.localAI[0] >= 600f && Vector2.Distance(player.Center, npc.Center) > 160f) { npc.localAI[0] = 0f; - if (expertMode && Main.rand.NextBool(2)) + float num179 = 6f; + Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num180 = player.position.X + (float)player.width * 0.5f - value9.X; + float num181 = Math.Abs(num180) * 0.1f; + float num182 = player.position.Y + (float)player.height * 0.5f - value9.Y - num181; + float num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182)); + npc.netUpdate = true; + num183 = num179 / num183; + num180 *= num183; + num182 *= num183; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + value9.X += num180; + value9.Y += num182; + int totalProjectiles = expertMode ? 6 : 4; + int spread = expertMode ? 90 : 60; + for (int num186 = 0; num186 < totalProjectiles; num186++) { - float num179 = 8f; - Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num180 = player.position.X + (float)player.width * 0.5f - value9.X; - float num181 = Math.Abs(num180) * 0.1f; - float num182 = player.position.Y + (float)player.height * 0.5f - value9.Y - num181; - float num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182)); - npc.netUpdate = true; + num180 = player.position.X + (float)player.width * 0.5f - value9.X; + num182 = player.position.Y + (float)player.height * 0.5f - value9.Y; + num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182)); num183 = num179 / num183; + num180 += (float)Main.rand.Next(-spread, spread + 1); + num182 += (float)Main.rand.Next(-spread, spread + 1); num180 *= num183; num182 *= num183; - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - value9.X += num180; - value9.Y += num182; - for (int num186 = 0; num186 < 3; num186++) - { - num180 = player.position.X + (float)player.width * 0.5f - value9.X; - num182 = player.position.Y + (float)player.height * 0.5f - value9.Y; - num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182)); - num183 = num179 / num183; - num180 += (float)Main.rand.Next(-60, 61); - num182 += (float)Main.rand.Next(-60, 61); - num180 *= num183; - num182 *= num183; - Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f); - } - } - else - { - float num179 = 8f; - Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num180 = player.position.X + (float)player.width * 0.5f - value9.X; - float num181 = Math.Abs(num180) * 0.1f; - float num182 = player.position.Y + (float)player.height * 0.5f - value9.Y - num181; - float num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182)); - npc.netUpdate = true; - num183 = num179 / num183; - num180 *= num183; - num182 *= num183; - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - value9.X += num180; - value9.Y += num182; - for (int num186 = 0; num186 < 4; num186++) - { - num180 = player.position.X + (float)player.width * 0.5f - value9.X; - num182 = player.position.Y + (float)player.height * 0.5f - value9.Y; - num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182)); - num183 = num179 / num183; - num180 += (float)Main.rand.Next(-60, 61); - num182 += (float)Main.rand.Next(-60, 61); - num180 *= num183; - num182 *= num183; - Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f); - } + Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } diff --git a/NPCs/SlimeGod/SlimeGodCore.cs b/NPCs/SlimeGod/SlimeGodCore.cs index 528ab9755e..71c0405e08 100644 --- a/NPCs/SlimeGod/SlimeGodCore.cs +++ b/NPCs/SlimeGod/SlimeGodCore.cs @@ -1,5 +1,6 @@ using CalamityMod.CalPlayer; using CalamityMod.Events; +using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; using CalamityMod.Items.Materials; @@ -418,54 +419,26 @@ namespace CalamityMod.NPCs.SlimeGod float divisor = malice ? 10f : 15f; if (npc.ai[1] % divisor == 0f && Vector2.Distance(player.Center, vectorCenter) > 160f) { - if (expertMode && Main.rand.NextBool(2)) - { - float num179 = revenge ? 2f : 3f; - Vector2 value9 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); - float num180 = player.position.X + player.width * 0.5f - value9.X; - float num181 = Math.Abs(num180) * 0.1f; - float num182 = player.position.Y + player.height * 0.5f - value9.Y - num181; - float num183 = (float)Math.Sqrt(num180 * num180 + num182 * num182); - npc.netUpdate = true; - num183 = num179 / num183; - num180 *= num183; - num182 *= num183; - int type = Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - value9.X += num180; - value9.Y += num182; - num180 = player.position.X + player.width * 0.5f - value9.X; - num182 = player.position.Y + player.height * 0.5f - value9.Y; - num183 = (float)Math.Sqrt(num180 * num180 + num182 * num182); - num183 = num179 / num183; - num180 *= num183; - num182 *= num183; - Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f); - } - else - { - float num179 = revenge ? 6f : 5f; - Vector2 value9 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); - float num180 = player.position.X + player.width * 0.5f - value9.X; - float num181 = Math.Abs(num180) * 0.1f; - float num182 = player.position.Y + player.height * 0.5f - value9.Y - num181; - float num183 = (float)Math.Sqrt(num180 * num180 + num182 * num182); - npc.netUpdate = true; - num183 = num179 / num183; - num180 *= num183; - num182 *= num183; - int type = Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - value9.X += num180; - value9.Y += num182; - num180 = player.position.X + player.width * 0.5f - value9.X; - num182 = player.position.Y + player.height * 0.5f - value9.Y; - num183 = (float)Math.Sqrt(num180 * num180 + num182 * num182); - num183 = num179 / num183; - num180 *= num183; - num182 *= num183; - Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f); - } + float num179 = expertMode ? 9f : 7.5f; + Vector2 value9 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + float num180 = player.position.X + player.width * 0.5f - value9.X; + float num181 = Math.Abs(num180) * 0.1f; + float num182 = player.position.Y + player.height * 0.5f - value9.Y - num181; + float num183 = (float)Math.Sqrt(num180 * num180 + num182 * num182); + num183 = num179 / num183; + num180 *= num183; + num182 *= num183; + int type = Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + value9.X += num180; + value9.Y += num182; + num180 = player.position.X + player.width * 0.5f - value9.X; + num182 = player.position.Y + player.height * 0.5f - value9.Y; + num183 = (float)Math.Sqrt(num180 * num180 + num182 * num182); + num183 = num179 / num183; + num180 *= num183; + num182 *= num183; + Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -478,59 +451,33 @@ namespace CalamityMod.NPCs.SlimeGod { if (npc.ai[1] % 40f == 0f) { - if (expertMode && Main.rand.NextBool(2)) + float num179 = expertMode ? 12f : 10f; + Vector2 value9 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + float num180 = player.position.X + player.width * 0.5f - value9.X; + float num181 = Math.Abs(num180) * 0.1f; + float num182 = player.position.Y + player.height * 0.5f - value9.Y - num181; + float num183 = (float)Math.Sqrt(num180 * num180 + num182 * num182); + num183 = num179 / num183; + num180 *= num183; + num182 *= num183; + int type = Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + value9.X += num180; + value9.Y += num182; + int totalProjectiles = expertMode ? 3 : 2; + int spread = expertMode ? 45 : 30; + for (int num186 = 0; num186 < totalProjectiles; num186++) { - float num179 = revenge ? 2f : 3f; - Vector2 value9 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); - float num180 = player.position.X + player.width * 0.5f - value9.X; - float num181 = Math.Abs(num180) * 0.1f; - float num182 = player.position.Y + player.height * 0.5f - value9.Y - num181; - float num183 = (float)Math.Sqrt(num180 * num180 + num182 * num182); - npc.netUpdate = true; - num183 = num179 / num183; - num180 *= num183; - num182 *= num183; - int type = Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - value9.X += num180; - value9.Y += num182; num180 = player.position.X + player.width * 0.5f - value9.X; num182 = player.position.Y + player.height * 0.5f - value9.Y; num183 = (float)Math.Sqrt(num180 * num180 + num182 * num182); num183 = num179 / num183; + num180 += Main.rand.Next(-spread, spread + 1); + num182 += Main.rand.Next(-spread, spread + 1); num180 *= num183; num182 *= num183; Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f); } - else - { - float num179 = revenge ? 6f : 5f; - Vector2 value9 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); - float num180 = player.position.X + player.width * 0.5f - value9.X; - float num181 = Math.Abs(num180) * 0.1f; - float num182 = player.position.Y + player.height * 0.5f - value9.Y - num181; - float num183 = (float)Math.Sqrt(num180 * num180 + num182 * num182); - npc.netUpdate = true; - num183 = num179 / num183; - num180 *= num183; - num182 *= num183; - int type = Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - value9.X += num180; - value9.Y += num182; - for (int num186 = 0; num186 < 2; num186++) - { - num180 = player.position.X + player.width * 0.5f - value9.X; - num182 = player.position.Y + player.height * 0.5f - value9.Y; - num183 = (float)Math.Sqrt(num180 * num180 + num182 * num182); - num183 = num179 / num183; - num180 += Main.rand.Next(-30, 31); - num182 += Main.rand.Next(-30, 31); - num180 *= num183; - num182 *= num183; - Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f); - } - } } } } @@ -691,8 +638,9 @@ namespace CalamityMod.NPCs.SlimeGod // Vanity DropHelper.DropItemFromSetChance(npc, 0.142857f, ModContent.ItemType(), ModContent.ItemType()); - // Other - } + // Equipment + DropHelper.DropItem(npc, ModContent.ItemType(), true); + } // Mark the Slime God as dead CalamityWorld.downedSlimeGod = true; diff --git a/NPCs/SlimeGod/SlimeGodRun.cs b/NPCs/SlimeGod/SlimeGodRun.cs index 591a60a177..a4cbb412e8 100644 --- a/NPCs/SlimeGod/SlimeGodRun.cs +++ b/NPCs/SlimeGod/SlimeGodRun.cs @@ -178,63 +178,30 @@ namespace CalamityMod.NPCs.SlimeGod if (npc.localAI[0] >= 450f && Vector2.Distance(player.Center, npc.Center) > 160f) { npc.localAI[0] = 0f; - if (expertMode && Main.rand.NextBool(2)) + float num179 = expertMode ? 12f : 10f; + Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num180 = player.position.X + (float)player.width * 0.5f - value9.X; + float num181 = Math.Abs(num180) * 0.1f; + float num182 = player.position.Y + (float)player.height * 0.5f - value9.Y - num181; + float num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182)); + num183 = num179 / num183; + num180 *= num183; + num182 *= num183; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + value9.X += num180; + value9.Y += num182; + for (int num186 = 0; num186 < 2; num186++) { - float num179 = revenge ? 9f : 8f; - Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num180 = player.position.X + (float)player.width * 0.5f - value9.X; - float num181 = Math.Abs(num180) * 0.1f; - float num182 = player.position.Y + (float)player.height * 0.5f - value9.Y - num181; - float num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182)); - npc.netUpdate = true; + num180 = player.position.X + (float)player.width * 0.5f - value9.X; + num182 = player.position.Y + (float)player.height * 0.5f - value9.Y; + num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182)); num183 = num179 / num183; + num180 += (float)Main.rand.Next(-10, 11); + num182 += (float)Main.rand.Next(-10, 11); num180 *= num183; num182 *= num183; - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - value9.X += num180; - value9.Y += num182; - for (int num186 = 0; num186 < 2; num186++) - { - num180 = player.position.X + (float)player.width * 0.5f - value9.X; - num182 = player.position.Y + (float)player.height * 0.5f - value9.Y; - num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182)); - num183 = num179 / num183; - num180 += (float)Main.rand.Next(-60, 61); - num182 += (float)Main.rand.Next(-60, 61); - num180 *= num183; - num182 *= num183; - Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f); - } - } - else - { - float num179 = revenge ? 9f : 8f; - Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num180 = player.position.X + (float)player.width * 0.5f - value9.X; - float num181 = Math.Abs(num180) * 0.1f; - float num182 = player.position.Y + (float)player.height * 0.5f - value9.Y - num181; - float num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182)); - npc.netUpdate = true; - num183 = num179 / num183; - num180 *= num183; - num182 *= num183; - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - value9.X += num180; - value9.Y += num182; - for (int num186 = 0; num186 < 2; num186++) - { - num180 = player.position.X + (float)player.width * 0.5f - value9.X; - num182 = player.position.Y + (float)player.height * 0.5f - value9.Y; - num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182)); - num183 = num179 / num183; - num180 += (float)Main.rand.Next(-30, 31); - num182 += (float)Main.rand.Next(-30, 31); - num180 *= num183; - num182 *= num183; - Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f); - } + Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f); } } } diff --git a/NPCs/SlimeGod/SlimeGodRunSplit.cs b/NPCs/SlimeGod/SlimeGodRunSplit.cs index de0f795620..5dd7120aaa 100644 --- a/NPCs/SlimeGod/SlimeGodRunSplit.cs +++ b/NPCs/SlimeGod/SlimeGodRunSplit.cs @@ -153,7 +153,7 @@ namespace CalamityMod.NPCs.SlimeGod } if (Main.netMode != NetmodeID.MultiplayerClient) - { + { npc.localAI[0] += flag100 ? 0.5f : 1f; if (revenge) npc.localAI[0] += 0.5f; @@ -163,61 +163,28 @@ namespace CalamityMod.NPCs.SlimeGod if (npc.localAI[0] >= 450f && Vector2.Distance(player.Center, npc.Center) > 160f) { npc.localAI[0] = 0f; - if (expertMode && Main.rand.NextBool(2)) - { - float num179 = revenge ? 9f : 8f; - Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num180 = player.position.X + (float)player.width * 0.5f - value9.X; - float num181 = Math.Abs(num180) * 0.1f; - float num182 = player.position.Y + (float)player.height * 0.5f - value9.Y - num181; - float num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182)); - npc.netUpdate = true; - num183 = num179 / num183; - num180 *= num183; - num182 *= num183; - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - value9.X += num180; - value9.Y += num182; - num180 = player.position.X + (float)player.width * 0.5f - value9.X; - num182 = player.position.Y + (float)player.height * 0.5f - value9.Y; - num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182)); - num183 = num179 / num183; - num180 += (float)Main.rand.Next(-30, 31); - num182 += (float)Main.rand.Next(-30, 31); - num180 *= num183; - num182 *= num183; - Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f); - } - else - { - float num179 = revenge ? 9f : 8f; - Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num180 = player.position.X + (float)player.width * 0.5f - value9.X; - float num181 = Math.Abs(num180) * 0.1f; - float num182 = player.position.Y + (float)player.height * 0.5f - value9.Y - num181; - float num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182)); - npc.netUpdate = true; - num183 = num179 / num183; - num180 *= num183; - num182 *= num183; - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - value9.X += num180; - value9.Y += num182; - num180 = player.position.X + (float)player.width * 0.5f - value9.X; - num182 = player.position.Y + (float)player.height * 0.5f - value9.Y; - num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182)); - num183 = num179 / num183; - num180 += (float)Main.rand.Next(-15, 16); - num182 += (float)Main.rand.Next(-15, 16); - num180 *= num183; - num182 *= num183; - Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f); - } - npc.netUpdate = true; - } - } + float num179 = expertMode ? 12f : 10f; + Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num180 = player.position.X + (float)player.width * 0.5f - value9.X; + float num181 = Math.Abs(num180) * 0.1f; + float num182 = player.position.Y + (float)player.height * 0.5f - value9.Y - num181; + float num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182)); + num183 = num179 / num183; + num180 *= num183; + num182 *= num183; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + value9.X += num180; + value9.Y += num182; + num180 = player.position.X + (float)player.width * 0.5f - value9.X; + num182 = player.position.Y + (float)player.height * 0.5f - value9.Y; + num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182)); + num183 = num179 / num183; + num180 *= num183; + num182 *= num183; + Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f); + } + } if (npc.ai[0] == 0f) { diff --git a/NPCs/SlimeGod/SlimeGodSplit.cs b/NPCs/SlimeGod/SlimeGodSplit.cs index aefab5f62a..14a26ad244 100644 --- a/NPCs/SlimeGod/SlimeGodSplit.cs +++ b/NPCs/SlimeGod/SlimeGodSplit.cs @@ -157,63 +157,34 @@ namespace CalamityMod.NPCs.SlimeGod if (npc.localAI[0] >= 600f && Vector2.Distance(player.Center, npc.Center) > 160f) { npc.localAI[0] = 0f; - if (expertMode && Main.rand.NextBool(2)) + float num179 = 6f; + Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num180 = player.position.X + (float)player.width * 0.5f - value9.X; + float num181 = Math.Abs(num180) * 0.1f; + float num182 = player.position.Y + (float)player.height * 0.5f - value9.Y - num181; + float num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182)); + num183 = num179 / num183; + num180 *= num183; + num182 *= num183; + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + value9.X += num180; + value9.Y += num182; + int totalProjectiles = expertMode ? 3 : 2; + int spread = expertMode ? 45 : 30; + for (int num186 = 0; num186 < totalProjectiles; num186++) { - float num179 = 8f; - Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num180 = player.position.X + (float)player.width * 0.5f - value9.X; - float num181 = Math.Abs(num180) * 0.1f; - float num182 = player.position.Y + (float)player.height * 0.5f - value9.Y - num181; - float num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182)); - npc.netUpdate = true; - num183 = num179 / num183; - num180 *= num183; - num182 *= num183; - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - value9.X += num180; - value9.Y += num182; num180 = player.position.X + (float)player.width * 0.5f - value9.X; num182 = player.position.Y + (float)player.height * 0.5f - value9.Y; num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182)); num183 = num179 / num183; - num180 += (float)Main.rand.Next(-30, 31); - num182 += (float)Main.rand.Next(-30, 31); + num180 += (float)Main.rand.Next(-spread, spread + 1); + num182 += (float)Main.rand.Next(-spread, spread + 1); num180 *= num183; num182 *= num183; Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f); } - else - { - float num179 = 8f; - Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num180 = player.position.X + (float)player.width * 0.5f - value9.X; - float num181 = Math.Abs(num180) * 0.1f; - float num182 = player.position.Y + (float)player.height * 0.5f - value9.Y - num181; - float num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182)); - npc.netUpdate = true; - num183 = num179 / num183; - num180 *= num183; - num182 *= num183; - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - value9.X += num180; - value9.Y += num182; - for (int num186 = 0; num186 < 2; num186++) - { - num180 = player.position.X + (float)player.width * 0.5f - value9.X; - num182 = player.position.Y + (float)player.height * 0.5f - value9.Y; - num183 = (float)Math.Sqrt((double)(num180 * num180 + num182 * num182)); - num183 = num179 / num183; - num180 += (float)Main.rand.Next(-30, 31); - num182 += (float)Main.rand.Next(-30, 31); - num180 *= num183; - num182 *= num183; - Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f); - } - } - npc.netUpdate = true; - } + } } if (npc.ai[0] == 0f) diff --git a/NPCs/StormWeaver/StormWeaverHead.cs b/NPCs/StormWeaver/StormWeaverHead.cs index b6158706cf..e3d4523559 100644 --- a/NPCs/StormWeaver/StormWeaverHead.cs +++ b/NPCs/StormWeaver/StormWeaverHead.cs @@ -757,9 +757,6 @@ namespace CalamityMod.NPCs.StormWeaver DropHelper.DropBags(npc); - // Legendary drop for Storm Weaver - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); - DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); bool lastSentinelKilled = CalamityWorld.downedSentinel1 && !CalamityWorld.downedSentinel2 && CalamityWorld.downedSentinel3; DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, lastSentinelKilled); @@ -772,6 +769,7 @@ namespace CalamityMod.NPCs.StormWeaver // Weapons DropHelper.DropItemChance(npc, ModContent.ItemType(), 4); DropHelper.DropItemChance(npc, ModContent.ItemType(), 4); + DropHelper.DropItemChance(npc, ModContent.ItemType(), 4); // Vanity DropHelper.DropItemChance(npc, ModContent.ItemType(), 7); diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index d3bbdb5384..00947ebb22 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -1,6 +1,7 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Events; +using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; using CalamityMod.Items.Materials; @@ -74,7 +75,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas private bool hasSummonedBrothers = false; private int giveUpCounter = 1200; - private int lootTimer = 0; //900 * 5 = 4500 private int phaseChange = 0; private int spawnX = 0; private int spawnX2 = 0; @@ -242,7 +242,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas writer.Write(npc.chaseable); writer.Write(giveUpCounter); - writer.Write(lootTimer); writer.Write(phaseChange); writer.Write(spawnX); writer.Write(spawnX2); @@ -294,7 +293,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.chaseable = reader.ReadBoolean(); giveUpCounter = reader.ReadInt32(); - lootTimer = reader.ReadInt32(); phaseChange = reader.ReadInt32(); spawnX = reader.ReadInt32(); spawnX2 = reader.ReadInt32(); @@ -326,8 +324,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas CalamityGlobalNPC.SCal = npc.whoAmI; - lootTimer++; - bool wormAlive = false; if (CalamityGlobalNPC.SCalWorm != -1) { @@ -2715,21 +2711,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas potionType = ModContent.ItemType(); } - // If SCal is killed too quickly, cancel all drops and chastise the player - public override bool SpecialNPCLoot() - { - //75 seconds for bullet hells + 25 seconds for normal phases. - //Does not occur in Boss Rush due to weakened SCal + stronger weapons (rarely occurs with just Cal gear) - if ((lootTimer < 6000) && !BossRushEvent.BossRushActive) - { - if (!BossRushEvent.BossRushActive) - CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.SCalFunnyCheatText", textColor); - return true; - } - - return false; - } - public override void NPCLoot() { // Create a teleport line effect @@ -2740,7 +2721,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas DropHelper.DropBags(npc); - // Legendary drop for SCal + // Only drops in Malice because this is Leviathan's item DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); // Levi drops directly from the boss so that you cannot obtain it by difficulty swapping bags @@ -2765,8 +2746,11 @@ namespace CalamityMod.NPCs.SupremeCalamitas DropHelper.WeightStack(w) ); - // SCal vanity set (This drops all at once, or not at all) - if (Main.rand.NextBool(7)) + // Equipment + DropHelper.DropItem(npc, ModContent.ItemType(), true); + + // SCal vanity set (This drops all at once, or not at all) + if (Main.rand.NextBool(7)) { DropHelper.DropItem(npc, ModContent.ItemType()); DropHelper.DropItem(npc, ModContent.ItemType()); @@ -2792,11 +2776,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas } #endregion - public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) - { - return !CalamityUtils.AntiButcher(npc, ref damage, 0.5f); - } - // Prevent the player from accidentally killing SCal instead of having her turn into a town NPC. public override bool CheckDead() { diff --git a/NPCs/SupremeCalamitas/SupremeCataclysm.cs b/NPCs/SupremeCalamitas/SupremeCataclysm.cs index 47b0fb99df..e3b3cf64d4 100644 --- a/NPCs/SupremeCalamitas/SupremeCataclysm.cs +++ b/NPCs/SupremeCalamitas/SupremeCataclysm.cs @@ -209,11 +209,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } - public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) - { - return !CalamityUtils.AntiButcher(npc, ref damage, 0.5f); - } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { SpriteEffects spriteEffects = SpriteEffects.None; diff --git a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs index d118c64b73..fc54824355 100644 --- a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs +++ b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs @@ -213,11 +213,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } - public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) - { - return !CalamityUtils.AntiButcher(npc, ref damage, 0.5f); - } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { SpriteEffects spriteEffects = SpriteEffects.None; diff --git a/NPCs/TownNPCs/DILF.cs b/NPCs/TownNPCs/DILF.cs index 41f13fe171..65e86775e3 100644 --- a/NPCs/TownNPCs/DILF.cs +++ b/NPCs/TownNPCs/DILF.cs @@ -17,6 +17,7 @@ using Terraria.GameContent.Events; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; + namespace CalamityMod.NPCs.TownNPCs { [AutoloadHead] @@ -147,6 +148,8 @@ namespace CalamityMod.NPCs.TownNPCs nextSlot++; shop.item[nextSlot].SetDefaults(ModContent.ItemType()); nextSlot++; + shop.item[nextSlot].SetDefaults(ModContent.ItemType()); + nextSlot++; } if (NPC.downedChristmasIceQueen && NPC.downedChristmasTree && NPC.downedChristmasSantank) { diff --git a/NPCs/VanillaNPCOverrides/Bosses/CultistAI.cs b/NPCs/VanillaNPCOverrides/Bosses/CultistAI.cs index a8f4c28c7d..fb62a5b67d 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/CultistAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/CultistAI.cs @@ -1,5 +1,5 @@ using CalamityMod.Events; -using CalamityMod.NPCs.Abyss; +using CalamityMod.NPCs.AdultEidolonWyrm; using CalamityMod.World; using Microsoft.Xna.Framework; using System; diff --git a/NPCs/Yharon/Yharon.cs b/NPCs/Yharon/Yharon.cs index 0606e838e9..69bc14a8ee 100644 --- a/NPCs/Yharon/Yharon.cs +++ b/NPCs/Yharon/Yharon.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Events; +using CalamityMod.Items.Accessories; using CalamityMod.Items.Accessories.Wings; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; @@ -2822,10 +2823,6 @@ namespace CalamityMod.NPCs.Yharon // Bags occur in either phase 1 or 2, as they don't contain phase 2 only drops DropHelper.DropBags(npc); - // Legendary drops for Yharon - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); - DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, CalamityWorld.malice); - // Normal drops: Everything that would otherwise be in the bag if (!Main.expertMode) { @@ -2839,8 +2836,9 @@ namespace CalamityMod.NPCs.Yharon DropHelper.WeightStack(w), DropHelper.WeightStack(w), // Yharon Kindle Staff DropHelper.WeightStack(w), // Infernal Spear - DropHelper.WeightStack(w) - ); + DropHelper.WeightStack(w), + DropHelper.WeightStack(w) + ); // Vanity DropHelper.DropItemChance(npc, ModContent.ItemType(), 7); @@ -2852,8 +2850,9 @@ namespace CalamityMod.NPCs.Yharon int soulFragMax = 22; DropHelper.DropItem(npc, ModContent.ItemType(), true, soulFragMin, soulFragMax); - // Equipment - DropHelper.DropItem(npc, ModContent.ItemType()); + // Equipment + DropHelper.DropItem(npc, ModContent.ItemType(), true); + DropHelper.DropItem(npc, ModContent.ItemType(), true); } // Vanity diff --git a/Particles/FusableParticleManager.cs b/Particles/FusableParticleManager.cs index a981918daf..a38ba79fcc 100644 --- a/Particles/FusableParticleManager.cs +++ b/Particles/FusableParticleManager.cs @@ -104,7 +104,7 @@ namespace CalamityMod.Particles /// /// Renders each cached instance with its connecting shader. /// - internal static void RenderAllFusableParticles(FusableParticleRenderLayer renderLayer) + internal static void RenderAllFusableParticles() { // Don't attempt to render anything serverside or on the menu. if (Main.netMode == NetmodeID.Server || Main.gameMenu) @@ -118,17 +118,8 @@ namespace CalamityMod.Particles if (particleSet.Particles.Count <= 0) continue; - // Ignore particle sets of incompatible render layers. - // They will be drawn later when appropriate. - if (renderLayer != particleSet.RenderLayer) - continue; - - bool needsRestartAtEnd = renderLayer == FusableParticleRenderLayer.OverWater; List backgroundTargets = particleSet.GetBackgroundTargets; - if (needsRestartAtEnd) - Main.spriteBatch.End(); - // Restart the sprite batch. This must be done with an immediate sort mode since a shader is going to be applied. Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.instance.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); @@ -164,9 +155,6 @@ namespace CalamityMod.Particles } Main.spriteBatch.End(); - - if (needsRestartAtEnd) - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.instance.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); } } @@ -176,6 +164,9 @@ namespace CalamityMod.Particles /// The type to check. internal static FusableParticleRenderCollection GetParticleRenderCollectionByType(Type type) { + if (Main.netMode == NetmodeID.Server) + return null; + return ParticleSets.First(s => s.ParticleSet.GetType() == type); } @@ -185,6 +176,9 @@ namespace CalamityMod.Particles /// The type to check. public static T GetParticleSetByType() where T : BaseFusableParticleSet { + if (Main.netMode == NetmodeID.Server) + return null; + return ParticleSets.First(s => s.ParticleSet.GetType() == typeof(T)).ParticleSet as T; } } diff --git a/Projectiles/Boss/AbyssMine.cs b/Projectiles/Boss/AbyssMine.cs deleted file mode 100644 index 454fd43911..0000000000 --- a/Projectiles/Boss/AbyssMine.cs +++ /dev/null @@ -1,80 +0,0 @@ -using CalamityMod.Events; -using CalamityMod.World; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Boss -{ - public class AbyssMine : ModProjectile - { - public override string Texture => "CalamityMod/Projectiles/Boss/AbyssBallVolley"; - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Abyss Mine"); - } - - public override void SetDefaults() - { - projectile.Calamity().canBreakPlayerDefense = true; - projectile.width = 30; - projectile.height = 30; - projectile.hostile = true; - projectile.alpha = 60; - projectile.penetrate = -1; - projectile.tileCollide = false; - projectile.timeLeft = (Main.expertMode || BossRushEvent.BossRushActive || CalamityWorld.malice) ? 3000 : 2400; - projectile.Calamity().affectedByMaliceModeVelocityMultiplier = true; - } - - public override void AI() - { - projectile.velocity *= 0.97f; - - if (projectile.ai[1] == 0f) - { - projectile.ai[1] = 1f; - Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 33); - } - - if (Main.rand.NextBool(6)) - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 173, 0f, 0f); - } - - public override void Kill(int timeLeft) - { - Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 14); - projectile.position = projectile.Center; - projectile.width = projectile.height = 96; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - for (int num621 = 0; num621 < 10; num621++) - { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1.2f); - Main.dust[num622].velocity *= 3f; - if (Main.rand.NextBool(2)) - { - Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; - } - } - for (int num623 = 0; num623 < 20; num623++) - { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1.7f); - Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1f); - Main.dust[num624].velocity *= 2f; - } - projectile.Damage(); - } - - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(projectile.Center, 12f, targetHitbox); - - public override void OnHitPlayer(Player target, int damage, bool crit) - { - target.AddBuff(BuffID.Weak, 240); - } - } -} diff --git a/Projectiles/Boss/AbyssMine2.cs b/Projectiles/Boss/AbyssMine2.cs deleted file mode 100644 index 658578467d..0000000000 --- a/Projectiles/Boss/AbyssMine2.cs +++ /dev/null @@ -1,86 +0,0 @@ -using CalamityMod.Events; -using CalamityMod.World; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Boss -{ - public class AbyssMine2 : ModProjectile - { - public override string Texture => "CalamityMod/Projectiles/Boss/AbyssBallVolley2"; - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Abyss Mine"); - } - - public override void SetDefaults() - { - projectile.Calamity().canBreakPlayerDefense = true; - projectile.width = 30; - projectile.height = 30; - projectile.hostile = true; - projectile.alpha = 60; - projectile.penetrate = -1; - projectile.tileCollide = false; - projectile.timeLeft = (Main.expertMode || BossRushEvent.BossRushActive || CalamityWorld.malice) ? 3000 : 2400; - projectile.Calamity().affectedByMaliceModeVelocityMultiplier = true; - } - - public override void AI() - { - projectile.velocity *= 0.99f; - - if (projectile.ai[1] == 0f) - { - projectile.ai[1] = 1f; - Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 33); - } - - if (Main.rand.NextBool(6)) - { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 127, 0f, 0f); - Main.dust[dust].noGravity = true; - } - } - - public override void Kill(int timeLeft) - { - Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 14); - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); - projectile.width = projectile.height = 96; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - for (int num621 = 0; num621 < 10; num621++) - { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default, 1.2f); - Main.dust[num622].velocity *= 3f; - Main.dust[num622].noGravity = true; - if (Main.rand.NextBool(2)) - { - Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; - } - } - for (int num623 = 0; num623 < 20; num623++) - { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default, 1.7f); - Main.dust[num624].noGravity = true; - Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default, 1f); - Main.dust[num624].velocity *= 2f; - } - projectile.Damage(); - } - - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(projectile.Center, 12f, targetHitbox); - - public override void OnHitPlayer(Player target, int damage, bool crit) - { - target.AddBuff(BuffID.Darkness, 240); - } - } -} diff --git a/Projectiles/Boss/BrimstoneGigaBlast.cs b/Projectiles/Boss/BrimstoneGigaBlast.cs index 717d25ec58..8536061fc4 100644 --- a/Projectiles/Boss/BrimstoneGigaBlast.cs +++ b/Projectiles/Boss/BrimstoneGigaBlast.cs @@ -118,8 +118,8 @@ namespace CalamityMod.Projectiles.Boss for (int i = 0; i < 8; i++) { offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 7f), (float)(Math.Cos(offsetAngle) * 7f), ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 1f); - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 7f), (float)(-Math.Cos(offsetAngle) * 7f), ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 1f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 7f), (float)(Math.Cos(offsetAngle) * 7f), ModContent.ProjectileType(), (int)Math.Round(projectile.damage * 0.75), projectile.knockBack, projectile.owner, 0f, 1f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 7f), (float)(-Math.Cos(offsetAngle) * 7f), ModContent.ProjectileType(), (int)Math.Round(projectile.damage * 0.75), projectile.knockBack, projectile.owner, 0f, 1f); } } } diff --git a/Projectiles/Boss/HolyBlast.cs b/Projectiles/Boss/HolyBlast.cs index 0b4bb9b9d4..6677d05517 100644 --- a/Projectiles/Boss/HolyBlast.cs +++ b/Projectiles/Boss/HolyBlast.cs @@ -7,6 +7,7 @@ using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Boss { public class HolyBlast : ModProjectile @@ -100,11 +101,13 @@ namespace CalamityMod.Projectiles.Boss double offsetAngle; float velocity = 5f; int totalProjectiles = (!Main.dayTime || CalamityWorld.malice) ? 5 : 4; + int type = ModContent.ProjectileType(); + int damage = (int)Math.Round(projectile.damage * 0.75); for (int i = 0; i < totalProjectiles; i++) { offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; - Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, (float)(Math.Sin(offsetAngle) * velocity), (float)(Math.Cos(offsetAngle) * velocity), ModContent.ProjectileType(), projectile.damage, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, (float)(-Math.Sin(offsetAngle) * velocity), (float)(-Math.Cos(offsetAngle) * velocity), ModContent.ProjectileType(), projectile.damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, (float)(Math.Sin(offsetAngle) * velocity), (float)(Math.Cos(offsetAngle) * velocity), type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(shootFromVector.X, shootFromVector.Y, (float)(-Math.Sin(offsetAngle) * velocity), (float)(-Math.Cos(offsetAngle) * velocity), type, damage, 0f, Main.myPlayer, 0f, 0f); } } Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/ProvidenceHolyBlastImpact"), projectile.Center); diff --git a/Projectiles/Boss/HolyBomb.cs b/Projectiles/Boss/HolyBomb.cs index c3e3767783..2875ea2dca 100644 --- a/Projectiles/Boss/HolyBomb.cs +++ b/Projectiles/Boss/HolyBomb.cs @@ -4,10 +4,12 @@ using CalamityMod.NPCs.Providence; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using System; using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Boss { public class HolyBomb : ModProjectile @@ -57,7 +59,7 @@ namespace CalamityMod.Projectiles.Boss projectile.position.Y = projectile.position.Y - (projectile.height / 2); if (projectile.owner == Main.myPlayer) { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, -2f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, -2f, ModContent.ProjectileType(), (int)Math.Round(projectile.damage * 0.75), projectile.knockBack, projectile.owner, 0f, 0f); } flareShootTimer = 60; } diff --git a/Projectiles/Boss/HolyLight.cs b/Projectiles/Boss/HolyLight.cs index 7dfc311d8c..046515bef3 100644 --- a/Projectiles/Boss/HolyLight.cs +++ b/Projectiles/Boss/HolyLight.cs @@ -38,8 +38,6 @@ namespace CalamityMod.Projectiles.Boss projectile.timeLeft = 160; } - bool expertMode = Main.expertMode; - if (projectile.velocity.Length() < 16f) projectile.velocity *= 1.01f; @@ -49,7 +47,7 @@ namespace CalamityMod.Projectiles.Boss return; float playerDist = Vector2.Distance(player.Center, projectile.Center); - if (playerDist < 50f && !player.dead && projectile.position.X < player.position.X + player.width && projectile.position.X + projectile.width > player.position.X && projectile.position.Y < player.position.Y + player.height && projectile.position.Y + projectile.height > player.position.Y) + if (!player.immune && playerDist < 50f && !player.dead && projectile.position.X < player.position.X + player.width && projectile.position.X + projectile.width > player.position.X && projectile.position.Y < player.position.Y + player.height && projectile.position.Y + projectile.height > player.position.Y) { int healAmt = (int)projectile.ai[1]; player.HealEffect(healAmt, false); diff --git a/Projectiles/Boss/IceBomb.cs b/Projectiles/Boss/IceBomb.cs index c136b8b193..f26b69aa4d 100644 --- a/Projectiles/Boss/IceBomb.cs +++ b/Projectiles/Boss/IceBomb.cs @@ -104,8 +104,8 @@ namespace CalamityMod.Projectiles.Boss for (i = 0; i < 3; i++) { offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * velocity), (float)(Math.Cos(offsetAngle) * velocity), ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 1f, 0f); - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * velocity), (float)(-Math.Cos(offsetAngle) * velocity), ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 1f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * velocity), (float)(Math.Cos(offsetAngle) * velocity), ModContent.ProjectileType(), (int)Math.Round(projectile.damage * 0.75), projectile.knockBack, projectile.owner, 1f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * velocity), (float)(-Math.Cos(offsetAngle) * velocity), ModContent.ProjectileType(), (int)Math.Round(projectile.damage * 0.75), projectile.knockBack, projectile.owner, 1f, 0f); } } diff --git a/Projectiles/Boss/MoltenBlast.cs b/Projectiles/Boss/MoltenBlast.cs index 65166200f6..e8dcd66d1c 100644 --- a/Projectiles/Boss/MoltenBlast.cs +++ b/Projectiles/Boss/MoltenBlast.cs @@ -114,7 +114,7 @@ namespace CalamityMod.Projectiles.Boss for (int b = 0; b < blobAmt; b++) { Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); - Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), projectile.damage, 0f, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), (int)Math.Round(projectile.damage * 0.75), 0f, projectile.owner, 0f, 0f); } } Main.PlaySound(SoundID.Item20, projectile.Center); diff --git a/Projectiles/Boss/MoltenBlob.cs b/Projectiles/Boss/MoltenBlob.cs index bd115c6f79..daa35eef32 100644 --- a/Projectiles/Boss/MoltenBlob.cs +++ b/Projectiles/Boss/MoltenBlob.cs @@ -18,13 +18,14 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - projectile.width = 12; + projectile.Calamity().canBreakPlayerDefense = true; + projectile.width = 12; projectile.height = 12; projectile.hostile = true; projectile.penetrate = -1; projectile.timeLeft = 900; projectile.scale = 1.5f; - cooldownSlot = 0; + cooldownSlot = 1; projectile.Calamity().affectedByMaliceModeVelocityMultiplier = true; } diff --git a/Projectiles/Boss/SandBlast.cs b/Projectiles/Boss/SandBlast.cs index 3a737fe118..b7ce0f151b 100644 --- a/Projectiles/Boss/SandBlast.cs +++ b/Projectiles/Boss/SandBlast.cs @@ -45,12 +45,26 @@ namespace CalamityMod.Projectiles.Boss projectile.ai[1] = 1f; Main.PlaySound(SoundID.Item, (int)projectile.position.X, (int)projectile.position.Y, 21); } - projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + 1.57f; + + if (projectile.ai[0] == 1f) + { + int num103 = Player.FindClosest(projectile.Center, 1, 1); + float inertia = 60f; + float scaleFactor2 = projectile.velocity.Length(); + Vector2 vector11 = Main.player[num103].Center - projectile.Center; + vector11.Normalize(); + vector11 *= scaleFactor2; + projectile.velocity = (projectile.velocity * (inertia - 1f) + vector11) / inertia; + projectile.velocity.Normalize(); + projectile.velocity *= scaleFactor2; + } + + projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + MathHelper.PiOver2; + projectile.alpha -= 50; if (projectile.alpha < 0) - { projectile.alpha = 0; - } + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 85, 0f, 0f, 100, default, 0.8f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; diff --git a/Projectiles/Boss/SandTooth.cs b/Projectiles/Boss/SandTooth.cs index 0b5a1fc8fe..dd13482776 100644 --- a/Projectiles/Boss/SandTooth.cs +++ b/Projectiles/Boss/SandTooth.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Projectiles.Boss projectile.hostile = true; projectile.ignoreWater = true; projectile.penetrate = 1; - projectile.timeLeft = 450; + projectile.timeLeft = 600; projectile.Calamity().affectedByMaliceModeVelocityMultiplier = true; } @@ -27,17 +27,24 @@ namespace CalamityMod.Projectiles.Boss { int num103 = Player.FindClosest(projectile.Center, 1, 1); projectile.ai[1] += 1f; - if (projectile.ai[1] < 250f && projectile.ai[1] > 60f) + if (projectile.ai[1] < 150f && projectile.ai[1] > 30f) { - float scaleFactor2 = projectile.velocity.Length(); + float inertia = 20f; + float scaleFactor2 = projectile.velocity.Length(); Vector2 vector11 = Main.player[num103].Center - projectile.Center; vector11.Normalize(); vector11 *= scaleFactor2; - projectile.velocity = (projectile.velocity * 24f + vector11) / 25f; + projectile.velocity = (projectile.velocity * (inertia - 1f) + vector11) / inertia; projectile.velocity.Normalize(); projectile.velocity *= scaleFactor2; } - projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + MathHelper.PiOver4; + else if (projectile.ai[0] == 1f) + { + if (projectile.velocity.Length() < 16f) + projectile.velocity *= 1.01f; + } + + projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + MathHelper.PiOver4; } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Boss/ToxicCloud.cs b/Projectiles/Boss/ToxicCloud.cs new file mode 100644 index 0000000000..a54768350e --- /dev/null +++ b/Projectiles/Boss/ToxicCloud.cs @@ -0,0 +1,85 @@ +using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Events; +using CalamityMod.World; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Boss +{ + public class ToxicCloud : ModProjectile + { + public override string Texture => "CalamityMod/Projectiles/Enemy/ToxicMinnowCloud"; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Toxic Cloud"); + Main.projFrames[projectile.type] = 4; + } + + public override void SetDefaults() + { + projectile.Calamity().canBreakPlayerDefense = true; + projectile.width = 52; + projectile.height = 48; + projectile.hostile = true; + projectile.alpha = 255; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.ignoreWater = true; + projectile.timeLeft = 900; + projectile.Calamity().affectedByMaliceModeVelocityMultiplier = true; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, 0.1f, 0.7f, 0f); + + bool malice = CalamityWorld.malice || BossRushEvent.BossRushActive; + if (projectile.velocity.Length() < (malice ? 10f : 8f)) + projectile.velocity *= 1.02f; + + projectile.frameCounter++; + if (projectile.frameCounter > 9) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 3) + projectile.frame = 0; + + projectile.ai[0] += 1f; + if (projectile.ai[0] >= 860f) + { + if (projectile.alpha < 255) + { + projectile.alpha += 5; + if (projectile.alpha > 255) + projectile.alpha = 255; + } + else if (projectile.owner == Main.myPlayer) + projectile.Kill(); + } + else if (projectile.alpha > 80) + { + projectile.alpha -= 30; + if (projectile.alpha < 80) + projectile.alpha = 80; + } + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(projectile.Center, 20f, targetHitbox); + + public override bool CanHitPlayer(Player target) => projectile.alpha == 80; + + public override void OnHitPlayer(Player target, int damage, bool crit) + { + if (projectile.alpha == 80) + { + target.AddBuff(BuffID.Poisoned, 120); + target.AddBuff(ModContent.BuffType(), 120); + } + } + } +} diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 740bade3a6..0659fba2e0 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -83,14 +83,6 @@ namespace CalamityMod.Projectiles public int lineColor = 0; // Note: Although this was intended for fishing line colors, I use this as an AI variable a lot because vanilla only has 4 that sometimes are already in use. ~Ben public bool extorterBoost = false; - // Organic/Inorganic Boosts - public bool hasOrganicEnemyHitBoost = false; - public bool hasInorganicEnemyHitBoost = false; - public float organicEnemyHitBoost = 0f; - public float inorganicEnemyHitBoost = 0f; - public Action organicEnemyHitEffect = null; - public Action inorganicEnemyHitEffect = null; - // Dogshit, hacky workarounds for the summon respawning system public bool RequiresManualResurrection = false; @@ -173,19 +165,8 @@ namespace CalamityMod.Projectiles trueMelee = true; break; - case ProjectileID.Bullet: - case ProjectileID.MeteorShot: case ProjectileID.BulletHighVelocity: case ProjectileID.ChlorophyteBullet: - case ProjectileID.CrystalBullet: - case ProjectileID.CursedBullet: - case ProjectileID.ExplosiveBullet: - case ProjectileID.GoldenBullet: - case ProjectileID.IchorBullet: - case ProjectileID.MoonlordBullet: - case ProjectileID.NanoBullet: - case ProjectileID.PartyBullet: - case ProjectileID.VenomBullet: case ProjectileID.WoodenArrowFriendly: case ProjectileID.BeeArrow: case ProjectileID.BoneArrow: @@ -226,6 +207,23 @@ namespace CalamityMod.Projectiles pointBlankShotDuration = basePointBlankShotDuration; break; + // Make bullets almost hitscan because that's how bullets should work in games :^) + // Chloro bullets are not here, because they home in + case ProjectileID.Bullet: + case ProjectileID.MeteorShot: + case ProjectileID.CrystalBullet: + case ProjectileID.IchorBullet: + case ProjectileID.CursedBullet: + case ProjectileID.VenomBullet: + case ProjectileID.PartyBullet: + case ProjectileID.NanoBullet: + case ProjectileID.ExplosiveBullet: + case ProjectileID.GoldenBullet: + case ProjectileID.MoonlordBullet: + projectile.extraUpdates += 2; + pointBlankShotDuration = basePointBlankShotDuration; + break; + case ProjectileID.FlamingJack: case ProjectileID.Anchor: case ProjectileID.Sunfury: @@ -2371,30 +2369,6 @@ namespace CalamityMod.Projectiles if (modPlayer.rottenDogTooth && projectile.Calamity().stealthStrike) target.AddBuff(BuffType(), RottenDogtooth.ArmorCrunchDebuffTime); - - // Super dummies have nearly 10 million max HP (which is used in damage calculations). - // This can very easily cause damage numbers that are unrealistic for the weapon. - // As a result, they are omitted in this code. - - List ignoreTheseBitches = new List() - { - NPCType(), - NPCID.TheDestroyerBody, //why aren't these bosses - NPCID.TheDestroyerTail - }; - if (!target.boss && ignoreTheseBitches.TrueForAll(x => target.type != x)) - { - if (target.Inorganic() && hasInorganicEnemyHitBoost) - { - damage += (int)(target.lifeMax * inorganicEnemyHitBoost); - inorganicEnemyHitEffect?.Invoke(target); - } - if (target.Organic() && hasOrganicEnemyHitBoost) - { - damage += (int)(target.lifeMax * organicEnemyHitBoost); - organicEnemyHitEffect?.Invoke(target); - } - } if (modPlayer.flamingItemEnchant && !projectile.minion && !projectile.npcProj) target.AddBuff(BuffType(), VulnerabilityHex.AflameDuration); diff --git a/Projectiles/DraedonsArsenal/PulseDragonProjectile.cs b/Projectiles/DraedonsArsenal/PulseDragonProjectile.cs index 820a4a8edd..32e631d304 100644 --- a/Projectiles/DraedonsArsenal/PulseDragonProjectile.cs +++ b/Projectiles/DraedonsArsenal/PulseDragonProjectile.cs @@ -48,8 +48,6 @@ namespace CalamityMod.Projectiles.DraedonsArsenal projectile.localNPCHitCooldown = 4; projectile.tileCollide = false; projectile.extraUpdates = 1; - projectile.Calamity().hasInorganicEnemyHitBoost = true; - projectile.Calamity().inorganicEnemyHitBoost = 0.003f; } public override void SendExtraAI(BinaryWriter writer) diff --git a/Projectiles/DraedonsArsenal/PulsePistolShot.cs b/Projectiles/DraedonsArsenal/PulsePistolShot.cs index b2eea27c1d..f7f2558603 100644 --- a/Projectiles/DraedonsArsenal/PulsePistolShot.cs +++ b/Projectiles/DraedonsArsenal/PulsePistolShot.cs @@ -39,8 +39,6 @@ namespace CalamityMod.Projectiles.DraedonsArsenal projectile.penetrate = 1; projectile.extraUpdates = 10; projectile.timeLeft = 120 * (1 + projectile.extraUpdates); - projectile.Calamity().hasInorganicEnemyHitBoost = true; - projectile.Calamity().inorganicEnemyHitBoost = 1f / 300f; } public override void AI() diff --git a/Projectiles/DraedonsArsenal/PulseRifleShot.cs b/Projectiles/DraedonsArsenal/PulseRifleShot.cs index d1412009e6..1062666d67 100644 --- a/Projectiles/DraedonsArsenal/PulseRifleShot.cs +++ b/Projectiles/DraedonsArsenal/PulseRifleShot.cs @@ -111,12 +111,6 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } } } - - if (!target.boss) - { - if (target.Inorganic()) - damage += target.lifeMax / 250; - } } public override void Kill(int timeLeft) diff --git a/Projectiles/DraedonsArsenal/PulseTurretShot.cs b/Projectiles/DraedonsArsenal/PulseTurretShot.cs index 88f051de21..49dfb4ac07 100644 --- a/Projectiles/DraedonsArsenal/PulseTurretShot.cs +++ b/Projectiles/DraedonsArsenal/PulseTurretShot.cs @@ -26,8 +26,6 @@ namespace CalamityMod.Projectiles.DraedonsArsenal projectile.minion = true; projectile.penetrate = 1; projectile.timeLeft = 600; - projectile.Calamity().hasInorganicEnemyHitBoost = true; - projectile.Calamity().inorganicEnemyHitBoost = 0.002f; projectile.extraUpdates = 1; } diff --git a/Projectiles/DraedonsArsenal/TeslaCannonShot.cs b/Projectiles/DraedonsArsenal/TeslaCannonShot.cs index 954725406c..5092b4fcbd 100644 --- a/Projectiles/DraedonsArsenal/TeslaCannonShot.cs +++ b/Projectiles/DraedonsArsenal/TeslaCannonShot.cs @@ -126,22 +126,6 @@ namespace CalamityMod.Projectiles.DraedonsArsenal ElectricalBurst(5f, 9f); } - public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) - { - if (!target.boss) - { - if (projectile.ai[1] >= 0f) - { - if (target.Organic()) - { - target.velocity.X = 0f; - target.velocity.Y = 0f; - damage += target.lifeMax / 250; - } - } - } - } - public override void Kill(int timeLeft) { bool notArcingProjectile = projectile.ai[1] >= 0f; diff --git a/Projectiles/Magic/ApotheosisWorm.cs b/Projectiles/Magic/ApotheosisWorm.cs index a0516e7e36..7fb7cdf9c4 100644 --- a/Projectiles/Magic/ApotheosisWorm.cs +++ b/Projectiles/Magic/ApotheosisWorm.cs @@ -75,6 +75,9 @@ namespace CalamityMod.Projectiles.Magic public override void SendExtraAI(BinaryWriter writer) { + if (Segments is null || Segments[0] is null) + InitializeSegments(); + for (int i = 0; i < Segments.Length; i++) { Segments[i].WriteTo(writer); @@ -83,6 +86,9 @@ namespace CalamityMod.Projectiles.Magic public override void ReceiveExtraAI(BinaryReader reader) { + if (Segments is null || Segments[0] is null) + InitializeSegments(); + for (int i = 0; i < Segments.Length; i++) { Segments[i].ReadFrom(reader); diff --git a/Projectiles/Magic/ArtAttackHoldout.cs b/Projectiles/Magic/ArtAttackHoldout.cs new file mode 100644 index 0000000000..614b606c5d --- /dev/null +++ b/Projectiles/Magic/ArtAttackHoldout.cs @@ -0,0 +1,83 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Magic +{ + public class ArtAttackHoldout : ModProjectile + { + public Player Owner => Main.player[projectile.owner]; + public const float AimResponsiveness = 0.72f; + + public override string Texture => "CalamityMod/Items/Weapons/Magic/ArtAttack"; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Art Attack"); + } + + public override void SetDefaults() + { + projectile.width = 70; + projectile.height = 70; + projectile.friendly = false; + projectile.magic = false; + projectile.tileCollide = false; + projectile.ignoreWater = true; + projectile.timeLeft = 90000; + } + + public override void AI() + { + // Common code among holdouts to keep the holdout projectile directly in the player's hand. + UpdatePlayerVisuals(); + + if (Main.myPlayer == projectile.owner) + { + // Update aim. + UpdateAim(); + + // Create the star. + if (projectile.localAI[0] == 0f) + { + Vector2 initialStarVelocity = projectile.velocity.SafeNormalize(Vector2.UnitY) * 15f; + Projectile.NewProjectile(projectile.Center, initialStarVelocity, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner); + projectile.localAI[0] = 1f; + } + + if (!Owner.channel) + projectile.Kill(); + } + } + + private void UpdatePlayerVisuals() + { + // Place the projectile directly into the player's hand at all times. + projectile.Center = Owner.RotatedRelativePoint(Owner.MountedCenter); + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver4; + + // The staff is a holdout projectile; update the player's variables to reflect this. + Owner.ChangeDir(projectile.direction); + Owner.heldProj = projectile.whoAmI; + Owner.itemTime = 2; + Owner.itemAnimation = 2; + Owner.itemRotation = CalamityUtils.WrapAngle90Degrees(projectile.rotation); + } + + // Adjusts the aim vector of the staff to point towards the mouse. This is Last Prism code. + private void UpdateAim() + { + Vector2 aimOffset = projectile.SafeDirectionTo(Main.MouseWorld, -Vector2.UnitY); + aimOffset = Vector2.Lerp(aimOffset, Vector2.Normalize(projectile.velocity), AimResponsiveness).SafeNormalize(Vector2.UnitY) * 30f; + + if (aimOffset != projectile.velocity) + { + projectile.netSpam = 0; + projectile.netUpdate = true; + } + projectile.velocity = aimOffset; + } + + public override bool CanDamage() => false; + } +} diff --git a/Projectiles/Magic/ArtAttackStar.cs b/Projectiles/Magic/ArtAttackStar.cs new file mode 100644 index 0000000000..c660e1aaf4 --- /dev/null +++ b/Projectiles/Magic/ArtAttackStar.cs @@ -0,0 +1,269 @@ +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Projectiles.Typeless; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using System.Collections.Generic; +using System.Linq; +using Terraria; +using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Magic +{ + public class ArtAttackStar : ModProjectile + { + public PrimitiveTrail TrailDrawer = null; + public Player Owner => Main.player[projectile.owner]; + public ref float Time => ref projectile.ai[0]; + public const int StarShapeCreationDelay = 12; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Star"); + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 120; + } + + public override void SetDefaults() + { + projectile.width = 2; + projectile.height = 2; + projectile.tileCollide = false; + projectile.ignoreWater = true; + projectile.timeLeft = 9000; + projectile.alpha = 255; + projectile.magic = true; + } + + public override void AI() + { + ProjectileID.Sets.TrailCacheLength[projectile.type] = 60; + + // Die if the holdout is gone. + if (Owner.ownedProjectileCounts[ModContent.ProjectileType()] <= 0 && Time >= 2f) + { + projectile.Kill(); + return; + } + + bool shapeIsComplete = false; + int shapeEndPoint = -1; + + // Determine if two points are intersecting with the star. + List cleanOldPositions = projectile.oldPos.Where(p => p != Vector2.Zero).ToList(); + if (Time > StarShapeCreationDelay) + { + int start = 12; + int end = cleanOldPositions.Count; + float averageDistanceFromStar = 0f; + float closedAngleLowerBound = (cleanOldPositions.Count - 2f) * MathHelper.Pi; + for (int i = end - 1; i >= start; i--) + { + float distanceFromStar = Vector2.Distance(projectile.position, projectile.oldPos[i]); + if (distanceFromStar < projectile.velocity.Length() * 0.7f + 12f) + { + shapeIsComplete = true; + + if (shapeEndPoint == -1) + shapeEndPoint = i; + } + averageDistanceFromStar += distanceFromStar; + } + averageDistanceFromStar /= end - start; + + // Cancel out intersection "completions" if the velocity is slow enough to be rebounding or the shape is relatively small. + if (averageDistanceFromStar < projectile.velocity.Length() + 70f || projectile.velocity.Length() < 16f) + shapeIsComplete = false; + } + + // Idly emit dust. + EmitIdleDust(); + + // Die if the owner is no longer channeling the staff or a complete shape is made. + // If a complete shape is made, do damage checks. + // The shape end point exists in cases where a shape is completed but an NPC is not in the part that is enclosed. + if (!Owner.channel || shapeIsComplete) + { + if (shapeIsComplete) + { + Main.PlaySound(SoundID.DD2_DarkMageHealImpact, Owner.Center); + DoShapeHitAreaChecks(cleanOldPositions, shapeEndPoint); + } + + projectile.Kill(); + return; + } + + // Fade in. + projectile.Opacity = MathHelper.Clamp(projectile.Opacity + 0.1f, 0f, 1f); + + // Update movement. + if (Main.myPlayer == projectile.owner) + DoMouseMovement(); + + Time++; + } + + public void DoMouseMovement() + { + Vector2 destination = Main.MouseWorld; + float distanceFromTarget = projectile.Distance(destination); + float moveInterpolant = Utils.InverseLerp(0f, 100f, distanceFromTarget, true) * Utils.InverseLerp(600f, 400f, distanceFromTarget, true); + Vector2 targetCenterOffsetVec = destination - projectile.Center; + float movementSpeed = MathHelper.Min(60f, targetCenterOffsetVec.Length()); + Vector2 idealVelocity = targetCenterOffsetVec.SafeNormalize(Vector2.Zero) * movementSpeed; + + // Ensure velocity never has a magnitude less than 2. + if (projectile.velocity.Length() < 2f) + projectile.velocity += projectile.velocity.RotatedBy(MathHelper.PiOver4).SafeNormalize(Vector2.Zero) * 2f; + + // Die if anything goes wrong with the velocity. + if (projectile.velocity.HasNaNs()) + projectile.Kill(); + + // Approach the ideal velocity. + projectile.velocity = Vector2.Lerp(projectile.velocity, idealVelocity, moveInterpolant * 0.15f); + projectile.velocity = projectile.velocity.MoveTowards(idealVelocity, 6f); + if (projectile.velocity.AngleBetween(projectile.oldVelocity) < 0.85f && projectile.velocity.AngleBetween(idealVelocity) > 1.4f) + projectile.velocity = projectile.velocity.RotatedBy(0.35f) * 0.75f; + + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; + + // Continuously sync since mouse information is local. + projectile.netUpdate = true; + projectile.netSpam = 0; + } + + public void EmitIdleDust() + { + bool slowMovement = projectile.velocity.Length() < 6f; + int dustCount = slowMovement ? 3 : 1; + + for (int i = 0; i < dustCount; i++) + { + Dust rainbowMagic = Dust.NewDustPerfect(projectile.Center + Main.rand.NextVector2Circular(8f, 8f), 261); + rainbowMagic.velocity = Main.rand.NextVector2Circular(6f, 6f) - (projectile.velocity * 0.16f).RotatedByRandom(0.51f); + if (slowMovement) + rainbowMagic.velocity -= Vector2.UnitY.RotatedByRandom(0.81f) * Main.rand.NextFloat(4.5f); + + rainbowMagic.color = Main.hslToRgb(Main.rand.NextFloat(), 1f, Main.rand.NextFloat(0.5f, 0.9f)); + rainbowMagic.color.A = 128; + rainbowMagic.scale = Main.rand.NextFloat(1.3f, 1.6f); + rainbowMagic.fadeIn = 0.4f; + rainbowMagic.noGravity = true; + } + } + + public void DoShapeHitAreaChecks(List cleanOldPositions, int shapeEndPoint) + { + float damageFactor = MathHelper.Lerp(1f, ArtAttack.MaxDamageBoostFactor, Utils.InverseLerp(0f, ArtAttack.MaxDamageBoostTime, Time, true)); + int damage = (int)(projectile.damage * damageFactor); + for (int i = 0; i < Main.maxNPCs; i++) + { + if (!Main.npc[i].CanBeChasedBy()) + continue; + + bool enemyIsInShape = false; + + // Find the top left and bottom right bounds of the shape by using min/maxes. + Vector2 topLeft = new Vector2(1000000f, 1000000f); + Vector2 bottomRight = new Vector2(-1000000f, -1000000f); + for (int j = 0; j < shapeEndPoint; j++) + { + topLeft.X = MathHelper.Min(topLeft.X, cleanOldPositions[j].X); + topLeft.Y = MathHelper.Min(topLeft.Y, cleanOldPositions[j].Y); + bottomRight.X = MathHelper.Max(bottomRight.X, cleanOldPositions[j].X); + bottomRight.Y = MathHelper.Max(bottomRight.Y, cleanOldPositions[j].Y); + } + + // Roughly estimate if the NPC is within the shape with line v line and rectangle checks. + // There's probably a more mathematically pleasing way to do this but for it works sufficiently well. + Vector2 center = (topLeft + bottomRight) * 0.5f; + Vector2 area = new Vector2(Math.Abs(bottomRight.X - topLeft.X), Math.Abs(bottomRight.Y - topLeft.Y)) * 0.8f; + Rectangle shapeRectangle = Utils.CenteredRectangle(center, area); + for (int j = 0; j < cleanOldPositions.Count; j++) + { + Vector2 left = Main.npc[i].Center - Vector2.UnitX * 2000f; + Vector2 right = Main.npc[i].Center + Vector2.UnitX * 2000f; + bool inRangeOfStars = shapeRectangle.Intersects(Main.npc[i].Hitbox); + bool lineCheck = Collision.CheckLinevLine(left, right, cleanOldPositions[j], cleanOldPositions[(j + 1) % cleanOldPositions.Count]).Length > 0; + if (lineCheck && inRangeOfStars) + { + enemyIsInShape = true; + break; + } + } + + // Strike an enemy if it's in the shape. + if (enemyIsInShape) + { + Main.PlaySound(SoundID.DD2_LightningBugZap, Main.npc[i].Center); + CreateDustExplosionEffect(Main.npc[i].Center); + + if (Main.myPlayer == projectile.owner) + { + int strike = Projectile.NewProjectile(Main.npc[i].Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, projectile.owner, i); + if (Main.projectile.IndexInRange(strike)) + Main.projectile[strike].Calamity().forceMelee = true; + } + } + } + } + + public void CreateDustExplosionEffect(Vector2 dustSpawnPosition) + { + for (int i = 0; i < 60; i++) + { + Dust rainbowMagic = Dust.NewDustPerfect(dustSpawnPosition + Main.rand.NextVector2Circular(12f, 12f), 267); + rainbowMagic.velocity = Main.rand.NextVector2Unit() * Main.rand.NextFloat(2f, 9.5f); + rainbowMagic.color = Main.hslToRgb(Main.rand.NextFloat(), 1f, Main.rand.NextFloat(0.5f, 0.9f)); + rainbowMagic.color.A = 100; + rainbowMagic.scale = Main.rand.NextFloat(1f, 1.25f); + rainbowMagic.fadeIn = Main.rand.NextFloat(0.4f, 1f); + rainbowMagic.noGravity = true; + } + } + + public override void Kill(int timeLeft) => CreateDustExplosionEffect(projectile.Center); + + public Color TrailColor(float completionRatio) + { + float hue = (Main.GlobalTime * -0.62f + completionRatio * 1.5f) % 1f; + float brightness = MathHelper.SmoothStep(0.5f, 1f, Utils.InverseLerp(0.3f, 0f, completionRatio, true)); + float opacity = Utils.InverseLerp(1f, 0.8f, completionRatio, true) * projectile.Opacity; + Color color = Main.hslToRgb(hue, 1f, brightness) * opacity; + color.A = (byte)(int)(Utils.InverseLerp(0f, 0.2f, completionRatio) * 128); + return color; + } + + public float TrailWidth(float completionRatio) + { + float widthInterpolant = Utils.InverseLerp(-0.1f, 0.25f, completionRatio, true) * Utils.InverseLerp(1.1f, 0.5f, completionRatio, true); + return MathHelper.SmoothStep(0f, 20f, widthInterpolant); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + if (TrailDrawer is null) + TrailDrawer = new PrimitiveTrail(TrailWidth, TrailColor, null, GameShaders.Misc["CalamityMod:ArtAttack"]); + + Texture2D texture = Main.projectileTexture[projectile.type]; + Vector2 drawPosition = projectile.Center - Main.screenPosition + Vector2.UnitY * projectile.gfxOffY; + Vector2 origin = texture.Size() * 0.5f; + + spriteBatch.EnterShaderRegion(); + GameShaders.Misc["CalamityMod:ArtAttack"].SetShaderTexture(ModContent.GetTexture("CalamityMod/ExtraTextures/FabstaffStreak")); + GameShaders.Misc["CalamityMod:ArtAttack"].Apply(); + + TrailDrawer.Draw(projectile.oldPos, projectile.Size * 0.5f - Main.screenPosition, 100); + spriteBatch.ExitShaderRegion(); + + spriteBatch.Draw(texture, drawPosition, null, projectile.GetAlpha(Color.White), projectile.rotation, origin, projectile.scale, 0, 0f); + return false; + } + + // The star itself does not do contact damage. + public override bool CanDamage() => false; + } +} \ No newline at end of file diff --git a/Projectiles/Magic/ArtAttackStar.png b/Projectiles/Magic/ArtAttackStar.png new file mode 100644 index 0000000000..f31119a8d1 Binary files /dev/null and b/Projectiles/Magic/ArtAttackStar.png differ diff --git a/Projectiles/Magic/ClamorNoctusWyvern.png b/Projectiles/Magic/ClamorNoctusWyvern.png index 7a244dd21c..514dbd4679 100644 Binary files a/Projectiles/Magic/ClamorNoctusWyvern.png and b/Projectiles/Magic/ClamorNoctusWyvern.png differ diff --git a/Projectiles/Magic/Crescent.png b/Projectiles/Magic/Crescent.png index 6d0844d54a..ca8f2ad58d 100644 Binary files a/Projectiles/Magic/Crescent.png and b/Projectiles/Magic/Crescent.png differ diff --git a/Projectiles/Magic/EidolicWailSoundwave.cs b/Projectiles/Magic/EidolicWailSoundwave.cs index ee34188fd4..d99917b966 100644 --- a/Projectiles/Magic/EidolicWailSoundwave.cs +++ b/Projectiles/Magic/EidolicWailSoundwave.cs @@ -26,8 +26,9 @@ namespace CalamityMod.Projectiles.Magic projectile.ignoreWater = true; projectile.penetrate = -1; projectile.magic = true; + projectile.extraUpdates = 1; projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 8; + projectile.localNPCHitCooldown = 16; projectile.timeLeft = 450; projectile.Calamity().PierceResistHarshness = 0.06f; projectile.Calamity().PierceResistCap = 0.4f; @@ -35,16 +36,10 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { - if (projectile.ai[0] == 0f) - { - if (projectile.velocity.Length() < 16f) - projectile.velocity *= 1.02f; - } - if (projectile.localAI[0] < 1f) { - projectile.localAI[0] += 0.005f; //200 to reach full size and max power - projectile.scale += 0.005f; + projectile.localAI[0] += 0.02f; // 50 frames to reach full size and max power + projectile.scale += 0.02f; projectile.width = (int)(36f * projectile.scale); projectile.height = (int)(36f * projectile.scale); } @@ -77,11 +72,6 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 240); - - if (projectile.velocity.Length() > 3f) - projectile.velocity *= 0.9f; - - projectile.ai[0] = 1f; } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Magic/HadopelagicEcho2.cs b/Projectiles/Magic/HadopelagicEcho2.cs index 784e61a8c8..d8aa187ae6 100644 --- a/Projectiles/Magic/HadopelagicEcho2.cs +++ b/Projectiles/Magic/HadopelagicEcho2.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Magic projectile.penetrate = -1; projectile.magic = true; projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = -1; + projectile.localNPCHitCooldown = 8; projectile.timeLeft = 30; projectile.extraUpdates = 1; projectile.tileCollide = false; @@ -37,9 +37,6 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { - projectile.width = (int)(36f * projectile.scale); - projectile.height = (int)(36f * projectile.scale); - if (projectile.alpha > 100) projectile.alpha -= 25; if (projectile.alpha < 100) diff --git a/Projectiles/Magic/HadopelagicEchoSoundwave.cs b/Projectiles/Magic/HadopelagicEchoSoundwave.cs index e041fcd22d..db38ec780f 100644 --- a/Projectiles/Magic/HadopelagicEchoSoundwave.cs +++ b/Projectiles/Magic/HadopelagicEchoSoundwave.cs @@ -13,7 +13,6 @@ namespace CalamityMod.Projectiles.Magic private int echoCooldown = 0; private bool playedSound = false; - private static int penetrationAmt = 50; public override void SetStaticDefaults() { @@ -30,10 +29,11 @@ namespace CalamityMod.Projectiles.Magic projectile.alpha = 100; projectile.friendly = true; projectile.ignoreWater = true; - projectile.penetrate = penetrationAmt; - projectile.magic = true; + projectile.penetrate = -1; + projectile.extraUpdates = 1; + projectile.magic = true; projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 8; + projectile.localNPCHitCooldown = 16; projectile.timeLeft = 450; projectile.Calamity().PierceResistHarshness = 0.06f; projectile.Calamity().PierceResistCap = 0.4f; @@ -82,26 +82,24 @@ namespace CalamityMod.Projectiles.Magic public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { - damage = (int)((double)damage * projectile.localAI[0] * (0.5D + (0.5D / projectile.penetrate))); + damage = (int)(damage * projectile.localAI[0]); } public override void ModifyHitPvp(Player target, ref int damage, ref bool crit) { - damage = (int)((double)damage * projectile.localAI[0] * (0.5D + (0.5D / projectile.penetrate))); + damage = (int)(damage * projectile.localAI[0]); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 240); - projectile.velocity *= 0.85f; - if (echoCooldown <= 0) { - echoCooldown = 60; + echoCooldown = 120; int echoID = ModContent.ProjectileType(); int echoDamage = (int)(0.2f * projectile.damage); float echoKB = projectile.knockBack / 3; - int echos = 5; + int echos = 2; for (int i = 0; i < echos; ++i) { float startDist = Main.rand.NextFloat(260f, 270f); diff --git a/Projectiles/Magic/MagnusBeam.cs b/Projectiles/Magic/MagnusBeam.cs index 132b7a79af..cf0547c878 100644 --- a/Projectiles/Magic/MagnusBeam.cs +++ b/Projectiles/Magic/MagnusBeam.cs @@ -1,3 +1,4 @@ +using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -23,7 +24,6 @@ namespace CalamityMod.Projectiles.Magic projectile.penetrate = 1; projectile.extraUpdates = 2; projectile.alpha = 0; - projectile.magic = true; } public override void AI() @@ -202,9 +202,16 @@ namespace CalamityMod.Projectiles.Magic return false; } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 480); + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (!target.canGhostHeal || Main.player[projectile.owner].moonLeech) + target.AddBuff(ModContent.BuffType(), 480); + + if (!target.canGhostHeal || Main.player[projectile.owner].moonLeech) return; Player player = Main.player[projectile.owner]; diff --git a/Projectiles/Magic/SmallSpirit.cs b/Projectiles/Magic/SmallSpirit.cs index 4a0b5b8997..4d69980a21 100644 --- a/Projectiles/Magic/SmallSpirit.cs +++ b/Projectiles/Magic/SmallSpirit.cs @@ -108,7 +108,7 @@ namespace CalamityMod.Projectiles.Magic // Emit particles. Vector2 spawnPosition = projectile.Center + Main.rand.NextVector2Circular(5f, 5f) * radius / 130f; - FusableParticleManager.GetParticleSetByType().SpawnParticle(spawnPosition, radius); + FusableParticleManager.GetParticleSetByType()?.SpawnParticle(spawnPosition, radius); } public override Color? GetAlpha(Color lightColor) => Color.White * projectile.Opacity; diff --git a/Projectiles/Magic/SpiritCongregation.cs b/Projectiles/Magic/SpiritCongregation.cs index b8e04f6890..abb2e7fe15 100644 --- a/Projectiles/Magic/SpiritCongregation.cs +++ b/Projectiles/Magic/SpiritCongregation.cs @@ -115,6 +115,8 @@ namespace CalamityMod.Projectiles.Magic } } + projectile.rotation = projectile.velocity.ToRotation(); + // Handle dynamic damage. if (BaseDamage == 0f) BaseDamage = projectile.damage; @@ -198,7 +200,6 @@ namespace CalamityMod.Projectiles.Magic // Approach the ideal velocity. projectile.velocity = projectile.velocity.MoveTowards(idealVelocity, MovementSpeed * 0.04f); projectile.velocity = (projectile.velocity * (inertia - 1f) + idealVelocity) / inertia; - projectile.rotation = projectile.velocity.ToRotation(); } public void ReleaseSmallSpirits() @@ -232,12 +233,12 @@ namespace CalamityMod.Projectiles.Magic { // Summon a base particle. Vector2 spawnPosition = projectile.Center + Main.rand.NextVector2Circular(1f, 1f) * particleSize / 26f; - FusableParticleManager.GetParticleSetByType().SpawnParticle(spawnPosition, particleSize); + FusableParticleManager.GetParticleSetByType()?.SpawnParticle(spawnPosition, particleSize); // And an "ahead" particle that spawns based on current movement. // This causes the "head" of the overall thing to have bumps when moving. spawnPosition += projectile.velocity.RotatedByRandom(1.38f) * particleSize / 105f; - FusableParticleManager.GetParticleSetByType().SpawnParticle(spawnPosition, particleSize * 0.4f); + FusableParticleManager.GetParticleSetByType()?.SpawnParticle(spawnPosition, particleSize * 0.4f); } // Release gas projectiles randomly. This does not happen when dying. diff --git a/Projectiles/Magic/SpiritDust.cs b/Projectiles/Magic/SpiritDust.cs index 652cc57501..849438ff38 100644 --- a/Projectiles/Magic/SpiritDust.cs +++ b/Projectiles/Magic/SpiritDust.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Magic { float radius = MathHelper.SmoothStep(80f, 48f, 1f - projectile.timeLeft / 90f); Vector2 spawnPosition = projectile.Center + Main.rand.NextVector2Circular(5f, 5f) * radius / 130f; - FusableParticleManager.GetParticleSetByType().SpawnParticle(spawnPosition, radius); + FusableParticleManager.GetParticleSetByType()?.SpawnParticle(spawnPosition, radius); } } } diff --git a/Projectiles/Melee/AegisBlast2.cs b/Projectiles/Melee/AegisBlast2.cs index 5eca076486..8caed9f8a2 100644 --- a/Projectiles/Melee/AegisBlast2.cs +++ b/Projectiles/Melee/AegisBlast2.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Projectiles.Melee projectile.ignoreWater = false; projectile.tileCollide = false; projectile.penetrate = -1; - projectile.timeLeft = 60; + projectile.timeLeft = 5; projectile.melee = true; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; diff --git a/Projectiles/Melee/CrescentMoonFlail.png b/Projectiles/Melee/CrescentMoonFlail.png index c9843d69f4..b9ea952ecf 100644 Binary files a/Projectiles/Melee/CrescentMoonFlail.png and b/Projectiles/Melee/CrescentMoonFlail.png differ diff --git a/Projectiles/Melee/FossilSpike.cs b/Projectiles/Melee/FossilSpike.cs deleted file mode 100644 index 1281e38dee..0000000000 --- a/Projectiles/Melee/FossilSpike.cs +++ /dev/null @@ -1,41 +0,0 @@ -using Terraria; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Melee -{ - public class FossilSpike : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Spike"); - Main.projFrames[projectile.type] = 4; - } - - public override void SetDefaults() - { - projectile.width = 20; - projectile.height = 40; - projectile.friendly = true; - projectile.penetrate = 2; - projectile.tileCollide = false; - projectile.timeLeft = 300; - projectile.melee = true; - projectile.usesIDStaticNPCImmunity = true; - projectile.idStaticNPCHitCooldown = 10; - } - - public override void AI() - { - if (Main.rand.NextBool(5)) - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 32, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); - - projectile.frameCounter++; - if (projectile.frameCounter > 4) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame > 3) - projectile.frame = 0; - } - } -} diff --git a/Projectiles/Melee/FossilSpike.png b/Projectiles/Melee/FossilSpike.png deleted file mode 100644 index fb666e7969..0000000000 Binary files a/Projectiles/Melee/FossilSpike.png and /dev/null differ diff --git a/Projectiles/Melee/IllustriousKnife.cs b/Projectiles/Melee/IllustriousKnife.cs index cf0e1afd23..3908c920f7 100644 --- a/Projectiles/Melee/IllustriousKnife.cs +++ b/Projectiles/Melee/IllustriousKnife.cs @@ -20,8 +20,8 @@ namespace CalamityMod.Projectiles.Melee public override void SetDefaults() { - projectile.width = 18; - projectile.height = 18; + projectile.width = 14; + projectile.height = 50; projectile.friendly = true; projectile.melee = true; projectile.penetrate = 1; diff --git a/Projectiles/Melee/IllustriousKnife.png b/Projectiles/Melee/IllustriousKnife.png index d8793dd624..167d5ab8eb 100644 Binary files a/Projectiles/Melee/IllustriousKnife.png and b/Projectiles/Melee/IllustriousKnife.png differ diff --git a/Projectiles/Ranged/AMRShot.cs b/Projectiles/Ranged/AMRShot.cs index 7949bc4aa9..e623f004d7 100644 --- a/Projectiles/Ranged/AMRShot.cs +++ b/Projectiles/Ranged/AMRShot.cs @@ -74,18 +74,15 @@ namespace CalamityMod.Projectiles.Ranged private void OnHitEffects(Vector2 targetPos, bool crit) { - bool skullmasher = projectile.ai[1] == 1f; - if (crit || skullmasher) + if (crit) { - int extraProjectileAmt = skullmasher ? 4 : 8; + int extraProjectileAmt = 8; for (int x = 0; x < extraProjectileAmt; x++) { if (projectile.owner == Main.myPlayer) { - bool fromRight = skullmasher ? x > 1 : x > 3; + bool fromRight = x > 3; CalamityUtils.ProjectileBarrage(projectile.Center, targetPos, fromRight, 500f, 500f, 0f, 500f, 10f, ModContent.ProjectileType(), (int)(projectile.damage * 0.1), projectile.knockBack * 0.1f, projectile.owner); - if (skullmasher) - CalamityUtils.ProjectileBarrage(projectile.Center, targetPos, fromRight, 1000f, 1000f, 0f, 1000f, 12f, (int)projectile.ai[0], (int)(projectile.damage * 0.1), projectile.knockBack * 0.1f, projectile.owner); } } } diff --git a/Projectiles/Ranged/AccelerationBulletProj.cs b/Projectiles/Ranged/AccelerationBulletProj.cs index 291f488c2d..c65b098b39 100644 --- a/Projectiles/Ranged/AccelerationBulletProj.cs +++ b/Projectiles/Ranged/AccelerationBulletProj.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.ranged = true; projectile.penetrate = 1; projectile.timeLeft = 600; - projectile.extraUpdates = 1; + projectile.extraUpdates = 3; aiType = ProjectileID.Bullet; projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; } diff --git a/Projectiles/Ranged/AcidBulletProj.cs b/Projectiles/Ranged/AcidBulletProj.cs index 456a797abf..b69324fecc 100644 --- a/Projectiles/Ranged/AcidBulletProj.cs +++ b/Projectiles/Ranged/AcidBulletProj.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.ranged = true; projectile.penetrate = 1; projectile.timeLeft = 600; - projectile.extraUpdates = 1; + projectile.extraUpdates = 3; aiType = ProjectileID.Bullet; projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; } diff --git a/Projectiles/Ranged/BloodClotFriendly.cs b/Projectiles/Ranged/BloodClotFriendly.cs index 40dd3cd2d4..bd6a0b2206 100644 --- a/Projectiles/Ranged/BloodClotFriendly.cs +++ b/Projectiles/Ranged/BloodClotFriendly.cs @@ -23,6 +23,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.ranged = true; projectile.penetrate = 1; projectile.aiStyle = 1; + projectile.extraUpdates = 3; aiType = ProjectileID.Bullet; projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; } diff --git a/Projectiles/Ranged/EnhancedNanoRoundProj.cs b/Projectiles/Ranged/EnhancedNanoRoundProj.cs index b3e2b15138..3ce8fe6181 100644 --- a/Projectiles/Ranged/EnhancedNanoRoundProj.cs +++ b/Projectiles/Ranged/EnhancedNanoRoundProj.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.ranged = true; projectile.penetrate = 1; projectile.timeLeft = 600; - projectile.extraUpdates = 1; + projectile.extraUpdates = 3; aiType = ProjectileID.Bullet; projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; } diff --git a/Projectiles/Ranged/FlashBulletProj.cs b/Projectiles/Ranged/FlashBulletProj.cs index 6f9e5b4708..b63f939874 100644 --- a/Projectiles/Ranged/FlashBulletProj.cs +++ b/Projectiles/Ranged/FlashBulletProj.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.ranged = true; projectile.penetrate = 1; projectile.timeLeft = 600; - projectile.extraUpdates = 1; + projectile.extraUpdates = 3; aiType = ProjectileID.Bullet; projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; } diff --git a/Projectiles/Ranged/HyperiusBulletProj.cs b/Projectiles/Ranged/HyperiusBulletProj.cs index 255640f7b4..2de850cd35 100644 --- a/Projectiles/Ranged/HyperiusBulletProj.cs +++ b/Projectiles/Ranged/HyperiusBulletProj.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.ranged = true; projectile.penetrate = 1; projectile.timeLeft = 600; - projectile.extraUpdates = 1; + projectile.extraUpdates = 3; aiType = ProjectileID.Bullet; projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; } diff --git a/Projectiles/Ranged/IcyBulletProj.cs b/Projectiles/Ranged/IcyBulletProj.cs index 8d5678abd2..c895a36cd4 100644 --- a/Projectiles/Ranged/IcyBulletProj.cs +++ b/Projectiles/Ranged/IcyBulletProj.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.ranged = true; projectile.coldDamage = true; projectile.penetrate = 3; - projectile.extraUpdates = 1; + projectile.extraUpdates = 3; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 20; projectile.coldDamage = true; diff --git a/Projectiles/Ranged/IlluminatedBullet.cs b/Projectiles/Ranged/IlluminatedBullet.cs index 294d325a7c..0172c5947f 100644 --- a/Projectiles/Ranged/IlluminatedBullet.cs +++ b/Projectiles/Ranged/IlluminatedBullet.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.tileCollide = true; projectile.penetrate = 1; projectile.timeLeft = 300; - projectile.extraUpdates = 1; + projectile.extraUpdates = 3; // Invisible for the first few frames projectile.alpha = 255; diff --git a/Projectiles/Ranged/ImpactRound.cs b/Projectiles/Ranged/ImpactRound.cs index 60d9eb92ff..be55a595d3 100644 --- a/Projectiles/Ranged/ImpactRound.cs +++ b/Projectiles/Ranged/ImpactRound.cs @@ -57,8 +57,6 @@ namespace CalamityMod.Projectiles.Ranged double damageMult = 1D; if (crit) damageMult += 0.25; - if (target.Inorganic()) - damageMult += 0.1; damage = (int)(damage * damageMult); } diff --git a/Projectiles/Ranged/ProBolt.cs b/Projectiles/Ranged/ProBolt.cs index 933ca2cb8c..053fcd12c6 100644 --- a/Projectiles/Ranged/ProBolt.cs +++ b/Projectiles/Ranged/ProBolt.cs @@ -23,6 +23,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.ranged = true; projectile.penetrate = 3; projectile.timeLeft = 600; + projectile.extraUpdates = 1; projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; } diff --git a/Projectiles/Ranged/PumplerHoldout.cs b/Projectiles/Ranged/PumplerHoldout.cs index 9b9c23fadf..8247a57e1e 100644 --- a/Projectiles/Ranged/PumplerHoldout.cs +++ b/Projectiles/Ranged/PumplerHoldout.cs @@ -235,7 +235,7 @@ namespace CalamityMod.Projectiles.Ranged Vector2 drawPosition = projectile.Center - Main.screenPosition; Rectangle frameRectangle = Main.projectileTexture[projectile.type].Frame(1, 9, 0, projectile.frame); - spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPosition, frameRectangle, Color.White, projectile.rotation, frameRectangle.Size() * 0.5f, 1f, projectile.direction == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0); + spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPosition, frameRectangle, lightColor, projectile.rotation, frameRectangle.Size() * 0.5f, 1f, projectile.direction == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0); spriteBatch.ExitShaderRegion(); diff --git a/Projectiles/Ranged/RealmRavagerBullet.cs b/Projectiles/Ranged/RealmRavagerBullet.cs index 45466c59a7..b8b4a9d23a 100644 --- a/Projectiles/Ranged/RealmRavagerBullet.cs +++ b/Projectiles/Ranged/RealmRavagerBullet.cs @@ -26,6 +26,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.ignoreWater = true; projectile.aiStyle = 1; aiType = ProjectileID.BulletHighVelocity; + projectile.extraUpdates = 3; projectile.penetrate = 1; projectile.timeLeft = 90; projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; diff --git a/Projectiles/Ranged/SeaDragonRocket.png b/Projectiles/Ranged/SeaDragonRocket.png index 2c1206e1ee..2c581d19f6 100644 Binary files a/Projectiles/Ranged/SeaDragonRocket.png and b/Projectiles/Ranged/SeaDragonRocket.png differ diff --git a/Projectiles/Ranged/ShockblastRound.cs b/Projectiles/Ranged/ShockblastRound.cs index 535c115982..c33f4a9558 100644 --- a/Projectiles/Ranged/ShockblastRound.cs +++ b/Projectiles/Ranged/ShockblastRound.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.penetrate = 1; projectile.timeLeft = 600; projectile.light = 0.5f; - projectile.extraUpdates = 1; + projectile.extraUpdates = 3; aiType = ProjectileID.Bullet; projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; } diff --git a/Projectiles/Ranged/SicknessRound.cs b/Projectiles/Ranged/SicknessRound.cs index 211604ed24..324a5df4dc 100644 --- a/Projectiles/Ranged/SicknessRound.cs +++ b/Projectiles/Ranged/SicknessRound.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.penetrate = 1; projectile.timeLeft = 600; projectile.light = 0.25f; - projectile.extraUpdates = 2; + projectile.extraUpdates = 4; aiType = ProjectileID.Bullet; projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; } diff --git a/Projectiles/Ranged/SlagRound.cs b/Projectiles/Ranged/SlagRound.cs index fa82eeda44..7f6f4603d7 100644 --- a/Projectiles/Ranged/SlagRound.cs +++ b/Projectiles/Ranged/SlagRound.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.ranged = true; projectile.penetrate = 1; projectile.aiStyle = 1; - projectile.extraUpdates = 1; + projectile.extraUpdates = 3; aiType = ProjectileID.Bullet; projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; } diff --git a/Projectiles/Ranged/TerraBulletMain.cs b/Projectiles/Ranged/TerraBulletMain.cs index 1173112c0d..5e075dd6fb 100644 --- a/Projectiles/Ranged/TerraBulletMain.cs +++ b/Projectiles/Ranged/TerraBulletMain.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.penetrate = 1; projectile.timeLeft = 600; projectile.alpha = 255; - projectile.extraUpdates = 1; + projectile.extraUpdates = 3; projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.basePointBlankShotDuration; } diff --git a/Projectiles/Rogue/GildedDaggerProj.cs b/Projectiles/Rogue/GildedDaggerProj.cs index 5a584fe74c..0f5a501fac 100644 --- a/Projectiles/Rogue/GildedDaggerProj.cs +++ b/Projectiles/Rogue/GildedDaggerProj.cs @@ -9,8 +9,6 @@ namespace CalamityMod.Projectiles.Rogue { public class GildedDaggerProj : ModProjectile { - public override string Texture => "CalamityMod/Items/Weapons/Rogue/GildedDagger"; - private bool hasHitEnemy = false; private int targetNPC = -1; private List previousNPCs = new List() { -1 }; @@ -44,15 +42,10 @@ namespace CalamityMod.Projectiles.Rogue { projectile.spriteDirection = projectile.direction = (projectile.velocity.X > 0).ToDirectionInt(); projectile.rotation = projectile.velocity.ToRotation() + (projectile.spriteDirection == 1 ? 0f : MathHelper.PiOver2); - //Rotating 45 degrees if shooting right + //Rotating 90 degrees if shooting right if (projectile.spriteDirection == 1) { - projectile.rotation += MathHelper.ToRadians(45f); - } - //Rotating 45 degrees if shooting left - if (projectile.spriteDirection == -1) - { - projectile.rotation -= MathHelper.ToRadians(45f); + projectile.rotation += MathHelper.ToRadians(90f); } } diff --git a/Projectiles/Rogue/GildedDaggerProj.png b/Projectiles/Rogue/GildedDaggerProj.png new file mode 100644 index 0000000000..2dbcf289d2 Binary files /dev/null and b/Projectiles/Rogue/GildedDaggerProj.png differ diff --git a/Projectiles/Rogue/GleamingDaggerProj.cs b/Projectiles/Rogue/GleamingDaggerProj.cs index b84a1832a5..c3b21e498f 100644 --- a/Projectiles/Rogue/GleamingDaggerProj.cs +++ b/Projectiles/Rogue/GleamingDaggerProj.cs @@ -9,8 +9,6 @@ namespace CalamityMod.Projectiles.Rogue { public class GleamingDaggerProj : ModProjectile { - public override string Texture => "CalamityMod/Items/Weapons/Rogue/GleamingDagger"; - private bool hasHitEnemy = false; private int targetNPC = -1; private List previousNPCs = new List() { -1 }; @@ -44,15 +42,10 @@ namespace CalamityMod.Projectiles.Rogue { projectile.spriteDirection = projectile.direction = (projectile.velocity.X > 0).ToDirectionInt(); projectile.rotation = projectile.velocity.ToRotation() + (projectile.spriteDirection == 1 ? 0f : MathHelper.PiOver2); - //Rotating 45 degrees if shooting right + //Rotating 90 degrees if shooting right if (projectile.spriteDirection == 1) { - projectile.rotation += MathHelper.ToRadians(45f); - } - //Rotating 45 degrees if shooting left - if (projectile.spriteDirection == -1) - { - projectile.rotation -= MathHelper.ToRadians(45f); + projectile.rotation += MathHelper.ToRadians(90f); } } diff --git a/Projectiles/Rogue/GleamingDaggerProj.png b/Projectiles/Rogue/GleamingDaggerProj.png new file mode 100644 index 0000000000..6abf63a518 Binary files /dev/null and b/Projectiles/Rogue/GleamingDaggerProj.png differ diff --git a/Projectiles/Rogue/MangroveChakramProjectile.cs b/Projectiles/Rogue/MangroveChakramProjectile.cs index a7d3ca2287..2bbb51de92 100644 --- a/Projectiles/Rogue/MangroveChakramProjectile.cs +++ b/Projectiles/Rogue/MangroveChakramProjectile.cs @@ -25,8 +25,8 @@ namespace CalamityMod.Projectiles.Rogue projectile.aiStyle = 3; projectile.timeLeft = 600; aiType = ProjectileID.WoodenBoomerang; - projectile.melee = true; - } + projectile.Calamity().rogue = true; + } public override void AI() { diff --git a/Projectiles/Rogue/NiceCock.cs b/Projectiles/Rogue/NiceCock.cs index 529dda0f6c..2f841f3054 100644 --- a/Projectiles/Rogue/NiceCock.cs +++ b/Projectiles/Rogue/NiceCock.cs @@ -11,6 +11,7 @@ namespace CalamityMod.Projectiles.Rogue public class NiceCock : ModProjectile { public bool homing = false; + public int Timer = 0; private bool initialized = false; private Color[] colors = new Color[] { @@ -95,6 +96,12 @@ namespace CalamityMod.Projectiles.Rogue if (Main.npc[index] is null || !Main.npc[index].active || Main.npc[index].life < 0) projectile.Kill(); + // Decrement the timer. This should last a second as stealth strikes will initialize this at 61. + if (Timer > 1) + Timer --; + if (Timer == 1) + homing = true; + NPC target = Main.npc[index]; if (homing) diff --git a/Projectiles/Rogue/NightsGazeStar.png b/Projectiles/Rogue/NightsGazeStar.png index 1db97cb7ea..8cb0af2395 100644 Binary files a/Projectiles/Rogue/NightsGazeStar.png and b/Projectiles/Rogue/NightsGazeStar.png differ diff --git a/Projectiles/Rogue/Quasar2.cs b/Projectiles/Rogue/Quasar2.cs deleted file mode 100644 index 02951b4af3..0000000000 --- a/Projectiles/Rogue/Quasar2.cs +++ /dev/null @@ -1,104 +0,0 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.CalPlayer; -using CalamityMod.Dusts; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Rogue -{ - public class Quasar2 : ModProjectile - { - public override string Texture => "CalamityMod/Items/Weapons/Rogue/Quasar"; - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Quasar"); - ProjectileID.Sets.TrailCacheLength[projectile.type] = 4; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - } - - public override void SetDefaults() - { - projectile.width = 24; - projectile.height = 24; - projectile.friendly = true; - projectile.ignoreWater = true; - projectile.penetrate = 1; - projectile.timeLeft = 300; - projectile.Calamity().rogue = true; - } - - public override void AI() - { - projectile.rotation = projectile.velocity.ToRotation() + MathHelper.ToRadians(45f); - float num472 = projectile.Center.X; - float num473 = projectile.Center.Y; - float num474 = 600f; - for (int num475 = 0; num475 < Main.maxNPCs; num475++) - { - if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1) && !CalamityPlayer.areThereAnyDamnBosses) - { - float npcCenterX = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2); - float npcCenterY = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2); - float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - npcCenterX) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - npcCenterY); - if (num478 < num474) - { - if (Main.npc[num475].position.X < num472) - { - Main.npc[num475].velocity.X += 0.25f; - } - else - { - Main.npc[num475].velocity.X -= 0.25f; - } - if (Main.npc[num475].position.Y < num473) - { - Main.npc[num475].velocity.Y += 0.25f; - } - else - { - Main.npc[num475].velocity.Y -= 0.25f; - } - } - } - } - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(ModContent.BuffType(), 180); - } - - public override void OnHitPvp(Player target, int damage, bool crit) - { - target.AddBuff(ModContent.BuffType(), 180); - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - CalamityUtils.DrawAfterimagesCentered(projectile, ProjectileID.Sets.TrailingMode[projectile.type], lightColor, 1); - return false; - } - - public override void Kill(int timeLeft) - { - for (int k = 0; k < 5; k++) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, ModContent.DustType(), projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); - } - if (projectile.Calamity().stealthStrike && projectile.owner == Main.myPlayer) - { - int boomer = Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(projectile.damage * 0.5f), projectile.knockBack, projectile.owner, 0f, 1f); - if (boomer.WithinBounds(Main.maxProjectiles)) - { - Main.projectile[boomer].Calamity().stealthStrike = true; - Main.projectile[boomer].height = Main.projectile[boomer].width = 280; - Main.projectile[boomer].Center = projectile.Center; - } - } - } - } -} diff --git a/Projectiles/Rogue/QuasarKnife.cs b/Projectiles/Rogue/QuasarKnife.cs deleted file mode 100644 index 0bdf26a5c0..0000000000 --- a/Projectiles/Rogue/QuasarKnife.cs +++ /dev/null @@ -1,123 +0,0 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.CalPlayer; -using CalamityMod.Dusts; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Rogue -{ - public class QuasarKnife : ModProjectile - { - public override string Texture => "CalamityMod/Items/Weapons/Rogue/Quasar"; - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Quasar"); - ProjectileID.Sets.TrailCacheLength[projectile.type] = 4; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - } - - public override void SetDefaults() - { - projectile.width = 24; - projectile.height = 24; - projectile.friendly = true; - projectile.ignoreWater = true; - projectile.penetrate = 4; - projectile.timeLeft = 300; - projectile.Calamity().rogue = true; - } - - public override void AI() - { - projectile.rotation = projectile.velocity.ToRotation() + MathHelper.ToRadians(45f); - float num472 = projectile.Center.X; - float num473 = projectile.Center.Y; - float num474 = 600f; - for (int num475 = 0; num475 < Main.maxNPCs; num475++) - { - if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1) && !CalamityPlayer.areThereAnyDamnBosses) - { - float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2); - float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2); - float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477); - if (num478 < num474) - { - if (Main.npc[num475].position.X < num472) - { - Main.npc[num475].velocity.X += 0.25f; - } - else - { - Main.npc[num475].velocity.X -= 0.25f; - } - if (Main.npc[num475].position.Y < num473) - { - Main.npc[num475].velocity.Y += 0.25f; - } - else - { - Main.npc[num475].velocity.Y -= 0.25f; - } - } - } - } - projectile.ai[1] += 1f; - if (projectile.ai[1] == 25f) - { - int numProj = 2; - float rotation = MathHelper.ToRadians(50); - if (projectile.owner == Main.myPlayer) - { - for (int i = 0; i < numProj + 1; i++) - { - Vector2 speed = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51)); - while (speed.X == 0f && speed.Y == 0f) - { - speed = new Vector2((float)Main.rand.Next(-50, 51), (float)Main.rand.Next(-50, 51)); - } - speed.Normalize(); - speed *= (float)Main.rand.Next(30, 61) * 0.1f * 2.5f; - int knife = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, speed.X, speed.Y, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); - Main.projectile[knife].Calamity().stealthStrike = projectile.Calamity().stealthStrike; - if (projectile.Calamity().stealthStrike) - { - Main.projectile[knife].timeLeft = 120; - } - } - Main.PlaySound(SoundID.Item14, projectile.position); - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); - projectile.active = false; - } - } - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(ModContent.BuffType(), 180); - } - - public override void OnHitPvp(Player target, int damage, bool crit) - { - target.AddBuff(ModContent.BuffType(), 180); - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - CalamityUtils.DrawAfterimagesCentered(projectile, ProjectileID.Sets.TrailingMode[projectile.type], lightColor, 1); - return false; - } - - public override void Kill(int timeLeft) - { - Main.PlaySound(SoundID.Item27, projectile.position); - for (int k = 0; k < 5; k++) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, ModContent.DustType(), projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); - } - } - } -} diff --git a/Projectiles/Rogue/RadiantExplosion.cs b/Projectiles/Rogue/RadiantExplosion.cs index 4fec6b4f2f..18c04f5bb6 100644 --- a/Projectiles/Rogue/RadiantExplosion.cs +++ b/Projectiles/Rogue/RadiantExplosion.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Rogue } } - if (projectile.ai[1] == 1f) //Quasar Stealth Strike + if (projectile.Calamity().stealthStrike) { float num472 = projectile.Center.X; float num473 = projectile.Center.Y; diff --git a/Projectiles/Rogue/SearedPanProjectile.cs b/Projectiles/Rogue/SearedPanProjectile.cs index 3461b4b344..0a5e76f5a2 100644 --- a/Projectiles/Rogue/SearedPanProjectile.cs +++ b/Projectiles/Rogue/SearedPanProjectile.cs @@ -10,6 +10,20 @@ namespace CalamityMod.Projectiles.Rogue { public class SearedPanProjectile : ModProjectile { + internal enum SearedPanTypes + { + VenLocket = 0, + Normal = 1, + Golden = 2, + StealthStrike = 3 + } + + internal SearedPanTypes PanType + { + get => (SearedPanTypes)(int)projectile.ai[0]; + set => projectile.ai[0] = (int)value; + } + public override void SetStaticDefaults() { DisplayName.SetDefault("Pan"); @@ -63,67 +77,51 @@ namespace CalamityMod.Projectiles.Rogue if (!playerCanStealthStrike) return; - // Increment the seared pan counter and refill stealth after three consecutive hits + // Increment the seared pan counter. Pans summoned via the Venerated Locket shouldn't increment the counter. // See CalamityPlayerMiscEffects.cs for code that resets the counter after 40 frames modPlayer.searedPanTimer = 0; - if (!projectile.Calamity().stealthStrike && specialEffects) + if (specialEffects && PanType != SearedPanTypes.VenLocket) modPlayer.searedPanCounter++; - if (modPlayer.searedPanCounter >= 3 && !projectile.Calamity().stealthStrike && specialEffects) - { - modPlayer.searedPanCounter = 0; - modPlayer.rogueStealth = modPlayer.rogueStealthMax; - } - // Stealth strikes spawn four golden sparks on hit - if (projectile.Calamity().stealthStrike) + // Pans summoned via the Venerated Locket have zero special effects + if (PanType == SearedPanTypes.StealthStrike) { modPlayer.searedPanCounter = 0; + // Stealth strikes spawn four golden sparks on hit for (int t = 0; t < 4; t++) { Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.2), 0f, projectile.owner); } Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/SearedPanSmash"), (int)projectile.position.X, (int)projectile.position.Y); - // Stealth strikes also cause any fireballs to home in on their targets + // Stealth strikes also cause any existing fireballs to home in on their targets + FireballStuff(true); + + if (!specialEffects) + return; + // Stealth strikes then summon five fireballs to circle the hit enemy, they will home in on their own after a second. + for (int t = 0; t < 5; t++) + { + int i = Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(projectile.damage * 0.1), 0f, projectile.owner, 0f, targetIndex); + Main.projectile[i].ModProjectile().Timer = 61; + } + FireballPositions(targetIndex); + } + else if (PanType == SearedPanTypes.Golden) + { + modPlayer.searedPanCounter = 0; + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/SearedPanSmash"), (int)projectile.position.X, (int)projectile.position.Y); + // Golden pans simply cause all fireballs to home in on their targets FireballStuff(true); } - else if (targetIndex != -1 && health > 0) + else if (PanType == SearedPanTypes.Normal && targetIndex != -1 && health > 0 && specialEffects) { // Summon three fireballs to circle the hit enemy for (int t = 0; t < 3; t++) { Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(projectile.damage * 0.1), 0f, projectile.owner, 0f, targetIndex); } - int fireballCount = 0; - // Count how many fireballs exist already around the given target - for (int i = 0; i < Main.maxProjectiles; i++) - { - // Keep the loop as short as possible - if (!Main.projectile[i].active || Main.projectile[i].owner != projectile.owner || !Main.projectile[i].Calamity().rogue || targetIndex != (int)Main.projectile[i].ai[1]) - continue; - if (Main.projectile[i].modProjectile is NiceCock) - { - if (Main.projectile[i].ModProjectile().homing) - continue; - fireballCount++; - } - } - // Adjust the angle of the existing fireballs around a target - float angleVariance = MathHelper.TwoPi / fireballCount; - float angle = 0f; - for (int i = 0; i < Main.maxProjectiles; i++) - { - if (!Main.projectile[i].active || Main.projectile[i].owner != projectile.owner || !Main.projectile[i].Calamity().rogue || targetIndex != (int)Main.projectile[i].ai[1]) - continue; - if (Main.projectile[i].modProjectile is NiceCock) - { - if (Main.projectile[i].ModProjectile().homing) - continue; - Main.projectile[i].ai[0] = angle; - Main.projectile[i].netUpdate = true; - angle += angleVariance; - } - } + FireballPositions(targetIndex); } } @@ -149,18 +147,52 @@ namespace CalamityMod.Projectiles.Rogue } } + private void FireballPositions(int targetIndex) + { + int fireballCount = 0; + // Count how many fireballs exist already around the given target + for (int i = 0; i < Main.maxProjectiles; i++) + { + // Keep the loop as short as possible + if (!Main.projectile[i].active || Main.projectile[i].owner != projectile.owner || !Main.projectile[i].Calamity().rogue || targetIndex != (int)Main.projectile[i].ai[1]) + continue; + if (Main.projectile[i].modProjectile is NiceCock) + { + if (Main.projectile[i].ModProjectile().homing) + continue; + fireballCount++; + } + } + // Adjust the angle of the existing fireballs around a target + float angleVariance = MathHelper.TwoPi / fireballCount; + float angle = 0f; + for (int i = 0; i < Main.maxProjectiles; i++) + { + if (!Main.projectile[i].active || Main.projectile[i].owner != projectile.owner || !Main.projectile[i].Calamity().rogue || targetIndex != (int)Main.projectile[i].ai[1]) + continue; + if (Main.projectile[i].modProjectile is NiceCock) + { + if (Main.projectile[i].ModProjectile().homing) + continue; + Main.projectile[i].ai[0] = angle; + Main.projectile[i].netUpdate = true; + angle += angleVariance; + } + } + } + public override bool OnTileCollide(Vector2 oldVelocity) { - // Kill all fireballs if you miss a stealth strike - if (projectile.Calamity().stealthStrike) + // Kill all fireballs if you miss a stealth strike or golden pan + if (PanType == SearedPanTypes.Golden || PanType == SearedPanTypes.StealthStrike) FireballStuff(false); return true; } public override Color? GetAlpha(Color lightColor) { - // Stealth strikes are golden colored - if (projectile.Calamity().stealthStrike) + // Stealth strikes and golden pans are golden colored + if (PanType == SearedPanTypes.Golden || PanType == SearedPanTypes.StealthStrike) return new Color(255, 222, 0); return null; } diff --git a/Projectiles/Rogue/ShatteredSunKnife.cs b/Projectiles/Rogue/ShatteredSunKnife.cs index 692ef944a6..1fcc3d127d 100644 --- a/Projectiles/Rogue/ShatteredSunKnife.cs +++ b/Projectiles/Rogue/ShatteredSunKnife.cs @@ -1,5 +1,7 @@ +using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -83,7 +85,42 @@ namespace CalamityMod.Projectiles.Rogue } } } - } + + if (projectile.Calamity().stealthStrike) + { + float num472 = projectile.Center.X; + float num473 = projectile.Center.Y; + float num474 = 600f; + for (int num475 = 0; num475 < Main.maxNPCs; num475++) + { + if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1) && !CalamityPlayer.areThereAnyDamnBosses) + { + float npcCenterX = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2); + float npcCenterY = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2); + float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - npcCenterX) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - npcCenterY); + if (num478 < num474) + { + if (Main.npc[num475].position.X < num472) + { + Main.npc[num475].velocity.X += 0.25f; + } + else + { + Main.npc[num475].velocity.X -= 0.25f; + } + if (Main.npc[num475].position.Y < num473) + { + Main.npc[num475].velocity.Y += 0.25f; + } + else + { + Main.npc[num475].velocity.Y -= 0.25f; + } + } + } + } + } + } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { diff --git a/Projectiles/Rogue/ShatteredSunScorchedBlade.cs b/Projectiles/Rogue/ShatteredSunScorchedBlade.cs index 42372cc373..0f58f7371a 100644 --- a/Projectiles/Rogue/ShatteredSunScorchedBlade.cs +++ b/Projectiles/Rogue/ShatteredSunScorchedBlade.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -111,7 +112,42 @@ namespace CalamityMod.Projectiles.Rogue projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; } } - } + + if (projectile.Calamity().stealthStrike) + { + float num472 = projectile.Center.X; + float num473 = projectile.Center.Y; + float num474 = 600f; + for (int num475 = 0; num475 < Main.maxNPCs; num475++) + { + if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1) && !CalamityPlayer.areThereAnyDamnBosses) + { + float npcCenterX = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2); + float npcCenterY = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2); + float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - npcCenterX) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - npcCenterY); + if (num478 < num474) + { + if (Main.npc[num475].position.X < num472) + { + Main.npc[num475].velocity.X += 0.25f; + } + else + { + Main.npc[num475].velocity.X -= 0.25f; + } + if (Main.npc[num475].position.Y < num473) + { + Main.npc[num475].velocity.Y += 0.25f; + } + else + { + Main.npc[num475].velocity.Y -= 0.25f; + } + } + } + } + } + } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { diff --git a/Projectiles/Summon/BelladonnaPetal.png b/Projectiles/Summon/BelladonnaPetal.png index 7eed93a980..ddd5d1aac1 100644 Binary files a/Projectiles/Summon/BelladonnaPetal.png and b/Projectiles/Summon/BelladonnaPetal.png differ diff --git a/Projectiles/Summon/BelladonnaSpirit.cs b/Projectiles/Summon/BelladonnaSpirit.cs index 7eaa0c7ad6..7905a16228 100644 --- a/Projectiles/Summon/BelladonnaSpirit.cs +++ b/Projectiles/Summon/BelladonnaSpirit.cs @@ -17,15 +17,15 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { DisplayName.SetDefault("Belladonna Spirit"); - Main.projFrames[projectile.type] = 4; + Main.projFrames[projectile.type] = 5; ProjectileID.Sets.MinionSacrificable[projectile.type] = true; ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; } public override void SetDefaults() { - projectile.width = 38; - projectile.height = 36; + projectile.width = 28; + projectile.height = 48; projectile.netImportant = true; projectile.friendly = true; projectile.minionSlots = 1; diff --git a/Projectiles/Summon/BelladonnaSpirit.png b/Projectiles/Summon/BelladonnaSpirit.png index 10ab7ca0a4..3f62956805 100644 Binary files a/Projectiles/Summon/BelladonnaSpirit.png and b/Projectiles/Summon/BelladonnaSpirit.png differ diff --git a/Projectiles/Summon/IceSentry.cs b/Projectiles/Summon/IceSentry.cs index b41df48151..d118f88681 100644 --- a/Projectiles/Summon/IceSentry.cs +++ b/Projectiles/Summon/IceSentry.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetDefaults() { - projectile.width = 102; + projectile.width = 94; projectile.height = 94; projectile.timeLeft = Projectile.SentryLifeTime; projectile.ignoreWater = true; diff --git a/Projectiles/Summon/IceSentry.png b/Projectiles/Summon/IceSentry.png index ddbce1dbb9..76390915a6 100644 Binary files a/Projectiles/Summon/IceSentry.png and b/Projectiles/Summon/IceSentry.png differ diff --git a/Projectiles/Summon/SepulcherMinion.cs b/Projectiles/Summon/SepulcherMinion.cs index c3446a1093..c0dfb7cefe 100644 --- a/Projectiles/Summon/SepulcherMinion.cs +++ b/Projectiles/Summon/SepulcherMinion.cs @@ -131,6 +131,9 @@ namespace CalamityMod.Projectiles.Summon #region Syncing public override void SendExtraAI(BinaryWriter writer) { + if (Arms is null || Arms[0] is null) + Initialize(); + writer.Write(IdleTimer); writer.Write(PlayerAttackCountdown); writer.Write(Arms.Count); @@ -148,6 +151,9 @@ namespace CalamityMod.Projectiles.Summon public override void ReceiveExtraAI(BinaryReader reader) { + if (Arms is null || Arms[0] is null) + Initialize(); + IdleTimer = reader.ReadInt32(); PlayerAttackCountdown = reader.ReadInt32(); int armCount = reader.ReadInt32(); diff --git a/Projectiles/Summon/SiriusMinion.png b/Projectiles/Summon/SiriusMinion.png index dd846897b8..a37b045183 100644 Binary files a/Projectiles/Summon/SiriusMinion.png and b/Projectiles/Summon/SiriusMinion.png differ diff --git a/Projectiles/Summon/StormjawBaby.cs b/Projectiles/Summon/StormjawBaby.cs index b691a22377..231b1414ba 100644 --- a/Projectiles/Summon/StormjawBaby.cs +++ b/Projectiles/Summon/StormjawBaby.cs @@ -14,6 +14,9 @@ namespace CalamityMod.Projectiles.Summon { public float dust = 0f; private int sparkCounter = 0; + private int targetIndex = -1; + private Vector2 idlePos = Vector2.Zero; + public Player player => Main.player[projectile.owner]; public override void SetStaticDefaults() { @@ -40,13 +43,27 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { - Player player = Main.player[projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); - CalamityGlobalProjectile modProj = projectile.Calamity(); + OnSpawn(); + SummonChecks(); + + idlePos = player.Center; + idlePos.X -= (15f + player.width / 2f) * player.direction; + idlePos.X -= projectile.minionPos * 40f * player.direction; + + FindTarget(); + FlyBackToPlayer(); + AttackTarget(); + GoToTarget(); + IdleBehavior(); + } + + private void OnSpawn() + { + // Handle stuff on spawn & variable damage if (dust == 0f) { - modProj.spawnedPlayerMinionDamageValue = player.MinionDamage(); - modProj.spawnedPlayerMinionProjectileDamageValue = projectile.damage; + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); + projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int dustAmt = 36; for (int d = 0; d < dustAmt; d++) { @@ -60,31 +77,35 @@ namespace CalamityMod.Projectiles.Summon } dust += 1f; } - if (player.MinionDamage() != modProj.spawnedPlayerMinionDamageValue) + } + + private void SummonChecks() + { + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) { - int damage2 = (int)((float)modProj.spawnedPlayerMinionProjectileDamageValue / - modProj.spawnedPlayerMinionDamageValue * player.MinionDamage()); + int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / + projectile.Calamity().spawnedPlayerMinionDamageValue * player.MinionDamage()); projectile.damage = damage2; } + bool projTypeCheck = projectile.type == ModContent.ProjectileType(); player.AddBuff(ModContent.BuffType(), 3600); if (projTypeCheck) { if (player.dead) { - modPlayer.stormjaw = false; + player.Calamity().stormjaw = false; } - if (modPlayer.stormjaw) + if (player.Calamity().stormjaw) { projectile.timeLeft = 2; } } + } - Vector2 idlePos = player.Center; - idlePos.X -= (15f + player.width / 2f) * player.direction; - idlePos.X -= projectile.minionPos * 40f * player.direction; - - int targetIndex = -1; + private void FindTarget() + { + targetIndex = -1; float maxDistance = 800f; if (projectile.ai[0] == 0f) //find target { @@ -115,6 +136,10 @@ namespace CalamityMod.Projectiles.Summon } } } + } + + private void FlyBackToPlayer() + { if (projectile.ai[0] == 1f) //returning to player { projectile.tileCollide = false; @@ -216,6 +241,10 @@ namespace CalamityMod.Projectiles.Summon projectile.spriteDirection = -1; projectile.rotation = projectile.velocity.ToRotation() + projectile.spriteDirection != 1 ? MathHelper.Pi : 0f; } + } + + private void AttackTarget() + { if (projectile.ai[0] == 2f) //attack target { projectile.spriteDirection = -projectile.direction; @@ -286,6 +315,47 @@ namespace CalamityMod.Projectiles.Summon return; } } + else + { + Rectangle rectangle = new Rectangle((int)(projectile.position.X + projectile.velocity.X * 0.5f - 4f), (int)(projectile.position.Y + projectile.velocity.Y * 0.5f - 4f), projectile.width + 8, projectile.height + 8); + for (int i = 0; i < Main.maxNPCs; i++) + { + NPC npc = Main.npc[i]; + if (npc.CanBeChasedBy(projectile, false) && npc.immune[projectile.owner] <= 0) + { + Rectangle rect = npc.getRect(); + if (rectangle.Intersects(rect) && (npc.noTileCollide || player.CanHit(npc))) + { + sparkCounter += Main.rand.Next(1,3); + if (sparkCounter >= 20) + { + if (Main.myPlayer == projectile.owner) + { + for (int j = 0; j < Main.rand.Next(1,4); j++) + { + Vector2 sparkS = new Vector2(Main.rand.NextFloat(-5f, 5f), Main.rand.NextFloat(-5f, 5f)); + int spark = Projectile.NewProjectile(projectile.Center, sparkS, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner); + if (spark.WithinBounds(Main.maxProjectiles)) + { + Main.projectile[spark].Calamity().forceMinion = true; + Main.projectile[spark].timeLeft = 120; + Main.projectile[spark].penetrate = 3; + Main.projectile[spark].usesIDStaticNPCImmunity = true; + Main.projectile[spark].idStaticNPCHitCooldown = 10; + Main.projectile[spark].usesLocalNPCImmunity = false; + } + } + sparkCounter = 0; + } + } + } + } + } + } + } + + private void GoToTarget() + { if (targetIndex >= 0) //go to target { float rangeofSight = 700f; @@ -320,6 +390,10 @@ namespace CalamityMod.Projectiles.Summon projectile.netUpdate = true; } } + } + + private void IdleBehavior() + { if (projectile.ai[0] == 0f && targetIndex < 0) //passive AI { if (sparkCounter > 0) @@ -329,8 +403,10 @@ namespace CalamityMod.Projectiles.Summon float sepAnxietyDist = 500f; Vector2 playerDist = player.Center - projectile.Center; + // Teleport to the player if too far if (playerDist.Length() > 2000f) projectile.position = player.Center - projectile.Size / 2f; + // Fly back if too far from the player else if (playerDist.Length() > sepAnxietyDist || Math.Abs(playerDist.Y) > 300f) { projectile.ai[0] = 1f; @@ -341,26 +417,27 @@ namespace CalamityMod.Projectiles.Summon projectile.velocity.Y = 0f; } } + if (projectile.ai[0] == 0f) { projectile.tileCollide = true; float accelFast = 0.5f; float maxSpeed = 4f; - float num3 = 4f; + float xVel = 4f; float accelSlow = 0.1f; - if (num3 < Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y)) + if (xVel < Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y)) { - num3 = Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y); + xVel = Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y); accelFast = 0.7f; } - int num7 = 0; + int direction = 0; bool flag3 = false; float idleDist = idlePos.X - projectile.Center.X; if (Math.Abs(idleDist) > 5f) { if (idleDist < 0f) { - num7 = -1; + direction = -1; if (projectile.velocity.X > -maxSpeed) { projectile.velocity.X -= accelFast; @@ -372,7 +449,7 @@ namespace CalamityMod.Projectiles.Summon } else { - num7 = 1; + direction = 1; if (projectile.velocity.X < maxSpeed) { projectile.velocity.X += accelFast; @@ -389,12 +466,12 @@ namespace CalamityMod.Projectiles.Summon if (Math.Abs(projectile.velocity.X) < accelFast * 2f) projectile.velocity.X = 0.0f; } - if (num7 != 0) + if (direction != 0) { - int num9 = (int)projectile.Center.X / 16; - int num10 = (int)projectile.position.Y / 16; - int x = num9 + num7 + (int) projectile.velocity.X; - for (int y = num10; y < num10 + projectile.height / 16 + 1; ++y) + int xPos = (int)projectile.Center.X / 16; + int yPos = (int)projectile.position.Y / 16; + int x = xPos + direction + (int) projectile.velocity.X; + for (int y = yPos; y < yPos + projectile.height / 16 + 1; ++y) { if (WorldGen.SolidTile(x, y)) flag3 = true; @@ -407,25 +484,25 @@ namespace CalamityMod.Projectiles.Summon { int x = (int)projectile.Center.X / 16; if (i == 0) - x = (int)projectile.position.X / 16; + x = (int)projectile.Left.X / 16; if (i == 2) - x = (int)(projectile.position.X + projectile.width) / 16; + x = (int)projectile.Right.X / 16; int y = (int)projectile.Bottom.Y / 16; Tile tile = Main.tile[x, y]; if (WorldGen.SolidTile(x, y) || tile.halfBrick() || tile.slope() > 0 || TileID.Sets.Platforms[tile.type] && tile.active() && !tile.inActive()) { try { - int num9 = (int)projectile.Center.X / 16; - int num10 = (int)projectile.Center.Y / 16; - int i2 = num9 + num7 + (int)projectile.velocity.X; - if (!WorldGen.SolidTile(i2, num10 - 1) && !WorldGen.SolidTile(i2, num10 - 2)) + int xPos = (int)projectile.Center.X / 16; + int yPos = (int)projectile.Center.Y / 16; + int i2 = xPos + direction + (int)projectile.velocity.X; + if (!WorldGen.SolidTile(i2, yPos - 1) && !WorldGen.SolidTile(i2, yPos - 2)) projectile.velocity.Y = -5.1f; - else if (!WorldGen.SolidTile(i2, num10 - 2)) + else if (!WorldGen.SolidTile(i2, yPos - 2)) projectile.velocity.Y = -7.1f; - else if (WorldGen.SolidTile(i2, num10 - 5)) + else if (WorldGen.SolidTile(i2, yPos - 5)) projectile.velocity.Y = -11.1f; - else if (WorldGen.SolidTile(i2, num10 - 4)) + else if (WorldGen.SolidTile(i2, yPos - 4)) projectile.velocity.Y = -10.1f; else projectile.velocity.Y = -9.1f; @@ -437,17 +514,17 @@ namespace CalamityMod.Projectiles.Summon } } } - if (projectile.velocity.X > num3) - projectile.velocity.X = num3; - if (projectile.velocity.X < -num3) - projectile.velocity.X = -num3; + if (projectile.velocity.X > xVel) + projectile.velocity.X = xVel; + if (projectile.velocity.X < -xVel) + projectile.velocity.X = -xVel; if (projectile.velocity.X < 0f) projectile.direction = -1; if (projectile.velocity.X > 0f) projectile.direction = 1; - if (projectile.velocity.X > accelFast && num7 == 1) + if (projectile.velocity.X > accelFast && direction == 1) projectile.direction = 1; - if (projectile.velocity.X < -accelFast && num7 == -1) + if (projectile.velocity.X < -accelFast && direction == -1) projectile.direction = -1; projectile.spriteDirection = -projectile.direction; projectile.rotation = 0f; @@ -490,48 +567,14 @@ namespace CalamityMod.Projectiles.Summon if (projectile.velocity.Y > 10f) projectile.velocity.Y = 10f; } - if (projectile.ai[0] != 2f) - { - Rectangle rectangle = new Rectangle((int)(projectile.position.X + projectile.velocity.X * 0.5f - 4f), (int)(projectile.position.Y + projectile.velocity.Y * 0.5f - 4f), projectile.width + 8, projectile.height + 8); - for (int i = 0; i < Main.maxNPCs; i++) - { - NPC npc = Main.npc[i]; - if (npc.CanBeChasedBy(projectile, false) && npc.immune[projectile.owner] <= 0) - { - Rectangle rect = npc.getRect(); - if (rectangle.Intersects(rect) && (npc.noTileCollide || player.CanHit(npc))) - { - sparkCounter += Main.rand.Next(1,3); - if (sparkCounter >= 20) - { - if (Main.myPlayer == projectile.owner) - { - for (int j = 0; j < Main.rand.Next(1,4); j++) - { - Vector2 sparkS = new Vector2(Main.rand.NextFloat(-5f, 5f), Main.rand.NextFloat(-5f, 5f)); - int spark = Projectile.NewProjectile(projectile.Center, sparkS, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner); - if (spark.WithinBounds(Main.maxProjectiles)) - { - Main.projectile[spark].Calamity().forceMinion = true; - Main.projectile[spark].timeLeft = 120; - Main.projectile[spark].penetrate = 3; - Main.projectile[spark].usesIDStaticNPCImmunity = true; - Main.projectile[spark].idStaticNPCHitCooldown = 10; - Main.projectile[spark].usesLocalNPCImmunity = false; - } - } - sparkCounter = 0; - } - } - } - } - } - } } public override bool TileCollideStyle(ref int width, ref int height, ref bool fallThrough) { - fallThrough = false; + if (targetIndex < 0) + fallThrough = projectile.Bottom.Y < player.Top.Y; + else + fallThrough = projectile.Bottom.Y < Main.npc[targetIndex].Top.Y; return true; } diff --git a/Projectiles/Typeless/FiniteUse/GrenadeRound.cs b/Projectiles/Typeless/FiniteUse/GrenadeRound.cs index 1352f5125a..6e389354cf 100644 --- a/Projectiles/Typeless/FiniteUse/GrenadeRound.cs +++ b/Projectiles/Typeless/FiniteUse/GrenadeRound.cs @@ -61,8 +61,7 @@ namespace CalamityMod.Projectiles.Typeless.FiniteUse public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { - if (target.Inorganic()) - damage += target.lifeMax / 100; // 500 + 200 = 700 + (100000 / 100 = 1000) = 1700 * 2 (explosion) = 3400 = 3.4% of boss HP + damage += target.lifeMax / 100; // 500 + 200 = 700 + (100000 / 100 = 1000) = 1700 * 2 (explosion) = 3400 = 3.4% of boss HP } public override void Kill(int timeLeft) diff --git a/Projectiles/Typeless/FiniteUse/MagnumRound.cs b/Projectiles/Typeless/FiniteUse/MagnumRound.cs index 129f8b3deb..518ab59d86 100644 --- a/Projectiles/Typeless/FiniteUse/MagnumRound.cs +++ b/Projectiles/Typeless/FiniteUse/MagnumRound.cs @@ -28,8 +28,7 @@ namespace CalamityMod.Projectiles.Typeless.FiniteUse public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { - if (target.Organic()) - damage += target.lifeMax / 75; // 400 + 80 = 480 + (100000 / 75 = 1333) = 1813 = 1.813% of boss HP + damage += target.lifeMax / 75; // 400 + 80 = 480 + (100000 / 75 = 1333) = 1813 = 1.813% of boss HP } } } diff --git a/Projectiles/Typeless/RelicOfDeliveranceSpear.cs b/Projectiles/Typeless/RelicOfDeliveranceSpear.cs index 9f29a25cc5..d46ea1c835 100644 --- a/Projectiles/Typeless/RelicOfDeliveranceSpear.cs +++ b/Projectiles/Typeless/RelicOfDeliveranceSpear.cs @@ -166,20 +166,6 @@ namespace CalamityMod.Projectiles.Typeless projectile.velocity = Vector2.Lerp(projectile.velocity, IdealVelocity, 0.125f); } - if (!CalamityPlayer.areThereAnyDamnBosses && player.Calamity().burdenBreakerYeet) - { - if (projectile.ai[1] < 500f) - { - projectile.ai[1] *= 1.02f; - IdealVelocity = Vector2.Normalize(IdealVelocity) * projectile.ai[1]; - } - else - { - projectile.Kill(); - return; - } - } - player.velocity = projectile.velocity; // Count down the charge cooldown if (projectile.localAI[1] > 0f) diff --git a/Skies/CryogenSky.cs b/Skies/CryogenSky.cs index bd4fd5ca4f..d67c777d02 100644 --- a/Skies/CryogenSky.cs +++ b/Skies/CryogenSky.cs @@ -18,90 +18,115 @@ namespace CalamityMod.Skies public Vector2 Center; public SpriteEffects DirectionEffect; } - private int cryogenIndex = -1; - private float fadeIn = 0f; - private float fadeOut = 0f; - private CryogenAurora[] Auroras; + public int CryogenIndex = -1; + public float FadeInCountdown = 0f; + public float FadeoutTimer = 0f; + public CryogenAurora[] Auroras; + + public static bool ShouldDrawRegularly; - internal const int TimePerRotation = 75; internal static Texture2D AuroraTexture => ModContent.GetTexture("CalamityMod/ExtraTextures/AuroraTexture"); + public static void UpdateDrawEligibility() + { + bool useEffect = NPC.AnyNPCs(ModContent.NPCType()) || ShouldDrawRegularly; + + if (SkyManager.Instance["CalamityMod:Cryogen"] != null && useEffect != SkyManager.Instance["CalamityMod:Cryogen"].IsActive()) + { + if (useEffect) + SkyManager.Instance.Activate("CalamityMod:Cryogen"); + else + SkyManager.Instance.Deactivate("CalamityMod:Cryogen"); + } + + if (ShouldDrawRegularly) + ShouldDrawRegularly = false; + } + public override void Update(GameTime gameTime) { - if (fadeIn > 0) - fadeIn--; + if (FadeInCountdown > 0) + FadeInCountdown--; - if (cryogenIndex == -1) + if (CryogenIndex == -1 && !ShouldDrawRegularly) { UpdateCryogenIndex(); - if (fadeOut == 0) - fadeOut = 45f; - fadeOut--; - if (fadeOut <= 0f) + if (FadeoutTimer == 0) + FadeoutTimer = 45f; + FadeoutTimer--; + if (FadeoutTimer <= 0f) Deactivate(); } + + float auroraStrength = CalculateAuroraStrength(); for (int i = 0; i < Auroras.Length; i++) { Vector2 centerRange = new Vector2(Main.screenWidth * 0.5f, Main.screenHeight * 0.1f / Auroras[i].Depth); Auroras[i].Center = centerRange * (Auroras[i].CenterOffsetRatio * MathHelper.TwoPi).ToRotationVector2() + Vector2.UnitX * Main.screenWidth * 0.5f; Auroras[i].Center.Y -= 180f + (float)Math.Cos(Main.GlobalTime * 1.2f + Auroras[i].CenterOffsetRatio * MathHelper.Pi) * 50f; - Auroras[i].CenterOffsetRatio += 1f / 1800f * MathHelper.Lerp(0.2f, 1f, 1f - GetCryogenLifeRatio()) * (float)Math.Sin(Main.GlobalTime * 0.9f); + Auroras[i].CenterOffsetRatio += 1f / 1800f * MathHelper.Lerp(0.2f, 1f, auroraStrength) * (float)Math.Sin(Main.GlobalTime * 0.9f); } } - private float GetCryogenLifeRatio() + public float GetCryogenLifeRatio() { if (UpdateCryogenIndex()) { - float localIntensity = 0f; - if (cryogenIndex != -1) - { - localIntensity = Main.npc[cryogenIndex].life / (float)Main.npc[cryogenIndex].lifeMax; - } - return localIntensity; + float lifeRatio = 0f; + if (CryogenIndex != -1) + lifeRatio = Main.npc[CryogenIndex].life / (float)Main.npc[CryogenIndex].lifeMax; + + return lifeRatio; } return 0f; } - private bool UpdateCryogenIndex() + public float CalculateAuroraStrength() + { + if (ShouldDrawRegularly) + return 1f; + + return 1f - GetCryogenLifeRatio(); + } + + public bool UpdateCryogenIndex() { int cryogenType = ModContent.NPCType(); - if (cryogenIndex >= 0 && Main.npc[cryogenIndex].active && Main.npc[cryogenIndex].type == cryogenType) - { + if (CryogenIndex >= 0 && Main.npc[CryogenIndex].active && Main.npc[CryogenIndex].type == cryogenType) return true; - } - cryogenIndex = -1; + + CryogenIndex = -1; for (int i = 0; i < Main.npc.Length; i++) { if (Main.npc[i].active && Main.npc[i].type == cryogenType) { - cryogenIndex = i; + CryogenIndex = i; break; } } - return cryogenIndex != -1; + return CryogenIndex != -1; } public override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDepth) { if (maxDepth >= float.MaxValue && minDepth < float.MaxValue) { - float drawPower = 1f - GetCryogenLifeRatio(); + float auroraStrength = CalculateAuroraStrength(); for (int i = 0; i < Auroras.Length; i++) { - float hue = 0.5f + Auroras[i].ColorHueOffset * 0.5f * MathHelper.Lerp(0.15f, 0.95f, drawPower); + float hue = 0.5f + Auroras[i].ColorHueOffset * 0.5f * MathHelper.Lerp(0.15f, 0.95f, auroraStrength); hue += (float)Math.Cos(Main.GlobalTime * 1.2f) * 0.25f; hue %= 1f; float scale = 1.4f / Auroras[i].Depth; scale += (float)Math.Cos(Main.GlobalTime * 0.7f + Auroras[i].CenterOffsetRatio * MathHelper.TwoPi) * 0.2f; Color auroraColor = Main.hslToRgb(hue, 1f, 0.825f) * 0.85f; - auroraColor *= MathHelper.Lerp(0.3f, 1f, drawPower); + auroraColor *= MathHelper.Lerp(0.3f, 1f, auroraStrength); - if (fadeIn > 0f) - auroraColor *= Utils.InverseLerp(45f, 0f, fadeIn); - if (fadeOut > 0f) - auroraColor *= Utils.InverseLerp(0f, 45f, fadeOut); + if (FadeInCountdown > 0f) + auroraColor *= Utils.InverseLerp(45f, 0f, FadeInCountdown); + if (FadeoutTimer > 0f) + auroraColor *= Utils.InverseLerp(0f, 45f, FadeoutTimer); if (Main.dayTime) auroraColor *= 0.4f; @@ -126,7 +151,7 @@ namespace CalamityMod.Skies public override void Activate(Vector2 position, params object[] args) { - fadeIn = 45f; + FadeInCountdown = 45f; Auroras = new CryogenAurora[150]; for (int i = 0; i < Auroras.Length; i++) { @@ -137,11 +162,10 @@ namespace CalamityMod.Skies } } - public override void Deactivate(params object[] args) - { - } + public override void Reset() { } - public override void Reset() { } // a - public override bool IsActive() => (cryogenIndex != -1 || fadeOut > 0 || fadeIn > 0) && !Main.gameMenu; + public override void Deactivate(params object[] args) { } + + public override bool IsActive() => (CryogenIndex != -1 || FadeoutTimer > 0 || FadeInCountdown > 0) && !Main.gameMenu; } } diff --git a/Sounds/Custom/IronHeartBigHurt.cs b/Sounds/Custom/IronHeartBigHurt.cs deleted file mode 100644 index b968920933..0000000000 --- a/Sounds/Custom/IronHeartBigHurt.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class IronHeartBigHurt : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) - { - soundInstance = sound.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - Main.PlaySoundInstance(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/IronHeartBigHurt.ogg b/Sounds/Custom/IronHeartBigHurt.ogg deleted file mode 100644 index c49eb2531e..0000000000 Binary files a/Sounds/Custom/IronHeartBigHurt.ogg and /dev/null differ diff --git a/Sounds/Custom/IronHeartHurt.cs b/Sounds/Custom/IronHeartHurt.cs deleted file mode 100644 index f54cf60bf0..0000000000 --- a/Sounds/Custom/IronHeartHurt.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class IronHeartHurt : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) - { - soundInstance = sound.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - Main.PlaySoundInstance(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/IronHeartHurt.ogg b/Sounds/Custom/IronHeartHurt.ogg deleted file mode 100644 index 113478d360..0000000000 Binary files a/Sounds/Custom/IronHeartHurt.ogg and /dev/null differ diff --git a/Sounds/Item/IronHeartDeath.cs b/Sounds/Item/IronHeartDeath.cs deleted file mode 100644 index c6a9d97aaa..0000000000 --- a/Sounds/Item/IronHeartDeath.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Item -{ - public class IronHeartDeath : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) - { - soundInstance = sound.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - Main.PlaySoundInstance(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Item/IronHeartDeath.ogg b/Sounds/Item/IronHeartDeath.ogg deleted file mode 100644 index ea63c441d2..0000000000 Binary files a/Sounds/Item/IronHeartDeath.ogg and /dev/null differ diff --git a/Tiles/CalamityGlobalTile.cs b/Tiles/CalamityGlobalTile.cs index 0c4a2fb3e9..b1a2f22308 100644 --- a/Tiles/CalamityGlobalTile.cs +++ b/Tiles/CalamityGlobalTile.cs @@ -2,6 +2,7 @@ using CalamityMod.CalPlayer; using CalamityMod.Events; using CalamityMod.Items.Potions; using CalamityMod.Items.TreasureBags; +using CalamityMod.Items.Weapons.Melee; using CalamityMod.Projectiles.Environment; using CalamityMod.Tiles.Abyss; using CalamityMod.Tiles.Astral; @@ -197,16 +198,22 @@ namespace CalamityMod.Tiles Gore.NewGore(new Vector2(i, j) * 16, Main.rand.NextVector2CircularEdge(3f, 3f), mod.GetGoreSlot("Gores/SulphSeaGen/SulphPotGore2")); } } - else if (type == TileID.DemonAltar && CalamityConfig.Instance.EarlyHardmodeProgressionRework && Main.hardMode) + else if (type == TileID.DemonAltar && Main.hardMode) { - int quantity = 6; Vector2 pos = new Vector2(i, j) * 16; - for (int k = 0; k < quantity; k += 1) + if (CalamityConfig.Instance.EarlyHardmodeProgressionRework) { - pos.X += Main.rand.NextFloat(-32f, 32f); - pos.Y += Main.rand.NextFloat(-32f, 32f); - Item.NewItem(pos, ItemID.SoulofNight, 1); + WorldGen.altarCount++; + int quantity = 6; + for (int k = 0; k < quantity; k += 1) + { + pos.X += Main.rand.NextFloat(-32f, 32f); + pos.Y += Main.rand.NextFloat(-32f, 32f); + Item.NewItem(pos, ItemID.SoulofNight); + } } + if (WorldGen.altarCount % 3 == 0 && WorldGen.altarCount > 1) + Item.NewItem(pos, ModContent.ItemType()); } } diff --git a/Tiles/DraedonStructures/AgedLaboratoryDoorClosed.png b/Tiles/DraedonStructures/AgedLaboratoryDoorClosed.png index 95d6be2a76..9c9a428add 100644 Binary files a/Tiles/DraedonStructures/AgedLaboratoryDoorClosed.png and b/Tiles/DraedonStructures/AgedLaboratoryDoorClosed.png differ diff --git a/Tiles/DraedonStructures/AgedLaboratoryDoorClosed_Highlight.png b/Tiles/DraedonStructures/AgedLaboratoryDoorClosed_Highlight.png index 6e7c679e06..5bddc040bd 100644 Binary files a/Tiles/DraedonStructures/AgedLaboratoryDoorClosed_Highlight.png and b/Tiles/DraedonStructures/AgedLaboratoryDoorClosed_Highlight.png differ diff --git a/Tiles/DraedonStructures/AgedLaboratoryDoorOpen.png b/Tiles/DraedonStructures/AgedLaboratoryDoorOpen.png index f81ecd2a79..bf15a23f2d 100644 Binary files a/Tiles/DraedonStructures/AgedLaboratoryDoorOpen.png and b/Tiles/DraedonStructures/AgedLaboratoryDoorOpen.png differ diff --git a/Tiles/DraedonStructures/AgedLaboratoryDoorOpen_Highlight.png b/Tiles/DraedonStructures/AgedLaboratoryDoorOpen_Highlight.png index 67d4102d82..db5e0740ae 100644 Binary files a/Tiles/DraedonStructures/AgedLaboratoryDoorOpen_Highlight.png and b/Tiles/DraedonStructures/AgedLaboratoryDoorOpen_Highlight.png differ diff --git a/Tiles/DraedonStructures/LaboratoryDoorClosed.png b/Tiles/DraedonStructures/LaboratoryDoorClosed.png index 7e05cf6076..15e66321c3 100644 Binary files a/Tiles/DraedonStructures/LaboratoryDoorClosed.png and b/Tiles/DraedonStructures/LaboratoryDoorClosed.png differ diff --git a/Tiles/DraedonStructures/LaboratoryDoorClosed_Highlight.png b/Tiles/DraedonStructures/LaboratoryDoorClosed_Highlight.png index 6e7c679e06..5bddc040bd 100644 Binary files a/Tiles/DraedonStructures/LaboratoryDoorClosed_Highlight.png and b/Tiles/DraedonStructures/LaboratoryDoorClosed_Highlight.png differ diff --git a/Tiles/DraedonStructures/LaboratoryDoorOpen.png b/Tiles/DraedonStructures/LaboratoryDoorOpen.png index e2756de99d..90794cfcbf 100644 Binary files a/Tiles/DraedonStructures/LaboratoryDoorOpen.png and b/Tiles/DraedonStructures/LaboratoryDoorOpen.png differ diff --git a/Tiles/DraedonStructures/LaboratoryDoorOpen_Highlight.png b/Tiles/DraedonStructures/LaboratoryDoorOpen_Highlight.png index 67d4102d82..db5e0740ae 100644 Binary files a/Tiles/DraedonStructures/LaboratoryDoorOpen_Highlight.png and b/Tiles/DraedonStructures/LaboratoryDoorOpen_Highlight.png differ diff --git a/Tiles/MonsterBanner.cs b/Tiles/MonsterBanner.cs index 7ecc55890d..483bec02db 100644 --- a/Tiles/MonsterBanner.cs +++ b/Tiles/MonsterBanner.cs @@ -31,394 +31,9 @@ namespace CalamityMod.Tiles public override void KillMultiTile(int i, int j, int frameX, int frameY) { int style = frameX / 18; - string item; - switch (style) - { - case 0: - item = "AquaticParasiteBanner"; - break; - case 1: - item = "FlounderBanner"; - break; - case 2: - item = "GnasherBanner"; - break; - case 3: - item = "TrasherBanner"; - break; - case 4: - item = "CatfishBanner"; - break; - case 5: - item = "MaulerBanner"; - break; - case 6: - item = "AquaticSeekerBanner"; - break; - case 7: - item = "AquaticUrchinBanner"; - break; - case 8: - item = "FrogfishBanner"; - break; - case 9: - item = "MantisShrimpBanner"; - break; - case 10: - item = "AquaticAberrationBanner"; - break; - case 11: - item = "ParaseaBanner"; - break; - case 12: - item = "SeaUrchinBanner"; - break; - case 13: - item = "BoxJellyfishBanner"; - break; - case 14: - item = "MorayEelBanner"; - break; - case 15: - item = "DevilFishBanner"; - break; - case 16: - item = "CuttlefishBanner"; - break; - case 17: - item = "ToxicMinnowBanner"; - break; - case 18: - item = "ViperfishBanner"; - break; - case 19: - item = "LuminousCorvinaBanner"; - break; - case 20: - item = "GiantSquidBanner"; - break; - case 21: - item = "LaserfishBanner"; - break; - case 22: - item = "OarfishBanner"; - break; - case 23: - item = "ColossalSquidBanner"; - break; - case 24: - item = "MirageJellyBanner"; - break; - case 25: - item = "EidolistBanner"; - break; - case 26: - item = "GulperEelBanner"; - break; - case 27: - item = "EidolonWyrmJuvenileBanner"; - break; - case 28: - item = "BloatfishBanner"; - break; - case 29: - item = "BobbitWormBanner"; - break; - case 30: - item = "ChaoticPufferBanner"; - break; - case 31: - item = "AstralProbeBanner"; - break; - case 32: - item = "SmallSightseerBanner"; - break; - case 33: - item = "BigSightseerBanner"; - break; - case 34: - item = "AriesBanner"; - break; - case 35: - item = "AstralSlimeBanner"; - break; - case 36: - item = "AtlasBanner"; - break; - case 37: - item = "MantisBanner"; - break; - case 38: - item = "NovaBanner"; - break; - case 39: - item = "AstralachneaBanner"; - break; - case 40: - item = "HiveBanner"; - break; - case 41: - item = "StellarCullexBanner"; - break; - case 42: - item = "FusionFeederBanner"; - break; - case 43: - item = "HadarianBanner"; - break; - case 44: - item = "HeatSpiritBanner"; - break; - case 45: - item = "ScryllarBanner"; - break; - case 46: - item = "DespairStoneBanner"; - break; - case 47: - item = "SoulSlurperBanner"; - break; - case 48: - item = "ImpiousImmolatorBanner"; - break; - case 49: - item = "ScornEaterBanner"; - break; - case 50: - item = "ProfanedEnergyBanner"; - break; - case 51: - item = "WulfrumSlimeBanner"; - break; - case 52: - item = "WulfrumDroneBanner"; - break; - case 53: - item = "PitbullBanner"; - break; - case 54: - item = "BlightedEyeBanner"; - break; - case 55: - item = "CalamityEyeBanner"; - break; - case 56: - item = "SunskaterBanner"; - break; - case 57: - item = "ShockstormShuttleBanner"; - break; - case 58: - item = "CloudElementalBanner"; - break; - case 59: - item = "AngryDogBanner"; - break; - case 60: - item = "CryonBanner"; - break; - case 61: - item = "IceClasperBanner"; - break; - case 62: - item = "StormlionBanner"; - break; - case 63: - item = "CnidrionBanner"; - break; - case 64: - item = "SandTortoiseBanner"; - break; - case 65: - item = "GreatSandSharkBanner"; - break; - case 66: - item = "AmethystCrawlerBanner"; - break; - case 67: - item = "TopazCrawlerBanner"; - break; - case 68: - item = "SapphireCrawlerBanner"; - break; - case 69: - item = "EmeraldCrawlerBanner"; - break; - case 70: - item = "RubyCrawlerBanner"; - break; - case 71: - item = "DiamondCrawlerBanner"; - break; - case 72: - item = "AmberCrawlerBanner"; - break; - case 73: - item = "CrystalCrawlerBanner"; - break; - case 74: - item = "SunBatBanner"; - break; - case 75: - item = "CosmicElementalBanner"; - break; - case 76: - item = "EarthElementalBanner"; - break; - case 77: - item = "ArmoredDiggerBanner"; - break; - case 78: - item = "MelterBanner"; - break; - case 79: - item = "PestilentSlimeBanner"; - break; - case 80: - item = "PlagueshellBanner"; - break; - case 81: - item = "PlagueChargerBanner"; - break; - case 82: - item = "VirulingBanner"; - break; - case 83: - item = "PlaguebringerBanner"; - break; - case 84: - item = "PhantomSpiritBanner"; - break; - case 85: - item = "OverloadedSoldierBanner"; - break; - case 86: - item = "PhantomDebrisBanner"; - break; - case 87: - item = "BOHLDOHRBanner"; - break; - case 88: - item = "EbonianBlightSlimeBanner"; - break; - case 89: - item = "CrimulanBlightSlimeBanner"; - break; - case 90: - item = "AeroSlimeBanner"; - break; - case 91: - item = "CryoSlimeBanner"; - break; - case 92: - item = "PerennialSlimeBanner"; - break; - case 93: - item = "CharredSlimeBanner"; - break; - case 94: - item = "BloomSlimeBanner"; - break; - case 95: - item = "CultistAssassinBanner"; - break; - case 96: - item = "ReaperSharkBanner"; - break; - case 97: - item = "IrradiatedSlimeBanner"; - break; - case 98: - item = "PrismTurtleBanner"; - break; - case 99: - item = "ClamBanner"; - break; - case 100: - item = "EutrophicRayBanner"; - break; - case 101: - item = "GhostBellBanner"; - break; - case 102: - item = "GhostBellSmallBanner"; - break; - case 103: - item = "SeaFloatyBanner"; - break; - case 104: - item = "BlindedAnglerBanner"; - break; - case 105: - item = "SeaMinnowBanner"; - break; - case 106: - item = "SeaSerpentBanner"; - break; - case 107: - item = "GiantClamBanner"; - break; - case 108: - item = "PiggyBanner"; - break; - case 109: - item = "FearlessGoldfishWarriorBanner"; - break; - case 110: - item = "RadiatorBanner"; - break; - case 111: - item = "TrilobiteBanner"; - break; - case 112: - item = "OrthoceraBanner"; - break; - case 113: - item = "SkyfinBanner"; - break; - case 114: - item = "WaterLeechBanner"; - break; - case 115: - item = "AcidEelBanner"; - break; - case 116: - item = "NuclearToadBanner"; - break; - case 117: - item = "FlakCrabBanner"; - break; - case 118: - item = "SulfurousSkaterBanner"; - break; - case 119: - item = "FlakBabyBanner"; - break; - case 120: - item = "AnthozoanCrabBanner"; - break; - case 121: - item = "BelchingCoralBanner"; - break; - case 122: - item = "GammaSlimeBanner"; - break; - case 123: - item = "WulfrumGyratorBanner"; - break; - case 124: - item = "WulfrumHovercraftBanner"; - break; - case 125: - item = "WulfrumRoverBanner"; - break; - case 126: - item = "WulfrumPylonBanner"; - break; - default: - return; - } - Item.NewItem(i * 16, j * 16, 16, 48, mod.ItemType(item)); + int banner = CalamityUtils.GetBannerItem(style); + if (banner != -1) + Item.NewItem(i * 16, j * 16, 16, 48, banner); } public override void NearbyEffects(int i, int j, bool closer) @@ -430,393 +45,10 @@ namespace CalamityMod.Tiles return; int style = Main.tile[i, j].frameX / 18; - string type; - switch (style) - { - case 0: - type = "AquaticParasite"; - break; - case 1: - type = "Flounder"; - break; - case 2: - type = "Gnasher"; - break; - case 3: - type = "Trasher"; - break; - case 4: - type = "Catfish"; - break; - case 5: - type = "Mauler"; - break; - case 6: - type = "AquaticSeekerHead"; - break; - case 7: - type = "AquaticUrchin"; - break; - case 8: - type = "Frogfish"; - break; - case 9: - type = "MantisShrimp"; - break; - case 10: - type = "AquaticAberration"; - break; - case 11: - type = "Parasea"; - break; - case 12: - type = "SeaUrchin"; - break; - case 13: - type = "BoxJellyfish"; - break; - case 14: - type = "MorayEel"; - break; - case 15: - type = "DevilFish"; - break; - case 16: - type = "Cuttlefish"; - break; - case 17: - type = "ToxicMinnow"; - break; - case 18: - type = "Viperfish"; - break; - case 19: - type = "LuminousCorvina"; - break; - case 20: - type = "GiantSquid"; - break; - case 21: - type = "Laserfish"; - break; - case 22: - type = "OarfishHead"; - break; - case 23: - type = "ColossalSquid"; - break; - case 24: - type = "MirageJelly"; - break; - case 25: - type = "Eidolist"; - break; - case 26: - type = "GulperEelHead"; - break; - case 27: - type = "EidolonWyrmHead"; - break; - case 28: - type = "Bloatfish"; - break; - case 29: - type = "BobbitWormHead"; - break; - case 30: - type = "ChaoticPuffer"; - break; - case 31: - type = "AstralProbe"; - break; - case 32: - type = "SmallSightseer"; - break; - case 33: - type = "BigSightseer"; - break; - case 34: - type = "Aries"; - break; - case 35: - type = "AstralSlime"; - break; - case 36: - type = "Atlas"; - break; - case 37: - type = "Mantis"; - break; - case 38: - type = "Nova"; - break; - case 39: - type = "AstralachneaGround"; - break; - case 40: - type = "Hive"; - break; - case 41: - type = "StellarCulex"; - break; - case 42: - type = "FusionFeeder"; - break; - case 43: - type = "Hadarian"; - break; - case 44: - type = "HeatSpirit"; - break; - case 45: - type = "Scryllar"; - break; - case 46: - type = "DespairStone"; - break; - case 47: - type = "SoulSlurper"; - break; - case 48: - type = "ImpiousImmolator"; - break; - case 49: - type = "ScornEater"; - break; - case 50: - type = "ProfanedEnergyBody"; - break; - case 52: - type = "WulfrumDrone"; - break; - case 53: - type = "Pitbull"; - break; - case 54: - type = "BlightedEye"; - break; - case 55: - type = "CalamityEye"; - break; - case 56: - type = "Sunskater"; - break; - case 57: - type = "ShockstormShuttle"; - break; - case 58: - type = "ThiccWaifu"; - break; - case 59: - type = "AngryDog"; - break; - case 60: - type = "Cryon"; - break; - case 61: - type = "IceClasper"; - break; - case 62: - type = "StormlionCharger"; - break; - case 63: - type = "Cnidrion"; - break; - case 64: - type = "SandTortoise"; - break; - case 65: - type = "GreatSandShark"; - break; - case 66: - type = "CrawlerAmethyst"; - break; - case 67: - type = "CrawlerTopaz"; - break; - case 68: - type = "CrawlerSapphire"; - break; - case 69: - type = "CrawlerEmerald"; - break; - case 70: - type = "CrawlerRuby"; - break; - case 71: - type = "CrawlerDiamond"; - break; - case 72: - type = "CrawlerAmber"; - break; - case 73: - type = "CrawlerCrystal"; - break; - case 74: - type = "SunBat"; - break; - case 75: - type = "CosmicElemental"; - break; - case 76: - type = "Horse"; - break; - case 77: - type = "ArmoredDiggerHead"; - break; - case 78: - type = "PlaguedFlyingFox"; - break; - case 79: - type = "PlaguedJungleSlime"; - break; - case 80: - type = "PlaguedTortoise"; - break; - case 81: - type = "PlagueBee"; - break; - case 82: - type = "PlaguedDerpling"; - break; - case 83: - type = "PlaguebringerShade"; - break; - case 84: - type = "PhantomSpirit"; - break; - case 85: - type = "OverloadedSoldier"; - break; - case 86: - type = "PhantomDebris"; - break; - case 87: - type = "Bohldohr"; - break; - case 88: - type = "EbonianBlightSlime"; - break; - case 89: - type = "CrimulanBlightSlime"; - break; - case 90: - type = "AeroSlime"; - break; - case 91: - type = "CryoSlime"; - break; - case 92: - type = "PerennialSlime"; - break; - case 93: - type = "CharredSlime"; - break; - case 94: - type = "BloomSlime"; - break; - case 95: - type = "CultistAssassin"; - break; - case 96: - type = "Reaper"; - break; - case 97: - type = "IrradiatedSlime"; - break; - case 98: - type = "PrismTurtle"; - break; - case 99: - type = "Clam"; - break; - case 100: - type = "EutrophicRay"; - break; - case 101: - type = "GhostBell"; - break; - case 102: - type = "GhostBellSmall"; - break; - case 103: - type = "SeaFloaty"; - break; - case 104: - type = "BlindedAngler"; - break; - case 105: - type = "SeaMinnow"; - break; - case 106: - type = "SeaSerpent1"; - break; - case 107: - type = "GiantClam"; - break; - case 108: - type = "Piggy"; - break; - case 109: - type = "FearlessGoldfishWarrior"; - break; - case 110: - type = "Radiator"; - break; - case 111: - type = "Trilobite"; - break; - case 112: - type = "Orthocera"; - break; - case 113: - type = "Skyfin"; - break; - case 114: - type = "WaterLeech"; - break; - case 115: - type = "AcidEel"; - break; - case 116: - type = "NuclearToad"; - break; - case 117: - type = "FlakCrab"; - break; - case 118: - type = "SulfurousSkater"; - break; - case 119: - type = "FlakBaby"; - break; - case 120: - type = "AnthozoanCrab"; - break; - case 121: - type = "BelchingCoral"; - break; - case 122: - type = "GammaSlime"; - break; - case 123: - type = "WulfrumGyrator"; - break; - case 124: - type = "WulfrumHovercraft"; - break; - case 125: - type = "WulfrumRover"; - break; - case 126: - type = "WulfrumPylon"; - break; - default: - return; - } - if (type.Length > 0) + int npc = CalamityUtils.GetBannerNPC(style); + if (npc != -1) { - player.NPCBannerBuff[mod.NPCType(type)] = true; + player.NPCBannerBuff[npc] = true; player.hasBanner = true; } } diff --git a/Utilities/CalamityRecipes.cs b/Utilities/CalamityRecipes.cs index 88bcc42aa6..53de1daf13 100644 --- a/Utilities/CalamityRecipes.cs +++ b/Utilities/CalamityRecipes.cs @@ -29,6 +29,7 @@ namespace CalamityMod public static void AddRecipes() { EditLeatherRecipe(); + EditPhoenixBlaster(); EditTerraBladeRecipe(); EditFireGauntletRecipe(); EditSpiritFlameRecipe(); @@ -145,6 +146,26 @@ namespace CalamityMod }); } + // Change Phoenix Blaster's recipe to be consistent with literally every other weapon recipes in the game + private static void EditPhoenixBlaster() + { + List rec = Main.recipe.ToList(); + rec.Where(x => x.createItem.type == ItemID.PhoenixBlaster).ToList().ForEach(s => + { + for (int i = 0; i < s.requiredItem.Length; i++) + { + s.requiredItem[i] = new Item(); + } + s.requiredItem[0].SetDefaults(ItemID.Handgun, false); + s.requiredItem[0].stack = 1; + s.requiredItem[1].SetDefaults(ItemID.HellstoneBar, false); + s.requiredItem[1].stack = 10; + + s.createItem.SetDefaults(ItemID.PhoenixBlaster, false); + s.createItem.stack = 1; + }); + } + // Change Terra Blade's recipe to require 7 Living Shards (forces the Blade to be post-Plantera) private static void EditTerraBladeRecipe() { diff --git a/Utilities/DropHelper.cs b/Utilities/DropHelper.cs index b3fa50b89e..4aa0a47485 100644 --- a/Utilities/DropHelper.cs +++ b/Utilities/DropHelper.cs @@ -1,5 +1,4 @@ using CalamityMod.Items.Accessories; -using CalamityMod.NPCs; using CalamityMod.World; using Microsoft.Xna.Framework; using System.Collections.Generic; @@ -247,14 +246,6 @@ namespace CalamityMod } #endregion - #region Extra Boss Bags - /// - /// The number of extra loot bags bosses drop when Armageddon is active.

- /// This is normally 5. Bosses drop 5 bags on normal, and 6 on Expert+. - ///
- public static int ArmageddonExtraBags = 5; - #endregion - #region Boss Bag Drop Helpers /// /// Automatically drops the correct number of boss bags for each difficulty based on constants kept in DropHelper. @@ -269,9 +260,6 @@ namespace CalamityMod if (theBoss is null) return bagsDropped; - // Armageddon's bonus bags drop even on Normal. - bagsDropped += DropArmageddonBags(theBoss); - // If the difficulty isn't Expert+, no more bags are dropped. if (!Main.expertMode) return bagsDropped; @@ -282,21 +270,6 @@ namespace CalamityMod return bagsDropped; } - - /// - /// Drops the correct number of boss bags for Armageddon. - /// - /// The NPC to drop boss bags for. - /// The number of boss bags dropped. No bags are dropped if the boss has been downed already. - public static int DropArmageddonBags(NPC theBoss) - { - if (!CalamityWorld.armageddon || CalamityGlobalNPC.GetDownedBossVariable(theBoss.type)) - return 0; - - for (int i = 0; i < ArmageddonExtraBags; ++i) - theBoss.DropBossBags(); - return ArmageddonExtraBags; - } #endregion #region Specific Drop Helpers diff --git a/Utilities/ItemUtils.cs b/Utilities/ItemUtils.cs index a0fb9542ac..a42a886f67 100644 --- a/Utilities/ItemUtils.cs +++ b/Utilities/ItemUtils.cs @@ -29,8 +29,6 @@ namespace CalamityMod internal static readonly Color DraedonRustRarityColor = new Color(204, 71, 35); // The donator rarity isn't technically a rarity, but is a constant color used in tooltips internal static readonly Color DonatorItemColor = new Color(139, 0, 0); - // The Challenge Drop rarity isn't technically a rarity, but is a constant color used in tooltips - internal static readonly Color ChallengeDropColor = new Color(255, 140, 0); public static readonly CalamityRarity[] postMLRarities = { @@ -445,8 +443,6 @@ namespace CalamityMod (player.Calamity().coreOfTheBloodGod ? 0.15 : 0) + (player.Calamity().bloodPactBoost ? 0.5 : 0); int healAmt = (int)(item.healLife * healMult); - if (CalamityWorld.ironHeart) - healAmt = 0; if (healAmt > 0 && player.QuickHeal_GetItemToUse() != null) { if (player.QuickHeal_GetItemToUse().type != item.type) diff --git a/Utilities/MiscUtils.cs b/Utilities/MiscUtils.cs index 5ced6652fa..c84df23fda 100644 --- a/Utilities/MiscUtils.cs +++ b/Utilities/MiscUtils.cs @@ -1,4 +1,16 @@ +using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Tools.ClimateChange; +using CalamityMod.NPCs.Abyss; +using CalamityMod.NPCs.AcidRain; +using CalamityMod.NPCs.AquaticScourge; +using CalamityMod.NPCs.Astral; +using CalamityMod.NPCs.Crags; +using CalamityMod.NPCs.GreatSandShark; +using CalamityMod.NPCs.Leviathan; +using CalamityMod.NPCs.NormalNPCs; +using CalamityMod.NPCs.PlagueEnemies; +using CalamityMod.NPCs.SulphurousSea; +using CalamityMod.NPCs.SunkenSea; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Graphics; @@ -315,5 +327,786 @@ namespace CalamityMod Main.dayTime = changeToDay; CalamityNetcode.SyncWorld(); } + + public static int GetBannerItem(int style) + { + int item = -1; + switch (style) + { + case 0: + item = ModContent.ItemType(); + break; + case 1: + item = ModContent.ItemType(); + break; + case 2: + item = ModContent.ItemType(); + break; + case 3: + item = ModContent.ItemType(); + break; + case 4: + item = ModContent.ItemType(); + break; + case 5: + item = ModContent.ItemType(); + break; + case 6: + item = ModContent.ItemType(); + break; + case 7: + item = ModContent.ItemType(); + break; + case 8: + item = ModContent.ItemType(); + break; + case 9: + item = ModContent.ItemType(); + break; + case 10: + item = ModContent.ItemType(); + break; + case 11: + item = ModContent.ItemType(); + break; + case 12: + item = ModContent.ItemType(); + break; + case 13: + item = ModContent.ItemType(); + break; + case 14: + item = ModContent.ItemType(); + break; + case 15: + item = ModContent.ItemType(); + break; + case 16: + item = ModContent.ItemType(); + break; + case 17: + item = ModContent.ItemType(); + break; + case 18: + item = ModContent.ItemType(); + break; + case 19: + item = ModContent.ItemType(); + break; + case 20: + item = ModContent.ItemType(); + break; + case 21: + item = ModContent.ItemType(); + break; + case 22: + item = ModContent.ItemType(); + break; + case 23: + item = ModContent.ItemType(); + break; + case 24: + item = ModContent.ItemType(); + break; + case 25: + item = ModContent.ItemType(); + break; + case 26: + item = ModContent.ItemType(); + break; + case 27: + item = ModContent.ItemType(); + break; + case 28: + item = ModContent.ItemType(); + break; + case 29: + item = ModContent.ItemType(); + break; + case 30: + item = ModContent.ItemType(); + break; + case 31: + item = ModContent.ItemType(); + break; + case 32: + item = ModContent.ItemType(); + break; + case 33: + item = ModContent.ItemType(); + break; + case 34: + item = ModContent.ItemType(); + break; + case 35: + item = ModContent.ItemType(); + break; + case 36: + item = ModContent.ItemType(); + break; + case 37: + item = ModContent.ItemType(); + break; + case 38: + item = ModContent.ItemType(); + break; + case 39: + item = ModContent.ItemType(); + break; + case 40: + item = ModContent.ItemType(); + break; + case 41: + item = ModContent.ItemType(); + break; + case 42: + item = ModContent.ItemType(); + break; + case 43: + item = ModContent.ItemType(); + break; + case 44: + item = ModContent.ItemType(); + break; + case 45: + item = ModContent.ItemType(); + break; + case 46: + item = ModContent.ItemType(); + break; + case 47: + item = ModContent.ItemType(); + break; + case 48: + item = ModContent.ItemType(); + break; + case 49: + item = ModContent.ItemType(); + break; + case 50: + item = ModContent.ItemType(); + break; + case 51: + item = ModContent.ItemType(); + break; + case 52: + item = ModContent.ItemType(); + break; + case 53: + item = ModContent.ItemType(); + break; + case 54: + item = ModContent.ItemType(); + break; + case 55: + item = ModContent.ItemType(); + break; + case 56: + item = ModContent.ItemType(); + break; + case 57: + item = ModContent.ItemType(); + break; + case 58: + item = ModContent.ItemType(); + break; + case 59: + item = ModContent.ItemType(); + break; + case 60: + item = ModContent.ItemType(); + break; + case 61: + item = ModContent.ItemType(); + break; + case 62: + item = ModContent.ItemType(); + break; + case 63: + item = ModContent.ItemType(); + break; + case 64: + item = ModContent.ItemType(); + break; + case 65: + item = ModContent.ItemType(); + break; + case 66: + item = ModContent.ItemType(); + break; + case 67: + item = ModContent.ItemType(); + break; + case 68: + item = ModContent.ItemType(); + break; + case 69: + item = ModContent.ItemType(); + break; + case 70: + item = ModContent.ItemType(); + break; + case 71: + item = ModContent.ItemType(); + break; + case 72: + item = ModContent.ItemType(); + break; + case 73: + item = ModContent.ItemType(); + break; + case 74: + item = ModContent.ItemType(); + break; + case 75: + item = ModContent.ItemType(); + break; + case 76: + item = ModContent.ItemType(); + break; + case 77: + item = ModContent.ItemType(); + break; + case 78: + item = ModContent.ItemType(); + break; + case 79: + item = ModContent.ItemType(); + break; + case 80: + item = ModContent.ItemType(); + break; + case 81: + item = ModContent.ItemType(); + break; + case 82: + item = ModContent.ItemType(); + break; + case 83: + item = ModContent.ItemType(); + break; + case 84: + item = ModContent.ItemType(); + break; + case 85: + item = ModContent.ItemType(); + break; + case 86: + item = ModContent.ItemType(); + break; + case 87: + item = ModContent.ItemType(); + break; + case 88: + item = ModContent.ItemType(); + break; + case 89: + item = ModContent.ItemType(); + break; + case 90: + item = ModContent.ItemType(); + break; + case 91: + item = ModContent.ItemType(); + break; + case 92: + item = ModContent.ItemType(); + break; + case 93: + item = ModContent.ItemType(); + break; + case 94: + item = ModContent.ItemType(); + break; + case 95: + item = ModContent.ItemType(); + break; + case 96: + item = ModContent.ItemType(); + break; + case 97: + item = ModContent.ItemType(); + break; + case 98: + item = ModContent.ItemType(); + break; + case 99: + item = ModContent.ItemType(); + break; + case 100: + item = ModContent.ItemType(); + break; + case 101: + item = ModContent.ItemType(); + break; + case 102: + item = ModContent.ItemType(); + break; + case 103: + item = ModContent.ItemType(); + break; + case 104: + item = ModContent.ItemType(); + break; + case 105: + item = ModContent.ItemType(); + break; + case 106: + item = ModContent.ItemType(); + break; + case 107: + item = ModContent.ItemType(); + break; + case 108: + item = ModContent.ItemType(); + break; + case 109: + item = ModContent.ItemType(); + break; + case 110: + item = ModContent.ItemType(); + break; + case 111: + item = ModContent.ItemType(); + break; + case 112: + item = ModContent.ItemType(); + break; + case 113: + item = ModContent.ItemType(); + break; + case 114: + item = ModContent.ItemType(); + break; + case 115: + item = ModContent.ItemType(); + break; + case 116: + item = ModContent.ItemType(); + break; + case 117: + item = ModContent.ItemType(); + break; + case 118: + item = ModContent.ItemType(); + break; + case 119: + item = ModContent.ItemType(); + break; + case 120: + item = ModContent.ItemType(); + break; + case 121: + item = ModContent.ItemType(); + break; + case 122: + item = ModContent.ItemType(); + break; + case 123: + item = ModContent.ItemType(); + break; + case 124: + item = ModContent.ItemType(); + break; + case 125: + item = ModContent.ItemType(); + break; + case 126: + item = ModContent.ItemType(); + break; + default: + break; + } + return item; + } + + public static int GetBannerNPC(int style) + { + int npc = -1; + switch (style) + { + case 0: + npc = ModContent.NPCType(); + break; + case 1: + npc = ModContent.NPCType(); + break; + case 2: + npc = ModContent.NPCType(); + break; + case 3: + npc = ModContent.NPCType(); + break; + case 4: + npc = ModContent.NPCType(); + break; + case 5: + npc = ModContent.NPCType(); + break; + case 6: + npc = ModContent.NPCType(); + break; + case 7: + npc = ModContent.NPCType(); + break; + case 8: + npc = ModContent.NPCType(); + break; + case 9: + npc = ModContent.NPCType(); + break; + case 10: + npc = ModContent.NPCType(); + break; + case 11: + npc = ModContent.NPCType(); + break; + case 12: + npc = ModContent.NPCType(); + break; + case 13: + npc = ModContent.NPCType(); + break; + case 14: + npc = ModContent.NPCType(); + break; + case 15: + npc = ModContent.NPCType(); + break; + case 16: + npc = ModContent.NPCType(); + break; + case 17: + npc = ModContent.NPCType(); + break; + case 18: + npc = ModContent.NPCType(); + break; + case 19: + npc = ModContent.NPCType(); + break; + case 20: + npc = ModContent.NPCType(); + break; + case 21: + npc = ModContent.NPCType(); + break; + case 22: + npc = ModContent.NPCType(); + break; + case 23: + npc = ModContent.NPCType(); + break; + case 24: + npc = ModContent.NPCType(); + break; + case 25: + npc = ModContent.NPCType(); + break; + case 26: + npc = ModContent.NPCType(); + break; + case 27: + npc = ModContent.NPCType(); + break; + case 28: + npc = ModContent.NPCType(); + break; + case 29: + npc = ModContent.NPCType(); + break; + case 30: + npc = ModContent.NPCType(); + break; + case 31: + npc = ModContent.NPCType(); + break; + case 32: + npc = ModContent.NPCType(); + break; + case 33: + npc = ModContent.NPCType(); + break; + case 34: + npc = ModContent.NPCType(); + break; + case 35: + npc = ModContent.NPCType(); + break; + case 36: + npc = ModContent.NPCType(); + break; + case 37: + npc = ModContent.NPCType(); + break; + case 38: + npc = ModContent.NPCType(); + break; + case 39: + npc = ModContent.NPCType(); + break; + case 40: + npc = ModContent.NPCType(); + break; + case 41: + npc = ModContent.NPCType(); + break; + case 42: + npc = ModContent.NPCType(); + break; + case 43: + npc = ModContent.NPCType(); + break; + case 44: + npc = ModContent.NPCType(); + break; + case 45: + npc = ModContent.NPCType(); + break; + case 46: + npc = ModContent.NPCType(); + break; + case 47: + npc = ModContent.NPCType(); + break; + case 48: + npc = ModContent.NPCType(); + break; + case 49: + npc = ModContent.NPCType(); + break; + case 50: + npc = ModContent.NPCType(); + break; + case 52: + npc = ModContent.NPCType(); + break; + case 53: + npc = ModContent.NPCType(); + break; + case 54: + npc = ModContent.NPCType(); + break; + case 55: + npc = ModContent.NPCType(); + break; + case 56: + npc = ModContent.NPCType(); + break; + case 57: + npc = ModContent.NPCType(); + break; + case 58: + npc = ModContent.NPCType(); + break; + case 59: + npc = ModContent.NPCType(); + break; + case 60: + npc = ModContent.NPCType(); + break; + case 61: + npc = ModContent.NPCType(); + break; + case 62: + npc = ModContent.NPCType(); + break; + case 63: + npc = ModContent.NPCType(); + break; + case 64: + npc = ModContent.NPCType(); + break; + case 65: + npc = ModContent.NPCType(); + break; + case 66: + npc = ModContent.NPCType(); + break; + case 67: + npc = ModContent.NPCType(); + break; + case 68: + npc = ModContent.NPCType(); + break; + case 69: + npc = ModContent.NPCType(); + break; + case 70: + npc = ModContent.NPCType(); + break; + case 71: + npc = ModContent.NPCType(); + break; + case 72: + npc = ModContent.NPCType(); + break; + case 73: + npc = ModContent.NPCType(); + break; + case 74: + npc = ModContent.NPCType(); + break; + case 75: + npc = ModContent.NPCType(); + break; + case 76: + npc = ModContent.NPCType(); + break; + case 77: + npc = ModContent.NPCType(); + break; + case 78: + npc = ModContent.NPCType(); + break; + case 79: + npc = ModContent.NPCType(); + break; + case 80: + npc = ModContent.NPCType(); + break; + case 81: + npc = ModContent.NPCType(); + break; + case 82: + npc = ModContent.NPCType(); + break; + case 83: + npc = ModContent.NPCType(); + break; + case 84: + npc = ModContent.NPCType(); + break; + case 85: + npc = ModContent.NPCType(); + break; + case 86: + npc = ModContent.NPCType(); + break; + case 87: + npc = ModContent.NPCType(); + break; + case 88: + npc = ModContent.NPCType(); + break; + case 89: + npc = ModContent.NPCType(); + break; + case 90: + npc = ModContent.NPCType(); + break; + case 91: + npc = ModContent.NPCType(); + break; + case 92: + npc = ModContent.NPCType(); + break; + case 93: + npc = ModContent.NPCType(); + break; + case 94: + npc = ModContent.NPCType(); + break; + case 95: + npc = ModContent.NPCType(); + break; + case 96: + npc = ModContent.NPCType(); + break; + case 97: + npc = ModContent.NPCType(); + break; + case 98: + npc = ModContent.NPCType(); + break; + case 99: + npc = ModContent.NPCType(); + break; + case 100: + npc = ModContent.NPCType(); + break; + case 101: + npc = ModContent.NPCType(); + break; + case 102: + npc = ModContent.NPCType(); + break; + case 103: + npc = ModContent.NPCType(); + break; + case 104: + npc = ModContent.NPCType(); + break; + case 105: + npc = ModContent.NPCType(); + break; + case 106: + npc = ModContent.NPCType(); + break; + case 107: + npc = ModContent.NPCType(); + break; + case 108: + npc = ModContent.NPCType(); + break; + case 109: + npc = ModContent.NPCType(); + break; + case 110: + npc = ModContent.NPCType(); + break; + case 111: + npc = ModContent.NPCType(); + break; + case 112: + npc = ModContent.NPCType(); + break; + case 113: + npc = ModContent.NPCType(); + break; + case 114: + npc = ModContent.NPCType(); + break; + case 115: + npc = ModContent.NPCType(); + break; + case 116: + npc = ModContent.NPCType(); + break; + case 117: + npc = ModContent.NPCType(); + break; + case 118: + npc = ModContent.NPCType(); + break; + case 119: + npc = ModContent.NPCType(); + break; + case 120: + npc = ModContent.NPCType(); + break; + case 121: + npc = ModContent.NPCType(); + break; + case 122: + npc = ModContent.NPCType(); + break; + case 123: + npc = ModContent.NPCType(); + break; + case 124: + npc = ModContent.NPCType(); + break; + case 125: + npc = ModContent.NPCType(); + break; + case 126: + npc = ModContent.NPCType(); + break; + default: + break; + } + return npc; + } } } diff --git a/Utilities/NPCDebuffs.cs b/Utilities/NPCDebuffs.cs index 42231f5dc1..21aedc4a7e 100644 --- a/Utilities/NPCDebuffs.cs +++ b/Utilities/NPCDebuffs.cs @@ -2,6 +2,7 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.NPCs.Abyss; using CalamityMod.NPCs.AcidRain; +using CalamityMod.NPCs.AdultEidolonWyrm; using CalamityMod.NPCs.AquaticScourge; using CalamityMod.NPCs.Astral; using CalamityMod.NPCs.AstrumAureus; diff --git a/Utilities/NPCStats.cs b/Utilities/NPCStats.cs index 255c1e0dfd..87b6097719 100644 --- a/Utilities/NPCStats.cs +++ b/Utilities/NPCStats.cs @@ -1,5 +1,5 @@ using CalamityMod.NPCs; -using CalamityMod.NPCs.Abyss; +using CalamityMod.NPCs.AdultEidolonWyrm; using CalamityMod.NPCs.AquaticScourge; using CalamityMod.NPCs.AstrumAureus; using CalamityMod.NPCs.AstrumDeus; @@ -486,7 +486,7 @@ namespace CalamityMod { ModContent.NPCType(), new int[] { 100, 200, 220, 232, 270 } }, { ModContent.NPCType(), new int[] { 150, 300, 330, 348, 450 } }, - { ModContent.NPCType(), new int[] { 120, 240, 264, 278, 360 } }, + { ModContent.NPCType(), new int[] { 130, 260, 288, 304, 390 } }, { ModContent.NPCType(), new int[] { 180, 360, 396, 418, 540 } }, { ModContent.NPCType(), new int[] { 120, 192, 224, 250, 330 } }, @@ -563,16 +563,10 @@ namespace CalamityMod { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 42, 68, 84, 92, 126 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 38, 60, 76, 84, 114 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 60, 96, 116, 128, 174 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 54, 88, 108, 116, 162 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 42, 68, 84, 92, 126 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 60, 96, 116, 128, 174 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 38, 60, 76, 84, 114 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 54, 88, 108, 116, 162 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 38, 60, 76, 84, 114 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 54, 88, 104, 112, 156 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 34, 52, 68, 74, 102 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 48, 80, 100, 108, 150 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 24, 48, 60, 68, 90 } }, { new Tuple(NPCID.WallofFleshEye, ProjectileID.EyeLaser), new int[] { @@ -582,10 +576,10 @@ namespace CalamityMod 76, 102 } }, // 66 to 90, depending on life { new Tuple(NPCID.WallofFleshEye, ProjectileID.DeathLaser), new int[] { 40, 72, 88, 96, 132 } }, - { new Tuple(NPCID.WallofFlesh, ProjectileID.DemonSickle), new int[] { 40, 72, 88, 96, 132 } }, + { new Tuple(NPCID.WallofFlesh, ProjectileID.DemonSickle), new int[] { 52, 92, 112, 124, 168 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 46, 80, 96, 108, 144 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 58, 100, 120, 132, 180 } }, + { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 60, 108, 132, 144, 198 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 52, 92, 112, 124, 168 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 46, 80, 96, 108, 144 } }, @@ -604,6 +598,7 @@ namespace CalamityMod { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 56, 92, 116, 128, 174 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 66, 112, 128, 140, 192 } }, + { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 70, 120, 136, 152, 210 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 60, 100, 120, 132, 180 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 56, 92, 116, 128, 174 } }, @@ -614,15 +609,15 @@ namespace CalamityMod { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 70, 112, 128, 140, 192 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 60, 100, 108, 116, 162 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 60, 100, 108, 116, 162 } }, + { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 70, 112, 128, 140, 192 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 100, 172, 184, 200, 276 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 70, 112, 128, 140, 192 } }, - { new Tuple(NPCID.SkeletronPrime, ProjectileID.Skull), new int[] { 44, 88, 112, 124, 168 } }, + { new Tuple(NPCID.SkeletronPrime, ProjectileID.Skull), new int[] { 50, 100, 124, 136, 186 } }, { new Tuple(NPCID.SkeletronPrime, ProjectileID.DeathLaser), new int[] { 50, 100, 124, 136, 186 } }, - { new Tuple(NPCID.SkeletronPrime, ProjectileID.RocketSkeleton), new int[] { 54, 108, 132, 144, 198 } }, - { new Tuple(NPCID.SkeletronPrime, ProjectileID.SaucerMissile), new int[] { 54, 108, 132, 144, 198 } }, - { new Tuple(NPCID.PrimeCannon, ProjectileID.RocketSkeleton), new int[] { 54, 108, 132, 144, 198 } }, + { new Tuple(NPCID.SkeletronPrime, ProjectileID.RocketSkeleton), new int[] { 60, 120, 148, 160, 222 } }, + { new Tuple(NPCID.SkeletronPrime, ProjectileID.SaucerMissile), new int[] { 60, 120, 148, 160, 222 } }, + { new Tuple(NPCID.PrimeCannon, ProjectileID.RocketSkeleton), new int[] { 60, 120, 148, 160, 222 } }, { new Tuple(NPCID.PrimeCannon, ProjectileID.BombSkeletronPrime), new int[] { 80, 160, 0, 0, 240 } }, { new Tuple(NPCID.PrimeLaser, ProjectileID.DeathLaser), new int[] { 50, 100, 124, 136, 186 } }, // 150 in non-rev master mode @@ -651,7 +646,7 @@ namespace CalamityMod { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 72, 116, 136, 144, 204 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 74, 128, 148, 160, 222 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 80, 140, 160, 172, 240 } }, + { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 88, 140, 160, 172, 252 } }, { new Tuple(NPCID.Golem, ProjectileID.Fireball), new int[] { 58, 116, 148, 160, 222 } }, { new Tuple(NPCID.Golem, ProjectileID.EyeBeam), new int[] { 56, 112, 140, 152, 210 } }, @@ -709,15 +704,15 @@ namespace CalamityMod { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 200, 220, 232, 330 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 200, 300, 332, 356, 498 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 130, 208, 228, 240, 342 } }, + { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 150, 264, 288, 300, 432 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 192, 220, 236, 330 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 192, 220, 236, 330 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 130, 208, 228, 240, 342 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 35, 50, 50, 0, 0 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 110, 168, 196, 208, 294 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 110, 168, 196, 208, 294 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 192, 220, 236, 330 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 192, 220, 236, 330 } }, + { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 228, 252, 264, 378 } }, + { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 105, 171, 189, 198, 284 } }, + { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 228, 252, 264, 378 } }, + { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 105, 171, 189, 198, 284 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 130, 208, 228, 240, 342 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 228, 252, 264, 378 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 228, 252, 264, 378 } }, @@ -725,13 +720,13 @@ namespace CalamityMod { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 200, 220, 232, 330 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 200, 232, 248, 348 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 200, 232, 248, 348 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 200, 232, 248, 348 } }, + { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 228, 252, 264, 378 } }, + { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 228, 252, 264, 378 } }, { new Tuple(ModContent.NPCType(), ProjectileID.CultistBossLightningOrb), new int[] { 150, 264, 288, 300, 432 } }, { new Tuple(ModContent.NPCType(), ProjectileID.CultistBossLightningOrbArc), new int[] { 150, 264, 288, 300, 432 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 192, 212, 224, 318 } }, + { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 130, 212, 236, 248, 354 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 240, 264, 280, 396 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 192, 212, 224, 318 } }, @@ -739,7 +734,7 @@ namespace CalamityMod { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 240, 264, 280, 396 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 150, 260, 288, 304, 432 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 192, 212, 224, 318 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 150, 260, 288, 304, 432 } }, + { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 160, 276, 304, 320, 456 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 130, 212, 236, 248, 354 } }, { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 150, 240, 264, 276, 390 } }, diff --git a/Utilities/NPCUtils.cs b/Utilities/NPCUtils.cs index 6b42057171..e394dbbc46 100644 --- a/Utilities/NPCUtils.cs +++ b/Utilities/NPCUtils.cs @@ -271,20 +271,6 @@ namespace CalamityMod return ClosestNPCAt(origin, maxDistanceToCheck, ignoreTiles); } - /// - /// Crude anti-butcher logic based on % max health. - /// - /// The NPC attacked. - /// How much damage the attack would deal. - /// Whether or not the anti-butcher was triggered. - public static bool AntiButcher(NPC npc, ref double damage, float healthPercent) - { - if (damage <= npc.lifeMax * healthPercent) - return false; - damage = 0D; - return true; - } - /// /// Check if an NPC is organic /// @@ -304,33 +290,6 @@ namespace CalamityMod return false; } - /// - /// Check if an NPC is inorganic - /// - /// The NPC attacked. - /// Whether or not the NPC is inorganic. - public static bool Inorganic(this NPC target) - { - if (target.HitSound != SoundID.NPCHit1 && target.HitSound != SoundID.NPCHit6 && target.HitSound != SoundID.NPCHit7 && - target.HitSound != SoundID.NPCHit8 && target.HitSound != SoundID.NPCHit9 && target.HitSound != SoundID.NPCHit12 && - target.HitSound != SoundID.NPCHit13 && target.HitSound != SoundID.NPCHit14 && target.HitSound != SoundID.NPCHit18 && - target.HitSound != SoundID.NPCHit19 && target.HitSound != SoundID.NPCHit20 && target.HitSound != SoundID.NPCHit21 && - target.HitSound != SoundID.NPCHit22 && target.HitSound != SoundID.NPCHit23 && target.HitSound != SoundID.NPCHit24 && - target.HitSound != SoundID.NPCHit25 && target.HitSound != SoundID.NPCHit26 && target.HitSound != SoundID.NPCHit27 && - target.HitSound != SoundID.NPCHit28 && target.HitSound != SoundID.NPCHit29 && target.HitSound != SoundID.NPCHit31 && - target.HitSound != SoundID.NPCHit32 && target.HitSound != SoundID.NPCHit33 && target.HitSound != SoundID.NPCHit35 && - target.HitSound != SoundID.NPCHit37 && target.HitSound != SoundID.NPCHit38 && target.HitSound != SoundID.NPCHit40 && - target.HitSound != SoundID.NPCHit43 && target.HitSound != SoundID.NPCHit44 && target.HitSound != SoundID.NPCHit45 && - target.HitSound != SoundID.NPCHit46 && target.HitSound != SoundID.NPCHit47 && target.HitSound != SoundID.NPCHit48 && - target.HitSound != SoundID.NPCHit50 && target.HitSound != SoundID.NPCHit51 && target.HitSound != SoundID.NPCHit55 && - target.HitSound != SoundID.NPCHit56 && target.HitSound != SoundID.NPCHit57 && target.type != NPCType() && - target.type != NPCType() && target.type != NPCType()) - { - return true; - } - return false; - } - /// /// Shortcut for the generic boss summon message. /// diff --git a/World/CalamityWorld.cs b/World/CalamityWorld.cs index b2f1dedfa7..d1a5525e93 100644 --- a/World/CalamityWorld.cs +++ b/World/CalamityWorld.cs @@ -27,7 +27,7 @@ using Terraria.World.Generation; namespace CalamityMod.World { - public class CalamityWorld : ModWorld + public partial class CalamityWorld : ModWorld { #region Vars public static int DoGSecondStageCountdown = 0; @@ -46,12 +46,10 @@ namespace CalamityMod.World public static int deathBossSpawnCooldown = 0; // Cooldown between Death Mode natural boss spawns // Modes - public static bool demonMode = false; // Spawn rate boost public static bool onionMode = false; // Extra accessory from Moon Lord public static bool revenge = false; // Revengeance Mode public static bool death = false; // Death Mode public static bool armageddon = false; // Armageddon Mode - public static bool ironHeart = false; // Iron Heart Mode public static bool malice = false; // Malice Mode // New Temple Altar @@ -322,7 +320,6 @@ namespace CalamityMod.World downedBumble = false; downedCrabulon = false; downedBetsy = false; - demonMode = false; onionMode = false; revenge = false; downedStarGod = false; @@ -333,7 +330,6 @@ namespace CalamityMod.World downedSecondSentinels = false; death = false; armageddon = false; - ironHeart = false; malice = false; rainingAcid = false; downedEoCAcidRain = false; @@ -404,8 +400,6 @@ namespace CalamityMod.World downed.Add("betsy"); if (downedScavenger) downed.Add("scavenger"); - if (demonMode) - downed.Add("demonMode"); if (onionMode) downed.Add("onionMode"); if (revenge) @@ -424,8 +418,6 @@ namespace CalamityMod.World downed.Add("death"); if (armageddon) downed.Add("armageddon"); - if (ironHeart) - downed.Add("ironHeart"); if (malice) downed.Add("malice"); if (abyssSide) @@ -566,7 +558,6 @@ namespace CalamityMod.World downedCrabulon = downed.Contains("crabulon"); downedBetsy = downed.Contains("betsy"); downedScavenger = downed.Contains("scavenger"); - demonMode = downed.Contains("demonMode"); onionMode = downed.Contains("onionMode"); revenge = downed.Contains("revenge"); downedStarGod = downed.Contains("starGod"); @@ -576,7 +567,6 @@ namespace CalamityMod.World downedBoomerDuke = downed.Contains("oldDuke"); death = downed.Contains("death"); armageddon = downed.Contains("armageddon"); - ironHeart = downed.Contains("ironHeart"); malice = downed.Contains("malice"); abyssSide = downed.Contains("abyssSide"); BossRushEvent.BossRushActive = downed.Contains("bossRushActive"); @@ -688,7 +678,7 @@ namespace CalamityMod.World _ = flags4[2]; _ = flags4[3]; _ = flags4[4]; - demonMode = flags4[5]; + _ = flags4[5]; onionMode = flags4[6]; revenge = flags4[7]; @@ -710,7 +700,7 @@ namespace CalamityMod.World armageddon = flags6[4]; _ = flags6[5]; _ = flags6[6]; - ironHeart = flags6[7]; + _ = flags6[7]; BitsByte flags7 = reader.ReadByte(); BossRushEvent.BossRushActive = flags7[0]; @@ -809,7 +799,7 @@ namespace CalamityMod.World flags4[2] = false; flags4[3] = false; flags4[4] = false; - flags4[5] = demonMode; + flags4[5] = false; flags4[6] = onionMode; flags4[7] = revenge; @@ -831,7 +821,7 @@ namespace CalamityMod.World flags6[4] = armageddon; flags6[5] = false; flags6[6] = false; - flags6[7] = ironHeart; + flags6[7] = false; BitsByte flags7 = new BitsByte(); flags7[0] = BossRushEvent.BossRushActive; @@ -952,7 +942,7 @@ namespace CalamityMod.World _ = flags4[2]; _ = flags4[3]; _ = flags4[4]; - demonMode = flags4[5]; + _ = flags4[5]; onionMode = flags4[6]; revenge = flags4[7]; @@ -974,7 +964,7 @@ namespace CalamityMod.World armageddon = flags6[4]; _ = flags6[5]; _ = flags6[6]; - ironHeart = flags6[7]; + _ = flags6[7]; BitsByte flags7 = reader.ReadByte(); BossRushEvent.BossRushActive = flags7[0]; @@ -1307,9 +1297,5 @@ namespace CalamityMod.World } } #endregion - - #region PostUpdate - public override void PostUpdate() => WorldUpdateMiscEffects.PerformWorldUpdates(); - #endregion } } diff --git a/World/WorldUpdateMiscEffects.cs b/World/WorldUpdateMiscEffects.cs index 87cdee4172..c799934fdd 100644 --- a/World/WorldUpdateMiscEffects.cs +++ b/World/WorldUpdateMiscEffects.cs @@ -2,7 +2,7 @@ using CalamityMod.CalPlayer; using CalamityMod.DataStructures; using CalamityMod.Events; using CalamityMod.NPCs; -using CalamityMod.NPCs.Abyss; +using CalamityMod.NPCs.AdultEidolonWyrm; using CalamityMod.NPCs.AstrumAureus; using CalamityMod.NPCs.Bumblebirb; using CalamityMod.NPCs.Calamitas; @@ -34,10 +34,14 @@ using static CalamityMod.World.CalamityWorld; namespace CalamityMod.World { - public class WorldUpdateMiscEffects + public partial class CalamityWorld : ModWorld { - public static void PerformWorldUpdates() + public override void PostUpdate() { + // Reset this int because it causes bugs with other mods if you delete Dr. Draedon through abnormal means + if (!NPC.AnyNPCs(ModContent.NPCType())) + CalamityGlobalNPC.draedon = -1; + // Reset the exo mech to summon if Draedon is absent. if (DraedonMechToSummon != ExoMech.None && CalamityGlobalNPC.draedon == -1) DraedonMechToSummon = ExoMech.None; @@ -388,9 +392,6 @@ namespace CalamityMod.World if (revenge) spawnRate *= 0.85D; - if (demonMode) - spawnRate *= 0.75D; - if (death && Main.bloodMoon) spawnRate *= 0.2D; if (modPlayer.zerg)