v1.1.0: exotic potions and scrolls now require energy to create
This commit is contained in:
parent
97fd800b92
commit
a4db11c8eb
|
@ -171,6 +171,8 @@ public abstract class Recipe {
|
||||||
|
|
||||||
private static Recipe[] oneIngredientRecipes = new Recipe[]{
|
private static Recipe[] oneIngredientRecipes = new Recipe[]{
|
||||||
new AlchemistsToolkit.upgradeKit(),
|
new AlchemistsToolkit.upgradeKit(),
|
||||||
|
new ExoticPotion.PotionToExotic(),
|
||||||
|
new ExoticScroll.ScrollToExotic(),
|
||||||
new Scroll.ScrollToStone(),
|
new Scroll.ScrollToStone(),
|
||||||
new ArcaneResin.Recipe(),
|
new ArcaneResin.Recipe(),
|
||||||
new StewedMeat.oneMeat()
|
new StewedMeat.oneMeat()
|
||||||
|
@ -208,8 +210,8 @@ public abstract class Recipe {
|
||||||
|
|
||||||
private static Recipe[] threeIngredientRecipes = new Recipe[]{
|
private static Recipe[] threeIngredientRecipes = new Recipe[]{
|
||||||
new Potion.SeedToPotion(),
|
new Potion.SeedToPotion(),
|
||||||
new ExoticPotion.PotionToExotic(),
|
//new ExoticPotion.PotionToExotic(),
|
||||||
new ExoticScroll.ScrollToExotic(),
|
//new ExoticScroll.ScrollToExotic(),
|
||||||
new StewedMeat.threeMeat(),
|
new StewedMeat.threeMeat(),
|
||||||
new MeatPie.Recipe()
|
new MeatPie.Recipe()
|
||||||
};
|
};
|
||||||
|
|
|
@ -128,50 +128,33 @@ public class ExoticPotion extends Potion {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class PotionToExotic extends Recipe{
|
public static class PotionToExotic extends Recipe{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean testIngredients(ArrayList<Item> ingredients) {
|
public boolean testIngredients(ArrayList<Item> ingredients) {
|
||||||
int s = 0;
|
if (ingredients.size() == 1 && regToExo.containsKey(ingredients.get(0).getClass())){
|
||||||
Potion p = null;
|
return true;
|
||||||
|
|
||||||
for (Item i : ingredients){
|
|
||||||
if (i instanceof Plant.Seed){
|
|
||||||
s++;
|
|
||||||
} else if (regToExo.containsKey(i.getClass())) {
|
|
||||||
p = (Potion)i;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return p != null && s == 2;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int cost(ArrayList<Item> ingredients) {
|
public int cost(ArrayList<Item> ingredients) {
|
||||||
return 0;
|
return 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Item brew(ArrayList<Item> ingredients) {
|
public Item brew(ArrayList<Item> ingredients) {
|
||||||
Item result = null;
|
|
||||||
|
|
||||||
for (Item i : ingredients){
|
for (Item i : ingredients){
|
||||||
i.quantity(i.quantity()-1);
|
i.quantity(i.quantity()-1);
|
||||||
if (regToExo.containsKey(i.getClass())) {
|
|
||||||
result = Reflection.newInstance(regToExo.get(i.getClass()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return result;
|
|
||||||
|
return Reflection.newInstance(regToExo.get(ingredients.get(0).getClass()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Item sampleOutput(ArrayList<Item> ingredients) {
|
public Item sampleOutput(ArrayList<Item> ingredients) {
|
||||||
for (Item i : ingredients){
|
return Reflection.newInstance(regToExo.get(ingredients.get(0).getClass()));
|
||||||
if (regToExo.containsKey(i.getClass())) {
|
|
||||||
return Reflection.newInstance(regToExo.get(i.getClass()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -123,47 +123,30 @@ public abstract class ExoticScroll extends Scroll {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean testIngredients(ArrayList<Item> ingredients) {
|
public boolean testIngredients(ArrayList<Item> ingredients) {
|
||||||
int r = 0;
|
if (ingredients.size() == 1 && regToExo.containsKey(ingredients.get(0).getClass())){
|
||||||
Scroll s = null;
|
return true;
|
||||||
|
|
||||||
for (Item i : ingredients){
|
|
||||||
if (i instanceof Runestone){
|
|
||||||
r++;
|
|
||||||
} else if (regToExo.containsKey(i.getClass())) {
|
|
||||||
s = (Scroll)i;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return s != null && r == 2;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int cost(ArrayList<Item> ingredients) {
|
public int cost(ArrayList<Item> ingredients) {
|
||||||
return 0;
|
return 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Item brew(ArrayList<Item> ingredients) {
|
public Item brew(ArrayList<Item> ingredients) {
|
||||||
Item result = null;
|
|
||||||
|
|
||||||
for (Item i : ingredients){
|
for (Item i : ingredients){
|
||||||
i.quantity(i.quantity()-1);
|
i.quantity(i.quantity()-1);
|
||||||
if (regToExo.containsKey(i.getClass())) {
|
|
||||||
result = Reflection.newInstance(regToExo.get(i.getClass()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return result;
|
|
||||||
|
return Reflection.newInstance(regToExo.get(ingredients.get(0).getClass()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Item sampleOutput(ArrayList<Item> ingredients) {
|
public Item sampleOutput(ArrayList<Item> ingredients) {
|
||||||
for (Item i : ingredients){
|
return Reflection.newInstance(regToExo.get(ingredients.get(0).getClass()));
|
||||||
if (regToExo.containsKey(i.getClass())) {
|
|
||||||
return Reflection.newInstance(regToExo.get(i.getClass()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -563,6 +563,8 @@ public class AlchemyScene extends PixelScene {
|
||||||
bubbleEmitter.start(Speck.factory( Speck.BUBBLE ), 0.01f, 100 );
|
bubbleEmitter.start(Speck.factory( Speck.BUBBLE ), 0.01f, 100 );
|
||||||
sparkEmitter.burst(SparkParticle.FACTORY, 20);
|
sparkEmitter.burst(SparkParticle.FACTORY, 20);
|
||||||
Sample.INSTANCE.play( Assets.Sounds.LIGHTNING );
|
Sample.INSTANCE.play( Assets.Sounds.LIGHTNING );
|
||||||
|
|
||||||
|
updateState();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class ItemButton extends Component {
|
public static class ItemButton extends Component {
|
||||||
|
|
|
@ -332,7 +332,7 @@ public class QuickRecipe extends Component {
|
||||||
r = new ExoticPotion.PotionToExotic();
|
r = new ExoticPotion.PotionToExotic();
|
||||||
for (Class<?> cls : Generator.Category.POTION.classes){
|
for (Class<?> cls : Generator.Category.POTION.classes){
|
||||||
Potion pot = (Potion) Reflection.newInstance(cls);
|
Potion pot = (Potion) Reflection.newInstance(cls);
|
||||||
ArrayList<Item> in = new ArrayList<>(Arrays.asList(pot, new Plant.Seed.PlaceHolder().quantity(2)));
|
ArrayList<Item> in = new ArrayList<>(Arrays.asList(pot));
|
||||||
result.add(new QuickRecipe( r, in, r.sampleOutput(in)));
|
result.add(new QuickRecipe( r, in, r.sampleOutput(in)));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
@ -340,7 +340,7 @@ public class QuickRecipe extends Component {
|
||||||
r = new ExoticScroll.ScrollToExotic();
|
r = new ExoticScroll.ScrollToExotic();
|
||||||
for (Class<?> cls : Generator.Category.SCROLL.classes){
|
for (Class<?> cls : Generator.Category.SCROLL.classes){
|
||||||
Scroll scroll = (Scroll) Reflection.newInstance(cls);
|
Scroll scroll = (Scroll) Reflection.newInstance(cls);
|
||||||
ArrayList<Item> in = new ArrayList<>(Arrays.asList(scroll, new Runestone.PlaceHolder().quantity(2)));
|
ArrayList<Item> in = new ArrayList<>(Arrays.asList(scroll));
|
||||||
result.add(new QuickRecipe( r, in, r.sampleOutput(in)));
|
result.add(new QuickRecipe( r, in, r.sampleOutput(in)));
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user