From 859cb39d0d25abcb77b298450fb8cc6dba95732e Mon Sep 17 00:00:00 2001 From: DominicKarma42 <51094361+DominicKarma@users.noreply.github.com> Date: Mon, 8 Jun 2020 18:52:46 -0500 Subject: [PATCH 1/6] Ultima and Yanmei's Knife (also base laserbeam) --- Buffs/StatBuffs/KamiBuff.cs | 25 +++ Buffs/StatBuffs/KamiBuff.png | Bin 0 -> 423 bytes Buffs/StatDebuffs/KamiDebuff.cs | 33 ++++ Buffs/StatDebuffs/KamiDebuff.png | Bin 0 -> 514 bytes CalPlayer/CalamityPlayer.cs | 46 ++++- CalPlayer/CalamityPlayerMiscEffects.cs | 16 +- CalamityMod.cs | 108 ++++++++++- ExtraTextures/Lasers/UltimaRayEnd.png | Bin 0 -> 334 bytes ExtraTextures/Lasers/UltimaRayMid.png | Bin 0 -> 227 bytes ExtraTextures/Lasers/UltimaRayStart.png | Bin 0 -> 292 bytes Items/Weapons/Melee/YanmeisKnife.cs | 68 +++++++ Items/Weapons/Melee/YanmeisKnife.png | Bin 0 -> 930 bytes Items/Weapons/Ranged/Ultima.cs | 70 ++++++++ Items/Weapons/Ranged/Ultima.png | Bin 0 -> 2698 bytes NPCs/CalamityGlobalNPC.cs | 16 ++ .../BaseLaserbeamProjectile.cs | 169 ++++++++++++++++++ Projectiles/Melee/YanmeisKnifeSlash.cs | 114 ++++++++++++ Projectiles/Melee/YanmeisKnifeSlash.png | Bin 0 -> 1646 bytes Projectiles/Ranged/UltimaBolt.cs | 112 ++++++++++++ Projectiles/Ranged/UltimaBolt.png | Bin 0 -> 437 bytes Projectiles/Ranged/UltimaBowProjectile.cs | 108 +++++++++++ Projectiles/Ranged/UltimaBowProjectile.png | Bin 0 -> 1951 bytes Projectiles/Ranged/UltimaRay.cs | 51 ++++++ Projectiles/Ranged/UltimaRay.png | Bin 0 -> 135 bytes Projectiles/Ranged/UltimaSpark.cs | 91 ++++++++++ Projectiles/Ranged/UltimaSpark.png | Bin 0 -> 131 bytes Utilities/CalamityUtils.cs | 14 ++ 27 files changed, 1033 insertions(+), 8 deletions(-) create mode 100644 Buffs/StatBuffs/KamiBuff.cs create mode 100644 Buffs/StatBuffs/KamiBuff.png create mode 100644 Buffs/StatDebuffs/KamiDebuff.cs create mode 100644 Buffs/StatDebuffs/KamiDebuff.png create mode 100644 ExtraTextures/Lasers/UltimaRayEnd.png create mode 100644 ExtraTextures/Lasers/UltimaRayMid.png create mode 100644 ExtraTextures/Lasers/UltimaRayStart.png create mode 100644 Items/Weapons/Melee/YanmeisKnife.cs create mode 100644 Items/Weapons/Melee/YanmeisKnife.png create mode 100644 Items/Weapons/Ranged/Ultima.cs create mode 100644 Items/Weapons/Ranged/Ultima.png create mode 100644 Projectiles/BaseProjectiles/BaseLaserbeamProjectile.cs create mode 100644 Projectiles/Melee/YanmeisKnifeSlash.cs create mode 100644 Projectiles/Melee/YanmeisKnifeSlash.png create mode 100644 Projectiles/Ranged/UltimaBolt.cs create mode 100644 Projectiles/Ranged/UltimaBolt.png create mode 100644 Projectiles/Ranged/UltimaBowProjectile.cs create mode 100644 Projectiles/Ranged/UltimaBowProjectile.png create mode 100644 Projectiles/Ranged/UltimaRay.cs create mode 100644 Projectiles/Ranged/UltimaRay.png create mode 100644 Projectiles/Ranged/UltimaSpark.cs create mode 100644 Projectiles/Ranged/UltimaSpark.png diff --git a/Buffs/StatBuffs/KamiBuff.cs b/Buffs/StatBuffs/KamiBuff.cs new file mode 100644 index 0000000000..0e89d7656b --- /dev/null +++ b/Buffs/StatBuffs/KamiBuff.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.StatBuffs +{ + public class KamiBuff : ModBuff + { + public const float RunSpeedBoost = 0.2f; + public const float RunAccelerationBoost = 0.4f; + public override void SetDefaults() + { + DisplayName.SetDefault("Kami Injection"); + Description.SetDefault("Increased defense, movement speed, and damage"); + Main.debuff[Type] = false; + Main.pvpBuff[Type] = true; + Main.buffNoSave[Type] = true; + longerExpertDebuff = false; + } + + public override void Update(Player player, ref int buffIndex) + { + player.Calamity().kamiBoost = true; + } + } +} diff --git a/Buffs/StatBuffs/KamiBuff.png b/Buffs/StatBuffs/KamiBuff.png new file mode 100644 index 0000000000000000000000000000000000000000..4fdc0fff94bdb960374f706ae2e70a8ec1e4650b GIT binary patch literal 423 zcmV;Y0a*TtP)Px$VM#^2fihtm2d*x4T9;x?Lxj@FPbFu4kSqe z%$2=ee*myPxvRWUCt)40o2~+Lr;4HgB5=S=Lcin5>|86cl2AJ*d<*e8APT%vEBg(2 z#c9|j-WkP@#{ub2-?xT>x_4^vq$cD!MRYmvP>zEO`&(y~H|U%Y=swrDRP({MI|3qb zz}JAD-DJml7SzfGy2_hQ$?-T~!J2|C2(RgE7{3D+^w+PcLmI6+;QsvI@h8KslGq8- RJD30f002ovPDHLkV1jW6x4i%W literal 0 HcmV?d00001 diff --git a/Buffs/StatDebuffs/KamiDebuff.cs b/Buffs/StatDebuffs/KamiDebuff.cs new file mode 100644 index 0000000000..d554fa2441 --- /dev/null +++ b/Buffs/StatDebuffs/KamiDebuff.cs @@ -0,0 +1,33 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.StatDebuffs +{ + public class KamiDebuff : ModBuff + { + public const float MultiplicativeDamageReduction = 0.8f; + public const float MaxNPCSpeed = 16f; // Hard-cap for npc speed when afflicted with this debuff. Does not affect certain NPCs and does not affect any bosses (Basically only works on boss minions). + public override void SetDefaults() + { + DisplayName.SetDefault("Kami Flu"); + Description.SetDefault("Defenseless and dying"); + Main.debuff[Type] = true; + Main.pvpBuff[Type] = true; + Main.buffNoSave[Type] = false; + longerExpertDebuff = false; + } + + public override void Update(NPC npc, ref int buffIndex) + { + if (npc.Calamity().kamiFlu < npc.buffTime[buffIndex]) + npc.Calamity().kamiFlu = npc.buffTime[buffIndex]; + npc.DelBuff(buffIndex); + buffIndex--; + } + + public override void Update(Player player, ref int buffIndex) + { + player.Calamity().teslaFreeze = true; + } + } +} diff --git a/Buffs/StatDebuffs/KamiDebuff.png b/Buffs/StatDebuffs/KamiDebuff.png new file mode 100644 index 0000000000000000000000000000000000000000..df7af84f98f90a69d302de53616ccbc0d1bcf0bc GIT binary patch literal 514 zcmV+d0{#7oP)Px$yh%hsR9J=Omp@1XQ5?rVS1lreE)g_DGz3M^64)PXkO+#lz&#`yn%i1*46>jI z#IdE;mLv?45+Q^va*Jw+qD3J>8p4LVUvN*)KLqxq@AB^6`@OsSe%`;|83T)B06ZLD zmuaEg!-EDuM=M`iO$JZ~2)%6o>OrAi7Xb0s5&-Ey%+~(7G-JEJ5AOpS5a{~t1Du?T zW6xYC04^)OnE0~w*N1>OagsPx;@p2_yF2@705c5*}l4UP_@HZY|p%iga8O`#LZFyqGqvvGStuq=tDpxb0Hj9 zu+^Vu?*ItwZUT_Jc?94oVz&2NB>eBER*yCzP>~U-d%k)`2Vphd*9_+ z%@=2U z9hni0?r^HqY*?f(0a3lvE!90+v)#$L=+6ll|Nigz8&FP%)cpX?WdHyG07*qoM6N<$ Ef}Wq?Q~&?~ literal 0 HcmV?d00001 diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 72962abe04..d78d7316c0 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -99,6 +99,9 @@ namespace CalamityMod.CalPlayer public Projectile lastProjectileHit; public double acidRoundMultiplier = 1D; public int waterLeechTarget = -1; + public float KameiTrailXScale = 0.1f; + public int KameiBladeUseDelay = 0; + public Vector2[] KameiOldPositions = new Vector2[4]; #endregion #region External variables -- Only set by Mod.Call @@ -793,6 +796,7 @@ namespace CalamityMod.CalPlayer public bool hallowedDefense = false; public bool hallowedPower = false; public bool hallowedRegen = false; + public bool kamiBoost = false; #endregion #region Minion @@ -1515,6 +1519,7 @@ namespace CalamityMod.CalPlayer hallowedDefense = false; hallowedRegen = false; hallowedPower = false; + kamiBoost = false; IBoots = false; elysianFire = false; sTracers = false; @@ -2034,6 +2039,7 @@ namespace CalamityMod.CalPlayer rRage = false; xRage = false; xWrath = false; + kamiBoost = false; graxDefense = false; encased = false; sMeleeBoost = false; @@ -2220,6 +2226,7 @@ namespace CalamityMod.CalPlayer elysianGuard = false; #endregion + KameiBladeUseDelay = 0; lastProjectileHit = null; if (CalamityWorld.bossRushActive) @@ -3535,6 +3542,7 @@ namespace CalamityMod.CalPlayer ((frostFlare && player.statLife < (int)(player.statLifeMax2 * 0.25)) ? 0.15f : 0f) + (auricSet ? 0.1f : 0f) + (dragonScales ? 0.1f : 0f) + + (kamiBoost ? KamiBuff.RunAccelerationBoost : 0f) + (cTracers ? 0.1f : 0f) + (silvaSet ? 0.05f : 0f) + (eTracers ? 0.05f : 0f) + @@ -3554,6 +3562,7 @@ namespace CalamityMod.CalPlayer (cTracers ? 0.1f : 0f) + (silvaSet ? 0.05f : 0f) + (eTracers ? 0.05f : 0f) + + (kamiBoost ? KamiBuff.RunSpeedBoost : 0f) + (etherealExtorter && player.ZoneBeach ? 0.05f : 0f) + (stressPills ? 0.05f : 0f) + (laudanum && horror ? 0.1f : 0f) + @@ -8581,10 +8590,40 @@ namespace CalamityMod.CalPlayer { if (drawInfo.shadow != 0f) return; - Player drawPlayer = drawInfo.drawPlayer; Item item = drawPlayer.ActiveItem(); + // Kamei trail/afterimage effect. + if (drawPlayer.Calamity().kamiBoost) + { + for (int i = drawPlayer.Calamity().KameiOldPositions.Length - 1; i > 0; i--) + { + if (drawPlayer.Calamity().KameiOldPositions[i - 1] == Vector2.Zero) + drawPlayer.Calamity().KameiOldPositions[i - 1] = drawPlayer.position; + drawPlayer.Calamity().KameiOldPositions[i] = drawPlayer.Calamity().KameiOldPositions[i - 1]; + } + drawPlayer.Calamity().KameiOldPositions[0] = drawPlayer.position; + + List existingDrawData = Main.playerDrawData; + for (int i = 0; i < drawPlayer.Calamity().KameiOldPositions.Length; i++) + { + float scale = MathHelper.Lerp(1f, 0.5f, i / (float)drawPlayer.Calamity().KameiOldPositions.Length); + float opacity = MathHelper.Lerp(0.25f, 0.08f, i / (float)drawPlayer.Calamity().KameiOldPositions.Length); + List afterimage = new List(); + for (int j = 0; j < existingDrawData.Count; j++) + { + var drawData = existingDrawData[j]; + drawData.position = existingDrawData[j].position - drawPlayer.position + drawPlayer.oldPosition; + drawData.color = Color.Cyan * opacity; + drawData.color.G = (byte)(drawData.color.G * 1.6); + drawData.color.B = (byte)(drawData.color.B * 1.2); + drawData.scale = new Vector2(scale); + afterimage.Add(drawData); + } + Main.playerDrawData.InsertRange(0, afterimage); + } + } + if (!drawPlayer.frozen && item.type > ItemID.None && !drawPlayer.dead && @@ -8744,6 +8783,7 @@ namespace CalamityMod.CalPlayer } } }); + public override void ModifyDrawInfo(ref PlayerDrawInfo drawInfo) { if (drawInfo.shadow != 0f) @@ -9143,8 +9183,8 @@ namespace CalamityMod.CalPlayer public override void DrawEffects(PlayerDrawInfo drawInfo, ref float r, ref float g, ref float b, ref float a, ref bool fullBright) { - // Dust modifications while high - if (trippy) + // Dust modifications while high + if (trippy) { if (Main.myPlayer == player.whoAmI) { diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 393c2b1b26..42788cabc2 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -336,8 +336,8 @@ namespace CalamityMod.CalPlayer { player.Calamity().andromedaState = AndromedaPlayerState.Inactive; } - - if (player.Calamity().andromedaState == AndromedaPlayerState.LargeRobot) + + if(player.Calamity().andromedaState == AndromedaPlayerState.LargeRobot) { player.width = 152; player.height = 212; @@ -892,6 +892,8 @@ namespace CalamityMod.CalPlayer // Cooldowns and timers if (modPlayer.gainRageCooldown > 0) modPlayer.gainRageCooldown--; + if (modPlayer.KameiBladeUseDelay > 0) + modPlayer.KameiBladeUseDelay--; if (modPlayer.galileoCooldown > 0) modPlayer.galileoCooldown--; if (modPlayer.soundCooldown > 0) @@ -1123,8 +1125,14 @@ namespace CalamityMod.CalPlayer player.endurance += 0.07f; } - // Absorber bonus - if (modPlayer.absorber) + if (modPlayer.kamiBoost) + { + player.allDamage += 0.3f; + player.statDefense += 20; + } + + // Absorber bonus + if (modPlayer.absorber) { player.moveSpeed += 0.12f; player.jumpSpeedBoost += 1.2f; diff --git a/CalamityMod.cs b/CalamityMod.cs index 717d20194b..012013d1ab 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -203,6 +203,7 @@ namespace CalamityMod public static List angryBonesList; public static List hornetList; public static List mossHornetList; + public static List bossMinionList; public static List legOverrideList; @@ -427,6 +428,7 @@ namespace CalamityMod angryBonesList = null; hornetList = null; mossHornetList = null; + bossMinionList = null; legOverrideList = null; @@ -644,7 +646,10 @@ namespace CalamityMod ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), - ModContent.ProjectileType() + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), // Because of potential dust lag. + ModContent.ProjectileType() }; projectileDestroyExceptionList = new List() @@ -2440,6 +2445,107 @@ namespace CalamityMod NPCID.GiantMossHornet }; + bossMinionList = new List() + { + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + NPCID.SlimeSpiked, + NPCID.ServantofCthulhu, + ModContent.NPCType(), + NPCID.EaterofWorldsHead, + NPCID.EaterofWorldsBody, + NPCID.EaterofWorldsTail, + NPCID.Creeper, + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + NPCID.SkeletronHand, + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + NPCID.LeechHead, + NPCID.LeechBody, + NPCID.LeechTail, + NPCID.WallofFleshEye, + NPCID.TheHungry, + NPCID.TheHungryII, + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + NPCID.PrimeCannon, + NPCID.PrimeLaser, + NPCID.PrimeSaw, + NPCID.PrimeVice, + ModContent.NPCType(), + NPCID.TheDestroyer, + NPCID.TheDestroyerBody, + NPCID.TheDestroyerTail, + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + NPCID.PlanterasTentacle, + ModContent.NPCType(), + NPCID.Spore, + NPCID.GolemHead, + NPCID.GolemHeadFree, + NPCID.GolemFistLeft, + NPCID.GolemFistRight, + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + NPCID.CultistDragonHead, + NPCID.CultistDragonBody1, + NPCID.CultistDragonBody2, + NPCID.CultistDragonBody3, + NPCID.CultistDragonBody4, + NPCID.CultistDragonTail, + NPCID.AncientCultistSquidhead, + NPCID.MoonLordFreeEye, + NPCID.MoonLordHand, + NPCID.MoonLordHead, + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType(), + ModContent.NPCType() + }; + Mod thorium = ModLoader.GetMod("ThoriumMod"); if (CalamityConfig.Instance.BuffThoriumBosses && thorium != null) { diff --git a/ExtraTextures/Lasers/UltimaRayEnd.png b/ExtraTextures/Lasers/UltimaRayEnd.png new file mode 100644 index 0000000000000000000000000000000000000000..26fefb2eb4e34012b49ff899de59c1b9444b8a1c GIT binary patch literal 334 zcmeAS@N?(olHy`uVBq!ia0vp^Qa~)m!3HGnb@XfnQjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`ISV`@iy0XB4ude`@%$AjK*7hJE{-7{-e;#8@--U>uqcWyTCiY4MU(fx z|6E@48ZY*#G`-biT;fuIHEUFRr~WxZmmc=kFaCRF>DbzA`vptLI9s%eioukeQQ$o&LECE;LeI e-eRGt)g|r5(NU6MxGNs$T?S8AKbLh*2~7ZbF^hEo literal 0 HcmV?d00001 diff --git a/ExtraTextures/Lasers/UltimaRayMid.png b/ExtraTextures/Lasers/UltimaRayMid.png new file mode 100644 index 0000000000000000000000000000000000000000..9a13aa9d6be3822e577491a2ec9e58676980c977 GIT binary patch literal 227 zcmeAS@N?(olHy`uVBq!ia0vp^Qa~)n!3HFaZu8v$QjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`ISV`@iy0XB4ude`@%$AjK*0)67sn6}@8pyNjCwIUKFGUpb8`7HXnCyVc2LVXJw}())VDoCb6|6 z$Dl;#*O!;V62eSC*(1AV2uRr2Nv-WKXk7SMIqBdE*A(V1T`Aqy89Wja3=^&^+1zHV Rjs&`a!PC{xWt~$(696p`MNR+! literal 0 HcmV?d00001 diff --git a/ExtraTextures/Lasers/UltimaRayStart.png b/ExtraTextures/Lasers/UltimaRayStart.png new file mode 100644 index 0000000000000000000000000000000000000000..6ebfb4d0e7e58126fddc4df64724ea829d6868f2 GIT binary patch literal 292 zcmeAS@N?(olHy`uVBq!ia0vp^Qa~)m!3HGnb@XfnQjEnx?oJHr&dIz4a#+$GeH|GX zHuiJ>Nn{1`ISV`@iy0XB4ude`@%$AjK*61!E{-7{-e;#6@*P&-am`d$V{1Dj)A)OS zld^%afq}xduz#z>LsHtro_k)Ko~r%f@e%&bo?b6qv(~!W9cwryv3=ghKQHbJ<{$Rk z^Zmr!;tSWLwp`7b?Z)$}iECg-2+(p%x8$+~OS z)PFrc?!H(0`r7)J=`Z$+^8Sv}4ciZx?>P5Y`-|+?dxE(); + item.shootSpeed = 24f; + item.Calamity().customRarity = CalamityRarity.Dedicated; + } + + public override bool CanUseItem(Player player) + { + if (player.Calamity().KameiBladeUseDelay > 0) + return false; + return base.CanUseItem(player); + } + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + player.Calamity().KameiBladeUseDelay = 180; + Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f); + return false; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.PsychoKnife); + recipe.AddIngredient(ItemID.Obsidian, 10); + recipe.AddIngredient(ItemID.IronBar, 20); + recipe.AddIngredient(ModContent.ItemType(), 50); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Weapons/Melee/YanmeisKnife.png b/Items/Weapons/Melee/YanmeisKnife.png new file mode 100644 index 0000000000000000000000000000000000000000..36c6bc6c069eeaf9179745b0823af6e779971d31 GIT binary patch literal 930 zcmV;T16}-yP)Px&TuDShRA_$=d*J)lmReY@g{mKO= z78WsQcd*_?6+mEWuHAdyfr{OF!UsJ}DZA$S;l2~@U!l3ASATYP4cx@5df7e17KW#tlgR#HV{_99Rkcq-_ zj?JByrNF3Z8({Q#cUg(ZIg1`WKP605tAD31pJ6{AbJh)C$0_qVc+Tx84ML$u|8o*8Q#7ueHYO(j8LO zt|W7Wt(rG_gVI?>H`ujpF94S=-Zthhp1TnES6pgYlB#wkBVV{M90owOb^s7NeF1<~ z>ox-Lp!TsbUu2ze$}TUR1HkIdn-swH#*eP+d?)PrJS?)oU=VZx^&7X|t6vf5U6hP5%mar_qyKH`5o&xyMrJw8!R?cgDDGa2)gAKQ=#CO7~FdXjl^wpUho!#Jn z%SwDF90&%3`VQ3I-scna;g*&7PdFZr1K?G9xZ^wFKkJ)m!<$mScK`qY07*qoM6N<$ Ef{Ze^I{*Lx literal 0 HcmV?d00001 diff --git a/Items/Weapons/Ranged/Ultima.cs b/Items/Weapons/Ranged/Ultima.cs new file mode 100644 index 0000000000..f51f49efef --- /dev/null +++ b/Items/Weapons/Ranged/Ultima.cs @@ -0,0 +1,70 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables.Ores; +using CalamityMod.Projectiles.Ranged; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Ranged +{ + public class Ultima : ModItem + { + public const float FullChargeTime = 420f; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ultima"); + Tooltip.SetDefault("Casts a continuous stream of plasma bolts\n" + + "Over time the bolts are replaced with powerful lasers\n" + + "Bolts power up into solid beams as you continue shooting\n" + + "90% chance to not consume ammo"); + } + + public override void SetDefaults() + { + item.damage = 210; + item.ranged = true; + item.width = 44; + item.height = 58; + item.useTime = item.useAnimation = 3; + item.useStyle = ItemUseStyleID.HoldingOut; + item.noMelee = true; + item.knockBack = 2f; + item.value = CalamityGlobalItem.RarityVioletBuyPrice; + item.rare = 10; + item.UseSound = SoundID.Item33; + item.autoReuse = true; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 18f; + item.useAmmo = AmmoID.Arrow; + item.channel = true; + item.useTurn = false; + item.autoReuse = true; + item.noUseGraphic = true; + item.Calamity().customRarity = CalamityRarity.Dedicated; + } + + 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).SafeNormalize(Vector2.UnitX * player.direction), ModContent.ProjectileType(), 0, 0f, player.whoAmI); + return false; + } + + public override bool ConsumeAmmo(Player player) => Main.rand.Next(0, 100) >= 90; + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.PulseBow); + recipe.AddIngredient(ItemID.LaserRifle); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddIngredient(ModContent.ItemType(), 15); + recipe.AddIngredient(ModContent.ItemType(), 15); + recipe.AddTile(ModContent.TileType()); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Weapons/Ranged/Ultima.png b/Items/Weapons/Ranged/Ultima.png new file mode 100644 index 0000000000000000000000000000000000000000..bf77665303f634ce66c3f270b7c97106d1306294 GIT binary patch literal 2698 zcmXArcU)6f8^X^VFaML|@>_srk^{iB7Q4i1l{kNfp>X%dnI|Vv)*uy?pTwRRok5AcejsdP6^DKz zW^^jv;d6mXNLB$p-)|SkA}wk?ipn9(jv4ZnOs0*(W(n@^*DQFjoo++OWDEq1I=AyU zAjP`5UK3Qpb~!=vu85`LcM`BSnkHM3KNo8&?0s2jQ=h1h(HIy>9;g({?GB#G$KKHS zAeBsY{^Ti=TU#?CQb%KQ^M-Hm$_i~4MjJ1Sx@qOXtg5#8$MS3aKmT`Nz9_O3+|xL_(( z%Wa8Jgr(z~opp3?MGZCXmB`7H*P)ZJcefpnHQrn{1F%KSKI8mBCSjX+&6T%TFaQ5_ z3ljGdu-prlx`i9#897bsId$sQ4A9{~#9DO*@s9To%I3)deo=4M-~7ohbK%|bNfl-R!a(1BCod`@%E&~=!kF0{ZBRVIkhV9jU?1xuv> z;eS^qo{9N1T8Or8Zxg{Ln6K0DERD3Vk|M%a-{mypm^fPE(|BuvLP+HY-mLHbfP8tO zL95#}W6<{r6olP30|VSVf>bddoO(dS>+~}iTikgT{<)7HSNU(u<=Cd#kppA%XVU30 zujz%(*;LV7FG!H_i42w0RNLt=7tC{smssxg3vWx>yJ@VK586gnt8}Y1_cih#_w3tA zruY=7>rpbz0*8^(xY3Y4ny9Xmujf;60qDfKN38nUSibrZK zT|^G4ZuQFoPTK92%b0MxMA=FL&k7hG_DxY_F%1wsQV`WzCB{g^CPP2Zp!LRUzn;3W zo20Nb%M*%P-5_lOKq`x#@BM97oXTH6h?`5;uGo`7txIXDFGVJ~M#+u6l(;(RU zNSJ^N4aP9rRRCs&QRNc2q6tIh>M>wVHYKk!1~XJ99?Owc1h*SS-SY30@}>LN_tdMn z;7~6F3PX#M|IF{8kA4UM-u2RIiuq^Mj_FTpT`7FFZKjJT<5EvGFL9 z&*k*MAWEXR0V9a)eEj0#dj~U_<`y5O{;GJQU3x>*b>r-mw=>C}EL>hZV=>_jBqIY7 z5#M4@wVKC+O{U!^rw@2;8?26I#v4cQ2O;B>+izV}4Fg=jX^3F6>R|3!Z`ZH&=k(A~ zh}~#K&B#rgjzZ54?*4JFV-fViD0$vVZcD|uTof_9K{7;=n5sN@)gW@UF$Ma_1pu}D3qAqvezmKF)3qH+fI z&I^_nA6IVS*g^3v2{J2<##yly8hp!Oyot_V1V4&U_Wx9Gsbr6#D0|)*MB7w+f6%fk zJV$xvuJ-PB<>bVjYMzsnz|mKu)tqu3NQX4pBc}EU(XmzdX0VjsWmHwgrf)d&KK(xK zuUYR~sEx*O$EB)*@_uVJ1-W^-f!-K}cXyGK*UqVN@zO)4{4emJAqQUhfC%@F{#qSF z_}i${3y@C4(&r1j{J%Ha$~jOg#L4wcw4gZs0)g!X%vi4G>$5Fb3k_|vKkhC+8PWP+ z`nzILQq}3V3%lt8;#K7XpHUax%jIsJy3%jj&S0isk5zT74Xs2jZ10us3w`5ADAzA& zQR=)b#al<_g#omJxk#&wx|i^j6dW<;pEr^9b3F$6*QKL}9-GYxB6q_V%1V{M#?nGD zf%}q=;x0^wUk6Y|JP!0lHCK@g?C8ZbfB4EhfzUP{p zy*7GM5NulB6^ST%QQee8N3ueC~7VrnF?G&nufx| zz&GD!QsnG3vIn%Z)w11GZzyljq#2$+Hu_%7)}{q@$vhmdOccM9Gdyb|eu4BMycViy zV6}OLA8q|?xxy1$F%zC&8D^&$4N2980Td#ofM16?>_6=ca`$??W23a1ynarvm@)=V z3Vzz-hNgwGO{%CREe!!76%8wYjq}Zer5*_4GIJ6;_&^f|a>y=$_D7$qDaU(MSuoyt z?D9|Jc}?yDY>#X16^2!3MMhoI2rEtvvV#(5EOYcxf!@S+I>~Z>%U<~A%+kJEvk(nZ zoY?^~Yg9Wbh=wl-GUVhm7t7#_#nwZSYN5AYx7oTc4Nm_pyfgWjL=>81JbrmSzsIkw zZApHA>mbE51*c0BaZ2dq$vmv+W<<`O&e{?5`jr-vL@U8QR(OuAys>4m?J=ihczE(W zTYqog!g~hJ8C%_Ti}Jb1V8qwWOn3O+Fcwi^$0nGXotR{P%RQh1N%&~GSKX`%{odO{ zxQndV^v=MXCOe;>ja$cxGU$HwK<1l}EH$o)c`a(i%Br q68%&=Jw3u$%C5!baq>OqJ;@oF6whaV#0 0) calcDR *= 0.75f; + if (npc.Calamity().kamiFlu > 0) + calcDR *= KamiDebuff.MultiplicativeDamageReduction; // Ichor supersedes Cursed Inferno if both are applied. if (npc.ichor) @@ -3152,6 +3156,8 @@ namespace CalamityMod.NPCs clamDebuff--; if (sulphurPoison > 0) sulphurPoison--; + if (kamiFlu > 0) + kamiFlu--; if (relicOfResilienceCooldown > 0) relicOfResilienceCooldown--; if (relicOfResilienceWeakness > 0) @@ -3163,6 +3169,11 @@ namespace CalamityMod.NPCs if (npc.boss || CalamityMod.movementImpairImmuneList.Contains(npc.type)) return; + if (kamiFlu > 0) + { + npc.velocity = Vector2.Clamp(npc.velocity, new Vector2(-KamiDebuff.MaxNPCSpeed), new Vector2(KamiDebuff.MaxNPCSpeed)); + } + if (!CalamityPlayer.areThereAnyDamnBosses) { if (pearlAura > 0) @@ -4517,6 +4528,11 @@ namespace CalamityMod.NPCs return new Color(200, 50, 50, npc.alpha); } + if (npc.Calamity().kamiFlu > 0) + { + return new Color(51, 197, 108, npc.alpha); + } + return null; } diff --git a/Projectiles/BaseProjectiles/BaseLaserbeamProjectile.cs b/Projectiles/BaseProjectiles/BaseLaserbeamProjectile.cs new file mode 100644 index 0000000000..2bdecf4355 --- /dev/null +++ b/Projectiles/BaseProjectiles/BaseLaserbeamProjectile.cs @@ -0,0 +1,169 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.Enums; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.BaseProjectiles +{ + public abstract class BaseLaserbeamProjectile : ModProjectile + { + public float RotationalSpeed + { + get => projectile.ai[0]; + set => projectile.ai[0] = value; + } + public float Time + { + get => projectile.localAI[0]; + set => projectile.localAI[0] = value; + } + public float LaserLength + { + get => projectile.localAI[1]; + set => projectile.localAI[1] = value; + } + public virtual void Behavior() + { + // 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. + projectile.velocity = projectile.velocity.SafeNormalize(-Vector2.UnitY); + + Time++; + if (Time >= Lifetime) + { + projectile.Kill(); + return; + } + + DetermineScale(); + + UpdateLaserMotion(); + + float idealLaserLength = DetermineLaserLength(); + LaserLength = MathHelper.Lerp(LaserLength, idealLaserLength, 0.9f); // Very quickly approach the ideal laser length. + + DelegateMethods.v3_1 = LightCastColor.ToVector3(); + Utils.PlotTileLine(projectile.Center, projectile.Center + projectile.velocity * LaserLength, projectile.width * projectile.scale, new Utils.PerLinePoint(DelegateMethods.CastLight)); + } + public virtual void UpdateLaserMotion() + { + // This part is rather complicated at a glance. + // What it's doing is converting the velocity to an angle, doing something with that angle, and changing it back into the velocity. + // In this case, "doing something with that angle" means incrementing it by a constant. + // You could attempt to make it intelligent by having it move towards the target like the Last Prism, but that's not done here. + // This allows one to cause an arcing motion. + + float updatedVelocityDirection = projectile.velocity.ToRotation() + RotationalSpeed; + projectile.rotation = updatedVelocityDirection - MathHelper.PiOver2; // Pretty much all lasers have a vertical sheet. + projectile.velocity = updatedVelocityDirection.ToRotationVector2(); + } + public virtual void DetermineScale() + { + projectile.scale = (float)Math.Sin(Time / Lifetime * MathHelper.Pi) * 6f * MaxScale; + if (projectile.scale > MaxScale) + { + projectile.scale = MaxScale; + } + } + public virtual void AttachToSomething() { } // Does nothing by default. + public virtual float DetermineLaserLength() => MaxLaserLength; // Go with the default length and ignore any obstacles by default. + public virtual void ExtraBehavior() { } + public override void AI() + { + Behavior(); + ExtraBehavior(); + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + // This should never happen, but just in case- + 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); + } + return false; + } + public override void CutTiles() + { + DelegateMethods.tilecut_0 = TileCuttingContext.AttackMelee; + Utils.PlotTileLine(projectile.Center, projectile.Center + projectile.velocity * LaserLength, projectile.Size.Length() * projectile.scale, new Utils.PerLinePoint(DelegateMethods.CutTiles)); + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + if (projHitbox.Intersects(targetHitbox)) + return true; + float unused = 69420f; + if (Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), projectile.Center, projectile.Center + projectile.velocity * LaserLength, projectile.Size.Length() * projectile.scale, ref unused)) + { + return true; + } + return false; + } + + #region Virtual Values + 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 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/Melee/YanmeisKnifeSlash.cs b/Projectiles/Melee/YanmeisKnifeSlash.cs new file mode 100644 index 0000000000..dd629cacd0 --- /dev/null +++ b/Projectiles/Melee/YanmeisKnifeSlash.cs @@ -0,0 +1,114 @@ +using CalamityMod.Buffs.StatBuffs; +using CalamityMod.Buffs.StatDebuffs; +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Melee +{ + public class YanmeisKnifeSlash : ModProjectile + { + // This is a rather weird thing, but it's what the patron asked for. + public static readonly Func CanRecieveCoolEffectsFrom = (npc) => npc.boss || CalamityMod.bossMinionList.Contains(npc.type); + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Yanmei's Knife"); + Main.projFrames[projectile.type] = 5; + } + + public override void SetDefaults() + { + projectile.width = 180; + projectile.height = 96; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.melee = true; + projectile.ownerHitCheck = true; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 20; + projectile.Calamity().trueMelee = true; + } + + public override void AI() + { + Player player = Main.player[projectile.owner]; + + // Frames and crap + projectile.frameCounter++; + if (projectile.frameCounter % 7 == 0) + { + projectile.frame++; + if (projectile.frame >= Main.projFrames[projectile.type]) + projectile.Kill(); + } + + // Create idle light and dust. + Vector2 origin = projectile.Center + projectile.velocity * 3f; + Lighting.AddLight(origin, 0f, 1.5f, 0.1f); + + Vector2 playerRotatedPoint = player.RotatedRelativePoint(player.MountedCenter, true); + + // Rotation and directioning. + float velocityAngle = projectile.velocity.ToRotation(); + projectile.rotation = velocityAngle + (projectile.spriteDirection == -1).ToInt() * MathHelper.Pi; + projectile.direction = (Math.Cos(velocityAngle) > 0).ToDirectionInt(); + + // Positioning close to the end of the player's arm. + projectile.position = playerRotatedPoint - projectile.Size * 0.5f + velocityAngle.ToRotationVector2() * 80f; + + // Sprite and player directioning. + projectile.spriteDirection = projectile.direction; + player.ChangeDir(projectile.direction); + + // Prevents the projectile from dying + projectile.timeLeft = 2; + + // Player item-based field manipulation. + player.itemRotation = (projectile.velocity * projectile.direction).ToRotation(); + player.heldProj = projectile.whoAmI; + player.itemTime = 2; + player.itemAnimation = 2; + } + + public void HandleAttachmentMovement(Player player, Vector2 playerRotatedPoint) + { + float speed = 1f; + if (player.ActiveItem().shoot == projectile.type) + { + speed = player.ActiveItem().shootSpeed * projectile.scale; + } + Vector2 newVelocity = (Main.MouseWorld - playerRotatedPoint).SafeNormalize(Vector2.UnitX * player.direction) * speed; + + // 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 (!CanRecieveCoolEffectsFrom(target)) + return; + target.AddBuff(ModContent.BuffType(), 600); + if (!Main.dedServ) + { + for (int i = 0; i < 60; i++) + { + Dust dust = Dust.NewDustDirect(Main.player[projectile.owner].position, Main.player[projectile.owner].width, Main.player[projectile.owner].height, 267); + dust.position.X += Main.rand.NextFloat(-16f, 16f); + dust.color = Main.hslToRgb(Main.rand.NextFloat(0.26f, 0.37f), 1f, 0.75f); + dust.velocity = Main.rand.NextVector2Circular(24f, 24f); + dust.scale = Main.rand.NextFloat(1.4f, 1.8f); + dust.noGravity = true; + } + } + Main.PlaySound(SoundID.Zombie, Main.player[projectile.owner].Center, 104); + Main.player[projectile.owner].AddBuff(ModContent.BuffType(), 600); + } + public override Color? GetAlpha(Color lightColor) => new Color(0, 215, 0, 0); + } +} diff --git a/Projectiles/Melee/YanmeisKnifeSlash.png b/Projectiles/Melee/YanmeisKnifeSlash.png new file mode 100644 index 0000000000000000000000000000000000000000..e0b03d728cfe75e968220cddf7f8dc3c8996581b GIT binary patch literal 1646 zcmb7EdpOg37+-Z#XG@)x(m~WHGlVCS+Zk(U$z_TdsmP^Ra%*g7RHzx_VKgO@88CB96j12qXo^pv^9YKAY|}iIeeEXc*X3ApDSs z+9Tz|ib{pYVBHI}%iH<#zRI+A);lNPNP#bn=Xe6GepZHNddv*ZN`NEGlz;ct(Z5sE zGSxD}>EYC^8Mg+m8T8C-EHVjR-Y@|0f4)@nim{zXHI@2_YA0rjbug^>fi=Bq7zGZGO}J|lj2^a&kst1DF}NXH@^ zLGnB^zFLL=yIMZSP*JDoqOLefYF>*!Ijp8_fuqptLu5Edq3DOBa}$$bvbZCs^fd_s zIjVPWK%th4BX~!jq%3YSaYKAj8L1?o*I#lA4`h}%I(VkL?=emZ>YM@m82&@CK?D3Q zik;8?7hE(e(!4LL?Qm5dE5t+iGx(SJrzTZv>4}hoPqX0?>eI@`5HHQesI@0fBM(q? znP@lY71^p+)jC1gxwE8FKd~+h7O&I;g?4zJgzI9kW9WsP#t^Fe=G@ZJSjzH%S6%36 z@jjSvV?FR9*xFvk5ZY`%^sc~T$Z$&|eo_b@?4VHiA!i~cc&8zi;s)l+QigdvwNp_3 z-G?X31SRJqL;}wGeA?AL524V6XJgiMIkKSg%1{7v1#c=J_guChEQX+QZQMeV)es^B z6duf;@H#%To?&}llF72d{_!2nhO9P6vz@U(vod6Pr4-77r8nu;n%g(4V+GgTnT?sz-VS_p-e$`x42B;1&r~89)Fp$T37C-YQ~<^seex5ADE> zuL;TZFR7D%E?Bu`_#>G{0R{b${=pjP5~)Df-rBG{@gUII+>?^17sqJ6!5Z-*CiW0R zcGR{8c|Dgd;E@6AEl6*NXgrx%weWfhP-mEh)cr_BRT#{jFqJ@|(D(xGgRT;jIVvq2bKTJ)>=&$>QR(I^YiJK6Gb%xasKYJ>gJ#*->XGVCl*huta zA)*o}yh$f`fW4fJErDE2Hj4GBlM+p;uNW-}Q`U)t-6tiUiotCkE6L81N`6`%ZqPYP zg0wT<1gb&w7g>9oOf>!3I@hZK6MlY!Bd*l4+cU37$N!}5-j`*I9YH7q3#H;Yf;afs z%+w;?7EUXY8a2>VFOv}~h^HdM9IhLaXl;m9&@XY?5jrW%r0cc1z;(y5K86nS>D&q{ z{Nu=A1Dj*bx3XJ!GD#{PJ~+MWNQ5{(UG?^RtlicQwPe3_^Yzx8ztC+ayG1BnTCn!% zjC_{EH$@qzAg@ovcWLdqkjYigi{7u5{WtG~Bk%w%$hYk+oOWb~#*~$OwI{3JITC$B z4a_u@!xvUe$;kcV$lS{*nYdx=xoYAad`IT%6tnAztojN%VDQk^=ZAw@&zfz7tK<2; projectile.ai[0]; + set => projectile.ai[0] = value; + } + public float DefaultHue => ((float)Math.Sin(Main.GlobalTime * 2.5f) + 1) * 0.5f; + public const int MaxBounces = 1; + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 3; + DisplayName.SetDefault("Ultima Bolt"); + } + + public override void SetDefaults() + { + projectile.width = 18; + projectile.height = 42; + projectile.friendly = true; + projectile.ranged = true; + projectile.arrow = true; + projectile.penetrate = 1; + projectile.timeLeft = 300; + } + + public override void AI() + { + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; + } + + public Color GetColorFromHue(float hue) => Main.hslToRgb(hue, 1f, 0.725f) * projectile.Opacity; + public override Color? GetAlpha(Color lightColor) => GetColorFromHue(DefaultHue); + + public void ProduceExplosionDust(int dustCount) + { + if (!Main.dedServ) + { + for (int i = 0; i < dustCount; i++) + { + Dust dust = Dust.NewDustPerfect(projectile.Center, 267); + dust.color = Main.hslToRgb(Main.rand.NextFloat(), 1f, 0.8f); + dust.scale = Main.rand.NextFloat(1f, 1.25f); + dust.velocity = Main.rand.NextVector2Circular(7f, 7f); + dust.noGravity = true; + } + } + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + if (Bounces >= MaxBounces) + { + projectile.Kill(); + return false; + } + + if (projectile.velocity.X != oldVelocity.X) + { + projectile.velocity.X = -oldVelocity.X; + } + if (projectile.velocity.Y != oldVelocity.Y) + { + projectile.velocity.Y = -oldVelocity.Y; + } + Bounces++; + ProduceExplosionDust(24); + + return false; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D texture = ModContent.GetTexture(Texture); + for (int i = 0; i < projectile.oldPos.Length; i++) + { + if (i > 0) + { + CalamityUtils.DistanceClamp(ref projectile.oldPos[i], ref projectile.oldPos[i - 1], 8f); // Ensure the max distance between the old positions isn't too great. It looks weird if it is. + } + float completionRatio = i / (float)projectile.oldPos.Length; + Color color = GetColorFromHue((DefaultHue + completionRatio * 0.5f) % 1f) * (float)Math.Pow(1f - completionRatio, 2); + spriteBatch.Draw(texture, + projectile.oldPos[i] + texture.Size() * 0.5f - Main.screenPosition, + null, + color, + projectile.rotation, + texture.Size() * 0.5f, + projectile.scale, + SpriteEffects.None, + 0f); + } + return false; + } + + public override void Kill(int timeLeft) + { + CalamityGlobalProjectile.ExpandHitboxBy(projectile, 90, 90); + projectile.Damage(); + ProduceExplosionDust(32); + } + } +} diff --git a/Projectiles/Ranged/UltimaBolt.png b/Projectiles/Ranged/UltimaBolt.png new file mode 100644 index 0000000000000000000000000000000000000000..4e0b7c7f9b7ed12430c4041f7c657e0164074975 GIT binary patch literal 437 zcmV;m0ZRUfP)<00001b5ch_0Itp) z=>Px$Z%IT!R7i>KmA^{EP!xy18`@y4SnALq6a+yBsV;&q;40`V)YaXGaB*_gS5VN= z7f@U@lR`l$NIO^})`qks4$0}CmH*9f$3H6Y+}KT+NbX1^ zPL3lK0&%)1d1u$^Rljm!4;VN)EOEGN9RaXdK1qp4bk%tTpy^s8eiHwPvo~@JBYDZc zHIZ#!`vZMBGNB(2DLtZD=N^D^`@&xc{It?K1mHEh^xH(;hc6T2;^`5I=8F5`F>iSO z(mF_&=##TWoo@fB$v^?*ve7At5lvp9*se8P3jibd=VU%UqGmu~_MU*j4?KRNxOrHU f*Z%)Pf4a~Id5Ly%$PMl{00000NkvXXu0mjfZaTqv literal 0 HcmV?d00001 diff --git a/Projectiles/Ranged/UltimaBowProjectile.cs b/Projectiles/Ranged/UltimaBowProjectile.cs new file mode 100644 index 0000000000..866886e85d --- /dev/null +++ b/Projectiles/Ranged/UltimaBowProjectile.cs @@ -0,0 +1,108 @@ +using CalamityMod.Items.Weapons.Ranged; +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Ranged +{ + public class UltimaBowProjectile : ModProjectile + { + public float Time + { + get => projectile.ai[0]; + set => projectile.ai[0] = value; + } + public const float PositioningOffset = 35f; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ultima"); + } + + public override void SetDefaults() + { + projectile.width = 82; + projectile.height = 144; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.ranged = true; + projectile.ignoreWater = true; + } + + public override void AI() + { + Player player = Main.player[projectile.owner]; + projectile.direction = (Math.Cos(projectile.velocity.ToRotation()) > 0).ToDirectionInt(); + AttemptToFireProjectiles(player); + AttachToPlayer(player); + projectile.rotation = projectile.velocity.ToRotation() + (projectile.spriteDirection == -1).ToInt() * MathHelper.Pi; + Time++; + } + + public void AttemptToFireProjectiles(Player player) + { + bool canFire = player.channel && player.HasAmmo(player.ActiveItem(), true) && !player.noItems && !player.CCed; + if (!canFire) + { + projectile.Kill(); + return; + } + if (Main.netMode != NetmodeID.MultiplayerClient && Time % player.ActiveItem().useTime == 0) + { + int type = ProjectileID.WoodenArrowFriendly; // This doesn't really matter. It's overriten anyway. But it is passed into the PackAmmo method. + float shotSpeed = player.ActiveItem().shootSpeed; + int damage = player.GetWeaponDamage(player.ActiveItem()); + float knockBack = player.ActiveItem().knockBack; + + player.PickAmmo(player.ActiveItem(), ref type, ref shotSpeed, ref canFire, ref damage, ref knockBack); // Pick ammo and consume it (this incorporates the bow's chance to not consume ammo). + + Main.PlaySound(player.ActiveItem().UseSound, projectile.Center); + + type = ModContent.ProjectileType(); + float shootLaserChance = Utils.InverseLerp(Ultima.FullChargeTime * 0.35f, Ultima.FullChargeTime, Time, true); + Vector2 shotPosition = player.RotatedRelativePoint(player.MountedCenter, true); + shotPosition += projectile.velocity.ToRotation().ToRotationVector2().RotatedByRandom(MathHelper.ToRadians(40f)).RotatedBy(-0.25f * projectile.spriteDirection) * 42f; + + projectile.velocity = projectile.DirectionTo(Main.MouseWorld); + + Vector2 shotVelocity = projectile.velocity * shotSpeed; // The velocity should always be a unit vector. + + // Fire a laser. + if (Main.rand.NextFloat() <= shootLaserChance) + { + type = ModContent.ProjectileType(); + shotVelocity = shotVelocity.RotatedByRandom(0.03f); + damage *= 2; + } + // Sometimes fire little sparks if the bow is fully charged. + if (Time >= Ultima.FullChargeTime * 0.7f && Main.rand.NextBool(6)) + { + // To ensure that the sparks don't spawn on top of the laser itself. + float offsetAngle = Main.rand.NextFloat(0.2f, 0.5f) * Main.rand.NextBool(2).ToDirectionInt(); + Vector2 sparkVelocity = projectile.DirectionTo(Main.MouseWorld).RotatedByRandom(0.5f) * 13f; + sparkVelocity = sparkVelocity.RotatedBy(offsetAngle); + Projectile.NewProjectile(shotPosition, sparkVelocity, ModContent.ProjectileType(), damage / 3, knockBack, projectile.owner); + } + knockBack = player.GetWeaponKnockback(player.ActiveItem(), knockBack); + + Projectile.NewProjectile(shotPosition, shotVelocity, type, damage, knockBack, projectile.owner); + projectile.netUpdate = true; + } + } + + public void AttachToPlayer(Player player) + { + projectile.Center = player.RotatedRelativePoint(player.MountedCenter, true) + projectile.velocity.ToRotation().ToRotationVector2() * PositioningOffset; + projectile.spriteDirection = projectile.direction; + projectile.timeLeft = 2; + player.ChangeDir(projectile.direction); + player.heldProj = projectile.whoAmI; + player.itemTime = player.itemAnimation = 2; + player.itemRotation = (projectile.velocity * projectile.direction).ToRotation(); + } + + public override bool CanDamage() => false; + } +} diff --git a/Projectiles/Ranged/UltimaBowProjectile.png b/Projectiles/Ranged/UltimaBowProjectile.png new file mode 100644 index 0000000000000000000000000000000000000000..a5e99993fdd8d15d8bc355add860644e58a7dc56 GIT binary patch literal 1951 zcmeAS@N?(olHy`uVBq!ia0vp^AY8=33?#qDmCXlIjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WMyDrW(e>JaRrJC2#CtbsHkZe8(26x$woT*d4*?W*Y?bqrW3Z-!{qu5k9$uN zH@<4y^7Yd9-~WN?N5N--d7?R<9c4lwUYy$zd>==b@sTKd1t48hH-SnR$VE&`InjQ*kpI`9o z_;TJrrsturi{}5nJ>D{l=PWsX=709$DU*~$GQM{|p5k$K`o-iM+I^v3U29IwG1A+n zrrjB)rfSYnEo%(9nJiIPj%PN`N2 zcu30K{ofh!^k+`%!c`J;b_Vq)-#rxQ)fwX4(sTTQ>F&KAYd#fibYg3qFooUmfwcJc z0#&V*qFa`!>8E6WniP@h6?Q_&BzWeAi<@S=SUyc-d5YqD-@@swj$|;jLS6<+p$nv}+D7EQ7i|WGaM++XyFI>E2n~BTDQ~S0b z;<)W(_4+EehU!zn7wz*hy|qkDmh4!vr*3NjL(+n?d$(-~x~r;^!}+JCzf^lwiK52} zW#*QKS$EHUc$gr|t^HEvR+%14R@&(R?WJ@4JrrzIRLthe6+V2M?ijh0UvTbEhs;^) z_0I_}E*JSXZBknQneCkg@$H+u>{d@PDm|bRNfJdyblEVB6AB3lT@Oib1GuuXJ z^_+Sy&g^`RLI=|wajRFot_${L5?rLsA<4V7dd+E%HJ9u^wt6o+sE`ud7=3omCa=<| z9*n`)l)hDZwRlM_nWGuGS^bFC``HT>1E#15DY5QX=?Puc9cuJShj*dY!=3wddcw{L zGjrb7Sh8+gw7t;kkO^G9o+m;|?p7r(ndG<6L8f0*wmXB?#Y+!5z^$I6&F{QY5dWPwg21ZsUG?9 n2ck6>vup{wbLRHc!ykBkMRl3apI`9`R4RJ9`njxgN@xNAsx_+3 literal 0 HcmV?d00001 diff --git a/Projectiles/Ranged/UltimaRay.cs b/Projectiles/Ranged/UltimaRay.cs new file mode 100644 index 0000000000..43742db73f --- /dev/null +++ b/Projectiles/Ranged/UltimaRay.cs @@ -0,0 +1,51 @@ +using CalamityMod.Projectiles.BaseProjectiles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Ranged +{ + public class UltimaRay : BaseLaserbeamProjectile + { + public float HueOffset + { + get => projectile.ai[1]; + set => projectile.ai[1] = value; + } + public override float MaxScale => 0.7f; + public override float MaxLaserLength => 1599.999999f; + public override float Lifetime => 50f; + public override Color LaserOverlayColor => Main.hslToRgb((float)Math.Sin(Main.GlobalTime * 2.3f + HueOffset) * 0.5f + 0.5f, 1f, 0.775f) * Utils.InverseLerp(Lifetime, 0f, Time, true); + public override Color LightCastColor => LaserOverlayColor; + 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("Ultima Ray"); + } + public override void SetDefaults() + { + projectile.width = projectile.height = 22; + projectile.friendly = true; + projectile.ranged = true; + projectile.arrow = true; + projectile.penetrate = -1; + projectile.alpha = 255; + projectile.localNPCHitCooldown = 8; + projectile.usesLocalNPCImmunity = true; + } + public override bool PreAI() + { + // Initialization. Using the AI hook would override the base laser's code, and we don't want that. + if (projectile.localAI[0] == 0f) + { + HueOffset = Main.rand.NextFloat(MathHelper.Pi / 5f); + projectile.localAI[0] = 1f; + } + return true; + } + public override bool ShouldUpdatePosition() => false; + } +} diff --git a/Projectiles/Ranged/UltimaRay.png b/Projectiles/Ranged/UltimaRay.png new file mode 100644 index 0000000000000000000000000000000000000000..15e877573779272f931ab67d818cf9f2b8911a17 GIT binary patch literal 135 zcmeAS@N?(olHy`uVBq!ia0vp^EFjFm1|(O0oL2{=*pj^6T^Rm@;DWu&Cj&(|3p^r= z85sBugD~Uq{1qucLG}_)Usv`AZ0utE^0#a@0p%D(JY5_^IIbuE`TyUZ*(f2&fw_g1 Y;aDFttLt^E7eILiPgg&ebxsLQ0Jwf72LJ#7 literal 0 HcmV?d00001 diff --git a/Projectiles/Ranged/UltimaSpark.cs b/Projectiles/Ranged/UltimaSpark.cs new file mode 100644 index 0000000000..277bb81070 --- /dev/null +++ b/Projectiles/Ranged/UltimaSpark.cs @@ -0,0 +1,91 @@ +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Ranged +{ + public class UltimaSpark : ModProjectile + { + public float Time + { + get => projectile.ai[0]; + set => projectile.ai[0] = value; + } + public const int DustType = 261; + public const float MaxHomingDistance = 1200f; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ultima Spark"); + } + + public override void SetDefaults() + { + projectile.width = projectile.height = 8; + projectile.friendly = true; + projectile.ranged = true; + projectile.arrow = true; + projectile.penetrate = 1; + projectile.timeLeft = 240; + projectile.extraUpdates = 1; + } + + public override void AI() + { + if (!Main.dedServ && Time > 5f) + { + for (int i = 0; i < 3; i++) + { + Vector2 spawnPosition = Vector2.Lerp(projectile.oldPosition, projectile.position, i / 3f); + Dust dust = Dust.NewDustPerfect(spawnPosition, DustType); + dust.color = Main.hslToRgb((Main.rand.NextFloat(-0.04f, 0.04f) + Time / 80f) % 1f, 0.8f, 0.6f); + dust.scale = 2.3f; + dust.fadeIn = 1f; + dust.rotation = Main.rand.NextFloat(MathHelper.TwoPi); + dust.velocity = Vector2.Zero; + dust.noGravity = true; + } + } + + NPC potentialTarget = projectile.Center.ClosestNPCAt(MaxHomingDistance); + if (potentialTarget != null) + { + projectile.velocity = (projectile.velocity * 8f + projectile.DirectionTo(potentialTarget.Center) * 18f) / 9f; + return; + } + + if (Time > 30f) + { + float updatedTime = Time - 30f; + // Make a complete 90 degree turn in 30 frames. + if (updatedTime % 120f > 90f) + { + projectile.velocity = projectile.velocity.RotatedBy(MathHelper.PiOver2 / 20f); + } + // Arc around quickly for 60 frames. + else if (updatedTime % 120f > 30f) + { + projectile.velocity = projectile.velocity.RotatedBy((float)Math.Sin((updatedTime - 30f) % 60f / 60f * MathHelper.TwoPi) * MathHelper.ToRadians(15f)); + } + } + + Time++; + } + + public override void Kill(int timeLeft) + { + CalamityGlobalProjectile.ExpandHitboxBy(projectile, 60, 60); + projectile.Damage(); + if (!Main.dedServ) + { + for (int i = 0; i < 20; i++) + { + Dust dust = Dust.NewDustPerfect(projectile.Center, DustType); + dust.color = Main.hslToRgb(Main.rand.NextFloat(), 1f, 0.7f); + dust.scale = Main.rand.NextFloat(0.9f, 1.25f); + dust.velocity = Main.rand.NextVector2Circular(6f, 6f); + dust.noGravity = true; + } + } + } + } +} diff --git a/Projectiles/Ranged/UltimaSpark.png b/Projectiles/Ranged/UltimaSpark.png new file mode 100644 index 0000000000000000000000000000000000000000..a799dbbc353977ec2ed482fc77cc5a26c01f72fe GIT binary patch literal 131 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucK?zS6#}JL+ + /// Clamps the distance between vectors via normalization. + /// + /// The starting point. + /// The ending point. + /// The maximum possible distance between the two vectors before they get clamped. + public static void DistanceClamp(ref Vector2 start, ref Vector2 end, float maxDistance) + { + if (Vector2.Distance(end, start) > maxDistance) + { + end = start + Vector2.Normalize(end - start) * maxDistance; + } + } #endregion } } From 2383baf145086cc8d4ead76879ab356d540daca2 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 19 Jun 2020 10:57:17 -0400 Subject: [PATCH 2/6] fixed abyssal diving gear showing hair minor issues include not showing abyss diving gear on character selection screen, and some face accs prioritization Also fixed face accs like Diving Gear drawing over transformations --- CalPlayer/CalamityPlayer.cs | 180 ++++++++++++++----------- CalamityMod.cs | 2 + Items/Accessories/AbyssalDivingGear.cs | 110 ++++++++------- 3 files changed, 163 insertions(+), 129 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 6bc0800e48..4fb505a89b 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -476,6 +476,7 @@ namespace CalamityMod.CalPlayer public bool depthCharm = false; public bool anechoicPlating = false; public bool jellyfishNecklace = false; + public bool abyssDivingGear = false; public bool abyssalAmulet = false; public bool lumenousAmulet = false; public bool reaperToothNecklace = false; @@ -1581,6 +1582,7 @@ namespace CalamityMod.CalPlayer depthCharm = false; anechoicPlating = false; jellyfishNecklace = false; + abyssDivingGear = false; abyssalAmulet = false; lumenousAmulet = false; reaperToothNecklace = false; @@ -3261,6 +3263,10 @@ namespace CalamityMod.CalPlayer profanedCrystalHide = false; profanedCrystalForce = true; } + else if (item.type == ModContent.ItemType()) + { + abyssDivingGear = true; + } } } @@ -6921,93 +6927,102 @@ namespace CalamityMod.CalPlayer } #endregion - #region Frame Effects + #region Frame Effects + public override void FrameEffects() + { + if (player.Calamity().andromedaState == AndromedaPlayerState.LargeRobot || + player.Calamity().andromedaState == AndromedaPlayerState.SpecialAttack) + { + player.head = mod.GetEquipSlot("NoHead", EquipType.Head); // To make the head invisible on the map. The map was having a hissy fit because of hitbox changes. + } + else if ((profanedCrystal || profanedCrystalForce) && !profanedCrystalHide) + { + player.legs = mod.GetEquipSlot("ProviLegs", EquipType.Legs); + player.body = mod.GetEquipSlot("ProviBody", EquipType.Body); + player.head = mod.GetEquipSlot("ProviHead", EquipType.Head); + player.wings = mod.GetEquipSlot("ProviWings", EquipType.Wings); + player.face = -1; - public override void FrameEffects() - { - if (player.Calamity().andromedaState == AndromedaPlayerState.LargeRobot || - player.Calamity().andromedaState == AndromedaPlayerState.SpecialAttack) - { - player.head = mod.GetEquipSlot("NoHead", EquipType.Head); // To make the head invisible on the map. The map was having a hissy fit because of hitbox changes. - } - else if (snowRuffianSet) - { - player.wings = mod.GetEquipSlot("SnowRuffWings", EquipType.Wings); - bool falling = player.gravDir == -1 ? player.velocity.Y < 0.05f : player.velocity.Y > 0.05f; - if (player.controlJump && falling) - { - player.velocity.Y *= 0.9f; - player.wingFrame = 3; + bool enrage = !profanedCrystalForce && profanedCrystalBuffs && player.statLife <= (int)(player.statLifeMax2 * 0.5); + + if (profanedCrystalWingCounter.Value == 0) + { + int key = profanedCrystalWingCounter.Key; + profanedCrystalWingCounter = new KeyValuePair(key == 3 ? 0 : key + 1, enrage ? 5 : 7); + } + + player.wingFrame = profanedCrystalWingCounter.Key; + profanedCrystalWingCounter = new KeyValuePair(profanedCrystalWingCounter.Key, profanedCrystalWingCounter.Value - 1); + player.armorEffectDrawOutlines = true; + if (profanedCrystalBuffs) + { + player.armorEffectDrawShadow = true; + if (enrage) + { + player.armorEffectDrawOutlinesForbidden = true; + } + } + } + else if ((snowmanPower || snowmanForce) && !snowmanHide) + { + player.legs = mod.GetEquipSlot("PopoLeg", EquipType.Legs); + player.body = mod.GetEquipSlot("PopoBody", EquipType.Body); + player.head = snowmanNoseless ? mod.GetEquipSlot("PopoNoselessHead", EquipType.Head) : mod.GetEquipSlot("PopoHead", EquipType.Head); + player.face = -1; + } + else if ((abyssalDivingSuitPower || abyssalDivingSuitForce) && !abyssalDivingSuitHide) + { + player.legs = mod.GetEquipSlot("AbyssalDivingSuitLeg", EquipType.Legs); + player.body = mod.GetEquipSlot("AbyssalDivingSuitBody", EquipType.Body); + player.head = mod.GetEquipSlot("AbyssalDivingSuitHead", EquipType.Head); + player.face = -1; + } + else if ((sirenBoobsPower || sirenBoobsForce) && !sirenBoobsHide) + { + player.legs = mod.GetEquipSlot("SirenLeg", EquipType.Legs); + player.body = mod.GetEquipSlot("SirenBody", EquipType.Body); + player.head = mod.GetEquipSlot("SirenHead", EquipType.Head); + player.face = -1; + } + else if ((sirenBoobsAltPower || sirenBoobsAltForce) && !sirenBoobsAltHide) + { + player.legs = mod.GetEquipSlot("SirenLegAlt", EquipType.Legs); + player.body = mod.GetEquipSlot("SirenBodyAlt", EquipType.Body); + player.head = mod.GetEquipSlot("SirenHeadAlt", EquipType.Head); + player.face = -1; + } + else + { + if (profanedCrystalWingCounter.Key != 1) + profanedCrystalWingCounter = new KeyValuePair(1, 7); + if (profanedCrystalAnimCounter.Key != 0) + profanedCrystalAnimCounter = new KeyValuePair(0, 10); + } + if (snowRuffianSet) + { + player.wings = mod.GetEquipSlot("SnowRuffWings", EquipType.Wings); + bool falling = player.gravDir == -1 ? player.velocity.Y < 0.05f : player.velocity.Y > 0.05f; + if (player.controlJump && falling) + { + player.velocity.Y *= 0.9f; + player.wingFrame = 3; player.noFallDmg = true; player.fallStart = (int)(player.position.Y / 16f); - } - } - else if ((profanedCrystal || profanedCrystalForce) && !profanedCrystalHide) - { - player.legs = mod.GetEquipSlot("ProviLegs", EquipType.Legs); - player.body = mod.GetEquipSlot("ProviBody", EquipType.Body); - player.head = mod.GetEquipSlot("ProviHead", EquipType.Head); - player.wings = mod.GetEquipSlot("ProviWings", EquipType.Wings); + } + } + if (abyssDivingGear && (player.head == -1 || player.head == ArmorIDs.Head.FamiliarWig)) + { + player.head = mod.GetEquipSlot("AbyssDivingGearHead", EquipType.Head); + player.face = -1; + } - bool enrage = !profanedCrystalForce && profanedCrystalBuffs && player.statLife <= (int)(player.statLifeMax2 * 0.5); + if (CalamityWorld.defiled) + Defiled(); - if (profanedCrystalWingCounter.Value == 0) - { - int key = profanedCrystalWingCounter.Key; - profanedCrystalWingCounter = new KeyValuePair(key == 3 ? 0 : key + 1, enrage ? 5 : 7); - } - - player.wingFrame = profanedCrystalWingCounter.Key; - profanedCrystalWingCounter = new KeyValuePair(profanedCrystalWingCounter.Key, profanedCrystalWingCounter.Value - 1); - player.armorEffectDrawOutlines = true; - if (profanedCrystalBuffs) - { - player.armorEffectDrawShadow = true; - if (enrage) - { - player.armorEffectDrawOutlinesForbidden = true; - } - } - } - else if ((snowmanPower || snowmanForce) && !snowmanHide) - { - player.legs = mod.GetEquipSlot("PopoLeg", EquipType.Legs); - player.body = mod.GetEquipSlot("PopoBody", EquipType.Body); - player.head = snowmanNoseless ? mod.GetEquipSlot("PopoNoselessHead", EquipType.Head) : mod.GetEquipSlot("PopoHead", EquipType.Head); - } - else if ((abyssalDivingSuitPower || abyssalDivingSuitForce) && !abyssalDivingSuitHide) - { - player.legs = mod.GetEquipSlot("AbyssalDivingSuitLeg", EquipType.Legs); - player.body = mod.GetEquipSlot("AbyssalDivingSuitBody", EquipType.Body); - player.head = mod.GetEquipSlot("AbyssalDivingSuitHead", EquipType.Head); - } - else if ((sirenBoobsPower || sirenBoobsForce) && !sirenBoobsHide) - { - player.legs = mod.GetEquipSlot("SirenLeg", EquipType.Legs); - player.body = mod.GetEquipSlot("SirenBody", EquipType.Body); - player.head = mod.GetEquipSlot("SirenHead", EquipType.Head); - } - else if ((sirenBoobsAltPower || sirenBoobsAltForce) && !sirenBoobsAltHide) - { - player.legs = mod.GetEquipSlot("SirenLegAlt", EquipType.Legs); - player.body = mod.GetEquipSlot("SirenBodyAlt", EquipType.Body); - player.head = mod.GetEquipSlot("SirenHeadAlt", EquipType.Head); - } - else - { - if (profanedCrystalWingCounter.Key != 1) - profanedCrystalWingCounter = new KeyValuePair(1, 7); - if (profanedCrystalAnimCounter.Key != 0) - profanedCrystalAnimCounter = new KeyValuePair(0, 10); - } - - if (CalamityWorld.defiled) - Defiled(); - - if (weakPetrification) - WeakPetrification(); - } - #endregion + if (weakPetrification) + WeakPetrification(); + } + #endregion #region Limitations private void WeakPetrification() @@ -9447,6 +9462,7 @@ namespace CalamityMod.CalPlayer } } }); + public override void ModifyDrawInfo(ref PlayerDrawInfo drawInfo) { if (drawInfo.shadow != 0f) diff --git a/CalamityMod.cs b/CalamityMod.cs index a237b266a0..c6f5df6ca9 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -285,6 +285,8 @@ namespace CalamityMod AddEquipTexture(new SnowRuffianWings(), null, EquipType.Wings, "SnowRuffWings", "CalamityMod/Items/Armor/SnowRuffianWings"); + AddEquipTexture(new AbyssDivingGearHair(), null, EquipType.Head, "AbyssDivingGearHead", "CalamityMod/Items/Accessories/AbyssalDivingGear_Face"); + AstralCactusTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/Tiles/AstralCactus"); AstralCactusGlowTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/Tiles/AstralCactusGlow"); AstralSky = ModContent.GetTexture("CalamityMod/ExtraTextures/AstralSky"); diff --git a/Items/Accessories/AbyssalDivingGear.cs b/Items/Accessories/AbyssalDivingGear.cs index a5ca41427f..202b02f1b9 100644 --- a/Items/Accessories/AbyssalDivingGear.cs +++ b/Items/Accessories/AbyssalDivingGear.cs @@ -6,54 +6,70 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - [AutoloadEquip(EquipType.Face)] - public class AbyssalDivingGear : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Abyssal Diving Gear"); - Tooltip.SetDefault("Reduces the damage caused by the pressure of the abyss while out of breath\n" + - "Removes the bleed effect caused by the abyss\n" + - "Grants the ability to swim and greatly extends underwater breathing\n" + - "Provides light underwater and extra mobility on ice\n" + - "Provides a moderate amount of light in the abyss\n" + - "Greatly reduces breath loss in the abyss"); - } + //[AutoloadEquip(EquipType.Face)] + public class AbyssalDivingGear : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Abyssal Diving Gear"); + Tooltip.SetDefault("Reduces the damage caused by the pressure of the abyss while out of breath\n" + + "Removes the bleed effect caused by the abyss\n" + + "Grants the ability to swim and greatly extends underwater breathing\n" + + "Provides light underwater and extra mobility on ice\n" + + "Provides a moderate amount of light in the abyss\n" + + "Greatly reduces breath loss in the abyss"); + } - public override void SetDefaults() - { - item.width = 26; - item.height = 26; - item.value = CalamityGlobalItem.Rarity7BuyPrice; - item.rare = 7; - item.accessory = true; - } + public override void SetDefaults() + { + item.width = 26; + item.height = 26; + item.value = CalamityGlobalItem.Rarity7BuyPrice; + item.rare = 7; + item.accessory = true; + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - CalamityPlayer modPlayer = player.Calamity(); - modPlayer.depthCharm = true; - modPlayer.jellyfishNecklace = true; - player.arcticDivingGear = true; - player.accFlipper = true; - player.accDivingHelm = true; - player.iceSkate = true; - if (player.wet) - { - Lighting.AddLight((int)player.Center.X / 16, (int)player.Center.Y / 16, 0.2f, 0.8f, 0.9f); - } - } + public override void UpdateAccessory(Player player, bool hideVisual) + { + CalamityPlayer modPlayer = player.Calamity(); + modPlayer.depthCharm = true; + modPlayer.jellyfishNecklace = true; + if (!hideVisual) + modPlayer.abyssDivingGear = true; //this bool is just used for drawing + player.arcticDivingGear = true; + player.accFlipper = true; + player.accDivingHelm = true; + player.iceSkate = true; + if (player.wet) + { + Lighting.AddLight((int)player.Center.X / 16, (int)player.Center.Y / 16, 0.2f, 0.8f, 0.9f); + } + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.ArcticDivingGear); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType(), 10); - recipe.AddIngredient(ModContent.ItemType(), 10); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } + public override void UpdateVanity(Player player, EquipType type) + { + player.Calamity().abyssDivingGear = true; //this bool is just used for drawing + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.ArcticDivingGear); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } + + public class AbyssDivingGearHair : EquipTexture + { + public override void DrawHair(ref bool drawHair, ref bool drawAltHair) + { + drawHair = false; + drawAltHair = false; + } + } } From f9ff0c8a021d34bd0d18b3b9e8aeee2458ff5d9a Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 19 Jun 2020 12:22:43 -0400 Subject: [PATCH 3/6] lore items only work while favorited --- CalPlayer/CalamityPlayer.cs | 21 +++++++++++++------ CalPlayer/CalamityPlayerMiscEffects.cs | 2 +- Items/LoreItems/KnowledgeAquaticScourge.cs | 14 +++++++------ Items/LoreItems/KnowledgeAstrumAureus.cs | 6 ++++-- Items/LoreItems/KnowledgeAstrumDeus.cs | 6 ++++-- Items/LoreItems/KnowledgeBrainofCthulhu.cs | 5 +++-- .../LoreItems/KnowledgeBrimstoneElemental.cs | 6 ++++-- Items/LoreItems/KnowledgeCalamitas.cs | 6 ++++-- Items/LoreItems/KnowledgeCrabulon.cs | 6 ++++-- Items/LoreItems/KnowledgeCryogen.cs | 6 ++++-- Items/LoreItems/KnowledgeDesertScourge.cs | 6 ++++-- Items/LoreItems/KnowledgeDestroyer.cs | 6 ++++-- Items/LoreItems/KnowledgeDevourerofGods.cs | 6 ++++-- Items/LoreItems/KnowledgeDukeFishron.cs | 6 ++++-- Items/LoreItems/KnowledgeEaterofWorlds.cs | 6 ++++-- Items/LoreItems/KnowledgeEyeofCthulhu.cs | 14 ++++++++----- Items/LoreItems/KnowledgeGolem.cs | 6 ++++-- Items/LoreItems/KnowledgeHiveMind.cs | 5 +++-- Items/LoreItems/KnowledgeKingSlime.cs | 6 ++++-- Items/LoreItems/KnowledgeLeviathanandSiren.cs | 6 ++++-- Items/LoreItems/KnowledgeLunaticCultist.cs | 5 +++-- Items/LoreItems/KnowledgeMoonLord.cs | 6 ++++-- Items/LoreItems/KnowledgeOldDuke.cs | 6 ++++-- Items/LoreItems/KnowledgePerforators.cs | 5 +++-- .../KnowledgePlaguebringerGoliath.cs | 6 ++++-- Items/LoreItems/KnowledgePlantera.cs | 6 ++++-- Items/LoreItems/KnowledgePolterghast.cs | 6 ++++-- Items/LoreItems/KnowledgeProvidence.cs | 6 ++++-- Items/LoreItems/KnowledgeQueenBee.cs | 6 ++++-- Items/LoreItems/KnowledgeRavager.cs | 6 ++++-- Items/LoreItems/KnowledgeSkeletron.cs | 5 +++-- Items/LoreItems/KnowledgeSkeletronPrime.cs | 6 ++++-- Items/LoreItems/KnowledgeSlimeGod.cs | 5 +++-- Items/LoreItems/KnowledgeTwins.cs | 6 ++++-- Items/LoreItems/KnowledgeWallofFlesh.cs | 6 ++++-- Items/LoreItems/KnowledgeYharon.cs | 6 ++++-- 36 files changed, 155 insertions(+), 82 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index ca6e5f0f83..fd27e54a1d 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -3679,7 +3679,6 @@ namespace CalamityMod.CalPlayer } #endregion } - #endregion #region Rogue Mirrors @@ -3706,6 +3705,11 @@ namespace CalamityMod.CalPlayer Main.projectile[lumenyl].rotation = Main.rand.NextFloat(0, 360); Main.projectile[lumenyl].frame = Main.rand.Next(0, 4); } + + if (player.whoAmI == Main.myPlayer) + { + NetMessage.SendData(MessageID.Dodge, -1, -1, null, player.whoAmI, 1f, 0f, 0f, 0, 0, 0); + } } } @@ -3726,6 +3730,11 @@ namespace CalamityMod.CalPlayer Main.PlaySound(SoundID.Item68, Main.player[Main.myPlayer].position); int eclipseBurst = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)(7000 * player.RogueDamage()), 0, player.whoAmI); + + if (player.whoAmI == Main.myPlayer) + { + NetMessage.SendData(MessageID.Dodge, -1, -1, null, player.whoAmI, 1f, 0f, 0f, 0, 0, 0); + } } } #endregion @@ -8293,11 +8302,11 @@ namespace CalamityMod.CalPlayer Rectangle rectangle = new Rectangle((int)((double)player.position.X + (double)player.velocity.X * 0.5 - 4.0), (int)((double)player.position.Y + (double)player.velocity.Y * 0.5 - 4.0), player.width + 8, player.height + 8); for (int i = 0; i < Main.maxNPCs; i++) { - if (Main.npc[i].active && !Main.npc[i].dontTakeDamage && !Main.npc[i].friendly && !Main.npc[i].townNPC && Main.npc[i].immune[player.whoAmI] <= 0 && Main.npc[i].damage > 0) + NPC npc = Main.npc[i]; + if (npc.active && !npc.dontTakeDamage && !npc.friendly && !npc.townNPC && npc.immune[player.whoAmI] <= 0 && npc.damage > 0) { - NPC nPC = Main.npc[i]; Rectangle rect = nPC.getRect(); - if (rectangle.Intersects(rect) && (nPC.noTileCollide || player.CanHit(nPC))) + if (rectangle.Intersects(rect) && (npc.noTileCollide || player.CanHit(npc))) { OnDodge(); break; @@ -8306,9 +8315,9 @@ namespace CalamityMod.CalPlayer } for (int i = 0; i < Main.maxProjectiles; i++) { - if (Main.projectile[i].active && !Main.projectile[i].friendly && Main.projectile[i].hostile && Main.projectile[i].damage > 0) + Projectile proj = Main.projectile[i]; + if (proj.active && !proj.friendly && proj.hostile && proj.damage > 0) { - Projectile proj = Main.projectile[i]; Rectangle rect = proj.getRect(); if (rectangle.Intersects(rect)) { diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 3803891113..6dc3407c00 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -3844,7 +3844,7 @@ namespace CalamityMod.CalPlayer #region Rogue Mirrors private static void RogueMirrors(Player player, CalamityPlayer modPlayer) { - Rectangle rectangle = new Rectangle((int)((double)player.position.X + (double)player.velocity.X * 0.5 - 4.0), (int)((double)player.position.Y + (double)player.velocity.Y * 0.5 - 4.0), player.width + 8, player.height + 8); + Rectangle rectangle = new Rectangle((int)(player.position.X + player.velocity.X * 0.5f - 4f), (int)(player.position.Y + player.velocity.Y * 0.5f - 4f), player.width + 8, player.height + 8); for (int i = 0; i < Main.maxNPCs; i++) { NPC npc = Main.npc[i]; diff --git a/Items/LoreItems/KnowledgeAquaticScourge.cs b/Items/LoreItems/KnowledgeAquaticScourge.cs index 725d3ce13d..c00a8083ea 100644 --- a/Items/LoreItems/KnowledgeAquaticScourge.cs +++ b/Items/LoreItems/KnowledgeAquaticScourge.cs @@ -15,7 +15,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("A horror born of pollution and insatiable hunger; based on size alone this was merely a juvenile.\n" + "These scourge creatures are the largest aquatic predators and very rarely do they frequent such shallow waters.\n" + "Place in your inventory to gain immunity to the sulphurous waters and increase the stat gains from the Well Fed buff.\n" + - "However, without the Well Fed buff your stats will decrease due to your insatiable hunger."); + "However, without the Well Fed buff your stats will decrease due to your insatiable hunger.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -31,11 +32,12 @@ namespace CalamityMod.Items.LoreItems return false; } - public override void UpdateInventory(Player player) - { - CalamityPlayer modPlayer = player.Calamity(); - modPlayer.aquaticScourgeLore = true; - } + public override void UpdateInventory(Player player) + { + CalamityPlayer modPlayer = player.Calamity(); + if (item.favorited) + modPlayer.aquaticScourgeLore = true; + } public override void AddRecipes() { diff --git a/Items/LoreItems/KnowledgeAstrumAureus.cs b/Items/LoreItems/KnowledgeAstrumAureus.cs index 7b1d99ae7d..afff87fd71 100644 --- a/Items/LoreItems/KnowledgeAstrumAureus.cs +++ b/Items/LoreItems/KnowledgeAstrumAureus.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems DisplayName.SetDefault("Astrum Aureus"); Tooltip.SetDefault("A titanic cyborg infected by a star-borne disease expelled from the belly of an ancient god.\n" + "The destruction of this creature will not prevent the spread of the disease.\n" + - "Place in your inventory to gain increased jump speed in space."); + "Place in your inventory to gain increased jump speed in space.\n" + + "This effect only occurs if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.astrumAureusLore = true; + if (item.favorited) + modPlayer.astrumAureusLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeAstrumDeus.cs b/Items/LoreItems/KnowledgeAstrumDeus.cs index e892c5c7e8..a8b5376105 100644 --- a/Items/LoreItems/KnowledgeAstrumDeus.cs +++ b/Items/LoreItems/KnowledgeAstrumDeus.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems DisplayName.SetDefault("Astrum Deus"); Tooltip.SetDefault("God of the stars and largest vessel for the Astral Infection.\n" + "Though struck down from its place among the stars its remnants have gathered strength, aiming to take its rightful place in the cosmos once more.\n" + - "Place in your inventory to gain increased movement speed in space."); + "Place in your inventory to gain increased movement speed in space.\n" + + "This effect only occurs if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.astrumDeusLore = true; + if (item.favorited) + modPlayer.astrumDeusLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeBrainofCthulhu.cs b/Items/LoreItems/KnowledgeBrainofCthulhu.cs index 4e6a899dbb..e5f11cc641 100644 --- a/Items/LoreItems/KnowledgeBrainofCthulhu.cs +++ b/Items/LoreItems/KnowledgeBrainofCthulhu.cs @@ -15,7 +15,8 @@ namespace CalamityMod.Items.LoreItems "Most likely another abomination spawned from this inchoate mass of flesh.\n" + "Allows you to teleport similar to the Rod of Discord while in the crimson. Place in your hotbar to use it.\n" + "Teleportation is disabled while Chaos State is active.\n" + - "However, you become confused for a few seconds after you use it due to your overwhelming brain power."); + "However, you become confused for a few seconds after you use it due to your overwhelming brain power.\n" + + "Teleportation only occurs if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,7 @@ namespace CalamityMod.Items.LoreItems public override bool CanUseItem(Player player) { - return player.ZoneCrimson; + return player.ZoneCrimson && item.favorited; } public override bool UseItem(Player player) diff --git a/Items/LoreItems/KnowledgeBrimstoneElemental.cs b/Items/LoreItems/KnowledgeBrimstoneElemental.cs index 336c1e75a2..d9a666e5d1 100644 --- a/Items/LoreItems/KnowledgeBrimstoneElemental.cs +++ b/Items/LoreItems/KnowledgeBrimstoneElemental.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems DisplayName.SetDefault("Brimstone Elemental"); Tooltip.SetDefault("The most powerful of the elementals, bent on exacting revenge upon the bloody inferno that demolished her home.\n" + "Finally put to rest, she will suffer no longer from the grief caused by the deaths of her people.\n" + - "Place in your inventory to improve the inferno potion effect."); + "Place in your inventory to improve the inferno potion effect.\n" + + "This effect only occurs if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.brimstoneElementalLore = true; + if (item.favorited) + modPlayer.brimstoneElementalLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeCalamitas.cs b/Items/LoreItems/KnowledgeCalamitas.cs index a4f20b294d..d2cddd9d9c 100644 --- a/Items/LoreItems/KnowledgeCalamitas.cs +++ b/Items/LoreItems/KnowledgeCalamitas.cs @@ -15,7 +15,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("The witch unrivaled. Perhaps the only one amongst my cohorts to have ever given me cause for doubt.\n" + "Now that you have defeated her your destiny is clear.\n" + "Come now, face me.\n" + - "Place in your inventory to die instantly from every hit."); + "Place in your inventory to die instantly from every hit.\n" + + "This effect only occurs if the item is favorited."); } public override void SetDefaults() @@ -35,7 +36,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.SCalLore = true; + if (item.favorited) + modPlayer.SCalLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeCrabulon.cs b/Items/LoreItems/KnowledgeCrabulon.cs index 57bf38da6e..1b2116ca4e 100644 --- a/Items/LoreItems/KnowledgeCrabulon.cs +++ b/Items/LoreItems/KnowledgeCrabulon.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("A crab and its mushrooms, a love story.\n" + "It's interesting how creatures can adapt given certain circumstances.\n" + "Place in your inventory to gain the Mushy buff while underground or in the mushroom biome.\n" + - "However, your movement speed will be decreased while in these areas due to you being covered in fungi."); + "However, your movement speed will be decreased while in these areas due to you being covered in fungi.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.crabulonLore = true; + if (item.favorited) + modPlayer.crabulonLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeCryogen.cs b/Items/LoreItems/KnowledgeCryogen.cs index 184c4b9776..16b985b6f8 100644 --- a/Items/LoreItems/KnowledgeCryogen.cs +++ b/Items/LoreItems/KnowledgeCryogen.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems DisplayName.SetDefault("Cryogen"); Tooltip.SetDefault("The archmage's prison.\n" + "I am unsure if it has grown weaker over the decades of imprisonment.\n" + - "Place in your inventory to gain a frost dash that freezes enemies, at the cost of slightly reduced defense due to your brittle body."); + "Place in your inventory to gain a frost dash that freezes enemies, at the cost of slightly reduced defense due to your brittle body.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.dashMod = 6; + if (item.favorited) + modPlayer.dashMod = 6; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeDesertScourge.cs b/Items/LoreItems/KnowledgeDesertScourge.cs index 082f206049..a631c734fa 100644 --- a/Items/LoreItems/KnowledgeDesertScourge.cs +++ b/Items/LoreItems/KnowledgeDesertScourge.cs @@ -15,7 +15,8 @@ namespace CalamityMod.Items.LoreItems "What used to be a majestic beast swimming through the water has now become a dried-up and\n" + "gluttonous husk, constantly on a voracious search for its next meal.\n" + "Place in your inventory for an increase to defense while in the desert or sunken sea.\n" + - "However, you will deal decreased damage while in these areas due to being a husk of your former self."); + "However, you will deal decreased damage while in these areas due to being a husk of your former self.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { - player.Calamity().desertScourgeLore = true; + if (item.favorited) + player.Calamity().desertScourgeLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeDestroyer.cs b/Items/LoreItems/KnowledgeDestroyer.cs index 55303b8bff..5c3141b702 100644 --- a/Items/LoreItems/KnowledgeDestroyer.cs +++ b/Items/LoreItems/KnowledgeDestroyer.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("A machine brought to life by the mighty souls of warriors, and built to excavate massive tunnels in planets to gather resources.\n" + "Could have proven useful if Draedon didn't have an obsession with turning everything into a tool of destruction.\n" + "Place in your inventory to gain a boost to your pick speed.\n" + - "However, your max acceleration is decreased slightly due to you feeling heavier."); + "However, your max acceleration is decreased slightly due to you feeling heavier.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.destroyerLore = true; + if (item.favorited) + modPlayer.destroyerLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeDevourerofGods.cs b/Items/LoreItems/KnowledgeDevourerofGods.cs index c7b2f2d492..3cf2fa69fd 100644 --- a/Items/LoreItems/KnowledgeDevourerofGods.cs +++ b/Items/LoreItems/KnowledgeDevourerofGods.cs @@ -15,7 +15,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("This serpent’s power to assimilate the abilities and energy of those it consumed is unique in almost all the known cosmos, save for its lesser brethren.\n" + "I would have soon had to eliminate it as a threat had it been given more time and creatures to feast upon.\n" + "Place in your inventory to boost the power of your true melee strikes by 25%.\n" + - "However, due to your reckless nature you will take increased damage."); + "However, due to your reckless nature you will take increased damage.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -35,7 +36,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.DoGLore = true; + if (item.favorited) + modPlayer.DoGLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeDukeFishron.cs b/Items/LoreItems/KnowledgeDukeFishron.cs index 516bd28ad7..fdc59c60bd 100644 --- a/Items/LoreItems/KnowledgeDukeFishron.cs +++ b/Items/LoreItems/KnowledgeDukeFishron.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("The mutant terror of the sea was once the trusted companion of an old king; he tamed it using its favorite treat.\n" + "Long ago, the creature flew in desperation from the raging bloody inferno consuming its home, ultimately finding its way to the ocean.\n" + "Place in your inventory for an increase to all damage, crit and movement speed while submerged in liquid.\n" + - "However, while not submerged in liquid you will have slightly decreased damage, crit and movement speed due to feeling dried out."); + "However, while not submerged in liquid you will have slightly decreased damage, crit and movement speed due to feeling dried out.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.dukeFishronLore = true; + if (item.favorited) + modPlayer.dukeFishronLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeEaterofWorlds.cs b/Items/LoreItems/KnowledgeEaterofWorlds.cs index 40a7adf76f..83269fc9a3 100644 --- a/Items/LoreItems/KnowledgeEaterofWorlds.cs +++ b/Items/LoreItems/KnowledgeEaterofWorlds.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("Perhaps it was just a giant worm infected by the microbe, given centuries to feed and grow its festering body.\n" + "Seems likely, given the origins of this place.\n" + "Deadly microbes spawn around you while this is placed in your inventory.\n" + - "However, you will have decreased life regen due to your skin rotting off."); + "However, you will have decreased life regen due to your skin rotting off.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.eaterOfWorldsLore = true; + if (item.favorited) + modPlayer.eaterOfWorldsLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeEyeofCthulhu.cs b/Items/LoreItems/KnowledgeEyeofCthulhu.cs index 61a1a60a44..086355307c 100644 --- a/Items/LoreItems/KnowledgeEyeofCthulhu.cs +++ b/Items/LoreItems/KnowledgeEyeofCthulhu.cs @@ -13,7 +13,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("That eye...how peculiar.\n" + "I sensed it watching you more intensely as you grew stronger.\n" + "Place in your inventory for night vision at night.\n" + - "However, your vision is reduced during the day."); + "However, your vision is reduced during the day.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -31,10 +32,13 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { - if (!Main.dayTime) - player.nightVision = true; - else - player.blind = true; + if (item.favorited) + { + if (!Main.dayTime) + player.nightVision = true; + else + player.blind = true; + } } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeGolem.cs b/Items/LoreItems/KnowledgeGolem.cs index 4fc871658b..d661b84483 100644 --- a/Items/LoreItems/KnowledgeGolem.cs +++ b/Items/LoreItems/KnowledgeGolem.cs @@ -13,7 +13,8 @@ namespace CalamityMod.Items.LoreItems DisplayName.SetDefault("Golem"); Tooltip.SetDefault("A primitive construct.\n" + "I admire the lihzahrd race for their ingenuity, though finding faith in such a flawed idol would invariably lead to their downfall.\n" + - "Place in your inventory to gain increased defense while standing still."); + "Place in your inventory to gain increased defense while standing still.\n" + + "This effect only occurs if the item is favorited."); } public override void SetDefaults() @@ -32,7 +33,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.golemLore = true; + if (item.favorited) + modPlayer.golemLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeHiveMind.cs b/Items/LoreItems/KnowledgeHiveMind.cs index 2d7b59c989..9ad9b6dbd9 100644 --- a/Items/LoreItems/KnowledgeHiveMind.cs +++ b/Items/LoreItems/KnowledgeHiveMind.cs @@ -15,7 +15,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("A hive of clustered microbial-infected flesh.\n" + "I do not believe killing it will lessen the corruption here.\n" + "Place in your inventory for all of your projectiles to inflict cursed flames when in the corruption.\n" + - "However, enemy spawn rates will be greatly reduced while in the corruption due to your overwhelmingly-putrid odor."); + "However, enemy spawn rates will be greatly reduced while in the corruption due to your overwhelmingly-putrid odor.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,7 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { - if (player.ZoneCorrupt) + if (player.ZoneCorrupt && item.favorited) { CalamityPlayer modPlayer = player.Calamity(); modPlayer.hiveMindLore = true; diff --git a/Items/LoreItems/KnowledgeKingSlime.cs b/Items/LoreItems/KnowledgeKingSlime.cs index 9b7704180f..1af39c4988 100644 --- a/Items/LoreItems/KnowledgeKingSlime.cs +++ b/Items/LoreItems/KnowledgeKingSlime.cs @@ -13,7 +13,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("Only a fool could be caught by this pitiful excuse for a hunter.\n" + "Unfortunately, our world has no shortage of those.\n" + "Place in your inventory to gain a slight movement speed and jump boost.\n" + - "However, your defense is slightly reduced due to your gelatinous body."); + "However, your defense is slightly reduced due to your gelatinous body.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -31,7 +32,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { - player.Calamity().kingSlimeLore = true; + if (item.favorited) + player.Calamity().kingSlimeLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeLeviathanandSiren.cs b/Items/LoreItems/KnowledgeLeviathanandSiren.cs index b0207cd611..e95bef421f 100644 --- a/Items/LoreItems/KnowledgeLeviathanandSiren.cs +++ b/Items/LoreItems/KnowledgeLeviathanandSiren.cs @@ -16,7 +16,8 @@ namespace CalamityMod.Items.LoreItems "Perhaps two genetic misfits outcast from their homes that found comfort in assisting one another.\n" + "Place in your inventory to gain increased max health while wearing the siren heart and treasure detect while wearing the strange orb.\n" + "Allows the young siren pet to move normally while outside of liquids.\n" + - "However, if you're not submerged in liquid you will have decreased defense and damage reduction."); + "However, if you're not submerged in liquid you will have decreased defense and damage reduction.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -35,7 +36,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.leviathanAndSirenLore = true; + if (item.favorited) + modPlayer.leviathanAndSirenLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeLunaticCultist.cs b/Items/LoreItems/KnowledgeLunaticCultist.cs index 85eefb0946..4ddea4544f 100644 --- a/Items/LoreItems/KnowledgeLunaticCultist.cs +++ b/Items/LoreItems/KnowledgeLunaticCultist.cs @@ -15,7 +15,8 @@ namespace CalamityMod.Items.LoreItems "Someone I once held in such contempt for his actions is now...deceased, his sealing ritual undone...prepare for the end.\n" + "Your impending doom approaches...\n" + "Place in your inventory for an increase to all stats during the lunar event.\n" + - "However, your vision is decreased due to eldritch knowledge damaging your mind."); + "However, your vision is decreased due to eldritch knowledge damaging your mind.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,7 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { - if (NPC.LunarApocalypseIsUp) + if (NPC.LunarApocalypseIsUp && item.favorited) { CalamityPlayer modPlayer = player.Calamity(); modPlayer.lunaticCultistLore = true; diff --git a/Items/LoreItems/KnowledgeMoonLord.cs b/Items/LoreItems/KnowledgeMoonLord.cs index de993228b6..6d023e3fcb 100644 --- a/Items/LoreItems/KnowledgeMoonLord.cs +++ b/Items/LoreItems/KnowledgeMoonLord.cs @@ -15,7 +15,8 @@ namespace CalamityMod.Items.LoreItems "Had it been fully restored it would have been a force to behold, but what you fought was an empty shell.\n" + "However, that doesn't diminish the immense potential locked within it, released upon its death.\n" + "Place in your inventory to gain an improved Gravity Globe that gives you an increase to all stats while upside down.\n" + - "However, while not upside down you have permanent featherfall."); + "However, while not upside down you have permanent featherfall.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -34,7 +35,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.moonLordLore = true; + if (item.favorited) + modPlayer.moonLordLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeOldDuke.cs b/Items/LoreItems/KnowledgeOldDuke.cs index 78a1498a80..6df689a8c1 100644 --- a/Items/LoreItems/KnowledgeOldDuke.cs +++ b/Items/LoreItems/KnowledgeOldDuke.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems DisplayName.SetDefault("Old Duke"); Tooltip.SetDefault("Strange, to find out that the mutant terror of the seas was not alone in its unique biology.\n" + "Perhaps I was mistaken to classify the creature from its relation to pigrons alone.\n" + - "Place in your inventory to convert negative effects from the Acid Rain debuff to positive effects."); + "Place in your inventory to convert negative effects from the Acid Rain debuff to positive effects.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -34,7 +35,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.boomerDukeLore = true; + if (item.favorited) + modPlayer.boomerDukeLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgePerforators.cs b/Items/LoreItems/KnowledgePerforators.cs index aed58f7645..53dbe77a77 100644 --- a/Items/LoreItems/KnowledgePerforators.cs +++ b/Items/LoreItems/KnowledgePerforators.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems DisplayName.SetDefault("The Perforators and their Hive"); Tooltip.SetDefault("An abomination of comingled flesh, bone, and organ, infested primarily by blood-slurping worms.\n" + "Place in your inventory for all of your projectiles to inflict ichor when in the crimson.\n" + - "However, enemy spawn rates will be greatly increased while in the crimson due to your body excreting a sweet-smelling pus."); + "However, enemy spawn rates will be greatly increased while in the crimson due to your body excreting a sweet-smelling pus.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -32,7 +33,7 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { - if (player.ZoneCrimson) + if (player.ZoneCrimson && item.favorited) { CalamityPlayer modPlayer = player.Calamity(); modPlayer.perforatorLore = true; diff --git a/Items/LoreItems/KnowledgePlaguebringerGoliath.cs b/Items/LoreItems/KnowledgePlaguebringerGoliath.cs index 54bc9ee369..4f88bf176c 100644 --- a/Items/LoreItems/KnowledgePlaguebringerGoliath.cs +++ b/Items/LoreItems/KnowledgePlaguebringerGoliath.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems DisplayName.SetDefault("The Plaguebringer Goliath"); Tooltip.SetDefault("A horrific amalgam of steel, flesh, and infection, capable of destroying an entire civilization in just one onslaught.\n" + "Its plague nuke barrage can leave an entire area uninhabitable for months. A shame that it came to this but the plague must be contained.\n" + - "Place in your inventory to gain increased wing flight time, but at the cost of reduced life regen."); + "Place in your inventory to gain increased wing flight time, but at the cost of reduced life regen.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.plaguebringerGoliathLore = true; + if (item.favorited) + modPlayer.plaguebringerGoliathLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgePlantera.cs b/Items/LoreItems/KnowledgePlantera.cs index b5a07a9743..7c71900847 100644 --- a/Items/LoreItems/KnowledgePlantera.cs +++ b/Items/LoreItems/KnowledgePlantera.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("Well done, you killed a plant.\n" + "It was used as a vessel to house the spirits of those unfortunate enough to find their way down here.\n" + "I wish you luck in dealing with the fallout.\n" + - "Place in your inventory to gain increased item grab range."); + "Place in your inventory to gain increased item grab range.\n" + + "This effect only occurs if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.planteraLore = true; + if (item.favorited) + modPlayer.planteraLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgePolterghast.cs b/Items/LoreItems/KnowledgePolterghast.cs index 80488cdddb..acce6e2081 100644 --- a/Items/LoreItems/KnowledgePolterghast.cs +++ b/Items/LoreItems/KnowledgePolterghast.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems DisplayName.SetDefault("Polterghast"); Tooltip.SetDefault("A creature born of hatred and anger, formed by countless human souls with all of their energy entirely devoted to consuming others.\n" + "It seems a waste to have had such a potent source of power ravage mindlessly through these empty halls.\n" + - "Place in your inventory to gain increased item grab range."); + "Place in your inventory to gain increased item grab range.\n" + + "This effect only occurs if the item is favorited."); } public override void SetDefaults() @@ -34,7 +35,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.polterghastLore = true; + if (item.favorited) + modPlayer.polterghastLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeProvidence.cs b/Items/LoreItems/KnowledgeProvidence.cs index 4c6d5cb9e0..16183e5179 100644 --- a/Items/LoreItems/KnowledgeProvidence.cs +++ b/Items/LoreItems/KnowledgeProvidence.cs @@ -15,7 +15,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("A core surrounded by stone and flame, a simple origin and a simple goal.\n" + "What would have become of us had she not been defeated is a frightening concept to consider.\n" + "Place in your inventory to imbue all projectiles with profaned flames, causing them to inflict extra damage.\n" + - "However, your max life is decreased due to a part of your soul being required to fuel the profaned flames."); + "However, your max life is decreased due to a part of your soul being required to fuel the profaned flames.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -35,7 +36,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.providenceLore = true; + if (item.favorited) + modPlayer.providenceLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeQueenBee.cs b/Items/LoreItems/KnowledgeQueenBee.cs index f4ed7c5ed5..b91706e5ae 100644 --- a/Items/LoreItems/KnowledgeQueenBee.cs +++ b/Items/LoreItems/KnowledgeQueenBee.cs @@ -12,7 +12,8 @@ namespace CalamityMod.Items.LoreItems { DisplayName.SetDefault("Queen Bee"); Tooltip.SetDefault("As crude as the giant insects are they can prove useful in certain situations...given the ability to control them.\n" + - "Place in your inventory to make small bees and weak hornets friendly."); + "Place in your inventory to make small bees and weak hornets friendly.\n" + + "This effect only occurs if the item is favorited."); } public override void SetDefaults() @@ -31,7 +32,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.queenBeeLore = true; + if (item.favorited) + modPlayer.queenBeeLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeRavager.cs b/Items/LoreItems/KnowledgeRavager.cs index 8a2b2fc156..461310f14d 100644 --- a/Items/LoreItems/KnowledgeRavager.cs +++ b/Items/LoreItems/KnowledgeRavager.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems DisplayName.SetDefault("Ravager"); Tooltip.SetDefault("The flesh golem constructed using twisted necromancy during the time of my conquest to counter my unstoppable forces.\n" + "Its creators were slaughtered by it moments after its conception. It is for the best that it has been destroyed.\n" + - "Place in your inventory to gain an increase to all damage, but at the cost of reduced wing flight time."); + "Place in your inventory to gain an increase to all damage, but at the cost of reduced wing flight time.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.ravagerLore = true; + if (item.favorited) + modPlayer.ravagerLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeSkeletron.cs b/Items/LoreItems/KnowledgeSkeletron.cs index 81a3cf3fdc..8f54da002b 100644 --- a/Items/LoreItems/KnowledgeSkeletron.cs +++ b/Items/LoreItems/KnowledgeSkeletron.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("The curse is said to only affect the elderly.\n" + "After they are afflicted they become an immortal vessel for an ancient demon of the underworld.\n" + "Place in your inventory to gain increased damage while in the dungeon.\n" + - "However, your max health is decreased due to Skeletron's curse."); + "However, your max health is decreased due to Skeletron's curse.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -32,7 +33,7 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { - if (player.ZoneDungeon) + if (player.ZoneDungeon && item.favorited) { CalamityPlayer modPlayer = player.Calamity(); modPlayer.skeletronLore = true; diff --git a/Items/LoreItems/KnowledgeSkeletronPrime.cs b/Items/LoreItems/KnowledgeSkeletronPrime.cs index bbb95cff60..22239ad9f4 100644 --- a/Items/LoreItems/KnowledgeSkeletronPrime.cs +++ b/Items/LoreItems/KnowledgeSkeletronPrime.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("What a silly and pointless contraption for something created with the essence of pure terror.\n" + "Draedon obviously took several liberties with its design...I am not impressed.\n" + "Place in your inventory to gain a boost to your armor penetration.\n" + - "However, your max acceleration is decreased due to you feeling heavier."); + "However, your max acceleration is decreased due to you feeling heavier.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.skeletronPrimeLore = true; + if (item.favorited) + modPlayer.skeletronPrimeLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeSlimeGod.cs b/Items/LoreItems/KnowledgeSlimeGod.cs index e980523588..c194ec932f 100644 --- a/Items/LoreItems/KnowledgeSlimeGod.cs +++ b/Items/LoreItems/KnowledgeSlimeGod.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("It is a travesty, one of the most threatening biological terrors ever created.\n" + "If this creature were allowed to combine every slime on the planet it would become nearly unstoppable.\n" + "Place in your inventory to become slimed and able to slide around on tiles quickly, at the cost of reduced defense.\n" + - "This effect makes dashing more difficult and does not work with mounts."); + "This effect makes dashing more difficult and does not work with mounts.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -32,7 +33,7 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { - if (player.mount.Active) + if (player.mount.Active || !item.favorited) return; if (player.dashDelay < 0) diff --git a/Items/LoreItems/KnowledgeTwins.cs b/Items/LoreItems/KnowledgeTwins.cs index 7314c7f2ba..1514675839 100644 --- a/Items/LoreItems/KnowledgeTwins.cs +++ b/Items/LoreItems/KnowledgeTwins.cs @@ -15,7 +15,8 @@ namespace CalamityMod.Items.LoreItems "These creatures did not belong in this world, it's best to be rid of them.\n" + "Place in your inventory to gain invisibility and rogue bonuses at night.\n" + "However, your defense is reduced while above 50% life due to you feeling softer.\n" + - "Your max acceleration is reduced while below 50% life due to you feeling heavier."); + "Your max acceleration is reduced while below 50% life due to you feeling heavier.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -34,7 +35,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.twinsLore = true; + if (item.favorited) + modPlayer.twinsLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeWallofFlesh.cs b/Items/LoreItems/KnowledgeWallofFlesh.cs index 7f485be3dc..6c4b7a7015 100644 --- a/Items/LoreItems/KnowledgeWallofFlesh.cs +++ b/Items/LoreItems/KnowledgeWallofFlesh.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems Tooltip.SetDefault("I see the deed is done.\n" + "The unholy amalgamation of flesh and hatred has been defeated.\n" + "Prepare to face the terrors that lurk in the light and dark parts of this world.\n" + - "Place in your inventory to gain increased item grab range."); + "Place in your inventory to gain increased item grab range.\n" + + "This effect only occurs if the item is favorited."); } public override void SetDefaults() @@ -33,7 +34,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.wallOfFleshLore = true; + if (item.favorited) + modPlayer.wallOfFleshLore = true; } public override void AddRecipes() diff --git a/Items/LoreItems/KnowledgeYharon.cs b/Items/LoreItems/KnowledgeYharon.cs index 535ff8a48d..bbf5a90a42 100644 --- a/Items/LoreItems/KnowledgeYharon.cs +++ b/Items/LoreItems/KnowledgeYharon.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Items.LoreItems DisplayName.SetDefault("Jungle Dragon, Yharon"); Tooltip.SetDefault("I would not be able to bear a world without my faithful companion by my side.\n" + "Fortunately, fate will have it so that it is a world I shall never have to see, for better or for worse.\n" + - "Place in your inventory to gain nearly-infinite wing flight time, but at the cost of a 25% decrease to all damage."); + "Place in your inventory to gain nearly-infinite wing flight time, but at the cost of a 25% decrease to all damage.\n" + + "These effects only occur if the item is favorited."); } public override void SetDefaults() @@ -34,7 +35,8 @@ namespace CalamityMod.Items.LoreItems public override void UpdateInventory(Player player) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.yharonLore = true; + if (item.favorited) + modPlayer.yharonLore = true; } public override void AddRecipes() From fd0a4f47ffc5f9f3774bd9d8eb8941f1cab48d33 Mon Sep 17 00:00:00 2001 From: DominicKarma42 <51094361+DominicKarma@users.noreply.github.com> Date: Mon, 29 Jun 2020 01:35:18 -0500 Subject: [PATCH 4/6] Made Yanmei's Knife typeless --- Items/Weapons/{Melee => Typeless}/YanmeisKnife.cs | 5 ++--- Items/Weapons/{Melee => Typeless}/YanmeisKnife.png | Bin .../{Melee => Typeless}/YanmeisKnifeSlash.cs | 3 +-- .../{Melee => Typeless}/YanmeisKnifeSlash.png | Bin 4 files changed, 3 insertions(+), 5 deletions(-) rename Items/Weapons/{Melee => Typeless}/YanmeisKnife.cs (95%) rename Items/Weapons/{Melee => Typeless}/YanmeisKnife.png (100%) rename Projectiles/{Melee => Typeless}/YanmeisKnifeSlash.cs (98%) rename Projectiles/{Melee => Typeless}/YanmeisKnifeSlash.png (100%) diff --git a/Items/Weapons/Melee/YanmeisKnife.cs b/Items/Weapons/Typeless/YanmeisKnife.cs similarity index 95% rename from Items/Weapons/Melee/YanmeisKnife.cs rename to Items/Weapons/Typeless/YanmeisKnife.cs index 6aaf841199..fabdacfe67 100644 --- a/Items/Weapons/Melee/YanmeisKnife.cs +++ b/Items/Weapons/Typeless/YanmeisKnife.cs @@ -1,11 +1,11 @@ using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Melee; +using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Weapons.Melee +namespace CalamityMod.Items.Weapons.Typeless { public class YanmeisKnife : ModItem { @@ -24,7 +24,6 @@ namespace CalamityMod.Items.Weapons.Melee item.width = 48; item.damage = 8; item.crit += 6; - item.melee = true; item.noMelee = true; item.noUseGraphic = true; item.useAnimation = item.useTime = 32; diff --git a/Items/Weapons/Melee/YanmeisKnife.png b/Items/Weapons/Typeless/YanmeisKnife.png similarity index 100% rename from Items/Weapons/Melee/YanmeisKnife.png rename to Items/Weapons/Typeless/YanmeisKnife.png diff --git a/Projectiles/Melee/YanmeisKnifeSlash.cs b/Projectiles/Typeless/YanmeisKnifeSlash.cs similarity index 98% rename from Projectiles/Melee/YanmeisKnifeSlash.cs rename to Projectiles/Typeless/YanmeisKnifeSlash.cs index dd629cacd0..599ff27179 100644 --- a/Projectiles/Melee/YanmeisKnifeSlash.cs +++ b/Projectiles/Typeless/YanmeisKnifeSlash.cs @@ -6,7 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Projectiles.Melee +namespace CalamityMod.Projectiles.Typeless { public class YanmeisKnifeSlash : ModProjectile { @@ -25,7 +25,6 @@ namespace CalamityMod.Projectiles.Melee projectile.friendly = true; projectile.penetrate = -1; projectile.tileCollide = false; - projectile.melee = true; projectile.ownerHitCheck = true; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 20; diff --git a/Projectiles/Melee/YanmeisKnifeSlash.png b/Projectiles/Typeless/YanmeisKnifeSlash.png similarity index 100% rename from Projectiles/Melee/YanmeisKnifeSlash.png rename to Projectiles/Typeless/YanmeisKnifeSlash.png From 32eb869041d93e1ee29f668506c29f6bc03ef2db Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 2 Jul 2020 10:34:52 -0400 Subject: [PATCH 5/6] comment grammar, yes this totally matters 100 percent --- Projectiles/Ranged/UltimaBowProjectile.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projectiles/Ranged/UltimaBowProjectile.cs b/Projectiles/Ranged/UltimaBowProjectile.cs index 866886e85d..a919fc7310 100644 --- a/Projectiles/Ranged/UltimaBowProjectile.cs +++ b/Projectiles/Ranged/UltimaBowProjectile.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Ranged } if (Main.netMode != NetmodeID.MultiplayerClient && Time % player.ActiveItem().useTime == 0) { - int type = ProjectileID.WoodenArrowFriendly; // This doesn't really matter. It's overriten anyway. But it is passed into the PackAmmo method. + int type = ProjectileID.WoodenArrowFriendly; // This doesn't really matter. It's overwritten anyway. But it is passed into the PackAmmo method. float shotSpeed = player.ActiveItem().shootSpeed; int damage = player.GetWeaponDamage(player.ActiveItem()); float knockBack = player.ActiveItem().knockBack; From b0e7cd97c5e324aeece37e9144fbc226f50716c2 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Thu, 2 Jul 2020 10:35:06 -0400 Subject: [PATCH 6/6] yes --- Projectiles/Ranged/UltimaBowProjectile.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projectiles/Ranged/UltimaBowProjectile.cs b/Projectiles/Ranged/UltimaBowProjectile.cs index a919fc7310..c5f44980fe 100644 --- a/Projectiles/Ranged/UltimaBowProjectile.cs +++ b/Projectiles/Ranged/UltimaBowProjectile.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Ranged } if (Main.netMode != NetmodeID.MultiplayerClient && Time % player.ActiveItem().useTime == 0) { - int type = ProjectileID.WoodenArrowFriendly; // This doesn't really matter. It's overwritten anyway. But it is passed into the PackAmmo method. + int type = ProjectileID.WoodenArrowFriendly; // This doesn't really matter. It's overwritten anyway. But it is passed into the PickAmmo method. float shotSpeed = player.ActiveItem().shootSpeed; int damage = player.GetWeaponDamage(player.ActiveItem()); float knockBack = player.ActiveItem().knockBack;