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();
}
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();
}
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();
}
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();
}
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();
}
Aggregations