use of mod.azure.doom.entity.DemonEntity in project MCDoom by AzureDoom.
the class TotemEntity method applyEffects.
private void applyEffects() {
if (!this.world.isClient()) {
Box axisalignedbb = (new Box(this.pos)).expand(40).stretch(0.0D, (double) this.world.getHeight(), 0.0D);
List<DemonEntity> list = this.world.getNonSpectatingEntities(DemonEntity.class, axisalignedbb);
for (DemonEntity entity : list) {
entity.addStatusEffect(new StatusEffectInstance(StatusEffects.STRENGTH, 1000, 1));
entity.addStatusEffect(new StatusEffectInstance(StatusEffects.SPEED, 1000, 1));
entity.setGlowing(true);
}
}
}
use of mod.azure.doom.entity.DemonEntity in project MCDoom by AzureDoom.
the class ChainsawAnimated method doDeathCheck.
private void doDeathCheck(LivingEntity user, Entity target, ItemStack stack) {
Random rand = new Random();
List<Item> givenList = Arrays.asList(DoomItems.CHAINGUN_BULLETS, DoomItems.SHOTGUN_SHELLS, DoomItems.ARGENT_BOLT, DoomItems.SHOTGUN_SHELLS, DoomItems.ENERGY_CELLS, DoomItems.ROCKET);
if (target instanceof DemonEntity && !(target instanceof PlayerEntity)) {
if (((LivingEntity) target).isDead()) {
if (user instanceof PlayerEntity) {
PlayerEntity playerentity = (PlayerEntity) user;
if (stack.getDamage() < (stack.getMaxDamage() - 1) && !playerentity.getItemCooldownManager().isCoolingDown(this)) {
playerentity.getItemCooldownManager().set(this, 18);
for (int i = 0; i < 5; ) {
int randomIndex = rand.nextInt(givenList.size());
Item randomElement = givenList.get(randomIndex);
target.dropItem(randomElement);
target.dropItem(randomElement);
break;
}
}
}
}
}
}
use of mod.azure.doom.entity.DemonEntity in project MCDoom by AzureDoom.
the class Chainsaw method doDeathCheck.
private void doDeathCheck(LivingEntity user, Entity target, ItemStack stack) {
Random rand = new Random();
List<Item> givenList = Arrays.asList(DoomItems.CHAINGUN_BULLETS, DoomItems.SHOTGUN_SHELLS, DoomItems.ARGENT_BOLT, DoomItems.SHOTGUN_SHELLS, DoomItems.ENERGY_CELLS, DoomItems.ROCKET);
if (target instanceof DemonEntity && !(target instanceof PlayerEntity)) {
if (((LivingEntity) target).isDead()) {
if (user instanceof PlayerEntity) {
PlayerEntity playerentity = (PlayerEntity) user;
if (stack.getDamage() < (stack.getMaxDamage() - 1) && !playerentity.getItemCooldownManager().isCoolingDown(this)) {
playerentity.getItemCooldownManager().set(this, 18);
for (int i = 0; i < 5; ) {
int randomIndex = rand.nextInt(givenList.size());
Item randomElement = givenList.get(randomIndex);
target.dropItem(randomElement);
target.dropItem(randomElement);
break;
}
}
}
}
}
}
use of mod.azure.doom.entity.DemonEntity in project MCDoom by AzureDoom.
the class TotemEntity method removeEffects.
private void removeEffects() {
if (!this.world.isClient()) {
Box axisalignedbb = (new Box(this.pos)).expand(40).stretch(0.0D, (double) this.world.getHeight(), 0.0D);
List<DemonEntity> list = this.world.getNonSpectatingEntities(DemonEntity.class, axisalignedbb);
for (DemonEntity entity : list) {
entity.setGlowing(false);
entity.clearStatusEffects();
}
}
}
use of mod.azure.doom.entity.DemonEntity in project MCDoom by AzureDoom.
the class PossessedScientistEntity method attack.
@Override
public void attack(LivingEntity target, float pullProgress) {
Vec3d vec3d = target.getVelocity();
double d = target.getX() + vec3d.x - this.getX();
double e = target.getEyeY() - (double) 1.1f - this.getY();
double f = target.getZ() + vec3d.z - this.getZ();
double g = Math.sqrt(d * d + f * f);
Potion potion;
if (target instanceof DemonEntity) {
potion = target.getHealth() <= 4.0f ? Potions.HEALING : Potions.REGENERATION;
this.setTarget(null);
} else {
potion = Potions.POISON;
}
PotionEntity potionEntity = new PotionEntity(this.world, this);
potionEntity.setItem(PotionUtil.setPotion(new ItemStack(Items.SPLASH_POTION), potion));
potionEntity.setPitch(potionEntity.getPitch() - -20.0f);
potionEntity.setVelocity(d, e + g * 0.2, f, 0.75f, 8.0f);
if (!this.isSilent()) {
this.world.playSound(null, this.getX(), this.getY(), this.getZ(), SoundEvents.ENTITY_WITCH_THROW, this.getSoundCategory(), 1.0f, 0.8f + this.random.nextFloat() * 0.4f);
}
this.world.spawnEntity(potionEntity);
}
Aggregations