use of WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.IHoardDemon in project BloodMagic by WayofTime.
the class AlchemicalWizardryEventHooks method onEntityDeath.
@SubscribeEvent
public void onEntityDeath(LivingDeathEvent event) {
EntityLivingBase entityLiving = event.entityLiving;
if (entityLiving instanceof IDemon && event.source.getEntity() instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) event.source.getEntity();
player.addStat(ModAchievements.demonSpawn, 1);
}
if (entityLiving instanceof IHoardDemon && event.source.getEntity() instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) event.source.getEntity();
player.addStat(ModAchievements.demons, 1);
}
}
use of WayofTime.alchemicalWizardry.common.demonVillage.demonHoard.demon.IHoardDemon in project BloodMagic by WayofTime.
the class DaggerOfSacrifice method hitEntity.
@Override
public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase) {
if (par3EntityLivingBase == null || par2EntityLivingBase == null || par3EntityLivingBase.worldObj.isRemote || (par3EntityLivingBase instanceof EntityPlayer && SpellHelper.isFakePlayer(par3EntityLivingBase.worldObj, (EntityPlayer) par3EntityLivingBase))) {
return false;
}
if (par2EntityLivingBase instanceof IHoardDemon) {
return false;
}
if (par2EntityLivingBase.isChild() || par2EntityLivingBase instanceof EntityPlayer || par2EntityLivingBase instanceof IBossDisplayData) {
return false;
}
World world = par2EntityLivingBase.worldObj;
if (par2EntityLivingBase.isDead || par2EntityLivingBase.getHealth() < 0.5f) {
return false;
}
if (par2EntityLivingBase instanceof IDemon) {
((IDemon) par2EntityLivingBase).setDropCrystal(false);
this.findAndNotifyAltarOfDemon(world, par2EntityLivingBase);
}
int lifeEssence = 500;
if (par2EntityLivingBase instanceof EntityVillager)
lifeEssence = 2000;
else if (par2EntityLivingBase instanceof EntitySlime)
lifeEssence = 150;
else if (par2EntityLivingBase instanceof EntityEnderman)
lifeEssence = 200;
else if (par2EntityLivingBase instanceof EntityAnimal)
lifeEssence = 250;
if (findAndFillAltar(par2EntityLivingBase.worldObj, par2EntityLivingBase, lifeEssence)) {
double posX = par2EntityLivingBase.posX;
double posY = par2EntityLivingBase.posY;
double posZ = par2EntityLivingBase.posZ;
for (int i = 0; i < 8; i++) {
SpellHelper.sendIndexedParticleToAllAround(world, posX, posY, posZ, 20, world.provider.dimensionId, 1, posX, posY, posZ);
}
par2EntityLivingBase.setHealth(-1);
par2EntityLivingBase.onDeath(DamageSource.generic);
}
return false;
}
Aggregations