Balanced all enemies, tweaked waves
This commit is contained in:
@@ -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 = false;
|
public static boolean infiniteAmmo = true;
|
||||||
//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
|
||||||
|
|||||||
@@ -9,14 +9,15 @@ import com.badlogic.gdx.input.GestureDetector;
|
|||||||
import com.badlogic.gdx.utils.Array;
|
import com.badlogic.gdx.utils.Array;
|
||||||
import com.badlogic.gdx.utils.ObjectMap;
|
import com.badlogic.gdx.utils.ObjectMap;
|
||||||
import com.badlogic.gdx.utils.reflect.ClassReflection;
|
import com.badlogic.gdx.utils.reflect.ClassReflection;
|
||||||
import com.badlogic.gdx.utils.reflect.Constructor;
|
|
||||||
|
|
||||||
import io.anuke.mindustry.Mindustry;
|
import io.anuke.mindustry.Mindustry;
|
||||||
import io.anuke.mindustry.Vars;
|
import io.anuke.mindustry.Vars;
|
||||||
import io.anuke.mindustry.core.GameState.State;
|
import io.anuke.mindustry.core.GameState.State;
|
||||||
import io.anuke.mindustry.entities.*;
|
import io.anuke.mindustry.entities.*;
|
||||||
import io.anuke.mindustry.entities.effect.Fx;
|
import io.anuke.mindustry.entities.effect.Fx;
|
||||||
import io.anuke.mindustry.entities.enemies.*;
|
import io.anuke.mindustry.entities.enemies.BlastEnemy;
|
||||||
|
import io.anuke.mindustry.entities.enemies.Enemy;
|
||||||
|
import io.anuke.mindustry.entities.enemies.HealerEnemy;
|
||||||
import io.anuke.mindustry.input.AndroidInput;
|
import io.anuke.mindustry.input.AndroidInput;
|
||||||
import io.anuke.mindustry.input.GestureHandler;
|
import io.anuke.mindustry.input.GestureHandler;
|
||||||
import io.anuke.mindustry.input.Input;
|
import io.anuke.mindustry.input.Input;
|
||||||
@@ -113,61 +114,8 @@ public class Control extends Module{
|
|||||||
|
|
||||||
player = new Player();
|
player = new Player();
|
||||||
|
|
||||||
spawns = Array.with(
|
spawns = WaveCreator.getSpawns();
|
||||||
new EnemySpawn(TitanEnemy.class){{
|
WaveCreator.testWaves(1, 30);
|
||||||
after = 5;
|
|
||||||
spacing = 2;
|
|
||||||
scaling = 5;
|
|
||||||
}},
|
|
||||||
new EnemySpawn(FortressEnemy.class){{
|
|
||||||
after = 12;
|
|
||||||
spacing = 3;
|
|
||||||
scaling = 5;
|
|
||||||
}},
|
|
||||||
new EnemySpawn(HealerEnemy.class){{
|
|
||||||
scaling = 3;
|
|
||||||
spacing = 2;
|
|
||||||
after = 8;
|
|
||||||
}},
|
|
||||||
new EnemySpawn(Enemy.class){{
|
|
||||||
scaling = 3;
|
|
||||||
tierscaleback = 3;
|
|
||||||
}},
|
|
||||||
new EnemySpawn(FastEnemy.class){{
|
|
||||||
after = 2;
|
|
||||||
scaling = 3;
|
|
||||||
}},
|
|
||||||
new EnemySpawn(FlamerEnemy.class){{
|
|
||||||
after = 14;
|
|
||||||
spacing = 5;
|
|
||||||
scaling = 2;
|
|
||||||
}},
|
|
||||||
new EnemySpawn(BlastEnemy.class){{
|
|
||||||
after = 12;
|
|
||||||
spacing = 2;
|
|
||||||
scaling = 3;
|
|
||||||
}},
|
|
||||||
new EnemySpawn(RapidEnemy.class){{
|
|
||||||
after = 7;
|
|
||||||
spacing = 3;
|
|
||||||
scaling = 3;
|
|
||||||
}},
|
|
||||||
new EnemySpawn(EmpEnemy.class){{
|
|
||||||
after = 19;
|
|
||||||
spacing = 3;
|
|
||||||
scaling = 5;
|
|
||||||
}},
|
|
||||||
new EnemySpawn(TankEnemy.class){{
|
|
||||||
after = 4;
|
|
||||||
spacing = 2;
|
|
||||||
scaling = 3;
|
|
||||||
}},
|
|
||||||
new EnemySpawn(MortarEnemy.class){{
|
|
||||||
after = 20;
|
|
||||||
spacing = 3;
|
|
||||||
scaling = 5;
|
|
||||||
}}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void reset(){
|
public void reset(){
|
||||||
@@ -290,9 +238,9 @@ public class Control extends Module{
|
|||||||
|
|
||||||
Timers.run(index*50f, ()->{
|
Timers.run(index*50f, ()->{
|
||||||
try{
|
try{
|
||||||
Constructor c = ClassReflection.getConstructor(spawn.type, int.class);
|
Enemy enemy = ClassReflection.newInstance(spawn.type);
|
||||||
Enemy enemy = (Enemy)c.newInstance(fl);
|
|
||||||
enemy.set(tile.worldx() + Mathf.range(range), tile.worldy() + Mathf.range(range));
|
enemy.set(tile.worldx() + Mathf.range(range), tile.worldy() + Mathf.range(range));
|
||||||
|
enemy.spawn = fl;
|
||||||
enemy.tier = spawn.tier(wave, fl);
|
enemy.tier = spawn.tier(wave, fl);
|
||||||
Effects.effect(Fx.spawn, enemy);
|
Effects.effect(Fx.spawn, enemy);
|
||||||
enemy.add(enemyGroup);
|
enemy.add(enemyGroup);
|
||||||
@@ -466,15 +414,15 @@ public class Control extends Module{
|
|||||||
|
|
||||||
if(Inputs.keyUp(Keys.Y)){
|
if(Inputs.keyUp(Keys.Y)){
|
||||||
if(Inputs.keyDown(Keys.SHIFT_LEFT)){
|
if(Inputs.keyDown(Keys.SHIFT_LEFT)){
|
||||||
new HealerEnemy(0).set(player.x, player.y).add();
|
new HealerEnemy().set(player.x, player.y).add();
|
||||||
}else{
|
}else{
|
||||||
float px = player.x, py = player.y;
|
float px = player.x, py = player.y;
|
||||||
Timers.run(30f, ()->new BlastEnemy(0).set(px, py).add());
|
Timers.run(30f, ()->new BlastEnemy().set(px, py).add());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(shouldUpdateItems && Timers.get("updateItems", 8)){
|
if(shouldUpdateItems && (Timers.get("updateItems", 8) || GameState.is(State.paused))){
|
||||||
ui.updateItems();
|
ui.updateItems();
|
||||||
shouldUpdateItems = false;
|
shouldUpdateItems = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -232,14 +232,14 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
|
|||||||
}
|
}
|
||||||
public void draw(Bullet b){}
|
public void draw(Bullet b){}
|
||||||
},
|
},
|
||||||
small = new BulletType(1.5f, 1){
|
small = new BulletType(1.5f, 2){
|
||||||
public void draw(Bullet b){
|
public void draw(Bullet b){
|
||||||
Draw.color(glowy);
|
Draw.color(glowy);
|
||||||
Draw.rect("shot", b.x, b.y, b.angle() - 45);
|
Draw.rect("shot", b.x, b.y, b.angle() - 45);
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
smallSlow = new BulletType(1.2f, 1){
|
smallSlow = new BulletType(1.2f, 2){
|
||||||
public void draw(Bullet b){
|
public void draw(Bullet b){
|
||||||
Draw.color("orange");
|
Draw.color("orange");
|
||||||
Draw.rect("shot", b.x, b.y, b.angle() - 45);
|
Draw.rect("shot", b.x, b.y, b.angle() - 45);
|
||||||
|
|||||||
@@ -4,14 +4,24 @@ import io.anuke.mindustry.entities.enemies.Enemy;
|
|||||||
import io.anuke.ucore.util.Mathf;
|
import io.anuke.ucore.util.Mathf;
|
||||||
|
|
||||||
public class EnemySpawn{
|
public class EnemySpawn{
|
||||||
|
/**The enemy type spawned*/
|
||||||
public final Class<? extends Enemy> type;
|
public final Class<? extends Enemy> type;
|
||||||
|
/**When this spawns should end*/
|
||||||
protected int before = Integer.MAX_VALUE;
|
protected int before = Integer.MAX_VALUE;
|
||||||
|
/**When this spawns should start*/
|
||||||
protected int after;
|
protected int after;
|
||||||
|
/**The spacing, in waves, of spawns. 2 = spawns every other wave*/
|
||||||
protected int spacing = 1;
|
protected int spacing = 1;
|
||||||
|
/**How many waves need to pass after the start of this spawn for the tier to increase by one*/
|
||||||
protected int tierscale = 15;
|
protected int tierscale = 15;
|
||||||
|
/**How many less enemies there are, every time the tier increases*/
|
||||||
protected int tierscaleback = 1;
|
protected int tierscaleback = 1;
|
||||||
|
/**Maximum amount of enemies that spawn*/
|
||||||
protected int max = 17;
|
protected int max = 17;
|
||||||
|
/**How many waves need to pass before the amount of enemies increases by 1*/
|
||||||
protected float scaling = 9999f;
|
protected float scaling = 9999f;
|
||||||
|
/**Amount of enemies spawned initially, with no scaling*/
|
||||||
|
protected int amount = 1;
|
||||||
|
|
||||||
public EnemySpawn(Class<? extends Enemy> type){
|
public EnemySpawn(Class<? extends Enemy> type){
|
||||||
this.type = type;
|
this.type = type;
|
||||||
@@ -21,7 +31,7 @@ public class EnemySpawn{
|
|||||||
if(wave < after || wave > before || (wave - after) % spacing != 0){
|
if(wave < after || wave > before || (wave - after) % spacing != 0){
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return Math.min(1 * Math.max((int)((wave / spacing) / scaling), 1) - (tier(wave, lane)-1) * tierscaleback, max);
|
return Math.min(amount-1 + 1 * Math.max((int)((wave / spacing) / scaling), 1) - (tier(wave, lane)-1) * tierscaleback, max);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int tier(int wave, int lane){
|
public int tier(int wave, int lane){
|
||||||
|
|||||||
201
core/src/io/anuke/mindustry/entities/WaveCreator.java
Normal file
201
core/src/io/anuke/mindustry/entities/WaveCreator.java
Normal file
@@ -0,0 +1,201 @@
|
|||||||
|
package io.anuke.mindustry.entities;
|
||||||
|
|
||||||
|
import com.badlogic.gdx.utils.Array;
|
||||||
|
import com.badlogic.gdx.utils.reflect.ClassReflection;
|
||||||
|
|
||||||
|
import io.anuke.mindustry.entities.enemies.*;
|
||||||
|
|
||||||
|
public class WaveCreator{
|
||||||
|
|
||||||
|
public static Array<EnemySpawn> getSpawns(){
|
||||||
|
//TODO
|
||||||
|
//Gdx.app.exit();
|
||||||
|
return Array.with(
|
||||||
|
new EnemySpawn(Enemy.class){{
|
||||||
|
scaling = 1;
|
||||||
|
before = 3;
|
||||||
|
}},
|
||||||
|
|
||||||
|
new EnemySpawn(FastEnemy.class){{
|
||||||
|
scaling = 1;
|
||||||
|
after = 3;
|
||||||
|
spacing = 5;
|
||||||
|
amount = 4;
|
||||||
|
tierscaleback = 0;
|
||||||
|
}},
|
||||||
|
|
||||||
|
new EnemySpawn(BlastEnemy.class){{
|
||||||
|
after = 4;
|
||||||
|
amount = 3;
|
||||||
|
spacing = 5;
|
||||||
|
scaling = 1;
|
||||||
|
tierscaleback = 0;
|
||||||
|
}},
|
||||||
|
|
||||||
|
new EnemySpawn(TankEnemy.class){{
|
||||||
|
after = 5;
|
||||||
|
spacing = 5;
|
||||||
|
scaling = 1;
|
||||||
|
amount = 2;
|
||||||
|
}},
|
||||||
|
|
||||||
|
new EnemySpawn(RapidEnemy.class){{
|
||||||
|
after = 7;
|
||||||
|
spacing = 5;
|
||||||
|
scaling = 2;
|
||||||
|
amount = 3;
|
||||||
|
}},
|
||||||
|
|
||||||
|
new EnemySpawn(HealerEnemy.class){{
|
||||||
|
after = 5;
|
||||||
|
spacing = 5;
|
||||||
|
scaling = 1;
|
||||||
|
amount = 1;
|
||||||
|
}},
|
||||||
|
|
||||||
|
new EnemySpawn(TitanEnemy.class){{
|
||||||
|
after = 6;
|
||||||
|
amount = 2;
|
||||||
|
spacing = 5;
|
||||||
|
scaling = 3;
|
||||||
|
}},
|
||||||
|
|
||||||
|
new EnemySpawn(FlamerEnemy.class){{
|
||||||
|
after = 12;
|
||||||
|
amount = 3;
|
||||||
|
spacing = 5;
|
||||||
|
scaling = 2;
|
||||||
|
}},
|
||||||
|
|
||||||
|
new EnemySpawn(BlastEnemy.class){{
|
||||||
|
after = 4 + 5 + 5;
|
||||||
|
amount = 3;
|
||||||
|
spacing = 5;
|
||||||
|
scaling = 1;
|
||||||
|
tierscaleback = 0;
|
||||||
|
}},
|
||||||
|
//boss wave
|
||||||
|
new EnemySpawn(FortressEnemy.class){{
|
||||||
|
after = 16;
|
||||||
|
amount = 2;
|
||||||
|
spacing = 5;
|
||||||
|
scaling = 1;
|
||||||
|
}},
|
||||||
|
|
||||||
|
new EnemySpawn(TitanEnemy.class){{
|
||||||
|
after = 16;
|
||||||
|
amount = 2;
|
||||||
|
spacing = 5;
|
||||||
|
scaling = 3;
|
||||||
|
tierscaleback = 0;
|
||||||
|
}},
|
||||||
|
|
||||||
|
new EnemySpawn(HealerEnemy.class){{
|
||||||
|
after = 16;
|
||||||
|
spacing = 5;
|
||||||
|
scaling = 1;
|
||||||
|
amount = 2;
|
||||||
|
}},
|
||||||
|
//end boss wave
|
||||||
|
|
||||||
|
//enchanced boss wave
|
||||||
|
new EnemySpawn(MortarEnemy.class){{
|
||||||
|
after = 16 + 5;
|
||||||
|
amount = 1;
|
||||||
|
spacing = 5;
|
||||||
|
scaling = 1;
|
||||||
|
}},
|
||||||
|
|
||||||
|
new EnemySpawn(EmpEnemy.class){{
|
||||||
|
after = 16 + 5;
|
||||||
|
amount = 1;
|
||||||
|
spacing = 5;
|
||||||
|
scaling = 1;
|
||||||
|
}}
|
||||||
|
//end enchanced boss wave
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Array<EnemySpawn> getSpawnsOld(){
|
||||||
|
return Array.with(
|
||||||
|
new EnemySpawn(Enemy.class){{
|
||||||
|
scaling = 2;
|
||||||
|
before = 4;
|
||||||
|
}},
|
||||||
|
new EnemySpawn(Enemy.class){{
|
||||||
|
scaling = 3;
|
||||||
|
tierscaleback = 3;
|
||||||
|
spacing = 2;
|
||||||
|
after = 4;
|
||||||
|
}},
|
||||||
|
new EnemySpawn(TitanEnemy.class){{
|
||||||
|
after = 5;
|
||||||
|
spacing = 2;
|
||||||
|
scaling = 5;
|
||||||
|
}},
|
||||||
|
new EnemySpawn(FortressEnemy.class){{
|
||||||
|
after = 12;
|
||||||
|
spacing = 3;
|
||||||
|
scaling = 5;
|
||||||
|
}},
|
||||||
|
new EnemySpawn(HealerEnemy.class){{
|
||||||
|
scaling = 3;
|
||||||
|
spacing = 2;
|
||||||
|
after = 8;
|
||||||
|
}},
|
||||||
|
new EnemySpawn(FastEnemy.class){{
|
||||||
|
after = 2;
|
||||||
|
scaling = 3;
|
||||||
|
}},
|
||||||
|
new EnemySpawn(FlamerEnemy.class){{
|
||||||
|
after = 14;
|
||||||
|
spacing = 5;
|
||||||
|
scaling = 2;
|
||||||
|
}},
|
||||||
|
new EnemySpawn(BlastEnemy.class){{
|
||||||
|
after = 12;
|
||||||
|
spacing = 2;
|
||||||
|
scaling = 3;
|
||||||
|
}},
|
||||||
|
new EnemySpawn(RapidEnemy.class){{
|
||||||
|
after = 7;
|
||||||
|
spacing = 3;
|
||||||
|
scaling = 3;
|
||||||
|
}},
|
||||||
|
new EnemySpawn(EmpEnemy.class){{
|
||||||
|
after = 19;
|
||||||
|
spacing = 3;
|
||||||
|
scaling = 5;
|
||||||
|
}},
|
||||||
|
new EnemySpawn(TankEnemy.class){{
|
||||||
|
after = 4;
|
||||||
|
spacing = 2;
|
||||||
|
scaling = 3;
|
||||||
|
}},
|
||||||
|
new EnemySpawn(MortarEnemy.class){{
|
||||||
|
after = 20;
|
||||||
|
spacing = 3;
|
||||||
|
scaling = 5;
|
||||||
|
}}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void testWaves(int from, int to){
|
||||||
|
Array<EnemySpawn> spawns = getSpawns();
|
||||||
|
for(int i = from; i <= to; i ++){
|
||||||
|
System.out.print(i+": ");
|
||||||
|
int total = 0;
|
||||||
|
for(EnemySpawn spawn : spawns){
|
||||||
|
int a = spawn.evaluate(i, 0);
|
||||||
|
int t = spawn.tier(i, 0);
|
||||||
|
total += a;
|
||||||
|
|
||||||
|
if(a > 0){
|
||||||
|
System.out.print(a+"x" + ClassReflection.getSimpleName(spawn.type) + "-" + t + " ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
System.out.print(" (" + total + ")");
|
||||||
|
System.out.println();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,10 +7,9 @@ import io.anuke.mindustry.entities.TileEntity;
|
|||||||
|
|
||||||
public class BlastEnemy extends Enemy{
|
public class BlastEnemy extends Enemy{
|
||||||
|
|
||||||
public BlastEnemy(int spawn) {
|
public BlastEnemy() {
|
||||||
super(spawn);
|
|
||||||
maxhealth = 30;
|
maxhealth = 30;
|
||||||
speed = 0.65f;
|
speed = 0.7f;
|
||||||
bullet = null;
|
bullet = null;
|
||||||
turretrotatespeed = 0f;
|
turretrotatespeed = 0f;
|
||||||
mass = 0.8f;
|
mass = 0.8f;
|
||||||
|
|||||||
@@ -4,8 +4,7 @@ import io.anuke.mindustry.entities.BulletType;
|
|||||||
|
|
||||||
public class EmpEnemy extends Enemy{
|
public class EmpEnemy extends Enemy{
|
||||||
|
|
||||||
public EmpEnemy(int spawn) {
|
public EmpEnemy() {
|
||||||
super(spawn);
|
|
||||||
|
|
||||||
speed = 0.27f;
|
speed = 0.27f;
|
||||||
reload = 70;
|
reload = 70;
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ public class Enemy extends DestructibleEntity{
|
|||||||
public final static Color[] tierColors = { Color.valueOf("ffe451"), Color.valueOf("f48e20"), Color.valueOf("ff6757"), Color.valueOf("ff2d86") };
|
public final static Color[] tierColors = { Color.valueOf("ffe451"), Color.valueOf("f48e20"), Color.valueOf("ff6757"), Color.valueOf("ff2d86") };
|
||||||
public final static int maxtier = 4;
|
public final static int maxtier = 4;
|
||||||
|
|
||||||
protected float speed = 0.3f;
|
protected float speed = 0.4f;
|
||||||
protected float reload = 32;
|
protected float reload = 32;
|
||||||
protected float range = 60;
|
protected float range = 60;
|
||||||
protected float length = 4;
|
protected float length = 4;
|
||||||
@@ -47,9 +47,7 @@ public class Enemy extends DestructibleEntity{
|
|||||||
public Entity target;
|
public Entity target;
|
||||||
public int tier = 1;
|
public int tier = 1;
|
||||||
|
|
||||||
public Enemy(int spawn) {
|
public Enemy() {
|
||||||
this.spawn = spawn;
|
|
||||||
|
|
||||||
hitbox.setSize(5f);
|
hitbox.setSize(5f);
|
||||||
hitboxTile.setSize(4f);
|
hitboxTile.setSize(4f);
|
||||||
|
|
||||||
|
|||||||
@@ -2,14 +2,13 @@ package io.anuke.mindustry.entities.enemies;
|
|||||||
|
|
||||||
public class FastEnemy extends Enemy{
|
public class FastEnemy extends Enemy{
|
||||||
|
|
||||||
public FastEnemy(int spawn) {
|
public FastEnemy() {
|
||||||
super(spawn);
|
|
||||||
|
|
||||||
speed = 0.7f;
|
speed = 0.73f;
|
||||||
reload = 30;
|
reload = 25;
|
||||||
mass = 0.2f;
|
mass = 0.2f;
|
||||||
|
|
||||||
maxhealth = 30;
|
maxhealth = 40;
|
||||||
heal();
|
heal();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,8 +4,7 @@ import io.anuke.mindustry.entities.BulletType;
|
|||||||
|
|
||||||
public class FlamerEnemy extends Enemy{
|
public class FlamerEnemy extends Enemy{
|
||||||
|
|
||||||
public FlamerEnemy(int spawn) {
|
public FlamerEnemy() {
|
||||||
super(spawn);
|
|
||||||
|
|
||||||
speed = 0.35f;
|
speed = 0.35f;
|
||||||
|
|
||||||
|
|||||||
@@ -13,10 +13,9 @@ public class FortressEnemy extends Enemy{
|
|||||||
float spawnTime = 240;
|
float spawnTime = 240;
|
||||||
boolean deployed;
|
boolean deployed;
|
||||||
|
|
||||||
public FortressEnemy(int spawn) {
|
public FortressEnemy() {
|
||||||
super(spawn);
|
|
||||||
|
|
||||||
speed = 0.12f;
|
speed = 0.2f;
|
||||||
reload = 90;
|
reload = 90;
|
||||||
maxhealth = 700;
|
maxhealth = 700;
|
||||||
range = 70f;
|
range = 70f;
|
||||||
@@ -38,7 +37,8 @@ public class FortressEnemy extends Enemy{
|
|||||||
if(Timers.get(this, "spawn", spawnTime) && spawned < maxSpawn){
|
if(Timers.get(this, "spawn", spawnTime) && spawned < maxSpawn){
|
||||||
Angles.translation(angle, 20f);
|
Angles.translation(angle, 20f);
|
||||||
|
|
||||||
FastEnemy enemy = new FastEnemy(spawn);
|
FastEnemy enemy = new FastEnemy();
|
||||||
|
enemy.spawn = spawn;
|
||||||
enemy.tier = this.tier;
|
enemy.tier = this.tier;
|
||||||
enemy.spawner = this;
|
enemy.spawner = this;
|
||||||
enemy.set(x + Angles.x(), y + Angles.y());
|
enemy.set(x + Angles.x(), y + Angles.y());
|
||||||
|
|||||||
@@ -13,8 +13,7 @@ import io.anuke.ucore.util.Angles;
|
|||||||
|
|
||||||
public class HealerEnemy extends Enemy{
|
public class HealerEnemy extends Enemy{
|
||||||
|
|
||||||
public HealerEnemy(int spawn) {
|
public HealerEnemy() {
|
||||||
super(spawn);
|
|
||||||
|
|
||||||
speed = 0.2f;
|
speed = 0.2f;
|
||||||
reload = 14;
|
reload = 14;
|
||||||
|
|||||||
@@ -4,11 +4,10 @@ import io.anuke.mindustry.entities.BulletType;
|
|||||||
|
|
||||||
public class MortarEnemy extends Enemy{
|
public class MortarEnemy extends Enemy{
|
||||||
|
|
||||||
public MortarEnemy(int spawn) {
|
public MortarEnemy() {
|
||||||
super(spawn);
|
|
||||||
|
|
||||||
maxhealth = 200;
|
maxhealth = 200;
|
||||||
speed = 0.2f;
|
speed = 0.25f;
|
||||||
reload = 100f;
|
reload = 100f;
|
||||||
bullet = BulletType.shell;
|
bullet = BulletType.shell;
|
||||||
turretrotatespeed = 0.15f;
|
turretrotatespeed = 0.15f;
|
||||||
|
|||||||
@@ -4,14 +4,13 @@ import io.anuke.mindustry.entities.BulletType;
|
|||||||
|
|
||||||
public class RapidEnemy extends Enemy{
|
public class RapidEnemy extends Enemy{
|
||||||
|
|
||||||
public RapidEnemy(int spawn) {
|
public RapidEnemy() {
|
||||||
super(spawn);
|
|
||||||
|
|
||||||
reload = 8;
|
reload = 8;
|
||||||
bullet = BulletType.purple;
|
bullet = BulletType.purple;
|
||||||
rotatespeed = 0.08f;
|
rotatespeed = 0.08f;
|
||||||
maxhealth = 260;
|
maxhealth = 260;
|
||||||
speed = 0.27f;
|
speed = 0.33f;
|
||||||
heal();
|
heal();
|
||||||
hitbox.setSize(8f);
|
hitbox.setSize(8f);
|
||||||
mass = 3f;
|
mass = 3f;
|
||||||
|
|||||||
@@ -7,11 +7,10 @@ import io.anuke.ucore.util.Angles;
|
|||||||
|
|
||||||
public class TankEnemy extends Enemy{
|
public class TankEnemy extends Enemy{
|
||||||
|
|
||||||
public TankEnemy(int spawn) {
|
public TankEnemy() {
|
||||||
super(spawn);
|
|
||||||
|
|
||||||
maxhealth = 350;
|
maxhealth = 350;
|
||||||
speed = 0.2f;
|
speed = 0.24f;
|
||||||
reload = 90f;
|
reload = 90f;
|
||||||
rotatespeed = 0.06f;
|
rotatespeed = 0.06f;
|
||||||
bullet = BulletType.small;
|
bullet = BulletType.small;
|
||||||
|
|||||||
@@ -9,8 +9,7 @@ import io.anuke.ucore.core.Timers;
|
|||||||
|
|
||||||
public class TargetEnemy extends Enemy{
|
public class TargetEnemy extends Enemy{
|
||||||
|
|
||||||
public TargetEnemy(int spawn){
|
public TargetEnemy(){
|
||||||
super(0);
|
|
||||||
speed = 0f;
|
speed = 0f;
|
||||||
maxhealth = 10;
|
maxhealth = 10;
|
||||||
}
|
}
|
||||||
@@ -48,7 +47,7 @@ public class TargetEnemy extends Enemy{
|
|||||||
public void onDeath(){
|
public void onDeath(){
|
||||||
super.onDeath();
|
super.onDeath();
|
||||||
Timers.run(100f, ()->{
|
Timers.run(100f, ()->{
|
||||||
new TargetEnemy(0).set(x, y).add();
|
new TargetEnemy().set(x, y).add();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,8 +5,7 @@ import io.anuke.ucore.core.Timers;
|
|||||||
public class TestEnemy extends Enemy{
|
public class TestEnemy extends Enemy{
|
||||||
boolean dir = false;
|
boolean dir = false;
|
||||||
|
|
||||||
public TestEnemy(int spawn) {
|
public TestEnemy() {
|
||||||
super(spawn);
|
|
||||||
maxhealth = 99999;
|
maxhealth = 99999;
|
||||||
heal();
|
heal();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,12 +7,11 @@ import io.anuke.ucore.util.Mathf;
|
|||||||
|
|
||||||
public class TitanEnemy extends Enemy{
|
public class TitanEnemy extends Enemy{
|
||||||
|
|
||||||
public TitanEnemy(int spawn) {
|
public TitanEnemy() {
|
||||||
super(spawn);
|
|
||||||
|
|
||||||
speed = 0.14f;
|
speed = 0.22f;
|
||||||
reload = 30;
|
reload = 30;
|
||||||
maxhealth = 400;
|
maxhealth = 421;
|
||||||
range = 60f;
|
range = 60f;
|
||||||
bullet = BulletType.small;
|
bullet = BulletType.small;
|
||||||
hitbox.setSize(7f);
|
hitbox.setSize(7f);
|
||||||
@@ -27,7 +26,7 @@ public class TitanEnemy extends Enemy{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
void updateShooting(){
|
void updateShooting(){
|
||||||
Timers.get(this, "salvo", 250);
|
Timers.get(this, "salvo", 240);
|
||||||
|
|
||||||
if(Timers.getTime(this, "salvo") < 60){
|
if(Timers.getTime(this, "salvo") < 60){
|
||||||
if(Timers.get(this, "salvoShoot", 6)){
|
if(Timers.get(this, "salvoShoot", 6)){
|
||||||
@@ -35,7 +34,7 @@ public class TitanEnemy extends Enemy{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Timers.get(this, "shotgun", 90)){
|
if(Timers.get(this, "shotgun", 80)){
|
||||||
Angles.shotgun(5, 10f, 0f, f->{
|
Angles.shotgun(5, 10f, 0f, f->{
|
||||||
shoot(BulletType.smallSlow, f);
|
shoot(BulletType.smallSlow, f);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package io.anuke.mindustry.entities.enemies.flying;
|
||||||
|
|
||||||
|
import io.anuke.mindustry.entities.enemies.Enemy;
|
||||||
|
|
||||||
|
public class FlyingEnemy extends Enemy{
|
||||||
|
|
||||||
|
public FlyingEnemy() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -7,6 +7,8 @@ import com.badlogic.gdx.Input.Keys;
|
|||||||
import com.badlogic.gdx.math.Vector2;
|
import com.badlogic.gdx.math.Vector2;
|
||||||
|
|
||||||
import io.anuke.mindustry.Vars;
|
import io.anuke.mindustry.Vars;
|
||||||
|
import io.anuke.mindustry.core.GameState;
|
||||||
|
import io.anuke.mindustry.core.GameState.State;
|
||||||
import io.anuke.mindustry.resource.ItemStack;
|
import io.anuke.mindustry.resource.ItemStack;
|
||||||
import io.anuke.mindustry.resource.Weapon;
|
import io.anuke.mindustry.resource.Weapon;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
@@ -23,7 +25,7 @@ public class Input{
|
|||||||
//player is dead
|
//player is dead
|
||||||
if(player.health <= 0) return;
|
if(player.health <= 0) return;
|
||||||
|
|
||||||
if(Inputs.scrolled()){
|
if(Inputs.scrolled() && GameState.is(State.playing)){
|
||||||
Vars.renderer.scaleCamera(Inputs.scroll());
|
Vars.renderer.scaleCamera(Inputs.scroll());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -357,7 +357,8 @@ public class SaveIO{
|
|||||||
int health = stream.readInt();
|
int health = stream.readInt();
|
||||||
|
|
||||||
try{
|
try{
|
||||||
Enemy enemy = (Enemy)ClassReflection.getConstructor(enemyIDs.get(type), int.class).newInstance(lane);
|
Enemy enemy = ClassReflection.newInstance(enemyIDs.get(type));
|
||||||
|
enemy.spawn = lane;
|
||||||
enemy.health = health;
|
enemy.health = health;
|
||||||
enemy.x = x;
|
enemy.x = x;
|
||||||
enemy.y = y;
|
enemy.y = y;
|
||||||
|
|||||||
@@ -9,4 +9,8 @@ public class ItemStack{
|
|||||||
this.item = item;
|
this.item = item;
|
||||||
this.amount = amount;
|
this.amount = amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean equals(ItemStack other){
|
||||||
|
return other != null && other.item == item && other.amount == amount;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ public enum Recipe{
|
|||||||
duriumwalllarge(defense, DefenseBlocks.diriumwalllarge, stack(Item.dirium, 8)),
|
duriumwalllarge(defense, DefenseBlocks.diriumwalllarge, stack(Item.dirium, 8)),
|
||||||
door(defense, DefenseBlocks.door, stack(Item.steel, 3), stack(Item.iron, 3)),
|
door(defense, DefenseBlocks.door, stack(Item.steel, 3), stack(Item.iron, 3)),
|
||||||
largedoor(defense, DefenseBlocks.largedoor, stack(Item.steel, 3*4), stack(Item.iron, 3*4)),
|
largedoor(defense, DefenseBlocks.largedoor, stack(Item.steel, 3*4), stack(Item.iron, 3*4)),
|
||||||
titaniumshieldwall(defense, DefenseBlocks.titaniumshieldwall, stack(Item.titanium, 2)),
|
titaniumshieldwall(defense, DefenseBlocks.titaniumshieldwall, stack(Item.titanium, 3)),
|
||||||
|
|
||||||
conveyor(distribution, DistributionBlocks.conveyor, stack(Item.stone, 1)),
|
conveyor(distribution, DistributionBlocks.conveyor, stack(Item.stone, 1)),
|
||||||
steelconveyor(distribution, DistributionBlocks.steelconveyor, stack(Item.steel, 1)),
|
steelconveyor(distribution, DistributionBlocks.steelconveyor, stack(Item.steel, 1)),
|
||||||
@@ -43,36 +43,36 @@ public enum Recipe{
|
|||||||
mortarturret(weapon, WeaponBlocks.mortarturret, stack(Item.steel, 20), stack(Item.titanium, 15)),
|
mortarturret(weapon, WeaponBlocks.mortarturret, stack(Item.steel, 20), stack(Item.titanium, 15)),
|
||||||
teslaturret(weapon, WeaponBlocks.teslaturret, stack(Item.steel, 10), stack(Item.titanium, 15), stack(Item.dirium, 15)),
|
teslaturret(weapon, WeaponBlocks.teslaturret, stack(Item.steel, 10), stack(Item.titanium, 15), stack(Item.dirium, 15)),
|
||||||
plasmaturret(weapon, WeaponBlocks.plasmaturret, stack(Item.steel, 10), stack(Item.titanium, 10), stack(Item.dirium, 15)),
|
plasmaturret(weapon, WeaponBlocks.plasmaturret, stack(Item.steel, 10), stack(Item.titanium, 10), stack(Item.dirium, 15)),
|
||||||
chainturret(weapon, WeaponBlocks.chainturret, stack(Item.steel, 10), stack(Item.titanium, 10), stack(Item.dirium, 15)),
|
chainturret(weapon, WeaponBlocks.chainturret, stack(Item.steel, 35), stack(Item.titanium, 25), stack(Item.dirium, 35)),
|
||||||
titanturret(weapon, WeaponBlocks.titanturret, stack(Item.steel, 10), stack(Item.titanium, 10), stack(Item.dirium, 15)),
|
titanturret(weapon, WeaponBlocks.titanturret, stack(Item.steel, 50), stack(Item.titanium, 45), stack(Item.dirium, 55)),
|
||||||
|
|
||||||
smelter(crafting, ProductionBlocks.smelter, stack(Item.stone, 40), stack(Item.iron, 40)),
|
smelter(crafting, ProductionBlocks.smelter, stack(Item.stone, 40), stack(Item.iron, 40)),
|
||||||
crucible(crafting, ProductionBlocks.crucible, stack(Item.titanium, 40), stack(Item.steel, 40)),
|
crucible(crafting, ProductionBlocks.crucible, stack(Item.titanium, 40), stack(Item.steel, 40)),
|
||||||
coalpurifier(crafting, ProductionBlocks.coalpurifier, stack(Item.steel, 10), stack(Item.iron, 10)),
|
coalpurifier(crafting, ProductionBlocks.coalpurifier, stack(Item.steel, 10), stack(Item.iron, 10)),
|
||||||
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, 30), stack(Item.iron, 30)),
|
oilrefinery(crafting, ProductionBlocks.oilrefinery, stack(Item.steel, 15), stack(Item.iron, 15)),
|
||||||
stoneformer(crafting, ProductionBlocks.stoneformer, stack(Item.steel, 30), stack(Item.iron, 30)),
|
stoneformer(crafting, ProductionBlocks.stoneformer, stack(Item.steel, 10), stack(Item.iron, 10)),
|
||||||
lavasmelter(crafting, ProductionBlocks.lavasmelter, stack(Item.steel, 30), stack(Item.iron, 30)),
|
lavasmelter(crafting, ProductionBlocks.lavasmelter, stack(Item.steel, 20), stack(Item.iron, 20), stack(Item.titanium, 10)),
|
||||||
|
|
||||||
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)),
|
||||||
coaldrill(production, ProductionBlocks.coaldrill, stack(Item.stone, 25), stack(Item.iron, 40)),
|
coaldrill(production, ProductionBlocks.coaldrill, stack(Item.stone, 25), stack(Item.iron, 40)),
|
||||||
titaniumdrill(production, ProductionBlocks.titaniumdrill, stack(Item.iron, 40), stack(Item.steel, 40)),
|
titaniumdrill(production, ProductionBlocks.titaniumdrill, stack(Item.iron, 40), stack(Item.steel, 40)),
|
||||||
uraniumdrill(production, ProductionBlocks.uraniumdrill, stack(Item.titanium, 20), stack(Item.steel, 40)),
|
uraniumdrill(production, ProductionBlocks.uraniumdrill, stack(Item.iron, 40), stack(Item.steel, 40)),
|
||||||
omnidrill(production, ProductionBlocks.omnidrill, stack(Item.titanium, 20), stack(Item.dirium, 20)),
|
omnidrill(production, ProductionBlocks.omnidrill, stack(Item.titanium, 30), stack(Item.dirium, 20)),
|
||||||
|
|
||||||
coalgenerator(power, ProductionBlocks.coalgenerator, stack(Item.titanium, 10), stack(Item.dirium, 10)),
|
coalgenerator(power, ProductionBlocks.coalgenerator, stack(Item.iron, 30), stack(Item.stone, 20)),
|
||||||
thermalgenerator(power, ProductionBlocks.thermalgenerator, stack(Item.titanium, 10), stack(Item.dirium, 10)),
|
thermalgenerator(power, ProductionBlocks.thermalgenerator, stack(Item.steel, 30), stack(Item.iron, 30)),
|
||||||
combustiongenerator(power, ProductionBlocks.combustiongenerator, stack(Item.titanium, 10), stack(Item.dirium, 10)),
|
combustiongenerator(power, ProductionBlocks.combustiongenerator, stack(Item.iron, 30), stack(Item.stone, 20)),
|
||||||
rtgenerator(power, ProductionBlocks.rtgenerator, stack(Item.titanium, 10), stack(Item.dirium, 10)),
|
rtgenerator(power, ProductionBlocks.rtgenerator, stack(Item.titanium, 20), stack(Item.steel, 20)),
|
||||||
nuclearreactor(power, ProductionBlocks.nuclearReactor, stack(Item.titanium, 10), stack(Item.dirium, 10)),
|
nuclearreactor(power, ProductionBlocks.nuclearReactor, stack(Item.titanium, 40), stack(Item.dirium, 40), stack(Item.steel, 50)),
|
||||||
powerbooster(power, DistributionBlocks.powerbooster, stack(Item.titanium, 10), stack(Item.dirium, 10)),
|
powerbooster(power, DistributionBlocks.powerbooster, stack(Item.steel, 8), stack(Item.iron, 8)),
|
||||||
powerlaser(power, DistributionBlocks.powerlaser, stack(Item.titanium, 10), stack(Item.dirium, 10)),
|
powerlaser(power, DistributionBlocks.powerlaser, stack(Item.steel, 3), stack(Item.iron, 3)),
|
||||||
powerlaserrouter(power, DistributionBlocks.powerlaserrouter, stack(Item.titanium, 10), stack(Item.dirium, 10)),
|
powerlaserrouter(power, DistributionBlocks.powerlaserrouter, stack(Item.steel, 5), stack(Item.iron, 5)),
|
||||||
|
|
||||||
shieldgenerator(power, DefenseBlocks.shieldgenerator, stack(Item.titanium, 10), stack(Item.dirium, 10)),
|
shieldgenerator(power, DefenseBlocks.shieldgenerator, stack(Item.titanium, 30), stack(Item.dirium, 40)),
|
||||||
|
|
||||||
teleporter(distribution, DistributionBlocks.teleporter, stack(Item.titanium, 10), stack(Item.dirium, 10)),
|
teleporter(distribution, DistributionBlocks.teleporter, stack(Item.steel, 20), stack(Item.dirium, 15)),
|
||||||
|
|
||||||
healturret(power, DefenseBlocks.repairturret, stack(Item.iron, 30)),
|
healturret(power, DefenseBlocks.repairturret, stack(Item.iron, 30)),
|
||||||
megahealturret(power, DefenseBlocks.megarepairturret, stack(Item.iron, 20), stack(Item.steel, 30)),
|
megahealturret(power, DefenseBlocks.megarepairturret, stack(Item.iron, 20), stack(Item.steel, 30)),
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ public class LoadDialog extends FloatingDialog{
|
|||||||
for(int i = 0; i < Vars.saveSlots; i++){
|
for(int i = 0; i < Vars.saveSlots; i++){
|
||||||
final int slot = i;
|
final int slot = i;
|
||||||
|
|
||||||
TextButton button = new TextButton("[orange]Slot " + (i + 1));
|
TextButton button = new TextButton("[accent]Slot " + (i + 1));
|
||||||
button.pad(Unit.dp.inPixels(12));
|
button.pad(Unit.dp.inPixels(12));
|
||||||
button.getLabelCell().top().left().growX();
|
button.getLabelCell().top().left().growX();
|
||||||
|
|
||||||
|
|||||||
@@ -86,11 +86,11 @@ public class Generator{
|
|||||||
floor = Blocks.coal;
|
floor = Blocks.coal;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Noise.nnoise(x + 9999, y + 9999, 8, 1) > 0.253){
|
if(Noise.nnoise(x + 9999, y + 9999, 8, 1) > 0.264){
|
||||||
floor = Blocks.titanium;
|
floor = Blocks.titanium;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Noise.nnoise(x + 99999, y + 99999, 7, 1) > 0.258){
|
if(Noise.nnoise(x + 99999, y + 99999, 7, 1) > 0.259){
|
||||||
floor = Blocks.uranium;
|
floor = Blocks.uranium;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -112,7 +112,7 @@ public class Generator{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(color == Hue.rgb(Color.PURPLE)){
|
if(color == Hue.rgb(Color.PURPLE)){
|
||||||
if(!Vars.android) new TargetEnemy(0).set(x * Vars.tilesize, y * Vars.tilesize).add();
|
if(!Vars.android) new TargetEnemy().set(x * Vars.tilesize, y * Vars.tilesize).add();
|
||||||
floor = Blocks.stone;
|
floor = Blocks.stone;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -151,6 +151,7 @@ public class ProductionBlocks{
|
|||||||
stonedrill = new Drill("stonedrill"){{
|
stonedrill = new Drill("stonedrill"){{
|
||||||
resource = Blocks.stone;
|
resource = Blocks.stone;
|
||||||
result = Item.stone;
|
result = Item.stone;
|
||||||
|
time = 4;
|
||||||
formalName = "stone drill";
|
formalName = "stone drill";
|
||||||
description = "Mines 1 "+resource.name+" every "+time+" seconds.";
|
description = "Mines 1 "+resource.name+" every "+time+" seconds.";
|
||||||
fullDescription = "The essential drill. When placed on stone tiles, outputs stone at a slow pace indefinitely.";
|
fullDescription = "The essential drill. When placed on stone tiles, outputs stone at a slow pace indefinitely.";
|
||||||
|
|||||||
@@ -74,8 +74,8 @@ public class WeaponBlocks{
|
|||||||
bullet = BulletType.iron;
|
bullet = BulletType.iron;
|
||||||
ammo = Item.iron;
|
ammo = Item.iron;
|
||||||
health = 70;
|
health = 70;
|
||||||
shots = 7;
|
shots = 5;
|
||||||
inaccuracy = 30f;
|
inaccuracy = 15f;
|
||||||
shotDelayScale = 0.7f;
|
shotDelayScale = 0.7f;
|
||||||
fullDescription = "A standard turret. Uses iron for ammo. Shoots a spread of 7 bullets. "
|
fullDescription = "A standard turret. Uses iron for ammo. Shoots a spread of 7 bullets. "
|
||||||
+ "Lower range, but higher damage output than the gattling turret.";
|
+ "Lower range, but higher damage output than the gattling turret.";
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ public class Wall extends Block{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean canReplace(Block other){
|
public boolean canReplace(Block other){
|
||||||
return other instanceof Wall;
|
return other instanceof Wall && health > other.health;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -228,6 +228,7 @@ public class Turret extends Block{
|
|||||||
bullet(tile, entity.rotation + Mathf.range(inaccuracy));
|
bullet(tile, entity.rotation + Mathf.range(inaccuracy));
|
||||||
}else{
|
}else{
|
||||||
Timers.run(i * shotDelayScale, ()->{
|
Timers.run(i * shotDelayScale, ()->{
|
||||||
|
Angles.translation(entity.rotation, width * Vars.tilesize / 2f);
|
||||||
bullet(tile, entity.rotation + Mathf.range(inaccuracy));
|
bullet(tile, entity.rotation + Mathf.range(inaccuracy));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ public class Drill extends Block{
|
|||||||
@Override
|
@Override
|
||||||
public void update(Tile tile){
|
public void update(Tile tile){
|
||||||
|
|
||||||
if(tile.floor() == resource && Timers.get(tile, "drill", 60 * time) && tile.entity.totalItems() < capacity){
|
if((tile.floor() == resource || (resource.drops.equals(tile.floor().drops))) && Timers.get(tile, "drill", 60 * time) && tile.entity.totalItems() < capacity){
|
||||||
offloadNear(tile, result);
|
offloadNear(tile, result);
|
||||||
Effects.effect(Fx.spark, tile.worldx(), tile.worldy());
|
Effects.effect(Fx.spark, tile.worldx(), tile.worldy());
|
||||||
}
|
}
|
||||||
@@ -45,7 +45,7 @@ public class Drill extends Block{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawOver(Tile tile){
|
public void drawOver(Tile tile){
|
||||||
if(tile.floor() != resource && resource != null){
|
if(tile.floor() != resource && !(resource.drops.equals(tile.floor().drops)) && resource != null){
|
||||||
Draw.colorl(0.85f + Mathf.absin(Timers.time(), 6f, 0.15f));
|
Draw.colorl(0.85f + Mathf.absin(Timers.time(), 6f, 0.15f));
|
||||||
Draw.rect("cross", tile.worldx(), tile.worldy());
|
Draw.rect("cross", tile.worldx(), tile.worldy());
|
||||||
Draw.color();
|
Draw.color();
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ public class Generator extends PowerBlock{
|
|||||||
Effects.effect(Fx.shockwave, x, y);
|
Effects.effect(Fx.shockwave, x, y);
|
||||||
|
|
||||||
Timers.run(12f + Mathf.random(20f), () -> {
|
Timers.run(12f + Mathf.random(20f), () -> {
|
||||||
tile.damageNearby(3, 40, 0f);
|
tile.damageNearby(4, 40, 0f);
|
||||||
});
|
});
|
||||||
|
|
||||||
Effects.sound(explosionSound, x, y);
|
Effects.sound(explosionSound, x, y);
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user