use of org.spongepowered.api.entity.living.Living in project Skree by Skelril.
the class DaBombBossManager method handleUnbinds.
private void handleUnbinds() {
List<Instruction<UnbindCondition, Boss<Living, ZoneBossDetail<FreakyFourInstance>>>> unbindProcessor = getUnbindProcessor();
unbindProcessor.add(new FreakyFourBossDeath());
}
use of org.spongepowered.api.entity.living.Living in project Skree by Skelril.
the class HealthBindInstruction method apply.
@Override
public Optional<Instruction<BindCondition, Boss<T, K>>> apply(BindCondition bindCondition, Boss<T, K> bossDetail) {
Living targetEntity = bossDetail.getTargetEntity().get();
EntityHealthUtil.setMaxHealth(targetEntity, getHealth(), true);
return Optional.empty();
}
use of org.spongepowered.api.entity.living.Living in project Skree by Skelril.
the class DoomBlade method run.
@Override
public void run(Living owner, Living target, DamageEntityEvent event) {
notify(owner, Text.of(TextColors.YELLOW, "Your weapon releases a huge burst of energy."));
double dmgTotal = 0;
for (Entity e : getTargetEntities(target)) {
if (!e.isRemoved() && e instanceof Living) {
if (e.equals(owner))
continue;
double damage = getDamage(e);
if (!e.damage(damage, damageSource(owner))) {
continue;
}
ParticleGenerator.mobSpawnerFlames(e.getLocation(), 20);
dmgTotal += damage;
}
}
notify(owner, Text.of(TextColors.YELLOW, "Your sword dishes out an incredible ", (int) Math.ceil(dmgTotal), " damage!"));
}
use of org.spongepowered.api.entity.living.Living in project Skree by Skelril.
the class PatientXInstance method spawnCreatures.
public void spawnCreatures() {
Zombie boss = getBoss().get();
Collection<Living> entities = getContained(Living.class);
if (entities.size() > 500) {
sendAttackBroadcast("Ring-a-round the rosie, a pocket full of posies...", AttackSeverity.NORMAL);
EntityHealthUtil.toFullHealth(boss);
for (Entity entity : entities) {
if (entity instanceof Player) {
entity.offer(Keys.HEALTH, 0D);
} else if (!entity.equals(boss)) {
entity.remove();
}
}
return;
}
double amt = getPlayers(PARTICIPANT).size() * difficulty;
Location l = getCenter();
for (int i = 0; i < amt; i++) {
Entity zombie = getRegion().getExtent().createEntity(EntityTypes.ZOMBIE, l.getPosition());
// TODO convert to Sponge Data API
((EntityZombie) zombie).setCanPickUpLoot(false);
((EntityZombie) zombie).setChild(true);
getRegion().getExtent().spawnEntity(zombie, Cause.source(SpawnCause.builder().type(SpawnTypes.PLUGIN).build()).build());
}
}
use of org.spongepowered.api.entity.living.Living in project Skree by Skelril.
the class MeleeAttackClusterListener method onPlayerCombat.
@Listener(order = Order.LATE)
public void onPlayerCombat(DamageEntityEvent event) {
Entity targetEntity = event.getTargetEntity();
if (!(targetEntity instanceof Living)) {
return;
}
Optional<Living> optSourceEntity = getSource(event.getCause());
if (!optSourceEntity.isPresent()) {
return;
}
Living sourceEntity = optSourceEntity.get();
if (!isApplicable(sourceEntity)) {
return;
}
if (cooldownHandler.canUseAbility(sourceEntity)) {
cooldownHandler.useAbility(sourceEntity);
} else {
return;
}
attackCluster.getNextAttackToRun().run(sourceEntity, (Living) targetEntity, event);
}
Aggregations