Rebalanced Grave Digger so that it takes into account the swing cooldown
This commit is contained in:
parent
7d9312b2f8
commit
c3922fad63
|
@ -7,7 +7,7 @@ import WayofTime.bloodmagic.api.livingArmour.LivingArmourUpgrade;
|
|||
public class LivingArmourUpgradeGraveDigger extends LivingArmourUpgrade
|
||||
{
|
||||
public static final int[] costs = new int[] { 5, 12, 20, 35, 49, 78, 110, 160, 215, 320 };
|
||||
public static final double[] damageBoost = new double[] { 0.2, 0.4, 0.6, 0.8, 1, 1.2, 1.4, 1.6, 1.8, 2 };
|
||||
public static final double[] damageBoost = new double[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
|
||||
|
||||
public LivingArmourUpgradeGraveDigger(int level)
|
||||
{
|
||||
|
|
|
@ -37,6 +37,7 @@ import net.minecraftforge.event.entity.living.LivingEvent;
|
|||
import net.minecraftforge.event.entity.living.LivingHealEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingHurtEvent;
|
||||
import net.minecraftforge.event.entity.player.ArrowLooseEvent;
|
||||
import net.minecraftforge.event.entity.player.AttackEntityEvent;
|
||||
import net.minecraftforge.event.entity.player.EntityItemPickupEvent;
|
||||
import net.minecraftforge.event.entity.player.FillBucketEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerEvent;
|
||||
|
@ -591,6 +592,14 @@ public class EventHandler
|
|||
}
|
||||
}
|
||||
|
||||
private static float lastPlayerSwingStrength = 0;
|
||||
|
||||
@SubscribeEvent
|
||||
public void onLivingAttack(AttackEntityEvent event)
|
||||
{
|
||||
lastPlayerSwingStrength = event.getEntityPlayer().getCooledAttackStrength(0);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onEntityAttacked(LivingHurtEvent event)
|
||||
{
|
||||
|
@ -646,6 +655,7 @@ public class EventHandler
|
|||
if (sourceEntity instanceof EntityPlayer)
|
||||
{
|
||||
EntityPlayer player = (EntityPlayer) sourceEntity;
|
||||
|
||||
// Living Armor Handling
|
||||
if (LivingArmour.hasFullSet(player))
|
||||
{
|
||||
|
@ -661,7 +671,7 @@ public class EventHandler
|
|||
|
||||
if (upgrade instanceof LivingArmourUpgradeGraveDigger)
|
||||
{
|
||||
event.setAmount((float) (event.getAmount() * (1 + ((LivingArmourUpgradeGraveDigger) upgrade).getDamageModifier())));
|
||||
event.setAmount((float) (event.getAmount() + lastPlayerSwingStrength * ((LivingArmourUpgradeGraveDigger) upgrade).getDamageModifier()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue