Skip to content

Commit

Permalink
Merge remote-tracking branch 'daviscook477/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
kiooeht committed Apr 28, 2018
2 parents 3f15672 + 1acb808 commit a380eb6
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 10 deletions.
9 changes: 6 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,13 +261,16 @@ This is a fast forward to v1.6.3 of daviscook477's fork with a few additional ch
* Add support for per-card energy orb graphics (BlankTheEvil)

#### v2.5.0 ####
* Support **week 20** patch (kiooeht)
* Support week 20 patch (kiooeht)
* Add support for custom dynamic variables (kiooeht)
* Merge CustomCardWithRender features into CustomCard - **breaking change** - should only affect BlackMageMod
* Merge CustomCardWithRender features into CustomCard - breaking change - should only affect BlackMageMod
* Add feature CardBasic (1st functional version) (DemoXinMC)
* Add support for per-card banners (BlankTheEvil)

#### v2.6.0 ####
* Support week 21 patch

#### dev ####
* Support **week 22** patch (kiooeht)
* Allow mods to use the same card and relic IDs without conflict (kiooeht)
* Modal option improvements (kiooeht)
* Modal option improvements (kiooeht)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# BaseMod #
BaseMod provides a number of hooks and a console.

Currently supported version of Slay The Spire: `[EARLY_ACCESS_020]` (non beta)
Currently supported version of Slay The Spire: `[EARLY_ACCESS_022]` (non beta)

![Developer Console](github_resources/console.png)

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>basemod</groupId>
<artifactId>BaseMod</artifactId>
<version>1.6.5</version>
<version>2.6.0</version>
<packaging>jar</packaging>

<name>BaseMod</name>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,44 @@
package basemod.patches.com.megacrit.cardcrawl.actions.GameActionManager;

import java.util.ArrayList;

import com.evacipated.cardcrawl.modthespire.lib.LineFinder;
import com.evacipated.cardcrawl.modthespire.lib.Matcher;
import com.evacipated.cardcrawl.modthespire.lib.SpireInsertLocator;
import com.evacipated.cardcrawl.modthespire.lib.SpireInsertPatch;
import com.evacipated.cardcrawl.modthespire.lib.SpirePatch;
import com.evacipated.cardcrawl.modthespire.patcher.PatchingException;
import com.megacrit.cardcrawl.actions.GameActionManager;
import com.megacrit.cardcrawl.cards.CardQueueItem;

import basemod.BaseMod;
import javassist.CannotCompileException;
import javassist.CtBehavior;

@SpirePatch(cls="com.megacrit.cardcrawl.actions.GameActionManager", method="getNextAction")
public class GetNextActionHook {
@SpireInsertPatch(rloc=49)


@SpireInsertPatch()
public static void Insert(Object __obj_instance) {
GameActionManager actionManager = (GameActionManager) __obj_instance;
BaseMod.publishOnCardUse(((CardQueueItem)actionManager.cardQueue.get(0)).card);
}

public static class Locator extends SpireInsertLocator
{
public int[] Locate(CtBehavior ctMethodToPatch) throws CannotCompileException, PatchingException
{
ArrayList<Matcher> prevMatches = new ArrayList<>();
prevMatches.add(
new Matcher.FieldAccessMatcher(
"com.megacrit.cardcrawl.actions.GameActionManager",
"cardsPlayedThisTurn"));

Matcher finalMatcher = new Matcher.MethodCallMatcher("java.util.ArrayList", "add");

return LineFinder.findInOrder(ctMethodToPatch, new ArrayList<Matcher>(), finalMatcher);
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static class Locator extends SpireInsertLocator
{
public int[] Locate(CtBehavior ctMethodToPatch) throws CannotCompileException, PatchingException
{
Matcher finalMatcher = new Matcher.MethodCallMatcher(InputHelper.class.getName(), "updateFirst");
Matcher finalMatcher = new Matcher.MethodCallMatcher("com.megacrit.cardcrawl.helpers.InputHelper", "updateFirst");

int[] beforeLines = LineFinder.findInOrder(ctMethodToPatch, new ArrayList<Matcher>(), finalMatcher);

Expand All @@ -58,7 +58,7 @@ public static class Locator extends SpireInsertLocator
{
public int[] Locate(CtBehavior ctMethodToPatch) throws CannotCompileException, PatchingException
{
Matcher finalMatcher = new Matcher.MethodCallMatcher(InputHelper.class.getName(), "updateLast");
Matcher finalMatcher = new Matcher.MethodCallMatcher("com.megacrit.cardcrawl.helpers.InputHelper", "updateLast");

return LineFinder.findInOrder(ctMethodToPatch, new ArrayList<Matcher>(), finalMatcher);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package basemod.patches.com.megacrit.cardcrawl.helpers.InputHelper;

import com.evacipated.cardcrawl.modthespire.lib.SpirePatch;

import javassist.CannotCompileException;
import javassist.expr.ExprEditor;
import javassist.expr.MethodCall;

public class QuickSelectConsoleDisable {

@SpirePatch(cls="com.megacrit.cardcrawl.helpers.InputHelper", method="getCardSelectedByHotkey")
public static class GetCardSelectedByHotkeyFix {

public static ExprEditor Instrument() {
return new ExprEditor() {

public void edit(MethodCall m) throws CannotCompileException {
if (m.getClassName().equals("com.badlogic.gdx.Input") && m.getMethodName().equals("isKeyJustPressed")) {
m.replace("{ $_ = !basemod.DevConsole.visible && $proceed($$); }");
}
}

};
}

}

}
5 changes: 3 additions & 2 deletions src/main/resources/ModTheSpire.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"name": "BaseMod",
"author_list": ["t-larson", "test447", "Haashi", "kiooeht", "Blank The Evil", "FlipskiZ", "DemoXinMC"],
"description": "Unofficial modding API for Slay the Spire. Also a Dev Console.",
"version": "2.5.0",
"version": "2.6.0",
"sts_version": "04-26-2018",
"mts_version": "2.6.0"
"mts_version": "2.6.0",
"update_json": "https://api.github.com/repos/daviscook477/BaseMod/releases/latest"
}

0 comments on commit a380eb6

Please sign in to comment.