2
0
Fork 0

Created new LOTREnchantment type, to replace infused to be a +1 damage modifier (doesnt work)

main
KeyLime17 5 months ago
parent 390b0560e1
commit 3d05c80bca

@ -14,6 +14,7 @@ import lotr.common.LOTRMod;
import lotr.common.LOTRDimension;
import lotr.common.enchant.LOTREnchantment;
import lotr.common.enchant.LOTREnchantmentHelper;
import lotr.common.entity.item.LOTREntityArrowPoisoned;
import lotr.common.entity.npc.LOTREntityOrc;
import lotr.common.entity.projectile.LOTREntityCrossbowBolt;
import lotr.common.entity.projectile.LOTREntityDart;
@ -158,7 +159,6 @@ public class CinderEventHandler implements IFuelHandler {
@SubscribeEvent
public void onLivingHurt(LivingHurtEvent event) {
if (event.entityLiving == null || event.source.getEntity() == null) {
return;
}
@ -168,6 +168,18 @@ public class CinderEventHandler implements IFuelHandler {
World world = entity.worldObj;
DamageSource source = event.source;
if (event.source.getSourceOfDamage() instanceof LOTREntityArrowPoisoned && !world.isRemote) {
LOTREntityArrowPoisoned arrow = (LOTREntityArrowPoisoned) event.source.getSourceOfDamage();
Entity shooter = arrow.shootingEntity;
if (!(shooter instanceof EntityPlayerMP)) return;
EntityPlayerMP player = (EntityPlayerMP) shooter;
ItemStack item = player.inventory.getCurrentItem();
if (item == null || item.getItem() != CinderLoE.bowLurtz) return;
event.setCanceled(true);
if (entity.isPotionActive(Potion.poison.id)) entity.removePotionEffect(Potion.poison.id);
entity.addPotionEffect(new PotionEffect(LOTRPoisonedDrinks.killingPoison.id, 5));
}
//Elven Arrow, deals more damage to orc kind
// Utilizing the new Util, test if it works!
if (!world.isRemote && entity instanceof LOTREntityOrc && event.source.getSourceOfDamage() instanceof EntityElvenArrow) {

@ -0,0 +1,66 @@
package com.zivilon.cinder_loe.enchants;
import lotr.common.enchant.*;
import lotr.common.item.LOTRItemBalrogWhip;
import lotr.common.item.LOTRItemThrowingAxe;
import lotr.common.item.LOTRMaterial;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;
import net.minecraft.util.StatCollector;
public class LOTREnchantmentExtraSpecial extends LOTREnchantmentWeaponSpecial {
private final float baseDamageBoost;
private boolean compatibleBane = true;
private boolean compatibleOtherSpecial = false;
public LOTREnchantmentExtraSpecial(String s, float boost) {
super(s);
this.baseDamageBoost = boost;
setValueModifier(3.0F);
}
public float getBaseDamageBoost() {
return this.baseDamageBoost;
}
public float getEntitySpecificDamage(EntityLivingBase entity) {
return 0.0f;
}
@Override
public String getDescription(ItemStack itemstack) {
if (itemstack != null && itemstack.getItem() instanceof LOTRItemThrowingAxe) {
return StatCollector.translateToLocalFormatted((String)"lotr.enchant.damage.desc.throw", (Object[])new Object[]{this.formatAdditive(this.baseDamageBoost)});
}
return StatCollector.translateToLocalFormatted((String)"lotr.enchant.damage.desc", (Object[])new Object[]{this.formatAdditive(this.baseDamageBoost)});
}
@Override
public boolean canApply(ItemStack itemstack, boolean considering) {
if (super.canApply(itemstack, considering)) {
Item item = itemstack.getItem();
return !(item instanceof LOTRItemBalrogWhip) || this != LOTREnchantment.fire && this != LOTREnchantment.chill;
}
return false;
}
@Override
public boolean isBeneficial() {
return this.baseDamageBoost >= 0.0f;
}
@Override
public boolean isCompatibleWith(LOTREnchantment other) {
if (!this.compatibleBane && other instanceof LOTREnchantmentBane) {
return false;
}
return this.compatibleOtherSpecial || !(other instanceof LOTREnchantmentWeaponSpecial) || ((LOTREnchantmentExtraSpecial)other).compatibleOtherSpecial;
}
}

@ -1,5 +1,6 @@
package com.zivilon.cinder_loe.mixins;
import com.zivilon.cinder_loe.enchants.LOTREnchantmentExtraSpecial;
import com.zivilon.cinder_loe.enchants.LOTREnchantmentWeakProtectionRanged;
import com.zivilon.cinder_loe.enchants.LOTREnchantmentArmorSpecial;
import com.zivilon.cinder_loe.util.Utilities;
@ -28,7 +29,7 @@ public class MixinLOTREnchantment {
LOTREnchantment protectRangedWeak2 = new LOTREnchantmentWeakProtectionRanged("protectRangedWeak2", -2).setEnchantWeight(0);
LOTREnchantment rangedWeak3 = new LOTREnchantmentRangedDamage("rangedWeak3", 0.25f);
LOTREnchantment weak4 = new LOTREnchantmentDamage("weak4", -3.0f).setEnchantWeight(0);
LOTREnchantment chill = new LOTREnchantmentDamage("strong5", 3.25f).setEnchantWeight(0);
LOTREnchantment chill = new LOTREnchantmentExtraSpecial("strong5", 1.0f).setEnchantWeight(0);
LOTREnchantment rangedStrong4 = new LOTREnchantmentRangedDamage("rangedStrong4", 1.4f).setEnchantWeight(0).setSkilful();
LOTREnchantment meleeReach2 = new LOTREnchantmentMeleeReach("meleeReach2", 1.33f).setEnchantWeight(0).setSkilful();
LOTREnchantment meleeSpeed2 = new LOTREnchantmentMeleeSpeed("meleeSpeed2", 1.33f).setEnchantWeight(0).setSkilful();
@ -36,8 +37,8 @@ public class MixinLOTREnchantment {
LOTREnchantment fireRepair = new LOTREnchantmentArmorSpecial("fireRepair").setEnchantWeight(0).setSkilful();
LOTREnchantment mountArmor = new LOTREnchantmentArmorSpecial("mountArmor").setEnchantWeight(0).setSkilful();
LOTREnchantment stealth = new LOTREnchantmentArmorSpecial("stealth").setEnchantWeight(0).setSkilful();
LOTREnchantment meleeSturdy = new LOTREnchantmentWeaponSpecial("meleeSturdy").setEnchantWeight(0);
LOTREnchantment armorSturdy = new LOTREnchantmentArmorSpecial("armorSturdy").setEnchantWeight(0);
LOTREnchantment meleeSturdy = new LOTREnchantmentWeaponSpecial("meleeSturdy").setEnchantWeight(0).setValueModifier(1);
LOTREnchantment armorSturdy = new LOTREnchantmentArmorSpecial("armorSturdy").setEnchantWeight(0).setValueModifier(1);
LOTREnchantment.allEnchantments.add(protectRangedWeak1);

@ -900,6 +900,10 @@ public abstract class MixinLOTRTradeEntriesOverrides {
new LOTRTradeEntry(new ItemStack(LOTRMod.bodyDale), 28),
new LOTRTradeEntry(new ItemStack(LOTRMod.legsDale), 24),
new LOTRTradeEntry(new ItemStack(LOTRMod.bootsDale), 16),
new LOTRTradeEntry(new ItemStack(CinderLoE.helmetEsgaroth), 100),
new LOTRTradeEntry(new ItemStack(CinderLoE.bodyEsgaroth), 100),
new LOTRTradeEntry(new ItemStack(CinderLoE.legsEsgaroth), 100),
new LOTRTradeEntry(new ItemStack(CinderLoE.bootsEsgaroth), 100),
new LOTRTradeEntry(new ItemStack(LOTRMod.blacksmithHammer), 18),
new LOTRTradeEntry(new ItemStack(Blocks.iron_bars, 8), 20),
new LOTRTradeEntry(new ItemStack(LOTRMod.bronzeBars, 8), 20),

Loading…
Cancel
Save