mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-12 16:57:52 +07:00
Missions now displayed as number / Improved mission gen
This commit is contained in:
@ -58,6 +58,7 @@ text.sector.resume=Resume
|
|||||||
text.sector.locked=[scarlet][[Incomplete]
|
text.sector.locked=[scarlet][[Incomplete]
|
||||||
text.sector.unexplored=[accent][[Unexplored]
|
text.sector.unexplored=[accent][[Unexplored]
|
||||||
|
|
||||||
|
text.missions=Missions:[LIGHT_GRAY] {0}
|
||||||
text.mission=Mission:[LIGHT_GRAY] {0}
|
text.mission=Mission:[LIGHT_GRAY] {0}
|
||||||
text.mission.info=Mission Info
|
text.mission.info=Mission Info
|
||||||
text.mission.complete=Mission complete!
|
text.mission.complete=Mission complete!
|
||||||
|
@ -19,6 +19,7 @@ import io.anuke.mindustry.type.ItemStack;
|
|||||||
import io.anuke.mindustry.type.Recipe;
|
import io.anuke.mindustry.type.Recipe;
|
||||||
import io.anuke.mindustry.world.ColorMapper;
|
import io.anuke.mindustry.world.ColorMapper;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
|
import io.anuke.mindustry.world.blocks.defense.Wall;
|
||||||
import io.anuke.ucore.core.Settings;
|
import io.anuke.ucore.core.Settings;
|
||||||
import io.anuke.ucore.entities.Entities;
|
import io.anuke.ucore.entities.Entities;
|
||||||
import io.anuke.ucore.entities.EntityGroup;
|
import io.anuke.ucore.entities.EntityGroup;
|
||||||
@ -360,35 +361,11 @@ public class Sectors{
|
|||||||
sector.x = (short)finalX;
|
sector.x = (short)finalX;
|
||||||
sector.y = (short)finalY;
|
sector.y = (short)finalY;
|
||||||
|
|
||||||
//int missions = Math.max((int)(Math.log10(sector.difficulty/3.0) * 5), 1);
|
//recipe mission
|
||||||
|
addRecipeMission(sector, 3);
|
||||||
|
|
||||||
//for(int i = 0; i < missions; i++){
|
//expand
|
||||||
|
addExpandMission(sector, 16);
|
||||||
//}
|
|
||||||
|
|
||||||
//build list of locked recipes to add mission for obtaining it
|
|
||||||
if(!headless && Mathf.randomSeed(sector.getSeed() + 3) < 0.5){
|
|
||||||
Array<Recipe> recipes = new Array<>();
|
|
||||||
for(Recipe r : content.recipes()){
|
|
||||||
if(!control.unlocks.isUnlocked(r)){
|
|
||||||
recipes.add(r);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(recipes.size > 0){
|
|
||||||
Recipe recipe = recipes.random();
|
|
||||||
sector.missions.addAll(Missions.blockRecipe(recipe.result));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//add 0-1 expansion mission
|
|
||||||
if(sector.missions.size > 0){
|
|
||||||
int ex = finalWidth >= 3 ? 0 : Mathf.randomSeed(sector.getSeed() + 6, -2, 2);
|
|
||||||
int ey = finalHeight >= 3 ? 0 : Mathf.randomSeed(sector.getSeed() + 7, -2, 2);
|
|
||||||
if(ex != 0 || ey != 0){
|
|
||||||
sector.missions.add(new ExpandMission(ex, ey));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//50% chance to get a wave mission
|
//50% chance to get a wave mission
|
||||||
if(Mathf.randomSeed(sector.getSeed() + 6) < 0.5){
|
if(Mathf.randomSeed(sector.getSeed() + 6) < 0.5){
|
||||||
@ -397,12 +374,42 @@ public class Sectors{
|
|||||||
sector.missions.add(new BattleMission());
|
sector.missions.add(new BattleMission());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Mathf.randomSeed(sector.getSeed() + 3) < 0.5){
|
//possibly add another recipe mission
|
||||||
|
addRecipeMission(sector, 11);
|
||||||
|
|
||||||
|
//possibly another battle mission
|
||||||
|
if(Mathf.randomSeed(sector.getSeed() + 3) < 0.3){
|
||||||
|
addExpandMission(sector, 20);
|
||||||
|
sector.missions.add(new BattleMission());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//sector.missions.add(new ExpandMission());
|
private void addExpandMission(Sector sector, int offset){
|
||||||
//sector.missions.add(new WaveMission(sector.difficulty*5 + Mathf.randomSeed(sector.getSeed(), 0, 3)*5));
|
//add 0-1 expansion mission
|
||||||
|
if(sector.missions.size > 0){
|
||||||
|
int ex = sector.width >= 3 ? 0 : Mathf.randomSeed(sector.getSeed() + 6 + offset, -2, 2);
|
||||||
|
int ey = sector.height >= 3 ? 0 : Mathf.randomSeed(sector.getSeed() + 7 + offset, -2, 2);
|
||||||
|
if(ex != 0 || ey != 0){
|
||||||
|
sector.missions.add(new ExpandMission(ex, ey));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addRecipeMission(Sector sector, int offset){
|
||||||
|
//build list of locked recipes to add mission for obtaining it
|
||||||
|
if(!headless && Mathf.randomSeed(sector.getSeed() + offset) < 0.5){
|
||||||
|
Array<Recipe> recipes = new Array<>();
|
||||||
|
for(Recipe r : content.recipes()){
|
||||||
|
//..wall missions don't happen
|
||||||
|
if(r.result instanceof Wall || control.unlocks.isUnlocked(r)) continue;
|
||||||
|
recipes.add(r);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(recipes.size > 0){
|
||||||
|
Recipe recipe = recipes.get(Mathf.randomSeed(sector.getSeed() + 10, 0, recipes.size-1));
|
||||||
|
sector.missions.addAll(Missions.blockRecipe(recipe.result));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createTexture(Sector sector){
|
private void createTexture(Sector sector){
|
||||||
|
@ -42,8 +42,8 @@ public class SectorsDialog extends FloatingDialog{
|
|||||||
+ (selected.saveID == -1 ? " " + Bundles.get("text.sector.unexplored") :
|
+ (selected.saveID == -1 ? " " + Bundles.get("text.sector.unexplored") :
|
||||||
(selected.hasSave() ? " [accent]/[white] " + Bundles.format("text.sector.time", selected.getSave().getPlayTime()) : ""))));
|
(selected.hasSave() ? " [accent]/[white] " + Bundles.format("text.sector.time", selected.getSave().getPlayTime()) : ""))));
|
||||||
content().row();
|
content().row();
|
||||||
content().label(() -> Bundles.format("text.mission", selected == null || selected.completedMissions >= selected.missions.size
|
content().label(() -> Bundles.format("text.missions", selected == null || selected.completedMissions >= selected.missions.size
|
||||||
? Bundles.get("text.none") : selected.missions.get(selected.completedMissions).menuDisplayString())
|
? Bundles.get("text.none") : selected.missions.size)
|
||||||
+ "[WHITE] " /*+ (selected == null ? "" : Bundles.format("text.save.difficulty", "[LIGHT_GRAY]" + selected.getDifficulty().toString()))*/);
|
+ "[WHITE] " /*+ (selected == null ? "" : Bundles.format("text.save.difficulty", "[LIGHT_GRAY]" + selected.getDifficulty().toString()))*/);
|
||||||
content().row();
|
content().row();
|
||||||
content().add(new SectorView()).grow();
|
content().add(new SectorView()).grow();
|
||||||
|
Reference in New Issue
Block a user