Search in sources :

Example 1 with CatacombsBossDetail

use of com.skelril.skree.content.zone.group.catacombs.CatacombsBossDetail in project Skree by Skelril.

the class UndeadMinionRetaliation method apply.

@Override
public Optional<Instruction<DamagedCondition, Boss<Zombie, CatacombsBossDetail>>> apply(DamagedCondition damagedCondition, Boss<Zombie, CatacombsBossDetail> zombieCatacombsBossDetailBoss) {
    Zombie boss = zombieCatacombsBossDetailBoss.getTargetEntity().get();
    CatacombsBossDetail detail = zombieCatacombsBossDetailBoss.getDetail();
    CatacombsInstance inst = detail.getZone();
    for (int i = quantity(detail); i > 0; --i) {
        inst.spawnWaveMob(boss.getLocation());
    }
    return Optional.empty();
}
Also used : CatacombsBossDetail(com.skelril.skree.content.zone.group.catacombs.CatacombsBossDetail) CatacombsInstance(com.skelril.skree.content.zone.group.catacombs.CatacombsInstance) Zombie(org.spongepowered.api.entity.living.monster.Zombie)

Example 2 with CatacombsBossDetail

use of com.skelril.skree.content.zone.group.catacombs.CatacombsBossDetail in project Skree by Skelril.

the class DeathMark method apply.

@Override
public Optional<Instruction<DamagedCondition, Boss<Zombie, CatacombsBossDetail>>> apply(DamagedCondition damagedCondition, Boss<Zombie, CatacombsBossDetail> zombieCatacombsBossDetailBoss) {
    new PlayerCombatParser() {

        @Override
        public void processPlayerAttack(Player attacker, Living defender) {
            CatacombsBossDetail detail = zombieCatacombsBossDetailBoss.getDetail();
            CatacombsInstance inst = detail.getZone();
            if (detail.isWarmingMark()) {
                return;
            }
            if (detail.getMarked().isPresent()) {
                if (attacker.equals(detail.getMarked().get())) {
                    inst.getPlayerMessageChannel(PlayerClassifier.SPECTATOR).send(Text.of(TextColors.YELLOW, attacker.getName() + " has been freed!"));
                } else {
                    detail.getMarked().get().offer(Keys.HEALTH, 0D);
                }
                detail.setMarked(null);
            } else if (activate(detail)) {
                detail.warmMark();
                inst.getPlayerMessageChannel(PlayerClassifier.SPECTATOR).send(Text.of(TextColors.DARK_RED, "The necromancer stares intently at " + attacker.getName() + "!"));
                Task.builder().execute(() -> {
                    if (!inst.contains(attacker)) {
                        detail.setMarked(null);
                        return;
                    }
                    detail.setMarked(attacker);
                    inst.getPlayerMessageChannel(PlayerClassifier.SPECTATOR).send(Text.of(TextColors.DARK_RED, attacker.getName() + " has been marked!"));
                }).delay(3, TimeUnit.SECONDS).submit(SkreePlugin.inst());
            }
        }
    }.parse(damagedCondition.getEvent());
    return Optional.empty();
}
Also used : CatacombsBossDetail(com.skelril.skree.content.zone.group.catacombs.CatacombsBossDetail) Player(org.spongepowered.api.entity.living.player.Player) CatacombsInstance(com.skelril.skree.content.zone.group.catacombs.CatacombsInstance) Living(org.spongepowered.api.entity.living.Living) PlayerCombatParser(com.skelril.nitro.combat.PlayerCombatParser)

Example 3 with CatacombsBossDetail

use of com.skelril.skree.content.zone.group.catacombs.CatacombsBossDetail in project Skree by Skelril.

the class BlipDefense method apply.

@Override
public Optional<Instruction<DamagedCondition, Boss<Zombie, CatacombsBossDetail>>> apply(DamagedCondition damagedCondition, Boss<Zombie, CatacombsBossDetail> zombieCatacombsBossDetailBoss) {
    CatacombsBossDetail detail = zombieCatacombsBossDetailBoss.getDetail();
    if (activate(detail)) {
        Zombie boss = zombieCatacombsBossDetailBoss.getTargetEntity().get();
        Vector3d vel = EntityDirectionUtil.getFacingVector(boss);
        vel = vel.mul(getMultiplier());
        vel = new Vector3d(vel.getX(), Math.min(getYCiel(), Math.max(getYFloor(), vel.getY())), vel.getZ());
        boss.setVelocity(vel);
    }
    return Optional.empty();
}
Also used : CatacombsBossDetail(com.skelril.skree.content.zone.group.catacombs.CatacombsBossDetail) Zombie(org.spongepowered.api.entity.living.monster.Zombie) Vector3d(com.flowpowered.math.vector.Vector3d)

