mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-08-01 07:29:26 +07:00
Fixed core generation
This commit is contained in:
@ -359,8 +359,8 @@ public class NetServer extends Module{
|
||||
|
||||
Player player = connections.get(con.id);
|
||||
|
||||
if(player != null && (reason == KickReason.kick || reason == KickReason.banned) && admins.getTraceByID(getUUID(con.id)).uuid != null){
|
||||
PlayerInfo info = admins.getInfo(admins.getTraceByID(getUUID(con.id)).uuid);
|
||||
if(player != null && (reason == KickReason.kick || reason == KickReason.banned) && player.uuid != null){
|
||||
PlayerInfo info = admins.getInfo(player.uuid);
|
||||
info.timesKicked++;
|
||||
info.lastKicked = TimeUtils.millis();
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
package io.anuke.mindustry.maps.generation;
|
||||
|
||||
import com.badlogic.gdx.math.GridPoint2;
|
||||
import com.badlogic.gdx.math.Vector2;
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
import com.badlogic.gdx.utils.IntArray;
|
||||
import com.badlogic.gdx.utils.ObjectMap;
|
||||
@ -208,11 +207,6 @@ public class WorldGenerator{
|
||||
}
|
||||
}
|
||||
|
||||
int coreX = 60, coreY = 60;
|
||||
|
||||
tiles[coreX][coreY].setBlock(StorageBlocks.core);
|
||||
tiles[coreX][coreY].setTeam(Team.blue);
|
||||
|
||||
for(Mission mission : sector.missions){
|
||||
mission.generate(tiles, sector);
|
||||
}
|
||||
@ -232,8 +226,6 @@ public class WorldGenerator{
|
||||
int x = sectorX * sectorSize + localX + Short.MAX_VALUE;
|
||||
int y = sectorY * sectorSize + localY + Short.MAX_VALUE;
|
||||
|
||||
int coreX = 60, coreY = 60;
|
||||
|
||||
Block floor;
|
||||
Block wall = Blocks.air;
|
||||
|
||||
@ -243,13 +235,6 @@ public class WorldGenerator{
|
||||
double temp = vn.noise(x, y, 1f / 300f) * sim3.octaveNoise2D(detailed ? 2 : 1, 1, 1f / 13f, x, y)/13f
|
||||
+ sim3.octaveNoise2D(detailed ? 12 : 6, 0.6, 1f / 920f, x, y);
|
||||
|
||||
double dst = Vector2.dst(localX, localY, coreX, coreY);
|
||||
double lerpDst = 20;
|
||||
|
||||
if(dst < lerpDst){
|
||||
elevation = Mathf.lerp((float)elevation, 0.88f, Mathf.clamp(2*(1f-(float)(dst / lerpDst))));
|
||||
}
|
||||
|
||||
if(elevation < 0.7){
|
||||
floor = Blocks.deepwater;
|
||||
}else if(elevation < 0.79){
|
||||
|
@ -1,8 +1,16 @@
|
||||
package io.anuke.mindustry.maps.missions;
|
||||
|
||||
import com.badlogic.gdx.math.Vector2;
|
||||
import io.anuke.mindustry.content.blocks.Blocks;
|
||||
import io.anuke.mindustry.content.blocks.StorageBlocks;
|
||||
import io.anuke.mindustry.game.GameMode;
|
||||
import io.anuke.mindustry.game.Team;
|
||||
import io.anuke.mindustry.maps.Sector;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.mindustry.world.blocks.Floor;
|
||||
import io.anuke.ucore.scene.ui.layout.Table;
|
||||
import io.anuke.ucore.util.Bundles;
|
||||
import io.anuke.ucore.util.Mathf;
|
||||
|
||||
import static io.anuke.mindustry.Vars.state;
|
||||
|
||||
@ -13,6 +21,35 @@ public class WaveMission implements Mission{
|
||||
this.target = target;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate(Tile[][] tiles, Sector sector){
|
||||
int coreX = tiles.length/2, coreY = tiles.length/2;
|
||||
float targetElevation = Math.max(tiles[coreX][coreY].getElevation(), 1);
|
||||
|
||||
int lerpDst = 20;
|
||||
for(int x = -lerpDst/2; x <= lerpDst/2; x++){
|
||||
for(int y = -lerpDst/2; y <= lerpDst/2; y++){
|
||||
int wx = tiles.length/2 + x, wy = tiles[0].length/2 + y;
|
||||
|
||||
float dst = Vector2.dst(wx, wy, coreX, coreY);
|
||||
float elevation = tiles[wx][wy].getElevation();
|
||||
|
||||
if(dst < lerpDst){
|
||||
elevation = Mathf.lerp(elevation, targetElevation, Mathf.clamp(2*(1f-(dst / lerpDst))));
|
||||
}
|
||||
|
||||
if(tiles[wx][wy].floor().liquidDrop == null){
|
||||
tiles[wx][wy].setElevation((int) elevation);
|
||||
}else{
|
||||
tiles[wx][wy].setFloor((Floor) Blocks.sand);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tiles[coreX][coreY].setBlock(StorageBlocks.core);
|
||||
tiles[coreX][coreY].setTeam(Team.blue);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void display(Table table){
|
||||
table.add(Bundles.format("text.mission.wave", target));
|
||||
|
@ -112,9 +112,7 @@ public class HudFragment extends Fragment{
|
||||
if(Net.hasClient()){
|
||||
t.label(() -> ping.get(Net.getPing())).visible(() -> Net.client() && !gwt).colspan(2);
|
||||
}
|
||||
}).size(-1).visible(() -> Settings.getBool("fps")).update(t -> {
|
||||
t.setTranslation(0, state.mode.disableWaves ? waves.getHeight() : 0);
|
||||
}).get();
|
||||
}).size(-1).visible(() -> Settings.getBool("fps")).update(t -> t.setTranslation(0, state.mode.disableWaves ? waves.getHeight() : 0)).get();
|
||||
|
||||
//make wave box appear below rest of menu
|
||||
cont.swapActor(wavetable, menu.getParent());
|
||||
|
Reference in New Issue
Block a user