Cleanup
This commit is contained in:
@@ -71,12 +71,10 @@ public class Vars implements Loadable{
|
|||||||
public static final int maxTextLength = 150;
|
public static final int maxTextLength = 150;
|
||||||
/** max player name length in bytes */
|
/** max player name length in bytes */
|
||||||
public static final int maxNameLength = 40;
|
public static final int maxNameLength = 40;
|
||||||
/** displayed item size when ingame, TODO remove. */
|
/** displayed item size when ingame. */
|
||||||
public static final float itemSize = 5f;
|
public static final float itemSize = 5f;
|
||||||
/** extra padding around the world; units outside this bound will begin to self-destruct. */
|
/** units outside of this bound will die instantly */
|
||||||
public static final float worldBounds = 100f;
|
public static final float finalWorldBounds = 500;
|
||||||
/** units outside of this bound will simply die instantly */
|
|
||||||
public static final float finalWorldBounds = worldBounds + 500;
|
|
||||||
/** mining range for manual miners */
|
/** mining range for manual miners */
|
||||||
public static final float miningRange = 70f;
|
public static final float miningRange = 70f;
|
||||||
/** range for building */
|
/** range for building */
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package mindustry.content;
|
|||||||
|
|
||||||
import arc.math.*;
|
import arc.math.*;
|
||||||
import arc.struct.*;
|
import arc.struct.*;
|
||||||
|
import arc.util.ArcAnnotate.*;
|
||||||
import mindustry.ctype.*;
|
import mindustry.ctype.*;
|
||||||
import mindustry.game.Objectives.*;
|
import mindustry.game.Objectives.*;
|
||||||
import mindustry.type.*;
|
import mindustry.type.*;
|
||||||
@@ -314,15 +315,17 @@ public class TechTree implements ContentList{
|
|||||||
public static class TechNode{
|
public static class TechNode{
|
||||||
private static TechNode context;
|
private static TechNode context;
|
||||||
|
|
||||||
|
/** Depth in tech tree. */
|
||||||
|
public int depth;
|
||||||
/** Requirement node. */
|
/** Requirement node. */
|
||||||
public TechNode parent;
|
public @Nullable TechNode parent;
|
||||||
/** Content to be researched. */
|
/** Content to be researched. */
|
||||||
public UnlockableContent content;
|
public UnlockableContent content;
|
||||||
/** Item requirements for this content. */
|
/** Item requirements for this content. */
|
||||||
public ItemStack[] requirements;
|
public ItemStack[] requirements;
|
||||||
/** Extra objectives needed to research this. TODO implement */
|
/** Extra objectives needed to research this. TODO implement */
|
||||||
public Objective[] objectives = {};
|
public Objective[] objectives = {};
|
||||||
/** Turns required to research this content. */
|
/** Research turns required to research this content. */
|
||||||
public int turns = 3; //TODO keep track of turns that have been used so far
|
public int turns = 3; //TODO keep track of turns that have been used so far
|
||||||
/** Nodes that depend on this node. */
|
/** Nodes that depend on this node. */
|
||||||
public final Array<TechNode> children = new Array<>();
|
public final Array<TechNode> children = new Array<>();
|
||||||
@@ -335,6 +338,7 @@ public class TechTree implements ContentList{
|
|||||||
this.parent = ccontext;
|
this.parent = ccontext;
|
||||||
this.content = content;
|
this.content = content;
|
||||||
this.requirements = requirements;
|
this.requirements = requirements;
|
||||||
|
this.depth = parent == null ? 0 : parent.depth + 1;
|
||||||
|
|
||||||
context = this;
|
context = this;
|
||||||
children.run();
|
children.run();
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ public class Weathers implements ContentList{
|
|||||||
};
|
};
|
||||||
|
|
||||||
rain = new Weather("rain"){
|
rain = new Weather("rain"){
|
||||||
float yspeed = 7f, xspeed = 2f, padding = 16f, size = 40f, density = 1200f;
|
float yspeed = 5f, xspeed = 1.5f, padding = 16f, size = 40f, density = 1200f;
|
||||||
TextureRegion[] splashes = new TextureRegion[12];
|
TextureRegion[] splashes = new TextureRegion[12];
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -186,7 +186,6 @@ public class Renderer implements ApplicationListener{
|
|||||||
graphics.clear(clearColor);
|
graphics.clear(clearColor);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
|
|
||||||
//TODO 'animated water' is a bad name for this setting
|
|
||||||
if(Core.settings.getBool("animatedwater") || Core.settings.getBool("animatedshields")){
|
if(Core.settings.getBool("animatedwater") || Core.settings.getBool("animatedshields")){
|
||||||
effectBuffer.resize(graphics.getWidth(), graphics.getHeight());
|
effectBuffer.resize(graphics.getWidth(), graphics.getHeight());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -272,8 +272,8 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
|||||||
editor.getTags().put("rules", JsonIO.write(state.rules));
|
editor.getTags().put("rules", JsonIO.write(state.rules));
|
||||||
editor.getTags().remove("width");
|
editor.getTags().remove("width");
|
||||||
editor.getTags().remove("height");
|
editor.getTags().remove("height");
|
||||||
//TODO unkill player
|
|
||||||
//player.dead = true;
|
player.clearUnit();
|
||||||
|
|
||||||
Map returned = null;
|
Map returned = null;
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import mindustry.world.*;
|
|||||||
|
|
||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
//TODO move into a different class
|
|
||||||
public class Lightning{
|
public class Lightning{
|
||||||
private static final Rand random = new Rand();
|
private static final Rand random = new Rand();
|
||||||
private static final Rect rect = new Rect();
|
private static final Rect rect = new Rect();
|
||||||
|
|||||||
@@ -149,7 +149,6 @@ public class Units{
|
|||||||
result = null;
|
result = null;
|
||||||
cdist = 0f;
|
cdist = 0f;
|
||||||
|
|
||||||
//TODO optimize
|
|
||||||
for(Unitc e : Groups.unit){
|
for(Unitc e : Groups.unit){
|
||||||
if(!predicate.get(e) || e.team() != team) continue;
|
if(!predicate.get(e) || e.team() != team) continue;
|
||||||
|
|
||||||
|
|||||||
@@ -129,7 +129,8 @@ public class JsonIO{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Block read(Json json, JsonValue jsonData, Class type){
|
public Block read(Json json, JsonValue jsonData, Class type){
|
||||||
return Vars.content.getByName(ContentType.block, jsonData.asString());
|
Block block = Vars.content.getByName(ContentType.block, jsonData.asString());
|
||||||
|
return block == null ? Blocks.air : block;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -364,7 +364,7 @@ public class Tile implements Position, QuadTreeObject{
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the list of all tiles linked to this multiblock, or an empty array if it's not a multiblock.
|
* Returns the list of all tiles linked to this multiblock.
|
||||||
* This array contains all linked tiles, including this tile itself.
|
* This array contains all linked tiles, including this tile itself.
|
||||||
*/
|
*/
|
||||||
public Array<Tile> getLinkedTiles(Array<Tile> tmpArray){
|
public Array<Tile> getLinkedTiles(Array<Tile> tmpArray){
|
||||||
@@ -374,7 +374,7 @@ public class Tile implements Position, QuadTreeObject{
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the list of all tiles linked to this multiblock if it were this block, or an empty array if it's not a multiblock.
|
* Returns the list of all tiles linked to this multiblock if it were this block.
|
||||||
* This array contains all linked tiles, including this tile itself.
|
* This array contains all linked tiles, including this tile itself.
|
||||||
*/
|
*/
|
||||||
public Array<Tile> getLinkedTilesAs(Block block, Array<Tile> tmpArray){
|
public Array<Tile> getLinkedTilesAs(Block block, Array<Tile> tmpArray){
|
||||||
|
|||||||
@@ -56,8 +56,7 @@ public class PowerGraph{
|
|||||||
|
|
||||||
/** @return multiplier of speed at which resources should be consumed for power generation. */
|
/** @return multiplier of speed at which resources should be consumed for power generation. */
|
||||||
public float getUsageFraction(){
|
public float getUsageFraction(){
|
||||||
//TODO enable it later, or not?
|
return 1f;
|
||||||
return 1f; //lastUsageFraction;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getPowerProduced(){
|
public float getPowerProduced(){
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import mindustry.gen.*;
|
|||||||
import mindustry.world.*;
|
import mindustry.world.*;
|
||||||
|
|
||||||
public class ResearchBlock extends Block{
|
public class ResearchBlock extends Block{
|
||||||
|
public float researchSpeed = 1f;
|
||||||
|
|
||||||
public ResearchBlock(String name){
|
public ResearchBlock(String name){
|
||||||
super(name);
|
super(name);
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ public class Generators{
|
|||||||
for(int i = 0; i < frames; i++){
|
for(int i = 0; i < frames; i++){
|
||||||
float fin = (float)i / (frames);
|
float fin = (float)i / (frames);
|
||||||
float fout = 1f - fin;
|
float fout = 1f - fin;
|
||||||
float stroke = 4f * fout;
|
float stroke = 3.5f * fout;
|
||||||
float radius = (size/2f) * fin;
|
float radius = (size/2f) * fin;
|
||||||
|
|
||||||
Pixmap pixmap = new Pixmap(size, size);
|
Pixmap pixmap = new Pixmap(size, size);
|
||||||
|
|||||||
Reference in New Issue
Block a user