Balanced multiple generators, bugfixes, made some turrets use power

This commit is contained in:
Anuken
2017-11-07 12:28:33 -05:00
parent 7e3e34ffe1
commit 01f5fccf96
23 changed files with 353 additions and 203 deletions

View File

@@ -15,7 +15,7 @@ import io.anuke.ucore.util.Angles;
import io.anuke.ucore.util.Mathf;
public class EMP extends TimedEntity{
static final int maxTargets = 8;
static final int maxTargets = 10;
static Array<Tile> array = new Array<>();
int radius = 4;
@@ -53,6 +53,7 @@ public class EMP extends TimedEntity{
if(tile.block() instanceof PowerAcceptor){
PowerAcceptor p = (PowerAcceptor)tile.block();
tile.entity.damage(damage*2); //extra damage
p.setPower(tile, 0f);
}

View File

@@ -39,7 +39,7 @@ public class TeslaOrb extends Entity{
if(Mathf.chance(stopchance)){
break;
}
Array<SolidEntity> enemies = Entities.getNearby(curx, cury, range);
Array<SolidEntity> enemies = Entities.getNearby(curx, cury, range*2f);
for(SolidEntity entity : enemies){
if(entity instanceof Enemy && entity.distanceTo(curx, cury) < range

View File

@@ -1,7 +1,9 @@
package io.anuke.mindustry.entities.enemies;
import io.anuke.mindustry.Vars;
import io.anuke.mindustry.entities.Bullet;
import io.anuke.mindustry.entities.BulletType;
import io.anuke.mindustry.entities.TileEntity;
public class BlastEnemy extends Enemy{
@@ -17,7 +19,13 @@ public class BlastEnemy extends Enemy{
void move(){
super.move();
if(target != null && target.distanceTo(this) < 10f){
float range = 10f;
if(target instanceof TileEntity){
TileEntity e = (TileEntity)target;
range = (e.tile.block().width * Vars.tilesize) /2f + 6f;
}
if(target != null && target.distanceTo(this) < range){
Bullet b = new Bullet(BulletType.blast, this, x, y, 0).add();
b.damage = BulletType.blast.damage + (tier-1) * 40;
damage(999);

View File

@@ -101,7 +101,7 @@ public class Enemy extends DestructibleEntity{
int cindex = -1;
float dst = Float.MAX_VALUE;
//find closest node index
for(Tile tile : path){
if(Vector2.dst(tile.worldx(), tile.worldy(), x, y) < dst){
dst = Vector2.dst(tile.worldx(), tile.worldy(), x, y);
@@ -111,11 +111,13 @@ public class Enemy extends DestructibleEntity{
index ++;
}
//set node to that index
node = cindex;
int x2 = path[node].x, y2 = path[node].y;
if(World.raycast(Mathf.scl2(x, Vars.tilesize), Mathf.scl2(y, Vars.tilesize), x2, y2) != null){
//if the enemy can move to that node right now, set its position to it
if(World.raycast(Mathf.scl2(x, Vars.tilesize), Mathf.scl2(y, Vars.tilesize), x2, y2) == null){
Timers.run(Mathf.random(15f), ()->{
set(x2 * Vars.tilesize, y2 * Vars.tilesize);
});

View File

@@ -12,13 +12,12 @@ import io.anuke.ucore.graphics.Hue;
import io.anuke.ucore.util.Angles;
public class HealerEnemy extends Enemy{
int healTime = 14;
public HealerEnemy(int spawn) {
super(spawn);
speed = 0.2f;
reload = 30;
reload = 14;
maxhealth = 130;
range = 90f;
bullet = BulletType.shot;
@@ -48,7 +47,7 @@ public class HealerEnemy extends Enemy{
void updateShooting(){
Enemy enemy = (Enemy)target;
if(enemy.health < enemy.maxhealth && Timers.get(this, "heal", healTime)){
if(enemy.health < enemy.maxhealth && Timers.get(this, "heal", reload)){
enemy.health ++;
}
}

View File

@@ -12,7 +12,7 @@ public class TitanEnemy extends Enemy{
speed = 0.1f;
reload = 30;
maxhealth = 330;
maxhealth = 400;
range = 80f;
bullet = BulletType.small;
hitbox.setSize(7f);