From 0d8aadff8c181d466e82ef08461906ae92ae80e3 Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 8 Apr 2022 16:02:52 -0500 Subject: [PATCH] The last side things. 286 errors --- CalPlayer/CalamityPlayerOnHit.cs | 4 +- Items/Accessories/Wings/SoulofCryogen.cs | 5 +- Items/Armor/AerospecHelmet.cs | 3 +- Items/Armor/AtaxiaHelmet.cs | 3 +- Items/Armor/AuricTeslaSpaceHelmet.cs | 3 +- Items/Armor/DaedalusHeadgear.cs | 3 +- Items/Armor/DemonshadeHelm.cs | 3 +- Items/Armor/GodSlayerMask.cs | 2 +- Items/Armor/MolluskShellmet.cs | 3 +- Items/Armor/PlaguebringerVisor.cs | 3 +- Items/Armor/ReaverHeadgear.cs | 3 +- Items/Armor/SilvaHelmet.cs | 3 +- Items/Materials/ExoPrism.cs | 7 ++- Items/SummonItems/AstralChunk.cs | 5 +- Items/Weapons/Melee/Ataraxia.cs | 2 +- Items/Weapons/Melee/SeashineSword.cs | 5 +- Items/Weapons/Melee/StormSaber.cs | 4 +- Items/Weapons/Melee/TheMutilator.cs | 4 +- Items/Weapons/Melee/TrueArkoftheAncients.cs | 4 +- Items/Weapons/Ranged/Alluvion.cs | 8 +-- Items/Weapons/Ranged/CosmicBolter.cs | 8 +-- Items/Weapons/Ranged/Dualpoon.cs | 6 +- Items/Weapons/Ranged/Goobow.cs | 6 +- Items/Weapons/Ranged/GreatbowofTurmoil.cs | 8 +-- Items/Weapons/Ranged/HeavenlyGale.cs | 8 +-- Items/Weapons/Ranged/LunarianBow.cs | 8 +-- Items/Weapons/Ranged/Monsoon.cs | 8 +-- Items/Weapons/Ranged/OnyxChainBlaster.cs | 6 +- Items/Weapons/Ranged/Onyxia.cs | 6 +- Items/Weapons/Ranged/TheStorm.cs | 16 +++--- Items/Weapons/Ranged/Triploon.cs | 6 +- Items/Weapons/Rogue/AuroradicalThrow.cs | 5 +- Items/Weapons/Rogue/CorpusAvertor.cs | 4 +- Items/Weapons/Rogue/DeepSeaDumbbell.cs | 6 +- Items/Weapons/Rogue/Nychthemeron.cs | 9 +-- Items/Weapons/Rogue/RogueWeapon.cs | 55 ++++++++++--------- NPCs/ExoMechs/Apollo/Apollo.cs | 1 - NPCs/ExoMechs/Thanatos/ThanatosHead.cs | 1 - NPCs/Leviathan/AquaticAberration.cs | 2 +- NPCs/Leviathan/Leviathan.cs | 1 - NPCs/NormalNPCs/WulfrumPylon.cs | 2 +- NPCs/Polterghast/Polterghast.cs | 1 - NPCs/StormWeaver/StormWeaverHead.cs | 1 - NPCs/TownNPCs/WITCH.cs | 2 +- Projectiles/Boss/IchorBlob.cs | 4 +- Projectiles/Magic/Ancient2.cs | 6 +- Projectiles/Magic/ApotheosisWorm.cs | 4 +- Projectiles/Magic/BeamingBolt.cs | 2 +- Projectiles/Magic/MeteorStar.cs | 4 -- Projectiles/Magic/NebulaElementalBeam.cs | 6 +- Projectiles/Magic/SirensSongNote.cs | 4 +- Projectiles/Magic/SlitheringEelProjectile.cs | 8 +-- Projectiles/Magic/SpiritCongregation.cs | 16 +++--- Projectiles/Magic/SubsumingTentacle.cs | 8 +-- Projectiles/Magic/WaterLeechProj.cs | 6 +- .../Melee/ArkOfTheCosmos_BlastAttack.cs | 4 +- .../Melee/ArkOfTheCosmos_SwungBlade.cs | 8 +-- Projectiles/Melee/DragonRageStaff.cs | 2 +- Projectiles/Melee/ExcelsusBlue.cs | 4 +- Projectiles/Melee/GaelSkull2.cs | 2 +- Projectiles/Melee/Spears/StreamGougeProj.cs | 4 +- Projectiles/Melee/TaintedBladeSlasher.cs | 4 +- Projectiles/Melee/TrueBiomeBladeHoldout.cs | 2 +- Projectiles/Ranged/BeeRPG.cs | 2 +- Projectiles/Ranged/ButcherGun.cs | 2 +- Projectiles/Ranged/ChickenCannonHeld.cs | 2 +- Projectiles/Ranged/CondemnationHoldout.cs | 2 +- Projectiles/Ranged/DWArrow.cs | 6 +- Projectiles/Ranged/DaemonsFlameBow.cs | 4 +- Projectiles/Ranged/DesertMark.cs | 5 -- Projectiles/Ranged/DrataliornusBow.cs | 2 +- Projectiles/Ranged/DrizzlefishFireSplit.cs | 4 +- Projectiles/Ranged/ExoLight.cs | 2 +- Projectiles/Ranged/ExoMark.cs | 5 -- Projectiles/Ranged/ExplodingStake.cs | 2 +- Projectiles/Ranged/FallenStarProj.cs | 4 +- Projectiles/Ranged/FlamingStake.cs | 2 +- .../Ranged/FlurrystormCannonShooting.cs | 2 +- Projectiles/Ranged/GoliathRocket.cs | 2 +- Projectiles/Ranged/HiveBomb.cs | 2 +- Projectiles/Ranged/HiveMissile.cs | 2 +- Projectiles/Ranged/HolyFireBulletProj.cs | 2 +- Projectiles/Ranged/MaelstromHoldout.cs | 2 +- Projectiles/Ranged/MiniRocket.cs | 4 +- Projectiles/Ranged/Nanomachine.cs | 4 +- Projectiles/Ranged/Nuke.cs | 2 +- Projectiles/Ranged/PhangasmBow.cs | 2 +- Projectiles/Ranged/PrismExplosionLarge.cs | 2 +- Projectiles/Ranged/PrismMine.cs | 4 +- Projectiles/Ranged/PrismaticEnergyBlast.cs | 6 +- Projectiles/Rogue/ShockGrenadeProjectile.cs | 2 +- Projectiles/Rogue/SlickCaneProjectile.cs | 6 +- Projectiles/Rogue/SpearofDestinyProjectile.cs | 2 +- Projectiles/Rogue/StealthNimbus.cs | 2 +- Projectiles/Rogue/StealthRain.cs | 4 +- Projectiles/Rogue/SulphuricNukesplosion.cs | 4 +- Projectiles/Summon/Shellfish.cs | 6 +- Projectiles/Summon/VileFeederSummon.cs | 6 +- Schematics/CalamitySchematicIO.cs | 2 - .../AgedLaboratoryConsole.cs | 4 +- .../AgedLaboratoryDisplay.cs | 4 +- .../DraedonStructures/AgedLaboratoryServer.cs | 4 +- Utilities/FurnitureSetupUtils.cs | 1 + 103 files changed, 231 insertions(+), 247 deletions(-) diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index ee80e24dd6..d935c35b55 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -1607,7 +1607,7 @@ namespace CalamityMod.CalPlayer if ((target.life < target.lifeMax * 0.5) && bloodflareHeartTimer <= 0) { bloodflareHeartTimer = 300; - DropHelper.DropItem(target, ItemID.Heart); + Item.NewItem(target.GetItemSource_Loot(), target.Hitbox, ItemID.Heart); } } @@ -1831,7 +1831,7 @@ namespace CalamityMod.CalPlayer if ((target.life < target.lifeMax * 0.5) && bloodflareHeartTimer <= 0) { bloodflareHeartTimer = 300; - DropHelper.DropItem(target, ItemID.Heart); + Item.NewItem(target.GetItemSource_Loot(), target.Hitbox, ItemID.Heart); } } diff --git a/Items/Accessories/Wings/SoulofCryogen.cs b/Items/Accessories/Wings/SoulofCryogen.cs index bfd5a33f4c..efffd69c00 100644 --- a/Items/Accessories/Wings/SoulofCryogen.cs +++ b/Items/Accessories/Wings/SoulofCryogen.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Rogue; using Terraria; using Terraria.DataStructures; @@ -66,7 +66,8 @@ namespace CalamityMod.Items.Accessories.Wings { if (player.controlJump && !player.canJumpAgain_Cloud && player.jump == 0 && player.velocity.Y != 0f && !player.mount.Active && !player.mount.Cart) { - int p = Projectile.NewProjectile(player.Center.X, player.Center.Y, player.velocity.X * 0f, 2f, ModContent.ProjectileType(), (int)(25 * player.AverageDamage()), 3f, player.whoAmI, 1f); + var source = player.GetProjectileSource_Accessory(Item); + int p = Projectile.NewProjectile(source, player.Center.X, player.Center.Y, player.velocity.X * 0f, 2f, ModContent.ProjectileType(), (int)(25 * player.AverageDamage()), 3f, player.whoAmI, 1f); if (p.WithinBounds(Main.maxProjectiles)) { Main.projectile[p].Calamity().forceTypeless = true; diff --git a/Items/Armor/AerospecHelmet.cs b/Items/Armor/AerospecHelmet.cs index b93bc1b361..fecd03f454 100644 --- a/Items/Armor/AerospecHelmet.cs +++ b/Items/Armor/AerospecHelmet.cs @@ -48,13 +48,14 @@ namespace CalamityMod.Items.Armor player.noFallDmg = true; if (player.whoAmI == Main.myPlayer) { + var source = player.GetProjectileSource_Item(Item); if (player.FindBuffIndex(ModContent.BuffType()) == -1) { player.AddBuff(ModContent.BuffType(), 3600, true); } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(20 * player.MinionDamage()), 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(source, player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(20 * player.MinionDamage()), 0f, Main.myPlayer, 0f, 0f); } } player.GetDamage(DamageClass.Summon) += 0.11f; diff --git a/Items/Armor/AtaxiaHelmet.cs b/Items/Armor/AtaxiaHelmet.cs index ca7f2b2e50..004d8ac137 100644 --- a/Items/Armor/AtaxiaHelmet.cs +++ b/Items/Armor/AtaxiaHelmet.cs @@ -49,13 +49,14 @@ namespace CalamityMod.Items.Armor modPlayer.chaosSpirit = true; if (player.whoAmI == Main.myPlayer) { + var source = player.GetProjectileSource_Item(Item); if (player.FindBuffIndex(ModContent.BuffType()) == -1) { player.AddBuff(ModContent.BuffType(), 3600, true); } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(190f * player.MinionDamage()), 0f, Main.myPlayer, 38f, 0f); + Projectile.NewProjectile(source, player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(190f * player.MinionDamage()), 0f, Main.myPlayer, 38f, 0f); } } player.GetDamage(DamageClass.Summon) += 0.4f; diff --git a/Items/Armor/AuricTeslaSpaceHelmet.cs b/Items/Armor/AuricTeslaSpaceHelmet.cs index 4376f9092b..b59c6af412 100644 --- a/Items/Armor/AuricTeslaSpaceHelmet.cs +++ b/Items/Armor/AuricTeslaSpaceHelmet.cs @@ -66,13 +66,14 @@ namespace CalamityMod.Items.Armor } if (player.whoAmI == Main.myPlayer) { + var source = player.GetProjectileSource_Item(Item); if (player.FindBuffIndex(ModContent.BuffType()) == -1) { player.AddBuff(ModContent.BuffType(), 3600, true); } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(1200f * player.MinionDamage()), 0f, Main.myPlayer, -20f, 0f); + Projectile.NewProjectile(source, player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(1200f * player.MinionDamage()), 0f, Main.myPlayer, -20f, 0f); } } } diff --git a/Items/Armor/DaedalusHeadgear.cs b/Items/Armor/DaedalusHeadgear.cs index 488e82baf4..82d2962b0d 100644 --- a/Items/Armor/DaedalusHeadgear.cs +++ b/Items/Armor/DaedalusHeadgear.cs @@ -45,13 +45,14 @@ namespace CalamityMod.Items.Armor modPlayer.daedalusCrystal = true; if (player.whoAmI == Main.myPlayer) { + var source = player.GetProjectileSource_Item(Item); if (player.FindBuffIndex(ModContent.BuffType()) == -1) { player.AddBuff(ModContent.BuffType(), 3600, true); } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(95f * player.MinionDamage()), 0f, Main.myPlayer, 50f, 0f); + Projectile.NewProjectile(source, player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(95f * player.MinionDamage()), 0f, Main.myPlayer, 50f, 0f); } } player.GetDamage(DamageClass.Summon) += 0.2f; diff --git a/Items/Armor/DemonshadeHelm.cs b/Items/Armor/DemonshadeHelm.cs index f781802e8c..d5bf4741ed 100644 --- a/Items/Armor/DemonshadeHelm.cs +++ b/Items/Armor/DemonshadeHelm.cs @@ -57,6 +57,7 @@ namespace CalamityMod.Items.Armor if (player.whoAmI == Main.myPlayer && !modPlayer.chibii) { modPlayer.redDevil = true; + var source = player.GetProjectileSource_Item(Item); if (player.FindBuffIndex(ModContent.BuffType()) == -1) { player.AddBuff(ModContent.BuffType(), 3600, true); @@ -64,7 +65,7 @@ namespace CalamityMod.Items.Armor if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { int damage = (int)(10000 * player.AverageDamage()); - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(source, player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); } } player.GetDamage(DamageClass.Summon) += 1f; diff --git a/Items/Armor/GodSlayerMask.cs b/Items/Armor/GodSlayerMask.cs index 2103b2bc10..b1e4ac0e5e 100644 --- a/Items/Armor/GodSlayerMask.cs +++ b/Items/Armor/GodSlayerMask.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Armor modPlayer.godSlayerThrowing = true; modPlayer.rogueStealthMax += 1.2f; modPlayer.wearingRogueArmor = true; - string hotkey = CalamityMod.GodSlayerDashHotKey.TooltipHotkeyString(); + string hotkey = CalamityKeybinds.GodSlayerDashHotKey.TooltipHotkeyString(); player.setBonus = "Allows you to dash for an immense distance in 8 directions\n" + "Press " + hotkey + " while holding down the movement keys in the direction you want to dash\n" + "Enemies you dash through take massive damage\n" + diff --git a/Items/Armor/MolluskShellmet.cs b/Items/Armor/MolluskShellmet.cs index fd1c77bb00..b585b93ad9 100644 --- a/Items/Armor/MolluskShellmet.cs +++ b/Items/Armor/MolluskShellmet.cs @@ -51,13 +51,14 @@ namespace CalamityMod.Items.Armor player.maxMinions += 4; if (player.whoAmI == Main.myPlayer) { + var source = player.GetProjectileSource_Item(Item); if (player.FindBuffIndex(ModContent.BuffType()) == -1) { player.AddBuff(ModContent.BuffType(), 3600, true); } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 2) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(140 * player.MinionDamage()), 0f, player.whoAmI); + Projectile.NewProjectile(source, player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(140 * player.MinionDamage()), 0f, player.whoAmI); } } player.Calamity().wearingRogueArmor = true; diff --git a/Items/Armor/PlaguebringerVisor.cs b/Items/Armor/PlaguebringerVisor.cs index 0e79a076c9..fc8f10df12 100644 --- a/Items/Armor/PlaguebringerVisor.cs +++ b/Items/Armor/PlaguebringerVisor.cs @@ -57,13 +57,14 @@ namespace CalamityMod.Items.Armor player.maxMinions += 3; if (player.whoAmI == Main.myPlayer) { + var source = player.GetProjectileSource_Item(Item); if (player.FindBuffIndex(ModContent.BuffType()) == -1) { player.AddBuff(ModContent.BuffType(), 3600, true); } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(80 * player.MinionDamage()), 0f, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(source, player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(80 * player.MinionDamage()), 0f, player.whoAmI, 0f, 0f); } } diff --git a/Items/Armor/ReaverHeadgear.cs b/Items/Armor/ReaverHeadgear.cs index b30b95eb2b..1fd69b44df 100644 --- a/Items/Armor/ReaverHeadgear.cs +++ b/Items/Armor/ReaverHeadgear.cs @@ -56,13 +56,14 @@ namespace CalamityMod.Items.Armor if (player.whoAmI == Main.myPlayer) { + var source = player.GetProjectileSource_Item(Item); if (player.FindBuffIndex(ModContent.BuffType()) == -1) { player.AddBuff(ModContent.BuffType(), 3600, true); } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - Projectile.NewProjectile(player.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, player.whoAmI); + Projectile.NewProjectile(source, player.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, player.whoAmI); } } if (player.miscCounter % 10 == 0) diff --git a/Items/Armor/SilvaHelmet.cs b/Items/Armor/SilvaHelmet.cs index f276dc3a31..5bb667d9bc 100644 --- a/Items/Armor/SilvaHelmet.cs +++ b/Items/Armor/SilvaHelmet.cs @@ -53,13 +53,14 @@ namespace CalamityMod.Items.Armor "Summons an ancient leaf prism to blast your enemies with life energy"; if (player.whoAmI == Main.myPlayer) { + var source = player.GetProjectileSource_Item(Item); if (player.FindBuffIndex(ModContent.BuffType()) == -1) { player.AddBuff(ModContent.BuffType(), 3600, true); } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(600f * player.MinionDamage()), 0f, Main.myPlayer, -20f, 0f); + Projectile.NewProjectile(source, player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(600f * player.MinionDamage()), 0f, Main.myPlayer, -20f, 0f); } } player.GetDamage(DamageClass.Summon) += 0.65f; diff --git a/Items/Materials/ExoPrism.cs b/Items/Materials/ExoPrism.cs index e5f7c21f4b..3af1db79ff 100644 --- a/Items/Materials/ExoPrism.cs +++ b/Items/Materials/ExoPrism.cs @@ -1,6 +1,7 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; @@ -34,13 +35,13 @@ namespace CalamityMod.Items.Materials { float scale = baseScale * outwardnessFactor; Vector2 drawPosition = baseDrawPosition + (MathHelper.TwoPi * i / 4f).ToRotationVector2() * 4f; - spriteBatch.Draw(Main.itemTexture[Item.type], drawPosition, frame, drawColor, Item.velocity.X * 0.2f, frame.Size() * 0.5f, scale, SpriteEffects.None, 0f); + spriteBatch.Draw(TextureAssets.Item[Item.type].Value, drawPosition, frame, drawColor, Item.velocity.X * 0.2f, frame.Size() * 0.5f, scale, SpriteEffects.None, 0f); } } public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) { - Rectangle frame = Main.itemTexture[Item.type].Frame(); + Rectangle frame = TextureAssets.Item[Item.type].Value.Frame(); DrawBackAfterimage(spriteBatch, Item.position - Main.screenPosition + frame.Size() * 0.5f, frame, scale); return true; } diff --git a/Items/SummonItems/AstralChunk.cs b/Items/SummonItems/AstralChunk.cs index 2cde974b91..e6ed2d630a 100644 --- a/Items/SummonItems/AstralChunk.cs +++ b/Items/SummonItems/AstralChunk.cs @@ -1,10 +1,11 @@ -using CalamityMod.Events; +using CalamityMod.Events; using CalamityMod.Items.Materials; using CalamityMod.NPCs.AstrumAureus; using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using Terraria.DataStructures; namespace CalamityMod.Items.SummonItems { @@ -38,7 +39,7 @@ namespace CalamityMod.Items.SummonItems SoundEngine.PlaySound(SoundID.Roar, player.position, 0); if (Main.netMode != NetmodeID.MultiplayerClient) { - int npc = NPC.NewNPC((int)(player.position.X + Main.rand.Next(-250, 251)), (int)(player.position.Y - 500f), ModContent.NPCType(), 1); + int npc = NPC.NewNPC(new EntitySource_BossSpawn(player), (int)(player.position.X + Main.rand.Next(-250, 251)), (int)(player.position.Y - 500f), ModContent.NPCType(), 1); Main.npc[npc].timeLeft *= 20; CalamityUtils.BossAwakenMessage(npc); } diff --git a/Items/Weapons/Melee/Ataraxia.cs b/Items/Weapons/Melee/Ataraxia.cs index f98486b3bf..f585c3e55d 100644 --- a/Items/Weapons/Melee/Ataraxia.cs +++ b/Items/Weapons/Melee/Ataraxia.cs @@ -85,13 +85,13 @@ namespace CalamityMod.Items.Weapons.Melee private void OnHitEffects(Player player, Vector2 targetPos) { - // Individual true melee homing missiles deal 10% of the weapon's base damage. int numSplits = 5; int trueMeleeID = ModContent.ProjectileType(); int trueMeleeDamage = (int)(0.1f * Item.damage * player.MeleeDamage()); float angleVariance = MathHelper.TwoPi / (float)numSplits; float spinOffsetAngle = MathHelper.Pi / (2f * numSplits); + var source = player.GetProjectileSource_Item(Item); Vector2 posVec = new Vector2(8f, 0f).RotatedByRandom(MathHelper.TwoPi); for (int i = 0; i < numSplits; ++i) diff --git a/Items/Weapons/Melee/SeashineSword.cs b/Items/Weapons/Melee/SeashineSword.cs index fb433e098b..01a8a6106c 100644 --- a/Items/Weapons/Melee/SeashineSword.cs +++ b/Items/Weapons/Melee/SeashineSword.cs @@ -1,4 +1,4 @@ -using Terraria.DataStructures; +using Terraria.DataStructures; using CalamityMod.Items.Placeables; using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; @@ -31,10 +31,9 @@ namespace CalamityMod.Items.Weapons.Melee Item.UseSound = SoundID.Item1; } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) + public override void ModifyShootStats(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback) { type = ModContent.ProjectileType(); - return base.Shoot(player, ref position, ref velocity.X, ref velocity.Y, ref type, ref damage, ref knockBack); } public override void AddRecipes() diff --git a/Items/Weapons/Melee/StormSaber.cs b/Items/Weapons/Melee/StormSaber.cs index 6e0eed4a66..090b9c3d40 100644 --- a/Items/Weapons/Melee/StormSaber.cs +++ b/Items/Weapons/Melee/StormSaber.cs @@ -1,4 +1,4 @@ -using Terraria.DataStructures; +using Terraria.DataStructures; using Terraria.DataStructures; using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Weapons.Melee Vector2 spawnPos = new Vector2(player.MountedCenter.X + Main.rand.Next(-200, 201), player.MountedCenter.Y - 600f); Vector2 targetPos = Main.MouseWorld + new Vector2(Main.rand.Next(-30, 31), Main.rand.Next(-30, 31)); - Vector2 velocity = targetPos - spawnPos; + velocity = targetPos - spawnPos; velocity.Normalize(); velocity *= 13f; diff --git a/Items/Weapons/Melee/TheMutilator.cs b/Items/Weapons/Melee/TheMutilator.cs index 44d275c443..ab3193045b 100644 --- a/Items/Weapons/Melee/TheMutilator.cs +++ b/Items/Weapons/Melee/TheMutilator.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using Microsoft.Xna.Framework; using Terraria; @@ -46,7 +46,7 @@ namespace CalamityMod.Items.Weapons.Melee int heartDrop = CalamityPlayer.areThereAnyDamnBosses ? 1 : Main.rand.Next(1, 3); for (int i = 0; i < heartDrop; i++) { - Item.NewItem((int)target.position.X, (int)target.position.Y, target.width, target.height, 58, 1, false, 0, false, false); + Item.NewItem(player.GetItemSource_OnHit(target, 0), (int)target.position.X, (int)target.position.Y, target.width, target.height, 58, 1, false, 0, false, false); } } SoundEngine.PlaySound(SoundID.Item14, target.position); diff --git a/Items/Weapons/Melee/TrueArkoftheAncients.cs b/Items/Weapons/Melee/TrueArkoftheAncients.cs index 040b9e1f68..b96e2ba6f4 100644 --- a/Items/Weapons/Melee/TrueArkoftheAncients.cs +++ b/Items/Weapons/Melee/TrueArkoftheAncients.cs @@ -127,8 +127,8 @@ namespace CalamityMod.Items.Weapons.Melee Vector2 Shift = Utils.SafeNormalize(velocity.RotatedBy(MathHelper.PiOver2), Vector2.Zero) * 30; - Projectile.NewProjectile(source, player.Center + Shift, velocity.X.RotatedBy(MathHelper.PiOver4 * 0.3f) , ProjectileType(), (int)(damage * glassStarDamageMultiplier), knockback, player.whoAmI, Charge > 0 ? 1 : 0); - Projectile.NewProjectile(source, player.Center - Shift, velocity.X.RotatedBy(-MathHelper.PiOver4 * 0.3f), ProjectileType(), (int)(damage * glassStarDamageMultiplier), knockback, player.whoAmI, Charge > 0 ? 1 : 0); + Projectile.NewProjectile(source, player.Center + Shift, velocity.RotatedBy(MathHelper.PiOver4 * 0.3f) , ProjectileType(), (int)(damage * glassStarDamageMultiplier), knockback, player.whoAmI, Charge > 0 ? 1 : 0); + Projectile.NewProjectile(source, player.Center - Shift, velocity.RotatedBy(-MathHelper.PiOver4 * 0.3f), ProjectileType(), (int)(damage * glassStarDamageMultiplier), knockback, player.whoAmI, Charge > 0 ? 1 : 0); } diff --git a/Items/Weapons/Ranged/Alluvion.cs b/Items/Weapons/Ranged/Alluvion.cs index 42ced114ba..5fd0d31d88 100644 --- a/Items/Weapons/Ranged/Alluvion.cs +++ b/Items/Weapons/Ranged/Alluvion.cs @@ -1,4 +1,4 @@ -using Terraria.DataStructures; +using Terraria.DataStructures; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using CalamityMod.Projectiles.Ranged; @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.Calamity().canFirePointBlankShots = true; } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo spawnSource, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { Vector2 source = player.RotatedRelativePoint(player.MountedCenter); float num117 = MathHelper.Pi * 0.1f; @@ -75,7 +75,7 @@ namespace CalamityMod.Items.Weapons.Ranged newType = ModContent.ProjectileType(); break; } - int proj = Projectile.NewProjectile(source.X + offset.X, source.Y + offset.Y, velocity.X, velocity.Y, newType, damage, knockback, player.whoAmI); + int proj = Projectile.NewProjectile(spawnSource, source.X + offset.X, source.Y + offset.Y, velocity.X, velocity.Y, newType, damage, knockback, player.whoAmI); if (proj.WithinBounds(Main.maxProjectiles)) { Main.projectile[proj].arrow = true; @@ -84,7 +84,7 @@ namespace CalamityMod.Items.Weapons.Ranged } else { - int proj = Projectile.NewProjectile(source.X + offset.X, source.Y + offset.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI); + int proj = Projectile.NewProjectile(spawnSource, source.X + offset.X, source.Y + offset.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI); Main.projectile[proj].noDropItem = true; } } diff --git a/Items/Weapons/Ranged/CosmicBolter.cs b/Items/Weapons/Ranged/CosmicBolter.cs index b6181a51e0..94d6f15b39 100644 --- a/Items/Weapons/Ranged/CosmicBolter.cs +++ b/Items/Weapons/Ranged/CosmicBolter.cs @@ -1,4 +1,4 @@ -using Terraria.DataStructures; +using Terraria.DataStructures; using Terraria.DataStructures; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Ranged; @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.Calamity().canFirePointBlankShots = true; } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo spawnSource, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { Vector2 source = player.RotatedRelativePoint(player.MountedCenter, true); float piOver10 = MathHelper.Pi * 0.1f; @@ -56,10 +56,10 @@ namespace CalamityMod.Items.Weapons.Ranged offset -= velocity; if (type == ProjectileID.WoodenArrowFriendly) - Projectile.NewProjectile(source + offset, velocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI); + Projectile.NewProjectile(spawnSource, source + offset, velocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI); else { - int proj = Projectile.NewProjectile(source + offset, velocity, type, damage, knockback, player.whoAmI); + int proj = Projectile.NewProjectile(spawnSource, source + offset, velocity, type, damage, knockback, player.whoAmI); Main.projectile[proj].noDropItem = true; } } diff --git a/Items/Weapons/Ranged/Dualpoon.cs b/Items/Weapons/Ranged/Dualpoon.cs index b8430b73da..41932850d7 100644 --- a/Items/Weapons/Ranged/Dualpoon.cs +++ b/Items/Weapons/Ranged/Dualpoon.cs @@ -1,4 +1,4 @@ -using Terraria.DataStructures; +using Terraria.DataStructures; using CalamityMod.Items.Placeables; using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Weapons.Ranged return new Vector2(-5, 0); } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo spawnSource, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { Vector2 source = player.RotatedRelativePoint(player.MountedCenter, true); float piOverTen = MathHelper.Pi * 0.1f; @@ -58,7 +58,7 @@ namespace CalamityMod.Items.Weapons.Ranged { offset -= velocity; } - Projectile.NewProjectile(source.X + offset.X, source.Y + offset.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(spawnSource, source.X + offset.X, source.Y + offset.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI, 0f, 0f); } return false; } diff --git a/Items/Weapons/Ranged/Goobow.cs b/Items/Weapons/Ranged/Goobow.cs index f37229abad..64024f7457 100644 --- a/Items/Weapons/Ranged/Goobow.cs +++ b/Items/Weapons/Ranged/Goobow.cs @@ -1,4 +1,4 @@ -using Terraria.DataStructures; +using Terraria.DataStructures; using Terraria.DataStructures; using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; @@ -38,7 +38,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.Calamity().canFirePointBlankShots = true; } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo spawnSource, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { Vector2 source = player.RotatedRelativePoint(player.MountedCenter, true); float piOver10 = 0.1f * MathHelper.Pi; @@ -55,7 +55,7 @@ namespace CalamityMod.Items.Weapons.Ranged { offset -= velocity; } - int index = Projectile.NewProjectile(source + offset, velocity * 0.6f, ProjectileID.SlimeGun, damage / 4, 0f, player.whoAmI); + int index = Projectile.NewProjectile(spawnSource, source + offset, velocity * 0.6f, ProjectileID.SlimeGun, damage / 4, 0f, player.whoAmI); if (index.WithinBounds(Main.maxProjectiles)) { Main.projectile[index].Calamity().forceRanged = true; diff --git a/Items/Weapons/Ranged/GreatbowofTurmoil.cs b/Items/Weapons/Ranged/GreatbowofTurmoil.cs index 4992719988..91acb96e47 100644 --- a/Items/Weapons/Ranged/GreatbowofTurmoil.cs +++ b/Items/Weapons/Ranged/GreatbowofTurmoil.cs @@ -1,4 +1,4 @@ -using Terraria.DataStructures; +using Terraria.DataStructures; using Terraria.DataStructures; using CalamityMod.Items.Materials; using Microsoft.Xna.Framework; @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.Calamity().canFirePointBlankShots = true; } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo spawnSource, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { Vector2 source = player.RotatedRelativePoint(player.MountedCenter, true); float piOverTen = MathHelper.Pi * 0.1f; @@ -60,7 +60,7 @@ namespace CalamityMod.Items.Weapons.Ranged { type = ProjectileID.FireArrow; } - int num121 = Projectile.NewProjectile(source + offset, velocity, type, damage, knockback, player.whoAmI); + int num121 = Projectile.NewProjectile(spawnSource, source + offset, velocity, type, damage, knockback, player.whoAmI); Main.projectile[num121].noDropItem = true; } for (int i = 0; i < 2; i++) @@ -73,7 +73,7 @@ namespace CalamityMod.Items.Weapons.Ranged ProjectileID.HellfireArrow, ProjectileID.IchorArrow }); - int index = Projectile.NewProjectile(source, position, new Vector2(SpeedX, SpeedY), type, (int)(damage * 0.5f), knockback, player.whoAmI); + int index = Projectile.NewProjectile(spawnSource, position, new Vector2(SpeedX, SpeedY), type, (int)(damage * 0.5f), knockback, player.whoAmI); Main.projectile[index].noDropItem = true; Main.projectile[index].usesLocalNPCImmunity = true; Main.projectile[index].localNPCHitCooldown = 10; diff --git a/Items/Weapons/Ranged/HeavenlyGale.cs b/Items/Weapons/Ranged/HeavenlyGale.cs index 8c963d8efa..92433b76f3 100644 --- a/Items/Weapons/Ranged/HeavenlyGale.cs +++ b/Items/Weapons/Ranged/HeavenlyGale.cs @@ -1,4 +1,4 @@ -using Terraria.DataStructures; +using Terraria.DataStructures; using Terraria.DataStructures; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Ranged; @@ -57,7 +57,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.Calamity().canFirePointBlankShots = true; } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo spawnSource, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { Vector2 source = player.RotatedRelativePoint(player.MountedCenter, true); Vector2 vel = velocity; @@ -84,12 +84,12 @@ namespace CalamityMod.Items.Weapons.Ranged // Teal exo arrows deal less damage. float dmgMult = thisArrowType == ProjectileType() ? 0.66f : 1f; int finalDamage = (int)(damage * dmgMult); - Projectile.NewProjectile(source + offset, vel, thisArrowType, finalDamage, knockback, player.whoAmI); + Projectile.NewProjectile(spawnSource, source + offset, vel, thisArrowType, finalDamage, knockback, player.whoAmI); } else { int normalArrowDamage = (int)(damage * NormalArrowDamageMult); - int proj = Projectile.NewProjectile(source + offset, vel, type, normalArrowDamage, knockback, player.whoAmI); + int proj = Projectile.NewProjectile(spawnSource, source + offset, vel, type, normalArrowDamage, knockback, player.whoAmI); Main.projectile[proj].noDropItem = true; } } diff --git a/Items/Weapons/Ranged/LunarianBow.cs b/Items/Weapons/Ranged/LunarianBow.cs index d3bd98bdf6..8972b7c9b0 100644 --- a/Items/Weapons/Ranged/LunarianBow.cs +++ b/Items/Weapons/Ranged/LunarianBow.cs @@ -1,4 +1,4 @@ -using Terraria.DataStructures; +using Terraria.DataStructures; using Terraria.DataStructures; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Ranged; @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.Calamity().canFirePointBlankShots = true; } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo spawnSource, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { Vector2 source = player.RotatedRelativePoint(player.MountedCenter, true); float piOver10 = MathHelper.Pi * 0.1f; @@ -56,10 +56,10 @@ namespace CalamityMod.Items.Weapons.Ranged offset -= velocity; if (type == ProjectileID.WoodenArrowFriendly) - Projectile.NewProjectile(source + offset, velocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI); + Projectile.NewProjectile(spawnSource, source + offset, velocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI); else { - int proj = Projectile.NewProjectile(source + offset, velocity, type, damage, knockback, player.whoAmI); + int proj = Projectile.NewProjectile(spawnSource, source + offset, velocity, type, damage, knockback, player.whoAmI); Main.projectile[proj].noDropItem = true; } } diff --git a/Items/Weapons/Ranged/Monsoon.cs b/Items/Weapons/Ranged/Monsoon.cs index 11591f90b6..a22ebad43e 100644 --- a/Items/Weapons/Ranged/Monsoon.cs +++ b/Items/Weapons/Ranged/Monsoon.cs @@ -1,4 +1,4 @@ -using Terraria.DataStructures; +using Terraria.DataStructures; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using CalamityMod.Projectiles.Ranged; @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.Calamity().canFirePointBlankShots = true; } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo spawnSource, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { Vector2 source = player.RotatedRelativePoint(player.MountedCenter); float piOver10 = MathHelper.Pi * 0.1f; @@ -70,7 +70,7 @@ namespace CalamityMod.Items.Weapons.Ranged newType = ModContent.ProjectileType(); break; } - int proj = Projectile.NewProjectile(source.X + offset.X, source.Y + offset.Y, velocity.X, velocity.Y, newType, (int)(damage * 1.1), knockback, player.whoAmI); + int proj = Projectile.NewProjectile(spawnSource, source.X + offset.X, source.Y + offset.Y, velocity.X, velocity.Y, newType, (int)(damage * 1.1), knockback, player.whoAmI); if (proj.WithinBounds(Main.maxProjectiles)) { Main.projectile[proj].arrow = true; @@ -79,7 +79,7 @@ namespace CalamityMod.Items.Weapons.Ranged } else { - int proj = Projectile.NewProjectile(source.X + offset.X, source.Y + offset.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI); + int proj = Projectile.NewProjectile(spawnSource, source.X + offset.X, source.Y + offset.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI); Main.projectile[proj].noDropItem = true; } } diff --git a/Items/Weapons/Ranged/OnyxChainBlaster.cs b/Items/Weapons/Ranged/OnyxChainBlaster.cs index dd6a09fea8..ae4177c0e4 100644 --- a/Items/Weapons/Ranged/OnyxChainBlaster.cs +++ b/Items/Weapons/Ranged/OnyxChainBlaster.cs @@ -1,4 +1,4 @@ -using Terraria.DataStructures; +using Terraria.DataStructures; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -43,12 +43,10 @@ namespace CalamityMod.Items.Weapons.Ranged public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - - // Fire the Onyx Shard that is characteristic of the Onyx Blaster // The shard deals 250% damage and double knockback int shardDamage = (int)(2.5f * damage); - float shardKB = 2f * knockBack; + float shardKB = 2f * knockback; Vector2 offset = new Vector2(Main.rand.Next(-25, 26) * 0.05f, Main.rand.Next(-25, 26) * 0.05f); Projectile shard = Projectile.NewProjectileDirect(source, position, velocity + offset, ProjectileID.BlackBolt, shardDamage, shardKB, player.whoAmI, 0f, 0f); shard.timeLeft = (int)(shard.timeLeft * 1.25f); diff --git a/Items/Weapons/Ranged/Onyxia.cs b/Items/Weapons/Ranged/Onyxia.cs index d2cf4b09ed..df5955ea21 100644 --- a/Items/Weapons/Ranged/Onyxia.cs +++ b/Items/Weapons/Ranged/Onyxia.cs @@ -1,4 +1,4 @@ -using Terraria.DataStructures; +using Terraria.DataStructures; using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; @@ -47,12 +47,10 @@ namespace CalamityMod.Items.Weapons.Ranged public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - - // Fire the Onyx Shard that is characteristic of the Onyx Blaster // The shard deals 145% damage and double knockback int shardDamage = (int)(1.45f * damage); - float shardKB = 2f * knockBack; + float shardKB = 2f * knockback; Projectile shard = Projectile.NewProjectileDirect(source, position, velocity, ProjectileID.BlackBolt, shardDamage, shardKB, player.whoAmI, 0f, 0f); shard.timeLeft = (int)(shard.timeLeft * 1.4f); diff --git a/Items/Weapons/Ranged/TheStorm.cs b/Items/Weapons/Ranged/TheStorm.cs index 793e842d24..4ba24ccecb 100644 --- a/Items/Weapons/Ranged/TheStorm.cs +++ b/Items/Weapons/Ranged/TheStorm.cs @@ -1,4 +1,4 @@ -using Terraria.DataStructures; +using Terraria.DataStructures; using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using System; @@ -42,8 +42,6 @@ namespace CalamityMod.Items.Weapons.Ranged { int i = Main.myPlayer; float num72 = Main.rand.Next(25, 30); - float num74 = knockBack; - num74 = player.GetWeaponKnockback(Item, num74); player.itemTime = Item.useTime; Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; @@ -88,17 +86,17 @@ namespace CalamityMod.Items.Weapons.Ranged float speedY5 = num79 + (float)Main.rand.Next(-120, 121) * 0.01f; if (type == ProjectileID.WoodenArrowFriendly) { - Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5 * 0.9f, ModContent.ProjectileType(), damage, num74, i); - Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5 * 0.8f, ModContent.ProjectileType(), damage, num74, i); - Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5 * 0.7f, ModContent.ProjectileType(), damage, num74, i); + Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5 * 0.9f, ModContent.ProjectileType(), damage, knockback, i); + Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5 * 0.8f, ModContent.ProjectileType(), damage, knockback, i); + Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5 * 0.7f, ModContent.ProjectileType(), damage, knockback, i); } else { - int num121 = Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5 * 0.9f, type, damage, num74, i); + int num121 = Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5 * 0.9f, type, damage, knockback, i); Main.projectile[num121].noDropItem = true; - int num122 = Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5 * 0.8f, type, damage, num74, i); + int num122 = Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5 * 0.8f, type, damage, knockback, i); Main.projectile[num122].noDropItem = true; - int num123 = Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5 * 0.7f, type, damage, num74, i); + int num123 = Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5 * 0.7f, type, damage, knockback, i); Main.projectile[num123].noDropItem = true; } } diff --git a/Items/Weapons/Ranged/Triploon.cs b/Items/Weapons/Ranged/Triploon.cs index b95bc53238..d4425d8635 100644 --- a/Items/Weapons/Ranged/Triploon.cs +++ b/Items/Weapons/Ranged/Triploon.cs @@ -1,4 +1,4 @@ -using Terraria.DataStructures; +using Terraria.DataStructures; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using CalamityMod.Projectiles.Ranged; @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Vector2 source = player.RotatedRelativePoint(player.MountedCenter, true); + Vector2 center = player.RotatedRelativePoint(player.MountedCenter, true); float piOverTen = MathHelper.Pi * 0.1f; int projCount = 3; @@ -59,7 +59,7 @@ namespace CalamityMod.Items.Weapons.Ranged { offset -= velocity; } - Projectile.NewProjectile(source.X + offset.X, source.Y + offset.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(source, center.X + offset.X, center.Y + offset.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI, 0f, 0f); } return false; } diff --git a/Items/Weapons/Rogue/AuroradicalThrow.cs b/Items/Weapons/Rogue/AuroradicalThrow.cs index acd4306b09..9e864edf00 100644 --- a/Items/Weapons/Rogue/AuroradicalThrow.cs +++ b/Items/Weapons/Rogue/AuroradicalThrow.cs @@ -1,10 +1,11 @@ -using Terraria.DataStructures; +using Terraria.DataStructures; using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using Terraria.GameContent; namespace CalamityMod.Items.Weapons.Rogue { @@ -51,7 +52,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, Main.itemTexture[Item.type]); + Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, TextureAssets.Item[Item.type].Value); } } } diff --git a/Items/Weapons/Rogue/CorpusAvertor.cs b/Items/Weapons/Rogue/CorpusAvertor.cs index fad1b15fc4..b6c8a08f21 100644 --- a/Items/Weapons/Rogue/CorpusAvertor.cs +++ b/Items/Weapons/Rogue/CorpusAvertor.cs @@ -1,4 +1,4 @@ -using Terraria.DataStructures; +using Terraria.DataStructures; using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Weapons.Rogue } // Gains 10% of missing health as base damage. - public override void SafeModifyWeaponDamage(Player player, ref float add, ref float mult, ref float flat) + public override void SafeModifyWeaponDamage(Player player, ref StatModifier damage, ref float flat) { int lifeAmount = player.statLifeMax2 - player.statLife; flat += lifeAmount * 0.1f * player.RogueDamage(); diff --git a/Items/Weapons/Rogue/DeepSeaDumbbell.cs b/Items/Weapons/Rogue/DeepSeaDumbbell.cs index 51769bcbf0..e173a12edd 100644 --- a/Items/Weapons/Rogue/DeepSeaDumbbell.cs +++ b/Items/Weapons/Rogue/DeepSeaDumbbell.cs @@ -1,4 +1,4 @@ -using Terraria.DataStructures; +using Terraria.DataStructures; using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; @@ -68,9 +68,9 @@ namespace CalamityMod.Items.Weapons.Rogue public override float SafeSetUseTimeMultiplier(Player player) => player.altFunctionUse == 2 ? 5f / 9f : 1f; - public override void SafeModifyWeaponDamage(Player player, ref float add, ref float mult, ref float flat) + public override void SafeModifyWeaponDamage(Player player, ref StatModifier damage, ref float flat) { - mult += flexMult - 1f; + damage *= flexMult; } // Reset flex multiplier on direct hits. diff --git a/Items/Weapons/Rogue/Nychthemeron.cs b/Items/Weapons/Rogue/Nychthemeron.cs index 689ed2027e..9ca4c9c744 100644 --- a/Items/Weapons/Rogue/Nychthemeron.cs +++ b/Items/Weapons/Rogue/Nychthemeron.cs @@ -1,4 +1,4 @@ -using Terraria.DataStructures; +using Terraria.DataStructures; using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using System; @@ -69,7 +69,7 @@ namespace CalamityMod.Items.Weapons.Rogue p.Calamity().stealthStrike = true; int pID = p.identity; - CreateOrbs(position, (int)(orbDamage * 0.675f), knockback, pID, player, true); + CreateOrbs(source, position, (int)(orbDamage * 0.675f), knockback, pID, player, true); } } else @@ -77,7 +77,7 @@ namespace CalamityMod.Items.Weapons.Rogue int pIndex = Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI, 0f, 1f); int pID = Main.projectile[pIndex].identity; - CreateOrbs(position, orbDamage, knockback, pID, player, false); + CreateOrbs(source, position, orbDamage, knockback, pID, player, false); } return false; } @@ -104,7 +104,7 @@ namespace CalamityMod.Items.Weapons.Rogue CreateRecipe(1).AddIngredient(ItemID.SpikyBall, 30).AddIngredient(ItemID.LightShard).AddIngredient(ItemID.DarkShard).AddRecipeGroup("AnyMythrilBar", 2).AddTile(TileID.MythrilAnvil).Register(); } - private static void CreateOrbs(Vector2 position, int damage, float knockback, int projectileID, Player player, bool stealth) + private static void CreateOrbs(IEntitySource source, Vector2 position, int damage, float knockback, int projectileID, Player player, bool stealth) { float rotationOffset = 0f; @@ -150,6 +150,7 @@ namespace CalamityMod.Items.Weapons.Rogue rotationOffset += MathHelper.ToRadians(72f); } + int orb1 = Projectile.NewProjectile(source, position, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, player.whoAmI, orb1Col, projectileID); int orb2 = Projectile.NewProjectile(source, position, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, player.whoAmI, orb2Col, projectileID); if (orb1.WithinBounds(Main.maxProjectiles)) diff --git a/Items/Weapons/Rogue/RogueWeapon.cs b/Items/Weapons/Rogue/RogueWeapon.cs index 9d1a7334df..9d3ce03411 100644 --- a/Items/Weapons/Rogue/RogueWeapon.cs +++ b/Items/Weapons/Rogue/RogueWeapon.cs @@ -1,4 +1,4 @@ -using Terraria.DataStructures; +using Terraria.DataStructures; using CalamityMod.CalPlayer; using System; using System.Collections.Generic; @@ -6,6 +6,7 @@ using System.Linq; using Terraria; using Terraria.ModLoader; using Terraria.Utilities; +using CalamityMod.Prefixes; namespace CalamityMod.Items.Weapons.Rogue { @@ -32,26 +33,26 @@ namespace CalamityMod.Items.Weapons.Rogue public override int ChoosePrefix(UnifiedRandom rand) { WeightedRandom newPrefix = new WeightedRandom(); - newPrefix.Add("Pointy", 1); - newPrefix.Add("Sharp", 1); - newPrefix.Add("Feathered", 1); - newPrefix.Add("Sleek", 1); - newPrefix.Add("Hefty", 1); - newPrefix.Add("Mighty", 1); - newPrefix.Add("Glorious", 1); - newPrefix.Add("Serrated", 1); - newPrefix.Add("Vicious", 1); - newPrefix.Add("Lethal", 1); - newPrefix.Add("Flawless", 1); - newPrefix.Add("Radical", 1); - newPrefix.Add("Blunt", 1); - newPrefix.Add("Flimsy", 1); - newPrefix.Add("Unbalanced", 1); - newPrefix.Add("Atrocious", 1); - return Mod.GetPrefix(newPrefix).Type; + newPrefix.Add("CalamityMod/Prefixes/PointyWeaponPrefix", 1); + newPrefix.Add("CalamityMod/Prefixes/SharpWeaponPrefix", 1); + newPrefix.Add("CalamityMod/Prefixes/FeatheredWeaponPrefix", 1); + newPrefix.Add("CalamityMod/Prefixes/SleekWeaponPrefix", 1); + newPrefix.Add("CalamityMod/Prefixes/HeftyWeaponPrefix", 1); + newPrefix.Add("CalamityMod/Prefixes/MightyWeaponPrefix", 1); + newPrefix.Add("CalamityMod/Prefixes/GloriousWeaponPrefix", 1); + newPrefix.Add("CalamityMod/Prefixes/SerratedWeaponPrefix", 1); + newPrefix.Add("CalamityMod/Prefixes/ViciousWeaponPrefix", 1); + newPrefix.Add("CalamityMod/Prefixes/LethalWeaponPrefix", 1); + newPrefix.Add("CalamityMod/Prefixes/FlawlessWeaponPrefix", 1); + newPrefix.Add("CalamityMod/Prefixes/RadicalWeaponPrefix", 1); + newPrefix.Add("CalamityMod/Prefixes/BluntWeaponPrefix", 1); + newPrefix.Add("CalamityMod/Prefixes/FlimsyWeaponPrefix", 1); + newPrefix.Add("CalamityMod/Prefixes/UnbalancedWeaponPrefix", 1); + newPrefix.Add("CalamityMod/Prefixes/AtrociousWeaponPrefix", 1); + return ModContent.Find(newPrefix.Get()).Type; } - public override bool NewPreReforge() + public override bool PreReforge() { StealthStrikePrefixBonus = 1f; return true; @@ -79,21 +80,21 @@ namespace CalamityMod.Items.Weapons.Rogue // Add both the player's dedicated rogue damage and stealth strike damage as applicable. // Rogue weapons are internally throwing so they already benefit from throwing damage boosts. // 5E-06 to prevent downrounding is not needed anymore, added by TML itself - public sealed override void ModifyWeaponDamage(Player player, ref float add, ref float mult, ref float flat) + public sealed override void ModifyWeaponDamage(Player player, ref StatModifier damage, ref float flat) { CalamityPlayer mp = player.Calamity(); - SafeModifyWeaponDamage(player, ref add, ref mult, ref flat); + SafeModifyWeaponDamage(player, ref damage, ref flat); // Both regular rogue damage stat and stealth damage are added to the weapon simultaneously. - add += mp.throwingDamage + mp.stealthDamage - 1f; + damage += mp.throwingDamage + mp.stealthDamage - 1f; // Boost (or lower) the weapon's damage if it has a stealth strike available and an associated prefix if (mp.StealthStrikeAvailable() && Item.prefix > 0) - mult += StealthStrikePrefixBonus - 1f; + damage *= StealthStrikePrefixBonus; } - public virtual void SafeModifyWeaponDamage(Player player, ref float add, ref float mult, ref float flat) { } + public virtual void SafeModifyWeaponDamage(Player player, ref StatModifier damage, ref float flat) { } // Simply add the player's dedicated rogue crit chance. // Rogue crit isn't boosted by Calamity universal crit boosts, so this won't double-add universal crit. @@ -138,7 +139,7 @@ namespace CalamityMod.Items.Weapons.Rogue string restOfTooltip = text.Substring(damageNumberSubstringIndex); int damageWithStealth = int.Parse(text.Substring(0, damageNumberSubstringIndex)); - int damageWithoutStealth = (int)(Item.damage * (p.GetDamage() + p.GetDamage(DamageClass.Throwing) + mp.throwingDamage - 2f)); + int damageWithoutStealth = (int)(Item.damage * (p.GetDamage().Additive + p.GetDamage(DamageClass.Throwing).Additive + mp.throwingDamage - 2f)); text = damageWithoutStealth + restOfTooltip + " : " + damageWithStealth + " stealth strike damage"; } } @@ -156,8 +157,8 @@ namespace CalamityMod.Items.Weapons.Rogue string txt = (badModifier ? "-" : "+") + Math.Round(Math.Abs(ssDmgBoost) * 100f) + "% stealth strike damage"; TooltipLine stealthTooltip = new TooltipLine(Mod, "PrefixSSDmg", txt) { - isModifier = true, - isModifierBad = badModifier + IsModifier = true, + IsModifierBad = badModifier }; tooltips.Add(stealthTooltip); } diff --git a/NPCs/ExoMechs/Apollo/Apollo.cs b/NPCs/ExoMechs/Apollo/Apollo.cs index 104fd82825..e473bbe4fb 100644 --- a/NPCs/ExoMechs/Apollo/Apollo.cs +++ b/NPCs/ExoMechs/Apollo/Apollo.cs @@ -150,7 +150,6 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo NPC.netAlways = true; NPC.boss = true; Music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; - bossBag = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; } diff --git a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs index 2b3a159a2b..81b61a37e6 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs @@ -141,7 +141,6 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos NPC.boss = true; NPC.chaseable = false; Music = CalamityMod.Instance.GetMusicFromMusicMod("ExoMechs") ?? MusicID.Boss3; - bossBag = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; } diff --git a/NPCs/Leviathan/AquaticAberration.cs b/NPCs/Leviathan/AquaticAberration.cs index abad737887..4aac8cfde6 100644 --- a/NPCs/Leviathan/AquaticAberration.cs +++ b/NPCs/Leviathan/AquaticAberration.cs @@ -234,7 +234,7 @@ namespace CalamityMod.NPCs.Leviathan { int closestPlayer = Player.FindClosest(NPC.Center, 1, 1); if (Main.rand.Next(4) == 0 && Main.player[closestPlayer].statLife < Main.player[closestPlayer].statLifeMax2) - Item.NewItem((int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); + Item.NewItem(NPC.GetItemSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); } } diff --git a/NPCs/Leviathan/Leviathan.cs b/NPCs/Leviathan/Leviathan.cs index b569d00f7f..dcc6c36cd2 100644 --- a/NPCs/Leviathan/Leviathan.cs +++ b/NPCs/Leviathan/Leviathan.cs @@ -67,7 +67,6 @@ namespace CalamityMod.NPCs.Leviathan NPC.boss = true; NPC.netAlways = true; Music = CalamityMod.Instance.GetMusicFromMusicMod("LeviathanAndAnahita") ?? MusicID.Boss3; - bossBag = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; diff --git a/NPCs/NormalNPCs/WulfrumPylon.cs b/NPCs/NormalNPCs/WulfrumPylon.cs index b88c813fa3..9753ca3385 100644 --- a/NPCs/NormalNPCs/WulfrumPylon.cs +++ b/NPCs/NormalNPCs/WulfrumPylon.cs @@ -159,7 +159,7 @@ namespace CalamityMod.NPCs.NormalNPCs return 0f; // Spawn less frequently in the inner third of the world. - if (spawnInfo.playerFloorX > Main.maxTilesX * 0.333f && spawnInfo.playerFloorX < Main.maxTilesX - Main.maxTilesX * 0.333f) + if (spawnInfo.PlayerFloorX > Main.maxTilesX * 0.333f && spawnInfo.PlayerFloorX < Main.maxTilesX - Main.maxTilesX * 0.333f) return SpawnCondition.OverworldDaySlime.Chance * (Main.hardMode ? 0.01f : 0.06f) * pylonMult; return SpawnCondition.OverworldDaySlime.Chance * (Main.hardMode ? 0.033f : 0.15f) * pylonMult; diff --git a/NPCs/Polterghast/Polterghast.cs b/NPCs/Polterghast/Polterghast.cs index 0ed7793426..372cb1ccf6 100644 --- a/NPCs/Polterghast/Polterghast.cs +++ b/NPCs/Polterghast/Polterghast.cs @@ -78,7 +78,6 @@ namespace CalamityMod.NPCs.Polterghast Music = CalamityMod.Instance.GetMusicFromMusicMod("Polterghast") ?? MusicID.Plantera; NPC.HitSound = SoundID.NPCHit7; NPC.DeathSound = SoundID.NPCDeath39; - bossBag = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; } diff --git a/NPCs/StormWeaver/StormWeaverHead.cs b/NPCs/StormWeaver/StormWeaverHead.cs index 0ce415a858..c0c329555c 100644 --- a/NPCs/StormWeaver/StormWeaverHead.cs +++ b/NPCs/StormWeaver/StormWeaverHead.cs @@ -97,7 +97,6 @@ namespace CalamityMod.NPCs.StormWeaver NPC.noGravity = true; NPC.noTileCollide = true; NPC.netAlways = true; - bossBag = ModContent.ItemType(); if (CalamityWorld.malice || BossRushEvent.BossRushActive) NPC.scale = 1.25f; diff --git a/NPCs/TownNPCs/WITCH.cs b/NPCs/TownNPCs/WITCH.cs index 1a3dab129f..44b47ab1de 100644 --- a/NPCs/TownNPCs/WITCH.cs +++ b/NPCs/TownNPCs/WITCH.cs @@ -143,7 +143,7 @@ namespace CalamityMod.NPCs.TownNPCs if (!Main.LocalPlayer.Calamity().GivenBrimstoneLocus) { - Item.NewItem(NPC.GetItemSource_Loot(), NPC, ItemType()); + Item.NewItem(NPC.GetItemSource_Loot(), NPC.Hitbox, ItemType()); Main.LocalPlayer.Calamity().GivenBrimstoneLocus = true; } diff --git a/Projectiles/Boss/IchorBlob.cs b/Projectiles/Boss/IchorBlob.cs index f829b83bf9..fc60852c69 100644 --- a/Projectiles/Boss/IchorBlob.cs +++ b/Projectiles/Boss/IchorBlob.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using System.IO; @@ -164,7 +164,7 @@ namespace CalamityMod.Projectiles.Boss } } - public override bool TileCollideStyle(ref int width, ref int height, ref bool fallThrough) + public override bool TileCollideStyle(ref int width, ref int height, ref bool fallThrough, ref Vector2 hitboxCenterFrac) { fallThrough = false; return true; diff --git a/Projectiles/Magic/Ancient2.cs b/Projectiles/Magic/Ancient2.cs index 19dc70dd77..f2e6971180 100644 --- a/Projectiles/Magic/Ancient2.cs +++ b/Projectiles/Magic/Ancient2.cs @@ -1,4 +1,4 @@ -using CalamityMod.DataStructures; +using CalamityMod.DataStructures; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -90,10 +90,6 @@ namespace CalamityMod.Projectiles.Magic int frameHeight = height * Projectile.frame; Rectangle rectangle = new Rectangle(0, frameHeight, texture.Width, height); Vector2 origin = new Vector2(texture.Width / 2f, height / 2f); - SpriteEffects spriteEffects = SpriteEffects.None; - if (Projectile.spriteDirection == -1) - spriteEffects = SpriteEffects.FlipHorizontally; - Main.EntitySpriteDraw(texture, drawPos, new Microsoft.Xna.Framework.Rectangle?(rectangle), lightColor, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); // Dust effects diff --git a/Projectiles/Magic/ApotheosisWorm.cs b/Projectiles/Magic/ApotheosisWorm.cs index 2447dfd924..1f1e6a8a7e 100644 --- a/Projectiles/Magic/ApotheosisWorm.cs +++ b/Projectiles/Magic/ApotheosisWorm.cs @@ -265,11 +265,11 @@ namespace CalamityMod.Projectiles.Magic drawPosition -= headTexture.Size() * Projectile.scale * 0.5f; drawPosition += headTextureOrigin * Projectile.scale + new Vector2(0f, 4f + Projectile.gfxOffY); - Texture2D jawTexture = ModContent.Request("CalamityMod/Projectiles/Magic/ApotheosisJaw").Valie; + Texture2D jawTexture = ModContent.Request("CalamityMod/Projectiles/Magic/ApotheosisJaw").Value; Vector2 jawOrigin = jawTexture.Size() * 0.5f; // Segment drawing. - Texture2D bodyTexture = ModContent.Request("CalamityMod/NPCs/DevourerofGods/DevourerofGodsBodyS").Valie; + Texture2D bodyTexture = ModContent.Request("CalamityMod/NPCs/DevourerofGods/DevourerofGodsBodyS").Value; Texture2D tailTexture = ModContent.Request("CalamityMod/NPCs/DevourerofGods/DevourerofGodsTailS").Value; // Not white to differentiate itself slightly from regular DoG when fighting Boss Rush. diff --git a/Projectiles/Magic/BeamingBolt.cs b/Projectiles/Magic/BeamingBolt.cs index 5bdd900546..541f31d249 100644 --- a/Projectiles/Magic/BeamingBolt.cs +++ b/Projectiles/Magic/BeamingBolt.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Magic { Texture2D tex = ModContent.Request(Texture).Value; if (Projectile.ai[0] == 1f) - tex = ModContent.Request("CalamityMod/Projectiles/Magic/BeamingThornBlossom"); + tex = ModContent.Request("CalamityMod/Projectiles/Magic/BeamingThornBlossom").Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Magic/MeteorStar.cs b/Projectiles/Magic/MeteorStar.cs index b4883414ad..9a4949ff16 100644 --- a/Projectiles/Magic/MeteorStar.cs +++ b/Projectiles/Magic/MeteorStar.cs @@ -175,10 +175,6 @@ namespace CalamityMod.Projectiles.Magic Rectangle rectangle = new Rectangle(0, frameY, texture.Width, frameHeight); 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, Color.White, rotation, origin, scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Magic/NebulaElementalBeam.cs b/Projectiles/Magic/NebulaElementalBeam.cs index a2518816ed..c434fb664e 100644 --- a/Projectiles/Magic/NebulaElementalBeam.cs +++ b/Projectiles/Magic/NebulaElementalBeam.cs @@ -56,9 +56,9 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - DrawBeamWithColor(Main.spriteBatch, new Color(190, 29, 209), Projectile.scale); - DrawBeamWithColor(Main.spriteBatch, Color.Lerp(new Color(254, 126, 229), Color.Transparent, 0.35f), Projectile.scale * 0.6f); - DrawBeamWithColor(Main.spriteBatch, Color.Lerp(new Color(254, 190, 243), Color.Transparent, 0.35f), Projectile.scale * 0.6f); + DrawBeamWithColor(new Color(190, 29, 209), Projectile.scale); + DrawBeamWithColor(Color.Lerp(new Color(254, 126, 229), Color.Transparent, 0.35f), Projectile.scale * 0.6f); + DrawBeamWithColor(Color.Lerp(new Color(254, 190, 243), Color.Transparent, 0.35f), Projectile.scale * 0.6f); return false; } } diff --git a/Projectiles/Magic/SirensSongNote.cs b/Projectiles/Magic/SirensSongNote.cs index 918ce97d86..bff5b54a3e 100644 --- a/Projectiles/Magic/SirensSongNote.cs +++ b/Projectiles/Magic/SirensSongNote.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Magic if (Projectile.ai[1] == 0f) { Projectile.ai[1] = 1f; - Main.harpNote = Projectile.ai[0]; + Main.musicPitch = Projectile.ai[0]; SoundEngine.PlaySound(SoundID.Item26, Projectile.position); } diff --git a/Projectiles/Magic/SlitheringEelProjectile.cs b/Projectiles/Magic/SlitheringEelProjectile.cs index 5abd564e67..2bbbb36dc0 100644 --- a/Projectiles/Magic/SlitheringEelProjectile.cs +++ b/Projectiles/Magic/SlitheringEelProjectile.cs @@ -99,10 +99,10 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { - Texture2D headTexture = ModContent.Request("CalamityMod/Projectiles/Magic/SlitheringEelProjectile"); - Texture2D bodyTexture = ModContent.Request("CalamityMod/Projectiles/Magic/SlitheringEelBody"); - Texture2D bodyTexture2 = ModContent.Request("CalamityMod/Projectiles/Magic/SlitheringEelBody2"); - Texture2D tailTexture = ModContent.Request("CalamityMod/Projectiles/Magic/SlitheringEelTail"); + Texture2D headTexture = ModContent.Request("CalamityMod/Projectiles/Magic/SlitheringEelProjectile").Value; + Texture2D bodyTexture = ModContent.Request("CalamityMod/Projectiles/Magic/SlitheringEelBody").Value; + Texture2D bodyTexture2 = ModContent.Request("CalamityMod/Projectiles/Magic/SlitheringEelBody2").Value; + Texture2D tailTexture = ModContent.Request("CalamityMod/Projectiles/Magic/SlitheringEelTail").Value; Vector2 drawPosition; lightColor = new Color(255, 255, 255, 127); diff --git a/Projectiles/Magic/SpiritCongregation.cs b/Projectiles/Magic/SpiritCongregation.cs index 33cb16170f..a9fb65d331 100644 --- a/Projectiles/Magic/SpiritCongregation.cs +++ b/Projectiles/Magic/SpiritCongregation.cs @@ -262,14 +262,14 @@ namespace CalamityMod.Projectiles.Magic int maxFrame = CurrentPower <= LargeMouthPowerLowerBound ? 6 : 9; Vector2 backgroundOffset = Vector2.UnitX * Main.GlobalTimeWrappedHourly * maxFrame * 0.03f; Texture2D texture = ModContent.Request(Texture).Value; - Texture2D backTexture = ModContent.Request("CalamityMod/Projectiles/Magic/SpiritCongregationBack"); - Texture2D auraTexture = ModContent.Request("CalamityMod/Projectiles/Magic/SpiritCongregationAura"); - Texture2D backgroundTexture = ModContent.Request("CalamityMod/ExtraTextures/ParticleBackgrounds/GruesomeEminence_Ghost_Layer1"); + Texture2D backTexture = ModContent.Request("CalamityMod/Projectiles/Magic/SpiritCongregationBack").Value; + Texture2D auraTexture = ModContent.Request("CalamityMod/Projectiles/Magic/SpiritCongregationAura").Value; + Texture2D backgroundTexture = ModContent.Request("CalamityMod/ExtraTextures/ParticleBackgrounds/GruesomeEminence_Ghost_Layer1").Value; if (CurrentPower > LargeMouthPowerLowerBound) { - texture = ModContent.Request("CalamityMod/Projectiles/Magic/SpiritCongregationBig"); - backTexture = ModContent.Request("CalamityMod/Projectiles/Magic/SpiritCongregationBackBig"); - auraTexture = ModContent.Request("CalamityMod/Projectiles/Magic/SpiritCongregationAuraBig"); + texture = ModContent.Request("CalamityMod/Projectiles/Magic/SpiritCongregationBig").Value; + backTexture = ModContent.Request("CalamityMod/Projectiles/Magic/SpiritCongregationBackBig").Value; + auraTexture = ModContent.Request("CalamityMod/Projectiles/Magic/SpiritCongregationAuraBig").Value; } Effect shader = GameShaders.Misc["CalamityMod:BaseFusableParticleEdge"].Shader; @@ -284,7 +284,7 @@ namespace CalamityMod.Projectiles.Magic // Draw the outline aura below everything else. Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, Main.DefaultSamplerState, DepthStencilState.None, Main.instance.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); ; + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); ; for (int i = 0; i < 3; i++) Main.EntitySpriteDraw(auraTexture, drawPosition, frame, auraColor, Projectile.rotation, origin, Projectile.scale, direction, 0); @@ -293,7 +293,7 @@ namespace CalamityMod.Projectiles.Magic // Draw the back with the specified shader. Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.instance.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); shader.Parameters["edgeBorderSize"].SetValue(0f); shader.Parameters["borderShouldBeSolid"].SetValue(FusableParticleManager.GetParticleSetByType().BorderShouldBeSolid); diff --git a/Projectiles/Magic/SubsumingTentacle.cs b/Projectiles/Magic/SubsumingTentacle.cs index f65851cc19..9f8babdd0b 100644 --- a/Projectiles/Magic/SubsumingTentacle.cs +++ b/Projectiles/Magic/SubsumingTentacle.cs @@ -111,21 +111,21 @@ namespace CalamityMod.Projectiles.Magic public override bool PreDraw(ref Color lightColor) { Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.instance.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); if (Projectile.scale < 1f) { for (int i = 10; i < Projectile.oldPos.Length; i++) { var tentacleShader = GameShaders.Misc["CalamityMod:SubsumingTentacle"]; - tentacleShader.UseImage("Images/Misc/Perlin"); + tentacleShader.UseImage0("Images/Misc/Perlin"); Vector2 drawPos = Projectile.oldPos[i] + ModContent.Request(Texture).Size() / 2f - Main.screenPosition + Projectile.gfxOffY * Vector2.UnitY; float scale = MathHelper.Lerp(0.05f, 1.3f, i / (float)Projectile.oldPos.Length) * Projectile.scale; scale = MathHelper.Clamp(scale, 0f, 2f); Color color = Projectile.GetAlpha(lightColor) * ((Projectile.oldPos.Length - i) / Projectile.oldPos.Length); - Main.EntitySpriteDraw(ModContent.Request(Texture), drawPos, null, color, Projectile.rotation, ModContent.Request(Texture).Size() / 2f, scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(ModContent.Request(Texture).Value, drawPos, null, color, Projectile.rotation, ModContent.Request(Texture).Size() / 2f, scale, SpriteEffects.None, 0); tentacleShader.UseSaturation(i / (float)Projectile.oldPos.Length); // A "completion ratio" for the shader. Used to make the entire tentacle appear multi-colored. tentacleShader.UseOpacity(1f / Projectile.oldPos.Length); // A "step value" for the shader. Used to give variance in color at each individual segment. tentacleShader.Apply(null); @@ -136,7 +136,7 @@ namespace CalamityMod.Projectiles.Magic public override void PostDraw(Color drawColor) { Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.instance.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) diff --git a/Projectiles/Magic/WaterLeechProj.cs b/Projectiles/Magic/WaterLeechProj.cs index 4d3cc09c4a..fc0cb6c61d 100644 --- a/Projectiles/Magic/WaterLeechProj.cs +++ b/Projectiles/Magic/WaterLeechProj.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -82,7 +82,7 @@ namespace CalamityMod.Projectiles.Magic if (Projectile.spriteDirection == -1) spriteEffects = SpriteEffects.FlipHorizontally; - Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, drawStart, texture.Width, height)), Color.White, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, drawStart, texture.Width, height)), Color.White, Projectile.rotation, origin, Projectile.scale, spriteEffects, 0); return false; } @@ -96,7 +96,7 @@ namespace CalamityMod.Projectiles.Magic if (Projectile.spriteDirection == -1) spriteEffects = SpriteEffects.FlipHorizontally; - Main.EntitySpriteDraw(ModContent.Request("CalamityMod/NPCs/AcidRain/WaterLeechGlow"), Projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, drawStart, texture.Width, height)), Color.White, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(ModContent.Request("CalamityMod/NPCs/AcidRain/WaterLeechGlow").Value, Projectile.Center - Main.screenPosition, new Rectangle(0, drawStart, texture.Width, height), Color.White, Projectile.rotation, origin, Projectile.scale, spriteEffects, 0); } public override void Kill(int timeLeft) diff --git a/Projectiles/Melee/ArkOfTheCosmos_BlastAttack.cs b/Projectiles/Melee/ArkOfTheCosmos_BlastAttack.cs index 2a6692ef1b..5a08f8a306 100644 --- a/Projectiles/Melee/ArkOfTheCosmos_BlastAttack.cs +++ b/Projectiles/Melee/ArkOfTheCosmos_BlastAttack.cs @@ -1,4 +1,4 @@ -using CalamityMod.Particles; +using CalamityMod.Particles; using CalamityMod.Items.Weapons.Melee; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -175,7 +175,7 @@ namespace CalamityMod.Projectiles.Melee for (int i = 0; i < 5; i++) { var source = Projectile.GetProjectileSource_FromThis(); - Projectile blast = Projectile.NewProjectileDirect(Projectile.GetProjectileSource_FromThis(), source, Owner.Center, Main.rand.NextVector2CircularEdge(28, 28), ProjectileType(), (int)(ArkoftheCosmos.SlashBoltsDamageMultiplier * Projectile.damage), 0f, Owner.whoAmI, 0.55f, MathHelper.Pi * 0.07f); + Projectile blast = Projectile.NewProjectileDirect(source, Owner.Center, Main.rand.NextVector2CircularEdge(28, 28), ProjectileType(), (int)(ArkoftheCosmos.SlashBoltsDamageMultiplier * Projectile.damage), 0f, Owner.whoAmI, 0.55f, MathHelper.Pi * 0.07f); { blast.timeLeft = 100; } diff --git a/Projectiles/Melee/ArkOfTheCosmos_SwungBlade.cs b/Projectiles/Melee/ArkOfTheCosmos_SwungBlade.cs index 2c39c298bf..c8655b0cf2 100644 --- a/Projectiles/Melee/ArkOfTheCosmos_SwungBlade.cs +++ b/Projectiles/Melee/ArkOfTheCosmos_SwungBlade.cs @@ -1,4 +1,4 @@ -using CalamityMod.Particles; +using CalamityMod.Particles; using CalamityMod.Items.Weapons.Melee; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -184,7 +184,7 @@ namespace CalamityMod.Projectiles.Melee float adjustedBlastRotation = Projectile.rotation - MathHelper.PiOver4 * 1.15f * Owner.direction; var source = Projectile.GetProjectileSource_FromThis(); - Projectile blast = Projectile.NewProjectileDirect(Projectile.GetProjectileSource_FromThis(), source, Owner.Center + adjustedBlastRotation.ToRotationVector2() * 10f, adjustedBlastRotation.ToRotationVector2() * 20f, ProjectileType(), (int)(ArkoftheCosmos.SwirlBoltDamageMultiplier / ArkoftheCosmos.SwirlBoltAmount * Projectile.damage), 0f, Owner.whoAmI, 0.55f, MathHelper.Pi * 0.05f); + Projectile blast = Projectile.NewProjectileDirect(source, Owner.Center + adjustedBlastRotation.ToRotationVector2() * 10f, adjustedBlastRotation.ToRotationVector2() * 20f, ProjectileType(), (int)(ArkoftheCosmos.SwirlBoltDamageMultiplier / ArkoftheCosmos.SwirlBoltAmount * Projectile.damage), 0f, Owner.whoAmI, 0.55f, MathHelper.Pi * 0.05f); { blast.timeLeft = 100; } @@ -206,7 +206,7 @@ namespace CalamityMod.Projectiles.Melee //Spawn a constellation link var source = Projectile.GetProjectileSource_FromThis(); - Projectile chain = Projectile.NewProjectileDirect(Projectile.GetProjectileSource_FromThis(), source, Owner.Center, Vector2.Zero, ProjectileType(), (int)(Projectile.damage * ArkoftheCosmos.chainDamageMultiplier), 0, Owner.whoAmI, (int)(Projectile.timeLeft / 2f)); + Projectile chain = Projectile.NewProjectileDirect(source, Owner.Center, Vector2.Zero, ProjectileType(), (int)(Projectile.damage * ArkoftheCosmos.chainDamageMultiplier), 0, Owner.whoAmI, (int)(Projectile.timeLeft / 2f)); chain.timeLeft = (int)(Projectile.timeLeft / 2f); } @@ -244,7 +244,7 @@ namespace CalamityMod.Projectiles.Melee for (int i = 0; i < 3; i++) { var source = Projectile.GetProjectileSource_FromThis(); - Projectile blast = Projectile.NewProjectileDirect(Projectile.GetProjectileSource_FromThis(), source, Projectile.Center + (MathHelper.TwoPi * (i / 3f) + rotationOffset).ToRotationVector2() * 30f, (MathHelper.TwoPi * (i / 3f) + rotationOffset).ToRotationVector2() * 20f, ProjectileType(), (int)(ArkoftheCosmos.SnapBoltsDamageMultiplier * Projectile.damage), 0f, Owner.whoAmI, 0.55f, MathHelper.Pi * 0.05f); + Projectile blast = Projectile.NewProjectileDirect(source, Projectile.Center + (MathHelper.TwoPi * (i / 3f) + rotationOffset).ToRotationVector2() * 30f, (MathHelper.TwoPi * (i / 3f) + rotationOffset).ToRotationVector2() * 20f, ProjectileType(), (int)(ArkoftheCosmos.SnapBoltsDamageMultiplier * Projectile.damage), 0f, Owner.whoAmI, 0.55f, MathHelper.Pi * 0.05f); { blast.timeLeft = 100; } diff --git a/Projectiles/Melee/DragonRageStaff.cs b/Projectiles/Melee/DragonRageStaff.cs index 41cac79988..3f15171cde 100644 --- a/Projectiles/Melee/DragonRageStaff.cs +++ b/Projectiles/Melee/DragonRageStaff.cs @@ -261,7 +261,7 @@ namespace CalamityMod.Projectiles.Melee if (Projectile.spriteDirection == -1) spriteEffects = SpriteEffects.FlipHorizontally; - Main.EntitySpriteDraw(tex, drawPos, new Microsoft.Xna.Framework.Rectangle?(rectangle), lightColor, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(tex, drawPos, new Microsoft.Xna.Framework.Rectangle?(rectangle), lightColor, Projectile.rotation, origin, Projectile.scale, spriteEffects, 0); return false; } } diff --git a/Projectiles/Melee/ExcelsusBlue.cs b/Projectiles/Melee/ExcelsusBlue.cs index e38160d95f..493e49eee8 100644 --- a/Projectiles/Melee/ExcelsusBlue.cs +++ b/Projectiles/Melee/ExcelsusBlue.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; @@ -87,7 +87,7 @@ namespace CalamityMod.Projectiles.Melee color = new Color(255, 255, 255, 100); } Vector2 origin = new Vector2(39f, 46f); - Main.EntitySpriteDraw(ModContent.Request("CalamityMod/Projectiles/Melee/ExcelsusBlueGlow"), Projectile.Center - Main.screenPosition, null, color, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(ModContent.Request("CalamityMod/Projectiles/Melee/ExcelsusBlueGlow").Value, Projectile.Center - Main.screenPosition, null, color, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Melee/GaelSkull2.cs b/Projectiles/Melee/GaelSkull2.cs index 6ded1c3616..2156cbd4cf 100644 --- a/Projectiles/Melee/GaelSkull2.cs +++ b/Projectiles/Melee/GaelSkull2.cs @@ -122,7 +122,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.maxPenetrate = -1; Projectile.penetrate = -1; Projectile.Damage(); - SoundEngine.PlaySound((int)SoundType.NPCKilled, (int)Projectile.Center.X, (int)Projectile.Center.Y, 52, 0.4f); + SoundEngine.PlaySound(SoundID.NPCDeath52, Projectile.Center); for (int i = 0; i < 3; i++) { Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 218, 0f, 0f, 100, default, 1.5f); diff --git a/Projectiles/Melee/Spears/StreamGougeProj.cs b/Projectiles/Melee/Spears/StreamGougeProj.cs index 6c47fde843..76f6206ac7 100644 --- a/Projectiles/Melee/Spears/StreamGougeProj.cs +++ b/Projectiles/Melee/Spears/StreamGougeProj.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Weapons.Melee; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -85,7 +85,7 @@ namespace CalamityMod.Projectiles.Melee.Spears { Vector2 portalSpawnPosition = Main.MouseWorld + Main.rand.NextVector2Unit() * Main.rand.NextFloat(50f, 140f); Vector2 spearVelocity = (Main.MouseWorld - portalSpawnPosition).SafeNormalize(Vector2.UnitY); - Projectile.NewProjectile(Projectile.GetProjectileSource_FromThis(), Projectile.GetItemSource_FromThis(), portalSpawnPosition, spearVelocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + Projectile.NewProjectile(Projectile.GetProjectileSource_FromThis(), portalSpawnPosition, spearVelocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); } Time++; diff --git a/Projectiles/Melee/TaintedBladeSlasher.cs b/Projectiles/Melee/TaintedBladeSlasher.cs index 548f5691e5..ccac49ee3b 100644 --- a/Projectiles/Melee/TaintedBladeSlasher.cs +++ b/Projectiles/Melee/TaintedBladeSlasher.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Projectiles.Melee { get { - Texture2D bladeTexture = TextureAssets.Item[(int)SwordItemID]; + Texture2D bladeTexture = TextureAssets.Item[(int)SwordItemID].Value; Rectangle bladeFrame = bladeTexture.Frame(1, 1, 0, 0); bool hasMultipleFrames = Main.itemAnimations[(int)SwordItemID] != null; if (hasMultipleFrames) @@ -224,7 +224,7 @@ namespace CalamityMod.Projectiles.Melee handTexture = ModContent.Request("CalamityMod/ExtraTextures/TaintedHand2").Value; handDirection = SpriteEffects.FlipHorizontally; } - Texture2D bladeTexture = TextureAssets.Item[(int)SwordItemID]; + Texture2D bladeTexture = TextureAssets.Item[(int)SwordItemID].Value; // Draw the arms. float backArmRotation = Owner.AngleTo(BackArmAimPosition); diff --git a/Projectiles/Melee/TrueBiomeBladeHoldout.cs b/Projectiles/Melee/TrueBiomeBladeHoldout.cs index 40a5940117..18189d0efd 100644 --- a/Projectiles/Melee/TrueBiomeBladeHoldout.cs +++ b/Projectiles/Melee/TrueBiomeBladeHoldout.cs @@ -181,7 +181,7 @@ namespace CalamityMod.Projectiles.Melee //If we swapped out the main attunement for the second one despite the second attunement being empty at the time, unswap them. if ((associatedItem.ModItem as OmegaBiomeBlade).mainAttunement == null && (associatedItem.ModItem as OmegaBiomeBlade).secondaryAttunement != null) { - (associatedItem.ModItem as OmegaBiomeBlade).mainAttunement = (associatedItem.modItem as OmegaBiomeBlade).secondaryAttunement; + (associatedItem.ModItem as OmegaBiomeBlade).mainAttunement = (associatedItem.ModItem as OmegaBiomeBlade).secondaryAttunement; (associatedItem.ModItem as OmegaBiomeBlade).secondaryAttunement = null; } } diff --git a/Projectiles/Ranged/BeeRPG.cs b/Projectiles/Ranged/BeeRPG.cs index 8706908861..5d75b45e74 100644 --- a/Projectiles/Ranged/BeeRPG.cs +++ b/Projectiles/Ranged/BeeRPG.cs @@ -147,7 +147,7 @@ namespace CalamityMod.Projectiles.Ranged bool canShoot = true; int damage = 0; float kb = 0f; - player.PickAmmo(FalseLauncher, ref projID, ref shootSpeed, ref canShoot, ref damage, ref kb, true); + player.PickAmmo(FalseLauncher, ref projID, ref shootSpeed, ref canShoot, ref damage, ref kb, out _, true); int blastRadius = 0; if (projID == ProjectileID.RocketII) blastRadius = 3; diff --git a/Projectiles/Ranged/ButcherGun.cs b/Projectiles/Ranged/ButcherGun.cs index 9aa6b9f3b1..0e600da8ab 100644 --- a/Projectiles/Ranged/ButcherGun.cs +++ b/Projectiles/Ranged/ButcherGun.cs @@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Ranged float kback = player.ActiveItem().knockBack; if (canShoot) { - player.PickAmmo(player.ActiveItem(), ref projType, ref speedMult, ref canShoot, ref damage, ref kback); + player.PickAmmo(player.ActiveItem(), ref projType, ref speedMult, ref canShoot, ref damage, ref kback, out _); kback = player.GetWeaponKnockback(player.ActiveItem(), kback); float speed = player.ActiveItem().shootSpeed * Projectile.scale; Vector2 targetPos = Main.screenPosition + new Vector2((float)Main.mouseX, (float)Main.mouseY) - source; diff --git a/Projectiles/Ranged/ChickenCannonHeld.cs b/Projectiles/Ranged/ChickenCannonHeld.cs index aa06924388..414a78863f 100644 --- a/Projectiles/Ranged/ChickenCannonHeld.cs +++ b/Projectiles/Ranged/ChickenCannonHeld.cs @@ -92,7 +92,7 @@ namespace CalamityMod.Projectiles.Ranged if (FreeShotLoaded > 0) FreeShotLoaded--; else - player.PickAmmo(player.ActiveItem(), ref projType, ref speedMult2, ref canShoot, ref dmg, ref kBack, false); + player.PickAmmo(player.ActiveItem(), ref projType, ref speedMult2, ref canShoot, ref dmg, ref kBack, out _); projType = ModContent.ProjectileType(); kBack = player.GetWeaponKnockback(player.ActiveItem(), kBack); diff --git a/Projectiles/Ranged/CondemnationHoldout.cs b/Projectiles/Ranged/CondemnationHoldout.cs index 621b149163..8fa3930790 100644 --- a/Projectiles/Ranged/CondemnationHoldout.cs +++ b/Projectiles/Ranged/CondemnationHoldout.cs @@ -132,7 +132,7 @@ namespace CalamityMod.Projectiles.Ranged bool uselessFuckYou = OwnerCanShoot; int projectileType = 0; - Owner.PickAmmo(heldItem, ref projectileType, ref shootSpeed, ref uselessFuckYou, ref arrowDamage, ref knockback, false); + Owner.PickAmmo(heldItem, ref projectileType, ref shootSpeed, ref uselessFuckYou, ref arrowDamage, ref knockback, out _); projectileType = ModContent.ProjectileType(); knockback = Owner.GetWeaponKnockback(heldItem, knockback); diff --git a/Projectiles/Ranged/DWArrow.cs b/Projectiles/Ranged/DWArrow.cs index 50a8ae56c8..ab21f1ce5a 100644 --- a/Projectiles/Ranged/DWArrow.cs +++ b/Projectiles/Ranged/DWArrow.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; @@ -68,10 +68,10 @@ namespace CalamityMod.Projectiles.Ranged { case 2f: - texture = ModContent.Request("CalamityMod/Projectiles/Ranged/DWArrow2"); + texture = ModContent.Request("CalamityMod/Projectiles/Ranged/DWArrow2").Value; break; default: - texture = ModContent.Request("CalamityMod/Projectiles/Ranged/DWArrow"); + texture = ModContent.Request("CalamityMod/Projectiles/Ranged/DWArrow").Value; break; } Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, new Rectangle?(new Rectangle(0, 0, texture.Width, texture.Height)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, texture.Height / 2f), Projectile.scale, SpriteEffects.None, 0); diff --git a/Projectiles/Ranged/DaemonsFlameBow.cs b/Projectiles/Ranged/DaemonsFlameBow.cs index 04c580e08d..a0317a53d3 100644 --- a/Projectiles/Ranged/DaemonsFlameBow.cs +++ b/Projectiles/Ranged/DaemonsFlameBow.cs @@ -97,7 +97,7 @@ namespace CalamityMod.Projectiles.Ranged float weaponKnockback2 = player.ActiveItem().knockBack; if (flag16) { - player.PickAmmo(player.ActiveItem(), ref num42, ref scaleFactor11, ref flag16, ref weaponDamage2, ref weaponKnockback2, false); + player.PickAmmo(player.ActiveItem(), ref num42, ref scaleFactor11, ref flag16, ref weaponDamage2, ref weaponKnockback2, out _); weaponKnockback2 = player.GetWeaponKnockback(player.ActiveItem(), weaponKnockback2); float scaleFactor12 = player.ActiveItem().shootSpeed * Projectile.scale; Vector2 vector19 = vector; @@ -163,7 +163,7 @@ namespace CalamityMod.Projectiles.Ranged if (Projectile.spriteDirection == -1) spriteEffects = SpriteEffects.FlipHorizontally; - Main.EntitySpriteDraw(ModContent.Request("CalamityMod/Projectiles/Ranged/DaemonsFlameBowGlow"), Projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Color.White, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(ModContent.Request("CalamityMod/Projectiles/Ranged/DaemonsFlameBowGlow").Value, Projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Color.White, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); } public override bool? CanDamage() => false; diff --git a/Projectiles/Ranged/DesertMark.cs b/Projectiles/Ranged/DesertMark.cs index 58325c8958..8ab280d53c 100644 --- a/Projectiles/Ranged/DesertMark.cs +++ b/Projectiles/Ranged/DesertMark.cs @@ -143,11 +143,6 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { Color color25 = Lighting.GetColor((int)((double)Projectile.position.X + (double)Projectile.width * 0.5) / 16, (int)(((double)Projectile.position.Y + (double)Projectile.height * 0.5) / 16.0)); - SpriteEffects spriteEffects = SpriteEffects.None; - if (Projectile.spriteDirection == -1) - { - spriteEffects = SpriteEffects.FlipHorizontally; - } Vector2 vector38 = Projectile.position + new Vector2((float)Projectile.width, (float)Projectile.height) / 2f + Vector2.UnitY * Projectile.gfxOffY - Main.screenPosition; Texture2D texture2D27 = ModContent.Request(Texture).Value; Rectangle rectangle11 = texture2D27.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); diff --git a/Projectiles/Ranged/DrataliornusBow.cs b/Projectiles/Ranged/DrataliornusBow.cs index e2e99aeacb..e2cab115e8 100644 --- a/Projectiles/Ranged/DrataliornusBow.cs +++ b/Projectiles/Ranged/DrataliornusBow.cs @@ -97,7 +97,7 @@ namespace CalamityMod.Projectiles.Ranged int damage = player.GetWeaponDamage(player.ActiveItem()); float knockBack = player.ActiveItem().knockBack; - player.PickAmmo(player.ActiveItem(), ref type, ref scaleFactor, ref canFire, ref damage, ref knockBack, false); + player.PickAmmo(player.ActiveItem(), ref type, ref scaleFactor, ref canFire, ref damage, ref knockBack, out _); type = ModContent.ProjectileType(); knockBack = player.GetWeaponKnockback(player.ActiveItem(), knockBack); diff --git a/Projectiles/Ranged/DrizzlefishFireSplit.cs b/Projectiles/Ranged/DrizzlefishFireSplit.cs index a2d339faa0..eebcadbe28 100644 --- a/Projectiles/Ranged/DrizzlefishFireSplit.cs +++ b/Projectiles/Ranged/DrizzlefishFireSplit.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Ranged //Changes the texture of the projectile if (Projectile.ai[1] == 1f) { - Texture2D texture = ModContent.Request("CalamityMod/Projectiles/Ranged/DrizzlefishFire2"); + Texture2D texture = ModContent.Request("CalamityMod/Projectiles/Ranged/DrizzlefishFire2").Value; Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, new Rectangle?(new Rectangle(0, 0, 16, 16)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, 20 / 2f), Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Ranged/ExoLight.cs b/Projectiles/Ranged/ExoLight.cs index ab1c2df221..1248252cde 100644 --- a/Projectiles/Ranged/ExoLight.cs +++ b/Projectiles/Ranged/ExoLight.cs @@ -134,7 +134,7 @@ namespace CalamityMod.Projectiles.Ranged } public override bool PreDraw(ref Color lightColor) { - Texture2D lightTexture = ModContent.Request("CalamityMod/ExtraTextures/PhotovisceratorLight"); + Texture2D lightTexture = ModContent.Request("CalamityMod/ExtraTextures/PhotovisceratorLight").Value; for (int i = 0; i < Projectile.oldPos.Length; i++) { float colorInterpolation = (float)Math.Cos(Projectile.timeLeft / 16f + Main.GlobalTimeWrappedHourly / 20f + i / (float)Projectile.oldPos.Length * MathHelper.Pi) * 0.5f + 0.5f; diff --git a/Projectiles/Ranged/ExoMark.cs b/Projectiles/Ranged/ExoMark.cs index c9505bdcfd..52d7880134 100644 --- a/Projectiles/Ranged/ExoMark.cs +++ b/Projectiles/Ranged/ExoMark.cs @@ -138,11 +138,6 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { Color color25 = Lighting.GetColor((int)((double)Projectile.position.X + (double)Projectile.width * 0.5) / 16, (int)(((double)Projectile.position.Y + (double)Projectile.height * 0.5) / 16.0)); - SpriteEffects spriteEffects = SpriteEffects.None; - if (Projectile.spriteDirection == -1) - { - spriteEffects = SpriteEffects.FlipHorizontally; - } Vector2 vector38 = Projectile.position + new Vector2((float)Projectile.width, (float)Projectile.height) / 2f + Vector2.UnitY * Projectile.gfxOffY - Main.screenPosition; Texture2D texture2D27 = ModContent.Request(Texture).Value; Rectangle rectangle11 = texture2D27.Frame(1, Main.projFrames[Projectile.type], 0, Projectile.frame); diff --git a/Projectiles/Ranged/ExplodingStake.cs b/Projectiles/Ranged/ExplodingStake.cs index be8dd585f3..ef621de2df 100644 --- a/Projectiles/Ranged/ExplodingStake.cs +++ b/Projectiles/Ranged/ExplodingStake.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Ranged { if (Main.rand.NextBool(2)) { - Item.NewItem((int)Projectile.position.X, (int)Projectile.position.Y, Projectile.width, Projectile.height, ItemID.Stake); + Item.NewItem(Projectile.GetItemSource_DropAsItem(), (int)Projectile.position.X, (int)Projectile.position.Y, Projectile.width, Projectile.height, ItemID.Stake); } } diff --git a/Projectiles/Ranged/FallenStarProj.cs b/Projectiles/Ranged/FallenStarProj.cs index 2952caaabc..0906a929fb 100644 --- a/Projectiles/Ranged/FallenStarProj.cs +++ b/Projectiles/Ranged/FallenStarProj.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; @@ -96,7 +96,7 @@ namespace CalamityMod.Projectiles.Ranged Vector2 spriteOrigin = spriteRec.Size() / 2f; SpriteEffects spriteEffects = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; - Texture2D aura = ModContent.Request("CalamityMod/Projectiles/Ranged/FallenStarAura"); + Texture2D aura = ModContent.Request("CalamityMod/Projectiles/Ranged/FallenStarAura").Value; Vector2 drawStart = Projectile.Center + Projectile.velocity; Vector2 drawStart2 = Projectile.Center - Projectile.velocity * 0.5f; Vector2 spinPoint = new Vector2(0f, -10f); diff --git a/Projectiles/Ranged/FlamingStake.cs b/Projectiles/Ranged/FlamingStake.cs index d525e1415a..f973f5c27d 100644 --- a/Projectiles/Ranged/FlamingStake.cs +++ b/Projectiles/Ranged/FlamingStake.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Ranged { if (Main.rand.NextBool(2)) { - Item.NewItem((int)Projectile.position.X, (int)Projectile.position.Y, Projectile.width, Projectile.height, ItemID.Stake); + Item.NewItem(Projectile.GetItemSource_DropAsItem(), (int)Projectile.position.X, (int)Projectile.position.Y, Projectile.width, Projectile.height, ItemID.Stake); } } diff --git a/Projectiles/Ranged/FlurrystormCannonShooting.cs b/Projectiles/Ranged/FlurrystormCannonShooting.cs index 5b702cb039..59e37e70d1 100644 --- a/Projectiles/Ranged/FlurrystormCannonShooting.cs +++ b/Projectiles/Ranged/FlurrystormCannonShooting.cs @@ -105,7 +105,7 @@ namespace CalamityMod.Projectiles.Ranged float kBack = player.ActiveItem().knockBack; if (canShoot) { - player.PickAmmo(player.ActiveItem(), ref projType, ref speedMult2, ref canShoot, ref dmg, ref kBack, false); + player.PickAmmo(player.ActiveItem(), ref projType, ref speedMult2, ref canShoot, ref dmg, ref kBack, out _); kBack = player.GetWeaponKnockback(player.ActiveItem(), kBack); float shootSpeed = player.ActiveItem().shootSpeed * Projectile.scale; Vector2 source = player.RotatedRelativePoint(player.MountedCenter, true); diff --git a/Projectiles/Ranged/GoliathRocket.cs b/Projectiles/Ranged/GoliathRocket.cs index a39b977cc9..f3a56869f2 100644 --- a/Projectiles/Ranged/GoliathRocket.cs +++ b/Projectiles/Ranged/GoliathRocket.cs @@ -147,7 +147,7 @@ namespace CalamityMod.Projectiles.Ranged bool canShoot = true; int damage = 0; float kb = 0f; - player.PickAmmo(FalseLauncher, ref projID, ref shootSpeed, ref canShoot, ref damage, ref kb, true); + player.PickAmmo(FalseLauncher, ref projID, ref shootSpeed, ref canShoot, ref damage, ref kb, out _, true); int blastRadius = 0; if (projID == ProjectileID.RocketII) blastRadius = 6; diff --git a/Projectiles/Ranged/HiveBomb.cs b/Projectiles/Ranged/HiveBomb.cs index c4d20a833b..fc97d3de78 100644 --- a/Projectiles/Ranged/HiveBomb.cs +++ b/Projectiles/Ranged/HiveBomb.cs @@ -147,7 +147,7 @@ namespace CalamityMod.Projectiles.Ranged bool canShoot = true; int damage = 0; float kb = 0f; - player.PickAmmo(FalseLauncher, ref projID, ref shootSpeed, ref canShoot, ref damage, ref kb, true); + player.PickAmmo(FalseLauncher, ref projID, ref shootSpeed, ref canShoot, ref damage, ref kb, out _, true); int blastRadius = 0; if (projID == ProjectileID.RocketII) blastRadius = 4; diff --git a/Projectiles/Ranged/HiveMissile.cs b/Projectiles/Ranged/HiveMissile.cs index d80f1a4ca5..f601cf7efd 100644 --- a/Projectiles/Ranged/HiveMissile.cs +++ b/Projectiles/Ranged/HiveMissile.cs @@ -147,7 +147,7 @@ namespace CalamityMod.Projectiles.Ranged bool canShoot = true; int damage = 0; float kb = 0f; - player.PickAmmo(FalseLauncher, ref projID, ref shootSpeed, ref canShoot, ref damage, ref kb, true); + player.PickAmmo(FalseLauncher, ref projID, ref shootSpeed, ref canShoot, ref damage, ref kb, out _, true); int blastRadius = 0; if (projID == ProjectileID.RocketII) blastRadius = 5; diff --git a/Projectiles/Ranged/HolyFireBulletProj.cs b/Projectiles/Ranged/HolyFireBulletProj.cs index 237350fdfd..b9c6771980 100644 --- a/Projectiles/Ranged/HolyFireBulletProj.cs +++ b/Projectiles/Ranged/HolyFireBulletProj.cs @@ -74,7 +74,7 @@ namespace CalamityMod.Projectiles.Ranged int boom = Projectile.NewProjectile(Projectile.GetProjectileSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), blastDamage, Projectile.knockBack, Projectile.owner, 0f, scale); // Only declare the explosion as ranged class if the bullet itself is ranged class. - if (boom.WithinBounds(Main.maxProjectiles) && Projectile.ranged) + if (boom.WithinBounds(Main.maxProjectiles) && Projectile.CountsAsClass(DamageClass.Ranged)) Main.projectile[boom].Calamity().forceRanged = true; } diff --git a/Projectiles/Ranged/MaelstromHoldout.cs b/Projectiles/Ranged/MaelstromHoldout.cs index 2a2be1329c..d76cd7e31f 100644 --- a/Projectiles/Ranged/MaelstromHoldout.cs +++ b/Projectiles/Ranged/MaelstromHoldout.cs @@ -93,7 +93,7 @@ namespace CalamityMod.Projectiles.Ranged bool uselessFuckYou = OwnerCanShoot; int projectileType = 0; - Owner.PickAmmo(heldItem, ref projectileType, ref shootSpeed, ref uselessFuckYou, ref arrowDamage, ref knockback, false); + Owner.PickAmmo(heldItem, ref projectileType, ref shootSpeed, ref uselessFuckYou, ref arrowDamage, ref knockback, out _); projectileType = ModContent.ProjectileType(); knockback = Owner.GetWeaponKnockback(heldItem, knockback); diff --git a/Projectiles/Ranged/MiniRocket.cs b/Projectiles/Ranged/MiniRocket.cs index acfbe11983..aee8738f6f 100644 --- a/Projectiles/Ranged/MiniRocket.cs +++ b/Projectiles/Ranged/MiniRocket.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using System.Collections.Generic; using Terraria; using Terraria.ID; @@ -116,7 +116,7 @@ namespace CalamityMod.Projectiles.Ranged bool canShoot = true; int damage = 0; float kb = 0f; - player.PickAmmo(FalseLauncher, ref projID, ref shootSpeed, ref canShoot, ref damage, ref kb, true); + player.PickAmmo(FalseLauncher, ref projID, ref shootSpeed, ref canShoot, ref damage, ref kb, out _, true); int blastRadius = 0; if (projID == ProjectileID.RocketII) blastRadius = 3; diff --git a/Projectiles/Ranged/Nanomachine.cs b/Projectiles/Ranged/Nanomachine.cs index 33a953bbed..40795efef7 100644 --- a/Projectiles/Ranged/Nanomachine.cs +++ b/Projectiles/Ranged/Nanomachine.cs @@ -34,9 +34,9 @@ namespace CalamityMod.Projectiles.Ranged { if (Projectile.localAI[1] == 0) Projectile.localAI[1] = Main.rand.Next(1, 3); - Texture2D texture = ModContent.Request("CalamityMod/Projectiles/Ranged/Nanomachine"); + Texture2D texture = ModContent.Request("CalamityMod/Projectiles/Ranged/Nanomachine").Value; if (Projectile.localAI[1] == 2) - texture = ModContent.Request("CalamityMod/Projectiles/Ranged/Nanomachine2"); + texture = ModContent.Request("CalamityMod/Projectiles/Ranged/Nanomachine2").Value; CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1, texture); return false; } diff --git a/Projectiles/Ranged/Nuke.cs b/Projectiles/Ranged/Nuke.cs index 33a980eb31..7dc3daba20 100644 --- a/Projectiles/Ranged/Nuke.cs +++ b/Projectiles/Ranged/Nuke.cs @@ -121,7 +121,7 @@ namespace CalamityMod.Projectiles.Ranged bool canShoot = true; int damage = 0; float kb = 0f; - player.PickAmmo(FalseLauncher, ref projID, ref shootSpeed, ref canShoot, ref damage, ref kb, true); + player.PickAmmo(FalseLauncher, ref projID, ref shootSpeed, ref canShoot, ref damage, ref kb, out _, true); int blastRadius = 0; if (projID == ProjectileID.RocketII) blastRadius = 6; diff --git a/Projectiles/Ranged/PhangasmBow.cs b/Projectiles/Ranged/PhangasmBow.cs index d5af98520a..5f8d4e5a4e 100644 --- a/Projectiles/Ranged/PhangasmBow.cs +++ b/Projectiles/Ranged/PhangasmBow.cs @@ -84,7 +84,7 @@ namespace CalamityMod.Projectiles.Ranged float weaponKnockback2 = player.ActiveItem().knockBack; if (flag16) { - player.PickAmmo(player.ActiveItem(), ref num42, ref scaleFactor11, ref flag16, ref weaponDamage2, ref weaponKnockback2, false); + player.PickAmmo(player.ActiveItem(), ref num42, ref scaleFactor11, ref flag16, ref weaponDamage2, ref weaponKnockback2, out _); weaponKnockback2 = player.GetWeaponKnockback(player.ActiveItem(), weaponKnockback2); float scaleFactor12 = player.ActiveItem().shootSpeed * Projectile.scale; Vector2 vector19 = vector; diff --git a/Projectiles/Ranged/PrismExplosionLarge.cs b/Projectiles/Ranged/PrismExplosionLarge.cs index fc5e0d52cc..036a8f9976 100644 --- a/Projectiles/Ranged/PrismExplosionLarge.cs +++ b/Projectiles/Ranged/PrismExplosionLarge.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { Texture2D texture = ModContent.Request(Texture).Value; - Texture2D lightTexture = ModContent.Request("CalamityMod/ExtraTextures/PhotovisceratorLight"); + Texture2D lightTexture = ModContent.Request("CalamityMod/ExtraTextures/PhotovisceratorLight").Value; Rectangle frame = texture.Frame(3, 6, Projectile.frame / 6, Projectile.frame % 6); Vector2 drawPosition = Projectile.Center - Main.screenPosition; Vector2 origin = frame.Size() * 0.5f; diff --git a/Projectiles/Ranged/PrismMine.cs b/Projectiles/Ranged/PrismMine.cs index fbf90cc517..004f9082ca 100644 --- a/Projectiles/Ranged/PrismMine.cs +++ b/Projectiles/Ranged/PrismMine.cs @@ -85,8 +85,8 @@ namespace CalamityMod.Projectiles.Ranged public override bool PreDraw(ref Color lightColor) { Texture2D baseTexture = ModContent.Request(Texture).Value; - Texture2D glowTexture = ModContent.Request($"{Texture}Glowmask"); - Texture2D laserTexture = ModContent.Request($"CalamityMod/Projectiles/Ranged/PrismMineArc"); + Texture2D glowTexture = ModContent.Request($"{Texture}Glowmask").Value; + Texture2D laserTexture = ModContent.Request($"CalamityMod/Projectiles/Ranged/PrismMineArc").Value; void drawLineTo(Vector2 destination, Color laserColor) { diff --git a/Projectiles/Ranged/PrismaticEnergyBlast.cs b/Projectiles/Ranged/PrismaticEnergyBlast.cs index b4ba180ef5..3f858f9079 100644 --- a/Projectiles/Ranged/PrismaticEnergyBlast.cs +++ b/Projectiles/Ranged/PrismaticEnergyBlast.cs @@ -19,9 +19,9 @@ namespace CalamityMod.Projectiles.Ranged public override float Lifetime => 50f; public override Color LaserOverlayColor => Color.White; public override Color LightCastColor => LaserOverlayColor; - public override Texture2D LaserBeginTexture => ModContent.Request("CalamityMod/ExtraTextures/Lasers/PrismLaserStart"); - public override Texture2D LaserMiddleTexture => ModContent.Request("CalamityMod/ExtraTextures/Lasers/PrismLaserMid"); - public override Texture2D LaserEndTexture => ModContent.Request("CalamityMod/ExtraTextures/Lasers/PrismLaserEnd"); + public override Texture2D LaserBeginTexture => ModContent.Request("CalamityMod/ExtraTextures/Lasers/PrismLaserStart").Value; + public override Texture2D LaserMiddleTexture => ModContent.Request("CalamityMod/ExtraTextures/Lasers/PrismLaserMid").Value; + public override Texture2D LaserEndTexture => ModContent.Request("CalamityMod/ExtraTextures/Lasers/PrismLaserEnd").Value; public override void SetStaticDefaults() { diff --git a/Projectiles/Rogue/ShockGrenadeProjectile.cs b/Projectiles/Rogue/ShockGrenadeProjectile.cs index c08cdeadca..a87db9381b 100644 --- a/Projectiles/Rogue/ShockGrenadeProjectile.cs +++ b/Projectiles/Rogue/ShockGrenadeProjectile.cs @@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.Rogue public override void PostDraw(Color lightColor) { Vector2 origin = new Vector2(spriteWidth / 2, spriteHeight / 2); - Main.EntitySpriteDraw(ModContent.Request("CalamityMod/Items/Weapons/Rogue/ShockGrenadeGlow"), Projectile.Center - Main.screenPosition, null, Color.White, Projectile.rotation, origin, 1f, SpriteEffects.None, 0); + Main.EntitySpriteDraw(ModContent.Request("CalamityMod/Items/Weapons/Rogue/ShockGrenadeGlow").Value, Projectile.Center - Main.screenPosition, null, Color.White, Projectile.rotation, origin, 1f, SpriteEffects.None, 0); } public override void Kill(int timeLeft) diff --git a/Projectiles/Rogue/SlickCaneProjectile.cs b/Projectiles/Rogue/SlickCaneProjectile.cs index d011b4f4cc..d5e75ae101 100644 --- a/Projectiles/Rogue/SlickCaneProjectile.cs +++ b/Projectiles/Rogue/SlickCaneProjectile.cs @@ -98,7 +98,7 @@ namespace CalamityMod.Projectiles.Rogue modifiedMoneyValue /= Main.rand.Next(3) + 1; } moneyValueToDrop -= 10000 * modifiedMoneyValue; - DropHelper.DropItem(target, ItemID.GoldCoin, modifiedMoneyValue); + Item.NewItem(target.GetItemSource_Loot(), target.Hitbox, ItemID.GoldCoin, modifiedMoneyValue); } while (moneyValueToDrop > 100f) { @@ -112,7 +112,7 @@ namespace CalamityMod.Projectiles.Rogue modifiedMoneyValue /= Main.rand.Next(3) + 1; } moneyValueToDrop -= 100 * modifiedMoneyValue; - DropHelper.DropItem(target, ItemID.SilverCoin, modifiedMoneyValue); + Item.NewItem(target.GetItemSource_Loot(), target.Hitbox, ItemID.SilverCoin, modifiedMoneyValue); } while (moneyValueToDrop > 0f) { @@ -130,7 +130,7 @@ namespace CalamityMod.Projectiles.Rogue modifiedMoneyValue = 1; } moneyValueToDrop -= modifiedMoneyValue; - DropHelper.DropItem(target, ItemID.CopperCoin, modifiedMoneyValue); + Item.NewItem(target.GetItemSource_Loot(), target.Hitbox, ItemID.CopperCoin, modifiedMoneyValue); } } } diff --git a/Projectiles/Rogue/SpearofDestinyProjectile.cs b/Projectiles/Rogue/SpearofDestinyProjectile.cs index 0b5cdf480d..fd75ddeafb 100644 --- a/Projectiles/Rogue/SpearofDestinyProjectile.cs +++ b/Projectiles/Rogue/SpearofDestinyProjectile.cs @@ -107,7 +107,7 @@ namespace CalamityMod.Projectiles.Rogue { if (Projectile.Calamity().stealthStrike) { - Texture2D tex = ModContent.Request("CalamityMod/Projectiles/Rogue/SpearofDestinyGlow"); + Texture2D tex = ModContent.Request("CalamityMod/Projectiles/Rogue/SpearofDestinyGlow").Value; Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Color.White, Projectile.rotation, tex.Size() / 2, Projectile.scale, SpriteEffects.None, 0); } } diff --git a/Projectiles/Rogue/StealthNimbus.cs b/Projectiles/Rogue/StealthNimbus.cs index 600a1ed231..cec94fcac0 100644 --- a/Projectiles/Rogue/StealthNimbus.cs +++ b/Projectiles/Rogue/StealthNimbus.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Rogue { Texture2D texture = ModContent.Request(Texture).Value; if (Projectile.ai[0] == 1f) - texture = ModContent.Request("CalamityMod/Projectiles/Rogue/StealthNimbus2"); + texture = ModContent.Request("CalamityMod/Projectiles/Rogue/StealthNimbus2").Value; int height = texture.Height / Main.projFrames[Projectile.type]; int frameHeight = height * Projectile.frame; SpriteEffects spriteEffects = SpriteEffects.None; diff --git a/Projectiles/Rogue/StealthRain.cs b/Projectiles/Rogue/StealthRain.cs index 51185580f4..516259ea08 100644 --- a/Projectiles/Rogue/StealthRain.cs +++ b/Projectiles/Rogue/StealthRain.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Rogue //Changes the texture of the projectile if (Projectile.ai[0] == 1f) { - Texture2D texture = ModContent.Request("CalamityMod/Projectiles/Rogue/StealthRain2"); + Texture2D texture = ModContent.Request("CalamityMod/Projectiles/Rogue/StealthRain2").Value; Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, new Rectangle?(new Rectangle(0, 0, texture.Width, texture.Height)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, texture.Height / 2f), Projectile.scale, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Rogue/SulphuricNukesplosion.cs b/Projectiles/Rogue/SulphuricNukesplosion.cs index 75be28dc65..5b1595cb76 100644 --- a/Projectiles/Rogue/SulphuricNukesplosion.cs +++ b/Projectiles/Rogue/SulphuricNukesplosion.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -141,7 +141,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { Rectangle frame = new Rectangle(frameX * Projectile.width, frameY * Projectile.height, Projectile.width, Projectile.height); - Main.EntitySpriteDraw(ModContent.Request("CalamityMod/Projectiles/Rogue/SulphuricNukesplosion"), Projectile.Center - Main.screenPosition, frame, Color.White, Projectile.rotation, Projectile.Size / 2, 1f, SpriteEffects.None, 0); + Main.EntitySpriteDraw(ModContent.Request("CalamityMod/Projectiles/Rogue/SulphuricNukesplosion").Value, Projectile.Center - Main.screenPosition, frame, Color.White, Projectile.rotation, Projectile.Size / 2, 1f, SpriteEffects.None, 0); return false; } diff --git a/Projectiles/Summon/Shellfish.cs b/Projectiles/Summon/Shellfish.cs index 84bde3aca3..07e9c389e5 100644 --- a/Projectiles/Summon/Shellfish.cs +++ b/Projectiles/Summon/Shellfish.cs @@ -351,7 +351,7 @@ namespace CalamityMod.Projectiles.Summon ((Projectile.friendly && (!npc.friendly || (npc.type == NPCID.Guide && Projectile.owner < Main.maxPlayers && player.killGuide) || (npc.type == NPCID.Clothier && Projectile.owner < Main.maxPlayers && player.killClothier))) || (Projectile.hostile && npc.friendly && !npc.dontTakeDamageFromHostiles)) && (Projectile.owner < 0 || npc.immune[Projectile.owner] == 0 || Projectile.maxPenetrate == 1)) { - if (npc.noTileCollide || !Projectile.ownerHitCheck || Projectile.CanHit(npc)) + if (npc.noTileCollide || !Projectile.ownerHitCheck) { bool stickingToNPC; //Solar Crawltipede tail has special collision @@ -372,9 +372,9 @@ namespace CalamityMod.Projectiles.Summon if (stickingToNPC) { //reflect projectile if the npc can reflect it (like Selenians) - if (npc.reflectingProjectiles && Projectile.CanReflect()) + if (npc.reflectsProjectiles && Projectile.CanBeReflected()) { - npc.ReflectProjectile(Projectile.whoAmI); + npc.ReflectProjectile(Projectile); return; } diff --git a/Projectiles/Summon/VileFeederSummon.cs b/Projectiles/Summon/VileFeederSummon.cs index 5f1b6132c4..c85447de4c 100644 --- a/Projectiles/Summon/VileFeederSummon.cs +++ b/Projectiles/Summon/VileFeederSummon.cs @@ -186,7 +186,7 @@ namespace CalamityMod.Projectiles.Summon ((Projectile.friendly && (!npc.friendly || (npc.type == NPCID.Guide && Projectile.owner < Main.maxPlayers && player.killGuide) || (npc.type == NPCID.Clothier && Projectile.owner < Main.maxPlayers && player.killClothier))) || (Projectile.hostile && npc.friendly && !npc.dontTakeDamageFromHostiles)) && (Projectile.owner < 0 || npc.immune[Projectile.owner] == 0 || Projectile.maxPenetrate == 1)) { - if (npc.noTileCollide || !Projectile.ownerHitCheck || Projectile.CanHit(npc)) + if (npc.noTileCollide || !Projectile.ownerHitCheck) { bool stickingToNPC; //Solar Crawltipede tail has special collision @@ -207,9 +207,9 @@ namespace CalamityMod.Projectiles.Summon if (stickingToNPC) { //reflect projectile if the npc can reflect it (like Selenians) - if (npc.reflectingProjectiles && Projectile.CanReflect()) + if (npc.reflectsProjectiles && Projectile.CanBeReflected()) { - npc.ReflectProjectile(Projectile.whoAmI); + npc.ReflectProjectile(Projectile); return; } diff --git a/Schematics/CalamitySchematicIO.cs b/Schematics/CalamitySchematicIO.cs index ef66114028..02a6b4fe67 100644 --- a/Schematics/CalamitySchematicIO.cs +++ b/Schematics/CalamitySchematicIO.cs @@ -156,8 +156,6 @@ namespace CalamityMod.Schematics for (int j = area.Top; j < area.Bottom; j++) { Tile t = Main.tile[i, j]; - if (t is null) // Vanilla does this itself all the time. I wish it weren't necessary. - t = new Tile(); tiles[i - area.Left, j - area.Top] = t; } return tiles; diff --git a/Tiles/DraedonStructures/AgedLaboratoryConsole.cs b/Tiles/DraedonStructures/AgedLaboratoryConsole.cs index 881c40a86e..d96975563b 100644 --- a/Tiles/DraedonStructures/AgedLaboratoryConsole.cs +++ b/Tiles/DraedonStructures/AgedLaboratoryConsole.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.DraedonStructures; +using CalamityMod.Items.Placeables.DraedonStructures; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -60,7 +60,7 @@ namespace CalamityMod.Tiles.DraedonStructures { int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; - Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/DraedonStructures/AgedLaboratoryConsoleGlow"); + Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/DraedonStructures/AgedLaboratoryConsoleGlow").Value; Vector2 drawOffest = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffest; Color drawColour = Color.White; diff --git a/Tiles/DraedonStructures/AgedLaboratoryDisplay.cs b/Tiles/DraedonStructures/AgedLaboratoryDisplay.cs index 281a377710..2c11db5cc9 100644 --- a/Tiles/DraedonStructures/AgedLaboratoryDisplay.cs +++ b/Tiles/DraedonStructures/AgedLaboratoryDisplay.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.DraedonStructures; +using CalamityMod.Items.Placeables.DraedonStructures; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -53,7 +53,7 @@ namespace CalamityMod.Tiles.DraedonStructures { int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; - Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/DraedonStructures/AgedLaboratoryDisplayGlow"); + Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/DraedonStructures/AgedLaboratoryDisplayGlow").Value; Vector2 drawOffest = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffest; Color drawColour = Color.White; diff --git a/Tiles/DraedonStructures/AgedLaboratoryServer.cs b/Tiles/DraedonStructures/AgedLaboratoryServer.cs index 43d140c545..0491490c12 100644 --- a/Tiles/DraedonStructures/AgedLaboratoryServer.cs +++ b/Tiles/DraedonStructures/AgedLaboratoryServer.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.DraedonStructures; +using CalamityMod.Items.Placeables.DraedonStructures; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -60,7 +60,7 @@ namespace CalamityMod.Tiles.DraedonStructures { int xFrameOffset = Main.tile[i, j].TileFrameX; int yFrameOffset = Main.tile[i, j].TileFrameY; - Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/DraedonStructures/AgedLaboratoryServerGlow"); + Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/DraedonStructures/AgedLaboratoryServerGlow").Value; Vector2 drawOffest = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffest; Color drawColour = Color.White; diff --git a/Utilities/FurnitureSetupUtils.cs b/Utilities/FurnitureSetupUtils.cs index 44b0b83077..f477358280 100644 --- a/Utilities/FurnitureSetupUtils.cs +++ b/Utilities/FurnitureSetupUtils.cs @@ -265,6 +265,7 @@ namespace CalamityMod else { player.piggyBankProjTracker.Clear(); + player.voidLensChest.Clear(); int num213 = Chest.FindChest(left, top); if (num213 != -1) {