v0.7.2: identified items are now only required for specific recipes
This commit is contained in:
parent
1613c8adc4
commit
a9fa21dd4e
|
@ -105,6 +105,7 @@ public abstract class Recipe {
|
|||
|
||||
//TODO is this right?
|
||||
for (Item ingredient : ingredients){
|
||||
if (!ingredient.isIdentified()) return false;
|
||||
for (int i = 0; i < inputs.length; i++){
|
||||
if (ingredient.getClass() == inputs[i]){
|
||||
needed[i] -= ingredient.quantity();
|
||||
|
@ -239,8 +240,7 @@ public abstract class Recipe {
|
|||
}
|
||||
|
||||
public static boolean usableInRecipe(Item item){
|
||||
return item.isIdentified()
|
||||
&& !item.cursed
|
||||
return !item.cursed
|
||||
&& (!(item instanceof EquipableItem) || item instanceof Dart || item instanceof AlchemistsToolkit)
|
||||
&& !(item instanceof Wand);
|
||||
}
|
||||
|
|
|
@ -348,6 +348,7 @@ public class Bomb extends Item {
|
|||
boolean ingredient = false;
|
||||
|
||||
for (Item i : ingredients){
|
||||
if (!i.isIdentified()) return false;
|
||||
if (i.getClass().equals(Bomb.class)){
|
||||
bomb = true;
|
||||
} else if (validIngredients.containsKey(i.getClass())){
|
||||
|
|
|
@ -333,6 +333,7 @@ public abstract class Scroll extends Item {
|
|||
@Override
|
||||
public boolean testIngredients(ArrayList<Item> ingredients) {
|
||||
if (ingredients.size() != 1
|
||||
|| !ingredients.get(0).isIdentified()
|
||||
|| !(ingredients.get(0) instanceof Scroll)
|
||||
|| !stones.containsKey(ingredients.get(0).getClass())){
|
||||
return false;
|
||||
|
|
|
@ -108,7 +108,8 @@ public class QuickRecipe extends Component {
|
|||
ArrayList<Item> similar = Dungeon.hero.belongings.getAllSimilar(in);
|
||||
int quantity = 0;
|
||||
for (Item sim : similar) {
|
||||
if (sim.isIdentified()) quantity += sim.quantity();
|
||||
//if we are looking for a specific item, it must be IDed
|
||||
if (sim.getClass() != in.getClass() || sim.isIdentified()) quantity += sim.quantity();
|
||||
}
|
||||
|
||||
if (quantity < in.quantity()) {
|
||||
|
@ -255,6 +256,7 @@ public class QuickRecipe extends Component {
|
|||
for (Class<?> cls : Generator.Category.SCROLL.classes){
|
||||
try{
|
||||
Scroll scroll = (Scroll) cls.newInstance();
|
||||
if (!scroll.isKnown()) scroll.anonymize();
|
||||
ArrayList<Item> in = new ArrayList<Item>(Arrays.asList(scroll));
|
||||
result.add(new QuickRecipe( r, in, r.sampleOutput(in)));
|
||||
} catch (Exception e){
|
||||
|
|
Loading…
Reference in New Issue
Block a user