Search in sources :

Example 1 with CaveSpider

use of org.spongepowered.api.entity.living.monster.CaveSpider in project Skree by Skelril.

the class FreakyFourInstance method spawnCharlotteMinion.

private void spawnCharlotteMinion(Vector3d position) {
    Entity entity = getRegion().getExtent().createEntity(EntityTypes.CAVE_SPIDER, position);
    getRegion().getExtent().spawnEntity(entity, Cause.source(SpawnCause.builder().type(SpawnTypes.PLUGIN).build()).build());
    Boss<CaveSpider, ZoneBossDetail<FreakyFourInstance>> boss = new Boss<>((CaveSpider) entity, new ZoneBossDetail<>(this));
    charlotteMinions.add(boss);
    charlotteManager.getMinionManager().bind(boss);
}
Also used : Entity(org.spongepowered.api.entity.Entity) Boss(com.skelril.openboss.Boss) CaveSpider(org.spongepowered.api.entity.living.monster.CaveSpider) ZoneBossDetail(com.skelril.skree.content.zone.ZoneBossDetail)

Example 2 with CaveSpider

use of org.spongepowered.api.entity.living.monster.CaveSpider 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();
    });
}
Also used : FreakyFourInstance(com.skelril.skree.content.zone.group.freakyfour.FreakyFourInstance) CaveSpider(org.spongepowered.api.entity.living.monster.CaveSpider) Living(org.spongepowered.api.entity.living.Living) Instruction(com.skelril.openboss.Instruction) ZoneBossDetail(com.skelril.skree.content.zone.ZoneBossDetail)

Aggregations

ZoneBossDetail (com.skelril.skree.content.zone.ZoneBossDetail)2 CaveSpider (org.spongepowered.api.entity.living.monster.CaveSpider)2 Boss (com.skelril.openboss.Boss)1 Instruction (com.skelril.openboss.Instruction)1 FreakyFourInstance (com.skelril.skree.content.zone.group.freakyfour.FreakyFourInstance)1 Entity (org.spongepowered.api.entity.Entity)1 Living (org.spongepowered.api.entity.living.Living)1