From 109eadb2f1ff4f2da2c22ecabd122ac16e08ac8b Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Tue, 26 May 2020 23:04:49 -0400 Subject: [PATCH 001/202] set up basics for calamitas npc --- CalPlayer/CalamityPlayer.cs | 5 + NPCs/CalamityGlobalNPC.cs | 8 + NPCs/TownNPCs/WITCH.cs | 334 ++++++++++++++++++ NPCs/TownNPCs/WITCH.png | Bin 0 -> 4396 bytes NPCs/TownNPCs/WITCH_Head.png | Bin 0 -> 342 bytes .../SeethingDischargeBrimstoneHellblast.cs | 12 + 6 files changed, 359 insertions(+) create mode 100644 NPCs/TownNPCs/WITCH.cs create mode 100644 NPCs/TownNPCs/WITCH.png create mode 100644 NPCs/TownNPCs/WITCH_Head.png diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 1c967fe618..5b55734ffd 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -132,6 +132,7 @@ namespace CalamityMod.CalPlayer public bool newCirrusInventory = false; public bool newAmidiasInventory = false; public bool newBanditInventory = false; + public bool newCalamitasInventory = false; #endregion #region Stat Meter @@ -972,6 +973,7 @@ namespace CalamityMod.CalPlayer newCirrusInventory = false; newAmidiasInventory = false; newBanditInventory = false; + newCalamitasInventory = false; } public override TagCompound Save() @@ -1019,6 +1021,7 @@ namespace CalamityMod.CalPlayer boost.AddWithCondition("newCirrusInventory", newCirrusInventory); boost.AddWithCondition("newAmidiasInventory", newAmidiasInventory); boost.AddWithCondition("newBanditInventory", newBanditInventory); + boost.AddWithCondition("newCalamitasInventory", newCalamitasInventory); return new TagCompound { @@ -1090,6 +1093,7 @@ namespace CalamityMod.CalPlayer newCirrusInventory = boost.Contains("newCirrusInventory"); newAmidiasInventory = boost.Contains("newAmidiasInventory"); newBanditInventory = boost.Contains("newBanditInventory"); + newCalamitasInventory = boost.Contains("newCalamitasInventory"); rage = tag.GetAsInt("stress"); adrenaline = tag.GetAsInt("adrenaline"); @@ -1191,6 +1195,7 @@ namespace CalamityMod.CalPlayer BitsByte flags6 = reader.ReadByte(); newBanditInventory = flags6[0]; + newCalamitasInventory = flags6[1]; } else { diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 3f5e146fa3..e252e2c6d3 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -4670,6 +4670,10 @@ namespace CalamityMod.NPCs { DrawNewInventoryAlert(npc); } + else if (npc.type == NPCType() && Main.LocalPlayer.Calamity().newCalamitasInventory) + { + DrawNewInventoryAlert(npc); + } else { switch (npc.type) @@ -5736,6 +5740,10 @@ namespace CalamityMod.NPCs { Main.LocalPlayer.Calamity().newBanditInventory = true; } + else if (types[i] == NPCType()) + { + Main.LocalPlayer.Calamity().newCalamitasInventory = true; + } else { switch (types[i]) diff --git a/NPCs/TownNPCs/WITCH.cs b/NPCs/TownNPCs/WITCH.cs new file mode 100644 index 0000000000..ff27ce9ad1 --- /dev/null +++ b/NPCs/TownNPCs/WITCH.cs @@ -0,0 +1,334 @@ +using CalamityMod.Dusts; +using CalamityMod.Items.Accessories; +using CalamityMod.Items.Tools; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; +using CalamityMod.Projectiles.Magic; +using CalamityMod.World; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System.Collections.Generic; +using Terraria; +using Terraria.GameContent.Events; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; +namespace CalamityMod.NPCs.TownNPCs +{ + [AutoloadHead] + public class WITCH : ModNPC + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Brimstone Witch"); + + Main.npcFrameCount[npc.type] = 26; + NPCID.Sets.ExtraFramesCount[npc.type] = 9; + NPCID.Sets.AttackFrameCount[npc.type] = 4; + NPCID.Sets.DangerDetectRange[npc.type] = 700; + NPCID.Sets.AttackType[npc.type] = 2; + NPCID.Sets.AttackTime[npc.type] = 90; + NPCID.Sets.AttackAverageChance[npc.type] = 15; + NPCID.Sets.MagicAuraColor[npc.type] = new Color(250, 50, 50); + } + + public override void SetDefaults() + { + npc.townNPC = true; + npc.friendly = true; + npc.lavaImmune = true; + npc.width = 18; + npc.height = 40; + npc.aiStyle = 7; + npc.damage = 10; + //Has the same amount of life, defense, and dr as SCal + npc.Calamity().DR = CalamityWorld.death ? 0.75f : 0.7f; + npc.defense = 120; + npc.lifeMax = (int)((CalamityWorld.revenge ? 5500000 : 5000000) * (Main.expertMode ? 1.6f : 1f)); + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath6; + npc.knockBackResist = 0.8f; + animationType = NPCID.Wizard; + } + + public override void AI() + { + //To account for revengeance/death mode switching + if (npc.lifeMax != (int)((CalamityWorld.revenge ? 5500000 : 5000000) * (Main.expertMode ? 1.6f : 1f))) + { + npc.lifeMax = (int)((CalamityWorld.revenge ? 5500000 : 5000000) * (Main.expertMode ? 1.6f : 1f)); + } + if (npc.Calamity().DR != (CalamityWorld.death ? 0.75f : 0.7f)) + { + npc.Calamity().DR = CalamityWorld.death ? 0.75f : 0.7f; + } + } + + public override bool CanTownNPCSpawn(int numTownNPCs, int money) => CalamityWorld.downedSCal; + + public override string TownNPCName() => "Calamitas"; + + public override string GetChat() + { + if (npc.homeless) //not sure how to check if he has ever found a home before (to make this dialogue only run when he first spawns) + { + if (Main.rand.NextBool(2)) + return "I deeply appreciate you rescuing me from being trapped within my frozen castle... It's been many, many years..."; + else + return "Thank you for saving me...though now I admit I am without a home since mine got destroyed."; + } + + IList dialogue = new List(); + + if (Main.dayTime) + { + dialogue.Add("I must admit...I am not quite used to this weather. It's too warm for my taste..."); + dialogue.Add("My dear! What is it you would like to talk about today?"); + dialogue.Add("Why...I don't have to worry about any time of the day! If it is hot...then I can use my ice magic to cool down!"); + dialogue.Add("I do usually prefer a spot of humidity for my ice magic. It likes to come out as steam when it's too hot and dry..."); + dialogue.Add("Magic is a skill that must be learned and practiced! You seem to have an inherent talent for it at your age. I have spent all of my life honing it..."); + dialogue.Add("Why ice magic, you ask? Well, my parents were both pyromaniacs..."); + } + else + { + dialogue.Add("There be monsters lurking in the darkness. Most...unnatural monsters."); + dialogue.Add("You could break the icy stillness in the air tonight."); + dialogue.Add("Hmm...some would say that an unforeseen outside force is the root of the blood moon..."); + dialogue.Add("I was once the greatest Archmage of ice that ever hailed the lands. Whether or not that is still applicable, I am not sure..."); + dialogue.Add("There used to be other Archmages of other elements. I wonder where they are now...if they are also alive..."); + dialogue.Add("Oh...I wish I could tell you all about my life and the lessons I have learned, but it appears you have a great many things to do..."); + } + + dialogue.Add("I assure you, I will do my best to act as the cool grandfather figure you always wanted."); + + if (BirthdayParty.PartyIsUp) + dialogue.Add("Sometimes...I feel like all I'm good for during these events is making ice cubes and slushies."); + + if (NPC.downedMoonlord) + { + dialogue.Add("Tread carefully, my friend... Now that the Moon Lord has been defeated, many powerful creatures will crawl out to challenge you..."); + dialogue.Add("I feel the balance of nature tilting farther than ever before. Is it due to you, or because of the events leading to now...?"); + } + + if (CalamityWorld.downedPolterghast) + dialogue.Add("I felt a sudden chill down my spine. I sense something dangerous stirring in the Abyss..."); + + if (CalamityWorld.downedYharon) + dialogue.Add("...Where is Lord Yharim? He must be up to something..."); + + int dryad = NPC.FindFirstNPC(NPCID.Dryad); + if (dryad != -1) + dialogue.Add("Yes, I am older than " + Main.npc[dryad].GivenName + ". You can stop asking now..."); + + if (Main.player[Main.myPlayer].Calamity().chibii) + dialogue.Add("What an adorable tiny companion you have! Where in the world did you find such a...creature...? Actually, I'd rather not know."); + + if (Main.player[Main.myPlayer].Calamity().cryogenSoul) + dialogue.Add(Main.player[Main.myPlayer].name + "...just between us, I think I forgot my soul in the ice castle. If you see it, please do let me know."); + + if (Main.hardMode) + dialogue.Add("It wouldn't be the first time something unknown and powerful dropped from the heavens...I would tread carefully if I were you..."); + + return dialogue[Main.rand.Next(dialogue.Count)]; + } + + public override void SetChatButtons(ref string button, ref string button2) + { + button = Language.GetTextValue("LegacyInterface.28"); + } + + public override void OnChatButtonClicked(bool firstButton, ref bool shop) + { + if (firstButton) + { + Main.LocalPlayer.Calamity().newCalamitasInventory = false; + shop = true; + } + } + + public override void SetupShop(Chest shop, ref int nextSlot) + { + //Melee weapons + if (Main.LocalPlayer.HasItem(ItemType())) + { + shop.item[nextSlot].SetDefaults(ItemType()); + nextSlot++; + } + if (Main.LocalPlayer.HasItem(ItemType())) + { + shop.item[nextSlot].SetDefaults(ItemType()); + nextSlot++; + } + if (Main.LocalPlayer.HasItem(ItemType())) + { + shop.item[nextSlot].SetDefaults(ItemType()); + nextSlot++; + } + if (Main.LocalPlayer.HasItem(ItemType())) + { + shop.item[nextSlot].SetDefaults(ItemType()); + nextSlot++; + } + if (Main.LocalPlayer.HasItem(ItemType())) + { + shop.item[nextSlot].SetDefaults(ItemType()); + nextSlot++; + } + //Ranged weapons + if (Main.LocalPlayer.HasItem(ItemType())) + { + shop.item[nextSlot].SetDefaults(ItemType()); + nextSlot++; + } + if (Main.LocalPlayer.HasItem(ItemType())) + { + shop.item[nextSlot].SetDefaults(ItemType()); + nextSlot++; + } + if (Main.LocalPlayer.HasItem(ItemType())) + { + shop.item[nextSlot].SetDefaults(ItemType()); + nextSlot++; + } + if (Main.LocalPlayer.HasItem(ItemType())) + { + shop.item[nextSlot].SetDefaults(ItemType()); + nextSlot++; + } + //Magic weapons + if (Main.LocalPlayer.HasItem(ItemType())) + { + shop.item[nextSlot].SetDefaults(ItemType()); + nextSlot++; + } + if (Main.LocalPlayer.HasItem(ItemType())) + { + shop.item[nextSlot].SetDefaults(ItemType()); + nextSlot++; + } + if (Main.LocalPlayer.HasItem(ItemType())) + { + shop.item[nextSlot].SetDefaults(ItemType()); + nextSlot++; + } + //Summon weapons + if (Main.LocalPlayer.HasItem(ItemType())) + { + shop.item[nextSlot].SetDefaults(ItemType()); + nextSlot++; + } + if (Main.LocalPlayer.HasItem(ItemType())) + { + shop.item[nextSlot].SetDefaults(ItemType()); + nextSlot++; + } + //Rogue weapons + if (Main.LocalPlayer.HasItem(ItemType())) + { + shop.item[nextSlot].SetDefaults(ItemType()); + nextSlot++; + } + //Hybrid weapons + if (Main.LocalPlayer.HasItem(ItemType()) || Main.LocalPlayer.HasItem(ItemType())) + { + shop.item[nextSlot].SetDefaults(ItemType()); + nextSlot++; + shop.item[nextSlot].SetDefaults(ItemType()); + nextSlot++; + } + if (Main.LocalPlayer.HasItem(ItemType()) || Main.LocalPlayer.HasItem(ItemType())) + { + shop.item[nextSlot].SetDefaults(ItemType()); + nextSlot++; + shop.item[nextSlot].SetDefaults(ItemType()); + nextSlot++; + } + if (Main.LocalPlayer.HasItem(ItemType()) || Main.LocalPlayer.HasItem(ItemType())) + { + shop.item[nextSlot].SetDefaults(ItemType()); + nextSlot++; + shop.item[nextSlot].SetDefaults(ItemType()); + nextSlot++; + } + //Accessories + if (Main.LocalPlayer.HasItem(ItemType())) + { + shop.item[nextSlot].SetDefaults(ItemType()); + nextSlot++; + } + if (Main.LocalPlayer.HasItem(ItemType())) + { + shop.item[nextSlot].SetDefaults(ItemType()); + nextSlot++; + } + //Tools + if (Main.LocalPlayer.HasItem(ItemType())) + { + shop.item[nextSlot].SetDefaults(ItemType()); + nextSlot++; + } + } + + // Make this Town NPC teleport to the Queen statue when triggered. + public override bool CanGoToStatue(bool toKingStatue) => !toKingStatue; + + public override void TownNPCAttackStrength(ref int damage, ref float knockback) + { + damage = 50; + knockback = 10f; + } + + public override void TownNPCAttackCooldown(ref int cooldown, ref int randExtraCooldown) + { + cooldown = 10; + randExtraCooldown = 50; + } + + //public override void TownNPCAttackMagic(ref float auraLightMultiplier) + + public override void TownNPCAttackProj(ref int projType, ref int attackDelay) + { + projType = ProjectileType(); + attackDelay = 1; + } + + public override void TownNPCAttackProjSpeed(ref float multiplier, ref float gravityCorrection, ref float randomOffset) + { + multiplier = 2f; + } + + //Explode into red dust when die + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + npc.position = npc.Center; + npc.width = npc.height = 50; + npc.position.X -= npc.width / 2; + npc.position.Y -= npc.height / 2; + for (int dustIndex = 0; dustIndex < 5; dustIndex++) + { + int brimstone = Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); + Main.dust[brimstone].velocity *= 3f; + if (Main.rand.NextBool(2)) + { + Main.dust[brimstone].scale = 0.5f; + Main.dust[brimstone].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + } + } + for (int indexDust = 0; indexDust < 10; indexDust++) + { + int fire = Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 3f); + Main.dust[fire].noGravity = true; + Main.dust[fire].velocity *= 5f; + fire = Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); + Main.dust[fire].velocity *= 2f; + } + } + } + } +} diff --git a/NPCs/TownNPCs/WITCH.png b/NPCs/TownNPCs/WITCH.png new file mode 100644 index 0000000000000000000000000000000000000000..b6d9064a49be7651124bf7c5cd93b16cfdfecaaa GIT binary patch literal 4396 zcmeHKdpy&7AOEe5$=qooY`K($$fYDP!!g%}av5ooKB9~kmQA9kyou|%u^?IJ?Jbyp0=lou;y?>Y2@AZ3qzMs$g^4%$di=Cvn zvN!+$lJ5zGD}000FD zPJ3;I@2aX9N+{}SYFTdIZX+r0DFzQkAUv#a9xg6Xp1u@6{{j`2R6wiZu*u0I2Tw!? zHQU1E>=q#?8eY zWbgm;0l0sHYk_lHOTl|b1AtVk@CRv+s5k@w5?AeQtoBmUM`g`fyOuA;0pTel707fx_3=F}*%8vN-`D(UZHPlYreN#62T*le^nN|#R6gAs@d$nq~zlNfXf-}gn5q}weZ%W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G( zcH%Bjh~(rL+ouxgxym*|>^uJ>N1bVFqW>~mNw+lK-lV-*ok<$KHZFn@w>9(ZimXOD zn|ayZw4tR5o34R6?D1!( z*Sl46tM9|rncfopK1qqy8GItYi6qsJ<*76K&Q z=B7wJxDyj*q&}QIUwIzPDSN&NILnz&sOaCR9uE2URHyP*z%;J|ZS;~&`rtLokd2Rt z9XlHo2dB#7l@v3O4)j~ec>f+8@S+zfXoY7wvg%~pdZbgP;}lMXpAv@l(4{pM@T+`R z1C(~yJ;iHq26JSA6P(Cc`oag;!hHbc9_`rhtC@?`wXTt!iEShXiMFC7L8R4xvEw>Ezz`cmjwOl^ zyT6xAs7XTB)RhTaOCWaCbT97miEAYt^@#+A4Q+dz#|myGD-`06-dfl7I{ed&#tR(@ zzVPPKaDL07yo>HnRiw3bKcWIww{gg8!bXr-=c|Sfdf(Plv1~E0ab&^Kk9Koo^Up4U zZhEC_n7&`oKR}b9HA!^@o&`BA?!;Z!oy z(Z%2s*Er3p<*PGC(5cpP{XIB%M}G&C=+jI@h#U|memmDpx$|m|$TzWE+O)Um;P|Z1 z_lDlli(DClmJ8Znb)xp6cX#9-_Z#zIP##~u6fWcq{K*kgq2%Iae%&`B&Tx{e75bm zK5H_oEhb)4$GDisodgyO&74EL-ax+jm%*ORs{Qg=-zILb-1Gae^_F|!E_^zl9#IHy zx@$=m)ARMaIV{|2IugAut5v`B7(VbDI$)j7uJ-1*Q(&2u7M4Jf*D+#nPOrE)@Re?TfH^jKSA44lIuDa=43W zW-!b}%O}mo>M|=^OR)H{!^gpNWL_$mhN)k+{V{JadHOJGGbC-+CSJHC4Cd^VzLc}1)#319JrLr z$xQ(Zy?*%&YuLVf@&!eF_pw8e9QXJUxHN= 10) { From 0b880a6e39b4ffc2701c4730d5cf3905ad845dcb Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 21 Aug 2020 21:34:30 -0500 Subject: [PATCH 002/202] Universe splitter and Virid (at last) --- Buffs/Cooldowns/UniverseSplitterCooldown.cs | 19 ++ Buffs/Cooldowns/UniverseSplitterCooldown.png | Bin 0 -> 391 bytes Buffs/Summon/ViridVanguardBuff.cs | 36 ++++ Buffs/Summon/ViridVanguardBuff.png | Bin 0 -> 660 bytes CalPlayer/CalamityPlayer.cs | 2 + .../Lasers/UniverseSplitterHugeBeamEnd.png | Bin 0 -> 2822 bytes .../Lasers/UniverseSplitterHugeBeamMid.png | Bin 0 -> 1533 bytes .../Lasers/UniverseSplitterSmallBeamBegin.png | Bin 0 -> 226 bytes .../Lasers/UniverseSplitterSmallBeamEnd.png | Bin 0 -> 263 bytes .../Lasers/UniverseSplitterSmallBeamMid.png | Bin 0 -> 160 bytes Items/CalamityGlobalItem.cs | 34 +++ Items/Weapons/Summon/UniverseSplitter.cs | 90 ++++++++ Items/Weapons/Summon/UniverseSplitter.png | Bin 0 -> 5701 bytes Items/Weapons/Summon/ViridVanguard.cs | 110 ++++++++++ Items/Weapons/Summon/ViridVanguard.png | Bin 0 -> 611 bytes Projectiles/Summon/UniverseSplitterField.cs | 159 ++++++++++++++ Projectiles/Summon/UniverseSplitterField.png | Bin 0 -> 3289 bytes .../Summon/UniverseSplitterHugeBeam.cs | 201 ++++++++++++++++++ .../Summon/UniverseSplitterHugeBeam.png | Bin 0 -> 966 bytes .../Summon/UniverseSplitterSmallBeam.cs | 185 ++++++++++++++++ .../Summon/UniverseSplitterSmallBeam.png | Bin 0 -> 226 bytes Projectiles/Summon/ViridVanguardBlade.cs | 198 +++++++++++++++++ Projectiles/Summon/ViridVanguardBlade.png | Bin 0 -> 2879 bytes Projectiles/Summon/ViridVanguardBladeAlt.png | Bin 0 -> 2750 bytes 24 files changed, 1034 insertions(+) create mode 100644 Buffs/Cooldowns/UniverseSplitterCooldown.cs create mode 100644 Buffs/Cooldowns/UniverseSplitterCooldown.png create mode 100644 Buffs/Summon/ViridVanguardBuff.cs create mode 100644 Buffs/Summon/ViridVanguardBuff.png create mode 100644 ExtraTextures/Lasers/UniverseSplitterHugeBeamEnd.png create mode 100644 ExtraTextures/Lasers/UniverseSplitterHugeBeamMid.png create mode 100644 ExtraTextures/Lasers/UniverseSplitterSmallBeamBegin.png create mode 100644 ExtraTextures/Lasers/UniverseSplitterSmallBeamEnd.png create mode 100644 ExtraTextures/Lasers/UniverseSplitterSmallBeamMid.png create mode 100644 Items/Weapons/Summon/UniverseSplitter.cs create mode 100644 Items/Weapons/Summon/UniverseSplitter.png create mode 100644 Items/Weapons/Summon/ViridVanguard.cs create mode 100644 Items/Weapons/Summon/ViridVanguard.png create mode 100644 Projectiles/Summon/UniverseSplitterField.cs create mode 100644 Projectiles/Summon/UniverseSplitterField.png create mode 100644 Projectiles/Summon/UniverseSplitterHugeBeam.cs create mode 100644 Projectiles/Summon/UniverseSplitterHugeBeam.png create mode 100644 Projectiles/Summon/UniverseSplitterSmallBeam.cs create mode 100644 Projectiles/Summon/UniverseSplitterSmallBeam.png create mode 100644 Projectiles/Summon/ViridVanguardBlade.cs create mode 100644 Projectiles/Summon/ViridVanguardBlade.png create mode 100644 Projectiles/Summon/ViridVanguardBladeAlt.png diff --git a/Buffs/Cooldowns/UniverseSplitterCooldown.cs b/Buffs/Cooldowns/UniverseSplitterCooldown.cs new file mode 100644 index 0000000000..03270a884e --- /dev/null +++ b/Buffs/Cooldowns/UniverseSplitterCooldown.cs @@ -0,0 +1,19 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.Cooldowns +{ + public class UniverseSplitterCooldown : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Universe Splitter Cooldown"); + Description.SetDefault("You cannot use the Universe Splitter"); + Main.debuff[Type] = true; + Main.pvpBuff[Type] = true; + Main.buffNoSave[Type] = true; + longerExpertDebuff = false; + canBeCleared = false; + } + } +} diff --git a/Buffs/Cooldowns/UniverseSplitterCooldown.png b/Buffs/Cooldowns/UniverseSplitterCooldown.png new file mode 100644 index 0000000000000000000000000000000000000000..f24e416ef2c42f43d9b467cab3dd71f00e44c0db GIT binary patch literal 391 zcmV;20eJq2P)Px$K}keGR9J=WmoaVvF%U(cS13h<&{jD?4nW$JM1liQpeP+>nw*7(GF=o=Z~!7f zNec(y1gTIIrAQG{ph5EB0TxATqwt%R?H%v@zu)%QRkH>FpFfioC8C-&96(m)M?-MH z3gG%;>J5BcK6>rD<*d-eB%nY=cL;OMSTouOD_$!RU4e}UuJSry zXDd;76 z0olQ19T#P+cS7>;d(jmz>w%+BL$xaOX?QyIfMl#0h$k%UtB5qBE3kDhD61+?_g)|w lYQ}$kGZI8s!2SE%@h=i6hv`KB1MvU=002ovPDHLkV1g1&rI7#t literal 0 HcmV?d00001 diff --git a/Buffs/Summon/ViridVanguardBuff.cs b/Buffs/Summon/ViridVanguardBuff.cs new file mode 100644 index 0000000000..ef7f387078 --- /dev/null +++ b/Buffs/Summon/ViridVanguardBuff.cs @@ -0,0 +1,36 @@ +using CalamityMod.CalPlayer; +using CalamityMod.Projectiles.Summon; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.Summon +{ + public class ViridVanguardBuff : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Virid Vanguard"); + Description.SetDefault("A perfect act of unity surrounds you"); + Main.buffNoTimeDisplay[Type] = true; + Main.buffNoSave[Type] = true; + } + + public override void Update(Player player, ref int buffIndex) + { + CalamityPlayer modPlayer = player.Calamity(); + if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) + { + modPlayer.viridVanguard = true; + } + if (!modPlayer.viridVanguard) + { + player.DelBuff(buffIndex); + buffIndex--; + } + else + { + player.buffTime[buffIndex] = 18000; + } + } + } +} diff --git a/Buffs/Summon/ViridVanguardBuff.png b/Buffs/Summon/ViridVanguardBuff.png new file mode 100644 index 0000000000000000000000000000000000000000..5a824b9ddd93dbf33aa454585ccb099b06addf2a GIT binary patch literal 660 zcmV;F0&D$=P)Px%PDw;TR9J=OmrqDkQ5eO46VV@Rn$qE^poN4nSxs(ABwDl*gW0$XUDUE&OBXI$ zxX@K@!etSPLXe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oA%h*=C9&e>gaaAnC`iy}UQ);oFWos=#b`skVc z(tK>tk3x~W2=u=3Iv^RkH4FOvt9~w@?ag!#swUo-%DXI!$?)U9;|my<1*SKOENSWM4{o;fjaKb z@p&7}(WDy0v*$C7yq1oUq&y)$t#l77Tu7MPOd5+m5P@NdI&yZ_S>>8;{4HVPY?Ud< zDpVaaT>q;y!ivum+MuD4kLD8S3W-e#GOBbFIG4RKv!RZ%&0RM}46N?9NZxmA!2dZZ z0=Nanrq48R{wFy)R{bVwFAf$*clYC_ zr>7%e=1gQV9R37dYd#!5B^pKVeeC?B?XXyj=*nc@OBlM9b@*V|LaXFxp;aJnk@fIz z`Z5pcu|n%n?uhv#B`=Gq$uw=WW(Oz8KylqXA`BIDiS z`5YN|ZF`X+Fa?sG<}$bQq~Aj9>p~kTi>Lmw%sWz~CA}iFjpp z?8=%+p+PNHdO$?KqhRfb48_L}$`8DFN^iHW!jbv;H*oXgoz`eNVoWlhAqn&ceW?>`U^AD3jkwwlgOD>3bkMv0 z7yxOs%6r7DJq=AAIzMSQyls`uZ2x>Y&vGG`C6e0=FKX@UvX9x@lT(Uoz3Bf_WSTgu z=q&C*#jMDGX5@F!QMK{!FQ>OEJ6+7A2aTFLLxoW@WQXDozi7%z@BEOopbvd*bNaE)pz?Dn?lr-HdpUN`A$Bpp+$y6au!6T4ht3RH12 u`gvO?_OcA%;mdQmyzWB&Sa-er?b}>NhIUI|s?mMT2ZieC>(NP$%=-`4aZyqL literal 0 HcmV?d00001 diff --git a/ExtraTextures/Lasers/UniverseSplitterHugeBeamMid.png b/ExtraTextures/Lasers/UniverseSplitterHugeBeamMid.png new file mode 100644 index 0000000000000000000000000000000000000000..3fea77c900014025e19595ff31a6dbdae4502d3a GIT binary patch literal 1533 zcmeAS@N?(olHy`uVBq!ia0vp^Qy3T+YdF||EX|ln{XmMbILO_JVcj{ImkbQ7+dW+z zLn`LHy=#~!8!FLo(QwfMmqnkl_p(l75as5GPH@d(6mwwJb}Z^%9qu$+WU};L4>zYX z<$u#mo|~LgnUtJrcmKxu|95_G@cH(8_xH!s-%n4Cto!})v;F^v&%eIi|M%aAyZV2R zm#NhM`SJ7X{~zTw5z|tC{=44(CwceRqgTG4d&$u?Wq}7Ly@*=N*RuV=E7nc_`fK+7 zw7b!y+MTUO>@N`gn!d~-e)(r?O)!x%ooj~U01$L77<&%c=@*~ zsb8d8KGpu~qs-~Gv;ThS7VQf8_o8`u?7d@g^XoP`O%xK*bRx!Md&;RGyoSjp%n%8Py{<`VjYs1I+^NaWrZ$;`qHhz$HY>xG;y+*vi z7$7IU2?o^VZ#QaE#S`9T+-Wb2f5UV}(dYj1n#ec)akqBG|NQiEUi3l>7QCKYStEB! z=E}aa^SU=VO+3|}bjERS@7{B+kqbS1qZj7wYugmmx^11$_0v`7k6+&wrctK*UoT&z z{_|E5YoqK`sWli0$wzulPbM?p(JcoZXPP|_!ANGvmhNxO8pjil>ilw>uSbfa5Oh6#pR~%jGG{{-~UpQtUzP`1A|1;8fQv@Bq>hKw686 z=3oBazU$_}b9RB!Id{chRYku4dc*U=zW|v-TWrmaryn@$S9a&(o2i)_pn2gJL!A5i V@8z4Nm4M|rgQu&X%Q~loCIArQWuO26 literal 0 HcmV?d00001 diff --git a/ExtraTextures/Lasers/UniverseSplitterSmallBeamBegin.png b/ExtraTextures/Lasers/UniverseSplitterSmallBeamBegin.png new file mode 100644 index 0000000000000000000000000000000000000000..1f385eb92920ca142f064a5294605ccfe3a8c67e GIT binary patch literal 226 zcmeAS@N?(olHy`uVBq!ia0vp^d?3uh1|;P@bT0xa#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvI6;>1s;*bKn({$m~qF%?6*L{a!(h>5DWk0KlYV^%n}th95Y0J{uf}A+VOdU zpwD{?mSr;zs7Nv_EIhvOe?kxUf|J1q-5fpL434p0cye-^VBVqs7x*}mzXo>LtF=J^DICy#FNF@O_`aQ!SSZtz1|rM Re*m4p;OXk;vd$@?2>_W!lvI6;>1s;*bKn?prn9+hYSOq9J$J50z#KJ%M&-n+Z8`%CepFFuRp-Zvcv?VPe zq2*G-0hXnnYzn;!(hA!I*blrqxlQnidq=KNjez~0A1n|5-)C7SA@NtiWR}fMvrPsn zkq$maQ(AAdaJYs9yycr{|6gLwyhQ=7tP6fLA64X7@OfcFQ@~f9_6^(Ooq2sr7`S8o zbx-~2@L0Y2ltRf0-Xm!x8-8)9d^x=9fXGZUBLfD8fOVQ@!yL3tf$n7RboFyt=akR{ E0A6QYTL1t6 literal 0 HcmV?d00001 diff --git a/ExtraTextures/Lasers/UniverseSplitterSmallBeamMid.png b/ExtraTextures/Lasers/UniverseSplitterSmallBeamMid.png new file mode 100644 index 0000000000000000000000000000000000000000..ceb754745d5ce15c669c23683c2f889cd6a3e146 GIT binary patch literal 160 zcmeAS@N?(olHy`uVBq!ia0vp^d?3uh1|;P@bT0xa#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvI6;>1s;*bKn({#m@(^GCnr$Q)YHW=#KJ#0rJ?CR&%OY$37kxmoezpQzsuq{ zdw?PA^ob3UXA+qvr!)liRvcL2X47y_N>YNsc{Qs{-B!lcKm!;&UHx3vIVCg!0JbeG AjQ{`u literal 0 HcmV?d00001 diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index f43e2fbb45..0d969307d1 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -805,6 +805,40 @@ namespace CalamityMod.Items } return false; } + if (player.ActiveItem().type == ModContent.ItemType()) + { + int bladeCount = 0; + for (int i = 0; i < Main.projectile.Length; i++) + { + if (Main.projectile[i].active && + Main.projectile[i].type == ModContent.ProjectileType() && + Main.projectile[i].owner == player.whoAmI && + (Main.projectile[i].modProjectile as ViridVanguardBlade).FiringTime <= 0f) + { + bladeCount++; + } + } + if (bladeCount > 0) + { + int bladeIndex = 0; + for (int i = 0; i < Main.projectile.Length; i++) + { + if (Main.projectile[i].modProjectile is ViridVanguardBlade) + { + if ((Main.projectile[i].modProjectile as ViridVanguardBlade).FiringTime > 0f) + continue; + } + if (Main.projectile[i].active && Main.projectile[i].type == ModContent.ProjectileType() && Main.projectile[i].owner == player.whoAmI) + { + (Main.projectile[i].modProjectile as ViridVanguardBlade).FiringTime = 240f; + (Main.projectile[i].modProjectile as ViridVanguardBlade).RedirectAngle = MathHelper.Lerp(0f, MathHelper.TwoPi, bladeIndex / (float)bladeCount); + Main.projectile[i].netUpdate = true; + bladeIndex++; + } + } + } + return false; + } if (player.ActiveItem().type == ModContent.ItemType()) { bool hasBlades = false; diff --git a/Items/Weapons/Summon/UniverseSplitter.cs b/Items/Weapons/Summon/UniverseSplitter.cs new file mode 100644 index 0000000000..4fc5f0e934 --- /dev/null +++ b/Items/Weapons/Summon/UniverseSplitter.cs @@ -0,0 +1,90 @@ +using CalamityMod.Buffs.Cooldowns; +using CalamityMod.Items.Materials; +using CalamityMod.Items.SummonItems; +using CalamityMod.Projectiles.Summon; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Summon +{ + public class UniverseSplitter : ModItem + { + public const float ItemUseDustMaxRadius = 36f; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Universe Splitter"); + Tooltip.SetDefault("Summons an energy field at the mouse cursor\n" + + "After the field has been deployed, it begins to summon multiple small beams\n" + + "After several seconds have passed, an enormous laser beam appears at the field's position\n" + + "This effect has a cooldown\n" + + "Attempting to use this item during the cooldown will cause it to short circuit and do damage to you.\n" + + "An ancient artifact from a previous age, it waits for your command...\n" + + "This is a terrible idea, but it isn't yours anyways... right?"); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 14)); + } + + public override void SetDefaults() + { + item.width = 54; + item.height = 76; + item.useStyle = ItemUseStyleID.SwingThrow; + item.noMelee = true; + item.UseSound = SoundID.Item122; + + item.summon = true; + item.mana = 300; + item.damage = 18000; + item.knockBack = 7f; + item.autoReuse = true; + item.useTime = item.useAnimation = 10; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 10f; + item.noUseGraphic = true; + + item.value = CalamityGlobalItem.RarityHotPinkBuyPrice; + item.Calamity().customRarity = CalamityRarity.Developer; + } + + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + if (player.altFunctionUse != 2) + { + if (!player.HasBuff(ModContent.BuffType())) + { + player.AddBuff(ModContent.BuffType(), 45 * 60); + Projectile.NewProjectile(Main.MouseWorld, Vector2.Zero, type, damage, knockBack, player.whoAmI); + for (int i = 0; i < 36; i++) + { + float angle = MathHelper.TwoPi / 36f * i + Main.rand.NextFloat(MathHelper.TwoPi / 36f); + Dust dust = Dust.NewDustPerfect(position + angle.ToRotationVector2() * ItemUseDustMaxRadius, 247); + dust.velocity = Vector2.Normalize(angle.ToRotationVector2()) * 2.5f; + dust.noGravity = true; + dust.scale = 0.8f; + } + } + else + { + Projectile.NewProjectile(position, Vector2.UnitY * 3f, ProjectileID.SaucerScrap, 5, 0f, player.whoAmI); + } + } + return false; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 3); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddTile(ModContent.TileType()); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Weapons/Summon/UniverseSplitter.png b/Items/Weapons/Summon/UniverseSplitter.png new file mode 100644 index 0000000000000000000000000000000000000000..9397d8d05ab660745ccf7e291597240eaa23cba3 GIT binary patch literal 5701 zcmb_gYdF+<*Z#|%n4uI(=&)5z$q^q!Q`Nfu@)E*OZMU5FsZ$=bx|t*Gc^P$WITNm{)^52u&1JjVQ&0Q$ z%%$G2OjZp_+?8jSXne4al)v}9aEvJpmID(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vMV|giN4-W8y?{Zr8oQ;r05K{;?`<7!Y-+Sbs+p2j}ooK_=~2 zbF=~6F;e=s4exf3oUDhI`1imsk}XJUGVv1uN3VftmeWWl4*EX?k)qbpEhYLD$U=@g z8^Hd;ussMXmum^QX@taCQ7UxSea&i7<=`oHOuFW+T>#Uy@=vS9a#J|jRqmGYg;r|= zaKS+H#fG7xU;3EH*`=thD)shoBN}-3SI?w+K=ah3bPwR>@b_ai7ce|cm>C|Lf9FK z{+xmW#z--*^$PXkGw?mSK><0sCy})YZahp+6F>rzgx|nYXK@Z#8Pp2l-{i3HQ7N{;=dJlP}F^#TkR8ZG21 zVt=Bn`;nw-7omL~O!TK%l4;~Gm;==<;G|S>ua7Yw(65qBS mFrk`*bLszMhas=R6Im~TGOC`Oln3|1fZ2H~qauVW?tcKhpEMZ& literal 0 HcmV?d00001 diff --git a/Items/Weapons/Summon/ViridVanguard.cs b/Items/Weapons/Summon/ViridVanguard.cs new file mode 100644 index 0000000000..1eb96eccdb --- /dev/null +++ b/Items/Weapons/Summon/ViridVanguard.cs @@ -0,0 +1,110 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Summon; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Weapons.Summon +{ + public class ViridVanguard : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Virid Vanguard"); + Tooltip.SetDefault("Summons 2 blades that rotate around you\n" + + "Right clicking prompts all blades to fly upward and redirect towards the mouse"); + Item.staff[item.type] = true; + } + + public override void SetDefaults() + { + item.damage = 156; + item.summon = true; + item.sentry = true; + item.mana = 25; + item.width = 26; + item.height = 36; + item.useTime = item.useAnimation = 15; + item.useStyle = ItemUseStyleID.HoldingUp; + item.noMelee = true; + item.knockBack = 5f; + item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; + item.rare = 10; + item.autoReuse = true; + item.shoot = ModContent.ProjectileType(); + item.Calamity().customRarity = CalamityRarity.Turquoise; + } + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + float totalMinionSlots = 0f; + for (int i = 0; i < Main.projectile.Length; i++) + { + if (Main.projectile[i].active && Main.projectile[i].minion && Main.projectile[i].owner == player.whoAmI) + { + totalMinionSlots += Main.projectile[i].minionSlots; + } + } + if (player.altFunctionUse != 2 && totalMinionSlots + 1.5f < player.maxMinions) + { + position = Main.MouseWorld; + int swordCount = 0; + for (int i = 0; i < Main.projectile.Length; i++) + { + if (Main.projectile[i].active && Main.projectile[i].type == type && Main.projectile[i].owner == player.whoAmI) + { + if ((Main.projectile[i].modProjectile as ViridVanguardBlade).FiringTime > 0f) + continue; + swordCount++; + for (int j = 0; j < 22; j++) + { + Dust dust = Dust.NewDustDirect(Main.projectile[i].position, Main.projectile[i].width, Main.projectile[i].height, 2); + dust.velocity = Vector2.UnitY * Main.rand.NextFloat(3f, 5.5f) * Main.rand.NextBool(2).ToDirectionInt(); + dust.noGravity = true; + } + } + } + + Projectile newBlade = Projectile.NewProjectileDirect(position, Vector2.Zero, type, damage, knockBack, player.whoAmI); + (newBlade.modProjectile as ViridVanguardBlade).AltTexture = swordCount % 2 == 1; + newBlade.netUpdate = true; + swordCount++; + + newBlade = Projectile.NewProjectileDirect(position, Vector2.Zero, type, damage, knockBack, player.whoAmI); + (newBlade.modProjectile as ViridVanguardBlade).AltTexture = swordCount % 2 == 1; + newBlade.netUpdate = true; + swordCount++; + + float angleVariance = MathHelper.TwoPi / swordCount; + float angle = 0f; + for (int i = 0; i < Main.projectile.Length; i++) + { + if (Main.projectile[i].active && Main.projectile[i].type == type && Main.projectile[i].owner == player.whoAmI) + { + if ((Main.projectile[i].modProjectile as ViridVanguardBlade).FiringTime > 0f) + continue; + Main.projectile[i].ai[0] = angle; + Main.projectile[i].localAI[1] = 80f; + angle += angleVariance; + for (int j = 0; j < 22; j++) + { + Dust dust = Dust.NewDustDirect(Main.projectile[i].position, Main.projectile[i].width, Main.projectile[i].height, 6); + dust.velocity = Vector2.UnitY * Main.rand.NextFloat(3f, 5.5f) * Main.rand.NextBool(2).ToDirectionInt(); + dust.noGravity = true; + } + } + } + } + return false; + } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 8); + recipe.AddTile(TileID.LunarCraftingStation); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Weapons/Summon/ViridVanguard.png b/Items/Weapons/Summon/ViridVanguard.png new file mode 100644 index 0000000000000000000000000000000000000000..6455e12c546fdb36d8afde9540497657581396a7 GIT binary patch literal 611 zcmV-p0-XJcP)Px%9Z5t%R7i=wyC39pvsjRrcOo+2H?F02BaOdJ4exwFUsK``Y0!Y66hPJpewxJ1GF} zKD{b^0P0}|z#y$zq+wmJfHxu)wO0#(2QSvFfgi8?R$mB3$)2+8U*GIo*%9xg0e_PAsF7_~=M|HGf(z$Fj`>0xdeWOs=g-6j2CJdSSXrq$;7 zOQ2grC}gq%yZsK}lSnForokHf`TB!lB|0^qCGS9vzF#yZWWd+dh>GQ0*M50z* z$0ivJr^awD&lJEY&@14-dY4E@EYFj{P&wnApEn9>)=E^0=%4P`v*uNbXle{DYL7cV xfhy#Yt8;lJDvh0xh^j{ projectile.ai[0]; + set => projectile.ai[0] = value; + } + public float DustRadius = 0f; + public const float DustChargeTime = 30f; + public const float DustMinRadius = 0f; + public const float DustMaxRadius = 90f; + public const int SpiralPrecision = 25; + public const int SpiralRings = 5; + public const int TimeLeft = 720; + + public const float SmallBeamAngleMax = MathHelper.TwoPi / 15f; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Field"); + ProjectileID.Sets.MinionShot[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 200; + projectile.alpha = 255; + projectile.friendly = true; + projectile.minion = true; + projectile.minionSlots = 0f; + projectile.ignoreWater = true; + projectile.timeLeft = TimeLeft; + } + + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(DustRadius); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + DustRadius = reader.ReadSingle(); + } + + public override void AI() + { + Timer++; + if (Timer < DustChargeTime) + { + DustRadius = MathHelper.Lerp(DustMinRadius, DustMaxRadius, Timer / DustChargeTime); + } + else + { + DustRadius = DustMaxRadius + (float)Math.Sin(Timer / 50f) * 16f; + } + if (!Main.dedServ) + { + GenerateIdleDust(); + } + SpawnLasers(); + } + + public void GenerateIdleDust() + { + // Generate a dust ring that pulsates + for (int i = 0; i < 80; i++) + { + Dust dust = Dust.NewDustPerfect(projectile.Center + (i / 80f * MathHelper.TwoPi).ToRotationVector2() * DustRadius, 247); + dust.velocity = Vector2.Zero; + dust.scale = 1.2f; + dust.noGravity = true; + } + + // Spirals that spin around + for (int i = 0; i < SpiralPrecision; i++) + { + for (int direction = -1; direction <= 1; direction += 2) + { + for (int j = 0; j < SpiralRings; j++) + { + Dust dust = Dust.NewDustPerfect(projectile.Center + + Vector2.UnitY.RotatedBy(Timer / SpiralPrecision * direction).RotatedBy(j / (float)SpiralRings * MathHelper.TwoPi).RotatedBy(i / (float)SpiralPrecision * MathHelper.TwoPi / SpiralRings * direction) * + DustRadius * i / SpiralPrecision, 261); + dust.velocity = Vector2.Zero; + dust.scale = 0.7f; + dust.noGravity = true; + } + } + } + + // Outward expansion of dust + bool firingGiantLaserBeam = Timer > TimeLeft - UniverseSplitterHugeBeam.TimeLeft; + for (int i = 0; i < (firingGiantLaserBeam ? 30 : 16); i++) + { + Dust dust = Dust.NewDustPerfect(projectile.Center, 247); + dust.velocity = Main.rand.NextVector2Circular(8f, 8f) * (firingGiantLaserBeam ? 1.6f : 1f); + dust.noGravity = true; + dust.scale = 1.25f; + } + + // Energy dust that appears before the giant beam does and remains + if (Timer > TimeLeft - UniverseSplitterHugeBeam.TimeLeft - 120f) + { + float outwardCircleRadius = MathHelper.Lerp(0f, DustRadius * 1.2f, MathHelper.Clamp((Timer - (TimeLeft - UniverseSplitterHugeBeam.TimeLeft - 120f)) / 40f, 0f, 1f)); + for (int i = 0; i < 95; i++) + { + Dust dust = Dust.NewDustPerfect(projectile.Center + (i / 95f * MathHelper.TwoPi).ToRotationVector2() * outwardCircleRadius, 247); + dust.scale = 1.2f; + dust.noGravity = true; + dust.velocity = Main.rand.NextBool(7) ? projectile.DirectionFrom(dust.position) * 6f : Vector2.Zero; + } + } + } + + public void SpawnLasers() + { + // Create small beams sometimes + if (Timer > 120f && + Timer < TimeLeft - UniverseSplitterHugeBeam.TimeLeft && + Timer % 60f == 0f) + { + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/PlasmaBolt"), projectile.Center); + if (Main.myPlayer == projectile.owner) + { + Vector2 offset = new Vector2(Main.rand.NextFloat(-800f, 800f), -1460f); + Projectile.NewProjectile(projectile.Center + offset, + -Vector2.Normalize(offset), + ModContent.ProjectileType(), + projectile.damage, + projectile.knockBack, + projectile.owner, + (-Vector2.Normalize(offset)).ToRotation()); + } + } + // Summon a giant beam + if (Timer == TimeLeft - UniverseSplitterHugeBeam.TimeLeft && Main.myPlayer == projectile.owner) + { + Main.PlaySound(SoundID.Zombie, projectile.Center, 104); + Projectile.NewProjectile(projectile.Center + Vector2.UnitY * -UniverseSplitterHugeBeam.MaximumLength / 2f, + Vector2.UnitY, + ModContent.ProjectileType(), + projectile.damage, + projectile.knockBack, + projectile.owner, + 0f); + } + } + + public override bool CanDamage() => false; + } +} diff --git a/Projectiles/Summon/UniverseSplitterField.png b/Projectiles/Summon/UniverseSplitterField.png new file mode 100644 index 0000000000000000000000000000000000000000..c8fba012d09fc3124fb519f46dc1b54c2c2b14d5 GIT binary patch literal 3289 zcmeH}={M958^*u(of%}`v+o%{OUV*rX=Ep43zlViEIFnddb;k=&3FMM27gGsBd^u_ zZ@)dllDBYUj@&?2l@ba?3!}*R%t4CRDk6e2ErYiJB!!S0QU)-!Gwg6}ilhe(4Sz`} z5e=ktrKTW7*mqF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/UniverseSplitterHugeBeam.cs new file mode 100644 index 0000000000..5a211b41f3 --- /dev/null +++ b/Projectiles/Summon/UniverseSplitterHugeBeam.cs @@ -0,0 +1,201 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System.IO; +using Terraria; +using Terraria.ID; +using Terraria.Enums; +using Terraria.ModLoader; +using CalamityMod.Buffs.DamageOverTime; +using Terraria.GameContent.Events; + +namespace CalamityMod.Projectiles.Summon +{ + public class UniverseSplitterHugeBeam : ModProjectile + { + // Pretty self explanatory + public const int TotalFadeoutTime = 25; + public const int TimeLeft = 180; + public const float MaximumLength = 3000f; + // How fat the laser is + public const float LaserSize = 1.45f; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Universe Splitter Ray"); + } + + public override void SetDefaults() + { + projectile.width = 14; + projectile.height = 14; + projectile.friendly = true; + projectile.magic = true; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.timeLeft = TimeLeft; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 6; + } + + // Netcode for sending and receiving shit + // localAI[0] is the timer, localAI[1] is the laser length + + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(projectile.localAI[0]); + writer.Write(projectile.localAI[1]); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + projectile.localAI[0] = reader.ReadSingle(); + projectile.localAI[1] = reader.ReadSingle(); + } + + public override void AI() + { + projectile.velocity = (projectile.velocity.ToRotation() + projectile.ai[0]).ToRotationVector2(); + projectile.rotation = projectile.velocity.ToRotation() - MathHelper.PiOver2; + + projectile.localAI[0]++; + + // Fadein/out. The timeleft varies, so this must be done manually. + if (projectile.localAI[0] < TotalFadeoutTime) + { + projectile.scale = MathHelper.Lerp(0.01f, LaserSize, projectile.localAI[0] / TotalFadeoutTime); + } + + if (projectile.timeLeft < TotalFadeoutTime) + { + projectile.scale = MathHelper.Lerp(LaserSize, 0f, 1f - (projectile.timeLeft / (float)TotalFadeoutTime)); + } + + Vector2 samplingPoint = projectile.Center; + + float[] samples = new float[3]; + + float determinedLength = 0f; + Collision.LaserScan(samplingPoint, projectile.velocity, projectile.width * projectile.scale, MaximumLength + 72f, samples); + for (int i = 0; i < samples.Length; i++) + { + determinedLength += samples[i]; + } + determinedLength /= samples.Length; + + determinedLength = MathHelper.Clamp(determinedLength, MaximumLength * 0.3f, MaximumLength); + + float lerpDelta = 0.5f; + projectile.localAI[1] = MathHelper.Lerp(projectile.localAI[1], determinedLength, lerpDelta); + if (projectile.localAI[0] < 30f) + { + projectile.localAI[1] = MathHelper.Lerp(72f, projectile.localAI[1], projectile.localAI[0] / 30f); + } + Vector2 beamEndPosition = projectile.Center + projectile.velocity * (projectile.localAI[1] - 6f); + if (projectile.localAI[0] >= 30f && + projectile.localAI[0] <= 35f) + { + if (projectile.localAI[0] == 30f) + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/TeslaCannonFire"), projectile.Center); + for (int i = 0; i < 75; i++) + { + Dust dust = Dust.NewDustPerfect(beamEndPosition, 269); + dust.velocity = Main.rand.NextVector2Circular(16f, 11f); + dust.velocity = dust.velocity.SafeNormalize(Vector2.UnitY) * new Vector2(5f, 3.5f); + dust.scale = Main.rand.NextFloat(1.2f, 1.5f); + dust.noGravity = true; + + dust = Dust.NewDustPerfect(beamEndPosition, 269); + dust.velocity = (i / 75f * MathHelper.TwoPi).ToRotationVector2().RotatedByRandom(0.2f) * new Vector2(16f, 11f) * 1.3f; + dust.scale = Main.rand.NextFloat(1.4f, 1.75f); + dust.noGravity = true; + } + } + + if (projectile.localAI[0] > TimeLeft - 50f) + { + float light = 1f; + if (projectile.localAI[0] < TimeLeft - 30f) + { + light = MathHelper.Lerp(0f, 1f, (projectile.localAI[0] - (TimeLeft - 30f)) / 30f); + } + MoonlordDeathDrama.RequestLight(light, beamEndPosition); + } + + // Draw acid green light across the laser + DelegateMethods.v3_1 = new Vector3(0.62f, 0.94f, 0.38f); + Utils.PlotTileLine(projectile.Center, projectile.Center + projectile.velocity * projectile.localAI[1], projectile.width * projectile.scale, new Utils.PerLinePoint(DelegateMethods.CastLight)); + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + if (projectile.velocity == Vector2.Zero) + { + return false; + } + Texture2D laserTailTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/UniverseSplitterHugeBeamEnd"); + Texture2D laserBodyTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/UniverseSplitterHugeBeamMid"); + float laserLength = projectile.localAI[1]; + Color drawColor = new Color(1f, 1f, 1f) * 0.9f; + + // Laser body logic + + laserLength -= laserTailTexture.Height / 2 * projectile.scale; + Vector2 centerDelta = projectile.Center - 76f * projectile.velocity * projectile.scale; + centerDelta += projectile.velocity * projectile.scale * laserTailTexture.Height / 2f; + if (laserLength > 0f) + { + float laserLengthDelta = 0f; + Rectangle sourceRectangle = new Rectangle(0, 76 * (projectile.timeLeft / 3 % 5), laserBodyTexture.Width, 76); + while (laserLengthDelta + 1f < laserLength) + { + if (laserLength - laserLengthDelta < sourceRectangle.Height) + { + sourceRectangle.Height = (int)(laserLength - laserLengthDelta); + } + Main.spriteBatch.Draw(laserBodyTexture, centerDelta - Main.screenPosition, new Rectangle?(sourceRectangle), drawColor, projectile.rotation, new Vector2(sourceRectangle.Width / 2f, 0f), projectile.scale, SpriteEffects.None, 0f); + laserLengthDelta += sourceRectangle.Height * projectile.scale; + centerDelta += projectile.velocity * sourceRectangle.Height * projectile.scale; + sourceRectangle.Y += (int)(76 * projectile.scale); + if (sourceRectangle.Y + sourceRectangle.Height > laserBodyTexture.Height) + { + sourceRectangle.Y = 0; + } + } + } + + // Laser tail logic + centerDelta += projectile.velocity * projectile.scale * 38f; + Rectangle tailFrameRectangle = new Rectangle(0, 76 * (projectile.timeLeft / 3 % 5), laserTailTexture.Width, 76); + Main.spriteBatch.Draw(laserTailTexture, centerDelta - Main.screenPosition, tailFrameRectangle, drawColor, projectile.rotation, new Vector2(148f, 76f) / 2f, projectile.scale, SpriteEffects.None, 0f); + + return false; + } + + public override bool ShouldUpdatePosition() => false; + + public override void CutTiles() + { + DelegateMethods.tilecut_0 = TileCuttingContext.AttackProjectile; + Vector2 unit = projectile.velocity; + Utils.PlotTileLine(projectile.Center, projectile.Center + unit * projectile.localAI[1], (float)projectile.width * projectile.scale, new Utils.PerLinePoint(DelegateMethods.CutTiles)); + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + if (projHitbox.Intersects(targetHitbox)) + { + return true; + } + float value = 0f; + if (Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), projectile.Center, projectile.Center + projectile.velocity * (projectile.localAI[1] + 76f), 22f * projectile.scale, ref value)) + { + return true; + } + return false; + } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(BuffID.Electrified, 300); + target.AddBuff(ModContent.BuffType(), 45 * 60); + } + } +} diff --git a/Projectiles/Summon/UniverseSplitterHugeBeam.png b/Projectiles/Summon/UniverseSplitterHugeBeam.png new file mode 100644 index 0000000000000000000000000000000000000000..58ba72804ac3efa57cd3e13ac3c1788afb1cd476 GIT binary patch literal 966 zcmeAS@N?(olHy`uVBq!ia0vp^Q-IiqgAGV_2hN)Yq!^2X+?^QKos)S9a~60+7BevL9R^{>u+4#oUOg(p=t5?d}l+S>hIh0@%s0;nickZck|ZSn~JBu`j%RJamL2}x@+g{pUeK- z_mjgzK*K{28%pKA^045;>qo0TalhVVc_XH1;X;L}wgLY4LfN;^^4~ZqsCdCb1=j@# z6si;OPICJ5e``*gPPtbu#TBH=^mN{lIe&M)?$9z~2l8(+ZN2^W57*xMDE%j_f_~i@27(AR=>68ZT%ng&Ec=zzmOfRrBi1y^RlkI z%6v4rMk@NIJ4ikA*Kh0MPGqmGUA9nR>r972J=62ozV)^>i8O-Hm1j&xYgcA&+vRT} zvgF&h{e>;s=I0iF(%8Dbc4lFBTT_U2z`AMgR%`miW!fCOp1-zM@}#r6IZ*Ab#!c6A zBOh6vl=jRBGYMV$#jfYf?zz0%bfg@134ro6kNq-uck; zS;_Nm*xi!J(OWpN^46W)nSOpc?m*M5u0Hv)wv=ZmEm0rx;r~&83Y*5 zI`w0TeO>JOU&}1yZqHUPy&qNFX*%iUnc5XId4NvKSRiIHHC=s=&G}5(ZSRf!Zdn)i znN9|Vv+2&vGd;zt0w2DwkJ9mN`};a2$xD0d#efN3c^Z>fuYBWT{_*?Yn;YGgTKY|N zvecZN9krwm&r|!PbMVzNr^3BwMP~mN06I{UH&y)N`pgRd)pjjP|YW6{cOPb|dk*H0{8B|lf6w{_7X-c+G~vp(Pd{Cw^Hb#*ms{>wi1dcCQ5 z_37}hHFB}P{pVh^oE2d#2{d}L^rIVdp}htYFFCoeNifnziwK z_pFl_0w&D58_>4w*0il)PSl-%W3#lrw%qy0^<+-g%qz7#{%59}fqWbi`kz5irS?Gu T=d(G$yvN|_>gTe~DWM4flZU|( literal 0 HcmV?d00001 diff --git a/Projectiles/Summon/UniverseSplitterSmallBeam.cs b/Projectiles/Summon/UniverseSplitterSmallBeam.cs new file mode 100644 index 0000000000..02d9aad775 --- /dev/null +++ b/Projectiles/Summon/UniverseSplitterSmallBeam.cs @@ -0,0 +1,185 @@ +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using System.IO; +using Terraria; +using Terraria.ID; +using Terraria.Enums; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Summon +{ + public class UniverseSplitterSmallBeam : ModProjectile + { + // Pretty self explanatory + public const int FadeinTime = 25; + public const int MovementTime = 60; + public const int TimeLeft = 120; + public const float TotalSweeps = 4f; + public const float MaximumLength = 3000f; + // How fat the laser is + public const float LaserSize = 1.2f; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Universe Splitter Ray"); + } + + public override void SetDefaults() + { + projectile.width = 14; + projectile.height = 14; + projectile.friendly = true; + projectile.magic = true; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.timeLeft = TimeLeft; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 6; + } + + // Netcode for sending and receiving shit + // localAI[0] is the timer, localAI[1] is the laser length + + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(projectile.localAI[0]); + writer.Write(projectile.localAI[1]); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + projectile.localAI[0] = reader.ReadSingle(); + projectile.localAI[1] = reader.ReadSingle(); + } + + public static float CosineInterpolation(float start, float end, float time) + { + float cosineTime = (1f - (float)Math.Cos(MathHelper.Pi * time)) * 0.5f; + return start * (1 - cosineTime) + end * cosineTime; + } + + public override bool ShouldUpdatePosition() => false; + + public override void AI() + { + if (projectile.localAI[0] <= MovementTime) + { + projectile.velocity = (projectile.ai[0] + (float)Math.Cos(projectile.localAI[0] / MovementTime * TotalSweeps) * + CosineInterpolation(1f, 0f, projectile.localAI[0] / MovementTime) * UniverseSplitterField.SmallBeamAngleMax).ToRotationVector2(); + } + projectile.rotation = projectile.velocity.ToRotation() - MathHelper.PiOver2; + + projectile.localAI[0] += 1f; + + // Fadein/out. The timeleft varies, so this must be done manually. + if (projectile.localAI[0] < FadeinTime) + { + projectile.scale = MathHelper.Lerp(0.01f, LaserSize, projectile.localAI[0] / FadeinTime); + } + if (projectile.localAI[0] > MovementTime && + projectile.localAI[0] <= MovementTime + 10f) + { + projectile.scale = MathHelper.Lerp(LaserSize, 3.25f, (projectile.localAI[0] - MovementTime) / 10f); + } + if (projectile.localAI[0] > TimeLeft - 15f) + { + projectile.scale = MathHelper.Lerp(3.25f, 0.01f, (projectile.localAI[0] - (TimeLeft - 15f)) / 15f); + } + + Vector2 samplingPoint = projectile.Center; + + float[] samples = new float[3]; + + float determinedLength = 0f; + Collision.LaserScan(samplingPoint, projectile.velocity, projectile.width * projectile.scale, MaximumLength, samples); + for (int i = 0; i < samples.Length; i++) + { + determinedLength += samples[i]; + } + determinedLength /= samples.Length; + + determinedLength = MathHelper.Clamp(determinedLength, MaximumLength * 0.5f, MaximumLength); + + float lerpDelta = 0.5f; + projectile.localAI[1] = MathHelper.Lerp(projectile.localAI[1], determinedLength, lerpDelta); + Vector2 beamEndPosiiton = projectile.Center + projectile.velocity * (projectile.localAI[1] - 6f); + + // Draw white light across the laser + DelegateMethods.v3_1 = Color.White.ToVector3(); + Utils.PlotTileLine(projectile.Center, projectile.Center + projectile.velocity * projectile.localAI[1], projectile.width * projectile.scale, new Utils.PerLinePoint(DelegateMethods.CastLight)); + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + if (projectile.velocity == Vector2.Zero) + { + return false; + } + Texture2D laserTailTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/UniverseSplitterSmallBeamBegin"); + Texture2D laserBodyTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/UniverseSplitterSmallBeamMid"); + Texture2D laserHeadTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/UniverseSplitterSmallBeamEnd"); + float laserLength = projectile.localAI[1]; + Color drawColor = new Color(1f, 1f, 1f) * 0.9f; + + // Laser tail logic + + Main.spriteBatch.Draw(laserTailTexture, projectile.Center - Main.screenPosition, null, drawColor, projectile.rotation, laserTailTexture.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); + + // Laser body logic + + laserLength -= (laserTailTexture.Height / 2 + laserHeadTexture.Height) * projectile.scale; + Vector2 centerDelta = projectile.Center; + centerDelta += projectile.velocity * projectile.scale * (float)laserTailTexture.Height / 2f; + if (laserLength > 0f) + { + float laserLengthDelta = 0f; + Rectangle sourceRectangle = new Rectangle(0, 14 * (projectile.timeLeft / 3 % 5), laserBodyTexture.Width, 16); + while (laserLengthDelta + 1f < laserLength) + { + if (laserLength - laserLengthDelta < sourceRectangle.Height) + { + sourceRectangle.Height = (int)(laserLength - laserLengthDelta); + } + Main.spriteBatch.Draw(laserBodyTexture, centerDelta - Main.screenPosition, new Rectangle?(sourceRectangle), drawColor, projectile.rotation, new Vector2(sourceRectangle.Width / 2f, 0f), projectile.scale, SpriteEffects.None, 0f); + laserLengthDelta += sourceRectangle.Height * projectile.scale; + centerDelta += projectile.velocity * sourceRectangle.Height * projectile.scale; + sourceRectangle.Y += 14; + if (sourceRectangle.Y + sourceRectangle.Height > laserBodyTexture.Height) + { + sourceRectangle.Y = 0; + } + } + } + + // Laser head logic + + Main.spriteBatch.Draw(laserHeadTexture, centerDelta - Main.screenPosition, null, drawColor, projectile.rotation, laserHeadTexture.Frame(1, 1, 0, 0).Top(), projectile.scale, SpriteEffects.None, 0f); + return false; + } + + public override void CutTiles() + { + DelegateMethods.tilecut_0 = TileCuttingContext.AttackProjectile; + Vector2 unit = projectile.velocity; + Utils.PlotTileLine(projectile.Center, projectile.Center + unit * projectile.localAI[1], (float)projectile.width * projectile.scale, new Utils.PerLinePoint(DelegateMethods.CutTiles)); + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + if (projHitbox.Intersects(targetHitbox)) + { + return true; + } + float value = 0f; + if (Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), projectile.Center, projectile.Center + projectile.velocity * projectile.localAI[1], 22f * projectile.scale, ref value)) + { + return true; + } + return false; + } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(BuffID.Electrified, 300); + } + } +} diff --git a/Projectiles/Summon/UniverseSplitterSmallBeam.png b/Projectiles/Summon/UniverseSplitterSmallBeam.png new file mode 100644 index 0000000000000000000000000000000000000000..50902dedaff6c274a42e9c377c9230e0b0d89914 GIT binary patch literal 226 zcmeAS@N?(olHy`uVBq!ia0vp^d?3uh1|;P@bT0xa#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvI6;>1s;*bKn;gMnDKc2iWHz=xu=U`h=qUhANxu{W{HX$jv1mq{|m55?f5)F z(C57c%d!~>kMyJX~~*}Its!p7jj!xrKa5Ac^04;;>qIdrp(OD;CNH+Uhj;B RKY&hP@O1TaS?83{1OR4ZN(=x1 literal 0 HcmV?d00001 diff --git a/Projectiles/Summon/ViridVanguardBlade.cs b/Projectiles/Summon/ViridVanguardBlade.cs new file mode 100644 index 0000000000..c6586277c0 --- /dev/null +++ b/Projectiles/Summon/ViridVanguardBlade.cs @@ -0,0 +1,198 @@ +using CalamityMod.Buffs.Summon; +using CalamityMod.CalPlayer; +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.Summon +{ + public class ViridVanguardBlade : ModProjectile + { + public bool AltTexture = false; + + public int RemainingSlices = 0; + public int PostSliceDeathTimer; + public float RedirectAngle; + public float FiringTime = 0f; + public Vector2 IdealPosition; + public float Angle + { + get => projectile.ai[0]; + set => projectile.ai[0] = value; + } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Vanguard Blade"); + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 7; + } + + public override void SetDefaults() + { + projectile.width = 60; + projectile.height = 156; + projectile.netImportant = true; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.minionSlots = 1.5f; + projectile.timeLeft = 18000; + projectile.penetrate = -1; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 14; + projectile.tileCollide = false; + projectile.timeLeft *= 5; + projectile.minion = true; + } + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(RedirectAngle); + writer.Write(FiringTime); + writer.Write(AltTexture); + } + public override void ReceiveExtraAI(BinaryReader reader) + { + RedirectAngle = reader.ReadSingle(); + FiringTime = reader.ReadSingle(); + AltTexture = reader.ReadBoolean(); + } + public override void AI() + { + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); + projectile.spriteDirection = AltTexture.ToDirectionInt(); + if (projectile.localAI[0] == 0f) + { + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); + projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; + projectile.localAI[0] = 1f; + } + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) + { + int trueDamage = (int)(projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / + projectile.Calamity().spawnedPlayerMinionDamageValue * + player.MinionDamage()); + projectile.damage = trueDamage; + } + bool isProperProjectile = projectile.type == ModContent.ProjectileType(); + player.AddBuff(ModContent.BuffType(), 3600); + if (isProperProjectile) + { + if (player.dead) + { + modPlayer.viridVanguard = false; + } + if (modPlayer.viridVanguard) + { + projectile.timeLeft = 2; + } + } + + if (FiringTime <= 0f) + { + projectile.ai[1]++; + float outwardPosition = 320f; + outwardPosition += (float)Math.Sin(Angle) * 200f; + projectile.Center = player.Center + Angle.ToRotationVector2().RotatedBy((float)Math.Cos(Angle) * MathHelper.PiOver4 + AltTexture.ToInt() * MathHelper.Pi) * outwardPosition; + projectile.rotation = player.AngleTo(projectile.Center) + MathHelper.PiOver4; + Angle += MathHelper.ToRadians(4f); + } + else + { + projectile.spriteDirection = 1; + if (FiringTime >= 239f) + { + RemainingSlices = projectile.penetrate = 3; + IdealPosition = player.Center - Vector2.UnitY.RotatedBy(RedirectAngle) * 550f; + } + else if (FiringTime > 120f) + { + projectile.Center = Vector2.Lerp(projectile.Center, IdealPosition, 1f / 40f); + projectile.rotation = projectile.rotation.AngleLerp(RedirectAngle + MathHelper.ToRadians(82f), 1f / 60f); + } + else if (FiringTime > 80f) + { + projectile.Center = IdealPosition; + projectile.rotation = projectile.rotation.AngleLerp(projectile.AngleTo(Main.MouseWorld) + MathHelper.ToRadians(82f), 1f / 20f); + } + else if (FiringTime == 80f) + { + PostSliceDeathTimer = 80; + projectile.velocity = projectile.DirectionTo(Main.MouseWorld) * 30f; + } + else if (FiringTime == 1f) + { + if (RemainingSlices <= 0) + { + projectile.Kill(); + } + else if (RemainingSlices <= 2) + { + projectile.velocity *= -1; + FiringTime = 20f; + } + } + FiringTime--; + } + + if (RemainingSlices > 0) + PostSliceDeathTimer--; + if (PostSliceDeathTimer == 1) + projectile.Kill(); + + if (projectile.localAI[1] > 0) + { + projectile.alpha = (int)MathHelper.Lerp(255, 0, 1f - projectile.localAI[1] / 80f); + projectile.localAI[1]--; + } + } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (RemainingSlices > 0) + { + FiringTime = 10f; + RemainingSlices--; + } + } + public override void Kill(int timeLeft) + { + for (int j = 0; j < 40; j++) + { + Dust dust = Dust.NewDustDirect(projectile.position, projectile.width, projectile.height, 66); + dust.velocity = Vector2.UnitY * Main.rand.NextFloat(3f, 5.5f) * Main.rand.NextBool(2).ToDirectionInt(); + dust.noGravity = true; + } + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D texture = ModContent.GetTexture("CalamityMod/Projectiles/Summon/ViridVanguardBlade" + (AltTexture ? "" : "Alt")); + + Rectangle rectangle = new Rectangle(0, 0, texture.Width, texture.Height); + + SpriteEffects spriteEffects = SpriteEffects.None; + if (projectile.spriteDirection == -1) + spriteEffects = SpriteEffects.FlipHorizontally; + + if (CalamityConfig.Instance.Afterimages && FiringTime > 0f && FiringTime < 80f) + { + for (int i = 0; i < projectile.oldPos.Length; i++) + { + Vector2 drawPos = projectile.oldPos[i] + projectile.Size / 2f - Main.screenPosition + new Vector2(0f, projectile.gfxOffY); + Color color = Color.Lerp(Color.White, Color.DarkOliveGreen, i / (float)projectile.oldPos.Length) * + ((projectile.oldPos.Length - i) / (float)projectile.oldPos.Length); + float scale = MathHelper.Lerp(projectile.scale * 1f, projectile.scale * 0.5f, i / (float)projectile.oldPos.Length); + Main.spriteBatch.Draw(texture, drawPos, new Rectangle?(rectangle), color, + projectile.rotation, + rectangle.Size() / 2f, scale, spriteEffects, 0f); + } + } + Main.spriteBatch.Draw(texture, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Rectangle?(rectangle), Color.White, + projectile.rotation, + rectangle.Size() / 2f, 1f, spriteEffects, 0f); + return false; + } + } +} diff --git a/Projectiles/Summon/ViridVanguardBlade.png b/Projectiles/Summon/ViridVanguardBlade.png new file mode 100644 index 0000000000000000000000000000000000000000..400382aa1c3c0eb4f9c1e81dd42e22e519081c9c GIT binary patch literal 2879 zcmV-F3&8Y=P)Px<`AI}URCt{2om*@a*BQtE6MQ$mfw9fah6KCjk_ACRg`zZSt0+xW9!eynD5Rq5 zQ(v0)t!g8sRjr6VHF?TQA5a7@k&-@uAc#t>Y*|Q{NUrN91_I_{z&Hlu%lZak`|!+WB@ZN8(lem|Q50q;;!ZvMfecS)(0|3D0EyVzU0}xwZF1G9l zXVP-FWk)!Zv@O@yJO&WN?WJzZj&M{RdTkZ}aO_Ocva)4I*ru=hjspm6xb^jBIdJAW zfce|5vFKE zRpomC0Hbm9y9wg4*fwo>UDG1~z~12^0KoZ?+0g5g?3~PP-XH!+lkBG-^#cG7zPlMfK=85M*A)6bGY=;K09#{HQ6bsSzW6-=;LV?e+j>+v!dlVeaT|bubgV`8YSKrK z?FJCo{#IqmRjVa#w|89i$M28&yM#)6c}LhL9gnrQj#{|1v~^9M zchKMe`bU3HQQFUEBg;(C5w?lm`jxRY0D!64Q2=(^ifxt(2ubsm`!zXDHj^f29vItu zYlQr>TOR^QB}+NNnMAUb&FgBS$!*`8C&yhX@L&6l<3IbYkk@w*y?JfrDgeMM^>W9x zv{nHC+B?1u_41r=JHk=bync-b1huR--|LbP<1oomyc0-H-wFCo(V5#DFYW*Uoa*W| zW>5ESi>)3#wi7_$BlteNGaTVeVvVY_NM5IA{R|151)25gsN$WW$pp4*YafBBte&e(`dTU$!)#Q`5 zdnx>*1zuaON3z;>Ic{LM7XVONByrjip066~WMy7Z(J<$|THLSa%eLcM`cBbg|MaW2 z(DUeX9O0<4^^7!GZKK*YQ*v;1oaZMqIRE(jAHQdeBUwF8%Ms4Dbf%);Yf;yil#ZL=bs8`Br)I8V~2y23x7BmATaY&l6XZHJy-n>8v;T4!vhy84W5O_sK9%i$?U zc%ia+ZFU9_kWTFV7Wk|*0VS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9{(~Z%%sUz;>4uSt{=cTPdt>kiT$pYj9LL{%VZ}McdYW zyKGi9=ap_U)GzOmr1;}DgOv>dO`l@$+Zi^Y1chdXWOM3xmex4 zY%Bi=U%PNW0RV^p#%C8~73{x0xCbDx<%(8WyMa!5d6eK&r;hNFmIpuX(sr->Q#$$A zu6|<-M!%YIUvWpSMUKH9N{b!u&y#wrRPN drSgvO{{T=}?e@GObaDUy002ovPDHLkV1f}OwXy&J literal 0 HcmV?d00001 diff --git a/Projectiles/Summon/ViridVanguardBladeAlt.png b/Projectiles/Summon/ViridVanguardBladeAlt.png new file mode 100644 index 0000000000000000000000000000000000000000..127ec26b1c56df6c4e67a5dc6dde181069221259 GIT binary patch literal 2750 zcmV;v3PJUWP)41^@s6mDa4I00001b5ch_0Itp) z=>PxVA6O8Tn`(tYJVN;x7$51r5C;>&Nk*bQORLY`6iqwKC zsw#`Fnl4b0ngy+BM3hC_bt^ThLL+t2E~r2$Ra=1&3RI~xqK?By4cOS&G2jnuY)I`c z&i%hP_sraR&juU!z4zbD-1jxl_c!O^}|wc)GOK9Qhf5gwXPdw$rw$3;=L@ zFk|g+NlSZrcFb%^2raK@J0E9n7~9!a@VJVyI;))!T51K^PLL8pOQrmXz_y*aj38oLJL)X1TZiU0EhNf0r1ICnvAxoPkN6P{k()wSh=z_9A`9{*M8V$wcmW> zIshQkCbyXB_&n6-CWL}SGMyW$0pydRO}M<7Pi8LE=lMAWQ9{TiO{Vw8r155*(hi6K zNM`@bk^#+Ll3P1*;UWMa)6r=iKQNjFkeiniC4{tG-i&0lNQTk#tKX2BC&^GG6QuhO z#;tZjhzc5Kf^3Flw2mI@E&93ox?1rgL=qIeN=K)>`q`PnWOQ`=(;pl$@9e(RWSG0A zHw&xy5z5g#;Cq$ZgEEiNc{A%l1j1 zy2yO{9#)as9vM z$}9k2Vp@7Kdr7|AoJn%7@5*q#_koOOB;m3dZg+_>UPEfD!znV@<#rEyqS&+NQR<~W!kn{+x7KNTqu4&2_eem?I@2(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15NJD;j=^CljH+8GUasvaeuStTQr33PNExfqmYPg{ZMfgg zzm=^nNdZ8%Z!lDjVxfv3A??j}!zRT@fcx89q;_Y#aOnn zZAi~w^mwCZqNb>3{Z_X9%8ixBz>UvH@tA3_wr`y4l# zyTz8)e^>si4D)SX6y5q<{zaBi@gp=hXAkI}EoJR&4l}7?qwJ+ptO%K!Q~94JdOgRL z#qm}Z>>oT|HpPk%fc&|?j@?MAh?XQ~b18m=DA!sjy%}FKP%CuHtjG~^e!thRkrlC< zx5lkpwjN(xdAHii@)Q7!Pt82uI}T9v2~|{ztxQkdv*tlMOQVT++tbx402m%Eymq?O ziX5RlFGn&PpVhN?Q~>l$U1>p z9oo*5wi&I+5h~gEd;&3wep`gv@Kox&z0P3tQbX(kT(wT*@UZqm(>Fj;H%5)tu#fK5Je)TrDZ7q zC|SK40C4{78Osai*wBhn^a*)844MBoMVAntRiHPc%~0H~p95NHiX5R-L!(65cWxJt zvKcX)KP$0ZLt{E+&ReEi4X5Z4;u}rMrIkvCiX5T;0eF4Ffl!e@YybcN07*qoM6N<$ Ef-_w(*#H0l literal 0 HcmV?d00001 From 069b0b4bbc2c958144eb33a596a403532ee71f08 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Thu, 15 Oct 2020 16:48:04 -0500 Subject: [PATCH 003/202] Deathstare rod --- Buffs/Summon/DeathstareBuff.cs | 36 +++++ Buffs/Summon/DeathstareBuff.png | Bin 0 -> 404 bytes CalPlayer/CalamityPlayer.cs | 2 + Items/CalamityGlobalItem.cs | 1 + Items/Weapons/Summon/DeathstareRod.cs | 42 +++++ Items/Weapons/Summon/DeathstareRod.png | Bin 0 -> 464 bytes NPCs/CalamityGlobalNPCLoot.cs | 1 + Projectiles/Summon/DeathstareBeam.cs | 51 ++++++ Projectiles/Summon/DeathstareBeam.png | Bin 0 -> 2106 bytes Projectiles/Summon/DeathstareEyePupil.png | Bin 0 -> 181 bytes Projectiles/Summon/DeathstareEyeball.cs | 179 ++++++++++++++++++++++ Projectiles/Summon/DeathstareEyeball.png | Bin 0 -> 487 bytes 12 files changed, 312 insertions(+) create mode 100644 Buffs/Summon/DeathstareBuff.cs create mode 100644 Buffs/Summon/DeathstareBuff.png create mode 100644 Items/Weapons/Summon/DeathstareRod.cs create mode 100644 Items/Weapons/Summon/DeathstareRod.png create mode 100644 Projectiles/Summon/DeathstareBeam.cs create mode 100644 Projectiles/Summon/DeathstareBeam.png create mode 100644 Projectiles/Summon/DeathstareEyePupil.png create mode 100644 Projectiles/Summon/DeathstareEyeball.cs create mode 100644 Projectiles/Summon/DeathstareEyeball.png diff --git a/Buffs/Summon/DeathstareBuff.cs b/Buffs/Summon/DeathstareBuff.cs new file mode 100644 index 0000000000..8c3de83967 --- /dev/null +++ b/Buffs/Summon/DeathstareBuff.cs @@ -0,0 +1,36 @@ +using CalamityMod.CalPlayer; +using CalamityMod.Projectiles.Summon; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.Summon +{ + public class DeathstareBuff : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Miniature Eye of Cthulhu"); + Description.SetDefault("It's watching you"); + Main.buffNoTimeDisplay[Type] = true; + Main.buffNoSave[Type] = true; + } + + public override void Update(Player player, ref int buffIndex) + { + CalamityPlayer modPlayer = player.Calamity(); + if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) + { + modPlayer.deathstareEyeball = true; + } + if (!modPlayer.deathstareEyeball) + { + player.DelBuff(buffIndex); + buffIndex--; + } + else + { + player.buffTime[buffIndex] = 18000; + } + } + } +} diff --git a/Buffs/Summon/DeathstareBuff.png b/Buffs/Summon/DeathstareBuff.png new file mode 100644 index 0000000000000000000000000000000000000000..eaf73dcf4e35e89fe6da3bbd14ab850e372ab4a0 GIT binary patch literal 404 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCijq1AIbUfwWwxwq{Rke9YOR6(3>2qbnmF{H0Bm=6q~R z1q2=*pS@GV;F+am9uE&t7f;N+=|D=jB*-uLKL%jfRC|X5D9u^m5n0T@z;_UY8Fx&~ zehU;l>gnPbV&T7Z@@b(%3Ouga!mQqhUjMfb)5|Pf*3DIA=CdPx!P%Cj*Pb>_s}r5} z^jd`VmSoXyyG<1qBs=K*f4GXHZd*nciQ!xhc!#Ic!aVu#k} zZGx8K$r&>oO!SsKvD#S3k@2giLBnm$z4i%{PUJhC6WDY9<`l!k*pIVUbrieJu~K^P zS0_5d)hqC<sZRUkyy&i89;15?E5H=hOiIqUbm ai;BN!D&Z<|vhoSgLkym-elF{r5}E*gIG`8+ literal 0 HcmV?d00001 diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 2c1055a4ac..1485da57fa 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -952,6 +952,7 @@ namespace CalamityMod.CalPlayer public bool howlTrio = false; public bool mountedScanner = false; public bool viridVanguard = false; + public bool deathstareEyeball = false; #endregion #region Biome @@ -1978,6 +1979,7 @@ namespace CalamityMod.CalPlayer howlTrio = false; mountedScanner = false; viridVanguard = false; + deathstareEyeball = false; abyssalDivingSuitPrevious = abyssalDivingSuit; abyssalDivingSuit = abyssalDivingSuitHide = abyssalDivingSuitForce = abyssalDivingSuitPower = false; diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 04b73a0947..1ad7a21329 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -2983,6 +2983,7 @@ Grants immunity to fire blocks, and temporary immunity to lava"; case ItemID.EyeOfCthulhuBossBag: DropHelper.DropItem(player, ModContent.ItemType(), 3, 5); DropHelper.DropItemChance(player, ModContent.ItemType(), 3); + DropHelper.DropItemChance(player, ModContent.ItemType(), 3); DropHelper.DropItemCondition(player, ModContent.ItemType(), CalamityWorld.revenge); break; diff --git a/Items/Weapons/Summon/DeathstareRod.cs b/Items/Weapons/Summon/DeathstareRod.cs new file mode 100644 index 0000000000..d528e934b8 --- /dev/null +++ b/Items/Weapons/Summon/DeathstareRod.cs @@ -0,0 +1,42 @@ +using CalamityMod.Projectiles.Summon; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Summon +{ + public class DeathstareRod : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Deathstare Rod"); + Tooltip.SetDefault("Summons an eye above your head that watches you and shoots at enemies"); + } + + public override void SetDefaults() + { + item.damage = 33; + item.mana = 10; + item.width = item.height = 42; + item.useTime = item.useAnimation = 35; + item.useStyle = ItemUseStyleID.SwingThrow; + item.noMelee = true; + item.knockBack = 2f; + item.value = CalamityGlobalItem.Rarity1BuyPrice; + item.rare = ItemRarityID.Blue; + item.UseSound = SoundID.NPCHit8; + item.autoReuse = true; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 10f; + item.summon = true; + } + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 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) + { + CalamityUtils.KillShootProjectiles(true, type, player); + Projectile.NewProjectile(player.Center, Vector2.Zero, type, damage, knockBack, player.whoAmI, 0f, 0f); + return false; + } + } +} diff --git a/Items/Weapons/Summon/DeathstareRod.png b/Items/Weapons/Summon/DeathstareRod.png new file mode 100644 index 0000000000000000000000000000000000000000..fdabc4bd48543222d4a4095d2846497367f932f5 GIT binary patch literal 464 zcmeAS@N?(olHy`uVBq!ia0vp^S|H593?x6vT4n+%#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvI6<`0X`wFK)S*)NO>_%)r2R z7=#&*=dVZs3jXwTaSZYBUVHg=-eCm+*NaJqRCyj~{`kLtt4!O9Nvg{iR@fiiu%<%h zQ)$eys%ZY}mU%B-yR$G|{f@O1TaS?83{1ONl##6SQ5 literal 0 HcmV?d00001 diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index 49790cb43f..23e9383b2f 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -1471,6 +1471,7 @@ namespace CalamityMod.NPCs case NPCID.EyeofCthulhu: DropHelper.DropItemCondition(npc, ModContent.ItemType(), !Main.expertMode, 2, 4); + DropHelper.DropItemCondition(npc, ModContent.ItemType(), !Main.expertMode, 5, 1, 1); DropHelper.DropItemCondition(npc, ModContent.ItemType(), !Main.expertMode, 5, 1, 1); break; diff --git a/Projectiles/Summon/DeathstareBeam.cs b/Projectiles/Summon/DeathstareBeam.cs new file mode 100644 index 0000000000..0e1923ab88 --- /dev/null +++ b/Projectiles/Summon/DeathstareBeam.cs @@ -0,0 +1,51 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Summon +{ + public class DeathstareBeam : ModProjectile + { + public ref float OwnerUUID => ref projectile.ai[0]; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Beam"); + ProjectileID.Sets.MinionShot[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.width = 10; + projectile.height = 10; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.minion = true; + projectile.ignoreWater = true; + projectile.timeLeft = 10; + } + public override void AI() + { + if (!Main.projectile.IndexInRange((int)OwnerUUID)) + { + projectile.Kill(); + return; + } + + projectile.Opacity = Utils.InverseLerp(1f, 0f, 1f - projectile.timeLeft / 10f, true); + projectile.Center = Main.projectile[(int)OwnerUUID].Center - projectile.velocity; + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D beamTexture = Main.projectileTexture[projectile.type]; + Vector2 drawPosition = projectile.Center + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; + Vector2 drawScale = new Vector2(0.55f, projectile.velocity.Length() / beamTexture.Height * 20f); + Color color = Color.White * 2.1f * projectile.Opacity; + spriteBatch.Draw(beamTexture, drawPosition, null, color, projectile.rotation, beamTexture.Frame().Bottom(), drawScale, SpriteEffects.None, 0f); + return false; + } + } +} diff --git a/Projectiles/Summon/DeathstareBeam.png b/Projectiles/Summon/DeathstareBeam.png new file mode 100644 index 0000000000000000000000000000000000000000..a47f130baecf2f2d96a52d934b2ee135f5109041 GIT binary patch literal 2106 zcmV-A2*vk_P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!TO{z2&v0jIHm!U{B(Z`wmZGfJRvJ!;J5 zoA!9I0fkrjkIKFa807{dKOf5f1whP<1QZ}Dy@CD;LzpEa#(5s*##o+VSN21|^3t!Q zxToVyK!R-=3vixCG3<=*m3vsvPO%<9c&F(U+1jaanIcC|gyjAuUV1XQcoP?C1jKTC%fE8#E zCEKT9cqsW!W3Cwjmcfx200&^rvHp2L05TcfmStQFWbZ703XsImEdZ+Hu~C6uADtV3 zSb-*xfU7CpKdE6HkzQ7L19qdTNh(_$GSzkfWbw!@m=!<=QV7k;=4869&iKJ6I(Fw66Nd8?YRvCIG0oB*g8K_lbZm%e3Idu5TE?nQm)e*u}c# z&Xo*MF*IoE$yyP>6J`gP3$b(PL!#Nu0$qC9Y#N(iH|A!^#Z*Ykwk_MbiX<-3W9c0< zA#O7)mUf*vv(#HV#z}AQ0IDwE1>En-2)k`t<((zZ#W29IyMTN;!zeEp_NGW$^tF}| zYsj>#lJ~%p5aGlOa=~uhsxeVTFku@;Rb2KF@DIF8$qGSgJJCZ09 z4b5&{wqOiHl}+4^Wx`ySTtUH9rY@I$<;)!$^Qb8X9H!n?x-5dtC_avku^s^$G;cth zzc_o87+Q*0I{0H+1=gLX@S(2w~ybSruFHs*N;D72Xmjr3otAg=41(7`k>XHU%&qw5Vb*b z2&kVj)|}&Vu{#U_b!jk>o%Bk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nEpl!Ww$*KoFhrtf%z2V~7({f%{y{fMpQ?P#ER;xRj1AU(7h04I{<^y#VCH zj$w_J_sC~Uz`*Vewb=nMj2PFEM~3UCbDqa0)(8r$OV9@BFh&9{f+CEm<5E=7jocdy zF|C+k0WoG{Sl}E|aGFV^9RT+W0aT{vp5KgkEWg@rGVDPNfE|xbc-WDIqGFer1PJrW k!I%;tO=@-{Y#4@r0M3nAAlk{z(EtDd07*qoM6N<$f~9-!Qvd(} literal 0 HcmV?d00001 diff --git a/Projectiles/Summon/DeathstareEyePupil.png b/Projectiles/Summon/DeathstareEyePupil.png new file mode 100644 index 0000000000000000000000000000000000000000..ea9db1fb5d845a6561a9a895ee0457ae6e915302 GIT binary patch literal 181 zcmeAS@N?(olHy`uVBq!ia0vp^AT}2V8<6ZZI=>f4F%}28J29*~C-V}>VM%xNb!1@J z*w6hZkrl}2EbxddW?WrrbLCrS*4Y$}EoJ+qZSsB>X$NSpA^MNwpwp0|N#I YW-Ae{|FFVdQ&MBb@0P*WQzyJUM literal 0 HcmV?d00001 diff --git a/Projectiles/Summon/DeathstareEyeball.cs b/Projectiles/Summon/DeathstareEyeball.cs new file mode 100644 index 0000000000..e44dc1a066 --- /dev/null +++ b/Projectiles/Summon/DeathstareEyeball.cs @@ -0,0 +1,179 @@ +using CalamityMod.Buffs.Summon; +using CalamityMod.CalPlayer; +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 DeathstareEyeball : ModProjectile + { + // This does not need to be synced. It is used solely for drawcode/visuals and is intended to be local. + public float PupilScale = 1f; + public const int BeamFireRate = 60; + public Player Owner => Main.player[projectile.owner]; + public ref float Time => ref projectile.ai[1]; + public ref float PupilAngle => ref projectile.localAI[0]; + public ref float PupilOutwardness => ref projectile.localAI[1]; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Eyeball"); + ProjectileID.Sets.NeedsUUID[projectile.type] = true; + ProjectileID.Sets.MinionSacrificable[projectile.type] = true; + ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 16; + projectile.netImportant = true; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.minionSlots = 1f; + projectile.timeLeft = 90000; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.minion = true; + } + + #region AI + public override void AI() + { + Lighting.AddLight(projectile.Center, Color.Blue.ToVector3()); + + bool isCorrectMinion = projectile.type == ModContent.ProjectileType(); + CalamityPlayer modPlayer = Owner.Calamity(); + Owner.AddBuff(ModContent.BuffType(), 3600); + + // Ensure that the projectile executing this code is a valid one. + if (isCorrectMinion) + { + if (Owner.dead) + modPlayer.deathstareEyeball = false; + if (modPlayer.deathstareEyeball) + projectile.timeLeft = 2; + } + + Vector2 destination = Owner.Center + Vector2.UnitY * (Owner.gfxOffY - 110f); + if (Owner.gravDir == -1f) + destination.Y += 220f; + + // Very quickly fly towards above (or below if gravity is reversed) the player. + projectile.Center = Vector2.Lerp(projectile.Center, destination, 0.36f); + + projectile.position = projectile.position.Floor(); + projectile.rotation = (projectile.position.X - projectile.oldPosition.X) * 0.07f + Owner.velocity.X * 0.2f; + projectile.rotation = Utils.Clamp(projectile.rotation, -0.4f, 0.4f); + + if (projectile.localAI[0] == 0f) + { + Initialize(Owner); + projectile.localAI[0] = 1f; + } + if (Owner.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) + { + int trueDamage = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / + projectile.Calamity().spawnedPlayerMinionDamageValue * + Owner.MinionDamage()); + projectile.damage = trueDamage; + } + + NPC potentialTarget = projectile.Center.MinionHoming(720f, Owner); + + if (potentialTarget is null) + DoHoveringAI(); + else + DoAttackingAI(potentialTarget); + + projectile.frame = (int)(Time / 5) % 4; + + Time++; + } + + public void DoHoveringAI() + { + // Roll the pupil around if there's little movement from the eye and player. + if (Time % 180f > 120f && Math.Abs(projectile.rotation) < 0.03f) + { + float idealAngle = Utils.InverseLerp(120f, 180f, Time % 180f, true) * MathHelper.TwoPi; + + PupilAngle = PupilAngle.AngleTowards(idealAngle, MathHelper.ToRadians(12f)); + PupilOutwardness = MathHelper.Lerp(PupilOutwardness, 4f, 0.2f); + } + else + { + float idealOutwardness = MathHelper.Clamp(Owner.velocity.Length() * 0.5f, 0f, 5f); + float idealAngle = Owner.velocity.ToRotation(); + + PupilOutwardness = MathHelper.Lerp(PupilOutwardness, idealOutwardness, 0.2f); + PupilAngle = PupilAngle.AngleTowards(idealAngle, MathHelper.ToRadians(12f)); + } + } + + public void DoAttackingAI(NPC target) + { + PupilOutwardness = MathHelper.Lerp(PupilOutwardness, 4f, 0.25f); + + if (Time % BeamFireRate == BeamFireRate - 20) + { + if (Main.myPlayer == projectile.owner) + { + Vector2 velocity = (target.Center - projectile.Center) / 15f; + int beam = Projectile.NewProjectile(target.Center, velocity, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner); + Main.projectile[beam].ai[0] = Projectile.GetByUUID(projectile.owner, projectile.whoAmI); + Main.projectile[beam].Damage(); + } + PupilScale = 1.5f; + } + + // After firing, have the pupil retract a bit. + if (Time % BeamFireRate > BeamFireRate - 20) + { + PupilScale = MathHelper.Lerp(PupilScale, 0.7f, 0.15f); + } + // Otherwise, have it behave like normal. + else + { + PupilScale = MathHelper.Lerp(PupilScale, 1f, 0.175f); + PupilAngle = PupilAngle.AngleTowards(projectile.AngleTo(target.Center), MathHelper.ToRadians(15f)); + } + } + + public void Initialize(Player player) + { + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); + projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; + + if (!Main.dedServ) + return; + + for (int i = 0; i < 25; i++) + { + Dust dust = Dust.NewDustDirect(projectile.position, 52, 52, DustID.Blood); + dust.noGravity = true; + dust.scale = Main.rand.NextFloat(1.2f, 1.5f); + } + } + + #endregion + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D eyeTexture = Main.projectileTexture[projectile.type]; + Rectangle frame = eyeTexture.Frame(1, 4, 0, projectile.frame); + Vector2 origin = frame.Size() * 0.5f; + SpriteEffects spriteEffects = Owner.gravDir == 1 ? SpriteEffects.None : SpriteEffects.FlipVertically; + spriteBatch.Draw(eyeTexture, projectile.Center - Main.screenPosition, frame, projectile.GetAlpha(lightColor), projectile.rotation, origin, projectile.scale, spriteEffects, 0f); + + // Pupil drawing. + Texture2D pupilTexture = ModContent.GetTexture("CalamityMod/Projectiles/Summon/DeathstareEyePupil"); + Vector2 pupilDrawPosition = projectile.Center - Main.screenPosition + PupilAngle.ToRotationVector2() * PupilOutwardness; + spriteBatch.Draw(pupilTexture, pupilDrawPosition, null, projectile.GetAlpha(lightColor), PupilAngle, pupilTexture.Size() * 0.5f, PupilScale, spriteEffects, 0f); + return false; + } + + public override bool CanDamage() => false; + } +} diff --git a/Projectiles/Summon/DeathstareEyeball.png b/Projectiles/Summon/DeathstareEyeball.png new file mode 100644 index 0000000000000000000000000000000000000000..6825c3c66405eefbc18fbd8d14ed1a1626743206 GIT binary patch literal 487 zcmeAS@N?(olHy`uVBq!ia0vp^B0!wM!3-piZC7XoQjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`RRVlMT!D0jW7Narvwyxj`2XKqb3V396DQ{J@a)tucxGw2R6qczApDO$ zH<02f3Gxg6j{pop_s^XJigOltL>4nJ@ErzW#^d=bQh*klc)B=-czEBv>Rr}sAmDOQ z;llL4@6BzziiGay&Zw9)t6+zW;Im)wAfgFy6Tq>+n8ykcej1@;V?W`V9m62 zO0lNlEs11Jh3%g1&t?R1EbYktYIy9L(+c+l`R}qhy3eDcwcTr4B6*(O*}tsWp#Peb zi93_MbHwp#nVE_254B4%RZA! Date: Thu, 15 Oct 2020 16:50:18 -0500 Subject: [PATCH 004/202] Deathstare pupil draws a tiny bit up --- Projectiles/Summon/DeathstareEyeball.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Projectiles/Summon/DeathstareEyeball.cs b/Projectiles/Summon/DeathstareEyeball.cs index e44dc1a066..e22b85e53a 100644 --- a/Projectiles/Summon/DeathstareEyeball.cs +++ b/Projectiles/Summon/DeathstareEyeball.cs @@ -170,6 +170,7 @@ namespace CalamityMod.Projectiles.Summon // Pupil drawing. Texture2D pupilTexture = ModContent.GetTexture("CalamityMod/Projectiles/Summon/DeathstareEyePupil"); Vector2 pupilDrawPosition = projectile.Center - Main.screenPosition + PupilAngle.ToRotationVector2() * PupilOutwardness; + pupilDrawPosition -= Vector2.UnitY * 4f; spriteBatch.Draw(pupilTexture, pupilDrawPosition, null, projectile.GetAlpha(lightColor), PupilAngle, pupilTexture.Size() * 0.5f, PupilScale, spriteEffects, 0f); return false; } From be1b158ecd234f5e5b58612889ce27eb6dee55b4 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Fri, 16 Oct 2020 11:11:44 -0500 Subject: [PATCH 005/202] Daedalus Golem work (UNFINISHED ATM) --- Buffs/Summon/DaedalusGolemBuff.cs | 36 +++ Buffs/Summon/DaedalusGolemBuff.png | Bin 0 -> 506 bytes CalPlayer/CalamityPlayer.cs | 2 + Items/Weapons/Summon/DaedalusGolemStaff.cs | 44 +++ Items/Weapons/Summon/DaedalusGolemStaff.png | Bin 0 -> 1108 bytes .../DraedonsArsenal/StarSwallowerSummon.cs | 1 - Projectiles/Summon/DaedalusGolem.cs | 275 ++++++++++++++++++ Projectiles/Summon/DaedalusGolem.png | Bin 0 -> 3860 bytes Projectiles/Summon/DaedalusLightning.cs | 157 ++++++++++ Projectiles/Summon/DaedalusLightning.png | Bin 0 -> 191 bytes Projectiles/Summon/DeathstareEyeball.cs | 1 + Projectiles/Summon/MechwormHead.cs | 1 + Utilities/CalamityUtils.cs | 1 + 13 files changed, 517 insertions(+), 1 deletion(-) create mode 100644 Buffs/Summon/DaedalusGolemBuff.cs create mode 100644 Buffs/Summon/DaedalusGolemBuff.png create mode 100644 Items/Weapons/Summon/DaedalusGolemStaff.cs create mode 100644 Items/Weapons/Summon/DaedalusGolemStaff.png create mode 100644 Projectiles/Summon/DaedalusGolem.cs create mode 100644 Projectiles/Summon/DaedalusGolem.png create mode 100644 Projectiles/Summon/DaedalusLightning.cs create mode 100644 Projectiles/Summon/DaedalusLightning.png diff --git a/Buffs/Summon/DaedalusGolemBuff.cs b/Buffs/Summon/DaedalusGolemBuff.cs new file mode 100644 index 0000000000..6c0972e123 --- /dev/null +++ b/Buffs/Summon/DaedalusGolemBuff.cs @@ -0,0 +1,36 @@ +using CalamityMod.CalPlayer; +using CalamityMod.Projectiles.Summon; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.Summon +{ + public class DaedalusGolemBuff : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Daedalus Golem"); + Description.SetDefault("A crystal golem is following you"); + Main.buffNoTimeDisplay[Type] = true; + Main.buffNoSave[Type] = true; + } + + public override void Update(Player player, ref int buffIndex) + { + CalamityPlayer modPlayer = player.Calamity(); + if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) + { + modPlayer.daedalusGolem = true; + } + if (!modPlayer.daedalusGolem) + { + player.DelBuff(buffIndex); + buffIndex--; + } + else + { + player.buffTime[buffIndex] = 18000; + } + } + } +} diff --git a/Buffs/Summon/DaedalusGolemBuff.png b/Buffs/Summon/DaedalusGolemBuff.png new file mode 100644 index 0000000000000000000000000000000000000000..011938595e05e97592b59bce588b1aaeeae17d4e GIT binary patch literal 506 zcmVPx$v`IukR9J=Wmp@1XQ5?rV7ZnjWm=RGRC520%QBy+^^ammwm6i%=i)bz)8X}h# ziPorwhDMPfipZrYNTCKPs!1Y>1|g&<8}upfd3w;`-Qah*`~80R-u-@`d%t&gnrmPR zfRE?fELD`ft4{-{tL9Dhq}d(LEWluJOA0jJByvc)~`}iXOZ~F(jh=eNB z2^4lhU-(1{sH?qays6?u8yA<7{d<=J;QTcPl#+-n=iWi46DX_!vA2soUDd-`MzU2R zqGBVd?-0`o)DkG^f^vJkkWn|R?;Pp+)o!p}7pPw{$BQ-qeBBN5h||xC6Z)eIk{x;a z&Yc8ey7#dT0agCpG*C+7cCs0OK81wv3yI1zOZwl4LZ%Zabb-5l2>Ac%S7p=<$(Jj@ w0t9La)DqB~o&5l$Gw)UXJGM1BtnqjJ2VO~t*&EkB0RR9107*qoM6N<$f^G`rga7~l literal 0 HcmV?d00001 diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 1485da57fa..390b023739 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -953,6 +953,7 @@ namespace CalamityMod.CalPlayer public bool mountedScanner = false; public bool viridVanguard = false; public bool deathstareEyeball = false; + public bool daedalusGolem = false; #endregion #region Biome @@ -1980,6 +1981,7 @@ namespace CalamityMod.CalPlayer mountedScanner = false; viridVanguard = false; deathstareEyeball = false; + daedalusGolem = false; abyssalDivingSuitPrevious = abyssalDivingSuit; abyssalDivingSuit = abyssalDivingSuitHide = abyssalDivingSuitForce = abyssalDivingSuitPower = false; diff --git a/Items/Weapons/Summon/DaedalusGolemStaff.cs b/Items/Weapons/Summon/DaedalusGolemStaff.cs new file mode 100644 index 0000000000..988b360040 --- /dev/null +++ b/Items/Weapons/Summon/DaedalusGolemStaff.cs @@ -0,0 +1,44 @@ +using CalamityMod.Projectiles.Summon; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Summon +{ + public class DaedalusGolemStaff : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Daedalus Golem Staff"); + Tooltip.SetDefault("Summons a Daedalus Golem soldier that fires pellets and electricity\n" + + "Shining god of greed"); // Funny Hollow Knight reference. + } + + public override void SetDefaults() + { + item.damage = 70; + item.mana = 12; + item.width = item.height = 32; + item.useTime = item.useAnimation = 25; + item.useStyle = ItemUseStyleID.SwingThrow; + item.noMelee = true; + item.knockBack = 3f; + item.UseSound = SoundID.Item67; + item.autoReuse = true; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 10f; + item.summon = true; + + item.value = CalamityGlobalItem.Rarity5BuyPrice; + item.rare = ItemRarityID.Pink; + } + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + Point mouseTileCoords = Main.MouseWorld.ToTileCoordinates(); + if (!CalamityUtils.ParanoidTileRetrieval(mouseTileCoords.X, mouseTileCoords.Y).IsTileSolidGround()) + Projectile.NewProjectile(Main.MouseWorld, Vector2.UnitY * 4f, type, damage, knockBack, player.whoAmI, 0f, 0f); + return false; + } + } +} diff --git a/Items/Weapons/Summon/DaedalusGolemStaff.png b/Items/Weapons/Summon/DaedalusGolemStaff.png new file mode 100644 index 0000000000000000000000000000000000000000..974e746cb9abb20336604522ce7d5e07cd492feb GIT binary patch literal 1108 zcmV-a1grarP)Px(4oO5oRA_fXBHj@VB5X@a>-ymZQ2YCpaS)u zA*LO}@rJ~1c2+I`y`Q@+>y_3XHI%(|hkO9J<2~BY=QxJrmEOn9V$bS zJT6%S82mZt1IW)U0U&knE&#lBhXB2o7Sm?LY%rrv#v@i=^mmox=lbpQ2J_M@m-@@A zE}jJ7>V}=FKIbi;Ta@B4m^B+UV>`o9kKsH|Apl(;-WZHZPD(iV@&EuG@4f?Y`HnJr zy6Xp^n|7^O1;CS22LVWTxix_Hw@t%pmt#26Sd7O$fPzVCb>l8ntD`3m)Ob83Qvv8k z3+5Sn>H3;Vd8>iGjt+(G49BdOo{&BsfNx(0fIzdtwz74AZn*#2RRHS!F&i$9;YcB| zTU3$MpMAHb~ns@FD~4VI1UAN;C;o(cKV-xF559K+!vW;1hA0Nw1C-PHg*d)f-X zi}wwN&sC!gOEyw)C8w$940D_fg=08eGSZR(===1;5VOLiD;ELqxYZmuD@EnDWNvMq zb4MD-@JNx^&2nb~kddzD#EaIf1)ye^x?etRx(3kF`W%3qiBkZ`^Au_jxQdE2j^Y0$ z*mx_wvY4Gcw?YGGdZ>C~nfo@H_L7M5{N8qkNBq|`kGIk*i`m+vhk?MD9qy_oS~!M7 z5zMTNw=&Mgn_0njhKJot%Whv%sv2MWK4EFLAipp!%?h?N{5OV!?FGpmP)dd>cXX=k z{8yr0C8in0GhX3fOT&P^ zOINi+?d`~ZtT}(2=-Ah=?7y}(8_zVl)6{rtK2MdX*w?U}ixT8_KeYPqzrG*4Rz(rp a8U6zfl4uq@Sj0mB0000 StuckWalkThroughWallsTimer >= 40f || Collision.SolidCollision(projectile.Center, 2, 2); + public Player Owner => Main.player[projectile.owner]; + public ref float StuckWalkThroughWallsTimer => ref projectile.ai[0]; + public ref float StuckJumpSpeed => ref projectile.ai[1]; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Daedalus Golem"); + Main.projFrames[projectile.type] = 18; + ProjectileID.Sets.MinionSacrificable[projectile.type] = true; + ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.width = 40; + projectile.height = 58; + projectile.netImportant = true; + projectile.friendly = true; + projectile.minionSlots = 1; + projectile.timeLeft = 90000; + projectile.penetrate = -1; + projectile.minion = true; + projectile.tileCollide = true; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + } + + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(AttackTimer); + writer.Write(UsingChargedLaserAttack); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + AttackTimer = reader.ReadInt32(); + UsingChargedLaserAttack = reader.ReadBoolean(); + } + + #region AI + public override void AI() + { + Main.projFrames[projectile.type] = 16; + bool isCorrectProjectile = projectile.type == ModContent.ProjectileType(); + Owner.AddBuff(ModContent.BuffType(), 3600); + if (isCorrectProjectile) + { + if (Owner.dead) + Owner.Calamity().daedalusGolem = false; + + if (Owner.Calamity().daedalusGolem) + projectile.timeLeft = 2; + } + + AdjustMinionDamage(); + + // Fall down. + if (projectile.velocity.Y < 15f) + projectile.velocity.Y += Gravity; + + Vector2 destination; + NPC pontentialTarget = projectile.Center.MinionHoming(900f, Owner); + if (pontentialTarget is null) + destination = Owner.Center + Vector2.UnitX * (80f + (projectile.identity * 28f) % 560f); + else + destination = pontentialTarget.Center + Vector2.UnitX * (130f + (projectile.identity * 28f) % 560f); + + // Go upwards, and check down again to discover any height differences before deciding where to move. + Vector2 upwardCheck = destination - Vector2.UnitY * 2400f; + upwardCheck.Y = Utils.Clamp(upwardCheck.Y, 0f, Main.maxTilesY * 16f - 100f); + WorldUtils.Find(upwardCheck.ToTileCoordinates(), Searches.Chain(new Searches.Down(200), new Conditions.IsSolid()), out Point loweredPoint); + destination = loweredPoint.ToWorldCoordinates(); + + StuckWalkThroughWallsTimer = Utils.Clamp(StuckWalkThroughWallsTimer, 0, 160); + + if (projectile.Distance(Owner.Center) > 2500f) + { + projectile.Center = Owner.Center; + StuckWalkThroughWallsTimer = 0; + projectile.netImportant = true; + } + if ((MoveToDestination(destination) || AttackTimer > 0) && pontentialTarget != null) + { + AttackTimer++; + if (AttackTimer == 1) + { + UsingChargedLaserAttack = Main.rand.NextBool(3); + projectile.netUpdate = true; + } + + if (Main.myPlayer == projectile.owner) + { + if (UsingChargedLaserAttack && AttackTimer == ChargedLaserAttackTime / 2) + { + + } + else if (UsingChargedLaserAttack && AttackTimer == ChargedPelletAttackTime / 2) + { + + } + } + } + } + + public void AdjustMinionDamage() + { + if (projectile.localAI[0] == 0f) + { + projectile.Calamity().spawnedPlayerMinionDamageValue = Owner.MinionDamage(); + projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; + projectile.localAI[0] += 1f; + } + if (Owner.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) + { + int newDamage = (int)(projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / + projectile.Calamity().spawnedPlayerMinionDamageValue * + Owner.MinionDamage()); + projectile.damage = newDamage; + } + } + + public bool MoveToDestination(Vector2 destination) + { + Tile tileBelow = CalamityUtils.ParanoidTileRetrieval((int)(projectile.Bottom.X / 16), (int)(projectile.Bottom.Y / 16) + 1); + + // Float to the destination if stuck. + if (Stuck) + { + StuckJumpSpeed = 0f; + projectile.tileCollide = false; + + if (projectile.DistanceSQ(destination - Vector2.UnitY * 16f) > 10f * 10f) + projectile.velocity = projectile.DirectionTo(destination - Vector2.UnitY * 16f) * 6f; + else + StuckWalkThroughWallsTimer = 0; + + StuckWalkThroughWallsTimer -= 4; + return false; + } + + projectile.tileCollide = true; + // Don't bother moving any more if super close to the destination. + // Just slow down. + if (Math.Abs(projectile.Center.X - destination.X) < 15 + Math.Abs(projectile.velocity.X)) + { + StuckJumpSpeed = 0f; + projectile.velocity.X *= 0.8f; + return true; + } + + int currentWalkDirection = Math.Sign(projectile.velocity.X); + int tilesSearchedAhead = 0; + + Tile tileBelowAhead; + + do + { + tileBelowAhead = CalamityUtils.ParanoidTileRetrieval((int)(projectile.Bottom.X / 16) + currentWalkDirection, (int)(projectile.Bottom.Y / 16) + 1); + + if (tileBelowAhead.IsTileSolidGround()) + break; + + tilesSearchedAhead++; + } + while (tilesSearchedAhead < 4); + + int directionToWalk = Math.Sign(destination.X - projectile.Center.X); + float idealWalkSpeed = 10f * directionToWalk; + float walkAcceleration = directionToWalk != currentWalkDirection ? 0.325f : 0.2f; + projectile.velocity.X = MathHelper.Lerp(projectile.velocity.X, idealWalkSpeed, walkAcceleration); + + // Jump if there's a gap or a wall. + if (tileBelow.IsTileSolidGround() || Collision.SolidCollision(projectile.Center, 10, 10)) + { + if (Math.Abs(projectile.oldPosition.X - projectile.position.X) < 2f || + Collision.SolidCollision(projectile.Center, 2, 2) || + !Collision.CanHitLine(projectile.position, projectile.width, projectile.height, Owner.position, Owner.width, Owner.height)) + { + projectile.velocity.Y = -12f - StuckJumpSpeed; + projectile.netSpam -= 10; + StuckJumpSpeed += 3.5f; + StuckJumpSpeed = Utils.Clamp(StuckJumpSpeed, 0f, 14f); + + StuckWalkThroughWallsTimer += 10f; + + projectile.netUpdate = true; + } + else if (tilesSearchedAhead > 0) + { + projectile.velocity.X = 7f; + + projectile.velocity.Y = -(5f + tilesSearchedAhead * 2f); + projectile.netSpam -= 10; + projectile.netUpdate = true; + } + else + { + StuckJumpSpeed = 0f; + StuckWalkThroughWallsTimer -= 5f; + } + } + + projectile.spriteDirection = (projectile.velocity.X < 0).ToDirectionInt(); + return false; + } + #endregion + + // Prevent on-tile collision death. + public override bool OnTileCollide(Vector2 oldVelocity) => false; + + public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) + { + int startingWalkFrame = 6; + int endingWalkFrame = 10; + + int startingPelletFrame = 1; + int endingPelletFrame = 4; + + int startingBeamFrame = 11; + int endingBeamFrame = 15; + + // Walking frames. Moves more quickly the faster the walk. + projectile.frameCounter++; + Tile tileBelow = CalamityUtils.ParanoidTileRetrieval((int)(projectile.Bottom.X / 16), (int)(projectile.Bottom.Y / 16) + 1); + + if (Stuck) + { + projectile.frame = 5; + } + else if (AttackTimer > 0) + { + if (UsingChargedLaserAttack) + projectile.frame = (int)MathHelper.Lerp(startingBeamFrame, endingBeamFrame + 1, Utils.InverseLerp(0f, ChargedLaserAttackTime, AttackTimer, true)); + else + projectile.frame = (int)MathHelper.Lerp(startingPelletFrame, endingPelletFrame + 1, Utils.InverseLerp(0f, ChargedPelletAttackTime, AttackTimer, true)); + } + else if (Math.Abs(projectile.velocity.X) > 1f && tileBelow.IsTileSolidGround()) + { + if (projectile.frameCounter >= Utils.Clamp(2, 6, (int)Math.Abs(projectile.velocity.X * 0.8))) + { + projectile.frameCounter = 0; + projectile.frame++; + if (projectile.frame >= endingWalkFrame) + projectile.frame = startingWalkFrame; + } + projectile.frame = Utils.Clamp(projectile.frame, startingWalkFrame, endingWalkFrame); + } + else if (Math.Abs(projectile.velocity.X) <= 1f) + { + projectile.frame = 0; + } + } + + public override bool CanDamage() => false; + } +} diff --git a/Projectiles/Summon/DaedalusGolem.png b/Projectiles/Summon/Daedal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Rl^e&ZVyfgb-{f{sw ref projectile.ai[1]; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Daedalus Lightning"); + ProjectileID.Sets.MinionShot[projectile.type] = true; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 20; + ProjectileID.Sets.TrailingMode[projectile.type] = 1; + } + + public override void SetDefaults() + { + projectile.width = 14; + projectile.height = 14; + projectile.friendly = true; + projectile.minion = true; + projectile.alpha = 255; + projectile.penetrate = -1; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.extraUpdates = 20; + projectile.timeLeft = 75 * projectile.extraUpdates; + cooldownSlot = 1; + } + + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(projectile.localAI[0]); + writer.Write(projectile.localAI[1]); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + projectile.localAI[0] = reader.ReadSingle(); + projectile.localAI[1] = reader.ReadSingle(); + } + + public override void AI() + { + projectile.frameCounter++; + + Lighting.AddLight(projectile.Center, Color.Pink.ToVector3()); + if (projectile.frameCounter >= projectile.extraUpdates * 2) + { + projectile.frameCounter = 0; + float originalSpeed = projectile.velocity.Length(); + UnifiedRandom unifiedRandom = new UnifiedRandom((int)BaseTurnAngleRatio); + int num862 = 0; + Vector2 vector97 = -Vector2.UnitY; + Vector2 vector98; + do + { + BaseTurnAngleRatio = unifiedRandom.Next() % 100; + vector98 = (BaseTurnAngleRatio / 100f * MathHelper.TwoPi).ToRotationVector2(); + if (vector98.Y > 0f) + { + vector98.Y *= -1f; + } + bool flag37 = false; + if (vector98.Y > -0.02f) + { + flag37 = true; + } + if (vector98.X * (projectile.extraUpdates + 1) * 2f * originalSpeed + projectile.localAI[0] > 40f) + { + flag37 = true; + } + if (vector98.X * (projectile.extraUpdates + 1) * 2f * originalSpeed + projectile.localAI[0] < -40f) + { + flag37 = true; + } + if (!flag37) + { + vector97 = vector98; + } + num862++; + } + while (num862 < 100); + + projectile.velocity = Vector2.Zero; + projectile.localAI[1] = 1f; + + if (projectile.velocity != Vector2.Zero) + { + projectile.localAI[0] += vector97.X * (projectile.extraUpdates + 1) * 2f * originalSpeed; + projectile.velocity = vector97.RotatedBy(projectile.ai[0] + MathHelper.PiOver2) * originalSpeed; + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; + } + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Vector2 end = projectile.Center + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; + Texture2D lightningTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/RedLightningTexture"); + projectile.GetAlpha(lightColor); + Vector2 scaleVector = new Vector2(projectile.scale) / 2f; + for (int i = 0; i < 3; i++) + { + // c_1 and f_1 are two somewhat ambiguous fields that are used by various methods + // in the DelegateMethods class. c_1 is used to represent the current color to be + // drawn while f_1 represents the opacity. + switch (i) + { + case 0: + scaleVector = new Vector2(projectile.scale) * 0.6f; + DelegateMethods.c_1 = Color.HotPink * 0.5f; + break; + case 1: + scaleVector = new Vector2(projectile.scale) * 0.4f; + DelegateMethods.c_1 = Color.Pink * 0.5f; + break; + case 2: + scaleVector = new Vector2(projectile.scale) * 0.2f; + DelegateMethods.c_1 = Color.White * 0.5f; + break; + } + DelegateMethods.f_1 = 1f; + + // Ignore zero oldPos indices. + // There are almost guaranteed to be currently unfilled instead of being + // legitimate positions. + for (int j = projectile.oldPos.Length - 1; j > 0; j--) + { + if (!(projectile.oldPos[j] == Vector2.Zero)) + { + Vector2 start = projectile.oldPos[j] + projectile.Size * 0.5f + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; + Vector2 end2 = projectile.oldPos[j - 1] + projectile.Size * 0.5f + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; + Utils.DrawLaser(spriteBatch, lightningTexture, start, end2, scaleVector, DelegateMethods.LightningLaserDraw); + } + } + if (projectile.oldPos[0] != Vector2.Zero) + { + DelegateMethods.f_1 = 1f; + Vector2 start2 = projectile.oldPos[0] + projectile.Size * 0.5f + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; + Utils.DrawLaser(Main.spriteBatch, lightningTexture, start2, end, scaleVector, DelegateMethods.LightningLaserDraw); + } + } + return false; + } + } +} diff --git a/Projectiles/Summon/DaedalusLightning.png b/Projectiles/Summon/DaedalusLightning.png new file mode 100644 index 0000000000000000000000000000000000000000..f99e9c57d500bc2b7e8d33ffe4ce738e005f0b0d GIT binary patch literal 191 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H1|*Mc$*~4fjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCils0(?STf%N~sAJ_vPoCC7LJzX3_JiL=r4lw=$iprll!YwhAb;GQKEK67N z8RRHmTl#|G?$a&hhCB6K*$t*&K6ms=k*3vxnceQZZOwtr4-;NU+OVAF(%@xxUT)*Y ieq`62bER_3%nU1U%Lqmu_`efq1%s!npUXO@geCy~$3Ut8 literal 0 HcmV?d00001 diff --git a/Projectiles/Summon/DeathstareEyeball.cs b/Projectiles/Summon/DeathstareEyeball.cs index e22b85e53a..3845740cb1 100644 --- a/Projectiles/Summon/DeathstareEyeball.cs +++ b/Projectiles/Summon/DeathstareEyeball.cs @@ -20,6 +20,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { DisplayName.SetDefault("Eyeball"); + Main.projFrames[projectile.type] = 4; ProjectileID.Sets.NeedsUUID[projectile.type] = true; ProjectileID.Sets.MinionSacrificable[projectile.type] = true; ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; diff --git a/Projectiles/Summon/MechwormHead.cs b/Projectiles/Summon/MechwormHead.cs index 9070871a2e..737bab1c7b 100644 --- a/Projectiles/Summon/MechwormHead.cs +++ b/Projectiles/Summon/MechwormHead.cs @@ -296,6 +296,7 @@ namespace CalamityMod.Projectiles.Summon if (Vector2.Dot(projectile.velocity.SafeNormalize(Vector2.Zero), projectile.DirectionTo(target.Center)) > 0.86f) AttackStateTimer += redirectTime - (AttackStateTimer % chargeTime); } + if (AttackStateTimer % (chargeTime + redirectTime) == chargeTime) { // Charge and release a spread of lasers. diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index 3550170383..f5e853c2c5 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -1939,6 +1939,7 @@ namespace CalamityMod #endregion #region Tile Utilities + public static bool IsTileSolidGround(this Tile tile) => tile != null && tile.nactive() && Main.tileSolid[tile.type]; public static void SafeSquareTileFrame(int x, int y, bool resetFrame = true) { if (Main.tile[x, y] is null) From 89f73c436c4b713a0506a678fd968f3d3a57fc08 Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 16 Oct 2020 12:55:11 -0500 Subject: [PATCH 006/202] Added the Slime Puppet Staff --- Items/TreasureBags/SlimeGodBag.cs | 3 +- Items/Weapons/Summon/SlimePuppetStaff.cs | 48 +++++++++ Items/Weapons/Summon/SlimePuppetStaff.png | Bin 0 -> 1023 bytes NPCs/SlimeGod/SlimeGodCore.cs | 3 +- Projectiles/Summon/SlimePuppet.cs | 118 ++++++++++++++++++++++ Projectiles/Summon/SlimePuppet.png | Bin 0 -> 419 bytes 6 files changed, 170 insertions(+), 2 deletions(-) create mode 100644 Items/Weapons/Summon/SlimePuppetStaff.cs create mode 100644 Items/Weapons/Summon/SlimePuppetStaff.png create mode 100644 Projectiles/Summon/SlimePuppet.cs create mode 100644 Projectiles/Summon/SlimePuppet.png diff --git a/Items/TreasureBags/SlimeGodBag.cs b/Items/TreasureBags/SlimeGodBag.cs index 4ff7c12e68..3c97028e30 100644 --- a/Items/TreasureBags/SlimeGodBag.cs +++ b/Items/TreasureBags/SlimeGodBag.cs @@ -51,7 +51,8 @@ namespace CalamityMod.Items.TreasureBags DropHelper.WeightStack(w), DropHelper.WeightStack(w), DropHelper.WeightStack(w), - DropHelper.WeightStack(w) + DropHelper.WeightStack(w), + DropHelper.WeightStack(w) ); // Equipment diff --git a/Items/Weapons/Summon/SlimePuppetStaff.cs b/Items/Weapons/Summon/SlimePuppetStaff.cs new file mode 100644 index 0000000000..93bea9288a --- /dev/null +++ b/Items/Weapons/Summon/SlimePuppetStaff.cs @@ -0,0 +1,48 @@ +using CalamityMod.Projectiles.Summon; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Summon +{ + public class SlimePuppetStaff : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Slime Puppet Staff"); + Tooltip.SetDefault("Summons a slime ball that follows you\n" + + "The ball flies toward nearby enemies and explodes into slime on enemy hits\n" + + "Does not consume minion slots"); // In other words, bootleg mage :TaxEvasion: + Item.staff[item.type] = true; + } + + public override void SetDefaults() + { + item.damage = 26; + item.mana = 13; + item.width = 48; + item.height = 56; + item.useTime = item.useAnimation = 24; + item.useStyle = ItemUseStyleID.HoldingOut; + item.noMelee = true; + item.knockBack = 3.6f; + item.value = CalamityGlobalItem.Rarity4BuyPrice; + item.rare = ItemRarityID.LightRed; + item.UseSound = mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/SlimeGodPossession"); + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 10f; + item.summon = true; + } + + public override Vector2? HoldoutOrigin() => new Vector2(12f); + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + if (player.altFunctionUse != 2) + Projectile.NewProjectile(Main.MouseWorld, Vector2.Zero, type, damage, knockBack, Main.myPlayer); + + return false; + } + } +} diff --git a/Items/Weapons/Summon/SlimePuppetStaff.png b/Items/Weapons/Summon/SlimePuppetStaff.png new file mode 100644 index 0000000000000000000000000000000000000000..119db8650670d3e99cad96eb72d669bfb6168ef5 GIT binary patch literal 1023 zcmVPx&xk*GpRA_?pJe6n0?#Q`l#EZ*A4nU-%Jq56F(>?$~Riyw7 zeHsIPwdq((3jo(|tBAYTzb51S%fv+z*=o=us1TM)CS?3hY+6W*yd8O}wJ#GF?QLuY zAn`+0=dR;(07gfitJ)DoJXu`@!2a%gfahIKm9=JdA8U!{EOH9z-N6O`9>+guxk_X* z4tU;0h>N~-_WYfBIEcMlPa&iRFKr# z&wbY)w+jQxiJY(f>Yu z=BXtAKGUtT!cf&S0D9g&1faessEs%CZj-dgTH=4~RT>)<(ZqBzW5wh9_({7K(xS4J zg$_WuuTX2Bi?qmE;#u3c_-m2a_C!IEYH+{m6Q@a=g#9I}9RPP+jUW9n1;Fdx&a4*= z789S>#^;KRA~Odu377g6;W1-JByV4+tR-P0I{Aoy8`4gqgmiF~I;o0(8v=6gHRhAO#Lag${*u)IxZ_{* zlC;QL;=Vv-4FHM3XbQZnEni8C>?JOw&B~=G{q9`y=X@b8vX}VGmvqHqp6Q9r=L>0( t{lsS~m$&Le{uh!Mj4u7EvXHgJe*)A7XxDGiXV?G$002ovPDHLkV1fYE(w), DropHelper.WeightStack(w), DropHelper.WeightStack(w), - DropHelper.WeightStack(w) + DropHelper.WeightStack(w), + DropHelper.WeightStack(w) ); // Vanity diff --git a/Projectiles/Summon/SlimePuppet.cs b/Projectiles/Summon/SlimePuppet.cs new file mode 100644 index 0000000000..a5e6e9821f --- /dev/null +++ b/Projectiles/Summon/SlimePuppet.cs @@ -0,0 +1,118 @@ +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 SlimePuppet : ModProjectile + { + public Player Owner => Main.player[projectile.owner]; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Slime Puppet"); + ProjectileID.Sets.MinionSacrificable[projectile.type] = true; + ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 1; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } + + public override void SetDefaults() + { + projectile.width = 60; + projectile.height = 60; + projectile.netImportant = true; + projectile.friendly = true; + projectile.minionSlots = 0; + projectile.timeLeft = 300; + projectile.penetrate = 1; + projectile.minion = true; + projectile.tileCollide = false; + } + + public override void AI() + { + ResetDamage(); + + // Prevent clumping of other slime puppets near this one. + projectile.MinionAntiClump(); + + NPC potentialTarget = projectile.Center.MinionHoming(800f, Owner); + + if (potentialTarget is null) + { + // Movement above the player, depending on the index of the projectile in the Main.projectile array. + float destinationAngularOffset = (float)Math.Sin(projectile.identity / 6f % 6f * MathHelper.Pi) * MathHelper.Pi / 10f; + Vector2 destination = Owner.Center - Vector2.UnitY.RotatedBy(destinationAngularOffset) * 160f; + + if (projectile.DistanceSQ(destination) > 18f * 18f) + projectile.velocity = (projectile.velocity * 20f + projectile.DirectionTo(destination) * 9f) / 21f; + } + else + { + float nudgedVelocityDirection = projectile.velocity.ToRotation().AngleTowards(projectile.AngleTo(potentialTarget.Center), 0.078f); + projectile.velocity = nudgedVelocityDirection.ToRotationVector2() * MathHelper.Lerp(projectile.velocity.Length(), 16f, 0.25f); + if (projectile.DistanceSQ(potentialTarget.Center) < 120f * 120f) + projectile.Center += projectile.DirectionTo(potentialTarget.Center) * 3f; + } + if (projectile.ai[0] > 0f) + { + projectile.rotation += MathHelper.ToRadians(projectile.velocity.Length() / 4f) * Math.Sign(projectile.velocity.X); + projectile.ai[0]--; + } + else if (potentialTarget != null) + projectile.rotation = projectile.velocity.ToRotation(); + + if (Vector2.Dot(projectile.oldVelocity.SafeNormalize(Vector2.Zero), projectile.velocity.SafeNormalize(Vector2.Zero)) < 0.87) + projectile.ai[0] = 50f; + } + + public void ResetDamage() + { + // Initialize minion damage values the moment the projectile is spawned. + if (projectile.localAI[0] == 0f) + { + projectile.Calamity().spawnedPlayerMinionDamageValue = Owner.MinionDamage(); + projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; + projectile.localAI[0] = 1f; + } + if (Owner.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) + { + int trueDamage = (int)(projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * Owner.MinionDamage()); + projectile.damage = trueDamage; + } + } + + public override void Kill(int timeLeft) + { + CalamityGlobalProjectile.ExpandHitboxBy(projectile, 100); + projectile.maxPenetrate = -1; + projectile.penetrate = -1; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + projectile.Damage(); + Main.PlaySound(SoundID.NPCDeath1, projectile.Center); + + if (!Main.dedServ) + { + for (int i = 0; i < 20; i++) + { + Vector2 spawnOffset = Main.rand.NextVector2Unit() * Main.rand.NextFloat(4f, 36f); + Dust slime = Dust.NewDustPerfect(projectile.Center + spawnOffset, 243); + slime.velocity = spawnOffset.RotatedBy(MathHelper.PiOver2 * Main.rand.NextBool(2).ToDirectionInt()) * 0.16f; + slime.scale = 1.2f; + } + } + } + + public override bool OnTileCollide(Vector2 oldVelocity) => false; + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + } +} diff --git a/Projectiles/Summon/SlimePuppet.png b/Projectiles/Summon/SlimePuppet.png new file mode 100644 index 0000000000000000000000000000000000000000..25eb7cc27f92f5e33e8bfd5d826c88ee6f987181 GIT binary patch literal 419 zcmV;U0bKrxP)Px$T}ebiR7i=H(?Nk9;U z9>C4(z483|t_8qK(&pcQC+6jB34s25XfQs`A0~dF(Qg{_ieK;mdebrBKtV?&e-S&k~ueeVKr_RvuUJaD04$t^%Sb3yB*q`FpJyy*at&*lIZ3gq)NxBL_b z#ccrEqd^ERU6h9Bdfk}kPcMMjJ%TFH9u0v1q`=1cq-D%&e(}q7?iI+__IXgvZRTnC zdj-n#M!y+CoGnr!*lw|*ldN>z^*0@5k==>JG|m literal 0 HcmV?d00001 From a7eacb4cb6de1bdd0f209b320d1852c3d2f14294 Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 16 Oct 2020 15:17:31 -0500 Subject: [PATCH 007/202] Daedalus Golem should be finished now --- Items/Weapons/Summon/DaedalusGolemStaff.cs | 10 ++ Projectiles/Summon/DaedalusGolem.cs | 65 +++++++++---- Projectiles/Summon/DaedalusGolem.png | Bin 3860 -> 4819 bytes Projectiles/Summon/DaedalusLightning.cs | 105 ++++++++++++--------- Projectiles/Summon/DaedalusPellet.cs | 65 +++++++++++++ Projectiles/Summon/DaedalusPellet.png | Bin 0 -> 341 bytes Utilities/CalamityUtils.cs | 2 +- 7 files changed, 184 insertions(+), 63 deletions(-) create mode 100644 Projectiles/Summon/DaedalusPellet.cs create mode 100644 Projectiles/Summon/DaedalusPellet.png diff --git a/Items/Weapons/Summon/DaedalusGolemStaff.cs b/Items/Weapons/Summon/DaedalusGolemStaff.cs index 988b360040..8486a97ddf 100644 --- a/Items/Weapons/Summon/DaedalusGolemStaff.cs +++ b/Items/Weapons/Summon/DaedalusGolemStaff.cs @@ -1,3 +1,4 @@ +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -40,5 +41,14 @@ namespace CalamityMod.Items.Weapons.Summon Projectile.NewProjectile(Main.MouseWorld, Vector2.UnitY * 4f, type, damage, knockBack, player.whoAmI, 0f, 0f); return false; } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 12); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); + } } } diff --git a/Projectiles/Summon/DaedalusGolem.cs b/Projectiles/Summon/DaedalusGolem.cs index 6c5edb73d7..52095c4862 100644 --- a/Projectiles/Summon/DaedalusGolem.cs +++ b/Projectiles/Summon/DaedalusGolem.cs @@ -18,6 +18,7 @@ namespace CalamityMod.Projectiles.Summon public const int ChargedLaserAttackTime = 120; public const float Gravity = 0.35f; public bool Stuck => StuckWalkThroughWallsTimer >= 40f || Collision.SolidCollision(projectile.Center, 2, 2); + public Vector2 ArmPosition => projectile.Center + new Vector2(projectile.spriteDirection == 1 ? -4f : 32f, 0f); public Player Owner => Main.player[projectile.owner]; public ref float StuckWalkThroughWallsTimer => ref projectile.ai[0]; public ref float StuckJumpSpeed => ref projectile.ai[1]; @@ -31,7 +32,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetDefaults() { - projectile.width = 40; + projectile.width = 28; projectile.height = 58; projectile.netImportant = true; projectile.friendly = true; @@ -78,11 +79,11 @@ namespace CalamityMod.Projectiles.Summon projectile.velocity.Y += Gravity; Vector2 destination; - NPC pontentialTarget = projectile.Center.MinionHoming(900f, Owner); - if (pontentialTarget is null) + NPC potentialTarget = projectile.Center.MinionHoming(900f, Owner); + if (potentialTarget is null) destination = Owner.Center + Vector2.UnitX * (80f + (projectile.identity * 28f) % 560f); else - destination = pontentialTarget.Center + Vector2.UnitX * (130f + (projectile.identity * 28f) % 560f); + destination = potentialTarget.Center + Vector2.UnitX * (130f + (projectile.identity * 28f) % 560f); // Go upwards, and check down again to discover any height differences before deciding where to move. Vector2 upwardCheck = destination - Vector2.UnitY * 2400f; @@ -92,31 +93,55 @@ namespace CalamityMod.Projectiles.Summon StuckWalkThroughWallsTimer = Utils.Clamp(StuckWalkThroughWallsTimer, 0, 160); - if (projectile.Distance(Owner.Center) > 2500f) + if (projectile.Distance(Owner.Center) > 3500f) { projectile.Center = Owner.Center; StuckWalkThroughWallsTimer = 0; projectile.netImportant = true; } - if ((MoveToDestination(destination) || AttackTimer > 0) && pontentialTarget != null) + if ((MoveToDestination(destination) || AttackTimer > 0) && potentialTarget != null) { AttackTimer++; if (AttackTimer == 1) { - UsingChargedLaserAttack = Main.rand.NextBool(3); + UsingChargedLaserAttack = Main.rand.NextBool(7); projectile.netUpdate = true; } - if (Main.myPlayer == projectile.owner) - { - if (UsingChargedLaserAttack && AttackTimer == ChargedLaserAttackTime / 2) - { + if (AttackTimer >= (UsingChargedLaserAttack ? ChargedLaserAttackTime : ChargedPelletAttackTime)) + { + AttackTimer = 0; + projectile.netUpdate = true; + } + projectile.spriteDirection = (potentialTarget.Center.X - projectile.Center.X < 0).ToDirectionInt(); + + if (UsingChargedLaserAttack) + { + if (AttackTimer >= 45 && AttackTimer < ChargedLaserAttackTime / 2 && !Main.dedServ) + { + Vector2 drawOffset = Main.rand.NextVector2CircularEdge(12f, 12f); + Dust light = Dust.NewDustPerfect(ArmPosition + drawOffset, 261); + light.velocity = drawOffset.SafeNormalize(Vector2.Zero) * -2.5f; + light.color = Color.Lerp(Color.HotPink, Color.LightPink, Main.rand.NextFloat()); + light.scale = Main.rand.NextFloat(1.2f, 1.45f); + light.noGravity = true; } - else if (UsingChargedLaserAttack && AttackTimer == ChargedPelletAttackTime / 2) + else if (AttackTimer >= ChargedLaserAttackTime / 2 && AttackTimer <= ChargedLaserAttackTime / 2 + 30 && AttackTimer % 10 == 9) { - - } + Main.PlaySound(SoundID.Item122, ArmPosition); + if (Main.myPlayer == projectile.owner) + { + Vector2 initialVelocity = projectile.DirectionTo(potentialTarget.Center) * 3f; + float initialAngle = initialVelocity.ToRotation(); + Projectile.NewProjectile(ArmPosition, initialVelocity, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, initialAngle, Main.rand.Next(100)); + } + } + } + else if (!UsingChargedLaserAttack && AttackTimer == ChargedPelletAttackTime / 2 && Main.myPlayer == projectile.owner) + { + Vector2 initialVelocity = projectile.DirectionTo(potentialTarget.Center + potentialTarget.velocity * 15f) * 19f; + Projectile.NewProjectile(ArmPosition, initialVelocity, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner); } } } @@ -159,9 +184,10 @@ namespace CalamityMod.Projectiles.Summon projectile.tileCollide = true; // Don't bother moving any more if super close to the destination. - // Just slow down. - if (Math.Abs(projectile.Center.X - destination.X) < 15 + Math.Abs(projectile.velocity.X)) + // Just slow down and face the player. + if (Math.Abs(projectile.Center.X - destination.X) < 35 + Math.Abs(projectile.velocity.X)) { + projectile.spriteDirection = (Owner.Center.X - projectile.Center.X < 0).ToDirectionInt(); StuckJumpSpeed = 0f; projectile.velocity.X *= 0.8f; return true; @@ -226,8 +252,13 @@ namespace CalamityMod.Projectiles.Summon // Prevent on-tile collision death. public override bool OnTileCollide(Vector2 oldVelocity) => false; + public override bool TileCollideStyle(ref int width, ref int height, ref bool fallThrough) + { + fallThrough = false; + return true; + } - public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) + public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) { int startingWalkFrame = 6; int endingWalkFrame = 10; diff --git a/Projectiles/Summon/DaedalusGolem.png b/Projectiles/Summon/DaedalusGolem.png index 80d029eb2a5c0d2d24f4b7cf49f583b660c41efe..56ae471ca9b014e8adef91e5e29d1fcb3ad28eac 100644 GIT binary patch literal 4819 zcmeHLdo+}7yB{>+$#LFi=yj%%IXD$XhnJbrWEeDNCWqt@m8myOqNb9=Fb*S`L?o5L zh?GM)H3>5zDdqG=QZZ6W$&@rA_ISU&zqR&S-~Mm^wfA?g^{o58pLMV2x_-akbzS$h zo;0$DvnrqiKp+rR7vc_zY{o+%s~}1WvQ_ZzxJub1cZ}kUhg3e*`ykt_3dOnOAds5O zHH-V85QqYV>_#KV-fRA5V2|;k?FgpePKNG_#vUt)!R5vtso7gLGJNPm(!ktOrKIos z!uZs(?C`(GzZv+y#K6s{E3&MSgG5n0sLTJq2ZZ`V(Nw0bGK1)Q3<6OTtvqsYq-(rv zL3Y`JqcHDt>>9{4^ z@$1Z3HC<>E`0QC=V02ohyl`;veW<&b#~uCg*>kPEG=n!@)eo#=6*-tw>}Y{5QxbwalFk&jOo7W(@iDrV}*2eKX9 zg^b}PhL{Y6$(Iz`P>77l4O1l=$9wZn38`{QMfgB8VoDgFf=@hj3wc(G4DLLGM4a49 zFsOcG6L2)inflf#Ps|UxT~3Mt^Jfmbv}EF0cVc;O6e@1js?;(Bio_N`s zj`)M2zwk3ZFR(0>6k#1`yxY#^{hw|ry*KxHN%0Ra=ik##S2vCo4tpcP&T$pRqx}AoP=N9=;Pj-kZ{tyB4^N}HGw*fkTI-dz$;-IV2cx5URYrYV$Qyanwkr;_ zf+}X8ku$WOOP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2pi squash + // later in the code to get an arbitrary unit vector (which is then checked). public ref float BaseTurnAngleRatio => ref projectile.ai[1]; + public ref float AccumulatedXMovementSpeeds => ref projectile.localAI[0]; + public ref float BranchingIteration => ref projectile.localAI[1]; public override void SetStaticDefaults() { @@ -30,75 +34,87 @@ namespace CalamityMod.Projectiles.Summon projectile.friendly = true; projectile.minion = true; projectile.alpha = 255; - projectile.penetrate = -1; + projectile.penetrate = 2; projectile.ignoreWater = true; projectile.tileCollide = false; projectile.extraUpdates = 20; - projectile.timeLeft = 75 * projectile.extraUpdates; - cooldownSlot = 1; + projectile.timeLeft = 45 * projectile.extraUpdates; + + // Readjust the velocity magnitude the moment this projectile is created + // to make velocity setting outside the scope of this projectile less irritating + // to consider alongside extraUpdate multipliers. + // Also set the initial angle. + if (projectile.velocity != Vector2.Zero) + { + projectile.velocity /= projectile.extraUpdates; + } } public override void SendExtraAI(BinaryWriter writer) { - writer.Write(projectile.localAI[0]); - writer.Write(projectile.localAI[1]); + writer.Write(AccumulatedXMovementSpeeds); + writer.Write(BranchingIteration); } public override void ReceiveExtraAI(BinaryReader reader) { - projectile.localAI[0] = reader.ReadSingle(); - projectile.localAI[1] = reader.ReadSingle(); + AccumulatedXMovementSpeeds = reader.ReadSingle(); + BranchingIteration = reader.ReadSingle(); } public override void AI() { + // frameCounter in this context is really just an arbitrary timer + // which allows random turning to occur. projectile.frameCounter++; Lighting.AddLight(projectile.Center, Color.Pink.ToVector3()); if (projectile.frameCounter >= projectile.extraUpdates * 2) { projectile.frameCounter = 0; - float originalSpeed = projectile.velocity.Length(); + + float originalSpeed = MathHelper.Min(6f, projectile.velocity.Length()); UnifiedRandom unifiedRandom = new UnifiedRandom((int)BaseTurnAngleRatio); - int num862 = 0; - Vector2 vector97 = -Vector2.UnitY; - Vector2 vector98; + int turnTries = 0; + Vector2 newBaseDirection = -Vector2.UnitY; + Vector2 potentialBaseDirection; + do { BaseTurnAngleRatio = unifiedRandom.Next() % 100; - vector98 = (BaseTurnAngleRatio / 100f * MathHelper.TwoPi).ToRotationVector2(); - if (vector98.Y > 0f) - { - vector98.Y *= -1f; - } - bool flag37 = false; - if (vector98.Y > -0.02f) - { - flag37 = true; - } - if (vector98.X * (projectile.extraUpdates + 1) * 2f * originalSpeed + projectile.localAI[0] > 40f) - { - flag37 = true; - } - if (vector98.X * (projectile.extraUpdates + 1) * 2f * originalSpeed + projectile.localAI[0] < -40f) - { - flag37 = true; - } - if (!flag37) - { - vector97 = vector98; - } - num862++; - } - while (num862 < 100); + potentialBaseDirection = (BaseTurnAngleRatio / 100f * MathHelper.TwoPi).ToRotationVector2(); - projectile.velocity = Vector2.Zero; - projectile.localAI[1] = 1f; + // Ensure that the new potential direction base is always moving upwards (this is supposed to be somewhat similar to a -UnitY + RotatedBy). + potentialBaseDirection.Y = -Math.Abs(potentialBaseDirection.Y); + + bool canChangeLightningDirection = true; + + // Potential directions with very little Y speed should not be considered, because this + // consequentially means that the X speed would be quite large. + if (potentialBaseDirection.Y > -0.02f) + canChangeLightningDirection = false; + + // This mess of math basically encourages movement at the ends of an extraUpdate cycle, + // discourages super frequenent randomness as the accumulated X speed changes get larger, + // or if the original speed is quite large. + if (Math.Abs(potentialBaseDirection.X * (projectile.extraUpdates + 1) * 2f * originalSpeed + AccumulatedXMovementSpeeds) > + projectile.MaxUpdates * 2f * LightningTurnRandomnessFactor) + { + canChangeLightningDirection = false; + } + + // If the above checks were all passed, redefine the base direction of the lightning. + if (canChangeLightningDirection) + newBaseDirection = potentialBaseDirection; + + turnTries++; + } + while (turnTries < 100); if (projectile.velocity != Vector2.Zero) { - projectile.localAI[0] += vector97.X * (projectile.extraUpdates + 1) * 2f * originalSpeed; - projectile.velocity = vector97.RotatedBy(projectile.ai[0] + MathHelper.PiOver2) * originalSpeed; + AccumulatedXMovementSpeeds += newBaseDirection.X * (projectile.extraUpdates + 1) * 2f * originalSpeed; + projectile.velocity = newBaseDirection.RotatedBy(InitialVelocityAngle + MathHelper.PiOver2) * originalSpeed; projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; } } @@ -108,7 +124,6 @@ namespace CalamityMod.Projectiles.Summon { Vector2 end = projectile.Center + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; Texture2D lightningTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/RedLightningTexture"); - projectile.GetAlpha(lightColor); Vector2 scaleVector = new Vector2(projectile.scale) / 2f; for (int i = 0; i < 3; i++) { diff --git a/Projectiles/Summon/DaedalusPellet.cs b/Projectiles/Summon/DaedalusPellet.cs new file mode 100644 index 0000000000..afb538c7b9 --- /dev/null +++ b/Projectiles/Summon/DaedalusPellet.cs @@ -0,0 +1,65 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Summon +{ + public class DaedalusPellet : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Pellet"); + Main.projFrames[projectile.type] = 3; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + ProjectileID.Sets.MinionShot[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.width = 10; + projectile.height = 10; + projectile.friendly = true; + projectile.minion = true; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.alpha = 255; + projectile.penetrate = 1; + projectile.timeLeft = 600; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = -2; + } + + public override void AI() + { + projectile.frameCounter++; + if (projectile.frameCounter > 4) + { + projectile.frame++; + if (projectile.frame >= 3) + { + projectile.frame = 0; + } + projectile.frameCounter = 0; + } + if (projectile.ai[0] == 0f) + { + projectile.ai[0] = 1f; + Main.PlaySound(SoundID.DD2_SkyDragonsFuryShot, projectile.Center); + } + projectile.alpha = Utils.Clamp(projectile.alpha - 50, 0, 255); + } + + public override Color? GetAlpha(Color lightColor) + { + return new Color(255, 255, 255, projectile.alpha); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + } +} diff --git a/Projectiles/Summon/DaedalusPellet.png b/Projectiles/Summon/DaedalusPellet.png new file mode 100644 index 0000000000000000000000000000000000000000..b057abe3123bd091f52850e0618b08f55d33a610 GIT binary patch literal 341 zcmV-b0jmCqP)Px$4@pEpR7i>Kmb(hVKoCXG8nqD7(o|NKqF*8QeyF{lVXzg%DwYu+;42n7Aqg82 z+0}sLRvVa|xifQTvQRdZ93JyPj$x5IwOJQ{nkj>N?3@=lZKtd=NMJQ>CBBD?lh)3d zLHQ0cYmk-mR~d*Z3n|eWg9@O$;}w98e*>Vuyo8WF3)^v10qosZ1C6_&HtREQk45(Z z03H8kX&*#6yP0F5h1@f*fp@%qlzSTGFBJ0{Jm!H`d3g|J{(}-_s>I{Zr?G tile != null && tile.nactive() && Main.tileSolid[tile.type]; + public static bool IsTileSolidGround(this Tile tile) => tile != null && tile.nactive() && (Main.tileSolid[tile.type] || Main.tileSolidTop[tile.type]); public static void SafeSquareTileFrame(int x, int y, bool resetFrame = true) { if (Main.tile[x, y] is null) From 07b6d97570a6f466dd4e8ff5a587af33f5bcc8fe Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 16 Oct 2020 17:54:45 -0500 Subject: [PATCH 008/202] Made Daedalus Golem Lightning epic --- Projectiles/Summon/DaedalusGolem.cs | 11 +++- Projectiles/Summon/DaedalusLightning.cs | 70 +++++++++---------------- TrailGeneration/PrimitiveTrail.cs | 60 +++++++++++++++------ 3 files changed, 77 insertions(+), 64 deletions(-) diff --git a/Projectiles/Summon/DaedalusGolem.cs b/Projectiles/Summon/DaedalusGolem.cs index 52095c4862..f9a7ff0ece 100644 --- a/Projectiles/Summon/DaedalusGolem.cs +++ b/Projectiles/Summon/DaedalusGolem.cs @@ -127,12 +127,14 @@ namespace CalamityMod.Projectiles.Summon light.scale = Main.rand.NextFloat(1.2f, 1.45f); light.noGravity = true; } - else if (AttackTimer >= ChargedLaserAttackTime / 2 && AttackTimer <= ChargedLaserAttackTime / 2 + 30 && AttackTimer % 10 == 9) + else if (AttackTimer >= ChargedLaserAttackTime / 2 && AttackTimer <= ChargedLaserAttackTime / 2 + 60 && AttackTimer % 10 == 9) { Main.PlaySound(SoundID.Item122, ArmPosition); if (Main.myPlayer == projectile.owner) { - Vector2 initialVelocity = projectile.DirectionTo(potentialTarget.Center) * 3f; + Vector2 initialVelocity = projectile.DirectionTo(potentialTarget.Center) * 2f; + if (Main.rand.NextBool(2)) + initialVelocity = initialVelocity.RotatedByRandom(0.4f); float initialAngle = initialVelocity.ToRotation(); Projectile.NewProjectile(ArmPosition, initialVelocity, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, initialAngle, Main.rand.Next(100)); } @@ -144,6 +146,11 @@ namespace CalamityMod.Projectiles.Summon Projectile.NewProjectile(ArmPosition, initialVelocity, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner); } } + else if (potentialTarget is null && AttackTimer != 0) + { + AttackTimer = 0; + projectile.netUpdate = true; + } } public void AdjustMinionDamage() diff --git a/Projectiles/Summon/DaedalusLightning.cs b/Projectiles/Summon/DaedalusLightning.cs index d050b0c605..76c6de9150 100644 --- a/Projectiles/Summon/DaedalusLightning.cs +++ b/Projectiles/Summon/DaedalusLightning.cs @@ -2,6 +2,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using System.IO; +using System.Linq; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -10,6 +11,8 @@ namespace CalamityMod.Projectiles.Summon { public class DaedalusLightning : ModProjectile { + internal PrimitiveTrail LightningDrawer; + public const int MaximumBranchingIterations = 3; public const float LightningTurnRandomnessFactor = 1f; public ref float InitialVelocityAngle => ref projectile.ai[0]; @@ -23,7 +26,7 @@ namespace CalamityMod.Projectiles.Summon { DisplayName.SetDefault("Daedalus Lightning"); ProjectileID.Sets.MinionShot[projectile.type] = true; - ProjectileID.Sets.TrailCacheLength[projectile.type] = 20; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 100; ProjectileID.Sets.TrailingMode[projectile.type] = 1; } @@ -68,6 +71,10 @@ namespace CalamityMod.Projectiles.Summon // which allows random turning to occur. projectile.frameCounter++; + projectile.scale = (float)Math.Sin(MathHelper.Pi * projectile.timeLeft / (45f * (projectile.MaxUpdates - 1))) * 4f; + if (projectile.scale > 1f) + projectile.scale = 1f; + Lighting.AddLight(projectile.Center, Color.Pink.ToVector3()); if (projectile.frameCounter >= projectile.extraUpdates * 2) { @@ -97,8 +104,7 @@ namespace CalamityMod.Projectiles.Summon // This mess of math basically encourages movement at the ends of an extraUpdate cycle, // discourages super frequenent randomness as the accumulated X speed changes get larger, // or if the original speed is quite large. - if (Math.Abs(potentialBaseDirection.X * (projectile.extraUpdates + 1) * 2f * originalSpeed + AccumulatedXMovementSpeeds) > - projectile.MaxUpdates * 2f * LightningTurnRandomnessFactor) + if (Math.Abs(potentialBaseDirection.X * (projectile.extraUpdates + 1) * 2f * originalSpeed + AccumulatedXMovementSpeeds) > projectile.MaxUpdates * LightningTurnRandomnessFactor) { canChangeLightningDirection = false; } @@ -120,53 +126,25 @@ namespace CalamityMod.Projectiles.Summon } } + #region Drawing + internal float WidthFunction(float completionRatio) + { + float baseWidth = MathHelper.Lerp(2f, 6f, (float)Math.Sin(MathHelper.Pi * 4f * completionRatio) * 0.5f + 0.5f) * projectile.scale; + return baseWidth * (float)Math.Sin(MathHelper.Pi * completionRatio); + } + internal Color ColorFunction(float completionRatio) + { + Color baseColor = Color.Lerp(Color.Pink, Color.HotPink, (float)Math.Sin(MathHelper.TwoPi * completionRatio + Main.GlobalTime * 4f) * 0.5f + 0.5f); + return Color.Lerp(baseColor, Color.Red, ((float)Math.Sin(MathHelper.Pi * completionRatio + Main.GlobalTime * 4f) * 0.5f + 0.5f) * 0.8f); + } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - Vector2 end = projectile.Center + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; - Texture2D lightningTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/RedLightningTexture"); - Vector2 scaleVector = new Vector2(projectile.scale) / 2f; - for (int i = 0; i < 3; i++) - { - // c_1 and f_1 are two somewhat ambiguous fields that are used by various methods - // in the DelegateMethods class. c_1 is used to represent the current color to be - // drawn while f_1 represents the opacity. - switch (i) - { - case 0: - scaleVector = new Vector2(projectile.scale) * 0.6f; - DelegateMethods.c_1 = Color.HotPink * 0.5f; - break; - case 1: - scaleVector = new Vector2(projectile.scale) * 0.4f; - DelegateMethods.c_1 = Color.Pink * 0.5f; - break; - case 2: - scaleVector = new Vector2(projectile.scale) * 0.2f; - DelegateMethods.c_1 = Color.White * 0.5f; - break; - } - DelegateMethods.f_1 = 1f; + if (LightningDrawer is null) + LightningDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, false); - // Ignore zero oldPos indices. - // There are almost guaranteed to be currently unfilled instead of being - // legitimate positions. - for (int j = projectile.oldPos.Length - 1; j > 0; j--) - { - if (!(projectile.oldPos[j] == Vector2.Zero)) - { - Vector2 start = projectile.oldPos[j] + projectile.Size * 0.5f + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; - Vector2 end2 = projectile.oldPos[j - 1] + projectile.Size * 0.5f + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; - Utils.DrawLaser(spriteBatch, lightningTexture, start, end2, scaleVector, DelegateMethods.LightningLaserDraw); - } - } - if (projectile.oldPos[0] != Vector2.Zero) - { - DelegateMethods.f_1 = 1f; - Vector2 start2 = projectile.oldPos[0] + projectile.Size * 0.5f + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; - Utils.DrawLaser(Main.spriteBatch, lightningTexture, start2, end, scaleVector, DelegateMethods.LightningLaserDraw); - } - } + LightningDrawer.Draw(projectile.oldPos.Where(oldPos => oldPos != Vector2.Zero), projectile.Size * 0.5f - Main.screenPosition, 300); return false; } + #endregion } } diff --git a/TrailGeneration/PrimitiveTrail.cs b/TrailGeneration/PrimitiveTrail.cs index 84679ca077..384e847ce4 100644 --- a/TrailGeneration/PrimitiveTrail.cs +++ b/TrailGeneration/PrimitiveTrail.cs @@ -35,15 +35,21 @@ namespace CalamityMod public VertexWidthFunction WidthFunction; public VertexColorFunction ColorFunction; + // NOTE: Beziers can be laggy when a lot of control points are used, since our implementation + // uses a recursive Lerp that gets more computationally expensive the more original indices. + // n(n - 1)/2 linear interpolations to be precise, where n is the amount of original indices. + public bool UsesSmoothening; public Effect EffectToUse; - public PrimitiveTrail(VertexWidthFunction widthFunction, VertexColorFunction colorFunction, Effect specialShader = null) + public PrimitiveTrail(VertexWidthFunction widthFunction, VertexColorFunction colorFunction, bool useSmoothening = true, Effect specialShader = null) { if (widthFunction is null || colorFunction is null) throw new NullReferenceException($"In order to create a primitive trail, a non-null {(widthFunction is null ? "width" : "color")} function must be specified."); WidthFunction = widthFunction; ColorFunction = colorFunction; + UsesSmoothening = useSmoothening; + EffectToUse = specialShader ?? new BasicEffect(Main.instance.GraphicsDevice); if (EffectToUse is BasicEffect) { @@ -83,22 +89,44 @@ namespace CalamityMod { if (EffectToUse is BasicEffect) UpdateBasicEffect((BasicEffect)EffectToUse); - List originalControlPoints = new List(); + + // Don't smoothen the points unless explicitly told do so. + if (!UsesSmoothening) + { + List basePoints = originalPositions.Where(originalPosition => originalPosition != Vector2.Zero).ToList(); + List endPoints = new List(); + + if (basePoints.Count < 3) + return endPoints; + + // Remap the original positions across a certain length. + for (int i = 0; i < totalTrailPoints; i++) + { + float completionRatio = i / (float)totalTrailPoints; + int currentColorIndex = (int)(completionRatio * (basePoints.Count - 1)); + Vector2 currentColor = basePoints[currentColorIndex]; + Vector2 nextColor = basePoints[(currentColorIndex + 1) % basePoints.Count]; + endPoints.Add(Vector2.Lerp(currentColor, nextColor, completionRatio * (basePoints.Count - 1) % 0.999f) + generalOffset); + } + return endPoints; + } + + List controlPoints = new List(); for (int i = 0; i < originalPositions.Count(); i++) { // Don't incorporate points that are zeroed out. // They are almost certainly a result of incomplete oldPos arrays. if (originalPositions.ElementAt(i) == Vector2.Zero) continue; - originalControlPoints.Add(originalPositions.ElementAt(i) + generalOffset); + controlPoints.Add(originalPositions.ElementAt(i) + generalOffset); } - BezierCurve bezierCurve = new BezierCurve(originalControlPoints.ToArray()); - return originalControlPoints.Count <= 1 ? originalControlPoints : bezierCurve.GetPoints(totalTrailPoints); + BezierCurve bezierCurve = new BezierCurve(controlPoints.ToArray()); + return controlPoints.Count <= 1 ? controlPoints : bezierCurve.GetPoints(totalTrailPoints); } - public List GetVerticesFromTrailPoints(List trailPoints) + public VertexPosition2DColor[] GetVerticesFromTrailPoints(List trailPoints) { - List vertices = new List(); + VertexPosition2DColor[] vertices = new VertexPosition2DColor[trailPoints.Count * 6]; for (int i = 0; i < trailPoints.Count - 1; i++) { float completionRatio = i / (float)trailPoints.Count; @@ -122,14 +150,14 @@ namespace CalamityMod // What this is doing, at its core, is defining a rectangle based on two triangles. // These triangles are defined based on the width of the strip at that point. - // These rectangles combined are what make the trail itself. - vertices.Add(new VertexPosition2DColor(firstUp, vertexColor)); - vertices.Add(new VertexPosition2DColor(secondUp, vertexColor)); - vertices.Add(new VertexPosition2DColor(firstDown, vertexColor)); + // The resulting rectangles combined are what make the trail itself. + vertices[i * 6] = new VertexPosition2DColor(firstUp, vertexColor); + vertices[i * 6 + 1] = new VertexPosition2DColor(secondUp, vertexColor); + vertices[i * 6 + 2] = new VertexPosition2DColor(firstDown, vertexColor); - vertices.Add(new VertexPosition2DColor(secondUp, vertexColor)); - vertices.Add(new VertexPosition2DColor(secondDown, vertexColor)); - vertices.Add(new VertexPosition2DColor(firstDown, vertexColor)); + vertices[i * 6 + 3] = new VertexPosition2DColor(secondUp, vertexColor); + vertices[i * 6 + 4] = new VertexPosition2DColor(secondDown, vertexColor); + vertices[i * 6 + 5] = new VertexPosition2DColor(firstDown, vertexColor); } return vertices; } @@ -144,7 +172,7 @@ namespace CalamityMod if (trailPoints.Count <= 1) return; - List vertices = GetVerticesFromTrailPoints(trailPoints); + VertexPosition2DColor[] vertices = GetVerticesFromTrailPoints(trailPoints); foreach (var pass in EffectToUse.CurrentTechnique.Passes) { @@ -153,7 +181,7 @@ namespace CalamityMod // The division by 3 here is because, vertices is a list of vertices. // That parameter, however, wants the amount of primitives (in this case triangles), it should draw. // Getting the amount of triangles in this case is simply a matter of dividing the total vertices by 3. - Main.instance.GraphicsDevice.DrawUserPrimitives(PrimitiveType.TriangleList, vertices.ToArray(), 0, vertices.Count / 3); + Main.instance.GraphicsDevice.DrawUserPrimitives(PrimitiveType.TriangleList, vertices, 0, vertices.Length / 3); } } } From b9ecd1d27a2191294802f3d78b57921b98b3e77c Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 16 Oct 2020 20:07:45 -0500 Subject: [PATCH 009/202] Increased Daedalus Lightning randomness --- Projectiles/Summon/DaedalusLightning.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projectiles/Summon/DaedalusLightning.cs b/Projectiles/Summon/DaedalusLightning.cs index 76c6de9150..e451cc00e3 100644 --- a/Projectiles/Summon/DaedalusLightning.cs +++ b/Projectiles/Summon/DaedalusLightning.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Summon internal PrimitiveTrail LightningDrawer; public const int MaximumBranchingIterations = 3; - public const float LightningTurnRandomnessFactor = 1f; + public const float LightningTurnRandomnessFactor = 1.7f; public ref float InitialVelocityAngle => ref projectile.ai[0]; // Technically not a ratio, and more of a seed, but it is used in a 0-2pi squash // later in the code to get an arbitrary unit vector (which is then checked). From fd8fb9bda868d9235704bdfe198b73b849bc5b6e Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 16 Oct 2020 20:23:11 -0500 Subject: [PATCH 010/202] Null tile check handler --- Projectiles/Summon/DaedalusGolem.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Projectiles/Summon/DaedalusGolem.cs b/Projectiles/Summon/DaedalusGolem.cs index f9a7ff0ece..ead4d07779 100644 --- a/Projectiles/Summon/DaedalusGolem.cs +++ b/Projectiles/Summon/DaedalusGolem.cs @@ -86,10 +86,15 @@ namespace CalamityMod.Projectiles.Summon destination = potentialTarget.Center + Vector2.UnitX * (130f + (projectile.identity * 28f) % 560f); // Go upwards, and check down again to discover any height differences before deciding where to move. - Vector2 upwardCheck = destination - Vector2.UnitY * 2400f; - upwardCheck.Y = Utils.Clamp(upwardCheck.Y, 0f, Main.maxTilesY * 16f - 100f); - WorldUtils.Find(upwardCheck.ToTileCoordinates(), Searches.Chain(new Searches.Down(200), new Conditions.IsSolid()), out Point loweredPoint); - destination = loweredPoint.ToWorldCoordinates(); + // There's a chance that this will encounter a null tile. If it us, just skip this step. + try + { + Vector2 upwardCheck = destination - Vector2.UnitY * 2400f; + upwardCheck.Y = Utils.Clamp(upwardCheck.Y, 0f, Main.maxTilesY * 16f - 100f); + WorldUtils.Find(upwardCheck.ToTileCoordinates(), Searches.Chain(new Searches.Down(200), new Conditions.IsSolid()), out Point loweredPoint); + destination = loweredPoint.ToWorldCoordinates(); + } + catch (NullReferenceException) { } StuckWalkThroughWallsTimer = Utils.Clamp(StuckWalkThroughWallsTimer, 0, 160); From c29c546562084e6404758f049fe466ef2928b19b Mon Sep 17 00:00:00 2001 From: Dominic Date: Mon, 19 Oct 2020 13:32:08 -0500 Subject: [PATCH 011/202] More flower summons (not finished yet) --- Buffs/Summon/FlowersOfMortalityBuff.cs | 35 ++++++ Buffs/Summon/FlowersOfMortalityBuff.png | Bin 0 -> 634 bytes Buffs/Summon/WitherBlossomsBuff.cs | 35 ++++++ Buffs/Summon/WitherBlossomsBuff.png | Bin 0 -> 567 bytes CalPlayer/CalamityPlayer.cs | 4 + Items/Weapons/Summon/FlowersOfMortality.cs | 64 +++++++++++ Items/Weapons/Summon/FlowersOfMortality.png | Bin 0 -> 1277 bytes Items/Weapons/Summon/WitherBlossomsStaff.cs | 63 +++++++++++ Items/Weapons/Summon/WitherBlossomsStaff.png | Bin 0 -> 1034 bytes Projectiles/Summon/FlowersOfMortalityCore.png | Bin 0 -> 439 bytes Projectiles/Summon/FlowersOfMortalityPetal.cs | 106 ++++++++++++++++++ .../Summon/FlowersOfMortalityPetal.png | Bin 0 -> 976 bytes Projectiles/Summon/MortalityBeam.cs | 72 ++++++++++++ Projectiles/Summon/MortalityBeam.png | Bin 0 -> 119 bytes Projectiles/Summon/MortalityBolt.cs | 66 +++++++++++ Projectiles/Summon/MortalityBolt.png | Bin 0 -> 119 bytes Projectiles/Summon/WitherBlossom.cs | 87 ++++++++++++++ Projectiles/Summon/WitherBlossom.png | Bin 0 -> 977 bytes Projectiles/Summon/WitherBolt.cs | 97 ++++++++++++++++ Projectiles/Summon/WitherBolt.png | Bin 0 -> 3066 bytes Utilities/CalamityUtils.cs | 6 +- 21 files changed, 630 insertions(+), 5 deletions(-) create mode 100644 Buffs/Summon/FlowersOfMortalityBuff.cs create mode 100644 Buffs/Summon/FlowersOfMortalityBuff.png create mode 100644 Buffs/Summon/WitherBlossomsBuff.cs create mode 100644 Buffs/Summon/WitherBlossomsBuff.png create mode 100644 Items/Weapons/Summon/FlowersOfMortality.cs create mode 100644 Items/Weapons/Summon/FlowersOfMortality.png create mode 100644 Items/Weapons/Summon/WitherBlossomsStaff.cs create mode 100644 Items/Weapons/Summon/WitherBlossomsStaff.png create mode 100644 Projectiles/Summon/FlowersOfMortalityCore.png create mode 100644 Projectiles/Summon/FlowersOfMortalityPetal.cs create mode 100644 Projectiles/Summon/FlowersOfMortalityPetal.png create mode 100644 Projectiles/Summon/MortalityBeam.cs create mode 100644 Projectiles/Summon/MortalityBeam.png create mode 100644 Projectiles/Summon/MortalityBolt.cs create mode 100644 Projectiles/Summon/MortalityBolt.png create mode 100644 Projectiles/Summon/WitherBlossom.cs create mode 100644 Projectiles/Summon/WitherBlossom.png create mode 100644 Projectiles/Summon/WitherBolt.cs create mode 100644 Projectiles/Summon/WitherBolt.png diff --git a/Buffs/Summon/FlowersOfMortalityBuff.cs b/Buffs/Summon/FlowersOfMortalityBuff.cs new file mode 100644 index 0000000000..a27ece7655 --- /dev/null +++ b/Buffs/Summon/FlowersOfMortalityBuff.cs @@ -0,0 +1,35 @@ +using CalamityMod.CalPlayer; +using CalamityMod.Projectiles.Summon; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.Summon +{ + public class FlowersOfMortalityBuff : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Flowers of Mortality"); + Description.SetDefault("Celestial blossoms surround you"); + Main.buffNoTimeDisplay[Type] = true; + Main.buffNoSave[Type] = true; + } + + public override void Update(Player player, ref int buffIndex) + { + CalamityPlayer modPlayer = player.Calamity(); + if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) + modPlayer.flowersOfMortality = true; + + if (!modPlayer.flowersOfMortality) + { + player.DelBuff(buffIndex); + buffIndex--; + } + else + { + player.buffTime[buffIndex] = 18000; + } + } + } +} diff --git a/Buffs/Summon/FlowersOfMortalityBuff.png b/Buffs/Summon/FlowersOfMortalityBuff.png new file mode 100644 index 0000000000000000000000000000000000000000..dbba97dc87fcc1ae1c0d0104a4ff5b0574f9f149 GIT binary patch literal 634 zcmV-=0)_pFP)Px%G)Y83R9J=0m%&R^K^(_FYYBm%5ZgrzNs6K@yc9%L=38nb&@^q`O+Q=$mLr9&43NjuDbcbWI*v3POkdztt9y_q-f z`<>r!elv+=V>1ASU*C7xMD$W?*IVDn_2)k-*weF;KSQjmc9CO z&Dn20^~veK_WCRUOE0GYpA@*8egwobk}`47xct}`%l~I#8-V)mT6^MC?*R`KIH(7$ z`RepDAi9QyTmZnGoi^u(p4SA$r$c-C0e=*zgqBgmERR{^wUNI-S&?MV0q3|v?jI11 z0l_~76zy7bF%x4cA^%XuFeGIfMSbn?MDdIF0N6VD1c2>{VQapsD-hWS1m$%!8w_J9 zAX^B>Lb$)skp2jGpg_ee2s2PSmpKi<#a3IPj>*H8ojtbc^b1v2AhsHYYr@cqQ6kLv z-DgwX#_Ki!7<@2ly`OwM;`FC)TmU>!AQA&&9%0;S8ZnkX%v_9xIKSYZ0;Rl9$z$ic znD?(A0if+tJ5XkL^wul@KVIB)PPjPu8-RwivHek?T+iKAO*KF@Ar4#Fr$AX5LH1nc zYtiG$PFUIpzV)4Rc2LyEAuj)gEB$82e3M()] > 0) + modPlayer.witherBlossom = true; + + if (!modPlayer.witherBlossom) + { + player.DelBuff(buffIndex); + buffIndex--; + } + else + { + player.buffTime[buffIndex] = 18000; + } + } + } +} diff --git a/Buffs/Summon/WitherBlossomsBuff.png b/Buffs/Summon/WitherBlossomsBuff.png new file mode 100644 index 0000000000000000000000000000000000000000..334f026255df9e82f16c95782dd2899f978a2da0 GIT binary patch literal 567 zcmV-70?7S|P)Px$@kvBMR9J=0mp?BAQ5400i$ubT70Y4^g&-OU+ewHxHU zL?a{`SrU;5qS#`^zYVe?QTS8LoY~CV8M~U@cbb`b@4lJ2=bn4teUU^w0l>ra!w*$N zG}aLTsH^5jgAf6J0H!9U0caZN`g6g@^*sQ`r{@5)wYK}_Q!^<5w$?WT*AI+L0&snH z09e34gKok+m&bxUPxcS`?H->4*QZw(0N7pH2%NWvfiTq1_5g6SvI`VF?`>%WAY1tS zbA6cSf_)4q=JMP`?&iv|Gt@uSmjocQlL3mcZ@l^T*=b&=IRjoDm|L6&$}=EH6Jw*p zf%B#|q#0rVa1XG6ff5ZU&vCEg%jt?_T68#w-7gk_Il4+Dz5db%NZ{IlQr$BVTSXIu=q z_R@wK>q;xAJq$?QVco2DOVxBU8?puGS^a|G^#dV2r#%dqDA&yj+6Cpg>WQcNGUp6? z87Swu_I>Sg^1RZMl~8jABGFg}0Pn9)RXrUi;t4xW$G^9lxI_-?OR4|>002ovPDHLk FV1gM|1|0wZ literal 0 HcmV?d00001 diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 390b023739..0f718a66d8 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -954,6 +954,8 @@ namespace CalamityMod.CalPlayer public bool viridVanguard = false; public bool deathstareEyeball = false; public bool daedalusGolem = false; + public bool witherBlossom = false; + public bool flowersOfMortality = false; #endregion #region Biome @@ -1982,6 +1984,8 @@ namespace CalamityMod.CalPlayer viridVanguard = false; deathstareEyeball = false; daedalusGolem = false; + witherBlossom = false; + flowersOfMortality = false; abyssalDivingSuitPrevious = abyssalDivingSuit; abyssalDivingSuit = abyssalDivingSuitHide = abyssalDivingSuitForce = abyssalDivingSuitPower = false; diff --git a/Items/Weapons/Summon/FlowersOfMortality.cs b/Items/Weapons/Summon/FlowersOfMortality.cs new file mode 100644 index 0000000000..8020b91c54 --- /dev/null +++ b/Items/Weapons/Summon/FlowersOfMortality.cs @@ -0,0 +1,64 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Summon; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Summon +{ + public class FlowersOfMortality : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Flowers of Mortality"); + Tooltip.SetDefault("Summons five rainbow flowers over your head\n" + + "The combined flowers consume three minion slots"); + } + + public override void SetDefaults() + { + item.damage = 405; + item.summon = true; + item.mana = 10; + item.width = 36; + item.height = 36; + item.useTime = item.useAnimation = 15; + item.useStyle = ItemUseStyleID.SwingThrow; + item.noMelee = true; + item.knockBack = 5f; + item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; + item.rare = ItemRarityID.Red; + item.UseSound = SoundID.Item44; + item.autoReuse = true; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 10f; + item.Calamity().customRarity = CalamityRarity.Turquoise; + } + + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] < 3; //If you already have all 3, no need to resummon + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + CalamityUtils.KillShootProjectiles(false, type, player); + for (int i = 0; i < 5; i++) + { + Projectile blossom = Projectile.NewProjectileDirect(player.Center, Vector2.Zero, type, damage, knockBack, player.whoAmI, 0f, 0f); + blossom.ai[0] = MathHelper.TwoPi * i / 5f; + blossom.rotation = blossom.ai[0]; + } + return false; + } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ItemID.LunarBar, 15); + recipe.AddIngredient(ModContent.ItemType(), 15); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddTile(TileID.LunarCraftingStation); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Weapons/Summon/FlowersOfMortality.png b/Items/Weapons/Summon/FlowersOfMortality.png new file mode 100644 index 0000000000000000000000000000000000000000..6a81cbc728adf7114090e03a5089d1e10e49b6ad GIT binary patch literal 1277 zcmV$y00001b5ch_0Itp) z=>Px(w@E}nRA_Q^Kk$IHAMjYIQlyPXXBM7Kwol>H;QqW~D?1pxF7 z{bd5I-nRvS&kLUc;G^4D07&fq2Y|1yuG7Y`n|`O~bpU)ND-7@qXO3vJCS`xfr($VQ zPB`U^>1KH^FtyH#(ZdDLYR5M>ss5@+Q0w1OS){cSje7wX8h#XYSTpGls;tR~Y6mvI zuOA)LW87{w|K%|N`hQsnz-yb7$-46@wy97tEk*;YU(m+$49^zP>gNH7ojGj+lq`=J z0Ex!ECcvsa_3FS5m6bPs;{%{7VrAi|`sn=XUjUwpF4VuELeJJhqVqSc?HQgesy1xY zJ`e0{Fag2~ssXsR{|^8TJ+~cz=F8t{=l>lWN;$5??$htC)yA2GR*76^c-HH1ahY1} z+=^c{0gkmb1Mo%tE&yU@P6P1a(31dc`}q<8R~kmN@y3EbXzd+2H`RtMb|>m>u)qMg zKimhv$=1(Q{|x@7tR&+xEM^M|!@vWxd1WO4{Mx9;m}GBGD6{=7Dhr2eRhI5OnFJ;o z73^8LgYoMCBrl&*JFF?Ute1tMrE1-L?!>PDy&lhS z29XM&t%t>=%(SM<-cr8@JO2bAckMa@prh$v$|ok%;TfJOu~-W*^_iC4WLJ+`<#buu zTaYYn&*oC6Wj*aLE>iW@zW@L;Ka|$>d4^|-m|a#D0pLcwTibucW>m891eRI317bTH z)VNlbpNQ%BbrT@R$`!HWEooh!>kMaXE-hvwYt%cP?u+dvz}p{x3BUo%loMi35c7FU zmlyzpckVi6Wo0<#8BWQJV>n&2%gWSKN_$LW)oFVy`-1^7D_t468(nAkq5o_4CmVgY zdsCW?tf@2rx-Yf^&UM;}bYnAJJj2uBWOmY<1;E+tT;mybB3-iug<-?mulnbSS-~@G zN6h+z0RYB_6Ip3i@C*x1W+$yyfb20VxX-ZDjK{Y~y23a&Hk z$Ke;|$x-!dna9Pf;7Y^5)Hefy)Y)t|E4a?E5slVpF>H_7y!^%L$wU7=AbZUUt~2b% nnr%tlmFK;}<6>5Do#FogjXS?kutT-P00000NkvXXu0mjfUVUNI literal 0 HcmV?d00001 diff --git a/Items/Weapons/Summon/WitherBlossomsStaff.cs b/Items/Weapons/Summon/WitherBlossomsStaff.cs new file mode 100644 index 0000000000..2e541f0170 --- /dev/null +++ b/Items/Weapons/Summon/WitherBlossomsStaff.cs @@ -0,0 +1,63 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Summon; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Summon +{ + public class WitherBlossomsStaff : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Wither Blossoms Staff"); + Tooltip.SetDefault("Summons four decaying flowers over your head\n" + + "The combined flowers consume two minion slots"); + } + + public override void SetDefaults() + { + item.damage = 61; + item.mana = 10; + item.width = 52; + item.height = 60; + item.useTime = item.useAnimation = 20; + item.useStyle = ItemUseStyleID.SwingThrow; + item.noMelee = true; + item.knockBack = 3f; + item.value = CalamityGlobalItem.Rarity8BuyPrice; + item.rare = ItemRarityID.Yellow; + item.UseSound = SoundID.Item46; + item.autoReuse = true; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 10f; + item.summon = true; + } + + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] < 3; //If you already have all 3, no need to resummon + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + CalamityUtils.KillShootProjectiles(false, type, player); + for (int i = 0; i < 4; i++) + { + Projectile blossom = Projectile.NewProjectileDirect(player.Center, Vector2.Zero, type, damage, knockBack, player.whoAmI, 0f, 0f); + blossom.ai[0] = MathHelper.TwoPi * i / 4f; + blossom.rotation = blossom.ai[0]; + } + return false; + } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 15); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Weapons/Summon/WitherBlossomsStaff.png b/Items/Weapons/Summon/WitherBlossomsStaff.png new file mode 100644 index 0000000000000000000000000000000000000000..c74966ede5f10ac2e9260197e6fd3dec7cc8ed29 GIT binary patch literal 1034 zcmV+l1oiugP)PxRU!RA_W05kg7a`X3|&u3Fh9 z5b7@|XeC6ps6b38kfKcr5r~S0UzPS@`7x8GPK!IQ<2l{ys5LWoXMP*+nRD(vm-G00 z-}jtr5GNh0s+G&&R^y6&`wW1|v31M-;ei)h&a-dlul9e*74H`iUB8tMK)r820FTGM z1JKdtwv|MhkdD@6|)D*q!f1

J!=A>wP7d-aQVVP z0}_B>%srUlDNx$p9Me;oxd#*v>LkUBqOO5_rG2k)S!o}wd=4ZD{(EgAsN}c&BLxP) z%*4kaK+TOy%6$!0Gr*tZbP36XAsDkLs(Vj#zWE{my`4P@Q9JJmNnLhilLVt6%i2;% z4!#+;yh#Y@1UuUNp{w@*9Bm&0;PlzT#K?nDCm6|lLhMRQqtY+GFPE1BVRBNFrXM>5 zKt(m7aVD#Z5i^g9ryWl)>Uq#E?+HPX5Yu-Px+nF1|L`ZJolEo09g2Dl3QB* zXgP0^;BFpF literal 0 HcmV?d00001 diff --git a/Projectiles/Summon/FlowersOfMortalityCore.png b/Projectiles/Summon/FlowersOfMortalityCore.png new file mode 100644 index 0000000000000000000000000000000000000000..8e10fb5b09545d20a5f51680092ea6607ae48bee GIT binary patch literal 439 zcmV;o0Z9IdP)Px$aY;l$R5*>jl(9+!K@f(&iz1>3LIiDs2u7kI5)o`fMARp+P#+*&D!YJI3IPid zNoQw@s9+(sT1ZSINDfmNj35%k2p5T1Sjkyz2HkLn)%rJg^WV(!F*iFFO~vE$01S=B z0C>DBx%^UOV#)$27q2xxJgNK_=NW*j(*pnk7?R~jnpjV3iThhAy!>1?13+kS*aE0N zJ(wkK?+x~Ok_w^dFF%*fxB#7Qz%onRs5>q|e0oMB3auOgP(57sEWAv-0WjOlmwLO9 zcg+&}efT`t(?~=TpY2wZ(OvVbH%A=oAF$x3H?4CjT3i~_;`cfAOf+NpH*%iQo2N~M zUC3(*tvwd`<%$3QQ<00R9k5zRdJ=`tHvp(CYWB{ z(Uh7ZJFTWd&NIJ{N7}{#xc|D_MT*54|ya>7MXW4opxl#4kn&wMS h8+8W&+rBVM{0)*HhH7LvS!n Main.player[projectile.owner]; + public ref float OffsetAngle => ref projectile.ai[0]; + public ref float Time => ref projectile.ai[1]; + public float Hue => OffsetAngle % MathHelper.TwoPi / MathHelper.TwoPi % 1f; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Elemental Petal"); + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 8; + ProjectileID.Sets.MinionSacrificable[projectile.type] = true; + ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 30; + projectile.netImportant = true; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.minionSlots = 0.5f; + projectile.timeLeft = 90000; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.minion = true; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 4; + } + + public override void AI() + { + bool isCorrectMinion = projectile.type == ModContent.ProjectileType(); + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); + player.AddBuff(ModContent.BuffType(), 3600); + if (isCorrectMinion) + { + if (player.dead) + modPlayer.flowersOfMortality = false; + if (modPlayer.flowersOfMortality) + projectile.timeLeft = 2; + } + + SetProjectileDamage(); + + Time++; + NPC potentialTarget = projectile.Center.MinionHoming(1050f, Owner, false); + if (Time % 25 == 24 && Main.myPlayer == projectile.owner && potentialTarget != null) + { + Vector2 shootVelocity = projectile.DirectionTo(potentialTarget.Center) * 16f; + Projectile.NewProjectile(projectile.Center, shootVelocity, ModContent.ProjectileType(), projectile.damage / 3, projectile.knockBack, projectile.owner); + } + projectile.Center = player.Center + OffsetAngle.ToRotationVector2() * (150f + (float)Math.Sin(Time * 0.08f) * 15f); + projectile.rotation += MathHelper.ToRadians(7f); + OffsetAngle += MathHelper.ToRadians(6f); + } + + public void SetProjectileDamage() + { + if (projectile.localAI[0] == 0f) + { + projectile.Calamity().spawnedPlayerMinionDamageValue = Owner.MinionDamage(); + projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; + for (int i = 0; i < 36; i++) + { + Dust dust = Dust.NewDustPerfect(projectile.Center, 261); + dust.noGravity = true; + dust.color = Main.hslToRgb(Main.rand.NextFloat(), 1f, 0.5f); + dust.velocity = Main.rand.NextVector2Unit() * Main.rand.NextFloat(2f, 7f); + } + projectile.localAI[0] += 1f; + } + if (Owner.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) + { + int trueDamage = (int)(projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / + projectile.Calamity().spawnedPlayerMinionDamageValue * + Owner.MinionDamage()); + projectile.damage = trueDamage; + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D petalTexture = Main.projectileTexture[projectile.type]; + Texture2D coreTexture = ModContent.GetTexture("CalamityMod/Projectiles/Summon/FlowersOfMortalityCore"); + Color drawColor = Main.hslToRgb(Hue, 0.95f, 0.5f) * 2.3f; + + Vector2 drawPosition = projectile.Center - Main.screenPosition; + spriteBatch.Draw(petalTexture, drawPosition, null, projectile.GetAlpha(drawColor), projectile.rotation, petalTexture.Size() * 0.5f, projectile.scale, SpriteEffects.None, 0f); + spriteBatch.Draw(coreTexture, drawPosition, null, projectile.GetAlpha(lightColor), 0f, coreTexture.Size() * 0.5f, projectile.scale, SpriteEffects.None, 0f); + + return false; + } + } +} diff --git a/Projectiles/Summon/FlowersOfMortalityPetal.png b/Projectiles/Summon/FlowersOfMortalityPetal.png new file mode 100644 index 0000000000000000000000000000000000000000..a32bdc4d1ecdcf837ad74ad07664521f14d59349 GIT binary patch literal 976 zcmV;>126oEP)Px&ib+I4RA_2lgccVw5|{ZE;m?y92xuIj3uL==p(voipu(X7ZG#n;|!yy3ecH5B~$8iME@Aq@%)oL{WmX?-) zEVcw2W5F;|`rus(nI~>SqdYd3g!I>gs9)xt;?YCY^E3zrVi+G6tka?-gU#K8tV} zQFf9iQh>F!H6Zig_V%_Tx7ln0aD9F4jNjbcqySr6Th6%jNssJNHnRwq z5uFpYT20x($sX2I%2Jj=>v{XE`8La0`GV|`eHOtm;;prgj*bABOeVScyw~di?>%bg zS*Gl`5XUj_K2~O8BLX-)Jj}H>Tt>RxE&$bP707CxhlhvUlUttDxXm&a_Pt$iCW811%P>rRNSNJLuzKTFlt#)^J zm%Co}PN&ld0%9cUcDo;Tc3<`QJS^Ht3iJA%U>GS?tJT~pSJ1PvM^Q0i@!1$r-=ll7 zU>Ny-j{I%-a;^2<@bx9(*IIT!{mAn2G61F0ueLr(lHAy_kf(gi&3kXrY&IPmUteE= zf1w|-I5;=}U^E(iDptPQzsy_TYPBMONKVpg8?>ck(7 zMvi?K7Z=X@a2e6JJ;g?=)dKwYSb`l_|8jnQ?mVkj^D(M%=@T=uN8eK{!evC~hV9^d z*<{8;PW5cRYv|eDYiWHP$4++i=~qW<5iTPuD=WDZEdz=rowRyy`-*v;rz!}^)fXvM z5_Y}MzHk|tK?K>J6a%_@RUTJf-`w1EVr3pQe=r#2$`eDDFx7NjrO|jCw>>fF!B?trMI80000(), 180); + target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(ModContent.BuffType(), 180); + } + + public override void Kill(int timeLeft) + { + if (Main.myPlayer == projectile.owner) + { + float redHue = Main.rgbToHsl(Color.Red).X; + float greenHue = Main.rgbToHsl(Color.SeaGreen).X; + float blueHue = Main.rgbToHsl(Color.Blue).X; + Vector2 spawnPosition = projectile.Center + Main.rand.NextVector2CircularEdge(10f, 10f); + Projectile bolt = Projectile.NewProjectileDirect(spawnPosition, Main.rand.NextVector2CircularEdge(9f, 9f), ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner); + bolt.localAI[0] = Utils.SelectRandom(Main.rand, redHue, greenHue, blueHue); + } + } + } +} diff --git a/Projectiles/Summon/MortalityBeam.png b/Projectiles/Summon/MortalityBeam.png new file mode 100644 index 0000000000000000000000000000000000000000..3c8f498e7b5d6be4a208d079e9c36406652b97e5 GIT binary patch literal 119 zcmeAS@N?(olHy`uVBq!ia0vp^Od!m`1|*BN@u~nR#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvI6;>1s;*b3=DjSL74G){)!Z!AdjbuV~9j}vI8>@4+Db`1LI=#$Gd>y44$rj JF6*2UngBoO894v| literal 0 HcmV?d00001 diff --git a/Projectiles/Summon/MortalityBolt.cs b/Projectiles/Summon/MortalityBolt.cs new file mode 100644 index 0000000000..d0083cbc4e --- /dev/null +++ b/Projectiles/Summon/MortalityBolt.cs @@ -0,0 +1,66 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Summon +{ + public class MortalityBolt : ModProjectile + { + public Color ProjectileColor => Main.hslToRgb(projectile.localAI[0], 1f, 0.5f); + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bolt"); + ProjectileID.Sets.MinionShot[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 20; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.minionSlots = 0f; + projectile.minion = true; + projectile.penetrate = 1; + projectile.timeLeft = 180; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, Color.White.ToVector3()); + if (!Main.dedServ) + { + for (int i = 0; i < 4; i++) + { + Dust rainbowDust = Dust.NewDustPerfect(projectile.Center + Main.rand.NextVector2Circular(5f, 5f), 261); + rainbowDust.color = ProjectileColor; + rainbowDust.velocity += projectile.velocity; + rainbowDust.noGravity = true; + } + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(ModContent.BuffType(), 180); + } + + public override void Kill(int timeLeft) + { + if (!Main.dedServ) + { + for (int i = 0; i < 15; i++) + { + Dust rainbowDust = Dust.NewDustDirect(projectile.Center + Main.rand.NextVector2Circular(5f, 5f), 40, 40, 261); + rainbowDust.color = ProjectileColor; + rainbowDust.noGravity = true; + } + } + } + } +} diff --git a/Projectiles/Summon/MortalityBolt.png b/Projectiles/Summon/MortalityBolt.png new file mode 100644 index 0000000000000000000000000000000000000000..3c8f498e7b5d6be4a208d079e9c36406652b97e5 GIT binary patch literal 119 zcmeAS@N?(olHy`uVBq!ia0vp^Od!m`1|*BN@u~nR#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvI6;>1s;*b3=DjSL74G){)!Z!AdjbuV~9j}vI8>@4+Db`1LI=#$Gd>y44$rj JF6*2UngBoO894v| literal 0 HcmV?d00001 diff --git a/Projectiles/Summon/WitherBlossom.cs b/Projectiles/Summon/WitherBlossom.cs new file mode 100644 index 0000000000..003223e8b8 --- /dev/null +++ b/Projectiles/Summon/WitherBlossom.cs @@ -0,0 +1,87 @@ +using CalamityMod.Buffs.Summon; +using CalamityMod.CalPlayer; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Summon +{ + public class WitherBlossom : ModProjectile + { + public Player Owner => Main.player[projectile.owner]; + public ref float OffsetAngle => ref projectile.ai[0]; + public ref float Time => ref projectile.ai[1]; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Wither Blossom"); + ProjectileID.Sets.MinionSacrificable[projectile.type] = true; + ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 30; + projectile.netImportant = true; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.minionSlots = 0.5f; + projectile.timeLeft = 90000; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.minion = true; + } + + public override void AI() + { + bool isCorrectMinion = projectile.type == ModContent.ProjectileType(); + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); + player.AddBuff(ModContent.BuffType(), 3600); + if (isCorrectMinion) + { + if (player.dead) + modPlayer.witherBlossom = false; + if (modPlayer.witherBlossom) + projectile.timeLeft = 2; + } + + SetProjectileDamage(); + + Time++; + NPC potentialTarget = projectile.Center.MinionHoming(950f, Owner); + if (Time % 50 == 49 && Main.myPlayer == projectile.owner && potentialTarget != null) + { + Vector2 shootVelocity = projectile.DirectionTo(potentialTarget.Center).RotatedByRandom(0.25f) * 8f; + Projectile.NewProjectile(projectile.Center, shootVelocity, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner); + } + projectile.Center = player.Center + OffsetAngle.ToRotationVector2() * 150f; + projectile.rotation += MathHelper.ToRadians(5f); + OffsetAngle += MathHelper.ToRadians(4f); + } + + public void SetProjectileDamage() + { + if (projectile.localAI[0] == 0f) + { + projectile.Calamity().spawnedPlayerMinionDamageValue = Owner.MinionDamage(); + projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; + for (int i = 0; i < 36; i++) + { + Dust dust = Dust.NewDustPerfect(projectile.Center, 179); + dust.noGravity = true; + dust.velocity = Main.rand.NextVector2Unit() * Main.rand.NextFloat(2f, 7f); + } + projectile.localAI[0] += 1f; + } + if (Owner.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) + { + int trueDamage = (int)(projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / + projectile.Calamity().spawnedPlayerMinionDamageValue * + Owner.MinionDamage()); + projectile.damage = trueDamage; + } + } + + public override bool CanDamage() => false; + } +} diff --git a/Projectiles/Summon/WitherBlossom.png b/Projectiles/Summon/WitherBlossom.png new file mode 100644 index 0000000000000000000000000000000000000000..a0ba831dd45a42afe1a700bcc15055af1865b346 GIT binary patch literal 977 zcmV;?11|iDP)Px&i%CR5RA_^E*|X7voY}>_!IdDCWJFLIB+3I z)Nmjg0wPk{P$c!xzTKU#ot`f^&o4ZiivTWu zUIB1Z|Mn>NfAT23{s$@!+aN(=pnL@0ynY41?*2g=VsfE&qbj$=BHtGwGMLyYS7#%D zX8js~r_~t%e${W<5EGMj_YZ>40Hc%4EwL;y=8&mYDiJ`v(Ewm|{UrdW$46~|sp;tm z{G=)y%bkNRvAM8_aPCtq6eGy=&jI?$jx{l$-__>l7M$-bxscv|cn84F)^

;&~wMGHfw9$qczebQr4a2o^r?WA(nOCINUn{;*l1?Vact{ zPCMss*E?hVW$UZczxq`S4{%M#9dk>pZw~O)QIgFh|>}+j2pXZn6 zJO8Y+OXqxki7hT~05K_>ZQIPi%116MF-ywc*Ala`1f~2Eo2jl0BxUtbw;NU=l0GT> z&p$D%5W$fCR*YqpNNI&Rx5SE=48K$^1O2N_Sqc8DShQ;%b{8kN#Ju%bp-=$e{{B97 zeNQ=LD66;UEm>cz+3S=m+BFX;_w`thm`F`cl>oTAYYklS)rcvF^kw5AV)ndkXI)WM zg?$c8KkL?e2|}4PKE$NZ2>B}M69&6m=svxEx}sID{rA@W0&5<=dC4b{5E=C!s?>dZ)cGf-U#|JglCsiBYJJbT zXx}_^mi{1WZ*#y=tBm{;^C_`5o=LHrx-pot=I$u5o8nwIEVoZP>JygEE zfW(_S&b{sY>C>=p!A*z_tI#eE0atsda!c$FSL?#qM?OfK00000NkvXXu0mjfjN#T< literal 0 HcmV?d00001 diff --git a/Projectiles/Summon/WitherBolt.cs b/Projectiles/Summon/WitherBolt.cs new file mode 100644 index 0000000000..34abcec8de --- /dev/null +++ b/Projectiles/Summon/WitherBolt.cs @@ -0,0 +1,97 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; +using CalamityMod.Projectiles.Melee; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Summon +{ + public class WitherBolt : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Wither Bolt"); + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 25; + ProjectileID.Sets.MinionShot[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.scale = 0.8f; + projectile.width = projectile.height = (int)(72 * projectile.scale); + projectile.friendly = true; + projectile.minion = true; + projectile.minionSlots = 0f; + projectile.timeLeft = 180; + projectile.tileCollide = false; + projectile.ignoreWater = true; + projectile.penetrate = 2; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + } + public override void AI() + { + Lighting.AddLight(projectile.Center, Color.DarkGreen.ToVector3() * 1.25f); + float oldSpeed = projectile.velocity.Length(); + + NPC potentialTarget = projectile.Center.MinionHoming(800f, Main.player[projectile.owner]); + if (potentialTarget != null) + projectile.velocity = (projectile.velocity * 3f + projectile.DirectionTo(potentialTarget.Center) * oldSpeed) / 4f; + projectile.velocity = projectile.velocity.SafeNormalize(Vector2.UnitY) * oldSpeed * 1.01f; + + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 180); + projectile.Opacity = MathHelper.Lerp(projectile.Opacity, 0f, 0.25f); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D boltTexture = Main.projectileTexture[projectile.type]; + for (int i = 0; i < projectile.oldPos.Length; i++) + { + float completionRatio = i / (float)projectile.oldPos.Length; + Color drawColor = Color.Lerp(lightColor, Color.Olive, 0.6f); + drawColor = Color.Lerp(drawColor, Color.Black, completionRatio); + drawColor = Color.Lerp(drawColor, Color.Transparent, completionRatio); + + Vector2 drawPosition = projectile.oldPos[i] + projectile.Size * 0.5f - Main.screenPosition; + spriteBatch.Draw(boltTexture, drawPosition, null, projectile.GetAlpha(drawColor), projectile.oldRot[i], boltTexture.Size() * 0.5f, projectile.scale, SpriteEffects.None, 0f); + } + return false; + } + + public override void Kill(int timeLeft) + { + if (!Main.dedServ) + { + for (int i = 0; i < projectile.oldPos.Length / 2; i++) + { + for (int j = 0; j < 2; j++) + { + Dust plague = Dust.NewDustDirect(projectile.oldPos[i], projectile.width / 2, projectile.height / 2, 107); + plague.velocity = (projectile.oldRot[i] - MathHelper.PiOver2).ToRotationVector2() * 4.5f + Main.rand.NextVector2Circular(2f, 2f); + plague.color = Color.Olive; + plague.noGravity = true; + } + } + } + + if (Main.myPlayer == projectile.owner) + { + for (int i = 0; i < 2; i++) + { + Vector2 spawnPosition = projectile.Center + Main.rand.NextVector2CircularEdge(8f, 8f); + int seeker = Projectile.NewProjectile(spawnPosition, Main.rand.NextVector2Circular(12f, 12f), ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner); + Main.projectile[seeker].Calamity().forceMinion = true; + } + } + } + } +} diff --git a/Projectiles/Summon/WitherBolt.png b/Projectiles/Summon/WitherBolt.png new file mode 100644 index 0000000000000000000000000000000000000000..0968156e79f880c08816086f5cac6b8bd7c93d37 GIT binary patch literal 3066 zcmVPx#1ZP1_K>z@;j|==^1poj6BT!6KMF0Q*0s;a90|NvE1O){J1_lNQ2nY!Y2@4Ag z3=9m##l;N`4Gsz?O-)TuP*7AN$ts000VgNkl*~!l*IaYW zHH{nTuMEFeLHq9eBmJduSpr?eK9?faLHdj2%6)9sa1q7tmGdCTaPwP`;abl9R$Zz< zRfMy!L%=I7(9T>#ac%@Z0(^Fj!ki4Zn7L`^BG!2bwCctT1&QYDtqP5r5MzQ}wy!seR#$pxP^AFg@x=FNZbPoF;h zBi@Iu!r*EfGTsu(^9rj4a?wj!B@X-)svLkg z@S$|DIInKU;o;%!TeoiA4j=B;?M%6GAM@~DYoTo9=J4H?-JXzXdJm2X83O&2XR0g_ zXe*I78x|8qOOP4|K9Gdrz}4srL5?DB0ueKoLe*IF$whAJaBlYW-pN*t`>i7rNjfCKY#uwzKN1wvF`ysz#EML-(tl09hqS)*6KawHRPzq9^sov zVVtSe)Me^w#^<=9&o;_pfd+{i+3(Lwdy?rTjy(s&V;nwh@&+;Hc_~tR4~5}*5I5uO z+8hzQe=OIb>7&~*p1JtKfPyK;NzqaX@PV~i?$;&7;--5TuZ=ty3PN62~l zn6b|55ejhvi3IF}<^H0^nQ}E#0xe3I1+*f7zN}dVBTh9AXXC&j(jPM27Aa1 z3*+@wBs`)NFQ|()wLqk)HLezGZ-GEt4nP!D7NkJ>m|2`aHzND=e#vya%VZ}fCu%ds zI$M{jeZA{u5{I>$8zo2t_QwOU67FVHxWxi_uk<8y5i+1q4MsZ)Z`VH#qZhS(Ir!wa z7=kj6AxyQ%;oRB_r;QUrEK{le3z$ zzj*QDZ;u~8{)OK@(YLvG@1FMj^y!n@@jm+H$&)94dH3$!-=kaaMg24$kX`=uteAf? z9{!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PKQD3M ztOCJSjwzuaLXFiv Date: Thu, 29 Oct 2020 23:52:53 -0500 Subject: [PATCH 012/202] Upgraded Apotheosis. --- Items/Weapons/Magic/Apotheosis.cs | 9 +- Projectiles/Magic/ApothChloro.cs | 122 --------- Projectiles/Magic/ApothChloro.png | Bin 170 -> 0 bytes Projectiles/Magic/ApothJaws.cs | 82 ------ Projectiles/Magic/ApothJaws.png | Bin 1537 -> 0 bytes Projectiles/Magic/ApothMark.cs | 73 ----- Projectiles/Magic/ApothMark.png | Bin 2156 -> 0 bytes Projectiles/Magic/ApotheosisEnergy.cs | 100 +++++++ Projectiles/Magic/ApotheosisEnergy.png | Bin 0 -> 138 bytes Projectiles/Magic/ApotheosisJaw.png | Bin 0 -> 1723 bytes Projectiles/Magic/ApotheosisWorm.cs | 363 +++++++++++++++++++++++++ Projectiles/Magic/ApotheosisWorm.png | Bin 0 -> 2921 bytes 12 files changed, 467 insertions(+), 282 deletions(-) delete mode 100644 Projectiles/Magic/ApothChloro.cs delete mode 100644 Projectiles/Magic/ApothChloro.png delete mode 100644 Projectiles/Magic/ApothJaws.cs delete mode 100644 Projectiles/Magic/ApothJaws.png delete mode 100644 Projectiles/Magic/ApothMark.cs delete mode 100644 Projectiles/Magic/ApothMark.png create mode 100644 Projectiles/Magic/ApotheosisEnergy.cs create mode 100644 Projectiles/Magic/ApotheosisEnergy.png create mode 100644 Projectiles/Magic/ApotheosisJaw.png create mode 100644 Projectiles/Magic/ApotheosisWorm.cs create mode 100644 Projectiles/Magic/ApotheosisWorm.png diff --git a/Items/Weapons/Magic/Apotheosis.cs b/Items/Weapons/Magic/Apotheosis.cs index 33b831c591..126cf2f474 100644 --- a/Items/Weapons/Magic/Apotheosis.cs +++ b/Items/Weapons/Magic/Apotheosis.cs @@ -22,13 +22,12 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 420; + item.damage = 2420; item.magic = true; item.mana = (int)42.0; item.width = 30; item.height = 34; - item.useTime = 15; - item.useAnimation = 15; + item.useTime = item.useAnimation = 177; item.useStyle = ItemUseStyleID.HoldingOut; item.useTurn = false; item.noMelee = true; @@ -37,8 +36,8 @@ namespace CalamityMod.Items.Weapons.Magic item.rare = 10; item.UseSound = SoundID.Item92; item.autoReuse = true; - item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 15.69f; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 42.0f; item.Calamity().customRarity = CalamityRarity.Developer; } diff --git a/Projectiles/Magic/ApothChloro.cs b/Projectiles/Magic/ApothChloro.cs deleted file mode 100644 index 7a7a88882a..0000000000 --- a/Projectiles/Magic/ApothChloro.cs +++ /dev/null @@ -1,122 +0,0 @@ -using CalamityMod.Buffs.DamageOverTime; -using Microsoft.Xna.Framework; -using System; -using Terraria; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Magic -{ - public class ApothChloro : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Rays of Annihilation"); - } - - public override void SetDefaults() - { - projectile.width = 10; - projectile.height = 10; - projectile.alpha = 70; - projectile.timeLeft = 120; - projectile.penetrate = 1; - projectile.hostile = false; - projectile.friendly = true; - projectile.magic = true; - projectile.light = 0.5f; - projectile.extraUpdates = 1; - } - - public override void AI() - { - Lighting.AddLight(projectile.Center, 0.4f, 0.2f, 0.4f); - for (int i = 0; i < 5; i++) - { - Dust dust4 = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, 242, projectile.velocity.X, projectile.velocity.Y, 100, default, 1f)]; - dust4.velocity = Vector2.Zero; - dust4.position -= projectile.velocity / 5f * (float)i; - dust4.noGravity = true; - dust4.scale = 0.8f; - dust4.noLight = true; - } - float num1 = (float)(projectile.position.X - projectile.velocity.X / 10.0 * 9.0); - float num2 = (float)(projectile.position.Y - projectile.velocity.Y / 10.0 * 9.0); - float num3 = (float)Math.Sqrt((double)(projectile.velocity.X * projectile.velocity.X + projectile.velocity.Y * projectile.velocity.Y)); - float num4 = projectile.localAI[0]; - if (num4 == 0f) - { - projectile.localAI[0] = num3; - num4 = num3; - } - if (projectile.alpha > 0) - projectile.alpha = projectile.alpha - 25; - if (projectile.alpha < 0) - projectile.alpha = 0; - float num5 = (float)projectile.position.X; - float num6 = (float)projectile.position.Y; - float num7 = 300f; - bool flag2 = false; - int num8 = 0; - float num9; - if (projectile.ai[1] == 0f) - { - for (int index = 0; index < Main.maxNPCs; ++index) - { - if (Main.npc[index].CanBeChasedBy((object)this, false) && ((double)projectile.ai[1] == 0.0 || (double)projectile.ai[1] == (double)(index + 1))) - { - num1 = (float)Main.npc[index].position.X + (float)(Main.npc[index].width / 2); - num2 = (float)Main.npc[index].position.Y + (float)(Main.npc[index].height / 2); - num9 = Math.Abs((float)projectile.position.X + (float)(projectile.width / 2) - num1) + Math.Abs((float)projectile.position.Y + (float)(projectile.height / 2) - num2); - if ((double)num9 < (double)num7 && Collision.CanHit(new Vector2((float)projectile.position.X + (float)(projectile.width / 2), (float)projectile.position.Y + (float)(projectile.height / 2)), 1, 1, Main.npc[index].position, Main.npc[index].width, Main.npc[index].height)) - { - num7 = num9; - num5 = num1; - num6 = num2; - flag2 = true; - num8 = index; - } - } - } - if (flag2) - projectile.ai[1] = (float)(num8 + 1); - flag2 = false; - } - if (projectile.ai[1] > 0f) - { - int index = (int)((double)projectile.ai[1] - 1.0); - if (Main.npc[index].active && Main.npc[index].CanBeChasedBy((object)this, true) && !Main.npc[index].dontTakeDamage) - { - if ((double)Math.Abs((float)projectile.position.X + (float)(projectile.width / 2) - ((float)Main.npc[index].position.X + (float)(Main.npc[index].width / 2))) + (double)Math.Abs((float)projectile.position.Y + (float)(projectile.height / 2) - ((float)Main.npc[index].position.Y + (float)(Main.npc[index].height / 2))) < 3000.0) - { - flag2 = true; - num5 = (float)Main.npc[index].position.X + (float)(Main.npc[index].width / 2); - num6 = (float)Main.npc[index].position.Y + (float)(Main.npc[index].height / 2); - } - } - else - projectile.ai[1] = 0.0f; - } - if (!projectile.friendly) - flag2 = false; - if (flag2) - { - double num15 = (double)num4; - Vector2 vector2 = new Vector2((float)(projectile.position.X + (double)projectile.width * 0.5), (float)(projectile.position.Y + (double)projectile.height * 0.5)); - num2 = num5 - (float)vector2.X; - num9 = num6 - (float)vector2.Y; - double num10 = Math.Sqrt((double)num2 * (double)num2 + (double)num9 * (double)num9); - float num11 = (float)(num15 / num10); - float num12 = num2 * num11; - float num13 = num9 * num11; - int num14 = 8; - projectile.velocity.X = (float)((projectile.velocity.X * (double)(num14 - 1) + (double)num12) / (double)num14); - projectile.velocity.Y = (float)((projectile.velocity.Y * (double)(num14 - 1) + (double)num13) / (double)num14); - } - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(ModContent.BuffType(), 600, true); - target.AddBuff(ModContent.BuffType(), 600, true); - } - } -} diff --git a/Projectiles/Magic/ApothChloro.png b/Projectiles/Magic/ApothChloro.png deleted file mode 100644 index a17ddc8d5d421d5bbafb3594de42f53d254ee69e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 170 zcmeAS@N?(olHy`uVBq!ia0vp^AT}2V8<6ZZI=>f4v7|ftIx;Y9?C1WI$O`0h7I;J! zGcfQS1YyP<6SLm}1tm*dBT9nv(@M${i&7a15;OBk^zu?m6ioCC^b9SpT-%faRHW|d z;uxY4+^hx9jo^eRz*;SnnC$*kgTe~DWM4f5VtaL diff --git a/Projectiles/Magic/ApothJaws.cs b/Projectiles/Magic/ApothJaws.cs deleted file mode 100644 index 626ff7a2b2..0000000000 --- a/Projectiles/Magic/ApothJaws.cs +++ /dev/null @@ -1,82 +0,0 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; -using System; -using Terraria; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Magic -{ - public class ApothJaws : ModProjectile - { - private const float degrees = (float)(Math.PI / 180) * 2; - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Jaws of Annihilation"); - } - - public override void SetDefaults() - { - projectile.width = 144; - projectile.height = 72; - projectile.alpha = 70; - projectile.timeLeft = 240; - projectile.penetrate = -1; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 1; - projectile.friendly = true; - projectile.magic = true; - projectile.tileCollide = false; - projectile.ignoreWater = true; - projectile.light = 1.5f; - } - - public override void AI() - { - if (projectile.timeLeft % 8 == 0) - { - double angle = (double)Main.rand.Next(360) * Math.PI / 180; - float offsetX = projectile.position.X + (float)Main.rand.Next((int)projectile.width); - float offsetY = projectile.position.Y + (float)Main.rand.Next((int)projectile.height); - if (projectile.owner == Main.myPlayer) - { - Projectile.NewProjectile(offsetX, offsetY, 14 * (float)Math.Cos(angle), 14 * (float)Math.Sin(angle), ModContent.ProjectileType(), projectile.damage, projectile.knockBack / 2, projectile.owner); - } - } - if (projectile.timeLeft < 30) - projectile.alpha = projectile.alpha + 6; - else if (projectile.timeLeft < 210) - { - projectile.velocity.X *= 0.9f; - projectile.velocity.Y *= 0.9f; - } - else if (projectile.timeLeft < 240) - { - if (projectile.ai[1] == 0) - projectile.rotation += 1.3f * degrees; - else - projectile.rotation -= 1.3f * degrees; - } - else if (projectile.timeLeft == 240) - { - if (projectile.ai[1] == 0) - projectile.rotation = projectile.ai[0] - 30 * degrees; - else - { - projectile.rotation = projectile.ai[0] + 30 * degrees + (float)Math.PI; - projectile.spriteDirection = -1; - } - } - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(ModContent.BuffType(), 600, true); - target.AddBuff(ModContent.BuffType(), 600, true); - target.AddBuff(ModContent.BuffType(), 600, true); - if (Main.rand.NextBool(30)) - { - target.AddBuff(ModContent.BuffType(), 120, true); - } - } - } -} diff --git a/Projectiles/Magic/ApothJaws.png b/Projectiles/Magic/ApothJaws.png deleted file mode 100644 index 84d2046947dfb7701f0a778b54117176151a1358..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1537 zcmX|BdpOez7@kX5C5uuvm$9YDMvF)8s*y#kvF4CT2kR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bP=Dw8^MSfP!dR>FQnI`j|GaR|DIV2tE zpfB9|dd6x$<6>P@qVRjtl*I)s$sMDV)rGtJ6z2{$d?o^I)P%5*N26V3;}PZ6H4}rh8l1atXng@`3;E=2a3cG9*ua=yKLgNqSQ(PQLhs_J zzQe^MSS5MG^}ka@hA~FD72w@aY4^4X&;#6*b7^@#zasB^*)@N+ j?uyD%6}Hn4jOK(JgOBoK(u!KvqaB2Ea>rI3I(6kg6E@K; diff --git a/Projectiles/Magic/ApothMark.cs b/Projectiles/Magic/ApothMark.cs deleted file mode 100644 index 31dc4a1dfb..0000000000 --- a/Projectiles/Magic/ApothMark.cs +++ /dev/null @@ -1,73 +0,0 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; -using System; -using Terraria; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Magic -{ - public class ApothMark : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Jaws of Annihilation"); - } - - public override void SetDefaults() - { - projectile.width = 123; - projectile.height = 105; - projectile.alpha = 70; - projectile.timeLeft = 240; - projectile.penetrate = -1; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 1; - projectile.friendly = true; - projectile.magic = true; - projectile.tileCollide = false; - projectile.ignoreWater = true; - projectile.light = 1.5f; - } - - public override void AI() - { - if (projectile.timeLeft < 30) - projectile.alpha = projectile.alpha + 6; - else if (projectile.timeLeft < 210) - { - projectile.velocity.X *= 0.9f; - projectile.velocity.Y *= 0.9f; - } - else if (projectile.timeLeft == 240) - { - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X); - double offsetHyp = Math.Sqrt(48 * 48 + 38 * 38); - double offsetRotation = Math.Atan2(-38, 48) + (double)projectile.rotation; - double offsetX = offsetHyp * Math.Cos(offsetRotation); - double offsetY = offsetHyp * Math.Sin(offsetRotation); - if (projectile.owner == Main.myPlayer) - { - Projectile.NewProjectile(projectile.Center.X + (float)offsetX, projectile.Center.Y + (float)offsetY, projectile.velocity.X, projectile.velocity.Y, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, projectile.rotation, 0f); - } - offsetRotation = Math.Atan2(38, 48) + (double)projectile.rotation; - offsetX = offsetHyp * Math.Cos(offsetRotation); - offsetY = offsetHyp * Math.Sin(offsetRotation); - - if (projectile.owner == Main.myPlayer) - { - Projectile.NewProjectile(projectile.position.X + projectile.width / 2 + (float)offsetX, projectile.position.Y + projectile.height / 2 + (float)offsetY, projectile.velocity.X, projectile.velocity.Y, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, projectile.rotation, 1f); - } - } - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(ModContent.BuffType(), 600, true); - target.AddBuff(ModContent.BuffType(), 600, true); - target.AddBuff(ModContent.BuffType(), 600, true); - if (Main.rand.NextBool(30)) - { - target.AddBuff(ModContent.BuffType(), 120, true); - } - } - } -} diff --git a/Projectiles/Magic/ApothMark.png b/Projectiles/Magic/ApothMark.png deleted file mode 100644 index 41f8b01b7ac4d4d0bde703da2cdf5b3bacc7c158..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2156 zcmX|@c{mhm8^)bJvag96YqmILh$0D1V_yejIij)?S%)zk`Xb9Pt zj5M@p&GJa#SQ+|c57}KFV8P2Oc_`)N`(r*`JPTUp$uH3JMo2f|Rr|k2A1`;sy02|@ zFO_%g;6?n0wi<@IW;bTb;K}Ay_yS{#_!N%Ssk!gt*%-fqlCZzT9-fY`hH;2Z6#W32Ss!T8?c zXal$WI25LUN4LtMIZSxWuBm@)5vUxJvsCM_J%wZS#SBe0M5@?rdy`DclZ_(2e;|4U zHeul$>Obf-`=M#^uaXW78WaJyITQ_ZpqXV~rFc!=ade)Qmamf>*a<+mbf+)Yo&(`Zhm-CDA z&W)u)<<&WIn2q@}fzSGh&rHdGeN|aXs<%hqBSMW6P2FzcJA%FkodNTB8XrQ>e`bZv zR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t@4PpYi1trQ9V>7@?N}0n z#F0%E)qEusu@2LEva4l;BmVx`#$Vb3oSzEPHh{A@3iI?%JclVj7AuWou3(aW3*jl) zkXc&VjLTQ);<0MlGnKI-wwt#l6e~Q|k)Tl}<9qEE;6wIZpW7p5z1+1qbO9dQSh=NjH6F6CYJ^VS0IvYg7jUwd7T?8&E*^%-!dIyc84b(d0{TkPPr%weng*1gH@1P zX3;9vYeha+XM#>U!bocobbj%p3c+Ns=WY%S)Zx*%W_CE$J`2H6q>?oWr+2VL@Yz{8 KTQ*+5o&F!@LOfjn diff --git a/Projectiles/Magic/ApotheosisEnergy.cs b/Projectiles/Magic/ApotheosisEnergy.cs new file mode 100644 index 0000000000..30c346c073 --- /dev/null +++ b/Projectiles/Magic/ApotheosisEnergy.cs @@ -0,0 +1,100 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using System.Linq; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Magic +{ + public class ApotheosisEnergy : ModProjectile + { + internal PrimitiveTrail TrailDrawer = null; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Apotheosis Energy"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 20; + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 20; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.magic = true; + projectile.penetrate = -1; + projectile.timeLeft = 210; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 1; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, Color.Cyan.ToVector3() * projectile.Opacity); + + // Fade-effects. + if (projectile.timeLeft < 40f) + projectile.Opacity = Utils.InverseLerp(0f, 40f, projectile.timeLeft, true); + else + projectile.alpha = Utils.Clamp(projectile.alpha - 30, 0, 255); + + NPC potentialTarget = projectile.Center.ClosestNPCAt(5900f); + if (potentialTarget != null) + { + float squaredTargetDistance = projectile.DistanceSQ(potentialTarget.Center); + if (squaredTargetDistance > 120f * 120f && squaredTargetDistance < 1000f * 1000f) + projectile.velocity = projectile.velocity.ToRotation().AngleTowards(projectile.AngleTo(potentialTarget.Center), 0.1f).ToRotationVector2() * projectile.velocity.Length(); + } + } + + internal Color ColorFunction(float completionRatio) + { + Color baseColor = Color.Cyan; + if (completionRatio > 0.66f) + baseColor = Color.Lerp(baseColor, Color.Fuchsia, (completionRatio - 0.66f) / 0.33f); + else + { + float whiteFade = (float)Math.Sin(Utils.InverseLerp(0.1f, 0.56f, completionRatio, true) * MathHelper.Pi + Main.GlobalTime * 10f) * 0.85f; + baseColor = Color.Lerp(baseColor, Color.White, whiteFade); + } + + Color colorToUse = baseColor; + if (completionRatio > 0.5f) + colorToUse = Color.Lerp(baseColor, Color.Transparent, 1f - completionRatio / 0.5f); + return colorToUse * projectile.Opacity; + } + + internal float WidthFunction(float completionRatio) + { + float width; + float maxWidthOutwardness = 6f; + if (completionRatio < 0.2f) + width = (float)Math.Sin(completionRatio / 0.2f * MathHelper.PiOver2) * maxWidthOutwardness + 0.1f; + else + width = MathHelper.Lerp(maxWidthOutwardness, 0f, Utils.InverseLerp(0.2f, 1f, completionRatio, true)); + return width * projectile.Opacity; + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + for (int i = 0; i < projectile.oldPos.Length; i++) + { + if (Collision.CheckAABBvAABBCollision(projectile.oldPos[i], projHitbox.Size(), targetHitbox.TopLeft(), projHitbox.Size())) + return true; + } + return false; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + if (TrailDrawer is null) + TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction); + + TrailDrawer.Draw(projectile.oldPos, projectile.Size * 0.5f - Main.screenPosition, 85); + return false; + } + } +} diff --git a/Projectiles/Magic/ApotheosisEnergy.png b/Projectiles/Magic/ApotheosisEnergy.png new file mode 100644 index 0000000000000000000000000000000000000000..ead80128fa90d3321c087f258cc1d6b9c550723f GIT binary patch literal 138 zcmeAS@N?(olHy`uVBq!ia0vp^AT}2V8<6ZZI=>f4u_bxCyDx`7I;J! zGcfQS24TkI`72U@g6t)pzOL*K*f|(FVdQ&MBb@01<2^RR910 literal 0 HcmV?d00001 diff --git a/Projectiles/Magic/ApotheosisJaw.png b/Projectiles/Magic/ApotheosisJaw.png new file mode 100644 index 0000000000000000000000000000000000000000..ccf7b18279fed8badd0e95951c74ca27071f6ee0 GIT binary patch literal 1723 zcmV;s21NOZP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D22e>vK~#8N?VMYP zRb>>%&osV8NZ?qVywSy)6h*Bpr-bamhb9LmAqd1|=yXAAn#Y6~kbDX=t)?a>M+SmO zq|zSjqF^a0+R)%MT`bJ(L>crDy=fC`?e&i{i?e3mzC9OOKUl1@$D`xy{oCtX-}mh~ z4Wpx@rRmI~>zCF20fv7WY>=0UxI*&(o@r+U3~0Q1E+4PFuZ=S}zW)`@ZbU|=jS(>6 z=0*4Oanmi$oIzF-fEyu9c_U!Ls`kx%eCL82IfI=$p5>g?1mH#pQ`QKW(Ao78A8U5+ z*}-|}%m=wl0B(dZ<&20k;pDj=IOiQDG;V}2WsFE_!igjAa}HG-fEytMHv(4{#NES5 zO#q>518^gRU`F7|uHN`0A0OS@!`ZrW+Jt#)=W{-P=qJwFgraH#a3h4=Mrad&Wdz=j zxx@O$*Kh{=-Z(6;#!^&m0B(ek`$W)65yhO9*Kl0;`VS5Zyq`>{wSj5_#l>$&IB1qh zLA8N`Oeo3*!i^9z*9cu3$Oht_t$mzzb+<+d(9`uQ=g=!pNpT~D+$RFH0bKs`XATW& z1DQ~318M_6Z9uJ(|^Yi6IFDX$`MwXqs~ zLwO~CuL;17 z5OSZ0qB=n`q1J|moxL1n0&F12guFHoZiGKim}gb-{!;@l_EQ!;w4Va+k9ho}Y5LHu)76KBn6XN9w6!{U~W ziGGkX$M)9!`)-7g`9#Ex7DYn_P;6-F<9NE>xDi5TBlPNZC?n!{W>xfkwF$kw=jByIQWJn1 zA*40}Ym^Va(80$*8=?0xK%5b}_JFsaicA=KC|a9nd~gP5n9y-u^c>gH)6u_^)CAy0 z2#JlbMvDt4e&c-UuSU)QW+bfej~AB-+A0{sH8Oo;0=-3TGG5g+#ta>l)jD`uh1 zK&`;uC#c=ysE1{QHTOWD@mV$Ma|Vue)a@_a2qCi(-R;{r<9P=Bx%C+^AgLL^svXN0 zj5Tned%3)d&~pzMF<3gvS>r|snfnNIdir^Wq-I$C1+eBK+Jt+{vpAzR=(z_vPMCmN z0#IYz2qCo*AnvI*%u?g#78>1;;C)MHMqh^kxaa#i6(?;3I!sO6Tt)A=X{=eY#*Gky_Ys(NZrRku$3UB5)d(3=6EO_H3_=YXWd1gy2T#QAF=s0INozCg9lGFVRM9Z5!Jcq{WR8f*S$i zYDHX)&?acJ-rQY(e Main.player[projectile.owner]; + internal ref float Time => ref projectile.ai[0]; + internal ref float FlyAcceleration => ref projectile.ai[1]; + internal ref float JawRotation => ref projectile.localAI[1]; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("The Devourer of Gods"); + } + + public override void SetDefaults() + { + projectile.width = 108; + projectile.height = 108; + projectile.alpha = 255; + projectile.timeLeft = 300; + projectile.penetrate = -1; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 5; + projectile.friendly = true; + projectile.magic = true; + projectile.tileCollide = false; + projectile.ignoreWater = true; + projectile.netImportant = true; + projectile.light = 1.5f; + } + + // Be VERY careful with the projectile's netcode, and use syncs very sparingly. + // Syncing will use a lot more bytes than usual. + + public override void SendExtraAI(BinaryWriter writer) + { + for (int i = 0; i < Segments.Length; i++) + { + Segments[i].WriteTo(writer); + } + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + for (int i = 0; i < Segments.Length; i++) + { + Segments[i].ReadFrom(reader); + } + } + + public override void AI() + { + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; + + // Initialization. + if (projectile.localAI[0] == 0f) + { + PortalPosition = projectile.Center + projectile.velocity * 7f; + if (Main.myPlayer == projectile.owner) + InitializeSegments(); + projectile.localAI[0] = 1f; + } + + // Head fade-in effects. + if (projectile.timeLeft <= 75) + projectile.alpha = Utils.Clamp(projectile.alpha + 40, 0, 255); + else if (Time > 15f) + projectile.alpha = Utils.Clamp(projectile.alpha - 40, 0, 255); + + // Update all segments of the devourer every frame. + for (int i = 0; i < Segments.Length; i++) + UpdateSegment(i); + + Time++; + + // Reset the jaw's rotation slowly over time. + JawRotation = MathHelper.Lerp(JawRotation, 0f, 0.08f); + + NPC potentialTarget = projectile.Center.ClosestNPCAt(7200f); + if (potentialTarget != null) + AttackTarget(potentialTarget); + } + + internal void InitializeSegments() + { + Vector2 directionToMouse = (Main.MouseWorld - projectile.Center).SafeNormalize(Vector2.UnitX * Owner.direction); + projectile.rotation = directionToMouse.ToRotation() + MathHelper.PiOver2; + for (int i = 0; i < Segments.Length; i++) + { + Segments[i] = new Segment(255, projectile.rotation, projectile.Center + directionToMouse / Segments.Length * i * 900f); + } + projectile.netUpdate = true; + } + + internal void UpdateSegment(int segmentIndex) + { + float aheadSegmentRotation = segmentIndex > 0 ? Segments[segmentIndex - 1].Rotation : projectile.rotation; + Vector2 aheadSegmentCenter = segmentIndex > 0 ? Segments[segmentIndex - 1].Center : projectile.Center; + Vector2 offsetToAheadSegment = aheadSegmentCenter - Segments[segmentIndex].Center; + + // Individual segment fade effects depending on time. + if (projectile.timeLeft <= 60) + { + int invisibleSegmentIndex = (int)MathHelper.Lerp(0f, Segments.Length, 1f - MathHelper.Clamp(projectile.timeLeft / 60f * 1.4f, 0f, 1f)); + if (segmentIndex < invisibleSegmentIndex) + { + Segments[segmentIndex].Alpha += 31; + if (Segments[segmentIndex].Alpha > 255) + Segments[segmentIndex].Alpha = 255; + } + } + + if (Time <= 90f) + { + int visibleSegmentIndex = (int)MathHelper.Lerp(0f, Segments.Length, Utils.InverseLerp(15f, 70f, Time, true)); + if (segmentIndex < visibleSegmentIndex) + { + Segments[segmentIndex].Alpha -= 17; + if (Segments[segmentIndex].Alpha < 0) + Segments[segmentIndex].Alpha = 0; + } + } + + // This variant of segment attachment incorporates rotation. + // Given the fact that all segments will execute this code is succession, the + // result across the entire worm will exponentially decay over each segment, + // allowing for smooth rotations. This code is what the stardust dragon and mechworm use for their segmenting. + if (aheadSegmentRotation != Segments[segmentIndex].Rotation) + { + float offsetAngle = MathHelper.WrapAngle(aheadSegmentRotation - Segments[segmentIndex].Rotation); + offsetToAheadSegment = offsetToAheadSegment.RotatedBy(offsetAngle * 0.075f); + } + Segments[segmentIndex].Rotation = offsetToAheadSegment.ToRotation() + MathHelper.PiOver2; + if (offsetToAheadSegment != Vector2.Zero) + Segments[segmentIndex].Center = aheadSegmentCenter - offsetToAheadSegment.SafeNormalize(Vector2.Zero) * 70f; + } + + internal void AttackTarget(NPC target) + { + if (Time >= 40f && projectile.alpha == 0 && Main.rand.NextBool(8)) + { + if (Main.myPlayer == projectile.owner) + { + Segment segmentToShootFrom = Segments[Main.rand.Next(Segments.Length)]; + Vector2 shootVelocity = (target.Center - segmentToShootFrom.Center).SafeNormalize(Vector2.UnitY).RotatedByRandom(0.25f) * 18f; + Projectile.NewProjectile(segmentToShootFrom.Center, shootVelocity, ModContent.ProjectileType(), projectile.damage, 0f, projectile.owner); + } + + if (Main.rand.NextBool(10)) + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LargeMechGaussRifle"), projectile.Center); + } + + float idealFlyAcceleration = 0.18f; + + Vector2 destination = target.Center; + float distanceFromDestination = projectile.Distance(destination); + + // Get a swerve effect if somewhat far from the target. + if (projectile.Distance(destination) > 725f) + { + destination += (Time % 30f / 30f * MathHelper.TwoPi).ToRotationVector2() * 145f; + distanceFromDestination = projectile.Distance(destination); + idealFlyAcceleration *= 2.5f; + } + + // Charge if the target is far away. + if (distanceFromDestination > 1500f && Time > 45f) + idealFlyAcceleration = MathHelper.Min(6f, FlyAcceleration + 1f); + + FlyAcceleration = MathHelper.Lerp(FlyAcceleration, idealFlyAcceleration, 0.3f); + + float directionToTargetOrthogonality = Vector2.Dot(projectile.velocity.SafeNormalize(Vector2.Zero), projectile.DirectionTo(destination)); + + // Fly towards the target if it's far. + if (distanceFromDestination > 320f) + { + float speed = projectile.velocity.Length(); + if (speed < 23f) + speed += 0.08f; + + if (speed > 32f) + speed -= 0.08f; + + // Go faster if the line of sight is aiming closely at the target. + if (directionToTargetOrthogonality < 0.85f && directionToTargetOrthogonality > 0.5f) + speed += 6f; + + // And go slower otherwise so that the devourer can angle towards the target more accurately. + if (directionToTargetOrthogonality < 0.5f && directionToTargetOrthogonality > -0.7f) + speed -= 10f; + + speed = MathHelper.Clamp(speed, 16f, 34f); + + projectile.velocity = projectile.velocity.ToRotation().AngleTowards(projectile.AngleTo(destination), FlyAcceleration).ToRotationVector2() * speed; + } + + // Open jaws when near the target, and snap when really close. + if (distanceFromDestination < 200f) + JawRotation = MathHelper.Lerp(JawRotation, MathHelper.ToRadians(-34f), 0.4f); + else if (distanceFromDestination < 480f) + JawRotation = MathHelper.Lerp(JawRotation, MathHelper.ToRadians(15f), 0.24f); + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 600, true); + target.AddBuff(ModContent.BuffType(), 600, true); + target.AddBuff(ModContent.BuffType(), 600, true); + if (Main.rand.NextBool(30)) + { + target.AddBuff(ModContent.BuffType(), 120, true); + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + SpriteEffects spriteEffects = SpriteEffects.None; + if (projectile.spriteDirection == 1) + spriteEffects = SpriteEffects.FlipHorizontally; + + Texture2D headTexture = Main.projectileTexture[projectile.type]; + Vector2 drawPosition = projectile.Center - Main.screenPosition; + Vector2 headTextureOrigin = Main.projectileTexture[projectile.type].Size() * 0.5f; + drawPosition -= headTexture.Size() * projectile.scale * 0.5f; + drawPosition += headTextureOrigin * projectile.scale + new Vector2(0f, 4f + projectile.gfxOffY); + + Texture2D jawTexture = ModContent.GetTexture("CalamityMod/Projectiles/Magic/ApotheosisJaw"); + Vector2 jawOrigin = jawTexture.Size() * 0.5f; + + // Segment drawing. + Texture2D bodyTexture = ModContent.GetTexture("CalamityMod/NPCs/DevourerofGods/DevourerofGodsBodyS"); + Texture2D tailTexture = ModContent.GetTexture("CalamityMod/NPCs/DevourerofGods/DevourerofGodsTailS"); + + // Not white to differentiate itself slightly from regular DoG when fighting Boss Rush. + Color baseColor = Color.Lerp(Color.White, Color.Fuchsia, 0.15f); + + for (int i = 0; i < Segments.Length; i++) + { + bool isTail = i == Segments.Length - 1; + Texture2D segmentTexture = isTail ? tailTexture : bodyTexture; + Vector2 segmentOrigin = segmentTexture.Size() * 0.5f; + spriteBatch.Draw(segmentTexture, Segments[i].Center - Main.screenPosition, null, baseColor * ((255 - Segments[i].Alpha) / 255f), Segments[i].Rotation, segmentOrigin, projectile.scale, SpriteEffects.None, 0f); + } + + // Jaw drawing. + for (int i = -1; i <= 1; i += 2) + { + float jawBaseOffset = 42f; + SpriteEffects jawSpriteEffect = SpriteEffects.None; + if (i == 1) + jawSpriteEffect |= SpriteEffects.FlipHorizontally; + + // X/Y offsets for the jaws depending on the angle of the jaw. + // Has potential to act weird at unexpected angles, but that should never happen naturally. + Vector2 jawPosition = drawPosition; + jawPosition += Vector2.UnitX.RotatedBy(projectile.rotation + JawRotation * i) * i * (jawBaseOffset + (float)Math.Sin(JawRotation) * 24f); + jawPosition -= Vector2.UnitY.RotatedBy(projectile.rotation) * (38f + (float)Math.Sin(JawRotation) * 30f); + + spriteBatch.Draw(jawTexture, jawPosition, null, baseColor * projectile.Opacity, projectile.rotation + JawRotation * i, jawOrigin, projectile.scale, jawSpriteEffect, 0f); + } + + // Portal drawing at the start of the devourer's lifetime. + // This is extremely similar to the + if (Time < 60f) + { + float currentFade = Utils.InverseLerp(0f, 8f, Time, true) * Utils.InverseLerp(60f, 52f, Time, true); + currentFade *= (1f + 0.2f * (float)Math.Cos(Main.GlobalTime % 30f * MathHelper.Pi * 3f)) * 0.8f; + + Texture2D texture = ModContent.GetTexture("CalamityMod/Projectiles/Boss/DoGTeleportRift"); + Vector2 drawPos = PortalPosition - Main.screenPosition; + baseColor = new Color(150, 100, 255, 255) * projectile.Opacity; + baseColor *= 0.5f; + baseColor.A = 0; + Color colorA = baseColor; + Color colorB = baseColor * 0.5f; + colorA *= currentFade; + colorB *= currentFade; + Vector2 origin = texture.Size() / 2f; + Vector2 scale = new Vector2(8f, 19f) * projectile.Opacity * currentFade; + + spriteBatch.Draw(texture, drawPos, null, colorA, MathHelper.PiOver2, origin, scale, SpriteEffects.None, 0); + spriteBatch.Draw(texture, drawPos, null, colorA, 0f, origin, scale, SpriteEffects.None, 0); + spriteBatch.Draw(texture, drawPos, null, colorB, MathHelper.PiOver2, origin, scale * 0.8f, SpriteEffects.None, 0); + spriteBatch.Draw(texture, drawPos, null, colorB, 0f, origin, scale * 0.8f, SpriteEffects.None, 0); + + spriteBatch.Draw(texture, drawPos, null, colorA, MathHelper.PiOver2 + Main.GlobalTime * 3f * 0.25f, origin, scale, SpriteEffects.None, 0); + spriteBatch.Draw(texture, drawPos, null, colorA, Main.GlobalTime * 3f * 0.25f, origin, scale, SpriteEffects.None, 0); + spriteBatch.Draw(texture, drawPos, null, colorB, MathHelper.PiOver2 + Main.GlobalTime * 3f * 0.5f, origin, scale * 0.8f, SpriteEffects.None, 0); + spriteBatch.Draw(texture, drawPos, null, colorB, Main.GlobalTime * 3f * 0.5f, origin, scale * 0.8f, SpriteEffects.None, 0); + + spriteBatch.Draw(texture, drawPos, null, colorA, MathHelper.PiOver4, origin, scale * 0.6f, SpriteEffects.None, 0); + spriteBatch.Draw(texture, drawPos, null, colorA, MathHelper.PiOver4 * 3f, origin, scale * 0.6f, SpriteEffects.None, 0); + spriteBatch.Draw(texture, drawPos, null, colorB, MathHelper.PiOver4, origin, scale * 0.4f, SpriteEffects.None, 0); + spriteBatch.Draw(texture, drawPos, null, colorB, MathHelper.PiOver4 * 3f, origin, scale * 0.4f, SpriteEffects.None, 0); + + spriteBatch.Draw(texture, drawPos, null, colorA, MathHelper.PiOver4 + Main.GlobalTime * 3f * 0.75f, origin, scale * 0.6f, SpriteEffects.None, 0); + spriteBatch.Draw(texture, drawPos, null, colorA, MathHelper.PiOver4 * 3f + Main.GlobalTime * 3f * 0.75f, origin, scale * 0.6f, SpriteEffects.None, 0); + spriteBatch.Draw(texture, drawPos, null, colorB, MathHelper.PiOver4 + Main.GlobalTime * 3f, origin, scale * 0.4f, SpriteEffects.None, 0); + spriteBatch.Draw(texture, drawPos, null, colorB, MathHelper.PiOver4 * 3f + Main.GlobalTime * 3f, origin, scale * 0.4f, SpriteEffects.None, 0); + + } + + // Head drawing. + spriteBatch.Draw(headTexture, drawPosition, null, baseColor * projectile.Opacity, projectile.rotation, headTextureOrigin, projectile.scale, spriteEffects, 0f); + return false; + } + + // Manual collision detection that incorporates segments. + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + if (Collision.CheckAABBvAABBCollision(projectile.position, projHitbox.Size(), targetHitbox.TopLeft(), projHitbox.Size())) + return true; + + for (int i = 0; i < Segments.Length; i++) + { + if (Collision.CheckAABBvAABBCollision(Segments[i].Center - projHitbox.Size() * 0.5f, projHitbox.Size(), targetHitbox.TopLeft(), projHitbox.Size())) + return true; + } + return false; + } + } +} diff --git a/Projectiles/Magic/ApotheosisWorm.png b/Projectiles/Magic/ApotheosisWorm.png new file mode 100644 index 0000000000000000000000000000000000000000..31edfc75c74aac12218120c787ee65b35b11c72c GIT binary patch literal 2921 zcmeHJ`#;l*8y}m^E#{U_Ow2vEZ4RZrs4B<8tdvd^k;6o6qcEJ6sO+d?8XY4v zk*-*CSvBm0=;+Iuk`|JC+FAd@_owgoykD>9dB2|b^Ll=Hp4a>JdJ2LF-dj`+R6!un z7N7mN5IN_|gQpCZ=fqvNd2&)n3Gwy-HNHg5$P37EYycJnYA#j#7OMmTfk8q3VP10G z#sF04s|b@~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`?Q;{Py*x7RG=7 zK5S5z>1e%;D(>lU=h;6w>1Fj~IX!vwuu;c@>R9}+QjyvPJ zGatnbPfl4-4273ZLxS7gRf?q?&Q?+==TtE zKPp3fLF!~<29o}`ak&A97C zxrf7{HM(GS(Z^w5?fmUYeMFt#Ks5vdSnMyOI|uq#ztotg^)13PJ=4zO~WonD0X}0bnu~(3E4Vs2L|qD+(X&V2Pj~L3|>l21D literal 0 HcmV?d00001 From dc6d0495ec8ff28c86ee3ade0c67af382c0bfc9a Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Thu, 5 Nov 2020 19:55:18 -0600 Subject: [PATCH 013/202] Various beam weapons --- Items/Weapons/Magic/ElementalRay.cs | 46 ++++- Items/Weapons/Magic/TerraRay.cs | 10 +- .../BaseLaserbeamProjectile.cs | 140 +++++++------- Projectiles/Magic/BeamStar.cs | 96 +++++++++ Projectiles/Magic/BeamStar.png | Bin 0 -> 3136 bytes Projectiles/Magic/BloodBolt.cs | 37 ---- Projectiles/Magic/BloodOrb.cs | 27 --- Projectiles/Magic/BloodOrb.png | Bin 148 -> 0 bytes Projectiles/Magic/BloodRay.cs | 43 +++-- Projectiles/Magic/NebulaElementalBeam.cs | 65 +++++++ ...{BloodBolt.png => NebulaElementalBeam.png} | Bin Projectiles/Magic/NightBolt.cs | 2 +- Projectiles/Magic/NightsRayBeam.cs | 41 ++-- Projectiles/Magic/SolarElementalBeam.cs | 80 ++++++++ .../{TerraBolt.png => SolarElementalBeam.png} | Bin Projectiles/Magic/StardustElementalBeam.cs | 85 ++++++++ ...rraBolt2.png => StardustElementalBeam.png} | Bin Projectiles/Magic/TerraBeam.cs | 123 +++++++++--- Projectiles/Magic/TerraBolt.cs | 48 ----- Projectiles/Magic/TerraBolt2.cs | 38 ---- Projectiles/Magic/TerraOrb.cs | 33 ---- Projectiles/Magic/TerraOrb.png | Bin 148 -> 0 bytes Projectiles/Magic/TerraOrb2.cs | 33 ---- Projectiles/Magic/TerraOrb2.png | Bin 148 -> 0 bytes Projectiles/Magic/TerraShard.cs | 35 ++++ Projectiles/Magic/TerraShard.png | Bin 0 -> 135 bytes Projectiles/Magic/VortexElementalBeam.cs | 182 ++++++++++++++++++ Projectiles/Magic/VortexElementalBeam.png | Bin 0 -> 191 bytes 28 files changed, 812 insertions(+), 352 deletions(-) create mode 100644 Projectiles/Magic/BeamStar.cs create mode 100644 Projectiles/Magic/BeamStar.png delete mode 100644 Projectiles/Magic/BloodBolt.cs delete mode 100644 Projectiles/Magic/BloodOrb.cs delete mode 100644 Projectiles/Magic/BloodOrb.png create mode 100644 Projectiles/Magic/NebulaElementalBeam.cs rename Projectiles/Magic/{BloodBolt.png => NebulaElementalBeam.png} (100%) create mode 100644 Projectiles/Magic/SolarElementalBeam.cs rename Projectiles/Magic/{TerraBolt.png => SolarElementalBeam.png} (100%) create mode 100644 Projectiles/Magic/StardustElementalBeam.cs rename Projectiles/Magic/{TerraBolt2.png => StardustElementalBeam.png} (100%) delete mode 100644 Projectiles/Magic/TerraBolt.cs delete mode 100644 Projectiles/Magic/TerraBolt2.cs delete mode 100644 Projectiles/Magic/TerraOrb.cs delete mode 100644 Projectiles/Magic/TerraOrb.png delete mode 100644 Projectiles/Magic/TerraOrb2.cs delete mode 100644 Projectiles/Magic/TerraOrb2.png create mode 100644 Projectiles/Magic/TerraShard.cs create mode 100644 Projectiles/Magic/TerraShard.png create mode 100644 Projectiles/Magic/VortexElementalBeam.cs create mode 100644 Projectiles/Magic/VortexElementalBeam.png diff --git a/Items/Weapons/Magic/ElementalRay.cs b/Items/Weapons/Magic/ElementalRay.cs index 8bc5a8a053..51a9012991 100644 --- a/Items/Weapons/Magic/ElementalRay.cs +++ b/Items/Weapons/Magic/ElementalRay.cs @@ -23,8 +23,8 @@ namespace CalamityMod.Items.Weapons.Magic item.mana = 18; item.width = 62; item.height = 62; - item.useTime = 20; - item.useAnimation = 20; + item.useTime = 4; + item.reuseDelay = item.useAnimation = 15; item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 7.5f; @@ -32,17 +32,47 @@ namespace CalamityMod.Items.Weapons.Magic item.rare = 10; item.UseSound = SoundID.Item60; item.autoReuse = true; - item.shoot = ModContent.ProjectileType(); + item.shoot = 1; item.shootSpeed = 6f; item.Calamity().customRarity = CalamityRarity.Turquoise; } - public override Vector2? HoldoutOrigin() - { - return new Vector2(15, 15); - } + public override Vector2? HoldoutOrigin() => new Vector2(15); - public override void AddRecipes() + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + float offsetAngle = MathHelper.TwoPi * player.itemAnimation / player.itemAnimationMax; + offsetAngle += MathHelper.PiOver4 + Main.rand.NextFloat(0f, 1.3f); + float shootSpeed = 1f; + switch (player.itemAnimation) + { + case 14: + type = ModContent.ProjectileType(); + break; + case 10: + type = ModContent.ProjectileType(); + offsetAngle -= NebulaElementalBeam.UniversalAngularSpeed * 0.5f; + break; + case 6: + type = ModContent.ProjectileType(); + shootSpeed = 2f; + break; + case 2: + type = ModContent.ProjectileType(); + break; + default: + return false; + } + + Vector2 spawnOffset = player.DirectionTo(Main.MouseWorld).RotatedBy(offsetAngle) * -Main.rand.NextFloat(40f, 96f); + Vector2 shootDirection = (Main.MouseWorld - (position + spawnOffset)).SafeNormalize(Vector2.UnitX * player.direction); + int beam = Projectile.NewProjectile(position + spawnOffset, shootDirection * shootSpeed, type, damage, knockBack, player.whoAmI); + if (type == ModContent.ProjectileType()) + Main.projectile[beam].ai[0] = shootDirection.ToRotation(); + return false; + } + + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 5); diff --git a/Items/Weapons/Magic/TerraRay.cs b/Items/Weapons/Magic/TerraRay.cs index 578f2652bb..1affdf07ba 100644 --- a/Items/Weapons/Magic/TerraRay.cs +++ b/Items/Weapons/Magic/TerraRay.cs @@ -41,7 +41,15 @@ namespace CalamityMod.Items.Weapons.Magic return new Vector2(15, 15); } - public override void AddRecipes() + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + Vector2 shootVelocity = new Vector2(speedX, speedY); + Vector2 shootPosition = position + shootVelocity * 8f; + Projectile.NewProjectile(shootPosition, shootVelocity, type, damage, knockBack, player.whoAmI); + return false; + } + + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); diff --git a/Projectiles/BaseProjectiles/BaseLaserbeamProjectile.cs b/Projectiles/BaseProjectiles/BaseLaserbeamProjectile.cs index 3abf6c5637..78fe1d662a 100644 --- a/Projectiles/BaseProjectiles/BaseLaserbeamProjectile.cs +++ b/Projectiles/BaseProjectiles/BaseLaserbeamProjectile.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.BaseProjectiles // Attach to some arbitrary thing/position optionally. (The ai[1] value is a reserved for this in vanilla's Phantasmal Deathray) AttachToSomething(); - // Ensure the the velocity is a unit vector and is not a <0,0> vector. + // Ensure the the velocity is a unit vector. This has NaN safety in place with a fallback of <0, -1>. projectile.velocity = projectile.velocity.SafeNormalize(-Vector2.UnitY); Time++; @@ -79,11 +79,9 @@ namespace CalamityMod.Projectiles.BaseProjectiles /// public virtual void DetermineScale() { - projectile.scale = (float)Math.Sin(Time / Lifetime * MathHelper.Pi) * 6f * MaxScale; + projectile.scale = (float)Math.Sin(Time / Lifetime * MathHelper.Pi) * ScaleExpandRate * MaxScale; if (projectile.scale > MaxScale) - { projectile.scale = MaxScale; - } } /// @@ -92,7 +90,7 @@ namespace CalamityMod.Projectiles.BaseProjectiles public virtual void AttachToSomething() { } /// - /// Calculates the current laser's length. By default does not collide with tiles. is a generic laser collision method if you want to do that. + /// Calculates the current laser's length. By default does not collide with tiles. is a generic laser collision method if you want to use it. /// /// The laser length as a float. public virtual float DetermineLaserLength() => MaxLaserLength; @@ -115,6 +113,62 @@ namespace CalamityMod.Projectiles.BaseProjectiles Collision.LaserScan(projectile.Center, projectile.velocity, projectile.scale, MaxLaserLength, laserLengthSamplePoints); return laserLengthSamplePoints.Average(); } + + protected internal void DrawBeamWithColor(SpriteBatch spriteBatch, Color beamColor, float scale) + { + // Start texture drawing. + spriteBatch.Draw(LaserBeginTexture, + projectile.Center - Main.screenPosition, + null, + beamColor, + projectile.rotation, + LaserBeginTexture.Size() / 2f, + scale, + SpriteEffects.None, + 0f); + + // Prepare things for body drawing. + float laserBodyLength = LaserLength; + laserBodyLength -= (LaserBeginTexture.Height / 2 + LaserEndTexture.Height) * scale; + Vector2 centerOnLaser = projectile.Center; + centerOnLaser += projectile.velocity * scale * LaserBeginTexture.Height / 2f; + + // Body drawing. + if (laserBodyLength > 0f) + { + float laserOffset = LaserMiddleTexture.Height * scale; + float incrementalBodyLength = 0f; + while (incrementalBodyLength + 1f < laserBodyLength) + { + spriteBatch.Draw(LaserMiddleTexture, + centerOnLaser - Main.screenPosition, + null, + beamColor, + projectile.rotation, + LaserMiddleTexture.Width * 0.5f * Vector2.UnitX, + scale, + SpriteEffects.None, + 0f); + incrementalBodyLength += laserOffset; + centerOnLaser += projectile.velocity * laserOffset; + } + } + + // End texture drawing. + if (Math.Abs(LaserLength - DetermineLaserLength()) < 30f) + { + Vector2 laserEndCenter = centerOnLaser - Main.screenPosition; + spriteBatch.Draw(LaserEndTexture, + laserEndCenter, + null, + beamColor, + projectile.rotation, + LaserEndTexture.Frame(1, 1, 0, 0).Top(), + scale, + SpriteEffects.None, + 0f); + } + } #endregion #region Hook Overrides @@ -134,78 +188,30 @@ namespace CalamityMod.Projectiles.BaseProjectiles if (projectile.velocity == Vector2.Zero) return false; - // Start texture drawing. - spriteBatch.Draw(LaserBeginTexture, - projectile.Center - Main.screenPosition, - null, - LaserOverlayColor, - projectile.rotation, - LaserBeginTexture.Size() / 2f, - projectile.scale, - SpriteEffects.None, - 0f); - - // Prepare things for body drawing. - float laserBodyLength = LaserLength; - laserBodyLength -= (LaserBeginTexture.Height / 2 + LaserEndTexture.Height) * projectile.scale; - Vector2 centerOnLaser = projectile.Center; - centerOnLaser += projectile.velocity * projectile.scale * LaserBeginTexture.Height / 2f; - - // Body drawing. - if (laserBodyLength > 0f) - { - float laserOffset = LaserMiddleTexture.Height * projectile.scale; - float incrementalBodyLength = 0f; - while (incrementalBodyLength + 1f < laserBodyLength) - { - spriteBatch.Draw(LaserMiddleTexture, - centerOnLaser - Main.screenPosition, - null, - LaserOverlayColor, - projectile.rotation, - LaserMiddleTexture.Width * 0.5f * Vector2.UnitX, - projectile.scale, - SpriteEffects.None, - 0f); - incrementalBodyLength += laserOffset; - centerOnLaser += projectile.velocity * laserOffset; - } - } - - // End texture drawing. - if (Math.Abs(LaserLength - DetermineLaserLength()) < 30f) - { - Vector2 laserEndCenter = centerOnLaser - Main.screenPosition; - spriteBatch.Draw(LaserEndTexture, - laserEndCenter, - null, - LaserOverlayColor, - projectile.rotation, - LaserEndTexture.Frame(1, 1, 0, 0).Top(), - projectile.scale, - SpriteEffects.None, - 0f); - } + DrawBeamWithColor(spriteBatch, LaserOverlayColor, projectile.scale); return false; } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { if (projHitbox.Intersects(targetHitbox)) return true; - float unused = 69420f; - return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), projectile.Center, projectile.Center + projectile.velocity * LaserLength, projectile.Size.Length() * projectile.scale, ref unused); + float _ = 0f; + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), projectile.Center, projectile.Center + projectile.velocity * LaserLength, projectile.Size.Length() * projectile.scale, ref _); } - #endregion - #region Virtual Properties - public virtual float Lifetime => 120f; - public virtual float MaxScale => 1f; - public virtual float MaxLaserLength => 2400f; // Be careful with this. Going too high will cause lag. + public override bool ShouldUpdatePosition() => false; + #endregion + + #region Overridable Properties + public abstract float Lifetime { get; } + public abstract float MaxScale { get; } + public abstract float MaxLaserLength { get; } // Be careful with this. Going too high will cause lag. + public abstract Texture2D LaserBeginTexture { get; } + public abstract Texture2D LaserMiddleTexture { get; } + public abstract Texture2D LaserEndTexture { get; } + public virtual float ScaleExpandRate => 4f; public virtual Color LightCastColor => Color.White; public virtual Color LaserOverlayColor => Color.White * 0.9f; - public virtual Texture2D LaserBeginTexture { get; } - public virtual Texture2D LaserMiddleTexture { get; } - public virtual Texture2D LaserEndTexture { get; } #endregion } } diff --git a/Projectiles/Magic/BeamStar.cs b/Projectiles/Magic/BeamStar.cs new file mode 100644 index 0000000000..08746a6162 --- /dev/null +++ b/Projectiles/Magic/BeamStar.cs @@ -0,0 +1,96 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Magic +{ + public class BeamStar : ModProjectile + { + public ref float Time => ref projectile.ai[0]; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Star"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 6; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 12; + projectile.friendly = true; + projectile.alpha = 255; + projectile.penetrate = 1; + projectile.extraUpdates = 1; + projectile.timeLeft = 240; + projectile.tileCollide = true; + projectile.magic = true; + } + + public override void AI() + { + Time++; + + if (Time < 45f) + projectile.velocity = projectile.velocity.RotatedBy((projectile.identity % 4 - 2) / 2f * 0.016f) * 1.004f; + else + { + NPC potentialTarget = projectile.Center.ClosestNPCAt(800f, false); + if (potentialTarget != null) + { + float destinationDeltaAngle = MathHelper.WrapAngle(projectile.AngleTo(potentialTarget.Center) - projectile.velocity.ToRotation()); + + // If the angle is <0, meaning it's to the left, the sine will return a negative number, + // and a positive number if >0, because WrapAngle constricts to angle to a bound of + // -pi and pi, which are where a sine's wave restarts anew. + float angularHomeDirection = Math.Sign(Math.Sin(destinationDeltaAngle)); + projectile.velocity = projectile.velocity.RotatedBy(angularHomeDirection * 0.03f); + } + } + + if (Main.rand.NextBool(4)) + { + Dust stardust = Dust.NewDustDirect(projectile.position, projectile.width, projectile.height, 180, 0f, 0f, 100, default, 1f); + stardust.position = projectile.Center; + stardust.scale += Main.rand.NextFloat(0.5f); + stardust.noGravity = true; + stardust.velocity.Y -= 2f; + } + if (Main.rand.NextBool(6)) + { + Dust stardust = Dust.NewDustDirect(projectile.position, projectile.width, projectile.height, 176, 0f, 0f, 100, default, 1f); + stardust.position = projectile.Center; + stardust.scale += Main.rand.NextFloat(0.3f, 1.1f); + stardust.noGravity = true; + stardust.velocity *= 0.1f; + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Vector2 drawPosition; + Texture2D starTexture = Main.projectileTexture[projectile.type]; + for (int i = 1; i < projectile.oldPos.Length; i++) + { + float scale = projectile.scale * MathHelper.Lerp(0.9f, 0.6f, i / (float)projectile.oldPos.Length) * 0.56f; + drawPosition = projectile.oldPos[i] + projectile.Size * 0.5f - Main.screenPosition; + spriteBatch.Draw(starTexture, drawPosition, null, Color.White, 0f, starTexture.Size() * 0.5f, scale, SpriteEffects.None, 0f); + } + + drawPosition = projectile.Center - Main.screenPosition; + spriteBatch.Draw(starTexture, drawPosition, null, Color.White, 0f, starTexture.Size() * 0.5f, projectile.scale, SpriteEffects.None, 0f); + return false; + } + + public override void Kill(int timeLeft) + { + for (int k = 0; k < 10; k++) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 176, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 180, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); + } + } + } +} diff --git a/Projectiles/Magic/BeamStar.png b/Projectiles/Magic/BeamStar.png new file mode 100644 index 0000000000000000000000000000000000000000..741535f9612b76bf7a9ebae6d3ec38364f188c8a GIT binary patch literal 3136 zcmV-G48QYPx#1ZP1_K>z@;j|==^1poj6GEhuZMF0Q*000310RaF30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d}_trY&Fuz_kzQ0vbm2X+U395pc)d2e!w zwM|LlZBz``z{7O0r51QTInbqi0cxT*SSUrQJ%XCRCioX-t;Q<|7Su#tJdv_3wt?4# z!OMshe9K@S!-m+mBD*C8UPr9p4G9+Pkh(R>E`_%tR`3o43tl@_-v;kUu*NO2??dW> aruiRIK8?_PmaH5A0000()); - } - } -} diff --git a/Projectiles/Magic/BloodOrb.png b/Projectiles/Magic/BloodOrb.png deleted file mode 100644 index 6ea4de390303173be2d92b5b3fb1ba302aa351bf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 148 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VTavfC3&Vd9T(EcfWS|IVfk$L9 z0|Vb-5N14{zaj-F$X?><>&pIsolC${>|wRoS)h=jr;B5V#p&cf|Nq-Fn=%SBPd&Jz maWPw;lttEq6^+hE9T+mXnN^!s2qgd&GkCiCxvX ref projectile.ai[0]; + public ref float InitialDamage => ref projectile.ai[1]; public override void SetStaticDefaults() { DisplayName.SetDefault("Blood Ray"); @@ -19,29 +25,34 @@ namespace CalamityMod.Projectiles.Magic projectile.magic = true; projectile.penetrate = 10; projectile.extraUpdates = 100; - projectile.timeLeft = 150; + projectile.timeLeft = Lifetime; } public override void AI() { - projectile.localAI[1] += 1f; - if (projectile.localAI[1] >= 29f && projectile.owner == Main.myPlayer) - { - projectile.localAI[1] = 0f; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)(projectile.damage * 0.6), projectile.knockBack, projectile.owner, 0f, 0f); - } + // Just doing damage = (int)(damage * scalar) wouldn't work here. + // The exponential base would be too small for a weapon like this, and the + // cast (which removes the fractional part) would overtake any increases before the damage can rise. + if (InitialDamage == 0f) + { + InitialDamage = projectile.damage; + projectile.netUpdate = true; + } - projectile.localAI[0] += 1f; - if (projectile.localAI[0] > 9f) + Time++; + projectile.damage = (int)(InitialDamage * Math.Pow(ExponentialDamageBoost, Time)); + + if (Time >= 12f) { - for (int num447 = 0; num447 < 2; num447++) + for (int i = 0; i < 2; i++) { - Vector2 vector33 = projectile.position; - vector33 -= projectile.velocity * ((float)num447 * 0.25f); - int num448 = Dust.NewDust(vector33, 1, 1, (int)CalamityDusts.Brimstone, 0f, 0f, 0, default, 1.5f); - Main.dust[num448].position = vector33; - Main.dust[num448].scale = (float)Main.rand.Next(70, 110) * 0.013f; - Main.dust[num448].velocity *= 0.1f; + int dustType = Main.rand.NextBool(4) ? 182 : (int)CalamityDusts.Brimstone; + Vector2 dustSpawnPos = projectile.position - projectile.velocity * i / 2f; + Dust corruptMagic = Dust.NewDustPerfect(dustSpawnPos, dustType); + corruptMagic.scale = Main.rand.NextFloat(0.96f, 1.04f); + corruptMagic.scale *= MathHelper.Lerp(1f, 1.7f, Time / Lifetime); + corruptMagic.noGravity = true; + corruptMagic.velocity *= 0.1f; } } } diff --git a/Projectiles/Magic/NebulaElementalBeam.cs b/Projectiles/Magic/NebulaElementalBeam.cs new file mode 100644 index 0000000000..528320b2fd --- /dev/null +++ b/Projectiles/Magic/NebulaElementalBeam.cs @@ -0,0 +1,65 @@ +using CalamityMod.Projectiles.BaseProjectiles; +using CalamityMod.Projectiles.Typeless; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Magic +{ + public class NebulaElementalBeam : BaseLaserbeamProjectile + { + public override float MaxScale => 1.4f; + public override float MaxLaserLength => 1000f; + public override float Lifetime => 30f; + public override Color LightCastColor => Color.White; + public override Texture2D LaserBeginTexture => ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/UltimaRayStart"); + public override Texture2D LaserMiddleTexture => ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/UltimaRayMid"); + public override Texture2D LaserEndTexture => ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/UltimaRayEnd"); + + public const float UniversalAngularSpeed = MathHelper.Pi / 400f; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Beam"); + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 20; + projectile.friendly = true; + projectile.magic = true; + projectile.penetrate = 10; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 13; + projectile.tileCollide = false; + projectile.timeLeft = (int)Lifetime; + } + + public override void ExtraBehavior() + { + RotationalSpeed = UniversalAngularSpeed; + // Generate a burst of bubble-like nebula dust. + if (!Main.dedServ && Time == 5f) + { + int totalBubbles = 24; + for (int i = 0; i < totalBubbles; i++) + { + Dust nebulaBubble = Dust.NewDustPerfect(projectile.Center, 242); + nebulaBubble.velocity = Main.rand.NextVector2Circular(6f, 6f); + nebulaBubble.scale = Main.rand.NextFloat(2f, 3f); + nebulaBubble.noGravity = true; + } + } + } + + public override void DetermineScale() => projectile.scale = projectile.timeLeft / Lifetime * MaxScale; + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + DrawBeamWithColor(spriteBatch, Color.Lerp(Color.Lerp(Color.Purple, Color.White, 0.26f) * 1.1f, Color.Transparent, 0.25f), projectile.scale); + DrawBeamWithColor(spriteBatch, Color.Lerp(Color.Fuchsia * 1.1f, Color.Transparent, 0.25f), projectile.scale * 0.5f); + return false; + } + } +} diff --git a/Projectiles/Magic/BloodBolt.png b/Projectiles/Magic/NebulaElementalBeam.png similarity index 100% rename from Projectiles/Magic/BloodBolt.png rename to Projectiles/Magic/NebulaElementalBeam.png diff --git a/Projectiles/Magic/NightBolt.cs b/Projectiles/Magic/NightBolt.cs index c40e79b84f..1b3c92e331 100644 --- a/Projectiles/Magic/NightBolt.cs +++ b/Projectiles/Magic/NightBolt.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Magic { projectile.width = 4; projectile.height = 4; - projectile.extraUpdates = 100; + projectile.extraUpdates = 20; projectile.friendly = true; projectile.timeLeft = 30; projectile.magic = true; diff --git a/Projectiles/Magic/NightsRayBeam.cs b/Projectiles/Magic/NightsRayBeam.cs index bfcfe17a55..dc4ac283fd 100644 --- a/Projectiles/Magic/NightsRayBeam.cs +++ b/Projectiles/Magic/NightsRayBeam.cs @@ -5,6 +5,12 @@ namespace CalamityMod.Projectiles.Magic { public class NightsRayBeam : ModProjectile { + public ref float Time => ref projectile.ai[0]; + public bool HasFiredSideBeams + { + get => projectile.ai[1] == 1f; + set => projectile.ai[1] = value.ToInt(); + } public override void SetStaticDefaults() { DisplayName.SetDefault("Ray"); @@ -23,24 +29,33 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { - projectile.localAI[1] += 1f; - if (projectile.localAI[1] >= 29f && projectile.owner == Main.myPlayer) + if (!HasFiredSideBeams && projectile.owner == Main.myPlayer) { - projectile.localAI[1] = 0f; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)(projectile.damage * 0.6), projectile.knockBack, projectile.owner, 0f, 0f); + NPC potentialTarget = projectile.Center.ClosestNPCAt(5480f, false); + if (potentialTarget != null) + { + Vector2 baseSpawnPositionOffset = Main.rand.NextVector2CircularEdge(40f, 40f); + for (int i = 0; i < 4; i++) + { + Vector2 spawnPosition = potentialTarget.Center + baseSpawnPositionOffset.RotatedBy(MathHelper.TwoPi * i / 4f); + Projectile.NewProjectile(spawnPosition, Vector2.Zero, ModContent.ProjectileType(), (int)(projectile.damage * 0.8), projectile.knockBack, projectile.owner); + } + HasFiredSideBeams = true; + projectile.netUpdate = true; + } } - projectile.localAI[0] += 1f; - if (projectile.localAI[0] > 9f) + Time++; + if (Time >= 10f) { - for (int num447 = 0; num447 < 3; num447++) + for (int i = 0; i < 2; i++) { - Vector2 vector33 = projectile.position; - vector33 -= projectile.velocity * ((float)num447 * 0.25f); - int num448 = Dust.NewDust(vector33, 1, 1, 27, 0f, 0f, 0, default, 1.25f); - Main.dust[num448].position = vector33; - Main.dust[num448].scale = (float)Main.rand.Next(70, 110) * 0.013f; - Main.dust[num448].velocity *= 0.1f; + Vector2 dustSpawnPos = projectile.position - projectile.velocity * i / 2f; + Dust corruptMagic = Dust.NewDustPerfect(dustSpawnPos, 27); + corruptMagic.color = Color.Lerp(Color.Fuchsia, Color.Magenta, Main.rand.NextFloat(0.6f)); + corruptMagic.scale = Main.rand.NextFloat(0.96f, 1.04f); + corruptMagic.noGravity = true; + corruptMagic.velocity *= 0.1f; } } } diff --git a/Projectiles/Magic/SolarElementalBeam.cs b/Projectiles/Magic/SolarElementalBeam.cs new file mode 100644 index 0000000000..ccd2f22f53 --- /dev/null +++ b/Projectiles/Magic/SolarElementalBeam.cs @@ -0,0 +1,80 @@ +using CalamityMod.Projectiles.BaseProjectiles; +using CalamityMod.Projectiles.Typeless; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Magic +{ + public class SolarElementalBeam : BaseLaserbeamProjectile + { + public override float MaxScale => 1f; + public override float MaxLaserLength => 1000f; + public override float Lifetime => 30f; + public override Color LightCastColor => Color.White; + public override Texture2D LaserBeginTexture => ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/UltimaRayStart"); + public override Texture2D LaserMiddleTexture => ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/UltimaRayMid"); + public override Texture2D LaserEndTexture => ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/UltimaRayEnd"); + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Beam"); + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 20; + projectile.friendly = true; + projectile.magic = true; + projectile.penetrate = 10; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 13; + projectile.tileCollide = false; + projectile.timeLeft = (int)Lifetime; + } + + public override void ExtraBehavior() + { + // Generate a star-like burst of solar fire dust. + if (!Main.dedServ && Time == 5f) + { + int starPoints = 8; + for (int i = 0; i < starPoints; i++) + { + float angle = MathHelper.TwoPi * i / starPoints; + for (int j = 0; j < 12; j++) + { + float starSpeed = MathHelper.Lerp(2f, 10f, j / 12f); + Color dustColor = Color.Lerp(Color.White, Color.Yellow, j / 12f); + float dustScale = MathHelper.Lerp(1.6f, 0.85f, j / 12f); + + Dust fire = Dust.NewDustPerfect(projectile.Center, 6); + fire.velocity = angle.ToRotationVector2() * starSpeed; + fire.color = dustColor; + fire.scale = dustScale; + fire.noGravity = true; + } + } + } + } + + public override void DetermineScale() => projectile.scale = projectile.timeLeft / Lifetime * MaxScale; + + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + DrawBeamWithColor(spriteBatch, Color.Lerp(Color.DarkOrange * 1.1f, Color.Transparent, 0.25f), projectile.scale); + DrawBeamWithColor(spriteBatch, Color.Lerp(Color.Yellow * 1.1f, Color.Transparent, 0.25f), projectile.scale * 0.5f); + return false; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + int type = ModContent.ProjectileType(); + int boomDamage = (int)(damage * 1.1); + int boom = Projectile.NewProjectile(target.Center, Vector2.Zero, type, boomDamage, knockback, projectile.owner, 0f, Main.rand.NextFloat(0.85f, 2f)); + Main.projectile[boom].Calamity().forceMagic = true; + } + } +} diff --git a/Projectiles/Magic/TerraBolt.png b/Projectiles/Magic/SolarElementalBeam.png similarity index 100% rename from Projectiles/Magic/TerraBolt.png rename to Projectiles/Magic/SolarElementalBeam.png diff --git a/Projectiles/Magic/StardustElementalBeam.cs b/Projectiles/Magic/StardustElementalBeam.cs new file mode 100644 index 0000000000..7fe2f9350d --- /dev/null +++ b/Projectiles/Magic/StardustElementalBeam.cs @@ -0,0 +1,85 @@ +using CalamityMod.Projectiles.BaseProjectiles; +using CalamityMod.Projectiles.Typeless; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Magic +{ + public class StardustElementalBeam : BaseLaserbeamProjectile + { + public override float MaxScale => 0.85f; + public override float MaxLaserLength => 1000f; + public override float Lifetime => 30f; + public override Color LightCastColor => Color.White; + public override Texture2D LaserBeginTexture => ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/UltimaRayStart"); + public override Texture2D LaserMiddleTexture => ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/UltimaRayMid"); + public override Texture2D LaserEndTexture => ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/UltimaRayEnd"); + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Beam"); + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 20; + projectile.friendly = true; + projectile.magic = true; + projectile.penetrate = 10; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 13; + projectile.tileCollide = false; + projectile.timeLeft = (int)Lifetime; + } + + public override void ExtraBehavior() + { + // Generate 2 stars from the side. + if (Main.myPlayer == projectile.owner && Time == 5f) + { + int type = ModContent.ProjectileType(); + + int damage = (int)(projectile.damage * 0.75); + for (int i = 0; i < 2; i++) + { + Vector2 starSpeed = projectile.velocity.RotatedBy(MathHelper.PiOver2 * i) * 5f; + Projectile.NewProjectile(projectile.Center, starSpeed, type, damage, projectile.knockBack, projectile.owner); + } + } + } + + public override void DetermineScale() => projectile.scale = projectile.timeLeft / Lifetime * MaxScale; + + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + DrawBeamWithColor(spriteBatch, Color.Lerp(Color.CornflowerBlue * 1.1f, Color.Transparent, 0.3f), projectile.scale); + DrawBeamWithColor(spriteBatch, Color.Lerp(Color.Cyan, Color.Transparent, 0.3f), projectile.scale * 0.5f); + DrawBeamWithColor(spriteBatch, Color.Lerp(Color.White, Color.Transparent, 0.3f), projectile.scale * 0.2f); + return false; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + // Inflict the celled debuff for 3 seconds. + target.AddBuff(BuffID.StardustMinionBleed, 180); + + if (!Main.rand.NextBool(7)) + return; + + float spawnOffsetSpread = Main.rand.NextFloat(MathHelper.ToRadians(36f), MathHelper.ToRadians(64f)); + float baseOffsetAngle = Main.rand.NextFloat(-0.6f, 0.6f); + int type = ModContent.ProjectileType(); + damage = (int)(projectile.damage * 0.7); + for (int i = 0; i < 4; i++) + { + float spawnOffsetAngle = MathHelper.Lerp(spawnOffsetSpread * -0.5f, spawnOffsetSpread * 0.5f, i / 4f) + baseOffsetAngle; + Vector2 spawnPosition = target.Top - Vector2.UnitY.RotatedBy(spawnOffsetAngle) * 65f; + Projectile.NewProjectile(spawnPosition, -Vector2.UnitY.RotatedBy(spawnOffsetAngle) * 2f, type, damage, knockback, projectile.owner); + } + } + } +} diff --git a/Projectiles/Magic/TerraBolt2.png b/Projectiles/Magic/StardustElementalBeam.png similarity index 100% rename from Projectiles/Magic/TerraBolt2.png rename to Projectiles/Magic/StardustElementalBeam.png diff --git a/Projectiles/Magic/TerraBeam.cs b/Projectiles/Magic/TerraBeam.cs index b5e9dbd158..e0764b60cf 100644 --- a/Projectiles/Magic/TerraBeam.cs +++ b/Projectiles/Magic/TerraBeam.cs @@ -1,53 +1,116 @@ +using CalamityMod.Projectiles.BaseProjectiles; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Magic { - public class TerraBeam : ModProjectile + public class TerraBeam : BaseLaserbeamProjectile { + public override float MaxScale => 1f; + public override float MaxLaserLength => 1200f; + public override float Lifetime => 30f; + public override Color LightCastColor => Color.White; + public override Texture2D LaserBeginTexture => ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/UltimaRayStart"); + public override Texture2D LaserMiddleTexture => ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/UltimaRayMid"); + public override Texture2D LaserEndTexture => ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/UltimaRayEnd"); + + public ref float ShardCooldown => ref projectile.ai[1]; public override void SetStaticDefaults() { - DisplayName.SetDefault("Bolt"); + DisplayName.SetDefault("Beam"); } public override void SetDefaults() { - projectile.width = 4; - projectile.height = 4; + projectile.width = projectile.height = 20; projectile.friendly = true; projectile.magic = true; projectile.penetrate = 10; - projectile.extraUpdates = 100; - projectile.timeLeft = 150; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 8; + projectile.tileCollide = false; + projectile.timeLeft = (int)Lifetime; } - public override void AI() - { - projectile.localAI[1] += 1f; - if (projectile.localAI[1] >= 21f && projectile.owner == Main.myPlayer) - { - projectile.localAI[1] = 0f; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)(projectile.damage * 0.7), projectile.knockBack, projectile.owner, 0f, 0f); - } - - projectile.localAI[0] += 1f; - if (projectile.localAI[0] > 9f) - { - for (int num447 = 0; num447 < 3; num447++) + public override void ExtraBehavior() + { + // Generate a star-like and circular burst of terra dust. + if (!Main.dedServ && Time == 5f) + { + int starPoints = 6; + for (int i = 0; i < starPoints; i++) { - Vector2 vector33 = projectile.position; - vector33 -= projectile.velocity * ((float)num447 * 0.25f); - int num448 = Dust.NewDust(vector33, 1, 1, 107, 0f, 0f, 0, default, 1.25f); - Main.dust[num448].position = vector33; - Main.dust[num448].scale = (float)Main.rand.Next(70, 110) * 0.013f; - Main.dust[num448].velocity *= 0.1f; - } + float angle = MathHelper.TwoPi * i / starPoints; + for (int j = 0; j < 12; j++) + { + float starSpeed = MathHelper.Lerp(1f, 7f, j / 12f); + Color dustColor = Color.Lerp(Color.White, Color.YellowGreen, j / 12f); + float dustScale = MathHelper.Lerp(1.6f, 0.85f, j / 12f); + + Dust terraMagic = Dust.NewDustPerfect(projectile.Center, 107); + terraMagic.velocity = angle.ToRotationVector2() * starSpeed; + terraMagic.color = dustColor; + terraMagic.scale = dustScale; + terraMagic.noGravity = true; + } + } + + int ovalPoints = 42; + for (int i = 0; i < ovalPoints; i++) + { + float angle = MathHelper.TwoPi * i / ovalPoints; + Dust terraMagic = Dust.NewDustPerfect(projectile.Center, 107); + terraMagic.velocity = angle.ToRotationVector2() * 6f; + terraMagic.scale = 1.1f; + terraMagic.noGravity = true; + } } + + if (ShardCooldown > 0f) + ShardCooldown--; } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.immune[projectile.owner] = 8; + public override void DetermineScale() => projectile.scale = projectile.timeLeft / Lifetime * MaxScale; + + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + DrawBeamWithColor(spriteBatch, Color.Lime * 1.1f, projectile.scale); + DrawBeamWithColor(spriteBatch, Color.Yellow * 1.1f, projectile.scale * 0.5f); + return false; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (ShardCooldown > 0f) + return; + + // The "Center" of the laser is actually the start of it in this context. + // Collision is done separately. This might have a slight offset due to collision + // boxes, but that should be negligible. + float lengthFromStart = projectile.Distance(target.Center); + + int totalShards = (int)MathHelper.Lerp(1, 4, MathHelper.Clamp(lengthFromStart / MaxLaserLength * 1.4f, 0f, 1f)); + int shardType = ModContent.ProjectileType(); + int shardDamage = (int)(damage * 0.6); + for (int i = 0; i < totalShards; i++) + { + int tries = 0; + Vector2 spawnOffset; + do + { + spawnOffset = Main.rand.NextVector2CircularEdge(target.width * 0.5f + 40f, target.height * 0.5f + 40f); + tries++; + } + while (Collision.SolidCollision((target.Center + spawnOffset).ToTileCoordinates().ToVector2(), 4, 4) && tries < 10); + + Projectile.NewProjectile(target.Center + spawnOffset, Main.rand.NextVector2CircularEdge(6f, 6f), shardType, shardDamage, knockback); + } + + ShardCooldown = 3f; + projectile.netUpdate = true; } - } + } } diff --git a/Projectiles/Magic/TerraBolt.cs b/Projectiles/Magic/TerraBolt.cs deleted file mode 100644 index b724da7432..0000000000 --- a/Projectiles/Magic/TerraBolt.cs +++ /dev/null @@ -1,48 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Magic -{ - public class TerraBolt : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bolt"); - } - - public override void SetDefaults() - { - projectile.width = 4; - projectile.height = 4; - projectile.extraUpdates = 100; - projectile.friendly = true; - projectile.timeLeft = 30; - projectile.magic = true; - } - - public override void AI() - { - projectile.localAI[1] += 1f; - if (projectile.localAI[1] >= 29f && projectile.owner == Main.myPlayer) - { - projectile.localAI[1] = 0f; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)(projectile.damage * 0.7), projectile.knockBack, projectile.owner, 0f, 0f); - } - - for (int num447 = 0; num447 < 2; num447++) - { - Vector2 vector33 = projectile.position; - vector33 -= projectile.velocity * ((float)num447 * 0.25f); - int num448 = Dust.NewDust(vector33, 1, 1, 107, 0f, 0f, 0, default, 1.25f); - Main.dust[num448].position = vector33; - Main.dust[num448].scale = (float)Main.rand.Next(70, 110) * 0.013f; - Main.dust[num448].velocity *= 0.1f; - } - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.immune[projectile.owner] = 8; - } - } -} diff --git a/Projectiles/Magic/TerraBolt2.cs b/Projectiles/Magic/TerraBolt2.cs deleted file mode 100644 index 99efba297b..0000000000 --- a/Projectiles/Magic/TerraBolt2.cs +++ /dev/null @@ -1,38 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Magic -{ - public class TerraBolt2 : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bolt"); - } - - public override void SetDefaults() - { - projectile.width = 4; - projectile.height = 4; - projectile.extraUpdates = 100; - projectile.friendly = true; - projectile.timeLeft = 15; - projectile.magic = true; - } - - public override void AI() - { - Vector2 vector33 = projectile.position; - vector33 -= projectile.velocity * 0.25f; - int num448 = Dust.NewDust(vector33, 1, 1, 107, 0f, 0f, 0, default, 1.25f); - Main.dust[num448].position = vector33; - Main.dust[num448].scale = (float)Main.rand.Next(70, 110) * 0.013f; - Main.dust[num448].velocity *= 0.1f; - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.immune[projectile.owner] = 8; - } - } -} diff --git a/Projectiles/Magic/TerraOrb.cs b/Projectiles/Magic/TerraOrb.cs deleted file mode 100644 index fa0a9f5614..0000000000 --- a/Projectiles/Magic/TerraOrb.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Terraria; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Magic -{ - public class TerraOrb : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bolt"); - } - - public override void SetDefaults() - { - projectile.width = 14; - projectile.height = 14; - projectile.friendly = true; - projectile.alpha = 255; - projectile.penetrate = -1; - projectile.timeLeft = 30; - projectile.magic = true; - } - - public override void AI() - { - CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 300f, 6f, 24f, 5, ModContent.ProjectileType()); - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.immune[projectile.owner] = 8; - } - } -} diff --git a/Projectiles/Magic/TerraOrb.png b/Projectiles/Magic/TerraOrb.png deleted file mode 100644 index 6ea4de390303173be2d92b5b3fb1ba302aa351bf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 148 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VTavfC3&Vd9T(EcfWS|IVfk$L9 z0|Vb-5N14{zaj-F$X?><>&pIsolC${>|wRoS)h=jr;B5V#p&cf|Nq-Fn=%SBPd&Jz maWPw;lttEq6^+hE9T+mXnN^!s2qgd&GkCiCxvX()); - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.immune[projectile.owner] = 8; - } - } -} diff --git a/Projectiles/Magic/TerraOrb2.png b/Projectiles/Magic/TerraOrb2.png deleted file mode 100644 index 6ea4de390303173be2d92b5b3fb1ba302aa351bf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 148 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE-VTavfC3&Vd9T(EcfWS|IVfk$L9 z0|Vb-5N14{zaj-F$X?><>&pIsolC${>|wRoS)h=jr;B5V#p&cf|Nq-Fn=%SBPd&Jz maWPw;lttEq6^+hE9T+mXnN^!s2qgd&GkCiCxvX ref projectile.ai[0]; + // Technically not a ratio, and more of a seed, but it is used in a 0-2pi squash + // later in the code to get an arbitrary unit vector (which is then checked). + public ref float BaseTurnAngleRatio => ref projectile.ai[1]; + public ref float AccumulatedXMovementSpeeds => ref projectile.localAI[0]; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Lightning"); + ProjectileID.Sets.MinionShot[projectile.type] = true; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 30; + ProjectileID.Sets.TrailingMode[projectile.type] = 1; + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 16; + projectile.friendly = true; + projectile.magic = true; + projectile.alpha = 255; + projectile.penetrate = 1; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.extraUpdates = 20; + projectile.timeLeft = 45 * projectile.extraUpdates; + + // Readjust the velocity magnitude the moment this projectile is created + // to make velocity setting outside the scope of this projectile less irritating + // to consider alongside extraUpdate multipliers. + // Also set the initial angle. + if (projectile.velocity != Vector2.Zero) + { + projectile.velocity /= projectile.extraUpdates; + } + } + + public override void SendExtraAI(BinaryWriter writer) => writer.Write(AccumulatedXMovementSpeeds); + + public override void ReceiveExtraAI(BinaryReader reader) => AccumulatedXMovementSpeeds = reader.ReadSingle(); + + public override void AI() + { + // frameCounter in this context is really just an arbitrary timer + // which allows random turning to occur. + projectile.frameCounter++; + + projectile.scale += 0.04f / projectile.MaxUpdates; + if (projectile.scale > 1f) + projectile.scale = 1f; + + Lighting.AddLight(projectile.Center, Color.Pink.ToVector3()); + if (projectile.frameCounter >= projectile.extraUpdates * 2) + { + projectile.frameCounter = 0; + + float originalSpeed = MathHelper.Min(6f, projectile.velocity.Length()); + UnifiedRandom unifiedRandom = new UnifiedRandom((int)BaseTurnAngleRatio); + int turnTries = 0; + Vector2 newBaseDirection = -Vector2.UnitY; + Vector2 potentialBaseDirection; + + do + { + BaseTurnAngleRatio = unifiedRandom.Next() % 100; + potentialBaseDirection = (BaseTurnAngleRatio / 100f * MathHelper.TwoPi).ToRotationVector2(); + + // Ensure that the new potential direction base is always moving upwards (this is supposed to be somewhat similar to a -UnitY + RotatedBy). + potentialBaseDirection.Y = -Math.Abs(potentialBaseDirection.Y); + + bool canChangeLightningDirection = true; + + // Potential directions with very little Y speed should not be considered, because this + // consequentially means that the X speed would be quite large. + if (potentialBaseDirection.Y > -0.02f) + canChangeLightningDirection = false; + + // This mess of math basically encourages movement at the ends of an extraUpdate cycle, + // discourages super frequenent randomness as the accumulated X speed changes get larger, + // or if the original speed is quite large. + if (Math.Abs(potentialBaseDirection.X * (projectile.extraUpdates + 1) * 2f * originalSpeed + AccumulatedXMovementSpeeds) > projectile.MaxUpdates * LightningTurnRandomnessFactor) + { + canChangeLightningDirection = false; + } + + // If the above checks were all passed, redefine the base direction of the lightning. + if (canChangeLightningDirection) + newBaseDirection = potentialBaseDirection; + + turnTries++; + } + while (turnTries < 100); + + if (projectile.velocity != Vector2.Zero) + { + AccumulatedXMovementSpeeds += newBaseDirection.X * (projectile.extraUpdates + 1) * 2f * originalSpeed; + projectile.velocity = newBaseDirection.RotatedBy(InitialVelocityAngle + MathHelper.PiOver2) * originalSpeed; + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; + } + } + } + + #region Drawing + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D lightningSegmentTexture = Main.projectileTexture[projectile.type]; + projectile.GetAlpha(lightColor); + Vector2 lightningScale = new Vector2(projectile.scale) / 2f; + for (int i = 0; i < 3; i++) + { + // c_1 and f_1 are general fields that are used for drawing methods in here. + // c_1 is the color to be used, and f_1 is the opacity. + if (i == 0) + { + lightningScale = new Vector2(projectile.scale) * 0.6f; + DelegateMethods.c_1 = Color.DarkCyan * 0.85f; + } + else if (i == 1) + { + lightningScale = new Vector2(projectile.scale) * 0.4f; + DelegateMethods.c_1 = Color.Cyan * 0.85f; + } + else + { + lightningScale = new Vector2(projectile.scale) * 0.2f; + DelegateMethods.c_1 = Color.White; + } + + DelegateMethods.f_1 = 1f; + for (int j = projectile.oldPos.Length - 1; j > 0; j--) + { + if (projectile.oldPos[j] != Vector2.Zero) + { + Vector2 start = projectile.oldPos[j] + projectile.Size * 0.5f + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; + Vector2 end = projectile.oldPos[j - 1] + projectile.Size * 0.5f + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; + Utils.DrawLaser(spriteBatch, lightningSegmentTexture, start, end, lightningScale, DelegateMethods.LightningLaserDraw); + } + } + } + return false; + } + #endregion + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(BuffID.Electrified, 180); + + for (int i = 0; i < projectile.oldPos.Length - 1; i++) + { + // Skip zeroed old positions. They are almost certainly a + // result of incomplete indices. + if (projectile.oldPos[i + 1] == Vector2.Zero) + continue; + + for (int j = 0; j < 8; j++) + { + Vector2 dustSpawnPosition = Vector2.Lerp(projectile.oldPos[i], projectile.oldPos[i + 1], j / 8f); + dustSpawnPosition += projectile.Size * 0.5f; + + Dust electricity = Dust.NewDustPerfect(dustSpawnPosition, Main.rand.NextBool(2) ? 226 : 229); + electricity.velocity = Vector2.Zero; + electricity.scale = Main.rand.NextFloat(1.1f, 1.18f); + electricity.noGravity = true; + } + } + } + } +} diff --git a/Projectiles/Magic/VortexElementalBeam.png b/Projectiles/Magic/VortexElementalBeam.png new file mode 100644 index 0000000000000000000000000000000000000000..f99e9c57d500bc2b7e8d33ffe4ce738e005f0b0d GIT binary patch literal 191 zcmeAS@N?(olHy`uVBq!ia0vp^Vj#@H1|*Mc$*~4fjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCils0(?STf%N~sAJ_vPoCC7LJzX3_JiL=r4lw=$iprll!YwhAb;GQKEK67N z8RRHmTl#|G?$a&hhCB6K*$t*&K6ms=k*3vxnceQZZOwtr4-;NU+OVAF(%@xxUT)*Y ieq`62bER_3%nU1U%Lqmu_`efq1%s!npUXO@geCy~$3Ut8 literal 0 HcmV?d00001 From ef5a8254ab6f75dc377075e8a79ea7e4cccd73f0 Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 6 Nov 2020 15:11:26 -0600 Subject: [PATCH 014/202] Tooltip adjustment for rays --- Items/Weapons/Magic/CarnageRay.cs | 3 ++- Items/Weapons/Magic/ElementalRay.cs | 11 ++++++++++- Items/Weapons/Magic/NightsRay.cs | 3 ++- Items/Weapons/Magic/TerraRay.cs | 3 ++- Projectiles/Magic/BloodRay.cs | 9 ++++----- 5 files changed, 20 insertions(+), 9 deletions(-) diff --git a/Items/Weapons/Magic/CarnageRay.cs b/Items/Weapons/Magic/CarnageRay.cs index 65e8197023..d5952040bf 100644 --- a/Items/Weapons/Magic/CarnageRay.cs +++ b/Items/Weapons/Magic/CarnageRay.cs @@ -12,7 +12,8 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetStaticDefaults() { DisplayName.SetDefault("Carnage Ray"); - Tooltip.SetDefault("Fires a blood ray that splits if enemies are near it"); + Tooltip.SetDefault("Fires a blood ray\n" + + "The farther along the ray hit enemies are, the more damage they take"); Item.staff[item.type] = true; } diff --git a/Items/Weapons/Magic/ElementalRay.cs b/Items/Weapons/Magic/ElementalRay.cs index 51a9012991..44b0758e65 100644 --- a/Items/Weapons/Magic/ElementalRay.cs +++ b/Items/Weapons/Magic/ElementalRay.cs @@ -12,7 +12,11 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetStaticDefaults() { DisplayName.SetDefault("Elemental Ray"); - Tooltip.SetDefault("Casts a rainbow ray that splits when enemies are near it"); + Tooltip.SetDefault("Casts four celestial beams near the player\n" + + "Solar beams explode into fire on enemy hits\n" + + "Nebula beams sweep a little bit over time\n" + + "Vortex beams act like fast lightning and electrify enemies on hit\n" + + "Stardust beams release small stars that home on enemy hits"); Item.staff[item.type] = true; } @@ -67,8 +71,13 @@ namespace CalamityMod.Items.Weapons.Magic Vector2 spawnOffset = player.DirectionTo(Main.MouseWorld).RotatedBy(offsetAngle) * -Main.rand.NextFloat(40f, 96f); Vector2 shootDirection = (Main.MouseWorld - (position + spawnOffset)).SafeNormalize(Vector2.UnitX * player.direction); int beam = Projectile.NewProjectile(position + spawnOffset, shootDirection * shootSpeed, type, damage, knockBack, player.whoAmI); + + // Define specific values for fired lightning. if (type == ModContent.ProjectileType()) + { Main.projectile[beam].ai[0] = shootDirection.ToRotation(); + Main.projectile[beam].ai[1] = Main.rand.Next(100); + } return false; } diff --git a/Items/Weapons/Magic/NightsRay.cs b/Items/Weapons/Magic/NightsRay.cs index 7b4d0d00de..dcfb7353ea 100644 --- a/Items/Weapons/Magic/NightsRay.cs +++ b/Items/Weapons/Magic/NightsRay.cs @@ -12,7 +12,8 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetStaticDefaults() { DisplayName.SetDefault("Night's Ray"); - Tooltip.SetDefault("Fires a dark ray that splits if enemies are near it"); + Tooltip.SetDefault("Fires a dark ray\n" + + "When hitting enemies, they are hit by several new beams from their sides"); Item.staff[item.type] = true; } diff --git a/Items/Weapons/Magic/TerraRay.cs b/Items/Weapons/Magic/TerraRay.cs index 1affdf07ba..fba75d04ce 100644 --- a/Items/Weapons/Magic/TerraRay.cs +++ b/Items/Weapons/Magic/TerraRay.cs @@ -12,7 +12,8 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetStaticDefaults() { DisplayName.SetDefault("Terra Ray"); - Tooltip.SetDefault("Casts an energy ray that splits if enemies are near it"); + Tooltip.SetDefault("Casts an energy ray that splits into energy on enemy hits\n" + + "More energy is created the farther along the ray the hit enemy is"); Item.staff[item.type] = true; } diff --git a/Projectiles/Magic/BloodRay.cs b/Projectiles/Magic/BloodRay.cs index f82b5cf33e..c88aaefc00 100644 --- a/Projectiles/Magic/BloodRay.cs +++ b/Projectiles/Magic/BloodRay.cs @@ -48,11 +48,10 @@ namespace CalamityMod.Projectiles.Magic { int dustType = Main.rand.NextBool(4) ? 182 : (int)CalamityDusts.Brimstone; Vector2 dustSpawnPos = projectile.position - projectile.velocity * i / 2f; - Dust corruptMagic = Dust.NewDustPerfect(dustSpawnPos, dustType); - corruptMagic.scale = Main.rand.NextFloat(0.96f, 1.04f); - corruptMagic.scale *= MathHelper.Lerp(1f, 1.7f, Time / Lifetime); - corruptMagic.noGravity = true; - corruptMagic.velocity *= 0.1f; + Dust crimtameMagic = Dust.NewDustPerfect(dustSpawnPos, dustType); + crimtameMagic.scale = Main.rand.NextFloat(0.96f, 1.04f) * MathHelper.Lerp(1f, 1.7f, Time / Lifetime); + crimtameMagic.noGravity = true; + crimtameMagic.velocity *= 0.1f; } } } From 629277cb1a6991e715672bdff483f71511a60a57 Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 6 Nov 2020 21:58:05 -0600 Subject: [PATCH 015/202] Elemental beam color adjustments --- Projectiles/Magic/NebulaElementalBeam.cs | 5 +++-- Projectiles/Magic/SolarElementalBeam.cs | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Projectiles/Magic/NebulaElementalBeam.cs b/Projectiles/Magic/NebulaElementalBeam.cs index 528320b2fd..86b396809b 100644 --- a/Projectiles/Magic/NebulaElementalBeam.cs +++ b/Projectiles/Magic/NebulaElementalBeam.cs @@ -57,8 +57,9 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - DrawBeamWithColor(spriteBatch, Color.Lerp(Color.Lerp(Color.Purple, Color.White, 0.26f) * 1.1f, Color.Transparent, 0.25f), projectile.scale); - DrawBeamWithColor(spriteBatch, Color.Lerp(Color.Fuchsia * 1.1f, Color.Transparent, 0.25f), projectile.scale * 0.5f); + DrawBeamWithColor(spriteBatch, new Color(190, 29, 209), projectile.scale); + DrawBeamWithColor(spriteBatch, Color.Lerp(new Color(254, 126, 229), Color.Transparent, 0.35f), projectile.scale * 0.6f); + DrawBeamWithColor(spriteBatch, Color.Lerp(new Color(254, 190, 243), Color.Transparent, 0.35f), projectile.scale * 0.6f); return false; } } diff --git a/Projectiles/Magic/SolarElementalBeam.cs b/Projectiles/Magic/SolarElementalBeam.cs index ccd2f22f53..bce85a1d74 100644 --- a/Projectiles/Magic/SolarElementalBeam.cs +++ b/Projectiles/Magic/SolarElementalBeam.cs @@ -64,8 +64,8 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - DrawBeamWithColor(spriteBatch, Color.Lerp(Color.DarkOrange * 1.1f, Color.Transparent, 0.25f), projectile.scale); - DrawBeamWithColor(spriteBatch, Color.Lerp(Color.Yellow * 1.1f, Color.Transparent, 0.25f), projectile.scale * 0.5f); + DrawBeamWithColor(spriteBatch, Color.Lerp(Color.OrangeRed, Color.Transparent, 0.25f), projectile.scale); + DrawBeamWithColor(spriteBatch, Color.Lerp(Color.Yellow * 1.1f, Color.Transparent, 0.25f), projectile.scale * 0.4f); return false; } From 9a4a8e220c3a23fd3daa503cc89ad99c23467106 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sun, 8 Nov 2020 13:25:08 -0500 Subject: [PATCH 016/202] Polyp Launcher --- Items/Weapons/Summon/PolypLauncher.cs | 44 ++++++++ Items/Weapons/Summon/PolypLauncher.png | Bin 0 -> 951 bytes Projectiles/Summon/PolypLauncherProjectile.cs | 81 +++++++++++++++ .../Summon/PolypLauncherProjectile.png | Bin 0 -> 450 bytes Projectiles/Summon/PolypLauncherSentry.cs | 98 ++++++++++++++++++ Projectiles/Summon/PolypLauncherSentry.png | Bin 0 -> 1370 bytes Projectiles/Summon/PolypLauncherShrapnel.cs | 64 ++++++++++++ Projectiles/Summon/PolypLauncherShrapnel.png | Bin 0 -> 276 bytes Projectiles/Summon/PolypLauncherShrapnel2.png | Bin 0 -> 310 bytes Projectiles/Summon/PolypLauncherShrapnel3.png | Bin 0 -> 267 bytes 10 files changed, 287 insertions(+) create mode 100644 Items/Weapons/Summon/PolypLauncher.cs create mode 100644 Items/Weapons/Summon/PolypLauncher.png create mode 100644 Projectiles/Summon/PolypLauncherProjectile.cs create mode 100644 Projectiles/Summon/PolypLauncherProjectile.png create mode 100644 Projectiles/Summon/PolypLauncherSentry.cs create mode 100644 Projectiles/Summon/PolypLauncherSentry.png create mode 100644 Projectiles/Summon/PolypLauncherShrapnel.cs create mode 100644 Projectiles/Summon/PolypLauncherShrapnel.png create mode 100644 Projectiles/Summon/PolypLauncherShrapnel2.png create mode 100644 Projectiles/Summon/PolypLauncherShrapnel3.png diff --git a/Items/Weapons/Summon/PolypLauncher.cs b/Items/Weapons/Summon/PolypLauncher.cs new file mode 100644 index 0000000000..3f91391d98 --- /dev/null +++ b/Items/Weapons/Summon/PolypLauncher.cs @@ -0,0 +1,44 @@ +using CalamityMod.Projectiles.Summon; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Summon +{ + public class PolypLauncher : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Polyp Launcher"); + Tooltip.SetDefault("Summons a toad that explodes if enemies are nearby"); + } + + public override void SetDefaults() + { + item.damage = 12; + item.mana = 10; + item.width = 10; + item.height = 32; + item.useTime = item.useAnimation = 35; + item.useStyle = ItemUseStyleID.SwingThrow; + item.noMelee = true; + item.knockBack = 0f; + item.value = Item.buyPrice(0, 2, 0, 0); + item.rare = 2; + item.UseSound = SoundID.Item44; + item.autoReuse = true; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 10f; + item.summon = true; + } + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + //CalamityUtils.OnlyOneSentry(player, type); + Projectile.NewProjectile(Main.MouseWorld, Vector2.Zero, type, damage, knockBack, player.whoAmI, 20f); + player.UpdateMaxTurrets(); + return false; + } + } +} diff --git a/Items/Weapons/Summon/PolypLauncher.png b/Items/Weapons/Summon/PolypLauncher.png new file mode 100644 index 0000000000000000000000000000000000000000..09678f92718a90d58e21e2d8cf7c007818099edc GIT binary patch literal 951 zcmV;o14#UdP)Px#AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy24YJ`L;(K){{a7>y{D4^00RX{L_t(o!|j+oOjA)9hM!YfE)BK( zNENV(H3}MuqBxmIq7q}A(U>@y=*rB%z~JEQs*8h(0alGM#DM`9V$fis@dt_grA08> za&1d{9ZnDQTw78|vAL9YY47>Y`R>Vc-+t%o6_iMi&mK@;t?codJwgCfRCxeciX^nS zt5h4_s@%m+m_-hNg>(e~F-rjOCFRLPOl@A*IXON$o|Hs?CjhwG(+t3i;W=QJuqF$j z(Uk(=Wx@+U$S+YZCgiOf(yQ7cMOta)TSQyGOV}>u!LAIc{xP=&Foh)9+mge9Gs|-j=wGPs?jXR@Gl6#}VH2NtZ=f zGvnp%3jj<`ya%AEIRL=?ob1xNI=TTE8j)4wh}SIuI{lK_Y}{oxw}2f$xL^<8YCj6V z_dl!JXUC~FZC-oFNdSI?!yD%NYRdJEMwJ>W=xIBSaKRo{gt2*ds3N| zSdHhq_tebHrZ&9u2>Z@l1mJ{Q_OY$zf(7e!^X6L#yt>*e0Aevydjh`9cr<3_%wN8Q z68z6~8?5W505fUG>!q0C#jrTVE`a z`Q$jlYra!t;Gm4!jf#lBYOZN z9tBEIR>^UMMJO1|_o84+{pxnhafJT@4F&X#SA|Q#0000IbVXQnMOaBjI!|(GWo~p~ ZbZKvH05ODE?C$^o002ovPDHLkV1g$kt=0el literal 0 HcmV?d00001 diff --git a/Projectiles/Summon/PolypLauncherProjectile.cs b/Projectiles/Summon/PolypLauncherProjectile.cs new file mode 100644 index 0000000000..0163b72ee5 --- /dev/null +++ b/Projectiles/Summon/PolypLauncherProjectile.cs @@ -0,0 +1,81 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Buffs.StatDebuffs; + +namespace CalamityMod.Projectiles.DraedonsArsenal +{ + public class PolypLauncherProjectile : ModProjectile + { + public const float Gravity = 0.5f; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Polyp Chunk"); + ProjectileID.Sets.SentryShot[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.width = 18; + projectile.height = 18; + projectile.friendly = true; + projectile.tileCollide = true; + projectile.ignoreWater = true; + projectile.timeLeft = 300; + projectile.alpha = 255; + projectile.minion = true; + projectile.minionSlots = 0f; + } + + public override void AI() + { + if (projectile.velocity.Y <= 10f) + { + projectile.velocity.Y += Gravity; + } + projectile.ai[0]++; + if (projectile.ai[0] < 10) + { + projectile.alpha = (int)MathHelper.Lerp(255, 0, projectile.ai[0] / 10f); + } + projectile.tileCollide = projectile.alpha == 0; + projectile.rotation += (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y)) * 0.1f * projectile.direction; + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(SoundID.Item10, projectile.Center); + //Dust on impact + int dust_splash = 0; + while (dust_splash < 9) + { + Dust.NewDust(projectile.position, projectile.width, projectile.height, 180, -projectile.velocity.X * 0.15f, -projectile.velocity.Y * 0.15f, 120, default, 1.5f); + dust_splash += 1; + } + int split = 0; + int shardAmt = Main.rand.Next(1,5); + while (split < shardAmt) + { + //Calculate the velocity of the projectile + float shardspeedX = -projectile.velocity.X * Main.rand.NextFloat(.5f, .7f) + Main.rand.NextFloat(-3f, 3f); + float shardspeedY = -projectile.velocity.Y * Main.rand.Next(50, 70) * 0.01f + Main.rand.Next(-8, 9) * 0.2f; + //Prevents the projectile speed from being too low + if (shardspeedX < 2f && shardspeedX > -2f) + { + shardspeedX += -projectile.velocity.X; + } + if (shardspeedY > 2f && shardspeedY < 2f) + { + shardspeedY += -projectile.velocity.Y; + } + Vector2 shardSpeed = new Vector2(shardspeedX, shardspeedY); + + //Spawn the projectile + int shard = Projectile.NewProjectile(projectile.Center + shardSpeed, shardSpeed, ModContent.ProjectileType(), (int)(projectile.damage * 0.5), projectile.knockBack / 2f, projectile.owner, Main.rand.Next(3)); + split += 1; + } + } + } +} diff --git a/Projectiles/Summon/PolypLauncherProjectile.png b/Projectiles/Summon/PolypLauncherProjectile.png new file mode 100644 index 0000000000000000000000000000000000000000..d4fb7e3171ac1009c243b1d0b16fc32493a52cdc GIT binary patch literal 450 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+1|-AI^@Rf|mUKs7M+SzC{oH>NS%G}U;vjb? zhIQv;UIIA^$sR$z3=CCj3=9n|3=F@3LJcn%7)lKo7+xhXFj&oCU=S~uvn$XBD8ZKG z?e47F+Q#90zzf-` zCcT)7rg?|DHSUU~J#-2ybNNGw?60nSQ&Kj z%9O8evoCKhkH0=oUGHp8)(2G|5!G$e@BP(iICyNC!K&L#?iRftJJh7TgLGLong4#T zxjkB!Ay4nkkDs#MWpDR?+b#b1RY;Wj>x=u(tM;GK^froLo6^~rr5!otbQ&Kpd~&Q literal 0 HcmV?d00001 diff --git a/Projectiles/Summon/PolypLauncherSentry.cs b/Projectiles/Summon/PolypLauncherSentry.cs new file mode 100644 index 0000000000..df1132b9a5 --- /dev/null +++ b/Projectiles/Summon/PolypLauncherSentry.cs @@ -0,0 +1,98 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Summon +{ + public class PolypLauncherSentry : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Polyp Launcher"); + Main.projFrames[projectile.type] = 4; + ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.width = 42; + projectile.height = 28; + projectile.ignoreWater = true; + projectile.tileCollide = true; + projectile.sentry = true; + projectile.timeLeft = Projectile.SentryLifeTime; + projectile.penetrate = -1; + } + + public override void AI() + { + Player player = Main.player[projectile.owner]; + + if (projectile.localAI[0] == 0f) + { + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); + projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; + projectile.localAI[0] += 1f; + } + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) + { + int damage2 = (int)(projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / + projectile.Calamity().spawnedPlayerMinionDamageValue * + player.MinionDamage()); + projectile.damage = damage2; + } + + projectile.frameCounter++; + if (projectile.frameCounter > 4) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame >= Main.projFrames[projectile.type]) + { + projectile.frame = 0; + } + + projectile.velocity.Y += 0.5f; + if (projectile.velocity.Y > 10f) + { + projectile.velocity.Y = 10f; + } + + projectile.StickToTiles(false, false); + + if (projectile.ai[0] > 0f) + { + projectile.ai[0] -= 1f; + return; + } + projectile.ai[1] += Main.rand.Next(1,3); + + NPC potentialTarget = projectile.Center.MinionHoming(800f, player, false); + + if (projectile.owner == Main.myPlayer && potentialTarget != null) + { + if (projectile.ai[1] > 40f) + { + Vector2 spawnPosition = new Vector2(projectile.oldPosition.X + (projectile.width / 2), projectile.oldPosition.Y + (projectile.height / 2)); + + float shootSpeed = 9f; + float gravity = -PolypLauncherProjectile.Gravity; + float distance = Vector2.Distance(spawnPosition, potentialTarget.Center); + float angle = 0.5f * (float)Math.Asin(MathHelper.Clamp(gravity * distance / (float)Math.Pow(shootSpeed, 2), -1f, 1f)); + + Vector2 velocity = new Vector2(0f, -shootSpeed).RotatedBy(angle).RotatedByRandom(0.015f); + velocity.X *= (potentialTarget.Center.X - projectile.Center.X < 0).ToDirectionInt(); + + Projectile.NewProjectile(spawnPosition, velocity, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner); + projectile.ai[1] = 0f; + projectile.netUpdate = true; + } + } + } + + public override bool OnTileCollide(Vector2 oldVelocity) => false; + + public override bool CanDamage() => false; + } +} diff --git a/Projectiles/Summon/PolypLauncherSentry.png b/Projectiles/Summon/PolypLauncherSentry.png new file mode 100644 index 0000000000000000000000000000000000000000..605f9b0719a79b682c89a84357ad52e6149d5fe2 GIT binary patch literal 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q)$ literal 0 HcmV?d00001 diff --git a/Projectiles/Summon/PolypLauncherShrapnel.cs b/Projectiles/Summon/PolypLauncherShrapnel.cs new file mode 100644 index 0000000000..faed08d1e7 --- /dev/null +++ b/Projectiles/Summon/PolypLauncherShrapnel.cs @@ -0,0 +1,64 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Summon +{ + public class PolypLauncherShrapnel : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Polyp Shrapnel"); + ProjectileID.Sets.SentryShot[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.friendly = true; + projectile.width = 13; + projectile.height = 13; + projectile.ignoreWater = true; + projectile.timeLeft = 120 + projectile.minion = true; + projectile.minionSlots = 0f; + } + + public override void AI() + { + //Rotation and gravity + projectile.rotation += 0.6f * projectile.direction; + projectile.velocity.Y += 0.27f; + if (projectile.velocity.Y > 16f) + { + projectile.velocity.Y = 16f; + } + } + + public override void Kill(int timeLeft) + { + //Dust effect + int splash = 0; + while (splash < 4) + { + Dust.NewDust(projectile.position, projectile.width, projectile.height, 67, -projectile.velocity.X * 0.15f, -projectile.velocity.Y * 0.10f, 150, default, 0.9f); + splash += 1; + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + //Changes the texture of the projectile + Texture2D texture = Main.projectileTexture[projectile.type]; + if (projectile.ai[0] == 1f) + { + texture = ModContent.GetTexture("CalamityMod/Projectiles/Summon/PolypLauncherShrapnel2"); + } + if (projectile.ai[0] == 2f) + { + texture = ModContent.GetTexture("CalamityMod/Projectiles/Summon/PolypLauncherShrapnel3"); + } + Main.spriteBatch.Draw(texture, projectile.Center - Main.screenPosition, new Rectangle?(new Rectangle(0, 0, texture.Width, texture.Height)), projectile.GetAlpha(lightColor), projectile.rotation, texture.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); + return false; + } + } +} diff --git a/Projectiles/Summon/PolypLauncherShrapnel.png b/Projectiles/Summon/PolypLauncherShrapnel.png new file mode 100644 index 0000000000000000000000000000000000000000..94fe76c6508bd1d7d301443c99184fc6d3b27410 GIT binary patch literal 276 zcmeAS@N?(olHy`uVBq!ia0vp^AT|dF8<0HkD{mW+Vo7)Ob!1@J*w6hZkrl{iEDmya zVpw-h<|UA$kn9oU%fL{j#=y|f!octgDAe$RfuYoZf#FpG1B2BJ1_tqhIlBUFfD&v; z-tI08|3PrU-sO{lB1xVujv*44lXWfyrz8MD#n1kq_RL}hZw~Xbfq)vD5+nB+74vQH zc|c%yU7?Wy5Ii~gzh%}5hgqFHT}DR#B_$*z!d@6J@^Fc1vAEeZzj30C@I}TmON8Y; zOOzR6Pm8zx{&nsx&^DnG*9ai;bhGj=%1q5GNi50C&toubiForKD9hmK>gTe~DWM4f D4q#TV literal 0 HcmV?d00001 diff --git a/Projectiles/Summon/PolypLauncherShrapnel2.png b/Projectiles/Summon/PolypLauncherShrapnel2.png new file mode 100644 index 0000000000000000000000000000000000000000..08c20fef7397ad08b46f394c45afbd6fa3c5a168 GIT binary patch literal 310 zcmeAS@N?(olHy`uVBq!ia0vp^AT}2V8<6ZZI=>f4v7|ftIx;Y9?C1WI$O_~$76-XI zF|0c$^AgBWNcITwWnidMV_;}#VPNsOyYEX z%JxHND_mEtU%#hyMd-s{r#VU=*Mm$*maj7afrt;r29r{h7!o^_6w+&=ih=GCDshbf kB2PCf|Dw#)ypqI{%=|nC!zopr022ajApigX literal 0 HcmV?d00001 diff --git a/Projectiles/Summon/PolypLauncherShrapnel3.png b/Projectiles/Summon/PolypLauncherShrapnel3.png new file mode 100644 index 0000000000000000000000000000000000000000..b4ca87e39cf273780333ec11cdb7373bfab6e2dd GIT binary patch literal 267 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqEa{HEjtmSN`?>!lvI6;x#X;^) z4C~IxyaaL-l0AZa85pY67#JE_7#My5g&JNkFq9fFFuY1&V6d9Oz#v{QXIG#NP=YPV z+ueoXKL{?^yL>WGB+}ExF+}2Wa?iEEpXVD`_x$`iePSaJbT%?1G#cKyvCr552;TfU zdh!4e6uiFu{{NAg1#b@XcW@>NG}`=}&jSL-?Hqov_$Gu*nRxIOH+LP|qZ&qrOhw_q vU$_2=11%9Mag6{XPd6+7qRiC1lEjkC{5%H3mWVg+fwByqu6{1-oD!M Date: Sun, 8 Nov 2020 13:44:48 -0500 Subject: [PATCH 017/202] Polyp Launcher fixes --- Projectiles/Summon/PolypLauncherProjectile.cs | 4 ++-- Projectiles/Summon/PolypLauncherSentry.cs | 1 + Projectiles/Summon/PolypLauncherShrapnel.cs | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Projectiles/Summon/PolypLauncherProjectile.cs b/Projectiles/Summon/PolypLauncherProjectile.cs index 0163b72ee5..f7bcbafbd6 100644 --- a/Projectiles/Summon/PolypLauncherProjectile.cs +++ b/Projectiles/Summon/PolypLauncherProjectile.cs @@ -1,11 +1,11 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using CalamityMod.Buffs.StatDebuffs; -namespace CalamityMod.Projectiles.DraedonsArsenal +namespace CalamityMod.Projectiles.Summon { public class PolypLauncherProjectile : ModProjectile { diff --git a/Projectiles/Summon/PolypLauncherSentry.cs b/Projectiles/Summon/PolypLauncherSentry.cs index df1132b9a5..c44dfe3185 100644 --- a/Projectiles/Summon/PolypLauncherSentry.cs +++ b/Projectiles/Summon/PolypLauncherSentry.cs @@ -1,4 +1,5 @@ using Microsoft.Xna.Framework; +using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Summon/PolypLauncherShrapnel.cs b/Projectiles/Summon/PolypLauncherShrapnel.cs index faed08d1e7..bc7e418942 100644 --- a/Projectiles/Summon/PolypLauncherShrapnel.cs +++ b/Projectiles/Summon/PolypLauncherShrapnel.cs @@ -1,6 +1,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { @@ -18,7 +19,7 @@ namespace CalamityMod.Projectiles.Summon projectile.width = 13; projectile.height = 13; projectile.ignoreWater = true; - projectile.timeLeft = 120 + projectile.timeLeft = 120; projectile.minion = true; projectile.minionSlots = 0f; } From de256aaa81ca6d1ba002058169ae69c54d19577d Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sun, 8 Nov 2020 18:02:53 -0500 Subject: [PATCH 018/202] polyp launcher adjustments --- Items/Weapons/Summon/PolypLauncher.cs | 2 +- NPCs/TownNPCs/SEAHOE.cs | 2 ++ Projectiles/Summon/PolypLauncherProjectile.cs | 5 ++--- Projectiles/Summon/PolypLauncherSentry.cs | 8 ++++---- Projectiles/Summon/PolypLauncherShrapnel.cs | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Items/Weapons/Summon/PolypLauncher.cs b/Items/Weapons/Summon/PolypLauncher.cs index 3f91391d98..faee489bb3 100644 --- a/Items/Weapons/Summon/PolypLauncher.cs +++ b/Items/Weapons/Summon/PolypLauncher.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetStaticDefaults() { DisplayName.SetDefault("Polyp Launcher"); - Tooltip.SetDefault("Summons a toad that explodes if enemies are nearby"); + Tooltip.SetDefault("Summons a polyp bunch that launches coral chunks at nearby enemies"); } public override void SetDefaults() diff --git a/NPCs/TownNPCs/SEAHOE.cs b/NPCs/TownNPCs/SEAHOE.cs index 6ca6b7ac25..d82b1fcb58 100644 --- a/NPCs/TownNPCs/SEAHOE.cs +++ b/NPCs/TownNPCs/SEAHOE.cs @@ -374,6 +374,8 @@ namespace CalamityMod.NPCs.TownNPCs nextSlot++; shop.item[nextSlot].SetDefaults(ModContent.ItemType()); nextSlot++; + shop.item[nextSlot].SetDefaults(ModContent.ItemType()); + nextSlot++; if (CalamityWorld.downedDesertScourge) { shop.item[nextSlot].SetDefaults(ModContent.ItemType()); diff --git a/Projectiles/Summon/PolypLauncherProjectile.cs b/Projectiles/Summon/PolypLauncherProjectile.cs index f7bcbafbd6..fc0eeee785 100644 --- a/Projectiles/Summon/PolypLauncherProjectile.cs +++ b/Projectiles/Summon/PolypLauncherProjectile.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Projectiles.Summon { public class PolypLauncherProjectile : ModProjectile { - public const float Gravity = 0.5f; + public const float Gravity = 0.4f; public override void SetStaticDefaults() { DisplayName.SetDefault("Polyp Chunk"); @@ -40,7 +40,6 @@ namespace CalamityMod.Projectiles.Summon { projectile.alpha = (int)MathHelper.Lerp(255, 0, projectile.ai[0] / 10f); } - projectile.tileCollide = projectile.alpha == 0; projectile.rotation += (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y)) * 0.1f * projectile.direction; } @@ -51,7 +50,7 @@ namespace CalamityMod.Projectiles.Summon int dust_splash = 0; while (dust_splash < 9) { - Dust.NewDust(projectile.position, projectile.width, projectile.height, 180, -projectile.velocity.X * 0.15f, -projectile.velocity.Y * 0.15f, 120, default, 1.5f); + Dust.NewDust(projectile.position, projectile.width, projectile.height, 225, -projectile.velocity.X * 0.15f, -projectile.velocity.Y * 0.15f, 120, default, 1f); dust_splash += 1; } int split = 0; diff --git a/Projectiles/Summon/PolypLauncherSentry.cs b/Projectiles/Summon/PolypLauncherSentry.cs index c44dfe3185..88b104c1c1 100644 --- a/Projectiles/Summon/PolypLauncherSentry.cs +++ b/Projectiles/Summon/PolypLauncherSentry.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetDefaults() { projectile.width = 42; - projectile.height = 28; + projectile.height = 25; projectile.ignoreWater = true; projectile.tileCollide = true; projectile.sentry = true; @@ -77,12 +77,12 @@ namespace CalamityMod.Projectiles.Summon { Vector2 spawnPosition = new Vector2(projectile.oldPosition.X + (projectile.width / 2), projectile.oldPosition.Y + (projectile.height / 2)); - float shootSpeed = 9f; + float shootSpeed = 16f; float gravity = -PolypLauncherProjectile.Gravity; float distance = Vector2.Distance(spawnPosition, potentialTarget.Center); - float angle = 0.5f * (float)Math.Asin(MathHelper.Clamp(gravity * distance / (float)Math.Pow(shootSpeed, 2), -1f, 1f)); + float angle = 0.25f * (float)Math.Asin(MathHelper.Clamp(gravity * distance * 1.5f / (float)Math.Pow(shootSpeed, 2), -1f, 1f)); - Vector2 velocity = new Vector2(0f, -shootSpeed).RotatedBy(angle).RotatedByRandom(0.015f); + Vector2 velocity = new Vector2(0f, -shootSpeed).RotatedBy(angle).RotatedByRandom(0.1f); velocity.X *= (potentialTarget.Center.X - projectile.Center.X < 0).ToDirectionInt(); Projectile.NewProjectile(spawnPosition, velocity, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner); diff --git a/Projectiles/Summon/PolypLauncherShrapnel.cs b/Projectiles/Summon/PolypLauncherShrapnel.cs index bc7e418942..69dff708fe 100644 --- a/Projectiles/Summon/PolypLauncherShrapnel.cs +++ b/Projectiles/Summon/PolypLauncherShrapnel.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Projectiles.Summon int splash = 0; while (splash < 4) { - Dust.NewDust(projectile.position, projectile.width, projectile.height, 67, -projectile.velocity.X * 0.15f, -projectile.velocity.Y * 0.10f, 150, default, 0.9f); + Dust.NewDust(projectile.position, projectile.width, projectile.height, 225, -projectile.velocity.X * 0.15f, -projectile.velocity.Y * 0.10f, 150, default, 0.7f); splash += 1; } } From 17023d9540e6f3bf40430a4d72c2b5fcc13101c1 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Mon, 9 Nov 2020 20:37:12 -0600 Subject: [PATCH 019/202] Changed flowers of mortality a touch --- Projectiles/Summon/FlowersOfMortalityPetal.cs | 2 +- Projectiles/Summon/MortalityBeam.cs | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Projectiles/Summon/FlowersOfMortalityPetal.cs b/Projectiles/Summon/FlowersOfMortalityPetal.cs index bc0ab14fd7..17244ae025 100644 --- a/Projectiles/Summon/FlowersOfMortalityPetal.cs +++ b/Projectiles/Summon/FlowersOfMortalityPetal.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Summon NPC potentialTarget = projectile.Center.MinionHoming(1050f, Owner, false); if (Time % 25 == 24 && Main.myPlayer == projectile.owner && potentialTarget != null) { - Vector2 shootVelocity = projectile.DirectionTo(potentialTarget.Center) * 16f; + Vector2 shootVelocity = projectile.DirectionTo(potentialTarget.Center) * 10f; Projectile.NewProjectile(projectile.Center, shootVelocity, ModContent.ProjectileType(), projectile.damage / 3, projectile.knockBack, projectile.owner); } projectile.Center = player.Center + OffsetAngle.ToRotationVector2() * (150f + (float)Math.Sin(Time * 0.08f) * 15f); diff --git a/Projectiles/Summon/MortalityBeam.cs b/Projectiles/Summon/MortalityBeam.cs index 4c50e1da1c..3faca61c1d 100644 --- a/Projectiles/Summon/MortalityBeam.cs +++ b/Projectiles/Summon/MortalityBeam.cs @@ -1,14 +1,16 @@ 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.Summon { public class MortalityBeam : ModProjectile { + public ref float Time => ref projectile.ai[0]; public override void SetStaticDefaults() { DisplayName.SetDefault("Beam"); @@ -34,18 +36,23 @@ namespace CalamityMod.Projectiles.Summon Lighting.AddLight(projectile.Center, Color.White.ToVector3()); if (!Main.dedServ) { - for (int i = 0; i < 7; i++) + for (int i = -1; i <= 1; i += 2) { - Dust rainbowDust = Dust.NewDustPerfect(projectile.Center + Main.rand.NextVector2Circular(5f, 5f), 261); + float offset = (float)Math.Sin(Time / 45f * MathHelper.TwoPi) * 10f * i; + Vector2 rotatedOffset = new Vector2(offset, 2f).RotatedBy(projectile.velocity.ToRotation() + MathHelper.PiOver2); + + Dust rainbowDust = Dust.NewDustPerfect(projectile.Center + rotatedOffset, 261); rainbowDust.color = Main.hslToRgb(Main.rand.NextFloat(), 0.9f, 0.5f); - rainbowDust.velocity += projectile.velocity; + rainbowDust.velocity = Vector2.Zero; + rainbowDust.scale = 1.5f; rainbowDust.noGravity = true; } } + Time++; NPC potentialTarget = projectile.Center.MinionHoming(1000f, Main.player[projectile.owner], false); if (potentialTarget != null) - projectile.velocity = (projectile.velocity * 5f + projectile.DirectionTo(potentialTarget.Center) * 20f) / 6f; + projectile.velocity = (projectile.velocity * 5f + projectile.DirectionTo(potentialTarget.Center) * 13f) / 6f; } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) From cd3b3beb01a2267390bff07d96a54ffdc5e31952 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 14 Nov 2020 00:20:53 -0600 Subject: [PATCH 020/202] Added the Rainbow Party Cannon --- Items/Weapons/Magic/RainbowPartyCannon.cs | 60 ++ Items/Weapons/Magic/RainbowPartyCannon.png | Bin 0 -> 1689 bytes Projectiles/Magic/PartyComet.cs | 100 +++ Projectiles/Magic/PartyComet.png | Bin 0 -> 2677 bytes Projectiles/Magic/PartySparkle.cs | 120 +++ Projectiles/Magic/PartySparkle.png | Bin 0 -> 3066 bytes .../Magic/RainbowPartyCannonProjectile.cs | 103 +++ .../Magic/RainbowPartyCannonProjectile.png | Bin 0 -> 1302 bytes Projectiles/Magic/RainbowRocket.cs | 700 ++++++++++++++++++ Projectiles/Magic/RainbowRocket.png | Bin 0 -> 962 bytes 10 files changed, 1083 insertions(+) create mode 100644 Items/Weapons/Magic/RainbowPartyCannon.cs create mode 100644 Items/Weapons/Magic/RainbowPartyCannon.png create mode 100644 Projectiles/Magic/PartyComet.cs create mode 100644 Projectiles/Magic/PartyComet.png create mode 100644 Projectiles/Magic/PartySparkle.cs create mode 100644 Projectiles/Magic/PartySparkle.png create mode 100644 Projectiles/Magic/RainbowPartyCannonProjectile.cs create mode 100644 Projectiles/Magic/RainbowPartyCannonProjectile.png create mode 100644 Projectiles/Magic/RainbowRocket.cs create mode 100644 Projectiles/Magic/RainbowRocket.png diff --git a/Items/Weapons/Magic/RainbowPartyCannon.cs b/Items/Weapons/Magic/RainbowPartyCannon.cs new file mode 100644 index 0000000000..fa0d522cdc --- /dev/null +++ b/Items/Weapons/Magic/RainbowPartyCannon.cs @@ -0,0 +1,60 @@ +using CalamityMod.Projectiles.Magic; +using Microsoft.Xna.Framework; +using System.Collections.Generic; +using System.Linq; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Magic +{ + public class RainbowPartyCannon : ModItem + { + public static readonly Color[] ColorSet = new Color[] + { + new Color(188, 192, 193), // White + new Color(157, 100, 183), // Purple + new Color(249, 166, 77), // Honey-ish orange + new Color(255, 105, 234), // Pink + new Color(67, 204, 219), // Sky blue + new Color(249, 245, 99), // Bright yellow + new Color(236, 168, 247), // Purplish pink + }; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Rainbow Party Cannon"); + Tooltip.SetDefault("You should never see this lol"); + } + + public override void SetDefaults() + { + item.damage = 2200; + item.magic = true; + item.mana = 25; + item.width = 52; + item.height = 30; + item.crit += 4; + item.useTime = item.useAnimation = 24; + item.useStyle = ItemUseStyleID.HoldingOut; + item.noMelee = true; + item.knockBack = 3.5f; + item.value = CalamityGlobalItem.RarityHotPinkBuyPrice; + item.rare = 10; + item.Calamity().customRarity = CalamityRarity.Developer; + item.UseSound = SoundID.Item11; + item.autoReuse = true; + item.noUseGraphic = true; + item.shoot = ModContent.ProjectileType(); + item.channel = true; + item.shootSpeed = 20f; + } + + public static string DiscoHex => $"c/{(int)MathHelper.Lerp(156f, 255f, Main.DiscoR / 256f):X2}{108:X2}{251:X2}:"; + + public override void ModifyTooltips(List tooltips) + { + var tt2 = tooltips.FirstOrDefault(x => x.Name == "Tooltip0" && x.mod == "Terraria"); + tt2.text = $"[" + DiscoHex + "Let the rainbow remind you that together we will always shine...]"; + } + } +} diff --git a/Items/Weapons/Magic/RainbowPartyCannon.png b/Items/Weapons/Magic/RainbowPartyCannon.png new file mode 100644 index 0000000000000000000000000000000000000000..10b7ca96e9319f4bb980dcce2fd6edb911e8358b GIT binary patch literal 1689 zcmeAS@N?(olHy`uVBq!ia0vp^F+l9Z!3-qdzIAK_QjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn~YUU}gyL32_CATUj}>2JuIm^5?L!hI1C^l2Q7{?;LoNiir1w4m z<`agJAirQ>G9Jl*A^1DHDlh^$3p^r=85sBuf-vKbiP>)%7?{L7T^vIq+^=4H9o6I@ z()!TCWs+Z+!|wmuOZTR&l`RU`IB({g-wO>4_5GPw@c&J6UDz8xRjhu?mfE1iOyjoN zWsRXrkL}Jo=Rb2%Mez0y^{xJu_6Mu%Z10s`=DgU~`<=i2_rc%$*6n^*vFAv#Bi}}8 z{fweL>-xnM^>-OQy0x>>ulM@b&93v*3mR_Ume_8&Z{L+2?s9@%^Bx}j^@F4F_pI%! zwpheD?B5p_dfRKehvJ0;7i%9b2~6cx&sg)nd4EKx>z>?$%5fJ2{!DY3Rlo6y#m`-8 zy>s$seane4(vRAF=`n}+=etaQQxYTn^3Q6_%dJ_pY~f7ia;f*Tc?;&NSRdP%{ZQhm+r&d*F>*i07B1F=^ zSMU4fA2=uEvuH=<1JCEj{stvE{+av3lCROGH!g1u_vY;<^dFzTv*V9N!jt6+dajJu zw`_iT_@_W?!_f~%4<2qd{IBu(9q)J51MCdb(<@s1qMe@~Jvlke+vL(i@zdSS&x;gt z8o%u~co(a0&X-a#p@2K<$Fon5J+wb0OQ;_C{f|56tKy>x+wG5m^1Y|4pUXO@geCyg C+gm9B literal 0 HcmV?d00001 diff --git a/Projectiles/Magic/PartyComet.cs b/Projectiles/Magic/PartyComet.cs new file mode 100644 index 0000000000..8a4976c8f0 --- /dev/null +++ b/Projectiles/Magic/PartyComet.cs @@ -0,0 +1,100 @@ +using CalamityMod.Items.Weapons.Magic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Magic +{ + public class PartyComet : ModProjectile + { + public ref float Time => ref projectile.ai[0]; + public const float FadeinTime = 40f; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Comet"); + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 12; + Main.projFrames[projectile.type] = 3; + } + + public override void SetDefaults() + { + projectile.width = 72; + projectile.height = 72; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.magic = true; + projectile.timeLeft = 300; + projectile.usesLocalNPCImmunity = true; + projectile.alpha = 255; + projectile.localNPCHitCooldown = 16; + } + + public override void AI() + { + Time++; + projectile.Opacity = Utils.InverseLerp(0f, 20f, Time, true); + projectile.velocity = projectile.velocity.RotatedBy(Math.Sin(Time / 30f) * 0.0125f); + projectile.rotation = projectile.velocity.ToRotation() - MathHelper.PiOver2; + + projectile.frameCounter++; + if (projectile.frameCounter % 4 == 3) + projectile.frame = (projectile.frame + 1) % Main.projFrames[projectile.type]; + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D cometTexture = ModContent.GetTexture(Texture); + spriteBatch.Draw(cometTexture, + projectile.Center + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition, + cometTexture.Frame(1, Main.projFrames[projectile.type], 0, projectile.frame), + Color.White * projectile.Opacity, + projectile.rotation, + cometTexture.Size() * 0.5f, + projectile.scale, + SpriteEffects.None, + 0f); + return false; + } + public override void Kill(int timeLeft) + { + if (projectile.owner == Main.myPlayer) + { + // Generate pretty sparkles. + for (int i = 0; i < 18; i++) + { + Vector2 velocity = Vector2.UnitY.RotatedByRandom(MathHelper.TwoPi) * Main.rand.NextFloat(9f, 20f); + Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), projectile.damage, 1f, projectile.owner); + } + + // And release a bunch of rockets. + Vector2 baseDirection = projectile.velocity.SafeNormalize(-Vector2.UnitY).RotatedBy(MathHelper.PiOver2 * Math.Sign(Math.Cos(projectile.velocity.ToRotation()))); + for (int i = 0; i < (int)RainbowRocket.PartyCannonExplosionType.Count; i++) + { + Vector2 velocity = -projectile.velocity.SafeNormalize(-Vector2.UnitY); + velocity = velocity.RotatedBy(MathHelper.Lerp(-1.1f, 1.1f, i / (float)(int)RainbowRocket.PartyCannonExplosionType.Count)); + velocity *= Main.rand.NextFloat(7f, 15f); + + Projectile rocket = Projectile.NewProjectileDirect(projectile.Center, velocity, ModContent.ProjectileType(), projectile.damage * 3, 1f, projectile.owner); + rocket.ai[1] = i; + } + } + + if (!Main.dedServ) + { + for (int i = 0; i < 80; i++) + { + Dust dust = Dust.NewDustPerfect(projectile.Center, 263); + dust.color = CalamityUtils.MulticolorLerp((Main.rand.NextFloat(0.4f) + Main.GlobalTime * 0.4f) % 0.999f, RainbowPartyCannon.ColorSet); + dust.scale = Main.rand.NextFloat(0.6f, 0.9f); + dust.velocity = Vector2.UnitY.RotatedByRandom(MathHelper.TwoPi) * Main.rand.NextFloat(12f, 16f); + dust.noGravity = true; + } + } + + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LargeWeaponFire").WithVolume(0.45f), projectile.Center); + } + } +} diff --git a/Projectiles/Magic/PartyComet.png b/Projectiles/Magic/PartyComet.png new file mode 100644 index 0000000000000000000000000000000000000000..b713356be91cf322d7f20e08a5125b2d4aa95709 GIT binary patch literal 2677 zcmX|@dpr~BAIG0nYF5f}$z?ceiYTFSY`L9THpHZbF-}N?F0M2CxfJ^~2XiTxq9IDc z9Cb#Mu_IFM4u#1Z?mDj?T>0~DU{3#)vHoY5ru$#Kn2q5J=R-a`4G9-Nzc<`E$BXE!&b#=j zt&P1l`^!PgLSD7b#xxKNu_N-F<(!$9%4Asz4V75qmyBJ>HSe<*r4tgZk+9bCKr%y~ z@$O#I({UIk(-dHg#USEYYL&~YrC)^ z?Z(Srdxgv|DcKJr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}A`u<%_)g&5Q zqFOkhEU*%yfM9{wjgd<7`TfofR~IxZRD60EAv_kT;OhO{gU}sov;%zlI-d?r8-KN~ z$G_n>eW83y?8|U|%L(_VZV&;tsoG{gj)hvWt4X@8>vkh`oZ#YNQGm1a8f69*T{Ihy zeJkIhQ#81R*`>*7=XPEkZnFKb5Lc0zHBP9shB2_0RNI&4*!c*&wzX&H(W3wi(MMRg zqY4(SbNj5HeHQ_RHTaIrM_)A!R?iJEzWQs?B}d(mgh zw$pfjoPuYbk#ll`o?&fUwPbO`s92nTO6h@plLRvD_=e6~c%jeaIq@KTfc6y~)^oNM zwQyxtc$%c8?z2NuOZn+t2GmW9qJV2!P##NGy+c;-rb+IC=(M@kKMek#=)?!__1R(P z{9Y;`FU|%~2nEuxgr7sI(#cEGGVjjQa1tJn-ivxX<-vUCnn3h<+u#cybzUZ zs9Xo6kgD!szx!};s-q|4S|AHv{5i8%K4YAq&R8Lu?^#2!yWFWwQ4bxL@JTD=rFB%L z>^M`Q;m{9pe9E1vQf5#iY*e0NC33n6^J)YPL>H5bhWrQ^)vczWm)cZp-*72-XCq9D}cVURYU3w zbW&+^bY~=&F!*F|=9w4paRO)CSu2_HyINI4r8D%IhsvD;v2kX)`?eY$)G6yLn|~|* zK=X3YaP8+|He@a)d1Sjft-ZG2=5u=rtfM+2BDaBSo?pETxy1t~4RTukYmA@PJ3Oua-Zaep zK#6JNyS}m@Fw&@%C&^E^B6_{S8R^K@MR5!&P~~c5gPo^4DCE0afM}+VOuekrrEC*< z-|)?w{5)IKPsDF~hdP)4(5P#VTBqhLe>mhGF3NqKnNU)k7Y@#^XR04!qeGz projectile.ai[0]; + set => projectile.ai[0] = value; + } + public float ColorSpectrumHue + { + get => projectile.ai[1]; + set => projectile.ai[1] = value; + } + public const int Lifetime = 90; + public const int FadeinTime = 18; + public const int FadeoutTime = 18; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Pretty Sparkle"); + } + + public override void SetDefaults() + { + projectile.width = 72; + projectile.height = 72; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.magic = true; + projectile.timeLeft = Lifetime; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + projectile.scale = 0.001f; + } + + public override void AI() + { + if (Time == 1f) + { + projectile.scale = Main.rand.NextFloat(0.4f, 1.1f); + CalamityGlobalProjectile.ExpandHitboxBy(projectile, (int)(72 * projectile.scale)); + ColorSpectrumHue = Main.rand.NextFloat(0f, 0.9999f); + projectile.netUpdate = true; + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; + } + Time++; + + projectile.velocity *= 0.96f; + + projectile.rotation = projectile.rotation.AngleLerp(MathHelper.PiOver2, 0.085f); + + ColorSpectrumHue = (ColorSpectrumHue + 0.333f / Lifetime) % 0.999f; // Go 33% across the color spectrum throughout the sparkle's life instead of using a static sprite. + + projectile.Opacity = Utils.InverseLerp(0f, FadeinTime, Time, true) * Utils.InverseLerp(Lifetime, Lifetime - FadeoutTime, Time, true); + projectile.velocity = projectile.velocity.RotatedBy(Math.Sin(Time / 30f) * 0.0125f); + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D sparkleTexture = ModContent.GetTexture(Texture); + + Color sparkleColor = CalamityUtils.MulticolorLerp(ColorSpectrumHue, RainbowPartyCannon.ColorSet) * projectile.Opacity * 0.5f; + sparkleColor.A = 0; + + sparkleColor *= MathHelper.Lerp(1f, 1.5f, Utils.InverseLerp(Lifetime * 0.5f - 15f, Lifetime * 0.5f + 15f, Time, true)); + + Color orthogonalsparkleColor = Color.Lerp(sparkleColor, Color.White, 0.5f) * 0.5f; + + Vector2 origin = sparkleTexture.Size() / 2f; + + Vector2 sparkleScale = new Vector2(0.3f, 1f) * projectile.Opacity * projectile.scale; + Vector2 orthogonalsparkleScale = new Vector2(0.3f, 2f) * projectile.Opacity * projectile.scale; + + spriteBatch.Draw(sparkleTexture, + projectile.Center - Main.screenPosition + Vector2.UnitY * projectile.gfxOffY, + null, + sparkleColor, + MathHelper.PiOver2 + projectile.rotation, + origin, + orthogonalsparkleScale, + SpriteEffects.None, + 0f); + spriteBatch.Draw(sparkleTexture, + projectile.Center - Main.screenPosition + Vector2.UnitY * projectile.gfxOffY, + null, + sparkleColor, + projectile.rotation, + origin, + sparkleScale, + SpriteEffects.None, + 0f); + spriteBatch.Draw(sparkleTexture, + projectile.Center - Main.screenPosition + Vector2.UnitY * projectile.gfxOffY, + null, + orthogonalsparkleColor, + MathHelper.PiOver2 + projectile.rotation, + origin, + orthogonalsparkleScale * 0.6f, + SpriteEffects.None, + 0f); + spriteBatch.Draw(sparkleTexture, + projectile.Center - Main.screenPosition + Vector2.UnitY * projectile.gfxOffY, + null, + orthogonalsparkleColor, + projectile.rotation, + origin, + sparkleScale * 0.6f, + SpriteEffects.None, + 0f); + return false; + } + } +} diff --git a/Projectiles/Magic/PartySparkle.png b/Projectiles/Magic/PartySparkle.png new file mode 100644 index 0000000000000000000000000000000000000000..0968156e79f880c08816086f5cac6b8bd7c93d37 GIT binary patch literal 3066 zcmVPx#1ZP1_K>z@;j|==^1poj6BT!6KMF0Q*0s;a90|NvE1O){J1_lNQ2nY!Y2@4Ag z3=9m##l;N`4Gsz?O-)TuP*7AN$ts000VgNkl*~!l*IaYW zHH{nTuMEFeLHq9eBmJduSpr?eK9?faLHdj2%6)9sa1q7tmGdCTaPwP`;abl9R$Zz< zRfMy!L%=I7(9T>#ac%@Z0(^Fj!ki4Zn7L`^BG!2bwCctT1&QYDtqP5r5MzQ}wy!seR#$pxP^AFg@x=FNZbPoF;h zBi@Iu!r*EfGTsu(^9rj4a?wj!B@X-)svLkg z@S$|DIInKU;o;%!TeoiA4j=B;?M%6GAM@~DYoTo9=J4H?-JXzXdJm2X83O&2XR0g_ zXe*I78x|8qOOP4|K9Gdrz}4srL5?DB0ueKoLe*IF$whAJaBlYW-pN*t`>i7rNjfCKY#uwzKN1wvF`ysz#EML-(tl09hqS)*6KawHRPzq9^sov zVVtSe)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sZvT&- zHr~Ig6SeWVru~|K{rdI4@z0(;`x(#Sbixndyb0~27Jd5IbQ$&EUhTFqhc)(@7ur|5iKW_`TDnZ9#Jr(6 zx@lcF%~F9zH*_IrLkwAnpSBJ_UxaZ!(cVYI9Nb1OAZFZi?9=>WR?aZJm}6NJCuxE( zH^bHJb%QEYlD;QW(5^i(7PK2hgShr9Vc_;q6kEwBaez3N_iD+mA+tBftPzN$y~GrT z&sv}r2GotyNdnqw^hp53${W%IavyW5v5Ym$jdpwAbh|aw?lPV2_Q08MP%S{^ZHojw zp*SRte!MNyD5v`fbDk6>PfU^cpiMg1cTSwGhdjs9Z?Q2(zuACqr}XM8?e_N|n))Zl zrYHxN=g{sezTIRzjEDnmd?`DNTR?Ap6$yNJbWuk@A7pd(59dB;5u+V4!X`rPKQD3M ztOCJSjwzuaLXFiv Main.player[projectile.owner]; + public ref float Time => ref projectile.ai[0]; + public const float ChargeDelay = 60f; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Party Cannon"); + } + + public override void SetDefaults() + { + projectile.width = 92; + projectile.height = 66; + projectile.penetrate = -1; + projectile.magic = true; + projectile.tileCollide = false; + projectile.ignoreWater = true; + } + + public override void AI() + { + Item heldItem = Owner.ActiveItem(); + projectile.damage = (int)((heldItem?.damage ?? 0) * Owner.MagicDamage()); + + UpdatePlayerVisuals(Owner.Center); + + bool stillUsingCannon = Owner.channel && !Owner.noItems && !Owner.CCed; + if (!stillUsingCannon) + { + projectile.Kill(); + return; + } + + if (Time > ChargeDelay && Time % heldItem.useTime == 0) + { + ConsumeManaAndFireProjectile(heldItem); + } + else if (Time <= ChargeDelay && !Main.dedServ) + { + if (Main.rand.NextBool(3)) + { + Vector2 velocityDirection = projectile.velocity.RotatedByRandom(0.1f); + Vector2 shotOffset = velocityDirection * projectile.Size * 0.5f; + Dust.NewDustPerfect(projectile.Center + shotOffset, Main.rand.Next(139, 143), velocityDirection * Main.rand.NextFloat(5f, 9f)); + } + } + + Time++; + + // Forces the cannon to disappear immediately if anything goes wrong. + projectile.timeLeft = 2; + } + + public void ConsumeManaAndFireProjectile(Item heldItem) + { + if (Owner.whoAmI != Main.myPlayer) + return; + + if (!Owner.CheckMana(heldItem.mana, true)) + { + projectile.Kill(); + return; + } + + Main.PlaySound(heldItem.UseSound, projectile.Center); + Vector2 spawnPosition = projectile.Center + projectile.velocity * 150f; + Projectile.NewProjectile(spawnPosition, projectile.velocity.SafeNormalize(Vector2.Zero) * heldItem.shootSpeed, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, Owner.whoAmI); + } + + public void UpdatePlayerVisuals(Vector2 center) + { + // Place the cannon directly into the player's hand at all times. + projectile.Center = center; + + // Set the direction of the cannon if it hasn't been set yet. + if (projectile.velocity == Vector2.Zero || projectile.velocity.Length() != 1f) + projectile.velocity = (Main.MouseWorld - center).SafeNormalize(Vector2.UnitX * projectile.direction); + + projectile.rotation = projectile.velocity.ToRotation(); + projectile.direction = projectile.spriteDirection = (Math.Cos(projectile.rotation) > 0).ToDirectionInt(); + + // The crystal is a holdout projectile. Change the player's channel and direction values to reflect this. + Owner.ChangeDir(projectile.direction); + Owner.heldProj = projectile.whoAmI; + Owner.itemTime = 2; + Owner.itemAnimation = 2; + + Owner.itemRotation = (projectile.velocity * projectile.direction).ToRotation(); + if (projectile.spriteDirection == -1) + projectile.rotation += MathHelper.Pi; + } + + public override bool CanDamage() => false; + } +} diff --git a/Projectiles/Magic/RainbowPartyCannonProjectile.png b/Projectiles/Magic/RainbowPartyCannonProjectile.png new file mode 100644 index 0000000000000000000000000000000000000000..59c2f21ef93a1c7364c543371dce49895a72c12f GIT binary patch literal 1302 zcmV+x1?l>UP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!2kdb!2!6DYwZ941gl9zK~#8N?VC$T z6;T++wTEeB4<-#HrvZ5eOdze8l zs3=J8A`=pdAU8&W5tTiuguv>X`3v)TkMq3e-b>$a^FK4(xfkJgzWL6aF?nEMASoJz zLW}8(!{LX?bV49Tm?>x?xi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TWy literal 0 HcmV?d00001 diff --git a/Projectiles/Magic/RainbowRocket.cs b/Projectiles/Magic/RainbowRocket.cs new file mode 100644 index 0000000000..f0e955358d --- /dev/null +++ b/Projectiles/Magic/RainbowRocket.cs @@ -0,0 +1,700 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Magic +{ + public class RainbowRocket : ModProjectile + { + public enum PartyCannonExplosionType + { + Pink = 0, + Orange = 1, + Yellow = 2, + White = 3, + SkyBlue = 4, + Purple = 5, + PalePink = 6, + Count = 7 + } + + internal PrimitiveTrail TrailDrawer = null; + public ref float Time => ref projectile.ai[0]; + public PartyCannonExplosionType RocketType + { + get => (PartyCannonExplosionType)(int)projectile.ai[1]; + set => projectile.ai[1] = (int)value; + } + public const float SwerveAngle = 0.02f; + public const float SwerveAngleOffsetMax = 0.04f; + public const float SwerveTime = 60f; + public const float HomingAcceleration = 0.4f; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Rainbow Rocket"); + Main.projFrames[projectile.type] = 3; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 20; + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + } + + public override void SetDefaults() + { + projectile.width = 28; + projectile.height = 52; + + projectile.friendly = true; + projectile.penetrate = 1; + projectile.timeLeft = 180; + projectile.magic = true; + } + + #region AI + public override void AI() + { + Time++; + Lighting.AddLight(projectile.Center, Main.hslToRgb((float)Math.Sin(Time / 20f) * 0.5f + 0.5f, 0.9f, 0.9f).ToVector3()); + + projectile.tileCollide = Time > 60f; + + projectile.frameCounter++; + if (projectile.frameCounter % 4 == 3) + projectile.frame = (projectile.frame + 1) % Main.projFrames[projectile.type]; + + NPC potentialTarget = projectile.Center.ClosestNPCAt(2300f, true, true); + if (Time < SwerveTime) + DoMovement_IdleSwerveFly(); + else if (potentialTarget != null) + DoMovement_FlyToTarget(potentialTarget); + + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; + } + + private void DoMovement_IdleSwerveFly() + { + float swerveAngleOffset = MathHelper.Lerp(-SwerveAngleOffsetMax, SwerveAngleOffsetMax, (int)RocketType / ((int)PartyCannonExplosionType.Count)); + projectile.velocity = projectile.velocity.RotatedBy(swerveAngleOffset + SwerveAngle); + } + + private void DoMovement_FlyToTarget(NPC target) + { + float angleToTarget = projectile.AngleTo(target.Center); + float angleOffset = MathHelper.WrapAngle(angleToTarget - projectile.velocity.ToRotation()); + projectile.velocity = projectile.velocity.RotatedBy(MathHelper.Clamp(angleOffset, -0.2f, 0.2f)); + projectile.velocity = projectile.velocity.SafeNormalize(-Vector2.UnitY) * (projectile.velocity.Length() + HomingAcceleration); + + if (Vector2.Dot(projectile.velocity.SafeNormalize(Vector2.Zero), projectile.DirectionTo(target.Center)) < 0.75f) + projectile.velocity *= 0.75f; + } + #endregion + + #region Draw Effects + + internal Color GetRocketColor() + { + switch (RocketType) + { + case PartyCannonExplosionType.Pink: + return Color.Pink; + case PartyCannonExplosionType.Orange: + return Color.Orange; + case PartyCannonExplosionType.Yellow: + return Color.LightGoldenrodYellow * 0.8f; + case PartyCannonExplosionType.White: + return Color.LightGray; + case PartyCannonExplosionType.SkyBlue: + return Color.LightSkyBlue; + case PartyCannonExplosionType.Purple: + return Color.Magenta; + case PartyCannonExplosionType.PalePink: + return Color.Pink * 0.77f; + } + return Color.White; + } + + internal Color ColorFunction(float completionRatio) + { + Color baseColor = Main.hslToRgb((projectile.identity * 0.33f + completionRatio + Main.GlobalTime * 2f) % 1f, 1f, 0.54f); + return Color.Lerp(GetRocketColor(), baseColor, MathHelper.Clamp(completionRatio * 0.8f, 0f, 1f)) * projectile.Opacity; + } + + internal float WidthFunction(float completionRatio) + { + float width; + float maxWidthOutwardness = 8f; + if (completionRatio < 0.1f) + width = (float)Math.Sin(completionRatio / 0.1f * MathHelper.PiOver2) * maxWidthOutwardness + 0.1f; + else + width = MathHelper.Lerp(maxWidthOutwardness, 0f, Utils.InverseLerp(0.1f, 1f, completionRatio, true)); + return width * projectile.Opacity; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + if (TrailDrawer is null) + TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction); + + TrailDrawer.Draw(projectile.oldPos, projectile.Size * 0.5f - Main.screenPosition + projectile.velocity, 65); + + Texture2D rocketTexture = ModContent.GetTexture(Texture); + spriteBatch.Draw(rocketTexture, + projectile.Center - Main.screenPosition, + rocketTexture.Frame(1, Main.projFrames[projectile.type], 0, projectile.frame), + GetRocketColor(), + projectile.rotation, + rocketTexture.Size() * 0.5f, + projectile.scale, + SpriteEffects.None, + 0f); + return false; + } + #endregion + + #region Kill Effects + public override void Kill(int timeLeft) + { + if (projectile.owner == Main.myPlayer) + { + for (int i = 1; i < projectile.oldPos.Length; i++) + { + if (Main.rand.NextBool(3)) + { + float offsetAngle = MathHelper.Lerp(-MathHelper.PiOver4, MathHelper.PiOver4, i / (float)projectile.oldPos.Length); + Vector2 spawnPosition = projectile.oldPos[i] + projectile.Size * 0.5f; + Vector2 spawnVelocity = (projectile.oldPos[i - 1] - projectile.oldPos[i]).SafeNormalize(Vector2.Zero); + spawnVelocity = spawnVelocity.RotatedBy(offsetAngle); + spawnVelocity *= Main.rand.NextFloat(12f, 18f); + Projectile.NewProjectile(spawnPosition, spawnVelocity, ModContent.ProjectileType(), projectile.damage, 2f, projectile.owner); + } + } + } + + CalamityGlobalProjectile.ExpandHitboxBy(projectile, 350); + projectile.Damage(); + + Main.PlaySound(SoundID.Item14, projectile.Center); + + // There's no need to spawn dust from the server. + if (Main.dedServ) + return; + + switch (RocketType) + { + case PartyCannonExplosionType.Pink: + PinkMarkExplosionDust(); + break; + case PartyCannonExplosionType.Orange: + OrangeMarkExplosionDust(); + break; + case PartyCannonExplosionType.Yellow: + YellowMarkExplosionDust(); + break; + case PartyCannonExplosionType.White: + WhiteMarkExplosionDust(); + break; + case PartyCannonExplosionType.SkyBlue: + SkyBlueMarkExplosionDust(); + break; + case PartyCannonExplosionType.Purple: + PurpleMarkExplosionDust(); + break; + case PartyCannonExplosionType.PalePink: + PalePinkMarkExplosionDust(); + break; + } + } + #endregion + + #region Pink Mark + public void PinkMarkExplosionDust() + { + // Spawn the main balloon. + BalloonExplosionDust(projectile.Center, Main.rand.NextFloat(8f, 15f), Color.Yellow); + + // Spawn the two smaller balloons. + float absoluteOffsetAngle = Main.rand.NextFloat(0.4f, 0.7f) * -1f; + Vector2 offset = Vector2.UnitY.RotatedBy(absoluteOffsetAngle) * 120f; + offset += Vector2.UnitX * 40f; + BalloonExplosionDust(projectile.Center + offset, Main.rand.NextFloat(6f, 11f), Color.DeepPink, absoluteOffsetAngle); + + absoluteOffsetAngle = Main.rand.NextFloat(0.4f, 0.7f); + offset = Vector2.UnitY.RotatedBy(absoluteOffsetAngle) * 120f; + offset -= Vector2.UnitX * 40f; + BalloonExplosionDust(projectile.Center + offset, Main.rand.NextFloat(6f, 11f), Color.DeepPink, absoluteOffsetAngle); + } + public void BalloonExplosionDust(Vector2 center, float petalBurstSpeed, Color balloonColor, float absoluteOffsetAngle = 0) + { + float explosionOffsetAngle = Main.rand.NextFloat(-0.3f, 0.3f) + absoluteOffsetAngle; + + // Draw the balloon as a petal. + for (float angle = 0f; angle <= MathHelper.TwoPi; angle += MathHelper.ToRadians(4f)) + { + Vector2 initialUnitVector = angle.ToRotationVector2(); + float unitMultiplier = 2f + (1f + (float)Math.Cos(MathHelper.Pi + angle)); // This value is used to "squash" the circle to make it into a petal shape. + Vector2 velocity = initialUnitVector * unitMultiplier; + velocity.X *= 0.5f; + velocity = velocity.SafeNormalize(Vector2.Zero); // Turn the petal velocity into a unit vector again to make future speed calculations easier. + velocity = velocity.RotatedBy(MathHelper.PiOver2); // Flip the petal velocity. It's tilted to the side normally. + velocity = velocity.RotatedBy(explosionOffsetAngle); // Account for the explosion offset angle that was determined at the start. + + Dust dust = Dust.NewDustPerfect(center, 261); + dust.velocity = velocity * petalBurstSpeed; + dust.noGravity = true; + dust.color = balloonColor; + dust.fadeIn = 1.5f; + } + + // Draw the string below the petal, giving it the appearance of a balloon. + StringExplosionDust(center, petalBurstSpeed, explosionOffsetAngle); + } + public void StringExplosionDust(Vector2 center, float petalBurstSpeed, float offsetAngle) + { + int evaluationPoints = 40; + + // When mapped out, these points give a rough string, which when used with a bezier curve, can be smoothened out to make it look like a real string. + Vector2[] bezierControlPoints = new Vector2[] + { + new Vector2(0f, 40f), + new Vector2(20f, 76f), + new Vector2(-16f, 108f), + new Vector2(-20f, 146f), + new Vector2(-14f, 180f), + new Vector2(10f, 214f) + }; + BezierCurve bezierCurve = new BezierCurve(bezierControlPoints); + for (int i = 0; i < evaluationPoints; i++) + { + Dust dust = Dust.NewDustPerfect(center, 261); + dust.position = center + bezierCurve.Evaluate(i / (float)evaluationPoints).RotatedBy(offsetAngle) + Vector2.UnitY * petalBurstSpeed * 2f; + dust.velocity = Vector2.Zero; + dust.noGravity = true; + dust.color = Color.White; + dust.fadeIn = 1.5f; + } + } + #endregion + + #region Orange Mark + public void OrangeMarkExplosionDust() + { + // Spawn the main apple. + AppleExplosionDust(projectile.Center, Main.rand.NextFloat(8f, 15f)); + + // Spawn two other apples to the side. + float absoluteOffsetAngle = Main.rand.NextFloat(0.4f, 0.7f) * -1f; + Vector2 offset = Vector2.UnitY.RotatedBy(absoluteOffsetAngle) * 120f; + offset += Vector2.UnitX * 70f; + AppleExplosionDust(projectile.Center + offset, Main.rand.NextFloat(6f, 11f), absoluteOffsetAngle); + + absoluteOffsetAngle = Main.rand.NextFloat(0.4f, 0.7f); + offset = Vector2.UnitY.RotatedBy(absoluteOffsetAngle) * 120f; + offset -= Vector2.UnitX * 70f; + AppleExplosionDust(projectile.Center + offset, Main.rand.NextFloat(6f, 11f), absoluteOffsetAngle); + } + public void AppleExplosionDust(Vector2 center, float appleBurstSpeed, float offsetAngle = 0f) + { + for (float angle = 0f; angle <= MathHelper.TwoPi; angle += MathHelper.ToRadians(4f)) + { + Vector2 initialUnitVector = angle.ToRotationVector2(); + float cosineValue = (float)Math.Cos(angle); + + Vector2 velocity = initialUnitVector; + + velocity = velocity.SafeNormalize(Vector2.Zero); // Turn the petal velocity into a unit vector again to make future speed calculations easier. + velocity.X *= 1.333f; + + // Squash the circle to the shape of an apple. + if (Math.Abs(cosineValue) < 0.35f) + { + velocity.Y *= MathHelper.Lerp(0.9f, 1f, Math.Abs(cosineValue) / 0.35f); + + // Squash the upper part slightly more than the lower part. + if (Math.Sign(cosineValue) == 1f) + { + velocity.Y *= 0.85f; + } + } + + velocity = velocity.RotatedBy(offsetAngle); // Account for the explosion offset angle that was determined at the start. + + Dust dust = Dust.NewDustPerfect(center, 261); + dust.velocity = velocity * appleBurstSpeed; + dust.noGravity = true; + dust.color = Color.Orange; + dust.fadeIn = 1.5f; + } + AppleLeafExplosionDust(center + new Vector2(0f, -54).RotatedBy(offsetAngle), offsetAngle); + } + public void AppleLeafExplosionDust(Vector2 center, float offsetAngle) + { + int evaluationPoints = 40; + + // When mapped out, these points give a rough apple stem shape. + Vector2[] bezierControlPoints = new Vector2[] + { + new Vector2(0f, 0f), + new Vector2(-20f, -26f), + new Vector2(-26f, -46f), + new Vector2(-30f, -60f), + new Vector2(-24f, -70f), + new Vector2(-10f, -40f), + new Vector2(0f, 0f), + }; + BezierCurve bezierCurve = new BezierCurve(bezierControlPoints); + for (int i = 0; i < evaluationPoints; i++) + { + Dust dust = Dust.NewDustPerfect(center, 261); + dust.position = center + bezierCurve.Evaluate(i / (float)evaluationPoints).RotatedBy(offsetAngle); + dust.velocity = Vector2.Zero; + dust.noGravity = true; + dust.color = Color.Brown; + dust.fadeIn = 1.5f; + } + } + #endregion + + #region Yellow Mark + public void YellowMarkExplosionDust() + { + // Spawn three butterflies. + ButterflyExplosionDust(projectile.Center, Main.rand.NextFloat(8f, 12f)); + + Vector2 offset = Vector2.UnitY.RotatedBy(Main.rand.NextFloat(0.4f, 0.7f) * -1f) * 120f; + offset += Vector2.UnitX * 84f; + ButterflyExplosionDust(projectile.Center + offset, Main.rand.NextFloat(6f, 11f)); + + offset = Vector2.UnitY.RotatedBy(Main.rand.NextFloat(0.4f, 0.7f)) * 120f; + offset -= Vector2.UnitX * 84f; + ButterflyExplosionDust(projectile.Center + offset, Main.rand.NextFloat(6f, 11f)); + } + public void ButterflyExplosionDust(Vector2 center, float butterflyBurstSpeed, float offsetAngle = 0f) + { + int petalCount = 4; + // Draw the butterfly as a petal with 4 sides. + for (float angle = 0f; angle <= MathHelper.TwoPi; angle += MathHelper.ToRadians(4f)) + { + Vector2 initialUnitVector = angle.ToRotationVector2(); + float unitMultiplier = 2f + (1f + (float)Math.Cos(angle * petalCount)); // This value is used to "squash" the circle to make it into a petal shape. + Vector2 velocity = initialUnitVector * unitMultiplier; + velocity = velocity.RotatedBy(MathHelper.PiOver4 + MathHelper.PiOver2); // Tilt the vector to make it look like an actual butterfly. + velocity = velocity.RotatedBy(offsetAngle); + velocity *= 0.25f; // Normalization removes the spaces that make the vector petal-like and not circular, so multiplication must be utilized instead. + + Dust dust = Dust.NewDustPerfect(center, 262); + dust.velocity = velocity * butterflyBurstSpeed; + dust.noGravity = true; + dust.color = Color.Pink; + dust.fadeIn = 1.5f; + } + ButterflyAntennaExplosionDust(center + new Vector2(0f, -74f).RotatedBy(offsetAngle), offsetAngle); + } + public void ButterflyAntennaExplosionDust(Vector2 center, float offsetAngle = 0f) + { + int evaluationPoints = 40; + + // When mapped out, these points give a rough apple stem shape. + Vector2[] bezierControlPoints = new Vector2[] + { + new Vector2(0f, 60f), + new Vector2(0f, 30f), + new Vector2(10f, -28f), + new Vector2(20f, -42f), + new Vector2(30f, -48f), + new Vector2(42f, -40f), + new Vector2(50f, -30f), + new Vector2(52f, -24f), + }; + BezierCurve bezierCurve = new BezierCurve(bezierControlPoints); + for (int i = 0; i < evaluationPoints; i++) + { + Dust dust = Dust.NewDustPerfect(center, 263); + dust.position = center + bezierCurve.Evaluate(i / (float)evaluationPoints).RotatedBy(offsetAngle); + dust.velocity = Vector2.Zero; + dust.noGravity = true; + dust.color = Color.SkyBlue; + dust.fadeIn = 1.5f; + + dust = Dust.CloneDust(dust); + dust.position = center + bezierCurve.Evaluate(i / (float)evaluationPoints).RotatedBy(offsetAngle) * new Vector2(-1f, 1f); + } + } + #endregion + + #region White Mark + public void WhiteMarkExplosionDust() + { + // Spawn three diamonds. + DiamondExplosionDust(projectile.Center, Main.rand.NextFloat(8f, 12f)); + + float absoluteOffsetAngle = Main.rand.NextFloat(0.4f, 0.7f); + Vector2 offset = Vector2.UnitY.RotatedBy(absoluteOffsetAngle * -1f) * 120f; + offset += Vector2.UnitX * 84f; + DiamondExplosionDust(projectile.Center + offset, Main.rand.NextFloat(6f, 11f)); + + absoluteOffsetAngle = Main.rand.NextFloat(0.4f, 0.7f); + offset = Vector2.UnitY.RotatedBy(absoluteOffsetAngle) * 120f; + offset -= Vector2.UnitX * 84f; + DiamondExplosionDust(projectile.Center + offset, Main.rand.NextFloat(6f, 11f)); + } + public void DiamondExplosionDust(Vector2 center, float diamondBurstSpeed, float offsetAngle = 0f) + { + int dustCount = 80; + for (int i = 0; i < dustCount; i++) + { + Vector2 startingVelocity = Vector2.Zero; + Vector2 endingVelocity = Vector2.Zero; + + switch (i / (dustCount / 4)) + { + case 0: + startingVelocity = Vector2.UnitY; + endingVelocity = Vector2.UnitX; + break; + case 1: + startingVelocity = Vector2.UnitX; + endingVelocity = -Vector2.UnitY; + break; + case 2: + startingVelocity = -Vector2.UnitY; + endingVelocity = -Vector2.UnitX; + break; + case 3: + startingVelocity = -Vector2.UnitX; + endingVelocity = Vector2.UnitY; + break; + } + Vector2 velocity = Vector2.Lerp(startingVelocity, endingVelocity, i / (dustCount / 4f) % 1f); + velocity = velocity.RotatedBy(offsetAngle); + velocity *= diamondBurstSpeed; + velocity.X *= 0.667f; + + Dust dust = Dust.NewDustPerfect(center, 263); + dust.position = center; + dust.velocity = velocity; + dust.noGravity = true; + dust.color = Color.LightSteelBlue; + dust.fadeIn = 1.5f; + } + } + #endregion + + #region Sky Blue Mark + public void SkyBlueMarkExplosionDust() + { + RainbowBoltExplosionDust(projectile.Center, Main.rand.NextFloat(-0.2f, 0.2f)); + } + public void RainbowBoltExplosionDust(Vector2 center, float offsetAngle = 0f) + { + // Spawn several clouds. + for (int i = 0; i < 5; i++) + { + CloudExplosionDust(center, offsetAngle); + } + LightningExplosionDust(center, offsetAngle); + } + public void CloudExplosionDust(Vector2 center, float offsetAngle = 0f) + { + center += Main.rand.NextVector2CircularEdge(40f, 40f); + Vector2 offset = Main.rand.NextVector2Square(0.9f, 1.15f); + for (float angle = 0f; angle <= MathHelper.TwoPi; angle += MathHelper.ToRadians(2f)) + { + Vector2 initialUnitVector = angle.ToRotationVector2(); + Vector2 spawnOffset = initialUnitVector.RotatedBy(offsetAngle); + spawnOffset = spawnOffset.RotatedByRandom(0.4f); + spawnOffset *= new Vector2(54f, 36f) * offset; + + spawnOffset -= Vector2.UnitY.RotatedBy(offsetAngle) * 90f; + + Dust dust = Dust.NewDustPerfect(center + spawnOffset, 263); + dust.velocity = Vector2.Zero; + dust.noGravity = true; + dust.scale = 2.7f; + dust.fadeIn = 1.5f; + } + } + public void LightningExplosionDust(Vector2 center, float offsetAngle = 0f) + { + int evaluationPoints = 65; + + // When mapped out, these points give a rough (but slightly weird) lightning bolt. + Vector2[] controlPoints = new Vector2[] + { + new Vector2(-38f, -64f), + new Vector2(-42f, -44f), + new Vector2(-26f, -28f), + new Vector2(-24f, -10f), + new Vector2(-34f, -4f), + new Vector2(-48f, -10f), + new Vector2(-40f, 12f), + new Vector2(-30f, 30f), + new Vector2(-20f, 48f), + new Vector2(-8f, 28f), + new Vector2(2f, 6f), + new Vector2(-8f, -4f), + new Vector2(4f, -16f), + new Vector2(8f, -36f), + new Vector2(12f, -56f), + new Vector2(-38f, -64f) + }; + for (int i = 0; i < evaluationPoints; i++) + { + int currentIndex = (int)(i / (float)evaluationPoints * controlPoints.Length); + Vector2 currentPosition = controlPoints[currentIndex]; + Vector2 nextPosition = controlPoints[(currentIndex + 1) % controlPoints.Length]; + + Dust dust = Dust.NewDustPerfect(center, 263); + dust.position = center + Vector2.Lerp(currentPosition, nextPosition, i / (float)evaluationPoints * controlPoints.Length % 0.999f).RotatedBy(offsetAngle) * 2f; + dust.position += Vector2.UnitY.RotatedBy(offsetAngle) * 138f; + dust.velocity = Vector2.Zero; + dust.noGravity = true; + dust.color = Main.hslToRgb(i / (float)evaluationPoints * 3f % 1f, 0.6f, 0.7f); + dust.scale = 1.4f; + dust.fadeIn = 1.5f; + } + + center += Main.rand.NextVector2CircularEdge(120f, 120f); + Vector2 offset = Main.rand.NextVector2Square(0.9f, 1.15f); + for (float angle = 0f; angle <= MathHelper.TwoPi; angle += MathHelper.ToRadians(2f)) + { + Vector2 initialUnitVector = angle.ToRotationVector2(); + Vector2 spawnOffset = initialUnitVector.RotatedBy(offsetAngle); + spawnOffset = spawnOffset.RotatedByRandom(0.4f); + spawnOffset *= new Vector2(130f, 84f) * offset; + + spawnOffset += Vector2.UnitY.RotatedBy(offsetAngle) * 30f; + + Dust dust = Dust.NewDustPerfect(center + spawnOffset, 263); + dust.velocity = Vector2.Zero; + dust.noGravity = true; + dust.scale = 4f; + dust.fadeIn = 1.5f; + } + } + #endregion + + #region Purple Mark + public void PurpleMarkExplosionDust() + { + TwilightStarExplosionDust(projectile.Center, 14f, Color.Magenta); + for (int i = 0; i < 6; i++) + { + float angle = MathHelper.TwoPi * i / 6f; + Vector2 offset = angle.ToRotationVector2() * Main.rand.NextFloat(140f, 180f); + TwilightStarExplosionDust(projectile.Center + offset, 4f, Color.White, Main.rand.NextFloat(-0.2f, 0.2f)); + } + } + public void TwilightStarExplosionDust(Vector2 center, float petalBurstSpeed, Color starColor, float absoluteOffsetAngle = 0f) + { + int pointsOnStar = 6; + for (int i = 0; i < pointsOnStar; i++) + { + float angle = MathHelper.Pi * 1.5f - i * MathHelper.TwoPi / pointsOnStar; + float nextAngle = MathHelper.Pi * 1.5f - (i + 2) * MathHelper.TwoPi / pointsOnStar; + Vector2 start = angle.ToRotationVector2(); + Vector2 end = nextAngle.ToRotationVector2(); + int pointsOnStarSegment = 35; + for (int j = 0; j < pointsOnStarSegment; j++) + { + Dust dust = Dust.NewDustPerfect(center, 263); + dust.scale = 1.8f; + dust.velocity = Vector2.Lerp(start, end, j / (float)pointsOnStarSegment) * petalBurstSpeed; + dust.velocity.X *= 0.7f; + dust.velocity = dust.velocity.RotatedBy(absoluteOffsetAngle); + dust.fadeIn = 1.5f; + dust.color = starColor; + dust.noGravity = true; + } + } + } + #endregion + + #region Pale Pink Mark + public void PalePinkMarkExplosionDust() + { + StarlightMarkExplosionDust(projectile.Center); + StarlightStarExplosionDust(projectile.Center + new Vector2(16f, 36f), 2f); + } + public void StarlightMarkExplosionDust(Vector2 center) + { + int evaluationPoints = 60; + + // When mapped out, these points give a rough swerving stream shape. + Vector2[] bezierControlPoints = new Vector2[] + { + new Vector2(-38f, -58f), + new Vector2(-22f, -34f), + new Vector2(-10f, -22f), + new Vector2(6f, -11f), + new Vector2(13f, 1f), + new Vector2(-20f, 11f), + new Vector2(16f, 11f), + new Vector2(26f, 6f), + new Vector2(24f, -11f), + new Vector2(8f, -28f), + new Vector2(-10f, -39f), + new Vector2(-38f, -58f) + }; + BezierCurve bezierCurve = new BezierCurve(bezierControlPoints); + + for (int i = 0; i < evaluationPoints; i++) + { + Dust dust = Dust.NewDustPerfect(center, 263); + dust.position = center + bezierCurve.Evaluate(i / (float)evaluationPoints) * new Vector2(3f, 1.7f); + dust.velocity = Vector2.Zero; + dust.color = i >= evaluationPoints / 2 ? Color.Cyan : Color.SkyBlue; + dust.fadeIn = 1.5f; + dust.scale = 1.4f; + dust.noGravity = true; + + dust = Dust.CloneDust(dust); + dust.position = center + bezierCurve.Evaluate(i / (float)evaluationPoints) * new Vector2(1f, -1f) + new Vector2(30f, -12f); + } + } + public void StarlightStarExplosionDust(Vector2 center, float starBurstSpeed) + { + int dustCount = 60; + for (int i = 0; i < dustCount; i++) + { + Vector2 startingVelocity = Vector2.Zero; + Vector2 endingVelocity = Vector2.Zero; + + switch (i / (dustCount / 4)) + { + case 0: + startingVelocity = Vector2.UnitY; + endingVelocity = Vector2.UnitX; + break; + case 1: + startingVelocity = Vector2.UnitX; + endingVelocity = -Vector2.UnitY; + break; + case 2: + startingVelocity = -Vector2.UnitY; + endingVelocity = -Vector2.UnitX; + break; + case 3: + startingVelocity = -Vector2.UnitX; + endingVelocity = Vector2.UnitY; + break; + } + Vector2 velocity = Vector2.Lerp(startingVelocity, endingVelocity, i / (dustCount / 4f) % 1f); + velocity *= starBurstSpeed; + velocity.X *= 0.75f; + + Dust dust = Dust.NewDustPerfect(center, 263); + dust.position = center; + dust.velocity = velocity; + dust.noGravity = true; + dust.color = Color.Purple; + dust.fadeIn = 1.5f; + + dust = Dust.CloneDust(dust); + dust.velocity = dust.velocity.RotatedBy(MathHelper.PiOver4); + dust.color = Color.White; + } + } + #endregion + } +} diff --git a/Projectiles/Magic/RainbowRocket.png b/Projectiles/Magic/RainbowRocket.png new file mode 100644 index 0000000000000000000000000000000000000000..7ff99fa6145e2268e072f2efd7bee926ba464d7f GIT binary patch literal 962 zcmV;z13mnSP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D16N5zK~!i%?V4e0 z@-Ps`TV*YtWZaqyt$m{rMzMyru-_!;;UQbSW~>?$z+1&N_j%z zs$5KQ=FGFHdwhJvw!L1DW@y1PZ?RZ}V5)k-Znr}_1J_(!=P$;@Xf#qs8ot_L+u?AC z6^{QHzrMbr88F6_<6m(WDLq2Urx<1!%`y|EQ0$ZqgqUJ0u*wVceMhxZ5M?d=WA@pz1-fkY3yC{9(% z$x`lLF}*X`cCl!O#qjk$tluEG^m1B)d9utYRAZVtk?4K<`mb#V1T7bEzs$7&}VTm28Ee&=Q&o*knGJcxkbhvex3>Wp;i`1I-G*SQ>OnDoZ-8A^ z+G$PW`T02nJ6{WJv>!3WRz=h46w9-U#2V7?_tjAZtqt+s0`f8D+}+)wfkLj*1^+Ro zr}o#^mvNn@*b>FZ*cHlKPI(pEs2po@JEnD8RjrgS6t?^&{)54DCDXBM7I6G4&KmVB k{@~zUOXXN2 Date: Fri, 4 Dec 2020 16:02:21 -0600 Subject: [PATCH 021/202] Minor Cannon code adjustments/fixes --- Items/Weapons/Magic/RainbowPartyCannon.cs | 20 ++++++++++++++++++ .../Magic/{PartyComet.cs => RainbowComet.cs} | 7 +++--- .../{PartyComet.png => RainbowComet.png} | Bin .../Magic/RainbowPartyCannonProjectile.cs | 9 ++++++-- Projectiles/Magic/RainbowRocket.cs | 5 +++-- 5 files changed, 33 insertions(+), 8 deletions(-) rename Projectiles/Magic/{PartyComet.cs => RainbowComet.cs} (92%) rename Projectiles/Magic/{PartyComet.png => RainbowComet.png} (100%) diff --git a/Items/Weapons/Magic/RainbowPartyCannon.cs b/Items/Weapons/Magic/RainbowPartyCannon.cs index fa0d522cdc..fcab52ec02 100644 --- a/Items/Weapons/Magic/RainbowPartyCannon.cs +++ b/Items/Weapons/Magic/RainbowPartyCannon.cs @@ -1,4 +1,6 @@ +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Magic; +using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using System.Collections.Generic; using System.Linq; @@ -56,5 +58,23 @@ namespace CalamityMod.Items.Weapons.Magic var tt2 = tooltips.FirstOrDefault(x => x.Name == "Tooltip0" && x.mod == "Terraria"); tt2.text = $"[" + DiscoHex + "Let the rainbow remind you that together we will always shine...]"; } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.ConfettiCannon); + recipe.AddIngredient(ModContent.ItemType()); + + // This is the Celebration. The ItemID name is a bit unclear. + // TODO: Replace this with Celebration MK2 in 1.4. + recipe.AddIngredient(ItemID.FireworksLauncher); + recipe.AddIngredient(ItemID.FlaskofParty, 5); + recipe.AddIngredient(ItemID.SoulofLight, 25); + recipe.AddIngredient(ItemID.Confetti, 50); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddTile(ModContent.TileType()); + recipe.SetResult(this); + recipe.AddRecipe(); + } } } diff --git a/Projectiles/Magic/PartyComet.cs b/Projectiles/Magic/RainbowComet.cs similarity index 92% rename from Projectiles/Magic/PartyComet.cs rename to Projectiles/Magic/RainbowComet.cs index 8a4976c8f0..3e244cfc67 100644 --- a/Projectiles/Magic/PartyComet.cs +++ b/Projectiles/Magic/RainbowComet.cs @@ -8,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { - public class PartyComet : ModProjectile + public class RainbowComet : ModProjectile { public ref float Time => ref projectile.ai[0]; public const float FadeinTime = 40f; @@ -70,7 +70,6 @@ namespace CalamityMod.Projectiles.Magic } // And release a bunch of rockets. - Vector2 baseDirection = projectile.velocity.SafeNormalize(-Vector2.UnitY).RotatedBy(MathHelper.PiOver2 * Math.Sign(Math.Cos(projectile.velocity.ToRotation()))); for (int i = 0; i < (int)RainbowRocket.PartyCannonExplosionType.Count; i++) { Vector2 velocity = -projectile.velocity.SafeNormalize(-Vector2.UnitY); @@ -92,9 +91,9 @@ namespace CalamityMod.Projectiles.Magic dust.velocity = Vector2.UnitY.RotatedByRandom(MathHelper.TwoPi) * Main.rand.NextFloat(12f, 16f); dust.noGravity = true; } - } - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LargeWeaponFire").WithVolume(0.45f), projectile.Center); + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LargeWeaponFire").WithVolume(0.45f), projectile.Center); + } } } } diff --git a/Projectiles/Magic/PartyComet.png b/Projectiles/Magic/RainbowComet.png similarity index 100% rename from Projectiles/Magic/PartyComet.png rename to Projectiles/Magic/RainbowComet.png diff --git a/Projectiles/Magic/RainbowPartyCannonProjectile.cs b/Projectiles/Magic/RainbowPartyCannonProjectile.cs index 719269ca5d..da42c6a936 100644 --- a/Projectiles/Magic/RainbowPartyCannonProjectile.cs +++ b/Projectiles/Magic/RainbowPartyCannonProjectile.cs @@ -72,7 +72,12 @@ namespace CalamityMod.Projectiles.Magic Main.PlaySound(heldItem.UseSound, projectile.Center); Vector2 spawnPosition = projectile.Center + projectile.velocity * 150f; - Projectile.NewProjectile(spawnPosition, projectile.velocity.SafeNormalize(Vector2.Zero) * heldItem.shootSpeed, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, Owner.whoAmI); + + // Shoot farther back if the cannon is shoved into a bunch of tiles. + if (!Collision.CanHitLine(Owner.MountedCenter, 16, 16, spawnPosition, 16, 16)) + spawnPosition = projectile.Center + projectile.velocity * 50f; + + Projectile.NewProjectile(spawnPosition, projectile.velocity.SafeNormalize(Vector2.Zero) * heldItem.shootSpeed, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, Owner.whoAmI); } public void UpdatePlayerVisuals(Vector2 center) @@ -87,7 +92,7 @@ namespace CalamityMod.Projectiles.Magic projectile.rotation = projectile.velocity.ToRotation(); projectile.direction = projectile.spriteDirection = (Math.Cos(projectile.rotation) > 0).ToDirectionInt(); - // The crystal is a holdout projectile. Change the player's channel and direction values to reflect this. + // The cannon is a holdout projectile. Change the player's channel and direction values to reflect this. Owner.ChangeDir(projectile.direction); Owner.heldProj = projectile.whoAmI; Owner.itemTime = 2; diff --git a/Projectiles/Magic/RainbowRocket.cs b/Projectiles/Magic/RainbowRocket.cs index f0e955358d..821f465838 100644 --- a/Projectiles/Magic/RainbowRocket.cs +++ b/Projectiles/Magic/RainbowRocket.cs @@ -74,7 +74,7 @@ namespace CalamityMod.Projectiles.Magic private void DoMovement_IdleSwerveFly() { - float swerveAngleOffset = MathHelper.Lerp(-SwerveAngleOffsetMax, SwerveAngleOffsetMax, (int)RocketType / ((int)PartyCannonExplosionType.Count)); + float swerveAngleOffset = MathHelper.Lerp(-SwerveAngleOffsetMax, SwerveAngleOffsetMax, (float)RocketType / ((float)PartyCannonExplosionType.Count)); projectile.velocity = projectile.velocity.RotatedBy(swerveAngleOffset + SwerveAngle); } @@ -136,7 +136,8 @@ namespace CalamityMod.Projectiles.Magic if (TrailDrawer is null) TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction); - TrailDrawer.Draw(projectile.oldPos, projectile.Size * 0.5f - Main.screenPosition + projectile.velocity, 65); + projectile.oldPos[0] = projectile.position + projectile.velocity.SafeNormalize(Vector2.Zero) * 50f; + TrailDrawer.Draw(projectile.oldPos, projectile.Size * 0.5f - Main.screenPosition + projectile.velocity, 80); Texture2D rocketTexture = ModContent.GetTexture(Texture); spriteBatch.Draw(rocketTexture, From d75637617e9d12d0cfd8fc7e5383298dd4bb10bd Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 9 Dec 2020 13:44:59 -0600 Subject: [PATCH 022/202] Made Phaseslayer visuals epic Also made custom shaders work on the PrimitiveTrail --- Effects/CalamityShaders.cs | 5 +- Effects/PhaseslayerRipShader.fx | 61 ++++++++++ Effects/PhaseslayerRipShader.xnb | Bin 0 -> 2108 bytes ExtraTextures/SwordSlashTexture.png | Bin 0 -> 52267 bytes .../DraedonsArsenal/PhaseslayerProjectile.cs | 45 +++++-- TrailGeneration/PrimitiveTrail.cs | 113 +++++++++++------- Utilities/CalamityUtils.cs | 7 ++ 7 files changed, 174 insertions(+), 57 deletions(-) create mode 100644 Effects/PhaseslayerRipShader.fx create mode 100644 Effects/PhaseslayerRipShader.xnb create mode 100644 ExtraTextures/SwordSlashTexture.png diff --git a/Effects/CalamityShaders.cs b/Effects/CalamityShaders.cs index 30f41c4725..a86e46a6f9 100644 --- a/Effects/CalamityShaders.cs +++ b/Effects/CalamityShaders.cs @@ -12,7 +12,8 @@ namespace CalamityMod.Effects public static Effect LightShader; public static Effect TentacleShader; public static Effect LightDistortionShader; - + public static Effect PhaseslayerRipShader; + public static void LoadShaders() { if (Main.dedServ) @@ -21,6 +22,7 @@ namespace CalamityMod.Effects LightShader = CalamityMod.Instance.GetEffect("Effects/LightBurstShader"); TentacleShader = CalamityMod.Instance.GetEffect("Effects/TentacleShader"); LightDistortionShader = CalamityMod.Instance.GetEffect("Effects/DistortionShader"); + PhaseslayerRipShader = CalamityMod.Instance.GetEffect("Effects/PhaseslayerRipShader"); Filters.Scene["CalamityMod:Astral"] = new Filter(new AstralScreenShaderData(new Ref(AstralFogShader), "AstralPass").UseColor(0.18f, 0.08f, 0.24f), EffectPriority.VeryHigh); @@ -29,6 +31,7 @@ namespace CalamityMod.Effects GameShaders.Misc["CalamityMod:SubsumingTentacle"] = new MiscShaderData(new Ref(TentacleShader), "BurstPass"); GameShaders.Misc["CalamityMod:LightDistortion"] = new MiscShaderData(new Ref(LightDistortionShader), "DistortionPass"); + GameShaders.Misc["CalamityMod:PhaseslayerRipEffect"] = new MiscShaderData(new Ref(PhaseslayerRipShader), "TrailPass"); } } } diff --git a/Effects/PhaseslayerRipShader.fx b/Effects/PhaseslayerRipShader.fx new file mode 100644 index 0000000000..5f2870b13b --- /dev/null +++ b/Effects/PhaseslayerRipShader.fx @@ -0,0 +1,61 @@ +sampler uImage0 : register(s0); +sampler uImage1 : register(s1); +float3 uColor; +float3 uSecondaryColor; +float uOpacity; +float uSaturation; +float uRotation; +float uTime; +float4 uSourceRect; +float2 uWorldPosition; +float uDirection; +float3 uLightSource; +float2 uImageSize0; +float2 uImageSize1; +matrix uWorldViewProjection; + +struct VertexShaderInput +{ + float4 Position : POSITION0; + float4 Color : COLOR0; + float2 TextureCoordinates : TEXCOORD0; +}; + +struct VertexShaderOutput +{ + float4 Position : SV_POSITION; + float4 Color : COLOR0; + float2 TextureCoordinates : TEXCOORD0; +}; + +VertexShaderOutput VertexShaderFunction(in VertexShaderInput input) +{ + VertexShaderOutput output = (VertexShaderOutput)0; + float4 pos = mul(input.Position, uWorldViewProjection); + output.Position = pos; + + output.Color = input.Color; + output.TextureCoordinates = input.TextureCoordinates; + + return output; +} + +// The X coordinate is the trail completion, the Y coordinate is the same as any other. +// This is simply how the primitive TextCoord is layed out in the C# code. +float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0 +{ + float4 color = input.Color; + float2 coords = input.TextureCoordinates; + float slashMapColor = tex2D(uImage1, coords); + float opacity = 1 - slashMapColor.r; + return color * pow(opacity, 3); +} + +technique Technique1 +{ + pass TrailPass + { + VertexShader = compile vs_2_0 VertexShaderFunction(); + PixelShader = compile ps_2_0 PixelShaderFunction(); + } +} diff --git a/Effects/PhaseslayerRipShader.xnb b/Effects/PhaseslayerRipShader.xnb new file mode 100644 index 0000000000000000000000000000000000000000..02b74566bac4cc7832d7c8b3fa83f0f570b1ee8f GIT binary patch literal 2108 zcmb_dK~EDw7@chai(u--#6uI;8z!V_YimjZQ7J0MDz&ZHg9%xdfv%J;Zg&NYhkEni z0hNOX6MOJL!i9rJ4*UZ>a^T>BBL{y0^?f@#%Y;B;)UWw=-mKXjAorq^}ro*l=Ncs2@E;Po8*X+ZF2L@f&C8`$%84mN@Qmjb9Zl?SVqUM2LCW zo@4Sd&QDmor-&nvDwM^+y{ER*m@C;W%U@2ooW&X}y({^J^P=188P;vmRJ%72YZ7(jS9 zZSj?oV?US92+!zDo_r3?g}gu6PG_a+7*?ZXv|7OAb(Nd-ruD+(X;DM_(2Jy{Q2k}3 zj3IzgNpLSB>k4lJe^&So@SegCfn#!`ffK-ag%^SA3SR}@Q200C9|}JNjw$<;0M0AC z2J9;Q9q^{YcY*g6z8dTwJ)$09>i&SF7)4ti`B6|-1uiMNpqX_Ma+*T~BHiv$_bMw? zZ;vNHr$~r4>LQNNCviz3qj(cE*2nVHiV)wvH1=Z9?~&s!w`MXkDHeXe^`Y`LeX>|7 z>XkZu+Vz6Hv}`p1Mv|Eu$&p+pnaO9f?6JSS@eX6{oBjiW%N5KBu#Ho&evG5r0bbW) z@y@t^EaK1{Y-_QD4hpb(4V=9}c5rUMBgFj_-0uf}(iWWRssCUdYl*O!KVG}rMQae` zpTy5-!I2~Qmka&-LY-)%F6rMVVDgU^LFbnItRYW*ceb{+qL^wAel*7ah?jr4AA!GZ z={w%hwifIG{Ax#l@gG7y?~-T8j^GiWYa#FPc_id9pGU!cpIIEQPT)C<{)BFwT>cHN CJrNuL literal 0 HcmV?d00001 diff --git a/ExtraTextures/SwordSlashTexture.png b/ExtraTextures/SwordSlashTexture.png new file mode 100644 index 0000000000000000000000000000000000000000..4bb428f1962b06a9a4c1b7f60db56a035f671e23 GIT binary patch literal 52267 zcmY(r1yGgm7d3k5l8^=g0qK$k=@JkD0qO2e0SW0&0TEF;MC3=8bc3LDqkwcMQX}C2;T6(_U11~L%p8x(RRBv0d7@*A92DIT#4)=$ zpG{F_;uR5zwik?3WcmgMS6`UO$;p4$Tl2^IO1x}pdN4E!ANZ_^=EEfW>LGl(yab(+D9vXt zu|6-chw#dV`M%Xv#*AT>xIRWxzYVg5RzH#=Eu6JO%A75~r$1cSNdGLlh|(y+Qzhv7 zFE1s?DJZHN8)M)D;N5#I`Fhtpm{K3XL!nU9xX~R2UYYs@y=R38z8SV9X>eQmY~CY`9uZd zY!aj4TYhg!Ea7TRAx39Q)ITcP;y(`_ArRyStuc z`H;sd5D`S*#*O?fp0i~kmfd|M0oznJ@AB7Q5*{S#>Yh!;Qsi>9k@kX)qgz{Bx0Cu^ zyiPatxone;j*gUzv<9sC^^J^rzJA4hlb+5;ow)2r=U7i2)x&@pjv|&#;JVNl>hr@7 z3qE$+XYuSVLG-@>UP^lEL`w;}c|u!$Dkfr_%rIC}E*>6B8ygI>({74`-?gKb9v-*L zb@AY_=t==A3*Shek0-gG?3t*tkih+_vZSWolX6D$K3_zB|n=E%jUTA0{E9myRUvd{STxh5K=w zaTeyIOR8>dO-M^4gN1}GZdr!E!Q;?3Au$mjE|D>Jv~b$d!qb!F;^KnkKI;dWXlYVh z3kwUBCS!v1`(~dZsvr`pYHGp;)9+hZS)qM%CLgyao%}gP$C`>$F#hr9i)wuZmQ>lo zaT&%G8R5*nY;hm=vp+V!fB(*Ujj}xO*S6Mxi;JuCNW$68EfXD0l)8DzL6(bL9-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sO!7Z!!kVP8wX|BqmVFJE zchZwq(Q%j3-VzxoFYoJW7&;t*%4O0e+uAqh`$2T`LQR?PWPMV z&_(@dv!_1M3pLfsZt;=)DjMNx5@3v!OshfdSN+ebiU%4qrO8ZRO&d;L2R9pt8rrnU zx<=6WpzeDdY^>CWsxpCDYrMGlU#oayVh?w%%LWMb;$hPNe=i0eiK-RP@zLEvAJ=7? zP;vSvzUKbP2TMh2u9S4X<0IsTf52svW~;Vi$1&1j?YNmUsQ>4dPa$O0C4ZUSh2J|1 z_GgcMLnVsa&FSAufhZL+s%M=&A>5ODnzEm+*$>~>RpbnWmuhIzS-6}+uG1@V7sf=S zeOi_55w4Vo3@nCy6Bu;d$S)SnZK#>{H;8D`T{~aft~~_OZ9fUS`UyB^OFTZv(E8Wz zX;Z-aw*A5hCW$(q6D8JW6@3Ts9d;sQK}QpEBl%+LUN7;S(SNLg`OR#5T}M;5#o>3R zDXe{MlpJ-%ccdG?nM((RM+@qhgw$M5L=eh6SYvtU6!E7j;M^nwbH08ISo|Zb8jUszPzaHGz*C@GX75@JKYW{5@ literal 0 HcmV?d00001 diff --git a/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs b/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs index b1be1d8490..0a720569e4 100644 --- a/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs +++ b/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs @@ -4,8 +4,11 @@ using CalamityMod.Items.Weapons.DraedonsArsenal; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; +using System.Collections.Generic; using System.IO; +using System.Linq; using Terraria; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; @@ -57,7 +60,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal { DisplayName.SetDefault("Phaseslayer"); ProjectileID.Sets.TrailingMode[projectile.type] = 2; - ProjectileID.Sets.TrailCacheLength[projectile.type] = 8; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 14; } public override void SetDefaults() @@ -167,7 +170,6 @@ namespace CalamityMod.Projectiles.DraedonsArsenal // These lines ensure the player and their arm are rotated the correct direction to hold the sword. projectile.direction = (Math.Cos(projectile.rotation) > 0).ToDirectionInt(); player.ChangeDir(projectile.direction); - player.heldProj = projectile.whoAmI; player.itemTime = 2; player.itemAnimation = 2; player.itemRotation = projectile.rotation * projectile.direction; @@ -271,6 +273,24 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } } + internal PrimitiveTrail TrailDrawer; + internal Color ColorFunction(float completionRatio) + { + float opacity = projectile.Opacity; + opacity *= Utils.InverseLerp(StandardSwingSpeed * 0.7f, StandardSwingSpeed, AngularDamageFactor, true); + + float rotationAdjusted = MathHelper.WrapAngle(projectile.rotation) + MathHelper.Pi; + float oldRotationAdjusted = MathHelper.WrapAngle(projectile.oldRot[1]) + MathHelper.Pi; + float deltaAngle = Math.Abs(rotationAdjusted - oldRotationAdjusted); + + if (deltaAngle < 0.04f) + opacity = 0f; + + return Color.Lerp(Color.Red, Color.PaleVioletRed * completionRatio, MathHelper.Clamp(completionRatio * 0.8f, 0f, 1f)) * opacity; + } + + internal float WidthFunction(float completionRatio) => (IsSmall ? 101f : 127f) * (1f - completionRatio); + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { Texture2D bladeTexture = ModContent.GetTexture("CalamityMod/Projectiles/DraedonsArsenal/PhaseslayerBlade"); @@ -280,19 +300,24 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Vector2 bladeOffset = projectile.rotation.ToRotationVector2() * (IsSmall ? 90f : 132f) * projectile.scale; Vector2 origin = bladeTexture.Size() * 0.5f; origin /= IsSmall ? new Vector2(1f, 3f) : new Vector2(3f, 7f); + Rectangle frame = IsSmall ? bladeTexture.Frame(1, 3, 0, BladeFrameY) : bladeTexture.Frame(3, 7, BladeFrameX, BladeFrameY); - // TODO: Update this afterimage drawcode to be more cool. - for (int i = 1; i < projectile.oldRot.Length; i++) + if (TrailDrawer is null) + TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, true, GameShaders.Misc["CalamityMod:PhaseslayerRipEffect"]); + + GameShaders.Misc["CalamityMod:PhaseslayerRipEffect"].SetShaderTexture(ModContent.GetTexture("CalamityMod/ExtraTextures/SwordSlashTexture")); + + Player player = Main.player[projectile.owner]; + List positions = new List(); + for (int i = 0; i < projectile.oldPos.Length; i++) { - float angleDelta = MathHelper.Clamp(projectile.rotation - projectile.oldRot[i], -0.26f, 0.26f); - float angle = projectile.rotation + angleDelta; - angle += MathHelper.PiOver2; - Color color = Color.White * (float)Math.Pow(1f - i / (float)projectile.oldRot.Length, 3f); - Rectangle afterimageFrame = IsSmall ? bladeTexture.Frame(1, 3, 0, 2) : bladeTexture.Frame(3, 7, 2, 6); - spriteBatch.Draw(bladeTexture, projectile.Center + bladeOffset - Main.screenPosition, afterimageFrame, color, angle, origin, projectile.scale, SpriteEffects.None, 0f); + if (projectile.oldPos[i] == Vector2.Zero) + continue; + positions.Add(projectile.position + projectile.oldRot[i].ToRotationVector2() * (IsSmall ? 90f : 132f) * projectile.scale); } + TrailDrawer.Draw(positions, projectile.Size * 0.5f - Main.screenPosition, 50); spriteBatch.Draw(bladeTexture, projectile.Center + bladeOffset - Main.screenPosition, frame, Color.White, projectile.rotation + MathHelper.PiOver2, origin, projectile.scale, SpriteEffects.None, 0f); spriteBatch.Draw(hiltTexture, projectile.Center - Main.screenPosition, null, lightColor, projectile.rotation + MathHelper.PiOver2, hiltTexture.Size() * 0.5f, projectile.scale, SpriteEffects.None, 0f); diff --git a/TrailGeneration/PrimitiveTrail.cs b/TrailGeneration/PrimitiveTrail.cs index 384e847ce4..c1f96ebfbd 100644 --- a/TrailGeneration/PrimitiveTrail.cs +++ b/TrailGeneration/PrimitiveTrail.cs @@ -2,10 +2,9 @@ using Microsoft.Xna.Framework.Graphics; using System; using System.Collections.Generic; -using System.Diagnostics.Contracts; using System.Linq; -using System.Runtime.CompilerServices; using Terraria; +using Terraria.Graphics.Shaders; namespace CalamityMod { @@ -15,17 +14,20 @@ namespace CalamityMod { public Vector2 Position; public Color Color; + public Vector2 TextureCoordinates; public VertexDeclaration VertexDeclaration => _vertexDeclaration; private static readonly VertexDeclaration _vertexDeclaration = new VertexDeclaration(new VertexElement[] { new VertexElement(0, VertexElementFormat.Vector2, VertexElementUsage.Position, 0), - new VertexElement(8, VertexElementFormat.Color, VertexElementUsage.Color, 0) + new VertexElement(8, VertexElementFormat.Color, VertexElementUsage.Color, 0), + new VertexElement(12, VertexElementFormat.Vector2, VertexElementUsage.TextureCoordinate, 0), }); - public VertexPosition2DColor(Vector2 position, Color color) + public VertexPosition2DColor(Vector2 position, Color color, Vector2 textureCoordinates) { Position = position; Color = color; + TextureCoordinates = textureCoordinates; } } @@ -39,9 +41,10 @@ namespace CalamityMod // uses a recursive Lerp that gets more computationally expensive the more original indices. // n(n - 1)/2 linear interpolations to be precise, where n is the amount of original indices. public bool UsesSmoothening; - public Effect EffectToUse; + public BasicEffect BaseEffect; + public MiscShaderData SpecialShader; - public PrimitiveTrail(VertexWidthFunction widthFunction, VertexColorFunction colorFunction, bool useSmoothening = true, Effect specialShader = null) + public PrimitiveTrail(VertexWidthFunction widthFunction, VertexColorFunction colorFunction, bool useSmoothening = true, MiscShaderData specialShader = null) { if (widthFunction is null || colorFunction is null) throw new NullReferenceException($"In order to create a primitive trail, a non-null {(widthFunction is null ? "width" : "color")} function must be specified."); @@ -50,16 +53,18 @@ namespace CalamityMod UsesSmoothening = useSmoothening; - EffectToUse = specialShader ?? new BasicEffect(Main.instance.GraphicsDevice); - if (EffectToUse is BasicEffect) + if (specialShader != null) + SpecialShader = specialShader; + + BaseEffect = new BasicEffect(Main.instance.GraphicsDevice) { - (EffectToUse as BasicEffect).VertexColorEnabled = true; - (EffectToUse as BasicEffect).TextureEnabled = false; - UpdateBasicEffect(EffectToUse as BasicEffect); - } + VertexColorEnabled = true, + TextureEnabled = false + }; + UpdateBaseEffect(out _, out _); } - public void UpdateBasicEffect(BasicEffect effect) + public void UpdateBaseEffect(out Matrix effectProjection, out Matrix effectView) { // The screen width and height. int width = Main.instance.GraphicsDevice.Viewport.Width; @@ -68,7 +73,7 @@ namespace CalamityMod Vector2 zoom = Main.GameViewMatrix.Zoom; // Get a matrix that aims towards the Z axis (these calculations are relative to a 2D world). - Matrix effectView = Matrix.CreateLookAt(Vector3.Zero, Vector3.UnitZ, Vector3.Up); + effectView = Matrix.CreateLookAt(Vector3.Zero, Vector3.UnitZ, Vector3.Up); // Offset the matrix to the appropriate position. effectView *= Matrix.CreateTranslation(width / 2, height / -2, 0f); @@ -79,17 +84,13 @@ namespace CalamityMod // And account for the current zoom. effectView *= Matrix.CreateScale(zoom.X, zoom.Y, 1f); - Matrix effectProjection = Matrix.CreateOrthographic(width, height, 0f, 1000f); - effect.View = effectView; - effect.Projection = effectProjection; + effectProjection = Matrix.CreateOrthographic(width, height, 0f, 1000f); + BaseEffect.View = effectView; + BaseEffect.Projection = effectProjection; } - [Pure] public List GetTrailPoints(IEnumerable originalPositions, Vector2 generalOffset, int totalTrailPoints) { - if (EffectToUse is BasicEffect) - UpdateBasicEffect((BasicEffect)EffectToUse); - // Don't smoothen the points unless explicitly told do so. if (!UsesSmoothening) { @@ -126,7 +127,7 @@ namespace CalamityMod public VertexPosition2DColor[] GetVerticesFromTrailPoints(List trailPoints) { - VertexPosition2DColor[] vertices = new VertexPosition2DColor[trailPoints.Count * 6]; + List vertices = new List(); for (int i = 0; i < trailPoints.Count - 1; i++) { float completionRatio = i / (float)trailPoints.Count; @@ -137,52 +138,72 @@ namespace CalamityMod Vector2 positionAhead = trailPoints[i + 1]; Vector2 directionToAhead = (positionAhead - trailPoints[i]).SafeNormalize(Vector2.Zero); + Vector2 leftCurrentTextureCoord = new Vector2(completionRatio, 0f); + Vector2 rightCurrentTextureCoord = new Vector2(completionRatio, 1f); + // Point 90 degrees away from the direction towards the next point, and use it to mark the edges of the rectangle. // This doesn't use RotatedBy for the sake of performance (there can potentially be a lot of trail points). Vector2 sideDirection = new Vector2(-directionToAhead.Y, directionToAhead.X); - // The bounds of the rectangle. - Vector2 firstUp = currentPosition - sideDirection * widthAtVertex; - Vector2 firstDown = currentPosition + sideDirection * widthAtVertex; - - Vector2 secondUp = positionAhead - sideDirection * widthAtVertex; - Vector2 secondDown = positionAhead + sideDirection * widthAtVertex; - // What this is doing, at its core, is defining a rectangle based on two triangles. // These triangles are defined based on the width of the strip at that point. // The resulting rectangles combined are what make the trail itself. - vertices[i * 6] = new VertexPosition2DColor(firstUp, vertexColor); - vertices[i * 6 + 1] = new VertexPosition2DColor(secondUp, vertexColor); - vertices[i * 6 + 2] = new VertexPosition2DColor(firstDown, vertexColor); - - vertices[i * 6 + 3] = new VertexPosition2DColor(secondUp, vertexColor); - vertices[i * 6 + 4] = new VertexPosition2DColor(secondDown, vertexColor); - vertices[i * 6 + 5] = new VertexPosition2DColor(firstDown, vertexColor); + vertices.Add(new VertexPosition2DColor(currentPosition - sideDirection * widthAtVertex, vertexColor, leftCurrentTextureCoord)); + vertices.Add(new VertexPosition2DColor(currentPosition + sideDirection * widthAtVertex, vertexColor, rightCurrentTextureCoord)); } - return vertices; + + return vertices.ToArray(); + } + + public short[] GetIndicesFromTrailPoints(int pointCount) + { + // What this is doing is basically representing each point on the vertices list as + // indices. These indices should come together to create a tiny rectangle that acts + // as a segment on the trail. This is achieved here by splitting the indices (or rather, points) + // into 2 triangles, which requires 6 points. + // The logic here basically determines which indices are connected together. + int totalIndices = (pointCount - 1) * 6; + short[] indices = new short[totalIndices]; + + for (int i = 0; i < pointCount - 2; i++) + { + int startingTriangleIndex = i * 6; + int connectToIndex = i * 2; + indices[startingTriangleIndex] = (short)connectToIndex; + indices[startingTriangleIndex + 1] = (short)(connectToIndex + 1); + indices[startingTriangleIndex + 2] = (short)(connectToIndex + 2); + indices[startingTriangleIndex + 3] = (short)(connectToIndex + 2); + indices[startingTriangleIndex + 4] = (short)(connectToIndex + 1); + indices[startingTriangleIndex + 5] = (short)(connectToIndex + 3); + } + + return indices; } public void Draw(IEnumerable originalPositions, Vector2 generalOffset, int totalTrailPoints) { Main.instance.GraphicsDevice.RasterizerState = RasterizerState.CullNone; - List trailPoints = GetTrailPoints(originalPositions, generalOffset, totalTrailPoints); // A trail with only one point or less has nothing to connect to, and therefore, can't make a trail. - if (trailPoints.Count <= 1) + if (originalPositions.Count() <= 1 || trailPoints.Count <= 1) return; + UpdateBaseEffect(out Matrix projection, out Matrix view); VertexPosition2DColor[] vertices = GetVerticesFromTrailPoints(trailPoints); + short[] triangleIndices = GetIndicesFromTrailPoints(trailPoints.Count); - foreach (var pass in EffectToUse.CurrentTechnique.Passes) + if (SpecialShader != null) { - pass.Apply(); - - // The division by 3 here is because, vertices is a list of vertices. - // That parameter, however, wants the amount of primitives (in this case triangles), it should draw. - // Getting the amount of triangles in this case is simply a matter of dividing the total vertices by 3. - Main.instance.GraphicsDevice.DrawUserPrimitives(PrimitiveType.TriangleList, vertices, 0, vertices.Length / 3); + SpecialShader.Shader.Parameters["uWorldViewProjection"].SetValue(view * projection); + SpecialShader.Apply(); } + else + BaseEffect.CurrentTechnique.Passes[0].Apply(); + + Main.instance.GraphicsDevice.DrawUserIndexedPrimitives(PrimitiveType.TriangleList, vertices, 0, vertices.Length, triangleIndices, 0, triangleIndices.Length / 3); + + Main.pixelShader.CurrentTechnique.Passes[0].Apply(); } } } \ No newline at end of file diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index 6aa90e2717..b8a59c8557 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -36,6 +36,7 @@ using System.Text; using Terraria; using Terraria.DataStructures; using Terraria.Enums; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; @@ -3842,6 +3843,12 @@ namespace CalamityMod Color nextColor = colors[(currentColorIndex + 1) % colors.Length]; return Color.Lerp(currentColor, nextColor, increment * colors.Length % 1f); } + + // TODO: Find some way to speed this up. + public static void SetShaderTexture(this MiscShaderData shader, Texture2D texture) + { + typeof(MiscShaderData).GetField("_uImage", BindingFlags.NonPublic | BindingFlags.Instance).SetValue(shader, new Ref(texture)); + } #endregion #region Mathematical Utilities From 22c5a74991c235b28cf7a4e5b34d4fb496d0ac60 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 9 Dec 2020 19:47:57 -0600 Subject: [PATCH 023/202] Reworked the Fabstaff --- Effects/CalamityShaders.cs | 3 + Effects/FabstaffStreak.fx | 72 +++++++++++++++++++++++ Effects/FabstaffStreak.xnb | Bin 0 -> 2832 bytes ExtraTextures/FabstaffStreak.png | Bin 0 -> 20902 bytes Items/Weapons/Magic/Fabstaff.cs | 4 +- Projectiles/Magic/FabBolt.cs | 96 ++++++++++++++++++++++++++----- Projectiles/Magic/FabOrb.cs | 31 ---------- Projectiles/Magic/FabRay.cs | 70 ++++++++++++++++------ 8 files changed, 213 insertions(+), 63 deletions(-) create mode 100644 Effects/FabstaffStreak.fx create mode 100644 Effects/FabstaffStreak.xnb create mode 100644 ExtraTextures/FabstaffStreak.png delete mode 100644 Projectiles/Magic/FabOrb.cs diff --git a/Effects/CalamityShaders.cs b/Effects/CalamityShaders.cs index a86e46a6f9..e2afeb9183 100644 --- a/Effects/CalamityShaders.cs +++ b/Effects/CalamityShaders.cs @@ -13,6 +13,7 @@ namespace CalamityMod.Effects public static Effect TentacleShader; public static Effect LightDistortionShader; public static Effect PhaseslayerRipShader; + public static Effect FabstaffRayShader; public static void LoadShaders() { @@ -23,6 +24,7 @@ namespace CalamityMod.Effects TentacleShader = CalamityMod.Instance.GetEffect("Effects/TentacleShader"); LightDistortionShader = CalamityMod.Instance.GetEffect("Effects/DistortionShader"); PhaseslayerRipShader = CalamityMod.Instance.GetEffect("Effects/PhaseslayerRipShader"); + FabstaffRayShader = CalamityMod.Instance.GetEffect("Effects/FabstaffStreak"); Filters.Scene["CalamityMod:Astral"] = new Filter(new AstralScreenShaderData(new Ref(AstralFogShader), "AstralPass").UseColor(0.18f, 0.08f, 0.24f), EffectPriority.VeryHigh); @@ -32,6 +34,7 @@ namespace CalamityMod.Effects GameShaders.Misc["CalamityMod:SubsumingTentacle"] = new MiscShaderData(new Ref(TentacleShader), "BurstPass"); GameShaders.Misc["CalamityMod:LightDistortion"] = new MiscShaderData(new Ref(LightDistortionShader), "DistortionPass"); GameShaders.Misc["CalamityMod:PhaseslayerRipEffect"] = new MiscShaderData(new Ref(PhaseslayerRipShader), "TrailPass"); + GameShaders.Misc["CalamityMod:FabstaffRay"] = new MiscShaderData(new Ref(FabstaffRayShader), "TrailPass"); } } } diff --git a/Effects/FabstaffStreak.fx b/Effects/FabstaffStreak.fx new file mode 100644 index 0000000000..497063c9da --- /dev/null +++ b/Effects/FabstaffStreak.fx @@ -0,0 +1,72 @@ +sampler uImage0 : register(s0); +sampler uImage1 : register(s1); +float3 uColor; +float3 uSecondaryColor; +float uOpacity; +float uSaturation; +float uRotation; +float uTime; +float4 uSourceRect; +float2 uWorldPosition; +float uDirection; +float3 uLightSource; +float2 uImageSize0; +float2 uImageSize1; +matrix uWorldViewProjection; + +struct VertexShaderInput +{ + float4 Position : POSITION0; + float4 Color : COLOR0; + float2 TextureCoordinates : TEXCOORD0; +}; + +struct VertexShaderOutput +{ + float4 Position : SV_POSITION; + float4 Color : COLOR0; + float2 TextureCoordinates : TEXCOORD0; +}; + +VertexShaderOutput VertexShaderFunction(in VertexShaderInput input) +{ + VertexShaderOutput output = (VertexShaderOutput)0; + float4 pos = mul(input.Position, uWorldViewProjection); + output.Position = pos; + + output.Color = input.Color; + output.TextureCoordinates = input.TextureCoordinates; + + return output; +} + +// The X coordinate is the trail completion, the Y coordinate is the same as any other. +// This is simply how the primitive TextCoord is layed out in the C# code. +float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0 +{ + float4 color = input.Color; + float2 coords = input.TextureCoordinates; + + // Read the fade map as a streak. + float4 fadeMapColor = tex2D(uImage1, float2(frac(coords.x - uTime * 2.5), coords.y)); + float opacity = fadeMapColor.r; + + // Fade out at the edges of the trail to give a blur effect. + // This is very important. + float power = lerp(3, 10, coords.x); + opacity = lerp(pow(sin(coords.y * 3.141), power), opacity, coords.x); + + // Fade out at the end of the streak. + if (coords.x > 0.7) + opacity *= pow(1 - (coords.x - 0.7) / 0.3, 6); + return color * opacity * 1.5; +} + +technique Technique1 +{ + pass TrailPass + { + VertexShader = compile vs_2_0 VertexShaderFunction(); + PixelShader = compile ps_2_0 PixelShaderFunction(); + } +} diff --git a/Effects/FabstaffStreak.xnb b/Effects/FabstaffStreak.xnb new file mode 100644 index 0000000000000000000000000000000000000000..45b95d5d3f96dccd64d7961c591d51614e3fe859 GIT binary patch literal 2832 zcmb_eO>7%g5T5lmkT{s10|z8r!J&#TLE`69L9RW~W2N@cLykRE;)=X{v(In+8Z`(N#(BH*&HHBF zym>#H`a4ToaqaX3k@ki5w$*U#j=k=t>un>w>=+y7mhD_i7wxudw%zpk^>wr1uA0W0 z=}hUzvEOuz&8F4pOzD?Qr(@aeh1qn5e^YwVYq_3dF0@V0b&S@OUiPlEtj1gBPSw6< zwioiV*~WVQiaEVz<}$h546$g{&Ru|JfR5jEpId2}4kg=>G*&U>Zm7*?xnbUM(v)>X67 zY+E0B=CttPb%>+!RM`JHG%07H%u9fG39YH%F7$5|d=vT|1wVkEkP8hx1wF6e67;5m zx1oQn;Gdx1R`3Jp31yv9(DMqeLw6PYIrJL}K7f8t!P}$t;~|eT&CccQpBPJ4-{qPUY3} z6)jR<9{MkaIlYgu*cRrbkzR+5bK)AXopa(m#r-iD$ZTa!=z2ul?I+1^68TkD)Ie%{ zsmnL>hW;5UmR70>)#)GgSmC(tp`WDXda20qH7fVz_Kucoqp9%al*!-^OXPvs3Gv;6GzXTtRB7rSNhy6I3!b2QFoLXPUhKL|Gbm@=XAH>>6 zyzAp}2pmFqj#=AZ3a*(p`VvKL;qj~eHz#N=EVANE8{k$W_#C+3w9nD>Gdz7wSW0fJFv zh&v${p1<$76E^OWcfvQ&<@rM*!P(<8`PlElU@(ZHL^1q0#{VH7Kj9rS+HYOC5AoeW z{luO`y|9+a9{w-l^*rDjqV)xi1Xv4kEWnWvCjuM=#vHL+Nqi0tdqR)i2d~Ff{u{22 BgzNwS literal 0 HcmV?d00001 diff --git a/ExtraTextures/FabstaffStreak.png b/ExtraTextures/FabstaffStreak.png new file mode 100644 index 0000000000000000000000000000000000000000..3a05118936f92a4112ada33780298dbc96256dea GIT binary patch literal 20902 zcmeEt=T{S7)O836U3!%Ofq+z{DTEGEMGdGRAYFo3KuVAn2n0}&UPUA{QBgp8?@b6D zM1jzo6zL>V63WZ(eLg?`!82=S&D;;O);;&0b+!P zb@53Bprg5X*?4_@^4|z`-|!}&co4FFF#x&f+|>a9%HkPM9Kjc3dJiKj6ac{7@!vz$ z?fw-B0Nhi%rKe-&XSX#2u6=54ez14({TH z942c^OFfwG@bhqU$6=o>wYRs+%emQDTEc0*#4<86cDGh~Iyx@!zE}G1C+h$E>Hiku zfA z*j#;rvZb$3DVF^(nq@Lc610n}UBBxdz^B|m7^vPDaK{k)hN@!6*__Tj5jz2b<1>AV zkLS9dbW!rb2OC42ExVOJo=TszY2d=)0b^T1B6o$h8>Ov59)8?=?PYlfapl*Emhnpw<%=eD%t#?<@U z_~+Cl z=T*;*UOC14?-P9%$WA45o1x+m!MVjOm+H%Imgk911O>Dme@xr0lRt`{jmzCNH_zVf z{P)1) z2ol%oo-}OwR>{T9&A*yHaBXTL?l^9}u-5XIZJ$uSJ`}m4)w4ivd1Zyf>C>$?yGOFh z{%2*9eM-m<3R~TFr&FJ*(3nyZ4~sGKM?x9FU-b6B6mkB^@@fm>XIkoVH;Q=?vq8e? zB&W&qJ~NmsZ0o0ri%fqBrFEbtcR2@MR*?Zbb;%|-%&9Ft9eSbr;&ODpUk1@y`sKEK zu}byUxbiuta%QD%sHZZudgFERm<@kT{}pSyilTg(IRAXLnRQaJZ_~!Q?Y39i7K3jy zF;jLf-fwU>hrBo?I=-;R4O{l)CWslQRPnP9f`#^+NijpC5lF) zkh93`kpP3mi@8ajl{kHgDD@3gpI;l=gA945I~~2EOwD1?X%FhkX|Med9~yr$%0_;t zt)hilEL=^@U%K4($Z;A`Y_srF{kyd?GU&| zOC9xH>g%K2(v{kCR7o;WSMy9My6BikM}i5TVV!G0)2^*A|xqml_?tA1=jo3wXsk{pIO8 z4JU_|ZH?lPin7}yZ*%7-c!CA3qn|k%kGQFmP^I} zchGZ`tmby<#&&MH%2hvzo*b*WZTC<0qz6y6m*oMXA!sMpDE7WxmB5TwCPqOs8yza< ztX&?)Tgc&(8`BMs8X{eohd6Kg@GGY^!M7(eLb~?aE+6Ex_`{p4@Hc1xrFK|}%AqF2 z&462m%fH5LCT;oT+HHE~w-cW*0TufpuAR;2Yu*-$XOcfKK~GQPbW$nn*zF0U&jBrz z8TX~D^YZ)w*?BkK=pteDU(jw~Y!eJEezc@-^MiKDaCI)e4?(z^&!TeLznA=5edPyj zAV|Hk`0#s1Uf5|!(<;Y7bj?vz!;y&#F1s0_H*{g_?8V&hx`>@uC1|%{$$Z~;1w~#% zp0MDkJL!sk`9i$Z;dw?ht|%3LQ_}lav1M#=Ce^sg5FNoCRKL>84zg-H=bjln^h1t? zwps$TME1 ztRi{c-Vs-i2y!a?YJ(A|lN5+w6#wihX-|5V0DGAsYAV# z#uel^nOqHm5yrwX4@!3j16OVckpz}f?T=GUc7o3-?x~k1^7ioTAL2t9<-owwZC=(# z721HUXF?zmh+Z)pMQLd=zRX(%_8?N52aHW0ZJQ8}cyPBhwM%E|$xiX5*i0-Wk7%(E zQ@5RejU)|6XnHSQZTwr<{MY%coa*e)oo!E67lPCjlB0eoF+@PDC6U(E@kHN-B@1PT z|AyKh!4O=K$Agt(v6g9< + /// Manually sets the texture of a instance, since vanilla's implementation only supports strings that access vanilla textures. + /// + /// The shader to bind the texture to. + /// The texture to bind. public static void SetShaderTexture(this MiscShaderData shader, Texture2D texture) { - typeof(MiscShaderData).GetField("_uImage", BindingFlags.NonPublic | BindingFlags.Instance).SetValue(shader, new Ref(texture)); + UImageField.SetValue(shader, new Ref(texture)); } #endregion From 7112d34b24936c00aee5c6b590669d6aaa4c0841 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sun, 27 Dec 2020 13:24:14 -0600 Subject: [PATCH 045/202] Fixed Gamma Laser aiming problems in MP --- Projectiles/Summon/GammaDeathray.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Projectiles/Summon/GammaDeathray.cs b/Projectiles/Summon/GammaDeathray.cs index 95dae2cea3..e75f62deea 100644 --- a/Projectiles/Summon/GammaDeathray.cs +++ b/Projectiles/Summon/GammaDeathray.cs @@ -59,8 +59,15 @@ namespace CalamityMod.Projectiles.Summon if (!owner.active || owner.type != ModContent.ProjectileType()) projectile.Kill(); - projectile.velocity = projectile.AngleTo(Main.MouseWorld).ToRotationVector2(); - projectile.rotation = projectile.velocity.ToRotation() - MathHelper.PiOver2; + if (Main.myPlayer == projectile.owner) + { + projectile.velocity = projectile.AngleTo(Main.MouseWorld).ToRotationVector2(); + projectile.rotation = projectile.velocity.ToRotation() - MathHelper.PiOver2; + + // Since the logic for this can only be run by one client, it must constantly be synced. + projectile.netUpdate = true; + projectile.netSpam = 0; + } if (owner.active) { From ca4e9ae32a0562e4646107420262b0f5eaf3fb49 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 13 Jan 2021 20:31:58 -0600 Subject: [PATCH 046/202] Added Rotten Dogtooth --- CalPlayer/CalamityPlayer.cs | 15 ++++++++--- Items/Accessories/RottenDogtooth.cs | 34 ++++++++++++++++++++++++ Items/Accessories/RottenDogtooth.png | Bin 0 -> 303 bytes NPCs/NormalNPCs/Pitbull.cs | 2 ++ Projectiles/CalamityGlobalProjectile.cs | 10 +++++-- 5 files changed, 56 insertions(+), 5 deletions(-) create mode 100644 Items/Accessories/RottenDogtooth.cs create mode 100644 Items/Accessories/RottenDogtooth.png diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index d54b298900..ffba550785 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -292,6 +292,7 @@ namespace CalamityMod.CalPlayer public float rogueStealthMax = 0f; public float stealthGenStandstill = 1f; public float stealthGenMoving = 1f; + public int flatStealthLossReduction = 0; public const float StealthAccelerationCap = 2f; public float stealthAcceleration = 1f; public bool stealthStrikeThisFrame = false; @@ -574,6 +575,7 @@ namespace CalamityMod.CalPlayer public int roverDriveTimer = 0; public int roverFrameCounter = 0; public int roverFrame = 0; + public bool rottenDogTooth = false; #endregion #region Armor Set @@ -1601,6 +1603,7 @@ namespace CalamityMod.CalPlayer noStupidNaturalARSpawns = false; burdenBreakerYeet = false; roverDrive = false; + rottenDogTooth = false; daedalusReflect = false; daedalusSplit = false; @@ -1973,6 +1976,8 @@ namespace CalamityMod.CalPlayer rageModeActive = false; adrenalineModeActive = false; + flatStealthLossReduction = 0; + lastProjectileHit = null; } #endregion @@ -6882,6 +6887,9 @@ namespace CalamityMod.CalPlayer #region Shoot public override bool Shoot(Item item, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { + if (rottenDogTooth && item.Calamity().rogue && item.type != ModContent.ItemType()) + damage = (int)(damage * RottenDogtooth.StealthStrikeDamageMultiplier); + if (veneratedLocket) { if (item.Calamity().rogue && item.type != ModContent.ItemType()) @@ -9081,20 +9089,21 @@ namespace CalamityMod.CalPlayer stealthStrikeThisFrame = true; stealthAcceleration = 1f; // Reset acceleration when you attack + float lossReductionRatio = flatStealthLossReduction / rogueStealthMax; if (stealthStrikeHalfCost) { - rogueStealth -= 0.5f * rogueStealthMax; + rogueStealth -= 0.5f * rogueStealthMax - lossReductionRatio; if (rogueStealth <= 0f) rogueStealth = 0f; } else if (stealthStrike75Cost) { - rogueStealth -= 0.75f * rogueStealthMax; + rogueStealth -= 0.75f * rogueStealthMax - lossReductionRatio; if (rogueStealth <= 0f) rogueStealth = 0f; } else - rogueStealth = 0f; + rogueStealth = lossReductionRatio; } #endregion diff --git a/Items/Accessories/RottenDogtooth.cs b/Items/Accessories/RottenDogtooth.cs new file mode 100644 index 0000000000..fb51bb1b1f --- /dev/null +++ b/Items/Accessories/RottenDogtooth.cs @@ -0,0 +1,34 @@ +using CalamityMod.CalPlayer; +using System.Collections.Generic; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Accessories +{ + public class RottenDogtooth : ModItem + { + internal const int ArmorCrunchDebuffTime = 180; + internal const float StealthStrikeDamageMultiplier = 0.1f; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Rotten Dogtooth"); + Tooltip.SetDefault($"Makes Stealth strikes inflict Armor Crunch, deal {(int)(StealthStrikeDamageMultiplier * 100)}% more damage and cost 1 less unit of stealth."); + } + + public override void SetDefaults() + { + item.width = 14; + item.height = 22; + item.value = CalamityGlobalItem.Rarity1BuyPrice; + item.rare = ItemRarityID.Blue; + item.accessory = true; + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.Calamity().rottenDogTooth = true; + player.Calamity().flatStealthLossReduction++; + } + } +} diff --git a/Items/Accessories/RottenDogtooth.png b/Items/Accessories/RottenDogtooth.png new file mode 100644 index 0000000000000000000000000000000000000000..8a542b03b629e8cb8452d987fc69c09c400a4bb2 GIT binary patch literal 303 zcmV+~0nq-5P)|YJ%_VJ%HqV83Qlbgx_ust2*Wjqzz6{GaU+nAVlvH~EC_7b3xD*_Pg)|N!+L;#4$ z;cBu$x|W51^q(^$x&CFb80@HXH5l*lD(7 z3kRbq0EN6Ok|AmpeGh=?un+wA_8V?VmZ(Wu+FQBg34ou~CL!WvtnQ`n*zGCOQ%#XR z7mD&-kmp>#Oa3hc`*q#6P00PF=5?G$;T7002ovPDHLkV1j1j Bi(&u( literal 0 HcmV?d00001 diff --git a/NPCs/NormalNPCs/Pitbull.cs b/NPCs/NormalNPCs/Pitbull.cs index c017b9018c..5ff91530ab 100644 --- a/NPCs/NormalNPCs/Pitbull.cs +++ b/NPCs/NormalNPCs/Pitbull.cs @@ -1,3 +1,4 @@ +using CalamityMod.Items.Accessories; using CalamityMod.Items.Placeables.Banners; using CalamityMod.World; using Terraria; @@ -64,6 +65,7 @@ namespace CalamityMod.NPCs.NormalNPCs { int bandageDropRate = CalamityWorld.defiled ? DropHelper.DefiledDropRateInt : Main.expertMode ? 50 : 100; DropHelper.DropItemChance(npc, ItemID.AdhesiveBandage, bandageDropRate, 1, 1); + DropHelper.DropItemChance(npc, ModContent.ItemType(), 8); } } } diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index cc7888a5d4..555c491f59 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -3,6 +3,7 @@ using CalamityMod.Buffs.StatDebuffs; using CalamityMod.CalPlayer; using CalamityMod.Dusts; using CalamityMod.Events; +using CalamityMod.Items.Accessories; using CalamityMod.NPCs.NormalNPCs; using CalamityMod.Projectiles.Healing; using CalamityMod.Projectiles.Magic; @@ -21,6 +22,8 @@ using Terraria.ID; using Terraria.ModLoader; using static Terraria.ModLoader.ModContent; +using NanotechProjectile = CalamityMod.Projectiles.Typeless.Nanotech; + namespace CalamityMod.Projectiles { public class CalamityGlobalProjectile : GlobalProjectile @@ -1155,9 +1158,9 @@ namespace CalamityMod.Projectiles { if (Main.player[projectile.owner].miscCounter % 30 == 0 && projectile.FinalExtraUpdate()) { - if (projectile.owner == Main.myPlayer && player.ownedProjectileCounts[ProjectileType()] < 25) + if (projectile.owner == Main.myPlayer && player.ownedProjectileCounts[ProjectileType()] < 25) { - Projectile.NewProjectile(projectile.Center, Vector2.Zero, ProjectileType(), + Projectile.NewProjectile(projectile.Center, Vector2.Zero, ProjectileType(), CalamityUtils.DamageSoftCap(projectile.damage * 0.15, 150), 0f, projectile.owner, 0f, 0f); } } @@ -1399,6 +1402,9 @@ namespace CalamityMod.Projectiles Player player = Main.player[projectile.owner]; CalamityPlayer modPlayer = player.Calamity(); + if (modPlayer.rottenDogTooth && projectile.Calamity().stealthStrike) + target.AddBuff(BuffType(), RottenDogtooth.ArmorCrunchDebuffTime); + // Super dummies have nearly 10 million max HP (which is used in damage calculations). // This can very easily cause damage numbers that are unrealistic for the weapon. // As a result, they are omitted in this code. From 89ba63250b502aabed598407c178571d2171c2dc Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Thu, 14 Jan 2021 17:17:42 -0600 Subject: [PATCH 047/202] Eternity no longer uses SSV --- Items/Weapons/Magic/Eternity.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Items/Weapons/Magic/Eternity.cs b/Items/Weapons/Magic/Eternity.cs index 4d5f927ffa..1d9a43e448 100644 --- a/Items/Weapons/Magic/Eternity.cs +++ b/Items/Weapons/Magic/Eternity.cs @@ -60,7 +60,6 @@ namespace CalamityMod.Items.Weapons.Magic recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType(), 20); recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddIngredient(ItemID.UnicornHorn, 5); From a81e7665e1583681570e9c3aa2f00fa41d06e15b Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Tue, 16 Feb 2021 19:09:15 -0600 Subject: [PATCH 048/202] Error fixes --- Items/Weapons/Magic/RainbowPartyCannon.cs | 2 +- Items/Weapons/Ranged/BulletFilledShotgun.cs | 4 ++-- Items/Weapons/Summon/UniverseSplitter.cs | 2 +- Projectiles/Magic/RainbowRocket.cs | 1 + .../Melee/PhosphorescentGauntletPunches.cs | 3 ++- Utilities/DrawingUtils.cs | 15 +++++++++++++++ Utilities/TileUtils.cs | 6 ++++++ 7 files changed, 28 insertions(+), 5 deletions(-) diff --git a/Items/Weapons/Magic/RainbowPartyCannon.cs b/Items/Weapons/Magic/RainbowPartyCannon.cs index fcab52ec02..30901196de 100644 --- a/Items/Weapons/Magic/RainbowPartyCannon.cs +++ b/Items/Weapons/Magic/RainbowPartyCannon.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Weapons.Magic item.knockBack = 3.5f; item.value = CalamityGlobalItem.RarityHotPinkBuyPrice; item.rare = 10; - item.Calamity().customRarity = CalamityRarity.Developer; + item.Calamity().customRarity = CalamityRarity.HotPink; item.UseSound = SoundID.Item11; item.autoReuse = true; item.noUseGraphic = true; diff --git a/Items/Weapons/Ranged/BulletFilledShotgun.cs b/Items/Weapons/Ranged/BulletFilledShotgun.cs index b0c35d0d08..7b38b8dc0d 100644 --- a/Items/Weapons/Ranged/BulletFilledShotgun.cs +++ b/Items/Weapons/Ranged/BulletFilledShotgun.cs @@ -34,8 +34,8 @@ namespace CalamityMod.Items.Weapons.Ranged item.useStyle = ItemUseStyleID.HoldingOut; item.UseSound = SoundID.Item38; item.value = CalamityGlobalItem.Rarity3BuyPrice; - item.rare = 3; - item.Calamity().customRarity = CalamityRarity.Dedicated; + item.rare = ItemRarityID.Orange; + item.Calamity().donorItem = true; } public override Vector2? HoldoutOffset() => new Vector2(-7, 0); diff --git a/Items/Weapons/Summon/UniverseSplitter.cs b/Items/Weapons/Summon/UniverseSplitter.cs index 4fc5f0e934..66c282b95e 100644 --- a/Items/Weapons/Summon/UniverseSplitter.cs +++ b/Items/Weapons/Summon/UniverseSplitter.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Items.Weapons.Summon item.noUseGraphic = true; item.value = CalamityGlobalItem.RarityHotPinkBuyPrice; - item.Calamity().customRarity = CalamityRarity.Developer; + item.Calamity().customRarity = CalamityRarity.HotPink; } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; diff --git a/Projectiles/Magic/RainbowRocket.cs b/Projectiles/Magic/RainbowRocket.cs index 821f465838..c5c12a0efa 100644 --- a/Projectiles/Magic/RainbowRocket.cs +++ b/Projectiles/Magic/RainbowRocket.cs @@ -1,3 +1,4 @@ +using CalamityMod.DataStructures; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; diff --git a/Projectiles/Melee/PhosphorescentGauntletPunches.cs b/Projectiles/Melee/PhosphorescentGauntletPunches.cs index 92fdab0bb3..3bb90dba9c 100644 --- a/Projectiles/Melee/PhosphorescentGauntletPunches.cs +++ b/Projectiles/Melee/PhosphorescentGauntletPunches.cs @@ -1,4 +1,5 @@ -using CalamityMod.Dusts; +using CalamityMod.DataStructures; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; diff --git a/Utilities/DrawingUtils.cs b/Utilities/DrawingUtils.cs index b3545e886a..2653142ec5 100644 --- a/Utilities/DrawingUtils.cs +++ b/Utilities/DrawingUtils.cs @@ -1,8 +1,10 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; +using System.Reflection; using System.Text; using Terraria; +using Terraria.Graphics.Shaders; namespace CalamityMod { @@ -259,6 +261,19 @@ namespace CalamityMod return Color.Lerp(currentColor, nextColor, increment * colors.Length % 1f); } + // Cached for efficiency purposes. + internal static readonly FieldInfo UImageField = typeof(MiscShaderData).GetField("_uImage", BindingFlags.NonPublic | BindingFlags.Instance); + + /// + /// Manually sets the texture of a instance, since vanilla's implementation only supports strings that access vanilla textures. + /// + /// The shader to bind the texture to. + /// The texture to bind. + public static void SetShaderTexture(this MiscShaderData shader, Texture2D texture) + { + UImageField.SetValue(shader, new Ref(texture)); + } + public static void EnterShaderRegion(this SpriteBatch spriteBatch) { spriteBatch.End(); diff --git a/Utilities/TileUtils.cs b/Utilities/TileUtils.cs index e499f8d696..a383821d66 100644 --- a/Utilities/TileUtils.cs +++ b/Utilities/TileUtils.cs @@ -458,5 +458,11 @@ namespace CalamityMod SetMerge(type, TileType()); SetMerge(type, TileType()); } + + /// + /// Determines if a tile is solid ground based on whether it's active and not actuated or if the tile is solid in any way, including just the top. + /// + /// The tile to check. + public static bool IsTileSolidGround(this Tile tile) => tile != null && tile.nactive() && (Main.tileSolid[tile.type] || Main.tileSolidTop[tile.type]); } } From d9a86e187301bffdf35fba73fe3b2df9b2eedff3 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Fri, 19 Feb 2021 17:09:23 -0600 Subject: [PATCH 049/202] Start on prism chainsaw --- Items/Weapons/Melee/PrismSaw.cs | 47 ++++++ Items/Weapons/Melee/PrismSaw.png | Bin 0 -> 2096 bytes Projectiles/Melee/PrismSawGlowmask.png | Bin 0 -> 5104 bytes Projectiles/Melee/PrismSawProjectile.cs | 196 +++++++++++++++++++++++ Projectiles/Melee/PrismSawProjectile.png | Bin 0 -> 715 bytes Projectiles/Melee/PrismTooth.cs | 97 +++++++++++ Projectiles/Melee/PrismTooth.png | Bin 0 -> 338 bytes 7 files changed, 340 insertions(+) create mode 100644 Items/Weapons/Melee/PrismSaw.cs create mode 100644 Items/Weapons/Melee/PrismSaw.png create mode 100644 Projectiles/Melee/PrismSawGlowmask.png create mode 100644 Projectiles/Melee/PrismSawProjectile.cs create mode 100644 Projectiles/Melee/PrismSawProjectile.png create mode 100644 Projectiles/Melee/PrismTooth.cs create mode 100644 Projectiles/Melee/PrismTooth.png diff --git a/Items/Weapons/Melee/PrismSaw.cs b/Items/Weapons/Melee/PrismSaw.cs new file mode 100644 index 0000000000..e0454cfca1 --- /dev/null +++ b/Items/Weapons/Melee/PrismSaw.cs @@ -0,0 +1,47 @@ +using CalamityMod.Projectiles.Melee; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Melee +{ + public class PrismSaw : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Prism Saw"); + } + + public override void SetDefaults() + { + item.height = 134; + item.width = 54; + item.damage = 3781; + item.melee = true; + item.noMelee = true; + item.noUseGraphic = true; + item.channel = true; + item.useStyle = ItemUseStyleID.HoldingOut; + item.useTime = 5; + item.useAnimation = 25; + item.knockBack = 12f; + item.autoReuse = false; + item.value = CalamityGlobalItem.RarityVioletBuyPrice; + item.rare = ItemRarityID.Red; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 1f; + item.Calamity().customRarity = CalamityRarity.Violet; + } + + public override void GetWeaponCrit(Player player, ref int crit) => crit += 18; + + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 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) + { + Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f); + return false; + } + } +} diff --git a/Items/Weapons/Melee/PrismSaw.png b/Items/Weapons/Melee/PrismSaw.png new file mode 100644 index 0000000000000000000000000000000000000000..7a425f490982e3a43ed8745bb2e84be0a834f24c GIT binary patch literal 2096 zcmV-02+#M4P)Px+>PbXFRCt{2omp%ZRTzN35w!KTmKI8Z(juiUY$9$^G!$Y~;u5#Gl^9}-i2)zP zAc-dGgK>*UA`g|ogE7XqCdLPss3c&Cf<_5qtB_b)C~K)umR@hgaD6!axt`xScjlHW zx4`)l0yA@FYv+9DKmR#1z~Cd@|Ho4R&MNc;cm@|ip)Vi=%MO)QV*-HguHA*XnllV< z2#>{}HN>5bj{@+?dn>Gs<1d&L0Q9Aj0PNne?WA7Z>5eyq$70YMLets48GxVGe*-{u z?SueeSLfD~a&f0S-Vh#(LKq@zFQT$)4E@V#fN|sN0Jwa{O`!*q7^7nN$N=EL{(b+$ zC7(HXLwGC-W(Zd=B2iKr01O#26o88+Uz!Hkw`V)>UsLFq!kgm6@P_bM4A>CTw!297 z_5yJ9=wARF?CFtBp}h!Q(=}IIGs{}8t(yoyefRe&j2&wXcVy$Ptj8;zULC8Pi(Jj&4dJoK*$|agqX9@H&P@Z196c`9 ze$q=2V^oc)4FI}!cUn)r%NV*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qR7D)4F>aC6yufLPKIWG7*CP#eRzZ$^0m8#S>0MUhdln_;qGl+YZ(gtVPNSu zQJ7nsb_39}Ly!P$fxM-xy_g)k*?zFVqhEF9&%-jw-IMXvS?MGPh@iUJH+g5 ze)-R1o_GFBuo8*xYfXy@S{N_s>&Y?PT;?IRnf+>88I(>8sNrTLM&}*v@aj2aD_2)V g`R|_KK66tj*% Main.player[projectile.owner]; + public ref float Time => ref projectile.ai[0]; + public ref float OriginalDamage => ref projectile.ai[1]; + public float ChargeUpPower => MathHelper.Clamp((float)Math.Pow(Time / 240f, 1.6D), 0f, 1f); + public override void SetStaticDefaults() => DisplayName.SetDefault("Verrrrrrrry over the top chainsaw thing"); + + public override void SetDefaults() + { + projectile.width = 132; + projectile.height = 56; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.melee = true; + projectile.ownerHitCheck = true; + projectile.usesIDStaticNPCImmunity = true; + projectile.idStaticNPCHitCooldown = 2; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D texture = Main.projectileTexture[projectile.type]; + Texture2D glowmaskTexture = ModContent.GetTexture("CalamityMod/Projectiles/Melee/PrismSawGlowmask"); + Rectangle glowmaskRectangle = glowmaskTexture.Frame(1, 6, 0, projectile.frame); + Vector2 origin = texture.Size() * 0.5f; + Vector2 drawPosition = projectile.Center - Main.screenPosition; + SpriteEffects direction = projectile.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(texture, drawPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, origin, projectile.scale, direction, 0f); + spriteBatch.Draw(glowmaskTexture, drawPosition, glowmaskRectangle, Color.White, projectile.rotation, origin, projectile.scale, direction, 0f); + return false; + } + + public override void AI() + { + PlayChainsawSounds(); + DetermineDamage(); + + Vector2 playerRotatedPoint = Owner.RotatedRelativePoint(Owner.MountedCenter); + if (Main.myPlayer == projectile.owner) + { + if (Owner.channel && !Owner.noItems && !Owner.CCed) + HandleChannelMovement(playerRotatedPoint); + else + projectile.Kill(); + } + + DetermineVisuals(playerRotatedPoint); + ManipulatePlayerValues(); + EmitPrettyDust(); + + if (Time > 90f && Time % 36f == 35f) + ReleasePrismTeeth(); + + // Prevent the projectile from dying normally. However, if anything for whatever reason + // goes wrong it will immediately be destroyed on the next frame. + projectile.timeLeft = 2; + + Time++; + } + + public void PlayChainsawSounds() + { + if (projectile.soundDelay <= 0) + { + Main.PlaySound(SoundID.Item22, projectile.position); + projectile.soundDelay = (int)MathHelper.Lerp(30f, 12f, ChargeUpPower); + } + } + + public void DetermineDamage() + { + // Set the initial damage the moment it's created. + if (Main.myPlayer == projectile.owner && OriginalDamage == 0f) + { + OriginalDamage = projectile.damage; + projectile.netUpdate = true; + } + + // And then do time based calculations. This does not execute if the original damage is 0. + if (OriginalDamage != 0f) + projectile.damage = (int)MathHelper.SmoothStep(OriginalDamage * 0.36f, OriginalDamage, ChargeUpPower); + } + + public void DetermineVisuals(Vector2 playerRotatedPoint) + { + float velocityAngle = projectile.velocity.ToRotation(); + projectile.rotation = velocityAngle; + + int oldDirection = projectile.spriteDirection; + if (oldDirection == -1) + projectile.rotation += MathHelper.Pi; + + projectile.direction = projectile.spriteDirection = (Math.Cos(velocityAngle) > 0).ToDirectionInt(); + + if (projectile.spriteDirection != oldDirection) + projectile.rotation -= MathHelper.Pi; + + // Positioning close to the end of the player's arm. + projectile.position = playerRotatedPoint - projectile.Size * 0.5f + velocityAngle.ToRotationVector2() * 30f; + + // Update the position a tiny bit every frame at random to make it look like the saw is vibrating. + projectile.position += Main.rand.NextVector2Circular(1.4f, 1.4f); + + // Update glowmask frames. + projectile.frameCounter += (int)MathHelper.SmoothStep(12f, 33f, ChargeUpPower); + if (projectile.frameCounter >= 32) + { + projectile.frame = (projectile.frame + 1) % 6; + projectile.frameCounter = 0; + } + } + + public void HandleChannelMovement(Vector2 playerRotatedPoint) + { + float speed = 1f; + if (Owner.ActiveItem().shoot == projectile.type) + speed = Owner.ActiveItem().shootSpeed * projectile.scale; + + Vector2 currentAimDirection = projectile.velocity.SafeNormalize(Vector2.UnitX * Owner.direction); + Vector2 idealAimDirection = (Main.MouseWorld - playerRotatedPoint).SafeNormalize(Vector2.UnitX * Owner.direction); + + float angularAimVelocity = 0.16f; + float directionAngularDisparity = projectile.velocity.AngleBetween(idealAimDirection) / MathHelper.Pi; + + // Increase the turn speed if close to the ideal direction, since successive linear interpolations + // are asymptotic. + angularAimVelocity += MathHelper.Lerp(0f, 0.25f, Utils.InverseLerp(0.28f, 0.08f, directionAngularDisparity, true)); + + if (directionAngularDisparity < 0.02f) + projectile.velocity = Vector2.Lerp(currentAimDirection, idealAimDirection, angularAimVelocity); + else + projectile.velocity = idealAimDirection; + + projectile.velocity = projectile.velocity.SafeNormalize(Vector2.UnitX * Owner.direction) * speed; + } + + public void ManipulatePlayerValues() + { + Owner.itemRotation = (projectile.velocity * projectile.direction).ToRotation(); + Owner.heldProj = projectile.whoAmI; + Owner.itemTime = 2; + Owner.itemAnimation = 2; + Owner.ChangeDir(projectile.direction); + } + + public void EmitPrettyDust() + { + if (Main.dedServ) + return; + + for (int i = 0; i < 2; i++) + { + Vector2 spawnPosition = projectile.Center + projectile.velocity * 35f; + spawnPosition += Main.rand.NextVector2CircularEdge(9f, 35f).RotatedBy(projectile.velocity.ToRotation() + MathHelper.PiOver2); + + Dust rainbowSpark = Dust.NewDustPerfect(spawnPosition, 261); + rainbowSpark.velocity = projectile.velocity * 3f + Main.rand.NextVector2CircularEdge(1.5f, 1.5f); + rainbowSpark.noGravity = true; + rainbowSpark.color = Main.hslToRgb((Time / 40f + Main.rand.NextFloat(-0.1f, 0.1f)) % 1f, 0.95f, 0.6f); + rainbowSpark.scale = Main.rand.NextFloat(0.9f, 1.25f); + } + } + + public void ReleasePrismTeeth() + { + if (Main.myPlayer != projectile.owner) + return; + + float shootReach = MathHelper.SmoothStep(projectile.width * 1.2f, projectile.width * 2.25f + 20f, ChargeUpPower); + Projectile.NewProjectile(Owner.Center, projectile.velocity, ModContent.ProjectileType(), projectile.damage / 2, 0f, projectile.owner, 0f, shootReach); + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + // Collision is done as a line to bypass the fact that hitboxes cannot rotate and that + // this projectile is notably flat in terms of sprite shape. + float _ = 0f; + float width = projectile.scale * 36f; + Vector2 start = projectile.Center; + Vector2 end = projectile.Center + projectile.velocity * 70f; + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), start, end, width, ref _); + } + } +} diff --git a/Projectiles/Melee/PrismSawProjectile.png b/Projectiles/Melee/PrismSawProjectile.png new file mode 100644 index 0000000000000000000000000000000000000000..f0e5ea6ab42fab4e1319ef2b370ac0db595fcd12 GIT binary patch literal 715 zcmV;+0yO=JP)Px#1ZP1_K>z@;j|==^1poj5Cs0gOMF0Q*P+4a)I6odBA#;3-$38xXD^{AMuCTqu z99dUBmFYfNt^fc4@9Rvz0000DbW%=J|NsC0|NsC0|NsC006pj;h5!Hn32;bRa{vGi z!TfwarE_WhrC9G@*nr%Gv+Xhu6}2|vcZ z29l-w4$`iu_nArJT#cC|az0aJE(s{*9Fh1EeG5`r7KxmpF@r=ukfliDj4hc%LS>;; za=u)S*N7>x7%DWroE*+eh5oS`5ha#|hb|;S@#fKvs06)tlu8VVEtE!}KXx5R9Z7o9 z5cGv*dlO6I{FwwLJS7U;8AYONpv4?A;Gc2dnAfoCMjZ$sp&g-&Na=cAmNqpUNSkab zPS>!>2gY&F1^St-x)DX9-6{m6^zq>muF*Hk6G&!V_3=^}Vzy{4^dG?(kVQ2hk^}`= zsH=~tY|ff-G`BWf!=|1>6vc_9#p~XRG~!7pnRfJxX|tPJ!g2&a$BxaA#ulQV(_?g3amvS*K!a&MK)pCuE#P4i0pAsE z7ueuaO1a%o@MtMSmY@(41o03F)j}=e?hh9UDbm}EUUr~oMMFxshD6%B3Z-}s}6IPyMZ=){%i*cw9`UF0Zc xkl1RNL*+k8Y&9I4I*3^$wi-5cC;=qy_aF4Xz^SGdP>TQn002ovPDHLkV1kA8E=>Rc literal 0 HcmV?d00001 diff --git a/Projectiles/Melee/PrismTooth.cs b/Projectiles/Melee/PrismTooth.cs new file mode 100644 index 0000000000..60f7eb5841 --- /dev/null +++ b/Projectiles/Melee/PrismTooth.cs @@ -0,0 +1,97 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using System.IO; +using Terraria; +using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Melee +{ + public class PrismTooth : ModProjectile + { + internal PrimitiveTrail TrailDrawer; + public const int Lifetime = 30; + public Player Owner => Main.player[projectile.owner]; + public ref float Time => ref projectile.ai[0]; + public ref float ShootReach => ref projectile.ai[1]; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Prism Tooth"); + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 36; + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 35; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.timeLeft = Lifetime; + projectile.melee = true; + } + + public override void SendExtraAI(BinaryWriter writer) => writer.Write((byte)projectile.direction); + + public override void ReceiveExtraAI(BinaryReader reader) => projectile.direction = reader.ReadByte(); + + public override void AI() + { + // Determine the initial direction of the tooth in terms of its orbit. + if (Main.myPlayer == projectile.owner && projectile.spriteDirection == 0) + { + projectile.spriteDirection = Main.rand.NextBool(2).ToDirectionInt(); + projectile.netUpdate = true; + } + + projectile.rotation = MathHelper.Pi * Time / Lifetime; + if (projectile.spriteDirection == -1) + projectile.rotation = MathHelper.Pi - projectile.rotation; + projectile.rotation += projectile.velocity.ToRotation(); + + // In this context, the velocity is simply the initial direction as a unit vector- it does not + // actually influence movement in any way. + float angle = MathHelper.TwoPi * Time / Lifetime - MathHelper.PiOver2; + if (projectile.spriteDirection == -1) + angle += MathHelper.Pi; + + Vector2 baseDirection = angle.ToRotationVector2(); + baseDirection.X *= 0.25f; + baseDirection.Y = baseDirection.Y * 0.5f + 0.5f; + baseDirection = baseDirection.RotatedBy(projectile.velocity.ToRotation() - MathHelper.PiOver2); + + projectile.Center = Owner.RotatedRelativePoint(Owner.MountedCenter) + baseDirection * ShootReach; + projectile.Opacity = Utils.InverseLerp(0f, 12f, Time, true) * Utils.InverseLerp(Lifetime, Lifetime - 12f, Time, true); + + Time++; + } + + public override Color? GetAlpha(Color lightColor) + { + float hue = (projectile.identity % 9f / 9f + projectile.timeLeft / (float)Lifetime) % 1f; + return Color.Lerp(lightColor, Main.hslToRgb(hue, 0.95f, 0.55f), 0.35f) * projectile.Opacity; + } + + internal float WidthFunction(float completionRatio) => 54f; + + internal Color ColorFunction(float completionRatio) + { + Color color = Color.Lerp(Color.White, Color.Violet, Utils.InverseLerp(0f, 0.7f, completionRatio, true)) * (1f - Utils.InverseLerp(0f, 0.98f, completionRatio, true)); + color.A /= 2; + return color; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + if (TrailDrawer is null) + TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, false, GameShaders.Misc["CalamityMod:OverpoweredTouhouSpearShader"]); + + GameShaders.Misc["CalamityMod:OverpoweredTouhouSpearShader"].SetShaderTexture(ModContent.GetTexture("CalamityMod/ExtraTextures/ScarletDevilStreak")); + TrailDrawer.Draw(projectile.oldPos, projectile.Size * 0.5f - Main.screenPosition + projectile.velocity.SafeNormalize(Vector2.Zero) * 86f, 60); + return true; + } + + public override bool ShouldUpdatePosition() => false; + } +} diff --git a/Projectiles/Melee/PrismTooth.png b/Projectiles/Melee/PrismTooth.png new file mode 100644 index 0000000000000000000000000000000000000000..3201a55ae98713958e02f1bdc52eb32a629fbf7a GIT binary patch literal 338 zcmeAS@N?(olHy`uVBq!ia0vp^azJdt!3-o<-K;nOq!^2X+?^QKos)S9O9%LbxB}__|NkHQ|26Z&on;>~|NlS!|7ZUHt@$S)YE z1`HU2{VRk(f(0It#S9F5he4R}c>anMpx|mx7sn6_|GAeg3N+Rm}2RF`{%g0~0YFlo_x<@}U4}7XR@HtE1VWq(1-wjV=v+E>XD&#igG*5Z6cjmDV zKi{usp4b2QjFLtDd5HoWwzDQ1Jm&DOk$C)ak#BhQlf|WJbBb&Xo;S)!?@Kn{AJ%i% zq~O{j9VVy1V^`U_rzGVx|L%MY( W_{r~NI2{afHiM_DpUXO@geCxTo{zQw literal 0 HcmV?d00001 From 847c4dc7650485ef6d7fe44b02bc00729412f2d5 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 20 Feb 2021 14:21:46 -0600 Subject: [PATCH 050/202] Finished the Photon Ripper Also made some primitive drawing adjustments/fixes --- Effects/CalamityShaders.cs | 3 + Effects/PrismCrystalStreak.fx | 70 +++++++++ Effects/PrismCrystalStreak.xnb | Bin 0 -> 2904 bytes .../Melee/{PrismSaw.cs => PhotonRipper.cs} | 12 +- .../Melee/{PrismSaw.png => PhotonRipper.png} | Bin Projectiles/Boss/InfernadoRevenge.cs | 2 +- .../DraedonsArsenal/PhaseslayerProjectile.cs | 2 +- Projectiles/Magic/FabBolt.cs | 6 +- Projectiles/Magic/FabRay.cs | 6 +- ...wGlowmask.png => PhotonRipperGlowmask.png} | Bin ...rojectile.cs => PhotonRipperProjectile.cs} | 89 +++++++----- ...jectile.png => PhotonRipperProjectile.png} | Bin Projectiles/Melee/PrismTooth.cs | 133 +++++++++++------- Projectiles/Rogue/ScarletDevilProjectile.cs | 2 +- Projectiles/Summon/DaedalusLightning.cs | 2 +- TrailGeneration/PrimitiveTrail.cs | 97 +++++++++---- 16 files changed, 304 insertions(+), 120 deletions(-) create mode 100644 Effects/PrismCrystalStreak.fx create mode 100644 Effects/PrismCrystalStreak.xnb rename Items/Weapons/Melee/{PrismSaw.cs => PhotonRipper.cs} (79%) rename Items/Weapons/Melee/{PrismSaw.png => PhotonRipper.png} (100%) rename Projectiles/Melee/{PrismSawGlowmask.png => PhotonRipperGlowmask.png} (100%) rename Projectiles/Melee/{PrismSawProjectile.cs => PhotonRipperProjectile.cs} (63%) rename Projectiles/Melee/{PrismSawProjectile.png => PhotonRipperProjectile.png} (100%) diff --git a/Effects/CalamityShaders.cs b/Effects/CalamityShaders.cs index ffab1270d3..22ef4a17b1 100644 --- a/Effects/CalamityShaders.cs +++ b/Effects/CalamityShaders.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Effects public static Effect FabstaffRayShader; public static Effect ScarletDevilShader; public static Effect BordernadoFireShader; + public static Effect PrismCrystalShader; public static void LoadShaders() { @@ -29,6 +30,7 @@ namespace CalamityMod.Effects FabstaffRayShader = CalamityMod.Instance.GetEffect("Effects/FabstaffStreak"); ScarletDevilShader = CalamityMod.Instance.GetEffect("Effects/ScarletDevilStreak"); BordernadoFireShader = CalamityMod.Instance.GetEffect("Effects/BordernadoFire"); + PrismCrystalShader = CalamityMod.Instance.GetEffect("Effects/PrismCrystalStreak"); Filters.Scene["CalamityMod:Astral"] = new Filter(new AstralScreenShaderData(new Ref(AstralFogShader), "AstralPass").UseColor(0.18f, 0.08f, 0.24f), EffectPriority.VeryHigh); @@ -41,6 +43,7 @@ namespace CalamityMod.Effects GameShaders.Misc["CalamityMod:FabstaffRay"] = new MiscShaderData(new Ref(FabstaffRayShader), "TrailPass"); GameShaders.Misc["CalamityMod:OverpoweredTouhouSpearShader"] = new MiscShaderData(new Ref(ScarletDevilShader), "TrailPass"); GameShaders.Misc["CalamityMod:Bordernado"] = new MiscShaderData(new Ref(BordernadoFireShader), "TrailPass"); + GameShaders.Misc["CalamityMod:PrismCrystal"] = new MiscShaderData(new Ref(PrismCrystalShader), "TrailPass"); } } } diff --git a/Effects/PrismCrystalStreak.fx b/Effects/PrismCrystalStreak.fx new file mode 100644 index 0000000000..8ec86f9cd3 --- /dev/null +++ b/Effects/PrismCrystalStreak.fx @@ -0,0 +1,70 @@ +sampler uImage0 : register(s0); +sampler uImage1 : register(s1); +float3 uColor; +float3 uSecondaryColor; +float uOpacity; +float uSaturation; +float uRotation; +float uTime; +float4 uSourceRect; +float2 uWorldPosition; +float uDirection; +float3 uLightSource; +float2 uImageSize0; +float2 uImageSize1; +matrix uWorldViewProjection; + +struct VertexShaderInput +{ + float4 Position : POSITION0; + float4 Color : COLOR0; + float2 TextureCoordinates : TEXCOORD0; +}; + +struct VertexShaderOutput +{ + float4 Position : SV_POSITION; + float4 Color : COLOR0; + float2 TextureCoordinates : TEXCOORD0; +}; + +VertexShaderOutput VertexShaderFunction(in VertexShaderInput input) +{ + VertexShaderOutput output = (VertexShaderOutput)0; + float4 pos = mul(input.Position, uWorldViewProjection); + output.Position = pos; + + output.Color = input.Color; + output.TextureCoordinates = input.TextureCoordinates; + + return output; +} + +// The X coordinate is the trail completion, the Y coordinate is the same as any other. +// This is simply how the primitive TextCoord is layed out in the C# code. +// Inputted images go into uImage1 sampler, in case you have a noise map or something similar. +float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0 +{ + float4 color = input.Color; + float2 coords = input.TextureCoordinates; + + float areaFadeGlow = lerp(1.2, 17, coords.x); + if (coords.x < 0.25) + areaFadeGlow = lerp(areaFadeGlow, 1.2, 1 - coords.x / 0.25); + float2 mapColor = tex2D(uImage1, float2(frac(coords.x - uTime * 4.2), coords.y)); + float opacity = pow(sin(coords.y * 3.141), areaFadeGlow) + 0.6 * lerp(1.1, 0.3, coords.x) * mapColor.r; + + if (coords.x > 0.66) + opacity = lerp(opacity, 0, (coords.x - 0.66) / 0.3); + + return color * opacity; +} + +technique Technique1 +{ + pass TrailPass + { + VertexShader = compile vs_2_0 VertexShaderFunction(); + PixelShader = compile ps_2_0 PixelShaderFunction(); + } +} diff --git a/Effects/PrismCrystalStreak.xnb b/Effects/PrismCrystalStreak.xnb new file mode 100644 index 0000000000000000000000000000000000000000..43f330f1f69e92c4dc2e3d5ceefdd7a67751cc00 GIT binary patch literal 2904 zcmb_eO=ufe5T2D}SE(HoQVJ~?szM8HF~WB3qENebEXR$h+NhS42wDgmc^z#dYu(ju zY?mC=n+rL(KZiOLs?Z*SbWx#gE+H}WRIq7|f#lGGp*`dfD7|X?&Axr>R}(`?JMw7f zoA=GUd9&|5x%BSLYL8axBho(8-Z9IzRkxO$RH>$?=4^f0Sheg+sf<-~jGB`=wX|fE zodrW*H0+_|VeGeTeWhZS>qE)2hFv$U+T>Vjm_I|wj9YbF+nB5wu4C)fp=8dzP&LbM z8|ww@l2MyXkByd>(ie=8MPqz;eEcDDK2^nz|B}y%cd~qhC+B;4A<`Fjj~l+)a`W< z9F$KFlvtjhmE{Q3J+q>hO=q34H$TQ6 zlQErt9V7M}(+4;>5bh)Ef0bvEK=kmeX{_dK>%*Wke?%{H&v;KBoQG@S-XHYyUMbkR zS6-DN5NNN-%#*2><0>73*H}3Q3-4w z{v66O0bd&Wg@9Cmol|&$n>>gtbC#PJ@w~40B4r9EX9fVzFcCiHFoq;g<7*fi#Yxbp zm(uKoh`VnD@1oxyk$G3@=SR;EQ+R(T2NzyRp3dg8$$W*c_GHFdUNNgMPNYU(Pn{Sa zO^v3<#;EI+D7SDbuSH68UGJr^ruQ)y`@)(uN|xZ`nz#q-=bE@qaeuVivRYXahW;VW z+LP4RkNWcSY9ckiwB?g|UGF$$vh#(w8gz)gyTfv9`jBDdO3+*>o8kN#<(hJP$S23~ zm^@qZ`3RDLcplMvI6@jFn!7t!PF~yEnj&i4zP9!J6#FCa15ZPzzWvjC6RCWE6#n~( zU#9OT=C^luvUhfOuKNBM{6GISI0d~^EEW+b^7p{69liUb-uKhZcI(wQKHb! z?9YbWxA^_SI~98v{X$<8oB00<+eO>voIOgL>h~qwv0{eZY1b$Y6o>TNU J@HV;2e*^A2rUw83 literal 0 HcmV?d00001 diff --git a/Items/Weapons/Melee/PrismSaw.cs b/Items/Weapons/Melee/PhotonRipper.cs similarity index 79% rename from Items/Weapons/Melee/PrismSaw.cs rename to Items/Weapons/Melee/PhotonRipper.cs index e0454cfca1..fad70e541b 100644 --- a/Items/Weapons/Melee/PrismSaw.cs +++ b/Items/Weapons/Melee/PhotonRipper.cs @@ -6,18 +6,22 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Melee { - public class PrismSaw : ModItem + public class PhotonRipper : ModItem { public override void SetStaticDefaults() { - DisplayName.SetDefault("Prism Saw"); + DisplayName.SetDefault("Photon Ripper"); + Tooltip.SetDefault("Unleashes a flurry of prismatic crystals at extremely fast speeds\n" + + ""); } public override void SetDefaults() { item.height = 134; item.width = 54; - item.damage = 3781; + item.damage = 2581; + item.axe = 3330; + item.axe /= 5; item.melee = true; item.noMelee = true; item.noUseGraphic = true; @@ -29,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Melee item.autoReuse = false; item.value = CalamityGlobalItem.RarityVioletBuyPrice; item.rare = ItemRarityID.Red; - item.shoot = ModContent.ProjectileType(); + item.shoot = ModContent.ProjectileType(); item.shootSpeed = 1f; item.Calamity().customRarity = CalamityRarity.Violet; } diff --git a/Items/Weapons/Melee/PrismSaw.png b/Items/Weapons/Melee/PhotonRipper.png similarity index 100% rename from Items/Weapons/Melee/PrismSaw.png rename to Items/Weapons/Melee/PhotonRipper.png diff --git a/Projectiles/Boss/InfernadoRevenge.cs b/Projectiles/Boss/InfernadoRevenge.cs index 1f7df09256..a5a0dc225b 100644 --- a/Projectiles/Boss/InfernadoRevenge.cs +++ b/Projectiles/Boss/InfernadoRevenge.cs @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { if (TornadoDrawer is null) - TornadoDrawer = new PrimitiveTrail(_ => projectile.width * 0.5f + 16f, ColorFunction, true, GameShaders.Misc["CalamityMod:Bordernado"]); + TornadoDrawer = new PrimitiveTrail(_ => projectile.width * 0.5f + 16f, ColorFunction, specialShader: GameShaders.Misc["CalamityMod:Bordernado"]); GameShaders.Misc["CalamityMod:Bordernado"].SetShaderTexture(ModContent.GetTexture("Terraria/Misc/Perlin")); Vector2[] drawPoints = new Vector2[5]; diff --git a/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs b/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs index 68c8728504..165fcecad2 100644 --- a/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs +++ b/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs @@ -308,7 +308,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Rectangle frame = IsSmall ? bladeTexture.Frame(1, 3, 0, BladeFrameY) : bladeTexture.Frame(3, 7, BladeFrameX, BladeFrameY); if (TrailDrawer is null) - TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, true, GameShaders.Misc["CalamityMod:PhaseslayerRipEffect"]); + TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, specialShader: GameShaders.Misc["CalamityMod:PhaseslayerRipEffect"]); GameShaders.Misc["CalamityMod:PhaseslayerRipEffect"].SetShaderTexture(ModContent.GetTexture("CalamityMod/ExtraTextures/SwordSlashTexture")); diff --git a/Projectiles/Magic/FabBolt.cs b/Projectiles/Magic/FabBolt.cs index cdddbd6508..e61e4f4d51 100644 --- a/Projectiles/Magic/FabBolt.cs +++ b/Projectiles/Magic/FabBolt.cs @@ -1,6 +1,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; +using System.Collections.Generic; using System.Linq; using Terraria; using Terraria.Graphics.Shaders; @@ -49,6 +50,7 @@ namespace CalamityMod.Projectiles.Magic } else projectile.velocity *= 1.004f; + projectile.rotation = projectile.velocity.ToRotation(); } internal Color ColorFunction(float completionRatio) @@ -68,10 +70,10 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { if (TrailDrawer is null) - TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, false, GameShaders.Misc["CalamityMod:FabstaffRay"]); + TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, PrimitiveTrail.SmoothCatmullRomPointRetreivalFunction, GameShaders.Misc["CalamityMod:FabstaffRay"]); GameShaders.Misc["CalamityMod:FabstaffRay"].SetShaderTexture(ModContent.GetTexture("CalamityMod/ExtraTextures/FabstaffStreak")); - TrailDrawer.Draw(projectile.oldPos, projectile.Size * 0.5f - Main.screenPosition, 8); + TrailDrawer.Draw(projectile.oldPos, projectile.Size * 0.5f - Main.screenPosition, 0, projectile.oldRot); return false; } diff --git a/Projectiles/Magic/FabRay.cs b/Projectiles/Magic/FabRay.cs index 6f934fab3a..2db4a6c8b8 100644 --- a/Projectiles/Magic/FabRay.cs +++ b/Projectiles/Magic/FabRay.cs @@ -78,10 +78,10 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { if (TrailDrawer is null) - TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, true, GameShaders.Misc["CalamityMod:FabstaffRay"]); + TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, specialShader: GameShaders.Misc["CalamityMod:FabstaffRay"]); - GameShaders.Misc["CalamityMod:FabstaffRay"].SetShaderTexture(ModContent.GetTexture("CalamityMod/ExtraTextures/FabstaffStreak")); - TrailDrawer.Draw(projectile.oldPos, projectile.Size * 0.5f - Main.screenPosition, 50); + GameShaders.Misc["CalamityMod:FabstaffRay"].SetShaderTexture(ModContent.GetTexture("CalamityMod/ExtraTextures/ScarletDevilStreak")); + TrailDrawer.Draw(projectile.oldPos, projectile.Size * 0.5f - Main.screenPosition, 76); return false; } diff --git a/Projectiles/Melee/PrismSawGlowmask.png b/Projectiles/Melee/PhotonRipperGlowmask.png similarity index 100% rename from Projectiles/Melee/PrismSawGlowmask.png rename to Projectiles/Melee/PhotonRipperGlowmask.png diff --git a/Projectiles/Melee/PrismSawProjectile.cs b/Projectiles/Melee/PhotonRipperProjectile.cs similarity index 63% rename from Projectiles/Melee/PrismSawProjectile.cs rename to Projectiles/Melee/PhotonRipperProjectile.cs index f6cc8371a2..679d3fc24f 100644 --- a/Projectiles/Melee/PrismSawProjectile.cs +++ b/Projectiles/Melee/PhotonRipperProjectile.cs @@ -1,5 +1,4 @@ -using CalamityMod.Dusts; -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; @@ -8,13 +7,15 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class PrismSawProjectile : ModProjectile + public class PhotonRipperProjectile : ModProjectile { public Player Owner => Main.player[projectile.owner]; + public const int CrystalShootRate = 5; + public const int ChargeUpTime = 5; public ref float Time => ref projectile.ai[0]; public ref float OriginalDamage => ref projectile.ai[1]; - public float ChargeUpPower => MathHelper.Clamp((float)Math.Pow(Time / 240f, 1.6D), 0f, 1f); - public override void SetStaticDefaults() => DisplayName.SetDefault("Verrrrrrrry over the top chainsaw thing"); + public float ChargeUpPower => MathHelper.Clamp((float)Math.Pow(Time / ChargeUpTime, 1.6D), 0f, 1f); + public override void SetStaticDefaults() => DisplayName.SetDefault("An extraordinarily cost inefficient chainsaw"); // Seriously though Draedon this seems a bit over the top lmfao. public override void SetDefaults() { @@ -26,17 +27,18 @@ namespace CalamityMod.Projectiles.Melee projectile.melee = true; projectile.ownerHitCheck = true; projectile.usesIDStaticNPCImmunity = true; - projectile.idStaticNPCHitCooldown = 2; + projectile.idStaticNPCHitCooldown = 8; } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { Texture2D texture = Main.projectileTexture[projectile.type]; - Texture2D glowmaskTexture = ModContent.GetTexture("CalamityMod/Projectiles/Melee/PrismSawGlowmask"); + Texture2D glowmaskTexture = ModContent.GetTexture("CalamityMod/Projectiles/Melee/PhotonRipperGlowmask"); Rectangle glowmaskRectangle = glowmaskTexture.Frame(1, 6, 0, projectile.frame); Vector2 origin = texture.Size() * 0.5f; Vector2 drawPosition = projectile.Center - Main.screenPosition; SpriteEffects direction = projectile.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(texture, drawPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, origin, projectile.scale, direction, 0f); spriteBatch.Draw(glowmaskTexture, drawPosition, glowmaskRectangle, Color.White, projectile.rotation, origin, projectile.scale, direction, 0f); return false; @@ -47,20 +49,23 @@ namespace CalamityMod.Projectiles.Melee PlayChainsawSounds(); DetermineDamage(); - Vector2 playerRotatedPoint = Owner.RotatedRelativePoint(Owner.MountedCenter); + // Determines the owner's position whilst incorporating their fullRotation field. + // It uses vector transformation on a Z rotation matrix based on said rotation under the hood. + // This is essentially just the pure mathematical definition of the RotatedBy method. + Vector2 playerRotatedPosition = Owner.RotatedRelativePoint(Owner.MountedCenter); if (Main.myPlayer == projectile.owner) { if (Owner.channel && !Owner.noItems && !Owner.CCed) - HandleChannelMovement(playerRotatedPoint); + HandleChannelMovement(playerRotatedPosition); else projectile.Kill(); } - DetermineVisuals(playerRotatedPoint); + DetermineVisuals(playerRotatedPosition); ManipulatePlayerValues(); EmitPrettyDust(); - if (Time > 90f && Time % 36f == 35f) + if (Time % CrystalShootRate == CrystalShootRate - 1f) ReleasePrismTeeth(); // Prevent the projectile from dying normally. However, if anything for whatever reason @@ -74,7 +79,7 @@ namespace CalamityMod.Projectiles.Melee { if (projectile.soundDelay <= 0) { - Main.PlaySound(SoundID.Item22, projectile.position); + Main.PlaySound(SoundID.Item22, projectile.Center); projectile.soundDelay = (int)MathHelper.Lerp(30f, 12f, ChargeUpPower); } } @@ -88,32 +93,38 @@ namespace CalamityMod.Projectiles.Melee projectile.netUpdate = true; } - // And then do time based calculations. This does not execute if the original damage is 0. + // And then do time based damage calculations. This does not execute if the original damage is 0. if (OriginalDamage != 0f) projectile.damage = (int)MathHelper.SmoothStep(OriginalDamage * 0.36f, OriginalDamage, ChargeUpPower); } - public void DetermineVisuals(Vector2 playerRotatedPoint) + public void DetermineVisuals(Vector2 playerRotatedPosition) { - float velocityAngle = projectile.velocity.ToRotation(); - projectile.rotation = velocityAngle; + float directionAngle = projectile.velocity.ToRotation(); + projectile.rotation = directionAngle; int oldDirection = projectile.spriteDirection; if (oldDirection == -1) projectile.rotation += MathHelper.Pi; - projectile.direction = projectile.spriteDirection = (Math.Cos(velocityAngle) > 0).ToDirectionInt(); + projectile.direction = projectile.spriteDirection = (Math.Cos(directionAngle) > 0).ToDirectionInt(); + // If the direction differs from what it originaly was, undo the previous 180 degree turn. + // If this is not done, the chainsaw will have 1 frame of rotational "jitter" when the direction changes based on the + // original angle. This effect looks very strange in-game. if (projectile.spriteDirection != oldDirection) projectile.rotation -= MathHelper.Pi; - // Positioning close to the end of the player's arm. - projectile.position = playerRotatedPoint - projectile.Size * 0.5f + velocityAngle.ToRotationVector2() * 30f; + // Positioning close to the player's arm. + projectile.position = playerRotatedPosition - projectile.Size * 0.5f + directionAngle.ToRotationVector2() * 30f; // Update the position a tiny bit every frame at random to make it look like the saw is vibrating. + // It is reset on the next frame. projectile.position += Main.rand.NextVector2Circular(1.4f, 1.4f); // Update glowmask frames. + // Smoothstep is essentially like a linear interpolation but instead of being a straight line its + // curve is pseudo-logistic, with low increases at the ends of the curve. projectile.frameCounter += (int)MathHelper.SmoothStep(12f, 33f, ChargeUpPower); if (projectile.frameCounter >= 32) { @@ -122,28 +133,23 @@ namespace CalamityMod.Projectiles.Melee } } - public void HandleChannelMovement(Vector2 playerRotatedPoint) + public void HandleChannelMovement(Vector2 playerRotatedPosition) { - float speed = 1f; - if (Owner.ActiveItem().shoot == projectile.type) - speed = Owner.ActiveItem().shootSpeed * projectile.scale; + Vector2 idealAimDirection = (Main.MouseWorld - playerRotatedPosition).SafeNormalize(Vector2.UnitX * Owner.direction); - Vector2 currentAimDirection = projectile.velocity.SafeNormalize(Vector2.UnitX * Owner.direction); - Vector2 idealAimDirection = (Main.MouseWorld - playerRotatedPoint).SafeNormalize(Vector2.UnitX * Owner.direction); - - float angularAimVelocity = 0.16f; + float angularAimVelocity = 0.15f; float directionAngularDisparity = projectile.velocity.AngleBetween(idealAimDirection) / MathHelper.Pi; // Increase the turn speed if close to the ideal direction, since successive linear interpolations // are asymptotic. angularAimVelocity += MathHelper.Lerp(0f, 0.25f, Utils.InverseLerp(0.28f, 0.08f, directionAngularDisparity, true)); - if (directionAngularDisparity < 0.02f) - projectile.velocity = Vector2.Lerp(currentAimDirection, idealAimDirection, angularAimVelocity); + if (directionAngularDisparity > 0.02f) + projectile.velocity = Vector2.Lerp(projectile.velocity, idealAimDirection, angularAimVelocity); else projectile.velocity = idealAimDirection; - projectile.velocity = projectile.velocity.SafeNormalize(Vector2.UnitX * Owner.direction) * speed; + projectile.velocity = projectile.velocity.SafeNormalize(Vector2.UnitX * Owner.direction); } public void ManipulatePlayerValues() @@ -163,6 +169,9 @@ namespace CalamityMod.Projectiles.Melee for (int i = 0; i < 2; i++) { Vector2 spawnPosition = projectile.Center + projectile.velocity * 35f; + + // Spawn the dust a little bit on the chainsaw. X variance is less than Y variance to ensure that dust does not + // spawn too far from the blade. spawnPosition += Main.rand.NextVector2CircularEdge(9f, 35f).RotatedBy(projectile.velocity.ToRotation() + MathHelper.PiOver2); Dust rainbowSpark = Dust.NewDustPerfect(spawnPosition, 261); @@ -175,11 +184,27 @@ namespace CalamityMod.Projectiles.Melee public void ReleasePrismTeeth() { + // Play the sound that the crystal vile shard uses. + // Hopefully this isn't too cancerous to listen to, given the shoot rate of the crystals. + Main.PlaySound(SoundID.Item101, projectile.Center); + if (Main.myPlayer != projectile.owner) return; - float shootReach = MathHelper.SmoothStep(projectile.width * 1.2f, projectile.width * 2.25f + 20f, ChargeUpPower); - Projectile.NewProjectile(Owner.Center, projectile.velocity, ModContent.ProjectileType(), projectile.damage / 2, 0f, projectile.owner, 0f, shootReach); + float shootReach = MathHelper.SmoothStep(projectile.width * 1.8f, projectile.width * 5.3f + 16f, ChargeUpPower); + + // Incorporate item shoot speed into the range of the crystals. + shootReach *= Owner.ActiveItem().shootSpeed; + + float distanceFromMouse = Owner.Distance(Main.MouseWorld); + + // If the distance to the mouse is less than the base reach, reach only to mouse. + // This way the player can more directly control the crystals if they want. + // This comes with a small constant offset to cancel out other factors. + if (distanceFromMouse < shootReach && distanceFromMouse > 40f) + shootReach = distanceFromMouse + 32f; + + Projectile.NewProjectile(Owner.Center, projectile.velocity, ModContent.ProjectileType(), projectile.damage / 2, 0f, projectile.owner, shootReach, projectile.whoAmI); } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) diff --git a/Projectiles/Melee/PrismSawProjectile.png b/Projectiles/Melee/PhotonRipperProjectile.png similarity index 100% rename from Projectiles/Melee/PrismSawProjectile.png rename to Projectiles/Melee/PhotonRipperProjectile.png diff --git a/Projectiles/Melee/PrismTooth.cs b/Projectiles/Melee/PrismTooth.cs index 60f7eb5841..f916eda231 100644 --- a/Projectiles/Melee/PrismTooth.cs +++ b/Projectiles/Melee/PrismTooth.cs @@ -1,8 +1,8 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; -using System.IO; using Terraria; +using Terraria.GameContent.Achievements; using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; @@ -12,86 +12,125 @@ namespace CalamityMod.Projectiles.Melee public class PrismTooth : ModProjectile { internal PrimitiveTrail TrailDrawer; - public const int Lifetime = 30; + public const int Lifetime = 80; public Player Owner => Main.player[projectile.owner]; - public ref float Time => ref projectile.ai[0]; - public ref float ShootReach => ref projectile.ai[1]; + public ref float ShootReach => ref projectile.ai[0]; + public ref float Time => ref projectile.ai[1]; public override void SetStaticDefaults() - { - DisplayName.SetDefault("Prism Tooth"); + { + DisplayName.SetDefault("Prism Tooth"); ProjectileID.Sets.TrailingMode[projectile.type] = 2; ProjectileID.Sets.TrailCacheLength[projectile.type] = 36; } - public override void SetDefaults() - { - projectile.width = projectile.height = 35; + public override void SetDefaults() + { + projectile.scale = 0.6f; + projectile.width = projectile.height = 40; projectile.friendly = true; - projectile.penetrate = 1; - projectile.timeLeft = Lifetime; - projectile.melee = true; - } - - public override void SendExtraAI(BinaryWriter writer) => writer.Write((byte)projectile.direction); - - public override void ReceiveExtraAI(BinaryReader reader) => projectile.direction = reader.ReadByte(); + projectile.tileCollide = false; + projectile.penetrate = -1; + projectile.extraUpdates = 5; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 4 * projectile.MaxUpdates; + projectile.timeLeft = Lifetime; + projectile.melee = true; + } public override void AI() { - // Determine the initial direction of the tooth in terms of its orbit. - if (Main.myPlayer == projectile.owner && projectile.spriteDirection == 0) - { - projectile.spriteDirection = Main.rand.NextBool(2).ToDirectionInt(); - projectile.netUpdate = true; - } + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.Pi * Time / Lifetime; - projectile.rotation = MathHelper.Pi * Time / Lifetime; - if (projectile.spriteDirection == -1) - projectile.rotation = MathHelper.Pi - projectile.rotation; - projectile.rotation += projectile.velocity.ToRotation(); + Vector2 baseDirection = (MathHelper.TwoPi * Time / Lifetime - MathHelper.PiOver2).ToRotationVector2(); + baseDirection.X *= 0.25f; + + // Constrain the Y offset into the bounds of 0-1 instead of -1-1. This prevents + // the crystal from flying behind the owner. In this context, the Y offset becomes how far away the + // crystal is from its own in terms of reach. + baseDirection.Y = baseDirection.Y * 0.5f + 0.5f; + Vector2 positionOffset = baseDirection * ShootReach; + + // Don't allow the X offset to go too far. + // This hard limit turns the squashed circle into bending, semi-rectangular shape. + if (Math.Abs(positionOffset.X) > 45f) + positionOffset.X = Math.Sign(baseDirection.X) * 45f; // In this context, the velocity is simply the initial direction as a unit vector- it does not // actually influence movement in any way. - float angle = MathHelper.TwoPi * Time / Lifetime - MathHelper.PiOver2; - if (projectile.spriteDirection == -1) - angle += MathHelper.Pi; + positionOffset = positionOffset.RotatedBy(projectile.velocity.ToRotation() - MathHelper.PiOver2); - Vector2 baseDirection = angle.ToRotationVector2(); - baseDirection.X *= 0.25f; - baseDirection.Y = baseDirection.Y * 0.5f + 0.5f; - baseDirection = baseDirection.RotatedBy(projectile.velocity.ToRotation() - MathHelper.PiOver2); - - projectile.Center = Owner.RotatedRelativePoint(Owner.MountedCenter) + baseDirection * ShootReach; + projectile.Center = Owner.RotatedRelativePoint(Owner.MountedCenter) + projectile.velocity * 42f + positionOffset; projectile.Opacity = Utils.InverseLerp(0f, 12f, Time, true) * Utils.InverseLerp(Lifetime, Lifetime - 12f, Time, true); + // Destroy trees within the range of the past 20 oldPos positions. + for (int i = 0; i < 20; i++) + { + Point pointToCheck = (projectile.oldPos[i] + projectile.Size * 0.5f).ToTileCoordinates(); + AbsolutelyFuckingAnnihilateTrees(pointToCheck.X, pointToCheck.Y); + } + Time++; } - public override Color? GetAlpha(Color lightColor) + public void AbsolutelyFuckingAnnihilateTrees(int x, int y) { - float hue = (projectile.identity % 9f / 9f + projectile.timeLeft / (float)Lifetime) % 1f; - return Color.Lerp(lightColor, Main.hslToRgb(hue, 0.95f, 0.55f), 0.35f) * projectile.Opacity; + Tile tileAtPosition = CalamityUtils.ParanoidTileRetrieval(x, y); + + // Ignore tiles that are not active and are not breakable by axes. + if (!tileAtPosition.active() || !Main.tileAxe[tileAtPosition.type]) + return; + + // Don't attempt to mine the tile if for whatever reason it's not supposed to be broken. + if (!WorldGen.CanKillTile(x, y)) + return; + + AchievementsHelper.CurrentlyMining = true; + + WorldGen.KillTile(x, y); + if (Main.netMode == NetmodeID.MultiplayerClient) + NetMessage.SendData(MessageID.TileChange, -1, -1, null, 0, x, y); + + AchievementsHelper.CurrentlyMining = false; } - internal float WidthFunction(float completionRatio) => 54f; + public override Color? GetAlpha(Color lightColor) => Color.White; + + internal float WidthFunction(float completionRatio) => projectile.scale * 24f * (1f - Utils.InverseLerp(0.7f, 1f, completionRatio, true)); internal Color ColorFunction(float completionRatio) { - Color color = Color.Lerp(Color.White, Color.Violet, Utils.InverseLerp(0f, 0.7f, completionRatio, true)) * (1f - Utils.InverseLerp(0f, 0.98f, completionRatio, true)); - color.A /= 2; - return color; + float hue = (projectile.identity % 9f / 9f + completionRatio * 0.7f) % 1f; + return Color.Lerp(Color.White, Main.hslToRgb(hue, 0.95f, 0.55f), 0.35f) * projectile.Opacity; } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - if (TrailDrawer is null) - TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, false, GameShaders.Misc["CalamityMod:OverpoweredTouhouSpearShader"]); + if (Time <= 5f) + return true; - GameShaders.Misc["CalamityMod:OverpoweredTouhouSpearShader"].SetShaderTexture(ModContent.GetTexture("CalamityMod/ExtraTextures/ScarletDevilStreak")); - TrailDrawer.Draw(projectile.oldPos, projectile.Size * 0.5f - Main.screenPosition + projectile.velocity.SafeNormalize(Vector2.Zero) * 86f, 60); + if (TrailDrawer is null) + TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, specialShader: GameShaders.Misc["CalamityMod:PrismCrystal"]); + + // Variable adjustment vector used to prevent the trail for starting somewhat that isn't behind + // the crystal. This may appear in small amounts, with offsets of a few pixels, but at the speed + // these crystals go, it's probably not something to worry too much about. + Vector2 generalOffset = projectile.rotation.ToRotationVector2().RotatedBy(MathHelper.PiOver2) * 15f; + generalOffset += projectile.rotation.ToRotationVector2() * -5f * (float)Math.Sin(projectile.rotation); + + // Mess with the oldPos array so that the trail always points towards the crystal. + Vector2 oldPosition = projectile.oldPos[1]; + projectile.oldPos[1] = projectile.oldPos[0] - projectile.rotation.ToRotationVector2() * Vector2.Distance(projectile.oldPos[0], projectile.oldPos[1]); + + // Revert back if the above calculations caused any NaNs. + if (projectile.oldPos[1].HasNaNs()) + projectile.oldPos[1] = oldPosition; + + GameShaders.Misc["CalamityMod:PrismCrystal"].SetShaderTexture(ModContent.GetTexture("CalamityMod/ExtraTextures/ScarletDevilStreak")); + TrailDrawer.Draw(projectile.oldPos, projectile.Size * 0.5f + generalOffset - Main.screenPosition, 65); return true; } + // Prevent the crystals from utilizing velocity. Their movement is entirely dependant on Center setting. public override bool ShouldUpdatePosition() => false; } } diff --git a/Projectiles/Rogue/ScarletDevilProjectile.cs b/Projectiles/Rogue/ScarletDevilProjectile.cs index a6921e3e08..6a438a2b93 100644 --- a/Projectiles/Rogue/ScarletDevilProjectile.cs +++ b/Projectiles/Rogue/ScarletDevilProjectile.cs @@ -176,7 +176,7 @@ namespace CalamityMod.Projectiles.Rogue else { if (TrailDrawer is null) - TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, false, GameShaders.Misc["CalamityMod:OverpoweredTouhouSpearShader"]); + TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, PrimitiveTrail.RigidPointRetreivalFunction, GameShaders.Misc["CalamityMod:OverpoweredTouhouSpearShader"]); GameShaders.Misc["CalamityMod:OverpoweredTouhouSpearShader"].SetShaderTexture(ModContent.GetTexture("CalamityMod/ExtraTextures/ScarletDevilStreak")); TrailDrawer.Draw(projectile.oldPos, projectile.Size * 0.5f - Main.screenPosition + projectile.velocity.SafeNormalize(Vector2.Zero) * 86f, 60); diff --git a/Projectiles/Summon/DaedalusLightning.cs b/Projectiles/Summon/DaedalusLightning.cs index e451cc00e3..056a522d17 100644 --- a/Projectiles/Summon/DaedalusLightning.cs +++ b/Projectiles/Summon/DaedalusLightning.cs @@ -140,7 +140,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { if (LightningDrawer is null) - LightningDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, false); + LightningDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, PrimitiveTrail.RigidPointRetreivalFunction); LightningDrawer.Draw(projectile.oldPos.Where(oldPos => oldPos != Vector2.Zero), projectile.Size * 0.5f - Main.screenPosition, 300); return false; diff --git a/TrailGeneration/PrimitiveTrail.cs b/TrailGeneration/PrimitiveTrail.cs index 9037ad0311..7294706863 100644 --- a/TrailGeneration/PrimitiveTrail.cs +++ b/TrailGeneration/PrimitiveTrail.cs @@ -38,21 +38,24 @@ namespace CalamityMod public VertexWidthFunction WidthFunction; public VertexColorFunction ColorFunction; - // NOTE: Beziers can be laggy when a lot of control points are used, since our implementation - // uses a recursive Lerp that gets more computationally expensive the more original indices. - // n(n - 1)/2 linear interpolations to be precise, where n is the amount of original indices. - public bool UsesSmoothening; public BasicEffect BaseEffect; public MiscShaderData SpecialShader; + public TrailPointRetrievalFunction TrailPointFunction; - public PrimitiveTrail(VertexWidthFunction widthFunction, VertexColorFunction colorFunction, bool useSmoothening = true, MiscShaderData specialShader = null) + public delegate List TrailPointRetrievalFunction(IEnumerable originalPositions, Vector2 generalOffset, int totalTrailPoints, IEnumerable originalRotations = null); + + public PrimitiveTrail(VertexWidthFunction widthFunction, VertexColorFunction colorFunction, TrailPointRetrievalFunction pointFunction = null, MiscShaderData specialShader = null) { if (widthFunction is null || colorFunction is null) throw new NullReferenceException($"In order to create a primitive trail, a non-null {(widthFunction is null ? "width" : "color")} function must be specified."); WidthFunction = widthFunction; ColorFunction = colorFunction; - UsesSmoothening = useSmoothening; + // Default to bezier smoothening if nothing else is inputted. + if (pointFunction is null) + pointFunction = SmoothBezierPointRetreivalFunction; + + TrailPointFunction = pointFunction; if (specialShader != null) SpecialShader = specialShader; @@ -90,29 +93,31 @@ namespace CalamityMod BaseEffect.Projection = effectProjection; } - public List GetTrailPoints(IEnumerable originalPositions, Vector2 generalOffset, int totalTrailPoints) + public static List RigidPointRetreivalFunction(IEnumerable originalPositions, Vector2 generalOffset, int totalTrailPoints, IEnumerable originalRotations = null) { - // Don't smoothen the points unless explicitly told do so. - if (!UsesSmoothening) - { - List basePoints = originalPositions.Where(originalPosition => originalPosition != Vector2.Zero).ToList(); - List endPoints = new List(); + List basePoints = originalPositions.Where(originalPosition => originalPosition != Vector2.Zero).ToList(); + List endPoints = new List(); - if (basePoints.Count < 3) - return endPoints; - - // Remap the original positions across a certain length. - for (int i = 0; i < totalTrailPoints; i++) - { - float completionRatio = i / (float)totalTrailPoints; - int currentColorIndex = (int)(completionRatio * (basePoints.Count - 1)); - Vector2 currentColor = basePoints[currentColorIndex]; - Vector2 nextColor = basePoints[(currentColorIndex + 1) % basePoints.Count]; - endPoints.Add(Vector2.Lerp(currentColor, nextColor, completionRatio * (basePoints.Count - 1) % 0.999f) + generalOffset); - } + if (basePoints.Count < 3) return endPoints; - } + // Remap the original positions across a certain length. + for (int i = 0; i < totalTrailPoints; i++) + { + float completionRatio = i / (float)totalTrailPoints; + int currentColorIndex = (int)(completionRatio * (basePoints.Count - 1)); + Vector2 currentColor = basePoints[currentColorIndex]; + Vector2 nextColor = basePoints[(currentColorIndex + 1) % basePoints.Count]; + endPoints.Add(Vector2.Lerp(currentColor, nextColor, completionRatio * (basePoints.Count - 1) % 0.999f) + generalOffset); + } + return endPoints; + } + + // NOTE: Beziers can be laggy when a lot of control points are used, since our implementation + // uses a recursive Lerp that gets more computationally expensive the more original indices. + // n(n + 1)/2 linear interpolations to be precise, where n is the amount of original indices. + public static List SmoothBezierPointRetreivalFunction(IEnumerable originalPositions, Vector2 generalOffset, int totalTrailPoints, IEnumerable originalRotations = null) + { List controlPoints = new List(); for (int i = 0; i < originalPositions.Count(); i++) { @@ -126,6 +131,32 @@ namespace CalamityMod return controlPoints.Count <= 1 ? controlPoints : bezierCurve.GetPoints(totalTrailPoints); } + public static List SmoothCatmullRomPointRetreivalFunction(IEnumerable originalPositions, Vector2 generalOffset, int totalTrailPoints, IEnumerable originalRotations) + { + List smoothenedPoints = new List(); + for (int i = 0; i < originalPositions.Count() - 1; i++) + { + if (originalPositions.ElementAt(i) == Vector2.Zero || originalPositions.ElementAt(i + 1) == Vector2.Zero) + continue; + + float currentRotation = MathHelper.WrapAngle(originalRotations.ElementAt(i)); + float aheadRotation = MathHelper.WrapAngle(originalRotations.ElementAt(i + 1)); + int pointsToAdd = (int)(Math.Abs(aheadRotation - currentRotation) * 50f / MathHelper.Pi) + 4; + if (pointsToAdd > 6) + { + int v = 7; + } + + float segmentLength = Vector2.Distance(originalPositions.ElementAt(i), originalPositions.ElementAt(i + 1)); + float increment = 1f / (pointsToAdd + 2); + Vector2 end = originalPositions.ElementAt(i) + currentRotation.ToRotationVector2() * segmentLength; + Vector2 front = originalPositions.ElementAt(i + 1) + aheadRotation.ToRotationVector2() * -segmentLength; + for (float j = increment; j < 1f; j += increment) + smoothenedPoints.Add(Vector2.CatmullRom(end, originalPositions.ElementAt(i), originalPositions.ElementAt(i + 1), front, j) + generalOffset); + } + return smoothenedPoints; + } + public VertexPosition2DColor[] GetVerticesFromTrailPoints(List trailPoints) { List vertices = new List(); @@ -181,19 +212,29 @@ namespace CalamityMod return indices; } - public void Draw(IEnumerable originalPositions, Vector2 generalOffset, int totalTrailPoints) + public void Draw(IEnumerable originalPositions, Vector2 generalOffset, int totalTrailPoints, IEnumerable originalRotations = null) { Main.instance.GraphicsDevice.RasterizerState = RasterizerState.CullNone; - List trailPoints = GetTrailPoints(originalPositions, generalOffset, totalTrailPoints); + List trailPoints = TrailPointFunction(originalPositions, generalOffset, totalTrailPoints, originalRotations); // A trail with only one point or less has nothing to connect to, and therefore, can't make a trail. - if (originalPositions.Count() <= 1 || trailPoints.Count <= 1) + if (originalPositions.Count() <= 2 || trailPoints.Count <= 2) + return; + + // If the trail point has any NaN positions, don't draw anything. + if (trailPoints.Any(point => point.HasNaNs())) return; UpdateBaseEffect(out Matrix projection, out Matrix view); VertexPosition2DColor[] vertices = GetVerticesFromTrailPoints(trailPoints); + short[] triangleIndices = GetIndicesFromTrailPoints(trailPoints.Count); + // Don't draw anything if the indicies/vertices are in any way invalid. + // If they are, the graphics engine, along with the entire game, will crash. + if (triangleIndices.Length % 6 != 0 || vertices.Length % 2 != 0) + return; + if (SpecialShader != null) { SpecialShader.Shader.Parameters["uWorldViewProjection"].SetValue(view * projection); From 168bd66889f0bec92497ef221c8712d27253b9b8 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 20 Feb 2021 15:27:51 -0600 Subject: [PATCH 051/202] Tooltip fix --- Items/Weapons/Melee/PhotonRipper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Melee/PhotonRipper.cs b/Items/Weapons/Melee/PhotonRipper.cs index fad70e541b..8d1c565fff 100644 --- a/Items/Weapons/Melee/PhotonRipper.cs +++ b/Items/Weapons/Melee/PhotonRipper.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Melee { DisplayName.SetDefault("Photon Ripper"); Tooltip.SetDefault("Unleashes a flurry of prismatic crystals at extremely fast speeds\n" + - ""); + "These crystals are capable of breaking trees"); } public override void SetDefaults() From 683ac6f85b489f340640e81c1cc94c6c1b3403f4 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Mon, 22 Feb 2021 21:23:26 -0600 Subject: [PATCH 052/202] Corrected Photon Ripper charge time --- Projectiles/Melee/PhotonRipperProjectile.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projectiles/Melee/PhotonRipperProjectile.cs b/Projectiles/Melee/PhotonRipperProjectile.cs index 679d3fc24f..408fb5021c 100644 --- a/Projectiles/Melee/PhotonRipperProjectile.cs +++ b/Projectiles/Melee/PhotonRipperProjectile.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Melee { public Player Owner => Main.player[projectile.owner]; public const int CrystalShootRate = 5; - public const int ChargeUpTime = 5; + public const int ChargeUpTime = 360; public ref float Time => ref projectile.ai[0]; public ref float OriginalDamage => ref projectile.ai[1]; public float ChargeUpPower => MathHelper.Clamp((float)Math.Pow(Time / ChargeUpTime, 1.6D), 0f, 1f); From 890c66b5fe2066c2309d4640e84ea65f718391ad Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Tue, 23 Feb 2021 18:17:05 -0600 Subject: [PATCH 053/202] Buff typo fix --- Buffs/Summon/EyeOfNightBuff.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Buffs/Summon/EyeOfNightBuff.cs b/Buffs/Summon/EyeOfNightBuff.cs index 8bbb1098c3..db3f86b42b 100644 --- a/Buffs/Summon/EyeOfNightBuff.cs +++ b/Buffs/Summon/EyeOfNightBuff.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Buffs.Summon { public override void SetDefaults() { - DisplayName.SetDefault("Eye ofNight"); + DisplayName.SetDefault("Eye of Night"); Description.SetDefault("It eerily watches"); Main.buffNoTimeDisplay[Type] = true; Main.buffNoSave[Type] = true; From 34a6c6594fc3c653d9b81af56d525f680753c3a5 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 24 Feb 2021 13:27:48 -0600 Subject: [PATCH 054/202] Added the Spine of Thanatos --- Items/Weapons/Melee/SpineOfThanatos.cs | 51 ++++ Items/Weapons/Melee/SpineOfThanatos.png | Bin 0 -> 1316 bytes Projectiles/Melee/PrismRay.cs | 219 ++++++++++++++++++ Projectiles/Melee/SpineOfThanatosBody1.png | Bin 0 -> 1120 bytes .../Melee/SpineOfThanatosBody1Glowmask.png | Bin 0 -> 282 bytes Projectiles/Melee/SpineOfThanatosBody2.png | Bin 0 -> 710 bytes .../Melee/SpineOfThanatosBody2Glowmask.png | Bin 0 -> 239 bytes .../Melee/SpineOfThanatosProjectile.cs | 219 ++++++++++++++++++ .../Melee/SpineOfThanatosProjectile.png | Bin 0 -> 1563 bytes .../SpineOfThanatosProjectileGlowmask.png | Bin 0 -> 287 bytes Projectiles/Melee/SpineOfThanatosTail.png | Bin 0 -> 1386 bytes .../Melee/SpineOfThanatosTailGlowmask.png | Bin 0 -> 351 bytes Projectiles/Ranged/ExoLight.cs | 8 + Utilities/MathematicalUtils.cs | 8 + Utilities/ProjectileUtils.cs | 7 +- 15 files changed, 510 insertions(+), 2 deletions(-) create mode 100644 Items/Weapons/Melee/SpineOfThanatos.cs create mode 100644 Items/Weapons/Melee/SpineOfThanatos.png create mode 100644 Projectiles/Melee/PrismRay.cs create mode 100644 Projectiles/Melee/SpineOfThanatosBody1.png create mode 100644 Projectiles/Melee/SpineOfThanatosBody1Glowmask.png create mode 100644 Projectiles/Melee/SpineOfThanatosBody2.png create mode 100644 Projectiles/Melee/SpineOfThanatosBody2Glowmask.png create mode 100644 Projectiles/Melee/SpineOfThanatosProjectile.cs create mode 100644 Projectiles/Melee/SpineOfThanatosProjectile.png create mode 100644 Projectiles/Melee/SpineOfThanatosProjectileGlowmask.png create mode 100644 Projectiles/Melee/SpineOfThanatosTail.png create mode 100644 Projectiles/Melee/SpineOfThanatosTailGlowmask.png diff --git a/Items/Weapons/Melee/SpineOfThanatos.cs b/Items/Weapons/Melee/SpineOfThanatos.cs new file mode 100644 index 0000000000..47e7275d91 --- /dev/null +++ b/Items/Weapons/Melee/SpineOfThanatos.cs @@ -0,0 +1,51 @@ +using CalamityMod.Projectiles.Melee; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Melee +{ + public class SpineOfThanatos : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Spine of Thanatos"); + Tooltip.SetDefault("Releases 3 fast metallic whips outward\n" + + "Once all three collide, a prism of light is shot outward\n" + + "If an enemy is within the line of sight of the whips on collision, the light will fire towards it"); + } + + public override void SetDefaults() + { + item.width = item.height = 28; + item.damage = 1450; + item.rare = ItemRarityID.Red; + item.value = CalamityGlobalItem.RarityVioletBuyPrice; + item.Calamity().customRarity = CalamityRarity.Violet; + item.noMelee = true; + item.noUseGraphic = true; + item.channel = true; + item.autoReuse = true; + item.melee = true; + item.useAnimation = item.useTime = 24; + item.useStyle = ItemUseStyleID.HoldingOut; + item.knockBack = 8f; + item.UseSound = SoundID.Item68; + item.shootSpeed = 1f; + item.shoot = ModContent.ProjectileType(); + } + + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 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) + { + for (int i = 0; i < 2; i++) + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, (i == 0f).ToDirectionInt()); + + // Create a third, final whip that does not swing around at all and instead simply flies towards the mouse. + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f); + return false; + } + } +} diff --git a/Items/Weapons/Melee/SpineOfThanatos.png b/Items/Weapons/Melee/SpineOfThanatos.png new file mode 100644 index 0000000000000000000000000000000000000000..cbac11a0602009a38bb5499a98804ceda9be18dd GIT binary patch literal 1316 zcmV+<1>5?GP)IJk)R;>ftV=(~w`ZEgQ zp8i44aaXTQD#v>V4p;!U=5ExwgoY?0Zc_Hd697z~yXa}dq6Z&(1b~74L(2PexhduS zb7#*4UIXm(ExKlBazQS$t;vq z!06+qDP$*kk}s{V0}xLnl%1CuAG60@vX6t34=wQ^_EiBG`zUW89D4(R?}k57P7?AW z*#WiMo=NGRUJD%JPhPVTUl>s_+t*KjaRd`S1hR6YIUhCdm$x>P=n`51j^} z^yy4>v=)e_>F@i74AFMX?A*VG%6aV9U{*MF}CkYBh7z{t^201C?s6}NF! zzQcluxTie(>OrsNQq@(!++orC03ylJ^-fEE-u6ZJW$oxw{4=kR*KIu_?x8?^b&)B9 z6AAe{cWhI?IX9z35s^d_lb6@Y%eSxVe-!|K@)2>9QU@OfVDlv4Z@qf+%iVSP zMG?KvZjyL=Kk}l8xJeybee&CDs};;GI~09K1dSK{$_!UE@6lvXLU a#Qz1|8XsSksK^Nb0000 CalamityUtils.MulticolorLerp(RayHue, ExoPalette); + public Color HueDownscaledRayColor => RayColor * 0.66f; + public ref float RayHue => ref projectile.ai[0]; + public ref float Time => ref projectile.localAI[1]; + public static readonly Color[] ExoPalette = new Color[] + { + new Color(250, 255, 112), + new Color(211, 235, 108), + new Color(166, 240, 105), + new Color(105, 240, 220), + new Color(64, 130, 145), + new Color(145, 96, 145), + new Color(242, 112, 73), + new Color(199, 62, 62), + }; + public const int Lifetime = 30; + public override string Texture => "CalamityMod/Projectiles/StarProj"; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Prismatic Light"); + ProjectileID.Sets.MinionShot[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 14; + projectile.alpha = 255; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.ignoreWater = true; + projectile.timeLeft = 900; + projectile.friendly = true; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + projectile.melee = true; + } + + public override void AI() + { + DelegateMethods.v3_1 = RayColor.ToVector3() * 0.5f; + Utils.PlotTileLine(StartingPosition, projectile.Center, 8f, new Utils.PerLinePoint(DelegateMethods.CastLight)); + if (projectile.localAI[0] == 0f) + { + projectile.direction = Main.rand.NextBool(2).ToDirectionInt(); + projectile.localAI[0] = 1f; + } + projectile.rotation = Time / 20f * MathHelper.TwoPi * projectile.direction; + projectile.alpha = Utils.Clamp(projectile.alpha - 18, 0, 255); + if (projectile.alpha == 0) + Lighting.AddLight(projectile.Center, RayColor.ToVector3() * 0.5f); + + for (int i = 0; i < 2; i++) + { + if (Main.rand.NextBool(10)) + { + Dust verticalMagic = Dust.NewDustDirect(projectile.Center, 0, 0, 267, 0f, 0f, 225, RayColor, 1.5f); + verticalMagic.noGravity = true; + verticalMagic.noLight = true; + verticalMagic.scale = projectile.Opacity; + verticalMagic.position = projectile.Center; + verticalMagic.velocity = Vector2.UnitY.RotatedBy(projectile.rotation + MathHelper.TwoPi * i / 2f) * 2.5f; + } + } + if (Main.rand.NextBool(10)) + { + Vector2 dustSpawnPosition = projectile.Center + Main.rand.NextVector2Unit() * Main.rand.NextFloat(20f, 120f); + Point dustTileCoords = dustSpawnPosition.ToTileCoordinates(); + bool canSpawnDust = true; + if (!WorldGen.InWorld(dustTileCoords.X, dustTileCoords.Y, 0)) + canSpawnDust = false; + + if (canSpawnDust && WorldGen.SolidTile(dustTileCoords.X, dustTileCoords.Y)) + canSpawnDust = false; + + if (canSpawnDust) + { + Dust risingMagic = Dust.NewDustDirect(dustSpawnPosition, 0, 0, 267, 0f, 0f, 127, RayColor, 1f); + risingMagic.noGravity = true; + risingMagic.position = dustSpawnPosition; + risingMagic.velocity = -Vector2.UnitY * Main.rand.NextFloat(1.6f, 7.5f); + risingMagic.fadeIn = Main.rand.NextFloat(1f, 2f); + risingMagic.scale = Main.rand.NextFloat(0.6f, 1.2f); + risingMagic.noLight = true; + + risingMagic = Dust.CloneDust(risingMagic); + risingMagic.scale *= 0.65f; + risingMagic.fadeIn *= 0.65f; + risingMagic.color = new Color(255, 255, 255, 255); + } + } + projectile.scale = projectile.Opacity * 0.5f; + projectile.velocity = Vector2.Zero; + + Time++; + if (Time >= Lifetime) + projectile.Kill(); + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + float _ = 0f; + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), StartingPosition, projectile.Center, projectile.scale * 22f, ref _); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Vector2 baseDrawPosition = projectile.Center + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; + Texture2D texture = Main.projectileTexture[projectile.type]; + Rectangle frame = texture.Frame(1, Main.projFrames[projectile.type], 0, projectile.frame); + Vector2 origin = frame.Size() / 2f; + Color fadedRayColor = projectile.GetAlpha(lightColor); + Color fullbrightRayColor = HueDownscaledRayColor.MultiplyRGBA(new Color(255, 255, 255, 0)); + + // Draw the stars at the end of the laser. + for (int i = 0; i < 6; i++) + { + Vector2 drawPosition = baseDrawPosition + (MathHelper.TwoPi * i / 6f + Main.GlobalTime * 3f).ToRotationVector2() * projectile.scale * 4f; + spriteBatch.Draw(texture, drawPosition, frame, fullbrightRayColor, projectile.rotation, origin, projectile.scale * 2f, SpriteEffects.None, 0f); + spriteBatch.Draw(texture, drawPosition, frame, fullbrightRayColor, 0f, origin, projectile.scale * 2f, SpriteEffects.None, 0f); + } + + // Draw the shimmering ray itself. + if (projectile.Opacity > 0.3f) + { + Vector2 drawOffset = (StartingPosition - projectile.Center) * 0.5f; + Vector2 scale = new Vector2(1f, drawOffset.Length() * 2f / texture.Height); + float rotation = drawOffset.ToRotation() + MathHelper.PiOver2; + + // This factor causes the opacity to flash rather quickly. + float drawFade = MathHelper.Clamp(MathHelper.Distance(Lifetime * 0.5f, Time) / (Lifetime * 0.667f), 0f, 1f); + + for (int i = 0; i < 3; i++) + { + Vector2 drawPosition = baseDrawPosition; + drawPosition += (MathHelper.TwoPi * i / 3f + Main.GlobalTime * 3f).ToRotationVector2() * projectile.scale * 2.5f; + drawPosition += drawOffset; + + spriteBatch.Draw(texture, drawPosition, frame, fullbrightRayColor * drawFade * 0.8f, rotation, origin, scale, SpriteEffects.None, 0f); + spriteBatch.Draw(texture, drawPosition, frame, fadedRayColor * drawFade * 0.8f, rotation, origin, scale * 0.5f, SpriteEffects.None, 0f); + } + } + return false; + } + + public override void Kill(int timeLeft) + { + CreateKillExplosionBurstDust(Main.rand.Next(7, 13)); + + // Adjust values and do damage before dying. + if (Main.myPlayer != projectile.owner) + return; + + Vector2 oldSize = projectile.Size; + projectile.position = projectile.Center; + projectile.width = projectile.height = 60; + projectile.Center = projectile.position; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + projectile.Damage(); + projectile.position = projectile.Center; + projectile.Size = oldSize; + projectile.Center = projectile.position; + } + + public void CreateKillExplosionBurstDust(int dustCount) + { + if (Main.dedServ) + return; + + Vector2 baseExplosionDirection = -Vector2.UnitY.RotatedByRandom(MathHelper.Pi) * 3f; + Vector2 outwardFireSpeedFactor = new Vector2(2.1f, 2f); + Color brightenedRayColor = RayColor; + brightenedRayColor.A = 255; + + for (float i = 0f; i < dustCount; i++) + { + Dust explosionDust = Dust.NewDustDirect(projectile.Center, 0, 0, 267, 0f, 0f, 0, brightenedRayColor, 1f); + explosionDust.position = projectile.Center; + explosionDust.velocity = baseExplosionDirection.RotatedBy(MathHelper.TwoPi * i / dustCount) * outwardFireSpeedFactor * Main.rand.NextFloat(0.8f, 1.2f); + explosionDust.noGravity = true; + explosionDust.scale = 1.1f; + explosionDust.fadeIn = Main.rand.NextFloat(1.4f, 2.4f); + + explosionDust = Dust.CloneDust(explosionDust); + explosionDust.scale /= 2f; + explosionDust.fadeIn /= 2f; + explosionDust.color = new Color(255, 255, 255, 255); + } + for (float i = 0f; i < dustCount; i++) + { + Dust explosionDust = Dust.NewDustDirect(projectile.Center, 0, 0, 267, 0f, 0f, 0, brightenedRayColor, 1f); + explosionDust.position = projectile.Center; + explosionDust.velocity = baseExplosionDirection.RotatedBy(MathHelper.TwoPi * i / dustCount) * outwardFireSpeedFactor * Main.rand.NextFloat(0.8f, 1.2f); + explosionDust.velocity *= Main.rand.NextFloat() * 0.8f; + explosionDust.noGravity = true; + explosionDust.scale = Main.rand.NextFloat(); + explosionDust.fadeIn = Main.rand.NextFloat(1.4f, 2.4f); + + explosionDust = Dust.CloneDust(explosionDust); + explosionDust.scale /= 2f; + explosionDust.fadeIn /= 2f; + explosionDust.color = new Color(255, 255, 255, 255); + } + } + + public override Color? GetAlpha(Color lightColor) => new Color(projectile.Opacity, projectile.Opacity, projectile.Opacity, 0); + } +} diff --git a/Projectiles/Melee/SpineOfThanatosBody1.png b/Projectiles/Melee/SpineOfThanatosBody1.png new file mode 100644 index 0000000000000000000000000000000000000000..4aae688469b096de27f386dbfac198563314d1f3 GIT binary patch literal 1120 zcmV-m1fTnfP)00001b5ch_0Itp) z=>Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D1NBKnK~z{r?U`*z z6hR!uuP`x9PxHO9%nL~@wKqs3Un(mqD54i6DZ!xfYXt=bK~X_Tgryh+1%e0>1!b9) zO4RkGFr$1SQI;p0MwZTZF z)M`WWs~SWaed<4|reJHBMNK~7Q-8>Kj4G=rR9QvksId-?&y1gqLS)QLC}WkYE@P8! z&UzdUJ^8Q;8kQ6db#B*OD2WrF)0Pd+nSqDmYCO3dH<5D zs>H}qaw>Tn^iEL;bnlL1P*Rc^2$ee{>1cniHUqjkJD_C$ku%WZ69=IgSvk0-Ck=Hd z6Z1JLoivIOLMO?>^wm(_?>G~Ptk3V`X3vF^=k|M0wnuoJa0an{!S0>VO)Hl{rL(4t zQIAea7%N1MtdXPAIh$>cE2q)k{sv0tw&oW>d7Q|8$#$i)3b;n|IGUK0j7(eeD>!oHtUi^9eMZBR~>RsQL)iTYHX^h{K9!8 zqB`k53)m0;&x>_wte7W8BcfuF8R+XltQtM7@cHt|i=)sY#{je})blDRpK4^RN*J5+ zcgemXZ8a{nMnE%Ck3-)L>+cqF&pl&Sg8A;F#G|7>ojeP*SRDA|i1q|EqK!`b16_T> zc8uH#R7m5wTy)KU44h%t7$aV<2@dJ0M>SL7z4 z?$wIRD35&CVu6h4z+{XZ9p#8^*;s%&_B!o975T2m=Clb<}Mys~hS0xiL8RWvw<+o_0;XKxcgTKhz`apVA+w m(jQ$v70^%FKa)6WvHSp>L(K*oC-wLM0000Nn{1`b>4PUU;h990VuUIF83sm;wlO9 z3kIrz0ESIxbj|}sISV`@iy0XB4uLSEsD@VqP%z)q#WBRg`|Xv3d<_a54G$RtEB=e0 zlZwvXWzsG?>po}6|3GuuZ_7m(CZ3qqC8^npVLVB|&L_JIzObSE)2*BtM&IwEa-?iLXCugQTTuE`M(ezACF~?Hqe@frlQ@ OY6eeNKbLh*2~7ZSglcdA literal 0 HcmV?d00001 diff --git a/Projectiles/Melee/SpineOfThanatosBody2.png b/Projectiles/Melee/SpineOfThanatosBody2.png new file mode 100644 index 0000000000000000000000000000000000000000..17382a5519f9ae5138ea4f20f8b54046d5968cc0 GIT binary patch literal 710 zcmV;%0y+JOP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!TYBK}=y9S8xp}6x6~-MNDTA+1AFw!Y)M+3yHyAkdVR@QPHGO z1lLB95M%>c-w-qsT}c%JI`^MBGIN}_YvbMz4*xyO%$+;)&p9)b6<}0WhqRG72Yb8P z$ezfvA!u{)1$6Z!{}Ka6!HY1~aK4;G9{)B5b;9d9A82~-x#8$-v2t?pxX@p))0 zr8>A3eGkoQ{D-w%u4f~6>#SR(qkbtbi9jn#nhZ|9`;rG8{{8_F79)JY8grqrNZnVNMQ0K{$6EiW3O2!Hk(y3{gMZiQwptH-zqdzK}I)gTXESKI8AN zH+4PGh1djiuzwUvOhg|+d6#vXSHaWTrK2{$(XPJNNH*h3P)iIceH6EmHD|vXgFL0B}c91BS(vh z%dqy-lV8Z4kdB%FCx=GfB3b_W8Cnslg>nve6HvaL9Q~0{zjcXZ@+Xv>rJUgNd9Brq zarDkEbYp!5K?q046@hpn=&2A0hjcEb9qDMg;7$^v)8Ktr7b@=p`HfnpZb|U2Ojzxw%!jop^C7=2(ow%~XNlbW s$2iyDixlNhB{%GsZYPNhaWoLP0`0i)nt}B~ivR!s literal 0 HcmV?d00001 diff --git a/Projectiles/Melee/SpineOfThanatosBody2Glowmask.png b/Projectiles/Melee/SpineOfThanatosBody2Glowmask.png new file mode 100644 index 0000000000000000000000000000000000000000..d12dd42818a41e6b69ba23201b6f9760c2e482a4 GIT binary patch literal 239 zcmeAS@N?(olHy`uVBq!ia0vp^RzNJr!3-q5BL0FnjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCil21AIbUf%K;W&;S4bXMVV2dp&8{hfJMy-gZ+#>X*))tPG?$OM?7@feOHY zA=tk{2qakG5n0T@z;_UY8Fx&~ehU=z@N{tuvG9L;+K`Vyfx|h_apJxIN31qvDj6Ph zy?0G*|AQzWuOl(5dwV;ka6DLPYAqJH(&K%8utTVtw6x(%&t-Zuccr}g WhipPoints = new List(); + public Player Owner => Main.player[projectile.owner]; + public float CurrentBendFactor => MaximumBendFactor * CalamityUtils.Convert01To010(Time / Lifetime); + public Vector2 WhipEnd => projectile.Center + WhipOutwardness; + + // This wrapper exists solely for clarity as to the definition of velocity in the context of this projectile. + // You may notice that the Center property of this projectile is constantly set to be near the player. However, since + // ShouldUpdatePosition is not overriden to false, it still gains its velocity as usual for 1 frame before being reset again. + public ref Vector2 WhipOutwardness => ref projectile.velocity; + public ref float Time => ref projectile.ai[0]; + public ref float SwingDirection => ref projectile.ai[1]; + public ref float InitialDirectionRotation => ref projectile.localAI[0]; + public const int Lifetime = 125; + public const int FlyBackTime = 40; + public const int FinalWhipRayShootRate = 10; + public const int LaserRayCount = 12; + public const float MaximumBendFactor = 42f; + public override void SetStaticDefaults() => DisplayName.SetDefault("Spine of Thanatos"); + + public override void SetDefaults() + { + projectile.width = 58; + projectile.height = 70; + projectile.scale = 0.75f; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.melee = true; + projectile.extraUpdates = 2; + projectile.timeLeft = Lifetime; + projectile.ownerHitCheck = true; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 7; + } + + public void DetermineWhipPoints() + { + Vector2 startingPosition = Owner.RotatedRelativePoint(Owner.MountedCenter); + + List initialPoints = new List() + { + startingPosition + }; + for (int i = 0; i < 12; i++) + { + Vector2 bendOffset = Vector2.UnitX * -SwingDirection; + + // Make the bend factor depend on how far along the generated positions we are. + // The maximum bend should be halfway across the chain. + bendOffset *= CurrentBendFactor * CalamityUtils.Convert01To010(i / 12f); + + // Smoothly zero out the bending effects if the current position is near the owner. + bendOffset *= Utils.InverseLerp(0f, 300f, Owner.Distance(Vector2.Lerp(startingPosition, projectile.Center, i / 12f) + bendOffset), true); + initialPoints.Add(Vector2.Lerp(startingPosition, projectile.Center, i / 12f) + bendOffset); + } + initialPoints.Add(projectile.Center); + + BezierCurve bezierCurve = new BezierCurve(initialPoints.ToArray()); + int totalChains = (int)(projectile.Distance(startingPosition) / 24f / projectile.scale); + totalChains = (int)MathHelper.Clamp(totalChains, 40f, 440f); + + WhipPoints = bezierCurve.GetPoints(totalChains); + } + + public override void AI() + { + DetermineWhipPoints(); + + // Determines the owner's position whilst incorporating their fullRotation field. + // It uses vector transformation on a Z rotation matrix based on said rotation under the hood. + // This is essentially just the pure mathematical definition of the RotatedBy method. + Vector2 playerRotatedPosition = Owner.RotatedRelativePoint(Owner.MountedCenter); + if (Main.myPlayer == projectile.owner) + { + if (!Owner.noItems && !Owner.CCed) + HandleChannelMovement(playerRotatedPosition); + else + projectile.Kill(); + } + + ManipulatePlayerValues(); + + // Create a bunch of prismatic lasers outward from the non-arcing whip right before it comes back + // to its owner. + if (SwingDirection == 0f && projectile.timeLeft == FlyBackTime) + CreateBadassPrismExplosion(); + Time++; + } + + public void HandleChannelMovement(Vector2 playerRotatedPosition) + { + // Set the initial direction as a base for rotation. + if (InitialDirectionRotation == 0f) + InitialDirectionRotation = WhipOutwardness.ToRotation() - MathHelper.PiOver2; + + float attackCompletionRatio = Utils.InverseLerp(Lifetime, FlyBackTime, projectile.timeLeft, true); + + // Normally swing from a "cone" to a collision area that causes both whips to collide. + float baseSwingAngle = MathHelper.Lerp(-1.1f, 1.57f, 1f - attackCompletionRatio); + + Vector2 swingDirection = (SwingDirection * baseSwingAngle + MathHelper.PiOver2).ToRotationVector2(); + swingDirection = swingDirection.RotatedBy(InitialDirectionRotation); + + // If the whip is ready to return to its owner, have its outwardness approach the player again. + if (projectile.timeLeft < FlyBackTime) + WhipOutwardness = Vector2.Lerp(WhipOutwardness, InitialDirectionRotation.ToRotationVector2(), 0.1f); + else + { + // Have acceleration vary based on how much time has passed. + Vector2 swingSpeedIncrement = swingDirection * MathHelper.SmoothStep(3.8f, 13f, (float)Math.Pow(CalamityUtils.Convert01To010(Time / Lifetime), 8f)); + WhipOutwardness += swingSpeedIncrement; + } + projectile.Center = playerRotatedPosition; + projectile.rotation = WhipOutwardness.ToRotation(); + } + + public void ManipulatePlayerValues() + { + Owner.itemTime = 2; + Owner.itemAnimation = 2; + if (SwingDirection == 0f) + { + Owner.itemRotation = WhipOutwardness.ToRotation() * projectile.direction; + Owner.ChangeDir(projectile.direction); + } + } + + public void CreateBadassPrismExplosion() + { + var sound = Main.PlaySound(SoundID.DD2_DarkMageHealImpact, Owner.Center); + if (sound != null) + sound.Pitch = MathHelper.Clamp(sound.Pitch + 0.15f, 0f, 1f); + + if (Main.myPlayer != projectile.owner) + return; + + // Fire a bunch of rays rays. + int rayDamage = (int)(projectile.damage * 1.5); + NPC potentialTarget = WhipEnd.ClosestNPCAt(700f); + for (int i = 0; i < LaserRayCount; i++) + { + float rayRotation = projectile.rotation + MathHelper.Lerp(-0.57f, 0.57f, i / (float)LaserRayCount); + float targetAimDisparity = 0f; + if (potentialTarget != null) + targetAimDisparity = projectile.rotation.ToRotationVector2().AngleBetween((potentialTarget.Center - WhipEnd).SafeNormalize(Vector2.Zero)); + + // By default, make the prism rays go outward a good amount based on their rotation + // to give a fan look. + Vector2 prismEndPosition = WhipEnd + rayRotation.ToRotationVector2() * 420f; + + // However, if a potential target is within the general line of sight of the whip, + // fire all lasers at it instead. This results in the entire laser spectrum appearing as one + // brilliant, blazing laser that does great damage. However, it does take some skill to do. + if (potentialTarget != null && targetAimDisparity < MathHelper.Pi * 0.27f) + prismEndPosition = potentialTarget.Center + potentialTarget.velocity * 4f; + + int prismRay = Projectile.NewProjectile(prismEndPosition, Vector2.Zero, ModContent.ProjectileType(), rayDamage, projectile.knockBack * 0.2f, projectile.owner); + if (Main.projectile.IndexInRange(prismRay)) + { + Main.projectile[prismRay].ModProjectile().RayHue = i / (float)LaserRayCount; + Main.projectile[prismRay].ModProjectile().StartingPosition = WhipEnd; + } + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + for (int i = 0; i < WhipPoints.Count - 1; i++) + { + string whipTexturePath; + if (i == WhipPoints.Count - 2) + whipTexturePath = Texture; + else if (i == 0) + whipTexturePath = "CalamityMod/Projectiles/Melee/SpineOfThanatosTail"; + else + whipTexturePath = $"CalamityMod/Projectiles/Melee/SpineOfThanatosBody{i % 2 + 1}"; + Texture2D whipSegmentTexture = ModContent.GetTexture(whipTexturePath); + Texture2D whipSegmentGlowmaskTexture = ModContent.GetTexture($"{whipTexturePath}Glowmask"); + + Vector2 origin = whipSegmentTexture.Size() * 0.5f; + float rotation = (WhipPoints[i + 1] - WhipPoints[i]).ToRotation() + MathHelper.PiOver2; + Vector2 drawPosition = WhipPoints[i] - Main.screenPosition; + Color color = projectile.GetAlpha(Lighting.GetColor((int)WhipPoints[i].X / 16, (int)WhipPoints[i].Y / 16)); + spriteBatch.Draw(whipSegmentTexture, drawPosition, null, color, rotation, origin, projectile.scale, SpriteEffects.None, 0f); + spriteBatch.Draw(whipSegmentGlowmaskTexture, drawPosition, null, Color.White, rotation, origin, projectile.scale, SpriteEffects.None, 0f); + } + + return false; + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + if (WhipPoints.Count <= 1) + return false; + + float width = projectile.scale * 38f; + for (int i = 0; i < WhipPoints.Count - 1; i++) + { + float _ = 0f; + if (Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), WhipPoints[i], WhipPoints[i + 1], width, ref _)) + return true; + } + return false; + } + } +} diff --git a/Projectiles/Melee/SpineOfThanatosProjectile.png b/Projectiles/Melee/SpineOfThanatosProjectile.png new file mode 100644 index 0000000000000000000000000000000000000000..749cc7be1bc5e6c3092c8d773ab718b67c06f913 GIT binary patch literal 1563 zcmV+$2ITpPP)J00001b5ch_0Itp) z=>Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D1+Ym(K~#8N?V5XN z9Yq+$uhGQhCgh=cnKm(PrP_x{eLzjb##Ad70+!-~K+%Fqu?Q8a)Pka*P{9@nYNdi; zAsBq15v;G;)KqNRKh*eW(-vb&W1BPy-X!EjgT|S&_tf3bo$TK9RwTPW7|srNcV>6b ze&5c_-b*4EpQ*Sy`YJ1*7vFOJe(GcwD#<1#uCt!-LT4NQy9?E^Ym48c5jvU#bT(y1 z^+TfjCq(GzY$LqTnUY_470OJ>%FaVccJ>X7qZebWi_E#Eegi7aO}n6qX~()ZR^5fl z_ibN76-gcYhB11fELd<2ieD1lKT$$Q6D2D<2PIh~JNt%?Cd$b0(3CDW-BJ_LWv1xt ztINo6OtlwF+SoUA)GvNxGaAiANt9&8YUrpJc~=ym$k;5McO43$6RBybD1MQ#dU<*@ zqRUL34UD4~GS)>#lo|H+JL{nDH|~TM6qTTl{z+_8jPX6p}|4a{SwA#qR7}JW6^Zy=_q4NjdRi0*w`rRP*q2}Z#I62`tf6( z(67Jx1S*m3`gJyR)XPZ|GE3Sp^@a8&o1b|ZN@wY$#ILiVql#%`((4YltylrAI&c80 znAXv`^$(!(d(*p6Ix3OxSz>#VT>A+fRXActzBf&dZaLinrIX9^iqXg6Sg&g=W|WrV z_wnv-hqFapy-*V}``QQ{btRga1sxk5!JVd~oEH*)Ga(!al}!AJwh#55!tvXd+^^+4 zuUA-IGbVHATUj&vuPN+bP+X?Ph;%eJFCWJb#s*NAgpMj4PI8QCLayU*mO>}D9(fNc zk=geA%0t{yuYUPf2(xY+qoe$4JmYSG}q*8QlHz&LtYT#d68j%}rL68SzQOPj6Z%c~&&qUV** z;#*GS`mpSuS(#(s=6&Bn*W7U{&R;qk$QX5XQo@+w9hGBVj*J+qgfS#p-r(Gi4$I?B zYe};I^^ZIVRn9^cxW?c(x^U4FY@Fyg0!NwkKHc*L)Gu^W#w!15^4v%ZlwTkl{W;;QB@pH5-&#?D_*l18B-e`w?;%i)Kx&~Bpu-sAXfnyi(dal zx~;Z4zGXpYgXbu-t?gS0kRuYW_o>XrCP%q`D=}qPBA*}=a)cHbM~xS%opc*t&dFZu zD1`g#F|mDIteutbIy>4yx~S1llrGviyL)M4H>1dY{SurQmGe&1Y^ADVGxXq(&q6m2 zS!*+IdF_Or-z+y3--qqhq+f zrL)peML-?Z{{qv*{^-Y@V~oAjemAr}XB(7Gu3WVU$L?-?3-!@SD~5Qy$ytevVLHLD zV=3o~P=9FM!_bz!9S&!?Qt|Y%&!LQI`E@OjF$xNci=pZ18Mt$Fly~gjd)DKaw*AAX zxBavOO5~G4=9HD=xJy&4E>qJopq(d!@uk>$ua`ud=?1{k+$@Q*NWC{{o($Iv=PyAIEtraGvt~0^(>S@;9EZmw=JRjD-LI N002ovPDHLkV1na)4ZZ*X literal 0 HcmV?d00001 diff --git a/Projectiles/Melee/SpineOfThanatosProjectileGlowmask.png b/Projectiles/Melee/SpineOfThanatosProjectileGlowmask.png new file mode 100644 index 0000000000000000000000000000000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^ByRvs0`wI^K&U& zPabPmG&~9I?G(r5{#zwwJOuSyjSQ6BP!ziiBD)Tp$R5FG2>g_QV%DPFEYT>LpE1V@h zpAYM^*{o@OE@z%$sBgF$s@)Iv*X{?ga~w7F!bs@eyB>kYkBI*2iQY6~vbXg!XeJ}x z@csT}h{>;s38?)3%Kn!Q@ClK(Yh1`vK3bb#sAv;j>AM{<;cQ~$7SZ3n|MA<1d0yu^ zO8CuW&6Y9fiLR5TI*|vCmB*ra6m(QZo{7*X=qS&lQ7}K7+cx32v&ZWZ%inOE>nO=9 z!HZ($l+|1l_m}60ip}c%+x)nW+K90I`h6*Tu1FfuB-AGwlWw(9_CU> z#O1;wzeo{YlBX2Jkj&Zc? z{b+NY_?IZGT#kOUwO7mv@*lt%^)&J@G;aR>X*aH;cER^s4LHi#M9$u6AP?pGPnWo@ suHATpVXvNaC-ubG*j#oT;;6^-7g>N3+M!*)a{vGU07*qoM6N<$f=3v#+yDRo literal 0 HcmV?d00001 diff --git a/Projectiles/Melee/SpineOfThanatosTailGlowmask.png b/Projectiles/Melee/SpineOfThanatosTailGlowmask.png new file mode 100644 index 0000000000000000000000000000000000000000..7d1ac8f4b8dd11d1c9756bbbaa67d7d0d4140214 GIT binary patch literal 351 zcmeAS@N?(olHy`uVBq!ia0vp^RzPgR!3-qdNn{1`wE}!XT!Hkb0?+^d|7U)b>4PUUw+!A`TzfiU;hj2BG*~! z6$6#=bU$ncQhX&re!)QX2*BWa;LZu43}=ByBv2vWVGw3Kp1&dmD7eJa#WBRg`|aho ze9a0x4uK07DSi1HA8ws}=bGN4b!px^_G^5Uc;w!^eDlI{mHY>qC$X0DT|B>4H@{;| z21jhUzU!Oc2FIHx@!nm1X;EF@C4O@r8;zR*zy4G%OmhtX_VdJlPsXGgAN}6PpPKG< z7v9|Kl{sZbo<{%f*vh$=k|)YH?790n^!|e5tGBH1>fW?S^P|(*wr4yOjQPF7OqTxE gOpIGGcUgz<&Xg&R`ZsLO0o}{s>FVdQ&MBb@0NY)ecK`qY literal 0 HcmV?d00001 diff --git a/Projectiles/Ranged/ExoLight.cs b/Projectiles/Ranged/ExoLight.cs index 8978b339e7..9b76732b06 100644 --- a/Projectiles/Ranged/ExoLight.cs +++ b/Projectiles/Ranged/ExoLight.cs @@ -48,6 +48,14 @@ namespace CalamityMod.Projectiles.Ranged OffsetSpeed = Main.rand.NextFloat(MathHelper.ToRadians(2.5f), MathHelper.ToRadians(4f)) * Main.rand.NextBool(2).ToDirectionInt(); projectile.localAI[0] = 1f; } + + // Ensure that the owner projectile index is a valid one. + if (!Main.projectile.IndexInRange((int)projectile.localAI[1])) + { + projectile.Kill(); + return; + } + Projectile owner = Main.projectile[(int)projectile.localAI[1]]; // Ensure the owner is the correct projectile. diff --git a/Utilities/MathematicalUtils.cs b/Utilities/MathematicalUtils.cs index 884bbe3266..f2d0727683 100644 --- a/Utilities/MathematicalUtils.cs +++ b/Utilities/MathematicalUtils.cs @@ -20,6 +20,14 @@ namespace CalamityMod /// The second vector. public static float AngleBetween(this Vector2 v1, Vector2 v2) => (float)Math.Acos(Vector2.Dot(v1.SafeNormalize(Vector2.Zero), v2.SafeNormalize(Vector2.Zero))); + // NOTE: A similar function to this one exists in 1.4, but it is not the same underlying function. Check Turn01ToCyclic010 in Utils.cs to see the effect. + + /// + /// Converts a 0-1 bound to a 0-1-0 bump. This function automatically clamps the value to the necessary 0-1 range. + /// + /// The value to convert. + public static float Convert01To010(float value) => (float)Math.Sin(MathHelper.Pi * MathHelper.Clamp(value, 0f, 1f)); + // REMOVE THIS IN CALAMITY 1.4, it's a 1.4 World.cs function. // Due to its temporary state, this method will not receive an XML documentation comment. public static Rectangle ClampToWorld(Rectangle tileRectangle) diff --git a/Utilities/ProjectileUtils.cs b/Utilities/ProjectileUtils.cs index 70fb715a21..5fded37213 100644 --- a/Utilities/ProjectileUtils.cs +++ b/Utilities/ProjectileUtils.cs @@ -1,6 +1,4 @@ -using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Magic; -using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -24,6 +22,11 @@ namespace CalamityMod public static bool IsSummon(this Projectile proj) => proj.minion || proj.sentry || CalamityLists.projectileMinionList.Contains(proj.type) || ProjectileID.Sets.MinionShot[proj.type] || ProjectileID.Sets.SentryShot[proj.type]; + public static T ModProjectile(this Projectile projectile) where T : ModProjectile + { + return projectile.modProjectile as T; + } + public static void KillAllHostileProjectiles() { for (int x = 0; x < Main.maxProjectiles; x++) From 1408f92aa98fd905e00d33cf4b7a186a9e6dd79a Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 24 Feb 2021 13:34:48 -0600 Subject: [PATCH 055/202] Added some projectile kill exceptions --- CalamityLists.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CalamityLists.cs b/CalamityLists.cs index 8139be2cb2..2edcac1514 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -433,13 +433,15 @@ namespace CalamityMod ProjectileType(), ProjectileType(), ProjectileType(), - // ProjectileType(), // TODO: ADD THE APOTHEOSIS WORM HERE LATER. IT IS IN A DIFFERENT BRANCH AS OF WRITING THIS. + ProjectileType(), ProjectileType(), ProjectileType(), ProjectileType(), ProjectileType(), ProjectileType(), + ProjectileType(), + ProjectileType(), //Some hostile boss projectiles ProjectileType(), From 848cb839319ca37639760dfc5248a02efaf8660b Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 24 Feb 2021 14:53:17 -0600 Subject: [PATCH 056/202] Thanatos spine explosion effect --- .../Melee/SpineOfThanatosProjectile.cs | 6 +- Projectiles/Melee/ThanatosBoom.cs | 55 +++++++++++++++++++ 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 Projectiles/Melee/ThanatosBoom.cs diff --git a/Projectiles/Melee/SpineOfThanatosProjectile.cs b/Projectiles/Melee/SpineOfThanatosProjectile.cs index 1508165a3e..80a001416c 100644 --- a/Projectiles/Melee/SpineOfThanatosProjectile.cs +++ b/Projectiles/Melee/SpineOfThanatosProjectile.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Melee projectile.timeLeft = Lifetime; projectile.ownerHitCheck = true; projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 7; + projectile.localNPCHitCooldown = 22; } public void DetermineWhipPoints() @@ -121,6 +121,8 @@ namespace CalamityMod.Projectiles.Melee { // Have acceleration vary based on how much time has passed. Vector2 swingSpeedIncrement = swingDirection * MathHelper.SmoothStep(3.8f, 13f, (float)Math.Pow(CalamityUtils.Convert01To010(Time / Lifetime), 8f)); + if (SwingDirection == 0f) + swingSpeedIncrement *= 0.84f; WhipOutwardness += swingSpeedIncrement; } projectile.Center = playerRotatedPosition; @@ -147,6 +149,8 @@ namespace CalamityMod.Projectiles.Melee if (Main.myPlayer != projectile.owner) return; + Projectile.NewProjectile(WhipEnd, Vector2.Zero, ModContent.ProjectileType(), projectile.damage * 2, 0f, projectile.owner); + // Fire a bunch of rays rays. int rayDamage = (int)(projectile.damage * 1.5); NPC potentialTarget = WhipEnd.ClosestNPCAt(700f); diff --git a/Projectiles/Melee/ThanatosBoom.cs b/Projectiles/Melee/ThanatosBoom.cs new file mode 100644 index 0000000000..be0d35f9f8 --- /dev/null +++ b/Projectiles/Melee/ThanatosBoom.cs @@ -0,0 +1,55 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Melee +{ + public class ThanatosBoom : ModProjectile + { + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public override void SetStaticDefaults() => DisplayName.SetDefault("Boom"); + + public override void SetDefaults() + { + projectile.width = projectile.height = 54; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.timeLeft = 45; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 4; + projectile.melee = true; + } + + public override void AI() + { + if (projectile.localAI[0] == 0f) + { + CreateExplosionDust(); + projectile.localAI[0] = 1f; + } + } + + public void CreateExplosionDust() + { + if (Main.dedServ) + return; + + for (float speed = 2f; speed <= 6f; speed += 0.7f) + { + float lifePersistance = Main.rand.NextFloat(0.8f, 1.7f); + for (int i = 0; i < 60; i++) + { + Dust energy = Dust.NewDustPerfect(projectile.Center, 267); + energy.velocity = (MathHelper.TwoPi * i / 60f).ToRotationVector2() * speed; + energy.noGravity = true; + energy.color = Main.hslToRgb(Main.rand.NextFloat(), 0.7f, 0.625f); + energy.fadeIn = lifePersistance; + energy.scale = 1.4f; + } + } + } + } +} From 0fcd640fc9c1cc54aac68ae6f42a8820edc35d3e Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 3 Mar 2021 17:23:13 -0600 Subject: [PATCH 057/202] Added Prism Shuriken (name pending) --- Effects/CalamityShaders.cs | 2 +- Gores/PrismShurikenBlade.png | Bin 0 -> 420 bytes Items/CalamityGlobalItem.cs | 18 ++- Items/Weapons/Rogue/PrismShuriken.cs | 48 ++++++++ Items/Weapons/Rogue/PrismShuriken.png | Bin 0 -> 4720 bytes Projectiles/Melee/PrismRay.cs | 14 +-- Projectiles/Melee/PrismTooth.cs | 4 +- Projectiles/Rogue/PrismRocket.cs | 72 ++++++++++++ Projectiles/Rogue/PrismRocket.png | Bin 0 -> 327 bytes Projectiles/Rogue/PrismShurikenBlade.cs | 54 +++++++++ Projectiles/Rogue/PrismShurikenBlade.png | Bin 0 -> 327 bytes Projectiles/Rogue/PrismShurikenGlowmask.png | Bin 0 -> 3985 bytes Projectiles/Rogue/PrismShurikenProjectile.cs | 117 +++++++++++++++++++ TrailGeneration/PrimitiveTrail.cs | 4 - 14 files changed, 311 insertions(+), 22 deletions(-) create mode 100644 Gores/PrismShurikenBlade.png create mode 100644 Items/Weapons/Rogue/PrismShuriken.cs create mode 100644 Items/Weapons/Rogue/PrismShuriken.png create mode 100644 Projectiles/Rogue/PrismRocket.cs create mode 100644 Projectiles/Rogue/PrismRocket.png create mode 100644 Projectiles/Rogue/PrismShurikenBlade.cs create mode 100644 Projectiles/Rogue/PrismShurikenBlade.png create mode 100644 Projectiles/Rogue/PrismShurikenGlowmask.png create mode 100644 Projectiles/Rogue/PrismShurikenProjectile.cs diff --git a/Effects/CalamityShaders.cs b/Effects/CalamityShaders.cs index 22ef4a17b1..9343d1ec9a 100644 --- a/Effects/CalamityShaders.cs +++ b/Effects/CalamityShaders.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Effects GameShaders.Misc["CalamityMod:FabstaffRay"] = new MiscShaderData(new Ref(FabstaffRayShader), "TrailPass"); GameShaders.Misc["CalamityMod:OverpoweredTouhouSpearShader"] = new MiscShaderData(new Ref(ScarletDevilShader), "TrailPass"); GameShaders.Misc["CalamityMod:Bordernado"] = new MiscShaderData(new Ref(BordernadoFireShader), "TrailPass"); - GameShaders.Misc["CalamityMod:PrismCrystal"] = new MiscShaderData(new Ref(PrismCrystalShader), "TrailPass"); + GameShaders.Misc["CalamityMod:PrismaticStreak"] = new MiscShaderData(new Ref(PrismCrystalShader), "TrailPass"); } } } diff --git a/Gores/PrismShurikenBlade.png b/Gores/PrismShurikenBlade.png new file mode 100644 index 0000000000000000000000000000000000000000..650f27e8c16f3396b5bdf9389569887832d00b4c GIT binary patch literal 420 zcmeAS@N?(olHy`uVBq!ia0vp^T0m^U!3-q#Fwgo4q!^2X+?^QKos)S9D+c(4xXLLg0+|7k>BbiJ#WmftmaMajTxU1+rKMhR=7&2#shO9idjcu$ zk|4j}|8T(I<lFz@$g=I`Jzy>0*_0e%aK$6 z>kD@3^~~L7#kN_0ZNVIdgA1leZ@d^$%pR>_b*z#van`LHo;e~m?{^*xyH(f|e#7rz zPG7S1W92PVG8aj0j56XNkO@qZ(-#`D9b6?-ln z5U@3vUKnX*yY88U=sVAqm+MU3HP@zkO;HV)m(0>1Y~afvEbv29l|9WcfnV!P*#fQi z-l20UF2&tzKQ_ZS`jPRa8^v60t9TFDmBhMQe_Jjylbtv5?&RzrGPW;QtEK<@8SpSS zneoA{HnV@~Y+QVfPxYf6ctRew{w=TH)svx_ue{U#VA_>}g}?w{@O1TaS?83{1ON%D BrKSJ? literal 0 HcmV?d00001 diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 67e0e2d7ef..98c9bffffb 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -70,9 +70,21 @@ namespace CalamityMod.Items public bool donorItem = false; public bool devItem = false; - // See RogueWeapon.cs for rogue modifier shit - #region Modifiers - public CalamityGlobalItem() + public static readonly Color[] ExoPalette = new Color[] + { + new Color(250, 255, 112), + new Color(211, 235, 108), + new Color(166, 240, 105), + new Color(105, 240, 220), + new Color(64, 130, 145), + new Color(145, 96, 145), + new Color(242, 112, 73), + new Color(199, 62, 62), + }; + + // See RogueWeapon.cs for rogue modifier shit + #region Modifiers + public CalamityGlobalItem() { StealthGenBonus = 1f; } diff --git a/Items/Weapons/Rogue/PrismShuriken.cs b/Items/Weapons/Rogue/PrismShuriken.cs new file mode 100644 index 0000000000..e8aae97879 --- /dev/null +++ b/Items/Weapons/Rogue/PrismShuriken.cs @@ -0,0 +1,48 @@ +using CalamityMod.Projectiles.Rogue; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Rogue +{ + public class PrismShuriken : RogueWeapon + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Prism Shuriken"); + Tooltip.SetDefault("Fires a large prismatic razorblade\n" + + "After hitting something, the blade dies moments later\n" + + "The blade explodes into rockets on death\n" + + "Stealth strikes explode into more rockets on death"); + } + + public override void SafeSetDefaults() + { + item.width = item.height = 120; + item.damage = 300; + item.knockBack = 8.5f; + item.useAnimation = item.useTime = 14; + item.Calamity().rogue = true; + item.autoReuse = true; + item.shootSpeed = 18f; + item.shoot = ModContent.ProjectileType(); + + item.useStyle = ItemUseStyleID.SwingThrow; + item.UseSound = SoundID.Item1; + item.noMelee = true; + item.noUseGraphic = true; + item.value = CalamityGlobalItem.RarityVioletBuyPrice; + item.rare = ItemRarityID.Red; + item.Calamity().customRarity = CalamityRarity.Violet; + } + + 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 shuriken = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + if (player.Calamity().StealthStrikeAvailable() && Main.projectile.IndexInRange(shuriken)) + Main.projectile[shuriken].Calamity().stealthStrike = true; + return false; + } + } +} diff --git a/Items/Weapons/Rogue/PrismShuriken.png b/Items/Weapons/Rogue/PrismShuriken.png new file mode 100644 index 0000000000000000000000000000000000000000..9b945f0278b9ae06a62fb1c271d10aeae045ad30 GIT binary patch literal 4720 zcmXX~cQ{+^8;+_Dlut`bDPO5pP+GNWl(sZVOA}(RQnhL9Bv!W>zLu($*wkvxAXfX; zs8yp9E1^;ef)IjO`QiKhan5^P=Q`)S&-=Xh{XF;mMn5tJo#H;v4FCX6-8ayK?2oAZ zEBwT<{X4@KD6l_p_(MQ<0OfsRa{$0;+5398%|bF3Grgag5#SvWgvh_%$)9}nRoLk7 zXRW9Zum|!QpETde!1&#ZWcSN=?VoOaQdoL27)RrMAEe}cg<1E|omTLsVJNjP&u3FN z{o+uhv+4V!><=REk4ni2cSOpItX{UiWOV0r`#3)+Vi65O)|ABdFMVT$32ZD8iB+*n z4s7a8s+Nh~KZ9SsfY}dRkfE%taj8hWb|J^Co6dD0SypiC)`!n67Y-gRZk+!5CyXEa zpbK}@N4?-I0>EM{WKS|tYHDm{uKq?pm!th*bCOHc{2$_Dd6M}98x{4eLM{=|qYPci z7<^e(H?imBgqV3$cqcqcuo1z$*T8JRnHrvk6CIO^sOOTQwXlUu*HINj{*D zSFU$j8WRA=#M%LD>y?fQVoo!8#W}LJI<>8mq3H5QN83(bl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(5r^tLB)BWvk$lp~F5zBj1FU zNso}0#IkNJQoY!?(QR?*l$3W2w*+hw$nXYk?>6?xm(?0re4*Ki{ko$!Ad8x%E&d1- zm@9hosvBIn_S#QTP0Zy7d8GaZFhOaO#{#$WuK2y`L=&l3|CIXApjLlPj`DhA#a z%NGR^e^4Y`BAocDRSA7D-8V)IdHwf>dfFtmdo z*4{Ze04OIb++wwyw&3m?{4z6eY2Q_NddkUF;UD%DeM_uSyREQb*lLU874#nEwudEu zPTTN4G6=Ph*!QYOM)sZN{dODq!@N0)7v?yw0R3 zfb~gBFc{d@Wdu(eH9t0LzVNPNfaEtEX5U{Y!!?Kanm>OS5%^ld%h9{u)GQ^BU;5V? zUf||ssq-z$_6tidZHdv|4|Phk7`GsX*9XXGuS0wAtgS-(qhxKNM9w2XD&v+}QD~U#Cm)M~@+{Y*y zwZMNHd{Su{!PU;dL|g)k*^Us8)k-Y8QR?$!STw^gob@=RWi%q-*dqk#-a($628G`K zb~6;G)Tpt~8UzoT7Sy;d8yxKq`n7SZ?Vhbfz&K{&UToS`of=n(M~JRNTmJ%xqWHYh znD4b=-XyH9M2$bTa`U}m??I{i5J+?#Z}j;JL5sT7Y8_yltD9WZT{`pYxyAFreU{E+ z%I)~9k)=1~0!Q<|yLP`k@XX6S6;Gqdh>#DmV literal 0 HcmV?d00001 diff --git a/Projectiles/Melee/PrismRay.cs b/Projectiles/Melee/PrismRay.cs index 4c38a60f4f..64f8374f45 100644 --- a/Projectiles/Melee/PrismRay.cs +++ b/Projectiles/Melee/PrismRay.cs @@ -1,3 +1,4 @@ +using CalamityMod.Items; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -8,21 +9,10 @@ namespace CalamityMod.Projectiles.Melee public class PrismRay : ModProjectile { public Vector2 StartingPosition; - public Color RayColor => CalamityUtils.MulticolorLerp(RayHue, ExoPalette); + public Color RayColor => CalamityUtils.MulticolorLerp(RayHue, CalamityGlobalItem.ExoPalette); public Color HueDownscaledRayColor => RayColor * 0.66f; public ref float RayHue => ref projectile.ai[0]; public ref float Time => ref projectile.localAI[1]; - public static readonly Color[] ExoPalette = new Color[] - { - new Color(250, 255, 112), - new Color(211, 235, 108), - new Color(166, 240, 105), - new Color(105, 240, 220), - new Color(64, 130, 145), - new Color(145, 96, 145), - new Color(242, 112, 73), - new Color(199, 62, 62), - }; public const int Lifetime = 30; public override string Texture => "CalamityMod/Projectiles/StarProj"; diff --git a/Projectiles/Melee/PrismTooth.cs b/Projectiles/Melee/PrismTooth.cs index f916eda231..5067e888a6 100644 --- a/Projectiles/Melee/PrismTooth.cs +++ b/Projectiles/Melee/PrismTooth.cs @@ -109,7 +109,7 @@ namespace CalamityMod.Projectiles.Melee return true; if (TrailDrawer is null) - TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, specialShader: GameShaders.Misc["CalamityMod:PrismCrystal"]); + TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, specialShader: GameShaders.Misc["CalamityMod:PrismaticStreak"]); // Variable adjustment vector used to prevent the trail for starting somewhat that isn't behind // the crystal. This may appear in small amounts, with offsets of a few pixels, but at the speed @@ -125,7 +125,7 @@ namespace CalamityMod.Projectiles.Melee if (projectile.oldPos[1].HasNaNs()) projectile.oldPos[1] = oldPosition; - GameShaders.Misc["CalamityMod:PrismCrystal"].SetShaderTexture(ModContent.GetTexture("CalamityMod/ExtraTextures/ScarletDevilStreak")); + GameShaders.Misc["CalamityMod:PrismaticStreak"].SetShaderTexture(ModContent.GetTexture("CalamityMod/ExtraTextures/ScarletDevilStreak")); TrailDrawer.Draw(projectile.oldPos, projectile.Size * 0.5f + generalOffset - Main.screenPosition, 65); return true; } diff --git a/Projectiles/Rogue/PrismRocket.cs b/Projectiles/Rogue/PrismRocket.cs new file mode 100644 index 0000000000..90d8e9004e --- /dev/null +++ b/Projectiles/Rogue/PrismRocket.cs @@ -0,0 +1,72 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class PrismRocket : ModProjectile + { + public float ExponentialAccelerationFactor => projectile.Calamity().stealthStrike ? 1.027f : 1.015f; + public float MaxHomingSpeed => projectile.Calamity().stealthStrike ? 26f : 21f; + public const int Lifetime = 150; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Prism Rocket"); + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 20; + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 16; + projectile.friendly = true; + projectile.melee = true; + projectile.penetrate = 1; + projectile.tileCollide = false; + projectile.timeLeft = Lifetime; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 9; + projectile.Calamity().rogue = true; + } + + public override void AI() + { + NPC potentialTarget = projectile.Center.ClosestNPCAt(800f, true); + if (potentialTarget != null) + AttackTarget(potentialTarget); + + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; + EmitDust(); + } + + public void AttackTarget(NPC target) + { + float newSpeed = projectile.velocity.Length() * ExponentialAccelerationFactor; + if (newSpeed > MaxHomingSpeed) + newSpeed = MaxHomingSpeed; + + if (!projectile.WithinRange(target.Center, 30f)) + { + projectile.velocity = (projectile.velocity * 5f + projectile.DirectionTo(target.Center) * newSpeed) / 6f; + projectile.velocity = projectile.velocity.ToRotation().AngleTowards(projectile.AngleTo(target.Center), 0.15f).ToRotationVector2() * newSpeed; + } + } + + public void EmitDust() + { + if (Main.dedServ) + return; + + for (int i = 0; i < 2; i++) + { + Dust dust = Dust.NewDustPerfect(projectile.Center - (projectile.rotation - MathHelper.PiOver2).ToRotationVector2() * 10f, 261); + dust.color = Color.Cyan; + dust.velocity = Main.rand.NextVector2Unit(); + dust.scale = Main.rand.NextFloat(0.75f, 1.05f); + dust.noGravity = true; + } + } + } +} diff --git a/Projectiles/Rogue/PrismRocket.png b/Projectiles/Rogue/PrismRocket.png new file mode 100644 index 0000000000000000000000000000000000000000..dd035814fc00fcbae8edaa81d335d4d0143b5061 GIT binary patch literal 327 zcmeAS@N?(olHy`uVBq!ia0vp^VnD3L!3-oDE=Au5QjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`6$5-iT!C~zWV*41eQ`~B9}XD2{24z1g*gj6B8wRq_zrCLf@;mhCnA>GDxE>CdLu_vBtbbH0nWS#o~%(TFVdQ I&MBb@01SeE<^TWy literal 0 HcmV?d00001 diff --git a/Projectiles/Rogue/PrismShurikenBlade.cs b/Projectiles/Rogue/PrismShurikenBlade.cs new file mode 100644 index 0000000000..cff7ed7a77 --- /dev/null +++ b/Projectiles/Rogue/PrismShurikenBlade.cs @@ -0,0 +1,54 @@ +using Terraria; +using Terraria.ModLoader; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria.ID; + +namespace CalamityMod.Projectiles.Rogue +{ + public class PrismShurikenBlade : ModProjectile + { + public override void SetStaticDefaults() => DisplayName.SetDefault("Blade"); + + public override void SetDefaults() + { + projectile.width = projectile.height = 22; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.Calamity().rogue = true; + projectile.extraUpdates = 1; + projectile.timeLeft = 360; + } + + public override void AI() + { + CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 850f, 14.5f, 35f); + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; + } + + public override void Kill(int timeLeft) + { + if (Main.dedServ) + return; + + for (int i = 0; i < 25; i++) + { + Vector2 circularOffsetDirection = (MathHelper.TwoPi * i / 25f).ToRotationVector2().RotatedBy(projectile.velocity.ToRotation() - MathHelper.PiOver2); + Vector2 spawnPosition = projectile.Center - (projectile.rotation - MathHelper.PiOver2).ToRotationVector2() * projectile.height * 1.25f; + spawnPosition += circularOffsetDirection * new Vector2(12f, 7f); + + Dust energy = Dust.NewDustPerfect(spawnPosition, 261); + energy.velocity = circularOffsetDirection * new Vector2(3f, 2f); + energy.color = Color.Cyan; + energy.scale = 0.7f; + energy.noGravity = true; + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + } +} diff --git a/Projectiles/Rogue/PrismShurikenBlade.png b/Projectiles/Rogue/PrismShurikenBlade.png new file mode 100644 index 0000000000000000000000000000000000000000..dd035814fc00fcbae8edaa81d335d4d0143b5061 GIT binary patch literal 327 zcmeAS@N?(olHy`uVBq!ia0vp^VnD3L!3-oDE=Au5QjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`6$5-iT!C~zWV*41eQ`~B9}XD2{24z1g*gj6B8wRq_zrCLf@;mhCnA>GDxE>CdLu_vBtbbH0nWS#o~%(TFVdQ I&MBb@01SeE<^TWy literal 0 HcmV?d00001 diff --git a/Projectiles/Rogue/PrismShurikenGlowmask.png b/Projectiles/Rogue/PrismShurikenGlowmask.png new file mode 100644 index 0000000000000000000000000000000000000000..0cdffe82c6b6196922f650f8ed9535a0d96c4be8 GIT binary patch literal 3985 zcmXX}c_38p_r4>gvQ#u=OU1+>l|7V_Efca#cFIoH2GiI^`lt{h`<^Y^*lUb+$`-O_ z$<9o&ObiA?7~dJc-yiqB|D1c@_dMr$pYxpXM|xW9r}<6;0Koo0TiuYpM$@0*lPBo! z4NvGf`T{~2YN-Kby#h-Ba0d23{hslQ^py-NH-S;#4zzIG6IBgAERSK-|vDN@%B+Nst$Y(q}zNaVoX-)xmmaBc|HA@wElBk)}p1I9^WTdcgwjIUiOOwMqWwzLix4~sHenx zB?IO0bTs=sWQ+tfzy*_CTmpzel*V=KS!ImM`)%%pcQ80>i6Xb~vbDEk53>)*8YXZ| z`rN3A(rA)T5d1bLoA}Yed{?O4)+uLRM)970i21JM2p2c8 z69QGJh})@++BVD7^`6yd@`8H*06Dw=V+F1nsY)#?k>uUtNo>|PmbHpZ+bS;@AR}@M zHx>&kq7!BM2E5>WM)SPMd=%P-1W`hxJ;M-L5TVpGc@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w+x=P^_{bw3{iW+u_LbMBmxPDkjl_Vcxy@7iMu}rn9h&O=vHD zz+jox7ou@LQq{MX@(F9v{woMrX9*n7E_VngBhKXODFLDl%bi=&<{k`DZ*v#GaH>S2 zcoD_&#j;a^{J`QfvmDQ&u6jU}lO@nQ(?8{t9V2kKqd49i{p}%d)ETD!F^HWJ(asQU q<-`;hE;%}^!VrhZHrpa^nh;M>^j)iD-WK|d4Ls1$Q!i6{68b;&65pf% literal 0 HcmV?d00001 diff --git a/Projectiles/Rogue/PrismShurikenProjectile.cs b/Projectiles/Rogue/PrismShurikenProjectile.cs new file mode 100644 index 0000000000..6f7cda6dbe --- /dev/null +++ b/Projectiles/Rogue/PrismShurikenProjectile.cs @@ -0,0 +1,117 @@ +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 PrismShurikenProjectile : ModProjectile + { + public ref float BaseDamage => ref projectile.ai[0]; + public ref float AccumulatedHits => ref projectile.ai[1]; + public const int EnergyShotCount = 6; + public override string Texture => "CalamityMod/Items/Weapons/Rogue/PrismShuriken"; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Prism Shuriken"); + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 16; + } + + public override void SetDefaults() + { + projectile.width = 142; + projectile.height = 126; + projectile.friendly = true; + projectile.penetrate = 10; + projectile.timeLeft = 300; + projectile.alpha = 255; + projectile.tileCollide = false; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + projectile.Calamity().rogue = true; + } + + public override void AI() + { + projectile.alpha = Utils.Clamp(projectile.alpha - 18, 0, 255); + projectile.rotation += projectile.velocity.Length() * Math.Sign(projectile.velocity.X) * 0.036f; + } + + public override bool CanDamage() => projectile.alpha <= 128; + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (projectile.timeLeft > 20) + projectile.timeLeft = 20; + } + + public override void Kill(int timeLeft) + { + // Release a puff of rainbow dust and some blades. + // If this projectile is a stealth strike, don't create the blades as a gore-- create them as a projectile instead. + if (!Main.dedServ) + { + for (int i = 0; i < 80; i++) + { + Dust rainbowBurst = Dust.NewDustPerfect(projectile.Center, 267); + rainbowBurst.color = Main.hslToRgb(i / 80f, 0.9f, 0.6f); + rainbowBurst.velocity = Main.rand.NextVector2Unit() * Main.rand.NextFloat(3f, 5.5f); + rainbowBurst.scale = Main.rand.NextFloat(1.4f, 2.4f); + rainbowBurst.fadeIn = Main.rand.NextFloat(0.8f, 1.6f); + rainbowBurst.noGravity = true; + } + + if (!projectile.Calamity().stealthStrike) + { + int goreType = mod.GetGoreSlot("Gores/PrismShurikenBlade"); + for (int i = 0; i < 6; i++) + { + Vector2 shootDirection = (MathHelper.TwoPi * i / 6f + projectile.rotation + MathHelper.PiOver2).ToRotationVector2(); + Vector2 spawnPosition = projectile.Center + projectile.Size * 0.5f * projectile.scale * shootDirection * 0.85f; + if (!WorldGen.SolidTile((int)spawnPosition.X / 16, (int)spawnPosition.Y / 16)) + Gore.NewGorePerfect(spawnPosition, projectile.velocity * 0.5f + shootDirection * 7f, goreType, projectile.scale); + } + } + } + + int shootType = ModContent.ProjectileType(); + if (Main.myPlayer != projectile.owner) + return; + + // Release a circle of damaging blades if this projectile is a stealth strike. + if (projectile.Calamity().stealthStrike) + { + int bladeType = ModContent.ProjectileType(); + for (int i = 0; i < 6; i++) + { + Vector2 shootDirection = (MathHelper.TwoPi * i / 6f + projectile.rotation + MathHelper.PiOver2).ToRotationVector2(); + Vector2 spawnPosition = projectile.Center + projectile.Size * 0.5f * projectile.scale * shootDirection * 0.85f; + Projectile.NewProjectile(spawnPosition, projectile.velocity * 0.5f + shootDirection * 7f, bladeType, projectile.damage, projectile.knockBack, projectile.owner); + } + } + + if (CalamityUtils.CountProjectiles(shootType) > 24) + return; + + int energyDamage = (int)(projectile.damage * 0.66); + float baseDirectionRotation = Main.rand.NextFloat(MathHelper.TwoPi); + for (int i = 0; i < EnergyShotCount; i++) + { + Vector2 shootVelocity = (MathHelper.TwoPi * i / EnergyShotCount + baseDirectionRotation).ToRotationVector2() * 9f; + Projectile.NewProjectile(projectile.Center + shootVelocity, shootVelocity, shootType, energyDamage, projectile.knockBack, projectile.owner); + } + } + + public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D glowmask = ModContent.GetTexture("CalamityMod/Projectiles/Rogue/PrismShurikenGlowmask"); + Vector2 drawPosition = projectile.Center - Main.screenPosition + Vector2.UnitY * projectile.gfxOffY; + Vector2 origin = glowmask.Size() * 0.5f; + spriteBatch.Draw(glowmask, drawPosition, null, projectile.GetAlpha(Color.White), projectile.rotation, origin, projectile.scale, SpriteEffects.None, 0f); + } + } +} diff --git a/TrailGeneration/PrimitiveTrail.cs b/TrailGeneration/PrimitiveTrail.cs index 7294706863..f58f0a90f8 100644 --- a/TrailGeneration/PrimitiveTrail.cs +++ b/TrailGeneration/PrimitiveTrail.cs @@ -142,10 +142,6 @@ namespace CalamityMod float currentRotation = MathHelper.WrapAngle(originalRotations.ElementAt(i)); float aheadRotation = MathHelper.WrapAngle(originalRotations.ElementAt(i + 1)); int pointsToAdd = (int)(Math.Abs(aheadRotation - currentRotation) * 50f / MathHelper.Pi) + 4; - if (pointsToAdd > 6) - { - int v = 7; - } float segmentLength = Vector2.Distance(originalPositions.ElementAt(i), originalPositions.ElementAt(i + 1)); float increment = 1f / (pointsToAdd + 2); From a611b2f17d3c1844292fe5cddf3385dbc01a4b04 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sun, 14 Mar 2021 20:28:38 -0500 Subject: [PATCH 058/202] Added the prism javelin (name pending) --- Items/Weapons/Rogue/PrismJavelin.cs | 46 ++++++ Items/Weapons/Rogue/PrismJavelin.png | Bin 0 -> 3711 bytes Projectiles/Melee/PrismRay.cs | 2 +- Projectiles/Rogue/PrismJavelinDuplicate.cs | 61 +++++++ Projectiles/Rogue/PrismJavelinDuplicate.png | Bin 0 -> 2210 bytes Projectiles/Rogue/PrismJavelinProjectile.cs | 169 ++++++++++++++++++++ 6 files changed, 277 insertions(+), 1 deletion(-) create mode 100644 Items/Weapons/Rogue/PrismJavelin.cs create mode 100644 Items/Weapons/Rogue/PrismJavelin.png create mode 100644 Projectiles/Rogue/PrismJavelinDuplicate.cs create mode 100644 Projectiles/Rogue/PrismJavelinDuplicate.png create mode 100644 Projectiles/Rogue/PrismJavelinProjectile.cs diff --git a/Items/Weapons/Rogue/PrismJavelin.cs b/Items/Weapons/Rogue/PrismJavelin.cs new file mode 100644 index 0000000000..efad05b766 --- /dev/null +++ b/Items/Weapons/Rogue/PrismJavelin.cs @@ -0,0 +1,46 @@ +using CalamityMod.Projectiles.Rogue; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Rogue +{ + public class PrismJavelin : RogueWeapon + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Prism Javelin"); + Tooltip.SetDefault("Fires a javelin that releases energy duplicates at enemies it hits\n" + + "Stealth strikes release duplicates much more quickly"); + } + + public override void SafeSetDefaults() + { + item.width = item.height = 128; + item.damage = 375; + item.knockBack = 7f; + item.useAnimation = item.useTime = 14; + item.Calamity().rogue = true; + item.autoReuse = true; + item.shootSpeed = 24f; + item.shoot = ModContent.ProjectileType(); + + item.useStyle = ItemUseStyleID.SwingThrow; + item.UseSound = SoundID.Item1; + item.noMelee = true; + item.noUseGraphic = true; + item.value = CalamityGlobalItem.RarityVioletBuyPrice; + item.rare = ItemRarityID.Red; + item.Calamity().customRarity = CalamityRarity.Violet; + } + + 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 javelin = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, -1f); + if (player.Calamity().StealthStrikeAvailable() && Main.projectile.IndexInRange(javelin)) + Main.projectile[javelin].Calamity().stealthStrike = true; + return false; + } + } +} diff --git a/Items/Weapons/Rogue/PrismJavelin.png b/Items/Weapons/Rogue/PrismJavelin.png new file mode 100644 index 0000000000000000000000000000000000000000..c1d0c0131beab9bc41a8e40d7a90558321b69696 GIT binary patch literal 3711 zcmXX}c|6nqAOFmKlOxxZ4iV)n$6U)*)R&T@h>1kaOeEK^E~T%lT>Wz2xi-Y)+`3$q zIjY5Im~E2fn8q-E*6;Vn`}6+e{dm0J&*$s)d_7;UPx5)^(~@E;VgLY0I-ap}-QCf= zB_g!@eP?y`BLGM_INF_Zi_T{jz{9e>D)%PlnLA2=_@`w<-=N(DA1>e1zh{&Egef2C zFrPB|#HdB;oJLDzrO};`(|9-d-Mx@fBM9@7-XDltO{qwU*h_wGzXQ|zbPvcJ5EY&6 z<}NK{em2_-H9n);5kp-3Nbg$cKsIr9h!KUXe3nqyVF8kEVMs`8U@K_oi-!oI4Y^l1 z;L1UuVaK{v**vrT=Qdc>$q7b5zf*Nb*?u+y43msMvirZNLtP7kO{#j_!aS%)Kmn7yBM}=Wp51@CG;te0blkzO7pqpCW;e2>jO(UOw9n1jYQ?$D)43*JuJU_w__7`OiDqvr(B(_A$13I~d zfO?d_K5*Vg8^%|jz%R_F0EBL=3i=GKRVsT;v*?_`ir^p!mG+T;)hdZE&xsZ}Gy(=feUHMD zwS9+izCUYLA~Xkj-E*I;5Q+7|euUGP(GdWJ3NB7>AV+JwSi#=dI0Qr;@8n1KN3hyo zZb4BTwl1mzch!+sixiFl+)Aj4OQ1P;0@^5_YN>M^oV%6Ft${E~eh9=%JfJ&6o zma>D}P=P}u60EJRYUu2Gx5H1Tk?-XIlzgC?`zqTS?qCII6nUr&?5su$0*k~N{)1|o z8kQQs(1;dChyhqtQF?%VREp3Gvkt(bHk5fKVdJ1tJJKF^at%|iCmVFWLaNQZbY)!3 z3|~6{!_z$g<7TiCMzKD(WPtPwvKvG0HxR^6XRUOmFxYHMpI+n^vH6d^>sK*~SbtpX_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Projectiles/Melee/PrismRay.cs +++ b/Projectiles/Melee/PrismRay.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { DelegateMethods.v3_1 = RayColor.ToVector3() * 0.5f; - Utils.PlotTileLine(StartingPosition, projectile.Center, 8f, new Utils.PerLinePoint(DelegateMethods.CastLight)); + Utils.PlotTileLine(StartingPosition, projectile.Center, 8f, DelegateMethods.CastLight); if (projectile.localAI[0] == 0f) { projectile.direction = Main.rand.NextBool(2).ToDirectionInt(); diff --git a/Projectiles/Rogue/PrismJavelinDuplicate.cs b/Projectiles/Rogue/PrismJavelinDuplicate.cs new file mode 100644 index 0000000000..32f430a60a --- /dev/null +++ b/Projectiles/Rogue/PrismJavelinDuplicate.cs @@ -0,0 +1,61 @@ +using CalamityMod.Items; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class PrismJavelinDuplicate : ModProjectile + { + public ref float Time => ref projectile.ai[0]; + public ref float Lifetime => ref projectile.ai[1]; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Prism Javelin"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 6; + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + } + + public override void SetDefaults() + { + projectile.scale = 0.66f; + projectile.width = projectile.height = (int)(124f * projectile.scale); + projectile.friendly = true; + projectile.penetrate = 3; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 16; + projectile.timeLeft = 900; + projectile.extraUpdates = 1; + projectile.Calamity().rogue = true; + } + + public override void AI() + { + // Accelerate until at a certain speed. + if (projectile.velocity.Length() < 20f) + projectile.velocity *= 1.02f; + + projectile.Opacity = CalamityUtils.Convert01To010(Time / Lifetime) * 0.6f; + if (Time >= Lifetime) + projectile.Kill(); + + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver4; + Time++; + } + + public override bool CanDamage() => projectile.alpha < 180; + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + if (Time <= 1f) + return false; + + Color drawColor = CalamityUtils.MulticolorLerp((Time / 35f + projectile.identity / 4f) % 1f, CalamityGlobalItem.ExoPalette); + drawColor.A = 0; + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, drawColor, ProjectileID.Sets.TrailingMode[projectile.type]); + return false; + } + } +} diff --git a/Projectiles/Rogue/PrismJavelinDuplicate.png b/Projectiles/Rogue/PrismJavelinDuplicate.png new file mode 100644 index 0000000000000000000000000000000000000000..e6f4b2d8f37e05b4351988180306ae22b31c2584 GIT binary patch literal 2210 zcmeHH`#01H6u)2NInp3K)+577h$+R{qEquggBg!7@+`F;)9x`blU7U`QmxtY$goN6 z+Aul0JA?6RcFodpmbMUvH7bnfni>s~Oe{P78GE+RIro0Yo~PpP!L27_14sPVr_6Z zoa-Sxl}Zf@3k!-!q|@n1Nl8p5lg0ivCnqN_FR!eu>`tXnAP_V+H%p~bxm-RyJv}=+ zt5T_!mX_3N^~T1Arqw5Wn!tZ+0#y%6eKdap=Ys=6G&lTz286uVv(s$PAlWB^1+cmO zqamH=s^c`;VeRWh3{5*ZeS7@EeHY`aSqV2A!^3JPR$Hsf^2^*E8l#5l&yZ9YZQGYB z>aEg(3Af)e$%zCbQ^;x+ zig(2&VeuXDyJi1+HjvIOU%$etvw57spX^5n^gEsd1EcO9al;U=(Dk3Y_c}u>7PjUvzf zqWb!9makYVEzmu8`*Bgxk?9h%0k_!dtr@!&7xkvl<>MEuI8#m;R&|~td;fh1Y%vu0 zE_)LV?iUA4Y^U&d2}a*;!Y=$+z6M+r3YBe({`6llgX5+U5-%#-88|K2ahv26>g%yLvb# z)J&^jFJ)fLL^*H=(H19vva#a`ow!3-7Y-B>4?fh(0HM(%OXTx1k#;OQhL$?Apbt`& zB|%@*I*N#qd8VI1*31z0A^+wsqwH8?$FzfV13)t(4*cQv$f30&%qh}%nMzgm9ROZJ zt$p93B7T|8kVsN=%WoM2tqPMG!tV2ON7!uTmCzeFnP@}bG&^@Hly<80dnbF4(gP+C z$Z5vDsdX;A#Gbd9M#Y-54RM|gOIjRK9JFRL8lRbPCfZGJU{RbHDG*GX7F*&#*$71h znM#2cDy=Cxy+4;G>~K}P*d3XBf7d`h#1xUJ&5nDSMjXd(z}!Emrw-S z>5UIhw0Mi2CV$;8w%vs0)~r;nK~q$T+>c<+PECs10<|{MrpSip4~CgQ=q2mxiw?rJ zFH;3`7Q?I#zH(^B!5+FgNX~=rGHaZm!MPY#dMu}PdQ;7;xHxHwB!LoeD6(3VdNn6G z>P(LzAzlXIX*Q8d!;G2eiWT{(VhnV&1h+==Zc_HWcvv8QGs1rfhtOW*c)bFN@Z5>L z@IhW~hAa&0a=K^6=2%Euf7hfSmoDx+is7WJI*zW?_*ui`>TX$*pOw6BoO~7)yY_g# zf`|CjdB#@J74qF^LQj$5PC?-3m#TsC*2Q?{O5rA3%^5AjI9m@9CdRYUlmsf5d8$J!-+ zNSkt!@w)f3w~jh6?5gHnJM)y9ezYz5n=L5}77yLV>gp>(0v_Py`*Aw)cXhKqs=u#y KfR~UIoBb~%(m3}3 literal 0 HcmV?d00001 diff --git a/Projectiles/Rogue/PrismJavelinProjectile.cs b/Projectiles/Rogue/PrismJavelinProjectile.cs new file mode 100644 index 0000000000..f4c133a79e --- /dev/null +++ b/Projectiles/Rogue/PrismJavelinProjectile.cs @@ -0,0 +1,169 @@ +using CalamityMod.Items; +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.Rogue +{ + public class PrismJavelinProjectile : ModProjectile + { + public int Time; + public ref float HitTargetIndex => ref projectile.ai[0]; + + public override string Texture => "CalamityMod/Items/Weapons/Rogue/PrismJavelin"; + + public override void SetStaticDefaults() => DisplayName.SetDefault("Prism Javelin"); + + public override void SetDefaults() + { + projectile.width = projectile.height = 124; + projectile.friendly = true; + projectile.tileCollide = false; + projectile.penetrate = 2; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + projectile.timeLeft = 300; + projectile.Calamity().rogue = true; + } + + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(Time); + + // timeLeft is not synced by default. However, it is changed during an operation that is only + // performed from one client's perspective, therefore it must be synced in this context. + writer.Write(projectile.timeLeft); + writer.Write((byte)projectile.alpha); + writer.Write(projectile.scale); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + Time = reader.ReadInt32(); + projectile.timeLeft = reader.ReadInt32(); + projectile.alpha = reader.ReadByte(); + projectile.scale = reader.ReadSingle(); + } + + public override void AI() + { + // Accelerate until at a certain speed. + if (projectile.velocity.Length() < 20f) + projectile.velocity *= 1.02f; + + if (projectile.alpha < 10) + EmitDustFromTip(); + + // Stick to the target for a while and release a bunch of duplicates. + if (Main.npc.IndexInRange((int)HitTargetIndex) && Main.npc[(int)HitTargetIndex].active) + { + if (projectile.alpha < 255) + projectile.alpha = Utils.Clamp(projectile.alpha + 30, 0, 255); + + int shootRate = projectile.Calamity().stealthStrike ? 2 : 4; + if (projectile.timeLeft % shootRate == shootRate - 1) + { + FireDuplicateAtTarget(Main.npc[(int)HitTargetIndex], projectile.Calamity().stealthStrike ? 305f : 200f); + if (projectile.Calamity().stealthStrike) + FireExtraDuplicatesAtTarget(Main.npc[(int)HitTargetIndex]); + } + } + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver4; + Time++; + } + + public void EmitDustFromTip() + { + if (Main.dedServ) + return; + + float dustVelocityArcOffset = 1.5f + (float)Math.Sin(MathHelper.TwoPi * projectile.timeLeft / 35f) * 0.25f; + + float colorInterpolant = (float)Math.Cos(MathHelper.TwoPi * projectile.timeLeft / 75f) * 0.5f + 0.5f; + Color dustColor = CalamityUtils.MulticolorLerp(colorInterpolant, CalamityGlobalItem.ExoPalette); + Vector2 currentDirection = projectile.velocity.SafeNormalize(-Vector2.UnitY); + Vector2 tipPosition = projectile.Center + currentDirection * (projectile.height * 0.67f - 3f); + tipPosition += Main.rand.NextVector2CircularEdge(0.35f, 0.35f); + + for (float direction = -1f; direction <= 1f; direction += 2f) + { + Dust prismaticEnergy = Dust.NewDustPerfect(tipPosition, 267); + prismaticEnergy.velocity = currentDirection.RotatedBy(direction * dustVelocityArcOffset) * -7f + projectile.velocity; + prismaticEnergy.scale = 1.2f; + prismaticEnergy.color = dustColor; + prismaticEnergy.noGravity = true; + + prismaticEnergy = Dust.CloneDust(prismaticEnergy); + prismaticEnergy.scale *= 0.6f; + } + } + + public void FireDuplicateAtTarget(NPC target, float baseOutwardness) + { + if (Main.myPlayer != projectile.owner) + return; + + Vector2 spawnPosition = target.Center + Main.rand.NextVector2CircularEdge(baseOutwardness, baseOutwardness) * Main.rand.NextFloat(0.9f, 1.15f); + Vector2 shootVelocity = (target.Center - spawnPosition).SafeNormalize(Vector2.UnitY) * Main.rand.NextFloat(12f, 14f); + Projectile.NewProjectile(spawnPosition, shootVelocity, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, baseOutwardness / 9f); + } + + public void FireExtraDuplicatesAtTarget(NPC target) + { + if (Main.myPlayer != projectile.owner) + return; + + Vector2 spawnPosition = target.Center + Vector2.UnitY * Main.rand.NextBool(2).ToDirectionInt() * Main.rand.NextFloat(200f, 270f); + spawnPosition.X += Main.rand.NextFloatDirection() * target.width * 0.45f; + + Vector2 shootVelocity = Vector2.UnitY * (target.Center.Y - spawnPosition.Y > 0f).ToDirectionInt() * Main.rand.NextFloat(14f, 16.5f); + Projectile.NewProjectile(spawnPosition, shootVelocity, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 24f); + } + + public void ReleaseHitDust(Vector2 spawnPosition) + { + if (Main.dedServ) + return; + + int dustCount = projectile.Calamity().stealthStrike ? 60 : 40; + Vector2 baseDustVelocity = -Vector2.UnitY.RotatedByRandom(MathHelper.Pi) * 1.4f; + Vector2 outwardFireSpeedFactor = new Vector2(2.1f, 2f); + + for (float i = 0f; i < dustCount; i++) + { + Color dustColor = CalamityUtils.MulticolorLerp(Main.rand.NextFloat(), CalamityGlobalItem.ExoPalette); + Dust explosionDust = Dust.NewDustDirect(spawnPosition, 0, 0, 267, 0f, 0f, 0, dustColor, 1f); + explosionDust.position = spawnPosition; + explosionDust.velocity = baseDustVelocity.RotatedBy(MathHelper.TwoPi * i / dustCount) * outwardFireSpeedFactor * Main.rand.NextFloat(0.8f, 1.2f); + explosionDust.velocity += projectile.velocity * Main.rand.NextFloat(0.6f, 0.85f); + if (projectile.Calamity().stealthStrike) + explosionDust.velocity *= 1.6f; + + explosionDust.noGravity = true; + explosionDust.scale = 1.1f; + explosionDust.fadeIn = Main.rand.NextFloat(1.4f, 2.4f); + + Dust.CloneDust(explosionDust).velocity *= Main.rand.NextFloat(0.8f); + + explosionDust = Dust.CloneDust(explosionDust); + explosionDust.scale /= 2f; + explosionDust.fadeIn /= 2f; + explosionDust.color = new Color(255, 255, 255, 255); + } + } + + public override bool CanDamage() => projectile.alpha < 80; + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + ReleaseHitDust(target.Center - projectile.velocity * 3f); + HitTargetIndex = target.whoAmI; + projectile.timeLeft = projectile.Calamity().stealthStrike ? 100 : 60; + projectile.netUpdate = true; + } + } +} From fcc4448cfc861fe86667dd6236f0c9aa22ce573d Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Thu, 18 Mar 2021 19:44:02 -0500 Subject: [PATCH 059/202] Renamed Prism Shuriken to Refraction Rotor --- .../Rogue/{PrismShuriken.cs => RefractionRotor.cs} | 6 +++--- .../{PrismShuriken.png => RefractionRotor.png} | Bin ...ikenGlowmask.png => RefractionRotorGlowmask.png} | Bin ...enProjectile.cs => RefractionRotorProjectile.cs} | 8 +++----- 4 files changed, 6 insertions(+), 8 deletions(-) rename Items/Weapons/Rogue/{PrismShuriken.cs => RefractionRotor.cs} (90%) rename Items/Weapons/Rogue/{PrismShuriken.png => RefractionRotor.png} (100%) rename Projectiles/Rogue/{PrismShurikenGlowmask.png => RefractionRotorGlowmask.png} (100%) rename Projectiles/Rogue/{PrismShurikenProjectile.cs => RefractionRotorProjectile.cs} (95%) diff --git a/Items/Weapons/Rogue/PrismShuriken.cs b/Items/Weapons/Rogue/RefractionRotor.cs similarity index 90% rename from Items/Weapons/Rogue/PrismShuriken.cs rename to Items/Weapons/Rogue/RefractionRotor.cs index e8aae97879..d27133187f 100644 --- a/Items/Weapons/Rogue/PrismShuriken.cs +++ b/Items/Weapons/Rogue/RefractionRotor.cs @@ -6,11 +6,11 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class PrismShuriken : RogueWeapon + public class RefractionRotor : RogueWeapon { public override void SetStaticDefaults() { - DisplayName.SetDefault("Prism Shuriken"); + DisplayName.SetDefault("Refraction Rotor"); Tooltip.SetDefault("Fires a large prismatic razorblade\n" + "After hitting something, the blade dies moments later\n" + "The blade explodes into rockets on death\n" + @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.Calamity().rogue = true; item.autoReuse = true; item.shootSpeed = 18f; - item.shoot = ModContent.ProjectileType(); + item.shoot = ModContent.ProjectileType(); item.useStyle = ItemUseStyleID.SwingThrow; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/PrismShuriken.png b/Items/Weapons/Rogue/RefractionRotor.png similarity index 100% rename from Items/Weapons/Rogue/PrismShuriken.png rename to Items/Weapons/Rogue/RefractionRotor.png diff --git a/Projectiles/Rogue/PrismShurikenGlowmask.png b/Projectiles/Rogue/RefractionRotorGlowmask.png similarity index 100% rename from Projectiles/Rogue/PrismShurikenGlowmask.png rename to Projectiles/Rogue/RefractionRotorGlowmask.png diff --git a/Projectiles/Rogue/PrismShurikenProjectile.cs b/Projectiles/Rogue/RefractionRotorProjectile.cs similarity index 95% rename from Projectiles/Rogue/PrismShurikenProjectile.cs rename to Projectiles/Rogue/RefractionRotorProjectile.cs index 6f7cda6dbe..e87801c161 100644 --- a/Projectiles/Rogue/PrismShurikenProjectile.cs +++ b/Projectiles/Rogue/RefractionRotorProjectile.cs @@ -7,12 +7,10 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class PrismShurikenProjectile : ModProjectile + public class RefractionRotorProjectile : ModProjectile { - public ref float BaseDamage => ref projectile.ai[0]; - public ref float AccumulatedHits => ref projectile.ai[1]; public const int EnergyShotCount = 6; - public override string Texture => "CalamityMod/Items/Weapons/Rogue/PrismShuriken"; + public override string Texture => "CalamityMod/Items/Weapons/Rogue/RefractionRotor"; public override void SetStaticDefaults() { @@ -108,7 +106,7 @@ namespace CalamityMod.Projectiles.Rogue public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) { - Texture2D glowmask = ModContent.GetTexture("CalamityMod/Projectiles/Rogue/PrismShurikenGlowmask"); + Texture2D glowmask = ModContent.GetTexture("CalamityMod/Projectiles/Rogue/RefractionRotorGlowmask"); Vector2 drawPosition = projectile.Center - Main.screenPosition + Vector2.UnitY * projectile.gfxOffY; Vector2 origin = glowmask.Size() * 0.5f; spriteBatch.Draw(glowmask, drawPosition, null, projectile.GetAlpha(Color.White), projectile.rotation, origin, projectile.scale, SpriteEffects.None, 0f); From 54cf4ad93c3a77c0c016f58153f30dc9428f1e06 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Thu, 18 Mar 2021 21:01:51 -0500 Subject: [PATCH 060/202] Added the Jailor and Surge Driver --- ExtraTextures/Lasers/FadeLaserEnd.png | Bin 0 -> 310 bytes ExtraTextures/Lasers/FadeLaserMid.png | Bin 0 -> 251 bytes ExtraTextures/Lasers/FadeLaserStart.png | Bin 0 -> 313 bytes ExtraTextures/Lasers/PrismLaserEnd.png | Bin 0 -> 310 bytes ExtraTextures/Lasers/PrismLaserMid.png | Bin 0 -> 251 bytes ExtraTextures/Lasers/PrismLaserStart.png | Bin 0 -> 313 bytes Items/Weapons/Ranged/SurgeDriver.cs | 78 +++++++++++ Items/Weapons/Ranged/SurgeDriver.png | Bin 0 -> 2321 bytes Items/Weapons/Ranged/TheJailor.cs | 49 +++++++ Items/Weapons/Ranged/TheJailor.png | Bin 0 -> 2230 bytes Projectiles/Ranged/PrismComet.cs | 102 ++++++++++++++ Projectiles/Ranged/PrismEnergyBullet.cs | 69 +++++++++ Projectiles/Ranged/PrismExplosionLarge.cs | 60 ++++++++ Projectiles/Ranged/PrismExplosionLarge.png | Bin 0 -> 22972 bytes Projectiles/Ranged/PrismExplosionSmall.cs | 56 ++++++++ Projectiles/Ranged/PrismExplosionSmall.png | Bin 0 -> 2924 bytes Projectiles/Ranged/PrismMine.cs | 110 +++++++++++++++ Projectiles/Ranged/PrismMine.png | Bin 0 -> 514 bytes Projectiles/Ranged/PrismMineArc.png | Bin 0 -> 542 bytes Projectiles/Ranged/PrismMineGlowmask.png | Bin 0 -> 2122 bytes Projectiles/Ranged/PrismaticEnergyBlast.cs | 147 ++++++++++++++++++++ Projectiles/Ranged/PrismaticEnergyBlast.png | Bin 0 -> 2903 bytes 22 files changed, 671 insertions(+) create mode 100644 ExtraTextures/Lasers/FadeLaserEnd.png create mode 100644 ExtraTextures/Lasers/FadeLaserMid.png create mode 100644 ExtraTextures/Lasers/FadeLaserStart.png create mode 100644 ExtraTextures/Lasers/PrismLaserEnd.png create mode 100644 ExtraTextures/Lasers/PrismLaserMid.png create mode 100644 ExtraTextures/Lasers/PrismLaserStart.png create mode 100644 Items/Weapons/Ranged/SurgeDriver.cs create mode 100644 Items/Weapons/Ranged/SurgeDriver.png create mode 100644 Items/Weapons/Ranged/TheJailor.cs create mode 100644 Items/Weapons/Ranged/TheJailor.png create mode 100644 Projectiles/Ranged/PrismComet.cs create mode 100644 Projectiles/Ranged/PrismEnergyBullet.cs create mode 100644 Projectiles/Ranged/PrismExplosionLarge.cs create mode 100644 Projectiles/Ranged/PrismExplosionLarge.png create mode 100644 Projectiles/Ranged/PrismExplosionSmall.cs create mode 100644 Projectiles/Ranged/PrismExplosionSmall.png create mode 100644 Projectiles/Ranged/PrismMine.cs create mode 100644 Projectiles/Ranged/PrismMine.png create mode 100644 Projectiles/Ranged/PrismMineArc.png create mode 100644 Projectiles/Ranged/PrismMineGlowmask.png create mode 100644 Projectiles/Ranged/PrismaticEnergyBlast.cs create mode 100644 Projectiles/Ranged/PrismaticEnergyBlast.png diff --git a/ExtraTextures/Lasers/FadeLaserEnd.png b/ExtraTextures/Lasers/FadeLaserEnd.png new file mode 100644 index 0000000000000000000000000000000000000000..899fa123784b642d29b65c0337ec59e5887da423 GIT binary patch literal 310 zcmeAS@N?(olHy`uVBq!ia0vp^VnBR}gBeIx3LjVvq!^2X+?^QKos)S9^91;WxB}__|NlRF^a#kNMQ;sbxOfY*K5Fat?zVg1rbrNf9rXM}}VqFhANcqj0 vx2q%H{5>=08LzlaVxIp0*L!!e$UWu^ZZK$#nYb$&=v)R*S3j3^P6^91;WxB}__|NlRF^a#k=G}R|B({WuN@!tVxCxfS}pUXO@geCxD!&`d* literal 0 HcmV?d00001 diff --git a/ExtraTextures/Lasers/FadeLaserStart.png b/ExtraTextures/Lasers/FadeLaserStart.png new file mode 100644 index 0000000000000000000000000000000000000000..0e661a1658fba71e73bfda4527ddb14964aac5e2 GIT binary patch literal 313 zcmeAS@N?(olHy`uVBq!ia0vp^VnBR}gBeIx3LjVvq!^2X+?^QKos)S9^91;WxB}__|NlRF^a#kPo72wv+kKy$(_MLxSuf$X=J$V$uHOyj^8Wo(19UNir>mdKI;Vst0K`{+ A{r~^~ literal 0 HcmV?d00001 diff --git a/ExtraTextures/Lasers/PrismLaserEnd.png b/ExtraTextures/Lasers/PrismLaserEnd.png new file mode 100644 index 0000000000000000000000000000000000000000..a8079f34185e25b7d7133e2bca81bb23c68cc2ab GIT binary patch literal 310 zcmeAS@N?(olHy`uVBq!ia0vp^VnBR}gBeIx3LjVvq!^2X+?^QKos)S9^91;WxB}__|Np;_@B%U}Ge6=7sVfQc3kC`@IB2c>0_1ZRctjR6Fz_7) zVaDV6D^h@hi#=T&Ln7SYUb)D1$bhFc@%Fy|*0Y_3ZHp;}utD z>96^1w7l{#Yw(QAdy34$YjpZ=yC41W^6t@Bv4;IKfBW<~KX2?x?#Wk4_UXCMW4LdF zN%7I+MwR;#Ouiot|8K2rx$ed6lw%7E6U-h5#7E4!ue>jDoy6Lj=|_*gSl7c2Qhu}M v?dr%kf6vT$#w%`K^91;WxB}__|Np;_@B%U}Ge6=7sVfQc3kC`@IB2c>0_1ZRctjR6Fz_7) zVaDV6D^h@h8J;eVArbCxuNZP2P~dU6sCMuFxvOfr8^vN8bg=d#Wzp$Py^Em_?F literal 0 HcmV?d00001 diff --git a/ExtraTextures/Lasers/PrismLaserStart.png b/ExtraTextures/Lasers/PrismLaserStart.png new file mode 100644 index 0000000000000000000000000000000000000000..e8c35908399ab7b0afe54979bfc66265ce450921 GIT binary patch literal 313 zcmeAS@N?(olHy`uVBq!ia0vp^VnBR}gBeIx3LjVvq!^2X+?^QKos)S9^91;WxB}__|Np;_@B%U}Ge6=7sVfQc3kC`@IB2c>0_1ZRctjR6Fz_7) zVaDV6D^h@h%RF5iLn7SYUOC9uqQK)C$o>ES`Ny-jEnJq>zND?^WvqlHcK~PJ-z`b^ zt7m%Tef!s$dvni&QoS2tZ%#j(c{j6ng{fqV&;1kugJlj@XKjs@!`SBEjF>M z@S|w)VNAxb4|OKcj^ju7&G@=_(Tq|{5yNe{KEXX*-GN7r zchwr6|Fb&n=Crf^cHbxGbXOi^)=Rjp`TZZG>vw~>ynp}H0A0-B>FVdQ&MBb@084#- AU;qFB literal 0 HcmV?d00001 diff --git a/Items/Weapons/Ranged/SurgeDriver.cs b/Items/Weapons/Ranged/SurgeDriver.cs new file mode 100644 index 0000000000..b5f285e84d --- /dev/null +++ b/Items/Weapons/Ranged/SurgeDriver.cs @@ -0,0 +1,78 @@ +using CalamityMod.Projectiles.Ranged; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Ranged +{ + public class SurgeDriver : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Surge Driver"); + Tooltip.SetDefault("Left clicks release a laser ray that explodes on collision\n" + + "Right clicks release a barrage of laser beams that release homing energy on enemy hitss"); + } + + public override void SetDefaults() + { + item.damage = 1200; + item.ranged = true; + item.width = 164; + item.height = 58; + item.useTime = item.useAnimation = 56; + item.useStyle = ItemUseStyleID.HoldingOut; + item.noMelee = true; + item.knockBack = 8f; + item.value = CalamityGlobalItem.RarityVioletBuyPrice; + item.rare = ItemRarityID.Purple; + item.Calamity().customRarity = CalamityRarity.Violet; + item.autoReuse = true; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 11f; + item.useAmmo = AmmoID.Bullet; + } + + public override Vector2? HoldoutOffset() => Vector2.UnitX * -50f; + + public override bool AltFunctionUse(Player player) => true; + + public override bool CanUseItem(Player player) + { + if (player.altFunctionUse == 2) + item.UseSound = SoundID.Item14; + else + item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LaserCannon"); + return base.CanUseItem(player); + } + public override float UseTimeMultiplier(Player player) => player.altFunctionUse == 2 ? 5f : 1f; + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + Vector2 shootVelocity = new Vector2(speedX, speedY); + Vector2 shootDirection = shootVelocity.SafeNormalize(Vector2.UnitX * player.direction); + Vector2 gunTip = position + shootDirection * item.scale * 132f; + + // Large bullet/rocket releasing. + if (player.altFunctionUse == 2) + { + for (int i = 0; i < 2; i++) + { + Vector2 newShootVelocity = shootVelocity * Main.rand.NextFloat(1f, 1.45f); + newShootVelocity = newShootVelocity.RotatedByRandom(0.15f); + Projectile.NewProjectile(gunTip, newShootVelocity, item.shoot, damage, knockBack, player.whoAmI); + } + } + + // Snipe blast. + else + { + shootVelocity *= 0.64f; + damage = (int)(damage * 6.66); + Projectile.NewProjectile(gunTip, shootVelocity, ModContent.ProjectileType(), damage, knockBack, player.whoAmI); + } + return false; + } + } +} diff --git a/Items/Weapons/Ranged/SurgeDriver.png b/Items/Weapons/Ranged/SurgeDriver.png new file mode 100644 index 0000000000000000000000000000000000000000..f06915a6ac38ef682739f9df02faf2344911d104 GIT binary patch literal 2321 zcmV+s3GViZP) zTZ|P&8pnSP1Cbe=3k+8g6pVr(@tVlS9d#qFiY7>+24jp5W_Mv%M(I0I+exD~a{Waklau+qX%PR?c!MW~|WWX!DS4g2}^E?20w=4o+?%RI@;LGgxYv#^LJnpGgF97h)n`;0#@ZE0My^`fa%?T^IqQT&@6a&2>`p6ZOSCIW6*go3W7ogykdwishcnffXh8Wb|%73b7WD`UC6jLoBI(w;{YO>=Pn?!Eqn@qZQuPG+wZP5&&EEBQj+pXlF66{N)(yh<$DruD@rZxtDihA z8;LsVsQ&yUC}hAZ2H(Yr%4kC?itdey=c~T2IkvsndR_a=ewSZ4H`RG$yiyQvDGICG zAquH!Y2Yc0~sO zH{CipR&SwR)aL#4cJYE*L2Sw?il~wOv?5KJ-NIPKJ$tzQys6zam!6m$beT2@sJ63ATV^i%(kDPx9i@o&Fe`$5@C69 z^*>{uUASV{g3EJi?`A{BEth<|6@X3GF9zVoMR(`j|KH!<1Hd!ae~`GpwBP0>bvt*c zCzkDcY~z|WwYAyTxh`2K_LTPky;@I+Z`zAY#XhNw(&lVR!Z@R zE>Eewp-U-Uh_}*_n{s3G*0$?+jS2|1_Ph4qwdRso`GS=uzqGrnGXfYhb{qih$B&j2 znbQP?40uHaD)y`uE$#TB9@i6P(&LlbyUF?VoiF=|hkW%-)4Sii>Hh%Sx8%=>?U1Y= z*-vBhqLK~t&|@oO<+k4VaA8v}?H%R&wne5~PcmJfcw6D=Kj>Jz@y6X4N^IMvh~oWhy?YmOoG9g*ns|Qctn91niRpSWx*}^qAp>6F z%ox{-AZV|acHB=CRNrYXrO{qel;ZVuZ{)uK)m~xsDifPtwK_Q#ElO!ad#-Y!$M-}* zL?LbCkcGBO_qwHi;ky6jAI-3NTD@Hq(e_y%7Zft!6%j>dco&+zbPQ&EFzuBZu5w8y|!^j-F{n^k{mCQBtardTET7Kr_SeeeU{%tP{@E+ z42jeT#VUy_o5xnKD@L1EA$5dDys2&6@-L4q%iBIze&%q`3Uo!zilw@0Mg-7v>JZ?L zWlvu)E&^!!xD|j=6{h>q*VA3r-%U`+fL9FZW$Ww`7dC~k-6^iD6j!}zl~FT!nwje& z*Q@>`;YAU34s3oQ+iVbFuuA5$h$^TDuO}=yuz97BiOP^WFGa|vnEe&;HUoB+#FXg zJ8kb;W1C}AD!SdGpn@oA!ipBZD`_*lh1oYxhyYr??ueBScLsQ&1ceNEg|(Nhx#FsM z5kPl`S#?b2WQcc=-j+)VUHN+&mlqXgEPn)mQH^G`A6NdO&4UVhu8^zTMzOt48*<%} z!LMV^8@g8xIR{w&nZT=B{XLSx&mV&`}8;Gqx$YE2CTH?({B=U#CQ% z7i^5T$L1k@BPe9RD@qwN%d3onEz;1~&;Y)I60;tGFAda<}m2CC6rq1`&o>HHuPz9VeV^#z((BBW_yn1D2m3gf)ueZ-KPpGfj z`xCwYE%lXAc6+ScH_xaE3K{T57c*h z&p+-3;Lhzv5o}pNI^$eC;UMLU0Ir_55P-eSO^FKR@{WZnV4?W3(nPrl3K{Tt#3FLfXd2oF?AkYF*@-$QAU|3Ec1iMUs@gWoGwJk_Uw-TTZ3&5(B9@Id8?ly zvGduK(6-|3(L=3in(O3zQ@*qWg$#H_$sW>1p5AHVIqN5xRnjV}s$%uF?r#C0cgwXv zP9e4Dbm7WloHEt?Pt38l!>+1g=ey9>XB=sQLI%8|?EelmW7cc{4z;!v^e+yBdW{*# z&FT0Y)7zHFgsj4~ezQ?B`M1}X)_nrNTkD(); + item.shootSpeed = 11f; + item.useAmmo = AmmoID.Bullet; + } + + public override Vector2? HoldoutOffset() => new Vector2(-40f, -16f); + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + Vector2 shootVelocity = new Vector2(speedX, speedY); + Vector2 shootDirection = shootVelocity.SafeNormalize(Vector2.UnitX * player.direction); + Vector2 gunTip = position + shootDirection * item.scale * 45f; + + Projectile.NewProjectile(gunTip, shootVelocity, item.shoot, damage, knockBack, player.whoAmI); + return false; + } + } +} diff --git a/Items/Weapons/Ranged/TheJailor.png b/Items/Weapons/Ranged/TheJailor.png new file mode 100644 index 0000000000000000000000000000000000000000..fe3c9379ec5162ed6f62a5492eda390d3667d5cf GIT binary patch literal 2230 zcmV;n2ub&eP)Px-a7jc#RCt{2oLg{JR~g5DTMi}n#1z6Up(G#$VHl>iL$Q@oMg?g*+IFgqK6#m8 z;)7#BJN44h2dg+vybn-kv=7=si&Hz;BDGbqMZ={s43?IVCV{4DplNO=7b*=oKCJVR zvleUbb4YTMb!OK8WoNJZIa$B8zVBQ6?0_86M{d4N{!ApVL2CYg4*hdd$CGV+V5$e; zWmjyf2QUsL04i4&1OWeg?@L->WOMflW9$*^rI0Ysx93Pz;)F%0F*BKPyo>PdQ)V(uE`VQsIoy!BC1@bx@B2K z0C22nIsg}j+qL}CN;UNV9&AYfta$nkb$|D>0DQHt8Gz?jeL|~Ol&>m|OzQ_=XrK>p zk04KsqslrlVS9kgXwi@VeV2B>;h{|cw8x*e_Se(h69Dwbd#!}l^}eCCEA3q@cm;sY zbIOWyl^{=yqsp39R&!%H04=X{Ycu+6Yl~K{|1Zk#kQr@i_VNMkzOD5Xka;vYzHeD% z`zArN=PgtOjf_~!PgWG$6XU3|7DqA(x_R|#01h2KtP%9;_B^eeIkU|@=7u$&wD$MR zu16!sW0E7JR8=q4$_bICX5>i}d&rtU(Ik0d9Myyovu5Si$ovcMzm>cye`G~<2LMN# zMyytqSVe1V6)|TTwrc5eqG`@}Q96R8-NDvhM7AReBWYH}+yJ2S9rbx8iX2ajqZ%_Y zCLzJxDgY84ZIPaT(W-fBh8;ZuKv!Hvf#ZX10QB|R{gThrZU$h{qQw9-H!D9S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Vk0s`-!VWn@w`kk&>6Meh2g3g`rHX!>d|#2I74g)$_zS zs!1nC2oO@j?E86DH37ieZJ}14NL#DJqPk{35_=QRTRiTOOPA91H!1SOII1aom)E>1 z6^4GhttDZkXGF@(3iV8~Saaq{W;&}(R9sRf?+cJ5>)s+nrR)(|l_$ng<>cG%l8XG5 zfXIwVnMxPiN+E4hzbj9SqsqBA{Dn#O7CBiopNa`PFEO9WG5x5N$V67g9VSnVqsm2M ztT84bB|^#HMk;I0e8wPbubOO9M4lK&m5WxHm6&uViG{_=Um5Jze*#gO59Fm{e z6XP`|<*ZdE)>UWISpf2jiUWZ5(~T4Iru3T=pZu>b%707*qoM6N<$ Eg6}XwsQ>@~ literal 0 HcmV?d00001 diff --git a/Projectiles/Ranged/PrismComet.cs b/Projectiles/Ranged/PrismComet.cs new file mode 100644 index 0000000000..f98fd7303b --- /dev/null +++ b/Projectiles/Ranged/PrismComet.cs @@ -0,0 +1,102 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Ranged +{ + public class PrismComet : ModProjectile + { + public ref float Time => ref projectile.ai[0]; + public override string Texture => "CalamityMod/Projectiles/Melee/Exocomet"; + + 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.scale = 0.86f; + projectile.width = 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() + { + Lighting.AddLight(projectile.Center, Color.LightSeaGreen.ToVector3()); + projectile.frameCounter++; + if (projectile.frameCounter % 6 == 5) + projectile.frame = (projectile.frame + 1) % Main.projFrames[projectile.type]; + + projectile.alpha = Utils.Clamp(projectile.alpha - 25, 30, 255); + + if (projectile.alpha < 40) + ReleaseIdleDust(); + + // Home onto any targets after a short amount of time. + if (Time >= 25f) + { + NPC potentialTarget = projectile.Center.ClosestNPCAt(1050f); + if (potentialTarget != null) + projectile.velocity = (projectile.velocity * 12f + projectile.DirectionTo(potentialTarget.Center) * 19f) / 13f; + } + else + projectile.velocity *= 1.05f; + + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; + + Time++; + } + public void ReleaseIdleDust() + { + if (Main.dedServ) + return; + + Dust prismEnergy = Dust.NewDustDirect(projectile.position - projectile.velocity * 4f, 8, 8, 107, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, new Color(0, 255, 255), 0.5f); + prismEnergy.velocity *= -0.25f; + prismEnergy.velocity -= projectile.velocity * 0.3f; + + prismEnergy = Dust.NewDustDirect(projectile.position - projectile.velocity * 4f, 8, 8, 107, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, new Color(0, 255, 255), 0.5f); + prismEnergy.velocity *= -0.25f; + prismEnergy.position -= projectile.velocity * 0.5f; + prismEnergy.velocity -= projectile.velocity * 0.3f; + } + + public override bool CanDamage() => Time >= 20f; + + 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) + { + Color color = Color.Honeydew * projectile.Opacity; + color.A = 0; + return color; + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(SoundID.Zombie, (int)projectile.position.X, (int)projectile.position.Y, 103, 1f, 0f); + CalamityGlobalProjectile.ExpandHitboxBy(projectile, 80); + projectile.Damage(); + + if (Main.myPlayer != projectile.owner) + return; + + Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), projectile.damage, 0f, projectile.owner); + } + } +} diff --git a/Projectiles/Ranged/PrismEnergyBullet.cs b/Projectiles/Ranged/PrismEnergyBullet.cs new file mode 100644 index 0000000000..cf1920bd67 --- /dev/null +++ b/Projectiles/Ranged/PrismEnergyBullet.cs @@ -0,0 +1,69 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Ranged +{ + public class PrismEnergyBullet : ModProjectile + { + public ref float CurrentLaserLength => ref projectile.ai[0]; + public ref float Time => ref projectile.ai[1]; + public override string Texture => "CalamityMod/Projectiles/LaserProj"; + + public override void SetStaticDefaults() => DisplayName.SetDefault("Prism Rocket"); + + public override void SetDefaults() + { + projectile.scale = 1.7f; + projectile.width = projectile.height = 12; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.timeLeft = 300; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 13; + projectile.extraUpdates = 1; + projectile.ranged = true; + } + + public override void AI() + { + CurrentLaserLength = (int)MathHelper.Lerp(1f, 70f, Utils.InverseLerp(0f, 15f, Time, true) * Utils.InverseLerp(0f, 15f, projectile.timeLeft, true)); + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; + Time++; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (Main.myPlayer != projectile.owner) + return; + + for (int i = 0; i < 3; i++) + { + Vector2 shootVelocity = projectile.velocity.RotatedBy(MathHelper.Lerp(-0.3f, 0.3f, i / 2f)) * 0.4f; + Projectile.NewProjectile(projectile.Center, shootVelocity, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner); + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D texture = Main.projectileTexture[projectile.type]; + Vector2 origin = texture.Size() * 0.5f; + Vector2 currentDirection = projectile.velocity.SafeNormalize(Vector2.Zero); + for (int i = 0; i < CurrentLaserLength; i++) + { + float scale = MathHelper.Lerp(1f, 0.2f, i / CurrentLaserLength) * projectile.scale; + Vector2 drawPosition = projectile.Center - currentDirection * i * 4f - Main.screenPosition; + Color drawColor = Color.Lerp(Color.Lime, Color.YellowGreen, (float)Math.Cos(i / CurrentLaserLength * 2.1f - Main.GlobalTime * 2.5f) * 0.5f + 0.5f); + drawColor = Color.Lerp(drawColor, Color.Yellow, 0.55f); + drawColor = Color.Lerp(drawColor, Color.White, (float)Math.Pow(i / CurrentLaserLength, 3D)); + drawColor.A = 0; + + spriteBatch.Draw(texture, drawPosition, null, drawColor, projectile.rotation, origin, scale, SpriteEffects.None, 0f); + } + return false; + } + } +} diff --git a/Projectiles/Ranged/PrismExplosionLarge.cs b/Projectiles/Ranged/PrismExplosionLarge.cs new file mode 100644 index 0000000000..6ed873f793 --- /dev/null +++ b/Projectiles/Ranged/PrismExplosionLarge.cs @@ -0,0 +1,60 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Ranged +{ + public class PrismExplosionLarge : ModProjectile + { + public override void SetStaticDefaults() => DisplayName.SetDefault("Explosion"); + + public override void SetDefaults() + { + projectile.width = projectile.height = 300; + projectile.friendly = true; + projectile.ignoreWater = false; + projectile.tileCollide = false; + projectile.ranged = true; + projectile.penetrate = -1; + projectile.timeLeft = 150; + projectile.extraUpdates = 2; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 11; + projectile.scale = 0.35f; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, Color.White.ToVector3() * 1.5f); + projectile.frameCounter++; + if (projectile.frameCounter % 8 == 7) + projectile.frame++; + + if (projectile.frame >= 18) + projectile.Kill(); + projectile.scale *= 1.0115f; + projectile.Opacity = Utils.InverseLerp(5f, 36f, projectile.timeLeft, true); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D texture = Main.projectileTexture[projectile.type]; + Texture2D lightTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/PhotovisceratorLight"); + Rectangle frame = texture.Frame(3, 6, projectile.frame / 6, projectile.frame % 6); + Vector2 drawPosition = projectile.Center - Main.screenPosition; + Vector2 origin = frame.Size() * 0.5f; + + for (int i = 0; i < 36; i++) + { + Vector2 lightDrawPosition = drawPosition + (MathHelper.TwoPi * i / 36f + Main.GlobalTime * 5f).ToRotationVector2() * projectile.scale * 20f; + Color lightBurstColor = CalamityUtils.MulticolorLerp(projectile.timeLeft / 144f, Items.CalamityGlobalItem.ExoPalette); + lightBurstColor = Color.Lerp(lightBurstColor, Color.White, 0.4f) * projectile.Opacity * 0.04f; + lightBurstColor.A = 0; + spriteBatch.Draw(lightTexture, lightDrawPosition, null, lightBurstColor, 0f, lightTexture.Size() * 0.5f, projectile.scale * 2.5f, SpriteEffects.None, 0f); + } + spriteBatch.Draw(texture, drawPosition, frame, Color.White, 0f, origin, 1f, SpriteEffects.None, 0f); + return false; + } + } +} diff --git a/Projectiles/Ranged/PrismExplosionLarge.png b/Projectiles/Ranged/PrismExplosionLarge.png new file mode 100644 index 0000000000000000000000000000000000000000..3bbf34853c652aedccf633385d382a44a2613f22 GIT binary patch literal 22972 zcmb@uc{r49_&hGYwseVMV2eJi`j zHuf!yeK#b8->shd{{DL3?|U4t<9PmP=AQeyuJgRE^ZZ<&^K(9!JKAdWXIRew06-5{ zSJndniY)-3-1v(c{G`442lx+w!c|Z0CV>CKwg>=R09^TozSrB8ai2&|8^85Er!Irk zi<+zt3|SutoEkml8!S!xv2pp9USMI2#$`x#@Q}t(qfepqKiEef5k&?xrC-*hN%{|Y zPFH;~{Pcv5kcjE_Ov{^`o?uU z75&halllCya-wzSyP|cI9dd_@>#j@`;0*uwe|L~({qz8!zlbwZ<;((yD*H&)}NO=R3OeIe#l$`tq{1PP6E0`uD6NvUsu~42;XjP);feji~LK3 zmz@#po=am-s->g_SiT51vkT`iihBFrjgrQ&0g;C0lX{a2%Z<3Wly$d=Ft2J2pc|3^ zOO}*=8PZCaX^>zj4z&w2LF|k4t!L`Cy;Wua0vlE)=qLc9_5h3{rsOVc)`Yl6|0VX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of(qI?kWeK-SzAbU||5Mn|Xxx0L11S2Bh@=m#V(dthccF_=MzZQHL8} zV-_ZkbCCd;I`5L{&2{08L4v`E49ttpL`BRn+nfaDFXi%(a9d{~$NbmJ_adD|n=+8AH5)IazNuiL)sJo)woe zC{TFiu|BBSu9l55s^XdiiCn70ko*}C!}DQF+%0zkMeaqC2O`gaGAHYOVxL2$u%3+D zboz2}95&pp80)548{Ng3e?A@lpqT+;2mX0dYe=;Xevk zrgR`~Kn8@lFCVM^dafwvN!^#ZrhPVTu6cs_?E$k<#1FehxkwFLh0}5pZmwt0g|wOTvBamoXwt&%FWtcCZe6!tbP8? zsV8{05&vz^r#jjLfscBG1pbtzCja{1Dzh>%cIleZsihP^x1_?!#cT_9j>(U0HJ zQ8`Jy=n=NH=DR{)QArt^ge9F+f989R*G_)qPV$%PO> z?yO_N@X_2h50BUW4Tl3zx=q{eQ-3{?(eoS5h1I)eL``~c;{WAWV+c|%NtZvbp-ohD zv#g?~Dm!qE_u-2ZeucWeR;BMK2k*lDLzR!Bf@W4wi0a?~ue>P%uh-=_riWCcA!e;A z{QkZ>p(r}Exv@Tl`E!n<{Or(EKJ`EI`sl|dgbIpamsA`_92dcD(hCyXd5uMus+`I? zJtZ&FG}6a!XJ^FXYq~cjjs}RD<8}E*->qs$Njb6>s%GoTn+HQ#YfW(QD7gzlGf3@C zmKX^wGl6S_Uzy>_PL$9q*XG^&n;nDCMzyb3O{mSfyF^?Yr@5MtYA!m)AhO`e`x2|2 zH@f5S#DR{kgB9NRqdiifqc*ouS$#Jv-I`gKzlE(8?Xo&)(o$cic5EA&i##?htG_@a zuD#uy-IifEV^s+WIs!_g?q@N4jDdbn)Jz|#DNSr6HMZ#O2MUc3PB;|}@f*^M!o= Main.projFrames[projectile.type]) + projectile.Kill(); + projectile.scale *= 1.0115f; + projectile.Opacity = Utils.InverseLerp(5f, 36f, projectile.timeLeft, true); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D texture = Main.projectileTexture[projectile.type]; + Texture2D lightTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/PhotovisceratorLight"); + Rectangle frame = texture.Frame(1, Main.projFrames[projectile.type], 0, projectile.frame); + Vector2 drawPosition = projectile.Center - Main.screenPosition; + Vector2 origin = frame.Size() * 0.5f; + + spriteBatch.Draw(texture, drawPosition, frame, Color.White, 0f, origin, 1f, SpriteEffects.None, 0f); + return false; + } + } +} diff --git a/Projectiles/Ranged/PrismExplosionSmall.png b/Projectiles/Ranged/PrismExplosionSmall.png new file mode 100644 index 0000000000000000000000000000000000000000..b4c5a29207c4300b8648fd20650f5c8af6a95cf4 GIT binary patch literal 2924 zcmbVOdpMM78y_9WI8=;dXr1D%S(1$$npO_O7=zbVW1VN1Rw?H~mSUZTNqARi%v5Gf z(&b#SAu|k{LS#4AgrPx1gUG1(-o3u-`{(ciQe4Y3>6F3HzUf$p|B+!cNz-|nHZ4Z1#iIvq3OES2{y?_ID1DU5Q^=8 zPpPi(JHZG9vd6{2?uR)4dBOaHkq0V{{rk=>Z{%tvqN(3Bxom;bGZY)9bNzR3Q!K3Z zGjc2VG|j9QqWA#S3&k-ec+zhlag3x+e7zx>{po~QoE{IJ=}h5gP+V@^ z`Mg&)%~}>%q~$yD(iIJ`(L1ocW(^SRuMHu-M=jX$AJ`E*Nt}qW?G}nuI`7=|A#39^ zNXu8Gk2m80L4THgYO76%#;L~`?oGR~(kR-9Nlhg2HAM9>d?26Aj8bV&4^hLvrH#~VKEkaT2k3a>P{qs5>O0K%$dn*iIhi~#&i2mBmyiYJ zb3<2K8$ibqkK8#0=D+5I947muUV;5af^n$Xv>1bxc>V*0bOIeD&p7|d`4rlTA{d~X z2hYwrO3t>}`W(Bia2>GThePI?uH@(V+_-!qsqe~GX?FQA+LOpgPAdSd%amSgi6+`q0EqR8m$d)!=z`1AkbY+h7R{g|-eOjjKS_UD*9+rP_ zCa+kR+_QdX9Wp0VdprO!6KL zHcI*<*X8c>+X}7`fpz1DI^rJ#i9D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818sZ{rN?D`{mVh6ToT?_X%=YEKjV9U-5wc1_YZLps^ay7DqA{t} ziv4Opr{$#bf_;*i$QN!mJLq*eXi#}`p846CK^>sXE3LihcIn*`Dq5ESrd#7U=|x12Kd#A3**7rtx`_g*yu0@csfuhl~i+CBjIrt=NkZ{ZAO&7bsOoC)Aqk*86KbIJ%PvzjjkjSRn*Q_Ye5t7rcL&bV^E~ c MinesToConnectTo = new List(); + public ref float Time => ref projectile.ai[0]; + public const float MineConnectDistanceMax = 850f; + public override void SetStaticDefaults() => DisplayName.SetDefault("Mine"); + + public override void SetDefaults() + { + projectile.width = projectile.height = 40; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.ranged = true; + projectile.penetrate = -1; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 7; + projectile.timeLeft = 280; + } + + public override void AI() + { + projectile.velocity *= 0.94f; + Lighting.AddLight(projectile.Center, Color.Cyan.ToVector3()); + + float idealScale = MathHelper.Lerp(0.93f, 1.07f, (float)Math.Sin(MathHelper.TwoPi * projectile.timeLeft / 14f) * 0.5f + 0.5f); + projectile.scale = MathHelper.Lerp(0.15f, idealScale, Utils.InverseLerp(0f, 15f, Time, true) * Utils.InverseLerp(0f, 15f, projectile.timeLeft, true)); + Time++; + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + foreach (Projectile mine in LocateOtherMines()) + { + if (projectile.timeLeft <= 12) + break; + + float _ = 0f; + if (Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), projectile.Center, mine.Center, 20f, ref _)) + return true; + } + return base.Colliding(projHitbox, targetHitbox); + } + + public List LocateOtherMines() + { + List mines = new List(); + for (int i = 0; i < Main.maxProjectiles; i++) + { + Projectile proj = Main.projectile[i]; + if (proj.type != projectile.type || !proj.active || proj.timeLeft <= 12 || i == projectile.whoAmI) + continue; + if (!projectile.WithinRange(proj.Center, MineConnectDistanceMax)) + continue; + + mines.Add(proj); + } + + return mines; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D baseTexture = Main.projectileTexture[projectile.type]; + Texture2D glowTexture = ModContent.GetTexture($"{Texture}Glowmask"); + Texture2D laserTexture = ModContent.GetTexture($"CalamityMod/Projectiles/Ranged/PrismMineArc"); + + void drawLineTo(Vector2 destination, Color laserColor) + { + float rotation = projectile.AngleTo(destination); + float remainingDistance = projectile.Distance(destination) - 30f; + float laserScale = 0.5f; + Rectangle frame = laserTexture.Frame(1, 7, 0, (int)(Main.GlobalTime * 17f + projectile.identity * 3f) % 7); + Vector2 laserOrigin = frame.Size() * 0.5f; + while (remainingDistance > frame.Height * laserScale) + { + Vector2 laserDrawPosition = projectile.Center + projectile.DirectionTo(destination) * remainingDistance - Main.screenPosition; + spriteBatch.Draw(laserTexture, laserDrawPosition, frame, laserColor, rotation, laserOrigin, laserScale, SpriteEffects.None, 0f); + remainingDistance -= frame.Height * laserScale; + } + } + + Vector2 origin = baseTexture.Size() * 0.5f; + Vector2 drawPosition = projectile.Center - Main.screenPosition; + + foreach (Projectile mine in LocateOtherMines()) + { + float fade = Utils.InverseLerp(8f, 24f, projectile.timeLeft, true) * Utils.InverseLerp(8f, 24f, mine.timeLeft, true); + drawLineTo(mine.Center, Color.White * fade); + } + + spriteBatch.Draw(baseTexture, drawPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, origin, projectile.scale, SpriteEffects.None, 0f); + + Rectangle glowFrame = glowTexture.Frame(1, 6, 0, (int)Time / 4 % 6); + Color glowColor = Color.White * 0.5f; + glowColor.A = 0; + spriteBatch.Draw(glowTexture, drawPosition, glowFrame, glowColor, projectile.rotation, origin, projectile.scale, SpriteEffects.None, 0f); + return false; + } + } +} \ No newline at end of file diff --git a/Projectiles/Ranged/PrismMine.png b/Projectiles/Ranged/PrismMine.png new file mode 100644 index 0000000000000000000000000000000000000000..f6e0b4a1e3ac41098c97c7f1a77d25df2e980bd1 GIT binary patch literal 514 zcmeAS@N?(olHy`uVBq!ia0vp^J|N7&3?x5zE|dgPjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCikV0(?STfwYo_fk$S6oPuIv|2$j2aAOPm;+pP&$n<3&GBZEi(OKs`5o5n0T@z;_UY z8Fx&~ehYM%zNd?0NQC>_X}8M`DG0cxE10;fe)j4A|ERupovq8Zh8%j-_*ZGB!EM(x zg^8-lzSI0BFTI@d(j?MqX{uD`^!))r%d*~8sOqS04r7W<@8OoXT)JbM*}Z!Udfq(d zDrHG_dpt$m>%^L+E8g!d=hJ$==Y2I-eN+~wWROdnE#^vy-psrIH#H|fJ|S6Q?*8mEGc3L~?oF+Ekipg$z+qF-6M9iY=IG1v zDHApZ?!1#|F<)Q&g~Y-8R}`g>XU=*amEy5WG=V2&^)u;BRpks~T_rg$E8Sl0y14x1 z+F<2ootE|P3X|md-9;YFSIi&xb*VZc>+7@v$@2a$FszROoeu2hIoAyII g3-D5hv%l{1UjzU1Po6GPgg&ebxsLQ03gTTDF6Tf literal 0 HcmV?d00001 diff --git a/Projectiles/Ranged/PrismMineArc.png b/Projectiles/Ranged/PrismMineArc.png new file mode 100644 index 0000000000000000000000000000000000000000..5fa9c7b1b437c0300b9a96fc8a175aef3f70bb63 GIT binary patch literal 542 zcmV+(0^$9MP)Px#3{Xr|MF0Q*Y4F?t00960|5l${000001awkPQvm<}|FbPXhyVZqut`KgRA_fZPwChQGRc5J?T6hmrF7FiBGs*u(^hL?V$$NMY^I0((+ehN@vmkeY!n)u|~0CYkw@{~F@cM-iwvNlx7B zJh?yi1(8Jv@%PbBy8r+H07*qoM6N<$f{5tw6951J literal 0 HcmV?d00001 diff --git a/Projectiles/Ranged/PrismMineGlowmask.png b/Projectiles/Ranged/PrismMineGlowmask.png new file mode 100644 index 0000000000000000000000000000000000000000..bec3e59194d0b98c04f3ddb3ac1be58d9e83961c GIT binary patch literal 2122 zcmZXVc~sKr9>#G`F--y|)UZNwmxi>}v~oj11p(3Pf_8tjNQ)La=BT;lmP;bY)zO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zZD7SG^?5H^$PHSanD4|83Pu=hU=|ExbKenORf%mkfR9HXtKDu%Us(JOm#WPjz_yv= zEcIiEp>=beF#|2n$5`3qt5t`ZA~l3PNW*GLH^2B4I*)>}J0R(arr)I2JGka)z1WIb zmUE|-sxLsn^5o-!2l@B`JkyI{n>;i}Ujpk3cSB);lI_*HjuuoxEV4v7O|W_=Q4E8Q zhKs}VkB-dX-uzdt8Vt9EmY-KE+*6Fvf9`%*roD5sO`!!`((_}_6cp-La^3H$&f5J> za$QJV)()89An^K;XE#l*1@yDL{No^t{XV-l*J$CJ==0@MPt*B__RW;?V=>cVp5=8W zVH}cg-OzK(01nkPXsO&(_DzP$lZ(Gm0zAv9U+KLO()f|#QIm@e+TkXeAjIwer>fVS z4p}d@{4yt*k|jXLe{ei9JoT|_OM5ilmyqF>xu=P)-8PfL3XABfFRiT1T640vi~mac zUUT*)BONDACRt^jgeyZ7bf+9etohtQm_cjW?G{XY(S6jOjJC0}#yI=fwtDHByrveZ zA*2*of~rOQU$)T?v@5=hxqScue2;wo0br?1c>oCoi(ilDRc$VfN-a;srScXER5R75 zpiOj-Ye`mUU7l4?!eJ?C*K6*|*{2kYtsEyM{YT?0oN{=|Xt(9F`elf@X)_;Dra&!nY7-r2Vg$KF=Wv5)U@$W5iY?d(!>)ZfQ}I*a zvFO_i0Q`zr^%Ox?)6R|btohW5WqnR|$weR-CX*atbt8er&ZIWcuj2q+n+(L=Ebz%N zth=y@4h{VWc2iX-Y`Qrx zpYX3orti;{DcVvIU%hL1&9Y-@>rIa$QTh9v^~xsN=ICa3G#q0z%=E`h!YAT@*ix^A zwzgXNR4~49^oDl` z3*&I projectile.ai[1] == 1f; + set => projectile.ai[1] = value.ToInt(); + } + public override string Texture => "CalamityMod/ExtraTextures/Lasers/PrismLaserStart"; + public override float MaxScale => 1f; + public override float MaxLaserLength => 2700f; + public override float Lifetime => 50f; + public override Color LaserOverlayColor => Color.White; + public override Color LightCastColor => LaserOverlayColor; + public override Texture2D LaserBeginTexture => ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/PrismLaserStart"); + public override Texture2D LaserMiddleTexture => ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/PrismLaserMid"); + public override Texture2D LaserEndTexture => ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/PrismLaserEnd"); + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Energy Blast"); + Main.projFrames[projectile.type] = 5; + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 24; + projectile.friendly = true; + projectile.ranged = true; + projectile.tileCollide = false; + projectile.penetrate = 100; + projectile.extraUpdates = 1; + projectile.timeLeft = 450; + } + + public override bool PreAI() + { + projectile.frameCounter++; + if (projectile.frameCounter % 5 == 4) + projectile.frame++; + + Vector2 laserEnd = projectile.position + projectile.velocity * LaserLength; + if (Collision.SolidCollision(laserEnd, 84, 84)) + CreateExplosion(laserEnd + projectile.Size * 0.5f); + return true; + } + + public void CreateExplosion(Vector2 laserEnd) + { + if (Main.myPlayer != projectile.owner || ExplodedYet || LaserLength <= 60f) + return; + + Projectile.NewProjectile(laserEnd, Vector2.Zero, ModContent.ProjectileType(), projectile.damage, 0f, projectile.owner); + + if (!ExplodedYet) + { + ExplodedYet = true; + projectile.netUpdate = true; + } + } + + public override float DetermineLaserLength() + { + if (projectile.penetrate == 100) + return DetermineLaserLength_CollideWithTiles(8); + return LaserLength; + } + + public override bool CanDamage() => projectile.penetrate == 100; + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + LaserLength = projectile.Distance(target.Center); + CreateExplosion(target.Center); + } + + public override void Kill(int timeLeft) + { + Vector2 laserEnd = projectile.Center + projectile.velocity * LaserLength; + CreateExplosion(laserEnd); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + // Start texture drawing. + Rectangle beginFrame = LaserBeginTexture.Frame(1, Main.projFrames[projectile.type], 0, projectile.frame); + spriteBatch.Draw(LaserBeginTexture, + projectile.Center - Main.screenPosition, + beginFrame, + Color.White, + projectile.rotation, + beginFrame.Size() / 2f, + projectile.scale, + SpriteEffects.None, + 0f); + + // Prepare things for body drawing. + float laserBodyLength = LaserLength; + laserBodyLength -= (LaserBeginTexture.Height * 0.5f + LaserEndTexture.Height) * projectile.scale / Main.projFrames[projectile.type]; + Vector2 centerOnLaser = projectile.Center; + + // Body drawing. + Rectangle middleFrame = LaserMiddleTexture.Frame(1, Main.projFrames[projectile.type], 0, projectile.frame); + if (laserBodyLength > 30f) + { + float laserOffset = (LaserMiddleTexture.Height - 10f) * projectile.scale / Main.projFrames[projectile.type]; + float incrementalBodyLength = 0f; + while (incrementalBodyLength + 1f < laserBodyLength) + { + spriteBatch.Draw(LaserMiddleTexture, + centerOnLaser - Main.screenPosition, + middleFrame, + Color.White, + projectile.rotation, + middleFrame.Width * 0.5f * Vector2.UnitX, + projectile.scale, + SpriteEffects.None, + 0f); + incrementalBodyLength += laserOffset; + centerOnLaser += projectile.velocity * laserOffset; + } + } + + // End texture drawing. + Rectangle endFrame = LaserEndTexture.Frame(1, Main.projFrames[projectile.type], 0, projectile.frame); + Vector2 laserEndCenter = centerOnLaser - Main.screenPosition; + spriteBatch.Draw(LaserEndTexture, + laserEndCenter, + endFrame, + Color.White, + projectile.rotation, + endFrame.Size() * new Vector2(0.5f, 0f), + projectile.scale, + SpriteEffects.None, + 0f); + return false; + } + } +} diff --git a/Projectiles/Ranged/PrismaticEnergyBlast.png b/Projectiles/Ranged/PrismaticEnergyBlast.png new file mode 100644 index 0000000000000000000000000000000000000000..8e2d2a871cdedc2f8035aec442b4c527a2bf3160 GIT binary patch literal 2903 zcmV-d3#jyoP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D3hYTlK~#8N?VRg# z6Ui0Dv1}RH^80Pfn}w}p$tGU|e95NB9~~;2$_7#uDx0d^u=&6e9)5r=Sue{ESuf}O z?(`LsY%^XKQnlGRra3b`Gq-Q|J-Xe~G7Oyi-=U|i0U;co2}eRWbo8Hp6r=(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-VQwjdNRDW$dy{rk!G`Sft%bxx9@ZUw!r0zu?!##`*?+ zD)+p`Z`M8Z12xevj_D`Bu3+{ZiGpHa(d>iOX}M$SVitpw-!MyXB2H3}!>+l4SO>w$ zZ@DJuL9Bv&*72OAbx!h|_6gqNT?%saD5*auxso(1CI8yz=ZLc?$kC%D&q=N%=WOyX z4u4+wAqsMws3d2;?}mNltsG^u6#GRmzxxO$|LXbw1n;9DN6)japm*dbTR-_a%Fl~KZ-_0w=#PVpVU53QJf zBnpbb$5c>1dfJLpPCvSo;`k_v=|`fVcjDZ+{{kvxraID#`U(I5002ovPDHLkV1ke6 Bu4(`P literal 0 HcmV?d00001 From 2db8878782b023629402a6ba0c84f654ac649033 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Thu, 18 Mar 2021 21:10:10 -0500 Subject: [PATCH 061/202] Renamed Prism Javelin to Atom Splitter --- .../Rogue/{PrismJavelin.cs => TheAtomSplitter.cs} | 6 +++--- .../{PrismJavelin.png => TheAtomSplitter.png} | Bin ...linDuplicate.cs => TheAtomSplitterDuplicate.cs} | 4 ++-- ...nDuplicate.png => TheAtomSplitterDuplicate.png} | Bin ...nProjectile.cs => TheAtomSplitterProjectile.cs} | 13 +++++-------- 5 files changed, 10 insertions(+), 13 deletions(-) rename Items/Weapons/Rogue/{PrismJavelin.cs => TheAtomSplitter.cs} (89%) rename Items/Weapons/Rogue/{PrismJavelin.png => TheAtomSplitter.png} (100%) rename Projectiles/Rogue/{PrismJavelinDuplicate.cs => TheAtomSplitterDuplicate.cs} (94%) rename Projectiles/Rogue/{PrismJavelinDuplicate.png => TheAtomSplitterDuplicate.png} (100%) rename Projectiles/Rogue/{PrismJavelinProjectile.cs => TheAtomSplitterProjectile.cs} (94%) diff --git a/Items/Weapons/Rogue/PrismJavelin.cs b/Items/Weapons/Rogue/TheAtomSplitter.cs similarity index 89% rename from Items/Weapons/Rogue/PrismJavelin.cs rename to Items/Weapons/Rogue/TheAtomSplitter.cs index efad05b766..e9cd46167f 100644 --- a/Items/Weapons/Rogue/PrismJavelin.cs +++ b/Items/Weapons/Rogue/TheAtomSplitter.cs @@ -6,11 +6,11 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Rogue { - public class PrismJavelin : RogueWeapon + public class TheAtomSplitter : RogueWeapon { public override void SetStaticDefaults() { - DisplayName.SetDefault("Prism Javelin"); + DisplayName.SetDefault("The Atom Splitter"); Tooltip.SetDefault("Fires a javelin that releases energy duplicates at enemies it hits\n" + "Stealth strikes release duplicates much more quickly"); } @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.Calamity().rogue = true; item.autoReuse = true; item.shootSpeed = 24f; - item.shoot = ModContent.ProjectileType(); + item.shoot = ModContent.ProjectileType(); item.useStyle = ItemUseStyleID.SwingThrow; item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Rogue/PrismJavelin.png b/Items/Weapons/Rogue/TheAtomSplitter.png similarity index 100% rename from Items/Weapons/Rogue/PrismJavelin.png rename to Items/Weapons/Rogue/TheAtomSplitter.png diff --git a/Projectiles/Rogue/PrismJavelinDuplicate.cs b/Projectiles/Rogue/TheAtomSplitterDuplicate.cs similarity index 94% rename from Projectiles/Rogue/PrismJavelinDuplicate.cs rename to Projectiles/Rogue/TheAtomSplitterDuplicate.cs index 32f430a60a..7e10e32704 100644 --- a/Projectiles/Rogue/PrismJavelinDuplicate.cs +++ b/Projectiles/Rogue/TheAtomSplitterDuplicate.cs @@ -7,13 +7,13 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class PrismJavelinDuplicate : ModProjectile + public class TheAtomSplitterDuplicate : ModProjectile { public ref float Time => ref projectile.ai[0]; public ref float Lifetime => ref projectile.ai[1]; public override void SetStaticDefaults() { - DisplayName.SetDefault("Prism Javelin"); + DisplayName.SetDefault("Atom Splitter"); ProjectileID.Sets.TrailCacheLength[projectile.type] = 6; ProjectileID.Sets.TrailingMode[projectile.type] = 2; } diff --git a/Projectiles/Rogue/PrismJavelinDuplicate.png b/Projectiles/Rogue/TheAtomSplitterDuplicate.png similarity index 100% rename from Projectiles/Rogue/PrismJavelinDuplicate.png rename to Projectiles/Rogue/TheAtomSplitterDuplicate.png diff --git a/Projectiles/Rogue/PrismJavelinProjectile.cs b/Projectiles/Rogue/TheAtomSplitterProjectile.cs similarity index 94% rename from Projectiles/Rogue/PrismJavelinProjectile.cs rename to Projectiles/Rogue/TheAtomSplitterProjectile.cs index f4c133a79e..61c475bdf3 100644 --- a/Projectiles/Rogue/PrismJavelinProjectile.cs +++ b/Projectiles/Rogue/TheAtomSplitterProjectile.cs @@ -9,14 +9,14 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class PrismJavelinProjectile : ModProjectile + public class TheAtomSplitterProjectile : ModProjectile { - public int Time; public ref float HitTargetIndex => ref projectile.ai[0]; + public ref float Time => ref projectile.ai[1]; public override string Texture => "CalamityMod/Items/Weapons/Rogue/PrismJavelin"; - public override void SetStaticDefaults() => DisplayName.SetDefault("Prism Javelin"); + public override void SetStaticDefaults() => DisplayName.SetDefault("Atom Splitter"); public override void SetDefaults() { @@ -32,8 +32,6 @@ namespace CalamityMod.Projectiles.Rogue public override void SendExtraAI(BinaryWriter writer) { - writer.Write(Time); - // timeLeft is not synced by default. However, it is changed during an operation that is only // performed from one client's perspective, therefore it must be synced in this context. writer.Write(projectile.timeLeft); @@ -43,7 +41,6 @@ namespace CalamityMod.Projectiles.Rogue public override void ReceiveExtraAI(BinaryReader reader) { - Time = reader.ReadInt32(); projectile.timeLeft = reader.ReadInt32(); projectile.alpha = reader.ReadByte(); projectile.scale = reader.ReadSingle(); @@ -109,7 +106,7 @@ namespace CalamityMod.Projectiles.Rogue Vector2 spawnPosition = target.Center + Main.rand.NextVector2CircularEdge(baseOutwardness, baseOutwardness) * Main.rand.NextFloat(0.9f, 1.15f); Vector2 shootVelocity = (target.Center - spawnPosition).SafeNormalize(Vector2.UnitY) * Main.rand.NextFloat(12f, 14f); - Projectile.NewProjectile(spawnPosition, shootVelocity, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, baseOutwardness / 9f); + Projectile.NewProjectile(spawnPosition, shootVelocity, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, baseOutwardness / 9f); } public void FireExtraDuplicatesAtTarget(NPC target) @@ -121,7 +118,7 @@ namespace CalamityMod.Projectiles.Rogue spawnPosition.X += Main.rand.NextFloatDirection() * target.width * 0.45f; Vector2 shootVelocity = Vector2.UnitY * (target.Center.Y - spawnPosition.Y > 0f).ToDirectionInt() * Main.rand.NextFloat(14f, 16.5f); - Projectile.NewProjectile(spawnPosition, shootVelocity, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 24f); + Projectile.NewProjectile(spawnPosition, shootVelocity, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 24f); } public void ReleaseHitDust(Vector2 spawnPosition) From 97aa0afddd37dbed1aeb505a7a38f51a71cbf9ae Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Thu, 18 Mar 2021 22:44:43 -0500 Subject: [PATCH 062/202] Made Surge Driver use 2 mode sprites --- Items/Weapons/Ranged/SurgeDriver.cs | 27 +++-- Items/Weapons/Ranged/SurgeDriver.png | Bin 2321 -> 1071 bytes Projectiles/Ranged/PrismaticEnergyBlast.cs | 2 +- Projectiles/Ranged/SurgeDriverHoldout.cs | 100 ++++++++++++++++++ Projectiles/Ranged/SurgeDriverHoldout.png | Bin 0 -> 1011 bytes .../Rogue/TheAtomSplitterProjectile.cs | 2 +- 6 files changed, 120 insertions(+), 11 deletions(-) create mode 100644 Projectiles/Ranged/SurgeDriverHoldout.cs create mode 100644 Projectiles/Ranged/SurgeDriverHoldout.png diff --git a/Items/Weapons/Ranged/SurgeDriver.cs b/Items/Weapons/Ranged/SurgeDriver.cs index b5f285e84d..6ce1f01aa4 100644 --- a/Items/Weapons/Ranged/SurgeDriver.cs +++ b/Items/Weapons/Ranged/SurgeDriver.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 1200; + item.damage = 800; item.ranged = true; item.width = 164; item.height = 58; @@ -34,25 +34,38 @@ namespace CalamityMod.Items.Weapons.Ranged item.useAmmo = AmmoID.Bullet; } - public override Vector2? HoldoutOffset() => Vector2.UnitX * -50f; + public override Vector2? HoldoutOffset() => new Vector2(-50f, -8f); public override bool AltFunctionUse(Player player) => true; public override bool CanUseItem(Player player) { if (player.altFunctionUse == 2) + { + item.noUseGraphic = false; + item.reuseDelay = 0; item.UseSound = SoundID.Item14; + item.channel = false; + } else + { + item.noUseGraphic = true; + item.reuseDelay = 28; item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LaserCannon"); + item.channel = true; + return player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0; + } return base.CanUseItem(player); } + public override float UseTimeMultiplier(Player player) => player.altFunctionUse == 2 ? 5f : 1f; public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Vector2 shootVelocity = new Vector2(speedX, speedY); Vector2 shootDirection = shootVelocity.SafeNormalize(Vector2.UnitX * player.direction); - Vector2 gunTip = position + shootDirection * item.scale * 132f; + Vector2 gunTip = position + shootDirection * item.scale * 126f; + gunTip.Y -= 6f; // Large bullet/rocket releasing. if (player.altFunctionUse == 2) @@ -65,13 +78,9 @@ namespace CalamityMod.Items.Weapons.Ranged } } - // Snipe blast. + // Snipe blast. Done via a held projectile. else - { - shootVelocity *= 0.64f; - damage = (int)(damage * 6.66); - Projectile.NewProjectile(gunTip, shootVelocity, ModContent.ProjectileType(), damage, knockBack, player.whoAmI); - } + Projectile.NewProjectile(gunTip, shootVelocity, ModContent.ProjectileType(), 0, knockBack, player.whoAmI); return false; } } diff --git a/Items/Weapons/Ranged/SurgeDriver.png b/Items/Weap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W$Ww`7dC~k-6^iD6j!}zl~FT!nwje& z*Q@>`;YAU34s3oQ+iVbFuuA5$h$^TDuO}=yuz97BiOP^WFGa|vnEe&;HUoB+#FXg zJ8kb;W1C}AD!SdGpn@oA!ipBZD`_*lh1oYxhyYr??ueBScLsQ&1ceNEg|(Nhx#FsM z5kPl`S#?b2WQcc=-j+)VUHN+&mlqXgEPn)mQH^G`A6NdO&4UVhu8^zTMzOt48*<%} z!LMV^8@g8xIR{w&nZT=B{XLSx&mV&`}8;Gqx$YE2CTH?({B=U#CQ% z7i^5T$L1k@BPe9RD@qwN%d3onEz;1~&;Y)I60;tGFAda<}m2CC6rq1`&o>HHuPz9VeV^#z((BBW_yn1D2m3gf)ueZ-KPpGfj z`xCwYE%lXAc6+ScH_xaE3K{T57c*h z&p+-3;Lhzv5o}pNI^$eC;UMLU0Ir_55P-eSO^FKR@{WZnV4?W3(nPrl3K{Tt#3FLfXd2oF?AkYF*@-$QAU|3Ec1iMUs@gWoGwJk_Uw-TTZ3&5(B9@Id8?ly zvGduK(6-|3(L=3in(O3zQ@*qWg$#H_$sW>1p5AHVIqN5xRnjV}s$%uF?r#C0cgwXv zP9e4Dbm7WloHEt?Pt38l!>+1g=ey9>XB=sQLI%8|?EelmW7cc{4z;!v^e+yBdW{*# z&FT0Y)7zHFgsj4~ezQ?B`M1}X)_nrNTkD Main.player[projectile.owner]; + public bool OwnerCanShoot => Owner.channel && Owner.HasAmmo(Owner.ActiveItem(), true) && !Owner.noItems && !Owner.CCed; + public ref float ShootCountdown => ref projectile.ai[0]; + public override void SetStaticDefaults() => DisplayName.SetDefault("Storm Driver"); + + public override void SetDefaults() + { + projectile.width = 192; + projectile.height = 52; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.ranged = true; + projectile.ignoreWater = true; + } + + public override void AI() + { + if (!OwnerCanShoot) + projectile.Kill(); + + Vector2 armPosition = Owner.RotatedRelativePoint(Owner.MountedCenter, true); + armPosition += projectile.velocity.SafeNormalize(Owner.direction * Vector2.UnitX) * 32f; + armPosition.Y -= 12f; + + UpdateProjectileHeldVariables(armPosition); + ManipulatePlayerVariables(); + + ShootCountdown--; + if (ShootCountdown <= 0f) + { + if (Main.myPlayer == projectile.owner) + { + ShootProjectiles(armPosition); + ShootCountdown = 28f; + projectile.netUpdate = true; + } + + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LaserCannon"), projectile.Center); + } + } + + public void ShootProjectiles(Vector2 armPosition) + { + if (Main.myPlayer != projectile.owner) + return; + + Item heldItem = Owner.ActiveItem(); + int projectileType = ModContent.ProjectileType(); + float shootSpeed = heldItem.shootSpeed * projectile.scale * 0.64f; + int damage = (int)(Owner.GetWeaponDamage(heldItem) * 6.66); + float knockback = heldItem.knockBack; + + bool uselessFuckYou = OwnerCanShoot; + Owner.PickAmmo(heldItem, ref projectileType, ref shootSpeed, ref uselessFuckYou, ref damage, ref knockback, false); + projectileType = ModContent.ProjectileType(); + + knockback = Owner.GetWeaponKnockback(heldItem, knockback); + Vector2 shootDirection = (Main.MouseWorld - projectile.Center).SafeNormalize(-Vector2.UnitY); + Vector2 shootVelocity = shootDirection * shootSpeed; + + // Sync if the shoot direction changes. + if (shootDirection.X != projectile.velocity.X || shootDirection.Y != projectile.velocity.Y) + projectile.netUpdate = true; + + Vector2 gunTip = armPosition + shootDirection * heldItem.scale * 130f; + Projectile.NewProjectile(gunTip, shootVelocity, projectileType, damage, knockback, projectile.owner, 0f, 0f); + + projectile.velocity = shootDirection; + } + + public void UpdateProjectileHeldVariables(Vector2 armPosition) + { + projectile.position = armPosition - projectile.Size * 0.5f; + projectile.rotation = projectile.velocity.ToRotation(); + if (projectile.spriteDirection == -1) + projectile.rotation += MathHelper.Pi; + projectile.spriteDirection = projectile.direction; + projectile.timeLeft = 2; + } + + public void ManipulatePlayerVariables() + { + Owner.ChangeDir(projectile.direction); + Owner.heldProj = projectile.whoAmI; + Owner.itemTime = 2; + Owner.itemAnimation = 2; + Owner.itemRotation = (projectile.velocity * projectile.direction).ToRotation(); + } + } +} diff --git a/Projectiles/Ranged/SurgeDriverHoldout.png b/Projectiles/Ranged/SurgeDriverHoldout.png new file mode 100644 index 0000000000000000000000000000000000000000..1d943243d5d77f6caa7c3152aae4c58661a4e176 GIT binary patch literal 1011 zcmVjB3)00001b5ch_0Itp) z=>Px#1ZP1_K>z@;j|==^1poj5KTu3mMF0Q*rtoRhbva{a7o8LJ^%m!dU34(0000LbW%=J|NsC0 z|NsC0|NsC0|NsC0|NsC004v#j>Hq)$32;bRa{vGi!vFvd!vV){sAK>D0~|?2K~!i% z?V0O(;xG(ElNu;(X-c=e|Ff=-M#2sWlm9vvB-4YGDC~pLQ0sT?o%9UVct_0;*kubv|2r9mdkYp8;}xK zf|Oof<_)Y?VcJs{q7?(~hGPMCuWhpXnKDxnT*b@h6kDt(0f z?I7;^cm)XyWfm)uJ7xe49#%xQB?GZwyeg0hfl))g>Y&V+@vB9R>Y6VDhnTVhLV@By zs_l692Ef*L^pz^d5GE6qZHHm87#tZeH|vyW&F3tV%m~J*=cUQVP*5$}P*;EK8B^}u zp#cIF0Pvxd>q%2EK=#HM$r_3pGWyq_|rHHC8t~k%=A)A($n@fDNc- z!S)2j0COcGD)TTx)`BL;+L_DCSoYdNOa`mzK?u#Bk{8b5|Vo;I1@IL`!Y9g2q*49pXv zB=GZ7x2^4#2M^J_0li+));9(uDzZU#0{t?Ge8V$fu7`VCHBcl;;MW%$l`j!Ydxn_N zn#U`lsuEfYx1}9wKM{Y7)(s$Vxzu)HfY|ixk%^cIaRRBQ%5`Yh0MeuNq#5AfcrwEy zi+U|zgr)0B7wsAlx+FbmC(>pU25NkOGtFF&Rt*HEt}@W~{ABCho1k?AWArn*cW#77 hGjMD2@7};}_Zv63xy(nu*9HIp002ovPDHLkV1g|0$;1Ev literal 0 HcmV?d00001 diff --git a/Projectiles/Rogue/TheAtomSplitterProjectile.cs b/Projectiles/Rogue/TheAtomSplitterProjectile.cs index 61c475bdf3..abc384ed25 100644 --- a/Projectiles/Rogue/TheAtomSplitterProjectile.cs +++ b/Projectiles/Rogue/TheAtomSplitterProjectile.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Rogue public ref float HitTargetIndex => ref projectile.ai[0]; public ref float Time => ref projectile.ai[1]; - public override string Texture => "CalamityMod/Items/Weapons/Rogue/PrismJavelin"; + public override string Texture => "CalamityMod/Items/Weapons/Rogue/TheAtomSplitter"; public override void SetStaticDefaults() => DisplayName.SetDefault("Atom Splitter"); From f42f0e5286868b25dd68d903e3051399cc4e55d4 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sun, 21 Mar 2021 20:56:27 -0500 Subject: [PATCH 063/202] Start of SCal book --- Items/Weapons/Magic/SCalBook.cs | 43 ++++++++++ Items/Weapons/Magic/SCalBook.png | Bin 0 -> 3740 bytes Projectiles/Magic/RedirectingFire.cs | 99 +++++++++++++++++++++ Projectiles/Magic/RedirectingSoul.cs | 111 ++++++++++++++++++++++++ Projectiles/Magic/RedirectingSoul.png | Bin 0 -> 497 bytes Projectiles/Magic/SCalBookProj.cs | 118 ++++++++++++++++++++++++++ Projectiles/Magic/SCalBookProj.png | Bin 0 -> 1054 bytes 7 files changed, 371 insertions(+) create mode 100644 Items/Weapons/Magic/SCalBook.cs create mode 100644 Items/Weapons/Magic/SCalBook.png create mode 100644 Projectiles/Magic/RedirectingFire.cs create mode 100644 Projectiles/Magic/RedirectingSoul.cs create mode 100644 Projectiles/Magic/RedirectingSoul.png create mode 100644 Projectiles/Magic/SCalBookProj.cs create mode 100644 Projectiles/Magic/SCalBookProj.png diff --git a/Items/Weapons/Magic/SCalBook.cs b/Items/Weapons/Magic/SCalBook.cs new file mode 100644 index 0000000000..8ef6d64c2f --- /dev/null +++ b/Items/Weapons/Magic/SCalBook.cs @@ -0,0 +1,43 @@ +using CalamityMod.Projectiles.Magic; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Magic +{ + public class SCalBook : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Some Edgy Word idk"); + Tooltip.SetDefault("yes"); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 6)); + } + + public override void SetDefaults() + { + item.damage = 2444; + item.magic = true; + item.mana = 30; + item.width = 38; + item.height = 40; + item.useTime = item.useAnimation = 120; + item.useStyle = ItemUseStyleID.HoldingOut; + item.noMelee = true; + item.UseSound = SoundID.DD2_EtherianPortalDryadTouch; + item.knockBack = 0f; + + item.value = CalamityGlobalItem.Rarity15BuyPrice; + item.Calamity().customRarity = CalamityRarity.Violet; + + item.autoReuse = true; + item.noUseGraphic = true; + item.shoot = ModContent.ProjectileType(); + item.channel = true; + item.shootSpeed = 0f; + } + + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; + } +} \ No newline at end of file diff --git a/Items/Weapons/Magic/SCalBook.png b/Items/Weapons/Magic/SCalBook.png new file mode 100644 index 0000000000000000000000000000000000000000..4c8e3e4f8b1f81d68a96ec9e8274de7bad93dd3e GIT binary patch literal 3740 zcmV;N4rB3&P)Px@R!KxbRCt{2oo$R2)fvbC!`rfVSCBnZg)Gn}t*M5l_Cw2Sm6srjs0FVgy9tsNSOu0BSGfIf=0A7O zGjr~ld+#oE=AQqT*_k_cX7>3%=giCb-DdzNr^=RR`XH0J3;=NR#0CJs+aI*$qSm`+ zOuYvHA02AfmY+U-vWE__u=-q-z4W524gkmjz^Y%)k6dr@lj{p^v$vf{yaWB@0!IFt zG4%k#xlN6qb~^xI;~Q!^YxaHoCbd`$Vd|pl?#{kye+7>!0rEzTQvGyYU0tLDR5trDfc&)%C3_b-uw~C@0D$RD zBMKe>9buc2xzEUFGyMSoFLa&v0N{~N4yyeX+@oJpx?o*_&VnSz)$43T=Xjd!0Ovx0|3lesdB${u)0>;aP$@r0KR?X zkJ|SV??Aum>VX~rWV0V@PDs76Z7%>|_VgP8*xQPX_}%mM+#fPzh&DfG!W963k>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b5vtvg)?(y*O`+Q|77ly`;u@89I-J+UWtyR`u`-kXuu6SVwjoJ+ zNu{5eE0)-zBtIkxF6KTXFTZEoe&sN8lqvU3q?M!=xc$D&T@yRU+&8@~ z(ZPwzSLffl&X3i#CZAB@`4Vlg(j+rAfC$DLW z{e=d_-bb<&j+qk*or$vs2IBFRs>+$^cVe>l;WbR~22sE2*{%l^Gnc!dKcsNXoQ;`d zow>(XDsn3BFZOsIam<`SB{Orf@?USgo7L5sb9Lr=S+So^-&K@oAD>I_>Z(d8VVto2Fr{d$iwb%}St$;rvdsj?OO zp4diS-8N&22LPM5?gr5N?=0>FW=21Yix0}Qc6}& zNG~%Nk^9<;Eq;Wr_2(IRI!frS+32q4Vh}Pq@S6iWbRY4*I?v> zT#oqy2S#3s+uyQB^*(g&w=HRB=4`nyC3}y2M5l#UE+E+!wyY|g`{`xo_($B_r-FVv zy8AZvK2o;aPd_uqUrdnOw~3J_4@64k!UbsaQnL4vM6Yzr#LPW-mEwl7J~xzn2l&f~ zapTl4CYXDH{P|a2ToSnfMn10C7U(3eaZI_-UMJv&j``eBR&hhgcOY(^IWlb~C&-7& zT&83%#N20fG)CUU%$c~M|C+*O655q6`P$Km{t24v`fubwW{gh|L6x) zY0O;db>@5p)M4I ref projectile.ai[0]; + public ref float Time => ref projectile.ai[1]; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public override void SetStaticDefaults() => DisplayName.SetDefault("Fire"); + + public override void SetDefaults() + { + projectile.width = projectile.height = 18; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.tileCollide = false; + projectile.magic = true; + projectile.ignoreWater = true; + } + + public override void AI() + { + if (Time >= 18f) + { + NPC potentialTarget = projectile.Center.ClosestNPCAt(1100f, false); + if (potentialTarget != null) + HomeInOnTarget(potentialTarget); + + float accelerationFactor = MathHelper.SmoothStep(1.025f, 1.015f, Utils.InverseLerp(6f, 24f, projectile.velocity.Length(), true)); + if (projectile.velocity.Length() < 24f) + projectile.velocity *= accelerationFactor; + } + EmitDust(); + Time++; + } + + public void HomeInOnTarget(NPC target) + { + float oldSpeed = projectile.velocity.Length(); + float delayFactor = Utils.InverseLerp(20f, 35f, Time, true); + float homeSpeed = MathHelper.Lerp(0f, 0.075f, delayFactor); + + projectile.velocity = Vector2.Lerp(projectile.velocity, projectile.DirectionTo(target.Center) * 16f, homeSpeed); + projectile.velocity = projectile.velocity.SafeNormalize(Vector2.UnitY) * oldSpeed; + projectile.position += (target.Center - projectile.Center).SafeNormalize(Vector2.Zero) * MathHelper.Lerp(25f, 1f, Utils.InverseLerp(100f, 360f, projectile.Distance(target.Center), true)) * delayFactor; + } + + public Dust CreateDustInstance() + { + int dustType = 264; + + Color brimstoneColor = Color.Lerp(Color.Red, Color.DarkViolet, (float)Math.Sin(projectile.identity * 3f + Time / 12f) * 0.7f + 0.3f); + Color dustColor = Color.Lerp(Color.Orange, Color.Yellow, Main.rand.NextFloat()); + dustColor = Color.Lerp(dustColor, brimstoneColor, (float)Math.Pow(BurstIntensity, 2D)); + + Dust dust = Dust.NewDustPerfect(projectile.Center, dustType); + dust.color = dustColor; + dust.noGravity = true; + dust.noLight = true; + return dust; + } + + public void EmitDust() + { + if (Main.dedServ) + return; + + for (int i = 0; i < 5; i++) + { + Dust dust = CreateDustInstance(); + dust.velocity = (MathHelper.TwoPi * i / 5f).ToRotationVector2(); + dust.position += projectile.velocity; + dust.scale = MathHelper.Lerp(1f, 1.5f, BurstIntensity) * Main.rand.NextFloat(0.7f, 1.3f); + } + } + + public override void Kill(int timeLeft) + { + if (Main.dedServ) + return; + + for (int i = 0; i < 15; i++) + { + Dust ectoplasm = Dust.NewDustPerfect(projectile.Center + Main.rand.NextVector2Circular(30f, 30f) * BurstIntensity, 264); + ectoplasm.velocity = Main.rand.NextVector2Circular(2f, 2f); + ectoplasm.color = Color.Lerp(Color.Orange, Color.Yellow, Main.rand.NextFloat(0.67f)); + ectoplasm.scale = MathHelper.Lerp(1f, 1.6f, BurstIntensity); + ectoplasm.noGravity = true; + ectoplasm.noLight = true; + } + } + } +} diff --git a/Projectiles/Magic/RedirectingSoul.cs b/Projectiles/Magic/RedirectingSoul.cs new file mode 100644 index 0000000000..ada9d3e9f3 --- /dev/null +++ b/Projectiles/Magic/RedirectingSoul.cs @@ -0,0 +1,111 @@ +using CalamityMod.DataStructures; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using System.Collections.Generic; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Magic +{ + public class RedirectingSoul : ModProjectile + { + public ref float BurstIntensity => ref projectile.ai[0]; + public ref float Time => ref projectile.ai[1]; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Soul"); + Main.projFrames[projectile.type] = 3; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 10; + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 18; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.tileCollide = false; + projectile.magic = true; + projectile.ignoreWater = true; + } + + public override void AI() + { + if (Time >= 20f) + { + NPC potentialTarget = projectile.Center.ClosestNPCAt(1250f, false); + if (potentialTarget != null) + HomeInOnTarget(potentialTarget); + + float accelerationFactor = MathHelper.SmoothStep(1.03f, 1.015f, Utils.InverseLerp(6f, 24f, projectile.velocity.Length(), true)); + if (projectile.velocity.Length() < 21f) + projectile.velocity *= accelerationFactor; + } + projectile.frameCounter++; + if (projectile.frameCounter % 4f == 3f) + projectile.frame = (projectile.frame + 1) % Main.projFrames[projectile.type]; + projectile.rotation = projectile.velocity.ToRotation() - MathHelper.PiOver2; + Time++; + } + + public void HomeInOnTarget(NPC target) + { + float oldSpeed = projectile.velocity.Length(); + float delayFactor = Utils.InverseLerp(20f, 35f, Time, true); + float homeSpeed = MathHelper.Lerp(0f, 0.075f, delayFactor); + + projectile.velocity = Vector2.Lerp(projectile.velocity, projectile.DirectionTo(target.Center) * 16f, homeSpeed); + projectile.velocity = projectile.velocity.SafeNormalize(Vector2.UnitY) * oldSpeed; + projectile.position += (target.Center - projectile.Center).SafeNormalize(Vector2.Zero) * MathHelper.Lerp(25f, 1f, Utils.InverseLerp(100f, 360f, projectile.Distance(target.Center), true)) * delayFactor; + } + + public override Color? GetAlpha(Color lightColor) + { + Color baseColor = Color.Lerp(Color.IndianRed, Color.DarkViolet, projectile.identity % 5f / 5f); + Color color = Color.Lerp(baseColor, Color.Black, BurstIntensity * 0.5f + (float)Math.Cos(Main.GlobalTime * 2.7f) * 0.04f); + color.A = 0; + return color * projectile.Opacity; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D texture = Main.projectileTexture[projectile.type]; + Rectangle frame = texture.Frame(1, Main.projFrames[projectile.type], 0, projectile.frame); + for (int i = 0; i < 4; i++) + { + for (int j = 0; j < projectile.oldPos.Length; j++) + { + Color drawColor = projectile.GetAlpha(lightColor) * ((projectile.oldPos.Length - j) / (float)projectile.oldPos.Length); + Vector2 drawPosition = projectile.oldPos[j] + projectile.Size * 0.5f + (MathHelper.TwoPi * i / 4f).ToRotationVector2() * 3.5f - Main.screenPosition; + float rotation = projectile.oldRot[j]; + + spriteBatch.Draw(texture, drawPosition, frame, drawColor, rotation, frame.Size() * 0.5f, projectile.scale, SpriteEffects.None, 0f); + } + } + + return false; + } + + public override void Kill(int timeLeft) + { + // Play a wraith death sound at max intensity and a dungeon spirit hit sound otherwise. + Main.PlaySound(BurstIntensity >= 1f ? SoundID.NPCDeath52 : SoundID.NPCHit35, projectile.Center); + + // Make a ghost sound and explode into ectoplasmic energy. + if (Main.dedServ) + return; + + for (int i = 0; i < 45; i++) + { + Dust ectoplasm = Dust.NewDustPerfect(projectile.Center + Main.rand.NextVector2Circular(50f, 50f) * BurstIntensity, 264); + ectoplasm.velocity = Main.rand.NextVector2Circular(2f, 2f); + ectoplasm.color = projectile.GetAlpha(Color.White); + ectoplasm.scale = MathHelper.Lerp(1f, 1.6f, BurstIntensity); + ectoplasm.noGravity = true; + ectoplasm.noLight = true; + } + } + } +} diff --git a/Projectiles/Magic/RedirectingSoul.png b/Projectiles/Magic/RedirectingSoul.png new file mode 100644 index 0000000000000000000000000000000000000000..d0160bfac4e1abff89872b940759f8f70f4165ce GIT binary patch literal 497 zcmVPx#1ZP1_K>z@;j|==^1poj532;bRa{vGi!2kdb!2!6DYwZ940ftFLK~z{r?U%uA zgg^{MNgCjYkT^mGoGE}dD2z5JfHO1zM2?&`T(Qfk!+cL z-#4p`d7jN`119bUUDt^L;LHr0I2-J4uudeNN-MVS^>+a^u+2u)KyMdJ{Li!T@7dJ= z@Kn0)9}9D2;%snugS9)OLq9{m21nDF(KEmq05}UtlDyn0eFJ31=>vQUfxCfi8r#tC nNVX1i&&GQ;uH3WnGCc1C>Io(>B8dF<00000NkvXXu0mjfEgjAN literal 0 HcmV?d00001 diff --git a/Projectiles/Magic/SCalBookProj.cs b/Projectiles/Magic/SCalBookProj.cs new file mode 100644 index 0000000000..7fb907e11d --- /dev/null +++ b/Projectiles/Magic/SCalBookProj.cs @@ -0,0 +1,118 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.Utilities; + +namespace CalamityMod.Projectiles.Magic +{ + public class SCalBookProj : ModProjectile + { + public Player Owner => Main.player[projectile.owner]; + public float ShootIntensity => MathHelper.SmoothStep(0f, 1f, Utils.InverseLerp(0f, 275f, Time, true)); + public ref float Time => ref projectile.ai[0]; + public ref float AttackTimer => ref projectile.ai[1]; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Eternity"); + Main.projFrames[projectile.type] = 8; + } + + public override void SetDefaults() + { + projectile.width = 26; + projectile.height = 32; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.magic = true; + projectile.ignoreWater = true; + } + + public override void AI() + { + projectile.Center = Owner.Center + Vector2.UnitX * Owner.direction * 18f; + + // If the player is no longer able to hold the book, kill it. + if (!Owner.channel || Owner.noItems || Owner.CCed) + { + projectile.Kill(); + return; + } + + if (AttackTimer >= Main.rand.Next(20, 28) - (int)MathHelper.Lerp(0f, 11f, Utils.InverseLerp(0f, 120f, Time, true))) + ReleaseThings(); + + // Switch frames at a linearly increasing rate to make it look like the player is flipping pages quickly. + projectile.frameCounter++; + if (projectile.frameCounter >= (int)MathHelper.Lerp(10f, 2f, Utils.InverseLerp(0f, 180f, Time, true))) + { + projectile.frame = (projectile.frame + 1) % Main.projFrames[projectile.type]; + projectile.frameCounter = 0; + } + + AdjustPlayerValues(); + projectile.timeLeft = 2; + AttackTimer++; + Time++; + } + + public void ReleaseThings() + { + Main.PlaySound(SoundID.DD2_EtherianPortalSpawnEnemy); + if (Main.myPlayer != projectile.owner) + return; + + WeightedRandom typeDecider = new WeightedRandom(); + + typeDecider.Add(ModContent.ProjectileType(), 1.5f); + + // Make souls appear more frequently (aka with a higher weight) the more "intense" the shots should be. + typeDecider.Add(ModContent.ProjectileType(), ShootIntensity); + + Vector2 spawnPosition = projectile.Top + Main.rand.NextVector2CircularEdge(4f, 4f); + Vector2 shootVelocity = -Vector2.UnitY.RotatedBy(Main.rand.NextFloat(-0.13f, 0.23f) * Owner.direction) * Owner.gravDir; + shootVelocity *= Main.rand.NextFloat(5f, 8); + + Projectile.NewProjectile(spawnPosition, shootVelocity, typeDecider.Get(), projectile.damage, projectile.knockBack, projectile.owner, ShootIntensity); + + AttackTimer = 0f; + projectile.netUpdate = true; + } + + public void AdjustPlayerValues() + { + projectile.spriteDirection = projectile.direction = Owner.direction; + Owner.heldProj = projectile.whoAmI; + Owner.itemTime = 2; + Owner.itemAnimation = 2; + Owner.itemRotation = (projectile.direction * projectile.velocity).ToRotation(); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + float glowOutwardness = MathHelper.SmoothStep(0f, 4f, Utils.InverseLerp(90f, 270f, Time, true)); + Texture2D bookTexture = Main.projectileTexture[projectile.type]; + Rectangle frame = bookTexture.Frame(1, Main.projFrames[projectile.type], 0, projectile.frame); + Vector2 drawPosition; + Vector2 origin = frame.Size() * 0.5f; + Color glowColor = Color.Lerp(Color.Pink, Color.Red, (float)Math.Cos(Main.GlobalTime * 5f) * 0.5f + 0.5f); + glowColor.A = 0; + + // Draw an ominous glowing version of the book after a bit of time. + for (int i = 0; i < 8; i++) + { + drawPosition = projectile.Center + (MathHelper.TwoPi * i / 8f + Main.GlobalTime * 4f).ToRotationVector2() * glowOutwardness - Main.screenPosition; + spriteBatch.Draw(bookTexture, drawPosition, frame, projectile.GetAlpha(glowColor), projectile.rotation, origin, projectile.scale, SpriteEffects.None, 0f); + } + + drawPosition = projectile.Center - Main.screenPosition; + spriteBatch.Draw(bookTexture, drawPosition, frame, projectile.GetAlpha(lightColor), projectile.rotation, origin, projectile.scale, SpriteEffects.None, 0f); + return false; + } + + public override bool CanDamage() => false; + } +} diff --git a/Projectiles/Magic/SCalBookProj.png b/Projectiles/Magic/SCalBookProj.png new file mode 100644 index 0000000000000000000000000000000000000000..ca66b0eb6fc9e39957800d003da93c7ccd77a700 GIT binary patch literal 1054 zcmV+(1mXLMP)Px&*hxe|RCt{2oXt)XQ5c4w5m1T{euD@aLu4W1Z=x|8OiWy8VxkLK$t8FNBiTrIcg`UG00l%H^e%HDmj}o_6o=egW9E>6f}m8ViM0xm^Od zI(ou*!05^Sfg8@fS_EKbZr(^_Z!h;33acJCNa(e+v?UrdVf@CW!1dD)pVZvWeZo6q z?ST)xdGr$i1DE|V{rq^*xc}mmf3$aYb{gy7zyDw?J4pz@$blvR2D|)&GR+>q`uZ=xMM8UpoOy(%CO`S_-+thHK40^wwi5}(VgYcFP*Kv4XMgSn`~5RY z_RDhM=WS$o&;wX_n>E(wavx(o;r7q?6}L+O*)Pig+`WATfFl>od2eid!bpDX@IK>g z6_s@R&!rV(7;EO2_C+9UZ0i3VZe_mHePfOTn{8 z7-9CN)}|yT@+ch{9t2?FZ8q>Il^Ordhi^a{XMDL~C&My;2h;bAJKsI^XM>7)FqYf6 zx3)0G#wUzrd&aNWzUsKB#OWB8pn9wXJE0&+!^TpOF?BbF{rkH;s5WasIyC9tYFL`F zz1W)IZVZ#!ThgwrSS&c6@g-qY*Ct4}W)s%6xlefQOb-A}jlR7_b!}1hCdtIs^7*eo z8m%p=Ya1FmY&_mhwz|3oIPBVLp4lrALl-icW&qaLe;J9xk_qaibtiNT0~|+)d(QQs z+HIUV4X}~y{JG-*JbV5+QL7QvX1GgekC`O19Vg6f;*tvUt~q954U{;~%-np{zQLij zm0v}7cQ3Hfwb|cv+SuQmh8>+^Z9jkh0Mg(zaZzg%)Y`TjwYD;9ZK*}OwlYb(HXHXn z4fX5V4CGf|xtzcJUvzCiwZ-LfAKlD{b?@2&{M5j`)5JxsO;Bswa@5+&sI{dQ?b@_! zOH3-vTe~(uyS8fFJB?bKTAQHOrq)(>;#gbFbL`IP+HCBEJHKlSGwlNdy@CDB&g Date: Mon, 22 Mar 2021 19:39:49 -0500 Subject: [PATCH 064/202] Fixed photo MP mouse problems --- Projectiles/Ranged/ExoLightBomb.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Projectiles/Ranged/ExoLightBomb.cs b/Projectiles/Ranged/ExoLightBomb.cs index 312ca66bd6..91702debf8 100644 --- a/Projectiles/Ranged/ExoLightBomb.cs +++ b/Projectiles/Ranged/ExoLightBomb.cs @@ -52,10 +52,12 @@ namespace CalamityMod.Projectiles.Ranged public override void SendExtraAI(BinaryWriter writer) { writer.Write(YDirection); + writer.WriteVector2(Destination); } public override void ReceiveExtraAI(BinaryReader reader) { YDirection = reader.ReadSingle(); + Destination = reader.ReadVector2(); } public override void AI() @@ -66,7 +68,11 @@ namespace CalamityMod.Projectiles.Ranged if (projectile.localAI[0] == 0f) { InitialCenter = projectile.Center; - Destination = Main.MouseWorld; + if (Main.myPlayer == projectile.owner) + { + Destination = Main.MouseWorld; + projectile.netUpdate = true; + } DustType = Main.rand.NextBool(2) ? 107 : 234; if (Main.rand.NextBool(4)) { @@ -74,6 +80,10 @@ namespace CalamityMod.Projectiles.Ranged } projectile.localAI[0] = 1f; } + + if (Destination == Vector2.Zero) + return; + if (Time <= 90f) { projectile.position = Vector2.Lerp(InitialCenter, Destination, Time / 90f); @@ -92,9 +102,8 @@ namespace CalamityMod.Projectiles.Ranged projectile.Center = Destination + ((Time - 90) / 90f * MathHelper.ToRadians(720f) + (YDirection == -1).ToInt() * MathHelper.Pi).ToRotationVector2() * radius; } else if (Time == 180f) - { projectile.Kill(); - } + projectile.rotation = projectile.velocity.ToRotation() - MathHelper.PiOver2; Time++; } From 4be772b6a386fdd0c9531cc4dcace034b1f0a83b Mon Sep 17 00:00:00 2001 From: Dominic Date: Tue, 30 Mar 2021 05:06:38 -0500 Subject: [PATCH 065/202] Touchups to SCal book --- Items/Weapons/Magic/SCalBook.cs | 2 +- Projectiles/Magic/RedirectingFire.cs | 2 + Projectiles/Magic/RedirectingGildedSoul.cs | 87 ++++++++++++++++++ Projectiles/Magic/RedirectingGildedSoul.png | Bin 0 -> 2119 bytes Projectiles/Magic/RedirectingLostSoul.cs | 81 ++++++++++++++++ Projectiles/Magic/RedirectingLostSoul.png | Bin 0 -> 2015 bytes Projectiles/Magic/RedirectingSoul.png | Bin 497 -> 0 bytes ...tingSoul.cs => RedirectingVengefulSoul.cs} | 60 +++++++----- Projectiles/Magic/RedirectingVengefulSoul.png | Bin 0 -> 2432 bytes Projectiles/Magic/SCalBookProj.cs | 16 +++- 10 files changed, 223 insertions(+), 25 deletions(-) create mode 100644 Projectiles/Magic/RedirectingGildedSoul.cs create mode 100644 Projectiles/Magic/RedirectingGildedSoul.png create mode 100644 Projectiles/Magic/RedirectingLostSoul.cs create mode 100644 Projectiles/Magic/RedirectingLostSoul.png delete mode 100644 Projectiles/Magic/RedirectingSoul.png rename Projectiles/Magic/{RedirectingSoul.cs => RedirectingVengefulSoul.cs} (60%) create mode 100644 Projectiles/Magic/RedirectingVengefulSoul.png diff --git a/Items/Weapons/Magic/SCalBook.cs b/Items/Weapons/Magic/SCalBook.cs index 8ef6d64c2f..6c9d6bb53b 100644 --- a/Items/Weapons/Magic/SCalBook.cs +++ b/Items/Weapons/Magic/SCalBook.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Magic { item.damage = 2444; item.magic = true; - item.mana = 30; + item.mana = 10; item.width = 38; item.height = 40; item.useTime = item.useAnimation = 120; diff --git a/Projectiles/Magic/RedirectingFire.cs b/Projectiles/Magic/RedirectingFire.cs index 01a3c0b691..808b34a254 100644 --- a/Projectiles/Magic/RedirectingFire.cs +++ b/Projectiles/Magic/RedirectingFire.cs @@ -82,6 +82,8 @@ namespace CalamityMod.Projectiles.Magic public override void Kill(int timeLeft) { + // Emit some fire sounds. + Main.PlaySound(SoundID.Item34, projectile.Center); if (Main.dedServ) return; diff --git a/Projectiles/Magic/RedirectingGildedSoul.cs b/Projectiles/Magic/RedirectingGildedSoul.cs new file mode 100644 index 0000000000..d54269ddb3 --- /dev/null +++ b/Projectiles/Magic/RedirectingGildedSoul.cs @@ -0,0 +1,87 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Magic +{ + public class RedirectingGildedSoul : ModProjectile + { + public ref float BurstIntensity => ref projectile.ai[0]; + public ref float Time => ref projectile.ai[1]; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gilded Soul"); + Main.projFrames[projectile.type] = 4; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 10; + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + } + + public override void SetDefaults() + { + projectile.scale = 0.6f; + projectile.width = projectile.height = 32; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.tileCollide = false; + projectile.magic = true; + projectile.ignoreWater = true; + } + + public override void AI() => RedirectingVengefulSoul.DoSoulAI(projectile, ref Time, 5f); + + public override Color? GetAlpha(Color lightColor) + { + Color baseColor = Color.Lerp(Color.DarkGoldenrod, Color.Gold, projectile.identity % 5f / 5f); + Color color = Color.Lerp(baseColor, Color.White, BurstIntensity * 0.5f + (float)Math.Cos(Main.GlobalTime * 2.7f) * 0.04f); + color.A = 127; + return color * projectile.Opacity; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D texture = Main.projectileTexture[projectile.type]; + Rectangle frame = texture.Frame(1, Main.projFrames[projectile.type], 0, projectile.frame); + SpriteEffects direction = projectile.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + for (int i = 0; i < 4; i++) + { + for (int j = 0; j < projectile.oldPos.Length / 2; j++) + { + Color drawColor = projectile.GetAlpha(lightColor); + drawColor = Color.Lerp(drawColor, Color.White * projectile.Opacity, 2f * j / projectile.oldPos.Length) * (float)Math.Pow(1f - Utils.InverseLerp(0f, projectile.oldPos.Length / 2, j, true), 2D); + Vector2 drawPosition = projectile.oldPos[j] + projectile.Size * 0.5f + (MathHelper.TwoPi * i / 4f).ToRotationVector2() * 0.5f - Main.screenPosition; + float rotation = projectile.oldRot[j]; + + spriteBatch.Draw(texture, drawPosition, frame, drawColor, rotation, frame.Size() * 0.5f, projectile.scale, direction, 0f); + } + } + + return false; + } + + public override void Kill(int timeLeft) + { + // Play a wraith death sound at max intensity and a dungeon spirit hit sound otherwise. + Main.PlaySound(BurstIntensity >= 1f ? SoundID.NPCDeath52 : SoundID.NPCHit35, projectile.Center); + + // As well as an "extinguished" sound. + Main.PlaySound(SoundID.NPCDeath55, projectile.Center); + + // Make a ghost sound and explode into ectoplasmic energy. + if (Main.dedServ) + return; + + for (int i = 0; i < 45; i++) + { + Dust ectoplasm = Dust.NewDustPerfect(projectile.Center + Main.rand.NextVector2Circular(80f, 80f) * (float)Math.Pow(BurstIntensity, 2D), 264); + ectoplasm.velocity = Main.rand.NextVector2Circular(2f, 2f); + ectoplasm.color = projectile.GetAlpha(Color.White); + ectoplasm.scale = MathHelper.Lerp(1f, 1.6f, BurstIntensity); + ectoplasm.noGravity = true; + ectoplasm.noLight = true; + } + } + } +} diff --git a/Projectiles/Magic/RedirectingGildedSoul.png b/Projectiles/Magic/RedirectingGildedSoul.png new file mode 100644 index 0000000000000000000000000000000000000000..ecffa8c8a31dea2b64e178378f7d491407179ce4 GIT binary patch literal 2119 zcmb7_{Xf&|AIC2-B!V-jBzX>R@LrjZ{Jc0Hkfs z5=l@bK&u%c3GFU!zubj_SQyEg0IIplp8-IK*$^$9BJ);Q_5m16Wlkp^gQ#&xZ;&jK z&k&FDi@zs(!c*2bSXWIW(gM9U*G2hQo=TKCaUwoVN=Z&8bjaO6QxR>GI9IT@5as7? zN-N4?CMnTAP~#21P(L*V`OdtVj9HmvMST*n&(rA8jVDg7sNa;s+_$37Y88lLnsG0@Tg42iu8uyV2_o-ls}_2qpa0N0LpN&&@Y z_3YEgLVRbyq;xn(hiI|B`H}CrN|>yW_vY2AYxMrGQ~gi-=I}%hV8oTFN{h|CJlCnY z9&w|ktNDjL?lufqb+k(!RM6MJ#RQK<@WGrSwTG>KaCKVb9v}|dw#J)DK`Vc4h=J`0 z=M`M#B_SM829ou_pVjlu-sYsfzO^jCSa3Nm4kAt++f?bARRIipTlHS(?HSDk*YQ)< z8?5T7d*sHuGUcLgOQnmi|Dr9adb5L;^t?Al%vJ!yIyW5-f|t8vKxGO7Cr|zLT!<>5 z_=m(IoH&5xJ(&wDZ%{AEjtR2EuhXI{J5jrNzGmkpH8Zk9%dY9b8C5+SuOnLC875`? z{4Ee|dr(57ir2@AfSZI1|7P@bIZk%WzKj+zb7(WUJUw6ibtQIo}a#&-v*Aid+$zGOc`Q$`3{$3JN3Y>f+?cB-OlJ(+c-u|s2v-4YiP+u@W^GAn0Tv%u#07di3C&SOymHppbMVoG> zXIY^tCZh2wJMr2h>m}(4rQw-l@)mXTPiMk7<9HbNZz8> zWLEE#W;dc$r~+k6LG7}H@8>&iw>ddo<=NMbvkLSpFqz%nzO$H=DUoYPAGxMlA$@uS ztCyvyXL8pq$q7lJ$8z5gQH}VDqn7k{GM$({l6JqV#c`9Jom)KHe6v7PY^zYe_;8@V zEaiDfOhDX7v{^9W_F>Pc5ff(dziegKKSm$$W_LKa!Wq*W_t7O^ucTpB($tTd98u=X zcZ?38S9CC_!9z2vh51LIo753{u8vYUNyAJBHBk(kb0eSo`@CsRo%P#Tq*ekXZBUL9 ze#WPwlBvaca__q%-n-q^pX8{v%nj0=**JtC5oa%~UEAJyxUkF}5D&swXt4jz+LY=k z9TEfC)v2!Cx9-Cq*r9$gyxT!FGYJ}+o6>XK!@T~g)MMF=maei6SsaNw6rd4RmkL=B zKPAKPg1^vxQ~9-e1VZf9_IVdEIu8#?$^S6r`$}+QAh;R&2Shl_~P4FJ(Me-nu5y z`rD6ww$M%Yp?057=~SF)cB!lTHml{w_h-cozP9@Sm$jPSVqK70B^6cUvSNf!4&@KI z>`(FKO4Q5uKekJK@rpLU7KRmn5Tf1(t;!Dno5w`Bq}CtV6j*^VOqXCgo%Wrl@28E5 z=);xg6p|l3=I_;hou$QP6`+Er*qW7C1x5^pWumX ref projectile.ai[0]; + public ref float Time => ref projectile.ai[1]; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Soul"); + Main.projFrames[projectile.type] = 4; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 10; + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 32; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.tileCollide = false; + projectile.magic = true; + projectile.ignoreWater = true; + } + + public override void AI() => RedirectingVengefulSoul.DoSoulAI(projectile, ref Time, 1f); + + public override Color? GetAlpha(Color lightColor) + { + Color baseColor = Color.Lerp(Color.DarkRed, Color.DarkViolet, projectile.identity % 5f / 5f * 0.5f); + Color color = Color.Lerp(baseColor, Color.White, BurstIntensity * 0.5f + (float)Math.Cos(Main.GlobalTime * 2.7f) * 0.04f); + color.A = 0; + return color * projectile.Opacity; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + SpriteEffects direction = projectile.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + Texture2D texture = Main.projectileTexture[projectile.type]; + Rectangle frame = texture.Frame(1, Main.projFrames[projectile.type], 0, projectile.frame); + + for (int j = 0; j < projectile.oldPos.Length / 2; j++) + { + float fade = (float)Math.Pow(1f - Utils.InverseLerp(0f, projectile.oldPos.Length / 2, j, true), 2D); + Color drawColor = projectile.GetAlpha(lightColor) * fade; + Vector2 drawPosition = projectile.oldPos[j] + projectile.Size * 0.5f - Main.screenPosition; + float rotation = projectile.oldRot[j]; + + spriteBatch.Draw(texture, drawPosition, frame, drawColor, rotation, frame.Size() * 0.5f, projectile.scale, direction, 0f); + } + + return false; + } + + public override void Kill(int timeLeft) + { + // Play a wraith death sound at max intensity and a dungeon spirit hit sound otherwise. + Main.PlaySound(BurstIntensity >= 1f ? SoundID.NPCDeath52 : SoundID.NPCHit35, projectile.Center); + + // Make a ghost sound and explode into ectoplasmic energy. + if (Main.dedServ) + return; + + for (int i = 0; i < 45; i++) + { + Dust ectoplasm = Dust.NewDustPerfect(projectile.Center + Main.rand.NextVector2Circular(50f, 50f) * BurstIntensity, 264); + ectoplasm.velocity = Main.rand.NextVector2Circular(2f, 2f); + ectoplasm.color = projectile.GetAlpha(Color.White); + ectoplasm.scale = MathHelper.Lerp(1f, 1.6f, BurstIntensity); + ectoplasm.noGravity = true; + ectoplasm.noLight = true; + } + } + } +} diff --git a/Projectiles/Magic/RedirectingLostSoul.png b/Projectiles/Magic/RedirectingLostSoul.png new file mode 100644 index 0000000000000000000000000000000000000000..f02bca12216e5683e2178d592fad9d143ece854b GIT binary patch literal 2015 zcmV<52O#)~P)Px+nMp)JRCt{2ozH6&XBfvnqh^zAOlnLbnrMaAQlp}!hk~FKdPrMJDcDn?>0eL^ z{R>L}fG8K|BbesHb8@^kR!PO=68El4yReP7gCrcIU~wGw;mKW+U@{F3arB zk6pg+@8|nI3yyN(wfX@E4jfGU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%m}NJJ$eGL_ryGV zHXC~%@xn+x7@2pwJTQv3D{kt~O*tbZPA;=A(>lBCD3mtAjod=o-l_{LE32VGFA}{l zg30yN5P4BM6oSv)>@4qv&E|`-*nI?S^ukChFQj>4q%Dy3bjcxATE(sFc-Dx@Na#F} z>k^z6iL0$T*OLj8BSPxDWCL*?n6wk}?i-h=sVF}g?iZKy#O)+`VbWr08d1{L^&~hC zOonq4>!OZ}YmbZg+h)Sq)ab&3yr1DKY(%f83(f;$AWv2h!7BEpl|PfBa9SQ0LC3!@ zO+>SUn648_t9Z+DMC5frWpzZ@Iv<77yPk^75s@n|j3B*&t!r77&+37Zl^UmbUb1HQ zXlUgV@0*tYMfcxnd0+HutW&&M@@52Tz=OKdgF`_beme6c_WHcu7ooI@7q;eR%H2rD zQYFgB8d=QskrH6xeTk*Cino1T-4>JgC4tzwEtFRAEwiqkfkH}YX%%;QV9JKe15-9! z9+^1zf0mj|Y7wB5bz^1y5|h3z}D%`K7F`{MGz6ogUny#I|<)J{W}2c|{XjMdZD zxFUIEG`i$iXAe=kiZ#-Yr`2&m{tHRQ`cCl#Ozl8yNhlzq0@O={%L7v|%{U?w9gX5^ z)92a7%UvFr7E#y=jLFv~4#uoXyF4&0q8Y^_`^94Z)hf}sXmms<<@A_bknABY4@^di z+@X*ubD#bWX*nD7{s)rI10y)a^P-iP*;ilqzv23SN@H?CMX>e22rdsyMq0M!mNnal x#v((2%L9{#H^u`axI8dT@+K>u2^UET`5%)Fs^Ewyc{Kn4002ovPDHLkV1gl`_TB&h literal 0 HcmV?d00001 diff --git a/Projectiles/Magic/RedirectingSoul.png b/Projectiles/Magic/RedirectingSoul.png deleted file mode 100644 index d0160bfac4e1abff89872b940759f8f70f4165ce..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 497 zcmVPx#1ZP1_K>z@;j|==^1poj532;bRa{vGi!2kdb!2!6DYwZ940ftFLK~z{r?U%uA zgg^{MNgCjYkT^mGoGE}dD2z5JfHO1zM2?&`T(Qfk!+cL z-#4p`d7jN`119bUUDt^L;LHr0I2-J4uudeNN-MVS^>+a^u+2u)KyMdJ{Li!T@7dJ= z@Kn0)9}9D2;%snugS9)OLq9{m21nDF(KEmq05}UtlDyn0eFJ31=>vQUfxCfi8r#tC nNVX1i&&GQ;uH3WnGCc1C>Io(>B8dF<00000NkvXXu0mjfEgjAN diff --git a/Projectiles/Magic/RedirectingSoul.cs b/Projectiles/Magic/RedirectingVengefulSoul.cs similarity index 60% rename from Projectiles/Magic/RedirectingSoul.cs rename to Projectiles/Magic/RedirectingVengefulSoul.cs index ada9d3e9f3..5197493fcc 100644 --- a/Projectiles/Magic/RedirectingSoul.cs +++ b/Projectiles/Magic/RedirectingVengefulSoul.cs @@ -1,29 +1,28 @@ -using CalamityMod.DataStructures; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; -using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { - public class RedirectingSoul : ModProjectile + public class RedirectingVengefulSoul : ModProjectile { public ref float BurstIntensity => ref projectile.ai[0]; public ref float Time => ref projectile.ai[1]; public override void SetStaticDefaults() { DisplayName.SetDefault("Soul"); - Main.projFrames[projectile.type] = 3; + Main.projFrames[projectile.type] = 4; ProjectileID.Sets.TrailCacheLength[projectile.type] = 10; ProjectileID.Sets.TrailingMode[projectile.type] = 2; } public override void SetDefaults() { - projectile.width = projectile.height = 18; + projectile.scale = 0.8f; + projectile.width = projectile.height = 46; projectile.friendly = true; projectile.penetrate = 1; projectile.tileCollide = false; @@ -31,29 +30,37 @@ namespace CalamityMod.Projectiles.Magic projectile.ignoreWater = true; } - public override void AI() + public override void AI() => DoSoulAI(projectile, ref Time, 2f); + + public static void DoSoulAI(Projectile projectile, ref float time, float soulPower) { - if (Time >= 20f) + if (time >= 20f) { NPC potentialTarget = projectile.Center.ClosestNPCAt(1250f, false); if (potentialTarget != null) - HomeInOnTarget(potentialTarget); + HomeInOnTarget(projectile, potentialTarget, time); float accelerationFactor = MathHelper.SmoothStep(1.03f, 1.015f, Utils.InverseLerp(6f, 24f, projectile.velocity.Length(), true)); - if (projectile.velocity.Length() < 21f) + if (projectile.velocity.Length() < 21f + soulPower * 2f) projectile.velocity *= accelerationFactor; } + projectile.Opacity = Utils.InverseLerp(0f, 15f, time, true); projectile.frameCounter++; - if (projectile.frameCounter % 4f == 3f) + if (projectile.frameCounter % 5f == 4f) projectile.frame = (projectile.frame + 1) % Main.projFrames[projectile.type]; - projectile.rotation = projectile.velocity.ToRotation() - MathHelper.PiOver2; - Time++; + + projectile.rotation = projectile.velocity.ToRotation(); + projectile.spriteDirection = (projectile.velocity.X > 0f).ToDirectionInt(); + if (projectile.spriteDirection == -1) + projectile.rotation += MathHelper.Pi; + + time++; } - public void HomeInOnTarget(NPC target) + public static void HomeInOnTarget(Projectile projectile, NPC target, float time) { float oldSpeed = projectile.velocity.Length(); - float delayFactor = Utils.InverseLerp(20f, 35f, Time, true); + float delayFactor = Utils.InverseLerp(20f, 35f, time, true); float homeSpeed = MathHelper.Lerp(0f, 0.075f, delayFactor); projectile.velocity = Vector2.Lerp(projectile.velocity, projectile.DirectionTo(target.Center) * 16f, homeSpeed); @@ -63,25 +70,27 @@ namespace CalamityMod.Projectiles.Magic public override Color? GetAlpha(Color lightColor) { - Color baseColor = Color.Lerp(Color.IndianRed, Color.DarkViolet, projectile.identity % 5f / 5f); - Color color = Color.Lerp(baseColor, Color.Black, BurstIntensity * 0.5f + (float)Math.Cos(Main.GlobalTime * 2.7f) * 0.04f); + Color baseColor = Color.Lerp(Color.IndianRed, Color.DarkViolet, projectile.identity % 5f / 5f * 0.5f); + Color color = Color.Lerp(baseColor * 1.5f, baseColor, BurstIntensity * 0.5f + (float)Math.Cos(Main.GlobalTime * 2.7f) * 0.04f); color.A = 0; return color * projectile.Opacity; } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { + SpriteEffects direction = projectile.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; Texture2D texture = Main.projectileTexture[projectile.type]; Rectangle frame = texture.Frame(1, Main.projFrames[projectile.type], 0, projectile.frame); for (int i = 0; i < 4; i++) { - for (int j = 0; j < projectile.oldPos.Length; j++) + for (int j = 0; j < projectile.oldPos.Length / 2; j++) { - Color drawColor = projectile.GetAlpha(lightColor) * ((projectile.oldPos.Length - j) / (float)projectile.oldPos.Length); - Vector2 drawPosition = projectile.oldPos[j] + projectile.Size * 0.5f + (MathHelper.TwoPi * i / 4f).ToRotationVector2() * 3.5f - Main.screenPosition; + float fade = (float)Math.Pow(1f - Utils.InverseLerp(0f, projectile.oldPos.Length / 2, j, true), 2D); + Color drawColor = Color.Lerp(projectile.GetAlpha(lightColor), Color.White * projectile.Opacity, j / projectile.oldPos.Length) * fade; + Vector2 drawPosition = projectile.oldPos[j] + projectile.Size * 0.5f + (MathHelper.TwoPi * i / 4f).ToRotationVector2() * 1.5f - Main.screenPosition; float rotation = projectile.oldRot[j]; - spriteBatch.Draw(texture, drawPosition, frame, drawColor, rotation, frame.Size() * 0.5f, projectile.scale, SpriteEffects.None, 0f); + spriteBatch.Draw(texture, drawPosition, frame, drawColor, rotation, frame.Size() * 0.5f, projectile.scale, direction, 0f); } } @@ -99,10 +108,17 @@ namespace CalamityMod.Projectiles.Magic for (int i = 0; i < 45; i++) { - Dust ectoplasm = Dust.NewDustPerfect(projectile.Center + Main.rand.NextVector2Circular(50f, 50f) * BurstIntensity, 264); + Dust ectoplasm = Dust.NewDustPerfect(projectile.Center + Main.rand.NextVector2Circular(100f, 100f) * (float)Math.Pow(BurstIntensity, 2D), 264); ectoplasm.velocity = Main.rand.NextVector2Circular(2f, 2f); ectoplasm.color = projectile.GetAlpha(Color.White); - ectoplasm.scale = MathHelper.Lerp(1f, 1.6f, BurstIntensity); + ectoplasm.scale = MathHelper.Lerp(1.2f, 1.9f, BurstIntensity); + ectoplasm.noGravity = true; + ectoplasm.noLight = true; + + ectoplasm = Dust.NewDustPerfect(projectile.Center, 264); + ectoplasm.velocity = (MathHelper.TwoPi * i / 45f).ToRotationVector2() * 6f; + ectoplasm.color = projectile.GetAlpha(Color.White); + ectoplasm.scale = MathHelper.Lerp(1.2f, 1.9f, BurstIntensity); ectoplasm.noGravity = true; ectoplasm.noLight = true; } diff --git a/Projectiles/Magic/RedirectingVengefulSoul.png b/Projectiles/Magic/RedirectingVengefulSoul.png new file mode 100644 index 0000000000000000000000000000000000000000..3e0e4507b7ebceefbef02aa6dae0ec8a55989fbd GIT binary patch literal 2432 zcmeHI{X5eO6#tsdLbF6zNHL^l^Onf4tr??cA$jSktrz!RQM=p9YsoC0>BdHlZe{E3 zdaj5xjZo&j>!s0)MDiLH87nVw=dOEyyMMyHo##2{Jm;L}{PH=Ua}JM6@rCKE*8ubS%Bbq zsI_|3+6=#N769ngeN&C-mppCt?f8>S#D~Nmn0kGIIqbH^XUICnCU-t%usDkn_gZUb zxdE~|x^k~92PX=+r^wDs@lyF7h`15&yp&2SEp34W7WNd3a4?w1XRbX}N4Ay9MRsPo z$7R@~+LB~5r1ZQ0oe4S!{} zhDhPd*KuT~D=>z{#$D6!tbb5w_b2U~e!(b;%0WiwTb?>-VK#gn0Vh3m-P^B2APsH* z5r&0gbq&d#4;Yryp4%Ats688WPu~E*4%l`uKPbjn`N@k{(JvQA zO%!(;RqD1?c5F-;NP7(8;vOw#;k1mJI!2rPQC5E}jmS!af!|#Nlyys*P{s}9#mmq$ z<_>FLv&wTKhW&EDDR!3ADCCXaR*fC4y>l9OqOJ< zwxd2DWqsK;8zEi;cN4~pFyz~+#|KOFGd$O}52e=G%lcs`0i@X6Ewwq-a*y_N?`QK0 z1V+cHZPrbW7Vg%6bL{%E>eELi{oE+uJ1=~a*1K%NjwEvo_u28|ihs5=g&c?cM$O&X zNmuoOF7~hDQ)*X8=&DSbfN`^KfaN@yskxTK4Nc$tBo8k1?u+6igk}B`eHO%(DgE2R z7)gm&z)B{6qiDpWI( zqAnZePnvOV0ZC`UDFwFiTO+ey_w_=TRfHE_;=Ef{X{#5$x}4mq#0#N!F{G;z(!%Zo zgE`<4hlEYFN5<1~K`r>MWW<4#GpVw;lB2aaszC~z+TCJ`fX3L7_28m6 zP%b+M*%m5aFSrVS*TJv{^;VhM?@Ev!sVJ9R^9J{9A8U(mqa?d2ha!nK$E@&P14##E zPK{%_%&PWb3aSN<0OkhlkMYgPne1s0dyC_wfJWN5#eN$te>0nkL&IB9a%ikU{a!Gu z+|aj~Em-M5aRcT&W{ZkhI6_kt=O{icYcDdvepfQq0A4&lY*OP`Ec`DKw*@Cq&j7a z+>I(P*~WY1!Fkeh)I{Z(TMUN1p8)P*&NEFI5sTLUh%UR39aj%s=*L z>OB)p8*bMt#z);q32>2wVaog}yTr)SQ_gRA#9-Z>7f0KmZK7B!*{;tgfYPp4-KHK} zH{(pOrIL1FD)9;8wYY}M>57>6AP$+B!|^G|qJ3mJ@vv`iCy>|6`I}JfV5!4Dgo@(K g|C>-fsTLM18hG#9fnP00(!V`IvJZuLmq6qE1= Main.rand.Next(20, 28) - (int)MathHelper.Lerp(0f, 11f, Utils.InverseLerp(0f, 120f, Time, true))) + if (AttackTimer >= Main.rand.Next(20, 28) - (int)MathHelper.Lerp(0f, 16f, Utils.InverseLerp(0f, 120f, Time, true))) ReleaseThings(); // Switch frames at a linearly increasing rate to make it look like the player is flipping pages quickly. @@ -65,17 +65,29 @@ namespace CalamityMod.Projectiles.Magic if (Main.myPlayer != projectile.owner) return; + // If the owner has sufficient mana, consume it. + // Otherwise, delete the book and don't bother summoning anything. + if (!Owner.CheckMana(Owner.ActiveItem().mana, true, false)) + { + projectile.Kill(); + return; + } WeightedRandom typeDecider = new WeightedRandom(); typeDecider.Add(ModContent.ProjectileType(), 1.5f); // Make souls appear more frequently (aka with a higher weight) the more "intense" the shots should be. - typeDecider.Add(ModContent.ProjectileType(), ShootIntensity); + typeDecider.Add(ModContent.ProjectileType(), ShootIntensity * 0.75f); + typeDecider.Add(ModContent.ProjectileType(), ShootIntensity * 0.4f); + typeDecider.Add(ModContent.ProjectileType(), ShootIntensity * 0.2f); Vector2 spawnPosition = projectile.Top + Main.rand.NextVector2CircularEdge(4f, 4f); Vector2 shootVelocity = -Vector2.UnitY.RotatedBy(Main.rand.NextFloat(-0.13f, 0.23f) * Owner.direction) * Owner.gravDir; shootVelocity *= Main.rand.NextFloat(5f, 8); + if (Owner.velocity.Y < 0f) + shootVelocity.Y += Owner.velocity.Y; + Projectile.NewProjectile(spawnPosition, shootVelocity, typeDecider.Get(), projectile.damage, projectile.knockBack, projectile.owner, ShootIntensity); AttackTimer = 0f; From b0ab1f88b0d3f3cc970a45480d92d0e468bff2d3 Mon Sep 17 00:00:00 2001 From: Dominic Date: Tue, 30 Mar 2021 05:11:54 -0500 Subject: [PATCH 066/202] Tooltip typo fix --- Items/Weapons/Ranged/SurgeDriver.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Ranged/SurgeDriver.cs b/Items/Weapons/Ranged/SurgeDriver.cs index 6ce1f01aa4..72b51af581 100644 --- a/Items/Weapons/Ranged/SurgeDriver.cs +++ b/Items/Weapons/Ranged/SurgeDriver.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Ranged { DisplayName.SetDefault("Surge Driver"); Tooltip.SetDefault("Left clicks release a laser ray that explodes on collision\n" + - "Right clicks release a barrage of laser beams that release homing energy on enemy hitss"); + "Right clicks release a barrage of laser beams that release homing energy on enemy hits"); } public override void SetDefaults() From f348ff4bcd937f14a7adf63bff992b5f0c441e5f Mon Sep 17 00:00:00 2001 From: Dominic Date: Tue, 30 Mar 2021 08:50:16 -0500 Subject: [PATCH 067/202] Added Condemnation --- Items/Weapons/Ranged/Condemnation.cs | 79 +++++++++++ Items/Weapons/Ranged/Condemnation.png | Bin 0 -> 2095 bytes Projectiles/Ranged/CondemnationArrow.cs | 89 ++++++++++++ Projectiles/Ranged/CondemnationArrow.png | Bin 0 -> 1141 bytes Projectiles/Ranged/CondemnationArrowHoming.cs | 78 ++++++++++ Projectiles/Ranged/CondemnationHoldout.cs | 134 ++++++++++++++++++ Utilities/CollisionUtils.cs | 28 ++++ 7 files changed, 408 insertions(+) create mode 100644 Items/Weapons/Ranged/Condemnation.cs create mode 100644 Items/Weapons/Ranged/Condemnation.png create mode 100644 Projectiles/Ranged/CondemnationArrow.cs create mode 100644 Projectiles/Ranged/CondemnationArrow.png create mode 100644 Projectiles/Ranged/CondemnationArrowHoming.cs create mode 100644 Projectiles/Ranged/CondemnationHoldout.cs create mode 100644 Utilities/CollisionUtils.cs diff --git a/Items/Weapons/Ranged/Condemnation.cs b/Items/Weapons/Ranged/Condemnation.cs new file mode 100644 index 0000000000..f9a321673d --- /dev/null +++ b/Items/Weapons/Ranged/Condemnation.cs @@ -0,0 +1,79 @@ +using CalamityMod.Projectiles.Ranged; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Ranged +{ + public class Condemnation : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Condemnation"); + Tooltip.SetDefault("Left clicks allows you to charge the repeater and release more arrows the longer the charge lasts\n" + + "Right clicks release fast moving arrows"); + } + + public override void SetDefaults() + { + item.damage = 2700; + item.ranged = true; + item.width = 130; + item.height = 42; + item.useTime = item.useAnimation = 16; + item.useStyle = ItemUseStyleID.HoldingOut; + item.noMelee = true; + item.knockBack = 5f; + item.value = CalamityGlobalItem.RarityVioletBuyPrice; + item.rare = ItemRarityID.Purple; + item.Calamity().customRarity = CalamityRarity.Violet; + item.autoReuse = true; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 14.5f; + item.useAmmo = AmmoID.Arrow; + } + + public override Vector2? HoldoutOffset() => new Vector2(-50f, 0f); + + public override bool AltFunctionUse(Player player) => true; + + public override bool CanUseItem(Player player) + { + if (player.altFunctionUse == 2) + { + item.noUseGraphic = false; + item.UseSound = SoundID.DD2_BallistaTowerShot; + item.channel = false; + } + else + { + item.noUseGraphic = true; + item.UseSound = SoundID.Item20; + item.channel = true; + return player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0; + } + return base.CanUseItem(player); + } + + public override float UseTimeMultiplier(Player player) => player.altFunctionUse == 2 ? 0.7f : 1f; + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + Vector2 shootVelocity = new Vector2(speedX, speedY); + Vector2 shootDirection = shootVelocity.SafeNormalize(Vector2.UnitX * player.direction); + + // Single arrow firing. + if (player.altFunctionUse == 2) + { + Vector2 tipPosition = position + shootDirection * 110f; + Projectile.NewProjectile(tipPosition, shootVelocity, item.shoot, damage, knockBack, player.whoAmI); + } + + // Charge-up. Done via a holdout projectile. + else + Projectile.NewProjectile(position, shootDirection, ModContent.ProjectileType(), 0, knockBack, player.whoAmI); + return false; + } + } +} diff --git a/Items/Weapons/Ranged/Condemnation.png b/Items/Weapons/Ranged/Condemnation.png new file mode 100644 index 0000000000000000000000000000000000000000..09d5d3c1fbf30cf15d78524122170c3f04d8532c GIT binary patch literal 2095 zcmV+~2+;S5P)Px+=}AOERCt{2oLy`j)fLBo*WUHUUx^*!I3^z(C8ROVCn14~LMb1rKoLl!d8i5$ zq&^^lpuF{=B9)AI=mSz()Jm25P*9O7L0k1hYAXQ|p)H9LLJYw%f&@DWaT1f*&c?gz z_1fEqv&ZXuJ+q!*FF4ixy^QA0o!PsybN+MAx#zCo8sp)P&4KL$V`BiMC&mHj%Z&nX z`gGr{KJU5YmPq|R9=!sLy)NkR!CIfKpTt5JrOeWIx)9F;CeqWZVieBAw z%@FQUjPi))F;0ob2P1F){8VB|;=n63;_Eq!%%0|31XJ_@vOWqqOnfWP;j1mKQ4 z?+)zOee7rfAdyHIfJ`P+_PR?K)*FBePWxOdgjWO)0Oso+z)aNDHCp>SzflK3O|G>7 z@WKy2u#W$+dj$Y{_f-S1)hsZ@t<`UJwHRXWxG8IqN@w4nBaOGdPLxI!;hneNvW|zf zKm4s=-{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flJaO*5{*OV6Zj1i_qf}Z6y&`yk zYx_Tx<`wG2yYG0-5boU ref projectile.ai[0]; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Condemnation Arrow"); + ProjectileID.Sets.TrailingMode[projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 9; + } + + public override void SetDefaults() + { + projectile.width = 26; + projectile.height = 90; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.ranged = true; + projectile.arrow = true; + projectile.extraUpdates = 1; + projectile.timeLeft = 300; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, Color.Violet.ToVector3()); + projectile.Opacity = Utils.InverseLerp(0f, 20f, Time, true); + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; + Time++; + + // Release side arrows every so often. + if (Main.netMode != NetmodeID.MultiplayerClient && Time % 90f == 89f) + { + for (int i = -1; i <= 1; i += 2) + { + Vector2 shootVelocity = projectile.velocity.RotatedBy(i * 0.036f); + Projectile.NewProjectile(projectile.Center, shootVelocity, ModContent.ProjectileType(), projectile.damage / 2, projectile.knockBack, projectile.owner); + } + } + } + + public override Color? GetAlpha(Color lightColor) + { + Color c1 = new Color(226, 40, 40, 0); + Color c2 = new Color(205, 0, 194, 0); + return Color.Lerp(c1, c2, (float)Math.Cos(projectile.identity * 1.41f + Main.GlobalTime * 8f) * 0.5f + 0.5f) * projectile.Opacity; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, 1); + return false; + } + + public override void Kill(int timeLeft) + { + // Release a burst of magic dust on death. + if (Main.dedServ) + return; + + for (int i = 0; i < 30; i++) + { + Dust fire = Dust.NewDustPerfect(projectile.Center, 130); + fire.velocity = projectile.velocity.SafeNormalize(Vector2.UnitY).RotatedByRandom(0.8f) * new Vector2(4f, 1.25f) * Main.rand.NextFloat(0.9f, 1f); + fire.velocity = fire.velocity.RotatedBy(projectile.rotation - MathHelper.PiOver2); + fire.velocity += projectile.velocity * 0.7f; + + fire.noGravity = true; + fire.color = Color.Lerp(Color.White, Color.Purple, Main.rand.NextFloat()); + fire.scale = Main.rand.NextFloat(1f, 1.1f); + + fire = Dust.CloneDust(fire); + fire.velocity = Main.rand.NextVector2Circular(3f, 3f); + fire.velocity += projectile.velocity * 0.6f; + } + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => projectile.RotatingHitboxCollision(targetHitbox.TopLeft(), targetHitbox.Size()); + } +} diff --git a/Projectiles/Ranged/CondemnationArrow.png b/Projectiles/Ranged/CondemnationArrow.png new file mode 100644 index 0000000000000000000000000000000000000000..3b2032bb207f2ce2f2acc122324ef6e6862f84d0 GIT binary patch literal 1141 zcmV-*1d98KP)V?00001b5ch_0Itp) z=>Px(FG)l}RA_g=bd-ww1y60E0yN0yBYvft93MfN2d>ZR&2iq^~O0gwJAT5Yke@#wun7W ztL|acM14@A?V?-xsY)RF;;{XKA$^S^qs>Q$(U%yb$cWjJ+b%}DC#RZzZF66G8pUd( z419($TBWB^q&Ayc1hLf~s#WqDMQSsyDQyCP>YhCSOwP@P+M~2eF*EpCdSW7AuHK&q zU{aT;_L!`m93#uL+>L)L*V|vawzv0j@cqZ%2f)_e0g`-=?C~$ZpO%-L<&p0Sz~?{q0Pt!q9~kd5OOKJRWMg1O&S!r-Rg?97 z0nEx%1F*3xqvJ#UQehOx5Irjc04y}-+fK01XgL3o(0LTeF}hH{+18;@C<3sywias7 zWJH^|dD8z4tI!qaazlasVo{=Vbv2x+kM3dA-=BFVyJGtlG`dG4AHVgM++D;$F9O?d z>;8Yxe@0}~?b|mR+JE?n)DP;l8=?O9?#*r)1Kq%=1)*nv5PREdaaS<{pj>$gfN##7 z543%)qR@Se6z`oq1HdoWJNvtlqI(z_(_;XxOkK7B-yi-6fWfIR04SB7Hvradw4EpY zx_34!zlZYq0su=(e}=wK`Fz1RI{=Nwa_D^NX{1bshNPydOkR2I4FIl8UB+u$=O5S| zpILeuDI;7CJ9zK_0C(=(1>nhk$T9^EJ|3 zXRS2=j~@$@_4W0@ys1Q;ZC!~mBH!@vFtGV$RYuzW{eft;xVRV?--3i|s(zH|-Yb+r z9NLUam{GB~3xJW4-2f~vF9o7Zwa_o?hp$VP){2S$ebOk*svrFsCcEbW>vjYih)N&#X{oWiXl?=e%)xRxlt>i!G?=t{*7Z#$ "CalamityMod/Projectiles/Ranged/CondemnationArrow"; + public ref float Time => ref projectile.ai[0]; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Condemnation Arrow"); + ProjectileID.Sets.TrailingMode[projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 9; + } + + public override void SetDefaults() + { + projectile.width = 14; + projectile.height = 45; + projectile.scale = 0.5f; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.tileCollide = true; + projectile.ranged = true; + projectile.arrow = true; + projectile.extraUpdates = 1; + projectile.timeLeft = 300; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, Color.Violet.ToVector3()); + projectile.Opacity = Utils.InverseLerp(0f, 20f, Time, true) * Utils.InverseLerp(0f, 20f, projectile.timeLeft, true); + + NPC potentialTarget = projectile.Center.ClosestNPCAt(1500f, false); + if (potentialTarget != null) + projectile.velocity = (projectile.velocity * 29f + projectile.DirectionTo(potentialTarget.Center) * 21f) / 30f; + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; + Time++; + } + + public override Color? GetAlpha(Color lightColor) + { + Color c1 = new Color(226, 40, 40, 0); + Color c2 = new Color(205, 0, 194, 0); + return Color.Lerp(c1, c2, (float)Math.Cos(projectile.identity * 1.41f + Main.GlobalTime * 8f) * 0.5f + 0.5f) * projectile.Opacity; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, 1); + return false; + } + + public override void Kill(int timeLeft) + { + // Release a burst of magic dust on death. + if (Main.dedServ) + return; + + for (int i = 0; i < 10; i++) + { + Dust fire = Dust.NewDustPerfect(projectile.Center, 267); + fire.velocity = Main.rand.NextVector2Circular(2f, 2f); + fire.color = Color.Lerp(Color.Red, Color.Purple, Main.rand.NextFloat()); + fire.scale = Main.rand.NextFloat(1f, 1.1f); + fire.noGravity = true; + } + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => projectile.RotatingHitboxCollision(targetHitbox.TopLeft(), targetHitbox.Size()); + } +} diff --git a/Projectiles/Ranged/CondemnationHoldout.cs b/Projectiles/Ranged/CondemnationHoldout.cs new file mode 100644 index 0000000000..3ebe3ec429 --- /dev/null +++ b/Projectiles/Ranged/CondemnationHoldout.cs @@ -0,0 +1,134 @@ +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Ranged +{ + public class CondemnationHoldout : ModProjectile + { + public Player Owner => Main.player[projectile.owner]; + public bool OwnerCanShoot => Owner.channel && Owner.HasAmmo(Owner.ActiveItem(), true) && !Owner.noItems && !Owner.CCed; + public ref float ChargeUpTime => ref projectile.ai[0]; + public override string Texture => "CalamityMod/Items/Weapons/Ranged/Condemnation"; + public override void SetStaticDefaults() => DisplayName.SetDefault("Condemnation"); + + public override void SetDefaults() + { + projectile.width = 130; + projectile.height = 42; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.ranged = true; + projectile.ignoreWater = true; + } + + public override void AI() + { + Vector2 armPosition = Owner.RotatedRelativePoint(Owner.MountedCenter, true); + + Vector2 tipPosition = armPosition + projectile.velocity * projectile.width * 0.5f; + if (ChargeUpTime < 20f) + ReleaseInitialChargeDust(tipPosition); + if (ChargeUpTime == 20f) + ReleaseInitialBurstDust(tipPosition); + + // Release projectiles after done charging. + if (!OwnerCanShoot) + { + projectile.Kill(); + + // If killed prior to the charge being complete, don't bother spawning anything. Just die. + if (ChargeUpTime < 20f) + return; + + int totalProjectilesToShoot = (int)Math.Pow(ChargeUpTime * 0.15f, 0.71) + 1; + if (totalProjectilesToShoot > 32) + totalProjectilesToShoot = 32; + + for (int i = 0; i < totalProjectilesToShoot; i++) + ShootProjectiles(tipPosition, MathHelper.Lerp(0.425f, 1f, i / (float)totalProjectilesToShoot)); + + Main.PlaySound(SoundID.DD2_BallistaTowerShot); + } + + UpdateProjectileHeldVariables(armPosition); + ManipulatePlayerVariables(); + ChargeUpTime++; + } + + public void ReleaseInitialBurstDust(Vector2 tipPosition) + { + if (Main.dedServ) + return; + + for (int i = 0; i < 36; i++) + { + Dust chargeMagic = Dust.NewDustPerfect(tipPosition, 267); + chargeMagic.velocity = (MathHelper.TwoPi * i / 36f).ToRotationVector2() * 5f + Owner.velocity; + chargeMagic.scale = Main.rand.NextFloat(1f, 1.5f); + chargeMagic.color = Color.Violet; + chargeMagic.noGravity = true; + } + } + + public void ReleaseInitialChargeDust(Vector2 tipPosition) + { + if (Main.dedServ) + return; + + for (int i = 0; i < 2; i++) + { + Dust chargeMagic = Dust.NewDustPerfect(tipPosition + Main.rand.NextVector2Circular(20f, 20f), 267); + chargeMagic.velocity = (tipPosition - chargeMagic.position) * 0.1f + Owner.velocity; + chargeMagic.scale = Main.rand.NextFloat(1f, 1.5f); + chargeMagic.color = projectile.GetAlpha(Color.White); + chargeMagic.noGravity = true; + } + } + + public void ShootProjectiles(Vector2 tipPosition, float speedFactor) + { + if (Main.myPlayer != projectile.owner) + return; + + Item heldItem = Owner.ActiveItem(); + int projectileType = ModContent.ProjectileType(); + float shootSpeed = heldItem.shootSpeed * speedFactor * 1.5f; + int damage = (int)(Owner.GetWeaponDamage(heldItem) * 1.45); + float knockback = heldItem.knockBack; + + bool uselessFuckYou = OwnerCanShoot; + Owner.PickAmmo(heldItem, ref projectileType, ref shootSpeed, ref uselessFuckYou, ref damage, ref knockback, false); + projectileType = ModContent.ProjectileType(); + + knockback = Owner.GetWeaponKnockback(heldItem, knockback); + Vector2 shootVelocity = projectile.velocity.SafeNormalize(Vector2.UnitY) * shootSpeed; + + Projectile.NewProjectile(tipPosition, shootVelocity, projectileType, damage, knockback, projectile.owner, 0f, 0f); + } + + public void UpdateProjectileHeldVariables(Vector2 armPosition) + { + projectile.position = armPosition - projectile.Size * 0.5f; + projectile.rotation = projectile.velocity.ToRotation(); + if (projectile.spriteDirection == -1) + projectile.rotation += MathHelper.Pi; + projectile.spriteDirection = projectile.direction; + projectile.timeLeft = 2; + } + + public void ManipulatePlayerVariables() + { + Owner.ChangeDir(projectile.direction); + Owner.heldProj = projectile.whoAmI; + Owner.itemTime = 2; + Owner.itemAnimation = 2; + Owner.itemRotation = (projectile.velocity * projectile.direction).ToRotation(); + } + + public override bool CanDamage() => false; + } +} diff --git a/Utilities/CollisionUtils.cs b/Utilities/CollisionUtils.cs new file mode 100644 index 0000000000..2ba78d6163 --- /dev/null +++ b/Utilities/CollisionUtils.cs @@ -0,0 +1,28 @@ +using Microsoft.Xna.Framework; +using Terraria; + +namespace CalamityMod +{ + public static partial class CalamityUtils + { + /// + /// Performs collision based a rotating hitbox for an entity by treating the hitbox as a line. By default uses the velocity of the entity as a direction. This can be overriden. + /// + /// The entity. + /// The top left coordinates of the target to check. + /// The hitbox size of the target to check. + /// An optional direction override + public static bool RotatingHitboxCollision(this Entity entity, Vector2 targetTopLeft, Vector2 targetHitboxDimensions, Vector2? directionOverride = null) + { + Vector2 lineDirection = directionOverride ?? entity.velocity; + + // Ensure that the line direction is a unit vector. + lineDirection = lineDirection.SafeNormalize(Vector2.UnitY); + Vector2 start = entity.Center - lineDirection * entity.height * 0.5f; + Vector2 end = entity.Center + lineDirection * entity.height * 0.5f; + + float _ = 0f; + return Collision.CheckAABBvLineCollision(targetTopLeft, targetHitboxDimensions, start, end, entity.width, ref _); + } + } +} From e6a0fa1efa1c0335461746a98b48332623d32b70 Mon Sep 17 00:00:00 2001 From: Dominic Date: Tue, 30 Mar 2021 15:15:28 -0500 Subject: [PATCH 068/202] Added Sacrifice and Vigilance --- Buffs/Summon/SoulSeekerBuff.cs | 35 ++++++ Buffs/Summon/SoulSeekerBuff.png | Bin 0 -> 633 bytes CalPlayer/CalamityPlayer.cs | 2 + Items/Weapons/Rogue/Sacrifice.cs | 66 ++++++++++ Items/Weapons/Rogue/Sacrifice.png | Bin 0 -> 1933 bytes Items/Weapons/Summon/Vigilance.cs | 58 +++++++++ Items/Weapons/Summon/Vigilance.png | Bin 0 -> 2517 bytes Projectiles/Ranged/CondemnationArrow.cs | 3 +- Projectiles/Rogue/SacrificeProjectile.cs | 104 ++++++++++++++++ Projectiles/Summon/BrimstoneDartSummon.cs | 64 ++++++++++ Projectiles/Summon/SeekerSummonProj.cs | 140 ++++++++++++++++++++++ Projectiles/Summon/SeekerSummonProj.png | Bin 0 -> 8180 bytes 12 files changed, 471 insertions(+), 1 deletion(-) create mode 100644 Buffs/Summon/SoulSeekerBuff.cs create mode 100644 Buffs/Summon/SoulSeekerBuff.png create mode 100644 Items/Weapons/Rogue/Sacrifice.cs create mode 100644 Items/Weapons/Rogue/Sacrifice.png create mode 100644 Items/Weapons/Summon/Vigilance.cs create mode 100644 Items/Weapons/Summon/Vigilance.png create mode 100644 Projectiles/Rogue/SacrificeProjectile.cs create mode 100644 Projectiles/Summon/BrimstoneDartSummon.cs create mode 100644 Projectiles/Summon/SeekerSummonProj.cs create mode 100644 Projectiles/Summon/SeekerSummonProj.png diff --git a/Buffs/Summon/SoulSeekerBuff.cs b/Buffs/Summon/SoulSeekerBuff.cs new file mode 100644 index 0000000000..e552084a4b --- /dev/null +++ b/Buffs/Summon/SoulSeekerBuff.cs @@ -0,0 +1,35 @@ +using CalamityMod.CalPlayer; +using CalamityMod.Projectiles.Summon; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.Summon +{ + public class SoulSeekerBuff : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Soul Seeker"); + Description.SetDefault("It definitely wants something from you"); + Main.buffNoTimeDisplay[Type] = true; + Main.buffNoSave[Type] = true; + } + + public override void Update(Player player, ref int buffIndex) + { + CalamityPlayer modPlayer = player.Calamity(); + if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) + modPlayer.soulSeeker = true; + + if (!modPlayer.soulSeeker) + { + player.DelBuff(buffIndex); + buffIndex--; + } + else + { + player.buffTime[buffIndex] = 18000; + } + } + } +} diff --git a/Buffs/Summon/SoulSeekerBuff.png b/Buffs/Summon/SoulSeekerBuff.png new file mode 100644 index 0000000000000000000000000000000000000000..fe6b96bed37bd3b1c7587dfe8da153ebc7189404 GIT binary patch literal 633 zcmV-<0*3vGP)Px%Gf6~2R9J=0moaD*K^TR<6@{pU5;SmvUWkPWgcB8&laRzZAhEHCS_l^Q+61D7 zo`^+yyDN-=RHlhw6Jn4Y3NaWW*aSU=9H^v?gF5vuNQ!S-wlbCA76o_=W|U+_(#C)xg1Jz`f+h_&xMa2 z@3M|_t2JOZ34aKvce>+&i)R4X*fRCmnJSR<_W6UmsSDPZ>i|qlzi8o;9%@3>n08HJv z2_z(xiOQHEQgcZ7L%>b>%gJZ<%navod2J1Vu=)zfCgI8-0_u_OSXy8H06-Z#_01&5 zTF>phGUg8f>Gu6`V0Q-eoGb0>xfJ%B^G{0ysTVq5JPW|5`e*BW?gZi;kyLqPoKHL+ zw=7uU$K55NA)rLT`$G&{AqJ= ziMk|mClF^q1f(0I*Q{|C8NEN`JS#)~XTaU{*51Acl0BlFj}949u2a>&%)hhNah PendingProjectilesToRespawn = new List(); @@ -1963,6 +1964,7 @@ namespace CalamityMod.CalPlayer sageSpirit = false; fleshBall = false; eyeOfNight = false; + soulSeeker = false; abyssalDivingSuitPrevious = abyssalDivingSuit; abyssalDivingSuit = abyssalDivingSuitHide = abyssalDivingSuitForce = abyssalDivingSuitPower = false; diff --git a/Items/Weapons/Rogue/Sacrifice.cs b/Items/Weapons/Rogue/Sacrifice.cs new file mode 100644 index 0000000000..374f48cf1f --- /dev/null +++ b/Items/Weapons/Rogue/Sacrifice.cs @@ -0,0 +1,66 @@ +using CalamityMod.Projectiles.Rogue; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Rogue +{ + public class Sacrifice : RogueWeapon + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sacrifice"); + Tooltip.SetDefault("Releases a dagger that sticks to enemies\n" + + "Right clicking causes all stuck daggers to fly back at you and give you life" + + "Daggers stuck to enemies release bloodsplosions over time"); + } + + public override void SafeSetDefaults() + { + item.damage = 266; + item.width = item.height = 68; + item.useAnimation = item.useTime = 6; + item.noMelee = true; + item.noUseGraphic = true; + item.useStyle = ItemUseStyleID.SwingThrow; + item.knockBack = 4f; + item.rare = ItemRarityID.Purple; + item.Calamity().customRarity = CalamityRarity.Violet; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.value = CalamityGlobalItem.RarityVioletBuyPrice; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 12f; + item.Calamity().rogue = true; + } + + public override bool AltFunctionUse(Player player) => true; + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + if (player.altFunctionUse == 2) + { + for (int i = 0; i < Main.maxProjectiles; i++) + { + if (Main.projectile[i].type != type || !Main.projectile[i].active || Main.projectile[i].owner != player.whoAmI) + continue; + + if (Main.projectile[i].ai[0] != 1f) + continue; + + Main.projectile[i].ai[0] = 2f; + Main.projectile[i].netUpdate = true; + } + return false; + } + + Vector2 velocity = new Vector2(speedX, speedY); + position += velocity * 3f; + int proj = Projectile.NewProjectile(position, velocity, type, damage, knockBack, player.whoAmI); + if (player.Calamity().StealthStrikeAvailable() && Main.projectile.IndexInRange(proj)) + Main.projectile[proj].Calamity().stealthStrike = true; + return false; + } + } +} diff --git a/Items/Weapons/Rogue/Sacrifice.png b/Items/Weapons/Rogue/Sacrifice.png new file mode 100644 index 0000000000000000000000000000000000000000..4ad5c254803e94e7df8a13edd7fdd86941cbfa28 GIT binary patch literal 1933 zcmV;82Xgp{P)00001b5ch_0Itp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bim0%slHUeA?8YDh|#D|Vlqa_cQ+|G+I3!$^UCI_u2}KNq%-O~0C(kuEr4Gy zNNn->gg{mEsG8>ek3Vuf|Ls>dxW*|dQo4@&Spy|1LySg!5;HDUdZSr6jTShuMG-S& zX74fO&-2nTtFDvS^3*a}2~;z$V#eYH?pjEZ;w9wemsSH#Y?*o6>_Msb3^5vYecN7# ztFlpU?6oAf4RErLBIUz<(w#r`t*qo#?KulL{>3ZhOT5~#Z9CwQq8zP~A|$^+s^n8A zPXbr&aCI`oXcUhaSC+Zkla1bb@(Ostm6500}sI9XBermelx2ow+?z90WO%^A5VEqJ!++|kGXw{*AX8(D!wBa%oLx|bkPPUmatJ?Dn`rt zO-49=Ev0j|ZEdYKz?`}BUDv&Y4z>(28uh2=YXP*kOHE|kmt7YlGrs_!qVi?{GQ!gm zdZ?ESrL$GykIKuXCd$c`eYkb!YvYa|Xc=NOO1PJyVvTJ}vZ$|bumMU-#rHHcGyw47 z%@gC^|5;MH>sZB%zG6urkYNEdH_Lj}P&r{kj7C~wyxAx@S;A3AM~4lNm6ZiJq0f!Jpo{A}fKrlv%j34Tn$q=KFl&58D1$;qR|cu zAQpnvyq80!>sN;#s+7NIU104poL{_LJrkj zavdvDd_G^y2}{Q<5{V?_U{y?cO}5H0XRdmkuf{9lhIIFrAx0xh*SSk7KLo(?TYm&# z+#AuYPY9AFNlvGdmhb-yX6%@(&E`O1eYk{-QqjoTPV?Zb*zdcmr zcAZyi(eCUt*y}|7l_5qW%kK}ms$`XI)Nw(PXC2A$Aqiy(mGx57FH?}Kx=DTuMZe$Gd)l;#Ax&%;A4X@ TTLza|00000NkvXXu0mjf-l==z literal 0 HcmV?d00001 diff --git a/Items/Weapons/Summon/Vigilance.cs b/Items/Weapons/Summon/Vigilance.cs new file mode 100644 index 0000000000..0dea2dac4b --- /dev/null +++ b/Items/Weapons/Summon/Vigilance.cs @@ -0,0 +1,58 @@ +using CalamityMod.Projectiles.Summon; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Summon +{ + public class SeekerSummon : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Vigilance"); + Tooltip.SetDefault("Summons a soul seeker to fight for you"); + } + + public override void SetDefaults() + { + item.damage = 1000; + item.mana = 12; + item.width = item.height = 32; + item.useTime = item.useAnimation = 10; + item.useStyle = ItemUseStyleID.SwingThrow; + item.noMelee = true; + item.knockBack = 4f; + item.UseSound = SoundID.DD2_BetsySummon; + item.autoReuse = true; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 10f; + item.summon = true; + + item.value = CalamityGlobalItem.RarityVioletBuyPrice; + item.rare = ItemRarityID.Purple; + item.Calamity().customRarity = CalamityRarity.Violet; + } + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + if (player.altFunctionUse != 2) + { + Projectile.NewProjectile(Main.MouseWorld, Vector2.Zero, type, damage, knockBack, player.whoAmI); + + int seekerIndex = 0; + int totalSeekers = CalamityUtils.CountProjectiles(type); + for (int i = 0; i < Main.maxProjectiles; i++) + { + if (Main.projectile[i].type != type || !Main.projectile[i].active || Main.projectile[i].owner != player.whoAmI) + continue; + Main.projectile[i].ai[0] = seekerIndex / (float)totalSeekers; + Main.projectile[i].netUpdate = true; + + seekerIndex++; + } + } + return false; + } + } +} diff --git a/Items/Weapons/Summon/Vigilance.png b/Items/Weapons/Summon/Vigilance.png new file mode 100644 index 0000000000000000000000000000000000000000..cdc748ad3572c65622ed3a78ca92eaf32233b707 GIT binary patch literal 2517 zcmV;`2`cu9P)Px;k4Z#9RCt{2om*@iR~dl6@h$e+8($KqP3zdHU7&THDuSSjhy()2gbITi!0JP# zAR+YyaeIV99tv+fa8n;Z;(=C3sDeZgaY-Z+5+jRLZHXFpiyI3$hjwd4D3?cw3< z@7Z%av+GT5@7d*iFPoX2-5oje?f;*D{&Uu&M2N-W0Q7dp0Ql=`)jq(J2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a/Projectiles/Ranged/CondemnationArrow.cs +++ b/Projectiles/Ranged/CondemnationArrow.cs @@ -52,7 +52,8 @@ namespace CalamityMod.Projectiles.Ranged { Color c1 = new Color(226, 40, 40, 0); Color c2 = new Color(205, 0, 194, 0); - return Color.Lerp(c1, c2, (float)Math.Cos(projectile.identity * 1.41f + Main.GlobalTime * 8f) * 0.5f + 0.5f) * projectile.Opacity; + Color fadeColor = Color.Lerp(c1, c2, (float)Math.Cos(projectile.identity * 1.41f + Main.GlobalTime * 8f) * 0.5f + 0.5f); + return Color.Lerp(lightColor, fadeColor, 0.5f) * projectile.Opacity; } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Rogue/SacrificeProjectile.cs b/Projectiles/Rogue/SacrificeProjectile.cs new file mode 100644 index 0000000000..a91b5cc0b2 --- /dev/null +++ b/Projectiles/Rogue/SacrificeProjectile.cs @@ -0,0 +1,104 @@ +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 SacrificeProjectile : ModProjectile + { + public Player Owner => Main.player[projectile.owner]; + public bool StickingToAnything => projectile.ai[0] == 1f; + public bool ReturningToOwner => projectile.ai[0] == 2f; + public override string Texture => "CalamityMod/Items/Weapons/Rogue/Sacrifice"; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sacrifice"); + ProjectileID.Sets.TrailingMode[projectile.type] = 1; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 8; + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 68; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.penetrate = -1; + projectile.timeLeft = 600; + projectile.Calamity().rogue = true; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 6; + } + + public override void AI() + { + if (ReturningToOwner) + { + projectile.timeLeft = 2; + projectile.velocity = projectile.DirectionTo(Owner.Center) * 24f; + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.Pi + MathHelper.PiOver4; + + // Heal the player and disappear when touching them. + if (projectile.Hitbox.Intersects(Owner.Hitbox)) + { + int healAmount = projectile.Calamity().stealthStrike ? 50 : 4; + + Owner.HealEffect(healAmount); + Owner.statLife += healAmount; + if (Owner.statLife > Owner.statLifeMax2) + Owner.statLife = Owner.statLifeMax2; + + projectile.Kill(); + } + } + else if (!StickingToAnything) + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver4; + else if (!Main.dedServ && projectile.timeLeft % 40f == 39f) + { + for (int i = 0; i < 60; i++) + { + Dust blood = Dust.NewDustPerfect(projectile.Center + Main.rand.NextVector2Circular(50f, 50f), Main.rand.NextBool(2) ? 264 : 5); + blood.velocity = Main.rand.NextVector2Circular(3f, 3f); + blood.noGravity = true; + blood.color = Color.Lerp(Color.Red, Color.DarkRed, Main.rand.NextFloat(0.25f, 1f)); + blood.scale = Main.rand.NextFloat(1f, 1.4f); + } + } + + if (StickingToAnything && projectile.timeLeft > 90) + projectile.timeLeft = 90; + projectile.StickyProjAI(50); + } + + public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) + { + projectile.ModifyHitNPCSticky(15, true); + projectile.velocity *= 0.5f; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type]); + return false; + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height); + Main.PlaySound(SoundID.Dig, projectile.position); + projectile.Kill(); + return false; + } + + public override void Kill(int timeLeft) + { + for (int i = 0; i < 5; i++) + { + int dust = Dust.NewDust(projectile.Center, 1, 1, 33, 0, 0, 0, default, 1.5f); + Main.dust[dust].noGravity = true; + } + } + } +} diff --git a/Projectiles/Summon/BrimstoneDartSummon.cs b/Projectiles/Summon/BrimstoneDartSummon.cs new file mode 100644 index 0000000000..28b1c8615d --- /dev/null +++ b/Projectiles/Summon/BrimstoneDartSummon.cs @@ -0,0 +1,64 @@ +using CalamityMod.Buffs.DamageOverTime; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Summon +{ + public class BrimstoneDartSummon : ModProjectile + { + public override string Texture => "CalamityMod/Projectiles/Boss/BrimstoneBarrage"; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Brimstone Dart"); + Main.projFrames[projectile.type] = 4; + ProjectileID.Sets.MinionShot[projectile.type] = true; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 2; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 24; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.minion = true; + projectile.minionSlots = 0f; + projectile.penetrate = -1; + projectile.timeLeft = 120; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 8; + } + + public override void AI() + { + if (projectile.velocity.Length() < 21f) + projectile.velocity *= 1.02f; + + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; + + projectile.frameCounter++; + if (projectile.frameCounter % 5 == 4) + projectile.frame = (projectile.frame + 1) % Main.projFrames[projectile.type]; + + projectile.Opacity = Utils.InverseLerp(0f, 40f, projectile.timeLeft, true); + + Lighting.AddLight(projectile.Center, 0.75f, 0f, 0f); + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 180); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + lightColor.R = (byte)(255 * projectile.Opacity); + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + } +} diff --git a/Projectiles/Summon/SeekerSummonProj.cs b/Projectiles/Summon/SeekerSummonProj.cs new file mode 100644 index 0000000000..48a7f04a53 --- /dev/null +++ b/Projectiles/Summon/SeekerSummonProj.cs @@ -0,0 +1,140 @@ +using CalamityMod.Buffs.Summon; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Summon +{ + public class SeekerSummonProj : ModProjectile + { + public Player Owner => Main.player[projectile.owner]; + public ref float CircleAngleRatio => ref projectile.ai[0]; + public ref float Time => ref projectile.ai[1]; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Soul Seeker"); + Main.projFrames[projectile.type] = 5; + ProjectileID.Sets.MinionSacrificable[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 84; + projectile.netImportant = true; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.minionSlots = 1f; + projectile.timeLeft = 90000; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.minion = true; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 8; + projectile.alpha = 255; + } + + + public override void AI() + { + if (projectile.localAI[0] == 0f) + { + DoInitializationEffects(); + projectile.localAI[0] = 1f; + } + + ProvidePlayerMinionBuffs(); + DetermineFrames(); + + projectile.alpha = Utils.Clamp(projectile.alpha - 15, 0, 255); + NPC potentialTarget = projectile.Center.MinionHoming(2050f, Owner); + if (potentialTarget is null) + FlyNearOwner(); + else + AttackTarget(potentialTarget); + Time++; + } + + internal void DoInitializationEffects() + { + if (Main.dedServ) + return; + + for (int i = 0; i < 40; i++) + { + Dust brimstoneFire = Dust.NewDustPerfect(projectile.Center + Main.rand.NextVector2Circular(50f, 50f), DustID.Fireworks); + brimstoneFire.velocity = Vector2.UnitY * -Main.rand.NextFloat(2f, 5f); + brimstoneFire.scale = 1f + brimstoneFire.velocity.Length() * 0.1f; + brimstoneFire.color = Color.Lerp(Color.White, Color.OrangeRed, Main.rand.NextFloat()); + brimstoneFire.noGravity = true; + } + } + + internal void ProvidePlayerMinionBuffs() + { + Owner.AddBuff(ModContent.BuffType(), 3600); + + // Verify player/minion state integrity. The minion cannot stay alive if the + // owner is dead or if the caller of the AI is invalid. + if (projectile.type != ModContent.ProjectileType()) + return; + + if (Owner.dead) + Owner.Calamity().soulSeeker = false; + if (Owner.Calamity().soulSeeker) + projectile.timeLeft = 2; + } + + internal void DetermineFrames() + { + projectile.frameCounter++; + if (projectile.frameCounter % 5 == 4) + projectile.frame = (projectile.frame + 1) % Main.projFrames[projectile.type]; + } + + internal void FlyNearOwner() + { + // Make an imp laugh sound every so often. + if (Main.rand.NextBool(1600)) + Main.PlaySound(SoundID.DD2_KoboldFlyerHurt); + + Vector2 destination = Owner.Center + (MathHelper.TwoPi * CircleAngleRatio - MathHelper.PiOver2).ToRotationVector2() * 310f; + projectile.Center = Vector2.Lerp(projectile.Center, destination, 0.03f); + + if (!projectile.WithinRange(destination, 20f)) + projectile.velocity = (projectile.velocity * 20f + projectile.DirectionTo(destination) * 16f) / 21f; + + projectile.spriteDirection = (destination.X - projectile.Center.X > 0f).ToDirectionInt(); + } + + internal void AttackTarget(NPC target) + { + // Slow down and release a bunch of darts at the enemy for a short interval. + if (Time % 90f > 45f) + { + // Make an imp scream sound every so often. + if (Main.rand.NextBool(400)) + Main.PlaySound(SoundID.DD2_KoboldFlyerChargeScream); + + projectile.velocity *= 0.9f; + if (Time % 16f == 15f) + { + Vector2 eyePosition = projectile.Center + new Vector2(projectile.spriteDirection * 22f, -12f); + Vector2 shootVelocity = (target.Center - eyePosition).SafeNormalize(Vector2.UnitX * projectile.spriteDirection) * 14f; + projectile.spriteDirection = (shootVelocity.X > 0f).ToDirectionInt(); + if (Main.netMode != NetmodeID.MultiplayerClient) + { + Projectile.NewProjectile(eyePosition, shootVelocity, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner); + } + } + return; + } + + projectile.spriteDirection = (projectile.velocity.X > 0f).ToDirectionInt(); + if (!projectile.WithinRange(target.Center, 400f)) + projectile.velocity = (projectile.velocity * 10f + projectile.DirectionTo(target.Center) * 22f) / 11f; + else if (projectile.velocity.Length() < 28f) + projectile.velocity = projectile.DirectionTo(target.Center) * 29f; + } + } +} diff --git a/Projectiles/Summon/SeekerSummonProj.png b/Projectiles/Summon/SeekerSummonProj.png new file mode 100644 index 0000000000000000000000000000000000000000..bd3a5924ca1b3036a565056b45c1f0e1bb7af3cb GIT binary patch literal 8180 zcma)hcT^MGzwZDVEEJKWbU1(%m7dU~SrAm32c)+k5K3r*^b!p*26|4#rAs=Tdz?Oss!at;b@Gvwcidp@)Iv9e|6 ziS*W~VIGij7FY~>zVm)`weJ4t5@YY+;*I(~R9!0&mcJVg( zlK2Hl_v@mcgc97Vos+noSf;*2tHAXagee2j_ANbU zp^^xAzb&XspT>5dMx+Dx)BpVBn_{fO8G>sIe&;>em`6UaJ_dxYu>dna#clhK8-(ON zm*(nW;(OV5sn8O&+dTS6nF07@VGP_6FT5?D)&A(6Tm$+u_i#Bb%ud^a5s*BQJn&{! z2&y7C!~(g?^C|UI@#8E!C=j@H1`q!jkO-rUm0_PeknhlAUQST17ijjjV;TP6O4hv&KLhX5Ksh zKy&uNu|9G7@Xs?h)|Uk=1Q?1a4$toUUi(Z^Qou^fMKKkU+C@iC=Q}-2D(K(c)IKURJu0&rhMO+J4Wc@GAzflb#YTg^(AQgXpHY7tf&Y6X2U)^Svi znioLP@caI@d9ZpZrQX%oHZ`ZgQuv}CB<;lnP}-rUE^=Kxmsf77+m+vx^wCa()Shx% z`AIAh0aP@01=)xGigGJ|np%&{;r*v^rN!QOgGa4UHBKID}b3aU^*NDuQIkv+bRtHqTq3#oVU% z6xa>b?9GT4;iBaZT|8%`w|bU(JBtQL9UA&&nFxi(%HBhF-w)T;^4eTM%4c>uAN5WcO^5l-?N7BnI1S8DtotOT zy^FBp^I`T8*Dt_Q^U}RN8b?A8+9g_<^EWs>Ak5+yAugpiZ`F-!^ByuCPKB$Q6cEB# zSZvt<6{VjN*Nrr=tdW|%`kadrkL3fF6Gj+;t>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37af343a3e2ab9db4794453e85fd28ad9b93e1d Mon Sep 17 00:00:00 2001 From: Dominic Date: Tue, 30 Mar 2021 16:21:48 -0500 Subject: [PATCH 069/202] Updated Vigilance dart visuals --- Items/Weapons/Summon/Vigilance.cs | 2 +- Projectiles/Summon/BrimstoneDartSummon.cs | 18 +++++++++++++++++- Projectiles/Summon/SeekerSummonProj.cs | 7 +++++-- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/Items/Weapons/Summon/Vigilance.cs b/Items/Weapons/Summon/Vigilance.cs index 0dea2dac4b..990b520b42 100644 --- a/Items/Weapons/Summon/Vigilance.cs +++ b/Items/Weapons/Summon/Vigilance.cs @@ -6,7 +6,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Summon { - public class SeekerSummon : ModItem + public class Vigilance : ModItem { public override void SetStaticDefaults() { diff --git a/Projectiles/Summon/BrimstoneDartSummon.cs b/Projectiles/Summon/BrimstoneDartSummon.cs index 28b1c8615d..36d5a4fce7 100644 --- a/Projectiles/Summon/BrimstoneDartSummon.cs +++ b/Projectiles/Summon/BrimstoneDartSummon.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -27,7 +28,7 @@ namespace CalamityMod.Projectiles.Summon projectile.tileCollide = false; projectile.minion = true; projectile.minionSlots = 0f; - projectile.penetrate = -1; + projectile.penetrate = 1; projectile.timeLeft = 120; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 8; @@ -54,6 +55,21 @@ namespace CalamityMod.Projectiles.Summon target.AddBuff(ModContent.BuffType(), 180); } + public override void Kill(int timeLeft) + { + if (Main.dedServ) + return; + + for (int i = 0; i < 15; i++) + { + Dust brimstone = Dust.NewDustPerfect(projectile.Center, 267); + brimstone.velocity = projectile.velocity.RotatedByRandom(0.26f) * Main.rand.NextFloat(0.3f, 0.8f); + brimstone.scale = Main.rand.NextFloat(1.5f, 1.85f); + brimstone.color = Color.DarkRed; + brimstone.noGravity = true; + } + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { lightColor.R = (byte)(255 * projectile.Opacity); diff --git a/Projectiles/Summon/SeekerSummonProj.cs b/Projectiles/Summon/SeekerSummonProj.cs index 48a7f04a53..1e5fe713c1 100644 --- a/Projectiles/Summon/SeekerSummonProj.cs +++ b/Projectiles/Summon/SeekerSummonProj.cs @@ -15,7 +15,8 @@ namespace CalamityMod.Projectiles.Summon { DisplayName.SetDefault("Soul Seeker"); Main.projFrames[projectile.type] = 5; - ProjectileID.Sets.MinionSacrificable[projectile.type] = true; + ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; + ProjectileID.Sets.MinionSacrificable[projectile.type] = true; } public override void SetDefaults() @@ -119,8 +120,10 @@ namespace CalamityMod.Projectiles.Summon projectile.velocity *= 0.9f; if (Time % 16f == 15f) { + float shootSpeed = 14f; Vector2 eyePosition = projectile.Center + new Vector2(projectile.spriteDirection * 22f, -12f); - Vector2 shootVelocity = (target.Center - eyePosition).SafeNormalize(Vector2.UnitX * projectile.spriteDirection) * 14f; + Vector2 aheadAim = (target.Center - eyePosition) / target.velocity.Length() / shootSpeed; + Vector2 shootVelocity = (target.Center + aheadAim - eyePosition).SafeNormalize(Vector2.UnitX * projectile.spriteDirection) * shootSpeed; projectile.spriteDirection = (shootVelocity.X > 0f).ToDirectionInt(); if (Main.netMode != NetmodeID.MultiplayerClient) { From a0801e0b6e7ec07c0d89fa5cee3f04c31e63a81a Mon Sep 17 00:00:00 2001 From: Dominic Date: Tue, 30 Mar 2021 19:48:48 -0500 Subject: [PATCH 070/202] Renamed SCal book to Heresy --- Items/Weapons/Magic/{SCalBook.cs => Heresy.cs} | 9 +++++---- Items/Weapons/Magic/{SCalBook.png => Heresy.png} | Bin .../Magic/{SCalBookProj.cs => HeresyProj.cs} | 4 ++-- .../Magic/{SCalBookProj.png => HeresyProj.png} | Bin 4 files changed, 7 insertions(+), 6 deletions(-) rename Items/Weapons/Magic/{SCalBook.cs => Heresy.cs} (79%) rename Items/Weapons/Magic/{SCalBook.png => Heresy.png} (100%) rename Projectiles/Magic/{SCalBookProj.cs => HeresyProj.cs} (98%) rename Projectiles/Magic/{SCalBookProj.png => HeresyProj.png} (100%) diff --git a/Items/Weapons/Magic/SCalBook.cs b/Items/Weapons/Magic/Heresy.cs similarity index 79% rename from Items/Weapons/Magic/SCalBook.cs rename to Items/Weapons/Magic/Heresy.cs index 6c9d6bb53b..87ed76df7f 100644 --- a/Items/Weapons/Magic/SCalBook.cs +++ b/Items/Weapons/Magic/Heresy.cs @@ -6,12 +6,13 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Magic { - public class SCalBook : ModItem + public class Heresy : ModItem { public override void SetStaticDefaults() { - DisplayName.SetDefault("Some Edgy Word idk"); - Tooltip.SetDefault("yes"); + DisplayName.SetDefault("Heresy"); + Tooltip.SetDefault("Releases fire and souls upward from a held book\n" + + "As the book is held the power of both increases"); Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 6)); } @@ -33,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Magic item.autoReuse = true; item.noUseGraphic = true; - item.shoot = ModContent.ProjectileType(); + item.shoot = ModContent.ProjectileType(); item.channel = true; item.shootSpeed = 0f; } diff --git a/Items/Weapons/Magic/SCalBook.png b/Items/Weapons/Magic/Heresy.png similarity index 100% rename from Items/Weapons/Magic/SCalBook.png rename to Items/Weapons/Magic/Heresy.png diff --git a/Projectiles/Magic/SCalBookProj.cs b/Projectiles/Magic/HeresyProj.cs similarity index 98% rename from Projectiles/Magic/SCalBookProj.cs rename to Projectiles/Magic/HeresyProj.cs index 6fa130a5bd..89a71ba3fd 100644 --- a/Projectiles/Magic/SCalBookProj.cs +++ b/Projectiles/Magic/HeresyProj.cs @@ -8,7 +8,7 @@ using Terraria.Utilities; namespace CalamityMod.Projectiles.Magic { - public class SCalBookProj : ModProjectile + public class HeresyProj : ModProjectile { public Player Owner => Main.player[projectile.owner]; public float ShootIntensity => MathHelper.SmoothStep(0f, 1f, Utils.InverseLerp(0f, 275f, Time, true)); @@ -16,7 +16,7 @@ namespace CalamityMod.Projectiles.Magic public ref float AttackTimer => ref projectile.ai[1]; public override void SetStaticDefaults() { - DisplayName.SetDefault("Eternity"); + DisplayName.SetDefault("Heresy"); Main.projFrames[projectile.type] = 8; } diff --git a/Projectiles/Magic/SCalBookProj.png b/Projectiles/Magic/HeresyProj.png similarity index 100% rename from Projectiles/Magic/SCalBookProj.png rename to Projectiles/Magic/HeresyProj.png From bfe1c7189e32f94b68ddd281153b1e943f76bbf4 Mon Sep 17 00:00:00 2001 From: Dominic Date: Tue, 30 Mar 2021 19:49:37 -0500 Subject: [PATCH 071/202] Added Heresy to Eternity's recipe --- Items/Weapons/Magic/Eternity.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Items/Weapons/Magic/Eternity.cs b/Items/Weapons/Magic/Eternity.cs index 68c32d5a28..17b9d78fc9 100644 --- a/Items/Weapons/Magic/Eternity.cs +++ b/Items/Weapons/Magic/Eternity.cs @@ -64,6 +64,7 @@ namespace CalamityMod.Items.Weapons.Magic recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType(), 20); recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddIngredient(ItemID.UnicornHorn, 5); From ac6e3efd287466f70bb5d2971a15ac28432fdbc3 Mon Sep 17 00:00:00 2001 From: Dominic Date: Thu, 1 Apr 2021 15:42:59 -0500 Subject: [PATCH 072/202] Added Perdition and Calamity --- Buffs/DamageOverTime/VulnerabilityHex.cs | 8 ++ Buffs/Summon/PerditionBuff.cs | 36 +++++ Buffs/Summon/PerditionBuff.png | Bin 0 -> 489 bytes CalPlayer/CalamityPlayer.cs | 21 ++- CalPlayer/CalamityPlayerMiscEffects.cs | 48 +++++++ Effects/CalamityShaders.cs | 3 + Effects/SCalMouseShader.fx | 31 ++++ Effects/SCalMouseShader.xnb | Bin 0 -> 2440 bytes ExtraTextures/CalamityAura.png | Bin 0 -> 2865 bytes ILEditing/ILChanges.cs | 103 ++++++++++++++ Items/Accessories/Calamity.cs | 39 +++++ Items/Accessories/Calamity.png | Bin 0 -> 2548 bytes Items/Weapons/Summon/Perdition.cs | 58 ++++++++ Items/Weapons/Summon/Perdition.png | Bin 0 -> 1860 bytes NPCs/CalamityGlobalNPC.cs | 18 ++- Projectiles/Summon/LostSoulGiant.cs | 110 +++++++++++++++ Projectiles/Summon/LostSoulGiant.png | Bin 0 -> 2432 bytes Projectiles/Summon/LostSoulGold.cs | 81 +++++++++++ Projectiles/Summon/LostSoulGold.png | Bin 0 -> 2119 bytes Projectiles/Summon/LostSoulLarge.cs | 82 +++++++++++ Projectiles/Summon/LostSoulLarge.png | Bin 0 -> 3608 bytes Projectiles/Summon/LostSoulSmall.cs | 81 +++++++++++ Projectiles/Summon/LostSoulSmall.png | Bin 0 -> 2015 bytes Projectiles/Summon/PerditionBeacon.cs | 172 +++++++++++++++++++++++ Projectiles/Summon/PerditionBeacon.png | Bin 0 -> 8559 bytes Projectiles/Summon/PerditionCross.png | Bin 0 -> 525 bytes 26 files changed, 881 insertions(+), 10 deletions(-) create mode 100644 Buffs/Summon/PerditionBuff.cs create mode 100644 Buffs/Summon/PerditionBuff.png create mode 100644 Effects/SCalMouseShader.fx create mode 100644 Effects/SCalMouseShader.xnb create mode 100644 ExtraTextures/CalamityAura.png create mode 100644 Items/Accessories/Calamity.cs create mode 100644 Items/Accessories/Calamity.png create mode 100644 Items/Weapons/Summon/Perdition.cs create mode 100644 Items/Weapons/Summon/Perdition.png create mode 100644 Projectiles/Summon/LostSoulGiant.cs create mode 100644 Projectiles/Summon/LostSoulGiant.png create mode 100644 Projectiles/Summon/LostSoulGold.cs create mode 100644 Projectiles/Summon/LostSoulGold.png create mode 100644 Projectiles/Summon/LostSoulLarge.cs create mode 100644 Projectiles/Summon/LostSoulLarge.png create mode 100644 Projectiles/Summon/LostSoulSmall.cs create mode 100644 Projectiles/Summon/LostSoulSmall.png create mode 100644 Projectiles/Summon/PerditionBeacon.cs create mode 100644 Projectiles/Summon/PerditionBeacon.png create mode 100644 Projectiles/Summon/PerditionCross.png diff --git a/Buffs/DamageOverTime/VulnerabilityHex.cs b/Buffs/DamageOverTime/VulnerabilityHex.cs index 17b1addd7e..005efdf936 100644 --- a/Buffs/DamageOverTime/VulnerabilityHex.cs +++ b/Buffs/DamageOverTime/VulnerabilityHex.cs @@ -20,5 +20,13 @@ namespace CalamityMod.Buffs.DamageOverTime { player.Calamity().vHex = true; } + + public override void Update(NPC npc, ref int buffIndex) + { + if (npc.Calamity().vulnerabilityHex < npc.buffTime[buffIndex]) + npc.Calamity().vulnerabilityHex = npc.buffTime[buffIndex]; + npc.DelBuff(buffIndex); + buffIndex--; + } } } diff --git a/Buffs/Summon/PerditionBuff.cs b/Buffs/Summon/PerditionBuff.cs new file mode 100644 index 0000000000..1773a82e3e --- /dev/null +++ b/Buffs/Summon/PerditionBuff.cs @@ -0,0 +1,36 @@ +using CalamityMod.CalPlayer; +using CalamityMod.Projectiles.Summon; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.Summon +{ + public class PerditionBuff : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Perdition"); + Description.SetDefault("How unfortunate"); + Main.buffNoTimeDisplay[Type] = true; + Main.buffNoSave[Type] = true; + //Main.persistentBuff[Type] = true; + } + + public override void Update(Player player, ref int buffIndex) + { + CalamityPlayer modPlayer = player.Calamity(); + if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) + modPlayer.perditionBeacon = true; + + if (!modPlayer.perditionBeacon) + { + player.DelBuff(buffIndex); + buffIndex--; + } + else + { + player.buffTime[buffIndex] = 18000; + } + } + } +} diff --git a/Buffs/Summon/PerditionBuff.png b/Buffs/Summon/PerditionBuff.png new file mode 100644 index 0000000000000000000000000000000000000000..256653f0de59cd04bf4ed7c574884bd78359849a GIT binary patch literal 489 zcmVPx$qe(|yw&S%ZsPpd<~Q7R8WnG^uU z{u%()ZhflZ$FU3m71JWRbOJ`mK9AQ?ccy-h#KBGE+p|B{Y zF5bL9xb!0+&abksR-w8B%zy4>p8MJ!Fit`r0;+R);zFklz#tw2Al&I%Z98+3Q&;Xw z1`?k0VpCww{YU0P+u609vi~pA#mNR_0Ha zHG5pb)i3Lm?6y7xMCv&e=i=z_?7-Fkd2$DUd3$bGYOZm9Z$Qz~2^iVkeE?oQ1`GW= fKH3cH@pt?S{JoA3A1bhX00000NkvXXu0mjfwx!l2 literal 0 HcmV?d00001 diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index bdc186a2f5..036f321168 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -111,6 +111,9 @@ namespace CalamityMod.CalPlayer public int defenseDamage = 0; public float rangedAmmoCost = 1f; public bool heldGaelsLastFrame = false; + public bool blazingMouseDamageEffects = false; + public bool ableToDrawBlazingMouse = false; + public float blazingMouseAuraFade = 0f; #endregion #region Tile Entity Trackers @@ -927,6 +930,7 @@ namespace CalamityMod.CalPlayer public bool fleshBall = false; public bool eyeOfNight = false; public bool soulSeeker = false; + public bool perditionBeacon = false; public List PendingProjectilesToRespawn = new List(); @@ -1496,6 +1500,8 @@ namespace CalamityMod.CalPlayer noWings = false; blockAllDashes = false; + blazingMouseDamageEffects = false; + ableToDrawBlazingMouse = false; luxorsGift = false; fungalSymbiote = false; @@ -1965,6 +1971,7 @@ namespace CalamityMod.CalPlayer fleshBall = false; eyeOfNight = false; soulSeeker = false; + perditionBeacon = false; abyssalDivingSuitPrevious = abyssalDivingSuit; abyssalDivingSuit = abyssalDivingSuitHide = abyssalDivingSuitForce = abyssalDivingSuitPower = false; @@ -5581,8 +5588,11 @@ namespace CalamityMod.CalPlayer int damageToDefense = (int)(newDamage * defenseStatDamageMult); defenseDamage += damageToDefense; - if (hurtSoundTimer == 0) - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/DefenseDamage"), (int)player.position.X, (int)player.position.Y); + if (hurtSoundTimer == 0) + { + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/DefenseDamage"), (int)player.position.X, (int)player.position.Y); + hurtSoundTimer = 30; + } string text = (-damageToDefense).ToString(); Color messageColor = Color.LightGray; @@ -6017,8 +6027,11 @@ namespace CalamityMod.CalPlayer int damageToDefense = (int)(newDamage * defenseStatDamageMult); defenseDamage += damageToDefense; - if (hurtSoundTimer == 0) - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/DefenseDamage"), (int)player.position.X, (int)player.position.Y); + if (hurtSoundTimer == 0) + { + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/DefenseDamage"), (int)player.position.X, (int)player.position.Y); + hurtSoundTimer = 30; + } string text = (-damageToDefense).ToString(); Color messageColor = Color.LightGray; // Light Gray text because it's visible and defense icon is gray in the UI diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index f357246bb4..889f95459e 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -82,6 +82,10 @@ namespace CalamityMod.CalPlayer player.AddBuff(ModContent.BuffType(), 2, false); } + // Hurt the nearest NPC to the mouse if using the burning mouse. + if (modPlayer.blazingMouseDamageEffects) + HandleBlazingMouseEffects(player, modPlayer); + // Revengeance effects RevengeanceModeMiscEffects(player, modPlayer, mod); @@ -481,8 +485,52 @@ namespace CalamityMod.CalPlayer #endregion #region Misc Effects + + private static void HandleBlazingMouseEffects(Player player, CalamityPlayer modPlayer) + { + Rectangle auraRectangle = Utils.CenteredRectangle(Main.MouseWorld, new Vector2(35f, 62f)); + modPlayer.blazingMouseAuraFade = MathHelper.Clamp(modPlayer.blazingMouseAuraFade - 0.025f, 0.25f, 1f); + for (int i = 0; i < Main.maxNPCs; i++) + { + if (!Main.npc[i].CanBeChasedBy() || !Main.npc[i].Hitbox.Intersects(auraRectangle) || !Main.rand.NextBool(2)) + continue; + + harmNPC(Main.npc[i]); + modPlayer.blazingMouseAuraFade = MathHelper.Clamp(modPlayer.blazingMouseAuraFade + 0.15f, 0.25f, 1f); + } + + void harmNPC(NPC npc) + { + int damage = (int)(player.AverageDamage() * Main.rand.Next(1950, 2050)); + npc.StrikeNPC(damage, 0f, 0); + + player.addDPS(damage); + npc.AddBuff(ModContent.BuffType(), 900); + + for (int i = 0; i < 4; i++) + { + Dust fire = Dust.NewDustDirect(npc.position, npc.width, npc.height, 267); + fire.velocity = Vector2.UnitY * -Main.rand.NextFloat(2f, 3.45f); + fire.scale = 1f + fire.velocity.Length() / 6f; + fire.color = Color.Lerp(Color.Orange, Color.Red, Main.rand.NextFloat(0.85f)); + fire.noGravity = true; + } + } + } + private static void MiscEffects(Player player, CalamityPlayer modPlayer, Mod mod) { + // Do a vanity/social slot check for SCal's expert drop since alternatives to get this working are a pain in the ass to create. + int blazingMouseItem = ModContent.ItemType(); + for (int i = 13; i < 18 + player.extraAccessorySlots; i++) + { + if (player.armor[i].type == blazingMouseItem) + { + modPlayer.ableToDrawBlazingMouse = true; + break; + } + } + // Dust on hand when holding the phosphorescent gauntlet. if (player.ActiveItem().type == ModContent.ItemType()) PhosphorescentGauntletPunches.GenerateDustOnOwnerHand(player); diff --git a/Effects/CalamityShaders.cs b/Effects/CalamityShaders.cs index 43d9e7a4c4..10c2bc2645 100644 --- a/Effects/CalamityShaders.cs +++ b/Effects/CalamityShaders.cs @@ -10,6 +10,7 @@ namespace CalamityMod.Effects { public static Effect AstralFogShader; public static Effect LightShader; + public static Effect SCalMouseShader; public static Effect TentacleShader; public static Effect LightDistortionShader; public static Effect PhaseslayerRipShader; @@ -25,6 +26,7 @@ namespace CalamityMod.Effects AstralFogShader = CalamityMod.Instance.GetEffect("Effects/CustomShader"); LightShader = CalamityMod.Instance.GetEffect("Effects/LightBurstShader"); TentacleShader = CalamityMod.Instance.GetEffect("Effects/TentacleShader"); + SCalMouseShader = CalamityMod.Instance.GetEffect("Effects/SCalMouseShader"); LightDistortionShader = CalamityMod.Instance.GetEffect("Effects/DistortionShader"); PhaseslayerRipShader = CalamityMod.Instance.GetEffect("Effects/PhaseslayerRipShader"); ScarletDevilShader = CalamityMod.Instance.GetEffect("Effects/ScarletDevilStreak"); @@ -37,6 +39,7 @@ namespace CalamityMod.Effects Filters.Scene["CalamityMod:LightBurst"] = new Filter(new ScreenShaderData(new Ref(LightShader), "BurstPass"), EffectPriority.VeryHigh); Filters.Scene["CalamityMod:LightBurst"].Load(); + GameShaders.Misc["CalamityMod:FireMouse"] = new MiscShaderData(new Ref(SCalMouseShader), "DyePass"); GameShaders.Misc["CalamityMod:SubsumingTentacle"] = new MiscShaderData(new Ref(TentacleShader), "BurstPass"); GameShaders.Misc["CalamityMod:LightDistortion"] = new MiscShaderData(new Ref(LightDistortionShader), "DistortionPass"); GameShaders.Misc["CalamityMod:PhaseslayerRipEffect"] = new MiscShaderData(new Ref(PhaseslayerRipShader), "TrailPass"); diff --git a/Effects/SCalMouseShader.fx b/Effects/SCalMouseShader.fx new file mode 100644 index 0000000000..07151bc3b6 --- /dev/null +++ b/Effects/SCalMouseShader.fx @@ -0,0 +1,31 @@ +sampler uImage0 : register(s0); +sampler uImage1 : register(s1); +float3 uColor; +float3 uSecondaryColor; +float uOpacity; +float uSaturation; +float uRotation; +float uTime; +float4 uSourceRect; +float2 uWorldPosition; +float uDirection; +float3 uLightSource; +float2 uImageSize0; +float2 uImageSize1; + +float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0 +{ + float fadeInterpolant = cos(coords.y * coords.x * 6.283 - uTime * 13.1) * 0.5 + 0.5; + + float4 fadeColor = float4(lerp(uColor, uSecondaryColor, fadeInterpolant), 1); + float4 color = tex2D(uImage0, coords) * fadeColor; + color *= 1 + fadeInterpolant * 0.5; + return color; +} +technique Technique1 +{ + pass DyePass + { + PixelShader = compile ps_2_0 PixelShaderFunction(); + } +} \ No newline at end of file diff --git a/Effects/SCalMouseShader.xnb b/Effects/SCalMouseShader.xnb new file mode 100644 index 0000000000000000000000000000000000000000..a6f0b32b7ffdb77147deccd67a2dc8781e35bfe5 GIT binary patch literal 2440 zcmcIlO=ufe5T2DRN2!&_&`S=6E`dTCjF1(($i%Ky%W-R}wyGqjIuw$PypER0T6MKc z;*x`)J-D=ol(e@Tw$MY6E;{rNYDy@*7fT5L&>3+UbOjUci-k=YzT#pn0?>O z`{uowdC$-F_f~Hvl)aNg%2&#}M#D0@=C+-wx3$c=rS0f9P3uOcXtr&=ZD%fRZ|e=a zqH9~aHLD)Se#_E2O{3ABRWIvS*D%}5^O-FFX4Rt8vK>obZtIS1X{}kc>|ARZjd%3j znt4NSFX!iTjqUt3eQrx%$Sy2gAQt7XB+(yJPxq&NGx#Vcz41S>0KbG`0y-0z(HCLl zZ0u;)^(+ZaA({=qbIu&a;ZmTs#1THpMJHf5MYCmE6vf<^2uHSA?doN%+a<26rZ<{x<6}pkBRUP6YvvfbK7zKO!TH9b_aS@(1`1{Z1?dP8Z_os#z~f&ao$i&~l`KW?sCusQn)-IB zT2iY`eqz<4xzjOP0E?O2>zT!cTqc*FpQo{Rm&%n(RV7wmAA3ttJ-=XC_HmwmJqoEm z1J|KkBky|^+JW|>>GP$saV>mO-B*`AGqMl`NDBKa4zfhQZcwsWmn|MV=@fl8d4$VtIHCn z>FJ|t~U&T7O_x>6Q8o85D!9$<0PTyaL_m0sC@PhdOQ!hp%)+mPe31U1qh)Kfs XT&^Xo&5sc_^HDGFA43m(%xCZn>%u`J literal 0 HcmV?d00001 diff --git a/ExtraTextures/CalamityAura.png b/ExtraTextures/CalamityAura.png new file mode 100644 index 0000000000000000000000000000000000000000..fddcf00e77aa60506a75a57c2a50ed002edda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Z7dX=dYALxTq7CY!xXAvO+nG{)}~qn>T#I8r z`k`IeBGI9HN_1tiMA41pdA-g)bp?yZfoTrf)IZ(PxN}19r~b&X)d*SY;`|~3_<0{E z&Zh{rFwnT=&L^0w!W!Z>gGia)AE@UE)=~--Dn&Tlm0?0~P@(e4wdQW~*~&XnAKEP^ zkur0GNn#X|6?(@GG5(Goe^uB0c0eizJ#r|{rvvvQ3Q11z9)Rr-;>GRHSRc0XCARJ4z#Gg=0;}>{4t!g6%=R@B+v<^aoqJE*i9Mf> zI4B<#3G4&$g|O{kF#m(%^2|k!>z*5$1+||+NHq6JC%`@rq+03(3agD%;pp%L_#-{8 z2k& zcFiKIV76bV%?(-0S-%wOl9TJjpCrkZ>}1p-(`%9grOOq@a>6P9B)61+FEP_7GF^@> zlcH+jjN-^w`J3BlA&9ZwXW*l3-NT8@tzP%}b!vSsAnSDDSxy#K8JVoAMZxALmUDB< zW)UmhSAI##8mnWB>b@P3sqQ1wGi)0QNzU(F5FL@xWhy5GtrrNVdBb&iQ4WFGyggL) zPsRuhC)V444OS-7DHU}ax#|%_Ts1>e9lOee1^w|veMPVuQ@kW-s&dGH-c5V8&ty_i z|3`rQ7ns$0o$`(J5FmWIER?lMTShiQRa;P7n+{k;mrHu)A>)njj1R#Ns_{IQ^>3pP BNWcI9 literal 0 HcmV?d00001 diff --git a/ILEditing/ILChanges.cs b/ILEditing/ILChanges.cs index 4b29fd9965..14538d01dc 100644 --- a/ILEditing/ILChanges.cs +++ b/ILEditing/ILChanges.cs @@ -3,14 +3,18 @@ using CalamityMod.NPCs; using CalamityMod.Tiles.DraedonStructures; using CalamityMod.World; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Mono.Cecil.Cil; using MonoMod.Cil; using System; using System.Collections.Generic; using System.Reflection; using Terraria; +using Terraria.GameInput; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; +using Terraria.UI.Gamepad; using Terraria.Utilities; using Terraria.World.Generation; @@ -68,6 +72,7 @@ namespace CalamityMod.ILEditing AlterTownNPCSpawnRate(); DisableDemonAltarGeneration(); FixSplittingWormBannerDrops(); + UseCoolFireCursorEffect(); } /// @@ -421,6 +426,104 @@ namespace CalamityMod.ILEditing // If it's anything else, let vanilla and/or TML handle it. return orig(i, j, forced); } + + private static void UseCoolFireCursorEffect() + { + On.Terraria.Main.DrawCursor += (orig, bonus, smart) => + { + // Do nothing special if the player has a regular mouse or is on the menu. + if (Main.gameMenu || !Main.LocalPlayer.Calamity().ableToDrawBlazingMouse) + { + orig(bonus, smart); + return; + } + + if (Main.LocalPlayer.dead) + { + Main.SmartInteractShowingGenuine = false; + Main.SmartInteractShowingFake = false; + Main.SmartInteractNPC = -1; + Main.SmartInteractNPCsNearby.Clear(); + Main.SmartInteractTileCoords.Clear(); + Main.SmartInteractTileCoordsSelected.Clear(); + Main.TileInteractionLX = (Main.TileInteractionHX = (Main.TileInteractionLY = (Main.TileInteractionHY = -1))); + } + + Color flameColor = Color.Lerp(Color.DarkRed, Color.OrangeRed, (float)Math.Cos(Main.GlobalTime * 7.4f) * 0.5f + 0.5f); + Color cursorColor = flameColor * 1.9f; + Vector2 baseDrawPosition = Main.MouseScreen + bonus; + + // Draw the mouse as usual if the player isn't using the gamepad. + if (!PlayerInput.UsingGamepad) + { + int cursorIndex = smart.ToInt(); + + Color desaturatedCursorColor = cursorColor; + desaturatedCursorColor.R /= 5; + desaturatedCursorColor.G /= 5; + desaturatedCursorColor.B /= 5; + desaturatedCursorColor.A /= 2; + + Vector2 drawPosition = baseDrawPosition; + Vector2 desaturatedDrawPosition = drawPosition + Vector2.One; + + // If the blazing mouse is actually going to do damage, draw an indicator aura. + if (Main.LocalPlayer.Calamity().blazingMouseDamageEffects && !Main.mapFullscreen) + { + Texture2D auraTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/CalamityAura"); + Rectangle auraFrame = auraTexture.Frame(1, 6, 0, (int)(Main.GlobalTime * 12.3f) % 6); + float auraScale = MathHelper.Lerp(0.95f, 1f, (float)Math.Sin(Main.GlobalTime * 1.1f) * 0.5f + 0.5f); + + for (int i = 0; i < 12; i++) + { + Color auraColor = Color.Orange * Main.LocalPlayer.Calamity().blazingMouseAuraFade * 0.125f; + auraColor.A = 0; + Vector2 offsetDrawPosition = baseDrawPosition + (MathHelper.TwoPi * i / 12f + Main.GlobalTime * 5f).ToRotationVector2() * 2.5f; + offsetDrawPosition.Y -= 18f; + + Main.spriteBatch.Draw(auraTexture, offsetDrawPosition, auraFrame, auraColor, 0f, auraFrame.Size() * 0.5f, Main.cursorScale * auraScale, SpriteEffects.None, 0f); + } + } + + Main.spriteBatch.Draw(Main.cursorTextures[cursorIndex], drawPosition, null, desaturatedCursorColor, 0f, Vector2.Zero, Main.cursorScale, SpriteEffects.None, 0f); + + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.instance.Rasterizer, null, Main.GameViewMatrix.EffectMatrix); + GameShaders.Misc["CalamityMod:FireMouse"].UseColor(Color.Red); + GameShaders.Misc["CalamityMod:FireMouse"].UseSecondaryColor(Color.Lerp(Color.Red, Color.Orange, 0.75f)); + GameShaders.Misc["CalamityMod:FireMouse"].Apply(); + + Main.spriteBatch.Draw(Main.cursorTextures[cursorIndex], desaturatedDrawPosition, null, cursorColor, 0f, Vector2.Zero, Main.cursorScale * 1.075f, SpriteEffects.None, 0f); + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.instance.Rasterizer, null, Main.GameViewMatrix.EffectMatrix); + return; + } + + // Don't bother doing any more drawing if the player is dead. + if (Main.LocalPlayer.dead && !Main.LocalPlayer.ghost && !Main.gameMenu) + return; + + if (PlayerInput.InvisibleGamepadInMenus) + return; + + // Draw a white circle instead if using the smart cursor. + if (smart && !(UILinkPointNavigator.Available && !PlayerInput.InBuildingMode)) + { + cursorColor = Color.White * Main.GamepadCursorAlpha; + int frameX = 0; + Texture2D smartCursorTexture = Main.cursorTextures[13]; + Rectangle frame = smartCursorTexture.Frame(2, 1, frameX, 0); + Main.spriteBatch.Draw(smartCursorTexture, baseDrawPosition, frame, cursorColor, 0f, frame.Size() * 0.5f, Main.cursorScale, SpriteEffects.None, 0f); + return; + } + + // Otherwise draw an ordinary crosshair at the mouse position. + cursorColor = Color.White; + Texture2D crosshairTexture = Main.cursorTextures[15]; + Main.spriteBatch.Draw(crosshairTexture, baseDrawPosition, null, cursorColor, 0f, crosshairTexture.Size() * 0.5f, Main.cursorScale, SpriteEffects.None, 0f); + }; + } + #endregion #region Helper Functions diff --git a/Items/Accessories/Calamity.cs b/Items/Accessories/Calamity.cs new file mode 100644 index 0000000000..d96bc93ed9 --- /dev/null +++ b/Items/Accessories/Calamity.cs @@ -0,0 +1,39 @@ +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Accessories +{ + public class Calamity : ModItem + { + public const float MaxNPCSpeed = 5f; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Calamity"); + Tooltip.SetDefault("Lights your mouse ablaze with a brimstone fire and causes a flaming aura to appear around it\n" + + "Enemies near the aura take immense damage and are inflicted with Vulnerability Hex\n" + + "The mouse fire effect can be shown without the aura and damage effects by putting this item in a vanity slot"); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 4)); + } + + public override void SetDefaults() + { + item.width = 44; + item.height = 108; + item.rare = ItemRarityID.Purple; + item.value = CalamityGlobalItem.RarityVioletBuyPrice; + item.expert = true; + item.vanity = true; + item.accessory = true; + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.Calamity().blazingMouseDamageEffects = true; + player.Calamity().ableToDrawBlazingMouse = true; + } + + public override void UpdateEquip(Player player) => player.Calamity().ableToDrawBlazingMouse = true; + } +} diff --git a/Items/Accessories/Calamity.png b/Items/Accessories/Calamity.png new file mode 100644 index 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0cykU!4o)3ngeY8=KpUv%BK!qU z(dSp6_(zZaHj$-va|5$wJzRG}`PcIvfw~Ig>5=sM-R89cM?4PJqh1foEIG0ycQ&t& z#vgc@c~B@6ZqBo^-jPe%JDc<}NOoi15f^z|Yi0q$c!H?4(*5HOUn;spUJPZ=)w#?= z*~cY}JRmwOzss{a_JGZ+*(AXf4JWDdcPt!mw578xQnw<*X+`KNkY)1s2k9>wtz($9 z*Yfxu!)X`xnpSe%qG*1a&GU12$0DT$oz{12G`yTkVO2(D;K%eA)4f%Fry{HjW19V< zOD5(LU=KYCcCTIXnt9)sc|*bdu4_U^>KtX9v1h!@3Bny;If|DODsY?5gSi$9YMw0) zv+lHP&+Kkf3;tT1whfRqB(hp_^W+m@I)|7QpJt{;9u(iHcPofqJ=+)fBI`PYdU_6Zh~A5^afqce+xtryQ<7w|{%PeS%* z+)2weOHe z{KoAznR#vGoAhHZ+a6(ymFHkT#KCfCfnK4He_`DGA%~N)#E{x`+Alx2TcsH`m;%SH zpD8=b*qdc3{zuQx@o%{_c(); + item.shootSpeed = 10f; + item.summon = true; + item.sentry = true; + + item.value = CalamityGlobalItem.RarityVioletBuyPrice; + item.rare = ItemRarityID.Purple; + item.Calamity().customRarity = CalamityRarity.Violet; + } + + public override bool AltFunctionUse(Player player) => true; + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + if (player.altFunctionUse != 2) + { + Projectile.NewProjectile(Main.MouseWorld, Vector2.Zero, type, damage, knockBack, player.whoAmI); + player.UpdateMaxTurrets(); + } + else + { + // Play some demonic noises prior to a target being selected. + Main.PlaySound(SoundID.Zombie, player.Center, 93); + Main.PlaySound(SoundID.Item119, player.Center); + } + return false; + } + } +} diff --git a/Items/Weapons/Summon/Perdition.png b/Items/Weapons/Summon/Perdition.png new file mode 100644 index 0000000000000000000000000000000000000000..84db27a9984357b78368553df79b32040aa28178 GIT binary patch literal 1860 zcmV-K2fO%*P)Px*{z*hZRC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2)!9=*gMR4Du3zt|OjY)j(4ftN1yZ4;(=z-kDTx`|^Cf#q zXwVPGandj{zO$L?>?xr^n@B{S#U2=t=RIkxtTL(dOmqH)fBElrP($2 z{9Q8Rx^}zV$=2-Y>=5p}VkA=R0GvFT<0G9Qg=bK+XQNNivt1VU_ZD8+;u$TxFJ;Tcqhd(ADfXlZUTwm-B=p0CN*-cu<&gRzTy9DqgZqiKMn zJNu389lKxV*`@4%gV*vwiffb&U_>A z28%DbP)bhQoXzPWc{c4}XBz-NxXXMe_y&LZL*^K?GSSQ_4Ril?0Gc|zzg3p+1m58A zAGjge&W2=rMuX`UQKnZ!&+9?ulE51*UbVQ_0a&r6CJk`t*ed`;ziR|WYEsVQ|6t1{ y!8f@3h&-vZ`lc%!fJ-mh=ocNx% literal 0 HcmV?d00001 diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 21af0d3e0f..a1b0defd74 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -4,6 +4,8 @@ using CalamityMod.Buffs.StatDebuffs; using CalamityMod.CalPlayer; using CalamityMod.Dusts; using CalamityMod.Events; +using CalamityMod.Items; +using CalamityMod.Items.Accessories; using CalamityMod.Items.Weapons.Melee; using CalamityMod.NPCs.Abyss; using CalamityMod.NPCs.AcidRain; @@ -149,6 +151,7 @@ namespace CalamityMod.NPCs public int GaussFluxTimer = 0; public int sagePoisonTime = 0; public int sagePoisonDamage = 0; + public int vulnerabilityHex = 0; // whoAmI Variables public static int[] bobbitWormBottom = new int[5]; @@ -951,6 +954,7 @@ namespace CalamityMod.NPCs ApplyDPSDebuff(dFlames, 2500, 500, ref npc.lifeRegen, ref damage); ApplyDPSDebuff(bBlood, 50, 10, ref npc.lifeRegen, ref damage); ApplyDPSDebuff(kamiFlu, 250, 25, ref npc.lifeRegen, ref damage); + ApplyDPSDebuff(vulnerabilityHex, 44440, 4444, ref npc.lifeRegen, ref damage); ApplyDPSDebuff(sulphurPoison, 180, 36, ref npc.lifeRegen, ref damage); ApplyDPSDebuff(sagePoisonTime, 90, npc.Calamity().sagePoisonDamage, ref npc.lifeRegen, ref damage); @@ -1088,9 +1092,9 @@ namespace CalamityMod.NPCs // Nothing should be immune to Enraged. npc.buffImmune[BuffType()] = false; - // Extra Notes: - // Shellfish minions set debuff immunity to Shellfish Claps on enemy hits, so most things are technically not immune. - // The Spiteful Candle sets the debuff immunity of Spite to all nearby enemies in the tile file for an enemy with less than 99% DR. + // Extra Notes: + // Shellfish minions set debuff immunity to Shellfish Claps on enemy hits, so most things are technically not immune. + // The Spiteful Candle sets the debuff immunity of Spite to all nearby enemies in the tile file for an enemy with less than 99% DR. } #endregion @@ -3259,17 +3263,19 @@ namespace CalamityMod.NPCs GaussFluxTimer--; if (ladHearts > 0) ladHearts--; + if (vulnerabilityHex > 0) + vulnerabilityHex--; // Bosses and any specific other NPCs are completely immune to having their movement impaired. if (npc.boss || CalamityLists.movementImpairImmuneList.Contains(npc.type)) return; if (kamiFlu > 0) - { npc.velocity = Vector2.Clamp(npc.velocity, new Vector2(-KamiDebuff.MaxNPCSpeed), new Vector2(KamiDebuff.MaxNPCSpeed)); - } + if (vulnerabilityHex > 0) + npc.velocity = Vector2.Clamp(npc.velocity, new Vector2(-Calamity.MaxNPCSpeed), new Vector2(Calamity.MaxNPCSpeed, 10f)); - if (!CalamityPlayer.areThereAnyDamnBosses && !CalamityLists.enemyImmunityList.Contains(npc.type)) + if (!CalamityPlayer.areThereAnyDamnBosses && !CalamityLists.enemyImmunityList.Contains(npc.type)) { if (pearlAura > 0) npc.velocity *= 0.9f; diff --git a/Projectiles/Summon/LostSoulGiant.cs b/Projectiles/Summon/LostSoulGiant.cs new file mode 100644 index 0000000000..13123a056d --- /dev/null +++ b/Projectiles/Summon/LostSoulGiant.cs @@ -0,0 +1,110 @@ +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 LostSoulGiant : ModProjectile + { + public ref float Time => ref projectile.ai[0]; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Soul"); + Main.projFrames[projectile.type] = 4; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 10; + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + } + + public override void SetDefaults() + { + projectile.scale = 0.8f; + projectile.width = projectile.height = 52; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.tileCollide = false; + projectile.magic = true; + projectile.ignoreWater = true; + } + + public override void AI() => DoSoulAI(projectile, ref Time); + + public static void DoSoulAI(Projectile projectile, ref float time) + { + if (time >= 15f) + { + NPC potentialTarget = projectile.Center.ClosestNPCAt(1800f, false); + if (potentialTarget != null) + HomeInOnTarget(projectile, potentialTarget); + } + + projectile.Opacity = Utils.InverseLerp(0f, 15f, time, true); + projectile.frameCounter++; + if (projectile.frameCounter % 5f == 4f) + projectile.frame = (projectile.frame + 1) % Main.projFrames[projectile.type]; + + projectile.rotation = projectile.velocity.ToRotation(); + projectile.spriteDirection = (projectile.velocity.X > 0f).ToDirectionInt(); + if (projectile.spriteDirection == -1) + projectile.rotation += MathHelper.Pi; + + time++; + } + + public static void HomeInOnTarget(Projectile projectile, NPC target) + { + float speed = MathHelper.Lerp(11f, 21f, (float)Math.Sin(projectile.identity % 7f / 7f * MathHelper.TwoPi) * 0.5f + 0.5f); + projectile.velocity = Vector2.Lerp(projectile.velocity, projectile.DirectionTo(target.Center) * speed, 0.075f); + } + + public override Color? GetAlpha(Color lightColor) + { + Color baseColor = Color.Lerp(Color.IndianRed, Color.DarkViolet, projectile.identity % 5f / 5f * 0.5f); + Color color = Color.Lerp(baseColor * 1.5f, baseColor, (float)Math.Cos(Main.GlobalTime * 2.7f) * 0.04f + 0.45f); + color.A = 0; + return color * projectile.Opacity; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + SpriteEffects direction = projectile.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + Texture2D texture = Main.projectileTexture[projectile.type]; + Rectangle frame = texture.Frame(1, Main.projFrames[projectile.type], 0, projectile.frame); + for (int i = 0; i < 4; i++) + { + for (int j = 0; j < projectile.oldPos.Length / 2; j++) + { + float fade = (float)Math.Pow(1f - Utils.InverseLerp(0f, projectile.oldPos.Length / 2, j, true), 2D); + Color drawColor = Color.Lerp(projectile.GetAlpha(lightColor), Color.White * projectile.Opacity, j / projectile.oldPos.Length) * fade; + Vector2 drawPosition = projectile.oldPos[j] + projectile.Size * 0.5f + (MathHelper.TwoPi * i / 4f).ToRotationVector2() * 1.5f - Main.screenPosition; + float rotation = projectile.oldRot[j]; + + spriteBatch.Draw(texture, drawPosition, frame, drawColor, rotation, frame.Size() * 0.5f, projectile.scale, direction, 0f); + } + } + + return false; + } + + public override void Kill(int timeLeft) + { + // Play a wraith death sound. + Main.PlaySound(SoundID.NPCDeath52, projectile.Center); + + if (Main.dedServ) + return; + + for (int i = 0; i < 45; i++) + { + Dust ectoplasm = Dust.NewDustPerfect(projectile.Center + Main.rand.NextVector2Circular(60f, 60f), 264); + ectoplasm.velocity = Main.rand.NextVector2Circular(2f, 2f); + ectoplasm.color = projectile.GetAlpha(Color.White); + ectoplasm.scale = 1.45f; + ectoplasm.noGravity = true; + ectoplasm.noLight = true; + } + } + } +} diff --git a/Projectiles/Summon/LostSoulGiant.png b/Projectiles/Summon/LostSoulGiant.png new file mode 100644 index 0000000000000000000000000000000000000000..3e0e4507b7ebceefbef02aa6dae0ec8a55989fbd GIT binary patch literal 2432 zcmeHI{X5eO6#tsdLbF6zNHL^l^Onf4tr??cA$jSktrz!RQM=p9YsoC0>BdHlZe{E3 zdaj5xjZo&j>!s0)MDiLH87nVw=dOEyyMMyHo##2{Jm;L}{PH=Ua}JM6@rCKE*8ubS%Bbq zsI_|3+6=#N769ngeN&C-mppCt?f8>S#D~Nmn0kGIIqbH^XUICnCU-t%usDkn_gZUb zxdE~|x^k~92P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K g|C>-fsTLM18hG#9fnP00(!V`IvJZuLmq6qE1 ref projectile.ai[0]; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gold Soul"); + Main.projFrames[projectile.type] = 4; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 10; + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 38; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.tileCollide = false; + projectile.magic = true; + projectile.ignoreWater = true; + } + + public override void AI() => LostSoulGiant.DoSoulAI(projectile, ref Time); + + public override Color? GetAlpha(Color lightColor) + { + Color baseColor = Color.Lerp(Color.DarkGoldenrod, Color.Gold, projectile.identity % 5f / 5f); + Color color = Color.Lerp(baseColor, Color.White, (float)Math.Cos(Main.GlobalTime * 2.7f) * 0.04f + 0.5f); + color.A = 127; + return color * projectile.Opacity; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + SpriteEffects direction = projectile.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + Texture2D texture = Main.projectileTexture[projectile.type]; + Rectangle frame = texture.Frame(1, Main.projFrames[projectile.type], 0, projectile.frame); + for (int i = 0; i < 4; i++) + { + for (int j = 0; j < projectile.oldPos.Length / 2; j++) + { + float fade = (float)Math.Pow(1f - Utils.InverseLerp(0f, projectile.oldPos.Length / 2, j, true), 2D); + Color drawColor = Color.Lerp(projectile.GetAlpha(lightColor), Color.White * projectile.Opacity, j / projectile.oldPos.Length) * fade; + Vector2 drawPosition = projectile.oldPos[j] + projectile.Size * 0.5f + (MathHelper.TwoPi * i / 4f).ToRotationVector2() * 0.8f - Main.screenPosition; + float rotation = projectile.oldRot[j]; + + spriteBatch.Draw(texture, drawPosition, frame, drawColor, rotation, frame.Size() * 0.5f, projectile.scale, direction, 0f); + } + } + + return false; + } + + public override void Kill(int timeLeft) + { + // Play a wraith death sound. + Main.PlaySound(SoundID.NPCDeath52, projectile.Center); + + if (Main.dedServ) + return; + + for (int i = 0; i < 45; i++) + { + Dust ectoplasm = Dust.NewDustPerfect(projectile.Center + Main.rand.NextVector2Circular(42f, 42f), 264); + ectoplasm.velocity = Main.rand.NextVector2Circular(1.75f, 1.75f); + ectoplasm.color = projectile.GetAlpha(Color.White); + ectoplasm.scale = 1.45f; + ectoplasm.noGravity = true; + ectoplasm.noLight = true; + } + } + } +} diff --git a/Projectiles/Summon/LostSoulGold.png b/Projectiles/Summon/LostSoulGold.png new file mode 100644 index 0000000000000000000000000000000000000000..ecffa8c8a31dea2b64e178378f7d491407179ce4 GIT binary patch literal 2119 zcmb7_{Xf&|AIC2-B!V-jBzX>R@LrjZ{Jc0Hkfs z5=l@bK&u%c3GFU!zubj_SQyEg0IIplp8-IK*$^$9BJ);Q_5m16Wlkp^gQ#&xZ;&jK z&k&FDi@zs(!c*2bSXWIW(gM9U*G2hQo=TKCaUwoVN=Z&8bjaO6QxR>GI9IT@5as7? zN-N4?CMnTAP~#21P(L*V`OdtVj9HmvMST*n&(rA8jVDg7sNa;s+_$37Y88lLnsG0@Tg42iu8uyV2_o-ls}_2qpa0N0LpN&&@Y z_3YEgLVRbyq;xn(hiI|B`H}CrN|>yW_vY2AYxMrGQ~gi-=I}%hV8oTFN{h|CJlCnY z9&w|ktNDjL?lufqb+k(!RM6MJ#RQK<@WGrSwTG>KaCKVb9v}|dw#J)DK`Vc4h=J`0 z=M`M#B_SM829ou_pVjlu-sYsfzO^jCSa3Nm4kAt++f?bARRIipTlHS(?HSDk*YQ)< z8?5T7d*sHuGUcLgOQnmi|Dr9adb5L;^t?Al%vJ!yIyW5-f|t8vKxGO7Cr|zLT!<>5 z_=m(IoH&5xJ(&wDZ%{AEjtR2EuhXI{J5jrNzGmkpH8Zk9%dY9b8C5+SuOnLC875`? z{4Ee|dr(57ir2@AfSZI1|7P@bIZk%WzKj+zb7(WUJUw6ibtQIo}a#&-v*Aid+$zGOc`Q$`3{$3JN3Y>f+?cB-OlJ(+c-u|s2v-4YiP+u@W^GAn0Tv%u#07di3C&SOymHppbMVoG> zXIY^tCZh2wJMr2h>m}(4rQw-l@)mXTPiMk7<9HbNZz8> zWLEE#W;dc$r~+k6LG7}H@8>&iw>ddo<=NMbvkLSpFqz%nzO$H=DUoYPAGxMlA$@uS ztCyvyXL8pq$q7lJ$8z5gQH}VDqn7k{GM$({l6JqV#c`9Jom)KHe6v7PY^zYe_;8@V zEaiDfOhDX7v{^9W_F>Pc5ff(dziegKKSm$$W_LKa!Wq*W_t7O^ucTpB($tTd98u=X zcZ?38S9CC_!9z2vh51LIo753{u8vYUNyAJBHBk(kb0eSo`@CsRo%P#Tq*ekXZBUL9 ze#WPwlBvaca__q%-n-q^pX8{v%nj0=**JtC5oa%~UEAJyxUkF}5D&swXt4jz+LY=k z9TEfC)v2!Cx9-Cq*r9$gyxT!FGYJ}+o6>XK!@T~g)MMF=maei6SsaNw6rd4RmkL=B zKPAKPg1^vxQ~9-e1VZf9_IVdEIu8#?$^S6r`$}+QAh;R&2Shl_~P4FJ(Me-nu5y z`rD6ww$M%Yp?057=~SF)cB!lTHml{w_h-cozP9@Sm$jPSVqK70B^6cUvSNf!4&@KI z>`(FKO4Q5uKekJK@rpLU7KRmn5Tf1(t;!Dno5w`Bq}CtV6j*^VOqXCgo%Wrl@28E5 z=);xg6p|l3=I_;hou$QP6`+Er*qW7C1x5^pWumX ref projectile.ai[0]; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Soul"); + Main.projFrames[projectile.type] = 4; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 10; + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + } + + public override void SetDefaults() + { + projectile.scale = 0.75f; + projectile.width = projectile.height = 46; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.tileCollide = false; + projectile.magic = true; + projectile.ignoreWater = true; + } + + public override void AI() => LostSoulGiant.DoSoulAI(projectile, ref Time); + + public override Color? GetAlpha(Color lightColor) + { + Color baseColor = Color.Lerp(Color.Orange, Color.IndianRed, projectile.identity % 5f / 5f * 0.5f); + Color color = Color.Lerp(baseColor * 1.5f, baseColor, (float)Math.Cos(Main.GlobalTime * 2.7f) * 0.04f + 0.45f); + color.A = 0; + return color * projectile.Opacity; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + SpriteEffects direction = projectile.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + Texture2D texture = Main.projectileTexture[projectile.type]; + Rectangle frame = texture.Frame(1, Main.projFrames[projectile.type], 0, projectile.frame); + for (int i = 0; i < 4; i++) + { + for (int j = 0; j < projectile.oldPos.Length / 2; j++) + { + float fade = (float)Math.Pow(1f - Utils.InverseLerp(0f, projectile.oldPos.Length / 2, j, true), 2D); + Color drawColor = Color.Lerp(projectile.GetAlpha(lightColor), Color.White * projectile.Opacity, j / projectile.oldPos.Length) * fade; + Vector2 drawPosition = projectile.oldPos[j] + projectile.Size * 0.5f + (MathHelper.TwoPi * i / 4f).ToRotationVector2() * 1.25f - Main.screenPosition; + float rotation = projectile.oldRot[j]; + + spriteBatch.Draw(texture, drawPosition, frame, drawColor, rotation, frame.Size() * 0.5f, projectile.scale, direction, 0f); + } + } + + return false; + } + + public override void Kill(int timeLeft) + { + // Play a wraith death sound. + Main.PlaySound(SoundID.NPCDeath52, projectile.Center); + + if (Main.dedServ) + return; + + for (int i = 0; i < 45; i++) + { + Dust ectoplasm = Dust.NewDustPerfect(projectile.Center + Main.rand.NextVector2Circular(42f, 42f), 264); + ectoplasm.velocity = Main.rand.NextVector2Circular(1.75f, 1.75f); + ectoplasm.color = projectile.GetAlpha(Color.White); + ectoplasm.scale = 1.45f; + ectoplasm.noGravity = true; + ectoplasm.noLight = true; + } + } + } +} diff --git a/Projectiles/Summon/LostSoulLarge.png b/Projectiles/Summon/LostSoulLarge.png new file mode 100644 index 0000000000000000000000000000000000000000..06675010ab335ce519411697dea9e3f6d9f3658e GIT binary patch literal 3608 zcmXAsc|26>AIA?-GNPo&SR;d& zvd7qG#!!|Lx)D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IY~v5Y5o~1`rRly{s94@UqMk;EJ8?;-#+uosJpL!dk-*_FSY7}EaOeTrNpqB zOG$$WZDjOe+RuYpG%euYT{QX((-kHfDD5t~ga~_qes6BOWFR^~EG5*S8^VOEnT{CV$eN`uo~5vuz7-ROL7|IcwiEyAi3V ztE6lS(o`wi(Yp{#l-jAu#Z?Nf@JO)X=f6?AcC$NoMNj#6w#X4;Zhg65icoN)83z;x zIfGw`Ydb5p3Rv=Jve@<-m~+gp>M||y^sJ;aw9Tx!i-jwVd9k8k;-TXdtEEdHjG-SH zU;Z!#mPh&%Pn}IdI^F9FsyUZV9^LWwM1oc$xF#EnDkbAJyl2n1jjXP!SB)U_d)qd% zdXVCRx+f*UQ`K_+N_X~GgZv3cx z1L4J(7#jnQ7#lA@WdfK zZfLJue)z`WZsrIaJ7AJM z%E}CEtc86^L|=c2MMZgW9rIyY(341-mi992^-yfJ)B1^Wl+kgS@ z7A*gDrsBt4R2JQ}J?lsl|Qg$NoC5f^jQV&_1S~Nr4*~ec7fPr1l7BX2OmJnm=;UDngmf zb#{|_xdEKY*DEk!dL0*tKMvZ!?5*RN zY}7{XCBEO4AXiSjWD(!7{2~?!nL73@wAPX z&e!U_$Jc-b8y+#QV@NRFPJOsVz|xQp>_plk$nsi?4|9<@yg9^joHeM*rWD?g&BYXF zm!5iLdJhW_tLvDEmR5|9z};PF9?4cME|mhzVVZc~6!hMnR_r|q>GUchPDKcS$OBZikdXQT1M=3EM8 zeEy#f@N{hL(62bb-*)4C%w9$1v}7F;uz-QbHohKeebrLp;$HDHX;KoSCT9c%#>V5a m;uC`5a7)83t!toa7b5Qv0T&yP=77I?fECi-yu#Gy*8c#H@ZPro literal 0 HcmV?d00001 diff --git a/Projectiles/Summon/LostSoulSmall.cs b/Projectiles/Summon/LostSoulSmall.cs new file mode 100644 index 0000000000..0bc2e93403 --- /dev/null +++ b/Projectiles/Summon/LostSoulSmall.cs @@ -0,0 +1,81 @@ +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 LostSoulSmall : ModProjectile + { + public ref float Time => ref projectile.ai[0]; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Soul"); + Main.projFrames[projectile.type] = 4; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 10; + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 38; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.tileCollide = false; + projectile.magic = true; + projectile.ignoreWater = true; + } + + public override void AI() => LostSoulGiant.DoSoulAI(projectile, ref Time); + + public override Color? GetAlpha(Color lightColor) + { + Color baseColor = Color.Lerp(Color.Orange, Color.IndianRed, projectile.identity % 5f / 5f * 0.425f); + Color color = Color.Lerp(baseColor * 1.5f, baseColor, (float)Math.Cos(Main.GlobalTime * 2.7f) * 0.04f + 0.45f); + color.A = 0; + return color * projectile.Opacity; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + SpriteEffects direction = projectile.spriteDirection == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + Texture2D texture = Main.projectileTexture[projectile.type]; + Rectangle frame = texture.Frame(1, Main.projFrames[projectile.type], 0, projectile.frame); + for (int i = 0; i < 4; i++) + { + for (int j = 0; j < projectile.oldPos.Length / 2; j++) + { + float fade = (float)Math.Pow(1f - Utils.InverseLerp(0f, projectile.oldPos.Length / 2, j, true), 2D); + Color drawColor = Color.Lerp(projectile.GetAlpha(lightColor), Color.White * projectile.Opacity, j / projectile.oldPos.Length) * fade; + Vector2 drawPosition = projectile.oldPos[j] + projectile.Size * 0.5f + (MathHelper.TwoPi * i / 4f).ToRotationVector2() * 0.8f - Main.screenPosition; + float rotation = projectile.oldRot[j]; + + spriteBatch.Draw(texture, drawPosition, frame, drawColor, rotation, frame.Size() * 0.5f, projectile.scale, direction, 0f); + } + } + + return false; + } + + public override void Kill(int timeLeft) + { + // Play a wraith death sound. + Main.PlaySound(SoundID.NPCDeath52, projectile.Center); + + if (Main.dedServ) + return; + + for (int i = 0; i < 45; i++) + { + Dust ectoplasm = Dust.NewDustPerfect(projectile.Center + Main.rand.NextVector2Circular(42f, 42f), 264); + ectoplasm.velocity = Main.rand.NextVector2Circular(1.75f, 1.75f); + ectoplasm.color = projectile.GetAlpha(Color.White); + ectoplasm.scale = 1.45f; + ectoplasm.noGravity = true; + ectoplasm.noLight = true; + } + } + } +} diff --git a/Projectiles/Summon/LostSoulSmall.png b/Projectiles/Summon/LostSoulSmall.png new file mode 100644 index 0000000000000000000000000000000000000000..f02bca12216e5683e2178d592fad9d143ece854b GIT binary patch literal 2015 zcmV<52O#)~P)Px+nMp)JRCt{2ozH6&XBfvnqh^zAOlnLbnrMaAQlp}!hk~FKdPrMJDcDn?>0eL^ z{R>L}fG8K|BbesHb8@^kR!PO=68El4yReP7gCrcIU~wGw;mKW+U@{F3arB zk6pg+@8|nI3yyN(wfX@E4jfGUd}88JtG_}l+uHKfEx?XVe3svM(D&9Z4`9C^yuGxv z9KJ3Au(-GYK(*Q%xk;r`iM)1pRwAFBC13djL-! z{|CVQe4u=-R`UT?S62b(?cEu6<=@FW0dyw8zH&c1>^lk-v?m) z>J`AOxNY6m^!N7z^;Tb$cZxSqh|;3)=t4Mh3SaN{_Qu}-?5UFgjQ{d00H;6xB=Y%# z2Yy z{M_6e;1oC0P!e?Aj9e?q>+{o;PNV1VsA5`asrxVAIhg7E(kh;1b|wn@>eU0db^0^_ z9WP%3@UW*R_9jx7(@KIUXPS-uv^SV{kB17Hl-9k$&YeBw?#HeBX4{cnnvye>iU%;! z-3`FQo}SpYKor#dxwO)vxbXAiCz0cren0YCo#M76^!KI_9{?ZC&IYTh%fV`DL%*GP zo%H9Tyq>2^2@r+lJpFzHu8ucF))8M!e=k@mZ$h^P*TUJJyf4Q%#oJ7p^5fTUrhP{r zHY%%+2Z#1}08eLv*54`KZqnKcJqv7zsY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%`K7F`{MGz6ogUny#I|<)J{W}2c|{XjMdZD zxFUIEG`i$iXAe=kiZ#-Yr`2&m{tHRQ`cCl#Ozl8yNhlzq0@O={%L7v|%{U?w9gX5^ z)92a7%UvFr7E#y=jLFv~4#uoXyF4&0q8Y^_`^94Z)hf}sXmms<<@A_bknABY4@^di z+@X*ubD#bWX*nD7{s)rI10y)a^P-iP*;ilqzv23SN@H?CMX>e22rdsyMq0M!mNnal x#v((2%L9{#H^u`axI8dT@+K>u2^UET`5%)Fs^Ewyc{Kn4002ovPDHLkV1gl`_TB&h literal 0 HcmV?d00001 diff --git a/Projectiles/Summon/PerditionBeacon.cs b/Projectiles/Summon/PerditionBeacon.cs new file mode 100644 index 0000000000..9cec293928 --- /dev/null +++ b/Projectiles/Summon/PerditionBeacon.cs @@ -0,0 +1,172 @@ +using CalamityMod.Buffs.Summon; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.Utilities; + +namespace CalamityMod.Projectiles.Summon +{ + public class PerditionBeacon : ModProjectile + { + public ref float AttackTime => ref projectile.ai[0]; + public ref float AttackTimer => ref projectile.ai[1]; + public ref float DownwardCrossFade => ref projectile.localAI[1]; + public Player Owner => Main.player[projectile.owner]; + + // Only attack targets if one is explicitly defined. Don't default to a closest target. + public NPC Target => Owner.HasMinionAttackTargetNPC ? Main.npc[Owner.MinionAttackTargetNPC] : null; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Perdition Beacon"); + Main.projFrames[projectile.type] = 16; + ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.width = 48; + projectile.height = 90; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.sentry = true; + projectile.light = 1f; + projectile.timeLeft = Projectile.SentryLifeTime; + projectile.penetrate = -1; + projectile.alpha = 255; + } + + public override void AI() + { + Player player = Main.player[projectile.owner]; + + if (projectile.localAI[0] == 0f) + { + DoInitializationEffects(); + projectile.localAI[0] = 1f; + } + + // Dynamically adjust damage of the minion. + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) + { + int newDamage = (int)(projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * player.MinionDamage()); + projectile.damage = newDamage; + } + + // Fade in. + projectile.alpha = Utils.Clamp(projectile.alpha - 8, 0, 255); + + HandleFrames(); + FollowOwner(); + ProvidePlayerMinionBuffs(); + if (Target != null && projectile.WithinRange(Target.Center, 2200f)) + { + AttackTarget(); + DownwardCrossFade = MathHelper.Clamp(DownwardCrossFade + 0.025f, 0f, 1f); + AttackTime++; + } + else + { + DownwardCrossFade = MathHelper.Clamp(DownwardCrossFade - 0.025f, 0f, 1f); + AttackTime = 0f; + } + + AttackTime++; + } + + internal void DoInitializationEffects() + { + projectile.Calamity().spawnedPlayerMinionDamageValue = Owner.MinionDamage(); + projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; + + // Release a burst of fire dust on spawn. + if (Main.dedServ) + return; + + for (int i = 0; i < 55; i++) + { + Dust fire = Dust.NewDustPerfect(projectile.Center + Main.rand.NextVector2Circular(35f, 35f), 267); + fire.velocity = Vector2.Lerp(fire.velocity, Vector2.UnitY * -Main.rand.NextFloat(3.5f, 6f), 0.5f); + fire.color = Color.Lerp(Color.Orange, Color.Red, Main.rand.NextFloat(0f, 0.67f)); + fire.scale = Main.rand.NextFloat(1.2f, 1.5f); + fire.noGravity = true; + } + } + + internal void ProvidePlayerMinionBuffs() + { + Owner.AddBuff(ModContent.BuffType(), 3600); + + // Verify player/minion state integrity. The minion cannot stay alive if the + // owner is dead or if the caller of the AI is invalid. + if (projectile.type != ModContent.ProjectileType()) + return; + + if (Owner.dead) + Owner.Calamity().perditionBeacon = false; + if (Owner.Calamity().perditionBeacon) + projectile.timeLeft = 2; + } + + internal void HandleFrames() + { + projectile.frameCounter++; + if (projectile.frameCounter % 5 == 4) + projectile.frame = (projectile.frame + 1) % Main.projFrames[projectile.type]; + } + + internal void FollowOwner() + { + Vector2 destination = Owner.Top - Vector2.UnitY * MathHelper.Lerp(20f, 40f, (float)Math.Cos(projectile.timeLeft / 24f) * 0.5f + 0.5f); + projectile.Center = Vector2.Lerp(projectile.Center, destination, 0.025f); + projectile.Center += (destination - projectile.Center).SafeNormalize(Vector2.Zero) * 3f; + if (projectile.WithinRange(destination, 5f)) + projectile.Center = destination; + } + + internal void AttackTarget() + { + // Release cinders around the target. + Dust cinder = Dust.NewDustPerfect(Target.Center + Main.rand.NextVector2Circular(800f, 800f), DustID.Fire); + cinder.velocity = Vector2.UnitY * -Main.rand.NextFloat(3f, 7f); + cinder.scale = 1f + cinder.velocity.Length() * 0.17f; + cinder.noGravity = true; + + int shootRate = (int)MathHelper.Lerp(24f, 3f, Utils.InverseLerp(0f, 300f, AttackTime, true)); + AttackTimer++; + + if (AttackTimer < shootRate || Main.myPlayer != projectile.owner) + return; + + AttackTimer = 0f; + projectile.netUpdate = true; + + WeightedRandom rng = new WeightedRandom(projectile.identity * 2167 + (int)(Main.GlobalTime * 20)); + rng.Add(ModContent.ProjectileType(), 0.5f); + rng.Add(ModContent.ProjectileType(), 0.6f); + rng.Add(ModContent.ProjectileType(), 0.8f); + rng.Add(ModContent.ProjectileType(), 1f); + + Vector2 spawnPosition = Target.Center + Vector2.UnitY.RotatedByRandom(0.27f) * 1150f; + Vector2 shootVelocity = (Target.Center - spawnPosition).SafeNormalize(-Vector2.UnitY).RotatedByRandom(0.09f) * Main.rand.NextFloat(19f, 31f); + Projectile.NewProjectile(spawnPosition, shootVelocity, rng.Get(), projectile.damage, projectile.knockBack, projectile.owner); + } + + public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) + { + if (Target is null) + return; + + Texture2D crossTexture = ModContent.GetTexture("CalamityMod/Projectiles/Summon/PerditionCross"); + + Vector2 drawPosition = Target.Bottom - Main.screenPosition; + drawPosition.Y -= 12f; + Color drawColor = Color.White * DownwardCrossFade; + spriteBatch.Draw(crossTexture, drawPosition, null, drawColor, projectile.rotation, crossTexture.Size() * 0.5f, projectile.scale * 0.85f, SpriteEffects.None, 0f); + } + + public override bool CanDamage() => false; + } +} diff --git a/Projectiles/Summon/PerditionBeacon.png b/Projectiles/Summon/PerditionBeacon.png new file mode 100644 index 0000000000000000000000000000000000000000..daa5e3f58f045757f80b06c77922e62754234fc6 GIT binary patch literal 8559 zcmc(FXIN9)y6zN31;qj)3b9})Dnvk1VLk-p6(KcAtCCulplUGM_w|nPYt4_qI6$@2aAh7}*&i2x3xH zxUB)+#UO~@^zcFO=|E=gGw`<0NdqMZ<+j15Am}2bc>AW7Tijf{QONmT_r~1<(^~Jb z_V=oXKN21#HR*eDey(G+JK0K~dDTobz@mFxq|dsv zLhHvWD#r;uglr9R8+sOEc>nykv>$wL5S{8-KKTpcEZ5iiVWTqZ9&qT-*Gl| zf+XfeTq{9yia<)4F3!;r6bcQ|)SoMv`$N%AkoUR2QhKKzl}fH$Yk*g*(Lolj3G`5l zfbG?6sbgwJ2$kv1EQ<^06Us5==c84l2HeF+Gy5T_wZSZ7D)?0#&USM(9`cPBA36+` z=C8t``jqM=(SnKU6#*VaT@CbEeQ)djM5uO0a-I(2H!MF4-Ehaha@euq6;hmjBuU%{ z32YB8+eyj}9)^C@RRtI62)fnJcJ}W~?_XNa>)#I%?MJ6XYqA$6WT_E!wRNdZkZ-#k z8nk$&eQ8RqdQTG?%PAs}A?@9pQ1@0hLt zn`#=B$i=@!TSFT-78MO#>E1HgdTuga-A`E`QSP78XGv-d3|$G5$XM9g^n!eS+y;C6 zITm(LK;LF}q#<9nS!WaPiTEy7uO$v$2=ZB5GxxmFcqDO01o}i>U9zJFD=o_I4xEPS zM-~GQwcuUwRcL-2^R;2@)!-SKEiJ~QYkw@u$4nT1=(la3-#rJ_nm6w7t!qhY&pKRt34_165n`;-isJ?H6SC5$|u`8v`02PqfF1 zeWa4}G2h3+WDi1yW%&1Td}=CDHAa|X&xW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|^=V+fcpUPbp(HrO;wx0=MA4(lBQgTwWPO5oCR;EJcpV+hl2z@ag+4B=C#Kw_n5 zqD2G#nldmY@&FkPUEJluG>=i##j4ERfyWuqYwxK>95{Xp=Qd$y05TCdPkl;;-Napv~z?*2EF zUkIo5xQvuWSc51qNf3FH*|`XPKuHPQ)hS(d$gpoV-?=DAI-UJTY(+_64m-$!RDruB zS@Z8L9QL0X{ci@*nftSWRZjphIhP-$v8}uUZj#*kbtT|HaAy8!oL$f+!skAM`uYKO zHnWYx>k%Hl)MeutXF{Nce;H2ip(F?Zc8@zNmr4c%XSIVTC?LfPx$$4Nv%R9J=8n5|C4KoG}g2@gPUoa7wYvn0F#b%-V)Q3xO;mtvRUmNBhG1u6l|Bfd<7+jh!V1IwRa=lId5tsUTY&N1}e0#)y_Fao;t`1Le z67xM=-ExcEPvpNt|IGyeRQ7YDS|b*Pl;-@5V{iXn8?6hff*_!Z zWO*CpwJ{~F9kxAUn?w5|z(ho>RXD{D-TxxMA~Lo1HdP0R9lve3sx{(Y!jFp?|Bh@s P00000NkvXXu0mjfQzhj8 literal 0 HcmV?d00001 From 1f9bd87e5395e575092872f9165df849140ae576 Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 9 Apr 2021 18:08:01 -0500 Subject: [PATCH 073/202] Minor adjustments to the SCal Town NPC --- CalPlayer/CalamityPlayer.cs | 5 ++ NPCs/TownNPCs/WITCH.cs | 153 ++++-------------------------------- 2 files changed, 21 insertions(+), 137 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 5cf0890c55..41ea4ba7f6 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -150,6 +150,7 @@ namespace CalamityMod.CalPlayer public bool newCirrusInventory = false; public bool newAmidiasInventory = false; public bool newBanditInventory = false; + public bool newCalamitasInventory = false; #endregion #region Stat Meter @@ -1039,6 +1040,7 @@ namespace CalamityMod.CalPlayer newCirrusInventory = false; newAmidiasInventory = false; newBanditInventory = false; + newCalamitasInventory = false; } public override TagCompound Save() @@ -1086,6 +1088,7 @@ namespace CalamityMod.CalPlayer boost.AddWithCondition("newCirrusInventory", newCirrusInventory); boost.AddWithCondition("newAmidiasInventory", newAmidiasInventory); boost.AddWithCondition("newBanditInventory", newBanditInventory); + boost.AddWithCondition("newCalamitasInventory", newCalamitasInventory); return new TagCompound { @@ -1160,6 +1163,7 @@ namespace CalamityMod.CalPlayer newCirrusInventory = boost.Contains("newCirrusInventory"); newAmidiasInventory = boost.Contains("newAmidiasInventory"); newBanditInventory = boost.Contains("newBanditInventory"); + newCalamitasInventory = boost.Contains("newCalamitasInventory"); // Load rage from "stress" if this is an older save. Otherwise load it from "rage", its new name. if (tag.ContainsKey("stress")) @@ -1293,6 +1297,7 @@ namespace CalamityMod.CalPlayer BitsByte flags6 = reader.ReadByte(); newBanditInventory = flags6[0]; + newCalamitasInventory = flags6[1]; } else { diff --git a/NPCs/TownNPCs/WITCH.cs b/NPCs/TownNPCs/WITCH.cs index ff27ce9ad1..9f3bfa7159 100644 --- a/NPCs/TownNPCs/WITCH.cs +++ b/NPCs/TownNPCs/WITCH.cs @@ -45,35 +45,27 @@ namespace CalamityMod.NPCs.TownNPCs npc.height = 40; npc.aiStyle = 7; npc.damage = 10; - //Has the same amount of life, defense, and dr as SCal - npc.Calamity().DR = CalamityWorld.death ? 0.75f : 0.7f; + + // You should not be able to kill SCal under any typical circumstances. + npc.Calamity().DR = 0.999999f; + npc.Calamity().unbreakableDR = true; + npc.lifeMax = 1000000; + npc.defense = 120; - npc.lifeMax = (int)((CalamityWorld.revenge ? 5500000 : 5000000) * (Main.expertMode ? 1.6f : 1f)); npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath6; npc.knockBackResist = 0.8f; animationType = NPCID.Wizard; } - public override void AI() - { - //To account for revengeance/death mode switching - if (npc.lifeMax != (int)((CalamityWorld.revenge ? 5500000 : 5000000) * (Main.expertMode ? 1.6f : 1f))) - { - npc.lifeMax = (int)((CalamityWorld.revenge ? 5500000 : 5000000) * (Main.expertMode ? 1.6f : 1f)); - } - if (npc.Calamity().DR != (CalamityWorld.death ? 0.75f : 0.7f)) - { - npc.Calamity().DR = CalamityWorld.death ? 0.75f : 0.7f; - } - } - public override bool CanTownNPCSpawn(int numTownNPCs, int money) => CalamityWorld.downedSCal; public override string TownNPCName() => "Calamitas"; public override string GetChat() { + // TODO: Give this town NPC unique dialog. + if (npc.homeless) //not sure how to check if he has ever found a home before (to make this dialogue only run when he first spawns) { if (Main.rand.NextBool(2)) @@ -136,10 +128,7 @@ namespace CalamityMod.NPCs.TownNPCs return dialogue[Main.rand.Next(dialogue.Count)]; } - public override void SetChatButtons(ref string button, ref string button2) - { - button = Language.GetTextValue("LegacyInterface.28"); - } + public override void SetChatButtons(ref string button, ref string button2) => button = Language.GetTextValue("LegacyInterface.28"); public override void OnChatButtonClicked(bool firstButton, ref bool shop) { @@ -152,125 +141,13 @@ namespace CalamityMod.NPCs.TownNPCs public override void SetupShop(Chest shop, ref int nextSlot) { - //Melee weapons + // NOTE: This town NPC is intended to not have an actual shop in the future and will instead have a special system. + // This item is only here temporarily. if (Main.LocalPlayer.HasItem(ItemType())) { shop.item[nextSlot].SetDefaults(ItemType()); nextSlot++; } - if (Main.LocalPlayer.HasItem(ItemType())) - { - shop.item[nextSlot].SetDefaults(ItemType()); - nextSlot++; - } - if (Main.LocalPlayer.HasItem(ItemType())) - { - shop.item[nextSlot].SetDefaults(ItemType()); - nextSlot++; - } - if (Main.LocalPlayer.HasItem(ItemType())) - { - shop.item[nextSlot].SetDefaults(ItemType()); - nextSlot++; - } - if (Main.LocalPlayer.HasItem(ItemType())) - { - shop.item[nextSlot].SetDefaults(ItemType()); - nextSlot++; - } - //Ranged weapons - if (Main.LocalPlayer.HasItem(ItemType())) - { - shop.item[nextSlot].SetDefaults(ItemType()); - nextSlot++; - } - if (Main.LocalPlayer.HasItem(ItemType())) - { - shop.item[nextSlot].SetDefaults(ItemType()); - nextSlot++; - } - if (Main.LocalPlayer.HasItem(ItemType())) - { - shop.item[nextSlot].SetDefaults(ItemType()); - nextSlot++; - } - if (Main.LocalPlayer.HasItem(ItemType())) - { - shop.item[nextSlot].SetDefaults(ItemType()); - nextSlot++; - } - //Magic weapons - if (Main.LocalPlayer.HasItem(ItemType())) - { - shop.item[nextSlot].SetDefaults(ItemType()); - nextSlot++; - } - if (Main.LocalPlayer.HasItem(ItemType())) - { - shop.item[nextSlot].SetDefaults(ItemType()); - nextSlot++; - } - if (Main.LocalPlayer.HasItem(ItemType())) - { - shop.item[nextSlot].SetDefaults(ItemType()); - nextSlot++; - } - //Summon weapons - if (Main.LocalPlayer.HasItem(ItemType())) - { - shop.item[nextSlot].SetDefaults(ItemType()); - nextSlot++; - } - if (Main.LocalPlayer.HasItem(ItemType())) - { - shop.item[nextSlot].SetDefaults(ItemType()); - nextSlot++; - } - //Rogue weapons - if (Main.LocalPlayer.HasItem(ItemType())) - { - shop.item[nextSlot].SetDefaults(ItemType()); - nextSlot++; - } - //Hybrid weapons - if (Main.LocalPlayer.HasItem(ItemType()) || Main.LocalPlayer.HasItem(ItemType())) - { - shop.item[nextSlot].SetDefaults(ItemType()); - nextSlot++; - shop.item[nextSlot].SetDefaults(ItemType()); - nextSlot++; - } - if (Main.LocalPlayer.HasItem(ItemType()) || Main.LocalPlayer.HasItem(ItemType())) - { - shop.item[nextSlot].SetDefaults(ItemType()); - nextSlot++; - shop.item[nextSlot].SetDefaults(ItemType()); - nextSlot++; - } - if (Main.LocalPlayer.HasItem(ItemType()) || Main.LocalPlayer.HasItem(ItemType())) - { - shop.item[nextSlot].SetDefaults(ItemType()); - nextSlot++; - shop.item[nextSlot].SetDefaults(ItemType()); - nextSlot++; - } - //Accessories - if (Main.LocalPlayer.HasItem(ItemType())) - { - shop.item[nextSlot].SetDefaults(ItemType()); - nextSlot++; - } - if (Main.LocalPlayer.HasItem(ItemType())) - { - shop.item[nextSlot].SetDefaults(ItemType()); - nextSlot++; - } - //Tools - if (Main.LocalPlayer.HasItem(ItemType())) - { - shop.item[nextSlot].SetDefaults(ItemType()); - nextSlot++; - } } // Make this Town NPC teleport to the Queen statue when triggered. @@ -301,7 +178,7 @@ namespace CalamityMod.NPCs.TownNPCs multiplier = 2f; } - //Explode into red dust when die + // Explode into red dust on death. public override void HitEffect(int hitDirection, double damage) { if (npc.life <= 0) @@ -310,7 +187,7 @@ namespace CalamityMod.NPCs.TownNPCs npc.width = npc.height = 50; npc.position.X -= npc.width / 2; npc.position.Y -= npc.height / 2; - for (int dustIndex = 0; dustIndex < 5; dustIndex++) + for (int i = 0; i < 5; i++) { int brimstone = Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); Main.dust[brimstone].velocity *= 3f; @@ -320,11 +197,13 @@ namespace CalamityMod.NPCs.TownNPCs Main.dust[brimstone].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; } } - for (int indexDust = 0; indexDust < 10; indexDust++) + + for (int i = 0; i < 10; i++) { int fire = Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 3f); Main.dust[fire].noGravity = true; Main.dust[fire].velocity *= 5f; + fire = Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); Main.dust[fire].velocity *= 2f; } From 0a7e01341974df6c0345db95f07fe7cc79565edc Mon Sep 17 00:00:00 2001 From: Dominic Date: Sun, 11 Apr 2021 20:03:13 -0500 Subject: [PATCH 074/202] Start of Violence --- Items/Weapons/Melee/Violence.cs | 54 ++++++ Items/Weapons/Melee/Violence.png | Bin 0 -> 3353 bytes Projectiles/Melee/ViolenceSlashProjectile.cs | 121 +++++++++++++ Projectiles/Melee/ViolenceThrownProjectile.cs | 161 ++++++++++++++++++ 4 files changed, 336 insertions(+) create mode 100644 Items/Weapons/Melee/Violence.cs create mode 100644 Items/Weapons/Melee/Violence.png create mode 100644 Projectiles/Melee/ViolenceSlashProjectile.cs create mode 100644 Projectiles/Melee/ViolenceThrownProjectile.cs diff --git a/Items/Weapons/Melee/Violence.cs b/Items/Weapons/Melee/Violence.cs new file mode 100644 index 0000000000..9e022355b3 --- /dev/null +++ b/Items/Weapons/Melee/Violence.cs @@ -0,0 +1,54 @@ +using CalamityMod.Projectiles.Melee; +using CalamityMod.Projectiles.Melee.Spears; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Melee +{ + public class Violence : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Violence"); + Tooltip.SetDefault("Does things"); + } + + public override void SetDefaults() + { + item.height = item.width = 142; + item.damage = 1450; + item.melee = true; + item.noMelee = true; + item.useTurn = true; + item.noUseGraphic = true; + item.useAnimation = 25; + item.useTime = 25; + item.useStyle = ItemUseStyleID.HoldingOut; + item.knockBack = 9f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.value = CalamityGlobalItem.RarityVioletBuyPrice; + item.rare = ItemRarityID.Purple; + item.Calamity().customRarity = CalamityRarity.Violet; + item.channel = true; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 15f; + } + + public override bool AltFunctionUse(Player player) => true; + + public override bool CanUseItem(Player player) => player.altFunctionUse == 2 || player.ownedProjectileCounts[item.shoot] <= 0; + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + if (player.altFunctionUse != 2) + return true; + + Vector2 shootVelocity = new Vector2(speedX, speedY); + Projectile.NewProjectile(position, shootVelocity, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, shootVelocity.ToRotation()); + return false; + } + } +} diff --git a/Items/Weapons/Melee/Violence.png b/Items/Weapons/Melee/Violence.png new file mode 100644 index 0000000000000000000000000000000000000000..0946ba16ec6963c431bd5c687353ae321678b143 GIT binary patch literal 3353 zcmXX}c_38#`#xj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d;^c~vIyyNS4V$_;!?}kdu^aNw#UidIBNugw=M3ZFlJh3H21jU0zv+gS)f9@ z^$>)m=Eh7}PZ=cp^Ff0O7+>V#ew10_cqj1J$Lz9r6q_jmO0}f(KJ~j!VcJIB(*UB! zc4HnSE$){il#tl>tie;8!=1h-22G%9HWpfm*2P$L^)$4m#j%j@b`PV_Z*=gf9h?nt zVm!8U7IY1UMf0z&ueaV^N0_o(Cm|Bke7H$TSC{n6y~S2vy^OE1N21xht*Kf_g2Gc4 zPT>?Ttp}3u)tbg~=Wj`TBsBWIvDsbFn$7guC+)(sCI7Wa$lu4>A0%MYX>M@!PV*!b9hs2t1m8mKJ_Cn%ttS#?#%B|>QO*Yz3 zTEoe@+#7FCFlskfr5NM3IQr%u4A9gQ?{8%7#j@dgsaW;CLzCot&4;HAJwOVi zl#U?oSc3rxKk=VY9_JZ=78hd}{oKf7TbuNz^zg)_j^>}=QZXb0Ko-<=PmY^xkWZ4=vbwQI~l zQ?g)%J6x8LG2}(kWP4|{>>t4%-cwy?AJvXeiy)6$E(0ab)vAE!RfU>FidkjW{CD;w z2q2;l_<#?yKfvx=mAZ_x_z66xmCT{Pod>XSh@DqBdTuGCkVPef d*%}`4962=_gzfO=u>N%b*bNJ#%IhvM{|AligJb{z literal 0 HcmV?d00001 diff --git a/Projectiles/Melee/ViolenceSlashProjectile.cs b/Projectiles/Melee/ViolenceSlashProjectile.cs new file mode 100644 index 0000000000..dcc4ee91ba --- /dev/null +++ b/Projectiles/Melee/ViolenceSlashProjectile.cs @@ -0,0 +1,121 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using System.Collections.Generic; +using System.Linq; +using Terraria; +using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Melee +{ + public class ViolenceSlashProjectile : ModProjectile + { + internal PrimitiveTrail SliceAfterimageDrawer = null; + internal Player Owner => Main.player[projectile.owner]; + internal ref float Time => ref projectile.ai[0]; + internal float SwingSine => (float)Math.Sin(MathHelper.TwoPi * Time / 50f); + public override string Texture => "CalamityMod/Items/Weapons/Melee/Violence"; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Violence"); + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 36; + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 142; + projectile.aiStyle = -1; + projectile.friendly = true; + projectile.melee = true; + projectile.penetrate = -1; + projectile.timeLeft = 90000; + projectile.ignoreWater = true; + projectile.extraUpdates = 1; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 6; + projectile.tileCollide = false; + } + + public override void AI() + { + // Fade in. + projectile.Opacity = Utils.InverseLerp(0f, 15f, Time, true); + + if (!Owner.channel) + { + projectile.Kill(); + return; + } + + ManipulatePlayerFields(); + DoMovement(); + + // Create some demonic light at the tip of the spear. + Lighting.AddLight(projectile.Center + (projectile.rotation + MathHelper.PiOver4).ToRotationVector2() * projectile.height * 0.45f, Color.Red.ToVector3() * 0.4f); + Time++; + } + + internal void DoMovement() + { + projectile.Center = Owner.RotatedRelativePoint(Owner.MountedCenter) + (projectile.rotation - MathHelper.PiOver4).ToRotationVector2() * projectile.height * 0.45f; + projectile.rotation = SwingSine * MathHelper.ToRadians(87f); + + if (Main.myPlayer == projectile.owner && !projectile.WithinRange(Main.MouseWorld, projectile.height + 15f)) + { + projectile.velocity = projectile.DirectionTo(Main.MouseWorld); + projectile.netSpam = 0; + projectile.netUpdate = true; + } + + projectile.rotation += projectile.velocity.ToRotation() + MathHelper.PiOver4; + } + + internal void ManipulatePlayerFields() + { + Owner.itemTime = 2; + Owner.itemAnimation = 2; + Owner.ChangeDir((Math.Cos(projectile.rotation - MathHelper.PiOver4) > 0f).ToDirectionInt()); + } + + internal Color PrimitiveColorFunction(float completionRatio) + { + float averageRotation = projectile.oldRot.Average(angle => MathHelper.WrapAngle(angle) + MathHelper.Pi); + float opacity = projectile.Opacity * Utils.InverseLerp(0.75f, 0.45f, completionRatio, true) * 0.5f; + opacity *= Utils.InverseLerp(0.125f, 0.15f, Math.Abs(SwingSine), true); + + float rotationAdjusted = MathHelper.WrapAngle(projectile.rotation) + MathHelper.Pi; + float oldRotationAdjusted = MathHelper.WrapAngle(projectile.oldRot[1]) + MathHelper.Pi; + + return Color.Lerp(Color.Red * 1.1f, Color.DarkRed, Utils.InverseLerp(0f, 0.5f, completionRatio, true)) * opacity; + } + + internal float PrimitiveWidthFunction(float completionRatio) => projectile.height * 0.48f; + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + if (SliceAfterimageDrawer is null) + SliceAfterimageDrawer = new PrimitiveTrail(PrimitiveWidthFunction, PrimitiveColorFunction, specialShader: GameShaders.Misc["CalamityMod:PhaseslayerRipEffect"]); + + GameShaders.Misc["CalamityMod:PhaseslayerRipEffect"].SetShaderTexture(ModContent.GetTexture("CalamityMod/ExtraTextures/SwordSlashTexture")); + + Texture2D spearProjectile = Main.projectileTexture[projectile.type]; + + Player player = Main.player[projectile.owner]; + List positions = new List(); + + for (int i = 0; i < 16; i++) + { + Vector2 position = projectile.position + (projectile.rotation - MathHelper.PiOver4).ToRotationVector2() * (PrimitiveWidthFunction(0f) - 30f) * projectile.scale * 0.5f; + float angleOffset = MathHelper.Pi * 0.25f * -Math.Sign(SwingSine) * i / 16f; + position += (projectile.rotation - MathHelper.PiOver4 + MathHelper.PiOver2).ToRotationVector2().RotatedBy(angleOffset) * -SwingSine * i * 12f; + positions.Add(position); + } + + SliceAfterimageDrawer.Draw(positions, projectile.Size * 0.5f - Main.screenPosition, 50); + return true; + } + } +} diff --git a/Projectiles/Melee/ViolenceThrownProjectile.cs b/Projectiles/Melee/ViolenceThrownProjectile.cs new file mode 100644 index 0000000000..b9c33c3445 --- /dev/null +++ b/Projectiles/Melee/ViolenceThrownProjectile.cs @@ -0,0 +1,161 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Melee +{ + public class ViolenceThrownProjectile : ModProjectile + { + internal PrimitiveTrail StreakDrawer = null; + internal Player Owner => Main.player[projectile.owner]; + internal ref float Time => ref projectile.ai[0]; + public override string Texture => "CalamityMod/Items/Weapons/Melee/Violence"; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Violence"); + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 36; + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 142; + projectile.aiStyle = -1; + projectile.friendly = true; + projectile.melee = true; + projectile.penetrate = -1; + projectile.timeLeft = 90000; + projectile.ignoreWater = true; + projectile.extraUpdates = 1; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 6; + projectile.tileCollide = false; + } + + public override void AI() + { + // Fade in. + projectile.Opacity = Utils.InverseLerp(0f, 15f, Time, true); + + if (Owner.channel) + { + HomeTowardsMouse(); + projectile.rotation += 0.35f / projectile.MaxUpdates; + } + else + { + ReturnToOwner(); + + float idealAngle = projectile.AngleTo(Owner.Center) - MathHelper.PiOver4 + MathHelper.Pi; + projectile.rotation = projectile.rotation.AngleLerp(idealAngle, 0.1f); + projectile.rotation = projectile.rotation.AngleTowards(idealAngle, 0.25f); + } + ManipulatePlayerFields(); + + // Create some demonic light at the tip of the spear. + Lighting.AddLight(projectile.Center + (projectile.rotation + MathHelper.PiOver4).ToRotationVector2() * projectile.height * 0.45f, Color.Red.ToVector3() * 0.4f); + Time++; + } + + internal void HomeTowardsMouse() + { + if (Main.myPlayer != projectile.owner) + return; + + if (projectile.WithinRange(Main.MouseWorld, projectile.velocity.Length() * 0.7f)) + projectile.Center = Main.MouseWorld; + else + projectile.velocity = (projectile.velocity * 6f + projectile.DirectionTo(Main.MouseWorld) * 14f) / 7f; + projectile.netSpam = 0; + projectile.netUpdate = true; + } + + internal void ReturnToOwner() + { + projectile.Center = Vector2.Lerp(projectile.Center, Owner.Center, 0.02f); + projectile.velocity = projectile.DirectionTo(Owner.Center) * 15f; + if (projectile.Hitbox.Intersects(Owner.Hitbox)) + { + for (int i = 0; i < 75; i++) + { + Dust fire = Dust.NewDustPerfect(Owner.Center, DustID.Fire); + fire.velocity = (MathHelper.TwoPi * i / 75f).ToRotationVector2() * 4f - Vector2.UnitY * 3f; + fire.scale = 1.4f; + fire.noGravity = true; + } + projectile.Kill(); + } + } + + internal void ManipulatePlayerFields() + { + Owner.itemTime = 2; + Owner.itemAnimation = 2; + } + + internal float PrimitiveWidthFunction(float completionRatio) + { + float tipWidthFactor = MathHelper.SmoothStep(0f, 1f, Utils.InverseLerp(0.01f, 0.04f, completionRatio)); + float bodyWidthFactor = (float)Math.Pow(Utils.InverseLerp(1f, 0.04f, completionRatio), 0.9D); + return (float)Math.Pow(tipWidthFactor * bodyWidthFactor, 0.1D) * 30f; + } + + internal Color PrimitiveColorFunction(float completionRatio) + { + float fadeInterpolant = (float)Math.Cos(Main.GlobalTime * -9f + completionRatio * 6f + projectile.identity * 2f) * 0.5f + 0.5f; + + // Adjust the fade interpolant to be on a different scale via a linear interpolation. + fadeInterpolant = MathHelper.Lerp(0.15f, 0.75f, fadeInterpolant); + Color frontFade = Color.Lerp(new Color(255, 145, 115), new Color(113, 0, 159), fadeInterpolant); + + // Go halfway to a dark red color. + frontFade = Color.Lerp(frontFade, Color.DarkRed, 0.5f); + Color backFade = new Color(255, 145, 115); + + return Color.Lerp(frontFade, backFade, (float)Math.Pow(completionRatio, 1.2D)) * (float)Math.Pow(1f - completionRatio, 1.1D) * projectile.Opacity; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + if (StreakDrawer is null) + StreakDrawer = new PrimitiveTrail(PrimitiveWidthFunction, PrimitiveColorFunction, specialShader: GameShaders.Misc["CalamityMod:TrailStreak"]); + + GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(ModContent.GetTexture("CalamityMod/ExtraTextures/FabstaffStreak")); + + Texture2D spearProjectile = Main.projectileTexture[projectile.type]; + + // Not cloning the points causes the below operations to be applied to the original oldPos value by reference + // and thus causes it to be consistently added over and over, which is not intended behavior. + Vector2[] drawPoints = (Vector2[])projectile.oldPos.Clone(); + Vector2 aimAheadDirection = (projectile.rotation - MathHelper.PiOver2).ToRotationVector2(); + + if (Owner.channel) + { + drawPoints[0] += aimAheadDirection * -12f; + drawPoints[1] = drawPoints[0] - (projectile.rotation + MathHelper.PiOver4).ToRotationVector2() * Vector2.Distance(drawPoints[0], drawPoints[1]); + } + for (int i = 0; i < drawPoints.Length; i++) + drawPoints[i] -= (projectile.oldRot[i] + MathHelper.PiOver4).ToRotationVector2() * projectile.height * 0.5f; + + if (Time > projectile.oldPos.Length) + StreakDrawer.Draw(drawPoints, projectile.Size * 0.5f - Main.screenPosition, 88); + + Vector2 drawPosition = projectile.Center - Main.screenPosition; + for (int i = 0; i < 6; i++) + { + float rotation = projectile.oldRot[i] - MathHelper.PiOver2; + if (Owner.channel) + rotation += 0.2f; + + Color afterimageColor = Color.Lerp(lightColor, Color.Transparent, 1f - (float)Math.Pow(Utils.InverseLerp(0, 6, i), 1.4D)) * projectile.Opacity; + spriteBatch.Draw(spearProjectile, drawPosition, null, afterimageColor, rotation, spearProjectile.Size() * 0.5f, projectile.scale, SpriteEffects.None, 0f); + } + + return false; + } + } +} From b7b90f86b7a2251d9c3a4f949bb9674318acd968 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Tue, 13 Apr 2021 16:15:58 -0500 Subject: [PATCH 075/202] Start of Cal Reforge system --- CalPlayer/CalamityPlayer.cs | 8 + CalPlayer/CalamityPlayerMiscEffects.cs | 16 + CalamityMod.cs | 10 + .../UI/CalamitasReforgeBackground.png | Bin 0 -> 1094 bytes ExtraTextures/UI/CalamitasReforgePillar.png | Bin 0 -> 505 bytes ExtraTextures/UI/CalamitasReforgeSlot.png | Bin 0 -> 465 bytes Items/CalamityGlobalItem.cs | 29 +- NPCs/TownNPCs/WITCH.cs | 19 +- .../CalamitasEnchantUI.cs | 298 ++++++++++++++++++ UI/CalamitasEnchantments/Enchantment.cs | 38 +++ .../EnchantmentManager.cs | 64 ++++ 11 files changed, 469 insertions(+), 13 deletions(-) create mode 100644 ExtraTextures/UI/CalamitasReforgeBackground.png create mode 100644 ExtraTextures/UI/CalamitasReforgePillar.png create mode 100644 ExtraTextures/UI/CalamitasReforgeSlot.png create mode 100644 UI/CalamitasEnchantments/CalamitasEnchantUI.cs create mode 100644 UI/CalamitasEnchantments/Enchantment.cs create mode 100644 UI/CalamitasEnchantments/EnchantmentManager.cs diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 41ea4ba7f6..cdd99317ed 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -993,6 +993,10 @@ namespace CalamityMod.CalPlayer public bool omegaBlueTransformationPower; #endregion + #region Calamitas Enchant Effects + public bool sacrificeEnchant = false; + #endregion Calamitas Enchant Effects + #endregion #region SavingAndLoading @@ -1355,6 +1359,8 @@ namespace CalamityMod.CalPlayer // Max health reductions if (crimEffigy) player.statLifeMax2 = (int)(player.statLifeMax2 * 0.9); + if (sacrificeEnchant) + player.statLifeMax2 = (int)(player.statLifeMax2 * 0.8); if (regenator) player.statLifeMax2 = (int)(player.statLifeMax2 * 0.5); @@ -1976,6 +1982,8 @@ namespace CalamityMod.CalPlayer RageDuration = DefaultRageDuration; RageDamageBoost = DefaultRageDamageBoost; + sacrificeEnchant = false; + lastProjectileHit = null; } #endregion diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 9f61959bb8..b153e0338a 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -91,6 +91,9 @@ namespace CalamityMod.CalPlayer // Misc effects, because I don't know what else to call it MiscEffects(player, modPlayer, mod); + // Calamitas enchant held effects + EnchantHeldItemEffects(player, modPlayer, player.ActiveItem()); + // Max life and mana effects MaxLifeAndManaEffects(player, modPlayer, mod); @@ -2019,6 +2022,19 @@ namespace CalamityMod.CalPlayer } #endregion + #region Calamitas Enchantment Held Item Effects + public static void EnchantHeldItemEffects(Player player, CalamityPlayer modPlayer, Item heldItem) + { + if (heldItem.IsAir) + return; + + if (!heldItem.Calamity().AppliedEnchantment.HasValue || heldItem.Calamity().AppliedEnchantment.Value.HoldEffect is null) + return; + + heldItem.Calamity().AppliedEnchantment.Value.HoldEffect(player); + } + #endregion + #region Max Life And Mana Effects private static void MaxLifeAndManaEffects(Player player, CalamityPlayer modPlayer, Mod mod) { diff --git a/CalamityMod.cs b/CalamityMod.cs index 544e28d565..d690046eb4 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -38,6 +38,7 @@ using CalamityMod.Schematics; using CalamityMod.Skies; using CalamityMod.TileEntities; using CalamityMod.UI; +using CalamityMod.UI.CalamitasEnchants; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -144,6 +145,7 @@ namespace CalamityMod BossHealthBarManager.Load(this); DraedonStructures.Load(); CalamityLists.LoadLists(); + EnchantmentManager.LoadAllEnchantments(); SetupVanillaDR(); SetupBossKillTimes(); SetupBossVelocityScalingValues(); @@ -259,6 +261,7 @@ namespace CalamityMod bossVelocityDamageScaleValues?.Clear(); bossVelocityDamageScaleValues = null; + EnchantmentManager.UnloadAllEnchantments(); CalamityLists.UnloadLists(); NPCStats.Unload(); @@ -855,6 +858,13 @@ namespace CalamityMod return true; }, InterfaceScaleType.None)); + // Calamitas Enchantment UI + layers.Insert(mouseIndex, new LegacyGameInterfaceLayer("Calamitas Enchantment", () => + { + CalamitasEnchantUI.Draw(Main.spriteBatch); + return true; + }, InterfaceScaleType.None)); + // Popup GUIs. layers.Insert(mouseIndex, new LegacyGameInterfaceLayer("Popup GUIs", () => { diff --git a/ExtraTextures/UI/CalamitasReforgeBackground.png b/ExtraTextures/UI/CalamitasReforgeBackground.png new file mode 100644 index 0000000000000000000000000000000000000000..ceca2dd493f70e71bda58de23a3c4a2f5a167988 GIT binary patch literal 1094 zcmeAS@N?(olHy`uVBq!ia0y~yU{nBN5e{ac$ewM|oIr}PILO_JVcj{Imp~3nx}&cn z1H;CC?mvmFK)z6bPlzj!-Z#QOCa}EyM73eVk-&q3;quR44d~a*$))q zEbxddW?*6#aLlM@Cf$jhQr~W?Xykxct>#msQ zlDFdRPuM0^eS6Hb@9v39Dp4+# zeeD)mg`EKe@xvnod|0;0A^xZnJB=KG$tOAIdf1W9D5ffej$p8BRVbJOIt+o#(B70WZ9 zUDDr}cIo*>hvWOtFWDuLu@H`Zm|u!BGtvMyifPnmgW?7^e4zY4>kuA!+&T~Z-^0Me zLJW*rFzLLNfdD<>i$t=*z*92y=jD~#r85@Z%UjS|wYyR5)mwhnU8i;ipP0;RGFe?ZL(Sjpg3r7^ zF$?S`-v4d1^H}ir6BCa)Fk4=d$WU;XV&;9~@%cRS-bs7vH5boqmRN?vf{+QFxvgmrA6@o%2htPae}44$rjF6*2UngEBCgR}qu literal 0 HcmV?d00001 diff --git a/ExtraTextures/UI/CalamitasReforgePillar.png b/ExtraTextures/UI/CalamitasReforgePillar.png new file mode 100644 index 0000000000000000000000000000000000000000..982e193751e07365311cab4571fc91d0f3910941 GIT binary patch literal 505 zcmeAS@N?(olHy`uVBq!ia0vp^Qb3%TW1o;L3#{w9%Z`Qs7D&Q>eh%9Dc z;M)(vj25iHDnQ36dAc};czD0PdN8lqK!D}KE!NvNvW1!c|6hAI(N~i_;`s!RsWZH% z)LzWu5vF2K^pc;)-y2Qt&*F0yUnJLvVm)V1$9Pxh{J z)qgg$>KvDNU-&@G>8C_5BNyYEwa=}Vrh0NJXK&|XnA;H1_K{6jrGt5S2s@V``_;>{ z&Kz`6kCEw7IXCr^+p#A$ef`HRp2b+`wn#HMIavOmX0NIsxI$z?$n_46dPbgQoKN{p z{X7&{7VT|&U@FLZ&QF;Avi77;iVIA#IIev1ZSnr%sr7W(?7Uy^RruF`7iL=@)MI_p zIZ}Dib7ME2k3tjt7r0FddM4SD{9=l+*t%2ta}OWlz7=O4@nicwH=zqQ*Y&kLU$q3Y dKi{Hbe>SLNn{1`wE}!XT!FNWwsd-c#@`pa`ik}UO*DUhsNS1hID?m$fmJ|-f#+CF$@{m@ zfXcj=OyUDld?i7C!T*r~gX@7iCx9}X1s;*bKm`Xum~qF%?6*J%h&OXJD;_$A3V-kRUl<5`A<$)7dlJbw1?PI9m)%yT(bINR#6#-SU} zpRing#N(_vIk<~svBzv-O;=NO1IK{&_=z_a8v~d0FMQS_R_B_M%F-p)e)PV&fb#SD z>3*DPA2&UJdBN_aj{1g~r-PFDBd6VX&?DgP{MAEYxwZFl7UQ^bosJn#Tg$utam7Dm zoSSfLW0ilv-G7CgjD0O9PI1PFR5u=DEq$dhVY=WV&VUjJrKcN@6~}&CR37_y%7s(& zp8x1Q=ElVPMQq`dH3GbrQc~hQC!QAVEz-PqEn{*d?^ button = Language.GetTextValue("LegacyInterface.28"); + public override void SetChatButtons(ref string button, ref string button2) => button = "Enchant"; public override void OnChatButtonClicked(bool firstButton, ref bool shop) { if (firstButton) { + Main.playerInventory = true; Main.LocalPlayer.Calamity().newCalamitasInventory = false; - shop = true; - } - } + CalamitasEnchantUI.NPCIndex = npc.whoAmI; + CalamitasEnchantUI.CurrentlyViewing = true; - public override void SetupShop(Chest shop, ref int nextSlot) - { - // NOTE: This town NPC is intended to not have an actual shop in the future and will instead have a special system. - // This item is only here temporarily. - if (Main.LocalPlayer.HasItem(ItemType())) - { - shop.item[nextSlot].SetDefaults(ItemType()); - nextSlot++; + shop = false; } } diff --git a/UI/CalamitasEnchantments/CalamitasEnchantUI.cs b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs new file mode 100644 index 0000000000..74f51a0b5f --- /dev/null +++ b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs @@ -0,0 +1,298 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using System.Collections.Generic; +using System.Linq; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.UI; +using Terraria.UI.Chat; + +namespace CalamityMod.UI.CalamitasEnchants +{ + public class CalamitasEnchantUI + { + public static int NPCIndex = -1; + public static int SelectedEnchantmentIndex = -1; + public static float SelectedEnchantmentScaleFactor = 1f; + public static Item CurrentlyHeldItem = new Item(); + + public static bool CurrentlyViewing = false; + + public static readonly Vector2 ReforgeUITopLeft = new Vector2(28f, 270f); + public static readonly float ResolutionRatio = Main.screenHeight / 1440f; + + public static Rectangle MouseScreenArea => Utils.CenteredRectangle(Main.MouseScreen, Vector2.One * 2f); + + public static bool InRangeOfNPC() + { + // Don't bother trying if no valid NPC has been selected yet. + if (!Main.npc.IndexInRange(NPCIndex) || !Main.npc[NPCIndex].active) + return false; + + Rectangle validTalkArea = Utils.CenteredRectangle(Main.LocalPlayer.Center, new Vector2(Player.tileRangeX * 2f, Player.tileRangeY) * 16f); + return validTalkArea.Intersects(Main.npc[NPCIndex].Hitbox); + } + + public static void Draw(SpriteBatch spriteBatch) + { + // Don't bother doing anything except resetting if not looking at the UI. + if (!CurrentlyViewing) + { + // If an item was stored, release it back into the world. + if (!CurrentlyHeldItem.IsAir) + { + Main.LocalPlayer.QuickSpawnClonedItem(CurrentlyHeldItem, CurrentlyHeldItem.stack); + CurrentlyHeldItem.TurnToAir(); + } + + NPCIndex = -1; + return; + } + + // Check if the player can still be in the UI. + if (Main.LocalPlayer.chest != -1 || Main.LocalPlayer.sign != -1 || Main.LocalPlayer.talkNPC == -1 || !Main.playerInventory || !InRangeOfNPC() || Main.InGuideCraftMenu) + { + CurrentlyViewing = false; + + // Check if the player has any items being held. + // If they do, drop it onto the ground. + Main.LocalPlayer.dropItemCheck(); + + // Reload visible recipes in case the dropped item was an ingredient. + Recipe.FindRecipes(); + return; + } + + // Open the inventory and stop talking to any NPCs by default while the UI is open, similar to the goblin tinkerer. + Main.playerInventory = true; + Main.npcChatText = string.Empty; + + Texture2D backgroundTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/CalamitasReforgeBackground"); + Texture2D pillarTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/CalamitasReforgePillar"); + Vector2 backgroundScale = MathHelper.Clamp(ResolutionRatio * 1.25f, 0.67f, 1f) * new Vector2(1.3f, 1f); + + // Draw the background. + spriteBatch.Draw(backgroundTexture, ReforgeUITopLeft, null, Color.White, 0f, Vector2.Zero, backgroundScale, SpriteEffects.None, 0f); + + // As well as a cool pillar to the side. + Vector2 pillarDrawPosition = ReforgeUITopLeft + Vector2.UnitX * (backgroundScale.X * backgroundTexture.Width + 25f); + pillarDrawPosition.Y += 20f; + spriteBatch.Draw(pillarTexture, pillarDrawPosition, null, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + + DrawIcons(spriteBatch, out bool isHoveringOverItemIcon, out bool isHoveringOverReforgeIcon); + if (isHoveringOverItemIcon) + InteractWithItemSlot(); + + Enchantment? enchantmentToUse = DisplayEnchantOptions(spriteBatch, ReforgeUITopLeft + new Vector2(112f, 55f), out List textAreas); + InteractWithTextAreas(textAreas); + + int cost = 0; + if (SelectedEnchantmentIndex != -1) + cost = DisplayEnchantCost(spriteBatch); + + if (isHoveringOverReforgeIcon && Main.mouseLeft && Main.mouseLeftRelease) + InteractWithReforgeIcon(enchantmentToUse, cost); + } + + public static void DrawIcons(SpriteBatch spriteBatch, out bool isHoveringOverItemIcon, out bool isHoveringOverReforgeIcon) + { + Texture2D itemSlotTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/CalamitasReforgeSlot"); + Vector2 itemSlotDrawPosition = ReforgeUITopLeft + new Vector2(40f, 65f); + Vector2 reforgeIconDrawPosition = itemSlotDrawPosition + Vector2.UnitX * (itemSlotTexture.Width * 0.5f + 24f); + + isHoveringOverReforgeIcon = false; + Rectangle reforgeIconArea = Utils.CenteredRectangle(reforgeIconDrawPosition, Main.reforgeTexture[0].Size()); + + Texture2D reforgeIconTexture = Main.reforgeTexture[0]; + + // Have the reforge icon light up if the mouse is hovering over it. + if (MouseScreenArea.Intersects(reforgeIconArea)) + { + reforgeIconTexture = Main.reforgeTexture[1]; + isHoveringOverReforgeIcon = true; + } + + // This will be used for item deposit/withdrawal logic. + isHoveringOverItemIcon = MouseScreenArea.Intersects(Utils.CenteredRectangle(itemSlotDrawPosition, itemSlotTexture.Size())); + + spriteBatch.Draw(itemSlotTexture, itemSlotDrawPosition, null, Color.White, 0f, itemSlotTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0f); + + // Draw the draw the item within the slot, if it exists. + if (!CurrentlyHeldItem.IsAir) + AttemptToDrawItemInIcon(spriteBatch, itemSlotDrawPosition); + + spriteBatch.Draw(reforgeIconTexture, reforgeIconDrawPosition, null, Color.White, 0f, reforgeIconTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0f); + } + + public static void AttemptToDrawItemInIcon(SpriteBatch spriteBatch, Vector2 drawPosition) + { + float inventoryScale = Main.inventoryScale; + Texture2D itemTexture = Main.itemTexture[CurrentlyHeldItem.type]; + Rectangle itemFrame = itemTexture.Frame(1, 1, 0, 0); + if (Main.itemAnimations[CurrentlyHeldItem.type] != null) + itemFrame = Main.itemAnimations[CurrentlyHeldItem.type].GetFrame(itemTexture); + + float baseScale = 1f; + Color _ = Color.White; + ItemSlot.GetItemLight(ref _, ref baseScale, CurrentlyHeldItem, false); + + float itemScale = 1f; + + // Ensure that the item being drawn does not exceed a certain size. + // If it does, constrict its scale to prevent it from going beyond the maximum. + if (itemFrame.Width > 36 || itemFrame.Height > 36) + itemScale = 36f / MathHelper.Max(itemFrame.Width, itemFrame.Height); + + itemScale *= inventoryScale * baseScale; + + // Draw the item. + if (ItemLoader.PreDrawInInventory(CurrentlyHeldItem, spriteBatch, drawPosition, itemFrame, CurrentlyHeldItem.GetAlpha(Color.White), CurrentlyHeldItem.GetColor(Color.White), itemTexture.Size() * 0.5f, itemScale)) + { + spriteBatch.Draw(itemTexture, drawPosition, itemFrame, CurrentlyHeldItem.GetAlpha(Color.White), 0f, itemTexture.Size() * 0.5f, itemScale, SpriteEffects.None, 0f); + spriteBatch.Draw(itemTexture, drawPosition, itemFrame, CurrentlyHeldItem.GetColor(Color.White), 0f, itemTexture.Size() * 0.5f, itemScale, SpriteEffects.None, 0f); + } + } + + public static void InteractWithItemSlot() + { + if (!CurrentlyHeldItem.IsAir) + { + // Display item stats. + Main.HoverItem = CurrentlyHeldItem.Clone(); + + // Force the HoverItem to be displayed. + Main.instance.MouseTextHackZoom(string.Empty); + } + + // Prevent the player from say, firing a weapon while the mouse is hovering over the slot. + Main.LocalPlayer.mouseInterface = false; + Main.blockMouse = true; + + bool isHeldItemEnchantable = Main.mouseItem.damage > 0; + + // Attempt to exchange if the slot is clicked. + if (Main.mouseLeftRelease && Main.mouseLeft && (isHeldItemEnchantable || Main.mouseItem.IsAir)) + { + // Reset the enchantment variables. + SelectedEnchantmentScaleFactor = 1f; + SelectedEnchantmentIndex = -1; + + Utils.Swap(ref Main.mouseItem, ref CurrentlyHeldItem); + Main.PlaySound(SoundID.Grab); + } + } + + public static Enchantment? DisplayEnchantOptions(SpriteBatch spriteBatch, Vector2 drawPosition, out List textAreas) + { + IEnumerable possibleEnchantments = EnchantmentManager.GetValidEnchantmentsForItem(CurrentlyHeldItem); + + // Initialize the areas. + textAreas = new List(); + + if (SelectedEnchantmentIndex == -1) + SelectedEnchantmentScaleFactor = MathHelper.Lerp(SelectedEnchantmentScaleFactor, 1f, 0.15f); + else + SelectedEnchantmentScaleFactor = MathHelper.Lerp(SelectedEnchantmentScaleFactor, 1.35f, 0.15f); + + // Don't attempt to draw anything if no valid enchantments exist for an item, for whatever reason. + if (possibleEnchantments.Count() <= 0) + return null; + + int totalEnchantmentsToDisplay = Math.Min(possibleEnchantments.Count(), 6); + Enchantment? enchantmentToUse = null; + for (int i = 0; i < totalEnchantmentsToDisplay; i++) + { + Vector2 scale = Vector2.One; + Enchantment enchantment = possibleEnchantments.ElementAt(i); + + // Save this enchantment specifically if it's the one that's going to be selected. + if (i == SelectedEnchantmentIndex) + { + scale *= SelectedEnchantmentScaleFactor; + enchantmentToUse = enchantment; + } + + // Draw all options. + ChatManager.DrawColorCodedStringWithShadow(spriteBatch, Main.fontMouseText, enchantment.Name, drawPosition, Color.Orange, 0f, Vector2.Zero, scale); + textAreas.Add(new Rectangle((int)drawPosition.X, (int)drawPosition.Y, 180, 40)); + drawPosition.Y += 60f; + } + + return enchantmentToUse; + } + + public static void InteractWithTextAreas(List textAreas) + { + for (int i = 0; i < textAreas.Count; i++) + { + Rectangle area = textAreas[i]; + if (Main.mouseLeft && Main.mouseLeftRelease && MouseScreenArea.Intersects(area)) + { + if (SelectedEnchantmentIndex == i) + SelectedEnchantmentIndex = -1; + else + SelectedEnchantmentIndex = i; + break; + } + } + } + + public static int DisplayEnchantCost(SpriteBatch spriteBatch) + { + if (CurrentlyHeldItem.IsAir) + return 0; + + int cost = CurrentlyHeldItem.value * 4; + Point topLeftDrawPosition = (ReforgeUITopLeft + new Vector2(18f, 34f)).ToPoint(); + ItemSlot.DrawMoney(spriteBatch, "Cost: ", topLeftDrawPosition.X, topLeftDrawPosition.Y, Utils.CoinsSplit(cost)); + + return cost; + } + + public static void InteractWithReforgeIcon(Enchantment? enchantmentToUse, int cost) + { + // If there's no valid item in the slot, do nothing. + if (CurrentlyHeldItem.IsAir) + return; + + // If there is no cost or the player cannot afford it, do nothing. + if (cost <= 0L || !Main.LocalPlayer.CanBuyItem(cost)) + return; + + // If no enchantment has been selected, do nothing. + if (!enchantmentToUse.HasValue) + return; + + Item originalItem = CurrentlyHeldItem.Clone(); + byte oldPrefix = CurrentlyHeldItem.prefix; + CurrentlyHeldItem.SetDefaults(CurrentlyHeldItem.type); + CurrentlyHeldItem.Prefix(oldPrefix); + CurrentlyHeldItem = CurrentlyHeldItem.CloneWithModdedDataFrom(originalItem); + + CurrentlyHeldItem.Calamity().AppliedEnchantment = enchantmentToUse.Value; + enchantmentToUse.Value.CreationEffect?.Invoke(CurrentlyHeldItem); + + // Update the compare item. This is used check comparisons when showing reforge tooltip bonuses. + // Updating it with the same bonuses as what was applied to the real item will negate the incorrect numbers, + // such as absurd damage boosts. + if (Main.cpItem is null || Main.cpItem.netID != CurrentlyHeldItem.netID) + { + Main.cpItem = new Item(); + Main.cpItem.netDefaults(CurrentlyHeldItem.netID); + } + Main.cpItem.Calamity().AppliedEnchantment = enchantmentToUse.Value; + enchantmentToUse.Value.CreationEffect?.Invoke(Main.cpItem); + + // Take away the money for the cost. + Main.LocalPlayer.BuyItem(cost); + + // Reset the enchantment variables. + SelectedEnchantmentScaleFactor = 1f; + SelectedEnchantmentIndex = -1; + + Main.PlaySound(SoundID.DD2_BetsyFlameBreath, Main.LocalPlayer.Center); + } + } +} diff --git a/UI/CalamitasEnchantments/Enchantment.cs b/UI/CalamitasEnchantments/Enchantment.cs new file mode 100644 index 0000000000..40e18b539f --- /dev/null +++ b/UI/CalamitasEnchantments/Enchantment.cs @@ -0,0 +1,38 @@ +using System; +using Terraria; + +namespace CalamityMod.UI.CalamitasEnchants +{ + public struct Enchantment + { + public string Name; + public string Description; + public Action CreationEffect; + public Action HoldEffect; + public Predicate ApplyRequirement; + public Enchantment(string name, string description, Action creationEffect, Action holdEffect, Predicate requirement) + { + Name = name; + Description = description; + CreationEffect = creationEffect; + HoldEffect = holdEffect; + ApplyRequirement = requirement; + } + public Enchantment(string name, string description, Action holdEffect, Predicate requirement) + { + Name = name; + Description = description; + CreationEffect = null; + HoldEffect = holdEffect; + ApplyRequirement = requirement; + } + public Enchantment(string name, string description, Action creationEffect, Predicate requirement) + { + Name = name; + Description = description; + CreationEffect = creationEffect; + HoldEffect = null; + ApplyRequirement = requirement; + } + } +} diff --git a/UI/CalamitasEnchantments/EnchantmentManager.cs b/UI/CalamitasEnchantments/EnchantmentManager.cs new file mode 100644 index 0000000000..f9e2af8c44 --- /dev/null +++ b/UI/CalamitasEnchantments/EnchantmentManager.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Terraria; + +namespace CalamityMod.UI.CalamitasEnchants +{ + public static class EnchantmentManager + { + public static List EnchantmentList { get; internal set; } = new List(); + public static Enchantment ClearEnchantment { get; internal set; } + public static IEnumerable GetValidEnchantmentsForItem(Item item) + { + // Do nothing if the item cannot be enchanted. + if (item.IsAir || item.damage <= 0) + yield break; + + // Only give the option to clear if the item already has an enchantment. + if (item.Calamity().AppliedEnchantment.HasValue) + { + yield return ClearEnchantment; + yield break; + } + + // Otherwise check based on all the requirements for all enchantments. + foreach (Enchantment enchantment in EnchantmentList) + { + // Don't incorporate an enchantment in the list if the item already has it. + if (item.Calamity().AppliedEnchantment.HasValue && item.Calamity().AppliedEnchantment.Value.Equals(enchantment)) + continue; + + if (enchantment.ApplyRequirement(item)) + yield return enchantment; + } + } + + public static Enchantment? FindByName(string name, StringComparison comparisonType) + { + Enchantment? enchantment = EnchantmentList.FirstOrDefault(enchant => enchant.Name.Equals(name, comparisonType)); + if (enchantment.HasValue && !enchantment.Value.Equals(default(Enchantment))) + return enchantment; + return null; + } + + public static void LoadAllEnchantments() + { + EnchantmentList.Add(new Enchantment("Self-Sacrificial", "Does 10% more damage at the cost of 20% of your max life", item => + { + item.damage = (int)(item.damage * 1.2); + }, + player => + { + player.Calamity().sacrificeEnchant = true; + }, item => item.damage > 0)); + + ClearEnchantment = new Enchantment("Disenchant", string.Empty, item => + { + item.Calamity().AppliedEnchantment = null; + }, item => item.damage > 0); + } + + public static void UnloadAllEnchantments() => EnchantmentList = null; + } +} From ab98cf874ceeb9eaed773a26e4654b5e804f737a Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Tue, 13 Apr 2021 16:26:11 -0500 Subject: [PATCH 076/202] Made disenchantment text white --- UI/CalamitasEnchantments/CalamitasEnchantUI.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/UI/CalamitasEnchantments/CalamitasEnchantUI.cs b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs index 74f51a0b5f..192a622a1f 100644 --- a/UI/CalamitasEnchantments/CalamitasEnchantUI.cs +++ b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs @@ -204,9 +204,15 @@ namespace CalamityMod.UI.CalamitasEnchants Enchantment? enchantmentToUse = null; for (int i = 0; i < totalEnchantmentsToDisplay; i++) { + Color textColor = Color.Orange; Vector2 scale = Vector2.One; Enchantment enchantment = possibleEnchantments.ElementAt(i); + // Make the text for the disenchantment option white to differentiate it from + // everything else. + if (enchantment.Equals(EnchantmentManager.ClearEnchantment)) + textColor = Color.White; + // Save this enchantment specifically if it's the one that's going to be selected. if (i == SelectedEnchantmentIndex) { @@ -215,7 +221,7 @@ namespace CalamityMod.UI.CalamitasEnchants } // Draw all options. - ChatManager.DrawColorCodedStringWithShadow(spriteBatch, Main.fontMouseText, enchantment.Name, drawPosition, Color.Orange, 0f, Vector2.Zero, scale); + ChatManager.DrawColorCodedStringWithShadow(spriteBatch, Main.fontMouseText, enchantment.Name, drawPosition, textColor, 0f, Vector2.Zero, scale); textAreas.Add(new Rectangle((int)drawPosition.X, (int)drawPosition.Y, 180, 40)); drawPosition.Y += 60f; } From a49ee384457f89c9ed88063aef4944d656c68f84 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Tue, 13 Apr 2021 16:32:36 -0500 Subject: [PATCH 077/202] Reforge bonus text problem fix --- UI/CalamitasEnchantments/CalamitasEnchantUI.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/UI/CalamitasEnchantments/CalamitasEnchantUI.cs b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs index 192a622a1f..dc701508cf 100644 --- a/UI/CalamitasEnchantments/CalamitasEnchantUI.cs +++ b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs @@ -283,11 +283,9 @@ namespace CalamityMod.UI.CalamitasEnchants // Update the compare item. This is used check comparisons when showing reforge tooltip bonuses. // Updating it with the same bonuses as what was applied to the real item will negate the incorrect numbers, // such as absurd damage boosts. - if (Main.cpItem is null || Main.cpItem.netID != CurrentlyHeldItem.netID) - { + if (Main.cpItem is null) Main.cpItem = new Item(); - Main.cpItem.netDefaults(CurrentlyHeldItem.netID); - } + Main.cpItem.SetDefaults(Main.cpItem.type); Main.cpItem.Calamity().AppliedEnchantment = enchantmentToUse.Value; enchantmentToUse.Value.CreationEffect?.Invoke(Main.cpItem); From 23bd9850ad5e4bf18b757d851773f155deb558e2 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Tue, 13 Apr 2021 16:32:50 -0500 Subject: [PATCH 078/202] Slight enchantment definition cleanup --- .../EnchantmentManager.cs | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/UI/CalamitasEnchantments/EnchantmentManager.cs b/UI/CalamitasEnchantments/EnchantmentManager.cs index f9e2af8c44..95fab232ff 100644 --- a/UI/CalamitasEnchantments/EnchantmentManager.cs +++ b/UI/CalamitasEnchantments/EnchantmentManager.cs @@ -44,19 +44,14 @@ namespace CalamityMod.UI.CalamitasEnchants public static void LoadAllEnchantments() { - EnchantmentList.Add(new Enchantment("Self-Sacrificial", "Does 10% more damage at the cost of 20% of your max life", item => - { - item.damage = (int)(item.damage * 1.2); - }, - player => - { - player.Calamity().sacrificeEnchant = true; - }, item => item.damage > 0)); + EnchantmentList.Add(new Enchantment("Self-Sacrificial", "Does 10% more damage at the cost of 20% of your max life", + item => item.damage = (int)(item.damage * 1.1), + player => player.Calamity().sacrificeEnchant = true, + item => item.damage > 0)); - ClearEnchantment = new Enchantment("Disenchant", string.Empty, item => - { - item.Calamity().AppliedEnchantment = null; - }, item => item.damage > 0); + ClearEnchantment = new Enchantment("Disenchant", string.Empty, + item => item.Calamity().AppliedEnchantment = null, + item => item.damage > 0); } public static void UnloadAllEnchantments() => EnchantmentList = null; From db24a79d1681fda1320f4023f3e097d8d4b1e200 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Tue, 13 Apr 2021 17:08:35 -0500 Subject: [PATCH 079/202] Added descriptions on selection --- .../CalamitasEnchantUI.cs | 64 ++++++++++++------- .../EnchantmentManager.cs | 14 ++++ 2 files changed, 54 insertions(+), 24 deletions(-) diff --git a/UI/CalamitasEnchantments/CalamitasEnchantUI.cs b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs index dc701508cf..e128d01c5f 100644 --- a/UI/CalamitasEnchantments/CalamitasEnchantUI.cs +++ b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs @@ -14,7 +14,7 @@ namespace CalamityMod.UI.CalamitasEnchants public class CalamitasEnchantUI { public static int NPCIndex = -1; - public static int SelectedEnchantmentIndex = -1; + public static Enchantment? SelectedEnchantment = null; public static float SelectedEnchantmentScaleFactor = 1f; public static Item CurrentlyHeldItem = new Item(); @@ -85,12 +85,22 @@ namespace CalamityMod.UI.CalamitasEnchants if (isHoveringOverItemIcon) InteractWithItemSlot(); - Enchantment? enchantmentToUse = DisplayEnchantOptions(spriteBatch, ReforgeUITopLeft + new Vector2(112f, 55f), out List textAreas); - InteractWithTextAreas(textAreas); + DisplayEnchantmentOptions(spriteBatch, ReforgeUITopLeft + new Vector2(112f, 55f), + out List textAreas, + out IEnumerable possibleEnchantments, + out Enchantment? enchantmentToUse); + + InteractWithTextAreas(textAreas, possibleEnchantments); int cost = 0; - if (SelectedEnchantmentIndex != -1) - cost = DisplayEnchantCost(spriteBatch); + if (SelectedEnchantment.HasValue) + { + cost = DisplayEnchantmentCost(spriteBatch, out Point costDrawPositionTopLeft); + Point descriptionDrawPositionTopLeft = costDrawPositionTopLeft; + descriptionDrawPositionTopLeft.Y += 90; + + DisplayEnchantmentDescription(spriteBatch, descriptionDrawPositionTopLeft); + } if (isHoveringOverReforgeIcon && Main.mouseLeft && Main.mouseLeftRelease) InteractWithReforgeIcon(enchantmentToUse, cost); @@ -177,31 +187,31 @@ namespace CalamityMod.UI.CalamitasEnchants { // Reset the enchantment variables. SelectedEnchantmentScaleFactor = 1f; - SelectedEnchantmentIndex = -1; + SelectedEnchantment = null; Utils.Swap(ref Main.mouseItem, ref CurrentlyHeldItem); Main.PlaySound(SoundID.Grab); } } - public static Enchantment? DisplayEnchantOptions(SpriteBatch spriteBatch, Vector2 drawPosition, out List textAreas) + public static void DisplayEnchantmentOptions(SpriteBatch spriteBatch, Vector2 drawPosition, out List textAreas, out IEnumerable possibleEnchantments, out Enchantment? enchantmentToUse) { - IEnumerable possibleEnchantments = EnchantmentManager.GetValidEnchantmentsForItem(CurrentlyHeldItem); + enchantmentToUse = null; + possibleEnchantments = EnchantmentManager.GetValidEnchantmentsForItem(CurrentlyHeldItem); // Initialize the areas. textAreas = new List(); - if (SelectedEnchantmentIndex == -1) + if (SelectedEnchantment is null) SelectedEnchantmentScaleFactor = MathHelper.Lerp(SelectedEnchantmentScaleFactor, 1f, 0.15f); else SelectedEnchantmentScaleFactor = MathHelper.Lerp(SelectedEnchantmentScaleFactor, 1.35f, 0.15f); // Don't attempt to draw anything if no valid enchantments exist for an item, for whatever reason. if (possibleEnchantments.Count() <= 0) - return null; + return; int totalEnchantmentsToDisplay = Math.Min(possibleEnchantments.Count(), 6); - Enchantment? enchantmentToUse = null; for (int i = 0; i < totalEnchantmentsToDisplay; i++) { Color textColor = Color.Orange; @@ -214,7 +224,7 @@ namespace CalamityMod.UI.CalamitasEnchants textColor = Color.White; // Save this enchantment specifically if it's the one that's going to be selected. - if (i == SelectedEnchantmentIndex) + if (enchantment.Equals(SelectedEnchantment)) { scale *= SelectedEnchantmentScaleFactor; enchantmentToUse = enchantment; @@ -222,41 +232,47 @@ namespace CalamityMod.UI.CalamitasEnchants // Draw all options. ChatManager.DrawColorCodedStringWithShadow(spriteBatch, Main.fontMouseText, enchantment.Name, drawPosition, textColor, 0f, Vector2.Zero, scale); - textAreas.Add(new Rectangle((int)drawPosition.X, (int)drawPosition.Y, 180, 40)); - drawPosition.Y += 60f; + textAreas.Add(new Rectangle((int)drawPosition.X, (int)drawPosition.Y, 180, 30)); + drawPosition.Y += 32f; } - - return enchantmentToUse; } - public static void InteractWithTextAreas(List textAreas) + public static void InteractWithTextAreas(List textAreas, IEnumerable possibleEnchantments) { for (int i = 0; i < textAreas.Count; i++) { Rectangle area = textAreas[i]; + Enchantment enchantmentAtIndex = possibleEnchantments.ElementAt(i); if (Main.mouseLeft && Main.mouseLeftRelease && MouseScreenArea.Intersects(area)) { - if (SelectedEnchantmentIndex == i) - SelectedEnchantmentIndex = -1; + if (SelectedEnchantment.Equals(enchantmentAtIndex)) + SelectedEnchantment = null; else - SelectedEnchantmentIndex = i; + SelectedEnchantment = enchantmentAtIndex; break; } } } - public static int DisplayEnchantCost(SpriteBatch spriteBatch) + public static int DisplayEnchantmentCost(SpriteBatch spriteBatch, out Point costDrawPositionTopLeft) { + costDrawPositionTopLeft = (ReforgeUITopLeft + new Vector2(18f, 34f)).ToPoint(); if (CurrentlyHeldItem.IsAir) return 0; int cost = CurrentlyHeldItem.value * 4; - Point topLeftDrawPosition = (ReforgeUITopLeft + new Vector2(18f, 34f)).ToPoint(); - ItemSlot.DrawMoney(spriteBatch, "Cost: ", topLeftDrawPosition.X, topLeftDrawPosition.Y, Utils.CoinsSplit(cost)); + ItemSlot.DrawMoney(spriteBatch, "Cost: ", costDrawPositionTopLeft.X, costDrawPositionTopLeft.Y, Utils.CoinsSplit(cost)); return cost; } + public static void DisplayEnchantmentDescription(SpriteBatch spriteBatch, Point descriptionDrawPositionTopLeft) + { + Vector2 vectorDrawPosition = descriptionDrawPositionTopLeft.ToVector2(); + Vector2 scale = new Vector2(0.55f, 0.6f); + ChatManager.DrawColorCodedStringWithShadow(spriteBatch, Main.fontMouseText, SelectedEnchantment.Value.Description, vectorDrawPosition, Color.Orange, 0f, Vector2.Zero, scale); + } + public static void InteractWithReforgeIcon(Enchantment? enchantmentToUse, int cost) { // If there's no valid item in the slot, do nothing. @@ -294,7 +310,7 @@ namespace CalamityMod.UI.CalamitasEnchants // Reset the enchantment variables. SelectedEnchantmentScaleFactor = 1f; - SelectedEnchantmentIndex = -1; + SelectedEnchantment = null; Main.PlaySound(SoundID.DD2_BetsyFlameBreath, Main.LocalPlayer.Center); } diff --git a/UI/CalamitasEnchantments/EnchantmentManager.cs b/UI/CalamitasEnchantments/EnchantmentManager.cs index 95fab232ff..66cde07d57 100644 --- a/UI/CalamitasEnchantments/EnchantmentManager.cs +++ b/UI/CalamitasEnchantments/EnchantmentManager.cs @@ -22,6 +22,14 @@ namespace CalamityMod.UI.CalamitasEnchants yield break; } + // If an enchanted has already been selected, only show it to make space for the description. + // It can be unselected to reveal the others again. + if (CalamitasEnchantUI.SelectedEnchantment.HasValue) + { + yield return CalamitasEnchantUI.SelectedEnchantment.Value; + yield break; + } + // Otherwise check based on all the requirements for all enchantments. foreach (Enchantment enchantment in EnchantmentList) { @@ -49,6 +57,12 @@ namespace CalamityMod.UI.CalamitasEnchants player => player.Calamity().sacrificeEnchant = true, item => item.damage > 0)); + EnchantmentList.Add(new Enchantment("Self-Sacrificial", "Does 10% more damage at the cost of 20% of your max life", + item => item.damage = (int)(item.damage * 1.1), + player => player.Calamity().sacrificeEnchant = true, + item => item.damage > 0)); + + // Special disenchantment thing. This is separated from the list on purpose. ClearEnchantment = new Enchantment("Disenchant", string.Empty, item => item.Calamity().AppliedEnchantment = null, item => item.damage > 0); From 7973d01491b220d0ada687e020b11952de00b08b Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 14 Apr 2021 10:38:37 -0500 Subject: [PATCH 080/202] Load effect fix --- .../UI/CalamitasReforgeBackground.png | Bin 1094 -> 159 bytes Items/CalamityGlobalItem.cs | 13 ++++++++++--- UI/CalamitasEnchantments/CalamitasEnchantUI.cs | 6 +++--- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/ExtraTextures/UI/CalamitasReforgeBackground.png b/ExtraTextures/UI/CalamitasReforgeBackground.png index ceca2dd493f70e71bda58de23a3c4a2f5a167988..c708fc5ae96e452b17ab94b9311288e42c419c87 100644 GIT binary patch delta 117 zcmX@cF`rSfGr-TCmrII^fq{Y7)59f*fq^jugc+HEB91X(-zF+5@GuAXgt%t#@@g$y zx@lsbxHW^Sr;B4q#=W-(85x1fniT%8&+~8qvXFqxYDTL92F4q=Uetg@Jzf1=);T3K F0RR<*91Q>f literal 1094 zcmeAS@N?(olHy`uVBq!ia0y~yU{nBN5e{ac$ewM|oIr}PILO_JVcj{Imp~3nx}&cn z1H;CC?mvmFK)z6bPlzj!-Z#QOCa}EyM73eVk-&q3;quR44d~a*$))q zEbxddW?*6#aLlM@Cf$jhQr~W?Xykxct>#msQ zlDFdRPuM0^eS6Hb@9v39Dp4+# zeeD)mg`EKe@xvnod|0;0A^xZnJB=KG$tOAIdf1W9D5ffej$p8BRVbJOIt+o#(B70WZ9 zUDDr}cIo*>hvWOtFWDuLu@H`Zm|u!BGtvMyifPnmgW?7^e4zY4>kuA!+&T~Z-^0Me zLJW*rFzLLNfdD<>i$t=*z*92y=jD~#r85@Z%UjS|wYyR5)mwhnU8i;ipP0;RGFe?ZL(Sjpg3r7^ zF$?S`-v4d1^H}ir6BCa)Fk4=d$WU;XV&;9~@%cRS-bs7vH5boqmRN?vf{+QFxvgmrA6@o%2htPae}44$rjF6*2UngEBCgR}qu diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index dcd05cd988..5b80aa79fa 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -228,9 +228,6 @@ namespace CalamityMod.Items } if (item.type == ItemID.StarCannon) item.UseSound = null; - - if (!item.IsAir && item.Calamity().AppliedEnchantment.HasValue && item.Calamity().AppliedEnchantment.Value.CreationEffect != null) - item.Calamity().AppliedEnchantment.Value.CreationEffect(item); } #endregion @@ -495,7 +492,12 @@ namespace CalamityMod.Items Enchantment? savedEnchantment = EnchantmentManager.FindByName(tag.GetString("enchantment"), StringComparison.OrdinalIgnoreCase); if (savedEnchantment.HasValue) + { AppliedEnchantment = savedEnchantment.Value; + bool hasCreationEffect = AppliedEnchantment.Value.CreationEffect != null; + if (hasCreationEffect) + item.Calamity().AppliedEnchantment.Value.CreationEffect(item); + } } public override void LoadLegacy(Item item, BinaryReader reader) @@ -542,7 +544,12 @@ namespace CalamityMod.Items Enchantment? savedEnchantment = EnchantmentManager.FindByName(reader.ReadString(), StringComparison.OrdinalIgnoreCase); if (savedEnchantment.HasValue) + { AppliedEnchantment = savedEnchantment.Value; + bool hasCreationEffect = AppliedEnchantment.Value.CreationEffect != null; + if (hasCreationEffect) + item.Calamity().AppliedEnchantment.Value.CreationEffect(item); + } } #endregion diff --git a/UI/CalamitasEnchantments/CalamitasEnchantUI.cs b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs index e128d01c5f..4ddede0d76 100644 --- a/UI/CalamitasEnchantments/CalamitasEnchantUI.cs +++ b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs @@ -71,7 +71,7 @@ namespace CalamityMod.UI.CalamitasEnchants Texture2D backgroundTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/CalamitasReforgeBackground"); Texture2D pillarTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/CalamitasReforgePillar"); - Vector2 backgroundScale = MathHelper.Clamp(ResolutionRatio * 1.25f, 0.67f, 1f) * new Vector2(1.3f, 1f); + Vector2 backgroundScale = MathHelper.Clamp(ResolutionRatio * 1.25f, 0.67f, 1f) * new Vector2(1.3f, 0.85f); // Draw the background. spriteBatch.Draw(backgroundTexture, ReforgeUITopLeft, null, Color.White, 0f, Vector2.Zero, backgroundScale, SpriteEffects.None, 0f); @@ -85,7 +85,7 @@ namespace CalamityMod.UI.CalamitasEnchants if (isHoveringOverItemIcon) InteractWithItemSlot(); - DisplayEnchantmentOptions(spriteBatch, ReforgeUITopLeft + new Vector2(112f, 55f), + DisplayEnchantmentOptions(spriteBatch, ReforgeUITopLeft + new Vector2(112f, 35f), out List textAreas, out IEnumerable possibleEnchantments, out Enchantment? enchantmentToUse); @@ -109,7 +109,7 @@ namespace CalamityMod.UI.CalamitasEnchants public static void DrawIcons(SpriteBatch spriteBatch, out bool isHoveringOverItemIcon, out bool isHoveringOverReforgeIcon) { Texture2D itemSlotTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/CalamitasReforgeSlot"); - Vector2 itemSlotDrawPosition = ReforgeUITopLeft + new Vector2(40f, 65f); + Vector2 itemSlotDrawPosition = ReforgeUITopLeft + new Vector2(40f, 45f); Vector2 reforgeIconDrawPosition = itemSlotDrawPosition + Vector2.UnitX * (itemSlotTexture.Width * 0.5f + 24f); isHoveringOverReforgeIcon = false; From ddd43c2875a03824f6d2da668412f1d0545d3745 Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 16 Apr 2021 20:26:27 -0500 Subject: [PATCH 081/202] Improved UI visuals --- ExtraTextures/UI/CalamitasCurseBackground.png | Bin 0 -> 3317 bytes ...rgeSlot.png => CalamitasCurseItemSlot.png} | Bin .../UI/CalamitasCurseUI_ArrowDown.png | Bin 0 -> 236 bytes .../UI/CalamitasCurseUI_ArrowDownClicked.png | Bin 0 -> 221 bytes .../UI/CalamitasCurseUI_ArrowDownHovered.png | Bin 0 -> 196 bytes ExtraTextures/UI/CalamitasCurseUI_ArrowUp.png | Bin 0 -> 205 bytes .../UI/CalamitasCurseUI_ArrowUpClicked.png | Bin 0 -> 190 bytes .../UI/CalamitasCurseUI_ArrowUpHovered.png | Bin 0 -> 142 bytes ExtraTextures/UI/CalamitasCurseUI_Button.png | Bin 0 -> 585 bytes .../UI/CalamitasCurseUI_ButtonClicked.png | Bin 0 -> 468 bytes .../UI/CalamitasCurseUI_ButtonHovered.png | Bin 0 -> 409 bytes .../UI/CalamitasReforgeBackground.png | Bin 159 -> 0 bytes ExtraTextures/UI/CalamitasReforgePillar.png | Bin 505 -> 0 bytes .../CalamitasEnchantUI.cs | 227 +++++++++++------- .../EnchantmentManager.cs | 15 +- 15 files changed, 135 insertions(+), 107 deletions(-) create mode 100644 ExtraTextures/UI/CalamitasCurseBackground.png rename ExtraTextures/UI/{CalamitasReforgeSlot.png => CalamitasCurseItemSlot.png} (100%) create mode 100644 ExtraTextures/UI/CalamitasCurseUI_ArrowDown.png create mode 100644 ExtraTextures/UI/CalamitasCurseUI_ArrowDownClicked.png create mode 100644 ExtraTextures/UI/CalamitasCurseUI_ArrowDownHovered.png create mode 100644 ExtraTextures/UI/CalamitasCurseUI_ArrowUp.png create mode 100644 ExtraTextures/UI/CalamitasCurseUI_ArrowUpClicked.png create mode 100644 ExtraTextures/UI/CalamitasCurseUI_ArrowUpHovered.png create mode 100644 ExtraTextures/UI/CalamitasCurseUI_Button.png create mode 100644 ExtraTextures/UI/CalamitasCurseUI_ButtonClicked.png create mode 100644 ExtraTextures/UI/CalamitasCurseUI_ButtonHovered.png delete mode 100644 ExtraTextures/UI/CalamitasReforgeBackground.png delete mode 100644 ExtraTextures/UI/CalamitasReforgePillar.png diff --git a/ExtraTextures/UI/CalamitasCurseBackground.png b/ExtraTextures/UI/CalamitasCurseBackground.png new file mode 100644 index 0000000000000000000000000000000000000000..f6c3ca7fd26bc2e3bbe1e0186c6945ac359ca6df GIT binary patch literal 3317 zcmeHJ_gB+d7XKzBfrKJmdRY-rItT;_DjlR3DFPuZNLe5Rff!i^f&QNgpJPrvVXzuIXm~9_ug&io_Fu(-gjP(yQ{r0N)818 zfUu*3jVAy=a6EohfRDHT)SVy2J0J<3_Ex|{y21)ifJIokSOP#ZMQ}d^4gh?ByR)|~ zPY=LFl|}T_03i)25mOB%jF!9;zl6JqW~8vNoutEGZ4D#bHIqC}+rla`k^H~vsAMTv z7AEKoshDvc9kXQ^baTdH^2fd+)5E;zjVEb`&+dF%?%r5qe~s*7%1Z zIPX#>4c~|q1cV-b5m@OZhn8wAmEYdt+2y`Y+dFLZlSj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Cp#1Aj;?4?GwCyZcYI|L4LbxxwVk?oun^4`ZXDb^#Znm&jWGCqkS zh0mm0HkJ+8fQ6R;c7YNP`il$XdVJeIGl&)MVAN(Ia87Cv{i?Y>H%+&0FfYKy^IjFX z^^}B+X`B-Cd>cYu6UjKiuzA}B*3*`?aQ#&qi8y2Jln>6l;OGPi@)Xxc3qmsy=&VN> zchy%_k?+a@fe{r)>LD+*T84N?C)>9B3F>E;m)F+Cnq11!@+}g4^%bNk sn{%7Tc=KE?Jj_4En~wZM+Wf(hC$1@0eufVI-#?I!wyri0t#H@=1^VAW`v3p{ literal 0 HcmV?d00001 diff --git a/ExtraTextures/UI/CalamitasReforgeSlot.png b/ExtraTextures/UI/CalamitasCurseItemSlot.png similarity index 100% rename from ExtraTextures/UI/CalamitasReforgeSlot.png rename to ExtraTextures/UI/CalamitasCurseItemSlot.png diff --git a/ExtraTextures/UI/CalamitasCurseUI_ArrowDown.png b/ExtraTextures/UI/CalamitasCurseUI_ArrowDown.png new file mode 100644 index 0000000000000000000000000000000000000000..055426f728f68f8114ac2bdbff7cc1b810909aca GIT binary patch literal 236 zcmeAS@N?(olHy`uVBq!ia0vp^d_c^@!3HFQ8hUO4DaPU;cPEB*=VV?2IV|apzK#qG z8~eHcB(eheoCO|{#XwDmK$uZf!>a)(*y!ov7@`rJTvNZ|pFOj{9Q*yuE`ls=ZE^{- zIDIBDO5|=?deAIy-aIC;1F6Pm)b5|LOqf+8{r^9E^oa?AD>&0iL|U7F8q7{K3;nW| z<+Aa$_;i+wQ*LuG8_ZsQb_UC{^wcMfnKOJ19Bic%7wkX6pc8nbnDMBZ#DaajEetcw cj0_kU-rv#NUY+{jHPA5(p00i_>zopr0P@XF@c;k- literal 0 HcmV?d00001 diff --git a/ExtraTextures/UI/CalamitasCurseUI_ArrowDownClicked.png b/ExtraTextures/UI/CalamitasCurseUI_ArrowDownClicked.png new file mode 100644 index 0000000000000000000000000000000000000000..21aa985d34eabad705d19fb5d8b16d95ed6fd37f GIT binary patch literal 221 zcmV<303!d1P)Px#mq|oHR49?9&7lp#Kmdi||C%N>piYp63Ixy^Hs}VY834ruC^U*8z@xiChoDe- zO%;loCJl!=QPPkm_tX88U?w8hG490Blo-VK1aN(4Y&XaKVI!z=z*&zy9X|f^QGc zMu^JAM4koKV0uqojp)&|8NQ1)-RcRbWIL79VpwpqCvS4_ eKhIM+EDWJM>RO65Lqe+p%s~tC-&{J^Bf5d3hP{H^<$+$~ALYPOdEBB}pm+_9N3zcq1 z$M5_8kh?3TU37=7e1gHerv;Ypn7`bT74W^jU}>6@X6ntadnLXWdrXq;cwBk2eNn!~ zvfD@9SI$~>=f&~)m&|wW+Y#wkWHI-By=+h0-LyyC?QL39q$4HrflgxZboFyt=akR{ E0FnPsb^rhX literal 0 HcmV?d00001 diff --git a/ExtraTextures/UI/CalamitasCurseUI_ArrowUpClicked.png b/ExtraTextures/UI/CalamitasCurseUI_ArrowUpClicked.png new file mode 100644 index 0000000000000000000000000000000000000000..fc8bc6b53956aae46219c369e7b52cc23142ae96 GIT binary patch literal 190 zcmeAS@N?(olHy`uVBq!ia0vp^d_c^_!3HE-Zss2cQjEnx?oJHr&dIz4aw%;d~)D+BC9&x*HP0^^q+9JyAq`)>Vv!qmICoRj_)*Ou@^Xh+h@yAWb z;*U0nznXB}L~vcK_=C??O_zVNrEzgbzPfL_Vp?d+@28Arzf12q-})~s9vqaXaC~8m oo}cIAV?{q#A6NMowebh*NgwTv>e0%%KsPXWy85}Sb4q9e0P!|PqW}N^ literal 0 HcmV?d00001 diff --git a/ExtraTextures/UI/CalamitasCurseUI_ArrowUpHovered.png b/ExtraTextures/UI/CalamitasCurseUI_ArrowUpHovered.png new file mode 100644 index 0000000000000000000000000000000000000000..6894e585fc7ac632738c48ddf95bb60f51eaeccf GIT binary patch literal 142 zcmeAS@N?(olHy`uVBq!ia0vp^d_c^_!3HE-Zss2cQjEnx?oJHr&dIz4ay&d;978lF zCZ{ws?bk0eT+sMGV3uIygvdj^jUd1oYr3&Pu-{iAYocY!?GsKdzArxYh}`x#p|-|s mviz#wYO^M1DKop8F)`?E;4?oOma+tBCWEJ|pUXO@geCxK=`NH2 literal 0 HcmV?d00001 diff --git a/ExtraTextures/UI/CalamitasCurseUI_Button.png b/ExtraTextures/UI/CalamitasCurseUI_Button.png new file mode 100644 index 0000000000000000000000000000000000000000..42694b1b18d1d8b8ebf02f2fa13ec55200f70be5 GIT binary patch literal 585 zcmV-P0=E5$P)Px%14%?dR7i=PP1x^xISbneo6 zF!ZQh)Pom63NJ>dSUk9U$xU4mB~i>Mh!zh)Fmn(D*HxSj&*$!MT2~64^?RB5{dvE~ zZ@%C6dt-0{Is;w$)j1}`0Ek=D1?!ZYw9#qdpErs{YKTQ@&VHl+h3R&b^F-Lc)7t=4 z`qBjp6=nx)cB)wPQH|O=dd);j0rO?_;_Yfb0GX2EeAhC*oRtMdio=NbOj8 z7qpp5eV_Jy!oO+n3H4Q(`$B!iSDjmJ8Vy4k09p=J*W-#0jBEg~o{^=!Q(cGo27rrY zij&!`)x7tPR$YH^49Ie%Rp&-)#eo4Zx21aVj-$rVH2{{sDYa>C^aMCUVi|zssB}kf zq(r`79oq@$WM^?fX zc6*>1fWdBMN1}?mmiJEq7r27BF2BzJn6}ll_pGBo X^=OM-Px$j!8s8R7i=1HpW#|9QJHKaU$6FH=5*{h ziAfXvmZqMlo-b3+m;ZjEpUSlhMm(8Hc0b#*_#zrnAY})Qt4Zygpnm@%A^;ATO~OiP zN$nWrh0Ds=aUzT8dp~VzJl6w24U`X%bBlokGzK*QR_8nipwm-Ez0en{M?QcWsDLUc zdfJP-6NoZY`Sjq>QI+jUO>c%9Ln+`ioe z-UvdS?U7JtYh!lH`5F(1(xc7A6adX9O`CW#ya7y|KbZM2FRR^(4^T*D9f;T?AK)k# zOpnN}w<8nJ#6#H;xdY=nNA^l(g;G8|NBV0=9_DRy9_=q3190|uVNhqwJ~v@6A&I=& z)!sx;o&1L~$t(cvek<%n3c&XKx&v_iayPbJCaEK7_gg@O5q$z=fOubZ8x`{a0000< KMNUMnLSTaVUB<5f literal 0 HcmV?d00001 diff --git a/ExtraTextures/UI/CalamitasCurseUI_ButtonHovered.png b/ExtraTextures/UI/CalamitasCurseUI_ButtonHovered.png new file mode 100644 index 0000000000000000000000000000000000000000..3b9ad755f11a609e34d1486dfe988940b6e5591d GIT binary patch literal 409 zcmV;K0cQS*P)Px$Q%OWYR7i=R_Lcx=zV7_O17EVzC)|Ac8FI_xkd+%Q;0;o(_V$6r#er+9Z ziss+bOwHQXIsl(9Qw^}clg%5)+W^e2o&mUfoC;s%{8AlBUr>)UEbhz&QC>hPec@B* zy3ZO%yBW_|uS%c4)JfW!aT|b-@vHSlaHY;fGj6NA9^liXRwn{rGDCti4=JD$g0Fl&%(~HAIkiTdn-@sgg-}uTW1o;L3#{w9%Z`Qs7D&Q>eh%9Dc z;M)(vj25iHDnQ36dAc};czD0PdN8lqK!D}KE!NvNvW1!c|6hAI(N~i_;`s!RsWZH% z)LzWu5vF2K^pc;)-y2Qt&*F0yUnJLvVm)V1$9Pxh{J z)qgg$>KvDNU-&@G>8C_5BNyYEwa=}Vrh0NJXK&|XnA;H1_K{6jrGt5S2s@V``_;>{ z&Kz`6kCEw7IXCr^+p#A$ef`HRp2b+`wn#HMIavOmX0NIsxI$z?$n_46dPbgQoKN{p z{X7&{7VT|&U@FLZ&QF;Avi77;iVIA#IIev1ZSnr%sr7W(?7Uy^RruF`7iL=@)MI_p zIZ}Dib7ME2k3tjt7r0FddM4SD{9=l+*t%2ta}OWlz7=O4@nicwH=zqQ*Y&kLU$q3Y dKi{Hbe>SL 0f) + TopButtonClickCountdown--; + if (BottomButtonClickCountdown > 0f) + BottomButtonClickCountdown--; + if (ReforgeButtonClickCountdown > 0f) + ReforgeButtonClickCountdown--; + // Don't bother doing anything except resetting if not looking at the UI. if (!CurrentlyViewing) { @@ -47,6 +59,7 @@ namespace CalamityMod.UI.CalamitasEnchants CurrentlyHeldItem.TurnToAir(); } + EnchantIndex = 0; NPCIndex = -1; return; } @@ -69,71 +82,85 @@ namespace CalamityMod.UI.CalamitasEnchants Main.playerInventory = true; Main.npcChatText = string.Empty; - Texture2D backgroundTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/CalamitasReforgeBackground"); - Texture2D pillarTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/CalamitasReforgePillar"); - Vector2 backgroundScale = MathHelper.Clamp(ResolutionRatio * 1.25f, 0.67f, 1f) * new Vector2(1.3f, 0.85f); + Texture2D backgroundTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/CalamitasCurseBackground"); + Vector2 backgroundScale = Vector2.One * MathHelper.Clamp(ResolutionRatio * 1.25f, 0.67f, 1f); // Draw the background. spriteBatch.Draw(backgroundTexture, ReforgeUITopLeft, null, Color.White, 0f, Vector2.Zero, backgroundScale, SpriteEffects.None, 0f); - // As well as a cool pillar to the side. - Vector2 pillarDrawPosition = ReforgeUITopLeft + Vector2.UnitX * (backgroundScale.X * backgroundTexture.Width + 25f); - pillarDrawPosition.Y += 20f; - spriteBatch.Draw(pillarTexture, pillarDrawPosition, null, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + // Draw the item icon. + Vector2 itemSlotDrawPosition = ReforgeUITopLeft + new Vector2(30f, 50f) * backgroundScale; + Vector2 reforgeIconDrawPosition = ReforgeUITopLeft + new Vector2(88f, 60f) * backgroundScale; - DrawIcons(spriteBatch, out bool isHoveringOverItemIcon, out bool isHoveringOverReforgeIcon); - if (isHoveringOverItemIcon) - InteractWithItemSlot(); - - DisplayEnchantmentOptions(spriteBatch, ReforgeUITopLeft + new Vector2(112f, 35f), - out List textAreas, - out IEnumerable possibleEnchantments, - out Enchantment? enchantmentToUse); - - InteractWithTextAreas(textAreas, possibleEnchantments); + // Select the enchantment to use. + SelectEnchantment(out IEnumerable possibleEnchantments); + // Draw the cost and description. int cost = 0; if (SelectedEnchantment.HasValue) { - cost = DisplayEnchantmentCost(spriteBatch, out Point costDrawPositionTopLeft); + Point costDrawPositionTopLeft = (ReforgeUITopLeft + new Vector2(50f, 84f) * backgroundScale).ToPoint(); + cost = DrawEnchantmentCost(spriteBatch, costDrawPositionTopLeft); Point descriptionDrawPositionTopLeft = costDrawPositionTopLeft; descriptionDrawPositionTopLeft.Y += 90; - DisplayEnchantmentDescription(spriteBatch, descriptionDrawPositionTopLeft); + DrawEnchantmentDescription(spriteBatch, descriptionDrawPositionTopLeft); } - if (isHoveringOverReforgeIcon && Main.mouseLeft && Main.mouseLeftRelease) - InteractWithReforgeIcon(enchantmentToUse, cost); + DrawItemIcon(spriteBatch, itemSlotDrawPosition, reforgeIconDrawPosition, backgroundScale, out bool isHoveringOverItemIcon, out bool isHoveringOverReforgeIcon); + if (isHoveringOverItemIcon) + InteractWithItemSlot(); + + // Draw the buttons. + DrawAndInteractWithButtons(spriteBatch, possibleEnchantments, ReforgeUITopLeft + new Vector2(210f, 50f) * backgroundScale, ReforgeUITopLeft + new Vector2(210f, 90f) * backgroundScale, backgroundScale); + + // Draw the enchantment name. + if (SelectedEnchantment.HasValue) + DrawEnchantmentName(spriteBatch, ReforgeUITopLeft + new Vector2(130f, 64f) * backgroundScale); + + // Handle spending logic. + if (isHoveringOverReforgeIcon) + { + // Prevent the player from say, firing a weapon while the mouse is hovering over the icon. + Main.LocalPlayer.mouseInterface = false; + Main.blockMouse = true; + + if (Main.mouseLeft && Main.mouseLeftRelease) + { + InteractWithEnchantIcon(SelectedEnchantment, cost); + ReforgeButtonClickCountdown = 8f; + } + } } - public static void DrawIcons(SpriteBatch spriteBatch, out bool isHoveringOverItemIcon, out bool isHoveringOverReforgeIcon) + public static void DrawItemIcon(SpriteBatch spriteBatch, Vector2 itemSlotDrawPosition, Vector2 reforgeIconDrawPosition, Vector2 scale, out bool isHoveringOverItemIcon, out bool isHoveringOverReforgeIcon) { - Texture2D itemSlotTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/CalamitasReforgeSlot"); - Vector2 itemSlotDrawPosition = ReforgeUITopLeft + new Vector2(40f, 45f); - Vector2 reforgeIconDrawPosition = itemSlotDrawPosition + Vector2.UnitX * (itemSlotTexture.Width * 0.5f + 24f); - isHoveringOverReforgeIcon = false; - Rectangle reforgeIconArea = Utils.CenteredRectangle(reforgeIconDrawPosition, Main.reforgeTexture[0].Size()); + Texture2D itemSlotTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/CalamitasCurseItemSlot"); - Texture2D reforgeIconTexture = Main.reforgeTexture[0]; + Texture2D reforgeIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/CalamitasCurseUI_Button"); + Rectangle reforgeIconArea = new Rectangle((int)reforgeIconDrawPosition.X, (int)reforgeIconDrawPosition.Y, (int)(reforgeIconTexture.Width * scale.X), (int)(reforgeIconTexture.Height * scale.Y)); // Have the reforge icon light up if the mouse is hovering over it. if (MouseScreenArea.Intersects(reforgeIconArea)) { - reforgeIconTexture = Main.reforgeTexture[1]; + reforgeIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/CalamitasCurseUI_ButtonHovered"); isHoveringOverReforgeIcon = true; } - // This will be used for item deposit/withdrawal logic. - isHoveringOverItemIcon = MouseScreenArea.Intersects(Utils.CenteredRectangle(itemSlotDrawPosition, itemSlotTexture.Size())); + if (ReforgeButtonClickCountdown > 0f) + reforgeIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/CalamitasCurseUI_ButtonClicked"); - spriteBatch.Draw(itemSlotTexture, itemSlotDrawPosition, null, Color.White, 0f, itemSlotTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0f); + // This will be used for item deposit/withdrawal logic. + isHoveringOverItemIcon = MouseScreenArea.Intersects(new Rectangle((int)itemSlotDrawPosition.X, (int)itemSlotDrawPosition.Y, (int)(itemSlotTexture.Width * scale.X), (int)(itemSlotTexture.Height * scale.Y))); + + spriteBatch.Draw(itemSlotTexture, itemSlotDrawPosition, null, Color.White, 0f, Vector2.Zero, scale, SpriteEffects.None, 0f); // Draw the draw the item within the slot, if it exists. if (!CurrentlyHeldItem.IsAir) AttemptToDrawItemInIcon(spriteBatch, itemSlotDrawPosition); - spriteBatch.Draw(reforgeIconTexture, reforgeIconDrawPosition, null, Color.White, 0f, reforgeIconTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0f); + spriteBatch.Draw(reforgeIconTexture, reforgeIconDrawPosition, null, Color.White, 0f, Vector2.Zero, scale, SpriteEffects.None, 0f); } public static void AttemptToDrawItemInIcon(SpriteBatch spriteBatch, Vector2 drawPosition) @@ -156,12 +183,13 @@ namespace CalamityMod.UI.CalamitasEnchants itemScale = 36f / MathHelper.Max(itemFrame.Width, itemFrame.Height); itemScale *= inventoryScale * baseScale; + drawPosition += itemFrame.Size() * itemScale * new Vector2(0.65f, 0.6f); // Draw the item. if (ItemLoader.PreDrawInInventory(CurrentlyHeldItem, spriteBatch, drawPosition, itemFrame, CurrentlyHeldItem.GetAlpha(Color.White), CurrentlyHeldItem.GetColor(Color.White), itemTexture.Size() * 0.5f, itemScale)) { - spriteBatch.Draw(itemTexture, drawPosition, itemFrame, CurrentlyHeldItem.GetAlpha(Color.White), 0f, itemTexture.Size() * 0.5f, itemScale, SpriteEffects.None, 0f); - spriteBatch.Draw(itemTexture, drawPosition, itemFrame, CurrentlyHeldItem.GetColor(Color.White), 0f, itemTexture.Size() * 0.5f, itemScale, SpriteEffects.None, 0f); + spriteBatch.Draw(itemTexture, drawPosition, itemFrame, CurrentlyHeldItem.GetAlpha(Color.White), 0f, Vector2.Zero, itemScale, SpriteEffects.None, 0f); + spriteBatch.Draw(itemTexture, drawPosition, itemFrame, CurrentlyHeldItem.GetColor(Color.White), 0f, Vector2.Zero, itemScale, SpriteEffects.None, 0f); } } @@ -185,78 +213,88 @@ namespace CalamityMod.UI.CalamitasEnchants // Attempt to exchange if the slot is clicked. if (Main.mouseLeftRelease && Main.mouseLeft && (isHeldItemEnchantable || Main.mouseItem.IsAir)) { - // Reset the enchantment variables. - SelectedEnchantmentScaleFactor = 1f; - SelectedEnchantment = null; - Utils.Swap(ref Main.mouseItem, ref CurrentlyHeldItem); Main.PlaySound(SoundID.Grab); } } - public static void DisplayEnchantmentOptions(SpriteBatch spriteBatch, Vector2 drawPosition, out List textAreas, out IEnumerable possibleEnchantments, out Enchantment? enchantmentToUse) + public static void SelectEnchantment(out IEnumerable possibleEnchantments) { - enchantmentToUse = null; possibleEnchantments = EnchantmentManager.GetValidEnchantmentsForItem(CurrentlyHeldItem); + SelectedEnchantment = null; - // Initialize the areas. - textAreas = new List(); + if (possibleEnchantments.Count() > 0) + SelectedEnchantment = possibleEnchantments.ElementAt(EnchantIndex); + } - if (SelectedEnchantment is null) - SelectedEnchantmentScaleFactor = MathHelper.Lerp(SelectedEnchantmentScaleFactor, 1f, 0.15f); - else - SelectedEnchantmentScaleFactor = MathHelper.Lerp(SelectedEnchantmentScaleFactor, 1.35f, 0.15f); - - // Don't attempt to draw anything if no valid enchantments exist for an item, for whatever reason. - if (possibleEnchantments.Count() <= 0) + public static void DrawAndInteractWithButtons(SpriteBatch spriteBatch, IEnumerable possibleEnchantments, Vector2 topButtonTopLeft, Vector2 bottomButtonTopLeft, Vector2 scale) + { + // Leave the arrows blank if no possible enchants exist. + if (possibleEnchantments.Count() == 0) return; - int totalEnchantmentsToDisplay = Math.Min(possibleEnchantments.Count(), 6); - for (int i = 0; i < totalEnchantmentsToDisplay; i++) + // Decide textures. + Texture2D topArrowTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/CalamitasCurseUI_ArrowUp"); + Texture2D bottomArrowTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/CalamitasCurseUI_ArrowDown"); + if (TopButtonClickCountdown > 0f) + topArrowTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/CalamitasCurseUI_ArrowUpClicked"); + if (BottomButtonClickCountdown > 0f) + bottomArrowTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/CalamitasCurseUI_ArrowDownClicked"); + + Rectangle topButtonArea = new Rectangle((int)topButtonTopLeft.X, (int)topButtonTopLeft.Y, (int)(topArrowTexture.Width * scale.X), (int)(topArrowTexture.Height * scale.Y)); + Rectangle bottomButtonArea = new Rectangle((int)bottomButtonTopLeft.X, (int)bottomButtonTopLeft.Y, (int)(bottomArrowTexture.Width * scale.X), (int)(bottomArrowTexture.Height * scale.Y)); + bool hoveringOverTopArrow = MouseScreenArea.Intersects(topButtonArea); + bool hoveringOverBottomArrow = MouseScreenArea.Intersects(bottomButtonArea); + if (hoveringOverTopArrow) { - Color textColor = Color.Orange; - Vector2 scale = Vector2.One; - Enchantment enchantment = possibleEnchantments.ElementAt(i); + topArrowTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/CalamitasCurseUI_ArrowUpHovered"); - // Make the text for the disenchantment option white to differentiate it from - // everything else. - if (enchantment.Equals(EnchantmentManager.ClearEnchantment)) - textColor = Color.White; + // Prevent the player from say, firing a weapon while the mouse is hovering over the button. + Main.LocalPlayer.mouseInterface = false; + Main.blockMouse = true; + } + if (hoveringOverBottomArrow) + { + bottomArrowTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/CalamitasCurseUI_ArrowDownHovered"); - // Save this enchantment specifically if it's the one that's going to be selected. - if (enchantment.Equals(SelectedEnchantment)) + // Prevent the player from say, firing a weapon while the mouse is hovering over the button. + Main.LocalPlayer.mouseInterface = false; + Main.blockMouse = true; + } + + // Draw the arrows. + if (EnchantIndex > 0) + spriteBatch.Draw(topArrowTexture, topButtonTopLeft, null, Color.White, 0f, Vector2.Zero, scale, SpriteEffects.None, 0f); + if (EnchantIndex < possibleEnchantments.Count() - 1) + spriteBatch.Draw(bottomArrowTexture, bottomButtonTopLeft, null, Color.White, 0f, Vector2.Zero, scale, SpriteEffects.None, 0f); + + if (Main.mouseLeft && Main.mouseLeftRelease) + { + // Decement the enchantment index if the top button is pressed. + if (hoveringOverTopArrow && EnchantIndex > 0) { - scale *= SelectedEnchantmentScaleFactor; - enchantmentToUse = enchantment; + EnchantIndex--; + TopButtonClickCountdown = 8f; } - // Draw all options. - ChatManager.DrawColorCodedStringWithShadow(spriteBatch, Main.fontMouseText, enchantment.Name, drawPosition, textColor, 0f, Vector2.Zero, scale); - textAreas.Add(new Rectangle((int)drawPosition.X, (int)drawPosition.Y, 180, 30)); - drawPosition.Y += 32f; - } - } - - public static void InteractWithTextAreas(List textAreas, IEnumerable possibleEnchantments) - { - for (int i = 0; i < textAreas.Count; i++) - { - Rectangle area = textAreas[i]; - Enchantment enchantmentAtIndex = possibleEnchantments.ElementAt(i); - if (Main.mouseLeft && Main.mouseLeftRelease && MouseScreenArea.Intersects(area)) + // Increment the enchantment index if the bottom button is pressed. + if (hoveringOverBottomArrow && EnchantIndex < possibleEnchantments.Count() - 1) { - if (SelectedEnchantment.Equals(enchantmentAtIndex)) - SelectedEnchantment = null; - else - SelectedEnchantment = enchantmentAtIndex; - break; + EnchantIndex++; + TopButtonClickCountdown = 8f; } } } - public static int DisplayEnchantmentCost(SpriteBatch spriteBatch, out Point costDrawPositionTopLeft) + public static void DrawEnchantmentName(SpriteBatch spriteBatch, Vector2 nameDrawPositionTopLeft) + { + Vector2 scale = new Vector2(0.8f, 0.745f); + Color drawColor = SelectedEnchantment.Value.Equals(EnchantmentManager.ClearEnchantment) ? Color.White : Color.Orange; + ChatManager.DrawColorCodedStringWithShadow(spriteBatch, Main.fontMouseText, SelectedEnchantment.Value.Name, nameDrawPositionTopLeft, drawColor, 0f, Vector2.Zero, scale); + } + + public static int DrawEnchantmentCost(SpriteBatch spriteBatch, Point costDrawPositionTopLeft) { - costDrawPositionTopLeft = (ReforgeUITopLeft + new Vector2(18f, 34f)).ToPoint(); if (CurrentlyHeldItem.IsAir) return 0; @@ -266,14 +304,21 @@ namespace CalamityMod.UI.CalamitasEnchants return cost; } - public static void DisplayEnchantmentDescription(SpriteBatch spriteBatch, Point descriptionDrawPositionTopLeft) + public static void DrawEnchantmentDescription(SpriteBatch spriteBatch, Point descriptionDrawPositionTopLeft) { Vector2 vectorDrawPosition = descriptionDrawPositionTopLeft.ToVector2(); - Vector2 scale = new Vector2(0.55f, 0.6f); - ChatManager.DrawColorCodedStringWithShadow(spriteBatch, Main.fontMouseText, SelectedEnchantment.Value.Description, vectorDrawPosition, Color.Orange, 0f, Vector2.Zero, scale); + Vector2 scale = new Vector2(0.67f, 0.7f); + foreach (string line in Utils.WordwrapString(SelectedEnchantment.Value.Description, Main.fontMouseText, 400, 10, out _)) + { + if (string.IsNullOrEmpty(line)) + continue; + + ChatManager.DrawColorCodedStringWithShadow(spriteBatch, Main.fontMouseText, line, vectorDrawPosition, Color.Orange, 0f, Vector2.Zero, scale); + vectorDrawPosition.Y += 16; + } } - public static void InteractWithReforgeIcon(Enchantment? enchantmentToUse, int cost) + public static void InteractWithEnchantIcon(Enchantment? enchantmentToUse, int cost) { // If there's no valid item in the slot, do nothing. if (CurrentlyHeldItem.IsAir) @@ -308,10 +353,6 @@ namespace CalamityMod.UI.CalamitasEnchants // Take away the money for the cost. Main.LocalPlayer.BuyItem(cost); - // Reset the enchantment variables. - SelectedEnchantmentScaleFactor = 1f; - SelectedEnchantment = null; - Main.PlaySound(SoundID.DD2_BetsyFlameBreath, Main.LocalPlayer.Center); } } diff --git a/UI/CalamitasEnchantments/EnchantmentManager.cs b/UI/CalamitasEnchantments/EnchantmentManager.cs index 66cde07d57..1b136eab90 100644 --- a/UI/CalamitasEnchantments/EnchantmentManager.cs +++ b/UI/CalamitasEnchantments/EnchantmentManager.cs @@ -22,15 +22,7 @@ namespace CalamityMod.UI.CalamitasEnchants yield break; } - // If an enchanted has already been selected, only show it to make space for the description. - // It can be unselected to reveal the others again. - if (CalamitasEnchantUI.SelectedEnchantment.HasValue) - { - yield return CalamitasEnchantUI.SelectedEnchantment.Value; - yield break; - } - - // Otherwise check based on all the requirements for all enchantments. + // Check based on all the requirements for all enchantments. foreach (Enchantment enchantment in EnchantmentList) { // Don't incorporate an enchantment in the list if the item already has it. @@ -57,11 +49,6 @@ namespace CalamityMod.UI.CalamitasEnchants player => player.Calamity().sacrificeEnchant = true, item => item.damage > 0)); - EnchantmentList.Add(new Enchantment("Self-Sacrificial", "Does 10% more damage at the cost of 20% of your max life", - item => item.damage = (int)(item.damage * 1.1), - player => player.Calamity().sacrificeEnchant = true, - item => item.damage > 0)); - // Special disenchantment thing. This is separated from the list on purpose. ClearEnchantment = new Enchantment("Disenchant", string.Empty, item => item.Calamity().AppliedEnchantment = null, From ab74c4ebb9359a0031398b7b0dc554df8768ebda Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 16 Apr 2021 20:36:46 -0500 Subject: [PATCH 082/202] Added menu sounds on arrow clicks --- UI/CalamitasEnchantments/CalamitasEnchantUI.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/UI/CalamitasEnchantments/CalamitasEnchantUI.cs b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs index b00d0ecfbb..8d6d197a16 100644 --- a/UI/CalamitasEnchantments/CalamitasEnchantUI.cs +++ b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs @@ -275,13 +275,15 @@ namespace CalamityMod.UI.CalamitasEnchants { EnchantIndex--; TopButtonClickCountdown = 8f; + Main.PlaySound(SoundID.MenuTick); } // Increment the enchantment index if the bottom button is pressed. if (hoveringOverBottomArrow && EnchantIndex < possibleEnchantments.Count() - 1) { EnchantIndex++; - TopButtonClickCountdown = 8f; + BottomButtonClickCountdown = 8f; + Main.PlaySound(SoundID.MenuTick); } } } From 8d67efd68a5c041bad3828c2ebd52a786c031106 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 17 Apr 2021 09:28:38 -0500 Subject: [PATCH 083/202] Made requirement definitions less rigid Also did some refactoring and offset the name display a tiny bit --- .../CalamitasEnchantUI.cs | 134 +++++++++--------- UI/CalamitasEnchantments/Enchantment.cs | 19 ++- .../EnchantmentManager.cs | 13 +- Utilities/ItemUtils.cs | 8 ++ 4 files changed, 100 insertions(+), 74 deletions(-) diff --git a/UI/CalamitasEnchantments/CalamitasEnchantUI.cs b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs index 8d6d197a16..36e4b51445 100644 --- a/UI/CalamitasEnchantments/CalamitasEnchantUI.cs +++ b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs @@ -92,8 +92,11 @@ namespace CalamityMod.UI.CalamitasEnchants Vector2 itemSlotDrawPosition = ReforgeUITopLeft + new Vector2(30f, 50f) * backgroundScale; Vector2 reforgeIconDrawPosition = ReforgeUITopLeft + new Vector2(88f, 60f) * backgroundScale; + // Prevent the player from say, firing a weapon while the mouse is hovering over the UI. + DisableMouseWhenOverUI(backgroundTexture, backgroundScale); + // Select the enchantment to use. - SelectEnchantment(out IEnumerable possibleEnchantments); + IEnumerable possibleEnchantments = SelectEnchantment(); // Draw the cost and description. int cost = 0; @@ -116,23 +119,69 @@ namespace CalamityMod.UI.CalamitasEnchants // Draw the enchantment name. if (SelectedEnchantment.HasValue) - DrawEnchantmentName(spriteBatch, ReforgeUITopLeft + new Vector2(130f, 64f) * backgroundScale); + DrawEnchantmentName(spriteBatch, ReforgeUITopLeft + new Vector2(130f, 66f) * backgroundScale); // Handle spending logic. if (isHoveringOverReforgeIcon) { - // Prevent the player from say, firing a weapon while the mouse is hovering over the icon. - Main.LocalPlayer.mouseInterface = false; - Main.blockMouse = true; - if (Main.mouseLeft && Main.mouseLeftRelease) { - InteractWithEnchantIcon(SelectedEnchantment, cost); - ReforgeButtonClickCountdown = 8f; + InteractWithEnchantIcon(cost); + ReforgeButtonClickCountdown = 15f; } } } + public static void DisableMouseWhenOverUI(Texture2D backgroundTexture, Vector2 backgroundScale) + { + Rectangle backgroundArea = new Rectangle((int)ReforgeUITopLeft.X, (int)ReforgeUITopLeft.Y, (int)(backgroundTexture.Width * backgroundScale.X), (int)(backgroundTexture.Width * backgroundScale.Y)); + + if (MouseScreenArea.Intersects(backgroundArea)) + { + Main.LocalPlayer.mouseInterface = false; + Main.blockMouse = true; + } + } + + public static IEnumerable SelectEnchantment() + { + IEnumerable possibleEnchantments = EnchantmentManager.GetValidEnchantmentsForItem(CurrentlyHeldItem); + + // Select the enchantment based on an index in the possible enchantments. + // If no possible enchantments were found, default to null. + SelectedEnchantment = null; + + if (possibleEnchantments.Count() > 0) + SelectedEnchantment = possibleEnchantments.ElementAt(EnchantIndex); + + return possibleEnchantments; + } + + public static int DrawEnchantmentCost(SpriteBatch spriteBatch, Point costDrawPositionTopLeft) + { + if (CurrentlyHeldItem.IsAir) + return 0; + + int cost = CurrentlyHeldItem.value * 4; + ItemSlot.DrawMoney(spriteBatch, "Cost: ", costDrawPositionTopLeft.X, costDrawPositionTopLeft.Y, Utils.CoinsSplit(cost)); + + return cost; + } + + public static void DrawEnchantmentDescription(SpriteBatch spriteBatch, Point descriptionDrawPositionTopLeft) + { + Vector2 vectorDrawPosition = descriptionDrawPositionTopLeft.ToVector2(); + Vector2 scale = new Vector2(0.67f, 0.7f); + foreach (string line in Utils.WordwrapString(SelectedEnchantment.Value.Description, Main.fontMouseText, 400, 10, out _)) + { + if (string.IsNullOrEmpty(line)) + continue; + + ChatManager.DrawColorCodedStringWithShadow(spriteBatch, Main.fontMouseText, line, vectorDrawPosition, Color.Orange, 0f, Vector2.Zero, scale); + vectorDrawPosition.Y += 16; + } + } + public static void DrawItemIcon(SpriteBatch spriteBatch, Vector2 itemSlotDrawPosition, Vector2 reforgeIconDrawPosition, Vector2 scale, out bool isHoveringOverItemIcon, out bool isHoveringOverReforgeIcon) { isHoveringOverReforgeIcon = false; @@ -204,29 +253,14 @@ namespace CalamityMod.UI.CalamitasEnchants Main.instance.MouseTextHackZoom(string.Empty); } - // Prevent the player from say, firing a weapon while the mouse is hovering over the slot. - Main.LocalPlayer.mouseInterface = false; - Main.blockMouse = true; - - bool isHeldItemEnchantable = Main.mouseItem.damage > 0; - // Attempt to exchange if the slot is clicked. - if (Main.mouseLeftRelease && Main.mouseLeft && (isHeldItemEnchantable || Main.mouseItem.IsAir)) + if (Main.mouseLeftRelease && Main.mouseLeft && (Main.mouseItem.CanBeEnchantedBySomething() || Main.mouseItem.IsAir)) { Utils.Swap(ref Main.mouseItem, ref CurrentlyHeldItem); Main.PlaySound(SoundID.Grab); } } - public static void SelectEnchantment(out IEnumerable possibleEnchantments) - { - possibleEnchantments = EnchantmentManager.GetValidEnchantmentsForItem(CurrentlyHeldItem); - SelectedEnchantment = null; - - if (possibleEnchantments.Count() > 0) - SelectedEnchantment = possibleEnchantments.ElementAt(EnchantIndex); - } - public static void DrawAndInteractWithButtons(SpriteBatch spriteBatch, IEnumerable possibleEnchantments, Vector2 topButtonTopLeft, Vector2 bottomButtonTopLeft, Vector2 scale) { // Leave the arrows blank if no possible enchants exist. @@ -246,22 +280,11 @@ namespace CalamityMod.UI.CalamitasEnchants bool hoveringOverTopArrow = MouseScreenArea.Intersects(topButtonArea); bool hoveringOverBottomArrow = MouseScreenArea.Intersects(bottomButtonArea); if (hoveringOverTopArrow) - { topArrowTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/CalamitasCurseUI_ArrowUpHovered"); - // Prevent the player from say, firing a weapon while the mouse is hovering over the button. - Main.LocalPlayer.mouseInterface = false; - Main.blockMouse = true; - } if (hoveringOverBottomArrow) - { bottomArrowTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/CalamitasCurseUI_ArrowDownHovered"); - // Prevent the player from say, firing a weapon while the mouse is hovering over the button. - Main.LocalPlayer.mouseInterface = false; - Main.blockMouse = true; - } - // Draw the arrows. if (EnchantIndex > 0) spriteBatch.Draw(topArrowTexture, topButtonTopLeft, null, Color.White, 0f, Vector2.Zero, scale, SpriteEffects.None, 0f); @@ -274,7 +297,7 @@ namespace CalamityMod.UI.CalamitasEnchants if (hoveringOverTopArrow && EnchantIndex > 0) { EnchantIndex--; - TopButtonClickCountdown = 8f; + TopButtonClickCountdown = 15f; Main.PlaySound(SoundID.MenuTick); } @@ -282,7 +305,7 @@ namespace CalamityMod.UI.CalamitasEnchants if (hoveringOverBottomArrow && EnchantIndex < possibleEnchantments.Count() - 1) { EnchantIndex++; - BottomButtonClickCountdown = 8f; + BottomButtonClickCountdown = 15f; Main.PlaySound(SoundID.MenuTick); } } @@ -295,32 +318,7 @@ namespace CalamityMod.UI.CalamitasEnchants ChatManager.DrawColorCodedStringWithShadow(spriteBatch, Main.fontMouseText, SelectedEnchantment.Value.Name, nameDrawPositionTopLeft, drawColor, 0f, Vector2.Zero, scale); } - public static int DrawEnchantmentCost(SpriteBatch spriteBatch, Point costDrawPositionTopLeft) - { - if (CurrentlyHeldItem.IsAir) - return 0; - - int cost = CurrentlyHeldItem.value * 4; - ItemSlot.DrawMoney(spriteBatch, "Cost: ", costDrawPositionTopLeft.X, costDrawPositionTopLeft.Y, Utils.CoinsSplit(cost)); - - return cost; - } - - public static void DrawEnchantmentDescription(SpriteBatch spriteBatch, Point descriptionDrawPositionTopLeft) - { - Vector2 vectorDrawPosition = descriptionDrawPositionTopLeft.ToVector2(); - Vector2 scale = new Vector2(0.67f, 0.7f); - foreach (string line in Utils.WordwrapString(SelectedEnchantment.Value.Description, Main.fontMouseText, 400, 10, out _)) - { - if (string.IsNullOrEmpty(line)) - continue; - - ChatManager.DrawColorCodedStringWithShadow(spriteBatch, Main.fontMouseText, line, vectorDrawPosition, Color.Orange, 0f, Vector2.Zero, scale); - vectorDrawPosition.Y += 16; - } - } - - public static void InteractWithEnchantIcon(Enchantment? enchantmentToUse, int cost) + public static void InteractWithEnchantIcon(int cost) { // If there's no valid item in the slot, do nothing. if (CurrentlyHeldItem.IsAir) @@ -331,7 +329,7 @@ namespace CalamityMod.UI.CalamitasEnchants return; // If no enchantment has been selected, do nothing. - if (!enchantmentToUse.HasValue) + if (!SelectedEnchantment.HasValue) return; Item originalItem = CurrentlyHeldItem.Clone(); @@ -340,8 +338,8 @@ namespace CalamityMod.UI.CalamitasEnchants CurrentlyHeldItem.Prefix(oldPrefix); CurrentlyHeldItem = CurrentlyHeldItem.CloneWithModdedDataFrom(originalItem); - CurrentlyHeldItem.Calamity().AppliedEnchantment = enchantmentToUse.Value; - enchantmentToUse.Value.CreationEffect?.Invoke(CurrentlyHeldItem); + CurrentlyHeldItem.Calamity().AppliedEnchantment = SelectedEnchantment.Value; + SelectedEnchantment.Value.CreationEffect?.Invoke(CurrentlyHeldItem); // Update the compare item. This is used check comparisons when showing reforge tooltip bonuses. // Updating it with the same bonuses as what was applied to the real item will negate the incorrect numbers, @@ -349,8 +347,8 @@ namespace CalamityMod.UI.CalamitasEnchants if (Main.cpItem is null) Main.cpItem = new Item(); Main.cpItem.SetDefaults(Main.cpItem.type); - Main.cpItem.Calamity().AppliedEnchantment = enchantmentToUse.Value; - enchantmentToUse.Value.CreationEffect?.Invoke(Main.cpItem); + Main.cpItem.Calamity().AppliedEnchantment = SelectedEnchantment.Value; + SelectedEnchantment.Value.CreationEffect?.Invoke(Main.cpItem); // Take away the money for the cost. Main.LocalPlayer.BuyItem(cost); diff --git a/UI/CalamitasEnchantments/Enchantment.cs b/UI/CalamitasEnchantments/Enchantment.cs index 40e18b539f..2516b669df 100644 --- a/UI/CalamitasEnchantments/Enchantment.cs +++ b/UI/CalamitasEnchantments/Enchantment.cs @@ -9,7 +9,10 @@ namespace CalamityMod.UI.CalamitasEnchants public string Description; public Action CreationEffect; public Action HoldEffect; - public Predicate ApplyRequirement; + + // This is internal because CanBeAppliedTo should be used over this field directly. + // Using that has the benefit of null checks and is objectively superior to using the raw delegate. + internal Predicate ApplyRequirement; public Enchantment(string name, string description, Action creationEffect, Action holdEffect, Predicate requirement) { Name = name; @@ -34,5 +37,19 @@ namespace CalamityMod.UI.CalamitasEnchants HoldEffect = null; ApplyRequirement = requirement; } + + public bool CanBeAppliedTo(Item item) + { + // "Empty" items can never be enchanted. + if (item is null || item.IsAir) + return false; + + // If there is no requirement, always return true, bar the above requirement. + if (ApplyRequirement is null) + return true; + + // Otherwise return what the defined requirement says is needed. + return ApplyRequirement(item); + } } } diff --git a/UI/CalamitasEnchantments/EnchantmentManager.cs b/UI/CalamitasEnchantments/EnchantmentManager.cs index 1b136eab90..ba184a4d4d 100644 --- a/UI/CalamitasEnchantments/EnchantmentManager.cs +++ b/UI/CalamitasEnchantments/EnchantmentManager.cs @@ -12,7 +12,7 @@ namespace CalamityMod.UI.CalamitasEnchants public static IEnumerable GetValidEnchantmentsForItem(Item item) { // Do nothing if the item cannot be enchanted. - if (item.IsAir || item.damage <= 0) + if (!item.CanBeEnchantedBySomething()) yield break; // Only give the option to clear if the item already has an enchantment. @@ -44,10 +44,13 @@ namespace CalamityMod.UI.CalamitasEnchants public static void LoadAllEnchantments() { - EnchantmentList.Add(new Enchantment("Self-Sacrificial", "Does 10% more damage at the cost of 20% of your max life", - item => item.damage = (int)(item.damage * 1.1), - player => player.Calamity().sacrificeEnchant = true, - item => item.damage > 0)); + EnchantmentList = new List + { + new Enchantment("Self-Sacrificial", "Does 10% more damage at the cost of 20% of your max life", + item => item.damage = (int)(item.damage * 1.1), + player => player.Calamity().sacrificeEnchant = true, + item => item.damage > 0) + }; // Special disenchantment thing. This is separated from the list on purpose. ClearEnchantment = new Enchantment("Disenchant", string.Empty, diff --git a/Utilities/ItemUtils.cs b/Utilities/ItemUtils.cs index a96224be03..536a8361db 100644 --- a/Utilities/ItemUtils.cs +++ b/Utilities/ItemUtils.cs @@ -1,6 +1,8 @@ +using CalamityMod.UI.CalamitasEnchants; using CalamityMod.World; using Microsoft.Xna.Framework; using System.Collections.Generic; +using System.Linq; using System.Text; using Terraria; using Terraria.ID; @@ -261,6 +263,12 @@ namespace CalamityMod } #endregion + /// + /// Determines if an item can be enchanted by any item at all via Calamitas' enchantment system. + /// + /// The item to check. + public static bool CanBeEnchantedBySomething(this Item item) => EnchantmentManager.EnchantmentList.Any(enchantment => enchantment.ApplyRequirement(item)); + public static void ConsumeItemViaQuickBuff(Player player, Item item, int buffType, int buffTime, bool reducedPotionSickness) { bool showsOver = false; From 715fdad9e921c06a4f3b6c67421467c0abaa1903 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 17 Apr 2021 14:37:15 -0500 Subject: [PATCH 084/202] Centered enchantment names --- UI/CalamitasEnchantments/CalamitasEnchantUI.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/UI/CalamitasEnchantments/CalamitasEnchantUI.cs b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs index 36e4b51445..4b34b41903 100644 --- a/UI/CalamitasEnchantments/CalamitasEnchantUI.cs +++ b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs @@ -119,7 +119,7 @@ namespace CalamityMod.UI.CalamitasEnchants // Draw the enchantment name. if (SelectedEnchantment.HasValue) - DrawEnchantmentName(spriteBatch, ReforgeUITopLeft + new Vector2(130f, 66f) * backgroundScale); + DrawEnchantmentName(spriteBatch, ReforgeUITopLeft + new Vector2(216f, 66f) * backgroundScale); // Handle spending logic. if (isHoveringOverReforgeIcon) @@ -311,11 +311,13 @@ namespace CalamityMod.UI.CalamitasEnchants } } - public static void DrawEnchantmentName(SpriteBatch spriteBatch, Vector2 nameDrawPositionTopLeft) + public static void DrawEnchantmentName(SpriteBatch spriteBatch, Vector2 nameDrawCenter) { Vector2 scale = new Vector2(0.8f, 0.745f); + float textWidth = Main.fontMouseText.MeasureString(SelectedEnchantment.Value.Name).X * scale.X; Color drawColor = SelectedEnchantment.Value.Equals(EnchantmentManager.ClearEnchantment) ? Color.White : Color.Orange; - ChatManager.DrawColorCodedStringWithShadow(spriteBatch, Main.fontMouseText, SelectedEnchantment.Value.Name, nameDrawPositionTopLeft, drawColor, 0f, Vector2.Zero, scale); + nameDrawCenter.X -= textWidth * 0.5f; + ChatManager.DrawColorCodedStringWithShadow(spriteBatch, Main.fontMouseText, SelectedEnchantment.Value.Name, nameDrawCenter, drawColor, 0f, Vector2.Zero, scale); } public static void InteractWithEnchantIcon(int cost) @@ -353,6 +355,9 @@ namespace CalamityMod.UI.CalamitasEnchants // Take away the money for the cost. Main.LocalPlayer.BuyItem(cost); + // Reset the enchantment index to prevent index problems on a different item. + EnchantIndex = 0; + Main.PlaySound(SoundID.DD2_BetsyFlameBreath, Main.LocalPlayer.Center); } } From 1632ef4541d369b248f5a483974a5d1cc4b41146 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 17 Apr 2021 15:00:37 -0500 Subject: [PATCH 085/202] Stackables and ammo can no longer be enchanted --- UI/CalamitasEnchantments/EnchantmentManager.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UI/CalamitasEnchantments/EnchantmentManager.cs b/UI/CalamitasEnchantments/EnchantmentManager.cs index ba184a4d4d..a5005a8662 100644 --- a/UI/CalamitasEnchantments/EnchantmentManager.cs +++ b/UI/CalamitasEnchantments/EnchantmentManager.cs @@ -49,13 +49,13 @@ namespace CalamityMod.UI.CalamitasEnchants new Enchantment("Self-Sacrificial", "Does 10% more damage at the cost of 20% of your max life", item => item.damage = (int)(item.damage * 1.1), player => player.Calamity().sacrificeEnchant = true, - item => item.damage > 0) + item => item.damage > 0 && item.maxStack == 1 && item.notAmmo) }; // Special disenchantment thing. This is separated from the list on purpose. ClearEnchantment = new Enchantment("Disenchant", string.Empty, item => item.Calamity().AppliedEnchantment = null, - item => item.damage > 0); + item => item.maxStack == 1 && item.notAmmo); } public static void UnloadAllEnchantments() => EnchantmentList = null; From 046d7b8d284bd809c99a7471e96e52ca4c839ec3 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 17 Apr 2021 15:55:50 -0500 Subject: [PATCH 086/202] ID loading system --- Items/CalamityGlobalItem.cs | 8 ++++---- UI/CalamitasEnchantments/Enchantment.cs | 13 ++++++++++--- UI/CalamitasEnchantments/EnchantmentManager.cs | 14 ++++++++------ 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 5b80aa79fa..649cc2a063 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -472,7 +472,7 @@ namespace CalamityMod.Items ["rarity"] = (int)customRarity, ["charge"] = Charge, ["reforgeTier"] = reforgeTier, - ["enchantment"] = AppliedEnchantment.HasValue ? AppliedEnchantment.Value.Name : string.Empty + ["enchantmentID"] = AppliedEnchantment.HasValue ? AppliedEnchantment.Value.ID : 0 }; } @@ -490,7 +490,7 @@ namespace CalamityMod.Items reforgeTier = tag.GetInt("reforgeTimer"); - Enchantment? savedEnchantment = EnchantmentManager.FindByName(tag.GetString("enchantment"), StringComparison.OrdinalIgnoreCase); + Enchantment? savedEnchantment = EnchantmentManager.FindByID(tag.GetInt("enchantmentID")); if (savedEnchantment.HasValue) { AppliedEnchantment = savedEnchantment.Value; @@ -529,7 +529,7 @@ namespace CalamityMod.Items writer.Write(timesUsed); writer.Write(Charge); writer.Write(reforgeTier); - writer.Write(AppliedEnchantment.HasValue ? AppliedEnchantment.Value.Name : string.Empty); + writer.Write(AppliedEnchantment.HasValue ? AppliedEnchantment.Value.ID : 0); } public override void NetReceive(Item item, BinaryReader reader) @@ -542,7 +542,7 @@ namespace CalamityMod.Items Charge = reader.ReadSingle(); reforgeTier = reader.ReadInt32(); - Enchantment? savedEnchantment = EnchantmentManager.FindByName(reader.ReadString(), StringComparison.OrdinalIgnoreCase); + Enchantment? savedEnchantment = EnchantmentManager.FindByID(reader.ReadInt32()); if (savedEnchantment.HasValue) { AppliedEnchantment = savedEnchantment.Value; diff --git a/UI/CalamitasEnchantments/Enchantment.cs b/UI/CalamitasEnchantments/Enchantment.cs index 2516b669df..68908fd0ac 100644 --- a/UI/CalamitasEnchantments/Enchantment.cs +++ b/UI/CalamitasEnchantments/Enchantment.cs @@ -10,32 +10,39 @@ namespace CalamityMod.UI.CalamitasEnchants public Action CreationEffect; public Action HoldEffect; + public int ID { get; internal set; } + + internal static readonly Random EnchantmentIDDecider = new Random(0xCA17A3); + // This is internal because CanBeAppliedTo should be used over this field directly. // Using that has the benefit of null checks and is objectively superior to using the raw delegate. internal Predicate ApplyRequirement; - public Enchantment(string name, string description, Action creationEffect, Action holdEffect, Predicate requirement) + public Enchantment(string name, string description, int id, Action creationEffect, Action holdEffect, Predicate requirement) { Name = name; Description = description; CreationEffect = creationEffect; HoldEffect = holdEffect; ApplyRequirement = requirement; + ID = id; } - public Enchantment(string name, string description, Action holdEffect, Predicate requirement) + public Enchantment(string name, string description, int id, Action holdEffect, Predicate requirement) { Name = name; Description = description; CreationEffect = null; HoldEffect = holdEffect; ApplyRequirement = requirement; + ID = id; } - public Enchantment(string name, string description, Action creationEffect, Predicate requirement) + public Enchantment(string name, string description, int id, Action creationEffect, Predicate requirement) { Name = name; Description = description; CreationEffect = creationEffect; HoldEffect = null; ApplyRequirement = requirement; + ID = id; } public bool CanBeAppliedTo(Item item) diff --git a/UI/CalamitasEnchantments/EnchantmentManager.cs b/UI/CalamitasEnchantments/EnchantmentManager.cs index a5005a8662..b31c60702f 100644 --- a/UI/CalamitasEnchantments/EnchantmentManager.cs +++ b/UI/CalamitasEnchantments/EnchantmentManager.cs @@ -7,6 +7,7 @@ namespace CalamityMod.UI.CalamitasEnchants { public static class EnchantmentManager { + internal const int ClearEnchantmentID = -18591774; public static List EnchantmentList { get; internal set; } = new List(); public static Enchantment ClearEnchantment { get; internal set; } public static IEnumerable GetValidEnchantmentsForItem(Item item) @@ -34,9 +35,9 @@ namespace CalamityMod.UI.CalamitasEnchants } } - public static Enchantment? FindByName(string name, StringComparison comparisonType) + public static Enchantment? FindByID(int id) { - Enchantment? enchantment = EnchantmentList.FirstOrDefault(enchant => enchant.Name.Equals(name, comparisonType)); + Enchantment? enchantment = EnchantmentList.FirstOrDefault(enchant => enchant.ID == id); if (enchantment.HasValue && !enchantment.Value.Equals(default(Enchantment))) return enchantment; return null; @@ -46,16 +47,17 @@ namespace CalamityMod.UI.CalamitasEnchants { EnchantmentList = new List { - new Enchantment("Self-Sacrificial", "Does 10% more damage at the cost of 20% of your max life", + new Enchantment("Self-Sacrificial", "Does 10% more damage at the cost of 20% of your max life", + 1, item => item.damage = (int)(item.damage * 1.1), player => player.Calamity().sacrificeEnchant = true, - item => item.damage > 0 && item.maxStack == 1 && item.notAmmo) + item => item.damage > 0 && item.maxStack == 1) }; // Special disenchantment thing. This is separated from the list on purpose. - ClearEnchantment = new Enchantment("Disenchant", string.Empty, + ClearEnchantment = new Enchantment("Disenchant", string.Empty, ClearEnchantmentID, item => item.Calamity().AppliedEnchantment = null, - item => item.maxStack == 1 && item.notAmmo); + item => item.maxStack == 1); } public static void UnloadAllEnchantments() => EnchantmentList = null; From 333b2da53346229bc5f5b6b23de6457fc6378be9 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 28 Apr 2021 14:22:56 -0500 Subject: [PATCH 087/202] Improved Eternity's visuals and reduced dust Also reduced its radius again so that wiki editors don't have to suffer lol --- ExtraTextures/EternityStreak.png | Bin 0 -> 65328 bytes Projectiles/Magic/EternityBook.cs | 2 +- Projectiles/Magic/EternityCircle.cs | 2 +- Projectiles/Magic/EternityHex.cs | 70 +++++++++++++++++++++------- Projectiles/Magic/EternityHoming.cs | 32 +++++-------- 5 files changed, 66 insertions(+), 40 deletions(-) create mode 100644 ExtraTextures/EternityStreak.png diff --git a/ExtraTextures/EternityStreak.png b/ExtraTextures/EternityStreak.png new file mode 100644 index 0000000000000000000000000000000000000000..8b7fcd0246f10e8cb6f4757f957fb385ea9f6173 GIT binary patch literal 65328 zcmXtfWn5G5ANJW8Fhbb~5kVLm5`vD95~Up7p@b--RX|WwkQ|6Qx+MjENT{T=AZ#L1 z5`sz#BOD;z4A}O}|MNUA&SyJsPTc1k*L8ibJIdTt?*#i9b^riQ80cdx0RY7K3j&}l zj30-GZ{7c$`B~~|0~P&3ON&$uIv7P^ZsZR{)@W zHNa?D2i*Soo3*Tb`NjzSoo=8cKREqVW9p>QiG8rL??>l$?G=nx6ha@92-IWaY?&lG z?zf+U#OqeIM}Kgt(juNx`;ZUvT=^jQm^R|EM*SVMvT$YH-mko6;5pqmw`L^xn^ngF zHPj_`A!OuoNkiyzgF0b#q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d;yH-FA6m` z%z@lsEux|wg3R<>QGiekdliO+;lY=mKJrin-X>UcqaF3C;`R&b%}qntOA|I8?Forh zsPKex4#Zk*1X&|dudq;~DKNxWCR{h>9%GI>`&7OGPsgNpFd|~ztdQqe*fhz9X+j-1 z|CBXr{>4W(!KiDa--ajaAG=tyxacz2?Z}A{NHttW?bL}Xwq+5g_(l=tv9?!M&!t|1Kcv70S@*2w0w%w79xPfuEfWQ;+q zE??Wx5p5aj%r{9)|6MO{M2DTS0$;*qjHfD?gc$^d%!v^DHBe>Ko@vrREq!Y!zBE&D z8_d1E&6>=tun(xk@uB^hDt-RYr96m8*sSo5y4wtYT#L@8Hb675_~>hU{pAaHE$1!t zkmT{=-Y1mA=ppk9)o)8jjbpk%I64|xrp^dAfT>(WwKe9d+*shzS3ZwSA76srMJ$XPFQD!Dh-a&d^*LHIy+DLd?4EuEEM*^GI q#-17gQjff$W}fL6JzHx7V+Rr@e>_|ax|!Vo_{YNJG_lH<6!U)@UYp1O literal 0 HcmV?d00001 diff --git a/Projectiles/Magic/EternityBook.cs b/Projectiles/Magic/EternityBook.cs index 61b77e0ceb..ab373b7042 100644 --- a/Projectiles/Magic/EternityBook.cs +++ b/Projectiles/Magic/EternityBook.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Projectiles.Magic Time++; // Summon a bunch of cool things the moment the book is created, assuming an NPC is near the mouse position. - if (Time == 1f) + if (Main.myPlayer == projectile.owner && Time == 1f) { NPC target = Main.MouseWorld.ClosestNPCAt(4400f, true, true); diff --git a/Projectiles/Magic/EternityCircle.cs b/Projectiles/Magic/EternityCircle.cs index 7fbc1e6174..c88d994190 100644 --- a/Projectiles/Magic/EternityCircle.cs +++ b/Projectiles/Magic/EternityCircle.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Magic get => (int)projectile.localAI[1]; set => projectile.localAI[1] = value; } - public const float TargetOffsetRadius = 595f; + public const float TargetOffsetRadius = 490f; public const float SinusoidalOffsetAngleIncrement = 0.54f; public static readonly float SinusoidalPositionAngleIncrement = MathHelper.ToRadians(3.5f); public override void SetStaticDefaults() diff --git a/Projectiles/Magic/EternityHex.cs b/Projectiles/Magic/EternityHex.cs index 79813a7cbb..f750703407 100644 --- a/Projectiles/Magic/EternityHex.cs +++ b/Projectiles/Magic/EternityHex.cs @@ -1,7 +1,10 @@ using CalamityMod.Items.Weapons.Magic; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using System; using Terraria; +using Terraria.Graphics.Shaders; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic @@ -10,6 +13,7 @@ namespace CalamityMod.Projectiles.Magic { public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + internal PrimitiveTrail LemniscateDrawer = null; public int TargetNPCIndex { get => (int)projectile.ai[0]; @@ -36,16 +40,20 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { DisplayName.SetDefault("Eternity"); + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 54; } public override void SetDefaults() { + ProjectileID.Sets.TrailCacheLength[projectile.type] = 63; projectile.width = 4; projectile.height = 4; projectile.tileCollide = false; projectile.extraUpdates = 1; projectile.alpha = 255; } + public override void AI() { Player player = Main.player[projectile.owner]; @@ -99,13 +107,16 @@ namespace CalamityMod.Projectiles.Magic for (int i = 0; i < 3; i++) { LemniscateAngle += MathHelper.TwoPi / 200f; - DrawLemniscate(target); + DetermineLemniscatePosition(target); } + if (Time < Lifetime * projectile.MaxUpdates) { float effectRate = MathHelper.Lerp(0.4f, 1f, Time / (Lifetime * projectile.MaxUpdates - 40)); float random = Main.rand.NextFloat(); + projectile.Opacity = Utils.InverseLerp(Lifetime * projectile.MaxUpdates, (Lifetime - 60f) * projectile.MaxUpdates, Time, true); + // Spawn a bunch of swirling dust and do damage. if (random <= effectRate) SpawnSwirlingDust(target); @@ -142,6 +153,7 @@ namespace CalamityMod.Projectiles.Magic projectile.Kill(); } } + public void DeathDust() { for (int i = 0; i < 44; i++) @@ -151,7 +163,8 @@ namespace CalamityMod.Projectiles.Magic dust.noGravity = true; } } - public void DrawLemniscate(NPC target) + + public void DetermineLemniscatePosition(NPC target) { // This value causes the lemniscate to smoothen out and look better. float scale = 2f / (3f - (float)Math.Cos(2 * LemniscateAngle)); @@ -160,16 +173,8 @@ namespace CalamityMod.Projectiles.Magic Vector2 lemniscateOffset = scale * new Vector2((float)Math.Cos(LemniscateAngle), (float)Math.Sin(2f * LemniscateAngle) / 2f); projectile.Center = target.Center + lemniscateOffset * outwardMultiplier; - - // This part isn't actually throughout the projectile's lifetime because of extra updates. - float completionValue = Utils.InverseLerp(0f, Lifetime, Time, true); - Color dustColor = Color.Lerp(new Color(245, 112, 218), new Color(28, 13, 118), completionValue); - - Dust dust = Dust.NewDustDirect(projectile.Center, 0, 0, Eternity.DustID, newColor: dustColor); - dust.velocity = Vector2.Zero; - dust.scale = MathHelper.Lerp(0.8f, 1.5f, completionValue); - dust.noGravity = true; } + public void ChooseNewTarget(NPC newTarget) { TargetNPCIndex = newTarget.whoAmI; @@ -189,24 +194,55 @@ namespace CalamityMod.Projectiles.Magic DeathDust(); } } + public void SpawnSwirlingDust(NPC target) { - for (int i = 0; i < 12; i++) + for (int i = 0; i < 3; i++) { float randomAngle = Main.rand.NextFloat() * MathHelper.TwoPi; float outwardnessFactor = Main.rand.NextFloat(); Vector2 spawnPosition = target.Center + randomAngle.ToRotationVector2() * MathHelper.Lerp(70f, EternityCircle.TargetOffsetRadius - 60f, outwardnessFactor); Vector2 velocity = (randomAngle - 3f * MathHelper.Pi / 8f).ToRotationVector2() * (10f + 9f * Main.rand.NextFloat() + 4f * outwardnessFactor); - Dust swirlingDust = Dust.NewDustPerfect(spawnPosition, Eternity.DustID, new Vector2?(velocity), 0, Main.rand.NextBool(3) ? Eternity.BlueColor : Eternity.PinkColor, 1.4f); - swirlingDust.scale = 0.8f; - swirlingDust.fadeIn = 0.95f + outwardnessFactor * 0.3f; + Dust swirlingDust = Dust.NewDustPerfect(spawnPosition, 267, new Vector2?(velocity), 0, Main.rand.NextBool(3) ? Eternity.BlueColor : Eternity.PinkColor, 1.4f); + swirlingDust.scale = 1.2f; + swirlingDust.fadeIn = 0.25f + outwardnessFactor * 0.1f; swirlingDust.noGravity = true; } } + // So that the player can gauge the DPS of this weapon effectively (StrikeNPC alone will not register the DPS to the player. I have to do this myself). public void RegisterDPS(int damage) { Main.player[projectile.owner].addDPS(damage); } - } -} \ No newline at end of file + + public Color PrimitiveColorFunction(float completionRatio) + { + float leftoverTimeScale = (float)Math.Sin(Main.GlobalTime * 4f) * 0.5f + 0.5f; + leftoverTimeScale *= 0.5f; + + Color headColor = Color.Lerp(Color.Black, Color.Magenta, 0.1f); + Color tailColor = Color.Lerp(Color.Magenta, Color.Cyan, completionRatio * 0.5f + leftoverTimeScale); + float opacity = (float)Math.Pow(Utils.InverseLerp(1f, 0.61f, completionRatio, true), 0.4) * projectile.Opacity; + float fadeToMagenta = MathHelper.SmoothStep(0f, 1f, (float)Math.Pow(completionRatio, 0.6D)); + + return Color.Lerp(headColor, tailColor, fadeToMagenta) * opacity; + } + + public float PrimitiveWidthFunction(float completionRatio) + { + float widthInterpolant = Utils.InverseLerp(0f, 0.12f, completionRatio, true); + return MathHelper.SmoothStep(1f, 10f, widthInterpolant); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + if (LemniscateDrawer is null) + LemniscateDrawer = new PrimitiveTrail(PrimitiveWidthFunction, PrimitiveColorFunction, null, GameShaders.Misc["CalamityMod:TrailStreak"]); + + GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(ModContent.GetTexture("CalamityMod/ExtraTextures/EternityStreak")); + LemniscateDrawer.Draw(projectile.oldPos, projectile.Size * 0.5f - Main.screenPosition, 84); + return false; + } + } +} diff --git a/Projectiles/Magic/EternityHoming.cs b/Projectiles/Magic/EternityHoming.cs index 4fe3a17bce..bca5378067 100644 --- a/Projectiles/Magic/EternityHoming.cs +++ b/Projectiles/Magic/EternityHoming.cs @@ -29,24 +29,7 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { - NPC target = null; - float distance = 4400f; - for (int index = 0; index < Main.npc.Length; index++) - { - if (Main.npc[index].CanBeChasedBy(null, false)) - { - if (Main.npc[index].boss && Vector2.Distance(projectile.Center, Main.npc[index].Center) <= 4400f) - { - target = Main.npc[index]; - break; - } - if (Vector2.Distance(projectile.Center, Main.npc[index].Center) < distance) - { - distance = Vector2.Distance(projectile.Center, Main.npc[index].Center); - target = Main.npc[index]; - } - } - } + NPC target = projectile.Center.ClosestNPCAt(3000f); if (target != null) { projectile.velocity = (projectile.velocity * 7f + projectile.DirectionTo(target.Center) * 10f) / 8f; @@ -54,12 +37,19 @@ namespace CalamityMod.Projectiles.Magic projectile.ai[0] += 0.18f; float angle = projectile.velocity.ToRotation() + MathHelper.PiOver2; float pulse = (float)Math.Sin(projectile.ai[0]); - float radius = 10f; + float radius = 4f; Vector2 offset = angle.ToRotationVector2() * pulse * radius; - Dust dust = Dust.NewDustPerfect(projectile.Center + offset, Eternity.DustID, Vector2.Zero, 0, Eternity.BlueColor); + + Dust dust = Dust.NewDustPerfect(projectile.Center + offset, 264, Vector2.Zero); + dust.color = Eternity.BlueColor; + dust.scale = 1.4f; + dust.noLight = true; dust.noGravity = true; - dust = Dust.NewDustPerfect(projectile.Center - offset, Eternity.DustID, Vector2.Zero, 0, Eternity.BlueColor); + dust = Dust.NewDustPerfect(projectile.Center - offset, 264, Vector2.Zero); + dust.color = Eternity.PinkColor; + dust.scale = 1.4f; + dust.noLight = true; dust.noGravity = true; } } From 65d56d86b39d2879e96ae7c5aa9283f8bda7b310 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 28 Apr 2021 14:27:02 -0500 Subject: [PATCH 088/202] Trail length fix --- Projectiles/Magic/EternityHex.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Projectiles/Magic/EternityHex.cs b/Projectiles/Magic/EternityHex.cs index f750703407..2f950b7059 100644 --- a/Projectiles/Magic/EternityHex.cs +++ b/Projectiles/Magic/EternityHex.cs @@ -41,12 +41,11 @@ namespace CalamityMod.Projectiles.Magic { DisplayName.SetDefault("Eternity"); ProjectileID.Sets.TrailingMode[projectile.type] = 2; - ProjectileID.Sets.TrailCacheLength[projectile.type] = 54; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 63; } public override void SetDefaults() { - ProjectileID.Sets.TrailCacheLength[projectile.type] = 63; projectile.width = 4; projectile.height = 4; projectile.tileCollide = false; From 16df53b2144d69068c881288de91f99418c4912a Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 30 Apr 2021 20:20:43 -0500 Subject: [PATCH 089/202] Error fix and start of demon enchantment (wip) --- CalPlayer/CalamityPlayer.cs | 6 +- Items/CalamityGlobalItem.cs | 53 ++++-- Items/CalamityGlobalItemTooltip.cs | 17 ++ NPCs/Other/CalamitasEnchantDemon.cs | 161 ++++++++++++++++++ NPCs/Other/CalamitasEnchantDemon.png | Bin 0 -> 8180 bytes Projectiles/Healing/DemonHeal.cs | 33 ++++ .../CalamitasEnchantUI.cs | 6 +- .../EnchantmentManager.cs | 10 +- 8 files changed, 264 insertions(+), 22 deletions(-) create mode 100644 NPCs/Other/CalamitasEnchantDemon.cs create mode 100644 NPCs/Other/CalamitasEnchantDemon.png create mode 100644 Projectiles/Healing/DemonHeal.cs diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index fafbbe4bf8..3f7242cc72 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -995,7 +995,7 @@ namespace CalamityMod.CalPlayer #endregion #region Calamitas Enchant Effects - public bool sacrificeEnchant = false; + public bool cursedSummonsEnchant = false; #endregion Calamitas Enchant Effects #endregion @@ -1363,8 +1363,6 @@ namespace CalamityMod.CalPlayer // Max health reductions if (crimEffigy) player.statLifeMax2 = (int)(player.statLifeMax2 * 0.9); - if (sacrificeEnchant) - player.statLifeMax2 = (int)(player.statLifeMax2 * 0.8); if (regenator) player.statLifeMax2 = (int)(player.statLifeMax2 * 0.5); @@ -1986,7 +1984,7 @@ namespace CalamityMod.CalPlayer RageDuration = DefaultRageDuration; RageDamageBoost = DefaultRageDamageBoost; - sacrificeEnchant = false; + cursedSummonsEnchant = false; lastProjectileHit = null; } diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 389adcd6df..2bb7bcb04f 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -5,6 +5,7 @@ using CalamityMod.Events; using CalamityMod.Items.Accessories; using CalamityMod.Items.Potions; using CalamityMod.Items.Weapons.Summon; +using CalamityMod.NPCs.Other; using CalamityMod.NPCs.SupremeCalamitas; using CalamityMod.NPCs.TownNPCs; using CalamityMod.Projectiles.Magic; @@ -14,6 +15,7 @@ using CalamityMod.Projectiles.Rogue; using CalamityMod.Projectiles.Summon; using CalamityMod.Projectiles.Typeless; using CalamityMod.UI; +using CalamityMod.UI.CalamitasEnchants; using CalamityMod.World; using Microsoft.Xna.Framework; using System; @@ -49,10 +51,14 @@ namespace CalamityMod.Items return float.IsNaN(ratio) || float.IsInfinity(ratio) ? 0f : MathHelper.Clamp(ratio, 0f, 1f); } } - #endregion + #endregion - // Miscellaneous stuff - public CalamityRarity customRarity = CalamityRarity.NoEffect; + #region Enchantment Variables + public Enchantment? AppliedEnchantment = null; + #endregion + + // Miscellaneous stuff + public CalamityRarity customRarity = CalamityRarity.NoEffect; public int timesUsed = 0; public int reforgeTier = 0; public bool donorItem = false; @@ -221,6 +227,7 @@ namespace CalamityMod.Items public override bool Shoot(Item item, Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { CalamityPlayer modPlayer = player.Calamity(); + if (rogue) { speedX *= modPlayer.throwingVelocity; @@ -457,8 +464,9 @@ namespace CalamityMod.Items ["timesUsed"] = timesUsed, ["rarity"] = (int)customRarity, ["charge"] = Charge, - ["reforgeTier"] = reforgeTier - }; + ["reforgeTier"] = reforgeTier, + ["enchantmentID"] = AppliedEnchantment.HasValue ? AppliedEnchantment.Value.ID : 0 + }; } public override void Load(Item item, TagCompound tag) @@ -474,7 +482,15 @@ namespace CalamityMod.Items Charge = tag.GetFloat("charge"); reforgeTier = tag.GetInt("reforgeTimer"); - } + Enchantment? savedEnchantment = EnchantmentManager.FindByID(tag.GetInt("enchantmentID")); + if (savedEnchantment.HasValue) + { + AppliedEnchantment = savedEnchantment.Value; + bool hasCreationEffect = AppliedEnchantment.Value.CreationEffect != null; + if (hasCreationEffect) + item.Calamity().AppliedEnchantment.Value.CreationEffect(item); + } + } public override void LoadLegacy(Item item, BinaryReader reader) { @@ -505,7 +521,8 @@ namespace CalamityMod.Items writer.Write(timesUsed); writer.Write(Charge); writer.Write(reforgeTier); - } + writer.Write(AppliedEnchantment.HasValue ? AppliedEnchantment.Value.ID : 0); + } public override void NetReceive(Item item, BinaryReader reader) { @@ -516,7 +533,16 @@ namespace CalamityMod.Items timesUsed = reader.ReadInt32(); Charge = reader.ReadSingle(); reforgeTier = reader.ReadInt32(); - } + + Enchantment? savedEnchantment = EnchantmentManager.FindByID(reader.ReadInt32()); + if (savedEnchantment.HasValue) + { + AppliedEnchantment = savedEnchantment.Value; + bool hasCreationEffect = AppliedEnchantment.Value.CreationEffect != null; + if (hasCreationEffect) + item.Calamity().AppliedEnchantment.Value.CreationEffect(item); + } + } #endregion #region Pickup Item Changes @@ -560,7 +586,7 @@ namespace CalamityMod.Items NetMessage.SendData(MessageID.MoonlordCountdown, -1, -1, null, NPC.MoonLordCountdown); } - return base.UseItem(item, player); + return base.UseItem(item, player); } public override bool AltFunctionUse(Item item, Player player) @@ -669,7 +695,14 @@ namespace CalamityMod.Items if (PopupGUIManager.AnyGUIsActive) return false; - if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0 && + if (player.Calamity().cursedSummonsEnchant && NPC.CountNPCS(ModContent.NPCType()) < 2) + { + Point spawnPosition = Main.MouseWorld.ToPoint(); + NPC.NewNPC(spawnPosition.X, spawnPosition.Y, ModContent.NPCType(), Target: player.whoAmI); + Main.PlaySound(SoundID.DD2_DarkMageSummonSkeleton, Main.MouseWorld); + } + + if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0 && (item.damage > 0 || item.ammo != AmmoID.None)) { return false; // Don't use weapons if you're charging with a spear diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index e6b3df9f97..f0ee590ff9 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -41,6 +41,10 @@ namespace CalamityMod.Items // This is placed between vanilla tooltip edits and mod mechanics because it can apply to vanilla items. StealthGenAccessoryTooltip(item, tooltips); + // If an item has an enchantment, show its prefix in the first tooltip line and append its description to the + // tooltip list. + EnchantmentTooltips(item, tooltips); + // Everything below this line can only apply to modded items. If the item is vanilla, stop here for efficiency. if (item.type < ItemID.Count) return; @@ -218,6 +222,19 @@ namespace CalamityMod.Items } #endregion + #region Enchantment Tooltips + private void EnchantmentTooltips(Item item, IList tooltips) + { + if (!item.IsAir && AppliedEnchantment.HasValue) + { + tooltips[0].text = $"{AppliedEnchantment.Value.Name} {tooltips[0].text}"; + + TooltipLine descriptionLine = new TooltipLine(mod, "Enchantment", CalamityUtils.ColorMessage(AppliedEnchantment.Value.Description, Color.DarkRed)); + tooltips.Add(descriptionLine); + } + } + #endregion + #region Vanilla Item Tooltip Modification private void ModifyVanillaTooltips(Item item, IList tooltips) { diff --git a/NPCs/Other/CalamitasEnchantDemon.cs b/NPCs/Other/CalamitasEnchantDemon.cs new file mode 100644 index 0000000000..f88ba5486a --- /dev/null +++ b/NPCs/Other/CalamitasEnchantDemon.cs @@ -0,0 +1,161 @@ +using CalamityMod.Projectiles.Healing; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.NPCs.Other +{ + public class CalamitasEnchantDemon : ModNPC + { + public Player Target => Main.player[npc.target]; + public ref float AttackTimer => ref npc.ai[0]; + public ref float FadeAwayTimer => ref npc.ai[1]; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Demon"); + Main.npcFrameCount[npc.type] = 5; + } + + public override void SetDefaults() + { + npc.width = 68; + npc.height = 68; + npc.damage = 0; + npc.defense = 0; + + // This is meant to be created after SCal is defeated and should be at least a little challenging. + npc.lifeMax = 166660; + npc.HitSound = SoundID.NPCHit47; + npc.DeathSound = SoundID.NPCDeath18; + npc.noGravity = true; + npc.noTileCollide = true; + npc.value = 0f; + npc.knockBackResist = 0f; + npc.netAlways = true; + npc.aiStyle = 0; + } + + public override void AI() + { + FadeAwayTimer++; + + // This npc should not attempt to locate other targets. The only one it will accept is the + // player who summoned it in the first place. + if (!Main.projectile.IndexInRange(npc.target) || Target.dead || !Target.active) + { + FadeAway(); + return; + } + + if (FadeAwayTimer < 15f) + { + DoInitializationAI(); + return; + } + + AttackTarget(); + } + + public void FadeAway() + { + npc.dontTakeDamage = true; + npc.Opacity = Utils.InverseLerp(50f, 0f, FadeAwayTimer, true); + + // Become inactive after fading away completely. + if (npc.Opacity <= 0f) + { + npc.active = false; + npc.netUpdate = true; + } + + // Slow down and fade away. + npc.velocity = Vector2.Lerp(npc.velocity, Vector2.UnitY * npc.Opacity * -2f, 0.125f); + + FadeAwayTimer++; + + if (Main.dedServ) + return; + + // Create some fade dust. + for (int i = 0; i < 3; i++) + { + Dust magic = Dust.NewDustDirect(npc.position, npc.width, npc.height, 223); + magic.velocity = -Vector2.UnitY * Main.rand.NextFloat(2.8f, 3.5f); + magic.scale = Main.rand.NextFloat(1f, 1.125f); + magic.fadeIn = 0.4f; + magic.noGravity = true; + magic.noLight = true; + } + } + + public void DoInitializationAI() + { + // Create a burst of magic on the first frame. + if (!Main.dedServ && FadeAwayTimer == 1f) + { + for (int i = 0; i < 50; i++) + { + Dust magic = Dust.NewDustDirect(npc.position, npc.width, npc.height, 223); + magic.velocity = -Vector2.UnitY * Main.rand.NextFloat(2.8f, 3.5f); + magic.scale = Main.rand.NextFloat(1f, 1.125f); + magic.fadeIn = 0.7f; + magic.noGravity = true; + magic.noLight = true; + } + } + + // Rise upward. + npc.velocity = Vector2.UnitX * MathHelper.Lerp(-0.1f, -3.5f, FadeAwayTimer / 15f); + } + + public void AttackTarget() + { + // Slow down prior to a charge. + if (AttackTimer % 120f > 90f) + npc.velocity *= 0.94f; + + // Otherwise attempt to move towards the player. + else if (!npc.WithinRange(Target.Center, 150f)) + { + Vector2 idealVelocity = npc.SafeDirectionTo(Target.Center) * 16f; + npc.velocity = (npc.velocity * 29f + idealVelocity) / 30f; + npc.velocity = Vector2.Lerp(npc.velocity, idealVelocity, 0.025f); + } + + // Charge. + if (AttackTimer % 120f == 119f) + npc.velocity = npc.SafeDirectionTo(Target.Center) * 23.5f; + + npc.spriteDirection = (npc.velocity.X < 0f).ToDirectionInt(); + } + + public override void FindFrame(int frameHeight) + { + npc.frameCounter++; + if (npc.frameCounter % 5f == 4f) + npc.frame.Y += frameHeight; + + if (npc.frame.Y >= frameHeight * Main.npcFrameCount[npc.type]) + npc.frame.Y = 0; + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Utils.PoofOfSmoke(npc.Center); + + // Release 4 healing projectiles towards the target. + if (Main.netMode != NetmodeID.MultiplayerClient) + { + for (int i = 0; i < 4; i++) + { + Vector2 shootVelocity = npc.SafeDirectionTo(Target.Center).RotatedByRandom(0.6f) * Main.rand.NextFloat(12f, 14f); + Projectile.NewProjectile(npc.Center, shootVelocity, ModContent.ProjectileType(), 0, 0f, npc.target); + } + } + } + } + } +} diff --git a/NPCs/Other/CalamitasEnchantDemon.png b/NPCs/Other/CalamitasEnchantDemon.png new file mode 100644 index 0000000000000000000000000000000000000000..bd3a5924ca1b3036a565056b45c1f0e1bb7af3cb GIT binary patch literal 8180 zcma)hcT^MGzwZD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6-a3i6_Uqh zG%oI^a#)%s+d{k=+IY~M-K(Nh=Z?nvAkQ-a+D_!Ds9yRq(n9{P zXrCGwtnqKO|6Q{)?O}k0;3Uhh%HrF&^C05S?7v2BJk|5|QCn}>jx+b{%@pEPWo!zc zPyI}FN~??`Cu;F1sD0JR1XGAsdJ2J>&h#gLXG)rOBNZ61hi<#o&=D6Aph^xC%Pvrp z&s2%OT+4DjDi%?LCNSMdYobbg*AgSZSu@VDl=I$FU#(u zDh)yA*t^>@Xr~JyF&XkkP)($ubpQN3rEUjI^pD-;eK+u<>BC`HsGy@PhI{hDb;>L# zxi(Z}5rpgWr@7;RnGqjxL9RT&Y&tFmqe-1V-EpwVT~q9{C5`jyP4A=HjkZjL9t`C) z0k81Ve@!}T)a~j4ck=jo3F!u24PF@u3z^rTjSozp6hDvQm|+w1own9~T8@}^U6Dy5r@a4_Wmfpr zPB*}ceqRYvBBJBuOS)P)ryu`b8*1J6-ZWzwl26;BJA^V+lUV}eT}$W-@$NAPg3W8^ z(@sYRV2rP?pIy4wZ6(*A6Zq?)F9rP41Rt;DOQRSV`8nHN){ifmch=Z@myTs?J1nLBK^7LEkp=nDF6K>Fu>ZCC8Su!M)&JMo9Nh5XUifUp0<4x zklX4@540I}DC6I*c@`Za{W38SB=D;dxB_})Xed9r4@-!h*8B={^O{;XB%?skqvsAm z@~O3LylxotKJ5iMJO=cLz?!A5XNn`aon2`kN~_Y85!H_vYx*XJ0weDJzxsAOn#LR# YQsVCWs`)Ya86UWP(@?weI{fkf0p%a}O#lD@ literal 0 HcmV?d00001 diff --git a/Projectiles/Healing/DemonHeal.cs b/Projectiles/Healing/DemonHeal.cs new file mode 100644 index 0000000000..fcff05e107 --- /dev/null +++ b/Projectiles/Healing/DemonHeal.cs @@ -0,0 +1,33 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Healing +{ + public class DemonHeal : ModProjectile + { + public Player Owner => Main.player[projectile.owner]; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public override void SetStaticDefaults() => DisplayName.SetDefault("Heal"); + + public override void SetDefaults() + { + projectile.width = 4; + projectile.height = 4; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.timeLeft = 640; + } + + public override void AI() + { + projectile.HealingProjectile(10, projectile.owner, 20f, 20f, true, 640); + + Dust fire = Dust.NewDustPerfect(projectile.Center, 130); + fire.velocity = Microsoft.Xna.Framework.Vector2.Zero; + fire.scale = Main.rand.NextFloat(1f, 1.15f); + fire.fadeIn = 0.45f; + fire.noGravity = true; + } + } +} diff --git a/UI/CalamitasEnchantments/CalamitasEnchantUI.cs b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs index 4b34b41903..b18fa5dd63 100644 --- a/UI/CalamitasEnchantments/CalamitasEnchantUI.cs +++ b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs @@ -232,13 +232,13 @@ namespace CalamityMod.UI.CalamitasEnchants itemScale = 36f / MathHelper.Max(itemFrame.Width, itemFrame.Height); itemScale *= inventoryScale * baseScale; - drawPosition += itemFrame.Size() * itemScale * new Vector2(0.65f, 0.6f); + drawPosition += Vector2.One * 23f * baseScale; // Draw the item. if (ItemLoader.PreDrawInInventory(CurrentlyHeldItem, spriteBatch, drawPosition, itemFrame, CurrentlyHeldItem.GetAlpha(Color.White), CurrentlyHeldItem.GetColor(Color.White), itemTexture.Size() * 0.5f, itemScale)) { - spriteBatch.Draw(itemTexture, drawPosition, itemFrame, CurrentlyHeldItem.GetAlpha(Color.White), 0f, Vector2.Zero, itemScale, SpriteEffects.None, 0f); - spriteBatch.Draw(itemTexture, drawPosition, itemFrame, CurrentlyHeldItem.GetColor(Color.White), 0f, Vector2.Zero, itemScale, SpriteEffects.None, 0f); + spriteBatch.Draw(itemTexture, drawPosition, itemFrame, CurrentlyHeldItem.GetAlpha(Color.White), 0f, itemFrame.Size() * 0.5f, itemScale, SpriteEffects.None, 0f); + spriteBatch.Draw(itemTexture, drawPosition, itemFrame, CurrentlyHeldItem.GetColor(Color.White), 0f, itemFrame.Size() * 0.5f, itemScale, SpriteEffects.None, 0f); } } diff --git a/UI/CalamitasEnchantments/EnchantmentManager.cs b/UI/CalamitasEnchantments/EnchantmentManager.cs index b31c60702f..7dde6936c9 100644 --- a/UI/CalamitasEnchantments/EnchantmentManager.cs +++ b/UI/CalamitasEnchantments/EnchantmentManager.cs @@ -13,7 +13,7 @@ namespace CalamityMod.UI.CalamitasEnchants public static IEnumerable GetValidEnchantmentsForItem(Item item) { // Do nothing if the item cannot be enchanted. - if (!item.CanBeEnchantedBySomething()) + if (item is null || !item.CanBeEnchantedBySomething()) yield break; // Only give the option to clear if the item already has an enchantment. @@ -47,11 +47,11 @@ namespace CalamityMod.UI.CalamitasEnchants { EnchantmentList = new List { - new Enchantment("Self-Sacrificial", "Does 10% more damage at the cost of 20% of your max life", - 1, + new Enchantment("Cursed", "Summons demons that harm you but drop healing items on death on item usage.", + 100, item => item.damage = (int)(item.damage * 1.1), - player => player.Calamity().sacrificeEnchant = true, - item => item.damage > 0 && item.maxStack == 1) + player => player.Calamity().cursedSummonsEnchant = true, + item => item.damage > 0 && item.maxStack == 1 && item.summon) }; // Special disenchantment thing. This is separated from the list on purpose. From aeb436afd167fda2e7b9f9655244e7a9577c5bc8 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sun, 2 May 2021 18:59:01 -0500 Subject: [PATCH 090/202] Error fix --- Projectiles/Ranged/CondemnationArrow.cs | 2 +- Projectiles/Ranged/CondemnationArrowHoming.cs | 2 +- Projectiles/Ranged/PrismComet.cs | 2 +- Projectiles/Rogue/PrismShurikenBlade.cs | 2 +- Projectiles/Rogue/SacrificeProjectile.cs | 2 +- Projectiles/Rogue/TheAtomSplitterDuplicate.cs | 2 +- Projectiles/Summon/BrimstoneDartSummon.cs | 2 +- Projectiles/Summon/DaedalusPellet.cs | 2 +- Projectiles/Summon/SlimePuppet.cs | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Projectiles/Ranged/CondemnationArrow.cs b/Projectiles/Ranged/CondemnationArrow.cs index 551270239e..ea57b89d1e 100644 --- a/Projectiles/Ranged/CondemnationArrow.cs +++ b/Projectiles/Ranged/CondemnationArrow.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(projectile, ProjectileID.Sets.TrailingMode[projectile.type], lightColor); return false; } diff --git a/Projectiles/Ranged/CondemnationArrowHoming.cs b/Projectiles/Ranged/CondemnationArrowHoming.cs index 7030158457..6e5d09f1d1 100644 --- a/Projectiles/Ranged/CondemnationArrowHoming.cs +++ b/Projectiles/Ranged/CondemnationArrowHoming.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, 1); + CalamityUtils.DrawAfterimagesCentered(projectile, ProjectileID.Sets.TrailingMode[projectile.type], lightColor); return false; } diff --git a/Projectiles/Ranged/PrismComet.cs b/Projectiles/Ranged/PrismComet.cs index f98fd7303b..044092df73 100644 --- a/Projectiles/Ranged/PrismComet.cs +++ b/Projectiles/Ranged/PrismComet.cs @@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + CalamityUtils.DrawAfterimagesCentered(projectile, ProjectileID.Sets.TrailingMode[projectile.type], lightColor); return false; } diff --git a/Projectiles/Rogue/PrismShurikenBlade.cs b/Projectiles/Rogue/PrismShurikenBlade.cs index cff7ed7a77..696565eed0 100644 --- a/Projectiles/Rogue/PrismShurikenBlade.cs +++ b/Projectiles/Rogue/PrismShurikenBlade.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + CalamityUtils.DrawAfterimagesCentered(projectile, ProjectileID.Sets.TrailingMode[projectile.type], lightColor); return false; } } diff --git a/Projectiles/Rogue/SacrificeProjectile.cs b/Projectiles/Rogue/SacrificeProjectile.cs index a91b5cc0b2..627fa81fca 100644 --- a/Projectiles/Rogue/SacrificeProjectile.cs +++ b/Projectiles/Rogue/SacrificeProjectile.cs @@ -80,7 +80,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type]); + CalamityUtils.DrawAfterimagesCentered(projectile, ProjectileID.Sets.TrailingMode[projectile.type], lightColor); return false; } diff --git a/Projectiles/Rogue/TheAtomSplitterDuplicate.cs b/Projectiles/Rogue/TheAtomSplitterDuplicate.cs index 7e10e32704..0dfc874940 100644 --- a/Projectiles/Rogue/TheAtomSplitterDuplicate.cs +++ b/Projectiles/Rogue/TheAtomSplitterDuplicate.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Projectiles.Rogue Color drawColor = CalamityUtils.MulticolorLerp((Time / 35f + projectile.identity / 4f) % 1f, CalamityGlobalItem.ExoPalette); drawColor.A = 0; - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, drawColor, ProjectileID.Sets.TrailingMode[projectile.type]); + CalamityUtils.DrawAfterimagesCentered(projectile, ProjectileID.Sets.TrailingMode[projectile.type], drawColor); return false; } } diff --git a/Projectiles/Summon/BrimstoneDartSummon.cs b/Projectiles/Summon/BrimstoneDartSummon.cs index 36d5a4fce7..4c234ceeba 100644 --- a/Projectiles/Summon/BrimstoneDartSummon.cs +++ b/Projectiles/Summon/BrimstoneDartSummon.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { lightColor.R = (byte)(255 * projectile.Opacity); - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + CalamityUtils.DrawAfterimagesCentered(projectile, ProjectileID.Sets.TrailingMode[projectile.type], lightColor, 1); return false; } } diff --git a/Projectiles/Summon/DaedalusPellet.cs b/Projectiles/Summon/DaedalusPellet.cs index afb538c7b9..99d908f1dd 100644 --- a/Projectiles/Summon/DaedalusPellet.cs +++ b/Projectiles/Summon/DaedalusPellet.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + CalamityUtils.DrawAfterimagesCentered(projectile, ProjectileID.Sets.TrailingMode[projectile.type], lightColor); return false; } } diff --git a/Projectiles/Summon/SlimePuppet.cs b/Projectiles/Summon/SlimePuppet.cs index a5e6e9821f..a7b390487e 100644 --- a/Projectiles/Summon/SlimePuppet.cs +++ b/Projectiles/Summon/SlimePuppet.cs @@ -111,7 +111,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + CalamityUtils.DrawAfterimagesCentered(projectile, ProjectileID.Sets.TrailingMode[projectile.type], lightColor); return false; } } From c863d5337146c2d008ca8706079bbff24f1748ed Mon Sep 17 00:00:00 2001 From: Dominic Date: Sun, 2 May 2021 19:36:06 -0500 Subject: [PATCH 091/202] Fixed Fabstaff referencing a renamed shader --- Projectiles/Magic/FabBolt.cs | 4 ++-- Projectiles/Magic/FabRay.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Projectiles/Magic/FabBolt.cs b/Projectiles/Magic/FabBolt.cs index e61e4f4d51..3894c65d7f 100644 --- a/Projectiles/Magic/FabBolt.cs +++ b/Projectiles/Magic/FabBolt.cs @@ -70,9 +70,9 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { if (TrailDrawer is null) - TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, PrimitiveTrail.SmoothCatmullRomPointRetreivalFunction, GameShaders.Misc["CalamityMod:FabstaffRay"]); + TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, PrimitiveTrail.SmoothCatmullRomPointRetreivalFunction, GameShaders.Misc["CalamityMod:TrailStreak"]); - GameShaders.Misc["CalamityMod:FabstaffRay"].SetShaderTexture(ModContent.GetTexture("CalamityMod/ExtraTextures/FabstaffStreak")); + GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(ModContent.GetTexture("CalamityMod/ExtraTextures/FabstaffStreak")); TrailDrawer.Draw(projectile.oldPos, projectile.Size * 0.5f - Main.screenPosition, 0, projectile.oldRot); return false; } diff --git a/Projectiles/Magic/FabRay.cs b/Projectiles/Magic/FabRay.cs index 2db4a6c8b8..69fd92b47b 100644 --- a/Projectiles/Magic/FabRay.cs +++ b/Projectiles/Magic/FabRay.cs @@ -78,9 +78,9 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { if (TrailDrawer is null) - TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, specialShader: GameShaders.Misc["CalamityMod:FabstaffRay"]); + TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, specialShader: GameShaders.Misc["CalamityMod:TrailStreak"]); - GameShaders.Misc["CalamityMod:FabstaffRay"].SetShaderTexture(ModContent.GetTexture("CalamityMod/ExtraTextures/ScarletDevilStreak")); + GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(ModContent.GetTexture("CalamityMod/ExtraTextures/ScarletDevilStreak")); TrailDrawer.Draw(projectile.oldPos, projectile.Size * 0.5f - Main.screenPosition, 76); return false; } From 4489c44094bde6bf2b6f71d561d72d5f6f3f951b Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Tue, 11 May 2021 17:38:58 -0500 Subject: [PATCH 092/202] Removed some useless directives --- NPCs/TownNPCs/WITCH.cs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/NPCs/TownNPCs/WITCH.cs b/NPCs/TownNPCs/WITCH.cs index 04be4e9e42..a370b8fde1 100644 --- a/NPCs/TownNPCs/WITCH.cs +++ b/NPCs/TownNPCs/WITCH.cs @@ -1,24 +1,16 @@ using CalamityMod.Dusts; -using CalamityMod.Items.Accessories; -using CalamityMod.Items.Tools; -using CalamityMod.Items.Weapons.Magic; -using CalamityMod.Items.Weapons.Melee; -using CalamityMod.Items.Weapons.Ranged; -using CalamityMod.Items.Weapons.Rogue; -using CalamityMod.Items.Weapons.Summon; using CalamityMod.Projectiles.Magic; -using CalamityMod.UI; using CalamityMod.UI.CalamitasEnchants; using CalamityMod.World; using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; using System.Collections.Generic; using Terraria; using Terraria.GameContent.Events; using Terraria.ID; -using Terraria.Localization; using Terraria.ModLoader; + using static Terraria.ModLoader.ModContent; + namespace CalamityMod.NPCs.TownNPCs { [AutoloadHead] From bf00ea7a293b335649b019ce8a7015381928f314 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 12 May 2021 09:42:09 -0500 Subject: [PATCH 093/202] UI adjustments --- UI/CalamitasEnchantments/CalamitasEnchantUI.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/UI/CalamitasEnchantments/CalamitasEnchantUI.cs b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs index b18fa5dd63..1222cd9543 100644 --- a/UI/CalamitasEnchantments/CalamitasEnchantUI.cs +++ b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs @@ -23,7 +23,7 @@ namespace CalamityMod.UI.CalamitasEnchants public static bool CurrentlyViewing = false; - public static readonly Vector2 ReforgeUITopLeft = new Vector2(28f, 270f); + public static readonly Vector2 ReforgeUITopLeft = new Vector2(28f, 245f); public static readonly float ResolutionRatio = Main.screenHeight / 1440f; public static Rectangle MouseScreenArea => Utils.CenteredRectangle(Main.MouseScreen, Vector2.One * 2f); @@ -83,7 +83,7 @@ namespace CalamityMod.UI.CalamitasEnchants Main.npcChatText = string.Empty; Texture2D backgroundTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/CalamitasCurseBackground"); - Vector2 backgroundScale = Vector2.One * MathHelper.Clamp(ResolutionRatio * 1.25f, 0.67f, 1f); + Vector2 backgroundScale = Vector2.One; // Draw the background. spriteBatch.Draw(backgroundTexture, ReforgeUITopLeft, null, Color.White, 0f, Vector2.Zero, backgroundScale, SpriteEffects.None, 0f); @@ -102,7 +102,7 @@ namespace CalamityMod.UI.CalamitasEnchants int cost = 0; if (SelectedEnchantment.HasValue) { - Point costDrawPositionTopLeft = (ReforgeUITopLeft + new Vector2(50f, 84f) * backgroundScale).ToPoint(); + Point costDrawPositionTopLeft = (ReforgeUITopLeft + new Vector2(50f, 78f) * backgroundScale).ToPoint(); cost = DrawEnchantmentCost(spriteBatch, costDrawPositionTopLeft); Point descriptionDrawPositionTopLeft = costDrawPositionTopLeft; descriptionDrawPositionTopLeft.Y += 90; @@ -171,7 +171,7 @@ namespace CalamityMod.UI.CalamitasEnchants public static void DrawEnchantmentDescription(SpriteBatch spriteBatch, Point descriptionDrawPositionTopLeft) { Vector2 vectorDrawPosition = descriptionDrawPositionTopLeft.ToVector2(); - Vector2 scale = new Vector2(0.67f, 0.7f); + Vector2 scale = new Vector2(0.67f, 0.7f) * MathHelper.Clamp(ResolutionRatio, 0.825f, 1f); foreach (string line in Utils.WordwrapString(SelectedEnchantment.Value.Description, Main.fontMouseText, 400, 10, out _)) { if (string.IsNullOrEmpty(line)) From 283b8519857e8e58aa39f241e398560ec0135cec Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 12 May 2021 11:10:08 -0500 Subject: [PATCH 094/202] Aflame enchantment --- Buffs/DamageOverTime/VulnerabilityHex.cs | 9 +- Buffs/DamageOverTime/WeakBrimstoneFlames.cs | 20 +++++ Buffs/DamageOverTime/WeakBrimstoneFlames.png | Bin 0 -> 568 bytes CalPlayer/CalamityPlayer.cs | 8 +- CalPlayer/CalamityPlayerLifeRegen.cs | 9 ++ CalPlayer/CalamityPlayerMiscEffects.cs | 7 +- ExtraTextures/Particles/Fire.png | Bin 0 -> 10317 bytes Items/CalamityGlobalItem.cs | 3 +- NPCs/CalamityGlobalNPC.cs | 34 +++++++- Particles/BaseParticleSet.cs | 77 ++++++++++++++++++ Particles/FireParticleSet.cs | 44 ++++++++++ Particles/Particle.cs | 21 +++++ Projectiles/CalamityGlobalProjectile.cs | 6 ++ .../EnchantmentManager.cs | 10 ++- 14 files changed, 235 insertions(+), 13 deletions(-) create mode 100644 Buffs/DamageOverTime/WeakBrimstoneFlames.cs create mode 100644 Buffs/DamageOverTime/WeakBrimstoneFlames.png create mode 100644 ExtraTextures/Particles/Fire.png create mode 100644 Particles/BaseParticleSet.cs create mode 100644 Particles/FireParticleSet.cs create mode 100644 Particles/Particle.cs diff --git a/Buffs/DamageOverTime/VulnerabilityHex.cs b/Buffs/DamageOverTime/VulnerabilityHex.cs index 17b1addd7e..dfc4a2c6e0 100644 --- a/Buffs/DamageOverTime/VulnerabilityHex.cs +++ b/Buffs/DamageOverTime/VulnerabilityHex.cs @@ -16,9 +16,14 @@ namespace CalamityMod.Buffs.DamageOverTime canBeCleared = false; } - public override void Update(Player player, ref int buffIndex) + public override void Update(Player player, ref int buffIndex) => player.Calamity().vHex = true; + + public override void Update(NPC npc, ref int buffIndex) { - player.Calamity().vHex = true; + if (npc.Calamity().vulnerabilityHex < npc.buffTime[buffIndex]) + npc.Calamity().vulnerabilityHex = npc.buffTime[buffIndex]; + npc.DelBuff(buffIndex); + buffIndex--; } } } diff --git a/Buffs/DamageOverTime/WeakBrimstoneFlames.cs b/Buffs/DamageOverTime/WeakBrimstoneFlames.cs new file mode 100644 index 0000000000..bf421c63ca --- /dev/null +++ b/Buffs/DamageOverTime/WeakBrimstoneFlames.cs @@ -0,0 +1,20 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.DamageOverTime +{ + public class WeakBrimstoneFlames : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Weak Brimstone Flames"); + Description.SetDefault("Health loss"); + Main.debuff[Type] = true; + Main.pvpBuff[Type] = true; + Main.buffNoSave[Type] = true; + longerExpertDebuff = false; + } + + public override void Update(Player player, ref int buffIndex) => player.Calamity().weakBrimstoneFlames = true; + } +} diff --git a/Buffs/DamageOverTime/WeakBrimstoneFlames.png b/Buffs/DamageOverTime/WeakBrimstoneFlames.png new file mode 100644 index 0000000000000000000000000000000000000000..e2be863c4b8e5b6419c691f4fa2241bc20825796 GIT binary patch literal 568 zcmV-80>}M{P)Jb8|JbTyEvzrow@Tm=gyrw8|24x0D!00=O6SD`SDx;00aG8GzkHK9{|`` zTel1!@133lOX=aB_HxS}KQe0fubiC%@IZkbU`b6wpkm#P*le>FXKTb>jR{`ky>B0RV;RjAeI4gFg!BD2R7#6rk^` z!|B9{_Fp8GP@&Z+Gf&;_=Wi6ed^D{xJ7Rp8PL2X9(TxgN?F1QfUJZW~AY-jW+1N|w zRP&T;=0q_Y0O;O`nmO0Gs!81+1&GBtxzp*pg|}}p7}pk*67)HlYml)kyZWPmGYSmI znE9S{f^mO*S(Sz%d;HCvx)2QfQGnPPlComz%cS9sVg0wZ&)p^vBE{ z*^l;OR+Ng20#sr-IY|CrfgsF;0Dwlb(bvD@FcbRmcl--PV$fMYoVy1A0000 0) + player.lifeRegen = 0; + + player.lifeRegenTime = 0; + lifeRegenLost += 5; + } + if (modPlayer.bFlames) { if (player.lifeRegen > 0) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index ec3aab6f51..2c15270b74 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -84,9 +84,6 @@ namespace CalamityMod.CalPlayer // Misc effects, because I don't know what else to call it MiscEffects(player, modPlayer, mod); - // Calamitas enchant held effects - EnchantHeldItemEffects(player, modPlayer, player.ActiveItem()); - // Max life and mana effects MaxLifeAndManaEffects(player, modPlayer, mod); @@ -2020,6 +2017,10 @@ namespace CalamityMod.CalPlayer return; heldItem.Calamity().AppliedEnchantment.Value.HoldEffect(player); + + // Weak brimstone flame hold curse effect. + if (modPlayer.flamingItemEnchant) + player.AddBuff(ModContent.BuffType(), 10); } #endregion diff --git a/ExtraTextures/Particles/Fire.png b/ExtraTextures/Particles/Fire.png new file mode 100644 index 0000000000000000000000000000000000000000..cc76a599b3fa10e773c9bb82aff2d72ed2bb67f6 GIT binary patch literal 10317 zcmYLPcRZWl_fKL4L9B|ECP+)w-m5}XsoJaduGVag+C;@_wPMs>p;lXz7DbGr_Na=g zU4&Yt_Nejm`Tq0!dP;Py8nL$ps&##bwK41&+6rb(p61Y4FIT4q(60_x}4KK*0S&g02o{Udw}v(#sUDq z^#yGWHIqQwKQsNqDt2b$+vomr;6ODh0`qOC2A_tZ3F+YiN>4f=BSYSglJ!9XFYE$v z0dQPsi#!L~!eC+6rpP@s5SzfCpgsHQ)c42w%?ZVb`jQ!V6a<(jb`xNwT zp8jc`4XLO-tW?}5ZVBlJ^|1$)UMS~=&ePkiv^EQE5q&4!#L|rG-p3NWu5QTepAMGf zyPq82iS}tU+ZRV4C70MuMuZoX^X7Y=l$Tsotzy&_OkV`U>_~g{a%a4{5$>aN-}laR zDah$r=lLc1L7)kPOY8JrfA)E03DA+7iMcYc>%#41S66im>vvrxIR~W06m|V{sKjn$ zFF=lp+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en, ref damage); ApplyDPSDebuff(dFlames, 2500, 500, ref npc.lifeRegen, ref damage); - ApplyDPSDebuff(bBlood, 50, 10, ref npc.lifeRegen, ref damage); + ApplyDPSDebuff(vulnerabilityHex, 44440, 4444, ref npc.lifeRegen, ref damage); + ApplyDPSDebuff(bBlood, 50, 10, ref npc.lifeRegen, ref damage); ApplyDPSDebuff(kamiFlu, 250, 25, ref npc.lifeRegen, ref damage); ApplyDPSDebuff(sulphurPoison, 180, 36, ref npc.lifeRegen, ref damage); @@ -2002,7 +2008,9 @@ namespace CalamityMod.NPCs #region Pre AI public override bool PreAI(NPC npc) { - CalamityGlobalTownNPC.SetPatreonTownNPCName(npc, mod); + if (VulnerabilityHexFireDrawer != null) + VulnerabilityHexFireDrawer.Update(); + CalamityGlobalTownNPC.SetPatreonTownNPCName(npc, mod); if (CalamityPlayer.areThereAnyDamnBosses) { @@ -3504,6 +3512,8 @@ namespace CalamityMod.NPCs bBlood--; if (dFlames > 0) dFlames--; + if (vulnerabilityHex > 0) + vulnerabilityHex--; if (marked > 0) marked--; if (vaporfied > 0) @@ -4853,6 +4863,24 @@ namespace CalamityMod.NPCs Main.spriteBatch.Draw(Main.npcTexture[npc.type], new Vector2(position9.X - Main.screenPosition.X + npc.width / 2 - Main.npcTexture[npc.type].Width * npc.scale / 2f + vector11.X * npc.scale, position9.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + vector11.Y * npc.scale + num66 + npc.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(npc.frame), alpha15, npc.rotation, vector11, npc.scale, spriteEffects, 0f); } } + else + { + if (npc.Calamity().vulnerabilityHex > 0) + { + float compactness = npc.width * 0.6f; + if (compactness < 10f) + compactness = 10f; + float power = npc.height / 100f; + if (power > 2.75f) + power = 2.75f; + if (VulnerabilityHexFireDrawer is null || VulnerabilityHexFireDrawer.LocalTimer >= VulnerabilityHexFireDrawer.SetLifetime) + VulnerabilityHexFireDrawer = new FireParticleSet(npc.Calamity().vulnerabilityHex, 1, Color.Red * 1.25f, Color.Red, compactness, power); + else + VulnerabilityHexFireDrawer.DrawSet(npc.Bottom - Vector2.UnitY * (12f - npc.gfxOffY)); + } + else + VulnerabilityHexFireDrawer = null; + } // Draw a pillar of light and fade the background as an animation when skipping things in the DD2 event. if (npc.type == NPCID.DD2EterniaCrystal) diff --git a/Particles/BaseParticleSet.cs b/Particles/BaseParticleSet.cs new file mode 100644 index 0000000000..8490181b26 --- /dev/null +++ b/Particles/BaseParticleSet.cs @@ -0,0 +1,77 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using System.Collections.Generic; +using System.Linq; +using Terraria; +using Terraria.ID; + +namespace CalamityMod.Particles +{ + public abstract class BaseParticleSet + { + public int LocalTimer { get; internal set; } + public int SetLifetime { get; internal set; } + public int ParticleSpawnRate; + public List Particles = new List(); + public abstract int ParticleLifetime { get; } + public abstract void UpdateBehavior(Particle particle); + public abstract Particle SpawnParticle(); + public abstract Color DetermineParticleColor(float lifetimeCompletion); + public abstract Texture2D ParticleTexture { get; } + public virtual int ParticleFrameVariants => 1; + public virtual Func OrderFunction { get; } = null; + + public BaseParticleSet(int setLifetime, int particleSpawnRate) + { + SetLifetime = setLifetime; + ParticleSpawnRate = particleSpawnRate; + } + + public virtual void Update() + { + // Don't perform any operations on the server. Doing so would be a waste of space as these sets are entirely based on drawcode. + if (Main.netMode == NetmodeID.Server) + return; + + bool closeToDeath = LocalTimer >= SetLifetime - ParticleLifetime && SetLifetime > 0; + if (LocalTimer % ParticleSpawnRate == 0 && !closeToDeath) + { + Particle particle = SpawnParticle(); + particle.Lifetime = ParticleLifetime; + particle.Variant = Main.rand.Next(ParticleFrameVariants); + Particles.Add(particle); + } + + // Update and increment the time of all particles. + for (int i = 0; i < Particles.Count; i++) + { + Particles[i].Time++; + UpdateBehavior(Particles[i]); + } + + // Clear all expired particles. + Particles.RemoveAll(particle => particle.Time >= particle.Lifetime); + LocalTimer++; + } + + public virtual void DrawSet(Vector2 basePosition) + { + if (Main.netMode == NetmodeID.Server) + return; + + IEnumerable orderedParticles = Particles; + if (OrderFunction != null) + orderedParticles = orderedParticles.OrderBy(OrderFunction); + + foreach (Particle particle in Particles.OrderBy(p => p.Time)) + { + Vector2 drawPosition = basePosition - Main.screenPosition + particle.RelativeOffset; + Color particleColor = DetermineParticleColor(particle.Time / (float)particle.Lifetime); + Rectangle frame = ParticleTexture.Frame(1, ParticleFrameVariants, 0, particle.Variant); + + Main.spriteBatch.Draw(ParticleTexture, drawPosition, frame, particleColor, 0f, frame.Size() * 0.5f, particle.Scale, SpriteEffects.None, 0f); + } + } + } +} \ No newline at end of file diff --git a/Particles/FireParticleSet.cs b/Particles/FireParticleSet.cs new file mode 100644 index 0000000000..fd362b1a76 --- /dev/null +++ b/Particles/FireParticleSet.cs @@ -0,0 +1,44 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Particles +{ + public class FireParticleSet : BaseParticleSet + { + public float SpawnAreaCompactness; + public float RelativePower; + public Color BrightColor; + public Color DarkColor; + public override int ParticleLifetime => 50; + public override Texture2D ParticleTexture => ModContent.GetTexture("CalamityMod/ExtraTextures/Particles/Fire"); + public FireParticleSet(int setLifetime, int particleSpawnRate, Color brightColor, Color darkColor, float spawnAreaCompactness, float relativePower) : + base(setLifetime, particleSpawnRate) + { + BrightColor = brightColor; + DarkColor = darkColor; + SpawnAreaCompactness = spawnAreaCompactness; + RelativePower = relativePower; + } + + public override void UpdateBehavior(Particle particle) + { + particle.Scale += RelativePower * 0.01f; + particle.RelativeOffset.Y -= RelativePower * 3f; + } + + public override Color DetermineParticleColor(float lifetimeCompletion) + { + Color particleColor = Color.Lerp(BrightColor, DarkColor, lifetimeCompletion); + particleColor = Color.Lerp(particleColor, Color.SaddleBrown, Utils.InverseLerp(0.95f, 0.7f, lifetimeCompletion, true)); + particleColor = Color.Lerp(particleColor, Color.White, Utils.InverseLerp(0.1f, 0.25f, lifetimeCompletion, true) * Utils.InverseLerp(0.4f, 0.25f, lifetimeCompletion, true) * 0.7f); + particleColor *= Utils.InverseLerp(0f, 0.15f, lifetimeCompletion, true) * Utils.InverseLerp(1f, 0.8f, lifetimeCompletion, true) * 0.6f; + particleColor.A = 50; + + return particleColor; + } + + public override Particle SpawnParticle() => new Particle(ParticleLifetime, Main.rand.NextVector2Circular(1f, 1f) * SpawnAreaCompactness, 0.06f); + } +} \ No newline at end of file diff --git a/Particles/Particle.cs b/Particles/Particle.cs new file mode 100644 index 0000000000..cf3bac931f --- /dev/null +++ b/Particles/Particle.cs @@ -0,0 +1,21 @@ +using Microsoft.Xna.Framework; + +namespace CalamityMod.Particles +{ + public class Particle + { + public int Time; + public int Lifetime; + public int Variant; + public float Scale; + public Vector2 RelativeOffset; + public Particle(int lifetime, Vector2 relativeOffset, float scale, int variant = 0) + { + Time = 0; + Lifetime = lifetime; + Variant = variant; + Scale = scale; + RelativeOffset = relativeOffset; + } + } +} \ No newline at end of file diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 8559271bb3..a0885fc92e 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -1,3 +1,4 @@ +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.CalPlayer; using CalamityMod.Events; using CalamityMod.NPCs.NormalNPCs; @@ -1723,6 +1724,11 @@ namespace CalamityMod.Projectiles organicEnemyHitEffect?.Invoke(target); } } + + // NOTE - At the time of writing this vulnerability hex is basically useless against + // enemies. However, on the weapons branch it is extremely powerful and is used by the Calamity expert accessory. + if (modPlayer.flamingItemEnchant && !projectile.minion) + target.AddBuff(BuffType(), 420); if (!projectile.npcProj && !projectile.trap && rogue && stealthStrike && modPlayer.stealthStrikeAlwaysCrits) crit = true; diff --git a/UI/CalamitasEnchantments/EnchantmentManager.cs b/UI/CalamitasEnchantments/EnchantmentManager.cs index 7dde6936c9..eec05cf0ab 100644 --- a/UI/CalamitasEnchantments/EnchantmentManager.cs +++ b/UI/CalamitasEnchantments/EnchantmentManager.cs @@ -13,7 +13,7 @@ namespace CalamityMod.UI.CalamitasEnchants public static IEnumerable GetValidEnchantmentsForItem(Item item) { // Do nothing if the item cannot be enchanted. - if (item is null || !item.CanBeEnchantedBySomething()) + if (item is null || item.IsAir || !item.CanBeEnchantedBySomething()) yield break; // Only give the option to clear if the item already has an enchantment. @@ -51,7 +51,13 @@ namespace CalamityMod.UI.CalamitasEnchants 100, item => item.damage = (int)(item.damage * 1.1), player => player.Calamity().cursedSummonsEnchant = true, - item => item.damage > 0 && item.maxStack == 1 && item.summon) + item => item.damage > 0 && item.maxStack == 1 && item.summon), + + new Enchantment("Aflame", "Lights enemies ablaze on hit but also causes the user to take damage over time when holding this item.", + 200, + null, + player => player.Calamity().flamingItemEnchant = true, + item => item.damage > 0 && item.maxStack == 1 && !item.summon), }; // Special disenchantment thing. This is separated from the list on purpose. From cdee32539d80b7841491bd9b3afadacba467164a Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 12 May 2021 12:44:21 -0500 Subject: [PATCH 095/202] Made Yharim's Crystal use the right mana method The old one wouldn't work with the on-mana-consume hooks --- Projectiles/Magic/YharimsCrystalPrism.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projectiles/Magic/YharimsCrystalPrism.cs b/Projectiles/Magic/YharimsCrystalPrism.cs index 9f8a3703a5..7447510c99 100644 --- a/Projectiles/Magic/YharimsCrystalPrism.cs +++ b/Projectiles/Magic/YharimsCrystalPrism.cs @@ -82,7 +82,7 @@ namespace CalamityMod.Projectiles.Magic UpdateAim(rrp, speedTimesScale); // CheckMana returns true if the mana cost can be paid. If mana isn't consumed this frame, the CheckMana short-circuits out of being evaluated. - bool allowContinuedUse = !ShouldConsumeMana() || player.CheckMana(player.ActiveItem().mana, true, false); + bool allowContinuedUse = !ShouldConsumeMana() || player.CheckMana(player.ActiveItem(), -1, true, false); bool crystalStillInUse = player.channel && allowContinuedUse && !player.noItems && !player.CCed; // The beams are only projected once (on frame 1). From 4aa5d4b7ce680ddab43407badf1a7f0551889306 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 12 May 2021 13:34:59 -0500 Subject: [PATCH 096/202] Fixed some other mana using holdouts --- Projectiles/DraedonsArsenal/GatlingLaserProj.cs | 2 +- Projectiles/Magic/DarkSparkPrism.cs | 2 +- Projectiles/Magic/PurgeProj.cs | 2 +- Projectiles/Magic/SparklingBeam.cs | 2 +- Projectiles/Magic/T1000Proj.cs | 2 +- Projectiles/Ranged/ContagionBow.cs | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Projectiles/DraedonsArsenal/GatlingLaserProj.cs b/Projectiles/DraedonsArsenal/GatlingLaserProj.cs index c6b5a6c1c5..e03bec6fec 100644 --- a/Projectiles/DraedonsArsenal/GatlingLaserProj.cs +++ b/Projectiles/DraedonsArsenal/GatlingLaserProj.cs @@ -74,7 +74,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal // This both checks if the player has sufficient mana and consumes it if they do. // If this is false, the Gatling Laser stops functioning. - bool hasMana = player.CheckMana(gatling.mana, true, false); + bool hasMana = player.CheckMana(gatling, -1, true, false); // Checks if the Gatling Laser has sufficient charge to fire. If this is false, it stops functioning. CalamityGlobalItem modItem = gatling.Calamity(); diff --git a/Projectiles/Magic/DarkSparkPrism.cs b/Projectiles/Magic/DarkSparkPrism.cs index 0fde8c1dfa..2f84f847a2 100644 --- a/Projectiles/Magic/DarkSparkPrism.cs +++ b/Projectiles/Magic/DarkSparkPrism.cs @@ -125,7 +125,7 @@ namespace CalamityMod.Projectiles.Magic if (flag10 && Main.myPlayer == projectile.owner) { - bool flag11 = !flag9 || player.CheckMana(player.ActiveItem().mana, true, false); + bool flag11 = !flag9 || player.CheckMana(player, -1, true, false); bool flag12 = player.channel && flag11 && !player.noItems && !player.CCed; if (flag12) { diff --git a/Projectiles/Magic/PurgeProj.cs b/Projectiles/Magic/PurgeProj.cs index f6357b097f..e0d68f4db5 100644 --- a/Projectiles/Magic/PurgeProj.cs +++ b/Projectiles/Magic/PurgeProj.cs @@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Magic if (flag && Main.myPlayer == projectile.owner) { int weaponDamage2 = player.GetWeaponDamage(player.ActiveItem()); - bool flag2 = player.channel && player.CheckMana(player.ActiveItem().mana, true, false) && !player.noItems && !player.CCed; + bool flag2 = player.channel && player.CheckMana(player.ActiveItem(), -1, true, false) && !player.noItems && !player.CCed; if (flag2) { float speed = player.ActiveItem().shootSpeed * projectile.scale; diff --git a/Projectiles/Magic/SparklingBeam.cs b/Projectiles/Magic/SparklingBeam.cs index 7c188ee5f6..0ed8ed8033 100644 --- a/Projectiles/Magic/SparklingBeam.cs +++ b/Projectiles/Magic/SparklingBeam.cs @@ -229,7 +229,7 @@ namespace CalamityMod.Projectiles.Magic } else { // Do we still have enough mana? If not, we kill the projectile because we cannot use it anymore - if (Main.player[projectile.owner].miscCounter % 10 == 0 && !player.CheckMana(player.ActiveItem().mana, true)) + if (Main.player[projectile.owner].miscCounter % 10 == 0 && !player.CheckMana(player.ActiveItem(), -1, true)) { projectile.Kill(); } diff --git a/Projectiles/Magic/T1000Proj.cs b/Projectiles/Magic/T1000Proj.cs index aec9a410c4..caebb2cf30 100644 --- a/Projectiles/Magic/T1000Proj.cs +++ b/Projectiles/Magic/T1000Proj.cs @@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Magic if (flag && Main.myPlayer == projectile.owner) { int weaponDamage2 = player.GetWeaponDamage(player.ActiveItem()); - bool flag2 = player.channel && player.CheckMana(player.ActiveItem().mana, true, false) && !player.noItems && !player.CCed; + bool flag2 = player.channel && player.CheckMana(player.ActiveItem(), -1, true, false) && !player.noItems && !player.CCed; if (flag2) { float speed = player.ActiveItem().shootSpeed * projectile.scale; diff --git a/Projectiles/Ranged/ContagionBow.cs b/Projectiles/Ranged/ContagionBow.cs index c7382b46ee..89ac2dd550 100644 --- a/Projectiles/Ranged/ContagionBow.cs +++ b/Projectiles/Ranged/ContagionBow.cs @@ -88,7 +88,7 @@ namespace CalamityMod.Projectiles.Ranged } if (flag && Main.myPlayer == projectile.owner) { - bool flag2 = player.channel && player.CheckMana(player.ActiveItem().mana, true, false) && !player.noItems && !player.CCed; + bool flag2 = player.channel && !player.noItems && !player.CCed; if (flag2) { float speed = player.ActiveItem().shootSpeed * projectile.scale; From 529cfcef74fc7840f20776950a78ef4171cb6339 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 12 May 2021 13:50:51 -0500 Subject: [PATCH 097/202] Oblatory enchant and modcall stuff --- CalPlayer/CalamityPlayer.cs | 29 ++++++ CalPlayer/CalamityPlayerLifeRegen.cs | 1 - ModSupport/ModCalls.cs | 6 ++ .../EnchantmentManager.cs | 88 ++++++++++++++++++- 4 files changed, 122 insertions(+), 2 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index a8345fa6cb..e108247939 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -997,6 +997,7 @@ namespace CalamityMod.CalPlayer #region Calamitas Enchant Effects public bool cursedSummonsEnchant = false; public bool flamingItemEnchant = false; + public bool lifeManaEnchant = false; #endregion Calamitas Enchant Effects #endregion @@ -1977,6 +1978,7 @@ namespace CalamityMod.CalPlayer cursedSummonsEnchant = false; flamingItemEnchant = false; + lifeManaEnchant = false; lastProjectileHit = null; CalamityPlayerMiscEffects.EnchantHeldItemEffects(player, player.Calamity(), player.ActiveItem()); @@ -10239,5 +10241,32 @@ namespace CalamityMod.CalPlayer } #endregion + + #region Mana Consumption Effects + public override void OnConsumeMana(Item item, int manaConsumed) + { + CalamityPlayer modPlayer = player.Calamity(); + if (Main.rand.NextBool(4) && modPlayer.lifeManaEnchant) + { + if (Main.myPlayer == player.whoAmI) + { + player.HealEffect(-5); + player.statLife -= 5; + if (player.statLife <= 0) + player.KillMe(PlayerDeathReason.ByCustomReason($"{player.name} converted all of their life to mana."), 1000, -1); + } + + for (int i = 0; i < 8; i++) + { + Dust life = Dust.NewDustPerfect(player.Top + Main.rand.NextVector2Circular(player.width * 0.5f, 6f), 267); + life.color = Color.Red; + life.velocity = -Vector2.UnitY.RotatedByRandom(0.48f) * Main.rand.NextFloat(3f, 4.4f); + life.scale = Main.rand.NextFloat(1.5f, 1.72f); + life.fadeIn = 0.7f; + life.noGravity = true; + } + } + } + #endregion } } diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 94dadc0c43..ecf422817b 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -1,7 +1,6 @@ using CalamityMod.Buffs.Alcohol; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Events; -using CalamityMod.Projectiles.Healing; using CalamityMod.Projectiles.Ranged; using CalamityMod.World; using Microsoft.Xna.Framework; diff --git a/ModSupport/ModCalls.cs b/ModSupport/ModCalls.cs index 1ff4d2662c..9023cd6b13 100644 --- a/ModSupport/ModCalls.cs +++ b/ModSupport/ModCalls.cs @@ -2,6 +2,7 @@ using CalamityMod.CalPlayer; using CalamityMod.Events; using CalamityMod.Items; using CalamityMod.Projectiles; +using CalamityMod.UI.CalamitasEnchants; using CalamityMod.World; using System; using System.Collections.Generic; @@ -1699,6 +1700,11 @@ namespace CalamityMod CalamityLists.MinionsToNotResurrectList.AddRange(secondaryArguments.Select(argument => Convert.ToInt32(argument))); return null; + case "CreateEnchantment": + case "RegisterEnchantment": + EnchantmentManager.ConstructFromModcall(args.Skip(1)); + break; + default: return new ArgumentException("ERROR: Invalid method name."); } diff --git a/UI/CalamitasEnchantments/EnchantmentManager.cs b/UI/CalamitasEnchantments/EnchantmentManager.cs index eec05cf0ab..e1a8b02a3e 100644 --- a/UI/CalamitasEnchantments/EnchantmentManager.cs +++ b/UI/CalamitasEnchantments/EnchantmentManager.cs @@ -43,13 +43,89 @@ namespace CalamityMod.UI.CalamitasEnchants return null; } + public static void ConstructFromModcall(IEnumerable parameters) + { + int secondaryArgumentCount = parameters.Count(); + if (secondaryArgumentCount < 4) + throw new ArgumentNullException("ERROR: A minimum of 4 arguments must be supplied to this command; a name, a description, an id, and a requirement predicate."); + if (secondaryArgumentCount > 6) + throw new ArgumentNullException("ERROR: A maximum of 6 arguments can be supplied to this command."); + + string name = string.Empty; + string description = string.Empty; + int id = -1; + Predicate requirement = null; + Action creationEffect = null; + Action holdEffect = null; + + // First element - the name. + if (parameters.ElementAt(0) is string nameElement) + name = nameElement; + else + throw new ArgumentException("The first argument to this command must be a string."); + + // Second element - the description. + if (parameters.ElementAt(1) is string descriptionElement) + description = descriptionElement; + else + throw new ArgumentException("The second argument to this command must be a string."); + + // Third element - the ID. + if (parameters.ElementAt(2) is int idElement) + id = idElement; + else + throw new ArgumentException("The third argument to this command must be an int."); + + // Fourth element - the requirement predicate. This determines if an item can be enchanted by said enchant or not. + if (parameters.ElementAt(3) is Predicate requirementElement) + requirement = requirementElement; + else + throw new ArgumentException("The fourth argument to this command must be an Item Predicate."); + + // Optional elements - creation and hold effects. + switch (secondaryArgumentCount) + { + case 5: + object fifthElement = parameters.ElementAt(4); + if (fifthElement is Action creationElement) + creationEffect = creationElement; + else if (fifthElement is Action holdElement) + holdEffect = holdElement; + else + throw new ArgumentException("The fifth argument to this command must be an Item or Player Action."); + break; + case 6: + fifthElement = parameters.ElementAt(4); + object sixthElement = parameters.ElementAt(5); + if (fifthElement is Action creationElement2) + { + creationEffect = creationElement2; + holdEffect = sixthElement as Action; + } + else if (fifthElement is Action holdElement2) + { + creationEffect = sixthElement as Action; + holdEffect = holdElement2; + } + else + throw new ArgumentException("The fifth argument to this command must be an Item or Player Action and the sixth must be the other action type."); + break; + } + + // Ensure the enchantment's ID is not already claimed. + if (EnchantmentList.Any(enchant => enchant.ID == id) || id == ClearEnchantmentID) + throw new ArgumentException("An enchantment with this ID already exists. Another one must be specified."); + + EnchantmentList.Add(new Enchantment(name, description, id, creationEffect, holdEffect, requirement)); + } + public static void LoadAllEnchantments() { EnchantmentList = new List { new Enchantment("Cursed", "Summons demons that harm you but drop healing items on death on item usage.", 100, - item => item.damage = (int)(item.damage * 1.1), + null, player => player.Calamity().cursedSummonsEnchant = true, item => item.damage > 0 && item.maxStack == 1 && item.summon), @@ -58,6 +134,16 @@ namespace CalamityMod.UI.CalamitasEnchants null, player => player.Calamity().flamingItemEnchant = true, item => item.damage > 0 && item.maxStack == 1 && !item.summon), + + new Enchantment("Oblatory", "Reduces mana cost and greatly increases damage but sometimes causes this item to use your life.", + 300, + item => + { + item.damage = (int)(item.damage * 1.5); + item.mana = (int)Math.Ceiling(item.mana * 0.6); + }, + player => player.Calamity().lifeManaEnchant = true, + item => item.damage > 0 && item.maxStack == 1 && item.magic && item.mana > 0), }; // Special disenchantment thing. This is separated from the list on purpose. From 41a46d957d9a8f0e015ac6d807d47c6c21d778d5 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 12 May 2021 19:46:06 -0500 Subject: [PATCH 098/202] Projectile proximity enchants --- CalPlayer/CalamityPlayer.cs | 5 +++++ Items/Weapons/Melee/Murasama.cs | 1 + ModSupport/ModCalls.cs | 2 +- Projectiles/CalamityGlobalProjectile.cs | 16 ++++++++++++++-- Projectiles/Magic/DarkSparkPrism.cs | 2 +- UI/CalamitasEnchantments/CalamitasEnchantUI.cs | 5 +++-- UI/CalamitasEnchantments/Enchantment.cs | 2 -- UI/CalamitasEnchantments/EnchantmentManager.cs | 15 ++++++++++++++- 8 files changed, 39 insertions(+), 9 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index e108247939..39d4a966f0 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -998,6 +998,8 @@ namespace CalamityMod.CalPlayer public bool cursedSummonsEnchant = false; public bool flamingItemEnchant = false; public bool lifeManaEnchant = false; + public bool farProximityRewardEnchant = false; + public bool closeProximityRewardEnchant = false; #endregion Calamitas Enchant Effects #endregion @@ -1979,8 +1981,11 @@ namespace CalamityMod.CalPlayer cursedSummonsEnchant = false; flamingItemEnchant = false; lifeManaEnchant = false; + farProximityRewardEnchant = false; + closeProximityRewardEnchant = false; lastProjectileHit = null; + CalamityPlayerMiscEffects.EnchantHeldItemEffects(player, player.Calamity(), player.ActiveItem()); } #endregion diff --git a/Items/Weapons/Melee/Murasama.cs b/Items/Weapons/Melee/Murasama.cs index efc3691e56..78055bf72a 100644 --- a/Items/Weapons/Melee/Murasama.cs +++ b/Items/Weapons/Melee/Murasama.cs @@ -19,6 +19,7 @@ namespace CalamityMod.Items.Weapons.Melee Tooltip.SetDefault("There will be blood!\n" + "ID and power-level locked\n" + "Prove your strength or have the correct user ID to wield this sword"); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 13)); } public override void SetDefaults() diff --git a/ModSupport/ModCalls.cs b/ModSupport/ModCalls.cs index 9023cd6b13..05de84ee37 100644 --- a/ModSupport/ModCalls.cs +++ b/ModSupport/ModCalls.cs @@ -1703,7 +1703,7 @@ namespace CalamityMod case "CreateEnchantment": case "RegisterEnchantment": EnchantmentManager.ConstructFromModcall(args.Skip(1)); - break; + return null; default: return new ArgumentException("ERROR: Invalid method name."); diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index a0885fc92e..445a999043 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -1725,11 +1725,23 @@ namespace CalamityMod.Projectiles } } - // NOTE - At the time of writing this vulnerability hex is basically useless against - // enemies. However, on the weapons branch it is extremely powerful and is used by the Calamity expert accessory. if (modPlayer.flamingItemEnchant && !projectile.minion) target.AddBuff(BuffType(), 420); + if (modPlayer.farProximityRewardEnchant) + { + float proximityDamageInterpolant = Utils.InverseLerp(250f, 2400f, target.Distance(player.Center), true); + float proximityDamageFactor = MathHelper.SmoothStep(0.7f, 1.45f, proximityDamageInterpolant); + damage = (int)Math.Ceiling(damage * proximityDamageFactor); + } + + if (modPlayer.closeProximityRewardEnchant) + { + float proximityDamageInterpolant = Utils.InverseLerp(400f, 175f, target.Distance(player.Center), true); + float proximityDamageFactor = MathHelper.SmoothStep(0.75f, 1.75f, proximityDamageInterpolant); + damage = (int)Math.Ceiling(damage * proximityDamageFactor); + } + if (!projectile.npcProj && !projectile.trap && rogue && stealthStrike && modPlayer.stealthStrikeAlwaysCrits) crit = true; } diff --git a/Projectiles/Magic/DarkSparkPrism.cs b/Projectiles/Magic/DarkSparkPrism.cs index 2f84f847a2..009b32ccca 100644 --- a/Projectiles/Magic/DarkSparkPrism.cs +++ b/Projectiles/Magic/DarkSparkPrism.cs @@ -125,7 +125,7 @@ namespace CalamityMod.Projectiles.Magic if (flag10 && Main.myPlayer == projectile.owner) { - bool flag11 = !flag9 || player.CheckMana(player, -1, true, false); + bool flag11 = !flag9 || player.CheckMana(player.ActiveItem(), -1, true, false); bool flag12 = player.channel && flag11 && !player.noItems && !player.CCed; if (flag12) { diff --git a/UI/CalamitasEnchantments/CalamitasEnchantUI.cs b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs index 1222cd9543..480780ef07 100644 --- a/UI/CalamitasEnchantments/CalamitasEnchantUI.cs +++ b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs @@ -217,7 +217,8 @@ namespace CalamityMod.UI.CalamitasEnchants float inventoryScale = Main.inventoryScale; Texture2D itemTexture = Main.itemTexture[CurrentlyHeldItem.type]; Rectangle itemFrame = itemTexture.Frame(1, 1, 0, 0); - if (Main.itemAnimations[CurrentlyHeldItem.type] != null) + bool hasMultipleFrames = Main.itemAnimations[CurrentlyHeldItem.type] != null; + if (hasMultipleFrames) itemFrame = Main.itemAnimations[CurrentlyHeldItem.type].GetFrame(itemTexture); float baseScale = 1f; @@ -235,7 +236,7 @@ namespace CalamityMod.UI.CalamitasEnchants drawPosition += Vector2.One * 23f * baseScale; // Draw the item. - if (ItemLoader.PreDrawInInventory(CurrentlyHeldItem, spriteBatch, drawPosition, itemFrame, CurrentlyHeldItem.GetAlpha(Color.White), CurrentlyHeldItem.GetColor(Color.White), itemTexture.Size() * 0.5f, itemScale)) + if (hasMultipleFrames || ItemLoader.PreDrawInInventory(CurrentlyHeldItem, spriteBatch, drawPosition, itemFrame, CurrentlyHeldItem.GetAlpha(Color.White), CurrentlyHeldItem.GetColor(Color.White), itemTexture.Size() * 0.5f, itemScale)) { spriteBatch.Draw(itemTexture, drawPosition, itemFrame, CurrentlyHeldItem.GetAlpha(Color.White), 0f, itemFrame.Size() * 0.5f, itemScale, SpriteEffects.None, 0f); spriteBatch.Draw(itemTexture, drawPosition, itemFrame, CurrentlyHeldItem.GetColor(Color.White), 0f, itemFrame.Size() * 0.5f, itemScale, SpriteEffects.None, 0f); diff --git a/UI/CalamitasEnchantments/Enchantment.cs b/UI/CalamitasEnchantments/Enchantment.cs index 68908fd0ac..e098ecb163 100644 --- a/UI/CalamitasEnchantments/Enchantment.cs +++ b/UI/CalamitasEnchantments/Enchantment.cs @@ -12,8 +12,6 @@ namespace CalamityMod.UI.CalamitasEnchants public int ID { get; internal set; } - internal static readonly Random EnchantmentIDDecider = new Random(0xCA17A3); - // This is internal because CanBeAppliedTo should be used over this field directly. // Using that has the benefit of null checks and is objectively superior to using the raw delegate. internal Predicate ApplyRequirement; diff --git a/UI/CalamitasEnchantments/EnchantmentManager.cs b/UI/CalamitasEnchantments/EnchantmentManager.cs index e1a8b02a3e..bd67cf75a3 100644 --- a/UI/CalamitasEnchantments/EnchantmentManager.cs +++ b/UI/CalamitasEnchantments/EnchantmentManager.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Linq; using Terraria; +using Terraria.ID; namespace CalamityMod.UI.CalamitasEnchants { @@ -144,12 +145,24 @@ namespace CalamityMod.UI.CalamitasEnchants }, player => player.Calamity().lifeManaEnchant = true, item => item.damage > 0 && item.maxStack == 1 && item.magic && item.mana > 0), + + new Enchantment("Resentful", "Makes the damage of projectiles vary based on how far the hit target is from you. The farther, the more damage, and vice versa.", + 400, + null, + player => player.Calamity().farProximityRewardEnchant = true, + item => item.damage > 0 && item.maxStack == 1 && item.shoot > ProjectileID.None), + + new Enchantment("Bloodthirsty", "Makes the damage of projectiles vary based on how far the hit target is from you. The closer, the more damage, and vice versa.", + 500, + null, + player => player.Calamity().closeProximityRewardEnchant = true, + item => item.damage > 0 && item.maxStack == 1 && item.shoot > ProjectileID.None), }; // Special disenchantment thing. This is separated from the list on purpose. ClearEnchantment = new Enchantment("Disenchant", string.Empty, ClearEnchantmentID, item => item.Calamity().AppliedEnchantment = null, - item => item.maxStack == 1); + item => item.maxStack == 1 && item.shoot >= ProjectileID.None); } public static void UnloadAllEnchantments() => EnchantmentList = null; From 1e29259380d2af7a3e2ac979a5c1782038648162 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Thu, 13 May 2021 19:31:11 -0500 Subject: [PATCH 099/202] Ephemeral enchant --- CalPlayer/CalamityPlayer.cs | 29 +++-------- CalPlayer/CalamityPlayerMiscEffects.cs | 21 ++++++++ Items/CalamityGlobalItem.cs | 51 +++++++++++++++++-- .../EnchantmentManager.cs | 6 +++ 4 files changed, 81 insertions(+), 26 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 39d4a966f0..7e89eb65d9 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -1000,6 +1000,7 @@ namespace CalamityMod.CalPlayer public bool lifeManaEnchant = false; public bool farProximityRewardEnchant = false; public bool closeProximityRewardEnchant = false; + public bool dischargingItemEnchant = false; #endregion Calamitas Enchant Effects #endregion @@ -1983,6 +1984,7 @@ namespace CalamityMod.CalPlayer lifeManaEnchant = false; farProximityRewardEnchant = false; closeProximityRewardEnchant = false; + dischargingItemEnchant = false; lastProjectileHit = null; @@ -4472,44 +4474,29 @@ namespace CalamityMod.CalPlayer #region Get Weapon Damage And KB public override void ModifyWeaponDamage(Item item, ref float add, ref float mult, ref float flat) { - if (item.type == ModContent.ItemType()) - { - mult += GaelsGreatsword.BaseDamage / (float)GaelsGreatsword.BaseDamage - 1f; - } if (flamethrowerBoost && item.ranged && (item.useAmmo == AmmoID.Gel || CalamityLists.flamethrowerList.Contains(item.type))) - { mult += hoverboardBoost ? 0.35f : 0.25f; - } + if (cinnamonRoll && CalamityLists.fireWeaponList.Contains(item.type)) - { mult += 0.15f; - } + if (evergreenGin && CalamityLists.natureWeaponList.Contains(item.type)) - { mult += 0.15f; - } + if (fireball && CalamityLists.fireWeaponList.Contains(item.type)) - { mult += 0.1f; - } + if (eskimoSet && CalamityLists.iceWeaponList.Contains(item.type)) - { mult += 0.1f; - } if (item.ranged) - { acidRoundMultiplier = item.useTime / 20D; - } else - { acidRoundMultiplier = 1D; - } - //Prismatic Breaker is a weird hybrid melee-ranged weapon so include it too. Why are you using desert prowler post-Yharon? don't ask me + + // Prismatic Breaker is a weird hybrid melee-ranged weapon so include it too. Why are you using desert prowler post-Yharon? don't ask me if (desertProwler && (item.ranged || item.type == ModContent.ItemType()) && item.ammo == AmmoID.None) - { flat += 1f; - } } public override void GetWeaponKnockback(Item item, ref float knockback) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 2c15270b74..a809f3e11f 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -7,6 +7,7 @@ using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Buffs.Summon; using CalamityMod.Dusts; using CalamityMod.Events; +using CalamityMod.Items; using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor; using CalamityMod.Items.Fishing.AstralCatches; @@ -2013,6 +2014,26 @@ namespace CalamityMod.CalPlayer if (heldItem.IsAir) return; + // Exhaustion recharge effects. + foreach (Item item in player.inventory) + { + if (item.IsAir) + continue; + + if (item.Calamity().AppliedEnchantment.HasValue && item.Calamity().AppliedEnchantment.Value.ID == 600) + { + // Initialize the exhaustion if it is currently not defined. + if (item.Calamity().DischargeEnchantExhaustion <= 0f) + item.Calamity().DischargeEnchantExhaustion = CalamityGlobalItem.DischargeEnchantExhaustionCap; + + // Slowly recharge the weapon over time. This is depleted when the item is actaully used. + else if (item.Calamity().DischargeEnchantExhaustion < CalamityGlobalItem.DischargeEnchantExhaustionCap) + item.Calamity().DischargeEnchantExhaustion++; + } + else + item.Calamity().DischargeEnchantExhaustion = 0f; + } + if (!heldItem.Calamity().AppliedEnchantment.HasValue || heldItem.Calamity().AppliedEnchantment.Value.HoldEffect is null) return; diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index b83de24cfd..da202648c4 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -55,6 +55,18 @@ namespace CalamityMod.Items #region Enchantment Variables public Enchantment? AppliedEnchantment = null; + public float DischargeEnchantExhaustion = 0; + public float DischargeExhaustionRatio + { + get + { + float ratio = DischargeEnchantExhaustion / DischargeEnchantExhaustionCap; + return float.IsNaN(ratio) || float.IsInfinity(ratio) ? 0f : MathHelper.Clamp(ratio, 0f, 1f); + } + } + public const float DischargeEnchantExhaustionCap = 1600f; + public const float DischargeEnchantMinDamageFactor = 0.77f; + public const float DischargeEnchantMaxDamageFactor = 1.26f; #endregion // Miscellaneous stuff @@ -76,6 +88,7 @@ namespace CalamityMod.Items { CalamityGlobalItem myClone = (CalamityGlobalItem)base.Clone(item, itemClone); myClone.StealthGenBonus = StealthGenBonus; + myClone.DischargeEnchantExhaustion = DischargeEnchantExhaustion; myClone.Charge = Charge; return myClone; } @@ -485,7 +498,8 @@ namespace CalamityMod.Items ["rarity"] = (int)customRarity, ["charge"] = Charge, ["reforgeTier"] = reforgeTier, - ["enchantmentID"] = AppliedEnchantment.HasValue ? AppliedEnchantment.Value.ID : 0 + ["enchantmentID"] = AppliedEnchantment.HasValue ? AppliedEnchantment.Value.ID : 0, + ["DischargeEnchantExhaustion"] = DischargeEnchantExhaustion }; } @@ -501,6 +515,7 @@ namespace CalamityMod.Items else Charge = tag.GetFloat("charge"); + DischargeEnchantExhaustion = tag.GetFloat("DischargeEnchantExhaustion"); reforgeTier = tag.GetInt("reforgeTimer"); Enchantment? savedEnchantment = EnchantmentManager.FindByID(tag.GetInt("enchantmentID")); if (savedEnchantment.HasValue) @@ -541,6 +556,7 @@ namespace CalamityMod.Items writer.Write(Charge); writer.Write(reforgeTier); writer.Write(AppliedEnchantment.HasValue ? AppliedEnchantment.Value.ID : 0); + writer.Write(DischargeEnchantExhaustion); } public override void NetReceive(Item item, BinaryReader reader) @@ -561,6 +577,7 @@ namespace CalamityMod.Items if (hasCreationEffect) item.Calamity().AppliedEnchantment.Value.CreationEffect(item); } + DischargeEnchantExhaustion = reader.ReadSingle(); } #endregion @@ -739,6 +756,15 @@ namespace CalamityMod.Items if (modPlayer.profanedCrystalBuffs && item.pick == 0 && item.axe == 0 && item.hammer == 0 && item.autoReuse && (modItem.rogue || item.magic || item.ranged || item.melee)) return player.altFunctionUse == 0 ? ProfanedSoulCrystal.TransformItemUsage(item, player) : AltFunctionUse(item, player); + // Exhaust the weapon if it has the necessary enchant. + if (!item.IsAir && modPlayer.dischargingItemEnchant) + { + float exhaustionCost = item.useTime * 2.25f; + if (exhaustionCost < 10f) + exhaustionCost = 10f; + DischargeEnchantExhaustion = MathHelper.Clamp(DischargeEnchantExhaustion - exhaustionCost, 0.001f, DischargeEnchantExhaustionCap); + } + // Check for sufficient charge if this item uses charge. if (item.type >= ItemID.Count && modItem.UsesCharge) { @@ -840,7 +866,11 @@ namespace CalamityMod.Items // Summon weapons specifically do not have their damage affected by charge. They still require charge to function however. CalamityGlobalItem modItem = item.Calamity(); - if (!item.summon && (modItem?.UsesCharge ?? false)) + + if (!item.summon && modItem.DischargeEnchantExhaustion > 0f) + mult *= DischargeEnchantmentDamageFormula(); + + if (!item.summon && (modItem?.UsesCharge ?? false)) { // At exactly zero charge, do not perform any multiplication. // This makes charge-using weapons show up at full damage when previewed in crafting, Recipe Browser, etc. @@ -850,9 +880,20 @@ namespace CalamityMod.Items } } - // This formula gives a slightly higher value than 1.0 above 85% charge, and a slightly lower value than 0.0 at 0% charge. - // Specifically, it gives 0.0 or less at 0.36% charge or lower. This is fine because the result is immediately clamped. - internal float ChargeDamageFormula() + internal float DischargeEnchantmentDamageFormula() + { + // This exponential has the properties of beginning at 0 and ending at 1, yet also has their signature rising curve. + // It is therefore perfect for a potential interpolant. + float interpolant = (float)Math.Pow(2D, DischargeExhaustionRatio) - 1f; + + // No further smoothening is required in the form of a Smoothstep remap. + // A linear interpolation works fine; the exponential already has the desired curve shape. + return MathHelper.Lerp(DischargeEnchantMinDamageFactor, DischargeEnchantMaxDamageFactor, interpolant); + } + + // This formula gives a slightly higher value than 1.0 above 85% charge, and a slightly lower value than 0.0 at 0% charge. + // Specifically, it gives 0.0 or less at 0.36% charge or lower. This is fine because the result is immediately clamped. + internal float ChargeDamageFormula() { float x = MathHelper.Clamp(ChargeRatio, 0f, 1f); float y = 1.087f - 0.08f / (x + 0.07f); diff --git a/UI/CalamitasEnchantments/EnchantmentManager.cs b/UI/CalamitasEnchantments/EnchantmentManager.cs index bd67cf75a3..518948ff15 100644 --- a/UI/CalamitasEnchantments/EnchantmentManager.cs +++ b/UI/CalamitasEnchantments/EnchantmentManager.cs @@ -157,6 +157,12 @@ namespace CalamityMod.UI.CalamitasEnchants null, player => player.Calamity().closeProximityRewardEnchant = true, item => item.damage > 0 && item.maxStack == 1 && item.shoot > ProjectileID.None), + + new Enchantment("Ephemeral", "Causes the damage output of this item to discharge from exhaustive use. Its damage returns naturally when not being used.", + 600, + null, + player => player.Calamity().dischargingItemEnchant = true, + item => item.damage > 0 && item.maxStack == 1 && !item.summon), }; // Special disenchantment thing. This is separated from the list on purpose. From 97f41ce991aa49516870b293c393433c6d543c35 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Thu, 13 May 2021 21:45:41 -0500 Subject: [PATCH 100/202] Damned enchant --- CalPlayer/CalamityPlayer.cs | 2 + ILEditing/ILChanges.cs | 27 ++++++- Projectiles/CalamityGlobalProjectile.cs | 41 +++++++++- .../Summon/SummonBrimstoneExplosion.cs | 72 ++++++++++++++++++ .../Summon/SummonBrimstoneExplosion.png | Bin 0 -> 965 bytes .../EnchantmentManager.cs | 8 ++ 6 files changed, 145 insertions(+), 5 deletions(-) create mode 100644 Projectiles/Summon/SummonBrimstoneExplosion.cs create mode 100644 Projectiles/Summon/SummonBrimstoneExplosion.png diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 7e89eb65d9..0855e92ffb 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -1001,6 +1001,7 @@ namespace CalamityMod.CalPlayer public bool farProximityRewardEnchant = false; public bool closeProximityRewardEnchant = false; public bool dischargingItemEnchant = false; + public bool explosiveMinionsEnchant = false; #endregion Calamitas Enchant Effects #endregion @@ -1985,6 +1986,7 @@ namespace CalamityMod.CalPlayer farProximityRewardEnchant = false; closeProximityRewardEnchant = false; dischargingItemEnchant = false; + explosiveMinionsEnchant = false; lastProjectileHit = null; diff --git a/ILEditing/ILChanges.cs b/ILEditing/ILChanges.cs index c5d55c73dd..06db62641a 100644 --- a/ILEditing/ILChanges.cs +++ b/ILEditing/ILChanges.cs @@ -1,5 +1,6 @@ using CalamityMod.CalPlayer; using CalamityMod.NPCs; +using CalamityMod.Projectiles; using CalamityMod.Tiles.DraedonStructures; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -69,6 +70,7 @@ namespace CalamityMod.ILEditing DisableDemonAltarGeneration(); DisableTeleportersDuringBossFights(); FixSplittingWormBannerDrops(); + IncorporateMinionExplodingCountdown(); } /// @@ -397,10 +399,29 @@ namespace CalamityMod.ILEditing }; } - #endregion + private static void IncorporateMinionExplodingCountdown() + { + On.Terraria.Projectile.NewProjectile_float_float_float_float_int_int_float_int_float_float += (orig, x, y, xSpeed, ySpeed, type, damage, knockback, owner, ai0, ai1) => + { + // This is unfortunately not something that can be done via SetDefaults since owner is set + // after that method is called. Doing it directly when the projectile is spawned appears to be the only reasonable way. + int proj = orig(x, y, xSpeed, ySpeed, type, damage, knockback, owner, ai0, ai1); + Projectile projectile = Main.projectile[proj]; + if (projectile.minion) + { + Player player = Main.player[projectile.owner]; + CalamityPlayerMiscEffects.EnchantHeldItemEffects(player, player.Calamity(), player.ActiveItem()); + if (player.Calamity().explosiveMinionsEnchant) + projectile.Calamity().ExplosiveEnchantCountdown = CalamityGlobalProjectile.ExplosiveEnchantTime; + } + return proj; + }; + } - #region IL Editing Injected/Hooked Functions - private static void BossRushLifeBytes(On.Terraria.Main.orig_InitLifeBytes orig) + #endregion + + #region IL Editing Injected/Hooked Functions + private static void BossRushLifeBytes(On.Terraria.Main.orig_InitLifeBytes orig) { orig(); foreach (int npcType in NeedsFourLifeBytes) diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 445a999043..8fc1717647 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -6,6 +6,7 @@ using CalamityMod.Projectiles.Boss; using CalamityMod.Projectiles.Melee; using CalamityMod.Projectiles.Melee.Yoyos; using CalamityMod.Projectiles.Rogue; +using CalamityMod.Projectiles.Summon; using CalamityMod.Projectiles.Typeless; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -106,8 +107,12 @@ namespace CalamityMod.Projectiles public bool affectedByMaliceModeVelocityMultiplier = false; public const float MaliceModeProjectileVelocityMultiplier = 1.25f; - #region SetDefaults - public override void SetDefaults(Projectile projectile) + // Enchantment variables. + public int ExplosiveEnchantCountdown = 0; + public const int ExplosiveEnchantTime = 600; + + #region SetDefaults + public override void SetDefaults(Projectile projectile) { if (CalamityLists.trueMeleeProjectileList.Contains(projectile.type)) trueMelee = true; @@ -219,6 +224,38 @@ namespace CalamityMod.Projectiles #region PreAI public override bool PreAI(Projectile projectile) { + if (projectile.minion && ExplosiveEnchantCountdown > 0) + { + ExplosiveEnchantCountdown--; + + // Make fizzle sounds and fire dust to indicate the impending explosion. + if (ExplosiveEnchantCountdown <= 300) + { + if (Main.rand.NextBool(24)) + Main.PlaySound(SoundID.DD2_BetsyFireballShot, projectile.Center); + + Dust fire = Dust.NewDustPerfect(projectile.Center + Main.rand.NextVector2Circular(projectile.width, projectile.height) * 0.42f, 267); + fire.color = Color.Lerp(Color.Orange, Color.Red, Main.rand.NextFloat(0.45f, 1f)); + fire.scale = Main.rand.NextFloat(1.4f, 1.65f); + fire.fadeIn = 0.5f; + fire.noGravity = true; + } + + if (ExplosiveEnchantCountdown <= 0) + { + Main.PlaySound(SoundID.DD2_KoboldExplosion, projectile.Center); + if (Main.myPlayer == projectile.owner) + { + if (projectile.minionSlots > 0f) + { + int damage = (int)(Main.player[projectile.owner].MinionDamage() * 6000); + Projectile.NewProjectile(projectile.Center, Vector2.Zero, ProjectileType(), damage, 0f, projectile.owner); + } + projectile.Kill(); + } + } + } + if (RequiresManualResurrection) { // Reactivate the projectile the instant it's created. This is dirty as fuck, but diff --git a/Projectiles/Summon/SummonBrimstoneExplosion.cs b/Projectiles/Summon/SummonBrimstoneExplosion.cs new file mode 100644 index 0000000000..0c4eb00e90 --- /dev/null +++ b/Projectiles/Summon/SummonBrimstoneExplosion.cs @@ -0,0 +1,72 @@ +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Summon +{ + public class SummonBrimstoneExplosion : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Explosion"); + ProjectileID.Sets.MinionShot[projectile.type] = true; + Main.projFrames[projectile.type] = 6; + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 160; + projectile.friendly = true; + projectile.hostile = true; + projectile.minion = true; + projectile.penetrate = -1; + projectile.timeLeft = Main.projFrames[projectile.type] * 5; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + } + + public override void AI() + { + if (projectile.localAI[0] == 0f) + { + CreateInitialDust(); + projectile.localAI[0] = 1f; + } + + // Emit crimson light. + Lighting.AddLight(projectile.Center, Color.Red.ToVector3() * 1.1f); + if (projectile.timeLeft % 5f == 4f) + projectile.frame++; + } + + public void CreateInitialDust() + { + float randomnessSmoothness = 3f; + for (int i = 0; i < 10; i++) + { + randomnessSmoothness += i; + + int offsetVariance = (int)(randomnessSmoothness * 4f); + for (int j = 0; j < 30; j++) + { + Vector2 velocity = Main.rand.NextVector2Square(-randomnessSmoothness, randomnessSmoothness).SafeNormalize(Vector2.UnitY) * randomnessSmoothness * 0.48f; + Dust dust = Dust.NewDustDirect(projectile.Center, offsetVariance, offsetVariance, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 1.6f); + dust.position += Main.rand.NextVector2Square(-10f, 10f); + dust.velocity = velocity; + dust.noGravity = true; + } + } + + projectile.Damage(); + CalamityGlobalProjectile.ExpandHitboxBy(projectile, 48); + } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + // Prevent absurd quantities of damage to the player. + damage = (int)(damage * 0.018); + } + } +} diff --git a/Projectiles/Summon/SummonBrimstoneExplosion.png b/Projectiles/Summon/SummonBrimstoneExplosion.png new file mode 100644 index 0000000000000000000000000000000000000000..b53b2fea887d88be7c6d896d0ad4715d91c23470 GIT binary patch literal 965 zcmV;$13LVPP)Px#1ZP1_K>z@;j|==^1poj55>QN3MF0Q*|B-WH7CEgnM&nOU00013X~QP~000Jb zQchF<|NsC00JFcOzW@LL32;bRa{vGi!2kdb!2!6DYwZ9411d>GK~!i%?Usvjqc99b zmu>U^zr0*uDUux%(1p%qww#$3Jr2g^nLm#LpDZtn1p`;hkty=B!U*In$BN9Nmpy8w zG>9g93r!0QYpYQuuAH3 zCX|SrGjcEF7@Uvnhi~+1O+g@LT=_$#RMo%7g&_D$fa?BtZOo~WodTPV+R_z z=!zU|Y#qq>qw}0bQHJKSZyCjfQDk0%3}p;M11K_d5-PUVG^%p{NHJ=A3~F6=LJh2C zs4_9ju%dBBUKX!5cLB2)CT6$@>>MsL6hzse)Et z$u9#sRhgK%!W=4IVa$jw`-_&J2UM|3Yd19c@t}y$8x&6Gyo?r9&tek3U{IH_I0$I@ z;qiZ@E^``C+FmV=!$(w?F#!}EkI{>$F8e8C88G7zi0~gMGRtVY3^)vG%&RhPOuv0l z@~sc!7r!pE=u-jE`5<6x#g)43#NwK5umV&WD)0Y za9+kFEKKw#uP&oBo5Dz4cKU<9qRPDBmbA>mCsjGhxt(Q?YjS_9%=tOlsmZuCEuO-m zY#Jrme}W)!*dln`EG)~eM{z5z%OoEh3g9qS6lGk}abY0WblJj9H2DZu$n!~^m!Sen zpM0`hT3}J0qsX&^zEYQusk%HqL;y7lSL!n8%R$~@UzZ52U%DnA z;j?8waXsf{s6QuL*l}Lo;`hk&lhxNX`3Se1x#i3)XFf%akL^A+8K2#)7tBai-ew%+ nI=TO8a;@BR%bEXNemwpG|6JTXI#<=S00000NkvXXu0mjfmFu-D literal 0 HcmV?d00001 diff --git a/UI/CalamitasEnchantments/EnchantmentManager.cs b/UI/CalamitasEnchantments/EnchantmentManager.cs index 518948ff15..98d94c20f7 100644 --- a/UI/CalamitasEnchantments/EnchantmentManager.cs +++ b/UI/CalamitasEnchantments/EnchantmentManager.cs @@ -1,8 +1,10 @@ +using CalamityMod.Items.Weapons.Summon; using System; using System.Collections.Generic; using System.Linq; using Terraria; using Terraria.ID; +using Terraria.ModLoader; namespace CalamityMod.UI.CalamitasEnchants { @@ -163,6 +165,12 @@ namespace CalamityMod.UI.CalamitasEnchants null, player => player.Calamity().dischargingItemEnchant = true, item => item.damage > 0 && item.maxStack == 1 && !item.summon), + + new Enchantment("Damned", "Causes minions to be created with a 40 second timer. Once it runs out, they explode violently. The explosion can hurt both you and enemies. Minions do more damage to compensate.", + 700, + item => item.damage = (int)(item.damage * 1.5), + player => player.Calamity().explosiveMinionsEnchant = true, + item => item.damage > 0 && item.maxStack == 1 && item.summon), }; // Special disenchantment thing. This is separated from the list on purpose. From 45ef12b92393674161044e4c3c840be33ce253eb Mon Sep 17 00:00:00 2001 From: Dominic Date: Sun, 16 May 2021 16:32:07 -0500 Subject: [PATCH 101/202] Tainted enchant (epic) --- CalPlayer/CalamityPlayer.cs | 5 + CalamityLists.cs | 4 +- Effects/CalamityShaders.cs | 3 + Effects/FadedUVMapStreak.xnb | Bin 2832 -> 2832 bytes Effects/FadingSolidTrail.fx | 63 ++++ Effects/FadingSolidTrail.xnb | Bin 0 -> 2036 bytes ExtraTextures/BladeTrailUVMap.png | Bin 0 -> 13673 bytes ExtraTextures/TaintedArm.png | Bin 0 -> 932 bytes ExtraTextures/TaintedForearm.png | Bin 0 -> 690 bytes ExtraTextures/TaintedHand.png | Bin 0 -> 673 bytes ExtraTextures/TaintedHand2.png | Bin 0 -> 783 bytes Projectiles/Melee/TaintedBladeSlasher.cs | 276 ++++++++++++++++++ TrailGeneration/PrimitiveTrail.cs | 15 +- .../CalamitasEnchantUI.cs | 1 - .../EnchantmentManager.cs | 37 ++- 15 files changed, 398 insertions(+), 6 deletions(-) create mode 100644 Effects/FadingSolidTrail.fx create mode 100644 Effects/FadingSolidTrail.xnb create mode 100644 ExtraTextures/BladeTrailUVMap.png create mode 100644 ExtraTextures/TaintedArm.png create mode 100644 ExtraTextures/TaintedForearm.png create mode 100644 ExtraTextures/TaintedHand.png create mode 100644 ExtraTextures/TaintedHand2.png create mode 100644 Projectiles/Melee/TaintedBladeSlasher.cs diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 0855e92ffb..0407d4ed16 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -1002,6 +1002,7 @@ namespace CalamityMod.CalPlayer public bool closeProximityRewardEnchant = false; public bool dischargingItemEnchant = false; public bool explosiveMinionsEnchant = false; + public bool bladeArmEnchant = false; #endregion Calamitas Enchant Effects #endregion @@ -1987,6 +1988,7 @@ namespace CalamityMod.CalPlayer closeProximityRewardEnchant = false; dischargingItemEnchant = false; explosiveMinionsEnchant = false; + bladeArmEnchant = false; lastProjectileHit = null; @@ -6854,6 +6856,9 @@ namespace CalamityMod.CalPlayer #region Shoot public override bool Shoot(Item item, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { + if (bladeArmEnchant) + return false; + if (veneratedLocket) { if (item.Calamity().rogue && item.type != ModContent.ItemType()) diff --git a/CalamityLists.cs b/CalamityLists.cs index 9790add389..ccb4559ddb 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -368,7 +368,8 @@ namespace CalamityMod ProjectileType(), ProjectileType(), ProjectileType(), - ProjectileType() + ProjectileType(), + ProjectileType() }; rangedProjectileExceptionList = new List() @@ -440,6 +441,7 @@ namespace CalamityMod ProjectileType(), ProjectileType(), ProjectileType(), + ProjectileType(), //Some hostile boss projectiles ProjectileType(), diff --git a/Effects/CalamityShaders.cs b/Effects/CalamityShaders.cs index 407dc6b42c..04c361c29b 100644 --- a/Effects/CalamityShaders.cs +++ b/Effects/CalamityShaders.cs @@ -13,6 +13,7 @@ namespace CalamityMod.Effects public static Effect TentacleShader; public static Effect LightDistortionShader; public static Effect FadedUVMapStreakShader; + public static Effect FadingSolidTrailShader; public static void LoadShaders() { @@ -23,6 +24,7 @@ namespace CalamityMod.Effects TentacleShader = CalamityMod.Instance.GetEffect("Effects/TentacleShader"); LightDistortionShader = CalamityMod.Instance.GetEffect("Effects/DistortionShader"); FadedUVMapStreakShader = CalamityMod.Instance.GetEffect("Effects/FadedUVMapStreak"); + FadingSolidTrailShader = CalamityMod.Instance.GetEffect("Effects/FadingSolidTrail"); Filters.Scene["CalamityMod:Astral"] = new Filter(new AstralScreenShaderData(new Ref(AstralFogShader), "AstralPass").UseColor(0.18f, 0.08f, 0.24f), EffectPriority.VeryHigh); @@ -32,6 +34,7 @@ namespace CalamityMod.Effects GameShaders.Misc["CalamityMod:SubsumingTentacle"] = new MiscShaderData(new Ref(TentacleShader), "BurstPass"); GameShaders.Misc["CalamityMod:LightDistortion"] = new MiscShaderData(new Ref(LightDistortionShader), "DistortionPass"); GameShaders.Misc["CalamityMod:TrailStreak"] = new MiscShaderData(new Ref(FadedUVMapStreakShader), "TrailPass"); + GameShaders.Misc["CalamityMod:FadingSolidTrail"] = new MiscShaderData(new Ref(FadingSolidTrailShader), "TrailPass"); } } } diff --git a/Effects/FadedUVMapStreak.xnb b/Effects/FadedUVMapStreak.xnb index 45b95d5d3f96dccd64d7961c591d51614e3fe859..fbc7a110eca69ec46b8fe2f22a41aafeba756474 100644 GIT binary patch delta 38 ucmbOrHbHEIJtJe`WCzAf=1G^>C$C}bVp3hZ*@9^=BlAZ0vdur3CD;M?h792V delta 38 scmbOrHbHEIJtHH-WCzAfW(Ed^$!i$9m>3u~TQKcq1o1cjV3uG90J3lh#Q*>R diff --git a/Effects/FadingSolidTrail.fx b/Effects/FadingSolidTrail.fx new file mode 100644 index 0000000000..dd9efcb37a --- /dev/null +++ b/Effects/FadingSolidTrail.fx @@ -0,0 +1,63 @@ +sampler uImage0 : register(s0); +sampler uImage1 : register(s1); +float3 uColor; +float3 uSecondaryColor; +float uOpacity; +float uSaturation; +float uRotation; +float uTime; +float4 uSourceRect; +float2 uWorldPosition; +float uDirection; +float3 uLightSource; +float2 uImageSize0; +float2 uImageSize1; +matrix uWorldViewProjection; + +struct VertexShaderInput +{ + float4 Position : POSITION0; + float4 Color : COLOR0; + float2 TextureCoordinates : TEXCOORD0; +}; + +struct VertexShaderOutput +{ + float4 Position : SV_POSITION; + float4 Color : COLOR0; + float2 TextureCoordinates : TEXCOORD0; +}; + +VertexShaderOutput VertexShaderFunction(in VertexShaderInput input) +{ + VertexShaderOutput output = (VertexShaderOutput)0; + float4 pos = mul(input.Position, uWorldViewProjection); + output.Position = pos; + + output.Color = input.Color; + output.TextureCoordinates = input.TextureCoordinates; + + return output; +} + +// The X coordinate is the trail completion, the Y coordinate is the same as any other. +// This is simply how the primitive TextCoord is layed out in the C# code. +float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0 +{ + float4 color = input.Color; + float2 coords = input.TextureCoordinates; + + // Read the fade map as a streak. + float4 fadeMapColor = tex2D(uImage1, coords); + float opacity = fadeMapColor.r; + return color * opacity; +} + +technique Technique1 +{ + pass TrailPass + { + VertexShader = compile vs_2_0 VertexShaderFunction(); + PixelShader = compile ps_2_0 PixelShaderFunction(); + } +} diff --git a/Effects/FadingSolidTrail.xnb b/Effects/FadingSolidTrail.xnb new file mode 100644 index 0000000000000000000000000000000000000000..7e0935bda4647b1083ec783ebcaf68ec0d72f999 GIT binary patch literal 2036 zcmb_czi-n}5PnYDlG38EATdP3Y(qBi_ZSOd*9i2_g*~rWPGhx z`F)8o<*oAAG#tBSFS^>CrE3oyeTA>t&azgtEtgxac7Jh^8}1C(Yurhz=cy+hy;(Pn zR$86qPRq2dv0*JkzqDHP8m{N?F^hYyqc_rO*;{Cs#v{H_wU@ayRv6A1i-iTAt?_&& zpTEt>loG1@G4N~ms!xN9(%(IK9S`tj+jz0+(J^7&#n>bL=s9|ti8o`rf%^3MjdS#Uq_3JQoVCA;9=}Lh+5?G# z1s2q0dyc_paDJjW?@Qtsq!MLGaPO(@G-_qLW%}(z{S1;gG|CZq1Hj&d>EIpIe)OIR zNiXUa`E|C|$?Ig+O+IW(Fh`9LP5~DrUIMO5d>#0M#J>Uml=v}l zLfWSka6#g8z^=sK0B=cr5BNah>*4;kJvWgb#6 z*6p5jZ?a`1WP77lZzacy6;bpPSFH==-e> z&D>I_N|lmYs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w2G zCrM!Q$G_vFh$0^mJB}MhdA<6AfXe(=EwR|*8dDoPJDsoT{Kb1To5oDQvMd=x z5^RlRQw2t#Vsdf|8`a(e9g+!LhcL{Qx!>iPGNJXi2N@!7Vfzy(w$d1_S7(s;jE`+f zY_Lu5vb1^5SR+ZcTXwU3;*3e(2g%s7>}dXCcX`riila>)qx&tu1>?e? zAizPKS4Z7xpbe`uGW~$%uC;D@WKV4ucU{jtVPsUkA*9ljbHUmQC>jYmHZt=z$!*j} z-~QNsu`tKL0Lw(HAH~Yj(Hc76E^ub<@<_byPoEpDH2rv6X-j7B$g8f{ahl%LhSWd0 zkM-;x0j}B6F5{abCeK$qder@O80(xMgqXS}XnN&!NFo#1vspF{i80dN+vKCa;@_4OR2uCQ1zsB`*Vfe` z@tqa6YZ(uUymo75X}+`C7xbrhPVub~4`gJxsw&ZXs3@{Vm?!8L*oVE~#sR}dgW0_Q z$q`;L{>x^U*z(z@gw!080I(-An?3>NQP+^R&9+%<7wCFw54Us>#Y+3Wnx;;>FeIDj zBNAwKj?q|9nN1w@{+Usz!slzMKu$<1*Qy`w@d17v{Z2L~+m+7{`lvkRu)Z19AuP?c zDcwQix-L|_*WD(KU6)?UQ>jgs^sW&vbs+O*KTgz-11a~a&3NXyYfL+4Pzj|)E{K?3 zY3*q0^o=!74SOv{i1w&sC=abxk6US$%%@hI$EQSzE{ZBM|ME_3v`yssoIguq8W~?X z+cc%mX*3Etn33u7HVkj+GEt2lAhnqcwc`Y5+Aza5Yt2*5#x@JVZ(sfMR~tLbH7rO?~FJ|gO&{G85jZKWVwKh3ySO zv@0)z>(k-X#FDrsvah3%pP*2-5kuB*oES9TNIBtZB*}G2mUN7AnDT`pEPgD`tJV#2k{j# literal 0 HcmV?d00001 diff --git a/ExtraTextures/TaintedArm.png b/ExtraTextures/TaintedArm.png new file mode 100644 index 0000000000000000000000000000000000000000..f8796f05e787355d2b6fa65e383341523fbba80f GIT binary patch literal 932 zcmV;V16%xwP)Px#1ZP1_K>z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XQ||5?3z@}?*%Xc43eMWs?b2v%mAC+VZZZmN*okPpIU zYg2aKyxH9(R)@o3Wf~4Pw#P2)_FuKV=si{S#FJXm=0;`(cAG1D!C`w-`=IkZqwUSZ zrMA9G#G^pH-q0`ZFRyBUexappyY{6mbKJSr)}=&v3LwYK{pW|aPyp;LHIuUu@B(;$ z>n3L-PVTP86bV;>t+gHPgQM#+ZCL^K0xN*e&tH1l0w|HY0>1+gm&?&=ELP-@+;RQ{ znei~|rIE-v`ZVGd_KOgX0v1qWeRfU{sRmR;8cQ)&h7}B70gM>l@P!qzJQAJ)oFfaV zf6M^_u0!PfJF-g3A!|c=eF#T^!JuE2!*V%C1UT3Dp08)Z^T4!l#PEofdk~%i@Pd^~ z%!mwEg)g})VD1Td4~PnY8dkLFiV#kpAGH-#^@NDG3b_6mc*sS#9st%ZIb9h7JONb@ zeem}M&H-3!g9UQ$dtJO$@L!YzD9!+QX2hzRbWOrnz!eG4`B~?UcsyW5#yh60#G`-( zdmt)QCgpb$JTr!`0C4SY-~;QKAuAT20xo#wWH@q=vjUaM Y4}g=Q+-bLJ=l}o!07*qoM6N<$f=62|yZ`_I literal 0 HcmV?d00001 diff --git a/ExtraTextures/TaintedHand.png b/ExtraTextures/TaintedHand.png new file mode 100644 index 0000000000000000000000000000000000000000..89e494b14c32ffcb87057c14ac88f2b6bdd74a9c GIT binary patch literal 673 zcmV;S0$%-zP)QF(00001b5ch_0Itp) z=>Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!TrF$*+f(9o_?_0ncE!M z?`CG_?9OJh&L-&hhYL44-0n4Ji(J1vb(_~%++rU zQ)&bQqv38iuFB=}V>nKylcc#~jcxpgnZeXpm-ZRM#Qo<-7#1_c%_gWnDv zKtG4-vU2S@rhA~)FO4%btJnYQ7?@cbf3J>NY{eY~bxZlF8IO9i(yLp)t@2(rLVd>K zxH2$C9335;gd<$sUNvWP&W}% za1(~&8MRoAhdvo7KP$1sucx}FR%6grkfpi#T-WRdea|e{Sg$u&h$qjOXN1ocZ=UzL z*0b`B@$A_Hy_IQlQ%2Z>F#nqw~y^ z#-mYwR3-z(i1^I}0E^XU7% zd0v;%p7%;K7Y~ai8`LMQQ_NFz-m27>l^SCy8!7ZH+^b{Uueuof_TL__o&hWOdjDK@ z1KG>{>Um32V~QGNWqhti)ga{NwZ~WvH419Ln+KH`>vX;VdY!$tZA3*W00000NkvXX Hu0mjfiXl39 literal 0 HcmV?d00001 diff --git a/ExtraTextures/TaintedHand2.png b/ExtraTextures/TaintedHand2.png new file mode 100644 index 0000000000000000000000000000000000000000..7050006ac8c61186020aaeb5ff1be56f97c2d586 GIT binary patch literal 783 zcmV+q1MvKbP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!2kdb!2!6DYwZ940;EYqK~!i%?U>C@ z8!;4x(}WU838k<=s1i~)RDvxlUZBt17wC#@E47-_cx`NfHY zMB|~Z99pja7b*Tf4#Ldm=y#97zEo@;Su1G1GU1~hUfg3`j47D zw4Rm|)>Fm2dX-nu?O^BP1ZL;m*ogViw0`&yrkt56R`#{3ub|BqGb)xsmGnk#`^nUQ z?J~3<)t|*79qpuv`WIDeZ|opdR7I^%Rk$Rce7r4K?m^(7s-Mt&_PR7m4qi4TwUh5u;gM?o@c zTx&O$@QzNuhvyRgvr6*+KbTsBIdW3=KgHl|yzKXp_fW-@iYr*F-2)|fu73LwTAu&_ N002ovPDHLkV1gnUf{_3K literal 0 HcmV?d00001 diff --git a/Projectiles/Melee/TaintedBladeSlasher.cs b/Projectiles/Melee/TaintedBladeSlasher.cs new file mode 100644 index 0000000000..a5e25b8753 --- /dev/null +++ b/Projectiles/Melee/TaintedBladeSlasher.cs @@ -0,0 +1,276 @@ +using CalamityMod.CalPlayer; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using System.IO; +using Terraria; +using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Melee +{ + public class TaintedBladeSlasher : ModProjectile + { + internal PrimitiveTrail TrailDrawer = null; + public ref float SwordItemID => ref projectile.ai[0]; + public ref float VerticalOffset => ref projectile.localAI[0]; + public ref float Time => ref projectile.localAI[1]; + public float AttackCompletionRatio => 1f - Owner.itemAnimation / (float)Owner.itemAnimationMax; + public Player Owner => Main.player[projectile.owner]; + public int Variant => projectile.identity % 2; + + public const float ForearmLength = 80f; + public const float ArmLength = 108f; + + public Rectangle BladeFrame + { + get + { + Texture2D bladeTexture = Main.itemTexture[(int)SwordItemID]; + Rectangle bladeFrame = bladeTexture.Frame(1, 1, 0, 0); + bool hasMultipleFrames = Main.itemAnimations[(int)SwordItemID] != null; + if (hasMultipleFrames) + bladeFrame = Main.itemAnimations[(int)SwordItemID].GetFrame(bladeTexture); + return bladeFrame; + } + } + + public Vector2 BackArmAimPosition + { + get + { + Vector2 baseAimPosition = Owner.Top + new Vector2(-Owner.direction * (ForearmLength + Math.Abs(VerticalOffset) * 0.55f), -27f); + if (Variant == 1) + baseAimPosition.Y += 30f; + if (Owner.itemAnimation == 0) + return baseAimPosition; + + Vector2 endSwingPosition = Owner.Center + Vector2.UnitX * Owner.direction * 510f; + return Vector2.SmoothStep(baseAimPosition, endSwingPosition, Utils.InverseLerp(0f, 0.67f, AttackCompletionRatio, true) * Utils.InverseLerp(1f, 0.67f, AttackCompletionRatio, true)); + } + } + public Vector2 IdleMoveOffset + { + get + { + Vector2 offset = Owner.itemAnimation == 0 ? (Time / 27f).ToRotationVector2() * new Vector2(5f, 4f) : Vector2.Zero; + if (Variant == 1) + offset += Vector2.UnitX * Owner.direction * (1f - AttackCompletionRatio) * 40f; + return offset; + } + } + public Vector2 FrontArmEnd + { + get + { + float backArmRotation = Owner.AngleTo(BackArmAimPosition); + Vector2 fromArmDrawPosition = Owner.Center + backArmRotation.ToRotationVector2() * ForearmLength; + Vector2 backOffset = (projectile.Center - fromArmDrawPosition).SafeNormalize(Vector2.Zero) * ArmLength + IdleMoveOffset; + return fromArmDrawPosition + backOffset; + } + } + public Vector2 BladeOffsetDirection + { + get + { + float backArmRotation = Owner.AngleTo(BackArmAimPosition); + Vector2 fromArmDrawPosition = Owner.Center + backArmRotation.ToRotationVector2() * ForearmLength; + Vector2 backOffset = (projectile.Center - fromArmDrawPosition).SafeNormalize(Vector2.Zero) * ArmLength + IdleMoveOffset; + float bladeRotation = backOffset.ToRotation() - MathHelper.PiOver4 + MathHelper.Pi; + return -(bladeRotation + MathHelper.PiOver4 + BladeRotationOffset).ToRotationVector2(); + } + } + public Vector2 BladeCenterPosition + { + get + { + float offsetFactor = BladeFrame.Height / 4f + 31f; + return FrontArmEnd + BladeOffsetDirection * offsetFactor; + } + } + public float BladeRotationOffset => MathHelper.Lerp(MathHelper.PiOver2, 0f, Utils.InverseLerp(0f, 0.17f, 1f - AttackCompletionRatio, true)) * -Owner.direction; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Blade"); + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 70; + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 4; + projectile.friendly = true; + projectile.melee = true; + projectile.tileCollide = false; + projectile.penetrate = -1; + projectile.timeLeft = 90000; + projectile.usesLocalNPCImmunity = true; + } + + public override void SendExtraAI(BinaryWriter writer) => writer.Write(VerticalOffset); + + public override void ReceiveExtraAI(BinaryReader reader) => VerticalOffset = reader.ReadSingle(); + + public override void AI() + { + CalamityPlayerMiscEffects.EnchantHeldItemEffects(Owner, Owner.Calamity(), Owner.ActiveItem()); + if (!Owner.Calamity().bladeArmEnchant) + { + projectile.Kill(); + return; + } + float swingOffsetAngle = MathHelper.SmoothStep(-1.87f, 3.79f, AttackCompletionRatio); + + // Offset a little bit angularly if the secondary variant to prevent complete overlap. + if (Variant == 1) + swingOffsetAngle -= 0.7f; + swingOffsetAngle *= Owner.direction; + swingOffsetAngle = MathHelper.Lerp(0f, swingOffsetAngle, Utils.InverseLerp(0f, 0.16f, AttackCompletionRatio, true)); + + if (Owner.itemAnimation == 0) + swingOffsetAngle = 0f; + + Vector2 destination = Owner.Center; + + if (Owner.itemAnimation == 0) + { + destination.X += Owner.direction * (VerticalOffset * 0.6f + 180f); + destination.Y += 330f + VerticalOffset; + if (Variant == 1) + destination.Y += 540f; + + // The blade can be kept in a static location when not being swung. + // This can result in insane damage coming from "poking" enemies. + // To accomodate for this, the hit countdown is increased when not attacking. + projectile.localNPCHitCooldown = 24; + } + else + { + // Swing around in an arc as needed. + // One arm extends a little bit further than the other. + destination -= Vector2.UnitY.RotatedBy(swingOffsetAngle) * 600f; + + // Make a fire/swing sound. + if (Owner.itemAnimation == 21) + Main.PlaySound(SoundID.DD2_FlameburstTowerShot, Owner.Center); + projectile.localNPCHitCooldown = 3; + } + + if (AttackCompletionRatio < 0.16f) + projectile.oldPos = new Vector2[projectile.oldPos.Length]; + + // Very, very quickly approach the swing destination while attacking. + // Also gain a temporary extra update. + if (Owner.itemAnimation > 0) + { + projectile.Center = Vector2.Lerp(projectile.Center, destination, 0.19f); + projectile.extraUpdates = 1; + } + + // Idly move towards the destination. + if (projectile.Center != destination) + projectile.Center += (destination - projectile.Center).SafeNormalize(Vector2.Zero) * MathHelper.Min(projectile.Distance(destination), 12f + Owner.velocity.Length()); + + Time++; + } + + internal float PrimitiveWidthFunction(float completionRatio) => BladeFrame.Height * 0.47f; + + internal Color PrimitiveColorFunction(float completionRatio) + { + float opacity = Utils.InverseLerp(0.8f, 0.52f, completionRatio, true) * Utils.InverseLerp(1f, 0.81f, AttackCompletionRatio, true); + Color startingColor = Color.Lerp(Color.Red, Color.DarkRed, 0.4f); + Color endingColor = Color.Lerp(Color.DarkRed, Color.Purple, 0.77f); + return Color.Lerp(startingColor, endingColor, (float)Math.Pow(completionRatio, 0.37f)) * opacity; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + if (TrailDrawer is null) + TrailDrawer = new PrimitiveTrail(PrimitiveWidthFunction, PrimitiveColorFunction, specialShader: GameShaders.Misc["CalamityMod:FadingSolidTrail"]); + + Texture2D forearmTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/TaintedForearm"); + Texture2D armTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/TaintedArm"); + Texture2D handTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/TaintedHand"); + + // Reflect the 1st hand variant horizontally. + SpriteEffects handDirection = SpriteEffects.None; + if (Variant == (Owner.direction == -1).ToInt()) + { + handTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/TaintedHand2"); + handDirection = SpriteEffects.FlipHorizontally; + } + Texture2D bladeTexture = Main.itemTexture[(int)SwordItemID]; + + // Draw the arms. + float backArmRotation = Owner.AngleTo(BackArmAimPosition); + spriteBatch.Draw(forearmTexture, Owner.Center - Main.screenPosition, null, Color.White, backArmRotation - MathHelper.PiOver2, Vector2.UnitX * forearmTexture.Size() * 0.5f, projectile.scale, SpriteEffects.None, 0f); + + Vector2 frontArmDrawPosition = Owner.Center + backArmRotation.ToRotationVector2() * ForearmLength + IdleMoveOffset; + float frontArmRotation = projectile.AngleFrom(frontArmDrawPosition); + spriteBatch.Draw(armTexture, frontArmDrawPosition - Main.screenPosition, null, Color.White, frontArmRotation - MathHelper.PiOver2, Vector2.UnitX * armTexture.Size() * 0.5f, projectile.scale, SpriteEffects.None, 0f); + + float handRotation = frontArmRotation + MathHelper.PiOver2 + MathHelper.Pi; + float bladeRotation = handRotation - MathHelper.PiOver4 + MathHelper.Pi + BladeRotationOffset; + if (Owner.direction == -1) + bladeRotation += MathHelper.PiOver2; + + // Draw the trail behind the blade. + if (Owner.itemAnimation > 0) + { + GameShaders.Misc["CalamityMod:FadingSolidTrail"].SetShaderTexture(ModContent.GetTexture("CalamityMod/ExtraTextures/BladeTrailUVMap")); + Vector2 bottom = BladeCenterPosition - BladeOffsetDirection * BladeFrame.Height * 0.5f - Main.screenPosition; + Vector2 top = BladeCenterPosition + BladeOffsetDirection * BladeFrame.Height * 0.5f - Main.screenPosition; + Vector2 offsetToBlade = (top - bottom).SafeNormalize(Vector2.Zero).RotatedBy(MathHelper.PiOver2) * 5f; + + TrailDrawer.OverridingStickPointStart = BladeCenterPosition - BladeOffsetDirection * BladeFrame.Height * 0.5f + offsetToBlade - Main.screenPosition; + TrailDrawer.OverridingStickPointEnd = BladeCenterPosition + BladeOffsetDirection * BladeFrame.Height * 0.5f + offsetToBlade - Main.screenPosition; + + // Swap the ends if needed so that the trail faces the right direction. + if (Owner.direction == -1) + Utils.Swap(ref TrailDrawer.OverridingStickPointStart, ref TrailDrawer.OverridingStickPointEnd); + + Vector2[] drawPoints = new Vector2[projectile.oldPos.Length]; + Vector2 perpendicularDirection = BladeOffsetDirection.SafeNormalize(Vector2.UnitY).RotatedBy(MathHelper.PiOver2); + for (int i = 1; i < drawPoints.Length; i++) + { + if (projectile.oldPos[i] == Vector2.Zero) + continue; + + drawPoints[i] = projectile.Center + perpendicularDirection.RotatedBy(i * -0.014f * Owner.direction) * i * -Owner.direction * 4f; + } + + TrailDrawer.Draw(drawPoints, BladeCenterPosition - projectile.position - Main.screenPosition, 67); + } + + // Draw the blade. + Vector2 bladeDrawPosition = BladeCenterPosition - Main.screenPosition; + SpriteEffects bladeDirection = Owner.direction == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + spriteBatch.Draw(bladeTexture, bladeDrawPosition, BladeFrame, Color.White, bladeRotation, BladeFrame.Size() * 0.5f, projectile.scale, bladeDirection, 0f); + + // Draw the hand. + spriteBatch.Draw(handTexture, FrontArmEnd - Main.screenPosition, null, projectile.GetAlpha(Color.White), handRotation, handTexture.Size() * 0.5f, projectile.scale, handDirection, 0f); + return false; + } + + // Register collision at the blade's position. + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + Vector2 start = BladeCenterPosition - BladeOffsetDirection * BladeFrame.Height * 0.5f; + Vector2 end = BladeCenterPosition + BladeOffsetDirection * BladeFrame.Height * 0.5f; + float width = 60f; + float _ = 0f; + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), start, end, width, ref _); + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + ItemLoader.OnHitNPC(Owner.ActiveItem(), Owner, target, damage, knockback, crit); + NPCLoader.OnHitByItem(target, Owner, Owner.ActiveItem(), damage, knockback, crit); + PlayerHooks.OnHitNPC(Owner, Owner.ActiveItem(), target, damage, knockback, crit); + } + } +} diff --git a/TrailGeneration/PrimitiveTrail.cs b/TrailGeneration/PrimitiveTrail.cs index 707c0e8845..53668105f3 100644 --- a/TrailGeneration/PrimitiveTrail.cs +++ b/TrailGeneration/PrimitiveTrail.cs @@ -45,6 +45,9 @@ namespace CalamityMod public DynamicIndexBuffer IndexBuffer = null; public DynamicVertexBuffer VertexBuffer = null; + public Vector2 OverridingStickPointStart = Vector2.Zero; + public Vector2 OverridingStickPointEnd = Vector2.Zero; + public delegate List TrailPointRetrievalFunction(IEnumerable originalPositions, Vector2 generalOffset, int totalTrailPoints, IEnumerable originalRotations = null); public PrimitiveTrail(VertexWidthFunction widthFunction, VertexColorFunction colorFunction, TrailPointRetrievalFunction pointFunction = null, MiscShaderData specialShader = null) @@ -194,11 +197,19 @@ namespace CalamityMod // This doesn't use RotatedBy for the sake of performance (there can potentially be a lot of trail points). Vector2 sideDirection = new Vector2(-directionToAhead.Y, directionToAhead.X); + Vector2 left = currentPosition - sideDirection * widthAtVertex; + Vector2 right = currentPosition + sideDirection * widthAtVertex; + if (i == 0 && OverridingStickPointStart != Vector2.Zero) + { + left = OverridingStickPointStart; + right = OverridingStickPointEnd; + } + // What this is doing, at its core, is defining a rectangle based on two triangles. // These triangles are defined based on the width of the strip at that point. // The resulting rectangles combined are what make the trail itself. - vertices[i * 2] = new VertexPosition2DColor(currentPosition - sideDirection * widthAtVertex, vertexColor, leftCurrentTextureCoord); - vertices[i * 2 + 1] = new VertexPosition2DColor(currentPosition + sideDirection * widthAtVertex, vertexColor, rightCurrentTextureCoord); + vertices[i * 2] = new VertexPosition2DColor(left, vertexColor, leftCurrentTextureCoord); + vertices[i * 2 + 1] = new VertexPosition2DColor(right, vertexColor, rightCurrentTextureCoord); } if (VertexBuffer is null || vertices.Length != VertexBuffer.VertexCount) diff --git a/UI/CalamitasEnchantments/CalamitasEnchantUI.cs b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs index 480780ef07..47f77b4606 100644 --- a/UI/CalamitasEnchantments/CalamitasEnchantUI.cs +++ b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs @@ -1,6 +1,5 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using System.Collections.Generic; using System.Linq; using Terraria; diff --git a/UI/CalamitasEnchantments/EnchantmentManager.cs b/UI/CalamitasEnchantments/EnchantmentManager.cs index 98d94c20f7..619a285624 100644 --- a/UI/CalamitasEnchantments/EnchantmentManager.cs +++ b/UI/CalamitasEnchantments/EnchantmentManager.cs @@ -1,4 +1,5 @@ -using CalamityMod.Items.Weapons.Summon; +using CalamityMod.Projectiles.Melee; +using Microsoft.Xna.Framework; using System; using System.Collections.Generic; using System.Linq; @@ -126,7 +127,7 @@ namespace CalamityMod.UI.CalamitasEnchants { EnchantmentList = new List { - new Enchantment("Cursed", "Summons demons that harm you but drop healing items on death on item usage.", + new Enchantment("Cursed", "Summons demons that harm you but drop healing items on death on item usage.", 100, null, player => player.Calamity().cursedSummonsEnchant = true, @@ -171,6 +172,38 @@ namespace CalamityMod.UI.CalamitasEnchants item => item.damage = (int)(item.damage * 1.5), player => player.Calamity().explosiveMinionsEnchant = true, item => item.damage > 0 && item.maxStack == 1 && item.summon), + + new Enchantment("Tainted", "Removes projectile shooting capabilities of this item. In exchange, two skeletal arms are released on use that slice at the mouse position.", + 800, + item => item.useTime = item.useAnimation = 25, + player => + { + player.Calamity().bladeArmEnchant = true; + bool armsArePresent = false; + int armType = ModContent.ProjectileType(); + for (int i = 0; i < Main.maxProjectiles; i++) + { + if (Main.projectile[i].type != armType || Main.projectile[i].owner != player.whoAmI || !Main.projectile[i].active) + continue; + + armsArePresent = true; + break; + } + + if (Main.myPlayer == player.whoAmI && !armsArePresent) + { + // Yes, this is a LOT of damage but given the limited range of this thing it needs to be extremely powerful when it does actually hit. + int damage = (int)(player.ActiveItem().damage * player.MeleeDamage() * 5); + int blade = Projectile.NewProjectile(player.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, player.whoAmI, 1, player.ActiveItem().type); + if (Main.projectile.IndexInRange(blade)) + Main.projectile[blade].localAI[0] = 0f; + + blade = Projectile.NewProjectile(player.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, player.whoAmI, -1, player.ActiveItem().type); + if (Main.projectile.IndexInRange(blade)) + Main.projectile[blade].localAI[0] = -80f; + } + }, + item => item.damage > 0 && item.maxStack == 1 && item.melee && !item.noUseGraphic && item.shoot > ProjectileID.None), }; // Special disenchantment thing. This is separated from the list on purpose. From 2e5a35630ecc57923fd3ad1a2dcc845d94a830ba Mon Sep 17 00:00:00 2001 From: Dominic Date: Sun, 16 May 2021 16:36:14 -0500 Subject: [PATCH 102/202] Slight fix --- Projectiles/Melee/TaintedBladeSlasher.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projectiles/Melee/TaintedBladeSlasher.cs b/Projectiles/Melee/TaintedBladeSlasher.cs index a5e25b8753..3958b3a93c 100644 --- a/Projectiles/Melee/TaintedBladeSlasher.cs +++ b/Projectiles/Melee/TaintedBladeSlasher.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Melee public class TaintedBladeSlasher : ModProjectile { internal PrimitiveTrail TrailDrawer = null; - public ref float SwordItemID => ref projectile.ai[0]; + public ref float SwordItemID => ref projectile.ai[1]; public ref float VerticalOffset => ref projectile.localAI[0]; public ref float Time => ref projectile.localAI[1]; public float AttackCompletionRatio => 1f - Owner.itemAnimation / (float)Owner.itemAnimationMax; From 9426eeb9759285793bc1d7b9a2eca98f905cad7b Mon Sep 17 00:00:00 2001 From: Dominic Date: Sun, 16 May 2021 19:47:41 -0500 Subject: [PATCH 103/202] Start of Treacherous Enchant (wip) --- CalPlayer/CalamityPlayer.cs | 2 + Items/CalamityGlobalItem.cs | 8 ++ Projectiles/Magic/ManaMonster.cs | 120 ++++++++++++++++++ Projectiles/Magic/ManaMonster.png | Bin 0 -> 983 bytes .../EnchantmentManager.cs | 6 + 5 files changed, 136 insertions(+) create mode 100644 Projectiles/Magic/ManaMonster.cs create mode 100644 Projectiles/Magic/ManaMonster.png diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 0407d4ed16..d4bc8d64d5 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -1003,6 +1003,7 @@ namespace CalamityMod.CalPlayer public bool dischargingItemEnchant = false; public bool explosiveMinionsEnchant = false; public bool bladeArmEnchant = false; + public bool manaMonsterEnchant = false; #endregion Calamitas Enchant Effects #endregion @@ -1989,6 +1990,7 @@ namespace CalamityMod.CalPlayer dischargingItemEnchant = false; explosiveMinionsEnchant = false; bladeArmEnchant = false; + manaMonsterEnchant = false; lastProjectileHit = null; diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index da202648c4..df861eb740 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -734,6 +734,14 @@ namespace CalamityMod.Items Main.PlaySound(SoundID.DD2_DarkMageSummonSkeleton, Main.MouseWorld); } + bool belowHalfMana = player.statMana < player.statManaMax2 * 0.5f; + if (player.Calamity().manaMonsterEnchant && Main.rand.NextBool(12) && player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0 && belowHalfMana) + { + int damage = (int)(45000 * player.MagicDamage()); + Vector2 shootVelocity = player.SafeDirectionTo(Main.MouseWorld, -Vector2.UnitY).RotatedByRandom(0.67f) * Main.rand.NextFloat(4f, 5f); + Projectile.NewProjectile(player.Center + shootVelocity, shootVelocity, ModContent.ProjectileType(), damage, 0f, player.whoAmI); + } + if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0 && (item.damage > 0 || item.ammo != AmmoID.None)) { diff --git a/Projectiles/Magic/ManaMonster.cs b/Projectiles/Magic/ManaMonster.cs new file mode 100644 index 0000000000..4d5ff9f799 --- /dev/null +++ b/Projectiles/Magic/ManaMonster.cs @@ -0,0 +1,120 @@ +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Magic +{ + public class ManaMonster : ModProjectile + { + public ref float Time => ref projectile.ai[0]; + public Player Target => Main.player[projectile.owner]; + public const int NPCAttackTime = 150; + public const int PlayerAttackRedirectTime = 45; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Monster"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 3; + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 52; + projectile.friendly = true; + projectile.hostile = true; + projectile.tileCollide = false; + projectile.ignoreWater = true; + projectile.penetrate = -1; + projectile.timeLeft = 300; + projectile.Opacity = 0f; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 5; + projectile.magic = true; + } + + public override void AI() + { + if (Time < NPCAttackTime) + { + projectile.Opacity = Utils.InverseLerp(0f, 15f, Time, true); + NPC potentialTarget = projectile.Center.ClosestNPCAt(1600f); + if (potentialTarget != null) + AttackNPCTarget(potentialTarget); + else if (projectile.velocity.Length() < 22f) + projectile.velocity *= 1.02f; + } + else + { + // Make an alert sound to indicate that the monster has become enraged and will now attack its caster. + if (Time == NPCAttackTime) + { + int ambientNoiseID = Main.rand.Next(39, 41 + 1); + Main.PlaySound(SoundID.Zombie, Target.Center, ambientNoiseID); + Main.PlaySound(SoundID.DD2_DrakinShot, Target.Center); + CreateTransitionBurstDust(); + } + + if (Time < NPCAttackTime + PlayerAttackRedirectTime) + { + float idealMovementDirection = projectile.AngleTo(Target.Center); + float angularTurnSpeed = 0.09f; + float newSpeed = MathHelper.Lerp(projectile.velocity.Length(), 14f, 0.1f); + projectile.velocity = projectile.velocity.ToRotation().AngleTowards(idealMovementDirection, angularTurnSpeed).ToRotationVector2() * newSpeed; + } + else if (projectile.velocity.Length() < 34f) + projectile.velocity *= 1.02f; + + // Fade out. + projectile.Opacity = Utils.InverseLerp(0f, 15f, projectile.timeLeft, true); + } + + projectile.rotation = projectile.velocity.ToRotation() - MathHelper.PiOver2; + Time++; + } + + public void AttackNPCTarget(NPC target) + { + if (!projectile.WithinRange(target.Center, 60f)) + { + float idealMovementDirection = projectile.AngleTo(target.Center); + float angularTurnSpeed = 0.18f; + float newSpeed = MathHelper.Lerp(projectile.velocity.Length(), 21f, 0.115f); + projectile.velocity = projectile.velocity.ToRotation().AngleTowards(idealMovementDirection, angularTurnSpeed).ToRotationVector2() * newSpeed; + } + } + + public void CreateTransitionBurstDust() + { + if (Main.dedServ) + return; + + for (int i = 0; i < 75; i++) + { + Dust brimstone = Dust.NewDustPerfect(projectile.Center + Main.rand.NextVector2Square(-25f, 25f), (int)CalamityDusts.Brimstone); + brimstone.velocity = Main.rand.NextVector2Unit() * Main.rand.NextFloat(2f, 3.1f) * MathHelper.Lerp(1f, 2.175f, i / 75f); + brimstone.velocity = Vector2.Lerp(brimstone.velocity, -Vector2.UnitY * brimstone.velocity.Length(), 0.5f); + brimstone.scale = MathHelper.Lerp(1f, 1.875f, i / 75f) * Main.rand.NextFloat(0.8f, 1f); + brimstone.fadeIn = 0.4f; + brimstone.noGravity = true; + } + } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + // Ensure damage is not absolutely obscene when hitting players. + damage = (int)(damage * 0.0021); + } + + public override bool CanDamage() => projectile.Opacity >= 1f; + + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityUtils.DrawAfterimagesCentered(projectile, ProjectileID.Sets.TrailingMode[projectile.type], lightColor, 1); + return false; + } + } +} diff --git a/Projectiles/Magic/ManaMonster.png b/Projectiles/Magic/ManaMonster.png new file mode 100644 index 0000000000000000000000000000000000000000..9b98b7bad063f0b4347abe0ef345a61deb11c197 GIT binary patch literal 983 zcmV;|11S87P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D18hk|K~#8N?V3M} z6G0e<6C)=%v=pq);wllWY(R6pneJ!4y;o66|NBU{Bwn3YbA(P3a=6@ zJuY|{qM4m%!C&$^o9u36cjtjHo9t$1_kHG_*_ot09*?7uWi3sD5rc` zOG-6|v4igHIyQ!hF!paB9~Npbnp>3q>Y6*bWrY0@&CS75ddvSstGYCDy2MIS~KsmX51FhTvpVW&cLntT3M!}xe%7Id1uzl%voE3MGZ!CAuzYT zx#8aT-@SDuI$h#MZeBf1PA)ICABsm98tdKfZFM z(!YAgm0wPVt~~5^TnT$WzQrdLi$ZVi_GrbuCdMYOi4m+gCgT}n+8@}@@qE81V$Ol) zmh$N6jNeLl+BtS5xu;-tXSC`{czE`w-mLdKyv=7@ACk``9(W$i6t(faiI>u;`i`n)qoP7#q%+lQ>Z9;;xidRgYI zUN%%e$Me4a=JZz?BC7K=&|V96e|>kMwR&I9XU*UlpJ+*-y|kk9LTHXTB10ss8MKM@D?+Imzs8{uxxD`u zv7kkzzo`qlMgv@T{mp?DDI#PUO!pU*d$goreX?I$Qgh6~ltKUhk=~W-uB46g4#AdR4hr~O5HPpuEEdPDU^bD$B@+<)r|002ovPDHLk FV1nsK-qZj9 literal 0 HcmV?d00001 diff --git a/UI/CalamitasEnchantments/EnchantmentManager.cs b/UI/CalamitasEnchantments/EnchantmentManager.cs index 619a285624..73fd142398 100644 --- a/UI/CalamitasEnchantments/EnchantmentManager.cs +++ b/UI/CalamitasEnchantments/EnchantmentManager.cs @@ -204,6 +204,12 @@ namespace CalamityMod.UI.CalamitasEnchants } }, item => item.damage > 0 && item.maxStack == 1 && item.melee && !item.noUseGraphic && item.shoot > ProjectileID.None), + + new Enchantment("Treacherous", "Causes this item to sometimes release a monster that hurts both you and enemies when you have less than 50% mana.", + 900, + null, + player => player.Calamity().manaMonsterEnchant = true, + item => item.damage > 0 && item.maxStack == 1 && item.magic && item.mana > 0), }; // Special disenchantment thing. This is separated from the list on purpose. From 101c1f5c8cbc8662585fd777837c8d50eb3b48f9 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Tue, 18 May 2021 17:07:05 -0500 Subject: [PATCH 104/202] Finished up the Treacherous enchant --- Items/CalamityGlobalItem.cs | 4 ++-- Projectiles/Magic/ManaMonster.cs | 30 ++++++++---------------------- 2 files changed, 10 insertions(+), 24 deletions(-) diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index df861eb740..9a3773413d 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -737,8 +737,8 @@ namespace CalamityMod.Items bool belowHalfMana = player.statMana < player.statManaMax2 * 0.5f; if (player.Calamity().manaMonsterEnchant && Main.rand.NextBool(12) && player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0 && belowHalfMana) { - int damage = (int)(45000 * player.MagicDamage()); - Vector2 shootVelocity = player.SafeDirectionTo(Main.MouseWorld, -Vector2.UnitY).RotatedByRandom(0.67f) * Main.rand.NextFloat(4f, 5f); + int damage = (int)(165000 * player.MagicDamage()); + Vector2 shootVelocity = player.SafeDirectionTo(Main.MouseWorld, -Vector2.UnitY).RotatedByRandom(0.07f) * Main.rand.NextFloat(4f, 5f); Projectile.NewProjectile(player.Center + shootVelocity, shootVelocity, ModContent.ProjectileType(), damage, 0f, player.whoAmI); } diff --git a/Projectiles/Magic/ManaMonster.cs b/Projectiles/Magic/ManaMonster.cs index 4d5ff9f799..934b90e21c 100644 --- a/Projectiles/Magic/ManaMonster.cs +++ b/Projectiles/Magic/ManaMonster.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Magic { public ref float Time => ref projectile.ai[0]; public Player Target => Main.player[projectile.owner]; - public const int NPCAttackTime = 150; + public const int NPCAttackTime = 50; public const int PlayerAttackRedirectTime = 45; public override void SetStaticDefaults() { @@ -39,12 +39,9 @@ namespace CalamityMod.Projectiles.Magic { if (Time < NPCAttackTime) { - projectile.Opacity = Utils.InverseLerp(0f, 15f, Time, true); - NPC potentialTarget = projectile.Center.ClosestNPCAt(1600f); - if (potentialTarget != null) - AttackNPCTarget(potentialTarget); - else if (projectile.velocity.Length() < 22f) - projectile.velocity *= 1.02f; + projectile.Opacity = Utils.InverseLerp(0f, 30f, Time, true); + if (projectile.velocity.Length() < 27f) + projectile.velocity *= 1.05f; } else { @@ -61,11 +58,11 @@ namespace CalamityMod.Projectiles.Magic { float idealMovementDirection = projectile.AngleTo(Target.Center); float angularTurnSpeed = 0.09f; - float newSpeed = MathHelper.Lerp(projectile.velocity.Length(), 14f, 0.1f); + float newSpeed = MathHelper.Lerp(projectile.velocity.Length(), 22f, 0.1f); projectile.velocity = projectile.velocity.ToRotation().AngleTowards(idealMovementDirection, angularTurnSpeed).ToRotationVector2() * newSpeed; } - else if (projectile.velocity.Length() < 34f) - projectile.velocity *= 1.02f; + else if (projectile.velocity.Length() < 35f) + projectile.velocity *= 1.04f; // Fade out. projectile.Opacity = Utils.InverseLerp(0f, 15f, projectile.timeLeft, true); @@ -75,17 +72,6 @@ namespace CalamityMod.Projectiles.Magic Time++; } - public void AttackNPCTarget(NPC target) - { - if (!projectile.WithinRange(target.Center, 60f)) - { - float idealMovementDirection = projectile.AngleTo(target.Center); - float angularTurnSpeed = 0.18f; - float newSpeed = MathHelper.Lerp(projectile.velocity.Length(), 21f, 0.115f); - projectile.velocity = projectile.velocity.ToRotation().AngleTowards(idealMovementDirection, angularTurnSpeed).ToRotationVector2() * newSpeed; - } - } - public void CreateTransitionBurstDust() { if (Main.dedServ) @@ -105,7 +91,7 @@ namespace CalamityMod.Projectiles.Magic public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) { // Ensure damage is not absolutely obscene when hitting players. - damage = (int)(damage * 0.0021); + damage = Main.rand.Next(150, 225); } public override bool CanDamage() => projectile.Opacity >= 1f; From f91c2fe215ac173ce1b126ecb2a4a79390b0cbe8 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 19 May 2021 19:15:24 -0500 Subject: [PATCH 105/202] Entropy's vigil upgrade and Brimstone Locus --- CalPlayer/CalamityPlayer.cs | 3 + ExtraTextures/Particles/Light.png | Bin 0 -> 2903 bytes Items/BrimstoneLocus.cs | 35 ++++++ Items/BrimstoneLocus.png | Bin 0 -> 295 bytes Items/CalamityGlobalItem.cs | 52 +++++++- Items/Weapons/Summon/Something.cs | 50 ++++++++ Items/Weapons/Summon/Something.png | Bin 0 -> 477 bytes NPCs/TownNPCs/WITCH.cs | 7 ++ Particles/EnchantedParticleSet.cs | 45 +++++++ Projectiles/Melee/TaintedBladeSlasher.cs | 8 +- Projectiles/Summon/CataclysmSummon.cs | 115 ++++++++++++++++++ Projectiles/Summon/CatastropheSummon.cs | 51 ++++++++ .../CalamitasEnchantUI.cs | 39 ++++-- .../EnchantmentManager.cs | 27 +++- 14 files changed, 416 insertions(+), 16 deletions(-) create mode 100644 ExtraTextures/Particles/Light.png create mode 100644 Items/BrimstoneLocus.cs create mode 100644 Items/BrimstoneLocus.png create mode 100644 Items/Weapons/Summon/Something.cs create mode 100644 Items/Weapons/Summon/Something.png create mode 100644 Particles/EnchantedParticleSet.cs create mode 100644 Projectiles/Summon/CataclysmSummon.cs create mode 100644 Projectiles/Summon/CatastropheSummon.cs diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index d4bc8d64d5..eaa8000d18 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -114,6 +114,7 @@ namespace CalamityMod.CalPlayer public int defenseDamage = 0; public float rangedAmmoCost = 1f; public bool heldGaelsLastFrame = false; + public bool GivenBrimstoneLocus = false; #endregion #region Tile Entity Trackers @@ -1103,6 +1104,7 @@ namespace CalamityMod.CalPlayer boost.AddWithCondition("newAmidiasInventory", newAmidiasInventory); boost.AddWithCondition("newBanditInventory", newBanditInventory); boost.AddWithCondition("newCalamitasInventory", newCalamitasInventory); + boost.AddWithCondition("GivenBrimstoneLocus", GivenBrimstoneLocus); return new TagCompound { @@ -1179,6 +1181,7 @@ namespace CalamityMod.CalPlayer newAmidiasInventory = boost.Contains("newAmidiasInventory"); newBanditInventory = boost.Contains("newBanditInventory"); newCalamitasInventory = boost.Contains("newCalamitasInventory"); + GivenBrimstoneLocus = boost.Contains("GivenBrimstoneLocus"); // Load rage from "stress" if this is an older save. Otherwise load it from "rage", its new name. if (tag.ContainsKey("stress")) diff --git a/ExtraTextures/Particles/Light.png b/ExtraTextures/Particles/Light.png new file mode 100644 index 0000000000000000000000000000000000000000..8e2d2a871cdedc2f8035aec442b4c527a2bf3160 GIT binary patch literal 2903 zcmV-d3#jyoP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D3hYTlK~#8N?VRg# z6Ui0Dv1}RH^80Pfn}w}p$tGU|e95NB9~~;2$_7#uDx0d^u=&6e9)5r=Sue{ESuf}O z?(`LsY%^XKQnlGRra3b`Gq-Q|J-Xe~G7Oyi-=U|i0U;co2}eRWbo8Hp6r=(tI0YY5 zL1x>Pk`iFYpa91y$(7R*tRkQ-z+KAvD2hrH6oU_`pdQ7zLL7dcPN#>%xdmr16_k`3 z=n2+Q`^Xg1YDdbEfb6`{Xw<`bkD~niLn|s#Pz-*If_k2Hh4d?ESO|O`J}-2i52w?{ z5>ijFBpg#rz0o){uGftZh3<24kD^>be%^)mQdFX#7`%^y?3sS0ID3v65#WpfkB*LJ z;j93UkB?8n5|mvZ5@1JDfF+n3T&-3s@SXtg@9!Je1o%LJ`*W1@`{t%ZK{5Ct3OZ3a zT{*^B0vUtH#>U3ssi~>yZk`Cr8K0P#fJZVJQv6m(FlnNq4dJ3H`BP*S;E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mV?d00001 diff --git a/Items/BrimstoneLocus.cs b/Items/BrimstoneLocus.cs new file mode 100644 index 0000000000..d30495e93c --- /dev/null +++ b/Items/BrimstoneLocus.cs @@ -0,0 +1,35 @@ +using CalamityMod.Items.Materials; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items +{ + public class BrimstoneLocus : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Brimstone Locus"); + Tooltip.SetDefault("Not only can I enhance your equipment with potent magic, I can also draw out the true strength and ascend\n" + + "some of your weaponry to entirely new forms\n" + + "Such items are revealed while this item is in your inventory"); + } + + public override void SetDefaults() + { + item.width = 20; + item.height = 20; + item.rare = ItemRarityID.Purple; + item.Calamity().customRarity = CalamityRarity.Violet; + item.value = 0; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 3); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/BrimstoneLocus.png b/Items/BrimstoneLocus.png new file mode 100644 index 0000000000000000000000000000000000000000..fae3b786552cd8d03b5413f9b8d64b7a8511d72e GIT binary patch literal 295 zcmeAS@N?(olHy`uVBq!ia0vp^av;pX3?zBp#Z3TGjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCf`V@Ck7R(qeqdwi>p+mTnpn28m*p|0fnd_V-_F;s%sDbIvLUNO6?}`33)n z0ftRybj|}sISV`@iy0XB4ude`@%$AjK*1VM7sn6_|D_WS@-ZuNxNtjN{r~@=(K)qS z-p03U#ZTBY9lZYMP}l0%I~UX5`Ilt-f7ze^SVhmCz2xmZuJ0YT3$oTdFKY6+8uPAO z<6TxmzM@Yk@0oLp8&(wy9;|9zbgo8x@B33R7iV%99e=@U&6iOn60$qkl())) + return true; + + // Create particle positions as necessary. + EnchantmentEnergyParticles.Update(); + + // Draw all particles. + float currentPower = 0f; + int calamitasNPCIndex = NPC.FindFirstNPC(ModContent.NPCType()); + if (calamitasNPCIndex != -1) + currentPower = Utils.InverseLerp(11750f, 1000f, Main.LocalPlayer.Distance(Main.npc[calamitasNPCIndex].Center), true); + + position += Vector2.One * 14f; + EnchantmentEnergyParticles.InterpolationSpeed = MathHelper.Lerp(0.035f, 0.1f, currentPower); + EnchantmentEnergyParticles.DrawSet(position + Main.screenPosition); + + float pulse = Main.GlobalTime * 0.79f % 1f; + float pulseFade = Utils.InverseLerp(0.87f, 0.27f, pulse, true); + float pulseScale = scale * MathHelper.Lerp(1.6f, 1f, pulseFade) / scale; + Color pulseColor = Color.Lerp(drawColor, Color.BlueViolet, pulseFade) * pulseFade; + drawItemManually(pulseColor, pulseScale); + drawItemManually(drawColor, 1f); + + return false; + } + #endregion + #region Reforging private int NewPrefixType(Item item) { diff --git a/Items/Weapons/Summon/Something.cs b/Items/Weapons/Summon/Something.cs new file mode 100644 index 0000000000..7accc71ebf --- /dev/null +++ b/Items/Weapons/Summon/Something.cs @@ -0,0 +1,50 @@ +using CalamityMod.Projectiles.Summon; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Summon +{ + public class Something : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Something"); + Tooltip.SetDefault("Summons either Cataclysm or Catastrophe at the mouse position\n" + + "They will look at you for a moment before charging at you\n" + + "They can do damage to both you and enemies"); + } + + public override void SetDefaults() + { + item.mana = 100; + item.damage = 16660; + item.useStyle = ItemUseStyleID.SwingThrow; + item.width = 58; + item.height = 64; + item.useTime = item.useAnimation = 30; + item.autoReuse = true; + item.noMelee = true; + item.knockBack = 0f; + item.value = CalamityGlobalItem.RarityVioletBuyPrice; + item.rare = ItemRarityID.Red; + item.Calamity().customRarity = CalamityRarity.Violet; + item.UseSound = SoundID.DD2_BetsySummon; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 10f; + item.summon = true; + } + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + if (player.altFunctionUse != 2) + { + if (Main.rand.NextBool(2)) + type = ModContent.ProjectileType(); + Projectile.NewProjectile(Main.MouseWorld, Vector2.Zero, type, damage, knockBack, player.whoAmI); + } + return false; + } + } +} diff --git a/Items/Weapons/Summon/Something.png b/Items/Weapons/Summon/Something.png new file mode 100644 index 0000000000000000000000000000000000000000..96d3b0caf3147fdefbac73e05553e25a2a1f232d GIT binary patch literal 477 zcmeAS@N?(olHy`uVBq!ia0vp^RzU2)!3-p8?o8PWq!^2X+?^QKos)S9s|5IjxB}__%uLa0YEQY=NsG&_F>%#aP-rnS`rqjO?_6Q1iVjdg*N2je zK#Hd%$S?Rm0x$^OKX(o&&RO6QSEamT;l20T?YzSZ0vg( z;LUxvM{KeOr_5$9SYwvT#)(Hm86OaZ5C4;A{ KpUXO@geCx`1k6$Z literal 0 HcmV?d00001 diff --git a/NPCs/TownNPCs/WITCH.cs b/NPCs/TownNPCs/WITCH.cs index a370b8fde1..161db7bccd 100644 --- a/NPCs/TownNPCs/WITCH.cs +++ b/NPCs/TownNPCs/WITCH.cs @@ -1,4 +1,5 @@ using CalamityMod.Dusts; +using CalamityMod.Items; using CalamityMod.Projectiles.Magic; using CalamityMod.UI.CalamitasEnchants; using CalamityMod.World; @@ -133,6 +134,12 @@ namespace CalamityMod.NPCs.TownNPCs CalamitasEnchantUI.NPCIndex = npc.whoAmI; CalamitasEnchantUI.CurrentlyViewing = true; + if (!Main.LocalPlayer.Calamity().GivenBrimstoneLocus) + { + DropHelper.DropItem(npc, ItemType()); + Main.LocalPlayer.Calamity().GivenBrimstoneLocus = true; + } + shop = false; } } diff --git a/Particles/EnchantedParticleSet.cs b/Particles/EnchantedParticleSet.cs new file mode 100644 index 0000000000..4feb625237 --- /dev/null +++ b/Particles/EnchantedParticleSet.cs @@ -0,0 +1,45 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Particles +{ + public class ChargingEnergyParticleSet : BaseParticleSet + { + public float InterpolationSpeed; + public float EdgeOffset; + public Color EdgeColor; + public Color CenterColor; + public override int ParticleLifetime => 50; + public override Texture2D ParticleTexture => ModContent.GetTexture("CalamityMod/ExtraTextures/Particles/Light"); + public ChargingEnergyParticleSet(int setLifetime, int particleSpawnRate, Color edgeColor, Color centerColor, float interpolationSpeed, float edgeOffset) : + base(setLifetime, particleSpawnRate) + { + EdgeColor = edgeColor; + CenterColor = centerColor; + InterpolationSpeed = interpolationSpeed; + EdgeOffset = edgeOffset; + } + + public override void UpdateBehavior(Particle particle) + { + float distanceToCenter = particle.RelativeOffset.Length(); + particle.Scale = MathHelper.SmoothStep(0.05f, 0.125f, Utils.InverseLerp(EdgeOffset, 6f, distanceToCenter, true)); + particle.Scale *= Utils.InverseLerp(ParticleLifetime, ParticleLifetime - 10f, particle.Time, true); + + if (distanceToCenter > 4.5f) + particle.RelativeOffset = Vector2.Lerp(particle.RelativeOffset, Vector2.Zero, InterpolationSpeed); + } + + public override Color DetermineParticleColor(float lifetimeCompletion) + { + Color particleColor = Color.Lerp(EdgeColor, CenterColor, Utils.InverseLerp(0f, 0.67f, lifetimeCompletion, true)); + particleColor.A = 50; + + return particleColor; + } + + public override Particle SpawnParticle() => new Particle(ParticleLifetime, Main.rand.NextVector2CircularEdge(1f, 1f) * EdgeOffset, 0.1f); + } +} \ No newline at end of file diff --git a/Projectiles/Melee/TaintedBladeSlasher.cs b/Projectiles/Melee/TaintedBladeSlasher.cs index 3958b3a93c..5634fdf373 100644 --- a/Projectiles/Melee/TaintedBladeSlasher.cs +++ b/Projectiles/Melee/TaintedBladeSlasher.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Projectiles.Melee public ref float Time => ref projectile.localAI[1]; public float AttackCompletionRatio => 1f - Owner.itemAnimation / (float)Owner.itemAnimationMax; public Player Owner => Main.player[projectile.owner]; - public int Variant => projectile.identity % 2; + public int Variant => (int)projectile.ai[0] % 2; public const float ForearmLength = 80f; public const float ArmLength = 108f; @@ -117,11 +117,12 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { CalamityPlayerMiscEffects.EnchantHeldItemEffects(Owner, Owner.Calamity(), Owner.ActiveItem()); - if (!Owner.Calamity().bladeArmEnchant) + if (!Owner.Calamity().bladeArmEnchant || Owner.CCed || !Owner.active || Owner.dead) { projectile.Kill(); return; } + float swingOffsetAngle = MathHelper.SmoothStep(-1.87f, 3.79f, AttackCompletionRatio); // Offset a little bit angularly if the secondary variant to prevent complete overlap. @@ -174,6 +175,9 @@ namespace CalamityMod.Projectiles.Melee if (projectile.Center != destination) projectile.Center += (destination - projectile.Center).SafeNormalize(Vector2.Zero) * MathHelper.Min(projectile.Distance(destination), 12f + Owner.velocity.Length()); + // Ensure that the position is never too far from the destination. + CalamityUtils.DistanceClamp(ref projectile.position, ref destination, 50f); + Time++; } diff --git a/Projectiles/Summon/CataclysmSummon.cs b/Projectiles/Summon/CataclysmSummon.cs new file mode 100644 index 0000000000..36beeecad4 --- /dev/null +++ b/Projectiles/Summon/CataclysmSummon.cs @@ -0,0 +1,115 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Summon +{ + public class CataclysmSummon : ModProjectile + { + public ref float Time => ref projectile.ai[0]; + public bool LookingAtPlayer => Time < 45f; + public override string Texture => "CalamityMod/NPCs/SupremeCalamitas/SupremeCataclysm"; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cataclysm"); + Main.projFrames[projectile.type] = 6; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 4; + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + ProjectileID.Sets.MinionSacrificable[projectile.type] = false; + ProjectileID.Sets.MinionTargettingFeature[projectile.type] = false; + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 100; + projectile.netImportant = true; + projectile.friendly = true; + projectile.hostile = true; + projectile.ignoreWater = true; + projectile.minionSlots = 0f; + projectile.timeLeft = 90000; + projectile.penetrate = -1; + projectile.Opacity = 0f; + projectile.tileCollide = false; + projectile.minion = true; + } + + public override void AI() => Behavior(projectile, Main.player[projectile.owner], ref Time); + + public static void Behavior(Projectile projectile, Player owner, ref float time) + { + DoFrameEffects(projectile); + + if (time < 40f) + FadeIn(projectile); + + else if (time > 95f) + { + projectile.Opacity -= 0.06f; + if (projectile.Opacity < 0f) + projectile.Kill(); + } + + if (time < 25f) + { + float idealRotation = projectile.AngleTo(owner.Center) - MathHelper.PiOver2; + projectile.rotation = projectile.rotation.AngleLerp(idealRotation, 0.08f); + projectile.rotation = projectile.rotation.AngleTowards(idealRotation, 0.2f); + } + else if (time < 40f) + { + projectile.rotation = projectile.AngleTo(owner.Center) - MathHelper.PiOver2; + projectile.velocity = projectile.SafeDirectionTo(owner.Center) * -5f; + } + else if (time == 40f) + { + projectile.rotation = projectile.AngleTo(owner.Center) - MathHelper.PiOver2; + projectile.velocity = projectile.SafeDirectionTo(owner.Center) * 31f; + projectile.damage = (int)(projectile.damage * 1.45); + + Main.PlaySound(SoundID.DD2_BetsyFlameBreath, owner.Center); + Main.PlaySound(SoundID.DD2_WyvernDiveDown, owner.Center); + } + + time++; + } + + public static void FadeIn(Projectile projectile) + { + if (projectile.localAI[0] == 0f) + { + for (int i = 0; i < 40; i++) + { + Dust brimstone = Dust.NewDustPerfect(projectile.Center + Main.rand.NextVector2Square(-65f, 65f), 267); + brimstone.velocity = -Vector2.UnitY * Main.rand.NextFloat(1.8f, 3.6f); + brimstone.scale = Main.rand.NextFloat(1.65f, 1.85f); + brimstone.fadeIn = Main.rand.NextFloat(0.7f, 0.9f); + brimstone.color = Color.Red; + brimstone.noGravity = true; + } + projectile.localAI[0] = 1f; + } + + projectile.Opacity = MathHelper.Clamp(projectile.Opacity + 0.075f, 0f, 1f); + } + + public static void DoFrameEffects(Projectile projectile) + { + projectile.frameCounter++; + if (projectile.frameCounter % 5f == 4f) + projectile.frame = (projectile.frame + 1) % Main.projFrames[projectile.type]; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityUtils.DrawAfterimagesCentered(projectile, ProjectileID.Sets.TrailingMode[projectile.type], Color.Red, 1); + return true; + } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) => damage = 70; + + public override bool CanDamage() => projectile.Opacity >= 1f; + } +} diff --git a/Projectiles/Summon/CatastropheSummon.cs b/Projectiles/Summon/CatastropheSummon.cs new file mode 100644 index 0000000000..d60bdafa56 --- /dev/null +++ b/Projectiles/Summon/CatastropheSummon.cs @@ -0,0 +1,51 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Summon +{ + public class CatastropheSummon : ModProjectile + { + public ref float Time => ref projectile.ai[0]; + public bool LookingAtPlayer => Time < 45f; + public override string Texture => "CalamityMod/NPCs/SupremeCalamitas/SupremeCatastrophe"; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Catastrophe"); + Main.projFrames[projectile.type] = 6; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 4; + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + ProjectileID.Sets.MinionSacrificable[projectile.type] = false; + ProjectileID.Sets.MinionTargettingFeature[projectile.type] = false; + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 120; + projectile.netImportant = true; + projectile.friendly = true; + projectile.hostile = true; + projectile.ignoreWater = true; + projectile.minionSlots = 0f; + projectile.timeLeft = 90000; + projectile.penetrate = -1; + projectile.Opacity = 0f; + projectile.tileCollide = false; + projectile.minion = true; + } + + public override void AI() => CataclysmSummon.Behavior(projectile, Main.player[projectile.owner], ref Time); + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityUtils.DrawAfterimagesCentered(projectile, ProjectileID.Sets.TrailingMode[projectile.type], Color.Red, 1); + return true; + } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) => damage = 70; + + public override bool CanDamage() => projectile.Opacity >= 1f; + } +} diff --git a/UI/CalamitasEnchantments/CalamitasEnchantUI.cs b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs index 47f77b4606..2be7d5e39d 100644 --- a/UI/CalamitasEnchantments/CalamitasEnchantUI.cs +++ b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs @@ -162,6 +162,11 @@ namespace CalamityMod.UI.CalamitasEnchants return 0; int cost = CurrentlyHeldItem.value * 4; + + // Increase the cost of enchanting significantly if doing so would upgrade the item directly. + if (SelectedEnchantment.HasValue && SelectedEnchantment.Value.Name == "Curse") + cost = (int)MathHelper.Min(cost, Item.buyPrice(5)) * 5; + ItemSlot.DrawMoney(spriteBatch, "Cost: ", costDrawPositionTopLeft.X, costDrawPositionTopLeft.Y, Utils.CoinsSplit(cost)); return cost; @@ -234,6 +239,9 @@ namespace CalamityMod.UI.CalamitasEnchants itemScale *= inventoryScale * baseScale; drawPosition += Vector2.One * 23f * baseScale; + if (EnchantmentManager.ItemUpgradeRelationship.ContainsKey(CurrentlyHeldItem.type)) + drawPosition -= Vector2.One * 12f; + // Draw the item. if (hasMultipleFrames || ItemLoader.PreDrawInInventory(CurrentlyHeldItem, spriteBatch, drawPosition, itemFrame, CurrentlyHeldItem.GetAlpha(Color.White), CurrentlyHeldItem.GetColor(Color.White), itemTexture.Size() * 0.5f, itemScale)) { @@ -326,22 +334,30 @@ namespace CalamityMod.UI.CalamitasEnchants if (CurrentlyHeldItem.IsAir) return; - // If there is no cost or the player cannot afford it, do nothing. - if (cost <= 0L || !Main.LocalPlayer.CanBuyItem(cost)) - return; - // If no enchantment has been selected, do nothing. if (!SelectedEnchantment.HasValue) return; + // If there is no cost or the player cannot afford it, do nothing. + if (cost <= 0 || !Main.LocalPlayer.CanBuyItem(cost)) + return; + Item originalItem = CurrentlyHeldItem.Clone(); byte oldPrefix = CurrentlyHeldItem.prefix; CurrentlyHeldItem.SetDefaults(CurrentlyHeldItem.type); CurrentlyHeldItem.Prefix(oldPrefix); CurrentlyHeldItem = CurrentlyHeldItem.CloneWithModdedDataFrom(originalItem); - CurrentlyHeldItem.Calamity().AppliedEnchantment = SelectedEnchantment.Value; - SelectedEnchantment.Value.CreationEffect?.Invoke(CurrentlyHeldItem); + if (SelectedEnchantment.Value.Name == "Curse") + { + CurrentlyHeldItem.SetDefaults(EnchantmentManager.ItemUpgradeRelationship[CurrentlyHeldItem.type]); + CurrentlyHeldItem.Prefix(oldPrefix); + } + else + { + CurrentlyHeldItem.Calamity().AppliedEnchantment = SelectedEnchantment.Value; + SelectedEnchantment.Value.CreationEffect?.Invoke(CurrentlyHeldItem); + } // Update the compare item. This is used check comparisons when showing reforge tooltip bonuses. // Updating it with the same bonuses as what was applied to the real item will negate the incorrect numbers, @@ -349,8 +365,12 @@ namespace CalamityMod.UI.CalamitasEnchants if (Main.cpItem is null) Main.cpItem = new Item(); Main.cpItem.SetDefaults(Main.cpItem.type); - Main.cpItem.Calamity().AppliedEnchantment = SelectedEnchantment.Value; - SelectedEnchantment.Value.CreationEffect?.Invoke(Main.cpItem); + + if (SelectedEnchantment.Value.Name != "Curse") + { + Main.cpItem.Calamity().AppliedEnchantment = SelectedEnchantment.Value; + SelectedEnchantment.Value.CreationEffect?.Invoke(Main.cpItem); + } // Take away the money for the cost. Main.LocalPlayer.BuyItem(cost); @@ -359,6 +379,9 @@ namespace CalamityMod.UI.CalamitasEnchants EnchantIndex = 0; Main.PlaySound(SoundID.DD2_BetsyFlameBreath, Main.LocalPlayer.Center); + + if (SelectedEnchantment.Value.Name == "Curse") + Main.PlaySound(SoundID.DD2_DarkMageHealImpact, Main.LocalPlayer.Center); } } } diff --git a/UI/CalamitasEnchantments/EnchantmentManager.cs b/UI/CalamitasEnchantments/EnchantmentManager.cs index 73fd142398..f86efb6f3e 100644 --- a/UI/CalamitasEnchantments/EnchantmentManager.cs +++ b/UI/CalamitasEnchantments/EnchantmentManager.cs @@ -1,3 +1,4 @@ +using CalamityMod.Items.Weapons.Summon; using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; using System; @@ -13,6 +14,7 @@ namespace CalamityMod.UI.CalamitasEnchants { internal const int ClearEnchantmentID = -18591774; public static List EnchantmentList { get; internal set; } = new List(); + public static Dictionary ItemUpgradeRelationship { get; internal set; } = new Dictionary(); public static Enchantment ClearEnchantment { get; internal set; } public static IEnumerable GetValidEnchantmentsForItem(Item item) { @@ -20,6 +22,10 @@ namespace CalamityMod.UI.CalamitasEnchants if (item is null || item.IsAir || !item.CanBeEnchantedBySomething()) yield break; + // Don't allow any enchantments if the item is an upgrade item. + if (ItemUpgradeRelationship.ContainsValue(item.type)) + yield break; + // Only give the option to clear if the item already has an enchantment. if (item.Calamity().AppliedEnchantment.HasValue) { @@ -127,6 +133,12 @@ namespace CalamityMod.UI.CalamitasEnchants { EnchantmentList = new List { + new Enchantment("Curse", "Transforms this item into something significantly better.", + 1, + null, + null, + item => ItemUpgradeRelationship.ContainsKey(item.type)), + new Enchantment("Cursed", "Summons demons that harm you but drop healing items on death on item usage.", 100, null, @@ -194,11 +206,11 @@ namespace CalamityMod.UI.CalamitasEnchants { // Yes, this is a LOT of damage but given the limited range of this thing it needs to be extremely powerful when it does actually hit. int damage = (int)(player.ActiveItem().damage * player.MeleeDamage() * 5); - int blade = Projectile.NewProjectile(player.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, player.whoAmI, 1, player.ActiveItem().type); + int blade = Projectile.NewProjectile(player.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, player.whoAmI, 0f, player.ActiveItem().type); if (Main.projectile.IndexInRange(blade)) Main.projectile[blade].localAI[0] = 0f; - blade = Projectile.NewProjectile(player.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, player.whoAmI, -1, player.ActiveItem().type); + blade = Projectile.NewProjectile(player.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, player.whoAmI, 1f, player.ActiveItem().type); if (Main.projectile.IndexInRange(blade)) Main.projectile[blade].localAI[0] = -80f; } @@ -216,8 +228,17 @@ namespace CalamityMod.UI.CalamitasEnchants ClearEnchantment = new Enchantment("Disenchant", string.Empty, ClearEnchantmentID, item => item.Calamity().AppliedEnchantment = null, item => item.maxStack == 1 && item.shoot >= ProjectileID.None); + + ItemUpgradeRelationship = new Dictionary() + { + [ModContent.ItemType()] = ModContent.ItemType() + }; } - public static void UnloadAllEnchantments() => EnchantmentList = null; + public static void UnloadAllEnchantments() + { + EnchantmentList = null; + ItemUpgradeRelationship = null; + } } } From 2f1cb9026007217d9ba37b357982155c292fd4a6 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Thu, 20 May 2021 18:09:55 -0500 Subject: [PATCH 106/202] Couple of fixes --- Items/Weapons/Rogue/Sacrifice.cs | 3 +++ Projectiles/Magic/FabBolt.cs | 4 ++-- Projectiles/Melee/PrismTooth.cs | 2 +- Projectiles/Rogue/SacrificeProjectile.cs | 21 +++++++++++++++------ 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/Items/Weapons/Rogue/Sacrifice.cs b/Items/Weapons/Rogue/Sacrifice.cs index 374f48cf1f..505afebffd 100644 --- a/Items/Weapons/Rogue/Sacrifice.cs +++ b/Items/Weapons/Rogue/Sacrifice.cs @@ -1,3 +1,4 @@ +using CalamityMod.NPCs.NormalNPCs; using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; @@ -49,7 +50,9 @@ namespace CalamityMod.Items.Weapons.Rogue if (Main.projectile[i].ai[0] != 1f) continue; + NPC attachedNPC = Main.npc[(int)Main.projectile[i].ai[1]]; Main.projectile[i].ai[0] = 2f; + Main.projectile[i].ModProjectile().AbleToHealOwner = attachedNPC.type != NPCID.TargetDummy && attachedNPC.type != ModContent.NPCType(); Main.projectile[i].netUpdate = true; } return false; diff --git a/Projectiles/Magic/FabBolt.cs b/Projectiles/Magic/FabBolt.cs index 3894c65d7f..633fb3049e 100644 --- a/Projectiles/Magic/FabBolt.cs +++ b/Projectiles/Magic/FabBolt.cs @@ -70,10 +70,10 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { if (TrailDrawer is null) - TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, PrimitiveTrail.SmoothCatmullRomPointRetreivalFunction, GameShaders.Misc["CalamityMod:TrailStreak"]); + TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, PrimitiveTrail.RigidPointRetreivalFunction, GameShaders.Misc["CalamityMod:TrailStreak"]); GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(ModContent.GetTexture("CalamityMod/ExtraTextures/FabstaffStreak")); - TrailDrawer.Draw(projectile.oldPos, projectile.Size * 0.5f - Main.screenPosition, 0, projectile.oldRot); + TrailDrawer.Draw(projectile.oldPos, projectile.Size * 0.5f - Main.screenPosition, 120, projectile.oldRot); return false; } diff --git a/Projectiles/Melee/PrismTooth.cs b/Projectiles/Melee/PrismTooth.cs index 5067e888a6..598cfb71eb 100644 --- a/Projectiles/Melee/PrismTooth.cs +++ b/Projectiles/Melee/PrismTooth.cs @@ -95,7 +95,7 @@ namespace CalamityMod.Projectiles.Melee public override Color? GetAlpha(Color lightColor) => Color.White; - internal float WidthFunction(float completionRatio) => projectile.scale * 24f * (1f - Utils.InverseLerp(0.7f, 1f, completionRatio, true)); + internal float WidthFunction(float completionRatio) => projectile.scale * 24f * (1f - Utils.InverseLerp(0.7f, 1f, completionRatio, true)) + 1f; internal Color ColorFunction(float completionRatio) { diff --git a/Projectiles/Rogue/SacrificeProjectile.cs b/Projectiles/Rogue/SacrificeProjectile.cs index 627fa81fca..0a7e2c12cf 100644 --- a/Projectiles/Rogue/SacrificeProjectile.cs +++ b/Projectiles/Rogue/SacrificeProjectile.cs @@ -1,6 +1,6 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; +using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -12,6 +12,7 @@ namespace CalamityMod.Projectiles.Rogue public Player Owner => Main.player[projectile.owner]; public bool StickingToAnything => projectile.ai[0] == 1f; public bool ReturningToOwner => projectile.ai[0] == 2f; + public bool AbleToHealOwner = true; public override string Texture => "CalamityMod/Items/Weapons/Rogue/Sacrifice"; public override void SetStaticDefaults() { @@ -32,6 +33,11 @@ namespace CalamityMod.Projectiles.Rogue projectile.localNPCHitCooldown = 6; } + public override void SendExtraAI(BinaryWriter writer) => writer.Write(AbleToHealOwner); + + public override void ReceiveExtraAI(BinaryReader reader) => AbleToHealOwner = reader.ReadBoolean(); + + public override void AI() { if (ReturningToOwner) @@ -43,12 +49,15 @@ namespace CalamityMod.Projectiles.Rogue // Heal the player and disappear when touching them. if (projectile.Hitbox.Intersects(Owner.Hitbox)) { - int healAmount = projectile.Calamity().stealthStrike ? 50 : 4; + if (!Owner.moonLeech && AbleToHealOwner) + { + int healAmount = projectile.Calamity().stealthStrike ? 50 : 4; - Owner.HealEffect(healAmount); - Owner.statLife += healAmount; - if (Owner.statLife > Owner.statLifeMax2) - Owner.statLife = Owner.statLifeMax2; + Owner.HealEffect(healAmount); + Owner.statLife += healAmount; + if (Owner.statLife > Owner.statLifeMax2) + Owner.statLife = Owner.statLifeMax2; + } projectile.Kill(); } From 48645809e2a307274f4e7bfd832ac2aea8283609 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Thu, 20 May 2021 19:08:16 -0500 Subject: [PATCH 107/202] Particle fixes --- CalPlayer/CalamityPlayerMiscEffects.cs | 5 +++++ Items/CalamityGlobalItem.cs | 13 +++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index a809f3e11f..19127d619a 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -112,6 +112,11 @@ namespace CalamityMod.CalPlayer // Potions (Quick Buff && Potion Sickness) HandlePotions(player, modPlayer); + // Update all particle sets for items. + // This must be done here instead of in the item logic because these sets are not properly instanced + // in the global classes. Attempting to update them there will cause multiple updates to one set for multiple items. + CalamityGlobalItem.UpdateAllParticleSets(); + // Regularly sync player stats during multiplayer if (player.whoAmI == Main.myPlayer && Main.netMode == NetmodeID.MultiplayerClient) { diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 13a0015304..a7904cc87d 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -87,7 +87,6 @@ namespace CalamityMod.Items public CalamityGlobalItem() { StealthGenBonus = 1f; - EnchantmentEnergyParticles = new ChargingEnergyParticleSet(-1, 2, Color.DarkViolet, Color.White, 0.04f, 24f); } public override GlobalItem Clone(Item item, Item itemClone) @@ -1692,14 +1691,19 @@ namespace CalamityMod.Items #endregion #region Inventory Drawing - internal ChargingEnergyParticleSet EnchantmentEnergyParticles; + internal static ChargingEnergyParticleSet EnchantmentEnergyParticles = new ChargingEnergyParticleSet(-1, 2, Color.DarkViolet, Color.White, 0.04f, 24f); + + internal static void UpdateAllParticleSets() + { + EnchantmentEnergyParticles.Update(); + } public override bool PreDrawInInventory(Item item, SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale) { void drawItemManually(Color color, float generalScale) { Texture2D itemTexture = Main.itemTexture[item.type]; - Rectangle itemFrame = (Main.itemAnimations[item.type] == null) ? itemTexture.Frame(1, 1, 0, 0) : Main.itemAnimations[item.type].GetFrame(itemTexture); + Rectangle itemFrame = (Main.itemAnimations[item.type] == null) ? itemTexture.Frame() : Main.itemAnimations[item.type].GetFrame(itemTexture); Vector2 itemOrigin = itemFrame.Size() * 0.5f; spriteBatch.Draw(itemTexture, position, itemFrame, color, 0f, itemOrigin, scale * generalScale, SpriteEffects.None, 0f); } @@ -1707,9 +1711,6 @@ namespace CalamityMod.Items if (!EnchantmentManager.ItemUpgradeRelationship.ContainsKey(item.type) || !Main.LocalPlayer.InventoryHas(ModContent.ItemType())) return true; - // Create particle positions as necessary. - EnchantmentEnergyParticles.Update(); - // Draw all particles. float currentPower = 0f; int calamitasNPCIndex = NPC.FindFirstNPC(ModContent.NPCType()); From b700d75c11bf2fa4730905d1cae1b09c7042b148 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 26 May 2021 13:46:26 -0500 Subject: [PATCH 108/202] Exhume upgrade enchant name --- UI/CalamitasEnchantments/CalamitasEnchantUI.cs | 8 ++++---- UI/CalamitasEnchantments/EnchantmentManager.cs | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/UI/CalamitasEnchantments/CalamitasEnchantUI.cs b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs index 2be7d5e39d..b3570e3ad6 100644 --- a/UI/CalamitasEnchantments/CalamitasEnchantUI.cs +++ b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs @@ -164,7 +164,7 @@ namespace CalamityMod.UI.CalamitasEnchants int cost = CurrentlyHeldItem.value * 4; // Increase the cost of enchanting significantly if doing so would upgrade the item directly. - if (SelectedEnchantment.HasValue && SelectedEnchantment.Value.Name == "Curse") + if (SelectedEnchantment.HasValue && SelectedEnchantment.Value.Name == EnchantmentManager.UpgradeEnchantName) cost = (int)MathHelper.Min(cost, Item.buyPrice(5)) * 5; ItemSlot.DrawMoney(spriteBatch, "Cost: ", costDrawPositionTopLeft.X, costDrawPositionTopLeft.Y, Utils.CoinsSplit(cost)); @@ -348,7 +348,7 @@ namespace CalamityMod.UI.CalamitasEnchants CurrentlyHeldItem.Prefix(oldPrefix); CurrentlyHeldItem = CurrentlyHeldItem.CloneWithModdedDataFrom(originalItem); - if (SelectedEnchantment.Value.Name == "Curse") + if (SelectedEnchantment.Value.Name == EnchantmentManager.UpgradeEnchantName) { CurrentlyHeldItem.SetDefaults(EnchantmentManager.ItemUpgradeRelationship[CurrentlyHeldItem.type]); CurrentlyHeldItem.Prefix(oldPrefix); @@ -366,7 +366,7 @@ namespace CalamityMod.UI.CalamitasEnchants Main.cpItem = new Item(); Main.cpItem.SetDefaults(Main.cpItem.type); - if (SelectedEnchantment.Value.Name != "Curse") + if (SelectedEnchantment.Value.Name != EnchantmentManager.UpgradeEnchantName) { Main.cpItem.Calamity().AppliedEnchantment = SelectedEnchantment.Value; SelectedEnchantment.Value.CreationEffect?.Invoke(Main.cpItem); @@ -380,7 +380,7 @@ namespace CalamityMod.UI.CalamitasEnchants Main.PlaySound(SoundID.DD2_BetsyFlameBreath, Main.LocalPlayer.Center); - if (SelectedEnchantment.Value.Name == "Curse") + if (SelectedEnchantment.Value.Name == EnchantmentManager.UpgradeEnchantName) Main.PlaySound(SoundID.DD2_DarkMageHealImpact, Main.LocalPlayer.Center); } } diff --git a/UI/CalamitasEnchantments/EnchantmentManager.cs b/UI/CalamitasEnchantments/EnchantmentManager.cs index f86efb6f3e..893b3f232b 100644 --- a/UI/CalamitasEnchantments/EnchantmentManager.cs +++ b/UI/CalamitasEnchantments/EnchantmentManager.cs @@ -13,6 +13,7 @@ namespace CalamityMod.UI.CalamitasEnchants public static class EnchantmentManager { internal const int ClearEnchantmentID = -18591774; + internal const string UpgradeEnchantName = "Exhume"; public static List EnchantmentList { get; internal set; } = new List(); public static Dictionary ItemUpgradeRelationship { get; internal set; } = new Dictionary(); public static Enchantment ClearEnchantment { get; internal set; } @@ -133,7 +134,7 @@ namespace CalamityMod.UI.CalamitasEnchants { EnchantmentList = new List { - new Enchantment("Curse", "Transforms this item into something significantly better.", + new Enchantment(UpgradeEnchantName, "Transforms this item into something significantly better.", 1, null, null, From 9d95c596bb4a063a279a90e4dd8721ea6d5ce524 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 26 May 2021 13:47:35 -0500 Subject: [PATCH 109/202] Enchanted item rarity effect --- Items/CalamityGlobalItem.cs | 3 -- Items/CalamityGlobalItemTooltip.cs | 35 +++++++++++++++++++ .../EnchantmentManager.cs | 4 +-- Utilities/ItemUtils.cs | 22 ++++++++++++ 4 files changed, 59 insertions(+), 5 deletions(-) diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index a7904cc87d..4a8751cb07 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -4,7 +4,6 @@ using CalamityMod.CalPlayer; using CalamityMod.Events; using CalamityMod.Items.Accessories; using CalamityMod.Items.Potions; -using CalamityMod.Items.SummonItems; using CalamityMod.Items.Weapons.Summon; using CalamityMod.NPCs.Other; using CalamityMod.NPCs.SupremeCalamitas; @@ -22,13 +21,11 @@ using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; -using System.Collections.Generic; using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.ModLoader.IO; -using Terraria.UI; namespace CalamityMod.Items { diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index ba2fb23903..b888524432 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -10,6 +10,7 @@ using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Items.Weapons.Summon; using CalamityMod.World; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using System; using System.Collections.Generic; using System.Linq; @@ -17,6 +18,7 @@ using System.Text; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using Terraria.UI.Chat; namespace CalamityMod.Items { @@ -964,6 +966,39 @@ namespace CalamityMod.Items } #endregion + #region Enchanted Rarity Text Drawing + public override bool PreDrawTooltipLine(Item item, DrawableTooltipLine line, ref int yOffset) + { + // Special enchantment line color. + if (line.Name == "ItemName" && line.mod == "Terraria" && item.IsEnchanted()) + { + Color rarityColor = line.color; + Vector2 basePosition = new Vector2(line.X, line.Y); + + float backInterpolant = (float)Math.Pow(Main.GlobalTime * 0.81f % 1f, 1.5f); + Vector2 backScale = line.baseScale * MathHelper.Lerp(1f, 1.2f, backInterpolant); + Color backColor = Color.Lerp(rarityColor, Color.DarkRed, backInterpolant) * (float)Math.Pow(1f - backInterpolant, 0.46f); + Vector2 backPosition = basePosition - new Vector2(1f, 0.1f) * backInterpolant * 10f; + + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive); + + // Draw the back text as an ominous pulse. + for (int i = 0; i < 2; i++) + ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, line.font, line.text, backPosition, backColor, line.rotation, line.origin, backScale, line.maxWidth, line.spread); + + Main.spriteBatch.End(); + Main.spriteBatch.Begin(); + + // Draw the front text as usual. + ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, line.font, line.text, basePosition, rarityColor, line.rotation, line.origin, line.baseScale, line.maxWidth, line.spread); + + return false; + } + return true; + } + #endregion + #region Fargo Biome Fountain Tooltip private void FargoFountainTooltip(Item item, IList tooltips) { diff --git a/UI/CalamitasEnchantments/EnchantmentManager.cs b/UI/CalamitasEnchantments/EnchantmentManager.cs index 893b3f232b..714ed29ee6 100644 --- a/UI/CalamitasEnchantments/EnchantmentManager.cs +++ b/UI/CalamitasEnchantments/EnchantmentManager.cs @@ -130,7 +130,7 @@ namespace CalamityMod.UI.CalamitasEnchants EnchantmentList.Add(new Enchantment(name, description, id, creationEffect, holdEffect, requirement)); } - public static void LoadAllEnchantments() + internal static void LoadAllEnchantments() { EnchantmentList = new List { @@ -236,7 +236,7 @@ namespace CalamityMod.UI.CalamitasEnchants }; } - public static void UnloadAllEnchantments() + internal static void UnloadAllEnchantments() { EnchantmentList = null; ItemUpgradeRelationship = null; diff --git a/Utilities/ItemUtils.cs b/Utilities/ItemUtils.cs index 7cee8821f8..ad29b36b7f 100644 --- a/Utilities/ItemUtils.cs +++ b/Utilities/ItemUtils.cs @@ -198,6 +198,28 @@ namespace CalamityMod return moved; } + /// + /// Determines if a given item is enchanted based on Calamitas' special system. + /// + /// The item to check. + public static bool IsEnchanted(this Item item) + { + // If the item is air just immediately return false. + // It will not have a CalamityGlobalItem instance to use and attempting to do anything with it + // would just result in errors. + if (item.IsAir) + return false; + + // If the item is contained in the enchant upgrade result relationship, return true. + if (EnchantmentManager.ItemUpgradeRelationship.ContainsValue(item.type)) + return true; + + if (item.Calamity().AppliedEnchantment.HasValue) + return true; + + return false; + } + public static Rectangle FixSwingHitbox(float hitboxWidth, float hitboxHeight) { Player player = Main.player[Main.myPlayer]; From 7ab93103f4370bbb01bf8b95847bf827ee59a14b Mon Sep 17 00:00:00 2001 From: Dominic Date: Thu, 27 May 2021 19:52:25 -0500 Subject: [PATCH 110/202] Renamed the vigil upgrade to Exhumed Vigilance --- Items/CalamityGlobalItemTooltip.cs | 2 +- .../Summon/{Something.cs => ExhumedVigilance.cs} | 4 ++-- .../Summon/{Something.png => ExhumedVigilance.png} | Bin UI/CalamitasEnchantments/EnchantmentManager.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) rename Items/Weapons/Summon/{Something.cs => ExhumedVigilance.cs} (94%) rename Items/Weapons/Summon/{Something.png => ExhumedVigilance.png} (100%) diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index b888524432..eefdbc317a 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -972,7 +972,7 @@ namespace CalamityMod.Items // Special enchantment line color. if (line.Name == "ItemName" && line.mod == "Terraria" && item.IsEnchanted()) { - Color rarityColor = line.color; + Color rarityColor = line.overrideColor ?? line.color; Vector2 basePosition = new Vector2(line.X, line.Y); float backInterpolant = (float)Math.Pow(Main.GlobalTime * 0.81f % 1f, 1.5f); diff --git a/Items/Weapons/Summon/Something.cs b/Items/Weapons/Summon/ExhumedVigilance.cs similarity index 94% rename from Items/Weapons/Summon/Something.cs rename to Items/Weapons/Summon/ExhumedVigilance.cs index 7accc71ebf..107d5e99a8 100644 --- a/Items/Weapons/Summon/Something.cs +++ b/Items/Weapons/Summon/ExhumedVigilance.cs @@ -6,11 +6,11 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Summon { - public class Something : ModItem + public class ExhumedVigilance : ModItem { public override void SetStaticDefaults() { - DisplayName.SetDefault("Something"); + DisplayName.SetDefault("Exhumed Vigilance"); Tooltip.SetDefault("Summons either Cataclysm or Catastrophe at the mouse position\n" + "They will look at you for a moment before charging at you\n" + "They can do damage to both you and enemies"); diff --git a/Items/Weapons/Summon/Something.png b/Items/Weapons/Summon/ExhumedVigilance.png similarity index 100% rename from Items/Weapons/Summon/Something.png rename to Items/Weapons/Summon/ExhumedVigilance.png diff --git a/UI/CalamitasEnchantments/EnchantmentManager.cs b/UI/CalamitasEnchantments/EnchantmentManager.cs index 714ed29ee6..06f8eb821a 100644 --- a/UI/CalamitasEnchantments/EnchantmentManager.cs +++ b/UI/CalamitasEnchantments/EnchantmentManager.cs @@ -232,7 +232,7 @@ namespace CalamityMod.UI.CalamitasEnchants ItemUpgradeRelationship = new Dictionary() { - [ModContent.ItemType()] = ModContent.ItemType() + [ModContent.ItemType()] = ModContent.ItemType() }; } From 3b8691c6a2e1a784d4bd13c733444064cb5eb121 Mon Sep 17 00:00:00 2001 From: Dominic Date: Mon, 31 May 2021 14:41:53 -0500 Subject: [PATCH 111/202] Tainted blade enchant bug fix --- Projectiles/Melee/TaintedBladeSlasher.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projectiles/Melee/TaintedBladeSlasher.cs b/Projectiles/Melee/TaintedBladeSlasher.cs index 5634fdf373..45f392914a 100644 --- a/Projectiles/Melee/TaintedBladeSlasher.cs +++ b/Projectiles/Melee/TaintedBladeSlasher.cs @@ -117,7 +117,7 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { CalamityPlayerMiscEffects.EnchantHeldItemEffects(Owner, Owner.Calamity(), Owner.ActiveItem()); - if (!Owner.Calamity().bladeArmEnchant || Owner.CCed || !Owner.active || Owner.dead) + if (!Owner.Calamity().bladeArmEnchant || Owner.ActiveItem().type != SwordItemID || Owner.CCed || !Owner.active || Owner.dead) { projectile.Kill(); return; From d9b016fb05dc7b73f61e0238578cdc322ba5adc9 Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 4 Jun 2021 22:14:15 -0500 Subject: [PATCH 112/202] Interactions with BR/The new fight --- NPCs/SupremeCalamitas/SupremeCalamitas.cs | 195 ++++++++++++++-------- 1 file changed, 129 insertions(+), 66 deletions(-) diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index a34f9404cc..1729faee74 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -12,6 +12,7 @@ using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Items.Weapons.Summon; +using CalamityMod.NPCs.TownNPCs; using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -203,7 +204,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas public override void BossHeadSlot(ref int index) { bool inPhase2 = npc.ai[0] == 3f; - if (!CalamityWorld.downedSCal) + if (!CalamityWorld.downedSCal || BossRushEvent.BossRushActive) index = inPhase2 ? hoodedHeadIconP2Index : hoodedHeadIconIndex; else index = inPhase2 ? hoodlessHeadIconP2Index : hoodlessHeadIconIndex; @@ -375,10 +376,13 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (!startText) { - string key = "Mods.CalamityMod.SCalSummonText"; - if (CalamityWorld.downedSCal) - key += "Rematch"; - CalamityUtils.DisplayLocalizedText(key, textColor); + if (!BossRushEvent.BossRushActive) + { + string key = "Mods.CalamityMod.SCalSummonText"; + if (CalamityWorld.downedSCal) + key += "Rematch"; + CalamityUtils.DisplayLocalizedText(key, textColor); + } startText = true; } #endregion @@ -562,7 +566,11 @@ namespace CalamityMod.NPCs.SupremeCalamitas forcefieldOpacity = Utils.InverseLerp(0.1f, 0.6f, npc.Opacity, true); if (npc.alpha >= 230) { - // TODO: Spawn the town NPC variant of SCal here when it's on the public branch. + if (Main.netMode != NetmodeID.MultiplayerClient && !BossRushEvent.BossRushActive && CalamityWorld.downedSCal) + { + Dust.QuickDustLine(npc.Center, initialRitualPosition, 350f, Color.Red); + NPC.NewNPC((int)initialRitualPosition.X, (int)initialRitualPosition.Y + 12, ModContent.NPCType()); + } npc.active = false; npc.netUpdate = true; } @@ -749,10 +757,13 @@ namespace CalamityMod.NPCs.SupremeCalamitas } if (!startSecondAttack && (npc.life <= npc.lifeMax * 0.75)) { - string key = "Mods.CalamityMod.SCalBH2Text"; - if (CalamityWorld.downedSCal) - key += "Rematch"; - CalamityUtils.DisplayLocalizedText(key, textColor); + if (!BossRushEvent.BossRushActive) + { + string key = "Mods.CalamityMod.SCalBH2Text"; + if (CalamityWorld.downedSCal) + key += "Rematch"; + CalamityUtils.DisplayLocalizedText(key, textColor); + } startSecondAttack = true; return; } @@ -809,12 +820,16 @@ namespace CalamityMod.NPCs.SupremeCalamitas { // Switch from the Grief section of Stained, Brutal Calamity to the Lament section. music = CalamityMod.Instance.GetMusicFromMusicMod("SCL") ?? MusicID.Boss3; - string key = "Mods.CalamityMod.SCalBH3Text"; - if (CalamityWorld.downedSCal) - key += "Rematch"; - CalamityUtils.DisplayLocalizedText(key, textColor); - if (CalamityWorld.downedSCal) - CalamityUtils.DisplayLocalizedText(key + "2", textColor); + + if (!BossRushEvent.BossRushActive) + { + string key = "Mods.CalamityMod.SCalBH3Text"; + if (CalamityWorld.downedSCal) + key += "Rematch"; + CalamityUtils.DisplayLocalizedText(key, textColor); + if (CalamityWorld.downedSCal) + CalamityUtils.DisplayLocalizedText(key + "2", textColor); + } startThirdAttack = true; return; } @@ -880,10 +895,14 @@ namespace CalamityMod.NPCs.SupremeCalamitas { // Switch from the Lament section of Stained, Brutal Calamity to the Epiphany section. music = CalamityMod.Instance.GetMusicFromMusicMod("SCE") ?? MusicID.LunarBoss; - string key = "Mods.CalamityMod.SCalBH4Text"; - if (CalamityWorld.downedSCal) - key += "Rematch"; - CalamityUtils.DisplayLocalizedText(key, textColor); + + if (!BossRushEvent.BossRushActive) + { + string key = "Mods.CalamityMod.SCalBH4Text"; + if (CalamityWorld.downedSCal) + key += "Rematch"; + CalamityUtils.DisplayLocalizedText(key, textColor); + } startFourthAttack = true; return; } @@ -947,10 +966,13 @@ namespace CalamityMod.NPCs.SupremeCalamitas } if (!startFifthAttack && (npc.life <= npc.lifeMax * 0.1)) { - string key = "Mods.CalamityMod.SCalBH5Text"; - if (CalamityWorld.downedSCal) - key += "Rematch"; - CalamityUtils.DisplayLocalizedText(key, textColor); + if (!BossRushEvent.BossRushActive) + { + string key = "Mods.CalamityMod.SCalBH5Text"; + if (CalamityWorld.downedSCal) + key += "Rematch"; + CalamityUtils.DisplayLocalizedText(key, textColor); + } startFifthAttack = true; return; } @@ -972,9 +994,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (!canDespawn) npc.velocity.X *= 0.96f; - if (CalamityWorld.downedSCal) + if (CalamityWorld.downedSCal && !BossRushEvent.BossRushActive) { - // TODO: Spawn the town NPC variant of SCal again here. if (giveUpCounter == 720) { for (int i = 0; i < 24; i++) @@ -992,14 +1013,21 @@ namespace CalamityMod.NPCs.SupremeCalamitas NPCLoot(); } } - else if (giveUpCounter == 900) + else if (giveUpCounter == 900 && !BossRushEvent.BossRushActive) CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.SCalAcceptanceText1", textColor); - else if(giveUpCounter == 600) + else if (giveUpCounter == 600 && !BossRushEvent.BossRushActive) CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.SCalAcceptanceText2", textColor); - else if(giveUpCounter == 300) + else if (giveUpCounter == 300 && !BossRushEvent.BossRushActive) CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.SCalAcceptanceText3", textColor); if (giveUpCounter <= 0) { + if (BossRushEvent.BossRushActive) + { + npc.chaseable = true; + npc.dontTakeDamage = false; + return; + } + for (int i = 0; i < 24; i++) { Dust brimstoneFire = Dust.NewDustPerfect(npc.Center + Main.rand.NextVector2Square(-24f, 24f), DustID.Fire); @@ -1016,6 +1044,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas return; } giveUpCounter--; + npc.chaseable = false; npc.dontTakeDamage = true; return; @@ -1032,37 +1061,49 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } - string key = "Mods.CalamityMod.SCalDesparationText4"; - if (CalamityWorld.downedSCal) - key += "Rematch"; - CalamityUtils.DisplayLocalizedText(key, textColor); + if (!BossRushEvent.BossRushActive) + { + string key = "Mods.CalamityMod.SCalDesparationText4"; + if (CalamityWorld.downedSCal) + key += "Rematch"; + CalamityUtils.DisplayLocalizedText(key, textColor); + } gettingTired5 = true; return; } else if (!gettingTired4 && (npc.life <= npc.lifeMax * 0.02)) { - string key = "Mods.CalamityMod.SCalDesparationText3"; - if (CalamityWorld.downedSCal) - key += "Rematch"; - CalamityUtils.DisplayLocalizedText(key, textColor); + if (!BossRushEvent.BossRushActive) + { + string key = "Mods.CalamityMod.SCalDesparationText3"; + if (CalamityWorld.downedSCal) + key += "Rematch"; + CalamityUtils.DisplayLocalizedText(key, textColor); + } gettingTired4 = true; return; } else if (!gettingTired3 && (npc.life <= npc.lifeMax * 0.04)) { - string key = "Mods.CalamityMod.SCalDesparationText2"; - if (CalamityWorld.downedSCal) - key += "Rematch"; - CalamityUtils.DisplayLocalizedText(key, textColor); + if (!BossRushEvent.BossRushActive) + { + string key = "Mods.CalamityMod.SCalDesparationText2"; + if (CalamityWorld.downedSCal) + key += "Rematch"; + CalamityUtils.DisplayLocalizedText(key, textColor); + } gettingTired3 = true; return; } else if (!gettingTired2 && (npc.life <= npc.lifeMax * 0.06)) { - string key = "Mods.CalamityMod.SCalDesparationText1"; - if (CalamityWorld.downedSCal) - key += "Rematch"; - CalamityUtils.DisplayLocalizedText(key, textColor); + if (!BossRushEvent.BossRushActive) + { + string key = "Mods.CalamityMod.SCalDesparationText1"; + if (CalamityWorld.downedSCal) + key += "Rematch"; + CalamityUtils.DisplayLocalizedText(key, textColor); + } gettingTired2 = true; return; } @@ -1125,10 +1166,13 @@ namespace CalamityMod.NPCs.SupremeCalamitas #region TransformSeekerandBrotherTriggers if (!halfLife && (npc.life <= npc.lifeMax * 0.4)) { - string key = "Mods.CalamityMod.SCalPhase2Text"; - if (CalamityWorld.downedSCal) - key += "Rematch"; - CalamityUtils.DisplayLocalizedText(key, textColor); + if (!BossRushEvent.BossRushActive) + { + string key = "Mods.CalamityMod.SCalPhase2Text"; + if (CalamityWorld.downedSCal) + key += "Rematch"; + CalamityUtils.DisplayLocalizedText(key, textColor); + } halfLife = true; } @@ -1137,10 +1181,13 @@ namespace CalamityMod.NPCs.SupremeCalamitas { if (!secondStage) { - string key = "Mods.CalamityMod.SCalSeekerRingText"; - if (CalamityWorld.downedSCal) - key += "Rematch"; - CalamityUtils.DisplayLocalizedText(key, textColor); + if (!BossRushEvent.BossRushActive) + { + string key = "Mods.CalamityMod.SCalSeekerRingText"; + if (CalamityWorld.downedSCal) + key += "Rematch"; + CalamityUtils.DisplayLocalizedText(key, textColor); + } if (Main.netMode != NetmodeID.MultiplayerClient) { Main.PlaySound(SoundID.Item74, npc.position); @@ -2460,13 +2507,17 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (attackCastDelay == 0) { - string key = "Mods.CalamityMod.SCalStartText"; - if (npc.life <= npc.lifeMax * 0.08) - key = "Mods.CalamityMod.SCalSepulcher2Text"; + if (!BossRushEvent.BossRushActive) + { + string key = "Mods.CalamityMod.SCalStartText"; + if (npc.life <= npc.lifeMax * 0.08) + key = "Mods.CalamityMod.SCalSepulcher2Text"; + + if (CalamityWorld.downedSCal) + key += "Rematch"; + CalamityUtils.DisplayLocalizedText(key, textColor); + } - if (CalamityWorld.downedSCal) - key += "Rematch"; - CalamityUtils.DisplayLocalizedText(key, textColor); foreach (Vector2 heartSpawnPosition in heartSpawnPositions) { // Make the hearts appear in a burst of flame. @@ -2578,13 +2629,17 @@ namespace CalamityMod.NPCs.SupremeCalamitas // And spawn them. if (attackCastDelay == 0) { - string key = "Mods.CalamityMod.SCalBrothersText"; - if (CalamityWorld.downedSCal) - key += "Rematch"; + if (!BossRushEvent.BossRushActive) + { + string key = "Mods.CalamityMod.SCalBrothersText"; + if (CalamityWorld.downedSCal) + key += "Rematch"; + + CalamityUtils.DisplayLocalizedText(key, textColor); + if (CalamityWorld.downedSCal) + CalamityUtils.DisplayLocalizedText(key + "2", textColor); + } - CalamityUtils.DisplayLocalizedText(key, textColor); - if (CalamityWorld.downedSCal) - CalamityUtils.DisplayLocalizedText(key + "2", textColor); if (Main.netMode != NetmodeID.MultiplayerClient) { CalamityUtils.SpawnBossBetter(catastropheSpawnPosition, ModContent.NPCType()); @@ -2666,10 +2721,16 @@ namespace CalamityMod.NPCs.SupremeCalamitas public override void NPCLoot() { + if (BossRushEvent.BossRushActive) + return; + // Create a teleport line effect Dust.QuickDustLine(npc.Center, initialRitualPosition, 500f, Color.Red); npc.Center = initialRitualPosition; + // Make the town NPC spawn. + NPC.NewNPC((int)initialRitualPosition.X, (int)initialRitualPosition.Y + 12, ModContent.NPCType()); + // Increase the player's SCal kill count if (Main.player[npc.target].Calamity().sCalKillCount < 5) Main.player[npc.target].Calamity().sCalKillCount++; @@ -2730,6 +2791,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas // Prevent the player from accidentally killing SCal instead of having her turn into a town NPC. public override bool CheckDead() { + if (BossRushEvent.BossRushActive) + return true; npc.life = 1; npc.active = true; npc.dontTakeDamage = true; @@ -2798,7 +2861,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (npc.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - Texture2D texture2D15 = CalamityWorld.downedSCal ? Main.npcTexture[npc.type] : ModContent.GetTexture("CalamityMod/NPCs/SupremeCalamitas/SupremeCalamitasHooded"); + Texture2D texture2D15 = CalamityWorld.downedSCal && !BossRushEvent.BossRushActive ? Main.npcTexture[npc.type] : ModContent.GetTexture("CalamityMod/NPCs/SupremeCalamitas/SupremeCalamitasHooded"); Vector2 vector11 = new Vector2(texture2D15.Width / 2f, texture2D15.Height / Main.npcFrameCount[npc.type] / 2f); Color color36 = Color.White; From a4ae4dc85995218ce716202b36fda451bdf59f0b Mon Sep 17 00:00:00 2001 From: Dominic Date: Sun, 6 Jun 2021 09:41:36 -0500 Subject: [PATCH 113/202] Sacrifice Fixes --- Items/Weapons/Rogue/Sacrifice.cs | 2 +- Projectiles/Rogue/SacrificeProjectile.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Items/Weapons/Rogue/Sacrifice.cs b/Items/Weapons/Rogue/Sacrifice.cs index 505afebffd..c3665fa0c6 100644 --- a/Items/Weapons/Rogue/Sacrifice.cs +++ b/Items/Weapons/Rogue/Sacrifice.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Rogue { DisplayName.SetDefault("Sacrifice"); Tooltip.SetDefault("Releases a dagger that sticks to enemies\n" + - "Right clicking causes all stuck daggers to fly back at you and give you life" + + "Right clicking causes all stuck daggers to fly back at you and give you life\n" + "Daggers stuck to enemies release bloodsplosions over time"); } diff --git a/Projectiles/Rogue/SacrificeProjectile.cs b/Projectiles/Rogue/SacrificeProjectile.cs index 0a7e2c12cf..327afc4dff 100644 --- a/Projectiles/Rogue/SacrificeProjectile.cs +++ b/Projectiles/Rogue/SacrificeProjectile.cs @@ -68,7 +68,7 @@ namespace CalamityMod.Projectiles.Rogue { for (int i = 0; i < 60; i++) { - Dust blood = Dust.NewDustPerfect(projectile.Center + Main.rand.NextVector2Circular(50f, 50f), Main.rand.NextBool(2) ? 264 : 5); + Dust blood = Dust.NewDustPerfect(projectile.Center + Main.rand.NextVector2Circular(50f, 50f), 267); blood.velocity = Main.rand.NextVector2Circular(3f, 3f); blood.noGravity = true; blood.color = Color.Lerp(Color.Red, Color.DarkRed, Main.rand.NextFloat(0.25f, 1f)); From 494d10e89f77cb98984fc296892476235d37d650 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sun, 6 Jun 2021 14:02:03 -0500 Subject: [PATCH 114/202] Cal NPC resprite --- NPCs/TownNPCs/WITCH.cs | 9 ++++----- NPCs/TownNPCs/WITCH.png | Bin 4396 -> 5010 bytes NPCs/TownNPCs/WITCH_Head.png | Bin 342 -> 448 bytes 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/NPCs/TownNPCs/WITCH.cs b/NPCs/TownNPCs/WITCH.cs index 161db7bccd..c536d20ba6 100644 --- a/NPCs/TownNPCs/WITCH.cs +++ b/NPCs/TownNPCs/WITCH.cs @@ -21,14 +21,13 @@ namespace CalamityMod.NPCs.TownNPCs { DisplayName.SetDefault("Brimstone Witch"); - Main.npcFrameCount[npc.type] = 26; + Main.npcFrameCount[npc.type] = 27; NPCID.Sets.ExtraFramesCount[npc.type] = 9; NPCID.Sets.AttackFrameCount[npc.type] = 4; NPCID.Sets.DangerDetectRange[npc.type] = 700; - NPCID.Sets.AttackType[npc.type] = 2; - NPCID.Sets.AttackTime[npc.type] = 90; - NPCID.Sets.AttackAverageChance[npc.type] = 15; - NPCID.Sets.MagicAuraColor[npc.type] = new Color(250, 50, 50); + NPCID.Sets.AttackType[npc.type] = 1; + NPCID.Sets.AttackTime[npc.type] = 30; + NPCID.Sets.AttackAverageChance[npc.type] = 5; } public override void SetDefaults() diff --git a/NPCs/TownNPCs/WITCH.png b/NPCs/TownNPCs/WITCH.png index b6d9064a49be7651124bf7c5cd93b16cfdfecaaa..7c02e35630acb55640041e8e134719e5da2fe077 100644 GIT binary patch literal 5010 zcmeHLiBl7I`wt*NgArf33JS4kFyR!+p(p`_2w4upk|0MRf?~rVPze?h40u3G&`4N< zpke}vlE^J;jbc!wNDvJHibW|XqKH_z6bumG#dh9lXWoC{H@|mhGQ0bo+1+QK&+|Dp zKam5x(I{gS0)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ab&^Kk9Koo^Up4U zZhEC_n7&`oKR}b9HA!^@o&`BA?!;Z!oy z(Z%2s*Er3p<*PGC(5cpP{XIB%M}G&C=+jI@h#U|memmDpx$|m|$TzWE+O)Um;P|Z1 z_lDlli(DClmJ8Znb)xp6cX#9-_Z#zIP##~u6fWcq{K*kgq2%Iae%&`B&Tx{e75bm zK5H_oEhb)4$GDisodgyO&74EL-ax+jm%*ORs{Qg=-zILb-1Gae^_F|!E_^zl9#IHy zx@$=m)ARMaIV{|2IugAut5v`B7(VA^17k?HA1^@s6#I$TX00001b5ch_0Itp)=>Px#1ZP1_K>z@;j|==^ z1poj532;bRa{vGi!vFvd!vV){sAK>D0aZyvK~zXfW7JbsWk3dkLPB8r{kwPn!3@#? zBZy!EGid-oF2?FIH*ZfcEh!@lrg4GiPacEmU0b(YSrdO=p z2&Uh?c@3sv;?ri%0n>p2-e4LAZasJorl+@efoYn#7{lO$C(nWL-RsxD`2FkGUbDI$)j7uJ- z1*Q(&2u7M4Jf*D+#nPOrE)@Re?TfH^jKSA44lIuDa=43WW-!b}%O}mo>M|=^OR)H{ z!^gpNWL_$mhN)k+{VS8j4-B|!8ygv zV9PaCRIr9MOc0k(aJrc421j|?f*rGL!yYgl9_9t6SFYNI)#XtEE?{x=u*PsP-3<=E z{s`5ZX!^Jc=7~KM_0gWY0(bb^@II<)x%*izv a0HgKey$=1(0{{R307*qoM6N<$f&c)SYm*`X From 917bf07ac2ccb986980d7378cab12de02770a868 Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 11 Jun 2021 03:51:45 -0500 Subject: [PATCH 115/202] Sacrifice does not have hidden water --- Projectiles/Rogue/SacrificeProjectile.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projectiles/Rogue/SacrificeProjectile.cs b/Projectiles/Rogue/SacrificeProjectile.cs index 327afc4dff..1487b2ab70 100644 --- a/Projectiles/Rogue/SacrificeProjectile.cs +++ b/Projectiles/Rogue/SacrificeProjectile.cs @@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Rogue { for (int i = 0; i < 5; i++) { - int dust = Dust.NewDust(projectile.Center, 1, 1, 33, 0, 0, 0, default, 1.5f); + int dust = Dust.NewDust(projectile.Center, 1, 1, 5, 0, 0, 0, default, 1.5f); Main.dust[dust].noGravity = true; } } From 8f77b49e296be152eb0ca31ec169fa8322f525e4 Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 11 Jun 2021 04:00:50 -0500 Subject: [PATCH 116/202] Condemnation Adjustment --- Projectiles/Ranged/CondemnationHoldout.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Projectiles/Ranged/CondemnationHoldout.cs b/Projectiles/Ranged/CondemnationHoldout.cs index 3ebe3ec429..b8899add01 100644 --- a/Projectiles/Ranged/CondemnationHoldout.cs +++ b/Projectiles/Ranged/CondemnationHoldout.cs @@ -112,6 +112,17 @@ namespace CalamityMod.Projectiles.Ranged public void UpdateProjectileHeldVariables(Vector2 armPosition) { + if (Main.myPlayer == projectile.owner) + { + Vector2 oldVelocity = projectile.velocity; + projectile.velocity = projectile.SafeDirectionTo(Main.MouseWorld); + if (projectile.velocity != oldVelocity) + { + projectile.netSpam = 0; + projectile.netUpdate = true; + } + } + projectile.position = armPosition - projectile.Size * 0.5f; projectile.rotation = projectile.velocity.ToRotation(); if (projectile.spriteDirection == -1) From 4e3cffcd829e4b483264ef511282ffdd1a99536c Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 11 Jun 2021 06:14:57 -0500 Subject: [PATCH 117/202] Photon Ripper fix --- Projectiles/Melee/PhotonRipperProjectile.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Projectiles/Melee/PhotonRipperProjectile.cs b/Projectiles/Melee/PhotonRipperProjectile.cs index 408fb5021c..62588db1aa 100644 --- a/Projectiles/Melee/PhotonRipperProjectile.cs +++ b/Projectiles/Melee/PhotonRipperProjectile.cs @@ -155,7 +155,6 @@ namespace CalamityMod.Projectiles.Melee public void ManipulatePlayerValues() { Owner.itemRotation = (projectile.velocity * projectile.direction).ToRotation(); - Owner.heldProj = projectile.whoAmI; Owner.itemTime = 2; Owner.itemAnimation = 2; Owner.ChangeDir(projectile.direction); From 2d6e01c3f72b6192bdd240b6038c555c732f85f7 Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 11 Jun 2021 14:14:22 -0500 Subject: [PATCH 118/202] Merge conflict handling --- NPCs/SupremeCalamitas/SupremeCalamitas.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index 440c0feb0a..1afb51394b 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -13,6 +13,7 @@ using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Items.Weapons.Summon; +using CalamityMod.NPCs.TownNPCs; using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -567,7 +568,17 @@ namespace CalamityMod.NPCs.SupremeCalamitas forcefieldOpacity = Utils.InverseLerp(0.1f, 0.6f, npc.Opacity, true); if (npc.alpha >= 230) { - // TODO: Spawn the town NPC variant of SCal here when it's on the public branch. + if (CalamityWorld.downedSCal && !BossRushEvent.BossRushActive) + { + // Create a teleport line effect + Dust.QuickDustLine(npc.Center, initialRitualPosition, 500f, Color.Red); + npc.Center = initialRitualPosition; + + // Make the town NPC spawn. + if (Main.netMode != NetmodeID.MultiplayerClient) + NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y + 12, ModContent.NPCType()); + } + npc.active = false; npc.netUpdate = true; } @@ -994,7 +1005,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (CalamityWorld.downedSCal && !BossRushEvent.BossRushActive) { - // TODO: Spawn the town NPC variant of SCal again here. if (giveUpCounter == 720) { for (int i = 0; i < 24; i++) @@ -2722,6 +2732,9 @@ namespace CalamityMod.NPCs.SupremeCalamitas Dust.QuickDustLine(npc.Center, initialRitualPosition, 500f, Color.Red); npc.Center = initialRitualPosition; + // Make the town NPC spawn. + NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y + 12, ModContent.NPCType()); + // Increase the player's SCal kill count if (Main.player[npc.target].Calamity().sCalKillCount < 5) Main.player[npc.target].Calamity().sCalKillCount++; From 44921d57795fb5c854a9df8b20853c2dc3eda2a0 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 12 Jun 2021 03:41:46 -0500 Subject: [PATCH 119/202] Omniblade swing slash --- Items/Weapons/Melee/Omniblade.cs | 25 ++----- Projectiles/Melee/OmnibladeSwing.cs | 102 +++++++++++++++++++++++++++ Projectiles/Melee/OmnibladeSwing.png | Bin 0 -> 6167 bytes 3 files changed, 109 insertions(+), 18 deletions(-) create mode 100644 Projectiles/Melee/OmnibladeSwing.cs create mode 100644 Projectiles/Melee/OmnibladeSwing.png diff --git a/Items/Weapons/Melee/Omniblade.cs b/Items/Weapons/Melee/Omniblade.cs index 77835d62e0..3e9906068f 100644 --- a/Items/Weapons/Melee/Omniblade.cs +++ b/Items/Weapons/Melee/Omniblade.cs @@ -1,6 +1,5 @@ -using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Materials; -using Microsoft.Xna.Framework; +using CalamityMod.Projectiles.Melee; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -29,28 +28,18 @@ namespace CalamityMod.Items.Weapons.Melee item.autoReuse = true; item.height = 146; item.value = Item.buyPrice(0, 80, 0, 0); + item.noMelee = true; + item.noUseGraphic = true; + item.channel = true; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 24f; item.rare = ItemRarityID.Yellow; } // Terraria seems to really dislike high crit values in SetDefaults public override void GetWeaponCrit(Player player, ref int crit) => crit += 45; - public override void UseItemHitbox(Player player, ref Rectangle hitbox, ref bool noHitbox) - { - hitbox = CalamityUtils.FixSwingHitbox(102, 102); - } - - public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) - { - if (Main.rand.NextBool(5)) - target.AddBuff(ModContent.BuffType(), 360); - } - - public override void OnHitPvp(Player player, Player target, int damage, bool crit) - { - if (Main.rand.NextBool(5)) - target.AddBuff(ModContent.BuffType(), 360); - } + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; public override void AddRecipes() { diff --git a/Projectiles/Melee/OmnibladeSwing.cs b/Projectiles/Melee/OmnibladeSwing.cs new file mode 100644 index 0000000000..715455b7c9 --- /dev/null +++ b/Projectiles/Melee/OmnibladeSwing.cs @@ -0,0 +1,102 @@ +using CalamityMod.Buffs.StatDebuffs; +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Melee +{ + public class OmnibladeSwing : ModProjectile + { + public Player Owner => Main.player[projectile.owner]; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Omniblade"); + Main.projFrames[projectile.type] = 6; + } + + public override void SetDefaults() + { + projectile.width = 246; + projectile.height = 184; + projectile.scale = 1.15f; + + projectile.friendly = true; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.melee = true; + projectile.ownerHitCheck = true; + projectile.usesIDStaticNPCImmunity = true; + projectile.idStaticNPCHitCooldown = 3; + projectile.Calamity().trueMelee = true; + } + + public override void AI() + { + projectile.frameCounter++; + projectile.frame = projectile.frameCounter / 3; + if (projectile.frame >= Main.projFrames[projectile.type]) + projectile.Kill(); + + Vector2 playerRotatedPoint = Owner.RotatedRelativePoint(Owner.MountedCenter, true); + if (Main.myPlayer == projectile.owner) + { + if (Owner.channel && !Owner.noItems && !Owner.CCed) + HandleChannelMovement(playerRotatedPoint); + else + projectile.Kill(); + } + + // Rotation and directioning. + projectile.direction = (projectile.velocity.X > 0).ToDirectionInt(); + + // Sprite and player directioning. + projectile.spriteDirection = -projectile.direction; + if (projectile.direction == 1) + projectile.Left = Owner.Center; + else + projectile.Right = Owner.Center; + projectile.position.X += projectile.spriteDirection == -1 ? -116f : 88f; + projectile.position.Y -= projectile.scale * 66f; + Owner.ChangeDir(projectile.direction); + + // Prevents the projectile from dying + projectile.timeLeft = 2; + + // Player item-based field manipulation. + Owner.itemRotation = (projectile.velocity * projectile.direction).ToRotation(); + Owner.heldProj = projectile.whoAmI; + Owner.itemTime = 2; + Owner.itemAnimation = 2; + } + + public void HandleChannelMovement(Vector2 playerRotatedPoint) + { + Vector2 newVelocity = Vector2.UnitX * (Main.MouseWorld.X > playerRotatedPoint.X).ToDirectionInt(); + + // Sync if a velocity component changes. + if (projectile.velocity.X != newVelocity.X || projectile.velocity.Y != newVelocity.Y) + projectile.netUpdate = true; + + projectile.velocity = newVelocity; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (Main.rand.NextBool(5)) + target.AddBuff(ModContent.BuffType(), 360); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + if (Main.rand.NextBool(5)) + target.AddBuff(ModContent.BuffType(), 360); + } + + public override Color? GetAlpha(Color lightColor) => new Color(200, 200, 200, 170); + + // Don't suffer from the same issues Murasama did in the past; encouraging people to kill their wrists for some extra DPS is bad lmao + public override bool CanDamage() => projectile.frameCounter > 6; + } +} diff --git a/Projectiles/Melee/OmnibladeSwing.png b/Projectiles/Melee/OmnibladeSwing.png new file mode 100644 index 0000000000000000000000000000000000000000..bb0103db6841577fa66a79f322baff3d37637f6c GIT binary patch literal 6167 zcmeHLdpJ~U+aFSC7wwgbLD5>3)G*B0qatk@i;!$Yavoz$rGrT9Bpqm#H4e#PZ>P#D zl_Df0hq9bcmE<&uL5j!_rb6E{)%RZS_x<<2e|+C{z3-munt7h*p676{`~Ka(`?=Re zD@zlZpA>&0kw`K-O_|mtk_3}PlJb+D2P6jmsdJ!_@U=EEB4srxzXJm)FT-7iBvMY~ z;u-h(B+@*Rm4&S_kSC^J8~*$ibpHDMWr6=R3)~%K^@BJe`B_`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6+$)E<3iCw}ZzQ1%zvsOKj?@oq`Y2}XM!9M9#}L_iXoU`OMX62G#$Sb6q+PgFYv-396A--25QYV zGGI+_rt82VF;+!wwI+92KtKdNHAAKN%$ezC%n`(i+_UptV$Z*=e{=zoC~X2>K%uX* z^$QPy*=w&;Csw0UOW-(A1)o%av@X5f9`ULg3o#IsMJ$@u{$7hNfM)Y^0KN4BzWJe=li=Zad;i8#TaigQ04}7JAVJyP zQs}q}@Lvoi+TynFJzH*(p?feZCagp!spd@#SbLlRac`SsS~Ab7N`HZ#mZF$uU!qe2!LjG9vQ&S zZ9KdZ7vu3_fM?SrF1;7uOH(|y3XvRTQkE2ji5bU|d>jy+60)))YP|+ Date: Sat, 12 Jun 2021 16:31:39 -0500 Subject: [PATCH 120/202] Damned Curse rename and improvements --- Projectiles/CalamityGlobalProjectile.cs | 11 ++- .../Summon/SummonBrimstoneExplosionSmall.cs | 64 ++++++++++++++++++ .../Summon/SummonBrimstoneExplosionSmall.png | Bin 0 -> 965 bytes .../EnchantmentManager.cs | 4 +- 4 files changed, 76 insertions(+), 3 deletions(-) create mode 100644 Projectiles/Summon/SummonBrimstoneExplosionSmall.cs create mode 100644 Projectiles/Summon/SummonBrimstoneExplosionSmall.png diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 86c10b88cf..3b341686aa 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -110,7 +110,7 @@ namespace CalamityMod.Projectiles // Enchantment variables. public int ExplosiveEnchantCountdown = 0; - public const int ExplosiveEnchantTime = 600; + public const int ExplosiveEnchantTime = 2400; #region SetDefaults public override void SetDefaults(Projectile projectile) @@ -228,6 +228,9 @@ namespace CalamityMod.Projectiles if (projectile.minion && ExplosiveEnchantCountdown > 0) { ExplosiveEnchantCountdown--; + if (defDamage == 0) + defDamage = projectile.damage; + projectile.damage = (int)(defDamage * MathHelper.SmoothStep(1f, 1.6f, 1f - ExplosiveEnchantCountdown / (float)ExplosiveEnchantTime)); // Make fizzle sounds and fire dust to indicate the impending explosion. if (ExplosiveEnchantCountdown <= 300) @@ -242,6 +245,12 @@ namespace CalamityMod.Projectiles fire.noGravity = true; } + if (ExplosiveEnchantCountdown % 40 == 39 && Main.rand.NextBool(12)) + { + int damage = (int)(Main.player[projectile.owner].MinionDamage() * 2000); + Projectile.NewProjectile(projectile.Center, Vector2.Zero, ProjectileType(), damage, 0f, projectile.owner); + } + if (ExplosiveEnchantCountdown <= 0) { Main.PlaySound(SoundID.DD2_KoboldExplosion, projectile.Center); diff --git a/Projectiles/Summon/SummonBrimstoneExplosionSmall.cs b/Projectiles/Summon/SummonBrimstoneExplosionSmall.cs new file mode 100644 index 0000000000..24b4b6de0e --- /dev/null +++ b/Projectiles/Summon/SummonBrimstoneExplosionSmall.cs @@ -0,0 +1,64 @@ +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Summon +{ + public class SummonBrimstoneExplosionSmall : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Explosion"); + ProjectileID.Sets.MinionShot[projectile.type] = true; + Main.projFrames[projectile.type] = 6; + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 108; + projectile.friendly = true; + projectile.hostile = false; + projectile.minion = true; + projectile.penetrate = -1; + projectile.timeLeft = Main.projFrames[projectile.type] * 5; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + } + + public override void AI() + { + if (projectile.localAI[0] == 0f) + { + CreateInitialDust(); + projectile.localAI[0] = 1f; + } + + // Emit crimson light. + Lighting.AddLight(projectile.Center, Color.Red.ToVector3() * 1.1f); + if (projectile.timeLeft % 5f == 4f) + projectile.frame++; + } + + public void CreateInitialDust() + { + float randomnessSmoothness = 3f; + for (int i = 0; i < 6; i++) + { + randomnessSmoothness += i * 0.36f; + + for (int j = 0; j < 30; j++) + { + Vector2 velocity = Main.rand.NextVector2Square(-randomnessSmoothness, randomnessSmoothness).SafeNormalize(Vector2.UnitY) * randomnessSmoothness * 0.48f; + Dust dust = Dust.NewDustDirect(projectile.position + Vector2.One * 22f, 1, 1, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 1.6f); + dust.position += Main.rand.NextVector2Square(-10f, 10f); + dust.velocity = velocity; + dust.noGravity = true; + } + } + + projectile.Damage(); + } + } +} diff --git a/Projectiles/Summon/SummonBrimstoneExplosionSmall.png b/Projectiles/Summon/SummonBrimstoneExplosionSmall.png new file mode 100644 index 0000000000000000000000000000000000000000..b53b2fea887d88be7c6d896d0ad4715d91c23470 GIT binary patch literal 965 zcmV;$13LVPP)Px#1ZP1_K>z@;j|==^1poj55>QN3MF0Q*|B-WH7CEgnM&nOU00013X~QP~000Jb zQchF<|NsC00JFcOzW@LL32;bRa{vGi!2kdb!2!6DYwZ9411d>GK~!i%?Usvjqc99b zmu>U^zr0*uDUux%(1p%qww#$3Jr2g^nLm#LpDZtn1p`;hkty=B!U*In$BN9Nmpy8w zG>9g93r!0QYpYQuuAH3 zCX|SrGjcEF7@Uvnhi~+1O+g@LT=_$#RMo%7g&_D$fa?BtZOo~WodTPV+R_z z=!zU|Y#qq>qw}0bQHJKSZyCjfQDk0%3}p;M11K_d5-PUVG^%p{NHJ=A3~F6=LJh2C zs4_9ju%dBBUKX!5cLB2)CT6$@>>MsL6hzse)Et z$u9#sRhgK%!W=4IVa$jw`-_&J2UM|3Yd19c@t}y$8x&6Gyo?r9&tek3U{IH_I0$I@ z;qiZ@E^``C+FmV=!$(w?F#!}EkI{>$F8e8C88G7zi0~gMGRtVY3^)vG%&RhPOuv0l z@~sc!7r!pE=u-jE`5<6x#g)43#NwK5umV&WD)0Y za9+kFEKKw#uP&oBo5Dz4cKU<9qRPDBmbA>mCsjGhxt(Q?YjS_9%=tOlsmZuCEuO-m zY#Jrme}W)!*dln`EG)~eM{z5z%OoEh3g9qS6lGk}abY0WblJj9H2DZu$n!~^m!Sen zpM0`hT3}J0qsX&^zEYQusk%HqL;y7lSL!n8%R$~@UzZ52U%DnA z;j?8waXsf{s6QuL*l}Lo;`hk&lhxNX`3Se1x#i3)XFf%akL^A+8K2#)7tBai-ew%+ nI=TO8a;@BR%bEXNemwpG|6JTXI#<=S00000NkvXXu0mjfmFu-D literal 0 HcmV?d00001 diff --git a/UI/CalamitasEnchantments/EnchantmentManager.cs b/UI/CalamitasEnchantments/EnchantmentManager.cs index 06f8eb821a..377204cc07 100644 --- a/UI/CalamitasEnchantments/EnchantmentManager.cs +++ b/UI/CalamitasEnchantments/EnchantmentManager.cs @@ -180,9 +180,9 @@ namespace CalamityMod.UI.CalamitasEnchants player => player.Calamity().dischargingItemEnchant = true, item => item.damage > 0 && item.maxStack == 1 && !item.summon), - new Enchantment("Damned", "Causes minions to be created with a 40 second timer. Once it runs out, they explode violently. The explosion can hurt both you and enemies. Minions do more damage to compensate.", + new Enchantment("Hellbound", "Causes minions to be created with a 40 second timer. Once it runs out, they explode violently. The explosion can hurt both you and enemies. Minions do more damage the longer they live and idly explode.", 700, - item => item.damage = (int)(item.damage * 1.5), + null, player => player.Calamity().explosiveMinionsEnchant = true, item => item.damage > 0 && item.maxStack == 1 && item.summon), From c2954fc69994408dcedabbad7fbe1a9be99272d2 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 12 Jun 2021 18:12:32 -0500 Subject: [PATCH 121/202] Withered Enchant and Shattered Community change --- Buffs/Cooldowns/Withered.cs | 21 +++++++++++++++ Buffs/Cooldowns/Withered.png | Bin 0 -> 517 bytes CalPlayer/CalamityPlayerLifeRegen.cs | 19 ++++++++++++- Items/Accessories/ShatteredCommunity.cs | 25 ------------------ Items/CalamityGlobalItem.cs | 2 +- .../CalamitasEnchantUI.cs | 3 --- .../EnchantmentManager.cs | 12 +++++++-- 7 files changed, 50 insertions(+), 32 deletions(-) create mode 100644 Buffs/Cooldowns/Withered.cs create mode 100644 Buffs/Cooldowns/Withered.png diff --git a/Buffs/Cooldowns/Withered.cs b/Buffs/Cooldowns/Withered.cs new file mode 100644 index 0000000000..5a68168394 --- /dev/null +++ b/Buffs/Cooldowns/Withered.cs @@ -0,0 +1,21 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.Cooldowns +{ + public class Withered : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Withered"); + Description.SetDefault("Holding withered weapons causes you to suffer but makes your weapons strong"); + 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) => player.Calamity().witheredDebuff = true; + } +} diff --git a/Buffs/Cooldowns/Withered.png b/Buffs/Cooldowns/Withered.png new file mode 100644 index 0000000000000000000000000000000000000000..8565069431ae04a073a6edffbea36c09cd24b8bb GIT binary patch literal 517 zcmV+g0{Z=lP)s zX2sZ82*JW47CU#s%~RGuk8f-&l_)-faLLC{WOEin*Y;FlqLz?U-%FME9>-BR8+o zXSC+YT>%{f@5-Q=pB%+cYsEJ6QsXjp;BIxDkDLPkt+YN(%e>?sKv>c-V+Utsc00000NkvXX Hu0mjfX6NGx literal 0 HcmV?d00001 diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 3623f87f65..5befef5ace 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -5,6 +5,7 @@ using CalamityMod.Events; using CalamityMod.Projectiles.Ranged; using CalamityMod.World; using Microsoft.Xna.Framework; +using System; using Terraria; using Terraria.ModLoader; @@ -408,7 +409,23 @@ namespace CalamityMod.CalPlayer if (player.lifeRegen > 0) player.lifeRegen = 0; lifeRegenLost += 42; //the meaning of death - } + } + if (modPlayer.witheredDebuff) + { + modPlayer.witheredWeaponHoldTime += modPlayer.witheringWeaponEnchant.ToDirectionInt(); + if (modPlayer.witheredWeaponHoldTime < 0) + { + modPlayer.witheredWeaponHoldTime = 0; + } + else + { + lifeRegenLost += (int)(4D * Math.Pow(1.5D, modPlayer.witheredWeaponHoldTime / 87D)); + if (player.lifeRegen > 0) + player.lifeRegen = 0; + } + } + else + modPlayer.witheredWeaponHoldTime = 0; player.lifeRegen -= (int)(lifeRegenLost * lifeRegenMult); diff --git a/Items/Accessories/ShatteredCommunity.cs b/Items/Accessories/ShatteredCommunity.cs index f26df095ed..731ab8fe33 100644 --- a/Items/Accessories/ShatteredCommunity.cs +++ b/Items/Accessories/ShatteredCommunity.cs @@ -238,30 +238,5 @@ namespace CalamityMod.Items.Accessories level = reader.ReadInt32(); totalRageDamage = reader.ReadInt64(); } - - public override void AddRecipes() - { - ModRecipe r = new ShatteredCommunityRecipe(mod); - r.SetResult(this); - r.AddIngredient(ModContent.ItemType()); - r.AddIngredient(ModContent.ItemType()); - r.AddIngredient(ModContent.ItemType(), 120); - r.AddRecipe(); - } - - // The Shattered Community can only be crafted with a full-power Community. - // That is, in a world where all relevant bosses have been defeated. - private class ShatteredCommunityRecipe : ModRecipe - { - public ShatteredCommunityRecipe(Mod mod) : base(mod) { } - - public override bool RecipeAvailable() - { - bool vanillaBosses = NPC.downedSlimeKing && NPC.downedBoss1 && NPC.downedBoss2 && NPC.downedQueenBee && NPC.downedBoss3 && Main.hardMode; - vanillaBosses &= NPC.downedMechBossAny && NPC.downedPlantBoss && NPC.downedGolemBoss && NPC.downedFishron && NPC.downedAncientCultist && NPC.downedMoonlord; - bool calamityBosses = CalamityWorld.downedProvidence && CalamityWorld.downedDoG && CalamityWorld.downedYharon; - return vanillaBosses && calamityBosses; - } - } } } diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 0847369958..34dec2710e 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -1721,7 +1721,7 @@ namespace CalamityMod.Items if (calamitasNPCIndex != -1) currentPower = Utils.InverseLerp(11750f, 1000f, Main.LocalPlayer.Distance(Main.npc[calamitasNPCIndex].Center), true); - position += Vector2.One * 14f; + position += frame.Size() * 0.25f; EnchantmentEnergyParticles.InterpolationSpeed = MathHelper.Lerp(0.035f, 0.1f, currentPower); EnchantmentEnergyParticles.DrawSet(position + Main.screenPosition); diff --git a/UI/CalamitasEnchantments/CalamitasEnchantUI.cs b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs index b3570e3ad6..5abf79f364 100644 --- a/UI/CalamitasEnchantments/CalamitasEnchantUI.cs +++ b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs @@ -239,9 +239,6 @@ namespace CalamityMod.UI.CalamitasEnchants itemScale *= inventoryScale * baseScale; drawPosition += Vector2.One * 23f * baseScale; - if (EnchantmentManager.ItemUpgradeRelationship.ContainsKey(CurrentlyHeldItem.type)) - drawPosition -= Vector2.One * 12f; - // Draw the item. if (hasMultipleFrames || ItemLoader.PreDrawInInventory(CurrentlyHeldItem, spriteBatch, drawPosition, itemFrame, CurrentlyHeldItem.GetAlpha(Color.White), CurrentlyHeldItem.GetColor(Color.White), itemTexture.Size() * 0.5f, itemScale)) { diff --git a/UI/CalamitasEnchantments/EnchantmentManager.cs b/UI/CalamitasEnchantments/EnchantmentManager.cs index 377204cc07..aa03ce8d81 100644 --- a/UI/CalamitasEnchantments/EnchantmentManager.cs +++ b/UI/CalamitasEnchantments/EnchantmentManager.cs @@ -1,3 +1,4 @@ +using CalamityMod.Items.Accessories; using CalamityMod.Items.Weapons.Summon; using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; @@ -180,7 +181,7 @@ namespace CalamityMod.UI.CalamitasEnchants player => player.Calamity().dischargingItemEnchant = true, item => item.damage > 0 && item.maxStack == 1 && !item.summon), - new Enchantment("Hellbound", "Causes minions to be created with a 40 second timer. Once it runs out, they explode violently. The explosion can hurt both you and enemies. Minions do more damage the longer they live and idly explode.", + new Enchantment("Hellbound", "Causes minions to be created with a 40 second timer. Once it runs out, they explode violently. Minions do more damage the longer they live and idly explode as well.", 700, null, player => player.Calamity().explosiveMinionsEnchant = true, @@ -223,6 +224,12 @@ namespace CalamityMod.UI.CalamitasEnchants null, player => player.Calamity().manaMonsterEnchant = true, item => item.damage > 0 && item.maxStack == 1 && item.magic && item.mana > 0), + + new Enchantment("Withering", "You heal when hurt based on damage dealt. After being hurt, the weapon rapidly drains your life to deal massive damage.", + 1000, + null, + player => player.Calamity().witheringWeaponEnchant = true, + item => item.damage > 0 && item.maxStack == 1 && !item.summon), }; // Special disenchantment thing. This is separated from the list on purpose. @@ -232,7 +239,8 @@ namespace CalamityMod.UI.CalamitasEnchants ItemUpgradeRelationship = new Dictionary() { - [ModContent.ItemType()] = ModContent.ItemType() + [ModContent.ItemType()] = ModContent.ItemType(), + [ModContent.ItemType()] = ModContent.ItemType(), }; } From 69dd51a640a039d58a8c05797cfdb348967d59d2 Mon Sep 17 00:00:00 2001 From: Dominic Date: Mon, 14 Jun 2021 04:00:56 -0500 Subject: [PATCH 122/202] Movement AI fixes --- Items/Weapons/Melee/Omniblade.cs | 2 +- Projectiles/Magic/RedirectingVengefulSoul.cs | 5 ++--- Projectiles/Summon/DazzlingStabber.cs | 13 +++++-------- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/Items/Weapons/Melee/Omniblade.cs b/Items/Weapons/Melee/Omniblade.cs index 3e9906068f..0ccd879f86 100644 --- a/Items/Weapons/Melee/Omniblade.cs +++ b/Items/Weapons/Melee/Omniblade.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Melee item.noMelee = true; item.noUseGraphic = true; item.channel = true; - item.shoot = ModContent.ProjectileType(); + item.shoot = ModContent.ProjectileType(); item.shootSpeed = 24f; item.rare = ItemRarityID.Yellow; } diff --git a/Projectiles/Magic/RedirectingVengefulSoul.cs b/Projectiles/Magic/RedirectingVengefulSoul.cs index 5197493fcc..fd9ce2250c 100644 --- a/Projectiles/Magic/RedirectingVengefulSoul.cs +++ b/Projectiles/Magic/RedirectingVengefulSoul.cs @@ -63,9 +63,8 @@ namespace CalamityMod.Projectiles.Magic float delayFactor = Utils.InverseLerp(20f, 35f, time, true); float homeSpeed = MathHelper.Lerp(0f, 0.075f, delayFactor); - projectile.velocity = Vector2.Lerp(projectile.velocity, projectile.DirectionTo(target.Center) * 16f, homeSpeed); - projectile.velocity = projectile.velocity.SafeNormalize(Vector2.UnitY) * oldSpeed; - projectile.position += (target.Center - projectile.Center).SafeNormalize(Vector2.Zero) * MathHelper.Lerp(25f, 1f, Utils.InverseLerp(100f, 360f, projectile.Distance(target.Center), true)) * delayFactor; + projectile.velocity = Vector2.Lerp(projectile.velocity, projectile.SafeDirectionTo(target.Center) * 16f, homeSpeed); + projectile.velocity = (projectile.velocity + projectile.SafeDirectionTo(target.Center) * 3f).SafeNormalize(Vector2.UnitY) * oldSpeed; } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Summon/DazzlingStabber.cs b/Projectiles/Summon/DazzlingStabber.cs index 62b6114e16..99c39730e1 100644 --- a/Projectiles/Summon/DazzlingStabber.cs +++ b/Projectiles/Summon/DazzlingStabber.cs @@ -100,18 +100,14 @@ namespace CalamityMod.Projectiles.Summon return; } - // Don't do anything if very close to the target. - if (projectile.WithinRange(target.Center, 60f)) - return; - // Reset the velocity to fly upward if there is very little motion to ensure // that the summon does not get stuck. - if (projectile.velocity.Length() < 1.6f) - projectile.velocity = Vector2.UnitY * 5f; + if (projectile.velocity.Length() < 3f) + projectile.velocity = Vector2.UnitY * -12f; // If close to the target, slow down dramatically. if (projectile.velocity.Length() > 5f && projectile.WithinRange(target.Center, 90f)) - projectile.velocity *= 0.8f; + projectile.velocity *= 0.93f; // Otherwise, if not close, speed up dramatically. else if (projectile.velocity.Length() < 40f) @@ -120,7 +116,8 @@ namespace CalamityMod.Projectiles.Summon float angularTurnSpeed = 0.35f; float angleToTargetCoords = projectile.AngleTo(target.Center); - projectile.velocity = projectile.velocity.ToRotation().AngleTowards(angleToTargetCoords, angularTurnSpeed).ToRotationVector2() * projectile.velocity.Length(); + if (!projectile.WithinRange(target.Center, 200f)) + projectile.velocity = projectile.velocity.ToRotation().AngleTowards(angleToTargetCoords, angularTurnSpeed).ToRotationVector2() * projectile.velocity.Length(); // If not super close to the target but the target is very much in the line of sight of the summon, charge. if (!projectile.WithinRange(target.Center, 75f) && Vector2.Dot(projectile.SafeDirectionTo(target.Center), projectile.velocity.SafeNormalize(Vector2.Zero)) > 0.85f) From 1715ce6720c4612d99780f3fdbc3ab041b27eecb Mon Sep 17 00:00:00 2001 From: Dominic Date: Mon, 14 Jun 2021 04:06:47 -0500 Subject: [PATCH 123/202] Daedalus Golem frame fixes --- Projectiles/Summon/DaedalusGolem.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Projectiles/Summon/DaedalusGolem.cs b/Projectiles/Summon/DaedalusGolem.cs index ead4d07779..cfe61e4164 100644 --- a/Projectiles/Summon/DaedalusGolem.cs +++ b/Projectiles/Summon/DaedalusGolem.cs @@ -119,7 +119,8 @@ namespace CalamityMod.Projectiles.Summon projectile.netUpdate = true; } - projectile.spriteDirection = (potentialTarget.Center.X - projectile.Center.X < 0).ToDirectionInt(); + if (MathHelper.Distance(potentialTarget.Center.X, projectile.Center.X) > 30f) + projectile.spriteDirection = (potentialTarget.Center.X - projectile.Center.X < 0).ToDirectionInt(); if (UsingChargedLaserAttack) { @@ -197,9 +198,8 @@ namespace CalamityMod.Projectiles.Summon projectile.tileCollide = true; // Don't bother moving any more if super close to the destination. // Just slow down and face the player. - if (Math.Abs(projectile.Center.X - destination.X) < 35 + Math.Abs(projectile.velocity.X)) + if (Math.Abs(projectile.Center.X - destination.X) < 55 + Math.Abs(projectile.velocity.X)) { - projectile.spriteDirection = (Owner.Center.X - projectile.Center.X < 0).ToDirectionInt(); StuckJumpSpeed = 0f; projectile.velocity.X *= 0.8f; return true; @@ -257,7 +257,7 @@ namespace CalamityMod.Projectiles.Summon } } - projectile.spriteDirection = (projectile.velocity.X < 0).ToDirectionInt(); + projectile.spriteDirection = (Owner.Center.X - projectile.Center.X < 0).ToDirectionInt(); return false; } #endregion @@ -296,7 +296,7 @@ namespace CalamityMod.Projectiles.Summon else projectile.frame = (int)MathHelper.Lerp(startingPelletFrame, endingPelletFrame + 1, Utils.InverseLerp(0f, ChargedPelletAttackTime, AttackTimer, true)); } - else if (Math.Abs(projectile.velocity.X) > 1f && tileBelow.IsTileSolidGround()) + else if (Math.Abs(projectile.velocity.X) > 5f && Math.Abs(projectile.velocity.Y) < 2f && tileBelow.IsTileSolidGround()) { if (projectile.frameCounter >= Utils.Clamp(2, 6, (int)Math.Abs(projectile.velocity.X * 0.8))) { From 7749fbadafb9307784623dbf376ada081e07a719 Mon Sep 17 00:00:00 2001 From: Dominic Date: Mon, 14 Jun 2021 04:24:01 -0500 Subject: [PATCH 124/202] Vigilance/Viral Sprout summoning issue fix --- Items/Weapons/Summon/Vigilance.cs | 12 ++++++++++-- Items/Weapons/Summon/ViralSprout.cs | 14 +++++++++++--- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/Items/Weapons/Summon/Vigilance.cs b/Items/Weapons/Summon/Vigilance.cs index 990b520b42..b0499f9946 100644 --- a/Items/Weapons/Summon/Vigilance.cs +++ b/Items/Weapons/Summon/Vigilance.cs @@ -38,10 +38,18 @@ namespace CalamityMod.Items.Weapons.Summon { if (player.altFunctionUse != 2) { + int seekerIndex = 0; + int totalSeekers = 0; + for (int i = 0; i < Main.maxProjectiles; i++) + { + if (Main.projectile[i].type != type || !Main.projectile[i].active || Main.projectile[i].owner != player.whoAmI) + continue; + + totalSeekers++; + } + Projectile.NewProjectile(Main.MouseWorld, Vector2.Zero, type, damage, knockBack, player.whoAmI); - int seekerIndex = 0; - int totalSeekers = CalamityUtils.CountProjectiles(type); for (int i = 0; i < Main.maxProjectiles; i++) { if (Main.projectile[i].type != type || !Main.projectile[i].active || Main.projectile[i].owner != player.whoAmI) diff --git a/Items/Weapons/Summon/ViralSprout.cs b/Items/Weapons/Summon/ViralSprout.cs index fc63be50f8..77be9227c7 100644 --- a/Items/Weapons/Summon/ViralSprout.cs +++ b/Items/Weapons/Summon/ViralSprout.cs @@ -39,10 +39,18 @@ namespace CalamityMod.Items.Weapons.Summon { if (player.altFunctionUse != 2) { - int sageSpirit = Projectile.NewProjectile(Main.MouseWorld, Vector2.Zero, type, damage, knockBack, player.whoAmI); + Projectile.NewProjectile(Main.MouseWorld, Vector2.Zero, type, damage, knockBack, player.whoAmI); - if (Main.projectile.IndexInRange(sageSpirit)) - Main.projectile[sageSpirit].localAI[0] = player.ownedProjectileCounts[type]; + int minionCount = 0; + for (int i = 0; i < Main.maxProjectiles; i++) + { + if (Main.projectile[i].type != type || !Main.projectile[i].active || Main.projectile[i].owner != player.whoAmI) + continue; + + Main.projectile[i].localAI[0] = minionCount; + Main.projectile[i].netUpdate = true; + minionCount++; + } } return false; } From 82e1ad21bb10c1674882cce7ae60336e4fc20124 Mon Sep 17 00:00:00 2001 From: Dominic Date: Mon, 14 Jun 2021 04:38:40 -0500 Subject: [PATCH 125/202] Stronger Flesh Ball jumps --- Projectiles/Summon/FleshBallMinion.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Projectiles/Summon/FleshBallMinion.cs b/Projectiles/Summon/FleshBallMinion.cs index 880296c568..651651a7cc 100644 --- a/Projectiles/Summon/FleshBallMinion.cs +++ b/Projectiles/Summon/FleshBallMinion.cs @@ -111,7 +111,7 @@ namespace CalamityMod.Projectiles.Summon bool closeToPlayer = projectile.WithinRange(Owner.Center, 150f); if (!closeToPlayer && SittingOnGround && HopTimer % 30f == 29f) { - projectile.velocity = projectile.DirectionTo(Owner.Center) * 9f + new Vector2(Math.Sign(projectile.velocity.X) * 2f, -4f); + projectile.velocity = projectile.SafeDirectionTo(Owner.Center) * 9f + new Vector2(Math.Sign(projectile.velocity.X) * 2f, -9f); // Don't collide with tiles for 1 frame, to prevent slopes from being a nuisance. projectile.tileCollide = false; @@ -125,7 +125,7 @@ namespace CalamityMod.Projectiles.Summon if (SittingOnGround && HopTimer % 20f == 19f) { - projectile.velocity = projectile.DirectionTo(target.Center) * 6f + new Vector2(Math.Sign(projectile.velocity.X) * 2f, -4f); + projectile.velocity = projectile.DirectionTo(target.Center) * 6f + new Vector2(Math.Sign(projectile.velocity.X) * 2f, -7f); // Release a bunch of blood. if (Main.myPlayer == projectile.owner) @@ -148,8 +148,8 @@ namespace CalamityMod.Projectiles.Summon } } - // Prevent immediate death on tile collision, and slow down on tile collision. - public override bool OnTileCollide(Vector2 oldVelocity) + // Prevent immediate death on tile collision, and slow down on tile collision. + public override bool OnTileCollide(Vector2 oldVelocity) { projectile.velocity.X *= 0.9f; return false; From 27705e36e433ec0a9dd2ecd58002d0dd50d32ce6 Mon Sep 17 00:00:00 2001 From: Dominic Date: Mon, 14 Jun 2021 04:38:49 -0500 Subject: [PATCH 126/202] Smart Daedalus Golem platform fallthrough --- Projectiles/Summon/DaedalusGolem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projectiles/Summon/DaedalusGolem.cs b/Projectiles/Summon/DaedalusGolem.cs index cfe61e4164..0090806db9 100644 --- a/Projectiles/Summon/DaedalusGolem.cs +++ b/Projectiles/Summon/DaedalusGolem.cs @@ -266,7 +266,7 @@ namespace CalamityMod.Projectiles.Summon public override bool OnTileCollide(Vector2 oldVelocity) => false; public override bool TileCollideStyle(ref int width, ref int height, ref bool fallThrough) { - fallThrough = false; + fallThrough = projectile.Bottom.Y < Owner.Top.Y; return true; } From 656bbd233e14863c64273bd8a357ae5ac5e065a5 Mon Sep 17 00:00:00 2001 From: Dominic Date: Mon, 14 Jun 2021 04:38:57 -0500 Subject: [PATCH 127/202] Deathstare beam visual bug fix --- Projectiles/Summon/DeathstareBeam.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Projectiles/Summon/DeathstareBeam.cs b/Projectiles/Summon/DeathstareBeam.cs index 0e1923ab88..e9804eb637 100644 --- a/Projectiles/Summon/DeathstareBeam.cs +++ b/Projectiles/Summon/DeathstareBeam.cs @@ -1,5 +1,6 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -44,7 +45,9 @@ namespace CalamityMod.Projectiles.Summon Vector2 drawPosition = projectile.Center + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; Vector2 drawScale = new Vector2(0.55f, projectile.velocity.Length() / beamTexture.Height * 20f); Color color = Color.White * 2.1f * projectile.Opacity; - spriteBatch.Draw(beamTexture, drawPosition, null, color, projectile.rotation, beamTexture.Frame().Bottom(), drawScale, SpriteEffects.None, 0f); + + if (Math.Abs(projectile.rotation - MathHelper.PiOver2) > 0.008f) + spriteBatch.Draw(beamTexture, drawPosition, null, color, projectile.rotation, beamTexture.Frame().Bottom(), drawScale, SpriteEffects.None, 0f); return false; } } From 38eeb8f8dfb1e97aa192ed0e8e7e15fdbab24781 Mon Sep 17 00:00:00 2001 From: Dominic Date: Mon, 14 Jun 2021 04:42:21 -0500 Subject: [PATCH 128/202] Far-off minion teleport effects --- Projectiles/Summon/EyeOfNightSummon.cs | 7 +++++++ Projectiles/Summon/PerditionBeacon.cs | 3 ++- Projectiles/Summon/SeekerSummonProj.cs | 7 +++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Projectiles/Summon/EyeOfNightSummon.cs b/Projectiles/Summon/EyeOfNightSummon.cs index b87e076ff3..a9b64e428c 100644 --- a/Projectiles/Summon/EyeOfNightSummon.cs +++ b/Projectiles/Summon/EyeOfNightSummon.cs @@ -95,6 +95,13 @@ namespace CalamityMod.Projectiles.Summon else if (!projectile.WithinRange(destination, 20f)) projectile.velocity = projectile.velocity * 0.9f + idealVelocity * 0.1f; + if (!projectile.WithinRange(Owner.Center, 1800f)) + { + projectile.Center = Owner.Center; + projectile.velocity = -Vector2.UnitY * 4f; + projectile.netUpdate = true; + } + // Slow down a bit over time. projectile.velocity *= 0.985f; } diff --git a/Projectiles/Summon/PerditionBeacon.cs b/Projectiles/Summon/PerditionBeacon.cs index 9cec293928..fdd5ec89b8 100644 --- a/Projectiles/Summon/PerditionBeacon.cs +++ b/Projectiles/Summon/PerditionBeacon.cs @@ -122,7 +122,8 @@ namespace CalamityMod.Projectiles.Summon Vector2 destination = Owner.Top - Vector2.UnitY * MathHelper.Lerp(20f, 40f, (float)Math.Cos(projectile.timeLeft / 24f) * 0.5f + 0.5f); projectile.Center = Vector2.Lerp(projectile.Center, destination, 0.025f); projectile.Center += (destination - projectile.Center).SafeNormalize(Vector2.Zero) * 3f; - if (projectile.WithinRange(destination, 5f)) + + if (projectile.WithinRange(destination, 5f) || !projectile.WithinRange(destination, 2200f)) projectile.Center = destination; } diff --git a/Projectiles/Summon/SeekerSummonProj.cs b/Projectiles/Summon/SeekerSummonProj.cs index 1e5fe713c1..cbf10e1020 100644 --- a/Projectiles/Summon/SeekerSummonProj.cs +++ b/Projectiles/Summon/SeekerSummonProj.cs @@ -105,6 +105,13 @@ namespace CalamityMod.Projectiles.Summon if (!projectile.WithinRange(destination, 20f)) projectile.velocity = (projectile.velocity * 20f + projectile.DirectionTo(destination) * 16f) / 21f; + if (!projectile.WithinRange(Owner.Center, 1800f)) + { + projectile.Center = Owner.Center; + projectile.velocity = -Vector2.UnitY * 4f; + projectile.netUpdate = true; + } + projectile.spriteDirection = (destination.X - projectile.Center.X > 0f).ToDirectionInt(); } From f23815991ef0f75fbcbd206a8bf636689a8c21a1 Mon Sep 17 00:00:00 2001 From: Dominic Date: Mon, 14 Jun 2021 04:55:46 -0500 Subject: [PATCH 129/202] Fabstaff and Photon Ripper light --- Projectiles/Magic/FabBolt.cs | 5 ++++- Projectiles/Magic/FabRay.cs | 3 +++ Projectiles/Melee/PrismTooth.cs | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Projectiles/Magic/FabBolt.cs b/Projectiles/Magic/FabBolt.cs index dcdc471668..99420e8491 100644 --- a/Projectiles/Magic/FabBolt.cs +++ b/Projectiles/Magic/FabBolt.cs @@ -52,7 +52,10 @@ namespace CalamityMod.Projectiles.Magic else projectile.velocity *= 1.004f; projectile.rotation = projectile.velocity.ToRotation(); - } + + // Emit light. + Lighting.AddLight(projectile.Center, Vector3.One * projectile.Opacity * 0.45f); + } internal Color ColorFunction(float completionRatio) { diff --git a/Projectiles/Magic/FabRay.cs b/Projectiles/Magic/FabRay.cs index 2b0c48839c..2d75e9d2d7 100644 --- a/Projectiles/Magic/FabRay.cs +++ b/Projectiles/Magic/FabRay.cs @@ -60,6 +60,9 @@ namespace CalamityMod.Projectiles.Magic } } } + + // Emit light. + Lighting.AddLight(projectile.Center, Vector3.One * projectile.Opacity * 0.7f); } internal Color ColorFunction(float completionRatio) diff --git a/Projectiles/Melee/PrismTooth.cs b/Projectiles/Melee/PrismTooth.cs index 598cfb71eb..a7ac09c06d 100644 --- a/Projectiles/Melee/PrismTooth.cs +++ b/Projectiles/Melee/PrismTooth.cs @@ -69,6 +69,9 @@ namespace CalamityMod.Projectiles.Melee AbsolutelyFuckingAnnihilateTrees(pointToCheck.X, pointToCheck.Y); } + // Emit light. + Lighting.AddLight(projectile.Center, Vector3.One * 0.7f); + Time++; } From 643cb628a8b6c7d6d3235b3fc675ff2073f11c23 Mon Sep 17 00:00:00 2001 From: Dominic Date: Mon, 14 Jun 2021 05:08:53 -0500 Subject: [PATCH 130/202] Rotten Dogtooth fixes --- CalPlayer/CalamityPlayer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index e987fd236a..7d868d922a 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -6910,7 +6910,7 @@ namespace CalamityMod.CalPlayer public override bool Shoot(Item item, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { if (rottenDogTooth && item.Calamity().rogue && item.type != ModContent.ItemType()) - damage = (int)(damage * RottenDogtooth.StealthStrikeDamageMultiplier); + damage = (int)(damage * (1f + RottenDogtooth.StealthStrikeDamageMultiplier)); if (veneratedLocket) { @@ -9549,7 +9549,7 @@ namespace CalamityMod.CalPlayer stealthStrikeThisFrame = true; stealthAcceleration = 1f; // Reset acceleration when you attack - float lossReductionRatio = flatStealthLossReduction / rogueStealthMax; + float lossReductionRatio = flatStealthLossReduction / (rogueStealthMax * 100f); if (stealthStrikeHalfCost) { rogueStealth -= 0.5f * rogueStealthMax - lossReductionRatio; From 6a304b58889de4efd3570a84b7af89e1ea8d897a Mon Sep 17 00:00:00 2001 From: Dominic Date: Mon, 14 Jun 2021 05:27:59 -0500 Subject: [PATCH 131/202] Condemnation rotation issue --- Projectiles/Ranged/CondemnationHoldout.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Projectiles/Ranged/CondemnationHoldout.cs b/Projectiles/Ranged/CondemnationHoldout.cs index b8899add01..1ac21ab858 100644 --- a/Projectiles/Ranged/CondemnationHoldout.cs +++ b/Projectiles/Ranged/CondemnationHoldout.cs @@ -114,8 +114,9 @@ namespace CalamityMod.Projectiles.Ranged { if (Main.myPlayer == projectile.owner) { + float interpolant = Utils.InverseLerp(5f, 25f, projectile.Distance(Main.MouseWorld), true); Vector2 oldVelocity = projectile.velocity; - projectile.velocity = projectile.SafeDirectionTo(Main.MouseWorld); + projectile.velocity = Vector2.Lerp(projectile.velocity, projectile.SafeDirectionTo(Main.MouseWorld), interpolant); if (projectile.velocity != oldVelocity) { projectile.netSpam = 0; From 7222901420b4526f27bd04e3a5b7b0ce7e86f20d Mon Sep 17 00:00:00 2001 From: Dominic Date: Tue, 15 Jun 2021 10:06:45 -0500 Subject: [PATCH 132/202] Persecuted enchantment --- CalPlayer/CalamityPlayer.cs | 18 +++ NPCs/Other/CalamitasEnchantDemon.cs | 4 +- NPCs/Other/DemonPortal.cs | 123 ++++++++++++++++++ NPCs/Other/DemonPortal.png | Bin 0 -> 837 bytes Projectiles/Typeless/SuicideBomberDemon.cs | 117 +++++++++++++++++ Projectiles/Typeless/SuicideBomberDemon.png | Bin 0 -> 8180 bytes .../EnchantmentManager.cs | 6 + Utilities/DrawingUtils.cs | 11 ++ 8 files changed, 278 insertions(+), 1 deletion(-) create mode 100644 NPCs/Other/DemonPortal.cs create mode 100644 NPCs/Other/DemonPortal.png create mode 100644 Projectiles/Typeless/SuicideBomberDemon.cs create mode 100644 Projectiles/Typeless/SuicideBomberDemon.png diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index c3e51a953c..1467e28ea8 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -32,6 +32,7 @@ using CalamityMod.NPCs.DevourerofGods; using CalamityMod.NPCs.GreatSandShark; using CalamityMod.NPCs.Leviathan; using CalamityMod.NPCs.NormalNPCs; +using CalamityMod.NPCs.Other; using CalamityMod.NPCs.PlaguebringerGoliath; using CalamityMod.NPCs.Polterghast; using CalamityMod.NPCs.Providence; @@ -1017,6 +1018,12 @@ namespace CalamityMod.CalPlayer public bool explosiveMinionsEnchant = false; public bool bladeArmEnchant = false; public bool manaMonsterEnchant = false; + + public bool witheringWeaponEnchant = false; + public bool witheredDebuff = false; + public int witheredWeaponHoldTime = 0; + + public bool persecutedEnchant = false; #endregion Calamitas Enchant Effects #endregion @@ -2010,6 +2017,8 @@ namespace CalamityMod.CalPlayer explosiveMinionsEnchant = false; bladeArmEnchant = false; manaMonsterEnchant = false; + witheringWeaponEnchant = false; + persecutedEnchant = false; lastProjectileHit = null; @@ -7347,6 +7356,15 @@ namespace CalamityMod.CalPlayer if (player.whoAmI == Main.myPlayer) { + // Summon a portal if needed. + if (player.Calamity().persecutedEnchant && NPC.CountNPCS(ModContent.NPCType()) < 2) + { + Vector2 spawnPosition = player.Center + Main.rand.NextVector2Unit() * Main.rand.NextFloat(270f, 420f); + int portal = NPC.NewNPC((int)spawnPosition.X, (int)spawnPosition.Y, ModContent.NPCType()); + if (Main.npc.IndexInRange(portal)) + Main.npc[portal].target = player.whoAmI; + } + if (revivify) { int healAmt = (int)(damage / 15D); diff --git a/NPCs/Other/CalamitasEnchantDemon.cs b/NPCs/Other/CalamitasEnchantDemon.cs index f88ba5486a..d4a60a001d 100644 --- a/NPCs/Other/CalamitasEnchantDemon.cs +++ b/NPCs/Other/CalamitasEnchantDemon.cs @@ -25,7 +25,7 @@ namespace CalamityMod.NPCs.Other npc.defense = 0; // This is meant to be created after SCal is defeated and should be at least a little challenging. - npc.lifeMax = 166660; + npc.lifeMax = 101010; npc.HitSound = SoundID.NPCHit47; npc.DeathSound = SoundID.NPCDeath18; npc.noGravity = true; @@ -36,6 +36,8 @@ namespace CalamityMod.NPCs.Other npc.aiStyle = 0; } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) => npc.lifeMax = 101010; + public override void AI() { FadeAwayTimer++; diff --git a/NPCs/Other/DemonPortal.cs b/NPCs/Other/DemonPortal.cs new file mode 100644 index 0000000000..092c7846ee --- /dev/null +++ b/NPCs/Other/DemonPortal.cs @@ -0,0 +1,123 @@ +using CalamityMod.Projectiles.Typeless; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.NPCs.Other +{ + public class DemonPortal : ModNPC + { + public ref float Time => ref npc.ai[0]; + public override void SetStaticDefaults() => DisplayName.SetDefault("Mysterious Portal"); + + public override void SetDefaults() + { + npc.width = npc.height = 60; + npc.damage = 0; + npc.defense = 0; + npc.lifeMax = 24660; + npc.noGravity = true; + npc.noTileCollide = true; + npc.value = 0f; + npc.knockBackResist = 0f; + npc.netAlways = true; + npc.aiStyle = -1; + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) => npc.lifeMax = 24660; + + public override void AI() + { + npc.rotation += 0.18f; + npc.Opacity = Utils.InverseLerp(0f, 30f, Time, true) * Utils.InverseLerp(420f, 390f, Time, true); + npc.velocity = Vector2.Zero; + npc.scale = npc.Opacity; + + if (Time == 300f) + { + if (Main.netMode != NetmodeID.MultiplayerClient) + ReleaseThings(); + Main.PlaySound(SoundID.DD2_EtherianPortalOpen, npc.Center); + } + + if (Main.netMode != NetmodeID.MultiplayerClient && Time >= 420f) + { + npc.active = false; + npc.netUpdate = true; + } + + Time++; + } + + public void ReleaseThings() + { + bool friendly = npc.life == 1; + for (int i = 0; i < 6; i++) + { + int demon = Projectile.NewProjectile(npc.Center, Main.rand.NextVector2CircularEdge(4f, 4f), ModContent.ProjectileType(), 17000, 0f, npc.target); + if (Main.projectile.IndexInRange(demon)) + { + Main.projectile[demon].friendly = friendly; + Main.projectile[demon].hostile = !friendly; + } + } + } + + public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) + { + bool wouldDie = npc.life - (damage * (crit ? 2D : 1D)) <= 0; + if (wouldDie) + { + npc.immortal = true; + + // Enrage demons if hit when already at 1 health. + if (npc.life == 1) + { + int demonType = ModContent.ProjectileType(); + for (int i = 0; i < Main.maxProjectiles; i++) + { + if (Main.projectile[i].type != demonType || !Main.projectile[i].active || Main.projectile[i].hostile) + continue; + + Main.projectile[i].hostile = true; + Main.projectile[i].friendly = false; + Main.projectile[i].netUpdate = true; + } + } + + npc.life = 1; + damage = 0D; + return false; + } + return true; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + spriteBatch.SetBlendState(BlendState.AlphaBlend); + + Texture2D portalTexture = Main.npcTexture[npc.type]; + Vector2 drawPosition = npc.Center - Main.screenPosition; + Vector2 origin = portalTexture.Size() * 0.5f; + Color baseColor = Color.White; + + // Purple-black portal. + Color color = Color.Lerp(baseColor, Color.Black, 0.55f) * npc.Opacity * 1.8f; + spriteBatch.Draw(portalTexture, drawPosition, null, color, npc.rotation, origin, npc.scale * 1.2f, SpriteEffects.None, 0f); + spriteBatch.Draw(portalTexture, drawPosition, null, color, -npc.rotation, origin, npc.scale * 1.2f, SpriteEffects.None, 0f); + + // Purple portal. + color = Color.Lerp(Color.Lerp(baseColor, Color.Purple, 0.55f), Color.Black, 0.66f) * npc.Opacity * 1.6f; + spriteBatch.Draw(portalTexture, drawPosition, null, color, npc.rotation * 0.6f, origin, npc.scale * 1.2f, SpriteEffects.None, 0f); + + // Red portal. + color = Color.Lerp(baseColor, Color.Red, 0.55f) * npc.Opacity * 1.6f; + spriteBatch.Draw(portalTexture, drawPosition, null, color, npc.rotation * -0.6f, origin, npc.scale * 1.2f, SpriteEffects.None, 0f); + + spriteBatch.SetBlendState(BlendState.AlphaBlend); + return false; + } + } +} diff --git a/NPCs/Other/DemonPortal.png b/NPCs/Other/DemonPortal.png new file mode 100644 index 0000000000000000000000000000000000000000..1fb1ceee5ec7c9ee409dd8e0e838951134cc5808 GIT binary patch literal 837 zcmV-L1G@Z)P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGizyJUazyWI3i3tDz0@_JLK~!i%?U_Am z6j2n0*DORtqoVkYh!7AzD#c1s?A1bSZ3TaVzrdd$*xHJP+KYmvR(>=A5z!#QK-frN zB`9Z@r|?aV=gytkY%%wN9%H}zlP5rx?0`wXtm;*1vRWD`5Sb* z8VAg`oskv8fN7=aIIBjl-M>_|hnElD{4-;U3`4HzVi-f3GZ2}Lj7E6Iz3Q!|!86`p z!{ny-M8ZRJ7BHP_I5MkfPxNxTe}?P0VSJ5DdpQeD%_?d-mDgXNRqcx5nhopW$aF+* z?kZZX!OLx}C7$VGSPg?W{wkW=ZL74>bktDO#V}wRQs>aqnrQ*o$Mw*TwLvlLp}DQ5 zHFqE~?iq#1tj?jqTm2Qo5uWMDFy_>_ZjTJBS#MRub?TFxVmKA)1KlXNGeY_s;IFj9ff?`P9K3 z2dZtx(%RCSH`17GdBLSUhUfq+h-rn|G#55qj!e4{2#X5wU3!4Z*#Do z&@_LIQl;BM71g(qpidDY$5sx-a4u?ANgZb=O)=aQo%uve%PjQF@L=#4u1&JuY~y$e P00000NkvXXu0mjfrTv(< literal 0 HcmV?d00001 diff --git a/Projectiles/Typeless/SuicideBomberDemon.cs b/Projectiles/Typeless/SuicideBomberDemon.cs new file mode 100644 index 0000000000..a712fd1b16 --- /dev/null +++ b/Projectiles/Typeless/SuicideBomberDemon.cs @@ -0,0 +1,117 @@ +using Microsoft.Xna.Framework; +using System.IO; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Typeless +{ + public class SuicideBomberDemon : ModProjectile + { + public Player Owner => Main.player[projectile.owner]; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Demon"); + Main.projFrames[projectile.type] = 5; + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 32; + projectile.tileCollide = false; + projectile.ignoreWater = true; + projectile.penetrate = -1; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 5; + projectile.Opacity = 0f; + projectile.timeLeft = 300; + } + + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(projectile.friendly); + writer.Write(projectile.hostile); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + projectile.friendly = reader.ReadBoolean(); + projectile.hostile = reader.ReadBoolean(); + } + + public override void AI() + { + if (projectile.owner == 255) + projectile.owner = Player.FindClosest(projectile.Center, 1, 1); + projectile.Opacity = MathHelper.Clamp(projectile.Opacity + 0.025f, 0f, 1f); + + projectile.frame = projectile.frameCounter++ / 5 % Main.projFrames[projectile.type]; + + // Anti-clumping behavior. + float pushForce = 0.08f; + for (int k = 0; k < Main.maxProjectiles; k++) + { + Projectile otherProj = Main.projectile[k]; + // Short circuits to make the loop as fast as possible + if (!otherProj.active || otherProj.type != projectile.type || k == projectile.whoAmI) + continue; + + // If the other projectile is indeed the same owned by the same player and they're too close, nudge them away. + bool sameProjType = otherProj.type == projectile.type; + float taxicabDist = MathHelper.Distance(projectile.position.X, otherProj.position.X) + MathHelper.Distance(projectile.position.Y, otherProj.position.Y); + if (sameProjType && taxicabDist < 60f) + { + if (projectile.position.X < otherProj.position.X) + projectile.velocity.X -= pushForce; + else + projectile.velocity.X += pushForce; + + if (projectile.position.Y < otherProj.position.Y) + projectile.velocity.Y -= pushForce; + else + projectile.velocity.Y += pushForce; + } + } + + if (projectile.hostile) + { + projectile.velocity = projectile.velocity.MoveTowards(projectile.SafeDirectionTo(Owner.Center) * 16f, 1.4f); + projectile.spriteDirection = (Owner.Center.X > projectile.Center.X).ToDirectionInt(); + if (projectile.Hitbox.Intersects(Owner.Hitbox)) + projectile.Kill(); + } + else if (projectile.friendly) + { + NPC potentialTarget = projectile.Center.ClosestNPCAt(1360f); + if (potentialTarget is null) + projectile.velocity = Vector2.Lerp(projectile.velocity, -Vector2.UnitY * 10f, 0.06f); + else + { + projectile.spriteDirection = (potentialTarget.Center.X > projectile.Center.X).ToDirectionInt(); + projectile.velocity = projectile.velocity.MoveTowards(projectile.SafeDirectionTo(potentialTarget.Center) * 18.5f, 3f); + if (projectile.Hitbox.Intersects(potentialTarget.Hitbox)) + { + projectile.Damage(); + projectile.Kill(); + } + } + } + } + + public override void Kill(int timeLeft) + { + for (int i = 0; i < 40; i++) + { + Dust explosion = Dust.NewDustDirect(projectile.position, projectile.width, projectile.height, 267); + explosion.velocity = Main.rand.NextVector2Circular(4f, 4f); + explosion.color = Color.Red; + explosion.scale = 1.35f; + explosion.fadeIn = 0.45f; + explosion.noGravity = true; + } + } + + public override bool CanDamage() => projectile.Opacity >= 1f; + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) => damage = Main.rand.Next(60, 70); + } +} diff --git a/Projectiles/Typeless/SuicideBomberDemon.png b/Projectiles/Typeless/SuicideBomberDemon.png new file mode 100644 index 0000000000000000000000000000000000000000..bd3a5924ca1b3036a565056b45c1f0e1bb7af3cb GIT binary patch literal 8180 zcma)hcT^MGzwZDVEEJKWbU1(%m7dU~SrAm32c)+k5K3r*^b!p*26|4#rAs=Tdz?Oss!at;b@Gvwcidp@)Iv9e|6 ziS*W~VIGij7FY~>zVm)`weJ4t5@YY+;*I(~R9!0&mcJVg( zlK2Hl_v@mcgc97Vos+noSf;*2tHAXagee2j_AN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XGAsdJ2J>&h#gLXG)rOBNZ61hi<#o&=D6Aph^xC%Pvrp z&s2%OT+4DjDi%?LCNSMdYobbg*AgSZSu@VDl=I$FU#(u zDh)yA*t^>@Xr~JyF&XkkP)($ubpQN3rEUjI^pD-;eK+u<>BC`HsGy@PhI{hDb;>L# zxi(Z}5rpgWr@7;RnGqjxL9RT&Y&tFmqe-1V-EpwVT~q9{C5`jyP4A=HjkZjL9t`C) z0k81Ve@!}T)a~j4ck=jo3F!u24PF@u3z^rTjSozp6hDvQm|+w1own9~T8@}^U6Dy5r@a4_Wmfpr zPB*}ceqRYvBBJBuOS)P)ryu`b8*1J6-ZWzwl26;BJA^V+lUV}eT}$W-@$NAPg3W8^ z(@sYRV2rP?pIy4wZ6(*A6Zq?)F9rP41Rt;DOQRSV`8nHN){ifmch=Z@myTs?J1nLBK^7LEkp=nDF6K>Fu>ZCC8Su!M)&JMo9Nh5XUifUp0<4x zklX4@540I}DC6I*c@`Za{W38SB=D;dxB_})Xed9r4@-!h*8B={^O{;XB%?skqvsAm z@~O3LylxotKJ5iMJO=cLz?!A5XNn`aon2`kN~_Y85!H_vYx*XJ0weDJzxsAOn#LR# YQsVCWs`)Ya86UWP(@?weI{fkf0p%a}O#lD@ literal 0 HcmV?d00001 diff --git a/UI/CalamitasEnchantments/EnchantmentManager.cs b/UI/CalamitasEnchantments/EnchantmentManager.cs index aa03ce8d81..6a1502f4c6 100644 --- a/UI/CalamitasEnchantments/EnchantmentManager.cs +++ b/UI/CalamitasEnchantments/EnchantmentManager.cs @@ -230,6 +230,12 @@ namespace CalamityMod.UI.CalamitasEnchants null, player => player.Calamity().witheringWeaponEnchant = true, item => item.damage > 0 && item.maxStack == 1 && !item.summon), + + new Enchantment("Persecuted", "You attract portals which summon demons on hit. The portal must be brought close to death or the demons will attack you. Otherwise they attack enemies.", + 1100, + null, + player => player.Calamity().persecutedEnchant = true, + item => item.damage > 0 && item.maxStack == 1 && item.shoot > ProjectileID.None), }; // Special disenchantment thing. This is separated from the list on purpose. diff --git a/Utilities/DrawingUtils.cs b/Utilities/DrawingUtils.cs index 697e5f7931..a3eefd6d7e 100644 --- a/Utilities/DrawingUtils.cs +++ b/Utilities/DrawingUtils.cs @@ -112,6 +112,17 @@ namespace CalamityMod } } + /// + /// Sets a 's arbitrarily. + /// + /// The sprite batch. + /// The blend state to use. + public static void SetBlendState(this SpriteBatch spriteBatch, BlendState blendState) + { + spriteBatch.End(); + spriteBatch.Begin(SpriteSortMode.Immediate, blendState, Main.DefaultSamplerState, DepthStencilState.None, RasterizerState.CullCounterClockwise, null, Main.GameViewMatrix.TransformationMatrix); + } + // Used for bullets. This lets you draw afterimages while keeping the hitbox at the front of the projectile. // This supports type 0 and type 2 afterimages. Vanilla bullets never have type 2 afterimages. public static void DrawAfterimagesFromEdge(Projectile proj, int mode, Color lightColor, Texture2D texture = null) From a3e5bebe411ffaae7cfd8ade642f06e63b16098d Mon Sep 17 00:00:00 2001 From: Dominic Date: Tue, 15 Jun 2021 12:26:44 -0500 Subject: [PATCH 133/202] Enchantment icons --- CalPlayer/CalamityPlayer.cs | 2 + CalPlayer/CalamityPlayerMiscEffects.cs | 14 ++++ ExtraTextures/UI/CalamitasCurseBackground.png | Bin 3317 -> 3403 bytes .../EnchantmentSymbols/CurseIcon_Aflame.png | Bin 0 -> 308 bytes .../CurseIcon_Bloodthirsty.png | Bin 0 -> 295 bytes .../CurseIcon_Capricious.png | Bin 0 -> 277 bytes .../CurseIcon_Ephemeral.png | Bin 0 -> 300 bytes .../EnchantmentSymbols/CurseIcon_Erratic.png | Bin 0 -> 270 bytes .../EnchantmentSymbols/CurseIcon_Evasive.png | Bin 0 -> 246 bytes .../CurseIcon_Evocative.png | Bin 0 -> 314 bytes .../EnchantmentSymbols/CurseIcon_Exhumed.png | Bin 0 -> 819 bytes .../CurseIcon_Hellbound.png | Bin 0 -> 309 bytes .../EnchantmentSymbols/CurseIcon_Incisive.png | Bin 0 -> 334 bytes .../CurseIcon_Indignant.png | Bin 0 -> 302 bytes .../CurseIcon_Lecherous.png | Bin 0 -> 294 bytes .../EnchantmentSymbols/CurseIcon_Oblatory.png | Bin 0 -> 303 bytes .../CurseIcon_Obstinate.png | Bin 0 -> 289 bytes .../CurseIcon_Persecuted.png | Bin 0 -> 281 bytes .../EnchantmentSymbols/CurseIcon_Polluted.png | Bin 0 -> 341 bytes .../CurseIcon_Relentless.png | Bin 0 -> 287 bytes .../CurseIcon_Resentful.png | Bin 0 -> 285 bytes .../CurseIcon_Splintered.png | Bin 0 -> 316 bytes .../EnchantmentSymbols/CurseIcon_Tainted.png | Bin 0 -> 290 bytes .../CurseIcon_Traitorous.png | Bin 0 -> 334 bytes .../CurseIcon_Vindictive.png | Bin 0 -> 303 bytes .../EnchantmentSymbols/CurseIcon_Withered.png | Bin 0 -> 301 bytes .../CalamitasEnchantUI.cs | 38 ++++++++--- UI/CalamitasEnchantments/Enchantment.cs | 10 ++- .../EnchantmentManager.cs | 64 ++++++++++++------ 29 files changed, 96 insertions(+), 32 deletions(-) create mode 100644 ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Aflame.png create mode 100644 ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Bloodthirsty.png create mode 100644 ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Capricious.png create mode 100644 ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Ephemeral.png create mode 100644 ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Erratic.png create mode 100644 ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Evasive.png create mode 100644 ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Evocative.png create mode 100644 ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Exhumed.png create mode 100644 ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Hellbound.png create mode 100644 ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Incisive.png create mode 100644 ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Indignant.png create mode 100644 ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Lecherous.png create mode 100644 ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Oblatory.png create mode 100644 ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Obstinate.png create mode 100644 ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Persecuted.png create mode 100644 ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Polluted.png create mode 100644 ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Relentless.png create mode 100644 ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Resentful.png create mode 100644 ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Splintered.png create mode 100644 ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Tainted.png create mode 100644 ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Traitorous.png create mode 100644 ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Vindictive.png create mode 100644 ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Withered.png diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 1467e28ea8..69914b73ed 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -1024,6 +1024,7 @@ namespace CalamityMod.CalPlayer public int witheredWeaponHoldTime = 0; public bool persecutedEnchant = false; + public int persecutedEnchantSummonTimer = 0; #endregion Calamitas Enchant Effects #endregion @@ -2427,6 +2428,7 @@ namespace CalamityMod.CalPlayer animusBoost = 1f; potionTimer = 0; bloodflareCoreLostDefense = 0; + persecutedEnchantSummonTimer = 0; if (BossRushEvent.BossRushActive) { diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 2af4eb10fa..5f766fba27 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -22,6 +22,7 @@ using CalamityMod.NPCs.AcidRain; using CalamityMod.NPCs.Astral; using CalamityMod.NPCs.Crags; using CalamityMod.NPCs.NormalNPCs; +using CalamityMod.NPCs.Other; using CalamityMod.NPCs.SupremeCalamitas; using CalamityMod.Projectiles.Boss; using CalamityMod.Projectiles.Environment; @@ -1180,6 +1181,19 @@ namespace CalamityMod.CalPlayer modPlayer.aBulwarkRareTimer--; if (modPlayer.hellbornBoost > 0) modPlayer.hellbornBoost--; + if (modPlayer.persecutedEnchantSummonTimer < 1800) + modPlayer.persecutedEnchantSummonTimer++; + else + { + modPlayer.persecutedEnchantSummonTimer = 0; + if (Main.myPlayer == player.whoAmI && player.Calamity().persecutedEnchant && NPC.CountNPCS(ModContent.NPCType()) < 2) + { + Vector2 spawnPosition = player.Center + Main.rand.NextVector2Unit() * Main.rand.NextFloat(270f, 420f); + int portal = NPC.NewNPC((int)spawnPosition.X, (int)spawnPosition.Y, ModContent.NPCType()); + if (Main.npc.IndexInRange(portal)) + Main.npc[portal].target = player.whoAmI; + } + } if (player.miscCounter % 20 == 0) modPlayer.canFireAtaxiaRangedProjectile = true; if (player.miscCounter % 100 == 0) diff --git a/ExtraTextures/UI/CalamitasCurseBackground.png b/ExtraTextures/UI/CalamitasCurseBackground.png index f6c3ca7fd26bc2e3bbe1e0186c6945ac359ca6df..29555271c1f6e2758c26afaad47b5655305bf5b3 100644 GIT binary patch delta 2329 zcmbtWYc!PY8XjX}90uc zIb<41h?$A_IxRUwDu?V&n=(48ls&t>f9$pPpKq=G=ULBvt?SQy-Oqhp&*ugAjLE3q zru76(V@(VOL-6v1127mBM0uaYt18bexw1(y*$2n(@`Bxhcwz5~3860>^^XqdT3>8D z(O=9g{x;`&>fN6=#q&124LPfoGW^d45 zsrRY!JFBHb>hXzz1w}qvhA;*tAz90+Ky6>aTFk;x3~H3Atn!d+SnoA=; zIR3S@?!cn-rvs{wZ}0DjO`Xz88J{_nIkN=HkREERZOoZE9IYYA~r+}=RP9uLZuD&^ICu>Z*&JS|`iw$}j)QYpQNuCY=lTHY!8`dN?9BJb2T ztb)GoQ$3Bi@hOI~`8#+gM=$A@*aR;3NfjU94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nchantmentSymbols/CurseIcon_Aflame.png new file mode 100644 index 0000000000000000000000000000000000000000..8d8c0b27ec38a0dcaea586ff1a7419d318b08627 GIT binary patch literal 308 zcmV-40n7f0P)Px#?ny*JR9J=Wm`M(UFbqXMRnO5C_diirT!gNorp8kS651ZLW~lV1;BtssK~W z6~Y@7>!4M~7%bClf2$sbH+YFbC3}0#N$t&949IA(Vl?KY`%PJ%+Tf5mnw?T?)480I z&tS)@q^YhkPx#;Ymb6R9J=Wm^%`~APfZ`nViE_?tdazxrkFS!)T-@VTzzc+qeK^SbnmBq9}6H zq7_dZR?)Tct{2|4(IXiAYq$m#bJAFJ7HB)m7<}%fJw)*T2M*&Oly+1Gmh{ za$=H_+8`aFVuscWm{iwdYJ(E*yi?a|H%3fSe##&Kf7cF#&N+|m4ORzNneO0;!`guj zi|b8edxJB(SlyN6hEP%L=gwx#-VY;P%4U>!GHzpWwl_F^lR%7Invo_va~|6pjI6Px#&q+i6kO!VlE95&EzQ6eY7v&&mb$xdPkZ};`t~;d5<@!R#W*4 zs|F2ougKGSkN7u8Monh%CgUyEF-WW?Tkoyr$a)6Jgh>El@SoW^X=QzbPx#=1D|BR9J=Wn86OiAP9!pvghb&@Bc(Q^+mc9i8_QI>r%9SC({Jdei6YEEf&}E z@CJNn~{deh$cN;%IiS^h{*gJRCJCU0p_%*`f~c#+chJO+g?uT`;H-B$c?244*^ zmZ8$*QF#tAr9l+SB*ZNZTGcI@taY652CMr)Iq_W`1c+Bnj%N_)7-kNlUlWc_l*NZP zC{;0f(!1t9VVZ%edq{&NY7a#xW@`>i$V?7t&^=|R0H&b33=`gPx#$Vo&&R9J=WmOBoGFbo72^v*%W{ZB;oE&^4gVC7?*M4(Nkfd&I3FDx*byvt&} z;J_A6&(f?Nf9E6JS({AhNK1ponO>uxH~4EXLmEr&W@H|K-YAbjX`q10s1_cB5y|w* zor;VHW2ZQ(Oi~(5QrOYl_fo|;22nR<{%Zkb26KkGmk07*qoM6N<$f}&e+2mk;8 literal 0 HcmV?d00001 diff --git a/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Evasive.png b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Evasive.png new file mode 100644 index 0000000000000000000000000000000000000000..3969952ddca0e49467adcdb37c68a23195e492c5 GIT binary patch literal 246 zcmeAS@N?(olHy`uVBq!ia0vp^8X(NU1|)m_?Z^dEjKx9jP7LeL$-D$|Hh8)?hD5Z! zo$e^)U?9LU{S%-1|N4oO`wP58qs?ZzOzHKJSMD$~bZrrE`jw_(TR1h6|E=oxn3Qfm zxsR%~heIAp-I`OU{p&~GncYjdn;B1gNVpqU9o*}v_dzp_Eq`CJ=9;^aQ}#OSX7gXd z^CGtETzf(Og_>ER&+fFHI4gJM?<4;ET=B30J)vP)78&qol`;+0JZ*Lj{pDw literal 0 HcmV?d00001 diff --git a/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Evocative.png b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Evocative.png new file mode 100644 index 0000000000000000000000000000000000000000..588a10e3b0cdd9f1ed53e1eb80539a85cc5fec3e GIT binary patch literal 314 zcmV-A0mc4_P)Px#^hrcPR9J=Wmq8N3FbGAd<2kzW{wM0ni_}$|gb9J4;uOZbmDYqw-T+df#o}Hz zbi+Y=`FPebUi5Z4Qp@8fQ5|tR;6ZzB*NyN7%{kbybF%NI>)<{w1^t?KXw#T*=%vsN)@Do67gtkBFz{6`-YZwX8$P!&r^ z)t%4a#7t*3DCP2S3JP!VTgAZCQkXTSt!v`uF<61lb^Ld9KVRSEbSi_xoAW+}zM~lS zcS&V%2r%6Ya}MpZsSTo2j8x4V5!7e%_Cc+majgCEQk?Jx7mK_30E7oIAM!#nd;kCd M07*qoM6N<$f>IWXK>z>% literal 0 HcmV?d00001 diff --git a/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Exhumed.png b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Exhumed.png new file mode 100644 index 0000000000000000000000000000000000000000..584bd628816ff3ca8333a87b1dcb3b413cede037 GIT binary patch literal 819 zcmV-31I+x1P)Px%?MXyIR9J=Wn9ojAK@^9-p<1Z5N(-coO&6v>aiM{*(}WdDG;!g=cW^~qkl-V@ zU}0SO79{R~xN~I;MiV0t{D(qH0E-la7U;N`OzlkP-j--$ukp9JnYm}q%zXFEnYjc1 z^?MS{8a_-dIO`we2LPDAR`*^41sp&e_-O`?`8xk}Xg0l+Qb3X6Z~s09+YV z=+cQ004vYG7tF{ci6AX_ka-)+equu_Dav4fi1iMhHC%-002ovPDHLkV1gm|e~AD9 literal 0 HcmV?d00001 diff --git a/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Hellbound.png b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Hellbound.png new file mode 100644 index 0000000000000000000000000000000000000000..96b2a87a02d4ed345067c7ecd10ac95eba73108b GIT binary patch literal 309 zcmeAS@N?(olHy`uVBq!ia0vp^8X(NU1|)m_?Z^dEjKx9jP7LeL$-D$|-g~+@hD5Z! zo#DvWY{0{Ech&nBEC1IA`qwO(qr-YS?lxy`=Tu8YM<$-^B!#G+!qa>emnWOsPqd8R zlImahz|Q0sd(Gj5ti1CDvdz7gZM;#%C6d$J^z%PlG;}jPUVd-Jw=-?`m_AE~Y$|t1 zJGROzK`gDbu9-J3)M-iN(~~P^>ZS@LrJ5%21szg26Ias8c-+xTVhe{P$BgE`4xG(# z$CGFJ>@{C2x}wEVZK`Z){dKR9LkVWd({6tG&L1e)d{e6}ZS(z;pQTyuc7$Jb{;O=f z-%;)M@xb(}Uaur_8g5Geovo^w8Spfx_{>w@b=)z3X3H)#H;LexwFTsL22WQ%mvv4F FO#r4yeJ}t3 literal 0 HcmV?d00001 diff --git a/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Incisive.png b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Incisive.png new file mode 100644 index 0000000000000000000000000000000000000000..fe9459ec6135b8c6b7a8cd9d72eb5d01f8baf6c7 GIT binary patch literal 334 zcmV-U0kQsxP)Px$2uVaiR9J=WmrD-9Fbo9^;vB5F|A|=jBCv{-SpGblB5agdL7N6Ld2v#r&1YP+ z8&A5wqR-4c=t%t`&h?aDzDUMkx=#tubZdj-W7cHqx4F^s25&%{F;Z?4&6+j?P?hLw zaAaZ1qKVPoGd)a-?fM!N;8|QoE|^>H3x=WUP~IS1^^KA9KG4-JX74ZSAV;fYvG&skS?bWe_qEIC-bC*xI1CO1)JWs)t$@`x+Fog&IN4LNij{;HmqjMBpt> gJRg=fxY_)gH?1N_L8CDWXaE2J07*qoM6N<$f)z}a$p8QV literal 0 HcmV?d00001 diff --git a/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Indignant.png b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Indignant.png new file mode 100644 index 0000000000000000000000000000000000000000..526223131ed6dbf436984aa240f4ab0b60f43162 GIT binary patch literal 302 zcmV+}0nz@6P)Px#=t)FDR9J=Wmq8N4AP7Z&J3U8Nx&Mi}%0<$Z9YRGxnTD!wlSKm2Hz*1$7T0p~ zO7z0B_Q_Ei!-hTk^4>nA-|(;o^qR5~-k^F`8FP}UVs5F{B*Ggs*C32FW;Mnc(jez# zuGbi63WEUr%_YJc^wE0aP;9_w#Z#Ob4TJl60oneEP)Px#;7LS5R9J=Wmq`x8APhx+s-7dO-v2~h^&;)c61d-BP*h>+x5Ny|!%RSuB*}ks zSb--_UG$#q3jiK?IX|i9Hr48feEs!=xuG${BpIiQ3(Fh4H)7h{p~{;%SJbQOH)e?T z7t)|*t_jI4ZQNyE+Dm^S4GP{I>(%p`q%#-NU~k{jMsyr3PO#$D_{$q~tv=KZf>!PXBnQAR=ceYj-JiB9f1Blae0HY`NCGS)fbI>Z`jKl?B<|#^L0S?$Px#=}AOER9J=Wm`e`AFbqVeh;y*w{wHG9i@?f)ME(+^)*)}jA`R_hCRha)V{F!f z2X6H7$z6NLo_tF!m!IyQz;$$k55o;vX6qT0j4B+Oh#sAmwenL{XPu!l0mo`Vur zmc1=6X>hcKR)#m=ZP+qd&tU&Vj&m{EdRp)LrRo_}=-V7>HM8Djvc5seq>{zPz!w=- zsc%qW)ZG8In8jf(+V+O|4Juhv%}qVcc#-}IQp^#jH|TDZ(oV}D`(4vyFg!go?`oty zQcRxS;P5#}FjJ3rKAe0WjACUfU>HCFgNwz{ya4nqGGa93rI-K!002ovPDHLkV1g8i Bgk=B# literal 0 HcmV?d00001 diff --git a/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Obstinate.png b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Obstinate.png new file mode 100644 index 0000000000000000000000000000000000000000..41a740b38771f711bae0c946055c5ba2b0fd3a66 GIT binary patch literal 289 zcmV++0p9+JP)Px#+et)0R9J=Wmq8AMAPhx|nRBq3`=7{_7nxZ#0i@-F7_sn{h)7=Gw-PND&*JV{ zcqcDC`i0;A(xI-i_1n@te0nVe7;9o4g8`_q=qyT1X)raC8g;^WmU#?vo+-DvDRb=@ zRLn?R%0K4)1~cZmm?7{?zTaSglxL-R={VHIFs2MLkvS#*)QZ9Lr|Ji@=1TMEY!d2X z7!wAe+b4}TRG^6A4OVY(Cx6*W4Z|C3sU(i5oMXK#n=q*67+?ym;aN-=l&I|s(Ml9y n%3$e#7kUph#|&?9v3Qz4B&jV?Mun_f00000NkvXXu0mjfvf+7? literal 0 HcmV?d00001 diff --git a/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Persecuted.png b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Persecuted.png new file mode 100644 index 0000000000000000000000000000000000000000..d4999cd4adef288907f7baf1210cf18255b3375a GIT binary patch literal 281 zcmV+!0p|XRP)Px#(@8`@R9J=Wm_ZJNAPhz8#B;cs`=4l5bCGdH;xu6UZHf59TM{ksY!MKd#8|Qe zeq_^4zhhr-`9kqt@genP%?fm4E(E{9UgiqJ8@yb_4s(lY|LePx$4@pEpR9J=Wm`x6ZAPh#!WX|Dg?tdazUWD096KOvBBTNG5+h}4z^U^|*=%I~d z1?;r(ZAN21baeitlGk5n@4<f|FrLtKs1dMskpmx#*hvs>yi`D!B!#S&3^hIiJA` zIajQQ%6QeJ9LLY6HfZIVYQ}34kbm6-7>v8blm;2gq>Ph9`%1|0278=~L+@DsTwEhi nwaiWbEVR=5kL>UUA6oeW06|Gaftp%w00000NkvXXu0mjfbkdpI literal 0 HcmV?d00001 diff --git a/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Relentless.png b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Relentless.png new file mode 100644 index 0000000000000000000000000000000000000000..df19b8d4c1994064a898f9f1cc1c0d07760997f1 GIT binary patch literal 287 zcmV+)0pR|LP)Px#*-1n}R9J=Wm_ZK1APfYZs_)1t|9??W`AB+-idJB+6VzhrxrKm0qXnFZBuNsR z#XI07t9Qtu&AG|04t{uN`!-LuW5t|mMtOh0v&uXM3(yRXEpU_FoiB#r4br(OZW8MTL8$YwWq){s&0XxMTB!4n=vOry*P!rbkXF`Q zRm@3fg9uyiiO6SHDs|*i_G=N^AY0d6%_>D)gH|@IZ1p0p!Mj}eey%c~!QOusEao#< lz?!MHv(@+T29xC1ya8;GBwXoCI8p!r002ovPDHLkV1nEGe(C@K literal 0 HcmV?d00001 diff --git a/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Resentful.png b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Resentful.png new file mode 100644 index 0000000000000000000000000000000000000000..6259357bb1e2546cdd4fd349dcbcfe8b775871ab GIT binary patch literal 285 zcmV+&0pk9NP)Px#*GWV{R9J=Wm`xIcFbGDe<2kzW{wH$fMeHgwEd%nA#5Sb7t>nj-M2JL5lEmg= z1?=?H9-TFPZ**8gez3Tre}HOGFlQNajfI+=!eB9H?pGEMjcJ)2-rx$vKyUnJyu@oJ zT`MxYL3CfiI8HybGXH0=AbbTb=MdIlPOz1nU@K}S;omc~`naectB7lmSk5eFfLzSm zYs`_0k!nUX3B*H$uLnI9^{r!u&BdOIy6de@=ub2|yuq*kSTbWCcH(;?T2doS!M jzVlY+y8nhXn6&Z&iViO~@sRyX00000NkvXXu0mjfL+^b) literal 0 HcmV?d00001 diff --git a/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Splintered.png b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Splintered.png new file mode 100644 index 0000000000000000000000000000000000000000..0f75aff9d7fc72c7365a0394714dd8a2b940bec3 GIT binary patch literal 316 zcmV-C0mJ@@P)Px#_DMuRR9J=Wm^}`IFbqaNs-A<1`=5x3i=>k!aO2nx5w)wlg&{v8FOD4mCX-2S zmQfS!Sgl=4t8v3|d8b$J3q8f#+HsVj2G!lnXV75EYedl)1_#t)Q|;Bv5#bHCPO&u)S}RM}?LDH;SEkEzvcrH-7iY9g-9L% O0000Px#+(|@1R9J=Wm`e`BAPfafm2-5J`=6+*T!gMHwU)6T&?*>tHj%=AWJ3s1k|ePy zUWFGuTSawdjFT>?@dF&>Hkt+%bJCb+zh(HVoo8|jgQhuY05A{r!z^#`Fv_~j$@d>7 zxt;8sKb1H~9Ano^-+1HPYZL%TLhCVm0eHE77 o@&<=ir2+iIDMTA)agyB48%A3*T`w|$2mk;807*qoM6N<$f*gx?i~s-t literal 0 HcmV?d00001 diff --git a/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Traitorous.png b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Traitorous.png new file mode 100644 index 0000000000000000000000000000000000000000..9a7f8c7cecbd50c96ce6c2af5d8d4fa1699b6ddf GIT binary patch literal 334 zcmV-U0kQsxP)Px$2uVaiR9J=Wm`e_XAP@!HiRW;|{ZHhIi!iHB6nIVZancOdMnfV(!4rh&rH^e? zMJFA68>DwQ@>TVI+MDzno@n4kcWZ%Ct7_IU=*U;kFAe4mHmCTKTEvhv|DVB(x!QzQ znKW;3j|*Z$LJyI-(x~urs?jrVFzLlfhqi}RDJ`WQjg)zV$sD|ZOg4SrxIDA#5l3oD zgWRJKT}7T)hlwUN$iyZ^cy1w+inTk7d4n)Py}K2~bE@>uYY-v)y`egh>07xYpKXhI zgHno1AX6o?Rr^Qt2D?ud8q%J9_c|#?DAFyqVOoPdDb`Z@E{ZH^ur#mHesj*1WLS!| gpp%Jd*W#C6zC{i^Uk+RXdjJ3c07*qoM6N<$f}m55!~g&Q literal 0 HcmV?d00001 diff --git a/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Vindictive.png b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Vindictive.png new file mode 100644 index 0000000000000000000000000000000000000000..3a768a4e8e59eb37aa990585cc5e87d32e36af8e GIT binary patch literal 303 zcmV+~0nq-5P)Px#=}AOER9J=Wn86OiAP9!pvgg=o@Bc(Q?M1p1iT*(pu!$1COWU-i<_n0H=n&&! zec?-QKE0$^ANmD{RP&q~?FL@60~UrwtcFt?zrli*G0erv zTy$PcWzdyVn8WGj!ALJ=dey9ct7kNi!2xrlu}syzyg^SVQO&hX6misf6WQNjfy*4; zx0+04kO}o#!K6wGgJP$cy?bl1yumZTDDGVySD`f*N2`}fX|S64M@=d{J%2C8o=I@6 znhdPKi71Id#$-~!wE|z>U}R5%xc=2_zpFb$`2$loIaNqEAKw4~002ovPDHLkV1ipM Bhp+$u literal 0 HcmV?d00001 diff --git a/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Withered.png b/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Withered.png new file mode 100644 index 0000000000000000000000000000000000000000..fd200486135311cd3ff5e68f4c0c37070304f99d GIT binary patch literal 301 zcmV+|0n+}7P)Px#=Sf6CR9J=Wm`e`BAPhvORnO5??|-7MdXaSHiV|#Ws0t(bZL&at@HFNVAW7D8 z(Hfq(YfZ;5#(3c6dife0?C+dr*Dx0~78a(ja}qfIlX=C;F8Jzf25Z}2kNGNV<0k!jbCMP<-sXmn2=SPcL$8El+7LMPvvz^#z`G!wbi z&E7@KZ=gL7 literal 0 HcmV?d00001 diff --git a/UI/CalamitasEnchantments/CalamitasEnchantUI.cs b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs index 5abf79f364..e4434c1263 100644 --- a/UI/CalamitasEnchantments/CalamitasEnchantUI.cs +++ b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs @@ -22,7 +22,7 @@ namespace CalamityMod.UI.CalamitasEnchants public static bool CurrentlyViewing = false; - public static readonly Vector2 ReforgeUITopLeft = new Vector2(28f, 245f); + public static readonly Vector2 ReforgeUITopLeft = new Vector2(68f, 320f); public static readonly float ResolutionRatio = Main.screenHeight / 1440f; public static Rectangle MouseScreenArea => Utils.CenteredRectangle(Main.MouseScreen, Vector2.One * 2f); @@ -87,10 +87,6 @@ namespace CalamityMod.UI.CalamitasEnchants // Draw the background. spriteBatch.Draw(backgroundTexture, ReforgeUITopLeft, null, Color.White, 0f, Vector2.Zero, backgroundScale, SpriteEffects.None, 0f); - // Draw the item icon. - Vector2 itemSlotDrawPosition = ReforgeUITopLeft + new Vector2(30f, 50f) * backgroundScale; - Vector2 reforgeIconDrawPosition = ReforgeUITopLeft + new Vector2(88f, 60f) * backgroundScale; - // Prevent the player from say, firing a weapon while the mouse is hovering over the UI. DisableMouseWhenOverUI(backgroundTexture, backgroundScale); @@ -104,11 +100,20 @@ namespace CalamityMod.UI.CalamitasEnchants Point costDrawPositionTopLeft = (ReforgeUITopLeft + new Vector2(50f, 78f) * backgroundScale).ToPoint(); cost = DrawEnchantmentCost(spriteBatch, costDrawPositionTopLeft); Point descriptionDrawPositionTopLeft = costDrawPositionTopLeft; - descriptionDrawPositionTopLeft.Y += 90; + descriptionDrawPositionTopLeft.Y += 70; + Vector2 iconDrawPositionTopLeft = costDrawPositionTopLeft.ToVector2() + new Vector2(270f, -24f); DrawEnchantmentDescription(spriteBatch, descriptionDrawPositionTopLeft); + if (!string.IsNullOrEmpty(SelectedEnchantment.Value.IconTexturePath)) + { + Texture2D iconTexture = ModContent.GetTexture(SelectedEnchantment.Value.IconTexturePath); + DrawIcon(spriteBatch, iconDrawPositionTopLeft, iconTexture); + } } + // Draw the item icon. + Vector2 itemSlotDrawPosition = ReforgeUITopLeft + new Vector2(30f, 50f) * backgroundScale; + Vector2 reforgeIconDrawPosition = ReforgeUITopLeft + new Vector2(84f, 60f) * backgroundScale; DrawItemIcon(spriteBatch, itemSlotDrawPosition, reforgeIconDrawPosition, backgroundScale, out bool isHoveringOverItemIcon, out bool isHoveringOverReforgeIcon); if (isHoveringOverItemIcon) InteractWithItemSlot(); @@ -167,7 +172,18 @@ namespace CalamityMod.UI.CalamitasEnchants if (SelectedEnchantment.HasValue && SelectedEnchantment.Value.Name == EnchantmentManager.UpgradeEnchantName) cost = (int)MathHelper.Min(cost, Item.buyPrice(5)) * 5; - ItemSlot.DrawMoney(spriteBatch, "Cost: ", costDrawPositionTopLeft.X, costDrawPositionTopLeft.Y, Utils.CoinsSplit(cost)); + // Draw the coin costs. + string costText = "Cost: "; + Utils.DrawBorderStringFourWay(spriteBatch, Main.fontMouseText, costText, costDrawPositionTopLeft.X, costDrawPositionTopLeft.Y + 45f, Color.White * (Main.mouseTextColor / 255f), Color.Black, Vector2.Zero); + costDrawPositionTopLeft.X += (int)(Main.fontMouseText.MeasureString(costText).X * 0.5f + 12f); + + int[] coinsArray = Utils.CoinsSplit(cost); + for (int i = 0; i < 4; i++) + { + Vector2 drawPosition = new Vector2(costDrawPositionTopLeft.X + ChatManager.GetStringSize(Main.fontMouseText, costText, Vector2.One, -1f).X + (24 * i) - 24f, costDrawPositionTopLeft.Y + 54f); + spriteBatch.Draw(Main.itemTexture[ItemID.PlatinumCoin - i], drawPosition, null, Color.White, 0f, Main.itemTexture[ItemID.PlatinumCoin - i].Size() * 0.5f, 1f, SpriteEffects.None, 0f); + Utils.DrawBorderStringFourWay(spriteBatch, Main.fontItemStack, coinsArray[3 - i].ToString(), drawPosition.X - 11f, drawPosition.Y, Color.White, Color.Black, new Vector2(0.3f), 0.75f); + } return cost; } @@ -176,7 +192,7 @@ namespace CalamityMod.UI.CalamitasEnchants { Vector2 vectorDrawPosition = descriptionDrawPositionTopLeft.ToVector2(); Vector2 scale = new Vector2(0.67f, 0.7f) * MathHelper.Clamp(ResolutionRatio, 0.825f, 1f); - foreach (string line in Utils.WordwrapString(SelectedEnchantment.Value.Description, Main.fontMouseText, 400, 10, out _)) + foreach (string line in Utils.WordwrapString(SelectedEnchantment.Value.Description, Main.fontMouseText, 465, 10, out _)) { if (string.IsNullOrEmpty(line)) continue; @@ -186,6 +202,11 @@ namespace CalamityMod.UI.CalamitasEnchants } } + public static void DrawIcon(SpriteBatch spriteBatch, Vector2 drawPositionTopLeft, Texture2D texture) + { + spriteBatch.Draw(texture, drawPositionTopLeft, null, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + } + public static void DrawItemIcon(SpriteBatch spriteBatch, Vector2 itemSlotDrawPosition, Vector2 reforgeIconDrawPosition, Vector2 scale, out bool isHoveringOverItemIcon, out bool isHoveringOverReforgeIcon) { isHoveringOverReforgeIcon = false; @@ -261,6 +282,7 @@ namespace CalamityMod.UI.CalamitasEnchants // Attempt to exchange if the slot is clicked. if (Main.mouseLeftRelease && Main.mouseLeft && (Main.mouseItem.CanBeEnchantedBySomething() || Main.mouseItem.IsAir)) { + EnchantIndex = 0; Utils.Swap(ref Main.mouseItem, ref CurrentlyHeldItem); Main.PlaySound(SoundID.Grab); } diff --git a/UI/CalamitasEnchantments/Enchantment.cs b/UI/CalamitasEnchantments/Enchantment.cs index e098ecb163..e24f411e0e 100644 --- a/UI/CalamitasEnchantments/Enchantment.cs +++ b/UI/CalamitasEnchantments/Enchantment.cs @@ -7,6 +7,7 @@ namespace CalamityMod.UI.CalamitasEnchants { public string Name; public string Description; + public string IconTexturePath; public Action CreationEffect; public Action HoldEffect; @@ -15,7 +16,7 @@ namespace CalamityMod.UI.CalamitasEnchants // This is internal because CanBeAppliedTo should be used over this field directly. // Using that has the benefit of null checks and is objectively superior to using the raw delegate. internal Predicate ApplyRequirement; - public Enchantment(string name, string description, int id, Action creationEffect, Action holdEffect, Predicate requirement) + public Enchantment(string name, string description, int id, string iconTexturePath, Action creationEffect, Action holdEffect, Predicate requirement) { Name = name; Description = description; @@ -23,8 +24,9 @@ namespace CalamityMod.UI.CalamitasEnchants HoldEffect = holdEffect; ApplyRequirement = requirement; ID = id; + IconTexturePath = iconTexturePath; } - public Enchantment(string name, string description, int id, Action holdEffect, Predicate requirement) + public Enchantment(string name, string description, int id, string iconTexturePath, Action holdEffect, Predicate requirement) { Name = name; Description = description; @@ -32,8 +34,9 @@ namespace CalamityMod.UI.CalamitasEnchants HoldEffect = holdEffect; ApplyRequirement = requirement; ID = id; + IconTexturePath = iconTexturePath; } - public Enchantment(string name, string description, int id, Action creationEffect, Predicate requirement) + public Enchantment(string name, string description, int id, string iconTexturePath, Action creationEffect, Predicate requirement) { Name = name; Description = description; @@ -41,6 +44,7 @@ namespace CalamityMod.UI.CalamitasEnchants HoldEffect = null; ApplyRequirement = requirement; ID = id; + IconTexturePath = iconTexturePath; } public bool CanBeAppliedTo(Item item) diff --git a/UI/CalamitasEnchantments/EnchantmentManager.cs b/UI/CalamitasEnchantments/EnchantmentManager.cs index 6a1502f4c6..ba3dddd99c 100644 --- a/UI/CalamitasEnchantments/EnchantmentManager.cs +++ b/UI/CalamitasEnchantments/EnchantmentManager.cs @@ -58,14 +58,15 @@ namespace CalamityMod.UI.CalamitasEnchants public static void ConstructFromModcall(IEnumerable parameters) { int secondaryArgumentCount = parameters.Count(); - if (secondaryArgumentCount < 4) + if (secondaryArgumentCount < 5) throw new ArgumentNullException("ERROR: A minimum of 4 arguments must be supplied to this command; a name, a description, an id, and a requirement predicate."); - if (secondaryArgumentCount > 6) + if (secondaryArgumentCount > 7) throw new ArgumentNullException("ERROR: A maximum of 6 arguments can be supplied to this command."); string name = string.Empty; string description = string.Empty; int id = -1; + string iconTexturePath = null; Predicate requirement = null; Action creationEffect = null; Action holdEffect = null; @@ -94,33 +95,39 @@ namespace CalamityMod.UI.CalamitasEnchants else throw new ArgumentException("The fourth argument to this command must be an Item Predicate."); + // Fifth element - the texture path. This determines what icon is drawn on the UI when selected. It may be null to specify that none should be drawn. + if (parameters.ElementAt(4) is string iconTexturePathElement) + iconTexturePath = iconTexturePathElement; + else + throw new ArgumentException("The fifth argument to this command must be a string."); + // Optional elements - creation and hold effects. switch (secondaryArgumentCount) { - case 5: - object fifthElement = parameters.ElementAt(4); - if (fifthElement is Action creationElement) + case 6: + object sixthElement = parameters.ElementAt(4); + if (sixthElement is Action creationElement) creationEffect = creationElement; - else if (fifthElement is Action holdElement) + else if (sixthElement is Action holdElement) holdEffect = holdElement; else - throw new ArgumentException("The fifth argument to this command must be an Item or Player Action."); + throw new ArgumentException("The sixth argument to this command must be an Item or Player Action."); break; - case 6: - fifthElement = parameters.ElementAt(4); - object sixthElement = parameters.ElementAt(5); - if (fifthElement is Action creationElement2) + case 7: + sixthElement = parameters.ElementAt(4); + object seventhElement = parameters.ElementAt(5); + if (sixthElement is Action creationElement2) { creationEffect = creationElement2; - holdEffect = sixthElement as Action; + holdEffect = seventhElement as Action; } - else if (fifthElement is Action holdElement2) + else if (sixthElement is Action holdElement2) { - creationEffect = sixthElement as Action; + creationEffect = seventhElement as Action; holdEffect = holdElement2; } else - throw new ArgumentException("The fifth argument to this command must be an Item or Player Action and the sixth must be the other action type."); + throw new ArgumentException("The sixth argument to this command must be an Item or Player Action and the sixth must be the other action type."); break; } @@ -128,33 +135,37 @@ namespace CalamityMod.UI.CalamitasEnchants if (EnchantmentList.Any(enchant => enchant.ID == id) || id == ClearEnchantmentID) throw new ArgumentException("An enchantment with this ID already exists. Another one must be specified."); - EnchantmentList.Add(new Enchantment(name, description, id, creationEffect, holdEffect, requirement)); + EnchantmentList.Add(new Enchantment(name, description, id, iconTexturePathElement, creationEffect, holdEffect, requirement)); } internal static void LoadAllEnchantments() { EnchantmentList = new List { - new Enchantment(UpgradeEnchantName, "Transforms this item into something significantly better.", + new Enchantment(UpgradeEnchantName, "Transforms this item into something significantly stronger.", 1, + "CalamityMod/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Exhumed", null, null, item => ItemUpgradeRelationship.ContainsKey(item.type)), - new Enchantment("Cursed", "Summons demons that harm you but drop healing items on death on item usage.", + new Enchantment("Indignant", "Summons demons that harm you but drop healing items on death on item usage.", 100, + "CalamityMod/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Indignant", null, player => player.Calamity().cursedSummonsEnchant = true, item => item.damage > 0 && item.maxStack == 1 && item.summon), new Enchantment("Aflame", "Lights enemies ablaze on hit but also causes the user to take damage over time when holding this item.", 200, + "CalamityMod/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Aflame", null, player => player.Calamity().flamingItemEnchant = true, item => item.damage > 0 && item.maxStack == 1 && !item.summon), new Enchantment("Oblatory", "Reduces mana cost and greatly increases damage but sometimes causes this item to use your life.", 300, + "CalamityMod/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Oblatory", item => { item.damage = (int)(item.damage * 1.5); @@ -165,30 +176,35 @@ namespace CalamityMod.UI.CalamitasEnchants new Enchantment("Resentful", "Makes the damage of projectiles vary based on how far the hit target is from you. The farther, the more damage, and vice versa.", 400, + "CalamityMod/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Resentful", null, player => player.Calamity().farProximityRewardEnchant = true, item => item.damage > 0 && item.maxStack == 1 && item.shoot > ProjectileID.None), new Enchantment("Bloodthirsty", "Makes the damage of projectiles vary based on how far the hit target is from you. The closer, the more damage, and vice versa.", 500, + "CalamityMod/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Bloodthirsty", null, player => player.Calamity().closeProximityRewardEnchant = true, item => item.damage > 0 && item.maxStack == 1 && item.shoot > ProjectileID.None), new Enchantment("Ephemeral", "Causes the damage output of this item to discharge from exhaustive use. Its damage returns naturally when not being used.", 600, + "CalamityMod/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Ephemeral", null, player => player.Calamity().dischargingItemEnchant = true, item => item.damage > 0 && item.maxStack == 1 && !item.summon), new Enchantment("Hellbound", "Causes minions to be created with a 40 second timer. Once it runs out, they explode violently. Minions do more damage the longer they live and idly explode as well.", 700, + "CalamityMod/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Hellbound", null, player => player.Calamity().explosiveMinionsEnchant = true, item => item.damage > 0 && item.maxStack == 1 && item.summon), new Enchantment("Tainted", "Removes projectile shooting capabilities of this item. In exchange, two skeletal arms are released on use that slice at the mouse position.", 800, + "CalamityMod/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Tainted", item => item.useTime = item.useAnimation = 25, player => { @@ -219,27 +235,33 @@ namespace CalamityMod.UI.CalamitasEnchants }, item => item.damage > 0 && item.maxStack == 1 && item.melee && !item.noUseGraphic && item.shoot > ProjectileID.None), - new Enchantment("Treacherous", "Causes this item to sometimes release a monster that hurts both you and enemies when you have less than 50% mana.", + new Enchantment("Traitorous", "Causes this item to sometimes release a monster that hurts both you and enemies when you have less than 50% mana.", 900, + "CalamityMod/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Traitorous", null, player => player.Calamity().manaMonsterEnchant = true, item => item.damage > 0 && item.maxStack == 1 && item.magic && item.mana > 0), new Enchantment("Withering", "You heal when hurt based on damage dealt. After being hurt, the weapon rapidly drains your life to deal massive damage.", 1000, + "CalamityMod/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Withered", null, player => player.Calamity().witheringWeaponEnchant = true, item => item.damage > 0 && item.maxStack == 1 && !item.summon), - new Enchantment("Persecuted", "You attract portals which summon demons on hit. The portal must be brought close to death or the demons will attack you. Otherwise they attack enemies.", + new Enchantment("Persecuted", "When attacked, or over time, demon portals appear near you. If sufficiently damaged they are friendly; otherwise they attack you.", 1100, + "CalamityMod/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Persecuted", null, player => player.Calamity().persecutedEnchant = true, item => item.damage > 0 && item.maxStack == 1 && item.shoot > ProjectileID.None), }; // Special disenchantment thing. This is separated from the list on purpose. - ClearEnchantment = new Enchantment("Disenchant", string.Empty, ClearEnchantmentID, + ClearEnchantment = new Enchantment("Disenchant", + string.Empty, + ClearEnchantmentID, + null, item => item.Calamity().AppliedEnchantment = null, item => item.maxStack == 1 && item.shoot >= ProjectileID.None); From ba70ac64e2b0dfaa8a2470d065478bccc6192aad Mon Sep 17 00:00:00 2001 From: Dominic Date: Tue, 15 Jun 2021 12:36:44 -0500 Subject: [PATCH 134/202] Locus resprite that was missed fsr --- Items/BrimstoneLocus.png | Bin 295 -> 1029 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/Items/BrimstoneLocus.png b/Items/BrimstoneLocus.png index fae3b786552cd8d03b5413f9b8d64b7a8511d72e..4f08d4e2d27d7ee2788316bd34907bc9707b4ba6 100644 GIT binary patch delta 1013 zcmVv~nojHN|Lz~| zWpmT)Vmtj{{Lcf<^X~b-@AEw8e}pK0ay(`ubXRsJw5PBCms9f>mk@V^g+f!07@^C+ zJ?a~K5Ue-it^thS4qT4j038esLFR8=yNWocvI<&m6wVZ1+yVXEZ-=U^c#pqzCior5 zN=<_n=@y__15J3x20rwsr8$&!ku?StQeBMv*+95JB7ajp8a;z4_ zoPoHv%a1*Pa#oUgy0v#~FYln8%)k0fq9zpp$f5B;%eWkOr1(dr2~Xce{k>1vkjpGM0V016NNR+C2T@0)7JIfbtMR12UOfL&pDnMlpP=s z@0LKBc|JF=uCp%?4`&H$YM!wn@I~M|AXgiMUi_vIWeE;2^Id(@P@*63d=}^cGtJIQ zTI+kEa^}?zkIbtb9DFc)RuqO0G1y7cz!>+M-rp69(if04>xk zsdz%-dm4Gq^DM}Y5Pnat^Tb270a5XKWZrI>K&(9n)GFk*_epwkm|Kq+99{JIcfMff zCfzzQ>m=H3`2R_Ek@3}Lo&;YXSTE$a7b$v#%COk#N?fdPcye02mHsm1KI8aH;5*>b zb%)MIiWhpyOT5GV-Rj%-f2thTpjik0*$;4L)cH{}j}LM75pTU@E&M+NzTjCfWky2B jEn?Dt delta 273 zcmZqWSk9!_8Q|y6%O%Cdz`(%k>ERLtq~$=EgBeKjyo;MKQBk2@F2EFWRg4~@>L-SRfRT`PXVrs?4IKZm+j$KJV^ zp7zeaB-{VX{`|)(diLxkZ|`w^@338vweERQlh4(dcikHAvKsOgeL{K9oLk(ms#x$~ zRqLX2HR5~UpNhFSlf&rv3s!5sj4F|k-NB}8CvG;*uR6znn@2qL$&$_8K!-4Ry85}S Ib4q9e0Bpc&MF0Q* From 1f95e423013c5a5a278bad8b3cb4cf9ab45c59d3 Mon Sep 17 00:00:00 2001 From: Dominic Date: Tue, 15 Jun 2021 13:38:05 -0500 Subject: [PATCH 135/202] Tainted blade afterimage trail fix --- Effects/FadingSolidTrail.fx | 3 +++ Effects/FadingSolidTrail.xnb | Bin 2036 -> 2576 bytes Projectiles/Melee/TaintedBladeSlasher.cs | 4 +++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Effects/FadingSolidTrail.fx b/Effects/FadingSolidTrail.fx index dd9efcb37a..5b8427dcff 100644 --- a/Effects/FadingSolidTrail.fx +++ b/Effects/FadingSolidTrail.fx @@ -13,6 +13,7 @@ float3 uLightSource; float2 uImageSize0; float2 uImageSize1; matrix uWorldViewProjection; +float shouldFlip; struct VertexShaderInput { @@ -46,6 +47,8 @@ float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0 { float4 color = input.Color; float2 coords = input.TextureCoordinates; + if (shouldFlip == 1) + coords.y = 1 - coords.y; // Read the fade map as a streak. float4 fadeMapColor = tex2D(uImage1, coords); diff --git a/Effects/FadingSolidTrail.xnb b/Effects/FadingSolidTrail.xnb index 7e0935bda4647b1083ec783ebcaf68ec0d72f999..0d83a614e8e4531647c3403999fa3b9d3190b9b0 100644 GIT binary patch delta 600 zcmYjNyGjE=6umR+#`OUkg5U!|5mJbakH$h#6A}mni5g)A!NLSK5PYDbjTppQ)M-+P z#7?n^q_K$j3I2p1kU~T(c04!P)tu#W&pmVY+}ZuKulg)!Id*J{aQC%!JLq;1z4tWg zVfu&Y(%#GU>$xDcD8A(5SZ!9miWwLT-{b@Yv+#?LdQb=M?olz9EEe{N)VHw^k*sF( z+wM+b|0q92Mp&gfbYd16*|wYqpL1T>=Mww|#VA5^QK~i41$arFnj^9<)tz~{;prS@ zRugMNI!RAQDV|-54a2;JVvU1&#*Ife(I!#6fb}_48r63BC;nW)kGePd<>86?F{kG} z-HRn_DR}?D0RaLYbk;o`p?Er#wGcEe8*gX>XPzFSq?3-fZm?M4&Imel4(VV5bha9_ z%%3;V+RvE>?=%1#(3)t4$P{E(@Y5DxvDn8@6QSrFmf~+(C8G6bEUh@r42hZUi8Sj~ U=&%XasnKwhNLEE 0) { GameShaders.Misc["CalamityMod:FadingSolidTrail"].SetShaderTexture(ModContent.GetTexture("CalamityMod/ExtraTextures/BladeTrailUVMap")); + GameShaders.Misc["CalamityMod:FadingSolidTrail"].Shader.Parameters["shouldFlip"].SetValue((float)(Owner.direction == -1).ToInt()); + Vector2 bottom = BladeCenterPosition - BladeOffsetDirection * BladeFrame.Height * 0.5f - Main.screenPosition; Vector2 top = BladeCenterPosition + BladeOffsetDirection * BladeFrame.Height * 0.5f - Main.screenPosition; Vector2 offsetToBlade = (top - bottom).SafeNormalize(Vector2.Zero).RotatedBy(MathHelper.PiOver2) * 5f; @@ -244,7 +246,7 @@ namespace CalamityMod.Projectiles.Melee if (projectile.oldPos[i] == Vector2.Zero) continue; - drawPoints[i] = projectile.Center + perpendicularDirection.RotatedBy(i * -0.014f * Owner.direction) * i * -Owner.direction * 4f; + drawPoints[i] = projectile.Center + perpendicularDirection.RotatedBy(i * -0.014f * Owner.direction) * i * -Owner.direction * 6f; } TrailDrawer.Draw(drawPoints, BladeCenterPosition - projectile.position - Main.screenPosition, 67); From dacc68d3c1f6587b4a629bb8a9704b8ebdfe56a5 Mon Sep 17 00:00:00 2001 From: Dominic Date: Tue, 15 Jun 2021 15:01:55 -0500 Subject: [PATCH 136/202] Lecherous enchant --- CalPlayer/CalamityPlayer.cs | 3 + NPCs/Other/BrimstoneOrb.cs | 111 ++++++++++++++++++ NPCs/Other/BrimstoneOrb.png | Bin 0 -> 481 bytes NPCs/TownNPCs/WITCH.cs | 19 ++- .../EnchantmentManager.cs | 29 +++++ 5 files changed, 160 insertions(+), 2 deletions(-) create mode 100644 NPCs/Other/BrimstoneOrb.cs create mode 100644 NPCs/Other/BrimstoneOrb.png diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 69914b73ed..71304aafe8 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -1025,6 +1025,8 @@ namespace CalamityMod.CalPlayer public bool persecutedEnchant = false; public int persecutedEnchantSummonTimer = 0; + + public bool lecherousOrbEnchant = false; #endregion Calamitas Enchant Effects #endregion @@ -2020,6 +2022,7 @@ namespace CalamityMod.CalPlayer manaMonsterEnchant = false; witheringWeaponEnchant = false; persecutedEnchant = false; + lecherousOrbEnchant = false; lastProjectileHit = null; diff --git a/NPCs/Other/BrimstoneOrb.cs b/NPCs/Other/BrimstoneOrb.cs new file mode 100644 index 0000000000..2b96ceeae0 --- /dev/null +++ b/NPCs/Other/BrimstoneOrb.cs @@ -0,0 +1,111 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.NPCs.Other +{ + public class BrimstoneOrb : ModNPC + { + public ref float Time => ref npc.ai[0]; + public Player Owner + { + get + { + if (npc.target >= 255 || npc.target < 0) + npc.TargetClosest(); + return Main.player[npc.target]; + } + } + public override void SetStaticDefaults() => DisplayName.SetDefault("Brimstone Orb"); + + public override void SetDefaults() + { + npc.width = npc.height = 28; + npc.damage = 0; + npc.defense = 0; + npc.lifeMax = 97444; + npc.noGravity = true; + npc.noTileCollide = true; + npc.value = 0f; + npc.HitSound = SoundID.NPCHit5; + npc.DeathSound = SoundID.NPCDeath7; + npc.knockBackResist = 0f; + npc.netAlways = true; + npc.aiStyle = -1; + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) => npc.lifeMax = 97444; + + public override void AI() + { + npc.Opacity = Utils.InverseLerp(0f, 15f, Time, true); + npc.velocity = Vector2.Zero; + + if (Main.myPlayer == npc.target) + { + // Disappear if the player no longer has the enchanted weapon. + if (!Owner.Calamity().lecherousOrbEnchant) + { + npc.active = false; + npc.netUpdate = true; + } + + Vector2 destination = Vector2.Lerp(Owner.Center, Main.MouseWorld, 0.3f); + npc.Center = Vector2.Lerp(npc.Center, destination, 0.035f).MoveTowards(destination, 5f); + if (!npc.WithinRange(destination, 2000f)) + npc.Center = Owner.Center; + + if (npc.Center != destination) + { + npc.netSpam = 0; + npc.netUpdate = true; + } + } + + Time++; + } + + public override void HitEffect(int hitDirection, double damage) + { + for (int i = 0; i < 3; i++) + { + Dust magic = Dust.NewDustPerfect(npc.Center + Main.rand.NextVector2Circular(12f, 12f), 264); + magic.color = Color.Red; + magic.velocity = Main.rand.NextVector2Circular(3f, 3f); + magic.fadeIn = 0.9f; + magic.scale = 1.3f; + magic.noGravity = true; + } + + if (npc.life <= 0) + { + for (int i = 0; i < 15; i++) + { + Dust magic = Dust.NewDustPerfect(npc.Center + Main.rand.NextVector2Circular(12f, 12f), 264); + magic.color = Color.Red; + magic.velocity = Main.rand.NextVector2Circular(6f, 6f); + magic.fadeIn = 1.25f; + magic.scale = Main.rand.NextFloat(1.2f, 1.56f); + magic.noGravity = true; + } + } + } + + public override void ModifyHitByProjectile(Projectile projectile, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) + { + // Minions do less damage to this project due to the fact that they can attack independantly from the player. + // The intent of this effect is for it to interfere with damage output in exchange for health. + if (projectile.minion) + damage = (int)(damage * 0.35); + } + + public override void NPCLoot() + { + for (int i = 0; i < 8; i++) + DropHelper.DropItem(npc, ItemID.Heart); + } + + public override Color? GetAlpha(Color drawColor) => Color.White * npc.Opacity; + } +} diff --git a/NPCs/Other/BrimstoneOrb.png b/NPCs/Other/BrimstoneOrb.png new file mode 100644 index 0000000000000000000000000000000000000000..680009c5da5117b371cac1f550277a7d0d0252af GIT binary patch literal 481 zcmV<70UrK|P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0d`45K~zXf&6Y7s z13?glPq7FR$QAwoK|zv2L9wxjo!V&W4@hHSp+yS8LM#PA8^II_mNquph@BQ`B!XH5 z!4&ouC!|OrDEoHbA(I=8&Fy_Kyd?*B`!REy8wv(wX>8@oEfcwUzaHpb!!A=p-IX-j z%YV34GW*?vTUj(?|AsW9QSopF*{(h!7dB^+QDqlN!p@al+&&?e4?0L`>d#O!8?C<~ zTkQy0YF!{T{xVJ7u`00000NkvXXu0mjf6=cWe literal 0 HcmV?d00001 diff --git a/NPCs/TownNPCs/WITCH.cs b/NPCs/TownNPCs/WITCH.cs index c536d20ba6..bff081bc14 100644 --- a/NPCs/TownNPCs/WITCH.cs +++ b/NPCs/TownNPCs/WITCH.cs @@ -1,4 +1,5 @@ using CalamityMod.Dusts; +using CalamityMod.Events; using CalamityMod.Items; using CalamityMod.Projectiles.Magic; using CalamityMod.UI.CalamitasEnchants; @@ -11,6 +12,7 @@ using Terraria.ID; using Terraria.ModLoader; using static Terraria.ModLoader.ModContent; +using SCalBoss = CalamityMod.NPCs.SupremeCalamitas.SupremeCalamitas; namespace CalamityMod.NPCs.TownNPCs { @@ -158,9 +160,22 @@ namespace CalamityMod.NPCs.TownNPCs randExtraCooldown = 50; } - //public override void TownNPCAttackMagic(ref float auraLightMultiplier) + public override bool PreAI() + { + // Disappear if the SCal boss is active. She's supposed to be the boss. + // However, this doesn't happen in Boss Rush; the SCal there is a silent puppet created by Xeroc, not SCal herself. + if (NPC.AnyNPCs(NPCType()) && !BossRushEvent.BossRushActive) + { + npc.active = false; + npc.netUpdate = true; + return false; + } + return true; + } - public override void TownNPCAttackProj(ref int projType, ref int attackDelay) + //public override void TownNPCAttackMagic(ref float auraLightMultiplier) + + public override void TownNPCAttackProj(ref int projType, ref int attackDelay) { projType = ProjectileType(); attackDelay = 1; diff --git a/UI/CalamitasEnchantments/EnchantmentManager.cs b/UI/CalamitasEnchantments/EnchantmentManager.cs index ba3dddd99c..a1e0e3ce78 100644 --- a/UI/CalamitasEnchantments/EnchantmentManager.cs +++ b/UI/CalamitasEnchantments/EnchantmentManager.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Accessories; using CalamityMod.Items.Weapons.Summon; +using CalamityMod.NPCs.Other; using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; using System; @@ -255,6 +256,34 @@ namespace CalamityMod.UI.CalamitasEnchants null, player => player.Calamity().persecutedEnchant = true, item => item.damage > 0 && item.maxStack == 1 && item.shoot > ProjectileID.None), + + new Enchantment("Lecherous", "Spawns a resiliant brimstone orb that stays between you and your mouse that interferes with your homing weapons. It releases a bunch of hearts on death.", + 1200, + "CalamityMod/ExtraTextures/UI/EnchantmentSymbols/CurseIcon_Lecherous", + null, + player => + { + player.Calamity().lecherousOrbEnchant = true; + + bool orbIsPresent = false; + int orbType = ModContent.NPCType(); + for (int i = 0; i < Main.maxNPCs; i++) + { + if (Main.npc[i].type != orbType || Main.npc[i].target != player.whoAmI || !Main.npc[i].active) + continue; + + orbIsPresent = true; + break; + } + + if (Main.myPlayer == player.whoAmI && !orbIsPresent) + { + int orb = NPC.NewNPC((int)player.Center.X, (int)player.Center.Y - 5, orbType); + if (Main.npc.IndexInRange(orb)) + Main.npc[orb].TargetClosest(); + } + }, + item => item.damage > 0 && item.maxStack == 1 && item.shoot > ProjectileID.None), }; // Special disenchantment thing. This is separated from the list on purpose. From f768f1e8f83c41583f5057742a3a6df09c58643e Mon Sep 17 00:00:00 2001 From: Dominic Date: Tue, 15 Jun 2021 15:02:54 -0500 Subject: [PATCH 137/202] Removed unnecessary code --- NPCs/Other/BrimstoneOrb.cs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/NPCs/Other/BrimstoneOrb.cs b/NPCs/Other/BrimstoneOrb.cs index 2b96ceeae0..eeefb6705f 100644 --- a/NPCs/Other/BrimstoneOrb.cs +++ b/NPCs/Other/BrimstoneOrb.cs @@ -92,14 +92,6 @@ namespace CalamityMod.NPCs.Other } } - public override void ModifyHitByProjectile(Projectile projectile, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) - { - // Minions do less damage to this project due to the fact that they can attack independantly from the player. - // The intent of this effect is for it to interfere with damage output in exchange for health. - if (projectile.minion) - damage = (int)(damage * 0.35); - } - public override void NPCLoot() { for (int i = 0; i < 8; i++) From 5259a83003c1a9ae9569cc4a7c5bee45ea523ba4 Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 18 Jun 2021 13:36:13 -0500 Subject: [PATCH 138/202] Start of Exhumed Mechworm --- Buffs/Summon/SepulcherMinionBuff.cs | 36 ++ Buffs/Summon/SepulcherMinionBuff.png | Bin 0 -> 704 bytes CalPlayer/CalamityPlayer.cs | 2 + Items/Weapons/Summon/StaffoftheMechworm2.cs | 48 ++ Items/Weapons/Summon/StaffoftheMechworm2.png | Bin 0 -> 1405 bytes Projectiles/Summon/BrimstoneDartMinion.cs | 58 ++ Projectiles/Summon/SepulcherArm.png | Bin 0 -> 769 bytes Projectiles/Summon/SepulcherForeArm.png | Bin 0 -> 625 bytes Projectiles/Summon/SepulcherHand.png | Bin 0 -> 839 bytes Projectiles/Summon/SepulcherMinion.cs | 519 ++++++++++++++++++ Projectiles/Summon/SepulcherMinionBody.png | Bin 0 -> 1924 bytes Projectiles/Summon/SepulcherMinionBodyAlt.png | Bin 0 -> 2059 bytes Projectiles/Summon/SepulcherMinionHead.png | Bin 0 -> 1768 bytes Projectiles/Summon/SepulcherMinionTail.png | Bin 0 -> 1033 bytes 14 files changed, 663 insertions(+) create mode 100644 Buffs/Summon/SepulcherMinionBuff.cs create mode 100644 Buffs/Summon/SepulcherMinionBuff.png create mode 100644 Items/Weapons/Summon/StaffoftheMechworm2.cs create mode 100644 Items/Weapons/Summon/StaffoftheMechworm2.png create mode 100644 Projectiles/Summon/BrimstoneDartMinion.cs create mode 100644 Projectiles/Summon/SepulcherArm.png create mode 100644 Projectiles/Summon/SepulcherForeArm.png create mode 100644 Projectiles/Summon/SepulcherHand.png create mode 100644 Projectiles/Summon/SepulcherMinion.cs create mode 100644 Projectiles/Summon/SepulcherMinionBody.png create mode 100644 Projectiles/Summon/SepulcherMinionBodyAlt.png create mode 100644 Projectiles/Summon/SepulcherMinionHead.png create mode 100644 Projectiles/Summon/SepulcherMinionTail.png diff --git a/Buffs/Summon/SepulcherMinionBuff.cs b/Buffs/Summon/SepulcherMinionBuff.cs new file mode 100644 index 0000000000..34910472ba --- /dev/null +++ b/Buffs/Summon/SepulcherMinionBuff.cs @@ -0,0 +1,36 @@ +using CalamityMod.CalPlayer; +using CalamityMod.Projectiles.Summon; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.Summon +{ + public class SepulcherMinionBuff : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Sepulcher"); + Description.SetDefault("It is not benevolent"); + Main.buffNoTimeDisplay[Type] = true; + Main.buffNoSave[Type] = true; + //Main.persistentBuff[Type] = true; + } + + public override void Update(Player player, ref int buffIndex) + { + CalamityPlayer modPlayer = player.Calamity(); + if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) + modPlayer.sepulcher = true; + + if (!modPlayer.sepulcher) + { + player.DelBuff(buffIndex); + buffIndex--; + } + else + { + player.buffTime[buffIndex] = 18000; + } + } + } +} diff --git a/Buffs/Summon/SepulcherMinionBuff.png b/Buffs/Summon/SepulcherMinionBuff.png new file mode 100644 index 0000000000000000000000000000000000000000..5eeae4fa2bc9a0ad21703d163c051442a004eecb GIT binary patch literal 704 zcmV;x0zdtUP)!3UH8HitVDQT+AopN{_JjsInTV(lRS`bG`|9#CMhc|#)E z*%=35TWG!FuP4s}5RB{rU^e$$@n;g()b;rE7XV%jrvSLa1I5=|0VfBV8zO)kK~rpv zGEBre0Vwug1mJ4a;xCMS1z<_)zQx-LCbPrJe{c()2sP zRc>EwKj7BAxvppWfRh9AhLh2L09qdRC_{<7HDu3-6-yOAPCEc^^Y&ib3Ya+6dJcfT zf>)=ZL@s+N)gcOH+N{0rdXrOrnKmnjw#+puKUqf<^xQOb6fm>ioQ48XD4)5j?uWaM z18yI1XNvVZlhsursJQ|Q`hW@ZWMoEQLKHMRs|nBa0Y`ydM{WS_l#`rTxAh!G~zo0_nA|K%$H6pi)0qky2&Jb%)(7k~i@0Qfr$*WcPM&LrS=LOBtcRZ(*Ve1W-aCT_vx^(PM#$I0000 PendingProjectilesToRespawn = new List(); // Due to the way vanilla summons work, the buff must be applied manually for it to properly register, since @@ -1986,6 +1987,7 @@ namespace CalamityMod.CalPlayer plaguebringerPatronSummon = false; howlTrio = false; mountedScanner = false; + sepulcher = false; abyssalDivingSuitPrevious = abyssalDivingSuit; abyssalDivingSuit = abyssalDivingSuitHide = abyssalDivingSuitForce = abyssalDivingSuitPower = false; diff --git a/Items/Weapons/Summon/StaffoftheMechworm2.cs b/Items/Weapons/Summon/StaffoftheMechworm2.cs new file mode 100644 index 0000000000..1fb6faa386 --- /dev/null +++ b/Items/Weapons/Summon/StaffoftheMechworm2.cs @@ -0,0 +1,48 @@ +using CalamityMod.Projectiles.Summon; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Summon +{ + public class StaffoftheMechworm2 : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Staff of the Mechworm (But Exhumed!)"); + Tooltip.SetDefault("Summons a sepulcher to fight for you\n" + + "While the sepulcher is active brimstone hearts will begin to appear and orbit you\n" + + "The sepulcher will attempt to attack you more and more frequently depending on how many hearts are present\n" + + "The sepulcher takes up 4 minion slots"); + } + + public override void SetDefaults() + { + item.damage = 666; + item.mana = 15; + item.width = 58; + item.height = 58; + item.useTime = item.useAnimation = 12; + item.useStyle = ItemUseStyleID.SwingThrow; + item.noMelee = true; + item.knockBack = 2f; + item.value = CalamityGlobalItem.Rarity15BuyPrice; + item.rare = ItemRarityID.Purple; + item.Calamity().customRarity = CalamityRarity.Violet; + item.UseSound = SoundID.DD2_BetsySummon; + item.autoReuse = true; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 10f; + item.summon = true; + } + + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 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) + { + Projectile.NewProjectile(Main.MouseWorld, -Vector2.UnitY * 5f, type, damage, knockBack, player.whoAmI); + return false; + } + } +} diff --git a/Items/Weapons/Summon/StaffoftheMechworm2.png b/Items/Weapons/Summon/StaffoftheMechworm2.png new file mode 100644 index 0000000000000000000000000000000000000000..ffcc7066c041095c029a4ac8652a4ae994d0611d GIT binary patch literal 1405 zcmV-@1%mpCP)@W;98YG}@S@Niel3wi+Q17LDM7R7G&XAc(X^sRex$9|fU`mKH^5 zDku~eT>2sY^EYrlXnO+~x{B!4?ncJZyvxW1$40D;extDzN zZ|7W#B}PNp-2hlO8g z?Qveg7@}dN`U2u1|G}d2Y5*>r8?phm?|2`8%C_6D`Tfx!&j9ej&Nl$4sak|OlPy7x*@8B+%8A8wD?*Pazt+K!v5=F)t63!Nln*sQG?K1!be^>xu z_s9?c$1ctR(7B-rfTq*x`x1M^u;8V$0L+AXA7h9{+8Pqovn=yj09pB~Y=GP9>H&E2 z)P4Xquh;;VcnXL#MWOdJ;n)%Cl4UMp4ADp%L%il3LhFlL0jSti;yS*qs|;|= z=n9-r$5Dnn@!sbEY~A^4%=1c@EEq#H(#DVoTwQ2c?OhhYk$rn?fL4?#54Nud;9bT6 zIJ$QPfKn~{NH!9r=kdZAqLDU+$V^mz(-AXJWrh|*4tD;E$Lqa`Dj35R4%j zNi#&RL?x@NEGz_Ic5>VXsJiEA00tkf1)%sRRcE}gUd=UP%uHk6gO>sEFotNP!VuSQ zKC4jG4fj8;>IJDl_r7%yfYQ|}yU6@P>Wc_suHxS)#t@B^)gk)2NW~_#k3%X@sXT{| ztIx}1YeuVR7aL=UM$!z?dlfO`saGBVoL-~n@BsjFi_0v4*-4dUWahb8vBC>uh(^K< zk?fLRQVPKAWi=bs*IuP}=?-NPzc%Yk7RC^bgw-KpMrCsY0HeKquDQm~->X;=qpomW zn=vHCEP4#_GUM6Z?*Q<{HuYLiu|}nwx%yV9*M&gLU41gY$h}$Z>zEo- zD{JX$hF}cQ@Qfi|JBWpxmH8Gxz*44&8G275bw;|IAs9n6qGE{GQwLtpo5=BG%{&v0 zF+?NEkjAQ30PKHfVrCDC5whQNN81(vatewqfI0uPI?+PFbzWmgh7!&);Z^w1Q;hPg znjm}1D?>9-eJ9S`)TCsgjEWgL#t@Bg4Dnip7c*q9mi}JQ*IJDsON4L?sVb-gV0fw@ z@P58k_G}5VLq~SzTsSwBfXhrC#t;qb`Ib)ssL!4SAUC_j250YhWBW^hcSWl2=F8OB zAs9n6eC6580XR9IYXfvPsP0zwjtde~!mIG1Cy "CalamityMod/Projectiles/Boss/BrimstoneBarrage"; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Brimfire"); + Main.projFrames[projectile.type] = 4; + ProjectileID.Sets.MinionShot[projectile.type] = true; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 2; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 18; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.timeLeft = 300; + projectile.penetrate = 1; + projectile.minion = true; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + projectile.alpha = 255; + } + + public override void AI() + { + projectile.frameCounter++; + projectile.frame = projectile.frameCounter / 5 % Main.projFrames[projectile.type]; + projectile.Opacity = Utils.InverseLerp(300f, 285f, projectile.timeLeft, true) * Utils.InverseLerp(0f, 15f, projectile.timeLeft, true); + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; + + if (projectile.velocity.Length() < 35f) + projectile.velocity *= 1.036f; + + Lighting.AddLight(projectile.Center, 0.75f, 0f, 0f); + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) => target.AddBuff(ModContent.BuffType(), 600); + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + lightColor.R = (byte)(255 * projectile.Opacity); + CalamityUtils.DrawAfterimagesCentered(projectile, ProjectileID.Sets.TrailingMode[projectile.type], lightColor, 1); + return false; + } + } +} diff --git a/Projectiles/Summon/SepulcherArm.png b/Projectiles/Summon/SepulcherArm.png new file mode 100644 index 0000000000000000000000000000000000000000..b45111f2065293ffdd8a1711e4dfab68e0bd55bf GIT binary patch literal 769 zcmV+c1OEJpP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0+vZcK~z{r)t5m} z6G0TmcccsLRw`I1K@+V9kZQc3LzPg>#wAGm<{F2u7_FWesDHOQw+1jKND; z9eFjA%OV@Lcy{ZI!Mm@ngSmPSUDq~vIKlPv*z;UOuXuhHLF=ej7-m#DTJ1vP6wwK~ z68SuR3jdXhSJ=%sCoW!LH}o%PvLxeC^uHK9`bD2Y`ai1% zPX&)oj1D9aow$TW`Cpm~^0yzo0i$$#G6*_9mP_XEWxShvq~-g{6*ha0h=2ICH!o)~ zxj!xZTirN8-rlv5iLJdd@<=+NXZO{naOuHyk%gT zis(pXW%B-;Ixp%Hlq>9eLF%97KAF((;qr~!m=HUqBC_0BQFlt7W`|Omt9&Oda;+}< zW@0d5;+OOGNz3t|H^lLZ?_+)(bWPx#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0tQJ$K~z{r?U%hy z0znjocM(=Z0TEFV6Qd1@78V){U%y?WAn^y#6?TDj?^&+G z$OaN;sQ8k@-I>JU?423BSJwoVlhe&7&7qH_L<$2Y9t_}binRvDyH{t30enh8k3^!) zM~`I4K#T>0aI`(2!I(KMS%|u0!`b=!JI2x+1=8V&Msgts&Wmk9G|`Ebm;t#?98z;y zZjP|(*6chcn7xNv#Eoe$N73;#;;LRm+_}9+bV07<<)|5d$h{Syg^>s(a^l1x=CfXd z)HxD)EWJU@#_zLnU_t|9JU93zGU-kqy7ygMh) zQOjNH=!i+j5{O56@BEAo4Z%^NEcveeam27QcEa!uK3i2aj(iv5b0Xq5uf!3(Gv2!w zKI?Uek>|)X%NpswsNXda@mD~k|BmQ{i>JJmL5{jJSg1SwTd3RlVFt}D+VglO8s_^+I=d8b~!BNsSH1s5^kZ)Vt0 z*6=!j1M?8k1Px&0ZBwbR9J=8m_2V3F&M{xPMS0?v?!|DQYujxcu^Txn3$Mg;2ZIU_yi1eV(P?# z5S5@q3!+3(C`ps%^^%yud6L*UUm78h`=9Qf^Z9%~KQFcw9zEXJw(j$*1pqp|ww|?b z-ngj%s+SiUV866!y%*_`0ywUp1MvC068pWBZy^6$E4~M{C<36A$!LI1uMNP1JNs6< zuiuX}z>B;0WBWNcJr;s0X&~VfiS!77la3+r^5IkKd9z-&p1b;SQD15x;S*^Mhp~1c zA$qpG3&5w}zbyM< z)d!IVD5ldUZaiedCnD;OMpm@=B)(F1?DF18r=3`H!Y5Kpr-5mP6WFUs1~wfoj5uOHb2-+VLGxiuVwMPx2&goLa!MDnMu-F==_DFx8ilT55( zO2Cbxt!x$unTSa8gX;s&OD38=Hu}K4Pt1@2AeS*` z+$B85%EaLkachg*XH@(F$E1pmcY4*>R#RP{Q$@+7#g&W#XpQ%*qDaRs<|itq7j7C8 z6%-L`@>_#QF0H)ruN4dt?^$2LQ!QtzwR=jSz#kQh6bzB&&(J)i{#L;d`2*$yEw2+b Ri?9Fy002ovPDHLkV1hBPfvW%j literal 0 HcmV?d00001 diff --git a/Projectiles/Summon/SepulcherMinion.cs b/Projectiles/Summon/SepulcherMinion.cs new file mode 100644 index 0000000000..50abfd7e2c --- /dev/null +++ b/Projectiles/Summon/SepulcherMinion.cs @@ -0,0 +1,519 @@ +using CalamityMod.Buffs.Summon; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Summon +{ + public class SepulcherMinion : ModProjectile + { + public struct SepulcherSegment + { + public Vector2 CurrentPosition; + public float Rotation; + public SepulcherSegment(Vector2 position, float rotation) + { + CurrentPosition = position; + Rotation = rotation; + } + } + + public class SepulcherArm + { + public class SepulcherArmLimb + { + public Vector2 Center; + public float Rotation; + + public SepulcherArmLimb(Vector2 center, float rotation) + { + Center = center; + Rotation = rotation; + } + + public void SendData(BinaryWriter writer) + { + writer.WritePackedVector2(Center); + writer.Write(Rotation); + } + + public static SepulcherArmLimb ReceiveData(BinaryReader reader) => new SepulcherArmLimb(reader.ReadPackedVector2(), reader.ReadSingle()); + } + + public SepulcherArmLimb[] Limbs = new SepulcherArmLimb[2]; + public byte SegmentIndexToAttachTo; + public Vector2 Center; + public float Rotation; + public bool ReelingBack = false; + public bool Direction; + public SepulcherArm(Vector2 center, byte segmentIndexToAttachTo, float rotation, bool reelingBack, bool direction) + { + Center = center; + SegmentIndexToAttachTo = segmentIndexToAttachTo; + Rotation = rotation; + ReelingBack = reelingBack; + Direction = direction; + Limbs = new SepulcherArmLimb[2] + { + new SepulcherArmLimb(center, rotation), + new SepulcherArmLimb(center, rotation) + }; + } + } + + public enum AIState + { + HoverNearOwner, + AttackEnemy_Charge, + AttackEnemy_ReleaseDartBurst, + AttackOwner + } + + public int IdleTimer; + public int AttackTimer; + public int PlayerAttackCountdown; + public SepulcherSegment[] Segments = new SepulcherSegment[24]; + public List Arms = new List(); + public Player Owner => Main.player[projectile.owner]; + public AIState CurrentAIState + { + get => (AIState)(int)projectile.ai[0]; + set + { + // Don't do anything unless the caller is the owner of this projectile- changes will be synced to other clients in MP. + if (Main.myPlayer != projectile.owner) + return; + + projectile.ai[0] = (int)value; + projectile.netUpdate = true; + } + } + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sepulcher"); + ProjectileID.Sets.MinionSacrificable[projectile.type] = true; + ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.width = 24; + projectile.height = 24; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.netImportant = true; + projectile.penetrate = -1; + projectile.minionSlots = 4f; + projectile.timeLeft = 90000; + projectile.Opacity = 0f; + projectile.tileCollide = false; + projectile.minion = true; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 4; + projectile.scale = 1.35f; + projectile.hide = true; + } + + #region Syncing + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(IdleTimer); + writer.Write(PlayerAttackCountdown); + writer.Write(Arms.Count); + for (int i = 0; i < Arms.Count; i++) + { + writer.WritePackedVector2(Arms[i].Center); + writer.Write(Arms[i].SegmentIndexToAttachTo); + writer.Write(Arms[i].Rotation); + writer.Write(Arms[i].ReelingBack); + writer.Write(Arms[i].Direction); + Arms[0].Limbs[0].SendData(writer); + Arms[0].Limbs[1].SendData(writer); + } + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + IdleTimer = reader.ReadInt32(); + PlayerAttackCountdown = reader.ReadInt32(); + Arms.Clear(); + for (int i = 0; i < reader.ReadInt32(); i++) + { + Arms.Add(new SepulcherArm(reader.ReadPackedVector2(), reader.ReadByte(), reader.ReadSingle(), reader.ReadBoolean(), reader.ReadBoolean())); + Arms.Last().Limbs[0] = SepulcherArm.SepulcherArmLimb.ReceiveData(reader); + Arms.Last().Limbs[1] = SepulcherArm.SepulcherArmLimb.ReceiveData(reader); + } + } + #endregion + + #region AI + public override void AI() + { + Initialize(); + HandleBuffs(); + HandleFlexibleDamage(); + UpdateSegments(); + + // Fade in rapidly. + projectile.Opacity = MathHelper.Clamp(projectile.Opacity + 0.2f, 0f, 1f); + + NPC potentialTarget = AttemptToFindTarget(1450f); + + // Enter the attack state if a valid enemy is found and go back to hovering otherwise. + // This will be overriden if attacking the owner. + if (CurrentAIState != AIState.AttackEnemy_ReleaseDartBurst && CurrentAIState != AIState.AttackEnemy_Charge) + { + if (potentialTarget != null) + CurrentAIState = AIState.AttackEnemy_ReleaseDartBurst; + } + else if (potentialTarget is null) + { + CurrentAIState = AIState.HoverNearOwner; + AttackTimer = 0; + } + + // Reset the AI to player attack mode if the countdown is going on. + if (PlayerAttackCountdown > 0) + { + if (CurrentAIState != AIState.AttackOwner) + CurrentAIState = AIState.AttackOwner; + + PlayerAttackCountdown--; + + // If it's finished, go back to idle owner hover movement. + if (PlayerAttackCountdown <= 0) + CurrentAIState = AIState.HoverNearOwner; + } + + switch (CurrentAIState) + { + case AIState.HoverNearOwner: + HoverNearOwner(); + break; + case AIState.AttackEnemy_ReleaseDartBurst: + AttackEnemyWithDarts(potentialTarget); + AttackTimer++; + break; + case AIState.AttackEnemy_Charge: + AttackEnemyByCharging(potentialTarget); + AttackTimer++; + break; + } + + // Check if ready to enrage every so often. + IdleTimer++; + if (IdleTimer % 600 == 599) + { + float chanceToBecomeAngry = 0f; + if (Main.rand.NextFloat() < chanceToBecomeAngry) + { + PlayerAttackCountdown = 300; + projectile.netUpdate = true; + } + } + } + + public void Initialize() + { + if (projectile.localAI[0] != 0f) + return; + + for (int i = 0; i < Segments.Length; i++) + Segments[i].CurrentPosition = projectile.Center - projectile.velocity.SafeNormalize(Vector2.UnitY) * i * 0.2f; + + projectile.Calamity().spawnedPlayerMinionDamageValue = Owner.MinionDamage(); + projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; + projectile.localAI[0] = 1f; + if (Main.myPlayer == projectile.owner) + { + float rotationalOffset = 0f; + for (byte i = 3; i < Segments.Length - 2; i += 2) + { + Arms.Add(new SepulcherArm(Segments[i].CurrentPosition, i, rotationalOffset, false, false)); + rotationalOffset = MathHelper.WrapAngle(rotationalOffset + MathHelper.Pi / 6f); + + Arms.Add(new SepulcherArm(Segments[i].CurrentPosition, i, rotationalOffset + MathHelper.Pi, false, true)); + rotationalOffset = MathHelper.WrapAngle(rotationalOffset + MathHelper.Pi / 6f); + } + projectile.netUpdate = true; + } + } + + public void HandleBuffs() + { + // Maintain or remove the Mechworm buff from the owner. + Owner.AddBuff(ModContent.BuffType(), 3600); + if (Owner.dead) + Owner.Calamity().sepulcher = false; + if (Owner.Calamity().sepulcher) + projectile.timeLeft = 2; + } + + public void HandleFlexibleDamage() + { + // Adjust the damage of this projectile if the owner's current minion damage factor has changed for any reason. + if (Owner.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) + { + int trueDamage = (int)(projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * Owner.MinionDamage()); + projectile.damage = trueDamage; + } + } + + public void UpdateSegments() + { + float aheadRotation = projectile.rotation; + Vector2 aheadPosition = projectile.Center; + + // Connect all segments to each-other and calculate their rotations. + for (int i = 0; i < Segments.Length; i++) + { + Vector2 offsetToDestination = aheadPosition - Segments[i].CurrentPosition; + // This variant of segment attachment incorporates rotation. + // Given the fact that all segments will execute this code is succession, the + // result across the entire worm will exponentially decay over each segment, + // allowing for smooth rotations. This code is what the stardust dragon uses for its segmenting. + if (aheadRotation != Segments[i].Rotation) + { + float angleOffset = MathHelper.WrapAngle(aheadRotation - Segments[i].Rotation.AngleLerp(aheadRotation, 0.08f)); + offsetToDestination = offsetToDestination.RotatedBy(angleOffset * 0.08f); + } + + Segments[i].Rotation = (aheadPosition - Segments[i].CurrentPosition).ToRotation() + MathHelper.PiOver2; + Segments[i].CurrentPosition = aheadPosition - offsetToDestination.SafeNormalize(Vector2.Zero) * 60f; + + // Adjust the ahead positions before interating further. + aheadPosition = Segments[i].CurrentPosition; + aheadRotation = Segments[i].Rotation; + } + + // Adjust the arms. + for (int i = 0; i < Arms.Count; i++) + { + SepulcherSegment segmentToAttachTo = Segments[Arms[i].SegmentIndexToAttachTo]; + Vector2 idealMovePosition = segmentToAttachTo.CurrentPosition; + float sideFactor = MathHelper.Lerp(200f, 18f, Utils.InverseLerp(-0.51f, -0.06f, Arms[i].Rotation, true)); + float aheadFactor = MathHelper.Lerp(284f, 680f, Utils.InverseLerp(-0.51f, -0.06f, Arms[i].Rotation, true)); + int direction = Arms[i].Direction.ToDirectionInt(); + idealMovePosition += (segmentToAttachTo.Rotation + Arms[i].Rotation * direction - MathHelper.PiOver2).ToRotationVector2() * projectile.scale * aheadFactor; + idealMovePosition += (segmentToAttachTo.Rotation + Arms[i].Rotation * direction - MathHelper.PiOver2 + MathHelper.PiOver2 * direction).ToRotationVector2() * projectile.scale * sideFactor; + Arms[i].Center = idealMovePosition; + + Vector2 offsetFromSegment = Vector2.Zero; + + offsetFromSegment += new Vector2(direction * 60f, 55f).RotatedBy(segmentToAttachTo.Rotation - (MathHelper.PiOver2 - Arms[i].Rotation * 1.7f - 0.77f) * direction).SafeNormalize(Vector2.UnitY) * 82f; + Arms[i].Limbs[0].Center = segmentToAttachTo.CurrentPosition + offsetFromSegment; + Arms[i].Limbs[0].Rotation = offsetFromSegment.ToRotation(); + + Arms[i].Limbs[1].Rotation = (Arms[i].Center - Arms[i].Limbs[0].Center).ToRotation(); + Arms[i].Limbs[1].Center = Arms[i].Limbs[0].Center + offsetFromSegment * 0.5f + (Arms[i].Center - Arms[i].Limbs[0].Center).SafeNormalize(Vector2.UnitY) * 84f; + + float rotationalVelocityFactor = Utils.InverseLerp(0f, 6f, projectile.velocity.Length(), true); + if (CurrentAIState == AIState.AttackEnemy_Charge) + rotationalVelocityFactor *= 0.85f; + + if (Arms[i].ReelingBack) + { + Arms[i].Rotation -= rotationalVelocityFactor * 0.066f; + if (Arms[i].Rotation < -0.55f) + Arms[i].ReelingBack = false; + } + else + { + Arms[i].Rotation += rotationalVelocityFactor * 0.029f; + if (Arms[i].Rotation > 0.77f) + Arms[i].ReelingBack = true; + } + } + } + + public void HoverNearOwner() + { + // Teleport to the owner if it's very far away. + if (!projectile.WithinRange(Owner.Center, 3200f)) + { + projectile.Center = Owner.Center; + projectile.velocity = Main.rand.NextVector2CircularEdge(4f, 4f); + projectile.netUpdate = true; + } + + // Attempt to move towards the owner. + if (!projectile.WithinRange(Owner.Center, 540f)) + { + Vector2 destination = Owner.Center + (IdleTimer / 31f).ToRotationVector2() * 240f; + projectile.velocity = Vector2.Lerp(projectile.velocity, projectile.SafeDirectionTo(destination) * 18f, 0.03f); + + float updatedDirectionRotation = projectile.velocity.ToRotation().AngleTowards(projectile.AngleTo(destination), 0.04f); + projectile.velocity = updatedDirectionRotation.ToRotationVector2() * projectile.velocity.Length(); + } + else if (projectile.velocity.Length() < 16f) + projectile.velocity *= 1.03f; + + // Determine the head rotation. + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; + } + + public void AttackEnemyWithDarts(NPC target) + { + Vector2 destination = target.Center + ((AttackTimer / 20f).ToRotationVector2() * 320f); + + // Step towards the ideal velocity with an acceleration of 1 pixel/second^2. + projectile.velocity = projectile.velocity.MoveTowards(projectile.SafeDirectionTo(destination) * 24f, 1f); + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; + + // Release a burst of darts from all segments at the target. + if (Main.myPlayer == projectile.owner && AttackTimer % 60 > 60 - Segments.Length) + { + int segmentToFireFrom = 60 - AttackTimer % 60; + Vector2 spawnPosition = Segments[segmentToFireFrom].CurrentPosition; + Vector2 shootVelocity = (target.Center - spawnPosition).SafeNormalize(Vector2.UnitY) * 8f; + Projectile.NewProjectile(spawnPosition, shootVelocity, ModContent.ProjectileType(), projectile.damage / 2, projectile.knockBack, projectile.owner); + } + + if (Main.myPlayer == projectile.owner && AttackTimer > 430) + { + CurrentAIState = AIState.AttackEnemy_Charge; + AttackTimer = 0; + } + } + + public void AttackEnemyByCharging(NPC target) + { + if (!projectile.WithinRange(target.Center, 350f)) + { + Vector2 destination = target.Center + (AttackTimer / 25f).ToRotationVector2() * MathHelper.Min(target.width * 0.35f, 150f); + projectile.velocity = Vector2.Lerp(projectile.velocity, projectile.SafeDirectionTo(destination) * 34f, 0.05f); + + float updatedDirectionRotation = projectile.velocity.ToRotation().AngleTowards(projectile.AngleTo(destination), 0.07f); + projectile.velocity = updatedDirectionRotation.ToRotationVector2() * projectile.velocity.Length(); + } + else if (projectile.velocity.Length() < 21f) + projectile.velocity *= 1.035f; + + // Determine the head rotation. + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; + + if (Main.myPlayer == projectile.owner && AttackTimer > 280) + { + CurrentAIState = AIState.AttackEnemy_ReleaseDartBurst; + AttackTimer = 0; + } + } + + public NPC AttemptToFindTarget(float searchDistance) + { + NPC closestTarget = null; + + if (Owner.HasMinionAttackTargetNPC) + { + NPC targetedNPC = Main.npc[Owner.MinionAttackTargetNPC]; + if (targetedNPC.WithinRange(projectile.Center, searchDistance) && targetedNPC.CanBeChasedBy()) + return targetedNPC; + } + + float distance = searchDistance * searchDistance; + for (int index = 0; index < Main.maxNPCs; index++) + { + if (Main.npc[index].CanBeChasedBy()) + { + float extraDistance = (Main.npc[index].width / 2) + (Main.npc[index].height / 2); + + if (Main.npc[index].WithinRange(projectile.Center, distance + extraDistance)) + { + distance = Main.npc[index].DistanceSQ(projectile.Center); + closestTarget = Main.npc[index]; + } + } + } + + return closestTarget; + } + + #endregion + + #region Drawing + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D headTexture = ModContent.GetTexture("CalamityMod/Projectiles/Summon/SepulcherMinionHead"); + Texture2D bodyTexture = ModContent.GetTexture("CalamityMod/Projectiles/Summon/SepulcherMinionBody"); + Texture2D bodyTexture2 = ModContent.GetTexture("CalamityMod/Projectiles/Summon/SepulcherMinionBodyAlt"); + Texture2D tailTexture = ModContent.GetTexture("CalamityMod/Projectiles/Summon/SepulcherMinionTail"); + Texture2D armTexture = ModContent.GetTexture("CalamityMod/Projectiles/Summon/SepulcherArm"); + Texture2D foreArmTexture = ModContent.GetTexture("CalamityMod/Projectiles/Summon/SepulcherForeArm"); + Texture2D handTexture = ModContent.GetTexture("CalamityMod/Projectiles/Summon/SepulcherHand"); + + Vector2 drawPosition; + + // Draw arms. + for (int i = 0; i < Arms.Count; i++) + { + Vector2 forearmDrawPosition = Arms[i].Limbs[0].Center - Main.screenPosition; + Color drawColor = Lighting.GetColor((int)(Arms[i].Limbs[0].Center.X / 16), (int)(Arms[i].Limbs[0].Center.Y / 16)); + spriteBatch.Draw(foreArmTexture, forearmDrawPosition, null, drawColor, Arms[i].Limbs[0].Rotation + MathHelper.PiOver2, foreArmTexture.Size() * 0.5f, projectile.scale, SpriteEffects.None, 0f); + + Vector2 armDrawPosition = Arms[i].Limbs[1].Center - Main.screenPosition; + drawColor = Lighting.GetColor((int)(Arms[i].Limbs[1].Center.X / 16), (int)(Arms[i].Limbs[1].Center.Y / 16)); + spriteBatch.Draw(armTexture, armDrawPosition, null, drawColor, Arms[i].Limbs[1].Rotation + MathHelper.PiOver2, armTexture.Size() * new Vector2(0.5f, 0f), projectile.scale, SpriteEffects.FlipVertically, 0f); + + Vector2 handDrawPosition = armDrawPosition; + SpriteEffects handDirection = Arms[i].Direction ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(handTexture, handDrawPosition, null, drawColor, Arms[i].Limbs[1].Rotation - MathHelper.PiOver2, handTexture.Size() * new Vector2(0.5f, 0f), projectile.scale, handDirection, 0f); + } + + for (int i = 0; i < Segments.Length; i++) + { + Texture2D textureToUse = i % 2 == 1 ? bodyTexture2 : bodyTexture; + + // Use the tail texture for the last segment. + if (i == Segments.Length - 1) + textureToUse = tailTexture; + + drawPosition = Segments[i].CurrentPosition - Main.screenPosition; + lightColor = Lighting.GetColor((int)(drawPosition.X + Main.screenPosition.X) / 16, (int)(drawPosition.Y + Main.screenPosition.Y) / 16); + spriteBatch.Draw(textureToUse, drawPosition, null, projectile.GetAlpha(lightColor), Segments[i].Rotation, textureToUse.Size() * 0.5f, projectile.scale, SpriteEffects.None, 0f); + } + + drawPosition = projectile.Center - Main.screenPosition; + lightColor = Lighting.GetColor((int)(drawPosition.X + Main.screenPosition.X) / 16, (int)(drawPosition.Y + Main.screenPosition.Y) / 16); + spriteBatch.Draw(headTexture, drawPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, headTexture.Size() * 0.5f, projectile.scale * 1.25f, SpriteEffects.None, 0f); + return false; + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + // If default collision is possible return true immediately. + if (projHitbox.Intersects(targetHitbox)) + return true; + + // Check based on segments. + for (int i = 0; i < Segments.Length; i++) + { + if (Utils.CenteredRectangle(Segments[i].CurrentPosition, Vector2.One * 52f).Intersects(targetHitbox)) + return true; + } + + // And finally arm hands. + for (int i = 0; i < Arms.Count; i++) + { + if (Utils.CenteredRectangle(Arms[i].Center, Vector2.One * 32f).Intersects(targetHitbox)) + return true; + } + + return false; + } + + public override void DrawBehind(int index, List drawCacheProjsBehindNPCsAndTiles, List drawCacheProjsBehindNPCs, List drawCacheProjsBehindProjectiles, List drawCacheProjsOverWiresUI) + { + drawCacheProjsBehindProjectiles.Add(index); + } + + #endregion + } +} diff --git a/Projectiles/Summon/SepulcherMinionBody.png b/Projectiles/Summon/SepulcherMinionBody.png new file mode 100644 index 0000000000000000000000000000000000000000..5e8b75333ef4e7beb6b6b9b19646e550aa3167ea GIT binary patch literal 1924 zcmeAS@N?(olHy`uVBq!ia0vp^And`x3}WpM3IS4##X;^)4C~IxyaaMs(j9#r85lP9 zbN@+XWnf@t2=EDU1&VWV@yhe*YYU6pXiIA=D0s6AyC`aes_10!@)jD~xQTcK8ak#2 zXtXFxwip?$F>&oH*8kz@xo@KR|L*MfhwA_T`wcW?6pV(zPz(VvHU=?ZK4B;c@(cby zvH?TzcXm}^9C8+TL>4nJa0`PlBg3pY62QWO(bL5-B*OjZjJMlnD+su9OKhz>GV9Xs zfB99fzZtkDUy2uh7pcv4=8PYk+tEKiYE~CcE?!wYp*SMwdFv|$&W94_l9%3Y+7=mC zpQ@|E_*yFYvH+7#%Q|kyi08A^j+IW0=dxPCc4=qjvA^Hd1T=CsEmnEG>)dD2C~nU~ zXVsdF-Gbt;E&FNrWEYp(mrXYgHN4)HYABMvOoR1bu&2soe~o}9>w~jn&F?h2m zb+OPr%b+!rPSlB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git a/Projectiles/Summon/SepulcherMinionHead.png b/Projectiles/Summon/SepulcherMinionHead.png new file mode 100644 index 0000000000000000000000000000000000000000..ce918150f1e3334acb2269f120379bbaccd2d7c1 GIT binary patch literal 1768 zcmVP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!2kdb!2!6DYwZ9427O6HK~#8N?VMX| z6jdC?*&?@UfwtB{st6*WpdwXYphk!Z5Q8R~DDfH}jLM^i2Te2tn-Vg(eX5Jdd0jOZGUFPDN`71r;~~^(W#7R)rbFel zg7b4{%(s0dtMk!uMYFfg@Nhe=gq&wwY1uwH4miEIzQOjZrcO8Q{o}Cd_KriQrPj@% z;#|jDwvGqixSKg<&!PKnrkU-LK+m5xUM0pjq-9Gwr&oU5Wja!^j@yr2z0mgQ9J5xR z=r}VN%8rMR^_ap))o+Cr3ezW7o9g&AyT_~^!a40W7u#-g9T8p8Xn^rBKE|6yjB$-| zAU5dP(|X|HhH>loLhmESc%rGe`lvN>G*RmK%GYrhBgDzsa2*g`kR$8sh6+8ujxPkS zE8ncntdSLg4v3nl9Z{)wH3u8U&AmYFFm?Pu){l;>O2Vu0;aiD&Oy0@}-e83xb zGs3L&$E}Fasu&G~#us`&F~*rKogJPh*5O=Zp7Zhdx}QcUrh(WFy$_y`j%$1{Gx~g* z^Pr9bb(b!S{+hl3La&FA(-0bebUe|*%<2q<(E6@11X@>h#en|1t|UEvTD?|y9V;n1 zUTUnXv!Q?2Sj>v9B*=Q+(DTvpL<@wnXjXKlAuT7Q#jHAAD%vMR$3Y!`aJhG4^|C3Z zix#aked?ta)7H<69eQ9=@qMpP#`)`H2-SVf1-G6m{-pEGi;-z$1&CXYPpF7i$`S5GwUJh{(Q(Q)rR@V6-|AZGPM3yyDCbA{~#PVZPwf22ss^?D|FGR-^9Y9(K#|$&0&(`?s?B~0Sud8u}y1ezo1XG-2r7WB1 zvoCdD>%AUd&mThTH$=xFl-;kN;p-=z+wE&!Gwu2PA5*Q%d^-yC7X{t7G?~_X+G?8h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wa|zHO3%g zSUDi`FvTVUdc`rPS0I3o$2RK6>;0`U2J@N8z=OBXBr=?7lQFI(aCFChi6+CQ`3qF9 zF@TywCIO7$vyS5cj^F3|DiL!So96Sq-p7mTHO3jl{DZE=8AMHDKe{Hv`?+TDzSxiX zuvl}}n8_GmGw7n|hByzIN4GlTYORw^)t+A@9LDz?j& ziZxa&c~kls1)h9 zf9__&31zP>V2zau=ChMMYX0IHyE9PQ_p4H=SYxa9k2&3vJLXDaYizlo*7mjqW&1@c zD{-Z23)mX_Uz~1;j<_1w8e1+{i7@3}X)qOPtfuA<157brJ~VaG00000NkvXXu0mjf D2Dj?t literal 0 HcmV?d00001 From 5e5b6d85e8004cac8897e39acde7626eca1c78c6 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Sun, 20 Jun 2021 03:37:31 +0200 Subject: [PATCH 139/202] Dazzling stabber anti-stick behavior --- Projectiles/Summon/DazzlingStabber.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Projectiles/Summon/DazzlingStabber.cs b/Projectiles/Summon/DazzlingStabber.cs index 99c39730e1..3c4c8335e8 100644 --- a/Projectiles/Summon/DazzlingStabber.cs +++ b/Projectiles/Summon/DazzlingStabber.cs @@ -128,6 +128,9 @@ namespace CalamityMod.Projectiles.Summon projectile.netUpdate = true; } + if (projectile.WithinRange(target.Center, 25f)) + projectile.velocity.Y -= 0.7f; + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; } From 8fe96f2e4e7a029820de2681f67f185103ddf1f9 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Sun, 20 Jun 2021 03:38:29 +0200 Subject: [PATCH 140/202] Flesh Ball minion platform fall behavior --- Projectiles/Summon/FleshBallMinion.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Projectiles/Summon/FleshBallMinion.cs b/Projectiles/Summon/FleshBallMinion.cs index 651651a7cc..210163db55 100644 --- a/Projectiles/Summon/FleshBallMinion.cs +++ b/Projectiles/Summon/FleshBallMinion.cs @@ -154,5 +154,11 @@ namespace CalamityMod.Projectiles.Summon projectile.velocity.X *= 0.9f; return false; } + + public override bool TileCollideStyle(ref int width, ref int height, ref bool fallThrough) + { + fallThrough = projectile.Bottom.Y < Owner.Top.Y; + return true; + } } } From 5d0dbef365823b63f6ac66a295e56a76e8c3e33d Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Sun, 20 Jun 2021 04:16:37 +0200 Subject: [PATCH 141/202] Revert "Dazzling stabber anti-stick behavior" This reverts commit 5e5b6d85e8004cac8897e39acde7626eca1c78c6. --- Projectiles/Summon/DazzlingStabber.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/Projectiles/Summon/DazzlingStabber.cs b/Projectiles/Summon/DazzlingStabber.cs index 3c4c8335e8..99c39730e1 100644 --- a/Projectiles/Summon/DazzlingStabber.cs +++ b/Projectiles/Summon/DazzlingStabber.cs @@ -128,9 +128,6 @@ namespace CalamityMod.Projectiles.Summon projectile.netUpdate = true; } - if (projectile.WithinRange(target.Center, 25f)) - projectile.velocity.Y -= 0.7f; - projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; } From cad4b8d1ed411883b721a68fd2fb4e35198dfc9b Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Sun, 20 Jun 2021 18:40:43 +0200 Subject: [PATCH 142/202] Fixed a bug with Eternity retargetting --- Projectiles/Magic/EternityHex.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projectiles/Magic/EternityHex.cs b/Projectiles/Magic/EternityHex.cs index 2f950b7059..91ca33bd9f 100644 --- a/Projectiles/Magic/EternityHex.cs +++ b/Projectiles/Magic/EternityHex.cs @@ -184,7 +184,7 @@ namespace CalamityMod.Projectiles.Magic Projectile proj = Main.projectile[i]; if (!proj.active) continue; - if (proj.whoAmI != projectile.whoAmI) + if (proj.owner != projectile.owner) continue; if (proj.type != ModContent.ProjectileType() && proj.type != ModContent.ProjectileType()) continue; From 1dc5ace76c95968fcb276849bc73cbc75df828d0 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Tue, 22 Jun 2021 04:54:03 +0200 Subject: [PATCH 143/202] Exhumed mechworm enrage behavior --- NPCs/Other/ExhumedHeart.cs | 66 ++++++ NPCs/Other/ExhumedHeart.png | Bin 0 -> 2249 bytes Projectiles/Summon/SepulcherMinion.cs | 225 ++++++++++++++++++--- Projectiles/Summon/SepulcherMinionEyes.png | Bin 0 -> 252 bytes Projectiles/Summon/SepulcherMinionHead.png | Bin 1768 -> 752 bytes Projectiles/Summon/SepulcherMinionJaw.png | Bin 0 -> 295 bytes 6 files changed, 264 insertions(+), 27 deletions(-) create mode 100644 NPCs/Other/ExhumedHeart.cs create mode 100644 NPCs/Other/ExhumedHeart.png create mode 100644 Projectiles/Summon/SepulcherMinionEyes.png create mode 100644 Projectiles/Summon/SepulcherMinionJaw.png diff --git a/NPCs/Other/ExhumedHeart.cs b/NPCs/Other/ExhumedHeart.cs new file mode 100644 index 0000000000..f1fdb578b3 --- /dev/null +++ b/NPCs/Other/ExhumedHeart.cs @@ -0,0 +1,66 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.NPCs.Other +{ + public class ExhumedHeart : ModNPC + { + public ref float Time => ref npc.ai[0]; + public Player Owner + { + get + { + if (npc.target >= 255 || npc.target < 0) + npc.TargetClosest(); + return Main.player[npc.target]; + } + } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Exhumed Brimstone Heart"); + Main.npcFrameCount[npc.type] = 6; + } + + public override void SetDefaults() + { + npc.width = npc.height = 38; + npc.damage = 0; + npc.defense = 0; + npc.lifeMax = 51740; + npc.noGravity = true; + npc.noTileCollide = true; + npc.value = 0f; + npc.HitSound = SoundID.NPCHit13; + npc.DeathSound = SoundID.NPCDeath1; + npc.knockBackResist = 0f; + npc.netAlways = true; + npc.aiStyle = -1; + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) => npc.lifeMax = 51740; + + public override void AI() + { + npc.Opacity = Utils.InverseLerp(0f, 25f, Time, true); + npc.Center = Owner.Center + (MathHelper.TwoPi * Time / 540f).ToRotationVector2() * 350f; + npc.velocity = Vector2.Zero; + + Time++; + } + + public override void FindFrame(int frameHeight) + { + npc.frameCounter++; + npc.frame.Y = (int)(npc.frameCounter / 5) % Main.npcFrameCount[npc.type] * frameHeight; + } + + public override Color? GetAlpha(Color drawColor) + { + Color color = Color.Purple * npc.Opacity; + color.A = 127; + return color; + } + } +} diff --git a/NPCs/Other/ExhumedHeart.png b/NPCs/Other/ExhumedHeart.png new file mode 100644 index 0000000000000000000000000000000000000000..c597cfe505dbc26ebfb4a17f3d193fbd257e9d06 GIT binary patch literal 2249 zcmV;)2sZbLP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGf6951U69E94oEQKA2wq77TRiM6&tOrOeF}~i580f1)C5MBnAWiBB zVk6P|8u^a<$oiV^o-;F>$ei;&FiduL?z;Ec?|yUUoOjoaF~%5U%mVJ&?(Z0{9-O$f z{b%8Wqdyn@H&1N$t6}zUi@Ar6PLvfl3uHP!#$%C6^3-hs^J@xP=wpPZgVeEW!lzpv>^lw){S+93sPA1aU-_==4>y05J?{X| z$NgEi=-2Sun@5T|H40}QJyZ77D5ll$CtrS1_S86Fy4H{TGpscWn8vI^t#X`p1MR(> z0il1x+GiEaK5_1;vWIsseYE}8-{?D`eOS@4hSI-bYB4jX=D)rAb=hZ3J@fTrm~kxq z5z~4m1MRn3+n;^@aoNA{{L5vJdF|WKzhO|*&|2G=#xVB-{TgbcwtfwBO_rfGn2jN_ zQ6A&z@y5eySg$M~GY9%}IyM>iiUY%EHusj>fDuK_fgaCswJQvzKf|E4tmk~tTGr!u zoZGE4KG45mYFWF1_F*-wOs!q$*Dzq3vBh&|-z)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HR+K4AgS1ruFfu-2wWqVW5`DT-MU8diC5o)1!=Q7&6naG>bWoVPLMUHL2Y? z|Bx}BVLkI@-}t<*9P#Q5FMh#cEVgV^mfb&>@oHGng!bG~S;p!N8)J+y#u#JFon!CU zbPDqpFx)bRI^lwAO>&GzTSo$NT^-KoZ zZ)^Es%xm9<{tbhghOD+T)0!WKsX5|)4QI)0$hrq)=~if6?eE{PURgk94)o`AY%=Z@ zhZ@#1k)q~6kLS3l`L)#*@nazOX_Dz2^47Gl&eHe6%0MvBroEr3N81x!1 z`@gt@n&-CDt*v0ZHRbB;c+?YZ#opG{%?-Y&L%Z X3?`!v=}~JZ00000NkvXXu0mjf2HlQ} literal 0 HcmV?d00001 diff --git a/Projectiles/Summon/SepulcherMinion.cs b/Projectiles/Summon/SepulcherMinion.cs index 50abfd7e2c..7635085c33 100644 --- a/Projectiles/Summon/SepulcherMinion.cs +++ b/Projectiles/Summon/SepulcherMinion.cs @@ -1,6 +1,8 @@ using CalamityMod.Buffs.Summon; +using CalamityMod.NPCs.Other; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -93,19 +95,24 @@ namespace CalamityMod.Projectiles.Summon projectile.netUpdate = true; } } + public ref float JawRotation => ref projectile.localAI[0]; + public ref float JawSnapTimer => ref projectile.localAI[1]; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; public override void SetStaticDefaults() { DisplayName.SetDefault("Sepulcher"); + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; ProjectileID.Sets.MinionSacrificable[projectile.type] = true; ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; } public override void SetDefaults() { - projectile.width = 24; - projectile.height = 24; + projectile.width = 54; + projectile.height = 54; projectile.friendly = true; projectile.ignoreWater = true; projectile.netImportant = true; @@ -117,7 +124,6 @@ namespace CalamityMod.Projectiles.Summon projectile.minion = true; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 4; - projectile.scale = 1.35f; projectile.hide = true; } @@ -192,6 +198,10 @@ namespace CalamityMod.Projectiles.Summon CurrentAIState = AIState.HoverNearOwner; } + + // Determine whether the projectile can attack its owner based on the attakc countdown. + projectile.hostile = PlayerAttackCountdown > 0; + switch (CurrentAIState) { case AIState.HoverNearOwner: @@ -205,24 +215,48 @@ namespace CalamityMod.Projectiles.Summon AttackEnemyByCharging(potentialTarget); AttackTimer++; break; + case AIState.AttackOwner: + AttackOwner(); + break; } // Check if ready to enrage every so often. IdleTimer++; if (IdleTimer % 600 == 599) { + int heartsAttachedToOwner = 0; + int heartType = ModContent.NPCType(); + for (int i = 0; i < Main.maxNPCs; i++) + { + if (Main.npc[i].type != heartType || !Main.npc[i].active || Main.npc[i].target != projectile.owner) + continue; + heartsAttachedToOwner++; + } + float chanceToBecomeAngry = 0f; + if (heartsAttachedToOwner >= 2) + chanceToBecomeAngry = Utils.InverseLerp(2f, 6f, heartsAttachedToOwner, true); if (Main.rand.NextFloat() < chanceToBecomeAngry) { PlayerAttackCountdown = 300; projectile.netUpdate = true; } + else if (Main.netMode != NetmodeID.MultiplayerClient) + NPC.NewNPC((int)Owner.Center.X, (int)Owner.Center.Y, heartType); } + + if (JawSnapTimer > 0f) + { + JawRotation = JawRotation.AngleTowards(-0.44f, 0.064f); + JawSnapTimer--; + } + else + JawRotation = JawRotation.AngleTowards(0f, 0.03f); } public void Initialize() { - if (projectile.localAI[0] != 0f) + if (projectile.ai[1] != 0f) return; for (int i = 0; i < Segments.Length; i++) @@ -230,7 +264,7 @@ namespace CalamityMod.Projectiles.Summon projectile.Calamity().spawnedPlayerMinionDamageValue = Owner.MinionDamage(); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; - projectile.localAI[0] = 1f; + projectile.ai[1] = 1f; if (Main.myPlayer == projectile.owner) { float rotationalOffset = 0f; @@ -286,7 +320,7 @@ namespace CalamityMod.Projectiles.Summon } Segments[i].Rotation = (aheadPosition - Segments[i].CurrentPosition).ToRotation() + MathHelper.PiOver2; - Segments[i].CurrentPosition = aheadPosition - offsetToDestination.SafeNormalize(Vector2.Zero) * 60f; + Segments[i].CurrentPosition = aheadPosition - offsetToDestination.SafeNormalize(Vector2.Zero) * 48f; // Adjust the ahead positions before interating further. aheadPosition = Segments[i].CurrentPosition; @@ -307,16 +341,18 @@ namespace CalamityMod.Projectiles.Summon Vector2 offsetFromSegment = Vector2.Zero; - offsetFromSegment += new Vector2(direction * 60f, 55f).RotatedBy(segmentToAttachTo.Rotation - (MathHelper.PiOver2 - Arms[i].Rotation * 1.7f - 0.77f) * direction).SafeNormalize(Vector2.UnitY) * 82f; + offsetFromSegment += new Vector2(direction * 35f, 28f).RotatedBy(segmentToAttachTo.Rotation - (MathHelper.PiOver2 - Arms[i].Rotation * 1.7f - 0.77f) * direction).SafeNormalize(Vector2.UnitY) * 62f; Arms[i].Limbs[0].Center = segmentToAttachTo.CurrentPosition + offsetFromSegment; Arms[i].Limbs[0].Rotation = offsetFromSegment.ToRotation(); Arms[i].Limbs[1].Rotation = (Arms[i].Center - Arms[i].Limbs[0].Center).ToRotation(); - Arms[i].Limbs[1].Center = Arms[i].Limbs[0].Center + offsetFromSegment * 0.5f + (Arms[i].Center - Arms[i].Limbs[0].Center).SafeNormalize(Vector2.UnitY) * 84f; + Arms[i].Limbs[1].Center = Arms[i].Limbs[0].Center + offsetFromSegment * 0.5f + (Arms[i].Center - Arms[i].Limbs[0].Center).SafeNormalize(Vector2.UnitY) * 64f; float rotationalVelocityFactor = Utils.InverseLerp(0f, 6f, projectile.velocity.Length(), true); if (CurrentAIState == AIState.AttackEnemy_Charge) rotationalVelocityFactor *= 0.85f; + if (CurrentAIState == AIState.AttackOwner) + rotationalVelocityFactor *= 1.2f; if (Arms[i].ReelingBack) { @@ -388,46 +424,97 @@ namespace CalamityMod.Projectiles.Summon if (!projectile.WithinRange(target.Center, 350f)) { Vector2 destination = target.Center + (AttackTimer / 25f).ToRotationVector2() * MathHelper.Min(target.width * 0.35f, 150f); - projectile.velocity = Vector2.Lerp(projectile.velocity, projectile.SafeDirectionTo(destination) * 34f, 0.05f); + projectile.velocity = Vector2.Lerp(projectile.velocity, projectile.SafeDirectionTo(destination) * 34f, 0.08f); - float updatedDirectionRotation = projectile.velocity.ToRotation().AngleTowards(projectile.AngleTo(destination), 0.07f); + float updatedDirectionRotation = projectile.velocity.ToRotation().AngleTowards(projectile.AngleTo(destination), 0.12f); projectile.velocity = updatedDirectionRotation.ToRotationVector2() * projectile.velocity.Length(); } - else if (projectile.velocity.Length() < 21f) + else if (projectile.velocity.Length() < 29f) + { projectile.velocity *= 1.035f; + if (JawSnapTimer <= 0f) + { + // Open the mouth of the jaw if close but not super close to the target. + if (projectile.WithinRange(target.Center, 270f)) + JawRotation = JawRotation.AngleLerp(0.87f, 0.12f); + + // If really close, snap. + if (projectile.WithinRange(target.Center, 165f)) + { + Main.PlaySound(SoundID.DD2_SkeletonHurt, projectile.Center); + JawSnapTimer = 45f; + } + } + } // Determine the head rotation. projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; - if (Main.myPlayer == projectile.owner && AttackTimer > 280) + if (Main.myPlayer == projectile.owner && AttackTimer > 480) { CurrentAIState = AIState.AttackEnemy_ReleaseDartBurst; AttackTimer = 0; } } + public void AttackOwner() + { + // Attempt to angle towards the owner. + float newSpeed = MathHelper.Lerp(projectile.velocity.Length(), 21f, 0.025f); + + if (!projectile.WithinRange(Owner.Center, 370f)) + { + Vector2 idealVelocity = projectile.SafeDirectionTo(Owner.Center) * newSpeed; + projectile.velocity = projectile.velocity.MoveTowards(idealVelocity, 2f); + + float idealAimDirection = idealVelocity.ToRotation(); + projectile.velocity = projectile.velocity.ToRotation().AngleLerp(idealAimDirection, 0.05f).ToRotationVector2() * projectile.velocity.Length(); + } + else if (projectile.velocity.Length() < 36f) + { + projectile.velocity *= 1.03f; + if (JawSnapTimer <= 0f) + { + // Open the mouth of the jaw if close but not super close to the owner. + if (projectile.WithinRange(Owner.Center, 300f)) + JawRotation = JawRotation.AngleLerp(0.87f, 0.12f); + + // If really close, snap. + if (projectile.WithinRange(Owner.Center, 180f)) + { + Main.PlaySound(SoundID.DD2_SkeletonHurt, projectile.Center); + JawSnapTimer = 45f; + } + } + } + + // Determine the head rotation. + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; + } + public NPC AttemptToFindTarget(float searchDistance) { NPC closestTarget = null; + int heartType = ModContent.NPCType(); if (Owner.HasMinionAttackTargetNPC) { NPC targetedNPC = Main.npc[Owner.MinionAttackTargetNPC]; - if (targetedNPC.WithinRange(projectile.Center, searchDistance) && targetedNPC.CanBeChasedBy()) + if (targetedNPC.WithinRange(projectile.Center, searchDistance) && targetedNPC.CanBeChasedBy() && targetedNPC.type != heartType) return targetedNPC; } float distance = searchDistance * searchDistance; - for (int index = 0; index < Main.maxNPCs; index++) + for (int i = 0; i < Main.maxNPCs; i++) { - if (Main.npc[index].CanBeChasedBy()) + if (Main.npc[i].CanBeChasedBy() && Main.npc[i].type != heartType) { - float extraDistance = (Main.npc[index].width / 2) + (Main.npc[index].height / 2); + float extraDistance = (Main.npc[i].width / 2) + (Main.npc[i].height / 2); - if (Main.npc[index].WithinRange(projectile.Center, distance + extraDistance)) + if (Main.npc[i].WithinRange(projectile.Center, distance + extraDistance)) { - distance = Main.npc[index].DistanceSQ(projectile.Center); - closestTarget = Main.npc[index]; + distance = Main.npc[i].DistanceSQ(projectile.Center); + closestTarget = Main.npc[i]; } } } @@ -441,6 +528,13 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { + float angerFactor = Utils.InverseLerp(300f, 280f, PlayerAttackCountdown, true) * Utils.InverseLerp(0f, 30f, PlayerAttackCountdown, true); + float afterimageOutwardness = MathHelper.Lerp(6f, 8f, (float)Math.Cos(Main.GlobalTime * 2.3f) * 0.5f + 0.5f) * angerFactor; + Color backAfterimageColor = Color.Red * angerFactor; + backAfterimageColor.A = 0; + + Texture2D eyesTexture = ModContent.GetTexture("CalamityMod/Projectiles/Summon/SepulcherMinionEyes"); + Texture2D jawTexture = ModContent.GetTexture("CalamityMod/Projectiles/Summon/SepulcherMinionJaw"); Texture2D headTexture = ModContent.GetTexture("CalamityMod/Projectiles/Summon/SepulcherMinionHead"); Texture2D bodyTexture = ModContent.GetTexture("CalamityMod/Projectiles/Summon/SepulcherMinionBody"); Texture2D bodyTexture2 = ModContent.GetTexture("CalamityMod/Projectiles/Summon/SepulcherMinionBodyAlt"); @@ -451,22 +545,50 @@ namespace CalamityMod.Projectiles.Summon Vector2 drawPosition; - // Draw arms. + // Draw the arms. for (int i = 0; i < Arms.Count; i++) { Vector2 forearmDrawPosition = Arms[i].Limbs[0].Center - Main.screenPosition; Color drawColor = Lighting.GetColor((int)(Arms[i].Limbs[0].Center.X / 16), (int)(Arms[i].Limbs[0].Center.Y / 16)); + + if (afterimageOutwardness > 0f) + { + for (int j = 0; j < 4; j++) + { + Vector2 drawOffset = (MathHelper.TwoPi * j / 4f).ToRotationVector2() * afterimageOutwardness; + spriteBatch.Draw(foreArmTexture, forearmDrawPosition + drawOffset, null, backAfterimageColor, Arms[i].Limbs[0].Rotation + MathHelper.PiOver2, foreArmTexture.Size() * 0.5f, projectile.scale, SpriteEffects.None, 0f); + } + } spriteBatch.Draw(foreArmTexture, forearmDrawPosition, null, drawColor, Arms[i].Limbs[0].Rotation + MathHelper.PiOver2, foreArmTexture.Size() * 0.5f, projectile.scale, SpriteEffects.None, 0f); Vector2 armDrawPosition = Arms[i].Limbs[1].Center - Main.screenPosition; drawColor = Lighting.GetColor((int)(Arms[i].Limbs[1].Center.X / 16), (int)(Arms[i].Limbs[1].Center.Y / 16)); + + if (afterimageOutwardness > 0f) + { + for (int j = 0; j < 4; j++) + { + Vector2 drawOffset = (MathHelper.TwoPi * j / 4f).ToRotationVector2() * afterimageOutwardness; + spriteBatch.Draw(armTexture, armDrawPosition + drawOffset, null, backAfterimageColor, Arms[i].Limbs[1].Rotation + MathHelper.PiOver2, armTexture.Size() * new Vector2(0.5f, 0f), projectile.scale, SpriteEffects.FlipVertically, 0f); + } + } spriteBatch.Draw(armTexture, armDrawPosition, null, drawColor, Arms[i].Limbs[1].Rotation + MathHelper.PiOver2, armTexture.Size() * new Vector2(0.5f, 0f), projectile.scale, SpriteEffects.FlipVertically, 0f); Vector2 handDrawPosition = armDrawPosition; SpriteEffects handDirection = Arms[i].Direction ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + + if (afterimageOutwardness > 0f) + { + for (int j = 0; j < 4; j++) + { + Vector2 drawOffset = (MathHelper.TwoPi * j / 4f).ToRotationVector2() * afterimageOutwardness; + spriteBatch.Draw(handTexture, handDrawPosition + drawOffset, null, backAfterimageColor, Arms[i].Limbs[1].Rotation - MathHelper.PiOver2, handTexture.Size() * new Vector2(0.5f, 0f), projectile.scale, handDirection, 0f); + } + } spriteBatch.Draw(handTexture, handDrawPosition, null, drawColor, Arms[i].Limbs[1].Rotation - MathHelper.PiOver2, handTexture.Size() * new Vector2(0.5f, 0f), projectile.scale, handDirection, 0f); } + // Draw the segments. for (int i = 0; i < Segments.Length; i++) { Texture2D textureToUse = i % 2 == 1 ? bodyTexture2 : bodyTexture; @@ -477,12 +599,54 @@ namespace CalamityMod.Projectiles.Summon drawPosition = Segments[i].CurrentPosition - Main.screenPosition; lightColor = Lighting.GetColor((int)(drawPosition.X + Main.screenPosition.X) / 16, (int)(drawPosition.Y + Main.screenPosition.Y) / 16); + + if (afterimageOutwardness > 0f) + { + for (int j = 0; j < 4; j++) + { + Vector2 drawOffset = (MathHelper.TwoPi * j / 4f).ToRotationVector2() * afterimageOutwardness; + spriteBatch.Draw(textureToUse, drawPosition + drawOffset, null, backAfterimageColor, Segments[i].Rotation, textureToUse.Size() * 0.5f, projectile.scale, SpriteEffects.None, 0f); + } + } spriteBatch.Draw(textureToUse, drawPosition, null, projectile.GetAlpha(lightColor), Segments[i].Rotation, textureToUse.Size() * 0.5f, projectile.scale, SpriteEffects.None, 0f); } drawPosition = projectile.Center - Main.screenPosition; lightColor = Lighting.GetColor((int)(drawPosition.X + Main.screenPosition.X) / 16, (int)(drawPosition.Y + Main.screenPosition.Y) / 16); + + // Draw the jaws. + for (int i = -1; i <= 1; i += 2) + { + float jawBaseOffset = 24f; + SpriteEffects jawSpriteEffect = i == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + Vector2 jawPosition = projectile.Center - Main.screenPosition; + jawPosition += Vector2.UnitX.RotatedBy(projectile.rotation + JawRotation * i) * i * (jawBaseOffset + (float)Math.Sin(JawRotation) * 14f); + jawPosition -= Vector2.UnitY.RotatedBy(projectile.rotation) * (26f + (float)Math.Sin(JawRotation) * 8f); + spriteBatch.Draw(jawTexture, jawPosition, null, projectile.GetAlpha(lightColor), projectile.rotation + JawRotation * i, jawTexture.Size() * 0.5f, projectile.scale * 1.25f, jawSpriteEffect, 0f); + } + + // Draw the head. + if (afterimageOutwardness > 0f) + { + for (int i = 0; i < 4; i++) + { + Vector2 drawOffset = (MathHelper.TwoPi * i / 4f).ToRotationVector2() * afterimageOutwardness; + spriteBatch.Draw(headTexture, drawPosition + drawOffset, null, backAfterimageColor, projectile.rotation, headTexture.Size() * 0.5f, projectile.scale * 1.25f, SpriteEffects.None, 0f); + } + } spriteBatch.Draw(headTexture, drawPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, headTexture.Size() * 0.5f, projectile.scale * 1.25f, SpriteEffects.None, 0f); + + // Draw demonic eyes if enraged. + if (afterimageOutwardness > 0f) + { + for (int i = 0; i < (int)(projectile.oldPos.Length * angerFactor); i++) + { + drawPosition = projectile.Center - Main.screenPosition - projectile.velocity.SafeNormalize(Vector2.Zero) * 3f * i; + Color fadeColor = Color.White * (1f - i / (float)projectile.oldPos.Length); + spriteBatch.Draw(eyesTexture, drawPosition, null, projectile.GetAlpha(fadeColor), projectile.oldRot[i], eyesTexture.Size() * 0.5f, projectile.scale * 1.25f, SpriteEffects.None, 0f); + } + } + return false; } @@ -499,13 +663,6 @@ namespace CalamityMod.Projectiles.Summon return true; } - // And finally arm hands. - for (int i = 0; i < Arms.Count; i++) - { - if (Utils.CenteredRectangle(Arms[i].Center, Vector2.One * 32f).Intersects(targetHitbox)) - return true; - } - return false; } @@ -514,6 +671,20 @@ namespace CalamityMod.Projectiles.Summon drawCacheProjsBehindProjectiles.Add(index); } + #endregion + + #region Damage Stuff + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + damage = Main.rand.Next(80, 90); + } + + public override bool? CanHitNPC(NPC target) + { + if (target.type == ModContent.NPCType()) + return false; + return null; + } #endregion } } diff --git a/Projectiles/Summon/SepulcherMinionEyes.png b/Projectiles/Summon/SepulcherMinionEyes.png new file mode 100644 index 0000000000000000000000000000000000000000..29f526703105e4181a1784a023e6686924dcbdb1 GIT binary patch literal 252 zcmeAS@N?(olHy`uVBq!ia0vp^c0e4#!3-p4ZQ5c8q!^2X+?^QKos)S9^9T5ZxB}^;3YPy*&HO*R0my#j$Ow{REeY}q{tpBUzqj!P0|ht>JR*x3 z82Ao=Fk{xWPEMd;s;7%%NQC>_GaLCD6nGc{H~#r=uDy}DQ)iy3-uGqO9^Uw+{cMJ1 zTHnlMC>8(Y?UdwQ@p@k?vwv$&H_=+w2;Bm)z4*}Q$iB}E1X;E literal 0 HcmV?d00001 diff --git a/Projectiles/Summon/SepulcherMinionHead.png b/Projectiles/Summon/SepulcherMinionHead.png index ce918150f1e3334acb2269f120379bbaccd2d7c1..e1fb4453594bf28e7713d4a41a6008628cee78a0 100644 GIT binary patch delta 711 zcmaFC`+;?WBnLAC1H-IMTMQ>ED%3j#_=LCu`CMGQfrgIS!s0H98tDNV`zD&dKUCi? z<7lHT-B+xCRKe0s#6zA>|Np6(KRi7Pjcr`33*S z1{fGG9e4s%!CBxDSV?q{`4?bhybSQvVBcdKn`bMs!86@B$EXMKuX_M<_ zhGP@e9v#%@>D+uE)aIC4y_>1FXyVz=zfb*^kenT5p}nW8X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=x29jf6uLOb%xV=H}ib|FEohZb{sIKKC+k^eTeT diff --git a/Projectiles/Summon/SepulcherMinionJaw.png b/Projectiles/Summon/SepulcherMinionJaw.png new file mode 100644 index 0000000000000000000000000000000000000000..11df3bb5aebbe5b8413609d8b3b3fbe184119db3 GIT binary patch literal 295 zcmeAS@N?(olHy`uVBq!ia0vp^VnD3L!3-oDE=Au5QjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`MFV_7T!FNc)mncaXw zoCO|{#S9F52SAuH>slu#P_V<(#WBRff9eHBt|JOOE*I6@-q%0*I=kz1lV{n2)_n(V z{OFl~!mBmZ^_EX-=vkTLCnQu7j>(i6q+PvtwkkZ{qh*3 Date: Wed, 23 Jun 2021 01:32:23 -0500 Subject: [PATCH 144/202] 1 - SCal brother fix. --- NPCs/ExoMechs/Thanatos/ThanatosHead.cs | 6 +----- NPCs/SupremeCalamitas/SupremeCataclysm.cs | 7 ++++--- NPCs/SupremeCalamitas/SupremeCatastrophe.cs | 7 ++++--- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs index 31ef75de3f..2c1cdc5508 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs @@ -158,10 +158,6 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; - // Increase aggression if player is taking a long time to kill the boss - if (lifeRatio > calamityGlobalNPC.killTimeRatio_IncreasedAggression) - lifeRatio = calamityGlobalNPC.killTimeRatio_IncreasedAggression; - // Check if the other exo mechs are alive int otherExoMechsAlive = 0; bool exoPrimeAlive = false; @@ -551,7 +547,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos calamityGlobalNPC.newAI[3] += 1f; if (calamityGlobalNPC.newAI[3] >= velocityAdjustTime) { - npc.localAI[0] = 1f; + npc.localAI[0] = /*berserk ? 1f : 0f*/ 1f; AIState = (float)Phase.Charge; calamityGlobalNPC.newAI[2] = 0f; calamityGlobalNPC.newAI[3] = 0f; diff --git a/NPCs/SupremeCalamitas/SupremeCataclysm.cs b/NPCs/SupremeCalamitas/SupremeCataclysm.cs index 2733c47632..af55c1e4bf 100644 --- a/NPCs/SupremeCalamitas/SupremeCataclysm.cs +++ b/NPCs/SupremeCalamitas/SupremeCataclysm.cs @@ -82,6 +82,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (Main.npc[CalamityGlobalNPC.SCalCatastrophe].active) totalLifeRatio += Main.npc[CalamityGlobalNPC.SCalCatastrophe].life / (float)Main.npc[CalamityGlobalNPC.SCalCatastrophe].lifeMax; } + totalLifeRatio *= 0.5f; // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -101,7 +102,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas num677 *= 0.5f; } - int scale = (int)Math.Round(MathHelper.Lerp(2f, 6.5f, totalLifeRatio * 0.5f)); + int scale = (int)Math.Round(MathHelper.Lerp(2f, 6.5f, 1f - totalLifeRatio)); if (npc.ai[3] < distanceX) { npc.ai[3] += scale; @@ -161,7 +162,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } if (npc.localAI[0] >= 120f) { - float fireRate = CalamityWorld.malice ? 2f : MathHelper.Lerp(1f, 2.5f, totalLifeRatio * 0.5f); + float fireRate = CalamityWorld.malice ? 2f : MathHelper.Lerp(1f, 2.5f, 1f - totalLifeRatio); npc.ai[1] += fireRate; if (npc.ai[1] >= 60f) { @@ -174,7 +175,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas Projectile.NewProjectile(npc.Center, new Vector2(-8f, 0f), type, damage, 0f, Main.myPlayer); } } - fireRate = CalamityWorld.malice ? 3f : MathHelper.Lerp(1f, 4f, totalLifeRatio * 0.5f); + fireRate = CalamityWorld.malice ? 3f : MathHelper.Lerp(1f, 4f, 1f - totalLifeRatio); npc.ai[2] += fireRate; if (npc.ai[2] >= 300f) { diff --git a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs index 03a6f65b55..3f626975e3 100644 --- a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs +++ b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs @@ -82,6 +82,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (Main.npc[CalamityGlobalNPC.SCalCataclysm].active) totalLifeRatio += Main.npc[CalamityGlobalNPC.SCalCataclysm].life / (float)Main.npc[CalamityGlobalNPC.SCalCataclysm].lifeMax; } + totalLifeRatio *= 0.5f; // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -101,7 +102,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas num677 *= 0.5f; } - int scale = (int)Math.Round(MathHelper.Lerp(2f, 6.5f, totalLifeRatio * 0.5f)); + int scale = (int)Math.Round(MathHelper.Lerp(2f, 6.5f, 1f - totalLifeRatio)); if (npc.ai[3] < distanceX) { npc.ai[3] += scale; @@ -161,7 +162,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } if (npc.localAI[0] >= 120f) { - float fireRate = CalamityWorld.malice ? 2f : MathHelper.Lerp(1f, 2.5f, totalLifeRatio * 0.5f); + float fireRate = CalamityWorld.malice ? 2f : MathHelper.Lerp(1f, 2.5f, 1f - totalLifeRatio); npc.ai[1] += fireRate; if (npc.ai[1] >= 45f) { @@ -174,7 +175,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas Projectile.NewProjectile(npc.Center, new Vector2(4f, 0f), type, damage, 0f, Main.myPlayer); } } - fireRate = CalamityWorld.malice ? 3f : MathHelper.Lerp(1f, 4f, totalLifeRatio * 0.5f); + fireRate = CalamityWorld.malice ? 3f : MathHelper.Lerp(1f, 4f, 1f - totalLifeRatio); npc.ai[2] += fireRate; if (npc.ai[2] >= 300f) { From f213bff9aab07564f65afd2e0409721d1efc64c3 Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Wed, 23 Jun 2021 17:49:59 -0500 Subject: [PATCH 145/202] 1 - AEW spin attack fix. --- NPCs/Abyss/EidolonWyrmBodyAltHuge.cs | 2 +- NPCs/Abyss/EidolonWyrmBodyHuge.cs | 4 ++-- NPCs/Abyss/EidolonWyrmHeadHuge.cs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/NPCs/Abyss/EidolonWyrmBodyAltHuge.cs b/NPCs/Abyss/EidolonWyrmBodyAltHuge.cs index bee2fbc7da..dab9292565 100644 --- a/NPCs/Abyss/EidolonWyrmBodyAltHuge.cs +++ b/NPCs/Abyss/EidolonWyrmBodyAltHuge.cs @@ -112,7 +112,7 @@ namespace CalamityMod.NPCs.Abyss { npc.localAI[0] += 1f; float shootShadowFireballGateValue = 90f; - float divisor = 5f; + float divisor = 2f; if (npc.ai[3] % divisor == 0f && npc.localAI[0] >= shootShadowFireballGateValue) { npc.localAI[0] = 0f; diff --git a/NPCs/Abyss/EidolonWyrmBodyHuge.cs b/NPCs/Abyss/EidolonWyrmBodyHuge.cs index c808772239..6b6f7a32b3 100644 --- a/NPCs/Abyss/EidolonWyrmBodyHuge.cs +++ b/NPCs/Abyss/EidolonWyrmBodyHuge.cs @@ -111,8 +111,8 @@ namespace CalamityMod.NPCs.Abyss if (Vector2.Distance(npc.Center, Main.player[Main.npc[(int)npc.ai[2]].target].Center) > 160f) { npc.localAI[0] += 1f; - float spawnAncientLightGateValue = 180f; - float divisor = 10f; + float spawnAncientLightGateValue = 120f; + float divisor = 4f; if (npc.ai[3] % divisor == 0f && npc.localAI[0] >= spawnAncientLightGateValue) { npc.localAI[0] = 0f; diff --git a/NPCs/Abyss/EidolonWyrmHeadHuge.cs b/NPCs/Abyss/EidolonWyrmHeadHuge.cs index 77075bb406..4ecf4c442c 100644 --- a/NPCs/Abyss/EidolonWyrmHeadHuge.cs +++ b/NPCs/Abyss/EidolonWyrmHeadHuge.cs @@ -207,7 +207,7 @@ namespace CalamityMod.NPCs.Abyss Main.npc[Previous].ai[0] = lol; NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, lol, 0f, 0f, 0f, 0); Previous = lol; - Main.npc[Previous].ai[3] = i; + Main.npc[Previous].ai[3] = i / 2; } TailSpawned = true; } From e3678212cdbb814aa1a102f00e8da1dc30159ba3 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Thu, 24 Jun 2021 05:44:01 +0200 Subject: [PATCH 146/202] Thanatos laser (telegraph) attachment problem fix No, I don't know why just passing this into NewProjectile doesn't work --- NPCs/ExoMechs/Thanatos/ThanatosHead.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs index 2c1cdc5508..933b025751 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs @@ -619,10 +619,13 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { float squishedRatio = (float)Math.Pow((float)Math.Sin(MathHelper.Pi * b / 6f), 2D); float smoothenedRatio = MathHelper.SmoothStep(0f, 1f, squishedRatio); + Main.projectile[beam].ai[0] = npc.whoAmI; Main.projectile[beam].ai[1] = MathHelper.Lerp(-0.74f, 0.74f, smoothenedRatio); } } - Projectile.NewProjectile(npc.Center, Vector2.Zero, type, 0, 0f, 255, npc.whoAmI); + int beam2 = Projectile.NewProjectile(npc.Center, Vector2.Zero, type, 0, 0f, 255, npc.whoAmI); + if (Main.projectile.IndexInRange(beam2)) + Main.projectile[beam2].ai[0] = npc.whoAmI; } } } @@ -635,7 +638,9 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { int type = ModContent.ProjectileType(); int damage = npc.GetProjectileDamage(type); - Projectile.NewProjectile(npc.Center, Vector2.Zero, type, damage, 0f, 255, npc.whoAmI); + int laser = Projectile.NewProjectile(npc.Center, Vector2.Zero, type, damage, 0f, 255, npc.whoAmI); + if (Main.projectile.IndexInRange(laser)) + Main.projectile[laser].ai[0] = npc.whoAmI; } } } From cb162113af969d474a5cd24f8b24b46cc9e7a3e2 Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Thu, 24 Jun 2021 15:25:59 -0500 Subject: [PATCH 147/202] 1 - Gale fix. 2 - Apoc Array and Ion Blaster slight nerf. --- Items/Weapons/Magic/ApoctosisArray.cs | 4 ++-- Items/Weapons/Magic/IonBlaster.cs | 4 ++-- Items/Weapons/Ranged/HeavenlyGale.cs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Items/Weapons/Magic/ApoctosisArray.cs b/Items/Weapons/Magic/ApoctosisArray.cs index 697bcfefef..12b0b3658a 100644 --- a/Items/Weapons/Magic/ApoctosisArray.cs +++ b/Items/Weapons/Magic/ApoctosisArray.cs @@ -45,8 +45,8 @@ namespace CalamityMod.Items.Weapons.Magic if (injectionNerf) manaRatio = MathHelper.Min(manaRatio, 0.65f); - // 20% to 220% damage. Astral Injection caps it at 124% damage. - float damageRatio = 0.2f + 1.6f * manaRatio; + // 20% to 160% damage. Astral Injection caps it at 111% damage. + float damageRatio = 0.2f + 1.4f * manaRatio; int finalDamage = (int)(damage * damageRatio); Projectile proj = Projectile.NewProjectileDirect(position, new Vector2(speedX, speedY), type, finalDamage, knockBack, player.whoAmI); diff --git a/Items/Weapons/Magic/IonBlaster.cs b/Items/Weapons/Magic/IonBlaster.cs index fd77de50fa..e1cf2a27fc 100644 --- a/Items/Weapons/Magic/IonBlaster.cs +++ b/Items/Weapons/Magic/IonBlaster.cs @@ -46,8 +46,8 @@ namespace CalamityMod.Items.Weapons.Magic if (injectionNerf) manaRatio = MathHelper.Min(manaRatio, 0.65f); - // 20% to 180% damage. Astral Injection caps it at 124% damage. - float damageRatio = 0.2f + 1.6f * manaRatio; + // 20% to 160% damage. Astral Injection caps it at 111% damage. + float damageRatio = 0.2f + 1.4f * manaRatio; int finalDamage = (int)(damage * damageRatio); Projectile proj = Projectile.NewProjectileDirect(position, new Vector2(speedX, speedY), type, finalDamage, knockBack, player.whoAmI); diff --git a/Items/Weapons/Ranged/HeavenlyGale.cs b/Items/Weapons/Ranged/HeavenlyGale.cs index cad26edbf9..232861159f 100644 --- a/Items/Weapons/Ranged/HeavenlyGale.cs +++ b/Items/Weapons/Ranged/HeavenlyGale.cs @@ -48,7 +48,6 @@ namespace CalamityMod.Items.Weapons.Ranged public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Vector2 source = player.RotatedRelativePoint(player.MountedCenter, true); - float dmgMult = 1f; float piOver10 = MathHelper.Pi * 0.1f; int arrowAmt = 5; Vector2 speed = new Vector2(speedX, speedY); @@ -98,6 +97,7 @@ namespace CalamityMod.Items.Weapons.Ranged break; } + float dmgMult = 1f; if (arrowTypes[i] == ProjectileType()) dmgMult = 0.5f; From 9ee6afa248554fdcd5989c45bb4158a9b5cf828e Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Thu, 24 Jun 2021 20:09:42 -0500 Subject: [PATCH 148/202] 1 - Nerfed healing on a couple projectiles. --- Projectiles/Melee/Blood.cs | 2 +- Projectiles/Melee/Leech.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Projectiles/Melee/Blood.cs b/Projectiles/Melee/Blood.cs index 2973ab8a00..4e04f7104e 100644 --- a/Projectiles/Melee/Blood.cs +++ b/Projectiles/Melee/Blood.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Melee if (player.moonLeech) return; - int healAmt = projectile.ai[0] == 1f ? 3 : 5; + int healAmt = 2; player.statLife += healAmt; player.HealEffect(healAmt); } diff --git a/Projectiles/Melee/Leech.cs b/Projectiles/Melee/Leech.cs index 9774c32ebe..6bd904b1b7 100644 --- a/Projectiles/Melee/Leech.cs +++ b/Projectiles/Melee/Leech.cs @@ -53,8 +53,8 @@ namespace CalamityMod.Projectiles.Melee return; Player player = Main.player[projectile.owner]; - player.statLife += 5; - player.HealEffect(5); + player.statLife += 2; + player.HealEffect(2); } } } From 982beda726fbeface5286c3ee8407566d4504d36 Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Fri, 25 Jun 2021 01:30:35 -0500 Subject: [PATCH 149/202] 1 - Ancient Shiv projectile local i-frames. --- Projectiles/Melee/BlueAura.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Projectiles/Melee/BlueAura.cs b/Projectiles/Melee/BlueAura.cs index 8908e5b14f..51f745879f 100644 --- a/Projectiles/Melee/BlueAura.cs +++ b/Projectiles/Melee/BlueAura.cs @@ -21,6 +21,8 @@ namespace CalamityMod.Projectiles.Melee projectile.tileCollide = false; projectile.penetrate = -1; projectile.timeLeft = 300; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; } public override void AI() From 2f060b9398f05bbbeb82145aef34d5afeb52601b Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 13:16:46 -0500 Subject: [PATCH 150/202] DirectionTo safening --- Items/Weapons/Magic/ElementalRay.cs | 2 +- Items/Weapons/Melee/Violence.cs | 9 ++------- Projectiles/Magic/ApotheosisWorm.cs | 2 +- Projectiles/Magic/FabRay.cs | 2 +- Projectiles/Magic/RainbowRocket.cs | 2 +- Projectiles/Magic/RedirectingFire.cs | 2 +- Projectiles/Melee/ViolenceSlashProjectile.cs | 2 +- Projectiles/Melee/ViolenceThrownProjectile.cs | 6 +++--- Projectiles/Ranged/CondemnationArrowHoming.cs | 2 +- Projectiles/Ranged/PrismComet.cs | 2 +- Projectiles/Ranged/PrismMine.cs | 2 +- Projectiles/Rogue/PrismRocket.cs | 2 +- Projectiles/Rogue/SacrificeProjectile.cs | 2 +- Projectiles/Summon/DaedalusGolem.cs | 6 +++--- Projectiles/Summon/EyeOfNightSummon.cs | 4 ++-- Projectiles/Summon/FleshBallMinion.cs | 2 +- Projectiles/Summon/FlowersOfMortalityPetal.cs | 2 +- Projectiles/Summon/LostSoulGiant.cs | 2 +- Projectiles/Summon/MortalityBeam.cs | 2 +- Projectiles/Summon/SeekerSummonProj.cs | 6 +++--- Projectiles/Summon/SlimePuppet.cs | 6 +++--- Projectiles/Summon/ViridVanguardBlade.cs | 2 +- Projectiles/Summon/WitherBlossom.cs | 2 +- Projectiles/Summon/WitherBolt.cs | 2 +- 24 files changed, 34 insertions(+), 39 deletions(-) diff --git a/Items/Weapons/Magic/ElementalRay.cs b/Items/Weapons/Magic/ElementalRay.cs index 3b06d836ce..2c6d165a4e 100644 --- a/Items/Weapons/Magic/ElementalRay.cs +++ b/Items/Weapons/Magic/ElementalRay.cs @@ -67,7 +67,7 @@ namespace CalamityMod.Items.Weapons.Magic return false; } - Vector2 spawnOffset = player.DirectionTo(Main.MouseWorld).RotatedBy(offsetAngle) * -Main.rand.NextFloat(40f, 96f); + Vector2 spawnOffset = player.SafeDirectionTo(Main.MouseWorld, Vector2.UnitY).RotatedBy(offsetAngle) * -Main.rand.NextFloat(40f, 96f); Vector2 shootDirection = (Main.MouseWorld - (position + spawnOffset)).SafeNormalize(Vector2.UnitX * player.direction); int beam = Projectile.NewProjectile(position + spawnOffset, shootDirection * shootSpeed, type, damage, knockBack, player.whoAmI); diff --git a/Items/Weapons/Melee/Violence.cs b/Items/Weapons/Melee/Violence.cs index 9e022355b3..4e2c3c558a 100644 --- a/Items/Weapons/Melee/Violence.cs +++ b/Items/Weapons/Melee/Violence.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetStaticDefaults() { DisplayName.SetDefault("Violence"); - Tooltip.SetDefault("Does things"); + Tooltip.SetDefault("Releases a blazing fork which stays near the mouse and shreds enemies"); } public override void SetDefaults() @@ -37,17 +37,12 @@ namespace CalamityMod.Items.Weapons.Melee item.shootSpeed = 15f; } - public override bool AltFunctionUse(Player player) => true; - public override bool CanUseItem(Player player) => player.altFunctionUse == 2 || player.ownedProjectileCounts[item.shoot] <= 0; public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - if (player.altFunctionUse != 2) - return true; - Vector2 shootVelocity = new Vector2(speedX, speedY); - Projectile.NewProjectile(position, shootVelocity, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, shootVelocity.ToRotation()); + Projectile.NewProjectile(position, shootVelocity, type, damage, knockBack, player.whoAmI, 0f, shootVelocity.ToRotation()); return false; } } diff --git a/Projectiles/Magic/ApotheosisWorm.cs b/Projectiles/Magic/ApotheosisWorm.cs index 6d9f798e74..e466ab8f1a 100644 --- a/Projectiles/Magic/ApotheosisWorm.cs +++ b/Projectiles/Magic/ApotheosisWorm.cs @@ -210,7 +210,7 @@ namespace CalamityMod.Projectiles.Magic FlyAcceleration = MathHelper.Lerp(FlyAcceleration, idealFlyAcceleration, 0.3f); - float directionToTargetOrthogonality = Vector2.Dot(projectile.velocity.SafeNormalize(Vector2.Zero), projectile.DirectionTo(destination)); + float directionToTargetOrthogonality = Vector2.Dot(projectile.velocity.SafeNormalize(Vector2.Zero), projectile.SafeDirectionTo(destination)); // Fly towards the target if it's far. if (distanceFromDestination > 320f) diff --git a/Projectiles/Magic/FabRay.cs b/Projectiles/Magic/FabRay.cs index 2d75e9d2d7..137015fad6 100644 --- a/Projectiles/Magic/FabRay.cs +++ b/Projectiles/Magic/FabRay.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Magic NPC potentialTarget = projectile.Center.ClosestNPCAt(180f, false); if (potentialTarget != null) { - Vector2 shootVelocity = projectile.DirectionTo(potentialTarget.Center) * 13f; + Vector2 shootVelocity = projectile.SafeDirectionTo(potentialTarget.Center) * 13f; Projectile.NewProjectile(projectile.Center - shootVelocity * 2.5f, shootVelocity, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner); } diff --git a/Projectiles/Magic/RainbowRocket.cs b/Projectiles/Magic/RainbowRocket.cs index c5c12a0efa..6b2b51ff60 100644 --- a/Projectiles/Magic/RainbowRocket.cs +++ b/Projectiles/Magic/RainbowRocket.cs @@ -86,7 +86,7 @@ namespace CalamityMod.Projectiles.Magic projectile.velocity = projectile.velocity.RotatedBy(MathHelper.Clamp(angleOffset, -0.2f, 0.2f)); projectile.velocity = projectile.velocity.SafeNormalize(-Vector2.UnitY) * (projectile.velocity.Length() + HomingAcceleration); - if (Vector2.Dot(projectile.velocity.SafeNormalize(Vector2.Zero), projectile.DirectionTo(target.Center)) < 0.75f) + if (Vector2.Dot(projectile.velocity.SafeNormalize(Vector2.Zero), projectile.SafeDirectionTo(target.Center)) < 0.75f) projectile.velocity *= 0.75f; } #endregion diff --git a/Projectiles/Magic/RedirectingFire.cs b/Projectiles/Magic/RedirectingFire.cs index 808b34a254..d738f7a43a 100644 --- a/Projectiles/Magic/RedirectingFire.cs +++ b/Projectiles/Magic/RedirectingFire.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Magic float delayFactor = Utils.InverseLerp(20f, 35f, Time, true); float homeSpeed = MathHelper.Lerp(0f, 0.075f, delayFactor); - projectile.velocity = Vector2.Lerp(projectile.velocity, projectile.DirectionTo(target.Center) * 16f, homeSpeed); + projectile.velocity = Vector2.Lerp(projectile.velocity, projectile.SafeDirectionTo(target.Center) * 16f, homeSpeed); projectile.velocity = projectile.velocity.SafeNormalize(Vector2.UnitY) * oldSpeed; projectile.position += (target.Center - projectile.Center).SafeNormalize(Vector2.Zero) * MathHelper.Lerp(25f, 1f, Utils.InverseLerp(100f, 360f, projectile.Distance(target.Center), true)) * delayFactor; } diff --git a/Projectiles/Melee/ViolenceSlashProjectile.cs b/Projectiles/Melee/ViolenceSlashProjectile.cs index dcc4ee91ba..90f645103c 100644 --- a/Projectiles/Melee/ViolenceSlashProjectile.cs +++ b/Projectiles/Melee/ViolenceSlashProjectile.cs @@ -65,7 +65,7 @@ namespace CalamityMod.Projectiles.Melee if (Main.myPlayer == projectile.owner && !projectile.WithinRange(Main.MouseWorld, projectile.height + 15f)) { - projectile.velocity = projectile.DirectionTo(Main.MouseWorld); + projectile.velocity = projectile.SafeDirectionTo(Main.MouseWorld); projectile.netSpam = 0; projectile.netUpdate = true; } diff --git a/Projectiles/Melee/ViolenceThrownProjectile.cs b/Projectiles/Melee/ViolenceThrownProjectile.cs index b9c33c3445..0fcf8ac827 100644 --- a/Projectiles/Melee/ViolenceThrownProjectile.cs +++ b/Projectiles/Melee/ViolenceThrownProjectile.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Melee { ReturnToOwner(); - float idealAngle = projectile.AngleTo(Owner.Center) - MathHelper.PiOver4 + MathHelper.Pi; + float idealAngle = projectile.AngleTo(Owner.Center) - MathHelper.PiOver4; projectile.rotation = projectile.rotation.AngleLerp(idealAngle, 0.1f); projectile.rotation = projectile.rotation.AngleTowards(idealAngle, 0.25f); } @@ -69,7 +69,7 @@ namespace CalamityMod.Projectiles.Melee if (projectile.WithinRange(Main.MouseWorld, projectile.velocity.Length() * 0.7f)) projectile.Center = Main.MouseWorld; else - projectile.velocity = (projectile.velocity * 6f + projectile.DirectionTo(Main.MouseWorld) * 14f) / 7f; + projectile.velocity = (projectile.velocity * 3f + projectile.DirectionTo(Main.MouseWorld) * 19f) / 4f; projectile.netSpam = 0; projectile.netUpdate = true; } @@ -77,7 +77,7 @@ namespace CalamityMod.Projectiles.Melee internal void ReturnToOwner() { projectile.Center = Vector2.Lerp(projectile.Center, Owner.Center, 0.02f); - projectile.velocity = projectile.DirectionTo(Owner.Center) * 15f; + projectile.velocity = projectile.SafeDirectionTo(Owner.Center) * 22f; if (projectile.Hitbox.Intersects(Owner.Hitbox)) { for (int i = 0; i < 75; i++) diff --git a/Projectiles/Ranged/CondemnationArrowHoming.cs b/Projectiles/Ranged/CondemnationArrowHoming.cs index 6e5d09f1d1..14d7acf2b3 100644 --- a/Projectiles/Ranged/CondemnationArrowHoming.cs +++ b/Projectiles/Ranged/CondemnationArrowHoming.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Ranged NPC potentialTarget = projectile.Center.ClosestNPCAt(1500f, false); if (potentialTarget != null) - projectile.velocity = (projectile.velocity * 29f + projectile.DirectionTo(potentialTarget.Center) * 21f) / 30f; + projectile.velocity = (projectile.velocity * 29f + projectile.SafeDirectionTo(potentialTarget.Center) * 21f) / 30f; projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; Time++; } diff --git a/Projectiles/Ranged/PrismComet.cs b/Projectiles/Ranged/PrismComet.cs index 044092df73..5fc4a36842 100644 --- a/Projectiles/Ranged/PrismComet.cs +++ b/Projectiles/Ranged/PrismComet.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Ranged { NPC potentialTarget = projectile.Center.ClosestNPCAt(1050f); if (potentialTarget != null) - projectile.velocity = (projectile.velocity * 12f + projectile.DirectionTo(potentialTarget.Center) * 19f) / 13f; + projectile.velocity = (projectile.velocity * 12f + projectile.SafeDirectionTo(potentialTarget.Center) * 19f) / 13f; } else projectile.velocity *= 1.05f; diff --git a/Projectiles/Ranged/PrismMine.cs b/Projectiles/Ranged/PrismMine.cs index 9cf3e0b32f..b2e06f1ef6 100644 --- a/Projectiles/Ranged/PrismMine.cs +++ b/Projectiles/Ranged/PrismMine.cs @@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.Ranged Vector2 laserOrigin = frame.Size() * 0.5f; while (remainingDistance > frame.Height * laserScale) { - Vector2 laserDrawPosition = projectile.Center + projectile.DirectionTo(destination) * remainingDistance - Main.screenPosition; + Vector2 laserDrawPosition = projectile.Center + projectile.SafeDirectionTo(destination, -Vector2.UnitY) * remainingDistance - Main.screenPosition; spriteBatch.Draw(laserTexture, laserDrawPosition, frame, laserColor, rotation, laserOrigin, laserScale, SpriteEffects.None, 0f); remainingDistance -= frame.Height * laserScale; } diff --git a/Projectiles/Rogue/PrismRocket.cs b/Projectiles/Rogue/PrismRocket.cs index 90d8e9004e..482518b704 100644 --- a/Projectiles/Rogue/PrismRocket.cs +++ b/Projectiles/Rogue/PrismRocket.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Rogue if (!projectile.WithinRange(target.Center, 30f)) { - projectile.velocity = (projectile.velocity * 5f + projectile.DirectionTo(target.Center) * newSpeed) / 6f; + projectile.velocity = (projectile.velocity * 5f + projectile.SafeDirectionTo(target.Center) * newSpeed) / 6f; projectile.velocity = projectile.velocity.ToRotation().AngleTowards(projectile.AngleTo(target.Center), 0.15f).ToRotationVector2() * newSpeed; } } diff --git a/Projectiles/Rogue/SacrificeProjectile.cs b/Projectiles/Rogue/SacrificeProjectile.cs index 1487b2ab70..e86e784981 100644 --- a/Projectiles/Rogue/SacrificeProjectile.cs +++ b/Projectiles/Rogue/SacrificeProjectile.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Rogue if (ReturningToOwner) { projectile.timeLeft = 2; - projectile.velocity = projectile.DirectionTo(Owner.Center) * 24f; + projectile.velocity = projectile.SafeDirectionTo(Owner.Center) * 24f; projectile.rotation = projectile.velocity.ToRotation() + MathHelper.Pi + MathHelper.PiOver4; // Heal the player and disappear when touching them. diff --git a/Projectiles/Summon/DaedalusGolem.cs b/Projectiles/Summon/DaedalusGolem.cs index 0090806db9..ef481613a1 100644 --- a/Projectiles/Summon/DaedalusGolem.cs +++ b/Projectiles/Summon/DaedalusGolem.cs @@ -138,7 +138,7 @@ namespace CalamityMod.Projectiles.Summon Main.PlaySound(SoundID.Item122, ArmPosition); if (Main.myPlayer == projectile.owner) { - Vector2 initialVelocity = projectile.DirectionTo(potentialTarget.Center) * 2f; + Vector2 initialVelocity = projectile.SafeDirectionTo(potentialTarget.Center) * 2f; if (Main.rand.NextBool(2)) initialVelocity = initialVelocity.RotatedByRandom(0.4f); float initialAngle = initialVelocity.ToRotation(); @@ -148,7 +148,7 @@ namespace CalamityMod.Projectiles.Summon } else if (!UsingChargedLaserAttack && AttackTimer == ChargedPelletAttackTime / 2 && Main.myPlayer == projectile.owner) { - Vector2 initialVelocity = projectile.DirectionTo(potentialTarget.Center + potentialTarget.velocity * 15f) * 19f; + Vector2 initialVelocity = projectile.SafeDirectionTo(potentialTarget.Center + potentialTarget.velocity * 15f) * 19f; Projectile.NewProjectile(ArmPosition, initialVelocity, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner); } } @@ -187,7 +187,7 @@ namespace CalamityMod.Projectiles.Summon projectile.tileCollide = false; if (projectile.DistanceSQ(destination - Vector2.UnitY * 16f) > 10f * 10f) - projectile.velocity = projectile.DirectionTo(destination - Vector2.UnitY * 16f) * 6f; + projectile.velocity = projectile.SafeDirectionTo(destination - Vector2.UnitY * 16f) * 6f; else StuckWalkThroughWallsTimer = 0; diff --git a/Projectiles/Summon/EyeOfNightSummon.cs b/Projectiles/Summon/EyeOfNightSummon.cs index a9b64e428c..6af7ff3d56 100644 --- a/Projectiles/Summon/EyeOfNightSummon.cs +++ b/Projectiles/Summon/EyeOfNightSummon.cs @@ -89,7 +89,7 @@ namespace CalamityMod.Projectiles.Summon internal void FlyNearOwner() { Vector2 destination = Owner.Top - Vector2.UnitY * 45f + (projectile.identity * 0.9f).ToRotationVector2() * 16f; - Vector2 idealVelocity = projectile.DirectionTo(destination) * MathHelper.Lerp(2.3f, 8f, Utils.InverseLerp(16f, 160f, projectile.Distance(destination))); + Vector2 idealVelocity = projectile.SafeDirectionTo(destination) * MathHelper.Lerp(2.3f, 8f, Utils.InverseLerp(16f, 160f, projectile.Distance(destination))); if (projectile.velocity.Length() < 0.4f) projectile.velocity = Vector2.UnitY.RotatedBy(Main.rand.NextFloat(0.5f, 1.1f) * Main.rand.NextBool(2).ToDirectionInt()) * -3.6f; else if (!projectile.WithinRange(destination, 20f)) @@ -110,7 +110,7 @@ namespace CalamityMod.Projectiles.Summon { if (Main.myPlayer == projectile.owner && HoverTime % 30 == 29) { - Projectile.NewProjectile(projectile.Center, projectile.DirectionTo(target.Center) * 8f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner); + Projectile.NewProjectile(projectile.Center, projectile.SafeDirectionTo(target.Center) * 8f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner); HoverTime++; } diff --git a/Projectiles/Summon/FleshBallMinion.cs b/Projectiles/Summon/FleshBallMinion.cs index 210163db55..57dab5bbee 100644 --- a/Projectiles/Summon/FleshBallMinion.cs +++ b/Projectiles/Summon/FleshBallMinion.cs @@ -125,7 +125,7 @@ namespace CalamityMod.Projectiles.Summon if (SittingOnGround && HopTimer % 20f == 19f) { - projectile.velocity = projectile.DirectionTo(target.Center) * 6f + new Vector2(Math.Sign(projectile.velocity.X) * 2f, -7f); + projectile.velocity = projectile.SafeDirectionTo(target.Center) * 6f + new Vector2(Math.Sign(projectile.velocity.X) * 2f, -7f); // Release a bunch of blood. if (Main.myPlayer == projectile.owner) diff --git a/Projectiles/Summon/FlowersOfMortalityPetal.cs b/Projectiles/Summon/FlowersOfMortalityPetal.cs index 17244ae025..b743c1018e 100644 --- a/Projectiles/Summon/FlowersOfMortalityPetal.cs +++ b/Projectiles/Summon/FlowersOfMortalityPetal.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Summon NPC potentialTarget = projectile.Center.MinionHoming(1050f, Owner, false); if (Time % 25 == 24 && Main.myPlayer == projectile.owner && potentialTarget != null) { - Vector2 shootVelocity = projectile.DirectionTo(potentialTarget.Center) * 10f; + Vector2 shootVelocity = projectile.SafeDirectionTo(potentialTarget.Center) * 10f; Projectile.NewProjectile(projectile.Center, shootVelocity, ModContent.ProjectileType(), projectile.damage / 3, projectile.knockBack, projectile.owner); } projectile.Center = player.Center + OffsetAngle.ToRotationVector2() * (150f + (float)Math.Sin(Time * 0.08f) * 15f); diff --git a/Projectiles/Summon/LostSoulGiant.cs b/Projectiles/Summon/LostSoulGiant.cs index 13123a056d..b7caaff612 100644 --- a/Projectiles/Summon/LostSoulGiant.cs +++ b/Projectiles/Summon/LostSoulGiant.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Summon public static void HomeInOnTarget(Projectile projectile, NPC target) { float speed = MathHelper.Lerp(11f, 21f, (float)Math.Sin(projectile.identity % 7f / 7f * MathHelper.TwoPi) * 0.5f + 0.5f); - projectile.velocity = Vector2.Lerp(projectile.velocity, projectile.DirectionTo(target.Center) * speed, 0.075f); + projectile.velocity = Vector2.Lerp(projectile.velocity, projectile.SafeDirectionTo(target.Center) * speed, 0.075f); } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Summon/MortalityBeam.cs b/Projectiles/Summon/MortalityBeam.cs index 3faca61c1d..622f0b5b14 100644 --- a/Projectiles/Summon/MortalityBeam.cs +++ b/Projectiles/Summon/MortalityBeam.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Projectiles.Summon Time++; NPC potentialTarget = projectile.Center.MinionHoming(1000f, Main.player[projectile.owner], false); if (potentialTarget != null) - projectile.velocity = (projectile.velocity * 5f + projectile.DirectionTo(potentialTarget.Center) * 13f) / 6f; + projectile.velocity = (projectile.velocity * 5f + projectile.SafeDirectionTo(potentialTarget.Center) * 13f) / 6f; } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Summon/SeekerSummonProj.cs b/Projectiles/Summon/SeekerSummonProj.cs index cbf10e1020..7805fd543a 100644 --- a/Projectiles/Summon/SeekerSummonProj.cs +++ b/Projectiles/Summon/SeekerSummonProj.cs @@ -103,7 +103,7 @@ namespace CalamityMod.Projectiles.Summon projectile.Center = Vector2.Lerp(projectile.Center, destination, 0.03f); if (!projectile.WithinRange(destination, 20f)) - projectile.velocity = (projectile.velocity * 20f + projectile.DirectionTo(destination) * 16f) / 21f; + projectile.velocity = (projectile.velocity * 20f + projectile.SafeDirectionTo(destination) * 16f) / 21f; if (!projectile.WithinRange(Owner.Center, 1800f)) { @@ -142,9 +142,9 @@ namespace CalamityMod.Projectiles.Summon projectile.spriteDirection = (projectile.velocity.X > 0f).ToDirectionInt(); if (!projectile.WithinRange(target.Center, 400f)) - projectile.velocity = (projectile.velocity * 10f + projectile.DirectionTo(target.Center) * 22f) / 11f; + projectile.velocity = (projectile.velocity * 10f + projectile.SafeDirectionTo(target.Center) * 22f) / 11f; else if (projectile.velocity.Length() < 28f) - projectile.velocity = projectile.DirectionTo(target.Center) * 29f; + projectile.velocity = projectile.SafeDirectionTo(target.Center) * 29f; } } } diff --git a/Projectiles/Summon/SlimePuppet.cs b/Projectiles/Summon/SlimePuppet.cs index a7b390487e..2141fdc467 100644 --- a/Projectiles/Summon/SlimePuppet.cs +++ b/Projectiles/Summon/SlimePuppet.cs @@ -48,14 +48,14 @@ namespace CalamityMod.Projectiles.Summon Vector2 destination = Owner.Center - Vector2.UnitY.RotatedBy(destinationAngularOffset) * 160f; if (projectile.DistanceSQ(destination) > 18f * 18f) - projectile.velocity = (projectile.velocity * 20f + projectile.DirectionTo(destination) * 9f) / 21f; + projectile.velocity = (projectile.velocity * 20f + projectile.SafeDirectionTo(destination) * 9f) / 21f; } else { float nudgedVelocityDirection = projectile.velocity.ToRotation().AngleTowards(projectile.AngleTo(potentialTarget.Center), 0.078f); projectile.velocity = nudgedVelocityDirection.ToRotationVector2() * MathHelper.Lerp(projectile.velocity.Length(), 16f, 0.25f); - if (projectile.DistanceSQ(potentialTarget.Center) < 120f * 120f) - projectile.Center += projectile.DirectionTo(potentialTarget.Center) * 3f; + if (projectile.WithinRange(potentialTarget.Center, 120f)) + projectile.Center += projectile.SafeDirectionTo(potentialTarget.Center) * 3f; } if (projectile.ai[0] > 0f) { diff --git a/Projectiles/Summon/ViridVanguardBlade.cs b/Projectiles/Summon/ViridVanguardBlade.cs index c6586277c0..df19971af4 100644 --- a/Projectiles/Summon/ViridVanguardBlade.cs +++ b/Projectiles/Summon/ViridVanguardBlade.cs @@ -121,7 +121,7 @@ namespace CalamityMod.Projectiles.Summon else if (FiringTime == 80f) { PostSliceDeathTimer = 80; - projectile.velocity = projectile.DirectionTo(Main.MouseWorld) * 30f; + projectile.velocity = projectile.SafeDirectionTo(Main.MouseWorld) * 30f; } else if (FiringTime == 1f) { diff --git a/Projectiles/Summon/WitherBlossom.cs b/Projectiles/Summon/WitherBlossom.cs index 003223e8b8..94bf3ee576 100644 --- a/Projectiles/Summon/WitherBlossom.cs +++ b/Projectiles/Summon/WitherBlossom.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Summon NPC potentialTarget = projectile.Center.MinionHoming(950f, Owner); if (Time % 50 == 49 && Main.myPlayer == projectile.owner && potentialTarget != null) { - Vector2 shootVelocity = projectile.DirectionTo(potentialTarget.Center).RotatedByRandom(0.25f) * 8f; + Vector2 shootVelocity = projectile.SafeDirectionTo(potentialTarget.Center).RotatedByRandom(0.25f) * 8f; Projectile.NewProjectile(projectile.Center, shootVelocity, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner); } projectile.Center = player.Center + OffsetAngle.ToRotationVector2() * 150f; diff --git a/Projectiles/Summon/WitherBolt.cs b/Projectiles/Summon/WitherBolt.cs index 34abcec8de..fed98e329a 100644 --- a/Projectiles/Summon/WitherBolt.cs +++ b/Projectiles/Summon/WitherBolt.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Summon NPC potentialTarget = projectile.Center.MinionHoming(800f, Main.player[projectile.owner]); if (potentialTarget != null) - projectile.velocity = (projectile.velocity * 3f + projectile.DirectionTo(potentialTarget.Center) * oldSpeed) / 4f; + projectile.velocity = (projectile.velocity * 3f + projectile.SafeDirectionTo(potentialTarget.Center) * oldSpeed) / 4f; projectile.velocity = projectile.velocity.SafeNormalize(Vector2.UnitY) * oldSpeed * 1.01f; projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; From 18217f2115e62a6c67fb419b5a4773c4e0809fd2 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 13:17:01 -0500 Subject: [PATCH 151/202] Bordernado update --- Effects/BordernadoFire.fx | 26 ++++++++++---------------- Effects/BordernadoFire.xnb | Bin 3132 -> 3416 bytes Projectiles/Boss/InfernadoRevenge.cs | 11 ++++++----- 3 files changed, 16 insertions(+), 21 deletions(-) diff --git a/Effects/BordernadoFire.fx b/Effects/BordernadoFire.fx index 0c7352ea09..f21b52ac0d 100644 --- a/Effects/BordernadoFire.fx +++ b/Effects/BordernadoFire.fx @@ -30,7 +30,7 @@ struct VertexShaderOutput VertexShaderOutput VertexShaderFunction(in VertexShaderInput input) { - VertexShaderOutput output = (VertexShaderOutput)0; + VertexShaderOutput output = (VertexShaderOutput) 0; float4 pos = mul(input.Position, uWorldViewProjection); output.Position = pos; @@ -48,23 +48,17 @@ float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0 float2 coords = input.TextureCoordinates; // Read the fade map as a streak. - float4 fadeMapColor = tex2D(uImage1, float2(frac(coords.x + uTime / 4.16), coords.y)); - fadeMapColor.r *= pow(coords.x, 0.4); - float opacity = 1; + float4 fadeMapColor = tex2D(uImage1, float2(frac(coords.y + cos(uTime) * 0.01), frac(coords.x - uTime * 1.4 * uSaturation))); + fadeMapColor.r *= pow(coords.x, 0.2); - // Fading out. - if (fadeMapColor.r < 0.31) - opacity = fadeMapColor.r / 0.31; + float opacity = lerp(1.45, 1.95, fadeMapColor.r) * color.a; + opacity *= pow(sin(coords.y * 3.141), lerp(1, 4, pow(coords.x, 2))); + opacity *= fadeMapColor.r * 1.5 + 1; + opacity *= lerp(0.4, 0.9, fadeMapColor.r); - // Redish burn fade if close but not close enough to fading out. - else if (fadeMapColor.r < 0.44) - color.rgb = lerp(color.rgb, float3(1, 0.1, 0.2), 0.7 - (fadeMapColor.r - 0.31) / 0.13 * 0.7); - - float bloomPower = lerp(2.1, 7.4, saturate(1 - coords.x + sin(uTime * 2.3 + coords.x * 6.283) * 0.2)); - opacity *= pow(sin(coords.y * 3.141), bloomPower); - - color.rgb = lerp(color.rgb, float3(1, 1, 1), 0.5); - return color * opacity; + float3 transformColor = lerp(float3(1, 205 / 255.0, 119 / 255.0), float3(1, 76 / 255.0, 79 / 255.0), fadeMapColor.r); + color.rgb = lerp(color.rgb, transformColor, fadeMapColor.r); + return color * opacity * 1.6; } technique Technique1 diff --git a/Effects/BordernadoFire.xnb b/Effects/BordernadoFire.xnb index e5275ae9e9953113a4164ce9a5ecadb37711f017..2d0ac3b0dcd7d53753e9911113f5a0247463037f 100644 GIT binary patch delta 1161 zcmZuvPe>GD6o22$?9QxzTG61bB&?`Ikmw=Ei!-`v2^N++us2=8$RxE;i#qIB9fB?^ z-z6hr79na6u^Op=}b>=E9eiAj44=oPlDPWVCh3LCXmC( zG2{$V0m9fVcZDpf`{YbKB_GAF>PIL&G?;0UJ@x6qdmq=Y zb&P&6K}CEsQz!c}zYg!Wf;F*vXYb21-*4YHFZ;1mAzE*yRz=H|wRkH>u6F+XjdGk`T3*vpz zZF>j4@2>+Fjh|oT>R-#W(Laf)@iQDEyR4Gus${z@{zoT(c}~#hnjG8`57l;$K_f`< zF`X)|fsFBIM?S9%Zn;)hg3goEiG%GncOxhGu25oiC{#P0&5iiIfsKKp|LR>YY2DbeFdJL%Um*oz2~j0)y<3F#GAnx delta 900 zcmZWnL2J}N6n-%-c`oqx}4{1wq;oeTmX`WT*7mu0e0J z-5!~Gx48E7Zq0dhd3)_DkuscfSXpyOJg( z3Cs0m$A*o##ga=VF#LI#GY2fj2vJBB1*u);WwkLZlOb@%8OE`JSfEZ~B>Z<-9}lD` z5ESv@OD^KW;=PdwMFEqE3gETCiCEa@hJ1+<4cSa)%)nV85u#_OAM!!U=N^2?X^w1; JSAXUoh<` projectile.width * 0.5f + 16f, ColorFunction, specialShader: GameShaders.Misc["CalamityMod:Bordernado"]); + GameShaders.Misc["CalamityMod:Bordernado"].UseSaturation(-0.2f); GameShaders.Misc["CalamityMod:Bordernado"].SetShaderTexture(ModContent.GetTexture("Terraria/Misc/Perlin")); Vector2[] drawPoints = new Vector2[5]; Vector2 upwardAscent = Vector2.UnitY * TornadoHeight; From b568f08d4e5c22e5fe2107e1cdde275d0a195823 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 13:26:10 -0500 Subject: [PATCH 152/202] Damage adjustments --- Items/Weapons/Magic/Apotheosis.cs | 2 +- Items/Weapons/Magic/Heresy.cs | 2 +- Items/Weapons/Magic/RainbowPartyCannon.cs | 2 +- Items/Weapons/Melee/PhosphorescentGauntlet.cs | 2 +- Items/Weapons/Melee/PhotonRipper.cs | 2 +- Items/Weapons/Melee/SpineOfThanatos.cs | 2 +- Items/Weapons/Melee/Violence.cs | 2 +- Items/Weapons/Ranged/Condemnation.cs | 2 +- Items/Weapons/Ranged/SurgeDriver.cs | 2 +- Items/Weapons/Ranged/TheJailor.cs | 2 +- Items/Weapons/Rogue/RefractionRotor.cs | 2 +- Items/Weapons/Rogue/TheAtomSplitter.cs | 2 +- Items/Weapons/Summon/Perdition.cs | 2 +- Items/Weapons/Summon/Vigilance.cs | 2 +- Projectiles/Magic/ApotheosisWorm.cs | 6 +++--- 15 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Items/Weapons/Magic/Apotheosis.cs b/Items/Weapons/Magic/Apotheosis.cs index a603a76460..7066a7686c 100644 --- a/Items/Weapons/Magic/Apotheosis.cs +++ b/Items/Weapons/Magic/Apotheosis.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 85; + item.damage = 77; item.magic = true; item.mana = 42; item.width = 30; diff --git a/Items/Weapons/Magic/Heresy.cs b/Items/Weapons/Magic/Heresy.cs index 87ed76df7f..6d04804a89 100644 --- a/Items/Weapons/Magic/Heresy.cs +++ b/Items/Weapons/Magic/Heresy.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 2444; + item.damage = 444; item.magic = true; item.mana = 10; item.width = 38; diff --git a/Items/Weapons/Magic/RainbowPartyCannon.cs b/Items/Weapons/Magic/RainbowPartyCannon.cs index 30901196de..3c2c2ca4c7 100644 --- a/Items/Weapons/Magic/RainbowPartyCannon.cs +++ b/Items/Weapons/Magic/RainbowPartyCannon.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 2200; + item.damage = 225; item.magic = true; item.mana = 25; item.width = 52; diff --git a/Items/Weapons/Melee/PhosphorescentGauntlet.cs b/Items/Weapons/Melee/PhosphorescentGauntlet.cs index e171501e80..4167740a72 100644 --- a/Items/Weapons/Melee/PhosphorescentGauntlet.cs +++ b/Items/Weapons/Melee/PhosphorescentGauntlet.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = item.height = 40; - item.damage = 6460; + item.damage = 750; item.melee = true; item.noMelee = true; item.noUseGraphic = true; diff --git a/Items/Weapons/Melee/PhotonRipper.cs b/Items/Weapons/Melee/PhotonRipper.cs index 8d1c565fff..aa3deafe46 100644 --- a/Items/Weapons/Melee/PhotonRipper.cs +++ b/Items/Weapons/Melee/PhotonRipper.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Melee { item.height = 134; item.width = 54; - item.damage = 2581; + item.damage = 305; item.axe = 3330; item.axe /= 5; item.melee = true; diff --git a/Items/Weapons/Melee/SpineOfThanatos.cs b/Items/Weapons/Melee/SpineOfThanatos.cs index 47e7275d91..69b7b1c1df 100644 --- a/Items/Weapons/Melee/SpineOfThanatos.cs +++ b/Items/Weapons/Melee/SpineOfThanatos.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.width = item.height = 28; - item.damage = 1450; + item.damage = 410; item.rare = ItemRarityID.Red; item.value = CalamityGlobalItem.RarityVioletBuyPrice; item.Calamity().customRarity = CalamityRarity.Violet; diff --git a/Items/Weapons/Melee/Violence.cs b/Items/Weapons/Melee/Violence.cs index 4e2c3c558a..306590f0c4 100644 --- a/Items/Weapons/Melee/Violence.cs +++ b/Items/Weapons/Melee/Violence.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { item.height = item.width = 142; - item.damage = 1450; + item.damage = 204; item.melee = true; item.noMelee = true; item.useTurn = true; diff --git a/Items/Weapons/Ranged/Condemnation.cs b/Items/Weapons/Ranged/Condemnation.cs index f9a321673d..ae59eee27d 100644 --- a/Items/Weapons/Ranged/Condemnation.cs +++ b/Items/Weapons/Ranged/Condemnation.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 2700; + item.damage = 566; item.ranged = true; item.width = 130; item.height = 42; diff --git a/Items/Weapons/Ranged/SurgeDriver.cs b/Items/Weapons/Ranged/SurgeDriver.cs index 72b51af581..f3e8ed0a68 100644 --- a/Items/Weapons/Ranged/SurgeDriver.cs +++ b/Items/Weapons/Ranged/SurgeDriver.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 800; + item.damage = 156; item.ranged = true; item.width = 164; item.height = 58; diff --git a/Items/Weapons/Ranged/TheJailor.cs b/Items/Weapons/Ranged/TheJailor.cs index 4c45fab7d2..88451afad2 100644 --- a/Items/Weapons/Ranged/TheJailor.cs +++ b/Items/Weapons/Ranged/TheJailor.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 1220; + item.damage = 360; item.ranged = true; item.width = 102; item.height = 70; diff --git a/Items/Weapons/Rogue/RefractionRotor.cs b/Items/Weapons/Rogue/RefractionRotor.cs index d27133187f..16b39952a0 100644 --- a/Items/Weapons/Rogue/RefractionRotor.cs +++ b/Items/Weapons/Rogue/RefractionRotor.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SafeSetDefaults() { item.width = item.height = 120; - item.damage = 300; + item.damage = 110; item.knockBack = 8.5f; item.useAnimation = item.useTime = 14; item.Calamity().rogue = true; diff --git a/Items/Weapons/Rogue/TheAtomSplitter.cs b/Items/Weapons/Rogue/TheAtomSplitter.cs index e9cd46167f..18635adb8b 100644 --- a/Items/Weapons/Rogue/TheAtomSplitter.cs +++ b/Items/Weapons/Rogue/TheAtomSplitter.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SafeSetDefaults() { item.width = item.height = 128; - item.damage = 375; + item.damage = 256; item.knockBack = 7f; item.useAnimation = item.useTime = 14; item.Calamity().rogue = true; diff --git a/Items/Weapons/Summon/Perdition.cs b/Items/Weapons/Summon/Perdition.cs index e41d47b26f..ed08789e23 100644 --- a/Items/Weapons/Summon/Perdition.cs +++ b/Items/Weapons/Summon/Perdition.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetDefaults() { - item.damage = 1666; + item.damage = 444; item.mana = 25; item.width = item.height = 56; item.useTime = item.useAnimation = 42; diff --git a/Items/Weapons/Summon/Vigilance.cs b/Items/Weapons/Summon/Vigilance.cs index b0499f9946..23b51e01f7 100644 --- a/Items/Weapons/Summon/Vigilance.cs +++ b/Items/Weapons/Summon/Vigilance.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetDefaults() { - item.damage = 1000; + item.damage = 333; item.mana = 12; item.width = item.height = 32; item.useTime = item.useAnimation = 10; diff --git a/Projectiles/Magic/ApotheosisWorm.cs b/Projectiles/Magic/ApotheosisWorm.cs index e466ab8f1a..57b91a9d1a 100644 --- a/Projectiles/Magic/ApotheosisWorm.cs +++ b/Projectiles/Magic/ApotheosisWorm.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Magic projectile.timeLeft = 300; projectile.penetrate = -1; projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 5; + projectile.localNPCHitCooldown = 9; projectile.friendly = true; projectile.magic = true; projectile.tileCollide = false; @@ -117,7 +117,7 @@ namespace CalamityMod.Projectiles.Magic // Reset the jaw's rotation slowly over time. JawRotation = MathHelper.Lerp(JawRotation, 0f, 0.08f); - NPC potentialTarget = projectile.Center.ClosestNPCAt(7200f); + NPC potentialTarget = projectile.Center.ClosestNPCAt(4200f); if (potentialTarget != null) AttackTarget(potentialTarget); } @@ -184,7 +184,7 @@ namespace CalamityMod.Projectiles.Magic { Segment segmentToShootFrom = Segments[Main.rand.Next(Segments.Length)]; Vector2 shootVelocity = (target.Center - segmentToShootFrom.Center).SafeNormalize(Vector2.UnitY).RotatedByRandom(0.25f) * 18f; - Projectile.NewProjectile(segmentToShootFrom.Center, shootVelocity, ModContent.ProjectileType(), projectile.damage, 0f, projectile.owner); + Projectile.NewProjectile(segmentToShootFrom.Center, shootVelocity, ModContent.ProjectileType(), projectile.damage / 2, 0f, projectile.owner); } if (Main.rand.NextBool(10)) From 3c67eea4c2e5aca53b30d864f3b379056d2ddb68 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 13:34:03 -0500 Subject: [PATCH 153/202] Rainbow Party Cannon tooltip code adjustment --- Items/Weapons/Magic/RainbowPartyCannon.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Items/Weapons/Magic/RainbowPartyCannon.cs b/Items/Weapons/Magic/RainbowPartyCannon.cs index 3c2c2ca4c7..94188df883 100644 --- a/Items/Weapons/Magic/RainbowPartyCannon.cs +++ b/Items/Weapons/Magic/RainbowPartyCannon.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetStaticDefaults() { DisplayName.SetDefault("Rainbow Party Cannon"); - Tooltip.SetDefault("You should never see this lol"); + Tooltip.SetDefault("Let the rainbow remind you that together we will always shine..."); } public override void SetDefaults() @@ -51,12 +51,10 @@ namespace CalamityMod.Items.Weapons.Magic item.shootSpeed = 20f; } - public static string DiscoHex => $"c/{(int)MathHelper.Lerp(156f, 255f, Main.DiscoR / 256f):X2}{108:X2}{251:X2}:"; - public override void ModifyTooltips(List tooltips) { var tt2 = tooltips.FirstOrDefault(x => x.Name == "Tooltip0" && x.mod == "Terraria"); - tt2.text = $"[" + DiscoHex + "Let the rainbow remind you that together we will always shine...]"; + tt2.overrideColor = new Color(MathHelper.Lerp(156f, 255f, Main.DiscoR / 256f), 108f, 251f); } public override void AddRecipes() From 9cf14fbb0a53ad19534542b87586c2fa4da44bde Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 08:20:00 -0500 Subject: [PATCH 154/202] SCal Seeker Murasama resist --- NPCs/CalamityGlobalNPC.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 6514732f5e..8a1fa30993 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -3942,6 +3942,8 @@ namespace CalamityMod.NPCs } else if (npc.type == NPCType()) { + if (projectile.type == ProjectileType()) + damage = (int)(damage * 0.7); if (projectile.type == ProjectileType()) damage = (int)(damage * 0.9); } From 0545d16e4563d52e99454d535d117e8daec7f714 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 08:20:53 -0500 Subject: [PATCH 155/202] Nerfed Dragon Rage damage to 1275 --- Items/Weapons/Melee/DragonRage.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Melee/DragonRage.cs b/Items/Weapons/Melee/DragonRage.cs index e6670e844a..683d97d6be 100644 --- a/Items/Weapons/Melee/DragonRage.cs +++ b/Items/Weapons/Melee/DragonRage.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { - item.damage = 1350; + item.damage = 1275; item.knockBack = 7.5f; item.useAnimation = item.useTime = 25; item.melee = true; From ab0fc7b4350661d0527b762e22069f32d770f8f1 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 08:22:15 -0500 Subject: [PATCH 156/202] SCal Seeker Yharim's Crystal resist --- NPCs/CalamityGlobalNPC.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 8a1fa30993..29d57647d5 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -3944,6 +3944,8 @@ namespace CalamityMod.NPCs { if (projectile.type == ProjectileType()) damage = (int)(damage * 0.7); + if (projectile.type == ProjectileType()) + damage = (int)(damage * 0.75); if (projectile.type == ProjectileType()) damage = (int)(damage * 0.9); } From 5081156584a3be865889ab8c60873100fc166109 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 08:24:47 -0500 Subject: [PATCH 157/202] Nerfed Subsuming Vortex damage to 175 --- Items/Weapons/Magic/SubsumingVortex.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Magic/SubsumingVortex.cs b/Items/Weapons/Magic/SubsumingVortex.cs index 561aa64ca2..01566b5b5f 100644 --- a/Items/Weapons/Magic/SubsumingVortex.cs +++ b/Items/Weapons/Magic/SubsumingVortex.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 300; + item.damage = 175; item.magic = true; item.mana = 78; item.width = 38; From 976c668813cf7dd17ad0d56121a7def933338afc Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 08:26:10 -0500 Subject: [PATCH 158/202] Nerfed Voltatic Climax damage to 105 --- Items/Weapons/Magic/Climax.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Items/Weapons/Magic/Climax.cs b/Items/Weapons/Magic/Climax.cs index ff1244b646..15d9c50a84 100644 --- a/Items/Weapons/Magic/Climax.cs +++ b/Items/Weapons/Magic/Climax.cs @@ -20,13 +20,13 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 131; + item.damage = 105; item.magic = true; item.mana = 30; item.width = 78; item.height = 78; - item.useTime = 41; - item.useAnimation = 41; + item.useTime = 55; + item.useAnimation = 55; item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5f; From 3b63f4fc16ea2d449cc4071592c46f5f38de2f63 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 08:27:00 -0500 Subject: [PATCH 159/202] Buffed Void Vortex damage to 82 --- Items/Weapons/Magic/VoidVortex.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Items/Weapons/Magic/VoidVortex.cs b/Items/Weapons/Magic/VoidVortex.cs index d5c849419b..c199cf4eaf 100644 --- a/Items/Weapons/Magic/VoidVortex.cs +++ b/Items/Weapons/Magic/VoidVortex.cs @@ -18,13 +18,13 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 75; + item.damage = 82; item.magic = true; item.mana = 60; item.width = 130; item.height = 130; - item.useTime = 49; - item.useAnimation = 49; + item.useTime = 80; + item.useAnimation = 80; item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 0f; From 108ffcdc8925a62457740cf2c029bfd10202ad1a Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 08:28:13 -0500 Subject: [PATCH 160/202] Buffed Dragon's Breath damage to 200 --- Items/Weapons/Ranged/DragonsBreath.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Ranged/DragonsBreath.cs b/Items/Weapons/Ranged/DragonsBreath.cs index 7f23f120b5..daafd98c11 100644 --- a/Items/Weapons/Ranged/DragonsBreath.cs +++ b/Items/Weapons/Ranged/DragonsBreath.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 78; + item.damage = 200; item.ranged = true; item.width = 64; item.height = 28; From 16f2bdaf55992253eded324527dde9872a4bb669 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 08:30:16 -0500 Subject: [PATCH 161/202] Gave SCal a slight Onyx Bolt resist --- NPCs/CalamityGlobalNPC.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 29d57647d5..2010ed73c7 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -3919,6 +3919,10 @@ namespace CalamityMod.NPCs } else if (npc.type == NPCType()) { + // For Onyxia. + if (projectile.type == ProjectileID.BlackBolt) + damage = (int)(damage * 0.9); + if (projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType()) { From 11dd056db4ef74861476e959a1235eed04ffeb58 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 09:22:44 -0500 Subject: [PATCH 162/202] Nerfed Photoviscerator's right click --- Items/Weapons/Ranged/Photoviscerator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Ranged/Photoviscerator.cs b/Items/Weapons/Ranged/Photoviscerator.cs index da0b70c1b3..3193e384ae 100644 --- a/Items/Weapons/Ranged/Photoviscerator.cs +++ b/Items/Weapons/Ranged/Photoviscerator.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Weapons.Ranged public class Photoviscerator : ModItem { public const int CooldownTime = 60 * 7; // 7 second cooldown. - public const double AltFireDamageMult = 4.27; + public const double AltFireDamageMult = 2.5; public override void SetStaticDefaults() { From 57c7326a7f80323c350b2965e4d9a71d7f6b49ce Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 11:34:06 -0500 Subject: [PATCH 163/202] Nerfed Magnomaly Cannon damage to 340 --- Items/Weapons/Ranged/MagnomalyCannon.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Ranged/MagnomalyCannon.cs b/Items/Weapons/Ranged/MagnomalyCannon.cs index 9c6f2c15cd..b56dc12554 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 = 435; + item.damage = 340; item.ranged = true; item.width = 84; item.height = 30; From 11fe5d27529e91b3dea958ab005459495bdbc36c Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 12:53:05 -0500 Subject: [PATCH 164/202] Removed summon resists for SCal but nerfed auric minion damage --- Items/Armor/AuricTeslaSpaceHelmet.cs | 2 +- NPCs/CalamityGlobalNPC.cs | 11 ----------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/Items/Armor/AuricTeslaSpaceHelmet.cs b/Items/Armor/AuricTeslaSpaceHelmet.cs index cf084dc02c..134b6a9914 100644 --- a/Items/Armor/AuricTeslaSpaceHelmet.cs +++ b/Items/Armor/AuricTeslaSpaceHelmet.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Items.Armor player.setBonus = "Summoner Tarragon, Bloodflare and Silva armor effects\n" + "All projectiles spawn healing auric orbs on enemy hits\n" + "Max run speed and acceleration boosted by 10%\n" + - "+8 max minions and 120% increased minion damage"; + "+8 max minions and 90% increased minion damage"; CalamityPlayer modPlayer = player.Calamity(); modPlayer.tarraSet = true; modPlayer.tarraSummon = true; diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 2010ed73c7..0f5815362b 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -3922,17 +3922,6 @@ namespace CalamityMod.NPCs // For Onyxia. if (projectile.type == ProjectileID.BlackBolt) damage = (int)(damage * 0.9); - - if (projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType() || - projectile.type == ProjectileType()) - { - damage = (int)(damage * 0.85); - } - if (projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType()) - damage = (int)(damage * 0.8); - - if (projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType()) - damage = (int)(damage * 0.81); } else if (npc.type == NPCType() || npc.type == NPCType()) { From 9f75b9a9eef8377796a39f92d39e2382c6c134b4 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 12:54:10 -0500 Subject: [PATCH 165/202] Nerfed Anti-Material rifle damage to 3240 --- Items/Weapons/Ranged/AMR.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Ranged/AMR.cs b/Items/Weapons/Ranged/AMR.cs index 89e8b5111c..bb5728702a 100644 --- a/Items/Weapons/Ranged/AMR.cs +++ b/Items/Weapons/Ranged/AMR.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 3520; + item.damage = 3240; item.ranged = true; item.width = 76; item.height = 30; From 306c326d95fa614c1767ec944ad6d145c92893ae Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 13:00:23 -0500 Subject: [PATCH 166/202] Auric thing --- Items/Armor/AuricTeslaSpaceHelmet.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Armor/AuricTeslaSpaceHelmet.cs b/Items/Armor/AuricTeslaSpaceHelmet.cs index 134b6a9914..59c452eddd 100644 --- a/Items/Armor/AuricTeslaSpaceHelmet.cs +++ b/Items/Armor/AuricTeslaSpaceHelmet.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Items.Armor player.lavaMax += 240; player.ignoreWater = true; player.crimsonRegen = true; - player.minionDamage += 1.2f; + player.minionDamage += 0.9f; player.maxMinions += 8; if (player.lavaWet) { From a124b64fd6ed5c8922d7b5adfd653643e79f7d85 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 13:01:03 -0500 Subject: [PATCH 167/202] Buffed Skullmasher's damage to 1100 --- Items/Weapons/Ranged/Skullmasher.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Ranged/Skullmasher.cs b/Items/Weapons/Ranged/Skullmasher.cs index 518ec98cc7..bbf4b19e9e 100644 --- a/Items/Weapons/Ranged/Skullmasher.cs +++ b/Items/Weapons/Ranged/Skullmasher.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 924; + item.damage = 1100; item.ranged = true; item.width = 142; item.height = 40; From 543dec310cefd3f759547eb5eb0a75a568a06fd5 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 13:02:31 -0500 Subject: [PATCH 168/202] Nerfed Celestus' SS damage factor --- Items/Weapons/Rogue/Celestus.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Rogue/Celestus.cs b/Items/Weapons/Rogue/Celestus.cs index 11fd20a13e..af511ced9e 100644 --- a/Items/Weapons/Rogue/Celestus.cs +++ b/Items/Weapons/Rogue/Celestus.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Weapons.Rogue { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike { - int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, (int)(damage * 0.65), knockBack, player.whoAmI); if (stealth.WithinBounds(Main.maxProjectiles)) Main.projectile[stealth].Calamity().stealthStrike = true; } From 066d225dcf542560edafd37215c8e6175d4c038a Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 13:02:59 -0500 Subject: [PATCH 169/202] Nerfed Dratalinorus damage to 80 --- Items/Weapons/Ranged/Drataliornus.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Ranged/Drataliornus.cs b/Items/Weapons/Ranged/Drataliornus.cs index f1ced9fdd0..05c1402721 100644 --- a/Items/Weapons/Ranged/Drataliornus.cs +++ b/Items/Weapons/Ranged/Drataliornus.cs @@ -24,7 +24,7 @@ Right click to fire two devastating barrages of five empowered fireballs. public override void SetDefaults() { - item.damage = 231; + item.damage = 80; item.knockBack = 1f; item.shootSpeed = 18f; item.useStyle = ItemUseStyleID.HoldingOut; From 799592ff67bd9e1d61ba81117ff977e37f6d8e01 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 13:03:22 -0500 Subject: [PATCH 170/202] Buffed Tyranny's End damage to 2250 --- Items/Weapons/Ranged/TyrannysEnd.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Ranged/TyrannysEnd.cs b/Items/Weapons/Ranged/TyrannysEnd.cs index f0fafacd23..2506f776bb 100644 --- a/Items/Weapons/Ranged/TyrannysEnd.cs +++ b/Items/Weapons/Ranged/TyrannysEnd.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 1260; + item.damage = 2250; item.knockBack = 9.5f; item.ranged = true; item.useTime = 55; From 456755513f6055b2a0666caf49240be0f6689d2b Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 13:03:38 -0500 Subject: [PATCH 171/202] Nerfed Ace's High damage to 230 --- Items/Weapons/Ranged/AcesHigh.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Ranged/AcesHigh.cs b/Items/Weapons/Ranged/AcesHigh.cs index 13b704a3e8..8884fcf40e 100644 --- a/Items/Weapons/Ranged/AcesHigh.cs +++ b/Items/Weapons/Ranged/AcesHigh.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 479; + item.damage = 230; item.ranged = true; item.width = 48; item.height = 30; From f54839730cb217823556ff6c69b84856ddf1eefe Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 13:04:17 -0500 Subject: [PATCH 172/202] Further Nerfed Eradicator's SS damage factor --- Items/Weapons/Rogue/Eradicator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Rogue/Eradicator.cs b/Items/Weapons/Rogue/Eradicator.cs index 6f0dce3d0f..709098ebd9 100644 --- a/Items/Weapons/Rogue/Eradicator.cs +++ b/Items/Weapons/Rogue/Eradicator.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { if (player.Calamity().StealthStrikeAvailable()) - damage /= 2; + damage = (int)(damage * 0.4); int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); if (player.Calamity().StealthStrikeAvailable() && proj.WithinBounds(Main.maxProjectiles)) From 3ca38d6f6f0217c6d7ddc9797b398824301f5410 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 13:04:57 -0500 Subject: [PATCH 173/202] Buffed God's Paranoia's SS damage factor --- Items/Weapons/Rogue/GodsParanoia.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Rogue/GodsParanoia.cs b/Items/Weapons/Rogue/GodsParanoia.cs index 4a27fc49f1..6314525c45 100644 --- a/Items/Weapons/Rogue/GodsParanoia.cs +++ b/Items/Weapons/Rogue/GodsParanoia.cs @@ -69,7 +69,7 @@ Right click to delete all existing spiky balls"); modPlayer.killSpikyBalls = false; if (modPlayer.StealthStrikeAvailable()) //setting the stealth strike { - damage = (int)(damage * 1.12); + damage = (int)(damage * 1.345); int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); if (stealth.WithinBounds(Main.maxProjectiles)) Main.projectile[stealth].Calamity().stealthStrike = true; From 23e4b24387782b1b0214871879d294d21bc0c6c6 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 13:05:58 -0500 Subject: [PATCH 174/202] Made Dragon Pow's hit effect range more lenient --- Projectiles/Melee/DragonPowFlail.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Projectiles/Melee/DragonPowFlail.cs b/Projectiles/Melee/DragonPowFlail.cs index e5b6761e92..b65387990b 100644 --- a/Projectiles/Melee/DragonPowFlail.cs +++ b/Projectiles/Melee/DragonPowFlail.cs @@ -138,8 +138,8 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - // Only perform hit effects after reaching approximately 75% of the way out. - if (Main.player[projectile.owner].WithinRange(target.Center, 620f)) + // Only perform hit effects after reaching approximately 55% of the way out. + if (Main.player[projectile.owner].WithinRange(target.Center, 475f)) return; // Inflicts Daybroken, Abyssal Flames and Holy Flames for 8 seconds on-hit @@ -156,8 +156,8 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitPvp(Player target, int damage, bool crit) { - // Only perform hit effects after reaching approximately 75% of the way out. - if (projectile.WithinRange(Main.player[projectile.owner].Center, 1100f)) + // Only perform hit effects after reaching approximately 55% of the way out. + if (projectile.WithinRange(Main.player[projectile.owner].Center, 475f)) return; // Inflicts Abyssal Flames and Holy Flames for 8 seconds on-hit From 8f1e5a3ec835b314a5ff501616886305d9a95934 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 13:07:19 -0500 Subject: [PATCH 175/202] Reduced Ataraxia's Split projectile lifetime --- Projectiles/Melee/AtaraxiaSplit.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projectiles/Melee/AtaraxiaSplit.cs b/Projectiles/Melee/AtaraxiaSplit.cs index 033acb4421..0771c80dd0 100644 --- a/Projectiles/Melee/AtaraxiaSplit.cs +++ b/Projectiles/Melee/AtaraxiaSplit.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Projectiles.Melee projectile.penetrate = -1; projectile.usesIDStaticNPCImmunity = true; projectile.idStaticNPCHitCooldown = 6; - projectile.timeLeft = 50; + projectile.timeLeft = 25; projectile.tileCollide = false; projectile.ignoreWater = true; projectile.alpha = 0; From 9fb046898d6dca01bc414ca6f934d4d20d21a502 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 16:46:12 -0500 Subject: [PATCH 176/202] Placeholder text --- NPCs/TownNPCs/WITCH.cs | 66 +----------------------------------------- 1 file changed, 1 insertion(+), 65 deletions(-) diff --git a/NPCs/TownNPCs/WITCH.cs b/NPCs/TownNPCs/WITCH.cs index bff081bc14..0313ce6017 100644 --- a/NPCs/TownNPCs/WITCH.cs +++ b/NPCs/TownNPCs/WITCH.cs @@ -58,71 +58,7 @@ namespace CalamityMod.NPCs.TownNPCs public override string TownNPCName() => "Calamitas"; - public override string GetChat() - { - // TODO: Give this town NPC unique dialog. - - if (npc.homeless) //not sure how to check if he has ever found a home before (to make this dialogue only run when he first spawns) - { - if (Main.rand.NextBool(2)) - return "I deeply appreciate you rescuing me from being trapped within my frozen castle... It's been many, many years..."; - else - return "Thank you for saving me...though now I admit I am without a home since mine got destroyed."; - } - - IList dialogue = new List(); - - if (Main.dayTime) - { - dialogue.Add("I must admit...I am not quite used to this weather. It's too warm for my taste..."); - dialogue.Add("My dear! What is it you would like to talk about today?"); - dialogue.Add("Why...I don't have to worry about any time of the day! If it is hot...then I can use my ice magic to cool down!"); - dialogue.Add("I do usually prefer a spot of humidity for my ice magic. It likes to come out as steam when it's too hot and dry..."); - dialogue.Add("Magic is a skill that must be learned and practiced! You seem to have an inherent talent for it at your age. I have spent all of my life honing it..."); - dialogue.Add("Why ice magic, you ask? Well, my parents were both pyromaniacs..."); - } - else - { - dialogue.Add("There be monsters lurking in the darkness. Most...unnatural monsters."); - dialogue.Add("You could break the icy stillness in the air tonight."); - dialogue.Add("Hmm...some would say that an unforeseen outside force is the root of the blood moon..."); - dialogue.Add("I was once the greatest Archmage of ice that ever hailed the lands. Whether or not that is still applicable, I am not sure..."); - dialogue.Add("There used to be other Archmages of other elements. I wonder where they are now...if they are also alive..."); - dialogue.Add("Oh...I wish I could tell you all about my life and the lessons I have learned, but it appears you have a great many things to do..."); - } - - dialogue.Add("I assure you, I will do my best to act as the cool grandfather figure you always wanted."); - - if (BirthdayParty.PartyIsUp) - dialogue.Add("Sometimes...I feel like all I'm good for during these events is making ice cubes and slushies."); - - if (NPC.downedMoonlord) - { - dialogue.Add("Tread carefully, my friend... Now that the Moon Lord has been defeated, many powerful creatures will crawl out to challenge you..."); - dialogue.Add("I feel the balance of nature tilting farther than ever before. Is it due to you, or because of the events leading to now...?"); - } - - if (CalamityWorld.downedPolterghast) - dialogue.Add("I felt a sudden chill down my spine. I sense something dangerous stirring in the Abyss..."); - - if (CalamityWorld.downedYharon) - dialogue.Add("...Where is Lord Yharim? He must be up to something..."); - - int dryad = NPC.FindFirstNPC(NPCID.Dryad); - if (dryad != -1) - dialogue.Add("Yes, I am older than " + Main.npc[dryad].GivenName + ". You can stop asking now..."); - - if (Main.player[Main.myPlayer].Calamity().chibii) - dialogue.Add("What an adorable tiny companion you have! Where in the world did you find such a...creature...? Actually, I'd rather not know."); - - if (Main.player[Main.myPlayer].Calamity().cryogenSoul) - dialogue.Add(Main.player[Main.myPlayer].name + "...just between us, I think I forgot my soul in the ice castle. If you see it, please do let me know."); - - if (Main.hardMode) - dialogue.Add("It wouldn't be the first time something unknown and powerful dropped from the heavens...I would tread carefully if I were you..."); - - return dialogue[Main.rand.Next(dialogue.Count)]; - } + public override string GetChat() => "Mrrp is cringe."; public override void SetChatButtons(ref string button, ref string button2) => button = "Enchant"; From 1b7e62e13e685ea391e9a7bdf648939bb9cf7daa Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 16:48:40 -0500 Subject: [PATCH 177/202] Temporary Sepulcher weapon removal --- Items/Weapons/Summon/StaffoftheMechworm2.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Items/Weapons/Summon/StaffoftheMechworm2.cs b/Items/Weapons/Summon/StaffoftheMechworm2.cs index 1fb6faa386..54a05bfb70 100644 --- a/Items/Weapons/Summon/StaffoftheMechworm2.cs +++ b/Items/Weapons/Summon/StaffoftheMechworm2.cs @@ -8,6 +8,9 @@ namespace CalamityMod.Items.Weapons.Summon { public class StaffoftheMechworm2 : ModItem { + // This is unfinished atm. + public override bool Autoload(ref string name) => false; + public override void SetStaticDefaults() { DisplayName.SetDefault("Staff of the Mechworm (But Exhumed!)"); From 075a1c545b8f9233bb6880b7825a9ba0de27873d Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 16:49:10 -0500 Subject: [PATCH 178/202] Exhumed Vigilance damage nerf --- Items/Weapons/Summon/ExhumedVigilance.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Summon/ExhumedVigilance.cs b/Items/Weapons/Summon/ExhumedVigilance.cs index 107d5e99a8..185a2ccd9d 100644 --- a/Items/Weapons/Summon/ExhumedVigilance.cs +++ b/Items/Weapons/Summon/ExhumedVigilance.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetDefaults() { item.mana = 100; - item.damage = 16660; + item.damage = 1666; item.useStyle = ItemUseStyleID.SwingThrow; item.width = 58; item.height = 64; From 29de0010b53fc851a4df6628dda48040464495c0 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 17:51:45 -0500 Subject: [PATCH 179/202] Unfinished comment fix --- Projectiles/Magic/ApotheosisWorm.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projectiles/Magic/ApotheosisWorm.cs b/Projectiles/Magic/ApotheosisWorm.cs index 57b91a9d1a..77e904b95b 100644 --- a/Projectiles/Magic/ApotheosisWorm.cs +++ b/Projectiles/Magic/ApotheosisWorm.cs @@ -301,7 +301,7 @@ namespace CalamityMod.Projectiles.Magic } // Portal drawing at the start of the devourer's lifetime. - // This is extremely similar to the + // This is extremely similar to the portal created when DoG teleports. if (Time < 60f) { float currentFade = Utils.InverseLerp(0f, 8f, Time, true) * Utils.InverseLerp(60f, 52f, Time, true); From 113c09ff7681e16fc1d0526a6b44ab74d4df5164 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 17:59:35 -0500 Subject: [PATCH 180/202] Withered buff icon resprite --- Buffs/Cooldowns/Withered.png | Bin 517 -> 578 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/Buffs/Cooldowns/Withered.png b/Buffs/Cooldowns/Withered.png index 8565069431ae04a073a6edffbea36c09cd24b8bb..c51dae7b2a01cf2f6868db3129deebff8cd7bbdf 100644 GIT binary patch delta 564 zcmV-40?Yk{1i}Q68Gix*008_L?V|ty00DDSM?wIu&K&6g000DMK}|sb0I`n?{9y$E z000SaNLh0L01m?d01m?e$8V@)0005kNklY#OWhHqii-F<>EmfCWN*6!{KezyY$`OHB=cWH*@Igyd3)KOjEC1?UwA zeZ~4fa@vAtKz|Z{96-RgcOQTx{@g&{RD|pU2?;hJ`RNxINCF8!T#f8MhzK$mfK-HH zK~{nk5WRTu3yApGzQNI*r!Ro$+4mnn1avjr;XvOYdk8C_ZyX?ln(6m|WUQMski2^P zGmt!YA5p$aadJRe3=BYT0m&IwvJfsD3`8ordG{xfRDV}y2aACKvOgeT@8P#V5|Yv& zewrMr4UzzZqtAW;Nr(R+KMkA@AOM#?kmI8zQwd1&zu^Ru5Vu3X;P3$iAp2w8jyFIO zzuO^TAbhZIqB)Sf@CalxE`LB`0^)WExN?aZ%0dO!QlK=Jyzm5&q?ZrU13)dia7TU! z7Y#sshAj&~Vgea#z78s^Hk`TvBx&!1A>O)XU;qFzlGj_(zumR~0000rI0jMHezAp3)onMh;JbxL@WZ)!k=cv*jNa`!Xg$scf!o>I;pY) zo@RIM&YhWa_TD=)LA6o_pmp0BFh*1>1qzv86!Y->+Av3okuVRJ7E|3zt!Dtbjs@hd zKr#kYz6$eFd4J1r=yq;W?OBLkUSmHM6H+g{iGg7ybTAhPqpW|wvbqMq)8j*`pC}P1 zC306_m<5urR@4hz%mp^{1auwoP5}p8%w72E_fqX1DWED}w6_fmvtees7`HPNaK(mv zx91V$u0Wy^ZqA0lkhwtqp=4bn{L7j+f Date: Sat, 26 Jun 2021 19:45:11 -0400 Subject: [PATCH 181/202] if x return true else return false --- Utilities/ItemUtils.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Utilities/ItemUtils.cs b/Utilities/ItemUtils.cs index ad29b36b7f..00b12acb8e 100644 --- a/Utilities/ItemUtils.cs +++ b/Utilities/ItemUtils.cs @@ -214,10 +214,7 @@ namespace CalamityMod if (EnchantmentManager.ItemUpgradeRelationship.ContainsValue(item.type)) return true; - if (item.Calamity().AppliedEnchantment.HasValue) - return true; - - return false; + return item.Calamity().AppliedEnchantment.HasValue; } public static Rectangle FixSwingHitbox(float hitboxWidth, float hitboxHeight) From f9566bdc281994d4f7c79deae931cacca6e01fd0 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 18:55:23 -0500 Subject: [PATCH 182/202] Vulnerability hex ambiguity fix --- Buffs/DamageOverTime/VulnerabilityHex.cs | 8 -------- NPCs/CalamityGlobalNPC.cs | 1 - 2 files changed, 9 deletions(-) diff --git a/Buffs/DamageOverTime/VulnerabilityHex.cs b/Buffs/DamageOverTime/VulnerabilityHex.cs index 519aa10d15..dfc4a2c6e0 100644 --- a/Buffs/DamageOverTime/VulnerabilityHex.cs +++ b/Buffs/DamageOverTime/VulnerabilityHex.cs @@ -25,13 +25,5 @@ namespace CalamityMod.Buffs.DamageOverTime npc.DelBuff(buffIndex); buffIndex--; } - - public override void Update(NPC npc, ref int buffIndex) - { - if (npc.Calamity().vulnerabilityHex < npc.buffTime[buffIndex]) - npc.Calamity().vulnerabilityHex = npc.buffTime[buffIndex]; - npc.DelBuff(buffIndex); - buffIndex--; - } } } diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 468c4dda67..86be0eb288 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -148,7 +148,6 @@ namespace CalamityMod.NPCs public int wCleave = 0; public int bBlood = 0; public int dFlames = 0; - public int vulnerabilityHex = 0; public int marked = 0; public int irradiated = 0; public int bFlames = 0; From dbe2ca3bc5ab5c8af34e4733ff37c37e979d091b Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Sat, 26 Jun 2021 19:20:11 -0500 Subject: [PATCH 183/202] 1 - Radiant Ooze and Ambrosial Ampoule life regen don't stack. --- CalPlayer/CalamityPlayerLifeRegen.cs | 5 +++++ CalPlayer/CalamityPlayerMiscEffects.cs | 5 ++++- Items/Accessories/AmbrosialAmpoule.cs | 1 + Items/Accessories/RadiantOoze.cs | 5 ----- Items/Accessories/Sponge.cs | 1 + 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 5eaaf80cc2..b13d4b0e77 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -653,6 +653,11 @@ namespace CalamityMod.CalPlayer player.lifeRegenTime += 1; player.lifeRegen += 2; } + else if (modPlayer.rOoze) + { + if (!Main.dayTime) + player.lifeRegen += 4; + } if (modPlayer.ursaSergeant) { diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index d64c545969..ac99000e5e 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -1402,11 +1402,14 @@ namespace CalamityMod.CalPlayer // Ambrosial Ampoule bonus and other light-granting bonuses float[] light = new float[3]; - if (modPlayer.aAmpoule) + if ((modPlayer.rOoze && !Main.dayTime) || modPlayer.aAmpoule) { light[0] += 1f; light[1] += 1f; light[2] += 0.6f; + } + if (modPlayer.aAmpoule) + { player.endurance += 0.05f; player.pickSpeed -= 0.25f; player.buffImmune[BuffID.Venom] = true; diff --git a/Items/Accessories/AmbrosialAmpoule.cs b/Items/Accessories/AmbrosialAmpoule.cs index 4286e66c63..ac477ff3f0 100644 --- a/Items/Accessories/AmbrosialAmpoule.cs +++ b/Items/Accessories/AmbrosialAmpoule.cs @@ -51,6 +51,7 @@ namespace CalamityMod.Items.Accessories CalamityPlayer modPlayer = player.Calamity(); modPlayer.beeResist = true; modPlayer.aAmpoule = true; + modPlayer.rOoze = true; } public override void AddRecipes() diff --git a/Items/Accessories/RadiantOoze.cs b/Items/Accessories/RadiantOoze.cs index d25f436569..4828b840ba 100644 --- a/Items/Accessories/RadiantOoze.cs +++ b/Items/Accessories/RadiantOoze.cs @@ -25,11 +25,6 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { player.Calamity().rOoze = true; - if (!Main.dayTime) - { - Lighting.AddLight((int)(player.position.X + (float)(player.width / 2)) / 16, (int)(player.position.Y + (float)(player.height / 2)) / 16, 1f, 1f, 0.6f); - player.lifeRegen += 4; - } } public override void AddRecipes() diff --git a/Items/Accessories/Sponge.cs b/Items/Accessories/Sponge.cs index 107bcab7ec..c5d984bb12 100644 --- a/Items/Accessories/Sponge.cs +++ b/Items/Accessories/Sponge.cs @@ -78,6 +78,7 @@ namespace CalamityMod.Items.Accessories modPlayer.seaShell = true; modPlayer.absorber = true; modPlayer.aAmpoule = true; + modPlayer.rOoze = true; player.statManaMax2 += 20; } From 45d0551b7463c4cf3560d8942c948fe120e09d8a Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 19:27:58 -0500 Subject: [PATCH 184/202] Color fix --- Items/Weapons/Magic/RainbowPartyCannon.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Magic/RainbowPartyCannon.cs b/Items/Weapons/Magic/RainbowPartyCannon.cs index 94188df883..1fa28d3f8d 100644 --- a/Items/Weapons/Magic/RainbowPartyCannon.cs +++ b/Items/Weapons/Magic/RainbowPartyCannon.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void ModifyTooltips(List tooltips) { var tt2 = tooltips.FirstOrDefault(x => x.Name == "Tooltip0" && x.mod == "Terraria"); - tt2.overrideColor = new Color(MathHelper.Lerp(156f, 255f, Main.DiscoR / 256f), 108f, 251f); + tt2.overrideColor = new Color((int)MathHelper.Lerp(156f, 255f, Main.DiscoR / 256f), 108, 251); } public override void AddRecipes() From 4cdca8ea08730589083325c68485a9cf419f7090 Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Sat, 26 Jun 2021 19:29:11 -0500 Subject: [PATCH 185/202] 1 - Updated Cal Clone total kill time to be 4 minutes. --- CalamityMod.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CalamityMod.cs b/CalamityMod.cs index e07aff653a..68f5bea4fb 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -552,7 +552,7 @@ namespace CalamityMod { ModContent.NPCType(), 7200 }, { ModContent.NPCType(), 10800 }, { ModContent.NPCType(), 1200 }, - { ModContent.NPCType(), 11400 }, + { ModContent.NPCType(), 13200 }, { ModContent.NPCType(), 10800 }, { ModContent.NPCType(), 10800 }, { ModContent.NPCType(), 10800 }, From 3f30b7e3c549a53929e064e6824397bf19a05698 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 20:45:25 -0500 Subject: [PATCH 186/202] Fixed Brimstone Orb rage generation --- CalPlayer/CalamityPlayerMiscEffects.cs | 2 +- NPCs/CalamityGlobalNPC.cs | 3 +++ NPCs/Other/BrimstoneOrb.cs | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index c78d13b8c1..f7e789e900 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -351,7 +351,7 @@ namespace CalamityMod.CalPlayer for (int i = 0; i < Main.maxNPCs; ++i) { NPC npc = Main.npc[i]; - if (npc is null || !npc.IsAnEnemy()) + if (npc is null || !npc.IsAnEnemy() || npc.Calamity().DoesNotGenerateRage) continue; // Take the longer of the two directions for the NPC's hitbox to be generous. diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 86be0eb288..093719ee1f 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -114,6 +114,9 @@ namespace CalamityMod.NPCs public int shopAlertAnimTimer = 0; public int shopAlertAnimFrame = 0; + // Rage interactions + public bool DoesNotGenerateRage = false; + // NewAI internal const int maxAIMod = 4; public float[] newAI = new float[maxAIMod]; diff --git a/NPCs/Other/BrimstoneOrb.cs b/NPCs/Other/BrimstoneOrb.cs index eeefb6705f..8468cd95e5 100644 --- a/NPCs/Other/BrimstoneOrb.cs +++ b/NPCs/Other/BrimstoneOrb.cs @@ -33,6 +33,7 @@ namespace CalamityMod.NPCs.Other npc.knockBackResist = 0f; npc.netAlways = true; npc.aiStyle = -1; + npc.Calamity().DoesNotGenerateRage = true; } public override void ScaleExpertStats(int numPlayers, float bossLifeScale) => npc.lifeMax = 97444; From 79b5d517fed3b1ba2319ff5c28c41b4d0d2b4b9e Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 20:46:10 -0500 Subject: [PATCH 187/202] Fixed Weak Brimstone Flames showing time --- Buffs/DamageOverTime/WeakBrimstoneFlames.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Buffs/DamageOverTime/WeakBrimstoneFlames.cs b/Buffs/DamageOverTime/WeakBrimstoneFlames.cs index bf421c63ca..edf6f12830 100644 --- a/Buffs/DamageOverTime/WeakBrimstoneFlames.cs +++ b/Buffs/DamageOverTime/WeakBrimstoneFlames.cs @@ -12,6 +12,7 @@ namespace CalamityMod.Buffs.DamageOverTime Main.debuff[Type] = true; Main.pvpBuff[Type] = true; Main.buffNoSave[Type] = true; + Main.buffNoTimeDisplay[Type] = true; longerExpertDebuff = false; } From 6dcb27e0b39dce5d1768efdbfbe1a3b35fd3006d Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 20:48:42 -0500 Subject: [PATCH 188/202] Fixed UI interactions with the Calamity mouse --- ILEditing/ILChanges.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ILEditing/ILChanges.cs b/ILEditing/ILChanges.cs index 6bf6c712c0..adf8ec7167 100644 --- a/ILEditing/ILChanges.cs +++ b/ILEditing/ILChanges.cs @@ -611,7 +611,7 @@ namespace CalamityMod.ILEditing Main.spriteBatch.Draw(Main.cursorTextures[cursorIndex], drawPosition, null, desaturatedCursorColor, 0f, Vector2.Zero, Main.cursorScale, SpriteEffects.None, 0f); Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.instance.Rasterizer, null, Main.GameViewMatrix.EffectMatrix); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.instance.Rasterizer, null, Main.UIScaleMatrix); GameShaders.Misc["CalamityMod:FireMouse"].UseColor(Color.Red); GameShaders.Misc["CalamityMod:FireMouse"].UseSecondaryColor(Color.Lerp(Color.Red, Color.Orange, 0.75f)); GameShaders.Misc["CalamityMod:FireMouse"].Apply(); From 99c1a0ce2e17f872e1ddd81f87c09c175da04b34 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 20:51:17 -0500 Subject: [PATCH 189/202] Reduced Refraction Rotor dust --- Projectiles/Rogue/PrismRocket.cs | 3 +++ Projectiles/Rogue/PrismShurikenBlade.cs | 4 ++-- Projectiles/Rogue/RefractionRotorProjectile.cs | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Projectiles/Rogue/PrismRocket.cs b/Projectiles/Rogue/PrismRocket.cs index 482518b704..25e8598ab3 100644 --- a/Projectiles/Rogue/PrismRocket.cs +++ b/Projectiles/Rogue/PrismRocket.cs @@ -61,6 +61,9 @@ namespace CalamityMod.Projectiles.Rogue for (int i = 0; i < 2; i++) { + if (!Main.rand.NextBool(3)) + continue; + Dust dust = Dust.NewDustPerfect(projectile.Center - (projectile.rotation - MathHelper.PiOver2).ToRotationVector2() * 10f, 261); dust.color = Color.Cyan; dust.velocity = Main.rand.NextVector2Unit(); diff --git a/Projectiles/Rogue/PrismShurikenBlade.cs b/Projectiles/Rogue/PrismShurikenBlade.cs index 696565eed0..31e90538bb 100644 --- a/Projectiles/Rogue/PrismShurikenBlade.cs +++ b/Projectiles/Rogue/PrismShurikenBlade.cs @@ -31,9 +31,9 @@ namespace CalamityMod.Projectiles.Rogue if (Main.dedServ) return; - for (int i = 0; i < 25; i++) + for (int i = 0; i < 15; i++) { - Vector2 circularOffsetDirection = (MathHelper.TwoPi * i / 25f).ToRotationVector2().RotatedBy(projectile.velocity.ToRotation() - MathHelper.PiOver2); + Vector2 circularOffsetDirection = (MathHelper.TwoPi * i / 15f).ToRotationVector2().RotatedBy(projectile.velocity.ToRotation() - MathHelper.PiOver2); Vector2 spawnPosition = projectile.Center - (projectile.rotation - MathHelper.PiOver2).ToRotationVector2() * projectile.height * 1.25f; spawnPosition += circularOffsetDirection * new Vector2(12f, 7f); diff --git a/Projectiles/Rogue/RefractionRotorProjectile.cs b/Projectiles/Rogue/RefractionRotorProjectile.cs index e87801c161..24cdfaf854 100644 --- a/Projectiles/Rogue/RefractionRotorProjectile.cs +++ b/Projectiles/Rogue/RefractionRotorProjectile.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Rogue // If this projectile is a stealth strike, don't create the blades as a gore-- create them as a projectile instead. if (!Main.dedServ) { - for (int i = 0; i < 80; i++) + for (int i = 0; i < 15; i++) { Dust rainbowBurst = Dust.NewDustPerfect(projectile.Center, 267); rainbowBurst.color = Main.hslToRgb(i / 80f, 0.9f, 0.6f); From 25101e9737e30916bb9b63d8a7dc83fa577f40b4 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 20:53:51 -0500 Subject: [PATCH 190/202] Made Jailor chains a little slower --- Projectiles/Ranged/PrismMine.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projectiles/Ranged/PrismMine.cs b/Projectiles/Ranged/PrismMine.cs index b2e06f1ef6..406e1be8af 100644 --- a/Projectiles/Ranged/PrismMine.cs +++ b/Projectiles/Ranged/PrismMine.cs @@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Ranged float rotation = projectile.AngleTo(destination); float remainingDistance = projectile.Distance(destination) - 30f; float laserScale = 0.5f; - Rectangle frame = laserTexture.Frame(1, 7, 0, (int)(Main.GlobalTime * 17f + projectile.identity * 3f) % 7); + Rectangle frame = laserTexture.Frame(1, 7, 0, (int)(Main.GlobalTime * 10f + projectile.identity * 3f) % 7); Vector2 laserOrigin = frame.Size() * 0.5f; while (remainingDistance > frame.Height * laserScale) { From cd255ce60bcc34617e4f73d5f35dee556bd9d4ef Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 20:54:49 -0500 Subject: [PATCH 191/202] Added some missing dev item tags --- Items/Weapons/Magic/RainbowPartyCannon.cs | 1 + Items/Weapons/Summon/UniverseSplitter.cs | 1 + 2 files changed, 2 insertions(+) diff --git a/Items/Weapons/Magic/RainbowPartyCannon.cs b/Items/Weapons/Magic/RainbowPartyCannon.cs index 1fa28d3f8d..a346414cf1 100644 --- a/Items/Weapons/Magic/RainbowPartyCannon.cs +++ b/Items/Weapons/Magic/RainbowPartyCannon.cs @@ -49,6 +49,7 @@ namespace CalamityMod.Items.Weapons.Magic item.shoot = ModContent.ProjectileType(); item.channel = true; item.shootSpeed = 20f; + item.Calamity().devItem = true; } public override void ModifyTooltips(List tooltips) diff --git a/Items/Weapons/Summon/UniverseSplitter.cs b/Items/Weapons/Summon/UniverseSplitter.cs index 66c282b95e..10806aa174 100644 --- a/Items/Weapons/Summon/UniverseSplitter.cs +++ b/Items/Weapons/Summon/UniverseSplitter.cs @@ -47,6 +47,7 @@ namespace CalamityMod.Items.Weapons.Summon item.value = CalamityGlobalItem.RarityHotPinkBuyPrice; item.Calamity().customRarity = CalamityRarity.HotPink; + item.Calamity().devItem = true; } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; From 9391babda72dbe530ce52aee76fa82fd580f4ace Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 20:55:23 -0500 Subject: [PATCH 192/202] Adjusted Bullet-Filled Shotgun's tooltip --- Items/Weapons/Ranged/BulletFilledShotgun.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Ranged/BulletFilledShotgun.cs b/Items/Weapons/Ranged/BulletFilledShotgun.cs index 7b38b8dc0d..0dcb7bf48a 100644 --- a/Items/Weapons/Ranged/BulletFilledShotgun.cs +++ b/Items/Weapons/Ranged/BulletFilledShotgun.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Ranged { DisplayName.SetDefault("Bullet-Filled Shotgun"); Tooltip.SetDefault("Fires a massive spread of bouncing bullets\n" + - "Consumes five ammo per fire\n" + + "Consumes five bullets per-use\n" + "Aim? What's that?"); } public override void SetDefaults() From 4f1a4ed3ca159167fb21c5cb35bc8add135b970c Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 21:05:32 -0500 Subject: [PATCH 193/202] Calamitas Encahnt UI scale integration --- .../CalamitasEnchantUI.cs | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/UI/CalamitasEnchantments/CalamitasEnchantUI.cs b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs index e4434c1263..39ade9da0c 100644 --- a/UI/CalamitasEnchantments/CalamitasEnchantUI.cs +++ b/UI/CalamitasEnchantments/CalamitasEnchantUI.cs @@ -82,7 +82,7 @@ namespace CalamityMod.UI.CalamitasEnchants Main.npcChatText = string.Empty; Texture2D backgroundTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/CalamitasCurseBackground"); - Vector2 backgroundScale = Vector2.One; + Vector2 backgroundScale = Vector2.One * Main.UIScale; // Draw the background. spriteBatch.Draw(backgroundTexture, ReforgeUITopLeft, null, Color.White, 0f, Vector2.Zero, backgroundScale, SpriteEffects.None, 0f); @@ -100,8 +100,8 @@ namespace CalamityMod.UI.CalamitasEnchants Point costDrawPositionTopLeft = (ReforgeUITopLeft + new Vector2(50f, 78f) * backgroundScale).ToPoint(); cost = DrawEnchantmentCost(spriteBatch, costDrawPositionTopLeft); Point descriptionDrawPositionTopLeft = costDrawPositionTopLeft; - descriptionDrawPositionTopLeft.Y += 70; - Vector2 iconDrawPositionTopLeft = costDrawPositionTopLeft.ToVector2() + new Vector2(270f, -24f); + descriptionDrawPositionTopLeft.Y += (int)(Main.UIScale * 70f); + Vector2 iconDrawPositionTopLeft = costDrawPositionTopLeft.ToVector2() + new Vector2(270f, -24f) * Main.UIScale; DrawEnchantmentDescription(spriteBatch, descriptionDrawPositionTopLeft); if (!string.IsNullOrEmpty(SelectedEnchantment.Value.IconTexturePath)) @@ -174,15 +174,15 @@ namespace CalamityMod.UI.CalamitasEnchants // Draw the coin costs. string costText = "Cost: "; - Utils.DrawBorderStringFourWay(spriteBatch, Main.fontMouseText, costText, costDrawPositionTopLeft.X, costDrawPositionTopLeft.Y + 45f, Color.White * (Main.mouseTextColor / 255f), Color.Black, Vector2.Zero); - costDrawPositionTopLeft.X += (int)(Main.fontMouseText.MeasureString(costText).X * 0.5f + 12f); + Utils.DrawBorderStringFourWay(spriteBatch, Main.fontMouseText, costText, costDrawPositionTopLeft.X, costDrawPositionTopLeft.Y + 45f * Main.UIScale, Color.White * (Main.mouseTextColor / 255f), Color.Black, Vector2.Zero, Main.UIScale); + costDrawPositionTopLeft.X += (int)((Main.fontMouseText.MeasureString(costText).X * 0.5f + 12f) * Main.UIScale); int[] coinsArray = Utils.CoinsSplit(cost); for (int i = 0; i < 4; i++) { - Vector2 drawPosition = new Vector2(costDrawPositionTopLeft.X + ChatManager.GetStringSize(Main.fontMouseText, costText, Vector2.One, -1f).X + (24 * i) - 24f, costDrawPositionTopLeft.Y + 54f); - spriteBatch.Draw(Main.itemTexture[ItemID.PlatinumCoin - i], drawPosition, null, Color.White, 0f, Main.itemTexture[ItemID.PlatinumCoin - i].Size() * 0.5f, 1f, SpriteEffects.None, 0f); - Utils.DrawBorderStringFourWay(spriteBatch, Main.fontItemStack, coinsArray[3 - i].ToString(), drawPosition.X - 11f, drawPosition.Y, Color.White, Color.Black, new Vector2(0.3f), 0.75f); + Vector2 drawPosition = new Vector2(costDrawPositionTopLeft.X + (ChatManager.GetStringSize(Main.fontMouseText, costText, Vector2.One, -1f).X + ((24 * i) - 24f)) * Main.UIScale, costDrawPositionTopLeft.Y + 54f * Main.UIScale); + spriteBatch.Draw(Main.itemTexture[ItemID.PlatinumCoin - i], drawPosition, null, Color.White, 0f, Main.itemTexture[ItemID.PlatinumCoin - i].Size() * 0.5f, Main.UIScale, SpriteEffects.None, 0f); + Utils.DrawBorderStringFourWay(spriteBatch, Main.fontItemStack, coinsArray[3 - i].ToString(), drawPosition.X - 11f, drawPosition.Y, Color.White, Color.Black, new Vector2(0.3f), 0.75f * Main.UIScale); } return cost; @@ -191,20 +191,20 @@ namespace CalamityMod.UI.CalamitasEnchants public static void DrawEnchantmentDescription(SpriteBatch spriteBatch, Point descriptionDrawPositionTopLeft) { Vector2 vectorDrawPosition = descriptionDrawPositionTopLeft.ToVector2(); - Vector2 scale = new Vector2(0.67f, 0.7f) * MathHelper.Clamp(ResolutionRatio, 0.825f, 1f); + Vector2 scale = new Vector2(0.67f, 0.7f) * MathHelper.Clamp(ResolutionRatio, 0.825f, 1f) * Main.UIScale; foreach (string line in Utils.WordwrapString(SelectedEnchantment.Value.Description, Main.fontMouseText, 465, 10, out _)) { if (string.IsNullOrEmpty(line)) continue; ChatManager.DrawColorCodedStringWithShadow(spriteBatch, Main.fontMouseText, line, vectorDrawPosition, Color.Orange, 0f, Vector2.Zero, scale); - vectorDrawPosition.Y += 16; + vectorDrawPosition.Y += Main.UIScale * 16f; } } public static void DrawIcon(SpriteBatch spriteBatch, Vector2 drawPositionTopLeft, Texture2D texture) { - spriteBatch.Draw(texture, drawPositionTopLeft, null, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + spriteBatch.Draw(texture, drawPositionTopLeft, null, Color.White, 0f, Vector2.Zero, Main.UIScale, SpriteEffects.None, 0f); } public static void DrawItemIcon(SpriteBatch spriteBatch, Vector2 itemSlotDrawPosition, Vector2 reforgeIconDrawPosition, Vector2 scale, out bool isHoveringOverItemIcon, out bool isHoveringOverReforgeIcon) @@ -246,7 +246,7 @@ namespace CalamityMod.UI.CalamitasEnchants if (hasMultipleFrames) itemFrame = Main.itemAnimations[CurrentlyHeldItem.type].GetFrame(itemTexture); - float baseScale = 1f; + float baseScale = Main.UIScale; Color _ = Color.White; ItemSlot.GetItemLight(ref _, ref baseScale, CurrentlyHeldItem, false); @@ -340,7 +340,7 @@ namespace CalamityMod.UI.CalamitasEnchants public static void DrawEnchantmentName(SpriteBatch spriteBatch, Vector2 nameDrawCenter) { - Vector2 scale = new Vector2(0.8f, 0.745f); + Vector2 scale = new Vector2(0.8f, 0.745f) * Main.UIScale; float textWidth = Main.fontMouseText.MeasureString(SelectedEnchantment.Value.Name).X * scale.X; Color drawColor = SelectedEnchantment.Value.Equals(EnchantmentManager.ClearEnchantment) ? Color.White : Color.Orange; nameDrawCenter.X -= textWidth * 0.5f; From 7a017a2c4f6c611522a77e51e44dadf5a9b6c24b Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 21:09:20 -0500 Subject: [PATCH 194/202] Celestial Sigil stack fix --- Items/CalamityGlobalItem.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index a8e3a9afa5..babd4bca52 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -130,7 +130,10 @@ namespace CalamityMod.Items if (item.type == ItemID.PirateMap || item.type == ItemID.SnowGlobe) item.maxStack = 20; - if (item.type >= ItemID.GreenSolution && item.type <= ItemID.RedSolution) + if (item.type == ItemID.CelestialSigil) + item.maxStack = 1; + + if (item.type >= ItemID.GreenSolution && item.type <= ItemID.RedSolution) item.value = Item.buyPrice(0, 0, 5, 0); if (CalamityLists.useTurnList?.Contains(item.type) ?? false) From 56b193cac1ac65cacc04289f4602ba3999721534 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 26 Jun 2021 21:09:52 -0500 Subject: [PATCH 195/202] Game loading fix --- UI/CalamitasEnchantments/EnchantmentManager.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/UI/CalamitasEnchantments/EnchantmentManager.cs b/UI/CalamitasEnchantments/EnchantmentManager.cs index a1e0e3ce78..e30094da53 100644 --- a/UI/CalamitasEnchantments/EnchantmentManager.cs +++ b/UI/CalamitasEnchantments/EnchantmentManager.cs @@ -209,6 +209,9 @@ namespace CalamityMod.UI.CalamitasEnchants item => item.useTime = item.useAnimation = 25, player => { + if (Main.gameMenu) + return; + player.Calamity().bladeArmEnchant = true; bool armsArePresent = false; int armType = ModContent.ProjectileType(); @@ -263,6 +266,9 @@ namespace CalamityMod.UI.CalamitasEnchants null, player => { + if (Main.gameMenu) + return; + player.Calamity().lecherousOrbEnchant = true; bool orbIsPresent = false; From 7df3196eaf9bf228988947d2e61a29f8d9602929 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sun, 27 Jun 2021 00:41:14 -0500 Subject: [PATCH 196/202] Exhumed Hearts no longer generate rage --- NPCs/Other/ExhumedHeart.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/NPCs/Other/ExhumedHeart.cs b/NPCs/Other/ExhumedHeart.cs index f1fdb578b3..bfde229cb5 100644 --- a/NPCs/Other/ExhumedHeart.cs +++ b/NPCs/Other/ExhumedHeart.cs @@ -37,6 +37,7 @@ namespace CalamityMod.NPCs.Other npc.knockBackResist = 0f; npc.netAlways = true; npc.aiStyle = -1; + npc.Calamity().DoesNotGenerateRage = true; } public override void ScaleExpertStats(int numPlayers, float bossLifeScale) => npc.lifeMax = 51740; From 16dcfd8f5d18abdfdb8412d700f2238dfd1cf894 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sun, 27 Jun 2021 01:40:55 -0500 Subject: [PATCH 197/202] Made Apotheosis a tiny bit less jarring --- Projectiles/Magic/ApotheosisEnergy.cs | 2 +- Projectiles/Magic/ApotheosisWorm.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Projectiles/Magic/ApotheosisEnergy.cs b/Projectiles/Magic/ApotheosisEnergy.cs index 30c346c073..0b27b1b7fe 100644 --- a/Projectiles/Magic/ApotheosisEnergy.cs +++ b/Projectiles/Magic/ApotheosisEnergy.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Magic baseColor = Color.Lerp(baseColor, Color.Fuchsia, (completionRatio - 0.66f) / 0.33f); else { - float whiteFade = (float)Math.Sin(Utils.InverseLerp(0.1f, 0.56f, completionRatio, true) * MathHelper.Pi + Main.GlobalTime * 10f) * 0.85f; + float whiteFade = (float)Math.Sin(Utils.InverseLerp(0.0f, 0.2f, completionRatio, true) * MathHelper.Pi + Main.GlobalTime * 3f) * 0.45f; baseColor = Color.Lerp(baseColor, Color.White, whiteFade); } diff --git a/Projectiles/Magic/ApotheosisWorm.cs b/Projectiles/Magic/ApotheosisWorm.cs index 77e904b95b..dd7c1fa2ec 100644 --- a/Projectiles/Magic/ApotheosisWorm.cs +++ b/Projectiles/Magic/ApotheosisWorm.cs @@ -317,7 +317,7 @@ namespace CalamityMod.Projectiles.Magic colorA *= currentFade; colorB *= currentFade; Vector2 origin = texture.Size() / 2f; - Vector2 scale = new Vector2(8f, 19f) * projectile.Opacity * currentFade; + Vector2 scale = new Vector2(4f, 10f) * projectile.Opacity * currentFade; spriteBatch.Draw(texture, drawPos, null, colorA, MathHelper.PiOver2, origin, scale, SpriteEffects.None, 0); spriteBatch.Draw(texture, drawPos, null, colorA, 0f, origin, scale, SpriteEffects.None, 0); From bf3568b54b05209c58b2ea28392734bb0fe4ad4f Mon Sep 17 00:00:00 2001 From: Dominic Date: Sun, 27 Jun 2021 07:48:27 -0500 Subject: [PATCH 198/202] Tainted enchant fire gauntlet fix --- Projectiles/Melee/TaintedBladeSlasher.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Projectiles/Melee/TaintedBladeSlasher.cs b/Projectiles/Melee/TaintedBladeSlasher.cs index f4d16515ed..7d493cda46 100644 --- a/Projectiles/Melee/TaintedBladeSlasher.cs +++ b/Projectiles/Melee/TaintedBladeSlasher.cs @@ -108,6 +108,7 @@ namespace CalamityMod.Projectiles.Melee projectile.penetrate = -1; projectile.timeLeft = 90000; projectile.usesLocalNPCImmunity = true; + projectile.noEnchantments = true; } public override void SendExtraAI(BinaryWriter writer) => writer.Write(VerticalOffset); From 80d00c8cebaa8771571be3bf4469be0312f7f0df Mon Sep 17 00:00:00 2001 From: Dominic Date: Mon, 28 Jun 2021 19:14:52 -0500 Subject: [PATCH 199/202] Malice sprite stuff --- ExtraTextures/UI/ModeIndicatorArea.png | Bin 1124 -> 662 bytes ExtraTextures/UI/ModeIndicatorMalice.png | Bin 0 -> 357 bytes ExtraTextures/UI/ModeIndicatorRune.png | Bin 567 -> 0 bytes Items/DifficultyItems/Malice.cs | 3 +++ Items/DifficultyItems/Malice.png | Bin 497 -> 3073 bytes UI/ModeIndicatorUI.cs | 16 +++++++--------- 6 files changed, 10 insertions(+), 9 deletions(-) create mode 100644 ExtraTextures/UI/ModeIndicatorMalice.png delete mode 100644 ExtraTextures/UI/ModeIndicatorRune.png diff --git a/ExtraTextures/UI/ModeIndicatorArea.png b/ExtraTextures/UI/ModeIndicatorArea.png index 701089c3ccdaa9e9c2109e739c44bc0a64782550..508fe00039ad87668029603cf3d9c898db4d9fe8 100644 GIT binary patch delta 620 zcmV-y0+apZ2$ltq83+Ra0021Ia<`EoAb%K8OjJb{6&_DlUuA7_Kt@k4F+GTnksu%~ z0000i1}vcf000PdQchF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pMJAX_o!(4;pDt2j& z)BDa;8$-ef!d;KB3;>9zi+EP-&GK#P2l>YX7E7yUH{*1Xu=? zjsX^7gy1%UY3mn1FvM#B_ZPqWY?<0dFqR>JpE_|rz;}?^Q)F8PFkytynh}iG5PloZ zbY%b&MhKl5!7F$T>B|5nj1YP=f?-2IUj{H?L}oDf1Ns3=TN>bL)Bpeg07*qoM6N<$ Eg3>_vKmY&$ diff --git a/ExtraTextures/UI/ModeIndicatorMalice.png b/ExtraTextures/UI/ModeIndicatorMalice.png new file mode 100644 index 0000000000000000000000000000000000000000..bfa33cbe8d04eb35f37a3da2c9bac5f474540a72 GIT binary patch literal 357 zcmeAS@N?(olHy`uVBq!ia0vp^azL!W!3-pg=2`dxDaPU;cPEB*=VV?2IV|apzK#qG z8~eHcB(ehe>H$6>t_ljeskue|;qe{)6CK?A#YE-w3~hIm#uON8PWE+vvb^E{%R@l5 zFEeMe04d&*Aiv=MNPxlig;E<(g0sLQvY3H^Z$Ah#TCfJI00q~1x;Tbd_)nb_&DWy9 zKr$oB^kbGSFT0S#5JKNOiGoCHyDmLF`Suxta-QcneAQ6BQ7W? m|8!pI5X#&U-59?2z5P`#(T~;J=Pd@hoWax8&t;ucLK6VP42UHF literal 0 HcmV?d00001 diff --git a/ExtraTextures/UI/ModeIndicatorRune.png b/ExtraTextures/UI/ModeIndicatorRune.png deleted file mode 100644 index 51a2ed08d5258278e95aeed20db9b06ee537d0b6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 567 zcmV-70?7S|P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGizyJUazyWI3i3tDz0nAB6K~z{r)t668 z0zn*x#}qmU{zXGbU6l$13+oVci|`Wk1?uL#@6ZS6*4;|bxbA`_7@U~^1>t`;1dE>n2kgQz<$9=d6gei0*|;p zAu0h-!AiMIX&+;NHPl1TSO)h1u)i_Pz|DPz^8EOj^5~3@_qO;Lpc3x|{6%%yPLR0Xgb zVYf0e{Af3A@|0=xPeQK(GDe0n_BED~D*%iPWh^pg><1MF(bE%>enbEO002ovPDHLk FV1m3{0lfeK diff --git a/Items/DifficultyItems/Malice.cs b/Items/DifficultyItems/Malice.cs index 998250226f..874febecbf 100644 --- a/Items/DifficultyItems/Malice.cs +++ b/Items/DifficultyItems/Malice.cs @@ -3,6 +3,7 @@ using CalamityMod.Events; using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; @@ -16,6 +17,7 @@ namespace CalamityMod.Items.DifficultyItems Tooltip.SetDefault("Enrages every boss and allows them to drop special items.\n" + "Nurse no longer heals while a boss is alive.\n" + "Effect can be toggled on and off."); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 8)); } public override void SetDefaults() @@ -27,6 +29,7 @@ namespace CalamityMod.Items.DifficultyItems item.useTime = 45; item.useStyle = ItemUseStyleID.HoldingUp; item.UseSound = SoundID.Item119; + item.noUseGraphic = true; item.consumable = false; } diff --git a/Items/DifficultyItems/Malice.png b/Items/DifficultyItems/Malice.png index 493a9b001ca2fca997f4041e011df8e577faa106..fa448647be361034f7e03ec5ef3152dae9f99bfd 100644 GIT binary patch literal 3073 zcmbVOdpy&7AD>Gkm$K+&O%|I=ku0$dGYs1>hKh(Bb5d?$iQ`Uj6f@fn<=#X|BDoey z&XExzxh7#@p>j!?%bq!%>YV4l=lQ-~-`D5&z5V`pf8L+>=bdCnw3OZk+6Djsr13bc zy&wvv@Q$q_f-l%QdrA<5g6%C$0e3sWT){&0w26%g0B|o=a?N9lV7=eY+R@w;g;9`G z^71^JmiT)L+%S{$voA=g>6eIpCX-WF#}|x`fVP{0+W^rqyD&kJq1Y20Hut{|fcfKB zt%4JYb2#TFN1xWOMiN$p&sUK9m7 zjg%k#wFD5^QQ+4R)9w0x$21b}3~sm=$T?q06@}^kGIv@MI$c7;E>L(Yi~Y1b zxcvu{sZQ)i#$X*GsykWc+$GdYuPe*mw^bp%@L4nerlu zEr!t%5mENFF0;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3Q5R7gv$lv|R+APfXo$lwsx_rLDa9w?m0&w{5aj)bNufiXYF7g<$* ze(D~?ECeC?f7cy|nfpN8KcQ8G1)FVELKLB9IJJ&oim@9NYl5K_B%KOjuZq#^@i2># zECkh>aS@@6Vc%&A#7sH52ho4xRRln0n&@={R*_f*kh7o48Hmxl5K1(b(z6P?I}xq% zO26*d1fs)|l6xsM6JsgvnrhqbLJ&n3{(Fi@cGQeZ2;$SF4Gg95q}BIJV-4XL0&z*O z)ocWr#+#{X1<`Tg$)Z!r8N^*<*CR8J@Cjq4$jjqsVkOo%pR>HP2nAZ2;n&;HbwQ+Y zFhO%jAL7-4aCP_Vf>`6-GlvW_soJ new Vector2(0f, -16f); - public static Vector2 ArmageddonIconOffset => new Vector2(11.5f, 7f); - public static Vector2 DefiledRuneIconOffset => new Vector2(-12f, 7); + public static Vector2 ArmageddonIconOffset => new Vector2(12f, 7f); + public static Vector2 MaliceIconOffset => new Vector2(-12f, 7f); public static void Draw(SpriteBatch spriteBatch) { // The mode indicator should only be displayed when the inventory is open, to prevent obstruction. @@ -22,9 +22,7 @@ namespace CalamityMod.UI Texture2D revengeanceIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/ModeIndicatorRev"); Texture2D deathIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/ModeIndicatorDeath"); Texture2D armageddonIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/ModeIndicatorArma"); - - // TODO -- When Malice is added, replace this with Malice's indicator. - Texture2D defiledRuneIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/ModeIndicatorRune"); + Texture2D maliceIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/ModeIndicatorMalice"); Vector2 drawCenter = new Vector2(Main.screenWidth - 400f, 72f) + outerAreaTexture.Size() * 0.5f; @@ -33,14 +31,14 @@ namespace CalamityMod.UI if (CalamityWorld.revenge) { Texture2D difficultyIconToUse = CalamityWorld.death ? deathIconTexture : revengeanceIconTexture; - spriteBatch.Draw(difficultyIconToUse, drawCenter + DifficultyIconOffset, null, Color.White, 0f, revengeanceIconTexture.Size() * 0.5f, 0.9f, SpriteEffects.None, 0f); + spriteBatch.Draw(difficultyIconToUse, drawCenter + DifficultyIconOffset, null, Color.White, 0f, difficultyIconToUse.Size() * 0.5f, 0.9f, SpriteEffects.None, 0f); } if (CalamityWorld.armageddon) - spriteBatch.Draw(armageddonIconTexture, drawCenter + ArmageddonIconOffset, null, Color.White, 0f, revengeanceIconTexture.Size() * 0.5f, 0.9f, SpriteEffects.None, 0f); + spriteBatch.Draw(armageddonIconTexture, drawCenter + ArmageddonIconOffset, null, Color.White, 0f, armageddonIconTexture.Size() * 0.5f, 0.9f, SpriteEffects.None, 0f); - /*if (false) - spriteBatch.Draw(defiledRuneIconTexture, drawCenter + DefiledRuneIconOffset, null, Color.White, 0f, revengeanceIconTexture.Size() * 0.5f, 0.9f, SpriteEffects.None, 0f);*/ + if (CalamityWorld.malice) + spriteBatch.Draw(maliceIconTexture, drawCenter + MaliceIconOffset, null, Color.White, 0f, maliceIconTexture.Size() * 0.5f, 0.9f, SpriteEffects.None, 0f); } } } From 5ac54a7a0b0acd698aa57be513b84064c44ec67a Mon Sep 17 00:00:00 2001 From: Dominic Date: Mon, 28 Jun 2021 19:26:09 -0500 Subject: [PATCH 200/202] Icon render fixes --- ExtraTextures/UI/ModeIndicatorArma.png | Bin 527 -> 253 bytes ExtraTextures/UI/ModeIndicatorDeath.png | Bin 539 -> 257 bytes ExtraTextures/UI/ModeIndicatorMalice.png | Bin 357 -> 261 bytes ExtraTextures/UI/ModeIndicatorRev.png | Bin 523 -> 248 bytes UI/ModeIndicatorUI.cs | 8 ++++---- 5 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ExtraTextures/UI/ModeIndicatorArma.png b/ExtraTextures/UI/ModeIndicatorArma.png index d5e6ea594e2e8d084fc20206a7b516cd03f3080b..619f29b4a2beff55eda3871d668aa5e75be5386c 100644 GIT binary patch delta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~ZJAcUey3CuNSCOGPT#vdYC>9y zjFq~SMygz9Tt9zc^V5j9Ef)@N7gGOqvVGSz?!q?$wYwJ!z6M&$;OXk;vd$@?2>>K@ BR&D?Q delta 280 zcmZo=ddf7x(NjIZC&X1jK{qwG$Ui*3qkp1~mXaX9;Q#;s zGdO6i`~u{27I;J!GcfQS0Aa?gYn_}x!BkHd#}EturxU&T8VopC1K-uB8?(A3FFxO@ zoqm!3@}5gq{!FXSkbaW3AZv5#^8OXGK3OG9b&V8`SnK<~?#gq)5MK-DEg{7VvXq=l zw=8>X$x{3zBG4oxCuX8+B=h`BT=!mR%V&M(?Y+ktxzi?D6=)-ar>mdKI;Vst0ERM4 A5&!@I delta 480 zcmV<60U!SO0gD8X83+ad000F*$bXR`Ab$yPNLh0L01m+b01m+cxRGn^0004?Nkl ztA^!DS+>H|sx{dP&{e=3<0!*U=NW0+i^xJghitamNVQ*Af%uFaXDwv7v9*bOdwE4J zuN08v{;r99Xta<{F^`NIH@7g4yuQ3blK6~mD+}Y*QVAdM4v8nt-em<2QfZ{h@t}{K zmDjtn5`-1Jt=Ey}7!%GR4R_L?NPivY{b?jCz%@Y3H?CSKBx!6P%2t@-#gS|URJsG? z_!)DKIcK_6t&TU&c;qh@CbSW#?}uf4RyE_FR>$WR}u)*-?r@Mcpc`< z@$O?6Nls=akvyGfNqg?$wB+fu|M86^XITqr&dx<>-s|>|r&HniqA7p7QB9}U-d9kW zjFmysl*DJOK4mW1xuGh+Q;MgO&hV+zHsmQ&_fI0K0xCK~6?2VM)Cv%tp-N1~iNp`H WoZqEpmC`=|0000 new Vector2(0f, -16f); + public static Vector2 DifficultyIconOffset => new Vector2(0f, -13f); public static Vector2 ArmageddonIconOffset => new Vector2(12f, 7f); public static Vector2 MaliceIconOffset => new Vector2(-12f, 7f); public static void Draw(SpriteBatch spriteBatch) @@ -31,14 +31,14 @@ namespace CalamityMod.UI if (CalamityWorld.revenge) { Texture2D difficultyIconToUse = CalamityWorld.death ? deathIconTexture : revengeanceIconTexture; - spriteBatch.Draw(difficultyIconToUse, drawCenter + DifficultyIconOffset, null, Color.White, 0f, difficultyIconToUse.Size() * 0.5f, 0.9f, SpriteEffects.None, 0f); + spriteBatch.Draw(difficultyIconToUse, drawCenter + DifficultyIconOffset, null, Color.White, 0f, difficultyIconToUse.Size() * 0.5f, 1f, SpriteEffects.None, 0f); } if (CalamityWorld.armageddon) - spriteBatch.Draw(armageddonIconTexture, drawCenter + ArmageddonIconOffset, null, Color.White, 0f, armageddonIconTexture.Size() * 0.5f, 0.9f, SpriteEffects.None, 0f); + spriteBatch.Draw(armageddonIconTexture, drawCenter + ArmageddonIconOffset, null, Color.White, 0f, armageddonIconTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0f); if (CalamityWorld.malice) - spriteBatch.Draw(maliceIconTexture, drawCenter + MaliceIconOffset, null, Color.White, 0f, maliceIconTexture.Size() * 0.5f, 0.9f, SpriteEffects.None, 0f); + spriteBatch.Draw(maliceIconTexture, drawCenter + MaliceIconOffset, null, Color.White, 0f, maliceIconTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0f); } } } From ac4859e6a03f9b989cadfb7c1dd35a841b1e7778 Mon Sep 17 00:00:00 2001 From: Dominic Date: Mon, 28 Jun 2021 21:26:31 -0500 Subject: [PATCH 201/202] UI hover text --- UI/ModeIndicatorUI.cs | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/UI/ModeIndicatorUI.cs b/UI/ModeIndicatorUI.cs index 694004e53e..ea0209a775 100644 --- a/UI/ModeIndicatorUI.cs +++ b/UI/ModeIndicatorUI.cs @@ -24,21 +24,49 @@ namespace CalamityMod.UI Texture2D armageddonIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/ModeIndicatorArma"); Texture2D maliceIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/ModeIndicatorMalice"); + Rectangle mouseRectangle = Utils.CenteredRectangle(Main.MouseScreen, Vector2.One * 2f); + Vector2 drawCenter = new Vector2(Main.screenWidth - 400f, 72f) + outerAreaTexture.Size() * 0.5f; spriteBatch.Draw(outerAreaTexture, drawCenter, null, Color.White, 0f, outerAreaTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0f); + Texture2D difficultyIconToUse = CalamityWorld.death ? deathIconTexture : revengeanceIconTexture; + bool modeIsActive = CalamityWorld.revenge; + bool renderingText = false; if (CalamityWorld.revenge) - { - Texture2D difficultyIconToUse = CalamityWorld.death ? deathIconTexture : revengeanceIconTexture; spriteBatch.Draw(difficultyIconToUse, drawCenter + DifficultyIconOffset, null, Color.White, 0f, difficultyIconToUse.Size() * 0.5f, 1f, SpriteEffects.None, 0f); + + // Rev/Death active text. + if (mouseRectangle.Intersects(Utils.CenteredRectangle(drawCenter + DifficultyIconOffset, difficultyIconToUse.Size()))) + { + Main.instance.MouseText($"{(CalamityWorld.death ? "Death" : "Revengeance")} mode is {(modeIsActive ? "active" : "not active")}."); + renderingText = true; } if (CalamityWorld.armageddon) + { spriteBatch.Draw(armageddonIconTexture, drawCenter + ArmageddonIconOffset, null, Color.White, 0f, armageddonIconTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0f); + } + + // Armageddon active text. + if (!renderingText && mouseRectangle.Intersects(Utils.CenteredRectangle(drawCenter + ArmageddonIconOffset, armageddonIconTexture.Size()))) + { + Main.instance.MouseText($"Armageddon mode is {(CalamityWorld.armageddon ? "active" : "not active")}."); + renderingText = true; + } if (CalamityWorld.malice) spriteBatch.Draw(maliceIconTexture, drawCenter + MaliceIconOffset, null, Color.White, 0f, maliceIconTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0f); + + // Malice active text. + if (!renderingText && mouseRectangle.Intersects(Utils.CenteredRectangle(drawCenter + MaliceIconOffset, armageddonIconTexture.Size()))) + { + Main.instance.MouseText($"Malice mode is {(CalamityWorld.malice ? "active" : "not active")}."); + renderingText = true; + } + + if (renderingText) + Main.instance.MouseTextHackZoom(string.Empty); } } } From 954ffb73123132e261457748d4a3da431cf41825 Mon Sep 17 00:00:00 2001 From: Cameron Ewell Date: Mon, 28 Jun 2021 23:04:31 -0400 Subject: [PATCH 202/202] Mode is capitalized, Armageddon isn't Armageddon Mode --- UI/ModeIndicatorUI.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/UI/ModeIndicatorUI.cs b/UI/ModeIndicatorUI.cs index ea0209a775..5967268016 100644 --- a/UI/ModeIndicatorUI.cs +++ b/UI/ModeIndicatorUI.cs @@ -39,7 +39,7 @@ namespace CalamityMod.UI // Rev/Death active text. if (mouseRectangle.Intersects(Utils.CenteredRectangle(drawCenter + DifficultyIconOffset, difficultyIconToUse.Size()))) { - Main.instance.MouseText($"{(CalamityWorld.death ? "Death" : "Revengeance")} mode is {(modeIsActive ? "active" : "not active")}."); + Main.instance.MouseText($"{(CalamityWorld.death ? "Death" : "Revengeance")} Mode is {(modeIsActive ? "active" : "not active")}."); renderingText = true; } @@ -51,7 +51,7 @@ namespace CalamityMod.UI // Armageddon active text. if (!renderingText && mouseRectangle.Intersects(Utils.CenteredRectangle(drawCenter + ArmageddonIconOffset, armageddonIconTexture.Size()))) { - Main.instance.MouseText($"Armageddon mode is {(CalamityWorld.armageddon ? "active" : "not active")}."); + Main.instance.MouseText($"Armageddon is {(CalamityWorld.armageddon ? "active" : "not active")}."); renderingText = true; } @@ -61,7 +61,7 @@ namespace CalamityMod.UI // Malice active text. if (!renderingText && mouseRectangle.Intersects(Utils.CenteredRectangle(drawCenter + MaliceIconOffset, armageddonIconTexture.Size()))) { - Main.instance.MouseText($"Malice mode is {(CalamityWorld.malice ? "active" : "not active")}."); + Main.instance.MouseText($"Malice Mode is {(CalamityWorld.malice ? "active" : "not active")}."); renderingText = true; }

OHT|dzbSFFanv5OzZ>;ZHDG3H-SfK1?<@OJ zKIPI_cau|eEd8UBeW?;J^1kf(zO|La@V%^{(5FU;2Sw#NfTX4A&S9WcKP4)hm$#nVwoca*iSh^i{Ecn=t_lqdHb7pli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}mF~U&-nhPysPS z1pvv$Ov3K)$Tr8o#G&CgGZ76_rp?ezM@mV*11tITj&+}%5bq<}32S3M_!}8w-ejWr zd27hMcnocEHx^{$1MpJg^5Y78I4-glUfod5=TuN&;uS#OGTxBZd7OLC6mq;+g-Unc zizj$SE%nkO2L&x6t{?3y zkO5KkL*&5`XR?4-#B6VW-Q1RDxzE$=kkIfqTbd)#G?C$7Sc2`Gp+g?@uok|4KHT!s zorPJ4!z6(G);{S8S4%M1w(TrPohogVNhcc;t}iX-1M)lr^FNaQza!`Zxr?QCEeqRSe5bO*%)X8TCGs!m$-n8Cu2UnE zD&-^izaXXsoeoPyu6_nDp4YIexItFn$^EYZ3*D)cBJ5E>#A_m-=yImQV8*RQZD;7HHbyNfBUmX4?XU3rE^1Vm^G7H< zYE^unmZrOb5EC`r+P2v>M`2N3W!Gke2XZuj(); - item.shootSpeed = 6f; + item.shootSpeed = 13.5f; item.Calamity().customRarity = CalamityRarity.ItemSpecific; } diff --git a/Projectiles/Magic/FabBolt.cs b/Projectiles/Magic/FabBolt.cs index a4176ffc0f..339cd823ce 100644 --- a/Projectiles/Magic/FabBolt.cs +++ b/Projectiles/Magic/FabBolt.cs @@ -1,40 +1,108 @@ using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using System.Linq; using Terraria; +using Terraria.Graphics.Shaders; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { public class FabBolt : ModProjectile { + internal PrimitiveTrail TrailDrawer; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public bool FadingOut + { + get => projectile.ai[0] == 1f; + set => projectile.ai[0] = value.ToInt(); + } + public override void SetStaticDefaults() { DisplayName.SetDefault("Bolt"); + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 23; } public override void SetDefaults() { projectile.width = 4; projectile.height = 4; - projectile.extraUpdates = 100; projectile.friendly = true; - projectile.timeLeft = 45; + projectile.extraUpdates = 2; + projectile.penetrate = 12; + projectile.timeLeft = 90 * projectile.extraUpdates; projectile.magic = true; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 0; } public override void AI() { - if (projectile.timeLeft % 2f == 0f) - { - Vector2 vector33 = projectile.position; - vector33 -= projectile.velocity * 0.25f; - int num448 = Dust.NewDust(vector33, 1, 1, 234, 0f, 0f, 0, default, 1.25f); - Main.dust[num448].position = vector33; - Main.dust[num448].noGravity = true; - Main.dust[num448].noLight = true; - Main.dust[num448].scale = Main.rand.Next(70, 110) * 0.013f; - Main.dust[num448].velocity *= 0.1f; - } + if (FadingOut) + { + projectile.Opacity = MathHelper.Lerp(projectile.Opacity, 0f, 0.27f); + if (projectile.Opacity <= 0.05f) + projectile.Kill(); + } + else + projectile.velocity *= 1.004f; } - } + + internal Color ColorFunction(float completionRatio) + { + float fadeToEnd = MathHelper.Lerp(0.25f, 0.5f, (float)Math.Cos(-Main.GlobalTime * 3f) * 0.5f + 0.5f); + fadeToEnd *= 1f - Utils.InverseLerp(0.35f, 0f, completionRatio, true); + Color endColor = Color.Lerp(Color.Cyan, Color.HotPink, projectile.identity % 2); + return Color.Lerp(Color.White, endColor, fadeToEnd) * projectile.Opacity * 0.7f; + } + + internal float WidthFunction(float completionRatio) + { + float expansionCompletion = 1f - (float)Math.Pow(1f - Utils.InverseLerp(0f, 0.2f, completionRatio, true), 2D); + return MathHelper.Lerp(0f, 22f, expansionCompletion) * projectile.Opacity; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + if (TrailDrawer is null) + TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, true, GameShaders.Misc["CalamityMod:FabstaffRay"]); + + GameShaders.Misc["CalamityMod:FabstaffRay"].SetShaderTexture(ModContent.GetTexture("CalamityMod/ExtraTextures/FabstaffStreak")); + TrailDrawer.Draw(projectile.oldPos, projectile.Size * 0.5f - Main.screenPosition, 40); + return false; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (!FadingOut && projectile.penetrate < 2) + { + FadingOut = true; + projectile.velocity *= 0.1f; + projectile.extraUpdates = 0; + projectile.netUpdate = true; + } + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + if (!FadingOut) + { + FadingOut = true; + projectile.velocity *= 0.1f; + projectile.extraUpdates = 0; + projectile.netUpdate = true; + } + return false; + } + + public override bool CanDamage() + { + if (FadingOut) + return false; + return base.CanDamage(); + } + } } diff --git a/Projectiles/Magic/FabOrb.cs b/Projectiles/Magic/FabOrb.cs deleted file mode 100644 index a1c1c6c48b..0000000000 --- a/Projectiles/Magic/FabOrb.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Magic -{ - public class FabOrb : ModProjectile - { - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Orb"); - } - - public override void SetDefaults() - { - projectile.width = 14; - projectile.height = 14; - projectile.friendly = true; - projectile.alpha = 255; - projectile.penetrate = -1; - projectile.timeLeft = 30; - projectile.magic = true; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 10; - } - - public override void AI() - { - CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 150f, 6f, 6f, 2, ModContent.ProjectileType(), 1D, true); - } - } -} diff --git a/Projectiles/Magic/FabRay.cs b/Projectiles/Magic/FabRay.cs index 30ea6a4056..30d63ffa8a 100644 --- a/Projectiles/Magic/FabRay.cs +++ b/Projectiles/Magic/FabRay.cs @@ -1,15 +1,22 @@ using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; using Terraria; +using Terraria.Graphics.Shaders; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { public class FabRay : ModProjectile { + internal PrimitiveTrail TrailDrawer; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; public override void SetStaticDefaults() { DisplayName.SetDefault("Ray"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 72; + ProjectileID.Sets.TrailingMode[projectile.type] = 2; } public override void SetDefaults() @@ -18,9 +25,9 @@ namespace CalamityMod.Projectiles.Magic projectile.height = 4; projectile.friendly = true; projectile.magic = true; - projectile.penetrate = 20; - projectile.extraUpdates = 100; - projectile.timeLeft = 600; + projectile.penetrate = 70; + projectile.extraUpdates = 3; + projectile.timeLeft = 60 * projectile.extraUpdates; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 0; } @@ -29,24 +36,55 @@ namespace CalamityMod.Projectiles.Magic { Lighting.AddLight(projectile.Center, 0.2f, 0.01f, 0.1f); projectile.ai[0] += 1f; - if (projectile.ai[0] % 6f == 0f && projectile.owner == Main.myPlayer) - { - Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); - } + projectile.Opacity = Utils.InverseLerp(0f, 10f * projectile.MaxUpdates, projectile.timeLeft, true); - if (projectile.ai[0] > 16f && projectile.ai[0] % 2f == 0f) + if (projectile.owner == Main.myPlayer && projectile.ai[0] % 12f == 0f) { - Vector2 source = projectile.position; - int pink = Dust.NewDust(source, 1, 1, 234, 0f, 0f, 0, default, 1.25f); - Main.dust[pink].noGravity = true; - Main.dust[pink].noLight = true; - Main.dust[pink].position = source; - Main.dust[pink].scale = Main.rand.Next(70, 110) * 0.013f; - Main.dust[pink].velocity *= 0.1f; + NPC potentialTarget = projectile.Center.ClosestNPCAt(180f, false); + if (potentialTarget != null) + { + Vector2 shootVelocity = projectile.DirectionTo(potentialTarget.Center) * 13f; + Projectile.NewProjectile(projectile.Center - shootVelocity * 2.5f, shootVelocity, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner); + } + + for (int i = 0; i < projectile.oldPos.Length / 4; i += 3) + { + potentialTarget = projectile.oldPos[i].ClosestNPCAt(280f, false); + if (potentialTarget != null) + { + Vector2 shootVelocity = (potentialTarget.Center - projectile.oldPos[i]).SafeNormalize(Vector2.UnitY) * 13f; + Projectile.NewProjectile(projectile.oldPos[i] - shootVelocity * 2.5f, shootVelocity, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner); + break; + } + } } } - public override bool OnTileCollide(Vector2 oldVelocity) + internal Color ColorFunction(float completionRatio) + { + float fadeToEnd = MathHelper.Lerp(0.65f, 1f, (float)Math.Cos(-Main.GlobalTime * 3f) * 0.5f + 0.5f); + float fadeOpacity = Utils.InverseLerp(1f, 0.64f, completionRatio, true) * projectile.Opacity; + Color endColor = Color.Lerp(Color.Cyan, Color.HotPink, (float)Math.Sin(completionRatio * MathHelper.Pi * 1.6f - Main.GlobalTime * 4f) * 0.5f + 0.5f); + return Color.Lerp(Color.White, endColor, fadeToEnd) * fadeOpacity; + } + + internal float WidthFunction(float completionRatio) + { + float expansionCompletion = 1f - (float)Math.Pow(1f - Utils.InverseLerp(0f, 0.3f, completionRatio, true), 2D); + return MathHelper.Lerp(0f, 32f * projectile.Opacity, expansionCompletion); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + if (TrailDrawer is null) + TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, true, GameShaders.Misc["CalamityMod:FabstaffRay"]); + + GameShaders.Misc["CalamityMod:FabstaffRay"].SetShaderTexture(ModContent.GetTexture("CalamityMod/ExtraTextures/FabstaffStreak")); + TrailDrawer.Draw(projectile.oldPos, projectile.Size * 0.5f - Main.screenPosition, 50); + return false; + } + + public override bool OnTileCollide(Vector2 oldVelocity) { projectile.penetrate--; if (projectile.penetrate <= 0) From 2b236596899fa90abc5e58f7fe78c3d11f2d4eb3 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 9 Dec 2020 20:19:17 -0600 Subject: [PATCH 024/202] Small optimizations --- Projectiles/Magic/FabBolt.cs | 4 ++-- Projectiles/Magic/FabRay.cs | 2 +- Utilities/BezierCurve.cs | 9 +++------ Utilities/CalamityUtils.cs | 13 ++++++++----- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Projectiles/Magic/FabBolt.cs b/Projectiles/Magic/FabBolt.cs index 339cd823ce..cdddbd6508 100644 --- a/Projectiles/Magic/FabBolt.cs +++ b/Projectiles/Magic/FabBolt.cs @@ -68,10 +68,10 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { if (TrailDrawer is null) - TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, true, GameShaders.Misc["CalamityMod:FabstaffRay"]); + TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, false, GameShaders.Misc["CalamityMod:FabstaffRay"]); GameShaders.Misc["CalamityMod:FabstaffRay"].SetShaderTexture(ModContent.GetTexture("CalamityMod/ExtraTextures/FabstaffStreak")); - TrailDrawer.Draw(projectile.oldPos, projectile.Size * 0.5f - Main.screenPosition, 40); + TrailDrawer.Draw(projectile.oldPos, projectile.Size * 0.5f - Main.screenPosition, 8); return false; } diff --git a/Projectiles/Magic/FabRay.cs b/Projectiles/Magic/FabRay.cs index 30d63ffa8a..75f9d2bbdb 100644 --- a/Projectiles/Magic/FabRay.cs +++ b/Projectiles/Magic/FabRay.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Projectiles.Magic public override void SetStaticDefaults() { DisplayName.SetDefault("Ray"); - ProjectileID.Sets.TrailCacheLength[projectile.type] = 72; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 54; ProjectileID.Sets.TrailingMode[projectile.type] = 2; } diff --git a/Utilities/BezierCurve.cs b/Utilities/BezierCurve.cs index 0076f82598..306d493611 100644 --- a/Utilities/BezierCurve.cs +++ b/Utilities/BezierCurve.cs @@ -38,19 +38,16 @@ namespace CalamityMod private Vector2 PrivateEvaluate(Vector2[] points, float T) { - if (points.Length > 2) + while (points.Length > 2) { Vector2[] nextPoints = new Vector2[points.Length - 1]; for (int k = 0; k < points.Length - 1; k++) { nextPoints[k] = Vector2.Lerp(points[k], points[k + 1], T); } - return PrivateEvaluate(nextPoints, T); - } - else - { - return Vector2.Lerp(points[0], points[1], T); + points = nextPoints; } + return Vector2.Lerp(points[0], points[1], T); } } } diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index b8a59c8557..5fb3891af4 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -374,13 +374,16 @@ namespace CalamityMod { float extraDistance = (Main.npc[index].width / 2) + (Main.npc[index].height / 2); - if (Vector2.Distance(origin, Main.npc[index].Center) < (distance + extraDistance) && (Collision.CanHitLine(origin, 1, 1, Main.npc[index].Center, 1, 1) || ignoreTiles)) + if (!Main.npc[index].WithinRange(origin, distance + extraDistance) || + !(Collision.CanHitLine(origin, 1, 1, Main.npc[index].Center, 1, 1) || ignoreTiles)) { - if (Main.npc[index].boss || Main.npc[index].type == NPCID.WallofFleshEye) - bossFound = true; - distance = Vector2.Distance(origin, Main.npc[index].Center); - closestTarget = Main.npc[index]; + continue; } + + if (Main.npc[index].boss || Main.npc[index].type == NPCID.WallofFleshEye) + bossFound = true; + distance = Vector2.Distance(origin, Main.npc[index].Center); + closestTarget = Main.npc[index]; } } } From 11aee1b13cf254733086c4b13c001d30038e1741 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 9 Dec 2020 21:08:07 -0600 Subject: [PATCH 025/202] Fixed Photoviscerator homing --- Projectiles/Ranged/ExoLightBurst.cs | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/Projectiles/Ranged/ExoLightBurst.cs b/Projectiles/Ranged/ExoLightBurst.cs index 5b3a782775..a05e3afd2b 100644 --- a/Projectiles/Ranged/ExoLightBurst.cs +++ b/Projectiles/Ranged/ExoLightBurst.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Projectiles.Ranged public override void SetDefaults() { - projectile.width = projectile.height = 190; + projectile.width = projectile.height = 50; projectile.friendly = true; projectile.ignoreWater = true; projectile.tileCollide = false; @@ -68,17 +68,15 @@ namespace CalamityMod.Projectiles.Ranged projectile.ModifyHitNPCSticky(4, false); } - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - int width = (int)MathHelper.Min(targetHitbox.Width, 150); - int height = (int)MathHelper.Min(targetHitbox.Height, 150); - CalamityGlobalProjectile.ExpandHitboxBy(projectile, width, height); - return null; - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.ExoDebuffs(2f); + if (projectile.width == 50) + { + int width = (int)MathHelper.Min(target.Hitbox.Width, 60); + int height = (int)MathHelper.Min(target.Hitbox.Height, 60); + CalamityGlobalProjectile.ExpandHitboxBy(projectile, width, height); + } + target.ExoDebuffs(2f); } public override void OnHitPvp(Player target, int damage, bool crit) From 0f01d33fc93cec0cd4bf366bb6631f845bdd834a Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 9 Dec 2020 21:37:14 -0600 Subject: [PATCH 026/202] Made Cirrus use the Fabstaff ray --- NPCs/TownNPCs/FAP.cs | 5 ++- Projectiles/Magic/FabRay.cs | 3 +- Projectiles/Typeless/CirrusBolt.cs | 41 ----------------- Projectiles/Typeless/CirrusOrb.cs | 32 -------------- Projectiles/Typeless/CirrusRay.cs | 71 ------------------------------ 5 files changed, 5 insertions(+), 147 deletions(-) delete mode 100644 Projectiles/Typeless/CirrusBolt.cs delete mode 100644 Projectiles/Typeless/CirrusOrb.cs delete mode 100644 Projectiles/Typeless/CirrusRay.cs diff --git a/NPCs/TownNPCs/FAP.cs b/NPCs/TownNPCs/FAP.cs index 88f432dc9d..8524642d96 100644 --- a/NPCs/TownNPCs/FAP.cs +++ b/NPCs/TownNPCs/FAP.cs @@ -1,6 +1,7 @@ using CalamityMod.Events; using CalamityMod.Items.Placeables.Furniture; using CalamityMod.Items.Potions.Alcohol; +using CalamityMod.Projectiles.Magic; using CalamityMod.Projectiles.Typeless; using CalamityMod.World; using System.Collections.Generic; @@ -375,13 +376,13 @@ namespace CalamityMod.NPCs.TownNPCs public override void TownNPCAttackProj(ref int projType, ref int attackDelay) { - projType = ModContent.ProjectileType(); + projType = ModContent.ProjectileType(); attackDelay = 1; } public override void TownNPCAttackProjSpeed(ref float multiplier, ref float gravityCorrection, ref float randomOffset) { - multiplier = 2f; + multiplier = 11.5f; } } } diff --git a/Projectiles/Magic/FabRay.cs b/Projectiles/Magic/FabRay.cs index 75f9d2bbdb..d11fe87789 100644 --- a/Projectiles/Magic/FabRay.cs +++ b/Projectiles/Magic/FabRay.cs @@ -38,7 +38,8 @@ namespace CalamityMod.Projectiles.Magic projectile.ai[0] += 1f; projectile.Opacity = Utils.InverseLerp(0f, 10f * projectile.MaxUpdates, projectile.timeLeft, true); - if (projectile.owner == Main.myPlayer && projectile.ai[0] % 12f == 0f) + int shootRate = projectile.npcProj ? 40 : 12; + if (projectile.owner == Main.myPlayer && projectile.ai[0] % shootRate == 0f) { NPC potentialTarget = projectile.Center.ClosestNPCAt(180f, false); if (potentialTarget != null) diff --git a/Projectiles/Typeless/CirrusBolt.cs b/Projectiles/Typeless/CirrusBolt.cs deleted file mode 100644 index a5480db6c2..0000000000 --- a/Projectiles/Typeless/CirrusBolt.cs +++ /dev/null @@ -1,41 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Typeless -{ - public class CirrusBolt : ModProjectile - { - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bolt"); - } - - public override void SetDefaults() - { - projectile.width = 4; - projectile.height = 4; - projectile.extraUpdates = 100; - projectile.friendly = true; - projectile.timeLeft = 45; - projectile.magic = true; - projectile.npcProj = true; - } - - public override void AI() - { - if (projectile.timeLeft % 2f == 0f) - { - Vector2 vector33 = projectile.position; - vector33 -= projectile.velocity * 0.25f; - int num448 = Dust.NewDust(vector33, 1, 1, 234, 0f, 0f, 0, default, 1.25f); - Main.dust[num448].position = vector33; - Main.dust[num448].noGravity = true; - Main.dust[num448].noLight = true; - Main.dust[num448].scale = Main.rand.Next(70, 110) * 0.013f; - Main.dust[num448].velocity *= 0.1f; - } - } - } -} diff --git a/Projectiles/Typeless/CirrusOrb.cs b/Projectiles/Typeless/CirrusOrb.cs deleted file mode 100644 index 13bcddbfdc..0000000000 --- a/Projectiles/Typeless/CirrusOrb.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Typeless -{ - public class CirrusOrb : ModProjectile - { - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Orb"); - } - - public override void SetDefaults() - { - projectile.width = 14; - projectile.height = 14; - projectile.friendly = true; - projectile.alpha = 255; - projectile.penetrate = -1; - projectile.timeLeft = 30; - projectile.magic = true; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 10; - projectile.npcProj = true; - } - - public override void AI() - { - CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 150f, 6f, 6f, 2, ModContent.ProjectileType()); - } - } -} diff --git a/Projectiles/Typeless/CirrusRay.cs b/Projectiles/Typeless/CirrusRay.cs deleted file mode 100644 index 094e1ccb59..0000000000 --- a/Projectiles/Typeless/CirrusRay.cs +++ /dev/null @@ -1,71 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Typeless -{ - public class CirrusRay : ModProjectile - { - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ray"); - } - - public override void SetDefaults() - { - projectile.width = 4; - projectile.height = 4; - projectile.friendly = true; - projectile.magic = true; - projectile.penetrate = 5; - projectile.extraUpdates = 100; - projectile.timeLeft = 300; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 0; - projectile.npcProj = true; - } - - public override void AI() - { - Lighting.AddLight(projectile.Center, 0.2f, 0.01f, 0.1f); - projectile.ai[0] += 1f; - if (projectile.ai[0] % 6f == 0f && projectile.owner == Main.myPlayer) - { - Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); - } - - if (projectile.ai[0] > 16f && projectile.ai[0] % 2f == 0f) - { - Vector2 source = projectile.position; - int pink = Dust.NewDust(source, 1, 1, 234, 0f, 0f, 0, default, 1.25f); - Main.dust[pink].noGravity = true; - Main.dust[pink].noLight = true; - Main.dust[pink].position = source; - Main.dust[pink].scale = Main.rand.Next(70, 110) * 0.013f; - Main.dust[pink].velocity *= 0.1f; - } - } - - public override bool OnTileCollide(Vector2 oldVelocity) - { - projectile.penetrate--; - if (projectile.penetrate <= 0) - { - projectile.Kill(); - } - else - { - if (projectile.velocity.X != oldVelocity.X) - { - projectile.velocity.X = -oldVelocity.X; - } - if (projectile.velocity.Y != oldVelocity.Y) - { - projectile.velocity.Y = -oldVelocity.Y; - } - } - return false; - } - } -} From f0064d7881d7b531873c3282e30752eebd04d27d Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Thu, 10 Dec 2020 15:42:00 -0600 Subject: [PATCH 027/202] Fixed phaseslayer trails clumping together sometimes --- .../DraedonsArsenal/PhaseslayerProjectile.cs | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs b/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs index 0a720569e4..68c8728504 100644 --- a/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs +++ b/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal { DisplayName.SetDefault("Phaseslayer"); ProjectileID.Sets.TrailingMode[projectile.type] = 2; - ProjectileID.Sets.TrailCacheLength[projectile.type] = 14; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 13; } public override void SetDefaults() @@ -276,12 +276,16 @@ namespace CalamityMod.Projectiles.DraedonsArsenal internal PrimitiveTrail TrailDrawer; internal Color ColorFunction(float completionRatio) { + float averageRotation = projectile.oldRot.Take(20).Average(angle => MathHelper.WrapAngle(angle) + MathHelper.Pi); + float deltaAngle = Math.Abs(averageRotation - (MathHelper.WrapAngle(projectile.rotation) + MathHelper.Pi)); float opacity = projectile.Opacity; opacity *= Utils.InverseLerp(StandardSwingSpeed * 0.7f, StandardSwingSpeed, AngularDamageFactor, true); + opacity *= (float)Math.Pow(Utils.InverseLerp(1f, 0.45f, completionRatio, true), 4D); + opacity *= (float)Math.Pow(Utils.InverseLerp(0.9f, 1.1f, deltaAngle, true), 2D); float rotationAdjusted = MathHelper.WrapAngle(projectile.rotation) + MathHelper.Pi; float oldRotationAdjusted = MathHelper.WrapAngle(projectile.oldRot[1]) + MathHelper.Pi; - float deltaAngle = Math.Abs(rotationAdjusted - oldRotationAdjusted); + deltaAngle = Math.Abs(rotationAdjusted - oldRotationAdjusted); if (deltaAngle < 0.04f) opacity = 0f; @@ -310,12 +314,23 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Player player = Main.player[projectile.owner]; List positions = new List(); + + float swingAngularDirection = Math.Sign(projectile.rotation - projectile.oldRot[1]); + projectile.oldRot[0] += swingAngularDirection * 0.1f; for (int i = 0; i < projectile.oldPos.Length; i++) { if (projectile.oldPos[i] == Vector2.Zero) continue; - positions.Add(projectile.position + projectile.oldRot[i].ToRotationVector2() * (IsSmall ? 90f : 132f) * projectile.scale); + + // Skip over any very points going in the wrong direction, to prevent "nets" from the primitive. + if (i > 1 && Math.Sign(projectile.oldRot[i - 1] - projectile.oldRot[i]) != swingAngularDirection) + continue; + + Vector2 position = projectile.position + projectile.oldRot[i].ToRotationVector2() * (IsSmall ? 90f : 132f) * projectile.scale; + + positions.Add(position); } + projectile.oldRot[0] -= swingAngularDirection * 0.1f; TrailDrawer.Draw(positions, projectile.Size * 0.5f - Main.screenPosition, 50); spriteBatch.Draw(bladeTexture, projectile.Center + bladeOffset - Main.screenPosition, frame, Color.White, projectile.rotation + MathHelper.PiOver2, origin, projectile.scale, SpriteEffects.None, 0f); From aff86e52e1beb099d4bb4afc31942c25ef6f7392 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Thu, 10 Dec 2020 17:40:59 -0600 Subject: [PATCH 028/202] Texture getting fix --- Projectiles/Magic/ApotheosisWorm.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projectiles/Magic/ApotheosisWorm.cs b/Projectiles/Magic/ApotheosisWorm.cs index b547a55ea5..6d9f798e74 100644 --- a/Projectiles/Magic/ApotheosisWorm.cs +++ b/Projectiles/Magic/ApotheosisWorm.cs @@ -307,7 +307,7 @@ namespace CalamityMod.Projectiles.Magic float currentFade = Utils.InverseLerp(0f, 8f, Time, true) * Utils.InverseLerp(60f, 52f, Time, true); currentFade *= (1f + 0.2f * (float)Math.Cos(Main.GlobalTime % 30f * MathHelper.Pi * 3f)) * 0.8f; - Texture2D texture = ModContent.GetTexture("CalamityMod/Projectiles/Boss/DoGTeleportRift"); + Texture2D texture = ModContent.GetTexture("CalamityMod/Projectiles/StarProj"); Vector2 drawPos = PortalPosition - Main.screenPosition; baseColor = new Color(150, 100, 255, 255) * projectile.Opacity; baseColor *= 0.5f; From 1496cee351c046173e9840741fd5c862c961f312 Mon Sep 17 00:00:00 2001 From: ben-tk <45545085+termigator1359@users.noreply.github.com> Date: Sat, 12 Dec 2020 12:47:28 -0500 Subject: [PATCH 029/202] Added Bullet-Filled Shotgun --- Items/Weapons/Ranged/BulletFilledShotgun.cs | 76 +++++++++++++++++++ Items/Weapons/Ranged/BulletFilledShotgun.png | Bin 0 -> 921 bytes Projectiles/Ranged/BouncingShotgunPellet.cs | 68 +++++++++++++++++ Projectiles/Ranged/RealmRavagerBullet.cs | 25 +++--- 4 files changed, 155 insertions(+), 14 deletions(-) create mode 100644 Items/Weapons/Ranged/BulletFilledShotgun.cs create mode 100644 Items/Weapons/Ranged/BulletFilledShotgun.png create mode 100644 Projectiles/Ranged/BouncingShotgunPellet.cs diff --git a/Items/Weapons/Ranged/BulletFilledShotgun.cs b/Items/Weapons/Ranged/BulletFilledShotgun.cs new file mode 100644 index 0000000000..b0c35d0d08 --- /dev/null +++ b/Items/Weapons/Ranged/BulletFilledShotgun.cs @@ -0,0 +1,76 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Ranged; +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Ranged +{ + public class BulletFilledShotgun : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bullet-Filled Shotgun"); + Tooltip.SetDefault("Fires a massive spread of bouncing bullets\n" + + "Consumes five ammo per fire\n" + + "Aim? What's that?"); + } + public override void SetDefaults() + { + item.damage = 1; + item.knockBack = 0f; + item.useTime = item.useAnimation = 45; + item.ranged = true; + item.noMelee = true; + item.autoReuse = true; + item.useAmmo = AmmoID.Bullet; + item.shootSpeed = 9f; + item.shoot = ModContent.ProjectileType(); + + item.width = 64; + item.height = 24; + item.useStyle = ItemUseStyleID.HoldingOut; + item.UseSound = SoundID.Item38; + item.value = CalamityGlobalItem.Rarity3BuyPrice; + item.rare = 3; + item.Calamity().customRarity = CalamityRarity.Dedicated; + } + + public override Vector2? HoldoutOffset() => new Vector2(-7, 0); + + public override bool CanUseItem(Player player) => CalamityGlobalItem.HasEnoughAmmo(player, item, 5); + + // Disable vanilla ammo consumption + public override bool ConsumeAmmo(Player player) => false; + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + type = item.shoot; + int bulletAmt = Main.rand.Next(25,35); + for (int i = 0; i < bulletAmt; i++) + { + float newSpeedX = speedX + Main.rand.NextFloat(-15f, 15f); + float newSpeedY = speedY + Main.rand.NextFloat(-15f, 15f); + Projectile.NewProjectile(position.X, position.Y, newSpeedX, newSpeedY, type, damage, knockBack, player.whoAmI); + } + + // Consume 5 ammo per shot + CalamityGlobalItem.ConsumeAdditionalAmmo(player, item, 5); + return false; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.MusketBall, 100); + recipe.AddIngredient(ItemID.IronBar, 7); + recipe.anyIronBar = true; + recipe.AddIngredient(ModContent.ItemType(), 3); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Weapons/Ranged/BulletFilledShotgun.png b/Items/Weapons/Ranged/BulletFilledShotgun.png new file mode 100644 index 0000000000000000000000000000000000000000..2635f2a49c01c15cebf0a2207a3226d2a964f587 GIT binary patch literal 921 zcmV;K17`e*P)Px#AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy24YJ`L;(K){{a7>y{D4^00QSpL_t(o!|j*NOH^SL#(!^)pXp4_ z=;SmxeJD&CC1Fg_riDpHgtV+hJE8u8=x>N<(JByHv1nsT3SiH63-G@n@V5eWcAnSl-p74f<%Qw4 z#!BtJ=&{t6@(c{Twl?N7Z8Lw*jc(Ilvv<7$)K(piHyyPd)lUH8b+rHtj*M9V7dy@Y zkcii7ekWR*H2c-FCjfL@y|$(N??=ZR*Uk7ZUJe3q`NCOk{r-bT04x=Xeh&ap!l+k7 ztL;5J{jH$w@jI8!0B~>M4FJj3Rshl?BLIBL&S`PFQ!&jRo+tq8Jwj}O#4{Nc2;-8^ z4e}hRnvkymuoYl!$MJf5GXRNbL|YdHNTsDG2&6YiHx|ZI#W(;%Wf=f&W$pWJu8srH zv)|6wJN41=c^(E5j_X|$?*Qm;Jn6XZD?k(=jC#e>;Saz%)8-`Swr;}g4FWemH>O1? zZt>loZ`Ugz@Ofr-?bKGl=AhBf93KZ=?X zP92H@>%G8Kh#T`8V;lCS^F~W^Tmcl8mK?7Sr^oSvP%!A}zWD{a*ZB&NidB}|dqB+pdmm9-D1u&7 "CalamityMod/Projectiles/Ranged/RealmRavagerBullet"; + private int bounce = 2; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Shotgun Pellet"); + } + + public override void SetDefaults() + { + projectile.width = 4; + projectile.height = 4; + projectile.light = 0.5f; + projectile.alpha = 255; + projectile.ranged = true; + projectile.friendly = true; + projectile.aiStyle = 1; + aiType = ProjectileID.BulletHighVelocity; + projectile.timeLeft = 180; + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + bounce--; + if (bounce <= 0) + projectile.Kill(); + else + { + if (projectile.velocity.X != oldVelocity.X) + projectile.velocity.X = -oldVelocity.X; + if (projectile.velocity.Y != oldVelocity.Y) + projectile.velocity.Y = -oldVelocity.Y; + Main.PlaySound(SoundID.Item10, projectile.Center); + projectile.damage /= 2; + } + return false; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) => Main.PlaySound(SoundID.Item10, projectile.Center); + + public override void OnHitPvp(Player target, int damage, bool crit) => Main.PlaySound(SoundID.Item10, projectile.Center); + + public override void Kill(int timeLeft) + { + CalamityGlobalProjectile.ExpandHitboxBy(projectile, 32); + for (int d = 0; d < 2; d++) + { + Dust.NewDust(projectile.position, projectile.width, projectile.height, DustID.Smoke, 0f, 0f, 100, default, 1.5f); + } + for (int d = 0; d < 20; d++) + { + int idx = Dust.NewDust(projectile.position, projectile.width, projectile.height, DustID.Fire, 0f, 0f, 0, default, 2.5f); + Main.dust[idx].noGravity = true; + Main.dust[idx].velocity *= 3f; + idx = Dust.NewDust(projectile.position, projectile.width, projectile.height, DustID.Fire, 0f, 0f, 100, default, 1.5f); + Main.dust[idx].velocity *= 2f; + Main.dust[idx].noGravity = true; + } + } + } +} diff --git a/Projectiles/Ranged/RealmRavagerBullet.cs b/Projectiles/Ranged/RealmRavagerBullet.cs index ba81aca67d..ef5d306904 100644 --- a/Projectiles/Ranged/RealmRavagerBullet.cs +++ b/Projectiles/Ranged/RealmRavagerBullet.cs @@ -28,23 +28,20 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - Main.PlaySound(SoundID.Item14, projectile.position); - projectile.position = projectile.Center; - projectile.width = projectile.height = 32; - 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++) + Main.PlaySound(SoundID.Item14, projectile.Center); + CalamityGlobalProjectile.ExpandHitboxBy(projectile, 32); + for (int d = 0; d < 2; d++) { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default, 1.5f); + Dust.NewDust(projectile.position, projectile.width, projectile.height, DustID.Smoke, 0f, 0f, 100, default, 1.5f); } - for (int num194 = 0; num194 < 20; num194++) + for (int d = 0; d < 20; d++) { - int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 0, default, 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, 6, 0f, 0f, 100, default, 1.5f); - Main.dust[num195].velocity *= 2f; - Main.dust[num195].noGravity = true; + int idx = Dust.NewDust(projectile.position, projectile.width, projectile.height, DustID.Fire, 0f, 0f, 0, default, 2.5f); + Main.dust[idx].noGravity = true; + Main.dust[idx].velocity *= 3f; + idx = Dust.NewDust(projectile.position, projectile.width, projectile.height, DustID.Fire, 0f, 0f, 100, default, 1.5f); + Main.dust[idx].velocity *= 2f; + Main.dust[idx].noGravity = true; } projectile.maxPenetrate = -1; projectile.penetrate = -1; From 5b50482b626cff2356b9e82513b458cedcc9b3a1 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 12 Dec 2020 18:56:29 -0600 Subject: [PATCH 030/202] Funny 2hu spear stealth strike --- CalPlayer/CalamityPlayer.cs | 2 +- Effects/CalamityShaders.cs | 3 + Effects/ScarletDevilStreak.fx | 70 +++++++++ Effects/ScarletDevilStreak.xnb | Bin 0 -> 2904 bytes ExtraTextures/ScarletDevilStreak.png | Bin 0 -> 20891 bytes Items/Weapons/Rogue/ScarletDevil.cs | 3 +- Projectiles/Rogue/ScarletDevilBullet.cs | 7 + Projectiles/Rogue/ScarletDevilProjectile.cs | 162 +++++++++++++++----- 8 files changed, 208 insertions(+), 39 deletions(-) create mode 100644 Effects/ScarletDevilStreak.fx create mode 100644 Effects/ScarletDevilStreak.xnb create mode 100644 ExtraTextures/ScarletDevilStreak.png diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 434ae71031..a2148875d5 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -6039,7 +6039,7 @@ namespace CalamityMod.CalPlayer Projectile.NewProjectile(target.Center, velocity, ModContent.ProjectileType(), CalamityUtils.DamageSoftCap(damage * 0.15, 30), 0f, player.whoAmI); } } - if (electricianGlove && proj.Calamity().stealthStrike && proj.Calamity().rogue && proj.Calamity().stealthStrikeHitCount < 5) + if (electricianGlove && proj.Calamity().stealthStrike && proj.Calamity().rogue && proj.Calamity().stealthStrikeHitCount < 5 && CalamityUtils.CountProjectiles(ModContent.ProjectileType()) < 30) { for (int s = 0; s < 3; s++) { diff --git a/Effects/CalamityShaders.cs b/Effects/CalamityShaders.cs index e2afeb9183..d5a0768e7a 100644 --- a/Effects/CalamityShaders.cs +++ b/Effects/CalamityShaders.cs @@ -14,6 +14,7 @@ namespace CalamityMod.Effects public static Effect LightDistortionShader; public static Effect PhaseslayerRipShader; public static Effect FabstaffRayShader; + public static Effect ScarletDevilShader; public static void LoadShaders() { @@ -25,6 +26,7 @@ namespace CalamityMod.Effects LightDistortionShader = CalamityMod.Instance.GetEffect("Effects/DistortionShader"); PhaseslayerRipShader = CalamityMod.Instance.GetEffect("Effects/PhaseslayerRipShader"); FabstaffRayShader = CalamityMod.Instance.GetEffect("Effects/FabstaffStreak"); + ScarletDevilShader = CalamityMod.Instance.GetEffect("Effects/ScarletDevilStreak"); Filters.Scene["CalamityMod:Astral"] = new Filter(new AstralScreenShaderData(new Ref(AstralFogShader), "AstralPass").UseColor(0.18f, 0.08f, 0.24f), EffectPriority.VeryHigh); @@ -35,6 +37,7 @@ namespace CalamityMod.Effects GameShaders.Misc["CalamityMod:LightDistortion"] = new MiscShaderData(new Ref(LightDistortionShader), "DistortionPass"); GameShaders.Misc["CalamityMod:PhaseslayerRipEffect"] = new MiscShaderData(new Ref(PhaseslayerRipShader), "TrailPass"); GameShaders.Misc["CalamityMod:FabstaffRay"] = new MiscShaderData(new Ref(FabstaffRayShader), "TrailPass"); + GameShaders.Misc["CalamityMod:OverpoweredTouhouSpearShader"] = new MiscShaderData(new Ref(ScarletDevilShader), "TrailPass"); } } } diff --git a/Effects/ScarletDevilStreak.fx b/Effects/ScarletDevilStreak.fx new file mode 100644 index 0000000000..b79f4db97e --- /dev/null +++ b/Effects/ScarletDevilStreak.fx @@ -0,0 +1,70 @@ +sampler uImage0 : register(s0); +sampler uImage1 : register(s1); +float3 uColor; +float3 uSecondaryColor; +float uOpacity; +float uSaturation; +float uRotation; +float uTime; +float4 uSourceRect; +float2 uWorldPosition; +float uDirection; +float3 uLightSource; +float2 uImageSize0; +float2 uImageSize1; +matrix uWorldViewProjection; + +struct VertexShaderInput +{ + float4 Position : POSITION0; + float4 Color : COLOR0; + float2 TextureCoordinates : TEXCOORD0; +}; + +struct VertexShaderOutput +{ + float4 Position : SV_POSITION; + float4 Color : COLOR0; + float2 TextureCoordinates : TEXCOORD0; +}; + +VertexShaderOutput VertexShaderFunction(in VertexShaderInput input) +{ + VertexShaderOutput output = (VertexShaderOutput)0; + float4 pos = mul(input.Position, uWorldViewProjection); + output.Position = pos; + + output.Color = input.Color; + output.TextureCoordinates = input.TextureCoordinates; + + return output; +} + +// The X coordinate is the trail completion, the Y coordinate is the same as any other. +// This is simply how the primitive TextCoord is layed out in the C# code. +// Inputted images go into uImage1 sampler, in case you have a noise map or something similar. +float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0 +{ + float4 color = input.Color; + float2 coords = input.TextureCoordinates; + + float areaFadeGlow = lerp(1.2, 17, coords.x); + if (coords.x < 0.25) + areaFadeGlow = lerp(areaFadeGlow, 1.2, 1 - coords.x / 0.25); + float2 mapColor = tex2D(uImage1, float2(frac(coords.x - uTime * 2.5), coords.y)); + float opacity = pow(sin(coords.y * 3.141), areaFadeGlow) + 0.6 * lerp(1.1, 0.3, coords.x) * mapColor.r; + + if (coords.x > 0.66) + opacity = lerp(opacity, 0, (coords.x - 0.66) / 0.3); + + return color * opacity; +} + +technique Technique1 +{ + pass TrailPass + { + VertexShader = compile vs_2_0 VertexShaderFunction(); + PixelShader = compile ps_2_0 PixelShaderFunction(); + } +} diff --git a/Effects/ScarletDevilStreak.xnb b/Effects/ScarletDevilStreak.xnb new file mode 100644 index 0000000000000000000000000000000000000000..b68ab8631de8df8971801e32d5f4b19e0ef00ca8 GIT binary patch literal 2904 zcmb_eO>7%g5T3Q2;F45EMMxk;!bl(m6j@0~kSh|B#%XATp(eJAC6KDEv#FOl-mu;! z3F=|F1*wPdb08HGuHaDFmmmSXRBa?qNQvmNQhVT#V-J-OS1;e}+qZc{4MK(IjCa0y z-^`mgZ}vHrcV&wQfWnaqVtcGJWoXqK^C8O#r z82X}N52cS{ziI0$HM80rN}n_ArfD@M$1=nG8A|8ey5ri$WW#VBTdxnL3+{!wS$)e` zFIkt2#$iJky(b5`B5De}3l5FX{jxw}Q9YBd&hdtEq( z>C=71m)B?EaSY;~UD2ziv(8xZ`y~N3mEX_&qK*pd4$2#e&r|gY887>1T2{ z*hl)IiOHQcZLGoDkJg!0_%d(l&(GuRmp3ogoMMn9+a&L@;(Iv9U|&Ih70pl3W722) zU;BujWBLF)hlA_L@?Xa@2q0>B&NNmFw)LT`jHns+D0^s;8`ZZ#vH~N=`;8mhQ#qEXw*wtwql68 zZvw$MH2Pv}Ak8C;Rc7e7EHDAw~+r z_le%cE2L4XwYPiu)YYx6DI)LI)vf2I*dBu&cp5VG-5>rN2o>1lu-{AlI(;uSzq7ZS zzrDA6C9o%8|K-oYDah?|xePxMzXx{h_?@5hzMpS&+ONF+*~Z36j^7J=r`_gP?-s9t z=hXA!2tB;vn+JM)JJdI|WQzBRPELYD+Zwf7*cbk^0Auc2jLM-c7ILVi!FB>XP560? ziOL@OCiL~eEyM16A|CseakaLwp5J;p$Sbg^^Bxju#S!bJAhwwAq5W1bB#k^{SPyF< z7I`9Xktgsq5i`Kx5T?bNGr|5+@Y(mY|drA(zTcrL0NEGYh zZW)i><8OHqHlC7q%h%B5dyMsicNjT5`gf(%>BP|r34A!l|1my(%)2V=PfzwOe!p<0 zqK8p0)HSt<|F6(4+78zY(h@ipU@gLl0LLPn3~(Gcs57PTvl7;v;=hBp$yNRfNc*0X literal 0 HcmV?d00001 diff --git a/ExtraTextures/ScarletDevilStreak.png b/ExtraTextures/ScarletDevilStreak.png new file mode 100644 index 0000000000000000000000000000000000000000..389379b370b79ecea17f61eed5c1a54d4498d89e GIT binary patch literal 20891 zcmbqaWm6n&*WAV3gS)%CTY%sJg1fuBOO}P;Hy+$AxVyVM8$7tX+spGC-VakVSJl+i z%vE)I`gHe+R8^KmMIuB3005}pTgnm}>+2gB7#JEF8W|ZG8ylOL zn3$THnwgoIo10r$SXf$GT3K0HTU*=M*x1_I+S%FJ+uJ)hI5;{wIypHxJ3G6$xVXBy zy1BWzySsaMczAkxdU<(ydwcu%`1tzz`uX|!`}+q31Ox^K1_cEL2M33QgoK8MhJ}Uw z{P`0E0)>Z%gTdg4h=|C@$X~yHMMXtLM@PrR#KgwN#>K_O$HylmB>eZ^e~F2SNl8h` z$;l}xDXFQcX=!Qc>FK|J|IWzB$jr>l%F4>l&d$ln$<58p%gf8p&o3w_C@d^2Dk>^2 zE-oo4DJ?B6D=RB6FR!Sm`19vaWo2bmRaJF$bx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_Wf!IuTzzflQo|Iub*WE5C;}VVitCD&5ix-H4N`zT1&k z+FuNwxq0VN07^YY|G1@H0@?vyv3!)(u$-{mcS zdw9m8aS&w-EGeSP^wkR-lq4|?J>|BMax&}V<41Txt5^nQUbj9y$*&7sbPDImVF|K1 zQz4Bt#e?vw!ld)nlFm!ftJlyMwrRg=9rCRn%-n6O=JV>Zg@A6pM@V6R{t2of0KR1J zT>8I=fvI)xM<=?!;%THsMR^=u#70w39(clGss$Q=u@HDl-z3-ID{0N`(tDXZC%nDOCl>>sk zF#)n3;&CpIKTr5H>-NBN<+?<-(rU2>${cG$At5I^orLu(Qn?KU6i4%#dnV@bk)7IS z+T8v;E0IWjj8~>r<9@PkKz(mPRy)3k(vWrEfe?JbHc&lBBO@u}XMLm?IXi=MKI$}* zi@HVJk~ieGlK3sB-bF_3vmSO!zr5O&uo76>f?z`xI%Np9Z!NlAl*7`$JqY? DLOuSY literal 0 HcmV?d00001 diff --git a/Items/Weapons/Rogue/ScarletDevil.cs b/Items/Weapons/Rogue/ScarletDevil.cs index 0cfb18d8a9..46f15f979a 100644 --- a/Items/Weapons/Rogue/ScarletDevil.cs +++ b/Items/Weapons/Rogue/ScarletDevil.cs @@ -26,9 +26,8 @@ namespace CalamityMod.Items.Weapons.Rogue item.crit += 20; item.noMelee = true; item.noUseGraphic = true; - item.useAnimation = 60; + item.useAnimation = item.useTime = 81; item.useStyle = ItemUseStyleID.SwingThrow; - item.useTime = 60; item.knockBack = 8f; item.UseSound = SoundID.Item60; item.autoReuse = true; diff --git a/Projectiles/Rogue/ScarletDevilBullet.cs b/Projectiles/Rogue/ScarletDevilBullet.cs index c896663b37..45588e7fac 100644 --- a/Projectiles/Rogue/ScarletDevilBullet.cs +++ b/Projectiles/Rogue/ScarletDevilBullet.cs @@ -70,5 +70,12 @@ namespace CalamityMod.Projectiles.Rogue { return new Color(250, 250, 250); } + + public override bool CanDamage() + { + if (projectile.Calamity().stealthStrike && projectile.ai[0] < 60f) + return false; + return base.CanDamage(); + } } } diff --git a/Projectiles/Rogue/ScarletDevilProjectile.cs b/Projectiles/Rogue/ScarletDevilProjectile.cs index f00ed1b758..f790ef8a28 100644 --- a/Projectiles/Rogue/ScarletDevilProjectile.cs +++ b/Projectiles/Rogue/ScarletDevilProjectile.cs @@ -3,6 +3,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; @@ -10,19 +11,22 @@ namespace CalamityMod.Projectiles.Rogue { public class ScarletDevilProjectile : ModProjectile { + internal PrimitiveTrail TrailDrawer; + public ref float ShootTimer => ref projectile.ai[0]; public override string Texture => "CalamityMod/Items/Weapons/Rogue/ScarletDevil"; public override void SetStaticDefaults() { DisplayName.SetDefault("Spear the Gungnir"); - ProjectileID.Sets.TrailCacheLength[projectile.type] = 8; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 45; ProjectileID.Sets.TrailingMode[projectile.type] = 0; } public override void SetDefaults() { - projectile.width = 116; - projectile.height = 116; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 45; + projectile.width = 92; + projectile.height = 92; projectile.friendly = true; projectile.penetrate = 1; projectile.tileCollide = false; @@ -35,27 +39,73 @@ namespace CalamityMod.Projectiles.Rogue { CalamityPlayer modPlayer = Main.player[projectile.owner].Calamity(); Lighting.AddLight(projectile.Center, 0.55f, 0.25f, 0f); - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 0.785f; - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 130, projectile.velocity.X * 0.25f, projectile.velocity.Y * 0.25f, 0, new Color(255, 255, 255), 0.85f); - projectile.ai[0] += 1f; - if (projectile.ai[0] == 1f && modPlayer.StealthStrikeAvailable()) + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver4; + + if (!Main.dedServ) { - projectile.Calamity().stealthStrike = true; + for (int i = 0; i < (projectile.Calamity().stealthStrike && Main.rand.NextBool(2) ? 2 : 1); i++) + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 130, projectile.velocity.X * 0.25f, projectile.velocity.Y * 0.25f, 0, new Color(255, 255, 255), 0.85f); } - if ((projectile.ai[0] %= 5f) == 0f) + + ShootTimer++; + if (ShootTimer == 1f && modPlayer.StealthStrikeAvailable()) + projectile.Calamity().stealthStrike = true; + + if (!projectile.Calamity().stealthStrike && projectile.oldPos.Length != 6) + projectile.oldPos = new Vector2[6]; + + if ((ShootTimer %= 5f) == 0f && !projectile.Calamity().stealthStrike) { - int numProj = 2; - float rotation = MathHelper.ToRadians(15); if (projectile.owner == Main.myPlayer) + GenerateSideBullets(2, MathHelper.ToRadians(15f)); + } + } + + internal void GenerateSideBullets(int totalBullets, float rotationalOffset) + { + for (int i = 0; i < totalBullets; i++) + { + Vector2 perturbedSpeed = new Vector2(-projectile.velocity.X / 3, -projectile.velocity.Y / 3).RotatedBy(MathHelper.Lerp(-rotationalOffset, rotationalOffset, i / (totalBullets - 1))); + for (int j = 0; j < 2; j++) { - for (int i = 0; i < numProj; i++) + Projectile.NewProjectile(projectile.Center, perturbedSpeed, ModContent.ProjectileType(), (int)(projectile.damage * 0.03), 0f, projectile.owner, 0f, 0f); + perturbedSpeed *= 1.05f; + } + } + } + + internal void SpawnOnStealthStrikeBullets() + { + float starSpeed = 25f; + + // Spawn a circle of fast bullets. + for (int i = 0; i < 40; i++) + { + Vector2 shootVelocity = (MathHelper.TwoPi * i / 40f).ToRotationVector2() * starSpeed; + int bullet = Projectile.NewProjectile(projectile.Center + shootVelocity, shootVelocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.02), 0f, projectile.owner); + if (Main.projectile.IndexInRange(bullet)) + Main.projectile[bullet].Calamity().stealthStrike = true; + } + + // Spawn a pair of stars, one slow, one fast. + int pointsOnStar = 6; + for (int k = 0; k < 2; k++) + { + for (int i = 0; i < pointsOnStar; i++) + { + float angle = MathHelper.Pi * 1.5f - i * MathHelper.TwoPi / pointsOnStar; + float nextAngle = MathHelper.Pi * 1.5f - (i + 3) % pointsOnStar * MathHelper.TwoPi / pointsOnStar; + if (k == 1) + nextAngle = MathHelper.Pi * 1.5f - (i + 2) * MathHelper.TwoPi / pointsOnStar; + Vector2 start = angle.ToRotationVector2(); + Vector2 end = nextAngle.ToRotationVector2(); + int pointsOnStarSegment = 18; + for (int j = 0; j < pointsOnStarSegment; j++) { - Vector2 perturbedSpeed = new Vector2(-projectile.velocity.X / 3, -projectile.velocity.Y / 3).RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numProj - 1))); - for (int j = 0; j < 2; j++) - { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, perturbedSpeed.X, perturbedSpeed.Y, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.03), 0f, projectile.owner, 0f, 0f); - perturbedSpeed *= 1.05f; - } + Vector2 shootVelocity = Vector2.Lerp(start, end, j / (float)pointsOnStarSegment) * starSpeed; + int bullet = Projectile.NewProjectile(projectile.Center + shootVelocity, shootVelocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.02), 0f, projectile.owner); + if (Main.projectile.IndexInRange(bullet)) + Main.projectile[bullet].Calamity().stealthStrike = true; } } } @@ -73,38 +123,78 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - projectile.position = projectile.Center; - projectile.width = projectile.height = 150; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.0075), 0f, projectile.owner, 0f, 0f); - if (target.type == NPCID.TargetDummy || !projectile.Calamity().stealthStrike || Main.player[projectile.owner].moonLeech) - { + CalamityGlobalProjectile.ExpandHitboxBy(projectile, 150); + Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(projectile.damage * 0.0075), 0f, projectile.owner); + if (target.type == NPCID.TargetDummy || !projectile.Calamity().stealthStrike) return; + + if (!Main.player[projectile.owner].moonLeech) + { + // Give on-heal effects from stealth strikes. + Main.player[projectile.owner].statLife += 120; + Main.player[projectile.owner].HealEffect(120); } - Main.player[projectile.owner].statLife += 120; - Main.player[projectile.owner].HealEffect(120); + + // And spawn a bloom of bullets. + SpawnOnStealthStrikeBullets(); } public override void OnHitPvp(Player target, int damage, bool crit) { - projectile.position = projectile.Center; - projectile.width = projectile.height = 150; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.0075), 0f, projectile.owner, 0f, 0f); + CalamityGlobalProjectile.ExpandHitboxBy(projectile, 150); + Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(projectile.damage * 0.0075), 0f, projectile.owner); if (!projectile.Calamity().stealthStrike) - { return; - } + + // Give on-heal effects from stealth strikes. Main.player[projectile.owner].statLife += 120; Main.player[projectile.owner].HealEffect(120); + + // And spawn a bloom of bullets. + SpawnOnStealthStrikeBullets(); + } + + internal float WidthFunction(float completionRatio) + { + float widthRatio = Utils.InverseLerp(0f, 0.1f, completionRatio, true); + float baseWidth = MathHelper.Lerp(0f, 110f, widthRatio) * MathHelper.Clamp(1f - (float)Math.Pow(completionRatio, 0.4D), 0.37f, 1f); + return baseWidth; + } + + internal Color ColorFunction(float completionRatio) + { + float colorFade = 1f - Utils.InverseLerp(0.6f, 0.98f, completionRatio, true); + Color baseColor = CalamityUtils.MulticolorLerp((float)Math.Pow(completionRatio, 1D / 2D), Color.White, Color.DarkRed, Color.Wheat, Color.IndianRed) * MathHelper.Lerp(0f, 1.4f, colorFade); + return Color.Lerp(baseColor, Color.DarkRed, (float)Math.Pow(completionRatio, 3D)); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, new Color(100, 100, 100), ProjectileID.Sets.TrailingMode[projectile.type], 1); - return true; + if (!projectile.Calamity().stealthStrike) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, new Color(100, 100, 100), ProjectileID.Sets.TrailingMode[projectile.type], 1); + return true; + } + else + { + if (TrailDrawer is null) + TrailDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, false, GameShaders.Misc["CalamityMod:OverpoweredTouhouSpearShader"]); + + GameShaders.Misc["CalamityMod:OverpoweredTouhouSpearShader"].SetShaderTexture(ModContent.GetTexture("CalamityMod/ExtraTextures/ScarletDevilStreak")); + TrailDrawer.Draw(projectile.oldPos, projectile.Size * 0.5f - Main.screenPosition + projectile.velocity.SafeNormalize(Vector2.Zero) * 86f, 60); + + Texture2D spearTexture = ModContent.GetTexture(Texture); + + for (int i = 0; i < 7; i++) + { + Color drawColor = Color.Lerp(lightColor, Color.White, 0.8f) * 0.2f; + drawColor.A = 0; + + Vector2 drawOffset = (i / 7f * MathHelper.TwoPi).ToRotationVector2() * 2f; + spriteBatch.Draw(spearTexture, projectile.Center - Main.screenPosition + drawOffset, null, drawColor, projectile.rotation, spearTexture.Size() * 0.5f, projectile.scale, SpriteEffects.None, 0f); + } + } + return false; } } } From 9155554016b11862c16fc817de56a8174a718bbe Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 12 Dec 2020 19:14:39 -0600 Subject: [PATCH 031/202] Made Scarlet Devil SS damage less absurd --- Projectiles/Rogue/ScarletDevilBullet.cs | 1 - Projectiles/Rogue/ScarletDevilProjectile.cs | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Projectiles/Rogue/ScarletDevilBullet.cs b/Projectiles/Rogue/ScarletDevilBullet.cs index 45588e7fac..7caa3809aa 100644 --- a/Projectiles/Rogue/ScarletDevilBullet.cs +++ b/Projectiles/Rogue/ScarletDevilBullet.cs @@ -18,7 +18,6 @@ namespace CalamityMod.Projectiles.Rogue projectile.timeLeft = 140; projectile.tileCollide = false; projectile.ignoreWater = true; - projectile.Calamity().rogue = true; } public override void AI() diff --git a/Projectiles/Rogue/ScarletDevilProjectile.cs b/Projectiles/Rogue/ScarletDevilProjectile.cs index f790ef8a28..5a0690e6b2 100644 --- a/Projectiles/Rogue/ScarletDevilProjectile.cs +++ b/Projectiles/Rogue/ScarletDevilProjectile.cs @@ -82,7 +82,7 @@ namespace CalamityMod.Projectiles.Rogue for (int i = 0; i < 40; i++) { Vector2 shootVelocity = (MathHelper.TwoPi * i / 40f).ToRotationVector2() * starSpeed; - int bullet = Projectile.NewProjectile(projectile.Center + shootVelocity, shootVelocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.02), 0f, projectile.owner); + int bullet = Projectile.NewProjectile(projectile.Center + shootVelocity, shootVelocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.01), 0f, projectile.owner); if (Main.projectile.IndexInRange(bullet)) Main.projectile[bullet].Calamity().stealthStrike = true; } @@ -103,7 +103,7 @@ namespace CalamityMod.Projectiles.Rogue for (int j = 0; j < pointsOnStarSegment; j++) { Vector2 shootVelocity = Vector2.Lerp(start, end, j / (float)pointsOnStarSegment) * starSpeed; - int bullet = Projectile.NewProjectile(projectile.Center + shootVelocity, shootVelocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.02), 0f, projectile.owner); + int bullet = Projectile.NewProjectile(projectile.Center + shootVelocity, shootVelocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.01), 0f, projectile.owner); if (Main.projectile.IndexInRange(bullet)) Main.projectile[bullet].Calamity().stealthStrike = true; } From fc2c262761ba9b6abd5444c42f6ed4de8ced663f Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 12 Dec 2020 22:31:45 -0600 Subject: [PATCH 032/202] Fixed up some old stealth strike code --- Items/Weapons/Rogue/DukesDecapitator.cs | 9 +++++++++ Items/Weapons/Rogue/LuminousStriker.cs | 9 +++++++++ Items/Weapons/Rogue/ScarletDevil.cs | 9 +++++++++ Projectiles/Rogue/DukesDecapitatorProj.cs | 7 +------ Projectiles/Rogue/LuminousStrikerProj.cs | 4 +--- Projectiles/Rogue/ScarletDevilProjectile.cs | 2 -- 6 files changed, 29 insertions(+), 11 deletions(-) diff --git a/Items/Weapons/Rogue/DukesDecapitator.cs b/Items/Weapons/Rogue/DukesDecapitator.cs index ce7038a314..0bf3ab4b3a 100644 --- a/Items/Weapons/Rogue/DukesDecapitator.cs +++ b/Items/Weapons/Rogue/DukesDecapitator.cs @@ -2,6 +2,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Projectiles.Rogue; +using Microsoft.Xna.Framework; namespace CalamityMod.Items.Weapons.Rogue { @@ -34,5 +35,13 @@ namespace CalamityMod.Items.Weapons.Rogue item.shootSpeed = 15f; item.Calamity().rogue = true; } + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + if (Main.projectile.IndexInRange(proj)) + Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); + return false; + } } } diff --git a/Items/Weapons/Rogue/LuminousStriker.cs b/Items/Weapons/Rogue/LuminousStriker.cs index cbebf08305..1460c01742 100644 --- a/Items/Weapons/Rogue/LuminousStriker.cs +++ b/Items/Weapons/Rogue/LuminousStriker.cs @@ -3,6 +3,7 @@ using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Rogue; +using Microsoft.Xna.Framework; namespace CalamityMod.Items.Weapons.Rogue { @@ -37,6 +38,14 @@ namespace CalamityMod.Items.Weapons.Rogue item.Calamity().rogue = true; } + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + if (Main.projectile.IndexInRange(proj)) + Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); + return false; + } + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/Rogue/ScarletDevil.cs b/Items/Weapons/Rogue/ScarletDevil.cs index 46f15f979a..38fe53234e 100644 --- a/Items/Weapons/Rogue/ScarletDevil.cs +++ b/Items/Weapons/Rogue/ScarletDevil.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Rogue; using CalamityMod.Tiles.Furniture.CraftingStations; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -39,6 +40,14 @@ namespace CalamityMod.Items.Weapons.Rogue item.Calamity().customRarity = CalamityRarity.ItemSpecific; } + 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 proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + if (Main.projectile.IndexInRange(proj)) + Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); + return false; + } + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Projectiles/Rogue/DukesDecapitatorProj.cs b/Projectiles/Rogue/DukesDecapitatorProj.cs index 8f4b23c6eb..46a5341d1b 100644 --- a/Projectiles/Rogue/DukesDecapitatorProj.cs +++ b/Projectiles/Rogue/DukesDecapitatorProj.cs @@ -43,18 +43,13 @@ namespace CalamityMod.Projectiles.Rogue projectile.velocity.Y *= 0.99f; } projectile.ai[0] += 1f; - if(projectile.ai[0] == 1f && modPlayer.StealthStrikeAvailable()) - { - stealthBubbles = true; - projectile.Calamity().stealthStrike = true; - } if (projectile.ai[0] == 5f) projectile.tileCollide = true; if ((projectile.ai[0] % 15f) == 0f && rotationAmount > 0) { rotationAmount -= 0.05f; - if(stealthBubbles == true && projectile.owner == Main.myPlayer) + if (modPlayer.StealthStrikeAvailable() && projectile.owner == Main.myPlayer) { float velocityX = Main.rand.NextFloat(-0.8f, 0.8f); float velocityY = Main.rand.NextFloat(-0.8f, -0.8f); diff --git a/Projectiles/Rogue/LuminousStrikerProj.cs b/Projectiles/Rogue/LuminousStrikerProj.cs index 10edfafd10..d749c0f1a8 100644 --- a/Projectiles/Rogue/LuminousStrikerProj.cs +++ b/Projectiles/Rogue/LuminousStrikerProj.cs @@ -31,10 +31,8 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { - CalamityPlayer modPlayer = Main.player[projectile.owner].Calamity(); - if (projectile.ai[0] == 0f && modPlayer.StealthStrikeAvailable()) + if (projectile.ai[0] == 0f && projectile.Calamity().stealthStrike) { - projectile.Calamity().stealthStrike = true; projectile.timeLeft = 600; projectile.ai[0] = 1f; } diff --git a/Projectiles/Rogue/ScarletDevilProjectile.cs b/Projectiles/Rogue/ScarletDevilProjectile.cs index 5a0690e6b2..ab2a37e736 100644 --- a/Projectiles/Rogue/ScarletDevilProjectile.cs +++ b/Projectiles/Rogue/ScarletDevilProjectile.cs @@ -48,8 +48,6 @@ namespace CalamityMod.Projectiles.Rogue } ShootTimer++; - if (ShootTimer == 1f && modPlayer.StealthStrikeAvailable()) - projectile.Calamity().stealthStrike = true; if (!projectile.Calamity().stealthStrike && projectile.oldPos.Length != 6) projectile.oldPos = new Vector2[6]; From c1be3e2c1ec4512f5cb36e8e762b1ff36fd905e7 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 12 Dec 2020 22:35:36 -0600 Subject: [PATCH 033/202] Oops --- Projectiles/Rogue/DukesDecapitatorProj.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projectiles/Rogue/DukesDecapitatorProj.cs b/Projectiles/Rogue/DukesDecapitatorProj.cs index 46a5341d1b..eeddcb016e 100644 --- a/Projectiles/Rogue/DukesDecapitatorProj.cs +++ b/Projectiles/Rogue/DukesDecapitatorProj.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Rogue if ((projectile.ai[0] % 15f) == 0f && rotationAmount > 0) { rotationAmount -= 0.05f; - if (modPlayer.StealthStrikeAvailable() && projectile.owner == Main.myPlayer) + if (projectile.Calamity().stealthStrike && projectile.owner == Main.myPlayer) { float velocityX = Main.rand.NextFloat(-0.8f, 0.8f); float velocityY = Main.rand.NextFloat(-0.8f, -0.8f); From cc1a6dc7b47666cea8d1951f1ff15f73ea7eccb4 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sun, 13 Dec 2020 16:04:49 -0600 Subject: [PATCH 034/202] Returned some lost variables --- CalPlayer/CalamityPlayer.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index c3e20b1b86..7402f0a3da 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -971,6 +971,11 @@ namespace CalamityMod.CalPlayer public bool plaguebringerPatronSummon = false; public bool howlTrio = false; public bool mountedScanner = false; + public bool daedalusGolem = false; + public bool deathstareEyeball = false; + public bool witherBlossom = false; + public bool flowersOfMortality = false; + public bool viridVanguard = false; #endregion #region Biome @@ -2023,6 +2028,11 @@ namespace CalamityMod.CalPlayer plaguebringerPatronSummon = false; howlTrio = false; mountedScanner = false; + daedalusGolem = false; + deathstareEyeball = false; + witherBlossom = false; + flowersOfMortality = false; + viridVanguard = false; abyssalDivingSuitPrevious = abyssalDivingSuit; abyssalDivingSuit = abyssalDivingSuitHide = abyssalDivingSuitForce = abyssalDivingSuitPower = false; From c842ea48e5ba02b938573f9972066a1778a278c4 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Thu, 17 Dec 2020 21:57:45 -0600 Subject: [PATCH 035/202] Bordernado and Sage Spirit --- Buffs/DamageOverTime/SagePoison.cs | 24 +++++ Buffs/DamageOverTime/SagePoison.png | Bin 0 -> 558 bytes Buffs/Summon/SageSpiritBuff.cs | 34 ++++++ Buffs/Summon/SageSpiritBuff.png | Bin 0 -> 514 bytes CalPlayer/CalamityPlayer.cs | 2 + Effects/BordernadoFire.fx | 77 +++++++++++++ Effects/BordernadoFire.xnb | Bin 0 -> 3132 bytes Effects/CalamityShaders.cs | 3 + Items/Weapons/Ranged/Arbalest.png | Bin 699 -> 393 bytes Items/Weapons/Summon/ViralSprout.cs | 59 ++++++++++ Items/Weapons/Summon/ViralSprout.png | Bin 0 -> 431 bytes NPCs/CalamityGlobalNPC.cs | 11 +- Projectiles/Boss/InfernadoRevenge.cs | 121 +++++++++------------ Projectiles/Boss/SkyFlareRevenge.cs | 1 + Projectiles/Summon/SageNeedle.cs | 75 +++++++++++++ Projectiles/Summon/SageNeedle.png | Bin 0 -> 311 bytes Projectiles/Summon/SageSpirit.cs | 156 +++++++++++++++++++++++++++ Projectiles/Summon/SageSpirit.png | Bin 0 -> 4212 bytes 18 files changed, 489 insertions(+), 74 deletions(-) create mode 100644 Buffs/DamageOverTime/SagePoison.cs create mode 100644 Buffs/DamageOverTime/SagePoison.png create mode 100644 Buffs/Summon/SageSpiritBuff.cs create mode 100644 Buffs/Summon/SageSpiritBuff.png create mode 100644 Effects/BordernadoFire.fx create mode 100644 Effects/BordernadoFire.xnb create mode 100644 Items/Weapons/Summon/ViralSprout.cs create mode 100644 Items/Weapons/Summon/ViralSprout.png create mode 100644 Projectiles/Summon/SageNeedle.cs create mode 100644 Projectiles/Summon/SageNeedle.png create mode 100644 Projectiles/Summon/SageSpirit.cs create mode 100644 Projectiles/Summon/SageSpirit.png diff --git a/Buffs/DamageOverTime/SagePoison.cs b/Buffs/DamageOverTime/SagePoison.cs new file mode 100644 index 0000000000..b1763d9e41 --- /dev/null +++ b/Buffs/DamageOverTime/SagePoison.cs @@ -0,0 +1,24 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.DamageOverTime +{ + public class SagePoison : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Sage Poison"); + Description.SetDefault("Poisoned"); + Main.debuff[Type] = true; + Main.pvpBuff[Type] = true; + Main.buffNoSave[Type] = true; + } + public override void Update(NPC npc, ref int buffIndex) + { + if (npc.Calamity().sagePoisonTime < npc.buffTime[buffIndex]) + npc.Calamity().sagePoisonTime = npc.buffTime[buffIndex]; + npc.DelBuff(buffIndex); + buffIndex--; + } + } +} diff --git a/Buffs/DamageOverTime/SagePoison.png b/Buffs/DamageOverTime/SagePoison.png new file mode 100644 index 0000000000000000000000000000000000000000..369f52e1efb3bc01475f5e9be8de812669e4fcb4 GIT binary patch literal 558 zcmV+}0@3}6P)Px$=t)FDR9J=8mrY9>Q51%s#6~9piHcusK~aPj6m;WGMJR5w=(dA8xgRlaz88St z;LklBRB9p>1BiFB(`JeR_W&=yyanLX^ioR=Y~}V^s_*_$1)#7~030CjLVlPt-~6y| z*@S0R6<-ek_`8@?iJf}hvX{0g^gv%?tZ6~d;LAqGeVj)rbc%tH#T5E$s z512C*-R7^g*vqSDusmYbfe1Ai1r+*XmkD7uHWy+Gs+0eQ#b z_Pft&jZd%ENBmW}-qzi=a)&^2I|V>>&2+mWl3rC`hb@WBpsL%57=SwjMCOVo-jH=6 z{C`&`VY+{MMV)vK{nr4zDIy{-+!OSbFy~vIl&q@Ss7L~)O!o_c)5IkJ z-^wbV85{-R`>%TafTJF0xEF|IC45RzXG8faMCEKri=DX_gapR3()] > 0) + modPlayer.sageSpirit = true; + + if (modPlayer.sageSpirit) + player.buffTime[buffIndex] = 18000; + else + { + player.DelBuff(buffIndex); + buffIndex--; + } + } + } +} diff --git a/Buffs/Summon/SageSpiritBuff.png b/Buffs/Summon/SageSpiritBuff.png new file mode 100644 index 0000000000000000000000000000000000000000..6f96cea427749c27a3c647eb4cfe956282f72fc2 GIT binary patch literal 514 zcmV+d0{#7oP)Px$yh%hsR9J=Wmpe;CK@f$%Luic0Cz1HEe97+0Pt=N0SZ3na&XaqS<2r4%h`OP@rC3Oy;Ze zd+!X<_^A!pqkzDP`E7qgRe^`&bwDZiPOwh_6JN!Ay5kCfXjb>PUjY-sP;fH!Sk_M% z$F937#``@An7NgTX3lR7b!+1*b7ueqH*SDeipACA#})YBz?*LPw5HegzLc_^Dw=r~ z1acPS7Rap#on`!6}#5`%=v@tZ&kpl!j*Ea?4Hpy01Hb=Wp4%mxH!_| z*{{I4KMz1OC8u5G&{RTf!FbO(0J9N40O2uZhqmuDKl>GsIv|jHU+U|b;#02^kwY&4 z;jv52hMeYSp91a`m2(^b07*qoM6N<$ Ef{1_RNB{r; literal 0 HcmV?d00001 diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 0eb7dc7ab8..cb0455f754 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -976,6 +976,7 @@ namespace CalamityMod.CalPlayer public bool witherBlossom = false; public bool flowersOfMortality = false; public bool viridVanguard = false; + public bool sageSpirit = false; #endregion #region Biome @@ -2033,6 +2034,7 @@ namespace CalamityMod.CalPlayer witherBlossom = false; flowersOfMortality = false; viridVanguard = false; + sageSpirit = false; abyssalDivingSuitPrevious = abyssalDivingSuit; abyssalDivingSuit = abyssalDivingSuitHide = abyssalDivingSuitForce = abyssalDivingSuitPower = false; diff --git a/Effects/BordernadoFire.fx b/Effects/BordernadoFire.fx new file mode 100644 index 0000000000..0c7352ea09 --- /dev/null +++ b/Effects/BordernadoFire.fx @@ -0,0 +1,77 @@ +sampler uImage0 : register(s0); +sampler uImage1 : register(s1); +float3 uColor; +float3 uSecondaryColor; +float uOpacity; +float uSaturation; +float uRotation; +float uTime; +float4 uSourceRect; +float2 uWorldPosition; +float uDirection; +float3 uLightSource; +float2 uImageSize0; +float2 uImageSize1; +matrix uWorldViewProjection; + +struct VertexShaderInput +{ + float4 Position : POSITION0; + float4 Color : COLOR0; + float2 TextureCoordinates : TEXCOORD0; +}; + +struct VertexShaderOutput +{ + float4 Position : SV_POSITION; + float4 Color : COLOR0; + float2 TextureCoordinates : TEXCOORD0; +}; + +VertexShaderOutput VertexShaderFunction(in VertexShaderInput input) +{ + VertexShaderOutput output = (VertexShaderOutput)0; + float4 pos = mul(input.Position, uWorldViewProjection); + output.Position = pos; + + output.Color = input.Color; + output.TextureCoordinates = input.TextureCoordinates; + + return output; +} + +// The X coordinate is the trail completion, the Y coordinate is the same as any other. +// This is simply how the primitive TextCoord is layed out in the C# code. +float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0 +{ + float4 color = input.Color; + float2 coords = input.TextureCoordinates; + + // Read the fade map as a streak. + float4 fadeMapColor = tex2D(uImage1, float2(frac(coords.x + uTime / 4.16), coords.y)); + fadeMapColor.r *= pow(coords.x, 0.4); + float opacity = 1; + + // Fading out. + if (fadeMapColor.r < 0.31) + opacity = fadeMapColor.r / 0.31; + + // Redish burn fade if close but not close enough to fading out. + else if (fadeMapColor.r < 0.44) + color.rgb = lerp(color.rgb, float3(1, 0.1, 0.2), 0.7 - (fadeMapColor.r - 0.31) / 0.13 * 0.7); + + float bloomPower = lerp(2.1, 7.4, saturate(1 - coords.x + sin(uTime * 2.3 + coords.x * 6.283) * 0.2)); + opacity *= pow(sin(coords.y * 3.141), bloomPower); + + color.rgb = lerp(color.rgb, float3(1, 1, 1), 0.5); + return color * opacity; +} + +technique Technique1 +{ + pass TrailPass + { + VertexShader = compile vs_2_0 VertexShaderFunction(); + PixelShader = compile ps_2_0 PixelShaderFunction(); + } +} diff --git a/Effects/BordernadoFire.xnb b/Effects/BordernadoFire.xnb new file mode 100644 index 0000000000000000000000000000000000000000..e5275ae9e9953113a4164ce9a5ecadb37711f017 GIT binary patch literal 3132 zcmb_eOKclO7@qYb*^(4P5fVa?FbJf8A}deih@>%bn>NCv#&&`wkgBb-u9rIAu-+vJ z;$VqOkT@9V0T2%(I25}=LE?3&q8#8*DTN*@wFi)V%%Kt|E?&NW$FrG+MnZ+L$NPW( zeE(zqd93pbvuj~xs-H3CJ>^BCV3}33XvgvuEjDLqEBcygU5F*kimg}d*vVp1FW4Df zTh^_i=wa+rmbO|l3e}Y`tH0hLW$I_=Ox?@{fc_^B8&XtYA3;IUR zyr5U6Q3@_@i9d=Zr9Nr=Z&sN9ZIK>jiL^`B+56&`@E`M%jJ-)FFJTiIXvH&ffQ5K7`*x z{G73(<0_v4(9_#$s%PtT)dmom+dB$@XB5-n_j1l{MbP9uqcO z|JsJ{Iie4cako(&ssGpZFdXn2E*bh-+A?1gmEkp`J$Wz=voxce)~Z#= zRO_5xC{>Kt9esq`&^mk{6BtV-)N068wOXi-R9RNH-MCgb^7%h4lKf~xjoCJmSusCVa z_}w>xwdnUogx}Tb+0nDZ%)h^*gPEtJr&HNfG+UypJ(@IER*f=*$=K+#vB`hWQznA>_ zkzaORb|fv4mj{i>x{iB{B~$Y`RW>?AUfBB?-(P2nUJE1+(mL*=Y%ZTl@;Rp)B93?x zpXMvhmUt@ca4u~DYQ&{}8!dw7x{SSq;}&3%#&CvML{Z|vD4@3X)M_(t3#h%2Mf4V-u2l}`Fdcwmu zBUckQBlA1N?}c7Ddi{H??}r~-&1ar_XLECs^eXhNW|NNZHuvt*ka=$&&K1y&bPsM6XR~fYLML&KN z@dHft;!!LqAIz2AF(+OV9&^^qJA(M_nxeKFWYDeH_xs=jMq7ze9(U2v6#y1L1#fUx<7^d zDw1G<4(`th|E~I+2BD)NaesaYS=?1f)VrsU^WEQ_tyU|D)I<1?kN=~+agX(AstralFogShader), "AstralPass").UseColor(0.18f, 0.08f, 0.24f), EffectPriority.VeryHigh); @@ -38,6 +40,7 @@ namespace CalamityMod.Effects GameShaders.Misc["CalamityMod:PhaseslayerRipEffect"] = new MiscShaderData(new Ref(PhaseslayerRipShader), "TrailPass"); GameShaders.Misc["CalamityMod:FabstaffRay"] = new MiscShaderData(new Ref(FabstaffRayShader), "TrailPass"); GameShaders.Misc["CalamityMod:OverpoweredTouhouSpearShader"] = new MiscShaderData(new Ref(ScarletDevilShader), "TrailPass"); + GameShaders.Misc["CalamityMod:Bordernado"] = new MiscShaderData(new Ref(BordernadoFireShader), "TrailPass"); } } } diff --git a/Items/Weapons/Ranged/Arbalest.png b/Items/Weapons/Ranged/Arbalest.png index 3948608583f80e6ba907dafb4647075e176bd83c..3b07924aed0edab3ff869588cb868d477077593a 100644 GIT binary patch delta 377 zcmdnZ+Q~dYvYwfNfx&s|E^8pgSRCZ;#IWw1%u67LCEd~2k%3`jKlh(RRv=$Jz$e5N zNQVR$2=WUmDO+?d-WY3U(3_ig@Y+KYdB={zhV|PIS4Cui)XZ(w0aCmrL4LvikpP43 z3#B%o1ZROqWHAE+-(d!ZdcMPq$MaXD07Wl(x;Tbd`0t$*D0E1H$Ay>ma@4!}xXmY- zu3ntkx9B}P$L#PI1uNABJ^c$7|MOQ2%J$+GOpcuO>^fJA!?`&nZE1Z?Tc?YtKbK(N z;j=r;t5{@d%>AIQ4lTaD>onK0>CTPhl3{O8e(R7ClFSk)uk`PnCYMfB(SgZq&p4FV zbrmqrKa$_WqTiI6{ke|$^W?6I9UD0oy%h}IXU04;Xxr^=i;u@YPw%RI-BqZdrXw^} z@#s9Q<+a2NTtN`ti$X*Ty$~!ekp!+V zoJHgea#n#52v`ZxN{o_D2|>FQDO1Es5wR20R)zckEv!7E9$I+B;y^K4hB5Zr6#&3v=-_RV}dI~P-T{MY`z|MYx|^K+9o+J9;Bs2B?i@E{DlPgwa~ z{a7$zW_Fk=8Ly5LGvbfyL${o6%ouoXHLLXvS`Sb%#4|!?CiL7Od$%c3Sy#+2qZ0&u z|J37hiDU(?5EU!(x1QLeZ#*i@d%Gvwvw!DHvLY1a@>(A?iHR9I$c4J zkZ0({!zyyYnR{DXp_kZ&JhQR~0DqTeMo6apY5PWjD}R1`HD2IiAQ)vhE2VO~d=Y{v z4T2%-y9cxcld8WpL0EL^8X=w-1=$dxVi5rGg%TiBI4PXB3%}ICNA*#sLG+ z8xRlcToUhF$Zt{eXludzU|#_S$aw+Y7jpwou80rZ&R?MSNCu2>eY4D*^edGK*Tr+i zN5z4=Di2&T0Cv~=JtK66B6VbB((); + item.shootSpeed = 10f; + item.summon = true; + } + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + if (player.altFunctionUse != 2) + { + int sageSpirit = Projectile.NewProjectile(Main.MouseWorld, Vector2.Zero, type, damage, knockBack, player.whoAmI); + + if (Main.projectile.IndexInRange(sageSpirit)) + Main.projectile[sageSpirit].localAI[0] = player.ownedProjectileCounts[type]; + } + return false; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 12); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Weapons/Summon/ViralSprout.png b/Items/Weapons/Summon/ViralSprout.png new file mode 100644 index 0000000000000000000000000000000000000000..062b3bc149d8e129a2efbbcf12d73a4397cae83e GIT binary patch literal 431 zcmeAS@N?(olHy`uVBq!ia0vp^3P7yI!3-py+OJ#yq!^2X+?^QKos)S98wdD=xB_W$bprubISyA-69$Vm(R9fL8do#} zn6A^r(`k1;Z3n7fXnH~hNC}n%`33(+0}QHbXC?t9ISV`@iy0XB4ude`@%$AjK*1ND zE{-7<{(C21+;m8RhgJ20$cpXX{_nr`W=T)q_k{=9%iS6$%Puy(!>6oz&;H|=@0ugdulGDS9yE>BQAJg7(u@P_tAwU(TBmo#O8tUM3mb>YhiS%4ftqW14@SGP z?wi%V_Tz#h5xi4693&H4-s}_oF;TzNFJjs?w??(KKb5;VogY5^(ODFu@Jz6@`RaMY zMtjbVs{7l1?=An9K1a#v+|`7f>i@=7_2<{I?pLy0J@HbS!GTpGlDj(?G_S7O_5S9K z@~ctyZQp`EtX}-fAi}-U?Zd_Ii{h=)-5A=Q-I*7|ar`4o|5N=~gCCcU0R7D1>FVdQ I&MBb@0G>Uw_W%F@ literal 0 HcmV?d00001 diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 28a74f3354..d65e67cfb1 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -145,6 +145,8 @@ namespace CalamityMod.NPCs public int relicOfResilienceCooldown = 0; public int relicOfResilienceWeakness = 0; public int GaussFluxTimer = 0; + public int sagePoisonTime = 0; + public int sagePoisonDamage = 0; // whoAmI Variables public static int[] bobbitWormBottom = new int[5]; @@ -739,6 +741,8 @@ namespace CalamityMod.NPCs ApplyDPSDebuff(bBlood, 50, 10, ref npc.lifeRegen, ref damage); ApplyDPSDebuff(kamiFlu, 250, 25, ref npc.lifeRegen, ref damage); ApplyDPSDebuff(sulphurPoison, 180, 36, ref npc.lifeRegen, ref damage); + + ApplyDPSDebuff(sagePoisonTime, 90, npc.Calamity().sagePoisonDamage, ref npc.lifeRegen, ref damage); if (npc.velocity.X == 0) ApplyDPSDebuff(electrified, 10, 2, ref npc.lifeRegen, ref damage); else @@ -805,6 +809,7 @@ namespace CalamityMod.NPCs } } + sagePoisonDamage = 0; DebuffImmunities(npc); if (BossRushEvent.BossRushActive) @@ -3008,6 +3013,8 @@ namespace CalamityMod.NPCs clamDebuff--; if (sulphurPoison > 0) sulphurPoison--; + if (sagePoisonTime > 0) + sagePoisonTime--; if (kamiFlu > 0) kamiFlu--; if (relicOfResilienceCooldown > 0) @@ -4126,7 +4133,9 @@ namespace CalamityMod.NPCs buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/SnapClamDebuff")); if (sulphurPoison > 0) buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/SulphuricPoisoning")); - if (vaporfied > 0) + if (sagePoisonTime > 0) + buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/SagePoison")); + if (vaporfied > 0) buffTextureList.Add(GetTexture("CalamityMod/Buffs/DamageOverTime/Vaporfied")); // Stat debuffs diff --git a/Projectiles/Boss/InfernadoRevenge.cs b/Projectiles/Boss/InfernadoRevenge.cs index da0f3af2e6..1f7df09256 100644 --- a/Projectiles/Boss/InfernadoRevenge.cs +++ b/Projectiles/Boss/InfernadoRevenge.cs @@ -1,28 +1,28 @@ using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; using System.IO; using Terraria; using Terraria.DataStructures; +using Terraria.Graphics.Shaders; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Boss { public class InfernadoRevenge : ModProjectile { - public override string Texture => "CalamityMod/Projectiles/Boss/Flarenado"; - + internal PrimitiveTrail TornadoDrawer; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public const int TornadoHeight = 8800; public override void SetStaticDefaults() { DisplayName.SetDefault("Infernado"); - Main.projFrames[projectile.type] = 12; } public override void SetDefaults() { projectile.width = 320; - projectile.height = 88; + projectile.height = 1020; projectile.hostile = true; projectile.tileCollide = false; projectile.ignoreWater = true; @@ -49,80 +49,55 @@ namespace CalamityMod.Projectiles.Boss projectile.active = false; projectile.netUpdate = true; return; - } - float scaleBase = 70f; - float scaleMult = 3.5f; - float baseWidth = 320f; - float baseHeight = 88f; - - projectile.frameCounter++; - if (projectile.frameCounter > 2) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame >= Main.projFrames[projectile.type]) - { - projectile.frame = 0; - } - if (projectile.localAI[0] == 0f) - { - projectile.localAI[0] = 1f; - projectile.scale = (scaleBase - projectile.ai[1]) * scaleMult / scaleBase; - CalamityGlobalProjectile.ExpandHitboxBy(projectile, (int)(baseWidth * projectile.scale), (int)(baseHeight * projectile.scale)); - projectile.netUpdate = true; - } - if (projectile.ai[1] != -1f) - { - projectile.scale = (scaleBase - projectile.ai[1]) * scaleMult / scaleBase; - projectile.width = (int)(baseWidth * projectile.scale); - projectile.height = (int)(baseHeight * projectile.scale); - } - - if (!Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) - { - projectile.alpha -= 30; - if (projectile.alpha < 60) - { - projectile.alpha = 60; - } - } - else - { - projectile.alpha += 30; - if (projectile.alpha > 150) - { - projectile.alpha = 150; - } - } - if (projectile.ai[0] > 0f) - { - projectile.ai[0] -= 1f; - } - - if (projectile.ai[0] == 1f && projectile.ai[1] > 0f && projectile.owner == Main.myPlayer) - { - projectile.netUpdate = true; - Vector2 center = projectile.Center; - center.Y -= baseHeight * projectile.scale / 2f; - float num618 = (scaleBase - projectile.ai[1] + 1f) * scaleMult / scaleBase; - center.Y -= baseHeight * num618 / 2f; - center.Y += 2f; - Projectile.NewProjectile(center, projectile.velocity, projectile.type, projectile.damage, projectile.knockBack, projectile.owner, 11f, projectile.ai[1] - 1f); } } - public override Color? GetAlpha(Color lightColor) - { - return new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, projectile.alpha); + internal Color ColorFunction(float completionRatio) + { + return Color.Lerp(Color.Orange, Color.Yellow, completionRatio); + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + float _ = 0f; + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), + targetHitbox.Size(), + projectile.Bottom, + projectile.Bottom - Vector2.UnitY * TornadoHeight, + 72, + ref _); } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - Texture2D texture2D13 = Main.projectileTexture[projectile.type]; - int num214 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; - int y6 = num214 * projectile.frame; - Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), projectile.scale, SpriteEffects.None, 0f); + if (TornadoDrawer is null) + TornadoDrawer = new PrimitiveTrail(_ => projectile.width * 0.5f + 16f, ColorFunction, true, GameShaders.Misc["CalamityMod:Bordernado"]); + + GameShaders.Misc["CalamityMod:Bordernado"].SetShaderTexture(ModContent.GetTexture("Terraria/Misc/Perlin")); + Vector2[] drawPoints = new Vector2[5]; + Vector2 upwardAscent = Vector2.UnitY * TornadoHeight; + Vector2 downwardOffset = Vector2.UnitY * projectile.height / (drawPoints.Length + 1); + + Vector2 bottom = projectile.Bottom + downwardOffset; + Vector2 top = bottom - upwardAscent; + for (int i = 0; i < drawPoints.Length - 1; i++) + drawPoints[i] = Vector2.Lerp(top, bottom, i / (float)(drawPoints.Length - 1)); + + drawPoints[drawPoints.Length - 1] = bottom; + TornadoDrawer.Draw(drawPoints, -Main.screenPosition, 85); + + Texture2D vortexTexture = ModContent.GetTexture("CalamityMod/Projectiles/Boss/OldDukeVortex"); + for (int i = 0; i < 110; i++) + { + float angle = MathHelper.TwoPi * i / 50f + Main.GlobalTime * MathHelper.TwoPi; + Color drawColor = Color.White * 0.04f; + drawColor.A = 0; + Vector2 drawPosition = bottom + angle.ToRotationVector2() * 4f - Main.screenPosition; + + drawPosition += (angle + Main.GlobalTime * i / 16f).ToRotationVector2() * 6f; + spriteBatch.Draw(vortexTexture, drawPosition, null, drawColor, angle + MathHelper.PiOver2, vortexTexture.Size() * 0.5f, 0.9f, SpriteEffects.None, 0f); + } + return false; } diff --git a/Projectiles/Boss/SkyFlareRevenge.cs b/Projectiles/Boss/SkyFlareRevenge.cs index 486d540e4f..c44a777e94 100644 --- a/Projectiles/Boss/SkyFlareRevenge.cs +++ b/Projectiles/Boss/SkyFlareRevenge.cs @@ -71,6 +71,7 @@ namespace CalamityMod.Projectiles.Boss { int dmg = 100; //damage is irrelevant since the player is instantly killed int nado = Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), dmg, 4f, Main.myPlayer, 16f, 50f); + Main.projectile[nado].Bottom = projectile.Center; Main.projectile[nado].netUpdate = true; } } diff --git a/Projectiles/Summon/SageNeedle.cs b/Projectiles/Summon/SageNeedle.cs new file mode 100644 index 0000000000..76f51d3629 --- /dev/null +++ b/Projectiles/Summon/SageNeedle.cs @@ -0,0 +1,75 @@ +using CalamityMod.Buffs.DamageOverTime; +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Summon +{ + public class SageNeedle : ModProjectile + { + public const int OnDeathHealValue = 1; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sage Needle"); + ProjectileID.Sets.MinionShot[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 16; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.minion = true; + projectile.minionSlots = 0f; + projectile.timeLeft = 150; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 6; + } + + public override void AI() + { + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.ToRadians(48f); + + // Don't collide with tiles unless the needle is falling. + projectile.tileCollide = projectile.velocity.Y > 0f; + if (projectile.velocity.Y < 12f) + projectile.velocity.Y += 0.16f; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + int totalSageSpirits = Main.player[projectile.owner].ownedProjectileCounts[ModContent.ProjectileType()]; + + // A slightly-smoothened curve that's a little less potent than a linear curve. + // Has the potential to eventually surpass a linear curve, but this is infeasible, only happening + // at around 344 allocated slots. + float averageDamageMultiplier = (float)(Math.Pow(totalSageSpirits, 0.73D) + Math.Pow(totalSageSpirits, 1.1D)) * 0.5f; + + // 1 slot provides 40 DoT. + // 2 slots provide 76 DoT. + // 3 slots provide 111 DoT. + // 4 slots provide 146 DoT. + // 5 slots provide 182 DoT. + int sagePoisonDamage = (int)(40 * averageDamageMultiplier); + sagePoisonDamage = CalamityUtils.DamageSoftCap(sagePoisonDamage, 270); + + target.AddBuff(ModContent.BuffType(), 300); + target.Calamity().sagePoisonDamage = sagePoisonDamage; + } + + public override void Kill(int timeLeft) + { + if (Main.dedServ) + return; + + for (int i = 0; i < 6; i++) + { + Dust redGrass = Dust.NewDustDirect(projectile.position + projectile.velocity, projectile.width, projectile.height, DustID.Grass, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f); + redGrass.velocity = Utils.NextVector2Unit(Main.rand) * Main.rand.NextFloat(1f, 3f); + redGrass.noGravity = true; + redGrass.color = Color.Lerp(Color.IndianRed, Color.MediumVioletRed, Main.rand.NextFloat()); + } + } + } +} diff --git a/Projectiles/Summon/SageNeedle.png b/Projectiles/Summon/SageNeedle.png new file mode 100644 index 0000000000000000000000000000000000000000..539aaa73849a8cb1ac641de016832d12da352cc3 GIT binary patch literal 311 zcmV-70m%M|P)Px#@kvBMR5*>r)IAP@KoExE7Z8+SAvSiJ*w~ubdL0kpb-a&PFwxG&pG1Q~U@g`m zk${K+{Th;CcX=`c7<`$YJxbQQpTbC6PQ|C Main.player[projectile.owner]; + internal ref float AttackTimer => ref projectile.ai[0]; + internal ref float PlayerFlyTime => ref projectile.ai[1]; + internal ref float SageSpiritIndex => ref projectile.localAI[0]; + internal ref float GeneralTime => ref projectile.localAI[1]; + internal Vector2 PlayerFlyStart; + internal Vector2 PlayerFlyOffsetAtEnds; + internal Vector2 PlayerFlyDestination; + + internal const int ShootRate = 40; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sage Spirit"); + Main.projFrames[projectile.type] = 4; + ProjectileID.Sets.MinionSacrificable[projectile.type] = true; + ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.width = 48; + projectile.height = 72; + projectile.netImportant = true; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.minionSlots = 1f; + projectile.timeLeft = 90000; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.minion = true; + } + + public override void AI() + { + GeneralTime++; + ProvidePlayerMinionBuffs(); + DetermineFrames(); + NPC potentialTarget = projectile.Center.MinionHoming(750f, Owner); + if (potentialTarget is null) + FlyNearOwner(); + else + { + ResetOwnerFlyValues(); + AttackTarget(potentialTarget); + } + } + + internal void ProvidePlayerMinionBuffs() + { + Owner.AddBuff(ModContent.BuffType(), 3600); + + // Verify player/minion state integrity. The minion cannot stay alive if the + // owner is dead or if the caller of the AI is invalid. + if (projectile.type != ModContent.ProjectileType()) + return; + + if (Owner.dead) + Owner.Calamity().sageSpirit = false; + if (Owner.Calamity().sageSpirit) + projectile.timeLeft = 2; + } + + internal void DetermineFrames() + { + projectile.frameCounter++; + if (projectile.frameCounter % 5 == 4) + projectile.frame = (projectile.frame + 1) % Main.projFrames[projectile.type]; + } + + internal void ResetOwnerFlyValues() + { + PlayerFlyTime = 0f; + PlayerFlyOffsetAtEnds = Vector2.Zero; + PlayerFlyStart = PlayerFlyDestination = -Vector2.One; + } + + internal void FlyNearOwner() + { + Vector2 destination = Owner.Center + Vector2.UnitX * Owner.width * 1.6f * Owner.direction; + + int totalSageSpirits = Owner.ownedProjectileCounts[projectile.type]; + destination += ((float)(SageSpiritIndex * MathHelper.TwoPi) / totalSageSpirits).ToRotationVector2() * 70f; + if (PlayerFlyTime >= 1f) + { + projectile.Center = PlayerFlyDestination; + ResetOwnerFlyValues(); + return; + } + + float distanceFromDestination = projectile.Distance(destination); + if (float.IsNaN(distanceFromDestination)) + distanceFromDestination = 0f; + + // Determine owner values if they are still in the air. + if (PlayerFlyTime <= 0f) + { + PlayerFlyStart = projectile.Center; + PlayerFlyOffsetAtEnds = Vector2.UnitY * distanceFromDestination; + PlayerFlyDestination = destination; + } + + projectile.position.Y += (float)System.Math.Cos(GeneralTime / 60f * MathHelper.TwoPi + projectile.identity * 1.1f) * 0.5f; + + if (distanceFromDestination < 160f && PlayerFlyTime <= 0f) + return; + + // A catmull-rom spline attempts to find a smooth arc of two points based on a 0-1 interpolant. + // Its results are always within the bounds of the second and third term. They are intended to be the "middle" of the spline. + // The other 2 points at the ends are intended to be used to determine how the resulting curve should arc. + // In this context, since the offset at the start is down, it'll actually go up because it's starting at the bottom + // and then going up, bending between the 2 middle points. + projectile.Center = Vector2.CatmullRom( + PlayerFlyStart + PlayerFlyOffsetAtEnds, + PlayerFlyStart, + PlayerFlyDestination, + PlayerFlyDestination + PlayerFlyOffsetAtEnds, + PlayerFlyTime); + + PlayerFlyTime = MathHelper.Clamp(PlayerFlyTime + 0.03f, 0f, 1f); + } + + internal void AttackTarget(NPC target) + { + AttackTimer++; + + int totalSageSpirits = Owner.ownedProjectileCounts[projectile.type]; + Vector2 destinationOffsetFactor = Vector2.Max(target.Size, new Vector2(160f)) * new Vector2(0.6f, 0.37f); + Vector2 destination = target.Center + (AttackTimer / 12f).ToRotationVector2() * destinationOffsetFactor; + destination += ((float)(SageSpiritIndex * MathHelper.TwoPi) / totalSageSpirits).ToRotationVector2() * 130f; + projectile.Center = Vector2.Lerp(projectile.Center, destination, 0.1f); + + // Frequently release a bunch of spikes. + if (projectile.owner == Main.myPlayer && AttackTimer % ShootRate == ShootRate - 1) + { + for (int i = 0; i < 3; i++) + { + Vector2 spikeVelocity = -Vector2.UnitY.RotatedBy(MathHelper.Lerp(-0.56f, 0.56f, i / 3f)) * 6f; + Projectile.NewProjectile(projectile.Top, spikeVelocity, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner); + } + } + } + + // The spirit itself should not do direct damage. + public override bool CanDamage() => false; + } +} diff --git a/Projectiles/Summon/SageSpirit.png b/Projectiles/Summon/SageSpirit.png new file mode 100644 index 0000000000000000000000000000000000000000..6bd3337fd9ab8848094c93124c5f72f858ac56bc GIT binary patch literal 4212 zcmX9?2{@E%8-6VfrwCcHuOV5AL5(cQGA29O*AUH&u_QW{5GN5*M8=-qz9vg#En6~{ z#y$!aW1XWgWdFbET-RLJJKucI_rA|^-_QMg6K7_EWIf4$5&*!8GSIbvRs#U&t}(-) zZz6qaInY8EV1c|2ss;s@0bo}^>1yBnJByNS>@CpC7c*Okic4NF2*UNJamt_*KA|zn z#@-!|xjuHEzl(~@yJpU1AjFH9C%Q*E(ks8DM{HX&>N~oSbYAHw$gCKG{ox*;Oi@4g z`WS|3vjd3<9trz=1M{_8zvHsLoo;u!>ltJjHuQ)*oBUn#i0pNLmX7fjuegms#)W|% z%{F4=@`^;`5U$==;$^Ob-<#B9_b0*)r4*FQWI|vfZ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literal 0 HcmV?d00001 From c9729732ad39a1e563b7d390b9e2193c6fdaceb0 Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 18 Dec 2020 15:08:34 -0600 Subject: [PATCH 036/202] Tiny amount of Sage Spirit cleanup --- Projectiles/Summon/SageSpirit.cs | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/Projectiles/Summon/SageSpirit.cs b/Projectiles/Summon/SageSpirit.cs index 76f1faa0bb..3d83dc002f 100644 --- a/Projectiles/Summon/SageSpirit.cs +++ b/Projectiles/Summon/SageSpirit.cs @@ -1,5 +1,7 @@ using CalamityMod.Buffs.Summon; using Microsoft.Xna.Framework; +using System; +using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -40,6 +42,24 @@ namespace CalamityMod.Projectiles.Summon projectile.minion = true; } + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(SageSpiritIndex); + writer.Write(GeneralTime); + writer.WritePackedVector2(PlayerFlyStart); + writer.WritePackedVector2(PlayerFlyOffsetAtEnds); + writer.WritePackedVector2(PlayerFlyDestination); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + SageSpiritIndex = reader.ReadSingle(); + GeneralTime = reader.ReadSingle(); + PlayerFlyStart = reader.ReadPackedVector2(); + PlayerFlyOffsetAtEnds = reader.ReadPackedVector2(); + PlayerFlyDestination = reader.ReadPackedVector2(); + } + public override void AI() { GeneralTime++; @@ -82,6 +102,7 @@ namespace CalamityMod.Projectiles.Summon PlayerFlyTime = 0f; PlayerFlyOffsetAtEnds = Vector2.Zero; PlayerFlyStart = PlayerFlyDestination = -Vector2.One; + projectile.netUpdate = true; } internal void FlyNearOwner() @@ -89,7 +110,7 @@ namespace CalamityMod.Projectiles.Summon Vector2 destination = Owner.Center + Vector2.UnitX * Owner.width * 1.6f * Owner.direction; int totalSageSpirits = Owner.ownedProjectileCounts[projectile.type]; - destination += ((float)(SageSpiritIndex * MathHelper.TwoPi) / totalSageSpirits).ToRotationVector2() * 70f; + destination += (SageSpiritIndex * MathHelper.TwoPi / totalSageSpirits).ToRotationVector2() * 70f; if (PlayerFlyTime >= 1f) { projectile.Center = PlayerFlyDestination; @@ -107,9 +128,11 @@ namespace CalamityMod.Projectiles.Summon PlayerFlyStart = projectile.Center; PlayerFlyOffsetAtEnds = Vector2.UnitY * distanceFromDestination; PlayerFlyDestination = destination; + projectile.netUpdate = true; + return; } - projectile.position.Y += (float)System.Math.Cos(GeneralTime / 60f * MathHelper.TwoPi + projectile.identity * 1.1f) * 0.5f; + projectile.position.Y += (float)Math.Cos(GeneralTime / 60f * MathHelper.TwoPi + projectile.identity * 1.1f) * 0.5f; if (distanceFromDestination < 160f && PlayerFlyTime <= 0f) return; @@ -136,7 +159,7 @@ namespace CalamityMod.Projectiles.Summon int totalSageSpirits = Owner.ownedProjectileCounts[projectile.type]; Vector2 destinationOffsetFactor = Vector2.Max(target.Size, new Vector2(160f)) * new Vector2(0.6f, 0.37f); Vector2 destination = target.Center + (AttackTimer / 12f).ToRotationVector2() * destinationOffsetFactor; - destination += ((float)(SageSpiritIndex * MathHelper.TwoPi) / totalSageSpirits).ToRotationVector2() * 130f; + destination += (SageSpiritIndex * MathHelper.TwoPi / totalSageSpirits).ToRotationVector2() * 130f; projectile.Center = Vector2.Lerp(projectile.Center, destination, 0.1f); // Frequently release a bunch of spikes. From 5209725ec377be3d4dd917e40e58956266895eba Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 18 Dec 2020 19:00:05 -0600 Subject: [PATCH 037/202] Oversight fix. --- Projectiles/Summon/SageSpirit.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Projectiles/Summon/SageSpirit.cs b/Projectiles/Summon/SageSpirit.cs index 3d83dc002f..25b0ea48cf 100644 --- a/Projectiles/Summon/SageSpirit.cs +++ b/Projectiles/Summon/SageSpirit.cs @@ -129,6 +129,7 @@ namespace CalamityMod.Projectiles.Summon PlayerFlyOffsetAtEnds = Vector2.UnitY * distanceFromDestination; PlayerFlyDestination = destination; projectile.netUpdate = true; + PlayerFlyTime = 0.01f; return; } From 031e05f105d7aaff2f135986eb357518da46da11 Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 18 Dec 2020 23:52:40 -0600 Subject: [PATCH 038/202] Added Flesh of Infidelity --- Buffs/Summon/FleshOfInfidelityBuff.cs | 34 +++++ Buffs/Summon/FleshOfInfidelityBuff.png | Bin 0 -> 563 bytes CalPlayer/CalamityPlayer.cs | 2 + Items/Weapons/Summon/FleshOfInfidelity.cs | 50 +++++++ Items/Weapons/Summon/FleshOfInfidelity.png | Bin 0 -> 796 bytes Projectiles/Summon/FleshBallMinion.cs | 149 +++++++++++++++++++++ Projectiles/Summon/FleshBallMinion.png | Bin 0 -> 1484 bytes Projectiles/Summon/SageSpirit.cs | 17 +++ 8 files changed, 252 insertions(+) create mode 100644 Buffs/Summon/FleshOfInfidelityBuff.cs create mode 100644 Buffs/Summon/FleshOfInfidelityBuff.png create mode 100644 Items/Weapons/Summon/FleshOfInfidelity.cs create mode 100644 Items/Weapons/Summon/FleshOfInfidelity.png create mode 100644 Projectiles/Summon/FleshBallMinion.cs create mode 100644 Projectiles/Summon/FleshBallMinion.png diff --git a/Buffs/Summon/FleshOfInfidelityBuff.cs b/Buffs/Summon/FleshOfInfidelityBuff.cs new file mode 100644 index 0000000000..fea7a77d87 --- /dev/null +++ b/Buffs/Summon/FleshOfInfidelityBuff.cs @@ -0,0 +1,34 @@ +using CalamityMod.CalPlayer; +using CalamityMod.Projectiles.Summon; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.Summon +{ + public class FleshOfInfidelityBuff : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Flesh Ball"); + Description.SetDefault("Why is it following you?"); + Main.buffNoTimeDisplay[Type] = true; + Main.buffNoSave[Type] = true; + //Main.persistentBuff[Type] = true; + } + + public override void Update(Player player, ref int buffIndex) + { + CalamityPlayer modPlayer = player.Calamity(); + if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) + modPlayer.fleshBall = true; + + if (modPlayer.fleshBall) + player.buffTime[buffIndex] = 18000; + else + { + player.DelBuff(buffIndex); + buffIndex--; + } + } + } +} diff --git a/Buffs/Summon/FleshOfInfidelityBuff.png b/Buffs/Summon/FleshOfInfidelityBuff.png new file mode 100644 index 0000000000000000000000000000000000000000..5fadbf39f8058283d967d17ec618287fb3151251 GIT binary patch literal 563 zcmV-30?hr1P)Px$?MXyIR9J=OSFuV1K@fcjQKE312!^Cl37ASN3x$A{MVgfP3QHRybw0tbNSP*x zg{6&^+9VJpO(YR995JFHvDkZe%;Zi|B@0e-?Ck9Bytgy6bBSyw2LO2O_hwk4WHY%0 z03?@rXp|%X%mAQtUKSJm-h1SNOm2IjjrDrHu6f%4U;zWExCwf!k#OAZJ_-H7?%|*N z#ECr&5SjK^GeP8ysi4+E4%@A!IX>@Hk`l#Gyxc318j7b7cYAgBY5 zb2YtKO^-u=Ua?DZwSC92JYNF03m`?cQbOqk+TK>c=Ub%gt2gpv{<{AjHG=9k|{FMNlgI&tqpTT)k{Y@uyO`sv!Lp&i*Y?= z7$G7pwC7zn9fOVeuj`66SrEV}o}2*)D`8F5{Q5{n^^3a$0N5W6gr1eLLHUTkivKZAim$QhXLKG z=t`(-J72fLcp5oRW>`0hF+HX|41{-M@|DqB@bf?K`^wjhlAjno5$iWVcS6BA&*ozf z0~C75o{k7v+nbP`4fQ2&D(qVeI(); + item.shootSpeed = 10f; + item.summon = true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ItemID.ImpStaff); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Weapons/Summon/FleshOfInfidelity.png b/Items/Weapons/Summon/FleshOfInfidelity.png new file mode 100644 index 0000000000000000000000000000000000000000..cb2bb8757c71763ad8f5a90852dc4ca2467039c6 GIT binary patch literal 796 zcmV+%1LOROP)Px%)=5M`R9J=Wm_2AyQ5462w^rMxc`1z%6{QyZqWCeWpdd(v3|$IRu!Do8sOaJ* zIBBV%i-@y`baQYhjs**XAXJbJja}LfX|d4I*xDwsreDwDV)ckj9P z^77+O)ZfDMq)l~yfRjwEP z+fskJF@qog_4Qr=5{bAC(AW1$i$Cdk4nXaCTmdA{MV7(du#?)YJ1w8;3%}0GvK^ z8Gw=D_gdUdQq+0-sqU60mX~wn1`DrARvSvDgA& z5YbXRY6En1T+!l@={X=xQb-l6mg6TBKxC%UD^tFTBxFOMCjjUi9n<#Re{mN`R~*Uu zSg;jV$kagd+j3HWbtzSwefNYXJZ=*_$ZOHDHLa9$#FTcYwuGv-V+^v>> z0tOK+*rVc2wJ1>ko0UVB4dbVX8oqMd#gx_%pscLNg#ji-YSwJbBMaL+btozRU}2m5LK4dkgu!RSOfow a7OY>MA}Q>WO7#W+0000 Main.player[projectile.owner]; + public bool SittingOnGround => Math.Abs(projectile.velocity.X) < 1.55f && projectile.velocity.Y == 0f; + public ref float HopTimer => ref projectile.ai[0]; + public const float Gravity = 0.25f; + public const float MaxFallSpeed = 12f; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Flesh Ball"); + Main.projFrames[projectile.type] = 4; + ProjectileID.Sets.MinionSacrificable[projectile.type] = true; + ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 32; + projectile.netImportant = true; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.minionSlots = 1f; + projectile.timeLeft = 90000; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.minion = true; + } + + public override void AI() + { + ProvidePlayerMinionBuffs(); + DetermineFrames(); + GenerateIdleVisuals(); + + HopTimer++; + NPC potentialTarget = projectile.Center.MinionHoming(950f, Owner); + if (potentialTarget is null) + GoNearOwner(); + else + AttackTarget(potentialTarget); + EnforceGravity(); + } + + internal void ProvidePlayerMinionBuffs() + { + Owner.AddBuff(ModContent.BuffType(), 3600); + + // Verify player/minion state integrity. The minion cannot stay alive if the + // owner is dead or if the caller of the AI is invalid. + if (projectile.type != ModContent.ProjectileType()) + return; + + if (Owner.dead) + Owner.Calamity().fleshBall = false; + if (Owner.Calamity().fleshBall) + projectile.timeLeft = 2; + } + + internal void DetermineFrames() + { + projectile.frameCounter++; + if (projectile.frameCounter % 5 == 4) + projectile.frame = (projectile.frame + 1) % Main.projFrames[projectile.type]; + } + + internal void EnforceGravity() + { + if (projectile.velocity.Y < MaxFallSpeed) + projectile.velocity.Y += Gravity; + } + + internal void GenerateIdleVisuals() + { + // All code within this method is visual. There is no need to waste resources executing it on the server. + if (Main.dedServ) + return; + + projectile.rotation += projectile.velocity.X * 0.05f; + + Vector2 shootOffsetDirection = -Vector2.UnitY.RotatedBy(projectile.rotation + projectile.direction * 0.2f); + Dust blood = Dust.NewDustDirect(projectile.Center + shootOffsetDirection * 10f - new Vector2(4f), 0, 0, DustID.Blood, newColor: Color.Transparent); + blood.velocity = shootOffsetDirection.RotatedByRandom(MathHelper.PiOver4) * Main.rand.NextFloat(3f, 4f); + blood.noGravity = true; + } + + internal void GoNearOwner() + { + projectile.tileCollide = true; + + bool closeToPlayer = projectile.WithinRange(Owner.Center, 150f); + if (!closeToPlayer && SittingOnGround && HopTimer % 30f == 29f) + { + projectile.velocity = projectile.DirectionTo(Owner.Center) * 9f + new Vector2(Math.Sign(projectile.velocity.X) * 2f, -4f); + + // Don't collide with tiles for 1 frame, to prevent slopes from being a nuisance. + projectile.tileCollide = false; + projectile.netUpdate = true; + } + } + + internal void AttackTarget(NPC target) + { + projectile.tileCollide = true; + + bool closeToTarget = projectile.WithinRange(target.Center, 300f); + if (SittingOnGround && HopTimer % 20f == 19f) + { + if (!closeToTarget) + { + projectile.velocity = projectile.DirectionTo(Owner.Center) * 6f + new Vector2(Math.Sign(projectile.velocity.X) * 2f, -4f); + + // Don't collide with tiles for 1 frame, to prevent slopes from being a nuisance. + projectile.tileCollide = false; + projectile.netUpdate = true; + } + // Release a bunch of blood. + else if (Main.myPlayer == projectile.owner) + { + for (int i = 0; i < Main.rand.Next(1, 3 + 1); i++) + { + Vector2 shootVelocity = -Vector2.UnitY.RotatedByRandom(0.3f); + int blood = Projectile.NewProjectile(projectile.Top, shootVelocity, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner); + if (Main.projectile.IndexInRange(blood)) + Main.projectile[blood].Calamity().forceMinion = true; + } + } + } + } + + // Prevent immediate death on tile collision, and slow down on tile collision. + public override bool OnTileCollide(Vector2 oldVelocity) + { + projectile.velocity.X *= 0.9f; + return false; + } + } +} diff --git a/Projectiles/Summon/FleshBallMinion.png b/Projectiles/Summon/FleshBallMinion.png new file mode 100644 index 0000000000000000000000000000000000000000..955f1050503f42c6b9ec0c92b3590586828a5b63 GIT binary patch literal 1484 zcmV;-1vC1IP)Px)hDk(0RCt{2n@?{WMHt4Pan>d#S`3LmLHrREDX3DB5Rnk5AAnwZLj4pRIriL- z&`*(LFM)d{E=WjJil{`Xia?QosKEpW|Jmg*^VptuXFR(b2hE0kPR;JD?fvzgciwqs zMxmzCbg=UNaClnlb33)3xj0{gY7U`Li~z_1;6dkQ z>*DR~IRM}W5(NN{Fm*ocBNs0rN#q6+0Kg+meKC>)z^!2h0Qh3CZ9Pv?Qg2U{0)S^p z?z|r#p-`{!#fZEv_08$u&g=KmvG=zCF%yF5HGIQQ1}{1v{2p4m4Tbx_%mWahkDDmBpZ^*yDJo{ZYIJ4W|flZRco+P>#KJM$Ux;xxl`GcY(6zpYp zhdt|ogG3YK8%wc0W92Z_@BHpKR{-!+Pg$RTebP|?aMaZ#qa&1XOnJEIZ3+OcPxNoS zmyWI8cW`F+nx}(T0RZou{$^cg=6+&gZk)`CTH`0l@OMN^81=Yh?O1l(4NUZ*UUR`w5G02^>q@FW7zgoXX-z?hQYb}d!r*%X4YZV z&K#S3VmoT7y#m7XwB{0`7z-y!;ZgTALVQ=_2nF*H1VxhJo2H^lxTvBd)GDOf|L;C` zq^@&DMHfSBbI^Q#Q0t(vhL(PioNtvS6(1oV3C_!ox|uaby#@W|KO=K`jB=KNig6kp zp#)--{tP_@0AF>-&UxAG?77um*4*=1N;W5CwPz*z7j$f$B=%fCIzlQ<2hQH&^AJPM znrtT}Jw{oH#z*MWbO*q~j}E!3R9%lzO8Q9A5lZCPM_E^lAOW%6dxgZfn?^fBZ`5qcV7pv zAR@^~qU=?NurqXHRus$3TrJi07|SYtLac@74!+31RXxV4ikFbgM_hfD72+*Z>4iMT zqRPE{yo4yZI`q;^kHUX$*tPG9)nx#F7uMmtS&EKOZ5Nhr+&9I+)=d9{u|zfAg$-uv z-H9e~n0E5zzmIh%#NKEI0LWCwYA5~bvWkvSaNb?kDPy}`v#5RCRnoU^W(?JK(CVsj zgeuoVOLDGl)OF6N=m@P^w-3p=--u(})%O_TiILW0lzUknyYw#PF@E@uvWR{6Lf(3e zmZU4f`5j{}IzsbI%{O{5SnV;&eMD6~M&93dZy$<}kotJ@6#xt8%$HXR9;48msU1^t z4~V=k+ePcb{%89bLt?ES9ihTL#`mzH0N_W=*5Wbln;3MEwK6tmG4T?XXLFtW1L#5}P1fr%E_|hi?eq-hA(9C>VsdSjWL`5n%t@wk?nmXFo)lf!k@U%|Ro;)draiII5xR62w(%b0+Fe*`?lBso&Gi_4H|n01zIq;` zk3@;H(g3P^jPIM8`iEX22IHLD7fu38UDjD?$4Qzv2^I2?T)U7nQQoiXF_MgLUs3#o zsP?S1QF~T8B=1@2kFpH_?OEyYS!tP(+q2RkwP&TJE_zm)YR^jhJVs{fMMgF^8tb4j zV?GnLHVJU_KJ2gd7)j<$Glm`Y%IyJ(j!zM|$BATVwY=#=44* m&{|G_1Lb|A#>G&pkp2bP* ref projectile.ai[1]; internal ref float SageSpiritIndex => ref projectile.localAI[0]; internal ref float GeneralTime => ref projectile.localAI[1]; + internal bool Initialized = false; internal Vector2 PlayerFlyStart; internal Vector2 PlayerFlyOffsetAtEnds; internal Vector2 PlayerFlyDestination; @@ -44,6 +45,7 @@ namespace CalamityMod.Projectiles.Summon public override void SendExtraAI(BinaryWriter writer) { + writer.Write(Initialized); writer.Write(SageSpiritIndex); writer.Write(GeneralTime); writer.WritePackedVector2(PlayerFlyStart); @@ -53,6 +55,7 @@ namespace CalamityMod.Projectiles.Summon public override void ReceiveExtraAI(BinaryReader reader) { + Initialized = reader.ReadBoolean(); SageSpiritIndex = reader.ReadSingle(); GeneralTime = reader.ReadSingle(); PlayerFlyStart = reader.ReadPackedVector2(); @@ -64,6 +67,7 @@ namespace CalamityMod.Projectiles.Summon { GeneralTime++; ProvidePlayerMinionBuffs(); + Initialize(); DetermineFrames(); NPC potentialTarget = projectile.Center.MinionHoming(750f, Owner); if (potentialTarget is null) @@ -90,6 +94,19 @@ namespace CalamityMod.Projectiles.Summon projectile.timeLeft = 2; } + internal void Initialize() + { + if (Initialized) + return; + + Initialized = true; + PlayerFlyTime = 1f; + PlayerFlyOffsetAtEnds = Vector2.UnitY; + PlayerFlyStart = projectile.Center; + PlayerFlyDestination = projectile.Center - Vector2.UnitY * 10f; + projectile.netUpdate = true; + } + internal void DetermineFrames() { projectile.frameCounter++; From 124b74751745539220ec4ebadb57d46730e1d931 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 19 Dec 2020 01:31:03 -0600 Subject: [PATCH 039/202] Gave Flesh Ball AI some powerful drugs --- Items/Weapons/Summon/FleshOfInfidelity.cs | 4 ++-- Projectiles/Summon/FleshBallMinion.cs | 21 ++++++++++----------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/Items/Weapons/Summon/FleshOfInfidelity.cs b/Items/Weapons/Summon/FleshOfInfidelity.cs index 30cda574df..6bc2587a56 100644 --- a/Items/Weapons/Summon/FleshOfInfidelity.cs +++ b/Items/Weapons/Summon/FleshOfInfidelity.cs @@ -1,8 +1,6 @@ using Terraria.ModLoader; using Terraria.ID; -using Terraria; using CalamityMod.Projectiles.Summon; -using Microsoft.Xna.Framework; using TerrariaAudio = Terraria.Audio; using CalamityMod.Items.Materials; @@ -27,6 +25,8 @@ namespace CalamityMod.Items.Weapons.Summon item.knockBack = 1f; item.value = CalamityGlobalItem.Rarity3BuyPrice; item.rare = ItemRarityID.Orange; + + // SoundID has no Zombie24 sound instance, so we must create one ourselves. item.UseSound = new TerrariaAudio.LegacySoundStyle(SoundID.Zombie, 24, TerrariaAudio.SoundType.Sound); item.autoReuse = true; item.shoot = ModContent.ProjectileType(); diff --git a/Projectiles/Summon/FleshBallMinion.cs b/Projectiles/Summon/FleshBallMinion.cs index e8b9e2572a..ac3e160640 100644 --- a/Projectiles/Summon/FleshBallMinion.cs +++ b/Projectiles/Summon/FleshBallMinion.cs @@ -114,26 +114,25 @@ namespace CalamityMod.Projectiles.Summon { projectile.tileCollide = true; - bool closeToTarget = projectile.WithinRange(target.Center, 300f); if (SittingOnGround && HopTimer % 20f == 19f) { - if (!closeToTarget) - { - projectile.velocity = projectile.DirectionTo(Owner.Center) * 6f + new Vector2(Math.Sign(projectile.velocity.X) * 2f, -4f); + projectile.velocity = projectile.DirectionTo(target.Center) * 6f + new Vector2(Math.Sign(projectile.velocity.X) * 2f, -4f); - // Don't collide with tiles for 1 frame, to prevent slopes from being a nuisance. - projectile.tileCollide = false; - projectile.netUpdate = true; - } + // Don't collide with tiles for 1 frame, to prevent slopes from being a nuisance. + projectile.tileCollide = false; + projectile.netUpdate = true; // Release a bunch of blood. - else if (Main.myPlayer == projectile.owner) + if (Main.myPlayer == projectile.owner) { - for (int i = 0; i < Main.rand.Next(1, 3 + 1); i++) + for (int i = 0; i < Main.rand.Next(1, 4 + 1); i++) { - Vector2 shootVelocity = -Vector2.UnitY.RotatedByRandom(0.3f); + Vector2 shootVelocity = -Vector2.UnitY.RotatedByRandom(0.3f) * Main.rand.NextFloat(6f, 11f); int blood = Projectile.NewProjectile(projectile.Top, shootVelocity, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner); if (Main.projectile.IndexInRange(blood)) + { Main.projectile[blood].Calamity().forceMinion = true; + Main.projectile[blood].penetrate = 1; + } } } } From 979dc2733d2b48b70da73a7e27e81cd40b9fc4b0 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 19 Dec 2020 20:12:26 -0600 Subject: [PATCH 040/202] Added the Eye of Night --- Buffs/Summon/EyeOfNightBuff.cs | 34 ++++++ Buffs/Summon/EyeOfNightBuff.png | Bin 0 -> 543 bytes CalPlayer/CalamityPlayer.cs | 2 + Items/Weapons/Summon/EyeOfNight.cs | 57 ++++++++++ Items/Weapons/Summon/EyeOfNight.png | Bin 0 -> 642 bytes Items/Weapons/Summon/FleshOfInfidelity.cs | 4 +- Projectiles/Summon/EyeOfNightCell.cs | 54 +++++++++ Projectiles/Summon/EyeOfNightCell.png | Bin 0 -> 198 bytes Projectiles/Summon/EyeOfNightSummon.cs | 129 ++++++++++++++++++++++ Projectiles/Summon/EyeOfNightSummon.png | Bin 0 -> 264 bytes Projectiles/Summon/FleshBallMinion.cs | 24 ++-- 11 files changed, 295 insertions(+), 9 deletions(-) create mode 100644 Buffs/Summon/EyeOfNightBuff.cs create mode 100644 Buffs/Summon/EyeOfNightBuff.png create mode 100644 Items/Weapons/Summon/EyeOfNight.cs create mode 100644 Items/Weapons/Summon/EyeOfNight.png create mode 100644 Projectiles/Summon/EyeOfNightCell.cs create mode 100644 Projectiles/Summon/EyeOfNightCell.png create mode 100644 Projectiles/Summon/EyeOfNightSummon.cs create mode 100644 Projectiles/Summon/EyeOfNightSummon.png diff --git a/Buffs/Summon/EyeOfNightBuff.cs b/Buffs/Summon/EyeOfNightBuff.cs new file mode 100644 index 0000000000..8bbb1098c3 --- /dev/null +++ b/Buffs/Summon/EyeOfNightBuff.cs @@ -0,0 +1,34 @@ +using CalamityMod.CalPlayer; +using CalamityMod.Projectiles.Summon; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.Summon +{ + public class EyeOfNightBuff : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Eye ofNight"); + Description.SetDefault("It eerily watches"); + Main.buffNoTimeDisplay[Type] = true; + Main.buffNoSave[Type] = true; + //Main.persistentBuff[Type] = true; + } + + public override void Update(Player player, ref int buffIndex) + { + CalamityPlayer modPlayer = player.Calamity(); + if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) + modPlayer.eyeOfNight = true; + + if (modPlayer.eyeOfNight) + player.buffTime[buffIndex] = 18000; + else + { + player.DelBuff(buffIndex); + buffIndex--; + } + } + } +} diff --git a/Buffs/Summon/EyeOfNightBuff.png b/Buffs/Summon/EyeOfNightBuff.png new file mode 100644 index 0000000000000000000000000000000000000000..e4f07e8ac0aa9ebf0b18b235ed4319ea64bc4451 GIT binary patch literal 543 zcmV+)0^t3LP)Px$*-1n}R9J=0m(MFiQ545NPl~)O#_yU*G&M5$RiwmDtYs%FDSOSrLRPYrzW`ay zMv}6Uok>Lb6*ZYiqb5&gp^+Vn=NR|Ro8AcHemA%C?zx?FzUSO`&NUi+Apq{u@i&Ty zYSV83loZpb8w}tLV7w>ds&JdWQRJkR0w5UZEXY72d8){P+6Dk(i48yl21*N6EGw%A zAQ-6smH}Z(m=Fd9|IUD?14%2D<268gd6@R{@ZUS|*Z8afsrDvcGXQ(>eIS3epTA!I ziUayEAdx%oy`XpE#P$2(YS)h((1!uRpuZb{HEY}TKy=;!U~JBA9jVG402-c$T=nJt zo2?J(#(}-)!$7d2%2i=zMRIJfQP!0G))o_h^pSeb*#q)H9|rPaYS@lga^5rY0zh=$ z{E%%usfEl{opL@W_YUaGfb?zY16%7Bkj=Rh-;G?L9|ODh#{f)+766D?lfah6;hHu8E*~$7 h`Z{j(h4gqGzXL8Jhym@CCqw`M002ovPDHLkV1iB7_qhN7 literal 0 HcmV?d00001 diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 2261f69cf6..39f1ef0124 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -979,6 +979,7 @@ namespace CalamityMod.CalPlayer public bool viridVanguard = false; public bool sageSpirit = false; public bool fleshBall = false; + public bool eyeOfNight = false; #endregion #region Biome @@ -2039,6 +2040,7 @@ namespace CalamityMod.CalPlayer viridVanguard = false; sageSpirit = false; fleshBall = false; + eyeOfNight = false; abyssalDivingSuitPrevious = abyssalDivingSuit; abyssalDivingSuit = abyssalDivingSuitHide = abyssalDivingSuitForce = abyssalDivingSuitPower = false; diff --git a/Items/Weapons/Summon/EyeOfNight.cs b/Items/Weapons/Summon/EyeOfNight.cs new file mode 100644 index 0000000000..ef30e0cc5f --- /dev/null +++ b/Items/Weapons/Summon/EyeOfNight.cs @@ -0,0 +1,57 @@ +using Terraria.ModLoader; +using Terraria.ID; +using CalamityMod.Projectiles.Summon; +using CalamityMod.Items.Materials; +using Terraria; +using Microsoft.Xna.Framework; + +namespace CalamityMod.Items.Weapons.Summon +{ + public class EyeOfNight : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Eye of Night"); + Tooltip.SetDefault("Summons a diseased eyeball that attaches to enemies and explodes"); + } + + public override void SetDefaults() + { + item.damage = 35; + item.mana = 10; + item.width = item.height = 36; + item.useTime = item.useAnimation = 30; + item.useStyle = ItemUseStyleID.SwingThrow; + item.noMelee = true; + item.knockBack = 1f; + item.value = CalamityGlobalItem.Rarity3BuyPrice; + item.rare = ItemRarityID.Orange; + + item.UseSound = SoundID.NPCHit1; + item.autoReuse = true; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 10f; + item.summon = true; + } + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + if (player.altFunctionUse != 2) + Projectile.NewProjectile(Main.MouseWorld, Vector2.UnitY * -3f, type, damage, knockBack, player.whoAmI); + 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(ItemID.ImpStaff); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Weapons/Summon/EyeOfNight.png b/Items/Weapons/Summon/EyeOfNight.png new file mode 100644 index 0000000000000000000000000000000000000000..6e5a635902b7e990810301516f3dc27f66a4a023 GIT binary patch literal 642 zcmV-|0)737P)Px%JV``BR9J=Gn6YaUQ5?rVS1alDV$+fsl%`fG2%W50B3d`W#YNnl#Kl2y=u{~9 zH@F3K5Zs*vH{GPgLE26Q!J!&a(iY8mmrIa%4)1=P?{aB0Hu&1_a`%4kz26-le!t)Q z-B}Ds(_@zbaO@laeozn7);V_0isk_r8q^E*E34m)3o|!U?TuCwfc8)2y6$}q0cJ|) zQrEw)ZfNgf9HHTT@S(-VXl4X}>h>3)lg!eSIRGA4D#}oGG(U%u5CF@iC2f3fdr=#g z@2mrG_nL~C`5Wne4n85tu2Y#Q06w%nYV+lCS>3Fq@4xjxh1~OJJ^;?Fy84?%z(7KO zU59?FKOuC+&YSQh0QWC012F$+A=QsFTLWS;M~*ektV91ysGB;nZf!AjosemNSM|#{ zLVedE*Y_*{x8a2VrQ;_6xH@?Oh-2y1r?&u9&OZb+QW}{pcLg|1gvK*j0NjQL!0CxI z06blP0mQ__-YtfNjOgGJlI$wl69Ci#)#u!vyAH%;l6w7a6@Z*QW&zX#chBb-N2q5V z>PAMgNyy}*-gr0BJKLEN3m}L($z;qVWgekYu>e4|wxdl5nbD)Fqig)|Q^`z^pR@qB zzJ1>FLA}U`%p;UE$oJG#eiDFis2xIFPb6!SWd4*uFPTe7$P}`90Cv3H5a7z$OF&Gf zkj-1sJg|RcMCK7Pg^b8JLc@0SrP+;)oI!&oBQlRr&}wQOUs7^951Nd~JVJ6Ke=Fqr czhoStUqZjoy<-2Bl>h($07*qoM6N<$f 5f) + Dust.NewDustPerfect(projectile.Center, (int)CalamityDusts.SulfurousSeaAcid).noGravity = true; + + projectile.StickyProjAI(360); + } + public override void Kill(int timeLeft) + { + CalamityGlobalProjectile.ExpandHitboxBy(projectile, 60); + projectile.Damage(); + + if (!Main.dedServ) + for (int i = 0; i < 10; i++) + Dust.NewDustDirect(projectile.position, 36, 36, (int)CalamityDusts.SulfurousSeaAcid).noGravity = true; + } + + public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) => projectile.ModifyHitNPCSticky(10, false); + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) => target.AddBuff(BuffID.CursedInferno, 120); + + public override void OnHitPvp(Player target, int damage, bool crit) => target.AddBuff(BuffID.CursedInferno, 120); + } +} diff --git a/Projectiles/Summon/EyeOfNightCell.png b/Projectiles/Summon/EyeOfNightCell.png new file mode 100644 index 0000000000000000000000000000000000000000..99bc8669bf338631aefe3ef977344e5f8ee59620 GIT binary patch literal 198 zcmeAS@N?(olHy`uVBq!ia0vp^AT}2VGmzZ%#=aj&F%}28J29*~C-V}>VM%xNb!1@J z*w6hZkrl`n3h)VW1=3pPD#3C3J5S84=(YrMzkL%H1X64zL4LviL4aZN{w4c?BAf*t zk;M!Qe1}1p@p%4<6riBCr;B5VM0oC*je-mcJck{g-1xoTr;n>>#V;@Ihg0rMS#{;0 hx3t>9yHB3a&M~~l@KUS&WHwM6gQu&X%Q~loCIG$TK#>3d literal 0 HcmV?d00001 diff --git a/Projectiles/Summon/EyeOfNightSummon.cs b/Projectiles/Summon/EyeOfNightSummon.cs new file mode 100644 index 0000000000..b87e076ff3 --- /dev/null +++ b/Projectiles/Summon/EyeOfNightSummon.cs @@ -0,0 +1,129 @@ +using CalamityMod.Buffs.Summon; +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Summon +{ + public class EyeOfNightSummon : ModProjectile + { + public Player Owner => Main.player[projectile.owner]; + public ref float HoverTime => ref projectile.ai[0]; + + public const int ShootRate = 60; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Eye of Night"); + ProjectileID.Sets.MinionSacrificable[projectile.type] = true; + ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 16; + projectile.netImportant = true; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.minionSlots = 1f; + projectile.timeLeft = 90000; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.minion = true; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 19; + } + + public override void AI() + { + ProvidePlayerMinionBuffs(); + DynamicallyUpdateDamage(); + GenerateVisuals(); + NPC potentialTarget = projectile.Center.MinionHoming(750f, Owner); + if (potentialTarget is null) + FlyNearOwner(); + else + AttackTarget(potentialTarget); + } + + internal void ProvidePlayerMinionBuffs() + { + Owner.AddBuff(ModContent.BuffType(), 3600); + + // Verify player/minion state integrity. The minion cannot stay alive if the + // owner is dead or if the caller of the AI is invalid. + if (projectile.type != ModContent.ProjectileType()) + return; + + if (Owner.dead) + Owner.Calamity().eyeOfNight = false; + if (Owner.Calamity().eyeOfNight) + projectile.timeLeft = 2; + } + + internal void DynamicallyUpdateDamage() + { + if (projectile.localAI[0] == 0f) + { + projectile.Calamity().spawnedPlayerMinionDamageValue = Owner.MinionDamage(); + projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; + projectile.localAI[0] = 1f; + } + if (Owner.MinionDamage() == projectile.Calamity().spawnedPlayerMinionDamageValue) + return; + int trueDamage = (int)(projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * Owner.MinionDamage()); + projectile.damage = trueDamage; + } + + internal void GenerateVisuals() + { + // The code within this method is visual. There is no need to waste resources executing it on the server. + if (Main.dedServ) + return; + + projectile.rotation += projectile.velocity.X * 0.075f; + } + + internal void FlyNearOwner() + { + Vector2 destination = Owner.Top - Vector2.UnitY * 45f + (projectile.identity * 0.9f).ToRotationVector2() * 16f; + Vector2 idealVelocity = projectile.DirectionTo(destination) * MathHelper.Lerp(2.3f, 8f, Utils.InverseLerp(16f, 160f, projectile.Distance(destination))); + if (projectile.velocity.Length() < 0.4f) + projectile.velocity = Vector2.UnitY.RotatedBy(Main.rand.NextFloat(0.5f, 1.1f) * Main.rand.NextBool(2).ToDirectionInt()) * -3.6f; + else if (!projectile.WithinRange(destination, 20f)) + projectile.velocity = projectile.velocity * 0.9f + idealVelocity * 0.1f; + + // Slow down a bit over time. + projectile.velocity *= 0.985f; + } + + internal void AttackTarget(NPC target) + { + if (Main.myPlayer == projectile.owner && HoverTime % 30 == 29) + { + Projectile.NewProjectile(projectile.Center, projectile.DirectionTo(target.Center) * 8f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner); + HoverTime++; + } + + Vector2 destination = target.Center; + Vector2 destinationOffset = Vector2.Max(target.Size * 1.2f, Vector2.One * 90f).RotatedBy(projectile.identity * 0.96f + HoverTime / 15f); + + // Make the offset pulsate over time. + destinationOffset *= MathHelper.Lerp(0.7f, 1.3f, (float)Math.Cos(projectile.identity * 1.11f + HoverTime / 14f) * 0.5f + 0.5f); + + destinationOffset.Y += (float)Math.Sin(projectile.identity * 1.16f + HoverTime / 15f + MathHelper.PiOver2) * MathHelper.Min(target.height * 0.8f, 70f); + + destination += destinationOffset; + + // Fly towards the destination faster the farther the eye already is to it. + float flySpeed = MathHelper.Lerp(5f, 15f, Utils.InverseLerp(40f, 250f, projectile.Distance(destination), true)); + + if (projectile.WithinRange(destination, 24f + target.velocity.Length() * 2f)) + HoverTime++; + + projectile.velocity = (destination - projectile.Center).SafeNormalize(Vector2.Zero) * flySpeed; + } + } +} \ No newline at end of file diff --git a/Projectiles/Summon/EyeOfNightSummon.png b/Projectiles/Summon/EyeOfNightSummon.png new file mode 100644 index 0000000000000000000000000000000000000000..7caaf49286c8c431e2b5768134ea9c2d6d52cde7 GIT binary patch literal 264 zcmV+j0r&oiP)Px#!bwCyR49?H(ya;tK@h<4|H{F^DTfvf2D6t8my9->)kp9NOumM}AU=RWd;x=C zvL8mH3gU^Y2*Me3z&%ccJEtr=JIilBMzy>i0GI0tfZcH$ksRuClKWEhGc1t`PBD6q z0F?X{0P9&^YULyRJ{iCY6&3G=cSM6%304(=TCh-aJ1T_5F=IQ|e O0000 Date: Sat, 19 Dec 2020 22:39:00 -0600 Subject: [PATCH 041/202] Tiny adjustments --- Items/Weapons/Summon/EyeOfNight.cs | 1 - Items/Weapons/Summon/FleshOfInfidelity.cs | 3 +-- Items/Weapons/Summon/ViralSprout.cs | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Items/Weapons/Summon/EyeOfNight.cs b/Items/Weapons/Summon/EyeOfNight.cs index ef30e0cc5f..5b6c81d1b7 100644 --- a/Items/Weapons/Summon/EyeOfNight.cs +++ b/Items/Weapons/Summon/EyeOfNight.cs @@ -48,7 +48,6 @@ namespace CalamityMod.Items.Weapons.Summon recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ItemID.ImpStaff); - recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddTile(TileID.Anvils); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Summon/FleshOfInfidelity.cs b/Items/Weapons/Summon/FleshOfInfidelity.cs index e02953a1d8..3d0f142d8a 100644 --- a/Items/Weapons/Summon/FleshOfInfidelity.cs +++ b/Items/Weapons/Summon/FleshOfInfidelity.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetDefaults() { - item.damage = 41; + item.damage = 31; item.mana = 10; item.width = item.height = 48; item.useTime = item.useAnimation = 30; @@ -41,7 +41,6 @@ namespace CalamityMod.Items.Weapons.Summon recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ItemID.ImpStaff); - recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddTile(TileID.Anvils); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Summon/ViralSprout.cs b/Items/Weapons/Summon/ViralSprout.cs index 70877c7383..fc63be50f8 100644 --- a/Items/Weapons/Summon/ViralSprout.cs +++ b/Items/Weapons/Summon/ViralSprout.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Summon item.width = 48; item.height = 56; item.useTime = item.useAnimation = 20; - item.useStyle = ItemUseStyleID.SwingThrow; + item.useStyle = ItemUseStyleID.HoldingUp; item.noMelee = true; item.knockBack = 2f; item.value = CalamityGlobalItem.Rarity7BuyPrice; From 5dd85f0d7290de69e9aa47dd5936458b7d983289 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sun, 20 Dec 2020 18:46:00 -0600 Subject: [PATCH 042/202] Reworked Vehemence a bit --- Items/Weapons/Magic/Vehemenc.cs | 20 ++--- Projectiles/Magic/Vehemence.cs | 99 +++++++++++++++++++------ Projectiles/Magic/VehemenceHoldout.cs | 93 +++++++++++++++++++++++ Projectiles/Magic/VehemenceHoldout.png | Bin 0 -> 2432 bytes Projectiles/Magic/VehemenceSkull.cs | 63 ++++++++++++++++ Projectiles/Magic/VehemenceSkull.png | Bin 0 -> 2771 bytes 6 files changed, 241 insertions(+), 34 deletions(-) create mode 100644 Projectiles/Magic/VehemenceHoldout.cs create mode 100644 Projectiles/Magic/VehemenceHoldout.png create mode 100644 Projectiles/Magic/VehemenceSkull.cs create mode 100644 Projectiles/Magic/VehemenceSkull.png diff --git a/Items/Weapons/Magic/Vehemenc.cs b/Items/Weapons/Magic/Vehemenc.cs index 1e20d281a9..f1011dc713 100644 --- a/Items/Weapons/Magic/Vehemenc.cs +++ b/Items/Weapons/Magic/Vehemenc.cs @@ -8,14 +8,14 @@ namespace CalamityMod.Items.Weapons.Magic { public class Vehemenc : ModItem { + public const int VehemenceSkullDamage = 7000; public override void SetStaticDefaults() { DisplayName.SetDefault("Vehemence"); Tooltip.SetDefault("Casts an intense energy blast\n" + "Does far more damage the more HP an enemy has left\n" + "Max damage is capped at 1,000,000\n" + - "If an enemy has full HP it will inflict several long-lasting debuffs\n" + - "Revengeance drop"); + "If an enemy has full HP it will inflict Demon Flames for an extremely long time"); Item.staff[item.type] = true; } @@ -26,8 +26,9 @@ namespace CalamityMod.Items.Weapons.Magic item.mana = 590; item.width = 44; item.height = 44; - item.useTime = 50; - item.useAnimation = 50; + item.useTime = item.useAnimation = 50; + item.noUseGraphic = true; + item.channel = true; item.useStyle = ItemUseStyleID.HoldingOut; item.noMelee = true; item.knockBack = 5.75f; @@ -35,20 +36,19 @@ namespace CalamityMod.Items.Weapons.Magic item.rare = 10; item.UseSound = SoundID.Item73; item.autoReuse = true; - item.shoot = ModContent.ProjectileType(); + item.shoot = ModContent.ProjectileType(); item.shootSpeed = 16f; } - public override Vector2? HoldoutOrigin() - { - return new Vector2(25, 25); - } + public override Vector2? HoldoutOrigin() => new Vector2(25, 25); public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(position, Vector2.Zero, type, damage, knockBack, player.whoAmI); player.AddBuff(BuffID.ManaSickness, 600, true); return false; } + + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; } } diff --git a/Projectiles/Magic/Vehemence.cs b/Projectiles/Magic/Vehemence.cs index 0f9f39ab4b..ea63ef5e85 100644 --- a/Projectiles/Magic/Vehemence.cs +++ b/Projectiles/Magic/Vehemence.cs @@ -1,3 +1,6 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; +using CalamityMod.Items.Weapons.Magic; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -9,6 +12,8 @@ namespace CalamityMod.Projectiles.Magic { public class Vehemence : ModProjectile { + public ref float Time => ref projectile.ai[0]; + public Player Owner => Main.player[projectile.owner]; public override void SetStaticDefaults() { DisplayName.SetDefault("Vehemence"); @@ -18,8 +23,7 @@ namespace CalamityMod.Projectiles.Magic public override void SetDefaults() { - projectile.width = 26; - projectile.height = 26; + projectile.width = projectile.height = 26; projectile.friendly = true; projectile.ignoreWater = true; projectile.penetrate = 1; @@ -31,49 +35,96 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; - Lighting.AddLight(projectile.Center, 0.45f, 0f, 0.45f); - for (int num457 = 0; num457 < 2; num457++) + Lighting.AddLight(projectile.Center, Color.DarkRed.ToVector3()); + + if (Time == 0f) + GenerateInitialBurstDust(); + + GenerateHelicalDust(); + Time++; + } + + private void GenerateInitialBurstDust() + { + if (Main.dedServ) + return; + + for (int i = 0; i < 40; i++) { - int num458 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 65, 0f, 0f, 100, default, 2f); - Main.dust[num458].noGravity = true; - Main.dust[num458].velocity *= 0.15f; - Main.dust[num458].velocity += projectile.velocity * 0.1f; + float angle = MathHelper.TwoPi * i / 40f; + + Dust brimstoneMagic = Dust.NewDustPerfect(projectile.Center + projectile.velocity * 7f, 27); + brimstoneMagic.velocity = angle.ToRotationVector2() * 15f; + brimstoneMagic.color = Color.Lerp(Color.Red, Color.MediumPurple, (float)Math.Sin(angle) * 0.5f + 0.5f); + brimstoneMagic.scale = 1.6f; + brimstoneMagic.noGravity = true; + } + } + + private void GenerateHelicalDust() + { + if (Main.dedServ) + return; + + // Helical brimstone dust from the back of the projectile. + for (int i = -1; i <= 1; i += 2) + { + float helixOffset = (float)Math.Sin(Time / 45f * MathHelper.TwoPi) * 11f * i; + Vector2 spawnOffset = new Vector2(helixOffset, -28f).RotatedBy(projectile.rotation); + + Dust brimstoneMagic = Dust.NewDustPerfect(projectile.Center + spawnOffset, (int)CalamityDusts.Brimstone); + brimstoneMagic.velocity = Vector2.Zero; + brimstoneMagic.scale = 1.1f; + brimstoneMagic.noGravity = true; } } public override void Kill(int timeLeft) { Main.PlaySound(SoundID.Item74, projectile.position); - for (int j = 0; j <= 25; j++) + if (Main.myPlayer == projectile.owner) { - int num459 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 65, 0f, 0f, 100, default, 1f); - Main.dust[num459].noGravity = true; - Main.dust[num459].velocity *= 0.1f; + int damage = (int)(Vehemenc.VehemenceSkullDamage * Owner.MagicDamage()); + for (int i = 0; i < 18; i++) + Projectile.NewProjectile(projectile.Center, Main.rand.NextVector2Circular(12f, 12f), ModContent.ProjectileType(), damage, projectile.knockBack, projectile.owner); + } + + if (!Main.dedServ) + { + for (int i = 0; i < 20; i++) + { + for (int j = 0; j < 4; j++) + { + Vector2 shootVelocity = projectile.velocity.RotatedBy(MathHelper.Lerp(-0.35f, 0.35f, j / 4f)) * Main.rand.NextFloat(0.75f, 1.1f); + Vector2 spawnPosition = projectile.Center + shootVelocity.SafeNormalize(Vector2.Zero) * 10f; + + Dust blood = Dust.NewDustPerfect(spawnPosition, DustID.Blood); + blood.velocity = shootVelocity; + blood.scale = MathHelper.Lerp(1.7f, 0.85f, i / 20f); + } + } + for (int i = 0; i < 60; i++) + { + Dust brimstoneMagic = Dust.NewDustPerfect(projectile.Center, Main.rand.NextBool(2) ? (int)CalamityDusts.Brimstone : 27); + brimstoneMagic.velocity = Main.rand.NextVector2Circular(18f, 18f); + brimstoneMagic.scale = 1.7f; + brimstoneMagic.noGravity = true; + } } } public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { - double lifeAmount = (double)target.life; - double lifeMax = (double)target.lifeMax; - double damageMult = lifeAmount / lifeMax * 7; + double damageMult = target.life / (float)target.lifeMax * 7; damage = (int)Math.Pow(damage, damageMult); if (damage > 1000000) - { damage = 1000000; - } } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { if (target.life == target.lifeMax) - { - target.AddBuff(BuffID.ShadowFlame, 12000); - target.AddBuff(BuffID.Ichor, 12000); - target.AddBuff(BuffID.Frostburn, 12000); - target.AddBuff(BuffID.OnFire, 12000); - target.AddBuff(BuffID.Poisoned, 12000); - } + target.AddBuff(ModContent.BuffType(), 18000); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Magic/VehemenceHoldout.cs b/Projectiles/Magic/VehemenceHoldout.cs new file mode 100644 index 0000000000..9052a882ed --- /dev/null +++ b/Projectiles/Magic/VehemenceHoldout.cs @@ -0,0 +1,93 @@ +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Magic +{ + public class VehemenceHoldout : ModProjectile + { + public Player Owner => Main.player[projectile.owner]; + public ref float Time => ref projectile.ai[0]; + + public const int ChargeTime = 90; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Vehemence"); + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 96; + projectile.friendly = false; + projectile.magic = false; + projectile.tileCollide = false; + projectile.ignoreWater = true; + projectile.timeLeft = ChargeTime + 1; + } + + public override void AI() + { + UpdatePlayerVisuals(); + if (Time == ChargeTime) + ShootBolt(); + else if (Time < ChargeTime) + CreateChargeDust(); + + Time++; + + if (Main.mouseLeftRelease && Time >= 5f && Time < ChargeTime) + projectile.Kill(); + } + + private void UpdatePlayerVisuals() + { + projectile.Center = Owner.RotatedRelativePoint(Owner.MountedCenter, true); + + projectile.rotation = projectile.AngleTo(Main.MouseWorld); + projectile.velocity = projectile.rotation.ToRotationVector2(); + + // Place the projectile directly into the player's hand with an offset at all times. + projectile.Center += projectile.rotation.ToRotationVector2() * 30f; + + projectile.direction = projectile.spriteDirection = (Math.Cos(projectile.rotation) > 0).ToDirectionInt(); + + // The staff is a holdout projectile; change the player's variables to reflect this. + Owner.ChangeDir(projectile.direction); + Owner.heldProj = projectile.whoAmI; + Owner.itemTime = 2; + Owner.itemAnimation = 2; + Owner.itemRotation = projectile.rotation * projectile.direction; + + projectile.rotation += MathHelper.PiOver4; + if (projectile.spriteDirection == -1) + projectile.rotation += MathHelper.PiOver2; + } + + private void ShootBolt() + { + if (Main.myPlayer != projectile.owner) + return; + + Item heldItem = Owner.ActiveItem(); + Vector2 shootVelocity = (Main.MouseWorld - projectile.Center).SafeNormalize(Vector2.UnitX * projectile.direction) * heldItem.shootSpeed; + Projectile.NewProjectile(projectile.Center, shootVelocity, ModContent.ProjectileType(), (int)(Owner.MagicDamage() * heldItem.damage), heldItem.knockBack, projectile.owner); + } + + private void CreateChargeDust() + { + if (Main.dedServ) + return; + + Vector2 spawnOffset = projectile.velocity * 70f; + for (int i = 0; i < 18; i++) + { + Dust brimstoneMagic = Dust.NewDustPerfect(projectile.Center + spawnOffset + Main.rand.NextVector2CircularEdge(30f, 30f), (int)CalamityDusts.Brimstone); + brimstoneMagic.velocity = (projectile.Center + spawnOffset - brimstoneMagic.position).SafeNormalize(Vector2.Zero) * 2f + Owner.velocity; + brimstoneMagic.scale = 1.2f; + brimstoneMagic.noGravity = true; + } + } + } +} diff --git a/Projectiles/Magic/VehemenceHoldout.png b/Projectiles/Magic/VehemenceHoldout.png new file mode 100644 index 0000000000000000000000000000000000000000..382701bacba1d0a05e9ef846ab5bc5e3fd43a93d GIT binary patch literal 2432 zcmXw5dpr~B8-ItG%YNB%D&!K&-RX4EtTDG`Lu4W>n&=p@5D8&(&*h-SqA;P{s&i_H z2nR=QVMMuK$|a04OG18gKA-c)`@Vm?&-490pXd8L&-*6Y+TdXlauNUlm<0i6Cpg^& z%MB_j*k`H5djJr}Ti{IWLvpye*1j%|vhfoqPGrks6yJOmAu;q_rF}E)v~aO9;*hbw z9-0fCTB19!yUX08a0eV5ol)BNVGCN4E*EspYA3~g(voP!oieen)I@$r#C!~kG&phZ zpPS<~f!K*f)`t_=fSy{}iHVx3`nho0oQu2&%-&I*JXos&+N6FGqZt{PWwGyvv=_#p zxR3(l7CLU?%M3>dOtLcL0}Z6761xJ78Z9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akGKK6ZahU=KO-8rbJe_o7!Eq)C`TeAc%&a3w>P> zkJBmrZ*h-Ro!;1 zVee{No*O!tAoUGGXyxiXce8G+RO)cr8C+Q&^1JS1yYc4-19uaw*Ay~lgjH1}8l;Bm zvT~;0rt2$(3@pFH9b$^?D*wYqWG-vrM(f=TDkTo~=++we?OY zXs5V=Hxn2ASIF#$|5=-&wP_4~Rr*=e;>SnG`d1OV-67{>q(V(C+aCckwqmw67?AJI9f3JHW<$G+l<$x@&CaEGLQ?7r67BL5ntZmlbRYpIj3hoXf{$!R(c<1hp5Q=Hm_m5>+Gkpc3*GI zYBr$TV#bozZ6-0ii@DZPsn-2Cgt9D5+3DJR!Q!QSHwual{&zTJL9LsH`d<{(ACaW~ z))017h`uo~ZdHfXaNfmJhj-;?qx@e(DxL3Q8>=E}rEHv9F&evJL`8^D#`$Xpf^<7T zLQlSt-|m1gO!TUHxsNjaS?YnqV7~f!LBn&EqjPJ*FZ_^t@@!!p8Bi6BV%Zwb=f`LY zWO#LKCz9grgHY@EJydMs)s|AM;9<`e2;8=G#*}0)L(nG)sP25uZm3uc+hZshBY`~h u$L@7XUPIkt-J`srAs__VwiD27D@~4Gk~cDcvnBXh0gE#>xM!wr(f ref projectile.ai[0]; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Brimstone Skull"); + Main.projFrames[projectile.type] = 10; + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 45; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.alpha = 255; + projectile.tileCollide = false; + projectile.ignoreWater = true; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 6; + projectile.magic = true; + } + + public override void AI() + { + Time++; + projectile.frameCounter++; + if (projectile.frameCounter > 6) + { + projectile.frame++; + projectile.frameCounter = 0; + } + + if (projectile.ai[0] < 125) // 155 - frameCounter tick * number of disippation frames. + { + if (projectile.frame >= 4) + projectile.frame = 0; + } + + else if (projectile.owner == Main.myPlayer && projectile.frame >= Main.projFrames[projectile.type]) + projectile.Kill(); + + projectile.velocity *= 0.98f; + if (projectile.alpha > 110) + { + projectile.alpha -= 30; + if (projectile.alpha < 70) + projectile.alpha = 70; + } + + if (Math.Abs(projectile.velocity.X) > 0.1f) + projectile.spriteDirection = -projectile.direction; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) => target.AddBuff(ModContent.BuffType(), 240); + } +} diff --git a/Projectiles/Magic/VehemenceSkull.png b/Projectiles/Magic/VehemenceSkull.png new file mode 100644 index 0000000000000000000000000000000000000000..249fa3f6fe5b53c43371579bba42aa8ea32bc4a2 GIT binary patch literal 2771 zcmeHJ`8V5%7XPA=h>C<-+XPL-7MVOtJ0(gClA^JFErTj1wWJHfXbo*i#cqf)YDt%r zR2Vw;4q7UxY855r6;GRJb!=^|we@+K^ZtyPd(J&~`RQ}-{oH$QraPUg1lNWG0HAb& z=HMx{h5#T-g2_p}ZmZYHQX>=VNwo*=4<4G62K&M(Cn*3>pQpGR0s#Oyz}*#el;+RN z$kbXm&A7Sk<;P0Hf8?JI{Czr*?DD2ox+lO-o^-FhzqbHhU!eNZ$ty(DzLy>XME74R z(-$RR0D!#v2?q)oAG9>_GKNdqpDM=B?R3V>pQdJ=YjE*3)3{j}+Z8%j9{f$+O?uLm zs~w$5xe+^L^k#9#qq#;|?2vep20iYEHbc=}^$JuOAnTsf^z`%_Tf#BC`)TU?GqAGA z%NIiqpMlyps@0eGv5U$ij+)OK>>K1LdAg`8XeN^PHSygHw&OAJ-CYW>G=!XBF-@#+ z);2URFcGvSMFqkEQ{_yi8lJC^osX=6YYF%fJ&|+9mV$tjULj?qNHj(j{Az_G5<(L> zVRWh(8Fe&-*eWq~LC@CaPaP~mYZfdwRLZ4nzvW=a&-Y}<`PIT^nqX1bTC;pSC*X*V zuT4*el_=Y9cmPJL>TW$hM*Wz@v2PlP*M!#EDJhr&wz>-a7Yw?%#*{CSX;J}9xX3ykF82@J_2HgFV^~M+tD)0Sp?N_4fJpcE# zJ1ZGWU42zTszE?3B+%ehI-zZ2Be*c6CwnwRO`rd4{(yP;2(o5-f{<3`dP<{F}Afzja`e zh0{#*-wd`flooV{n6YSwJPJRjQ>|60KYgxySF$!&n~&gD&ZHXI#21;o?PrYbLT15j z_ijT2Fm%moKl1k3l{%}-hbS#-e>S7wTHhqB$Nh;t7^6j&Pe5KPHR=9iy;t&5W$7_v zwQ7qkTx`FJDy@Unol+i__2E5xQ+`2t);63GdR@wfqL|Ao;~ZUQXoEnPUU@~ee6R(s zHE@1u4(U{94CaT?johYF3RAy76pICW5~5FC*kDy4C~SOYR=d(u$H$RQsbI)RaZyWk zhPNK5dAFtpaUw7oSWe?Zu|a+#tPic?NO_S9ZSuq1<35XyVR#NXeaaBMNsfE!@a?}+ zUFjSTNU641{EX`TgY0@77?f65@+4dX?|D(zA^>GQ5k#DICKa7YWk9cCD2KPLM7s86 zI<31N^Y%pT3LWf5IBdzTSq**tCZ@uu+NK&^e3S@DE=qT3h8K*mducGA)cqn)3rW*Y zziNwW?^V^EEN(*NDM-1bqM=@ILo=@|kIr~dM!FHWT*ODLj?q3UJxAp9$G;wBQLaSO zlyALHVl8-ji~VunMRDL*yv`HTvb^6gp$_PIM?yr{z6z0e>c|52k|RyeKa8A{;&UgB zt)8sIVKbD45(8qi#`Qi9mX^==pV{ zr$P6iuf}|AF=2#uQc|w#FCZ_EFiT9On2QoPzX#>mn5!pvKV2El@fF;C#ITG&??qWp zg!i;48v*0*S#8=?b{?PnW16^aFa?7jA}uCZ!R}?ikx6`kMdjt`!-G>B(D{N8BO2z$Qqr6tm!Jos)6DJO)oLqv3SDQFPQujK?3RD?P=MV>K7U2Ti-i^17 zI;|M;f7b@*x*8XSpET+fJ3pjV{vXZ3TeHxvp&{GgjYh(KWU%XBuf_>Sy2E|@;A{T_ DB;FUa literal 0 HcmV?d00001 From baecdd8162f20abaf62edf81e59f2a7a413013f5 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Thu, 24 Dec 2020 17:42:33 -0600 Subject: [PATCH 043/202] Added the Phosphorescent Gauntlet --- CalPlayer/CalamityPlayerMiscEffects.cs | 4 + Items/Weapons/Melee/PhosphorescentGauntlet.cs | 50 +++++ .../Weapons/Melee/PhosphorescentGauntlet.png | Bin 0 -> 887 bytes NPCs/AcidRain/NuclearTerror.cs | 2 + .../Melee/PhosphorescentGauntletPunches.cs | 176 ++++++++++++++++++ .../Melee/PhosphorescentGauntletPunches.png | Bin 0 -> 3709 bytes 6 files changed, 232 insertions(+) create mode 100644 Items/Weapons/Melee/PhosphorescentGauntlet.cs create mode 100644 Items/Weapons/Melee/PhosphorescentGauntlet.png create mode 100644 Projectiles/Melee/PhosphorescentGauntletPunches.cs create mode 100644 Projectiles/Melee/PhosphorescentGauntletPunches.png diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index b1e6fe4444..51cfe6f693 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -365,6 +365,10 @@ namespace CalamityMod.CalPlayer #region Misc Effects private static void MiscEffects(Player player, CalamityPlayer modPlayer, Mod mod) { + // Dust on hand when holding the phosphorescent gauntlet. + if (player.ActiveItem().type == ModContent.ItemType()) + PhosphorescentGauntletPunches.GenerateDustOnOwnerHand(player); + if (modPlayer.stealthUIAlpha > 0f && (modPlayer.rogueStealth <= 0f || modPlayer.rogueStealthMax <= 0f)) { modPlayer.stealthUIAlpha -= 0.035f; diff --git a/Items/Weapons/Melee/PhosphorescentGauntlet.cs b/Items/Weapons/Melee/PhosphorescentGauntlet.cs new file mode 100644 index 0000000000..e171501e80 --- /dev/null +++ b/Items/Weapons/Melee/PhosphorescentGauntlet.cs @@ -0,0 +1,50 @@ +using CalamityMod.Projectiles.Melee; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Melee +{ + public class PhosphorescentGauntlet : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Phosphorescent Gauntlet"); + Tooltip.SetDefault("Releases rapid sulphurous punches\n" + + "On use, you lunge in the direction of the mouse.\n" + + "On collision, you are knocked back"); + } + + public override void SetDefaults() + { + item.width = item.height = 40; + item.damage = 6460; + item.melee = true; + item.noMelee = true; + item.noUseGraphic = true; + item.channel = true; + item.useAnimation = item.useTime = 40; + item.useTurn = true; + item.useStyle = ItemUseStyleID.SwingThrow; + item.knockBack = 9f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.value = CalamityGlobalItem.RarityPureGreenBuyPrice; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 1f; + item.Calamity().customRarity = CalamityRarity.PureGreen; + } + + // Terraria seems to really dislike high crit values in SetDefaults. + public override void GetWeaponCrit(Player player, ref int crit) => crit += 10; + + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 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) + { + Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); + return false; + } + } +} diff --git a/Items/Weapons/Melee/PhosphorescentGauntlet.png b/Items/Weapons/Melee/PhosphorescentGauntlet.png new file mode 100644 index 0000000000000000000000000000000000000000..a470c6a68d22130593038fc55263f9e1811e681c GIT binary patch literal 887 zcmV--1Bm>IP)Px&F-b&0R9J=Wm`g}hQ5eU6*H>sdgN{ukW-sy)35kJexyVHiG9oN&;i^T@gWjRo zwxlqEB%@8OW>J)c^dgHSTqT8z#8ON1F`AP)iH@RJx5f21oI7{M*N|N7znS};bMN`i z{O))EeD^9WvaUYMFdPqW&jBE!eY+S^0Yd)8rh=)k#Y${IR@KFd(fEJD^N>HXhOy}g z>;FyAbi-8`aDKeLMH~hsd^x{Cnlv5Zpx3YgS&85ti$wuw4b}Yhi~Fkr@W;}p>drU3 z`%9Pb`qgUzcvajA!0ziCC9v#w!1QJXaqfPtYg6`-fj z1Hj3mbm_cJNl&F%5WoG?r439G)hjeE#&Fzpg#Fg=Y-{vDZVCX2Ya#+B>h72Tpt`OZ zfD<3HX0@k__J`7>=?MGOupql3$qK-?&Y^%cI+Fxhy+kh&o|>otgjk}ac|BPn^AZ+h zH>bn`(Aex&!Ix<5yFn=~Is0~DE^P&%_DR2VLGm`)A0NMz-Qmnp*?1fedZoCj%Q>AJpsnlsoHlGa!eLBx zPtj2c0C>h^B0CSp176bVIqhk7p8W;Dp}q2gx9-ctlkI7`lui~RQxXQCFi)%HhDOaL zO3U8>UY9slGSziWJGWjW<&Bqf^4uz`jhDh{{>O&1`tQ}uG0Vj N002ovPDHLkV1mZepoIVc literal 0 HcmV?d00001 diff --git a/NPCs/AcidRain/NuclearTerror.cs b/NPCs/AcidRain/NuclearTerror.cs index 6bbf7312bf..6d676ee1b2 100644 --- a/NPCs/AcidRain/NuclearTerror.cs +++ b/NPCs/AcidRain/NuclearTerror.cs @@ -9,6 +9,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Items.Weapons.Melee; namespace CalamityMod.NPCs.AcidRain { @@ -429,6 +430,7 @@ namespace CalamityMod.NPCs.AcidRain public override void NPCLoot() { DropHelper.DropItemChance(npc, ModContent.ItemType(), 3); + DropHelper.DropItemChance(npc, ModContent.ItemType(), 3); } } } diff --git a/Projectiles/Melee/PhosphorescentGauntletPunches.cs b/Projectiles/Melee/PhosphorescentGauntletPunches.cs new file mode 100644 index 0000000000..92fdab0bb3 --- /dev/null +++ b/Projectiles/Melee/PhosphorescentGauntletPunches.cs @@ -0,0 +1,176 @@ +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using System.Collections.Generic; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Melee +{ + public class PhosphorescentGauntletPunches : ModProjectile + { + public Player Owner => Main.player[projectile.owner]; + public bool HasPerformedLunge + { + get => projectile.ai[0] == 1f; + set + { + int newValue = value.ToInt(); + if (projectile.ai[0] != newValue) + { + projectile.ai[0] = newValue; + projectile.netUpdate = true; + } + } + } + + public ref float Time => ref projectile.ai[1]; + + public const float LungeSpeed = 19f; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Punch"); + Main.projFrames[projectile.type] = 14; + } + + public override void SetDefaults() + { + projectile.scale = 1.6f; + projectile.width = projectile.height = (int)(projectile.scale * 60); + projectile.friendly = true; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.melee = true; + projectile.ownerHitCheck = true; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 12; + projectile.frameCounter = 0; + projectile.Calamity().trueMelee = true; + } + + #region AI + public override void AI() + { + if (!HasPerformedLunge) + PerformLunge(); + + Vector2 topLeft = projectile.Center + projectile.velocity.RotatedBy(-MathHelper.PiOver2) * 40f; + Vector2 topRight = projectile.Center + projectile.velocity.RotatedBy(MathHelper.PiOver2) * 40f; + if (Time >= 8f && !Collision.CanHitLine(topLeft, 8, 8, topRight, 8, 8)) + ReelBack(); + HandleProjectileVisuals(); + HandlePositioning(); + Time++; + } + + internal void PerformLunge() + { + if (Main.myPlayer != projectile.owner) + return; + Owner.velocity = projectile.velocity.SafeNormalize(Vector2.UnitX * Owner.direction) * LungeSpeed; + HasPerformedLunge = true; + } + + internal void ReelBack() + { + Owner.immune = true; + Owner.immuneTime = 15; + + // Create some visual effects. + if (!Main.dedServ) + { + Vector2 topLeft = projectile.Center + projectile.velocity.RotatedBy(-MathHelper.PiOver2) * 40f; + Vector2 top = projectile.Center + projectile.velocity * 70f; + Vector2 topRight = projectile.Center + projectile.velocity.RotatedBy(MathHelper.PiOver2) * 40f; + foreach (Vector2 spawnPosition in new BezierCurve(topLeft, top, topRight).GetPoints(50)) + { + Dust sulphurousAcid = Dust.NewDustPerfect(spawnPosition + projectile.velocity * 16f, (int)CalamityDusts.SulfurousSeaAcid); + sulphurousAcid.velocity = projectile.velocity * 4f; + sulphurousAcid.noGravity = true; + sulphurousAcid.scale = 1.2f; + } + } + if (Main.myPlayer != projectile.owner) + return; + + // Reel back after collision. + Owner.velocity = Vector2.Reflect(Owner.velocity.SafeNormalize(Vector2.Zero), projectile.velocity.SafeNormalize(Vector2.Zero)) * Owner.velocity.Length(); + + // Create on-hit tile dust. + Collision.HitTiles(projectile.position, projectile.velocity, projectile.width + 16, projectile.height + 16); + projectile.Kill(); + } + + internal static void GenerateDustOnOwnerHand(Player player) + { + if (Main.dedServ) + return; + + Vector2 handOffset = Main.OffsetsPlayerOnhand[player.bodyFrame.Y / 56] * 2f; + if (player.direction != 1) + handOffset.X = player.bodyFrame.Width - handOffset.X; + if (player.gravDir != 1f) + handOffset.Y = player.bodyFrame.Height - handOffset.Y; + + handOffset -= new Vector2(player.bodyFrame.Width - player.width, player.bodyFrame.Height - player.height) / 2f; + Vector2 rotatedHandPosition = player.RotatedRelativePoint(player.position + handOffset, true); + for (int i = 0; i < 4; i++) + { + Dust dust = Dust.NewDustDirect(player.Center, 0, 0, (int)CalamityDusts.SulfurousSeaAcid, 0f, 0f, 150, default, 1.3f); + dust.position = rotatedHandPosition; + dust.velocity = Vector2.Zero; + dust.noGravity = true; + dust.fadeIn = 1f; + dust.velocity += player.velocity; + if (Main.rand.NextBool(2)) + { + dust.position += Utils.RandomVector2(Main.rand, -4f, 4f); + dust.scale += Main.rand.NextFloat(); + } + } + } + + internal void HandleProjectileVisuals() + { + float velocityAngle = projectile.velocity.ToRotation(); + projectile.rotation = velocityAngle + MathHelper.Pi; + projectile.frameCounter++; + if (projectile.frameCounter % 3 == 2) + { + projectile.frame++; + + // Die at the end of the final punch. + if (projectile.frame >= Main.projFrames[projectile.type]) + projectile.Kill(); + } + } + + internal void HandlePositioning() + { + projectile.Center = Owner.RotatedRelativePoint(Owner.MountedCenter); + projectile.Center += projectile.velocity.SafeNormalize(Vector2.UnitX * Owner.direction) * 30f; + } + #endregion + + #region Drawing + + // Manual drawing is used to correct the origin of the projectile when drawn. + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D punchTexture = ModContent.GetTexture(Texture); + Rectangle frame = punchTexture.Frame(1, Main.projFrames[projectile.type], 0, projectile.frame); + Vector2 origin = frame.Size() * 0.5f; + SpriteEffects directionEffect = projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + spriteBatch.Draw(punchTexture, projectile.Center - Main.screenPosition, frame, lightColor, projectile.rotation, origin, projectile.scale, directionEffect, 0f); + return false; + } + #endregion + + #region NPC Hit Collision Logic + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) => ReelBack(); + #endregion + } +} diff --git a/Projectiles/Melee/PhosphorescentGauntletPunches.png b/Projectiles/Melee/PhosphorescentGauntletPunches.png new file mode 100644 index 0000000000000000000000000000000000000000..ae775bc14a229f92addd73911063f9b7f678fb4e GIT binary patch literal 3709 zcmb7{XH-+&m&R`dv7!=rMQKV%A}>`#Q#lv)I{SHk&n2F>G8Nw`y%PWc zaWo2PBU}*xAcEa4CVUbAp={v-3bHXZ2I#G_;{dQn7mYk)8!q|D zpMvxTsbj?4= zR~D56T?ON^z{6%3pd%&%RLrdgD%2=Skuv<1N1ls32hwch#EvXo*&cb9a|76z`_v!g zA9#dYxl8qW-(_@+_?|7-LkLyFr>bX@(Ln3>O`qm%r}-TOfQ}c~PObb(Sp`Z5KO_JH zf!sDwzCs9ncp;{m=m<8ir{o74^?LJUtvFDAWzb_LJ*~H_lwpHmsd40TqD3vCk{=w znb)25MQd3O%q2g<=?|O@Ht`%RNqz&W*;Ssm^L2sL8$u`+=R%)ep`rvo;}nd18=p=Z z6hME$pYngLYJl?ByEnI-Pkgx(xR;#^JQzGW!L=Ukrt1<#@!r8vEdlTBthNCWmU1F` z*6G{|bjB3ReW1e9XpVY}2Thl<(aP4q&Q8(2GzV+vj*^$}Ytjz|pgiChEDvhqrb{5U zyfyau6t*oGQ|8>3t+oO6NF7jTeDqDbVX>J<=Hf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Law`nAY*SDr5GZ{&#HJSDselQ-Cx*gj}ER+KK#%)_Ntfx>;=dKIzJw(L56C zBM!lG)Gc9*&*G^lca~MR+b8w|SNQ6xPWIXbi2m^V6aHV$)#V|h^SL-;hllp~NvYNT zAxlV<$M1I=CvwH literal 0 HcmV?d00001 From 0610f0cf36a9deb4ffd5ad34870d3be4aa21aba0 Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 25 Dec 2020 12:44:45 -0600 Subject: [PATCH 044/202] Sped up some reflection --- Utilities/CalamityUtils.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index d9c1f5fdef..ffaf987d64 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -3803,10 +3803,17 @@ namespace CalamityMod return Color.Lerp(currentColor, nextColor, increment * colors.Length % 1f); } - // TODO: Find some way to speed this up. + // Cached for efficiency purposes. + internal static readonly FieldInfo UImageField = typeof(MiscShaderData).GetField("_uImage", BindingFlags.NonPublic | BindingFlags.Instance); + + ///