Merged current master to branch
This commit is contained in:
@@ -67,7 +67,7 @@ public class Sector{
|
||||
return !headless && control.saves.getByID(saveID) != null;
|
||||
}
|
||||
|
||||
public int packedPosition(){
|
||||
public int pos(){
|
||||
return Bits.packInt(x, y);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public class Sectors{
|
||||
world.loadSector(sector);
|
||||
logic.play();
|
||||
if(!headless){
|
||||
sector.saveID = control.saves.addSave("sector-" + sector.packedPosition()).index;
|
||||
sector.saveID = control.saves.addSave("sector-" + sector.pos()).index;
|
||||
}
|
||||
world.sectors.save();
|
||||
world.setSector(sector);
|
||||
|
||||
@@ -17,6 +17,7 @@ import io.anuke.mindustry.maps.Sector;
|
||||
import io.anuke.mindustry.maps.missions.Mission;
|
||||
import io.anuke.mindustry.type.Item;
|
||||
import io.anuke.mindustry.world.Block;
|
||||
import io.anuke.mindustry.world.Pos;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.mindustry.world.blocks.Floor;
|
||||
import io.anuke.mindustry.world.blocks.OreBlock;
|
||||
@@ -86,7 +87,7 @@ public class WorldGenerator{
|
||||
Tile tile = tiles[x][y];
|
||||
|
||||
if(tile.block().isMultiblock()){
|
||||
multiblocks.add(tile.packedPosition());
|
||||
multiblocks.add(tile.pos());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -95,8 +96,8 @@ public class WorldGenerator{
|
||||
for(int i = 0; i < multiblocks.size; i++){
|
||||
int pos = multiblocks.get(i);
|
||||
|
||||
int x = pos % tiles.length;
|
||||
int y = pos / tiles.length;
|
||||
int x = Pos.x(pos);
|
||||
int y = Pos.y(pos);
|
||||
|
||||
Block result = tiles[x][y].block();
|
||||
Team team = tiles[x][y].getTeam();
|
||||
|
||||
@@ -38,7 +38,7 @@ public class BattleMission extends MissionWithStartingCore{
|
||||
|
||||
@Override
|
||||
public GameMode getMode(){
|
||||
return GameMode.noWaves;
|
||||
return GameMode.attack;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2,10 +2,8 @@ package io.anuke.mindustry.maps.missions;
|
||||
|
||||
import com.badlogic.gdx.math.GridPoint2;
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
import io.anuke.mindustry.content.blocks.StorageBlocks;
|
||||
import io.anuke.mindustry.game.GameMode;
|
||||
import io.anuke.mindustry.game.SpawnGroup;
|
||||
import io.anuke.mindustry.game.Team;
|
||||
import io.anuke.mindustry.game.UnlockableContent;
|
||||
import io.anuke.mindustry.maps.Sector;
|
||||
import io.anuke.mindustry.maps.generation.Generation;
|
||||
@@ -34,7 +32,7 @@ public abstract class Mission{
|
||||
}
|
||||
|
||||
public GameMode getMode(){
|
||||
return GameMode.noWaves;
|
||||
return GameMode.attack;
|
||||
}
|
||||
|
||||
/**Sets the message displayed on mission begin. Returns this mission for chaining.*/
|
||||
|
||||
@@ -42,6 +42,13 @@ public abstract class MissionWithStartingCore extends Mission{
|
||||
startingCoreTile.setBlock(StorageBlocks.core);
|
||||
startingCoreTile.setTeam(team);
|
||||
state.teams.get(team).cores.add(startingCoreTile);
|
||||
|
||||
//makes sure there's a flat area around core
|
||||
for(int dx = -2; dx <= 2; dx++){
|
||||
for(int dy = -2; dy <= 2; dy++){
|
||||
gen.tiles[startingCoreTile.x + dx][startingCoreTile.y + dy].setElevation(startingCoreTile.getElevation());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -74,7 +74,7 @@ public class WaveMission extends MissionWithStartingCore{
|
||||
@Override
|
||||
public void update(){
|
||||
if(state.wave > target){
|
||||
state.mode = GameMode.noWaves;
|
||||
state.mode = GameMode.attack;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user