2
0
Fork 0

mouth of sauron weapon fixed, and fixed some bugs

main
KeyLime17 4 months ago
parent ec0796ecc7
commit 7b0c5db301

@ -315,14 +315,16 @@ public class CinderEventHandler implements IFuelHandler {
// Isildurs chestplate handler
// Incoming damage from poison, drink poison (for lurtz bow, rip anyone who drinks a bad drink), or wither is doubled
if (event.entityLiving.worldObj.isRemote) return;
if (!(event.entityLiving instanceof EntityPlayerMP)) return;
EntityPlayerMP player = (EntityPlayerMP) event.entityLiving;
ItemStack chest = player.getEquipmentInSlot(2);
if (chest == null || chest.getItem() != CinderLoE.bodyIsildur) return;
boolean isPoison = player.isPotionActive(Potion.poison.id);
boolean isPoisonedDrink = player.isPotionActive(LOTRPoisonedDrinks.killingPoison.id);
boolean isWitherDamage = event.source == DamageSource.wither;
if (isPoisonedDrink || isWitherDamage || isPoison) {
boolean isDrinkPoison = player.isPotionActive(LOTRPoisonedDrinks.killingPoison.id);
boolean isWither = event.source == DamageSource.wither;
if (isDrinkPoison || isWither) {
event.ammount *= 2.0F;
}
}

@ -332,6 +332,7 @@ public class CinderLoE {
public static Item alatarStaff;
public static Item sarumanStaff;
public static Item sarumanWhiteStaff;
public static Item mouthofsauronSword;
// Relics
public static Item welfRelic;
@ -728,18 +729,22 @@ public class CinderLoE {
alatarStaff = (new AlatarStaff()).setUnlocalizedName("lotr:alatarStaff").setTextureName("lotr:alatarStaff");
sarumanStaff = (new SarumanStaff()).setUnlocalizedName("lotr:sarumanStaff").setTextureName("lotr:sarumanStaff");
sarumanWhiteStaff = (new SarumanWhiteStaff()).setUnlocalizedName("lotr:sarumanWhiteStaff").setTextureName("lotr:sarumanStaff");
mouthofsauronSword = (new MouthOfSauronWeapon()).setUnlocalizedName("lotr:mouthofsauronSword").setTextureName("lotr:mouthofsauronSword");
ItemRegistration.register(radagastStaff, "radagastStaff", 6700);
ItemRegistration.register(pallandoStaff, "pallandoStaff", 6701);
ItemRegistration.register(alatarStaff, "alatarStaff", 6702);
ItemRegistration.register(sarumanStaff, "sarumanStaff", 6703);
ItemRegistration.register(sarumanWhiteStaff, "sarumanWhiteStaff", 6705);
ItemRegistration.register(mouthofsauronSword, "mouthofsauronSword", 6711);
linkLOTRWeapon(radagastStaff, "radagastStaff");
linkLOTRWeapon(pallandoStaff, "pallandoStaff");
linkLOTRWeapon(alatarStaff, "alatarStaff");
linkLOTRWeapon(sarumanStaff, "sarumanStaff");
linkLOTRWeapon(sarumanWhiteStaff, "sarumanWhiteStaff");
linkLOTRWeapon(mouthofsauronSword, "mouthofsauronSword");
// Relics
welfRelic = (new WoodElfRelic()).setUnlocalizedName("lotr:welfRelic").setTextureName("lotr:welfRelic");

@ -45,35 +45,36 @@ public class CharacterEventListener {
//Mouth of Sauron event handler
@SubscribeEvent
public void onPlayerTick(TickEvent.PlayerTickEvent event) {
if (event.phase != TickEvent.Phase.END || event.player.worldObj.isRemote) return;
if (event.phase != TickEvent.Phase.END || event.player.worldObj.isRemote) {
return;
}
EntityPlayerMP player = (EntityPlayerMP) event.player;
UUID id = player.getUniqueID();
// Only “MouthOfSauron” gets this ability
if (!CharacterRoleAPI.getCharacterRoleUUID("MouthOfSauron").equals(id)) {
UUID mosId = CharacterRoleAPI.getCharacterRoleUUID("MouthOfSauron");
if (mosId == null || !mosId.equals(id)) {
tickCounters.remove(id);
hiringEnabled.remove(id);
return;
}
if (!hiringEnabled.contains(id)) {
tickCounters.remove(id);
return;
}
// Tick up, and only run when we hit the interval
int count = tickCounters.getOrDefault(id, 0) + 1;
if (count < HIRE_INTERVAL) {
tickCounters.put(id, count);
return;
}
tickCounters.put(id, 0);
//player.addChatMessage(new ChatComponentText("[DEBUG] tryHireNPCs called"));
tryHireNPCs(player);
}
private static void tryHireNPCs(EntityPlayerMP player) {
World world = player.worldObj;
UUID playerId = player.getUniqueID();

@ -20,7 +20,7 @@ public class LOTRWeaponLinker implements IClassTransformer {
// Can add any number of items, append with comma
return addLinks(basicClass,
"spearRedDwarf", "crossbowRedDwarf", "swordRedDwarf", "battleaxeRedDwarf", "pikeRedDwarf", "daggerRedDwarf", "daggerRedDwarfPoisoned", "hammerRedDwarf",
"radagastStaff", "alatarStaff", "pallandoStaff", "sarumanStaff", "maceWarlord", "sarumanWhiteStaff",
"radagastStaff", "alatarStaff", "pallandoStaff", "sarumanStaff", "maceWarlord", "sarumanWhiteStaff", "mouthofsauronSword",
"spearLimwaith", "tridentLimwaith", "daggerLimwaith", "daggerLimwaithPoisoned", "truncheonLimwaith", "battleaxeLimwaith", "blowgunLimwaith",
"frostblade", "spearsolidgold", "whip", "spearUnnamed", "welfRelic", "daggerVoid",
"swordBree", "greatswordAngmar", "greatswordLindon", "greatswordDale", "greatswordNumenor",

@ -5,14 +5,17 @@ import lotr.common.LOTRLevelData;
import lotr.common.LOTRMod;
import lotr.common.entity.animal.LOTREntityHorse;
import lotr.common.fac.LOTRFaction;
import lotr.common.item.LOTRItemAxe;
import lotr.common.item.LOTRItemSword;
import lotr.common.item.LOTRMaterial;
import lotr.common.item.LOTRStoryItem;
import lotr.common.network.LOTRPacketHandler;
import lotr.common.network.LOTRPacketWeaponFX;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction;
import net.minecraft.item.ItemStack;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.DamageSource;
@ -21,12 +24,11 @@ import net.minecraft.world.World;
import java.util.List;
public class MouthOfSauronWeapon extends LOTRItemSword {
public class MouthOfSauronWeapon extends LOTRItemSword implements LOTRStoryItem {
public MouthOfSauronWeapon() {
super(LOTRMaterial.MORDOR);
this.setMaxDamage(1500);
this.lotrWeaponDamage = 8.0f;
}
public ItemStack onEaten(ItemStack itemstack, World world, EntityPlayer entityplayer) {
@ -38,7 +40,7 @@ public class MouthOfSauronWeapon extends LOTRItemSword {
user.swingItem();
world.playSoundAtEntity((Entity)user, "mob.wither.hurt", 2.0f, (itemRand.nextFloat() - itemRand.nextFloat()) * 0.2f + 1.0f);
if (!world.isRemote) {
List entities = world.getEntitiesWithinAABB(EntityLivingBase.class, user.boundingBox.expand(12.0, 8.0, 12.0));
List entities = world.getEntitiesWithinAABB(EntityLivingBase.class, user.boundingBox.expand(6.0, 6.0, 6.0));
if (!entities.isEmpty()) {
for (int i = 0; i < entities.size(); ++i) {
EntityLiving entityliving;
@ -66,4 +68,18 @@ public class MouthOfSauronWeapon extends LOTRItemSword {
return itemstack;
}
public int getMaxItemUseDuration(ItemStack itemstack) {
return 40;
}
@Override
public EnumAction getItemUseAction(ItemStack itemstack) {
return EnumAction.bow;
}
@Override
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) {
entityplayer.setItemInUse(itemstack, this.getMaxItemUseDuration(itemstack));
return itemstack;
}
}

@ -106,6 +106,7 @@ item.lotr:pallandoStaff.name=Staff of Pallando the Blue
item.lotr:alatarStaff.name=Staff of Alatar the Blue
item.lotr:sarumanStaff.name=Staff of Saruman of Many Colors
item.lotr:sarumanWhiteStaff.name=Staff of Saruman the White
item.lotr:mouthofsauronSword.name=Sword of the Lieutenant
item.lotr:welfRelic.name=Horn of the Greenwood Stag
item.lotr:ulukai.name=Ulûkai

Binary file not shown.

After

Width:  |  Height:  |  Size: 629 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 528 B

Loading…
Cancel
Save