diff --git a/Balancing/BalancingChangesManager.cs b/Balancing/BalancingChangesManager.cs index d68a0b4b9d..2419abca40 100644 --- a/Balancing/BalancingChangesManager.cs +++ b/Balancing/BalancingChangesManager.cs @@ -1,4 +1,4 @@ -using CalamityMod.NPCs.CeaselessVoid; +using CalamityMod.NPCs.CeaselessVoid; using CalamityMod.NPCs.Crabulon; using CalamityMod.NPCs.ExoMechs.Apollo; using CalamityMod.NPCs.ExoMechs.Artemis; @@ -15,6 +15,7 @@ using System.Collections.Generic; using System.Linq; using Terraria; using Terraria.ID; +using Terraria.ModLoader; using static Terraria.ModLoader.ModContent; namespace CalamityMod.Balancing @@ -32,7 +33,7 @@ namespace CalamityMod.Balancing { // Declare specific filters. bool DragonRageFilter(Projectile p) => - p.type == ProjectileType() || p.type == ProjectileType() || (p.type == ProjectileType() && p.melee); + p.type == ProjectileType() || p.type == ProjectileType() || (p.type == ProjectileType() && p.CountsAsClass(DamageClass.Melee)); bool MonkStaffT3Filter(Projectile p) => p.type == ProjectileID.MonkStaffT3_AltShot || (p.type == ProjectileID.Electrosphere && Main.player[p.owner].ActiveItem().type == ItemID.MonkStaffT3); diff --git a/Balancing/NPCHitContext.cs b/Balancing/NPCHitContext.cs index 9cccc7fc5e..787fce7d83 100644 --- a/Balancing/NPCHitContext.cs +++ b/Balancing/NPCHitContext.cs @@ -1,4 +1,5 @@ -using Terraria; +using Terraria; +using Terraria.ModLoader; namespace CalamityMod.Balancing { @@ -17,11 +18,11 @@ namespace CalamityMod.Balancing ClassType? classType = null; if (proj.active) { - if (proj.melee) + if (proj.CountsAsClass(DamageClass.Melee)) classType = ClassType.Melee; - if (proj.ranged) + if (proj.CountsAsClass(DamageClass.Ranged)) classType = ClassType.Ranged; - if (proj.magic) + if (proj.CountsAsClass(DamageClass.Magic)) classType = ClassType.Magic; if (proj.minion) classType = ClassType.Summon; diff --git a/Events/BossRushSky.cs b/Events/BossRushSky.cs index 7d46039ed7..a72663ceb7 100644 --- a/Events/BossRushSky.cs +++ b/Events/BossRushSky.cs @@ -2,6 +2,7 @@ using Microsoft.Xna.Framework.Graphics; using System; using Terraria; +using Terraria.GameContent; using Terraria.Graphics.Effects; using Terraria.ModLoader; @@ -79,7 +80,7 @@ namespace CalamityMod.Events return; if (maxDepth >= 0 && minDepth < 0 && GetIntensity() > 0f) - spriteBatch.Draw(Main.blackTileTexture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), GeneralColor * GetIntensity() * 0.5f); + spriteBatch.Draw(TextureAssets.BlackTile.Value, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), GeneralColor * GetIntensity() * 0.5f); Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive); diff --git a/ILEditing/VanillaBugfixingILChanges.cs b/ILEditing/VanillaBugfixingILChanges.cs index 0582ea3c24..a393ed00d7 100644 --- a/ILEditing/VanillaBugfixingILChanges.cs +++ b/ILEditing/VanillaBugfixingILChanges.cs @@ -7,6 +7,7 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; using Terraria; +using Terraria.GameContent; using Terraria.GameInput; using Terraria.ID; @@ -21,7 +22,7 @@ namespace CalamityMod.ILEditing } // This list should contain all vanilla NPCs present in Boss Rush which ARE NOT bosses and whose health is boosted over 32,767. - private static List NeedsFourLifeBytes => new List() + private static List NeedsFourLifeBytes => new() { // King Slime NPCID.BlueSlime, @@ -79,7 +80,7 @@ namespace CalamityMod.ILEditing NPCID.AncientCultistSquidhead, }; - public static List OrderedProjectiles = new List(); + public static List OrderedProjectiles = new(); /* #region Fixing NPC HP Sync Byte Counts in Boss Rush @@ -228,7 +229,7 @@ namespace CalamityMod.ILEditing cursor.Emit(OpCodes.Ldloc_0); cursor.EmitDelegate>(itemType => { - return Main.itemAnimations[itemType]?.GetFrame(Main.itemTexture[itemType]) ?? null; + return Main.itemAnimations[itemType]?.GetFrame(TextureAssets.Item[itemType].Value) ?? null; }); } #endregion Make Mouse Hover Items Work with Animated Items diff --git a/Items/DraedonMisc/EncryptedSchematicSunkenSea.cs b/Items/DraedonMisc/EncryptedSchematicSunkenSea.cs index 14e16481fa..a9466322c3 100644 --- a/Items/DraedonMisc/EncryptedSchematicSunkenSea.cs +++ b/Items/DraedonMisc/EncryptedSchematicSunkenSea.cs @@ -1,4 +1,5 @@ -using CalamityMod.CustomRecipes; +using System; +using CalamityMod.CustomRecipes; using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; diff --git a/Items/Potions/Alcohol/WhiteWine.cs b/Items/Potions/Alcohol/WhiteWine.cs index 9e8280febe..330ccdc1ae 100644 --- a/Items/Potions/Alcohol/WhiteWine.cs +++ b/Items/Potions/Alcohol/WhiteWine.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.Alcohol; +using CalamityMod.Buffs.Alcohol; using Terraria; using Terraria.GameInput; using Terraria.ID; @@ -38,7 +38,7 @@ Reduces defense by 6% and life regen by 1"); { if (PlayerInput.Triggers.JustPressed.QuickBuff) { - player.statMana += item.healMana; + player.statMana += Item.healMana; if (player.statMana > player.statManaMax2) { player.statMana = player.statManaMax2; @@ -46,10 +46,10 @@ Reduces defense by 6% and life regen by 1"); player.AddBuff(BuffID.ManaSickness, Player.manaSickTime, true); if (Main.myPlayer == player.whoAmI) { - player.ManaEffect(item.healMana); + player.ManaEffect(Item.healMana); } } - player.AddBuff(item.buffType, item.buffTime); + player.AddBuff(Item.buffType, Item.buffTime); return true; } } diff --git a/Items/SummonItems/AncientMedallion.cs b/Items/SummonItems/AncientMedallion.cs index 077c35dc05..37a1f442f9 100644 --- a/Items/SummonItems/AncientMedallion.cs +++ b/Items/SummonItems/AncientMedallion.cs @@ -1,9 +1,11 @@ -using CalamityMod.Events; +using CalamityMod.Events; using CalamityMod.NPCs.Ravager; using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using Terraria.DataStructures; + namespace CalamityMod.Items.SummonItems { public class AncientMedallion : ModItem @@ -37,7 +39,7 @@ namespace CalamityMod.Items.SummonItems SoundEngine.PlaySound(SoundID.Roar, player.position, 2); 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/SummonItems/DecapoditaSprout.cs b/Items/SummonItems/DecapoditaSprout.cs index 25029a9bb9..c3edc59c39 100644 --- a/Items/SummonItems/DecapoditaSprout.cs +++ b/Items/SummonItems/DecapoditaSprout.cs @@ -1,9 +1,11 @@ -using CalamityMod.Events; +using CalamityMod.Events; using CalamityMod.NPCs.Crabulon; using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using Terraria.DataStructures; + namespace CalamityMod.Items.SummonItems { public class DecapoditaSprout : ModItem @@ -36,7 +38,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/SummonItems/EidolonTablet.cs b/Items/SummonItems/EidolonTablet.cs index 9fd0060dce..8422648c97 100644 --- a/Items/SummonItems/EidolonTablet.cs +++ b/Items/SummonItems/EidolonTablet.cs @@ -1,6 +1,7 @@ -using CalamityMod.Events; +using CalamityMod.Events; using System; using Terraria; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; @@ -35,7 +36,7 @@ namespace CalamityMod.Items.SummonItems { if (Main.netMode != NetmodeID.MultiplayerClient) { - int npc = NPC.NewNPC((int)player.Center.X + 30, (int)player.Center.Y - 90, NPCID.CultistBoss, 1); + int npc = NPC.NewNPC(new EntitySource_BossSpawn(player), (int)player.Center.X + 30, (int)player.Center.Y - 90, NPCID.CultistBoss, 1); Main.npc[npc].direction = Main.npc[npc].spriteDirection = Math.Sign(player.Center.X - player.Center.X - 30f); Main.npc[npc].timeLeft *= 20; CalamityUtils.BossAwakenMessage(npc); diff --git a/Items/SummonItems/ProfanedCoreUnlimited.cs b/Items/SummonItems/ProfanedCoreUnlimited.cs index 4a626d1b48..82ee8be8cb 100644 --- a/Items/SummonItems/ProfanedCoreUnlimited.cs +++ b/Items/SummonItems/ProfanedCoreUnlimited.cs @@ -1,9 +1,10 @@ -using CalamityMod.Events; +using CalamityMod.Events; using CalamityMod.NPCs.Providence; using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using Terraria.DataStructures; namespace CalamityMod.Items.SummonItems { @@ -31,7 +32,7 @@ namespace CalamityMod.Items.SummonItems public override bool CanUseItem(Player player) { - return !NPC.AnyNPCs(ModContent.NPCType()) && (player.ZoneHoly || player.ZoneUnderworldHeight) && !BossRushEvent.BossRushActive; + return !NPC.AnyNPCs(ModContent.NPCType()) && (player.ZoneHallow || player.ZoneUnderworldHeight) && !BossRushEvent.BossRushActive; } public override bool? UseItem(Player player) @@ -39,7 +40,7 @@ namespace CalamityMod.Items.SummonItems SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/ProvidenceSpawn"), (int)player.position.X, (int)player.position.Y); if (Main.netMode != NetmodeID.MultiplayerClient) { - int npc = NPC.NewNPC((int)(player.position.X + Main.rand.Next(-500, 501)), (int)(player.position.Y - 250f), ModContent.NPCType(), 1); + int npc = NPC.NewNPC(new EntitySource_BossSpawn(player), (int)(player.position.X + Main.rand.Next(-500, 501)), (int)(player.position.Y - 250f), ModContent.NPCType(), 1); Main.npc[npc].timeLeft *= 20; CalamityUtils.BossAwakenMessage(npc); } diff --git a/Items/SummonItems/ProfanedShard.cs b/Items/SummonItems/ProfanedShard.cs index 99679bbe17..3db4033b03 100644 --- a/Items/SummonItems/ProfanedShard.cs +++ b/Items/SummonItems/ProfanedShard.cs @@ -1,4 +1,4 @@ -using CalamityMod.Events; +using CalamityMod.Events; using CalamityMod.Items.Materials; using CalamityMod.NPCs.ProfanedGuardians; using Terraria; @@ -31,7 +31,7 @@ namespace CalamityMod.Items.SummonItems public override bool CanUseItem(Player player) { - return !NPC.AnyNPCs(ModContent.NPCType()) && Main.dayTime && (player.ZoneHoly || player.ZoneUnderworldHeight) && !BossRushEvent.BossRushActive; + return !NPC.AnyNPCs(ModContent.NPCType()) && Main.dayTime && (player.ZoneHallow || player.ZoneUnderworldHeight) && !BossRushEvent.BossRushActive; } public override bool? UseItem(Player player) diff --git a/Items/SuperDummy.cs b/Items/SuperDummy.cs index 285e8379c4..0c5b6c788d 100644 --- a/Items/SuperDummy.cs +++ b/Items/SuperDummy.cs @@ -1,5 +1,6 @@ using CalamityMod.NPCs.NormalNPCs; using Terraria; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; @@ -67,7 +68,7 @@ namespace CalamityMod.Items // dummies are gone, and cause them to reappear, making the deletion moot. else { - var netMessage = mod.GetPacket(); + var netMessage = Mod.GetPacket(); netMessage.Write((byte)CalamityModMessageType.DeleteAllSuperDummies); netMessage.Send(); } @@ -80,12 +81,12 @@ namespace CalamityMod.Items // In single player, just spawn the dummy. if (Main.netMode == NetmodeID.SinglePlayer) - NPC.NewNPC(x, y, ModContent.NPCType()); + NPC.NewNPC(new EntitySource_ItemUse(player, Item), x, y, ModContent.NPCType()); // Otherwise, send a message to the server indicating that a Super Dummy should be spawned at this position. else { - var netMessage = mod.GetPacket(); + var netMessage = Mod.GetPacket(); netMessage.Write((byte)CalamityModMessageType.SpawnSuperDummy); netMessage.Write(x); netMessage.Write(y); diff --git a/Items/VanillaArmorChanges/AdamantiteArmorSetChange.cs b/Items/VanillaArmorChanges/AdamantiteArmorSetChange.cs index 041a5953c8..15ce0a0651 100644 --- a/Items/VanillaArmorChanges/AdamantiteArmorSetChange.cs +++ b/Items/VanillaArmorChanges/AdamantiteArmorSetChange.cs @@ -1,6 +1,7 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; +using Terraria.ModLoader; namespace CalamityMod.Items.VanillaArmorChanges { diff --git a/Items/VanillaArmorChanges/CobaltArmorSetChange.cs b/Items/VanillaArmorChanges/CobaltArmorSetChange.cs index b3c60d9207..e1d262ee49 100644 --- a/Items/VanillaArmorChanges/CobaltArmorSetChange.cs +++ b/Items/VanillaArmorChanges/CobaltArmorSetChange.cs @@ -1,6 +1,7 @@ using System; using Terraria; using Terraria.ID; +using Terraria.ModLoader; namespace CalamityMod.Items.VanillaArmorChanges { diff --git a/Items/VanillaArmorChanges/MonkT2ArmorSetChange.cs b/Items/VanillaArmorChanges/MonkT2ArmorSetChange.cs index 58d6c87f65..4e4ea61240 100644 --- a/Items/VanillaArmorChanges/MonkT2ArmorSetChange.cs +++ b/Items/VanillaArmorChanges/MonkT2ArmorSetChange.cs @@ -1,5 +1,6 @@ -using Terraria; +using Terraria; using Terraria.ID; +using Terraria.ModLoader; namespace CalamityMod.Items.VanillaArmorChanges { diff --git a/Items/VanillaArmorChanges/MythrilArmorSetChange.cs b/Items/VanillaArmorChanges/MythrilArmorSetChange.cs index 1266c7525b..795bb3d30d 100644 --- a/Items/VanillaArmorChanges/MythrilArmorSetChange.cs +++ b/Items/VanillaArmorChanges/MythrilArmorSetChange.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Typeless; +using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -66,7 +66,7 @@ namespace CalamityMod.Items.VanillaArmorChanges int flareDamage = CalamityUtils.DamageSoftCap(originalDamage * 0.4, FlareDamageSoftcap); Vector2 flareSpawnPosition = victim.Center + Main.rand.NextVector2Circular(10f, 10f); - Projectile.NewProjectile(flareSpawnPosition, Vector2.Zero, ModContent.ProjectileType(), flareDamage, 0f, owner.whoAmI); + Projectile.NewProjectile(owner.GetProjectileSource_Item(owner.ActiveItem()), flareSpawnPosition, Vector2.Zero, ModContent.ProjectileType(), flareDamage, 0f, owner.whoAmI); } } } diff --git a/Items/VanillaArmorChanges/PalladiumArmorSetChange.cs b/Items/VanillaArmorChanges/PalladiumArmorSetChange.cs index 5cf6e6444b..0a1537e259 100644 --- a/Items/VanillaArmorChanges/PalladiumArmorSetChange.cs +++ b/Items/VanillaArmorChanges/PalladiumArmorSetChange.cs @@ -1,5 +1,6 @@ -using Terraria; +using Terraria; using Terraria.ID; +using Terraria.ModLoader; namespace CalamityMod.Items.VanillaArmorChanges { diff --git a/Items/Weapons/Melee/ArkoftheAncients.cs b/Items/Weapons/Melee/ArkoftheAncients.cs index ebc026a8cd..fb73667aef 100644 --- a/Items/Weapons/Melee/ArkoftheAncients.cs +++ b/Items/Weapons/Melee/ArkoftheAncients.cs @@ -138,8 +138,8 @@ namespace CalamityMod.Items.Weapons.Melee float barScale = 1.3f; - var barBG = GetTexture("CalamityMod/ExtraTextures/GenericBarBack"); - var barFG = GetTexture("CalamityMod/ExtraTextures/GenericBarFront"); + var barBG = Request("CalamityMod/ExtraTextures/GenericBarBack").Value; + var barFG = Request("CalamityMod/ExtraTextures/GenericBarFront").Value; Vector2 drawPos = position + Vector2.UnitY * (frame.Height - 2) * scale + Vector2.UnitX * (frame.Width - barBG.Width * barScale) * scale * 0.5f; Rectangle frameCrop = new Rectangle(0, 0, (int)(Charge / 10f * barFG.Width), barFG.Height); diff --git a/Items/Weapons/Melee/ArkoftheCosmos.cs b/Items/Weapons/Melee/ArkoftheCosmos.cs index 16337b96f3..f114e27c56 100644 --- a/Items/Weapons/Melee/ArkoftheCosmos.cs +++ b/Items/Weapons/Melee/ArkoftheCosmos.cs @@ -1,4 +1,4 @@ -using Terraria.DataStructures; +using Terraria.DataStructures; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Melee; using CalamityMod.Tiles.Furniture.CraftingStations; @@ -205,8 +205,8 @@ namespace CalamityMod.Items.Weapons.Melee public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale) { - Texture2D handleTexture = GetTexture("CalamityMod/Items/Weapons/Melee/ArkoftheCosmosHandle"); - Texture2D bladeTexture = GetTexture("CalamityMod/Items/Weapons/Melee/ArkoftheCosmosGlow"); + Texture2D handleTexture = Request("CalamityMod/Items/Weapons/Melee/ArkoftheCosmosHandle").Value; + Texture2D bladeTexture = Request("CalamityMod/Items/Weapons/Melee/ArkoftheCosmosGlow").Value; float bladeOpacity = (Charge > 0) ? 1f : MathHelper.Clamp((float)Math.Sin(Main.GlobalTimeWrappedHourly % MathHelper.Pi) * 2f, 0, 1) * 0.7f + 0.3f; @@ -221,8 +221,8 @@ namespace CalamityMod.Items.Weapons.Melee if (Charge <= 0) return; - var barBG = GetTexture("CalamityMod/ExtraTextures/GenericBarBack"); - var barFG = GetTexture("CalamityMod/ExtraTextures/GenericBarFront"); + var barBG = Request("CalamityMod/ExtraTextures/GenericBarBack").Value; + var barFG = Request("CalamityMod/ExtraTextures/GenericBarFront").Value; float barScale = 3f; diff --git a/Items/Weapons/Melee/ArkoftheElements.cs b/Items/Weapons/Melee/ArkoftheElements.cs index 76e74eda5a..43b98c56d8 100644 --- a/Items/Weapons/Melee/ArkoftheElements.cs +++ b/Items/Weapons/Melee/ArkoftheElements.cs @@ -1,4 +1,4 @@ -using Terraria.DataStructures; +using Terraria.DataStructures; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; @@ -207,8 +207,8 @@ namespace CalamityMod.Items.Weapons.Melee public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale) { float extraScale = 0.3f; - Texture2D frontTexture = GetTexture("CalamityMod/Items/Weapons/Melee/ArkoftheElements"); - Texture2D backTexture = GetTexture("CalamityMod/Items/Weapons/Melee/ArkoftheElementsBack"); + Texture2D frontTexture = Request("CalamityMod/Items/Weapons/Melee/ArkoftheElements").Value; + Texture2D backTexture = Request("CalamityMod/Items/Weapons/Melee/ArkoftheElementsBack").Value; float tweakedScale = scale * (1 + extraScale); //Make the scale bigger to avoid crunching of the item Vector2 offset = (frontTexture.Size() * extraScale / 2f) * scale; @@ -223,8 +223,8 @@ namespace CalamityMod.Items.Weapons.Melee public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI) { - Texture2D frontTexture = GetTexture("CalamityMod/Items/Weapons/Melee/ArkoftheElements"); - Texture2D backTexture = GetTexture("CalamityMod/Items/Weapons/Melee/ArkoftheElementsBack"); + Texture2D frontTexture = Request("CalamityMod/Items/Weapons/Melee/ArkoftheElements").Value; + Texture2D backTexture = Request("CalamityMod/Items/Weapons/Melee/ArkoftheElementsBack").Value; spriteBatch.Draw(backTexture, Item.Center - Main.screenPosition, null, lightColor, rotation, Item.Size * 0.5f, scale, SpriteEffects.None, 0f); spriteBatch.Draw(frontTexture, Item.Center - Main.screenPosition, null, lightColor, rotation, Item.Size * 0.5f, scale, SpriteEffects.None, 0f); @@ -236,8 +236,8 @@ namespace CalamityMod.Items.Weapons.Melee if (Charge <= 0) return; - var barBG = GetTexture("CalamityMod/ExtraTextures/GenericBarBack"); - var barFG = GetTexture("CalamityMod/ExtraTextures/GenericBarFront"); + var barBG = Request("CalamityMod/ExtraTextures/GenericBarBack").Value; + var barFG = Request("CalamityMod/ExtraTextures/GenericBarFront").Value; float barScale = 3.5f; diff --git a/Items/Weapons/Melee/DragonPow.cs b/Items/Weapons/Melee/DragonPow.cs index 780af1a7e5..919fdfc198 100644 --- a/Items/Weapons/Melee/DragonPow.cs +++ b/Items/Weapons/Melee/DragonPow.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Melee; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ID; @@ -37,7 +37,7 @@ Summons a barrage of petals and waterfalls on enemy hits"); Item.noUseGraphic = true; Item.useStyle = ItemUseStyleID.Shoot; - Item.UseSound = Mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/YharonRoarShort"); + Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/YharonRoarShort"); Item.channel = true; Item.value = CalamityGlobalItem.Rarity15BuyPrice; diff --git a/Items/Weapons/Melee/TrueForbiddenOathblade.cs b/Items/Weapons/Melee/TrueForbiddenOathblade.cs index c9601dff4f..3c17f9993a 100644 --- a/Items/Weapons/Melee/TrueForbiddenOathblade.cs +++ b/Items/Weapons/Melee/TrueForbiddenOathblade.cs @@ -1,4 +1,4 @@ -using Terraria.DataStructures; +using Terraria.DataStructures; using Terraria.DataStructures; using CalamityMod.Items.Materials; using CalamityMod.Buffs.DamageOverTime; @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Weapons.Melee int index = 8; for (int i = -index; i <= index; i += index) { - Vector2 perturbedSpeed = new Vector2(velocity.X, speedY).RotatedBy(MathHelper.ToRadians(i)); + Vector2 perturbedSpeed = velocity.RotatedBy(MathHelper.ToRadians(i)); Projectile.NewProjectile(source, position, perturbedSpeed, type, damage / 2, knockback, player.whoAmI, 0f, 0f); } return false; diff --git a/Items/Weapons/Melee/Violence.cs b/Items/Weapons/Melee/Violence.cs index 4fece914b8..62f47cb0fc 100644 --- a/Items/Weapons/Melee/Violence.cs +++ b/Items/Weapons/Melee/Violence.cs @@ -1,4 +1,4 @@ -using Terraria.DataStructures; +using Terraria.DataStructures; using Terraria.DataStructures; using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; @@ -42,8 +42,7 @@ namespace CalamityMod.Items.Weapons.Melee public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Vector2 shootVelocity = new Vector2(velocity.X, speedY); - Projectile.NewProjectile(source, position, shootVelocity, type, damage, knockback, player.whoAmI, 0f, shootVelocity.ToRotation()); + Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, 0f, shootVelocity.ToRotation()); return false; } } diff --git a/Items/Weapons/Melee/VirulentKatana.cs b/Items/Weapons/Melee/VirulentKatana.cs index 06a99d5142..b6cafcf788 100644 --- a/Items/Weapons/Melee/VirulentKatana.cs +++ b/Items/Weapons/Melee/VirulentKatana.cs @@ -1,4 +1,4 @@ -using Terraria.DataStructures; +using Terraria.DataStructures; using Terraria.DataStructures; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Projectiles.Melee; @@ -38,7 +38,7 @@ namespace CalamityMod.Items.Weapons.Melee public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Projectile.NewProjectile(source, position, new Vector2(velocity.X, speedY), type, (int)(damage * 0.85), knockback, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(source, position, velocity, type, (int)(damage * 0.85), knockback, player.whoAmI, 0f, 0f); return false; } diff --git a/Items/Weapons/Ranged/AMR.cs b/Items/Weapons/Ranged/AMR.cs index a4bef9a32b..285c2c0ad8 100644 --- a/Items/Weapons/Ranged/AMR.cs +++ b/Items/Weapons/Ranged/AMR.cs @@ -1,4 +1,4 @@ -using Terraria.DataStructures; +using Terraria.DataStructures; using Terraria.DataStructures; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Ranged; @@ -32,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.knockBack = 9.5f; Item.value = Item.buyPrice(1, 80, 0, 0); Item.rare = ItemRarityID.Red; - Item.UseSound = Mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LargeWeaponFire"); + Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/LargeWeaponFire"); Item.autoReuse = true; Item.shoot = ProjectileID.Bullet; Item.shootSpeed = 12f; diff --git a/Items/Weapons/Ranged/ChargedDartRifle.cs b/Items/Weapons/Ranged/ChargedDartRifle.cs index f37bd4305e..848022436d 100644 --- a/Items/Weapons/Ranged/ChargedDartRifle.cs +++ b/Items/Weapons/Ranged/ChargedDartRifle.cs @@ -1,4 +1,4 @@ -using Terraria.DataStructures; +using Terraria.DataStructures; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.knockBack = 7f; Item.value = CalamityGlobalItem.Rarity10BuyPrice; Item.rare = ItemRarityID.Red; - Item.UseSound = Mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LaserCannon"); + Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/LaserCannon"); Item.autoReuse = true; Item.shootSpeed = 22f; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Ranged/ClamorRifle.cs b/Items/Weapons/Ranged/ClamorRifle.cs index 0fb9838927..85cd317d3b 100644 --- a/Items/Weapons/Ranged/ClamorRifle.cs +++ b/Items/Weapons/Ranged/ClamorRifle.cs @@ -1,5 +1,4 @@ -using Terraria.DataStructures; -using Terraria.DataStructures; +using Terraria.DataStructures; using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; @@ -28,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.noMelee = true; Item.knockBack = 2.5f; Item.value = Item.buyPrice(0, 36, 0, 0); - Item.UseSound = Mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/PlasmaBolt"); + Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/PlasmaBolt"); Item.autoReuse = true; Item.rare = ItemRarityID.Pink; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Ranged/DodusHandcannon.cs b/Items/Weapons/Ranged/DodusHandcannon.cs index 6596fa45bb..3bb5c2d2a2 100644 --- a/Items/Weapons/Ranged/DodusHandcannon.cs +++ b/Items/Weapons/Ranged/DodusHandcannon.cs @@ -1,4 +1,4 @@ -using Terraria.DataStructures; +using Terraria.DataStructures; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.knockBack = 6f; // Reduce volume to 30% so it stops destroying people's ears. - var sound = Mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LargeWeaponFire"); + var sound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/LargeWeaponFire"); Item.UseSound = sound?.WithVolume(0.3f); Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Ranged/ElementalBlaster.cs b/Items/Weapons/Ranged/ElementalBlaster.cs index a8403fc083..8f7f364135 100644 --- a/Items/Weapons/Ranged/ElementalBlaster.cs +++ b/Items/Weapons/Ranged/ElementalBlaster.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria.ID; @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.knockBack = 1.75f; Item.value = CalamityGlobalItem.Rarity11BuyPrice; Item.rare = ItemRarityID.Purple; - Item.UseSound = Mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/PlasmaBolt"); + Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/PlasmaBolt"); Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 18f; diff --git a/Items/Weapons/Ranged/FlakKraken.cs b/Items/Weapons/Ranged/FlakKraken.cs index bd20e1e659..b485e46628 100644 --- a/Items/Weapons/Ranged/FlakKraken.cs +++ b/Items/Weapons/Ranged/FlakKraken.cs @@ -1,4 +1,4 @@ -using Terraria.DataStructures; +using Terraria.DataStructures; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using CalamityMod.Projectiles.Ranged; @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.knockBack = 0f; Item.value = Item.buyPrice(0, 60, 0, 0); Item.rare = ItemRarityID.Lime; - Item.UseSound = Mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LaserCannon"); + Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/LaserCannon"); Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 30f; //30 } diff --git a/Items/Weapons/Ranged/HandheldTank.cs b/Items/Weapons/Ranged/HandheldTank.cs index 98ec67ff05..ce3eb03f39 100644 --- a/Items/Weapons/Ranged/HandheldTank.cs +++ b/Items/Weapons/Ranged/HandheldTank.cs @@ -1,4 +1,4 @@ -using Terraria.DataStructures; +using Terraria.DataStructures; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.autoReuse = true; Item.useStyle = ItemUseStyleID.Shoot; - Item.UseSound = Mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/TankCannon"); + Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/TankCannon"); Item.noMelee = true; Item.value = CalamityGlobalItem.Rarity12BuyPrice; diff --git a/Items/Weapons/Ranged/Karasawa.cs b/Items/Weapons/Ranged/Karasawa.cs index 87ec647433..7b5dd4c642 100644 --- a/Items/Weapons/Ranged/Karasawa.cs +++ b/Items/Weapons/Ranged/Karasawa.cs @@ -1,4 +1,4 @@ -using Terraria.DataStructures; +using Terraria.DataStructures; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Ranged; using CalamityMod.Tiles.Furniture.CraftingStations; @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.autoReuse = true; Item.useStyle = ItemUseStyleID.Shoot; - Item.UseSound = Mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/MechGaussRifle"); + Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/MechGaussRifle"); Item.noMelee = true; Item.value = CalamityGlobalItem.Rarity14BuyPrice; diff --git a/Items/Weapons/Ranged/MagnaStriker.cs b/Items/Weapons/Ranged/MagnaStriker.cs index 80f21ca436..39b7d9114e 100644 --- a/Items/Weapons/Ranged/MagnaStriker.cs +++ b/Items/Weapons/Ranged/MagnaStriker.cs @@ -1,4 +1,4 @@ -using Terraria.DataStructures; +using Terraria.DataStructures; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.knockBack = 2.25f; Item.value = Item.buyPrice(0, 80, 0, 0); Item.rare = ItemRarityID.Yellow; - Item.UseSound = Mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/OpalStrike"); + Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/OpalStrike"); Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 15f; diff --git a/Items/Weapons/Ranged/OpalStriker.cs b/Items/Weapons/Ranged/OpalStriker.cs index 021058d6fe..313dc71698 100644 --- a/Items/Weapons/Ranged/OpalStriker.cs +++ b/Items/Weapons/Ranged/OpalStriker.cs @@ -1,4 +1,4 @@ -using Terraria.DataStructures; +using Terraria.DataStructures; using Terraria.DataStructures; using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.knockBack = 0f; Item.value = Item.buyPrice(0, 2, 0, 0); Item.rare = ItemRarityID.Green; - Item.UseSound = Mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/OpalStrike"); + Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/OpalStrike"); Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 6f; diff --git a/Items/Weapons/Ranged/TyrannysEnd.cs b/Items/Weapons/Ranged/TyrannysEnd.cs index 803e2d54ac..f7ac54aa48 100644 --- a/Items/Weapons/Ranged/TyrannysEnd.cs +++ b/Items/Weapons/Ranged/TyrannysEnd.cs @@ -1,4 +1,4 @@ -using Terraria.DataStructures; +using Terraria.DataStructures; using Terraria.DataStructures; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Ranged; @@ -36,7 +36,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 32; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; - Item.UseSound = Mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LargeWeaponFire"); + Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/LargeWeaponFire"); Item.value = CalamityGlobalItem.Rarity15BuyPrice; Item.Calamity().customRarity = CalamityRarity.Violet; diff --git a/Items/Weapons/Summon/AngryChickenStaff.cs b/Items/Weapons/Summon/AngryChickenStaff.cs index 56cbf342ec..735e27b1e0 100644 --- a/Items/Weapons/Summon/AngryChickenStaff.cs +++ b/Items/Weapons/Summon/AngryChickenStaff.cs @@ -1,4 +1,4 @@ -using Terraria.DataStructures; +using Terraria.DataStructures; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.value = CalamityGlobalItem.Rarity15BuyPrice; Item.rare = ItemRarityID.Purple; Item.Calamity().customRarity = CalamityRarity.Violet; - Item.UseSound = Mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/FlareSound"); + Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/FlareSound"); Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 10f; diff --git a/Items/Weapons/Summon/SlimePuppetStaff.cs b/Items/Weapons/Summon/SlimePuppetStaff.cs index 10b5b40f6c..d37c27e857 100644 --- a/Items/Weapons/Summon/SlimePuppetStaff.cs +++ b/Items/Weapons/Summon/SlimePuppetStaff.cs @@ -1,4 +1,4 @@ -using Terraria.DataStructures; +using Terraria.DataStructures; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.knockBack = 3.6f; Item.value = CalamityGlobalItem.Rarity4BuyPrice; Item.rare = ItemRarityID.LightRed; - Item.UseSound = Mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/SlimeGodPossession"); + Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/SlimeGodPossession"); Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; diff --git a/Items/Weapons/Summon/UniverseSplitter.cs b/Items/Weapons/Summon/UniverseSplitter.cs index 16b345bc8f..3c29b0b17c 100644 --- a/Items/Weapons/Summon/UniverseSplitter.cs +++ b/Items/Weapons/Summon/UniverseSplitter.cs @@ -1,4 +1,4 @@ -using Terraria.DataStructures; +using Terraria.DataStructures; using CalamityMod.Items.Materials; using CalamityMod.Items.SummonItems; using CalamityMod.Projectiles.Summon; @@ -78,7 +78,9 @@ namespace CalamityMod.Items.Weapons.Summon public override void AddRecipes() { - CreateRecipe(1).AddIngredient(ModContent.ItemType()).AddIngredient(ModContent.ItemType()).AddIngredient(ModContent.ItemType(), 5).AddTile(ModContent.TileType()).Register(); + // TODO -- Draedon's remote appears to not exist as of 1.4 porting. Is this intentional or did something go wrong? + CreateRecipe(1).AddIngredient(ModContent.ItemType()).AddIngredient(ModContent.ItemType(), 5).AddTile(ModContent.TileType()).Register(); + //CreateRecipe(1).AddIngredient(ModContent.ItemType()).AddIngredient(ModContent.ItemType()).AddIngredient(ModContent.ItemType(), 5).AddTile(ModContent.TileType()).Register(); } } } diff --git a/Items/Weapons/Summon/VileFeeder.cs b/Items/Weapons/Summon/VileFeeder.cs index 2b9c3e8cef..f069641f40 100644 --- a/Items/Weapons/Summon/VileFeeder.cs +++ b/Items/Weapons/Summon/VileFeeder.cs @@ -1,4 +1,4 @@ -using Terraria.DataStructures; +using Terraria.DataStructures; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using System; @@ -43,8 +43,6 @@ namespace CalamityMod.Items.Weapons.Summon { int i = Main.myPlayer; float num72 = Item.shootSpeed; - float knockback = knockBack; - knockback = player.GetWeaponKnockback(Item, knockback); player.itemTime = Item.useTime; Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; diff --git a/Items/Weapons/Summon/ViridVanguard.cs b/Items/Weapons/Summon/ViridVanguard.cs index c47f8c6efc..4aa6759bbd 100644 --- a/Items/Weapons/Summon/ViridVanguard.cs +++ b/Items/Weapons/Summon/ViridVanguard.cs @@ -1,4 +1,4 @@ -using Terraria.DataStructures; +using Terraria.DataStructures; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; @@ -55,7 +55,7 @@ namespace CalamityMod.Items.Weapons.Summon { if (Main.projectile[i].active && Main.projectile[i].type == type && Main.projectile[i].owner == player.whoAmI) { - if ((Main.projectile[i].modProjectile as ViridVanguardBlade).FiringTime > 0f) + if ((Main.projectile[i].ModProjectile as ViridVanguardBlade).FiringTime > 0f) continue; swordCount++; for (int j = 0; j < 22; j++) @@ -68,12 +68,12 @@ namespace CalamityMod.Items.Weapons.Summon } Projectile newBlade = Projectile.NewProjectileDirect(source, position, Vector2.Zero, type, damage, knockback, player.whoAmI); - (newBlade.modProjectile as ViridVanguardBlade).AltTexture = swordCount % 2 == 1; + (newBlade.ModProjectile as ViridVanguardBlade).AltTexture = swordCount % 2 == 1; newBlade.netUpdate = true; swordCount++; newBlade = Projectile.NewProjectileDirect(source, position, Vector2.Zero, type, damage, knockback, player.whoAmI); - (newBlade.modProjectile as ViridVanguardBlade).AltTexture = swordCount % 2 == 1; + (newBlade.ModProjectile as ViridVanguardBlade).AltTexture = swordCount % 2 == 1; newBlade.netUpdate = true; swordCount++; @@ -83,7 +83,7 @@ namespace CalamityMod.Items.Weapons.Summon { if (Main.projectile[i].active && Main.projectile[i].type == type && Main.projectile[i].owner == player.whoAmI) { - if ((Main.projectile[i].modProjectile as ViridVanguardBlade).FiringTime > 0f) + if ((Main.projectile[i].ModProjectile as ViridVanguardBlade).FiringTime > 0f) continue; Main.projectile[i].ai[0] = angle; Main.projectile[i].localAI[1] = 80f; diff --git a/Items/Weapons/Typeless/AeroDynamite.cs b/Items/Weapons/Typeless/AeroDynamite.cs index 449679fa57..857d312dde 100644 --- a/Items/Weapons/Typeless/AeroDynamite.cs +++ b/Items/Weapons/Typeless/AeroDynamite.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Typeless; using Terraria; using Terraria.ID; diff --git a/Items/Weapons/Typeless/EyeofMagnus.cs b/Items/Weapons/Typeless/EyeofMagnus.cs index 212f742a8b..f800c64fae 100644 --- a/Items/Weapons/Typeless/EyeofMagnus.cs +++ b/Items/Weapons/Typeless/EyeofMagnus.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Magic; +using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Typeless Item.useTime = 20; Item.useStyle = ItemUseStyleID.Shoot; Item.knockBack = 5f; - Item.UseSound = Mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LaserCannon"); + Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/LaserCannon"); Item.autoReuse = true; Item.noMelee = true; Item.height = 50; @@ -40,7 +40,7 @@ namespace CalamityMod.Items.Weapons.Typeless } // Eye of Magnus scales off of all damage types simultaneously (meaning it scales 5x from universal damage boosts). - public override void ModifyWeaponDamage(Player player, ref float add, ref float mult, ref float flat) + public override void ModifyWeaponDamage(Player player, ref StatModifier damage, ref float flat) { float formula = 5f * (player.GetDamage() - 1f); formula += player.GetDamage(DamageClass.Melee) - 1f; @@ -48,7 +48,7 @@ namespace CalamityMod.Items.Weapons.Typeless formula += player.GetDamage(DamageClass.Magic) - 1f; formula += player.GetDamage(DamageClass.Summon) - 1f; formula += player.Calamity().throwingDamage - 1f; - add += formula; + damage += formula; } public override void AddRecipes() diff --git a/Items/Weapons/Typeless/GoldenGun.cs b/Items/Weapons/Typeless/GoldenGun.cs index f97f7de269..2698185542 100644 --- a/Items/Weapons/Typeless/GoldenGun.cs +++ b/Items/Weapons/Typeless/GoldenGun.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Items.Weapons.Typeless public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Projectile.NewProjectile(source, position, velocity, type, damage, knockBack, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, 0f, 0f); return false; } diff --git a/Items/Weapons/Typeless/LunicEye.cs b/Items/Weapons/Typeless/LunicEye.cs index 1fdc00c1b9..6d698063fd 100644 --- a/Items/Weapons/Typeless/LunicEye.cs +++ b/Items/Weapons/Typeless/LunicEye.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Materials; +using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Typeless Item.useTime = 15; Item.useStyle = ItemUseStyleID.Shoot; Item.knockBack = 4.5f; - Item.UseSound = Mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LaserCannon"); + Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/LaserCannon"); Item.autoReuse = true; Item.noMelee = true; Item.height = 50; @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Weapons.Typeless } // Lunic Eye scales off of all damage types simultaneously (meaning it scales 5x from universal damage boosts). - public override void ModifyWeaponDamage(Player player, ref float add, ref float mult, ref float flat) + public override void ModifyWeaponDamage(Player player, ref StatModifier damage, ref float flat) { float formula = 5f * (player.GetDamage() - 1f); formula += player.GetDamage(DamageClass.Melee) - 1f; @@ -49,7 +49,7 @@ namespace CalamityMod.Items.Weapons.Typeless formula += player.GetDamage(DamageClass.Magic) - 1f; formula += player.GetDamage(DamageClass.Summon) - 1f; formula += player.Calamity().throwingDamage - 1f; - add += formula; + damage += formula; } public override void AddRecipes() diff --git a/NPCs/AdultEidolonWyrm/AEWSky.cs b/NPCs/AdultEidolonWyrm/AEWSky.cs index c8cc1ea07c..5914ed6c07 100644 --- a/NPCs/AdultEidolonWyrm/AEWSky.cs +++ b/NPCs/AdultEidolonWyrm/AEWSky.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.Graphics.Effects; using Terraria.ModLoader; @@ -63,7 +64,7 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm if (maxDepth >= 0 && minDepth < 0) { float intensity = GetIntensity(); - spriteBatch.Draw(Main.blackTileTexture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), new Color(0, 0, 15) * intensity); + spriteBatch.Draw(TextureAssets.BlackTile.Value, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), new Color(0, 0, 15) * intensity); } } diff --git a/NPCs/Calamitas/CalSky.cs b/NPCs/Calamitas/CalSky.cs index bbe8d2ed6d..1d2acb3777 100644 --- a/NPCs/Calamitas/CalSky.cs +++ b/NPCs/Calamitas/CalSky.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.Graphics.Effects; using Terraria.ModLoader; @@ -69,7 +70,7 @@ namespace CalamityMod.NPCs.Calamitas if (maxDepth >= 0 && minDepth < 0) { float intensity = this.GetIntensity(); - spriteBatch.Draw(Main.blackTileTexture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.Black * intensity); + spriteBatch.Draw(TextureAssets.BlackTile.Value, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.Black * intensity); } } diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 4dab1d9026..430ac2b8c6 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -4139,7 +4139,7 @@ namespace CalamityMod.NPCs { bool appropriatePlayer = Main.myPlayer == playerIndex; if (Main.player[playerIndex].active && appropriatePlayer) - Main.player[playerIndex].Spawn(); + Main.player[playerIndex].Spawn(PlayerSpawnContext.RecallFromItem); } } } diff --git a/NPCs/DevourerofGods/DoGSky.cs b/NPCs/DevourerofGods/DoGSky.cs index b65627933e..30969cb114 100644 --- a/NPCs/DevourerofGods/DoGSky.cs +++ b/NPCs/DevourerofGods/DoGSky.cs @@ -1,8 +1,9 @@ -using CalamityMod.Events; +using CalamityMod.Events; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.GameContent; using Terraria.Graphics.Effects; using Terraria.ModLoader; @@ -77,12 +78,12 @@ namespace CalamityMod.NPCs.DevourerofGods double blackScreenLife_GateValue = lifeRatio < 0.6f && CalamityWorld.DoGSecondStageCountdown <= 2 ? 0.09 : 0.66; if (Main.npc[DoGIndex].life < Main.npc[DoGIndex].lifeMax * blackScreenLife_GateValue || CalamityWorld.death || BossRushEvent.BossRushActive) { - spriteBatch.Draw(Main.blackTileTexture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), + spriteBatch.Draw(TextureAssets.BlackTile.Value, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.Black * (intensity + 0.5f)); } else { - spriteBatch.Draw(Main.blackTileTexture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), + spriteBatch.Draw(TextureAssets.BlackTile.Value, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), (Main.npc[DoGIndex].ai[3] == 0f ? Color.Cyan : Color.Fuchsia) * intensity); } } diff --git a/NPCs/Leviathan/LevSky.cs b/NPCs/Leviathan/LevSky.cs index cd5a84f2de..3c6fba8994 100644 --- a/NPCs/Leviathan/LevSky.cs +++ b/NPCs/Leviathan/LevSky.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.Graphics.Effects; using Terraria.ModLoader; @@ -74,7 +75,7 @@ namespace CalamityMod.NPCs.Leviathan if (maxDepth >= 0 && minDepth < 0) { float intensity = GetIntensity(); - spriteBatch.Draw(Main.blackTileTexture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), new Color(0, 0, 15) * intensity); + spriteBatch.Draw(TextureAssets.BlackTile.Value, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), new Color(0, 0, 15) * intensity); } } diff --git a/NPCs/NormalNPCs/ArmoredDiggerHead.cs b/NPCs/NormalNPCs/ArmoredDiggerHead.cs index 2f06616ae1..d0479d9a5c 100644 --- a/NPCs/NormalNPCs/ArmoredDiggerHead.cs +++ b/NPCs/NormalNPCs/ArmoredDiggerHead.cs @@ -417,7 +417,8 @@ namespace CalamityMod.NPCs.NormalNPCs public override void ModifyNPCLoot(NPCLoot npcLoot) { - npcLoot.Add(ModContent.ItemType(), 3); + // TODO -- Draedon's remote appears to not exist as of 1.4 porting. Is this intentional or did something go wrong? + // npcLoot.Add(ModContent.ItemType(), 3); npcLoot.Add(ModContent.ItemType(), 1, 2, 4); npcLoot.Add(ModContent.ItemType(), 1, 4, 8); npcLoot.Add(ModContent.ItemType(), 1, 4, 8); diff --git a/NPCs/NormalNPCs/Sunskater.cs b/NPCs/NormalNPCs/Sunskater.cs index e4ff9841f4..252b352d28 100644 --- a/NPCs/NormalNPCs/Sunskater.cs +++ b/NPCs/NormalNPCs/Sunskater.cs @@ -33,7 +33,7 @@ namespace CalamityMod.NPCs.NormalNPCs AIType = -1; NPC.value = Item.buyPrice(0, 0, 5, 0); NPC.HitSound = SoundID.NPCHit50; - NPC.DeathSound = Mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/Sunskater"); + NPC.DeathSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCKilled/Sunskater"); NPC.knockBackResist = 0.7f; Banner = NPC.type; BannerItem = ModContent.ItemType(); diff --git a/NPCs/PlaguebringerGoliath/PbGSky.cs b/NPCs/PlaguebringerGoliath/PbGSky.cs index 451b05d2f5..7b002303d6 100644 --- a/NPCs/PlaguebringerGoliath/PbGSky.cs +++ b/NPCs/PlaguebringerGoliath/PbGSky.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.Graphics.Effects; using Terraria.ModLoader; @@ -69,7 +70,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath if (maxDepth >= 0 && minDepth < 0) { float intensity = this.GetIntensity(); - spriteBatch.Draw(Main.blackTileTexture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.Black * intensity); + spriteBatch.Draw(TextureAssets.BlackTile.Value, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.Black * intensity); } } diff --git a/NPCs/Providence/ProvSky.cs b/NPCs/Providence/ProvSky.cs index 006bc9237d..4844e93574 100644 --- a/NPCs/Providence/ProvSky.cs +++ b/NPCs/Providence/ProvSky.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.Graphics.Effects; using Terraria.ModLoader; @@ -73,7 +74,7 @@ namespace CalamityMod.NPCs.Providence { float intensity = GetIntensity(); Color color = Main.dayTime ? new Color(255, 200, 100) : new Color(100, 150, 255); - spriteBatch.Draw(Main.blackTileTexture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), color * intensity); + spriteBatch.Draw(TextureAssets.BlackTile.Value, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), color * intensity); } } diff --git a/NPCs/Signus/SignusSky.cs b/NPCs/Signus/SignusSky.cs index ea0bb1bdf5..fe449714bb 100644 --- a/NPCs/Signus/SignusSky.cs +++ b/NPCs/Signus/SignusSky.cs @@ -1,8 +1,9 @@ -using CalamityMod.Events; +using CalamityMod.Events; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.GameContent; using Terraria.Graphics.Effects; using Terraria.ModLoader; @@ -76,7 +77,7 @@ namespace CalamityMod.NPCs.Signus if (maxDepth >= 0 && minDepth < 0) { float intensity = this.GetIntensity(); - spriteBatch.Draw(Main.blackTileTexture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.Black * intensity); + spriteBatch.Draw(TextureAssets.BlackTile.Value, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.Black * intensity); } } diff --git a/NPCs/Yharon/YSky.cs b/NPCs/Yharon/YSky.cs index b553f8a588..ad1084428d 100644 --- a/NPCs/Yharon/YSky.cs +++ b/NPCs/Yharon/YSky.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.Graphics.Effects; using Terraria.ModLoader; @@ -69,7 +70,7 @@ namespace CalamityMod.NPCs.Yharon if (maxDepth >= 0 && minDepth < 0) { float intensity = this.GetIntensity(); - spriteBatch.Draw(Main.blackTileTexture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), new Color(77, 19, 0) * intensity); + spriteBatch.Draw(TextureAssets.BlackTile.Value, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), new Color(77, 19, 0) * intensity); } } diff --git a/Particles/RancorGroundLavaParticleSet.cs b/Particles/RancorGroundLavaParticleSet.cs index befe8caeb6..374877195c 100644 --- a/Particles/RancorGroundLavaParticleSet.cs +++ b/Particles/RancorGroundLavaParticleSet.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Particles }; public override List BackgroundTextures => new List() { - ModContent.Request("CalamityMod/Projectiles/InvisibleProj"), + ModContent.Request("CalamityMod/Projectiles/InvisibleProj").Value, }; public override FusableParticle SpawnParticle(Vector2 center, float sizeStrength) { @@ -38,7 +38,7 @@ namespace CalamityMod.Particles public override void DrawParticles() { - Texture2D fusableParticleBase = ModContent.Request("CalamityMod/ExtraTextures/FusableParticleBase"); + Texture2D fusableParticleBase = ModContent.Request("CalamityMod/ExtraTextures/FusableParticleBase").Value; foreach (FusableParticle particle in Particles) { Vector2 drawPosition = particle.Center - Main.screenPosition; diff --git a/Particles/RancorLavaParticleSet.cs b/Particles/RancorLavaParticleSet.cs index 4eff579bce..91e3f923cc 100644 --- a/Particles/RancorLavaParticleSet.cs +++ b/Particles/RancorLavaParticleSet.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System.Collections.Generic; using System.Linq; @@ -21,7 +21,7 @@ namespace CalamityMod.Particles }; public override List BackgroundTextures => new List() { - ModContent.Request("CalamityMod/Projectiles/InvisibleProj"), + ModContent.Request("CalamityMod/Projectiles/InvisibleProj").Value, }; public override FusableParticle SpawnParticle(Vector2 center, float sizeStrength) { @@ -38,7 +38,7 @@ namespace CalamityMod.Particles public override void DrawParticles() { - Texture2D fusableParticleBase = ModContent.Request("CalamityMod/ExtraTextures/FusableParticleBase"); + Texture2D fusableParticleBase = ModContent.Request("CalamityMod/ExtraTextures/FusableParticleBase").Value; foreach (FusableParticle particle in Particles) { Vector2 drawPosition = particle.Center - Main.screenPosition; diff --git a/Particles/SquishyLightParticle.cs b/Particles/SquishyLightParticle.cs index 71a4c2e43a..066346f511 100644 --- a/Particles/SquishyLightParticle.cs +++ b/Particles/SquishyLightParticle.cs @@ -45,8 +45,8 @@ namespace CalamityMod.Particles public override void CustomDraw(SpriteBatch spriteBatch) { - Texture2D tex = ModContent.Request("CalamityMod/Particles/Light"); - Texture2D bloomTex = ModContent.Request("CalamityMod/Particles/BloomCircle"); + Texture2D tex = ModContent.Request("CalamityMod/Particles/Light").Value; + Texture2D bloomTex = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; float squish = MathHelper.Clamp(Velocity.Length() / 10f * SquishStrenght, 1f, MaxSquish); diff --git a/Particles/ThunderBoltVFX.cs b/Particles/ThunderBoltVFX.cs index b86167a721..2aee62fe35 100644 --- a/Particles/ThunderBoltVFX.cs +++ b/Particles/ThunderBoltVFX.cs @@ -1,6 +1,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.ModLoader; namespace CalamityMod.Particles { diff --git a/Projectiles/Melee/EonBolt.cs b/Projectiles/Melee/EonBolt.cs index d9b85dc2f8..4c54f9b710 100644 --- a/Projectiles/Melee/EonBolt.cs +++ b/Projectiles/Melee/EonBolt.cs @@ -108,7 +108,7 @@ namespace CalamityMod.Projectiles.Melee GameShaders.Misc["CalamityMod:TrailStreak"].SetShaderTexture(Request("CalamityMod/ExtraTextures/ScarletDevilStreak").Value); TrailDrawer.Draw(Projectile.oldPos, Projectile.Size * 0.5f - Main.screenPosition, 30); - Texture2D texture = GetTexture("CalamityMod/Projectiles/Melee/GalaxiaBolt").Value; + Texture2D texture = Request("CalamityMod/Projectiles/Melee/GalaxiaBolt").Value; Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, null, Color.Lerp(lightColor, Color.White, 0.5f), Projectile.rotation, texture.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; diff --git a/Projectiles/Melee/GalaxiaTropicRing.cs b/Projectiles/Melee/GalaxiaTropicRing.cs index e4cbbb63c0..6dc490310f 100644 --- a/Projectiles/Melee/GalaxiaTropicRing.cs +++ b/Projectiles/Melee/GalaxiaTropicRing.cs @@ -73,16 +73,16 @@ namespace CalamityMod.Projectiles.Melee public override bool PreDraw(ref Color lightColor) { - Texture2D sigil = GetTexture(Mode == 0 ? "CalamityMod/Projectiles/Melee/GalaxiaCancer" : "CalamityMod/Projectiles/Melee/GalaxiaCapricorn"); //OMG Karkat and Gamzee from homestuck i am a big fan - Texture2D ring = GetTexture("CalamityMod/Particles/BloomRing"); - Texture2D starTexture = GetTexture("CalamityMod/Particles/Sparkle"); - Texture2D lineTexture = GetTexture("CalamityMod/Particles/BloomLine"); - Texture2D bloomTexture = GetTexture("CalamityMod/Particles/BloomCircle"); + Texture2D sigil = Request(Mode == 0 ? "CalamityMod/Projectiles/Melee/GalaxiaCancer" : "CalamityMod/Projectiles/Melee/GalaxiaCapricorn").Value; //OMG Karkat and Gamzee from homestuck i am a big fan + Texture2D ring = Request("CalamityMod/Particles/BloomRing").Value; + Texture2D starTexture = Request("CalamityMod/Particles/Sparkle").Value; + Texture2D lineTexture = Request("CalamityMod/Particles/BloomLine").Value; + Texture2D bloomTexture = Request("CalamityMod/Particles/BloomCircle").Value; Color ringColor = Mode == 0 ? new Color(255, 0, 0) * Fade : new Color(66, 0, 176) * Fade; Main.spriteBatch.End(); - Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, Main.DefaultSamplerState, DepthStencilState.None, Main.instance.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); Main.EntitySpriteDraw(bloomTexture, Projectile.Center - Main.screenPosition, null, ringColor * 0.5f, 0, bloomTexture.Size() / 2f, 2.5f, SpriteEffects.None, 0); Main.EntitySpriteDraw(ring, Projectile.Center - Main.screenPosition, null, ringColor * 0.8f, 0f, ring.Size() / 2f, Projectile.scale, 0f, 0); @@ -108,7 +108,7 @@ namespace CalamityMod.Projectiles.Melee } 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); return false; } diff --git a/Projectiles/Ranged/ImpactRound.cs b/Projectiles/Ranged/ImpactRound.cs index b5963bdf08..39d1611c5c 100644 --- a/Projectiles/Ranged/ImpactRound.cs +++ b/Projectiles/Ranged/ImpactRound.cs @@ -40,13 +40,13 @@ namespace CalamityMod.Projectiles.Ranged public override void AI() { - if (!initialized && Projectile.ranged) //Ranged check prevents quiver splits triggering the sound + if (!initialized && Projectile.CountsAsClass(DamageClass.Ranged)) //Ranged check prevents quiver splits triggering the sound { initialized = true; if (Main.netMode != NetmodeID.Server) { - var sound = Mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LargeWeaponFire"); + var sound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/LargeWeaponFire"); sound = sound.WithVolume(sound.Volume * 0.45f); SoundEngine.PlaySound(sound, Projectile.Center); } diff --git a/Projectiles/Typeless/BobbitHead.cs b/Projectiles/Typeless/BobbitHead.cs index ccddc294ce..194db4e8bf 100644 --- a/Projectiles/Typeless/BobbitHead.cs +++ b/Projectiles/Typeless/BobbitHead.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawHook(Projectile, GetTexture("CalamityMod/ExtraTextures/Chains/BobbitHookChain")); + CalamityUtils.DrawHook(Projectile, Request("CalamityMod/ExtraTextures/Chains/BobbitHookChain").Value); return true; } diff --git a/Projectiles/Typeless/SerpentsBiteHook.cs b/Projectiles/Typeless/SerpentsBiteHook.cs index b1ea9073f8..fe351be693 100644 --- a/Projectiles/Typeless/SerpentsBiteHook.cs +++ b/Projectiles/Typeless/SerpentsBiteHook.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Typeless public override bool PreDraw(ref Color lightColor) { - CalamityUtils.DrawHook(Projectile, GetTexture("CalamityMod/ExtraTextures/Chains/SerpentsBiteChain")); + CalamityUtils.DrawHook(Projectile, Request("CalamityMod/ExtraTextures/Chains/SerpentsBiteChain").Value); return true; } diff --git a/Projectiles/Typeless/WaterConvertor.cs b/Projectiles/Typeless/WaterConvertor.cs index a1f4ef853b..bb7ba1a856 100644 --- a/Projectiles/Typeless/WaterConvertor.cs +++ b/Projectiles/Typeless/WaterConvertor.cs @@ -1,4 +1,4 @@ -using CalamityMod.World; +using CalamityMod.World; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Typeless ConvertShit(Projectile); } - public void ConvertShit(Projectile projectile) + public static void ConvertShit(Projectile projectile) { if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -58,16 +58,13 @@ namespace CalamityMod.Projectiles.Typeless if (projectile.ai[0] == 4f) { AstralBiome.ConvertToAstral(i, j); - NetMessage.SendTileRange(-1, i, j, 1, 1); + NetMessage.SendTileSquare(-1, i, j, 1, 1); } } } } } - public override bool CanDamage() - { - return false; - } + public override bool? CanDamage() => false; } } diff --git a/Schematics/CalamitySchematicIO.cs b/Schematics/CalamitySchematicIO.cs index 907d5f239d..ef66114028 100644 --- a/Schematics/CalamitySchematicIO.cs +++ b/Schematics/CalamitySchematicIO.cs @@ -69,17 +69,17 @@ namespace CalamityMod.Schematics { target.CopyFrom(replacement); target.WallType = original.WallType; - target.wallFrameX(original.wallFrameX()); - target.wallFrameY(original.wallFrameY()); - target.wallColor(original.wallColor()); + target.wallFrameX(original.WallFrameX); + target.wallFrameY(original.WallFrameY); + target.wallColor(original.WallColor); } else if (keepTile) // tile from original, wall from replacement { target.CopyFrom(original); target.WallType = replacement.WallType; - target.wallFrameX(replacement.wallFrameX()); - target.wallFrameY(replacement.wallFrameY()); - target.wallColor(replacement.wallColor()); + target.wallFrameX(replacement.WallFrameX); + target.wallFrameY(replacement.WallFrameY); + target.wallColor(replacement.WallColor); } } } @@ -181,8 +181,8 @@ namespace CalamityMod.Schematics bool framesMatch = t.TileFrameX == smt.frameX; framesMatch &= t.TileFrameY == smt.frameY; // Wall frames are not checked separately because these are computed from binary headers. - // wallFrameX() => (bTileHeader2 & 0xF) * 36; - // wallFrameY() => (bTileHeader3 & 7) * 36; + // WallFrameX => (bTileHeader2 & 0xF) * 36; + // WallFrameY => (bTileHeader3 & 7) * 36; if (!framesMatch) return false; diff --git a/Skies/AstralScreenShaderData.cs b/Skies/AstralScreenShaderData.cs index e8527c6ecb..ce45e8fd11 100644 --- a/Skies/AstralScreenShaderData.cs +++ b/Skies/AstralScreenShaderData.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; @@ -12,7 +12,7 @@ namespace CalamityMod.Skies public override void Apply() { - Vector3 vec = Main.bgColor.ToVector3(); + Vector3 vec = Main.ColorOfTheSkies.ToVector3(); vec *= 0.4f; base.UseOpacity(Math.Max(vec.X, Math.Max(vec.Y, vec.Z))); base.Apply(); diff --git a/Skies/AstralSky.cs b/Skies/AstralSky.cs index 565823082e..cb1a76341f 100644 --- a/Skies/AstralSky.cs +++ b/Skies/AstralSky.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.Graphics.Effects; using Terraria.ID; @@ -35,7 +36,7 @@ namespace CalamityMod.Skies { if (maxDepth >= 3.40282347E+38f && minDepth < 3.40282347E+38f) { - spriteBatch.Draw(CalamityMod.AstralSky, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Main.bgColor * opacity); + spriteBatch.Draw(CalamityMod.AstralSky, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Main.ColorOfTheSkies * opacity); //Terraria's conditions. if (Main.netMode != NetmodeID.Server) @@ -46,7 +47,7 @@ namespace CalamityMod.Skies if (star == null) continue; - Texture2D t2D = Main.starTexture[star.type]; + Texture2D t2D = TextureAssets.Star[star.type].Value; Vector2 origin = new Vector2(t2D.Width * 0.5f, t2D.Height * 0.5f); int bgTop = (int)((-Main.screenPosition.Y) / (Main.worldSurface * 16.0 - 600.0) * 200.0); diff --git a/Skies/SCalSky.cs b/Skies/SCalSky.cs index b1ac2c4234..209a2bb96b 100644 --- a/Skies/SCalSky.cs +++ b/Skies/SCalSky.cs @@ -6,6 +6,7 @@ using Microsoft.Xna.Framework.Graphics; using System; using System.Collections.Generic; using Terraria; +using Terraria.GameContent; using Terraria.Graphics.Effects; using Terraria.ModLoader; @@ -199,11 +200,11 @@ namespace CalamityMod.Skies if (maxDepth >= 0 && minDepth < 0) { float intensity = GetIntensity(); - spriteBatch.Draw(Main.blackTileTexture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.Black * intensity); + spriteBatch.Draw(TextureAssets.BlackTile.Value, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), Color.Black * intensity); } // Draw cinders. - Texture2D cinderTexture = ModContent.Request("CalamityMod/ExtraTextures/CalamitasCinder"); + Texture2D cinderTexture = ModContent.Request("CalamityMod/ExtraTextures/CalamitasCinder").Value; for (int i = 0; i < Cinders.Count; i++) { Vector2 drawPosition = Cinders[i].Center - Main.screenPosition; diff --git a/Skies/StormWeaverFlashSky.cs b/Skies/StormWeaverFlashSky.cs index 38a4719722..ddb4329bf1 100644 --- a/Skies/StormWeaverFlashSky.cs +++ b/Skies/StormWeaverFlashSky.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Skies // It is a long, white vertical strip that exists for some reason. // This lightning effect is achieved by expanding this to fit the entire background and then drawing it as a distinct element. Texture2D white = TextureAssets.MagicPixel.Value; - float lightningFlashPower = (Main.npc[StormWeaverHeadIndex].modNPC as StormWeaverHead).lightning; + float lightningFlashPower = (Main.npc[StormWeaverHeadIndex].ModNPC as StormWeaverHead).lightning; Vector2 scale = new Vector2(Main.screenWidth * 1.1f / white.Width, Main.screenHeight * 1.1f / white.Height); Vector2 screenCenter = new Vector2(Main.screenWidth, Main.screenHeight) * 0.5f; Color drawColor = Color.White * MathHelper.Lerp(0f, 0.88f, lightningFlashPower); diff --git a/Systems/EntityUpdateInterceptionSystem.cs b/Systems/EntityUpdateInterceptionSystem.cs index 9011003356..581d74cbd5 100644 --- a/Systems/EntityUpdateInterceptionSystem.cs +++ b/Systems/EntityUpdateInterceptionSystem.cs @@ -1,5 +1,7 @@ -using CalamityMod.Particles; +using CalamityMod.NPCs; +using CalamityMod.Particles; using CalamityMod.TileEntities; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Systems diff --git a/Systems/WorldMiscUpdateSystem.cs b/Systems/WorldMiscUpdateSystem.cs index 6deac3066e..fcc3569e89 100644 --- a/Systems/WorldMiscUpdateSystem.cs +++ b/Systems/WorldMiscUpdateSystem.cs @@ -408,8 +408,12 @@ namespace CalamityMod.Systems spawnRate *= 1.43D; if (Main.SceneMetrics.PeaceCandleCount > 0) spawnRate *= 1.25D; + + // TODO -- Draedon's remote appears to not exist as of 1.4 porting. Is this intentional or did something go wrong? + /* if (player.HasItem(ModContent.ItemType())) spawnRate *= 5D; + */ int chance = (int)spawnRate; if (Main.rand.NextBool(chance)) diff --git a/Systems/WorldgenManagementSystem.cs b/Systems/WorldgenManagementSystem.cs index a7a17f773d..39b57009d1 100644 --- a/Systems/WorldgenManagementSystem.cs +++ b/Systems/WorldgenManagementSystem.cs @@ -219,16 +219,6 @@ namespace CalamityMod.Systems #region PostWorldGen public override void PostWorldGen() { - // 60% chance of 3-5 Mining Potions - // 20% chance of 2-3 Builder's Potions - // 20% chance of 5-9 Shine Potions - WeightedItemStack[] replacementPotions = new WeightedItemStack[] - { - DropHelper.WeightStack(ItemID.MiningPotion, 0.6f, 3, 5), - DropHelper.WeightStack(ItemID.BuilderPotion, 0.2f, 2, 3), - DropHelper.WeightStack(ItemID.ShinePotion, 0.2f, 5, 9), - }; - // Replace Suspicious Looking Eyes in Chests with random useful early game potions. for (int chestIndex = 0; chestIndex < Main.maxChests; chestIndex++) { @@ -245,9 +235,25 @@ namespace CalamityMod.Systems { if (chest.item[inventoryIndex].type == ItemID.SuspiciousLookingEye) { - WeightedItemStack replacement = DropHelper.RollWeightedRandom(replacementPotions); - chest.item[inventoryIndex].SetDefaults(replacement.itemID); - chest.item[inventoryIndex].stack = replacement.ChooseQuantity(); + // 60% chance of 3-5 Mining Potions + // 20% chance of 2-3 Builder's Potions + // 20% chance of 5-9 Shine Potions + float rng = WorldGen.genRand.NextFloat(); + if (rng < 0.2f) + { + chest.item[inventoryIndex].SetDefaults(ItemID.ShinePotion); + chest.item[inventoryIndex].stack = WorldGen.genRand.Next(5, 10); + } + else if (rng < 0.4f) + { + chest.item[inventoryIndex].SetDefaults(ItemID.BuilderPotion); + chest.item[inventoryIndex].stack = WorldGen.genRand.Next(2, 4); + } + else + { + chest.item[inventoryIndex].SetDefaults(ItemID.MiningPotion); + chest.item[inventoryIndex].stack = WorldGen.genRand.Next(3, 6); + } break; } } diff --git a/TileEntities/TECodebreaker.cs b/TileEntities/TECodebreaker.cs index 4d06997058..87728811cd 100644 --- a/TileEntities/TECodebreaker.cs +++ b/TileEntities/TECodebreaker.cs @@ -128,7 +128,7 @@ namespace CalamityMod.TileEntities // Also tell the server that you placed the 5x8 tiles that make up the Codebreaker. if (Main.netMode == NetmodeID.MultiplayerClient) { - NetMessage.SendTileRange(Main.myPlayer, i, j, CodebreakerTile.Width, CodebreakerTile.Height); + NetMessage.SendTileSquare(Main.myPlayer, i, j, CodebreakerTile.Width, CodebreakerTile.Height); NetMessage.SendData(MessageID.TileEntityPlacement, -1, -1, null, i, j, Type); return -1; } @@ -167,7 +167,7 @@ namespace CalamityMod.TileEntities if (totalCellsToDrop > 999) totalCellsToDrop = 999; InputtedCellCount -= totalCellsToDrop; - Item.NewItem(x * 16, y * 16, 32, 32, ModContent.ItemType(), totalCellsToDrop); + Item.NewItem(new EntitySource_TileEntity(this), x * 16, y * 16, 32, 32, ModContent.ItemType(), totalCellsToDrop); } } diff --git a/Tiles/Abyss/AcidWoodTree.cs b/Tiles/Abyss/AcidWoodTree.cs index a211093b35..29cb6872fa 100644 --- a/Tiles/Abyss/AcidWoodTree.cs +++ b/Tiles/Abyss/AcidWoodTree.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using CalamityMod.Items.Placeables; using Microsoft.Xna.Framework.Graphics; using Terraria.ModLoader; @@ -6,8 +6,8 @@ namespace CalamityMod.Tiles.Abyss { public class AcidWoodTree : ModPalmTree { - public override Texture2D GetTopTextures() => ModContent.Request("CalamityMod/Tiles/Abyss/AcidWoodTreeTops"); - public override Texture2D GetTexture() => ModContent.Request("CalamityMod/Tiles/Abyss/AcidWoodTree"); + public override Texture2D GetTopTextures() => ModContent.Request("CalamityMod/Tiles/Abyss/AcidWoodTreeTops").Value; + public override Texture2D GetTexture() => ModContent.Request("CalamityMod/Tiles/Abyss/AcidWoodTree").Value; public override int DropWood() => ModContent.ItemType(); public override int CreateDust() => (int)CalamityDusts.SulfurousSeaAcid; } diff --git a/Tiles/Abyss/SulphurousCactus.cs b/Tiles/Abyss/SulphurousCactus.cs index aae13e63b0..cc6bbc692c 100644 --- a/Tiles/Abyss/SulphurousCactus.cs +++ b/Tiles/Abyss/SulphurousCactus.cs @@ -1,10 +1,10 @@ -using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Graphics; using Terraria.ModLoader; namespace CalamityMod.Tiles.Abyss { public class SulphurousCactus : ModCactus { - public override Texture2D GetTexture() => ModContent.Request("CalamityMod/Tiles/Abyss/SulphurousCactus"); + public override Texture2D GetTexture() => ModContent.Request("CalamityMod/Tiles/Abyss/SulphurousCactus").Value; } } diff --git a/Tiles/Astral/AstralNormalMediumPiles.cs b/Tiles/Astral/AstralNormalMediumPiles.cs index eb30e39630..b8addfc6ca 100644 --- a/Tiles/Astral/AstralNormalMediumPiles.cs +++ b/Tiles/Astral/AstralNormalMediumPiles.cs @@ -1,4 +1,4 @@ - + using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; @@ -25,7 +25,7 @@ namespace CalamityMod.Tiles.Astral base.SetStaticDefaults(); } - public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height) + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) { offsetY = 2; } diff --git a/Tiles/Astral/AstralNormalSmallPiles.cs b/Tiles/Astral/AstralNormalSmallPiles.cs index f360529dff..c6ebc00d29 100644 --- a/Tiles/Astral/AstralNormalSmallPiles.cs +++ b/Tiles/Astral/AstralNormalSmallPiles.cs @@ -1,4 +1,4 @@ - + using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Terraria; @@ -20,7 +20,7 @@ namespace CalamityMod.Tiles.Astral base.SetStaticDefaults(); } - public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height) + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) { offsetY = 2; } diff --git a/Tiles/Astral/AstralNormalStalactite.cs b/Tiles/Astral/AstralNormalStalactite.cs index d5195dc6bc..3532ec83f0 100644 --- a/Tiles/Astral/AstralNormalStalactite.cs +++ b/Tiles/Astral/AstralNormalStalactite.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Tiles.Astral base.SetStaticDefaults(); } - public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height) + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) { Tile tile = Main.tile[i, j]; if (tile.TileFrameY <= 18 || tile.TileFrameY == 72) diff --git a/Tiles/Astral/AstralShortPlants.cs b/Tiles/Astral/AstralShortPlants.cs index 02f768f6d9..e7c98dd561 100644 --- a/Tiles/Astral/AstralShortPlants.cs +++ b/Tiles/Astral/AstralShortPlants.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Tiles.Astral base.SetStaticDefaults(); } - public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height) + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) { offsetY = 2; } diff --git a/Tiles/Astral/AstralTree.cs b/Tiles/Astral/AstralTree.cs index a7869d0963..7c93952607 100644 --- a/Tiles/Astral/AstralTree.cs +++ b/Tiles/Astral/AstralTree.cs @@ -1,4 +1,4 @@ -using CalamityMod.Dusts; +using CalamityMod.Dusts; using Microsoft.Xna.Framework.Graphics; using Terraria.ModLoader; namespace CalamityMod.Tiles.Astral @@ -8,11 +8,11 @@ namespace CalamityMod.Tiles.Astral public override Texture2D GetTopTextures(int i, int j, ref int frame, ref int frameWidth, ref int frameHeight, ref int xOffsetLeft, ref int yOffset) { frame = (i + j * j) % 3; - return ModContent.Request("CalamityMod/Tiles/Astral/AstralTree_Tops"); + return ModContent.Request("CalamityMod/Tiles/Astral/AstralTree_Tops").Value; } - public override Texture2D GetBranchTextures(int i, int j, int trunkOffset, ref int frame) => ModContent.Request("CalamityMod/Tiles/Astral/AstralTree_Branches"); - public override Texture2D GetTexture() => ModContent.Request("CalamityMod/Tiles/Astral/AstralTree"); + public override Texture2D GetBranchTextures(int i, int j, int trunkOffset, ref int frame) => ModContent.Request("CalamityMod/Tiles/Astral/AstralTree_Branches").Value; + public override Texture2D GetTexture() => ModContent.Request("CalamityMod/Tiles/Astral/AstralTree").Value; public override int DropWood() => ModContent.ItemType(); public override int CreateDust() => ModContent.DustType(); public override int GrowthFXGore() => -1; diff --git a/Tiles/AstralSnow/AstralSnowTree.cs b/Tiles/AstralSnow/AstralSnowTree.cs index 60d3bcfa30..bfd930a28e 100644 --- a/Tiles/AstralSnow/AstralSnowTree.cs +++ b/Tiles/AstralSnow/AstralSnowTree.cs @@ -1,4 +1,4 @@ -using Terraria.ModLoader; +using Terraria.ModLoader; using Microsoft.Xna.Framework.Graphics; namespace CalamityMod.Tiles @@ -8,17 +8,17 @@ namespace CalamityMod.Tiles public override Texture2D GetTopTextures(int i, int j, ref int frame, ref int frameWidth, ref int frameHeight, ref int xOffsetLeft, ref int yOffset) { frame = (i + j * j) % 6; - return ModContent.Request("CalamityMod/Tiles/AstralSnow/AstralSnowTree_Tops"); + return ModContent.Request("CalamityMod/Tiles/AstralSnow/AstralSnowTree_Tops").Value; } public override Texture2D GetBranchTextures(int i, int j, int trunkOffset, ref int frame) { - return ModContent.Request("CalamityMod/Tiles/AstralSnow/AstralSnowTree_Branches"); + return ModContent.Request("CalamityMod/Tiles/AstralSnow/AstralSnowTree_Branches").Value; } public override Texture2D GetTexture() { - return ModContent.Request("CalamityMod/Tiles/AstralSnow/AstralSnowTree"); + return ModContent.Request("CalamityMod/Tiles/AstralSnow/AstralSnowTree").Value; } public override int DropWood() diff --git a/Tiles/SunkenSea/BrainCoral.cs b/Tiles/SunkenSea/BrainCoral.cs index 6cea0d23c9..c380d1a955 100644 --- a/Tiles/SunkenSea/BrainCoral.cs +++ b/Tiles/SunkenSea/BrainCoral.cs @@ -1,4 +1,4 @@ -using CalamityMod.Projectiles.Typeless; +using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -43,7 +43,7 @@ namespace CalamityMod.Tiles.SunkenSea if (Main.tile[i, tileLocationY].LiquidAmount == 255 && Main.tile[i, tileLocationY - 1].LiquidAmount == 255 && Main.tile[i, tileLocationY - 2].LiquidAmount == 255) { if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile((float)(i * 16 + 16), (float)(tileLocationY * 16 + 16), 0f, -0.1f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(new EntitySource_WorldEvent(), (float)(i * 16 + 16), (float)(tileLocationY * 16 + 16), 0f, -0.1f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, 0f); } } } diff --git a/Tiles/SunkenSea/SeaPrismCrystals.cs b/Tiles/SunkenSea/SeaPrismCrystals.cs index 0350ac11ae..15254f439b 100644 --- a/Tiles/SunkenSea/SeaPrismCrystals.cs +++ b/Tiles/SunkenSea/SeaPrismCrystals.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables; +using CalamityMod.Items.Placeables; using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; @@ -20,7 +20,7 @@ namespace CalamityMod.Tiles.SunkenSea AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); AddMapEntry(new Color(0, 150, 200), name); SoundType = SoundID.Item; - soundStyle = 27; + SoundStyle = 27; DustType = 67; ItemDrop = ModContent.ItemType(); Main.tileSpelunker[Type] = true; diff --git a/Tiles/SunkenSea/SmallBrainCoral.cs b/Tiles/SunkenSea/SmallBrainCoral.cs index 453d1253be..a25456992e 100644 --- a/Tiles/SunkenSea/SmallBrainCoral.cs +++ b/Tiles/SunkenSea/SmallBrainCoral.cs @@ -1,6 +1,7 @@ -using CalamityMod.Projectiles.Typeless; +using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; using Terraria.ObjectData; @@ -43,7 +44,7 @@ namespace CalamityMod.Tiles.SunkenSea if (Main.tile[i, tileLocationY].LiquidAmount == 255 && Main.tile[i, tileLocationY - 1].LiquidAmount == 255 && Main.tile[i, tileLocationY - 2].LiquidAmount == 255) { if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile((float)(i * 16 + 16), (float)(tileLocationY * 16 + 16), 0f, -0.1f, ModContent.ProjectileType(), 0, 1f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(new EntitySource_WorldEvent(), (float)(i * 16 + 16), (float)(tileLocationY * 16 + 16), 0f, -0.1f, ModContent.ProjectileType(), 0, 1f, Main.myPlayer, 0f, 0f); } } } diff --git a/Tiles/SunkenSea/SunkenSeaStalactite.cs b/Tiles/SunkenSea/SunkenSeaStalactite.cs index 839238b001..143e5cf61f 100644 --- a/Tiles/SunkenSea/SunkenSeaStalactite.cs +++ b/Tiles/SunkenSea/SunkenSeaStalactite.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Tiles.SunkenSea base.SetStaticDefaults(); } - public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height) + public override void SetDrawPositions(int i, int j, ref int width, ref int offsetY, ref int height, ref short tileFrameX, ref short tileFrameY) { Tile tile = Main.tile[i, j]; if (tile.TileFrameY <= 18 || tile.TileFrameY == 72) diff --git a/UI/AstralArcanumUI.cs b/UI/AstralArcanumUI.cs index 811bc08965..2af1496cf5 100644 --- a/UI/AstralArcanumUI.cs +++ b/UI/AstralArcanumUI.cs @@ -6,6 +6,7 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; using Terraria.GameContent; +using ReLogic.Content; namespace CalamityMod.UI { @@ -31,7 +32,7 @@ namespace CalamityMod.UI public static void Load(Mod mod) { - CircleTextures = ModContent.Request("CalamityMod/ExtraTextures/UI/AstralArcanumCircles"); + CircleTextures = ModContent.Request("CalamityMod/ExtraTextures/UI/AstralArcanumCircles", AssetRequestMode.ImmediateLoad).Value; CircleNames = new string[] { "Underworld", @@ -164,7 +165,7 @@ namespace CalamityMod.UI } else if (Main.netMode == NetmodeID.MultiplayerClient) { - NetMessage.SendData(MessageID.TeleportationPotion, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.RequestTeleportationByServer, -1, -1, null, 0, 0f, 0f, 0f, 0, 0, 0); } } else diff --git a/UI/BossRushUI.cs b/UI/BossRushUI.cs index 7b57ced67d..3cdc6c5023 100644 --- a/UI/BossRushUI.cs +++ b/UI/BossRushUI.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Events; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -33,7 +33,7 @@ namespace CalamityMod.UI } public override string InvasionName => "Boss Rush"; public override Color InvasionBarColor => Color.DarkSlateBlue; - public override Texture2D IconTexture => ModContent.Request("CalamityMod/ExtraTextures/UI/BossRushIcon"); + public override Texture2D IconTexture => ModContent.Request("CalamityMod/ExtraTextures/UI/BossRushIcon").Value; public static float EvaluationLifeRatioFromNPCTypes(params int[] types) { diff --git a/UI/ChargeMeterUI.cs b/UI/ChargeMeterUI.cs index b52a8aad16..77a4e47a90 100644 --- a/UI/ChargeMeterUI.cs +++ b/UI/ChargeMeterUI.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -32,8 +32,8 @@ namespace CalamityMod.UI Reset(); return; } - Texture2D edgeTexture = ModContent.Request("CalamityMod/ExtraTextures/UI/ChargeMeterBorder"); - Texture2D barTexture = ModContent.Request("CalamityMod/ExtraTextures/UI/ChargeMeter"); + Texture2D edgeTexture = ModContent.Request("CalamityMod/ExtraTextures/UI/ChargeMeterBorder").Value; + Texture2D barTexture = ModContent.Request("CalamityMod/ExtraTextures/UI/ChargeMeter").Value; float uiScale = Main.UIScale; spriteBatch.Draw(edgeTexture, DrawPosition, null, Color.White, 0f, edgeTexture.Size() * 0.5f, uiScale, SpriteEffects.None, 0); diff --git a/UI/ChargingStationUI.cs b/UI/ChargingStationUI.cs index 1bcde751c6..6dcd9ec573 100644 --- a/UI/ChargingStationUI.cs +++ b/UI/ChargingStationUI.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.Items.DraedonMisc; using CalamityMod.TileEntities; using Microsoft.Xna.Framework; @@ -10,6 +10,7 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.UI; using Terraria.Audio; +using Terraria.GameContent; namespace CalamityMod.UI { @@ -106,10 +107,10 @@ namespace CalamityMod.UI bool syncRequired = false; // If the player is holding shift and has space for the item, just spawn it on his or her face. - if (Main.keyState.PressingShift() && p.ItemSpace(pluggedItem)) + if (Main.keyState.PressingShift() && p.ItemSpace(pluggedItem).CanTakeItemToPersonalInventory) { // This does not use DropHelper because it has to clone an existing item, not create one from nothing. - p.QuickSpawnClonedItem(pluggedItem, pluggedItem.stack); + p.QuickSpawnClonedItem(new EntitySource_TileEntity(charger), pluggedItem, pluggedItem.stack); // Destroy the original plugged item because a clone of it was just spawned. pluggedItem.TurnToAir(); @@ -154,7 +155,7 @@ namespace CalamityMod.UI bool shiftClicked = false; // If the player is holding shift and has space for the power cells, just spawn all of them on his or her face. - if (Main.keyState.PressingShift() && p.ItemSpace(powercell)) + if (Main.keyState.PressingShift() && p.ItemSpace(powercell).CanTakeItemToPersonalInventory) { DropHelper.DropItem(p, powercellID, powercell.stack); chargerStackDiff = (short)-powercell.stack; @@ -208,13 +209,13 @@ namespace CalamityMod.UI public static void DrawWeaponSlot(SpriteBatch spriteBatch, Item item, Vector2 drawPosition) { - Texture2D slotBackgroundTex = ModContent.Request("CalamityMod/ExtraTextures/UI/ChargerWeaponSlot"); + Texture2D slotBackgroundTex = ModContent.Request("CalamityMod/ExtraTextures/UI/ChargerWeaponSlot").Value; spriteBatch.Draw(slotBackgroundTex, drawPosition, null, Color.White, 0f, slotBackgroundTex.Size() * 0.5f, IconScale, SpriteEffects.None, 0f); if (!item.IsAir) { float inventoryScale = Main.inventoryScale; - Texture2D itemTexture = Main.itemTexture[item.type]; + Texture2D itemTexture = TextureAssets.Item[item.type].Value; Rectangle itemFrame = Main.itemAnimations[item.type] == null ? itemTexture.Frame(1, 1, 0, 0) : Main.itemAnimations[item.type].GetFrame(itemTexture); float baseScale = 1f; diff --git a/UI/DraedonLogHellGUI.cs b/UI/DraedonLogHellGUI.cs index 239757c933..00db0993bb 100644 --- a/UI/DraedonLogHellGUI.cs +++ b/UI/DraedonLogHellGUI.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Graphics; using Terraria.ModLoader; namespace CalamityMod.UI @@ -29,11 +29,11 @@ namespace CalamityMod.UI switch (Page) { case 0: - return ModContent.Request("CalamityMod/ExtraTextures/UI/DraedonsLogCragsBiome"); + return ModContent.Request("CalamityMod/ExtraTextures/UI/DraedonsLogCragsBiome").Value; case 1: - return ModContent.Request("CalamityMod/ExtraTextures/UI/DraedonsLogWallOfFlesh"); + return ModContent.Request("CalamityMod/ExtraTextures/UI/DraedonsLogWallOfFlesh").Value; default: - return ModContent.Request("CalamityMod/ExtraTextures/UI/DraedonsLogMurasamaPhaseslayer"); + return ModContent.Request("CalamityMod/ExtraTextures/UI/DraedonsLogMurasamaPhaseslayer").Value; } } } diff --git a/UI/DraedonLogJungleGUI.cs b/UI/DraedonLogJungleGUI.cs index dace85ef60..19f5975671 100644 --- a/UI/DraedonLogJungleGUI.cs +++ b/UI/DraedonLogJungleGUI.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Graphics; using Terraria.ModLoader; namespace CalamityMod.UI @@ -29,11 +29,11 @@ namespace CalamityMod.UI switch (Page) { case 0: - return ModContent.Request("CalamityMod/ExtraTextures/UI/DraedonsLogJungleBiome"); + return ModContent.Request("CalamityMod/ExtraTextures/UI/DraedonsLogJungleBiome").Value; case 1: - return ModContent.Request("CalamityMod/ExtraTextures/UI/DraedonsLogPlagueCell"); + return ModContent.Request("CalamityMod/ExtraTextures/UI/DraedonsLogPlagueCell").Value; default: - return ModContent.Request("CalamityMod/ExtraTextures/UI/DraedonsLogPlaguebringerGoliath"); + return ModContent.Request("CalamityMod/ExtraTextures/UI/DraedonsLogPlaguebringerGoliath").Value; } } } diff --git a/UI/DraedonLogPlanetoidGUI.cs b/UI/DraedonLogPlanetoidGUI.cs index 0eb894e7c7..8a8cfddbe9 100644 --- a/UI/DraedonLogPlanetoidGUI.cs +++ b/UI/DraedonLogPlanetoidGUI.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Graphics; using Terraria.ModLoader; namespace CalamityMod.UI @@ -29,11 +29,11 @@ namespace CalamityMod.UI switch (Page) { case 0: - return ModContent.Request("CalamityMod/ExtraTextures/UI/DraedonsLogPlanetoid"); + return ModContent.Request("CalamityMod/ExtraTextures/UI/DraedonsLogPlanetoid").Value; case 1: return null; // The Draedon's backstory page does not have an image, and probably shouldn't. default: - return ModContent.Request("CalamityMod/ExtraTextures/UI/DraedonsLogDoGArmor"); + return ModContent.Request("CalamityMod/ExtraTextures/UI/DraedonsLogDoGArmor").Value; } } } diff --git a/UI/DraedonLogSnowBiomeGUI.cs b/UI/DraedonLogSnowBiomeGUI.cs index 4d84ed7850..c336dbe640 100644 --- a/UI/DraedonLogSnowBiomeGUI.cs +++ b/UI/DraedonLogSnowBiomeGUI.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Graphics; using Terraria.ModLoader; namespace CalamityMod.UI @@ -29,11 +29,11 @@ namespace CalamityMod.UI switch (Page) { case 0: - return ModContent.Request("CalamityMod/ExtraTextures/UI/DraedonsLogIceBiome"); + return ModContent.Request("CalamityMod/ExtraTextures/UI/DraedonsLogIceBiome").Value; case 1: return null; // No image exists for Daedalus' ruins at the moment. default: - return ModContent.Request("CalamityMod/ExtraTextures/UI/DraedonsLogPermafrost"); + return ModContent.Request("CalamityMod/ExtraTextures/UI/DraedonsLogPermafrost").Value; } } } diff --git a/UI/DraedonLogSunkenSeaGUI.cs b/UI/DraedonLogSunkenSeaGUI.cs index a815730163..1363989f6f 100644 --- a/UI/DraedonLogSunkenSeaGUI.cs +++ b/UI/DraedonLogSunkenSeaGUI.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework.Graphics; using Terraria.ModLoader; namespace CalamityMod.UI @@ -31,11 +31,11 @@ namespace CalamityMod.UI switch (Page) { case 0: - return ModContent.Request("CalamityMod/ExtraTextures/UI/DraedonsLogSunkenSeaBiome"); + return ModContent.Request("CalamityMod/ExtraTextures/UI/DraedonsLogSunkenSeaBiome").Value; case 1: - return ModContent.Request("CalamityMod/ExtraTextures/UI/DraedonsLogEutrophicRayGhostBell"); + return ModContent.Request("CalamityMod/ExtraTextures/UI/DraedonsLogEutrophicRayGhostBell").Value; default: - return ModContent.Request("CalamityMod/ExtraTextures/UI/DraedonsLogGiantClam"); + return ModContent.Request("CalamityMod/ExtraTextures/UI/DraedonsLogGiantClam").Value; } } } diff --git a/UI/EnchantmentMetersUI.cs b/UI/EnchantmentMetersUI.cs index 185fc152a9..f056772cab 100644 --- a/UI/EnchantmentMetersUI.cs +++ b/UI/EnchantmentMetersUI.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; @@ -20,8 +20,8 @@ namespace CalamityMod.UI if (player.Calamity().dischargingItemEnchant) { float dischargeFactor = heldItem.Calamity().DischargeExhaustionRatio; - Texture2D barBorderTexture = ModContent.Request("CalamityMod/ExtraTextures/UI/EphemeralBarBorder"); - Texture2D barTexture = ModContent.Request("CalamityMod/ExtraTextures/UI/EphemeralBar"); + Texture2D barBorderTexture = ModContent.Request("CalamityMod/ExtraTextures/UI/EphemeralBarBorder").Value; + Texture2D barTexture = ModContent.Request("CalamityMod/ExtraTextures/UI/EphemeralBar").Value; int barCutoff = (int)(barTexture.Height * (1f - dischargeFactor)); Rectangle barFrame = new Rectangle(0, barCutoff, barTexture.Width, barTexture.Height - barCutoff); diff --git a/UI/RipperUI.cs b/UI/RipperUI.cs index e7b60b8b81..7a9ea5b2f5 100644 --- a/UI/RipperUI.cs +++ b/UI/RipperUI.cs @@ -1,8 +1,9 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; +using ReLogic.Content; using System.Collections.Generic; using System.Text; using Terraria; @@ -44,22 +45,22 @@ namespace CalamityMod.UI internal static void Load() { - rageBarTex = ModContent.Request("CalamityMod/ExtraTextures/UI/RageBar"); - rageBorderTex = ModContent.Request("CalamityMod/ExtraTextures/UI/RageBarBorder"); - rageAnimTex = ModContent.Request("CalamityMod/ExtraTextures/UI/RageFullAnimation"); + rageBarTex = ModContent.Request("CalamityMod/ExtraTextures/UI/RageBar", AssetRequestMode.ImmediateLoad).Value; + rageBorderTex = ModContent.Request("CalamityMod/ExtraTextures/UI/RageBarBorder", AssetRequestMode.ImmediateLoad).Value; + rageAnimTex = ModContent.Request("CalamityMod/ExtraTextures/UI/RageFullAnimation", AssetRequestMode.ImmediateLoad).Value; - adrenBarTex = ModContent.Request("CalamityMod/ExtraTextures/UI/AdrenalineBar"); - adrenBorderTex = ModContent.Request("CalamityMod/ExtraTextures/UI/AdrenalineBarBorder"); - adrenBorderTexFull = ModContent.Request("CalamityMod/ExtraTextures/UI/AdrenalineBarBorderFull"); - adrenAnimTex = ModContent.Request("CalamityMod/ExtraTextures/UI/AdrenalineFullAnimation"); + adrenBarTex = ModContent.Request("CalamityMod/ExtraTextures/UI/AdrenalineBar", AssetRequestMode.ImmediateLoad).Value; + adrenBorderTex = ModContent.Request("CalamityMod/ExtraTextures/UI/AdrenalineBarBorder", AssetRequestMode.ImmediateLoad).Value; + adrenBorderTexFull = ModContent.Request("CalamityMod/ExtraTextures/UI/AdrenalineBarBorderFull", AssetRequestMode.ImmediateLoad).Value; + adrenAnimTex = ModContent.Request("CalamityMod/ExtraTextures/UI/AdrenalineFullAnimation", AssetRequestMode.ImmediateLoad).Value; - mushroomPlasmaTex = ModContent.Request("CalamityMod/ExtraTextures/UI/RageDisplay_MushroomPlasmaRoot"); - infernalBloodTex = ModContent.Request("CalamityMod/ExtraTextures/UI/RageDisplay_InfernalBlood"); - redLightningTex = ModContent.Request("CalamityMod/ExtraTextures/UI/RageDisplay_RedLightningContainer"); + mushroomPlasmaTex = ModContent.Request("CalamityMod/ExtraTextures/UI/RageDisplay_MushroomPlasmaRoot", AssetRequestMode.ImmediateLoad).Value; + infernalBloodTex = ModContent.Request("CalamityMod/ExtraTextures/UI/RageDisplay_InfernalBlood", AssetRequestMode.ImmediateLoad).Value; + redLightningTex = ModContent.Request("CalamityMod/ExtraTextures/UI/RageDisplay_RedLightningContainer", AssetRequestMode.ImmediateLoad).Value; - electrolyteGelTex = ModContent.Request("CalamityMod/ExtraTextures/UI/AdrenalineDisplay_ElectrolyteGelPack"); - starlightFuelTex = ModContent.Request("CalamityMod/ExtraTextures/UI/AdrenalineDisplay_StarlightFuelCell"); - ectoheartTex = ModContent.Request("CalamityMod/ExtraTextures/UI/AdrenalineDisplay_Ectoheart"); + electrolyteGelTex = ModContent.Request("CalamityMod/ExtraTextures/UI/AdrenalineDisplay_ElectrolyteGelPack", AssetRequestMode.ImmediateLoad).Value; + starlightFuelTex = ModContent.Request("CalamityMod/ExtraTextures/UI/AdrenalineDisplay_StarlightFuelCell", AssetRequestMode.ImmediateLoad).Value; + ectoheartTex = ModContent.Request("CalamityMod/ExtraTextures/UI/AdrenalineDisplay_Ectoheart", AssetRequestMode.ImmediateLoad).Value; pearlOffsetLeft = new Vector2(rageBorderTex.Width * 0.3333f - 6f, rageBorderTex.Height - 9f); pearlOffsetCenter = new Vector2(rageBorderTex.Width * 0.5f - 6f, rageBorderTex.Height - 9f); diff --git a/UI/StealthUI.cs b/UI/StealthUI.cs index c668cf963d..5654d2d9d1 100644 --- a/UI/StealthUI.cs +++ b/UI/StealthUI.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; @@ -34,10 +34,10 @@ namespace CalamityMod.UI } return; } - Texture2D edgeTexture = ModContent.Request("CalamityMod/ExtraTextures/UI/StealthMeter"); - Texture2D indicatorTexture = ModContent.Request("CalamityMod/ExtraTextures/UI/StealthMeterStrikeIndicator"); - Texture2D barTexture = ModContent.Request("CalamityMod/ExtraTextures/UI/StealthMeterBar"); - Texture2D fullBarTexture = ModContent.Request("CalamityMod/ExtraTextures/UI/StealthMeterBarFull"); + Texture2D edgeTexture = ModContent.Request("CalamityMod/ExtraTextures/UI/StealthMeter").Value; + Texture2D indicatorTexture = ModContent.Request("CalamityMod/ExtraTextures/UI/StealthMeterStrikeIndicator").Value; + Texture2D barTexture = ModContent.Request("CalamityMod/ExtraTextures/UI/StealthMeterBar").Value; + Texture2D fullBarTexture = ModContent.Request("CalamityMod/ExtraTextures/UI/StealthMeterBarFull").Value; float uiScale = Main.UIScale; spriteBatch.Draw(edgeTexture, DrawPosition, null, Color.White * modPlayer.stealthUIAlpha, 0f, edgeTexture.Size() * 0.5f, uiScale, SpriteEffects.None, 0); if (modPlayer.StealthStrikeAvailable()) diff --git a/Utilities/NPCDebuffs.cs b/Utilities/NPCDebuffs.cs index 32db19384f..e02bc0fe5b 100644 --- a/Utilities/NPCDebuffs.cs +++ b/Utilities/NPCDebuffs.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.NPCs.Abyss; using CalamityMod.NPCs.AcidRain; @@ -55,7 +55,7 @@ namespace CalamityMod // Also, can I just say that I hate Sorted Dictionaries and Tuples and want to make something explode? -Ben var stupidTupleThing = new Tuple(true, new int[] {}); bool exists = EnemyStats.DebuffImmunities.TryGetValue(npc.type, out stupidTupleThing); - if (npc.modNPC is null || !exists) + if (npc.ModNPC is null || !exists) return; // If the npc is immune to everything, make it immune to everything diff --git a/Walls/AshenSlabWall.cs b/Walls/AshenSlabWall.cs index a704b3cbd4..3a6186334e 100644 --- a/Walls/AshenSlabWall.cs +++ b/Walls/AshenSlabWall.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Walls ( sprite, drawOffset, - new Rectangle(sheetOffset[0] + Main.tile[i, j].wallFrameX(), sheetOffset[1] + Main.tile[i, j].wallFrameY(), 32, 32), + new Rectangle(sheetOffset[0] + Main.tile[i, j].WallFrameX, sheetOffset[1] + Main.tile[i, j].WallFrameY, 32, 32), lightColor, 0, new Vector2(0f, 0f), @@ -56,7 +56,7 @@ namespace CalamityMod.Walls private Color GetWallColour(int i, int j) { - int colType = Main.tile[i, j].wallColor(); + int colType = Main.tile[i, j].WallColor; Color paintCol = WorldGen.paintColor(colType); if (colType < 13) { diff --git a/Walls/AstralMonolithWall.cs b/Walls/AstralMonolithWall.cs index 7c04d02465..fe319e9a51 100644 --- a/Walls/AstralMonolithWall.cs +++ b/Walls/AstralMonolithWall.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Walls ( sprite, drawOffset, - new Rectangle(sheetOffset[0] + Main.tile[i, j].wallFrameX(), sheetOffset[1] + Main.tile[i, j].wallFrameY(), 32, 32), + new Rectangle(sheetOffset[0] + Main.tile[i, j].WallFrameX, sheetOffset[1] + Main.tile[i, j].WallFrameY, 32, 32), lightColor, 0, new Vector2(0f, 0f), @@ -56,7 +56,7 @@ namespace CalamityMod.Walls private Color GetWallColour(int i, int j) { - int colType = Main.tile[i, j].wallColor(); + int colType = Main.tile[i, j].WallColor; Color paintCol = WorldGen.paintColor(colType); if (colType < 13) { diff --git a/Walls/BrimstoneSlagWall.cs b/Walls/BrimstoneSlagWall.cs index ec3da50596..ac92885c5d 100644 --- a/Walls/BrimstoneSlagWall.cs +++ b/Walls/BrimstoneSlagWall.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Walls ( sprite, drawOffset, - new Rectangle(sheetOffset[0] + Main.tile[i, j].wallFrameX(), sheetOffset[1] + Main.tile[i, j].wallFrameY(), 32, 32), + new Rectangle(sheetOffset[0] + Main.tile[i, j].WallFrameX, sheetOffset[1] + Main.tile[i, j].WallFrameY, 32, 32), lightColor, 0, new Vector2(0f, 0f), @@ -56,7 +56,7 @@ namespace CalamityMod.Walls private Color GetWallColour(int i, int j) { - int colType = Main.tile[i, j].wallColor(); + int colType = Main.tile[i, j].WallColor; Color paintCol = WorldGen.paintColor(colType); if (colType < 13) { diff --git a/Walls/BrimstoneSlagWallUnsafe.cs b/Walls/BrimstoneSlagWallUnsafe.cs index 0300447279..7506ca068d 100644 --- a/Walls/BrimstoneSlagWallUnsafe.cs +++ b/Walls/BrimstoneSlagWallUnsafe.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Walls ( sprite, drawOffset, - new Rectangle(sheetOffset[0] + Main.tile[i, j].wallFrameX(), sheetOffset[1] + Main.tile[i, j].wallFrameY(), 32, 32), + new Rectangle(sheetOffset[0] + Main.tile[i, j].WallFrameX, sheetOffset[1] + Main.tile[i, j].WallFrameY, 32, 32), lightColor, 0, new Vector2(0f, 0f), @@ -55,7 +55,7 @@ namespace CalamityMod.Walls private Color GetWallColour(int i, int j) { - int colType = Main.tile[i, j].wallColor(); + int colType = Main.tile[i, j].WallColor; Color paintCol = WorldGen.paintColor(colType); if (colType < 13) { diff --git a/Walls/CryonicBrickWall.cs b/Walls/CryonicBrickWall.cs index b1f4019971..a22706a240 100644 --- a/Walls/CryonicBrickWall.cs +++ b/Walls/CryonicBrickWall.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Walls ( sprite, drawOffset, - new Rectangle(sheetOffset[0] + Main.tile[i, j].wallFrameX(), sheetOffset[1] + Main.tile[i, j].wallFrameY(), 32, 32), + new Rectangle(sheetOffset[0] + Main.tile[i, j].WallFrameX, sheetOffset[1] + Main.tile[i, j].WallFrameY, 32, 32), lightColor, 0, new Vector2(0f, 0f), @@ -95,7 +95,7 @@ namespace CalamityMod.Walls private Color GetWallColour(int i, int j) { - int colType = Main.tile[i, j].wallColor(); + int colType = Main.tile[i, j].WallColor; Color paintCol = WorldGen.paintColor(colType); if (colType < 13) { diff --git a/Walls/EutrophicSandWall.cs b/Walls/EutrophicSandWall.cs index 1678415282..328f789db0 100644 --- a/Walls/EutrophicSandWall.cs +++ b/Walls/EutrophicSandWall.cs @@ -1,5 +1,6 @@ using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Walls diff --git a/Walls/ExoPrismPanelWall.cs b/Walls/ExoPrismPanelWall.cs index 56d3c9e07b..f614883c92 100644 --- a/Walls/ExoPrismPanelWall.cs +++ b/Walls/ExoPrismPanelWall.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Walls ( sprite, drawOffset, - new Rectangle(sheetOffset[0] + Main.tile[i, j].wallFrameX(), sheetOffset[1] + Main.tile[i, j].wallFrameY(), 32, 32), + new Rectangle(sheetOffset[0] + Main.tile[i, j].WallFrameX, sheetOffset[1] + Main.tile[i, j].WallFrameY, 32, 32), lightColor, 0, new Vector2(0f, 0f), @@ -55,7 +55,7 @@ namespace CalamityMod.Walls private Color GetWallColour(int i, int j) { - int colType = Main.tile[i, j].wallColor(); + int colType = Main.tile[i, j].WallColor; Color paintCol = WorldGen.paintColor(colType); if (colType < 13) { diff --git a/Walls/PerennialBrickWall.cs b/Walls/PerennialBrickWall.cs index 732639c21d..3b3eb5fa65 100644 --- a/Walls/PerennialBrickWall.cs +++ b/Walls/PerennialBrickWall.cs @@ -1,4 +1,4 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; @@ -26,7 +26,7 @@ namespace CalamityMod.Walls public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) { - Texture2D sprite = ModContent.Request("CalamityMod/Walls/PerennialBrickWall"); + Texture2D sprite = ModContent.Request("CalamityMod/Walls/PerennialBrickWall").Value; Color lightColor = GetWallColour(i, j); Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); zero -= new Vector2(8, 8); @@ -36,7 +36,7 @@ namespace CalamityMod.Walls ( sprite, drawOffset, - new Rectangle(sheetOffset[0] + Main.tile[i, j].wallFrameX(), sheetOffset[1] + Main.tile[i, j].wallFrameY(), 32, 32), + new Rectangle(sheetOffset[0] + Main.tile[i, j].WallFrameX, sheetOffset[1] + Main.tile[i, j].WallFrameY, 32, 32), lightColor, 0, new Vector2(0f, 0f), @@ -57,7 +57,7 @@ namespace CalamityMod.Walls private Color GetWallColour(int i, int j) { - int colType = Main.tile[i, j].wallColor(); + int colType = Main.tile[i, j].WallColor; Color paintCol = WorldGen.paintColor(colType); if (colType < 13) { diff --git a/Walls/ProfanedSlabWall.cs b/Walls/ProfanedSlabWall.cs index 3805f6d9ef..3206f0705e 100644 --- a/Walls/ProfanedSlabWall.cs +++ b/Walls/ProfanedSlabWall.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Walls public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) { - Texture2D sprite = ModContent.Request("CalamityMod/Walls/ProfanedSlabWall"); + Texture2D sprite = ModContent.Request("CalamityMod/Walls/ProfanedSlabWall").Value; Color lightColor = GetWallColour(i, j); Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); zero -= new Vector2(8, 8); @@ -36,7 +36,7 @@ namespace CalamityMod.Walls ( sprite, drawOffset, - new Rectangle(sheetOffset[0] + Main.tile[i, j].wallFrameX(), sheetOffset[1] + Main.tile[i, j].wallFrameY(), 32, 32), + new Rectangle(sheetOffset[0] + Main.tile[i, j].WallFrameX, sheetOffset[1] + Main.tile[i, j].WallFrameY, 32, 32), lightColor, 0, new Vector2(0f, 0f), @@ -57,7 +57,7 @@ namespace CalamityMod.Walls private Color GetWallColour(int i, int j) { - int colType = Main.tile[i, j].wallColor(); + int colType = Main.tile[i, j].WallColor; Color paintCol = WorldGen.paintColor(colType); if (colType < 13) { diff --git a/Walls/RunicProfanedBrickWall.cs b/Walls/RunicProfanedBrickWall.cs index 3ae5a54900..3510603c93 100644 --- a/Walls/RunicProfanedBrickWall.cs +++ b/Walls/RunicProfanedBrickWall.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Walls public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) { - Texture2D sprite = ModContent.Request("CalamityMod/Walls/RunicProfanedBrickWall"); + Texture2D sprite = ModContent.Request("CalamityMod/Walls/RunicProfanedBrickWall").Value; Color lightColor = GetWallColour(i, j); Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); zero -= new Vector2(8, 8); @@ -37,7 +37,7 @@ namespace CalamityMod.Walls ( sprite, drawOffset, - new Rectangle(sheetOffset[0] + Main.tile[i, j].wallFrameX(), sheetOffset[1] + Main.tile[i, j].wallFrameY(), 32, 32), + new Rectangle(sheetOffset[0] + Main.tile[i, j].WallFrameX, sheetOffset[1] + Main.tile[i, j].WallFrameY, 32, 32), lightColor, 0, new Vector2(0f, 0f), @@ -58,7 +58,7 @@ namespace CalamityMod.Walls private Color GetWallColour(int i, int j) { - int colType = Main.tile[i, j].wallColor(); + int colType = Main.tile[i, j].WallColor; Color paintCol = WorldGen.paintColor(colType); if (colType < 13) { diff --git a/Walls/VoidstoneSlabWall.cs b/Walls/VoidstoneSlabWall.cs index e9a87a32a8..94ead8ed18 100644 --- a/Walls/VoidstoneSlabWall.cs +++ b/Walls/VoidstoneSlabWall.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Walls public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) { - Texture2D sprite = ModContent.Request("CalamityMod/Walls/VoidstoneSlabWall"); + Texture2D sprite = ModContent.Request("CalamityMod/Walls/VoidstoneSlabWall").Value; Color lightColor = GetWallColour(i, j); Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); zero -= new Vector2(8, 8); @@ -35,7 +35,7 @@ namespace CalamityMod.Walls ( sprite, drawOffset, - new Rectangle(sheetOffset[0] + Main.tile[i, j].wallFrameX(), sheetOffset[1] + Main.tile[i, j].wallFrameY(), 32, 32), + new Rectangle(sheetOffset[0] + Main.tile[i, j].WallFrameX, sheetOffset[1] + Main.tile[i, j].WallFrameY, 32, 32), lightColor, 0, new Vector2(0f, 0f), @@ -103,7 +103,7 @@ namespace CalamityMod.Walls private Color GetWallColour(int i, int j) { - int colType = Main.tile[i, j].wallColor(); + int colType = Main.tile[i, j].WallColor; Color paintCol = WorldGen.paintColor(colType); if (colType < 13) { diff --git a/World/Planets/Planetoid.cs b/World/Planets/Planetoid.cs index 125eb43708..05962704bf 100644 --- a/World/Planets/Planetoid.cs +++ b/World/Planets/Planetoid.cs @@ -39,7 +39,7 @@ namespace CalamityMod.World.Planets int x = WorldGen.genRand.Next((int)(Main.maxTilesX * 0.2), (int)(Main.maxTilesX * 0.8)); int y = WorldGen.genRand.Next(70, 101); - bool placed = config2.CreateBiome().Place(x, y, WorldGen.structures); + bool placed = config2.CreateBiome().Place(new Point(x, y), WorldGen.structures); if (placed) LCPlanetoidCount--; @@ -54,7 +54,7 @@ namespace CalamityMod.World.Planets int y = WorldGen.genRand.Next(100, 131); - bool placed = config2.CreateBiome().Place(x, y, WorldGen.structures); + bool placed = config2.CreateBiome().Place(new Point(x, y), WorldGen.structures); if (placed) GrassPlanetoidCount--; @@ -68,7 +68,7 @@ namespace CalamityMod.World.Planets int x = WorldGen.genRand.Next((int)(Main.maxTilesX * 0.3f), (int)(Main.maxTilesX * 0.7f)); int y = WorldGen.genRand.Next(100, 131); - bool placed = config2.CreateBiome().Place(x, y, WorldGen.structures); + bool placed = config2.CreateBiome().Place(new Point(x, y), WorldGen.structures); if (placed) MudPlanetoidCount--; @@ -87,7 +87,7 @@ namespace CalamityMod.World.Planets return false; if (varia != null && - (Main.tile[i, j].TileType == varia.Find("StarplateBrick") .Type|| Main.tile[i, j].TileType == varia.Find("ForgottenCloud").Type)) + (Main.tile[i, j].TileType == varia.Find("StarplateBrick").Type || Main.tile[i, j].TileType == varia.Find("ForgottenCloud").Type)) { return false; }