Search in sources :

Example 1 with LivingArmourUpgradeBattleHungry

use of WayofTime.bloodmagic.livingArmour.downgrade.LivingArmourUpgradeBattleHungry in project BloodMagic by WayofTime.

the class ModRecipes method addLivingArmourDowngradeRecipes.

public static void addLivingArmourDowngradeRecipes() {
    String messageBase = "ritual.bloodmagic.downgradeRitual.dialogue.";
    ItemStack bowStack = new ItemStack(Items.BOW);
    ItemStack bottleStack = new ItemStack(Items.POTIONITEM, 1, 0);
    ItemStack swordStack = new ItemStack(Items.STONE_SWORD);
    ItemStack goldenAppleStack = new ItemStack(Items.GOLDEN_APPLE);
    ItemStack fleshStack = new ItemStack(Items.ROTTEN_FLESH);
    ItemStack shieldStack = new ItemStack(Items.SHIELD);
    ItemStack pickStack = new ItemStack(Items.STONE_PICKAXE);
    ItemStack minecartStack = new ItemStack(Items.MINECART);
    ItemStack stringStack = new ItemStack(Items.STRING);
    Map<ItemStack, Pair<String, int[]>> dialogueMap = new HashMap<>();
    dialogueMap.put(bowStack, Pair.of("bow", new int[] { 1, 100, 300, 500 }));
    dialogueMap.put(bottleStack, Pair.of("quenched", new int[] { 1, 100, 300, 500 }));
    dialogueMap.put(swordStack, Pair.of("dulledBlade", new int[] { 1, 100, 300, 500, 700 }));
    dialogueMap.put(goldenAppleStack, Pair.of("slowHeal", new int[] { 1, 100, 300, 500, 700 }));
    for (Entry<ItemStack, Pair<String, int[]>> entry : dialogueMap.entrySet()) {
        ItemStack keyStack = entry.getKey();
        String str = entry.getValue().getKey();
        Map<Integer, List<ITextComponent>> textMap = new HashMap<>();
        for (int tick : entry.getValue().getValue()) {
            List<ITextComponent> textList = new ArrayList<>();
            textList.add(new TextComponentTranslation("\u00A74%s", new TextComponentTranslation(messageBase + str + "." + tick)));
            textMap.put(tick, textList);
        }
        LivingArmourDowngradeRecipeRegistry.registerDialog(keyStack, textMap);
    }
    LivingArmourDowngradeRecipeRegistry.registerRecipe(new LivingArmourUpgradeStormTrooper(0), bowStack, Items.ARROW, "string", "ingotIron", "ingotIron");
    LivingArmourDowngradeRecipeRegistry.registerRecipe(new LivingArmourUpgradeStormTrooper(1), bowStack, Items.SPECTRAL_ARROW, "ingotGold", "dustRedstone", "dustGlowstone", "gemLapis");
    LivingArmourDowngradeRecipeRegistry.registerRecipe(new LivingArmourUpgradeStormTrooper(2), bowStack, "gemDiamond", Items.FIRE_CHARGE, Items.BLAZE_ROD, "feather");
    LivingArmourDowngradeRecipeRegistry.registerRecipe(new LivingArmourUpgradeStormTrooper(3), bowStack, Items.PRISMARINE_SHARD, Items.BLAZE_ROD, "feather", "feather");
    LivingArmourDowngradeRecipeRegistry.registerRecipe(new LivingArmourUpgradeStormTrooper(4), bowStack, new ItemStack(Items.TIPPED_ARROW, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.TIPPED_ARROW, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.TIPPED_ARROW, 1, OreDictionary.WILDCARD_VALUE));
    // LivingArmourDowngradeRecipeRegistry.registerDialog(bowStack, bowMap);
    LivingArmourDowngradeRecipeRegistry.registerRecipe(new LivingArmourUpgradeQuenched(0), bottleStack, Items.DRAGON_BREATH);
    LivingArmourDowngradeRecipeRegistry.registerRecipe(new LivingArmourUpgradeCrippledArm(0), shieldStack, "gemDiamond");
    for (int i = 0; i < 10; i++) {
        addRecipeForTieredDowngrade(new LivingArmourUpgradeMeleeDecrease(i), swordStack, i);
        addRecipeForTieredDowngrade(new LivingArmourUpgradeSlowHeal(i), goldenAppleStack, i);
        addRecipeForTieredDowngrade(new LivingArmourUpgradeBattleHungry(i), fleshStack, i);
        addRecipeForTieredDowngrade(new LivingArmourUpgradeDigSlowdown(i), pickStack, i);
        addRecipeForTieredDowngrade(new LivingArmourUpgradeDisoriented(i), minecartStack, i);
        addRecipeForTieredDowngrade(new LivingArmourUpgradeSlowness(i), stringStack, i);
    }
}
Also used : LivingArmourUpgradeSlowHeal(WayofTime.bloodmagic.livingArmour.downgrade.LivingArmourUpgradeSlowHeal) LivingArmourUpgradeBattleHungry(WayofTime.bloodmagic.livingArmour.downgrade.LivingArmourUpgradeBattleHungry) TextComponentTranslation(net.minecraft.util.text.TextComponentTranslation) LivingArmourUpgradeSlowness(WayofTime.bloodmagic.livingArmour.downgrade.LivingArmourUpgradeSlowness) HashMap(java.util.HashMap) ITextComponent(net.minecraft.util.text.ITextComponent) ArrayList(java.util.ArrayList) LivingArmourUpgradeMeleeDecrease(WayofTime.bloodmagic.livingArmour.downgrade.LivingArmourUpgradeMeleeDecrease) LivingArmourUpgradeDigSlowdown(WayofTime.bloodmagic.livingArmour.downgrade.LivingArmourUpgradeDigSlowdown) LivingArmourUpgradeCrippledArm(WayofTime.bloodmagic.livingArmour.downgrade.LivingArmourUpgradeCrippledArm) LivingArmourUpgradeQuenched(WayofTime.bloodmagic.livingArmour.downgrade.LivingArmourUpgradeQuenched) List(java.util.List) ArrayList(java.util.ArrayList) ItemStack(net.minecraft.item.ItemStack) LivingArmourUpgradeStormTrooper(WayofTime.bloodmagic.livingArmour.downgrade.LivingArmourUpgradeStormTrooper) LivingArmourUpgradeDisoriented(WayofTime.bloodmagic.livingArmour.downgrade.LivingArmourUpgradeDisoriented) Pair(org.apache.commons.lang3.tuple.Pair)

Example 2 with LivingArmourUpgradeBattleHungry

use of WayofTime.bloodmagic.livingArmour.downgrade.LivingArmourUpgradeBattleHungry in project BloodMagic by WayofTime.

the class GenericHandler method onEntityHurt.

@SubscribeEvent
public static void onEntityHurt(LivingHurtEvent event) {
    if (event.getEntity().getEntityWorld().isRemote)
        return;
    if (event.getSource().getTrueSource() instanceof EntityPlayer && !PlayerHelper.isFakePlayer((EntityPlayer) event.getSource().getTrueSource())) {
        EntityPlayer player = (EntityPlayer) event.getSource().getTrueSource();
        if (!player.getItemStackFromSlot(EntityEquipmentSlot.CHEST).isEmpty() && player.getItemStackFromSlot(EntityEquipmentSlot.CHEST).getItem() instanceof ItemPackSacrifice) {
            ItemPackSacrifice pack = (ItemPackSacrifice) player.getItemStackFromSlot(EntityEquipmentSlot.CHEST).getItem();
            boolean shouldSyphon = pack.getStoredLP(player.getItemStackFromSlot(EntityEquipmentSlot.CHEST)) < pack.CAPACITY;
            float damageDone = event.getEntityLiving().getHealth() < event.getAmount() ? event.getAmount() - event.getEntityLiving().getHealth() : event.getAmount();
            int totalLP = Math.round(damageDone * ConfigHandler.values.coatOfArmsConversion);
            if (shouldSyphon)
                ItemHelper.LPContainer.addLPToItem(player.getItemStackFromSlot(EntityEquipmentSlot.CHEST), totalLP, pack.CAPACITY);
        }
        if (LivingArmour.hasFullSet(player)) {
            ItemStack chestStack = player.getItemStackFromSlot(EntityEquipmentSlot.CHEST);
            LivingArmour armour = ItemLivingArmour.getLivingArmour(chestStack);
            if (armour != null) {
                LivingArmourUpgrade upgrade = ItemLivingArmour.getUpgrade(BloodMagic.MODID + ".upgrade.battleHunger", chestStack);
                if (upgrade instanceof LivingArmourUpgradeBattleHungry) {
                    ((LivingArmourUpgradeBattleHungry) upgrade).resetTimer();
                }
            }
        }
    }
}
Also used : LivingArmourUpgradeBattleHungry(WayofTime.bloodmagic.livingArmour.downgrade.LivingArmourUpgradeBattleHungry) ItemLivingArmour(WayofTime.bloodmagic.item.armour.ItemLivingArmour) LivingArmour(WayofTime.bloodmagic.livingArmour.LivingArmour) LivingArmourUpgrade(WayofTime.bloodmagic.livingArmour.LivingArmourUpgrade) EntityPlayer(net.minecraft.entity.player.EntityPlayer) ItemStack(net.minecraft.item.ItemStack) ItemPackSacrifice(WayofTime.bloodmagic.item.gear.ItemPackSacrifice) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Aggregations

