diff --git a/Buffs/StatBuffs/AdrenalineMode.cs b/Buffs/StatBuffs/AdrenalineMode.cs index f5fefad9cc..fc160dabe4 100644 --- a/Buffs/StatBuffs/AdrenalineMode.cs +++ b/Buffs/StatBuffs/AdrenalineMode.cs @@ -6,13 +6,10 @@ namespace CalamityMod.Buffs.StatBuffs { public class AdrenalineMode : ModBuff { - public static string RevTip = "150% damage boost. Can burnout down to 49.5%."; - public static string DeathTip = "500% damage boost. Can burnout down to 165%."; - public override void SetDefaults() { DisplayName.SetDefault("Adrenaline Mode"); - Description.SetDefault(RevTip); + Description.SetDefault("150% damage boost. Can burnout down to 49.5%."); Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; @@ -24,11 +21,5 @@ namespace CalamityMod.Buffs.StatBuffs { player.Calamity().adrenalineMode = true; } - - public override void ModifyBuffTip(ref string tip, ref int rare) - { - if (CalamityWorld.death) - tip = DeathTip; - } } } diff --git a/Buffs/StatBuffs/RageMode.cs b/Buffs/StatBuffs/RageMode.cs index 9e4e76b70c..9fcb1a870a 100644 --- a/Buffs/StatBuffs/RageMode.cs +++ b/Buffs/StatBuffs/RageMode.cs @@ -6,13 +6,10 @@ namespace CalamityMod.Buffs.StatBuffs { public class RageMode : ModBuff { - public static string RevTip = "50% damage boost. Can be boosted by other items up to 110%."; - public static string DeathTip = "170% damage boost. Can be boosted by other items up to 350%."; - public override void SetDefaults() { DisplayName.SetDefault("Rage Mode"); - Description.SetDefault(RevTip); + Description.SetDefault("50% damage boost. Can be boosted by other items up to 110%."); Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = false; @@ -24,11 +21,5 @@ namespace CalamityMod.Buffs.StatBuffs { player.Calamity().rageMode = true; } - - public override void ModifyBuffTip(ref string tip, ref int rare) - { - if (CalamityWorld.death) - tip = DeathTip; - } } } diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 72062ccb73..c387f8a456 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -4258,7 +4258,7 @@ namespace CalamityMod.CalPlayer { if (item.melee) { - damageMult += CalamityWorld.death ? (DHorHoD ? 7.6 : 6.8) : (DHorHoD ? 2.3 : 2.0); // Death Mode values: 8.9 and 8.0, rev: 2.3 and 2.0 + damageMult += (DHorHoD ? 2.3 : 2.0); } } else if (rageMode) @@ -4266,10 +4266,10 @@ namespace CalamityMod.CalPlayer if (item.melee) { double rageDamageBoost = 0.0 + - (rageBoostOne ? (CalamityWorld.death ? 0.5 : 0.15) : 0.0) + // Death Mode values: 0.6, rev: 0.15 - (rageBoostTwo ? (CalamityWorld.death ? 0.5 : 0.15) : 0.0) + // Death Mode values: 0.6, rev: 0.15 - (rageBoostThree ? (CalamityWorld.death ? 0.5 : 0.15) : 0.0); // Death Mode values: 0.6, rev: 0.15 - double rageDamage = (CalamityWorld.death ? (DHorHoD ? 2.0 : 1.7) : (DHorHoD ? 0.65 : 0.5)) + rageDamageBoost; // Death Mode values: 2.3 and 2.0, rev: 0.65 and 0.5 + (rageBoostOne ? 0.15 : 0.0) + + (rageBoostTwo ? 0.15 : 0.0) + + (rageBoostThree ? 0.15 : 0.0); + double rageDamage = (DHorHoD ? 0.65 : 0.5) + rageDamageBoost; damageMult += rageDamage; } } @@ -4277,7 +4277,7 @@ namespace CalamityMod.CalPlayer { if (item.melee) { - double damageMultAdr = (CalamityWorld.death ? 5.0 : 1.5) * (double)adrenalineDmgMult; // Death Mode values: 6, rev: 1.5 + double damageMultAdr = 1.5 * (double)adrenalineDmgMult; damageMult += damageMultAdr; } } @@ -4548,7 +4548,7 @@ namespace CalamityMod.CalPlayer { if (hasClassType) { - damageMult += CalamityWorld.death ? (DHorHoD ? 7.6 : 6.8) : (DHorHoD ? 2.3 : 2.0); // Death Mode values: 8.9 and 8.0, rev: 2.3 and 2.0 + damageMult += (DHorHoD ? 2.3 : 2.0); } } else if (rageMode) @@ -4556,10 +4556,10 @@ namespace CalamityMod.CalPlayer if (hasClassType) { double rageDamageBoost = 0.0 + - (rageBoostOne ? (CalamityWorld.death ? 0.5 : 0.15) : 0.0) + // Death Mode values: 0.6, rev: 0.15 - (rageBoostTwo ? (CalamityWorld.death ? 0.5 : 0.15) : 0.0) + // Death Mode values: 0.6, rev: 0.15 - (rageBoostThree ? (CalamityWorld.death ? 0.5 : 0.15) : 0.0); // Death Mode values: 0.6, rev: 0.15 - double rageDamage = (CalamityWorld.death ? (DHorHoD ? 2.0 : 1.7) : (DHorHoD ? 0.65 : 0.5)) + rageDamageBoost; // Death Mode values: 2.3 and 2.0, rev: 0.65 and 0.5 + (rageBoostOne ? 0.15 : 0.0) + + (rageBoostTwo ? 0.15 : 0.0) + + (rageBoostThree ? 0.15 : 0.0); + double rageDamage = (DHorHoD ? 0.65 : 0.5) + rageDamageBoost; damageMult += rageDamage; } } @@ -4567,7 +4567,7 @@ namespace CalamityMod.CalPlayer { if (hasClassType) { - double damageMultAdr = (CalamityWorld.death ? 5.0 : 1.5) * (double)adrenalineDmgMult; // Death Mode values: 6, rev: 1.5 + double damageMultAdr = 1.5 * (double)adrenalineDmgMult; damageMult += damageMultAdr; } } @@ -7439,8 +7439,7 @@ namespace CalamityMod.CalPlayer if ((drawPlayer.itemAnimation > 0 && item.useStyle != 0) || (item.holdStyle > 0 && !drawPlayer.pulley)) { // Staff - if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || - item.type == ModContent.ItemType()) + if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) { Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/DeathhailStaffGlow"); if (item.type == ModContent.ItemType()) @@ -7562,33 +7561,75 @@ namespace CalamityMod.CalPlayer Main.playerDrawData.Add(data); } } - - //NOTE -- This doesn't work and I don't know what I'm doing - - /*Microsoft.Xna.Framework.Color color12 = drawPlayer.GetImmuneAlphaPure(Lighting.GetColor((int) ((double) drawPlayer.position.X + (double) drawPlayer.width * 0.5) / 16, (int) ((double) drawPlayer.position.Y + (double) drawPlayer.height * 0.5) / 16, Microsoft.Xna.Framework.Color.White), drawInfo.shadow);*/ - - if (item.type == ModContent.ItemType()) - //32 is the height of the texture, 14 is the width of the texture - { - Texture2D texture = ModContent.GetTexture("CalamityMod/ExtraTextures/Tanks/FlurrystormCannonTankFull"); - - DrawData data = new DrawData(texture, - new Vector2((float) (int) ((double) drawPlayer.position.X - (double) Main.screenPosition.X + (double) (drawPlayer.width / 2) - (double) (9 * drawPlayer.direction)) + -4f * (float) drawPlayer.direction, - (float) (int) ((double) drawPlayer.position.Y - (double) Main.screenPosition.Y + (double) (drawPlayer.height / 2) + 2.0 * (double) drawPlayer.gravDir + (double) -8f * (double) drawPlayer.gravDir)), - new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, 14, 32)), - Color.White, - drawPlayer.bodyRotation, - new Vector2((float) (14 / 2), - (float) (32 / 2)), - 1f, - effect, - 0); - - Main.playerDrawData.Add(data); - } } }); + public override void ModifyDrawInfo(ref PlayerDrawInfo drawInfo) + { + if (drawInfo.shadow != 0f) + return; + + Player drawPlayer = drawInfo.drawPlayer; + Item item = drawPlayer.inventory[drawPlayer.selectedItem]; + + if (!drawPlayer.frozen && + item.type > 0 && + !drawPlayer.dead && + !item.noUseGraphic && + (!drawPlayer.wet || !item.noWet)) + { + if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) + { + Color color89 = drawInfo.middleArmorColor = drawPlayer.GetImmuneAlphaPure(Lighting.GetColor((int)(drawPlayer.position.X + drawPlayer.width * 0.5) / 16, (int)(drawPlayer.position.Y + drawPlayer.height * 0.5) / 16, Color.White), drawInfo.shadow); + SpriteEffects spriteEffects = player.direction == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + + Texture2D thingToDraw = ModContent.GetTexture("CalamityMod/ExtraTextures/Tanks/Backpack_FlurrystormCannon"); + if (item.type == ModContent.ItemType()) + thingToDraw = ModContent.GetTexture("CalamityMod/ExtraTextures/Tanks/Backpack_BlightSpewer"); + else if (item.type == ModContent.ItemType()) + thingToDraw = ModContent.GetTexture("CalamityMod/ExtraTextures/Tanks/Backpack_BrimstoneFlameblaster"); + else if (item.type == ModContent.ItemType()) + thingToDraw = ModContent.GetTexture("CalamityMod/ExtraTextures/Tanks/Backpack_HavocsBreath"); + else if (item.type == ModContent.ItemType()) + thingToDraw = ModContent.GetTexture("CalamityMod/ExtraTextures/Tanks/Backpack_SparkSpreader"); + else if (item.type == ModContent.ItemType()) + thingToDraw = ModContent.GetTexture("CalamityMod/ExtraTextures/Tanks/Backpack_HalleysInferno"); + else if (item.type == ModContent.ItemType()) + thingToDraw = ModContent.GetTexture("CalamityMod/ExtraTextures/Tanks/Backpack_CleansingBlaze"); + else if (item.type == ModContent.ItemType()) + thingToDraw = ModContent.GetTexture("CalamityMod/ExtraTextures/Tanks/Backpack_ElementalEruption"); + else if (item.type == ModContent.ItemType()) + thingToDraw = ModContent.GetTexture("CalamityMod/ExtraTextures/Tanks/Backpack_TheEmpyrean"); + else if (item.type == ModContent.ItemType()) + thingToDraw = ModContent.GetTexture("CalamityMod/ExtraTextures/Tanks/Backpack_Meowthrower"); + else if (item.type == ModContent.ItemType()) + thingToDraw = ModContent.GetTexture("CalamityMod/ExtraTextures/Tanks/Backpack_OverloadedBlaster"); + else if (item.type == ModContent.ItemType()) + thingToDraw = ModContent.GetTexture("CalamityMod/ExtraTextures/Tanks/Backpack_TerraFlameburster"); + else if (item.type == ModContent.ItemType()) + thingToDraw = ModContent.GetTexture("CalamityMod/ExtraTextures/Tanks/Backpack_Photoviscerator"); + else if (item.type == ModContent.ItemType()) + thingToDraw = ModContent.GetTexture("CalamityMod/ExtraTextures/Tanks/Backpack_Shadethrower"); + + float num25 = -4f; + float num24 = -8f; + DrawData howDoIDrawThings = new DrawData(thingToDraw, + new Vector2((int)(drawPlayer.position.X - Main.screenPosition.X + (drawPlayer.width / 2) - (9 * drawPlayer.direction)) + num25 * drawPlayer.direction, + (int)(drawPlayer.position.Y - Main.screenPosition.Y + (drawPlayer.height / 2) + 2f * drawPlayer.gravDir + num24 * drawPlayer.gravDir)), + new Rectangle(0, 0, thingToDraw.Width, thingToDraw.Height), + color89, + drawPlayer.bodyRotation, + new Vector2(thingToDraw.Width / 2, + thingToDraw.Height / 2), + 1f, + spriteEffects, + 0); + howDoIDrawThings.shader = 0; + Main.playerDrawData.Add(howDoIDrawThings); + } + } + } + public override void ModifyDrawLayers(List list) { MiscEffectsBack.visible = true; diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 09f1e6a9e1..0cdf39e717 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -2822,10 +2822,10 @@ namespace CalamityMod.CalPlayer (modPlayer.adrenalineBoostThree ? 5 : 0); bool DHorHoD = modPlayer.draedonsHeart || modPlayer.heartOfDarkness; int rageDamageBoost = 0 + - (modPlayer.rageBoostOne ? (CalamityWorld.death ? 50 : 15) : 0) + - (modPlayer.rageBoostTwo ? (CalamityWorld.death ? 50 : 15) : 0) + - (modPlayer.rageBoostThree ? (CalamityWorld.death ? 50 : 15) : 0); - modPlayer.rageDamageStat = (CalamityWorld.death ? (DHorHoD ? 200 : 170) : (DHorHoD ? 65 : 50)) + rageDamageBoost; // Death Mode values: 2.3 and 2.0, rev: 0.65 and 0.5 + (modPlayer.rageBoostOne ? 15 : 0) + + (modPlayer.rageBoostTwo ? 15 : 0) + + (modPlayer.rageBoostThree ? 15 : 0); + modPlayer.rageDamageStat = (DHorHoD ? 65 : 50) + rageDamageBoost; } #endregion diff --git a/CalamityMod.cs b/CalamityMod.cs index f4610fe650..ce26b89663 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -280,7 +280,10 @@ namespace CalamityMod Filters.Scene["CalamityMod:SupremeCalamitas"] = new Filter(new SCalScreenShaderData("FilterMiniTower").UseColor(1.1f, 0.3f, 0.3f).UseOpacity(0.65f), EffectPriority.VeryHigh); SkyManager.Instance["CalamityMod:SupremeCalamitas"] = new SCalSky(); - Filters.Scene["CalamityMod:Astral"] = new Filter(new AstralScreenShaderData(new Ref(CustomShader), "AstralPass").UseColor(0.18f, 0.08f, 0.24f), EffectPriority.VeryHigh); + Filters.Scene["CalamityMod:Signus"] = new Filter(new SignusScreenShaderData("FilterMiniTower").UseColor(0.35f, 0.1f, 0.55f).UseOpacity(0.35f), EffectPriority.VeryHigh); + SkyManager.Instance["CalamityMod:Signus"] = new SignusSky(); + + Filters.Scene["CalamityMod:Astral"] = new Filter(new AstralScreenShaderData(new Ref(CustomShader), "AstralPass").UseColor(0.18f, 0.08f, 0.24f), EffectPriority.VeryHigh); SkyManager.Instance["CalamityMod:Astral"] = new AstralSky(); UIHandler.OnLoad(this); @@ -870,6 +873,8 @@ namespace CalamityMod ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), ModContent.ItemType() }; @@ -916,6 +921,8 @@ namespace CalamityMod ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), //Cryonic Bar set stuff, could potentially be removed ModContent.ItemType(), ModContent.ItemType(), @@ -1034,6 +1041,9 @@ namespace CalamityMod ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), ModContent.ItemType() }; @@ -1945,8 +1955,6 @@ namespace CalamityMod ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), @@ -1976,6 +1984,8 @@ namespace CalamityMod ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), ModContent.ItemType() }; @@ -1992,6 +2002,8 @@ namespace CalamityMod ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), ModContent.ProjectileType() }; @@ -3466,6 +3478,5 @@ namespace CalamityMod ArmageddonBoolSync, DemonTrophyBoolSync, NPCRegenerationSync - //DistanceFromBossSync } } diff --git a/ExtraTextures/Tanks/Backpack_BlightSpewer.png b/ExtraTextures/Tanks/Backpack_BlightSpewer.png new file mode 100644 index 0000000000..131777084b Binary files /dev/null and b/ExtraTextures/Tanks/Backpack_BlightSpewer.png differ diff --git a/ExtraTextures/Tanks/Backpack_BrimstoneFlameblaster.png b/ExtraTextures/Tanks/Backpack_BrimstoneFlameblaster.png new file mode 100644 index 0000000000..942eebc4e6 Binary files /dev/null and b/ExtraTextures/Tanks/Backpack_BrimstoneFlameblaster.png differ diff --git a/ExtraTextures/Tanks/Backpack_CleansingBlaze.png b/ExtraTextures/Tanks/Backpack_CleansingBlaze.png new file mode 100644 index 0000000000..52118e7091 Binary files /dev/null and b/ExtraTextures/Tanks/Backpack_CleansingBlaze.png differ diff --git a/ExtraTextures/Tanks/Backpack_ElementalEruption.png b/ExtraTextures/Tanks/Backpack_ElementalEruption.png new file mode 100644 index 0000000000..61c5a1cfb8 Binary files /dev/null and b/ExtraTextures/Tanks/Backpack_ElementalEruption.png differ diff --git a/ExtraTextures/Tanks/FlurrystormCannonTankFull.png b/ExtraTextures/Tanks/Backpack_FlurrystormCannon.png similarity index 100% rename from ExtraTextures/Tanks/FlurrystormCannonTankFull.png rename to ExtraTextures/Tanks/Backpack_FlurrystormCannon.png diff --git a/ExtraTextures/Tanks/Backpack_HalleysInferno.png b/ExtraTextures/Tanks/Backpack_HalleysInferno.png new file mode 100644 index 0000000000..9c7967d20c Binary files /dev/null and b/ExtraTextures/Tanks/Backpack_HalleysInferno.png differ diff --git a/ExtraTextures/Tanks/Backpack_HavocsBreath.png b/ExtraTextures/Tanks/Backpack_HavocsBreath.png new file mode 100644 index 0000000000..bf5bbda5b7 Binary files /dev/null and b/ExtraTextures/Tanks/Backpack_HavocsBreath.png differ diff --git a/ExtraTextures/Tanks/Backpack_Meowthrower.png b/ExtraTextures/Tanks/Backpack_Meowthrower.png new file mode 100644 index 0000000000..8e1810a038 Binary files /dev/null and b/ExtraTextures/Tanks/Backpack_Meowthrower.png differ diff --git a/ExtraTextures/Tanks/Backpack_OverloadedBlaster.png b/ExtraTextures/Tanks/Backpack_OverloadedBlaster.png new file mode 100644 index 0000000000..9d44a8b48c Binary files /dev/null and b/ExtraTextures/Tanks/Backpack_OverloadedBlaster.png differ diff --git a/ExtraTextures/Tanks/Backpack_Photoviscerator.png b/ExtraTextures/Tanks/Backpack_Photoviscerator.png new file mode 100644 index 0000000000..aa94ab14fd Binary files /dev/null and b/ExtraTextures/Tanks/Backpack_Photoviscerator.png differ diff --git a/ExtraTextures/Tanks/Backpack_Shadethrower.png b/ExtraTextures/Tanks/Backpack_Shadethrower.png new file mode 100644 index 0000000000..126cc8698e Binary files /dev/null and b/ExtraTextures/Tanks/Backpack_Shadethrower.png differ diff --git a/ExtraTextures/Tanks/Backpack_SparkSpreader.png b/ExtraTextures/Tanks/Backpack_SparkSpreader.png new file mode 100644 index 0000000000..4c2d548c0f Binary files /dev/null and b/ExtraTextures/Tanks/Backpack_SparkSpreader.png differ diff --git a/ExtraTextures/Tanks/Backpack_TerraFlameburster.png b/ExtraTextures/Tanks/Backpack_TerraFlameburster.png new file mode 100644 index 0000000000..a494e4aeca Binary files /dev/null and b/ExtraTextures/Tanks/Backpack_TerraFlameburster.png differ diff --git a/ExtraTextures/Tanks/Backpack_TheEmpyrean.png b/ExtraTextures/Tanks/Backpack_TheEmpyrean.png new file mode 100644 index 0000000000..585763a882 Binary files /dev/null and b/ExtraTextures/Tanks/Backpack_TheEmpyrean.png differ diff --git a/Gores/ViperFish.png b/Gores/ViperFish.png index ab7a2bfdc4..05d7d4fb67 100644 Binary files a/Gores/ViperFish.png and b/Gores/ViperFish.png differ diff --git a/Gores/ViperFish2.png b/Gores/ViperFish2.png index 41ee3dea2d..d7485cde9e 100644 Binary files a/Gores/ViperFish2.png and b/Gores/ViperFish2.png differ diff --git a/Items/Accessories/Nanotech.cs b/Items/Accessories/Nanotech.cs index 6c8860a212..fd26b56a7c 100644 --- a/Items/Accessories/Nanotech.cs +++ b/Items/Accessories/Nanotech.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Accessories if (line2.mod == "Terraria" && line2.Name == "Tooltip0") { line2.text = "Rogue projectiles create nanoblades as they travel\n" + - "Stealth strikes summon lunar flares and sparks on enemy hits\n" + + "Stealth strikes summon nanobeams and sparks on enemy hits\n" + "Stealth strikes have +20 armor penetration, deal 5% more damage, and heal for 1 HP\n" + "Rogue weapons have a chance to instantly kill normal enemies\n" + "5% increased rogue damage, 5% increased rogue crit chance, and 15% increased rogue velocity\n" + diff --git a/Items/Accessories/PlaguedFuelPack.cs b/Items/Accessories/PlaguedFuelPack.cs index 238b57cecf..7d711ee88a 100644 --- a/Items/Accessories/PlaguedFuelPack.cs +++ b/Items/Accessories/PlaguedFuelPack.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Accessories public override void SetStaticDefaults() { DisplayName.SetDefault("Plagued Fuel Pack"); - Tooltip.SetDefault("*5 increased rogue damage\n" + + Tooltip.SetDefault("5% increased rogue damage\n" + "15% increased rogue projectile velocity\n" + "Press [Hotkey] to consume 25% of your maximum stealth to perform a swift upwards/diagonal dash which leaves a trail of plagued clouds\n" + "This effect has a 3 second cooldown before it can be used again"); diff --git a/Items/Armor/XerocMask.cs b/Items/Armor/XerocMask.cs index dc34f65f84..12a2412850 100644 --- a/Items/Armor/XerocMask.cs +++ b/Items/Armor/XerocMask.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Items.Armor modPlayer.xerocSet = true; modPlayer.rogueStealthMax += 1.25f; player.setBonus = "9% increased rogue damage and velocity\n" + - "All projectile types have special effects on enemy hits\n" + + "Rogue projectiles have special effects on enemy hits\n" + "Imbued with cosmic wrath and rage when you are damaged\n" + "Rogue stealth builds while not attacking and not moving, up to a max of 125\n" + "Once you have built max stealth, you will be able to perform a Stealth Strike\n" + diff --git a/Items/Weapons/Melee/DraedonsExoblade.cs b/Items/Weapons/Melee/DraedonsExoblade.cs index 4201d7fe8a..94c8424e76 100644 --- a/Items/Weapons/Melee/DraedonsExoblade.cs +++ b/Items/Weapons/Melee/DraedonsExoblade.cs @@ -1,7 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.Ores; using CalamityMod.Projectiles.Melee; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; diff --git a/Items/Weapons/Melee/ExoGladius.cs b/Items/Weapons/Melee/ExoGladius.cs new file mode 100644 index 0000000000..794de98f0f --- /dev/null +++ b/Items/Weapons/Melee/ExoGladius.cs @@ -0,0 +1,112 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Melee; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Melee +{ + public class ExoGladius : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Exo Gladius"); + Tooltip.SetDefault("Do not underestimate the power of Exoblade's younger brother\n" + + "Striking an enemy with the blade makes you immune for a short time and summons comets from the sky\n" + + "Fires a rainbow orb that summons sword beams on hit"); + } + + public override void SetDefaults() + { + item.useStyle = 3; + item.useTurn = false; + item.useAnimation = 12; + item.useTime = 12; + item.width = 56; + item.height = 56; + item.damage = 3001; + item.melee = true; + item.knockBack = 9.9f; + item.UseSound = SoundID.Item1; + item.useTurn = true; + item.autoReuse = true; + item.value = Item.buyPrice(2, 50, 0, 0); + item.rare = 10; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 19f; + item.Calamity().postMoonLordRarity = 15; + } + + 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, item.shootSpeed * player.direction, 0f, type, damage, knockBack, player.whoAmI, 0f, 0f); + return false; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 4); + recipe.AddTile(ModContent.TileType()); + recipe.SetResult(this); + recipe.AddRecipe(); + } + + public override void MeleeEffects(Player player, Rectangle hitbox) + { + if (Main.rand.NextBool(5)) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 107); + } + } + + public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) + { + if (!player.immune) + { + player.immune = true; + if (player.immuneTime < 10) + player.immuneTime = 10; + if (player.hurtCooldowns[0] < 10) + player.hurtCooldowns[0] = 10; + if (player.hurtCooldowns[1] < 10) + player.hurtCooldowns[1] = 10; + } + + target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.CursedInferno, 120); + target.AddBuff(BuffID.Frostburn, 120); + target.AddBuff(BuffID.OnFire, 120); + target.AddBuff(BuffID.Ichor, 120); + + float x = target.Center.X + (float)Main.rand.Next(-400, 400); + float y = target.Center.Y - (float)Main.rand.Next(500, 800); + Vector2 vector = new Vector2(x, y); + float num15 = target.Center.X + (float)(target.width / 2) - vector.X; + float num16 = target.Center.Y + (float)(target.height / 2) - vector.Y; + num15 += (float)Main.rand.Next(-100, 101); + int num17 = 25; + float num18 = (float)Math.Sqrt((double)(num15 * num15 + num16 * num16)); + num18 = (float)num17 / num18; + num15 *= num18; + num16 *= num18; + if (player.whoAmI == Main.myPlayer) + { + Projectile.NewProjectile(x, y, num15, num16, ModContent.ProjectileType(), (int)(item.damage * (player.allDamage + player.meleeDamage - 1f)), 15f, player.whoAmI, 0f, 0f); + } + } + } +} diff --git a/Items/Weapons/Melee/ExoGladius.png b/Items/Weapons/Melee/ExoGladius.png new file mode 100644 index 0000000000..e1c9f0323b Binary files /dev/null and b/Items/Weapons/Melee/ExoGladius.png differ diff --git a/Items/Weapons/Ranged/BrimstoneFlameblaster.cs b/Items/Weapons/Ranged/BrimstoneFlameblaster.cs index c8543e0e09..6d740d05ea 100644 --- a/Items/Weapons/Ranged/BrimstoneFlameblaster.cs +++ b/Items/Weapons/Ranged/BrimstoneFlameblaster.cs @@ -1,4 +1,5 @@ using CalamityMod.Projectiles.Ranged; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -32,5 +33,10 @@ namespace CalamityMod.Items.Weapons.Ranged item.shootSpeed = 10f; item.useAmmo = 23; } + + public override Vector2? HoldoutOffset() + { + return new Vector2(-10, 0); + } } } diff --git a/Items/Weapons/Ranged/BrimstoneFlamesprayer.cs b/Items/Weapons/Ranged/BrimstoneFlamesprayer.cs index 844a2f3d62..248dfe8f3c 100644 --- a/Items/Weapons/Ranged/BrimstoneFlamesprayer.cs +++ b/Items/Weapons/Ranged/BrimstoneFlamesprayer.cs @@ -1,4 +1,5 @@ using CalamityMod.Projectiles.Ranged; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -31,5 +32,10 @@ namespace CalamityMod.Items.Weapons.Ranged item.shootSpeed = 8.5f; item.useAmmo = 23; } + + public override Vector2? HoldoutOffset() + { + return new Vector2(-10, 0); + } } } diff --git a/Items/Weapons/Ranged/ChickenCannon.cs b/Items/Weapons/Ranged/ChickenCannon.cs index 92ea40d095..6a89ba593b 100644 --- a/Items/Weapons/Ranged/ChickenCannon.cs +++ b/Items/Weapons/Ranged/ChickenCannon.cs @@ -1,4 +1,5 @@ using CalamityMod.Projectiles.Ranged; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -34,6 +35,11 @@ namespace CalamityMod.Items.Weapons.Ranged item.Calamity().postMoonLordRarity = 14; } + public override Vector2? HoldoutOffset() + { + return new Vector2(-10, 0); + } + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.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, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); diff --git a/Items/Weapons/Ranged/DragonsBreath.cs b/Items/Weapons/Ranged/DragonsBreath.cs index a02a75c510..0efe260b0d 100644 --- a/Items/Weapons/Ranged/DragonsBreath.cs +++ b/Items/Weapons/Ranged/DragonsBreath.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override Vector2? HoldoutOffset() { - return new Vector2(-5, 10); + return new Vector2(-5, 5); } 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/ElementalEruption.cs b/Items/Weapons/Ranged/ElementalEruption.cs index f49481286c..2059db310d 100644 --- a/Items/Weapons/Ranged/ElementalEruption.cs +++ b/Items/Weapons/Ranged/ElementalEruption.cs @@ -37,6 +37,11 @@ namespace CalamityMod.Items.Weapons.Ranged item.Calamity().postMoonLordRarity = 12; } + public override Vector2? HoldoutOffset() + { + 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) { int num6 = Main.rand.Next(3, 5); diff --git a/Items/Weapons/Ranged/FirestormCannon.cs b/Items/Weapons/Ranged/FirestormCannon.cs index 6bf6fed861..66688140de 100644 --- a/Items/Weapons/Ranged/FirestormCannon.cs +++ b/Items/Weapons/Ranged/FirestormCannon.cs @@ -2,6 +2,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using Microsoft.Xna.Framework; namespace CalamityMod.Items.Weapons.Ranged { @@ -34,6 +35,11 @@ namespace CalamityMod.Items.Weapons.Ranged item.useAmmo = 931; } + public override Vector2? HoldoutOffset() + { + return new Vector2(-10, 0); + } + public override bool ConsumeAmmo(Player player) { if (Main.rand.Next(0, 100) < 70) diff --git a/Items/Weapons/Ranged/MagnomalyCannon.cs b/Items/Weapons/Ranged/MagnomalyCannon.cs index 44982a53cb..6203417bf3 100644 --- a/Items/Weapons/Ranged/MagnomalyCannon.cs +++ b/Items/Weapons/Ranged/MagnomalyCannon.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 1001; + item.damage = 1301; item.ranged = true; item.width = 84; item.height = 30; @@ -64,7 +64,7 @@ namespace CalamityMod.Items.Weapons.Ranged recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ItemID.ElectrosphereLauncher); - recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ModContent.ItemType(), 4); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Ranged/Meowthrower.cs b/Items/Weapons/Ranged/Meowthrower.cs index d3772a85c6..a3a7a49b2c 100644 --- a/Items/Weapons/Ranged/Meowthrower.cs +++ b/Items/Weapons/Ranged/Meowthrower.cs @@ -35,6 +35,11 @@ namespace CalamityMod.Items.Weapons.Ranged item.useAmmo = 23; } + public override Vector2? HoldoutOffset() + { + return new Vector2(-10, 0); + } + public override bool ConsumeAmmo(Player player) { if (Main.rand.Next(0, 100) < 50) diff --git a/Items/Weapons/Ranged/MepheticSprayer.cs b/Items/Weapons/Ranged/MepheticSprayer.cs index c5ae543053..323b676624 100644 --- a/Items/Weapons/Ranged/MepheticSprayer.cs +++ b/Items/Weapons/Ranged/MepheticSprayer.cs @@ -1,4 +1,5 @@ using CalamityMod.Projectiles.Ranged; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -31,5 +32,10 @@ namespace CalamityMod.Items.Weapons.Ranged item.shootSpeed = 7.5f; item.useAmmo = 23; } + + public override Vector2? HoldoutOffset() + { + return new Vector2(-10, 0); + } } } diff --git a/Items/Weapons/Ranged/MineralMortar.cs b/Items/Weapons/Ranged/MineralMortar.cs index 534c0a9458..301b2db2d3 100644 --- a/Items/Weapons/Ranged/MineralMortar.cs +++ b/Items/Weapons/Ranged/MineralMortar.cs @@ -1,4 +1,5 @@ using CalamityMod.Projectiles.Ranged; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -33,6 +34,11 @@ namespace CalamityMod.Items.Weapons.Ranged item.useAmmo = 771; } + public override Vector2? HoldoutOffset() + { + return new Vector2(-10, 0); + } + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.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, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); diff --git a/Items/Weapons/Ranged/OverloadedBlaster.cs b/Items/Weapons/Ranged/OverloadedBlaster.cs index 230d977a10..0efa5290df 100644 --- a/Items/Weapons/Ranged/OverloadedBlaster.cs +++ b/Items/Weapons/Ranged/OverloadedBlaster.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override Vector2? HoldoutOffset() { - return new Vector2(-4, 0); + return new Vector2(-4, -5); } public override bool ConsumeAmmo(Player player) diff --git a/Items/Weapons/Ranged/PestilentDefiler.cs b/Items/Weapons/Ranged/PestilentDefiler.cs index eb2b5d68f5..5d356ae7d5 100644 --- a/Items/Weapons/Ranged/PestilentDefiler.cs +++ b/Items/Weapons/Ranged/PestilentDefiler.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.value = Item.buyPrice(0, 80, 0, 0); item.rare = 8; item.UseSound = SoundID.Item40; - item.autoReuse = false; + item.autoReuse = true; item.shootSpeed = 20f; item.shoot = ModContent.ProjectileType(); item.useAmmo = 97; diff --git a/Items/Weapons/Ranged/Scorpion.cs b/Items/Weapons/Ranged/Scorpion.cs index 3713012f1f..f1c4b2a38a 100644 --- a/Items/Weapons/Ranged/Scorpion.cs +++ b/Items/Weapons/Ranged/Scorpion.cs @@ -1,4 +1,5 @@ using CalamityMod.Projectiles.Ranged; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -34,6 +35,11 @@ namespace CalamityMod.Items.Weapons.Ranged item.useAmmo = 771; } + public override Vector2? HoldoutOffset() + { + return new Vector2(-10, 0); + } + public override bool AltFunctionUse(Player player) { return true; diff --git a/Items/Weapons/Ranged/SpectralstormCannon.cs b/Items/Weapons/Ranged/SpectralstormCannon.cs index 90c3ae7a96..ae113acfa4 100644 --- a/Items/Weapons/Ranged/SpectralstormCannon.cs +++ b/Items/Weapons/Ranged/SpectralstormCannon.cs @@ -1,6 +1,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; +using Microsoft.Xna.Framework; namespace CalamityMod.Items.Weapons.Ranged { @@ -33,6 +34,11 @@ namespace CalamityMod.Items.Weapons.Ranged item.useAmmo = 931; } + public override Vector2? HoldoutOffset() + { + return new Vector2(-10, 0); + } + public override bool ConsumeAmmo(Player player) { if (Main.rand.Next(0, 100) < 70) diff --git a/Items/Weapons/Ranged/StormSurge.cs b/Items/Weapons/Ranged/StormSurge.cs index 429fe5b46a..ffabd498be 100644 --- a/Items/Weapons/Ranged/StormSurge.cs +++ b/Items/Weapons/Ranged/StormSurge.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Ranged; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -34,6 +35,11 @@ namespace CalamityMod.Items.Weapons.Ranged item.shootSpeed = 12f; } + public override Vector2? HoldoutOffset() + { + return new Vector2(-10, 0); + } + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/Ranged/TerraFlameburster.cs b/Items/Weapons/Ranged/TerraFlameburster.cs index 9b3b2f92b5..fd3d4a88d5 100644 --- a/Items/Weapons/Ranged/TerraFlameburster.cs +++ b/Items/Weapons/Ranged/TerraFlameburster.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Ranged; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -34,6 +35,11 @@ namespace CalamityMod.Items.Weapons.Ranged item.useAmmo = 23; } + public override Vector2? HoldoutOffset() + { + return new Vector2(-10, 0); + } + public override bool ConsumeAmmo(Player player) { if (Main.rand.Next(0, 100) < 80) diff --git a/Items/Weapons/Ranged/TheEmpyrean.cs b/Items/Weapons/Ranged/TheEmpyrean.cs index 96fd90bab3..66b8fc20b0 100644 --- a/Items/Weapons/Ranged/TheEmpyrean.cs +++ b/Items/Weapons/Ranged/TheEmpyrean.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Ranged; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -34,6 +35,11 @@ namespace CalamityMod.Items.Weapons.Ranged item.useAmmo = 23; } + public override Vector2? HoldoutOffset() + { + return new Vector2(-10, 0); + } + public override bool ConsumeAmmo(Player player) { if (Main.rand.Next(0, 100) < 70) diff --git a/Items/Weapons/Ranged/TheHive.cs b/Items/Weapons/Ranged/TheHive.cs index 112313875e..ff9cd81e5f 100644 --- a/Items/Weapons/Ranged/TheHive.cs +++ b/Items/Weapons/Ranged/TheHive.cs @@ -34,6 +34,11 @@ namespace CalamityMod.Items.Weapons.Ranged item.useAmmo = 771; } + public override Vector2? HoldoutOffset() + { + 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) { switch (Main.rand.Next(4)) diff --git a/Items/Weapons/Rogue/LuminousStriker.cs b/Items/Weapons/Rogue/LuminousStriker.cs index 88f668ebad..c3ad2ce218 100644 --- a/Items/Weapons/Rogue/LuminousStriker.cs +++ b/Items/Weapons/Rogue/LuminousStriker.cs @@ -47,6 +47,7 @@ namespace CalamityMod.Items.Weapons.Rogue ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddIngredient(ItemID.FragmentStardust, 10); recipe.AddTile(TileID.LunarCraftingStation); diff --git a/Items/Weapons/Rogue/ShatteredSun.cs b/Items/Weapons/Rogue/ShatteredSun.cs index c501b0d739..d3bf873fa8 100644 --- a/Items/Weapons/Rogue/ShatteredSun.cs +++ b/Items/Weapons/Rogue/ShatteredSun.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Rogue; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -11,14 +12,15 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SetStaticDefaults() { DisplayName.SetDefault("Shattered Sun"); - Tooltip.SetDefault("Throws daggers that split twice and explode upon contact"); + Tooltip.SetDefault("Throws daggers that transform into homing meteors\n" + + "Stealth strikes fire volleys of meteors from the player on meteor hits"); } public override void SafeSetDefaults() { item.width = 56; item.height = 56; - item.damage = 60; + item.damage = 90; item.crit += 10; item.noMelee = true; item.noUseGraphic = true; @@ -45,5 +47,16 @@ namespace CalamityMod.Items.Weapons.Rogue recipe.SetResult(this); recipe.AddRecipe(); } + + 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.Calamity().StealthStrikeAvailable()) + { + int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f); + Main.projectile[stealth].Calamity().stealthStrike = true; + return false; + } + return true; + } } } diff --git a/Items/Weapons/Rogue/SludgeSplotch.cs b/Items/Weapons/Rogue/SludgeSplotch.cs index 572adae7c0..f2bb5e884d 100644 --- a/Items/Weapons/Rogue/SludgeSplotch.cs +++ b/Items/Weapons/Rogue/SludgeSplotch.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.height = 30; item.maxStack = 999; item.value = Item.buyPrice(0, 1, 0, 0); - item.rare = 0; + item.rare = 1; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 10f; item.Calamity().rogue = true; diff --git a/Items/Weapons/Rogue/Supernova.cs b/Items/Weapons/Rogue/Supernova.cs index 710d2c3b28..b75aa31dc9 100644 --- a/Items/Weapons/Rogue/Supernova.cs +++ b/Items/Weapons/Rogue/Supernova.cs @@ -21,7 +21,7 @@ Stealth strikes release energy as they fly"); public override void SafeSetDefaults() { item.width = 34; - item.damage = 699; + item.damage = 1299; item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 24; @@ -62,7 +62,7 @@ Stealth strikes release energy as they fly"); //replaces Duststorm in a Bottle when added //recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ModContent.ItemType(), 4); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Summon/Endogenesis.cs b/Items/Weapons/Summon/Endogenesis.cs index a4e6ead6ce..a1bd44d31c 100644 --- a/Items/Weapons/Summon/Endogenesis.cs +++ b/Items/Weapons/Summon/Endogenesis.cs @@ -79,7 +79,7 @@ namespace CalamityMod.Items.Weapons.Summon if (AttackMode == 1) //icicles dmgMult = 1f; if (AttackMode == 2) //melee - dmgMult = 0.9f; + dmgMult = 0.95f; if (AttackMode == 3) //flamethrower dmgMult = 0.9f; int body = Projectile.NewProjectile(vector2.X, vector2.Y, 0f, 0f, type, (int)(damage * dmgMult), knockBack, player.whoAmI, AttackMode, 0f); diff --git a/Items/Weapons/Summon/ForgottenApexWand.cs b/Items/Weapons/Summon/ForgottenApexWand.cs index 867f6e99bc..6aa4ae6555 100644 --- a/Items/Weapons/Summon/ForgottenApexWand.cs +++ b/Items/Weapons/Summon/ForgottenApexWand.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Summon item.knockBack = 4f; item.mana = 15; - item.damage = 120; + item.damage = 28; item.useTime = 30; item.useAnimation = 30; item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Summon/LanternoftheSoul.cs b/Items/Weapons/Summon/LanternoftheSoul.cs new file mode 100644 index 0000000000..099220453d --- /dev/null +++ b/Items/Weapons/Summon/LanternoftheSoul.cs @@ -0,0 +1,49 @@ +using CalamityMod.Projectiles.Summon; +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Summon +{ + public class LanternoftheSoul : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Lantern of the Soul"); + Tooltip.SetDefault("Summons a lantern turret to fight for you"); + } + + public override void SetDefaults() + { + item.damage = 250; + item.summon = true; + item.sentry = true; + item.mana = 10; + item.width = 42; + item.height = 60; + item.useTime = 36; + item.useAnimation = 36; + item.useStyle = 1; + item.noMelee = true; + item.knockBack = 5f; + item.value = Item.buyPrice(1, 40, 0, 0); + item.rare = 10; + item.autoReuse = true; + item.shoot = ModContent.ProjectileType(); + item.Calamity().postMoonLordRarity = 22; + item.UseSound = SoundID.Item44; + } + + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + position = Main.MouseWorld; + speedX = 0; + speedY = 0; + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI); + player.UpdateMaxTurrets(); + return false; + } + } +} diff --git a/Items/Weapons/Summon/LanternoftheSoul.png b/Items/Weapons/Summon/LanternoftheSoul.png new file mode 100644 index 0000000000..2f2f239a4b Binary files /dev/null and b/Items/Weapons/Summon/LanternoftheSoul.png differ diff --git a/Items/Weapons/Summon/SandSharknadoStaff.cs b/Items/Weapons/Summon/SandSharknadoStaff.cs index 259984afa9..2f90592568 100644 --- a/Items/Weapons/Summon/SandSharknadoStaff.cs +++ b/Items/Weapons/Summon/SandSharknadoStaff.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetDefaults() { - item.damage = 42; + item.damage = 35; item.mana = 10; item.width = 48; item.height = 56; diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index d684f3db25..24d899125b 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -320,9 +320,8 @@ namespace CalamityMod calamity, "Profaned Guardians", (Func)(() => CalamityWorld.downedGuardians), ModContent.ItemType(), - ModContent.ItemType(), + new List() { ModContent.ItemType(), ModContent.ItemType() }, new List() { ModContent.ItemType(), ItemID.GreaterHealingPotion}, - new List() { ModContent.ItemType() }, "Use a [i:" + ModContent.ItemType() + "] in the Hallow or Underworld Biomes", "[c/FFA500:The guardians must protect their goddess at all costs.]", "CalamityMod/NPCs/ProfanedGuardians/ProfanedGuardians_BossChecklist"); @@ -393,7 +392,7 @@ namespace CalamityMod (Func)(() => CalamityWorld.downedSentinel3), ModContent.ItemType(), new List() {ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType()}, - new List() {ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ItemID.SuperHealingPotion}, + new List() {ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ItemID.SuperHealingPotion}, "Use a [i:" + ModContent.ItemType() + "] in the Underworld", "[c/BA55D3:The Devourer's assassin has finished its easy task.]"); diff --git a/NPCs/Abyss/Cuttlefish.png b/NPCs/Abyss/Cuttlefish.png index a7aace459c..4258fd6a70 100644 Binary files a/NPCs/Abyss/Cuttlefish.png and b/NPCs/Abyss/Cuttlefish.png differ diff --git a/NPCs/Abyss/CuttlefishGlow.png b/NPCs/Abyss/CuttlefishGlow.png index bc1570b0e7..0a1341d39c 100644 Binary files a/NPCs/Abyss/CuttlefishGlow.png and b/NPCs/Abyss/CuttlefishGlow.png differ diff --git a/NPCs/Abyss/Viperfish.png b/NPCs/Abyss/Viperfish.png index fbd1a610cf..3aeb7c48bf 100644 Binary files a/NPCs/Abyss/Viperfish.png and b/NPCs/Abyss/Viperfish.png differ diff --git a/NPCs/Abyss/ViperfishGlow.png b/NPCs/Abyss/ViperfishGlow.png index 6f97e08cb9..5c4c12bd1f 100644 Binary files a/NPCs/Abyss/ViperfishGlow.png and b/NPCs/Abyss/ViperfishGlow.png differ diff --git a/NPCs/AquaticScourge/AquaticParasite.cs b/NPCs/AquaticScourge/AquaticParasite.cs index 31beac86df..81b70b4dbc 100644 --- a/NPCs/AquaticScourge/AquaticParasite.cs +++ b/NPCs/AquaticScourge/AquaticParasite.cs @@ -17,11 +17,11 @@ namespace CalamityMod.NPCs.AquaticScourge public override void SetDefaults() { npc.noGravity = true; - npc.damage = 15; + npc.damage = Main.hardMode ? 35 : 15; npc.width = 28; npc.height = 28; npc.defense = 5; - npc.LifeMaxNERD(30, bossRush: 30000); + npc.LifeMaxNERB((Main.hardMode ? 200 : 30), bossRush: 30000); npc.aiStyle = -1; aiType = -1; for (int k = 0; k < npc.buffImmune.Length; k++) diff --git a/NPCs/AquaticScourge/AquaticScourgeBody.cs b/NPCs/AquaticScourge/AquaticScourgeBody.cs index 28c9da387b..a80e00786f 100644 --- a/NPCs/AquaticScourge/AquaticScourgeBody.cs +++ b/NPCs/AquaticScourge/AquaticScourgeBody.cs @@ -27,7 +27,7 @@ namespace CalamityMod.NPCs.AquaticScourge aiType = -1; npc.knockBackResist = 0f; npc.alpha = 255; - npc.LifeMaxNERD(73000, 85000, 100000, 10000000, 11000000); + npc.LifeMaxNERB(73000, 85000, 10000000); double HPBoost = Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); for (int k = 0; k < npc.buffImmune.Length; k++) diff --git a/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs b/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs index 65c2c17cf4..b561c24d10 100644 --- a/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs +++ b/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs @@ -27,7 +27,7 @@ namespace CalamityMod.NPCs.AquaticScourge aiType = -1; npc.knockBackResist = 0f; npc.alpha = 255; - npc.LifeMaxNERD(73000, 85000, 100000, 10000000, 11000000); + npc.LifeMaxNERB(73000, 85000, 10000000); double HPBoost = Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); for (int k = 0; k < npc.buffImmune.Length; k++) diff --git a/NPCs/AquaticScourge/AquaticScourgeHead.cs b/NPCs/AquaticScourge/AquaticScourgeHead.cs index 14a890a378..20004252b8 100644 --- a/NPCs/AquaticScourge/AquaticScourgeHead.cs +++ b/NPCs/AquaticScourge/AquaticScourgeHead.cs @@ -40,7 +40,7 @@ namespace CalamityMod.NPCs.AquaticScourge npc.Calamity().RevPlusDR(0.1f); npc.aiStyle = -1; aiType = -1; - npc.LifeMaxNERD(73000, 85000, 100000, 10000000, 11000000); + npc.LifeMaxNERB(73000, 85000, 10000000); double HPBoost = Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); for (int k = 0; k < npc.buffImmune.Length; k++) @@ -65,11 +65,13 @@ namespace CalamityMod.NPCs.AquaticScourge public override void SendExtraAI(BinaryWriter writer) { writer.Write(npc.chaseable); - } + writer.Write(npc.localAI[1]); + } public override void ReceiveExtraAI(BinaryReader reader) { npc.chaseable = reader.ReadBoolean(); + npc.localAI[1] = reader.ReadSingle(); } public override void AI() diff --git a/NPCs/AquaticScourge/AquaticScourgeTail.cs b/NPCs/AquaticScourge/AquaticScourgeTail.cs index 9a9eee58f5..5fd1e2ad9f 100644 --- a/NPCs/AquaticScourge/AquaticScourgeTail.cs +++ b/NPCs/AquaticScourge/AquaticScourgeTail.cs @@ -24,7 +24,7 @@ namespace CalamityMod.NPCs.AquaticScourge aiType = -1; npc.knockBackResist = 0f; npc.alpha = 255; - npc.LifeMaxNERD(73000, 85000, 100000, 10000000, 11000000); + npc.LifeMaxNERB(73000, 85000, 10000000); double HPBoost = Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); for (int k = 0; k < npc.buffImmune.Length; k++) diff --git a/NPCs/AquaticScourge/AquaticSeekerBody.cs b/NPCs/AquaticScourge/AquaticSeekerBody.cs index 525390dea7..a185d176a8 100644 --- a/NPCs/AquaticScourge/AquaticSeekerBody.cs +++ b/NPCs/AquaticScourge/AquaticSeekerBody.cs @@ -16,17 +16,17 @@ namespace CalamityMod.NPCs.AquaticScourge public override void SetDefaults() { - npc.damage = 15; //70 - npc.width = 16; //28 - npc.height = 16; //28 + npc.damage = Main.hardMode ? 30 : 15; + npc.width = 16; + npc.height = 16; npc.defense = 10; - npc.lifeMax = 60; - if (CalamityWorld.bossRushActive) + npc.lifeMax = Main.hardMode ? 500 : 60; + if (CalamityWorld.bossRushActive) { npc.lifeMax = 60000; } - npc.aiStyle = -1; //new - aiType = -1; //new + npc.aiStyle = -1; + aiType = -1; npc.knockBackResist = 0f; npc.alpha = 255; for (int k = 0; k < npc.buffImmune.Length; k++) diff --git a/NPCs/AquaticScourge/AquaticSeekerHead.cs b/NPCs/AquaticScourge/AquaticSeekerHead.cs index a067d313e2..847aa16995 100644 --- a/NPCs/AquaticScourge/AquaticSeekerHead.cs +++ b/NPCs/AquaticScourge/AquaticSeekerHead.cs @@ -13,8 +13,8 @@ namespace CalamityMod.NPCs.AquaticScourge { public const int minLength = 3; public const int maxLength = 4; - public float speed = 3f; //10 - public float turnSpeed = 0.05f; //0.15 + public float speed = 3f; + public float turnSpeed = 0.05f; bool TailSpawned = false; public override void SetStaticDefaults() @@ -24,11 +24,11 @@ namespace CalamityMod.NPCs.AquaticScourge public override void SetDefaults() { - npc.damage = 20; - npc.width = 22; //36 - npc.height = 28; //20 + npc.damage = Main.hardMode ? 40 : 20; + npc.width = 22; + npc.height = 28; npc.defense = 5; - npc.lifeMax = 60; + npc.lifeMax = Main.hardMode ? 500 : 60; if (CalamityWorld.bossRushActive) { npc.lifeMax = 60000; @@ -109,8 +109,8 @@ namespace CalamityMod.NPCs.AquaticScourge { npc.active = false; } - float num188 = speed; - float num189 = turnSpeed; + float num188 = speed * (Main.hardMode ? 3f : 1f); + float num189 = turnSpeed * (Main.hardMode ? 3f : 1f); Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2); float num192 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2); diff --git a/NPCs/AquaticScourge/AquaticSeekerTail.cs b/NPCs/AquaticScourge/AquaticSeekerTail.cs index dd182b947a..75253344ee 100644 --- a/NPCs/AquaticScourge/AquaticSeekerTail.cs +++ b/NPCs/AquaticScourge/AquaticSeekerTail.cs @@ -16,17 +16,17 @@ namespace CalamityMod.NPCs.AquaticScourge public override void SetDefaults() { - npc.damage = 5; //70 - npc.width = 16; //28 - npc.height = 22; //28 + npc.damage = Main.hardMode ? 15 : 5; + npc.width = 16; + npc.height = 22; npc.defense = 20; - npc.lifeMax = 60; - if (CalamityWorld.bossRushActive) + npc.lifeMax = Main.hardMode ? 500 : 60; + if (CalamityWorld.bossRushActive) { npc.lifeMax = 60000; } - npc.aiStyle = -1; //new - aiType = -1; //new + npc.aiStyle = -1; + aiType = -1; npc.knockBackResist = 0f; npc.alpha = 255; for (int k = 0; k < npc.buffImmune.Length; k++) diff --git a/NPCs/AquaticScourge/AquaticUrchin.cs b/NPCs/AquaticScourge/AquaticUrchin.cs index d40c04e557..5a9f61731f 100644 --- a/NPCs/AquaticScourge/AquaticUrchin.cs +++ b/NPCs/AquaticScourge/AquaticUrchin.cs @@ -20,11 +20,11 @@ namespace CalamityMod.NPCs.AquaticScourge { npc.aiStyle = -1; aiType = -1; - npc.damage = 25; - npc.width = 40; //324 - npc.height = 40; //216 + npc.damage = Main.hardMode ? 50 : 25; + npc.width = 40; + npc.height = 40; npc.defense = 10; - npc.lifeMax = 50; + npc.lifeMax = Main.hardMode ? 300 : 50; if (CalamityWorld.bossRushActive) { npc.lifeMax = 50000; diff --git a/NPCs/AstrumAureus/AstrumAureus.cs b/NPCs/AstrumAureus/AstrumAureus.cs index 8a82882d58..c751dd0650 100644 --- a/NPCs/AstrumAureus/AstrumAureus.cs +++ b/NPCs/AstrumAureus/AstrumAureus.cs @@ -40,7 +40,7 @@ namespace CalamityMod.NPCs.AstrumAureus npc.height = 280; npc.defense = 50; npc.Calamity().RevPlusDR(0.15f); - npc.LifeMaxNERD(96000, NPC.downedMoonlord ? 440000 : 122000, NPC.downedMoonlord ? 660000 : 187000, 8400000, 9000000); // 30 seconds in boss rush + npc.LifeMaxNERB(96000, NPC.downedMoonlord ? 440000 : 122000, 8400000); // 30 seconds in boss rush npc.aiStyle = -1; aiType = -1; npc.knockBackResist = 0f; diff --git a/NPCs/AstrumAureus/AureusSpawn.cs b/NPCs/AstrumAureus/AureusSpawn.cs index 6599b57ea2..c3bbb5f50a 100644 --- a/NPCs/AstrumAureus/AureusSpawn.cs +++ b/NPCs/AstrumAureus/AureusSpawn.cs @@ -31,7 +31,7 @@ namespace CalamityMod.NPCs.AstrumAureus global.DR = 0.999999f; global.unbreakableDR = true; npc.lifeMax = Main.expertMode ? 1007 : 1012; - if (CalamityWorld.death || CalamityWorld.bossRushActive) + if (CalamityWorld.bossRushActive) { npc.lifeMax = 1002; } diff --git a/NPCs/AstrumDeus/AstrumDeusBody.cs b/NPCs/AstrumDeus/AstrumDeusBody.cs index 0fb82a3efc..bff566706c 100644 --- a/NPCs/AstrumDeus/AstrumDeusBody.cs +++ b/NPCs/AstrumDeus/AstrumDeusBody.cs @@ -32,7 +32,7 @@ namespace CalamityMod.NPCs.AstrumDeus npc.height = 44; npc.defense = 40; npc.Calamity().RevPlusDR(0.1f); - npc.LifeMaxNERD(12000, 18000, 29100, 360000, 420000); + npc.LifeMaxNERB(12000, 18000, 360000); double HPBoost = Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = 6; diff --git a/NPCs/AstrumDeus/AstrumDeusBodySpectral.cs b/NPCs/AstrumDeus/AstrumDeusBodySpectral.cs index 1c5dc65b5d..9efde4a347 100644 --- a/NPCs/AstrumDeus/AstrumDeusBodySpectral.cs +++ b/NPCs/AstrumDeus/AstrumDeusBodySpectral.cs @@ -33,15 +33,7 @@ namespace CalamityMod.NPCs.AstrumDeus npc.width = 38; npc.height = 44; npc.defense = 50; - npc.lifeMax = CalamityWorld.revenge ? 53800 : 37500; - if (CalamityWorld.death) - { - npc.lifeMax = 80700; - } - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 1500000 : 1300000; - } + npc.LifeMaxNERB(37500, 53800, 1300000); double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); npc.aiStyle = -1; diff --git a/NPCs/AstrumDeus/AstrumDeusHead.cs b/NPCs/AstrumDeus/AstrumDeusHead.cs index c907765077..46ad5f5bdf 100644 --- a/NPCs/AstrumDeus/AstrumDeusHead.cs +++ b/NPCs/AstrumDeus/AstrumDeusHead.cs @@ -31,16 +31,8 @@ namespace CalamityMod.NPCs.AstrumDeus npc.height = 56; npc.defense = 20; npc.Calamity().RevPlusDR(0.1f); - npc.lifeMax = CalamityWorld.revenge ? 18000 : 12000; - if (CalamityWorld.death) - { - npc.lifeMax = 29100; - } - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 420000 : 360000; - } - double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; + npc.LifeMaxNERB(12000, 18000, 360000); + double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); npc.aiStyle = 6; aiType = -1; diff --git a/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs b/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs index 91a5559ce9..4c9c4c3b3e 100644 --- a/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs +++ b/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs @@ -42,16 +42,8 @@ namespace CalamityMod.NPCs.AstrumDeus npc.width = 56; npc.height = 56; npc.defense = 25; - npc.lifeMax = CalamityWorld.revenge ? 53800 : 37500; - if (CalamityWorld.death) - { - npc.lifeMax = 80700; - } - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 1500000 : 1300000; - } - double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; + npc.LifeMaxNERB(37500, 53800, 1300000); + double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); npc.aiStyle = -1; aiType = -1; diff --git a/NPCs/AstrumDeus/AstrumDeusProbe.png b/NPCs/AstrumDeus/AstrumDeusProbe.png index e08f7efc9e..cb5bb69dc7 100644 Binary files a/NPCs/AstrumDeus/AstrumDeusProbe.png and b/NPCs/AstrumDeus/AstrumDeusProbe.png differ diff --git a/NPCs/AstrumDeus/AstrumDeusProbe2.png b/NPCs/AstrumDeus/AstrumDeusProbe2.png index e08f7efc9e..cb5bb69dc7 100644 Binary files a/NPCs/AstrumDeus/AstrumDeusProbe2.png and b/NPCs/AstrumDeus/AstrumDeusProbe2.png differ diff --git a/NPCs/AstrumDeus/AstrumDeusTail.cs b/NPCs/AstrumDeus/AstrumDeusTail.cs index 23d5a00c78..8c89e56531 100644 --- a/NPCs/AstrumDeus/AstrumDeusTail.cs +++ b/NPCs/AstrumDeus/AstrumDeusTail.cs @@ -29,16 +29,8 @@ namespace CalamityMod.NPCs.AstrumDeus npc.height = 68; npc.defense = 60; npc.Calamity().RevPlusDR(0.35f); - npc.lifeMax = CalamityWorld.revenge ? 18000 : 12000; - if (CalamityWorld.death) - { - npc.lifeMax = 29100; - } - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 420000 : 360000; - } - double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; + npc.LifeMaxNERB(12000, 18000, 360000); + double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); npc.aiStyle = 6; aiType = -1; diff --git a/NPCs/AstrumDeus/AstrumDeusTailSpectral.cs b/NPCs/AstrumDeus/AstrumDeusTailSpectral.cs index 1d400d1329..42a1eed897 100644 --- a/NPCs/AstrumDeus/AstrumDeusTailSpectral.cs +++ b/NPCs/AstrumDeus/AstrumDeusTailSpectral.cs @@ -29,16 +29,8 @@ namespace CalamityMod.NPCs.AstrumDeus npc.width = 52; npc.height = 68; npc.defense = 75; - npc.lifeMax = CalamityWorld.revenge ? 53800 : 37500; - if (CalamityWorld.death) - { - npc.lifeMax = 80700; - } - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 1500000 : 1300000; - } - double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; + npc.LifeMaxNERB(37500, 53800, 1300000); + double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); npc.aiStyle = -1; aiType = -1; diff --git a/NPCs/BrimstoneElemental/Brimling.cs b/NPCs/BrimstoneElemental/Brimling.cs index 240df69803..6ed6d49f11 100644 --- a/NPCs/BrimstoneElemental/Brimling.cs +++ b/NPCs/BrimstoneElemental/Brimling.cs @@ -33,10 +33,6 @@ namespace CalamityMod.NPCs.BrimstoneElemental npc.defense = 0; npc.Calamity().DR = normalDR; npc.lifeMax = 4000; - if (CalamityWorld.death) - { - npc.lifeMax = 6000; - } npc.knockBackResist = 0f; for (int k = 0; k < npc.buffImmune.Length; k++) { diff --git a/NPCs/BrimstoneElemental/BrimstoneElemental.cs b/NPCs/BrimstoneElemental/BrimstoneElemental.cs index c6809a4c87..627648a9f9 100644 --- a/NPCs/BrimstoneElemental/BrimstoneElemental.cs +++ b/NPCs/BrimstoneElemental/BrimstoneElemental.cs @@ -38,7 +38,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental npc.height = 150; npc.defense = 15; npc.value = Item.buyPrice(0, 12, 0, 0); - npc.LifeMaxNERD(26000, 35708, 54050, 6500000, 7000000); + npc.LifeMaxNERB(26000, 35708, 6500000); if (CalamityWorld.downedProvidence && !CalamityWorld.bossRushActive) { npc.damage *= 3; diff --git a/NPCs/Bumblebirb/Bumblefuck.cs b/NPCs/Bumblebirb/Bumblefuck.cs index 1575c3da7e..b514cd8a7d 100644 --- a/NPCs/Bumblebirb/Bumblefuck.cs +++ b/NPCs/Bumblebirb/Bumblefuck.cs @@ -36,7 +36,7 @@ namespace CalamityMod.NPCs.Bumblebirb npc.width = 80; npc.height = 80; npc.defense = 40; - npc.LifeMaxNERD(227500, 252500, 302500, 3000000, 3200000); + npc.LifeMaxNERB(227500, 252500, 3000000); double HPBoost = Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.knockBackResist = 0f; diff --git a/NPCs/Bumblebirb/Bumblefuck2.cs b/NPCs/Bumblebirb/Bumblefuck2.cs index e28d0b3f1b..bd41190d91 100644 --- a/NPCs/Bumblebirb/Bumblefuck2.cs +++ b/NPCs/Bumblebirb/Bumblefuck2.cs @@ -24,7 +24,7 @@ namespace CalamityMod.NPCs.Bumblebirb npc.height = 80; npc.scale = 0.66f; npc.defense = 20; - npc.LifeMaxNERD(25000, 30000, 35000, 60000, 65000); + npc.LifeMaxNERB(25000, 30000, 60000); npc.knockBackResist = 0f; for (int k = 0; k < npc.buffImmune.Length; k++) { diff --git a/NPCs/Calamitas/Calamitas.cs b/NPCs/Calamitas/Calamitas.cs index 080d31a914..a93d2963ea 100644 --- a/NPCs/Calamitas/Calamitas.cs +++ b/NPCs/Calamitas/Calamitas.cs @@ -30,7 +30,7 @@ namespace CalamityMod.NPCs.Calamitas npc.defense = 15; npc.Calamity().RevPlusDR(0.15f); npc.value = 0f; - npc.LifeMaxNERD(37500, 51750, 82750, 5200000, 5500000); + npc.LifeMaxNERB(37500, 51750, 5200000); if (CalamityWorld.downedProvidence && !CalamityWorld.bossRushActive) { npc.damage *= 3; diff --git a/NPCs/Calamitas/CalamitasRun.cs b/NPCs/Calamitas/CalamitasRun.cs index 42c62cfb2f..ab4677add6 100644 --- a/NPCs/Calamitas/CalamitasRun.cs +++ b/NPCs/Calamitas/CalamitasRun.cs @@ -30,7 +30,7 @@ namespace CalamityMod.NPCs.Calamitas npc.height = 120; npc.defense = 10; npc.Calamity().RevPlusDR(0.15f); - npc.LifeMaxNERD(9000, 13200, 15000, 800000, 900000); + npc.LifeMaxNERB(9000, 13200, 800000); if (CalamityWorld.downedProvidence && !CalamityWorld.bossRushActive) { npc.damage *= 3; diff --git a/NPCs/Calamitas/CalamitasRun2.cs b/NPCs/Calamitas/CalamitasRun2.cs index c017185ffa..dec44d379f 100644 --- a/NPCs/Calamitas/CalamitasRun2.cs +++ b/NPCs/Calamitas/CalamitasRun2.cs @@ -30,7 +30,7 @@ namespace CalamityMod.NPCs.Calamitas npc.height = 120; npc.defense = 10; npc.Calamity().RevPlusDR(0.15f); - npc.LifeMaxNERD(7500, 11025, 13200, 800000, 900000); + npc.LifeMaxNERB(7500, 11025, 800000); if (CalamityWorld.downedProvidence && !CalamityWorld.bossRushActive) { npc.damage *= 3; diff --git a/NPCs/Calamitas/CalamitasRun3.cs b/NPCs/Calamitas/CalamitasRun3.cs index df3e53b13e..6443f13ae7 100644 --- a/NPCs/Calamitas/CalamitasRun3.cs +++ b/NPCs/Calamitas/CalamitasRun3.cs @@ -41,7 +41,7 @@ namespace CalamityMod.NPCs.Calamitas npc.defense = 25; npc.value = Item.buyPrice(0, 15, 0, 0); npc.Calamity().RevPlusDR(0.15f); - npc.LifeMaxNERD(28125, 38812, 62062, 3900000, 4125000); + npc.LifeMaxNERB(28125, 38812, 3900000); if (CalamityWorld.downedProvidence && !CalamityWorld.bossRushActive) { npc.damage *= 3; diff --git a/NPCs/Calamitas/SoulSeeker.cs b/NPCs/Calamitas/SoulSeeker.cs index 2285abc41e..ab435b6921 100644 --- a/NPCs/Calamitas/SoulSeeker.cs +++ b/NPCs/Calamitas/SoulSeeker.cs @@ -34,7 +34,7 @@ namespace CalamityMod.NPCs.Calamitas npc.lifeMax = 2500; if (CalamityWorld.bossRushActive) { - npc.lifeMax = CalamityWorld.death ? 200000 : 150000; + npc.lifeMax = 150000; } for (int k = 0; k < npc.buffImmune.Length; k++) { @@ -90,7 +90,6 @@ namespace CalamityMod.NPCs.Calamitas npc.netUpdate = true; return false; } - Player player = Main.player[npc.target]; NPC parent = Main.npc[NPC.FindFirstNPC(ModContent.NPCType())]; double deg = (double)npc.ai[1]; double rad = deg * (Math.PI / 180); diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index 216a761a3c..bc51d8be7b 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -50,6 +50,68 @@ namespace CalamityMod.NPCs npc.velocity.Length(); + // Circular movement + bool doSpiral = false; + if (head && calamityGlobalNPC.newAI[0] == 1f && calamityGlobalNPC.newAI[2] == 1f && (CalamityWorld.revenge || CalamityWorld.bossRushActive)) + { + float ai3 = 600f; + calamityGlobalNPC.newAI[3] += 1f; + doSpiral = calamityGlobalNPC.newAI[1] == 0f && calamityGlobalNPC.newAI[3] >= ai3; + if (doSpiral) + { + // Barf out enemies + if (calamityGlobalNPC.newAI[3] % 60f == 0f) + { + Main.PlaySound(4, (int)npc.position.X, (int)npc.position.Y, 13); + + int npcPosX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int npcPosY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + + if (npcPosX < 0) + npcPosX = 0; + if (npcPosX > Main.maxTilesX) + npcPosX = Main.maxTilesX; + if (npcPosY < 0) + npcPosY = 0; + if (npcPosY > Main.maxTilesY) + npcPosY = Main.maxTilesY; + + Vector2 spawnPosition = new Vector2((float)(npcPosX * 16), (float)(npcPosY * 16)); + + if (!Main.tile[npcPosX, npcPosY].active() && Main.netMode != NetmodeID.MultiplayerClient) + { + if (NPC.CountNPCS(ModContent.NPCType()) < 1) + NPC.NewNPC((int)spawnPosition.X, (int)spawnPosition.Y, ModContent.NPCType()); + if (NPC.CountNPCS(ModContent.NPCType()) < 4) + NPC.NewNPC((int)spawnPosition.X, (int)spawnPosition.Y, ModContent.NPCType()); + if (NPC.CountNPCS(ModContent.NPCType()) < 8) + NPC.NewNPC((int)spawnPosition.X, (int)spawnPosition.Y, ModContent.NPCType()); + } + } + + // Velocity boost + if (calamityGlobalNPC.newAI[3] == ai3) + { + npc.velocity.Normalize(); + npc.velocity *= 24f; + } + + // Spin velocity + float velocity = (float)(Math.PI * 2D) / 120f; + npc.velocity = npc.velocity.RotatedBy((double)(-(double)velocity * npc.localAI[1])); + npc.rotation = (float)System.Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X) + 1.57f; + + // Reset and charge at target + if (calamityGlobalNPC.newAI[3] >= ai3 + 180f) + { + calamityGlobalNPC.newAI[3] = 0f; + npc.velocity = Vector2.Normalize(Main.player[npc.target].Center - npc.Center) * 12f; + } + } + else + npc.localAI[1] = (npc.Center.X - Main.player[npc.target].Center.X < 0 ? 1f : -1f); + } + if (Main.netMode != NetmodeID.MultiplayerClient) { if (head) @@ -82,49 +144,14 @@ namespace CalamityMod.NPCs calamityGlobalNPC.newAI[2] = 1f; } - // Big barf attack, spawns enemies and projectile swarms - if (calamityGlobalNPC.newAI[0] == 1f) + // Big barf attack + if (calamityGlobalNPC.newAI[0] == 1f && !doSpiral) { npc.localAI[0] += 1f; - if (npc.localAI[0] >= ((calamityGlobalNPC.enraged > 0 || (Config.BossRushXerocCurse && CalamityWorld.bossRushActive)) ? 120f : 180f)) - { - int npcPosX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int npcPosY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - - if (npcPosX < 0) - npcPosX = 0; - if (npcPosX > Main.maxTilesX) - npcPosX = Main.maxTilesX; - if (npcPosY < 0) - npcPosY = 0; - if (npcPosY > Main.maxTilesY) - npcPosY = Main.maxTilesY; - - if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) < 300f && - !Main.tile[npcPosX, npcPosY].active()) - { - npc.localAI[0] = 0f; - npc.TargetClosest(true); - npc.netUpdate = true; - - int random = Main.rand.Next(3); - Main.PlaySound(3, (int)npc.Center.X, (int)npc.Center.Y, 8); - Vector2 spawnAt = npc.Center + new Vector2(0f, (float)npc.height / 2f); - - if (random == 0 && NPC.CountNPCS(ModContent.NPCType()) < 1) - NPC.NewNPC((int)spawnAt.X, (int)spawnAt.Y, ModContent.NPCType()); - else if (random == 1 && NPC.CountNPCS(ModContent.NPCType()) < 3) - NPC.NewNPC((int)spawnAt.X, (int)spawnAt.Y, ModContent.NPCType()); - else if (NPC.CountNPCS(ModContent.NPCType()) < 8) - NPC.NewNPC((int)spawnAt.X, (int)spawnAt.Y, ModContent.NPCType()); - } - } - - npc.localAI[1] += 1f; if (Main.player[npc.target].gravDir == -1f) - npc.localAI[1] += 2f; + npc.localAI[0] += 2f; - if (npc.localAI[1] >= (CalamityWorld.bossRushActive ? 270f : 390f)) + if (npc.localAI[0] >= (CalamityWorld.bossRushActive ? 300f : (CalamityWorld.revenge ? 360f : 420f))) { int npcPosX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; int npcPosY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; @@ -140,7 +167,7 @@ namespace CalamityMod.NPCs if (!Main.tile[npcPosX, npcPosY].active() && Vector2.Distance(Main.player[npc.target].Center, npc.Center) > 300f) { - npc.localAI[1] = 0f; + npc.localAI[0] = 0f; npc.TargetClosest(true); npc.netUpdate = true; Main.PlaySound(4, (int)npc.position.X, (int)npc.position.Y, 13); @@ -320,7 +347,7 @@ namespace CalamityMod.NPCs int num43 = (int)(Main.player[npc.target].Center.X / 16f); int num44 = (int)(Main.player[npc.target].Center.Y / 16f); - if (head) + if (head && !doSpiral) { for (int num45 = num43 - 2; num45 <= num43 + 2; num45++) { @@ -467,7 +494,7 @@ namespace CalamityMod.NPCs } } } - else + else if (!doSpiral) { float num196 = System.Math.Abs(num191); float num197 = System.Math.Abs(num192); @@ -1007,7 +1034,6 @@ namespace CalamityMod.NPCs int FireEye = NPC.NewNPC((int)(npc.Center.X + (Math.Sin(I * 72) * 150)), (int)(npc.Center.Y + (Math.Cos(I * 72) * 150)), ModContent.NPCType(), npc.whoAmI, 0, 0, 0, -1); NPC Eye = Main.npc[FireEye]; Eye.ai[0] = I * 72; - Eye.ai[3] = I * 72; } } @@ -3283,21 +3309,32 @@ namespace CalamityMod.NPCs npc.netUpdate = true; } - if (lifePercentage < 50 && revenge) + if (revenge) { - float spread = 45f * 0.0174f; - double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2; - double deltaAngle = spread / 8f; - double offsetAngle; int damage = expertMode ? 50 : 60; - int i; - float passedVar = 1f; - - for (i = 0; i < 4; i++) + if (lifePercentage < 50 || CalamityWorld.death || CalamityWorld.bossRushActive || !player.ZoneDungeon) { - offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, (float)(Math.Sin(offsetAngle) * 3f), (float)(Math.Cos(offsetAngle) * 3f), ModContent.ProjectileType(), damage, 0f, Main.myPlayer, passedVar, 0f); - passedVar += 1f; + for (int i = 0; i < 12; i++) + { + float ai1 = player.ZoneDungeon ? 0f : 1f; + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, 0f, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, (float)(i * 30), ai1); + } + } + else + { + float spread = 45f * 0.0174f; + double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2; + double deltaAngle = spread / 8f; + double offsetAngle; + int i; + float passedVar = 1f; + + for (i = 0; i < 4; i++) + { + offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, (float)(Math.Sin(offsetAngle) * 3f), (float)(Math.Cos(offsetAngle) * 3f), ModContent.ProjectileType(), damage, 0f, Main.myPlayer, passedVar, 0f); + passedVar += 1f; + } } } } diff --git a/NPCs/CalamityGlobalAI.cs b/NPCs/CalamityGlobalAI.cs index 135c8bd725..dd3afe7747 100644 --- a/NPCs/CalamityGlobalAI.cs +++ b/NPCs/CalamityGlobalAI.cs @@ -866,8 +866,7 @@ namespace CalamityMod.NPCs } } Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f, 0, default, 1f); - npc.velocity.X *= 0.98f; - npc.velocity.Y *= 0.98f; + npc.velocity *= 0.98f; if ((double)npc.velocity.X > -0.1 && (double)npc.velocity.X < 0.1) npc.velocity.X = 0f; @@ -2431,8 +2430,7 @@ namespace CalamityMod.NPCs // Increase speed if (Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y) < velocity) { - npc.velocity.Y *= 1.05f; - npc.velocity.X *= 1.05f; + npc.velocity *= 1.05f; } // Charge at target @@ -3343,15 +3341,13 @@ namespace CalamityMod.NPCs npc.rotation = npc.velocity.X / 15f; float num169 = (CalamityWorld.death || CalamityWorld.bossRushActive) ? 0.05f : 0.04f; - float num170 = (CalamityWorld.death || CalamityWorld.bossRushActive) ? 5.5f : 5f; + float num170 = (CalamityWorld.death || CalamityWorld.bossRushActive) ? 3f : 3.5f; float num171 = (CalamityWorld.death || CalamityWorld.bossRushActive) ? 0.1f : 0.08f; - float num172 = (CalamityWorld.death || CalamityWorld.bossRushActive) ? 11f : 10f; + float num172 = (CalamityWorld.death || CalamityWorld.bossRushActive) ? 7.5f : 8.5f; if (CalamityWorld.bossRushActive) { num169 *= 1.5f; - num170 *= 1.2f; num171 *= 1.5f; - num172 *= 1.2f; } if (npc.position.Y > Main.player[npc.target].position.Y - 250f) @@ -3517,8 +3513,8 @@ namespace CalamityMod.NPCs if (Main.npc[(int)npc.ai[1]].ai[1] != 0f) { - float maxX = CalamityWorld.bossRushActive ? 5f : 4f; - float maxY = CalamityWorld.bossRushActive ? 3.75f : 3f; + float maxX = CalamityWorld.bossRushActive ? 6f : 7f; + float maxY = CalamityWorld.bossRushActive ? 4.5f : 5f; if (npc.position.Y > Main.npc[(int)npc.ai[1]].position.Y - 100f) { if (npc.velocity.Y > 0f) @@ -3564,22 +3560,22 @@ namespace CalamityMod.NPCs npc.netUpdate = true; } - float maxX = CalamityWorld.bossRushActive ? 5f : 4f; - float maxY = CalamityWorld.bossRushActive ? 2f : 1.5f; + float maxX = CalamityWorld.bossRushActive ? 6f : 7f; + float maxY = CalamityWorld.bossRushActive ? 2f : 2.5f; if (npc.position.Y > Main.npc[(int)npc.ai[1]].position.Y + 230f) { if (npc.velocity.Y > 0f) - npc.velocity.Y *= 0.96f; - npc.velocity.Y -= CalamityWorld.bossRushActive ? 0.06f : 0.04f; + npc.velocity.Y *= 0.92f; + npc.velocity.Y -= CalamityWorld.bossRushActive ? 0.12f : 0.08f; if (npc.velocity.Y > maxY) npc.velocity.Y = maxY; } else if (npc.position.Y < Main.npc[(int)npc.ai[1]].position.Y + 230f) { if (npc.velocity.Y < 0f) - npc.velocity.Y *= 0.96f; - npc.velocity.Y += CalamityWorld.bossRushActive ? 0.06f : 0.04f; + npc.velocity.Y *= 0.92f; + npc.velocity.Y += CalamityWorld.bossRushActive ? 0.12f : 0.08f; if (npc.velocity.Y < -maxY) npc.velocity.Y = -maxY; } @@ -3587,8 +3583,8 @@ namespace CalamityMod.NPCs if (npc.position.X + (float)(npc.width / 2) > Main.npc[(int)npc.ai[1]].position.X + (float)(Main.npc[(int)npc.ai[1]].width / 2) - 200f * npc.ai[0]) { if (npc.velocity.X > 0f) - npc.velocity.X *= 0.96f; - npc.velocity.X -= CalamityWorld.bossRushActive ? 0.11f : 0.07f; + npc.velocity.X *= 0.92f; + npc.velocity.X -= CalamityWorld.bossRushActive ? 0.22f : 0.14f; if (npc.velocity.X > maxX) npc.velocity.X = maxX; } @@ -3596,43 +3592,8 @@ namespace CalamityMod.NPCs if (npc.position.X + (float)(npc.width / 2) < Main.npc[(int)npc.ai[1]].position.X + (float)(Main.npc[(int)npc.ai[1]].width / 2) - 200f * npc.ai[0]) { if (npc.velocity.X < 0f) - npc.velocity.X *= 0.96f; - npc.velocity.X += CalamityWorld.bossRushActive ? 0.11f : 0.07f; - if (npc.velocity.X < -maxX) - npc.velocity.X = -maxX; - } - - if (npc.position.Y > Main.npc[(int)npc.ai[1]].position.Y + 230f) - { - if (npc.velocity.Y > 0f) - npc.velocity.Y *= 0.96f; - npc.velocity.Y -= CalamityWorld.bossRushActive ? 0.06f : 0.04f; - if (npc.velocity.Y > maxY) - npc.velocity.Y = maxY; - } - else if (npc.position.Y < Main.npc[(int)npc.ai[1]].position.Y + 230f) - { - if (npc.velocity.Y < 0f) - npc.velocity.Y *= 0.96f; - npc.velocity.Y += CalamityWorld.bossRushActive ? 0.06f : 0.04f; - if (npc.velocity.Y < -maxY) - npc.velocity.Y = -maxY; - } - - if (npc.position.X + (float)(npc.width / 2) > Main.npc[(int)npc.ai[1]].position.X + (float)(Main.npc[(int)npc.ai[1]].width / 2) - 200f * npc.ai[0]) - { - if (npc.velocity.X > 0f) - npc.velocity.X *= 0.96f; - npc.velocity.X -= CalamityWorld.bossRushActive ? 0.11f : 0.07f; - if (npc.velocity.X > maxX) - npc.velocity.X = maxX; - } - - if (npc.position.X + (float)(npc.width / 2) < Main.npc[(int)npc.ai[1]].position.X + (float)(Main.npc[(int)npc.ai[1]].width / 2) - 200f * npc.ai[0]) - { - if (npc.velocity.X < 0f) - npc.velocity.X *= 0.96f; - npc.velocity.X += CalamityWorld.bossRushActive ? 0.11f : 0.07f; + npc.velocity.X *= 0.92f; + npc.velocity.X += CalamityWorld.bossRushActive ? 0.22f : 0.14f; if (npc.velocity.X < -maxX) npc.velocity.X = -maxX; } @@ -3653,11 +3614,10 @@ namespace CalamityMod.NPCs float num187 = (float)Math.Sqrt((double)(num185 * num185 + num186 * num186)); npc.rotation = (float)Math.Atan2((double)num186, (double)num185) + 1.57f; npc.velocity.X *= 0.95f; - npc.velocity.Y -= 0.1f; + npc.velocity.Y -= 0.2f; - npc.velocity.Y -= 0.06f; - if (npc.velocity.Y < -15f) - npc.velocity.Y = -15f; + if (npc.velocity.Y < -13f) + npc.velocity.Y = -13f; if (npc.position.Y < Main.npc[(int)npc.ai[1]].position.Y - 200f) { @@ -3690,13 +3650,12 @@ namespace CalamityMod.NPCs float num190 = (float)Math.Sqrt((double)(num188 * num188 + num189 * num189)); npc.rotation = (float)Math.Atan2((double)num189, (double)num188) + 1.57f; npc.velocity.Y *= 0.95f; - npc.velocity.X += 0.1f * -npc.ai[0]; + npc.velocity.X += 0.2f * -npc.ai[0]; - npc.velocity.X += 0.07f * -npc.ai[0]; - if (npc.velocity.X < -14f) - npc.velocity.X = -14f; - else if (npc.velocity.X > 14f) - npc.velocity.X = 14f; + if (npc.velocity.X < -12f) + npc.velocity.X = -12f; + else if (npc.velocity.X > 12f) + npc.velocity.X = 12f; if (npc.position.X + (float)(npc.width / 2) < Main.npc[(int)npc.ai[1]].position.X + (float)(Main.npc[(int)npc.ai[1]].width / 2) - 500f || npc.position.X + (float)(npc.width / 2) > Main.npc[(int)npc.ai[1]].position.X + (float)(Main.npc[(int)npc.ai[1]].width / 2) + 500f) { @@ -4912,8 +4871,7 @@ namespace CalamityMod.NPCs npc.ai[2] += 1f; if (npc.ai[2] >= 25f) { - npc.velocity.X *= 0.96f; - npc.velocity.Y *= 0.96f; + npc.velocity *= 0.96f; if ((double)npc.velocity.X > -0.1 && (double)npc.velocity.X < 0.1) { npc.velocity.X = 0f; @@ -5002,8 +4960,7 @@ namespace CalamityMod.NPCs Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f, 0, default, 1f); - npc.velocity.X *= 0.98f; - npc.velocity.Y *= 0.98f; + npc.velocity *= 0.98f; if ((double)npc.velocity.X > -0.1 && (double)npc.velocity.X < 0.1) npc.velocity.X = 0f; @@ -5612,8 +5569,7 @@ namespace CalamityMod.NPCs if (npc.ai[2] >= timeBeforeSlowDown) { // Slow down - npc.velocity.X *= 0.9f; - npc.velocity.Y *= 0.9f; + npc.velocity *= 0.9f; if ((double)npc.velocity.X > -0.1 && (double)npc.velocity.X < 0.1) npc.velocity.X = 0f; @@ -5707,8 +5663,7 @@ namespace CalamityMod.NPCs Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f, 0, default, 1f); - npc.velocity.X *= 0.98f; - npc.velocity.Y *= 0.98f; + npc.velocity *= 0.98f; if ((double)npc.velocity.X > -0.1 && (double)npc.velocity.X < 0.1) npc.velocity.X = 0f; @@ -6349,26 +6304,26 @@ namespace CalamityMod.NPCs npc.rotation = npc.velocity.X / 15f; - float velocity2 = CalamityWorld.bossRushActive ? 4f : 2f; + float velocity2 = 3f; float acceleration = CalamityWorld.bossRushActive ? 0.2f : 0.1f; if (!cannonAlive) { - velocity2 += 1f; + velocity2 -= 0.35f; acceleration += 0.025f; } if (!laserAlive) { - velocity2 += 1f; + velocity2 -= 0.35f; acceleration += 0.025f; } if (!viceAlive) { - velocity2 += 1f; + velocity2 -= 0.35f; acceleration += 0.025f; } if (!sawAlive) { - velocity2 += 1f; + velocity2 -= 0.35f; acceleration += 0.025f; } @@ -6400,8 +6355,8 @@ namespace CalamityMod.NPCs npc.velocity.X -= CalamityWorld.bossRushActive ? 0.15f : 0.1f; - if (npc.velocity.X > 8f) - npc.velocity.X = 8f; + if (npc.velocity.X > 7f) + npc.velocity.X = 7f; } if (npc.position.X + (float)(npc.width / 2) < Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - 150f) { @@ -6410,8 +6365,8 @@ namespace CalamityMod.NPCs npc.velocity.X += CalamityWorld.bossRushActive ? 0.15f : 0.1f; - if (npc.velocity.X < -8f) - npc.velocity.X = -8f; + if (npc.velocity.X < -7f) + npc.velocity.X = -7f; } } @@ -6580,9 +6535,9 @@ namespace CalamityMod.NPCs Main.PlaySound(15, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); // Set spin direction - if (Main.player[npc.target].velocity.X > 0) + if (Main.player[npc.target].velocity.X > 0f) calamityGlobalNPC.newAI[0] = 1f; - else if (Main.player[npc.target].velocity.X < 0) + else if (Main.player[npc.target].velocity.X < 0f) calamityGlobalNPC.newAI[0] = -1f; else calamityGlobalNPC.newAI[0] = (float)Main.player[npc.target].direction; @@ -6810,8 +6765,8 @@ namespace CalamityMod.NPCs npc.velocity.Y -= CalamityWorld.bossRushActive ? 0.15f : 0.1f; - if (npc.velocity.Y > 3f) - npc.velocity.Y = 3f; + if (npc.velocity.Y > 2.5f) + npc.velocity.Y = 2.5f; } else if (npc.position.Y < Main.npc[(int)npc.ai[1]].position.Y - 100f) { @@ -6820,8 +6775,8 @@ namespace CalamityMod.NPCs npc.velocity.Y += CalamityWorld.bossRushActive ? 0.15f : 0.1f; - if (npc.velocity.Y < -3f) - npc.velocity.Y = -3f; + if (npc.velocity.Y < -2.5f) + npc.velocity.Y = -2.5f; } if (npc.position.X + (float)(npc.width / 2) > Main.npc[(int)npc.ai[1]].position.X + (float)(Main.npc[(int)npc.ai[1]].width / 2) - 180f * npc.ai[0]) @@ -6831,8 +6786,8 @@ namespace CalamityMod.NPCs npc.velocity.X -= CalamityWorld.bossRushActive ? 0.21f : 0.14f; - if (npc.velocity.X > 8f) - npc.velocity.X = 8f; + if (npc.velocity.X > 7f) + npc.velocity.X = 7f; } if (npc.position.X + (float)(npc.width / 2) < Main.npc[(int)npc.ai[1]].position.X + (float)(Main.npc[(int)npc.ai[1]].width / 2) - 180f * npc.ai[0]) { @@ -6841,8 +6796,8 @@ namespace CalamityMod.NPCs npc.velocity.X += CalamityWorld.bossRushActive ? 0.21f : 0.14f; - if (npc.velocity.X < -8f) - npc.velocity.X = -8f; + if (npc.velocity.X < -7f) + npc.velocity.X = -7f; } npc.TargetClosest(true); @@ -7086,8 +7041,8 @@ namespace CalamityMod.NPCs npc.velocity.Y -= CalamityWorld.bossRushActive ? 0.12f : 0.08f; - if (npc.velocity.Y > 3f) - npc.velocity.Y = 3f; + if (npc.velocity.Y > 2.5f) + npc.velocity.Y = 2.5f; } else if (npc.position.Y < Main.npc[(int)npc.ai[1]].position.Y - 150f) { @@ -7096,8 +7051,8 @@ namespace CalamityMod.NPCs npc.velocity.Y += CalamityWorld.bossRushActive ? 0.12f : 0.08f; - if (npc.velocity.Y < -3f) - npc.velocity.Y = -3f; + if (npc.velocity.Y < -2.5f) + npc.velocity.Y = -2.5f; } if (npc.position.X + (float)(npc.width / 2) > Main.npc[(int)npc.ai[1]].position.X + (float)(Main.npc[(int)npc.ai[1]].width / 2) + 200f) @@ -7107,8 +7062,8 @@ namespace CalamityMod.NPCs npc.velocity.X -= CalamityWorld.bossRushActive ? 0.3f : 0.2f; - if (npc.velocity.X > 8f) - npc.velocity.X = 8f; + if (npc.velocity.X > 7f) + npc.velocity.X = 7f; } if (npc.position.X + (float)(npc.width / 2) < Main.npc[(int)npc.ai[1]].position.X + (float)(Main.npc[(int)npc.ai[1]].width / 2) + 160f) { @@ -7117,8 +7072,8 @@ namespace CalamityMod.NPCs npc.velocity.X += CalamityWorld.bossRushActive ? 0.3f : 0.2f; - if (npc.velocity.X < -8f) - npc.velocity.X = -8f; + if (npc.velocity.X < -7f) + npc.velocity.X = -7f; } Vector2 vector60 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); @@ -7298,8 +7253,8 @@ namespace CalamityMod.NPCs npc.velocity.Y -= CalamityWorld.bossRushActive ? 0.15f : 0.1f; - if (npc.velocity.Y > 8f) - npc.velocity.Y = 8f; + if (npc.velocity.Y > 7f) + npc.velocity.Y = 7f; } else if (npc.position.Y < Main.npc[(int)npc.ai[1]].position.Y) { @@ -7308,8 +7263,8 @@ namespace CalamityMod.NPCs npc.velocity.Y += CalamityWorld.bossRushActive ? 0.15f : 0.1f; - if (npc.velocity.Y < -8f) - npc.velocity.Y = -8f; + if (npc.velocity.Y < -7f) + npc.velocity.Y = -7f; } if (npc.position.X + (float)(npc.width / 2) > Main.npc[(int)npc.ai[1]].position.X + (float)(Main.npc[(int)npc.ai[1]].width / 2)) @@ -7319,8 +7274,8 @@ namespace CalamityMod.NPCs npc.velocity.X -= CalamityWorld.bossRushActive ? 0.75f : 0.5f; - if (npc.velocity.X > 12f) - npc.velocity.X = 12f; + if (npc.velocity.X > 10f) + npc.velocity.X = 10f; } if (npc.position.X + (float)(npc.width / 2) < Main.npc[(int)npc.ai[1]].position.X + (float)(Main.npc[(int)npc.ai[1]].width / 2)) { @@ -7329,8 +7284,8 @@ namespace CalamityMod.NPCs npc.velocity.X += CalamityWorld.bossRushActive ? 0.75f : 0.5f; - if (npc.velocity.X < -12f) - npc.velocity.X = -12f; + if (npc.velocity.X < -10f) + npc.velocity.X = -10f; } } @@ -7367,8 +7322,8 @@ namespace CalamityMod.NPCs npc.velocity.Y -= CalamityWorld.bossRushActive ? 0.15f : 0.1f; - if (npc.velocity.Y > 3f) - npc.velocity.Y = 3f; + if (npc.velocity.Y > 2.5f) + npc.velocity.Y = 2.5f; } else if (npc.position.Y < Main.npc[(int)npc.ai[1]].position.Y + 230f) { @@ -7377,8 +7332,8 @@ namespace CalamityMod.NPCs npc.velocity.Y += CalamityWorld.bossRushActive ? 0.15f : 0.1f; - if (npc.velocity.Y < -3f) - npc.velocity.Y = -3f; + if (npc.velocity.Y < -2.5f) + npc.velocity.Y = -2.5f; } if (npc.position.X + (float)(npc.width / 2) > Main.npc[(int)npc.ai[1]].position.X + (float)(Main.npc[(int)npc.ai[1]].width / 2) + 250f) @@ -7388,8 +7343,8 @@ namespace CalamityMod.NPCs npc.velocity.X -= CalamityWorld.bossRushActive ? 0.45f : 0.3f; - if (npc.velocity.X > 9f) - npc.velocity.X = 9f; + if (npc.velocity.X > 8f) + npc.velocity.X = 8f; } if (npc.position.X + (float)(npc.width / 2) < Main.npc[(int)npc.ai[1]].position.X + (float)(Main.npc[(int)npc.ai[1]].width / 2)) { @@ -7398,8 +7353,8 @@ namespace CalamityMod.NPCs npc.velocity.X += CalamityWorld.bossRushActive ? 0.3f : 0.2f; - if (npc.velocity.X < -8f) - npc.velocity.X = -8f; + if (npc.velocity.X < -7f) + npc.velocity.X = -7f; } Vector2 vector57 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); @@ -7605,8 +7560,8 @@ namespace CalamityMod.NPCs npc.velocity.Y -= CalamityWorld.bossRushActive ? 0.15f : 0.1f; - if (npc.velocity.Y > 8f) - npc.velocity.Y = 8f; + if (npc.velocity.Y > 7f) + npc.velocity.Y = 7f; } else if (npc.position.Y < Main.npc[(int)npc.ai[1]].position.Y) { @@ -7615,8 +7570,8 @@ namespace CalamityMod.NPCs npc.velocity.Y += CalamityWorld.bossRushActive ? 0.15f : 0.1f; - if (npc.velocity.Y < -8f) - npc.velocity.Y = -8f; + if (npc.velocity.Y < -7f) + npc.velocity.Y = -7f; } if (npc.position.X + (float)(npc.width / 2) > Main.npc[(int)npc.ai[1]].position.X + (float)(Main.npc[(int)npc.ai[1]].width / 2)) @@ -7626,8 +7581,8 @@ namespace CalamityMod.NPCs npc.velocity.X -= CalamityWorld.bossRushActive ? 0.75f : 0.5f; - if (npc.velocity.X > 12f) - npc.velocity.X = 12f; + if (npc.velocity.X > 10f) + npc.velocity.X = 10f; } if (npc.position.X + (float)(npc.width / 2) < Main.npc[(int)npc.ai[1]].position.X + (float)(Main.npc[(int)npc.ai[1]].width / 2)) { @@ -7636,8 +7591,8 @@ namespace CalamityMod.NPCs npc.velocity.X += CalamityWorld.bossRushActive ? 0.75f : 0.5f; - if (npc.velocity.X < -12f) - npc.velocity.X = -12f; + if (npc.velocity.X < -10f) + npc.velocity.X = -10f; } } else @@ -7670,8 +7625,8 @@ namespace CalamityMod.NPCs npc.velocity.Y -= CalamityWorld.bossRushActive ? 0.06f : 0.04f; - if (npc.velocity.Y > 3f) - npc.velocity.Y = 3f; + if (npc.velocity.Y > 2.5f) + npc.velocity.Y = 2.5f; } else if (npc.position.Y < Main.npc[(int)npc.ai[1]].position.Y + 260f) { @@ -7680,8 +7635,8 @@ namespace CalamityMod.NPCs npc.velocity.Y += CalamityWorld.bossRushActive ? 0.06f : 0.04f; - if (npc.velocity.Y < -3f) - npc.velocity.Y = -3f; + if (npc.velocity.Y < -2.5f) + npc.velocity.Y = -2.5f; } if (npc.position.X + (float)(npc.width / 2) > Main.npc[(int)npc.ai[1]].position.X + (float)(Main.npc[(int)npc.ai[1]].width / 2)) @@ -7691,8 +7646,8 @@ namespace CalamityMod.NPCs npc.velocity.X -= CalamityWorld.bossRushActive ? 0.45f : 0.3f; - if (npc.velocity.X > 12f) - npc.velocity.X = 12f; + if (npc.velocity.X > 10f) + npc.velocity.X = 10f; } if (npc.position.X + (float)(npc.width / 2) < Main.npc[(int)npc.ai[1]].position.X + (float)(Main.npc[(int)npc.ai[1]].width / 2) - 250f) { @@ -7701,8 +7656,8 @@ namespace CalamityMod.NPCs npc.velocity.X += CalamityWorld.bossRushActive ? 0.45f : 0.3f; - if (npc.velocity.X < -12f) - npc.velocity.X = -12f; + if (npc.velocity.X < -10f) + npc.velocity.X = -10f; } Vector2 vector52 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 1b78940272..86b96ed433 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -593,7 +593,7 @@ namespace CalamityMod.NPCs if (npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType() && - npc.type != ModContent.NPCType()) + npc.type != ModContent.NPCType() && npc.type != ModContent.NPCType()) { if (Main.netMode != NetmodeID.Server) { @@ -609,41 +609,8 @@ namespace CalamityMod.NPCs { BossRushStatChanges(npc, mod); } - else - { - if (CalamityMod.enemyImmunityList.Contains(npc.type) || npc.boss) - { - npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[ModContent.BuffType()] = true; - npc.buffImmune[BuffID.Webbed] = true; - npc.buffImmune[BuffID.Slow] = true; - } - if (DestroyerIDs.Contains(npc.type) || npc.type == NPCID.DD2EterniaCrystal || npc.townNPC) - { - for (int k = 0; k < npc.buffImmune.Length; k++) - { - npc.buffImmune[k] = true; - } - - if (npc.townNPC) - { - npc.buffImmune[BuffID.Wet] = false; - npc.buffImmune[BuffID.Slimed] = false; - npc.buffImmune[BuffID.Lovestruck] = false; - npc.buffImmune[BuffID.Stinky] = false; - } - } - } - - if (npc.buffImmune[BuffID.Venom] == false) - { - npc.buffImmune[ModContent.BuffType()] = false; - } - - npc.buffImmune[ModContent.BuffType()] = false; + DebuffImmunities(npc); BossValueChanges(npc); @@ -691,6 +658,44 @@ namespace CalamityMod.NPCs } #endregion + #region Debuff Immunities + private void DebuffImmunities(NPC npc) + { + if (CalamityMod.enemyImmunityList.Contains(npc.type) || npc.boss) + { + npc.buffImmune[ModContent.BuffType()] = true; + npc.buffImmune[ModContent.BuffType()] = true; + npc.buffImmune[ModContent.BuffType()] = true; + npc.buffImmune[ModContent.BuffType()] = true; + npc.buffImmune[BuffID.Webbed] = true; + npc.buffImmune[BuffID.Slow] = true; + } + + if (DestroyerIDs.Contains(npc.type) || npc.type == NPCID.DD2EterniaCrystal || npc.townNPC) + { + for (int k = 0; k < npc.buffImmune.Length; k++) + { + npc.buffImmune[k] = true; + } + + if (npc.townNPC) + { + npc.buffImmune[BuffID.Wet] = false; + npc.buffImmune[BuffID.Slimed] = false; + npc.buffImmune[BuffID.Lovestruck] = false; + npc.buffImmune[BuffID.Stinky] = false; + } + } + + if (npc.buffImmune[BuffID.Venom] == false) + { + npc.buffImmune[ModContent.BuffType()] = false; + } + + npc.buffImmune[ModContent.BuffType()] = false; + } + #endregion + #region Boss Value Changes private void BossValueChanges(NPC npc) { @@ -713,18 +718,18 @@ namespace CalamityMod.NPCs case NPCID.TheDestroyer: case NPCID.TheDestroyerBody: case NPCID.TheDestroyerTail: - npc.lifeMax = CalamityWorld.death ? (int)(npc.lifeMax * 2.7) : (int)(npc.lifeMax * 1.8); + npc.lifeMax = (int)(npc.lifeMax * 1.8); npc.scale = 1.5f; npc.npcSlots = 10f; break; case NPCID.Probe: - npc.lifeMax = CalamityWorld.death ? (int)(npc.lifeMax * 1.9) : (int)(npc.lifeMax * 1.6); - npc.scale *= CalamityWorld.death ? 1.25f : 1.2f; + npc.lifeMax = (int)(npc.lifeMax * 1.6); + npc.scale *= 1.2f; break; case NPCID.SkeletronPrime: - npc.lifeMax = CalamityWorld.death ? (int)(npc.lifeMax * 2.1) : (int)(npc.lifeMax * 1.45); + npc.lifeMax = (int)(npc.lifeMax * 1.45); npc.npcSlots = 12f; break; @@ -732,12 +737,12 @@ namespace CalamityMod.NPCs case NPCID.PrimeCannon: case NPCID.PrimeSaw: case NPCID.PrimeLaser: - npc.lifeMax = CalamityWorld.death ? (int)(npc.lifeMax * 1.15) : (int)(npc.lifeMax * 1.05); + npc.lifeMax = (int)(npc.lifeMax * 1.05); break; case NPCID.Retinazer: case NPCID.Spazmatism: - npc.lifeMax = CalamityWorld.death ? (int)(npc.lifeMax * 3.0) : (int)(npc.lifeMax * 1.8); + npc.lifeMax = (int)(npc.lifeMax * 1.8); npc.npcSlots = 10f; break; } @@ -755,20 +760,20 @@ namespace CalamityMod.NPCs } else if (npc.type == NPCID.MoonLordCore) { - npc.lifeMax = CalamityWorld.death ? (int)(npc.lifeMax * 2.7) : (int)(npc.lifeMax * 2.2); + npc.lifeMax = (int)(npc.lifeMax * 2.2); npc.npcSlots = 36f; } else if (npc.type == NPCID.MoonLordHand || npc.type == NPCID.MoonLordHead || npc.type == NPCID.MoonLordLeechBlob) { - npc.lifeMax = CalamityWorld.death ? (int)(npc.lifeMax * 1.4) : (int)(npc.lifeMax * 1.2); + npc.lifeMax = (int)(npc.lifeMax * 1.2); } else if (npc.type >= NPCID.CultistDragonHead && npc.type <= NPCID.CultistDragonTail) { - npc.lifeMax = CalamityWorld.death ? (int)(npc.lifeMax * 10.0) : (int)(npc.lifeMax * 5.0); + npc.lifeMax = (int)(npc.lifeMax * 5.0); } else if (npc.type == NPCID.DukeFishron) { - npc.lifeMax = CalamityWorld.death ? (int)(npc.lifeMax * 3.525) : (int)(npc.lifeMax * 1.85); + npc.lifeMax = (int)(npc.lifeMax * 1.85); npc.npcSlots = 20f; } else if (npc.type == NPCID.Sharkron || npc.type == NPCID.Sharkron2) @@ -777,21 +782,21 @@ namespace CalamityMod.NPCs } else if (npc.type == NPCID.Golem) { - npc.lifeMax = CalamityWorld.death ? (int)(npc.lifeMax * 7.0) : (int)(npc.lifeMax * 4.0); + npc.lifeMax = (int)(npc.lifeMax * 4.0); npc.npcSlots = 64f; } else if (npc.type == NPCID.GolemHead) { - npc.lifeMax = CalamityWorld.death ? (int)(npc.lifeMax * 2.0) : (int)(npc.lifeMax * 1.5); + npc.lifeMax = (int)(npc.lifeMax * 1.5); } else if (npc.type == NPCID.GolemHeadFree) { - npc.lifeMax = CalamityWorld.death ? (int)(npc.lifeMax * 1.5) : (int)(npc.lifeMax * 1.25); + npc.lifeMax = (int)(npc.lifeMax * 1.25); npc.dontTakeDamage = false; } else if (npc.type == NPCID.Plantera) { - npc.lifeMax = CalamityWorld.death ? (int)(npc.lifeMax * 3.4) : (int)(npc.lifeMax * 2.3); + npc.lifeMax = (int)(npc.lifeMax * 2.3); npc.npcSlots = 32f; } else if (npc.type == NPCID.PlanterasHook) @@ -800,7 +805,7 @@ namespace CalamityMod.NPCs } else if (npc.type == NPCID.WallofFlesh || npc.type == NPCID.WallofFleshEye) { - npc.lifeMax = CalamityWorld.death ? (int)(npc.lifeMax * 2.6) : (int)(npc.lifeMax * 1.9); + npc.lifeMax = (int)(npc.lifeMax * 1.9); if (npc.type == NPCID.WallofFlesh) { @@ -809,34 +814,34 @@ namespace CalamityMod.NPCs } else if (npc.type == NPCID.TheHungryII || npc.type == NPCID.LeechHead || npc.type == NPCID.LeechBody || npc.type == NPCID.LeechTail) { - npc.lifeMax = CalamityWorld.death ? (int)(npc.lifeMax * 1.15) : (int)(npc.lifeMax * 1.05); + npc.lifeMax = (int)(npc.lifeMax * 1.05); } else if (npc.type == NPCID.SkeletronHead) { - npc.lifeMax = CalamityWorld.death ? (int)(npc.lifeMax * 1.4) : (int)(npc.lifeMax * 1.25); + npc.lifeMax = (int)(npc.lifeMax * 1.25); npc.npcSlots = 12f; } else if (npc.type == NPCID.SkeletronHand) { - npc.lifeMax = CalamityWorld.death ? (int)(npc.lifeMax * 0.9) : (int)(npc.lifeMax * 0.75); + npc.lifeMax = (int)(npc.lifeMax * 0.75); } else if (npc.type == NPCID.QueenBee) { - npc.lifeMax = CalamityWorld.death ? (int)(npc.lifeMax * 1.65) : (int)(npc.lifeMax * 1.15); + npc.lifeMax = (int)(npc.lifeMax * 1.15); npc.npcSlots = 14f; } else if (npc.type == NPCID.BrainofCthulhu) { - npc.lifeMax = CalamityWorld.death ? (int)(npc.lifeMax * 2.1) : (int)(npc.lifeMax * 1.6); + npc.lifeMax = (int)(npc.lifeMax * 1.6); npc.npcSlots = 12f; } else if (npc.type == NPCID.Creeper) { - npc.lifeMax = CalamityWorld.death ? (int)(npc.lifeMax * 1.2) : (int)(npc.lifeMax * 1.1); + npc.lifeMax = (int)(npc.lifeMax * 1.1); } else if (EaterofWorldsIDs.Contains(npc.type)) { - npc.lifeMax = CalamityWorld.death ? (int)(npc.lifeMax * 1.4) : (int)(npc.lifeMax * 1.3); + npc.lifeMax = (int)(npc.lifeMax * 1.3); if (npc.type == NPCID.EaterofWorldsHead) { @@ -845,16 +850,9 @@ namespace CalamityMod.NPCs } else if (npc.type == NPCID.EyeofCthulhu) { - npc.lifeMax = CalamityWorld.death ? (int)(npc.lifeMax * 2.3) : (int)(npc.lifeMax * 1.25); + npc.lifeMax = (int)(npc.lifeMax * 1.25); npc.npcSlots = 10f; } - else if (npc.type == NPCID.KingSlime) - { - if (CalamityWorld.death) - { - npc.lifeMax = (int)(npc.lifeMax * 1.85); - } - } else if (npc.type == NPCID.Wraith || npc.type == NPCID.Mimic || npc.type == NPCID.Reaper || npc.type == NPCID.PresentMimic || npc.type == NPCID.SandElemental) { npc.knockBackResist = 0f; @@ -864,38 +862,27 @@ namespace CalamityMod.NPCs { if (DestroyerIDs.Contains(npc.type)) { - npc.lifeMax = CalamityWorld.death ? (int)(npc.lifeMax * 1.6) : (int)(npc.lifeMax * 1.25); + npc.lifeMax = (int)(npc.lifeMax * 1.25); npc.scale = 1.5f; npc.npcSlots = 10f; } - else if (npc.type == NPCID.Probe) - { - if (CalamityWorld.death) - { - npc.lifeMax = (int)(npc.lifeMax * 1.25); - npc.scale *= 1.2f; - } - } else if (npc.type == NPCID.SkeletronPrime) { - npc.lifeMax = CalamityWorld.death ? (int)(npc.lifeMax * 1.35) : (int)(npc.lifeMax * 1.15); + npc.lifeMax = (int)(npc.lifeMax * 1.15); npc.npcSlots = 12f; } else if (npc.type == NPCID.PrimeVice || npc.type == NPCID.PrimeCannon || npc.type == NPCID.PrimeSaw || npc.type == NPCID.PrimeLaser) { - if (!CalamityWorld.death) - { - npc.lifeMax = (int)(npc.lifeMax * 0.9); - } + npc.lifeMax = (int)(npc.lifeMax * 0.9); } else if (npc.type == NPCID.Retinazer) { - npc.lifeMax = CalamityWorld.death ? (int)(npc.lifeMax * 1.4) : (int)(npc.lifeMax * 1.25); + npc.lifeMax = (int)(npc.lifeMax * 1.25); npc.npcSlots = 10f; } else if (npc.type == NPCID.Spazmatism) { - npc.lifeMax = CalamityWorld.death ? (int)(npc.lifeMax * 1.45) : (int)(npc.lifeMax * 1.3); + npc.lifeMax = (int)(npc.lifeMax * 1.3); npc.npcSlots = 10f; } } @@ -929,7 +916,7 @@ namespace CalamityMod.NPCs if (npc.type == NPCID.CultistBoss) { - npc.lifeMax = CalamityWorld.death ? (int)(npc.lifeMax * 2.5) : (int)(npc.lifeMax * (CalamityWorld.revenge ? 1.7 : 1.2)); + npc.lifeMax = (int)(npc.lifeMax * (CalamityWorld.revenge ? 1.7 : 1.2)); npc.npcSlots = 20f; } @@ -1073,42 +1060,42 @@ namespace CalamityMod.NPCs npc.type == thorium.NPCType("BoreanHopper") || npc.type == thorium.NPCType("BoreanMyte1") || npc.type == thorium.NPCType("EnemyBeholder") || npc.type == thorium.NPCType("ThousandSoulPhalactry") || npc.type == thorium.NPCType("AbyssalSpawn")) { - npc.lifeMax = CalamityWorld.death ? (int)(npc.lifeMax * 2.3) : (int)(npc.lifeMax * 1.5); + npc.lifeMax = (int)(npc.lifeMax * 1.5); } else if (npc.type == thorium.NPCType("TheGrandThunderBirdv2")) { npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; - npc.lifeMax = CalamityWorld.death ? (int)(npc.lifeMax * 2.3) : (int)(npc.lifeMax * 1.5); + npc.lifeMax = (int)(npc.lifeMax * 1.5); } else if (npc.type == thorium.NPCType("QueenJelly")) { npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; - npc.lifeMax = CalamityWorld.death ? (int)(npc.lifeMax * 1.9) : (int)(npc.lifeMax * 1.35); + npc.lifeMax = (int)(npc.lifeMax * 1.35); } else if (npc.type == thorium.NPCType("Viscount")) { npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; - npc.lifeMax = CalamityWorld.death ? (int)(npc.lifeMax * 1.65) : (int)(npc.lifeMax * 1.25); + npc.lifeMax = (int)(npc.lifeMax * 1.25); } else if (npc.type == thorium.NPCType("GraniteEnergyStorm")) { npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; - npc.lifeMax = CalamityWorld.death ? (int)(npc.lifeMax * 1.25) : (int)(npc.lifeMax * 1.1); + npc.lifeMax = (int)(npc.lifeMax * 1.1); } else if (npc.type == thorium.NPCType("TheBuriedWarrior") || npc.type == thorium.NPCType("TheBuriedWarrior1") || npc.type == thorium.NPCType("TheBuriedWarrior2")) { npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; - npc.lifeMax = CalamityWorld.death ? (int)(npc.lifeMax * 1.5) : (int)(npc.lifeMax * 1.2); + npc.lifeMax = (int)(npc.lifeMax * 1.2); } else if (npc.type == thorium.NPCType("ThePrimeScouter") || npc.type == thorium.NPCType("CryoCore") || npc.type == thorium.NPCType("BioCore") || npc.type == thorium.NPCType("PyroCore")) @@ -1116,35 +1103,35 @@ namespace CalamityMod.NPCs npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; - npc.lifeMax = CalamityWorld.death ? (int)(npc.lifeMax * 1.75) : (int)(npc.lifeMax * 1.3); + npc.lifeMax = (int)(npc.lifeMax * 1.3); } else if (npc.type == thorium.NPCType("BoreanStrider") || npc.type == thorium.NPCType("BoreanStriderPopped")) { npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; - npc.lifeMax = CalamityWorld.death ? (int)(npc.lifeMax * 2.0) : (int)(npc.lifeMax * 1.4); + npc.lifeMax = (int)(npc.lifeMax * 1.4); } else if (npc.type == thorium.NPCType("FallenDeathBeholder") || npc.type == thorium.NPCType("FallenDeathBeholder2")) { npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; - npc.lifeMax = CalamityWorld.death ? (int)(npc.lifeMax * 2.5) : (int)(npc.lifeMax * 1.6); + npc.lifeMax = (int)(npc.lifeMax * 1.6); } else if (npc.type == thorium.NPCType("Lich") || npc.type == thorium.NPCType("LichHeadless")) { npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; - npc.lifeMax = CalamityWorld.death ? (int)(npc.lifeMax * 2.5) : (int)(npc.lifeMax * 1.6); + npc.lifeMax = (int)(npc.lifeMax * 1.6); } else if (npc.type == thorium.NPCType("Abyssion") || npc.type == thorium.NPCType("AbyssionCracked") || npc.type == thorium.NPCType("AbyssionReleased")) { npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; - npc.lifeMax = CalamityWorld.death ? (int)(npc.lifeMax * 2.3) : (int)(npc.lifeMax * 1.5); + npc.lifeMax = (int)(npc.lifeMax * 1.5); } else if (npc.type == thorium.NPCType("SlagFury") || npc.type == thorium.NPCType("Omnicide") || npc.type == thorium.NPCType("RealityBreaker") || npc.type == thorium.NPCType("Aquaius") || npc.type == thorium.NPCType("Aquaius2")) @@ -1152,7 +1139,7 @@ namespace CalamityMod.NPCs npc.buffImmune[ModContent.BuffType()] = true; npc.buffImmune[ModContent.BuffType()] = true; - npc.lifeMax = CalamityWorld.death ? (int)(npc.lifeMax * 1.75) : (int)(npc.lifeMax * 1.3); + npc.lifeMax = (int)(npc.lifeMax * 1.3); } } } @@ -2834,11 +2821,13 @@ namespace CalamityMod.NPCs maxSpawns = (int)(maxSpawns * 1.5f); } - if (CalamityWorld.death) + if (CalamityWorld.death && Main.bloodMoon) { - spawnRate = (int)(spawnRate * 0.75); + spawnRate = (int)(spawnRate * 0.25); + maxSpawns = (int)(maxSpawns * 10f); } - else if (CalamityWorld.revenge) + + if (CalamityWorld.revenge) { spawnRate = (int)(spawnRate * 0.85); } @@ -4042,7 +4031,6 @@ namespace CalamityMod.NPCs #region Any Boss NPCs public static bool AnyBossNPCS() { - for (int i = 0; i < 200; i++) { if (Main.npc[i].active && Main.npc[i].type != NPCID.MartianSaucerCore && diff --git a/NPCs/Crabulon/CrabulonIdle.cs b/NPCs/Crabulon/CrabulonIdle.cs index 765de1a5d1..a0cb29247a 100644 --- a/NPCs/Crabulon/CrabulonIdle.cs +++ b/NPCs/Crabulon/CrabulonIdle.cs @@ -37,7 +37,7 @@ namespace CalamityMod.NPCs.Crabulon npc.width = 280; npc.height = 160; npc.defense = 8; - npc.LifeMaxNERD(3000, 4000, 6930, 11000000, 10000000); + npc.LifeMaxNERB(3000, 4000, 11000000); double HPBoost = Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = -1; @@ -201,7 +201,7 @@ namespace CalamityMod.NPCs.Crabulon npc.velocity.X *= 0.98f; npc.velocity.Y *= 0.98f; npc.ai[1] += 1f; - if (npc.ai[1] >= 60f) + if (npc.ai[1] >= (revenge ? 30f : 60f)) { npc.noGravity = true; npc.noTileCollide = true; @@ -314,25 +314,68 @@ namespace CalamityMod.NPCs.Crabulon npc.ai[1] += 1f; if (npc.ai[1] > 0f) { + if (revenge) + { + switch ((int)npc.ai[3]) + { + case 0: + break; + case 1: + npc.ai[1] += 1f; + break; + case 2: + npc.ai[1] += 3f; + break; + case 3: + npc.ai[1] += 6f; + break; + default: + break; + } + } if (npc.life < npc.lifeMax / 2 || CalamityWorld.bossRushActive) { - npc.ai[1] += 4f; + npc.ai[1] += (!revenge ? 4f : 1f); } - if (npc.life < npc.lifeMax / 10 || CalamityWorld.bossRushActive) + if (npc.life < npc.lifeMax / 4 || CalamityWorld.bossRushActive) { - npc.ai[1] += 8f; + npc.ai[1] += (!revenge ? 4f : 1f); } } + if (npc.ai[1] >= 300f) { npc.ai[1] = -20f; - npc.frameCounter = 0.0; } else if (npc.ai[1] == -1f) { npc.TargetClosest(true); - npc.velocity.X = (float)((CalamityWorld.bossRushActive ? 12 : 4) * npc.direction); - npc.velocity.Y = CalamityWorld.bossRushActive ? -16f : -12.1f; + + int velocityX = CalamityWorld.bossRushActive ? 12 : 4; + float velocityY = CalamityWorld.bossRushActive ? -16f : -12f; + if (revenge) + { + switch ((int)npc.ai[3]) + { + case 0: // Normal + break; + case 1: // High + velocityY -= 4f; + break; + case 2: // Low + velocityY += 4f; + break; + case 3: // Long and low + velocityX += 4; + velocityY += 4f; + break; + default: + break; + } + } + npc.velocity.X = (float)(velocityX * npc.direction); + npc.velocity.Y = velocityY; + npc.ai[0] = 4f; npc.ai[1] = 0f; } @@ -343,30 +386,50 @@ namespace CalamityMod.NPCs.Crabulon if (npc.velocity.Y == 0f) { Main.PlaySound(SoundID.Item14, npc.position); + if (Main.netMode != NetmodeID.MultiplayerClient) - { Projectile.NewProjectile((int)npc.Center.X, (int)npc.Center.Y + 20, 0f, 0f, ModContent.ProjectileType(), 20, 0f, Main.myPlayer, 0f, 0f); - } - npc.ai[2] += 1f; - if (npc.ai[2] >= 3f) + + int num354 = expertMode ? 11 : 14; + if (npc.ai[2] % 2f == 0f && (double)npc.life < (double)npc.lifeMax * 0.5 && revenge) + { + if (Main.netMode != NetmodeID.MultiplayerClient) + { + float velocityX = npc.ai[2] == 0f ? -4f : 4f; + for (int x = 0; x < 20; x++) + { + Projectile.NewProjectile(npc.Center.X + (float)shotSpacing, npc.Center.Y - 1000f, velocityX, 0f, ModContent.ProjectileType(), num354, 0f, Main.myPlayer, 0f, 0f); + shotSpacing -= 100; + } + shotSpacing = 1000; + } + } + + npc.ai[2] += 1f; + if (npc.ai[2] >= ((double)npc.life < (double)npc.lifeMax * 0.5 ? 4f : 3f)) { - if (Main.netMode != NetmodeID.MultiplayerClient && revenge) + if (Main.netMode != NetmodeID.MultiplayerClient && revenge && (double)npc.life >= (double)npc.lifeMax * 0.5) { for (int x = 0; x < 20; x++) { - int num354 = expertMode ? 11 : 14; Projectile.NewProjectile(npc.Center.X + (float)shotSpacing, npc.Center.Y - 1000f, 0f, 0f, ModContent.ProjectileType(), num354, 0f, Main.myPlayer, 0f, 0f); shotSpacing -= 100; } shotSpacing = 1000; } + npc.ai[0] = 1f; npc.ai[2] = 0f; + if (revenge) + npc.ai[3] = 0f; } else { npc.ai[0] = 3f; - } + if (revenge) + npc.ai[3] += 1f; + } + for (int num622 = (int)npc.position.X - 20; num622 < (int)npc.position.X + npc.width + 40; num622 += 20) { for (int num623 = 0; num623 < 4; num623++) @@ -386,20 +449,21 @@ namespace CalamityMod.NPCs.Crabulon } else { + float velocityX = 0.11f + + (expertMode ? 0.02f : 0f) + + (revenge ? 0.02f : 0f); + if (npc.direction < 0) - { - npc.velocity.X = npc.velocity.X - 0.2f; - } + npc.velocity.X = npc.velocity.X - velocityX; else if (npc.direction > 0) - { - npc.velocity.X = npc.velocity.X + 0.2f; - } + npc.velocity.X = npc.velocity.X + velocityX; + float num626 = CalamityWorld.bossRushActive ? 5f : 2.5f; if (revenge) { num626 += 1f; } - if (npc.Calamity().enraged > 0|| (Config.BossRushXerocCurse && CalamityWorld.bossRushActive)) + if (npc.Calamity().enraged > 0 || (Config.BossRushXerocCurse && CalamityWorld.bossRushActive)) { num626 += 3f; } @@ -426,6 +490,7 @@ namespace CalamityMod.NPCs.Crabulon } } } + if (npc.localAI[0] == 0f && npc.life > 0) { npc.localAI[0] = (float)npc.lifeMax; diff --git a/NPCs/Cryogen/Cryogen.cs b/NPCs/Cryogen/Cryogen.cs index e8a0f49754..ca881e204e 100644 --- a/NPCs/Cryogen/Cryogen.cs +++ b/NPCs/Cryogen/Cryogen.cs @@ -45,7 +45,7 @@ namespace CalamityMod.NPCs.Cryogen npc.height = 80; npc.defense = 12; npc.Calamity().RevPlusDR(0.1f); - npc.LifeMaxNERD(17900, 26300, 39900, 3000000, 3200000); + npc.LifeMaxNERB(17900, 26300, 3000000); double HPBoost = Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = -1; @@ -115,7 +115,7 @@ namespace CalamityMod.NPCs.Cryogen double multAdd = revenge ? 0.1 : 0D; npc.TargetClosest(true); - if (npc.ai[2] == 0f && npc.localAI[1] == 0f && Main.netMode != NetmodeID.MultiplayerClient && (npc.ai[0] < 4f || CalamityWorld.bossRushActive)) //spawn shield for phase 0 1 2 3, not 4 5 + if (npc.ai[2] == 0f && npc.localAI[1] == 0f && Main.netMode != NetmodeID.MultiplayerClient && (npc.ai[0] < 4f || CalamityWorld.bossRushActive)) //spawn shield for phase 0 1 2 3, not 4 5 6 { int num6 = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, ModContent.NPCType(), npc.whoAmI, 0f, 0f, 0f, 0f, 255); npc.ai[2] = (float)(num6 + 1); @@ -144,14 +144,10 @@ namespace CalamityMod.NPCs.Cryogen } } - if (npc.ai[0] == 0f || npc.ai[0] == 2f || npc.ai[0] == 4f) + if (npc.ai[0] != 5f) { npc.rotation = npc.velocity.X * 0.1f; } - else if (npc.ai[0] == 1f || npc.ai[0] == 3f) - { - npc.rotation = 0f; - } if (!Main.raining && !CalamityWorld.bossRushActive) { @@ -177,7 +173,7 @@ namespace CalamityMod.NPCs.Cryogen npc.timeLeft = 2400; } - if (Main.netMode != NetmodeID.MultiplayerClient && expertMode) + if (Main.netMode != NetmodeID.MultiplayerClient && expertMode && (npc.ai[0] < 5f || !revenge || (double)npc.life >= (double)npc.lifeMax * 0.15)) { time++; if (CalamityWorld.death || CalamityWorld.bossRushActive) @@ -186,13 +182,15 @@ namespace CalamityMod.NPCs.Cryogen if (time >= 600) { Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float spread = 45f * 0.0174f; + int totalProjectiles = 4; + float spread = MathHelper.ToRadians(90); double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2; - double deltaAngle = spread / 4f; + double deltaAngle = spread / (float)totalProjectiles; double offsetAngle; int i; int num184 = 25; - float velocity = CalamityWorld.bossRushActive ? 12f : 8f; + float velocity = CalamityWorld.bossRushActive ? 12f : 4f; + for (i = 0; i < 2; i++) { offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; @@ -237,14 +235,14 @@ namespace CalamityMod.NPCs.Cryogen float num1243 = player.Center.X - vector142.X; float num1244 = player.Center.Y - vector142.Y; float num1245 = (float)Math.Sqrt((double)(num1243 * num1243 + num1244 * num1244)); - float num1246 = isChill ? 4f : 6f; + float num1246 = isChill ? 4f : 8f; if (CalamityWorld.death) { - num1246 = isChill ? 5f : 7f; + num1246 = isChill ? 5f : 10f; } if (CalamityWorld.bossRushActive) { - num1246 = 11f; + num1246 = 14f; } num1245 = num1246 / num1245; num1243 *= num1245; @@ -290,12 +288,15 @@ namespace CalamityMod.NPCs.Cryogen } } - float velocity = isChill ? 6f : 7.5f; - float acceleration = isChill ? 0.1f : 0.12f; + float velocity = isChill ? 7.5f : 4f; + float acceleration = isChill ? 0.1f : 0.15f; if (CalamityWorld.death) - velocity = isChill ? 6.5f : 8f; - if (CalamityWorld.bossRushActive) - velocity = 20f; + velocity = isChill ? 7f : 3.5f; + if (CalamityWorld.bossRushActive) + { + velocity = 3f; + acceleration *= 1.5f; + } if (npc.position.Y > Main.player[npc.target].position.Y - 375f) { @@ -325,8 +326,8 @@ namespace CalamityMod.NPCs.Cryogen npc.velocity.X = npc.velocity.X - acceleration; - if (npc.velocity.X > 8f) - npc.velocity.X = 8f; + if (npc.velocity.X > velocity) + npc.velocity.X = velocity; } if (npc.position.X + (float)(npc.width / 2) < Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - 300f) { @@ -335,14 +336,14 @@ namespace CalamityMod.NPCs.Cryogen npc.velocity.X = npc.velocity.X + acceleration; - if (npc.velocity.X < -8f) - npc.velocity.X = -8f; + if (npc.velocity.X < -velocity) + npc.velocity.X = -velocity; } if (npc.position.Y + (float)npc.height < player.position.Y && Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height) && Main.netMode != NetmodeID.MultiplayerClient) { iceShard += 1; - if (iceShard >= 24) + if (iceShard >= 20) { iceShard = 0; int num1169 = (int)(npc.position.X + 10f + (float)Main.rand.Next(npc.width - 20)); @@ -422,7 +423,7 @@ namespace CalamityMod.NPCs.Cryogen num180 += (float)Main.rand.Next(-180, 181); num182 += (float)Main.rand.Next(-180, 181); num180 *= num183; - Projectile.NewProjectile(value9.X, value9.Y, num180, -15f, num185, num184, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(value9.X, value9.Y, num180, -8f, num185, num184, 0f, Main.myPlayer, 0f, 0f); } } } @@ -433,14 +434,14 @@ namespace CalamityMod.NPCs.Cryogen float num1243 = player.Center.X - vector142.X; float num1244 = player.Center.Y - vector142.Y; float num1245 = (float)Math.Sqrt((double)(num1243 * num1243 + num1244 * num1244)); - float num1246 = isChill ? 6f : 8f; + float num1246 = isChill ? 6f : 12f; if (CalamityWorld.death) { - num1246 = isChill ? 7f : 9f; + num1246 = isChill ? 7f : 14f; } if (CalamityWorld.bossRushActive) { - num1246 = 15f; + num1246 = 20f; } num1245 = num1246 / num1245; num1243 *= num1245; @@ -498,12 +499,15 @@ namespace CalamityMod.NPCs.Cryogen } } - float velocity = isChill ? 6.5f : 8f; - float acceleration = isChill ? 0.1f : 0.12f; + float velocity = isChill ? 7.5f : 4f; + float acceleration = isChill ? 0.1f : 0.15f; if (CalamityWorld.death) - velocity = isChill ? 7f : 8.5f; + velocity = isChill ? 7f : 3.5f; if (CalamityWorld.bossRushActive) - velocity = 20f; + { + velocity = 3f; + acceleration *= 1.5f; + } if (npc.position.Y > Main.player[npc.target].position.Y - 375f) { @@ -533,8 +537,8 @@ namespace CalamityMod.NPCs.Cryogen npc.velocity.X = npc.velocity.X - acceleration; - if (npc.velocity.X > 8f) - npc.velocity.X = 8f; + if (npc.velocity.X > velocity) + npc.velocity.X = velocity; } if (npc.position.X + (float)(npc.width / 2) < Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - 300f) { @@ -543,14 +547,14 @@ namespace CalamityMod.NPCs.Cryogen npc.velocity.X = npc.velocity.X + acceleration; - if (npc.velocity.X < -8f) - npc.velocity.X = -8f; + if (npc.velocity.X < -velocity) + npc.velocity.X = -velocity; } if (npc.position.Y + (float)npc.height < player.position.Y && Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height) && Main.netMode != NetmodeID.MultiplayerClient) { iceShard += 1; - if (iceShard >= 18) + if (iceShard >= 15) { iceShard = 0; int num1169 = (int)(npc.position.X + 10f + (float)Main.rand.Next(npc.width - 20)); @@ -736,8 +740,8 @@ namespace CalamityMod.NPCs.Cryogen npc.localAI[2] = 0f; teleportLocationX = 0; iceShard = 0; - npc.netUpdate = true; + string key = "Mods.CalamityMod.CryogenBossText"; Color messageColor = Color.Cyan; if (Main.netMode == NetmodeID.SinglePlayer) @@ -750,13 +754,48 @@ namespace CalamityMod.NPCs.Cryogen } } } - else - { + else if (npc.ai[0] == 5f) + { npc.damage = (int)((float)npc.defDamage * 1.5f); - float num1372 = isChill ? 16f : 22f; - if (CalamityWorld.bossRushActive) + + if (revenge && (double)npc.life < (double)npc.lifeMax * 0.15) + { + if (npc.ai[1] == 60f) + npc.velocity = Vector2.Normalize(player.Center - npc.Center) * (CalamityWorld.bossRushActive ? 30f : (isChill ? 18f : 24f)); + + npc.ai[1] -= 1f; + if (npc.ai[1] <= 0f) + { + npc.ai[3] += 1f; + if (npc.ai[3] > 2f) + { + npc.damage = 0; + npc.defense = npc.defDefense + 8; + npc.ai[0] = 6f; + npc.ai[1] = 0f; + npc.ai[3] = 0f; + time = 0; + } + else + npc.ai[1] = 60f; + + npc.rotation = npc.velocity.X * 0.1f; + } + else if (npc.ai[1] <= 15f) + { + npc.velocity *= 0.95f; + npc.rotation = npc.velocity.X * 0.15f; + } + else + npc.rotation += (float)npc.direction * 0.5f; + + return; + } + + float num1372 = isChill ? 16f : 24f; + if (CalamityWorld.bossRushActive) { - num1372 = 30f; + num1372 = 32f; } 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; @@ -767,7 +806,7 @@ namespace CalamityMod.NPCs.Cryogen num1374 *= num1376; iceShard--; - if ((double)npc.life < (double)npc.lifeMax * (0.05 + multAdd) || CalamityWorld.death || CalamityWorld.bossRushActive) + if ((double)npc.life < (double)npc.lifeMax * (0.1 + multAdd) || CalamityWorld.death || CalamityWorld.bossRushActive) { if (num1375 < 170f || iceShard > 0) { @@ -775,19 +814,11 @@ namespace CalamityMod.NPCs.Cryogen { iceShard = 17; } - if (npc.velocity.X < 0f) - { - npc.direction = -1; - } - else - { - npc.direction = 1; - } npc.rotation += (float)npc.direction * 0.5f; return; } } - else if ((double)npc.life < (double)npc.lifeMax * (0.1 + multAdd)) + else if ((double)npc.life < (double)npc.lifeMax * (0.125 + multAdd)) { if (num1375 < 190f || iceShard > 0) { @@ -795,14 +826,6 @@ namespace CalamityMod.NPCs.Cryogen { iceShard = 19; } - if (npc.velocity.X < 0f) - { - npc.direction = -1; - } - else - { - npc.direction = 1; - } npc.rotation += (float)npc.direction * 0.35f; return; } @@ -815,14 +838,6 @@ namespace CalamityMod.NPCs.Cryogen { iceShard = 20; } - if (npc.velocity.X < 0f) - { - npc.direction = -1; - } - else - { - npc.direction = 1; - } npc.rotation += (float)npc.direction * 0.3f; return; } @@ -842,62 +857,166 @@ namespace CalamityMod.NPCs.Cryogen } npc.rotation = npc.velocity.X * 0.15f; } + else + { + time++; + if (time >= 60) + { + Vector2 value9 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float spread = 45f * 0.0174f; + double startAngle = Math.Atan2(npc.velocity.X, npc.velocity.Y) - spread / 2; + double deltaAngle = spread / 4f; + double offsetAngle; + int i; + int num184 = 25; + float velocity2 = CalamityWorld.bossRushActive ? 16f : 6f; + for (i = 0; i < 2; i++) + { + offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; + Projectile.NewProjectile(value9.X, value9.Y, (float)(Math.Sin(offsetAngle) * velocity2), (float)(Math.Cos(offsetAngle) * velocity2), ModContent.ProjectileType(), num184, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(value9.X, value9.Y, (float)(-Math.Sin(offsetAngle) * velocity2), (float)(-Math.Cos(offsetAngle) * velocity2), ModContent.ProjectileType(), num184, 0f, Main.myPlayer, 0f, 0f); + } + time = 0; + } - if (npc.ai[3] == 0f && npc.life > 0) - { - npc.ai[3] = (float)npc.lifeMax; - } - if (npc.life > 0) - { - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int num660 = (int)((double)npc.lifeMax * 0.075); - if ((float)(npc.life + num660) < npc.ai[3]) - { - npc.ai[3] = (float)npc.life; - for (int num662 = 0; num662 < 2; num662++) - { - int x = (int)(npc.position.X + (float)Main.rand.Next(npc.width - 32)); - int y = (int)(npc.position.Y + (float)Main.rand.Next(npc.height - 32)); - int random = 1; - switch ((int)npc.ai[0]) + if (npc.position.Y + (float)npc.height < player.position.Y && Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height) && Main.netMode != NetmodeID.MultiplayerClient) + { + iceShard += 1; + if (iceShard >= 12) + { + iceShard = 0; + int num1169 = (int)(npc.position.X + 10f + (float)Main.rand.Next(npc.width - 20)); + int num1170 = (int)(npc.position.Y + (float)npc.height + 4f); + int damage = expertMode ? 23 : 26; + float projVelocity = revenge ? 6f : 5f; + if (CalamityWorld.bossRushActive) + projVelocity = 9f; + + Projectile.NewProjectile((float)num1169, (float)num1170, 0f, projVelocity, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + } + } + + npc.ai[1] += 1f; + if (npc.ai[1] >= 180f) + { + npc.ai[0] = 5f; + npc.ai[1] = 60f; + time = 0; + iceShard = 0; + npc.netUpdate = true; + } + + float velocity = isChill ? 6f : 3f; + float acceleration = isChill ? 0.2f : 0.3f; + if (CalamityWorld.death) + velocity = isChill ? 5f : 2.5f; + if (CalamityWorld.bossRushActive) + { + velocity = 2f; + acceleration *= 1.5f; + } + + if (npc.position.Y > Main.player[npc.target].position.Y - 375f) + { + if (npc.velocity.Y > 0f) + npc.velocity.Y = npc.velocity.Y * 0.98f; + + npc.velocity.Y = npc.velocity.Y - acceleration; + + if (npc.velocity.Y > velocity) + npc.velocity.Y = velocity; + } + else if (npc.position.Y < Main.player[npc.target].position.Y - 400f) + { + if (npc.velocity.Y < 0f) + npc.velocity.Y = npc.velocity.Y * 0.98f; + + npc.velocity.Y = npc.velocity.Y + acceleration; + + if (npc.velocity.Y < -velocity) + npc.velocity.Y = -velocity; + } + + if (npc.position.X + (float)(npc.width / 2) > Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) + 350f) + { + if (npc.velocity.X > 0f) + npc.velocity.X = npc.velocity.X * 0.98f; + + npc.velocity.X = npc.velocity.X - acceleration; + + if (npc.velocity.X > velocity) + npc.velocity.X = velocity; + } + if (npc.position.X + (float)(npc.width / 2) < Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - 350f) + { + if (npc.velocity.X < 0f) + npc.velocity.X = npc.velocity.X * 0.98f; + + npc.velocity.X = npc.velocity.X + acceleration; + + if (npc.velocity.X < -velocity) + npc.velocity.X = -velocity; + } + } + + if (!revenge || (double)npc.life >= (double)npc.lifeMax * 0.15) + { + if (npc.ai[3] == 0f && npc.life > 0) + { + npc.ai[3] = (float)npc.lifeMax; + } + if (npc.life > 0) + { + if (Main.netMode != NetmodeID.MultiplayerClient) + { + int num660 = (int)((double)npc.lifeMax * 0.075); + if ((float)(npc.life + num660) < npc.ai[3]) + { + npc.ai[3] = (float)npc.life; + for (int num662 = 0; num662 < 2; num662++) { - case 0: - case 1: - break; - case 2: - case 3: - random = 2; - break; - case 4: - case 5: - random = 3; - break; - default: - break; + int x = (int)(npc.position.X + (float)Main.rand.Next(npc.width - 32)); + int y = (int)(npc.position.Y + (float)Main.rand.Next(npc.height - 32)); + int random = 1; + switch ((int)npc.ai[0]) + { + case 0: + case 1: + break; + case 2: + case 3: + random = 2; + break; + case 4: + case 5: + random = 3; + break; + default: + break; + } + int randomSpawn = Main.rand.Next(random); + if (randomSpawn == 0) + { + randomSpawn = ModContent.NPCType(); + } + else if (randomSpawn == 1) + { + randomSpawn = ModContent.NPCType(); + } + else + { + randomSpawn = ModContent.NPCType(); + } + int num664 = NPC.NewNPC(x, y, randomSpawn, 0, 0f, 0f, 0f, 0f, 255); + if (Main.netMode == NetmodeID.Server && num664 < 200) + { + NetMessage.SendData(23, -1, -1, null, num664, 0f, 0f, 0f, 0, 0, 0); + } } - int randomSpawn = Main.rand.Next(random); - if (randomSpawn == 0) - { - randomSpawn = ModContent.NPCType(); - } - else if (randomSpawn == 1) - { - randomSpawn = ModContent.NPCType(); - } - else - { - randomSpawn = ModContent.NPCType(); - } - int num664 = NPC.NewNPC(x, y, randomSpawn, 0, 0f, 0f, 0f, 0f, 255); - if (Main.netMode == NetmodeID.Server && num664 < 200) - { - NetMessage.SendData(23, -1, -1, null, num664, 0f, 0f, 0f, 0, 0, 0); - } - } - } - } - } + } + } + } + } } public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) //for alt textures diff --git a/NPCs/DesertScourge/DesertScourgeBody.cs b/NPCs/DesertScourge/DesertScourgeBody.cs index 6dc5414913..0abc195b7a 100644 --- a/NPCs/DesertScourge/DesertScourgeBody.cs +++ b/NPCs/DesertScourge/DesertScourgeBody.cs @@ -24,7 +24,7 @@ namespace CalamityMod.NPCs.DesertScourge npc.height = 36; npc.defense = 6; npc.Calamity().RevPlusDR(0.05f); - npc.LifeMaxNERD(2300, 2650, 5100, 16500000, 17500000); + npc.LifeMaxNERB(2300, 2650, 16500000); double HPBoost = Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = 6; diff --git a/NPCs/DesertScourge/DesertScourgeHead.cs b/NPCs/DesertScourge/DesertScourgeHead.cs index ddd14e91eb..5195acc985 100644 --- a/NPCs/DesertScourge/DesertScourgeHead.cs +++ b/NPCs/DesertScourge/DesertScourgeHead.cs @@ -40,7 +40,7 @@ namespace CalamityMod.NPCs.DesertScourge npc.npcSlots = 12f; npc.width = 32; npc.height = 80; - npc.LifeMaxNERD(2300, 2650, 5100, 16500000, 17500000); + npc.LifeMaxNERB(2300, 2650, 16500000); double HPBoost = Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = 6; diff --git a/NPCs/DesertScourge/DesertScourgeTail.cs b/NPCs/DesertScourge/DesertScourgeTail.cs index b3b89a5b5e..3c4bced03a 100644 --- a/NPCs/DesertScourge/DesertScourgeTail.cs +++ b/NPCs/DesertScourge/DesertScourgeTail.cs @@ -22,7 +22,7 @@ namespace CalamityMod.NPCs.DesertScourge npc.height = 48; npc.defense = 9; npc.Calamity().RevPlusDR(0.1f); - npc.LifeMaxNERD(2300, 2650, 5100, 16500000, 17500000); + npc.LifeMaxNERB(2300, 2650, 16500000); double HPBoost = Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = 6; diff --git a/NPCs/DevourerofGods/DevourerofGodsBody.cs b/NPCs/DevourerofGods/DevourerofGodsBody.cs index 9445a424f8..e14a57a1e3 100644 --- a/NPCs/DevourerofGods/DevourerofGodsBody.cs +++ b/NPCs/DevourerofGods/DevourerofGodsBody.cs @@ -29,11 +29,7 @@ namespace CalamityMod.NPCs.DevourerofGods CalamityGlobalNPC global = npc.Calamity(); global.DR = CalamityWorld.death ? 0.95f : 0.925f; global.unbreakableDR = true; - npc.lifeMax = CalamityWorld.revenge ? 750000 : 675000; - if (CalamityWorld.death) - { - npc.lifeMax = 1300000; - } + npc.LifeMaxNERB(675000, 750000); double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); npc.aiStyle = -1; diff --git a/NPCs/DevourerofGods/DevourerofGodsBodyS.cs b/NPCs/DevourerofGods/DevourerofGodsBodyS.cs index 1727a40563..fba06b5c70 100644 --- a/NPCs/DevourerofGods/DevourerofGodsBodyS.cs +++ b/NPCs/DevourerofGods/DevourerofGodsBodyS.cs @@ -29,7 +29,7 @@ namespace CalamityMod.NPCs.DevourerofGods CalamityGlobalNPC global = npc.Calamity(); global.DR = CalamityWorld.death ? 0.97f : 0.955f; global.unbreakableDR = true; - npc.LifeMaxNERD(1150000, 1350000, 2100000, 9200000, 10000000); + npc.LifeMaxNERB(1150000, 1350000, 9200000); double HPBoost = Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = -1; @@ -91,7 +91,7 @@ namespace CalamityMod.NPCs.DevourerofGods } else { - npc.dontTakeDamage = false; + npc.dontTakeDamage = Main.npc[(int)npc.ai[2]].dontTakeDamage; } if (npc.ai[3] > 0f) { diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index 4f36bf786b..468e111283 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -35,12 +35,8 @@ namespace CalamityMod.NPCs.DevourerofGods npc.width = 104; npc.height = 104; npc.defense = 50; - npc.lifeMax = CalamityWorld.revenge ? 750000 : 675000; - if (CalamityWorld.death) - { - npc.lifeMax = 1300000; - } - double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; + npc.LifeMaxNERB(675000, 750000); + double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); npc.takenDamageMultiplier = 1.25f; npc.aiStyle = -1; @@ -782,7 +778,7 @@ namespace CalamityMod.NPCs.DevourerofGods } // TODO: don't talk if the player has iframes - if (player.immuneTime > 0) + if (player.immuneTime > 0 || player.immune) return; int num = Main.rand.Next(5); diff --git a/NPCs/DevourerofGods/DevourerofGodsHeadS.cs b/NPCs/DevourerofGods/DevourerofGodsHeadS.cs index 20f78ae5b5..6f740652dc 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHeadS.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHeadS.cs @@ -40,6 +40,7 @@ namespace CalamityMod.NPCs.DevourerofGods private int idleCounter = (CalamityWorld.death || CalamityWorld.bossRushActive) ? 540 : 360; public int laserWallPhase = 0; private int laserWallCounter = 0; + private int postTeleportTimer = 0; public override void SetStaticDefaults() { @@ -53,7 +54,7 @@ namespace CalamityMod.NPCs.DevourerofGods npc.width = 186; npc.height = 186; npc.defense = 50; - npc.LifeMaxNERD(1150000, 1350000, 2100000, 9200000, 10000000); + npc.LifeMaxNERB(1150000, 1350000, 9200000); double HPBoost = Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.takenDamageMultiplier = 1.25f; @@ -82,6 +83,7 @@ namespace CalamityMod.NPCs.DevourerofGods public override void SendExtraAI(BinaryWriter writer) { + writer.Write(npc.dontTakeDamage); writer.Write(halfLife); writer.Write(laserShoot); writer.Write(phaseSwitch); @@ -92,10 +94,12 @@ namespace CalamityMod.NPCs.DevourerofGods writer.Write(idleCounter); writer.Write(laserWallPhase); writer.Write(laserWallCounter); + writer.Write(postTeleportTimer); } public override void ReceiveExtraAI(BinaryReader reader) { + npc.dontTakeDamage = reader.ReadBoolean(); halfLife = reader.ReadBoolean(); laserShoot = reader.ReadInt32(); phaseSwitch = reader.ReadInt32(); @@ -106,6 +110,7 @@ namespace CalamityMod.NPCs.DevourerofGods idleCounter = reader.ReadInt32(); laserWallPhase = reader.ReadInt32(); laserWallCounter = reader.ReadInt32(); + postTeleportTimer = reader.ReadInt32(); } public override void BossHeadRotation(ref float rotation) @@ -127,14 +132,36 @@ namespace CalamityMod.NPCs.DevourerofGods Vector2 vector = npc.Center; bool flies = npc.ai[2] == 0f; bool expertMode = Main.expertMode || CalamityWorld.bossRushActive; + bool revenge = CalamityWorld.revenge || CalamityWorld.bossRushActive; + bool death = CalamityWorld.death || CalamityWorld.bossRushActive; bool speedBoost = lifeRatio < 0.6 || (CalamityWorld.bossRushActive && lifeRatio < 0.9); bool speedBoost2 = lifeRatio < 0.2; bool breathFireMore = lifeRatio < 0.15; - // Laser walls - if (speedBoost && !speedBoost2) + // Light + Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0.2f, 0.05f, 0.2f); + + // Worm shit again + if (npc.ai[3] > 0f) + npc.realLife = (int)npc.ai[3]; + + // Target + if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead) + npc.TargetClosest(true); + + // Velocity + npc.velocity.Length(); + + float distanceFromTarget = Vector2.Distance(Main.player[npc.target].Center, vector); + bool tooFarAway = distanceFromTarget > 5600f; + + // Immunity after teleport + npc.dontTakeDamage = postTeleportTimer > 0; + + // Laser walls + if (speedBoost && !speedBoost2 && postTeleportTimer <= 0) { - if (laserWallPhase == 0) //start laser wall phase + if (laserWallPhase == 0) // Start laser wall phase { if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -146,7 +173,7 @@ namespace CalamityMod.NPCs.DevourerofGods } } } - else if (laserWallPhase == 1) //turn invisible and fire laser walls + else if (laserWallPhase == 1) // Turn invisible and fire laser walls { npc.alpha += 5; if (npc.alpha == 255) @@ -159,32 +186,48 @@ namespace CalamityMod.NPCs.DevourerofGods if (idleCounter <= 0) { laserWallPhase = 2; - idleCounter = (CalamityWorld.death || CalamityWorld.bossRushActive) ? 540 : 360; + idleCounter = death ? 540 : 360; } } } - else if (laserWallPhase == 2) //turn visible + else if (laserWallPhase == 2) // Turn visible { - npc.alpha -= 1; - if (npc.alpha <= 0) - { - npc.alpha = 0; - laserWallPhase = 0; - } + if (distanceFromTarget > 500f && revenge) + Teleport(); + else + { + npc.alpha -= 1; + if (npc.alpha <= 0) + { + npc.alpha = 0; + laserWallPhase = 0; + } + } } } else { - npc.alpha -= 6; - if (npc.alpha < 0) - npc.alpha = 0; + if (postTeleportTimer > 0) + { + postTeleportTimer -= 4; + if (postTeleportTimer < 0) + postTeleportTimer = 0; + + npc.alpha = postTeleportTimer; + } + else + { + npc.alpha -= 6; + if (npc.alpha < 0) + npc.alpha = 0; + } if (laserWallPhase > 0) laserWallPhase = 0; } - // Anger message - if (speedBoost2) + // Anger message + if (speedBoost2) { if (!halfLife) { @@ -199,20 +242,6 @@ namespace CalamityMod.NPCs.DevourerofGods } } - // Light - Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0.2f, 0.05f, 0.2f); - - // Worm shit again - if (npc.ai[3] > 0f) - npc.realLife = (int)npc.ai[3]; - - // Target - if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead) - npc.TargetClosest(true); - - // Velocity - npc.velocity.Length(); - // Spawn segments and fire projectiles if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -241,7 +270,7 @@ namespace CalamityMod.NPCs.DevourerofGods int projectileDamage = expertMode ? 69 : 80; // Fireballs - if (npc.alpha <= 0 && Vector2.Distance(Main.player[npc.target].Center, vector) > 500f && expertMode) + if (npc.alpha <= 0 && distanceFromTarget > 500f && expertMode) { calamityGlobalNPC.newAI[0] += 1f; if (calamityGlobalNPC.newAI[0] >= 150f && calamityGlobalNPC.newAI[0] % (breathFireMore ? 60f : 120f) == 0f) @@ -267,7 +296,7 @@ namespace CalamityMod.NPCs.DevourerofGods } } } - else if (Vector2.Distance(Main.player[npc.target].Center, vector) < 250f) + else if (distanceFromTarget < 250f) calamityGlobalNPC.newAI[0] = 0f; // Laser walls @@ -292,7 +321,7 @@ namespace CalamityMod.NPCs.DevourerofGods shotSpacing[0] -= spacingVar; } - if (Main.rand.NextBool(2) && (CalamityWorld.revenge || CalamityWorld.bossRushActive)) + if (Main.rand.NextBool(2) && revenge) { for (int x = 0; x < 10; x++) { @@ -313,7 +342,7 @@ namespace CalamityMod.NPCs.DevourerofGods shotSpacing[1] = 1050; // Upper wall - if (lifeRatio < 0.4f && (CalamityWorld.revenge || CalamityWorld.bossRushActive)) + if (lifeRatio < 0.4f && revenge) { if (shotSpacing[2] < 2100) shotSpacing[2] = 2100; @@ -361,7 +390,7 @@ namespace CalamityMod.NPCs.DevourerofGods } } } - fallSpeed += ((CalamityWorld.death || CalamityWorld.bossRushActive) ? 5f : 3.5f) * (1f - lifeRatio); + fallSpeed += (death ? 5f : 3.5f) * (1f - lifeRatio); // Movement int num180 = (int)(npc.position.X / 16f) - 1; @@ -397,20 +426,25 @@ namespace CalamityMod.NPCs.DevourerofGods phaseSwitch += 1; - int phaseLimit = ((CalamityWorld.death || CalamityWorld.bossRushActive) ? 600 : 900) / (1 + (int)(5f * (1f - lifeRatio))); + int phaseLimit = (death ? 600 : 900) / (1 + (int)(5f * (1f - lifeRatio))); npc.localAI[1] = 0f; - float speed = ((CalamityWorld.death || CalamityWorld.bossRushActive) ? 18f : 15f) + (3f * (1f - lifeRatio)); - float turnSpeed = ((CalamityWorld.death || CalamityWorld.bossRushActive) ? 0.33f : 0.3f) + (0.06f * (1f - lifeRatio)); - float homingSpeed = ((CalamityWorld.death || CalamityWorld.bossRushActive) ? 28f : 24f) + (12f * (1f - lifeRatio)); - float homingTurnSpeed = ((CalamityWorld.death || CalamityWorld.bossRushActive) ? 0.36f : 0.33f) + (0.15f * (1f - lifeRatio)); + float speed = (death ? 18f : 15f) + (3f * (1f - lifeRatio)); + float turnSpeed = (death ? 0.33f : 0.3f) + (0.06f * (1f - lifeRatio)); + float homingSpeed = (death ? 28f : 24f) + (12f * (1f - lifeRatio)); + float homingTurnSpeed = (death ? 0.36f : 0.33f) + (0.15f * (1f - lifeRatio)); - // Go to ground phase sooner - if (Vector2.Distance(Main.player[npc.target].Center, vector) > 5600f) - phaseSwitch += 10; + // Go to ground phase sooner + if (tooFarAway) + { + if (revenge && laserWallPhase == 0) + Teleport(); + else + phaseSwitch += 10; + } - float num188 = speed; + float num188 = speed; float num189 = turnSpeed; Vector2 vector18 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); float num191 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2); @@ -420,7 +454,7 @@ namespace CalamityMod.NPCs.DevourerofGods int num44 = (int)(Main.player[npc.target].Center.Y / 16f); // Charge at target for 1.5 seconds - bool flyAtTarget = (!speedBoost || speedBoost2) && phaseSwitch > phaseLimit - 90 && (CalamityWorld.revenge || CalamityWorld.bossRushActive); + bool flyAtTarget = (!speedBoost || speedBoost2) && phaseSwitch > phaseLimit - 90 && revenge; for (int num45 = num43 - 2; num45 <= num43 + 2; num45++) { @@ -618,14 +652,19 @@ namespace CalamityMod.NPCs.DevourerofGods phaseSwitch += 1; - float turnSpeed = 0.18f + (((CalamityWorld.death || CalamityWorld.bossRushActive) ? 0.14f : 0.12f) * (1f - lifeRatio)); - bool increaseSpeed = Vector2.Distance(Main.player[npc.target].Center, vector) > 3200f; + float turnSpeed = 0.18f + ((death ? 0.14f : 0.12f) * (1f - lifeRatio)); + bool increaseSpeed = distanceFromTarget > 3200f; - // Enrage - if (Vector2.Distance(Main.player[npc.target].Center, vector) > 5600f) - turnSpeed *= 6f; - else if (increaseSpeed) - turnSpeed *= 3f; + // Enrage + if (tooFarAway) + { + if (revenge && laserWallPhase == 0) + Teleport(); + else + turnSpeed *= 6f; + } + else if (increaseSpeed) + turnSpeed *= 3f; if (!flies) { @@ -725,8 +764,8 @@ namespace CalamityMod.NPCs.DevourerofGods } else { - double maximumSpeed1 = (increaseSpeed ? 1.2 : 0.4) + (double)(((CalamityWorld.death || CalamityWorld.bossRushActive) ? 0.14f : 0.12f) * (1f - lifeRatio)); - double maximumSpeed2 = (increaseSpeed ? 3.0 : 1.0) + (double)(((CalamityWorld.death || CalamityWorld.bossRushActive) ? 0.3f : 0.25f) * (1f - lifeRatio)); + double maximumSpeed1 = (increaseSpeed ? 1.2 : 0.4) + (double)((death ? 0.14f : 0.12f) * (1f - lifeRatio)); + double maximumSpeed2 = (increaseSpeed ? 3.0 : 1.0) + (double)((death ? 0.3f : 0.25f) * (1f - lifeRatio)); num193 = (float)Math.Sqrt((double)(num191 * num191 + num192 * num192)); float num25 = Math.Abs(num191); @@ -828,7 +867,7 @@ namespace CalamityMod.NPCs.DevourerofGods if (((npc.velocity.X > 0f && npc.oldVelocity.X < 0f) || (npc.velocity.X < 0f && npc.oldVelocity.X > 0f) || (npc.velocity.Y > 0f && npc.oldVelocity.Y < 0f) || (npc.velocity.Y < 0f && npc.oldVelocity.Y > 0f)) && !npc.justHit) npc.netUpdate = true; - if (phaseSwitch > ((CalamityWorld.death || CalamityWorld.bossRushActive) ? 600 : 900)) + if (phaseSwitch > (death ? 600 : 900)) { npc.ai[2] = 0f; phaseSwitch = 0; @@ -837,6 +876,95 @@ namespace CalamityMod.NPCs.DevourerofGods } } + private void Teleport() + { + postTeleportTimer = 255; + npc.alpha = postTeleportTimer; + + int playerWidth = Main.player[npc.target].width / 2; + int playerHeight = Main.player[npc.target].height / 2; + + float playerVelocityX = Main.player[npc.target].velocity.X; + float playerVelocityY = Main.player[npc.target].velocity.Y; + + int x = (int)Main.player[npc.target].position.X + playerWidth - 25; + int y = (int)Main.player[npc.target].position.Y + playerHeight - 25; + + float velocityThreshold = 0.05f; + int vectorAdjustment = 500; + if (playerVelocityX >= velocityThreshold) + { + x += vectorAdjustment; + yAdjustment(); + } + else if (playerVelocityX <= -velocityThreshold) + { + x -= vectorAdjustment; + yAdjustment(); + } + + void yAdjustment() + { + if (playerVelocityY >= velocityThreshold) + y += vectorAdjustment; + else if (playerVelocityY <= -velocityThreshold) + y -= vectorAdjustment; + } + + int x2 = x + 50; + int y2 = y + 50; + + float locationX = (float)Main.rand.Next(x, x2); + float locationY = (float)Main.rand.Next(y, y2); + Vector2 teleportLocation = new Vector2(locationX, locationY); + + npc.position = teleportLocation; + npc.netUpdate = true; + + for (int i = 0; i < 200; i++) + { + if (Main.npc[i].active && (Main.npc[i].type == ModContent.NPCType() || Main.npc[i].type == ModContent.NPCType())) + { + Main.npc[i].position = teleportLocation; + Main.npc[i].netUpdate = true; + } + } + + Vector2 npcCenter = new Vector2(npc.position.X + (float)(npc.width / 2), npc.position.Y + (float)(npc.height / 2)); + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LargeMechGaussRifle"), (int)npcCenter.X, (int)npcCenter.Y); + + int dustAmt = 50; + int random = 5; + + for (int j = 0; j < 10; j++) + { + random += j * 2; + int dustAmtSpawned = 0; + int scale = random * 13; + float dustPositionX = npcCenter.X - (float)(scale / 2); + float dustPositionY = npcCenter.Y - (float)(scale / 2); + while (dustAmtSpawned < dustAmt) + { + float dustVelocityX = (float)Main.rand.Next(-random, random); + float dustVelocityY = (float)Main.rand.Next(-random, random); + float dustVelocityScalar = (float)random * 2f; + float dustVelocity = (float)Math.Sqrt((double)(dustVelocityX * dustVelocityX + dustVelocityY * dustVelocityY)); + dustVelocity = dustVelocityScalar / dustVelocity; + dustVelocityX *= dustVelocity; + dustVelocityY *= dustVelocity; + int dust = Dust.NewDust(new Vector2(dustPositionX, dustPositionY), scale, scale, 173, 0f, 0f, 100, default, 5f); + Main.dust[dust].noGravity = true; + Main.dust[dust].position.X = teleportLocation.X; + Main.dust[dust].position.Y = teleportLocation.Y; + Main.dust[dust].position.X += (float)Main.rand.Next(-10, 11); + Main.dust[dust].position.Y += (float)Main.rand.Next(-10, 11); + Main.dust[dust].velocity.X = dustVelocityX; + Main.dust[dust].velocity.Y = dustVelocityY; + dustAmtSpawned++; + } + } + } + public override void BossLoot(ref string name, ref int potionType) { potionType = ModContent.ItemType(); @@ -928,7 +1056,7 @@ namespace CalamityMod.NPCs.DevourerofGods if (dist4 < minDist) minDist = dist4; - return minDist <= 80f && npc.alpha == 0; + return minDist <= 80f && npc.alpha <= 0; } // Projectiles can only hit within certain distance @@ -1048,7 +1176,7 @@ namespace CalamityMod.NPCs.DevourerofGods } // TODO: don't talk if the player has iframes - if (player.immune) + if (player.immune || player.immuneTime > 0) return; int num = Main.rand.Next(5); diff --git a/NPCs/DevourerofGods/DevourerofGodsTail.cs b/NPCs/DevourerofGods/DevourerofGodsTail.cs index 5bc4e4f723..72dfc064c7 100644 --- a/NPCs/DevourerofGods/DevourerofGodsTail.cs +++ b/NPCs/DevourerofGods/DevourerofGodsTail.cs @@ -24,12 +24,8 @@ namespace CalamityMod.NPCs.DevourerofGods npc.width = 66; npc.height = 66; npc.defense = 50; - npc.lifeMax = CalamityWorld.revenge ? 750000 : 675000; - if (CalamityWorld.death) - { - npc.lifeMax = 1300000; - } - double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; + npc.LifeMaxNERB(675000, 750000); + double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); npc.aiStyle = -1; aiType = -1; @@ -224,7 +220,7 @@ namespace CalamityMod.NPCs.DevourerofGods player.AddBuff(BuffID.Darkness, 180, true); // TODO: don't talk if the player has iframes - if (player.immuneTime > 0) + if (player.immuneTime > 0 || player.immune) return; int num = Main.rand.Next(2); diff --git a/NPCs/DevourerofGods/DevourerofGodsTailS.cs b/NPCs/DevourerofGods/DevourerofGodsTailS.cs index a2fdd88c89..c60a9e7288 100644 --- a/NPCs/DevourerofGods/DevourerofGodsTailS.cs +++ b/NPCs/DevourerofGods/DevourerofGodsTailS.cs @@ -27,7 +27,7 @@ namespace CalamityMod.NPCs.DevourerofGods npc.width = 80; npc.height = 140; npc.defense = 50; - npc.LifeMaxNERD(1150000, 1350000, 2100000, 9200000, 10000000); + npc.LifeMaxNERB(1150000, 1350000, 9200000); double HPBoost = Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.takenDamageMultiplier = 1.25f; @@ -87,7 +87,7 @@ namespace CalamityMod.NPCs.DevourerofGods } else { - npc.dontTakeDamage = false; + npc.dontTakeDamage = Main.npc[(int)npc.ai[2]].dontTakeDamage; } if (npc.ai[3] > 0f) { @@ -291,7 +291,7 @@ namespace CalamityMod.NPCs.DevourerofGods player.AddBuff(BuffID.Darkness, 180, true); // TODO: don't talk if the player has iframes - if (player.immune) + if (player.immune || player.immuneTime > 0) return; int num = Main.rand.Next(2); diff --git a/NPCs/GreatSandShark/GreatSandShark.cs b/NPCs/GreatSandShark/GreatSandShark.cs index 69cb4c2a10..e1eb21156e 100644 --- a/NPCs/GreatSandShark/GreatSandShark.cs +++ b/NPCs/GreatSandShark/GreatSandShark.cs @@ -34,11 +34,7 @@ namespace CalamityMod.NPCs.GreatSandShark npc.height = 120; npc.defense = 60; npc.Calamity().RevPlusDR(0.25f); - npc.lifeMax = CalamityWorld.revenge ? 11000 : 8000; - if (CalamityWorld.death) - { - npc.lifeMax = 16000; - } + npc.LifeMaxNERB(8000, 11000); npc.aiStyle = -1; aiType = -1; npc.knockBackResist = 0f; diff --git a/NPCs/HiveMind/HiveMind.cs b/NPCs/HiveMind/HiveMind.cs index 9d36be3470..b5fb63ae44 100644 --- a/NPCs/HiveMind/HiveMind.cs +++ b/NPCs/HiveMind/HiveMind.cs @@ -25,7 +25,7 @@ namespace CalamityMod.NPCs.HiveMind npc.width = 150; npc.height = 120; npc.defense = 10; - npc.LifeMaxNERD(1200, 1800, 3300, 350000, 400000); + npc.LifeMaxNERB(1200, 1800, 350000); double HPBoost = Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = -1; diff --git a/NPCs/HiveMind/HiveMindP2.cs b/NPCs/HiveMind/HiveMindP2.cs index 2bb2693a3b..274b576af3 100644 --- a/NPCs/HiveMind/HiveMindP2.cs +++ b/NPCs/HiveMind/HiveMindP2.cs @@ -71,7 +71,7 @@ namespace CalamityMod.NPCs.HiveMind npc.width = 150; npc.height = 120; npc.defense = 5; - npc.LifeMaxNERD(5800, 7560, 12500, 3000000, 3200000); + npc.LifeMaxNERB(5800, 7560, 3000000); double HPBoost = Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = -1; @@ -259,7 +259,7 @@ namespace CalamityMod.NPCs.HiveMind npc.alpha = 0; phase2timer = 0; deceleration = npc.velocity / 255f * reelbackFade; - if (CalamityWorld.death || CalamityWorld.bossRushActive) + if (CalamityWorld.revenge || CalamityWorld.bossRushActive) { state = 2; Main.PlaySound(36, (int)npc.Center.X, (int)npc.Center.Y, -1, 1f, 0f); @@ -305,16 +305,33 @@ namespace CalamityMod.NPCs.HiveMind if (nextState == 0) { npc.TargetClosest(true); - if (CalamityWorld.death || CalamityWorld.bossRushActive) + if ((CalamityWorld.revenge && (double)npc.life < (double)npc.lifeMax * 0.66) || CalamityWorld.death || CalamityWorld.bossRushActive) { - do - nextState = Main.rand.Next(3, 6); - while (nextState == previousState); - previousState = nextState; + if (CalamityWorld.death || CalamityWorld.bossRushActive) + { + do + nextState = Main.rand.Next(3, 6); + while (nextState == previousState); + previousState = nextState; + } + else if ((double)npc.life < (double)npc.lifeMax * 0.33) + { + do + nextState = Main.rand.Next(3, 6); + while (nextState == previousState); + previousState = nextState; + } + else + { + do + nextState = Main.rand.Next(3, 5); + while (nextState == previousState); + previousState = nextState; + } } else { - if (CalamityWorld.revenge && (Main.rand.NextBool(4) || reelCount == 3)) + if (CalamityWorld.revenge && (Main.rand.NextBool(3) || reelCount == 2)) { reelCount = 0; nextState = 2; @@ -322,7 +339,14 @@ namespace CalamityMod.NPCs.HiveMind else { reelCount++; - nextState = 1; + if (Main.expertMode && reelCount == 2) + { + reelCount = 0; + nextState = 2; + } + else + nextState = 1; + npc.ai[1] = 0f; npc.ai[2] = 0f; } @@ -418,9 +442,9 @@ namespace CalamityMod.NPCs.HiveMind npc.alpha = 255; npc.velocity = Vector2.Zero; dashStarted = false; - if (CalamityWorld.death || CalamityWorld.bossRushActive) + if ((CalamityWorld.revenge && (double)npc.life < (double)npc.lifeMax * 0.66) || CalamityWorld.death || CalamityWorld.bossRushActive) { - state = nextState; + state = nextState; nextState = 0; previousState = state; } @@ -436,7 +460,7 @@ namespace CalamityMod.NPCs.HiveMind rotationDirection = player.direction; } break; - case 3: //rev lunge + case 3: //lunge npc.netUpdate = true; if (npc.alpha > 0) { @@ -482,7 +506,7 @@ namespace CalamityMod.NPCs.HiveMind } } break; - case 4: //enemy spawn arc (death mode) + case 4: //enemy spawn arc if (npc.alpha > 0) { npc.alpha -= 5; @@ -537,7 +561,7 @@ namespace CalamityMod.NPCs.HiveMind } } break; - case 5: //raindash (death mode) + case 5: //raindash if (npc.alpha > 0) { npc.alpha -= 5; diff --git a/NPCs/Leviathan/Leviathan.cs b/NPCs/Leviathan/Leviathan.cs index cc780f9e3d..f546ba29f4 100644 --- a/NPCs/Leviathan/Leviathan.cs +++ b/NPCs/Leviathan/Leviathan.cs @@ -39,7 +39,7 @@ namespace CalamityMod.NPCs.Leviathan npc.height = 450; npc.defense = 40; npc.Calamity().RevPlusDR(0.35f); - npc.LifeMaxNERD(69000, 90700, 189750, 7000000, 7500000); + npc.LifeMaxNERB(69000, 90700, 7000000); double HPBoost = Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.knockBackResist = 0f; diff --git a/NPCs/Leviathan/Siren.cs b/NPCs/Leviathan/Siren.cs index c294c62021..fb3ab78546 100644 --- a/NPCs/Leviathan/Siren.cs +++ b/NPCs/Leviathan/Siren.cs @@ -34,7 +34,7 @@ namespace CalamityMod.NPCs.Leviathan npc.height = 100; npc.defense = 20; npc.Calamity().RevPlusDR(0.05f); - npc.LifeMaxNERD(27400, 41600, 58650, 2600000, 2800000); + npc.LifeMaxNERB(27400, 41600, 2600000); double HPBoost = Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.knockBackResist = 0f; diff --git a/NPCs/Perforator/PerforatorBodyLarge.cs b/NPCs/Perforator/PerforatorBodyLarge.cs index ba35e4900e..334a91ec24 100644 --- a/NPCs/Perforator/PerforatorBodyLarge.cs +++ b/NPCs/Perforator/PerforatorBodyLarge.cs @@ -25,11 +25,7 @@ namespace CalamityMod.NPCs.Perforator npc.width = 60; npc.height = 60; npc.defense = 8; - npc.lifeMax = 2500; - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 1000000 : 800000; - } + npc.LifeMaxNERB(2500, 2700, 800000); double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); npc.aiStyle = 6; diff --git a/NPCs/Perforator/PerforatorBodyMedium.cs b/NPCs/Perforator/PerforatorBodyMedium.cs index 29a58a5e95..56397cbdc4 100644 --- a/NPCs/Perforator/PerforatorBodyMedium.cs +++ b/NPCs/Perforator/PerforatorBodyMedium.cs @@ -24,11 +24,7 @@ namespace CalamityMod.NPCs.Perforator npc.width = 54; npc.height = 54; npc.defense = 6; - npc.lifeMax = 2000; - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 900000 : 700000; - } + npc.LifeMaxNERB(2000, 2200, 700000); double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); npc.aiStyle = 6; diff --git a/NPCs/Perforator/PerforatorBodySmall.cs b/NPCs/Perforator/PerforatorBodySmall.cs index 51921c633c..2ef3c2612a 100644 --- a/NPCs/Perforator/PerforatorBodySmall.cs +++ b/NPCs/Perforator/PerforatorBodySmall.cs @@ -24,11 +24,7 @@ namespace CalamityMod.NPCs.Perforator npc.width = 42; npc.height = 42; npc.defense = 4; - npc.lifeMax = 1250; - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 600000 : 500000; - } + npc.LifeMaxNERB(1250, 1500, 500000); double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); npc.aiStyle = 6; diff --git a/NPCs/Perforator/PerforatorHeadLarge.cs b/NPCs/Perforator/PerforatorHeadLarge.cs index ac4de30059..6212207bc5 100644 --- a/NPCs/Perforator/PerforatorHeadLarge.cs +++ b/NPCs/Perforator/PerforatorHeadLarge.cs @@ -32,12 +32,8 @@ namespace CalamityMod.NPCs.Perforator npc.width = 70; npc.height = 84; npc.defense = 4; - npc.lifeMax = 2500; - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 1000000 : 800000; - } - double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; + npc.LifeMaxNERB(2500, 2700, 800000); + double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); npc.aiStyle = 6; aiType = -1; diff --git a/NPCs/Perforator/PerforatorHeadMedium.cs b/NPCs/Perforator/PerforatorHeadMedium.cs index 401d0700e7..5346f034a3 100644 --- a/NPCs/Perforator/PerforatorHeadMedium.cs +++ b/NPCs/Perforator/PerforatorHeadMedium.cs @@ -31,12 +31,8 @@ namespace CalamityMod.NPCs.Perforator npc.width = 58; npc.height = 68; npc.defense = 2; - npc.lifeMax = 2000; - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 900000 : 700000; - } - double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; + npc.LifeMaxNERB(2000, 2200, 700000); + double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); npc.aiStyle = 6; aiType = -1; diff --git a/NPCs/Perforator/PerforatorHeadSmall.cs b/NPCs/Perforator/PerforatorHeadSmall.cs index 1a45d54551..d169ae0274 100644 --- a/NPCs/Perforator/PerforatorHeadSmall.cs +++ b/NPCs/Perforator/PerforatorHeadSmall.cs @@ -30,12 +30,8 @@ namespace CalamityMod.NPCs.Perforator npc.npcSlots = 5f; npc.width = 42; npc.height = 62; - npc.lifeMax = 1250; - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 600000 : 500000; - } - double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; + npc.LifeMaxNERB(1250, 1500, 500000); + double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); npc.aiStyle = 6; aiType = -1; diff --git a/NPCs/Perforator/PerforatorHive.cs b/NPCs/Perforator/PerforatorHive.cs index aeac5446ea..2a8ee9a2f1 100644 --- a/NPCs/Perforator/PerforatorHive.cs +++ b/NPCs/Perforator/PerforatorHive.cs @@ -43,7 +43,7 @@ namespace CalamityMod.NPCs.Perforator npc.width = 110; npc.height = 100; npc.defense = 4; - npc.LifeMaxNERD(3750, 5400, 7600, 2700000, 3000000); + npc.LifeMaxNERB(3750, 5400, 2700000); double HPBoost = Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = -1; @@ -110,12 +110,19 @@ namespace CalamityMod.NPCs.Perforator npc.timeLeft = 1800; } - bool wormAlive = false; - if (NPC.AnyNPCs(ModContent.NPCType()) || NPC.AnyNPCs(ModContent.NPCType()) || NPC.AnyNPCs(ModContent.NPCType())) + int wormsAlive = 0; + bool largeWormAlive = false; + if (NPC.AnyNPCs(ModContent.NPCType())) { - wormAlive = true; + wormsAlive++; + largeWormAlive = true; } - if (wormAlive) + if (NPC.AnyNPCs(ModContent.NPCType())) + wormsAlive++; + if (NPC.AnyNPCs(ModContent.NPCType())) + wormsAlive++; + + if (largeWormAlive) { npc.dontTakeDamage = true; } @@ -132,10 +139,11 @@ namespace CalamityMod.NPCs.Perforator shoot += 3; } npc.localAI[0] += (float)Main.rand.Next(shoot); - if (npc.localAI[0] >= (float)Main.rand.Next(300, 900)) + if (npc.localAI[0] >= (float)Main.rand.Next(300, 901) && npc.position.Y + (float)npc.height < player.position.Y && Vector2.Distance(player.Center, npc.Center) > 80f) { npc.localAI[0] = 0f; Main.PlaySound(3, (int)npc.position.X, (int)npc.position.Y, 20); + for (int num621 = 0; num621 < 8; num621++) { int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 170, 0f, 0f, 100, default, 1f); @@ -146,6 +154,7 @@ namespace CalamityMod.NPCs.Perforator Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; } } + for (int num623 = 0; num623 < 16; num623++) { int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default, 1.5f); @@ -154,6 +163,7 @@ namespace CalamityMod.NPCs.Perforator num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 5, 0f, 0f, 100, default, 1f); Main.dust[num624].velocity *= 2f; } + 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; @@ -168,6 +178,7 @@ namespace CalamityMod.NPCs.Perforator int num185 = Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType(); value9.X += num180; value9.Y += num182; + for (int num186 = 0; num186 < 20; num186++) { num180 = player.position.X + (float)player.width * 0.5f - value9.X; @@ -183,29 +194,37 @@ namespace CalamityMod.NPCs.Perforator npc.rotation = npc.velocity.X * 0.04f; npc.spriteDirection = (npc.direction > 0) ? 1 : -1; - if (wormAlive) + + if (revenge) { - Movement(player, 4f, 1f, (CalamityWorld.bossRushActive ? 0.2f : 0.15f), 160f, 300f, 400f); - } - else - { - if (large) + if (wormsAlive == 1) { - Movement(player, 5f, 1.5f, (CalamityWorld.bossRushActive ? 0.195f : 0.13f), 330f, 10f, 65f); - } - else if (medium) - { - Movement(player, 6f, 2f, (CalamityWorld.bossRushActive ? 0.18f : 0.12f), 320f, 15f, 60f); - } - else if (small) - { - Movement(player, 7f, 2.5f, (CalamityWorld.bossRushActive ? 0.165f : 0.11f), 310f, 20f, 55f); + Movement(player, 4f, 1f, (CalamityWorld.bossRushActive ? 0.2f : 0.15f), 160f, 300f, 400f); } else { - Movement(player, 8f, 3f, (CalamityWorld.bossRushActive ? 0.15f : 0.1f), 300f, 25f, 50f); + if (large || CalamityWorld.death || CalamityWorld.bossRushActive) + { + Movement(player, 5f, 1.5f, (CalamityWorld.bossRushActive ? 0.195f : 0.13f), 360f, 10f, 50f); + } + else if (medium) + { + Movement(player, 6f, 2f, (CalamityWorld.bossRushActive ? 0.18f : 0.12f), 340f, 15f, 50f); + } + else if (small) + { + Movement(player, 7f, 2.5f, (CalamityWorld.bossRushActive ? 0.165f : 0.11f), 320f, 20f, 50f); + } + else + { + Movement(player, 8f, 3f, (CalamityWorld.bossRushActive ? 0.15f : 0.1f), 300f, 25f, 50f); + } } } + else + { + Movement(player, 4f, 1f, 0.1f, 160f, 300f, 400f); + } if (npc.ai[3] == 0f && npc.life > 0) { diff --git a/NPCs/Perforator/PerforatorTailLarge.cs b/NPCs/Perforator/PerforatorTailLarge.cs index f597060d08..6cfb04c3a4 100644 --- a/NPCs/Perforator/PerforatorTailLarge.cs +++ b/NPCs/Perforator/PerforatorTailLarge.cs @@ -22,12 +22,8 @@ namespace CalamityMod.NPCs.Perforator npc.width = 60; npc.height = 78; npc.defense = 12; - npc.lifeMax = 2500; - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 1000000 : 800000; - } - double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; + npc.LifeMaxNERB(2500, 2700, 800000); + double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); npc.aiStyle = 6; aiType = -1; diff --git a/NPCs/Perforator/PerforatorTailMedium.cs b/NPCs/Perforator/PerforatorTailMedium.cs index 8aea588f04..93aaa5a38b 100644 --- a/NPCs/Perforator/PerforatorTailMedium.cs +++ b/NPCs/Perforator/PerforatorTailMedium.cs @@ -22,12 +22,8 @@ namespace CalamityMod.NPCs.Perforator npc.width = 44; npc.height = 58; npc.defense = 10; - npc.lifeMax = 2000; - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 900000 : 700000; - } - double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; + npc.LifeMaxNERB(2000, 2200, 700000); + double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); npc.aiStyle = 6; aiType = -1; diff --git a/NPCs/Perforator/PerforatorTailSmall.cs b/NPCs/Perforator/PerforatorTailSmall.cs index 4f8c4cca08..a985330100 100644 --- a/NPCs/Perforator/PerforatorTailSmall.cs +++ b/NPCs/Perforator/PerforatorTailSmall.cs @@ -22,12 +22,8 @@ namespace CalamityMod.NPCs.Perforator npc.width = 40; npc.height = 34; npc.defense = 8; - npc.lifeMax = 1250; - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 600000 : 500000; - } - double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; + npc.LifeMaxNERB(1250, 1500, 500000); + double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); npc.aiStyle = 6; aiType = -1; diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs index 7b671b4850..3499a21e0a 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs @@ -49,15 +49,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.height = 198; npc.defense = 40; npc.Calamity().RevPlusDR(0.25f); - npc.lifeMax = CalamityWorld.revenge ? 77275 : 58500; - if (CalamityWorld.death) - { - npc.lifeMax = 110000; - } - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 4000000 : 3700000; - } + npc.LifeMaxNERB(58500, 77275, 3700000); double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); npc.knockBackResist = 0f; @@ -211,7 +203,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath } while ((float)num596 == num595); - if (num596 == 0 && ((double)npc.life <= (double)npc.lifeMax * 0.8 || CalamityWorld.death || CalamityWorld.bossRushActive) && distFromPlayer.Length() < 1800f) + if (num596 == 0 && revenge && ((double)npc.life <= (double)npc.lifeMax * 0.8 || CalamityWorld.death || CalamityWorld.bossRushActive) && distFromPlayer.Length() < 1800f) { switch (Main.rand.Next(3)) { diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs b/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs index 2e124fa59e..06e32ad970 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs @@ -28,7 +28,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.height = 66; npc.defense = 30; npc.Calamity().RevPlusDR(0.2f); - npc.lifeMax = CalamityWorld.death ? 4000 : 3000; + npc.lifeMax = 3000; npc.value = Item.buyPrice(0, 1, 50, 0); if (CalamityWorld.bossRushActive) { diff --git a/NPCs/Polterghast/PolterPhantom.cs b/NPCs/Polterghast/PolterPhantom.cs index 5e1a84c03a..f6e88a450b 100644 --- a/NPCs/Polterghast/PolterPhantom.cs +++ b/NPCs/Polterghast/PolterPhantom.cs @@ -26,15 +26,7 @@ namespace CalamityMod.NPCs.Polterghast npc.damage = 210; npc.width = 90; npc.height = 120; - npc.lifeMax = CalamityWorld.revenge ? 150000 : 130000; - if (CalamityWorld.death) - { - npc.lifeMax = 225000; - } - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 1100000 : 900000; - } + npc.LifeMaxNERB(130000, 150000, 900000); double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); npc.knockBackResist = 0f; diff --git a/NPCs/Polterghast/Polterghast.cs b/NPCs/Polterghast/Polterghast.cs index f0922925af..251e59a17b 100644 --- a/NPCs/Polterghast/Polterghast.cs +++ b/NPCs/Polterghast/Polterghast.cs @@ -27,7 +27,6 @@ namespace CalamityMod.NPCs.Polterghast { private int despawnTimer = 600; private bool spawnGhost = false; - private bool boostDR = false; public static float phase1DR = 0.1f; public static float phase2DR = 0.15f; @@ -52,7 +51,7 @@ namespace CalamityMod.NPCs.Polterghast global.customDR = true; global.multDRReductions.Add(BuffID.Ichor, 0.88f); global.multDRReductions.Add(BuffID.CursedInferno, 0.9f); - npc.LifeMaxNERD(412500, 495000, 660000, 3250000, 3500000); + npc.LifeMaxNERB(412500, 495000, 3250000); double HPBoost = Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.knockBackResist = 0f; diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianBoss.cs b/NPCs/ProfanedGuardians/ProfanedGuardianBoss.cs index 125c7215ae..9252cdd494 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianBoss.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianBoss.cs @@ -35,7 +35,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians npc.height = 80; npc.defense = 50; npc.Calamity().RevPlusDR(0.4f); - npc.LifeMaxNERD(102500, 112500, 152500, 1650000, 1800000); + npc.LifeMaxNERB(102500, 112500, 1650000); double HPBoost = Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.knockBackResist = 0f; diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianBoss2.cs b/NPCs/ProfanedGuardians/ProfanedGuardianBoss2.cs index c642a9e609..8d81ddf842 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianBoss2.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianBoss2.cs @@ -27,7 +27,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians npc.height = 80; npc.defense = 50; npc.Calamity().RevPlusDR(0.25f); - npc.LifeMaxNERD(40000, 50000, 80000, 300000, 400000); + npc.LifeMaxNERB(40000, 50000, 300000); double HPBoost = Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.knockBackResist = 0f; diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianBoss3.cs b/NPCs/ProfanedGuardians/ProfanedGuardianBoss3.cs index 87041de0d0..907386105b 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianBoss3.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianBoss3.cs @@ -27,7 +27,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians npc.height = 80; npc.defense = 35; npc.Calamity().RevPlusDR(0.05f); - npc.LifeMaxNERD(25000, 35000, 50000, 200000, 240000); + npc.LifeMaxNERB(25000, 35000, 200000); double HPBoost = Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.knockBackResist = 0f; diff --git a/NPCs/Providence/ProvSpawnDefense.cs b/NPCs/Providence/ProvSpawnDefense.cs index 3e74731ebb..34f1e3aaf1 100644 --- a/NPCs/Providence/ProvSpawnDefense.cs +++ b/NPCs/Providence/ProvSpawnDefense.cs @@ -28,7 +28,7 @@ namespace CalamityMod.NPCs.Providence npc.lifeMax = 25000; if (CalamityWorld.bossRushActive) { - npc.lifeMax = CalamityWorld.death ? 360000 : 300000; + npc.lifeMax = 300000; } double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); diff --git a/NPCs/Providence/ProvSpawnHealer.cs b/NPCs/Providence/ProvSpawnHealer.cs index 74493635b3..b5c3d0aa46 100644 --- a/NPCs/Providence/ProvSpawnHealer.cs +++ b/NPCs/Providence/ProvSpawnHealer.cs @@ -28,7 +28,7 @@ namespace CalamityMod.NPCs.Providence npc.lifeMax = 40000; if (CalamityWorld.bossRushActive) { - npc.lifeMax = CalamityWorld.death ? 500000 : 400000; + npc.lifeMax = 400000; } double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); diff --git a/NPCs/Providence/ProvSpawnOffense.cs b/NPCs/Providence/ProvSpawnOffense.cs index d98b1d79a9..022bc5093d 100644 --- a/NPCs/Providence/ProvSpawnOffense.cs +++ b/NPCs/Providence/ProvSpawnOffense.cs @@ -32,7 +32,7 @@ namespace CalamityMod.NPCs.Providence npc.lifeMax = 42500; if (CalamityWorld.bossRushActive) { - npc.lifeMax = CalamityWorld.death ? 500000 : 400000; + npc.lifeMax = 400000; } double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index 78f3c0cc97..bbf5754a75 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -60,7 +60,7 @@ namespace CalamityMod.NPCs.Providence global.customDR = true; global.flatDRReductions.Add(BuffID.Ichor, 0.05f); global.flatDRReductions.Add(BuffID.CursedInferno, 0.05f); - npc.LifeMaxNERD(440000, 500000, 715000, 12500000, 15000000); + npc.LifeMaxNERB(440000, 500000, 12500000); double HPBoost = Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.knockBackResist = 0f; diff --git a/NPCs/Ravager/RavagerBody.cs b/NPCs/Ravager/RavagerBody.cs index e14abac0bf..63525ab4b6 100644 --- a/NPCs/Ravager/RavagerBody.cs +++ b/NPCs/Ravager/RavagerBody.cs @@ -42,7 +42,7 @@ namespace CalamityMod.NPCs.Ravager npc.defense = 55; npc.value = Item.buyPrice(0, 25, 0, 0); npc.Calamity().RevPlusDR(0.4f); - npc.LifeMaxNERD(42700, 53500, 90000, 4600000, 4800000); + npc.LifeMaxNERB(42700, 53500, 4600000); if (CalamityWorld.downedProvidence && !CalamityWorld.bossRushActive) { npc.damage *= 2; @@ -388,7 +388,15 @@ namespace CalamityMod.NPCs.Ravager npc.ai[1] += 1f; if (npc.ai[1] > 0f) { - if ((!rightClawActive && !leftClawActive) || npc.Calamity().enraged > 0 || (Config.BossRushXerocCurse && CalamityWorld.bossRushActive)) + if (CalamityWorld.revenge || CalamityWorld.bossRushActive) + { + if (npc.Calamity().newAI[0] % 3f == 0f) + npc.ai[1] += 1f; + else if (npc.Calamity().newAI[0] % 2f == 0f) + npc.ai[1] += 1f; + } + + if ((!rightClawActive && !leftClawActive) || npc.Calamity().enraged > 0 || (Config.BossRushXerocCurse && CalamityWorld.bossRushActive)) npc.ai[1] += 1f; if (!headActive || npc.Calamity().enraged > 0 || (Config.BossRushXerocCurse && CalamityWorld.bossRushActive)) npc.ai[1] += 1f; @@ -402,20 +410,32 @@ namespace CalamityMod.NPCs.Ravager { npc.TargetClosest(true); - float velocityX = ((enrage || npc.Calamity().enraged > 0 || (Config.BossRushXerocCurse && CalamityWorld.bossRushActive)) ? 8f : 4f) + (4f * (1f - lifeRatio)); - npc.velocity.X = velocityX * (float)npc.direction; + bool shouldFall = (Main.player[npc.target].position.Y >= npc.position.Y + (float)npc.height); + float velocityX = ((enrage || npc.Calamity().enraged > 0 || (Config.BossRushXerocCurse && CalamityWorld.bossRushActive)) ? 8f : 4f) + (4f * (1f - lifeRatio)); + float velocityY = -16f; - if (CalamityWorld.revenge || CalamityWorld.bossRushActive) - { - if (Main.player[npc.target].position.Y < npc.position.Y + (float)npc.height) - npc.velocity.Y = -15.2f; - else - npc.velocity.Y = 1f; + if (CalamityWorld.revenge || CalamityWorld.bossRushActive) + { + npc.noTileCollide = true; + if (shouldFall) + velocityY = 1f; - npc.noTileCollide = true; - } - else - npc.velocity.Y = -15.2f; + if (npc.Calamity().newAI[0] % 3f == 0f) + { + velocityX *= 2f; + if (!shouldFall) + velocityY *= 0.5f; + } + else if (npc.Calamity().newAI[0] % 2f == 0f) + { + velocityX *= 1.5f; + if (!shouldFall) + velocityY *= 0.75f; + } + } + + npc.velocity.X = velocityX * (float)npc.direction; + npc.velocity.Y = velocityY; npc.ai[0] = 1f; npc.ai[1] = 0f; @@ -445,7 +465,10 @@ namespace CalamityMod.NPCs.Ravager } } - for (int stompDustArea = (int)npc.position.X - 30; stompDustArea < (int)npc.position.X + npc.width + 60; stompDustArea += 30) + if (CalamityWorld.revenge || CalamityWorld.bossRushActive) + npc.Calamity().newAI[0] += 1f; + + for (int stompDustArea = (int)npc.position.X - 30; stompDustArea < (int)npc.position.X + npc.width + 60; stompDustArea += 30) { for (int stompDustAmount = 0; stompDustAmount < 6; stompDustAmount++) { diff --git a/NPCs/Ravager/RavagerClawLeft.cs b/NPCs/Ravager/RavagerClawLeft.cs index 8a4a49d3c8..ed70df4d19 100644 --- a/NPCs/Ravager/RavagerClawLeft.cs +++ b/NPCs/Ravager/RavagerClawLeft.cs @@ -58,7 +58,7 @@ namespace CalamityMod.NPCs.Ravager } if (CalamityWorld.bossRushActive) { - npc.lifeMax = CalamityWorld.death ? 300000 : 260000; + npc.lifeMax = 260000; } double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); diff --git a/NPCs/Ravager/RavagerClawRight.cs b/NPCs/Ravager/RavagerClawRight.cs index 5f98995b37..656a1bdae6 100644 --- a/NPCs/Ravager/RavagerClawRight.cs +++ b/NPCs/Ravager/RavagerClawRight.cs @@ -59,7 +59,7 @@ namespace CalamityMod.NPCs.Ravager } if (CalamityWorld.bossRushActive) { - npc.lifeMax = CalamityWorld.death ? 300000 : 260000; + npc.lifeMax = 260000; } double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); diff --git a/NPCs/Ravager/RavagerHead.cs b/NPCs/Ravager/RavagerHead.cs index 57e1fd1618..842341eed6 100644 --- a/NPCs/Ravager/RavagerHead.cs +++ b/NPCs/Ravager/RavagerHead.cs @@ -58,7 +58,7 @@ namespace CalamityMod.NPCs.Ravager } if (CalamityWorld.bossRushActive) { - npc.lifeMax = CalamityWorld.death ? 500000 : 450000; + npc.lifeMax = 450000; } double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); diff --git a/NPCs/Ravager/RavagerLegLeft.cs b/NPCs/Ravager/RavagerLegLeft.cs index e385af4b4d..e9760f3025 100644 --- a/NPCs/Ravager/RavagerLegLeft.cs +++ b/NPCs/Ravager/RavagerLegLeft.cs @@ -55,7 +55,7 @@ namespace CalamityMod.NPCs.Ravager } if (CalamityWorld.bossRushActive) { - npc.lifeMax = CalamityWorld.death ? 450000 : 400000; + npc.lifeMax = 400000; } double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); diff --git a/NPCs/Ravager/RavagerLegRight.cs b/NPCs/Ravager/RavagerLegRight.cs index 4e62aadedd..37400ad850 100644 --- a/NPCs/Ravager/RavagerLegRight.cs +++ b/NPCs/Ravager/RavagerLegRight.cs @@ -55,7 +55,7 @@ namespace CalamityMod.NPCs.Ravager } if (CalamityWorld.bossRushActive) { - npc.lifeMax = CalamityWorld.death ? 450000 : 400000; + npc.lifeMax = 400000; } double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); diff --git a/NPCs/Signus/CosmicLantern.cs b/NPCs/Signus/CosmicLantern.cs index 9936f217bd..c6f69d537b 100644 --- a/NPCs/Signus/CosmicLantern.cs +++ b/NPCs/Signus/CosmicLantern.cs @@ -60,7 +60,9 @@ namespace CalamityMod.NPCs.Signus public override void AI() { - npc.alpha -= 3; + Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0.75f, 0.75f, 0.75f); + + npc.alpha -= 3; if (npc.alpha < 0) { npc.alpha = 0; @@ -68,19 +70,21 @@ namespace CalamityMod.NPCs.Signus Main.dust[num1262].velocity *= 0.1f; Main.dust[num1262].noGravity = true; } + npc.rotation = npc.velocity.X * 0.08f; npc.spriteDirection = (npc.direction > 0) ? 1 : -1; npc.TargetClosest(true); + + bool revenge = CalamityWorld.revenge; + float playerDistNormMult = revenge ? 24f : 22f; + if (CalamityWorld.bossRushActive) + playerDistNormMult = 30f; + Vector2 vector145 = new Vector2(npc.Center.X, npc.Center.Y); float playerDistX = Main.player[npc.target].Center.X - vector145.X; float playerDistY = Main.player[npc.target].Center.Y - vector145.Y; float playerDistMagnitude = (float)Math.Sqrt((double)(playerDistX * playerDistX + playerDistY * playerDistY)); - bool revenge = CalamityWorld.revenge; - float playerDistNormMult = revenge ? 27f : 25f; - if (CalamityWorld.death || CalamityWorld.bossRushActive) - { - playerDistNormMult = 30f; - } + if (npc.localAI[0] < 85f) { playerDistNormMult = 0.1f; @@ -91,8 +95,10 @@ namespace CalamityMod.NPCs.Signus npc.localAI[0] += 1f; return; } + npc.dontTakeDamage = false; npc.chaseable = true; + playerDistMagnitude = playerDistNormMult / playerDistMagnitude; playerDistX *= playerDistMagnitude; playerDistY *= playerDistMagnitude; diff --git a/NPCs/Signus/Signus.cs b/NPCs/Signus/Signus.cs index 41cf37689c..0682db7d64 100644 --- a/NPCs/Signus/Signus.cs +++ b/NPCs/Signus/Signus.cs @@ -46,23 +46,15 @@ namespace CalamityMod.NPCs.Signus music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/ScourgeofTheUniverse"); else music = MusicID.Boss4; - npc.lifeMax = CalamityWorld.revenge ? 109500 : 70000; - if (CalamityWorld.DoGSecondStageCountdown <= 0) + bool notDoGFight = CalamityWorld.DoGSecondStageCountdown <= 0; + npc.LifeMaxNERB(notDoGFight ? 280000 : 70000, notDoGFight ? 445500 : 109500, 2400000); + if (notDoGFight) { npc.value = Item.buyPrice(0, 35, 0, 0); if (calamityModMusic != null) music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/Signus"); else music = MusicID.Boss4; - npc.lifeMax = CalamityWorld.revenge ? 445500 : 280000; - if (CalamityWorld.death) - { - npc.lifeMax = 722250; - } - } - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 2600000 : 2400000; } double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); @@ -131,7 +123,17 @@ namespace CalamityMod.NPCs.Signus Player player = Main.player[npc.target]; npc.TargetClosest(true); - Vector2 vector142 = new Vector2(npc.Center.X, npc.Center.Y); + + int targetLightStrength = player.Calamity().abyssLightLevelStat * 15; + if (revenge) + { + int fadeIn = (int)((double)lifeToAlpha * 1.5) - targetLightStrength; + if (fadeIn < 0) + fadeIn = 0; + Main.BlackFadeIn = fadeIn; + } + + Vector2 vector142 = new Vector2(npc.Center.X, npc.Center.Y); Vector2 vectorCenter = npc.Center; float num1243 = player.Center.X - vector142.X; float num1244 = player.Center.Y - vector142.Y; @@ -221,7 +223,7 @@ namespace CalamityMod.NPCs.Signus } if (npc.ai[0] == 0f) { - if (Main.netMode != NetmodeID.MultiplayerClient) + if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[1] += 1f; if (npc.localAI[1] >= 120f) @@ -361,21 +363,14 @@ namespace CalamityMod.NPCs.Signus Vector2 vector121 = new Vector2(npc.position.X + (float)(npc.width / 2), npc.position.Y + (float)(npc.height / 2)); npc.ai[1] += 1f; bool flag104 = false; - if (npc.life < npc.lifeMax / 4 || CalamityWorld.death || CalamityWorld.bossRushActive) + if (npc.life < npc.lifeMax / 2 || CalamityWorld.death || CalamityWorld.bossRushActive) { - if (npc.ai[1] % 30f == 29f) + if (npc.ai[1] % 45f == 44f) { flag104 = true; } } - else if (npc.life < npc.lifeMax / 2) - { - if (npc.ai[1] % 35f == 34f) - { - flag104 = true; - } - } - else if (npc.ai[1] % 40f == 39f) + else if (npc.ai[1] % 65f == 64f) { flag104 = true; } @@ -555,7 +550,7 @@ namespace CalamityMod.NPCs.Signus } else if (chargeSwitch == 1) //pause before charge { - npc.velocity *= scaleFactor4; + npc.velocity *= scaleFactor4; npc.ai[1] += 1f; if (npc.ai[1] >= num1001) { @@ -741,6 +736,13 @@ namespace CalamityMod.NPCs.Signus // Weapons DropHelper.DropItemChance(npc, ModContent.ItemType(), 3); DropHelper.DropItemChance(npc, ModContent.ItemType(), 3); + float f = Main.rand.NextFloat(); + bool replaceWithRare = f <= DropHelper.RareVariantDropRateFloat; // 1/40 chance overall of getting Lantern of the Soul + if (f < 0.3333333f) // 1/3 chance of getting Cosmilamp OR Lantern of the Soul replacing it + { + DropHelper.DropItemCondition(npc, ModContent.ItemType(), !replaceWithRare); + DropHelper.DropItemCondition(npc, ModContent.ItemType(), replaceWithRare); + } //Equipment DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.revenge, 4, 1, 1); diff --git a/NPCs/Signus/SignusBomb.cs b/NPCs/Signus/SignusBomb.cs index f6472cef7d..2ac2d59459 100644 --- a/NPCs/Signus/SignusBomb.cs +++ b/NPCs/Signus/SignusBomb.cs @@ -41,7 +41,8 @@ namespace CalamityMod.NPCs.Signus public override void AI() { - npc.rotation = npc.velocity.X * 0.04f; + Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0.7f, 0.2f, 1.1f); + npc.rotation = npc.velocity.X * 0.04f; if (npc.ai[1] == 0f) { npc.scale -= 0.02f; diff --git a/NPCs/Signus/SignusScreenShaderData.cs b/NPCs/Signus/SignusScreenShaderData.cs new file mode 100644 index 0000000000..b144eaa9c2 --- /dev/null +++ b/NPCs/Signus/SignusScreenShaderData.cs @@ -0,0 +1,44 @@ +using Terraria; +using Terraria.Graphics.Shaders; +using Terraria.ModLoader; + +namespace CalamityMod.NPCs.Signus +{ + public class SignusScreenShaderData : ScreenShaderData + { + private int SignusIndex; + + public SignusScreenShaderData(string passName) + : base(passName) + { + } + + private void UpdateSIndex() + { + int SignusType = ModContent.NPCType(); + if (SignusIndex >= 0 && Main.npc[SignusIndex].active && Main.npc[SignusIndex].type == SignusType) + { + return; + } + SignusIndex = -1; + for (int i = 0; i < Main.npc.Length; i++) + { + if (Main.npc[i].active && Main.npc[i].type == SignusType) + { + SignusIndex = i; + break; + } + } + } + + public override void Apply() + { + UpdateSIndex(); + if (SignusIndex != -1) + { + UseTargetPosition(Main.npc[SignusIndex].Center); + } + base.Apply(); + } + } +} diff --git a/NPCs/Signus/SignusSky.cs b/NPCs/Signus/SignusSky.cs new file mode 100644 index 0000000000..b0f9eb3cad --- /dev/null +++ b/NPCs/Signus/SignusSky.cs @@ -0,0 +1,107 @@ +using CalamityMod.World; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Graphics.Effects; +using Terraria.ModLoader; + +namespace CalamityMod.NPCs.Signus +{ + public class SignusSky : CustomSky + { + private bool isActive = false; + private float intensity = 0f; + private int SignusIndex = -1; + + public override void Update(GameTime gameTime) + { + if (isActive && intensity < 1f) + { + intensity += 0.01f; + } + else if (!isActive && intensity > 0f) + { + intensity -= 0.01f; + } + } + + private float GetIntensity() + { + if (this.UpdateSIndex()) + { + float x = 0f; + if (this.SignusIndex != -1) + { + x = Vector2.Distance(Main.player[Main.myPlayer].Center, Main.npc[this.SignusIndex].Center); + } + + float maxIntensity = 0.1f; + if (CalamityWorld.revenge) + { + maxIntensity = 1f - (float)Main.npc[this.SignusIndex].life / (float)Main.npc[this.SignusIndex].lifeMax; + } + return (1f - Utils.SmoothStep(3000f, 6000f, x)) * maxIntensity; + } + return 0f; + } + + public override Color OnTileColor(Color inColor) + { + float intensity = this.GetIntensity(); + return new Color(Vector4.Lerp(new Vector4(0.5f, 0.8f, 1f, 1f), inColor.ToVector4(), 1f - intensity)); + } + + private bool UpdateSIndex() + { + int SignusType = ModContent.NPCType(); + if (SignusIndex >= 0 && Main.npc[SignusIndex].active && Main.npc[SignusIndex].type == SignusType) + { + return true; + } + SignusIndex = -1; + for (int i = 0; i < Main.npc.Length; i++) + { + if (Main.npc[i].active && Main.npc[i].type == SignusType) + { + SignusIndex = i; + break; + } + } + return SignusIndex != -1; + } + + public override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDepth) + { + if (maxDepth >= 0 && minDepth < 0) + { + float intensity = this.GetIntensity(); + spriteBatch.Draw(Main.blackTileTexture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.Black * intensity); + } + } + + public override float GetCloudAlpha() + { + return 0f; + } + + public override void Activate(Vector2 position, params object[] args) + { + isActive = true; + } + + public override void Deactivate(params object[] args) + { + isActive = false; + } + + public override void Reset() + { + isActive = false; + } + + public override bool IsActive() + { + return isActive || intensity > 0f; + } + } +} diff --git a/NPCs/SlimeGod/SlimeGod.cs b/NPCs/SlimeGod/SlimeGod.cs index f6902ec2ec..7cb5bc2b8d 100644 --- a/NPCs/SlimeGod/SlimeGod.cs +++ b/NPCs/SlimeGod/SlimeGod.cs @@ -28,7 +28,7 @@ namespace CalamityMod.NPCs.SlimeGod npc.height = 92; npc.scale = 1.1f; npc.defense = 10; - npc.LifeMaxNERD(4000, 5500, 7700, 2200000, 2400000); + npc.LifeMaxNERB(4000, 5500, 2200000); double HPBoost = Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = -1; diff --git a/NPCs/SlimeGod/SlimeGodCore.cs b/NPCs/SlimeGod/SlimeGodCore.cs index 52a056f602..dbdb8f56f9 100644 --- a/NPCs/SlimeGod/SlimeGodCore.cs +++ b/NPCs/SlimeGod/SlimeGodCore.cs @@ -36,7 +36,7 @@ namespace CalamityMod.NPCs.SlimeGod npc.width = 44; npc.height = 44; npc.defense = 6; - npc.LifeMaxNERD(3000, 3750, 5250, 2500000, 2700000); + npc.LifeMaxNERB(3000, 3750, 2500000); double HPBoost = Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); NPCID.Sets.TrailCacheLength[npc.type] = 8; diff --git a/NPCs/SlimeGod/SlimeGodRun.cs b/NPCs/SlimeGod/SlimeGodRun.cs index 9a0b639c0e..77c96319c5 100644 --- a/NPCs/SlimeGod/SlimeGodRun.cs +++ b/NPCs/SlimeGod/SlimeGodRun.cs @@ -28,7 +28,7 @@ namespace CalamityMod.NPCs.SlimeGod npc.height = 92; npc.scale = 1.1f; npc.defense = 12; - npc.LifeMaxNERD(3500, 4813, 6738, 1600000, 1700000); + npc.LifeMaxNERB(3500, 4813, 1600000); double HPBoost = Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.knockBackResist = 0f; diff --git a/NPCs/SlimeGod/SlimeGodRunSplit.cs b/NPCs/SlimeGod/SlimeGodRunSplit.cs index 3a5ff68b1f..cc0d8be73a 100644 --- a/NPCs/SlimeGod/SlimeGodRunSplit.cs +++ b/NPCs/SlimeGod/SlimeGodRunSplit.cs @@ -23,7 +23,7 @@ namespace CalamityMod.NPCs.SlimeGod public override void SetDefaults() { - npc.LifeMaxNERD(1750, 2407, 3369, 800000, 850000); + npc.LifeMaxNERB(1750, 2407, 800000); double HPBoost = Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.damage = 45; diff --git a/NPCs/SlimeGod/SlimeGodSplit.cs b/NPCs/SlimeGod/SlimeGodSplit.cs index 06e4b04b41..0ec933f954 100644 --- a/NPCs/SlimeGod/SlimeGodSplit.cs +++ b/NPCs/SlimeGod/SlimeGodSplit.cs @@ -23,7 +23,7 @@ namespace CalamityMod.NPCs.SlimeGod public override void SetDefaults() { - npc.LifeMaxNERD(2000, 2750, 3850, 1100000, 1200000); + npc.LifeMaxNERB(2000, 2750, 1100000); double HPBoost = Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.damage = 40; diff --git a/NPCs/StormWeaver/StormWeaverBody.cs b/NPCs/StormWeaver/StormWeaverBody.cs index f0d04360f9..da2f55fe2b 100644 --- a/NPCs/StormWeaver/StormWeaverBody.cs +++ b/NPCs/StormWeaver/StormWeaverBody.cs @@ -25,23 +25,19 @@ namespace CalamityMod.NPCs.StormWeaver CalamityGlobalNPC global = npc.Calamity(); global.DR = 0.999999f; global.unbreakableDR = true; - npc.lifeMax = 20000; + bool notDoGFight = CalamityWorld.DoGSecondStageCountdown <= 0; + npc.LifeMaxNERB(notDoGFight ? 100000 : 20000, notDoGFight ? 100000 : 20000, 170000); Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); if (calamityModMusic != null) music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/ScourgeofTheUniverse"); else music = MusicID.Boss3; - if (CalamityWorld.DoGSecondStageCountdown <= 0) + if (notDoGFight) { if (calamityModMusic != null) music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/Weaver"); else music = MusicID.Boss3; - npc.lifeMax = 100000; - } - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = 170000; } double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); diff --git a/NPCs/StormWeaver/StormWeaverBodyNaked.cs b/NPCs/StormWeaver/StormWeaverBodyNaked.cs index ee3c2ce1b3..1d5d48daa0 100644 --- a/NPCs/StormWeaver/StormWeaverBodyNaked.cs +++ b/NPCs/StormWeaver/StormWeaverBodyNaked.cs @@ -26,22 +26,19 @@ namespace CalamityMod.NPCs.StormWeaver npc.width = 40; npc.height = 40; npc.lifeMax = 100000; - Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); + bool notDoGFight = CalamityWorld.DoGSecondStageCountdown <= 0; + npc.LifeMaxNERB(notDoGFight ? 600000 : 100000, notDoGFight ? 600000 : 100000, 3500000); + Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); if (calamityModMusic != null) music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/ScourgeofTheUniverse"); else music = MusicID.Boss3; - if (CalamityWorld.DoGSecondStageCountdown <= 0) + if (notDoGFight) { if (calamityModMusic != null) music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/Weaver"); else music = MusicID.Boss3; - npc.lifeMax = 600000; - } - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = 3500000; } double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); diff --git a/NPCs/StormWeaver/StormWeaverHead.cs b/NPCs/StormWeaver/StormWeaverHead.cs index 0714e85584..9b89842767 100644 --- a/NPCs/StormWeaver/StormWeaverHead.cs +++ b/NPCs/StormWeaver/StormWeaverHead.cs @@ -34,23 +34,19 @@ namespace CalamityMod.NPCs.StormWeaver CalamityGlobalNPC global = npc.Calamity(); global.DR = 0.999999f; global.unbreakableDR = true; - npc.lifeMax = 20000; - Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); + bool notDoGFight = CalamityWorld.DoGSecondStageCountdown <= 0; + npc.LifeMaxNERB(notDoGFight ? 100000 : 20000, notDoGFight ? 100000 : 20000, 170000); + Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); if (calamityModMusic != null) music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/ScourgeofTheUniverse"); else music = MusicID.Boss3; - if (CalamityWorld.DoGSecondStageCountdown <= 0) + if (notDoGFight) { if (calamityModMusic != null) music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/Weaver"); else music = MusicID.Boss3; - npc.lifeMax = 100000; - } - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = 170000; } double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); diff --git a/NPCs/StormWeaver/StormWeaverHeadNaked.cs b/NPCs/StormWeaver/StormWeaverHeadNaked.cs index d1b2c18a6b..90e8bce169 100644 --- a/NPCs/StormWeaver/StormWeaverHeadNaked.cs +++ b/NPCs/StormWeaver/StormWeaverHeadNaked.cs @@ -35,24 +35,20 @@ namespace CalamityMod.NPCs.StormWeaver npc.npcSlots = 5f; npc.width = 74; npc.height = 74; - npc.lifeMax = 100000; - Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); + bool notDoGFight = CalamityWorld.DoGSecondStageCountdown <= 0; + npc.LifeMaxNERB(notDoGFight ? 600000 : 100000, notDoGFight ? 600000 : 100000, 3500000); + Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); if (calamityModMusic != null) music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/ScourgeofTheUniverse"); else music = MusicID.Boss3; - if (CalamityWorld.DoGSecondStageCountdown <= 0) + if (notDoGFight) { npc.value = Item.buyPrice(0, 35, 0, 0); if (calamityModMusic != null) music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/Weaver"); else music = MusicID.Boss3; - npc.lifeMax = 600000; - } - if (CalamityWorld.bossRushActive) // 30 seconds - { - npc.lifeMax = 3500000; } double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); diff --git a/NPCs/StormWeaver/StormWeaverTail.cs b/NPCs/StormWeaver/StormWeaverTail.cs index efdc4972ac..e55d461a8d 100644 --- a/NPCs/StormWeaver/StormWeaverTail.cs +++ b/NPCs/StormWeaver/StormWeaverTail.cs @@ -19,25 +19,21 @@ namespace CalamityMod.NPCs.StormWeaver npc.npcSlots = 5f; npc.width = 48; npc.height = 80; - npc.lifeMax = 20000; npc.defense = 0; npc.takenDamageMultiplier = CalamityWorld.death ? 3f : 10f; - Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); + bool notDoGFight = CalamityWorld.DoGSecondStageCountdown <= 0; + npc.LifeMaxNERB(notDoGFight ? 100000 : 20000, notDoGFight ? 100000 : 20000, 170000); + Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); if (calamityModMusic != null) music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/ScourgeofTheUniverse"); else music = MusicID.Boss3; - if (CalamityWorld.DoGSecondStageCountdown <= 0) + if (notDoGFight) { if (calamityModMusic != null) music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/Weaver"); else music = MusicID.Boss3; - npc.lifeMax = 100000; - } - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = 170000; } double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); diff --git a/NPCs/StormWeaver/StormWeaverTailNaked.cs b/NPCs/StormWeaver/StormWeaverTailNaked.cs index 494003ada5..dfbcbc105c 100644 --- a/NPCs/StormWeaver/StormWeaverTailNaked.cs +++ b/NPCs/StormWeaver/StormWeaverTailNaked.cs @@ -24,23 +24,19 @@ namespace CalamityMod.NPCs.StormWeaver npc.npcSlots = 5f; npc.width = 48; npc.height = 80; - npc.lifeMax = 100000; - Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); + bool notDoGFight = CalamityWorld.DoGSecondStageCountdown <= 0; + npc.LifeMaxNERB(notDoGFight ? 600000 : 100000, notDoGFight ? 600000 : 100000, 3500000); + Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic"); if (calamityModMusic != null) music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/ScourgeofTheUniverse"); else music = MusicID.Boss3; - if (CalamityWorld.DoGSecondStageCountdown <= 0) + if (notDoGFight) { if (calamityModMusic != null) music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/Weaver"); else music = MusicID.Boss3; - npc.lifeMax = 600000; - } - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = 3500000; } double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); diff --git a/NPCs/SupremeCalamitas/SCalWormHeart.cs b/NPCs/SupremeCalamitas/SCalWormHeart.cs index ef3b7c3380..bba5e562b1 100644 --- a/NPCs/SupremeCalamitas/SCalWormHeart.cs +++ b/NPCs/SupremeCalamitas/SCalWormHeart.cs @@ -15,21 +15,13 @@ namespace CalamityMod.NPCs.SupremeCalamitas public override void SetDefaults() { - npc.damage = 0; //70 - npc.width = 24; //324 - npc.height = 24; //216 + npc.damage = 0; + npc.width = 24; + npc.height = 24; npc.defense = 0; - npc.lifeMax = CalamityWorld.revenge ? 180000 : 160000; - if (CalamityWorld.death) - { - npc.lifeMax = 240000; - } - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 120000 : 90000; - } - npc.aiStyle = -1; //new - aiType = -1; //new + npc.LifeMaxNERB(160000, 180000, 90000); + npc.aiStyle = -1; + aiType = -1; npc.knockBackResist = 0f; npc.alpha = 255; npc.noGravity = true; diff --git a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs index fb164671b4..f966412e7e 100644 --- a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs +++ b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs @@ -31,11 +31,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas npc.damage = 0; npc.defense = 80; npc.Calamity().RevPlusDR(0.35f); - npc.lifeMax = Main.expertMode ? 90000 : 50000; - if (CalamityWorld.revenge) - { - npc.lifeMax = CalamityWorld.death ? 100000 : 170000; - } + npc.LifeMaxNERB(Main.expertMode ? 90000 : 50000, 170000); for (int k = 0; k < npc.buffImmune.Length; k++) { npc.buffImmune[k] = true; diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index 9c80ec4a74..a3a4f4ae25 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -91,15 +91,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas global.multDRReductions.Add(BuffID.Ichor, 0.9f); global.multDRReductions.Add(BuffID.CursedInferno, 0.91f); npc.value = Item.buyPrice(10, 0, 0, 0); - npc.lifeMax = CalamityWorld.revenge ? 5500000 : 5000000; - if (CalamityWorld.death) - { - npc.lifeMax = 6250000; - } - if (CalamityWorld.bossRushActive) - { - npc.lifeMax = CalamityWorld.death ? 2300000 : 2100000; - } + npc.LifeMaxNERB(5000000, 5500000, 2100000); double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); npc.aiStyle = -1; diff --git a/NPCs/SupremeCalamitas/SupremeCataclysm.cs b/NPCs/SupremeCalamitas/SupremeCataclysm.cs index bfb375d5f6..d5e275ebc2 100644 --- a/NPCs/SupremeCalamitas/SupremeCataclysm.cs +++ b/NPCs/SupremeCalamitas/SupremeCataclysm.cs @@ -34,11 +34,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas global.customDR = true; global.multDRReductions.Add(BuffID.Ichor, 0.9f); global.multDRReductions.Add(BuffID.CursedInferno, 0.91f); - npc.lifeMax = CalamityWorld.revenge ? 2100000 : 1800000; - if (CalamityWorld.death) - { - npc.lifeMax = 1500000; - } + npc.LifeMaxNERB(1800000, 2100000); double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); npc.aiStyle = -1; diff --git a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs index ff56b3e06e..8fb914cdd4 100644 --- a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs +++ b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs @@ -34,11 +34,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas global.customDR = true; global.multDRReductions.Add(BuffID.Ichor, 0.9f); global.multDRReductions.Add(BuffID.CursedInferno, 0.91f); - npc.lifeMax = CalamityWorld.revenge ? 2100000 : 1800000; - if (CalamityWorld.death) - { - npc.lifeMax = 1500000; - } + npc.LifeMaxNERB(1800000, 2100000); double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); npc.aiStyle = -1; diff --git a/NPCs/Yharon/Yharon.cs b/NPCs/Yharon/Yharon.cs index 13867b0435..4cd3dd0b07 100644 --- a/NPCs/Yharon/Yharon.cs +++ b/NPCs/Yharon/Yharon.cs @@ -63,7 +63,7 @@ namespace CalamityMod.NPCs.Yharon npc.width = 200; npc.height = 200; npc.defense = 150; - npc.LifeMaxNERD(2275000, 2525000, 3025000, 3700000, 4000000); + npc.LifeMaxNERB(2275000, 2525000, 3700000); double HPBoost = Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.knockBackResist = 0f; diff --git a/Projectiles/Boss/DarkEnergyBall2.cs b/Projectiles/Boss/DarkEnergyBall2.cs new file mode 100644 index 0000000000..a8e3327698 --- /dev/null +++ b/Projectiles/Boss/DarkEnergyBall2.cs @@ -0,0 +1,83 @@ +using System; +using System.IO; +using Terraria; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Boss +{ + public class DarkEnergyBall2 : ModProjectile + { + private bool start = true; + private float startingPosX = 0f; + private float startingPosY = 0f; + private double distance = 0D; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dark Energy"); + Main.projFrames[projectile.type] = 6; + } + + public override void SetDefaults() + { + projectile.width = 80; + projectile.height = 80; + projectile.hostile = true; + projectile.tileCollide = false; + projectile.timeLeft = 600; + projectile.penetrate = -1; + cooldownSlot = 1; + } + + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(start); + writer.Write(startingPosX); + writer.Write(startingPosY); + writer.Write(distance); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + start = reader.ReadBoolean(); + startingPosX = reader.ReadSingle(); + startingPosY = reader.ReadSingle(); + distance = reader.ReadDouble(); + } + + public override void AI() + { + projectile.frameCounter++; + if (projectile.frameCounter > 4) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 5) + { + projectile.frame = 0; + } + + if (start) + { + startingPosX = projectile.Center.X; + startingPosY = projectile.Center.Y; + start = false; + } + + double deg = (double)projectile.ai[0]; + double rad = deg * (Math.PI / 180); + distance += (projectile.ai[1] == 1f ? 2D : 1D); + projectile.position.X = startingPosX - (int)(Math.Cos(rad) * distance) - projectile.width / 2; + projectile.position.Y = startingPosY - (int)(Math.Sin(rad) * distance) - projectile.height / 2; + projectile.ai[0] += 1f; + } + + public override void Kill(int timeLeft) + { + for (int k = 0; k < 5; k++) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 90, 0f, 0f); + } + } + } +} diff --git a/Projectiles/Boss/DarkEnergyBall2.png b/Projectiles/Boss/DarkEnergyBall2.png new file mode 100644 index 0000000000..813ebf8eb0 Binary files /dev/null and b/Projectiles/Boss/DarkEnergyBall2.png differ diff --git a/Projectiles/Boss/MushBombFall.cs b/Projectiles/Boss/MushBombFall.cs index 18e741ac38..0c4d203b12 100644 --- a/Projectiles/Boss/MushBombFall.cs +++ b/Projectiles/Boss/MushBombFall.cs @@ -1,4 +1,6 @@ -using Microsoft.Xna.Framework; +using CalamityMod.World; +using Microsoft.Xna.Framework; +using System; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss @@ -25,7 +27,8 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { - projectile.velocity.Y = 5f; + projectile.velocity.Y = CalamityWorld.death ? 6f : 5f; + projectile.frameCounter++; if (projectile.frameCounter > 4) { @@ -36,12 +39,14 @@ namespace CalamityMod.Projectiles.Boss { projectile.frame = 0; } + if (projectile.timeLeft < 90) - { projectile.tileCollide = true; - } - Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0f / 255f, (255 - projectile.alpha) * 0.15f / 255f, (255 - projectile.alpha) * 0.3f / 255f); - projectile.velocity.X *= 0.99f; + + Lighting.AddLight(projectile.Center, 0f, 0.15f, 0.3f); + + if (Math.Abs(projectile.velocity.X) > 2f) + projectile.velocity.X *= 0.99f; } public override void Kill(int timeLeft) diff --git a/Projectiles/Healing/BurntSiennaProj.cs b/Projectiles/Healing/BurntSiennaProj.cs index 47f7ee6516..5af35de105 100644 --- a/Projectiles/Healing/BurntSiennaProj.cs +++ b/Projectiles/Healing/BurntSiennaProj.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Healing float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490)); if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y) { - if (projectile.owner == Main.myPlayer) + if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech) { int num492 = 3; Main.player[num487].HealEffect(num492, false); diff --git a/Projectiles/Healing/CactusHealOrb.cs b/Projectiles/Healing/CactusHealOrb.cs index 99fb20fee9..2a820f4f43 100644 --- a/Projectiles/Healing/CactusHealOrb.cs +++ b/Projectiles/Healing/CactusHealOrb.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Healing float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490)); if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y) { - if (projectile.owner == Main.myPlayer) + if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech) { int num492 = 25; Main.player[num487].HealEffect(num492, false); diff --git a/Projectiles/Healing/EssenceFlame.cs b/Projectiles/Healing/EssenceFlame.cs index f585af83bf..24f49646a4 100644 --- a/Projectiles/Healing/EssenceFlame.cs +++ b/Projectiles/Healing/EssenceFlame.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Healing float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490)); if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y) { - if (projectile.owner == Main.myPlayer) + if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech) { int num492 = 8; Main.player[num487].HealEffect(num492, false); diff --git a/Projectiles/Healing/EssenceFlame.png b/Projectiles/Healing/EssenceFlame.png index 2ef4c2dba5..3009ead213 100644 Binary files a/Projectiles/Healing/EssenceFlame.png and b/Projectiles/Healing/EssenceFlame.png differ diff --git a/Projectiles/Healing/PhoenixHeal.cs b/Projectiles/Healing/PhoenixHeal.cs index f6897b12b1..bfa15556d4 100644 --- a/Projectiles/Healing/PhoenixHeal.cs +++ b/Projectiles/Healing/PhoenixHeal.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Healing float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490)); if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y) { - if (projectile.owner == Main.myPlayer) + if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech) { int num492 = 10; Main.player[num487].HealEffect(num492, false); diff --git a/Projectiles/Healing/RainHeal.cs b/Projectiles/Healing/RainHeal.cs index a8836237a2..0c1b9dd154 100644 --- a/Projectiles/Healing/RainHeal.cs +++ b/Projectiles/Healing/RainHeal.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Healing float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490)); if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y) { - if (projectile.owner == Main.myPlayer) + if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech) { int num492 = 8; Main.player[num487].HealEffect(num492, false); diff --git a/Projectiles/Healing/TerracottaProj.cs b/Projectiles/Healing/TerracottaProj.cs index 34aec083e1..b40dda0f6a 100644 --- a/Projectiles/Healing/TerracottaProj.cs +++ b/Projectiles/Healing/TerracottaProj.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Healing float num491 = (float)Math.Sqrt((double)(num489 * num489 + num490 * num490)); if (num491 < 50f && projectile.position.X < Main.player[num487].position.X + (float)Main.player[num487].width && projectile.position.X + (float)projectile.width > Main.player[num487].position.X && projectile.position.Y < Main.player[num487].position.Y + (float)Main.player[num487].height && projectile.position.Y + (float)projectile.height > Main.player[num487].position.Y) { - if (projectile.owner == Main.myPlayer) + if (projectile.owner == Main.myPlayer && !Main.player[Main.myPlayer].moonLeech) { int num492 = 9; Main.player[num487].HealEffect(num492, false); diff --git a/Projectiles/Magic/ForbiddenSunburst.cs b/Projectiles/Magic/ForbiddenSunburst.cs index f33abe16d7..7fb386a91a 100644 --- a/Projectiles/Magic/ForbiddenSunburst.cs +++ b/Projectiles/Magic/ForbiddenSunburst.cs @@ -39,28 +39,6 @@ namespace CalamityMod.Projectiles.Magic Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); projectile.localAI[0] += 1f; } - bool flag15 = false; - bool flag16 = false; - if (projectile.velocity.X < 0f && projectile.position.X < projectile.ai[0]) - { - flag15 = true; - } - if (projectile.velocity.X > 0f && projectile.position.X > projectile.ai[0]) - { - flag15 = true; - } - if (projectile.velocity.Y < 0f && projectile.position.Y < projectile.ai[1]) - { - flag16 = true; - } - if (projectile.velocity.Y > 0f && projectile.position.Y > projectile.ai[1]) - { - flag16 = true; - } - if (flag15 && flag16) - { - projectile.Kill(); - } float num461 = 25f; if (projectile.ai[0] > 180f) { diff --git a/Projectiles/Magic/HellfireExplosionFriendly.cs b/Projectiles/Magic/HellfireExplosionFriendly.cs index 2a7b33ef15..8eccc4e316 100644 --- a/Projectiles/Magic/HellfireExplosionFriendly.cs +++ b/Projectiles/Magic/HellfireExplosionFriendly.cs @@ -34,28 +34,6 @@ namespace CalamityMod.Projectiles.Magic Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); projectile.localAI[0] += 1f; } - bool flag15 = false; - bool flag16 = false; - if (projectile.velocity.X < 0f && projectile.position.X < projectile.ai[0]) - { - flag15 = true; - } - if (projectile.velocity.X > 0f && projectile.position.X > projectile.ai[0]) - { - flag15 = true; - } - if (projectile.velocity.Y < 0f && projectile.position.Y < projectile.ai[1]) - { - flag16 = true; - } - if (projectile.velocity.Y > 0f && projectile.position.Y > projectile.ai[1]) - { - flag16 = true; - } - if (flag15 && flag16) - { - projectile.Kill(); - } float num461 = 25f; if (projectile.ai[0] > 180f) { diff --git a/Projectiles/Magic/HellfireExplosionFriendly2.cs b/Projectiles/Magic/HellfireExplosionFriendly2.cs index 4ecd6564ff..aeb3b89c0f 100644 --- a/Projectiles/Magic/HellfireExplosionFriendly2.cs +++ b/Projectiles/Magic/HellfireExplosionFriendly2.cs @@ -32,28 +32,6 @@ namespace CalamityMod.Projectiles.Magic Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); projectile.localAI[0] += 1f; } - bool flag15 = false; - bool flag16 = false; - if (projectile.velocity.X < 0f && projectile.position.X < projectile.ai[0]) - { - flag15 = true; - } - if (projectile.velocity.X > 0f && projectile.position.X > projectile.ai[0]) - { - flag15 = true; - } - if (projectile.velocity.Y < 0f && projectile.position.Y < projectile.ai[1]) - { - flag16 = true; - } - if (projectile.velocity.Y > 0f && projectile.position.Y > projectile.ai[1]) - { - flag16 = true; - } - if (flag15 && flag16) - { - projectile.Kill(); - } float num461 = 25f; if (projectile.ai[0] > 180f) { diff --git a/Projectiles/Magic/SHPExplosion.cs b/Projectiles/Magic/SHPExplosion.cs index d979cd68e9..9472252545 100644 --- a/Projectiles/Magic/SHPExplosion.cs +++ b/Projectiles/Magic/SHPExplosion.cs @@ -30,28 +30,6 @@ namespace CalamityMod.Projectiles.Magic float num = (float)Main.rand.Next(90, 111) * 0.01f; num *= Main.essScale; Lighting.AddLight(projectile.Center, 5f * num, 1f * num, 4f * num); - bool flag15 = false; - bool flag16 = false; - if (projectile.velocity.X < 0f && projectile.position.X < projectile.ai[0]) - { - flag15 = true; - } - if (projectile.velocity.X > 0f && projectile.position.X > projectile.ai[0]) - { - flag15 = true; - } - if (projectile.velocity.Y < 0f && projectile.position.Y < projectile.ai[1]) - { - flag16 = true; - } - if (projectile.velocity.Y > 0f && projectile.position.Y > projectile.ai[1]) - { - flag16 = true; - } - if (flag15 && flag16) - { - projectile.Kill(); - } float num461 = 25f; if (projectile.ai[0] > 180f) { @@ -99,7 +77,6 @@ namespace CalamityMod.Projectiles.Magic Main.dust[num467].velocity.Y = num464; num462++; } - return; } } } diff --git a/Projectiles/Magic/VenusianExplosion.cs b/Projectiles/Magic/VenusianExplosion.cs index 2cd4168fd6..5355fa8dcf 100644 --- a/Projectiles/Magic/VenusianExplosion.cs +++ b/Projectiles/Magic/VenusianExplosion.cs @@ -35,28 +35,6 @@ namespace CalamityMod.Projectiles.Magic Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 74); projectile.localAI[0] += 1f; } - bool flag15 = false; - bool flag16 = false; - if (projectile.velocity.X < 0f && projectile.position.X < projectile.ai[0]) - { - flag15 = true; - } - if (projectile.velocity.X > 0f && projectile.position.X > projectile.ai[0]) - { - flag15 = true; - } - if (projectile.velocity.Y < 0f && projectile.position.Y < projectile.ai[1]) - { - flag16 = true; - } - if (projectile.velocity.Y > 0f && projectile.position.Y > projectile.ai[1]) - { - flag16 = true; - } - if (flag15 && flag16) - { - projectile.Kill(); - } float num461 = 25f; if (projectile.ai[0] > 180f) { diff --git a/Projectiles/Melee/EssenceFlame2.png b/Projectiles/Melee/EssenceFlame2.png index 2ef4c2dba5..3009ead213 100644 Binary files a/Projectiles/Melee/EssenceFlame2.png and b/Projectiles/Melee/EssenceFlame2.png differ diff --git a/Projectiles/Melee/EssenceScythe.cs b/Projectiles/Melee/EssenceScythe.cs index 54e2427eec..eea65cb06c 100644 --- a/Projectiles/Melee/EssenceScythe.cs +++ b/Projectiles/Melee/EssenceScythe.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Melee float num473 = projectile.Center.Y; float num474 = 600f; bool flag17 = false; - for (int num475 = 0; num475 < 200; num475++) + for (int num475 = 0; num475 < Main.npc.Length; num475++) { if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1)) { diff --git a/Projectiles/Melee/ExoGladComet.cs b/Projectiles/Melee/ExoGladComet.cs new file mode 100644 index 0000000000..80ffa279c7 --- /dev/null +++ b/Projectiles/Melee/ExoGladComet.cs @@ -0,0 +1,117 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Melee +{ + public class ExoGladComet : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Comet"); + Main.projFrames[projectile.type] = 5; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 10; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } + + public override void SetDefaults() + { + projectile.width = 12; + projectile.height = 12; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.melee = true; + projectile.penetrate = 1; + projectile.alpha = 50; + } + + public override void AI() + { + projectile.frameCounter++; + if (projectile.frameCounter > 5) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 4) + { + projectile.frame = 0; + } + if (projectile.timeLeft > 30 && projectile.alpha > 0) + { + projectile.alpha -= 25; + } + if (projectile.timeLeft > 30 && projectile.alpha < 128 && Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) + { + projectile.alpha = 128; + } + if (projectile.alpha < 0) + { + projectile.alpha = 0; + } + if (projectile.alpha < 40) + { + int num309 = Dust.NewDust(new Vector2(projectile.position.X - projectile.velocity.X * 4f + 2f, projectile.position.Y + 2f - projectile.velocity.Y * 4f), 8, 8, 107, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, new Color(0, 255, 255), 0.5f); + Main.dust[num309].velocity *= -0.25f; + num309 = Dust.NewDust(new Vector2(projectile.position.X - projectile.velocity.X * 4f + 2f, projectile.position.Y + 2f - projectile.velocity.Y * 4f), 8, 8, 107, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, new Color(0, 255, 255), 0.5f); + Main.dust[num309].velocity *= -0.25f; + Main.dust[num309].position -= projectile.velocity * 0.5f; + } + Lighting.AddLight(projectile.Center, 0f, 0.5f, 0.5f); + projectile.velocity *= 1.005f; + + projectile.spriteDirection = projectile.direction = (projectile.velocity.X > 0).ToDirectionInt(); + projectile.rotation = projectile.velocity.ToRotation() + (projectile.spriteDirection == 1 ? 0f : MathHelper.Pi) + MathHelper.ToRadians(90) * projectile.direction; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.CursedInferno, 120); + target.AddBuff(BuffID.Frostburn, 120); + target.AddBuff(BuffID.OnFire, 120); + target.AddBuff(BuffID.Ichor, 120); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + + public override Color? GetAlpha(Color lightColor) + { + return new Color(0, 255, 255, projectile.alpha); + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(29, (int)projectile.position.X, (int)projectile.position.Y, 103, 1f, 0f); + projectile.position = projectile.Center; + projectile.width = projectile.height = 80; + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + for (int num193 = 0; num193 < 2; num193++) + { + Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 100, new Color(0, 255, 255), 1.5f); + } + for (int num194 = 0; num194 < 20; num194++) + { + int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 0, new Color(0, 255, 255), 2.5f); + Main.dust[num195].noGravity = true; + Main.dust[num195].velocity *= 3f; + num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 100, new Color(0, 255, 255), 1.5f); + Main.dust[num195].velocity *= 2f; + Main.dust[num195].noGravity = true; + } + } + } +} diff --git a/Projectiles/Melee/ExoGladComet.png b/Projectiles/Melee/ExoGladComet.png new file mode 100644 index 0000000000..abdb698535 Binary files /dev/null and b/Projectiles/Melee/ExoGladComet.png differ diff --git a/Projectiles/Melee/ExoGladProj.cs b/Projectiles/Melee/ExoGladProj.cs new file mode 100644 index 0000000000..d2ebdcf12e --- /dev/null +++ b/Projectiles/Melee/ExoGladProj.cs @@ -0,0 +1,168 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Melee +{ + public class ExoGladProj : ModProjectile + { + private float counter = 0f; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Orb"); + } + + public override void SetDefaults() + { + projectile.width = 10; + projectile.height = 10; + projectile.friendly = true; + projectile.melee = true; + projectile.penetrate = 1; + projectile.tileCollide = false; + projectile.timeLeft = 300; + } + + public override void AI() + { + Vector2 value7 = new Vector2(5f, 10f); + counter += 1f; + if (counter == 48f) + { + counter = 0f; + } + else + { + for (int num41 = 0; num41 < 2; num41++) + { + int dustType = num41 == 0 ? 107 : 234; + if (Main.rand.NextBool(4)) + { + dustType = 269; + } + Vector2 value8 = Vector2.UnitX * -12f; + value8 = -Vector2.UnitY.RotatedBy((double)(counter * 0.1308997f + (float)num41 * 3.14159274f), default) * value7; + int num42 = Dust.NewDust(projectile.Center, 0, 0, dustType, 0f, 0f, 160, default, 1.5f); + Main.dust[num42].noGravity = true; + Main.dust[num42].position = projectile.Center + value8; + Main.dust[num42].velocity = projectile.velocity; + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 0.8f); + Main.dust[num458].noGravity = true; + Main.dust[num458].velocity *= 0f; + } + } + + float num472 = projectile.Center.X; + float num473 = projectile.Center.Y; + float num474 = 1000f; + bool flag17 = false; + for (int num475 = 0; num475 < Main.npc.Length; num475++) + { + if (Main.npc[num475].CanBeChasedBy(projectile, false)) + { + 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) + { + num474 = num478; + num472 = num476; + num473 = num477; + flag17 = true; + } + } + } + if (flag17) + { + float num483 = 36f; + Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float num484 = num472 - vector35.X; + float num485 = num473 - vector35.Y; + float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485)); + num486 = num483 / num486; + num484 *= num486; + num485 *= num486; + projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f; + projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f; + } + } + + public override void Kill(int timeLeft) + { + int dustType = Utils.SelectRandom(Main.rand, new int[] + { + 107, + 234, + 269 + }); + for (int k = 0; k < 4; k++) + { + int num = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, dustType, (float)(projectile.direction * 2), 0f, 150, default, 1f); + Main.dust[num].noGravity = true; + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + int type = ModContent.ProjectileType(); + int numSwords = Main.rand.Next(1,4); + float swordKB = projectile.knockBack; + for (int i = 0; i < numSwords; ++i) + { + float startOffsetX = Main.rand.NextFloat(1000f, 1400f) * (Main.rand.NextBool() ? -1f : 1f); + float startOffsetY = Main.rand.NextFloat(80f, 900f) * (Main.rand.NextBool() ? -1f : 1f); + Vector2 startPos = new Vector2(target.Center.X + startOffsetX, target.Center.Y + startOffsetY); + float dx = target.Center.X - startPos.X; + float dy = target.Center.Y - startPos.Y; + + dx += Main.rand.NextFloat(-5f, 5f); + dy += Main.rand.NextFloat(-5f, 5f); + float speed = Main.rand.NextFloat(24f, 30f); + float dist = (float)Math.Sqrt((double)(dx * dx + dy * dy)); + dist = speed / dist; + dx *= dist; + dy *= dist; + Vector2 swordVel = new Vector2(dx, dy); + float angle = Main.rand.NextFloat(MathHelper.TwoPi); + if (projectile.owner == Main.myPlayer) + { + int idx = Projectile.NewProjectile(startPos, swordVel, type, (int)((double)projectile.damage * 0.25), swordKB, projectile.owner, 0f, 0f); + Main.projectile[idx].rotation = angle; + } + } + + int spearAmt = Main.rand.Next(1,4); + for (int n = 0; n < spearAmt; n++) + { + float x = projectile.position.X + (float)Main.rand.Next(-400, 400); + float y = projectile.position.Y + (float)Main.rand.Next(800, 1000); + Vector2 vector = new Vector2(x, y); + float num13 = projectile.position.X + (float)(projectile.width / 2) - vector.X; + float num14 = projectile.position.Y + (float)(projectile.height / 2) - vector.Y; + num13 += (float)Main.rand.Next(-100, 101); + int num15 = 29; + float num16 = (float)Math.Sqrt((double)(num13 * num13 + num14 * num14)); + num16 = (float)num15 / num16; + num13 *= num16; + num14 *= num16; + int num17 = Projectile.NewProjectile(x, y, num13, num14, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.5), swordKB, projectile.owner, 0f, 0f); + } + + target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.CursedInferno, 120); + target.AddBuff(BuffID.Frostburn, 120); + target.AddBuff(BuffID.OnFire, 120); + target.AddBuff(BuffID.Ichor, 120); + } + } +} diff --git a/Projectiles/Melee/ExoGladProj.png b/Projectiles/Melee/ExoGladProj.png new file mode 100644 index 0000000000..0056fc1e24 Binary files /dev/null and b/Projectiles/Melee/ExoGladProj.png differ diff --git a/Projectiles/Melee/ExoGladSpears.cs b/Projectiles/Melee/ExoGladSpears.cs new file mode 100644 index 0000000000..3cd9a5a5ae --- /dev/null +++ b/Projectiles/Melee/ExoGladSpears.cs @@ -0,0 +1,181 @@ +using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.DamageOverTime; +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.Melee +{ + public class ExoGladSpears : ModProjectile + { + private Color currentColor = Color.Black; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gladius Beam"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 7; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } + + public override void SetDefaults() + { + projectile.width = 28; + projectile.height = 28; + projectile.friendly = true; + projectile.timeLeft = 600; + projectile.melee = true; + projectile.tileCollide = false; + projectile.extraUpdates = 1; + } + + public override void AI() + { + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 0.785f; + float num953 = 25f * projectile.ai[1]; //100 + float scaleFactor12 = 5f * projectile.ai[1]; //5 + float num954 = 1000f; + if (Main.player[projectile.owner].active && !Main.player[projectile.owner].dead) + { + float num472 = projectile.Center.X; + float num473 = projectile.Center.Y; + float num474 = 1000f; + bool flag17 = false; + for (int num475 = 0; num475 < Main.npc.Length; num475++) + { + if (Main.npc[num475].CanBeChasedBy(projectile, false)) + { + 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) + { + num474 = num478; + num472 = num476; + num473 = num477; + flag17 = true; + } + } + } + if (flag17) + { + float num483 = 9f; + Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float num484 = num472 - vector35.X; + float num485 = num473 - vector35.Y; + float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485)); + num486 = num483 / num486; + num484 *= num486; + num485 *= num486; + projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f; + projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f; + } + else if (projectile.Distance(Main.player[projectile.owner].Center) > num954) + { + Vector2 vector102 = projectile.DirectionTo(Main.player[projectile.owner].Center); + if (vector102.HasNaNs()) + { + vector102 = Vector2.UnitY; + } + projectile.velocity = (projectile.velocity * (num953 - 1f) + vector102 * scaleFactor12) / num953; + } + } + else + { + if (projectile.timeLeft > 30) + { + projectile.timeLeft = 30; + } + } + + Lighting.AddLight(projectile.Center, Main.DiscoR * 0.5f / 255f, Main.DiscoG * 0.5f / 255f, Main.DiscoB * 0.5f / 255f); + if (currentColor == Color.Black) + { + int startPoint = Main.rand.Next(6); + projectile.localAI[0] = startPoint; + currentColor = GetStartingColor(startPoint); + } + Visuals(projectile, ref currentColor); + } + + internal static void Visuals(Projectile projectile, ref Color c) + { + CalamityUtils.IterateDisco(ref c, ref projectile.localAI[0], 15); + Vector3 compositeColor = 0.1f * Color.White.ToVector3() + 0.05f * c.ToVector3(); + Lighting.AddLight(projectile.Center, compositeColor); + } + + internal static Color GetStartingColor(int startPoint = 0) + { + switch (startPoint) + { + default: return new Color(1f, 0f, 0f, 0f); // Color.Red + case 1: return new Color(1f, 1f, 0f, 0f); // Color.Yellow + case 2: return new Color(0f, 1f, 0f, 0f); // Color.Green + case 3: return new Color(0f, 1f, 1f, 0f); // Color.Turquoise + case 4: return new Color(0f, 0f, 1f, 0f); // Color.Blue + case 5: return new Color(1f, 0f, 1f, 0f); // Color.Violet + } + } + + // This projectile is always fullbright. + public override Color? GetAlpha(Color lightColor) + { + return currentColor; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + + public override void Kill(int timeLeft) + { + projectile.position = projectile.Center; + projectile.width = projectile.height = 64; + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.maxPenetrate = -1; + projectile.penetrate = -1; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + projectile.Damage(); + Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 74, 1f, 0f); + int dustType = Utils.SelectRandom(Main.rand, new int[] + { + 107, + 234, + 269 + }); + for (int num193 = 0; num193 < 6; num193++) + { + Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0, 0); + } + for (int num194 = 0; num194 < 10; num194++) + { + int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0, 0); + Main.dust[num195].noGravity = true; + Main.dust[num195].velocity *= 3f; + num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0, 0); + Main.dust[num195].velocity *= 2f; + Main.dust[num195].noGravity = true; + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.CursedInferno, 120); + target.AddBuff(BuffID.Frostburn, 120); + target.AddBuff(BuffID.OnFire, 120); + target.AddBuff(BuffID.Ichor, 120); + } + } +} diff --git a/Projectiles/Melee/ExoGladSpears.png b/Projectiles/Melee/ExoGladSpears.png new file mode 100644 index 0000000000..e1c9f0323b Binary files /dev/null and b/Projectiles/Melee/ExoGladSpears.png differ diff --git a/Projectiles/Melee/ExoGladiusBeam.cs b/Projectiles/Melee/ExoGladiusBeam.cs new file mode 100644 index 0000000000..6d2f50bedf --- /dev/null +++ b/Projectiles/Melee/ExoGladiusBeam.cs @@ -0,0 +1,133 @@ +using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.DamageOverTime; +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.Melee +{ + public class ExoGladiusBeam : ModProjectile + { + private int penetrationAmt = 6; + private Color currentColor = Color.Black; + public const float maxScale = 1.8f; + public bool initialized = false; + public float startYVelSign = 0f; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gladius Beam"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 4; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } + + public override void SetDefaults() + { + projectile.width = 28; + projectile.height = 28; + projectile.friendly = true; + projectile.penetrate = penetrationAmt; + projectile.timeLeft = 290; + projectile.melee = true; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 15; + projectile.extraUpdates = 1; + projectile.tileCollide = false; + } + + public override void AI() + { + if (!initialized) + { + startYVelSign = (float)Math.Sign(projectile.velocity.Y) * 0.35f; + initialized = true; + } + if (projectile.penetrate == penetrationAmt && projectile.timeLeft < 245) + { + projectile.velocity.Y -= startYVelSign; //arc on the X axis (the amount of pressure on this tiny detail made me want to tear my head off) + if (Math.Abs(projectile.velocity.X) < 30f) + { + projectile.velocity.X *= 1.04f; + } + } + if (projectile.velocity.Length() != 0) + { + projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + MathHelper.Pi / 4; + } + else + { + projectile.rotation += MathHelper.Pi / 6f / (projectile.scale * 2.5f); + } + projectile.ai[0]++; + if (projectile.ai[1] >= 0) + { + projectile.ai[1]--; + if (projectile.ai[1] == 0) + { + projectile.velocity *= -0.9f; + } + } + + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 0.785f; + Lighting.AddLight(projectile.Center, Main.DiscoR * 0.5f / 255f, Main.DiscoG * 0.5f / 255f, Main.DiscoB * 0.5f / 255f); + if (currentColor == Color.Black) + { + int startPoint = Main.rand.Next(6); + projectile.localAI[0] = startPoint; + currentColor = GetStartingColor(startPoint); + } + Visuals(projectile, ref currentColor); + } + + internal static void Visuals(Projectile projectile, ref Color c) + { + CalamityUtils.IterateDisco(ref c, ref projectile.localAI[0], 15); + Vector3 compositeColor = 0.1f * Color.White.ToVector3() + 0.05f * c.ToVector3(); + Lighting.AddLight(projectile.Center, compositeColor); + } + + internal static Color GetStartingColor(int startPoint = 0) + { + switch (startPoint) + { + default: return new Color(1f, 0f, 0f, 0f); // Color.Red + case 1: return new Color(1f, 1f, 0f, 0f); // Color.Yellow + case 2: return new Color(0f, 1f, 0f, 0f); // Color.Green + case 3: return new Color(0f, 1f, 1f, 0f); // Color.Turquoise + case 4: return new Color(0f, 0f, 1f, 0f); // Color.Blue + case 5: return new Color(1f, 0f, 1f, 0f); // Color.Violet + } + } + + // This projectile is always fullbright. + public override Color? GetAlpha(Color lightColor) + { + return currentColor; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + projectile.scale += (maxScale - 1) / (float)penetrationAmt; + projectile.ai[1] = 5 + Main.rand.Next(-2, 3); + + target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.CursedInferno, 120); + target.AddBuff(BuffID.Frostburn, 120); + target.AddBuff(BuffID.OnFire, 120); + target.AddBuff(BuffID.Ichor, 120); + } + } +} diff --git a/Projectiles/Melee/ExoGladiusBeam.png b/Projectiles/Melee/ExoGladiusBeam.png new file mode 100644 index 0000000000..e1c9f0323b Binary files /dev/null and b/Projectiles/Melee/ExoGladiusBeam.png differ diff --git a/Projectiles/Rogue/GodsParanoiaProj.cs b/Projectiles/Rogue/GodsParanoiaProj.cs index 93dd511324..a47f751f5b 100644 --- a/Projectiles/Rogue/GodsParanoiaProj.cs +++ b/Projectiles/Rogue/GodsParanoiaProj.cs @@ -85,10 +85,7 @@ namespace CalamityMod.Projectiles.Rogue } int num988 = 15; bool flag55 = false; - float[] var_2_2CB4E_cp_0 = projectile.localAI; - int var_2_2CB4E_cp_1 = 0; - float num73 = var_2_2CB4E_cp_0[var_2_2CB4E_cp_1]; - var_2_2CB4E_cp_0[var_2_2CB4E_cp_1] = num73 + 1f; + projectile.localAI[0] += 1f; if (projectile.localAI[0] % 30f == 0f) { flag55 = true; @@ -115,7 +112,7 @@ namespace CalamityMod.Projectiles.Rogue float pcy = projectile.Center.Y; float var1 = 800f; bool flag = false; - for (int npcvar = 0; npcvar < 200; npcvar++) + for (int npcvar = 0; npcvar < Main.npc.Length; npcvar++) { if (Main.npc[npcvar].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[npcvar].Center, 1, 1)) { @@ -160,7 +157,7 @@ namespace CalamityMod.Projectiles.Rogue Rectangle myRect = new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height); if (projectile.owner == Main.myPlayer) { - for (int i = 0; i < 200; i++) + for (int i = 0; i < Main.npc.Length; i++) { if (Main.npc[i].active && !Main.npc[i].dontTakeDamage && ((projectile.friendly && (!Main.npc[i].friendly || projectile.type == 318 || (Main.npc[i].type == 22 && projectile.owner < 255 && Main.player[projectile.owner].killGuide) || (Main.npc[i].type == 54 && projectile.owner < 255 && Main.player[projectile.owner].killClothier))) || diff --git a/Projectiles/Rogue/ShatteredSun2.cs b/Projectiles/Rogue/ShatteredSun2.cs deleted file mode 100644 index b7f51939e0..0000000000 --- a/Projectiles/Rogue/ShatteredSun2.cs +++ /dev/null @@ -1,86 +0,0 @@ -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 ShatteredSun2 : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Shattered Sun"); - ProjectileID.Sets.TrailCacheLength[projectile.type] = 4; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - } - - public override void SetDefaults() - { - projectile.width = 56; - projectile.height = 56; - projectile.friendly = true; - projectile.penetrate = 3; - projectile.timeLeft = 300; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 15; - projectile.Calamity().rogue = true; - } - - public override void AI() - { - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 2.355f; - if (projectile.spriteDirection == -1) - { - projectile.rotation -= 1.57f; - } - projectile.ai[1] += 1f; - if (projectile.ai[1] == 8f) - { - int numProj = 2; - float rotation = MathHelper.ToRadians(10); - if (projectile.owner == Main.myPlayer) - { - for (int i = 0; i < numProj; i++) - { - Vector2 perturbedSpeed = new Vector2(projectile.velocity.X, projectile.velocity.Y).RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numProj - 1))); - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, perturbedSpeed.X, perturbedSpeed.Y, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.5f), projectile.knockBack, projectile.owner, 0f, 0f); - } - projectile.active = false; - } - } - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - if (projectile.timeLeft > 299) - return false; - - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); - return false; - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); - } - - public override bool OnTileCollide(Vector2 oldVelocity) - { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); - return true; - } - - public override void Kill(int timeLeft) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); - for (int k = 0; k < 5; k++) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 246, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f, 0, default, 1f); - } - } - } -} diff --git a/Projectiles/Rogue/ShatteredSun2.png b/Projectiles/Rogue/ShatteredSun2.png deleted file mode 100644 index 95bfbda427..0000000000 Binary files a/Projectiles/Rogue/ShatteredSun2.png and /dev/null differ diff --git a/Projectiles/Rogue/ShatteredSun3.cs b/Projectiles/Rogue/ShatteredSun3.cs deleted file mode 100644 index 42bf1b87a6..0000000000 --- a/Projectiles/Rogue/ShatteredSun3.cs +++ /dev/null @@ -1,101 +0,0 @@ -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 ShatteredSun3 : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Shattered Sun"); - ProjectileID.Sets.TrailCacheLength[projectile.type] = 4; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - } - - public override void SetDefaults() - { - projectile.width = 56; - projectile.height = 56; - projectile.friendly = true; - projectile.penetrate = 1; - projectile.timeLeft = 300; - projectile.Calamity().rogue = true; - } - - public override void AI() - { - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 2.355f; - if (projectile.spriteDirection == -1) - { - projectile.rotation -= 1.57f; - } - float centerX = projectile.Center.X; - float centerY = projectile.Center.Y; - float num474 = 750f; - bool homeIn = false; - for (int i = 0; i < 200; i++) - { - if (Main.npc[i].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[i].Center, 1, 1)) - { - float num476 = Main.npc[i].position.X + (float)(Main.npc[i].width / 2); - float num477 = Main.npc[i].position.Y + (float)(Main.npc[i].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) - { - num474 = num478; - centerX = num476; - centerY = num477; - homeIn = true; - } - } - } - if (homeIn) - { - float num483 = 20f; - Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num484 = centerX - vector35.X; - float num485 = centerY - vector35.Y; - float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485)); - num486 = num483 / num486; - num484 *= num486; - num485 *= num486; - projectile.velocity.X = (projectile.velocity.X * 15f + num484) / 16f; - projectile.velocity.Y = (projectile.velocity.Y * 15f + num485) / 16f; - } - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - if (projectile.timeLeft > 299) - return false; - - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); - return false; - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); - } - - public override bool OnTileCollide(Vector2 oldVelocity) - { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); - return true; - } - - public override void Kill(int timeLeft) - { - for (int k = 0; k < 5; k++) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 246, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f, 0, default, 1f); - } - } - } -} diff --git a/Projectiles/Rogue/ShatteredSun3.png b/Projectiles/Rogue/ShatteredSun3.png deleted file mode 100644 index 95bfbda427..0000000000 Binary files a/Projectiles/Rogue/ShatteredSun3.png and /dev/null differ diff --git a/Projectiles/Rogue/ShatteredSunFireball.cs b/Projectiles/Rogue/ShatteredSunFireball.cs new file mode 100644 index 0000000000..e66da48de1 --- /dev/null +++ b/Projectiles/Rogue/ShatteredSunFireball.cs @@ -0,0 +1,230 @@ +using CalamityMod.Buffs.DamageOverTime; +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 ShatteredSunFireball : ModProjectile + { + int counter = 0; + float multiplier = 1f; + Vector2 originalVelocity; + bool stealthOrigin = false; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Flare"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 2; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + Main.projFrames[projectile.type] = 3; + } + + public override void SetDefaults() + { + projectile.width = 42; + projectile.height = 42; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.extraUpdates = 1; + projectile.penetrate = 1; + projectile.Calamity().rogue = true; + projectile.tileCollide = false; + projectile.timeLeft = 500; + } + + public override void AI() + { + + counter++; + if (counter == 1) + { + stealthOrigin = projectile.ai[0] == 1f; + projectile.ai[0] = 0f; + originalVelocity = projectile.velocity; + } + if (counter == 20 && !projectile.Calamity().stealthStrike && !stealthOrigin) + { + projectile.tileCollide = true; + } + if (counter % 5 == 0) + { + multiplier -= 0.07f; + projectile.velocity *= 1.1f; + } + projectile.frameCounter++; + if (projectile.frameCounter > 8) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 2) + { + projectile.frame = 0; + } + + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + + Lighting.AddLight(projectile.Center, 0.7f, 0.3f, 0f); + float num472 = projectile.Center.X; + float num473 = projectile.Center.Y; + float num474 = 400f; + bool flag17 = false; + for (int num475 = 0; num475 < 200; num475++) + { + if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1)) + { + 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) + { + num474 = num478; + num472 = num476; + num473 = num477; + flag17 = true; + } + } + } + if (flag17) + { + float num483 = 20f; + Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float num484 = num472 - vector35.X; + float num485 = num473 - vector35.Y; + float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485)); + num486 = num483 / num486; + num484 *= num486; + num485 *= num486; + projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f; + projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f; + } + float num633 = 700f; + Vector2 vector46 = projectile.position; + bool flag25 = false; + for (int num645 = 0; num645 < 200; num645++) + { + NPC nPC2 = Main.npc[num645]; + if (nPC2.CanBeChasedBy(projectile, false)) + { + float num646 = Vector2.Distance(nPC2.Center, projectile.Center); + if (!flag25) + { + num633 = num646; + vector46 = nPC2.Center; + flag25 = true; + } + } + } + if (flag25 && projectile.ai[0] == 0f) + { + Vector2 vector47 = vector46 - projectile.Center; + float num648 = vector47.Length(); + vector47.Normalize(); + if (num648 > 200f) + { + float scaleFactor2 = 8f; + vector47 *= scaleFactor2; + projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; + } + else + { + float num649 = 4f; + vector47 *= -num649; + projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; + } + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + damage = (int)((double)damage * multiplier); + if (projectile.Calamity().stealthStrike) + { + int numProj = 3; + float rotation = MathHelper.ToRadians(10); + if (projectile.owner == Main.myPlayer) + { + int spread = 6; + for (int i = 0; i < numProj; i++) + { + Vector2 perturbedspeed = new Vector2(originalVelocity.X, originalVelocity.Y + Main.rand.Next(-3, 4)).RotatedBy(MathHelper.ToRadians(spread)); + Vector2 position = Main.player[projectile.owner].position; + int proj = Projectile.NewProjectile(position.X, position.Y - 10, perturbedspeed.X, perturbedspeed.Y, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.3), 1f, projectile.owner, 0f, 0f); + spread -= Main.rand.Next(2, 6); + Main.projectile[proj].ai[0] = 1f; + } + projectile.active = false; + } + } + target.AddBuff(ModContent.BuffType(), 180); + } + + public override void Kill(int timeLeft) + { + + Main.PlaySound(2, (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 = 200; + 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 < 4; num621++) + { + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 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 < 12; num623++) + { + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f); + 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, 244, 0f, 0f, 100, default, 2f); + Main.dust[num624].velocity *= 2f; + } + for (int num625 = 0; num625 < 3; num625++) + { + float scaleFactor10 = 0.33f; + if (num625 == 1) + { + scaleFactor10 = 0.66f; + } + if (num625 == 2) + { + scaleFactor10 = 1f; + } + int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); + Gore gore = Main.gore[num626]; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y += 1f; + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y += 1f; + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y -= 1f; + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y -= 1f; + } + } + } +} diff --git a/Projectiles/Rogue/ShatteredSunFireball.png b/Projectiles/Rogue/ShatteredSunFireball.png new file mode 100644 index 0000000000..ca9b1d8ac6 Binary files /dev/null and b/Projectiles/Rogue/ShatteredSunFireball.png differ diff --git a/Projectiles/Rogue/ShatteredSunKnife.cs b/Projectiles/Rogue/ShatteredSunKnife.cs index e6b6337304..72f6a40d4c 100644 --- a/Projectiles/Rogue/ShatteredSunKnife.cs +++ b/Projectiles/Rogue/ShatteredSunKnife.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.width = 56; projectile.height = 56; projectile.friendly = true; - projectile.penetrate = 3; + projectile.penetrate = 4; projectile.timeLeft = 300; projectile.alpha = 255; projectile.tileCollide = false; @@ -48,18 +48,40 @@ namespace CalamityMod.Projectiles.Rogue projectile.tileCollide = false; } - if (projectile.ai[1] == 12f) + if (projectile.ai[1] == 25f) { - int numProj = 2; + int numProj = 5; float rotation = MathHelper.ToRadians(10); if (projectile.owner == Main.myPlayer) { + int spread = 6; for (int i = 0; i < numProj; i++) { - Vector2 perturbedSpeed = new Vector2(projectile.velocity.X, projectile.velocity.Y).RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numProj - 1))); - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, perturbedSpeed.X, perturbedSpeed.Y, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + Vector2 perturbedspeed = new Vector2(projectile.velocity.X, projectile.velocity.Y + Main.rand.Next(-3, 4)).RotatedBy(MathHelper.ToRadians(spread)); + int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, perturbedspeed.X * 0.2f, perturbedspeed.Y * 0.2f, ModContent.ProjectileType(), (int)((double)projectile.damage * 1.5), 1f, projectile.owner, 0f, 0f); + Main.projectile[proj].Calamity().stealthStrike = projectile.Calamity().stealthStrike; + spread -= Main.rand.Next(2, 6); } + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); projectile.active = false; + for (int num621 = 0; num621 < 8; num621++) + { + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default, 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 < 16; num623++) + { + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default, 3f); + 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, 2f); + Main.dust[num624].velocity *= 2f; + } } } } diff --git a/Projectiles/Rogue/SupernovaBomb.cs b/Projectiles/Rogue/SupernovaBomb.cs index 68d210d41d..2a765c4096 100644 --- a/Projectiles/Rogue/SupernovaBomb.cs +++ b/Projectiles/Rogue/SupernovaBomb.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Projectiles.Rogue { if (projectile.owner == Main.myPlayer) { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, projectile.velocity.X * 0f, 2f, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.6), projectile.knockBack, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, projectile.velocity.X * 0f, 2f, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.8), projectile.knockBack, projectile.owner, 0f, 0f); } stealthTimer = 8; } diff --git a/Projectiles/Summon/ApexShark.cs b/Projectiles/Summon/ApexShark.cs index 9e95eca1b8..5cfbc78dad 100644 --- a/Projectiles/Summon/ApexShark.cs +++ b/Projectiles/Summon/ApexShark.cs @@ -278,7 +278,7 @@ namespace CalamityMod.Projectiles.Summon { Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 70, 0.5f); projectile.velocity = new Vector2(0f, 5f).RotatedBy(projectile.velocity.ToRotation() + 1.5f); - int sand = Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), projectile.damage, 5f, projectile.owner, 0f, 0f); + int sand = Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(projectile.damage * 0.7f), (int)(projectile.knockBack * 0.7f), projectile.owner, 0f, 0f); Main.projectile[sand].Center = projectile.Center; projectile.netUpdate = true; HitCooldown = 20; diff --git a/Projectiles/Summon/DreadmineTurret.cs b/Projectiles/Summon/DreadmineTurret.cs index 95e05019d3..40799af0d4 100644 --- a/Projectiles/Summon/DreadmineTurret.cs +++ b/Projectiles/Summon/DreadmineTurret.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Summon if (Main.rand.NextBool(15)) { int num = 0; - for (int i = 0; i < 1000; i++) + for (int i = 0; i < Main.projectile.Length; i++) { if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == ModContent.ProjectileType()) { diff --git a/Projectiles/Summon/LanternFlame.cs b/Projectiles/Summon/LanternFlame.cs new file mode 100644 index 0000000000..48ed31a2fb --- /dev/null +++ b/Projectiles/Summon/LanternFlame.cs @@ -0,0 +1,141 @@ +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Summon +{ + public class LanternFlame : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Flame"); + Main.projFrames[projectile.type] = 4; + } + + public override void SetDefaults() + { + projectile.width = 20; + projectile.height = 20; + projectile.friendly = true; + projectile.minion = true; + projectile.penetrate = 1; + projectile.timeLeft = 600; + projectile.alpha = 255; + projectile.tileCollide = false; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.5f / 255f, (255 - projectile.alpha) * 0f / 255f, (255 - projectile.alpha) * 0.65f / 255f); + projectile.frameCounter++; + if (projectile.frameCounter > 4) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 3) + { + projectile.frame = 0; + } + + if (projectile.alpha > 0) + { + projectile.alpha -= 10; + } + if (projectile.alpha <= 25) + { + float num472 = projectile.Center.X; + float num473 = projectile.Center.Y; + float num474 = 700f; + bool flag17 = false; + if (Main.player[projectile.owner].HasMinionAttackTargetNPC) + { + NPC npc = Main.npc[Main.player[projectile.owner].MinionAttackTargetNPC]; + if (npc.CanBeChasedBy(projectile, false)) + { + float num950 = npc.position.X + (float)(npc.width / 2); + float num951 = npc.position.Y + (float)(npc.height / 2); + float num952 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num950) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num951); + if (num952 < num474) + { + num474 = num952; + num472 = num950; + num473 = num951; + flag17 = true; + } + } + } + else + { + for (int num475 = 0; num475 < Main.npc.Length; num475++) + { + if (Main.npc[num475].CanBeChasedBy(projectile, false)) + { + 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) + { + num474 = num478; + num472 = num476; + num473 = num477; + flag17 = true; + } + } + } + } + if (flag17) + { + float num483 = 16f; + Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float num484 = num472 - vector35.X; + float num485 = num473 - vector35.Y; + float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485)); + num486 = num483 / num486; + num484 *= num486; + num485 *= num486; + projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f; + projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f; + } + } + } + + public override void Kill(int timeLeft) + { + projectile.position = projectile.Center; + projectile.width = projectile.height = 48; + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.maxPenetrate = -1; + projectile.penetrate = -1; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + projectile.Damage(); + Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 74); + 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, 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 < 15; num623++) + { + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 3f); + 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, 173, 0f, 0f, 100, default, 2f); + Main.dust[num624].velocity *= 2f; + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(BuffID.ShadowFlame, 180); + } + } +} diff --git a/Projectiles/Summon/LanternFlame.png b/Projectiles/Summon/LanternFlame.png new file mode 100644 index 0000000000..3009ead213 Binary files /dev/null and b/Projectiles/Summon/LanternFlame.png differ diff --git a/Projectiles/Summon/LanternSoul.cs b/Projectiles/Summon/LanternSoul.cs new file mode 100644 index 0000000000..5614f44c37 --- /dev/null +++ b/Projectiles/Summon/LanternSoul.cs @@ -0,0 +1,85 @@ +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Summon +{ + public class LanternSoul : ModProjectile + { + public float count = 0; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Lantern"); + } + + public override void SetDefaults() + { + projectile.width = 26; + projectile.height = 26; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.sentry = true; + projectile.timeLeft = Projectile.SentryLifeTime; + projectile.penetrate = -1; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.5f / 255f, (255 - projectile.alpha) * 0f / 255f, (255 - projectile.alpha) * 0.65f / 255f); + Player player = Main.player[projectile.owner]; + if (projectile.localAI[0] == 0f) + { + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; + projectile.localAI[0] += 1f; + } + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + { + int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / + projectile.Calamity().spawnedPlayerMinionDamageValue * + (player.allDamage + player.minionDamage - 1f)); + projectile.damage = damage2; + } + + projectile.velocity = new Vector2(0f, (float)Math.Sin((double)(6.28318548f * projectile.ai[0] / 300f)) * 0.5f); + projectile.ai[0] += 1f; + if (projectile.ai[0] >= 300f) + { + projectile.ai[0] = 0f; + projectile.netUpdate = true; + } + + int num = 0; + for (int i = 0; i < Main.projectile.Length; i++) + { + if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == ModContent.ProjectileType()) + { + num++; + } + } + if (num < 20) + { + projectile.ai[1] += (float)Main.rand.Next(2,6) + 1f; + if (projectile.ai[1] >= 75f) + { + projectile.ai[1] = 0f; + projectile.netUpdate = true; + if (projectile.owner == Main.myPlayer) + { + float startOffsetX = Main.rand.NextFloat(15f, 200f) * (Main.rand.NextBool() ? -1f : 1f); + float startOffsetY = Main.rand.NextFloat(15f, 200f) * (Main.rand.NextBool() ? -1f : 1f); + Vector2 startPos = new Vector2(projectile.position.X + startOffsetX, projectile.position.Y + startOffsetY); + Vector2 speed = new Vector2(0f, 0f); + Projectile.NewProjectile(startPos, speed, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + } + } + } + } + + public override bool CanDamage() + { + return false; + } + } +} diff --git a/Projectiles/Summon/LanternSoul.png b/Projectiles/Summon/LanternSoul.png new file mode 100644 index 0000000000..335f855c50 Binary files /dev/null and b/Projectiles/Summon/LanternSoul.png differ diff --git a/Projectiles/Summon/MiniSandShark.cs b/Projectiles/Summon/MiniSandShark.cs index c2a7f2485e..c89d8d9cfb 100644 --- a/Projectiles/Summon/MiniSandShark.cs +++ b/Projectiles/Summon/MiniSandShark.cs @@ -73,6 +73,7 @@ namespace CalamityMod.Projectiles.Summon projectile.penetrate = -1; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; + projectile.damage /= 2; projectile.Damage(); Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); int num226 = 36; diff --git a/Projectiles/Summon/SiriusBeam.cs b/Projectiles/Summon/SiriusBeam.cs index 277dde9f12..d59e7333bb 100644 --- a/Projectiles/Summon/SiriusBeam.cs +++ b/Projectiles/Summon/SiriusBeam.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { projectile.localAI[0] += 1f; - if (projectile.localAI[0] > 9f) + if (projectile.localAI[0] > 3f) { for (int num447 = 0; num447 < 4; num447++) { diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index bd9c05f2e5..2cba89e05a 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -82,20 +82,14 @@ namespace CalamityMod /// The NPC whose lifeMax value you are trying to set. /// The value lifeMax will be set to in normal mode, this value gets doubled automatically in Expert mode. /// The value lifeMax will be set to in Revegeneance mode. - /// The value lifeMax will be set to in Death mode. /// The value lifeMax will be set to during the Boss Rush. - /// The value lifeMax will be set to during the Boss Rush, if Death mode is active. - public static void LifeMaxNERD(this NPC npc, int normal, int? revengeance = null, int? death = null, int? bossRush = null, int? bossRushDeath = null) + public static void LifeMaxNERB(this NPC npc, int normal, int? revengeance = null, int? bossRush = null) { npc.lifeMax = normal; if (bossRush.HasValue && CalamityWorld.bossRushActive) { - npc.lifeMax = bossRushDeath.HasValue && CalamityWorld.death ? bossRushDeath.Value : bossRush.Value; - } - else if (death.HasValue && CalamityWorld.death) - { - npc.lifeMax = death.Value; + npc.lifeMax = bossRush.Value; } else if (revengeance.HasValue && CalamityWorld.revenge) { diff --git a/World/CalamityWorld.cs b/World/CalamityWorld.cs index b699ce31e7..59cefeaa0a 100644 --- a/World/CalamityWorld.cs +++ b/World/CalamityWorld.cs @@ -1172,9 +1172,7 @@ namespace CalamityMod.World { double spawnRate = 100000D; - if (death) - spawnRate *= 0.75D; - else if (revenge) + if (revenge) spawnRate *= 0.85D; if (demonMode) diff --git a/build.txt b/build.txt index e219de0dbf..cd6893e7a2 100644 --- a/build.txt +++ b/build.txt @@ -1,5 +1,5 @@ author = Fabsol and the Dev Team -version = 1.4.2.111 +version = 1.4.2.201 displayName = Calamity Mod (No Calamity Music) homepage = https://forums.terraria.org/index.php?threads/calamity-mod.44065/ buildIgnore = .vs\*, Properties\*, *.csproj, *.user, obj\*, bin\*, *.config, .git\*, LICENSE, README.md, .editorconfig, .gitignore, .gitattributes