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