From ccb706f15c16ba2dc64d908c5646f8bfc3a40df3 Mon Sep 17 00:00:00 2001 From: WayofTime Date: Wed, 17 Feb 2016 16:31:11 -0500 Subject: [PATCH] - Removed the FOV effect from the Quick Feet speed upgrade. - Minor work on the Demon Crucible. --- changelog.txt | 2 + .../WayofTime/bloodmagic/api/Constants.java | 2 + .../api/soul/EnumDemonWillType.java | 13 + .../api/soul/IDemonWillConduit.java | 20 ++ .../bloodmagic/block/BlockDemonCrucible.java | 40 ++- .../client/render/RenderDemonCrucible.java | 59 ++++ .../upgrade/LivingArmourUpgradeSpeed.java | 7 +- .../potion/PotionEventHandlers.java | 31 +- .../bloodmagic/proxy/ClientProxy.java | 5 +- .../bloodmagic/registry/ModBlocks.java | 2 + .../bloodmagic/tile/TileDemonCrucible.java | 279 ++++++++++++++++++ .../bloodmagic/util/handler/EventHandler.java | 31 ++ .../assets/bloodmagic/lang/en_US.lang | 1 + 13 files changed, 469 insertions(+), 23 deletions(-) create mode 100644 src/main/java/WayofTime/bloodmagic/api/soul/EnumDemonWillType.java create mode 100644 src/main/java/WayofTime/bloodmagic/api/soul/IDemonWillConduit.java create mode 100644 src/main/java/WayofTime/bloodmagic/client/render/RenderDemonCrucible.java create mode 100644 src/main/java/WayofTime/bloodmagic/tile/TileDemonCrucible.java diff --git a/changelog.txt b/changelog.txt index 87af07fc..0378a529 100644 --- a/changelog.txt +++ b/changelog.txt @@ -11,6 +11,8 @@ Version 2.0.0-18 - Ammended range of Zephyr ritual - Fixed Green Grove ritual - Fixed Crusher ritual so it didn't break everything at once. +- Removed the FOV effect from the Quick Feet speed upgrade. +- Minor work on the Demon Crucible. ------------------------------------------------------ Version 2.0.0-17 diff --git a/src/main/java/WayofTime/bloodmagic/api/Constants.java b/src/main/java/WayofTime/bloodmagic/api/Constants.java index 415cce0c..a7ef8095 100644 --- a/src/main/java/WayofTime/bloodmagic/api/Constants.java +++ b/src/main/java/WayofTime/bloodmagic/api/Constants.java @@ -100,6 +100,8 @@ public class Constants public static final String GHOST_STACK_SIZE = "stackSize"; public static final String ITEM_INVENTORY = "itemInventory"; + + public static final String BLOCKPOS_CONNECTION = "connections"; } public static class Mod diff --git a/src/main/java/WayofTime/bloodmagic/api/soul/EnumDemonWillType.java b/src/main/java/WayofTime/bloodmagic/api/soul/EnumDemonWillType.java new file mode 100644 index 00000000..b502ef2d --- /dev/null +++ b/src/main/java/WayofTime/bloodmagic/api/soul/EnumDemonWillType.java @@ -0,0 +1,13 @@ +package WayofTime.bloodmagic.api.soul; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +@Getter +@RequiredArgsConstructor +public enum EnumDemonWillType +{ + DEFAULT("Default"); + + public final String name; +} diff --git a/src/main/java/WayofTime/bloodmagic/api/soul/IDemonWillConduit.java b/src/main/java/WayofTime/bloodmagic/api/soul/IDemonWillConduit.java new file mode 100644 index 00000000..d5523ac4 --- /dev/null +++ b/src/main/java/WayofTime/bloodmagic/api/soul/IDemonWillConduit.java @@ -0,0 +1,20 @@ +package WayofTime.bloodmagic.api.soul; + +/** + * Implement this interface on a block that can accept and store Demonic Will. + * + */ +public interface IDemonWillConduit +{ + public int getWeight(); + + public double fillDemonWill(EnumDemonWillType type, double amount, boolean doFill); + + public double drainDemonWill(EnumDemonWillType type, double amount, boolean doDrain); + + public boolean canFill(EnumDemonWillType type); + + public boolean canDrain(EnumDemonWillType type); + + public double getCurrentWill(EnumDemonWillType type); +} diff --git a/src/main/java/WayofTime/bloodmagic/block/BlockDemonCrucible.java b/src/main/java/WayofTime/bloodmagic/block/BlockDemonCrucible.java index 54b937f9..8d134a13 100644 --- a/src/main/java/WayofTime/bloodmagic/block/BlockDemonCrucible.java +++ b/src/main/java/WayofTime/bloodmagic/block/BlockDemonCrucible.java @@ -3,12 +3,18 @@ package WayofTime.bloodmagic.block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumFacing; import net.minecraft.world.World; import WayofTime.bloodmagic.BloodMagic; import WayofTime.bloodmagic.api.Constants; -import WayofTime.bloodmagic.tile.TileIncenseAltar; +import WayofTime.bloodmagic.api.soul.IDemonWill; +import WayofTime.bloodmagic.api.soul.IDemonWillGem; +import WayofTime.bloodmagic.tile.TileDemonCrucible; +import WayofTime.bloodmagic.util.Utils; public class BlockDemonCrucible extends BlockContainer { @@ -53,15 +59,39 @@ public class BlockDemonCrucible extends BlockContainer @Override public TileEntity createNewTileEntity(World world, int meta) { - return new TileIncenseAltar(); + return new TileDemonCrucible(); + } + + @Override + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ) + { + TileDemonCrucible crucible = (TileDemonCrucible) world.getTileEntity(pos); + + if (crucible == null || player.isSneaking()) + return false; + + ItemStack playerItem = player.getCurrentEquippedItem(); + + if (playerItem != null) + { + if (!(playerItem.getItem() instanceof IDemonWill) && !(playerItem.getItem() instanceof IDemonWillGem)) + { + return false; + } + } + + Utils.insertItemToTile(crucible, player); + + world.markBlockForUpdate(pos); + return true; } @Override public void breakBlock(World world, BlockPos blockPos, IBlockState blockState) { - TileIncenseAltar TileIncenseAltar = (TileIncenseAltar) world.getTileEntity(blockPos); - if (TileIncenseAltar != null) - TileIncenseAltar.dropItems(); + TileDemonCrucible tile = (TileDemonCrucible) world.getTileEntity(blockPos); + if (tile != null) + tile.dropItems(); super.breakBlock(world, blockPos, blockState); } diff --git a/src/main/java/WayofTime/bloodmagic/client/render/RenderDemonCrucible.java b/src/main/java/WayofTime/bloodmagic/client/render/RenderDemonCrucible.java new file mode 100644 index 00000000..4926971c --- /dev/null +++ b/src/main/java/WayofTime/bloodmagic/client/render/RenderDemonCrucible.java @@ -0,0 +1,59 @@ +package WayofTime.bloodmagic.client.render; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.block.model.ItemCameraTransforms; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import WayofTime.bloodmagic.tile.TileDemonCrucible; + +public class RenderDemonCrucible extends TileEntitySpecialRenderer +{ + public static Minecraft mc = Minecraft.getMinecraft(); + public static ResourceLocation resource = new ResourceLocation("bloodmagic", "textures/blocks/lifeEssenceStill.png"); + public static float minHeight = 0.6497f; + public static float maxHeight = 0.79f; + + @Override + public void renderTileEntityAt(TileDemonCrucible tile, double x, double y, double z, float partialTicks, int destroyStage) + { + ItemStack inputStack = tile.getStackInSlot(0); + + GlStateManager.pushMatrix(); + GlStateManager.translate(x, y, z); + this.renderItem(tile.getWorld(), inputStack, partialTicks); + GlStateManager.popMatrix(); + } + + private void renderItem(World world, ItemStack stack, float partialTicks) + { + RenderItem itemRenderer = mc.getRenderItem(); + if (stack != null) + { + GlStateManager.translate(0.5, 1.5, 0.5); + EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, stack); + entityitem.getEntityItem().stackSize = 1; + entityitem.hoverStart = 0.0F; + GlStateManager.pushMatrix(); + GlStateManager.disableLighting(); + + float rotation = (float) (720.0 * (System.currentTimeMillis() & 0x3FFFL) / 0x3FFFL); + + GlStateManager.rotate(rotation, 0.0F, 1.0F, 0); + GlStateManager.scale(0.5F, 0.5F, 0.5F); + GlStateManager.pushAttrib(); + RenderHelper.enableStandardItemLighting(); + itemRenderer.renderItem(entityitem.getEntityItem(), ItemCameraTransforms.TransformType.FIXED); + RenderHelper.disableStandardItemLighting(); + GlStateManager.popAttrib(); + + GlStateManager.enableLighting(); + GlStateManager.popMatrix(); + } + } +} diff --git a/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeSpeed.java b/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeSpeed.java index 91d99beb..d783c48d 100644 --- a/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeSpeed.java +++ b/src/main/java/WayofTime/bloodmagic/livingArmour/upgrade/LivingArmourUpgradeSpeed.java @@ -30,6 +30,11 @@ public class LivingArmourUpgradeSpeed extends LivingArmourUpgrade super(level); } + public double getSpeedModifier() + { + return speedModifier[this.level]; + } + @Override public void onTick(World world, EntityPlayer player, ILivingArmour livingArmour) { @@ -52,7 +57,7 @@ public class LivingArmourUpgradeSpeed extends LivingArmourUpgrade { Multimap modifierMap = HashMultimap.create(); - modifierMap.put(SharedMonsterAttributes.movementSpeed.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(895132, 1), "Speed modifier" + 1, speedModifier[this.level], 1)); +// modifierMap.put(SharedMonsterAttributes.movementSpeed.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(895132, 1), "Speed modifier" + 1, speedModifier[this.level], 1)); if (healthModifier[this.level] > 0) { diff --git a/src/main/java/WayofTime/bloodmagic/potion/PotionEventHandlers.java b/src/main/java/WayofTime/bloodmagic/potion/PotionEventHandlers.java index ca200124..caf27690 100644 --- a/src/main/java/WayofTime/bloodmagic/potion/PotionEventHandlers.java +++ b/src/main/java/WayofTime/bloodmagic/potion/PotionEventHandlers.java @@ -4,7 +4,6 @@ import java.util.List; import net.minecraft.entity.Entity; import net.minecraft.entity.IProjectile; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.entity.projectile.EntityThrowable; import net.minecraft.util.AxisAlignedBB; @@ -40,21 +39,21 @@ public class PotionEventHandlers @SubscribeEvent public void onEntityUpdate(LivingEvent.LivingUpdateEvent event) { - if (event.entityLiving.isPotionActive(ModPotions.boost)) - { - int i = event.entityLiving.getActivePotionEffect(ModPotions.boost).getAmplifier(); - { - float percentIncrease = (i + 1) * 0.05f; - - if (event.entityLiving instanceof EntityPlayer) - { - EntityPlayer entityPlayer = (EntityPlayer) event.entityLiving; - - if ((entityPlayer.onGround || entityPlayer.capabilities.isFlying) && entityPlayer.moveForward > 0F) - entityPlayer.moveFlying(0F, 1F, entityPlayer.capabilities.isFlying ? (percentIncrease / 2.0f) : percentIncrease); - } - } - } +// if (event.entityLiving.isPotionActive(ModPotions.boost)) +// { +// int i = event.entityLiving.getActivePotionEffect(ModPotions.boost).getAmplifier(); +// { +// float percentIncrease = (i + 1) * 0.05f; +// +// if (event.entityLiving instanceof EntityPlayer) +// { +// EntityPlayer entityPlayer = (EntityPlayer) event.entityLiving; +// +// if ((entityPlayer.onGround || entityPlayer.capabilities.isFlying) && entityPlayer.moveForward > 0F) +// entityPlayer.moveFlying(0F, 1F, entityPlayer.capabilities.isFlying ? (percentIncrease / 2.0f) : percentIncrease); +// } +// } +// } if (event.entityLiving.isPotionActive(ModPotions.whirlwind)) { diff --git a/src/main/java/WayofTime/bloodmagic/proxy/ClientProxy.java b/src/main/java/WayofTime/bloodmagic/proxy/ClientProxy.java index ec9c542f..45805212 100644 --- a/src/main/java/WayofTime/bloodmagic/proxy/ClientProxy.java +++ b/src/main/java/WayofTime/bloodmagic/proxy/ClientProxy.java @@ -1,6 +1,5 @@ package WayofTime.bloodmagic.proxy; -import WayofTime.bloodmagic.util.helper.InventoryRenderHelperV2; import net.minecraftforge.client.model.ModelLoader; import net.minecraftforge.client.model.obj.OBJLoader; import net.minecraftforge.common.MinecraftForge; @@ -11,6 +10,7 @@ import WayofTime.bloodmagic.client.helper.ShaderHelper; import WayofTime.bloodmagic.client.mesh.CustomMeshDefinitionActivatable; import WayofTime.bloodmagic.client.render.RenderAlchemyArray; import WayofTime.bloodmagic.client.render.RenderAltar; +import WayofTime.bloodmagic.client.render.RenderDemonCrucible; import WayofTime.bloodmagic.client.render.RenderItemRoutingNode; import WayofTime.bloodmagic.client.render.entity.BloodLightRenderFactory; import WayofTime.bloodmagic.client.render.entity.SentientArrowRenderFactory; @@ -22,9 +22,11 @@ import WayofTime.bloodmagic.registry.ModBlocks; import WayofTime.bloodmagic.registry.ModItems; import WayofTime.bloodmagic.tile.TileAlchemyArray; import WayofTime.bloodmagic.tile.TileAltar; +import WayofTime.bloodmagic.tile.TileDemonCrucible; import WayofTime.bloodmagic.tile.routing.TileRoutingNode; import WayofTime.bloodmagic.util.handler.ClientEventHandler; import WayofTime.bloodmagic.util.helper.InventoryRenderHelper; +import WayofTime.bloodmagic.util.helper.InventoryRenderHelperV2; public class ClientProxy extends CommonProxy { @@ -60,6 +62,7 @@ public class ClientProxy extends CommonProxy ClientRegistry.bindTileEntitySpecialRenderer(TileAlchemyArray.class, new RenderAlchemyArray()); ClientRegistry.bindTileEntitySpecialRenderer(TileAltar.class, new RenderAltar()); ClientRegistry.bindTileEntitySpecialRenderer(TileRoutingNode.class, new RenderItemRoutingNode()); + ClientRegistry.bindTileEntitySpecialRenderer(TileDemonCrucible.class, new RenderDemonCrucible()); } @Override diff --git a/src/main/java/WayofTime/bloodmagic/registry/ModBlocks.java b/src/main/java/WayofTime/bloodmagic/registry/ModBlocks.java index 663aefec..0718c574 100644 --- a/src/main/java/WayofTime/bloodmagic/registry/ModBlocks.java +++ b/src/main/java/WayofTime/bloodmagic/registry/ModBlocks.java @@ -38,6 +38,7 @@ import WayofTime.bloodmagic.item.block.ItemBlockRitualController; import WayofTime.bloodmagic.item.block.ItemBlockRitualStone; import WayofTime.bloodmagic.tile.TileAlchemyArray; import WayofTime.bloodmagic.tile.TileAltar; +import WayofTime.bloodmagic.tile.TileDemonCrucible; import WayofTime.bloodmagic.tile.TileImperfectRitualStone; import WayofTime.bloodmagic.tile.TileIncenseAltar; import WayofTime.bloodmagic.tile.TileMasterRitualStone; @@ -131,6 +132,7 @@ public class ModBlocks GameRegistry.registerTileEntity(TileOutputRoutingNode.class, Constants.Mod.MODID + ":" + TileOutputRoutingNode.class.getSimpleName()); GameRegistry.registerTileEntity(TileItemRoutingNode.class, Constants.Mod.MODID + ":" + TileItemRoutingNode.class.getSimpleName()); GameRegistry.registerTileEntity(TileIncenseAltar.class, Constants.Mod.MODID + ":" + TileIncenseAltar.class.getSimpleName()); + GameRegistry.registerTileEntity(TileDemonCrucible.class, Constants.Mod.MODID + ":" + TileDemonCrucible.class.getSimpleName()); } public static void initRenders() diff --git a/src/main/java/WayofTime/bloodmagic/tile/TileDemonCrucible.java b/src/main/java/WayofTime/bloodmagic/tile/TileDemonCrucible.java new file mode 100644 index 00000000..0e3b8c49 --- /dev/null +++ b/src/main/java/WayofTime/bloodmagic/tile/TileDemonCrucible.java @@ -0,0 +1,279 @@ +package WayofTime.bloodmagic.tile; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map.Entry; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ITickable; +import WayofTime.bloodmagic.api.Constants; +import WayofTime.bloodmagic.api.ritual.AreaDescriptor; +import WayofTime.bloodmagic.api.soul.EnumDemonWillType; +import WayofTime.bloodmagic.api.soul.IDemonWillConduit; + +public class TileDemonCrucible extends TileInventory implements ITickable, IDemonWillConduit +{ + public AreaDescriptor checkArea = new AreaDescriptor.Rectangle(new BlockPos(-5, -5, -5), 11); + public List conduitList = new ArrayList(); //Offset list + + public HashMap willMap = new HashMap(); + public final int maxWill = 100; + public final double maxTransferPerTick = 1; + public final double thresholdFill = 0.01; + + public int internalCounter = 0; + + public TileDemonCrucible() + { + super(1, "demonCrucible"); + } + + @Override + public void update() + { + if (internalCounter % 100 == 0) + { + conduitList.clear(); + + List posList = checkArea.getContainedPositions(pos); + for (BlockPos newPos : posList) + { + TileEntity tile = worldObj.getTileEntity(newPos); + if (tile instanceof IDemonWillConduit) + { + conduitList.add(newPos.subtract(getPos())); + } + } + } + + internalCounter++; + + if (worldObj.isBlockPowered(getPos())) + { + //TODO: Fill the contained gem if it is there. + } else + { + double maxWeight = 0; + List tileList = new ArrayList(); + + Iterator iterator = conduitList.iterator(); + while (iterator.hasNext()) + { + BlockPos newPos = pos.add(iterator.next()); + TileEntity tile = worldObj.getTileEntity(newPos); + if (tile instanceof IDemonWillConduit) + { + maxWeight += ((IDemonWillConduit) tile).getWeight(); + tileList.add((IDemonWillConduit) tile); + } else + { + iterator.remove(); + } + } + + if (maxWeight > 0) + { + for (EnumDemonWillType type : EnumDemonWillType.values()) + { + double currentAmount = this.getCurrentWill(type); + if (currentAmount <= 0) + { + continue; + } + + for (IDemonWillConduit conduit : tileList) + { + if (!conduit.canFill(type)) + { + continue; + } + + double transfer = Math.min(currentAmount, conduit.getWeight() * maxTransferPerTick / maxWeight); + if (transfer <= 0) + { + break; + } + + double conduitAmount = conduit.getCurrentWill(type); + + if (currentAmount - conduitAmount <= thresholdFill) // Will only fill if this conduit's amount is greater than the conduit it is filling. + { + continue; + } + + transfer = conduit.drainDemonWill(type, transfer, false); + if (transfer > 0) + { + conduit.drainDemonWill(type, transfer, true); + currentAmount -= transfer; + } + } + + if (currentAmount <= 0) + { + willMap.remove(type); + } else + { + willMap.put(type, currentAmount); + } + } + } + } + } + + @Override + public void readFromNBT(NBTTagCompound tag) + { + super.readFromNBT(tag); + + willMap.clear(); + + for (EnumDemonWillType type : EnumDemonWillType.values()) + { + double amount = tag.getDouble("EnumWill" + type.getName()); + if (amount > 0) + { + willMap.put(type, amount); + } + } + + NBTTagList tags = tag.getTagList(Constants.NBT.BLOCKPOS_CONNECTION, 10); + for (int i = 0; i < tags.tagCount(); i++) + { + NBTTagCompound blockTag = tags.getCompoundTagAt(i); + BlockPos newPos = new BlockPos(blockTag.getInteger(Constants.NBT.X_COORD), blockTag.getInteger(Constants.NBT.Y_COORD), blockTag.getInteger(Constants.NBT.Z_COORD)); + conduitList.add(newPos); + } + } + + @Override + public void writeToNBT(NBTTagCompound tag) + { + super.writeToNBT(tag); + + for (Entry entry : willMap.entrySet()) + { + tag.setDouble("EnumWill" + entry.getKey().getName(), entry.getValue()); + } + + NBTTagList tags = new NBTTagList(); + for (BlockPos pos : conduitList) + { + NBTTagCompound posTag = new NBTTagCompound(); + posTag.setInteger(Constants.NBT.X_COORD, pos.getX()); + posTag.setInteger(Constants.NBT.Y_COORD, pos.getY()); + posTag.setInteger(Constants.NBT.Z_COORD, pos.getZ()); + tags.appendTag(posTag); + } + + tag.setTag(Constants.NBT.BLOCKPOS_CONNECTION, tags); + } + + // IDemonWillConduit + + @Override + public int getWeight() + { + return 10; + } + + @Override + public double fillDemonWill(EnumDemonWillType type, double amount, boolean doFill) + { + if (amount <= 0) + { + return 0; + } + + if (!canFill(type)) + { + return 0; + } + + if (!doFill) + { + if (!willMap.containsKey(type)) + { + return Math.min(maxWill, amount); + } + + return Math.min(maxWill - willMap.get(type), amount); + } + + if (!willMap.containsKey(type)) + { + double max = Math.min(maxWill, amount); + + willMap.put(type, max); + + return max; + } + + double current = willMap.get(type); + double filled = maxWill - current; + + if (amount < filled) + { + willMap.put(type, current + amount); + filled = amount; + } else + { + willMap.put(type, (double) maxWill); + } + + return filled; + } + + @Override + public double drainDemonWill(EnumDemonWillType type, double amount, boolean doDrain) + { + if (!willMap.containsKey(type)) + { + return 0; + } + + double drained = amount; + double current = willMap.get(type); + if (current < drained) + { + drained = current; + } + + if (doDrain) + { + current -= drained; + if (current <= 0) + { + willMap.remove(type); + } else + { + willMap.put(type, current); + } + } + + return drained; + } + + @Override + public boolean canFill(EnumDemonWillType type) + { + return true; + } + + @Override + public boolean canDrain(EnumDemonWillType type) + { + return true; + } + + @Override + public double getCurrentWill(EnumDemonWillType type) + { + return willMap.containsKey(type) ? willMap.get(type) : 0; + } +} \ No newline at end of file diff --git a/src/main/java/WayofTime/bloodmagic/util/handler/EventHandler.java b/src/main/java/WayofTime/bloodmagic/util/handler/EventHandler.java index 1988dae8..5aed6303 100644 --- a/src/main/java/WayofTime/bloodmagic/util/handler/EventHandler.java +++ b/src/main/java/WayofTime/bloodmagic/util/handler/EventHandler.java @@ -72,6 +72,7 @@ import WayofTime.bloodmagic.livingArmour.upgrade.LivingArmourUpgradeArrowShot; import WayofTime.bloodmagic.livingArmour.upgrade.LivingArmourUpgradeDigging; import WayofTime.bloodmagic.livingArmour.upgrade.LivingArmourUpgradeGrimReaperSprint; import WayofTime.bloodmagic.livingArmour.upgrade.LivingArmourUpgradeSelfSacrifice; +import WayofTime.bloodmagic.livingArmour.upgrade.LivingArmourUpgradeSpeed; import WayofTime.bloodmagic.livingArmour.upgrade.LivingArmourUpgradeStepAssist; import WayofTime.bloodmagic.registry.ModBlocks; import WayofTime.bloodmagic.registry.ModItems; @@ -149,6 +150,36 @@ public class EventHandler player.stepHeight = 0.6f; } } + + float percentIncrease = 0; + + if (LivingArmour.hasFullSet(player)) + { + ItemStack chestStack = player.getCurrentArmor(2); + LivingArmour armour = ItemLivingArmour.getLivingArmour(chestStack); + if (armour != null) + { + LivingArmourUpgrade upgrade = ItemLivingArmour.getUpgrade(Constants.Mod.MODID + ".upgrade.movement", chestStack); + + if (upgrade instanceof LivingArmourUpgradeSpeed) + { + percentIncrease += 0.1f * ((LivingArmourUpgradeSpeed) upgrade).getSpeedModifier(); + } + } + } + + if (event.entityLiving.isPotionActive(ModPotions.boost)) + { + int i = event.entityLiving.getActivePotionEffect(ModPotions.boost).getAmplifier(); + { + percentIncrease += (i + 1) * 0.05f; + } + } + + if (percentIncrease > 0 && (player.onGround || player.capabilities.isFlying) && player.moveForward > 0F) + { + player.moveFlying(0F, 1F, player.capabilities.isFlying ? (percentIncrease / 2.0f) : percentIncrease); + } } } diff --git a/src/main/resources/assets/bloodmagic/lang/en_US.lang b/src/main/resources/assets/bloodmagic/lang/en_US.lang index 2b9240d0..df3b147d 100644 --- a/src/main/resources/assets/bloodmagic/lang/en_US.lang +++ b/src/main/resources/assets/bloodmagic/lang/en_US.lang @@ -180,6 +180,7 @@ tile.BloodMagic.incenseAltar.name=Incense Altar tile.BloodMagic.teleposer.name=Teleposer tile.BloodMagic.soulForge.name=Hellfire Forge +tile.BloodMagic.demonCrucible.name=Demon Crucible tile.BloodMagic.masterRouting.name=Master Routing Node tile.BloodMagic.outputRouting.name=Output Routing Node