use of com.skelril.openboss.Instruction in project Skree by Skelril.
the class StormBringer method setupStormBringer.
private void setupStormBringer() {
Sponge.getEventManager().registerListeners(SkreePlugin.inst(), new BossListener<>(bossManager, Skeleton.class));
List<Instruction<BindCondition, Boss<Skeleton, WildernessBossDetail>>> bindProcessor = bossManager.getBindProcessor();
bindProcessor.add((condition, boss) -> {
Optional<Skeleton> optBossEnt = boss.getTargetEntity();
if (optBossEnt.isPresent()) {
Skeleton bossEnt = optBossEnt.get();
bossEnt.offer(Keys.DISPLAY_NAME, Text.of("Storm Bringer"));
double bossHealth = 20 * 30 * boss.getDetail().getLevel();
setMaxHealth(bossEnt, bossHealth, true);
}
return Optional.empty();
});
List<Instruction<DamageCondition, Boss<Skeleton, WildernessBossDetail>>> damageProcessor = bossManager.getDamageProcessor();
damageProcessor.add((condition, boss) -> {
Entity eToHit = condition.getAttacked();
if (!(eToHit instanceof Living)) {
return Optional.empty();
}
Living toHit = (Living) eToHit;
Location<World> targetLocation = toHit.getLocation();
for (int i = boss.getDetail().getLevel() * Probability.getRangedRandom(1, 10); i >= 0; --i) {
Task.builder().execute(() -> {
Entity lightning = targetLocation.getExtent().createEntity(EntityTypes.LIGHTNING, targetLocation.getPosition());
targetLocation.getExtent().spawnEntity(lightning, Cause.source(SpawnCause.builder().type(SpawnTypes.PLUGIN).build()).build());
}).delayTicks(5 * (6 + i)).submit(SkreePlugin.inst());
}
return Optional.empty();
});
}
use of com.skelril.openboss.Instruction in project Skree by Skelril.
the class SnipeeBossManager method handleBinds.
private void handleBinds() {
List<Instruction<BindCondition, Boss<Living, ZoneBossDetail<FreakyFourInstance>>>> bindProcessor = getBindProcessor();
bindProcessor.add(new NamedBindInstruction<>("Snipee"));
bindProcessor.add(new HealthBindInstruction<>(config.snipeeHP));
bindProcessor.add((condition, boss) -> {
Living entity = boss.getTargetEntity().get();
if (entity instanceof ArmorEquipable) {
((ArmorEquipable) entity).setItemInHand(HandTypes.MAIN_HAND, newItemStack(ItemTypes.BOW));
}
return Optional.empty();
});
}
use of com.skelril.openboss.Instruction in project Skree by Skelril.
the class SnipeeBossManager 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, EntityHealthUtil.getMaxHealth((Living) attacked) * config.snipeeDamage);
condition.getEvent().setBaseDamage(0);
}
return Optional.empty();
});
}
use of com.skelril.openboss.Instruction in project Skree by Skelril.
the class CharlotteBossManager method handleUnbinds.
private void handleUnbinds() {
List<Instruction<UnbindCondition, Boss<Living, ZoneBossDetail<FreakyFourInstance>>>> unbindProcessor = getUnbindProcessor();
unbindProcessor.add(new FreakyFourBossDeath());
}
use of com.skelril.openboss.Instruction 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();
});
}
Aggregations