Skip to content

Commit 4d55143

Browse files
committed
Okay, housekeeping. Stuff should work
1 parent 3aee3fe commit 4d55143

7 files changed

Lines changed: 35 additions & 45 deletions

File tree

src/main/java/sneckomod/SneckoMod.java

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ public class SneckoMod implements
4040
EditRelicsSubscriber,
4141
EditStringsSubscriber,
4242
EditKeywordsSubscriber,
43-
EditCharactersSubscriber,
44-
PostDungeonInitializeSubscriber {
43+
EditCharactersSubscriber {
4544
public static final String SHOULDER1 = "sneckomodResources/images/char/shoulder.png";
4645
public static final String SHOULDER2 = "sneckomodResources/images/char/shoulder2.png";
4746
public static final String CORPSE = "sneckomodResources/images/char/corpse.png";
@@ -129,6 +128,13 @@ public void receiveEditCards() {
129128
} catch (URISyntaxException | IllegalAccessException | InstantiationException | NotFoundException | ClassNotFoundException e) {
130129
throw new RuntimeException(e);
131130
}
131+
for (AbstractCard.CardColor p : AbstractCard.CardColor.values()) {
132+
if (p != AbstractCard.CardColor.COLORLESS && p != AbstractCard.CardColor.CURSE && p != TheSnecko.Enums.SNECKO_CYAN) {
133+
AbstractCard q = new UnknownClass(p);
134+
BaseMod.addCard(q);
135+
UnlockTracker.markCardAsSeen(q.cardID);
136+
}
137+
}
132138
}
133139

134140
private static void autoAddCards()
@@ -201,16 +207,6 @@ public void receiveEditKeywords() {
201207
}
202208
}
203209

