Added the Living Armour Upgrade, Nocturnal Prowess, which gives night vision in dark areas and increases damage while the area is dark

This commit is contained in:
WayofTime 2016-09-03 11:17:36 -04:00
parent 0a2074c110
commit 0bc3824814
10 changed files with 255 additions and 7 deletions

View file

@ -12,6 +12,7 @@ import net.minecraft.entity.passive.EntityAnimal;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.Enchantments;
import net.minecraft.init.MobEffects;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@ -166,11 +167,19 @@ public class GenericHandler
{
sendPlayerDemonWillAura((EntityPlayer) entity);
}
}
EntityLivingBase entity = event.getEntityLiving();
if (entity.isPotionActive(MobEffects.NIGHT_VISION))
{
int duration = entity.getActivePotionEffect(MobEffects.NIGHT_VISION).getDuration();
if (duration == Constants.Misc.NIGHT_VISION_CONSTANT_END)
{
entity.removePotionEffect(MobEffects.NIGHT_VISION);
}
}
if (entity.isPotionActive(ModPotions.fireFuse))
{
entity.worldObj.spawnParticle(EnumParticleTypes.FLAME, entity.posX + entity.worldObj.rand.nextDouble() * 0.3, entity.posY + entity.worldObj.rand.nextDouble() * 0.3, entity.posZ + entity.worldObj.rand.nextDouble() * 0.3, 0, 0.06d, 0);

View file

@ -90,7 +90,7 @@ public class StatTrackerHandler
lastPlayerSwingStrength = event.getEntityPlayer().getCooledAttackStrength(0);
}
// Tracks: Fall Protect, Arrow Protect, Physical Protect, Grave Digger, Sprint Attack, Critical Strike,
// Tracks: Fall Protect, Arrow Protect, Physical Protect, Grave Digger, Sprint Attack, Critical Strike, Nocturnal Prowess
@SubscribeEvent
public void entityHurt(LivingHurtEvent event)
{
@ -151,6 +151,9 @@ public class StatTrackerHandler
{
StatTrackerMeleeDamage.incrementCounter(armour, amount);
if (player.worldObj.getLight(player.getPosition()) <= 9)
StatTrackerNightSight.incrementCounter(armour, amount);
if (mainWeapon != null && mainWeapon.getItem() instanceof ItemSpade)
StatTrackerGraveDigger.incrementCounter(armour, amount);