diff --git a/src/main/java/WayofTime/bloodmagic/meteor/Meteor.java b/src/main/java/WayofTime/bloodmagic/meteor/Meteor.java index f547c205..55f5728f 100644 --- a/src/main/java/WayofTime/bloodmagic/meteor/Meteor.java +++ b/src/main/java/WayofTime/bloodmagic/meteor/Meteor.java @@ -18,6 +18,7 @@ public class Meteor { private final int radius; private final int maxWeight; public int version; + public int cost = 1000000; public Meteor(ItemStack catalystStack, List components, float explosionStrength, int radius) { this.catalystStack = catalystStack; @@ -103,4 +104,12 @@ public class Meteor { public void setVersion(int version) { this.version = version; } + + public void setCost(int performCost) { + this.cost = performCost; + } + + public int getCost() { + return cost; + } } \ No newline at end of file diff --git a/src/main/java/WayofTime/bloodmagic/meteor/MeteorConfigHandler.java b/src/main/java/WayofTime/bloodmagic/meteor/MeteorConfigHandler.java index c6e1b65c..e72de2e3 100644 --- a/src/main/java/WayofTime/bloodmagic/meteor/MeteorConfigHandler.java +++ b/src/main/java/WayofTime/bloodmagic/meteor/MeteorConfigHandler.java @@ -109,7 +109,8 @@ public class MeteorConfigHandler { ironMeteorList.add(new MeteorComponent(60, "oreLapis")); ironMeteorList.add(new MeteorComponent(100, "oreRedstone")); Meteor ironMeteor = new Meteor(new ItemStack(Blocks.IRON_BLOCK), ironMeteorList, 15, 5); - ironMeteor.setVersion(2); + ironMeteor.setVersion(3); + ironMeteor.setCost(1000000); // Gold List goldMeteorList = Lists.newArrayList(); @@ -122,7 +123,8 @@ public class MeteorConfigHandler { goldMeteorList.add(new MeteorComponent(20, "oreEmerald")); goldMeteorList.add(new MeteorComponent(20, "oreCoal")); Meteor goldMeteor = new Meteor(new ItemStack(Blocks.GOLD_BLOCK), goldMeteorList, 18, 6); - goldMeteor.setVersion(3); + goldMeteor.setVersion(4); + goldMeteor.setCost(2500000); // Diamond List diamondMeteorList = Lists.newArrayList(); @@ -134,7 +136,8 @@ public class MeteorConfigHandler { diamondMeteorList.add(new MeteorComponent(50, "oreRedstone")); diamondMeteorList.add(new MeteorComponent(400, "oreDiamond")); Meteor diamondMeteor = new Meteor(new ItemStack(Blocks.DIAMOND_BLOCK), diamondMeteorList, 10, 3); - diamondMeteor.setVersion(3); + diamondMeteor.setVersion(4); + diamondMeteor.setCost(5000000); holders.add(Pair.of("iron", ironMeteor)); DEFAULT_METEORS.put("iron", ironMeteor); diff --git a/src/main/java/WayofTime/bloodmagic/ritual/types/RitualMeteor.java b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualMeteor.java index b9dbc916..1a5258d8 100644 --- a/src/main/java/WayofTime/bloodmagic/ritual/types/RitualMeteor.java +++ b/src/main/java/WayofTime/bloodmagic/ritual/types/RitualMeteor.java @@ -1,12 +1,13 @@ package WayofTime.bloodmagic.ritual.types; import WayofTime.bloodmagic.BloodMagic; -import WayofTime.bloodmagic.ritual.*; -import WayofTime.bloodmagic.soul.EnumDemonWillType; +import WayofTime.bloodmagic.core.data.SoulNetwork; import WayofTime.bloodmagic.demonAura.WorldDemonWillHandler; import WayofTime.bloodmagic.entity.projectile.EntityMeteor; import WayofTime.bloodmagic.meteor.Meteor; import WayofTime.bloodmagic.meteor.MeteorRegistry; +import WayofTime.bloodmagic.ritual.*; +import WayofTime.bloodmagic.soul.EnumDemonWillType; import net.minecraft.entity.item.EntityItem; import net.minecraft.item.ItemStack; import net.minecraft.util.math.BlockPos; @@ -21,7 +22,7 @@ public class RitualMeteor extends Ritual { public static final double destructiveWillDrain = 50; public RitualMeteor() { - super("ritualMeteor", 0, 1000000, "ritual." + BloodMagic.MODID + ".meteorRitual"); + super("ritualMeteor", 0, 0, "ritual." + BloodMagic.MODID + ".meteorRitual"); addBlockRange(ITEM_RANGE, new AreaDescriptor.Rectangle(new BlockPos(0, 1, 0), 1)); setMaximumVolumeAndDistanceOfRange(ITEM_RANGE, 0, 10, 10); } @@ -53,15 +54,25 @@ public class RitualMeteor extends Ritual { for (EntityItem entityItem : itemList) { ItemStack stack = entityItem.getItem(); Meteor meteor = MeteorRegistry.getMeteorForItem(stack); - if (meteor != null) { - EntityMeteor entityMeteor = new EntityMeteor(world, pos.getX(), 260, pos.getZ(), 0, -0.1, 0, radiusModifier, explosionModifier, fillerChance); - entityMeteor.setMeteorStack(stack.copy()); - world.spawnEntity(entityMeteor); - entityItem.setDead(); + if (meteor != null) { + SoulNetwork network = masterRitualStone.getOwnerNetwork(); + int cost = meteor.getCost(); + if (currentEssence < cost) { + network.causeNausea(); + break; + } else { + network.syphon(masterRitualStone.ticket(cost)); + EntityMeteor entityMeteor = new EntityMeteor(world, pos.getX(), 260, pos.getZ(), 0, -0.1, 0, radiusModifier, explosionModifier, fillerChance); + entityMeteor.setMeteorStack(stack.copy()); + world.spawnEntity(entityMeteor); + + entityItem.setDead(); + + } if (destructiveWill >= destructiveWillDrain && currentEssence >= 1000000000) { - masterRitualStone.getOwnerNetwork().syphon(masterRitualStone.ticket(1000000)); + network.syphon(masterRitualStone.ticket(cost / 10)); } else { masterRitualStone.setActive(false); }