v2.0.2: very slightly adjusted alchemy prices to improve price rounding
This commit is contained in:
@@ -108,7 +108,7 @@ public class LiquidMetal extends Item {
|
||||
|
||||
@Override
|
||||
public int value() {
|
||||
return Math.max(1, quantity/2);
|
||||
return quantity;
|
||||
}
|
||||
|
||||
private final WndBag.ItemSelector itemSelector = new WndBag.ItemSelector() {
|
||||
|
||||
@@ -57,8 +57,8 @@ public class Alchemize extends Spell {
|
||||
|
||||
@Override
|
||||
public int value() {
|
||||
//prices of ingredients, divided by output quantity
|
||||
return Math.round(quantity * (40 / 8f));
|
||||
//prices of ingredients, divided by output quantity, rounds down
|
||||
return (int)(40 * (quantity/8f));
|
||||
}
|
||||
|
||||
//TODO also allow alchemical catalyst? Or save that for an elixir/brew?
|
||||
|
||||
@@ -49,8 +49,8 @@ public class AquaBlast extends TargetedSpell {
|
||||
|
||||
@Override
|
||||
public int value() {
|
||||
//prices of ingredients, divided by output quantity
|
||||
return Math.round(quantity * ((60 + 40) / 8f));
|
||||
//prices of ingredients, divided by output quantity, rounds down
|
||||
return (int)((60 + 40) * (quantity/8f));
|
||||
}
|
||||
|
||||
public static class Recipe extends com.shatteredpixel.shatteredpixeldungeon.items.Recipe.SimpleRecipe {
|
||||
|
||||
@@ -200,8 +200,8 @@ public class BeaconOfReturning extends Spell {
|
||||
|
||||
@Override
|
||||
public int value() {
|
||||
//prices of ingredients, divided by output quantity
|
||||
return Math.round(quantity * ((50 + 40) / 5f));
|
||||
//prices of ingredients, divided by output quantity, rounds down
|
||||
return (int)((50 + 40) * (quantity/5f));
|
||||
}
|
||||
|
||||
public static class Recipe extends com.shatteredpixel.shatteredpixeldungeon.items.Recipe.SimpleRecipe {
|
||||
|
||||
@@ -89,8 +89,8 @@ public class CurseInfusion extends InventorySpell {
|
||||
|
||||
@Override
|
||||
public int value() {
|
||||
//prices of ingredients, divided by output quantity
|
||||
return Math.round(quantity * ((30 + 50) / 3f));
|
||||
//prices of ingredients, divided by output quantity, rounds down
|
||||
return (int)((30 + 50) * (quantity/3f));
|
||||
}
|
||||
|
||||
public static class Recipe extends com.shatteredpixel.shatteredpixeldungeon.items.Recipe.SimpleRecipe {
|
||||
|
||||
@@ -80,8 +80,8 @@ public class FeatherFall extends Spell {
|
||||
|
||||
@Override
|
||||
public int value() {
|
||||
//prices of ingredients, divided by output quantity
|
||||
return Math.round(quantity * ((30 + 40) / 2f));
|
||||
//prices of ingredients, divided by output quantity, rounds down
|
||||
return (int)((30 + 40) * (quantity/2f));
|
||||
}
|
||||
|
||||
public static class Recipe extends com.shatteredpixel.shatteredpixeldungeon.items.Recipe.SimpleRecipe {
|
||||
|
||||
@@ -77,8 +77,8 @@ public class MagicalInfusion extends InventorySpell {
|
||||
|
||||
@Override
|
||||
public int value() {
|
||||
//prices of ingredients, divided by output quantity
|
||||
return Math.round(quantity * ((50 + 40) / 1f));
|
||||
//prices of ingredients
|
||||
return (50 + 40) * quantity;
|
||||
}
|
||||
|
||||
public static class Recipe extends com.shatteredpixel.shatteredpixeldungeon.items.Recipe.SimpleRecipe {
|
||||
|
||||
@@ -65,8 +65,8 @@ public class PhaseShift extends TargetedSpell {
|
||||
|
||||
@Override
|
||||
public int value() {
|
||||
//prices of ingredients, divided by output quantity
|
||||
return Math.round(quantity * ((30 + 40) / 8f));
|
||||
//prices of ingredients, divided by output quantity, rounds down
|
||||
return (int)((30 + 40) * (quantity/8f));
|
||||
}
|
||||
|
||||
public static class Recipe extends com.shatteredpixel.shatteredpixeldungeon.items.Recipe.SimpleRecipe {
|
||||
|
||||
@@ -116,8 +116,8 @@ public class ReclaimTrap extends TargetedSpell {
|
||||
|
||||
@Override
|
||||
public int value() {
|
||||
//prices of ingredients, divided by output quantity
|
||||
return Math.round(quantity * ((40 + 50) / 4f));
|
||||
//prices of ingredients, divided by output quantity, rounds down
|
||||
return (int)((40 + 50) * (quantity/4f));
|
||||
}
|
||||
|
||||
private static final String STORED_TRAP = "stored_trap";
|
||||
|
||||
@@ -93,8 +93,8 @@ public class Recycle extends InventorySpell {
|
||||
|
||||
@Override
|
||||
public int value() {
|
||||
//prices of ingredients, divided by output quantity
|
||||
return Math.round(quantity * ((50 + 40) / 12f));
|
||||
//prices of ingredients, divided by output quantity, rounds down
|
||||
return (int)((50 + 40) * (quantity/12f));
|
||||
}
|
||||
|
||||
public static class Recipe extends com.shatteredpixel.shatteredpixeldungeon.items.Recipe.SimpleRecipe {
|
||||
|
||||
@@ -116,8 +116,8 @@ public class TelekineticGrab extends TargetedSpell {
|
||||
|
||||
@Override
|
||||
public int value() {
|
||||
//prices of ingredients, divided by output quantity (rounded up slightly)
|
||||
return Math.round(quantity * ((5 + 40) / 6f));
|
||||
//prices of ingredients, divided by output quantity, rounds down
|
||||
return (int)((10 + 40) * (quantity/6f));
|
||||
}
|
||||
|
||||
public static class Recipe extends com.shatteredpixel.shatteredpixeldungeon.items.Recipe.SimpleRecipe {
|
||||
|
||||
@@ -70,8 +70,8 @@ public class WildEnergy extends TargetedSpell {
|
||||
|
||||
@Override
|
||||
public int value() {
|
||||
//prices of ingredients, divided by output quantity
|
||||
return Math.round(quantity * ((50 + 50) / 5f));
|
||||
//prices of ingredients, divided by output quantity, rounds down
|
||||
return (int)((50 + 50) * (quantity/5f));
|
||||
}
|
||||
|
||||
public static class Recipe extends com.shatteredpixel.shatteredpixeldungeon.items.Recipe.SimpleRecipe {
|
||||
|
||||
Reference in New Issue
Block a user