diff --git a/src/main/java/com/wayoftime/bloodmagic/core/RegistrarBloodMagicItems.java b/src/main/java/com/wayoftime/bloodmagic/core/RegistrarBloodMagicItems.java index 8fedb858..f66f7bc7 100644 --- a/src/main/java/com/wayoftime/bloodmagic/core/RegistrarBloodMagicItems.java +++ b/src/main/java/com/wayoftime/bloodmagic/core/RegistrarBloodMagicItems.java @@ -3,7 +3,8 @@ package com.wayoftime.bloodmagic.core; import com.google.common.collect.Lists; import com.wayoftime.bloodmagic.BloodMagic; import com.wayoftime.bloodmagic.core.network.BloodOrb; -import com.wayoftime.bloodmagic.core.type.DemonWillType; +import com.wayoftime.bloodmagic.core.util.register.IModelLocator; +import com.wayoftime.bloodmagic.core.will.DemonWill; import com.wayoftime.bloodmagic.core.type.SlateType; import com.wayoftime.bloodmagic.core.util.register.IItemProvider; import com.wayoftime.bloodmagic.core.util.register.IVariantProvider; @@ -62,6 +63,8 @@ public class RegistrarBloodMagicItems { public static final Item LIVING_ARMOR_FEET = Items.AIR; public static final Item LIVING_TOME = Items.AIR; + public static final Item SENTIENT_SWORD = Items.AIR; + public static final Item MONSTER_SOUL = Items.AIR; public static final Item DEMON_WILL_CRYSTAL_RAW = Items.AIR; public static final Item DEMON_WILL_CRYSTAL_CORROSIVE = Items.AIR; public static final Item DEMON_WILL_CRYSTAL_DESTRUCTIVE = Items.AIR; @@ -100,13 +103,16 @@ public class RegistrarBloodMagicItems { new ItemLivingArmor(EntityEquipmentSlot.CHEST), new ItemLivingArmor(EntityEquipmentSlot.LEGS), new ItemLivingArmor(EntityEquipmentSlot.FEET), - new ItemLivingTome(), - new ItemAltarBuilder() + new ItemAltarBuilder(), + new ItemSentientSword(), + new ItemMonsterSoul() )); - for (DemonWillType type : DemonWillType.VALUES) + for (DemonWill type : DemonWill.VALUES) items.add(new ItemMundane("demon_will_crystal_" + type.getName())); + items.add(new ItemLivingTome()); // Last so it's at the bottom of the creative tab + registry.registerAll(items.toArray(new Item[0])); } @@ -116,17 +122,27 @@ public class RegistrarBloodMagicItems { for (Item item : items) { boolean flag = handleModel(item); - if (!flag) // If we haven't registered a model by now, we don't need any special handling so we'll just use the default model. - ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(), item instanceof ItemBlock ? "normal" : "inventory")); + if (!flag) { // If we haven't registered a model by now, we don't need any special handling so we'll just use the default model. + ResourceLocation modelPath = item.getRegistryName(); + if (item instanceof IModelLocator) + modelPath = ((IModelLocator) item).getModelPath(); + + ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(modelPath, item instanceof ItemBlock ? "normal" : "inventory")); + } } } static boolean handleModel(Item item) { if (item instanceof IVariantProvider) { + ResourceLocation modelPath = item.getRegistryName(); + if (item instanceof IModelLocator) + modelPath = ((IModelLocator) item).getModelPath(); + Int2ObjectMap variants = new Int2ObjectOpenHashMap<>(); ((IVariantProvider) item).collectVariants(variants); + for (Int2ObjectMap.Entry entry : variants.int2ObjectEntrySet()) - ModelLoader.setCustomModelResourceLocation(item, entry.getIntKey(), new ModelResourceLocation(item.getRegistryName(), entry.getValue())); + ModelLoader.setCustomModelResourceLocation(item, entry.getIntKey(), new ModelResourceLocation(modelPath, entry.getValue())); return true; } diff --git a/src/main/java/com/wayoftime/bloodmagic/core/util/InventoryUtil.java b/src/main/java/com/wayoftime/bloodmagic/core/util/InventoryUtil.java new file mode 100644 index 00000000..8f01b374 --- /dev/null +++ b/src/main/java/com/wayoftime/bloodmagic/core/util/InventoryUtil.java @@ -0,0 +1,31 @@ +package com.wayoftime.bloodmagic.core.util; + +import com.google.common.collect.Lists; +import net.minecraft.item.ItemStack; +import net.minecraftforge.items.IItemHandler; + +import javax.annotation.Nonnull; +import java.util.Collections; +import java.util.List; +import java.util.function.Predicate; + +public class InventoryUtil { + + public static final Predicate NO_EMPTY = stack -> !stack.isEmpty(); + + @Nonnull + public static List findMatchingItems(IItemHandler inventory, Predicate filter) { + List found = null; + for (int i = 0; i < inventory.getSlots(); i++) { + ItemStack stack = inventory.getStackInSlot(i); + if (filter.test(stack)) { + if (found == null) + found = Lists.newArrayList(); + + found.add(stack); + } + } + + return found == null ? Collections.emptyList() : found; + } +} diff --git a/src/main/java/com/wayoftime/bloodmagic/core/util/ModifiableValue.java b/src/main/java/com/wayoftime/bloodmagic/core/util/ModifiableValue.java new file mode 100644 index 00000000..d22e288b --- /dev/null +++ b/src/main/java/com/wayoftime/bloodmagic/core/util/ModifiableValue.java @@ -0,0 +1,40 @@ +package com.wayoftime.bloodmagic.core.util; + +import java.util.Objects; + +public class ModifiableValue { + + private T value; + + public ModifiableValue(T value) { + this.value = value; + } + + public T getValue() { + return value; + } + + public void setValue(T value) { + this.value = value; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (!(o instanceof ModifiableValue)) return false; + + ModifiableValue that = (ModifiableValue) o; + + return value != null ? value.equals(that.value) : that.value == null; + } + + @Override + public int hashCode() { + return value != null ? value.hashCode() : 0; + } + + @Override + public String toString() { + return Objects.toString(value); + } +} diff --git a/src/main/java/com/wayoftime/bloodmagic/core/util/register/IModelLocator.java b/src/main/java/com/wayoftime/bloodmagic/core/util/register/IModelLocator.java new file mode 100644 index 00000000..c23d6f7e --- /dev/null +++ b/src/main/java/com/wayoftime/bloodmagic/core/util/register/IModelLocator.java @@ -0,0 +1,16 @@ +package com.wayoftime.bloodmagic.core.util.register; + +import net.minecraft.util.ResourceLocation; + +import javax.annotation.Nonnull; + +public interface IModelLocator { + + /** + * Allows an item to point to a custom model path instead of using the registry name. + * + * @return the path to the model. + */ + @Nonnull + ResourceLocation getModelPath(); +} diff --git a/src/main/java/com/wayoftime/bloodmagic/core/type/DemonWillType.java b/src/main/java/com/wayoftime/bloodmagic/core/will/DemonWill.java similarity index 61% rename from src/main/java/com/wayoftime/bloodmagic/core/type/DemonWillType.java rename to src/main/java/com/wayoftime/bloodmagic/core/will/DemonWill.java index e61c6e46..afca4f50 100644 --- a/src/main/java/com/wayoftime/bloodmagic/core/type/DemonWillType.java +++ b/src/main/java/com/wayoftime/bloodmagic/core/will/DemonWill.java @@ -1,10 +1,10 @@ -package com.wayoftime.bloodmagic.core.type; +package com.wayoftime.bloodmagic.core.will; import net.minecraft.util.IStringSerializable; import java.util.Locale; -public enum DemonWillType implements IStringSerializable { +public enum DemonWill implements IStringSerializable { RAW, CORROSIVE, @@ -13,7 +13,7 @@ public enum DemonWillType implements IStringSerializable { STEADFAST, ; - public static final DemonWillType[] VALUES = values(); + public static final DemonWill[] VALUES = values(); @Override public String getName() { diff --git a/src/main/java/com/wayoftime/bloodmagic/core/will/DemonWillHolder.java b/src/main/java/com/wayoftime/bloodmagic/core/will/DemonWillHolder.java new file mode 100644 index 00000000..8590afdf --- /dev/null +++ b/src/main/java/com/wayoftime/bloodmagic/core/will/DemonWillHolder.java @@ -0,0 +1,67 @@ +package com.wayoftime.bloodmagic.core.will; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.INBTSerializable; + +import javax.annotation.Nullable; + +public class DemonWillHolder implements INBTSerializable { + + private DemonWill type; + private double amount; + + public DemonWillHolder(DemonWill type, double amount) { + this.type = type; + this.amount = amount; + } + + private DemonWillHolder() { + // No-op + } + + public DemonWill getType() { + return type; + } + + public double getAmount() { + return amount; + } + + public void setAmount(double amount) { + this.amount = amount; + } + + public void modifyAmount(double change) { + this.amount += change; + } + + @Override + public NBTTagCompound serializeNBT() { + NBTTagCompound tag = new NBTTagCompound(); + tag.setInteger("type", type.ordinal()); + tag.setDouble("amount", amount); + return tag; + } + + @Override + public void deserializeNBT(NBTTagCompound nbt) { + this.type = DemonWill.VALUES[nbt.getInteger("type")]; + this.amount = nbt.getDouble("amount"); + } + + @Nullable + public static DemonWillHolder fromStack(ItemStack stack) { + if (!stack.hasTagCompound()) // Definitely hasn't been bound yet. + return null; + + NBTBase willTag = stack.getTagCompound().getTag("demonWill"); + if (willTag.getId() != 10 || willTag.isEmpty()) // Make sure it's both a tag compound and that it has actual data. + return null; + + DemonWillHolder holder = new DemonWillHolder(); + holder.deserializeNBT((NBTTagCompound) willTag); + return holder; + } +} diff --git a/src/main/java/com/wayoftime/bloodmagic/core/will/DemonicWillEventHandler.java b/src/main/java/com/wayoftime/bloodmagic/core/will/DemonicWillEventHandler.java new file mode 100644 index 00000000..b2252d9c --- /dev/null +++ b/src/main/java/com/wayoftime/bloodmagic/core/will/DemonicWillEventHandler.java @@ -0,0 +1,100 @@ +package com.wayoftime.bloodmagic.core.will; + +import com.wayoftime.bloodmagic.BloodMagic; +import com.wayoftime.bloodmagic.core.RegistrarBloodMagicItems; +import com.wayoftime.bloodmagic.core.util.InventoryUtil; +import com.wayoftime.bloodmagic.event.DemonicWillEvent; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.monster.IMob; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumHand; +import net.minecraft.world.EnumDifficulty; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.util.FakePlayer; +import net.minecraftforge.event.entity.living.LivingDropsEvent; +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.items.CapabilityItemHandler; +import net.minecraftforge.items.IItemHandler; + +import java.util.function.Predicate; + +@Mod.EventBusSubscriber(modid = BloodMagic.MODID) +public class DemonicWillEventHandler { + + @SubscribeEvent + public static void gatherDrops(LivingDropsEvent event) { + if (!(event.getEntityLiving() instanceof IMob) && event.getEntityLiving().getEntityWorld().getDifficulty() != EnumDifficulty.PEACEFUL) + return; + + Entity sourceEntity = event.getSource().getTrueSource(); + if (!(sourceEntity instanceof EntityPlayer) || sourceEntity instanceof FakePlayer) + return; + + EntityPlayer player = (EntityPlayer) sourceEntity; + ItemStack held = player.getHeldItem(EnumHand.MAIN_HAND); + if (held.isEmpty() || !(held.getItem() instanceof ISentientEquipment)) + return; + + DemonWillHolder willDrop = ((ISentientEquipment) held.getItem()).getWillDrop(player, event.getEntityLiving(), held, event.getLootingLevel()); + if (willDrop == null) + return; + + DemonicWillEvent.GatherWillDrops willDropEvent = new DemonicWillEvent.GatherWillDrops(player, event.getEntityLiving(), held, event.getLootingLevel(), willDrop.getAmount()); + if (MinecraftForge.EVENT_BUS.post(willDropEvent)) + return; + + willDrop.setAmount(willDropEvent.getDroppedWill()); + IItemHandler inventory = player.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null); + if (inventory == null) + return; // shut up intellij this is never going to happen + + InventoryUtil.findMatchingItems(inventory, InventoryUtil.NO_EMPTY.and(new WillContainerFilter(willDrop.getType()))).forEach(stack -> { + if (willDrop.getAmount() <= 0) + return; + + IWillContainer container = (IWillContainer) stack.getItem(); + DemonWillHolder holder = container.getDemonWill(stack); + if (holder == null) + holder = new DemonWillHolder(willDrop.getType(), 0); + + holder.modifyAmount(Math.min(willDrop.getAmount(), container.getMaxContained(stack))); + willDrop.modifyAmount(-holder.getAmount()); + }); + + if (willDrop.getAmount() >= 0) { + ItemStack drop = new ItemStack(RegistrarBloodMagicItems.MONSTER_SOUL); + ((IWillContainer) drop.getItem()).applyDemonWill(drop, willDrop); + event.getDrops().add(new EntityItem(player.getEntityWorld(), event.getEntity().posX, event.getEntity().posY, event.getEntity().posZ, drop)); + } + } + + private static class WillContainerFilter implements Predicate { + + private final DemonWill type; + + public WillContainerFilter(DemonWill type) { + this.type = type; + } + + @Override + public boolean test(ItemStack stack) { + if (stack.getItem() instanceof IWillContainer) { + IWillContainer container = (IWillContainer) stack.getItem(); + double max = container.getMaxContained(stack); + DemonWillHolder holder = container.getDemonWill(stack); + if (holder == null) + return true; + + if (holder.getType() != type) + return false; + + return holder.getAmount() < max; + } + + return false; + } + } +} diff --git a/src/main/java/com/wayoftime/bloodmagic/core/will/ISentientEquipment.java b/src/main/java/com/wayoftime/bloodmagic/core/will/ISentientEquipment.java new file mode 100644 index 00000000..adcfe479 --- /dev/null +++ b/src/main/java/com/wayoftime/bloodmagic/core/will/ISentientEquipment.java @@ -0,0 +1,43 @@ +package com.wayoftime.bloodmagic.core.will; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.EntitySlime; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +import javax.annotation.Nullable; + +public interface ISentientEquipment { + + @Nullable + default DemonWillHolder getWillDrop(EntityPlayer player, EntityLivingBase attacked, ItemStack stack, int looting) { + double willModifier = attacked instanceof EntitySlime ? 0.67 : 1; + DemonWill type = getDemonWill(stack); + DemonWillHolder ret = null; + for (int i = 0; i <= looting; i++) { + if (i == 0 || player.getEntityWorld().rand.nextDouble() <= 0.4) { + if (ret == null) + ret = new DemonWillHolder(type, 0); + + ret.modifyAmount(willModifier * (getWillDropAmount(stack) * player.getEntityWorld().rand.nextDouble() * (attacked.getMaxHealth() / 20D))); + } + } + + return ret; + } + + double getWillDropAmount(ItemStack stack); + + default boolean isActivated(ItemStack stack) { + return stack.hasTagCompound() && stack.getTagCompound().getBoolean("sentientActivated"); + } + + default DemonWill getDemonWill(ItemStack stack) { + NBTTagCompound tagCompound = stack.getTagCompound(); + if (tagCompound == null || !tagCompound.hasKey("willType")) + return DemonWill.RAW; + + return DemonWill.valueOf(tagCompound.getString("willType")); + } +} diff --git a/src/main/java/com/wayoftime/bloodmagic/core/will/IWillContainer.java b/src/main/java/com/wayoftime/bloodmagic/core/will/IWillContainer.java new file mode 100644 index 00000000..c4058151 --- /dev/null +++ b/src/main/java/com/wayoftime/bloodmagic/core/will/IWillContainer.java @@ -0,0 +1,38 @@ +package com.wayoftime.bloodmagic.core.will; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +import javax.annotation.Nullable; +import java.util.List; + +public interface IWillContainer { + + double getMaxContained(ItemStack stack); + + @Nullable + default DemonWillHolder getDemonWill(ItemStack stack) { + return DemonWillHolder.fromStack(stack); + } + + default void applyDemonWill(ItemStack stack, DemonWillHolder holder) { + NBTTagCompound tag = stack.getTagCompound(); + if (tag == null) + stack.setTagCompound(tag = new NBTTagCompound()); + + tag.setTag("demonWill", holder.serializeNBT()); + } + + static void appendTooltip(ItemStack stack, List tooltip) { + if (!(stack.getItem() instanceof IWillContainer)) + return; + + DemonWillHolder holder = ((IWillContainer) stack.getItem()).getDemonWill(stack); + if (holder == null) + return; + + // TODO - Localize + tooltip.add("Will: " + holder.getType()); + tooltip.add("Amount: " + holder.getAmount()); + } +} diff --git a/src/main/java/com/wayoftime/bloodmagic/event/DemonicWillEvent.java b/src/main/java/com/wayoftime/bloodmagic/event/DemonicWillEvent.java new file mode 100644 index 00000000..f8c80fee --- /dev/null +++ b/src/main/java/com/wayoftime/bloodmagic/event/DemonicWillEvent.java @@ -0,0 +1,52 @@ +package com.wayoftime.bloodmagic.event; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fml.common.eventhandler.Cancelable; +import net.minecraftforge.fml.common.eventhandler.Event; + +public class DemonicWillEvent extends Event { + + @Cancelable + public static class GatherWillDrops extends DemonicWillEvent { + + private final EntityPlayer player; + private final EntityLivingBase attacked; + private final ItemStack stack; + private final int looting; + private double droppedWill; + + public GatherWillDrops(EntityPlayer player, EntityLivingBase attacked, ItemStack stack, int looting, double droppedWill) { + this.player = player; + this.attacked = attacked; + this.stack = stack; + this.looting = looting; + this.droppedWill = droppedWill; + } + + public EntityPlayer getPlayer() { + return player; + } + + public EntityLivingBase getAttacked() { + return attacked; + } + + public ItemStack getStack() { + return stack; + } + + public int getLooting() { + return looting; + } + + public double getDroppedWill() { + return droppedWill; + } + + public void setDroppedWill(double droppedWill) { + this.droppedWill = droppedWill; + } + } +} diff --git a/src/main/java/com/wayoftime/bloodmagic/item/ItemMonsterSoul.java b/src/main/java/com/wayoftime/bloodmagic/item/ItemMonsterSoul.java new file mode 100644 index 00000000..cdbd3224 --- /dev/null +++ b/src/main/java/com/wayoftime/bloodmagic/item/ItemMonsterSoul.java @@ -0,0 +1,56 @@ +package com.wayoftime.bloodmagic.item; + +import com.wayoftime.bloodmagic.BloodMagic; +import com.wayoftime.bloodmagic.core.util.register.IModelLocator; +import com.wayoftime.bloodmagic.core.will.DemonWill; +import com.wayoftime.bloodmagic.core.will.DemonWillHolder; +import com.wayoftime.bloodmagic.core.will.IWillContainer; +import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.ItemStack; +import net.minecraft.util.NonNullList; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import java.util.List; + +public class ItemMonsterSoul extends ItemMundane implements IWillContainer, IModelLocator { + + public ItemMonsterSoul() { + super("monster_soul"); + + setMaxStackSize(1); + addPropertyOverride(new ResourceLocation(BloodMagic.MODID, "will"), (stack, worldIn, entityIn) -> { + DemonWillHolder holder = getDemonWill(stack); + return holder == null || holder.getType() == DemonWill.RAW ? 0F : Float.parseFloat("0." + holder.getType().ordinal()); + }); + } + + @Override + public void getSubItems(CreativeTabs tab, NonNullList items) { + for (DemonWill will : DemonWill.VALUES) { + ItemStack stack = new ItemStack(this); + applyDemonWill(stack, new DemonWillHolder(will, 0)); + items.add(stack); + } + } + + @Override + public void addInformation(ItemStack stack, @Nullable World worldIn, List tooltip, ITooltipFlag flagIn) { + IWillContainer.appendTooltip(stack, tooltip); + } + + @Override + public double getMaxContained(ItemStack stack) { + DemonWillHolder holder = getDemonWill(stack); + return holder == null ? Double.MAX_VALUE : holder.getAmount(); + } + + @Nonnull + @Override + public ResourceLocation getModelPath() { + return new ResourceLocation(BloodMagic.MODID, "soul/monster_soul"); + } +} diff --git a/src/main/java/com/wayoftime/bloodmagic/item/ItemSentientSword.java b/src/main/java/com/wayoftime/bloodmagic/item/ItemSentientSword.java new file mode 100644 index 00000000..9c351f71 --- /dev/null +++ b/src/main/java/com/wayoftime/bloodmagic/item/ItemSentientSword.java @@ -0,0 +1,50 @@ +package com.wayoftime.bloodmagic.item; + +import com.wayoftime.bloodmagic.BloodMagic; +import com.wayoftime.bloodmagic.core.util.register.IModelLocator; +import com.wayoftime.bloodmagic.core.will.DemonWill; +import com.wayoftime.bloodmagic.core.will.ISentientEquipment; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.NonNullList; +import net.minecraft.util.ResourceLocation; + +import javax.annotation.Nonnull; + +public class ItemSentientSword extends ItemSword implements ISentientEquipment, IModelLocator { + + public ItemSentientSword() { + super(ToolMaterial.IRON); + + setRegistryName("sentient_sword"); + setTranslationKey(BloodMagic.MODID + ":sentient_sword"); + setCreativeTab(BloodMagic.TAB_BM); + + addPropertyOverride(new ResourceLocation(BloodMagic.MODID, "will"), (stack, worldIn, entityIn) -> Float.parseFloat("0." + getDemonWill(stack).ordinal())); + addPropertyOverride(new ResourceLocation(BloodMagic.MODID, "active"), (stack, worldIn, entityIn) -> isActivated(stack) ? 1.0F : 0.0F); + } + + @Override + public void getSubItems(CreativeTabs tab, NonNullList items) { + for (DemonWill will : DemonWill.VALUES) { + ItemStack stack = new ItemStack(this); + NBTTagCompound tag = new NBTTagCompound(); + tag.setString("willType", will.name()); + stack.setTagCompound(tag); + items.add(stack); + } + } + + @Override + public double getWillDropAmount(ItemStack stack) { + return 1; + } + + @Nonnull + @Override + public ResourceLocation getModelPath() { + return new ResourceLocation(BloodMagic.MODID, "soul/sentient_sword"); + } +} diff --git a/src/main/resources/assets/bloodmagic/lang/en_US.lang b/src/main/resources/assets/bloodmagic/lang/en_US.lang index e470cfe6..c65b4d7a 100644 --- a/src/main/resources/assets/bloodmagic/lang/en_US.lang +++ b/src/main/resources/assets/bloodmagic/lang/en_US.lang @@ -57,6 +57,8 @@ item.bloodmagic:demon_will_crystal_corrosive.name=Corrosive Demon Will Crystal item.bloodmagic:demon_will_crystal_destructive.name=Destructive Demon Will Crystal item.bloodmagic:demon_will_crystal_vengeful.name=Vengeful Demon Will Crystal item.bloodmagic:demon_will_crystal_steadfast.name=Steadfast Demon Will Crystal +item.bloodmagic:sentient_sword.name=Sentient Sword +item.bloodmagic:monster_soul.name=Monster Soul # Death @@ -68,6 +70,9 @@ fluid.bloodmagic:life_essence=Life Essence # Living Upgrades +upgrade.bloodmagic:arrow_protect.name=Arrow Protect +upgrade.bloodmagic:arrow_shot.name=Arrow Shot +upgrade.bloodmagic:critical_strike.name=Critical Strike upgrade.bloodmagic:jump.name=Jump Boost # Chat diff --git a/src/main/resources/assets/bloodmagic/models/item/soul/monster_soul.json b/src/main/resources/assets/bloodmagic/models/item/soul/monster_soul.json new file mode 100644 index 00000000..d41f788f --- /dev/null +++ b/src/main/resources/assets/bloodmagic/models/item/soul/monster_soul.json @@ -0,0 +1,32 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "bloodmagic:items/soul/monster_soul_raw" + }, + "overrides": [ + { + "predicate": { + "bloodmagic:will": 0.1 + }, + "model": "bloodmagic:item/soul/monster_soul_corrosive" + }, + { + "predicate": { + "bloodmagic:will": 0.2 + }, + "model": "bloodmagic:item/soul/monster_soul_destructive" + }, + { + "predicate": { + "bloodmagic:will": 0.3 + }, + "model": "bloodmagic:item/soul/monster_soul_vengeful" + }, + { + "predicate": { + "bloodmagic:will": 0.4 + }, + "model": "bloodmagic:item/soul/monster_soul_steadfast" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/bloodmagic/models/item/soul/monster_soul_corrosive.json b/src/main/resources/assets/bloodmagic/models/item/soul/monster_soul_corrosive.json new file mode 100644 index 00000000..27b7461b --- /dev/null +++ b/src/main/resources/assets/bloodmagic/models/item/soul/monster_soul_corrosive.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "bloodmagic:items/soul/monster_soul_corrosive" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/bloodmagic/models/item/soul/monster_soul_destructive.json b/src/main/resources/assets/bloodmagic/models/item/soul/monster_soul_destructive.json new file mode 100644 index 00000000..e1224220 --- /dev/null +++ b/src/main/resources/assets/bloodmagic/models/item/soul/monster_soul_destructive.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "bloodmagic:items/soul/monster_soul_destructive" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/bloodmagic/models/item/soul/monster_soul_raw.json b/src/main/resources/assets/bloodmagic/models/item/soul/monster_soul_raw.json new file mode 100644 index 00000000..2a9f7797 --- /dev/null +++ b/src/main/resources/assets/bloodmagic/models/item/soul/monster_soul_raw.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "bloodmagic:items/soul/monster_soul_raw" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/bloodmagic/models/item/soul/monster_soul_steadfast.json b/src/main/resources/assets/bloodmagic/models/item/soul/monster_soul_steadfast.json new file mode 100644 index 00000000..714f481e --- /dev/null +++ b/src/main/resources/assets/bloodmagic/models/item/soul/monster_soul_steadfast.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "bloodmagic:items/soul/monster_soul_steadfast" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/bloodmagic/models/item/soul/monster_soul_vengeful.json b/src/main/resources/assets/bloodmagic/models/item/soul/monster_soul_vengeful.json new file mode 100644 index 00000000..bf62db7e --- /dev/null +++ b/src/main/resources/assets/bloodmagic/models/item/soul/monster_soul_vengeful.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "bloodmagic:items/soul/monster_soul_vengeful" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/bloodmagic/models/item/soul/sentient_sword.json b/src/main/resources/assets/bloodmagic/models/item/soul/sentient_sword.json new file mode 100644 index 00000000..41be86f5 --- /dev/null +++ b/src/main/resources/assets/bloodmagic/models/item/soul/sentient_sword.json @@ -0,0 +1,70 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "bloodmagic:items/soul/sentient_sword_raw" + }, + "overrides": [ + { + "predicate": { + "bloodmagic:active": 1.0 + }, + "model": "bloodmagic:item/soul/sentient_sword_raw_active" + }, + { + "predicate": { + "bloodmagic:will": 0.1, + "bloodmagic:active": 0.0 + }, + "model": "bloodmagic:item/soul/sentient_sword_corrosive" + }, + { + "predicate": { + "bloodmagic:will": 0.1, + "bloodmagic:active": 1.0 + }, + "model": "bloodmagic:item/soul/sentient_sword_corrosive_active" + }, + { + "predicate": { + "bloodmagic:will": 0.2, + "bloodmagic:active": 0.0 + }, + "model": "bloodmagic:item/soul/sentient_sword_destructive" + }, + { + "predicate": { + "bloodmagic:will": 0.2, + "bloodmagic:active": 1.0 + }, + "model": "bloodmagic:item/soul/sentient_sword_destructive_active" + }, + { + "predicate": { + "bloodmagic:will": 0.3, + "bloodmagic:active": 0.0 + }, + "model": "bloodmagic:item/soul/sentient_sword_vengeful" + }, + { + "predicate": { + "bloodmagic:will": 0.3, + "bloodmagic:active": 1.0 + }, + "model": "bloodmagic:item/soul/sentient_sword_vengeful_active" + }, + { + "predicate": { + "bloodmagic:will": 0.4, + "bloodmagic:active": 0.0 + }, + "model": "bloodmagic:item/soul/sentient_sword_steadfast" + }, + { + "predicate": { + "bloodmagic:will": 0.4, + "bloodmagic:active": 1.0 + }, + "model": "bloodmagic:item/soul/sentient_sword_steadfast_active" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/bloodmagic/models/item/soul/sentient_sword_corrosive.json b/src/main/resources/assets/bloodmagic/models/item/soul/sentient_sword_corrosive.json new file mode 100644 index 00000000..7fffc02f --- /dev/null +++ b/src/main/resources/assets/bloodmagic/models/item/soul/sentient_sword_corrosive.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "bloodmagic:items/soul/sentient_sword_corrosive" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/bloodmagic/models/item/soul/sentient_sword_corrosive_active.json b/src/main/resources/assets/bloodmagic/models/item/soul/sentient_sword_corrosive_active.json new file mode 100644 index 00000000..8a82d0ed --- /dev/null +++ b/src/main/resources/assets/bloodmagic/models/item/soul/sentient_sword_corrosive_active.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "bloodmagic:items/soul/sentient_sword_corrosive_active" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/bloodmagic/models/item/soul/sentient_sword_destructive.json b/src/main/resources/assets/bloodmagic/models/item/soul/sentient_sword_destructive.json new file mode 100644 index 00000000..eb1f96c1 --- /dev/null +++ b/src/main/resources/assets/bloodmagic/models/item/soul/sentient_sword_destructive.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "bloodmagic:items/soul/sentient_sword_destructive" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/bloodmagic/models/item/soul/sentient_sword_destructive_active.json b/src/main/resources/assets/bloodmagic/models/item/soul/sentient_sword_destructive_active.json new file mode 100644 index 00000000..e20babf3 --- /dev/null +++ b/src/main/resources/assets/bloodmagic/models/item/soul/sentient_sword_destructive_active.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "bloodmagic:items/soul/sentient_sword_destructive_active" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/bloodmagic/models/item/soul/sentient_sword_raw_active.json b/src/main/resources/assets/bloodmagic/models/item/soul/sentient_sword_raw_active.json new file mode 100644 index 00000000..888581e1 --- /dev/null +++ b/src/main/resources/assets/bloodmagic/models/item/soul/sentient_sword_raw_active.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "bloodmagic:items/soul/sentient_sword_raw_active" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/bloodmagic/models/item/soul/sentient_sword_steadfast.json b/src/main/resources/assets/bloodmagic/models/item/soul/sentient_sword_steadfast.json new file mode 100644 index 00000000..e41cdbbc --- /dev/null +++ b/src/main/resources/assets/bloodmagic/models/item/soul/sentient_sword_steadfast.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "bloodmagic:items/soul/sentient_sword_steadfast" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/bloodmagic/models/item/soul/sentient_sword_steadfast_active.json b/src/main/resources/assets/bloodmagic/models/item/soul/sentient_sword_steadfast_active.json new file mode 100644 index 00000000..8eac4d16 --- /dev/null +++ b/src/main/resources/assets/bloodmagic/models/item/soul/sentient_sword_steadfast_active.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "bloodmagic:items/soul/sentient_sword_steadfast_active" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/bloodmagic/models/item/soul/sentient_sword_vengeful.json b/src/main/resources/assets/bloodmagic/models/item/soul/sentient_sword_vengeful.json new file mode 100644 index 00000000..c06e6227 --- /dev/null +++ b/src/main/resources/assets/bloodmagic/models/item/soul/sentient_sword_vengeful.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "bloodmagic:items/soul/sentient_sword_vengeful" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/bloodmagic/models/item/soul/sentient_sword_vengeful_active.json b/src/main/resources/assets/bloodmagic/models/item/soul/sentient_sword_vengeful_active.json new file mode 100644 index 00000000..45418c5d --- /dev/null +++ b/src/main/resources/assets/bloodmagic/models/item/soul/sentient_sword_vengeful_active.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "bloodmagic:items/soul/sentient_sword_vengeful_active" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/bloodmagic/textures/items/soul/monster_soul_corrosive.png b/src/main/resources/assets/bloodmagic/textures/items/soul/monster_soul_corrosive.png new file mode 100644 index 00000000..7fa94bb5 Binary files /dev/null and b/src/main/resources/assets/bloodmagic/textures/items/soul/monster_soul_corrosive.png differ diff --git a/src/main/resources/assets/bloodmagic/textures/items/soul/monster_soul_destructive.png b/src/main/resources/assets/bloodmagic/textures/items/soul/monster_soul_destructive.png new file mode 100644 index 00000000..6b2973ed Binary files /dev/null and b/src/main/resources/assets/bloodmagic/textures/items/soul/monster_soul_destructive.png differ diff --git a/src/main/resources/assets/bloodmagic/textures/items/soul/monster_soul_raw.png b/src/main/resources/assets/bloodmagic/textures/items/soul/monster_soul_raw.png new file mode 100644 index 00000000..63ebca42 Binary files /dev/null and b/src/main/resources/assets/bloodmagic/textures/items/soul/monster_soul_raw.png differ diff --git a/src/main/resources/assets/bloodmagic/textures/items/soul/monster_soul_steadfast.png b/src/main/resources/assets/bloodmagic/textures/items/soul/monster_soul_steadfast.png new file mode 100644 index 00000000..729f4fb8 Binary files /dev/null and b/src/main/resources/assets/bloodmagic/textures/items/soul/monster_soul_steadfast.png differ diff --git a/src/main/resources/assets/bloodmagic/textures/items/soul/monster_soul_vengeful.png b/src/main/resources/assets/bloodmagic/textures/items/soul/monster_soul_vengeful.png new file mode 100644 index 00000000..d4f1683b Binary files /dev/null and b/src/main/resources/assets/bloodmagic/textures/items/soul/monster_soul_vengeful.png differ diff --git a/src/main/resources/assets/bloodmagic/textures/items/soul/sentient_sword_corrosive.png b/src/main/resources/assets/bloodmagic/textures/items/soul/sentient_sword_corrosive.png new file mode 100644 index 00000000..e0bd985f Binary files /dev/null and b/src/main/resources/assets/bloodmagic/textures/items/soul/sentient_sword_corrosive.png differ diff --git a/src/main/resources/assets/bloodmagic/textures/items/soul/sentient_sword_corrosive_active.png b/src/main/resources/assets/bloodmagic/textures/items/soul/sentient_sword_corrosive_active.png new file mode 100644 index 00000000..21d5375d Binary files /dev/null and b/src/main/resources/assets/bloodmagic/textures/items/soul/sentient_sword_corrosive_active.png differ diff --git a/src/main/resources/assets/bloodmagic/textures/items/soul/sentient_sword_destructive.png b/src/main/resources/assets/bloodmagic/textures/items/soul/sentient_sword_destructive.png new file mode 100644 index 00000000..d1f84dc5 Binary files /dev/null and b/src/main/resources/assets/bloodmagic/textures/items/soul/sentient_sword_destructive.png differ diff --git a/src/main/resources/assets/bloodmagic/textures/items/soul/sentient_sword_destructive_active.png b/src/main/resources/assets/bloodmagic/textures/items/soul/sentient_sword_destructive_active.png new file mode 100644 index 00000000..f522b905 Binary files /dev/null and b/src/main/resources/assets/bloodmagic/textures/items/soul/sentient_sword_destructive_active.png differ diff --git a/src/main/resources/assets/bloodmagic/textures/items/soul/sentient_sword_raw.png b/src/main/resources/assets/bloodmagic/textures/items/soul/sentient_sword_raw.png new file mode 100644 index 00000000..0bcaf3d9 Binary files /dev/null and b/src/main/resources/assets/bloodmagic/textures/items/soul/sentient_sword_raw.png differ diff --git a/src/main/resources/assets/bloodmagic/textures/items/soul/sentient_sword_raw_active.png b/src/main/resources/assets/bloodmagic/textures/items/soul/sentient_sword_raw_active.png new file mode 100644 index 00000000..02b5bd57 Binary files /dev/null and b/src/main/resources/assets/bloodmagic/textures/items/soul/sentient_sword_raw_active.png differ diff --git a/src/main/resources/assets/bloodmagic/textures/items/soul/sentient_sword_steadfast.png b/src/main/resources/assets/bloodmagic/textures/items/soul/sentient_sword_steadfast.png new file mode 100644 index 00000000..ade2c703 Binary files /dev/null and b/src/main/resources/assets/bloodmagic/textures/items/soul/sentient_sword_steadfast.png differ diff --git a/src/main/resources/assets/bloodmagic/textures/items/soul/sentient_sword_steadfast_active.png b/src/main/resources/assets/bloodmagic/textures/items/soul/sentient_sword_steadfast_active.png new file mode 100644 index 00000000..465921dc Binary files /dev/null and b/src/main/resources/assets/bloodmagic/textures/items/soul/sentient_sword_steadfast_active.png differ diff --git a/src/main/resources/assets/bloodmagic/textures/items/soul/sentient_sword_vengeful.png b/src/main/resources/assets/bloodmagic/textures/items/soul/sentient_sword_vengeful.png new file mode 100644 index 00000000..cb85742d Binary files /dev/null and b/src/main/resources/assets/bloodmagic/textures/items/soul/sentient_sword_vengeful.png differ diff --git a/src/main/resources/assets/bloodmagic/textures/items/soul/sentient_sword_vengeful_active.png b/src/main/resources/assets/bloodmagic/textures/items/soul/sentient_sword_vengeful_active.png new file mode 100644 index 00000000..0bd8bf57 Binary files /dev/null and b/src/main/resources/assets/bloodmagic/textures/items/soul/sentient_sword_vengeful_active.png differ diff --git a/src/main/resources/assets/bloodmagic_guide/lang/en_us.lang b/src/main/resources/assets/bloodmagic_guide/lang/en_us.lang new file mode 100644 index 00000000..ecb62b1c --- /dev/null +++ b/src/main/resources/assets/bloodmagic_guide/lang/en_us.lang @@ -0,0 +1,3 @@ +# simple descriptions as we go so there's *something* for everything +guide.bloodmagic:living_armor_upgrade_jump=Increases jump height. Decreases fall damage. Above level 2, it will also increase forward momentum while jumping. +guide.bloodmagic:living_armor_upgrade_arrow_protect=Decreases damage taken from projectiles. \ No newline at end of file