From a7f86b2ba68b4cb2e67bdb4944154176bab18964 Mon Sep 17 00:00:00 2001 From: Anuken Date: Thu, 28 May 2020 21:13:25 -0400 Subject: [PATCH] Cleanup --- core/src/mindustry/Vars.java | 8 +++----- core/src/mindustry/content/TechTree.java | 8 ++++++-- core/src/mindustry/content/Weathers.java | 2 +- core/src/mindustry/core/Renderer.java | 1 - core/src/mindustry/editor/MapEditorDialog.java | 4 ++-- core/src/mindustry/entities/Lightning.java | 1 - core/src/mindustry/entities/Units.java | 1 - core/src/mindustry/io/JsonIO.java | 3 ++- core/src/mindustry/world/Tile.java | 4 ++-- core/src/mindustry/world/blocks/power/PowerGraph.java | 3 +-- .../mindustry/world/blocks/production/ResearchBlock.java | 1 + tools/src/mindustry/tools/Generators.java | 2 +- 12 files changed, 19 insertions(+), 19 deletions(-) diff --git a/core/src/mindustry/Vars.java b/core/src/mindustry/Vars.java index 56f1bb9f35..959b0bc390 100644 --- a/core/src/mindustry/Vars.java +++ b/core/src/mindustry/Vars.java @@ -71,12 +71,10 @@ public class Vars implements Loadable{ public static final int maxTextLength = 150; /** max player name length in bytes */ public static final int maxNameLength = 40; - /** displayed item size when ingame, TODO remove. */ + /** displayed item size when ingame. */ public static final float itemSize = 5f; - /** extra padding around the world; units outside this bound will begin to self-destruct. */ - public static final float worldBounds = 100f; - /** units outside of this bound will simply die instantly */ - public static final float finalWorldBounds = worldBounds + 500; + /** units outside of this bound will die instantly */ + public static final float finalWorldBounds = 500; /** mining range for manual miners */ public static final float miningRange = 70f; /** range for building */ diff --git a/core/src/mindustry/content/TechTree.java b/core/src/mindustry/content/TechTree.java index 314c8b0666..0cb848f6c8 100644 --- a/core/src/mindustry/content/TechTree.java +++ b/core/src/mindustry/content/TechTree.java @@ -2,6 +2,7 @@ package mindustry.content; import arc.math.*; import arc.struct.*; +import arc.util.ArcAnnotate.*; import mindustry.ctype.*; import mindustry.game.Objectives.*; import mindustry.type.*; @@ -314,15 +315,17 @@ public class TechTree implements ContentList{ public static class TechNode{ private static TechNode context; + /** Depth in tech tree. */ + public int depth; /** Requirement node. */ - public TechNode parent; + public @Nullable TechNode parent; /** Content to be researched. */ public UnlockableContent content; /** Item requirements for this content. */ public ItemStack[] requirements; /** Extra objectives needed to research this. TODO implement */ 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 /** Nodes that depend on this node. */ public final Array children = new Array<>(); @@ -335,6 +338,7 @@ public class TechTree implements ContentList{ this.parent = ccontext; this.content = content; this.requirements = requirements; + this.depth = parent == null ? 0 : parent.depth + 1; context = this; children.run(); diff --git a/core/src/mindustry/content/Weathers.java b/core/src/mindustry/content/Weathers.java index d0b2a137d8..2fc40aa169 100644 --- a/core/src/mindustry/content/Weathers.java +++ b/core/src/mindustry/content/Weathers.java @@ -62,7 +62,7 @@ public class Weathers implements ContentList{ }; 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]; @Override diff --git a/core/src/mindustry/core/Renderer.java b/core/src/mindustry/core/Renderer.java index 501e72789f..e91ae289d4 100644 --- a/core/src/mindustry/core/Renderer.java +++ b/core/src/mindustry/core/Renderer.java @@ -186,7 +186,6 @@ public class Renderer implements ApplicationListener{ graphics.clear(clearColor); Draw.reset(); - //TODO 'animated water' is a bad name for this setting if(Core.settings.getBool("animatedwater") || Core.settings.getBool("animatedshields")){ effectBuffer.resize(graphics.getWidth(), graphics.getHeight()); } diff --git a/core/src/mindustry/editor/MapEditorDialog.java b/core/src/mindustry/editor/MapEditorDialog.java index e7c42c4553..96792a7cc2 100644 --- a/core/src/mindustry/editor/MapEditorDialog.java +++ b/core/src/mindustry/editor/MapEditorDialog.java @@ -272,8 +272,8 @@ public class MapEditorDialog extends Dialog implements Disposable{ editor.getTags().put("rules", JsonIO.write(state.rules)); editor.getTags().remove("width"); editor.getTags().remove("height"); - //TODO unkill player - //player.dead = true; + + player.clearUnit(); Map returned = null; diff --git a/core/src/mindustry/entities/Lightning.java b/core/src/mindustry/entities/Lightning.java index 9422f1008d..c0cd8aab85 100644 --- a/core/src/mindustry/entities/Lightning.java +++ b/core/src/mindustry/entities/Lightning.java @@ -11,7 +11,6 @@ import mindustry.world.*; import static mindustry.Vars.*; -//TODO move into a different class public class Lightning{ private static final Rand random = new Rand(); private static final Rect rect = new Rect(); diff --git a/core/src/mindustry/entities/Units.java b/core/src/mindustry/entities/Units.java index 14b2638006..e6c4559b0e 100644 --- a/core/src/mindustry/entities/Units.java +++ b/core/src/mindustry/entities/Units.java @@ -149,7 +149,6 @@ public class Units{ result = null; cdist = 0f; - //TODO optimize for(Unitc e : Groups.unit){ if(!predicate.get(e) || e.team() != team) continue; diff --git a/core/src/mindustry/io/JsonIO.java b/core/src/mindustry/io/JsonIO.java index 095637536d..6b44f56cdb 100644 --- a/core/src/mindustry/io/JsonIO.java +++ b/core/src/mindustry/io/JsonIO.java @@ -129,7 +129,8 @@ public class JsonIO{ @Override 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; } }); diff --git a/core/src/mindustry/world/Tile.java b/core/src/mindustry/world/Tile.java index 6afddc9ae3..b773ff5e98 100644 --- a/core/src/mindustry/world/Tile.java +++ b/core/src/mindustry/world/Tile.java @@ -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. */ public Array getLinkedTiles(Array 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. */ public Array getLinkedTilesAs(Block block, Array tmpArray){ diff --git a/core/src/mindustry/world/blocks/power/PowerGraph.java b/core/src/mindustry/world/blocks/power/PowerGraph.java index fa7fbe585e..da360d9343 100644 --- a/core/src/mindustry/world/blocks/power/PowerGraph.java +++ b/core/src/mindustry/world/blocks/power/PowerGraph.java @@ -56,8 +56,7 @@ public class PowerGraph{ /** @return multiplier of speed at which resources should be consumed for power generation. */ public float getUsageFraction(){ - //TODO enable it later, or not? - return 1f; //lastUsageFraction; + return 1f; } public float getPowerProduced(){ diff --git a/core/src/mindustry/world/blocks/production/ResearchBlock.java b/core/src/mindustry/world/blocks/production/ResearchBlock.java index 1d674dfe0a..ec3de2fef1 100644 --- a/core/src/mindustry/world/blocks/production/ResearchBlock.java +++ b/core/src/mindustry/world/blocks/production/ResearchBlock.java @@ -9,6 +9,7 @@ import mindustry.gen.*; import mindustry.world.*; public class ResearchBlock extends Block{ + public float researchSpeed = 1f; public ResearchBlock(String name){ super(name); diff --git a/tools/src/mindustry/tools/Generators.java b/tools/src/mindustry/tools/Generators.java index 0ca371c8a5..bae4cc82fb 100644 --- a/tools/src/mindustry/tools/Generators.java +++ b/tools/src/mindustry/tools/Generators.java @@ -32,7 +32,7 @@ public class Generators{ for(int i = 0; i < frames; i++){ float fin = (float)i / (frames); float fout = 1f - fin; - float stroke = 4f * fout; + float stroke = 3.5f * fout; float radius = (size/2f) * fin; Pixmap pixmap = new Pixmap(size, size);