Added Soft Fall and Strong Legs living armour upgrades.
This commit is contained in:
parent
f9bf63ccf1
commit
96ecd73286
14 changed files with 392 additions and 17 deletions
|
@ -88,8 +88,10 @@ import WayofTime.bloodmagic.livingArmour.LivingArmour;
|
|||
import WayofTime.bloodmagic.livingArmour.tracker.StatTrackerArrowShot;
|
||||
import WayofTime.bloodmagic.livingArmour.tracker.StatTrackerDigging;
|
||||
import WayofTime.bloodmagic.livingArmour.tracker.StatTrackerExperience;
|
||||
import WayofTime.bloodmagic.livingArmour.tracker.StatTrackerFallProtect;
|
||||
import WayofTime.bloodmagic.livingArmour.tracker.StatTrackerGrimReaperSprint;
|
||||
import WayofTime.bloodmagic.livingArmour.tracker.StatTrackerHealthboost;
|
||||
import WayofTime.bloodmagic.livingArmour.tracker.StatTrackerJump;
|
||||
import WayofTime.bloodmagic.livingArmour.tracker.StatTrackerMeleeDamage;
|
||||
import WayofTime.bloodmagic.livingArmour.tracker.StatTrackerPhysicalProtect;
|
||||
import WayofTime.bloodmagic.livingArmour.tracker.StatTrackerSelfSacrifice;
|
||||
|
@ -98,6 +100,7 @@ import WayofTime.bloodmagic.livingArmour.upgrade.LivingArmourUpgradeArrowShot;
|
|||
import WayofTime.bloodmagic.livingArmour.upgrade.LivingArmourUpgradeDigging;
|
||||
import WayofTime.bloodmagic.livingArmour.upgrade.LivingArmourUpgradeExperience;
|
||||
import WayofTime.bloodmagic.livingArmour.upgrade.LivingArmourUpgradeGrimReaperSprint;
|
||||
import WayofTime.bloodmagic.livingArmour.upgrade.LivingArmourUpgradeJump;
|
||||
import WayofTime.bloodmagic.livingArmour.upgrade.LivingArmourUpgradeSelfSacrifice;
|
||||
import WayofTime.bloodmagic.livingArmour.upgrade.LivingArmourUpgradeSpeed;
|
||||
import WayofTime.bloodmagic.livingArmour.upgrade.LivingArmourUpgradeStepAssist;
|
||||
|
@ -145,6 +148,35 @@ public class EventHandler
|
|||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onJumpEvent(LivingEvent.LivingJumpEvent event)
|
||||
{
|
||||
if (event.getEntityLiving() instanceof EntityPlayer)
|
||||
{
|
||||
EntityPlayer player = (EntityPlayer) event.getEntityLiving();
|
||||
|
||||
if (LivingArmour.hasFullSet(player))
|
||||
{
|
||||
ItemStack chestStack = player.getItemStackFromSlot(EntityEquipmentSlot.CHEST);
|
||||
LivingArmour armour = ItemLivingArmour.armourMap.get(chestStack);
|
||||
if (armour != null)
|
||||
{
|
||||
StatTrackerJump.incrementCounter(armour);
|
||||
|
||||
if (!player.isSneaking())
|
||||
{
|
||||
LivingArmourUpgrade upgrade = ItemLivingArmour.getUpgrade(Constants.Mod.MODID + ".upgrade.jump", chestStack);
|
||||
|
||||
if (upgrade instanceof LivingArmourUpgradeJump)
|
||||
{
|
||||
player.motionY += ((LivingArmourUpgradeJump) upgrade).getJumpModifier();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onServerWorldTick(TickEvent.WorldTickEvent event)
|
||||
{
|
||||
|
@ -583,11 +615,16 @@ public class EventHandler
|
|||
LivingArmour armour = ItemLivingArmour.armourMap.get(chestStack);
|
||||
if (armour != null)
|
||||
{
|
||||
if (sourceEntity != null && !source.isMagicDamage())
|
||||
if (sourceEntity != null && !source.isMagicDamage() && !source.isProjectile())
|
||||
{
|
||||
// Add resistance to the upgrade that protects against non-magic damage
|
||||
StatTrackerPhysicalProtect.incrementCounter(armour, amount);
|
||||
}
|
||||
|
||||
if (source.equals(DamageSource.fall))
|
||||
{
|
||||
StatTrackerFallProtect.incrementCounter(armour, amount);
|
||||
}
|
||||
}
|
||||
} else
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue