2
0
Fork 0

Added Effigy of Wrath

main
Shinare 4 months ago
parent 91b9e6d417
commit 9541283dae

@ -74,6 +74,7 @@ import lotr.client.render.entity.*;
import lotr.client.render.tileentity.LOTRRenderUtumnoPortal;
import lotr.common.LOTRCreativeTabs;
import lotr.common.LOTRMod;
import lotr.common.enchant.LOTREnchantment;
import lotr.common.entity.animal.*;
import lotr.common.entity.npc.*;
import lotr.common.entity.projectile.LOTREntityGandalfFireball;
@ -225,6 +226,7 @@ public class CinderLoE {
public static Item forgingKit;
public static Item fieldRepairKit;
public static Item cinderFurItem;
public static Item effigyOfWrath;
// Common tools/weapons
public static Item whip;
@ -796,10 +798,12 @@ public class CinderLoE {
forgingKit = (new ForgingKit());
fieldRepairKit = new FieldRepairKit().setUnlocalizedName("lotr:field_repair_kit").setTextureName("lotr:field_repair_kit");
effigyOfWrath = new LOTRItemEnchantment(LOTREnchantment.getEnchantmentByName("wrath")).setUnlocalizedName("lotr:effigy_of_wrath").setTextureName("lotr:effigy_of_wrath");
ItemRegistration.register(frostblade, "frostblade", 6200);
ItemRegistration.register(forgingKit,"forgingKit",6001);
ItemRegistration.register(fieldRepairKit,"fieldRepairKit",6002);
ItemRegistration.register(effigyOfWrath,"effigyOfWrath",6005);
ItemRegistration.register(whip, "whip", 6110);
ItemRegistration.register(daggervoid, "daggerVoid", 6201);
ItemRegistration.register(spearsolidgold, "spearsolidgold", 6202);

@ -42,6 +42,7 @@ public class MixinLOTREnchantment {
LOTREnchantment meleeSturdy = new LOTREnchantmentWeaponSpecial("meleeSturdy").setEnchantWeight(0).setValueModifier(1);
LOTREnchantment armorSturdy = new LOTREnchantmentArmorSpecial("armorSturdy").setEnchantWeight(0).setValueModifier(1);
LOTREnchantment baneNPC = new LOTREnchantmentBane("baneNPC", 4.0f, LOTREntityNPC.class).setEnchantWeight(0);
LOTREnchantment wrath = new LOTREnchantmentWeaponSpecial("wrath").setEnchantWeight(0);
LOTREnchantment.allEnchantments.add(baneNPC);
@ -59,6 +60,7 @@ public class MixinLOTREnchantment {
LOTREnchantment.allEnchantments.add(fireRepair);
LOTREnchantment.allEnchantments.add(mountArmor);
LOTREnchantment.allEnchantments.add(stealth);
LOTREnchantment.allEnchantments.add(wrath);
Field enchantsByNameField = LOTREnchantment.class.getDeclaredField("enchantsByName");
enchantsByNameField.setAccessible(true);
@ -80,6 +82,7 @@ public class MixinLOTREnchantment {
enchantsByName.put(fireRepair.enchantName, fireRepair);
enchantsByName.put(mountArmor.enchantName, mountArmor);
enchantsByName.put(stealth.enchantName, stealth);
enchantsByName.put(wrath.enchantName, wrath);
} catch (NoSuchFieldException | IllegalAccessException e) {
e.printStackTrace();

@ -0,0 +1,38 @@
package com.zivilon.cinder_loe.mixins;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import com.zivilon.cinder_loe.items.LoEGreatSword;
import lotr.common.item.LOTRItemBattleaxe;
import lotr.common.item.LOTRItemHammer;
import lotr.common.item.LOTRItemBalrogWhip;
import lotr.common.enchant.LOTREnchantment;
import lotr.common.enchant.LOTREnchantmentType;
import lotr.common.enchant.LOTREnchantmentHelper;
import lotr.common.enchant.LOTREnchantmentWeaponSpecial;
import lotr.common.item.LOTRWeaponStats;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
@Mixin(LOTREnchantmentWeaponSpecial.class)
public abstract class MixinLOTREnchantmentWeaponSpecial extends LOTREnchantment {
public MixinLOTREnchantmentWeaponSpecial(String s, LOTREnchantmentType type) {
super(s, type);
}
@Overwrite(remap = false)
public boolean canApply(ItemStack itemstack, boolean considering) {
if (super.canApply(itemstack, considering)) {
Item item = itemstack.getItem();
if (item instanceof LOTRItemBalrogWhip && (this == LOTREnchantment.fire || this == LOTREnchantment.chill))
return false;
if (this == LOTREnchantment.getEnchantmentByName("wrath"))
return (item instanceof LoEGreatSword || item instanceof LOTRItemBattleaxe || item instanceof LOTRItemHammer);
return true;
}
return false;
}
}

@ -62,7 +62,10 @@ public class DamageEvent {
ItemStack weapon = attacker.getHeldItem();
if (weapon != null) {
if (player.isBlocking() && angleDifference >= 135 && angleDifference <=225) {
if (LOTREnchantmentHelper.hasEnchant(weapon, LOTREnchantment.getEnchantmentByName("wrath"))) {
world.playSoundAtEntity(player, "cinder_loe:attack.wrath", 0.5F, 0.75F);
return cancel;
}
if (weapon.getItem() instanceof ItemAxe || weapon.getItem() instanceof LOTRItemAxe || weapon.getItem() instanceof LOTRItemBattleaxe) {
sword.damageItem((int) (event.damage *1.5), player); // Axes deal 150% the Durability damage
player.clearItemInUse();

@ -58,6 +58,7 @@ item.cinder_fur_item_3.name=Obsidian Warg Fur
item.cinder_fur_item_4.name=Black Bear Fur
item.cinder_fur_item_5.name=Brown Bear Fur
item.cinder_fur_item_6.name=Lioness Fur
item.lotr:effigy_of_wrath.name=Effigy of Wrath
item.lotr:helmetJade.name=Jade Helmet
item.lotr:bodyJade.name=Jade Chestplate
@ -408,6 +409,9 @@ lotr.enchant.meleeSturdy.desc.melee=Cannot degrade with low durability
lotr.enchant.meleeSturdy.desc.ranged=Cannot degrade with low durability
lotr.enchant.armorSturdy=Sturdy
lotr.enchant.armorSturdy.desc=Cannot degrade with low durability
lotr.enchant.wrath=Wrathful
lotr.enchant.wrath.desc.melee=Attacks cannot be blocked
lotr.enchant.wrath.desc.ranged=Attacks cannot be blocked
lotr.unit.Banner_Warg=Warg Rider Banner
lotr.unit.Banner_Horse=Mounted Banner Bearer

@ -57,5 +57,13 @@
"monkey/hurt1",
"monkey/hurt2"
]
},
"attack.wrath":
{
"category": "player",
"sounds":
[
"attack/wrath"
]
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 949 B

@ -65,7 +65,8 @@
"MixinLOTRGuiMap",
"MixinLOTREntityAIOrcSkirmish",
"MixinLOTREntityMountainTrollChieftain",
"overrides.MixinLOTRFaction"
"overrides.MixinLOTRFaction",
"MixinLOTREnchantmentWeaponSpecial"
],
"client": []
}

Loading…
Cancel
Save