LivingArmourUpgradeBattleHungry (WayofTime.bloodmagic.livingArmour.downgrade.LivingArmourUpgradeBattleHungry)2 ItemStack (net.minecraft.item.ItemStack)2 ItemLivingArmour (WayofTime.bloodmagic.item.armour.ItemLivingArmour)1 ItemPackSacrifice (WayofTime.bloodmagic.item.gear.ItemPackSacrifice)1 LivingArmour (WayofTime.bloodmagic.livingArmour.LivingArmour)1 LivingArmourUpgrade (WayofTime.bloodmagic.livingArmour.LivingArmourUpgrade)1 LivingArmourUpgradeCrippledArm (WayofTime.bloodmagic.livingArmour.downgrade.LivingArmourUpgradeCrippledArm)1 LivingArmourUpgradeDigSlowdown (WayofTime.bloodmagic.livingArmour.downgrade.LivingArmourUpgradeDigSlowdown)1 LivingArmourUpgradeDisoriented (WayofTime.bloodmagic.livingArmour.downgrade.LivingArmourUpgradeDisoriented)1 LivingArmourUpgradeMeleeDecrease (WayofTime.bloodmagic.livingArmour.downgrade.LivingArmourUpgradeMeleeDecrease)1 LivingArmourUpgradeQuenched (WayofTime.bloodmagic.livingArmour.downgrade.LivingArmourUpgradeQuenched)1 LivingArmourUpgradeSlowHeal (WayofTime.bloodmagic.livingArmour.downgrade.LivingArmourUpgradeSlowHeal)1 LivingArmourUpgradeSlowness (WayofTime.bloodmagic.livingArmour.downgrade.LivingArmourUpgradeSlowness)1 LivingArmourUpgradeStormTrooper (WayofTime.bloodmagic.livingArmour.downgrade.LivingArmourUpgradeStormTrooper)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 List (java.util.List)1 EntityPlayer (net.minecraft.entity.player.EntityPlayer)1 ITextComponent (net.minecraft.util.text.ITextComponent)1 TextComponentTranslation (net.minecraft.util.text.TextComponentTranslation)1