diff --git a/Buffs/Pets/SirenLightPetBuff.cs b/Buffs/Pets/SirenLightPetBuff.cs index a51ffaffb0..faf7694757 100644 --- a/Buffs/Pets/SirenLightPetBuff.cs +++ b/Buffs/Pets/SirenLightPetBuff.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Buffs.Pets { public override void SetDefaults() { - DisplayName.SetDefault("Young Siren"); + DisplayName.SetDefault("Ocean Spirit"); Description.SetDefault("Small and cute"); Main.buffNoTimeDisplay[Type] = true; Main.lightPet[Type] = true; diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 85d6977afc..c9bd4e7bdd 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -996,7 +996,7 @@ namespace CalamityMod.CalPlayer modPlayer.roverDriveTimer = 0; } else - modPlayer.roverDriveTimer = CalamityUtils.SecondsToFrames(10f) + 1; //Doesn't reset to zero to prevent exploits + modPlayer.roverDriveTimer = 616; //Doesn't reset to zero to prevent exploits // Silva invincibility effects if (modPlayer.silvaCountdown > 0 && modPlayer.hasSilvaEffect && modPlayer.silvaSet) diff --git a/CalamityMod.cs b/CalamityMod.cs index 9ecaf7bd76..c1c5e06629 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -20,6 +20,7 @@ using CalamityMod.Items.Placeables; using CalamityMod.Items.Placeables.Furniture.Trophies; using CalamityMod.Items.Tools; using CalamityMod.Items.TreasureBags; +using CalamityMod.Items.Weapons.DraedonsArsenal; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; @@ -59,6 +60,7 @@ using CalamityMod.NPCs.SunkenSea; using CalamityMod.NPCs.SupremeCalamitas; using CalamityMod.NPCs.Yharon; using CalamityMod.Projectiles.Boss; +using CalamityMod.Projectiles.DraedonsArsenal; using CalamityMod.Projectiles.Enemy; using CalamityMod.Projectiles.Hybrid; using CalamityMod.Projectiles.Magic; @@ -67,8 +69,11 @@ using CalamityMod.Projectiles.Melee.Spears; using CalamityMod.Projectiles.Ranged; using CalamityMod.Projectiles.Rogue; using CalamityMod.Projectiles.Summon; -using CalamityMod.Tiles.LivingFire; +using CalamityMod.Schematics; using CalamityMod.Skies; +using CalamityMod.TileEntities; +using CalamityMod.Tiles; +using CalamityMod.Tiles.LivingFire; using CalamityMod.UI; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -86,9 +91,6 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.ModLoader.Config; using Terraria.UI; -using CalamityMod.Schematics; -using CalamityMod.Tiles; -using CalamityMod.TileEntities; namespace CalamityMod { @@ -125,6 +127,7 @@ namespace CalamityMod public static Effect CustomShader; public static Effect LightShader; public static Effect TentacleShader; + public static Effect LightDistortionShader; // DR data structure public static SortedDictionary DRValues; @@ -296,6 +299,7 @@ namespace CalamityMod CustomShader = GetEffect("Effects/CustomShader"); LightShader = GetEffect("Effects/LightBurstShader"); TentacleShader = GetEffect("Effects/TentacleShader"); + LightDistortionShader = GetEffect("Effects/DistortionShader"); Filters.Scene["CalamityMod:DevourerofGodsHead"] = new Filter(new DoGScreenShaderData("FilterMiniTower").UseColor(0.4f, 0.1f, 1.0f).UseOpacity(0.5f), EffectPriority.VeryHigh); SkyManager.Instance["CalamityMod:DevourerofGodsHead"] = new DoGSky(); @@ -331,8 +335,9 @@ namespace CalamityMod Filters.Scene["CalamityMod:LightBurst"].Load(); GameShaders.Misc["CalamityMod:SubsumingTentacle"] = new MiscShaderData(new Ref(TentacleShader), "BurstPass"); + GameShaders.Misc["CalamityMod:LightDistortion"] = new MiscShaderData(new Ref(LightDistortionShader), "DistortionPass"); - RipperUI.Reset(); + RipperUI.Reset(); AstralArcanumUI.Load(this); GameShaders.Hair.BindShader(ModContent.ItemType(), new LegacyHairShaderData().UseLegacyMethod((Player player, Color newColor, ref bool lighting) => Color.Lerp(player.hairColor, new Color(0, 255, 171), ((float)player.Calamity().adrenaline / (float)player.Calamity().adrenalineMax)))); @@ -778,6 +783,7 @@ namespace CalamityMod ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), + ModContent.ProjectileType(), //Some hostile boss projectiles ModContent.ProjectileType(), @@ -1178,7 +1184,8 @@ namespace CalamityMod ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType() + ModContent.ItemType(), + ModContent.ItemType() }; iceWeaponList = new List() @@ -1354,7 +1361,13 @@ namespace CalamityMod ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType() + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType() }; alcoholList = new List() @@ -2242,7 +2255,8 @@ namespace CalamityMod ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType() + ModContent.ItemType(), + ModContent.ItemType() }; flaskBombProjList = new List() @@ -2272,7 +2286,8 @@ namespace CalamityMod ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), - ModContent.ProjectileType() + ModContent.ProjectileType(), + ModContent.ProjectileType() }; spikyBallList = new List() @@ -2415,6 +2430,7 @@ namespace CalamityMod ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), + ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), @@ -4000,9 +4016,17 @@ namespace CalamityMod int countdown2 = reader.ReadInt32(); CalamityWorld.bossSpawnCountdown = countdown2; break; - case CalamityModMessageType.DeathBossSpawnCountdownSync: + case CalamityModMessageType.BRHostileProjKillSync: int countdown3 = reader.ReadInt32(); - CalamityWorld.deathBossSpawnCooldown = countdown3; + CalamityWorld.bossRushHostileProjKillCounter = countdown3; + break; + case CalamityModMessageType.DeathBossSpawnCountdownSync: + int countdown4 = reader.ReadInt32(); + CalamityWorld.deathBossSpawnCooldown = countdown4; + break; + case CalamityModMessageType.ArmoredDiggerCountdownSync: + int countdown5 = reader.ReadInt32(); + CalamityWorld.ArmoredDiggerSpawnCooldown = countdown5; break; case CalamityModMessageType.BossTypeSync: int type = reader.ReadInt32(); @@ -4167,6 +4191,8 @@ namespace CalamityMod BossRushStage, DoGCountdownSync, BossSpawnCountdownSync, + BRHostileProjKillSync, + ArmoredDiggerCountdownSync, BossTypeSync, DeathCountSync, RevengeanceBoolSync, diff --git a/Effects/DistortionShader.xnb b/Effects/DistortionShader.xnb new file mode 100644 index 0000000000..fc85ee9639 Binary files /dev/null and b/Effects/DistortionShader.xnb differ diff --git a/Events/AcidRainEvent.cs b/Events/AcidRainEvent.cs index 26dc6bd101..80c62c783d 100644 --- a/Events/AcidRainEvent.cs +++ b/Events/AcidRainEvent.cs @@ -143,11 +143,11 @@ namespace CalamityMod.Events } } /// - /// Attempts to start the Acid Rain event. Will fail if there is another invasion going on or the EoC has not been killed yet (unless you're in hardmode). + /// Attempts to start the Acid Rain event. Will fail if there is another invasion or boss rush going on. It will also fail if the EoC, WoF, or AS has not been killed yet. /// public static void TryStartEvent(bool forceRain = false) { - if (CalamityWorld.rainingAcid || (!NPC.downedBoss1 && !Main.hardMode) || CalamityWorld.bossRushActive) + if (CalamityWorld.rainingAcid || (!NPC.downedBoss1 && !Main.hardMode && !CalamityWorld.downedAquaticScourge) || CalamityWorld.bossRushActive) return; int playerCount = 0; for (int i = 0; i < Main.player.Length; i++) diff --git a/Items/Armor/AerospecHelmet.cs b/Items/Armor/AerospecHelmet.cs index 79efe6f96b..60b5e75c02 100644 --- a/Items/Armor/AerospecHelmet.cs +++ b/Items/Armor/AerospecHelmet.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Items.Armor } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(25f * (player.allDamage + player.minionDamage - 1f)), 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(20 * player.MinionDamage()), 0f, Main.myPlayer, 0f, 0f); } } player.minionDamage += 0.16f; diff --git a/Items/Armor/MolluskShellmet.cs b/Items/Armor/MolluskShellmet.cs index 4b8ceb4030..ff09f23829 100644 --- a/Items/Armor/MolluskShellmet.cs +++ b/Items/Armor/MolluskShellmet.cs @@ -57,8 +57,7 @@ namespace CalamityMod.Items.Armor } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 2) { - int shellfish = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(200f * player.MinionDamage()), 0f, Main.myPlayer, 0f, 0f); - Main.projectile[shellfish].Calamity().lineColor = 1; + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(140 * player.MinionDamage()), 0f, player.whoAmI); } } player.Calamity().wearingRogueArmor = true; diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 2c3eb1158a..001d63e635 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -61,9 +61,9 @@ namespace CalamityMod.Items public int timesUsed = 0; // The damage modifications for the item are handled in player files. - public int CurrentCharge = ChargeMax; + public int CurrentCharge; public bool Chargeable = false; - public const int ChargeMax = 150; + public int ChargeMax; public const float ChargeDamageMinMultiplier = 0.75f; public const float ChargeDamageReductionThreshold = 0.75f; @@ -99,6 +99,7 @@ namespace CalamityMod.Items #region SetDefaults public override void SetDefaults(Item item) { + item.Calamity().ChargeMax = ChargeMax; if (customRarity.IsPostML() && item.rare != 10) item.rare = 10; @@ -1067,6 +1068,9 @@ namespace CalamityMod.Items case CalamityRarity.Rainbow: tt2.overrideColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB); break; + case CalamityRarity.DraedonRust: + tt2.overrideColor = new Color(204, 71, 35); + break; case CalamityRarity.RareVariant: tt2.overrideColor = new Color(255, 140, 0); break; diff --git a/Items/DraedonsLog.cs b/Items/DraedonsLog.cs index 337678cf9d..ac8fd422b7 100644 --- a/Items/DraedonsLog.cs +++ b/Items/DraedonsLog.cs @@ -17,7 +17,8 @@ namespace CalamityMod.Items { item.width = 40; item.height = 40; - item.rare = 11; + item.rare = ItemRarityID.Red; + item.Calamity().customRarity = CalamityRarity.DraedonRust; item.useAnimation = item.useTime = 20; item.useStyle = ItemUseStyleID.HoldingUp; } diff --git a/Items/LoreItems/KnowledgeLeviathanandSiren.cs b/Items/LoreItems/KnowledgeLeviathanandSiren.cs index 7dd1598dfe..2e4bc424c7 100644 --- a/Items/LoreItems/KnowledgeLeviathanandSiren.cs +++ b/Items/LoreItems/KnowledgeLeviathanandSiren.cs @@ -11,11 +11,11 @@ namespace CalamityMod.Items.LoreItems { public override void SetStaticDefaults() { - DisplayName.SetDefault("Leviathan and Siren"); + DisplayName.SetDefault("Leviathan and Anahita"); Tooltip.SetDefault("An odd pair of creatures; one seeking companionship and the other seeking sustenance.\n" + "Perhaps two genetic misfits outcast from their homes that found comfort in assisting one another.\n" + - "Favorite this item to gain increased max health while wearing the siren heart and treasure detect while wearing the strange orb.\n" + - "Allows the young siren pet to move normally while outside of liquids.\n" + + "Favorite this item to gain increased max health while wearing the aquatic heart and treasure detect while wearing the strange orb.\n" + + "Allows the young Ocean Spirit light pet to move normally while outside of liquids.\n" + "However, if you're not submerged in liquid you will have decreased defense and damage reduction."); } diff --git a/Items/Materials/DubiousPlating.cs b/Items/Materials/DubiousPlating.cs index 4ab4787e59..30d2dca04a 100644 --- a/Items/Materials/DubiousPlating.cs +++ b/Items/Materials/DubiousPlating.cs @@ -1,4 +1,5 @@ using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Materials @@ -15,8 +16,9 @@ namespace CalamityMod.Items.Materials item.width = 30; item.height = 24; item.maxStack = 999; - item.value = Item.sellPrice(silver: 3); - item.rare = 1; + item.rare = ItemRarityID.Red; + item.Calamity().customRarity = CalamityRarity.DraedonRust; + item.value = Item.sellPrice(silver: 6); } } } diff --git a/Items/Materials/MysteriousCircuitry.cs b/Items/Materials/MysteriousCircuitry.cs index af61434ab7..374634ce67 100644 --- a/Items/Materials/MysteriousCircuitry.cs +++ b/Items/Materials/MysteriousCircuitry.cs @@ -1,4 +1,5 @@ using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Materials @@ -15,8 +16,9 @@ namespace CalamityMod.Items.Materials item.width = 30; item.height = 24; item.maxStack = 999; - item.value = Item.sellPrice(silver: 3); - item.rare = 1; + item.rare = ItemRarityID.Red; + item.Calamity().customRarity = CalamityRarity.DraedonRust; + item.value = Item.sellPrice(silver: 6); } } } diff --git a/Items/Pets/StrangeOrb.cs b/Items/Pets/StrangeOrb.cs index 8dfb85d620..6a95995312 100644 --- a/Items/Pets/StrangeOrb.cs +++ b/Items/Pets/StrangeOrb.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Pets public override void SetStaticDefaults() { DisplayName.SetDefault("Strange Orb"); - Tooltip.SetDefault("Summons a young Siren light pet\n" + + Tooltip.SetDefault("Summons a miniature Ocean Spirit light pet\n" + "Provides a large amount of light while underwater"); } diff --git a/Items/Placeables/DraedonsChargingStation.cs b/Items/Placeables/DraedonsChargingStation.cs index fb3c05b0af..3346d2aa33 100644 --- a/Items/Placeables/DraedonsChargingStation.cs +++ b/Items/Placeables/DraedonsChargingStation.cs @@ -1,8 +1,7 @@ -using CalamityMod.Items.Placeables.Walls; -using CalamityMod.Items.Materials; +using CalamityMod.Tiles; +using Terraria; using Terraria.ID; using Terraria.ModLoader; -using CalamityMod.Tiles; namespace CalamityMod.Items.Placeables { @@ -11,11 +10,11 @@ namespace CalamityMod.Items.Placeables public override void SetStaticDefaults() { DisplayName.SetDefault("Draedon's Charging Station"); + Tooltip.SetDefault("Charges Draedon's weaponry using Power Cells"); } public override void SetDefaults() { - item.rare = 10; item.width = 26; item.height = 26; item.maxStack = 999; @@ -25,6 +24,10 @@ namespace CalamityMod.Items.Placeables item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); + + item.rare = ItemRarityID.Red; + item.Calamity().customRarity = CalamityRarity.DraedonRust; + item.value = Item.buyPrice(gold: 50); } } } diff --git a/Items/Placeables/DraedonsFuelFactoryItem.cs b/Items/Placeables/DraedonsFuelFactoryItem.cs index 5b4d5378c8..a167ceacaf 100644 --- a/Items/Placeables/DraedonsFuelFactoryItem.cs +++ b/Items/Placeables/DraedonsFuelFactoryItem.cs @@ -1,6 +1,7 @@ +using CalamityMod.Tiles; +using Terraria; using Terraria.ID; using Terraria.ModLoader; -using CalamityMod.Tiles; namespace CalamityMod.Items.Placeables { @@ -9,11 +10,11 @@ namespace CalamityMod.Items.Placeables public override void SetStaticDefaults() { DisplayName.SetDefault("Draedon's Fuel Factory"); + Tooltip.SetDefault("Produces Draedon Power Cells over time"); } public override void SetDefaults() { - item.rare = 10; item.width = 26; item.height = 26; item.maxStack = 999; @@ -23,6 +24,10 @@ namespace CalamityMod.Items.Placeables item.useStyle = ItemUseStyleID.SwingThrow; item.consumable = true; item.createTile = ModContent.TileType(); + + item.rare = ItemRarityID.Red; + item.Calamity().customRarity = CalamityRarity.DraedonRust; + item.value = Item.buyPrice(gold: 50); } } } diff --git a/Items/PowerCell.cs b/Items/PowerCell.cs index d52091a977..470fb14122 100644 --- a/Items/PowerCell.cs +++ b/Items/PowerCell.cs @@ -1,4 +1,4 @@ -using CalamityMod.UI; +using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -10,15 +10,47 @@ namespace CalamityMod.Items public override void SetStaticDefaults() { DisplayName.SetDefault("Draedon Power Cell"); - Tooltip.SetDefault("Used at a charger to charge special weapons"); + Tooltip.SetDefault("Used to charge Draedon's weaponry at a charger\n" + + "Also can be processed by the Extractinator for spare parts"); } public override void SetDefaults() { item.width = 26; item.height = 14; - item.rare = 10; + item.rare = ItemRarityID.Red; + item.Calamity().customRarity = CalamityRarity.DraedonRust; item.maxStack = 999; + + ItemID.Sets.ExtractinatorMode[item.type] = item.type; + item.consumable = true; + item.useStyle = ItemUseStyleID.SwingThrow; + item.useAnimation = 15; + item.useTime = 10; + item.autoReuse = true; + item.useTurn = true; + } + + public override void ExtractinatorUse(ref int resultType, ref int resultStack) + { + float dropRand = Main.rand.NextFloat(); + resultStack = 1; + + // 2.5% chance for Mysterious Circuitry + // 2.5% chance for Dubious Plating + // 85% chance for 65-99 Copper Coins + // 10% chance for 1 Silver Coin + if (dropRand < 0.025f) + resultType = ModContent.ItemType(); + else if (dropRand < 0.05f) + resultType = ModContent.ItemType(); + else if (dropRand < 0.9f) + { + resultType = ItemID.CopperCoin; + resultStack = Main.rand.Next(65, 100); + } + else + resultType = ItemID.SilverCoin; } } } diff --git a/Items/Weapons/DraedonsArsenal/GatlingLaser.cs b/Items/Weapons/DraedonsArsenal/GatlingLaser.cs index e22fea0d20..826747b8bc 100644 --- a/Items/Weapons/DraedonsArsenal/GatlingLaser.cs +++ b/Items/Weapons/DraedonsArsenal/GatlingLaser.cs @@ -1,5 +1,4 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Weapons.Magic; using CalamityMod.Projectiles.DraedonsArsenal; using Microsoft.Xna.Framework; using Terraria; @@ -8,15 +7,13 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.DraedonsArsenal { - public class GatlingLaser : ModItem + public class GatlingLaser : ModItem { - private int BaseDamage = 600; - public override void SetStaticDefaults() { DisplayName.SetDefault("Gatling Laser"); Tooltip.SetDefault("Large laser cannon used primarily by Yharim's fleet and base defense force\n" + - "Highly accurate, but lacks the power to punch through defensive targets"); + "Highly accurate, but lacks the power to punch through defensive targets"); } public override void SetDefaults() @@ -24,7 +21,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal item.width = 58; item.height = 24; item.magic = true; - item.damage = BaseDamage; + item.damage = 54; item.knockBack = 1f; item.useTime = 2; item.useAnimation = 2; @@ -36,17 +33,18 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/GatlingLaserFireStart"); item.noMelee = true; - item.value = Item.buyPrice(1, 80, 0, 0); - item.rare = 10; - item.Calamity().customRarity = CalamityRarity.RareVariant; + item.value = CalamityGlobalItem.Rarity8BuyPrice; + item.rare = ItemRarityID.Red; + item.Calamity().customRarity = CalamityRarity.DraedonRust; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 24f; item.Calamity().Chargeable = true; + item.Calamity().ChargeMax = 135; } - public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { @@ -68,11 +66,11 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 15); - recipe.AddIngredient(ModContent.ItemType(), 15); - recipe.AddIngredient(ModContent.ItemType(), 5); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddIngredient(ModContent.ItemType(), 20); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ItemID.LaserMachinegun); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/DraedonsArsenal/GaussDagger.cs b/Items/Weapons/DraedonsArsenal/GaussDagger.cs new file mode 100644 index 0000000000..a32a6401cd --- /dev/null +++ b/Items/Weapons/DraedonsArsenal/GaussDagger.cs @@ -0,0 +1,66 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.DraedonsArsenal; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.DraedonsArsenal +{ + public class GaussDagger : ModItem + { + public const int HitsRequiredForFlux = 3; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gauss Dagger"); + Tooltip.SetDefault("Repeat strikes envelop foes in magnetic flux"); + } + public override void SetDefaults() + { + item.damage = 30; + item.melee = true; + item.width = 26; + item.height = 26; + item.useTime = 24; + item.useAnimation = 24; + item.useStyle = ItemUseStyleID.SwingThrow; + item.useTurn = false; + item.knockBack = 7f; + + item.value = CalamityGlobalItem.Rarity3BuyPrice; + item.rare = ItemRarityID.Red; + item.Calamity().customRarity = CalamityRarity.DraedonRust; + + item.UseSound = SoundID.Item1; + item.autoReuse = true; + + item.Calamity().Chargeable = true; + item.Calamity().ChargeMax = 50; + } + + public override void OnHitNPC(Player player, NPC target, int damage, float knockBack, bool crit) + { + target.Calamity().GaussFluxTimer += 50; + if (target.Calamity().GaussFluxTimer >= 30 * HitsRequiredForFlux) + { + target.Calamity().GaussFluxTimer = 0; + if (player.whoAmI == Main.myPlayer) + { + Projectile.NewProjectile(target.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, player.whoAmI, 0f, target.whoAmI); + } + } + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ModContent.ItemType(), 7); + recipe.AddIngredient(ModContent.ItemType(), 4); + recipe.AddIngredient(ItemID.MeteoriteBar, 4); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Weapons/DraedonsArsenal/GaussDagger.png b/Items/Weapons/DraedonsArsenal/GaussDagger.png new file mode 100644 index 0000000000..77ac1dfc11 Binary files /dev/null and b/Items/Weapons/DraedonsArsenal/GaussDagger.png differ diff --git a/Items/Weapons/DraedonsArsenal/GaussPistol.cs b/Items/Weapons/DraedonsArsenal/GaussPistol.cs index 75447ea709..8d6245d72b 100644 --- a/Items/Weapons/DraedonsArsenal/GaussPistol.cs +++ b/Items/Weapons/DraedonsArsenal/GaussPistol.cs @@ -10,6 +10,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void SetStaticDefaults() { DisplayName.SetDefault("Gauss Pistol"); + Tooltip.SetDefault("Fires a devastating high velocity blast with extreme knockback"); } public override void SetDefaults() @@ -18,7 +19,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal item.height = 22; item.magic = true; item.mana = 6; - item.damage = 25; + item.damage = 70; item.knockBack = 11f; item.useTime = item.useAnimation = 20; item.autoReuse = true; @@ -27,22 +28,25 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/GaussWeaponFire"); item.noMelee = true; - item.value = CalamityGlobalItem.Rarity3BuyPrice; - item.rare = 3; + item.value = CalamityGlobalItem.Rarity5BuyPrice; + item.rare = ItemRarityID.Red; + item.Calamity().customRarity = CalamityRarity.DraedonRust; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 14f; + item.Calamity().ChargeMax = 85; item.Calamity().Chargeable = true; } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 7); - recipe.AddIngredient(ModContent.ItemType(), 5); - recipe.AddIngredient(ModContent.ItemType(), 10); - recipe.AddTile(TileID.Anvils); + recipe.AddIngredient(ModContent.ItemType(), 12); + recipe.AddIngredient(ModContent.ItemType(), 8); + recipe.AddIngredient(ItemID.HallowedBar, 10); + recipe.AddIngredient(ItemID.SpaceGun); + recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); } diff --git a/Items/Weapons/DraedonsArsenal/GaussRifle.cs b/Items/Weapons/DraedonsArsenal/GaussRifle.cs index 7f28c794fc..519060b14c 100644 --- a/Items/Weapons/DraedonsArsenal/GaussRifle.cs +++ b/Items/Weapons/DraedonsArsenal/GaussRifle.cs @@ -1,6 +1,6 @@ using CalamityMod.Items.Materials; +using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Projectiles.DraedonsArsenal; -using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -8,12 +8,12 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.DraedonsArsenal { - public class GaussRifle : ModItem + public class GaussRifle : ModItem { public override void SetStaticDefaults() { DisplayName.SetDefault("Gauss Rifle"); - Tooltip.SetDefault("Fires an enormous pulse of energy"); + Tooltip.SetDefault("Fires a devastating high velocity blast with absurd knockback"); } public override void SetDefaults() @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal item.width = 112; item.height = 36; item.ranged = true; - item.damage = 8000; + item.damage = 170; item.knockBack = 30f; item.useTime = item.useAnimation = 28; item.autoReuse = true; @@ -30,14 +30,15 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/GaussWeaponFire"); item.noMelee = true; - item.value = CalamityGlobalItem.RarityVioletBuyPrice; + item.value = CalamityGlobalItem.Rarity8BuyPrice; item.rare = ItemRarityID.Red; - item.Calamity().customRarity = CalamityRarity.RareVariant; // In accordance with the other post-ML Arsenal weapons that Fabsol made. + item.Calamity().customRarity = CalamityRarity.DraedonRust; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 27f; item.Calamity().Chargeable = true; + item.Calamity().ChargeMax = 135; } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) @@ -49,11 +50,12 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 20); - recipe.AddIngredient(ModContent.ItemType(), 10); - recipe.AddIngredient(ModContent.ItemType(), 5); - recipe.AddIngredient(ItemID.LaserRifle); - recipe.AddTile(ModContent.TileType()); + recipe.AddIngredient(ModContent.ItemType(), 18); + recipe.AddIngredient(ModContent.ItemType(), 12); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); } diff --git a/Items/Weapons/DraedonsArsenal/HydraulicVoltCrasher.cs b/Items/Weapons/DraedonsArsenal/HydraulicVoltCrasher.cs index 91151c2253..2cdaa7ff59 100644 --- a/Items/Weapons/DraedonsArsenal/HydraulicVoltCrasher.cs +++ b/Items/Weapons/DraedonsArsenal/HydraulicVoltCrasher.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void SetStaticDefaults() { DisplayName.SetDefault("Hydraulic Volt Crasher"); - Tooltip.SetDefault("Zaps nearby enemies on hit"); + Tooltip.SetDefault("An electrically charged jackhammer which shocks all nearby foes on hit"); } public override void SetDefaults() @@ -25,25 +25,29 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal item.damage = 99; item.hammer = 230; item.UseSound = SoundID.Item23; + item.shoot = ModContent.ProjectileType(); - item.rare = 10; - item.Calamity().customRarity = CalamityRarity.RareVariant; - item.value = CalamityGlobalItem.Rarity10BuyPrice; + item.value = CalamityGlobalItem.Rarity5BuyPrice; + item.rare = ItemRarityID.Red; + item.Calamity().customRarity = CalamityRarity.DraedonRust; + item.noMelee = true; item.noUseGraphic = true; item.melee = true; item.channel = true; item.Calamity().Chargeable = true; + item.Calamity().ChargeMax = 85; } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 10); - recipe.AddIngredient(ModContent.ItemType(), 10); - recipe.AddIngredient(ModContent.ItemType(), 5); - recipe.AddTile(TileID.LunarCraftingStation); + recipe.AddIngredient(ModContent.ItemType(), 8); + recipe.AddIngredient(ModContent.ItemType(), 12); + recipe.AddIngredient(ItemID.HallowedBar, 10); + recipe.AddIngredient(ItemID.SoulofMight, 20); + recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); } diff --git a/Items/Weapons/DraedonsArsenal/LaserRifle.cs b/Items/Weapons/DraedonsArsenal/LaserRifle.cs index 9add3a711d..18a9b59409 100644 --- a/Items/Weapons/DraedonsArsenal/LaserRifle.cs +++ b/Items/Weapons/DraedonsArsenal/LaserRifle.cs @@ -9,8 +9,6 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal { public class LaserRifle : ModItem { - private int BaseDamage = 100; - public override void SetStaticDefaults() { DisplayName.SetDefault("Heavy Laser Rifle"); @@ -23,7 +21,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal item.width = 84; item.height = 28; item.ranged = true; - item.damage = BaseDamage; + item.damage = 270; item.knockBack = 4f; item.useTime = 25; item.useAnimation = 25; @@ -33,14 +31,15 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LaserRifleFire"); item.noMelee = true; - item.value = CalamityGlobalItem.Rarity10BuyPrice; - item.rare = 10; - item.Calamity().customRarity = CalamityRarity.RareVariant; + item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; + item.rare = ItemRarityID.Red; + item.Calamity().customRarity = CalamityRarity.DraedonRust; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 5f; item.Calamity().Chargeable = true; + item.Calamity().ChargeMax = 190; } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) @@ -51,23 +50,12 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal velocity.Normalize(); velocity *= 5f; } - for (int i = 0; i < 2; i++) { float SpeedX = velocity.X + Main.rand.Next(-1, 2) * 0.05f; float SpeedY = velocity.Y + Main.rand.Next(-1, 2) * 0.05f; Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, i, 0f); } - - // Consume 4 ammo per shot - CalamityGlobalItem.ConsumeAdditionalAmmo(player, item, 4); - - return false; - } - - // Disable vanilla ammo consumption - public override bool ConsumeAmmo(Player player) - { return false; } @@ -76,14 +64,14 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal return new Vector2(-20, 0); } - public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 15); recipe.AddIngredient(ModContent.ItemType(), 15); - recipe.AddIngredient(ModContent.ItemType(), 5); - recipe.AddIngredient(ItemID.LaserRifle); + recipe.AddIngredient(ModContent.ItemType(), 8); + recipe.AddIngredient(ItemID.LunarBar, 4); + recipe.AddIngredient(ItemID.SniperRifle); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/DraedonsArsenal/MountedScanner.cs b/Items/Weapons/DraedonsArsenal/MountedScanner.cs index d0393af097..4007bf4985 100644 --- a/Items/Weapons/DraedonsArsenal/MountedScanner.cs +++ b/Items/Weapons/DraedonsArsenal/MountedScanner.cs @@ -20,8 +20,9 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal item.width = 26; item.height = 26; item.summon = true; - item.damage = 15; + item.damage = 19; item.knockBack = 2f; + item.mana = 10; item.useTime = item.useAnimation = 25; item.autoReuse = true; @@ -29,8 +30,9 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal item.UseSound = SoundID.Item15; item.noMelee = true; - item.value = CalamityGlobalItem.Rarity4BuyPrice; - item.rare = 4; + item.value = CalamityGlobalItem.Rarity5BuyPrice; + item.rare = ItemRarityID.Red; + item.Calamity().customRarity = CalamityRarity.DraedonRust; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 1f; @@ -78,10 +80,9 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 15); recipe.AddIngredient(ModContent.ItemType(), 5); - recipe.AddIngredient(ModContent.ItemType(), 3); - recipe.AddIngredient(ModContent.ItemType(), 3); - recipe.AddIngredient(ModContent.ItemType(), 3); - recipe.AddTile(TileID.Anvils); + recipe.AddIngredient(ItemID.HallowedBar, 10); + recipe.AddIngredient(ItemID.SoulofFright, 20); + recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); } diff --git a/Items/Weapons/DraedonsArsenal/Phaseslayer.cs b/Items/Weapons/DraedonsArsenal/Phaseslayer.cs new file mode 100644 index 0000000000..8b0da9e7cd --- /dev/null +++ b/Items/Weapons/DraedonsArsenal/Phaseslayer.cs @@ -0,0 +1,81 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.DraedonsArsenal; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.DraedonsArsenal +{ + public class Phaseslayer : ModItem + { + public const int Damage = 19000; + // When below this percentage of charge, the sword is small instead of big. + public const float SizeChargeThreshold = 0.33f; + public const float SmallDamageMultiplier = 0.66f; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Phaseslayer"); + Tooltip.SetDefault("Wield a colossal laser blade which is controlled by the cursor\n" + + "Faster swings deal more damage and release sword beams\n" + + "When at low charge, the blade is smaller and weaker"); + } + public override void SetDefaults() + { + item.damage = Damage; + item.melee = true; + item.width = 26; + item.height = 26; + item.useTime = 24; + item.useAnimation = 24; + item.useStyle = ItemUseStyleID.HoldingOut; + item.useTurn = false; + item.knockBack = 7f; + + item.noUseGraphic = true; + + item.value = CalamityGlobalItem.RarityVioletBuyPrice; + item.rare = ItemRarityID.Red; + item.Calamity().customRarity = CalamityRarity.DraedonRust; + + item.UseSound = SoundID.Item1; + item.autoReuse = true; + + item.Calamity().Chargeable = true; + item.Calamity().ChargeMax = 250; + + item.shoot = ModContent.ProjectileType(); + item.channel = true; + } + + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0; + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + Projectile blade = Projectile.NewProjectileDirect(position, Vector2.Zero, type, damage, knockBack, player.whoAmI); + blade.rotation = blade.AngleTo(Main.MouseWorld); + return false; + } + + public override void AddRecipes() + { + void AddIndividualRecipe(int saberID) + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 15); + recipe.AddIngredient(ModContent.ItemType(), 25); + recipe.AddIngredient(ModContent.ItemType(), 4); + recipe.AddIngredient(saberID); + recipe.AddTile(ModContent.TileType()); + recipe.SetResult(this); + recipe.AddRecipe(); + } + + int[] phasesabers = { ItemID.WhitePhasesaber, ItemID.RedPhasesaber, ItemID.GreenPhasesaber, ItemID.BluePhasesaber, ItemID.PurplePhasesaber, ItemID.YellowPhasesaber }; + foreach (int id in phasesabers) + AddIndividualRecipe(id); + } + } +} diff --git a/Items/Weapons/DraedonsArsenal/Phaseslayer.png b/Items/Weapons/DraedonsArsenal/Phaseslayer.png new file mode 100644 index 0000000000..53f9fb432a Binary files /dev/null and b/Items/Weapons/DraedonsArsenal/Phaseslayer.png differ diff --git a/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs b/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs index 8823b67023..c1ab052d43 100644 --- a/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs +++ b/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs @@ -1,3 +1,5 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Items.Weapons.Magic; using CalamityMod.Projectiles.DraedonsArsenal; using Microsoft.Xna.Framework; using Terraria; @@ -6,10 +8,9 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.DraedonsArsenal { - public class PlasmaCaster : ModItem + public class PlasmaCaster : ModItem { - private int BaseDamage = 2800; - + public const int BaseDamage = 1100; public override void SetStaticDefaults() { DisplayName.SetDefault("Plasma Caster"); @@ -33,14 +34,15 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/PlasmaCasterFire"); item.noMelee = true; - item.value = Item.buyPrice(1, 80, 0, 0); - item.rare = 10; - item.Calamity().customRarity = CalamityRarity.RareVariant; + item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; + item.rare = ItemRarityID.Red; + item.Calamity().customRarity = CalamityRarity.DraedonRust; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 5f; item.Calamity().Chargeable = true; + item.Calamity().ChargeMax = 190; } public override bool AltFunctionUse(Player player) => true; @@ -61,31 +63,19 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal velocity *= 5f; } - int ammoConsumed = 20; float SpeedX = velocity.X + (float)Main.rand.Next(-3, 4) * 0.05f; float SpeedY = velocity.Y + (float)Main.rand.Next(-3, 4) * 0.05f; float damageMult = 1f; float kbMult = 1f; if (player.altFunctionUse == 2) { - ammoConsumed = 5; SpeedX = velocity.X + (float)Main.rand.Next(-15, 16) * 0.05f; SpeedY = velocity.Y + (float)Main.rand.Next(-15, 16) * 0.05f; damageMult = 0.3333f; - kbMult = 3f/7f; + kbMult = 3f / 7f; } Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType(), (int)(damage * damageMult), knockBack * kbMult, player.whoAmI, 0f, 0f); - - // Consume 20 or 5 ammo per shot - CalamityGlobalItem.ConsumeAdditionalAmmo(player, item, ammoConsumed); - - return false; - } - - // Disable vanilla ammo consumption - public override bool ConsumeAmmo(Player player) - { return false; } @@ -94,16 +84,18 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal return new Vector2(-10, 0); } - /*public override void AddRecipes() + public override void AddRecipes() { - ModRecipe r = new ModRecipe(mod); - r.AddIngredient(null, "CrownJewel"); - r.AddIngredient(null, "GalacticaSingularity", 5); - r.AddIngredient(null, "BarofLife", 10); - r.AddIngredient(null, "CosmiliteBar", 15); - r.AddTile(TileID.LunarCraftingStation); - r.SetResult(this); - r.AddRecipe(); - }*/ + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 15); + recipe.AddIngredient(ModContent.ItemType(), 15); + recipe.AddIngredient(ModContent.ItemType(), 8); + recipe.AddIngredient(ItemID.LunarBar, 4); + // still awkward that the item called Plasma Rifle is the same class and exact same tier as this item + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddTile(TileID.LunarCraftingStation); + recipe.SetResult(this); + recipe.AddRecipe(); + } } } diff --git a/Items/Weapons/DraedonsArsenal/PlasmaGrenade.cs b/Items/Weapons/DraedonsArsenal/PlasmaGrenade.cs index 77c4d48f1b..cea18ca75e 100644 --- a/Items/Weapons/DraedonsArsenal/PlasmaGrenade.cs +++ b/Items/Weapons/DraedonsArsenal/PlasmaGrenade.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.DraedonsArsenal; +using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -21,7 +22,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal { item.width = 22; item.height = 28; - item.damage = 50; + item.damage = 7143; item.noMelee = true; item.noUseGraphic = true; item.consumable = true; @@ -31,12 +32,16 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal item.knockBack = 3f; item.UseSound = SoundID.Item1; item.autoReuse = true; - item.value = CalamityGlobalItem.Rarity5BuyPrice; - item.rare = 5; + + item.value = Item.sellPrice(silver: 80); + item.rare = ItemRarityID.Red; + item.Calamity().customRarity = CalamityRarity.DraedonRust; + item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 10f; + item.shootSpeed = 19f; item.Calamity().rogue = true; } + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Projectile grenade = Projectile.NewProjectileDirect(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI); @@ -49,9 +54,9 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 1); recipe.AddIngredient(ModContent.ItemType(), 1); - recipe.AddIngredient(ItemID.HallowedBar, 2); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this, 200); + recipe.AddIngredient(ModContent.ItemType(), 1); + recipe.AddTile(ModContent.TileType()); + recipe.SetResult(this, 999); recipe.AddRecipe(); } } diff --git a/Items/Weapons/DraedonsArsenal/PoleWarper.cs b/Items/Weapons/DraedonsArsenal/PoleWarper.cs index 6e7b579249..2b07e95aca 100644 --- a/Items/Weapons/DraedonsArsenal/PoleWarper.cs +++ b/Items/Weapons/DraedonsArsenal/PoleWarper.cs @@ -1,5 +1,7 @@ using CalamityMod.Items.Materials; +using CalamityMod.Items.Weapons.Summon; using CalamityMod.Projectiles.DraedonsArsenal; +using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -7,27 +9,30 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.DraedonsArsenal { - public class PoleWarper : ModItem + public class PoleWarper : ModItem { public override void SetStaticDefaults() { DisplayName.SetDefault("Pole Warper"); - Tooltip.SetDefault("Summons two floating magnets which repel each other"); + Tooltip.SetDefault("Summons two floating magnets that repel each other"); } public override void SetDefaults() { item.shootSpeed = 10f; - item.damage = 33; + item.damage = 700; item.mana = 12; item.width = 38; item.height = 24; - item.useTime = item.useAnimation = 30; + item.useTime = item.useAnimation = 10; item.useStyle = ItemUseStyleID.HoldingUp; item.noMelee = true; item.knockBack = 8f; - item.value = CalamityGlobalItem.Rarity4BuyPrice; - item.rare = 4; + + item.value = CalamityGlobalItem.RarityVioletBuyPrice; + item.rare = ItemRarityID.Red; + item.Calamity().customRarity = CalamityRarity.DraedonRust; + item.UseSound = SoundID.Item15; item.autoReuse = true; item.shoot = ModContent.ProjectileType(); @@ -71,12 +76,11 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 6); - recipe.AddIngredient(ModContent.ItemType(), 6); - recipe.AddIngredient(ModContent.ItemType(), 3); - recipe.AddIngredient(ModContent.ItemType(), 3); - recipe.AddIngredient(ModContent.ItemType(), 3); - recipe.AddTile(TileID.Anvils); + recipe.AddIngredient(ModContent.ItemType(), 25); + recipe.AddIngredient(ModContent.ItemType(), 15); + recipe.AddIngredient(ModContent.ItemType(), 4); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); } diff --git a/Items/Weapons/DraedonsArsenal/PulsePistol.cs b/Items/Weapons/DraedonsArsenal/PulsePistol.cs index d6d5d93ca9..4920e17d76 100644 --- a/Items/Weapons/DraedonsArsenal/PulsePistol.cs +++ b/Items/Weapons/DraedonsArsenal/PulsePistol.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal { item.width = 62; item.height = 22; - item.ranged = true; + item.magic = true; item.damage = 22; item.knockBack = 0f; item.useTime = item.useAnimation = 20; @@ -31,35 +31,32 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal item.noMelee = true; item.value = CalamityGlobalItem.Rarity3BuyPrice; - item.rare = 3; + item.rare = ItemRarityID.Red; + item.Calamity().customRarity = CalamityRarity.DraedonRust; item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 5.2f; // Keep in mind that the shot has extra updates. + item.shootSpeed = 5.2f; // This may seem low but the shot has 10 extra updates. item.Calamity().Chargeable = true; + item.Calamity().ChargeMax = 50; } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); - - // Consume 6 ammo per shot - CalamityGlobalItem.ConsumeAdditionalAmmo(player, item, 6); - return false; } public override Vector2? HoldoutOffset() => new Vector2(10f, 0f); - // Disable vanilla ammo consumption - public override bool ConsumeAmmo(Player player) => false; - public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddIngredient(ModContent.ItemType(), 7); - recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddIngredient(ModContent.ItemType(), 4); + recipe.AddIngredient(ItemID.MeteoriteBar, 4); + recipe.AddIngredient(ItemID.FlintlockPistol); recipe.AddTile(TileID.Anvils); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/DraedonsArsenal/PulseRifle.cs b/Items/Weapons/DraedonsArsenal/PulseRifle.cs index a1caa6d4b9..d668d400c9 100644 --- a/Items/Weapons/DraedonsArsenal/PulseRifle.cs +++ b/Items/Weapons/DraedonsArsenal/PulseRifle.cs @@ -10,11 +10,11 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal { public class PulseRifle : ModItem { - private int BaseDamage = 2500; + private int BaseDamage = 4500; public override void SetStaticDefaults() { - DisplayName.SetDefault("Draedon's Pulse Rifle"); + DisplayName.SetDefault("Pulse Rifle"); Tooltip.SetDefault("Draedon's high-efficiency electromagnetic pulse rifle\n" + "Incredibly accurate pulse weapon, crafted and wielded by Draedon to defend against his own creations\n" + "When the pulse hits a target it will arc to another nearby target\n" + @@ -36,14 +36,15 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/PulseRifleFire"); item.noMelee = true; - item.value = Item.buyPrice(1, 80, 0, 0); - item.rare = 10; - item.Calamity().customRarity = CalamityRarity.RareVariant; + item.value = CalamityGlobalItem.RarityVioletBuyPrice; + item.rare = ItemRarityID.Red; + item.Calamity().customRarity = CalamityRarity.DraedonRust; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 5f; item.Calamity().Chargeable = true; + item.Calamity().ChargeMax = 250; } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) @@ -59,32 +60,19 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal float SpeedY = velocity.Y + (float)Main.rand.Next(-1, 2) * 0.05f; Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); - - // Consume 6 ammo per shot - CalamityGlobalItem.ConsumeAdditionalAmmo(player, item, 6); - return false; } - // Disable vanilla ammo consumption - public override bool ConsumeAmmo(Player player) - { - return false; - } - - public override Vector2? HoldoutOffset() - { - return new Vector2(-10, 0); - } + public override Vector2? HoldoutOffset() => new Vector2(-10, 0); public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 15); - recipe.AddIngredient(ModContent.ItemType(), 15); - recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ModContent.ItemType(), 16); + recipe.AddIngredient(ModContent.ItemType(), 24); + recipe.AddIngredient(ModContent.ItemType(), 4); + // The only arsenal weapon that is an upgrade of another arsenal weapon (and it makes sense). recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ItemID.LaserRifle); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/DraedonsArsenal/PulseTurretRemote.cs b/Items/Weapons/DraedonsArsenal/PulseTurretRemote.cs index 15767f3f01..ea566a1b16 100644 --- a/Items/Weapons/DraedonsArsenal/PulseTurretRemote.cs +++ b/Items/Weapons/DraedonsArsenal/PulseTurretRemote.cs @@ -7,29 +7,34 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.DraedonsArsenal { - public class PulseTurretRemote : ModItem + public class PulseTurretRemote : ModItem { public override void SetStaticDefaults() { DisplayName.SetDefault("Pulse Turret Remote"); + Tooltip.SetDefault("Summons a pulse turret which eradicates nearby foes with focused energy blasts\n" + + "Especially effective against inorganic targets"); } public override void SetDefaults() { item.width = 28; item.height = 26; + item.summon = true; item.sentry = true; - item.damage = 21; + item.damage = 100; item.knockBack = 0f; - item.useTime = item.useAnimation = 35; + item.mana = 10; + item.useTime = item.useAnimation = 25; item.autoReuse = true; item.useStyle = ItemUseStyleID.HoldingUp; item.UseSound = SoundID.Item15; item.noMelee = true; - item.value = CalamityGlobalItem.Rarity4BuyPrice; - item.rare = 4; + item.value = CalamityGlobalItem.Rarity5BuyPrice; + item.rare = ItemRarityID.Red; + item.Calamity().customRarity = CalamityRarity.DraedonRust; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 1f; @@ -55,6 +60,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal } } Projectile.NewProjectile(Main.MouseWorld, Vector2.Zero, type, damage, knockBack, player.whoAmI); + //player.UpdateMaxTurrets(); } return false; } @@ -62,12 +68,11 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 10); - recipe.AddIngredient(ModContent.ItemType(), 10); - recipe.AddIngredient(ModContent.ItemType(), 3); - recipe.AddIngredient(ModContent.ItemType(), 3); - recipe.AddIngredient(ModContent.ItemType(), 3); - recipe.AddTile(TileID.Anvils); + recipe.AddIngredient(ModContent.ItemType(), 12); + recipe.AddIngredient(ModContent.ItemType(), 18); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); } diff --git a/Items/Weapons/DraedonsArsenal/SnakeEyes.cs b/Items/Weapons/DraedonsArsenal/SnakeEyes.cs index 6e76fd1ac0..394aa4adca 100644 --- a/Items/Weapons/DraedonsArsenal/SnakeEyes.cs +++ b/Items/Weapons/DraedonsArsenal/SnakeEyes.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using CalamityMod.Items.Weapons.Summon; using CalamityMod.Projectiles.DraedonsArsenal; using Microsoft.Xna.Framework; using Terraria; @@ -7,7 +8,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.DraedonsArsenal { - public class SnakeEyes : ModItem + public class SnakeEyes : ModItem { public override void SetStaticDefaults() { @@ -18,16 +19,19 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void SetDefaults() { item.shootSpeed = 10f; - item.damage = 9; + item.damage = 75; item.mana = 12; item.width = 38; item.height = 24; - item.useTime = item.useAnimation = 30; + item.useTime = item.useAnimation = 15; item.useStyle = ItemUseStyleID.HoldingUp; item.noMelee = true; item.knockBack = 3f; - item.value = CalamityGlobalItem.Rarity3BuyPrice; - item.rare = ItemRarityID.Orange; + + item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; + item.rare = ItemRarityID.Red; + item.Calamity().customRarity = CalamityRarity.DraedonRust; + item.UseSound = SoundID.Item15; item.autoReuse = true; item.shoot = ModContent.ProjectileType(); @@ -44,10 +48,12 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 7); - recipe.AddIngredient(ModContent.ItemType(), 7); - recipe.AddIngredient(ModContent.ItemType(), 7); - recipe.AddTile(TileID.Anvils); + recipe.AddIngredient(ModContent.ItemType(), 15); + recipe.AddIngredient(ModContent.ItemType(), 15); + recipe.AddIngredient(ModContent.ItemType(), 8); + recipe.AddIngredient(ItemID.LunarBar, 4); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); recipe.AddRecipe(); } diff --git a/Items/Weapons/DraedonsArsenal/StarSwallowerContainmentUnit.cs b/Items/Weapons/DraedonsArsenal/StarSwallowerContainmentUnit.cs index 716fef4d87..51dc6502a8 100644 --- a/Items/Weapons/DraedonsArsenal/StarSwallowerContainmentUnit.cs +++ b/Items/Weapons/DraedonsArsenal/StarSwallowerContainmentUnit.cs @@ -12,13 +12,13 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void SetStaticDefaults() { DisplayName.SetDefault("Star Swallower Containment Unit"); - Tooltip.SetDefault("Summons a mechanical frog that vomits plasma onto enemies"); + Tooltip.SetDefault("Summons a biomechanical frog that vomits plasma onto enemies"); } public override void SetDefaults() { item.shootSpeed = 10f; - item.damage = 20; + item.damage = 24; item.mana = 10; item.width = 18; item.height = 28; @@ -27,7 +27,8 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal item.noMelee = true; item.knockBack = 2.25f; item.value = CalamityGlobalItem.Rarity3BuyPrice; - item.rare = 3; + item.rare = ItemRarityID.Red; + item.Calamity().customRarity = CalamityRarity.DraedonRust; item.UseSound = SoundID.Item15; item.autoReuse = true; item.shoot = ModContent.ProjectileType(); @@ -48,9 +49,11 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 6); - recipe.AddIngredient(ModContent.ItemType(), 6); - recipe.AddIngredient(ModContent.ItemType(), 8); + recipe.AddIngredient(ModContent.ItemType(), 8); + recipe.AddIngredient(ModContent.ItemType(), 4); + recipe.AddIngredient(ModContent.ItemType(), 4); + recipe.AddIngredient(ItemID.MeteoriteBar, 4); + recipe.AddIngredient(ItemID.Frog); recipe.AddTile(TileID.Anvils); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/DraedonsArsenal/TeslaCannon.cs b/Items/Weapons/DraedonsArsenal/TeslaCannon.cs index bb5198a90b..a50368759e 100644 --- a/Items/Weapons/DraedonsArsenal/TeslaCannon.cs +++ b/Items/Weapons/DraedonsArsenal/TeslaCannon.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal { public class TeslaCannon : ModItem { - private int BaseDamage = 9000; + private int BaseDamage = 10000; public override void SetStaticDefaults() { @@ -35,14 +35,15 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/TeslaCannonFire"); item.noMelee = true; - item.value = Item.buyPrice(1, 80, 0, 0); - item.rare = 10; - item.Calamity().customRarity = CalamityRarity.RareVariant; + item.value = CalamityGlobalItem.RarityVioletBuyPrice; + item.rare = ItemRarityID.Red; + item.Calamity().customRarity = CalamityRarity.DraedonRust; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 5f; item.Calamity().Chargeable = true; + item.Calamity().ChargeMax = 250; } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) @@ -58,30 +59,17 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal float SpeedY = velocity.Y + (float)Main.rand.Next(-1, 2) * 0.02f; Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); - - // Consume 30 ammo per shot - CalamityGlobalItem.ConsumeAdditionalAmmo(player, item, 30); - return false; } - // Disable vanilla ammo consumption - public override bool ConsumeAmmo(Player player) - { - return false; - } - - public override Vector2? HoldoutOffset() - { - return new Vector2(-20, 0); - } + public override Vector2? HoldoutOffset() => new Vector2(-20, 0); public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 15); + recipe.AddIngredient(ModContent.ItemType(), 25); recipe.AddIngredient(ModContent.ItemType(), 15); - recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ModContent.ItemType(), 4); recipe.AddIngredient(ItemID.ChargedBlasterCannon); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); diff --git a/Items/Weapons/Magic/AcidGun.cs b/Items/Weapons/Magic/AcidGun.cs index 21486d3c96..3c739f5a43 100644 --- a/Items/Weapons/Magic/AcidGun.cs +++ b/Items/Weapons/Magic/AcidGun.cs @@ -33,6 +33,9 @@ namespace CalamityMod.Items.Weapons.Magic item.shootSpeed = 14f; item.shoot = ModContent.ProjectileType(); } + + public override Vector2? HoldoutOffset() => new Vector2(-5, 0); + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { for (int i = 0; i < 3; i++) @@ -42,6 +45,7 @@ namespace CalamityMod.Items.Weapons.Magic } return false; } + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/Magic/ApoctosisArray.cs b/Items/Weapons/Magic/ApoctosisArray.cs index 72bf37f820..b91cc6fbd4 100644 --- a/Items/Weapons/Magic/ApoctosisArray.cs +++ b/Items/Weapons/Magic/ApoctosisArray.cs @@ -6,60 +6,60 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Magic { - public class ApoctosisArray : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Apoctosis Array"); - Tooltip.SetDefault("Fires ion blasts that speed up and then explode\n" + - "The higher your mana the more damage they will do\n" + + public class ApoctosisArray : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Apoctosis Array"); + Tooltip.SetDefault("Fires ion blasts that speed up and then explode\n" + + "The higher your mana the more damage they will do\n" + "Astral steroids can inhibit the potential of this weapon"); - } + } - public override void SetDefaults() - { - item.width = 98; - item.damage = 55; - item.magic = true; - item.mana = 12; - item.useAnimation = 7; - item.useTime = 7; - item.useStyle = ItemUseStyleID.HoldingOut; - item.knockBack = 6.75f; - item.UseSound = SoundID.Item91; - item.autoReuse = true; - item.noMelee = true; - item.height = 34; - item.value = Item.buyPrice(1, 20, 0, 0); - item.rare = 10; - item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 8f; - item.Calamity().customRarity = CalamityRarity.Turquoise; - } + public override void SetDefaults() + { + item.width = 98; + item.damage = 55; + item.magic = true; + item.mana = 12; + item.useAnimation = 7; + item.useTime = 7; + item.useStyle = ItemUseStyleID.HoldingOut; + item.knockBack = 6.75f; + item.UseSound = SoundID.Item91; + item.autoReuse = true; + item.noMelee = true; + item.height = 34; + item.value = Item.buyPrice(1, 20, 0, 0); + item.rare = 10; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 8f; + item.Calamity().customRarity = CalamityRarity.Turquoise; + } - public override Vector2? HoldoutOffset() - { - return new Vector2(-25, 0); - } + public override Vector2? HoldoutOffset() + { + return new Vector2(-25, 0); + } - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - float manaAmount = (float)player.statMana * 0.01f; - float damageMult = manaAmount; + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + float manaAmount = (float)player.statMana * 0.01f; + float damageMult = manaAmount; float injectionNerf = player.Calamity().astralInjection ? 0.6f : 1f; - int projectile = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, (int)(damage * damageMult * injectionNerf), knockBack, player.whoAmI, 0f, 0f); - Main.projectile[projectile].scale = manaAmount * 0.375f; - return false; - } + int projectile = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, (int)(damage * damageMult * injectionNerf), knockBack, player.whoAmI); + Main.projectile[projectile].scale = manaAmount * 0.375f; + return false; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ItemID.LunarBar, 5); - recipe.AddTile(TileID.LunarCraftingStation); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ItemID.LunarBar, 5); + recipe.AddTile(TileID.LunarCraftingStation); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } diff --git a/Items/Weapons/Magic/Effervescence.cs b/Items/Weapons/Magic/Effervescence.cs index cb97f27dda..cb8d9ce1e7 100644 --- a/Items/Weapons/Magic/Effervescence.cs +++ b/Items/Weapons/Magic/Effervescence.cs @@ -35,6 +35,8 @@ namespace CalamityMod.Items.Weapons.Magic item.Calamity().customRarity = CalamityRarity.Turquoise; } + public override Vector2? HoldoutOffset() => new Vector2(-5, 0); + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { for (int randomBullets = 0; randomBullets <= 4; randomBullets++) diff --git a/Items/Weapons/Magic/EidolicWail.cs b/Items/Weapons/Magic/EidolicWail.cs index 5e8e12c6f3..619cbca78c 100644 --- a/Items/Weapons/Magic/EidolicWail.cs +++ b/Items/Weapons/Magic/EidolicWail.cs @@ -37,9 +37,6 @@ namespace CalamityMod.Items.Weapons.Magic item.Calamity().customRarity = CalamityRarity.PureGreen; } - public override Vector2? HoldoutOffset() - { - return new Vector2(-5, 0); - } + public override Vector2? HoldoutOffset() => new Vector2(-5, 0); } } diff --git a/Items/Weapons/Magic/IonBlaster.cs b/Items/Weapons/Magic/IonBlaster.cs index fad71a3dc0..f85659f136 100644 --- a/Items/Weapons/Magic/IonBlaster.cs +++ b/Items/Weapons/Magic/IonBlaster.cs @@ -6,57 +6,59 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Magic { - public class IonBlaster : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ion Blaster"); - Tooltip.SetDefault("Fires ion blasts that speed up and then explode\n" + - "The higher your mana the more damage they will do"); - } + public class IonBlaster : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ion Blaster"); + Tooltip.SetDefault("Fires ion blasts that speed up and then explode\n" + + "The higher your mana the more damage they will do\n" + + "Astral steroids can inhibit the potential of this weapon"); + } - public override void SetDefaults() - { - item.width = 44; - item.damage = 30; - item.magic = true; - item.mana = 6; - item.useAnimation = 10; - item.useTime = 10; - item.useStyle = ItemUseStyleID.HoldingOut; - item.knockBack = 5.5f; - item.UseSound = SoundID.Item91; - item.autoReuse = true; - item.noMelee = true; - item.height = 28; - item.value = Item.buyPrice(0, 36, 0, 0); - item.rare = 5; - item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 3f; - } + public override void SetDefaults() + { + item.width = 44; + item.damage = 30; + item.magic = true; + item.mana = 6; + item.useAnimation = 10; + item.useTime = 10; + item.useStyle = ItemUseStyleID.HoldingOut; + item.knockBack = 5.5f; + item.UseSound = SoundID.Item91; + item.autoReuse = true; + item.noMelee = true; + item.height = 28; + item.value = Item.buyPrice(0, 36, 0, 0); + item.rare = 5; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 3f; + } - public override Vector2? HoldoutOffset() - { - return new Vector2(-5, 0); - } + public override Vector2? HoldoutOffset() + { + return new Vector2(-5, 0); + } - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - float manaAmount = (float)player.statMana * 0.01f; - float damageMult = manaAmount * 0.75f; - int projectile = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, (int)((double)damage * damageMult), knockBack, player.whoAmI, 0.0f, 0.0f); - Main.projectile[projectile].scale = manaAmount; - return false; - } + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + float manaAmount = (float)player.statMana * 0.01f; + float damageMult = manaAmount * 0.75f; + float injectionNerf = player.Calamity().astralInjection ? 0.6f : 1f; + int projectile = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, (int)(damage * damageMult * injectionNerf), knockBack, player.whoAmI); + Main.projectile[projectile].scale = manaAmount; + return false; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.SoulofFright, 10); - recipe.AddRecipeGroup("AnyAdamantiteBar", 7); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.SoulofFright, 10); + recipe.AddRecipeGroup("AnyAdamantiteBar", 7); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } diff --git a/Items/Weapons/Magic/Lazhar.cs b/Items/Weapons/Magic/Lazhar.cs index 4ed61c734a..e02e3b06f3 100644 --- a/Items/Weapons/Magic/Lazhar.cs +++ b/Items/Weapons/Magic/Lazhar.cs @@ -34,6 +34,8 @@ namespace CalamityMod.Items.Weapons.Magic item.shoot = ModContent.ProjectileType(); } + public override Vector2? HoldoutOffset() => new Vector2(-5, 0); + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { float SpeedX = speedX + (float)Main.rand.Next(-15, 16) * 0.05f; diff --git a/Items/Weapons/Magic/WrathoftheAncients.cs b/Items/Weapons/Magic/WrathoftheAncients.cs index d7aa63ac3d..de252ca89e 100644 --- a/Items/Weapons/Magic/WrathoftheAncients.cs +++ b/Items/Weapons/Magic/WrathoftheAncients.cs @@ -35,33 +35,7 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - int i = Main.myPlayer; - float num72 = item.shootSpeed; - int num73 = damage; - float num74 = knockBack; - num74 = player.GetWeaponKnockback(item, num74); - player.itemTime = item.useTime; - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (player.gravDir == -1f) - { - num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; - } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) - { - num78 = (float)player.direction; - } - else - { - num80 = num72 / num80; - } - num78 = 0f; - num79 = 0f; - vector2.X = (float)Main.mouseX + Main.screenPosition.X; - vector2.Y = (float)Main.mouseY + Main.screenPosition.Y; - Projectile.NewProjectile(vector2.X, vector2.Y, num78, num79, ModContent.ProjectileType(), num73, num74, i, 0f, 0f); + Projectile.NewProjectile(Main.MouseWorld, Vector2.Zero, type, damage, knockBack, player.whoAmI, 0f, 0f); return false; } } diff --git a/Items/Weapons/Rogue/ToxicantTwister.cs b/Items/Weapons/Rogue/ToxicantTwister.cs index 2c79249716..46c497b84d 100644 --- a/Items/Weapons/Rogue/ToxicantTwister.cs +++ b/Items/Weapons/Rogue/ToxicantTwister.cs @@ -13,14 +13,14 @@ namespace CalamityMod.Items.Weapons.Rogue DisplayName.SetDefault("Toxicant Twister"); Tooltip.SetDefault("Throws a slow moving boomerang\n" + "After a few moments, the boomerang chooses a target and rapidly homes in\n" + - "Stealth strikes fire three boomerangs that home in faster and rapidly release sand"); + "Stealth strikes home in faster and rapidly release sand"); } public override void SafeSetDefaults() { item.width = 42; item.height = 46; - item.damage = 750; + item.damage = 650; item.noMelee = true; item.noUseGraphic = true; item.useAnimation = item.useTime = 20; @@ -38,20 +38,8 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - if (player.Calamity().StealthStrikeAvailable()) - { - for (int i = 0; i < 3; i++) - { - float SpeedX = speedX + (float)Main.rand.Next(-20, 21) * 0.05f; - float SpeedY = speedY + (float)Main.rand.Next(-20, 21) * 0.05f; - int stealth = Projectile.NewProjectile(position, new Vector2(SpeedX, SpeedY), type, damage, knockBack, player.whoAmI); - Main.projectile[stealth].Calamity().stealthStrike = true; - } - } - else - { - Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f); - } + int boomer = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f); + Main.projectile[boomer].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); return false; } } diff --git a/Items/Weapons/Summon/CadaverousCarrion.cs b/Items/Weapons/Summon/CadaverousCarrion.cs index 32a59de547..655a09d704 100644 --- a/Items/Weapons/Summon/CadaverousCarrion.cs +++ b/Items/Weapons/Summon/CadaverousCarrion.cs @@ -37,11 +37,10 @@ namespace CalamityMod.Items.Weapons.Summon { if (player.altFunctionUse != 2) { - position = Main.MouseWorld; - Point mouseTileCoords = position.ToTileCoordinates(); - if (WorldGen.SolidTile(mouseTileCoords.X, mouseTileCoords.Y)) + Point mouseTileCoords = Main.MouseWorld.ToTileCoordinates(); + if (CalamityUtils.ParanoidTileRetrieval(mouseTileCoords.X, mouseTileCoords.Y).active()) return false; - Projectile.NewProjectile(position, Vector2.Zero, type, damage, knockBack, player.whoAmI); + Projectile.NewProjectile(Main.MouseWorld, Vector2.Zero, type, damage, knockBack, player.whoAmI); player.UpdateMaxTurrets(); } return false; diff --git a/Items/Weapons/Summon/CosmicImmaterializer.cs b/Items/Weapons/Summon/CosmicImmaterializer.cs index a5fbf51a9a..a332199476 100644 --- a/Items/Weapons/Summon/CosmicImmaterializer.cs +++ b/Items/Weapons/Summon/CosmicImmaterializer.cs @@ -47,29 +47,7 @@ namespace CalamityMod.Items.Weapons.Summon { CalamityPlayer modPlayer = player.Calamity(); bool hasSummonerSet = modPlayer.tarraSummon || modPlayer.bloodflareSummon || modPlayer.godSlayerSummon || modPlayer.silvaSummon || modPlayer.dsSetBonus || modPlayer.omegaBlueSet || modPlayer.fearmongerSet; //demonshade included so summoner isn't forced to use auric for BR - player.itemTime = item.useTime; - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (player.gravDir == -1f) - { - num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; - } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) - { - num78 = (float)player.direction; - num80 = item.shootSpeed; - } - else - { - num80 = item.shootSpeed / num80; - } - num78 = 0f; - num79 = 0f; - vector2.X = (float)Main.mouseX + Main.screenPosition.X; - vector2.Y = (float)Main.mouseY + Main.screenPosition.Y; - Projectile.NewProjectile(vector2.X, vector2.Y, num78, num79, type, (int)((double)damage * (hasSummonerSet ? 1.0 : 0.66)), knockBack, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(Main.MouseWorld, Vector2.Zero, type, (int)(damage * (hasSummonerSet ? 1 : 0.66)), knockBack, player.whoAmI, 0f, 0f); return false; } diff --git a/Items/Weapons/Summon/HivePod.cs b/Items/Weapons/Summon/HivePod.cs index 6b4c3d4bc5..e5046a6a05 100644 --- a/Items/Weapons/Summon/HivePod.cs +++ b/Items/Weapons/Summon/HivePod.cs @@ -36,10 +36,7 @@ namespace CalamityMod.Items.Weapons.Summon { if (player.altFunctionUse != 2) { - position = Main.MouseWorld; - speedX = 0; - speedY = 0; - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI); + Projectile.NewProjectile(Main.MouseWorld, Vector2.Zero, type, damage, knockBack, player.whoAmI); player.UpdateMaxTurrets(); } return false; diff --git a/Items/Weapons/Summon/ShellfishStaff.cs b/Items/Weapons/Summon/ShellfishStaff.cs index 5d703af829..e339fc04cb 100644 --- a/Items/Weapons/Summon/ShellfishStaff.cs +++ b/Items/Weapons/Summon/ShellfishStaff.cs @@ -38,10 +38,7 @@ namespace CalamityMod.Items.Weapons.Summon { if (player.altFunctionUse != 2) { - position = Main.MouseWorld; - speedX = 0; - speedY = 0; - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI); + Projectile.NewProjectile(Main.MouseWorld, Vector2.Zero, type, damage, knockBack, player.whoAmI); } return false; } diff --git a/Items/Weapons/Summon/SpikecragStaff.cs b/Items/Weapons/Summon/SpikecragStaff.cs index 4e076e9e8b..59fe58d3b1 100644 --- a/Items/Weapons/Summon/SpikecragStaff.cs +++ b/Items/Weapons/Summon/SpikecragStaff.cs @@ -38,10 +38,10 @@ namespace CalamityMod.Items.Weapons.Summon { if (player.altFunctionUse != 2) { - position = Main.MouseWorld; - speedX = 0; - speedY = 0; - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 120f, 0f); + Point mouseTileCoords = Main.MouseWorld.ToTileCoordinates(); + if (CalamityUtils.ParanoidTileRetrieval(mouseTileCoords.X, mouseTileCoords.Y).active()) + return false; + Projectile.NewProjectile(Main.MouseWorld, Vector2.Zero, type, damage, knockBack, player.whoAmI, 120f, 0f); player.UpdateMaxTurrets(); } return false; diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index e037e4d520..fcc8339950 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -21,6 +21,7 @@ using CalamityMod.Items.SummonItems.Invasion; using CalamityMod.Items.Tools; using CalamityMod.Items.Tools.ClimateChange; using CalamityMod.Items.TreasureBags; +using CalamityMod.Items.Weapons.DraedonsArsenal; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; @@ -56,6 +57,7 @@ using CalamityMod.NPCs.SunkenSea; using CalamityMod.NPCs.SupremeCalamitas; using CalamityMod.NPCs.TownNPCs; using CalamityMod.NPCs.Yharon; +using CalamityMod.Projectiles.DraedonsArsenal; using CalamityMod.Projectiles.Summon; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -811,61 +813,71 @@ namespace CalamityMod private static void SummonersAssociationSupport() { Mod sAssociation = ModLoader.GetMod("SummonersAssociation"); - if(sAssociation != null) + if (sAssociation is null) + return; + + void RegisterSummon(int summonItem, int summonBuff, int summonProjectile) { - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), new List() { ProjectileType(), ProjectileType(), ProjectileType()}, new List() {1-(1f/3f), 2f/3f, 2f/3f}); - //Entropy's Vigil is a bruh moment - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), new List() { ProjectileType(), ProjectileType()}); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType(), 1f); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); - sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType()); + sAssociation.Call("AddMinionInfo", summonItem, summonBuff, summonProjectile); } + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + RegisterSummon(ItemType(), BuffType(), ProjectileType()); + + sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), new List() { ProjectileType(), ProjectileType(), ProjectileType()}, new List() {1-(1f/3f), 2f/3f, 2f/3f}); + //Entropy's Vigil is a bruh moment + sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), new List() { ProjectileType(), ProjectileType()}); + sAssociation.Call("AddMinionInfo", ItemType(), BuffType(), ProjectileType(), 1f); } } } diff --git a/NPCs/Abyss/EidolonWyrmHead.cs b/NPCs/Abyss/EidolonWyrmHead.cs index a544e54f1d..65e9ff160c 100644 --- a/NPCs/Abyss/EidolonWyrmHead.cs +++ b/NPCs/Abyss/EidolonWyrmHead.cs @@ -76,7 +76,7 @@ namespace CalamityMod.NPCs.Abyss public override void AI() { - if (npc.justHit || npc.life <= npc.lifeMax * 0.98 || Main.player[npc.target].chaosState) + if (npc.justHit || detectsPlayer || Main.player[npc.target].chaosState) { detectsPlayer = true; npc.damage = Main.expertMode ? 340 : 170; @@ -221,16 +221,29 @@ namespace CalamityMod.NPCs.Abyss { npc.spriteDirection = 1; } - if (Main.player[npc.target].dead) - { - npc.TargetClosest(false); - } - npc.alpha -= 42; + if (Main.player[npc.target].dead) + { + npc.TargetClosest(false); + + npc.velocity.Y += 3f; + if (npc.position.Y > Main.worldSurface * 16.0) + npc.velocity.Y += 3f; + + if (npc.position.Y > (Main.maxTilesY - 200) * 16.0) + { + for (int a = 0; a < Main.maxNPCs; a++) + { + if (Main.npc[a].type == npc.type || Main.npc[a].type == ModContent.NPCType() || Main.npc[a].type == ModContent.NPCType() || Main.npc[a].type == ModContent.NPCType()) + Main.npc[a].active = false; + } + } + } + npc.alpha -= 42; if (npc.alpha < 0) { npc.alpha = 0; } - if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > 6400f || !NPC.AnyNPCs(ModContent.NPCType()) || !Main.player[npc.target].Calamity().ZoneAbyss) + if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > 6400f || !NPC.AnyNPCs(ModContent.NPCType())) { npc.active = false; } diff --git a/NPCs/Abyss/EidolonWyrmHeadHuge.cs b/NPCs/Abyss/EidolonWyrmHeadHuge.cs index 6df38e3267..91da677794 100644 --- a/NPCs/Abyss/EidolonWyrmHeadHuge.cs +++ b/NPCs/Abyss/EidolonWyrmHeadHuge.cs @@ -78,7 +78,7 @@ namespace CalamityMod.NPCs.Abyss { npc.TargetClosest(true); } - if (npc.justHit || npc.life <= npc.lifeMax * 0.98 || Main.player[npc.target].chaosState) + if (npc.justHit || detectsPlayer || Main.player[npc.target].chaosState) { if (!detectsPlayer) { @@ -216,6 +216,7 @@ namespace CalamityMod.NPCs.Abyss } } } + if (npc.velocity.X < 0f) { npc.spriteDirection = -1; @@ -224,16 +225,32 @@ namespace CalamityMod.NPCs.Abyss { npc.spriteDirection = 1; } + if (Main.player[npc.target].dead) { npc.TargetClosest(false); - } + + npc.velocity.Y += 3f; + if (npc.position.Y > Main.worldSurface * 16.0) + npc.velocity.Y += 3f; + + if (npc.position.Y > (Main.maxTilesY - 200) * 16.0) + { + for (int a = 0; a < Main.maxNPCs; a++) + { + if (Main.npc[a].type == npc.type || Main.npc[a].type == ModContent.NPCType() || Main.npc[a].type == ModContent.NPCType() || Main.npc[a].type == ModContent.NPCType()) + Main.npc[a].active = false; + } + } + } + npc.alpha -= 42; if (npc.alpha < 0) { npc.alpha = 0; } - if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > 6400f || !NPC.AnyNPCs(ModContent.NPCType())) + + if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > 6400f || !NPC.AnyNPCs(ModContent.NPCType())) { npc.active = false; } diff --git a/NPCs/AcidRain/AcidEel.cs b/NPCs/AcidRain/AcidEel.cs index c64038ed8d..f8a6109622 100644 --- a/NPCs/AcidRain/AcidEel.cs +++ b/NPCs/AcidRain/AcidEel.cs @@ -42,7 +42,7 @@ namespace CalamityMod.NPCs.AcidRain else if (CalamityWorld.downedAquaticScourge) { npc.damage = 80; - npc.lifeMax = 705; + npc.lifeMax = 420; } npc.value = Item.buyPrice(0, 0, 3, 32); diff --git a/NPCs/AcidRain/CragmawMire.cs b/NPCs/AcidRain/CragmawMire.cs index 2997931d62..b6d0e8b50b 100644 --- a/NPCs/AcidRain/CragmawMire.cs +++ b/NPCs/AcidRain/CragmawMire.cs @@ -30,7 +30,7 @@ namespace CalamityMod.NPCs.AcidRain npc.aiStyle = aiType = -1; npc.damage = 66; - npc.lifeMax = 6000; + npc.lifeMax = 4000; npc.defense = 25; if (CalamityWorld.downedPolterghast) diff --git a/NPCs/AcidRain/FlakCrab.cs b/NPCs/AcidRain/FlakCrab.cs index c11372763b..62078c88ce 100644 --- a/NPCs/AcidRain/FlakCrab.cs +++ b/NPCs/AcidRain/FlakCrab.cs @@ -26,7 +26,7 @@ namespace CalamityMod.NPCs.AcidRain npc.height = 70; npc.damage = 0; - npc.lifeMax = 700; + npc.lifeMax = 600; npc.aiStyle = aiType = -1; diff --git a/NPCs/AcidRain/IrradiatedSlime.cs b/NPCs/AcidRain/IrradiatedSlime.cs index 2513fee920..9e529eed89 100644 --- a/NPCs/AcidRain/IrradiatedSlime.cs +++ b/NPCs/AcidRain/IrradiatedSlime.cs @@ -25,7 +25,7 @@ namespace CalamityMod.NPCs.AcidRain npc.height = 30; npc.damage = 75; - npc.lifeMax = 640; + npc.lifeMax = 425; npc.defense = 5; npc.knockBackResist = 0f; diff --git a/NPCs/AcidRain/NuclearToad.cs b/NPCs/AcidRain/NuclearToad.cs index 96de09bdc2..16b59240dd 100644 --- a/NPCs/AcidRain/NuclearToad.cs +++ b/NPCs/AcidRain/NuclearToad.cs @@ -39,7 +39,7 @@ namespace CalamityMod.NPCs.AcidRain else if (CalamityWorld.downedAquaticScourge) { npc.damage = 80; - npc.lifeMax = 420; + npc.lifeMax = 380; } npc.knockBackResist = 0.7f; diff --git a/NPCs/AcidRain/Orthocera.cs b/NPCs/AcidRain/Orthocera.cs index a5667a3df9..bcfefb1355 100644 --- a/NPCs/AcidRain/Orthocera.cs +++ b/NPCs/AcidRain/Orthocera.cs @@ -27,7 +27,7 @@ namespace CalamityMod.NPCs.AcidRain npc.aiStyle = aiType = -1; npc.damage = 75; - npc.lifeMax = 605; + npc.lifeMax = 520; npc.defense = 15; npc.DR_NERD(0.075f); diff --git a/NPCs/AcidRain/Radiator.cs b/NPCs/AcidRain/Radiator.cs index 60c2065b34..9f6c3f98a9 100644 --- a/NPCs/AcidRain/Radiator.cs +++ b/NPCs/AcidRain/Radiator.cs @@ -25,7 +25,7 @@ namespace CalamityMod.NPCs.AcidRain npc.width = 24; npc.height = 24; npc.defense = 5; - npc.lifeMax = 100; + npc.lifeMax = 50; if (CalamityWorld.downedPolterghast) { @@ -36,7 +36,7 @@ namespace CalamityMod.NPCs.AcidRain else if (CalamityWorld.downedAquaticScourge) { npc.damage = 75; - npc.lifeMax = 640; + npc.lifeMax = 130; npc.defense = 10; } diff --git a/NPCs/AcidRain/Skyfin.cs b/NPCs/AcidRain/Skyfin.cs index 16f09e13ae..882f287281 100644 --- a/NPCs/AcidRain/Skyfin.cs +++ b/NPCs/AcidRain/Skyfin.cs @@ -31,7 +31,7 @@ namespace CalamityMod.NPCs.AcidRain npc.aiStyle = aiType = -1; npc.damage = 12; - npc.lifeMax = 150; + npc.lifeMax = 70; npc.defense = 6; npc.knockBackResist = 1f; @@ -46,7 +46,7 @@ namespace CalamityMod.NPCs.AcidRain else if (CalamityWorld.downedAquaticScourge) { npc.damage = 85; - npc.lifeMax = 700; + npc.lifeMax = 400; npc.DR_NERD(0.05f); } diff --git a/NPCs/AcidRain/SulfurousSkater.cs b/NPCs/AcidRain/SulfurousSkater.cs index 6698cbea48..001078709c 100644 --- a/NPCs/AcidRain/SulfurousSkater.cs +++ b/NPCs/AcidRain/SulfurousSkater.cs @@ -39,7 +39,7 @@ namespace CalamityMod.NPCs.AcidRain npc.height = 48; npc.damage = 70; - npc.lifeMax = 660; + npc.lifeMax = 520; npc.defense = 3; if (CalamityWorld.downedPolterghast) diff --git a/NPCs/AcidRain/Trilobite.cs b/NPCs/AcidRain/Trilobite.cs index 2a283f81c3..04e13cc550 100644 --- a/NPCs/AcidRain/Trilobite.cs +++ b/NPCs/AcidRain/Trilobite.cs @@ -32,7 +32,7 @@ namespace CalamityMod.NPCs.AcidRain npc.aiStyle = aiType = -1; npc.damage = 66; - npc.lifeMax = 850; + npc.lifeMax = 600; npc.defense = 15; npc.DR_NERD(0.25f); diff --git a/NPCs/AcidRain/WaterLeech.cs b/NPCs/AcidRain/WaterLeech.cs index b993de950c..335f6901a9 100644 --- a/NPCs/AcidRain/WaterLeech.cs +++ b/NPCs/AcidRain/WaterLeech.cs @@ -27,7 +27,7 @@ namespace CalamityMod.NPCs.AcidRain npc.height = 14; npc.damage = 20; - npc.lifeMax = 80; + npc.lifeMax = 60; npc.defense = 0; if (CalamityWorld.downedPolterghast) @@ -39,7 +39,7 @@ namespace CalamityMod.NPCs.AcidRain else if (CalamityWorld.downedAquaticScourge) { npc.damage = 80; - npc.lifeMax = 320; + npc.lifeMax = 150; } npc.value = Item.buyPrice(0, 0, 2, 5); diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index c8eb02733f..22518e08c0 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -3529,10 +3529,13 @@ namespace CalamityMod.NPCs // Increase projectile fire rate based on number of nearby active tiles float projectileFireRateMultiplier = MathHelper.Lerp(1f, 4f, 1f - ((tileEnrageMult - 1f) / 0.8f)); + // Decrease projectile time left based on number of nearby active tiles + int baseProjectileTimeLeft = (int)(333.4f * tileEnrageMult); + // Increase damage of projectiles and contact damage based on number of nearby active tiles int damageIncrease = 0; if (nearbyActiveTiles < 400) - damageIncrease += (400 - nearbyActiveTiles) / 20; // Ranges from 0 to 20 + damageIncrease += (400 - nearbyActiveTiles) / 40; // Ranges from 0 to 10 npc.damage = npc.defDamage + damageIncrease * 4; @@ -3615,7 +3618,7 @@ namespace CalamityMod.NPCs vector104.X += num942 * 5f; vector104.Y += num943 * 5f; int num947 = Projectile.NewProjectile(vector104.X, vector104.Y, num942, num943, num946, damage, 0f, Main.myPlayer, tileEnrageMult, 0f); - Main.projectile[num947].timeLeft = 300; + Main.projectile[num947].timeLeft = baseProjectileTimeLeft / 2; npc.netUpdate = true; } @@ -3626,7 +3629,8 @@ namespace CalamityMod.NPCs for (int i = 0; i < 12; i++) { float ai1 = player.ZoneDungeon ? 0f : 1f; - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, 0f, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, i * 30, ai1); + int proj = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, 0f, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, i * 30, ai1); + Main.projectile[proj].timeLeft = baseProjectileTimeLeft; } } else @@ -3641,7 +3645,8 @@ namespace CalamityMod.NPCs for (i = 0; i < 4; i++) { offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, (float)(Math.Sin(offsetAngle) * 3f), (float)(Math.Cos(offsetAngle) * 3f), ModContent.ProjectileType(), damage, 0f, Main.myPlayer, passedVar, 0f); + int proj = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, (float)(Math.Sin(offsetAngle) * 3f), (float)(Math.Cos(offsetAngle) * 3f), ModContent.ProjectileType(), damage, 0f, Main.myPlayer, passedVar, 0f); + Main.projectile[proj].timeLeft = baseProjectileTimeLeft; passedVar += 1f; } } diff --git a/NPCs/CalamityGlobalAI.cs b/NPCs/CalamityGlobalAI.cs index 97ff6db526..29210e7108 100644 --- a/NPCs/CalamityGlobalAI.cs +++ b/NPCs/CalamityGlobalAI.cs @@ -8695,7 +8695,7 @@ namespace CalamityMod.NPCs float radians = MathHelper.TwoPi / totalTentacles; for (int i = 0; i < totalTentacles; i++) { - Vector2 vector255 = new Vector2(0f, -60f * totalTentacles).RotatedBy(radians * i); + Vector2 vector255 = new Vector2(0f, -65f * totalTentacles).RotatedBy(radians * i); NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasTentacle, npc.whoAmI, vector255.X, vector255.Y, 1f, 0f, 255); } } @@ -8821,7 +8821,7 @@ namespace CalamityMod.NPCs float radians = MathHelper.TwoPi / totalTentacles; for (int i = 0; i < totalTentacles; i++) { - Vector2 vector255 = new Vector2(0f, -60f * totalTentacles).RotatedBy(radians * i); + Vector2 vector255 = new Vector2(0f, -65f * totalTentacles).RotatedBy(radians * i); NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasTentacle, npc.whoAmI, vector255.X, vector255.Y, 2f, 0f, 255); } } @@ -10160,7 +10160,7 @@ namespace CalamityMod.NPCs if (!Collision.CanHit(Main.npc[NPC.golemBoss].Center, 1, 1, Main.player[npc.target].Center, 1, 1)) npc.ai[2] += 8f; - if (npc.ai[2] >= 150f && Vector2.Distance(Main.player[npc.target].Center, npc.Center) > 160f) + if (npc.ai[2] >= 240f && Vector2.Distance(Main.player[npc.target].Center, npc.Center) > 160f) { npc.ai[2] = 0f; diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 5bd2a8dca7..2a361ea638 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -149,6 +149,7 @@ namespace CalamityMod.NPCs public int kamiFlu = 0; public int relicOfResilienceCooldown = 0; public int relicOfResilienceWeakness = 0; + public int GaussFluxTimer = 0; // whoAmI Variables public static int[] bobbitWormBottom = new int[5]; @@ -470,6 +471,33 @@ namespace CalamityMod.NPCs ResetSavedIndex(ref SCalCatastrophe, NPCType()); ResetSavedIndex(ref SCal, NPCType()); ResetSavedIndex(ref SCalWorm, NPCType()); + + if (NPC.FindFirstNPC(NPCID.Guide) == -1) + CalamityWorld.guideName = false; + if (NPC.FindFirstNPC(NPCID.Wizard) == -1) + CalamityWorld.wizardName = false; + if (NPC.FindFirstNPC(NPCID.Steampunker) == -1) + CalamityWorld.steampunkerName = false; + if (NPC.FindFirstNPC(NPCID.Stylist) == -1) + CalamityWorld.stylistName = false; + if (NPC.FindFirstNPC(NPCID.WitchDoctor) == -1) + CalamityWorld.witchDoctorName = false; + if (NPC.FindFirstNPC(NPCID.TaxCollector) == -1) + CalamityWorld.taxCollectorName = false; + if (NPC.FindFirstNPC(NPCID.Pirate) == -1) + CalamityWorld.pirateName = false; + if (NPC.FindFirstNPC(NPCID.Mechanic) == -1) + CalamityWorld.mechanicName = false; + if (NPC.FindFirstNPC(NPCID.ArmsDealer) == -1) + CalamityWorld.armsDealerName = false; + if (NPC.FindFirstNPC(NPCID.Dryad) == -1) + CalamityWorld.dryadName = false; + if (NPC.FindFirstNPC(NPCID.Nurse) == -1) + CalamityWorld.nurseName = false; + if (NPC.FindFirstNPC(NPCID.Angler) == -1) + CalamityWorld.anglerName = false; + if (NPC.FindFirstNPC(NPCID.Clothier) == -1) + CalamityWorld.clothierName = false; } #endregion @@ -2452,205 +2480,266 @@ namespace CalamityMod.NPCs switch (npc.type) { case NPCID.Guide: + if (CalamityWorld.guideName) + break; switch (Main.rand.Next(38)) // 34 guide names { case 0: npc.GivenName = "Lapp"; + CalamityWorld.guideName = true; break; case 1: npc.GivenName = "Ben Shapiro"; + CalamityWorld.guideName = true; break; case 2: npc.GivenName = "StreakistYT"; + CalamityWorld.guideName = true; break; case 3: npc.GivenName = "Neoplasmatic"; + CalamityWorld.guideName = true; break; default: + CalamityWorld.guideName = true; break; } break; case NPCID.Wizard: + if (CalamityWorld.wizardName) + break; switch (Main.rand.Next(26)) // 23 wizard names { case 0: npc.GivenName = "Mage One-Trick"; + CalamityWorld.wizardName = true; break; case 1: npc.GivenName = "Inorim, son of Ivukey"; + CalamityWorld.wizardName = true; break; case 2: npc.GivenName = "Jensen"; + CalamityWorld.wizardName = true; break; default: + CalamityWorld.wizardName = true; break; } break; case NPCID.Steampunker: + if (CalamityWorld.steampunkerName) + break; switch (Main.rand.Next(23)) // 21 steampunker names { case 0: npc.GivenName = "Vorbis"; + CalamityWorld.steampunkerName = true; break; case 1: npc.GivenName = "Angel"; + CalamityWorld.steampunkerName = true; break; default: + CalamityWorld.steampunkerName = true; break; } break; case NPCID.Stylist: + if (CalamityWorld.stylistName) + break; switch (Main.rand.Next(21)) // 20 stylist names { case 0: npc.GivenName = "Amber"; + CalamityWorld.stylistName = true; break; default: + CalamityWorld.stylistName = true; break; } break; case NPCID.WitchDoctor: + if (CalamityWorld.witchDoctorName) + break; switch (Main.rand.Next(11)) // 10 witch doctor names { case 0: npc.GivenName = "Sok'ar"; + CalamityWorld.witchDoctorName = true; break; default: + CalamityWorld.witchDoctorName = true; break; } break; case NPCID.TaxCollector: + if (CalamityWorld.taxCollectorName) + break; switch (Main.rand.Next(21)) // 20 tax collector names { case 0: npc.GivenName = "Emmett"; + CalamityWorld.taxCollectorName = true; break; default: + CalamityWorld.taxCollectorName = true; break; } break; case NPCID.Pirate: + if (CalamityWorld.pirateName) + break; switch (Main.rand.Next(12)) // 11 pirate names { case 0: npc.GivenName = "Tyler Van Hook"; + CalamityWorld.pirateName = true; break; default: + CalamityWorld.pirateName = true; break; } break; case NPCID.Mechanic: + if (CalamityWorld.mechanicName) + break; switch (Main.rand.Next(26)) // 24 mechanic names { case 0: npc.GivenName = "Lilly"; + CalamityWorld.mechanicName = true; break; case 1: npc.GivenName = "Daawn"; + CalamityWorld.mechanicName = true; break; default: + CalamityWorld.mechanicName = true; break; } break; case NPCID.ArmsDealer: + if (CalamityWorld.armsDealerName) + break; switch (Main.rand.Next(26)) // 24 arms dealer names { case 0: npc.GivenName = "Drifter"; + CalamityWorld.armsDealerName = true; break; case 1: npc.GivenName = "Finchi"; + CalamityWorld.armsDealerName = true; break; default: + CalamityWorld.armsDealerName = true; break; } break; case NPCID.Dryad: + if (CalamityWorld.dryadName) + break; switch (Main.rand.Next(23)) // 21 Dryad names { case 0: npc.GivenName = "Rythmi"; + CalamityWorld.dryadName = true; break; case 1: - npc.GivenName = "Izuna"; + npc.GivenName = "Izuna"; + CalamityWorld.dryadName = true; break; default: + CalamityWorld.dryadName = true; break; } break; case NPCID.Nurse: + if (CalamityWorld.nurseName) + break; switch (Main.rand.Next(25)) // 24 nurse names { case 0: npc.GivenName = "Farsni"; + CalamityWorld.nurseName = true; break; default: + CalamityWorld.nurseName = true; break; } break; case NPCID.Angler: + if (CalamityWorld.anglerName) + break; switch (Main.rand.Next(23)) // 22 angler names { case 0: npc.GivenName = "Dazren"; + CalamityWorld.anglerName = true; break; default: + CalamityWorld.anglerName = true; break; } break; case NPCID.Clothier: + if (CalamityWorld.clothierName) + break; switch (Main.rand.Next(26)) // 25 clothier names { case 0: npc.GivenName = "Joeseph Jostar"; + CalamityWorld.clothierName = true; break; default: + CalamityWorld.clothierName = true; break; } @@ -3012,7 +3101,7 @@ namespace CalamityMod.NPCs case 33: if (npc.type != NPCType() && npc.type != NPCType() && npc.type != NPCType() && npc.type != NPCType() && - npc.type != NPCType()) + npc.type != NPCType() && npc.type != NPCID.DetonatingBubble) { npc.active = false; npc.netUpdate = true; @@ -3198,6 +3287,8 @@ namespace CalamityMod.NPCs relicOfResilienceCooldown--; if (relicOfResilienceWeakness > 0) relicOfResilienceWeakness--; + if (GaussFluxTimer > 0) + GaussFluxTimer--; if (ladHearts > 0) ladHearts--; @@ -3888,28 +3979,13 @@ namespace CalamityMod.NPCs if (Main.rand.NextBool(maxValue) && Main.wallDungeon[Main.tile[(int)npc.Center.X / 16, (int)npc.Center.Y / 16].wall]) { - int randomType = Main.rand.Next(4); - switch (randomType) - { - case 0: - randomType = NPCType(); - break; - - case 1: - randomType = NPCType(); - break; - - case 2: - randomType = NPCType(); - break; - - case 3: - randomType = NPCType(); - break; - - default: - break; - } + int randomType = Utils.SelectRandom(Main.rand, new int[] + { + NPCType(), + NPCType(), + NPCType(), + NPCType() + }); NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, randomType, 0, 0f, 0f, 0f, 0f, 255); } @@ -3931,25 +4007,22 @@ namespace CalamityMod.NPCs { if (Main.netMode != NetmodeID.MultiplayerClient) { - int num261 = Main.rand.Next(2) + 2; - int num; - for (int num262 = 0; num262 < num261; num262 = num + 1) + int slimeAmt = Main.rand.Next(2) + 2; //2 to 3 extra + for (int s = 0; s < slimeAmt; s++) { - int num263 = NPC.NewNPC((int)(npc.position.X + npc.width / 2), (int)(npc.position.Y + npc.height), 1, 0, 0f, 0f, 0f, 0f, 255); - NPC npc2 = Main.npc[num263]; - npc2.SetDefaults(-5, -1f); + int slime = NPC.NewNPC((int)npc.Center.X, (int)(npc.position.Y + npc.height), NPCID.BlueSlime, 0, 0f, 0f, 0f, 0f, 255); + NPC npc2 = Main.npc[slime]; + npc2.SetDefaults(NPCID.BabySlime); npc2.velocity.X = npc.velocity.X * 2f; npc2.velocity.Y = npc.velocity.Y; - npc2.velocity.X += Main.rand.Next(-20, 20) * 0.1f + num262 * npc.direction * 0.3f; - npc2.velocity.Y -= Main.rand.Next(0, 10) * 0.1f + num262; + npc2.velocity.X += Main.rand.Next(-20, 20) * 0.1f + s * npc.direction * 0.3f; + npc2.velocity.Y -= Main.rand.Next(0, 10) * 0.1f + s; npc2.ai[0] = -1000 * Main.rand.Next(3); - if (Main.netMode == NetmodeID.Server && num263 < 200) + if (Main.netMode == NetmodeID.Server && slime < Main.maxNPCs) { - NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num263, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, slime, 0f, 0f, 0f, 0, 0, 0); } - - num = num262; } } } @@ -4166,6 +4239,13 @@ namespace CalamityMod.NPCs pool[NPCID.BlueJellyfish] = SpawnCondition.CaveJellyfish.Chance; } + // Add Truffle Worm spawns to surface mushroom biome + if (spawnInfo.player.ZoneGlowshroom && Main.hardMode && (spawnInfo.player.ZoneOverworldHeight || spawnInfo.player.ZoneSkyHeight)) + { + if (NPC.CountNPCS(NPCID.TruffleWorm) < 2) + pool[NPCID.TruffleWorm] = SpawnCondition.OverworldMushroom.Chance * 0.5f; + } + if (spawnInfo.player.Calamity().ZoneAbyss || spawnInfo.player.Calamity().ZoneCalamity || spawnInfo.player.Calamity().ZoneSulphur || @@ -4445,7 +4525,6 @@ namespace CalamityMod.NPCs dust.alpha = 200; dust.velocity.Y -= 0.2f; dust.velocity *= 1.2f; - dust = Main.dust[num4]; dust.scale += Main.rand.NextFloat(); } } @@ -4547,10 +4626,8 @@ namespace CalamityMod.NPCs { if (Main.rand.NextBool(5)) { - Vector2 vector2_2 = new Vector2((float)Main.rand.Next(-10, 11), (float)Main.rand.Next(-10, 11)); - vector2_2.Normalize(); - vector2_2.X *= 0.66f; - int heart = Gore.NewGore(npc.position + new Vector2((float)Main.rand.Next(npc.width + 1), (float)Main.rand.Next(npc.height + 1)), vector2_2 * (float)Main.rand.Next(3, 6) * 0.33f, 331, (float)Main.rand.Next(40, 121) * 0.01f); + Vector2 velocity = CalamityUtils.RandomVelocity(10f, 1f, 1f, 0.66f); + int heart = Gore.NewGore(npc.position + new Vector2(Main.rand.Next(npc.width + 1), Main.rand.Next(npc.height + 1)), velocity * Main.rand.Next(3, 6) * 0.33f, 331, Main.rand.Next(40, 121) * 0.01f); Main.gore[heart].sticky = false; Main.gore[heart].velocity *= 0.4f; Main.gore[heart].velocity.Y -= 0.6f; @@ -5662,10 +5739,46 @@ namespace CalamityMod.NPCs break; } } - #endregion + #endregion - #region Shop Stuff - public override void SetupShop(int type, Chest shop, ref int nextSlot) + #region Buff Town NPC + public override void BuffTownNPC(ref float damageMult, ref int defense) + { + if (NPC.downedMoonlord) + { + damageMult += 0.6f; + defense += 20; + } + if (CalamityWorld.downedProvidence) + { + damageMult += 0.2f; + defense += 12; + } + if (CalamityWorld.downedPolterghast) + { + damageMult += 0.2f; + defense += 12; + } + if (CalamityWorld.downedDoG) + { + damageMult += 0.2f; + defense += 12; + } + if (CalamityWorld.downedYharon) + { + damageMult += 0.2f; + defense += 12; + } + if (CalamityWorld.downedSCal) + { + damageMult += 0.6f; + defense += 20; + } + } + #endregion + + #region Shop Stuff + public override void SetupShop(int type, Chest shop, ref int nextSlot) { if (type == NPCID.Merchant) { @@ -6142,7 +6255,7 @@ namespace CalamityMod.NPCs } int players = 0; - for (int i = 0; i < 255; i++) + for (int i = 0; i < Main.maxPlayers; i++) { if (Main.player[i] != null && Main.player[i].active) { @@ -6188,14 +6301,14 @@ namespace CalamityMod.NPCs { if (plr == Main.myPlayer && projectile.ai[0] == 0f) { - for (int num13 = 0; num13 < Main.maxInventory; num13++) + for (int item = 0; item < Main.maxInventory; item++) { - if (player.inventory[num13].type == baitType) + if (player.inventory[item].type == baitType) { - player.inventory[num13].stack--; - if (player.inventory[num13].stack <= 0) + player.inventory[item].stack--; + if (player.inventory[item].stack <= 0) { - player.inventory[num13].SetDefaults(0, false); + player.inventory[item].SetDefaults(0, false); } break; } @@ -6206,8 +6319,8 @@ namespace CalamityMod.NPCs if (Main.netMode != NetmodeID.MultiplayerClient) { - int num8 = NPC.NewNPC((int)projectile.Center.X, (int)projectile.Center.Y + 100, type); - CalamityUtils.BossAwakenMessage(num8); + int boss = NPC.NewNPC((int)projectile.Center.X, (int)projectile.Center.Y + 100, type); + CalamityUtils.BossAwakenMessage(boss); } else { diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index 846816df4b..21628206d0 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -407,91 +407,109 @@ namespace CalamityMod.NPCs { CalamityWorld.bossRushStage = 7; CalamityUtils.KillAllHostileProjectiles(); + CalamityWorld.bossRushHostileProjKillCounter = 3; } else if (npc.type == ModContent.NPCType()) { CalamityWorld.bossRushStage = 9; CalamityUtils.KillAllHostileProjectiles(); + CalamityWorld.bossRushHostileProjKillCounter = 3; } else if (npc.type == ModContent.NPCType()) { CalamityWorld.bossRushStage = 12; CalamityUtils.KillAllHostileProjectiles(); + CalamityWorld.bossRushHostileProjKillCounter = 3; } else if (npc.type == ModContent.NPCType()) { CalamityWorld.bossRushStage = 14; CalamityUtils.KillAllHostileProjectiles(); + CalamityWorld.bossRushHostileProjKillCounter = 3; } else if (npc.type == ModContent.NPCType()) { CalamityWorld.bossRushStage = 16; CalamityUtils.KillAllHostileProjectiles(); + CalamityWorld.bossRushHostileProjKillCounter = 3; } else if (npc.type == ModContent.NPCType()) { CalamityWorld.bossRushStage = 17; CalamityUtils.KillAllHostileProjectiles(); + CalamityWorld.bossRushHostileProjKillCounter = 3; } else if (npc.type == ModContent.NPCType()) { CalamityWorld.bossRushStage = 18; CalamityUtils.KillAllHostileProjectiles(); + CalamityWorld.bossRushHostileProjKillCounter = 3; } else if (npc.type == ModContent.NPCType()) { CalamityWorld.bossRushStage = 20; CalamityUtils.KillAllHostileProjectiles(); + CalamityWorld.bossRushHostileProjKillCounter = 3; } else if (npc.type == ModContent.NPCType()) { CalamityWorld.bossRushStage = 22; CalamityUtils.KillAllHostileProjectiles(); + CalamityWorld.bossRushHostileProjKillCounter = 3; } else if (npc.type == ModContent.NPCType()) { CalamityWorld.bossRushStage = 23; CalamityUtils.KillAllHostileProjectiles(); + CalamityWorld.bossRushHostileProjKillCounter = 3; } else if (npc.type == ModContent.NPCType()) { CalamityWorld.bossRushStage = 24; CalamityUtils.KillAllHostileProjectiles(); + CalamityWorld.bossRushHostileProjKillCounter = 3; } else if (npc.type == ModContent.NPCType()) { CalamityWorld.bossRushStage = 25; CalamityUtils.KillAllHostileProjectiles(); + CalamityWorld.bossRushHostileProjKillCounter = 3; } else if (npc.type == ModContent.NPCType()) { CalamityWorld.bossRushStage = 26; CalamityUtils.KillAllHostileProjectiles(); + CalamityWorld.bossRushHostileProjKillCounter = 3; } else if (npc.type == ModContent.NPCType()) { CalamityWorld.bossRushStage = 27; CalamityUtils.KillAllHostileProjectiles(); + CalamityWorld.bossRushHostileProjKillCounter = 3; } else if (npc.type == ModContent.NPCType()) { CalamityWorld.bossRushStage = 30; CalamityUtils.KillAllHostileProjectiles(); + CalamityWorld.bossRushHostileProjKillCounter = 3; } else if (npc.type == ModContent.NPCType()) { CalamityWorld.bossRushStage = 31; CalamityUtils.KillAllHostileProjectiles(); + CalamityWorld.bossRushHostileProjKillCounter = 3; } else if (npc.type == ModContent.NPCType()) { CalamityWorld.bossRushStage = 32; CalamityUtils.KillAllHostileProjectiles(); + CalamityWorld.bossRushHostileProjKillCounter = 3; } else if (npc.type == ModContent.NPCType()) { CalamityWorld.bossRushStage = 33; CalamityUtils.KillAllHostileProjectiles(); + CalamityWorld.bossRushHostileProjKillCounter = 3; } else if (npc.type == ModContent.NPCType() || npc.type == ModContent.NPCType()) { @@ -500,12 +518,14 @@ namespace CalamityMod.NPCs { CalamityWorld.bossRushStage = 34; CalamityUtils.KillAllHostileProjectiles(); + CalamityWorld.bossRushHostileProjKillCounter = 3; } } else if (npc.type == ModContent.NPCType()) { CalamityWorld.bossRushStage = 35; CalamityUtils.KillAllHostileProjectiles(); + CalamityWorld.bossRushHostileProjKillCounter = 3; } else if (npc.type == ModContent.NPCType() || npc.type == ModContent.NPCType() || npc.type == ModContent.NPCType()) { @@ -514,24 +534,28 @@ namespace CalamityMod.NPCs { CalamityWorld.bossRushStage = 36; CalamityUtils.KillAllHostileProjectiles(); + CalamityWorld.bossRushHostileProjKillCounter = 3; } else if (npc.type == ModContent.NPCType() && !NPC.AnyNPCs(ModContent.NPCType()) && !NPC.AnyNPCs(ModContent.NPCType()) && NPC.CountNPCS(ModContent.NPCType()) < 2 && !NPC.AnyNPCs(ModContent.NPCType())) { CalamityWorld.bossRushStage = 36; CalamityUtils.KillAllHostileProjectiles(); + CalamityWorld.bossRushHostileProjKillCounter = 3; } else if (npc.type == ModContent.NPCType() && !NPC.AnyNPCs(ModContent.NPCType()) && !NPC.AnyNPCs(ModContent.NPCType()) && NPC.CountNPCS(ModContent.NPCType()) < 2 && !NPC.AnyNPCs(ModContent.NPCType())) { CalamityWorld.bossRushStage = 36; CalamityUtils.KillAllHostileProjectiles(); + CalamityWorld.bossRushHostileProjKillCounter = 3; } } else if (npc.type == ModContent.NPCType()) { CalamityWorld.bossRushStage = 37; CalamityUtils.KillAllHostileProjectiles(); + CalamityWorld.bossRushHostileProjKillCounter = 3; string key = "Mods.CalamityMod.BossRushTierFourEndText"; Color messageColor = Color.LightCoral; @@ -548,17 +572,20 @@ namespace CalamityMod.NPCs { CalamityWorld.bossRushStage = 38; CalamityUtils.KillAllHostileProjectiles(); + CalamityWorld.bossRushHostileProjKillCounter = 3; } else if (npc.type == ModContent.NPCType()) { CalamityWorld.bossRushStage = 39; CalamityUtils.KillAllHostileProjectiles(); + CalamityWorld.bossRushHostileProjKillCounter = 3; } else if (npc.type == ModContent.NPCType()) { DropHelper.DropItem(npc, ModContent.ItemType(), true); CalamityWorld.bossRushStage = 0; CalamityUtils.KillAllHostileProjectiles(); + CalamityWorld.bossRushHostileProjKillCounter = 3; CalamityWorld.bossRushActive = false; CalamityMod.UpdateServerBoolean(); @@ -589,31 +616,37 @@ namespace CalamityMod.NPCs case NPCID.QueenBee: CalamityWorld.bossRushStage = 1; CalamityUtils.KillAllHostileProjectiles(); + CalamityWorld.bossRushHostileProjKillCounter = 3; break; case NPCID.BrainofCthulhu: CalamityWorld.bossRushStage = 2; CalamityUtils.KillAllHostileProjectiles(); + CalamityWorld.bossRushHostileProjKillCounter = 3; break; case NPCID.KingSlime: CalamityWorld.bossRushStage = 3; CalamityUtils.KillAllHostileProjectiles(); + CalamityWorld.bossRushHostileProjKillCounter = 3; break; case NPCID.EyeofCthulhu: CalamityWorld.bossRushStage = 4; CalamityUtils.KillAllHostileProjectiles(); + CalamityWorld.bossRushHostileProjKillCounter = 3; break; case NPCID.SkeletronPrime: CalamityWorld.bossRushStage = 5; CalamityUtils.KillAllHostileProjectiles(); + CalamityWorld.bossRushHostileProjKillCounter = 3; break; case NPCID.Golem: CalamityWorld.bossRushStage = 6; CalamityUtils.KillAllHostileProjectiles(); + CalamityWorld.bossRushHostileProjKillCounter = 3; break; case NPCID.EaterofWorldsHead: @@ -621,11 +654,13 @@ namespace CalamityMod.NPCs case NPCID.EaterofWorldsTail: CalamityWorld.bossRushStage = 8; CalamityUtils.KillAllHostileProjectiles(); + CalamityWorld.bossRushHostileProjKillCounter = 3; break; case NPCID.TheDestroyer: CalamityWorld.bossRushStage = 10; CalamityUtils.KillAllHostileProjectiles(); + CalamityWorld.bossRushHostileProjKillCounter = 3; string key = "Mods.CalamityMod.BossRushTierOneEndText"; Color messageColor = Color.LightCoral; @@ -643,26 +678,31 @@ namespace CalamityMod.NPCs case NPCID.Spazmatism: CalamityWorld.bossRushStage = 11; CalamityUtils.KillAllHostileProjectiles(); + CalamityWorld.bossRushHostileProjKillCounter = 3; break; case NPCID.Retinazer: CalamityWorld.bossRushStage = 11; CalamityUtils.KillAllHostileProjectiles(); + CalamityWorld.bossRushHostileProjKillCounter = 3; break; case NPCID.WallofFlesh: CalamityWorld.bossRushStage = 13; CalamityUtils.KillAllHostileProjectiles(); + CalamityWorld.bossRushHostileProjKillCounter = 3; break; case NPCID.SkeletronHead: CalamityWorld.bossRushStage = 15; CalamityUtils.KillAllHostileProjectiles(); + CalamityWorld.bossRushHostileProjKillCounter = 3; break; case NPCID.CultistBoss: CalamityWorld.bossRushStage = 19; CalamityUtils.KillAllHostileProjectiles(); + CalamityWorld.bossRushHostileProjKillCounter = 3; string key2 = "Mods.CalamityMod.BossRushTierTwoEndText"; Color messageColor2 = Color.LightCoral; @@ -680,11 +720,13 @@ namespace CalamityMod.NPCs case NPCID.Plantera: CalamityWorld.bossRushStage = 21; CalamityUtils.KillAllHostileProjectiles(); + CalamityWorld.bossRushHostileProjKillCounter = 3; break; case NPCID.DukeFishron: CalamityWorld.bossRushStage = 28; CalamityUtils.KillAllHostileProjectiles(); + CalamityWorld.bossRushHostileProjKillCounter = 3; string key3 = "Mods.CalamityMod.BossRushTierThreeEndText"; Color messageColor3 = Color.LightCoral; @@ -702,6 +744,7 @@ namespace CalamityMod.NPCs case NPCID.MoonLordCore: CalamityWorld.bossRushStage = 29; CalamityUtils.KillAllHostileProjectiles(); + CalamityWorld.bossRushHostileProjKillCounter = 3; break; default: @@ -714,6 +757,10 @@ namespace CalamityMod.NPCs netMessage.Write((byte)CalamityModMessageType.BossRushStage); netMessage.Write(CalamityWorld.bossRushStage); netMessage.Send(); + var netMessage2 = mod.GetPacket(); + netMessage2.Write((byte)CalamityModMessageType.BRHostileProjKillSync); + netMessage2.Write(CalamityWorld.bossRushHostileProjKillCounter); + netMessage2.Send(); } return false; @@ -1323,7 +1370,7 @@ namespace CalamityMod.NPCs // Blood Orb drops: Valid enemy during a blood moon on the Surface if (!npc.SpawnedFromStatue && (npc.damage > 5 || npc.boss) && Main.bloodMoon && npc.HasPlayerTarget && npc.position.Y / 16D < Main.worldSurface) { - if (Main.player[Player.FindClosest(npc.position, npc.width, npc.height)].Calamity().bloodflareSet) + if (Main.player[Player.FindClosest(npc.Center, npc.width, npc.height)].Calamity().bloodflareSet) { DropHelper.DropItemChance(npc, ModContent.ItemType(), 2); // 50% chance of 1 orb with Bloodflare } diff --git a/NPCs/Leviathan/Leviathan.cs b/NPCs/Leviathan/Leviathan.cs index f8e6cbef7e..3922b8cd9f 100644 --- a/NPCs/Leviathan/Leviathan.cs +++ b/NPCs/Leviathan/Leviathan.cs @@ -128,7 +128,7 @@ namespace CalamityMod.NPCs.Leviathan // Phases bool phase2 = (lifeRatio < 0.7f && expertMode) || death; bool phase3 = lifeRatio < 0.4f; - bool phase4 = lifeRatio < 0.1f; + bool phase4 = lifeRatio < 0.2f; npc.spriteDirection = (npc.direction > 0) ? 1 : -1; diff --git a/NPCs/Leviathan/LeviathanStart.cs b/NPCs/Leviathan/LeviathanStart.cs index b083d0b277..8fa2732d97 100644 --- a/NPCs/Leviathan/LeviathanStart.cs +++ b/NPCs/Leviathan/LeviathanStart.cs @@ -2,6 +2,7 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Accessories; using CalamityMod.World; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using System.IO; using Terraria; using Terraria.ID; @@ -82,7 +83,28 @@ namespace CalamityMod.NPCs.Leviathan npc.active = false; } - public override float SpawnChance(NPCSpawnInfo spawnInfo) + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + SpriteEffects spriteEffects = SpriteEffects.None; + if (npc.spriteDirection == 1) + spriteEffects = SpriteEffects.FlipHorizontally; + + Texture2D texture2D15 = Main.npcTexture[npc.type]; + Vector2 vector11 = new Vector2(Main.npcTexture[npc.type].Width / 2, Main.npcTexture[npc.type].Height / 2); + + Vector2 vector43 = npc.Center - Main.screenPosition; + vector43 -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[npc.type]) * npc.scale / 2f; + vector43 += vector11 * npc.scale + new Vector2(0f, 4f + npc.gfxOffY); + spriteBatch.Draw(texture2D15, vector43, npc.frame, npc.GetAlpha(lightColor), npc.rotation, vector11, npc.scale, spriteEffects, 0f); + + texture2D15 = ModContent.GetTexture("CalamityMod/NPCs/Leviathan/LeviathanStartGlow"); + + spriteBatch.Draw(texture2D15, vector43, npc.frame, Color.White, npc.rotation, vector11, npc.scale, spriteEffects, 0f); + + return false; + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) { if (spawnInfo.playerSafe || NPC.AnyNPCs(NPCID.DukeFishron) || diff --git a/NPCs/Leviathan/Siren.cs b/NPCs/Leviathan/Siren.cs index 4f2cebfad0..8bc68e7645 100644 --- a/NPCs/Leviathan/Siren.cs +++ b/NPCs/Leviathan/Siren.cs @@ -141,7 +141,7 @@ namespace CalamityMod.NPCs.Leviathan // Phases bool phase2 = lifeRatio < 0.7f; bool phase3 = lifeRatio < 0.4f; - bool phase4 = lifeRatio < 0.1f; + bool phase4 = lifeRatio < 0.2f; // Spawn Leviathan and Clones, change music if (Main.netMode != NetmodeID.MultiplayerClient) diff --git a/NPCs/NormalNPCs/EbonianBlightSlime.cs b/NPCs/NormalNPCs/EbonianBlightSlime.cs index ef34eb3210..60c5b8402d 100644 --- a/NPCs/NormalNPCs/EbonianBlightSlime.cs +++ b/NPCs/NormalNPCs/EbonianBlightSlime.cs @@ -69,7 +69,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { - DropHelper.DropItem(npc, ModContent.ItemType(), 15, 16); + DropHelper.DropItem(npc, ModContent.ItemType(), 15, 20); DropHelper.DropItem(npc, ItemID.Gel, 10, 14); } } diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index 08b830ed59..801ea6bccd 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -1240,10 +1240,8 @@ namespace CalamityMod.NPCs.Providence if (projectile.active) { if (projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType()) - { projectile.Kill(); - } - else if (projectile.type == ModContent.ProjectileType()) + else if (projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType()) projectile.active = false; } } diff --git a/NPCs/Ravager/RavagerBody.cs b/NPCs/Ravager/RavagerBody.cs index 0b96fbe8b6..66217e8871 100644 --- a/NPCs/Ravager/RavagerBody.cs +++ b/NPCs/Ravager/RavagerBody.cs @@ -95,14 +95,12 @@ namespace CalamityMod.NPCs.Ravager public override void SendExtraAI(BinaryWriter writer) { writer.Write(npc.dontTakeDamage); - writer.Write(npc.noGravity); writer.Write(velocityY); } public override void ReceiveExtraAI(BinaryReader reader) { npc.dontTakeDamage = reader.ReadBoolean(); - npc.noGravity = reader.ReadBoolean(); velocityY = reader.ReadSingle(); } @@ -137,11 +135,11 @@ namespace CalamityMod.NPCs.Ravager if (npc.localAI[0] == 0f && Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[0] = 1f; - NPC.NewNPC((int)npc.Center.X - 70, (int)npc.Center.Y + 88, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); - NPC.NewNPC((int)npc.Center.X + 70, (int)npc.Center.Y + 88, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); - NPC.NewNPC((int)npc.Center.X - 120, (int)npc.Center.Y + 50, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); - NPC.NewNPC((int)npc.Center.X + 120, (int)npc.Center.Y + 50, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); - NPC.NewNPC((int)npc.Center.X + 1, (int)npc.Center.Y - 20, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); + NPC.NewNPC((int)npc.Center.X - 70, (int)npc.Center.Y + 88, ModContent.NPCType()); + NPC.NewNPC((int)npc.Center.X + 70, (int)npc.Center.Y + 88, ModContent.NPCType()); + NPC.NewNPC((int)npc.Center.X - 120, (int)npc.Center.Y + 50, ModContent.NPCType()); + NPC.NewNPC((int)npc.Center.X + 120, (int)npc.Center.Y + 50, ModContent.NPCType()); + NPC.NewNPC((int)npc.Center.X + 1, (int)npc.Center.Y - 20, ModContent.NPCType()); } if (npc.target >= 0 && Main.player[npc.target].dead) @@ -519,13 +517,13 @@ namespace CalamityMod.NPCs.Ravager if (!NPC.AnyNPCs(ModContent.NPCType())) { - NPC.NewNPC((int)npc.Center.X - spawnDistance, (int)npc.Center.Y - 10, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); - NPC.NewNPC((int)npc.Center.X + spawnDistance, (int)npc.Center.Y - 10, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); + NPC.NewNPC((int)npc.Center.X - spawnDistance, (int)npc.Center.Y - 10, ModContent.NPCType()); + NPC.NewNPC((int)npc.Center.X + spawnDistance, (int)npc.Center.Y - 10, ModContent.NPCType()); } else if (!NPC.AnyNPCs(ModContent.NPCType())) { - NPC.NewNPC((int)npc.Center.X - spawnDistance * 2, (int)npc.Center.Y - 10, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); - NPC.NewNPC((int)npc.Center.X + spawnDistance * 2, (int)npc.Center.Y - 10, ModContent.NPCType(), 0, 0f, 0f, 0f, 0f, 255); + NPC.NewNPC((int)npc.Center.X - spawnDistance * 2, (int)npc.Center.Y - 10, ModContent.NPCType()); + NPC.NewNPC((int)npc.Center.X + spawnDistance * 2, (int)npc.Center.Y - 10, ModContent.NPCType()); } } } @@ -534,6 +532,7 @@ namespace CalamityMod.NPCs.Ravager npc.Calamity().newAI[0] += 1f; npc.Calamity().newAI[1] = 0f; + npc.Calamity().newAI[3] = 0f; for (int stompDustArea = (int)npc.position.X - 30; stompDustArea < (int)npc.position.X + npc.width + 60; stompDustArea += 30) { @@ -560,22 +559,26 @@ namespace CalamityMod.NPCs.Ravager npc.noTileCollide = false; } - float amount = death ? 1f : 1f - lifeRatio; Vector2 targetVector = player.position; - float aimY = targetVector.Y - 320f; + float aimY = targetVector.Y - 480f; + float distanceFromTargetPos = Math.Abs(npc.Top.Y - aimY); + bool inRange = npc.Top.Y <= aimY + 16f && npc.Top.Y >= aimY - 16f; if (npc.ai[0] == 2f && npc.ai[1] == 0f) { - if (npc.Top.Y > aimY) - { - if (npc.velocity.Y > 0f) - npc.velocity.Y -= 0.5f + Math.Abs(npc.Top.Y - aimY) * 0.001f; - } + npc.Calamity().newAI[3] += 1f; + + if (inRange) + npc.velocity.Y = 0f; + else if (npc.Top.Y > aimY) + npc.velocity.Y -= 0.2f + distanceFromTargetPos * 0.001f; else - { - if (npc.velocity.Y < 0f) - npc.velocity.Y += 0.5f + Math.Abs(npc.Top.Y - aimY) * 0.001f; - } + npc.velocity.Y += 0.2f + distanceFromTargetPos * 0.001f; + + if (npc.velocity.Y < velocityY) + npc.velocity.Y = velocityY; + if (npc.velocity.Y > -velocityY) + npc.velocity.Y = -velocityY; } float maxOffset = 160f + (death ? 160f : 160f * (1f - lifeRatio)); @@ -584,14 +587,16 @@ namespace CalamityMod.NPCs.Ravager // Set offset to 0 if the target stops moving if (Math.Abs(player.velocity.X) < 0.5f) npc.Calamity().newAI[2] = 0f; + else + npc.Calamity().newAI[2] = player.direction; - if ((npc.position.X < targetVector.X + offset && npc.position.X + npc.width > targetVector.X + player.width + offset && (npc.Top.Y <= aimY || npc.ai[0] != 2f)) || npc.ai[1] > 0f) + if ((npc.position.X < targetVector.X + offset && npc.position.X + npc.width > targetVector.X + player.width + offset && (inRange || npc.ai[0] != 2f)) || npc.ai[1] > 0f || npc.Calamity().newAI[3] >= 180f) { if (npc.ai[0] == 2f) { - float stopBeforeFallTime = npc.Calamity().newAI[2] == 0f ? 20f : 30f; + float stopBeforeFallTime = npc.Calamity().newAI[2] == 0f ? 15f : 20f; if (expertMode) - stopBeforeFallTime -= death ? 15f : 15f * (1f - lifeRatio); + stopBeforeFallTime -= death ? 5f : 5f * (1f - lifeRatio); if (npc.ai[1] < stopBeforeFallTime) { @@ -629,8 +634,12 @@ namespace CalamityMod.NPCs.Ravager } else { + float velocityMult = 1.8f; float velocityXChange = 0.2f + Math.Abs(npc.Center.X - player.Center.X) * 0.001f; + if (npc.ai[0] == 2f) + velocityXChange *= velocityMult; + if (npc.direction < 0) npc.velocity.X -= velocityXChange; else if (npc.direction > 0) @@ -653,7 +662,7 @@ namespace CalamityMod.NPCs.Ravager velocityX += 1f; if (npc.ai[0] == 2f) - velocityX *= 1.4f; + velocityX *= velocityMult; if (npc.velocity.X < -velocityX) npc.velocity.X = -velocityX; @@ -770,12 +779,6 @@ namespace CalamityMod.NPCs.Ravager } } - public override bool CanHitPlayer(Player target, ref int cooldownSlot) - { - cooldownSlot = 1; - return true; - } - public override void OnHitPlayer(Player player, int damage, bool crit) { if (CalamityWorld.revenge) diff --git a/NPCs/SlimeGod/SlimeGodCore.cs b/NPCs/SlimeGod/SlimeGodCore.cs index acccc15d7f..8670965432 100644 --- a/NPCs/SlimeGod/SlimeGodCore.cs +++ b/NPCs/SlimeGod/SlimeGodCore.cs @@ -364,7 +364,7 @@ namespace CalamityMod.NPCs.SlimeGod if (Main.netMode != NetmodeID.MultiplayerClient) { - if (npc.ai[1] % 10f == 0f && Vector2.Distance(player.Center, vectorCenter) > 160f) + if (npc.ai[1] % 15f == 0f && Vector2.Distance(player.Center, vectorCenter) > 160f) { if (expertMode && Main.rand.NextBool(2)) { @@ -446,7 +446,7 @@ namespace CalamityMod.NPCs.SlimeGod { if (Main.netMode != NetmodeID.MultiplayerClient && Vector2.Distance(player.Center, vectorCenter) > 160f) { - if (npc.ai[1] % 20f == 0f) + if (npc.ai[1] % 40f == 0f) { if (expertMode && Main.rand.NextBool(2)) { diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index 70d40aece3..da653c78d0 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -453,18 +453,18 @@ namespace CalamityMod.NPCs.SupremeCalamitas int damage = expertMode ? 200 : 250; //800 500 if (bulletHellCounter2 < 300) //blasts from above { - Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 4f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 4f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); } else if (bulletHellCounter2 < 600) //blasts from left and right { - Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1000), -3.5f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1000), 3.5f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); } else //blasts from above, left, and right { - Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 3f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1000), -3f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1000), 3f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 3f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -528,21 +528,21 @@ namespace CalamityMod.NPCs.SupremeCalamitas { if (bulletHellCounter2 % 180 == 0) //blasts from top { - Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); } } else if (bulletHellCounter2 < 1500 && bulletHellCounter2 > 1200) { if (bulletHellCounter2 % 180 == 0) //blasts from right { - Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1000), -5f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -5f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); } } else if (bulletHellCounter2 > 1500) { if (bulletHellCounter2 % 180 == 0) //blasts from top { - Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); } } bulletHellCounter += 1; @@ -551,16 +551,16 @@ namespace CalamityMod.NPCs.SupremeCalamitas bulletHellCounter = 0; if (bulletHellCounter2 < 1200) //blasts from below { - Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y + 1000f, 0f, -4f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y + 1000f, 0f, -4f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); } else if (bulletHellCounter2 < 1500) //blasts from left { - Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1000), 3.5f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); } else //blasts from left and right { - Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1000), 3f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1000), -3f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -603,11 +603,11 @@ namespace CalamityMod.NPCs.SupremeCalamitas int damage = expertMode ? 150 : 200; if (bulletHellCounter2 % 180 == 0) //blasts from top { - Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); } if (bulletHellCounter2 % 240 == 0) //fireblasts from above { - Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 10f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 10f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); } bulletHellCounter += 1; if (bulletHellCounter > (enraged ? 9 : 11)) @@ -615,16 +615,16 @@ namespace CalamityMod.NPCs.SupremeCalamitas bulletHellCounter = 0; if (bulletHellCounter2 < 2100) //blasts from above { - Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 4f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 4f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); } else if (bulletHellCounter2 < 2400) //blasts from right { - Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1000), -3.5f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); } else //blasts from left and right { - Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1000), -3.5f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1000), 3.5f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -672,16 +672,16 @@ namespace CalamityMod.NPCs.SupremeCalamitas int damage = expertMode ? 150 : 200; if (bulletHellCounter2 % 180 == 0) //blasts from top { - Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); } if (bulletHellCounter2 % 240 == 0) //fireblasts from above { - Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 10f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 10f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); } int divisor = revenge ? 225 : expertMode ? 450 : 675; if (bulletHellCounter2 % divisor == 0 && expertMode) //giant homing fireballs { - Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 1f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, passedVar); + Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 1f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, passedVar); passedVar += 1f; } bulletHellCounter += 1; @@ -690,16 +690,16 @@ namespace CalamityMod.NPCs.SupremeCalamitas bulletHellCounter = 0; if (bulletHellCounter2 < 3000) //blasts from below { - Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y + 1000f, 0f, -4f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y + 1000f, 0f, -4f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); } else if (bulletHellCounter2 < 3300) //blasts from left { - Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1000), 3.5f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); } else //blasts from left and right { - Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1000), -3.5f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1000), 3.5f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); } } } @@ -747,34 +747,36 @@ namespace CalamityMod.NPCs.SupremeCalamitas int damage = expertMode ? 150 : 200; if (bulletHellCounter2 % 240 == 0) //blasts from top { - Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); } if (bulletHellCounter2 % 360 == 0) //fireblasts from above { - Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 10f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 10f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); } if (bulletHellCounter2 % 30 == 0) //projectiles that move in wave pattern { - Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-500, 500), -5f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); - } + int random = Main.rand.Next(-1000, 1001); + Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + random, -5f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X - 1000f, player.position.Y - random, 5f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + } bulletHellCounter += 1; if (bulletHellCounter > (enraged ? 12 : 14)) { bulletHellCounter = 0; if (bulletHellCounter2 < 3900) //blasts from above { - Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 4f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 4f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); } else if (bulletHellCounter2 < 4200) //blasts from left and right { - Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1000), -3.5f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1000), 3.5f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); } else //blasts from above, left, and right { - Projectile.NewProjectile(player.position.X + (float)Main.rand.Next(-1000, 1000), player.position.Y - 1000f, 0f, 3f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1000), -3f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1000), 3f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 3f * uDieLul, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3f * uDieLul, 0f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); } } } diff --git a/NPCs/TownNPCs/FAP.cs b/NPCs/TownNPCs/FAP.cs index 13c92b785d..7d5dd651c0 100644 --- a/NPCs/TownNPCs/FAP.cs +++ b/NPCs/TownNPCs/FAP.cs @@ -57,15 +57,10 @@ namespace CalamityMod.NPCs.TownNPCs for (int k = 0; k < Main.maxPlayers; k++) { Player player = Main.player[k]; - if (player.active) + bool hasVodka = player.InventoryHas(ModContent.ItemType())/* || player.PortableStorageHas(ModContent.ItemType())*/; + if (player.active && hasVodka) { - for (int j = 0; j < player.inventory.Length; j++) - { - if (player.inventory[j].type == ModContent.ItemType()) - { - return Main.hardMode; - } - } + return Main.hardMode || CalamityWorld.spawnedCirrus; } } return CalamityWorld.spawnedCirrus; @@ -94,7 +89,7 @@ namespace CalamityMod.NPCs.TownNPCs int random = Main.rand.Next(4); if (random == 0) { - return "Hey! Nice night. I'm gonna make some Bloody Marys. Celery included. Want one?"; + return "Hey, nice night! I'm gonna make some Bloody Marys, celery included. Want one?"; } else if (random == 1) { @@ -172,13 +167,6 @@ namespace CalamityMod.NPCs.TownNPCs dialogue.Add("My booze will always be better than " + Main.npc[tavernKeep].GivenName + "'s, and nobody can convince me otherwise."); } - // Doesn't seem like a necessary line - /* - int dryad = NPC.FindFirstNPC(NPCID.Dryad); - if (dryad != -1) - dialogue.Add(Main.npc[dryad].GivenName + " is cool too, but she'd outlive me."); - */ - int permadong = NPC.FindFirstNPC(ModContent.NPCType()); if (permadong != -1) dialogue.Add("I never realized how well-endowed " + Main.npc[permadong].GivenName + " was. It had to be the largest icicle I had ever seen."); @@ -189,7 +177,8 @@ namespace CalamityMod.NPCs.TownNPCs dialogue.Add("You still can't stop me from trying to move in with " + Main.npc[waifu].GivenName + "."); dialogue.Add("I love it when " + Main.npc[waifu].GivenName + "'s hands get sticky from all that...wax."); dialogue.Add(Main.npc[waifu].GivenName + " works wonders for my hair...among other things."); - } + dialogue.Add("Ever since " + Main.npc[waifu].GivenName + " moved in I haven't been drinking as much...it's a weird feeling."); + } if (Main.player[Main.myPlayer].Calamity().chibii) dialogue.Add("Is that a toy? Looks like something I'd carry around if I was 5 years old."); diff --git a/NPCs/TownNPCs/THIEF.cs b/NPCs/TownNPCs/THIEF.cs index 417d4f3a62..d7b43f5d9b 100644 --- a/NPCs/TownNPCs/THIEF.cs +++ b/NPCs/TownNPCs/THIEF.cs @@ -71,9 +71,10 @@ namespace CalamityMod.NPCs.TownNPCs for (int k = 0; k < Main.maxPlayers; k++) { Player player = Main.player[k]; - if (player.active && player.InventoryHas(ItemID.PlatinumCoin)) + bool rich = player.InventoryHas(ItemID.PlatinumCoin) || player.PortableStorageHas(ItemID.PlatinumCoin); + if (player.active && rich) { - return NPC.downedBoss3; + return NPC.downedBoss3 || CalamityWorld.spawnedBandit; } } return CalamityWorld.spawnedBandit; diff --git a/NPCs/Yharon/Yharon.cs b/NPCs/Yharon/Yharon.cs index 17b23cde45..9c01d658d7 100644 --- a/NPCs/Yharon/Yharon.cs +++ b/NPCs/Yharon/Yharon.cs @@ -2867,8 +2867,12 @@ namespace CalamityMod.NPCs.Yharon #region Strike NPC public override bool StrikeNPC(ref double damage, int defense, ref float knockback, int hitDirection, ref bool crit) { - if (CalamityUtils.AntiButcher(npc, ref damage, 0.5f)) - return false; + // Safeguard if damage would kill phase 1 before phase 2. + if (phaseOneLoot && (damage >= npc.life || (crit && damage * 2 >= npc.life))) + { + float lifeAboveTenPercent = npc.life - npc.lifeMax * 0.1f; + damage = MathHelper.Clamp((float)damage, 0f, lifeAboveTenPercent); + } // Safeguard to prevent damage which would allow skipping phase 2. if (!startSecondAI && dropLoot) diff --git a/Prefixes/RoguePrefix.cs b/Prefixes/RoguePrefix.cs index 2ecf8e31d6..3943122204 100644 --- a/Prefixes/RoguePrefix.cs +++ b/Prefixes/RoguePrefix.cs @@ -97,8 +97,13 @@ namespace CalamityMod.Prefixes invalid = true; if (item.useAnimation == Math.Round(item.useAnimation * useTimeMult) && useTimeMult != 1f) invalid = true; + // This code is commented out because CanRoll already guarantees that rogue prefixes will never appear on consumable items. + // Setting invalid to true doesn't do anything good. + // It just makes prefixed consumable rogue weapons put TML in an infinite loop looking for an appropriate prefix. + /* if (item.consumable) invalid = true; + */ } } diff --git a/Projectiles/Boss/DeusRitualDrama.cs b/Projectiles/Boss/DeusRitualDrama.cs index df72616b52..20f12a90fd 100644 --- a/Projectiles/Boss/DeusRitualDrama.cs +++ b/Projectiles/Boss/DeusRitualDrama.cs @@ -37,32 +37,25 @@ namespace CalamityMod.Projectiles.Boss projectile.timeLeft = TotalRitualTime; } - public override void AI() - { - Time++; - if (Time == TotalRitualTime - PulseTime) - { - int idx = NPC.NewNPC((int)projectile.Center.X, (int)projectile.Center.Y - (int)MaxUpwardRise, ModContent.NPCType(), 1); - if (idx != -1) - { - if (Main.netMode == NetmodeID.SinglePlayer) - { - Main.NewText(Language.GetTextValue("Announcement.HasAwoken", Main.npc[idx].TypeName), new Color(175, 75, 255)); - return; - } - - if (Main.netMode == NetmodeID.Server) - { - NetMessage.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasAwoken", new object[] - { - Main.npc[idx].GetTypeNetName() - }), new Color(175, 75, 255)); - return; - } - NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, idx); - } - } - } + public override void AI() + { + Time++; + if (Time == TotalRitualTime - PulseTime) + { + int idx = NPC.NewNPC((int)projectile.Center.X, (int)projectile.Center.Y - (int)MaxUpwardRise, ModContent.NPCType(), 1); + if (idx != -1) + { + if (Main.netMode != NetmodeID.MultiplayerClient) + { + CalamityUtils.BossAwakenMessage(idx); + } + else + { + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, idx); + } + } + } + } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 860127a9d0..ffad71a7f8 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -13,6 +13,7 @@ using CalamityMod.Projectiles.Ranged; using CalamityMod.Projectiles.Rogue; using CalamityMod.Projectiles.Summon; using CalamityMod.Projectiles.Typeless; +using CalamityMod.Projectiles.Typeless.FiniteUse; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -1021,6 +1022,8 @@ namespace CalamityMod.Projectiles defCrit = modPlayer.critStats[3]; else if (projectile.IsSummon()) defCrit = 4; + else if (player.ActiveItem().crit > 0) + defCrit = player.ActiveItem().crit; } if (projectile.owner == Main.myPlayer/* && Main.netMode != NetmodeID.MultiplayerClient*/) @@ -1118,6 +1121,15 @@ namespace CalamityMod.Projectiles if (!crit) crit = Main.rand.NextBool(10); } + + if (projectile.type == ProjectileType()) + { + if (crit) + { + damage = (int)(damage * 1.25); + knockback *= 1.25f; + } + } } } #endregion @@ -2104,7 +2116,7 @@ namespace CalamityMod.Projectiles } } - public static void MagnetSphereHitscan(Projectile projectile, float distanceRequired, float homingVelocity, float projectileTimer, int maxTargets, int spawnedProjectile, double damageMult = 1D) + public static void MagnetSphereHitscan(Projectile projectile, float distanceRequired, float homingVelocity, float projectileTimer, int maxTargets, int spawnedProjectile, double damageMult = 1D, bool attackMultiple = false) { float maxDistance = distanceRequired; bool homeIn = false; @@ -2147,6 +2159,24 @@ namespace CalamityMod.Projectiles Vector2 value = projectile.Center + projectile.velocity * 4f; Vector2 velocity = Vector2.Normalize(Main.npc[randomTarget].Center - value) * homingVelocity; + if (attackMultiple) + { + for (int i = 0; i < targetArrayIndex; i++) + { + velocity = Vector2.Normalize(Main.npc[targetArray[i]].Center - value) * homingVelocity; + + if (projectile.owner == Main.myPlayer) + { + int projectile2 = Projectile.NewProjectile(value.X, value.Y, velocity.X, velocity.Y, spawnedProjectile, (int)(projectile.damage * damageMult), projectile.knockBack, projectile.owner, 0f, 0f); + + if (projectile.type == ProjectileType() && projectile.Calamity().rogue) + Main.projectile[projectile2].Calamity().forceRogue = true; + } + } + + return; + } + if (projectile.type == ProjectileType()) { velocity.Y += Main.rand.Next(-30, 31) * 0.05f; @@ -2160,9 +2190,6 @@ namespace CalamityMod.Projectiles if (projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType() || projectile.type == ProjectileType() || (projectile.type == ProjectileType() && projectile.melee)) Main.projectile[projectile2].Calamity().forceMelee = true; - - else if (projectile.type == ProjectileType() && projectile.Calamity().rogue) - Main.projectile[projectile2].Calamity().forceRogue = true; } } } diff --git a/Projectiles/DraedonsArsenal/GaussFlux.cs b/Projectiles/DraedonsArsenal/GaussFlux.cs new file mode 100644 index 0000000000..6c5c2ac096 --- /dev/null +++ b/Projectiles/DraedonsArsenal/GaussFlux.cs @@ -0,0 +1,81 @@ +using System; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.DraedonsArsenal +{ + public class GaussFlux : ModProjectile + { + public float Time + { + get => projectile.ai[0]; + set => projectile.ai[0] = value; + } + public NPC Target + { + get => Main.npc[(int)projectile.ai[1]]; + set => projectile.ai[1] = value.whoAmI; + } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gauss Flux"); + } + + public override void SetDefaults() + { + projectile.width = 16; + projectile.height = 16; + projectile.friendly = true; + projectile.melee = true; + projectile.penetrate = -1; + projectile.timeLeft = 180; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 14; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, Color.Lime.ToVector3()); + if (!Target.active) + { + projectile.Kill(); + return; + } + projectile.Center = Target.Center; + if (!Main.dedServ) + { + if (Time == 0) + { + for (int i = 0; i < 60; i++) + { + Dust dust = Dust.NewDustPerfect(Target.Center, 261); + dust.color = Utils.SelectRandom(Main.rand, Color.Yellow, Color.YellowGreen); + dust.velocity = Main.rand.NextVector2Circular(20f, 20f); + dust.scale = 2f; + dust.noGravity = true; + } + } + for (int i = 0; i < 7; i++) + { + for (int arcIndex = 0; arcIndex < 6; arcIndex++) + { + float offsetAngle = MathHelper.ToRadians(1080f) * i / 18f; + offsetAngle += Time / 10f; + float scale = 1.4f + (float)Math.Cos(i / 7f * MathHelper.TwoPi + Time / 30f) * 0.3f; + scale *= MathHelper.Lerp(1f, 0.4f, arcIndex / 6f); + Vector2 offset = Target.Size.RotatedBy(offsetAngle) * 0.5f; + offset += (arcIndex * MathHelper.TwoPi / 6f + Time / 20f).ToRotationVector2() * 6f * arcIndex; + + Dust dust = Dust.NewDustPerfect(Target.Center + offset, 261); + dust.color = Utils.SelectRandom(Main.rand, Color.Yellow, Color.YellowGreen); + dust.velocity = Vector2.Zero; + dust.scale = scale; + dust.noGravity = true; + } + } + } + Time++; + } + } +} diff --git a/Projectiles/DraedonsArsenal/GaussFlux.png b/Projectiles/DraedonsArsenal/GaussFlux.png new file mode 100644 index 0000000000..272321a620 Binary files /dev/null and b/Projectiles/DraedonsArsenal/GaussFlux.png differ diff --git a/Projectiles/DraedonsArsenal/HydraulicVoltCrasherProjectile.cs b/Projectiles/DraedonsArsenal/HydraulicVoltCrasherProjectile.cs index 995b73e73a..76cbc7d798 100644 --- a/Projectiles/DraedonsArsenal/HydraulicVoltCrasherProjectile.cs +++ b/Projectiles/DraedonsArsenal/HydraulicVoltCrasherProjectile.cs @@ -137,7 +137,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Projectile.NewProjectileDirect(npc.Center, Vector2.Zero, ModContent.ProjectileType(), - projectile.damage, + (int)(projectile.damage * 0.35), 0f, projectile.owner, 0f, diff --git a/Projectiles/DraedonsArsenal/MassivePlasmaExplosion.cs b/Projectiles/DraedonsArsenal/MassivePlasmaExplosion.cs index a6a53ecaa2..517389e439 100644 --- a/Projectiles/DraedonsArsenal/MassivePlasmaExplosion.cs +++ b/Projectiles/DraedonsArsenal/MassivePlasmaExplosion.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal projectile.tileCollide = false; projectile.Calamity().rogue = true; projectile.usesIDStaticNPCImmunity = true; - projectile.idStaticNPCHitCooldown = 10; + projectile.idStaticNPCHitCooldown = 12; } public override void AI() diff --git a/Projectiles/DraedonsArsenal/MountedScannerLaser.cs b/Projectiles/DraedonsArsenal/MountedScannerLaser.cs index a2b3469e74..5d52edbbaf 100644 --- a/Projectiles/DraedonsArsenal/MountedScannerLaser.cs +++ b/Projectiles/DraedonsArsenal/MountedScannerLaser.cs @@ -84,5 +84,15 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } } } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + projectile.damage /= 3; + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + projectile.damage /= 3; + } } } diff --git a/Projectiles/DraedonsArsenal/PhaseslayerBeam.cs b/Projectiles/DraedonsArsenal/PhaseslayerBeam.cs new file mode 100644 index 0000000000..de66606ea8 --- /dev/null +++ b/Projectiles/DraedonsArsenal/PhaseslayerBeam.cs @@ -0,0 +1,67 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.Graphics.Shaders; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.DraedonsArsenal +{ + public class PhaseslayerBeam : ModProjectile + { + public const int Lifetime = 180; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Light Blade"); + Main.projFrames[projectile.type] = 5; + } + + public override void SetDefaults() + { + projectile.width = 64; + projectile.height = 120; + projectile.scale = 0.5f; + projectile.Size *= projectile.scale; + + projectile.friendly = true; + projectile.penetrate = 3; + projectile.melee = true; + projectile.tileCollide = false; + projectile.penetrate = -1; + projectile.usesLocalNPCImmunity = true; + projectile.timeLeft = Lifetime; + projectile.localNPCHitCooldown = 6; + } + + public override void AI() + { + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; + NPC potentialTarget = projectile.Center.ClosestNPCAt(1000f); + if (potentialTarget != null && projectile.Distance(potentialTarget.Center) > 40f && projectile.timeLeft > Lifetime - 60) + { + projectile.velocity = (projectile.velocity * 7f + projectile.DirectionTo(potentialTarget.Center) * 24f) / 8f; + } + projectile.frameCounter++; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D bladeTexture = ModContent.GetTexture(Texture); + MiscShaderData distortationShader = GameShaders.Misc["CalamityMod:LightDistortion"]; + + spriteBatch.End(); + spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.instance.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); + + Rectangle frame = bladeTexture.Frame(1, 5, 0, projectile.frameCounter / 4 % 5); + var drawData2 = new DrawData(bladeTexture, projectile.Center - Main.screenPosition, frame, Color.White, projectile.rotation, bladeTexture.Size() * 0.5f, projectile.scale * 1.2f, SpriteEffects.None, 0); + distortationShader.Apply(drawData2); + drawData2.Draw(spriteBatch); + + return false; + } + public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) + { + spriteBatch.End(); + spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Main.DefaultSamplerState, DepthStencilState.None, Main.instance.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); + } + } +} diff --git a/Projectiles/DraedonsArsenal/PhaseslayerBeam.png b/Projectiles/DraedonsArsenal/PhaseslayerBeam.png new file mode 100644 index 0000000000..8c9c20d1fe Binary files /dev/null and b/Projectiles/DraedonsArsenal/PhaseslayerBeam.png differ diff --git a/Projectiles/DraedonsArsenal/PhaseslayerBlade.png b/Projectiles/DraedonsArsenal/PhaseslayerBlade.png new file mode 100644 index 0000000000..a7058e9bce Binary files /dev/null and b/Projectiles/DraedonsArsenal/PhaseslayerBlade.png differ diff --git a/Projectiles/DraedonsArsenal/PhaseslayerBladeSmall.png b/Projectiles/DraedonsArsenal/PhaseslayerBladeSmall.png new file mode 100644 index 0000000000..f52f934a8a Binary files /dev/null and b/Projectiles/DraedonsArsenal/PhaseslayerBladeSmall.png differ diff --git a/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs b/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs new file mode 100644 index 0000000000..70bf27abed --- /dev/null +++ b/Projectiles/DraedonsArsenal/PhaseslayerProjectile.cs @@ -0,0 +1,304 @@ +using CalamityMod.Dusts; +using CalamityMod.Items; +using CalamityMod.Items.Weapons.DraedonsArsenal; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.DraedonsArsenal +{ + public class PhaseslayerProjectile : ModProjectile + { + // The "average" or "expected" swing speed which the sword's damage balance is based off of. + // This is rotation EVERY FRAME. The "average" swing speed is 360 degrees in one second, aka pi/30 radians per frame. + public const float StandardSwingSpeed = MathHelper.Pi / 30f; + + // How quickly the sword's damage updates to reflect its current speed. Higher values make it change damage more quickly. + public const float DamageUpdateResponsiveness = 0.08f; + + // When the accumuluated "charge exhaustion" meter reaches this value, the Phaseslayer item loses one point of charge. + public const float ChargeLossBreakpoint = 300f; + + public const int SwordBeamCooldown = 15; + private const float MaximumMouseRange = 360f; + private const float ProjCenterOffset = 36f; + + public bool IsSmall + { + get + { + CalamityGlobalItem swordItem = Main.player[projectile.owner].ActiveItem().Calamity(); + float chargeRatio = swordItem.CurrentCharge / (float)swordItem.ChargeMax; + return chargeRatio < Phaseslayer.SizeChargeThreshold; + } + } + + // ai[0] wrapper. Stores a rolling lerped average of angular momentum which is used as the swing speed damage multiplier. + public float AngularDamageFactor + { + get => projectile.ai[0]; + set => projectile.ai[0] = value; + } + + // ai[1] wrapper. Stores an accumulating "charge exhaustion" meter. When it reaches the limit, a charge point is lost. + public float ChargeLossProgress + { + get => projectile.ai[1]; + set => projectile.ai[1] = value; + } + + // localAI[0] wrapper + public float FadeoutTime + { + get => projectile.localAI[0]; + set => projectile.localAI[0] = value; + } + + public int BladeFrameX => IsSmall ? 1 : projectile.frame / 7; + public int BladeFrameY => IsSmall ? projectile.frame % 3 : projectile.frame % 7; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Phaseslayer"); + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 8; + } + + public override void SetDefaults() + { + projectile.width = 46; // Collision logic is done manually. + projectile.height = 46; + projectile.friendly = true; + projectile.melee = true; + projectile.tileCollide = false; + projectile.ignoreWater = true; + + projectile.penetrate = -1; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 7; + } + + public override void AI() + { + Player player = Main.player[projectile.owner]; + // Angles are wrapped to be 0 to 2pi instead of -pi to pi for convenience with absolute values. + float rotationAdjusted = MathHelper.WrapAngle(projectile.rotation) + MathHelper.Pi; + float oldRotationAdjusted = MathHelper.WrapAngle(projectile.oldRot[1]) + MathHelper.Pi; + float deltaAngle = Math.Abs(rotationAdjusted - oldRotationAdjusted); + + // Frame 1 effect: Prevent the sword from instantly firing a sword beam. + if (projectile.localAI[1] == 0f) + { + projectile.localAI[1] = 1f; + projectile.soundDelay = SwordBeamCooldown; + } + + ManipulatePlayer(player); + bool wasBig = !IsSmall; + UpdateCharge(player); + bool justShrunk = IsSmall && wasBig; + if (justShrunk) + OnShrinkEffects(); + AdjustDamageBasedOnRotation(player, deltaAngle); + ManipulateFrames(); + HandleSwordBeams(player, deltaAngle); + HandleFadeout(); + } + + private void ManipulatePlayer(Player player) + { + if (Main.myPlayer == player.whoAmI) + { + // In addition to typical channel cancellation criteria, the sword fizzles out if it runs out of charge. + Item playerItem = player.ActiveItem(); + bool hasCharge = playerItem.Calamity().CurrentCharge > 0; + if (player.channel && !player.noItems && !player.CCed && playerItem.type == ModContent.ItemType() && hasCharge) + { + // The distance ratio ranges from 0 (your mouse is directly on the player) to 1 (your mouse is at the max range considered, or any further distance). + float mouseDistance = projectile.Distance(Main.MouseWorld); + float distRatio = Utils.InverseLerp(0f, MaximumMouseRange, mouseDistance, true); + + // This formula ensures that the sword has a sudden and extremely harsh responsiveness penalty when the mouse is close to the player. + // Otherwise it controls perfectly fine. + float aimResponsiveness = 0.035f + 0.3f * (float)Math.Pow(distRatio, 1D/3); + + // Update the sword's angle with the responsiveness determined by mouse position. + projectile.rotation = projectile.rotation.AngleLerp(player.AngleTo(Main.MouseWorld), aimResponsiveness); + } + + // If the player is not wielding the sword, determine whether it should fade out or instantly vanish. + else if (FadeoutTime == 0f) + { + // If the player voluntarily stopped holding left mouse, start the fadeout timer. + if (!player.channel) + FadeoutTime = 10f; + // If the player was killed, frozen, cursed, etc. just delete it immediately. + else + projectile.Kill(); + } + + projectile.Center = player.MountedCenter + projectile.rotation.ToRotationVector2() * ProjCenterOffset; + } + + // These lines ensure the player and their arm are rotated the correct direction to hold the sword. + projectile.direction = (Math.Cos(projectile.rotation) > 0).ToDirectionInt(); + player.ChangeDir(projectile.direction); + player.heldProj = projectile.whoAmI; + player.itemTime = 2; + player.itemAnimation = 2; + player.itemRotation = projectile.rotation * projectile.direction; + } + + private void UpdateCharge(Player player) + { + // Having the sword active at all costs some energy. + ChargeLossProgress += 1f; + + // If charge is due to be lost, reset the accumuluated charge exhaustion and update the player's held item. + if (ChargeLossProgress > ChargeLossBreakpoint) + { + ChargeLossProgress -= ChargeLossBreakpoint; + + if (Main.myPlayer == projectile.owner) + { + if (Main.mouseItem.active) + Main.mouseItem.Calamity().CurrentCharge--; + else + player.HeldItem.Calamity().CurrentCharge--; + } + } + } + + private void OnShrinkEffects() + { + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/MechGaussRifle"), projectile.Center); + if (Main.dedServ) + return; + + for (int i = 0; i < 60; i++) + { + Dust dust = Dust.NewDustPerfect(projectile.Center, (int)CalamityDusts.Brimstone); + dust.velocity = Main.rand.NextVector2Circular(20f, 20f); + dust.scale = 2.5f; + dust.fadeIn = 1.2f; + dust.noGravity = true; + } + } + + private void AdjustDamageBasedOnRotation(Player player, float deltaAngle) + { + // Update the rolling "blade angular momentum" average by gently lerping in the newest data point. + AngularDamageFactor = MathHelper.Lerp(AngularDamageFactor, deltaAngle, DamageUpdateResponsiveness); + + // 0x expected speed gives you 53.5% damage. + // 1x expected speed gives you 100.0% damage. + // 1.5x expected speed gives you 116.6% damage. + // 2x expected speed gives you 130.6% damage. + // 3x expected speed gives you 153.5% damage. + // 4x expected speed gives you 171.7% damage. + // 5x expected speed gives you 187.0% damage. + float speedDamageScalar = 0.166f + (float)Math.Log(AngularDamageFactor / StandardSwingSpeed + 1.5f, 3f); + float statDamageScalar = player.MeleeDamage() * (IsSmall ? Phaseslayer.SmallDamageMultiplier : 1f); + projectile.damage = (int)(Phaseslayer.Damage * speedDamageScalar * statDamageScalar); + } + + private void ManipulateFrames() + { + projectile.frame = 0; + + if (IsSmall) + { + // Fadeout frames. + if (FadeoutTime > 5) + projectile.frame = 1; + else if (FadeoutTime > 0) + projectile.frame = 2; + } + else + { + projectile.frameCounter++; + int adjustFrameCounter = projectile.frameCounter % 120; + + // Idle lightning frames. + if (adjustFrameCounter >= 50 && adjustFrameCounter <= 78) + projectile.frame = (int)MathHelper.Lerp(1, 9, Utils.InverseLerp(50, 75, adjustFrameCounter, true)); + if (adjustFrameCounter >= 90 && adjustFrameCounter <= 120) + projectile.frame = (int)MathHelper.Lerp(10, 18, Utils.InverseLerp(90, 117, adjustFrameCounter, true)); + + // Fadeout frames. + if (FadeoutTime > 5) + projectile.frame = 19; + else if (FadeoutTime > 0) + projectile.frame = 20; + } + } + + private void HandleSwordBeams(Player player, float deltaAngle) + { + // Producing a sword beam takes a bit higher of a speed than the "typical" speed the sword is balanced around. + if (projectile.soundDelay <= 0 && deltaAngle >= 1.3f * StandardSwingSpeed) + { + // Sword beams cost a noticeable amount of energy, but deal the blade's current damage. Swing harder to get more damage! + ChargeLossProgress += 30f; + if (Main.myPlayer == player.whoAmI) + { + Vector2 velocity = projectile.rotation.ToRotationVector2() * 20f; + Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), projectile.damage, 0f, player.whoAmI); + } + + // The sound delay doubles as the sword beam's cooldown. + projectile.soundDelay = SwordBeamCooldown; + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/ELRFire"), projectile.Center); + } + } + + private void HandleFadeout() + { + if (FadeoutTime > 0) + { + FadeoutTime--; + if (FadeoutTime <= 0f) + projectile.Kill(); + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D bladeTexture = ModContent.GetTexture("CalamityMod/Projectiles/DraedonsArsenal/PhaseslayerBlade"); + Texture2D hiltTexture = ModContent.GetTexture(Texture); + if (IsSmall) + bladeTexture = ModContent.GetTexture("CalamityMod/Projectiles/DraedonsArsenal/PhaseslayerBladeSmall"); + Vector2 bladeOffset = projectile.rotation.ToRotationVector2() * (IsSmall ? 90f : 132f) * projectile.scale; + Vector2 origin = bladeTexture.Size() * 0.5f; + origin /= IsSmall ? new Vector2(1f, 3f) : new Vector2(3f, 7f); + Rectangle frame = IsSmall ? bladeTexture.Frame(1, 3, 0, BladeFrameY) : bladeTexture.Frame(3, 7, BladeFrameX, BladeFrameY); + + // TODO: Update this afterimage drawcode to be more cool. + for (int i = 1; i < projectile.oldRot.Length; i++) + { + float angleDelta = MathHelper.Clamp(projectile.rotation - projectile.oldRot[i], -0.26f, 0.26f); + float angle = projectile.rotation + angleDelta; + angle += MathHelper.PiOver2; + Color color = Color.White * (float)Math.Pow(1f - i / (float)projectile.oldRot.Length, 3f); + Rectangle afterimageFrame = IsSmall ? bladeTexture.Frame(1, 3, 0, 2) : bladeTexture.Frame(3, 7, 2, 6); + spriteBatch.Draw(bladeTexture, projectile.Center + bladeOffset - Main.screenPosition, afterimageFrame, color, angle, origin, projectile.scale, SpriteEffects.None, 0f); + } + + spriteBatch.Draw(bladeTexture, projectile.Center + bladeOffset - Main.screenPosition, frame, Color.White, projectile.rotation + MathHelper.PiOver2, origin, projectile.scale, SpriteEffects.None, 0f); + spriteBatch.Draw(hiltTexture, projectile.Center - Main.screenPosition, null, lightColor, projectile.rotation + MathHelper.PiOver2, hiltTexture.Size() * 0.5f, projectile.scale, SpriteEffects.None, 0f); + + return false; + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + float _ = 0f; + Vector2 start = projectile.Center + projectile.rotation.ToRotationVector2() * 28f; + Vector2 end = start + projectile.rotation.ToRotationVector2() * (IsSmall ? 202f : 254f) * projectile.scale; + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), start, end, 60f * projectile.scale, ref _); + } + } +} diff --git a/Projectiles/DraedonsArsenal/PhaseslayerProjectile.png b/Projectiles/DraedonsArsenal/PhaseslayerProjectile.png new file mode 100644 index 0000000000..53f9fb432a Binary files /dev/null and b/Projectiles/DraedonsArsenal/PhaseslayerProjectile.png differ diff --git a/Projectiles/DraedonsArsenal/PlasmaGrenadeProjectile.cs b/Projectiles/DraedonsArsenal/PlasmaGrenadeProjectile.cs index 5c4f2eeaee..21822a2fb7 100644 --- a/Projectiles/DraedonsArsenal/PlasmaGrenadeProjectile.cs +++ b/Projectiles/DraedonsArsenal/PlasmaGrenadeProjectile.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal { if (Main.myPlayer == projectile.owner) { - Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), projectile.damage * 3, projectile.knockBack * 3f, projectile.owner); + Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), projectile.damage * 2, projectile.knockBack * 2f, projectile.owner); } if (!Main.dedServ) { @@ -73,7 +73,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } else { - CalamityGlobalProjectile.ExpandHitboxBy(projectile, 240); + CalamityGlobalProjectile.ExpandHitboxBy(projectile, 360); projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; projectile.Damage(); @@ -84,7 +84,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal int type = Main.rand.NextBool(3) ? 261 : (int)CalamityDusts.SulfurousSeaAcid; Dust dust = Dust.NewDustPerfect(projectile.Center + Main.rand.NextVector2Circular(10f, 10f), type); dust.scale = Main.rand.NextFloat(1.3f, 1.5f); - dust.velocity = Main.rand.NextVector2CircularEdge(10f, 10f); + dust.velocity = Main.rand.NextVector2CircularEdge(15f, 15f); dust.noGravity = true; if (type == 261) { diff --git a/Projectiles/DraedonsArsenal/PoleWarperSummon.cs b/Projectiles/DraedonsArsenal/PoleWarperSummon.cs index c9284e2c9e..68d31b2395 100644 --- a/Projectiles/DraedonsArsenal/PoleWarperSummon.cs +++ b/Projectiles/DraedonsArsenal/PoleWarperSummon.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } GrantBuffs(player); NPC potentialTarget = projectile.Center.MinionHoming(900f, player); - if (potentialTarget == null) + if (potentialTarget is null) { PlayerMovement(player); RepelMovement(); diff --git a/Projectiles/DraedonsArsenal/PulsePistolShot.cs b/Projectiles/DraedonsArsenal/PulsePistolShot.cs index 4aac3ce503..b7617f922b 100644 --- a/Projectiles/DraedonsArsenal/PulsePistolShot.cs +++ b/Projectiles/DraedonsArsenal/PulsePistolShot.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal projectile.width = 16; projectile.height = 16; projectile.friendly = true; - projectile.ranged = true; + projectile.magic = true; projectile.penetrate = 1; projectile.extraUpdates = 10; projectile.timeLeft = 120 * (1 + projectile.extraUpdates); diff --git a/Projectiles/DraedonsArsenal/PulseTurret.cs b/Projectiles/DraedonsArsenal/PulseTurret.cs index a07b35e816..894391f217 100644 --- a/Projectiles/DraedonsArsenal/PulseTurret.cs +++ b/Projectiles/DraedonsArsenal/PulseTurret.cs @@ -49,9 +49,9 @@ namespace CalamityMod.Projectiles.DraedonsArsenal projectile.velocity.Y += 0.5f; } - NPC potentialTarget = projectile.Center.MinionHoming(850f, player); + NPC potentialTarget = projectile.Center.MinionHoming(850f, player, false); - if (potentialTarget != null && Collision.CanHit(projectile.position, projectile.width, projectile.height, potentialTarget.position, potentialTarget.width, potentialTarget.height)) + if (potentialTarget != null) { projectile.spriteDirection = (potentialTarget.Center.X - projectile.Center.X > 0).ToDirectionInt(); projectile.ai[0]++; @@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal { Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/PulseRifleFire"), shootPosition); Projectile.NewProjectile(shootPosition, - Vector2.Normalize(potentialTarget.Center - shootPosition) * 24f, + Vector2.Normalize(potentialTarget.Center - shootPosition) * 12f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, @@ -93,7 +93,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal for (int i = -1; i <= 1; i += 2) { Projectile.NewProjectile(shootPosition, - Vector2.Normalize(potentialTarget.Center - shootPosition).RotatedBy(i * MathHelper.ToRadians(28f)) * 14f, + Vector2.Normalize(potentialTarget.Center - shootPosition).RotatedBy(i * MathHelper.ToRadians(28f)) * 7f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, @@ -118,6 +118,8 @@ namespace CalamityMod.Projectiles.DraedonsArsenal { projectile.rotation = projectile.rotation.AngleLerp(0f, MathHelper.TwoPi / 50f); } + + projectile.StickToTiles(false, false); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/DraedonsArsenal/PulseTurretShot.cs b/Projectiles/DraedonsArsenal/PulseTurretShot.cs index fdd6c339ed..21324b7336 100644 --- a/Projectiles/DraedonsArsenal/PulseTurretShot.cs +++ b/Projectiles/DraedonsArsenal/PulseTurretShot.cs @@ -1,6 +1,7 @@ using System; using Microsoft.Xna.Framework; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.DraedonsArsenal @@ -12,18 +13,20 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override void SetStaticDefaults() { DisplayName.SetDefault("Pulse Bolt"); + ProjectileID.Sets.SentryShot[projectile.type] = true; } public override void SetDefaults() { - projectile.width = 4; - projectile.height = 4; + projectile.width = 10; + projectile.height = 10; projectile.friendly = true; - projectile.ranged = true; + projectile.minion = true; projectile.penetrate = 1; - projectile.timeLeft = 300; + projectile.timeLeft = 600; projectile.Calamity().hasInorganicEnemyHitBoost = true; projectile.Calamity().inorganicEnemyHitBoost = 0.002f; + projectile.extraUpdates = 1; } public override void AI() @@ -42,7 +45,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } if (projectile.ai[1] == 1f) { - NPC potentialTarget = projectile.Center.MinionHoming(850f, Main.player[projectile.owner]); + NPC potentialTarget = projectile.Center.MinionHoming(850f, Main.player[projectile.owner], false); if (potentialTarget != null) { float speed = projectile.velocity.Length(); diff --git a/Projectiles/DraedonsArsenal/SnakeEyesSummon.cs b/Projectiles/DraedonsArsenal/SnakeEyesSummon.cs index 266d1cfa96..ff6bb1d8e6 100644 --- a/Projectiles/DraedonsArsenal/SnakeEyesSummon.cs +++ b/Projectiles/DraedonsArsenal/SnakeEyesSummon.cs @@ -189,7 +189,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal offsetMultiplier = new Vector2(1f, -1f); break; } - if (Time % 30f == 0f) + if (Time % 20f == 0f) { if (projectile.ai[1] > 0 && Main.myPlayer == projectile.owner) { @@ -206,8 +206,8 @@ namespace CalamityMod.Projectiles.DraedonsArsenal else { EyeOutwardness = MathHelper.Lerp(EyeOutwardness, 1f, 0.15f); - EyeRotation = EyeRotation.AngleTowards(projectile.AngleTo(npc.Center), MathHelper.TwoPi / 30f); - projectile.Center = Vector2.SmoothStep(OldCenter, npc.Center + (new Vector2(300f) + projectile.Size * 0.5f) * offsetMultiplier, Time % 30f / 30f); + EyeRotation = EyeRotation.AngleTowards(projectile.AngleTo(npc.Center), MathHelper.TwoPi / 20f); + projectile.Center = Vector2.SmoothStep(OldCenter, npc.Center + (new Vector2(300f) + projectile.Size * 0.5f) * offsetMultiplier, Time % 20f / 20f); } } public void GenerateAfterimageDust() diff --git a/Projectiles/DraedonsArsenal/StarSwallowerSummon.cs b/Projectiles/DraedonsArsenal/StarSwallowerSummon.cs index 845249ad2f..a057b9e389 100644 --- a/Projectiles/DraedonsArsenal/StarSwallowerSummon.cs +++ b/Projectiles/DraedonsArsenal/StarSwallowerSummon.cs @@ -137,7 +137,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal FallThroughYPoint = player.Top.Y; } - AntiStickyMovement(0.05f); + projectile.MinionAntiClump(); ManipulateFrames(minimumFrame, maximumFrame); } @@ -261,7 +261,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal if (AcidShootTimer > 48) { AcidShootTimer = 0; - AcidShootCooldown = 30f; + AcidShootCooldown = 10f; projectile.netUpdate = true; } } @@ -269,34 +269,6 @@ namespace CalamityMod.Projectiles.DraedonsArsenal AcidShootCooldown--; projectile.velocity.X *= 0.8f; } - public void AntiStickyMovement(float antiStickAcceleration = 0.05f) - { - for (int index = 0; index < Main.projectile.Length; index++) - { - Projectile proj = Main.projectile[index]; - if (index != projectile.whoAmI && - proj.active && proj.owner == projectile.owner && - proj.type == projectile.type && Math.Abs(projectile.position.X - proj.position.X) + Math.Abs(projectile.position.Y - proj.position.Y) < projectile.width) - { - if (projectile.position.X < proj.position.X) - { - projectile.velocity.X -= antiStickAcceleration; - } - else - { - projectile.velocity.X += antiStickAcceleration; - } - if (projectile.position.Y < proj.position.Y) - { - projectile.velocity.Y -= antiStickAcceleration; - } - else - { - projectile.velocity.Y += antiStickAcceleration; - } - } - } - } public void ManipulateFrames(int minimumFrame, int maximumFrame) { if (projectile.frame < minimumFrame) diff --git a/Projectiles/DraedonsArsenal/VoltageStream.cs b/Projectiles/DraedonsArsenal/VoltageStream.cs index f0fce021cf..f1126050b0 100644 --- a/Projectiles/DraedonsArsenal/VoltageStream.cs +++ b/Projectiles/DraedonsArsenal/VoltageStream.cs @@ -97,8 +97,26 @@ namespace CalamityMod.Projectiles.DraedonsArsenal projectile.Kill(); } Time++; + + if (projectile.damage <= 0) + projectile.Kill(); } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + ReduceDamage(); + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + ReduceDamage(); + } + + private void ReduceDamage() + { + projectile.damage = (int)(projectile.damage * 0.75); + } + public override void Kill(int timeLeft) { } diff --git a/Projectiles/Enemy/FlakAcid.cs b/Projectiles/Enemy/FlakAcid.cs index ea1941e212..5abc682b56 100644 --- a/Projectiles/Enemy/FlakAcid.cs +++ b/Projectiles/Enemy/FlakAcid.cs @@ -54,9 +54,7 @@ namespace CalamityMod.Projectiles.Enemy } public override void Kill(int timeLeft) { - projectile.position = projectile.Center; - projectile.width = projectile.height = 150; - projectile.position -= projectile.Size / 2f; + CalamityGlobalProjectile.ExpandHitboxBy(projectile, 150); projectile.Damage(); for (int i = 0; i <= 40; i++) { @@ -74,6 +72,8 @@ namespace CalamityMod.Projectiles.Enemy } } + public override Color? GetAlpha(Color lightColor) => new Color(200, 200, 200, 200); + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); diff --git a/Projectiles/Enemy/GammaAcid.cs b/Projectiles/Enemy/GammaAcid.cs index 3afba2d30d..cf04973c26 100644 --- a/Projectiles/Enemy/GammaAcid.cs +++ b/Projectiles/Enemy/GammaAcid.cs @@ -39,9 +39,7 @@ namespace CalamityMod.Projectiles.Enemy } public override void Kill(int timeLeft) { - projectile.position = projectile.Center; - projectile.width = projectile.height = 80; - projectile.position -= projectile.Size / 2f; + CalamityGlobalProjectile.ExpandHitboxBy(projectile, 80); projectile.Damage(); for (int i = 0; i <= 40; i++) { @@ -59,6 +57,8 @@ namespace CalamityMod.Projectiles.Enemy } } + public override Color? GetAlpha(Color lightColor) => new Color(200, 200, 200, 200); + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); diff --git a/Projectiles/Hybrid/EradicatorProjectile.cs b/Projectiles/Hybrid/EradicatorProjectile.cs index 96c3f699a9..89990120da 100644 --- a/Projectiles/Hybrid/EradicatorProjectile.cs +++ b/Projectiles/Hybrid/EradicatorProjectile.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Hybrid public override void AI() { Lighting.AddLight(projectile.Center, 0.35f, 0f, 0.25f); - CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 300f, 6f, 8f, 20, ModContent.ProjectileType()); + CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 300f, 6f, 8f, 6, ModContent.ProjectileType(), 1D, true); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) diff --git a/Projectiles/Magic/AstralachneaFang.cs b/Projectiles/Magic/AstralachneaFang.cs index 06f099f567..332e5899c2 100644 --- a/Projectiles/Magic/AstralachneaFang.cs +++ b/Projectiles/Magic/AstralachneaFang.cs @@ -8,62 +8,55 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Magic { - public class AstralachneaFang : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Fang"); - ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - } + public class AstralachneaFang : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Fang"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } - public override void SetDefaults() - { - projectile.width = 14; - projectile.height = 14; - projectile.friendly = true; - projectile.penetrate = 1; - projectile.magic = true; - projectile.tileCollide = true; - projectile.timeLeft = 240; - } + public override void SetDefaults() + { + projectile.width = 14; + projectile.height = 14; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.magic = true; + projectile.tileCollide = true; + projectile.timeLeft = 240; + } - public override void AI() - { - int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, ModContent.DustType(), 0f, 0f, 100, default, 1f); - Main.dust[num469].noGravity = true; + public override void AI() + { + int astral = Dust.NewDust(projectile.position, projectile.width, projectile.height, ModContent.DustType(), 0f, 0f, 100, default, 1f); + Main.dust[astral].noGravity = true; - if (projectile.velocity.X < 0f) - { - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X); - } - else - { - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X); - } + projectile.rotation = projectile.velocity.ToRotation(); CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 250f, 13f, 25f); - } + } - public override void Kill(int timeLeft) - { - Main.PlaySound(SoundID.Item10, projectile.position); - for (int k = 0; k < 3; k++) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, ModContent.DustType(), 0f, 0f); + public override void Kill(int timeLeft) + { + Main.PlaySound(SoundID.Item10, projectile.position); + for (int k = 0; k < 3; k++) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, ModContent.DustType(), 0f, 0f); Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, ModContent.DustType(), 0f, 0f); } - } + } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(ModContent.BuffType(), 180); - } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 180); + } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); - return false; - } - } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + } } diff --git a/Projectiles/Magic/Climax2.cs b/Projectiles/Magic/Climax2.cs index 52e15ca516..1eedb8acfa 100644 --- a/Projectiles/Magic/Climax2.cs +++ b/Projectiles/Magic/Climax2.cs @@ -32,8 +32,8 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { timeElapsed += 0.02; - projectile.velocity.X = (float)(Math.Sin(timeElapsed * (double)(0.5f * projectile.ai[0])) * circleSize); - projectile.velocity.Y = (float)(Math.Cos(timeElapsed * (double)(0.5f * projectile.ai[0])) * circleSize); + projectile.velocity.X = (float)(Math.Sin(timeElapsed * (0.5f * projectile.ai[0])) * circleSize); + projectile.velocity.Y = (float)(Math.Cos(timeElapsed * (0.5f * projectile.ai[0])) * circleSize); circleSize += circleGrowth; if (projectile.velocity.X > 0f) @@ -56,14 +56,14 @@ namespace CalamityMod.Projectiles.Magic } } - CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 300f, 8f, 4f, 5, ModContent.ProjectileType()); + CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 300f, 8f, 4f, 2, ModContent.ProjectileType(), 1D, true); } public override Color? GetAlpha(Color lightColor) { if (projectile.timeLeft < 30) { - float num7 = (float)projectile.timeLeft / 30f; + float num7 = projectile.timeLeft / 30f; projectile.alpha = (int)(255f - 255f * num7); } return new Color(255 - projectile.alpha, 255 - projectile.alpha, 255 - projectile.alpha, 0); @@ -74,7 +74,7 @@ namespace CalamityMod.Projectiles.Magic Texture2D texture2D13 = Main.projectileTexture[projectile.type]; int num214 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; int y6 = num214 * projectile.frame; - Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), projectile.scale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2(texture2D13.Width / 2f, num214 / 2f), projectile.scale, SpriteEffects.None, 0f); return false; } diff --git a/Projectiles/Magic/ClimaxProj.cs b/Projectiles/Magic/ClimaxProj.cs index 4260c256a8..fc81a69681 100644 --- a/Projectiles/Magic/ClimaxProj.cs +++ b/Projectiles/Magic/ClimaxProj.cs @@ -50,14 +50,14 @@ namespace CalamityMod.Projectiles.Magic } if (projectile.timeLeft % 2 == projectile.ai[0]) - CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 400f, 8f, 4f, 5, ModContent.ProjectileType()); + CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 400f, 8f, 4f, 2, ModContent.ProjectileType(), 1D, true); } public override Color? GetAlpha(Color lightColor) { if (projectile.timeLeft < 30) { - float num7 = (float)projectile.timeLeft / 30f; + float num7 = projectile.timeLeft / 30f; projectile.alpha = (int)(255f - 255f * num7); } return new Color(255 - projectile.alpha, 255 - projectile.alpha, 255 - projectile.alpha, 0); @@ -68,7 +68,7 @@ namespace CalamityMod.Projectiles.Magic Texture2D texture2D13 = Main.projectileTexture[projectile.type]; int num214 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; int y6 = num214 * projectile.frame; - Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), projectile.scale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2(texture2D13.Width / 2f, num214 / 2f), projectile.scale, SpriteEffects.None, 0f); return false; } diff --git a/Projectiles/Magic/FabOrb.cs b/Projectiles/Magic/FabOrb.cs index 4d13216330..140dacc724 100644 --- a/Projectiles/Magic/FabOrb.cs +++ b/Projectiles/Magic/FabOrb.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { - CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 150f, 6f, 6f, 2, ModContent.ProjectileType()); + CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 150f, 6f, 6f, 2, ModContent.ProjectileType(), 1D, true); } } } diff --git a/Projectiles/Magic/GranitePulse.cs b/Projectiles/Magic/GranitePulse.cs index c085cb6789..6ca7cb8d9a 100644 --- a/Projectiles/Magic/GranitePulse.cs +++ b/Projectiles/Magic/GranitePulse.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Projectiles.Magic { public class GranitePulse : ModProjectile { - public float count = 0f; + public bool initialized = false; public override void SetStaticDefaults() { @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { - projectile.velocity = new Vector2(0f, (float)Math.Sin((double)(6.28318548f * projectile.ai[0] / 300f)) * 0.5f); + projectile.velocity = new Vector2(0f, (float)Math.Sin((double)(MathHelper.TwoPi * projectile.ai[0] / 300f)) * 0.5f); projectile.ai[0] += 1f; if (projectile.ai[0] >= 300f) { @@ -62,84 +62,75 @@ namespace CalamityMod.Projectiles.Magic if (projectile.localAI[0] >= 10f) { projectile.localAI[0] = 0f; - int num416 = 0; - int num417 = 0; - float num418 = 0f; - int num419 = projectile.type; - for (int num420 = 0; num420 < Main.maxProjectiles; num420++) + int projCount = 0; + int index = 0; + float findOldest = 0f; + int projType = projectile.type; + for (int i = 0; i < Main.maxProjectiles; i++) { - if (Main.projectile[num420].active && Main.projectile[num420].owner == projectile.owner && Main.projectile[num420].type == num419 && Main.projectile[num420].ai[1] < 3600f) + Projectile proj = Main.projectile[i]; + if (proj.active && proj.owner == projectile.owner && proj.type == projType && proj.ai[1] < 3600f) { - num416++; - if (Main.projectile[num420].ai[1] > num418) + projCount++; + if (proj.ai[1] > findOldest) { - num417 = num420; - num418 = Main.projectile[num420].ai[1]; + index = i; + findOldest = proj.ai[1]; } } } - if (num416 > 1) + if (projCount > 1) { - Main.projectile[num417].netUpdate = true; - Main.projectile[num417].ai[1] = 36000f; + Main.projectile[index].netUpdate = true; + Main.projectile[index].ai[1] = 36000f; return; } } - if (count == 0f) + if (!initialized) { - Main.PlaySound(SoundID.NPCHit53, projectile.position); - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); - projectile.width = 20; - projectile.height = 20; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - for (int num621 = 0; num621 < 5; num621++) + Main.PlaySound(SoundID.NPCHit53, projectile.Center); + CalamityGlobalProjectile.ExpandHitboxBy(projectile, 20); + for (int d = 0; d < 5; d++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 229, 0f, 0f, 100, default, 0.5f); - Main.dust[num622].velocity *= 3f; + int ecto = Dust.NewDust(projectile.position, projectile.width, projectile.height, 229, 0f, 0f, 100, default, 0.5f); + Main.dust[ecto].velocity *= 3f; if (Main.rand.NextBool(2)) { - Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[ecto].scale = 0.5f; + Main.dust[ecto].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; } } - for (int num623 = 0; num623 < 10; num623++) + for (int d = 0; d < 10; d++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 206, 0f, 0f, 100, default, 1f); - Main.dust[num624].noGravity = true; - Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 206, 0f, 0f, 100, default, 0.5f); - Main.dust[num624].velocity *= 2f; + int ecto = Dust.NewDust(projectile.position, projectile.width, projectile.height, 206, 0f, 0f, 100, default, 1f); + Main.dust[ecto].noGravity = true; + Main.dust[ecto].velocity *= 5f; + ecto = Dust.NewDust(projectile.position, projectile.width, projectile.height, 206, 0f, 0f, 100, default, 0.5f); + Main.dust[ecto].velocity *= 2f; } - count += 1f; + initialized = true; } - if (projectile.timeLeft % 50 == 49) + if (projectile.timeLeft % 50 == 1 && projectile.alpha <= 0) { - Main.PlaySound(SoundID.NPCHit53, projectile.position); - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); - projectile.width = 20; - projectile.height = 20; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - for (int num621 = 0; num621 < 5; num621++) + Main.PlaySound(SoundID.NPCHit53, projectile.Center); + CalamityGlobalProjectile.ExpandHitboxBy(projectile, 20); + for (int d = 0; d < 5; d++) { - int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 229, 0f, 0f, 100, default, 0.5f); - Main.dust[num622].velocity *= 3f; + int ecto = Dust.NewDust(projectile.position, projectile.width, projectile.height, 229, 0f, 0f, 100, default, 0.5f); + Main.dust[ecto].velocity *= 3f; if (Main.rand.NextBool(2)) { - Main.dust[num622].scale = 0.5f; - Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + Main.dust[ecto].scale = 0.5f; + Main.dust[ecto].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; } } - for (int num623 = 0; num623 < 10; num623++) + for (int d = 0; d < 10; d++) { - int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 206, 0f, 0f, 100, default, 1f); - Main.dust[num624].noGravity = true; - Main.dust[num624].velocity *= 5f; - num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 206, 0f, 0f, 100, default, 0.5f); - Main.dust[num624].velocity *= 2f; + int ecto = Dust.NewDust(projectile.position, projectile.width, projectile.height, 206, 0f, 0f, 100, default, 1f); + Main.dust[ecto].noGravity = true; + Main.dust[ecto].velocity *= 5f; + ecto = Dust.NewDust(projectile.position, projectile.width, projectile.height, 206, 0f, 0f, 100, default, 0.5f); + Main.dust[ecto].velocity *= 2f; } float spread = 45f * 0.0174f; double startAngle = Math.Atan2(projectile.velocity.X, projectile.velocity.Y) - spread / 2; @@ -165,7 +156,7 @@ namespace CalamityMod.Projectiles.Magic SpriteEffects spriteEffects = SpriteEffects.None; if (projectile.spriteDirection == -1) spriteEffects = SpriteEffects.FlipHorizontally; - Main.spriteBatch.Draw(texture, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, frameHeight, texture.Width, height)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture.Width / 2f, (float)height / 2f), projectile.scale, spriteEffects, 0f); + Main.spriteBatch.Draw(texture, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, frameHeight, texture.Width, height)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2(texture.Width / 2f, height / 2f), projectile.scale, spriteEffects, 0f); return false; } diff --git a/Projectiles/Magic/MagneticOrb.cs b/Projectiles/Magic/MagneticOrb.cs index 6d34c01a26..86f9056fe1 100644 --- a/Projectiles/Magic/MagneticOrb.cs +++ b/Projectiles/Magic/MagneticOrb.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Magic } } - CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 400f, 8f, 4f, 5, ModContent.ProjectileType()); + CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 400f, 8f, 4f, 2, ModContent.ProjectileType(), 1D, true); } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Pets/SirenYoung.cs b/Projectiles/Pets/SirenYoung.cs index ea4a75c9bf..70bd66a006 100644 --- a/Projectiles/Pets/SirenYoung.cs +++ b/Projectiles/Pets/SirenYoung.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Projectiles.Pets public override void SetStaticDefaults() { - DisplayName.SetDefault("Siren"); + DisplayName.SetDefault("Ocean Spirit"); Main.projFrames[projectile.type] = 17; Main.projPet[projectile.type] = true; ProjectileID.Sets.LightPet[projectile.type] = true; diff --git a/Projectiles/Ranged/CosmicFire.cs b/Projectiles/Ranged/CosmicFire.cs index 5b3dccc63a..a55ec15ef8 100644 --- a/Projectiles/Ranged/CosmicFire.cs +++ b/Projectiles/Ranged/CosmicFire.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Projectiles.Ranged public override void SetDefaults() { - projectile.width = 6; - projectile.height = 6; + projectile.width = 10; + projectile.height = 10; projectile.friendly = true; projectile.ignoreWater = true; projectile.ranged = true; @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Ranged scalar = 0.75f; } projectile.ai[0] += 1f; - int dustType = 62; + int dustType = Main.rand.NextBool(4) ? 61 : 62; if (Main.rand.NextBool(2)) { int fire = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 1f); diff --git a/Projectiles/Rogue/BallisticPoisonBombProj.cs b/Projectiles/Rogue/BallisticPoisonBombProj.cs index 9e5f0b8ab0..d6e9dbf72b 100644 --- a/Projectiles/Rogue/BallisticPoisonBombProj.cs +++ b/Projectiles/Rogue/BallisticPoisonBombProj.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Rogue { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 14, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); } - projectile.StickToTiles(); + projectile.StickToTiles(true, false); if (projectile.owner == Main.myPlayer && projectile.timeLeft <= 3) { projectile.tileCollide = false; @@ -72,7 +72,7 @@ namespace CalamityMod.Projectiles.Rogue int cloudAmt = Main.rand.Next(8, 13); for (int c = 0; c < cloudAmt; c++) { - Vector2 velocity = CalamityUtils.RandomVelocity(100f, 10f, 200f); + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 10f, 200f, 0.01f); Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.25), 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); } } diff --git a/Projectiles/Rogue/EclipsesFallMain.cs b/Projectiles/Rogue/EclipsesFallMain.cs index bbe31e0aee..94dfe345b5 100644 --- a/Projectiles/Rogue/EclipsesFallMain.cs +++ b/Projectiles/Rogue/EclipsesFallMain.cs @@ -7,63 +7,64 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - public class EclipsesFallMain : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Eclipse's Fall"); - ProjectileID.Sets.TrailCacheLength[projectile.type] = 6; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - } + public class EclipsesFallMain : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Eclipse's Fall"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 6; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } - public override void SetDefaults() - { - projectile.width = 26; - projectile.height = 26; - projectile.friendly = true; - projectile.penetrate = -1; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 10; - projectile.extraUpdates = 1; - projectile.ignoreWater = true; - projectile.tileCollide = false; - projectile.timeLeft = 300; - projectile.Calamity().rogue = true; - } + public override void SetDefaults() + { + projectile.width = 26; + projectile.height = 26; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + projectile.extraUpdates = 1; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.timeLeft = 300; + projectile.Calamity().rogue = true; + } - public override void AI() - { - if (Main.rand.NextBool(8)) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 138, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); - } - projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver4; - } + public override void AI() + { + if (Main.rand.NextBool(8)) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 138, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); + } + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver4; + } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { SpawnSpears(target.Center); - } + } - public override void OnHitPvp(Player target, int damage, bool crit) - { + public override void OnHitPvp(Player target, int damage, bool crit) + { SpawnSpears(target.Center); - } + } private void SpawnSpears(Vector2 targetPos) { - for (int n = 0; n < Main.rand.Next(3, 6); n++) //3 to 5 spears - { + int spearAmt = Main.rand.Next(3, 6); //3 to 5 spears + for (int n = 0; n < spearAmt; n++) + { float dmgMult = 0.08f * Main.rand.NextFloat(4f, 7f); float kBMult = 0.1f * Main.rand.NextFloat(7f, 10f); CalamityUtils.ProjectileRain(targetPos, 400f, 100f, 500f, 800f, 29f, ModContent.ProjectileType(), (int)(projectile.damage * dmgMult), projectile.knockBack * kBMult, projectile.owner); - } + } } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); - return false; - } - } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + } } diff --git a/Projectiles/Rogue/NastyChollaBol.cs b/Projectiles/Rogue/NastyChollaBol.cs index 4602066ee9..65724c1574 100644 --- a/Projectiles/Rogue/NastyChollaBol.cs +++ b/Projectiles/Rogue/NastyChollaBol.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.StickyProjAI(15); if (projectile.ai[0] != 1f) { - projectile.StickToTiles(); + projectile.StickToTiles(true, false); projectile.localAI[1] += 1f; if (projectile.localAI[1] > 10f) { diff --git a/Projectiles/Rogue/ScourgeoftheSeasProjectile.cs b/Projectiles/Rogue/ScourgeoftheSeasProjectile.cs index f2563bde7e..33a18cf336 100644 --- a/Projectiles/Rogue/ScourgeoftheSeasProjectile.cs +++ b/Projectiles/Rogue/ScourgeoftheSeasProjectile.cs @@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Rogue Main.PlaySound(SoundID.Item14, projectile.position); for (int dustIndex = 0; dustIndex < 8; dustIndex++) { - int dusty = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 85, 0f, 0f, 100, default, 1f); + int dusty = Dust.NewDust(projectile.position, projectile.width, projectile.height, 85, 0f, 0f, 100, default, 1f); Main.dust[dusty].velocity *= 1f; } if (projectile.owner == Main.myPlayer) @@ -74,9 +74,7 @@ namespace CalamityMod.Projectiles.Rogue int cloudNumber = Main.rand.Next(2, 6); for (int cloudIndex = 0; cloudIndex < cloudNumber; cloudIndex++) { - Vector2 velocity = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - velocity.Normalize(); - velocity *= (float)Main.rand.Next(10, 201) * 0.01f; + Vector2 velocity = CalamityUtils.RandomVelocity(100f, 10f, 200f, 0.01f); Projectile.NewProjectile(projectile.Center, velocity, ModContent.ProjectileType(), (int)(projectile.damage * 0.25), 1f, projectile.owner, 0f, projectile.Calamity().stealthStrike ? 1f : 0f); } } diff --git a/Projectiles/Rogue/StickyBol.cs b/Projectiles/Rogue/StickyBol.cs index e3a95f9cba..13627e9af6 100644 --- a/Projectiles/Rogue/StickyBol.cs +++ b/Projectiles/Rogue/StickyBol.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.StickyProjAI(10); if (projectile.ai[0] != 1f) { - projectile.StickToTiles(); + projectile.StickToTiles(true, false); projectile.localAI[1] += 1f; if (projectile.localAI[1] > 10f) { diff --git a/Projectiles/Summon/BrimstoneElementalMinion.cs b/Projectiles/Summon/BrimstoneElementalMinion.cs index 258574dd22..5b45e67e2d 100644 --- a/Projectiles/Summon/BrimstoneElementalMinion.cs +++ b/Projectiles/Summon/BrimstoneElementalMinion.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { - DisplayName.SetDefault("Big Busty Rose"); + DisplayName.SetDefault("Brimstone Elemental"); Main.projFrames[projectile.type] = 4; ProjectileID.Sets.MinionSacrificable[projectile.type] = true; ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; diff --git a/Projectiles/Summon/Hive.cs b/Projectiles/Summon/Hive.cs index ee8779e206..9ff8667a41 100644 --- a/Projectiles/Summon/Hive.cs +++ b/Projectiles/Summon/Hive.cs @@ -59,6 +59,8 @@ namespace CalamityMod.Projectiles.Summon projectile.velocity.Y = 10f; } + projectile.StickToTiles(false, false); + int target = 0; float num633 = 800f; Vector2 vector46 = projectile.position; @@ -112,18 +114,8 @@ namespace CalamityMod.Projectiles.Summon } } - public override bool OnTileCollide(Vector2 oldVelocity) - { - if (projectile.penetrate == 0) - { - projectile.Kill(); - } - return false; - } + public override bool OnTileCollide(Vector2 oldVelocity) => false; - public override bool CanDamage() - { - return false; - } + public override bool CanDamage() => false; } } diff --git a/Projectiles/Summon/MiniSandShark.cs b/Projectiles/Summon/MiniSandShark.cs index 6add2fa1fc..a48187bf90 100644 --- a/Projectiles/Summon/MiniSandShark.cs +++ b/Projectiles/Summon/MiniSandShark.cs @@ -59,10 +59,8 @@ namespace CalamityMod.Projectiles.Summon public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { SpriteEffects spriteEffects = projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; - Texture2D texture2D13 = Main.projectileTexture[projectile.type]; - int num214 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type]; - int y6 = num214 * projectile.frame; - Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), projectile.scale, spriteEffects, 0f); + Texture2D texture = Main.projectileTexture[projectile.type]; + Main.spriteBatch.Draw(texture, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, 0, texture.Width, texture.Height)), projectile.GetAlpha(lightColor), projectile.rotation, texture.Size() / 2f, projectile.scale, spriteEffects, 0f); return false; } diff --git a/Projectiles/Summon/OldDukeHeadCorpse.cs b/Projectiles/Summon/OldDukeHeadCorpse.cs index c46a72e220..1b8c893917 100644 --- a/Projectiles/Summon/OldDukeHeadCorpse.cs +++ b/Projectiles/Summon/OldDukeHeadCorpse.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Summon player.MinionDamage()); projectile.damage = trueDamage; } - NPC target = projectile.Center.MinionHoming(845f, player); + NPC target = projectile.Center.MinionHoming(845f, player, false); // No sense in targeting something below this sentry. if (target != null) { @@ -72,6 +72,8 @@ namespace CalamityMod.Projectiles.Summon { projectile.velocity.Y = 10f; } + + projectile.StickToTiles(false, false); } public override bool CanDamage() => false; diff --git a/Projectiles/Summon/OldDukeSharkVomit.cs b/Projectiles/Summon/OldDukeSharkVomit.cs index 3d74d06225..83bb554838 100644 --- a/Projectiles/Summon/OldDukeSharkVomit.cs +++ b/Projectiles/Summon/OldDukeSharkVomit.cs @@ -1,5 +1,7 @@ using CalamityMod.Dusts; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -34,7 +36,16 @@ namespace CalamityMod.Projectiles.Summon projectile.alpha = 255 - (int)(255 * projectile.ai[0] / 10f); } projectile.velocity.Y += 0.2f; - projectile.rotation = projectile.velocity.ToRotation(); + if (projectile.velocity.X < 0f) + { + projectile.spriteDirection = -1; + projectile.rotation = (float)Math.Atan2((double)-(double)projectile.velocity.Y, (double)-(double)projectile.velocity.X); + } + else + { + projectile.spriteDirection = 1; + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X); + } //Homing if (projectile.ai[0] > 20f) HomingAI(); @@ -52,7 +63,7 @@ namespace CalamityMod.Projectiles.Summon if (npc.CanBeChasedBy(projectile, false)) { float dist = (projectile.Center - npc.Center).Length(); - if (dist < maxHomingRange) + if (dist < maxHomingRange && Collision.CanHit(projectile.Center, projectile.width, projectile.height, npc.Center, npc.width, npc.height)) { targetIdx = player.MinionAttackTargetNPC; maxHomingRange = dist; @@ -60,18 +71,18 @@ namespace CalamityMod.Projectiles.Summon } } } - else + if (!hasHomingTarget) { for (int i = 0; i < Main.npc.Length; ++i) { NPC npc = Main.npc[i]; - if (npc == null || !npc.active) + if (npc is null || !npc.active) continue; if (npc.CanBeChasedBy(projectile, false)) { float dist = (projectile.Center - npc.Center).Length(); - if (dist < maxHomingRange) + if (dist < maxHomingRange && Collision.CanHit(projectile.Center, projectile.width, projectile.height, npc.Center, npc.width, npc.height)) { targetIdx = i; maxHomingRange = dist; @@ -91,6 +102,14 @@ namespace CalamityMod.Projectiles.Summon } } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + SpriteEffects spriteEffects = projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + Texture2D texture = Main.projectileTexture[projectile.type]; + Main.spriteBatch.Draw(texture, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, 0, texture.Width, texture.Height)), projectile.GetAlpha(lightColor), projectile.rotation, texture.Size() / 2f, projectile.scale, spriteEffects, 0f); + return false; + } + public override void Kill(int timeLeft) { for (int i = 0; i < Main.rand.Next(28, 41); i++) diff --git a/Projectiles/Summon/RadiantResolutionAura.cs b/Projectiles/Summon/RadiantResolutionAura.cs index 689d7c6820..718b0202de 100644 --- a/Projectiles/Summon/RadiantResolutionAura.cs +++ b/Projectiles/Summon/RadiantResolutionAura.cs @@ -72,7 +72,16 @@ namespace CalamityMod.Projectiles.Summon float allocatedSlots = projectile.ai[0]; projectile.rotation += MathHelper.ToRadians(3f) + MathHelper.ToRadians(allocatedSlots * 0.85f); - int radiantOrbDamage = (int)(projectile.damage * (Math.Log(allocatedSlots, 2.5) + 1f)); + float damageMult = (float)Math.Log(allocatedSlots, 3) + 1f; + + //Softcap the mult after 9 slots + float newMult = damageMult; + if (newMult > 3f) + { + newMult = ((damageMult - 3f) * 0.1f) + 3f; + } + + int radiantOrbDamage = (int)(projectile.damage * newMult); int radiantOrbAppearRate = (int)(130 * Math.Pow(0.9, allocatedSlots)); if (radiantOrbAppearRate < 7) diff --git a/Projectiles/Summon/Shellfish.cs b/Projectiles/Summon/Shellfish.cs index 06b00ba9bb..6143ba4ff0 100644 --- a/Projectiles/Summon/Shellfish.cs +++ b/Projectiles/Summon/Shellfish.cs @@ -60,9 +60,17 @@ namespace CalamityMod.Projectiles.Summon } spawnDust = false; } - bool flag64 = projectile.type == ModContent.ProjectileType(); + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) + { + int damage2 = (int)((float)modProj.spawnedPlayerMinionProjectileDamageValue / + modProj.spawnedPlayerMinionDamageValue * + player.MinionDamage()); + projectile.damage = damage2; + } + + bool correctMinion = projectile.type == ModContent.ProjectileType(); player.AddBuff(ModContent.BuffType(), 3600); - if (flag64) + if (correctMinion) { if (player.dead) { @@ -73,6 +81,7 @@ namespace CalamityMod.Projectiles.Summon projectile.timeLeft = 2; } } + projectile.frameCounter++; if (projectile.frameCounter > 3) { @@ -83,19 +92,10 @@ namespace CalamityMod.Projectiles.Summon { projectile.frame = 0; } + if (projectile.ai[0] == 0f) { - //lineColor == 1 means it is spawned from Mollusk Armor rather than the weapon - projectile.damage = (int)((modProj.lineColor == 1 ? 140f : 70f) * player.MinionDamage()); - if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) - { - int damage2 = (int)((float)modProj.spawnedPlayerMinionProjectileDamageValue / - modProj.spawnedPlayerMinionDamageValue * - player.MinionDamage()); - projectile.damage = damage2; - } projectile.ai[1] += 1f; - Vector2 vector46 = projectile.position; if (!fly) { projectile.tileCollide = true; @@ -104,7 +104,7 @@ namespace CalamityMod.Projectiles.Summon float playerDistance = vector48.Length(); if (projectile.velocity.Y == 0f && (projectile.velocity.X != 0f || playerDistance > 200f)) { - switch (Main.rand.Next(1, 3)) + switch (Main.rand.Next(1, 4)) { case 1: @@ -121,7 +121,7 @@ namespace CalamityMod.Projectiles.Summon } } projectile.velocity.Y += 0.3f; - float num633 = 1000f; + float maxDistance = 1000f; bool chaseNPC = false; float npcPositionX = 0f; if (player.HasMinionAttackTargetNPC) @@ -129,29 +129,25 @@ namespace CalamityMod.Projectiles.Summon NPC npc = Main.npc[player.MinionAttackTargetNPC]; if (npc.CanBeChasedBy(projectile, false)) { - float num646 = Vector2.Distance(npc.Center, projectile.Center); - if (!chaseNPC && num646 < num633) + float npcDist = Vector2.Distance(npc.Center, projectile.Center); + if (!chaseNPC && npcDist < maxDistance) { - num633 = num646; - vector46 = npc.Center; - npcPositionX = npc.position.X; + npcPositionX = npc.Center.X; chaseNPC = true; } } } if (!chaseNPC) { - for (int num645 = 0; num645 < Main.maxNPCs; num645++) + for (int index = 0; index < Main.maxNPCs; index++) { - NPC npcTarget = Main.npc[num645]; + NPC npcTarget = Main.npc[index]; if (npcTarget.CanBeChasedBy(projectile, false)) { - float num646 = Vector2.Distance(npcTarget.Center, projectile.Center); - if (!chaseNPC && num646 < num633) + float npcDist = Vector2.Distance(npcTarget.Center, projectile.Center); + if (!chaseNPC && npcDist < maxDistance) { - num633 = num646; - vector46 = npcTarget.Center; - npcPositionX = npcTarget.position.X; + npcPositionX = npcTarget.Center.X; chaseNPC = true; } } @@ -211,7 +207,7 @@ namespace CalamityMod.Projectiles.Summon { if (player.position.X - projectile.position.X > 0f) { - switch (Main.rand.Next(1, 3)) + switch (Main.rand.Next(1, 4)) { case 1: projectile.velocity.X += 0.05f; @@ -233,7 +229,7 @@ namespace CalamityMod.Projectiles.Summon } else { - switch (Main.rand.Next(1, 3)) + switch (Main.rand.Next(1, 4)) { case 1: projectile.velocity.X -= 0.05f; @@ -260,7 +256,7 @@ namespace CalamityMod.Projectiles.Summon { if (projectile.velocity.X > 0.5f) { - switch (Main.rand.Next(1, 3)) + switch (Main.rand.Next(1, 4)) { case 1: projectile.velocity.X -= 0.05f; @@ -277,7 +273,7 @@ namespace CalamityMod.Projectiles.Summon } else if (projectile.velocity.X < -0.5f) { - switch (Main.rand.Next(1, 3)) + switch (Main.rand.Next(1, 4)) { case 1: projectile.velocity.X += 0.05f; @@ -302,12 +298,11 @@ namespace CalamityMod.Projectiles.Summon } else if (fly) { - Vector2 center2 = projectile.Center; - Vector2 vector48 = player.Center - center2 + new Vector2(0f, 0f); - float playerDistance = vector48.Length(); - vector48.Normalize(); - vector48 *= 14f; - projectile.velocity = (projectile.velocity * 40f + vector48) / 41f; + Vector2 playerVec = player.Center - projectile.Center + new Vector2(0f, 0f); + float playerDistance = playerVec.Length(); + playerVec.Normalize(); + playerVec *= 14f; + projectile.velocity = (projectile.velocity * 40f + playerVec) / 41f; projectile.rotation = projectile.velocity.X * 0.03f; if (playerDistance > 1500f) @@ -336,11 +331,11 @@ namespace CalamityMod.Projectiles.Summon } } } - if ((double)projectile.velocity.X > 0.25) + if (projectile.velocity.X > 0.25f) { projectile.spriteDirection = -1; } - else if ((double)projectile.velocity.X < -0.25) + else if (projectile.velocity.X < -0.25f) { projectile.spriteDirection = 1; } @@ -349,37 +344,36 @@ namespace CalamityMod.Projectiles.Summon { projectile.rotation = 0; projectile.tileCollide = false; - int num988 = 10; - bool flag54 = false; - bool flag55 = false; + bool breakAway = false; + bool spawnDust = false; projectile.localAI[0] += 1f; if (projectile.localAI[0] % 30f == 0f) { - flag55 = true; + spawnDust = true; } - int num989 = (int)projectile.ai[1]; - if (projectile.localAI[0] >= (float)(60000 * num988)) //tryna make it stay on there "forever" without glitching + int npcIndex = (int)projectile.ai[1]; + if (projectile.localAI[0] >= 600000f) //tryna make it stay on there "forever" without glitching { - flag54 = true; + breakAway = true; } - else if (num989 < 0 || num989 >= Main.maxNPCs) + else if (npcIndex < 0 || npcIndex >= Main.maxNPCs) { - flag54 = true; + breakAway = true; } - else if (Main.npc[num989].active && !Main.npc[num989].dontTakeDamage && Main.npc[num989].defense < 9999) + else if (Main.npc[npcIndex].active && !Main.npc[npcIndex].dontTakeDamage && Main.npc[npcIndex].defense < 9999) { - projectile.Center = Main.npc[num989].Center - projectile.velocity * 2f; - projectile.gfxOffY = Main.npc[num989].gfxOffY; - if (flag55) + projectile.Center = Main.npc[npcIndex].Center - projectile.velocity * 2f; + projectile.gfxOffY = Main.npc[npcIndex].gfxOffY; + if (spawnDust) { - Main.npc[num989].HitEffect(0, 1.0); + Main.npc[npcIndex].HitEffect(0, 1.0); } } else { - flag54 = true; + breakAway = true; } - if (flag54) + if (breakAway) { projectile.ai[0] = 0f; projectile.velocity.X = 0f; @@ -390,60 +384,71 @@ namespace CalamityMod.Projectiles.Summon public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { + Player player = Main.player[projectile.owner]; Rectangle myRect = new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height); + if (projectile.owner == Main.myPlayer) { - for (int i = 0; i < Main.maxNPCs; i++) + for (int npcIndex = 0; npcIndex < Main.maxNPCs; npcIndex++) { - if (Main.npc[i].active && !Main.npc[i].dontTakeDamage && Main.npc[i].defense < 9999 && - ((projectile.friendly && (!Main.npc[i].friendly || projectile.type == 318 || (Main.npc[i].type == NPCID.Guide && projectile.owner < 255 && Main.player[projectile.owner].killGuide) || (Main.npc[i].type == NPCID.Clothier && projectile.owner < 255 && Main.player[projectile.owner].killClothier))) || - (projectile.hostile && Main.npc[i].friendly && !Main.npc[i].dontTakeDamageFromHostiles)) && (projectile.owner < 0 || Main.npc[i].immune[projectile.owner] == 0 || projectile.maxPenetrate == 1)) + NPC npc = Main.npc[npcIndex]; + //covers most edge cases like voodoo dolls + if (npc.active && !npc.dontTakeDamage && npc.defense < 9999 && + ((projectile.friendly && (!npc.friendly || (npc.type == NPCID.Guide && projectile.owner < Main.maxPlayers && player.killGuide) || (npc.type == NPCID.Clothier && projectile.owner < Main.maxPlayers && player.killClothier))) || + (projectile.hostile && npc.friendly && !npc.dontTakeDamageFromHostiles)) && (projectile.owner < 0 || npc.immune[projectile.owner] == 0 || projectile.maxPenetrate == 1)) { - if (Main.npc[i].noTileCollide || !projectile.ownerHitCheck || projectile.CanHit(Main.npc[i])) + if (npc.noTileCollide || !projectile.ownerHitCheck || projectile.CanHit(npc)) { - bool flag3; - if (Main.npc[i].type == NPCID.SolarCrawltipedeTail) + bool stickingToNPC; + //Solar Crawltipede tail has special collision + if (npc.type == NPCID.SolarCrawltipedeTail) { - Rectangle rect = Main.npc[i].getRect(); + Rectangle rect = npc.getRect(); int num5 = 8; rect.X -= num5; rect.Y -= num5; rect.Width += num5 * 2; rect.Height += num5 * 2; - flag3 = projectile.Colliding(myRect, rect); + stickingToNPC = projectile.Colliding(myRect, rect); } else { - flag3 = projectile.Colliding(myRect, Main.npc[i].getRect()); + stickingToNPC = projectile.Colliding(myRect, npc.getRect()); } - if (flag3) + if (stickingToNPC) { - if (Main.npc[i].reflectingProjectiles && projectile.CanReflect()) + //reflect projectile if the npc can reflect it (like Selenians) + if (npc.reflectingProjectiles && projectile.CanReflect()) { - Main.npc[i].ReflectProjectile(projectile.whoAmI); + npc.ReflectProjectile(projectile.whoAmI); return; } + + //let the projectile know it is sticking and the npc it is sticking too projectile.ai[0] = 1f; - projectile.ai[1] = (float)i; - projectile.velocity = (Main.npc[i].Center - projectile.Center) * 0.75f; + projectile.ai[1] = (float)npcIndex; + + //follow the NPC + projectile.velocity = (npc.Center - projectile.Center) * 0.75f; + projectile.netUpdate = true; - projectile.StatusNPC(i); - projectile.damage = 0; - int num28 = 10; - Point[] array2 = new Point[num28]; - int num29 = 0; - for (int l = 0; l < Main.projectile.Length; l++) + + //Count how many projectiles are attached, delete as necessary + Point[] array2 = new Point[10]; + int projCount = 0; + for (int projIndex = 0; projIndex < Main.maxProjectiles; projIndex++) { - if (l != projectile.whoAmI && Main.projectile[l].active && Main.projectile[l].owner == Main.myPlayer && Main.projectile[l].type == projectile.type && Main.projectile[l].ai[0] == 1f && Main.projectile[l].ai[1] == (float)i) + Projectile proj = Main.projectile[projIndex]; + if (projIndex != projectile.whoAmI && proj.active && proj.owner == Main.myPlayer && proj.type == projectile.type && proj.ai[0] == 1f && proj.ai[1] == (float)npcIndex) { - array2[num29++] = new Point(l, Main.projectile[l].timeLeft); - if (num29 >= array2.Length) + array2[projCount++] = new Point(projIndex, proj.timeLeft); + if (projCount >= array2.Length) { break; } } } - if (num29 >= array2.Length) + if (projCount >= array2.Length) { int num30 = 0; for (int m = 1; m < array2.Length; m++) @@ -471,14 +476,7 @@ namespace CalamityMod.Projectiles.Summon return null; } - public override bool OnTileCollide(Vector2 oldVelocity) - { - if (projectile.penetrate == 0) - { - projectile.Kill(); - } - return false; - } + public override bool CanDamage() => projectile.ai[0] == 0f; public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { diff --git a/Projectiles/Summon/SiriusMinion.cs b/Projectiles/Summon/SiriusMinion.cs index bbf4898f32..a90ae92670 100644 --- a/Projectiles/Summon/SiriusMinion.cs +++ b/Projectiles/Summon/SiriusMinion.cs @@ -7,117 +7,117 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class SiriusMinion : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sirius"); - ProjectileID.Sets.MinionSacrificable[projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; - } + public class SiriusMinion : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sirius"); + ProjectileID.Sets.MinionSacrificable[projectile.type] = true; + ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; + } - public override void SetDefaults() - { - projectile.width = 38; - projectile.height = 48; - projectile.netImportant = true; - projectile.friendly = true; - projectile.ignoreWater = true; - projectile.minionSlots = 1f; - projectile.timeLeft = 18000; - projectile.penetrate = -1; - projectile.tileCollide = false; - projectile.timeLeft *= 5; - projectile.minion = true; - } + public override void SetDefaults() + { + projectile.width = 38; + projectile.height = 48; + projectile.netImportant = true; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.minionSlots = 1f; + projectile.timeLeft = 18000; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.timeLeft *= 5; + projectile.minion = true; + } - public override void AI() - { - Player player = Main.player[projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); + public override void AI() + { + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); - bool correctMinion = projectile.type == ModContent.ProjectileType(); - if (correctMinion) - { - if (player.dead) - { - modPlayer.sirius = false; - } - if (modPlayer.sirius) - { - projectile.timeLeft = 2; - } - } - player.AddBuff(ModContent.BuffType(), 3600); + bool correctMinion = projectile.type == ModContent.ProjectileType(); + if (correctMinion) + { + if (player.dead) + { + modPlayer.sirius = false; + } + if (modPlayer.sirius) + { + projectile.timeLeft = 2; + } + } + player.AddBuff(ModContent.BuffType(), 3600); - projectile.minionSlots = projectile.ai[0]; - Lighting.AddLight(projectile.Center, 1f, 0.5f, 5f); + projectile.minionSlots = projectile.ai[0]; + Lighting.AddLight(projectile.Center, 1f, 0.5f, 5f); - projectile.Center = player.Center + Vector2.UnitY * (player.gfxOffY - 60f); - if (player.gravDir == -1f) - { - projectile.position.Y += 120f; - projectile.rotation = MathHelper.Pi; - } - else - { - projectile.rotation = 0f; - } - projectile.position.X = (int)projectile.position.X; - projectile.position.Y = (int)projectile.position.Y; + projectile.Center = player.Center + Vector2.UnitY * (player.gfxOffY - 60f); + if (player.gravDir == -1f) + { + projectile.position.Y += 120f; + projectile.rotation = MathHelper.Pi; + } + else + { + projectile.rotation = 0f; + } + projectile.position.X = (int)projectile.position.X; + projectile.position.Y = (int)projectile.position.Y; - float scalar = (float)Main.mouseTextColor / 200f - 0.35f; - scalar *= 0.2f; - projectile.scale = scalar + 0.95f; + float scalar = (float)Main.mouseTextColor / 200f - 0.35f; + scalar *= 0.2f; + projectile.scale = scalar + 0.95f; - if (projectile.localAI[0] == 0f) - { - projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); - projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; - int dustAmt = 50; - for (int d = 0; d < dustAmt; d++) - { - int sirius = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 20, 0f, 0f, 0, default, 1f); - Main.dust[sirius].velocity *= 2f; - Main.dust[sirius].scale *= 1.15f; - } - projectile.localAI[0] += 1f; - } + if (projectile.localAI[0] == 0f) + { + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); + projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; + int dustAmt = 50; + for (int d = 0; d < dustAmt; d++) + { + int sirius = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 20, 0f, 0f, 0, default, 1f); + Main.dust[sirius].velocity *= 2f; + Main.dust[sirius].scale *= 1.15f; + } + projectile.localAI[0] += 1f; + } - if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) - { - int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / - projectile.Calamity().spawnedPlayerMinionDamageValue * player.MinionDamage()); - projectile.damage = damage2; - } - if (projectile.owner == Main.myPlayer) - { - if (projectile.ai[1] != 0f) - { - projectile.ai[1] -= 1f; - return; - } + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) + { + int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / + projectile.Calamity().spawnedPlayerMinionDamageValue * player.MinionDamage()); + projectile.damage = damage2; + } + if (projectile.owner == Main.myPlayer) + { + if (projectile.ai[1] != 0f) + { + projectile.ai[1] -= 1f; + return; + } Vector2 targetVec = projectile.position; - float maxDistance = 7000f; - bool hasTarget = false; - if (player.HasMinionAttackTargetNPC) - { - NPC npc = Main.npc[player.MinionAttackTargetNPC]; - if (npc.CanBeChasedBy(projectile, false)) - { + float maxDistance = 7000f; + bool hasTarget = false; + if (player.HasMinionAttackTargetNPC) + { + NPC npc = Main.npc[player.MinionAttackTargetNPC]; + if (npc.CanBeChasedBy(projectile, false)) + { float extraDistance = (npc.width / 2) + (npc.height / 2); if (Vector2.Distance(npc.Center, projectile.Center) < (maxDistance + extraDistance)) { targetVec = npc.Center; - hasTarget = true; - } - } - } - if (!hasTarget) - { - for (int i = 0; i < Main.maxNPCs; i++) - { + hasTarget = true; + } + } + } + if (!hasTarget) + { + for (int i = 0; i < Main.maxNPCs; i++) + { NPC npc = Main.npc[i]; if (npc.CanBeChasedBy(projectile, false)) { @@ -129,27 +129,27 @@ namespace CalamityMod.Projectiles.Summon hasTarget = true; } } - } - } - if (hasTarget) - { - float projSpeed = 15f; + } + } + if (hasTarget) + { + float projSpeed = 15f; Vector2 source = new Vector2(projectile.Center.X - 4f, projectile.Center.Y); Vector2 velocity = targetVec - projectile.Center; - float targetDist = velocity.Length(); - targetDist = projSpeed / targetDist; - velocity.X *= targetDist; - velocity.Y *= targetDist; + float targetDist = velocity.Length(); + targetDist = projSpeed / targetDist; + velocity.X *= targetDist; + velocity.Y *= targetDist; float damageMult = ((float)Math.Log(projectile.ai[0], MathHelper.E)) + 1f; - int beam = Projectile.NewProjectile(source, velocity, ModContent.ProjectileType(), (int)(projectile.damage * damageMult), projectile.knockBack, projectile.owner); + int beam = Projectile.NewProjectile(source, velocity, ModContent.ProjectileType(), (int)(projectile.damage * damageMult), projectile.knockBack, projectile.owner); Main.projectile[beam].penetrate = (int)projectile.ai[0]; - projectile.ai[1] = 30f; - } - } - } + projectile.ai[1] = 30f; + } + } + } - public override Color? GetAlpha(Color lightColor) => new Color(200, 200, 200, 200); + public override Color? GetAlpha(Color lightColor) => new Color(200, 200, 200, 200); - public override bool CanDamage() => false; - } + public override bool CanDamage() => false; + } } diff --git a/Projectiles/Summon/Spikecrag.cs b/Projectiles/Summon/Spikecrag.cs index c211265560..2d0a91b2c3 100644 --- a/Projectiles/Summon/Spikecrag.cs +++ b/Projectiles/Summon/Spikecrag.cs @@ -60,6 +60,8 @@ namespace CalamityMod.Projectiles.Summon projectile.velocity.Y = 10f; } + projectile.StickToTiles(false, false); + if (projectile.ai[0] > 0f) { projectile.ai[0] -= 1f; @@ -75,7 +77,7 @@ namespace CalamityMod.Projectiles.Summon { float extraDistance = (float)(Main.npc[i].width / 2) + (Main.npc[i].height / 2); - if (Vector2.Distance(Main.npc[i].Center, projectile.Center) < (maxDistance + extraDistance)) + if (Vector2.Distance(Main.npc[i].Center, projectile.Center) < (maxDistance + extraDistance) && Collision.CanHit(projectile.Center, projectile.width, projectile.height, Main.npc[i].Center, Main.npc[i].width, Main.npc[i].height)) { homeIn = true; break; diff --git a/Projectiles/Summon/Valkyrie.cs b/Projectiles/Summon/Valkyrie.cs index 0c492c0bc0..f2f17b540c 100644 --- a/Projectiles/Summon/Valkyrie.cs +++ b/Projectiles/Summon/Valkyrie.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Summon projectile.friendly = true; projectile.ignoreWater = true; projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 10; + projectile.localNPCHitCooldown = 20; projectile.minionSlots = 0f; projectile.timeLeft = 18000; projectile.penetrate = -1; diff --git a/Projectiles/Summon/VileFeederSummon.cs b/Projectiles/Summon/VileFeederSummon.cs index 01428ee118..c6b57bde79 100644 --- a/Projectiles/Summon/VileFeederSummon.cs +++ b/Projectiles/Summon/VileFeederSummon.cs @@ -10,70 +10,76 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { - public class VileFeederSummon : ModProjectile - { - private bool spawnDust = true; - private float attackCooldown = 0f; + public class VileFeederSummon : ModProjectile + { + private bool spawnDust = true; private int eaterCooldown = 0; - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Baby Eater"); - Main.projFrames[projectile.type] = 4; - ProjectileID.Sets.MinionSacrificable[projectile.type] = true; - ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Baby Eater"); + Main.projFrames[projectile.type] = 4; + ProjectileID.Sets.MinionSacrificable[projectile.type] = true; + ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; + } - public override void SetDefaults() - { - projectile.width = 30; - projectile.height = 30; - projectile.netImportant = true; - projectile.friendly = true; - projectile.ignoreWater = true; - projectile.minionSlots = 1f; - projectile.timeLeft = 18000; - projectile.penetrate = -1; - projectile.tileCollide = false; - projectile.timeLeft *= 5; - projectile.minion = true; - } + public override void SetDefaults() + { + projectile.width = projectile.height = 30; + projectile.netImportant = true; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.minionSlots = 1f; + projectile.timeLeft = 18000; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.timeLeft *= 5; + projectile.minion = true; + } - public override void AI() - { - Player player = Main.player[projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); + public override void AI() + { + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); - if (spawnDust) - { - projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); - projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; - int num226 = 36; - for (int num227 = 0; num227 < num226; num227++) - { - Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; - vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; - Vector2 vector7 = vector6 - projectile.Center; - int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 7, vector7.X * 1.75f, vector7.Y * 1.75f, 100, default, 1.1f); - Main.dust[num228].noGravity = true; - Main.dust[num228].velocity = vector7; - } - spawnDust = false; - } + if (spawnDust) + { + projectile.Calamity().lineColor = -1; + projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage(); + projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; + int dustAmt = 36; + for (int d = 0; d < dustAmt; d++) + { + Vector2 source = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; + source = source.RotatedBy((double)((float)(d - (dustAmt / 2 - 1)) * MathHelper.TwoPi / (float)dustAmt), default) + projectile.Center; + Vector2 dustVel = source - projectile.Center; + int num228 = Dust.NewDust(source + dustVel, 0, 0, 7, dustVel.X * 1.75f, dustVel.Y * 1.75f, 100, default, 1.1f); + Main.dust[num228].noGravity = true; + Main.dust[num228].velocity = dustVel; + } + spawnDust = false; + } + if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) + { + int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / + projectile.Calamity().spawnedPlayerMinionDamageValue * + player.MinionDamage()); + projectile.damage = damage2; + } - bool correctMinion = projectile.type == ModContent.ProjectileType(); - player.AddBuff(ModContent.BuffType(), 3600); - if (correctMinion) - { - if (player.dead) - { - modPlayer.vileFeeder = false; - } - if (modPlayer.vileFeeder) - { - projectile.timeLeft = 2; - } - } + bool correctMinion = projectile.type == ModContent.ProjectileType(); + player.AddBuff(ModContent.BuffType(), 3600); + if (correctMinion) + { + if (player.dead) + { + modPlayer.vileFeeder = false; + } + if (modPlayer.vileFeeder) + { + projectile.timeLeft = 2; + } + } if (eaterCooldown < 0) eaterCooldown = 0; @@ -82,15 +88,7 @@ namespace CalamityMod.Projectiles.Summon { if (eaterCooldown > 0) eaterCooldown--; - projectile.damage = (int)(VileFeeder.BaseDamage * player.MinionDamage()); - if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue) - { - int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / - projectile.Calamity().spawnedPlayerMinionDamageValue * - player.MinionDamage()); - projectile.damage = damage2; - } - projectile.MinionAntiClump(); + projectile.ChargingMinionAI(640f, 1100f, 2400f, 150f, 0, 40f, 8f, 4f, 40f, 8f, false, false); projectile.frameCounter++; if (projectile.frameCounter > 3) { @@ -102,199 +100,46 @@ namespace CalamityMod.Projectiles.Summon projectile.frame = 0; } projectile.rotation = projectile.velocity.ToRotation() + MathHelper.ToRadians(270); - - bool flag24 = false; - if (projectile.ai[0] == 2f) - { - attackCooldown += 1f; - projectile.extraUpdates = 1; - if (attackCooldown > 40f) - { - attackCooldown = 1f; - projectile.ai[0] = 0f; - projectile.extraUpdates = 0; - projectile.numUpdates = 0; - projectile.netUpdate = true; - } - else - { - flag24 = true; - } - } - if (flag24) - { - return; - } - - Vector2 vector46 = projectile.position; - float num633 = 640f; //40 block detection range - bool targetFound = false; - if (player.HasMinionAttackTargetNPC) - { - NPC npc = Main.npc[player.MinionAttackTargetNPC]; - if (npc.CanBeChasedBy(projectile, false)) - { - float npcDist = Vector2.Distance(npc.Center, projectile.Center); - if (npcDist < num633 && !targetFound && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height)) - { - num633 = npcDist; - vector46 = npc.Center; - targetFound = true; - } - } - } - if (!targetFound) - { - for (int num645 = 0; num645 < Main.maxNPCs; num645++) - { - NPC nPC2 = Main.npc[num645]; - if (nPC2.CanBeChasedBy(projectile, false)) - { - float npcDist = Vector2.Distance(nPC2.Center, projectile.Center); - if (npcDist < num633 && !targetFound && Collision.CanHitLine(projectile.position, projectile.width, projectile.height, nPC2.position, nPC2.width, nPC2.height)) - { - num633 = npcDist; - vector46 = nPC2.Center; - targetFound = true; - } - } - } - } - float maxPlayerRange = 1100f; - if (targetFound) - { - maxPlayerRange = 2400f; - } - if (Vector2.Distance(player.Center, projectile.Center) > maxPlayerRange) - { - projectile.ai[0] = 1f; - projectile.netUpdate = true; - } - if (targetFound && projectile.ai[0] == 0f) - { - Vector2 vector47 = vector46 - projectile.Center; - float num648 = vector47.Length(); - vector47.Normalize(); - if (num648 > 200f) - { - float scaleFactor2 = 8f; - vector47 *= scaleFactor2; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; - } - else - { - float num649 = 4f; - vector47 *= -num649; - projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; - } - } - else - { - bool flag26 = false; - if (!flag26) - { - flag26 = projectile.ai[0] == 1f; - } - float num650 = 6f; - if (flag26) - { - num650 = 15f; - } - Vector2 center2 = projectile.Center; - Vector2 vector48 = player.Center - center2 + new Vector2(0f, -60f); - float playerDist = vector48.Length(); - if (playerDist > 200f && num650 < 8f) - { - num650 = 8f; - } - if (playerDist < 150f && flag26 && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) - { - projectile.ai[0] = 0f; - projectile.netUpdate = true; - } - if (playerDist > 2000f) - { - projectile.position.X = player.Center.X - (float)(projectile.width / 2); - projectile.position.Y = player.Center.Y - (float)(projectile.height / 2); - projectile.netUpdate = true; - } - if (playerDist > 70f) - { - vector48.Normalize(); - vector48 *= num650; - projectile.velocity = (projectile.velocity * 40f + vector48) / 41f; - } - else if (projectile.velocity.X == 0f && projectile.velocity.Y == 0f) - { - projectile.velocity.X = -0.15f; - projectile.velocity.Y = -0.05f; - } - } - if (attackCooldown > 0f) - { - attackCooldown += (float)Main.rand.Next(1, 4); - } - if (attackCooldown > 40f) - { - attackCooldown = 0f; - projectile.netUpdate = true; - } - if (projectile.ai[0] == 0f) - { - if (attackCooldown == 0f && targetFound && num633 < 500f) - { - attackCooldown += 1f; - if (Main.myPlayer == projectile.owner) - { - projectile.ai[0] = 2f; - Vector2 value20 = vector46 - projectile.Center; - value20.Normalize(); - projectile.velocity = value20 * 8f; - projectile.netUpdate = true; - } - } - } } else { projectile.frame = 0; - projectile.extraUpdates = 0; - int num988 = 10; - bool flag54 = false; - bool flag55 = false; - projectile.localAI[0] += 1f; - if (projectile.localAI[0] % 30f == 0f) - { - flag55 = true; - } - int npcIndex = (int)projectile.ai[1]; - if (projectile.localAI[0] >= (float)(60000 * num988)) //tryna make it stay on there "forever" without glitching - { - flag54 = true; - } - else if (npcIndex < 0 || npcIndex >= Main.maxNPCs) - { - flag54 = true; - } - else if (Main.npc[npcIndex].active && !Main.npc[npcIndex].dontTakeDamage && Main.npc[npcIndex].defense < 9999) - { - projectile.Center = Main.npc[npcIndex].Center - projectile.velocity * 2f; - projectile.gfxOffY = Main.npc[npcIndex].gfxOffY; - if (flag55) - { - Main.npc[npcIndex].HitEffect(0, 1.0); - } - } - else - { - flag54 = true; - } - if (flag54) - { - projectile.ai[0] = 0f; - projectile.velocity.X = 0f; - projectile.velocity.Y = 0f; - } + projectile.extraUpdates = 0; + bool breakAway = false; + bool spawnDust = false; + projectile.localAI[0] += 1f; + if (projectile.localAI[0] % 30f == 0f) + { + spawnDust = true; + } + int npcIndex = projectile.Calamity().lineColor; + if (projectile.localAI[0] >= 600000f) //tryna make it stay on there "forever" without glitching + { + breakAway = true; + } + else if (npcIndex < 0 || npcIndex >= Main.maxNPCs) + { + breakAway = true; + } + else if (Main.npc[npcIndex].active && !Main.npc[npcIndex].dontTakeDamage && Main.npc[npcIndex].defense < 9999) + { + projectile.Center = Main.npc[npcIndex].Center - projectile.velocity * 2f; + projectile.gfxOffY = Main.npc[npcIndex].gfxOffY; + if (spawnDust) + { + Main.npc[npcIndex].HitEffect(0, 1.0); + } + } + else + { + breakAway = true; + } + if (breakAway) + { + projectile.ai[0] = 0f; + projectile.velocity.X = 0f; + projectile.velocity.Y = 0f; + } if (projectile.owner == Main.myPlayer) { if (eaterCooldown > 0) @@ -309,112 +154,123 @@ namespace CalamityMod.Projectiles.Summon float yVector = (float)Main.rand.Next(-35, 36) * 0.02f; xVector *= 10f; yVector *= 10f; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, xVector, yVector, ModContent.ProjectileType(), (int)(VileFeeder.BaseDamage * player.MinionDamage() * 1.25f), projectile.knockBack, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, xVector, yVector, ModContent.ProjectileType(), (int)(projectile.damage * 1.25f), projectile.knockBack, projectile.owner, 0f, 0f); } eaterCooldown = 80; } } } - } - - public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) - { - Player player = Main.player[projectile.owner]; - Rectangle myRect = new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height); - if (projectile.owner == Main.myPlayer) - { - for (int i = 0; i < Main.maxNPCs; i++) - { - NPC npc = Main.npc[i]; - if (npc.active && !npc.dontTakeDamage && npc.defense < 9999 && - ((projectile.friendly && (!npc.friendly || (npc.type == NPCID.Guide && projectile.owner < Main.maxPlayers && player.killGuide) || (npc.type == NPCID.Clothier && projectile.owner < Main.maxPlayers && player.killClothier))) && (projectile.owner < 0 || npc.immune[projectile.owner] == 0 || projectile.maxPenetrate == 1))) - { - if (npc.noTileCollide || !projectile.ownerHitCheck || projectile.CanHit(npc)) - { - bool flag3; - if (npc.type == NPCID.SolarCrawltipedeTail) - { - Rectangle rect = npc.getRect(); - int num5 = 8; - rect.X -= num5; - rect.Y -= num5; - rect.Width += num5 * 2; - rect.Height += num5 * 2; - flag3 = projectile.Colliding(myRect, rect); - } - else - { - flag3 = projectile.Colliding(myRect, npc.getRect()); - } - if (flag3) - { - if (npc.reflectingProjectiles && projectile.CanReflect()) - { - npc.ReflectProjectile(projectile.whoAmI); - return; - } - projectile.ai[0] = 3f; - projectile.ai[1] = (float)i; - projectile.velocity = (npc.Center - projectile.Center) * 0.75f; - projectile.netUpdate = true; - projectile.StatusNPC(i); - projectile.damage = 0; - int num28 = 10; - Point[] array2 = new Point[num28]; - int num29 = 0; - for (int l = 0; l < Main.maxProjectiles; l++) - { - Projectile proj = Main.projectile[l]; - if (l != projectile.whoAmI && proj.active && proj.owner == Main.myPlayer && proj.type == projectile.type && proj.ai[0] == 3f && proj.ai[1] == (float)i) - { - array2[num29++] = new Point(l, Main.projectile[l].timeLeft); - if (num29 >= array2.Length) - { - break; - } - } - } - if (num29 >= array2.Length) - { - int num30 = 0; - for (int m = 1; m < array2.Length; m++) - { - if (array2[m].Y < array2[num30].Y) - { - num30 = m; - } - } - Main.projectile[array2[num30].X].Kill(); - } - } - } - } - } - } } - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) - { - if (targetHitbox.Width > 8 && targetHitbox.Height > 8) - { - targetHitbox.Inflate(-targetHitbox.Width / 8, -targetHitbox.Height / 8); - } - return null; - } + public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) + { + Player player = Main.player[projectile.owner]; + Rectangle myRect = new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height); - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - SpriteEffects spriteEffects = projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; - Texture2D texture = Main.projectileTexture[projectile.type]; - int num214 = texture.Height / Main.projFrames[projectile.type]; - int y6 = num214 * projectile.frame; - Main.spriteBatch.Draw(texture, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture.Width / 2f, (float)num214 / 2f), projectile.scale, spriteEffects, 0f); - return false; - } + if (projectile.owner == Main.myPlayer) + { + for (int npcIndex = 0; npcIndex < Main.maxNPCs; npcIndex++) + { + NPC npc = Main.npc[npcIndex]; + //covers most edge cases like voodoo dolls + if (npc.active && !npc.dontTakeDamage && npc.defense < 9999 && + ((projectile.friendly && (!npc.friendly || (npc.type == NPCID.Guide && projectile.owner < Main.maxPlayers && player.killGuide) || (npc.type == NPCID.Clothier && projectile.owner < Main.maxPlayers && player.killClothier))) || + (projectile.hostile && npc.friendly && !npc.dontTakeDamageFromHostiles)) && (projectile.owner < 0 || npc.immune[projectile.owner] == 0 || projectile.maxPenetrate == 1)) + { + if (npc.noTileCollide || !projectile.ownerHitCheck || projectile.CanHit(npc)) + { + bool stickingToNPC; + //Solar Crawltipede tail has special collision + if (npc.type == NPCID.SolarCrawltipedeTail) + { + Rectangle rect = npc.getRect(); + int num5 = 8; + rect.X -= num5; + rect.Y -= num5; + rect.Width += num5 * 2; + rect.Height += num5 * 2; + stickingToNPC = projectile.Colliding(myRect, rect); + } + else + { + stickingToNPC = projectile.Colliding(myRect, npc.getRect()); + } + if (stickingToNPC) + { + //reflect projectile if the npc can reflect it (like Selenians) + if (npc.reflectingProjectiles && projectile.CanReflect()) + { + npc.ReflectProjectile(projectile.whoAmI); + return; + } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.immune[projectile.owner] = 0; - } - } + //let the projectile know it is sticking and the npc it is sticking too + projectile.ai[0] = 1f; + projectile.Calamity().lineColor = npcIndex; + + //follow the NPC + projectile.velocity = (npc.Center - projectile.Center) * 0.75f; + + projectile.netUpdate = true; + + //Count how many projectiles are attached, delete as necessary + Point[] array2 = new Point[10]; + int projCount = 0; + for (int projIndex = 0; projIndex < Main.maxProjectiles; projIndex++) + { + Projectile proj = Main.projectile[projIndex]; + if (projIndex != projectile.whoAmI && proj.active && proj.owner == Main.myPlayer && proj.type == projectile.type && proj.ai[0] == 1f && proj.Calamity().lineColor == npcIndex) + { + array2[projCount++] = new Point(projIndex, proj.timeLeft); + if (projCount >= array2.Length) + { + break; + } + } + } + if (projCount >= array2.Length) + { + int num30 = 0; + for (int m = 1; m < array2.Length; m++) + { + if (array2[m].Y < array2[num30].Y) + { + num30 = m; + } + } + Main.projectile[array2[num30].X].Kill(); + } + } + } + } + } + } + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + if (targetHitbox.Width > 8 && targetHitbox.Height > 8) + { + targetHitbox.Inflate(-targetHitbox.Width / 8, -targetHitbox.Height / 8); + } + return null; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + SpriteEffects spriteEffects = projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + Texture2D texture = Main.projectileTexture[projectile.type]; + int num214 = texture.Height / Main.projFrames[projectile.type]; + int y6 = num214 * projectile.frame; + Main.spriteBatch.Draw(texture, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture.Width / 2f, (float)num214 / 2f), projectile.scale, spriteEffects, 0f); + return false; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.immune[projectile.owner] = 0; + } + + public override bool CanDamage() => projectile.ai[0] != 3f; + } } diff --git a/Projectiles/Typeless/FiniteUse/MagnumRound.cs b/Projectiles/Typeless/FiniteUse/MagnumRound.cs index 1b526a8421..e9d87d18e4 100644 --- a/Projectiles/Typeless/FiniteUse/MagnumRound.cs +++ b/Projectiles/Typeless/FiniteUse/MagnumRound.cs @@ -35,11 +35,6 @@ namespace CalamityMod.Projectiles.Typeless.FiniteUse } if (damage > target.lifeMax / 15 && CalamityPlayer.areThereAnyDamnBosses) damage = target.lifeMax / 15; - if (crit) - { - damage = (int)(damage * 1.25); - knockback *= 1.25f; - } } } } diff --git a/Projectiles/Typeless/NebulaStar.cs b/Projectiles/Typeless/NebulaStar.cs index a21ec81a21..4df7ad9f5d 100644 --- a/Projectiles/Typeless/NebulaStar.cs +++ b/Projectiles/Typeless/NebulaStar.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Typeless public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) { Rectangle frame = new Rectangle(0, 0, Main.projectileTexture[projectile.type].Width, Main.projectileTexture[projectile.type].Height); - spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Projectiles/Typeless/NebulaStarGlow"), projectile.Center - Main.screenPosition, frame, Color.White, projectile.rotation, projectile.Size / 2, 1f, SpriteEffects.None, 0f); + spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Projectiles/Typeless/NebulaStarGlow"), projectile.Center - Main.screenPosition, frame, Color.White * ((255 - projectile.alpha) / 255f), projectile.rotation, projectile.Size / 2, 1f, SpriteEffects.None, 0f); } } } diff --git a/Schematics/AutoGeneratedContent/ResearchFacility2Schematic.cs b/Schematics/AutoGeneratedContent/ResearchFacility2Schematic.cs new file mode 100644 index 0000000000..ab3c5f807e --- /dev/null +++ b/Schematics/AutoGeneratedContent/ResearchFacility2Schematic.cs @@ -0,0 +1,541 @@ +using CalamityMod.Tiles; +using Microsoft.Xna.Framework; +using System.CodeDom.Compiler; +using System.Collections.Generic; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Tiles.DraedonStructures; +using CalamityMod.Walls.DraedonStructures; + +namespace CalamityMod.Schematics.AutoGeneratedContent +{ + public class ResearchFacility2Schematic + { + [GeneratedCode("ScreenCaptureToSchematic", "1.0.2")] + public static ColorTileMap GetMap() + { + var tile1 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 0, 0, 0); + var tile2 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 16, 0, 8224).UseFrame(36, 54); + var tile3 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 16, 0, 32).UseFrame(0, 18); + var tile4 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32); + var tile5 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 16416).UseFrame(0, 72); + var tile6 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 16, 0, 8224).UseFrame(36, 54); + var tile7 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 16, 0, 32).UseFrame(0, 18); + var tile8 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 16, 0, 16416).UseFrame(36, 72); + var tile9 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 32).UseFrame(306, 72); + var tile10 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 82, 3, 32).UseFrame(72, 18).UseWall((ushort)ModContent.WallType(), 72, 108); + var tile11 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32).UseFrame(72, 0).UseWall((ushort)ModContent.WallType(), 0, 0); + var tile12 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 80, 1, 32).UseFrame(72, 18).UseWall((ushort)ModContent.WallType(), 0, 36); + var tile13 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 82, 4, 32).UseFrame(72, 18).UseWall((ushort)ModContent.WallType(), 72, 144); + var tile14 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 16, 0, 32).UseFrame(54, 72); + var tile15 = new TileDefinitionStructure(TileID.ClosedDoor).UseHeaders(0, 0, 0, 32).UseFrame(0, 756); + var tile16 = new TileDefinitionStructure(TileID.ClosedDoor).UseHeaders(0, 0, 0, 32).UseFrame(0, 774); + var tile17 = new TileDefinitionStructure(TileID.ClosedDoor).UseHeaders(0, 0, 0, 32).UseFrame(0, 792); + var tile18 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32).UseFrame(18, 0); + var tile19 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 32).UseFrame(54, 18); + var tile20 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 16, 0, 32).UseFrame(36, 36); + var tile21 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 8224).UseFrame(0, 54); + var tile22 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 16, 0, 32).UseFrame(306, 72); + var tile23 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 148, 3, 12320).UseFrame(54, 72).UseWall((ushort)ModContent.WallType(), 144, 108); + var tile24 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 1, 1, 0).UseWall((ushort)ModContent.WallType(), 36, 36); + var tile25 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 66, 1, 0).UseWall((ushort)ModContent.WallType(), 72, 36); + var tile26 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 74, 1, 0).UseWall((ushort)ModContent.WallType(), 360, 36); + var tile27 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 66, 1, 0).UseWall((ushort)ModContent.WallType(), 72, 36); + var tile28 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 64, 1, 0).UseWall((ushort)ModContent.WallType(), 0, 36); + var tile29 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 64, 1, 0).UseWall((ushort)ModContent.WallType(), 0, 36); + var tile30 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 0, 0, 0).UseWall((ushort)WallID.SapphireGemspark, 0, 0); + var tile31 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 103, 3, 32).UseFrame(54, 0).UseWall((ushort)WallID.SapphireGemspark, 252, 108); + var tile32 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32).UseFrame(18, 18); + var tile33 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 32).UseFrame(54, 36); + var tile34 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32).UseFrame(306, 72); + var tile35 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 136, 2, 0).UseWall((ushort)ModContent.WallType(), 288, 72); + var tile36 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 131, 1, 0).UseWall((ushort)ModContent.WallType(), 108, 36); + var tile37 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 136, 2, 0).UseWall((ushort)ModContent.WallType(), 288, 72); + var tile38 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 66, 2, 0).UseWall((ushort)WallID.SapphireGemspark, 72, 72); + var tile39 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 8224).UseFrame(72, 54); + var tile40 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 82, 3, 12320).UseFrame(54, 72).UseWall((ushort)ModContent.WallType(), 72, 108); + var tile41 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 131, 1, 0).UseWall((ushort)ModContent.WallType(), 108, 36); + var tile42 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 71, 1, 0).UseWall((ushort)ModContent.WallType(), 252, 36); + var tile43 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 139, 2, 0).UseWall((ushort)ModContent.WallType(), 396, 72); + var tile44 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 6, 1, 0).UseWall((ushort)ModContent.WallType(), 216, 36); + var tile45 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 139, 2, 0).UseWall((ushort)ModContent.WallType(), 396, 72); + var tile46 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 136, 1, 0).UseWall((ushort)ModContent.WallType(), 288, 36); + var tile47 = new TileDefinitionStructure(TileID.FishingCrate).UseHeaders(0, 75, 1, 32).UseFrame(36, 0).UseWall((ushort)ModContent.WallType(), 396, 36); + var tile48 = new TileDefinitionStructure(TileID.FishingCrate).UseHeaders(0, 66, 2, 32).UseFrame(36, 18).UseWall((ushort)WallID.SapphireGemspark, 72, 72); + var tile49 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 32).UseFrame(54, 0); + var tile50 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32).UseFrame(18, 36); + var tile51 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 16, 0, 32).UseFrame(270, 72); + var tile52 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32).UseFrame(18, 36); + var tile53 = new TileDefinitionStructure(TileID.HangingLanterns).UseHeaders(0, 1, 0, 32).UseFrame(0, 540).UseWall((ushort)ModContent.WallType(), 36, 0); + var tile54 = new TileDefinitionStructure(TileID.HangingLanterns).UseHeaders(0, 66, 1, 32).UseFrame(0, 558).UseWall((ushort)ModContent.WallType(), 72, 36); + var tile55 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 1, 1, 0).UseWall((ushort)ModContent.WallType(), 36, 36); + var tile56 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 10, 0, 0).UseWall((ushort)ModContent.WallType(), 360, 0); + var tile57 = new TileDefinitionStructure(TileID.FishingCrate).UseHeaders(0, 131, 1, 32).UseFrame(54, 0).UseWall((ushort)ModContent.WallType(), 108, 36); + var tile58 = new TileDefinitionStructure(TileID.FishingCrate).UseHeaders(0, 131, 2, 32).UseFrame(54, 18).UseWall((ushort)WallID.SapphireGemspark, 108, 72); + var tile59 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 16, 0, 32).UseFrame(36, 0); + var tile60 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 32).UseFrame(54, 0); + var tile61 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 16, 0, 32).UseFrame(252, 54); + var tile62 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 66, 3, 12320).UseFrame(18, 72).UseWall((ushort)ModContent.WallType(), 72, 108); + var tile63 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 6, 2, 0).UseWall((ushort)ModContent.WallType(), 216, 72); + var tile64 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 71, 2, 0).UseWall((ushort)ModContent.WallType(), 252, 72); + var tile65 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 66, 3, 12320).UseFrame(18, 72).UseWall((ushort)ModContent.WallType(), 72, 108); + var tile66 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 136, 1, 0).UseWall((ushort)ModContent.WallType(), 288, 36); + var tile67 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 139, 2, 0).UseWall((ushort)ModContent.WallType(), 396, 72); + var tile68 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 66, 1, 0).UseWall((ushort)ModContent.WallType(), 72, 36); + var tile69 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 136, 1, 32).UseFrame(36, 0).UseWall((ushort)ModContent.WallType(), 288, 36); + var tile70 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 11, 0, 0).UseWall((ushort)ModContent.WallType(), 396, 0); + var tile71 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 131, 1, 0).UseWall((ushort)ModContent.WallType(), 108, 36); + var tile72 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 71, 1, 0).UseWall((ushort)ModContent.WallType(), 252, 36); + var tile73 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 1, 1, 0).UseWall((ushort)ModContent.WallType(), 36, 36); + var tile74 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 66, 2, 0).UseWall((ushort)ModContent.WallType(), 72, 72); + var tile75 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 32).UseFrame(54, 36); + var tile76 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 131, 0, 0).UseWall((ushort)ModContent.WallType(), 108, 0); + var tile77 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 10, 0, 0).UseWall((ushort)ModContent.WallType(), 360, 0); + var tile78 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 138, 2, 32).UseWall((ushort)ModContent.WallType(), 360, 72); + var tile79 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 74, 1, 0).UseWall((ushort)ModContent.WallType(), 360, 36); + var tile80 = new TileDefinitionStructure(TileID.Lamps).UseHeaders(0, 138, 2, 32).UseFrame(0, 216).UseWall((ushort)ModContent.WallType(), 360, 72); + var tile81 = new TileDefinitionStructure(TileID.Lamps).UseHeaders(0, 131, 1, 32).UseFrame(0, 234).UseWall((ushort)ModContent.WallType(), 108, 36); + var tile82 = new TileDefinitionStructure(TileID.Lamps).UseHeaders(0, 1, 2, 32).UseFrame(0, 252).UseWall((ushort)WallID.SapphireGemspark, 36, 72); + var tile83 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 32).UseFrame(90, 54); + var tile84 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 16, 0, 32).UseFrame(36, 0); + var tile85 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 66, 0, 0).UseWall((ushort)ModContent.WallType(), 72, 0); + var tile86 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 66, 1, 32).UseWall((ushort)ModContent.WallType(), 72, 36); + var tile87 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 6, 2, 0).UseWall((ushort)ModContent.WallType(), 216, 72); + var tile88 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 71, 2, 0).UseWall((ushort)WallID.SapphireGemspark, 252, 72); + var tile89 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 64, 1, 4128).UseFrame(180, 0).UseWall((ushort)ModContent.WallType(), 0, 36); + var tile90 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 4, 32).UseFrame(18, 0).UseWall((ushort)ModContent.WallType(), 0, 144); + var tile91 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 16, 3, 12320).UseFrame(54, 72).UseWall((ushort)ModContent.WallType(), 0, 108); + var tile92 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 6, 1, 0).UseWall((ushort)ModContent.WallType(), 216, 36); + var tile93 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 75, 1, 32).UseWall((ushort)ModContent.WallType(), 396, 36); + var tile94 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 131, 1, 32).UseFrame(0, 18).UseWall((ushort)ModContent.WallType(), 108, 36); + var tile95 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 136, 1, 32).UseWall((ushort)ModContent.WallType(), 288, 36); + var tile96 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 71, 1, 0).UseWall((ushort)ModContent.WallType(), 252, 36); + var tile97 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 11, 0, 0).UseWall((ushort)ModContent.WallType(), 396, 0); + var tile98 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 71, 1, 0).UseWall((ushort)ModContent.WallType(), 252, 36); + var tile99 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 17, 2, 32).UseFrame(36, 0).UseWall((ushort)ModContent.WallType(), 36, 72); + var tile100 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 131, 0, 0).UseWall((ushort)ModContent.WallType(), 108, 0); + var tile101 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 74, 1, 0).UseWall((ushort)ModContent.WallType(), 360, 36); + var tile102 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 66, 1, 32).UseFrame(18, 0).UseWall((ushort)ModContent.WallType(), 72, 36); + var tile103 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 66, 1, 32).UseFrame(18, 18).UseWall((ushort)ModContent.WallType(), 72, 36); + var tile104 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 74, 1, 32).UseWall((ushort)ModContent.WallType(), 360, 36); + var tile105 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 10, 0, 0).UseWall((ushort)ModContent.WallType(), 360, 0); + var tile106 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 74, 1, 0).UseWall((ushort)ModContent.WallType(), 360, 36); + var tile107 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 98, 2, 32).UseFrame(54, 0).UseWall((ushort)ModContent.WallType(), 72, 72); + var tile108 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 32).UseFrame(270, 72); + var tile109 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 66, 1, 32).UseFrame(36, 0).UseWall((ushort)ModContent.WallType(), 72, 36); + var tile110 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 71, 2, 32).UseFrame(36, 18).UseWall((ushort)ModContent.WallType(), 252, 72); + var tile111 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 66, 1, 32).UseWall((ushort)ModContent.WallType(), 72, 36); + var tile112 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 71, 2, 0).UseWall((ushort)ModContent.WallType(), 252, 72); + var tile113 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 1, 1, 0).UseWall((ushort)ModContent.WallType(), 36, 36); + var tile114 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 1, 2, 32).UseFrame(18, 54).UseWall((ushort)ModContent.WallType(), 36, 72); + var tile115 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32).UseFrame(18, 0); + var tile116 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 132, 3, 12320).UseFrame(18, 72).UseWall((ushort)ModContent.WallType(), 144, 108); + var tile117 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 75, 1, 0).UseWall((ushort)ModContent.WallType(), 396, 36); + var tile118 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 71, 1, 32).UseWall((ushort)ModContent.WallType(), 252, 36); + var tile119 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 11, 0, 0).UseWall((ushort)ModContent.WallType(), 396, 0); + var tile120 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 1, 1, 0).UseWall((ushort)WallID.SapphireGemspark, 36, 36); + var tile121 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 6, 1, 0).UseWall((ushort)ModContent.WallType(), 216, 36); + var tile122 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 131, 2, 4128).UseFrame(180, 0).UseWall((ushort)ModContent.WallType(), 108, 72); + var tile123 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 32).UseFrame(144, 72); + var tile124 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 138, 2, 32).UseWall((ushort)ModContent.WallType(), 360, 72); + var tile125 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 131, 1, 0).UseWall((ushort)WallID.SapphireGemspark, 108, 36); + var tile126 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 10, 0, 0).UseWall((ushort)ModContent.WallType(), 360, 0); + var tile127 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 1, 2, 0).UseWall((ushort)ModContent.WallType(), 36, 72); + var tile128 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32).UseFrame(108, 72); + var tile129 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 1, 0, 0).UseWall((ushort)ModContent.WallType(), 36, 0); + var tile130 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 1, 1, 32).UseWall((ushort)ModContent.WallType(), 36, 36); + var tile131 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 66, 1, 0).UseWall((ushort)ModContent.WallType(), 72, 36); + var tile132 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 66, 2, 0).UseWall((ushort)ModContent.WallType(), 72, 72); + var tile133 = new TileDefinitionStructure(TileID.HangingLanterns).UseHeaders(0, 66, 0, 32).UseFrame(0, 540).UseWall((ushort)ModContent.WallType(), 72, 0); + var tile134 = new TileDefinitionStructure(TileID.HangingLanterns).UseHeaders(0, 139, 2, 32).UseFrame(0, 558).UseWall((ushort)ModContent.WallType(), 396, 72); + var tile135 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 66, 1, 8224).UseFrame(144, 0).UseWall((ushort)ModContent.WallType(), 72, 36); + var tile136 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 136, 1, 0).UseWall((ushort)ModContent.WallType(), 288, 36); + var tile137 = new TileDefinitionStructure(TileID.Extractinator).UseHeaders(0, 131, 1, 32).UseWall((ushort)WallID.SapphireGemspark, 108, 36); + var tile138 = new TileDefinitionStructure(TileID.Extractinator).UseHeaders(0, 136, 1, 32).UseFrame(0, 18).UseWall((ushort)ModContent.WallType(), 288, 36); + var tile139 = new TileDefinitionStructure(TileID.Extractinator).UseHeaders(0, 66, 2, 32).UseFrame(0, 36).UseWall((ushort)ModContent.WallType(), 72, 72); + var tile140 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 16, 0, 32).UseFrame(126, 72); + var tile141 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 132, 3, 12320).UseFrame(18, 72).UseWall((ushort)ModContent.WallType(), 144, 108); + var tile142 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 138, 2, 0).UseWall((ushort)ModContent.WallType(), 360, 72); + var tile143 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 131, 1, 8224).UseFrame(144, 0).UseWall((ushort)ModContent.WallType(), 108, 36); + var tile144 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 1, 1, 0).UseWall((ushort)ModContent.WallType(), 36, 36); + var tile145 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 138, 2, 0).UseWall((ushort)ModContent.WallType(), 360, 72); + var tile146 = new TileDefinitionStructure(TileID.Extractinator).UseHeaders(0, 131, 1, 32).UseFrame(18, 0).UseWall((ushort)WallID.SapphireGemspark, 108, 36); + var tile147 = new TileDefinitionStructure(TileID.Extractinator).UseHeaders(0, 74, 1, 32).UseFrame(18, 18).UseWall((ushort)ModContent.WallType(), 360, 36); + var tile148 = new TileDefinitionStructure(TileID.Extractinator).UseHeaders(0, 66, 2, 32).UseFrame(18, 36).UseWall((ushort)ModContent.WallType(), 72, 72); + var tile149 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 1, 1, 32).UseFrame(216, 0).UseWall((ushort)ModContent.WallType(), 36, 36); + var tile150 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 6, 2, 0).UseWall((ushort)ModContent.WallType(), 216, 72); + var tile151 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 66, 1, 0).UseWall((ushort)ModContent.WallType(), 72, 36); + var tile152 = new TileDefinitionStructure(TileID.Extractinator).UseHeaders(0, 6, 2, 32).UseFrame(36, 0).UseWall((ushort)WallID.SapphireGemspark, 216, 72); + var tile153 = new TileDefinitionStructure(TileID.Extractinator).UseHeaders(0, 131, 1, 32).UseFrame(36, 18).UseWall((ushort)ModContent.WallType(), 108, 36); + var tile154 = new TileDefinitionStructure(TileID.Extractinator).UseHeaders(0, 131, 2, 32).UseFrame(36, 36).UseWall((ushort)ModContent.WallType(), 108, 72); + var tile155 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 131, 0, 0).UseWall((ushort)ModContent.WallType(), 108, 0); + var tile156 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 75, 1, 32).UseWall((ushort)ModContent.WallType(), 396, 36); + var tile157 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 138, 2, 0).UseWall((ushort)ModContent.WallType(), 360, 72); + var tile158 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 138, 2, 0).UseWall((ushort)ModContent.WallType(), 360, 72); + var tile159 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 138, 2, 32).UseFrame(36, 0).UseWall((ushort)ModContent.WallType(), 360, 72); + var tile160 = new TileDefinitionStructure(TileID.Extractinator).UseHeaders(0, 138, 2, 32).UseFrame(18, 18).UseWall((ushort)ModContent.WallType(), 360, 72); + var tile161 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 16, 0, 32).UseFrame(36, 36); + var tile162 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 136, 2, 32).UseWall((ushort)ModContent.WallType(), 288, 72); + var tile163 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 66, 1, 32).UseFrame(0, 18).UseWall((ushort)ModContent.WallType(), 72, 36); + var tile164 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 131, 1, 32).UseWall((ushort)ModContent.WallType(), 108, 36); + var tile165 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 131, 1, 32).UseWall((ushort)ModContent.WallType(), 108, 36); + var tile166 = new TileDefinitionStructure(TileID.Extractinator).UseHeaders(0, 136, 2, 32).UseFrame(36, 0).UseWall((ushort)WallID.SapphireGemspark, 288, 72); + var tile167 = new TileDefinitionStructure(TileID.Extractinator).UseHeaders(0, 66, 1, 32).UseFrame(36, 18).UseWall((ushort)ModContent.WallType(), 72, 36); + var tile168 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 66, 1, 32).UseFrame(18, 0).UseWall((ushort)ModContent.WallType(), 72, 36); + var tile169 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 6, 1, 32).UseFrame(18, 18).UseWall((ushort)ModContent.WallType(), 216, 36); + var tile170 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 71, 1, 32).UseWall((ushort)ModContent.WallType(), 252, 36); + var tile171 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 75, 1, 0).UseWall((ushort)ModContent.WallType(), 396, 36); + var tile172 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 66, 1, 0).UseWall((ushort)WallID.SapphireGemspark, 72, 36); + var tile173 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 10, 0, 32).UseFrame(18, 0).UseWall((ushort)ModContent.WallType(), 360, 0); + var tile174 = new TileDefinitionStructure(TileID.GlassKiln).UseHeaders(0, 1, 1, 32).UseWall((ushort)WallID.SapphireGemspark, 36, 36); + var tile175 = new TileDefinitionStructure(TileID.GlassKiln).UseHeaders(0, 74, 1, 32).UseFrame(0, 18).UseWall((ushort)ModContent.WallType(), 360, 36); + var tile176 = new TileDefinitionStructure(TileID.GlassKiln).UseHeaders(0, 131, 2, 32).UseFrame(0, 36).UseWall((ushort)ModContent.WallType(), 108, 72); + var tile177 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 71, 2, 0).UseWall((ushort)ModContent.WallType(), 252, 72); + var tile178 = new TileDefinitionStructure(TileID.GlassKiln).UseHeaders(0, 136, 2, 32).UseFrame(18, 0).UseWall((ushort)WallID.SapphireGemspark, 288, 72); + var tile179 = new TileDefinitionStructure(TileID.GlassKiln).UseHeaders(0, 66, 1, 32).UseFrame(18, 18).UseWall((ushort)ModContent.WallType(), 72, 36); + var tile180 = new TileDefinitionStructure(TileID.GlassKiln).UseHeaders(0, 131, 2, 32).UseFrame(18, 36).UseWall((ushort)ModContent.WallType(), 108, 72); + var tile181 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 139, 2, 32).UseFrame(234, 0).UseWall((ushort)ModContent.WallType(), 396, 72); + var tile182 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 71, 1, 0).UseWall((ushort)ModContent.WallType(), 252, 36); + var tile183 = new TileDefinitionStructure(TileID.GlassKiln).UseHeaders(0, 66, 1, 32).UseFrame(36, 0).UseWall((ushort)WallID.SapphireGemspark, 72, 36); + var tile184 = new TileDefinitionStructure(TileID.GlassKiln).UseHeaders(0, 6, 1, 32).UseFrame(36, 18).UseWall((ushort)ModContent.WallType(), 216, 36); + var tile185 = new TileDefinitionStructure(TileID.GlassKiln).UseHeaders(0, 66, 2, 32).UseFrame(36, 36).UseWall((ushort)ModContent.WallType(), 72, 72); + var tile186 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 4128).UseFrame(18, 54); + var tile187 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 16, 0, 32).UseFrame(288, 72); + var tile188 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 1, 3, 16416).UseFrame(0, 72).UseWall((ushort)ModContent.WallType(), 36, 108); + var tile189 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 1, 1, 4128).UseFrame(180, 0).UseWall((ushort)ModContent.WallType(), 36, 36); + var tile190 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 6, 2, 4128).UseFrame(180, 0).UseWall((ushort)ModContent.WallType(), 216, 72); + var tile191 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 131, 1, 0).UseWall((ushort)ModContent.WallType(), 108, 36); + var tile192 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 6, 1, 32).UseWall((ushort)ModContent.WallType(), 216, 36); + var tile193 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 10, 0, 32).UseWall((ushort)ModContent.WallType(), 360, 0); + var tile194 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 138, 2, 0).UseWall((ushort)ModContent.WallType(), 360, 72); + var tile195 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 32).UseFrame(270, 54); + var tile196 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 1, 3, 16416).UseFrame(0, 72).UseWall((ushort)ModContent.WallType(), 36, 108); + var tile197 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 6, 2, 0).UseWall((ushort)WallID.SapphireGemspark, 216, 72); + var tile198 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 1, 2, 8224).UseFrame(144, 0).UseWall((ushort)ModContent.WallType(), 36, 72); + var tile199 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 4128).UseFrame(90, 54); + var tile200 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 32).UseFrame(252, 72); + var tile201 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 139, 2, 32).UseWall((ushort)ModContent.WallType(), 396, 72); + var tile202 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 1, 1, 32).UseFrame(0, 18).UseWall((ushort)ModContent.WallType(), 36, 36); + var tile203 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 136, 1, 0).UseWall((ushort)ModContent.WallType(), 288, 36); + var tile204 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 98, 2, 32).UseFrame(72, 54).UseWall((ushort)ModContent.WallType(), 72, 72); + var tile205 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 66, 0, 0).UseWall((ushort)ModContent.WallType(), 72, 0); + var tile206 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 1, 1, 32).UseFrame(18, 0).UseWall((ushort)ModContent.WallType(), 36, 36); + var tile207 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 163, 2, 32).UseFrame(54, 0).UseWall((ushort)ModContent.WallType(), 108, 72); + var tile208 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 67, 3, 16416).UseFrame(0, 72).UseWall((ushort)ModContent.WallType(), 108, 108); + var tile209 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 131, 1, 32).UseFrame(36, 0).UseWall((ushort)ModContent.WallType(), 108, 36); + var tile210 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 66, 2, 32).UseFrame(18, 0).UseWall((ushort)ModContent.WallType(), 72, 72); + var tile211 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 4, 0, 8224).UseFrame(144, 0).UseWall((ushort)ModContent.WallType(), 144, 0); + var tile212 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 165, 4, 32).UseFrame(54, 0).UseWall((ushort)ModContent.WallType(), 180, 144); + var tile213 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 66, 0, 0).UseWall((ushort)ModContent.WallType(), 72, 0); + var tile214 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 74, 1, 32).UseFrame(18, 0).UseWall((ushort)ModContent.WallType(), 360, 36); + var tile215 = new TileDefinitionStructure(TileID.Lamps).UseHeaders(0, 74, 1, 32).UseFrame(0, 216).UseWall((ushort)ModContent.WallType(), 360, 36); + var tile216 = new TileDefinitionStructure(TileID.Lamps).UseHeaders(0, 1, 2, 32).UseFrame(0, 252).UseWall((ushort)ModContent.WallType(), 36, 72); + var tile217 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32).UseFrame(0, 54); + var tile218 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 32).UseFrame(288, 72); + var tile219 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 133, 3, 16416).UseFrame(0, 72).UseWall((ushort)ModContent.WallType(), 180, 108); + var tile220 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 136, 2, 0).UseWall((ushort)ModContent.WallType(), 288, 72); + var tile221 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 6, 2, 0).UseWall((ushort)ModContent.WallType(), 216, 72); + var tile222 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 1, 2, 0).UseWall((ushort)ModContent.WallType(), 36, 72); + var tile223 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 165, 3, 16416).UseFrame(72, 72).UseWall((ushort)ModContent.WallType(), 180, 108); + var tile224 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 16, 0, 32).UseFrame(36, 18); + var tile225 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 16, 0, 4128).UseFrame(54, 54); + var tile226 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 16, 0, 32).UseFrame(252, 72); + var tile227 = new TileDefinitionStructure(TileID.HangingLanterns).UseHeaders(0, 131, 0, 32).UseFrame(0, 540).UseWall((ushort)ModContent.WallType(), 108, 0); + var tile228 = new TileDefinitionStructure(TileID.HangingLanterns).UseHeaders(0, 1, 1, 32).UseFrame(0, 558).UseWall((ushort)ModContent.WallType(), 36, 36); + var tile229 = new TileDefinitionStructure(TileID.FishingCrate).UseHeaders(0, 131, 1, 32).UseFrame(36, 0).UseWall((ushort)ModContent.WallType(), 108, 36); + var tile230 = new TileDefinitionStructure(TileID.FishingCrate).UseHeaders(0, 138, 2, 32).UseFrame(36, 18).UseWall((ushort)ModContent.WallType(), 360, 72); + var tile231 = new TileDefinitionStructure(TileID.FishingCrate).UseHeaders(0, 131, 1, 32).UseFrame(36, 0).UseWall((ushort)ModContent.WallType(), 108, 36); + var tile232 = new TileDefinitionStructure(TileID.FishingCrate).UseHeaders(0, 131, 2, 32).UseFrame(36, 18).UseWall((ushort)WallID.SapphireGemspark, 108, 72); + var tile233 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32).UseFrame(288, 72); + var tile234 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 33, 3, 16416).UseFrame(72, 72).UseWall((ushort)ModContent.WallType(), 36, 108); + var tile235 = new TileDefinitionStructure(TileID.FishingCrate).UseHeaders(0, 71, 2, 32).UseFrame(54, 0).UseWall((ushort)ModContent.WallType(), 252, 72); + var tile236 = new TileDefinitionStructure(TileID.FishingCrate).UseHeaders(0, 131, 1, 32).UseFrame(54, 18).UseWall((ushort)ModContent.WallType(), 108, 36); + var tile237 = new TileDefinitionStructure(TileID.FishingCrate).UseHeaders(0, 1, 2, 32).UseFrame(54, 18).UseWall((ushort)WallID.SapphireGemspark, 36, 72); + var tile238 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 83, 3, 16416).UseFrame(36, 72).UseWall((ushort)ModContent.WallType(), 108, 108); + var tile239 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 1, 2, 0).UseWall((ushort)WallID.SapphireGemspark, 36, 72); + var tile240 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 68, 1, 0).UseWall((ushort)ModContent.WallType(), 144, 36); + var tile241 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 132, 2, 0).UseWall((ushort)ModContent.WallType(), 144, 72); + var tile242 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 4, 0, 0).UseWall((ushort)ModContent.WallType(), 144, 0); + var tile243 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 132, 2, 0).UseWall((ushort)ModContent.WallType(), 144, 72); + var tile244 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 4, 0, 0).UseWall((ushort)ModContent.WallType(), 144, 0); + var tile245 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 67, 4, 0).UseWall((ushort)WallID.SapphireGemspark, 108, 144); + var tile246 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 32).UseFrame(0, 36); + var tile247 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 32).UseFrame(72, 72); + var tile248 = new TileDefinitionStructure(TileID.OpenDoor).UseHeaders(0, 0, 0, 32).UseFrame(0, 756); + var tile249 = new TileDefinitionStructure(TileID.OpenDoor).UseHeaders(0, 0, 0, 32).UseFrame(0, 774); + var tile250 = new TileDefinitionStructure(TileID.OpenDoor).UseHeaders(0, 0, 0, 32).UseFrame(0, 792); + var tile251 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32).UseFrame(72, 0); + var tile252 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 16, 0, 32).UseFrame(72, 18); + var tile253 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 12320).UseFrame(18, 72); + var tile254 = new TileDefinitionStructure(TileID.OpenDoor).UseHeaders(0, 0, 0, 32).UseFrame(18, 756); + var tile255 = new TileDefinitionStructure(TileID.OpenDoor).UseHeaders(0, 0, 0, 32).UseFrame(18, 774); + var tile256 = new TileDefinitionStructure(TileID.OpenDoor).UseHeaders(0, 0, 0, 32).UseFrame(18, 792); + var tile257 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 4128).UseFrame(90, 54); + var tile258 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 32).UseFrame(72, 36); + var tile259 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 16, 0, 12320).UseFrame(54, 72); + Dictionary colorTileMap = new Dictionary() + { + { new Color(0, 0, 0), tile1 }, + { new Color(35, 221, 125), tile2 }, + { new Color(112, 142, 86), tile3 }, + { new Color(23, 118, 69), tile4 }, + { new Color(113, 15, 65), tile5 }, + { new Color(158, 132, 110), tile6 }, + { new Color(195, 110, 40), tile7 }, + { new Color(217, 59, 120), tile8 }, + { new Color(17, 189, 14), tile9 }, + { new Color(24, 208, 83), tile10 }, + { new Color(105, 118, 33), tile11 }, + { new Color(179, 158, 172), tile12 }, + { new Color(23, 154, 161), tile13 }, + { new Color(4, 124, 200), tile14 }, + { new Color(42, 151, 79), tile15 }, + { new Color(13, 153, 244), tile16 }, + { new Color(58, 91, 39), tile17 }, + { new Color(69, 103, 174), tile18 }, + { new Color(252, 239, 246), tile19 }, + { new Color(155, 17, 31), tile20 }, + { new Color(111, 88, 189), tile21 }, + { new Color(2, 173, 0), tile22 }, + { new Color(36, 189, 112), tile23 }, + { new Color(148, 134, 233), tile24 }, + { new Color(204, 191, 242), tile25 }, + { new Color(95, 175, 163), tile26 }, + { new Color(41, 3, 36), tile27 }, + { new Color(25, 221, 117), tile28 }, + { new Color(44, 36, 14), tile29 }, + { new Color(114, 183, 174), tile30 }, + { new Color(181, 124, 137), tile31 }, + { new Color(130, 148, 36), tile32 }, + { new Color(11, 39, 233), tile33 }, + { new Color(79, 233, 220), tile34 }, + { new Color(132, 166, 213), tile35 }, + { new Color(62, 121, 168), tile36 }, + { new Color(188, 156, 64), tile37 }, + { new Color(83, 114, 13), tile38 }, + { new Color(251, 86, 122), tile39 }, + { new Color(72, 214, 137), tile40 }, + { new Color(241, 177, 5), tile41 }, + { new Color(194, 222, 9), tile42 }, + { new Color(95, 73, 42), tile43 }, + { new Color(205, 84, 136), tile44 }, + { new Color(185, 217, 26), tile45 }, + { new Color(71, 149, 55), tile46 }, + { new Color(160, 238, 171), tile47 }, + { new Color(102, 182, 27), tile48 }, + { new Color(110, 98, 10), tile49 }, + { new Color(123, 135, 62), tile50 }, + { new Color(170, 195, 81), tile51 }, + { new Color(96, 94, 55), tile52 }, + { new Color(214, 193, 199), tile53 }, + { new Color(203, 222, 47), tile54 }, + { new Color(125, 238, 71), tile55 }, + { new Color(183, 153, 152), tile56 }, + { new Color(243, 179, 193), tile57 }, + { new Color(66, 167, 232), tile58 }, + { new Color(222, 138, 251), tile59 }, + { new Color(234, 83, 123), tile60 }, + { new Color(255, 228, 194), tile61 }, + { new Color(236, 35, 145), tile62 }, + { new Color(55, 89, 123), tile63 }, + { new Color(226, 112, 211), tile64 }, + { new Color(111, 212, 15), tile65 }, + { new Color(123, 233, 199), tile66 }, + { new Color(211, 182, 201), tile67 }, + { new Color(113, 135, 212), tile68 }, + { new Color(125, 103, 27), tile69 }, + { new Color(105, 130, 211), tile70 }, + { new Color(59, 236, 110), tile71 }, + { new Color(76, 203, 249), tile72 }, + { new Color(108, 145, 203), tile73 }, + { new Color(182, 128, 63), tile74 }, + { new Color(29, 16, 66), tile75 }, + { new Color(237, 210, 211), tile76 }, + { new Color(216, 98, 161), tile77 }, + { new Color(52, 22, 156), tile78 }, + { new Color(178, 142, 92), tile79 }, + { new Color(237, 110, 187), tile80 }, + { new Color(117, 206, 214), tile81 }, + { new Color(168, 167, 131), tile82 }, + { new Color(101, 35, 8), tile83 }, + { new Color(22, 14, 87), tile84 }, + { new Color(252, 29, 54), tile85 }, + { new Color(137, 84, 119), tile86 }, + { new Color(145, 143, 148), tile87 }, + { new Color(72, 144, 32), tile88 }, + { new Color(50, 6, 214), tile89 }, + { new Color(209, 154, 61), tile90 }, + { new Color(157, 127, 34), tile91 }, + { new Color(15, 64, 178), tile92 }, + { new Color(105, 116, 104), tile93 }, + { new Color(190, 136, 175), tile94 }, + { new Color(202, 193, 83), tile95 }, + { new Color(73, 56, 249), tile96 }, + { new Color(102, 40, 57), tile97 }, + { new Color(229, 91, 223), tile98 }, + { new Color(39, 45, 61), tile99 }, + { new Color(182, 118, 160), tile100 }, + { new Color(173, 147, 137), tile101 }, + { new Color(202, 121, 143), tile102 }, + { new Color(53, 236, 220), tile103 }, + { new Color(131, 32, 223), tile104 }, + { new Color(14, 210, 6), tile105 }, + { new Color(229, 126, 207), tile106 }, + { new Color(205, 232, 206), tile107 }, + { new Color(221, 106, 113), tile108 }, + { new Color(4, 183, 35), tile109 }, + { new Color(67, 232, 18), tile110 }, + { new Color(117, 179, 254), tile111 }, + { new Color(200, 17, 244), tile112 }, + { new Color(37, 255, 72), tile113 }, + { new Color(195, 20, 75), tile114 }, + { new Color(28, 227, 7), tile115 }, + { new Color(89, 214, 137), tile116 }, + { new Color(216, 65, 175), tile117 }, + { new Color(110, 232, 141), tile118 }, + { new Color(210, 208, 41), tile119 }, + { new Color(23, 198, 193), tile120 }, + { new Color(108, 241, 4), tile121 }, + { new Color(201, 14, 109), tile122 }, + { new Color(224, 70, 193), tile123 }, + { new Color(17, 191, 126), tile124 }, + { new Color(134, 10, 212), tile125 }, + { new Color(130, 192, 134), tile126 }, + { new Color(106, 170, 225), tile127 }, + { new Color(154, 107, 166), tile128 }, + { new Color(99, 7, 202), tile129 }, + { new Color(113, 245, 65), tile130 }, + { new Color(203, 14, 56), tile131 }, + { new Color(135, 86, 34), tile132 }, + { new Color(70, 83, 213), tile133 }, + { new Color(154, 120, 144), tile134 }, + { new Color(199, 198, 129), tile135 }, + { new Color(48, 231, 222), tile136 }, + { new Color(185, 79, 16), tile137 }, + { new Color(162, 173, 28), tile138 }, + { new Color(224, 210, 133), tile139 }, + { new Color(94, 102, 6), tile140 }, + { new Color(163, 111, 80), tile141 }, + { new Color(128, 70, 177), tile142 }, + { new Color(70, 255, 179), tile143 }, + { new Color(177, 59, 109), tile144 }, + { new Color(177, 208, 49), tile145 }, + { new Color(80, 210, 165), tile146 }, + { new Color(36, 50, 31), tile147 }, + { new Color(235, 183, 165), tile148 }, + { new Color(48, 40, 97), tile149 }, + { new Color(28, 167, 132), tile150 }, + { new Color(156, 232, 236), tile151 }, + { new Color(206, 247, 9), tile152 }, + { new Color(64, 71, 127), tile153 }, + { new Color(208, 234, 232), tile154 }, + { new Color(43, 8, 20), tile155 }, + { new Color(163, 240, 221), tile156 }, + { new Color(235, 143, 255), tile157 }, + { new Color(224, 57, 52), tile158 }, + { new Color(230, 183, 184), tile159 }, + { new Color(170, 79, 29), tile160 }, + { new Color(79, 41, 88), tile161 }, + { new Color(47, 20, 82), tile162 }, + { new Color(128, 227, 216), tile163 }, + { new Color(40, 15, 139), tile164 }, + { new Color(37, 84, 71), tile165 }, + { new Color(55, 192, 175), tile166 }, + { new Color(145, 141, 56), tile167 }, + { new Color(132, 49, 23), tile168 }, + { new Color(132, 188, 175), tile169 }, + { new Color(184, 231, 63), tile170 }, + { new Color(80, 149, 247), tile171 }, + { new Color(98, 128, 192), tile172 }, + { new Color(144, 252, 243), tile173 }, + { new Color(193, 34, 13), tile174 }, + { new Color(4, 194, 127), tile175 }, + { new Color(116, 187, 228), tile176 }, + { new Color(236, 175, 246), tile177 }, + { new Color(8, 24, 193), tile178 }, + { new Color(229, 203, 248), tile179 }, + { new Color(65, 170, 88), tile180 }, + { new Color(162, 199, 251), tile181 }, + { new Color(153, 215, 122), tile182 }, + { new Color(148, 195, 211), tile183 }, + { new Color(134, 166, 196), tile184 }, + { new Color(187, 208, 106), tile185 }, + { new Color(42, 128, 110), tile186 }, + { new Color(151, 16, 1), tile187 }, + { new Color(203, 203, 55), tile188 }, + { new Color(73, 72, 124), tile189 }, + { new Color(53, 124, 181), tile190 }, + { new Color(199, 79, 81), tile191 }, + { new Color(155, 30, 90), tile192 }, + { new Color(18, 107, 235), tile193 }, + { new Color(5, 223, 247), tile194 }, + { new Color(17, 101, 9), tile195 }, + { new Color(49, 76, 72), tile196 }, + { new Color(86, 187, 75), tile197 }, + { new Color(138, 169, 154), tile198 }, + { new Color(86, 215, 251), tile199 }, + { new Color(195, 79, 143), tile200 }, + { new Color(253, 94, 70), tile201 }, + { new Color(30, 191, 87), tile202 }, + { new Color(115, 32, 177), tile203 }, + { new Color(16, 24, 21), tile204 }, + { new Color(131, 145, 48), tile205 }, + { new Color(9, 186, 102), tile206 }, + { new Color(46, 23, 251), tile207 }, + { new Color(52, 222, 193), tile208 }, + { new Color(106, 61, 165), tile209 }, + { new Color(183, 68, 70), tile210 }, + { new Color(94, 78, 27), tile211 }, + { new Color(91, 8, 129), tile212 }, + { new Color(177, 242, 166), tile213 }, + { new Color(177, 190, 44), tile214 }, + { new Color(151, 70, 162), tile215 }, + { new Color(53, 7, 24), tile216 }, + { new Color(105, 77, 29), tile217 }, + { new Color(149, 149, 56), tile218 }, + { new Color(148, 201, 128), tile219 }, + { new Color(132, 180, 129), tile220 }, + { new Color(177, 188, 219), tile221 }, + { new Color(106, 177, 201), tile222 }, + { new Color(249, 39, 136), tile223 }, + { new Color(175, 88, 199), tile224 }, + { new Color(192, 124, 88), tile225 }, + { new Color(207, 156, 151), tile226 }, + { new Color(30, 52, 54), tile227 }, + { new Color(140, 77, 247), tile228 }, + { new Color(41, 201, 185), tile229 }, + { new Color(227, 199, 63), tile230 }, + { new Color(1, 44, 62), tile231 }, + { new Color(36, 0, 2), tile232 }, + { new Color(80, 45, 149), tile233 }, + { new Color(217, 60, 224), tile234 }, + { new Color(144, 186, 245), tile235 }, + { new Color(86, 213, 24), tile236 }, + { new Color(223, 196, 44), tile237 }, + { new Color(232, 102, 127), tile238 }, + { new Color(75, 36, 110), tile239 }, + { new Color(228, 65, 232), tile240 }, + { new Color(16, 22, 95), tile241 }, + { new Color(72, 173, 43), tile242 }, + { new Color(136, 155, 124), tile243 }, + { new Color(85, 126, 111), tile244 }, + { new Color(2, 69, 248), tile245 }, + { new Color(86, 252, 146), tile246 }, + { new Color(2, 210, 243), tile247 }, + { new Color(160, 3, 2), tile248 }, + { new Color(19, 25, 198), tile249 }, + { new Color(191, 217, 219), tile250 }, + { new Color(147, 107, 235), tile251 }, + { new Color(173, 200, 37), tile252 }, + { new Color(128, 71, 13), tile253 }, + { new Color(201, 206, 58), tile254 }, + { new Color(155, 137, 70), tile255 }, + { new Color(188, 229, 32), tile256 }, + { new Color(135, 245, 40), tile257 }, + { new Color(220, 226, 110), tile258 }, + { new Color(244, 111, 18), tile259 }, + }; + return new ColorTileMap(colorTileMap); + } + } +} diff --git a/Schematics/AutoGeneratedContent/ResearchFacility2Schematic.png b/Schematics/AutoGeneratedContent/ResearchFacility2Schematic.png new file mode 100644 index 0000000000..19a1f43979 Binary files /dev/null and b/Schematics/AutoGeneratedContent/ResearchFacility2Schematic.png differ diff --git a/Schematics/AutoGeneratedContent/Workshop2Schematic.cs b/Schematics/AutoGeneratedContent/Workshop2Schematic.cs new file mode 100644 index 0000000000..e9462d5482 --- /dev/null +++ b/Schematics/AutoGeneratedContent/Workshop2Schematic.cs @@ -0,0 +1,741 @@ +using CalamityMod.Tiles; +using CalamityMod.Tiles.DraedonStructures; +using CalamityMod.Walls.DraedonStructures; +using Microsoft.Xna.Framework; +using System.CodeDom.Compiler; +using System.Collections.Generic; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Schematics.AutoGeneratedContent +{ + public class Workshop2Schematic + { + [GeneratedCode("ScreenCaptureToSchematic", "1.0.2")] + public static ColorTileMap GetMap() + { + var tile1 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 0, 0, 0); + var tile2 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 8224).UseFrame(72, 54); + var tile3 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 16, 0, 32).UseFrame(288, 0); + var tile4 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 16, 0, 32).UseFrame(90, 18); + var tile5 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32).UseFrame(90, 0); + var tile6 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 32).UseFrame(90, 36); + var tile7 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32).UseFrame(288, 18); + var tile8 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32); + var tile9 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 16, 0, 16416).UseFrame(36, 72); + var tile10 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 16, 0, 32).UseFrame(54, 54); + var tile11 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 32).UseFrame(90, 72); + var tile12 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 132, 3, 0).UseWall((ushort)ModContent.WallType(), 144, 108); + var tile13 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 128, 2, 0).UseWall((ushort)ModContent.WallType(), 0, 72); + var tile14 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 0, 0, 0).UseWall((ushort)ModContent.WallType(), 0, 0); + var tile15 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 101, 1, 2144).UseFrame(162, 36).UseWall((ushort)ModContent.WallType(), 180, 36).MakeActuated(); + var tile16 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 133, 2, 0).UseWall((ushort)ModContent.WallType(), 180, 72); + var tile17 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 96, 1, 4128).UseFrame(90, 54).UseWall((ushort)ModContent.WallType(), 0, 36); + var tile18 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 148, 4, 32).UseFrame(72, 18).UseWall((ushort)ModContent.WallType(), 144, 144); + var tile19 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 8224).UseFrame(72, 54); + var tile20 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32).UseFrame(288, 0); + var tile21 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 164, 3, 12320).UseFrame(144, 54).UseWall((ushort)ModContent.WallType(), 144, 108); + var tile22 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 136, 2, 0).UseWall((ushort)ModContent.WallType(), 288, 72); + var tile23 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 1, 1, 0).UseWall((ushort)ModContent.WallType(), 36, 36); + var tile24 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 1, 4, 0).UseWall((ushort)ModContent.WallType(), 36, 144); + var tile25 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 2144).UseFrame(108, 72).MakeActuated(); + var tile26 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 1, 0, 0).UseWall((ushort)ModContent.WallType(), 36, 0); + var tile27 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 1, 2, 32).UseFrame(54, 0).UseWall((ushort)ModContent.WallType(), 36, 72); + var tile28 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32).UseFrame(162, 0); + var tile29 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 32).UseFrame(54, 0); + var tile30 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 16, 0, 32).UseFrame(36, 36); + var tile31 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 1, 3, 0).UseWall((ushort)ModContent.WallType(), 36, 108); + var tile32 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 1, 2, 0).UseWall((ushort)ModContent.WallType(), 36, 72); + var tile33 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 98, 3, 2144).UseFrame(144, 72).UseWall((ushort)ModContent.WallType(), 72, 108).MakeActuated(); + var tile34 = new TileDefinitionStructure(TileID.FishingCrate).UseHeaders(0, 133, 2, 32).UseWall((ushort)ModContent.WallType(), 180, 72); + var tile35 = new TileDefinitionStructure(TileID.FishingCrate).UseHeaders(0, 75, 1, 32).UseFrame(0, 18).UseWall((ushort)ModContent.WallType(), 396, 36); + var tile36 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 66, 2, 32).UseWall((ushort)ModContent.WallType(), 72, 72); + var tile37 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32).UseFrame(108, 72); + var tile38 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 16, 0, 32).UseFrame(36, 0); + var tile39 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32).UseFrame(18, 36); + var tile40 = new TileDefinitionStructure(TileID.HangingLanterns).UseHeaders(0, 0, 0, 32).UseFrame(0, 540); + var tile41 = new TileDefinitionStructure(TileID.HangingLanterns).UseHeaders(0, 1, 0, 32).UseFrame(0, 558).UseWall((ushort)ModContent.WallType(), 36, 0); + var tile42 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 136, 4, 2144).UseFrame(108, 72).UseWall((ushort)ModContent.WallType(), 288, 144).MakeActuated(); + var tile43 = new TileDefinitionStructure(TileID.FishingCrate).UseHeaders(0, 0, 0, 32).UseFrame(18, 0); + var tile44 = new TileDefinitionStructure(TileID.FishingCrate).UseHeaders(0, 1, 0, 32).UseFrame(18, 18).UseWall((ushort)ModContent.WallType(), 36, 0); + var tile45 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 1, 2, 32).UseWall((ushort)ModContent.WallType(), 36, 72); + var tile46 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 16, 0, 32).UseFrame(126, 72); + var tile47 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 32).UseFrame(288, 36); + var tile48 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 148, 3, 12320).UseFrame(54, 72).UseWall((ushort)ModContent.WallType(), 144, 108); + var tile49 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 64, 1, 0).UseWall((ushort)ModContent.WallType(), 0, 36); + var tile50 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 71, 2, 0).UseWall((ushort)ModContent.WallType(), 252, 72); + var tile51 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 66, 1, 0).UseWall((ushort)ModContent.WallType(), 72, 36); + var tile52 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 5, 0, 0).UseWall((ushort)ModContent.WallType(), 180, 0); + var tile53 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 147, 2, 2144).UseFrame(126, 72).UseWall((ushort)ModContent.WallType(), 108, 72).MakeActuated(); + var tile54 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 1, 2, 32).UseWall((ushort)ModContent.WallType(), 36, 72); + var tile55 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 32).UseFrame(144, 72); + var tile56 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32).UseFrame(36, 0); + var tile57 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 66, 0, 2144).UseFrame(108, 0).UseWall((ushort)ModContent.WallType(), 72, 0).MakeActuated(); + var tile58 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 43, 0, 2144).UseFrame(90, 36).UseWall((ushort)ModContent.WallType(), 396, 0).MakeActuated(); + var tile59 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 131, 1, 2144).UseFrame(90, 0).UseWall((ushort)ModContent.WallType(), 108, 36).MakeActuated(); + var tile60 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 163, 2, 2144).UseFrame(90, 36).UseWall((ushort)ModContent.WallType(), 108, 72).MakeActuated(); + var tile61 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 2144).UseFrame(90, 36).MakeActuated(); + var tile62 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 140, 2, 2144).UseFrame(18, 72).UseWall((ushort)ModContent.WallType(), 432, 72).MakeActuated(); + var tile63 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32).UseFrame(72, 0); + var tile64 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 131, 0, 0).UseWall((ushort)ModContent.WallType(), 108, 0); + var tile65 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 66, 1, 0).UseWall((ushort)ModContent.WallType(), 72, 36); + var tile66 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 133, 3, 0).UseWall((ushort)ModContent.WallType(), 180, 108); + var tile67 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 66, 2, 32).UseFrame(234, 0).UseWall((ushort)ModContent.WallType(), 72, 72); + var tile68 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32).UseFrame(306, 36); + var tile69 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 16, 0, 16416).UseFrame(36, 72); + var tile70 = new TileDefinitionStructure(TileID.Lamps).UseHeaders(0, 0, 0, 32).UseFrame(0, 216); + var tile71 = new TileDefinitionStructure(TileID.Lamps).UseHeaders(0, 0, 0, 32).UseFrame(0, 234); + var tile72 = new TileDefinitionStructure(TileID.Lamps).UseHeaders(0, 0, 0, 32).UseFrame(0, 252); + var tile73 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 16, 0, 32).UseFrame(36, 54); + var tile74 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 16, 0, 32).UseFrame(0, 18); + var tile75 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 16416).UseFrame(72, 72); + var tile76 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 32).UseFrame(72, 54); + var tile77 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 131, 1, 0).UseWall((ushort)ModContent.WallType(), 108, 36); + var tile78 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 6, 2, 0).UseWall((ushort)ModContent.WallType(), 216, 72); + var tile79 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 8224).UseFrame(144, 0); + var tile80 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 76, 1, 4128).UseFrame(180, 0).UseWall((ushort)ModContent.WallType(), 432, 36); + var tile81 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 4128).UseFrame(18, 54); + var tile82 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32).UseFrame(288, 72); + var tile83 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 16416).UseFrame(0, 72); + var tile84 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 8224).UseFrame(0, 54); + var tile85 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 16, 0, 32).UseFrame(270, 72); + var tile86 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32).UseFrame(18, 18); + var tile87 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 32).UseFrame(54, 18); + var tile88 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 16, 0, 32).UseFrame(36, 36); + var tile89 = new TileDefinitionStructure(TileID.TallGateOpen).UseHeaders(0, 0, 0, 32); + var tile90 = new TileDefinitionStructure(TileID.TallGateOpen).UseHeaders(0, 0, 0, 32).UseFrame(0, 20); + var tile91 = new TileDefinitionStructure(TileID.TallGateOpen).UseHeaders(0, 0, 0, 32).UseFrame(0, 38); + var tile92 = new TileDefinitionStructure(TileID.TallGateOpen).UseHeaders(0, 0, 0, 32).UseFrame(0, 56); + var tile93 = new TileDefinitionStructure(TileID.TallGateOpen).UseHeaders(0, 0, 0, 32).UseFrame(0, 74); + var tile94 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32).UseFrame(18, 0); + var tile95 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32).UseFrame(270, 54); + var tile96 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 66, 0, 0).UseWall((ushort)ModContent.WallType(), 72, 0); + var tile97 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 68, 1, 0).UseWall((ushort)ModContent.WallType(), 144, 36); + var tile98 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 131, 2, 0).UseWall((ushort)ModContent.WallType(), 108, 72); + var tile99 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 8224).UseFrame(144, 0); + var tile100 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 73, 1, 4128).UseFrame(180, 0).UseWall((ushort)ModContent.WallType(), 324, 36); + var tile101 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 16, 0, 4128).UseFrame(54, 54); + var tile102 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32).UseFrame(288, 54); + var tile103 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 32).UseFrame(270, 72); + var tile104 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 16, 0, 32).UseFrame(36, 18); + var tile105 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 16, 0, 32).UseFrame(252, 54); + var tile106 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 66, 3, 32).UseFrame(72, 0).UseWall((ushort)ModContent.WallType(), 72, 108); + var tile107 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 12320).UseFrame(90, 72).UseWall((ushort)ModContent.WallType(), 0, 0); + var tile108 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 128, 2, 0).UseWall((ushort)ModContent.WallType(), 0, 72); + var tile109 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 128, 2, 4128).UseFrame(18, 54).UseWall((ushort)ModContent.WallType(), 0, 72); + var tile110 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 82, 4, 32).UseFrame(72, 18).UseWall((ushort)ModContent.WallType(), 72, 144); + var tile111 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 32).UseFrame(288, 54); + var tile112 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 140, 2, 0).UseWall((ushort)ModContent.WallType(), 432, 72); + var tile113 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 131, 0, 0).UseWall((ushort)ModContent.WallType(), 108, 0); + var tile114 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 1, 0, 0).UseWall((ushort)ModContent.WallType(), 36, 0); + var tile115 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 64, 1, 4128).UseFrame(180, 0).UseWall((ushort)ModContent.WallType(), 0, 36); + var tile116 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 4128).UseFrame(90, 54).UseWall((ushort)ModContent.WallType(), 0, 0); + var tile117 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 96, 1, 32).UseFrame(72, 36).UseWall((ushort)ModContent.WallType(), 0, 36); + var tile118 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 4, 32).UseFrame(72, 0).UseWall((ushort)ModContent.WallType(), 0, 144); + var tile119 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 32).UseFrame(72, 36); + var tile120 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 98, 3, 12320).UseFrame(90, 72).UseWall((ushort)ModContent.WallType(), 72, 108); + var tile121 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 131, 1, 0).UseWall((ushort)ModContent.WallType(), 108, 36); + var tile122 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 10, 0, 0).UseWall((ushort)ModContent.WallType(), 360, 0); + var tile123 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 132, 2, 0).UseWall((ushort)ModContent.WallType(), 144, 72); + var tile124 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 4, 0, 32).UseWall((ushort)ModContent.WallType(), 144, 0); + var tile125 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 138, 2, 32).UseFrame(0, 16).UseWall((ushort)ModContent.WallType(), 360, 72); + var tile126 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 1, 1, 32).UseFrame(0, 32).UseWall((ushort)ModContent.WallType(), 36, 36); + var tile127 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 131, 1, 32).UseFrame(0, 48).UseWall((ushort)ModContent.WallType(), 108, 36); + var tile128 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 131, 2, 32).UseFrame(162, 0).UseWall((ushort)ModContent.WallType(), 108, 72); + var tile129 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 66, 0, 0).UseWall((ushort)ModContent.WallType(), 72, 0); + var tile130 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 64, 1, 0).UseWall((ushort)ModContent.WallType(), 0, 36); + var tile131 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 5, 0, 32).UseFrame(216, 0).UseWall((ushort)ModContent.WallType(), 180, 0); + var tile132 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 71, 2, 4128).UseFrame(180, 0).UseWall((ushort)ModContent.WallType(), 252, 72); + var tile133 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 1, 1, 0).UseWall((ushort)ModContent.WallType(), 36, 36); + var tile134 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 4, 0, 32).UseFrame(0, 54).UseWall((ushort)ModContent.WallType(), 144, 0); + var tile135 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 64, 1, 12320).UseFrame(108, 54).UseWall((ushort)ModContent.WallType(), 0, 36); + var tile136 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 1, 2, 0).UseWall((ushort)ModContent.WallType(), 36, 72); + var tile137 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32).UseFrame(16, 0); + var tile138 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 1, 0, 32).UseFrame(16, 16).UseWall((ushort)ModContent.WallType(), 36, 0); + var tile139 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 66, 1, 32).UseFrame(16, 32).UseWall((ushort)ModContent.WallType(), 72, 36); + var tile140 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 136, 2, 32).UseFrame(16, 48).UseWall((ushort)ModContent.WallType(), 288, 72); + var tile141 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 82, 2, 32).UseFrame(126, 72).UseWall((ushort)ModContent.WallType(), 72, 72); + var tile142 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 66, 3, 0).UseWall((ushort)ModContent.WallType(), 72, 108); + var tile143 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 0, 0, 0).UseWall((ushort)ModContent.WallType(), 0, 0); + var tile144 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 1, 1, 0).UseWall((ushort)ModContent.WallType(), 36, 36); + var tile145 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 136, 1, 0).UseWall((ushort)ModContent.WallType(), 288, 36); + var tile146 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 66, 2, 0).UseWall((ushort)ModContent.WallType(), 72, 72); + var tile147 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32); + var tile148 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 66, 0, 0).UseWall((ushort)ModContent.WallType(), 72, 0); + var tile149 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 139, 2, 0).UseWall((ushort)ModContent.WallType(), 396, 72); + var tile150 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 68, 1, 0).UseWall((ushort)ModContent.WallType(), 144, 36); + var tile151 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 132, 2, 0).UseWall((ushort)ModContent.WallType(), 144, 72); + var tile152 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 1, 1, 0).UseWall((ushort)ModContent.WallType(), 36, 36); + var tile153 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 66, 2, 4128).UseFrame(180, 0).UseWall((ushort)ModContent.WallType(), 72, 72); + var tile154 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 32).UseFrame(144, 72); + var tile155 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 67, 3, 0).UseWall((ushort)ModContent.WallType(), 108, 108); + var tile156 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 11, 0, 0).UseWall((ushort)ModContent.WallType(), 396, 0); + var tile157 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 66, 1, 0).UseWall((ushort)ModContent.WallType(), 72, 36); + var tile158 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 4, 0, 0).UseWall((ushort)ModContent.WallType(), 144, 0); + var tile159 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 133, 2, 0).UseWall((ushort)ModContent.WallType(), 180, 72); + var tile160 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 133, 2, 32).UseFrame(32, 0).UseWall((ushort)ModContent.WallType(), 180, 72); + var tile161 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 6, 1, 32).UseFrame(32, 16).UseWall((ushort)ModContent.WallType(), 216, 36); + var tile162 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 139, 2, 32).UseFrame(32, 32).UseWall((ushort)ModContent.WallType(), 396, 72); + var tile163 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 1, 1, 32).UseFrame(32, 48).UseWall((ushort)ModContent.WallType(), 36, 36); + var tile164 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 33, 2, 32).UseFrame(144, 72).UseWall((ushort)ModContent.WallType(), 36, 72); + var tile165 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 138, 2, 0).UseWall((ushort)ModContent.WallType(), 360, 72); + var tile166 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 1, 1, 0).UseWall((ushort)ModContent.WallType(), 36, 36); + var tile167 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 69, 1, 32).UseWall((ushort)ModContent.WallType(), 180, 36); + var tile168 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 66, 2, 0).UseWall((ushort)ModContent.WallType(), 72, 72); + var tile169 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 67, 3, 0).UseWall((ushort)ModContent.WallType(), 108, 108); + var tile170 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 87, 3, 32).UseFrame(216, 18).UseWall((ushort)ModContent.WallType(), 252, 108); + var tile171 = new TileDefinitionStructure(TileID.HangingLanterns).UseHeaders(0, 0, 0, 32).UseFrame(0, 558); + var tile172 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32).UseFrame(48, 0); + var tile173 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 1, 3, 32).UseFrame(48, 16).UseWall((ushort)ModContent.WallType(), 36, 108); + var tile174 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 132, 2, 32).UseFrame(48, 32).UseWall((ushort)ModContent.WallType(), 144, 72); + var tile175 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 66, 1, 32).UseFrame(48, 48).UseWall((ushort)ModContent.WallType(), 72, 36); + var tile176 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 98, 2, 32).UseFrame(216, 36).UseWall((ushort)ModContent.WallType(), 72, 72); + var tile177 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 66, 2, 0).UseWall((ushort)ModContent.WallType(), 72, 72); + var tile178 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32); + var tile179 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 136, 4, 0).UseWall((ushort)ModContent.WallType(), 288, 144); + var tile180 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32).UseFrame(54, 0); + var tile181 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 131, 0, 0).UseWall((ushort)ModContent.WallType(), 108, 0); + var tile182 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 33, 2, 32).UseFrame(72, 54).UseWall((ushort)ModContent.WallType(), 36, 72); + var tile183 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 16, 0, 32).UseFrame(306, 54); + var tile184 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 1, 0, 0).UseWall((ushort)ModContent.WallType(), 36, 0); + var tile185 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 136, 1, 0).UseWall((ushort)ModContent.WallType(), 288, 36); + var tile186 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 1, 2, 0).UseWall((ushort)ModContent.WallType(), 36, 72); + var tile187 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 6, 4, 0).UseWall((ushort)ModContent.WallType(), 216, 144); + var tile188 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 66, 0, 0).UseWall((ushort)ModContent.WallType(), 72, 0); + var tile189 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 82, 2, 32).UseFrame(36, 0).UseWall((ushort)ModContent.WallType(), 72, 72); + var tile190 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 74, 1, 32).UseWall((ushort)ModContent.WallType(), 360, 36); + var tile191 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 131, 2, 32).UseFrame(0, 18).UseWall((ushort)ModContent.WallType(), 108, 72); + var tile192 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 71, 4, 0).UseWall((ushort)ModContent.WallType(), 252, 144); + var tile193 = new TileDefinitionStructure(TileID.FishingCrate).UseHeaders(0, 0, 0, 32); + var tile194 = new TileDefinitionStructure(TileID.FishingCrate).UseHeaders(0, 0, 0, 32).UseFrame(0, 18); + var tile195 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 131, 1, 32).UseFrame(18, 0).UseWall((ushort)ModContent.WallType(), 108, 36); + var tile196 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 66, 1, 32).UseFrame(18, 18).UseWall((ushort)ModContent.WallType(), 72, 36); + var tile197 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 64, 1, 32).UseWall((ushort)ModContent.WallType(), 0, 36); + var tile198 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 131, 2, 0).UseWall((ushort)ModContent.WallType(), 108, 72); + var tile199 = new TileDefinitionStructure(TileID.FishingCrate).UseHeaders(0, 6, 0, 32).UseFrame(18, 0).UseWall((ushort)ModContent.WallType(), 216, 0); + var tile200 = new TileDefinitionStructure(TileID.FishingCrate).UseHeaders(0, 132, 4, 32).UseFrame(18, 18).UseWall((ushort)ModContent.WallType(), 144, 144); + var tile201 = new TileDefinitionStructure(TileID.FishingCrate).UseHeaders(0, 0, 0, 32).UseFrame(36, 0); + var tile202 = new TileDefinitionStructure(TileID.FishingCrate).UseHeaders(0, 66, 0, 32).UseFrame(36, 18).UseWall((ushort)ModContent.WallType(), 72, 0); + var tile203 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 33, 2, 32).UseFrame(54, 0).UseWall((ushort)ModContent.WallType(), 36, 72); + var tile204 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 137, 2, 0).UseWall((ushort)ModContent.WallType(), 324, 72); + var tile205 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 6, 1, 0).UseWall((ushort)ModContent.WallType(), 216, 36); + var tile206 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 139, 2, 0).UseWall((ushort)ModContent.WallType(), 396, 72); + var tile207 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 131, 1, 32).UseWall((ushort)ModContent.WallType(), 108, 36); + var tile208 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 136, 1, 0).UseWall((ushort)ModContent.WallType(), 288, 36); + var tile209 = new TileDefinitionStructure(TileID.FishingCrate).UseHeaders(0, 0, 0, 32).UseFrame(18, 18); + var tile210 = new TileDefinitionStructure(TileID.FishingCrate).UseHeaders(0, 1, 0, 32).UseFrame(0, 18).UseWall((ushort)ModContent.WallType(), 36, 0); + var tile211 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 4, 32).UseWall((ushort)ModContent.WallType(), 0, 144); + var tile212 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 66, 3, 0).UseWall((ushort)ModContent.WallType(), 72, 108); + var tile213 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 11, 0, 0).UseWall((ushort)ModContent.WallType(), 396, 0); + var tile214 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 71, 0, 0).UseWall((ushort)ModContent.WallType(), 252, 0); + var tile215 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 69, 1, 0).UseWall((ushort)ModContent.WallType(), 180, 36); + var tile216 = new TileDefinitionStructure(TileID.FishingCrate).UseHeaders(0, 69, 1, 32).UseFrame(54, 0).UseWall((ushort)ModContent.WallType(), 180, 36); + var tile217 = new TileDefinitionStructure(TileID.FishingCrate).UseHeaders(0, 66, 1, 32).UseFrame(54, 18).UseWall((ushort)ModContent.WallType(), 72, 36); + var tile218 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 147, 2, 32).UseFrame(36, 0).UseWall((ushort)ModContent.WallType(), 108, 72); + var tile219 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 131, 1, 0).UseWall((ushort)ModContent.WallType(), 108, 36); + var tile220 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 1, 1, 32).UseWall((ushort)ModContent.WallType(), 36, 36); + var tile221 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 67, 4, 0).UseWall((ushort)ModContent.WallType(), 108, 144); + var tile222 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 6, 0, 0).UseWall((ushort)ModContent.WallType(), 216, 0); + var tile223 = new TileDefinitionStructure(TileID.FishingCrate).UseHeaders(0, 0, 0, 32).UseFrame(18, 0).UseWall((ushort)ModContent.WallType(), 0, 0); + var tile224 = new TileDefinitionStructure(TileID.FishingCrate).UseHeaders(0, 138, 2, 32).UseFrame(18, 18).UseWall((ushort)ModContent.WallType(), 360, 72); + var tile225 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 132, 2, 32).UseFrame(72, 0).UseWall((ushort)ModContent.WallType(), 144, 72); + var tile226 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 138, 2, 0).UseWall((ushort)ModContent.WallType(), 360, 72); + var tile227 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 33, 1, 2144).UseFrame(72, 54).UseWall((ushort)ModContent.WallType(), 36, 36).MakeActuated(); + var tile228 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 16, 0, 2144).UseFrame(90, 18).MakeActuated(); + var tile229 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 2144).UseFrame(90, 0).MakeActuated(); + var tile230 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 1, 0, 2144).UseFrame(108, 54).UseWall((ushort)ModContent.WallType(), 36, 0).MakeActuated(); + var tile231 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 66, 2, 32).UseFrame(18, 54).UseWall((ushort)ModContent.WallType(), 72, 72); + var tile232 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 66, 1, 0).UseWall((ushort)ModContent.WallType(), 72, 36); + var tile233 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 66, 2, 32).UseWall((ushort)ModContent.WallType(), 72, 72); + var tile234 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32).UseFrame(162, 0); + var tile235 = new TileDefinitionStructure(TileID.HangingLanterns).UseHeaders(0, 1, 0, 32).UseFrame(0, 540).UseWall((ushort)ModContent.WallType(), 36, 0); + var tile236 = new TileDefinitionStructure(TileID.HangingLanterns).UseHeaders(0, 66, 1, 32).UseFrame(0, 558).UseWall((ushort)ModContent.WallType(), 72, 36); + var tile237 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 17, 1, 2144).UseFrame(126, 72).UseWall((ushort)ModContent.WallType(), 36, 36).MakeActuated(); + var tile238 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32); + var tile239 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 132, 3, 32).UseFrame(0, 16).UseWall((ushort)ModContent.WallType(), 144, 108); + var tile240 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32).UseFrame(0, 32).UseWall((ushort)ModContent.WallType(), 0, 0); + var tile241 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 136, 2, 32).UseFrame(0, 48).UseWall((ushort)ModContent.WallType(), 288, 72); + var tile242 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 66, 2, 32).UseFrame(162, 0).UseWall((ushort)ModContent.WallType(), 72, 72); + var tile243 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 75, 1, 0).UseWall((ushort)ModContent.WallType(), 396, 36); + var tile244 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 132, 2, 32).UseWall((ushort)ModContent.WallType(), 144, 72); + var tile245 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 64, 1, 0).UseWall((ushort)ModContent.WallType(), 0, 36); + var tile246 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 133, 2, 0).UseWall((ushort)ModContent.WallType(), 180, 72); + var tile247 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 69, 1, 0).UseWall((ushort)ModContent.WallType(), 180, 36); + var tile248 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 69, 1, 0).UseWall((ushort)ModContent.WallType(), 180, 36); + var tile249 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 68, 1, 0).UseWall((ushort)ModContent.WallType(), 144, 36); + var tile250 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 6, 1, 8224).UseFrame(144, 0).UseWall((ushort)ModContent.WallType(), 216, 36); + var tile251 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 64, 1, 32).UseFrame(108, 72).UseWall((ushort)ModContent.WallType(), 0, 36); + var tile252 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 131, 1, 0).UseWall((ushort)ModContent.WallType(), 108, 36); + var tile253 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 43, 0, 2144).UseFrame(144, 72).UseWall((ushort)ModContent.WallType(), 396, 0).MakeActuated(); + var tile254 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 131, 1, 0).UseWall((ushort)ModContent.WallType(), 108, 36); + var tile255 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 5, 0, 0).UseWall((ushort)ModContent.WallType(), 180, 0); + var tile256 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 133, 2, 32).UseFrame(16, 0).UseWall((ushort)ModContent.WallType(), 180, 72); + var tile257 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 6, 1, 32).UseFrame(16, 16).UseWall((ushort)ModContent.WallType(), 216, 36); + var tile258 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 11, 0, 32).UseFrame(16, 32).UseWall((ushort)ModContent.WallType(), 396, 0); + var tile259 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 1, 1, 32).UseFrame(16, 48).UseWall((ushort)ModContent.WallType(), 36, 36); + var tile260 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 147, 2, 32).UseFrame(126, 72).UseWall((ushort)ModContent.WallType(), 108, 72); + var tile261 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 133, 3, 0).UseWall((ushort)ModContent.WallType(), 180, 108); + var tile262 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 4, 0, 0).UseWall((ushort)ModContent.WallType(), 144, 0); + var tile263 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 10, 0, 0).UseWall((ushort)ModContent.WallType(), 360, 0); + var tile264 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 1, 4, 0).UseWall((ushort)ModContent.WallType(), 36, 144); + var tile265 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32).UseFrame(234, 0); + var tile266 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 82, 1, 32).UseFrame(54, 54).UseWall((ushort)ModContent.WallType(), 72, 36); + var tile267 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 98, 1, 16416).UseFrame(144, 54).UseWall((ushort)ModContent.WallType(), 72, 36); + var tile268 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 74, 1, 0).UseWall((ushort)ModContent.WallType(), 360, 36); + var tile269 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 147, 1, 2144).UseFrame(126, 72).UseWall((ushort)ModContent.WallType(), 108, 36).MakeActuated(); + var tile270 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 66, 2, 0).UseWall((ushort)ModContent.WallType(), 72, 72); + var tile271 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32).UseFrame(32, 0); + var tile272 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 66, 0, 32).UseFrame(32, 16).UseWall((ushort)ModContent.WallType(), 72, 0); + var tile273 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 66, 1, 32).UseFrame(32, 32).UseWall((ushort)ModContent.WallType(), 72, 36); + var tile274 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 66, 1, 32).UseFrame(32, 48).UseWall((ushort)ModContent.WallType(), 72, 36); + var tile275 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 17, 2, 32).UseFrame(126, 72).UseWall((ushort)ModContent.WallType(), 36, 72); + var tile276 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 66, 3, 4128).UseFrame(180, 0).UseWall((ushort)ModContent.WallType(), 72, 108); + var tile277 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 0, 4, 0).UseWall((ushort)ModContent.WallType(), 0, 144); + var tile278 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 8224).UseFrame(0, 54); + var tile279 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 83, 3, 32).UseFrame(0, 18).UseWall((ushort)ModContent.WallType(), 108, 108); + var tile280 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 68, 1, 32).UseWall((ushort)ModContent.WallType(), 144, 36); + var tile281 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 148, 2, 32).UseFrame(0, 18).UseWall((ushort)ModContent.WallType(), 144, 72); + var tile282 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 17, 1, 16416).UseFrame(36, 72).UseWall((ushort)ModContent.WallType(), 36, 36); + var tile283 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 66, 1, 2144).UseFrame(216, 0).UseWall((ushort)ModContent.WallType(), 72, 36).MakeActuated(); + var tile284 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32).UseFrame(48, 0).UseWall((ushort)ModContent.WallType(), 0, 0); + var tile285 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 1, 1, 32).UseFrame(48, 16).UseWall((ushort)ModContent.WallType(), 36, 36); + var tile286 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 66, 1, 32).UseFrame(48, 32).UseWall((ushort)ModContent.WallType(), 72, 36); + var tile287 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 6, 2, 32).UseFrame(48, 48).UseWall((ushort)ModContent.WallType(), 216, 72); + var tile288 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 163, 2, 32).UseFrame(216, 36).UseWall((ushort)ModContent.WallType(), 108, 72); + var tile289 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 68, 1, 4128).UseFrame(180, 0).UseWall((ushort)ModContent.WallType(), 144, 36); + var tile290 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 32).UseFrame(306, 54); + var tile291 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32).UseFrame(18, 54); + var tile292 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 16, 0, 32).UseFrame(252, 72); + var tile293 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 99, 3, 32).UseFrame(270, 54).UseWall((ushort)ModContent.WallType(), 108, 108); + var tile294 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 20, 0, 32).UseFrame(0, 18).UseWall((ushort)ModContent.WallType(), 144, 0); + var tile295 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 132, 2, 16416).UseFrame(0, 72).UseWall((ushort)ModContent.WallType(), 144, 72); + var tile296 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 100, 1, 8224).UseFrame(72, 54).UseWall((ushort)ModContent.WallType(), 144, 36); + var tile297 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 17, 4, 32).UseFrame(0, 18).UseWall((ushort)ModContent.WallType(), 36, 144); + var tile298 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32).UseFrame(306, 54); + var tile299 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 1, 0, 4128).UseFrame(180, 0).UseWall((ushort)ModContent.WallType(), 36, 0); + var tile300 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 132, 4, 8224).UseFrame(144, 0).UseWall((ushort)ModContent.WallType(), 144, 144); + var tile301 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 32).UseFrame(306, 72); + var tile302 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 16, 0, 12320).UseFrame(54, 72); + var tile303 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 4128).UseFrame(18, 54); + var tile304 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 32).UseFrame(252, 72); + var tile305 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 32).UseFrame(54, 36); + var tile306 = new TileDefinitionStructure(TileID.TallGateClosed).UseHeaders(0, 0, 0, 32); + var tile307 = new TileDefinitionStructure(TileID.TallGateClosed).UseHeaders(0, 0, 0, 32).UseFrame(0, 20); + var tile308 = new TileDefinitionStructure(TileID.TallGateClosed).UseHeaders(0, 0, 0, 32).UseFrame(0, 38); + var tile309 = new TileDefinitionStructure(TileID.TallGateClosed).UseHeaders(0, 0, 0, 32).UseFrame(0, 56); + var tile310 = new TileDefinitionStructure(TileID.TallGateClosed).UseHeaders(0, 0, 0, 32).UseFrame(0, 74); + var tile311 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32).UseFrame(252, 54); + var tile312 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 12320).UseFrame(90, 72); + var tile313 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 16, 0, 32).UseFrame(126, 0); + var tile314 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 32).UseFrame(90, 36); + var tile315 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 82, 0, 32).UseFrame(90, 18).UseWall((ushort)ModContent.WallType(), 72, 0); + var tile316 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 33, 2, 32).UseFrame(72, 72).UseWall((ushort)ModContent.WallType(), 36, 72); + var tile317 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 66, 2, 32).UseFrame(216, 0).UseWall((ushort)ModContent.WallType(), 72, 72); + var tile318 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32).UseFrame(288, 36); + var tile319 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 12320).UseFrame(18, 72); + var tile320 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 16, 0, 32).UseFrame(72, 18); + var tile321 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 12320).UseFrame(90, 72); + var tile322 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 32).UseFrame(90, 54); + var tile323 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 132, 3, 0).UseWall((ushort)ModContent.WallType(), 144, 108); + var tile324 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 66, 2, 32).UseFrame(108, 72).UseWall((ushort)ModContent.WallType(), 72, 72); + var tile325 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32).UseFrame(54, 0); + var tile326 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 17, 3, 16416).UseFrame(36, 72).UseWall((ushort)ModContent.WallType(), 36, 108); + var tile327 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 10, 0, 32).UseFrame(108, 72).UseWall((ushort)ModContent.WallType(), 360, 0); + var tile328 = new TileDefinitionStructure(TileID.HeavyWorkBench).UseHeaders(0, 132, 4, 32).UseWall((ushort)ModContent.WallType(), 144, 144); + var tile329 = new TileDefinitionStructure(TileID.HeavyWorkBench).UseHeaders(0, 0, 0, 32).UseFrame(0, 18); + var tile330 = new TileDefinitionStructure(TileID.HeavyWorkBench).UseHeaders(0, 131, 0, 32).UseFrame(0, 36).UseWall((ushort)ModContent.WallType(), 108, 0); + var tile331 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 131, 2, 32).UseWall((ushort)ModContent.WallType(), 108, 72); + var tile332 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32).UseFrame(18, 0); + var tile333 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 32).UseFrame(54, 36); + var tile334 = new TileDefinitionStructure(TileID.HangingLanterns).UseHeaders(0, 131, 0, 32).UseFrame(0, 540).UseWall((ushort)ModContent.WallType(), 108, 0); + var tile335 = new TileDefinitionStructure(TileID.HangingLanterns).UseHeaders(0, 6, 2, 32).UseFrame(0, 558).UseWall((ushort)ModContent.WallType(), 216, 72); + var tile336 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 131, 1, 32).UseFrame(108, 72).UseWall((ushort)ModContent.WallType(), 108, 36); + var tile337 = new TileDefinitionStructure(TileID.HeavyWorkBench).UseHeaders(0, 71, 2, 32).UseFrame(18, 0).UseWall((ushort)ModContent.WallType(), 252, 72); + var tile338 = new TileDefinitionStructure(TileID.HeavyWorkBench).UseHeaders(0, 0, 0, 32).UseFrame(18, 18).UseWall((ushort)ModContent.WallType(), 0, 0); + var tile339 = new TileDefinitionStructure(TileID.HeavyWorkBench).UseHeaders(0, 131, 1, 32).UseFrame(18, 36).UseWall((ushort)ModContent.WallType(), 108, 36); + var tile340 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 6, 1, 32).UseFrame(108, 72).UseWall((ushort)ModContent.WallType(), 216, 36); + var tile341 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 75, 1, 0).UseWall((ushort)ModContent.WallType(), 396, 36); + var tile342 = new TileDefinitionStructure(TileID.HeavyWorkBench).UseHeaders(0, 131, 1, 32).UseFrame(36, 0).UseWall((ushort)ModContent.WallType(), 108, 36); + var tile343 = new TileDefinitionStructure(TileID.HeavyWorkBench).UseHeaders(0, 6, 1, 32).UseFrame(36, 18).UseWall((ushort)ModContent.WallType(), 216, 36); + var tile344 = new TileDefinitionStructure(TileID.HeavyWorkBench).UseHeaders(0, 75, 1, 32).UseFrame(36, 36).UseWall((ushort)ModContent.WallType(), 396, 36); + var tile345 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 32).UseFrame(306, 0); + var tile346 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 17, 3, 16416).UseFrame(126, 54).UseWall((ushort)ModContent.WallType(), 36, 108); + var tile347 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 42, 0, 32).UseFrame(144, 72).UseWall((ushort)ModContent.WallType(), 360, 0); + var tile348 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 131, 2, 32).UseFrame(72, 0).UseWall((ushort)ModContent.WallType(), 108, 72); + var tile349 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32).UseFrame(216, 0); + var tile350 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32).UseFrame(0, 54); + var tile351 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 32).UseFrame(72, 72); + var tile352 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 133, 3, 0).UseWall((ushort)ModContent.WallType(), 180, 108); + var tile353 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 164, 2, 32).UseFrame(216, 36).UseWall((ushort)ModContent.WallType(), 144, 72); + var tile354 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 164, 2, 8224).UseFrame(72, 54).UseWall((ushort)ModContent.WallType(), 144, 72); + var tile355 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 165, 4, 32).UseFrame(0, 36).UseWall((ushort)ModContent.WallType(), 180, 144); + var tile356 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 4128).UseFrame(90, 54); + var tile357 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 32, 0, 32).UseFrame(306, 0); + var tile358 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 32).UseFrame(306, 18); + var tile359 = new TileDefinitionStructure(ModContent.TileType()).UseHeaders(0, 0, 0, 12320).UseFrame(18, 72); + Dictionary colorTileMap = new Dictionary() + { + { new Color(0, 0, 0), tile1 }, + { new Color(114, 195, 225), tile2 }, + { new Color(226, 74, 12), tile3 }, + { new Color(228, 243, 191), tile4 }, + { new Color(144, 205, 196), tile5 }, + { new Color(39, 4, 64), tile6 }, + { new Color(112, 181, 57), tile7 }, + { new Color(106, 30, 171), tile8 }, + { new Color(8, 54, 212), tile9 }, + { new Color(26, 140, 167), tile10 }, + { new Color(233, 4, 18), tile11 }, + { new Color(173, 222, 58), tile12 }, + { new Color(173, 194, 45), tile13 }, + { new Color(67, 215, 12), tile14 }, + { new Color(71, 99, 37), tile15 }, + { new Color(6, 22, 237), tile16 }, + { new Color(28, 144, 14), tile17 }, + { new Color(209, 119, 142), tile18 }, + { new Color(75, 230, 38), tile19 }, + { new Color(191, 106, 140), tile20 }, + { new Color(13, 199, 189), tile21 }, + { new Color(100, 250, 238), tile22 }, + { new Color(172, 226, 239), tile23 }, + { new Color(138, 121, 66), tile24 }, + { new Color(19, 44, 222), tile25 }, + { new Color(44, 34, 187), tile26 }, + { new Color(133, 1, 31), tile27 }, + { new Color(230, 253, 252), tile28 }, + { new Color(153, 23, 141), tile29 }, + { new Color(132, 98, 248), tile30 }, + { new Color(20, 238, 88), tile31 }, + { new Color(161, 54, 15), tile32 }, + { new Color(79, 226, 104), tile33 }, + { new Color(55, 89, 52), tile34 }, + { new Color(254, 146, 22), tile35 }, + { new Color(203, 190, 74), tile36 }, + { new Color(176, 31, 195), tile37 }, + { new Color(106, 57, 104), tile38 }, + { new Color(109, 38, 202), tile39 }, + { new Color(193, 203, 227), tile40 }, + { new Color(96, 40, 127), tile41 }, + { new Color(246, 117, 139), tile42 }, + { new Color(233, 113, 246), tile43 }, + { new Color(206, 221, 63), tile44 }, + { new Color(82, 77, 167), tile45 }, + { new Color(234, 232, 106), tile46 }, + { new Color(230, 205, 88), tile47 }, + { new Color(67, 212, 67), tile48 }, + { new Color(53, 169, 180), tile49 }, + { new Color(239, 51, 15), tile50 }, + { new Color(69, 141, 23), tile51 }, + { new Color(133, 215, 49), tile52 }, + { new Color(180, 7, 28), tile53 }, + { new Color(138, 226, 77), tile54 }, + { new Color(83, 225, 65), tile55 }, + { new Color(131, 24, 235), tile56 }, + { new Color(192, 130, 61), tile57 }, + { new Color(95, 218, 253), tile58 }, + { new Color(139, 29, 84), tile59 }, + { new Color(60, 193, 204), tile60 }, + { new Color(215, 250, 62), tile61 }, + { new Color(230, 137, 79), tile62 }, + { new Color(39, 205, 118), tile63 }, + { new Color(118, 54, 225), tile64 }, + { new Color(78, 92, 235), tile65 }, + { new Color(11, 239, 242), tile66 }, + { new Color(1, 177, 145), tile67 }, + { new Color(200, 47, 177), tile68 }, + { new Color(210, 230, 179), tile69 }, + { new Color(26, 250, 186), tile70 }, + { new Color(220, 119, 69), tile71 }, + { new Color(80, 179, 232), tile72 }, + { new Color(14, 109, 88), tile73 }, + { new Color(241, 91, 74), tile74 }, + { new Color(116, 74, 76), tile75 }, + { new Color(92, 17, 125), tile76 }, + { new Color(17, 127, 45), tile77 }, + { new Color(97, 58, 16), tile78 }, + { new Color(58, 14, 203), tile79 }, + { new Color(140, 20, 162), tile80 }, + { new Color(155, 13, 211), tile81 }, + { new Color(188, 153, 190), tile82 }, + { new Color(155, 253, 169), tile83 }, + { new Color(3, 252, 130), tile84 }, + { new Color(154, 15, 85), tile85 }, + { new Color(70, 84, 229), tile86 }, + { new Color(100, 117, 213), tile87 }, + { new Color(53, 8, 122), tile88 }, + { new Color(140, 123, 61), tile89 }, + { new Color(53, 22, 164), tile90 }, + { new Color(28, 129, 88), tile91 }, + { new Color(181, 86, 78), tile92 }, + { new Color(119, 184, 176), tile93 }, + { new Color(142, 193, 19), tile94 }, + { new Color(212, 14, 131), tile95 }, + { new Color(170, 199, 43), tile96 }, + { new Color(186, 243, 186), tile97 }, + { new Color(230, 40, 158), tile98 }, + { new Color(205, 102, 4), tile99 }, + { new Color(88, 47, 30), tile100 }, + { new Color(129, 101, 231), tile101 }, + { new Color(4, 230, 122), tile102 }, + { new Color(41, 229, 185), tile103 }, + { new Color(7, 207, 155), tile104 }, + { new Color(52, 214, 180), tile105 }, + { new Color(193, 97, 250), tile106 }, + { new Color(247, 225, 179), tile107 }, + { new Color(17, 122, 34), tile108 }, + { new Color(234, 54, 89), tile109 }, + { new Color(186, 231, 239), tile110 }, + { new Color(73, 31, 136), tile111 }, + { new Color(145, 13, 91), tile112 }, + { new Color(44, 207, 39), tile113 }, + { new Color(9, 129, 225), tile114 }, + { new Color(113, 179, 36), tile115 }, + { new Color(30, 177, 81), tile116 }, + { new Color(234, 12, 5), tile117 }, + { new Color(10, 97, 77), tile118 }, + { new Color(106, 111, 235), tile119 }, + { new Color(196, 26, 175), tile120 }, + { new Color(32, 111, 253), tile121 }, + { new Color(202, 189, 175), tile122 }, + { new Color(19, 163, 201), tile123 }, + { new Color(89, 148, 145), tile124 }, + { new Color(210, 238, 96), tile125 }, + { new Color(210, 160, 198), tile126 }, + { new Color(253, 203, 133), tile127 }, + { new Color(7, 208, 218), tile128 }, + { new Color(234, 63, 190), tile129 }, + { new Color(58, 38, 158), tile130 }, + { new Color(111, 104, 181), tile131 }, + { new Color(119, 232, 18), tile132 }, + { new Color(227, 167, 245), tile133 }, + { new Color(116, 11, 13), tile134 }, + { new Color(136, 144, 120), tile135 }, + { new Color(115, 55, 115), tile136 }, + { new Color(237, 152, 206), tile137 }, + { new Color(36, 199, 78), tile138 }, + { new Color(41, 24, 158), tile139 }, + { new Color(34, 223, 126), tile140 }, + { new Color(241, 217, 125), tile141 }, + { new Color(43, 233, 44), tile142 }, + { new Color(219, 91, 5), tile143 }, + { new Color(78, 238, 249), tile144 }, + { new Color(209, 136, 192), tile145 }, + { new Color(120, 127, 63), tile146 }, + { new Color(98, 119, 7), tile147 }, + { new Color(74, 76, 141), tile148 }, + { new Color(207, 75, 161), tile149 }, + { new Color(103, 78, 207), tile150 }, + { new Color(115, 192, 200), tile151 }, + { new Color(118, 131, 49), tile152 }, + { new Color(144, 93, 167), tile153 }, + { new Color(76, 151, 220), tile154 }, + { new Color(109, 158, 170), tile155 }, + { new Color(213, 83, 62), tile156 }, + { new Color(141, 177, 153), tile157 }, + { new Color(95, 192, 104), tile158 }, + { new Color(119, 166, 140), tile159 }, + { new Color(239, 91, 158), tile160 }, + { new Color(139, 116, 12), tile161 }, + { new Color(53, 219, 45), tile162 }, + { new Color(49, 90, 5), tile163 }, + { new Color(143, 231, 34), tile164 }, + { new Color(152, 22, 223), tile165 }, + { new Color(43, 221, 174), tile166 }, + { new Color(227, 250, 247), tile167 }, + { new Color(98, 217, 156), tile168 }, + { new Color(54, 19, 0), tile169 }, + { new Color(95, 255, 220), tile170 }, + { new Color(165, 160, 1), tile171 }, + { new Color(8, 193, 34), tile172 }, + { new Color(207, 55, 195), tile173 }, + { new Color(124, 163, 249), tile174 }, + { new Color(57, 254, 201), tile175 }, + { new Color(118, 198, 169), tile176 }, + { new Color(136, 75, 201), tile177 }, + { new Color(222, 12, 97), tile178 }, + { new Color(166, 40, 155), tile179 }, + { new Color(112, 255, 199), tile180 }, + { new Color(45, 209, 90), tile181 }, + { new Color(41, 233, 71), tile182 }, + { new Color(32, 143, 85), tile183 }, + { new Color(188, 91, 165), tile184 }, + { new Color(234, 103, 86), tile185 }, + { new Color(254, 41, 219), tile186 }, + { new Color(210, 191, 77), tile187 }, + { new Color(86, 215, 180), tile188 }, + { new Color(18, 199, 148), tile189 }, + { new Color(160, 98, 152), tile190 }, + { new Color(135, 94, 56), tile191 }, + { new Color(251, 79, 210), tile192 }, + { new Color(159, 16, 21), tile193 }, + { new Color(130, 85, 54), tile194 }, + { new Color(84, 203, 239), tile195 }, + { new Color(36, 243, 165), tile196 }, + { new Color(10, 167, 255), tile197 }, + { new Color(191, 157, 63), tile198 }, + { new Color(122, 214, 250), tile199 }, + { new Color(166, 22, 33), tile200 }, + { new Color(178, 128, 45), tile201 }, + { new Color(189, 53, 252), tile202 }, + { new Color(108, 238, 23), tile203 }, + { new Color(132, 95, 25), tile204 }, + { new Color(198, 79, 105), tile205 }, + { new Color(22, 2, 11), tile206 }, + { new Color(196, 237, 212), tile207 }, + { new Color(239, 149, 186), tile208 }, + { new Color(153, 199, 193), tile209 }, + { new Color(249, 129, 121), tile210 }, + { new Color(216, 248, 249), tile211 }, + { new Color(243, 208, 213), tile212 }, + { new Color(9, 150, 150), tile213 }, + { new Color(243, 184, 4), tile214 }, + { new Color(141, 133, 72), tile215 }, + { new Color(230, 249, 77), tile216 }, + { new Color(213, 100, 211), tile217 }, + { new Color(238, 226, 40), tile218 }, + { new Color(77, 195, 234), tile219 }, + { new Color(115, 35, 109), tile220 }, + { new Color(59, 114, 109), tile221 }, + { new Color(158, 172, 102), tile222 }, + { new Color(31, 210, 127), tile223 }, + { new Color(148, 12, 107), tile224 }, + { new Color(117, 208, 53), tile225 }, + { new Color(207, 98, 16), tile226 }, + { new Color(114, 178, 205), tile227 }, + { new Color(115, 36, 28), tile228 }, + { new Color(165, 233, 22), tile229 }, + { new Color(208, 166, 13), tile230 }, + { new Color(234, 150, 115), tile231 }, + { new Color(40, 183, 69), tile232 }, + { new Color(151, 238, 217), tile233 }, + { new Color(225, 198, 39), tile234 }, + { new Color(206, 64, 87), tile235 }, + { new Color(103, 121, 17), tile236 }, + { new Color(243, 126, 96), tile237 }, + { new Color(218, 0, 112), tile238 }, + { new Color(159, 200, 78), tile239 }, + { new Color(80, 249, 194), tile240 }, + { new Color(80, 79, 43), tile241 }, + { new Color(114, 170, 118), tile242 }, + { new Color(248, 76, 25), tile243 }, + { new Color(239, 55, 116), tile244 }, + { new Color(55, 145, 236), tile245 }, + { new Color(166, 165, 227), tile246 }, + { new Color(197, 62, 112), tile247 }, + { new Color(5, 220, 40), tile248 }, + { new Color(172, 15, 149), tile249 }, + { new Color(2, 137, 238), tile250 }, + { new Color(247, 71, 245), tile251 }, + { new Color(22, 145, 119), tile252 }, + { new Color(251, 91, 150), tile253 }, + { new Color(224, 110, 44), tile254 }, + { new Color(247, 3, 70), tile255 }, + { new Color(236, 163, 111), tile256 }, + { new Color(132, 249, 35), tile257 }, + { new Color(107, 138, 186), tile258 }, + { new Color(82, 74, 114), tile259 }, + { new Color(3, 198, 155), tile260 }, + { new Color(225, 246, 195), tile261 }, + { new Color(42, 248, 240), tile262 }, + { new Color(126, 32, 0), tile263 }, + { new Color(117, 170, 73), tile264 }, + { new Color(77, 228, 207), tile265 }, + { new Color(68, 13, 217), tile266 }, + { new Color(225, 192, 107), tile267 }, + { new Color(38, 125, 143), tile268 }, + { new Color(203, 140, 188), tile269 }, + { new Color(58, 195, 70), tile270 }, + { new Color(4, 248, 148), tile271 }, + { new Color(251, 255, 119), tile272 }, + { new Color(104, 204, 11), tile273 }, + { new Color(86, 109, 130), tile274 }, + { new Color(111, 15, 78), tile275 }, + { new Color(217, 29, 166), tile276 }, + { new Color(234, 14, 60), tile277 }, + { new Color(153, 33, 6), tile278 }, + { new Color(47, 186, 121), tile279 }, + { new Color(51, 95, 108), tile280 }, + { new Color(51, 68, 93), tile281 }, + { new Color(185, 112, 178), tile282 }, + { new Color(180, 82, 229), tile283 }, + { new Color(88, 219, 65), tile284 }, + { new Color(206, 139, 82), tile285 }, + { new Color(233, 183, 110), tile286 }, + { new Color(65, 241, 110), tile287 }, + { new Color(22, 79, 181), tile288 }, + { new Color(9, 106, 214), tile289 }, + { new Color(142, 203, 69), tile290 }, + { new Color(254, 52, 109), tile291 }, + { new Color(158, 34, 41), tile292 }, + { new Color(37, 181, 158), tile293 }, + { new Color(155, 36, 203), tile294 }, + { new Color(193, 146, 50), tile295 }, + { new Color(251, 203, 150), tile296 }, + { new Color(179, 70, 3), tile297 }, + { new Color(10, 242, 109), tile298 }, + { new Color(254, 29, 244), tile299 }, + { new Color(167, 175, 5), tile300 }, + { new Color(220, 38, 134), tile301 }, + { new Color(159, 89, 166), tile302 }, + { new Color(211, 47, 104), tile303 }, + { new Color(41, 195, 1), tile304 }, + { new Color(208, 165, 204), tile305 }, + { new Color(163, 85, 189), tile306 }, + { new Color(130, 14, 159), tile307 }, + { new Color(64, 218, 133), tile308 }, + { new Color(65, 244, 66), tile309 }, + { new Color(255, 160, 5), tile310 }, + { new Color(52, 126, 6), tile311 }, + { new Color(152, 191, 254), tile312 }, + { new Color(68, 33, 56), tile313 }, + { new Color(140, 39, 155), tile314 }, + { new Color(45, 138, 130), tile315 }, + { new Color(2, 58, 77), tile316 }, + { new Color(161, 90, 199), tile317 }, + { new Color(55, 36, 161), tile318 }, + { new Color(102, 155, 75), tile319 }, + { new Color(0, 94, 101), tile320 }, + { new Color(100, 212, 143), tile321 }, + { new Color(98, 245, 69), tile322 }, + { new Color(251, 55, 229), tile323 }, + { new Color(205, 94, 52), tile324 }, + { new Color(132, 246, 230), tile325 }, + { new Color(3, 19, 80), tile326 }, + { new Color(2, 63, 185), tile327 }, + { new Color(245, 93, 69), tile328 }, + { new Color(62, 253, 89), tile329 }, + { new Color(100, 50, 36), tile330 }, + { new Color(179, 67, 194), tile331 }, + { new Color(211, 40, 83), tile332 }, + { new Color(12, 202, 149), tile333 }, + { new Color(61, 6, 2), tile334 }, + { new Color(103, 211, 252), tile335 }, + { new Color(147, 178, 45), tile336 }, + { new Color(186, 98, 136), tile337 }, + { new Color(250, 254, 31), tile338 }, + { new Color(171, 110, 118), tile339 }, + { new Color(74, 36, 247), tile340 }, + { new Color(235, 150, 5), tile341 }, + { new Color(193, 26, 26), tile342 }, + { new Color(113, 176, 206), tile343 }, + { new Color(147, 247, 72), tile344 }, + { new Color(187, 197, 56), tile345 }, + { new Color(183, 142, 138), tile346 }, + { new Color(72, 171, 74), tile347 }, + { new Color(43, 170, 207), tile348 }, + { new Color(156, 184, 69), tile349 }, + { new Color(163, 39, 185), tile350 }, + { new Color(221, 194, 165), tile351 }, + { new Color(157, 81, 112), tile352 }, + { new Color(252, 165, 185), tile353 }, + { new Color(225, 33, 1), tile354 }, + { new Color(95, 39, 107), tile355 }, + { new Color(63, 63, 56), tile356 }, + { new Color(230, 244, 224), tile357 }, + { new Color(236, 1, 121), tile358 }, + { new Color(173, 191, 236), tile359 }, + }; + return new ColorTileMap(colorTileMap); + } + } +} diff --git a/Schematics/AutoGeneratedContent/Workshop2Schematic.png b/Schematics/AutoGeneratedContent/Workshop2Schematic.png new file mode 100644 index 0000000000..b5907e5892 Binary files /dev/null and b/Schematics/AutoGeneratedContent/Workshop2Schematic.png differ diff --git a/Schematics/SchematicLoader.cs b/Schematics/SchematicLoader.cs index 2d222f8e80..96cc4afed8 100644 --- a/Schematics/SchematicLoader.cs +++ b/Schematics/SchematicLoader.cs @@ -27,7 +27,9 @@ namespace CalamityMod.Schematics { // Texture loading does not require a .png at the end of the path string. ["Workshop"] = LoadSchematicCodeAndTexture(typeof(WorkshopSchematic), "Schematics/AutoGeneratedContent/WorkshopSchematic"), - ["Plague Research Facility"] = LoadSchematicCodeAndTexture(typeof(ResearchFacilitySchematic), "Schematics/AutoGeneratedContent/ResearchFacilitySchematic"), + ["Workshop 2"] = LoadSchematicCodeAndTexture(typeof(Workshop2Schematic), "Schematics/AutoGeneratedContent/Workshop2Schematic"), + ["Research Facility"] = LoadSchematicCodeAndTexture(typeof(ResearchFacilitySchematic), "Schematics/AutoGeneratedContent/ResearchFacilitySchematic"), + ["Research Facility 2"] = LoadSchematicCodeAndTexture(typeof(ResearchFacility2Schematic), "Schematics/AutoGeneratedContent/ResearchFacility2Schematic"), ["Astral Beacon"] = LoadSchematicCodeAndTexture(typeof(AstralBeaconSchematic), "Schematics/AutoGeneratedContent/AstralBeaconSchematic") }; } diff --git a/Schematics/TileDefinitionStructure.cs b/Schematics/TileDefinitionStructure.cs index aa91696846..503934a5ac 100644 --- a/Schematics/TileDefinitionStructure.cs +++ b/Schematics/TileDefinitionStructure.cs @@ -62,5 +62,10 @@ namespace CalamityMod.Schematics SpecifiedTile.honey(liquidType == LiquidState.Honey); return this; } + public TileDefinitionStructure MakeActuated() + { + SpecifiedTile.inActive(true); + return this; + } } } diff --git a/Schematics/TilePlacementHelpers.cs b/Schematics/TilePlacementHelpers.cs index 490eb7c518..55c481437f 100644 --- a/Schematics/TilePlacementHelpers.cs +++ b/Schematics/TilePlacementHelpers.cs @@ -1,6 +1,9 @@ +using CalamityMod.TileEntities; +using CalamityMod.Tiles; using Microsoft.Xna.Framework; using System; using Terraria; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; using static CalamityMod.Schematics.SchematicLoader; @@ -29,7 +32,8 @@ namespace CalamityMod.Schematics { PilePlacementMaps.TryGetValue(mapKey, out PilePlacementFunction pilePlacementFunction); Tile[,] tiles = TileMaps[mapKey]; - int xOffset = placementPosition.X; + ushort[,] oldWalls = new ushort[tiles.GetLength(0), tiles.GetLength(1)]; + int xOffset = placementPosition.X; int yOffset = placementPosition.Y; // Top-left is the default for terraria. There is no need to include it in this switch. switch (placementAnchor) @@ -49,8 +53,8 @@ namespace CalamityMod.Schematics yOffset += tiles.GetLength(1); break; } - ushort[,] oldWalls = new ushort[tiles.GetLength(0), tiles.GetLength(1)]; - for (int x = 0; x < tiles.GetLength(0); x++) + oldWalls = new ushort[tiles.GetLength(0), tiles.GetLength(1)]; + for (int x = 0; x < tiles.GetLength(0); x++) { for (int y = 0; y < tiles.GetLength(1); y++) { @@ -81,11 +85,15 @@ namespace CalamityMod.Schematics chestInteraction?.Invoke(chest); } } + if (tiles[x, y].type == ModContent.TileType()) + { + WorldGen.PlaceTile(x, y, tiles[x, y].type); + } Main.tile[x + xOffset, y + yOffset] = (Tile)tiles[x, y].Clone(); // If specified, preserve walls if they're not not being overrided and there's no active tile in its place. - if (preserveWalls && oldWalls[x, y] != 0) + if (preserveWalls && oldWalls[x, y] != 0 && tiles[x, y].wall == 0) { Main.tile[x + xOffset, y + yOffset].wall = oldWalls[x, y]; } diff --git a/TileEntities/TEDraedonFuelFactory.cs b/TileEntities/TEDraedonFuelFactory.cs index 3d09bac2c1..eeb25fb214 100644 --- a/TileEntities/TEDraedonFuelFactory.cs +++ b/TileEntities/TEDraedonFuelFactory.cs @@ -30,7 +30,8 @@ namespace CalamityMod.TileEntities } Time++; - if (Time % 5 == 4 && Main.tileFrame[Main.tile[Position.X, Position.Y].type] == 43) + bool rightTimeToMakeCell = Time % 5 == 4 && Main.tileFrame[Main.tile[Position.X, Position.Y].type] == 43; + if (HeldItem.stack < HeldItem.maxStack && rightTimeToMakeCell) { HeldItem.stack++; } diff --git a/TileEntities/TEDraedonItemCharger.cs b/TileEntities/TEDraedonItemCharger.cs index 08c983da02..3ea5b1c28d 100644 --- a/TileEntities/TEDraedonItemCharger.cs +++ b/TileEntities/TEDraedonItemCharger.cs @@ -151,7 +151,7 @@ namespace CalamityMod.TileEntities } if (FuelItem.stack > 0 && ItemBeingCharged.stack > 0 && - Charge < CalamityGlobalItem.ChargeMax) + Charge < ItemBeingCharged.Calamity().ChargeMax) { if (Time % 25 == 0) { diff --git a/Tiles/DraedonItemCharger.cs b/Tiles/DraedonItemCharger.cs index 11f22a7a77..15681d4322 100644 --- a/Tiles/DraedonItemCharger.cs +++ b/Tiles/DraedonItemCharger.cs @@ -33,6 +33,10 @@ namespace CalamityMod.Tiles { int left = i - Main.tile[i, j].frameX % (Width * 18) / 18; int top = j - Main.tile[i, j].frameY % (Height * 18) / 18; + if (!TileEntity.ByPosition.ContainsKey(new Point16(left, top))) + { + TileEntity.ByPosition[new Point16(left, top)] = ModTileEntity.ConstructFromType(ModContent.TileEntityType()); + } return (TEDraedonItemCharger)TileEntity.ByPosition[new Point16(left, top)]; } public override bool CreateDust(int i, int j, ref int type) diff --git a/Tiles/InactiveDraedonFuelFactory.cs b/Tiles/InactiveDraedonFuelFactory.cs new file mode 100644 index 0000000000..c4b27ceef8 --- /dev/null +++ b/Tiles/InactiveDraedonFuelFactory.cs @@ -0,0 +1,50 @@ +using CalamityMod.Items.Placeables; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.Enums; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles +{ + public class InactiveDraedonFuelFactory : ModTile + { + public override void SetDefaults() + { + Main.tileLighted[Type] = true; + Main.tileFrameImportant[Type] = true; + Main.tileNoAttach[Type] = true; + Main.tileTable[Type] = true; + Main.tileLavaDeath[Type] = true; + Main.tileWaterDeath[Type] = false; + TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); + TileObjectData.newTile.Width = 4; + TileObjectData.newTile.Height = 4; + TileObjectData.newTile.Origin = new Point16(0, 3); + TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16, 16 }; + TileObjectData.newTile.CoordinatePadding = 0; + TileObjectData.addTile(Type); + ModTranslation name = CreateMapEntryName(); + name.SetDefault("Inactive Fuel Factory"); + AddMapEntry(new Color(67, 72, 81), name); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 226); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 32, 32, ModContent.ItemType()); + } + } +} diff --git a/Tiles/InactiveDraedonFuelFactory.png b/Tiles/InactiveDraedonFuelFactory.png new file mode 100644 index 0000000000..44a65635b3 Binary files /dev/null and b/Tiles/InactiveDraedonFuelFactory.png differ diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index f610e634f4..63983c484f 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -150,6 +150,17 @@ namespace CalamityMod { return player.inventory.Any(item => items.Contains(item.type)); } + public static bool PortableStorageHas(this Player player, params int[] items) + { + bool hasItem = false; + if (player.bank.item.Any(item => items.Contains(item.type))) + hasItem = true; + if (player.bank2.item.Any(item => items.Contains(item.type))) + hasItem = true; + if (player.bank3.item.Any(item => items.Contains(item.type))) + hasItem = true; + return hasItem; + } /// /// Inflict typical exo weapon debuffs in pvp. @@ -457,9 +468,15 @@ namespace CalamityMod /// Whether to ignore tiles when finding a target or not public static NPC MinionHoming(this Vector2 origin, float maxDistanceToCheck, Player owner, bool ignoreTiles = true) { - if (owner.HasMinionAttackTargetNPC) + if (owner is null || owner.whoAmI < 0 || owner.whoAmI > Main.maxPlayers || owner.MinionAttackTargetNPC < 0 || owner.MinionAttackTargetNPC > Main.maxNPCs) + return ClosestNPCAt(origin, maxDistanceToCheck, ignoreTiles); + NPC npc = Main.npc[owner.MinionAttackTargetNPC]; + bool canHit = true; + if (!ignoreTiles) + canHit = Collision.CanHit(origin, 1, 1, npc.Center, 1, 1); + if (owner.HasMinionAttackTargetNPC && canHit) { - return Main.npc[owner.MinionAttackTargetNPC]; + return npc; } return ClosestNPCAt(origin, maxDistanceToCheck, ignoreTiles); } @@ -964,7 +981,7 @@ namespace CalamityMod } } - public static void StickToTiles(this Projectile projectile) + public static void StickToTiles(this Projectile projectile, bool ignorePlatforms, bool stickToEverything) { try { @@ -993,7 +1010,13 @@ namespace CalamityMod for (int y = yBottom; y < yTop; y++) { Tile tile = Main.tile[x, y]; - if (tile != null && !TileID.Sets.Platforms[tile.type] && tile.type != TileID.PlanterBox && tile.nactive() && (Main.tileSolid[tile.type] || (Main.tileSolidTop[tile.type] && tile.frameY == 0))) + bool platformCheck = true; + if (ignorePlatforms) + platformCheck = !TileID.Sets.Platforms[tile.type] && tile.type != TileID.PlanterBox; + bool tableCheck = false; + if (stickToEverything) + tableCheck = Main.tileSolidTop[tile.type] && tile.frameY == 0; + if (tile != null && tile.nactive() && platformCheck && (Main.tileSolid[tile.type] || tableCheck)) { Vector2 tileSize; tileSize.X = (float)(x * 16); diff --git a/Utilities/Enums.cs b/Utilities/Enums.cs index ee589e1ee3..831072c3f1 100644 --- a/Utilities/Enums.cs +++ b/Utilities/Enums.cs @@ -19,6 +19,7 @@ namespace CalamityMod Developer = 16, Rainbow = 30, RareVariant = 31, - Dedicated = 32 + Dedicated = 32, + DraedonRust = 33, } } diff --git a/Walls/DraedonStructures/RustedPlateBeam.cs b/Walls/DraedonStructures/RustedPlateBeam.cs index 4dc8f86a73..e03ee628b2 100644 --- a/Walls/DraedonStructures/RustedPlateBeam.cs +++ b/Walls/DraedonStructures/RustedPlateBeam.cs @@ -1,7 +1,7 @@ -using Terraria; using Microsoft.Xna.Framework; -using Terraria.ID; +using Terraria; using Terraria.ModLoader; + namespace CalamityMod.Walls.DraedonStructures { public class RustedPlateBeam : ModWall @@ -10,7 +10,7 @@ namespace CalamityMod.Walls.DraedonStructures public override void SetDefaults() { dustType = 32; - drop = ModContent.ItemType(); + drop = ModContent.ItemType(); Main.wallHouse[Type] = true; AddMapEntry(new Color(74, 47, 39)); diff --git a/Walls/DraedonStructures/RustedPlatePillar.cs b/Walls/DraedonStructures/RustedPlatePillar.cs index 4d2e22a510..c45e84988d 100644 --- a/Walls/DraedonStructures/RustedPlatePillar.cs +++ b/Walls/DraedonStructures/RustedPlatePillar.cs @@ -1,7 +1,7 @@ -using Terraria; using Microsoft.Xna.Framework; -using Terraria.ID; +using Terraria; using Terraria.ModLoader; + namespace CalamityMod.Walls.DraedonStructures { public class RustedPlatePillar : ModWall @@ -10,7 +10,7 @@ namespace CalamityMod.Walls.DraedonStructures public override void SetDefaults() { dustType = 32; - drop = ModContent.ItemType(); + drop = ModContent.ItemType(); Main.wallHouse[Type] = true; AddMapEntry(new Color(99, 71, 60)); diff --git a/World/Abyss.cs b/World/Abyss.cs index e74b91323e..8751337d21 100644 --- a/World/Abyss.cs +++ b/World/Abyss.cs @@ -1099,9 +1099,13 @@ namespace CalamityMod.World islandLocationX -= 25; break; } + CalamityWorld.AbyssIslandX[CalamityWorld.numAbyssIslands] = islandLocationX; CalamityWorld.numAbyssIslands++; + islandLocationY += islandLocationOffset; + if (islandLocationY >= CalamityWorld.abyssChasmBottom - 50) + break; } CalamityWorld.AbyssItemArray = CalamityUtils.ShuffleArray(CalamityWorld.AbyssItemArray); diff --git a/World/CalamityWorld.cs b/World/CalamityWorld.cs index dd496c5312..71c312e6a5 100644 --- a/World/CalamityWorld.cs +++ b/World/CalamityWorld.cs @@ -69,6 +69,7 @@ namespace CalamityMod.World public static bool deactivateStupidFuckingBullshit = false; //Force Boss Rush to inactive public static int bossRushStage = 0; //Boss Rush Stage public static int bossRushSpawnCountdown = 180; //Delay before another Boss Rush boss can spawn + public static int bossRushHostileProjKillCounter = 0; //Death Mode natural boss spawns public static int bossSpawnCountdown = 0; //Death Mode natural boss spawn countdown @@ -136,10 +137,23 @@ namespace CalamityMod.World public static int[] SChestY = new int[10]; public static bool roxShrinePlaced = false; - //Spawned NPCs + //Town NPC bools public static bool spawnedBandit = false; public static bool spawnedCirrus = false; public static bool foundHomePermafrost = false; + public static bool guideName = false; + public static bool wizardName = false; + public static bool steampunkerName = false; + public static bool stylistName = false; + public static bool witchDoctorName = false; + public static bool taxCollectorName = false; + public static bool pirateName = false; + public static bool mechanicName = false; + public static bool armsDealerName = false; + public static bool dryadName = false; + public static bool nurseName = false; + public static bool anglerName = false; + public static bool clothierName = false; #region Downed Bools public static bool downedBossAny = false; //Any boss @@ -213,6 +227,7 @@ namespace CalamityMod.World bossRushActive = false; bossRushSpawnCountdown = 180; bossSpawnCountdown = 0; + bossRushHostileProjKillCounter = 0; deathBossSpawnCooldown = 0; bossType = 0; newAltarX = 0; @@ -222,6 +237,19 @@ namespace CalamityMod.World spawnedBandit = false; spawnedCirrus = false; foundHomePermafrost = false; + guideName = false; + wizardName = false; + steampunkerName = false; + stylistName = false; + witchDoctorName = false; + taxCollectorName = false; + pirateName = false; + mechanicName = false; + armsDealerName = false; + dryadName = false; + nurseName = false; + anglerName = false; + clothierName = false; downedDesertScourge = false; downedAquaticScourge = false; downedHiveMind = false; @@ -371,6 +399,32 @@ namespace CalamityMod.World downed.Add("drunkPrincess"); if (foundHomePermafrost) downed.Add("archmageHome"); + if (guideName) + downed.Add("guideName"); + if (wizardName) + downed.Add("wizardName"); + if (steampunkerName) + downed.Add("steampunkerName"); + if (stylistName) + downed.Add("stylistName"); + if (witchDoctorName) + downed.Add("witchDoctorName"); + if (taxCollectorName) + downed.Add("taxCollectorName"); + if (pirateName) + downed.Add("pirateName"); + if (mechanicName) + downed.Add("mechanicName"); + if (armsDealerName) + downed.Add("armsDealerName"); + if (dryadName) + downed.Add("dryadName"); + if (nurseName) + downed.Add("nurseName"); + if (anglerName) + downed.Add("anglerName"); + if (clothierName) + downed.Add("clothierName"); if (downedEoCAcidRain) downed.Add("eocRain"); if (downedAquaticScourgeAcidRain) @@ -457,6 +511,19 @@ namespace CalamityMod.World spawnedBandit = downed.Contains("bandit"); spawnedCirrus = downed.Contains("drunkPrincess"); foundHomePermafrost = downed.Contains("archmageHome"); + guideName = downed.Contains("guideName"); + wizardName = downed.Contains("wizardName"); + steampunkerName = downed.Contains("stylistName"); + stylistName = downed.Contains("stylistName"); + witchDoctorName = downed.Contains("witchDoctorName"); + taxCollectorName = downed.Contains("taxCollectorName"); + pirateName = downed.Contains("pirateName"); + mechanicName = downed.Contains("mechanicName"); + armsDealerName = downed.Contains("armsDealerName"); + dryadName = downed.Contains("dryadName"); + nurseName = downed.Contains("nurseName"); + anglerName = downed.Contains("anglerName"); + clothierName = downed.Contains("clothierName"); downedEoCAcidRain = downed.Contains("eocRain"); downedAquaticScourgeAcidRain = downed.Contains("hmRain"); triedToSummonOldDuke = downed.Contains("spawnedBoomer"); @@ -559,9 +626,29 @@ namespace CalamityMod.World downedSecondSentinels = flags8[2]; foundHomePermafrost = flags8[3]; downedCLAMHardMode = flags8[4]; - _ = flags8[5]; - _ = flags8[6]; - _ = flags8[7]; + guideName = flags8[5]; + wizardName = flags8[6]; + steampunkerName = flags8[7]; + + BitsByte flags9 = reader.ReadByte(); + stylistName = flags9[0]; + witchDoctorName = flags9[1]; + taxCollectorName = flags9[2]; + pirateName = flags9[3]; + mechanicName = flags9[4]; + armsDealerName = flags9[5]; + dryadName = flags9[6]; + nurseName = flags9[7]; + + BitsByte flags10 = reader.ReadByte(); + anglerName = flags10[0]; + clothierName = flags10[1]; + _ = flags10[2]; + _ = flags10[3]; + _ = flags10[4]; + _ = flags10[5]; + _ = flags10[6]; + _ = flags10[7]; } else { @@ -650,9 +737,29 @@ namespace CalamityMod.World flags8[2] = downedSecondSentinels; flags8[3] = foundHomePermafrost; flags8[4] = downedCLAMHardMode; - flags8[5] = false; - flags8[6] = false; - flags8[7] = false; + flags8[5] = guideName; + flags8[6] = wizardName; + flags8[7] = steampunkerName; + + BitsByte flags9 = new BitsByte(); + flags9[0] = stylistName; + flags9[1] = witchDoctorName; + flags9[2] = taxCollectorName; + flags9[3] = pirateName; + flags9[4] = mechanicName; + flags9[5] = armsDealerName; + flags9[6] = dryadName; + flags9[7] = nurseName; + + BitsByte flags10 = new BitsByte(); + flags10[0] = anglerName; + flags10[1] = clothierName; + flags10[2] = false; + flags10[3] = false; + flags10[4] = false; + flags10[5] = false; + flags10[6] = false; + flags10[7] = false; writer.Write(flags); writer.Write(flags2); @@ -662,6 +769,8 @@ namespace CalamityMod.World writer.Write(flags6); writer.Write(flags7); writer.Write(flags8); + writer.Write(flags9); + writer.Write(flags10); writer.Write(abyssChasmBottom); writer.Write(acidRainPoints); writer.Write(Reforges); @@ -749,9 +858,29 @@ namespace CalamityMod.World downedSecondSentinels = flags8[2]; foundHomePermafrost = flags8[3]; downedCLAMHardMode = flags8[4]; - _ = flags8[5]; - _ = flags8[6]; - _ = flags8[7]; + guideName = flags8[5]; + wizardName = flags8[6]; + steampunkerName = flags8[7]; + + BitsByte flags9 = reader.ReadByte(); + stylistName = flags9[0]; + witchDoctorName = flags9[1]; + taxCollectorName = flags9[2]; + pirateName = flags9[3]; + mechanicName = flags9[4]; + armsDealerName = flags9[5]; + dryadName = flags9[6]; + nurseName = flags9[7]; + + BitsByte flags10 = reader.ReadByte(); + anglerName = flags10[0]; + clothierName = flags10[1]; + _ = flags10[2]; + _ = flags10[3]; + _ = flags10[4]; + _ = flags10[5]; + _ = flags10[6]; + _ = flags10[7]; abyssChasmBottom = reader.ReadInt32(); acidRainPoints = reader.ReadInt32(); @@ -917,19 +1046,26 @@ namespace CalamityMod.World tasks.Insert(FinalIndex + 3, new PassLegacy("Rust and Dust", (GenerationProgress progress) => { List workshopPositions = new List(); - int workshopCount = Main.maxTilesX / 600; - int labCount = Main.maxTilesX / 1100; + int workshopCount = Main.maxTilesX / 1200; + int labCount = Main.maxTilesX / 1800; DraedonStructures.DraedonsLogWorkshopIndex = WorldGen.genRand.Next(workshopCount); for (int i = 0; i < workshopCount; i++) { - DraedonStructures.PlaceWorkshop(out Point placementPosition, workshopPositions); + DraedonStructures.PlaceWorkshop(out Point placementPosition, workshopPositions, "Workshop"); DraedonStructures.CurrentWorkshopIndex = i; workshopPositions.Add(placementPosition); + + DraedonStructures.PlaceWorkshop(out Point placementPosition2, workshopPositions, "Workshop 2"); + DraedonStructures.CurrentWorkshopIndex = i; + workshopPositions.Add(placementPosition2); } for (int i = 0; i < labCount; i++) { - DraedonStructures.PlacePlagueLab(out Point placementPosition2, workshopPositions); + DraedonStructures.PlaceResearchFacility(out Point placementPosition, workshopPositions, "Research Facility"); + workshopPositions.Add(placementPosition); + + DraedonStructures.PlaceResearchFacility(out Point placementPosition2, workshopPositions, "Research Facility 2"); workshopPositions.Add(placementPosition2); } })); @@ -1409,7 +1545,7 @@ namespace CalamityMod.World // Spawn bosses if (Main.netMode != NetmodeID.MultiplayerClient) { - Main.PlaySound(SoundID.Roar, player.position, 0); + bool playSpecialSound = false; switch (bossRushStage) { case 0: @@ -1433,6 +1569,7 @@ namespace CalamityMod.World ChangeTime(true); int npc = NPC.NewNPC((int)(player.position.X + Main.rand.Next(-100, 101)), (int)(player.position.Y - 400f), NPCID.Golem, 1); Main.npc[npc].timeLeft *= 20; + CalamityUtils.BossAwakenMessage(npc); break; case 6: ChangeTime(true); @@ -1470,6 +1607,7 @@ namespace CalamityMod.World ChangeTime(false); int npc6 = NPC.NewNPC((int)(player.position.X + Main.rand.Next(-100, 101)), (int)(player.position.Y - 400f), NPCID.SkeletronHead, 1); Main.npc[npc6].timeLeft *= 20; + CalamityUtils.BossAwakenMessage(npc6); break; case 15: ChangeTime(true); @@ -1487,6 +1625,7 @@ namespace CalamityMod.World int npc2 = NPC.NewNPC((int)player.Center.X, (int)player.Center.Y - 400, NPCID.CultistBoss, 1); Main.npc[npc2].direction = Main.npc[npc2].spriteDirection = Math.Sign(player.Center.X - player.Center.X - 90f); Main.npc[npc2].timeLeft *= 20; + CalamityUtils.BossAwakenMessage(npc2); break; case 19: for (int doom = 0; doom < Main.maxNPCs; doom++) @@ -1501,6 +1640,7 @@ namespace CalamityMod.World } int npc3 = NPC.NewNPC((int)(player.position.X + Main.rand.Next(-100, 101)), (int)(player.position.Y - 400f), ModContent.NPCType(), 1); Main.npc[npc3].timeLeft *= 20; + CalamityUtils.BossAwakenMessage(npc3); break; case 20: NPC.SpawnOnPlayer(closestPlayer, NPCID.Plantera); @@ -1521,12 +1661,16 @@ namespace CalamityMod.World NPC.SpawnOnPlayer(closestPlayer, ModContent.NPCType()); break; case 26: + playSpecialSound = true; + Main.PlaySound(SoundID.Roar, player.position, 2); int npc4 = NPC.NewNPC((int)(player.position.X + Main.rand.Next(-100, 101)), (int)(player.position.Y - 400f), ModContent.NPCType(), 1); Main.npc[npc4].timeLeft *= 20; + CalamityUtils.BossAwakenMessage(npc4); break; case 27: int npc5 = NPC.NewNPC((int)(player.position.X + Main.rand.Next(-100, 101)), (int)(player.position.Y - 400f), NPCID.DukeFishron, 1); Main.npc[npc5].timeLeft *= 20; + CalamityUtils.BossAwakenMessage(npc5); break; case 28: NPC.SpawnOnPlayer(closestPlayer, NPCID.MoonLordCore); @@ -1553,6 +1697,7 @@ namespace CalamityMod.World case 34: int npc7 = NPC.NewNPC((int)(player.position.X + Main.rand.Next(-100, 101)), (int)(player.position.Y - 400f), ModContent.NPCType(), 1); Main.npc[npc7].timeLeft *= 20; + CalamityUtils.BossAwakenMessage(npc7); break; case 35: NPC.SpawnOnPlayer(closestPlayer, ModContent.NPCType()); @@ -1561,7 +1706,11 @@ namespace CalamityMod.World break; case 36: ChangeTime(true); - NPC.SpawnOnPlayer(closestPlayer, ModContent.NPCType()); + playSpecialSound = true; + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/ProvidenceSpawn"), player.Center); + int prov = NPC.NewNPC((int)(player.position.X + Main.rand.Next(-500, 501)), (int)(player.position.Y - 250f), ModContent.NPCType(), 1); + Main.npc[prov].timeLeft *= 20; + CalamityUtils.BossAwakenMessage(prov); break; case 37: NPC.SpawnOnPlayer(closestPlayer, ModContent.NPCType()); @@ -1571,9 +1720,13 @@ namespace CalamityMod.World NPC.SpawnOnPlayer(closestPlayer, ModContent.NPCType()); break; case 39: + playSpecialSound = true; + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/DevourerSpawn"), player.Center); NPC.SpawnOnPlayer(closestPlayer, ModContent.NPCType()); break; } + if (!playSpecialSound) + Main.PlaySound(SoundID.Roar, player.position, 0); } } } @@ -1593,6 +1746,19 @@ namespace CalamityMod.World } } } + if (bossRushHostileProjKillCounter > 0) + { + bossRushHostileProjKillCounter--; + if (bossRushHostileProjKillCounter == 1) + CalamityUtils.KillAllHostileProjectiles(); + if (Main.netMode == NetmodeID.Server) + { + var netMessage = mod.GetPacket(); + netMessage.Write((byte)CalamityModMessageType.BRHostileProjKillSync); + netMessage.Write(bossRushHostileProjKillCounter); + netMessage.Send(); + } + } if (DoGSecondStageCountdown > 0) { @@ -1698,7 +1864,16 @@ namespace CalamityMod.World } } if (ArmoredDiggerSpawnCooldown > 0) + { ArmoredDiggerSpawnCooldown--; + if (Main.netMode == NetmodeID.Server) + { + var netMessage = mod.GetPacket(); + netMessage.Write((byte)CalamityModMessageType.ArmoredDiggerCountdownSync); + netMessage.Write(ArmoredDiggerSpawnCooldown); + netMessage.Send(); + } + } if (Main.dayTime && Main.hardMode) { diff --git a/World/DraedonStructures.cs b/World/DraedonStructures.cs index f835360954..526553d08d 100644 --- a/World/DraedonStructures.cs +++ b/World/DraedonStructures.cs @@ -89,7 +89,7 @@ namespace CalamityMod.World } return false; } - public static void PlaceWorkshop(out Point placementPoint, List workshopPoints) + public static void PlaceWorkshop(out Point placementPoint, List workshopPoints, string mapKey) { int tries = 0; @@ -99,7 +99,7 @@ namespace CalamityMod.World int placementPositionY = WorldGen.genRand.Next(underworldTop - 550, underworldTop - 50); placementPoint = new Point(placementPositionX, placementPositionY); - Vector2 schematicSize = new Vector2(SchematicLoader.TileMaps["Workshop"].GetLength(0), SchematicLoader.TileMaps["Workshop"].GetLength(1)); + Vector2 schematicSize = new Vector2(SchematicLoader.TileMaps[mapKey].GetLength(0), SchematicLoader.TileMaps[mapKey].GetLength(1)); int activeTilesInArea = 0; int xCheckArea = 40; bool canGenerateInLocation = true; @@ -127,9 +127,9 @@ namespace CalamityMod.World return; goto TryAgain; // Try again elsewhere if the correct conditions are not met. (Yes, I'm using a goto. Please don't kill me) } - SchematicPlacementHelpers.PlaceStructure("Workshop", new Point(placementPoint.X, placementPoint.Y), SchematicPlacementHelpers.PlacementAnchorType.TopLeft, FillWorkshopChest); + SchematicPlacementHelpers.PlaceStructure(mapKey, new Point(placementPoint.X, placementPoint.Y), SchematicPlacementHelpers.PlacementAnchorType.TopLeft, FillWorkshopChest); } - public static void PlacePlagueLab(out Point placementPoint, List workshopPoints) + public static void PlaceResearchFacility(out Point placementPoint, List workshopPoints, string mapKey) { int tries = 0; @@ -139,7 +139,7 @@ namespace CalamityMod.World int placementPositionY = WorldGen.genRand.Next(underworldTop - 400, underworldTop - 50); placementPoint = new Point(placementPositionX, placementPositionY); - Vector2 schematicSize = new Vector2(SchematicLoader.TileMaps["Plague Research Facility"].GetLength(0), SchematicLoader.TileMaps["Plague Research Facility"].GetLength(1)); + Vector2 schematicSize = new Vector2(SchematicLoader.TileMaps[mapKey].GetLength(0), SchematicLoader.TileMaps[mapKey].GetLength(1)); int activeTilesInArea = 0; int xCheckArea = 30; bool canGenerateInLocation = true; @@ -167,7 +167,7 @@ namespace CalamityMod.World return; goto TryAgain; // Try again elsewhere if the correct conditions are not met. (Yes, I'm using a goto. Please don't kill me) } - SchematicPlacementHelpers.PlaceStructure("Plague Research Facility", new Point(placementPoint.X, placementPoint.Y), SchematicPlacementHelpers.PlacementAnchorType.TopLeft, FillLaboratoryChest); + SchematicPlacementHelpers.PlaceStructure(mapKey, new Point(placementPoint.X, placementPoint.Y), SchematicPlacementHelpers.PlacementAnchorType.TopLeft, FillLaboratoryChest); } } } diff --git a/World/SmallBiomes.cs b/World/SmallBiomes.cs index 0e50d42249..1f72642e78 100644 --- a/World/SmallBiomes.cs +++ b/World/SmallBiomes.cs @@ -29,8 +29,8 @@ namespace CalamityMod.World { int x = Main.maxTilesX; int xIslandGen = WorldGen.crimson ? - WorldGen.genRand.Next((int)((double)x * 0.15), (int)((double)x * 0.2)) : - WorldGen.genRand.Next((int)((double)x * 0.8), (int)((double)x * 0.85)); + WorldGen.genRand.Next((int)(x * 0.1), (int)(x * 0.15)) : + WorldGen.genRand.Next((int)(x * 0.85), (int)(x * 0.9)); int yIslandGen = WorldGen.genRand.Next(90, 151); yIslandGen = Math.Min(yIslandGen, (int)WorldGen.worldSurfaceLow - 50); @@ -61,10 +61,10 @@ namespace CalamityMod.World int generateBack = genLimit - 80; //Small = 2020 int generateForward = genLimit + 80; //Small = 2180 - for (int k = 0; k < (int)((double)(x * y) * 50E-05); k++) //Surface Shrine + for (int k = 0; k < (int)(x * y * 50E-05); k++) //Surface Shrine { - int tilesX = WorldGen.genRand.Next((int)((double)x * 0.3), generateBack); - int tilesX2 = WorldGen.genRand.Next(generateForward, (int)((double)x * 0.7)); + int tilesX = WorldGen.genRand.Next((int)(x * 0.3), generateBack); + int tilesX2 = WorldGen.genRand.Next(generateForward, (int)(x * 0.7)); int tilesY = WorldGen.genRand.Next((int)(y * .3f), (int)(y * .35f)); if (Main.tile[tilesX, tilesY].type == TileID.Dirt || Main.tile[tilesX, tilesY].type == TileID.Stone) @@ -79,7 +79,7 @@ namespace CalamityMod.World } } - for (int k = 0; k < (int)((double)(x * y) * 50E-05); k++) //Evil Shrine + for (int k = 0; k < (int)(x * y * 50E-05); k++) //Evil Shrine { int tilesX = WorldGen.genRand.Next(0, x); int tilesY = WorldGen.genRand.Next((int)(y * .3f), (int)(y * .35f)); @@ -93,10 +93,10 @@ namespace CalamityMod.World } } - for (int k = 0; k < (int)((double)(x * y) * 50E-05); k++) //Cavern Shrine + for (int k = 0; k < (int)(x * y * 50E-05); k++) //Cavern Shrine { - int tilesX = WorldGen.genRand.Next((int)((double)x * 0.3), generateBack); - int tilesX2 = WorldGen.genRand.Next(generateForward, (int)((double)x * 0.7)); + int tilesX = WorldGen.genRand.Next((int)(x * 0.3), generateBack); + int tilesX2 = WorldGen.genRand.Next(generateForward, (int)(x * 0.7)); int tilesY = WorldGen.genRand.Next((int)(y * .55f), (int)(y * .8f)); if (Main.tile[tilesX, tilesY].type == TileID.Stone) @@ -111,7 +111,7 @@ namespace CalamityMod.World } } - for (int k = 0; k < (int)((double)(x * y) * 50E-05); k++) //Ice Shrine + for (int k = 0; k < (int)(x * y * 50E-05); k++) //Ice Shrine { int tilesX = WorldGen.genRand.Next(0, x); int tilesY = WorldGen.genRand.Next((int)(y * .35f), (int)(y * .5f)); @@ -123,7 +123,7 @@ namespace CalamityMod.World } } - for (int k = 0; k < (int)((double)(x * y) * 50E-05); k++) //Desert Shrine + for (int k = 0; k < (int)(x * y * 50E-05); k++) //Desert Shrine { int tilesX = WorldGen.genRand.Next(0, x); int tilesY = WorldGen.genRand.Next((int)(y * .35f), (int)(y * .5f)); @@ -135,7 +135,7 @@ namespace CalamityMod.World } } - for (int k = 0; k < (int)((double)(x * y) * 50E-05); k++) //Mushroom Shrine + for (int k = 0; k < (int)(x * y * 50E-05); k++) //Mushroom Shrine { int tilesX = WorldGen.genRand.Next(0, x); int tilesY = WorldGen.genRand.Next((int)(y * .35f), (int)(y * .5f)); @@ -147,7 +147,7 @@ namespace CalamityMod.World } } - for (int k = 0; k < (int)((double)(x * y) * 50E-05); k++) //Granite Shrine + for (int k = 0; k < (int)(x * y * 50E-05); k++) //Granite Shrine { int tilesX = WorldGen.genRand.Next(0, x); int tilesY = WorldGen.genRand.Next((int)(y * .35f), (int)(y * .5f)); @@ -159,7 +159,7 @@ namespace CalamityMod.World } } - for (int k = 0; k < (int)((double)(x * y) * 50E-05); k++) //Marble Shrine + for (int k = 0; k < (int)(x * y * 50E-05); k++) //Marble Shrine { int tilesX = WorldGen.genRand.Next(0, x); int tilesY = WorldGen.genRand.Next((int)(y * .35f), (int)(y * .5f)); @@ -172,7 +172,7 @@ namespace CalamityMod.World } //Murasama Shrine - WorldGenerationMethods.SpecialHut(TileID.HellstoneBrick, TileID.Hellstone, WallID.HellstoneBrick, 8, WorldGen.genRand.Next((int)((double)x * 0.97), (int)((double)x * 0.98)), y - 60); + WorldGenerationMethods.SpecialHut(TileID.HellstoneBrick, TileID.Hellstone, WallID.HellstoneBrick, 8, WorldGen.genRand.Next((int)(x * 0.97), (int)(x * 0.98)), y - 60); } } } diff --git a/World/WorldGenerationMethods.cs b/World/WorldGenerationMethods.cs index 1206237398..63f775049f 100644 --- a/World/WorldGenerationMethods.cs +++ b/World/WorldGenerationMethods.cs @@ -2305,8 +2305,8 @@ namespace CalamityMod.World #region EvilIsland public static void EvilIsland(int i, int j) { - double num = (double)WorldGen.genRand.Next(100, 150); //100 150 - float num2 = (float)WorldGen.genRand.Next(20, 30); //20 30 + double num = (double)WorldGen.genRand.Next(100, 150); + float num2 = (float)WorldGen.genRand.Next(20, 30); int num3 = i; int num4 = i; int num5 = i; @@ -4214,10 +4214,10 @@ namespace CalamityMod.World } } } - if (num <= 2f && vector.Y < (Main.rockLayer + Main.maxTilesY * 0.3)) + /*if (num <= 2f && vector.Y < (Main.rockLayer + Main.maxTilesY * 0.3)) { num = 2f; - } + }*/ vector += vector2; vector2.X += WorldGen.genRand.Next(-1, 2) * 0.01f; if (vector2.X > 0.02) diff --git a/build.txt b/build.txt index b61b3f685b..10f7c9f146 100644 --- a/build.txt +++ b/build.txt @@ -1,5 +1,5 @@ author = Fabsol and the Dev Team -version = 1.4.4.004 +version = 1.4.5.001 displayName = Calamity Mod (No Calamity Music) homepage = https://forums.terraria.org/index.php?threads/calamity-mod.44065/ buildIgnore = .vs\*, Properties\*, *.csproj, *.user, obj\*, bin\*, *.config, .git\*, LICENSE, README.md, .editorconfig, .gitignore, .gitattributes