diff --git a/src/main/java/com/windanesz/ancientspellcraft/AncientSpellcraft.java b/src/main/java/com/windanesz/ancientspellcraft/AncientSpellcraft.java index 7d54cd1d..9aeef457 100644 --- a/src/main/java/com/windanesz/ancientspellcraft/AncientSpellcraft.java +++ b/src/main/java/com/windanesz/ancientspellcraft/AncientSpellcraft.java @@ -39,6 +39,7 @@ import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.event.FMLInitializationEvent; +import net.minecraftforge.fml.common.event.FMLInterModComms; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.event.FMLServerStartingEvent; @@ -89,7 +90,8 @@ public void preInit(FMLPreInitializationEvent event) { settings = new Settings(); proxy.registerRenderers(); - + proxy.registerExtraHandbookContent(); + FMLInterModComms.sendMessage("ebwizardry", "addon_content", "I have stuff"); ASLoot.preInit(); ASBlocks.registerTileEntities(); ASBiomes.preInit(); diff --git a/src/main/java/com/windanesz/ancientspellcraft/CommonProxy.java b/src/main/java/com/windanesz/ancientspellcraft/CommonProxy.java index 17f9a64f..0eaf008e 100644 --- a/src/main/java/com/windanesz/ancientspellcraft/CommonProxy.java +++ b/src/main/java/com/windanesz/ancientspellcraft/CommonProxy.java @@ -104,4 +104,5 @@ public void checkTranslationKeys() {} public void openBookGUI(EntityPlayer player, ItemStack book) {} + public void registerExtraHandbookContent() {} } \ No newline at end of file diff --git a/src/main/java/com/windanesz/ancientspellcraft/Settings.java b/src/main/java/com/windanesz/ancientspellcraft/Settings.java index 37371d70..30449a47 100644 --- a/src/main/java/com/windanesz/ancientspellcraft/Settings.java +++ b/src/main/java/com/windanesz/ancientspellcraft/Settings.java @@ -424,7 +424,13 @@ public static class GeneralSettings { @Config.RequiresMcRestart public int wild_catalyst_max_distance = 10000; + @Config.Name("Runic Shield Armor Amount") + @Config.RequiresMcRestart + public float runic_shield_armor = 5.0f; + @Config.Name("Runic Shield Armor Toughness Amount") + @Config.RequiresMcRestart + public float runic_shield_armor_toughness = 5.0f; } public static class ClientSettings { diff --git a/src/main/java/com/windanesz/ancientspellcraft/client/ClientProxy.java b/src/main/java/com/windanesz/ancientspellcraft/client/ClientProxy.java index 977ba655..22dd077a 100644 --- a/src/main/java/com/windanesz/ancientspellcraft/client/ClientProxy.java +++ b/src/main/java/com/windanesz/ancientspellcraft/client/ClientProxy.java @@ -87,6 +87,7 @@ import com.windanesz.ancientspellcraft.tileentity.TileSphereCognizance; import com.windanesz.ancientspellcraft.util.ASParticles; import electroblob.wizardry.Wizardry; +import electroblob.wizardry.client.gui.handbook.GuiWizardHandbook; import electroblob.wizardry.client.particle.ParticleWizardry; import electroblob.wizardry.client.renderer.entity.RenderBlank; import electroblob.wizardry.client.renderer.entity.RenderMagicArrow; @@ -126,6 +127,7 @@ import org.lwjgl.input.Keyboard; import javax.annotation.Nullable; +import javax.swing.event.AncestorEvent; import java.util.Collection; import java.util.List; @@ -440,4 +442,9 @@ private void missingKeyWarning(String type, String registryName, String expected public void openBookGUI(EntityPlayer player, ItemStack book) { Minecraft.getMinecraft().displayGuiScreen(new GuiScreenBook(Minecraft.getMinecraft().player, book, false)); } + + @Override + public void registerExtraHandbookContent() { + GuiWizardHandbook.registerAddonHandbookContent(AncientSpellcraft.MODID); + } } \ No newline at end of file diff --git a/src/main/java/com/windanesz/ancientspellcraft/client/gui/ContainerInventoryInItemStack.java b/src/main/java/com/windanesz/ancientspellcraft/client/gui/ContainerInventoryInItemStack.java new file mode 100644 index 00000000..48413eb5 --- /dev/null +++ b/src/main/java/com/windanesz/ancientspellcraft/client/gui/ContainerInventoryInItemStack.java @@ -0,0 +1,104 @@ +package com.windanesz.ancientspellcraft.client.gui; + +import com.windanesz.ancientspellcraft.item.ItemGlyphArtefact; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + +public class ContainerInventoryInItemStack extends Container { + private final IInventory itemInventory; + + public ContainerInventoryInItemStack(IInventory playerInventory, IInventory itemInventory, EntityPlayer player) { + this.itemInventory = itemInventory; + itemInventory.openInventory(player); + + if (itemInventory instanceof InventoryInItemStack) { + + int rowCount = ((InventoryInItemStack) itemInventory).getRowCount(); + int columnCount = ((InventoryInItemStack) itemInventory).getColumnCount(); + int index = 0; + + int offsetX = itemInventory.getSizeInventory() == 9 ? 0 : -54; + + this.addSlotToContainer(new Slot(itemInventory, index, 80, 36) { + @Override + public boolean isItemValid(ItemStack stack) { + return stack.getItem() instanceof ItemGlyphArtefact; + } + }); + index++; + this.addSlotToContainer(new Slot(itemInventory, index, 60, 76) { + @Override + public boolean isItemValid(ItemStack stack) { + return stack.getItem() instanceof ItemGlyphArtefact; + } + }); + index++; + this.addSlotToContainer(new Slot(itemInventory, index, 100, 76) { + @Override + public boolean isItemValid(ItemStack stack) { + return stack.getItem() instanceof ItemGlyphArtefact; + } + }); + + // player's inventory + for (int i1 = 0; i1 < 3; ++i1) { + for (int k1 = 0; k1 < 9; ++k1) { + this.addSlotToContainer(new Slot(playerInventory, k1 + i1 * 9 + 9, 8 + k1 * 18, 134 + i1 * 18)); + } + } + + // player's inventory hotbar + for (int j1 = 0; j1 < 9; ++j1) { + this.addSlotToContainer(new Slot(playerInventory, j1, 8 + j1 * 18, 192)); + } + } + } + + public boolean canInteractWith(EntityPlayer playerIn) { + return this.itemInventory.isUsableByPlayer(playerIn); + } + + public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) { + ItemStack itemstack = ItemStack.EMPTY; + Slot slot = this.inventorySlots.get(index); + + if (slot != null && slot.getHasStack()) { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + + if (index < this.itemInventory.getSizeInventory()) { + if (!this.mergeItemStack(itemstack1, this.itemInventory.getSizeInventory(), this.inventorySlots.size(), true)) { + return ItemStack.EMPTY; + } + } else if (this.getSlot(1).isItemValid(itemstack1) && !this.getSlot(1).getHasStack()) { + if (!this.mergeItemStack(itemstack1, 1, 2, false)) { + return ItemStack.EMPTY; + } + } else if (this.getSlot(0).isItemValid(itemstack1)) { + if (!this.mergeItemStack(itemstack1, 0, 1, false)) { + return ItemStack.EMPTY; + } + } else if (this.itemInventory.getSizeInventory() <= 2 || !this.mergeItemStack(itemstack1, 2, this.itemInventory.getSizeInventory(), false)) { + return ItemStack.EMPTY; + } + + if (itemstack1.isEmpty()) { + slot.putStack(ItemStack.EMPTY); + } else { + slot.onSlotChanged(); + } + + } + + return itemstack; + } + + public void onContainerClosed(EntityPlayer playerIn) { + super.onContainerClosed(playerIn); + this.itemInventory.closeInventory(playerIn); + } + +} diff --git a/src/main/java/com/windanesz/ancientspellcraft/client/gui/GuiHandlerAS.java b/src/main/java/com/windanesz/ancientspellcraft/client/gui/GuiHandlerAS.java index 57f28b1c..01ce7824 100644 --- a/src/main/java/com/windanesz/ancientspellcraft/client/gui/GuiHandlerAS.java +++ b/src/main/java/com/windanesz/ancientspellcraft/client/gui/GuiHandlerAS.java @@ -1,6 +1,8 @@ package com.windanesz.ancientspellcraft.client.gui; +import com.windanesz.ancientspellcraft.item.IItemWithSlots; import com.windanesz.ancientspellcraft.item.ItemASSpellBook; +import com.windanesz.ancientspellcraft.item.ItemBattlemageShield; import com.windanesz.ancientspellcraft.item.ItemRitualBook; import com.windanesz.ancientspellcraft.item.ItemRunicPlate; import com.windanesz.ancientspellcraft.item.ItemSageTome; @@ -12,6 +14,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumHand; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.fml.common.network.IGuiHandler; @@ -32,6 +35,7 @@ public class GuiHandlerAS implements IGuiHandler { public static final int SAGE_LECTERN = nextGuiId++; public static final int SPELL_GUI_LECTERN = nextGuiId++; public static final int RUNIC_PLATE = nextGuiId++; + public static final int BATTLEMAGE_SHIELD = nextGuiId++; @Override public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) { @@ -49,6 +53,10 @@ public Object getServerGuiElement(int id, EntityPlayer player, World world, int } else if (id == SAGE_LECTERN) { TileEntity tileEntity = world.getTileEntity(new BlockPos(x, y, z)); return new ContainerSageLectern(player, player.inventory, (TileSageLectern) tileEntity); + } else if (id == BATTLEMAGE_SHIELD) { + ItemStack stack = player.getHeldItem(EnumHand.values()[x]); + InventoryInItemStack inventory = new InventoryInItemStack("Runic Shield", true, (IItemWithSlots) stack.getItem(), stack); + return new ContainerInventoryInItemStack(player.inventory, inventory, player); } return null; } @@ -130,6 +138,15 @@ public Object getClientGuiElement(int id, EntityPlayer player, World world, int return new GuiRunicPlate(player.getHeldItemOffhand()); } } + + if (id == BATTLEMAGE_SHIELD) { + if (player.getHeldItemMainhand().getItem() instanceof ItemBattlemageShield) { + ItemStack stack = player.getHeldItem(EnumHand.values()[x]); + InventoryInItemStack inventory = new InventoryInItemStack("Battlemage Shield", true, (IItemWithSlots) stack.getItem(), stack); + return new GuiScreenInventoryInItem(inventory, player, "battlemage_shield"); + } + } + return null; } } diff --git a/src/main/java/com/windanesz/ancientspellcraft/client/gui/GuiScreenInventoryInItem.java b/src/main/java/com/windanesz/ancientspellcraft/client/gui/GuiScreenInventoryInItem.java new file mode 100644 index 00000000..689eacc8 --- /dev/null +++ b/src/main/java/com/windanesz/ancientspellcraft/client/gui/GuiScreenInventoryInItem.java @@ -0,0 +1,39 @@ +package com.windanesz.ancientspellcraft.client.gui; + +import com.windanesz.ancientspellcraft.AncientSpellcraft; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class GuiScreenInventoryInItem extends GuiContainer { + + private final ResourceLocation GUI_BACKGROUND; + + public GuiScreenInventoryInItem(IInventory inventory, EntityPlayer player, String texture) { + super(new ContainerInventoryInItemStack(player.inventory, inventory, player)); + this.xSize = 176; + this.ySize = 223; + this.GUI_BACKGROUND = new ResourceLocation(AncientSpellcraft.MODID, "textures/gui/" + texture + ".png"); + } + + protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(GUI_BACKGROUND); + int i = (this.width - this.xSize) / 2; + int j = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.ySize); + + } + + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + this.drawDefaultBackground(); + super.drawScreen(mouseX, mouseY, partialTicks); + this.renderHoveredToolTip(mouseX, mouseY); + } + +} diff --git a/src/main/java/com/windanesz/ancientspellcraft/client/gui/InventoryInItemStack.java b/src/main/java/com/windanesz/ancientspellcraft/client/gui/InventoryInItemStack.java new file mode 100644 index 00000000..785333c8 --- /dev/null +++ b/src/main/java/com/windanesz/ancientspellcraft/client/gui/InventoryInItemStack.java @@ -0,0 +1,82 @@ +package com.windanesz.ancientspellcraft.client.gui; + +import com.windanesz.ancientspellcraft.item.IItemWithSlots; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.InventoryBasic; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; + +public class InventoryInItemStack extends InventoryBasic { + + private final ItemStack stack; + + public InventoryInItemStack(String title, boolean customName, IItemWithSlots itemWithSlots, ItemStack stack) { + super(title, customName, itemWithSlots.getSlotCount()); + this.stack = stack; + } + + public int getRowCount() { + return ((IItemWithSlots) (stack.getItem())).getRowCount(); + } + + public int getColumnCount() { + return ((IItemWithSlots) (stack.getItem())).getColumnCount(); + } + + @Override + public void openInventory(EntityPlayer player) { + super.openInventory(player); + NBTTagCompound nbt = this.stack.getTagCompound(); + if (nbt == null) { + nbt = new NBTTagCompound(); + } + + if (nbt.hasKey("Items")) { + + NBTTagList items = nbt.getTagList("Items", 10); + + for (int i = 0; i < items.tagCount(); ++i) { + NBTTagCompound nbttagcompound = items.getCompoundTagAt(i); + int j = nbttagcompound.getByte("Slot") & 255; + + if (j < this.getSizeInventory()) { + this.setInventorySlotContents(j, new ItemStack(nbttagcompound)); + } + } + } + } + + @Override + public void closeInventory(EntityPlayer player) { + + NBTTagCompound nbt = this.stack.getTagCompound(); + if (nbt == null) { + nbt = new NBTTagCompound(); + } + + NBTTagList items = new NBTTagList(); + + for (int i = 0; i < this.getSizeInventory(); ++i) { + ItemStack itemstack = this.getStackInSlot(i); + + if (!itemstack.isEmpty()) { + NBTTagCompound nbttagcompound = new NBTTagCompound(); + nbttagcompound.setByte("Slot", (byte) i); + itemstack.writeToNBT(nbttagcompound); + items.appendTag(nbttagcompound); + } + } + + nbt.setTag("Items", items); + stack.setTagCompound(nbt); + } + + @Override + public boolean isItemValidForSlot(int index, ItemStack stack) { + if (((IItemWithSlots) (stack.getItem())).isItemValid(stack.getItem())) { + return false; + } + return super.isItemValidForSlot(index, stack); + } +} \ No newline at end of file diff --git a/src/main/java/com/windanesz/ancientspellcraft/entity/construct/EntityArcaneBarrier.java b/src/main/java/com/windanesz/ancientspellcraft/entity/construct/EntityArcaneBarrier.java index 8302e0a9..79fdf7d5 100644 --- a/src/main/java/com/windanesz/ancientspellcraft/entity/construct/EntityArcaneBarrier.java +++ b/src/main/java/com/windanesz/ancientspellcraft/entity/construct/EntityArcaneBarrier.java @@ -45,6 +45,7 @@ import java.util.Arrays; import java.util.Comparator; import java.util.List; +import java.util.UUID; // TODO: Possibly convert this to EntityScaledConstruct @Mod.EventBusSubscriber @@ -453,6 +454,18 @@ public static void onExplosionEvent(ExplosionEvent event) { event.getExplosion().getPlayerKnockbackMap().keySet().removeIf(p -> getSurroundingForcefield(p) != forcefield); } + @Nullable + @Override + public UUID getOwnerId() { + return null; + } + + @Nullable + @Override + public Entity getOwner() { + return null; + } + public enum Colour { MAGENTA(13, 0.67f, 0.28f, 0.85f), RED(1, 0.85f, 0.27f, 0.27f), diff --git a/src/main/java/com/windanesz/ancientspellcraft/handler/ASEventHandler.java b/src/main/java/com/windanesz/ancientspellcraft/handler/ASEventHandler.java index 1b707e0e..24c75b56 100644 --- a/src/main/java/com/windanesz/ancientspellcraft/handler/ASEventHandler.java +++ b/src/main/java/com/windanesz/ancientspellcraft/handler/ASEventHandler.java @@ -8,6 +8,7 @@ import com.windanesz.ancientspellcraft.entity.projectile.EntityMetamagicProjectile; import com.windanesz.ancientspellcraft.integration.artemislib.ASArtemisLibIntegration; import com.windanesz.ancientspellcraft.integration.baubles.ASBaublesIntegration; +import com.windanesz.ancientspellcraft.item.ItemBattlemageShield; import com.windanesz.ancientspellcraft.item.ItemBeltScrollHolder; import com.windanesz.ancientspellcraft.item.ItemManaArtefact; import com.windanesz.ancientspellcraft.item.ItemNewArtefact; @@ -41,6 +42,7 @@ import electroblob.wizardry.entity.living.ISpellCaster; import electroblob.wizardry.entity.living.ISummonedCreature; import electroblob.wizardry.entity.projectile.EntityMagicProjectile; +import electroblob.wizardry.event.ArtefactCheckEvent; import electroblob.wizardry.event.SpellBindEvent; import electroblob.wizardry.event.SpellCastEvent; import electroblob.wizardry.integration.DamageSafetyChecker; @@ -146,7 +148,7 @@ public static void onRightClickItem(PlayerInteractEvent.RightClickItem event) { Ritual ritual = ItemRitualBook.getRitual(otherItemStack); if (!RitualDiscoveryData.hasRitualBeenDiscovered(player, ritual)) { RitualDiscoveryData.addKnownRitual(player, ritual); - if(!player.isCreative()) event.getItemStack().shrink(1); + if (!player.isCreative()) {event.getItemStack().shrink(1);} ASUtils.sendMessage(player, "ritual.discover", false, ritual.getNameForTranslationFormatted()); event.setCanceled(true); } @@ -297,7 +299,7 @@ private static void onMetaMagicFinished(EntityPlayer player, Spell spell, Potion setCooldown(player, spell); if (!player.world.isRemote) { - float chance = 0; + float chance = 0; for (ItemArtefact ring : ItemArtefact.getActiveArtefacts(player, ItemArtefact.Type.RING)) { if (ring == ASItems.ring_metamagic_preserve) { chance += 0.33f; @@ -351,7 +353,7 @@ private static void setCooldown(EntityPlayer player, Spell spell) { } private static int update(EntityPlayer player, Integer countdown) { - if (countdown == null) { return 0; } + if (countdown == null) {return 0;} if (!player.world.isRemote) { @@ -359,7 +361,7 @@ private static int update(EntityPlayer player, Integer countdown) { Integer spellId = data.getVariable(SPELL_ID); - if (spellId == null) { return 0; } + if (spellId == null) {return 0;} Spell spell = Spell.byMetadata(spellId); @@ -436,7 +438,7 @@ public static void onLivingHurtEvent(LivingHurtEvent event) { if ((player.getHealth() <= 8 || (player.getHealth() - event.getAmount() <= 6)) && player.world.rand.nextFloat() < 0.5f) { boolean shouldContinue = true; for (ItemStack wand : ASUtils.getAllHotbarWands(player)) { - if (!shouldContinue) { break; } + if (!shouldContinue) {break;} Spell[] spells = WandHelper.getSpells(wand); List minions = new ArrayList<>(); List indexes = new ArrayList<>(); @@ -548,12 +550,12 @@ public static void onLivingHurtEvent(LivingHurtEvent event) { Entity entity = EntityUtils.getEntityByUUID(player.world, iterator.next()); // the target who will take the damage instead - if (entity == null) { iterator.remove(); } + if (entity == null) {iterator.remove();} if (entity instanceof EntityPlayer && ((EntityPlayer) entity).isPotionActive(ASPotions.martyr)) { // Retaliatory effect if (DamageSafetyChecker.attackEntitySafely(entity, MagicDamage.causeDirectMagicDamage(player, - MagicDamage.DamageType.MAGIC, true), event.getAmount(), event.getSource().getDamageType(), + MagicDamage.DamageType.MAGIC, true), event.getAmount(), event.getSource().getDamageType(), DamageSource.MAGIC, false)) { // Sound only plays if the damage succeeds entity.playSound(WizardrySounds.SPELL_CURSE_OF_SOULBINDING_RETALIATE, 1.0F, player.world.rand.nextFloat() * 0.2F + 1.0F); @@ -588,6 +590,22 @@ public static void onLivingHurtEvent(LivingHurtEvent event) { @SubscribeEvent public static void onPotionApplicableEvent(PotionEvent.PotionApplicableEvent event) { + if (!event.getEntityLiving().world.isRemote && event.getPotionEffect().getPotion() != ASPotions.tenacity && event.getEntityLiving().isPotionActive(ASPotions.tenacity)) { + if (!event.getEntityLiving().getTags().contains(event.getPotionEffect().getPotion().getRegistryName().toString())) { + + int tenacityLevel = event.getEntityLiving().getActivePotionEffect(ASPotions.tenacity).getAmplifier() + 1; + // Calculate the reduction factor based on tenacity level + double reductionFactor = 1.0 - (0.25 * tenacityLevel); // You can adjust the reduction factor as needed + + event.getEntityLiving().addTag(event.getPotionEffect().getPotion().getRegistryName().toString()); + event.getEntityLiving().addPotionEffect(new PotionEffect(event.getPotionEffect().getPotion(), (int) (event.getPotionEffect().getDuration() * 0.5), event.getPotionEffect().getAmplifier())); + event.setResult(Event.Result.DENY); + } else { + event.getEntityLiving().getTags().remove(event.getPotionEffect().getPotion().getRegistryName().toString()); + // event.setResult(Event.Result.DENY); + } + } + if (event.getPotionEffect().getPotion() == ASPotions.eagle_eye && !(event.getEntityLiving() instanceof EntityPlayer)) { event.setResult(Event.Result.DENY); } @@ -773,7 +791,7 @@ public static void onLivingDeathEventLowest(LivingDeathEvent event) { if (!event.getEntityLiving().world.isRemote && event.getEntityLiving() instanceof EntityEvilWizard && ItemArtefact.isArtefactActive(player, ASItems.charm_plunderers_mark)) { double d0 = event.getEntityLiving().posY - 0.30000001192092896D + (double) event.getEntityLiving().getEyeHeight(); - EntityItem entityitem = new EntityItem(event.getEntityLiving().world, event.getEntityLiving().posX, d0, event.getEntityLiving().posZ,new ItemStack(ASItems.astral_diamond_shard)); + EntityItem entityitem = new EntityItem(event.getEntityLiving().world, event.getEntityLiving().posX, d0, event.getEntityLiving().posZ, new ItemStack(ASItems.astral_diamond_shard)); event.getEntityLiving().world.spawnEntity(entityitem); } } @@ -798,12 +816,12 @@ public static void onProjectileImpactArrowEvent(ProjectileImpactEvent.Arrow even } } -// if (ItemArtefact.isArtefactActive(player, ASItems.charm_ice_arrow)) { -// if (event.getRayTraceResult().entityHit instanceof EntityLivingBase) { -// EntityLivingBase target = (EntityLivingBase) event.getRayTraceResult().entityHit; -// target.addPotionEffect(new PotionEffect(WizardryPotions.frost, 30)); // 1,5 seconds of poisoning -// } -// } + // if (ItemArtefact.isArtefactActive(player, ASItems.charm_ice_arrow)) { + // if (event.getRayTraceResult().entityHit instanceof EntityLivingBase) { + // EntityLivingBase target = (EntityLivingBase) event.getRayTraceResult().entityHit; + // target.addPotionEffect(new PotionEffect(WizardryPotions.frost, 30)); // 1,5 seconds of poisoning + // } + // } } } } @@ -813,7 +831,7 @@ public static void onSpellCastPreEvent(SpellCastEvent.Pre event) { if (event.getSpell().getTier().ordinal() > 1) { for (EntityPlayer player : event.getWorld().playerEntities) { - if (event.getCaster() instanceof EntityLivingBase && event.getCaster().getDistanceSq(player) < 20 && ItemArtefact.isArtefactActive(player, ASItems.charm_suppression_orb)) { + if (event.getCaster() instanceof EntityLivingBase && event.getCaster().getDistanceSq(player) < 20 && ItemArtefact.isArtefactActive(player, ASItems.charm_suppression_orb)) { if (event.getCaster() instanceof EntityPlayer) { ASUtils.sendMessage(event.getCaster(), "item.ancientspellcraft:charm_suppression_orb.message", true); } @@ -1157,7 +1175,7 @@ public static void onSpellCastPreEvent(SpellCastEvent.Pre event) { projectile.damageMultiplier = modifiers.get(SpellModifiers.POTENCY); // Spawns the projectile in the world - if (!player.world.isRemote) { player.world.spawnEntity(projectile); } + if (!player.world.isRemote) {player.world.spawnEntity(projectile);} data.setVariable(MetamagicProjectile.METAMAGIC_PROJECTILE, null); event.setCanceled(true); @@ -1179,7 +1197,7 @@ public static void onSpellCastPreEvent(SpellCastEvent.Pre event) { projectile.damageMultiplier = modifiers.get(SpellModifiers.POTENCY); // Spawns the projectile in the world - if (!event.getWorld().isRemote) { player.world.spawnEntity(projectile); } + if (!event.getWorld().isRemote) {player.world.spawnEntity(projectile);} data.setVariable(Contingency.ACTIVE_CONTINGENCY_LISTENER, null); Contingency.playSound(event.getWorld(), player.getPosition()); event.setCanceled(true); @@ -1219,7 +1237,7 @@ public static void onSpellCastPreEvent(SpellCastEvent.Pre event) { player.getCooldownTracker().setCooldown(player.getHeldItemMainhand().getItem(), spellToStore.getCooldown()); } } - if (event.getWorld().isRemote) { Contingency.spawnParticles(event.getWorld(), player, Contingency.Type.fromName(spellTag)); } + if (event.getWorld().isRemote) {Contingency.spawnParticles(event.getWorld(), player, Contingency.Type.fromName(spellTag));} Contingency.playSound(event.getWorld(), player.getPosition()); data.setVariable(Contingency.ACTIVE_CONTINGENCY_LISTENER, null); @@ -1298,7 +1316,7 @@ public static void onArcaneWorkbenchApplyButtonPressed(SpellBindEvent event) { if (artefact == ASItems.charm_wand_upgrade) { if (player.world.rand.nextFloat() < 0.2f) { - // check if its a wand and a wand upgrade item + // check if it's a wand and a wand upgrade item if (WandHelper.isWandUpgrade(upgrade.getItem()) && centre.getItem() instanceof ItemWand) { Item specialUpgrade = upgrade.getItem(); @@ -1362,6 +1380,15 @@ public static void onPlayerTickEvent(TickEvent.PlayerTickEvent event) { } + @SubscribeEvent(priority = EventPriority.HIGHEST) + public static void onArtefactCheckEvent(ArtefactCheckEvent event) { + if (event.getPlayer() != null && event.getPlayer().getHeldItemOffhand().getItem() instanceof ItemBattlemageShield) { + if (ItemBattlemageShield.getArtefacts(event.getPlayer().getHeldItemOffhand()).stream().anyMatch(s -> s.getItem() == event.getArtefact())) { + event.setResult(Event.Result.ALLOW); + } + } + } + /** * This event is Cancelable. If this event is canceled, the Entity is not added to the world. * This event does not have a result. @@ -1434,7 +1461,7 @@ public static void onCheckSpawnEvent(EntityJoinWorldEvent event) { if (!ImbueWeapon.isBow(bow)) { bow = archer.getHeldItemOffhand(); - if (!ImbueWeapon.isBow(bow)) { return; } + if (!ImbueWeapon.isBow(bow)) {return;} } // Taken directly from ItemBow, so it works exactly the same as the power enchantment. @@ -1460,7 +1487,7 @@ public static float calculateVelocity(EntityMagicProjectile projectile, SpellMod if (projectile.hasNoGravity()) { // No sensible spell will do this - range is meaningless if the projectile has no gravity or lifetime - if (projectile.getLifetime() <= 0) { return 1.5f; } + if (projectile.getLifetime() <= 0) {return 1.5f;} // Speed = distance/time (trivial, I know, but I've put it here for the sake of completeness) return range / projectile.getLifetime(); } else { diff --git a/src/main/java/com/windanesz/ancientspellcraft/integration/baubles/ASBaublesIntegration.java b/src/main/java/com/windanesz/ancientspellcraft/integration/baubles/ASBaublesIntegration.java index d6ffd5c7..2ec32149 100644 --- a/src/main/java/com/windanesz/ancientspellcraft/integration/baubles/ASBaublesIntegration.java +++ b/src/main/java/com/windanesz/ancientspellcraft/integration/baubles/ASBaublesIntegration.java @@ -7,10 +7,12 @@ import baubles.api.cap.IBaublesItemHandler; import com.windanesz.ancientspellcraft.Settings; import com.windanesz.ancientspellcraft.item.ITickableArtefact; +import com.windanesz.ancientspellcraft.item.ItemBattlemageShield; import com.windanesz.ancientspellcraft.item.ItemNewArtefact; import electroblob.wizardry.item.ItemArtefact; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.ICapabilityProvider; diff --git a/src/main/java/com/windanesz/ancientspellcraft/item/IItemWithSlots.java b/src/main/java/com/windanesz/ancientspellcraft/item/IItemWithSlots.java new file mode 100644 index 00000000..781aaeff --- /dev/null +++ b/src/main/java/com/windanesz/ancientspellcraft/item/IItemWithSlots.java @@ -0,0 +1,16 @@ +package com.windanesz.ancientspellcraft.item; + +import net.minecraft.item.Item; + +public interface IItemWithSlots { + + int getSlotCount(); + + boolean hasGUI(); + + int getRowCount(); + + int getColumnCount(); + + boolean isItemValid(Item item); +} diff --git a/src/main/java/com/windanesz/ancientspellcraft/item/ItemBattlemageShield.java b/src/main/java/com/windanesz/ancientspellcraft/item/ItemBattlemageShield.java new file mode 100644 index 00000000..f90d50de --- /dev/null +++ b/src/main/java/com/windanesz/ancientspellcraft/item/ItemBattlemageShield.java @@ -0,0 +1,445 @@ +package com.windanesz.ancientspellcraft.item; + +import com.google.common.collect.ArrayListMultimap; +import com.google.common.collect.Multimap; +import com.windanesz.ancientspellcraft.AncientSpellcraft; +import com.windanesz.ancientspellcraft.Settings; +import com.windanesz.ancientspellcraft.client.gui.GuiHandlerAS; +import com.windanesz.ancientspellcraft.registry.ASItems; +import com.windanesz.ancientspellcraft.registry.ASTabs; +import com.windanesz.ancientspellcraft.util.ASUtils; +import com.windanesz.ancientspellcraft.util.WizardArmourUtils; +import electroblob.wizardry.Wizardry; +import electroblob.wizardry.constants.Constants; +import electroblob.wizardry.constants.Element; +import electroblob.wizardry.constants.Tier; +import electroblob.wizardry.data.WizardData; +import electroblob.wizardry.event.SpellCastEvent; +import electroblob.wizardry.item.IManaStoringItem; +import electroblob.wizardry.item.ISpellCastingItem; +import electroblob.wizardry.item.IWorkbenchItem; +import electroblob.wizardry.item.ItemArtefact; +import electroblob.wizardry.item.ItemWizardArmour; +import electroblob.wizardry.packet.PacketCastSpell; +import electroblob.wizardry.packet.WizardryPacketHandler; +import electroblob.wizardry.registry.Spells; +import electroblob.wizardry.registry.WizardryAdvancementTriggers; +import electroblob.wizardry.registry.WizardryItems; +import electroblob.wizardry.registry.WizardryRecipes; +import electroblob.wizardry.spell.Spell; +import electroblob.wizardry.util.SpellModifiers; +import electroblob.wizardry.util.WandHelper; +import net.minecraft.block.BlockDispenser; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.AttributeModifier; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.EntityEquipmentSlot; +import net.minecraft.inventory.Slot; +import net.minecraft.item.EnumAction; +import net.minecraft.item.IItemPropertyGetter; +import net.minecraft.item.Item; +import net.minecraft.item.ItemArmor; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ActionResult; +import net.minecraft.util.EnumActionResult; +import net.minecraft.util.EnumHand; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fml.common.network.simpleimpl.IMessage; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +public class ItemBattlemageShield extends Item implements ISpellCastingItem, IManaStoringItem, IWorkbenchItem, IItemWithSlots { + + private static final UUID SHIELD_ARMOR_BONUS = UUID.fromString("2b5b1f50-b6b5-473a-a402-e45a24d83c13"); + private static final UUID SHIELD_ARMOR_PERCENT_BONUS = UUID.fromString("3c1acb30-dafb-4c27-a142-680f12ed9c36"); + private static final UUID SHIELD_TOUGHNESS_BONUS = UUID.fromString("84d9a7e1-5346-4073-98e9-0e04d6d28da5"); + + + public ItemBattlemageShield() { + setFull3D(); + this.maxStackSize = 1; + this.setCreativeTab(ASTabs.ANCIENTSPELLCRAFT_GEAR); + this.setMaxDamage(1000); + this.addPropertyOverride(new ResourceLocation("blocking"), new IItemPropertyGetter() { + @SideOnly(Side.CLIENT) + public float apply(ItemStack stack, @Nullable World worldIn, @Nullable EntityLivingBase entityIn) { + return entityIn != null && entityIn.isHandActive() && entityIn.getActiveItemStack() == stack ? 1.0F : 0.0F; + } + }); + BlockDispenser.DISPENSE_BEHAVIOR_REGISTRY.putObject(this, ItemArmor.DISPENSER_BEHAVIOR); + WizardryRecipes.addToManaFlaskCharging(this); + } + + @Override + public int getSpellSlotCount(ItemStack stack) { + return 0; + } + + @Override + public boolean onApplyButtonPressed(EntityPlayer player, Slot centre, Slot crystals, Slot upgrade, Slot[] spellBooks) { + boolean changed = false; + + if (upgrade.getHasStack()) { + ItemStack original = centre.getStack().copy(); + centre.putStack(this.applyUpgrade(player, centre.getStack(), upgrade.getStack())); + changed = !ItemStack.areItemStacksEqual(centre.getStack(), original); + } + + + // Charges the shield by appropriate amount. Taken mostly from ItemWizardArmour, thanks to Electroblob + if (crystals.getStack() != ItemStack.EMPTY && !this.isManaFull(centre.getStack())) { + + int chargeDepleted = this.getManaCapacity(centre.getStack()) - this.getMana(centre.getStack()); + + if (crystals.getStack().getCount() * Constants.MANA_PER_CRYSTAL < chargeDepleted) { + // If there aren't enough crystals to fully charge the shield + this.rechargeMana(centre.getStack(), crystals.getStack().getCount() * Constants.MANA_PER_CRYSTAL); + crystals.decrStackSize(crystals.getStack().getCount()); + + } else { + // If there are excess crystals (or just enough) + this.setMana(centre.getStack(), this.getManaCapacity(centre.getStack())); + crystals.decrStackSize((int) Math.ceil(((double) chargeDepleted) / Constants.MANA_PER_CRYSTAL)); + } + + changed = true; + } + + return changed; + } + + public int getMaxDamage(ItemStack stack) { + return (int)((float)super.getMaxDamage(stack) * (1.0F + 0.15F * (float)WandHelper.getUpgradeLevel(stack, WizardryItems.storage_upgrade)) + 0.5F); + } + + public ItemStack applyUpgrade(@Nullable EntityPlayer player, ItemStack shield, ItemStack upgrade) { + if (WandHelper.isWandUpgrade(upgrade.getItem())) { + Item specialUpgrade = upgrade.getItem(); + + if (specialUpgrade == WizardryItems.storage_upgrade || specialUpgrade == WizardryItems.siphon_upgrade || specialUpgrade == WizardryItems.condenser_upgrade) { + + int maxUpgrades = 9; + if (WandHelper.getTotalUpgrades(shield) < maxUpgrades && WandHelper.getUpgradeLevel(shield, specialUpgrade) < 3) { + int prevMana = this.getMana(shield); + WandHelper.applyUpgrade(shield, specialUpgrade); + if (specialUpgrade == WizardryItems.storage_upgrade) { + this.setMana(shield, prevMana); + } + + upgrade.shrink(1); + if (player != null) { + WizardryAdvancementTriggers.special_upgrade.triggerFor(player); + } + } + } + + } + return shield; + } + + @Override + public boolean showTooltip(ItemStack stack) { + return true; + } + + @Override + public int getMana(ItemStack stack) { + return getManaCapacity(stack) - getDamage(stack); + } + + @Override + public void setDamage(ItemStack stack, int damage) { + // Overridden to do nothing to stop repair things from 'repairing' the mana in a wand + } + + @Override + public void setMana(ItemStack stack, int mana) { + // Using super (which can only be done from in here) bypasses the above override + super.setDamage(stack, getManaCapacity(stack) - mana); + } + + @Override + public int getManaCapacity(ItemStack stack) { + return this.getMaxDamage(stack); + } + + /** + * allows items to add custom lines of information to the mouseover description + */ + @Override + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, @Nullable World worldIn, List tooltip, net.minecraft.client.util.ITooltipFlag advanced) { + Wizardry.proxy.addMultiLineDescription(tooltip, "item." + this.getRegistryName() + ".desc"); + + if (advanced.isAdvanced()) { + // Advanced tooltips for debugging + // current mana + tooltip.add("\u00A79" + net.minecraft.client.resources.I18n.format("item." + Wizardry.MODID + ":wand.mana", + this.getMana(stack), this.getManaCapacity(stack))); + + } + } + + /** + * returns the action that specifies what animation to play when the items is being used + */ + public EnumAction getItemUseAction(ItemStack stack) { + return EnumAction.BLOCK; + } + + /** + * How long it takes to use or consume an item + */ + public int getMaxItemUseDuration(ItemStack stack) { + return 20000; + } + + /** + * Called when the equipped item is right-clicked. + */ + public ActionResult onItemRightClick(World worldIn, EntityPlayer player, EnumHand hand) { + ItemStack stack = player.getHeldItem(hand); + + if (!isBattlemage(player)) { + ASUtils.sendMessage(player, "Only a battlemage can use this", false); + return new ActionResult<>(EnumActionResult.FAIL, stack); + } + + if (hand == EnumHand.MAIN_HAND && player.isSneaking()) { + // open hud + player.openGui(AncientSpellcraft.instance, GuiHandlerAS.BATTLEMAGE_SHIELD, player.world, 0, 0, 0); + return ActionResult.newResult(EnumActionResult.SUCCESS, stack); + } + + if (isManaEmpty(stack)) { + return new ActionResult<>(EnumActionResult.FAIL, stack); + } + + // Spell spell = Spells.shield; + // SpellModifiers modifiers = new SpellModifiers(); + // modifiers.set("potency", 2.f, false); + // + // cast(stack, spell, player, hand, 0, modifiers); + // if (!player.isHandActive()) { + player.setActiveHand(hand); + return new ActionResult<>(EnumActionResult.SUCCESS, stack); + // } + + //return new ActionResult<>(EnumActionResult.FAIL, stack); + } + + @Override + public boolean canContinueUsing(ItemStack oldStack, ItemStack newStack) { + // Ignore durability changes + if (ItemStack.areItemsEqualIgnoreDurability(oldStack, newStack)) {return true;} + return super.canContinueUsing(oldStack, newStack); + } + + @Override + public void onUsingTick(ItemStack stack, EntityLivingBase user, int count) { + if (user instanceof EntityPlayer) { + if (count % 20 == 0) { // every sec + consumeMana(stack, 3, user); + if (isManaEmpty(stack)) { + user.stopActiveHand(); + } + } + + } + super.onUsingTick(stack, user, count); + } + + public boolean isBattlemage(EntityPlayer player) { + return WizardArmourUtils.isWearingFullSet(player, null, ItemWizardArmour.ArmourClass.BATTLEMAGE); + } + + @Override + public String getItemStackDisplayName(ItemStack stack) { + return super.getItemStackDisplayName(stack); + } + + public boolean shouldCauseReequipAnimation(ItemStack oldStack, ItemStack newStack, boolean slotChanged) { + if (!oldStack.isEmpty() || !newStack.isEmpty()) { + // We only care about the situation where we specifically want the animation NOT to play. + if (oldStack.getItem() == newStack.getItem() && !slotChanged) { + return false; + } + } + + return super.shouldCauseReequipAnimation(oldStack, newStack, slotChanged); + } + + @Override + public boolean cast(ItemStack stack, Spell spell, EntityPlayer caster, EnumHand hand, int castingTick, SpellModifiers modifiers) { + + World world = caster.world; + + if (world.isRemote && !spell.isContinuous && spell.requiresPacket()) {return false;} + + if (spell.cast(world, caster, hand, castingTick, modifiers)) { + + if (castingTick == 0) {MinecraftForge.EVENT_BUS.post(new SpellCastEvent.Post(SpellCastEvent.Source.OTHER, spell, caster, modifiers));} + + if (!world.isRemote) { + + // Continuous spells never require packets so don't rely on the requiresPacket method to specify it + if (!spell.isContinuous && spell.requiresPacket()) { + // Sends a packet to all players in dimension to tell them to spawn particles. + IMessage msg = new PacketCastSpell.Message(caster.getEntityId(), hand, spell, modifiers); + WizardryPacketHandler.net.sendToDimension(msg, world.provider.getDimension()); + } + } + return true; + } + return false; + } + + @Nonnull + @Override + public Spell getCurrentSpell(ItemStack stack) { + return Spells.shield; + } + + @Override + public boolean showSpellHUD(EntityPlayer player, ItemStack stack) { + return false; + } + + @Override + public boolean canCast(ItemStack stack, Spell spell, EntityPlayer caster, EnumHand hand, int castingTick, SpellModifiers modifiers) { + //unused + return true; + } + + @Override + public Multimap getItemAttributeModifiers(EntityEquipmentSlot slot) { + Multimap multimap = super.getItemAttributeModifiers(slot); + if (slot == EntityEquipmentSlot.OFFHAND) + { + multimap.put(SharedMonsterAttributes.ARMOR.getName(), new AttributeModifier(SHIELD_ARMOR_BONUS, "Armor modifier", Settings.generalSettings.runic_shield_armor, 0)); + //multimap.put(SharedMonsterAttributes.ARMOR.getName(), new AttributeModifier(SHIELD_ARMOR_PERCENT_BONUS, "Armor modifier", 0.2, 1)); + multimap.put(SharedMonsterAttributes.ARMOR_TOUGHNESS.getName(), new AttributeModifier(SHIELD_TOUGHNESS_BONUS, "Armor toughness", Settings.generalSettings.runic_shield_armor_toughness, 0)); + //multimap.put(SharedMonsterAttributes.ARMOR_TOUGHNESS.getName(), new AttributeModifier(ARMOR_MODIFIERS[equipmentSlot.getIndex()], "Armor toughness", (double)this.toughness, 0)); + } + + return multimap; + } + + + @Override + public void onUpdate(ItemStack stack, World world, Entity entity, int itemSlot, boolean isSelected) { + super.onUpdate(stack, world, entity, itemSlot, isSelected); + + if (entity instanceof EntityPlayer && isBattlemage((EntityPlayer) entity)) { + + EntityPlayer player = (EntityPlayer) entity; + + if (!ItemStack.areItemStacksEqual(player.getHeldItemOffhand(), stack)) { + return; + } + + if (stack.getItem() instanceof ItemBattlemageShield && stack.hasTagCompound()) { + NBTTagCompound nbt = stack.getTagCompound(); + if (nbt.hasKey("Items")) { + int count = stack.getTagCompound().getTagList("Items", 10).tagCount(); + + for (int i = 0; i < count; i++) { + tickArtefact(new ItemStack(stack.getTagCompound().getTagList("Items", 10).getCompoundTagAt(i)), player); + } + } + } + + if (!world.isRemote && !this.isManaFull(stack) && world.getTotalWorldTime() % 50L == 0L) { + this.rechargeMana(stack, WandHelper.getUpgradeLevel(stack, WizardryItems.condenser_upgrade)); + } + + if (!world.isRemote && player.getCooldownTracker().hasCooldown(stack.getItem()) && ItemArtefact.isArtefactActive(player, ASItems.charm_glyph_shield_disable)) { + player.getCooldownTracker().removeCooldown(this); + } + } + + } + + public static List getArtefacts(ItemStack shield) { + List artefacts = new ArrayList<>(); + if (shield.getItem() instanceof ItemBattlemageShield && shield.hasTagCompound()) { + NBTTagCompound nbt = shield.getTagCompound(); + if (nbt.hasKey("Items")) { + int count = shield.getTagCompound().getTagList("Items", 10).tagCount(); + + for (int i = 0; i < count; i++) { + artefacts.add(new ItemStack(shield.getTagCompound().getTagList("Items", 10).getCompoundTagAt(i))); + } + } + } + return artefacts; + } + + public void tickArtefact(ItemStack stack, EntityPlayer player) { + if (stack.getItem() instanceof ITickableArtefact) { + ((ITickableArtefact) stack.getItem()).onWornTick(stack, player); + } + } + + @Override + public boolean isEnchantable(ItemStack stack) { + return false; + } + + public int getItemEnchantability() { + return 0; + } + + @Override + public boolean isBookEnchantable(ItemStack stack, ItemStack book) { + return false; + } + + /** + * Return whether this item is repairable in an anvil. + */ + public boolean getIsRepairable(ItemStack toRepair, ItemStack repair) { + return false; + } + + @Override + public boolean isShield(ItemStack stack, @Nullable EntityLivingBase entity) { + return true; + } + + @Override + public int getSlotCount() { + return 3; + } + + @Override + public boolean hasGUI() { + return true; + } + + @Override + public int getRowCount() { + return 1; + } + + @Override + public int getColumnCount() { + return 3; + } + + @Override + public boolean isItemValid(Item item) { + return false; + } +} diff --git a/src/main/java/com/windanesz/ancientspellcraft/item/ItemBattlemageSword.java b/src/main/java/com/windanesz/ancientspellcraft/item/ItemBattlemageSword.java index 7817742c..c6a32d4f 100644 --- a/src/main/java/com/windanesz/ancientspellcraft/item/ItemBattlemageSword.java +++ b/src/main/java/com/windanesz/ancientspellcraft/item/ItemBattlemageSword.java @@ -24,6 +24,7 @@ import electroblob.wizardry.item.IManaStoringItem; import electroblob.wizardry.item.ISpellCastingItem; import electroblob.wizardry.item.IWorkbenchItem; +import electroblob.wizardry.item.ItemArtefact; import electroblob.wizardry.item.ItemWand; import electroblob.wizardry.item.ItemWizardArmour; import electroblob.wizardry.packet.PacketCastSpell; @@ -91,7 +92,7 @@ /** * Monster-sized class that holds all the Spell Blade related code. Brace yourselves. - * + *

* Author WinDanesez */ @Mod.EventBusSubscriber @@ -194,20 +195,18 @@ public void onUpdate(ItemStack stack, World world, Entity entity, int slot, bool ItemStack offhand = entityLiving.getHeldItemOffhand(); - if (offhand.getItem() instanceof ItemWand && !((ItemWand) offhand.getItem()).isManaEmpty(offhand)) { + if ((offhand.getItem() instanceof ItemWand || offhand.getItem() instanceof ItemBattlemageShield) && !((IManaStoringItem) offhand.getItem()).isManaEmpty(offhand)) { powered = true; } element = WizardArmourUtils.getFullSetElementForClass(entityLiving, ItemWizardArmour.ArmourClass.BATTLEMAGE); - if (element == null) - element = Element.MAGIC; + if (element == null) {element = Element.MAGIC;} // Triggering the elemental effect of this sword each tick EnumElementalSwordEffect.onUpdate(element, stack, world, entityLiving, slot, true); } - if (element == null) - element = Element.MAGIC; + if (element == null) {element = Element.MAGIC;} // setting the current element type, each tick if (element != null) { @@ -228,20 +227,14 @@ public void onUpdate(ItemStack stack, World world, Entity entity, int slot, bool // update glyph data if (entity.ticksExisted % 15 == 0 && entity instanceof EntityPlayer) { List glyphs = new ArrayList<>(); - - for (Item item : ItemGlyphArtefact.getActiveArtefacts((EntityPlayer) entity)) { - if (item instanceof ItemGlyphArtefact) { - String name = item.getRegistryName().toString(); - if (!glyphs.contains(name)) { - glyphs.add(name); - - // custom logic - if (item == ASItems.charm_glyph_antigravity && ((EntityPlayer) entity).getHeldItemMainhand().getItem() instanceof ItemBattlemageSword) { - ((EntityPlayer) entity).addPotionEffect(new PotionEffect(MobEffects.JUMP_BOOST, 40,0)); - ((EntityPlayer) entity).addPotionEffect(new PotionEffect(MobEffects.SPEED, 40,0)); - } - } - } + EntityPlayer player = (EntityPlayer) entity; + if ((player.getHeldItemMainhand().getItem() instanceof ItemBattlemageSword && ItemArtefact.isArtefactActive(player, ASItems.charm_glyph_antigravity))) { + player.addPotionEffect(new PotionEffect(MobEffects.JUMP_BOOST, 40, 0)); + player.addPotionEffect(new PotionEffect(MobEffects.SPEED, 40, 0)); + glyphs.add(ASItems.charm_glyph_antigravity.getRegistryName().toString()); + } + if ((player.getHeldItemMainhand().getItem() instanceof ItemBattlemageSword && ItemArtefact.isArtefactActive(player, ASItems.charm_glyph_might))) { + glyphs.add(ASItems.charm_glyph_might.getRegistryName().toString()); } if (!glyphs.isEmpty()) { @@ -250,9 +243,11 @@ public void onUpdate(ItemStack stack, World world, Entity entity, int slot, bool list.appendTag(new NBTTagString(s)); } compound.setTag("active_glyphs", list); + } else { + compound.removeTag("active_glyphs"); } - } + } stack.setTagCompound(compound); } } @@ -317,7 +312,6 @@ public Multimap getAttributeModifiers(EntityEquipment Spell[] spells = getSpells(stack); - // Arrays.stream(spells).(s -> (s instanceof Runeword && ((Runeword) s).isAffectingAttributes())); for (Spell spell : spells) { if (spell instanceof Runeword && ((Runeword) spell).isAffectingAttributes()) { @@ -341,10 +335,12 @@ public Multimap getAttributeModifiers(EntityEquipment Iterator iterator = stack.getTagCompound().getTagList("active_glyphs", net.minecraftforge.common.util.Constants.NBT.TAG_STRING).iterator(); while (iterator.hasNext()) { String glyph = ((NBTTagString) iterator.next()).getString(); - if (glyph.equals("ancientspellcraft:charm_glyph_antigravity")) { + if (glyph.equals(ASItems.charm_glyph_antigravity.getRegistryName().toString())) { damage *= 0.7; -// multimap.put(SharedMonsterAttributes.MOVEMENT_SPEED.getName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", -// 0.15f, net.minecraftforge.common.util.Constants.AttributeModifierOperation.ADD_MULTIPLE)); + // multimap.put(SharedMonsterAttributes.MOVEMENT_SPEED.getName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", + // 0.15f, net.minecraftforge.common.util.Constants.AttributeModifierOperation.ADD_MULTIPLE)); + } else if (glyph.equals(ASItems.charm_glyph_might.getRegistryName().toString())) { + damage *= 1.2; } } @@ -429,14 +425,14 @@ public boolean hitEntity(ItemStack stack, EntityLivingBase target, EntityLivingB @Override public boolean canContinueUsing(ItemStack oldStack, ItemStack newStack) { // Ignore durability changes - if (ItemStack.areItemsEqualIgnoreDurability(oldStack, newStack)) { return true; } + if (ItemStack.areItemsEqualIgnoreDurability(oldStack, newStack)) {return true;} return super.canContinueUsing(oldStack, newStack); } @Override public boolean shouldCauseBlockBreakReset(ItemStack oldStack, ItemStack newStack) { // Ignore durability changes - if (ItemStack.areItemsEqualIgnoreDurability(oldStack, newStack)) { return false; } + if (ItemStack.areItemsEqualIgnoreDurability(oldStack, newStack)) {return false;} return super.shouldCauseBlockBreakReset(oldStack, newStack); } @@ -449,7 +445,7 @@ public boolean shouldCauseReequipAnimation(ItemStack oldStack, ItemStack newStac // We only care about the situation where we specifically want the animation NOT to play. if (!oldStack.isEmpty() || !newStack.isEmpty() && oldStack.getItem() == newStack.getItem() && !slotChanged && oldStack.getItem() instanceof ItemBattlemageSword - && newStack.getItem() instanceof ItemBattlemageSword) { return false; } + && newStack.getItem() instanceof ItemBattlemageSword) {return false;} return super.shouldCauseReequipAnimation(oldStack, newStack, slotChanged); } @@ -459,7 +455,7 @@ public boolean shouldCauseReequipAnimation(ItemStack oldStack, ItemStack newStac public void addInformation(ItemStack stack, World world, List text, net.minecraft.client.util.ITooltipFlag advanced) { EntityPlayer player = net.minecraft.client.Minecraft.getMinecraft().player; - if (player == null) { return; } + if (player == null) {return;} text.add(Wizardry.proxy.translate("item.ancientspellcraft:battlemage_sword_armour_requirements_tooltip")); @@ -495,9 +491,9 @@ public void addInformation(ItemStack stack, World world, List text, net. } else { Optional otherSource = WizardClassWeaponHelper.getManaSourceFromOtherHand(stack, player); if (otherSource.isPresent()) { - otherSource.ifPresent(itemStack -> text.add(Wizardry.proxy.translate("tooltip.ancientspellcraft:mana_with_eternal_source_name", - new Style().setColor(TextFormatting.BLUE), ((IManaStoringItem) otherSource.get().getItem()).getMana(itemStack), - ((IManaStoringItem) otherSource.get().getItem()).getManaCapacity(itemStack), itemStack.getDisplayName() + new Style().setColor(TextFormatting.BLUE).getFormattingCode()))); + otherSource.ifPresent(itemStack -> text.add(Wizardry.proxy.translate("tooltip.ancientspellcraft:mana_with_eternal_source_name", + new Style().setColor(TextFormatting.BLUE), ((IManaStoringItem) otherSource.get().getItem()).getMana(itemStack), + ((IManaStoringItem) otherSource.get().getItem()).getManaCapacity(itemStack), itemStack.getDisplayName() + new Style().setColor(TextFormatting.BLUE).getFormattingCode()))); } else { text.add(Wizardry.proxy.translate("tooltip.ancientspellcraft:no_mana_source", new Style().setColor(TextFormatting.RED))); } @@ -549,28 +545,36 @@ public ActionResult onItemRightClick(World world, EntityPlayer player ItemStack stack = player.getHeldItem(hand); // Alternate right-click function; overrides spell casting. - if (WizardClassWeaponHelper.selectMinionTarget(player, world)) { return new ActionResult<>(EnumActionResult.SUCCESS, stack); } + if (WizardClassWeaponHelper.selectMinionTarget(player, world)) {return new ActionResult<>(EnumActionResult.SUCCESS, stack);} - Spell spell = WandHelper.getCurrentSpell(stack); - SpellModifiers modifiers = this.calculateModifiers(stack, player, spell); + if (!(player.getHeldItemOffhand().getItem() instanceof ItemBattlemageShield && !player.isSneaking())) { - if (canCast(stack, spell, player, hand, 0, modifiers)) { - // Need to account for the modifier since it could be zero even if the original charge-up wasn't - int chargeup = (int) (spell.getChargeup() * modifiers.get(SpellModifiers.CHARGEUP)); + Spell spell = WandHelper.getCurrentSpell(stack); - if (spell.isContinuous || chargeup > 0) { - // Spells that need the mouse to be held (continuous, charge-up or both) - if (!player.isHandActive()) { - player.setActiveHand(hand); - // Store the modifiers for use later - if (WizardData.get(player) != null) { WizardData.get(player).itemCastingModifiers = modifiers; } - if (chargeup > 0 && world.isRemote) { Wizardry.proxy.playChargeupSound(player); } - return new ActionResult<>(EnumActionResult.SUCCESS, stack); - } - } else { - // All other (instant) spells - if (cast(stack, spell, player, hand, 0, modifiers)) { - return new ActionResult<>(EnumActionResult.SUCCESS, stack); + // if (spell == ASSpells.runeword_meditate && player.getHeldItemOffhand().getItem() instanceof ItemBattlemageShield) { + // ((IManaStoringItem) player.getHeldItemOffhand().getItem()).rechargeMana(player.getHeldItemOffhand(), 1); + // } + + SpellModifiers modifiers = this.calculateModifiers(stack, player, spell); + + if (canCast(stack, spell, player, hand, 0, modifiers)) { + // Need to account for the modifier since it could be zero even if the original charge-up wasn't + int chargeup = (int) (spell.getChargeup() * modifiers.get(SpellModifiers.CHARGEUP)); + + if (spell.isContinuous || chargeup > 0) { + // Spells that need the mouse to be held (continuous, charge-up or both) + if (!player.isHandActive()) { + player.setActiveHand(hand); + // Store the modifiers for use later + if (WizardData.get(player) != null) {WizardData.get(player).itemCastingModifiers = modifiers;} + if (chargeup > 0 && world.isRemote) {Wizardry.proxy.playChargeupSound(player);} + return new ActionResult<>(EnumActionResult.SUCCESS, stack); + } + } else { + // All other (instant) spells + if (cast(stack, spell, player, hand, 0, modifiers)) { + return new ActionResult<>(EnumActionResult.SUCCESS, stack); + } } } } @@ -578,48 +582,46 @@ public ActionResult onItemRightClick(World world, EntityPlayer player return new ActionResult<>(EnumActionResult.FAIL, stack); } - - // For continuous spells and spells with a charge-up time. The count argument actually decrements by 1 each tick. // N.B. The first time this gets called is the tick AFTER onItemRightClick is called, not the same tick @Override - public void onUsingTick(ItemStack stack, EntityLivingBase user, int count){ + public void onUsingTick(ItemStack stack, EntityLivingBase user, int count) { - if(user instanceof EntityPlayer){ + if (user instanceof EntityPlayer) { - EntityPlayer player = (EntityPlayer)user; + EntityPlayer player = (EntityPlayer) user; Spell spell = WandHelper.getCurrentSpell(stack); SpellModifiers modifiers; - if(WizardData.get(player) != null){ + if (WizardData.get(player) != null) { modifiers = WizardData.get(player).itemCastingModifiers; - }else{ - modifiers = this.calculateModifiers(stack, (EntityPlayer)user, spell); // Fallback to the old way, should never be used + } else { + modifiers = this.calculateModifiers(stack, (EntityPlayer) user, spell); // Fallback to the old way, should never be used } int useTick = stack.getMaxItemUseDuration() - count; - int chargeup = (int)(spell.getChargeup() * modifiers.get(SpellModifiers.CHARGEUP)); + int chargeup = (int) (spell.getChargeup() * modifiers.get(SpellModifiers.CHARGEUP)); - if(spell.isContinuous){ + if (spell.isContinuous) { // Continuous spell charge-up is simple, just don't do anything until it's charged - if(useTick >= chargeup){ + if (useTick >= chargeup) { // castingTick needs to be relative to when the spell actually started int castingTick = useTick - chargeup; // Continuous spells (these must check if they can be cast each tick since the mana changes) // Don't call canCast when castingTick == 0 because we already did it in onItemRightClick - even // with charge-up times, because we don't want to trigger events twice - if(castingTick == 0 || canCast(stack, spell, player, player.getActiveHand(), castingTick, modifiers)){ + if (castingTick == 0 || canCast(stack, spell, player, player.getActiveHand(), castingTick, modifiers)) { cast(stack, spell, player, player.getActiveHand(), castingTick, modifiers); - }else{ + } else { // Stops the casting if it was interrupted, either by events or because the wand ran out of mana player.stopActiveHand(); } } - }else{ + } else { // Non-continuous spells need to check they actually have a charge-up since ALL spells call setActiveHand - if(chargeup > 0 && useTick == chargeup){ + if (chargeup > 0 && useTick == chargeup) { // Once the spell is charged, it's exactly the same as in onItemRightClick cast(stack, spell, player, player.getActiveHand(), 0, modifiers); } @@ -680,19 +682,21 @@ public boolean canCast(ItemStack stack, Spell spell, EntityPlayer caster, EnumHa // Spells can only be cast if the casting events aren't cancelled... if (castingTick == 0) { - if (MinecraftForge.EVENT_BUS.post(new SpellCastEvent.Pre(AncientSpellcraft.BATTLEMAGE_ITEM, spell, caster, modifiers))) { return false; } + if (MinecraftForge.EVENT_BUS.post(new SpellCastEvent.Pre(AncientSpellcraft.BATTLEMAGE_ITEM, spell, caster, modifiers))) {return false;} } else { - if (MinecraftForge.EVENT_BUS.post(new SpellCastEvent.Tick(AncientSpellcraft.BATTLEMAGE_ITEM, spell, caster, modifiers, castingTick))) { return false; } + if (MinecraftForge.EVENT_BUS.post(new SpellCastEvent.Tick(AncientSpellcraft.BATTLEMAGE_ITEM, spell, caster, modifiers, castingTick))) { + return false; + } } int cost = (int) (spell.getCost() * modifiers.get(SpellModifiers.COST) + 0.1f); // Weird floaty rounding // As of wizardry 4.2 mana cost is only divided over two intervals each second - if (spell.isContinuous) { cost = getDistributedCost(cost, castingTick); } + if (spell.isContinuous) {cost = getDistributedCost(cost, castingTick);} // ...and the wand has enough mana to cast the spell... -// if (hasManaStorage) + // if (hasManaStorage) boolean hasWandFromMana = cost <= this.getMana(stack, otherHand, caster) // This comes first because it changes over time // ...and the wand is the same tier as the spell or higher... && spell.getTier().level <= this.tier.level @@ -708,7 +712,7 @@ public boolean canCast(ItemStack stack, Spell spell, EntityPlayer caster, EnumHa boolean test = (cost <= mana // ...and the wand is the same tier as the spell or higher... && spell.getTier().level <= this.tier.level // ...and either the spell is not in cooldown or the player is in creative mode - && ( cooldown == 0 || caster.isCreative())); + && (cooldown == 0 || caster.isCreative())); return test; } } @@ -720,11 +724,11 @@ public boolean cast(ItemStack stack, Spell spell, EntityPlayer caster, EnumHand World world = caster.world; - if (world.isRemote && !spell.isContinuous && spell.requiresPacket()) { return false; } + if (world.isRemote && !spell.isContinuous && spell.requiresPacket()) {return false;} if (spell.cast(world, caster, hand, castingTick, modifiers)) { - if (castingTick == 0) { MinecraftForge.EVENT_BUS.post(new SpellCastEvent.Post(AncientSpellcraft.BATTLEMAGE_ITEM, spell, caster, modifiers)); } + if (castingTick == 0) {MinecraftForge.EVENT_BUS.post(new SpellCastEvent.Post(AncientSpellcraft.BATTLEMAGE_ITEM, spell, caster, modifiers));} if (!world.isRemote) { @@ -738,7 +742,7 @@ public boolean cast(ItemStack stack, Spell spell, EntityPlayer caster, EnumHand // Mana cost int cost = (int) (spell.getCost() * modifiers.get(SpellModifiers.COST) + 0.1f); // Weird floaty rounding // As of wizardry 4.2 mana cost is only divided over two intervals each second - if (spell.isContinuous) { cost = getDistributedCost(cost, castingTick); } + if (spell.isContinuous) {cost = getDistributedCost(cost, castingTick);} if (cost > 0) { // wand @@ -856,7 +860,6 @@ public static HashMap getTemporaryRunewordData(ItemSta return map; } - public static void setTemporaryRuneWordData(ItemStack sword, Runeword runeword, NBTTagCompound data) { // get the existing stuff HashMap map = getTemporaryRunewordData(sword); @@ -1014,8 +1017,8 @@ public boolean onApplyButtonPressed(EntityPlayer player, Slot centre, Slot cryst int chargeDepleted = this.getManaCapacity(centre.getStack()) - this.getMana(centre.getStack()); int manaPerItem = Constants.MANA_PER_CRYSTAL; - if (crystals.getStack().getItem() == WizardryItems.crystal_shard) { manaPerItem = Constants.MANA_PER_SHARD; } - if (crystals.getStack().getItem() == WizardryItems.grand_crystal) { manaPerItem = Constants.GRAND_CRYSTAL_MANA; } + if (crystals.getStack().getItem() == WizardryItems.crystal_shard) {manaPerItem = Constants.MANA_PER_SHARD;} + if (crystals.getStack().getItem() == WizardryItems.grand_crystal) {manaPerItem = Constants.GRAND_CRYSTAL_MANA;} if (crystals.getStack().getCount() * manaPerItem < chargeDepleted) { // If there aren't enough crystals to fully charge the wand @@ -1042,12 +1045,12 @@ public boolean onApplyButtonPressed(EntityPlayer player, Slot centre, Slot cryst * @return True if the workbench tooltip should be shown, false if not. */ @Override - public boolean showTooltip(ItemStack stack) { return true; } + public boolean showTooltip(ItemStack stack) {return true;} //-------------------------- IManaStoringItem implementation --------------------------// @Override - public int getMana(ItemStack stack) { return getManaCapacity(stack) - getDamage(stack); } + public int getMana(ItemStack stack) {return getManaCapacity(stack) - getDamage(stack);} @Override public void setMana(ItemStack stack, int mana) { @@ -1104,16 +1107,16 @@ public SpellModifiers calculateModifiers(ItemStack stack, EntityPlayer player, S // Now we only need to add multipliers if they are not 1. int level = WandHelper.getUpgradeLevel(stack, WizardryItems.range_upgrade); - if (level > 0) { modifiers.set(WizardryItems.range_upgrade, 1.0f + level * Constants.RANGE_INCREASE_PER_LEVEL, true); } + if (level > 0) {modifiers.set(WizardryItems.range_upgrade, 1.0f + level * Constants.RANGE_INCREASE_PER_LEVEL, true);} level = WandHelper.getUpgradeLevel(stack, WizardryItems.duration_upgrade); - if (level > 0) { modifiers.set(WizardryItems.duration_upgrade, 1.0f + level * Constants.DURATION_INCREASE_PER_LEVEL, false); } + if (level > 0) {modifiers.set(WizardryItems.duration_upgrade, 1.0f + level * Constants.DURATION_INCREASE_PER_LEVEL, false);} level = WandHelper.getUpgradeLevel(stack, WizardryItems.blast_upgrade); - if (level > 0) { modifiers.set(WizardryItems.blast_upgrade, 1.0f + level * Constants.BLAST_RADIUS_INCREASE_PER_LEVEL, true); } + if (level > 0) {modifiers.set(WizardryItems.blast_upgrade, 1.0f + level * Constants.BLAST_RADIUS_INCREASE_PER_LEVEL, true);} level = WandHelper.getUpgradeLevel(stack, WizardryItems.cooldown_upgrade); - if (level > 0) { modifiers.set(WizardryItems.cooldown_upgrade, 1.0f - level * Constants.COOLDOWN_REDUCTION_PER_LEVEL, true); } + if (level > 0) {modifiers.set(WizardryItems.cooldown_upgrade, 1.0f - level * Constants.COOLDOWN_REDUCTION_PER_LEVEL, true);} //// float progressionModifier = 1.0f - ((float) WizardData.get(player).countRecentCasts(spell) / WizardData.MAX_RECENT_SPELLS) //// * MAX_PROGRESSION_REDUCTION; @@ -1178,11 +1181,12 @@ protected static int getDistributedCost(int cost, int castingTick) { /** * Gets the battlemage sword of the specificed tier + * * @param tier to check * @return item of the tier */ public static Item getSwordForTier(Tier tier) { - if (tier == null) { throw new NullPointerException("The given tier cannot be null."); } + if (tier == null) {throw new NullPointerException("The given tier cannot be null.");} if (tier == Tier.NOVICE) { return ASItems.battlemage_sword_novice; @@ -1323,7 +1327,7 @@ public static void onLivingHurtEvent(LivingHurtEvent event) { ItemStack sword = player.getHeldItemMainhand(); // Can't melee with offhand items if (sword.getItem() instanceof ItemBattlemageSword) { HashMap map = getActiveRunewords(sword); - for (Map.Entry entry: map.entrySet()) { + for (Map.Entry entry : map.entrySet()) { if (entry.getKey().isAffectingDamageDirectly()) { event.setAmount(entry.getKey().affectDamage(event.getSource(), event.getAmount(), player, event.getEntityLiving(), sword)); } diff --git a/src/main/java/com/windanesz/ancientspellcraft/item/ItemGlyphArtefact.java b/src/main/java/com/windanesz/ancientspellcraft/item/ItemGlyphArtefact.java index a0e7e83f..1076ec71 100644 --- a/src/main/java/com/windanesz/ancientspellcraft/item/ItemGlyphArtefact.java +++ b/src/main/java/com/windanesz/ancientspellcraft/item/ItemGlyphArtefact.java @@ -1,7 +1,9 @@ package com.windanesz.ancientspellcraft.item; import electroblob.wizardry.block.BlockThorns; +import electroblob.wizardry.item.IManaStoringItem; import electroblob.wizardry.item.ItemArtefact; +import electroblob.wizardry.item.ItemWizardArmour; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.MobEffects; @@ -28,7 +30,7 @@ public ItemGlyphViality(EnumRarity rarity, Type type) { @Override public void onWornTick(ItemStack itemstack, EntityLivingBase player) { - if (player.ticksExisted % 140 == 0 && player.getHealth() < player.getMaxHealth()) { + if (player.ticksExisted % 80 == 0 && player.getHealth() < player.getMaxHealth()) { player.heal(0.5f); } } @@ -50,4 +52,23 @@ public void onWornTick(ItemStack itemstack, EntityLivingBase player) { } } + public static class ItemGlyphFortification extends ItemGlyphArtefact implements ITickableArtefact { + + public ItemGlyphFortification(EnumRarity rarity, Type type) { + super(rarity, type); + } + + @Override + public void onWornTick(ItemStack itemstack, EntityLivingBase player) { + if (player.ticksExisted % 60 == 0) { + for(ItemStack stack : player.getArmorInventoryList()){ + // IManaStoringItem is sufficient, since anything in the armour slots is probably armour + if (stack.getItem() instanceof ItemWizardArmour && ((ItemWizardArmour) stack.getItem()).armourClass == ItemWizardArmour.ArmourClass.BATTLEMAGE) { + ((IManaStoringItem) stack.getItem()).rechargeMana(stack, 1); + } + } + } + } + } + } diff --git a/src/main/java/com/windanesz/ancientspellcraft/item/ItemGlyphAuraArtefact.java b/src/main/java/com/windanesz/ancientspellcraft/item/ItemGlyphAuraArtefact.java new file mode 100644 index 00000000..a74ec53d --- /dev/null +++ b/src/main/java/com/windanesz/ancientspellcraft/item/ItemGlyphAuraArtefact.java @@ -0,0 +1,86 @@ +package com.windanesz.ancientspellcraft.item; + +import com.windanesz.ancientspellcraft.registry.ASItems; +import com.windanesz.ancientspellcraft.util.WizardArmourUtils; +import electroblob.wizardry.item.ItemWizardArmour; +import electroblob.wizardry.registry.WizardryPotions; +import electroblob.wizardry.util.AllyDesignationSystem; +import electroblob.wizardry.util.EntityUtils; +import electroblob.wizardry.util.MagicDamage; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.passive.EntityAnimal; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.MobEffects; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; + +import java.util.List; +import java.util.function.Predicate; +import java.util.stream.Collectors; + +public class ItemGlyphAuraArtefact extends ItemGlyphArtefact implements ITickableArtefact { + public ItemGlyphAuraArtefact(EnumRarity rarity, Type type) { + super(rarity, type); + } + + @Override + public void onWornTick(ItemStack itemstack, EntityLivingBase wearingEntity) { + if (wearingEntity instanceof EntityPlayer && !wearingEntity.world.isRemote && wearingEntity.ticksExisted % 10 == 0) { + + EntityPlayer player = (EntityPlayer) wearingEntity; + + if (WizardArmourUtils.isWearingFullSet(player, null, ItemWizardArmour.ArmourClass.BATTLEMAGE)) { + + if (this == ASItems.charm_aura_alacrity) { + getNearbyAllies(wearingEntity).forEach(e -> applyPotionIfNotActive(player, e, MobEffects.SPEED, 60, 0, false)); + applyPotionIfNotActive(player, player, MobEffects.SPEED, 60, 0, false); + } else if (this == ASItems.charm_aura_hatred) { + getNearbyAllies(wearingEntity).stream().filter(EntityLivingBase::isEntityUndead).forEach(e -> applyPotionIfNotActive(player, e, MobEffects.STRENGTH, 60, 0, false)); + } else if (this == ASItems.charm_aura_life) { + getNearbyAllies(wearingEntity).forEach(e -> e.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 60, 0))); + applyPotionIfNotActive(player, player, MobEffects.REGENERATION, 60, 0, false); + } else if (this == ASItems.charm_aura_purity) { + getNearbyEnemies(wearingEntity).stream().filter(EntityLivingBase::isEntityUndead).forEach(e -> applyPotionIfNotActive(player, e, MobEffects.SLOWNESS, 60, 0, false)); + getNearbyEnemies(wearingEntity).stream().filter(EntityLivingBase::isEntityUndead).forEach(e -> applyPotionIfNotActive(player, e, MobEffects.WEAKNESS, 60, 0, false)); + } else if (this == ASItems.charm_aura_warding) { + getNearbyAllies(wearingEntity).forEach(e -> applyPotionIfNotActive(player, e, WizardryPotions.ward, 60, 0, false)); + applyPotionIfNotActive(player, player, WizardryPotions.ward, 60, 1, false); + } else if (this == ASItems.charm_aura_wither) { + getNearbyEnemies(wearingEntity).forEach(e -> applyPotionIfNotActive(player, e, MobEffects.WITHER, 60, 0, true)); + } + } + } + + } + + public static List getNearbyAllies(EntityLivingBase player) { + List entitiesWithinRadius = EntityUtils.getEntitiesWithinRadius(10, player.posX, player.posY, player.posZ, player.world, EntityLivingBase.class); + return entitiesWithinRadius.stream().filter(e -> e != player).filter(e -> AllyDesignationSystem.isAllied(player, e)).collect(Collectors.toList()); + } + + public static void applyPotionIfNotActive(EntityPlayer player, EntityLivingBase entity, Potion potion, int duration, int amplifier, boolean damaging) { + //noinspection DataFlowIssue + if (!entity.isPotionActive(potion) || entity.getActivePotionEffect(potion).getAmplifier() < amplifier) { + if (damaging && entity.getRevengeTarget() != player) { + EntityUtils.attackEntityWithoutKnockback(entity, MagicDamage.causeDirectMagicDamage(player, MagicDamage.DamageType.MAGIC), 0.01f); + } + entity.addPotionEffect(new PotionEffect(potion, duration, amplifier)); + } + } + + public static List getNearbyEnemies(EntityLivingBase player) { + List entitiesWithinRadius = EntityUtils.getEntitiesWithinRadius(10, player.posX, player.posY, player.posZ, player.world, EntityLivingBase.class); + return entitiesWithinRadius.stream() + .filter(e -> e != player) + .filter(not(e -> e instanceof EntityAnimal)) + .filter(e -> !AllyDesignationSystem.isAllied(player, e)) + .collect(Collectors.toList()); + } + + public static Predicate not(Predicate predicate) { + return predicate.negate(); + } + +} diff --git a/src/main/java/com/windanesz/ancientspellcraft/item/ItemGlyphOfIllumination.java b/src/main/java/com/windanesz/ancientspellcraft/item/ItemGlyphOfIllumination.java index 3acb9aad..d73fb9a4 100644 --- a/src/main/java/com/windanesz/ancientspellcraft/item/ItemGlyphOfIllumination.java +++ b/src/main/java/com/windanesz/ancientspellcraft/item/ItemGlyphOfIllumination.java @@ -12,8 +12,10 @@ public ItemGlyphOfIllumination(EnumRarity rarity, Type type) { } public void onWornTick(ItemStack itemstack, EntityLivingBase player) { - if (player.getHeldItemMainhand().getItem() instanceof ItemBattlemageSword && player.world.isAirBlock(player.getPosition().up())) { - player.world.setBlockState(player.getPosition().up(), ASBlocks.MAGELIGHT.getDefaultState()); + if (!player.world.isRemote && (player.getHeldItemOffhand().getItem() instanceof ItemBattlemageShield || player.getHeldItemMainhand().getItem() instanceof ItemBattlemageSword && player.world.isAirBlock(player.getPosition().up()))) { + if (!player.world.getBlockState(player.getPosition().up()).equals(ASBlocks.MAGELIGHT.getDefaultState())) { + player.world.setBlockState(player.getPosition().up(), ASBlocks.MAGELIGHT.getDefaultState()); + } } } } diff --git a/src/main/java/com/windanesz/ancientspellcraft/potion/PotionTenacity.java b/src/main/java/com/windanesz/ancientspellcraft/potion/PotionTenacity.java new file mode 100644 index 00000000..10a40f48 --- /dev/null +++ b/src/main/java/com/windanesz/ancientspellcraft/potion/PotionTenacity.java @@ -0,0 +1,64 @@ +package com.windanesz.ancientspellcraft.potion; + +import com.windanesz.ancientspellcraft.AncientSpellcraft; +import com.windanesz.ancientspellcraft.registry.ASPotions; +import electroblob.wizardry.potion.PotionMagicEffect; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.event.entity.living.LivingDamageEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +import java.util.List; +import java.util.stream.Collectors; + +public class PotionTenacity extends PotionMagicEffect { + + private static int MAX_AIR_AMOUNT = 300; + + public PotionTenacity() { + + super(false, 0xE6E6FF, new ResourceLocation(AncientSpellcraft.MODID, "textures/gui/potion_icon_tenacity.png")); + this.setPotionName("potion." + AncientSpellcraft.MODID + ":tenacity"); + this.setBeneficial(); + } + + @Override + public boolean isReady(int duration, int amplifier) { + return true; + } + + // Halves the current duration of the marked potion effect + @Override + public void performEffect(EntityLivingBase entitylivingbase, int strength) { +// if (entitylivingbase.world.getTotalWorldTime() % 5 == 0) { +// String prefix = "TenacityShouldReduceDuration_"; +// List potionRegistryNameList = entitylivingbase.getTags() +// .stream() +// .filter(s -> s.matches("TenacityShouldReduceDuration_.*")) +// .map(s -> s.substring(prefix.length())) +// .collect(Collectors.toList()); +// +// for (String effectName : potionRegistryNameList) { +// Potion potion = Potion.getPotionFromResourceLocation(effectName); +// +// if (potion != null) { +// PotionEffect effect = entitylivingbase.getActivePotionEffect(potion); +// if (effect != null) { +// int newDuration = effect.getDuration() / 2; +// if (newDuration > 0) { +// entitylivingbase.addPotionEffect(new PotionEffect(potion, newDuration, effect.getAmplifier(), effect.getIsAmbient(), effect.doesShowParticles())); +// } else { +// entitylivingbase.removePotionEffect(potion); +// } +// } +// } +// // entitylivingbase.removeTag(prefix + effectName); +// } +// } + } + +} + + diff --git a/src/main/java/com/windanesz/ancientspellcraft/registry/ASItems.java b/src/main/java/com/windanesz/ancientspellcraft/registry/ASItems.java index a8d6f16e..f7d6669c 100644 --- a/src/main/java/com/windanesz/ancientspellcraft/registry/ASItems.java +++ b/src/main/java/com/windanesz/ancientspellcraft/registry/ASItems.java @@ -13,6 +13,7 @@ import com.windanesz.ancientspellcraft.item.ItemAncientHat; import com.windanesz.ancientspellcraft.item.ItemArmourUpgradeMaterial; import com.windanesz.ancientspellcraft.item.ItemBarterScroll; +import com.windanesz.ancientspellcraft.item.ItemBattlemageShield; import com.windanesz.ancientspellcraft.item.ItemBattlemageSword; import com.windanesz.ancientspellcraft.item.ItemBeltScrollHolder; import com.windanesz.ancientspellcraft.item.ItemBlockDevoritiumMaterial; @@ -41,6 +42,7 @@ import com.windanesz.ancientspellcraft.item.ItemEverfullManaFlask; import com.windanesz.ancientspellcraft.item.ItemEvergrowingCrystal; import com.windanesz.ancientspellcraft.item.ItemGlyphArtefact; +import com.windanesz.ancientspellcraft.item.ItemGlyphAuraArtefact; import com.windanesz.ancientspellcraft.item.ItemGlyphOfIllumination; import com.windanesz.ancientspellcraft.item.ItemGoldBag; import com.windanesz.ancientspellcraft.item.ItemGuardianBlade; @@ -313,6 +315,7 @@ private ASItems() {} // No instances! public static final Item battlemage_sword_apprentice = placeholder(); public static final Item battlemage_sword_advanced = placeholder(); public static final Item battlemage_sword_master = placeholder(); + public static final Item battlemage_shield = placeholder(); public static final Item devoritium_chestplate = placeholder(); public static final Item master_bolt = placeholder(); @@ -415,9 +418,17 @@ private ASItems() {} // No instances! public static final Item charm_glyph_antigravity = placeholder(); public static final Item charm_glyph_vitality = placeholder(); public static final Item charm_glyph_warden = placeholder(); + public static final Item charm_glyph_fortification = placeholder(); public static final Item charm_glyph_imbuement = placeholder(); - - + public static final Item charm_glyph_shield_disable = placeholder(); + public static final Item charm_glyph_might = placeholder(); + public static final Item charm_aura_alacrity = placeholder(); + public static final Item charm_aura_hatred = placeholder(); + public static final Item charm_aura_life = placeholder(); + public static final Item charm_aura_purity = placeholder(); + public static final Item charm_aura_warding = placeholder(); + public static final Item charm_aura_wither = placeholder(); + public static final Item charm_aura_tenacity = placeholder(); // below registry methods are courtesy of EB public static void registerItem(IForgeRegistry registry, String name, Item item) { @@ -572,6 +583,7 @@ public EnumRarity getRarity(ItemStack stack) { registerItem(registry, "battlemage_sword_apprentice", new ItemBattlemageSword(Tier.APPRENTICE, 5)); registerItem(registry, "battlemage_sword_advanced", new ItemBattlemageSword(Tier.ADVANCED, 7)); registerItem(registry, "battlemage_sword_master", new ItemBattlemageSword(Tier.MASTER, 9)); + registerItem(registry, "battlemage_shield", new ItemBattlemageShield()); registerItem(registry, "devoritium_ingot", new ItemDevoritium()); registerItem(registry, "devoritium_nugget", new ItemDevoritium()); @@ -716,7 +728,20 @@ public void addInformation(ItemStack stack, @Nullable World worldIn, List event) { registerPotion(registry, "curse_of_umbra", new PotionCurseUmbra()); registerPotion(registry, "curse_of_gills", new PotionCurseGills()); + registerPotion(registry, "tenacity", new PotionTenacity()); // ---- Artemislib dependent potions ---- diff --git a/src/main/java/com/windanesz/ancientspellcraft/registry/ASSpells.java b/src/main/java/com/windanesz/ancientspellcraft/registry/ASSpells.java index 84643126..bad88f07 100644 --- a/src/main/java/com/windanesz/ancientspellcraft/registry/ASSpells.java +++ b/src/main/java/com/windanesz/ancientspellcraft/registry/ASSpells.java @@ -207,6 +207,7 @@ private ASSpells() {} // no instances public static final Spell runeword_restoration = placeholder(); public static final Spell runeword_arcane = placeholder(); public static final Spell runeword_disarm = placeholder(); + public static final Spell runeword_meditate = placeholder(); public static final Spell conjure_ink = placeholder(); public static final Spell vanish = placeholder(); @@ -486,6 +487,7 @@ public boolean applicableForItem(Item item) { registry.register(new RunewordRestoration()); registry.register(new RunewordArcane()); registry.register(new RunewordDisarm()); + registry.register(new RunewordMeditate()); registry.register(new TurnUndead()); registry.register(new RevealUndead()); registry.register(new Singe()); diff --git a/src/main/java/com/windanesz/ancientspellcraft/spell/RunewordMeditate.java b/src/main/java/com/windanesz/ancientspellcraft/spell/RunewordMeditate.java new file mode 100644 index 00000000..f774a48c --- /dev/null +++ b/src/main/java/com/windanesz/ancientspellcraft/spell/RunewordMeditate.java @@ -0,0 +1,45 @@ +package com.windanesz.ancientspellcraft.spell; + +import com.windanesz.ancientspellcraft.item.ItemBattlemageShield; +import com.windanesz.ancientspellcraft.registry.ASItems; +import com.windanesz.ancientspellcraft.util.ASUtils; +import electroblob.wizardry.item.IManaStoringItem; +import electroblob.wizardry.item.ItemArtefact; +import electroblob.wizardry.item.ItemWizardArmour; +import electroblob.wizardry.item.SpellActions; +import electroblob.wizardry.util.SpellModifiers; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.MobEffects; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EnumHand; +import net.minecraft.world.World; + +public class RunewordMeditate extends Runeword { + + public RunewordMeditate() { + super("runeword_meditate", SpellActions.IMBUE, true); + addProperties(); + } + + @Override + public boolean cast(World world, EntityPlayer caster, EnumHand hand, int ticksInUse, SpellModifiers modifiers) { + if (!caster.world.isRemote && caster.ticksExisted % 10 == 0) { + if (caster.getHeldItemOffhand().getItem() instanceof ItemBattlemageShield) { + ((IManaStoringItem) caster.getHeldItemOffhand().getItem()).rechargeMana(caster.getHeldItemOffhand(), 3); + + if (ItemArtefact.isArtefactActive(caster, ASItems.charm_glyph_fortification)) { + for(ItemStack stack : caster.getArmorInventoryList()){ + + if (stack.getItem() instanceof ItemWizardArmour && ((ItemWizardArmour) stack.getItem()).armourClass == ItemWizardArmour.ArmourClass.BATTLEMAGE) { + ((IManaStoringItem) stack.getItem()).rechargeMana(stack, 6); + } + } + } + } + } + return super.cast(world, caster, hand, ticksInUse, modifiers); + } +} diff --git a/src/main/resources/assets/ancientspellcraft/lang/en_us.lang b/src/main/resources/assets/ancientspellcraft/lang/en_us.lang index ffb414a1..39c0f68c 100644 --- a/src/main/resources/assets/ancientspellcraft/lang/en_us.lang +++ b/src/main/resources/assets/ancientspellcraft/lang/en_us.lang @@ -305,6 +305,8 @@ item.ancientspellcraft\:battlemage_sword_blade.name=Crystal Silver Blade item.ancientspellcraft\:battlemage_sword_hilt.name=Spell Sword Hilt item.ancientspellcraft\:battlemage_sword_master.name=Spell Blade item.ancientspellcraft\:battlemage_sword_novice.name=Spell Dagger +item.ancientspellcraft\:battlemage_shield.name=Runic Shield +item.ancientspellcraft\:battlemage_shield.desc=Requires a matching set of battlemage armor\nSneak-right click it in the mainhand to open its GUI to place charms item.ancientspellcraft\:belt.generic.desc=Equip this belt in the Baubles inventory or by placing it on your hotbar if you don't have Baubles. Only one belt may be equipped at a time. item.ancientspellcraft\:belt_enchanter.desc=Increases the duration of Buff spells by 20%% item.ancientspellcraft\:belt_enchanter.name=Belt of The Enchanter @@ -363,6 +365,8 @@ item.ancientspellcraft\:charm_glyph_antigravity.desc=Increases speed by 25%% and item.ancientspellcraft\:charm_glyph_antigravity.name=Glyph of Anti-Gravity item.ancientspellcraft\:charm_glyph_illumination.desc=The Spell Blade radiates with light, illuminating the nearby area item.ancientspellcraft\:charm_glyph_illumination.name=Glyph of Illumination +item.ancientspellcraft\:charm_glyph_might.desc=Increases the Spell Blade's attack damage by 20%% +item.ancientspellcraft\:charm_glyph_might.name=Glyph of Might item.ancientspellcraft\:charm_glyph_leeching.desc=Grants the Necromancy Spell Blade 30%% chance to steal positive buffs from the target on each empowered attack item.ancientspellcraft\:charm_glyph_leeching.name=Glyph of Leeching item.ancientspellcraft\:charm_glyph_vitality.desc=Increases the rate of natural health regeneration @@ -371,6 +375,24 @@ item.ancientspellcraft\:charm_glyph_warden.desc=Hiding inside your own thorn bus item.ancientspellcraft\:charm_glyph_warden.name=Glyph of the Warden item.ancientspellcraft\:charm_glyph_imbuement.desc=Runeword: Imbue lasts for 6x more hits with the Spell Blade item.ancientspellcraft\:charm_glyph_imbuement.name=Glyph of Alchemy +item.ancientspellcraft\:charm_glyph_fortification.desc=Slowly restores durability to battlemage armour. This effect is 6x more potent during Runeword: Meditate +item.ancientspellcraft\:charm_glyph_fortification.name=Glyph of Fortification + +item.ancientspellcraft\:charm_aura_alacrity.name=Glyph of Alacrity +item.ancientspellcraft\:charm_aura_alacrity.desc=Increases the movement speed of nearby allies and the battlemage\nOnly battlemages can use this +item.ancientspellcraft\:charm_aura_hatred.name=Glyph of Hatred +item.ancientspellcraft\:charm_aura_hatred.desc=Nearby allied undead gain Strength\nOnly battlemages can use this +item.ancientspellcraft\:charm_aura_life.name=Glyph of Life +item.ancientspellcraft\:charm_aura_life.desc=Grants regeneration to nearby allies and the battlemage\nOnly battlemages can use this +item.ancientspellcraft\:charm_aura_purity.name=Glyph of Purity +item.ancientspellcraft\:charm_aura_purity.desc=Nearby undeads are weakened and slowed\nOnly battlemages can use this +item.ancientspellcraft\:charm_aura_warding.name=Glyph of Warding +item.ancientspellcraft\:charm_aura_warding.desc=Increases the magic resistance of nearby allies and the battlemage\nOnly battlemages can use this +item.ancientspellcraft\:charm_aura_wither.name=Glyph of Death +item.ancientspellcraft\:charm_aura_wither.desc=Withers all nearby enemies\nOnly battlemages can use this +item.ancientspellcraft\:charm_aura_tenacity.name=Glyph of Tenacity +item.ancientspellcraft\:charm_aura_tenacity.desc=Halves the duration of harmful effects for nearby allies and the battlemage + item.ancientspellcraft\:charm_gold_bag.desc=This magically enhanced coin bag refills itself with 3-8 gold nuggets each day item.ancientspellcraft\:charm_gold_bag.empty=You search through the bag but it was empty.. item.ancientspellcraft\:charm_gold_bag.name=Everfull Bag of Gold @@ -762,6 +784,7 @@ potion.ancientspellcraft\:time_knot=Time Knot potion.ancientspellcraft\:unlimited_power=Unlimited Power potion.ancientspellcraft\:water_walking=Water Walking potion.ancientspellcraft\:wizard_shield=Wizard Shield +potion.ancientspellcraft\:tenacity=Tenacity # relic relic_type.enchantment.instruction=Hold the table in your main hand and an item in your other hand for 6 seconds to enchant it @@ -1212,10 +1235,12 @@ spell.ancientspellcraft\:runeword_empower.desc=Instantly charges the Spell Blade spell.ancientspellcraft\:runeword_empower=Runeword: Empower spell.ancientspellcraft\:runeword_restoration.desc=Draw power from the Spell Blade, restoring 10%% missing health. spell.ancientspellcraft\:runeword_restoration=Runeword: Restoration -spell.ancientspellcraft\:runeword_arcane.desc=Imbue the Spell Blade with arcane energy, causing your next hit to deal 70% weapon damage and bypass armour. +spell.ancientspellcraft\:runeword_arcane.desc=Imbue the Spell Blade with arcane energy, causing your next hit to deal 70%% weapon damage and bypass armour. spell.ancientspellcraft\:runeword_arcane=Runeword: Arcane spell.ancientspellcraft\:runeword_disarm.desc=The next attack with the Spell Blade will disable the targeted player's held items for 3 seconds. spell.ancientspellcraft\:runeword_disarm=Runeword: Disarm +spell.ancientspellcraft\:runeword_meditate.desc=Meditates to restore the energy of a Runic Shield in the offhand. Continuous spell. +spell.ancientspellcraft\:runeword_meditate=Runeword: Meditate # spell type spelltype.contingency=Contingency @@ -1464,3 +1489,6 @@ item.ancientspellcraft\:charm_wizard_ale.name=Keg of Legendary Ale item.ancientspellcraft\:charm_wizard_ale.desc=Travelling Wizards stay for a week instead of a day when you use a Scroll of Bartering item.ancientspellcraft\:belt_soul_scorch.name=Scorching Belt item.ancientspellcraft\:belt_soul_scorch.desc=Attackers receive the Soul Scorch effect or 3 seconds +item.ancientspellcraft\:charm_glyph_shield_disable.name=Glyph of Unyielding +item.ancientspellcraft\:charm_glyph_shield_disable.desc=The Runic Shield cannot be disabled by axes or any other means + diff --git a/src/main/resources/assets/ancientspellcraft/models/item/battlemage_shield.json b/src/main/resources/assets/ancientspellcraft/models/item/battlemage_shield.json new file mode 100644 index 00000000..3a3814ff --- /dev/null +++ b/src/main/resources/assets/ancientspellcraft/models/item/battlemage_shield.json @@ -0,0 +1,106 @@ +{ + "credit": "Made by WinDanesz, with Blockbench", + "texture_size": [32, 32], + "textures": { + "3": "ancientspellcraft:items/battlemage_shield" + }, + "elements": [ + { + "name": "shieldHandle", + "from": [7, 7, 7], + "to": [9, 12, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 0, -0.3]}, + "faces": { + "north": {"uv": [9, 8, 10, 10.5], "texture": "#3"}, + "east": {"uv": [0, 7, 3, 9.5], "texture": "#3"}, + "south": {"uv": [0, 9.5, 1, 12], "texture": "#3"}, + "west": {"uv": [3, 7, 6, 9.5], "texture": "#3"}, + "up": {"uv": [8, 10, 7, 7], "texture": "#3"}, + "down": {"uv": [9, 7, 8, 10], "texture": "#3"} + } + }, + { + "from": [4, 1, 6], + "to": [12, 2, 7], + "faces": { + "north": {"uv": [10, 9, 14, 9.5], "texture": "#3"}, + "east": {"uv": [3, 11, 3.5, 11.5], "texture": "#3"}, + "south": {"uv": [10, 9.5, 14, 10], "texture": "#3"}, + "west": {"uv": [3.5, 11, 4, 11.5], "texture": "#3"}, + "up": {"uv": [14, 10.5, 10, 10], "texture": "#3"}, + "down": {"uv": [5, 10.5, 1, 11], "texture": "#3"} + } + }, + { + "from": [3, 2, 6], + "to": [13, 3, 7], + "faces": { + "north": {"uv": [1, 9.5, 6, 10], "texture": "#3"}, + "east": {"uv": [2, 11, 2.5, 11.5], "texture": "#3"}, + "south": {"uv": [1, 10, 6, 10.5], "texture": "#3"}, + "west": {"uv": [2.5, 11, 3, 11.5], "texture": "#3"}, + "up": {"uv": [15, 8.5, 10, 8], "texture": "#3"}, + "down": {"uv": [15, 8.5, 10, 9], "texture": "#3"} + } + }, + { + "from": [2, 3, 6], + "to": [14, 17, 7], + "faces": { + "north": {"uv": [0, 0, 6, 7], "texture": "#3"}, + "east": {"uv": [6, 7, 6.5, 14], "texture": "#3"}, + "south": {"uv": [6, 0, 12, 7], "texture": "#3"}, + "west": {"uv": [6.5, 7, 7, 14], "texture": "#3"}, + "up": {"uv": [15, 7.5, 9, 7], "texture": "#3"}, + "down": {"uv": [15, 7.5, 9, 8], "texture": "#3"} + } + }, + { + "from": [7, 8, 5], + "to": [9, 10, 7], + "faces": { + "north": {"uv": [7, 10, 8, 11], "texture": "#3"}, + "east": {"uv": [8, 10, 9, 11], "texture": "#3"}, + "south": {"uv": [5, 10.5, 6, 11.5], "texture": "#3"}, + "west": {"uv": [9, 10.5, 10, 11.5], "texture": "#3"}, + "up": {"uv": [11, 11.5, 10, 10.5], "texture": "#3"}, + "down": {"uv": [2, 11, 1, 12], "texture": "#3"} + } + } + ], + "overrides": [ + {"predicate": {"blocking": 1}, "model": "ancientspellcraft:item/battlemage_shield_blocking"} + ], + "display": { + "thirdperson_righthand": { + "rotation": [0, -87.25, 0], + "translation": [2.5, -2.5, 2] + }, + "thirdperson_lefthand": { + "rotation": [0, -87.25, 0], + "translation": [2.5, -2.5, 2] + }, + "firstperson_righthand": { + "rotation": [-7, -77, 19], + "translation": [5.75, -3, 0.25] + }, + "firstperson_lefthand": { + "rotation": [-7, -77, 19], + "translation": [5.75, -3, 0.25] + }, + "ground": { + "translation": [0, 2, 0], + "scale": [0.5, 0.5, 0.5] + }, + "gui": { + "rotation": [3, 163, 3], + "translation": [0.5, -1.25, 0], + "scale": [0.85, 0.85, 0.85] + }, + "fixed": { + "rotation": [-0.5, 0, 0], + "translation": [0.25, -1, -1.5], + "scale": [1.5, 1.5, 1.5] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/ancientspellcraft/models/item/battlemage_shield_blocking.json b/src/main/resources/assets/ancientspellcraft/models/item/battlemage_shield_blocking.json new file mode 100644 index 00000000..35950a45 --- /dev/null +++ b/src/main/resources/assets/ancientspellcraft/models/item/battlemage_shield_blocking.json @@ -0,0 +1,106 @@ +{ + "credit": "Made by WinDanesz, with Blockbench", + "texture_size": [32, 32], + "textures": { + "texture1": "ancientspellcraft:items/battlemage_shield" + }, + "elements": [ + { + "name": "shieldHandle", + "from": [7, 7, 7], + "to": [9, 12, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 0, -0.3]}, + "faces": { + "north": {"uv": [9, 8, 10, 10.5], "texture": "#texture1"}, + "east": {"uv": [0, 7, 3, 9.5], "texture": "#texture1"}, + "south": {"uv": [0, 9.5, 1, 12], "texture": "#texture1"}, + "west": {"uv": [3, 7, 6, 9.5], "texture": "#texture1"}, + "up": {"uv": [8, 10, 7, 7], "texture": "#texture1"}, + "down": {"uv": [9, 7, 8, 10], "texture": "#texture1"} + } + }, + { + "from": [4, 1, 6], + "to": [12, 2, 7], + "faces": { + "north": {"uv": [10, 9, 14, 9.5], "texture": "#texture1"}, + "east": {"uv": [3, 11, 3.5, 11.5], "texture": "#texture1"}, + "south": {"uv": [10, 9.5, 14, 10], "texture": "#texture1"}, + "west": {"uv": [3.5, 11, 4, 11.5], "texture": "#texture1"}, + "up": {"uv": [14, 10.5, 10, 10], "texture": "#texture1"}, + "down": {"uv": [5, 10.5, 1, 11], "texture": "#texture1"} + } + }, + { + "from": [3, 2, 6], + "to": [13, 3, 7], + "faces": { + "north": {"uv": [1, 9.5, 6, 10], "texture": "#texture1"}, + "east": {"uv": [2, 11, 2.5, 11.5], "texture": "#texture1"}, + "south": {"uv": [1, 10, 6, 10.5], "texture": "#texture1"}, + "west": {"uv": [2.5, 11, 3, 11.5], "texture": "#texture1"}, + "up": {"uv": [15, 8.5, 10, 8], "texture": "#texture1"}, + "down": {"uv": [15, 8.5, 10, 9], "texture": "#texture1"} + } + }, + { + "from": [2, 3, 6], + "to": [14, 17, 7], + "faces": { + "north": {"uv": [0, 0, 6, 7], "texture": "#texture1"}, + "east": {"uv": [6, 7, 6.5, 14], "texture": "#texture1"}, + "south": {"uv": [6, 0, 12, 7], "texture": "#texture1"}, + "west": {"uv": [6.5, 7, 7, 14], "texture": "#texture1"}, + "up": {"uv": [15, 7.5, 9, 7], "texture": "#texture1"}, + "down": {"uv": [15, 7.5, 9, 8], "texture": "#texture1"} + } + }, + { + "from": [7, 8, 5], + "to": [9, 10, 7], + "faces": { + "north": {"uv": [7, 10, 8, 11], "texture": "#texture1"}, + "east": {"uv": [8, 10, 9, 11], "texture": "#texture1"}, + "south": {"uv": [5, 10.5, 6, 11.5], "texture": "#texture1"}, + "west": {"uv": [9, 10.5, 10, 11.5], "texture": "#texture1"}, + "up": {"uv": [11, 11.5, 10, 10.5], "texture": "#texture1"}, + "down": {"uv": [2, 11, 1, 12], "texture": "#texture1"} + } + } + ], + "overrides": [ + {"predicate": {"blocking": 1}, "model": "ancientspellcraft:item/magic_shield_blocking"} + ], + "display": { + "thirdperson_righthand": { + "rotation": [32, -21.25, -1.25], + "translation": [0.5, 1.25, 0.75] + }, + "thirdperson_lefthand": { + "rotation": [32, -21.25, -1.25], + "translation": [0.5, 1.25, 0.75] + }, + "firstperson_righthand": { + "rotation": [9.5, 5, 6], + "translation": [-6.5, 0, 3.25] + }, + "firstperson_lefthand": { + "rotation": [9.5, 5, 6], + "translation": [-6.5, 0, 3.25] + }, + "ground": { + "translation": [0, 2, 0], + "scale": [0.5, 0.5, 0.5] + }, + "gui": { + "rotation": [3, 163, 3], + "translation": [0.5, -1.25, 0], + "scale": [0.85, 0.85, 0.85] + }, + "fixed": { + "rotation": [-0.5, 0, 0], + "translation": [0.25, -1, -1.5], + "scale": [1.5, 1.5, 1.5] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/ancientspellcraft/models/item/charm_aura_alacrity.json b/src/main/resources/assets/ancientspellcraft/models/item/charm_aura_alacrity.json new file mode 100644 index 00000000..d50689ba --- /dev/null +++ b/src/main/resources/assets/ancientspellcraft/models/item/charm_aura_alacrity.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "ancientspellcraft:items/charm_aura_alacrity" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/ancientspellcraft/models/item/charm_aura_hatred.json b/src/main/resources/assets/ancientspellcraft/models/item/charm_aura_hatred.json new file mode 100644 index 00000000..53aa0ec4 --- /dev/null +++ b/src/main/resources/assets/ancientspellcraft/models/item/charm_aura_hatred.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "ancientspellcraft:items/charm_aura_hatred" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/ancientspellcraft/models/item/charm_aura_life.json b/src/main/resources/assets/ancientspellcraft/models/item/charm_aura_life.json new file mode 100644 index 00000000..1bc722c0 --- /dev/null +++ b/src/main/resources/assets/ancientspellcraft/models/item/charm_aura_life.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "ancientspellcraft:items/charm_aura_life" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/ancientspellcraft/models/item/charm_aura_purity.json b/src/main/resources/assets/ancientspellcraft/models/item/charm_aura_purity.json new file mode 100644 index 00000000..cbd7ba30 --- /dev/null +++ b/src/main/resources/assets/ancientspellcraft/models/item/charm_aura_purity.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "ancientspellcraft:items/charm_aura_purity" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/ancientspellcraft/models/item/charm_aura_tenacity.json b/src/main/resources/assets/ancientspellcraft/models/item/charm_aura_tenacity.json new file mode 100644 index 00000000..ca3689ec --- /dev/null +++ b/src/main/resources/assets/ancientspellcraft/models/item/charm_aura_tenacity.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "ancientspellcraft:items/charm_aura_tenacity" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/ancientspellcraft/models/item/charm_aura_warding.json b/src/main/resources/assets/ancientspellcraft/models/item/charm_aura_warding.json new file mode 100644 index 00000000..5b95caa4 --- /dev/null +++ b/src/main/resources/assets/ancientspellcraft/models/item/charm_aura_warding.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "ancientspellcraft:items/charm_aura_warding" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/ancientspellcraft/models/item/charm_aura_wither.json b/src/main/resources/assets/ancientspellcraft/models/item/charm_aura_wither.json new file mode 100644 index 00000000..0f1dc16f --- /dev/null +++ b/src/main/resources/assets/ancientspellcraft/models/item/charm_aura_wither.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "ancientspellcraft:items/charm_aura_wither" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/ancientspellcraft/models/item/charm_glyph_experience.json b/src/main/resources/assets/ancientspellcraft/models/item/charm_glyph_experience.json new file mode 100644 index 00000000..95d27b3a --- /dev/null +++ b/src/main/resources/assets/ancientspellcraft/models/item/charm_glyph_experience.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "ancientspellcraft:items/charm_glyph_experience" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/ancientspellcraft/models/item/charm_glyph_fortification.json b/src/main/resources/assets/ancientspellcraft/models/item/charm_glyph_fortification.json new file mode 100644 index 00000000..ac62530e --- /dev/null +++ b/src/main/resources/assets/ancientspellcraft/models/item/charm_glyph_fortification.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "ancientspellcraft:items/charm_glyph_fortification" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/ancientspellcraft/models/item/charm_glyph_might.json b/src/main/resources/assets/ancientspellcraft/models/item/charm_glyph_might.json new file mode 100644 index 00000000..76d07dc5 --- /dev/null +++ b/src/main/resources/assets/ancientspellcraft/models/item/charm_glyph_might.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "ancientspellcraft:items/charm_glyph_might" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/ancientspellcraft/models/item/charm_glyph_shield_disable.json b/src/main/resources/assets/ancientspellcraft/models/item/charm_glyph_shield_disable.json new file mode 100644 index 00000000..d0106f5b --- /dev/null +++ b/src/main/resources/assets/ancientspellcraft/models/item/charm_glyph_shield_disable.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "ancientspellcraft:items/charm_glyph_shield_disable" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/ancientspellcraft/patchouli_books/manual/en_us/entries/2_researching/scribing_desk.json b/src/main/resources/assets/ancientspellcraft/patchouli_books/manual/en_us/entries/2_researching/scribing_desk.json index 6ba9808e..d20f669d 100644 --- a/src/main/resources/assets/ancientspellcraft/patchouli_books/manual/en_us/entries/2_researching/scribing_desk.json +++ b/src/main/resources/assets/ancientspellcraft/patchouli_books/manual/en_us/entries/2_researching/scribing_desk.json @@ -1,31 +1,5 @@ -{ - "name": "Scribing Desk", - "icon": "ancientspellcraft:scribing_desk", - "category": "2_researching", - "sortnum": 3, - "pages": [ - { - "type": "spotlight", - "item": "ancientspellcraft:scribing_desk", - "text": " The Scribing Desk can be used to put the knowledge uncovered from arcane relics into some practical usage...\nSpell type Stone Tablets can be used with the desk to create ancient spell books.", - "link_recipe": false - }, - { - "type": "crafting", - "recipe": "ancientspellcraft:scribing_desk", - "title": "Scribing Desk", + "text": "", "text": "The Scribing Desk can be crafted at a crafting table" - }, - { - "type": "image", - "images": [ - "ancientspellcraft:textures/gui/entries/scribing_desk_gui_1.png" - ], - "title": "Scribing Desk", - "text": "" - }, - { - "type": "text", "text": "The Scribing Desk has 7 item slots. $(br)- The top left slot is for relics like stone tablets. $(br)- The bottom left slot is for Magic Crystals. $(br)- The book slot in the middle is for an empty, regular Book. $(br) - The bottom right slot is for Ink. $(br) -The three slots in the middle are for ingredients." } ] diff --git a/src/main/resources/assets/ancientspellcraft/spells/runeword_meditate.json b/src/main/resources/assets/ancientspellcraft/spells/runeword_meditate.json new file mode 100644 index 00000000..0cb2ce4d --- /dev/null +++ b/src/main/resources/assets/ancientspellcraft/spells/runeword_meditate.json @@ -0,0 +1,21 @@ +{ + "enabled": { + "book": true, + "scroll": false, + "wands": false, + "npcs": true, + "dispensers": false, + "commands": true, + "treasure": true, + "trades": false, + "looting": true + }, + "tier": "advanced", + "element": "magic", + "type": "attack", + "cost": 0, + "chargeup": 40, + "cooldown": 120, + "base_properties": { + } +} \ No newline at end of file diff --git a/src/main/resources/assets/ancientspellcraft/texts/handbook_en_us.json b/src/main/resources/assets/ancientspellcraft/texts/handbook_en_us.json new file mode 100644 index 00000000..d665b5d0 --- /dev/null +++ b/src/main/resources/assets/ancientspellcraft/texts/handbook_en_us.json @@ -0,0 +1,152 @@ +{ + "bookmark_start_section": "ancient_magic", + + "colours": { + "text": "#000000", + "caption": "#666666", + "hyperlink": "#601ba0", + "highlight": "#dd4c1d", + "new_section": "#aaaaaa" + }, + + "images": { + "scribing_desk": { + "location": "ancientspellcraft:textures/gui/entries/scribing_desk.png", + "caption": "The Scribing Desk", + "u": 0, + "v": 0, + "width": 110, + "height": 99 + }, + "scribing_desk_gui": { + "location": "ancientspellcraft:textures/gui/entries/scribing_desk_gui.png", + "caption": "The Scribing Desk GUI", + "u": 0, + "v": 0, + "width": 110, + "height": 94 + }, + "spell_blade": { + "location": "ancientspellcraft:textures/items/battlemage_sword_advanced_magic.png", + "caption": "An Advanced Spell Blade", + "u": 0, + "v": 0, + "width": 64, + "height": 64, + "border": false + }, + "spell_blade_crafting": { + "location": "ancientspellcraft:textures/gui/entries/spell_blade_crafting.png", + "caption": "Crafting a Spell Blade", + "u": 0, + "v": 0, + "width": 110, + "height": 49, + "border": false + } + }, + + "recipes": { + "sphere_cognizance": { + "locations": [ "ancientspellcraft:sphere_cognizance" ] + }, + "scribing_desk": { + "locations": [ "ancientspellcraft:scribing_desk" ] + }, + "battlemage_sword_blade": { + "locations": [ "ancientspellcraft:battlemage_sword_blade" ] + }, + "battlemage_sword_hilt": { + "locations": [ "ancientspellcraft:battlemage_sword_hilt" ] + } + }, + + + "sections": { + "ancient_magic": { + "title": "Ancient Magic", + "include_in_contents": "main_contents", + "triggers": [ + "ancientspellcraft:relics" + ], + "text": [ + + " Only a few remnants of the old wizarding civilizations can be found in this era. Many of their ancient spells and techniques are said to be lost to the ages... the magical seals that bind magic to parchment have decayed and faded away, books and scrolls have been devoured by silverfish and the surviving ones crumble into dust at the slightest disturbance", + "Stone Tablets can be studied at a @sphere_cognizance Sphere of Cognizance@ to uncover their secrets. Some scholars theorize that these tablets might be inscribed with knowledge of ancient spells- created and utilized by wizards from long-forgotten civilizations. However, no wizard in recent history has been successful in recreating any of these spells." + ] + }, + "sphere_cognizance": { + "title": "Sphere of Cognizance", + "include_in_contents": "main_contents", + "text": [ + + "The Sphere of Cognizance can be used to research unknown spells or Relic items (Stone Tablets) and it can become an essential tool for identifying unknown spells. ", + "By fuelling the process with raw magic crystals and concentrating their mind on the Sphere, a wizard can learn clues regarding the very nature of the spell which was put under the Sphere, without casting it. Not only can the elemental affinity of the spell be revealed this way, but also the its purpose - be it a summoning incantation, or a protective aura around the caster.", + "#recipe sphere_cognizance" + ] + }, + "scribing_desk": { + "title": "Scribing Desk", + "include_in_contents": "main_contents", + "text": [ + "The Scribing Desk can be used to put the knowledge uncovered from arcane relics into some practical usage...", + "Spell type Stone Tablets can be used with the desk to create ancient spell books.", + "#image scribing_desk", + "The Scribing Desk has 7 item slots.", + "- The top left slot is for relics like stone tablets.", + "- The bottom left slot is for Magic Crystals.", + "- The book slot in the middle is for an empty, regular Book.", + "- The bottom right slot is for Ink.", + "- The three slots in the middle are for ingredients.", + "#image scribing_desk_gui", + "#recipe scribing_desk" + ] + }, + "battlemage_magic": { + "title": "Battlemage Magic", + "include_in_contents": "main_contents", + "text": [ + "In the world of wizardry, there exists a unique class of magic wielders known as Battlemages. These extraordinary individuals harness the power of magic swords, also known as spell blades, a special kind of weapon that comes in four distinct tiers: Novice, Apprentice, Advanced, and Master. What makes these magic swords truly remarkable is their adaptability to the elements. Unlike other magical items, these swords do not come pre-imbued with a specific element. Instead, they draw their elemental power from the armor set worn by the Battlemage. This dynamic connection between the sword and the armor enables the Battlemage to harness power of the element that aligns with their chosen armor set.", + "#image spell_blade", + "Spell blades are forged from the finest Crystal Silver and due to their nature, will only work in the hand of a true battlemage, who wears a full set of matching battlemage armour.", + "However, wielding such formidable magic swords is not a simple feat. Battlemages must be equipped with not only the sword itself but also a magic source in their off-hand. This source serves as the catalyst for channeling the sword's power, enabling the Battlemage to unleash devastating attacks.", + "The magic source can be a @wands wand@ or a Runic Shield" + ] + }, + "battlemage_swords": { + "title": "Battlemage Swords", + "include_in_contents": "main_contents", + "text": [ + "Creating a Spell Blade is a two-step process. First, you must craft the sword blade, and then you'll craft the hilt. These two essential components will eventually be merged into a formidable Spell Blade. The anvil where this merging happens is none other than the mighty Runic Anvil.", + "The first step involves crafting the blade of your Spell Blade. The Crystal Silver Plates are the key to creating a blade that resonates with magical power. With the shining metal plates, you'll forge the very essence of your sword's might.", + "Once the blade is crafted to perfection, it's time to create the hilt that will allow you to wield your Spell Blade with finesse. With the hilt in hand, you'll have all the necessary components for your weapon.", + "Now, the most critical moment arrives. Head to the Runic Anvil. Here, you'll assemble the blade and the hilt, uniting them into a single, powerful Spell Blade.", + "As you complete this final step, you'll feel the surge of magic emanating from your newly forged Spell Blade. It is now a reflection of your prowess and a testament to your journey as a Battlemage. With this weapon in hand, you are ready to embrace your role on the battlefield, where the clash of magic and steel knows no equal.", + "#recipe battlemage_sword_hilt", + "#recipe battlemage_sword_blade", + "#image spell_blade_crafting", + "Spell Blades conjure various effect depending on their current element. They accumulate charges with each strike and spell cast, glowing when fully charged. At full charge, the next physical attack expels all charges for an unique effect, depending on the element.", + + "#colour_fireFire#colour_reset \nBasic Attacks \n Fire Spell Blades turn enemies on flame with each attack and also have 20% chance to split burning embers on hit. This chance increases to 40% on an enemy kill. \nCharged Attack \n A charged attack grants the battlemage a short Fire Resistance and Fireskin effect. Burning enemies are Soul Scorched for a short duration, reducing their healing power.", + + "#colour_iceIce#colour_reset \nBasic Attacks \nIce Spell Blades Freeze their enemies with each attack, with 20% chance with each hit for the effect to stack. A slain enemy has 25% chance to explode into frozen ice shards.\nCharged Attack \nA charged attack causes an eruption of frost, knocking back, damaging and slowing all nearby enemies.", + + "#colour_lightningLightning#colour_reset \nBasic Attacks \nLightning Spell Blades damage all nearby enemies by chaining lighting magic into them. They also receive a static charge by movement, restoring mana as the battlemage moves. These blades have a higher cost of mana for basic attacks.\nCharged Attack \nA charged attack restores 60 mana instantly.", + + "#colour_necromancyNecromancy#colour_reset \nBasic Attacks \nNecromancy Spell Blades Wither enemies with each hit and steal a small amount of life force back to the battlemage. Killing an enemy grants a short speed and strength bonus.\nCharged Attack \nA charged restores more health and also restores some saturation.", + "#colour_earthEarth#colour_reset \nBasic Attacks \nEarth Spell Blades poison their targets with each attack, this effect has 20% chance to stack. Each attack has 50% chance to grow a nearby allied magic mushroom of a random effect.\nCharged Attack \nEarth Spell Blades doesn't have a charged effect.", + "#colour_sorcerySorcery#colour_reset \nBasic Attacks \nBasic Attacks of a Sorcery Spell Blade doesn't have special effects.\nCharged Attack \nCharged attacks summon conjured weapons for a short duration.", + "#colour_healingHealing#colour_reset \nBasic Attacks \nHealing Spell Blades apply Mark Sacrifice on the target with each hit, and set undeads on fire for 2 seconds.\nCharged Attack \nA charged attack of a spell blade applies a random beneficial bonus to all nearby allies." + ] + }, + "more_crafting_recipes": { + "title": "More Crafting Recipes", + "include_in_contents": "main_contents", + "text": [ + + "#recipe sphere_cognizance", + "#recipe scribing_desk" + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/ancientspellcraft/textures/gui/battlemage_shield.png b/src/main/resources/assets/ancientspellcraft/textures/gui/battlemage_shield.png new file mode 100644 index 00000000..e0bc8e82 Binary files /dev/null and b/src/main/resources/assets/ancientspellcraft/textures/gui/battlemage_shield.png differ diff --git a/src/main/resources/assets/ancientspellcraft/textures/gui/entries/scribing_desk.png b/src/main/resources/assets/ancientspellcraft/textures/gui/entries/scribing_desk.png new file mode 100644 index 00000000..bfbef153 Binary files /dev/null and b/src/main/resources/assets/ancientspellcraft/textures/gui/entries/scribing_desk.png differ diff --git a/src/main/resources/assets/ancientspellcraft/textures/gui/entries/scribing_desk_gui.png b/src/main/resources/assets/ancientspellcraft/textures/gui/entries/scribing_desk_gui.png new file mode 100644 index 00000000..bf417c2f Binary files /dev/null and b/src/main/resources/assets/ancientspellcraft/textures/gui/entries/scribing_desk_gui.png differ diff --git a/src/main/resources/assets/ancientspellcraft/textures/gui/entries/spell_blade_crafting.png b/src/main/resources/assets/ancientspellcraft/textures/gui/entries/spell_blade_crafting.png new file mode 100644 index 00000000..4012612a Binary files /dev/null and b/src/main/resources/assets/ancientspellcraft/textures/gui/entries/spell_blade_crafting.png differ diff --git a/src/main/resources/assets/ancientspellcraft/textures/gui/potion_icon_tenacity.png b/src/main/resources/assets/ancientspellcraft/textures/gui/potion_icon_tenacity.png new file mode 100644 index 00000000..c973df4d Binary files /dev/null and b/src/main/resources/assets/ancientspellcraft/textures/gui/potion_icon_tenacity.png differ diff --git a/src/main/resources/assets/ancientspellcraft/textures/items/battlemage_shield.png b/src/main/resources/assets/ancientspellcraft/textures/items/battlemage_shield.png new file mode 100644 index 00000000..8d9b9a63 Binary files /dev/null and b/src/main/resources/assets/ancientspellcraft/textures/items/battlemage_shield.png differ diff --git a/src/main/resources/assets/ancientspellcraft/textures/items/charm_aura_alacrity.png b/src/main/resources/assets/ancientspellcraft/textures/items/charm_aura_alacrity.png new file mode 100644 index 00000000..8928b3a1 Binary files /dev/null and b/src/main/resources/assets/ancientspellcraft/textures/items/charm_aura_alacrity.png differ diff --git a/src/main/resources/assets/ancientspellcraft/textures/items/charm_aura_hatred.png b/src/main/resources/assets/ancientspellcraft/textures/items/charm_aura_hatred.png new file mode 100644 index 00000000..039b87bc Binary files /dev/null and b/src/main/resources/assets/ancientspellcraft/textures/items/charm_aura_hatred.png differ diff --git a/src/main/resources/assets/ancientspellcraft/textures/items/charm_aura_life.png b/src/main/resources/assets/ancientspellcraft/textures/items/charm_aura_life.png new file mode 100644 index 00000000..c6a40c4f Binary files /dev/null and b/src/main/resources/assets/ancientspellcraft/textures/items/charm_aura_life.png differ diff --git a/src/main/resources/assets/ancientspellcraft/textures/items/charm_aura_purity.png b/src/main/resources/assets/ancientspellcraft/textures/items/charm_aura_purity.png new file mode 100644 index 00000000..451f2ca9 Binary files /dev/null and b/src/main/resources/assets/ancientspellcraft/textures/items/charm_aura_purity.png differ diff --git a/src/main/resources/assets/ancientspellcraft/textures/items/charm_aura_tenacity.png b/src/main/resources/assets/ancientspellcraft/textures/items/charm_aura_tenacity.png new file mode 100644 index 00000000..fe5c92db Binary files /dev/null and b/src/main/resources/assets/ancientspellcraft/textures/items/charm_aura_tenacity.png differ diff --git a/src/main/resources/assets/ancientspellcraft/textures/items/charm_aura_warding.png b/src/main/resources/assets/ancientspellcraft/textures/items/charm_aura_warding.png new file mode 100644 index 00000000..d97f5c76 Binary files /dev/null and b/src/main/resources/assets/ancientspellcraft/textures/items/charm_aura_warding.png differ diff --git a/src/main/resources/assets/ancientspellcraft/textures/items/charm_aura_wither.png b/src/main/resources/assets/ancientspellcraft/textures/items/charm_aura_wither.png new file mode 100644 index 00000000..2bae59d0 Binary files /dev/null and b/src/main/resources/assets/ancientspellcraft/textures/items/charm_aura_wither.png differ diff --git a/src/main/resources/assets/ancientspellcraft/textures/items/charm_glyph_fortification.png b/src/main/resources/assets/ancientspellcraft/textures/items/charm_glyph_fortification.png index 852043b2..a9abca11 100644 Binary files a/src/main/resources/assets/ancientspellcraft/textures/items/charm_glyph_fortification.png and b/src/main/resources/assets/ancientspellcraft/textures/items/charm_glyph_fortification.png differ diff --git a/src/main/resources/assets/ancientspellcraft/textures/items/charm_glyph_shield_disable.png b/src/main/resources/assets/ancientspellcraft/textures/items/charm_glyph_shield_disable.png new file mode 100644 index 00000000..9c685ecc Binary files /dev/null and b/src/main/resources/assets/ancientspellcraft/textures/items/charm_glyph_shield_disable.png differ diff --git a/tools/scripts/Generate-ItemArtefact.ps1 b/tools/scripts/Generate-ItemArtefact.ps1 index 07823b0c..cf584cb9 100644 --- a/tools/scripts/Generate-ItemArtefact.ps1 +++ b/tools/scripts/Generate-ItemArtefact.ps1 @@ -66,6 +66,6 @@ function Create-Texture { #endregion Functions New-SimpleModelFile -Add-LangFileEntry -Entry "item.$($script:modid)\:$($script:itemName).name=TODO" -Add-LangFileEntry -Entry "item.$($script:modid)\:$($script:itemName).desc=TODO" -Create-Texture \ No newline at end of file + Add-LangFileEntry -Entry "item.$($script:modid)\:$($script:itemName).name=TODO" + Add-LangFileEntry -Entry "item.$($script:modid)\:$($script:itemName).desc=TODO" + Create-Texture \ No newline at end of file