From 5d5cd1045cab9e143b23ea862a8e21ff17b1dfae Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 6 Nov 2020 12:39:50 -0500 Subject: [PATCH 01/46] murasama no longer draws on the first tick (drawing bug with the left) --- Projectiles/Melee/MurasamaSlash.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Projectiles/Melee/MurasamaSlash.cs b/Projectiles/Melee/MurasamaSlash.cs index c3af4bf7a1..307b029810 100644 --- a/Projectiles/Melee/MurasamaSlash.cs +++ b/Projectiles/Melee/MurasamaSlash.cs @@ -44,11 +44,14 @@ namespace CalamityMod.Projectiles.Melee projectile.ownerHitCheck = true; projectile.usesIDStaticNPCImmunity = true; projectile.idStaticNPCHitCooldown = 21; + projectile.frameCounter = 0; //projectile.Calamity().trueMelee = true; } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { + if (projectile.frameCounter <= 0) + return false; Texture2D texture = Main.projectileTexture[projectile.type]; Vector2 origin = texture.Size() / new Vector2(2f, 7f) * 0.5f; Rectangle frame = texture.Frame(2, 7, frameX, frameY); From 2edc2a4721650b9a2fbb811b3c3986f777e60a57 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 6 Nov 2020 12:40:17 -0500 Subject: [PATCH 02/46] laud now makes armor crunch and war cleave boost defense and dr respectively --- CalPlayer/CalamityPlayerMiscEffects.cs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 42f1b2df8c..42bd6163c1 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -1248,6 +1248,18 @@ namespace CalamityMod.CalPlayer player.buffTime[l] += 1; } + // See earlier as Laud cancels out the normal effects + if (hasBuff == ModContent.BuffType()) + { + // +15 defense + player.statDefense += ArmorCrunch.DefenseReduction; + } + if (hasBuff == ModContent.BuffType()) + { + // +10% damage reduction + player.endurance += 0.1f; + } + switch (hasBuff) { case BuffID.Obstructed: @@ -3161,13 +3173,13 @@ namespace CalamityMod.CalPlayer player.magicDamage -= 0.1f; } - if (modPlayer.aCrunch) + if (modPlayer.aCrunch && !modPlayer.laudanum) { player.statDefense -= ArmorCrunch.DefenseReduction; player.endurance *= 0.33f; } - if (modPlayer.wCleave) + if (modPlayer.wCleave && !modPlayer.laudanum) { player.statDefense -= WarCleave.DefenseReduction; player.endurance *= 0.75f; From fa1685879e96e0be32129199e056b5f26716cf1f Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 6 Nov 2020 12:40:41 -0500 Subject: [PATCH 03/46] comment fix --- CalPlayer/CalamityPlayerMiscEffects.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 42bd6163c1..07dd66956e 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -1248,7 +1248,7 @@ namespace CalamityMod.CalPlayer player.buffTime[l] += 1; } - // See earlier as Laud cancels out the normal effects + // See later as Laud cancels out the normal effects if (hasBuff == ModContent.BuffType()) { // +15 defense From 405825e5ed597afcb9d4241633ff426287fb0a59 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 6 Nov 2020 13:58:08 -0500 Subject: [PATCH 04/46] ebonian gel now looks better item.notAmmo bool is kind of shoehorned but pretty sure we want to avoid making custom ones if possible to avoid memory leaks --- Items/Materials/EbonianGel.cs | 24 +++++++++++++++++++++++- Items/Materials/EbonianGelRed.png | Bin 0 -> 337 bytes NPCs/NormalNPCs/CrimulanBlightSlime.cs | 2 +- 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 Items/Materials/EbonianGelRed.png diff --git a/Items/Materials/EbonianGel.cs b/Items/Materials/EbonianGel.cs index 758d825253..c10467e4e3 100644 --- a/Items/Materials/EbonianGel.cs +++ b/Items/Materials/EbonianGel.cs @@ -1,3 +1,5 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; @@ -13,10 +15,30 @@ namespace CalamityMod.Items.Materials public override void SetDefaults() { item.width = 16; - item.height = 14; + item.height = 18; item.maxStack = 999; item.value = Item.sellPrice(silver: 6); item.rare = 1; } + + public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale) + { + if (item.notAmmo) + { + Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Materials/EbonianGelRed"); + spriteBatch.Draw(texture, position, frame, Color.White, 0f, origin, scale, SpriteEffects.None, 0); + } + return !item.notAmmo; + } + + public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) + { + if (item.notAmmo) + { + Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Materials/EbonianGelRed"); + spriteBatch.Draw(texture, item.position - Main.screenPosition, new Rectangle(0, 0, item.width, item.height), lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); + } + return !item.notAmmo; + } } } diff --git a/Items/Materials/EbonianGelRed.png b/Items/Materials/EbonianGelRed.png new file mode 100644 index 0000000000000000000000000000000000000000..77ce83cbe34dbda460b51079b304cddeec2b3c76 GIT binary patch literal 337 zcmV-X0j~auP)Px$3rR#lR5*>bl(A|8K@f(&4H67z1kXw(jR=?HN@M3c2mxQkN3giJuoeUh-$1w` zNvX-fVVMZQ6V!l(uqkdAa>rSSo4?teof+n1XLf~Wy8t}dWdQb^BsqGlmIc7aW(U9| zdIR7lFZdD_oRS5=YrK;HgH|&Y;5jw`!(b`@l04HkLm)icO;w(K9|0J2>$wTTU?G@<<5cbisxjA zl&&WT4?h58Nwl&=ezZ#B?=3@fu!!H)*41YM;Nh;QD@uTox_zy1pO9bw7S1{JKhddG j0C@S@N@WXWn<4lG%MeYc&$p)I00000NkvXXu0mjfX8MT^ literal 0 HcmV?d00001 diff --git a/NPCs/NormalNPCs/CrimulanBlightSlime.cs b/NPCs/NormalNPCs/CrimulanBlightSlime.cs index 107ceb9e89..c14cf6dfde 100644 --- a/NPCs/NormalNPCs/CrimulanBlightSlime.cs +++ b/NPCs/NormalNPCs/CrimulanBlightSlime.cs @@ -73,7 +73,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { int item = Item.NewItem(npc.Center, npc.Size, ModContent.ItemType(), Main.rand.Next(15, 21), false, 0, false, false); - Main.item[item].color = new Color(250, 50, 50, 255); + Main.item[item].notAmmo = true; NetMessage.SendData(MessageID.ItemTweaker, -1, -1, null, item, 1f, 0f, 0f, 0, 0, 0); DropHelper.DropItem(npc, ItemID.Gel, 10, 14); From 08c73607d860b9e86ce5d4902383dca855824fc2 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 6 Nov 2020 13:58:51 -0500 Subject: [PATCH 05/46] coin of deceit now reduces the cost of stealth strikes recipe now has Acidwood, forcing exploration to the world's edge at the very least --- CalPlayer/CalamityPlayer.cs | 17 +++++++++++++++-- Items/Accessories/CoinofDeceit.cs | 7 ++++++- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 7ac0fbad50..84ac4aae6d 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -286,6 +286,7 @@ namespace CalamityMod.CalPlayer public float stealthAcceleration = 1f; public bool stealthStrikeThisFrame = false; public bool stealthStrikeHalfCost = false; + public bool stealthStrike75Cost = false; public bool stealthStrikeAlwaysCrits = false; public bool wearingRogueArmor = false; public float accStealthGenBoost = 0f; @@ -9667,6 +9668,7 @@ namespace CalamityMod.CalPlayer stealthGenMoving = 1f; stealthStrikeThisFrame = false; stealthStrikeHalfCost = false; + stealthStrike75Cost = false; stealthStrikeAlwaysCrits = false; // stealthAcceleration only resets if you don't have either of the accelerator accessories equipped @@ -9837,7 +9839,12 @@ namespace CalamityMod.CalPlayer { if (rogueStealthMax <= 0f) return false; - return rogueStealth >= rogueStealthMax * (stealthStrikeHalfCost ? 0.5f : 1f); + float consumptionMult = 1f; + if (stealthStrikeHalfCost) + consumptionMult = 0.5f; + else if (stealthStrike75Cost) + consumptionMult = 0.75f; + return rogueStealth >= rogueStealthMax * consumptionMult; } internal void ConsumeStealthByAttacking() @@ -9851,7 +9858,13 @@ namespace CalamityMod.CalPlayer if (rogueStealth <= 0f) rogueStealth = 0f; } - else + else if (stealthStrike75Cost) + { + rogueStealth -= 0.75f * rogueStealthMax; + if (rogueStealth <= 0f) + rogueStealth = 0f; + } + else rogueStealth = 0f; } #endregion diff --git a/Items/Accessories/CoinofDeceit.cs b/Items/Accessories/CoinofDeceit.cs index 05bf985301..02df07820c 100644 --- a/Items/Accessories/CoinofDeceit.cs +++ b/Items/Accessories/CoinofDeceit.cs @@ -1,3 +1,4 @@ +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -9,7 +10,8 @@ namespace CalamityMod.Items.Accessories public override void SetStaticDefaults() { DisplayName.SetDefault("Coin of Deceit"); - Tooltip.SetDefault("6% increased rogue crit chance"); + Tooltip.SetDefault("Stealth strikes only expend 75% of your max stealth\n" + + "6% increased rogue crit chance"); } public override void SetDefaults() @@ -24,6 +26,7 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { player.Calamity().throwingCrit += 6; + player.Calamity().stealthStrike75Cost = true; } public override void AddRecipes() @@ -31,6 +34,8 @@ namespace CalamityMod.Items.Accessories ModRecipe recipe = new ModRecipe(mod); recipe.AddRecipeGroup("AnyGoldBar", 4); recipe.AddRecipeGroup("AnyCopperBar", 8); + // So you make fake coins out of wood, nobody will judge you + recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddTile(TileID.Anvils); recipe.SetResult(this); recipe.AddRecipe(); From b61a365d5f028177e3c13675a4973b4c56cb9230 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 6 Nov 2020 14:07:20 -0500 Subject: [PATCH 06/46] murasama tweak --- Projectiles/Melee/MurasamaSlash.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projectiles/Melee/MurasamaSlash.cs b/Projectiles/Melee/MurasamaSlash.cs index 307b029810..80058e9f6c 100644 --- a/Projectiles/Melee/MurasamaSlash.cs +++ b/Projectiles/Melee/MurasamaSlash.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - if (projectile.frameCounter <= 0) + if (projectile.frameCounter <= 1) return false; Texture2D texture = Main.projectileTexture[projectile.type]; Vector2 origin = texture.Size() / new Vector2(2f, 7f) * 0.5f; From c5dbec7d3dbda10af1a83977173e1f3297be1c43 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 6 Nov 2020 14:59:43 -0500 Subject: [PATCH 07/46] Added glowmasks to several materials --- Items/Materials/AscendantSpiritEssence.cs | 26 ++++++++++++++-------- Items/Materials/AuricBar.cs | 5 ++--- Items/Materials/CalamitousEssence.cs | 18 ++++++++++----- Items/Materials/CoreofCalamity.cs | 13 +++++++++-- Items/Materials/CoreofCalamityGlow.png | Bin 0 -> 669 bytes Items/Materials/CoreofChaos.cs | 18 ++++++++++----- Items/Materials/CoreofChaosGlow.png | Bin 0 -> 429 bytes Items/Materials/CoreofCinder.cs | 18 ++++++++++----- Items/Materials/CoreofCinderGlow.png | Bin 0 -> 477 bytes Items/Materials/CoreofEleum.cs | 18 ++++++++++----- Items/Materials/CoreofEleumGlow.png | Bin 0 -> 459 bytes Items/Materials/DarksunFragment.cs | 16 ++++++++----- Items/Materials/DarksunFragmentGlow.png | Bin 0 -> 1335 bytes Items/Materials/EndothermicEnergy.cs | 23 ++++++++++++------- Items/Materials/EndothermicEnergyGlow.png | Bin 0 -> 1449 bytes Items/Materials/EssenceofChaos.cs | 18 ++++++++++----- Items/Materials/EssenceofCinder.cs | 18 ++++++++++----- Items/Materials/EssenceofEleum.cs | 18 ++++++++++----- Items/Materials/NightmareFuel.cs | 23 ++++++++++++------- Items/Materials/NightmareFuelGlow.png | Bin 0 -> 1500 bytes Items/Materials/Phantoplasm.cs | 5 +---- Projectiles/Rogue/ShroomerangSpore.cs | 1 - 22 files changed, 163 insertions(+), 75 deletions(-) create mode 100644 Items/Materials/CoreofCalamityGlow.png create mode 100644 Items/Materials/CoreofChaosGlow.png create mode 100644 Items/Materials/CoreofCinderGlow.png create mode 100644 Items/Materials/CoreofEleumGlow.png create mode 100644 Items/Materials/DarksunFragmentGlow.png create mode 100644 Items/Materials/EndothermicEnergyGlow.png create mode 100644 Items/Materials/NightmareFuelGlow.png diff --git a/Items/Materials/AscendantSpiritEssence.cs b/Items/Materials/AscendantSpiritEssence.cs index 96cb62b426..28e4aa4296 100644 --- a/Items/Materials/AscendantSpiritEssence.cs +++ b/Items/Materials/AscendantSpiritEssence.cs @@ -1,8 +1,10 @@ -using Terraria; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; using Terraria.ModLoader; using Terraria.DataStructures; -using CalamityMod.Tiles.Furniture.CraftingStations; -using Terraria.ID; namespace CalamityMod.Items.Materials { @@ -15,12 +17,6 @@ namespace CalamityMod.Items.Materials Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 6)); } - public override void Update(ref float gravity, ref float maxFallSpeed) - { - float brightness = Main.essScale * Main.rand.NextFloat(0.9f, 1.1f); - Lighting.AddLight(item.Center, 1.2f * brightness, 0.4f * brightness, 0.8f); - } - public override void SetDefaults() { item.width = 32; @@ -30,6 +26,18 @@ namespace CalamityMod.Items.Materials item.Calamity().customRarity = CalamityRarity.DarkBlue; item.value = Item.sellPrice(gold: 25); } + + public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) + { + CalamityUtils.DrawItemGlowmask(item, spriteBatch, 6, rotation, Main.itemTexture[item.type]); + } + + public override void Update(ref float gravity, ref float maxFallSpeed) + { + float brightness = Main.essScale * Main.rand.NextFloat(0.9f, 1.1f); + Lighting.AddLight(item.Center, 1.2f * brightness, 0.4f * brightness, 0.8f); + } + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Materials/AuricBar.cs b/Items/Materials/AuricBar.cs index d2b5ab8403..c06d5fc756 100644 --- a/Items/Materials/AuricBar.cs +++ b/Items/Materials/AuricBar.cs @@ -33,9 +33,8 @@ namespace CalamityMod.Items.Materials public override void Update(ref float gravity, ref float maxFallSpeed) { - float num = (float)Main.rand.Next(90, 111) * 0.01f; - num *= Main.essScale; - Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 0.5f * num, 0.7f * num, 0f); + float brightness = Main.essScale * Main.rand.NextFloat(0.9f, 1.1f); + Lighting.AddLight(item.Center, 0.5f * brightness, 0.7f * brightness, 0f); } public override void AddRecipes() diff --git a/Items/Materials/CalamitousEssence.cs b/Items/Materials/CalamitousEssence.cs index 81fe2b5fc1..1779444abb 100644 --- a/Items/Materials/CalamitousEssence.cs +++ b/Items/Materials/CalamitousEssence.cs @@ -1,3 +1,5 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -13,19 +15,25 @@ namespace CalamityMod.Items.Materials public override void SetDefaults() { - item.width = 10; - item.height = 14; + item.width = 20; + item.height = 34; item.maxStack = 999; item.rare = ItemRarityID.Red; item.value = Item.sellPrice(gold: 24); item.Calamity().customRarity = CalamityRarity.Violet; } + public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) + { + Texture2D texture = Main.itemTexture[item.type]; + Vector2 origin = new Vector2(texture.Width / 2f, texture.Height / 2f - 2f); + spriteBatch.Draw(texture, item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + } + public override void Update(ref float gravity, ref float maxFallSpeed) { - float num = (float)Main.rand.Next(90, 111) * 0.01f; - num *= Main.essScale; - Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 0.1f * num, 0.1f * num, 0.1f * num); + float brightness = Main.essScale * Main.rand.NextFloat(0.9f, 1.1f); + Lighting.AddLight(item.Center, 0.1f * brightness, 0.1f * brightness, 0.1f * brightness); } } } diff --git a/Items/Materials/CoreofCalamity.cs b/Items/Materials/CoreofCalamity.cs index 4f5ed57674..752ba369e2 100644 --- a/Items/Materials/CoreofCalamity.cs +++ b/Items/Materials/CoreofCalamity.cs @@ -1,3 +1,5 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -13,13 +15,20 @@ namespace CalamityMod.Items.Materials public override void SetDefaults() { - item.width = 40; - item.height = 40; + item.width = 36; + item.height = 36; item.maxStack = 99; item.value = Item.sellPrice(gold: 4); item.rare = 8; } + public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) + { + Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Materials/CoreofCalamityGlow"); + Vector2 origin = new Vector2(texture.Width / 2f, texture.Height / 2f - 2f); + spriteBatch.Draw(texture, item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + } + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Materials/CoreofCalamityGlow.png b/Items/Materials/CoreofCalamityGlow.png new file mode 100644 index 0000000000000000000000000000000000000000..9fa22c3303f6406e14b2f3090920480f0a381bcd GIT binary patch literal 669 zcmV;O0%HA%P)enPpMH8hO0<8v(F|5! zo_`x9gkZS}mUe#J+zyuief$NO-g1nUxHL524uUxV=5rXo$y^%jgQIsKX#qk{^&}G&!M>vrVb{bHQ^LWu0t=O(L)BthlLD` zkF%s6bPj^K7*@H$${(0Gti*A9#HchI?51N5WBnc4w%1Wk_?#M%^(4$k8J$_rrUjVu-Ep)h6uX4LGK`MMj5b=(W8=3 zNKq}9p@-0bI|vqqFo!9-tDvL}SV+Ot!EzaT)Ke{l2Cai&4kJ|F;L1Ey51~QpAasYp z_~<1!&C?LN1?Y)+z#T+tK})kVM5;qz>PH+4=Spm_`q&4Ic5}khE6e#TtO3Q>K6e zhiV}-XdDFdE-dPr%%#CXbtj*qgak~Se{uqf_{ZD@U_RACXwW-oT7enZjT;x=KnV%2 z?YUUf4$VV|?hbohoLO#Tmme8{p#UV8490W@n zuo4)(u7Z`+uqp%=BCxtk#1c}1!vHJ|qMJu_8X9yC!dlEC2@-0Cz|s~h?ZC96SIR_( z(2#QwAqV4!LyGDlH0T@zD?ni- zGpz0-6f&@oqIw7oItRgg3X3{Yd$Lpyp+V~)atlhDh0v&j$PEEP`bMK{G=vC+03mq* XzPlsr9|*EY00000NkvXXu0mjfO7XX} literal 0 HcmV?d00001 diff --git a/Items/Materials/CoreofCinder.cs b/Items/Materials/CoreofCinder.cs index e8457a9fd1..e3b0831bed 100644 --- a/Items/Materials/CoreofCinder.cs +++ b/Items/Materials/CoreofCinder.cs @@ -1,3 +1,5 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -13,18 +15,24 @@ namespace CalamityMod.Items.Materials public override void SetDefaults() { - item.width = 16; - item.height = 16; + item.width = 34; + item.height = 34; item.maxStack = 999; item.value = Item.sellPrice(silver: 40); item.rare = 8; } + public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) + { + Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Materials/CoreofCinderGlow"); + Vector2 origin = new Vector2(texture.Width / 2f, texture.Height / 2f - 2f); + spriteBatch.Draw(texture, item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + } + public override void Update(ref float gravity, ref float maxFallSpeed) { - float num = (float)Main.rand.Next(90, 111) * 0.01f; - num *= Main.essScale; - Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 0.3f * num, 0.3f * num, 0.05f * num); + float brightness = Main.essScale * Main.rand.NextFloat(0.9f, 1.1f); + Lighting.AddLight(item.Center, 0.3f * brightness, 0.3f * brightness, 0.05f * brightness); } public override void AddRecipes() diff --git a/Items/Materials/CoreofCinderGlow.png b/Items/Materials/CoreofCinderGlow.png new file mode 100644 index 0000000000000000000000000000000000000000..2aeab60cd2e92ee9f05fcf5611adc12b6cb9dcc1 GIT binary patch literal 477 zcmV<30V4j1P)5}%1-nX)E@|fjh%w1DN=}ykXE}i7J?QbpheWm&PEV_K>Y<%}Ni7?7LRk$C?4{vphIPq!(1*@}&|v7D>zH)Z{N zdzAJ5Y$)sA)w$e{juCet006INmrpWDup&4=ei?`Y56@LuSBVBEw_Ff$ zzOz+JDS&fYY?+Fb4hR??-;IK@1# z&dVd@f4$i?ZM0bb_5A1Mtc)8F&1>w(dal(M?LEKb=Ad%}!c43tr!nU_gu5-@GXu~a z2moN7K-R!I&1($D2zE;eD5EOk4kUJ-K;2=*VuM`G8V)vXu*n^WHcz1U#Eu76)m0TK z4G?CaP3sIev|F2XB($<>U3+RkEHAAYb&q)tqQWRV}({s6!A$gQ~!lkZNodf)nQ;L6QoBq^<%94%dcF zM!exRdza?!Jrd5nc6V=fc6Q#?qKcm3+5PtCRgL&4^NqENa75mLFo3Jxx6}JHIgoSd zjFb)}?u=yS{2Vr8=O<`_nLyCqj06V+4DdFb^y&^X-RL7z8|(CaKaGHq%7H+1tcm5# zKm>pB@Fto;hlo3!x1E&dot{g`n1SwBH3<4E35@<6>Gy}Bp4t-ikYvjZ!?+THRjnPAN904rbdDR zVtppC)oa>;=rxU*jCcpa2FA0u0J7793FI+zDkI*3urs0q_yRjAGXu>`9xvrD%}F`$ z7bC#{VP61p%ot9~%y6D{x0s9s14P>fzWjLh?4a76qSepsBYy@6I>l%;hb^6v%7E}^ zf#oNb^O{?u6$l1M(GH8o=iZv4g^R}j17XH?Z+~eP*{)O100000NkvXXu0mjf005Y7 B&|d%m literal 0 HcmV?d00001 diff --git a/Items/Materials/DarksunFragment.cs b/Items/Materials/DarksunFragment.cs index dae75292f2..73b923f3b2 100644 --- a/Items/Materials/DarksunFragment.cs +++ b/Items/Materials/DarksunFragment.cs @@ -1,3 +1,5 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.DataStructures; using Terraria.ModLoader; @@ -15,19 +17,23 @@ namespace CalamityMod.Items.Materials public override void SetDefaults() { - item.width = 20; - item.height = 19; + item.width = 28; + item.height = 32; item.maxStack = 999; item.rare = 10; item.value = Item.sellPrice(gold: 12); item.Calamity().customRarity = CalamityRarity.Violet; } + public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) + { + CalamityUtils.DrawItemGlowmask(item, spriteBatch, 8, rotation, ModContent.GetTexture("CalamityMod/Items/Materials/DarksunFragmentGlow")); + } + public override void Update(ref float gravity, ref float maxFallSpeed) { - float num = (float)Main.rand.Next(90, 111) * 0.01f; - num *= Main.essScale; - Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 0.5f * num, 0.5f * num, 0.5f * num); + float brightness = Main.essScale * Main.rand.NextFloat(0.9f, 1.1f); + Lighting.AddLight(item.Center, 0.5f * brightness, 0.5f * brightness, 0.5f * brightness); } } } diff --git a/Items/Materials/DarksunFragmentGlow.png b/Items/Materials/DarksunFragmentGlow.png new file mode 100644 index 0000000000000000000000000000000000000000..9794ca847653b46e96742df68222052c4694d095 GIT binary patch literal 1335 zcmV-71<3k|P)@{_mQRtgT@GKN0;+Wk*vl~G|dptx}N z*%Muje!O_o{eAd+t4{YfHe3U}1l0#+nMC_g2puRjc)WUSVIDhvbdSqYX;UdjX96P& zmj;xexq4yC(9L(>yT4+o{;c~cnzqa+r2(Z4KYrQURaW}rnOo<&&v(~0i=tLrJhG4u zwA#QL>QI|O3;!BmsU_C^uHmW`>{mGnG`%Tf=i!U{7VfcT33Dvq(|}&N zW<6}Mw)C1K4Gl<_Yjj}h!`xqr=0T|OX&YLtn$qPO9q4T%bRW!VPywaa6Ikjocz?PS zx~TMquuD;b9L~H;^HXH8+d?gB(Bg8ng)|_N+RY{R(ttZhA0kbG+SJ`Gq@c-wR!V{1 z;3`&6NFO!_(&U<0Mgz8zYiJf}{{EpGnEEjFAxbS$AC5ef`Y;?c-Y-V)E1vPAAhTQ4 z7Kpx|79tN7Ur(0~E<>q<*SBt$(tt~oYkEJocA-~-Lzf~~Heb%81GVcWlWSI(PXn+;$=hNupw$b6!-sL>gwZ<9H)16=H1*SekC$*x*Xt?&2`cRZ{^?|AM<3#B|D~X{m z=h1eXgMW52?cRUd$z_VD%J?5z(6r2{;55iGptwsO^gct%8h4$<5 znou>qcIz+OZTL#9GK(~o3^3Dnfk!}S4PPOXyDc>^G)Z>_Dz}pAo*#m2Pyc^>r_#9~tdQO3LvwgM0D^ zMIJ%vzN@0aYzs^;l?x0%UuzVweVr!1`2eh?w6&LSQ!R?Bp)_@fA#XlkU%R_B7+n#u zy1q2~bAu%Vfjk4+281OLRjS?{Z9>fN1D*PaqMJG>2BI@CkzM`pE;g(PI!?&Uw=EvCC8k=d6Zi)^{0{yj+b; zWtAr~%l=K{fjL1MFmv9%9gR;|T|l`|zBYP@%bX`HzS5*-K*d+eV!Tj3bM{QKBt<>}Sm5x9ZM5RmG{$YT4vM$wgm|z9`Jn>qdCs2x zkpdnB9bZ*WeCkU^g{Oqex=Sb4@XJ-1P)z@=s%iFvlGRJYYXNyiMbv^kqq4WQ8UKcP zS6;*0HmBo+lGIQKWn-S+QWVV`@9KbWeBQ+4DvKNNp^+Wm8l<_+>U!2$kygn$ttZ<_ zhZbfyv2N{(EZntYxB&y15i34aIB5nC21nE$??+ILs7lanS%!7K7{9ni#A}Co9R0)9{@`YZ~} zVzFn!Iqub6g24l99EDN7crBmc{j$iBQ8s+<33kCu@LeC~|N4SGvy>7VT6n^!_(J3R zYTD65w&yWzbL0n1b&~@-&9Z2px{)PA?2C!HFU>>9vYG*?A~+lYDzO?!eMX-*pkkc22WM|kH$WJ#IYhr*!R5B-3_wJq!SX6C?u)vxNZK+J8 z?g*6&!?dW8cDk4mj{bxaokZ8on$WRo(zGKm%>4rNHVhqN=kB2#3%u7( zGv2R!M9w7PSuFD$Hdd$;3?9k8Ib9X(ZWlr>c|(cTLB%KP$uP)^Rr+!t+;qt;A9o&j zv?4%iM_YwUt?xv+-MBDQPZ8+5%}!|vEPBX{`JTo&%l9!KD1pi~;b7rb410%kxM}9H zMFdP7(-ZHKp;xjiY;shiqst|X`plym@NpZ19Nk=xt+WieuG0>6+uDfhm>h8>5%RB^ z5}l~EQH_Yg3ej`{dO@jr!58&kPyJ&pjK+&W3AWcm%QKIiZuPWcP0!9?>930-hVx-? zVImOegg3VfM>8wq&SekU`Mj1iaR6i9ohI?PPYs^(PJ$28?HSi#%F-@VrDIOT5(oviEt literal 0 HcmV?d00001 diff --git a/Items/Materials/EssenceofChaos.cs b/Items/Materials/EssenceofChaos.cs index 2678e468b5..e2b73058ac 100644 --- a/Items/Materials/EssenceofChaos.cs +++ b/Items/Materials/EssenceofChaos.cs @@ -1,3 +1,5 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; @@ -13,18 +15,24 @@ namespace CalamityMod.Items.Materials public override void SetDefaults() { - item.width = 8; - item.height = 10; + item.width = 34; + item.height = 24; item.maxStack = 999; item.value = Item.sellPrice(silver: 40); item.rare = 5; } + public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) + { + Texture2D texture = Main.itemTexture[item.type]; + Vector2 origin = new Vector2(texture.Width / 2f, texture.Height / 2f - 2f); + spriteBatch.Draw(texture, item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + } + public override void Update(ref float gravity, ref float maxFallSpeed) { - float num = (float)Main.rand.Next(90, 111) * 0.01f; - num *= Main.essScale; - Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 0.5f * num, 0.3f * num, 0.05f * num); + float brightness = Main.essScale * Main.rand.NextFloat(0.9f, 1.1f); + Lighting.AddLight(item.Center, 0.5f * brightness, 0.3f * brightness, 0.05f * brightness); } } } diff --git a/Items/Materials/EssenceofCinder.cs b/Items/Materials/EssenceofCinder.cs index f878f49954..d39df25c5b 100644 --- a/Items/Materials/EssenceofCinder.cs +++ b/Items/Materials/EssenceofCinder.cs @@ -1,3 +1,5 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; @@ -13,18 +15,24 @@ namespace CalamityMod.Items.Materials public override void SetDefaults() { - item.width = 8; - item.height = 22; + item.width = 30; + item.height = 24; item.maxStack = 999; item.value = Item.sellPrice(silver: 40); item.rare = 5; } + public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) + { + Texture2D texture = Main.itemTexture[item.type]; + Vector2 origin = new Vector2(texture.Width / 2f, texture.Height / 2f - 2f); + spriteBatch.Draw(texture, item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + } + public override void Update(ref float gravity, ref float maxFallSpeed) { - float num = (float)Main.rand.Next(90, 111) * 0.01f; - num *= Main.essScale; - Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 0.3f * num, 0.3f * num, 0.05f * num); + float brightness = Main.essScale * Main.rand.NextFloat(0.9f, 1.1f); + Lighting.AddLight(item.Center, 0.3f * brightness, 0.3f * brightness, 0.05f * brightness); } } } diff --git a/Items/Materials/EssenceofEleum.cs b/Items/Materials/EssenceofEleum.cs index c4f0618a79..fbd6c8fe1f 100644 --- a/Items/Materials/EssenceofEleum.cs +++ b/Items/Materials/EssenceofEleum.cs @@ -1,3 +1,5 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; @@ -13,18 +15,24 @@ namespace CalamityMod.Items.Materials public override void SetDefaults() { - item.width = 8; - item.height = 20; + item.width = 34; + item.height = 26; item.maxStack = 999; item.value = Item.sellPrice(silver: 40); item.rare = 5; } + public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) + { + Texture2D texture = Main.itemTexture[item.type]; + Vector2 origin = new Vector2(texture.Width / 2f, texture.Height / 2f - 2f); + spriteBatch.Draw(texture, item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + } + public override void Update(ref float gravity, ref float maxFallSpeed) { - float num = (float)Main.rand.Next(90, 111) * 0.01f; - num *= Main.essScale; - Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 0.15f * num, 0.05f * num, 0.5f * num); + float brightness = Main.essScale * Main.rand.NextFloat(0.9f, 1.1f); + Lighting.AddLight(item.Center, 0.15f * brightness, 0.05f * brightness, 0.5f * brightness); } } } diff --git a/Items/Materials/NightmareFuel.cs b/Items/Materials/NightmareFuel.cs index 489f05df82..784a406137 100644 --- a/Items/Materials/NightmareFuel.cs +++ b/Items/Materials/NightmareFuel.cs @@ -1,3 +1,5 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; using Terraria.DataStructures; @@ -13,20 +15,25 @@ namespace CalamityMod.Items.Materials Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 6)); } - public override void Update(ref float gravity, ref float maxFallSpeed) - { - float brightness = Main.essScale * Main.rand.NextFloat(0.9f, 1.1f); - Lighting.AddLight(item.Center, 0.7f * brightness, 0.7f * brightness, 0f); - } - public override void SetDefaults() { - item.width = 20; - item.height = 20; + item.width = 38; + item.height = 36; item.maxStack = 999; item.rare = 10; item.value = Item.sellPrice(gold: 2); item.Calamity().customRarity = CalamityRarity.DarkBlue; } + + public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) + { + CalamityUtils.DrawItemGlowmask(item, spriteBatch, 6, rotation, ModContent.GetTexture("CalamityMod/Items/Materials/NightmareFuelGlow")); + } + + public override void Update(ref float gravity, ref float maxFallSpeed) + { + float brightness = Main.essScale * Main.rand.NextFloat(0.9f, 1.1f); + Lighting.AddLight(item.Center, 0.7f * brightness, 0.7f * brightness, 0f); + } } } diff --git a/Items/Materials/NightmareFuelGlow.png b/Items/Materials/NightmareFuelGlow.png new file mode 100644 index 0000000000000000000000000000000000000000..06e2d2db1033fc8f8e63b5e7dace6345c4f6f5fb GIT binary patch literal 1500 zcmV<21ta>2P)jnX6ty=XAR#8kL`!*gx{Gc3 z(dv;jdW%IwF`DJm>(*bZrP*!@|NMHl+28!c!?&Al$xqqeDf+P+kZxf64`-7i*FScX zAV?W0w|ROtmD`?OE~@nJmj?^DFVldP)_lLam};zlz8#d_zTUYa{QX)|m=;W^b4^&% z694rsl$RE)wi42?U|9*Ac z-~If0G-5PY?Bu|-zck8ipPWx(byMtgz*u}NQLHtXon4@LnU({ykLo@~1EwIEJ-V3C zo01nRMhliWF&O)Dm6CGBiqV6WOo?uLx0+%DthNHt-=i^Q_1HyJ2~?gAOkx%HKOIlO zx|@;~44JmOVgsyJD;=hcD%ngiZ-(lD-aRm#KxRh0t%A)Is}3e1&S;d`^O@*#7`3JW zD{V#Abh_GcVyzm!pI;C`R54nxs1JDMz1W0(KM5^(|H0DdykHV3G~p$$qEew|{g?)S zX~9GyC#GRrb$i8ngTZi=aVm*QTVHFoe4_))1=5jVj^lf+v)IRI!IB<)o_}qgzd3#s z>^6!OqX$c}2PBFeR7!o(bHd!`v|!qEn=x`zEAJv#Aym$ekvw41D$R^ETH$uBk_{}X z3@Tq;u>n>~f#~lHQx3(V3Pj5fAEQ-FRzU*jWg4$$%I;t`-sNQ+uQpb82eZkLl4Gqo zi1S=u6uJIKY-qwW4x>9~nlr(FBBz8dy7F8y`#?J-#fs5`p+Vj*LYmKD zb7vd0V7V2r<*NDEQh?Q#Z?yo2Vo@cBVnea00@3or$A)570l04Lz9(KOtwAch*!jJc zb>dSXE>?XIrvpP1za$2Wq{vh*Y)V=%uRqe&(W|RNQ4_tE$l~?K^XW0#AqgvXvS0#k z*OhjqjS_;_izv>QBhY~9LU`_YZBn_HLS5a*&`?DO<~0_iY;(nEz>>JwOeVW;@TR2s zz8@)9T`?Lk7i!!!UWJ0-b3fXeZL*}G9Pv(Rm8)cs9Sx>zw*Ft3OADh_X>@m|b* zzVx6~bFgRybjB+$nmzLB{g?-c`Z=2~yE<4hUjw&m4KUBd_IWqOJkSB=DKtzORcI*I zT`_bwr+_Uzq+Hxx(13Z14N=OjhLVgt=ib<`Vsv1&E)~taFE(2-TCmdQkKRX7pKQfW z2F#0Zl~!c2VzgkWUs9zOo)Xj%W2xk{V7daAd#vp}inhjcOu~zk6)Q#$W`#+X{6IPH zK&1%p8oa7tOqODik={+sJ#-a^&Oi(UF*Iv33Ih3s%tFgxo12UF!FeSY36LU$0X zA0J}{6Xmjx`~%;s=40Nn45roh0!xA>Aj;kBoH$a94h)8&z@eAb6gxRE?eD<%-gLH- zJLJ?Zhfd`4fUVtKcnW*>UN`GtEtofbvgPkCSTrr7`6(Ma4a&VBZ8b2j5hU}t`5#vE zF%QtL%DRKme#nUy44JsQDF>L>`f{HSQ|2lq<^BLF-*Ri&w+3YZ0000 new Color(200, 200, 200, 0); } } diff --git a/Projectiles/Rogue/ShroomerangSpore.cs b/Projectiles/Rogue/ShroomerangSpore.cs index 69c919e116..ae2aa462ae 100644 --- a/Projectiles/Rogue/ShroomerangSpore.cs +++ b/Projectiles/Rogue/ShroomerangSpore.cs @@ -7,7 +7,6 @@ namespace CalamityMod.Projectiles.Rogue { public class ShroomerangSpore : ModProjectile { - private int scaleFactor = 0; private bool initialized = false; public override void SetStaticDefaults() { From 383f0dc6683b8d020f9d4867bbad37b91fceb4e0 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 6 Nov 2020 16:27:09 -0500 Subject: [PATCH 08/46] Fixed weird sync bug with item glowmasks Fuck glowmasks period tbh --- Items/Materials/AscendantSpiritEssence.cs | 12 ++++++--- Items/Materials/AuricBar.cs | 18 ++++++++++--- Items/Materials/CruptixBar.cs | 22 ++++------------ Items/Materials/DarksunFragment.cs | 18 ++++++++++--- Items/Materials/EndothermicEnergy.cs | 18 ++++++++++--- Items/Materials/NightmareFuel.cs | 18 ++++++++++--- Items/PermanentBoosters/Ectoheart.cs | 25 +++++------------- .../RedLightningContainer.cs | 25 +++++------------- Items/Weapons/Melee/Murasama.cs | 26 +++++-------------- Utilities/CalamityUtils.cs | 12 +++++++++ 10 files changed, 99 insertions(+), 95 deletions(-) diff --git a/Items/Materials/AscendantSpiritEssence.cs b/Items/Materials/AscendantSpiritEssence.cs index 28e4aa4296..b3482d3720 100644 --- a/Items/Materials/AscendantSpiritEssence.cs +++ b/Items/Materials/AscendantSpiritEssence.cs @@ -10,6 +10,8 @@ namespace CalamityMod.Items.Materials { public class AscendantSpiritEssence : ModItem { + public int frameCounter = 0; + public int frame = 0; public override void SetStaticDefaults() { DisplayName.SetDefault("Ascendant Spirit Essence"); @@ -27,10 +29,12 @@ namespace CalamityMod.Items.Materials item.value = Item.sellPrice(gold: 25); } - public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) - { - CalamityUtils.DrawItemGlowmask(item, spriteBatch, 6, rotation, Main.itemTexture[item.type]); - } + public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) + { + Texture2D texture = Main.itemTexture[item.type]; + spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, 6, 6), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); + return false; + } public override void Update(ref float gravity, ref float maxFallSpeed) { diff --git a/Items/Materials/AuricBar.cs b/Items/Materials/AuricBar.cs index c06d5fc756..78a5242226 100644 --- a/Items/Materials/AuricBar.cs +++ b/Items/Materials/AuricBar.cs @@ -10,6 +10,8 @@ namespace CalamityMod.Items.Materials { public class AuricBar : ModItem { + public int frameCounter = 0; + public int frame = 0; public override void SetStaticDefaults() { DisplayName.SetDefault("Auric Tesla Bar"); @@ -26,10 +28,18 @@ namespace CalamityMod.Items.Materials item.Calamity().customRarity = CalamityRarity.Violet; } - public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) - { - CalamityUtils.DrawItemGlowmask(item, spriteBatch, 16, rotation, ModContent.GetTexture("CalamityMod/Items/Materials/AuricBarGlow")); - } + public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) + { + Texture2D texture = Main.itemTexture[item.type]; + spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, 6, 16), lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); + return false; + } + + public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) + { + Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Materials/AuricBarGlow"); + spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, 6, 16, false), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); + } public override void Update(ref float gravity, ref float maxFallSpeed) { diff --git a/Items/Materials/CruptixBar.cs b/Items/Materials/CruptixBar.cs index a9d7be51db..490fccce97 100644 --- a/Items/Materials/CruptixBar.cs +++ b/Items/Materials/CruptixBar.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Items.Materials { public class CruptixBar : ModItem { - private int frameCounter = 0; - private int frame = 0; + public int frameCounter = 0; + public int frame = 0; public override void SetStaticDefaults() { DisplayName.SetDefault("Scoria Bar"); @@ -35,29 +35,17 @@ namespace CalamityMod.Items.Materials item.rare = 8; } - internal Rectangle GetCurrentFrame() - { - int frameAmt = 6; - if (frameCounter >= 6) - { - frameCounter = -1; - frame = frame == frameAmt - 1 ? 0 : frame + 1; - } - frameCounter++; - return new Rectangle(0, item.height * frame, item.width, item.height); - } - - public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale) + public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frameI, Color drawColor, Color itemColor, Vector2 origin, float scale) { Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Materials/CruptixBar_Animated"); - spriteBatch.Draw(texture, position, GetCurrentFrame(), Color.White, 0f, origin, scale, SpriteEffects.None, 0); + spriteBatch.Draw(texture, position, item.GetCurrentFrame(ref frame, ref frameCounter, 6, 6), Color.White, 0f, origin, scale, SpriteEffects.None, 0); return false; } public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) { Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Materials/CruptixBar_Animated"); - spriteBatch.Draw(texture, item.position - Main.screenPosition, GetCurrentFrame(), lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); + spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, 6, 6), lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); return false; } diff --git a/Items/Materials/DarksunFragment.cs b/Items/Materials/DarksunFragment.cs index 73b923f3b2..49074f48cb 100644 --- a/Items/Materials/DarksunFragment.cs +++ b/Items/Materials/DarksunFragment.cs @@ -8,6 +8,8 @@ namespace CalamityMod.Items.Materials { public class DarksunFragment : ModItem { + public int frameCounter = 0; + public int frame = 0; public override void SetStaticDefaults() { DisplayName.SetDefault("Darksun Fragment"); @@ -25,10 +27,18 @@ namespace CalamityMod.Items.Materials item.Calamity().customRarity = CalamityRarity.Violet; } - public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) - { - CalamityUtils.DrawItemGlowmask(item, spriteBatch, 8, rotation, ModContent.GetTexture("CalamityMod/Items/Materials/DarksunFragmentGlow")); - } + public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) + { + Texture2D texture = Main.itemTexture[item.type]; + spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, 6, 8), lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); + return false; + } + + public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) + { + Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Materials/DarksunFragmentGlow"); + spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, 6, 8, false), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); + } public override void Update(ref float gravity, ref float maxFallSpeed) { diff --git a/Items/Materials/EndothermicEnergy.cs b/Items/Materials/EndothermicEnergy.cs index 120ff227da..b0e03a3bf1 100644 --- a/Items/Materials/EndothermicEnergy.cs +++ b/Items/Materials/EndothermicEnergy.cs @@ -8,6 +8,8 @@ namespace CalamityMod.Items.Materials { public class EndothermicEnergy : ModItem { + public int frameCounter = 0; + public int frame = 0; public override void SetStaticDefaults() { DisplayName.SetDefault("Endothermic Energy"); @@ -25,10 +27,18 @@ namespace CalamityMod.Items.Materials item.Calamity().customRarity = CalamityRarity.DarkBlue; } - public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) - { - CalamityUtils.DrawItemGlowmask(item, spriteBatch, 6, rotation, ModContent.GetTexture("CalamityMod/Items/Materials/EndothermicEnergyGlow")); - } + public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) + { + Texture2D texture = Main.itemTexture[item.type]; + spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, 6, 6), lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); + return false; + } + + public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) + { + Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Materials/EndothermicEnergyGlow"); + spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, 6, 6, false), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); + } public override void Update(ref float gravity, ref float maxFallSpeed) { diff --git a/Items/Materials/NightmareFuel.cs b/Items/Materials/NightmareFuel.cs index 784a406137..592f72540f 100644 --- a/Items/Materials/NightmareFuel.cs +++ b/Items/Materials/NightmareFuel.cs @@ -8,6 +8,8 @@ namespace CalamityMod.Items.Materials { public class NightmareFuel : ModItem { + public int frameCounter = 0; + public int frame = 0; public override void SetStaticDefaults() { DisplayName.SetDefault("Nightmare Fuel"); @@ -25,10 +27,18 @@ namespace CalamityMod.Items.Materials item.Calamity().customRarity = CalamityRarity.DarkBlue; } - public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) - { - CalamityUtils.DrawItemGlowmask(item, spriteBatch, 6, rotation, ModContent.GetTexture("CalamityMod/Items/Materials/NightmareFuelGlow")); - } + public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) + { + Texture2D texture = Main.itemTexture[item.type]; + spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, 6, 6), lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); + return false; + } + + public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) + { + Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Materials/NightmareFuelGlow"); + spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, 6, 6, false), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); + } public override void Update(ref float gravity, ref float maxFallSpeed) { diff --git a/Items/PermanentBoosters/Ectoheart.cs b/Items/PermanentBoosters/Ectoheart.cs index 20f868f541..bab0b0d71a 100644 --- a/Items/PermanentBoosters/Ectoheart.cs +++ b/Items/PermanentBoosters/Ectoheart.cs @@ -10,8 +10,8 @@ namespace CalamityMod.Items.PermanentBoosters { public class Ectoheart : ModItem { - private int frameCounter = 0; - private int frame = 0; + public int frameCounter = 0; + public int frame = 0; public override void SetStaticDefaults() { DisplayName.SetDefault("Ectoheart"); @@ -34,37 +34,24 @@ namespace CalamityMod.Items.PermanentBoosters public override bool CanUseItem(Player player) => !player.Calamity().adrenalineBoostThree; - internal Rectangle GetCurrentFrame(bool frameCounterUp = true) - { - int frameAmt = 3; - if (frameCounter >= 8) - { - frameCounter = -1; - frame = frame == frameAmt - 1 ? 0 : frame + 1; - } - if (frameCounterUp) - frameCounter++; - return new Rectangle(0, item.height * frame, item.width, item.height); - } - - public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale) + public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frameI, Color drawColor, Color itemColor, Vector2 origin, float scale) { Texture2D texture = ModContent.GetTexture("CalamityMod/Items/PermanentBoosters/Ectoheart_Animated"); - spriteBatch.Draw(texture, position, GetCurrentFrame(), Color.White, 0f, origin, scale, SpriteEffects.None, 0); + spriteBatch.Draw(texture, position, item.GetCurrentFrame(ref frame, ref frameCounter, 8, 3), Color.White, 0f, origin, scale, SpriteEffects.None, 0); return false; } public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) { Texture2D texture = ModContent.GetTexture("CalamityMod/Items/PermanentBoosters/Ectoheart_Animated"); - spriteBatch.Draw(texture, item.position - Main.screenPosition, GetCurrentFrame(), lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); + spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, 8, 3), lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); return false; } public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { Texture2D texture = ModContent.GetTexture("CalamityMod/Items/PermanentBoosters/EctoheartGlow"); - spriteBatch.Draw(texture, item.position - Main.screenPosition, GetCurrentFrame(false), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); + spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, 8, 3, false), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); } public override bool UseItem(Player player) diff --git a/Items/PermanentBoosters/RedLightningContainer.cs b/Items/PermanentBoosters/RedLightningContainer.cs index 99a9c38cd4..94c767127d 100644 --- a/Items/PermanentBoosters/RedLightningContainer.cs +++ b/Items/PermanentBoosters/RedLightningContainer.cs @@ -10,8 +10,8 @@ namespace CalamityMod.Items.PermanentBoosters { public class RedLightningContainer : ModItem { - private int frameCounter = 0; - private int frame = 0; + public int frameCounter = 0; + public int frame = 0; public override void SetStaticDefaults() { DisplayName.SetDefault("Red Lightning Container"); @@ -34,37 +34,24 @@ namespace CalamityMod.Items.PermanentBoosters public override bool CanUseItem(Player player) => !player.Calamity().rageBoostThree; - internal Rectangle GetCurrentFrame(bool frameCounterUp = true) - { - int frameAmt = 6; - if (frameCounter >= 5) - { - frameCounter = -1; - frame = frame == frameAmt - 1 ? 0 : frame + 1; - } - if (frameCounterUp) - frameCounter++; - return new Rectangle(0, item.height * frame, item.width, item.height); - } - - public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale) + public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frameI, Color drawColor, Color itemColor, Vector2 origin, float scale) { Texture2D texture = ModContent.GetTexture("CalamityMod/Items/PermanentBoosters/RedLightningContainer_Animated"); - spriteBatch.Draw(texture, position, GetCurrentFrame(), Color.White, 0f, origin, scale, SpriteEffects.None, 0); + spriteBatch.Draw(texture, position, item.GetCurrentFrame(ref frame, ref frameCounter, 5, 6), Color.White, 0f, origin, scale, SpriteEffects.None, 0); return false; } public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) { Texture2D texture = ModContent.GetTexture("CalamityMod/Items/PermanentBoosters/RedLightningContainer_Animated"); - spriteBatch.Draw(texture, item.position - Main.screenPosition, GetCurrentFrame(), lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); + spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, 5, 6), lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); return false; } public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { Texture2D texture = ModContent.GetTexture("CalamityMod/Items/PermanentBoosters/RedLightningContainerGlow"); - spriteBatch.Draw(texture, item.position - Main.screenPosition, GetCurrentFrame(false), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); + spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, 5, 6, false), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); } public override bool UseItem(Player player) diff --git a/Items/Weapons/Melee/Murasama.cs b/Items/Weapons/Melee/Murasama.cs index 0f73f79295..14bd4e2c94 100644 --- a/Items/Weapons/Melee/Murasama.cs +++ b/Items/Weapons/Melee/Murasama.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Items.Weapons.Melee { public class Murasama : ModItem { - private int frameCounter = 0; - private int frame = 0; + public int frameCounter = 0; + public int frame = 0; public override void SetStaticDefaults() { DisplayName.SetDefault("Murasama"); @@ -44,39 +44,25 @@ namespace CalamityMod.Items.Weapons.Melee Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(5, 14)); } - internal Rectangle GetCurrentFrame(bool frameCounterUp = true) + public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frameI, Color drawColor, Color itemColor, Vector2 origin, float scale) { //0 = 6 frames, 8 = 3 frames] - int applicableCounter = frame == 0 ? 36 : frame == 8 ? 24 : 6; - - if (frameCounter >= applicableCounter) - { - frameCounter = -1; - frame = frame == 13 ? 0 : frame + 1; - } - if (frameCounterUp) - frameCounter++; - return new Rectangle(0, item.height * frame, item.width, item.height); - } - - public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale) - { Texture2D texture = ModContent.GetTexture(Texture); - spriteBatch.Draw(texture, position, GetCurrentFrame(), Color.White, 0f, origin, scale, SpriteEffects.None, 0); + spriteBatch.Draw(texture, position, item.GetCurrentFrame(ref frame, ref frameCounter, frame == 0 ? 36 : frame == 8 ? 24 : 6, 13), Color.White, 0f, origin, scale, SpriteEffects.None, 0); return false; } public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) { Texture2D texture = ModContent.GetTexture(Texture); - spriteBatch.Draw(texture, item.position - Main.screenPosition, GetCurrentFrame(), lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); + spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, frame == 0 ? 36 : frame == 8 ? 24 : 6, 13), lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); return false; } public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/MurasamaGlow"); - spriteBatch.Draw(texture, item.position - Main.screenPosition, GetCurrentFrame(false), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); + spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, frame == 0 ? 36 : frame == 8 ? 24 : 6, 13, false), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); } public override bool CanUseItem(Player player) diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index 7399083ccf..96b6410969 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -3565,6 +3565,18 @@ namespace CalamityMod new Rectangle?(frame), Color.White, rotation, center, 1f, SpriteEffects.None, 0f); } + public static Rectangle GetCurrentFrame(this Item item, ref int frame, ref int frameCounter, int frameDelay, int frameAmt, bool frameCounterUp = true) + { + if (frameCounter >= frameDelay) + { + frameCounter = -1; + frame = frame == frameAmt - 1 ? 0 : frame + 1; + } + if (frameCounterUp) + frameCounter++; + return new Rectangle(0, item.height * frame, item.width, item.height); + } + public static bool DrawFishingLine(this Projectile projectile, int fishingRodType, Color poleColor, int xPositionAdditive = 45, float yPositionAdditive = 35f) { Player player = Main.player[projectile.owner]; From 6a4082093fd8b793a41fb92b3fcb8e02617cb390 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 6 Nov 2020 16:28:35 -0500 Subject: [PATCH 09/46] Changed "Sam" to "Jetstream Sam" --- Items/Weapons/Melee/Murasama.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Weapons/Melee/Murasama.cs b/Items/Weapons/Melee/Murasama.cs index 14bd4e2c94..22bd95fa6d 100644 --- a/Items/Weapons/Melee/Murasama.cs +++ b/Items/Weapons/Melee/Murasama.cs @@ -69,7 +69,7 @@ namespace CalamityMod.Items.Weapons.Melee { if (player.ownedProjectileCounts[item.shoot] > 0) return false; - return CalamityWorld.downedYharon || player.name == "Sam" || player.name == "Samuel Rodrigues"; + return CalamityWorld.downedYharon || player.name == "Jetstream Sam" || player.name == "Samuel Rodrigues"; } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) From 3b4eb05c1fcf1f921689dda0f2b3a690e2738206 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 6 Nov 2020 16:56:51 -0500 Subject: [PATCH 10/46] changed the glowmask util for single frame stuff --- Items/Accessories/Affliction.cs | 8 ++---- Items/Ammo/VanquisherArrow.cs | 3 +- Items/Materials/CalamitousEssence.cs | 4 +-- Items/Materials/CoreofCalamity.cs | 4 +-- Items/Materials/CoreofChaos.cs | 4 +-- Items/Materials/CoreofCinder.cs | 4 +-- Items/Materials/CoreofEleum.cs | 4 +-- Items/Materials/EssenceofChaos.cs | 4 +-- Items/Materials/EssenceofCinder.cs | 4 +-- Items/Materials/EssenceofEleum.cs | 4 +-- Items/Pets/RotomRemote.cs | 4 +-- Items/SummonItems/NecroplasmicBeacon.cs | 3 +- Items/TreasureBags/DevourerofGodsBag.cs | 3 +- Items/TreasureBags/PolterghastBag.cs | 3 +- Items/Weapons/Magic/AbyssShocker.cs | 23 ++------------- Items/Weapons/Magic/Apotheosis.cs | 3 +- Items/Weapons/Magic/DeathhailStaff.cs | 3 +- Items/Weapons/Magic/FatesReveal.cs | 3 +- Items/Weapons/Magic/GhastlyVisage.cs | 16 ++--------- Items/Weapons/Magic/SoulPiercer.cs | 3 +- Items/Weapons/Magic/SubsumingVortex.cs | 3 +- Items/Weapons/Melee/BansheeHook.cs | 3 +- Items/Weapons/Melee/ElementalExcalibur.cs | 3 +- Items/Weapons/Melee/EradicatorMelee.cs | 3 +- Items/Weapons/Melee/EssenceFlayer.cs | 3 +- Items/Weapons/Melee/Excelsus.cs | 11 ++++---- Items/Weapons/Melee/PrismaticBreaker.cs | 4 +-- Items/Weapons/Melee/StreamGouge.cs | 15 ++-------- Items/Weapons/Melee/TerrorBlade.cs | 3 +- Items/Weapons/Melee/TheEnforcer.cs | 3 +- Items/Weapons/Ranged/Auralis.cs | 4 +-- Items/Weapons/Ranged/AuroraBlazer.cs | 4 +-- Items/Weapons/Ranged/CleansingBlaze.cs | 3 +- Items/Weapons/Ranged/DaemonsFlame.cs | 3 +- Items/Weapons/Ranged/Deathwind.cs | 3 +- Items/Weapons/Ranged/PristineFury.cs | 33 +++++++--------------- Items/Weapons/Rogue/Apoctolith.cs | 3 +- Items/Weapons/Rogue/AuroradicalThrow.cs | 4 +-- Items/Weapons/Rogue/Eradicator.cs | 3 +- Items/Weapons/Rogue/ExecutionersBlade.cs | 3 +- Items/Weapons/Rogue/GhoulishGouger.cs | 3 +- Items/Weapons/Rogue/LeonidProgenitor.cs | 3 +- Items/Weapons/Rogue/NightsGaze.cs | 4 +-- Items/Weapons/Rogue/ShockGrenade.cs | 3 +- Items/Weapons/Summon/EtherealSubjugator.cs | 3 +- Utilities/CalamityUtils.cs | 10 ++----- 46 files changed, 66 insertions(+), 181 deletions(-) diff --git a/Items/Accessories/Affliction.cs b/Items/Accessories/Affliction.cs index 2b1939cd44..be3aa92fe3 100644 --- a/Items/Accessories/Affliction.cs +++ b/Items/Accessories/Affliction.cs @@ -28,8 +28,7 @@ namespace CalamityMod.Items.Accessories public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Vector2 origin = new Vector2(19f, 20f); - spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Accessories/Affliction"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Accessories/Affliction")); } public override void UpdateAccessory(Player player, bool hideVisual) @@ -38,10 +37,9 @@ namespace CalamityMod.Items.Accessories modPlayer.affliction = true; if (player.whoAmI != Main.myPlayer && player.miscCounter % 10 == 0) { - int myPlayer = Main.myPlayer; - if (Main.player[myPlayer].team == player.team && player.team != 0) + if (Main.LocalPlayer.team == player.team && player.team != 0) { - Main.player[myPlayer].AddBuff(ModContent.BuffType(), 20, true); + Main.LocalPlayer.AddBuff(ModContent.BuffType(), 20, true); } } } diff --git a/Items/Ammo/VanquisherArrow.cs b/Items/Ammo/VanquisherArrow.cs index f0c3bb4799..564e884821 100644 --- a/Items/Ammo/VanquisherArrow.cs +++ b/Items/Ammo/VanquisherArrow.cs @@ -35,8 +35,7 @@ namespace CalamityMod.Items.Ammo public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Vector2 origin = new Vector2(11f, 21f); - spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Ammo/VanquisherArrowGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Ammo/VanquisherArrowGlow")); } public override void AddRecipes() diff --git a/Items/Materials/CalamitousEssence.cs b/Items/Materials/CalamitousEssence.cs index 1779444abb..87def9520e 100644 --- a/Items/Materials/CalamitousEssence.cs +++ b/Items/Materials/CalamitousEssence.cs @@ -25,9 +25,7 @@ namespace CalamityMod.Items.Materials public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Texture2D texture = Main.itemTexture[item.type]; - Vector2 origin = new Vector2(texture.Width / 2f, texture.Height / 2f - 2f); - spriteBatch.Draw(texture, item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, Main.itemTexture[item.type]); } public override void Update(ref float gravity, ref float maxFallSpeed) diff --git a/Items/Materials/CoreofCalamity.cs b/Items/Materials/CoreofCalamity.cs index 752ba369e2..8779eb1639 100644 --- a/Items/Materials/CoreofCalamity.cs +++ b/Items/Materials/CoreofCalamity.cs @@ -24,9 +24,7 @@ namespace CalamityMod.Items.Materials public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Materials/CoreofCalamityGlow"); - Vector2 origin = new Vector2(texture.Width / 2f, texture.Height / 2f - 2f); - spriteBatch.Draw(texture, item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Materials/CoreofCalamityGlow")); } public override void AddRecipes() diff --git a/Items/Materials/CoreofChaos.cs b/Items/Materials/CoreofChaos.cs index 8ab1aa4143..7170466a60 100644 --- a/Items/Materials/CoreofChaos.cs +++ b/Items/Materials/CoreofChaos.cs @@ -24,9 +24,7 @@ namespace CalamityMod.Items.Materials public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Materials/CoreofChaosGlow"); - Vector2 origin = new Vector2(texture.Width / 2f, texture.Height / 2f - 2f); - spriteBatch.Draw(texture, item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Materials/CoreofChaosGlow")); } public override void Update(ref float gravity, ref float maxFallSpeed) diff --git a/Items/Materials/CoreofCinder.cs b/Items/Materials/CoreofCinder.cs index e3b0831bed..8614c239cc 100644 --- a/Items/Materials/CoreofCinder.cs +++ b/Items/Materials/CoreofCinder.cs @@ -24,9 +24,7 @@ namespace CalamityMod.Items.Materials public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Materials/CoreofCinderGlow"); - Vector2 origin = new Vector2(texture.Width / 2f, texture.Height / 2f - 2f); - spriteBatch.Draw(texture, item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Materials/CoreofCinderGlow")); } public override void Update(ref float gravity, ref float maxFallSpeed) diff --git a/Items/Materials/CoreofEleum.cs b/Items/Materials/CoreofEleum.cs index 580d46312d..b86d11c59d 100644 --- a/Items/Materials/CoreofEleum.cs +++ b/Items/Materials/CoreofEleum.cs @@ -24,9 +24,7 @@ namespace CalamityMod.Items.Materials public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Materials/CoreofEleumGlow"); - Vector2 origin = new Vector2(texture.Width / 2f, texture.Height / 2f - 2f); - spriteBatch.Draw(texture, item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Materials/CoreofEleumGlow")); } public override void Update(ref float gravity, ref float maxFallSpeed) diff --git a/Items/Materials/EssenceofChaos.cs b/Items/Materials/EssenceofChaos.cs index e2b73058ac..43af41383f 100644 --- a/Items/Materials/EssenceofChaos.cs +++ b/Items/Materials/EssenceofChaos.cs @@ -24,9 +24,7 @@ namespace CalamityMod.Items.Materials public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Texture2D texture = Main.itemTexture[item.type]; - Vector2 origin = new Vector2(texture.Width / 2f, texture.Height / 2f - 2f); - spriteBatch.Draw(texture, item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, Main.itemTexture[item.type]); } public override void Update(ref float gravity, ref float maxFallSpeed) diff --git a/Items/Materials/EssenceofCinder.cs b/Items/Materials/EssenceofCinder.cs index d39df25c5b..ed273dce5c 100644 --- a/Items/Materials/EssenceofCinder.cs +++ b/Items/Materials/EssenceofCinder.cs @@ -24,9 +24,7 @@ namespace CalamityMod.Items.Materials public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Texture2D texture = Main.itemTexture[item.type]; - Vector2 origin = new Vector2(texture.Width / 2f, texture.Height / 2f - 2f); - spriteBatch.Draw(texture, item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, Main.itemTexture[item.type]); } public override void Update(ref float gravity, ref float maxFallSpeed) diff --git a/Items/Materials/EssenceofEleum.cs b/Items/Materials/EssenceofEleum.cs index fbd6c8fe1f..42525859e0 100644 --- a/Items/Materials/EssenceofEleum.cs +++ b/Items/Materials/EssenceofEleum.cs @@ -24,9 +24,7 @@ namespace CalamityMod.Items.Materials public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Texture2D texture = Main.itemTexture[item.type]; - Vector2 origin = new Vector2(texture.Width / 2f, texture.Height / 2f - 2f); - spriteBatch.Draw(texture, item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, Main.itemTexture[item.type]); } public override void Update(ref float gravity, ref float maxFallSpeed) diff --git a/Items/Pets/RotomRemote.cs b/Items/Pets/RotomRemote.cs index 6122e39750..afc3d20d1a 100644 --- a/Items/Pets/RotomRemote.cs +++ b/Items/Pets/RotomRemote.cs @@ -46,9 +46,7 @@ namespace CalamityMod.Items.Pets public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Pets/RotomRemoteGlow"); - Vector2 origin = new Vector2(texture.Width / 2f, texture.Height / 2f - 2f); - spriteBatch.Draw(texture, item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Pets/RotomRemoteGlow")); } public override void AddRecipes() diff --git a/Items/SummonItems/NecroplasmicBeacon.cs b/Items/SummonItems/NecroplasmicBeacon.cs index aa35fff07c..6f7a7198dc 100644 --- a/Items/SummonItems/NecroplasmicBeacon.cs +++ b/Items/SummonItems/NecroplasmicBeacon.cs @@ -32,8 +32,7 @@ namespace CalamityMod.Items.SummonItems public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Vector2 origin = new Vector2(21f, 27f); //21, 29 - spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/SummonItems/NecroplasmicBeaconGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/SummonItems/NecroplasmicBeaconGlow")); } public override bool CanUseItem(Player player) diff --git a/Items/TreasureBags/DevourerofGodsBag.cs b/Items/TreasureBags/DevourerofGodsBag.cs index e6a8c1be5d..10b038af18 100644 --- a/Items/TreasureBags/DevourerofGodsBag.cs +++ b/Items/TreasureBags/DevourerofGodsBag.cs @@ -40,8 +40,7 @@ namespace CalamityMod.Items.TreasureBags public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Vector2 origin = new Vector2(18f, 20f); //18, 17 - spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/TreasureBags/DevourerofGodsBagGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/TreasureBags/DevourerofGodsBagGlow")); } public override bool CanRightClick() diff --git a/Items/TreasureBags/PolterghastBag.cs b/Items/TreasureBags/PolterghastBag.cs index 15ed6be9bf..a04a10c8b3 100644 --- a/Items/TreasureBags/PolterghastBag.cs +++ b/Items/TreasureBags/PolterghastBag.cs @@ -38,8 +38,7 @@ namespace CalamityMod.Items.TreasureBags public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Vector2 origin = new Vector2(16f, 20f); //16, 17 - spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/TreasureBags/PolterghastBagGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/TreasureBags/PolterghastBagGlow")); } public override bool CanRightClick() diff --git a/Items/Weapons/Magic/AbyssShocker.cs b/Items/Weapons/Magic/AbyssShocker.cs index e038fa78b3..a8d34c8afd 100644 --- a/Items/Weapons/Magic/AbyssShocker.cs +++ b/Items/Weapons/Magic/AbyssShocker.cs @@ -38,28 +38,9 @@ namespace CalamityMod.Items.Weapons.Magic public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/AbyssShocker_mask"); - spriteBatch.Draw - ( - texture, - new Vector2 - ( - item.position.X - Main.screenPosition.X + item.width * 0.5f, - item.position.Y - Main.screenPosition.Y + item.height - texture.Height * 0.5f + 2f - ), - new Rectangle(0, 0, texture.Width, texture.Height), - Color.White, - rotation, - texture.Size() * 0.5f, - scale, - SpriteEffects.None, - 0f - ); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/AbyssShocker_mask")); } - public override Vector2? HoldoutOffset() - { - return new Vector2(-14, 0); - } + public override Vector2? HoldoutOffset() => new Vector2(-14, 0); } } \ No newline at end of file diff --git a/Items/Weapons/Magic/Apotheosis.cs b/Items/Weapons/Magic/Apotheosis.cs index 33b831c591..3c098dd83b 100644 --- a/Items/Weapons/Magic/Apotheosis.cs +++ b/Items/Weapons/Magic/Apotheosis.cs @@ -44,8 +44,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Vector2 origin = new Vector2(15f, 15f); - spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/ApotheosisGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/ApotheosisGlow")); } public override void AddRecipes() diff --git a/Items/Weapons/Magic/DeathhailStaff.cs b/Items/Weapons/Magic/DeathhailStaff.cs index 9e5fe38d37..bb6a53cc5c 100644 --- a/Items/Weapons/Magic/DeathhailStaff.cs +++ b/Items/Weapons/Magic/DeathhailStaff.cs @@ -46,8 +46,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Vector2 origin = new Vector2(40f, 42f); - spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/DeathhailStaffGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/DeathhailStaffGlow")); } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) diff --git a/Items/Weapons/Magic/FatesReveal.cs b/Items/Weapons/Magic/FatesReveal.cs index 33ae94d164..94c24208fe 100644 --- a/Items/Weapons/Magic/FatesReveal.cs +++ b/Items/Weapons/Magic/FatesReveal.cs @@ -45,8 +45,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Vector2 origin = new Vector2(40f, 41f); - spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/FatesRevealGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/FatesRevealGlow")); } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) diff --git a/Items/Weapons/Magic/GhastlyVisage.cs b/Items/Weapons/Magic/GhastlyVisage.cs index dd575e3f31..d4ab394570 100644 --- a/Items/Weapons/Magic/GhastlyVisage.cs +++ b/Items/Weapons/Magic/GhastlyVisage.cs @@ -36,23 +36,11 @@ namespace CalamityMod.Items.Weapons.Magic item.Calamity().customRarity = CalamityRarity.PureGreen; } - public override bool CanUseItem(Player player) - { - for (int i = 0; i < Main.projectile.Length; i++) - { - Projectile p = Main.projectile[i]; - if (p.active && p.type == ModContent.ProjectileType() && p.owner == player.whoAmI) - { - return false; - } - } - return true; - } + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Vector2 origin = new Vector2(16f, 16f); - spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/GhastlyVisageGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/GhastlyVisageGlow")); } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) diff --git a/Items/Weapons/Magic/SoulPiercer.cs b/Items/Weapons/Magic/SoulPiercer.cs index 7fb36a4fe8..8ee7ada67a 100644 --- a/Items/Weapons/Magic/SoulPiercer.cs +++ b/Items/Weapons/Magic/SoulPiercer.cs @@ -45,8 +45,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Vector2 origin = new Vector2(32f, 30f); - spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/SoulPiercerGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/SoulPiercerGlow")); } public override void AddRecipes() diff --git a/Items/Weapons/Magic/SubsumingVortex.cs b/Items/Weapons/Magic/SubsumingVortex.cs index 0a0b90dbbc..91b73e0d48 100644 --- a/Items/Weapons/Magic/SubsumingVortex.cs +++ b/Items/Weapons/Magic/SubsumingVortex.cs @@ -41,8 +41,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Vector2 origin = new Vector2(19f, 22f); - spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/SubsumingVortexGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/SubsumingVortexGlow")); } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) diff --git a/Items/Weapons/Melee/BansheeHook.cs b/Items/Weapons/Melee/BansheeHook.cs index 9df8a147e6..575d5fc582 100644 --- a/Items/Weapons/Melee/BansheeHook.cs +++ b/Items/Weapons/Melee/BansheeHook.cs @@ -40,8 +40,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Vector2 origin = new Vector2(60f, 52f); - spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/BansheeHookGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/BansheeHookGlow")); } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; diff --git a/Items/Weapons/Melee/ElementalExcalibur.cs b/Items/Weapons/Melee/ElementalExcalibur.cs index 2121d70ba1..38440a614d 100644 --- a/Items/Weapons/Melee/ElementalExcalibur.cs +++ b/Items/Weapons/Melee/ElementalExcalibur.cs @@ -48,8 +48,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Vector2 origin = new Vector2(46f, 44f); - spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/ElementalExcaliburGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/ElementalExcaliburGlow")); } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) diff --git a/Items/Weapons/Melee/EradicatorMelee.cs b/Items/Weapons/Melee/EradicatorMelee.cs index 2a6563425c..76807f2b24 100644 --- a/Items/Weapons/Melee/EradicatorMelee.cs +++ b/Items/Weapons/Melee/EradicatorMelee.cs @@ -38,8 +38,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Vector2 origin = new Vector2(31f, 29f); - spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/EradicatorMeleeGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/EradicatorMeleeGlow")); } } } diff --git a/Items/Weapons/Melee/EssenceFlayer.cs b/Items/Weapons/Melee/EssenceFlayer.cs index 03438002ab..378921be75 100644 --- a/Items/Weapons/Melee/EssenceFlayer.cs +++ b/Items/Weapons/Melee/EssenceFlayer.cs @@ -39,8 +39,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Vector2 origin = new Vector2(50f, 37f); - spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/EssenceFlayerGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/EssenceFlayerGlow")); } public override void AddRecipes() diff --git a/Items/Weapons/Melee/Excelsus.cs b/Items/Weapons/Melee/Excelsus.cs index 45191fba72..9927187de7 100644 --- a/Items/Weapons/Melee/Excelsus.cs +++ b/Items/Weapons/Melee/Excelsus.cs @@ -38,16 +38,15 @@ namespace CalamityMod.Items.Weapons.Melee public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Vector2 origin = new Vector2(39f, 47f); - spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/ExcelsusGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/ExcelsusGlow")); } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { for (int index = 0; index < 3; ++index) { - float SpeedX = speedX + (float)Main.rand.Next(-30, 31) * 0.05f; - float SpeedY = speedY + (float)Main.rand.Next(-30, 31) * 0.05f; + float SpeedX = speedX + Main.rand.NextFloat(-1.5f, 1.5f); + float SpeedY = speedY + Main.rand.NextFloat(-1.5f, 1.5f); switch (index) { case 0: @@ -67,12 +66,12 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, ModContent.ProjectileType(), 0, 0, Main.myPlayer); + Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0, player.whoAmI); } public override void OnHitPvp(Player player, Player target, int damage, bool crit) { - Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, ModContent.ProjectileType(), 0, 0, Main.myPlayer); + Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0, player.whoAmI); } } } diff --git a/Items/Weapons/Melee/PrismaticBreaker.cs b/Items/Weapons/Melee/PrismaticBreaker.cs index fb0ec5f0da..f7d015b82b 100644 --- a/Items/Weapons/Melee/PrismaticBreaker.cs +++ b/Items/Weapons/Melee/PrismaticBreaker.cs @@ -81,9 +81,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - //item.width and then item.height - 2f - Vector2 origin = new Vector2(25f, 23f); - spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/PrismaticBreakerGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/PrismaticBreakerGlow")); } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) diff --git a/Items/Weapons/Melee/StreamGouge.cs b/Items/Weapons/Melee/StreamGouge.cs index 4ab2194d10..bc3c708627 100644 --- a/Items/Weapons/Melee/StreamGouge.cs +++ b/Items/Weapons/Melee/StreamGouge.cs @@ -41,21 +41,10 @@ namespace CalamityMod.Items.Weapons.Melee public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Vector2 origin = new Vector2(50f, 48f); - spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/StreamGougeGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/StreamGougeGlow")); } - public override bool CanUseItem(Player player) - { - for (int i = 0; i < 1000; ++i) - { - if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == item.shoot) - { - return false; - } - } - return true; - } + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; public override void AddRecipes() { diff --git a/Items/Weapons/Melee/TerrorBlade.cs b/Items/Weapons/Melee/TerrorBlade.cs index 593b852799..ac4d892846 100644 --- a/Items/Weapons/Melee/TerrorBlade.cs +++ b/Items/Weapons/Melee/TerrorBlade.cs @@ -38,8 +38,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Vector2 origin = new Vector2(44f, 38f); - spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/TerrorBladeGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/TerrorBladeGlow")); } public override void MeleeEffects(Player player, Rectangle hitbox) diff --git a/Items/Weapons/Melee/TheEnforcer.cs b/Items/Weapons/Melee/TheEnforcer.cs index 01e7eebf04..315abd8f04 100644 --- a/Items/Weapons/Melee/TheEnforcer.cs +++ b/Items/Weapons/Melee/TheEnforcer.cs @@ -39,8 +39,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Vector2 origin = new Vector2(50f, 48f); - spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/TheEnforcerGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/TheEnforcerGlow")); } public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) diff --git a/Items/Weapons/Ranged/Auralis.cs b/Items/Weapons/Ranged/Auralis.cs index 8f29ddde43..221980ac0b 100644 --- a/Items/Weapons/Ranged/Auralis.cs +++ b/Items/Weapons/Ranged/Auralis.cs @@ -61,9 +61,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Texture2D glowmask = ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/AuralisGlow"); - Vector2 origin = new Vector2(glowmask.Width / 2f, glowmask.Height / 2f - 2f); - spriteBatch.Draw(glowmask, item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/AuralisGlow")); } public override Vector2? HoldoutOffset() => new Vector2(-10, 0); diff --git a/Items/Weapons/Ranged/AuroraBlazer.cs b/Items/Weapons/Ranged/AuroraBlazer.cs index d772a1b0fc..44189aa445 100644 --- a/Items/Weapons/Ranged/AuroraBlazer.cs +++ b/Items/Weapons/Ranged/AuroraBlazer.cs @@ -47,9 +47,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Texture2D glowmask = ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/AuroraBlazerGlow"); - Vector2 origin = new Vector2(glowmask.Width / 2f, glowmask.Height / 2f - 2f); - spriteBatch.Draw(glowmask, item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/AuroraBlazerGlow")); } public override Vector2? HoldoutOffset() => new Vector2(-10, 0); diff --git a/Items/Weapons/Ranged/CleansingBlaze.cs b/Items/Weapons/Ranged/CleansingBlaze.cs index 471112ce59..8e779ba896 100644 --- a/Items/Weapons/Ranged/CleansingBlaze.cs +++ b/Items/Weapons/Ranged/CleansingBlaze.cs @@ -39,8 +39,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Vector2 origin = new Vector2(32f, 14f); - spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/CleansingBlazeGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/CleansingBlazeGlow")); } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) diff --git a/Items/Weapons/Ranged/DaemonsFlame.cs b/Items/Weapons/Ranged/DaemonsFlame.cs index 114b4c4be9..c292e316b2 100644 --- a/Items/Weapons/Ranged/DaemonsFlame.cs +++ b/Items/Weapons/Ranged/DaemonsFlame.cs @@ -42,8 +42,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Vector2 origin = new Vector2(31f, 62f); - spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/DaemonsFlameGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/DaemonsFlameGlow")); } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) diff --git a/Items/Weapons/Ranged/Deathwind.cs b/Items/Weapons/Ranged/Deathwind.cs index 72a70ed0a2..f25b307c03 100644 --- a/Items/Weapons/Ranged/Deathwind.cs +++ b/Items/Weapons/Ranged/Deathwind.cs @@ -39,8 +39,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Vector2 origin = new Vector2(20f, 41f); - spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/DeathwindGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/DeathwindGlow")); } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) diff --git a/Items/Weapons/Ranged/PristineFury.cs b/Items/Weapons/Ranged/PristineFury.cs index d3b98d9086..727bd67c4b 100644 --- a/Items/Weapons/Ranged/PristineFury.cs +++ b/Items/Weapons/Ranged/PristineFury.cs @@ -9,8 +9,8 @@ namespace CalamityMod.Items.Weapons.Ranged { public class PristineFury : ModItem { - private int frameCounter = 0; - private int frame = 0; + public int frameCounter = 0; + public int frame = 0; public static int BaseDamage = 140; public override void SetStaticDefaults() @@ -69,49 +69,36 @@ namespace CalamityMod.Items.Weapons.Ranged int flameAmt = 3; for (int index = 0; index < flameAmt; ++index) { - float SpeedX = speedX + (float)Main.rand.Next(-25, 26) * 0.05f; - float SpeedY = speedY + (float)Main.rand.Next(-25, 26) * 0.05f; - Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType(), (int)(damage * 0.8f), knockBack, player.whoAmI, 0f, 0f); + float SpeedX = speedX + Main.rand.NextFloat(-1.25f, 1.25f); + float SpeedY = speedY + Main.rand.NextFloat(-1.25f, 1.25f); + Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType(), (int)(damage * 0.8f), knockBack, player.whoAmI); } } else { - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI); } return false; } - internal Rectangle GetCurrentFrame(bool frameCounterUp = true) - { - int frameAmt = 4; - if (frameCounter >= 5) - { - frameCounter = -1; - frame = frame == frameAmt - 1 ? 0 : frame + 1; - } - if (frameCounterUp) - frameCounter++; - return new Rectangle(0, item.height * frame, item.width, item.height); - } - - public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale) + public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frameI, Color drawColor, Color itemColor, Vector2 origin, float scale) { Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/PristineFury_Animated"); - spriteBatch.Draw(texture, position, GetCurrentFrame(), Color.White, 0f, origin, scale, SpriteEffects.None, 0); + spriteBatch.Draw(texture, position, item.GetCurrentFrame(ref frame, ref frameCounter, 5, 4), Color.White, 0f, origin, scale, SpriteEffects.None, 0); return false; } public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) { Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/PristineFury_Animated"); - spriteBatch.Draw(texture, item.position - Main.screenPosition, GetCurrentFrame(), lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); + spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, 5, 4), lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); return false; } public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/PristineFuryGlow"); - spriteBatch.Draw(texture, item.position - Main.screenPosition, GetCurrentFrame(false), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); + spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, 5, 4, false), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); } } } diff --git a/Items/Weapons/Rogue/Apoctolith.cs b/Items/Weapons/Rogue/Apoctolith.cs index aa832fd900..c6e90e69b0 100644 --- a/Items/Weapons/Rogue/Apoctolith.cs +++ b/Items/Weapons/Rogue/Apoctolith.cs @@ -65,8 +65,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Vector2 origin = new Vector2(item.width / 2f, item.height / 2f - 2f); - spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Rogue/ApoctolithGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Rogue/ApoctolithGlow")); } } } diff --git a/Items/Weapons/Rogue/AuroradicalThrow.cs b/Items/Weapons/Rogue/AuroradicalThrow.cs index 93098fceea..3a5c4653ed 100644 --- a/Items/Weapons/Rogue/AuroradicalThrow.cs +++ b/Items/Weapons/Rogue/AuroradicalThrow.cs @@ -46,9 +46,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Texture2D glowmask = Main.itemTexture[item.type]; - Vector2 origin = new Vector2(glowmask.Width / 2f, glowmask.Height / 2f - 2f); - spriteBatch.Draw(glowmask, item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, Main.itemTexture[item.type]); } } } diff --git a/Items/Weapons/Rogue/Eradicator.cs b/Items/Weapons/Rogue/Eradicator.cs index 5d89e84644..38f5f5ac72 100644 --- a/Items/Weapons/Rogue/Eradicator.cs +++ b/Items/Weapons/Rogue/Eradicator.cs @@ -46,8 +46,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Vector2 origin = new Vector2(31f, 29f); - spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Rogue/EradicatorGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Rogue/EradicatorGlow")); } } } diff --git a/Items/Weapons/Rogue/ExecutionersBlade.cs b/Items/Weapons/Rogue/ExecutionersBlade.cs index 3249a74251..d082e0927b 100644 --- a/Items/Weapons/Rogue/ExecutionersBlade.cs +++ b/Items/Weapons/Rogue/ExecutionersBlade.cs @@ -40,8 +40,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Vector2 origin = new Vector2(32f, 30f); - spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Rogue/ExecutionersBladeGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Rogue/ExecutionersBladeGlow")); } public override void AddRecipes() diff --git a/Items/Weapons/Rogue/GhoulishGouger.cs b/Items/Weapons/Rogue/GhoulishGouger.cs index 318f5099a1..b380c92430 100644 --- a/Items/Weapons/Rogue/GhoulishGouger.cs +++ b/Items/Weapons/Rogue/GhoulishGouger.cs @@ -39,8 +39,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Vector2 origin = new Vector2(37f, 32f); - spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Rogue/GhoulishGougerGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Rogue/GhoulishGougerGlow")); } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) diff --git a/Items/Weapons/Rogue/LeonidProgenitor.cs b/Items/Weapons/Rogue/LeonidProgenitor.cs index fa62e10005..8c62e55f99 100644 --- a/Items/Weapons/Rogue/LeonidProgenitor.cs +++ b/Items/Weapons/Rogue/LeonidProgenitor.cs @@ -88,8 +88,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Vector2 origin = new Vector2(item.width / 2f, item.height / 2f - 2f); - spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Rogue/LeonidProgenitorGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Rogue/LeonidProgenitorGlow")); } } } diff --git a/Items/Weapons/Rogue/NightsGaze.cs b/Items/Weapons/Rogue/NightsGaze.cs index 275f6b3f85..011aac2cbb 100644 --- a/Items/Weapons/Rogue/NightsGaze.cs +++ b/Items/Weapons/Rogue/NightsGaze.cs @@ -54,9 +54,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Rogue/NightsGazeGlow"); - Vector2 origin = new Vector2(texture.Width / 2f, texture.Height / 2f - 2f); - spriteBatch.Draw(texture, item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Rogue/NightsGazeGlow")); } public override void AddRecipes() diff --git a/Items/Weapons/Rogue/ShockGrenade.cs b/Items/Weapons/Rogue/ShockGrenade.cs index 7c004ec3f2..ac9ad74334 100644 --- a/Items/Weapons/Rogue/ShockGrenade.cs +++ b/Items/Weapons/Rogue/ShockGrenade.cs @@ -50,8 +50,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Vector2 origin = new Vector2(item.width / 2, item.height / 2); - spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Rogue/ShockGrenadeGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Rogue/ShockGrenadeGlow")); } public override void AddRecipes() diff --git a/Items/Weapons/Summon/EtherealSubjugator.cs b/Items/Weapons/Summon/EtherealSubjugator.cs index 139cdae3f3..ef44a7f796 100644 --- a/Items/Weapons/Summon/EtherealSubjugator.cs +++ b/Items/Weapons/Summon/EtherealSubjugator.cs @@ -39,8 +39,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Vector2 origin = new Vector2(33f, 33f); - spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Summon/EtherealSubjugatorGlow"), item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); + item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Rogue/EtherealSubjugatorGlow")); } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index 96b6410969..d121557962 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -3555,14 +3555,10 @@ namespace CalamityMod #endregion #region Drawing Utilities - public static void DrawItemGlowmask(this Item item, SpriteBatch spriteBatch, int frameCount, float rotation, Texture2D glowmaskTexture) + public static void DrawItemGlowmaskSingleFrame(this Item item, SpriteBatch spriteBatch, float rotation, Texture2D glowmaskTexture) { - Vector2 center = new Vector2((float)(Main.itemTexture[item.type].Width / 2), (float)(Main.itemTexture[item.type].Height / frameCount / 2)); - Rectangle frame = Main.itemAnimations[item.type].GetFrame(glowmaskTexture); - Vector2 drawPosition = item.Center - Main.screenPosition; - - spriteBatch.Draw(glowmaskTexture, drawPosition, - new Rectangle?(frame), Color.White, rotation, center, 1f, SpriteEffects.None, 0f); + Vector2 origin = new Vector2(glowmaskTexture.Width / 2f, glowmaskTexture.Height / 2f - 2f); + spriteBatch.Draw(glowmaskTexture, item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f); } public static Rectangle GetCurrentFrame(this Item item, ref int frame, ref int frameCounter, int frameDelay, int frameAmt, bool frameCounterUp = true) From a37625b71fe4341c2c0dd26c9f09b477731e3602 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 6 Nov 2020 17:15:51 -0500 Subject: [PATCH 11/46] ascendant spirit essence glow tweak --- Items/Materials/AscendantSpiritEssence.cs | 8 +++++++- Items/Materials/AscendantSpiritEssenceGlow.png | Bin 0 -> 2124 bytes 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 Items/Materials/AscendantSpiritEssenceGlow.png diff --git a/Items/Materials/AscendantSpiritEssence.cs b/Items/Materials/AscendantSpiritEssence.cs index b3482d3720..153a3c7cf5 100644 --- a/Items/Materials/AscendantSpiritEssence.cs +++ b/Items/Materials/AscendantSpiritEssence.cs @@ -32,10 +32,16 @@ namespace CalamityMod.Items.Materials public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) { Texture2D texture = Main.itemTexture[item.type]; - spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, 6, 6), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); + spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, 6, 6), lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); return false; } + public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) + { + Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Materials/AscendantSpiritEssenceGlow"); + spriteBatch.Draw(texture, item.position - Main.screenPosition, item.GetCurrentFrame(ref frame, ref frameCounter, 6, 6, false), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); + } + public override void Update(ref float gravity, ref float maxFallSpeed) { float brightness = Main.essScale * Main.rand.NextFloat(0.9f, 1.1f); diff --git a/Items/Materials/AscendantSpiritEssenceGlow.png b/Items/Materials/AscendantSpiritEssenceGlow.png new file mode 100644 index 0000000000000000000000000000000000000000..72302cd70c9871eea686e1b965dda3631bd9d2a6 GIT binary patch literal 2124 zcmV-S2($NzP)-ll7JyG8OUeE0}z2NKm?G0;ROIeNMu87B!qm3 zzX|W)%N8*^)ndN6(pS~f)75ACB70|d`!`=#Rrgd)&2ILB|2Dzn?{xsT0(W0{X#4N9 zo&V~0_h(OdvT37DoxaRtHvn0sxn?hpF}`4gKcraP?Tlaj;Pb&oK6~SpiR-)LfVf*V0Oschmv0XCxq0p>^U3_zpy`Lg0non_{nOt~ zJaaV#+6Q>{$(;>sHgr0(u8gPxwE!fxr&aIzy{Qd=0s=1Xs)ceYn|x6ifRHD59Q}T8 zlzw(*-~ODDtl+ZZEewgTY*zaDRg820HdE<=f1oGVE_<0>nqR-fcMPH*}$kk7yxrqcAQ2+_619i zcYv-ySD-7<706Z~H!+E!`}6^L3m3(6#o++j^4seLShThlv9rAZr=mFk>sD3S?!Fn`y8r~=^tnt$UNt)@U2fF`}1IabSyE6^OkEL}g=jE-(zo|uCuu{aW<0$~7} z|4P0P74Uk88VA_DBGmxUy6+u+JmdxUFFiInSxpJ%9aMoZ0Cnf1)Dw=ceKLGxfBWX- zqs3}Q@~v7uVKIOtr60ZY_%PP<=XbTCNA{-`QJThw%ER#W!T~g=pTz}ICC|PtXcj9tHg{mR0$~8!z;XuIW5)7=?kQ*n zK=X4{Ak8hgtKMt_EcRCe(AxYoTPW6Tr^R^deFV%+v$y38z-kNk9{?7&SX?Ns!0G^! zh>#i)>pw1TgsTByy8f+;7f+lX0gz;r)QA>$UWWrndj9PzFApv(wIc22l+F%^r?;{8YfPTZIU~b*eJq5J@QZ87!>$QR53|{;2 zi{TZi#L8ieFXpu%-Az*)z+1ABJ|m1P(y!=NAPhkB-`P&+%ing>3vE84fXqF1-P2uh zIDq$hzZWdfSgnN%a~xn(5)P0ernB*>m;%iJu&HwA2fSbCeSh&O=m1@T`(J^cE5!1^mI$c$V(kJD^O~{#fwqtscIA13K*(7WOtG4gwgxlm9vV8ysm$9C%tS`fo1{lk#Gt0@XYW}79mBEYz3+VXw5A9WB;Mpz+Zpd7!UE0C=Ku7cKeUvpEs8sZ1T0q}~cx&qArnc!ES`eu09pprni*ZZ z7K8z4soSMb=`-6vH30neEo-IJ>i5(J!U5POlvPgT^Va7SQX61%k3g#dSo;lEs~3a; zEM1InN~jmG0W~AdZF-|d$bi^>02RQNveN^gWkS`vYT!AhV#K0=yJ8XsfXgpFq4DU& zhlgoSMmV0iHDya}pc#PK8UWoj_^dkX?;4pEXa*p~1!(tUPh!l@5ivJQ(y#SK4?IrUzJed^;2Vnbx+~Z~i zatC0a>i}JWuE1gia&trG)sXpdH~<4=#}`il8-N|}0A>YB7cAXg5C*W;z-9%)0hk-f z@mx@|5i*c)fLtYtDbNf6o2ue@LhpbbV6g%$Gs^0Orx$>oIi6XuiV6BR%Zg)ahV2;_ z2O{nM0Zoy`Hh^Cc4xmkuwW7Ls3Yr11_MTxcTQLPz2ViA;>AGRhA;O+EvjSlNECQx} zqtP0f0`52v4#0k3@j!VlnRTN=Z6FMQO0U!n&<3&>qi}$wzinl$oTxSs4v?l`>>sNB zyJq14>Q;bZmfZ09R`O0000 Date: Fri, 6 Nov 2020 18:08:43 -0500 Subject: [PATCH 12/46] sheeting fixes --- Projectiles/Rogue/StealthNimbus2.png | Bin 1809 -> 1959 bytes Projectiles/Rogue/StealthNimbusCloud2.png | Bin 859 -> 894 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/Projectiles/Rogue/StealthNimbus2.png b/Projectiles/Rogue/StealthNimbus2.png index 093136e7b9087d21c99d1b23f5e70678c65953b8..fe49b64f61522488687e1b0034784c89e93d94ee 100644 GIT binary patch delta 1958 zcmV;X2U+-$4yO;07k{V-1^@s6t0^7s000MUNklzaa~#r*z*rPe*2Em9)CT0pl7>ZZvWZ){?+e4 zE>ed@9(t$d)dK?nZqi`t>C1iFeRr!Pa`%rJ#D%F$PG+nbU<~BBhFanN$*__+J;GmqTgeSZ7vU)?7&$K~;z%YA)%tGkr? zUd&kaz*J|zzJCPED(3iiF!<$-Ke}7tgJ350O)$s3Ff)0MvF3oe0TqnF^02hBpo=*8 zIx~P?QT4j;Z7_}UU~b1)bHEfJwg~rriYZuLF~$t=bND{I7v)?_!26Gy2gYq&SsuTm zO)Cq!-b@)2jL4ULgDev`G1%)xQiv@aZEY2s%UY*U?Inx ziVgmY-p23c~ueB)ZKlm z9{hVeAG>hCQVXtKZZczQS2%s&1}wEyDdkpU%=LnE^@cX`nA`Hr0AnC3h-L#0)eq%- zY;I;$5Pw}9FemaLvQP|-odq~e#f4V3^JoT`TXax9fuNQx&3Yv6X9ZZPU@BO4zG!FA zX%t>8Fm7^eK`6j%an5d)MlI)6R>ipFJbH2uaT@075 z9jg^fHXQpL`{?Lh1JwglP0@v1xNmN)KJ_WCx1Eo16II*wss)z%;8I#W&l4xlpqXN) zHh)zM%nb*nT#tRMlnSTy*np*$Dy7_PjJZw)fL(7kmti(wZX9zvP~H4$ZYBpaHg*SU zalqWFiP{Ou>K1@OmEtW)Zg133-?NN02P}=|mA zw%p=*sp>TJ{fjYHJur9Vk+lofEK=2Jb;gT1uJoUcP!T9s4!;ZR>3>|@OV z10Y@{QTiX4VnsOhm4oNZsRr2Cg?~NO`?03)e9PstN>8xInunVR77NS`sHNr1;Z+(w z>r!pb91F}HC{WoO-1)9A-n*Me@!C62bf0Ri+U4^oE@w_Lz|{ESRyCC5t$?BYr|;hE zUis47{fwFJ-~#ID6l1&EQZ2AlKOCD{=B+n>=w9*u2Y1hp!Dmy(P!7JT7=IhRi@SPY zP9KEtpd6UMcQAC{D3l9` z?7{&{Ex2~M$&9UC;q-kQuz%E2rIcHZv2+bP9jBZDH(<^}ZkAA7YMG&cR1jSpFsEK^ zIdh15mlD*8MXr;vf@!+brr6Xn$~US9mhQKQ0n}d_!1XO>&RJsr*^>b|C3wr3bN0tE zic1FM24bhsI%O8mcblbMIhXxt@V@)%fT?a?SxzwvOR;8;^6GjuIe&Ai0mcleTsP>h zq2%&?&590&Hln64vF6b%F!n)Sb;0$ewEER@<}?S)#gwI7kA19^3a9nh zfTflyrQB?ct*y;F1AlJ7TrBA}YI3Z{7Iy-uV~DR0W^C-%+TwsUms&Me9M`0W{HC(19D8Qm0BkKJJD!4@qWca=ggT6SZO(PTowr)w_=s*&^dD^150B( zC&x`ybn$$*xjHRpcX7K=rr2aaE(T;^ZneZ+hXl_1?U{*m^?ydioafHAqztLpuQ*_i zxin{v+9!|a<2vvDc3JwI!Q*kvH9>WlrdVJu_*JVaY8N-Jvf%k(EY<8)(;ut^y8)Xk zR1Gk0ifVg0mvgHu(DtFtW1IWm|K8g@iVep5@Y9)gJcDi)nCq2ree8aEzK>U1Ql?Ok sn6V2FEH%K=Px*%Sl8*RCt{2oIh_I zMHt4PMHl-hB5Y#^#UKJoNE3GyP@+Hu-vP-55>$Xh8lVjnAOTg7Tp+<`paYZ-0G-`L zSbznNh>30FBK{L{6nl?-^LXE#ne|Jxti%&Y|*ETmR%UO!5l5-PhivINh z_?1gvG3zO(v42E`tR5%N&ddM+7S2Bb09d~LFM#99X?ddMZf!kcNP&v6 z=h>515Bf$N`njUlCHhUMc#0N4!ise)r4D0e%RTQ?%72F{pzZKJ^nO^5=dIs606idO z#rTK*=j;84k@k?{izUVP`)8Gpy-w1KY1cW@uxGT#tPu#6)~A-19|6w)k*s2MW5uX> z7HJwozL87KQ`o7P{#a2@SfhLx3R+`GV)b;>dNAgYFMWK&IUXOyl+byah0dRv)>HBf zI+mJPtbc?(+_YXS=_=Oijcg(??e5=rpk?$KPpcnE)B#rIv|a1E>Ht%@WPcUws8UvJSUs*iYIz&F>caMJZQZTB zF^y?;p!xZFZ@UK^#T=g%=_+P9!6Y;`v`6{Wq-%wh>h_M6>!aTUuF?=*_c9J+y9XS_ zT(XK4S7$E-jp0I9M`GKt>iJfEh_wqLS;YpO;94Is7OTfCXW6=rDr&9HD9I{T40sSx zv45uCyziK(V!m>|`_S^qKNULzf7iwuVbAdQLq{mq=e|`JRnk{ZkH=@%fHfbhpmr=t zM&Q+B@VdlOD*4g9*QKJ8zMVT{*j~Nmp;$_h@l}k(I=bw^ru9OvJH9SeQ%=j9_mLH| zlnH(65#K)hVJSI&ip8#)_;#R@*nReSwSPr8rkHP}5$Z*#8%4hTb=4_v?K?baET*rR zrBv*yiKP^wKj>>OHWo?pqx+6N{X#u_>x~Cuy&-X^M1QZb?!PB*Ub^TUQ)znj3P=0N zd-tYG6&hQysJCJHjQYj|Q4e3+P2Qyn_UNJ@ASkau1k=Xr) z!`_Flu@^ei9v{V&P~ULW`|y2Uy)wRvg>qWnzD2r<4ZA_k@2tJV_xdrySRqZ{h_J|t zDLH4(DbYA*&Qp(&8Kk(@YZj^+PZE|ag^fPd(m&pC7YoH%EW zPZ@QDL&-UF42G67$BGqS&Kxb@G-r;+V7iL6HD`{l(hS^3;=baja^@^uFXv5fedNx! zhLtnN`n^NWnKPoCIaKuKhxM_RbLI#m%bD}p=g$KGmahNi9LKJNTCrL|&VQLx*|pz) z;(oWO1iAJ>sZe*(&4@yFzj?>0$MSkig>uduAv$LcW9`Lr<>>nDcmD)%Tp=p+^;geS zHm3Dho=Vj`^>WUfTGS_;>y}kse&Ig=z|NhC+Q;1d(|ZK~tp7F1WAu+}>;1fSP`(kr zzgPKro(lX7RAGAgRC>N}udnx$bLLb~IhLeSB-E=XmVd|p%boJeWUbHT zoH-W0_oKP$LYjK@thcgSdMxXEWxE^w?T|Zg_eJKMIX=|2;;PI1WEl(7UALY0mX`ql zUoI>}-4N^PbuGr%rD{sfne&jzIdj@Z&Y9CTa?YH#k#pv>jYl?Tj^!WboH>tb&Yalm zj*Ux|bLO;-hn_RXa({Mx^+G>SKE{TgGe=ibj>kg%I#Ql-IcB0JW(gv_eMp|nG>5c$8vy4s7Ft4p6%=$l(Py|Q1{{IoH?Q1z0Uy-_2|!@ x+b;lMZLRe7i=u3AYVv_oPgh%V&YV8~1Ba{%9XSbk;Q#;t00>D%PDHLkV1fjYsu%zO diff --git a/Projectiles/Rogue/StealthNimbusCloud2.png b/Projectiles/Rogue/StealthNimbusCloud2.png index 93891649aeb11e147364aaebb45477597efdd6b1..5ac9056f6d178019f4ef3bd93f69ef64d5d9462d 100644 GIT binary patch literal 894 zcmV-^1A+XBP)!iZPf!_{ZYa0rbLR15k;D6NAua~Dc zz&ov zLMe^Lw(x5cBv@9)1z@ns6n3>322@sGWeFaK&g0k>9}nyfB7!V*fQOdn3*9J>s z6%GeRm7!oz*gacR19{R`MmTEm)g&%6{xD!vDG!@;0#?R1nlY+@&H%IZ=iZuL@fQQC zDX!GbS=Y8Rz^L)%>xvcbfyGwe4G(90i`#HmkWIj}F!c~k1cL$<(s!U;>ceYBK0o|+SX4yh*HuD1745%^% z?>X^sP*x)SO%yUkccAkyDk0;(^v=v;z^uiOy0^6Ru61u|V5!Boo~HJ}>i&P57p|Tm U5Bp;P0000@~ literal 859 zcmV-h1ElPx&6-h)vRA_gFIN*MV``v3s&ZS^|^fUC39V1?`3aj^WPeURk!0c@Pq?x4jB zMt;#dF1+ye%?kj)r!PMddQRQU<|zOSj}8+6xJ1@6ehw@#a%#})0RTSFW`+B!{P+5H zoC2FZsoz06H?hLHG(weC&OTzF)bC)0bqWCeq+58PPE_i^de46p#oAuqyP3@k<=PVd z4n|q$V>JH(060HR3gx@1xtYw!V`7_6(?#L8jh53)?jTz;rs*QMnzHTHk@kr?;mXk5 zj%KN3KL7x*MV82Rw)!3Lf=(=TTiJkHtk*$@jqS-#Ut4`pbu?8ayyoTs$Gf#JR3$t= z2LOU=5gjPuQMwm%M*DG5)fY8#6`fw>_kLVtMMA|WgZsjuC-w8b@MlvMBl<8drwn~g z`Ln6j<{BCAmF%YZwCJ|Hs6q=YveV}=E!Iv{5&Z|Fd0HBEKk04}^-llbZ?#2s8jUr2 zN?a8x)bD@+25a=fH|Qmic1j6xS+0HjQx+wQJVVjZIB1q7y4;M@_>M_(A?$)IpZB zSR$Nlv9gknMw2g_ZZ)ixyNi)tV{H2LW%fag@Fpa=wA8RkB zBQk39=gBd`Q_(pYwYi*K)e}Ljr)rL_W2doHj5=KAL69cioxTiK&~G&zbu8!k!v5s0 zDdi*UtCJ@qehzdr#AsU2E-lqRir)9n0BqJGMrMug7^5m5)!zr)d6Z3+Im>dRdA-8l l*`L$cM{8AS<2Ocje*j;A+FqB*^=beB002ovPDHLkV1l2)nc)Bc From 2a74224a4706e903f223cab9fe2acece9b6d2593 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 6 Nov 2020 18:47:58 -0500 Subject: [PATCH 13/46] Fixed boss rush text bug --- Events/BossRushEvent.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Events/BossRushEvent.cs b/Events/BossRushEvent.cs index 65cdf139bb..ca22b196cf 100644 --- a/Events/BossRushEvent.cs +++ b/Events/BossRushEvent.cs @@ -214,7 +214,7 @@ namespace CalamityMod.Events }, usesSpecialSound: true), new Boss(ModContent.NPCType(), spawnContext: type => { - CalamityUtils.DisplayLocalizedText("BossRushTierFourEndText2", XerocTextColor); + CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.BossRushTierFourEndText2", XerocTextColor); for (int playerIndex = 0; playerIndex < Main.maxPlayers; playerIndex++) { if (Main.player[playerIndex].active) From 32ad7aacdd0412fdc016d5b86d925b053f7c3030 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 6 Nov 2020 18:49:51 -0500 Subject: [PATCH 14/46] momentum capacitor typo fix --- CalamityMod.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CalamityMod.cs b/CalamityMod.cs index 16414ea458..5199ede371 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -126,7 +126,7 @@ namespace CalamityMod TarraHotKey = RegisterHotKey("Armor Set Bonus", "Y"); AstralTeleportHotKey = RegisterHotKey("Astral Teleport", "P"); AstralArcanumUIHotkey = RegisterHotKey("Astral Arcanum UI Toggle", "O"); - MomentumCapacitatorHotkey = RegisterHotKey("Momentom Capacitator Effect", "U"); + MomentumCapacitatorHotkey = RegisterHotKey("Momentom Capacitor Effect", "U"); SandCloakHotkey = RegisterHotKey("Sand Cloak Effect", "C"); SpectralVeilHotKey = RegisterHotKey("Spectral Veil Teleport", "Z"); PlaguePackHotKey = RegisterHotKey("Booster Dash", "Q"); From a98383b0495b2464502497eb8acdc3de99c5112d Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 6 Nov 2020 18:50:09 -0500 Subject: [PATCH 15/46] there were two typos, shit --- CalamityMod.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CalamityMod.cs b/CalamityMod.cs index 5199ede371..7e77e19751 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -126,7 +126,7 @@ namespace CalamityMod TarraHotKey = RegisterHotKey("Armor Set Bonus", "Y"); AstralTeleportHotKey = RegisterHotKey("Astral Teleport", "P"); AstralArcanumUIHotkey = RegisterHotKey("Astral Arcanum UI Toggle", "O"); - MomentumCapacitatorHotkey = RegisterHotKey("Momentom Capacitor Effect", "U"); + MomentumCapacitatorHotkey = RegisterHotKey("Momentum Capacitor Effect", "U"); SandCloakHotkey = RegisterHotKey("Sand Cloak Effect", "C"); SpectralVeilHotKey = RegisterHotKey("Spectral Veil Teleport", "Z"); PlaguePackHotKey = RegisterHotKey("Booster Dash", "Q"); From 9761bb376b2c1119b44b1e45b7a590f5f80bfeb4 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 6 Nov 2020 19:19:15 -0500 Subject: [PATCH 16/46] fixed opacity issues with type 1 afterimages --- Projectiles/CalamityGlobalProjectile.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 48454e7014..b2e8c91591 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -2129,16 +2129,18 @@ namespace CalamityMod.Projectiles // Paladin's Hammer style afterimages. Can be optionally spaced out further by using the typeOneDistanceMultiplier variable. // Type 1 afterimages linearly scale down from 66% to 0% opacity. They otherwise do not differ from type 0. case 1: - Color colorAtPosition = Lighting.GetColor((int)(projectile.Center.X / 16), (int)(projectile.Center.Y / 16)); - Color drawColor = projectile.GetAlpha(colorAtPosition); + Color drawColor = projectile.GetAlpha(lightColor); int afterimageCount = ProjectileID.Sets.TrailCacheLength[projectile.type]; - int k = 1; + int k = 0; while (k < afterimageCount) { Vector2 drawPos = projectile.oldPos[k] + centerOffset - Main.screenPosition + new Vector2(0f, projectile.gfxOffY); // DO NOT REMOVE THESE "UNNECESSARY" FLOAT CASTS EITHER. - float colorMult = (float)(afterimageCount - k); - drawColor *= colorMult / ((float)afterimageCount * 1.5f); + if (k > 0) + { + float colorMult = (float)(afterimageCount - k); + drawColor *= colorMult / ((float)afterimageCount * 1.5f); + } Main.spriteBatch.Draw(texture, drawPos, new Microsoft.Xna.Framework.Rectangle?(rectangle), drawColor, rotation, origin, scale, spriteEffects, 0f); k += typeOneDistanceMultiplier; } From 0b279dd3273526124d134beba58e9373fea18dba Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 6 Nov 2020 19:19:40 -0500 Subject: [PATCH 17/46] removed afterimages from cryophobia since they looked jittery --- Projectiles/Magic/CryoBlast.cs | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/Projectiles/Magic/CryoBlast.cs b/Projectiles/Magic/CryoBlast.cs index fe2e3cb645..1038d71148 100644 --- a/Projectiles/Magic/CryoBlast.cs +++ b/Projectiles/Magic/CryoBlast.cs @@ -13,8 +13,6 @@ namespace CalamityMod.Projectiles.Magic { DisplayName.SetDefault("Blast"); Main.projFrames[projectile.type] = 4; - ProjectileID.Sets.TrailCacheLength[projectile.type] = 4; - ProjectileID.Sets.TrailingMode[projectile.type] = 1; } public override void SetDefaults() @@ -69,14 +67,22 @@ namespace CalamityMod.Projectiles.Magic } } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { if (projectile.timeLeft > 599) return false; - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); - return false; - } + Texture2D texture = Main.projectileTexture[projectile.type]; + Rectangle rectangle = new Rectangle(0, 0, texture.Width, texture.Height); + Vector2 origin = rectangle.Size() / 2f; + + SpriteEffects spriteEffects = SpriteEffects.None; + if (projectile.spriteDirection == -1) + spriteEffects = SpriteEffects.FlipHorizontally; + + Main.spriteBatch.Draw(texture, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), rectangle, lightColor, projectile.rotation, origin, projectile.scale, spriteEffects, 0f); + return false; + } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { From 5ba68db199a52e982505ddbe8f7877993c7ae0cd Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 6 Nov 2020 19:21:46 -0500 Subject: [PATCH 18/46] renamed Weaver Trophy --- Items/Placeables/Furniture/Trophies/WeaverTrophy.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Placeables/Furniture/Trophies/WeaverTrophy.cs b/Items/Placeables/Furniture/Trophies/WeaverTrophy.cs index 574644403f..3adc92727c 100644 --- a/Items/Placeables/Furniture/Trophies/WeaverTrophy.cs +++ b/Items/Placeables/Furniture/Trophies/WeaverTrophy.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Items.Placeables.Furniture.Trophies { public override void SetStaticDefaults() { - DisplayName.SetDefault("Weaver Trophy"); + DisplayName.SetDefault("Storm Weaver Trophy"); } public override void SetDefaults() From 577d8678621f8eb4b3bbdc8741b6765ca0b1ba22 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 6 Nov 2020 19:25:29 -0500 Subject: [PATCH 19/46] updated sulphur set bonus tip to be more accurate --- Items/Armor/SulfurHelmet.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Items/Armor/SulfurHelmet.cs b/Items/Armor/SulfurHelmet.cs index 6e78679c6e..5b30573843 100644 --- a/Items/Armor/SulfurHelmet.cs +++ b/Items/Armor/SulfurHelmet.cs @@ -37,8 +37,7 @@ namespace CalamityMod.Items.Armor { player.setBonus = "Attacking and being attacked by enemies inflicts poison\n" + "Grants an additional jump that summons a sulphurous bubble\n" + - "Reduces the severity of the sulphuric waters\n" + - "Slightly reduces breath loss in the abyss\n" + + "Provides increased underwater mobility and reduces the severity of the sulphuric waters\n" + "Rogue stealth builds while not attacking and slower while moving, up to a max of 100\n" + "Once you have built max stealth, you will be able to perform a Stealth Strike\n" + "Rogue stealth only reduces when you attack, it does not reduce while moving\n" + From decd5fe4b1817eb798be46806f8c3ba222c0e3f6 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 6 Nov 2020 19:28:09 -0500 Subject: [PATCH 20/46] yharon p1 now triggers bandit ! --- NPCs/Yharon/Yharon.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/NPCs/Yharon/Yharon.cs b/NPCs/Yharon/Yharon.cs index e50ddcceb1..254cc0601e 100644 --- a/NPCs/Yharon/Yharon.cs +++ b/NPCs/Yharon/Yharon.cs @@ -13,6 +13,7 @@ using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Items.Weapons.Summon; +using CalamityMod.NPCs.TownNPCs; using CalamityMod.Projectiles.Boss; using CalamityMod.Tiles.Ores; using CalamityMod.World; @@ -2799,6 +2800,8 @@ namespace CalamityMod.NPCs.Yharon CalamityUtils.DisplayLocalizedText(key, messageColor); } + CalamityGlobalTownNPC.SetNewShopVariable(new int[] { ModContent.NPCType() }, CalamityWorld.buffedEclipse); + // Bags occur in either phase 1 or 2, as they don't contain phase 2 only drops DropHelper.DropBags(npc); From c337392813e63ef85ae4ea7386abe72a6988ad4a Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 6 Nov 2020 19:29:57 -0500 Subject: [PATCH 21/46] reworded stat meter for clarity --- Items/Accessories/StatMeter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Accessories/StatMeter.cs b/Items/Accessories/StatMeter.cs index 72bf551374..dd71d48a37 100644 --- a/Items/Accessories/StatMeter.cs +++ b/Items/Accessories/StatMeter.cs @@ -143,7 +143,7 @@ namespace CalamityMod.Items.Accessories sb.Append("Defense Lost: ").Append(defenseLoss); } else - sb.Append("Abyss stats only displayed while in the Abyss"); + sb.Append("Other Abyss stats are only displayed while in the Abyss"); return sb.ToString(); } From 733597f3fc2d5f4449ad15ba9124ebeca7aa728b Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 6 Nov 2020 20:51:37 -0500 Subject: [PATCH 22/46] reworded eldritch soul artifact tooltip for clarity --- Items/Accessories/EldritchSoulArtifact.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Items/Accessories/EldritchSoulArtifact.cs b/Items/Accessories/EldritchSoulArtifact.cs index 52bc9e97d0..bc2eedbf17 100644 --- a/Items/Accessories/EldritchSoulArtifact.cs +++ b/Items/Accessories/EldritchSoulArtifact.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Accessories { DisplayName.SetDefault("Eldritch Soul Artifact"); Tooltip.SetDefault("Knowledge\n" + - "Boosts melee speed by 10%, shoot speed by 25%, rogue damage by 15%, max minions by 2, and reduces mana cost by 15%"); + "Boosts melee speed by 10%, ranged velocity by 25%, rogue damage by 15%, max minions by 2, and reduces mana cost by 15%"); } public override void SetDefaults() From d8c2659ea91f89e52dadc1fe2b6ebfcaac86c1ae Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 6 Nov 2020 20:54:17 -0500 Subject: [PATCH 23/46] badge of bravery fix --- CalPlayer/CalamityPlayer.cs | 6 +++--- CalPlayer/CalamityPlayerMiscEffects.cs | 21 ++++++++++++++++----- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 84ac4aae6d..3aa8adf75c 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -3564,10 +3564,10 @@ namespace CalamityMod.CalPlayer float maxDistance = 480f; // 30 tile distance for (int l = 0; l < Main.maxNPCs; l++) { - NPC nPC = Main.npc[l]; - if (nPC.active && !nPC.friendly && nPC.damage > 0 && !nPC.dontTakeDamage && Vector2.Distance(player.Center, nPC.Center) <= maxDistance) + NPC npc = Main.npc[l]; + if (npc.active && !npc.friendly && (npc.damage > 0 || npc.boss) && !npc.dontTakeDamage && Vector2.Distance(player.Center, npc.Center) <= maxDistance) { - meleeSpeedMult += MathHelper.Lerp(0f, 0.3f, 1f - (Vector2.Distance(player.Center, nPC.Center) / maxDistance)); + meleeSpeedMult += MathHelper.Lerp(0f, 0.3f, 1f - (Vector2.Distance(player.Center, npc.Center) / maxDistance)); } } } diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 07dd66956e..d5cb798ec4 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -3261,10 +3261,10 @@ namespace CalamityMod.CalPlayer float maxDistance = 480f; // 30 tile distance for (int l = 0; l < Main.maxNPCs; l++) { - NPC nPC = Main.npc[l]; - if (nPC.active && !nPC.friendly && nPC.damage > 0 && !nPC.dontTakeDamage && Vector2.Distance(player.Center, nPC.Center) <= maxDistance) + NPC npc = Main.npc[l]; + if (npc.active && !npc.friendly && (npc.damage > 0 || npc.boss) && !npc.dontTakeDamage && Vector2.Distance(player.Center, npc.Center) <= maxDistance) { - player.meleeDamage += MathHelper.Lerp(0f, 0.3f, 1f - (Vector2.Distance(player.Center, nPC.Center) / maxDistance)); + player.meleeDamage += MathHelper.Lerp(0f, 0.3f, 1f - (Vector2.Distance(player.Center, npc.Center) / maxDistance)); } } } @@ -3925,8 +3925,19 @@ namespace CalamityMod.CalPlayer ((player.head == ArmorIDs.Head.MoltenHelmet && player.body == ArmorIDs.Body.MoltenBreastplate && player.legs == ArmorIDs.Legs.MoltenGreaves) ? 0.2 : 0) + (player.kbGlove ? 0.1 : 0) + (modPlayer.eGauntlet ? 0.1 : 0) + - (modPlayer.yInsignia ? 0.1 : 0) + - (modPlayer.badgeOfBraveryRare ? 0.2 : 0); + (modPlayer.yInsignia ? 0.1 : 0); + if (modPlayer.badgeOfBraveryRare) + { + float maxDistance = 480f; // 30 tile distance + for (int l = 0; l < Main.maxNPCs; l++) + { + NPC npc = Main.npc[l]; + if (npc.active && !npc.friendly && (npc.damage > 0 || npc.boss) && !npc.dontTakeDamage && Vector2.Distance(player.Center, npc.Center) <= maxDistance) + { + damageAdd += MathHelper.Lerp(0f, 0.3f, 1f - (Vector2.Distance(player.Center, npc.Center) / maxDistance)); + } + } + } modPlayer.trueMeleeDamage += damageAdd; // Intentionally at the end: Bloodflare Core's defense reduction (after all other boosting effects and whatnot) From a2a2a9968f658f5b9c43b0ef16a51a94203ff3f4 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sat, 7 Nov 2020 21:32:31 -0500 Subject: [PATCH 24/46] cotbg now makes healing pots heal 15% more --- CalPlayer/CalamityPlayer.cs | 6 ++++-- Items/Accessories/CoreOfTheBloodGod.cs | 1 + Utilities/CalamityUtils.cs | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 3aa8adf75c..d4c11c1220 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -4339,8 +4339,10 @@ namespace CalamityMod.CalPlayer #region Get Heal Life public override void GetHealLife(Item item, bool quickHeal, ref int healValue) { - if (bloodPactBoost) - healValue = (int)(healValue * 1.5); + double healMult = 1D + + (coreOfTheBloodGod ? 0.15 : 0) + + (bloodPactBoost ? 0.5 : 0); + healValue = (int)(healValue * healMult); if (CalamityWorld.ironHeart) healValue = 0; } diff --git a/Items/Accessories/CoreOfTheBloodGod.cs b/Items/Accessories/CoreOfTheBloodGod.cs index a518c0a659..028e5e988c 100644 --- a/Items/Accessories/CoreOfTheBloodGod.cs +++ b/Items/Accessories/CoreOfTheBloodGod.cs @@ -14,6 +14,7 @@ namespace CalamityMod.Items.Accessories DisplayName.SetDefault("Core of the Blood God"); Tooltip.SetDefault("8% increased damage and damage reduction\n" + "Boosts your max HP by 10%\n" + + "Healing Potions are 15% more effective\n" + "Halves enemy contact damage\n" + "When you take contact damage this effect has a 20 second cooldown"); } diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index d121557962..5bffbff5ab 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -770,7 +770,10 @@ namespace CalamityMod { Main.PlaySound(item.UseSound, player.Center); - int healAmt = player.Calamity().bloodPactBoost ? (int)(item.healLife * 1.5) : item.healLife; + double healMult = 1D + + (player.Calamity().coreOfTheBloodGod ? 0.15 : 0) + + (player.Calamity().bloodPactBoost ? 0.5 : 0); + int healAmt = (int)(item.healLife * healMult); if (CalamityWorld.ironHeart) healAmt = 0; if (healAmt > 0 && player.QuickHeal_GetItemToUse() != null) From e98d1698ad5b60e4a88dab761cf79424322465de Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sun, 8 Nov 2020 12:06:11 -0500 Subject: [PATCH 25/46] removed unused recipe group --- Utilities/CalamityRecipes.cs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Utilities/CalamityRecipes.cs b/Utilities/CalamityRecipes.cs index de4a5ee488..710b0832fd 100644 --- a/Utilities/CalamityRecipes.cs +++ b/Utilities/CalamityRecipes.cs @@ -910,13 +910,6 @@ namespace CalamityMod }); RecipeGroup.RegisterGroup("AnyGoldBar", group); - group = new RecipeGroup(() => "Any Evil Ore", new int[] - { - ItemID.CrimtaneOre, - ItemID.DemoniteOre - }); - RecipeGroup.RegisterGroup("AnyEvilOre", group); - group = new RecipeGroup(() => "Any Evil Block", new int[] { ItemID.EbonstoneBlock, From 5cdce606ce21d3334fcc79878e0e20a62e8922f7 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sun, 8 Nov 2020 12:17:55 -0500 Subject: [PATCH 26/46] all yoyos now spontaneously combust when more than 200 tiles away --- Projectiles/Melee/Yoyos/AirSpinnerYoyo.cs | 2 ++ Projectiles/Melee/Yoyos/AortaYoyo.cs | 2 ++ Projectiles/Melee/Yoyos/AzathothYoyo.cs | 2 ++ Projectiles/Melee/Yoyos/ChaotrixYoyo.cs | 5 +++-- Projectiles/Melee/Yoyos/CnidarianYoyo.cs | 2 ++ Projectiles/Melee/Yoyos/GodsGambitYoyo.cs | 2 ++ Projectiles/Melee/Yoyos/LaceratorYoyo.cs | 6 ++++++ Projectiles/Melee/Yoyos/MicrowaveYoyo.cs | 5 ++++- Projectiles/Melee/Yoyos/ObliteratorYoyo.cs | 3 +++ Projectiles/Melee/Yoyos/OblivionYoyo.cs | 2 ++ Projectiles/Melee/Yoyos/OracleYoyo.cs | 3 +++ Projectiles/Melee/Yoyos/PandemicYoyo.cs | 2 ++ Projectiles/Melee/Yoyos/QuagmireYoyo.cs | 2 ++ Projectiles/Melee/Yoyos/RiptideYoyo.cs | 2 ++ Projectiles/Melee/Yoyos/ShimmersparkYoyo.cs | 2 ++ Projectiles/Melee/Yoyos/SolarFlareYoyo.cs | 2 ++ Projectiles/Melee/Yoyos/SulphurousGrabberYoyo.cs | 3 +++ Projectiles/Melee/Yoyos/VerdantYoyo.cs | 3 +++ Projectiles/Melee/Yoyos/YinYoyo.cs | 2 ++ 19 files changed, 49 insertions(+), 3 deletions(-) diff --git a/Projectiles/Melee/Yoyos/AirSpinnerYoyo.cs b/Projectiles/Melee/Yoyos/AirSpinnerYoyo.cs index 56ba5f1f19..66bc2abd06 100644 --- a/Projectiles/Melee/Yoyos/AirSpinnerYoyo.cs +++ b/Projectiles/Melee/Yoyos/AirSpinnerYoyo.cs @@ -33,6 +33,8 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void AI() { CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 300f, 6f, 60f, 5, ModContent.ProjectileType(), 0.25); + if ((projectile.position - Main.player[projectile.owner].position).Length() > 3200f) //200 blocks + projectile.Kill(); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Melee/Yoyos/AortaYoyo.cs b/Projectiles/Melee/Yoyos/AortaYoyo.cs index 829909970d..f2ee8c59b8 100644 --- a/Projectiles/Melee/Yoyos/AortaYoyo.cs +++ b/Projectiles/Melee/Yoyos/AortaYoyo.cs @@ -33,6 +33,8 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void AI() { CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 240f, 6f, 180f, 3, ModContent.ProjectileType(), 0.25); + if ((projectile.position - Main.player[projectile.owner].position).Length() > 3200f) //200 blocks + projectile.Kill(); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Melee/Yoyos/AzathothYoyo.cs b/Projectiles/Melee/Yoyos/AzathothYoyo.cs index 695dd85f3e..52120a0f8f 100644 --- a/Projectiles/Melee/Yoyos/AzathothYoyo.cs +++ b/Projectiles/Melee/Yoyos/AzathothYoyo.cs @@ -41,6 +41,8 @@ namespace CalamityMod.Projectiles.Melee.Yoyos if (projectile.owner == Main.myPlayer) Projectile.NewProjectile(projectile.Center, projectile.velocity * 0.35f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); } + if ((projectile.position - Main.player[projectile.owner].position).Length() > 3200f) //200 blocks + projectile.Kill(); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Melee/Yoyos/ChaotrixYoyo.cs b/Projectiles/Melee/Yoyos/ChaotrixYoyo.cs index ba44b3cb17..deebe87473 100644 --- a/Projectiles/Melee/Yoyos/ChaotrixYoyo.cs +++ b/Projectiles/Melee/Yoyos/ChaotrixYoyo.cs @@ -37,12 +37,13 @@ namespace CalamityMod.Projectiles.Melee.Yoyos if (Main.rand.NextBool(5)) Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, Main.rand.NextBool(3) ? 16 : 127, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); - Vector2 goreVec = new Vector2(projectile.position.X, projectile.position.Y); if (Main.rand.NextBool(8)) { - int smoke = Gore.NewGore(goreVec, default, Main.rand.Next(375, 378), 0.5f); + int smoke = Gore.NewGore(projectile.position, default, Main.rand.Next(375, 378), 0.5f); Main.gore[smoke].behindTiles = true; } + if ((projectile.position - Main.player[projectile.owner].position).Length() > 3200f) //200 blocks + projectile.Kill(); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Melee/Yoyos/CnidarianYoyo.cs b/Projectiles/Melee/Yoyos/CnidarianYoyo.cs index ebb44531f8..bb55dc6ec4 100644 --- a/Projectiles/Melee/Yoyos/CnidarianYoyo.cs +++ b/Projectiles/Melee/Yoyos/CnidarianYoyo.cs @@ -32,6 +32,8 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void AI() { CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 300f, 6f, 180f, 5, ModContent.ProjectileType(), 0.75); + if ((projectile.position - Main.player[projectile.owner].position).Length() > 3200f) //200 blocks + projectile.Kill(); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Melee/Yoyos/GodsGambitYoyo.cs b/Projectiles/Melee/Yoyos/GodsGambitYoyo.cs index 2fa4337200..d47c89c43a 100644 --- a/Projectiles/Melee/Yoyos/GodsGambitYoyo.cs +++ b/Projectiles/Melee/Yoyos/GodsGambitYoyo.cs @@ -31,6 +31,8 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void AI() { CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 450f, 6f, 30f, 5, ProjectileID.SlimeGun, 0.75); + if ((projectile.position - Main.player[projectile.owner].position).Length() > 3200f) //200 blocks + projectile.Kill(); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Melee/Yoyos/LaceratorYoyo.cs b/Projectiles/Melee/Yoyos/LaceratorYoyo.cs index bad62fd73a..1d27b25c5e 100644 --- a/Projectiles/Melee/Yoyos/LaceratorYoyo.cs +++ b/Projectiles/Melee/Yoyos/LaceratorYoyo.cs @@ -34,6 +34,12 @@ namespace CalamityMod.Projectiles.Melee.Yoyos projectile.localNPCHitCooldown = 8; } + public override void AI() + { + if ((projectile.position - Main.player[projectile.owner].position).Length() > 3200f) //200 blocks + projectile.Kill(); + } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { if (target.type == NPCID.TargetDummy || !target.canGhostHeal || Main.player[projectile.owner].moonLeech) diff --git a/Projectiles/Melee/Yoyos/MicrowaveYoyo.cs b/Projectiles/Melee/Yoyos/MicrowaveYoyo.cs index dd8210a33f..ada3206e56 100644 --- a/Projectiles/Melee/Yoyos/MicrowaveYoyo.cs +++ b/Projectiles/Melee/Yoyos/MicrowaveYoyo.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos // Spawn invisible but damaging aura projectile if (projectile.owner == Main.myPlayer && !spawnedAura) { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)(projectile.damage * 0.35), projectile.knockBack, projectile.owner, projectile.identity, 0f); + Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(projectile.damage * 0.35), projectile.knockBack, projectile.owner, projectile.identity, 0f); spawnedAura = true; } @@ -80,6 +80,9 @@ namespace CalamityMod.Projectiles.Melee.Yoyos Main.dust[dust].velocity *= 0.2f; Main.dust[dust].scale = 0.1599999999f; } + + if ((projectile.position - Main.player[projectile.owner].position).Length() > 3200f) //200 blocks + projectile.Kill(); } public override void Kill(int timeLeft) diff --git a/Projectiles/Melee/Yoyos/ObliteratorYoyo.cs b/Projectiles/Melee/Yoyos/ObliteratorYoyo.cs index 4e8bf5dc91..0529999874 100644 --- a/Projectiles/Melee/Yoyos/ObliteratorYoyo.cs +++ b/Projectiles/Melee/Yoyos/ObliteratorYoyo.cs @@ -46,6 +46,9 @@ namespace CalamityMod.Projectiles.Melee.Yoyos // localAI[1] counts up to 19 (4 x 5 - 1), then resets back to 0 for a 20-frame cycle. public override void AI() { + if ((projectile.position - Main.player[projectile.owner].position).Length() > 3200f) //200 blocks + projectile.Kill(); + // Only do stuff once per frame, despite the yoyo's extra updates. extraUpdateCounter = (extraUpdateCounter + 1) % UpdatesPerFrame; if (extraUpdateCounter != UpdatesPerFrame - 1) diff --git a/Projectiles/Melee/Yoyos/OblivionYoyo.cs b/Projectiles/Melee/Yoyos/OblivionYoyo.cs index bac7ce45e0..c2e269a9e9 100644 --- a/Projectiles/Melee/Yoyos/OblivionYoyo.cs +++ b/Projectiles/Melee/Yoyos/OblivionYoyo.cs @@ -34,6 +34,8 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void AI() { CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 300f, 6f, 48f, 5, ModContent.ProjectileType(), 0.5); + if ((projectile.position - Main.player[projectile.owner].position).Length() > 3200f) //200 blocks + projectile.Kill(); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Melee/Yoyos/OracleYoyo.cs b/Projectiles/Melee/Yoyos/OracleYoyo.cs index ebdf604fd0..2affa509cd 100644 --- a/Projectiles/Melee/Yoyos/OracleYoyo.cs +++ b/Projectiles/Melee/Yoyos/OracleYoyo.cs @@ -57,6 +57,9 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void AI() { + if ((projectile.position - Main.player[projectile.owner].position).Length() > 3200f) //200 blocks + projectile.Kill(); + // Only do stuff once per frame, despite the yoyo's extra updates. extraUpdateCounter = (extraUpdateCounter + 1) % UpdatesPerFrame; if (extraUpdateCounter != UpdatesPerFrame - 1) diff --git a/Projectiles/Melee/Yoyos/PandemicYoyo.cs b/Projectiles/Melee/Yoyos/PandemicYoyo.cs index 922f0b8f72..8966f1c388 100644 --- a/Projectiles/Melee/Yoyos/PandemicYoyo.cs +++ b/Projectiles/Melee/Yoyos/PandemicYoyo.cs @@ -32,6 +32,8 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void AI() { CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 300f, 6f, 180f, 5, ModContent.ProjectileType(), 0.75); + if ((projectile.position - Main.player[projectile.owner].position).Length() > 3200f) //200 blocks + projectile.Kill(); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Melee/Yoyos/QuagmireYoyo.cs b/Projectiles/Melee/Yoyos/QuagmireYoyo.cs index e4a9a54c71..094eebef9e 100644 --- a/Projectiles/Melee/Yoyos/QuagmireYoyo.cs +++ b/Projectiles/Melee/Yoyos/QuagmireYoyo.cs @@ -29,6 +29,8 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void AI() { + if ((projectile.position - Main.player[projectile.owner].position).Length() > 3200f) //200 blocks + projectile.Kill(); if (Main.rand.NextBool(5)) Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 44, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); if (projectile.owner == Main.myPlayer) diff --git a/Projectiles/Melee/Yoyos/RiptideYoyo.cs b/Projectiles/Melee/Yoyos/RiptideYoyo.cs index 4323053162..569a1d2331 100644 --- a/Projectiles/Melee/Yoyos/RiptideYoyo.cs +++ b/Projectiles/Melee/Yoyos/RiptideYoyo.cs @@ -29,6 +29,8 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void AI() { + if ((projectile.position - Main.player[projectile.owner].position).Length() > 3200f) //200 blocks + projectile.Kill(); if (Main.rand.NextBool(90)) { switch (Main.rand.Next(1, 9)) diff --git a/Projectiles/Melee/Yoyos/ShimmersparkYoyo.cs b/Projectiles/Melee/Yoyos/ShimmersparkYoyo.cs index 1dbb6a2873..2814140d07 100644 --- a/Projectiles/Melee/Yoyos/ShimmersparkYoyo.cs +++ b/Projectiles/Melee/Yoyos/ShimmersparkYoyo.cs @@ -31,6 +31,8 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void AI() { CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 300f, 6f, 120f, 5, ProjectileID.HallowStar); + if ((projectile.position - Main.player[projectile.owner].position).Length() > 3200f) //200 blocks + projectile.Kill(); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Melee/Yoyos/SolarFlareYoyo.cs b/Projectiles/Melee/Yoyos/SolarFlareYoyo.cs index cf20c22e6d..84c2033be5 100644 --- a/Projectiles/Melee/Yoyos/SolarFlareYoyo.cs +++ b/Projectiles/Melee/Yoyos/SolarFlareYoyo.cs @@ -40,6 +40,8 @@ namespace CalamityMod.Projectiles.Melee.Yoyos { if (Main.rand.NextBool(5)) Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 244, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); + if ((projectile.position - Main.player[projectile.owner].position).Length() > 3200f) //200 blocks + projectile.Kill(); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Melee/Yoyos/SulphurousGrabberYoyo.cs b/Projectiles/Melee/Yoyos/SulphurousGrabberYoyo.cs index 89b9d931b2..f4fa16f935 100644 --- a/Projectiles/Melee/Yoyos/SulphurousGrabberYoyo.cs +++ b/Projectiles/Melee/Yoyos/SulphurousGrabberYoyo.cs @@ -94,6 +94,9 @@ namespace CalamityMod.Projectiles.Melee.Yoyos bubbleCounter = 0; } } + + if ((projectile.position - Main.player[projectile.owner].position).Length() > 3200f) //200 blocks + projectile.Kill(); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Melee/Yoyos/VerdantYoyo.cs b/Projectiles/Melee/Yoyos/VerdantYoyo.cs index 53870e444c..ce7e308fc2 100644 --- a/Projectiles/Melee/Yoyos/VerdantYoyo.cs +++ b/Projectiles/Melee/Yoyos/VerdantYoyo.cs @@ -42,6 +42,9 @@ namespace CalamityMod.Projectiles.Melee.Yoyos Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 75, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 300f, 12f, 54f, 5, ProjectileID.CrystalLeafShot, 0.8); + + if ((projectile.position - Main.player[projectile.owner].position).Length() > 3200f) //200 blocks + projectile.Kill(); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Melee/Yoyos/YinYoyo.cs b/Projectiles/Melee/Yoyos/YinYoyo.cs index 17fa1407b8..24a6695aa1 100644 --- a/Projectiles/Melee/Yoyos/YinYoyo.cs +++ b/Projectiles/Melee/Yoyos/YinYoyo.cs @@ -31,6 +31,8 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void AI() { CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 300f, 10f, 144f, 5, Main.rand.NextBool(2) ? ModContent.ProjectileType() : ModContent.ProjectileType()); + if ((projectile.position - Main.player[projectile.owner].position).Length() > 3200f) //200 blocks + projectile.Kill(); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) From b47101444d1f5ab1e854f660fa9551ec9d6b7e85 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sun, 8 Nov 2020 12:40:20 -0500 Subject: [PATCH 27/46] removed this sentry restriction since it stops them from being placed where there are minecart tracks --- Items/Weapons/DraedonsArsenal/PulseTurretRemote.cs | 3 --- Items/Weapons/Summon/CadaverousCarrion.cs | 3 --- Items/Weapons/Summon/CausticCroakerStaff.cs | 6 +----- Items/Weapons/Summon/SpikecragStaff.cs | 3 --- 4 files changed, 1 insertion(+), 14 deletions(-) diff --git a/Items/Weapons/DraedonsArsenal/PulseTurretRemote.cs b/Items/Weapons/DraedonsArsenal/PulseTurretRemote.cs index 30f2314bba..2a17704d19 100644 --- a/Items/Weapons/DraedonsArsenal/PulseTurretRemote.cs +++ b/Items/Weapons/DraedonsArsenal/PulseTurretRemote.cs @@ -51,9 +51,6 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - Point mouseTileCoords = Main.MouseWorld.ToTileCoordinates(); - if (CalamityUtils.ParanoidTileRetrieval(mouseTileCoords.X, mouseTileCoords.Y).active()) - return false; CalamityUtils.OnlyOneSentry(player, type); Projectile.NewProjectile(Main.MouseWorld, Vector2.Zero, type, damage, knockBack, player.whoAmI); player.UpdateMaxTurrets(); diff --git a/Items/Weapons/Summon/CadaverousCarrion.cs b/Items/Weapons/Summon/CadaverousCarrion.cs index b29f6e838c..a5ae6496c7 100644 --- a/Items/Weapons/Summon/CadaverousCarrion.cs +++ b/Items/Weapons/Summon/CadaverousCarrion.cs @@ -35,9 +35,6 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - Point mouseTileCoords = Main.MouseWorld.ToTileCoordinates(); - if (CalamityUtils.ParanoidTileRetrieval(mouseTileCoords.X, mouseTileCoords.Y).active()) - return false; //CalamityUtils.OnlyOneSentry(player, type); Projectile.NewProjectile(Main.MouseWorld, Vector2.Zero, type, damage, knockBack, player.whoAmI); player.UpdateMaxTurrets(); diff --git a/Items/Weapons/Summon/CausticCroakerStaff.cs b/Items/Weapons/Summon/CausticCroakerStaff.cs index 2febdbe250..a9d596cb50 100644 --- a/Items/Weapons/Summon/CausticCroakerStaff.cs +++ b/Items/Weapons/Summon/CausticCroakerStaff.cs @@ -38,11 +38,7 @@ namespace CalamityMod.Items.Weapons.Summon { if (player.altFunctionUse != 2) { - position = Main.MouseWorld; - Point mouseTileCoords = position.ToTileCoordinates(); - if (WorldGen.SolidTile(mouseTileCoords.X, mouseTileCoords.Y + 1)) - return false; - Projectile.NewProjectile(position, Vector2.Zero, type, damage, knockBack, player.whoAmI); + Projectile.NewProjectile(Main.MouseWorld, Vector2.Zero, type, damage, knockBack, player.whoAmI); player.UpdateMaxTurrets(); } return false; diff --git a/Items/Weapons/Summon/SpikecragStaff.cs b/Items/Weapons/Summon/SpikecragStaff.cs index b57c013401..8c61e50f2d 100644 --- a/Items/Weapons/Summon/SpikecragStaff.cs +++ b/Items/Weapons/Summon/SpikecragStaff.cs @@ -36,9 +36,6 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - Point mouseTileCoords = Main.MouseWorld.ToTileCoordinates(); - if (CalamityUtils.ParanoidTileRetrieval(mouseTileCoords.X, mouseTileCoords.Y).active()) - return false; //CalamityUtils.OnlyOneSentry(player, type); Projectile.NewProjectile(Main.MouseWorld, Vector2.Zero, type, damage, knockBack, player.whoAmI, 120f, 0f); player.UpdateMaxTurrets(); From ec933252e9927df4c04e3edf59a0bac1d74ee868 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sun, 8 Nov 2020 13:26:54 -0500 Subject: [PATCH 28/46] cryophobia drawing fix --- Projectiles/Magic/CryoBlast.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Projectiles/Magic/CryoBlast.cs b/Projectiles/Magic/CryoBlast.cs index 1038d71148..897ddea774 100644 --- a/Projectiles/Magic/CryoBlast.cs +++ b/Projectiles/Magic/CryoBlast.cs @@ -73,7 +73,9 @@ namespace CalamityMod.Projectiles.Magic return false; Texture2D texture = Main.projectileTexture[projectile.type]; - Rectangle rectangle = new Rectangle(0, 0, texture.Width, texture.Height); + int frameHeight = texture.Height / Main.projFrames[projectile.type]; + int frameY = frameHeight * projectile.frame; + Rectangle rectangle = new Rectangle(0, frameY, texture.Width, texture.Height); Vector2 origin = rectangle.Size() / 2f; SpriteEffects spriteEffects = SpriteEffects.None; From 951551fd5adeaba4647160cbb5d6828571724737 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sun, 8 Nov 2020 18:35:12 -0500 Subject: [PATCH 29/46] A very agile yoyo --- Items/Weapons/Melee/Cnidarian.cs | 3 ++- Items/Weapons/Melee/Shimmerspark.cs | 3 ++- Items/Weapons/Melee/TheEyeofCalamitas.cs | 3 ++- Items/Weapons/Melee/TheGodsGambit.cs | 3 ++- Items/Weapons/Melee/ThePlaguebringer.cs | 3 ++- Items/Weapons/Melee/Whirlpool.cs | 3 ++- Items/Weapons/Melee/YinYo.cs | 3 ++- Projectiles/Melee/Yoyos/AirSpinnerYoyo.cs | 1 + Projectiles/Melee/Yoyos/AortaYoyo.cs | 1 + 9 files changed, 16 insertions(+), 7 deletions(-) diff --git a/Items/Weapons/Melee/Cnidarian.cs b/Items/Weapons/Melee/Cnidarian.cs index bb90e35869..771d859192 100644 --- a/Items/Weapons/Melee/Cnidarian.cs +++ b/Items/Weapons/Melee/Cnidarian.cs @@ -11,7 +11,8 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetStaticDefaults() { DisplayName.SetDefault("Cnidarian"); - Tooltip.SetDefault("Fires a seashell when enemies are near"); + Tooltip.SetDefault("Fires a seashell when enemies are near\n" + + "A very agile yoyo"); ItemID.Sets.Yoyo[item.type] = true; ItemID.Sets.GamepadExtraRange[item.type] = 15; ItemID.Sets.GamepadSmartQuickReach[item.type] = true; diff --git a/Items/Weapons/Melee/Shimmerspark.cs b/Items/Weapons/Melee/Shimmerspark.cs index 783b48dc67..f13f5eddf4 100644 --- a/Items/Weapons/Melee/Shimmerspark.cs +++ b/Items/Weapons/Melee/Shimmerspark.cs @@ -11,7 +11,8 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetStaticDefaults() { DisplayName.SetDefault("Shimmerspark"); - Tooltip.SetDefault("Fires stars when enemies are near"); + Tooltip.SetDefault("Fires stars when enemies are near\n" + + "A very agile yoyo"); ItemID.Sets.Yoyo[item.type] = true; ItemID.Sets.GamepadExtraRange[item.type] = 15; ItemID.Sets.GamepadSmartQuickReach[item.type] = true; diff --git a/Items/Weapons/Melee/TheEyeofCalamitas.cs b/Items/Weapons/Melee/TheEyeofCalamitas.cs index d03fbc0b6b..b5f8d290a3 100644 --- a/Items/Weapons/Melee/TheEyeofCalamitas.cs +++ b/Items/Weapons/Melee/TheEyeofCalamitas.cs @@ -10,7 +10,8 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetStaticDefaults() { DisplayName.SetDefault("Oblivion"); - Tooltip.SetDefault("Fires brimstone lasers when enemies are near"); + Tooltip.SetDefault("Fires brimstone lasers when enemies are near\n" + + "A very agile yoyo"); ItemID.Sets.Yoyo[item.type] = true; ItemID.Sets.GamepadExtraRange[item.type] = 15; ItemID.Sets.GamepadSmartQuickReach[item.type] = true; diff --git a/Items/Weapons/Melee/TheGodsGambit.cs b/Items/Weapons/Melee/TheGodsGambit.cs index f997cf0ed5..a681de041e 100644 --- a/Items/Weapons/Melee/TheGodsGambit.cs +++ b/Items/Weapons/Melee/TheGodsGambit.cs @@ -12,7 +12,8 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetStaticDefaults() { DisplayName.SetDefault("The God's Gambit"); - Tooltip.SetDefault("Fires a stream of slime when enemies are near"); + Tooltip.SetDefault("Fires a stream of slime when enemies are near\n" + + "A very agile yoyo"); ItemID.Sets.Yoyo[item.type] = true; ItemID.Sets.GamepadExtraRange[item.type] = 15; ItemID.Sets.GamepadSmartQuickReach[item.type] = true; diff --git a/Items/Weapons/Melee/ThePlaguebringer.cs b/Items/Weapons/Melee/ThePlaguebringer.cs index 8c6cd8417a..2ca8a33dab 100644 --- a/Items/Weapons/Melee/ThePlaguebringer.cs +++ b/Items/Weapons/Melee/ThePlaguebringer.cs @@ -10,7 +10,8 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetStaticDefaults() { DisplayName.SetDefault("Pandemic"); - Tooltip.SetDefault("Fires plague seekers when enemies are near"); + Tooltip.SetDefault("Fires plague seekers when enemies are near\n" + + "A very agile yoyo"); ItemID.Sets.Yoyo[item.type] = true; ItemID.Sets.GamepadExtraRange[item.type] = 15; ItemID.Sets.GamepadSmartQuickReach[item.type] = true; diff --git a/Items/Weapons/Melee/Whirlpool.cs b/Items/Weapons/Melee/Whirlpool.cs index 51685046a2..db28a5ce4a 100644 --- a/Items/Weapons/Melee/Whirlpool.cs +++ b/Items/Weapons/Melee/Whirlpool.cs @@ -11,7 +11,8 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetStaticDefaults() { DisplayName.SetDefault("Riptide"); - Tooltip.SetDefault("Sprays a spiral of aqua streams in random directions"); + Tooltip.SetDefault("Sprays a spiral of aqua streams in random directions\n" + + "A very agile yoyo"); ItemID.Sets.Yoyo[item.type] = true; ItemID.Sets.GamepadExtraRange[item.type] = 15; ItemID.Sets.GamepadSmartQuickReach[item.type] = true; diff --git a/Items/Weapons/Melee/YinYo.cs b/Items/Weapons/Melee/YinYo.cs index 86a339211a..5577de4a62 100644 --- a/Items/Weapons/Melee/YinYo.cs +++ b/Items/Weapons/Melee/YinYo.cs @@ -11,7 +11,8 @@ namespace CalamityMod.Items.Weapons.Melee { DisplayName.SetDefault("Yin-Yo"); Tooltip.SetDefault("Fires light or dark shards when enemies are near\n" + - "Shards fly back and forth"); + "Shards fly back and forth\n" + + "A very agile yoyo"); ItemID.Sets.Yoyo[item.type] = true; ItemID.Sets.GamepadExtraRange[item.type] = 15; ItemID.Sets.GamepadSmartQuickReach[item.type] = true; diff --git a/Projectiles/Melee/Yoyos/AirSpinnerYoyo.cs b/Projectiles/Melee/Yoyos/AirSpinnerYoyo.cs index 66bc2abd06..f4f9034860 100644 --- a/Projectiles/Melee/Yoyos/AirSpinnerYoyo.cs +++ b/Projectiles/Melee/Yoyos/AirSpinnerYoyo.cs @@ -1,5 +1,6 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Projectiles/Melee/Yoyos/AortaYoyo.cs b/Projectiles/Melee/Yoyos/AortaYoyo.cs index f2ee8c59b8..9dcdd303e6 100644 --- a/Projectiles/Melee/Yoyos/AortaYoyo.cs +++ b/Projectiles/Melee/Yoyos/AortaYoyo.cs @@ -1,5 +1,6 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using Terraria; using Terraria.ID; using Terraria.ModLoader; From 06044ee4d5e292682d7d82ba0206946449488dcc Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Sun, 8 Nov 2020 22:39:28 -0600 Subject: [PATCH 30/46] Fixed a out-of-world problem with Astral Monolith. --- World/WorldGenerationMethods.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/World/WorldGenerationMethods.cs b/World/WorldGenerationMethods.cs index 0ca63c0526..fab41425ba 100644 --- a/World/WorldGenerationMethods.cs +++ b/World/WorldGenerationMethods.cs @@ -635,6 +635,12 @@ namespace CalamityMod.World if (CanAstralBiomeSpawn()) { DoAstralConversion(new Point(i, j)); + + // Upward checks go up 180 tiles. If for whatever reason the placement Y position + // would cause this upward movement to go outside of the world, clamp it to prevent index problems. + if (j < 181) + j = 181; + int checkWidth = 180; float averageHeight = 0f; float lowestHeight = 0f; From 84bb50d21513e130e168942871d603cb94003487 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Mon, 9 Nov 2020 06:38:35 -0500 Subject: [PATCH 31/46] attempted regislash fix --- Projectiles/Summon/AndromedaRegislash.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Projectiles/Summon/AndromedaRegislash.cs b/Projectiles/Summon/AndromedaRegislash.cs index 574be30c67..ab3ec1904d 100644 --- a/Projectiles/Summon/AndromedaRegislash.cs +++ b/Projectiles/Summon/AndromedaRegislash.cs @@ -12,6 +12,8 @@ namespace CalamityMod.Projectiles.Summon { DisplayName.SetDefault("Regislash"); Main.projFrames[projectile.type] = 6; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; + ProjectileID.Sets.TrailingMode[projectile.type] = 2; } public override void SetDefaults() @@ -62,7 +64,7 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 2); + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type]); return false; } } From bbd84e6ba5d9628a8ab3ce20ce58512f6587a7c1 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 30 Oct 2020 21:34:21 -0400 Subject: [PATCH 32/46] colors of a few other items --- Items/CalamityGlobalItem.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 4ee8b61c1f..23355f42f1 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -1125,7 +1125,7 @@ namespace CalamityMod.Items break; case CalamityRarity.ItemSpecific: - // Uniquely colored developer weapons + // Uniquely colored developer items if (item.type == ModContent.ItemType()) tt2.overrideColor = new Color(Main.DiscoR, 100, 255); if (item.type == ModContent.ItemType()) @@ -1150,6 +1150,16 @@ namespace CalamityMod.Items tt2.overrideColor = new Color(129, 29, 149); if (item.type == ModContent.ItemType()) tt2.overrideColor = new Color(220, 20, 60); + if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) + tt2.overrideColor = new Color(227, 226, 180); + if (item.type == ModContent.ItemType()) + tt2.overrideColor = new Color(254, 253, 235); + if (item.type == ModContent.ItemType()) + tt2.overrideColor = new Color(207, 17, 117); + if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) + tt2.overrideColor = CalamityUtils.ColorSwap(new Color(154, 255, 151), new Color(228, 151, 255), 2f); + if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) + tt2.overrideColor = CalamityUtils.ColorSwap(new Color(255, 132, 22), new Color(221, 85, 7), 2f); if (item.type == ModContent.ItemType()) { if (Main.GlobalTime % 1f < 0.6f) From bc910b25ae334743eba156d2636f0bfce9106c32 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 30 Oct 2020 21:44:55 -0400 Subject: [PATCH 33/46] using directive --- Items/CalamityGlobalItem.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 23355f42f1..94bf74c881 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -2,6 +2,7 @@ using CalamityMod.Buffs.Potions; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.CalPlayer; using CalamityMod.Items.Accessories; +using CalamityMod.Items.Armor; using CalamityMod.Items.DifficultyItems; using CalamityMod.Items.Materials; using CalamityMod.Items.PermanentBoosters; From 2b882bb2e7d044e695998e1e34e1440433edd99e Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 30 Oct 2020 21:58:37 -0400 Subject: [PATCH 34/46] Declared the rarity to be item specific --- Items/Armor/DemonshadeBreastplate.cs | 2 +- Items/Armor/DemonshadeGreaves.cs | 2 +- Items/Armor/DemonshadeHelm.cs | 2 +- Items/Weapons/Melee/RoyalKnivesMelee.cs | 2 +- .../Melee/TriactisTruePaladinianMageHammerofMightMelee.cs | 2 +- Items/Weapons/Ranged/Contagion.cs | 2 +- Items/Weapons/Ranged/SomaPrime.cs | 2 +- Items/Weapons/Rogue/RoyalKnives.cs | 2 +- Items/Weapons/Rogue/TriactisTruePaladinianMageHammerofMight.cs | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Items/Armor/DemonshadeBreastplate.cs b/Items/Armor/DemonshadeBreastplate.cs index 1614e94852..f61bea8cd9 100644 --- a/Items/Armor/DemonshadeBreastplate.cs +++ b/Items/Armor/DemonshadeBreastplate.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Armor item.height = 18; item.value = Item.buyPrice(4, 0, 0, 0); item.defense = 50; - item.Calamity().customRarity = CalamityRarity.Developer; + item.Calamity().customRarity = CalamityRarity.ItemSpecific; } public override void UpdateEquip(Player player) diff --git a/Items/Armor/DemonshadeGreaves.cs b/Items/Armor/DemonshadeGreaves.cs index 246b10d6b0..4149f9ef56 100644 --- a/Items/Armor/DemonshadeGreaves.cs +++ b/Items/Armor/DemonshadeGreaves.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Armor item.height = 18; item.value = Item.buyPrice(3, 0, 0, 0); item.defense = 50; //15 - item.Calamity().customRarity = CalamityRarity.Developer; + item.Calamity().customRarity = CalamityRarity.ItemSpecific; } public override void UpdateEquip(Player player) diff --git a/Items/Armor/DemonshadeHelm.cs b/Items/Armor/DemonshadeHelm.cs index 3b0de642b0..77c94edcfd 100644 --- a/Items/Armor/DemonshadeHelm.cs +++ b/Items/Armor/DemonshadeHelm.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Armor item.height = 18; item.value = Item.buyPrice(5, 0, 0, 0); item.defense = 50; //15 - item.Calamity().customRarity = CalamityRarity.Developer; + item.Calamity().customRarity = CalamityRarity.ItemSpecific; } public override bool IsArmorSet(Item head, Item body, Item legs) diff --git a/Items/Weapons/Melee/RoyalKnivesMelee.cs b/Items/Weapons/Melee/RoyalKnivesMelee.cs index fc6cabc9ce..a54dc4ae65 100644 --- a/Items/Weapons/Melee/RoyalKnivesMelee.cs +++ b/Items/Weapons/Melee/RoyalKnivesMelee.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Melee item.rare = 10; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 9f; - item.Calamity().customRarity = CalamityRarity.Developer; + item.Calamity().customRarity = CalamityRarity.ItemSpecific; } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) diff --git a/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMightMelee.cs b/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMightMelee.cs index 1cb1f1e4bd..ce64456628 100644 --- a/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMightMelee.cs +++ b/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMightMelee.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Melee item.rare = 10; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 25f; - item.Calamity().customRarity = CalamityRarity.Developer; + item.Calamity().customRarity = CalamityRarity.ItemSpecific; } public override void AddRecipes() diff --git a/Items/Weapons/Ranged/Contagion.cs b/Items/Weapons/Ranged/Contagion.cs index dab83756fe..d45276c2ed 100644 --- a/Items/Weapons/Ranged/Contagion.cs +++ b/Items/Weapons/Ranged/Contagion.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.shoot = ModContent.ProjectileType(); item.shootSpeed = 20f; item.useAmmo = AmmoID.Arrow; - item.Calamity().customRarity = CalamityRarity.Developer; + item.Calamity().customRarity = CalamityRarity.ItemSpecific; } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; diff --git a/Items/Weapons/Ranged/SomaPrime.cs b/Items/Weapons/Ranged/SomaPrime.cs index 2d30871104..23fc80a795 100644 --- a/Items/Weapons/Ranged/SomaPrime.cs +++ b/Items/Weapons/Ranged/SomaPrime.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.shoot = ModContent.ProjectileType(); item.shootSpeed = 30f; item.useAmmo = AmmoID.Bullet; - item.Calamity().customRarity = CalamityRarity.Developer; + item.Calamity().customRarity = CalamityRarity.ItemSpecific; } public override Vector2? HoldoutOffset() diff --git a/Items/Weapons/Rogue/RoyalKnives.cs b/Items/Weapons/Rogue/RoyalKnives.cs index 03098ed750..abd66c9e20 100644 --- a/Items/Weapons/Rogue/RoyalKnives.cs +++ b/Items/Weapons/Rogue/RoyalKnives.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.shoot = ModContent.ProjectileType(); item.shootSpeed = 9f; item.Calamity().rogue = true; - item.Calamity().customRarity = CalamityRarity.Developer; + item.Calamity().customRarity = CalamityRarity.ItemSpecific; } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) diff --git a/Items/Weapons/Rogue/TriactisTruePaladinianMageHammerofMight.cs b/Items/Weapons/Rogue/TriactisTruePaladinianMageHammerofMight.cs index a55ae882c3..a7f0f096fc 100644 --- a/Items/Weapons/Rogue/TriactisTruePaladinianMageHammerofMight.cs +++ b/Items/Weapons/Rogue/TriactisTruePaladinianMageHammerofMight.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.shoot = ModContent.ProjectileType(); item.shootSpeed = 25f; item.Calamity().rogue = true; - item.Calamity().customRarity = CalamityRarity.Developer; + item.Calamity().customRarity = CalamityRarity.ItemSpecific; } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) From 9f353f1d7610477ab7513e37904ec2e210707938 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 30 Oct 2020 22:12:44 -0400 Subject: [PATCH 35/46] increased the time interval for the colors on many of the weapons --- Items/CalamityGlobalItem.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 94bf74c881..57ef74e4c1 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -1138,13 +1138,13 @@ namespace CalamityMod.Items if (item.type == ModContent.ItemType()) tt2.overrideColor = CalamityUtils.ColorSwap(new Color(255, 166, 0), new Color(25, 250, 25), 4f); //alternates between emerald green and amber (BanditHueh) if (item.type == ModContent.ItemType()) - tt2.overrideColor = CalamityUtils.ColorSwap(new Color(210, 0, 255), new Color(255, 248, 24), 2f); + tt2.overrideColor = CalamityUtils.ColorSwap(new Color(210, 0, 255), new Color(255, 248, 24), 4f); if (item.type == ModContent.ItemType()) - tt2.overrideColor = CalamityUtils.ColorSwap(new Color(131, 239, 255), new Color(36, 55, 230), 2f); + tt2.overrideColor = CalamityUtils.ColorSwap(new Color(131, 239, 255), new Color(36, 55, 230), 4f); if (item.type == ModContent.ItemType()) - tt2.overrideColor = CalamityUtils.ColorSwap(new Color(255, 69, 0), new Color(139, 0, 0), 2f); + tt2.overrideColor = CalamityUtils.ColorSwap(new Color(255, 69, 0), new Color(139, 0, 0), 4f); if (item.type == ModContent.ItemType()) - tt2.overrideColor = CalamityUtils.ColorSwap(new Color(191, 45, 71), new Color(185, 187, 253), 2f); + tt2.overrideColor = CalamityUtils.ColorSwap(new Color(191, 45, 71), new Color(185, 187, 253), 4f); if (item.type == ModContent.ItemType()) tt2.overrideColor = new Color(146, 0, 0); if (item.type == ModContent.ItemType()) @@ -1158,9 +1158,9 @@ namespace CalamityMod.Items if (item.type == ModContent.ItemType()) tt2.overrideColor = new Color(207, 17, 117); if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) - tt2.overrideColor = CalamityUtils.ColorSwap(new Color(154, 255, 151), new Color(228, 151, 255), 2f); + tt2.overrideColor = CalamityUtils.ColorSwap(new Color(154, 255, 151), new Color(228, 151, 255), 4f); if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) - tt2.overrideColor = CalamityUtils.ColorSwap(new Color(255, 132, 22), new Color(221, 85, 7), 2f); + tt2.overrideColor = CalamityUtils.ColorSwap(new Color(255, 132, 22), new Color(221, 85, 7), 4f); if (item.type == ModContent.ItemType()) { if (Main.GlobalTime % 1f < 0.6f) From 2ff21451af4b850a87deff507e06f23e73349f28 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 30 Oct 2020 23:02:00 -0400 Subject: [PATCH 36/46] Earth custom rarity --- Items/CalamityGlobalItem.cs | 18 +++++++++++++++++- Items/Weapons/Melee/Earth.cs | 2 +- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 57ef74e4c1..31a1993ea9 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -1158,7 +1158,7 @@ namespace CalamityMod.Items if (item.type == ModContent.ItemType()) tt2.overrideColor = new Color(207, 17, 117); if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) - tt2.overrideColor = CalamityUtils.ColorSwap(new Color(154, 255, 151), new Color(228, 151, 255), 4f); + tt2.overrideColor = CalamityUtils.ColorSwap(new Color(154, 255, 151), new Color(228, 151, 255), 4f); if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) tt2.overrideColor = CalamityUtils.ColorSwap(new Color(255, 132, 22), new Color(221, 85, 7), 4f); if (item.type == ModContent.ItemType()) @@ -1176,6 +1176,22 @@ namespace CalamityMod.Items tt2.overrideColor = Color.Lerp(Color.White, new Color(89, 229, 255), (Main.GlobalTime % 1f - 0.8f) / 0.2f); } } + if (item.type == ModContent.ItemType()) + { + List earthColors = new List() + { + new Color(255, 93, 143), + new Color(178, 247, 239), + new Color(171, 196, 255) + }; + if (tt2 != null) + { + int colorIndex = (int)(Main.GlobalTime / 2 % earthColors.Count); + Color currentColor = earthColors[colorIndex]; + Color nextColor = earthColors[(colorIndex + 1) % earthColors.Count]; + tt2.overrideColor = Color.Lerp(currentColor, nextColor, Main.GlobalTime % 2f > 1f ? 1f : Main.GlobalTime % 1f); + } + } // Uniquely colored legendary weapons and Yharim's Crystal if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) diff --git a/Items/Weapons/Melee/Earth.cs b/Items/Weapons/Melee/Earth.cs index 0d399602c1..ead74ee388 100644 --- a/Items/Weapons/Melee/Earth.cs +++ b/Items/Weapons/Melee/Earth.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Items.Weapons.Melee item.autoReuse = true; item.value = Item.buyPrice(5, 0, 0, 0); item.rare = 10; - item.Calamity().customRarity = CalamityRarity.Developer; + item.Calamity().customRarity = CalamityRarity.ItemSpecific; } public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) From 6d06497510bd877eb52c6e811a15c7168c459512 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Fri, 30 Oct 2020 23:53:23 -0400 Subject: [PATCH 37/46] adjusted Earth's colors --- Items/CalamityGlobalItem.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 31a1993ea9..3ef2b9bf79 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -1180,9 +1180,9 @@ namespace CalamityMod.Items { List earthColors = new List() { - new Color(255, 93, 143), - new Color(178, 247, 239), - new Color(171, 196, 255) + new Color(255, 99, 146), + new Color(255, 228, 94), + new Color(127, 200, 248) }; if (tt2 != null) { From b597126cd9238c03ebb06479075f8d2d81a59443 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sat, 31 Oct 2020 08:46:24 -0400 Subject: [PATCH 38/46] Red Sun --- Items/CalamityGlobalItem.cs | 8 +++++--- Items/Weapons/Melee/RedSun.cs | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 3ef2b9bf79..b74c19de94 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -1145,20 +1145,22 @@ namespace CalamityMod.Items tt2.overrideColor = CalamityUtils.ColorSwap(new Color(255, 69, 0), new Color(139, 0, 0), 4f); if (item.type == ModContent.ItemType()) tt2.overrideColor = CalamityUtils.ColorSwap(new Color(191, 45, 71), new Color(185, 187, 253), 4f); + if (item.type == ModContent.ItemType()) + tt2.overrideColor = CalamityUtils.ColorSwap(new Color(204, 86, 80), new Color(237, 69, 141), 4f); if (item.type == ModContent.ItemType()) tt2.overrideColor = new Color(146, 0, 0); if (item.type == ModContent.ItemType()) tt2.overrideColor = new Color(129, 29, 149); if (item.type == ModContent.ItemType()) tt2.overrideColor = new Color(220, 20, 60); - if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) - tt2.overrideColor = new Color(227, 226, 180); if (item.type == ModContent.ItemType()) tt2.overrideColor = new Color(254, 253, 235); if (item.type == ModContent.ItemType()) tt2.overrideColor = new Color(207, 17, 117); + if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) + tt2.overrideColor = new Color(227, 226, 180); if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) - tt2.overrideColor = CalamityUtils.ColorSwap(new Color(154, 255, 151), new Color(228, 151, 255), 4f); + tt2.overrideColor = CalamityUtils.ColorSwap(new Color(154, 255, 151), new Color(228, 151, 255), 4f); if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) tt2.overrideColor = CalamityUtils.ColorSwap(new Color(255, 132, 22), new Color(221, 85, 7), 4f); if (item.type == ModContent.ItemType()) diff --git a/Items/Weapons/Melee/RedSun.cs b/Items/Weapons/Melee/RedSun.cs index b82929fc9e..75580890fc 100644 --- a/Items/Weapons/Melee/RedSun.cs +++ b/Items/Weapons/Melee/RedSun.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Items.Weapons.Melee item.rare = 10; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 15f; - item.Calamity().customRarity = CalamityRarity.Developer; + item.Calamity().customRarity = CalamityRarity.ItemSpecific; } public override void AddRecipes() From 4286cc3b277180497cec981d67f48b75b8913592 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 7 Oct 2020 22:23:18 -0500 Subject: [PATCH 39/46] Placeable rock. --- Items/Rock.cs | 9 +++++++++ Tiles/PlacedRock.cs | 40 ++++++++++++++++++++++++++++++++++++++++ Tiles/PlacedRock.png | Bin 0 -> 213 bytes 3 files changed, 49 insertions(+) create mode 100644 Tiles/PlacedRock.cs create mode 100644 Tiles/PlacedRock.png diff --git a/Items/Rock.cs b/Items/Rock.cs index 49c2aa5bf0..15d49b2633 100644 --- a/Items/Rock.cs +++ b/Items/Rock.cs @@ -1,4 +1,6 @@ +using CalamityMod.Tiles; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items @@ -16,6 +18,13 @@ namespace CalamityMod.Items item.width = 20; item.height = 20; item.value = Item.buyPrice(0, 0, 0, 1); + item.createTile = ModContent.TileType(); + item.useStyle = ItemUseStyleID.SwingThrow; + item.useTurn = true; + item.useAnimation = 15; + item.useTime = 10; + item.autoReuse = true; + item.consumable = true; } } } diff --git a/Tiles/PlacedRock.cs b/Tiles/PlacedRock.cs new file mode 100644 index 0000000000..742922575a --- /dev/null +++ b/Tiles/PlacedRock.cs @@ -0,0 +1,40 @@ +using CalamityMod.Items; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles +{ + public class PlacedRock : ModTile + { + public override void SetDefaults() + { + Main.tileFrameImportant[Type] = true; + + TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1); + TileObjectData.newTile.StyleHorizontal = true; + TileObjectData.newTile.LavaDeath = false; + TileObjectData.newTile.DrawYOffset = 2; + TileObjectData.addTile(Type); + + dustType = DustID.Stone; + drop = ModContent.ItemType(); + + AddMapEntry(new Color(83, 91, 102)); + } + + public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) + { + WorldGen.Check1x1(i, j, Type); + return true; + } + + public override void PlaceInWorld(int i, int j, Item item) + { + Main.tile[i, j].frameX = 0; + Main.tile[i, j].frameY = 0; + } + } +} diff --git a/Tiles/PlacedRock.png b/Tiles/PlacedRock.png new file mode 100644 index 0000000000000000000000000000000000000000..26f0ed28a15f9d79aab2d16ea8e345e63917db44 GIT binary patch literal 213 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NS%G|s0G|+7AT23kJab-KaY2%^gTIlvZE$oNQ1FY$RBIr`Q4-`A{2u}s?ltd? z1d4GMctjR6Fz_7)VaDV6D^h@hMxHK?AsWF)PZ%;W2=E*YxETMgJ~>qS?q1!@&!37X uY&y+oJ7exoz6p2S4JI#;o4q{!08^kSYwGv?fpdYn89ZJ6T-G@yGywqGr9vM7 literal 0 HcmV?d00001 From 75416a692f27cf16fdd3c4c9e022ff94fc864524 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 7 Oct 2020 22:27:21 -0500 Subject: [PATCH 40/46] Adrenaline persists during BR now. --- CalPlayer/CalamityPlayerMiscEffects.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 9f3f598f6f..f185ba7328 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -289,9 +289,10 @@ namespace CalamityMod.CalPlayer else { - // If any boss is alive (or you are between DoG phases), you gain adrenaline smoothly. + // If any boss is alive (or you are between DoG phases or Boss Rush is active), you gain adrenaline smoothly. // EXCEPTION: Wall of Flesh is alive and you are not in hell. Then you don't get anything. - if ((CalamityPlayer.areThereAnyDamnBosses || CalamityWorld.DoGSecondStageCountdown > 0) && !wofAndNotHell) + if ((CalamityPlayer.areThereAnyDamnBosses || CalamityWorld.DoGSecondStageCountdown > 0 || BossRushEvent.BossRushActive) && + !wofAndNotHell) { int numAdrenBoosts = (modPlayer.adrenalineBoostOne ? 1 : 0) + From f29718f1f7d9002d5f3969e5b174bc92271f44be Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 7 Oct 2020 22:39:09 -0500 Subject: [PATCH 41/46] Boss fight slime rain spawn prevention --- ILEditing/ILChanges.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ILEditing/ILChanges.cs b/ILEditing/ILChanges.cs index 4147572b5e..0b8fcb0aec 100644 --- a/ILEditing/ILChanges.cs +++ b/ILEditing/ILChanges.cs @@ -68,10 +68,17 @@ namespace CalamityMod.ILEditing private static void LabDoorFixes() { + On.Terraria.NPC.SlimeRainSpawns += PreventBossSlimeRainSpawns; On.Terraria.Player.TileInteractionsUse += Player_TileInteractionsUse; On.Terraria.WorldGen.OpenDoor += LabDoorsOpen; On.Terraria.WorldGen.CloseDoor += LabDoorsClose; } + + private static void PreventBossSlimeRainSpawns(On.Terraria.NPC.orig_SlimeRainSpawns orig, int plr) + { + if (!Main.player[plr].Calamity().bossZen) + orig(plr); + } #endregion #region IL Editing Injection Functions From 5e80dd00e8c12af3e7a1106b75d01af13fd17109 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 7 Oct 2020 22:47:27 -0500 Subject: [PATCH 42/46] Moved the IL Edit to the correct method --- ILEditing/ILChanges.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ILEditing/ILChanges.cs b/ILEditing/ILChanges.cs index 0b8fcb0aec..a80c62f190 100644 --- a/ILEditing/ILChanges.cs +++ b/ILEditing/ILChanges.cs @@ -27,6 +27,7 @@ namespace CalamityMod.ILEditing /// public static void Initialize() { + On.Terraria.NPC.SlimeRainSpawns += PreventBossSlimeRainSpawns; ApplyLifeBytesChanges(); SlideDungeonOver(); LabDoorFixes(); @@ -68,7 +69,6 @@ namespace CalamityMod.ILEditing private static void LabDoorFixes() { - On.Terraria.NPC.SlimeRainSpawns += PreventBossSlimeRainSpawns; On.Terraria.Player.TileInteractionsUse += Player_TileInteractionsUse; On.Terraria.WorldGen.OpenDoor += LabDoorsOpen; On.Terraria.WorldGen.CloseDoor += LabDoorsClose; From b8a11d850dcf3618dc3800a37db1ba770f96b58c Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Thu, 8 Oct 2020 16:47:40 -0500 Subject: [PATCH 43/46] Town NPC spawn manipulation changes --- CalamityConfig.cs | 18 ++++++++++++++++++ ILEditing/ILChanges.cs | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) diff --git a/CalamityConfig.cs b/CalamityConfig.cs index 86eda6b763..02f132d1c7 100644 --- a/CalamityConfig.cs +++ b/CalamityConfig.cs @@ -128,6 +128,24 @@ namespace CalamityMod [Tooltip("Sets Reactive Boss DR to always be full strength, even if the boss has already been defeated.\nIf disabled, the effect is only 66% as powerful after the boss has been defeated.\n\nReactive Boss DR makes bosses smoothly take less damage if they are being killed very quickly.\nIn most cases, the system has no noticeable effect.")] public bool FullPowerReactiveBossDR { get; set; } + [Label("Let Town NPCs spawn at night.")] + [BackgroundColor(192, 54, 64, 192)] + [DefaultValue(false)] + [Tooltip("Allows you to determine if town NPCs (including the Old Man) can spawn at night.")] + public bool CanTownNPCsSpawnAtNight { get; set; } + + private const int MinTownNPCSpawnMultiplier = 1; + private const int MaxTownNPCSpawnMultiplier = 10; + + [Label("Town NPC Spawn Rate Multiplier")] + [BackgroundColor(192, 54, 64, 192)] + [Range(MinTownNPCSpawnMultiplier, MaxTownNPCSpawnMultiplier)] + [Increment(1)] + [DrawTicks] + [DefaultValue(MinTownNPCSpawnMultiplier)] + [Tooltip("Makes town NPCs spawn more quickly, the higher this value is.")] + public int TownNPCSpawnRateMultiplier { get; set; } + private const float MinBossHealthBoost = 0f; private const float MaxBossHealthBoost = 900f; diff --git a/ILEditing/ILChanges.cs b/ILEditing/ILChanges.cs index a80c62f190..b4056fd154 100644 --- a/ILEditing/ILChanges.cs +++ b/ILEditing/ILChanges.cs @@ -3,6 +3,7 @@ using Mono.Cecil.Cil; using MonoMod.Cil; using System; using System.Collections.Generic; +using System.Reflection; using Terraria; using Terraria.GameInput; using Terraria.ID; @@ -27,9 +28,13 @@ namespace CalamityMod.ILEditing /// public static void Initialize() { + var spawnTownNPCMethod = typeof(Main).GetMethod("UpdateTime_SpawnTownNPCs", BindingFlags.Static | BindingFlags.NonPublic); + cachedUpdateTime_SpawnTownNPCs = Delegate.CreateDelegate(typeof(Action), spawnTownNPCMethod) as Action; + On.Terraria.NPC.SlimeRainSpawns += PreventBossSlimeRainSpawns; ApplyLifeBytesChanges(); SlideDungeonOver(); + AlterTownNPCSpawnRate(); LabDoorFixes(); PreventStupidTreesNearOcean(); } @@ -79,6 +84,42 @@ namespace CalamityMod.ILEditing if (!Main.player[plr].Calamity().bossZen) orig(plr); } + + private static Action cachedUpdateTime_SpawnTownNPCs; + + private static void AlterTownNPCSpawnRate() + { + IL.Terraria.Main.UpdateTime += (il) => + { + // Don't do town NPC spawning at the end (after a !Main.dayTime return). + // Do it at the beginning in spite of time. + + var cursor = new ILCursor(il); + cursor.EmitDelegate(() => + { + // A cached delegate is used here instead of direct reflection for performance reasons + // since UpdateTime is called every frame. + if (Main.dayTime || CalamityConfig.Instance.CanTownNPCsSpawnAtNight) + cachedUpdateTime_SpawnTownNPCs(); + }); + + if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchCallOrCallvirt
("UpdateTime_SpawnTownNPCs"))) + { + CalamityMod.Instance.Logger.Warn("Town NPC spawn editing code failed."); + return; + } + + cursor.Emit(OpCodes.Ret); + }; + + On.Terraria.Main.UpdateTime_SpawnTownNPCs += (orig) => + { + int oldWorldRate = Main.worldRate; + Main.worldRate *= CalamityConfig.Instance.TownNPCSpawnRateMultiplier; + orig(); + Main.worldRate = oldWorldRate; + }; + } #endregion #region IL Editing Injection Functions From 6806693b105761198515bd0eb9f5318ff4bf4030 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sun, 11 Oct 2020 02:56:50 -0500 Subject: [PATCH 44/46] Mode Indicator UI --- CalamityMod.cs | 7 ++++ ExtraTextures/UI/ModeIndicatorArea.png | Bin 0 -> 1124 bytes ExtraTextures/UI/ModeIndicatorArma.png | Bin 0 -> 527 bytes ExtraTextures/UI/ModeIndicatorDeath.png | Bin 0 -> 539 bytes ExtraTextures/UI/ModeIndicatorRev.png | Bin 0 -> 523 bytes ExtraTextures/UI/ModeIndicatorRune.png | Bin 0 -> 567 bytes UI/ModeIndicatorUI.cs | 47 ++++++++++++++++++++++++ 7 files changed, 54 insertions(+) create mode 100644 ExtraTextures/UI/ModeIndicatorArea.png create mode 100644 ExtraTextures/UI/ModeIndicatorArma.png create mode 100644 ExtraTextures/UI/ModeIndicatorDeath.png create mode 100644 ExtraTextures/UI/ModeIndicatorRev.png create mode 100644 ExtraTextures/UI/ModeIndicatorRune.png create mode 100644 UI/ModeIndicatorUI.cs diff --git a/CalamityMod.cs b/CalamityMod.cs index 464591ab3f..aad3d5b450 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -815,6 +815,13 @@ namespace CalamityMod return true; }, InterfaceScaleType.None)); + // Mode Indicator UI. + layers.Insert(mouseIndex, new LegacyGameInterfaceLayer("Mode Indicator UI", delegate () + { + ModeIndicatorUI.Draw(Main.spriteBatch); + return true; + }, InterfaceScaleType.UI)); + // Astral Arcanum overlay (if open) layers.Insert(mouseIndex, new LegacyGameInterfaceLayer("Astral Arcanum UI", delegate () { diff --git a/ExtraTextures/UI/ModeIndicatorArea.png b/ExtraTextures/UI/ModeIndicatorArea.png new file mode 100644 index 0000000000000000000000000000000000000000..701089c3ccdaa9e9c2109e739c44bc0a64782550 GIT binary patch literal 1124 zcmV-q1e^PbP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D1NlirK~#8N?VC+& z6hRP%cl`l=BxLm5B?E8SD?vUxXU zRnM0P>w%$XCo?^hs%Ls;YIcW{$z<>^xH?)scgJ7HM?;zIl?&4T_w;528?f>8iOij4 zcl(9RRrF;@7$J0Kgx7%4Xfe0r@%P*UHUo5JNEjisW`t$H>B*1WUb=EQx8URZ!`$Aw zvyxk&t>4uc5=ID(jerUF*4FZ8Ml%4cKYp0oy`5LN1)3qu+x>l+tEg*87$LZg(C!4; z1g`-WUPF$*9p`poX(6|D4GALz)d)6#GtZd-SPm=$R#%pDdvJJ^TMafu+b=Ko8WKhb zQzPmc@QKEN&1ai3SAjc5+(80l_@|uf7iDZ=gS73po^Q!q#Z4MRN(~7kgyCrEMm7Nk zXpsbL05S=%-R--pxdm*1g=WZycL%xUv55O+Lo{GW7$HoJxOTl7y>Y$9b(#&(&P8C2 zA#9L_mEqF;Vtd@@;Qr>z=jv(|MhJ680Axfv*El0U%Z%3qMmrAg{(*KJVFY0YB1Jw; z>D-!qj!2PDQ_9%vWMQpW+7Bii55V!__$|T+!5ky_oWgQ|zhgO{%Y1HH+XHXE8rpI5 z@)#qC+JQ)s<>-3Ac9>G8(!|TXlx~OpF=2$zI1n7+^o+sJ840Y%>vJZx^#J#;t*3$g zrLh6yLn4e2=B^qXT|V#l@Auaq$Xo^24S-gEus&-QE`BriX79DkRcOb}%j2p+6yHa1 zHJRCXR2kx}L3#}UsB!MTJZk{M)$=gIiD?9n0oFTAE5lraD zunYi*w6@$^rPgYkR{xqIQIBxqHUfB``Z!|@`o&!$s?%-v55fp1(?FyM&rTL8va^$h zwO%p-HvA23`?d%pgtlZ&T z#A^We7r*;#nc7A$mLY(jI&nY1caYjsWLpL>VT90{5scRmejCnoWdIXK2%QFs6 literal 0 HcmV?d00001 diff --git a/ExtraTextures/UI/ModeIndicatorArma.png b/ExtraTextures/UI/ModeIndicatorArma.png new file mode 100644 index 0000000000000000000000000000000000000000..d5e6ea594e2e8d084fc20206a7b516cd03f3080b GIT binary patch literal 527 zcmV+q0`UEbP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!T}$*G`xo>tW@%z2fXQ1AnBSs* zF-wcLP0VR`4@1t=*BGbhUrboeYd&fz(Z6^*w}v4b2Ns6N`&GDBJaBg!Z*0P(;XQ+$ z{$BI$6ts3=@*cc|UB5eh6%&?s+8ubyID|>TD#GQr6F5Gx3n#q^m|Pe~u+Q&$EM RA}s&_002ovPDHLkV1lY2=AZxo literal 0 HcmV?d00001 diff --git a/ExtraTextures/UI/ModeIndicatorDeath.png b/ExtraTextures/UI/ModeIndicatorDeath.png new file mode 100644 index 0000000000000000000000000000000000000000..5cb843a4e080579f791d11c58eb2009b32de7d4c GIT binary patch literal 539 zcmV+$0_6RPP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGizyJUazyWI3i3tDz0kBC#K~z{r)t5U@ z!cZ87!Aqh8UNEhbTq7nXUT`ta1~-hm8-G9(2Ny>d2NV4RZ0<%jiL-GLbubYFh)zPp z3xgzTFnxR8p(ix0i#tk>{7KTgZDl8v&s(^QiBasP%KNQPwBoTw{J~uo%0$*QT!o<78x)ws>>0}ab@E4MbNcJHrKyumuoUXTEG9=EA zib@bx@U~EZ)k#d)Lz&Hi0K6Rdg3p@$@Ik8y%Ww@4^%Jv~q`0&rW>ymCyJBX--gjSO z!sP7f##I(RoX^1QxxC7|H!;~?HGBDVx(83JY{Oe8oqONCiRJ58#_oDnF0tz`Hj)~{ zNM;OU^%{e(dE71P^my&D4wLL)FD&m)c5rvfeEz`XIHbYqtZKsKjd}w<>a*U7N2D3A+l&I3<)(H?fRd0pgTU d#-qeO-!DxV+$_Wl%tQbH002ovPDHLkV1l_K>=6I} literal 0 HcmV?d00001 diff --git a/ExtraTextures/UI/ModeIndicatorRev.png b/ExtraTextures/UI/ModeIndicatorRev.png new file mode 100644 index 0000000000000000000000000000000000000000..b1209d63f86704c7646f18937a37b308593b99cd GIT binary patch literal 523 zcmV+m0`&cfP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!2kdb!2!6DYwZ940ia1lK~z{r)t606 z0zn+cwHL61y%@XQbXUnBsIW_P4v#|jZheA2K*v5npP*a!z@v1IE=e7N4BhOOlD&9H zsMwfi=Ye);8NIaQ59Ar0S=`@$#+fzg`+i~+TzCD?3q0>8DVswvA@kqS8moroN?EqT z)T%Yv3eZ)+9OEd%PUjhE+l$CTK8I|!+DNruSAqD99cL|MxUsc~e0zCCF0T}jRS zd}y?gPBD*+8aKBvkG#ITLX!B5Z7U1o)lvx`@D7P5&E91N4pM2P%JHC&oR!zRvJ!+9 zysg)f<`@&sAq{uZpGY0&{b?jCz%@Y3H?CSKBx!6P%2t@-#gS|URJsG?_!)DKIcK_6 zt&TU&c;qh@CbSW#?}uf4RyE_FR>$WR}u)*-?r@Mcpc`<@$O?6Nls=a zkvyGfNqg?$wB+fu|M86^XITqr&dx<>-s|>|r&HniqA7p7QK#45S5TRZl|j;!#AmEN zWiHvdp(?;ril>s!@Tt=_)UDmp_IbB$Hh3J{&4N=(Ly#1FHa-=$`i(mwzI N002ovPDHLkV1l!9>_`9r literal 0 HcmV?d00001 diff --git a/ExtraTextures/UI/ModeIndicatorRune.png b/ExtraTextures/UI/ModeIndicatorRune.png new file mode 100644 index 0000000000000000000000000000000000000000..51a2ed08d5258278e95aeed20db9b06ee537d0b6 GIT binary patch literal 567 zcmV-70?7S|P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGizyJUazyWI3i3tDz0nAB6K~z{r)t668 z0zn*x#}qmU{zXGbU6l$13+oVci|`Wk1?uL#@6ZS6*4;|bxbA`_7@U~^1>t`;1dE>n2kgQz<$9=d6gei0*|;p zAu0h-!AiMIX&+;NHPl1TSO)h1u)i_Pz|DPz^8EOj^5~3@_qO;Lpc3x|{6%%yPLR0Xgb zVYf0e{Af3A@|0=xPeQK(GDe0n_BED~D*%iPWh^pg><1MF(bE%>enbEO002ovPDHLk FV1m3{0lfeK literal 0 HcmV?d00001 diff --git a/UI/ModeIndicatorUI.cs b/UI/ModeIndicatorUI.cs new file mode 100644 index 0000000000..23e7a31a24 --- /dev/null +++ b/UI/ModeIndicatorUI.cs @@ -0,0 +1,47 @@ +using CalamityMod.World; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.UI +{ + public class ModeIndicatorUI + { + public static readonly Vector2 OffsetToAreaCenter = new Vector2(0f, 4f); + public static Vector2 DifficultyIconOffset => new Vector2(0f, -16f); + public static Vector2 ArmageddonIconOffset => new Vector2(12f, 7f); + public static Vector2 DefiledRuneIconOffset => new Vector2(-12f, 7); + public static void Draw(SpriteBatch spriteBatch) + { + // The mode indicator should only be displayed when the inventory is open, to prevent obstruction. + if (!Main.playerInventory) + return; + + Texture2D outerAreaTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/ModeIndicatorArea"); + Texture2D revengeanceIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/ModeIndicatorRev"); + Texture2D deathIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/ModeIndicatorDeath"); + Texture2D armageddonIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/ModeIndicatorArma"); + + // CONSIDER: The defiled rune is scheduled to be removed. Possibly change the 3rd slot to occupy death instead of the + // death icon completely overtaking revengeance? + Texture2D defiledRuneIconTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/UI/ModeIndicatorRune"); + + Vector2 drawCenter = new Vector2(Main.screenWidth - 400f, 72f) + outerAreaTexture.Size() * 0.5f; + + spriteBatch.Draw(outerAreaTexture, drawCenter, null, Color.White, 0f, outerAreaTexture.Size() * 0.5f, 1f, SpriteEffects.None, 0f); + + if (CalamityWorld.revenge) + { + Texture2D difficultyIconToUse = CalamityWorld.death ? deathIconTexture : revengeanceIconTexture; + spriteBatch.Draw(difficultyIconToUse, drawCenter + DifficultyIconOffset, null, Color.White, 0f, revengeanceIconTexture.Size() * 0.5f, 0.9f, SpriteEffects.None, 0f); + } + + if (CalamityWorld.armageddon) + spriteBatch.Draw(armageddonIconTexture, drawCenter + ArmageddonIconOffset, null, Color.White, 0f, revengeanceIconTexture.Size() * 0.5f, 0.9f, SpriteEffects.None, 0f); + + if (CalamityWorld.defiled) + spriteBatch.Draw(defiledRuneIconTexture, drawCenter + DefiledRuneIconOffset, null, Color.White, 0f, revengeanceIconTexture.Size() * 0.5f, 0.9f, SpriteEffects.None, 0f); + } + } +} From 918f1465e81e2163a9a60e4e831776510d4aa361 Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 16 Oct 2020 18:31:26 -0500 Subject: [PATCH 45/46] Water leeches aren't as annoying anymore --- Buffs/DamageOverTime/HeavyBleeding.cs | 20 ++++++++++++++++++++ Buffs/DamageOverTime/HeavyBleeding.png | Bin 0 -> 740 bytes CalPlayer/CalamityPlayer.cs | 15 +++++++++++---- CalPlayer/CalamityPlayerLifeRegen.cs | 15 ++++++++++++++- NPCs/AcidRain/WaterLeech.cs | 5 ++--- 5 files changed, 47 insertions(+), 8 deletions(-) create mode 100644 Buffs/DamageOverTime/HeavyBleeding.cs create mode 100644 Buffs/DamageOverTime/HeavyBleeding.png diff --git a/Buffs/DamageOverTime/HeavyBleeding.cs b/Buffs/DamageOverTime/HeavyBleeding.cs new file mode 100644 index 0000000000..e44fb8e344 --- /dev/null +++ b/Buffs/DamageOverTime/HeavyBleeding.cs @@ -0,0 +1,20 @@ +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.DamageOverTime +{ + public class HeavyBleeding : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Heavy Bleeding"); + Description.SetDefault("You're losing a lot of blood"); + Main.debuff[Type] = true; + Main.pvpBuff[Type] = true; + Main.buffNoSave[Type] = true; + longerExpertDebuff = false; + } + + public override void Update(Player player, ref int buffIndex) => player.Calamity().waterLeechBleeding = true; + } +} diff --git a/Buffs/DamageOverTime/HeavyBleeding.png b/Buffs/DamageOverTime/HeavyBleeding.png new file mode 100644 index 0000000000000000000000000000000000000000..26ea11ef6b33be0a4d82af8b95034cce1400865a GIT binary patch literal 740 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnF3?v&v(vJfvmUKs7M+SzC{oH>NSwWJ?9znhg z3{`3j3=J&|48MRv4KElNN(~qoUL`OvSj}Ky5HFasE6@fgArasc;tHgJ;Q!K&|3%@? zfedNZ|I6n6|NnpWvgtWM3C5BjzhDN3XE)M7oFs2|7k074j@LjAdx@v7EBg};VL@&E z&oewfgXHsz{6ZMdFDjn}k z5hW>!C8<`)MX5lF!N|bKK-a)R*U&P=(A>(z*viCQ+rYrez+mb8g@z~^a`RI%(<*Um zxN=Cc7pOr2WJ7U&T1k0gQ7S`5Nl8JmmA-yvZen^W5N9T5>*W`v?>R3!7pPVOq&6g@ zG&jl0$|XO!G&eP`#L6lFsI-{DaQXk;`am_}NNPMmrdU~dq-LgPlrR_@X?*$d1*k*} zQ%QJcN=XJ##f4~#N}vi!Bo)4yxv3?U1*r^RH|ZDTrQ2@`^Fy=AHw37P!O+yw+``n- zz{p&r`SMnv5K3@l6x3@i+cjV+7}xBXXm2Q-1f)78&qol`;+02~hS5C8xG literal 0 HcmV?d00001 diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 3bc380a5b5..2f1449c732 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -776,6 +776,7 @@ namespace CalamityMod.CalPlayer public bool vaporfied = false; public bool energyShellCooldown = false; public bool prismaticCooldown = false; + public bool waterLeechBleeding = false; #endregion #region Buff @@ -1792,6 +1793,7 @@ namespace CalamityMod.CalPlayer vaporfied = false; energyShellCooldown = false; prismaticCooldown = false; + waterLeechBleeding = false; revivify = false; trinketOfChiBuff = false; @@ -2137,11 +2139,12 @@ namespace CalamityMod.CalPlayer vaporfied = false; energyShellCooldown = false; prismaticCooldown = false; - #endregion + waterLeechBleeding = false; + #endregion - #region Rogue - // Stealth - rogueStealth = 0f; + #region Rogue + // Stealth + rogueStealth = 0f; rogueStealthMax = 0f; stealthAcceleration = 1f; @@ -4223,6 +4226,10 @@ namespace CalamityMod.CalPlayer { damageSource = PlayerDeathReason.ByCustomReason(player.name + " fell prey to their sins."); } + if (waterLeechBleeding && damage == 10.0 && hitDirection == 0 && damageSource.SourceOtherIndex == 8) + { + damageSource = PlayerDeathReason.ByCustomReason(player.name + " lost too much blood."); + } if (shadowflame && damage == 10.0 && hitDirection == 0 && damageSource.SourceOtherIndex == 8) { damageSource = PlayerDeathReason.ByCustomReason(player.name + "'s spirit was turned to ash."); diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 77ebb26d24..2385889ac0 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -202,7 +202,20 @@ namespace CalamityMod.CalPlayer lifeRegenLost += 16; } - if (modPlayer.pFlames) + if (modPlayer.waterLeechBleeding) + { + if (player.lifeRegen > 0) + player.lifeRegen = 0; + + player.lifeRegenTime = 0; + lifeRegenLost += 6; + if (CalamityWorld.downedAquaticScourge) + lifeRegenLost += 6; + if (CalamityWorld.downedPolterghast) + lifeRegenLost += 12; + } + + if (modPlayer.pFlames) { if (player.lifeRegen > 0) player.lifeRegen = 0; diff --git a/NPCs/AcidRain/WaterLeech.cs b/NPCs/AcidRain/WaterLeech.cs index dc30d15300..450a75e411 100644 --- a/NPCs/AcidRain/WaterLeech.cs +++ b/NPCs/AcidRain/WaterLeech.cs @@ -8,6 +8,7 @@ using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Buffs.StatDebuffs; using System.IO; +using CalamityMod.Buffs.DamageOverTime; namespace CalamityMod.NPCs.AcidRain { @@ -27,18 +28,15 @@ namespace CalamityMod.NPCs.AcidRain npc.width = 26; npc.height = 14; - npc.damage = 10; npc.lifeMax = 30; if (CalamityWorld.downedPolterghast) { - npc.damage = 60; npc.lifeMax = 2250; npc.defense = 10; } else if (CalamityWorld.downedAquaticScourge) { - npc.damage = 30; npc.lifeMax = 90; } @@ -120,6 +118,7 @@ namespace CalamityMod.NPCs.AcidRain if (npc.Distance(destination) < 45f) { player.AddBuff(BuffID.Bleeding, 180, true); + player.AddBuff(ModContent.BuffType(), 30, true); } else if (!npc.wet && npc.Distance(destination) > 85f) { From 57fd5c4f940b84f395b3a556a28ddb985010b8eb Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 6 Nov 2020 20:34:17 -0600 Subject: [PATCH 46/46] Last Prism Beams don't die to SW segments --- CalamityLists.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CalamityLists.cs b/CalamityLists.cs index f94ca8d5ec..98ab5c2a9f 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -402,6 +402,7 @@ namespace CalamityMod ProjectileID.VortexBeater, ProjectileID.DD2PhoenixBow, ProjectileID.LastPrism, + ProjectileID.LastPrismLaser, ProjectileID.LaserMachinegun, ProjectileID.ChargedBlasterCannon, ProjectileID.MedusaHead, @@ -418,7 +419,10 @@ namespace CalamityMod ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), ModContent.ProjectileType(), + // ModContent.ProjectileType(), // TODO: ADD THE APOTHEOSIS WORM HERE LATER. IT IS IN A DIFFERENT BRANCH AS OF WRITING THIS. ModContent.ProjectileType(), ModContent.ProjectileType(),