Search in sources :

Example 6 with Living

use of org.spongepowered.api.entity.living.Living in project Skree by Skelril.

the class ThorAttack method apply.

@Override
public Optional<Instruction<DamageCondition, Boss<Zombie, CatacombsBossDetail>>> apply(DamageCondition damageCondition, Boss<Zombie, CatacombsBossDetail> zombieCatacombsBossDetailBoss) {
    Living bossEnt = zombieCatacombsBossDetailBoss.getTargetEntity().get();
    Entity toHit = damageCondition.getAttacked();
    toHit.setVelocity(EntityDirectionUtil.getFacingVector(bossEnt).mul(2));
    Task.builder().execute(() -> {
        Location<World> targetLoc = toHit.getLocation();
        Task.builder().execute(() -> {
            Lightning lightning = (Lightning) toHit.getWorld().createEntity(EntityTypes.LIGHTNING, targetLoc.getPosition());
            toHit.getWorld().spawnEntity(lightning, Cause.source(SpawnCause.builder().type(SpawnTypes.PLUGIN).build()).build());
        }).delay(750, TimeUnit.MILLISECONDS).submit(SkreePlugin.inst());
    }).delay(1500, TimeUnit.MILLISECONDS).submit(SkreePlugin.inst());
    return Optional.empty();
}
Also used : Entity(org.spongepowered.api.entity.Entity) Living(org.spongepowered.api.entity.living.Living) Lightning(org.spongepowered.api.entity.weather.Lightning) World(org.spongepowered.api.world.World)

Example 7 with Living

use of org.spongepowered.api.entity.living.Living in project Skree by Skelril.

the class FreakyFourInstance method runSnipee.

private void runSnipee() {
    Living snipee = getBoss(FreakyFourBoss.SNIPEE).get();
    VelocityEntitySpawner.sendRadial(EntityTypes.TIPPED_ARROW, snipee, 20, 1.6F, Cause.source(SpawnCause.builder().type(SpawnTypes.PROJECTILE).build()).build());
}
Also used : Living(org.spongepowered.api.entity.living.Living)

Example 8 with Living

use of org.spongepowered.api.entity.living.Living in project Skree by Skelril.

the class FrimusBossManager method handleDamaged.

private void handleDamaged() {
    List<Instruction<DamagedCondition, Boss<Living, ZoneBossDetail<FreakyFourInstance>>>> damagedProcessor = getDamagedProcessor();
    damagedProcessor.add((condition, boss) -> {
        DamageEntityEvent event = condition.getEvent();
        new PlayerCombatParser() {

            @Override
            public void processPlayerAttack(Player attacker, Living defender) {
                if (condition.getDamageSource().get() instanceof IndirectEntityDamageSource) {
                    attacker.sendMessage(Text.of(TextColors.RED, "Projectiles can't harm me... Mwahahaha!"));
                    event.setCancelled(true);
                }
            }
        }.parse(event);
        return Optional.empty();
    });
}
Also used : DamageEntityEvent(org.spongepowered.api.event.entity.DamageEntityEvent) Player(org.spongepowered.api.entity.living.player.Player) Living(org.spongepowered.api.entity.living.Living) IndirectEntityDamageSource(org.spongepowered.api.event.cause.entity.damage.source.IndirectEntityDamageSource) 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) PlayerCombatParser(com.skelril.nitro.combat.PlayerCombatParser)

Example 9 with Living

use of org.spongepowered.api.entity.living.Living in project Skree by Skelril.

the class FrimusBossManager method handleDamage.

private void handleDamage() {
    List<Instruction<DamageCondition, Boss<Living, ZoneBossDetail<FreakyFourInstance>>>> damageProcessor = getDamageProcessor();
    damageProcessor.add((condition, boss) -> {
        Entity attacked = condition.getAttacked();
        if (attacked instanceof Living) {
            EntityHealthUtil.forceDamage((Living) attacked, Math.max(1, Probability.getRandom(EntityHealthUtil.getHealth((Living) attacked)) - 5));
            condition.getEvent().setBaseDamage(0);
        }
        return Optional.empty();
    });
}
Also used : Entity(org.spongepowered.api.entity.Entity) Living(org.spongepowered.api.entity.living.Living) 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 10 with Living

use of org.spongepowered.api.entity.living.Living in project Skree by Skelril.

the class SnipeeBossManager 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)

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