aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornea <nea@nea.moe>2023-05-29 23:13:39 +0200
committernea <nea@nea.moe>2023-05-29 23:13:39 +0200
commit47b0e8114072cb85f5ff8857b561588d54906b30 (patch)
tree70718b28b39a790a6b08426668bd5ca3c1a06470
parent9bef42c18c0ba48ccd4e8aeffd79f8728db8dc25 (diff)
downloadneurepoparsing-47b0e8114072cb85f5ff8857b561588d54906b30.tar.gz
neurepoparsing-47b0e8114072cb85f5ff8857b561588d54906b30.tar.bz2
neurepoparsing-47b0e8114072cb85f5ff8857b561588d54906b30.zip
Add support for kat upgrade recipes
-rw-r--r--src/main/java/io/github/moulberry/repo/NEURepository.java1
-rw-r--r--src/main/java/io/github/moulberry/repo/data/NEUIngredient.java8
-rw-r--r--src/main/java/io/github/moulberry/repo/data/NEUKatUpgradeRecipe.java50
3 files changed, 59 insertions, 0 deletions
diff --git a/src/main/java/io/github/moulberry/repo/NEURepository.java b/src/main/java/io/github/moulberry/repo/NEURepository.java
index 41bfc12..38f8501 100644
--- a/src/main/java/io/github/moulberry/repo/NEURepository.java
+++ b/src/main/java/io/github/moulberry/repo/NEURepository.java
@@ -40,6 +40,7 @@ public final class NEURepository {
.registerSubtype(NEUCraftingRecipe.class, "crafting")
.registerSubtype(NEUMobDropRecipe.class, "drops")
.registerSubtype(NEUNpcShopRecipe.class, "npc_shop")
+ .registerSubtype(NEUKatUpgradeRecipe.class, "katgrade")
.setFallbackType(NEUUnknownRecipe.class)
.setDefaultTypeTag("crafting")
)
diff --git a/src/main/java/io/github/moulberry/repo/data/NEUIngredient.java b/src/main/java/io/github/moulberry/repo/data/NEUIngredient.java
index 0442cd1..c0c0627 100644
--- a/src/main/java/io/github/moulberry/repo/data/NEUIngredient.java
+++ b/src/main/java/io/github/moulberry/repo/data/NEUIngredient.java
@@ -11,6 +11,7 @@ public class NEUIngredient {
@NEUId String itemId;
double amount;
public static final String NEU_SENTINEL_EMPTY = "NEU_SENTINEL_EMPTY";
+ public static final String NEU_SENTINEL_COINS = "SKYBLOCK_COIN";
public static final NEUIngredient SENTINEL_EMPTY = new NEUIngredient();
static {
@@ -21,6 +22,13 @@ public class NEUIngredient {
private NEUIngredient() {
}
+ public static NEUIngredient ofCoins(double coins) {
+ NEUIngredient neuIngredient = new NEUIngredient();
+ neuIngredient.amount = coins;
+ neuIngredient.itemId = NEU_SENTINEL_COINS;
+ return neuIngredient;
+ }
+
public static NEUIngredient fromItem(NEUItem item, int count) {
NEUIngredient ingredient = new NEUIngredient();
ingredient.amount = count;
diff --git a/src/main/java/io/github/moulberry/repo/data/NEUKatUpgradeRecipe.java b/src/main/java/io/github/moulberry/repo/data/NEUKatUpgradeRecipe.java
new file mode 100644
index 0000000..839f693
--- /dev/null
+++ b/src/main/java/io/github/moulberry/repo/data/NEUKatUpgradeRecipe.java
@@ -0,0 +1,50 @@
+package io.github.moulberry.repo.data;
+
+import lombok.Getter;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+
+public class NEUKatUpgradeRecipe implements NEURecipe {
+ /**
+ * Base pet.
+ */
+ @Getter
+ NEUIngredient input;
+ /**
+ * Upgraded pet.
+ */
+ @Getter
+ NEUIngredient output;
+ /**
+ * List of bonus items you need to upgrade, not including the pet itself.
+ */
+ @Getter
+ List<NEUIngredient> items;
+ /**
+ * Coin cost for a level "0" pet. This cost is reduced for each level, so even a level 1 pet costs less to upgrade than this.
+ */
+ @Getter
+ double coins;
+ /**
+ * Time for the pet upgrade in seconds.
+ */
+ @Getter
+ long seconds;
+
+ @Override
+ public Collection<NEUIngredient> getAllInputs() {
+ List<NEUIngredient> inputs = new ArrayList<>();
+ inputs.add(input);
+ inputs.addAll(items);
+ inputs.add(NEUIngredient.ofCoins(coins));
+ return inputs;
+ }
+
+ @Override
+ public Collection<NEUIngredient> getAllOutputs() {
+ return Collections.singleton(output);
+ }
+}