BaseMod provides a number of hooks and a console.
- Java 8+
- Java 8
- Maven
- CFR 124 (run this with Java 8, doesn't work well with 9)
- Decompile the
com.megacrit.cardcrawl
package fromdesktop-1.0.jar
- Put the decompiled files in
../_lib/decompiled
relative to the repo - Run
mvn package
- Copy
target/BaseMod.jar
to your ModTheSpire mods directory.
Default hotkey is `
, can be changed from BaseMod's settings screen.
deck add [id] {upgrades}
add card to deck (optional: integer # of upgrades)deck r [id]
remove card from deckdraw [num]
draw cardsenergy add [amount]
gain energyenergy inf
toggles infinite energyenergy r [amount]
lose energygold add [amount]
gain goldgold r [amount]
lose goldhand add [id] {upgrades}
add card to hand with (optional: integer # of upgrades)hand r all
exhaust entire handhand r [id]
exhaust card from handinfo
toggle Settings.isInfokill all
kills all enemies in the current combatrelic add [id]
generate relicrelic list
logs all relic poolsrelic r [id]
lose relic
BaseMod.subscribeTo...(this)
BaseMod.unsubscribeFrom...(this)
Implement the appropriate interface (ex. basemod.interfaces.PostInitializeSubscriber
)
void receivePostDraw(AbstractCard)
- After a card is drawnvoid receivePostEnergyRecharge()
- At the start of every player turn, after energy has rechargedvoid receivePostInitialize()
- One time only, at the end ofCardCrawlGame.initialize()
boolean receivePreMonsterTurn(AbstractMonster)
- Before each monster takes its turn. Returning false will skip the monsters turn.void receiveRender(SpriteBatch)
- Under tips and the cursor, above everything elsevoid receivePostRender(SpriteBatch)
- Above everythingvoid receivePreStartGame()
- When starting a new game, before generating the dungeonvoid receivePreUpdate()
- Immediately after input is handledvoid receivePostUpdate()
- Immediately before input is disposed
32x32 images that display under the title on the main menu. Clicking one opens that mods settings menu.
BaseMod.registerModBadge(Texture texture, String modName, String author, String description, ModPanel settingsPanel)
ModPanel.addButton(float x, float y, Consumer<ModButton> clickEvent)
ModPanel.addLabel(String text, float x, float y, Consumer<ModLabel> updateEvent)
Example of setting up a basic mod badge with settings panel:
ModPanel settingsPanel = new ModPanel();
settingsPanel.addLabel("", 475.0f, 700.0f, (me) -> {
if (me.parent.waitingOnEvent) {
me.text = "Press key";
} else {
me.text = "Change console hotkey (" + Keys.toString(DevConsole.toggleKey) + ")";
}
});
settingsPanel.addButton(350.0f, 650.0f, (me) -> {
me.parent.waitingOnEvent = true;
oldInputProcessor = Gdx.input.getInputProcessor();
Gdx.input.setInputProcessor(new InputAdapter() {
@Override
public boolean keyUp(int keycode) {
DevConsole.toggleKey = keycode;
me.parent.waitingOnEvent = false;
Gdx.input.setInputProcessor(oldInputProcessor);
return true;
}
});
});
Texture badgeTexture = new Texture(Gdx.files.internal("img/BaseModBadge.png"));
registerModBadge(badgeTexture, MODNAME, AUTHOR, DESCRIPTION, settingsPanel);
CustomRelic(String id, Texture texture, AbstractRelic.RelicTier tier, AbstractRelic.LandingSound sfx)
BaseMod.loadCustomRelicStrings(String json)
- Initial release
- Scale console by Settings.scale
- Prevent game hotkeys from activating while console is visible
- Add mod badges
- Add initial support for mod settings screens
- Add
relic
console command - Add option to change console keybind on BaseMod settings screen
- Scale mod badges by Settings.scale
- Scale mod settings screens by Settings.scale
- Fix bug with IDs which contain spaces (FlipskiZ)
- Add
card
console command (FlipskiZ) - Add
kill all
console command
- Initial support for each mod badge being tied to its own settings panel
- Add
gold
command - Add
energy
command - Remove bundled font and use one from the base game instead
- Add
energy inf
command - Add
PostEnergyRechargeSubscriber
interface and related code
- Add
PostDrawSubscriber
interface and related code - Add
CustomRelic
extension of AbstractRelic - Add support for loading custom RelicStrings
- Fix a bug that prevented the character
D
from being input into the console - Rename
card
command tohand
- Add
hand r all
command - Add
deck
command - Add
draw
command - Add
float BaseMod.pathDensityMultiplier
property which can be used to modify map generation
- Add
PreStartGameSubscriber
interface and related code
- Add
AbstractDungeon
cleanup to diff, nothing changed yet. - Add
relic list
command - Fix crash when attempting to
deck add
an invalid card id - Add upgrade support to
deck add
andhand add
- Add
PreMonsterTurnSubscriber
interface and related code
- Add
PostCampfireSubscriber
interface and related code - Add proper support for
IntangiblePower
to be applied to players
- t-larson - Original author
- FlipskiZ -
hand
command, bug fixes