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