diff --git a/src/xyz/soper/arty/item/Mortar.java b/src/xyz/soper/arty/item/Mortar.java index db6e496..277f597 100644 --- a/src/xyz/soper/arty/item/Mortar.java +++ b/src/xyz/soper/arty/item/Mortar.java @@ -106,6 +106,8 @@ public class Mortar { public int getFailureType(Shell shell){ if(isFailure(shell)){ Random random = new Random(block.getWorld().getSeed() + System.currentTimeMillis()); + double maxDouble; + double randDouble = random.nextDouble(); //TODO: compare random double and create an algo to determine type of failure. } @@ -119,7 +121,17 @@ public class Mortar { */ private boolean isFailure(Shell shell){ Random random = new Random(block.getWorld().getSeed() + System.currentTimeMillis()); - return random.nextDouble() < failMultiplier*shell.failChance; + if(shell.incendiaryType && !incendiaryCapable) return random.nextDouble() < 3*failMultiplier*shell.failChance; + else return random.nextDouble() < failMultiplier*shell.failChance; + } + + /** + * + * @param shell Shell to test. + * @return True if the shell and mortar are compatible. + */ + public boolean incendiaryCompatible(Shell shell){ //TODO: check if this is right + return incendiaryCapable || !shell.incendiaryType; } public static boolean isMortar(Block block){