From d4367a52b592da1bc6a2cba3841ec6873ae927dc Mon Sep 17 00:00:00 2001 From: ben-tk <45545085+termigator1359@users.noreply.github.com> Date: Sat, 12 Dec 2020 20:00:10 -0500 Subject: [PATCH] Finished up Angelic Alliance I guess --- Buffs/Cooldowns/DivineBlessCooldown.cs | 2 +- Buffs/StatBuffs/DivineBless.cs | 5 +- CalPlayer/CalamityPlayer.cs | 32 ++++- CalPlayer/CalamityPlayerDrawEffects.cs | 5 +- CalPlayer/CalamityPlayerLifeRegen.cs | 1 - CalPlayer/CalamityPlayerMiscEffects.cs | 49 +++++-- CalPlayer/CalamityPlayerOnHit.cs | 16 +++ Items/Accessories/AngelicAlliance.cs | 27 +++- ModSupport/WeakReferenceSupport.cs | 3 +- NPCs/CalamityGlobalNPC.cs | 23 +++- NPCs/GreatSandShark/GreatSandShark.cs | 1 + NPCs/Leviathan/Leviathan.cs | 1 + NPCs/Leviathan/Siren.cs | 1 + .../PlaguebringerGoliath.cs | 1 + .../PlaguebringerShade.cs | 1 + NPCs/Polterghast/Polterghast.cs | 1 + NPCs/Ravager/RavagerBody.cs | 1 + NPCs/Ravager/RavagerClawLeft.cs | 1 + NPCs/Ravager/RavagerClawRight.cs | 1 + NPCs/Ravager/RavagerHead.cs | 1 + NPCs/Ravager/RavagerLegLeft.cs | 1 + NPCs/Ravager/RavagerLegRight.cs | 1 + NPCs/Signus/Signus.cs | 1 + NPCs/SupremeCalamitas/SoulSeekerSupreme.cs | 2 + NPCs/SupremeCalamitas/SupremeCalamitas.cs | 1 + NPCs/SupremeCalamitas/SupremeCataclysm.cs | 2 + NPCs/SupremeCalamitas/SupremeCatastrophe.cs | 2 + NPCs/Yharon/Yharon.cs | 1 + .../Summon/AngelicAllianceArchangel.cs | 130 ++++++++++++++++++ Projectiles/Summon/MiniGuardianAttack.cs | 53 ++++--- Projectiles/Summon/MiniGuardianDefense.cs | 55 +++++--- Projectiles/Summon/MiniGuardianHealer.cs | 32 ++--- Projectiles/Typeless/AllianceTriangle.cs | 58 ++++++++ Projectiles/Typeless/AllianceTriangle.png | Bin 0 -> 1809 bytes Sounds/Custom/AngelicAllianceActivation.cs | 18 +++ Utilities/CalamityUtils.cs | 10 +- 36 files changed, 451 insertions(+), 89 deletions(-) create mode 100644 Projectiles/Summon/AngelicAllianceArchangel.cs create mode 100644 Projectiles/Typeless/AllianceTriangle.cs create mode 100644 Projectiles/Typeless/AllianceTriangle.png create mode 100644 Sounds/Custom/AngelicAllianceActivation.cs diff --git a/Buffs/Cooldowns/DivineBlessCooldown.cs b/Buffs/Cooldowns/DivineBlessCooldown.cs index 3e36992ca7..7bfeebdbdb 100644 --- a/Buffs/Cooldowns/DivineBlessCooldown.cs +++ b/Buffs/Cooldowns/DivineBlessCooldown.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Buffs.Cooldowns { public override void SetDefaults() { - DisplayName.SetDefault("Divine Bless Cooldown"); + DisplayName.SetDefault("Divine Recharge"); Description.SetDefault("Your divine powers are recharging"); Main.debuff[Type] = true; Main.pvpBuff[Type] = true; diff --git a/Buffs/StatBuffs/DivineBless.cs b/Buffs/StatBuffs/DivineBless.cs index 54c31830cf..1f61ad062d 100644 --- a/Buffs/StatBuffs/DivineBless.cs +++ b/Buffs/StatBuffs/DivineBless.cs @@ -7,12 +7,13 @@ namespace CalamityMod.Buffs.StatBuffs { public override void SetDefaults() { - DisplayName.SetDefault("Kami Injection"); + DisplayName.SetDefault("Divine Bless"); Description.SetDefault("+5% damage, increased health regen, attacks inflict Banishing Fire"); - Main.debuff[Type] = false; + Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; longerExpertDebuff = false; + canBeCleared = false; } public override void Update(Player player, ref int buffIndex) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index dc8081c022..166f4aaa19 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -11,6 +11,7 @@ using CalamityMod.Items.Accessories.Vanity; using CalamityMod.Items.Armor; using CalamityMod.Items.DifficultyItems; using CalamityMod.Items.Dyes; +using CalamityMod.Items.LoreItems; using CalamityMod.Items.Mounts; using CalamityMod.Items.TreasureBags; using CalamityMod.Items.Weapons.Melee; @@ -615,7 +616,7 @@ namespace CalamityMod.CalPlayer public int roverFrameCounter = 0; public int roverFrame = 0; public bool angelicAlliance = false; - public int angelicActivate = 0; + public int angelicActivate = -1; #endregion #region Armor Set @@ -2141,7 +2142,7 @@ namespace CalamityMod.CalPlayer ladHearts = 0; prismaticLasers = 0; roverDriveTimer = 0; - angelicActivate = 0; + angelicActivate = -1; resetHeightandWidth = false; noLifeRegen = false; @@ -2794,12 +2795,31 @@ namespace CalamityMod.CalPlayer } } } + if (CalamityMod.AngelicAllianceHotKey.JustPressed && angelicAlliance && Main.myPlayer == player.whoAmI && !divineBless && !divineBlessCooldown) + { + int seconds = CalamityUtils.SecondsToFrames(profanedCrystal ? 60f : 30f); + player.AddBuff(ModContent.BuffType(), seconds, false); + Projectile.NewProjectile(player.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, player.whoAmI); + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/AngelicAllianceActivation"), player.Center); + + // Spawn an archangel for every minion you have + for (int projIndex = 0; projIndex < Main.maxProjectiles; projIndex++) + { + Projectile proj = Main.projectile[projIndex]; + if (proj.minionSlots <= 0f || !proj.IsSummon()) + continue; + if (proj.active && proj.owner == player.whoAmI) + { + Projectile.NewProjectile(player.Center, Vector2.Zero, ModContent.ProjectileType(), proj.damage / 4, proj.knockBack / 4f, player.whoAmI); + } + } + } if (CalamityMod.SandCloakHotkey.JustPressed && sandCloak && Main.myPlayer == player.whoAmI && rogueStealth >= rogueStealthMax * 0.25f && wearingRogueArmor && rogueStealthMax > 0 && !sandCloakCooldown) { player.AddBuff(ModContent.BuffType(), 1800, false); //30 seconds rogueStealth -= rogueStealthMax * 0.25f; - Projectile.NewProjectile(player.Center, Vector2.Zero, ModContent.ProjectileType(), 7, 8, player.whoAmI, 0, 0); + Projectile.NewProjectile(player.Center, Vector2.Zero, ModContent.ProjectileType(), 7, 8, player.whoAmI); Main.PlaySound(SoundID.Item, player.position, 45); } if (CalamityMod.SpectralVeilHotKey.JustPressed && spectralVeil && Main.myPlayer == player.whoAmI && rogueStealth >= rogueStealthMax * 0.25f && @@ -4369,7 +4389,7 @@ namespace CalamityMod.CalPlayer { damageSource = PlayerDeathReason.ByCustomReason(player.name + " was turned to ashes by the Profaned Goddess."); } - if (hFlames) + if (hFlames || banishingFire) { damageSource = PlayerDeathReason.ByCustomReason(player.name + " fell prey to their sins."); } @@ -5107,6 +5127,10 @@ namespace CalamityMod.CalPlayer { damageMult += 0.1; } + if (angelicAlliance && heldItem.type == ModContent.ItemType() && !hasClassType) + { + damageMult += 0.3; + } if (silvaMelee && Main.rand.NextBool(4) && isTrueMelee) { damageMult += 4.0; diff --git a/CalPlayer/CalamityPlayerDrawEffects.cs b/CalPlayer/CalamityPlayerDrawEffects.cs index ec6c12a763..6b1e9a5088 100644 --- a/CalPlayer/CalamityPlayerDrawEffects.cs +++ b/CalPlayer/CalamityPlayerDrawEffects.cs @@ -5,6 +5,7 @@ using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Summon; using CalamityMod.Projectiles.Summon; +using CalamityMod.Projectiles.Typeless; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -472,7 +473,7 @@ namespace CalamityMod.CalPlayer int totalMoonlightDyes = drawPlayer.dye.Count(dyeItem => dyeItem.type == ModContent.ItemType()); if (totalMoonlightDyes <= 0) return; - CalamityUtils.DrawAuroras(drawPlayer, 5 + (int)MathHelper.Clamp(totalMoonlightDyes, 0f, 4f) * 2, MathHelper.Clamp(totalMoonlightDyes / 3f, 0f, 1f), GetCurrentMoonlightDyeColor(incrementOffsetAngle)); + CalamityUtils.DrawAuroras(drawPlayer, 5 + (int)MathHelper.Clamp(totalMoonlightDyes, 0f, 4f) * 2, MathHelper.Clamp(totalMoonlightDyes / 3f, 0f, 1f), GetCurrentMoonlightDyeColor(), true); }); public static readonly PlayerLayer AuralisAuroraEffects = new PlayerLayer("CalamityMod", "AuralisAurora", PlayerLayer.Body, drawInfo => @@ -488,7 +489,7 @@ namespace CalamityMod.CalPlayer { Player drawPlayer = drawInfo.drawPlayer; CalamityPlayer modPlayer = drawPlayer.Calamity(); - if (modPlayer.angelicActivate <= 0) + if (drawPlayer.ownedProjectileCounts[ModContent.ProjectileType()] <= 0) return; CalamityUtils.DrawAuroras(drawPlayer, 7, 0.4f, CalamityUtils.ColorSwap(new Color(255, 163, 56), new Color(242, 48, 187), 3f)); }); diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 5f39b9d366..cffebf7e33 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -771,7 +771,6 @@ namespace CalamityMod.CalPlayer { player.lifeRegenTime++; - int lifeRegenTimeMaxBoost2 = 250; int lifeRegenMaxBoost2 = 1; float lifeRegenLifeRegenTimeMaxBoost2 = 4f; diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 210c2bdbed..65cee0ac20 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -1053,8 +1053,6 @@ namespace CalamityMod.CalPlayer modPlayer.auralisAurora--; if (modPlayer.auralisAuroraCooldown > 0) modPlayer.auralisAuroraCooldown--; - if (modPlayer.angelicActivate > 0) - modPlayer.angelicActivate--; // Silva invincibility effects if (modPlayer.silvaCountdown > 0 && modPlayer.hasSilvaEffect && modPlayer.silvaSet) @@ -1901,6 +1899,13 @@ namespace CalamityMod.CalPlayer modPlayer.prismaticLasers = 1800; player.AddBuff(ModContent.BuffType(), CalamityUtils.SecondsToFrames(30f), true); } + if (!modPlayer.angelicAlliance && modPlayer.divineBless) + { + modPlayer.divineBless = false; + player.ClearBuff(ModContent.BuffType()); + int seconds = CalamityUtils.SecondsToFrames(modPlayer.profanedCrystal ? 90f : 120f); + player.AddBuff(ModContent.BuffType(), seconds, false); + } } #endregion @@ -3499,15 +3504,16 @@ namespace CalamityMod.CalPlayer bool crystal = modPlayer.profanedCrystal && !modPlayer.profanedCrystalForce; bool summonSet = modPlayer.tarraSummon || modPlayer.bloodflareSummon || modPlayer.godSlayerSummon || modPlayer.silvaSummon || modPlayer.dsSetBonus || modPlayer.omegaBlueSet || modPlayer.fearmongerSet; + int guardianAmt = modPlayer.angelicAlliance ? 3 : 1; - if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) + if (player.ownedProjectileCounts[ModContent.ProjectileType()] < guardianAmt) Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -6f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, 0f); if (crystal || player.Calamity().minionSlotStat >= 10) { player.Calamity().gDefense = true; - if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) + if (player.ownedProjectileCounts[ModContent.ProjectileType()] < guardianAmt) Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -3f, ModContent.ProjectileType(), 1, 1f, Main.myPlayer, 0f, 0f); } @@ -3515,7 +3521,7 @@ namespace CalamityMod.CalPlayer { player.Calamity().gOffense = true; - if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) + if (player.ownedProjectileCounts[ModContent.ProjectileType()] < guardianAmt) Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), 1, 1f, Main.myPlayer, 0f, 0f); } } @@ -3554,7 +3560,7 @@ namespace CalamityMod.CalPlayer bool enrage = player.statLife <= (int)(player.statLifeMax2 * 0.5); bool notRetro = Lighting.NotRetro; if (!modPlayer.ZoneAbyss) //No abyss memes. - Lighting.AddLight(player.Center, enrage ? 60 : offenseBuffs ? 50 : 10, enrage ? 12 : offenseBuffs ? 10 : 2, 0); + Lighting.AddLight(player.Center, enrage ? 6 : offenseBuffs ? 5 : 1, enrage ? 1.2 : offenseBuffs ? 1 : 0.2, 0); if (enrage) { bool special = player.name == "Amber" || player.name == "Nincity" || player.name == "IbanPlay" || player.name == "Chen"; //People who either helped create the item or test it. @@ -3606,11 +3612,17 @@ namespace CalamityMod.CalPlayer ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), - ModContent.ProjectileType() + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType() }; + int projAmt = 1; for (int i = 0; i < summonDeleteList.Count; i++) { - if (player.ownedProjectileCounts[summonDeleteList[i]] > 1) + if (i > 9 && modPlayer.angelicAlliance) // PSA donuts + projAmt = 3; + if (player.ownedProjectileCounts[summonDeleteList[i]] > projAmt) { for (int projIndex = 0; projIndex < Main.maxProjectiles; projIndex++) { @@ -3767,6 +3779,27 @@ namespace CalamityMod.CalPlayer } } + if (modPlayer.angelicAlliance && Main.myPlayer == player.whoAmI) + { + for (int l = 0; l < Player.MaxBuffs; l++) + { + int hasBuff = player.buffType[l]; + if (hasBuff == ModContent.BuffType()) + { + modPlayer.angelicActivate = player.buffTime[l]; + } + } + if (modPlayer.angelicActivate == 1) + { + int seconds = CalamityUtils.SecondsToFrames(modPlayer.profanedCrystal ? 90f : 120f); + player.AddBuff(ModContent.BuffType(), seconds, false); + } + if (player.FindBuffIndex(ModContent.BuffType()) == -1) + modPlayer.angelicActivate = -1; + if (modPlayer.divineBless) + player.allDamage += 0.05f; + } + if (modPlayer.theBee) { if (player.statLife >= player.statLifeMax2) diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index eadb2ed090..937ddb00ef 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -3,6 +3,7 @@ using CalamityMod.Buffs.StatBuffs; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using CalamityMod.Items.Armor; +using CalamityMod.Items.LoreItems; using CalamityMod.NPCs.NormalNPCs; using CalamityMod.Projectiles; using CalamityMod.Projectiles.Healing; @@ -745,6 +746,14 @@ namespace CalamityMod.CalPlayer public static void NPCDebuffs(Player player, Mod mod, NPC target, bool melee, bool ranged, bool magic, bool summon, bool rogue, bool proj) { CalamityPlayer modPlayer = player.Calamity(); + if (modPlayer.angelicAlliance && player.ActiveItem().type == ItemType()) + { + if (Main.rand.NextBool(10) || modPlayer.divineBless) + { + target.AddBuff(BuffType(), 60, false); + } + } + if (melee) //prevents Deep Sea Dumbell from snagging true melee debuff memes { if (modPlayer.eGauntlet) @@ -930,6 +939,13 @@ namespace CalamityMod.CalPlayer public static void PvpDebuffs(Player player, Mod mod, Player target, bool melee, bool ranged, bool magic, bool summon, bool rogue, bool proj) { CalamityPlayer modPlayer = player.Calamity(); + if (modPlayer.angelicAlliance && player.ActiveItem().type == ItemType()) + { + if (Main.rand.NextBool(10) || modPlayer.divineBless) + { + target.AddBuff(BuffType(), 60, false); + } + } if (melee) { if (modPlayer.eGauntlet) diff --git a/Items/Accessories/AngelicAlliance.cs b/Items/Accessories/AngelicAlliance.cs index 3a40b9a3c6..d28be4a26c 100644 --- a/Items/Accessories/AngelicAlliance.cs +++ b/Items/Accessories/AngelicAlliance.cs @@ -14,9 +14,17 @@ namespace CalamityMod.Items.Accessories public override void SetStaticDefaults() { DisplayName.SetDefault("Angelic Alliance"); - Tooltip.SetDefault("Increases all damage by 10%\n" + - "Add some extra tooltip shit\n" + - "Something something hotkey"); + Tooltip.SetDefault("Call upon the force of heaven to empower your attacks and minions\n" + + "Further Empowerment to Holy Forces\n" + + "Courage, Enlightenment, Bliss. United in Judgement\n" + + "10% increased damage\n" + + "While holding the Profaned Guardians Lore item, all attacks have a chance to inflict Banishing Fire\n" + + "While holding the Providence Lore item, classless projectiles deal increased damage and the Holy Flames debuff deals more damage\n" + + "While the Profaned Soul Crystal is equipped, additional guardians will be summoned for a total of nine\n" + //This is going to be broken as fuck because the angels aren't already, y'know? + "This line is modified below. If you can read this, someone probably did something wrong (It was Ben)\n" + + "While under the effects of Divine Bless, for every minion you have, an archangel shall be summoned to aid you in combat\n" + + "Divine Bless also boosts your life regeneration and grants an additional +5% increased damage\n" + + "This line is also modified below, kinda sus"); } public override void SetDefaults() @@ -31,12 +39,19 @@ namespace CalamityMod.Items.Accessories public override void ModifyTooltips(List list) { - string hotkey = CalamityMod.AngelicAllianceHotkey.TooltipHotkeyString(); + string hotkey = CalamityMod.AngelicAllianceHotKey.TooltipHotkeyString(); + bool crystal = Main.player[Main.myPlayer].Calamity().profanedCrystal; + int time = crystal ? 60 : 30; + string time2 = crystal ? "1.5" : "2"; foreach (TooltipLine line2 in list) { - if (line2.mod == "Terraria" && line2.Name == "Tooltip2") + if (line2.mod == "Terraria" && line2.Name == "Tooltip7") { - line2.text = "Press " + hotkey + " to consume 25% of your maximum stealth to perform a short range teleport and render you momentarily invulnerable"; + line2.text = "Press " + hotkey + " to grace yourself in divinity for " + time + " seconds"; + } + if (line2.mod == "Terraria" && line2.Name == "Tooltip10") + { + line2.text = "This effect has a cooldown of " + time2 + " minutes"; } } } diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 1511c8fe34..ec11c8615b 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -531,7 +531,6 @@ namespace CalamityMod List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), /*ItemType(), */ItemType() }; List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; string instructions = $"Use a [i:{summon}] in the Jungle Biome"; - // TODO -- this setup code is only run once, so the despawn message can't be changed post-eclipse. Find a way around this. string despawn = CalamityUtils.ColorMessage("Yharon found you too weak to stay near your gravestone.", new Color(0xFF, 0xA5, 0x00)); string bossLogTex = "CalamityMod/NPCs/Yharon/Yharon_BossChecklist"; AddBoss(bossChecklist, calamity, "Yharon", order, type, DownedYharon, summon, loot, collection, instructions, despawn, bossLogTex); @@ -542,7 +541,7 @@ namespace CalamityMod BossDifficulty.TryGetValue("SupremeCalamitas", out float order); int type = NPCType(); int summon = ItemType(); - List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; + List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType() }; string instructions = $"Use an [i:{summon}]"; string despawn = CalamityUtils.ColorMessage("Please don't waste my time.", new Color(0xFF, 0xA5, 0x00)); diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index c03402a36c..3a24dd43a9 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -5,6 +5,7 @@ using CalamityMod.Buffs.StatDebuffs; using CalamityMod.CalPlayer; using CalamityMod.Dusts; using CalamityMod.Events; +using CalamityMod.Items.LoreItems; using CalamityMod.NPCs.Abyss; using CalamityMod.NPCs.AcidRain; using CalamityMod.NPCs.AquaticScourge; @@ -715,10 +716,26 @@ namespace CalamityMod.NPCs } } + bool allianceBoost = false; + if (hFlames > 0) + { + for (int i = 0; i < Main.maxPlayers; i++) + { + Player player = Main.player[i]; + if (player is null || !player.active || player.dead) + continue; + if (player.ActiveItem().type == ModContent.ItemType() && player.Calamity().angelicAlliance) + { + allianceBoost = true; + break; + } + } + } + //Oiled debuff makes flame debuffs 25% more effective if (npc.oiled) { - int oiledDoT = (bFlames > 0 ? 10 : 0) + (hFlames > 0 ? 13 : 0) + (gsInferno > 0 ? 63 : 0) + (aFlames > 0 ? 32 : 0) + (dFlames > 0 ? 625 : 0) + (banishingFire > 0 ? 375 : 0); + int oiledDoT = (bFlames > 0 ? 10 : 0) + (hFlames > 0 ? 13 : 0) + (allianceBoost ? 13 : 0) + (gsInferno > 0 ? 63 : 0) + (aFlames > 0 ? 32 : 0) + (dFlames > 0 ? 625 : 0) + (banishingFire > 0 ? 375 : 0); if (oiledDoT > 0) { int lifeRegenValue = oiledDoT * 4 + 12; @@ -731,7 +748,7 @@ namespace CalamityMod.NPCs ApplyDPSDebuff(vaporfied, 30, 6, ref npc.lifeRegen, ref damage); ApplyDPSDebuff(bFlames, 40, 8, ref npc.lifeRegen, ref damage); - ApplyDPSDebuff(hFlames, 50, 10, ref npc.lifeRegen, ref damage); + ApplyDPSDebuff(hFlames, allianceBoost ? 100 : 50, allianceBoost ? 20 : 10, ref npc.lifeRegen, ref damage); ApplyDPSDebuff(pFlames, 100, 20, ref npc.lifeRegen, ref damage); ApplyDPSDebuff(gsInferno, 250, 50, ref npc.lifeRegen, ref damage); ApplyDPSDebuff(astralInfection, 75, 15, ref npc.lifeRegen, ref damage); @@ -3840,7 +3857,7 @@ namespace CalamityMod.NPCs } } - if (hFlames > 0) + if (hFlames > 0 || banishingFire > 0) { if (Main.rand.Next(5) < 4) { diff --git a/NPCs/GreatSandShark/GreatSandShark.cs b/NPCs/GreatSandShark/GreatSandShark.cs index fa50059b9b..de4e585669 100644 --- a/NPCs/GreatSandShark/GreatSandShark.cs +++ b/NPCs/GreatSandShark/GreatSandShark.cs @@ -67,6 +67,7 @@ namespace CalamityMod.NPCs.GreatSandShark npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.behindTiles = true; npc.netAlways = true; npc.HitSound = SoundID.NPCHit1; diff --git a/NPCs/Leviathan/Leviathan.cs b/NPCs/Leviathan/Leviathan.cs index 2dbd97c4e1..66fb8410eb 100644 --- a/NPCs/Leviathan/Leviathan.cs +++ b/NPCs/Leviathan/Leviathan.cs @@ -82,6 +82,7 @@ namespace CalamityMod.NPCs.Leviathan npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.HitSound = SoundID.NPCHit56; npc.DeathSound = SoundID.NPCDeath60; npc.noTileCollide = true; diff --git a/NPCs/Leviathan/Siren.cs b/NPCs/Leviathan/Siren.cs index 53e8da1b95..695f18075b 100644 --- a/NPCs/Leviathan/Siren.cs +++ b/NPCs/Leviathan/Siren.cs @@ -73,6 +73,7 @@ namespace CalamityMod.NPCs.Leviathan npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.noGravity = true; npc.noTileCollide = true; npc.HitSound = SoundID.NPCHit1; diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs index 456f90a278..0bce99a735 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs @@ -84,6 +84,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.noGravity = true; npc.noTileCollide = true; npc.HitSound = SoundID.NPCHit4; diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs b/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs index e389e2d10f..eed139044e 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerShade.cs @@ -66,6 +66,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.noGravity = true; npc.noTileCollide = true; npc.HitSound = SoundID.NPCHit4; diff --git a/NPCs/Polterghast/Polterghast.cs b/NPCs/Polterghast/Polterghast.cs index a129520595..354425339a 100644 --- a/NPCs/Polterghast/Polterghast.cs +++ b/NPCs/Polterghast/Polterghast.cs @@ -70,6 +70,7 @@ namespace CalamityMod.NPCs.Polterghast npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.noGravity = true; npc.noTileCollide = true; npc.netAlways = true; diff --git a/NPCs/Ravager/RavagerBody.cs b/NPCs/Ravager/RavagerBody.cs index bded5ce97b..5d54408a92 100644 --- a/NPCs/Ravager/RavagerBody.cs +++ b/NPCs/Ravager/RavagerBody.cs @@ -81,6 +81,7 @@ namespace CalamityMod.NPCs.Ravager npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.boss = true; npc.alpha = 255; npc.HitSound = SoundID.NPCHit41; diff --git a/NPCs/Ravager/RavagerClawLeft.cs b/NPCs/Ravager/RavagerClawLeft.cs index e69eff62eb..7e57830fa4 100644 --- a/NPCs/Ravager/RavagerClawLeft.cs +++ b/NPCs/Ravager/RavagerClawLeft.cs @@ -53,6 +53,7 @@ namespace CalamityMod.NPCs.Ravager npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.noGravity = true; npc.canGhostHeal = false; npc.alpha = 255; diff --git a/NPCs/Ravager/RavagerClawRight.cs b/NPCs/Ravager/RavagerClawRight.cs index 24b3279258..17f9c43b05 100644 --- a/NPCs/Ravager/RavagerClawRight.cs +++ b/NPCs/Ravager/RavagerClawRight.cs @@ -53,6 +53,7 @@ namespace CalamityMod.NPCs.Ravager npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.noGravity = true; npc.canGhostHeal = false; npc.alpha = 255; diff --git a/NPCs/Ravager/RavagerHead.cs b/NPCs/Ravager/RavagerHead.cs index 9061f2d006..40fb15dee2 100644 --- a/NPCs/Ravager/RavagerHead.cs +++ b/NPCs/Ravager/RavagerHead.cs @@ -51,6 +51,7 @@ namespace CalamityMod.NPCs.Ravager npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.noGravity = true; npc.canGhostHeal = false; npc.noTileCollide = true; diff --git a/NPCs/Ravager/RavagerLegLeft.cs b/NPCs/Ravager/RavagerLegLeft.cs index d7a7fcf72b..c32a6b9719 100644 --- a/NPCs/Ravager/RavagerLegLeft.cs +++ b/NPCs/Ravager/RavagerLegLeft.cs @@ -49,6 +49,7 @@ namespace CalamityMod.NPCs.Ravager npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.noGravity = true; npc.canGhostHeal = false; npc.noTileCollide = true; diff --git a/NPCs/Ravager/RavagerLegRight.cs b/NPCs/Ravager/RavagerLegRight.cs index 2f467d096b..32c8b17717 100644 --- a/NPCs/Ravager/RavagerLegRight.cs +++ b/NPCs/Ravager/RavagerLegRight.cs @@ -49,6 +49,7 @@ namespace CalamityMod.NPCs.Ravager npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.noGravity = true; npc.canGhostHeal = false; npc.noTileCollide = true; diff --git a/NPCs/Signus/Signus.cs b/NPCs/Signus/Signus.cs index 8c4076557b..57d2e1f5d4 100644 --- a/NPCs/Signus/Signus.cs +++ b/NPCs/Signus/Signus.cs @@ -83,6 +83,7 @@ namespace CalamityMod.NPCs.Signus npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.noGravity = true; npc.noTileCollide = true; npc.netAlways = true; diff --git a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs index f9b35903fd..3eb9123f35 100644 --- a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs +++ b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs @@ -1,3 +1,4 @@ +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Projectiles.Boss; using CalamityMod.Dusts; using Microsoft.Xna.Framework; @@ -40,6 +41,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } npc.buffImmune[BuffID.Ichor] = false; npc.buffImmune[BuffID.CursedInferno] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.HitSound = SoundID.NPCHit4; npc.DeathSound = SoundID.NPCDeath14; } diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index 828b1dcc39..352f99a656 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -2060,6 +2060,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas // Rejoice! Hybrid weapons are no more, so this list is no longer cluttered. DropHelper.DropItemFromSetCondition(npc, true, Main.expertMode, ModContent.ItemType(), + ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), diff --git a/NPCs/SupremeCalamitas/SupremeCataclysm.cs b/NPCs/SupremeCalamitas/SupremeCataclysm.cs index bc421188d4..b31ffe2d7b 100644 --- a/NPCs/SupremeCalamitas/SupremeCataclysm.cs +++ b/NPCs/SupremeCalamitas/SupremeCataclysm.cs @@ -1,3 +1,4 @@ +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Projectiles.Boss; using CalamityMod.Projectiles.Summon; @@ -46,6 +47,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } npc.buffImmune[BuffID.Ichor] = false; npc.buffImmune[BuffID.CursedInferno] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.noGravity = true; npc.noTileCollide = true; npc.HitSound = SoundID.NPCHit4; diff --git a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs index f906318812..3ef4c62729 100644 --- a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs +++ b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs @@ -1,3 +1,4 @@ +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Projectiles.Boss; using CalamityMod.Projectiles.Summon; @@ -48,6 +49,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } npc.buffImmune[BuffID.Ichor] = false; npc.buffImmune[BuffID.CursedInferno] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.HitSound = SoundID.NPCHit4; npc.DeathSound = SoundID.NPCDeath14; } diff --git a/NPCs/Yharon/Yharon.cs b/NPCs/Yharon/Yharon.cs index dddb987fda..7b7f8127e4 100644 --- a/NPCs/Yharon/Yharon.cs +++ b/NPCs/Yharon/Yharon.cs @@ -80,6 +80,7 @@ namespace CalamityMod.NPCs.Yharon npc.buffImmune[BuffID.CursedInferno] = false; npc.buffImmune[ModContent.BuffType()] = false; npc.buffImmune[ModContent.BuffType()] = false; + npc.buffImmune[ModContent.BuffType()] = false; npc.DR_NERD(normalDR, null, null, null, true); CalamityGlobalNPC global = npc.Calamity(); diff --git a/Projectiles/Summon/AngelicAllianceArchangel.cs b/Projectiles/Summon/AngelicAllianceArchangel.cs new file mode 100644 index 0000000000..a70e611582 --- /dev/null +++ b/Projectiles/Summon/AngelicAllianceArchangel.cs @@ -0,0 +1,130 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.CalPlayer; +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Summon +{ + public class AngelicAllianceArchangel : ModProjectile + { + private int lifeSpan = 300; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Archangel"); + Main.projFrames[projectile.type] = 4; + ProjectileID.Sets.MinionSacrificable[projectile.type] = true; + ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.width = 60; + projectile.height = 68; + projectile.netImportant = true; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 20; + projectile.minionSlots = 0f; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.minion = true; + } + + public override void SendExtraAI(BinaryWriter writer) => writer.Write(lifeSpan); + + public override void ReceiveExtraAI(BinaryReader reader) => lifeSpan = reader.ReadInt32(); + + public override void AI() + { + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); + + if (!modPlayer.divineBless) + { + projectile.Kill(); + return; + } + + lifeSpan--; + if (lifeSpan <= 0) + { + projectile.alpha += 30; + if (projectile.alpha >= 255) + { + projectile.Kill(); + return; + } + } + + if (projectile.localAI[0] == 0f) + { + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); + projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; + int dustAmt = 30; + for (int d = 0; d < dustAmt; d++) + { + int idx = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, (int)CalamityDusts.ProfanedFire, 0f, 0f, 0, default, 1f); + Main.dust[idx].velocity *= 2f; + Main.dust[idx].scale *= 1.15f; + } + projectile.localAI[0] += 1f; + } + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) + { + int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / + projectile.Calamity().spawnedPlayerMinionDamageValue * + player.MinionDamage()); + projectile.damage = damage2; + } + + //Adjust sprite direction so it faces correctly + if (Math.Abs(projectile.velocity.X) > 0.2f) + { + projectile.spriteDirection = -projectile.direction; + } + + projectile.ChargingMinionAI(1600f, 1800f, 2500f, 400f, 0, 30f, 24f, 12f, new Vector2(0f, -60f), 30f, 10f, true, true); + + //Give off some light + float lightScalar = Main.rand.NextFloat(0.9f, 1.1f) * Main.essScale; + Lighting.AddLight(projectile.Center, 0.2f * lightScalar, 0.17f * lightScalar, 0.1f * lightScalar); + + if (!projectile.FinalExtraUpdate()) + return; + + //Frames + projectile.frameCounter++; + if (projectile.frameCounter > 7) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 3) + { + projectile.frame = 0; + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + SpriteEffects spriteEffects = projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + Texture2D texture = Main.projectileTexture[projectile.type]; + int frameHeight = texture.Height / Main.projFrames[projectile.type]; + int frameY = frameHeight * projectile.frame; + Main.spriteBatch.Draw(texture, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, frameY, texture.Width, frameHeight)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture.Width / 2f, (float)frameHeight / 2f), projectile.scale, spriteEffects, 0f); + return false; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) => target.AddBuff(ModContent.BuffType(), 300); + + public override void OnHitPvp(Player target, int damage, bool crit) => target.AddBuff(ModContent.BuffType(), 300); + + public override bool CanDamage() => projectile.alpha < 50; + } +} diff --git a/Projectiles/Summon/MiniGuardianAttack.cs b/Projectiles/Summon/MiniGuardianAttack.cs index 8ce1c223ce..50da51b6b8 100644 --- a/Projectiles/Summon/MiniGuardianAttack.cs +++ b/Projectiles/Summon/MiniGuardianAttack.cs @@ -1,3 +1,4 @@ +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.CalPlayer; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -98,8 +99,8 @@ namespace CalamityMod.Projectiles.Summon projectile.tileCollide = false; int num17 = 100; Vector2 vector3 = projectile.Center; - float num18 = Main.player[projectile.owner].Center.X - vector3.X; - float num19 = Main.player[projectile.owner].Center.Y - vector3.Y; + float num18 = player.Center.X - vector3.X; + float num19 = player.Center.Y - vector3.Y; num19 += (float)Main.rand.Next(-10, 21); num18 += (float)Main.rand.Next(-10, 21); num18 += (float)(60 * -(float)Main.player[projectile.owner].direction); @@ -107,8 +108,8 @@ namespace CalamityMod.Projectiles.Summon float num20 = (float)Math.Sqrt((double)(num18 * num18 + num19 * num19)); float num21 = 18f; - if (num20 < (float)num17 && Main.player[projectile.owner].velocity.Y == 0f && - projectile.position.Y + (float)projectile.height <= Main.player[projectile.owner].position.Y + (float)Main.player[projectile.owner].height && + if (num20 < (float)num17 && player.velocity.Y == 0f && + projectile.position.Y + (float)projectile.height <= player.position.Y + (float)player.height && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) { projectile.ai[0] = 0f; @@ -119,8 +120,7 @@ namespace CalamityMod.Projectiles.Summon } if (num20 > 2000f) { - projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); - projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2); + projectile.position = player.position; projectile.netUpdate = true; } if (num20 < 50f) @@ -148,34 +148,34 @@ namespace CalamityMod.Projectiles.Summon if (projectile.velocity.X < num18) { - projectile.velocity.X = projectile.velocity.X + num16; + projectile.velocity.X += num16; if (num16 > 0.05f && projectile.velocity.X < 0f) { - projectile.velocity.X = projectile.velocity.X + num16; + projectile.velocity.X += num16; } } if (projectile.velocity.X > num18) { - projectile.velocity.X = projectile.velocity.X - num16; + projectile.velocity.X -= num16; if (num16 > 0.05f && projectile.velocity.X > 0f) { - projectile.velocity.X = projectile.velocity.X - num16; + projectile.velocity.X -= num16; } } if (projectile.velocity.Y < num19) { - projectile.velocity.Y = projectile.velocity.Y + num16; + projectile.velocity.Y += num16; if (num16 > 0.05f && projectile.velocity.Y < 0f) { - projectile.velocity.Y = projectile.velocity.Y + num16 * 2f; + projectile.velocity.Y += num16 * 2f; } } if (projectile.velocity.Y > num19) { - projectile.velocity.Y = projectile.velocity.Y - num16; + projectile.velocity.Y -= num16; if (num16 > 0.05f && projectile.velocity.Y > 0f) { - projectile.velocity.Y = projectile.velocity.Y - num16 * 2f; + projectile.velocity.Y -= num16 * 2f; } } break; @@ -246,6 +246,7 @@ namespace CalamityMod.Projectiles.Summon projectile.active = false; return; } + projectile.MinionAntiClump(); float num535 = projectile.position.X; float num536 = projectile.position.Y; float num537 = 3000f; @@ -253,9 +254,9 @@ namespace CalamityMod.Projectiles.Summon NPC ownerMinionAttackTargetNPC2 = projectile.OwnerMinionAttackTargetNPC; if (ownerMinionAttackTargetNPC2 != null && ownerMinionAttackTargetNPC2.CanBeChasedBy(projectile, false)) { - float num539 = ownerMinionAttackTargetNPC2.position.X + (float)(ownerMinionAttackTargetNPC2.width / 2); - float num540 = ownerMinionAttackTargetNPC2.position.Y + (float)(ownerMinionAttackTargetNPC2.height / 2); - float num541 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num539) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num540); + float num539 = ownerMinionAttackTargetNPC2.Center.X; + float num540 = ownerMinionAttackTargetNPC2.Center.Y; + float num541 = Math.Abs(projectile.Center.X - num539) + Math.Abs(projectile.Center.Y - num540); if (num541 < num537) { num537 = num541; @@ -271,9 +272,9 @@ namespace CalamityMod.Projectiles.Summon { if (Main.npc[num542].CanBeChasedBy(projectile, false)) { - float num543 = Main.npc[num542].position.X + (float)(Main.npc[num542].width / 2); - float num544 = Main.npc[num542].position.Y + (float)(Main.npc[num542].height / 2); - float num545 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num543) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num544); + float num543 = Main.npc[num542].Center.X; + float num544 = Main.npc[num542].Center.Y; + float num545 = Math.Abs(projectile.Center.X - num543) + Math.Abs(projectile.Center.Y - num544); if (num545 < num537) { num537 = num545; @@ -325,5 +326,17 @@ namespace CalamityMod.Projectiles.Summon projectile.frame = 0; } } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (Main.player[projectile.owner].Calamity().angelicAlliance) + target.AddBuff(ModContent.BuffType(), 300); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + if (Main.player[projectile.owner].Calamity().angelicAlliance) + target.AddBuff(ModContent.BuffType(), 300); + } } } diff --git a/Projectiles/Summon/MiniGuardianDefense.cs b/Projectiles/Summon/MiniGuardianDefense.cs index ed5d0abef1..4dfdd2534f 100644 --- a/Projectiles/Summon/MiniGuardianDefense.cs +++ b/Projectiles/Summon/MiniGuardianDefense.cs @@ -1,3 +1,4 @@ +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.CalPlayer; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -96,17 +97,17 @@ namespace CalamityMod.Projectiles.Summon projectile.tileCollide = false; int num17 = 100; Vector2 vector3 = projectile.Center; - float num18 = Main.player[projectile.owner].Center.X - vector3.X; - float num19 = Main.player[projectile.owner].Center.Y - vector3.Y; + float num18 = player.Center.X - vector3.X; + float num19 = player.Center.Y - vector3.Y; num19 += (float)Main.rand.Next(-10, 21); num18 += (float)Main.rand.Next(-10, 21); - num18 += (float)(60 * -(float)Main.player[projectile.owner].direction); + num18 += (float)(60 * -(float)player.direction); num19 -= 60f; float num20 = (float)Math.Sqrt((double)(num18 * num18 + num19 * num19)); float num21 = 18f; - if (num20 < (float)num17 && Main.player[projectile.owner].velocity.Y == 0f && - projectile.position.Y + (float)projectile.height <= Main.player[projectile.owner].position.Y + (float)Main.player[projectile.owner].height && + if (num20 < (float)num17 && player.velocity.Y == 0f && + projectile.position.Y + (float)projectile.height <= player.position.Y + (float)player.height && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) { projectile.ai[0] = 0f; @@ -117,8 +118,7 @@ namespace CalamityMod.Projectiles.Summon } if (num20 > 2000f) { - projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); - projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2); + projectile.position = player.position; projectile.netUpdate = true; } if (num20 < 50f) @@ -146,34 +146,34 @@ namespace CalamityMod.Projectiles.Summon if (projectile.velocity.X < num18) { - projectile.velocity.X = projectile.velocity.X + num16; + projectile.velocity.X += num16; if (num16 > 0.05f && projectile.velocity.X < 0f) { - projectile.velocity.X = projectile.velocity.X + num16; + projectile.velocity.X += num16; } } if (projectile.velocity.X > num18) { - projectile.velocity.X = projectile.velocity.X - num16; + projectile.velocity.X -= num16; if (num16 > 0.05f && projectile.velocity.X > 0f) { - projectile.velocity.X = projectile.velocity.X - num16; + projectile.velocity.X -= num16; } } if (projectile.velocity.Y < num19) { - projectile.velocity.Y = projectile.velocity.Y + num16; + projectile.velocity.Y += num16; if (num16 > 0.05f && projectile.velocity.Y < 0f) { - projectile.velocity.Y = projectile.velocity.Y + num16 * 2f; + projectile.velocity.Y += num16 * 2f; } } if (projectile.velocity.Y > num19) { - projectile.velocity.Y = projectile.velocity.Y - num16; + projectile.velocity.Y -= num16; if (num16 > 0.05f && projectile.velocity.Y > 0f) { - projectile.velocity.Y = projectile.velocity.Y - num16 * 2f; + projectile.velocity.Y -= num16 * 2f; } } break; @@ -244,6 +244,7 @@ namespace CalamityMod.Projectiles.Summon projectile.active = false; return; } + projectile.MinionAntiClump(); float num535 = projectile.position.X; float num536 = projectile.position.Y; float num537 = 3000f; @@ -251,9 +252,9 @@ namespace CalamityMod.Projectiles.Summon NPC ownerMinionAttackTargetNPC2 = projectile.OwnerMinionAttackTargetNPC; if (ownerMinionAttackTargetNPC2 != null && ownerMinionAttackTargetNPC2.CanBeChasedBy(projectile, false)) { - float num539 = ownerMinionAttackTargetNPC2.position.X + (float)(ownerMinionAttackTargetNPC2.width / 2); - float num540 = ownerMinionAttackTargetNPC2.position.Y + (float)(ownerMinionAttackTargetNPC2.height / 2); - float num541 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num539) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num540); + float num539 = ownerMinionAttackTargetNPC2.Center.X; + float num540 = ownerMinionAttackTargetNPC2.Center.Y; + float num541 = Math.Abs(projectile.Center.X - num539) + Math.Abs(projectile.Center.Y - num540); if (num541 < num537) { num537 = num541; @@ -269,9 +270,9 @@ namespace CalamityMod.Projectiles.Summon { if (Main.npc[num542].CanBeChasedBy(projectile, false)) { - float num543 = Main.npc[num542].position.X + (float)(Main.npc[num542].width / 2); - float num544 = Main.npc[num542].position.Y + (float)(Main.npc[num542].height / 2); - float num545 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num543) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num544); + float num543 = Main.npc[num542].Center.X; + float num544 = Main.npc[num542].Center.Y; + float num545 = Math.Abs(projectile.Center.X - num543) + Math.Abs(projectile.Center.Y - num544); if (num545 < num537) { num537 = num545; @@ -321,5 +322,17 @@ namespace CalamityMod.Projectiles.Summon projectile.frame = 0; } } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (Main.player[projectile.owner].Calamity().angelicAlliance) + target.AddBuff(ModContent.BuffType(), 300); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + if (Main.player[projectile.owner].Calamity().angelicAlliance) + target.AddBuff(ModContent.BuffType(), 300); + } } } diff --git a/Projectiles/Summon/MiniGuardianHealer.cs b/Projectiles/Summon/MiniGuardianHealer.cs index 1ab9ca526e..35577702b1 100644 --- a/Projectiles/Summon/MiniGuardianHealer.cs +++ b/Projectiles/Summon/MiniGuardianHealer.cs @@ -57,13 +57,14 @@ namespace CalamityMod.Projectiles.Summon projectile.active = false; return; } + projectile.MinionAntiClump(); Player projOwner = Main.player[projectile.owner]; float num16 = 0.5f; projectile.tileCollide = false; int num17 = 100; - Vector2 vector3 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num18 = projOwner.position.X + (float)(projOwner.width / 2) - vector3.X; - float num19 = projOwner.position.Y + (float)(projOwner.height / 2) - vector3.Y; + Vector2 vector3 = projectile.Center; + float num18 = projOwner.Center.X - vector3.X; + float num19 = projOwner.Center.Y - vector3.Y; num19 += (float)Main.rand.Next(-10, 21); num18 += (float)Main.rand.Next(-10, 21); num18 += (float)(60 * -(float)projOwner.direction); @@ -83,8 +84,7 @@ namespace CalamityMod.Projectiles.Summon } if (num20 > 2000f) { - projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); - projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2); + projectile.position = projOwner.position; projectile.netUpdate = true; } if (num20 < 50f) @@ -112,46 +112,46 @@ namespace CalamityMod.Projectiles.Summon if (projectile.velocity.X < num18) { - projectile.velocity.X = projectile.velocity.X + num16; + projectile.velocity.X += num16; if (num16 > 0.05f && projectile.velocity.X < 0f) { - projectile.velocity.X = projectile.velocity.X + num16; + projectile.velocity.X += num16; } } if (projectile.velocity.X > num18) { - projectile.velocity.X = projectile.velocity.X - num16; + projectile.velocity.X -= num16; if (num16 > 0.05f && projectile.velocity.X > 0f) { - projectile.velocity.X = projectile.velocity.X - num16; + projectile.velocity.X -= num16; } } if (projectile.velocity.Y < num19) { - projectile.velocity.Y = projectile.velocity.Y + num16; + projectile.velocity.Y += num16; if (num16 > 0.05f && projectile.velocity.Y < 0f) { - projectile.velocity.Y = projectile.velocity.Y + num16 * 2f; + projectile.velocity.Y += num16 * 2f; } } if (projectile.velocity.Y > num19) { - projectile.velocity.Y = projectile.velocity.Y - num16; + projectile.velocity.Y -= num16; if (num16 > 0.05f && projectile.velocity.Y > 0f) { - projectile.velocity.Y = projectile.velocity.Y - num16 * 2f; + projectile.velocity.Y -= num16 * 2f; } } - if ((double)projectile.velocity.X > 0.25) + if (projectile.velocity.X > 0.25f) { projectile.direction = -1; } - else if ((double)projectile.velocity.X < -0.25) + else if (projectile.velocity.X < -0.25f) { projectile.direction = 1; } - if ((double)Math.Abs(projectile.velocity.X) > 0.2) + if (Math.Abs(projectile.velocity.X) > 0.2f) { projectile.spriteDirection = -projectile.direction; } diff --git a/Projectiles/Typeless/AllianceTriangle.cs b/Projectiles/Typeless/AllianceTriangle.cs new file mode 100644 index 0000000000..6fb40cbdfd --- /dev/null +++ b/Projectiles/Typeless/AllianceTriangle.cs @@ -0,0 +1,58 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Typeless +{ + public class AllianceTriangle : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Alliance Triangle"); + } + + public override void SetDefaults() + { + projectile.width = 154; + projectile.height = 134; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.alpha = 254; + } + + public override void AI() + { + Player player = Main.player[projectile.owner]; + Lighting.AddLight(projectile.Center, new Vector3(240, 185, 7) * (3f / 255)); + projectile.Center = player.Center; + + projectile.ai[0]++; + if (projectile.ai[0] <= 30f) + { + projectile.alpha -= 75; + if (projectile.alpha < 0) + projectile.alpha = 0; + } + else if (projectile.ai[0] > 120f) + projectile.alpha += 50; + + if (projectile.alpha >= 255 || player is null || player.dead) + { + projectile.Kill(); + } + } + + public override Color? GetAlpha(Color lightColor) + { + if (projectile.alpha <= 0) + return new Color(200, 200, 200, 200); + return null; + } + + public override bool CanDamage() => false; + } +} diff --git a/Projectiles/Typeless/AllianceTriangle.png b/Projectiles/Typeless/AllianceTriangle.png new file mode 100644 index 0000000000000000000000000000000000000000..66f397a1f38d825ef716bf31f71132dc77e472ed GIT binary patch literal 1809 zcmX9<2{@bS7XC}QYNR#yrqgLgm1(K1EfuDXZK#N4#1fh&TB?YxL~KceMp5k;X|zI3 zFf^DVG&9IBsNUh;Yv+arS1g^ei%?XIeZIKQzkJU*-}%lt?|aVq|8L!~7?>(T6@nm` zlcT*SSUKQHS5XFU9ZB{kSdIqUy4pg}&#X^&{gr@xB*qhC2fgmoSO9`nfTO1?1krUN zC^-#+wt*^n9)jYGA!zXq1flXE=u}ieqlYEfP`>Mev4;-iSMi%y*+AjvWN+(58QUWr(_h$K2(}obrd^4F1%aBN@utma@?G zHB!#hAEK6rTw4`d9mQ9bFN48hcC;~^?)_SgPMkhTf z%rWS?P%G_%L!pjN!ZGm-qyHKFL*ZUxPrZ|~9^xov7Z>z_^gMdw>37~%?-zVwAip1` zh39qFWZ35~64-e8;eaAtiQ3mShFQqtFIMq_Wzv(ct-Xs7CH*d(AgQ4cD@r!9j6t6@@i*EXnS|*v#lE}_R1uJsktC`>o0!w zZ(~KR4N;IrxAD_gGkW}Vz|933(&^enYka+CSEWV<q$H=6*62ieycd!98a%ikLuZF(_QT=EaljMcu{xncnCs zvMYgAt0Xtx#hKjsmzB*^-dDW3$#863_hFVJoh1a*U>9-k+Es5dDUUERzyq~xt#P~F z-tfJCt$CLinaMNrK1UQC>Z3JXKMe}Q?3QH?6Y5(0h}*kUo8EJF9st-i^iH~{J1_cU zNztEOJ&)pUx%==V^yQGhZ+ffUW#q9D#iN~S+bJequ8)Oh0Mv%`x*>YN){09)u5*G* zkq@iZ>#f|=_U)CdYhrJU0CSkYf@9#`w`>F2scKqSdOF$jOzi;WN1ou>z&8$|7E(%X z!*Kx4SQ<&~=yT*qNeS8M5+P^&C4!M3X9a?5kCnvrKp#m~ODQkfi3UxIpo%1i!hr;) z>kmtJPmy!$>z|MNSBrjr$H4(d>hV;ImLftgam2OL`KrT9m+2Wf9cnD|^Z5NcRRUCQ zB2@vnNS_oniOhUpkC%>%HZ+p<8ULv7b5IgH`*(y5 zwKH*BIOjQfZ8IZB@(vZFj(AfNqMp*kJq_j#uBMM;?wf(`iNgPFQNjuu zrZ~w39I|b6cF2gy`o-G2Ga4>xi7Cy=BiFAtPRPOE)#%-}=9b2~v99P;nI3WawNMg= z0W+}N6u+6{8sGjKudG$}`fva^Rvg>TD%EziufG_QL=fAHssE9WwBZ((;558DBdkk1Vp_XaK z4AJk^m@3>1x=00X_2|epv3c1_qGSw_iI#|*#nkGVryvhb`5@{7iGyp)XQE94vIZOf zh>5cS2mW*w!l^BIvxvOwJp2ujzu_T$<@f6*C@I_5;Cf-?$Sg5S?#hkuC4mP zWYRzbVZYF#_&B1cY+)Q0I{W+R2|&WKC5Ia8$lg+`Jj@t~20U&J_wm-4QX`j8vG>(p zR$q7}f%1>S&|2Tdz66uX$?8MP7C8B8cxW|)RLvrJ7NpOQjAD6q6{F+-?GwNKfrSd`Ly{VRLDU7{Ppc`0T+Iu`yFra?{I7GzFT-*6xT{0WvO>jFopxmNEgCb-7V?)W2kV)Fj Rr4_IXIia!kukG%n`~|DESa$#b literal 0 HcmV?d00001 diff --git a/Sounds/Custom/AngelicAllianceActivation.cs b/Sounds/Custom/AngelicAllianceActivation.cs new file mode 100644 index 0000000000..2df6ffa472 --- /dev/null +++ b/Sounds/Custom/AngelicAllianceActivation.cs @@ -0,0 +1,18 @@ +using Microsoft.Xna.Framework.Audio; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Sounds.Custom +{ + public class AngelicAllianceActivation : ModSound + { + public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) + { + soundInstance = sound.CreateInstance(); + soundInstance.Volume = volume * 1f; + soundInstance.Pan = pan; + Main.PlaySoundInstance(soundInstance); + return soundInstance; + } + } +} diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index a16f5592e8..0c9bb15ee4 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -1515,8 +1515,7 @@ namespace CalamityMod //Teleport to the player if abnormally far if (playerDist > 2000f) { - projectile.position.X = player.Center.X - (float)(projectile.width / 2); - projectile.position.Y = player.Center.Y - (float)(projectile.height / 2); + projectile.position = player.Center; projectile.netUpdate = true; } //If more than 70 pixels away, move toward the player @@ -3558,7 +3557,7 @@ namespace CalamityMod spriteBatch.Draw(glowmaskTexture, item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); } - public static void DrawAuroras(Player player, float auroraCount, float opacity, Color color) + public static void DrawAuroras(Player player, float auroraCount, float opacity, Color color, bool provDye = false) { float time = Main.GlobalTime % 3f / 3f; Texture2D auroraTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/AuroraTexture"); @@ -3569,6 +3568,11 @@ namespace CalamityMod float yOffset = (float)Math.Sin(time * MathHelper.TwoPi + incrementOffsetAngle * 2f + MathHelper.ToRadians(60f)) * 6f; float rotation = (float)Math.Sin(incrementOffsetAngle) * MathHelper.Pi / 12f; Vector2 offset = new Vector2(xOffset, yOffset - 14f); + + //Profaned Moonlight Dye because it needs to use something inside the loop + if (provDye) + color = CalamityPlayerDrawEffects.GetCurrentMoonlightDyeColor(incrementOffsetAngle); + DrawData drawData = new DrawData(auroraTexture, player.Top + offset - Main.screenPosition, null,