New insectoid almost done + DestroyBlockObjective

This commit is contained in:
Anuken
2022-04-18 21:34:21 -04:00
parent 5721cc75b6
commit 5b4e424cda
21 changed files with 234 additions and 19 deletions

View File

@@ -18,7 +18,7 @@ public class MapObjectives{
public static Prov<MapObjective>[] allObjectiveTypes = new Prov[]{
ResearchObjective::new, BuildCountObjective::new, UnitCountObjective::new, ItemObjective::new,
CommandModeObjective::new, CoreItemObjective::new, DestroyCoreObjective::new, DestroyUnitsObjective::new,
TimerObjective::new, FlagObjective::new
TimerObjective::new, FlagObjective::new, DestroyBlockObjective::new
};
public static Prov<ObjectiveMarker>[] allMarkerTypes = new Prov[]{
@@ -208,6 +208,34 @@ public class MapObjectives{
}
}
public static class DestroyBlockObjective extends MapObjective{
public int x, y;
public Team team = Team.malis;
public Block block = Blocks.router;
public DestroyBlockObjective(Block block, int x, int y, Team team){
this.block = block;
this.x = x;
this.y = y;
this.team = team;
}
public DestroyBlockObjective(){
}
@Override
public boolean complete(){
var build = world.build(x, y);
return build == null || build.team != team || build.block != block;
}
@Override
public String text(){
return Core.bundle.format("objective.destroyblock", block.emoji(), block.localizedName);
}
}
/** Command any unit to do anything. Always compete in headless mode. */
public static class CommandModeObjective extends MapObjective{