204-
@Override
205-
public void receivePostDungeonInitialize() {
206-
if (AbstractDungeon.player instanceof TheSnecko && !CardCrawlGame.loadingSave)
207-
for (int i = 0; i < 8; i++) {
208-
AbstractCard q = new UnknownClass(UnknownClass.getRandomCardColor());
209-
AbstractDungeon.uncommonCardPool.addToTop(q);
210-
AbstractDungeon.srcUncommonCardPool.addToTop(q);
211-
}
212-
}
213-
214210
public static AbstractCard getOffClassCard() {
215211
ArrayList<AbstractCard> possList = new ArrayList<>(CardLibrary.getAllCards());
216212
possList.removeIf(c -> (c.color == TheSnecko.Enums.SNECKO_CYAN || c.hasTag(AbstractCard.CardTags.HEALING)));

src/main/java/sneckomod/actions/MuddleHandAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
public class MuddleHandAction extends AbstractGameAction {
1111
private AbstractPlayer p;
1212

13-
public MuddleHandAction() {
13+
public MuddleHandAction() {
1414
this.actionType = ActionType.CARD_MANIPULATION;// 14
1515
this.p = AbstractDungeon.player;// 15
1616
this.duration = Settings.ACTION_DUR_FAST;// 16

src/main/java/sneckomod/actions/MuddleRandomCardAction.java

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,19 @@ public void update() {
2020
ArrayList<AbstractCard> myList = new ArrayList<>(AbstractDungeon.player.hand.group);
2121
Collections.shuffle(myList, AbstractDungeon.cardRandomRng.random);
2222
for (int i = 0; i < bruh; i++) {
23-
AbstractCard card = myList.remove(0);
24-
card.superFlash();
25-
if (card.cost >= 0 && !card.hasTag(SneckoMod.SNEKPROOF)) {// 32
26-
int newCost = AbstractDungeon.cardRandomRng.random(3);// 33
27-
if (card.cost != newCost) {// 34
28-
card.cost = newCost;// 35
29-
card.costForTurn = card.cost;// 36
30-
card.isCostModified = true;// 37
31-
}
23+
if (!myList.isEmpty()) {
24+
AbstractCard card = myList.remove(0);
25+
card.superFlash();
26+
if (card.cost >= 0 && !card.hasTag(SneckoMod.SNEKPROOF)) {// 32
27+
int newCost = AbstractDungeon.cardRandomRng.random(3);// 33
28+
if (card.cost != newCost) {// 34
29+
card.cost = newCost;// 35
30+
card.costForTurn = card.cost;// 36
31+
card.isCostModified = true;// 37
32+
}
3233

33-
card.freeToPlayOnce = false;// 39
34+
card.freeToPlayOnce = false;// 39
35+
}
3436
}
3537
}
3638
}

src/main/java/sneckomod/cards/SlitherStrike.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public void use(AbstractPlayer p, AbstractMonster m) {
2626
atb(new AbstractGameAction() {
2727
@Override
2828
public void update() {
29+
isDone = true;
2930
for (AbstractCard q : p.hand.group) {
3031
if (q.color != TheSnecko.Enums.SNECKO_CYAN) {
3132
q.modifyCostForCombat(-1);

src/main/java/sneckomod/cards/unknowns/AbstractUnknownCard.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,9 @@ public void replaceUnknown(Predicate<AbstractCard> funkyPredicate) {
8383
}
8484

8585
if (this.upgraded) cUnknown.upgrade();
86-
cUnknown.name = this.getClass().getSimpleName().replaceAll("([^_])([A-Z])", "$1 $2");
8786
if (cUnknown != null) {
8887
p.drawPile.removeCard(this);
88+
cUnknown.cardsToPreview = this;
8989
AbstractDungeon.player.drawPile.addToRandomSpot(cUnknown);
9090
}
9191
}

src/main/java/sneckomod/cards/unknowns/UnknownClass.java

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11

22
package sneckomod.cards.unknowns;
33

4-
import basemod.BaseMod;
54
import com.megacrit.cardcrawl.cards.AbstractCard;
65
import com.megacrit.cardcrawl.characters.AbstractPlayer;
76
import com.megacrit.cardcrawl.core.CardCrawlGame;
87
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
8+
import com.megacrit.cardcrawl.helpers.CardLibrary;
9+
import com.megacrit.cardcrawl.screens.compendium.CardLibraryScreen;
910
import sneckomod.CardIgnore;
10-
import sneckomod.TheSnecko;
1111

1212
import java.util.ArrayList;
1313
import java.util.function.Predicate;
@@ -17,8 +17,12 @@ public class UnknownClass extends AbstractUnknownCard {
1717
public final static String ID = makeID("UnknownClass");
1818

1919
public UnknownClass(CardColor cardColor) {
20-
super(ID, determineCardImg(cardColor), CardType.SKILL, CardRarity.UNCOMMON);
20+
super(ID + cardColor.name(), determineCardImg(cardColor), CardType.SKILL, CardRarity.UNCOMMON);
2121
myColor = cardColor;
22+
name = "???";
23+
originalName = "???";
24+
if (CardCrawlGame.isInARun())
25+
rawDescription = "sneckomod:Unknown " + getCharName(myColor) + " Card.";
2226
}
2327

2428
public static String determineCardImg(CardColor myColor) {
@@ -42,7 +46,7 @@ public static String determineCardImg(CardColor myColor) {
4246
}
4347
}
4448

45-
public String getCharName(CardColor myColor) {
49+
public static String getCharName(CardColor myColor) {
4650
ArrayList<AbstractPlayer> theDudes = new ArrayList<AbstractPlayer>(CardCrawlGame.characterManager.getAllCharacters());
4751
for (AbstractPlayer p : theDudes) {
4852
if (p.getCardColor() == myColor)
@@ -59,23 +63,6 @@ public AbstractCard makeCopy() {
5963
return new UnknownClass(myColor);
6064
}
6165

62-
@Override
63-
public void update() {
64-
super.update();
65-
if (!this.rawDescription.equals("sneckomod:Unknown " + getCharName(myColor) + ".")) {
66-
if (upgraded) rawDescription = "sneckomod:Unknown Upgraded " + getCharName(myColor) + " Card.";
67-
else
68-
this.rawDescription = "sneckomod:Unknown " + getCharName(myColor) + " Card.";
69-
initializeDescription();
70-
}
71-
}
72-
73-
public static CardColor getRandomCardColor() {
74-
ArrayList<CardColor> myList = new ArrayList<>(BaseMod.getCardColors());
75-
myList.removeIf(c -> c == TheSnecko.Enums.SNECKO_CYAN);
76-
return myList.get(AbstractDungeon.cardRandomRng.random(myList.size() - 1));
77-
}
78-
7966
@Override
8067
public Predicate<AbstractCard> myNeeds() {
8168
return c -> c.color == myColor;

src/main/resources/sneckomodResources/localization/eng/Cardstrings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,5 +240,9 @@
240240
"sneckomod:UnknownVulnerable": {
241241
"NAME": "???",
242242
"DESCRIPTION": "sneckomod:Unknown Vulnerable Card."
243+
},
244+
"sneckomod:UnknownColorless": {
245+
"NAME": "???",
246+
"DESCRIPTION": "sneckomod:Unknown Colorless Card."
243247
}
244248
}

0 commit comments

Comments
 (0)