Search in sources :

Example 36 with Living

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();
    });
}
Also used : FreakyFourInstance(com.skelril.skree.content.zone.group.freakyfour.FreakyFourInstance) CaveSpider(org.spongepowered.api.entity.living.monster.CaveSpider) Living(org.spongepowered.api.entity.living.Living) Instruction(com.skelril.openboss.Instruction) ZoneBossDetail(com.skelril.skree.content.zone.ZoneBossDetail)

Example 37 with Living

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());
}
Also used : Living(org.spongepowered.api.entity.living.Living) HealableInstruction(com.skelril.skree.content.zone.group.freakyfour.boss.bossmove.HealableInstruction) NamedBindInstruction(com.skelril.skree.content.zone.group.catacombs.instruction.bossmove.NamedBindInstruction) Instruction(com.skelril.openboss.Instruction) HealthBindInstruction(com.skelril.skree.content.zone.group.freakyfour.boss.bossmove.HealthBindInstruction) HealableInstruction(com.skelril.skree.content.zone.group.freakyfour.boss.bossmove.HealableInstruction) BackTeleportInstruction(com.skelril.skree.content.zone.group.freakyfour.boss.bossmove.BackTeleportInstruction) ZoneBossDetail(com.skelril.skree.content.zone.ZoneBossDetail) BackTeleportInstruction(com.skelril.skree.content.zone.group.freakyfour.boss.bossmove.BackTeleportInstruction)

Example 38 with Living

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());
}
Also used : Living(org.spongepowered.api.entity.living.Living) FreakyFourBossDeath(com.skelril.skree.content.zone.group.freakyfour.boss.bossmove.FreakyFourBossDeath) NamedBindInstruction(com.skelril.skree.content.zone.group.catacombs.instruction.bossmove.NamedBindInstruction) Instruction(com.skelril.openboss.Instruction) HealthBindInstruction(com.skelril.skree.content.zone.group.freakyfour.boss.bossmove.HealthBindInstruction) ZoneBossDetail(com.skelril.skree.content.zone.ZoneBossDetail)

Example 39 with Living

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);
}
Also used : Entity(org.spongepowered.api.entity.Entity) Living(org.spongepowered.api.entity.living.Living) EntityDamageSource(org.spongepowered.api.event.cause.entity.damage.source.EntityDamageSource)

Example 40 with Living

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());
}
Also used : Living(org.spongepowered.api.entity.living.Living) ProjectileSource(org.spongepowered.api.entity.projectile.source.ProjectileSource) Listener(org.spongepowered.api.event.Listener)

Aggregations

Living (org.spongepowered.api.entity.living.Living)63 Entity (org.spongepowered.api.entity.Entity)34 Player (org.spongepowered.api.entity.living.player.Player)16 Instruction (com.skelril.openboss.Instruction)15 ZoneBossDetail (com.skelril.skree.content.zone.ZoneBossDetail)13 Listener (org.spongepowered.api.event.Listener)13 World (org.spongepowered.api.world.World)12 NamedBindInstruction (com.skelril.skree.content.zone.group.catacombs.instruction.bossmove.NamedBindInstruction)10 HealthBindInstruction (com.skelril.skree.content.zone.group.freakyfour.boss.bossmove.HealthBindInstruction)10 DamageEntityEvent (org.spongepowered.api.event.entity.DamageEntityEvent)8 EntityDamageSource (org.spongepowered.api.event.cause.entity.damage.source.EntityDamageSource)7 Vector3d (com.flowpowered.math.vector.Vector3d)6 PlayerCombatParser (com.skelril.nitro.combat.PlayerCombatParser)6 CuboidContainmentPredicate (com.skelril.nitro.position.CuboidContainmentPredicate)6 BackTeleportInstruction (com.skelril.skree.content.zone.group.freakyfour.boss.bossmove.BackTeleportInstruction)6 HealableInstruction (com.skelril.skree.content.zone.group.freakyfour.boss.bossmove.HealableInstruction)6 IndirectEntityDamageSource (org.spongepowered.api.event.cause.entity.damage.source.IndirectEntityDamageSource)6 Vector3i (com.flowpowered.math.vector.Vector3i)5 IntegratedRunnable (com.skelril.nitro.time.IntegratedRunnable)5 TimedRunnable (com.skelril.nitro.time.TimedRunnable)5