Search in sources :

Example 1 with CatacombsInstance

use of com.skelril.skree.content.zone.group.catacombs.CatacombsInstance 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 CatacombsInstance

use of com.skelril.skree.content.zone.group.catacombs.CatacombsInstance 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.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.setMarked(attacker);
                inst.getPlayerMessageChannel(PlayerClassifier.SPECTATOR).send(Text.of(TextColors.DARK_RED, attacker.getName() + " has been marked!"));
            }
        }
    }.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 CatacombsInstance

use of com.skelril.skree.content.zone.group.catacombs.CatacombsInstance 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)

Aggregations

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