Skip to content

Commit

Permalink
Update to ModTheSpire/BaseMod v3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
twanvl committed Sep 1, 2018
1 parent 179a5eb commit 619b092
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 13 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>StSExporter</groupId>
<artifactId>StSExporter</artifactId>
<version>0.2.0</version>
<version>0.2.1</version>

<name>Exporter</name>
<description>A simple mod for Slay the Spire that can export card images and other data.</description>
Expand Down
8 changes: 6 additions & 2 deletions src/main/java/sts_exporter/CardExportData.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,21 @@ public class CardExportData {
public int block, damage, magicNumber;

public CardExportData(AbstractCard card, String imageDir) {
this(card, imageDir, true);
}

public CardExportData(AbstractCard card, String imageDir, boolean exportUpgrade) {
card.initializeDescription();
this.card = card;
this.name = card.name;
this.rarity = Exporter.rarityName(card.rarity);
this.color = Exporter.colorName(card.color);
this.type = Exporter.typeString(card.type);
if (!card.upgraded && card.canUpgrade()) {
if (exportUpgrade && !card.upgraded && card.canUpgrade()) {
AbstractCard copy = card.makeCopy();
copy.upgrade();
copy.displayUpgrades();
this.upgrade = new CardExportData(copy, imageDir);
this.upgrade = new CardExportData(copy, imageDir, false);
}
// cost
if (card.cost == -1) {
Expand Down
6 changes: 1 addition & 5 deletions src/main/java/sts_exporter/CreatureExportData.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,7 @@ public static ArrayList<AbstractCreature> getAllCreatures() {
}

// Now get all monsters
// There is unfortunately no list of all monsters in the game. The best we can do use use MonsterHelper.getMonster
for (String name : getAllMonsterNames()) {
creatures.add(MonsterHelper.getMonster(name));
}
// or MonsterHelper.getEncounter
// There is unfortunately no list of all monsters in the game. The best we can do is to use MonsterHelper.getEncounter
HashSet<String> seenMonsters = new HashSet<>();
for (String encounter : getAllEncounterNames()) {
Exporter.logger.info("Getting monsters for encounter " + encounter);
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/sts_exporter/Exporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@ public class Exporter implements PostInitializeSubscriber {
private static final String[] indexTemplates = {"index.html","creatures.html"};

public Exporter() {
BaseMod.subscribeToPostInitialize(this);
BaseMod.subscribe(this);
}

public static void initialize() {
new Exporter();
}

@Override
public void receivePostInitialize() {
// set scale to 1.0
//float oldscale = Settings.scale;
Expand Down
4 changes: 0 additions & 4 deletions src/main/resources/ModTheSpire.config

This file was deleted.

11 changes: 11 additions & 0 deletions src/main/resources/ModTheSpire.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"modid": "StSExporter",
"name": "Card Exporter",
"author_list": ["twanvl"],
"description": "A simple mod that can export card images and other data.",
"version": "0.2.1",
"sts_version": "08-23-2018",
"mts_version": "3.0.0",
"dependencies": ["basemod"],
"update_json": "https://api.github.com/repos/twanvl/sts-exporter/releases/latest"
}

0 comments on commit 619b092

Please sign in to comment.