Example 4 with CatacombsBossDetail

use of com.skelril.skree.content.zone.group.catacombs.CatacombsBossDetail in project Skree by Skelril.

the class ExplosiveArrowBarrage method apply.

@Override
public Optional<Instruction<DamagedCondition, Boss<Zombie, CatacombsBossDetail>>> apply(DamagedCondition damagedCondition, Boss<Zombie, CatacombsBossDetail> zombieCatacombsBossDetailBoss) {
    CatacombsBossDetail detail = zombieCatacombsBossDetailBoss.getDetail();
    CatacombsInstance inst = detail.getZone();
    Zombie boss = zombieCatacombsBossDetailBoss.getTargetEntity().get();
    if (activate(detail)) {
        List<Entity> arrows = VelocityEntitySpawner.sendRadial(EntityTypes.TIPPED_ARROW, boss, Cause.source(SpawnCause.builder().type(SpawnTypes.PROJECTILE).build()).build());
        Task.builder().execute(() -> {
            for (Entity arrow : arrows) {
                Location<World> target = arrow.getLocation();
                target.getExtent().triggerExplosion(Explosion.builder().location(target).radius(explosionStrength(detail)).canCauseFire(allowFire(detail)).shouldBreakBlocks(allowBlockBreak(detail)).shouldDamageEntities(true).build(), Cause.source(SkreePlugin.container()).owner(boss).build());
            }
        }).delay(getDelay(detail), TimeUnit.SECONDS).submit(SkreePlugin.inst());
    }
    return Optional.empty();
}
Also used : CatacombsBossDetail(com.skelril.skree.content.zone.group.catacombs.CatacombsBossDetail) Entity(org.spongepowered.api.entity.Entity) CatacombsInstance(com.skelril.skree.content.zone.group.catacombs.CatacombsInstance) Zombie(org.spongepowered.api.entity.living.monster.Zombie) World(org.spongepowered.api.world.World)

Example 5 with CatacombsBossDetail

use of com.skelril.skree.content.zone.group.catacombs.CatacombsBossDetail in project Skree by Skelril.

the class SoulReaper method apply.

@Override
public Optional<Instruction<DamageCondition, Boss<Zombie, CatacombsBossDetail>>> apply(DamageCondition damageCondition, Boss<Zombie, CatacombsBossDetail> zombieCatacombsBossDetailBoss) {
    CatacombsBossDetail detail = zombieCatacombsBossDetailBoss.getDetail();
    Entity attacked = damageCondition.getAttacked();
    if (attacked instanceof Player && activate(detail)) {
        Task.builder().execute(() -> {
            Optional<Zombie> optZombie = zombieCatacombsBossDetailBoss.getTargetEntity();
            if (optZombie.isPresent()) {
                Zombie boss = optZombie.get();
                double stolen = EntityHealthUtil.getHealth((Living) attacked) - 1;
                attacked.offer(Keys.HEALTH, 1D);
                EntityHealthUtil.heal(boss, stolen);
                ((Player) attacked).sendMessage(Text.of(TextColors.RED, "The necromancer reaps your soul."));
            }
        }).delayTicks(1).submit(SkreePlugin.inst());
    }
    return Optional.empty();
}
Also used : CatacombsBossDetail(com.skelril.skree.content.zone.group.catacombs.CatacombsBossDetail) Entity(org.spongepowered.api.entity.Entity) Player(org.spongepowered.api.entity.living.player.Player) Zombie(org.spongepowered.api.entity.living.monster.Zombie) Living(org.spongepowered.api.entity.living.Living)

Aggregations

CatacombsBossDetail (com.skelril.skree.content.zone.group.catacombs.CatacombsBossDetail)5 Zombie (org.spongepowered.api.entity.living.monster.Zombie)4 CatacombsInstance (com.skelril.skree.content.zone.group.catacombs.CatacombsInstance)3 Entity (org.spongepowered.api.entity.Entity)2 Living (org.spongepowered.api.entity.living.Living)2 Player (org.spongepowered.api.entity.living.player.Player)2 Vector3d (com.flowpowered.math.vector.Vector3d)1 PlayerCombatParser (com.skelril.nitro.combat.PlayerCombatParser)1 World (org.spongepowered.api.world.World)1