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