diff --git a/README.md b/README.md index 372760b..ad23ab7 100644 --- a/README.md +++ b/README.md @@ -1,52 +1,9 @@ -# StS-Default Mod Base +# Construct the Spire (formerly Arena) -Welcome to this extremely over-commented Slay the Spire modding base. +### Custom game Mod for Constructed mode in Slay the Spire -This is a minimal "default clean slate" for creating Slay the spire mods. +This patches the addNonDailyMods method in CustomModeScreen to set a static boolean that signals to the rest of the +patches that the mod has been enabled. -Use it to make your own mod of any type - If you want to add any standard in-game content (character, cards, relics, events, etc.), this is a good starting point. - -It features 1 character (the Default) with a minimal set of things: 1 card of each type, 1 debuff, 1 relic, etc. - -If you're new to modding, you basically *need* the BaseMod wiki for whatever you wish to add, and you can work your way thought it with this base. Another very important thing is to look at other mods (get them from their github!), as well as the base-game code, and see how they do things. - -https://github.com/daviscook477/BaseMod/wiki - -This base itself isn't going to help you code or anything!! Nor does it provide basic Java learning - if you need that go through the codeacademy free java course! While I have been putting comments about what does what, this is just a nice starting point if you need a place to start learning from that's not an absolute empty canvas, or an overly-complicated, difficult to understand mod. But you still need to learn how the in-game code works and how to piece things together on your own. (i.e. this base will show you where to put the code for double-tap, but not what it is/how to write it. Look up the actual cards and backward-engineer them for that.) - -Feel free to use this in any way you like, of course. - -If you have any issues or you want to recommend and/or add something to the mod that you feel would be helpful, feel free to submit an issue or a PR! - -Happy modding! - ---- - -## Check the wiki to get started: - -https://github.com/Gremious/StS-DefaultModBase/wiki - ---- - -## Know what you're doing? - -Hop on over to the Quick Start branch. It's a fully cloneable, uncommented version of the Default ready for jump-starting a brand new mod! - ---- - -## Some HD Slay the Spire art assets: - -Includes: - - Empty Relic Template feat. empty bottle - - Empty Card Template - - Color-Changable cardback - - A couple of HD Monster vectors (Louse, Nob, Sentry, Sneaky Gremlin) - - A coupe of HD items (J.A.X., A Coin) - - 2 people silhouettes - - A curse Background - -https://mega.nz/#F!gfpgTCyK!2oFOjVFKyOreKv7zdY1fEQ - -(If you want to contribute to this collection feel free to send me a message through [#modding](https://www.megacrit.com/) or a github issue.) - ---- +This behavior is because I couldn't quite figure out how to detect loaded game mods during runtime from methods called +after AbstractDungeon has been initalized. \ No newline at end of file diff --git a/constructTheArena/pom.xml b/constructTheArena/pom.xml index a8c7443..9cb6189 100644 --- a/constructTheArena/pom.xml +++ b/constructTheArena/pom.xml @@ -6,7 +6,7 @@ xyz.geniuscartel ConstructTheArena Construct The Arena - 1.0 + 1.1 A default base to start your own mod from. diff --git a/constructTheArena/src/main/java/constructTheArena/patches/CArenaPatch.java b/constructTheArena/src/main/java/constructTheArena/patches/CArenaPatch.java index 57541f0..8aef4b9 100644 --- a/constructTheArena/src/main/java/constructTheArena/patches/CArenaPatch.java +++ b/constructTheArena/src/main/java/constructTheArena/patches/CArenaPatch.java @@ -2,8 +2,6 @@ package constructTheArena.patches; import com.evacipated.cardcrawl.modthespire.lib.SpireInsertPatch; import com.evacipated.cardcrawl.modthespire.lib.SpirePatch; -import com.megacrit.cardcrawl.characters.AbstractPlayer; -import com.megacrit.cardcrawl.helpers.ModHelper; import com.megacrit.cardcrawl.screens.custom.CustomModeScreen; import com.megacrit.cardcrawl.trials.CustomTrial; import org.apache.logging.log4j.LogManager; @@ -27,17 +25,17 @@ public class CArenaPatch { public static void Insert(CustomModeScreen __instance, CustomTrial trial, ArrayList modIds, String modId) { if (modId.equals("constructTheArena:constructTheArena")) { //do nothing for now - if (ModHelper.isModEnabled("constructTheArena:constructTheArena")) { - enabled = true; - } else { - enabled = false; - } + enabled = true; } } - public static boolean isEnabled(){ + public static boolean isEnabled() { return enabled; } + + public static void setEnabled(boolean b) { + enabled = b; + } } diff --git a/constructTheArena/src/main/java/constructTheArena/patches/CArenaPatch.md b/constructTheArena/src/main/java/constructTheArena/patches/CArenaPatch.md new file mode 100644 index 0000000..62b7552 --- /dev/null +++ b/constructTheArena/src/main/java/constructTheArena/patches/CArenaPatch.md @@ -0,0 +1,3 @@ +#CArenaPatch + +This method simply detects if the game mod was selected by the user and stores the decision in a boolean. \ No newline at end of file diff --git a/constructTheArena/src/main/java/constructTheArena/patches/CArenaSkipMasterDeckPatch.md b/constructTheArena/src/main/java/constructTheArena/patches/CArenaSkipMasterDeckPatch.md new file mode 100644 index 0000000..090399e --- /dev/null +++ b/constructTheArena/src/main/java/constructTheArena/patches/CArenaSkipMasterDeckPatch.md @@ -0,0 +1,9 @@ +#CArenaSkipMasterDeckPatch + +This patch inserts a call inside initializeStarterDeck in AbstractPlayer + +This encapsulates and provides a reference to addBaseCards inside the method. There was a bug where subsequent games +would not load the starting deck because the logic for detecting enabled game mods was not what I was expecting. + +That being said, this checks the [[CArenaPatch]] class to see if the mod was enabled and bases its decision off of that. +It's a bit of a hack, yes, but it works. \ No newline at end of file diff --git a/constructTheArena/src/main/java/constructTheArena/patches/ConstructDraftPatch.java b/constructTheArena/src/main/java/constructTheArena/patches/ConstructDraftPatch.java index 73df98a..9d6e961 100644 --- a/constructTheArena/src/main/java/constructTheArena/patches/ConstructDraftPatch.java +++ b/constructTheArena/src/main/java/constructTheArena/patches/ConstructDraftPatch.java @@ -75,6 +75,7 @@ public class ConstructDraftPatch { AbstractDungeon.gridSelectScreen.open(constructGroup, 40, true, uiStrings.TEXT[0]+CardLimit+uiStrings.TEXT[1]); AbstractDungeon.getCurrRoom().spawnRelicAndObtain(Settings.WIDTH / 2.0F, Settings.HEIGHT / 2.0F, new ConstructorsBurden()); + CArenaPatch.setEnabled(false); //turne off deck skipping and whatnot } } diff --git a/constructTheArena/src/main/java/constructTheArena/patches/ConstructDraftPatch.md b/constructTheArena/src/main/java/constructTheArena/patches/ConstructDraftPatch.md new file mode 100644 index 0000000..090f017 --- /dev/null +++ b/constructTheArena/src/main/java/constructTheArena/patches/ConstructDraftPatch.md @@ -0,0 +1,13 @@ +#ConstructDraftPatch + +This prefixes the dailyBlessing method of the NeowEvent. This checks the [[CArenaPatch]] class to see if the game mod was +enabled. At the end of the patched method call, this will set CArenaPatch.enabled to false in order to make sure +subsequent (potentially non-cosntructed) games will have the master deck and normal card rewards. + +The current ruleset is thus: + +4 copies of every card available to the player's card pool +4 copies of each of the cards in the character's master deck +Maximum of 40 selections + +After the card selection dialgue is complete, the [[ConstructorsBurden]] relic will be added to the player \ No newline at end of file diff --git a/constructTheArena/src/main/java/constructTheArena/relics/ConstructorsBurden.md b/constructTheArena/src/main/java/constructTheArena/relics/ConstructorsBurden.md new file mode 100644 index 0000000..7be9fb8 --- /dev/null +++ b/constructTheArena/src/main/java/constructTheArena/relics/ConstructorsBurden.md @@ -0,0 +1,4 @@ +#ConstructorsBurden + +Simple abstract relic that reduces card rewards by 10 in order to negate all potential card rewards. There may be a case +where card rewards can exceed 10, but I can't think of one. \ No newline at end of file diff --git a/constructTheArena/src/main/java/constructTheArena/util/ResUtil.java b/constructTheArena/src/main/java/constructTheArena/util/ResUtil.java index 5ca02ed..a338962 100644 --- a/constructTheArena/src/main/java/constructTheArena/util/ResUtil.java +++ b/constructTheArena/src/main/java/constructTheArena/util/ResUtil.java @@ -12,7 +12,6 @@ public class ResUtil { sb.append("/"); } } - return sb.toString(); } diff --git a/deploy.sh b/deploy.sh new file mode 100644 index 0000000..46919ba --- /dev/null +++ b/deploy.sh @@ -0,0 +1,7 @@ +#! /bin/bash +rm ~/.steam/debian-installation/steamapps/common/SlayTheSpire/ConstructTheArena/content/ConstructTheArena.jar +cp constructTheArena/target/ConstructTheArena.jar ~/.steam/debian-installation/steamapps/common/SlayTheSpire/ConstructTheArena/content/ConstructTheArena.jar + +cd ~/.steam/debian-installation/steamapps/common/SlayTheSpire || exit + +java -jar mod-uploader.jar upload -w ConstructTheArena \ No newline at end of file