From ae26fd12578e12172c59bbe11cba2fdbf671de9e Mon Sep 17 00:00:00 2001 From: Mortis3 <53282720+DylanDoe21@users.noreply.github.com> Date: Sun, 19 Feb 2023 22:45:39 -0500 Subject: [PATCH] mechanic abandoned shed, tooltip stuff -added gen for the mechanics abandoned shed -fixed all instances of LMB and RMB to left click and right click respectively in the shortened tooltips --- BiomeManagers/SulphurousSeaBiome.cs | 4 +- DataStructures/Attunement.cs | 10 +-- Items/Weapons/Melee/ArkoftheCosmos.cs | 14 ++-- Items/Weapons/Melee/ArkoftheElements.cs | 8 +-- Items/Weapons/Melee/TrueArkoftheAncients.cs | 4 +- Items/Weapons/Summon/AtlasMunitionsBeacon.cs | 4 +- Schematics/MechanicShed.csch | Bin 0 -> 1176 bytes Schematics/SchematicManager.cs | 4 ++ Schematics/SurfaceHouse_Snow_Mechanic.csch | Bin 3019 -> 0 bytes Systems/WorldgenManagementSystem.cs | 11 +++ World/MechanicShed.cs | 69 +++++++++++++++++++ 11 files changed, 106 insertions(+), 22 deletions(-) create mode 100644 Schematics/MechanicShed.csch delete mode 100644 Schematics/SurfaceHouse_Snow_Mechanic.csch create mode 100644 World/MechanicShed.cs diff --git a/BiomeManagers/SulphurousSeaBiome.cs b/BiomeManagers/SulphurousSeaBiome.cs index af163eb129..ad63c36d7c 100644 --- a/BiomeManagers/SulphurousSeaBiome.cs +++ b/BiomeManagers/SulphurousSeaBiome.cs @@ -60,14 +60,14 @@ namespace CalamityMod.BiomeManagers if (Abyss.AtLeftSideOfWorld) { - if (point.X < 380) + if (point.X < 435) { sulphurPosX = true; } } else { - if (point.X > Main.maxTilesX - 380) + if (point.X > Main.maxTilesX - 435) { sulphurPosX = true; } diff --git a/DataStructures/Attunement.cs b/DataStructures/Attunement.cs index f2c271dde9..4488f4a01a 100644 --- a/DataStructures/Attunement.cs +++ b/DataStructures/Attunement.cs @@ -683,8 +683,8 @@ namespace CalamityMod.DataStructures { id = AttunementID.Phoenix; name = "Phoenix's Pride"; - function_description = "Hold LMB to swing Galaxia around you, accelerating over time\nThe swirling nebula constantly emits homing cosmic bolts"; - function_description_extra = "Release LMB to hurl Galaxia toward the cursor alongside 6 gigantic cosmic bolts"; + function_description = "Hold left click to swing Galaxia around you, accelerating over time\nThe swirling nebula constantly emits homing cosmic bolts"; + function_description_extra = "Release left click to hurl Galaxia toward the cursor alongside 6 gigantic cosmic bolts"; tooltipColor = new Color(255, 87, 0); tooltipColor2 = new Color(255, 143, 0); @@ -762,8 +762,8 @@ namespace CalamityMod.DataStructures { id = AttunementID.Polaris; name = "Polaris' Gaze"; //It carries the mark of the Northern Star - function_description = "Hold LMB to channel Galaxia's power into a tight vortex of galactic energies\nThe vortex powers up over time and when hitting enemies"; - function_description_extra = "Release LMB to fire off the charged star in straight line\nPress LMB again immediately to dash towards the star and release cosmic bolts"; + function_description = "Hold left click to channel Galaxia's power into a tight vortex of galactic energies\nThe vortex powers up over time and when hitting enemies"; + function_description_extra = "Release left click to fire off the charged star in straight line\nPress left click again immediately to dash towards the star and release cosmic bolts"; tooltipColor = new Color(128, 189, 255); tooltipColor2 = new Color(255, 128, 140); @@ -801,7 +801,7 @@ namespace CalamityMod.DataStructures { id = AttunementID.Andromeda; name = "Andromeda's Stride"; - function_description = "Hold LMB to charge a god-erasing lunge, release to unleash the devastating blow\nGalaxia emits cosmic bolts while charging"; + function_description = "Hold left click to charge a god-erasing lunge, release to unleash the devastating blow\nGalaxia emits cosmic bolts while charging"; function_description_extra = "Lunging into the ground will cause a shockwave which summons a storm of cosmic energies"; tooltipColor = new Color(132, 128, 255); tooltipColor2 = new Color(194, 166, 255); diff --git a/Items/Weapons/Melee/ArkoftheCosmos.cs b/Items/Weapons/Melee/ArkoftheCosmos.cs index b3a43ac972..0dda896488 100644 --- a/Items/Weapons/Melee/ArkoftheCosmos.cs +++ b/Items/Weapons/Melee/ArkoftheCosmos.cs @@ -39,16 +39,16 @@ namespace CalamityMod.Items.Weapons.Melee public static float SwirlBoltAmount = 6f; //The amount of cosmic bolts produced during hte swirl attack public static float SwirlBoltDamageMultiplier = 0.7f; //This is the damage multiplier for ALL THE BOLTS: Aka, said damage multiplier is divided by the amount of bolts in a swirl and the full damage multiplier is gotten if you hit all the bolts - const string ComboTooltip = "Using LMB performs a 5-swing combo that ends by throwing the blade\n" + + const string ComboTooltip = "Using left click performs a 5-swing combo that ends by throwing the blade\n" + "The thrown blade will follow your cursor\n" + - "Releasing LMB while the blade is out will cause an exploding snap"; + "Releasing left click while the blade is out will cause an exploding snap"; - const string ParryTooltip = "Using RMB will snip out the scissor blades in front of you\n" + + const string ParryTooltip = "Using right click will snip out the scissor blades in front of you\n" + "Hitting an enemy with it will parry them, granting you brief invulnerability\n" + "You can parry projectiles to make them deal 200 less damage for a short period\n" + "Parrying anything will empower the next 10 swings of the sword"; - const string BlastTooltip = "Using RMB while pressing UP with empowered charges will provoke a Big Rip in spacetime and use all charges\n" + + const string BlastTooltip = "Using right click while pressing UP with empowered charges will provoke a Big Rip in spacetime and use all charges\n" + "If more than 5 charges were used, you can dash across the rip by holding UP"; @@ -56,9 +56,9 @@ namespace CalamityMod.Items.Weapons.Melee { DisplayName.SetDefault("Ark of the Cosmos"); Tooltip.SetDefault("This line gets set in ModifyTooltips\n" + - "This line also gets set in ModifyTooltips\n" + - "This line also gets set in ModifyTooltips\n" + - "The physical culmination of your journey, capable of rending gods asunder"); + "This line also gets set in ModifyTooltips\n" + + "This line also gets set in ModifyTooltips\n" + + "The physical culmination of your journey, capable of rending gods asunder"); SacrificeTotal = 1; } diff --git a/Items/Weapons/Melee/ArkoftheElements.cs b/Items/Weapons/Melee/ArkoftheElements.cs index 2ba0a2f44c..a85ef0f5e5 100644 --- a/Items/Weapons/Melee/ArkoftheElements.cs +++ b/Items/Weapons/Melee/ArkoftheElements.cs @@ -31,15 +31,15 @@ namespace CalamityMod.Items.Weapons.Melee public static float blastFalloffStrenght = 0.75f; //Value between 0 and 1 that determines how much falloff increases affect the damage : Closer to 0 = damage falls off less intensely, closer to 1 : damage falls off way harder - const string ComboTooltip = "Using LMB performs a 5-swing combo that ends by throwing the blade\n" + - "Releasing LMB while the blade is out will deal extra damage and give 2 charges"; + const string ComboTooltip = "Using left click performs a 5-swing combo that ends by throwing the blade\n" + + "Releasing left click while the blade is out will deal extra damage and give 2 charges"; - const string ParryTooltip = "Using RMB will snip out the scissor blades in front of you\n" + + const string ParryTooltip = "Using right click will snip out the scissor blades in front of you\n" + "Hitting an enemy with it will parry them, granting you brief invulnerability\n" + "You can also parry projectiles to make them deal 200 less damage for a short period\n" + "Parrying will empower the next 10 swings of the sword, letting you use both blades at once"; - const string BlastTooltip = "Using RMB while pressing UP with empowered charges will provoke a Big Rip in spacetime and use all charges\n" + + const string BlastTooltip = "Using right click while pressing UP with empowered charges will provoke a Big Rip in spacetime and use all charges\n" + "If more than 5 charges were used, you can dash across the rip by holding UP"; public override void SetStaticDefaults() diff --git a/Items/Weapons/Melee/TrueArkoftheAncients.cs b/Items/Weapons/Melee/TrueArkoftheAncients.cs index 9e610b0738..fb028ab79d 100644 --- a/Items/Weapons/Melee/TrueArkoftheAncients.cs +++ b/Items/Weapons/Melee/TrueArkoftheAncients.cs @@ -26,11 +26,11 @@ namespace CalamityMod.Items.Weapons.Melee public static float blastFalloffSpeed = 0.1f; //How much the blast damage falls off as you hit more and more targets public static float blastFalloffStrenght = 0.75f; //Value between 0 and 1 that determines how much falloff increases affect the damage : Closer to 0 = damage falls off less intensely, closer to 1 : damage falls off way harder - const string ParryTooltip = "Using RMB will extend the Ark out in front of you." + + const string ParryTooltip = "Using right click will extend the Ark out in front of you." + "Hitting an enemy with it will parry them, granting you brief invulnerability\n" + "You can also parry projectiles to make them deal 160 less damage for a short period\n" + "Parrying empowers the next 10 swings of the sword, letting them throw stronger projectiles\n" + - "Using RMB and pressing UP will release all empowered charges in a powerful burst of energy"; + "Using right click and pressing UP will release all empowered charges in a powerful burst of energy"; public override void SetStaticDefaults() { diff --git a/Items/Weapons/Summon/AtlasMunitionsBeacon.cs b/Items/Weapons/Summon/AtlasMunitionsBeacon.cs index 7df6977eba..3070ca37f0 100644 --- a/Items/Weapons/Summon/AtlasMunitionsBeacon.cs +++ b/Items/Weapons/Summon/AtlasMunitionsBeacon.cs @@ -49,10 +49,10 @@ namespace CalamityMod.Items.Weapons.Summon "If an enemy is in close proximity, it will enter Overdrive mode\n" + "When in Overdrive mode the cannon uses three barrels that each collectively fire\n" + "The cannon also heats up the more it fires in overdrive mode\n" + - "Press RMB while holding this item to pick up the cannon and use it for yourself\n" + + "Press right click while holding this item to pick up the cannon and use it for yourself\n" + "When held, the cannon will always be in Overdrive mode\n" + "If the held cannon overheats due to Overdrive mode, you are forced to drop it\n" + - "Pressing RMB allows you to drop it manually\n" + + "Pressing right click allows you to drop it manually\n" + "If the held cannon is dropped near the mount, it will re-attach automatically\n" + "It's surprisingly easy to pick up"); SacrificeTotal = 1; diff --git a/Schematics/MechanicShed.csch b/Schematics/MechanicShed.csch new file mode 100644 index 0000000000000000000000000000000000000000..0ef5059d12a77fd8a84970d20c95ac9592686121 GIT binary patch literal 1176 zcmV;J1ZVpn6kNa`iwFP!000003ayyemK#M7hD$=oLW^0LB@2v!A$Z9K1Z$!Qi%eLO zF(878CW&C;l5D^P0|pir6MV7fm~(v31y8^Q&w!tRH{cxZ_^YdGT-|48SY!9uZ)W}u z^>_93jHGQ4QDajh9Dl+wE@y}1R&K@LVo*8tS&^trRAazZ^b7PpqL!!y8nV(TW3=rb zM>4LpNYl6;vFdRJt5AAGg9fW1N9j>VV)lzD(w6f$?a3OdWAlU}>MW_s!(5iaxUnjU z$r(Z6`X86O#2l#u(TUN_EQiC2Z2RzoY7_n7qU_aG3UkqMBUzXB-r$$Z>eAnu`|1Y! ziOM3Ct6Cq_?k2|d%t5myiz%zr)o~lz`=b!8jU2qnRjn-UgXDg=%Y80t>uP>*2vOSMjQdT-HTP)0zPq=IAfWeFYy)5!AG*-A!&g zE~uUS=oe~9l{n<;Co@~XGsg~7q34)a5IuVh?#|7a+BlpibpU2zE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(R<6MV$0BALp( z@7{sg(|kaw1Bbl~@F}Pd*qjc^Bz^{Sl4Zro3{++>H~8G&1-*G~$)aF^Kt}K!U7{#s zE7VB!Ej+Ui<&McvKPeEVAc0U=g0e(-Hozrs zAES8en4*vje>e_^;v4prb7F9GVG0_=)R@37EOkSF`t4H`AcQH|m9f*n8N@O&dYcAM zGx?uNQsAzH*DXUGx>bBiJ?o5)kARLZpk>xAK5d=F*1~`uqE~4TN*e`w=+1|!Gc2xS zqSvl?=TDOR>DwSVuT<#mJ*@U1USg1NN(p~niNI4W%QnVujvT#WGiq{Y^s2|Gsr(Y* uq!|937=il genpass.Name.Equals("Sunflowers")); + if (mechanicIndex != -1) + { + tasks.Insert(mechanicIndex + 1, new PassLegacy("Mechanic Shed", (progress, config) => + { + progress.Message = "Placing mechanic shed"; + MechanicShed.PlaceMechanicShed(WorldGen.structures); + })); + } + //Vernal pass int vernalIndex = tasks.FindIndex(genpass => genpass.Name.Equals("Muds Walls In Jungle")); if (vernalIndex != -1) diff --git a/World/MechanicShed.cs b/World/MechanicShed.cs new file mode 100644 index 0000000000..fc28be909d --- /dev/null +++ b/World/MechanicShed.cs @@ -0,0 +1,69 @@ +using System; +using System.Collections.Generic; +using CalamityMod.Schematics; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.WorldBuilding; +using static CalamityMod.Schematics.SchematicManager; + +namespace CalamityMod.World +{ + public class MechanicShed + { + public static void PlaceMechanicShed(StructureMap structures) + { + string mapKey = MechanicShedKey; + var schematic = TileMaps[mapKey]; + + int placementPositionX = WorldGen.genRand.Next(WorldGen.snowOriginLeft + 100, WorldGen.snowOriginRight - 100); + int placementPositionY = (int)Main.worldSurface - (Main.maxTilesY / 8); + + bool foundValidGround = false; + int attempts = 0; + while (!foundValidGround && attempts++ < 100000) + { + while (!WorldGen.SolidTile(placementPositionX, placementPositionY) && placementPositionY <= Main.worldSurface) + { + placementPositionY++; + } + + if (Main.tile[placementPositionX, placementPositionY].HasTile || Main.tile[placementPositionX, placementPositionY].WallType > 0) + { + foundValidGround = true; + } + } + + Point placementPoint = new Point(placementPositionX, placementPositionY + 3); + + Vector2 schematicSize = new Vector2(schematic.GetLength(0), schematic.GetLength(1)); + SchematicAnchor anchorType = SchematicAnchor.BottomCenter; + + bool place = true; + PlaceSchematic(mapKey, placementPoint, anchorType, ref place, new Action(FillMechanicChest)); + + Rectangle protectionArea = CalamityUtils.GetSchematicProtectionArea(schematic, placementPoint, anchorType); + structures.AddProtectedStructure(protectionArea, 30); + } + + public static void FillMechanicChest(Chest chest, int Type, bool place) + { + int gizmoGoobabGadgets = Utils.SelectRandom(WorldGen.genRand, ItemID.Stopwatch, ItemID.LifeformAnalyzer, ItemID.DPSMeter); + List contents = new List() + { + new ChestItem(ItemID.Toolbox, 1), + new ChestItem(ItemID.ActuationAccessory, 1), + new ChestItem(gizmoGoobabGadgets, 1), + new ChestItem(ItemID.BuilderPotion, WorldGen.genRand.Next(1, 3)), + new ChestItem(ItemID.GoldCoin, WorldGen.genRand.Next(1, 3)), + }; + + for (int i = 0; i < contents.Count; i++) + { + chest.item[i].SetDefaults(contents[i].Type); + chest.item[i].stack = contents[i].Stack; + } + } + } +}