Added resource mission
This commit is contained in:
@@ -62,6 +62,7 @@ text.sector.unexplored=[accent][[Unexplored]
|
||||
text.mission=Mission:[LIGHT_GRAY] {0}
|
||||
text.mission.wave=Survive [accent]{0}[] waves.
|
||||
text.mission.battle=Destroy the enemy base.
|
||||
text.mission.resource=Obtain {0} x{1}
|
||||
text.none=<none>
|
||||
text.close=Close
|
||||
text.quit=Quit
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package io.anuke.mindustry.maps.missions;
|
||||
|
||||
import io.anuke.mindustry.Vars;
|
||||
import io.anuke.mindustry.type.Item;
|
||||
import io.anuke.ucore.util.Bundles;
|
||||
|
||||
public class ResourceMission implements Mission{
|
||||
private final Item item;
|
||||
private final int amount;
|
||||
|
||||
public ResourceMission(Item item, int amount){
|
||||
this.item = item;
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isComplete(){
|
||||
return Vars.state.teams.getTeams(true).first().cores.first().entity.items.has(item, amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String displayString(){
|
||||
return Bundles.format("text.mission.resource", item.localizedName(), amount);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user