Search in sources :

Example 16 with Zombie

use of org.spongepowered.api.entity.living.monster.Zombie 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();
}
Also used : CatacombsBossDetail(com.skelril.skree.content.zone.group.catacombs.CatacombsBossDetail) Entity(org.spongepowered.api.entity.Entity) Player(org.spongepowered.api.entity.living.player.Player) Zombie(org.spongepowered.api.entity.living.monster.Zombie) Living(org.spongepowered.api.entity.living.Living)

Example 17 with Zombie

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

the class PatientXInstance method spawnBoss.

public void spawnBoss() {
    resetDifficulty();
    freezeBlocks(false);
    Zombie zombie = (Zombie) getRegion().getExtent().createEntity(EntityTypes.ZOMBIE, getRegion().getCenter());
    getRegion().getExtent().spawnEntity(zombie, Cause.source(SpawnCause.builder().type(SpawnTypes.PLUGIN).build()).build());
    Boss<Zombie, ZoneBossDetail<PatientXInstance>> boss = new Boss<>(zombie, new ZoneBossDetail<>(this));
    bossManager.bind(boss);
    this.boss = boss;
}
Also used : Boss(com.skelril.openboss.Boss) EntityZombie(net.minecraft.entity.monster.EntityZombie) Zombie(org.spongepowered.api.entity.living.monster.Zombie) ZoneBossDetail(com.skelril.skree.content.zone.ZoneBossDetail)

Example 18 with Zombie

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

the class PatientXInstance method healBoss.

public void healBoss(float percentHealth) {
    Optional<Zombie> optBoss = getBoss();
    if (optBoss.isPresent()) {
        Zombie boss = optBoss.get();
        heal(boss, getMaxHealth(boss) * percentHealth);
    }
}
Also used : EntityZombie(net.minecraft.entity.monster.EntityZombie) Zombie(org.spongepowered.api.entity.living.monster.Zombie)

Example 19 with Zombie

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

the class ShnugglesPrimeInstance method spawnMinions.

public void spawnMinions(@Nullable Living target) {
    int spawnCount = Math.max(3, getPlayers(PARTICIPANT).size());
    for (Location<World> spawnPt : spawnPts) {
        if (Probability.getChance(11)) {
            for (int i = spawnCount; i > 0; --i) {
                Zombie zombie = (Zombie) getRegion().getExtent().createEntity(EntityTypes.ZOMBIE, spawnPt.getPosition());
                // TODO convert to Sponge Data API
                ((EntityZombie) zombie).setChild(true);
                EntityHealthUtil.setMaxHealth(zombie, 1);
                getRegion().getExtent().spawnEntity(zombie, Cause.source(SpawnCause.builder().type(SpawnTypes.PLUGIN).build()).build());
                if (target != null) {
                    zombie.setTarget(target);
                }
            }
        }
    }
}
Also used : EntityZombie(net.minecraft.entity.monster.EntityZombie) Zombie(org.spongepowered.api.entity.living.monster.Zombie) EntityGiantZombie(net.minecraft.entity.monster.EntityGiantZombie) EntityZombie(net.minecraft.entity.monster.EntityZombie) World(org.spongepowered.api.world.World)

Example 20 with Zombie

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

the class CatacombsManager method setUpBoss.

private void setUpBoss() {
    Sponge.getEventManager().registerListeners(SkreePlugin.inst(), new BossListener<>(bossManager, Zombie.class));
    List<Instruction<BindCondition, Boss<Zombie, CatacombsBossDetail>>> bindProcessor = bossManager.getBindProcessor();
    bindProcessor.add(new NamedBindInstruction<>("Necromancer"));
    bindProcessor.add(new CatacombsHealthInstruction(200));
    List<Instruction<UnbindCondition, Boss<Zombie, CatacombsBossDetail>>> unbindProcessor = bossManager.getUnbindProcessor();
    unbindProcessor.add(new CheckedSpawnWave());
    unbindProcessor.add(new WaveDropInstruction(2));
    List<Instruction<DamageCondition, Boss<Zombie, CatacombsBossDetail>>> damageProcessor = bossManager.getDamageProcessor();
    damageProcessor.add(new WaveDamageModifier());
}
Also used : WaveDamageModifier(com.skelril.skree.content.zone.group.catacombs.instruction.WaveDamageModifier) CheckedSpawnWave(com.skelril.skree.content.zone.group.catacombs.instruction.CheckedSpawnWave) Zombie(org.spongepowered.api.entity.living.monster.Zombie) WaveDropInstruction(com.skelril.skree.content.zone.group.catacombs.instruction.WaveDropInstruction) NamedBindInstruction(com.skelril.skree.content.zone.group.catacombs.instruction.bossmove.NamedBindInstruction) Instruction(com.skelril.openboss.Instruction) WaveDropInstruction(com.skelril.skree.content.zone.group.catacombs.instruction.WaveDropInstruction) CatacombsHealthInstruction(com.skelril.skree.content.zone.group.catacombs.instruction.CatacombsHealthInstruction) CatacombsHealthInstruction(com.skelril.skree.content.zone.group.catacombs.instruction.CatacombsHealthInstruction)

Aggregations

Zombie (org.spongepowered.api.entity.living.monster.Zombie)20 EntityZombie (net.minecraft.entity.monster.EntityZombie)7 Instruction (com.skelril.openboss.Instruction)6 Entity (org.spongepowered.api.entity.Entity)6 Boss (com.skelril.openboss.Boss)5 CatacombsHealthInstruction (com.skelril.skree.content.zone.group.catacombs.instruction.CatacombsHealthInstruction)5 Player (org.spongepowered.api.entity.living.player.Player)5 Vector3d (com.flowpowered.math.vector.Vector3d)4 CatacombsBossDetail (com.skelril.skree.content.zone.group.catacombs.CatacombsBossDetail)4 Living (org.spongepowered.api.entity.living.Living)4 World (org.spongepowered.api.world.World)4 ZoneBossDetail (com.skelril.skree.content.zone.ZoneBossDetail)2 CatacombsInstance (com.skelril.skree.content.zone.group.catacombs.CatacombsInstance)2 BlockType (org.spongepowered.api.block.BlockType)2 PotionEffect (org.spongepowered.api.effect.potion.PotionEffect)2 Cause (org.spongepowered.api.event.cause.Cause)2 DamageSource (org.spongepowered.api.event.cause.entity.damage.source.DamageSource)2 EntityDamageSource (org.spongepowered.api.event.cause.entity.damage.source.EntityDamageSource)2 SpawnCause (org.spongepowered.api.event.cause.entity.spawn.SpawnCause)2 ItemStack (org.spongepowered.api.item.inventory.ItemStack)2