From cfc2c422d495c05e6acf79330d499dd607c47f47 Mon Sep 17 00:00:00 2001 From: ben-tk <45545085+ben-tk@users.noreply.github.com> Date: Wed, 5 Jan 2022 20:22:01 -0500 Subject: [PATCH] omg, anime girl works in vanity slots now.... also some vanity adjustments with the crowns so they check whatever is lowest in your acc slots --- CalPlayer/CalamityPlayer.cs | 29 +++++++++++++++++-- .../Pets/DaawnlightSpiritOriginMinion.cs | 2 +- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 57090d75f1..4895cb7d5b 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -1,6 +1,7 @@ using CalamityMod.Buffs; using CalamityMod.Buffs.Cooldowns; using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.Pets; using CalamityMod.Buffs.Potions; using CalamityMod.Buffs.StatBuffs; using CalamityMod.Buffs.StatDebuffs; @@ -579,6 +580,7 @@ namespace CalamityMod.CalPlayer public bool lumenousAmulet = false; public bool aquaticEmblem = false; public bool spiritOrigin = false; + public bool spiritOriginVanity = false; public bool darkSunRing = false; public bool calamityRing = false; public bool voidOfExtinction = false; @@ -1779,6 +1781,7 @@ namespace CalamityMod.CalPlayer lumenousAmulet = false; aquaticEmblem = false; spiritOrigin = false; + spiritOriginVanity = false; spiritOriginConvertedCrit = 0; astralStarRain = false; @@ -3667,17 +3670,37 @@ namespace CalamityMod.CalPlayer profanedCrystalHide = false; profanedCrystalForce = true; } - else if (item.type == ModContent.ItemType()) + + // Whichever is lowest in your vanity slots should take priority + if (item.type == ModContent.ItemType()) { + featherCrownDraw = false; + moonCrownDraw = false; abyssDivingGear = true; } - else if (item.type == ModContent.ItemType()) + if (item.type == ModContent.ItemType()) { + abyssDivingGear = false; + moonCrownDraw = false; featherCrownDraw = true; } - else if (item.type == ModContent.ItemType()) + if (item.type == ModContent.ItemType()) { + abyssDivingGear = false; + featherCrownDraw = false; moonCrownDraw = true; + } + + // Summon anime girl if it's in vanity slot as the pet is purely vanity + // It's possible for other "pet" items like Howl's Heart or HotE to summon a passive version of their "pets" with some tweaks though + if (item.type == ModContent.ItemType()) + { + spiritOriginVanity = true; + if (player.whoAmI == Main.myPlayer) + { + if (player.FindBuffIndex(ModContent.BuffType()) == -1) + player.AddBuff(ModContent.BuffType(), 18000, true); + } } } } diff --git a/Projectiles/Pets/DaawnlightSpiritOriginMinion.cs b/Projectiles/Pets/DaawnlightSpiritOriginMinion.cs index 612c42e69e..594b17ec49 100644 --- a/Projectiles/Pets/DaawnlightSpiritOriginMinion.cs +++ b/Projectiles/Pets/DaawnlightSpiritOriginMinion.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Pets public void HandlePetStuff() { - if (Owner.dead || !Owner.Calamity().spiritOrigin) + if (Owner.dead || !Owner.Calamity().spiritOrigin && !Owner.Calamity().spiritOriginVanity) Owner.Calamity().spiritOriginPet = false; if (Owner.Calamity().spiritOriginPet) projectile.timeLeft = 2;