mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-11 00:07:46 +07:00
Changed tutorial ore gen
This commit is contained in:
@ -5,10 +5,6 @@ import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Goal: To create a system to send events to the server from the client and vice versa, without creating a new packet type each time.<br>
|
||||
* These events may optionally also trigger on the caller client/server as well.<br>
|
||||
*/
|
||||
public class Annotations{
|
||||
|
||||
/** Marks a class as serializable.*/
|
||||
|
@ -4,8 +4,14 @@ import com.badlogic.gdx.utils.Array;
|
||||
import io.anuke.mindustry.content.Items;
|
||||
import io.anuke.mindustry.content.UnitTypes;
|
||||
import io.anuke.mindustry.content.blocks.*;
|
||||
import io.anuke.mindustry.game.EventType.WorldLoadEvent;
|
||||
import io.anuke.mindustry.maps.generation.Generation;
|
||||
import io.anuke.mindustry.maps.generation.WorldGenerator.GenResult;
|
||||
import io.anuke.mindustry.maps.missions.*;
|
||||
import io.anuke.mindustry.type.Item;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.mindustry.world.blocks.Floor;
|
||||
import io.anuke.ucore.core.Events;
|
||||
|
||||
import static io.anuke.mindustry.Vars.*;
|
||||
|
||||
@ -13,7 +19,7 @@ import static io.anuke.mindustry.Vars.*;
|
||||
public class TutorialSector{
|
||||
|
||||
public static Array<Mission> getMissions(){
|
||||
int x = sectorSize/2, y = sectorSize/2;
|
||||
//int x = sectorSize/2, y = sectorSize/2;
|
||||
|
||||
return Array.with(
|
||||
new ItemMission(Items.copper, 30).setMessage("$tutorial.begin"),
|
||||
@ -31,7 +37,22 @@ public class TutorialSector{
|
||||
new BlockLocMission(ProductionBlocks.mechanicalDrill, 55, 60).setMessage("$tutorial.drillturret"),
|
||||
|
||||
new WaveMission(5).setMessage("$tutorial.waves"),
|
||||
new ExpandMission(1, 0),
|
||||
|
||||
new ActionMission(() -> {
|
||||
Array<Item> ores = Array.with(Items.copper, Items.coal, Items.lead);
|
||||
GenResult res = new GenResult();
|
||||
for(int x = 0; x < world.width(); x++){
|
||||
for(int y = 0; y < world.height(); y++){
|
||||
Tile tile = world.tile(x, y);
|
||||
world.generator().generateTile(res, 0, 0, x, y, true, null, ores);
|
||||
if(!tile.hasCliffs()){
|
||||
tile.setFloor((Floor) res.floor);
|
||||
}
|
||||
}
|
||||
}
|
||||
Events.fire(new WorldLoadEvent());
|
||||
}),
|
||||
|
||||
new ItemMission(Items.lead, 30).setMessage("$tutorial.lead"),
|
||||
new ItemMission(Items.copper, 150).setMessage("$tutorial.morecopper"),
|
||||
|
||||
@ -45,9 +66,10 @@ public class TutorialSector{
|
||||
|
||||
new BlockMission(UnitBlocks.daggerFactory).setMessage("$tutorial.daggerfactory"),
|
||||
new UnitMission(UnitTypes.dagger).setMessage("$tutorial.dagger"),
|
||||
new ExpandMission(-1, 0),
|
||||
new ExpandMission(1, 0),
|
||||
new BattleMission(){
|
||||
public void generate(Generation gen){}
|
||||
public void generate(Generation gen){
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isComplete(){
|
||||
@ -67,7 +89,7 @@ public class TutorialSector{
|
||||
}
|
||||
|
||||
private static void generateBase(){
|
||||
int x = sectorSize/2, y = sectorSize/2;
|
||||
int x = sectorSize/2, y = sectorSize + sectorSize/2;
|
||||
world.setBlock(world.tile(x, y), StorageBlocks.core, waveTeam);
|
||||
// world.setBlock(world.tile(x + 1, y + 2), TurretBlocks.duo, waveTeam);
|
||||
//world.setBlock(world.tile(x + 1, y - 2), TurretBlocks.duo, waveTeam);
|
||||
|
@ -6,7 +6,7 @@ import io.anuke.mindustry.game.GameMode;
|
||||
import static io.anuke.mindustry.Vars.threads;
|
||||
|
||||
/**A mission which simply runs a single action and is completed instantly.*/
|
||||
public abstract class ActionMission extends Mission{
|
||||
public class ActionMission extends Mission{
|
||||
protected Runnable runner;
|
||||
|
||||
public ActionMission(Runnable runner){
|
||||
|
Reference in New Issue
Block a user