Pumpkin King boss

This commit is contained in:
Sam 2017-05-27 18:19:14 +01:00
parent 8f2c84b842
commit b9ad85dd1e
3 changed files with 101 additions and 1 deletions

View File

@ -84,7 +84,7 @@ public class MobaAI
return _target;
}
private String getBoundaryKey()
public String getBoundaryKey()
{
return _owner.GetColor() == ChatColor.RED ? "ORANGE" : "LIGHT_BLUE";
}

View File

@ -0,0 +1,78 @@
package nautilus.game.arcade.game.games.moba.boss.pumpkin;
import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTextMiddle;
import mineplex.core.common.util.UtilTime;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.utils.UtilVariant;
import nautilus.game.arcade.game.games.moba.Moba;
import nautilus.game.arcade.game.games.moba.ai.MobaAI;
import nautilus.game.arcade.game.games.moba.ai.goal.MobaAIMethod;
import nautilus.game.arcade.game.games.moba.ai.goal.MobaDirectAIMethod;
import nautilus.game.arcade.game.games.moba.boss.MobaBoss;
import org.bukkit.Location;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Skeleton;
import org.bukkit.event.EventHandler;
import java.util.concurrent.TimeUnit;
public class PumpkinBoss extends MobaBoss
{
private static final int SPAWN_TIME = (int) TimeUnit.MINUTES.toMillis(10);
private static final int RESPAWN_TIME = (int) TimeUnit.MINUTES.toMillis(5);
private static final MobaAIMethod AI_METHOD = new MobaDirectAIMethod();
private MobaAI _ai;
public PumpkinBoss(Moba host, Location location)
{
super(host, location, RESPAWN_TIME);
}
@Override
public void setup()
{
// Override this so that the entity isn't spawned as soon as the game starts.
UtilServer.RegisterEvents(this);
}
@Override
public LivingEntity spawnEntity()
{
Skeleton skeleton = UtilVariant.spawnWitherSkeleton(_location);
skeleton.setCustomName(C.cDRedB + "Pumpkin King");
skeleton.setCustomNameVisible(true);
skeleton.getWorld().strikeLightningEffect(skeleton.getLocation());
UtilTextMiddle.display(C.cDRedB + "The Pumpkin King", "Has Awoken!", 10, 40, 10);
_host.Announce("The Pumpkin King Has Awoken!", false);
return skeleton;
}
@Override
public MobaAI getAi()
{
if (_ai == null)
{
_ai = new PumpkinBossAI(_host, _entity, _location, AI_METHOD);
}
return _ai;
}
@EventHandler
public void updateSpawn(UpdateEvent event)
{
if (event.getType() != UpdateType.SEC || !_host.IsLive() || !UtilTime.elapsed(_host.GetStateTime(), SPAWN_TIME))
{
return;
}
}
}

View File

@ -0,0 +1,22 @@
package nautilus.game.arcade.game.games.moba.boss.pumpkin;
import nautilus.game.arcade.game.games.moba.Moba;
import nautilus.game.arcade.game.games.moba.ai.MobaAI;
import nautilus.game.arcade.game.games.moba.ai.goal.MobaAIMethod;
import org.bukkit.Location;
import org.bukkit.entity.LivingEntity;
public class PumpkinBossAI extends MobaAI
{
public PumpkinBossAI(Moba host, LivingEntity entity, Location home, MobaAIMethod aiMethod)
{
super(host, null, entity, home, aiMethod);
}
@Override
public String getBoundaryKey()
{
return "GRAY";
}
}