Last active
April 11, 2023 19:18
-
-
Save steviegt6/d65bc73b42dd1d1ef3a558cbcbca2d1a to your computer and use it in GitHub Desktop.
ExtraAccSlots patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/ExtraAccSlotsOld/AccSlotConfig.cs b/ExtraAccSlots/AccSlotConfig.cs | |
| index 8ba9f90..008fd53 100644 | |
| --- a/ExtraAccSlotsOld/AccSlotConfig.cs | |
| +++ b/ExtraAccSlots/AccSlotConfig.cs | |
| @@ -151,6 +151,124 @@ public class AccSlotConfig : ModConfig | |
| [DefaultValue(true)] | |
| [ReloadRequired] | |
| public bool StardustToggle; | |
| + | |
| + [Header("Calamity Boss Slots")] | |
| + [Label("Desert Scourge")] | |
| + [DefaultValue(true)] | |
| + public bool DesertScourgeToggle; | |
| + | |
| + [Label("Crabulon")] | |
| + [DefaultValue(true)] | |
| + public bool CrabulonToggle; | |
| + | |
| + [Label("The Hive Mind/The Perforators")] | |
| + [DefaultValue(true)] | |
| + public bool HiveMindPerforatorsToggle; | |
| + | |
| + [Label("The Slime God")] | |
| + [DefaultValue(true)] | |
| + public bool SlimeGodToggle; | |
| + | |
| + [Label("Cryogen")] | |
| + [DefaultValue(true)] | |
| + public bool CryogenToggle; | |
| + | |
| + [Label("Aquatic Scourge")] | |
| + [DefaultValue(true)] | |
| + public bool AquaticScourgeToggle; | |
| + | |
| + [Label("Brimstone Elemental")] | |
| + [DefaultValue(true)] | |
| + public bool BrimstoneElementalToggle; | |
| + | |
| + [Label("Calamitas Clone")] | |
| + [DefaultValue(true)] | |
| + public bool CalamitasCloneToggle; | |
| + | |
| + [Label("Leviathan and Anahita")] | |
| + [DefaultValue(true)] | |
| + public bool LeviathanAnahitaToggle; | |
| + | |
| + [Label("Astrum Aureus")] | |
| + [DefaultValue(true)] | |
| + public bool AstrumAureusToggle; | |
| + | |
| + [Label("The Plaguebringer Goliath")] | |
| + [DefaultValue(true)] | |
| + public bool PlaguebringerGoliathToggle; | |
| + | |
| + [Label("Ravager")] | |
| + [DefaultValue(true)] | |
| + public bool RavagerToggle; | |
| + | |
| + [Label("Astrum Deus")] | |
| + [DefaultValue(true)] | |
| + public bool AstrumDeusToggle; | |
| + | |
| + [Label("Profaned Guardians")] | |
| + [DefaultValue(true)] | |
| + public bool ProfanedGuardiansToggle; | |
| + | |
| + [Label("The Dragonfolly")] | |
| + [DefaultValue(true)] | |
| + public bool DragonfollyToggle; | |
| + | |
| + [Label("Providence")] | |
| + [DefaultValue(true)] | |
| + public bool ProvidenceToggle; | |
| + | |
| + [Label("Storm Weaver")] | |
| + [DefaultValue(true)] | |
| + public bool StormWeaverToggle; | |
| + | |
| + [Label("Ceaseless Void")] | |
| + [DefaultValue(true)] | |
| + public bool CeaselessVoidToggle; | |
| + | |
| + [Label("Signus")] | |
| + [DefaultValue(true)] | |
| + public bool SignusToggle; | |
| + | |
| + [Label("Polterghast")] | |
| + [DefaultValue(true)] | |
| + public bool PolterghastToggle; | |
| + | |
| + [Label("The Old Duke")] | |
| + [DefaultValue(true)] | |
| + public bool OldDukeToggle; | |
| + | |
| + [Label("The Devourer of Gods")] | |
| + [DefaultValue(true)] | |
| + public bool DevourerOfGodsToggle; | |
| + | |
| + [Label("Yharon")] | |
| + [DefaultValue(true)] | |
| + public bool YharonToggle; | |
| + | |
| + [Label("Exo Mechs")] | |
| + [DefaultValue(true)] | |
| + public bool ExoMechsToggle; | |
| + | |
| + [Label("Calamitas")] | |
| + [DefaultValue(true)] | |
| + public bool CalamitasToggle; | |
| + | |
| + [Header("Calamity Event Slots")] | |
| + [Label("Acid Rain Tier 1")] | |
| + [DefaultValue(true)] | |
| + public bool AcidRainTier1Toggle; | |
| + | |
| + [Label("Acid Rain Tier 2")] | |
| + [DefaultValue(true)] | |
| + public bool AcidRainTier2Toggle; | |
| + | |
| + [Label("Acid Rain Tier 3")] | |
| + [DefaultValue(true)] | |
| + public bool AcidRainTier3Toggle; | |
| + | |
| + [Label("Boss Rush")] | |
| + [DefaultValue(true)] | |
| + public bool BossRushToggle; | |
| [Header("Miscellaneous")] | |
| [Label("Dye Slots")] | |
| diff --git a/ExtraAccSlotsOld/ExtraAccSlots.csproj b/ExtraAccSlots/ExtraAccSlots.csproj | |
| index 9446c12..0fd78e5 100644 | |
| --- a/ExtraAccSlotsOld/ExtraAccSlots.csproj | |
| +++ b/ExtraAccSlots/ExtraAccSlots.csproj | |
| @@ -1,18 +1,13 @@ | |
| +<?xml version="1.0" encoding="utf-8"?> | |
| <Project Sdk="Microsoft.NET.Sdk"> | |
| + <Import Project="..\tModLoader.targets" /> | |
| <PropertyGroup> | |
| <AssemblyName>ExtraAccSlots</AssemblyName> | |
| - <GenerateAssemblyInfo>False</GenerateAssemblyInfo> | |
| - <TargetFramework>netcoreapp3.1</TargetFramework> | |
| + <TargetFramework>net6.0</TargetFramework> | |
| + <PlatformTarget>AnyCPU</PlatformTarget> | |
| + <LangVersion>latest</LangVersion> | |
| </PropertyGroup> | |
| - <PropertyGroup> | |
| - <LangVersion>11.0</LangVersion> | |
| - <AllowUnsafeBlocks>True</AllowUnsafeBlocks> | |
| - </PropertyGroup> | |
| - <PropertyGroup /> | |
| - <ItemGroup /> | |
| <ItemGroup> | |
| - <Reference Include="tModLoader"> | |
| - <HintPath>..\..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\tModLoader\tModLoader.dll</HintPath> | |
| - </Reference> | |
| + <PackageReference Include="tModLoader.CodeAssist" Version="0.1.*" /> | |
| </ItemGroup> | |
| </Project> | |
| \ No newline at end of file | |
| diff --git a/ExtraAccSlotsOld/Properties/AssemblyInfo.cs b/ExtraAccSlotsOld/Properties/AssemblyInfo.cs | |
| deleted file mode 100644 | |
| index bbd7eef..0000000 | |
| --- a/ExtraAccSlotsOld/Properties/AssemblyInfo.cs | |
| +++ /dev/null | |
| @@ -1,5 +0,0 @@ | |
| -using System.Diagnostics; | |
| -using System.Reflection; | |
| -using System.Runtime.CompilerServices; | |
| - | |
| -[assembly: AssemblyVersion("0.0.0.0")] | |
| diff --git a/ExtraAccSlots/Properties/launchSettings.json b/ExtraAccSlots/Properties/launchSettings.json | |
| new file mode 100644 | |
| index 0000000..8da89ff | |
| --- /dev/null | |
| +++ b/ExtraAccSlots/Properties/launchSettings.json | |
| @@ -0,0 +1,16 @@ | |
| +{ | |
| + "profiles": { | |
| + "Terraria": { | |
| + "commandName": "Executable", | |
| + "executablePath": "dotnet", | |
| + "commandLineArgs": "$(tMLPath)", | |
| + "workingDirectory": "$(tMLSteamPath)" | |
| + }, | |
| + "TerrariaServer": { | |
| + "commandName": "Executable", | |
| + "executablePath": "dotnet", | |
| + "commandLineArgs": "$(tMLServerPath)", | |
| + "workingDirectory": "$(tMLSteamPath)" | |
| + } | |
| + } | |
| +} | |
| \ No newline at end of file | |
| diff --git a/ExtraAccSlots/Slots/Commission/AccessorySlotLoader.cs b/ExtraAccSlots/Slots/Commission/AccessorySlotLoader.cs | |
| new file mode 100644 | |
| index 0000000..f328bfb | |
| --- /dev/null | |
| +++ b/ExtraAccSlots/Slots/Commission/AccessorySlotLoader.cs | |
| @@ -0,0 +1,61 @@ | |
| +using System; | |
| +using Terraria.ModLoader; | |
| + | |
| +namespace ExtraAccSlots.Slots.Commission; | |
| + | |
| +internal sealed class AccessorySlotLoader : ModSystem { | |
| + public override void OnModLoad() { | |
| + base.OnModLoad(); | |
| + | |
| + if (ModLoader.TryGetMod("CalamityMod", out var calamityMod)) | |
| + LoadCalamitySlots(calamityMod); | |
| + } | |
| + | |
| + private void LoadCalamitySlots(Mod calamityMod) { | |
| + void bossDowned(string bossName, Func<AccSlotConfig, bool> config) { | |
| + Mod.AddContent( | |
| + new BaseAccessorySlot( | |
| + "calamity_" + bossName, | |
| + () => (bool) calamityMod.Call("Downed", bossName), | |
| + Config(config) | |
| + ) | |
| + ); | |
| + } | |
| + | |
| + bossDowned("desertscourge", x => x.DesertScourgeToggle); | |
| + bossDowned("crabulon", x => x.CrabulonToggle); | |
| + bossDowned("hivemind", x => x.HiveMindPerforatorsToggle); | |
| + bossDowned("perforator", x => x.HiveMindPerforatorsToggle); | |
| + bossDowned("slimegod", x => x.SlimeGodToggle); | |
| + bossDowned("cryogen", x => x.CryogenToggle); | |
| + bossDowned("aquaticscourge", x => x.AquaticScourgeToggle); | |
| + bossDowned("brimstoneelemental", x => x.BrimstoneElementalToggle); | |
| + bossDowned("clone", x => x.CalamitasCloneToggle); | |
| + bossDowned("sirenleviathan", x => x.LeviathanAnahitaToggle); | |
| + bossDowned("aureus", x => x.AstrumAureusToggle); | |
| + bossDowned("pbg", x => x.PlaguebringerGoliathToggle); | |
| + bossDowned("ravager", x => x.RavagerToggle); | |
| + bossDowned("astrumdeus", x => x.AstrumDeusToggle); | |
| + bossDowned("guardians", x => x.ProfanedGuardiansToggle); | |
| + bossDowned("dragonfolly", x => x.DragonfollyToggle); | |
| + bossDowned("providence", x => x.ProvidenceToggle); | |
| + bossDowned("stormweaver", x => x.StormWeaverToggle); | |
| + bossDowned("void", x => x.CeaselessVoidToggle); | |
| + bossDowned("signus", x => x.SignusToggle); | |
| + bossDowned("polterghast", x => x.PolterghastToggle); | |
| + bossDowned("oldduke", x => x.OldDukeToggle); | |
| + bossDowned("dog", x => x.DevourerOfGodsToggle); | |
| + bossDowned("yharon", x => x.YharonToggle); | |
| + bossDowned("draedon", x => x.ExoMechsToggle); | |
| + bossDowned("calamitas", x => x.CalamitasToggle); | |
| + | |
| + bossDowned("acid rain 1", x => x.AcidRainTier1Toggle); | |
| + bossDowned("acid rain 2", x => x.AcidRainTier2Toggle); | |
| + bossDowned("acid rain 3", x => x.AcidRainTier3Toggle); | |
| + bossDowned("bossrush", x => x.BossRushToggle); | |
| + } | |
| + | |
| + private static Func<bool> Config(Func<AccSlotConfig, bool> config) { | |
| + return () => config(ModContent.GetInstance<AccSlotConfig>()); | |
| + } | |
| +} | |
| diff --git a/ExtraAccSlots/Slots/Commission/BaseAccessorySlot.cs b/ExtraAccSlots/Slots/Commission/BaseAccessorySlot.cs | |
| new file mode 100644 | |
| index 0000000..70c7330 | |
| --- /dev/null | |
| +++ b/ExtraAccSlots/Slots/Commission/BaseAccessorySlot.cs | |
| @@ -0,0 +1,36 @@ | |
| +using System; | |
| +using Terraria.ModLoader; | |
| + | |
| +namespace ExtraAccSlots.Slots.Commission; | |
| + | |
| +[Autoload(false)] | |
| +internal sealed class BaseAccessorySlot : ModAccessorySlot { | |
| + public override bool DrawDyeSlot => ModContent.GetInstance<AccSlotConfig>().DyeSlots; | |
| + | |
| + public override bool DrawVanitySlot => ModContent.GetInstance<AccSlotConfig>().VanitySlots; | |
| + | |
| + public override bool DrawFunctionalSlot => ModContent.GetInstance<AccSlotConfig>().FunctionalSlots; | |
| + | |
| + public override string Name { get ; } | |
| + | |
| + private readonly Func<bool> unlocked; | |
| + private readonly Func<bool> enabled; | |
| + | |
| + public BaseAccessorySlot( | |
| + string name, | |
| + Func<bool> unlocked, | |
| + Func<bool> enabled | |
| + ) { | |
| + Name = name; | |
| + this.unlocked = unlocked; | |
| + this.enabled = enabled; | |
| + } | |
| + | |
| + public override bool IsEnabled() { | |
| + return enabled() && unlocked(); | |
| + } | |
| + | |
| + public override bool IsVisibleWhenNotEnabled() { | |
| + return false; | |
| + } | |
| +} | |
| diff --git a/ExtraAccSlotsOld/build.txt b/ExtraAccSlots/build.txt | |
| index ca75fd6..5e8d4ab 100644 | |
| --- a/ExtraAccSlotsOld/build.txt | |
| +++ b/ExtraAccSlots/build.txt | |
| @@ -1,5 +1,5 @@ | |
| -author = Porygon-Z | |
| -version = 0.2.3.1 | |
| +author = Porygon-Z, Tomat | |
| +version = 0.3.0 | |
| displayName = Extra Accessory Slots | |
| hideCode = false | |
| hideResources = false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment