mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-02 20:33:50 +07:00
Many bugfixes and tweaks
This commit is contained in:
parent
dbb6673752
commit
aafe7fb74a
@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="io.anuke.mindustry"
|
package="io.anuke.mindustry"
|
||||||
android:versionCode="15"
|
android:versionCode="16"
|
||||||
android:versionName="2.4" >
|
android:versionName="3.0b" >
|
||||||
|
|
||||||
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="25" />
|
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="25" />
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ public class AndroidLauncher extends AndroidApplication {
|
|||||||
Unit.dp.multiplier = 1f;
|
Unit.dp.multiplier = 1f;
|
||||||
}
|
}
|
||||||
|
|
||||||
Mindustry.args.add("-debug");
|
//Mindustry.args.add("-debug");
|
||||||
|
|
||||||
initialize(new Mindustry(), config);
|
initialize(new Mindustry(), config);
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ project(":core") {
|
|||||||
apply plugin: "java"
|
apply plugin: "java"
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
// compile 'com.github.Anuken:ucore:61c43bf'
|
compile 'com.github.Anuken:ucore:92dc170f0e'
|
||||||
compile "com.badlogicgames.gdx:gdx:$gdxVersion"
|
compile "com.badlogicgames.gdx:gdx:$gdxVersion"
|
||||||
compile "com.badlogicgames.gdx:gdx-ai:1.8.1"
|
compile "com.badlogicgames.gdx:gdx-ai:1.8.1"
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
@ -5,6 +5,7 @@ precision mediump int;
|
|||||||
|
|
||||||
#define MAX_HITS 64
|
#define MAX_HITS 64
|
||||||
#define HIT_RADIUS 12.0
|
#define HIT_RADIUS 12.0
|
||||||
|
#define ALPHA 0.18
|
||||||
|
|
||||||
uniform sampler2D u_texture;
|
uniform sampler2D u_texture;
|
||||||
|
|
||||||
@ -53,7 +54,7 @@ void main() {
|
|||||||
color *= 1.65;
|
color *= 1.65;
|
||||||
}
|
}
|
||||||
|
|
||||||
color.a = 0.18;
|
color.a = ALPHA;
|
||||||
|
|
||||||
for(int i = 0; i < u_hitamount; i ++){
|
for(int i = 0; i < u_hitamount; i ++){
|
||||||
vec3 hit = u_hits[i];
|
vec3 hit = u_hits[i];
|
||||||
@ -62,7 +63,7 @@ void main() {
|
|||||||
|
|
||||||
if(abs(distance(vec2(hit.x, hit.y), coords - u_texsize/2.0) - rad) < 1.0){
|
if(abs(distance(vec2(hit.x, hit.y), coords - u_texsize/2.0) - rad) < 1.0){
|
||||||
color = mix(color, u_color* vec4(si, si, si, 1.0), (1.0 * fract));
|
color = mix(color, u_color* vec4(si, si, si, 1.0), (1.0 * fract));
|
||||||
color.a = 0.18 + 0.82 *fract;
|
color.a = ALPHA + 0.82 *fract;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ public class Vars{
|
|||||||
//whether to draw chunk borders
|
//whether to draw chunk borders
|
||||||
public static boolean debugChunks = false;
|
public static boolean debugChunks = false;
|
||||||
//whether turrets have infinite ammo (only with debug)
|
//whether turrets have infinite ammo (only with debug)
|
||||||
public static boolean infiniteAmmo = true;
|
public static boolean infiniteAmmo = false;
|
||||||
//whether to show paths of enemies
|
//whether to show paths of enemies
|
||||||
public static boolean showPaths = true;
|
public static boolean showPaths = true;
|
||||||
//number of save slots-- increasing may lead to layout issues
|
//number of save slots-- increasing may lead to layout issues
|
||||||
|
@ -115,7 +115,7 @@ public class Control extends Module{
|
|||||||
player = new Player();
|
player = new Player();
|
||||||
|
|
||||||
spawns = WaveCreator.getSpawns();
|
spawns = WaveCreator.getSpawns();
|
||||||
WaveCreator.testWaves(1, 30);
|
//WaveCreator.testWaves(1, 30);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void reset(){
|
public void reset(){
|
||||||
|
@ -62,7 +62,7 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
emp = new BulletType(1.6f, 6){
|
emp = new BulletType(1.6f, 8){
|
||||||
{
|
{
|
||||||
lifetime = 50f;
|
lifetime = 50f;
|
||||||
hitsize = 6f;
|
hitsize = 6f;
|
||||||
@ -89,7 +89,7 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
|
|||||||
|
|
||||||
public void removed(Bullet b){
|
public void removed(Bullet b){
|
||||||
Timers.run(5f, ()->{
|
Timers.run(5f, ()->{
|
||||||
new EMP(b.x, b.y, b.damage).add();
|
new EMP(b.x, b.y, b.getDamage()).add();
|
||||||
});
|
});
|
||||||
Effects.effect(Fx.empshockwave, b);
|
Effects.effect(Fx.empshockwave, b);
|
||||||
Effects.shake(3f, 3f, b);
|
Effects.shake(3f, 3f, b);
|
||||||
@ -132,7 +132,7 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
|
|||||||
DamageArea.damage(!(b.owner instanceof Enemy), b.x, b.y, 25f, (int)(damage * 2f/3f));
|
DamageArea.damage(!(b.owner instanceof Enemy), b.x, b.y, 25f, (int)(damage * 2f/3f));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
titanshell = new BulletType(1.8f, 40){
|
titanshell = new BulletType(1.8f, 38){
|
||||||
{
|
{
|
||||||
lifetime = 70f;
|
lifetime = 70f;
|
||||||
hitsize = 15f;
|
hitsize = 15f;
|
||||||
@ -160,7 +160,7 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
|
|||||||
Effects.effect(Fx.shellsmoke, b);
|
Effects.effect(Fx.shellsmoke, b);
|
||||||
Effects.effect(Fx.shockwaveSmall, b);
|
Effects.effect(Fx.shockwaveSmall, b);
|
||||||
|
|
||||||
DamageArea.damage(!(b.owner instanceof Enemy), b.x, b.y, 25f, (int)(damage * 2f/3f));
|
DamageArea.damage(!(b.owner instanceof Enemy), b.x, b.y, 50f, (int)(damage * 2f/3f));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
yellowshell = new BulletType(1.2f, 20){
|
yellowshell = new BulletType(1.2f, 20){
|
||||||
|
@ -91,7 +91,7 @@ public class WaveCreator{
|
|||||||
//boss wave
|
//boss wave
|
||||||
new EnemySpawn(FortressEnemy.class){{
|
new EnemySpawn(FortressEnemy.class){{
|
||||||
after = 16;
|
after = 16;
|
||||||
amount = 2;
|
amount = 1;
|
||||||
spacing = 5;
|
spacing = 5;
|
||||||
scaling = 1;
|
scaling = 1;
|
||||||
}},
|
}},
|
||||||
@ -149,8 +149,8 @@ public class WaveCreator{
|
|||||||
}},
|
}},
|
||||||
new EnemySpawn(FortressEnemy.class){{
|
new EnemySpawn(FortressEnemy.class){{
|
||||||
after = 12;
|
after = 12;
|
||||||
spacing = 3;
|
spacing = 4;
|
||||||
scaling = 5;
|
scaling = 6;
|
||||||
}},
|
}},
|
||||||
new EnemySpawn(HealerEnemy.class){{
|
new EnemySpawn(HealerEnemy.class){{
|
||||||
scaling = 3;
|
scaling = 3;
|
||||||
|
@ -50,14 +50,15 @@ public class EMP extends TimedEntity{
|
|||||||
Tile tile = array.get(i);
|
Tile tile = array.get(i);
|
||||||
targets.add(tile);
|
targets.add(tile);
|
||||||
|
|
||||||
if(tile.block() instanceof PowerAcceptor){
|
if(tile != null && tile.block() instanceof PowerAcceptor){
|
||||||
PowerAcceptor p = (PowerAcceptor)tile.block();
|
PowerAcceptor p = (PowerAcceptor)tile.block();
|
||||||
tile.entity.damage(damage*2); //extra damage
|
|
||||||
p.setPower(tile, 0f);
|
p.setPower(tile, 0f);
|
||||||
|
tile.entity.damage(damage*2); //extra damage
|
||||||
}
|
}
|
||||||
|
|
||||||
Effects.effect(Fx.empspark, tile.entity);
|
//entity may be null here, after the block is dead!
|
||||||
tile.entity.damage(damage);
|
Effects.effect(Fx.empspark, tile.worldx(), tile.worldy());
|
||||||
|
if(tile.entity != null) tile.entity.damage(damage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@ import io.anuke.ucore.util.Mathf;
|
|||||||
public class Shield extends Entity{
|
public class Shield extends Entity{
|
||||||
public boolean active;
|
public boolean active;
|
||||||
public boolean hitPlayers = false;
|
public boolean hitPlayers = false;
|
||||||
|
public float radius = 0f;
|
||||||
|
|
||||||
private float uptime = 0f;
|
private float uptime = 0f;
|
||||||
private final Tile tile;
|
private final Tile tile;
|
||||||
@ -84,8 +85,7 @@ public class Shield extends Entity{
|
|||||||
}
|
}
|
||||||
|
|
||||||
float drawRadius(){
|
float drawRadius(){
|
||||||
ShieldBlock block = (ShieldBlock)tile.block();
|
return (radius*2 + Mathf.sin(Timers.time(), 25f, 2f));
|
||||||
return (block.shieldRadius*2 + Mathf.sin(Timers.time(), 25f, 2f)) * uptime;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeDelay(){
|
public void removeDelay(){
|
||||||
|
@ -5,13 +5,10 @@ import com.badlogic.gdx.math.Vector2;
|
|||||||
import com.badlogic.gdx.utils.reflect.ClassReflection;
|
import com.badlogic.gdx.utils.reflect.ClassReflection;
|
||||||
|
|
||||||
import io.anuke.mindustry.Vars;
|
import io.anuke.mindustry.Vars;
|
||||||
import io.anuke.mindustry.entities.Bullet;
|
import io.anuke.mindustry.entities.*;
|
||||||
import io.anuke.mindustry.entities.BulletType;
|
|
||||||
import io.anuke.mindustry.entities.Player;
|
|
||||||
import io.anuke.mindustry.entities.effect.Fx;
|
import io.anuke.mindustry.entities.effect.Fx;
|
||||||
import io.anuke.mindustry.entities.effect.Shaders;
|
import io.anuke.mindustry.entities.effect.Shaders;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.ucore.UCore;
|
|
||||||
import io.anuke.ucore.core.*;
|
import io.anuke.ucore.core.*;
|
||||||
import io.anuke.ucore.entities.*;
|
import io.anuke.ucore.entities.*;
|
||||||
import io.anuke.ucore.util.Angles;
|
import io.anuke.ucore.util.Angles;
|
||||||
@ -103,6 +100,10 @@ public class Enemy extends DestructibleEntity{
|
|||||||
}
|
}
|
||||||
|
|
||||||
void updateTargeting(boolean nearCore){
|
void updateTargeting(boolean nearCore){
|
||||||
|
if(target != null && target instanceof TileEntity && ((TileEntity)target).dead){
|
||||||
|
target = null;
|
||||||
|
}
|
||||||
|
|
||||||
if(Timers.get(this, "target", 15) && !nearCore){
|
if(Timers.get(this, "target", 15) && !nearCore){
|
||||||
target = Vars.world.findTileTarget(x, y, null, range, false);
|
target = Vars.world.findTileTarget(x, y, null, range, false);
|
||||||
|
|
||||||
@ -110,10 +111,8 @@ public class Enemy extends DestructibleEntity{
|
|||||||
if(target == null){
|
if(target == null){
|
||||||
target = Entities.getClosest(Entities.defaultGroup(), x, y, range, e -> e instanceof Player);
|
target = Entities.getClosest(Entities.defaultGroup(), x, y, range, e -> e instanceof Player);
|
||||||
}
|
}
|
||||||
}
|
}else if(nearCore){
|
||||||
|
target = Vars.control.getCore().entity;
|
||||||
if(target instanceof Enemy){
|
|
||||||
UCore.log(target);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(target != null && bullet != null){
|
if(target != null && bullet != null){
|
||||||
|
@ -3,6 +3,7 @@ package io.anuke.mindustry.input;
|
|||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
|
|
||||||
import com.badlogic.gdx.Gdx;
|
import com.badlogic.gdx.Gdx;
|
||||||
|
import com.badlogic.gdx.Input.Buttons;
|
||||||
import com.badlogic.gdx.Input.Keys;
|
import com.badlogic.gdx.Input.Keys;
|
||||||
import com.badlogic.gdx.InputAdapter;
|
import com.badlogic.gdx.InputAdapter;
|
||||||
import com.badlogic.gdx.math.Vector2;
|
import com.badlogic.gdx.math.Vector2;
|
||||||
@ -10,7 +11,9 @@ import com.badlogic.gdx.math.Vector2;
|
|||||||
import io.anuke.mindustry.Vars;
|
import io.anuke.mindustry.Vars;
|
||||||
import io.anuke.mindustry.resource.ItemStack;
|
import io.anuke.mindustry.resource.ItemStack;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
|
import io.anuke.mindustry.world.blocks.types.Configurable;
|
||||||
import io.anuke.ucore.core.Graphics;
|
import io.anuke.ucore.core.Graphics;
|
||||||
|
import io.anuke.ucore.core.Inputs;
|
||||||
import io.anuke.ucore.core.Timers;
|
import io.anuke.ucore.core.Timers;
|
||||||
import io.anuke.ucore.scene.ui.layout.Unit;
|
import io.anuke.ucore.scene.ui.layout.Unit;
|
||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
@ -82,6 +85,18 @@ public class AndroidInput extends InputAdapter{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void doInput(){
|
public static void doInput(){
|
||||||
|
Tile cursor = selected();
|
||||||
|
|
||||||
|
//TODO test
|
||||||
|
if(Inputs.buttonUp(Buttons.LEFT) && cursor != null){
|
||||||
|
Tile linked = cursor.isLinked() ? cursor.getLinked() : cursor;
|
||||||
|
if(linked != null && linked.block() instanceof Configurable){
|
||||||
|
Vars.ui.showConfig(linked);
|
||||||
|
}else if(!Vars.ui.hasConfigMouse()){
|
||||||
|
Vars.ui.hideConfig();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(Gdx.input.isTouched(0)
|
if(Gdx.input.isTouched(0)
|
||||||
&& Mathf.near2d(lmousex, lmousey, Gdx.input.getX(0), Gdx.input.getY(0), Unit.dp.inPixels(50))
|
&& Mathf.near2d(lmousex, lmousey, Gdx.input.getX(0), Gdx.input.getY(0), Unit.dp.inPixels(50))
|
||||||
&& !ui.hasMouse() /*&& (player.recipe == null || mode == PlaceMode.touch)*/){
|
&& !ui.hasMouse() /*&& (player.recipe == null || mode == PlaceMode.touch)*/){
|
||||||
|
@ -52,7 +52,7 @@ public enum Recipe{
|
|||||||
titaniumpurifier(crafting, ProductionBlocks.titaniumpurifier, stack(Item.steel, 30), stack(Item.iron, 30)),
|
titaniumpurifier(crafting, ProductionBlocks.titaniumpurifier, stack(Item.steel, 30), stack(Item.iron, 30)),
|
||||||
oilrefinery(crafting, ProductionBlocks.oilrefinery, stack(Item.steel, 15), stack(Item.iron, 15)),
|
oilrefinery(crafting, ProductionBlocks.oilrefinery, stack(Item.steel, 15), stack(Item.iron, 15)),
|
||||||
stoneformer(crafting, ProductionBlocks.stoneformer, stack(Item.steel, 10), stack(Item.iron, 10)),
|
stoneformer(crafting, ProductionBlocks.stoneformer, stack(Item.steel, 10), stack(Item.iron, 10)),
|
||||||
lavasmelter(crafting, ProductionBlocks.lavasmelter, stack(Item.steel, 20), stack(Item.iron, 20), stack(Item.titanium, 10)),
|
lavasmelter(crafting, ProductionBlocks.lavasmelter, stack(Item.steel, 30), stack(Item.titanium, 15)),
|
||||||
|
|
||||||
stonedrill(production, ProductionBlocks.stonedrill, stack(Item.stone, 12)),
|
stonedrill(production, ProductionBlocks.stonedrill, stack(Item.stone, 12)),
|
||||||
irondrill(production, ProductionBlocks.irondrill, stack(Item.stone, 25)),
|
irondrill(production, ProductionBlocks.irondrill, stack(Item.stone, 25)),
|
||||||
|
@ -14,6 +14,7 @@ import io.anuke.mindustry.resource.Recipe;
|
|||||||
import io.anuke.mindustry.resource.Section;
|
import io.anuke.mindustry.resource.Section;
|
||||||
import io.anuke.mindustry.ui.FloatingDialog;
|
import io.anuke.mindustry.ui.FloatingDialog;
|
||||||
import io.anuke.ucore.core.Draw;
|
import io.anuke.ucore.core.Draw;
|
||||||
|
import io.anuke.ucore.graphics.Hue;
|
||||||
import io.anuke.ucore.scene.builders.table;
|
import io.anuke.ucore.scene.builders.table;
|
||||||
import io.anuke.ucore.scene.event.Touchable;
|
import io.anuke.ucore.scene.event.Touchable;
|
||||||
import io.anuke.ucore.scene.ui.*;
|
import io.anuke.ucore.scene.ui.*;
|
||||||
@ -105,7 +106,7 @@ public class BlocksFragment implements Fragment{
|
|||||||
//image.setDisabled(!has);
|
//image.setDisabled(!has);
|
||||||
image.setChecked(player.recipe == r);
|
image.setChecked(player.recipe == r);
|
||||||
image.setTouchable(canPlace ? Touchable.enabled : Touchable.disabled);
|
image.setTouchable(canPlace ? Touchable.enabled : Touchable.disabled);
|
||||||
image.getImage().setColor(has ? Color.WHITE : Color.DARK_GRAY);
|
image.getImage().setColor(has ? Color.WHITE : Hue.lightness(0.33f));
|
||||||
});
|
});
|
||||||
|
|
||||||
if(i % rows == rows-1)
|
if(i % rows == rows-1)
|
||||||
@ -195,7 +196,7 @@ public class BlocksFragment implements Fragment{
|
|||||||
}).size(110, 50).pad(10f).units(Unit.dp);
|
}).size(110, 50).pad(10f).units(Unit.dp);
|
||||||
|
|
||||||
d.show();
|
d.show();
|
||||||
}).expandX().padLeft(4).top().right().size(36f, 40f).units(Unit.dp);
|
}).expandX().padLeft(4).top().right().size(42f, 46f).padTop(-2).units(Unit.dp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ import io.anuke.ucore.scene.actions.Actions;
|
|||||||
import io.anuke.ucore.scene.builders.imagebutton;
|
import io.anuke.ucore.scene.builders.imagebutton;
|
||||||
import io.anuke.ucore.scene.builders.label;
|
import io.anuke.ucore.scene.builders.label;
|
||||||
import io.anuke.ucore.scene.builders.table;
|
import io.anuke.ucore.scene.builders.table;
|
||||||
|
import io.anuke.ucore.scene.event.Touchable;
|
||||||
import io.anuke.ucore.scene.ui.Image;
|
import io.anuke.ucore.scene.ui.Image;
|
||||||
import io.anuke.ucore.scene.ui.Label;
|
import io.anuke.ucore.scene.ui.Label;
|
||||||
import io.anuke.ucore.scene.ui.layout.Cell;
|
import io.anuke.ucore.scene.ui.layout.Cell;
|
||||||
@ -42,7 +43,7 @@ public class HudFragment implements Fragment{
|
|||||||
|
|
||||||
new table(){{
|
new table(){{
|
||||||
left();
|
left();
|
||||||
defaults().size(66).units(Unit.dp).left();
|
defaults().size(68).units(Unit.dp).left();
|
||||||
float isize = Unit.dp.inPixels(40);
|
float isize = Unit.dp.inPixels(40);
|
||||||
|
|
||||||
new imagebutton("icon-menu", isize, ()->{
|
new imagebutton("icon-menu", isize, ()->{
|
||||||
@ -64,6 +65,12 @@ public class HudFragment implements Fragment{
|
|||||||
|
|
||||||
row();
|
row();
|
||||||
|
|
||||||
|
new table(){{
|
||||||
|
addWaveTable();
|
||||||
|
}}.fillX().end();
|
||||||
|
|
||||||
|
row();
|
||||||
|
|
||||||
itemtable = new table("button").end().top().left().fillX().size(-1).get();
|
itemtable = new table("button").end().top().left().fillX().size(-1).get();
|
||||||
itemtable.setVisible(()-> control.getMode() != GameMode.sandbox);
|
itemtable.setVisible(()-> control.getMode() != GameMode.sandbox);
|
||||||
itemcell = get().getCell(itemtable);
|
itemcell = get().getCell(itemtable);
|
||||||
@ -95,29 +102,16 @@ public class HudFragment implements Fragment{
|
|||||||
|
|
||||||
//wave table...
|
//wave table...
|
||||||
new table(){{
|
new table(){{
|
||||||
atop();
|
|
||||||
aright();
|
|
||||||
|
|
||||||
float uheight = 72f;
|
if(!Vars.android){
|
||||||
|
atop();
|
||||||
|
aright();
|
||||||
|
}else{
|
||||||
|
abottom();
|
||||||
|
aleft();
|
||||||
|
}
|
||||||
|
|
||||||
new imagebutton("icon-play", Unit.dp.inPixels(30f), ()->{
|
//addWaveTable();
|
||||||
Vars.control.runWave();
|
|
||||||
}).size(uheight).uniformY().units(Unit.dp)
|
|
||||||
.visible(()-> Vars.control.getMode() == GameMode.sandbox && Vars.control.getEnemiesRemaining() <= 0);
|
|
||||||
|
|
||||||
new table("button"){{
|
|
||||||
|
|
||||||
new label(()->"[orange]Wave " + control.getWave()).scale(fontscale*2f).left();
|
|
||||||
|
|
||||||
row();
|
|
||||||
|
|
||||||
new label(()-> control.getEnemiesRemaining() > 0 ?
|
|
||||||
control.getEnemiesRemaining() + " Enemies remaining" :
|
|
||||||
(control.getTutorial().active() || Vars.control.getMode() == GameMode.sandbox) ? "waiting..." : "New wave in " + (int) (control.getWaveCountdown() / 60f))
|
|
||||||
.minWidth(150);
|
|
||||||
|
|
||||||
get().pad(Unit.dp.inPixels(12));
|
|
||||||
}}.height(uheight).units(Unit.dp);
|
|
||||||
|
|
||||||
visible(()->!GameState.is(State.menu));
|
visible(()->!GameState.is(State.menu));
|
||||||
}}.end();
|
}}.end();
|
||||||
@ -166,6 +160,46 @@ public class HudFragment implements Fragment{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void addWaveTable(){
|
||||||
|
float uheight = 66f;
|
||||||
|
|
||||||
|
new table("button"){{
|
||||||
|
aleft();
|
||||||
|
new table(){{
|
||||||
|
aleft();
|
||||||
|
|
||||||
|
new label(()->"[orange]Wave " + control.getWave()).scale(fontscale*1.5f).left();
|
||||||
|
|
||||||
|
row();
|
||||||
|
|
||||||
|
new label(()-> control.getEnemiesRemaining() > 0 ?
|
||||||
|
control.getEnemiesRemaining() + " enemies" :
|
||||||
|
(control.getTutorial().active() || Vars.control.getMode() == GameMode.sandbox) ? "waiting..." : "Wave in " + (int) (control.getWaveCountdown() / 60f))
|
||||||
|
.minWidth(140).left();
|
||||||
|
|
||||||
|
get().pad(Unit.dp.inPixels(12));
|
||||||
|
}}.left().padLeft(-6).end();
|
||||||
|
|
||||||
|
playButton(uheight);
|
||||||
|
//get().padTop(Unit.dp.inPixels(1));
|
||||||
|
//get().padBottom(Unit.dp.inPixels(1));
|
||||||
|
}}.height(uheight).units(Unit.dp).fillX().expandX().end();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void playButton(float uheight){
|
||||||
|
new imagebutton("icon-play", Unit.dp.inPixels(30f), ()->{
|
||||||
|
Vars.control.runWave();
|
||||||
|
}).height(uheight).fillX().padTop(-8f).padBottom(-12f).padRight(-18f).padLeft(-10f).width(40f).units(Unit.dp).update(l->{
|
||||||
|
boolean vis = Vars.control.getMode() == GameMode.sandbox && Vars.control.getEnemiesRemaining() <= 0;
|
||||||
|
boolean paused = GameState.is(State.paused) || !vis;
|
||||||
|
|
||||||
|
l.setVisible(vis);
|
||||||
|
l.getStyle().imageUp = Core.skin.getDrawable(vis ? "icon-play" : "clear");
|
||||||
|
l.setTouchable(!paused ? Touchable.enabled : Touchable.disabled);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public void updateItems(){
|
public void updateItems(){
|
||||||
|
|
||||||
itemtable.clear();
|
itemtable.clear();
|
||||||
|
@ -278,7 +278,7 @@ public class World extends Module{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Tmp.r2.overlaps(player.hitbox.getRect(player.x, player.y))){
|
if(!Vars.android && Tmp.r2.overlaps(player.hitbox.getRect(player.x, player.y))){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@ public class DistributionBlocks{
|
|||||||
}},
|
}},
|
||||||
|
|
||||||
pulseconduit = new LiquidBlock("pulseconduit"){{
|
pulseconduit = new LiquidBlock("pulseconduit"){{
|
||||||
|
formalName = "pulse conduit";
|
||||||
fullDescription = "Advanced liquid transport block. Transports liquids faster and stores more than standard conduits.";
|
fullDescription = "Advanced liquid transport block. Transports liquids faster and stores more than standard conduits.";
|
||||||
liquidCapacity = 16f;
|
liquidCapacity = 16f;
|
||||||
flowfactor = 4.9f;
|
flowfactor = 4.9f;
|
||||||
@ -29,7 +30,6 @@ public class DistributionBlocks{
|
|||||||
}},
|
}},
|
||||||
|
|
||||||
conveyor = new Conveyor("conveyor"){{
|
conveyor = new Conveyor("conveyor"){{
|
||||||
description = "Moves items.";
|
|
||||||
fullDescription = "Basic item transport block. Moves items forward and automatically deposits them into turrets or crafters. "
|
fullDescription = "Basic item transport block. Moves items forward and automatically deposits them into turrets or crafters. "
|
||||||
+ "Rotatable. Can be used as a bridge over liquids for enemies and players.";
|
+ "Rotatable. Can be used as a bridge over liquids for enemies and players.";
|
||||||
}},
|
}},
|
||||||
@ -37,16 +37,13 @@ public class DistributionBlocks{
|
|||||||
steelconveyor = new Conveyor("steelconveyor"){{
|
steelconveyor = new Conveyor("steelconveyor"){{
|
||||||
health = 55;
|
health = 55;
|
||||||
speed = 0.04f;
|
speed = 0.04f;
|
||||||
description = "Moves items faster.";
|
|
||||||
formalName = "steel conveyor";
|
formalName = "steel conveyor";
|
||||||
fullDescription = "Advanced item transport block. Moves items faster than standard conveyors.";
|
fullDescription = "Advanced item transport block. Moves items faster than standard conveyors.";
|
||||||
}},
|
}},
|
||||||
|
|
||||||
//TODO
|
|
||||||
pulseconveyor = new Conveyor("poweredconveyor"){{
|
pulseconveyor = new Conveyor("poweredconveyor"){{
|
||||||
health = 75;
|
health = 75;
|
||||||
speed = 0.09f;
|
speed = 0.09f;
|
||||||
description = "Moves items even faster.";
|
|
||||||
formalName = "pulse conveyor";
|
formalName = "pulse conveyor";
|
||||||
fullDescription = "The ultimate item transport block. Moves items faster than steel conveyors.";
|
fullDescription = "The ultimate item transport block. Moves items faster than steel conveyors.";
|
||||||
}},
|
}},
|
||||||
@ -71,7 +68,6 @@ public class DistributionBlocks{
|
|||||||
}},
|
}},
|
||||||
liquidjunction = new LiquidJunction("liquidjunction"){{
|
liquidjunction = new LiquidJunction("liquidjunction"){{
|
||||||
formalName = "liquid junction";
|
formalName = "liquid junction";
|
||||||
description = "Serves as a liquid junction.";
|
|
||||||
fullDescription = "Acts as a bridge for two crossing conduits. Useful in situations with "
|
fullDescription = "Acts as a bridge for two crossing conduits. Useful in situations with "
|
||||||
+ "two different conduits carrying different liquids to different locations.";
|
+ "two different conduits carrying different liquids to different locations.";
|
||||||
}},
|
}},
|
||||||
@ -88,7 +84,7 @@ public class DistributionBlocks{
|
|||||||
}},
|
}},
|
||||||
powerlaser = new PowerLaser("powerlaser"){{
|
powerlaser = new PowerLaser("powerlaser"){{
|
||||||
formalName = "power laser";
|
formalName = "power laser";
|
||||||
description = "Transmits power with a laser.";
|
description = "Transmits power.";
|
||||||
fullDescription = "Creates a laser that transmits power to the block in front of it. Does not generate any power itself. "
|
fullDescription = "Creates a laser that transmits power to the block in front of it. Does not generate any power itself. "
|
||||||
+ "Best used with generators or other lasers.";
|
+ "Best used with generators or other lasers.";
|
||||||
}},
|
}},
|
||||||
@ -103,16 +99,16 @@ public class DistributionBlocks{
|
|||||||
formalName = "laser corner";
|
formalName = "laser corner";
|
||||||
description = "Splits input power into 2 lasers.";
|
description = "Splits input power into 2 lasers.";
|
||||||
fullDescription = "Laser that distributes power to two directions at once. "
|
fullDescription = "Laser that distributes power to two directions at once. "
|
||||||
+ "Useful in situations where it is required to power multiple blocks from one generator, and a normal router is imprecise.";
|
+ "Useful in situations where it is required to power multiple blocks from one generator, and a router is imprecise.";
|
||||||
}},
|
}},
|
||||||
teleporter = new Teleporter("teleporter"){{
|
teleporter = new Teleporter("teleporter"){{
|
||||||
description = "[interact]Tap block to config[]\nTeleports items to others of the same color.";
|
description = "[interact]Tap block to config[]";
|
||||||
fullDescription = "Advanced item transport block. Teleporters input items to other teleporters of the same color."
|
fullDescription = "Advanced item transport block. Teleporters input items to other teleporters of the same color."
|
||||||
+ " Does nothing if no teleporters of the same color exist. If multiple teleporters exist of the same color, a random one is selected."
|
+ " Does nothing if no teleporters of the same color exist. If multiple teleporters exist of the same color, a random one is selected."
|
||||||
+ " Tap and click the arrows to change color.";
|
+ " Tap and click the arrows to change color.";
|
||||||
}},
|
}},
|
||||||
sorter = new Sorter("sorter"){{
|
sorter = new Sorter("sorter"){{
|
||||||
description = "[interact]Tap block to config[]\nSorts input items by type.";
|
description = "[interact]Tap block to config[]";
|
||||||
fullDescription = "Sorts item by material type. Material to accept is indicated by the color in the block. "
|
fullDescription = "Sorts item by material type. Material to accept is indicated by the color in the block. "
|
||||||
+ "All items that match the sort material are outputted forward, everything else is outputted to the left and right.";
|
+ "All items that match the sort material are outputted forward, everything else is outputted to the left and right.";
|
||||||
}};
|
}};
|
||||||
|
@ -78,7 +78,7 @@ public class ProductionBlocks{
|
|||||||
liquidAmount = 18.99f;
|
liquidAmount = 18.99f;
|
||||||
output = Item.coal;
|
output = Item.coal;
|
||||||
health = 50;
|
health = 50;
|
||||||
purifyTime = 60;
|
purifyTime = 50;
|
||||||
description = "Converts stone + water to coal.";
|
description = "Converts stone + water to coal.";
|
||||||
fullDescription = "A basic extractor block. Outputs coal when supplied with large amounts of water and stone.";
|
fullDescription = "A basic extractor block. Outputs coal when supplied with large amounts of water and stone.";
|
||||||
}
|
}
|
||||||
@ -92,7 +92,7 @@ public class ProductionBlocks{
|
|||||||
inputLiquid = Liquid.water;
|
inputLiquid = Liquid.water;
|
||||||
liquidAmount = 40f;
|
liquidAmount = 40f;
|
||||||
liquidCapacity = 41f;
|
liquidCapacity = 41f;
|
||||||
purifyTime = 80;
|
purifyTime = 60;
|
||||||
output = Item.titanium;
|
output = Item.titanium;
|
||||||
health = 70;
|
health = 70;
|
||||||
description = "Converts iron + water to titanium.";
|
description = "Converts iron + water to titanium.";
|
||||||
@ -106,7 +106,7 @@ public class ProductionBlocks{
|
|||||||
inputLiquid = Liquid.oil;
|
inputLiquid = Liquid.oil;
|
||||||
liquidAmount = 45f;
|
liquidAmount = 45f;
|
||||||
liquidCapacity = 46f;
|
liquidCapacity = 46f;
|
||||||
purifyTime = 70;
|
purifyTime = 60;
|
||||||
output = Item.coal;
|
output = Item.coal;
|
||||||
health = 80;
|
health = 80;
|
||||||
craftEffect = Fx.purifyoil;
|
craftEffect = Fx.purifyoil;
|
||||||
@ -266,7 +266,7 @@ public class ProductionBlocks{
|
|||||||
height = 3;
|
height = 3;
|
||||||
health = 600;
|
health = 600;
|
||||||
breaktime *= 2.3f;
|
breaktime *= 2.3f;
|
||||||
description = "Generates power from uranium + water.";
|
//description = "Advanced generator.";
|
||||||
fullDescription = "The ultimate power generator. Highly volatile. Generates power from uranium. Requires constant cooling in the form of water. "
|
fullDescription = "The ultimate power generator. Highly volatile. Generates power from uranium. Requires constant cooling in the form of water. "
|
||||||
+ "Will explode violently if insufficient amounts of coolant are supplied. ";
|
+ "Will explode violently if insufficient amounts of coolant are supplied. ";
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,6 @@ public class LiquidBlock extends Block implements LiquidAcceptor{
|
|||||||
|
|
||||||
public LiquidBlock(String name) {
|
public LiquidBlock(String name) {
|
||||||
super(name);
|
super(name);
|
||||||
description = "Transports liquids.";
|
|
||||||
rotate = true;
|
rotate = true;
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,11 @@ public class PowerTurret extends Turret implements PowerAcceptor{
|
|||||||
ammo = null;
|
ammo = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void postInit(){
|
||||||
|
description = "[turretinfo]Uses power.";
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getStats(Array<String> list){
|
public void getStats(Array<String> list){
|
||||||
super.getStats(list);
|
super.getStats(list);
|
||||||
@ -33,12 +38,6 @@ public class PowerTurret extends Turret implements PowerAcceptor{
|
|||||||
list.add("[powerinfo]Power/shot: " + Strings.toFixed(powerUsed, 1));
|
list.add("[powerinfo]Power/shot: " + Strings.toFixed(powerUsed, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void postInit(){
|
|
||||||
super.postInit();
|
|
||||||
description += "\n[powerinfo]Power/shot: " + Strings.toFixed(powerUsed, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawPixelOverlay(Tile tile){
|
public void drawPixelOverlay(Tile tile){
|
||||||
Vector2 offset = getPlaceOffset();
|
Vector2 offset = getPlaceOffset();
|
||||||
|
@ -31,7 +31,7 @@ public class RepairTurret extends PowerTurret{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void postInit(){
|
public void postInit(){
|
||||||
description = "[turretinfo]Range: " + (int)range + "\nPower/unit: "+powerUsed+"\n[description]Heals nearby tiles.";
|
description = "[powerinfo]Uses power[white]\nRepairs nearby blocks.";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -11,16 +11,20 @@ import io.anuke.mindustry.world.blocks.types.PowerBlock;
|
|||||||
import io.anuke.ucore.core.Effects;
|
import io.anuke.ucore.core.Effects;
|
||||||
import io.anuke.ucore.core.Timers;
|
import io.anuke.ucore.core.Timers;
|
||||||
import io.anuke.ucore.entities.BulletEntity;
|
import io.anuke.ucore.entities.BulletEntity;
|
||||||
|
import io.anuke.ucore.util.Mathf;
|
||||||
import io.anuke.ucore.util.Strings;
|
import io.anuke.ucore.util.Strings;
|
||||||
|
|
||||||
public class ShieldBlock extends PowerBlock{
|
public class ShieldBlock extends PowerBlock{
|
||||||
public float shieldRadius = 40f;
|
public float shieldRadius = 40f;
|
||||||
public float powerDrain = 0.006f;
|
public float powerDrain = 0.005f;
|
||||||
public float powerPerDamage = 0.1f;
|
public float powerPerDamage = 0.1f;
|
||||||
|
public float maxRadius = 40f;
|
||||||
|
public float radiusPowerScale = 7.5f;
|
||||||
|
|
||||||
public ShieldBlock(String name) {
|
public ShieldBlock(String name) {
|
||||||
super(name);
|
super(name);
|
||||||
voltage = powerDrain;
|
voltage = powerDrain;
|
||||||
|
health = 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -42,7 +46,7 @@ public class ShieldBlock extends PowerBlock{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(entity.power > powerPerDamage){
|
if(entity.power > powerPerDamage){
|
||||||
if(!entity.shield.active && entity.power > powerPerDamage * 8f){
|
if(!entity.shield.active){
|
||||||
entity.shield.add();
|
entity.shield.add();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,6 +56,8 @@ public class ShieldBlock extends PowerBlock{
|
|||||||
entity.shield.removeDelay();
|
entity.shield.removeDelay();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
entity.shield.radius = Mathf.lerp(entity.shield.radius, Math.min(entity.power * radiusPowerScale, maxRadius), Timers.delta() * 0.05f);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,8 +66,8 @@ public class Turret extends Block{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void postInit(){
|
public void postInit(){
|
||||||
description = "[turretinfo]" + (ammo==null ? "" : "Ammo: " + ammo +"\n")
|
if(ammo != null)
|
||||||
+ "Range: " + (int)range;
|
description = "[turretinfo]Ammo: " + ammo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -33,6 +33,7 @@ public class Junction extends Block{
|
|||||||
@Override
|
@Override
|
||||||
public boolean acceptItem(Item item, Tile dest, Tile source){
|
public boolean acceptItem(Item item, Tile dest, Tile source){
|
||||||
int dir = source.relativeTo(dest.x, dest.y);
|
int dir = source.relativeTo(dest.x, dest.y);
|
||||||
|
if(dir == -1) return false;
|
||||||
Tile to = dest.getNearby()[dir];
|
Tile to = dest.getNearby()[dir];
|
||||||
return to != null && to.block().acceptItem(item, to, dest);
|
return to != null && to.block().acceptItem(item, to, dest);
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,7 @@ public class PowerBooster extends Generator{
|
|||||||
super(name);
|
super(name);
|
||||||
explosive = false;
|
explosive = false;
|
||||||
hasLasers = false;
|
hasLasers = false;
|
||||||
|
powerSpeed = 0.4f;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -69,7 +70,6 @@ public class PowerBooster extends Generator{
|
|||||||
int acceptors = 0;
|
int acceptors = 0;
|
||||||
float flow = 0f;
|
float flow = 0f;
|
||||||
|
|
||||||
//TODO have two phases, where it checks nearby blocks first, then distributes it evenly
|
|
||||||
for(int i = 0; i < 2; i++){
|
for(int i = 0; i < 2; i++){
|
||||||
for(int x = -powerRange; x <= powerRange; x++){
|
for(int x = -powerRange; x <= powerRange; x++){
|
||||||
for(int y = -powerRange; y <= powerRange; y++){
|
for(int y = -powerRange; y <= powerRange; y++){
|
||||||
|
@ -24,7 +24,7 @@ public class Generator extends PowerBlock{
|
|||||||
|
|
||||||
public int laserRange = 6;
|
public int laserRange = 6;
|
||||||
public int laserDirections = 4;
|
public int laserDirections = 4;
|
||||||
public float powerSpeed = 0.06f;
|
public float powerSpeed = 0.1f;
|
||||||
public boolean explosive = true;
|
public boolean explosive = true;
|
||||||
public boolean hasLasers = true;
|
public boolean hasLasers = true;
|
||||||
public boolean outputOnly = false;
|
public boolean outputOnly = false;
|
||||||
@ -196,22 +196,17 @@ public class Generator extends PowerBlock{
|
|||||||
int relrot = (rotation + 2) % 4;
|
int relrot = (rotation + 2) % 4;
|
||||||
if(other.hasLasers){
|
if(other.hasLasers){
|
||||||
for(int i = 0; i < other.laserDirections; i ++){
|
for(int i = 0; i < other.laserDirections; i ++){
|
||||||
if(target.getRotation() + i - other.laserDirections/2 == (target.getRotation() + 2) % 4){
|
if(Mathf.mod(target.getRotation() + i - other.laserDirections/2, 4) == relrot){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(other.hasLasers && Math.abs(target.getRotation() - relrot) <= other.laserDirections / 2){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Tile laserTarget(Tile tile, int rotation){
|
protected Tile laserTarget(Tile tile, int rotation){
|
||||||
if(rotation < 0)
|
rotation = Mathf.mod(rotation, 4);
|
||||||
rotation += 4;
|
|
||||||
rotation %= 4;
|
|
||||||
GridPoint2 point = Geometry.getD4Points()[rotation];
|
GridPoint2 point = Geometry.getD4Points()[rotation];
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
@ -10,3 +10,10 @@ body {
|
|||||||
margin: 0px;
|
margin: 0px;
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.gdx-meter.red > span {
|
||||||
|
background-color: #e44d3c !important;
|
||||||
|
background-image: -moz-linear-gradient(top, #f4ba6e, #d29d58) !important;
|
||||||
|
background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #f4ba6e),color-stop(1, #d29d58)) !important;
|
||||||
|
background-image: -webkit-linear-gradient(#f4ba6e, #d29d58) !important;
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user