mirror of
https://github.com/Anuken/Mindustry.git
synced 2024-09-20 12:58:38 +03:00
Mech balance / Re-added map screenshot
This commit is contained in:
parent
db3aae1388
commit
b419a96d69
@ -565,7 +565,7 @@ liquid.oil.name = Oil
|
|||||||
liquid.cryofluid.name = Cryofluid
|
liquid.cryofluid.name = Cryofluid
|
||||||
mech.alpha-mech.name = Alpha
|
mech.alpha-mech.name = Alpha
|
||||||
mech.alpha-mech.weapon = Heavy Repeater
|
mech.alpha-mech.weapon = Heavy Repeater
|
||||||
mech.alpha-mech.ability = None
|
mech.alpha-mech.ability = Regeneration
|
||||||
mech.alpha-mech.description = The standard mech. Has decent speed and damage output.
|
mech.alpha-mech.description = The standard mech. Has decent speed and damage output.
|
||||||
mech.delta-mech.name = Delta
|
mech.delta-mech.name = Delta
|
||||||
mech.delta-mech.weapon = Arc Generator
|
mech.delta-mech.weapon = Arc Generator
|
||||||
@ -600,9 +600,10 @@ unit.speed = [LIGHT_GRAY]Speed: {0}
|
|||||||
mech.weapon = [LIGHT_GRAY]Weapon: {0}
|
mech.weapon = [LIGHT_GRAY]Weapon: {0}
|
||||||
mech.health = [LIGHT_GRAY]Health: {0}
|
mech.health = [LIGHT_GRAY]Health: {0}
|
||||||
mech.itemcapacity = [LIGHT_GRAY]Item Capacity: {0}
|
mech.itemcapacity = [LIGHT_GRAY]Item Capacity: {0}
|
||||||
mech.minespeed = [LIGHT_GRAY]Mining Speed: {0}
|
mech.minespeed = [LIGHT_GRAY]Mining Speed: {0}%
|
||||||
mech.minepower = [LIGHT_GRAY]Mining Power: {0}
|
mech.minepower = [LIGHT_GRAY]Mining Power: {0}
|
||||||
mech.ability = [LIGHT_GRAY]Ability: {0}
|
mech.ability = [LIGHT_GRAY]Ability: {0}
|
||||||
|
mech.buildspeed = [LIGHT_GRAY]Building Speed: {0}%
|
||||||
liquid.heatcapacity = [LIGHT_GRAY]Heat Capacity: {0}
|
liquid.heatcapacity = [LIGHT_GRAY]Heat Capacity: {0}
|
||||||
liquid.viscosity = [LIGHT_GRAY]Viscosity: {0}
|
liquid.viscosity = [LIGHT_GRAY]Viscosity: {0}
|
||||||
liquid.temperature = [LIGHT_GRAY]Temperature: {0}
|
liquid.temperature = [LIGHT_GRAY]Temperature: {0}
|
||||||
|
@ -35,6 +35,7 @@ public class Mechs implements ContentList{
|
|||||||
mass = 1.2f;
|
mass = 1.2f;
|
||||||
speed = 0.5f;
|
speed = 0.5f;
|
||||||
boostSpeed = 0.85f;
|
boostSpeed = 0.85f;
|
||||||
|
buildPower = 1.2f;
|
||||||
engineColor = Color.valueOf("ffd37f");
|
engineColor = Color.valueOf("ffd37f");
|
||||||
health = 300f;
|
health = 300f;
|
||||||
|
|
||||||
@ -47,6 +48,11 @@ public class Mechs implements ContentList{
|
|||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateAlt(Player player){
|
||||||
|
player.healBy(Time.delta() * 0.4f);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean alwaysUnlocked(){
|
public boolean alwaysUnlocked(){
|
||||||
return true;
|
return true;
|
||||||
@ -63,6 +69,7 @@ public class Mechs implements ContentList{
|
|||||||
itemCapacity = 15;
|
itemCapacity = 15;
|
||||||
mass = 0.9f;
|
mass = 0.9f;
|
||||||
health = 250f;
|
health = 250f;
|
||||||
|
buildPower = 0.9f;
|
||||||
weaponOffsetX = -1;
|
weaponOffsetX = -1;
|
||||||
weaponOffsetY = -1;
|
weaponOffsetY = -1;
|
||||||
engineColor = Color.valueOf("d3ddff");
|
engineColor = Color.valueOf("d3ddff");
|
||||||
@ -110,6 +117,7 @@ public class Mechs implements ContentList{
|
|||||||
boostSpeed = 0.8f;
|
boostSpeed = 0.8f;
|
||||||
canHeal = true;
|
canHeal = true;
|
||||||
health = 200f;
|
health = 200f;
|
||||||
|
buildPower = 1.6f;
|
||||||
engineColor = Pal.heal;
|
engineColor = Pal.heal;
|
||||||
|
|
||||||
weapon = new Weapon("heal-blaster"){{
|
weapon = new Weapon("heal-blaster"){{
|
||||||
@ -161,6 +169,7 @@ public class Mechs implements ContentList{
|
|||||||
weaponOffsetY = 0;
|
weaponOffsetY = 0;
|
||||||
engineColor = Color.valueOf("feb380");
|
engineColor = Color.valueOf("feb380");
|
||||||
health = 300f;
|
health = 300f;
|
||||||
|
buildPower = 1.5f;
|
||||||
weapon = new Weapon("swarmer"){{
|
weapon = new Weapon("swarmer"){{
|
||||||
length = 1.5f;
|
length = 1.5f;
|
||||||
recoil = 4f;
|
recoil = 4f;
|
||||||
@ -227,6 +236,7 @@ public class Mechs implements ContentList{
|
|||||||
weaponOffsetY = -1;
|
weaponOffsetY = -1;
|
||||||
engineColor = Pal.lightTrail;
|
engineColor = Pal.lightTrail;
|
||||||
cellTrnsY = 1f;
|
cellTrnsY = 1f;
|
||||||
|
buildPower = 1.1f;
|
||||||
weapon = new Weapon("blaster"){{
|
weapon = new Weapon("blaster"){{
|
||||||
length = 1.5f;
|
length = 1.5f;
|
||||||
reload = 20f;
|
reload = 20f;
|
||||||
@ -315,6 +325,7 @@ public class Mechs implements ContentList{
|
|||||||
itemCapacity = 30;
|
itemCapacity = 30;
|
||||||
engineColor = Color.valueOf("84f491");
|
engineColor = Color.valueOf("84f491");
|
||||||
cellTrnsY = 1f;
|
cellTrnsY = 1f;
|
||||||
|
buildPower = 2f;
|
||||||
weapon = new Weapon("bomber"){{
|
weapon = new Weapon("bomber"){{
|
||||||
length = 0f;
|
length = 0f;
|
||||||
width = 2f;
|
width = 2f;
|
||||||
@ -346,6 +357,7 @@ public class Mechs implements ContentList{
|
|||||||
itemCapacity = 60;
|
itemCapacity = 60;
|
||||||
engineColor = Color.valueOf("feb380");
|
engineColor = Color.valueOf("feb380");
|
||||||
cellTrnsY = 1f;
|
cellTrnsY = 1f;
|
||||||
|
buildPower = 1.2f;
|
||||||
|
|
||||||
weapon = new Weapon("bomber"){{
|
weapon = new Weapon("bomber"){{
|
||||||
length = 1.5f;
|
length = 1.5f;
|
||||||
|
@ -8,6 +8,7 @@ import io.anuke.arc.graphics.GL20;
|
|||||||
import io.anuke.arc.graphics.g2d.Draw;
|
import io.anuke.arc.graphics.g2d.Draw;
|
||||||
import io.anuke.arc.graphics.g2d.TextureAtlas;
|
import io.anuke.arc.graphics.g2d.TextureAtlas;
|
||||||
import io.anuke.arc.input.KeyCode;
|
import io.anuke.arc.input.KeyCode;
|
||||||
|
import io.anuke.arc.scene.ui.TextField;
|
||||||
import io.anuke.arc.util.BufferUtils;
|
import io.anuke.arc.util.BufferUtils;
|
||||||
import io.anuke.arc.util.Interval;
|
import io.anuke.arc.util.Interval;
|
||||||
import io.anuke.arc.util.Strings;
|
import io.anuke.arc.util.Strings;
|
||||||
@ -301,6 +302,10 @@ public class Control implements ApplicationListener{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!mobile && Core.input.keyTap(Binding.screenshot) && !(scene.getKeyboardFocus() instanceof TextField) && !ui.chatfrag.chatOpen()){
|
||||||
|
renderer.takeMapScreenshot();
|
||||||
|
}
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
if(!state.isPaused()){
|
if(!state.isPaused()){
|
||||||
Time.update();
|
Time.update();
|
||||||
|
@ -2,10 +2,13 @@ package io.anuke.mindustry.core;
|
|||||||
|
|
||||||
import io.anuke.arc.ApplicationListener;
|
import io.anuke.arc.ApplicationListener;
|
||||||
import io.anuke.arc.Core;
|
import io.anuke.arc.Core;
|
||||||
|
import io.anuke.arc.files.FileHandle;
|
||||||
import io.anuke.arc.function.Consumer;
|
import io.anuke.arc.function.Consumer;
|
||||||
import io.anuke.arc.function.Predicate;
|
import io.anuke.arc.function.Predicate;
|
||||||
import io.anuke.arc.graphics.Camera;
|
import io.anuke.arc.graphics.Camera;
|
||||||
import io.anuke.arc.graphics.Color;
|
import io.anuke.arc.graphics.Color;
|
||||||
|
import io.anuke.arc.graphics.Pixmap;
|
||||||
|
import io.anuke.arc.graphics.PixmapIO;
|
||||||
import io.anuke.arc.graphics.g2d.Draw;
|
import io.anuke.arc.graphics.g2d.Draw;
|
||||||
import io.anuke.arc.graphics.g2d.Lines;
|
import io.anuke.arc.graphics.g2d.Lines;
|
||||||
import io.anuke.arc.graphics.g2d.SpriteBatch;
|
import io.anuke.arc.graphics.g2d.SpriteBatch;
|
||||||
@ -13,6 +16,8 @@ import io.anuke.arc.graphics.glutils.FrameBuffer;
|
|||||||
import io.anuke.arc.math.Mathf;
|
import io.anuke.arc.math.Mathf;
|
||||||
import io.anuke.arc.math.geom.Rectangle;
|
import io.anuke.arc.math.geom.Rectangle;
|
||||||
import io.anuke.arc.math.geom.Vector2;
|
import io.anuke.arc.math.geom.Vector2;
|
||||||
|
import io.anuke.arc.util.BufferUtils;
|
||||||
|
import io.anuke.arc.util.ScreenUtils;
|
||||||
import io.anuke.arc.util.Time;
|
import io.anuke.arc.util.Time;
|
||||||
import io.anuke.arc.util.Tmp;
|
import io.anuke.arc.util.Tmp;
|
||||||
import io.anuke.arc.util.pooling.Pools;
|
import io.anuke.arc.util.pooling.Pools;
|
||||||
@ -296,10 +301,6 @@ public class Renderer implements ApplicationListener{
|
|||||||
EntityDraw.drawWith(group, toDraw, drawer);
|
EntityDraw.drawWith(group, toDraw, drawer);
|
||||||
}
|
}
|
||||||
|
|
||||||
public float cameraScale(){
|
|
||||||
return camerascale;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void scaleCamera(float amount){
|
public void scaleCamera(float amount){
|
||||||
targetscale += amount;
|
targetscale += amount;
|
||||||
clampScale();
|
clampScale();
|
||||||
@ -310,4 +311,47 @@ public class Renderer implements ApplicationListener{
|
|||||||
targetscale = Mathf.clamp(targetscale, s * 1.5f, Math.round(s * 6));
|
targetscale = Mathf.clamp(targetscale, s * 1.5f, Math.round(s * 6));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void takeMapScreenshot(){
|
||||||
|
drawGroundShadows();
|
||||||
|
|
||||||
|
int w = world.width()*tilesize, h = world.height()*tilesize;
|
||||||
|
|
||||||
|
boolean isWater = settings.getBool("animatedwater");
|
||||||
|
settings.put("animatedwater", false);
|
||||||
|
|
||||||
|
FrameBuffer buffer = new FrameBuffer(w, h);
|
||||||
|
|
||||||
|
float vpW = camera.width, vpH = camera.height, px = camera.position.x, py = camera.position.y;
|
||||||
|
disableUI = true;
|
||||||
|
camera.width = w;
|
||||||
|
camera.height = h;
|
||||||
|
camera.position.x = w/2f + tilesize/2f;
|
||||||
|
camera.position.y = h/2f + tilesize/2f;
|
||||||
|
Draw.flush();
|
||||||
|
buffer.begin();
|
||||||
|
draw();
|
||||||
|
Draw.flush();
|
||||||
|
buffer.end();
|
||||||
|
disableUI = false;
|
||||||
|
camera.width = vpW;
|
||||||
|
camera.height = vpH;
|
||||||
|
camera.position.set(px, py);
|
||||||
|
buffer.begin();
|
||||||
|
byte[] lines = ScreenUtils.getFrameBufferPixels(0, 0, w, h, true);
|
||||||
|
for(int i = 0; i < lines.length; i+= 4){
|
||||||
|
lines[i + 3] = (byte)255;
|
||||||
|
}
|
||||||
|
buffer.end();
|
||||||
|
Pixmap fullPixmap = new Pixmap(w, h, Pixmap.Format.RGBA8888);
|
||||||
|
BufferUtils.copy(lines, 0, fullPixmap.getPixels(), lines.length);
|
||||||
|
FileHandle file = screenshotDirectory.child("screenshot-" + Time.millis() + ".png");
|
||||||
|
PixmapIO.writePNG(file, fullPixmap);
|
||||||
|
fullPixmap.dispose();
|
||||||
|
ui.showInfoFade(Core.bundle.format("screenshot", file.toString()));
|
||||||
|
|
||||||
|
buffer.dispose();
|
||||||
|
|
||||||
|
settings.put("animatedwater", isWater);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,7 @@ public enum Binding implements KeyBind{
|
|||||||
menu(Core.app.getType() == ApplicationType.Android ? KeyCode.BACK : KeyCode.ESCAPE),
|
menu(Core.app.getType() == ApplicationType.Android ? KeyCode.BACK : KeyCode.ESCAPE),
|
||||||
pause(KeyCode.SPACE),
|
pause(KeyCode.SPACE),
|
||||||
toggle_menus(KeyCode.C),
|
toggle_menus(KeyCode.C),
|
||||||
|
screenshot(KeyCode.P),
|
||||||
player_list(KeyCode.TAB, "multiplayer"),
|
player_list(KeyCode.TAB, "multiplayer"),
|
||||||
chat(KeyCode.ENTER),
|
chat(KeyCode.ENTER),
|
||||||
chat_history_prev(KeyCode.UP),
|
chat_history_prev(KeyCode.UP),
|
||||||
|
@ -134,6 +134,7 @@ public class ContentDisplay{
|
|||||||
title.addImage(mech.getContentIcon()).size(8 * 6);
|
title.addImage(mech.getContentIcon()).size(8 * 6);
|
||||||
title.add("[accent]" + mech.localizedName()).padLeft(5);
|
title.add("[accent]" + mech.localizedName()).padLeft(5);
|
||||||
});
|
});
|
||||||
|
table.left().defaults().left();
|
||||||
|
|
||||||
table.row();
|
table.row();
|
||||||
|
|
||||||
@ -159,13 +160,17 @@ public class ContentDisplay{
|
|||||||
table.add(Core.bundle.format("mech.ability", Core.bundle.get("mech." + mech.name + ".ability")));
|
table.add(Core.bundle.format("mech.ability", Core.bundle.get("mech." + mech.name + ".ability")));
|
||||||
table.row();
|
table.row();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
table.add(Core.bundle.format("mech.buildspeed", (int)(mech.buildPower * 100f)));
|
||||||
|
table.row();
|
||||||
|
|
||||||
table.add(Core.bundle.format("mech.health", (int)mech.health));
|
table.add(Core.bundle.format("mech.health", (int)mech.health));
|
||||||
table.row();
|
table.row();
|
||||||
table.add(Core.bundle.format("mech.itemcapacity", mech.itemCapacity));
|
table.add(Core.bundle.format("mech.itemcapacity", mech.itemCapacity));
|
||||||
table.row();
|
table.row();
|
||||||
|
|
||||||
if(mech.drillPower > 0){
|
if(mech.drillPower > 0){
|
||||||
table.add(Core.bundle.format("mech.minespeed", (int) (mech.mineSpeed * 10)));
|
table.add(Core.bundle.format("mech.minespeed", (int)(mech.mineSpeed * 100f)));
|
||||||
table.row();
|
table.row();
|
||||||
table.add(Core.bundle.format("mech.minepower", mech.drillPower));
|
table.add(Core.bundle.format("mech.minepower", mech.drillPower));
|
||||||
table.row();
|
table.row();
|
||||||
|
@ -163,7 +163,7 @@ public class Block extends BlockStorage{
|
|||||||
if(tile == null || tile.entity == null || tile.entity.power == null) return out;
|
if(tile == null || tile.entity == null || tile.entity.power == null) return out;
|
||||||
|
|
||||||
for(Tile other : tile.entity.proximity()){
|
for(Tile other : tile.entity.proximity()){
|
||||||
if(other.entity.power != null && !(consumesPower && other.block().consumesPower && !outputsPower && !other.block().outputsPower)
|
if(other != null && other.entity != null && other.entity.power != null && !(consumesPower && other.block().consumesPower && !outputsPower && !other.block().outputsPower)
|
||||||
&& !tile.entity.power.links.contains(other.pos())){
|
&& !tile.entity.power.links.contains(other.pos())){
|
||||||
out.add(other);
|
out.add(other);
|
||||||
}
|
}
|
||||||
|
@ -1,16 +1,13 @@
|
|||||||
import static io.anuke.mindustry.Vars.logic;
|
|
||||||
import static io.anuke.mindustry.Vars.state;
|
|
||||||
import static io.anuke.mindustry.Vars.world;
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
|
||||||
|
|
||||||
import org.junit.jupiter.api.BeforeAll;
|
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
|
|
||||||
import io.anuke.arc.util.Time;
|
import io.anuke.arc.util.Time;
|
||||||
import io.anuke.mindustry.content.Blocks;
|
import io.anuke.mindustry.content.Blocks;
|
||||||
import io.anuke.mindustry.core.GameState.State;
|
import io.anuke.mindustry.core.GameState.State;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import static io.anuke.mindustry.Vars.*;
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
|
||||||
public class WorldTests {
|
public class WorldTests {
|
||||||
static Tile[][] tiles;
|
static Tile[][] tiles;
|
||||||
@ -30,7 +27,7 @@ public class WorldTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void addDarkness_allSolid_maxDarkness(){
|
void addDarknessAllSolidMaxDarkness(){
|
||||||
fillWith(Blocks.rocks.id);
|
fillWith(Blocks.rocks.id);
|
||||||
world.addDarkness(tiles);
|
world.addDarkness(tiles);
|
||||||
|
|
||||||
@ -42,7 +39,7 @@ public class WorldTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void addDarkness_allSyntethic_noDarkness(){
|
void addDarknessAllSyntethicNoDarkness(){
|
||||||
fillWith(Blocks.copperWall.id);
|
fillWith(Blocks.copperWall.id);
|
||||||
world.addDarkness(tiles);
|
world.addDarkness(tiles);
|
||||||
|
|
||||||
@ -54,7 +51,7 @@ public class WorldTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void addDarkness_allNotSolid_noDarkness(){
|
void addDarknessAllNotSolidNoDarkness(){
|
||||||
fillWith(Blocks.air.id);
|
fillWith(Blocks.air.id);
|
||||||
world.addDarkness(tiles);
|
world.addDarkness(tiles);
|
||||||
|
|
||||||
@ -66,7 +63,7 @@ public class WorldTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void addDarkness_allNotFilled_noDarkness(){
|
void addDarknessAllNotFilledNoDarkness(){
|
||||||
fillWith(Blocks.cliffs.id);
|
fillWith(Blocks.cliffs.id);
|
||||||
world.addDarkness(tiles);
|
world.addDarkness(tiles);
|
||||||
|
|
||||||
@ -78,7 +75,7 @@ public class WorldTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void addDarkness_oneNotSolidMiddle_noDarkness(){
|
void addDarknessOneNotSolidMiddleNoDarkness(){
|
||||||
fillWith(Blocks.rocks.id);
|
fillWith(Blocks.rocks.id);
|
||||||
tiles[5][5] = new Tile(5, 5, (byte)0, Blocks.copperWall.id, (byte)0, (byte)0);
|
tiles[5][5] = new Tile(5, 5, (byte)0, Blocks.copperWall.id, (byte)0, (byte)0);
|
||||||
world.addDarkness(tiles);
|
world.addDarkness(tiles);
|
||||||
@ -93,7 +90,7 @@ public class WorldTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void addDarkness_oneNotSolidCorner_noDarkness(){
|
void addDarknessOneNotSolidCornerNoDarkness(){
|
||||||
fillWith(Blocks.rocks.id);
|
fillWith(Blocks.rocks.id);
|
||||||
tiles[7][7] = new Tile(5, 5, (byte)0, Blocks.copperWall.id, (byte)0, (byte)0);
|
tiles[7][7] = new Tile(5, 5, (byte)0, Blocks.copperWall.id, (byte)0, (byte)0);
|
||||||
world.addDarkness(tiles);
|
world.addDarkness(tiles);
|
||||||
|
Loading…
Reference in New Issue
Block a user