Fix and nerf Coat of Arms

It was a bit broken. (~2000 LP for killing a zombie >.>) We'll see how it goes now.
This commit is contained in:
Nick 2016-01-07 18:15:23 -08:00
parent 978e50a42e
commit b34dbfbe4e
2 changed files with 4 additions and 3 deletions

View file

@ -18,7 +18,7 @@ import java.util.List;
public class ItemPackSacrifice extends ItemArmor implements IAltarManipulator public class ItemPackSacrifice extends ItemArmor implements IAltarManipulator
{ {
public final int CONVERSION = 50; // How much LP per heart public final int CONVERSION = 20; // How much LP per heart
public final int CAPACITY = 10000; // Max LP storage public final int CAPACITY = 10000; // Max LP storage
public ItemPackSacrifice() public ItemPackSacrifice()

View file

@ -14,6 +14,7 @@ import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.init.Items; import net.minecraft.init.Items;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.event.entity.living.LivingAttackEvent; import net.minecraftforge.event.entity.living.LivingAttackEvent;
@ -77,7 +78,8 @@ public class EventHandler
ItemPackSacrifice pack = (ItemPackSacrifice) player.getCurrentArmor(chestIndex).getItem(); ItemPackSacrifice pack = (ItemPackSacrifice) player.getCurrentArmor(chestIndex).getItem();
boolean shouldSyphon = pack.getStoredLP(player.getCurrentArmor(chestIndex)) < pack.CAPACITY; boolean shouldSyphon = pack.getStoredLP(player.getCurrentArmor(chestIndex)) < pack.CAPACITY;
int totalLP = Math.round(event.ammount * pack.CONVERSION); float damageDone = event.entityLiving.getHealth() < event.ammount ? event.ammount - event.entityLiving.getHealth() : event.ammount;
int totalLP = Math.round(damageDone * pack.CONVERSION);
if (shouldSyphon) if (shouldSyphon)
pack.addLP(player.getCurrentArmor(chestIndex), totalLP); pack.addLP(player.getCurrentArmor(chestIndex), totalLP);
@ -121,7 +123,6 @@ public class EventHandler
@SubscribeEvent @SubscribeEvent
public void onTelepose(TeleposeEvent event) public void onTelepose(TeleposeEvent event)
{ {
if (ConfigHandler.teleposerBlacklist.contains(event.initialStack) || ConfigHandler.teleposerBlacklist.contains(event.finalStack)) if (ConfigHandler.teleposerBlacklist.contains(event.initialStack) || ConfigHandler.teleposerBlacklist.contains(event.finalStack))
event.setCanceled(true); event.setCanceled(true);