Search in sources :

Example 1 with Zombie

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

the class CatacombsInstance method spawnZombie.

private Zombie spawnZombie(Location<World> loc) {
    Zombie zombie = (Zombie) loc.getExtent().createEntity(EntityTypes.ZOMBIE, loc.getPosition());
    loc.getExtent().spawnEntity(zombie, Cause.source(SpawnCause.builder().type(SpawnTypes.PLUGIN).build()).build());
    return zombie;
}
Also used : Zombie(org.spongepowered.api.entity.living.monster.Zombie)

Example 2 with Zombie

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

the class PatientXInstance method spawnCreatures.

public void spawnCreatures() {
    Zombie boss = getBoss().get();
    Collection<Living> entities = getContained(Living.class);
    if (entities.size() > 500) {
        sendAttackBroadcast("Ring-a-round the rosie, a pocket full of posies...", AttackSeverity.NORMAL);
        EntityHealthUtil.toFullHealth(boss);
        for (Entity entity : entities) {
            if (entity instanceof Player) {
                entity.offer(Keys.HEALTH, 0D);
            } else if (!entity.equals(boss)) {
                entity.remove();
            }
        }
        return;
    }
    double amt = getPlayers(PARTICIPANT).size() * difficulty;
    Location l = getCenter();
    for (int i = 0; i < amt; i++) {
        Entity zombie = getRegion().getExtent().createEntity(EntityTypes.ZOMBIE, l.getPosition());
        // TODO convert to Sponge Data API
        ((EntityZombie) zombie).setCanPickUpLoot(false);
        ((EntityZombie) zombie).setChild(true);
        getRegion().getExtent().spawnEntity(zombie, Cause.source(SpawnCause.builder().type(SpawnTypes.PLUGIN).build()).build());
    }
}
Also used : Entity(org.spongepowered.api.entity.Entity) Player(org.spongepowered.api.entity.living.player.Player) EntityZombie(net.minecraft.entity.monster.EntityZombie) Zombie(org.spongepowered.api.entity.living.monster.Zombie) EntityZombie(net.minecraft.entity.monster.EntityZombie) Living(org.spongepowered.api.entity.living.Living) Location(org.spongepowered.api.world.Location)

Example 3 with Zombie

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

Example 4 with Zombie

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

the class WaveDropInstruction method apply.

@Override
public Optional<Instruction<UnbindCondition, Boss<Zombie, CatacombsBossDetail>>> apply(UnbindCondition condition, Boss<Zombie, CatacombsBossDetail> boss) {
    int wave = boss.getDetail().getWave();
    Collection<ItemStack> drops = dropTable.getDrops(wave, wave * .5 * modifier);
    drops.addAll(foodDropTable.getDrops(1, .5 * modifier));
    Optional<Zombie> optEnt = boss.getTargetEntity();
    if (optEnt.isPresent()) {
        Task.builder().execute(() -> {
            new ItemDropper(optEnt.get().getLocation()).dropStacks(drops, SpawnTypes.DROPPED_ITEM);
        }).delayTicks(1).submit(SkreePlugin.inst());
    }
    return Optional.empty();
}
Also used : ItemDropper(com.skelril.nitro.item.ItemDropper) Zombie(org.spongepowered.api.entity.living.monster.Zombie) ItemStack(org.spongepowered.api.item.inventory.ItemStack) ItemStackFactory.newItemStack(com.skelril.nitro.item.ItemStackFactory.newItemStack)

Example 5 with Zombie

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

the class CatacombsManager method setUpWave.

private void setUpWave() {
    Sponge.getEventManager().registerListeners(SkreePlugin.inst(), new BossListener<>(waveMobManager, Zombie.class));
    List<Instruction<UnbindCondition, Boss<Zombie, CatacombsBossDetail>>> unbindProcessor = waveMobManager.getUnbindProcessor();
    unbindProcessor.add(new CheckedSpawnWave());
    unbindProcessor.add(new WaveDropInstruction(1));
    List<Instruction<DamageCondition, Boss<Zombie, CatacombsBossDetail>>> damageProcessor = waveMobManager.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)

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