use of org.spongepowered.api.entity.living.Living in project Skree by Skelril.
the class CharlotteMinionManager method handleDamage.
private void handleDamage() {
List<Instruction<DamageCondition, Boss<CaveSpider, ZoneBossDetail<FreakyFourInstance>>>> damageProcessor = getDamageProcessor();
damageProcessor.add((condition, boss) -> {
FreakyFourInstance inst = boss.getDetail().getZone();
Optional<Living> optBossEnt = inst.getBoss(FreakyFourBoss.CHARLOTTE);
if (optBossEnt.isPresent()) {
EntityHealthUtil.heal(optBossEnt.get(), condition.getEvent().getBaseDamage());
}
return Optional.empty();
});
}
use of org.spongepowered.api.entity.living.Living in project Skree by Skelril.
the class DaBombBossManager method handleDamaged.
private void handleDamaged() {
List<Instruction<DamagedCondition, Boss<Living, ZoneBossDetail<FreakyFourInstance>>>> damagedProcessor = getDamagedProcessor();
damagedProcessor.add(new BackTeleportInstruction(config));
damagedProcessor.add(new HealableInstruction());
}
use of org.spongepowered.api.entity.living.Living in project Skree by Skelril.
the class FrimusBossManager 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 MeleeAttackClusterListener method getSource.
public Optional<Living> getSource(Cause cause) {
Optional<EntityDamageSource> optEntityDamageSource = cause.first(EntityDamageSource.class);
if (!optEntityDamageSource.isPresent()) {
return Optional.empty();
}
EntityDamageSource damageSource = optEntityDamageSource.get();
Entity source = damageSource.getSource();
if (!(source instanceof Living)) {
return Optional.empty();
}
return Optional.of((Living) source);
}
use of org.spongepowered.api.entity.living.Living in project Skree by Skelril.
the class PointOfContactClusterListener method onBlockCollide.
@Listener
public void onBlockCollide(CollideEvent.Impact event, @First Projectile projectile) {
ProjectileSource source = projectile.getShooter();
if (!(source instanceof Living)) {
return;
}
Living sourceEntity = (Living) source;
if (!isApplicable(sourceEntity)) {
return;
}
if (cooldownHandler.canUseAbility(sourceEntity)) {
cooldownHandler.useAbility(sourceEntity);
} else {
return;
}
attackCluster.getNextAbilityToRun().run(sourceEntity, event.getImpactPoint());
}
Aggregations