Many bugfixes and tweaks

This commit is contained in:
Anuken
2017-12-05 12:21:08 -05:00
parent dbb6673752
commit aafe7fb74a
31 changed files with 143 additions and 89 deletions

View File

@@ -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;
hitsize = 6f;
@@ -89,7 +89,7 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
public void removed(Bullet b){
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.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));
}
},
titanshell = new BulletType(1.8f, 40){
titanshell = new BulletType(1.8f, 38){
{
lifetime = 70f;
hitsize = 15f;
@@ -160,7 +160,7 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
Effects.effect(Fx.shellsmoke, 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){

View File

@@ -91,7 +91,7 @@ public class WaveCreator{
//boss wave
new EnemySpawn(FortressEnemy.class){{
after = 16;
amount = 2;
amount = 1;
spacing = 5;
scaling = 1;
}},
@@ -149,8 +149,8 @@ public class WaveCreator{
}},
new EnemySpawn(FortressEnemy.class){{
after = 12;
spacing = 3;
scaling = 5;
spacing = 4;
scaling = 6;
}},
new EnemySpawn(HealerEnemy.class){{
scaling = 3;

View File

@@ -50,14 +50,15 @@ public class EMP extends TimedEntity{
Tile tile = array.get(i);
targets.add(tile);
if(tile.block() instanceof PowerAcceptor){
if(tile != null && tile.block() instanceof PowerAcceptor){
PowerAcceptor p = (PowerAcceptor)tile.block();
tile.entity.damage(damage*2); //extra damage
p.setPower(tile, 0f);
tile.entity.damage(damage*2); //extra damage
}
Effects.effect(Fx.empspark, tile.entity);
tile.entity.damage(damage);
//entity may be null here, after the block is dead!
Effects.effect(Fx.empspark, tile.worldx(), tile.worldy());
if(tile.entity != null) tile.entity.damage(damage);
}
}

View File

@@ -18,6 +18,7 @@ import io.anuke.ucore.util.Mathf;
public class Shield extends Entity{
public boolean active;
public boolean hitPlayers = false;
public float radius = 0f;
private float uptime = 0f;
private final Tile tile;
@@ -84,8 +85,7 @@ public class Shield extends Entity{
}
float drawRadius(){
ShieldBlock block = (ShieldBlock)tile.block();
return (block.shieldRadius*2 + Mathf.sin(Timers.time(), 25f, 2f)) * uptime;
return (radius*2 + Mathf.sin(Timers.time(), 25f, 2f));
}
public void removeDelay(){

View File

@@ -5,13 +5,10 @@ import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.utils.reflect.ClassReflection;
import io.anuke.mindustry.Vars;
import io.anuke.mindustry.entities.Bullet;
import io.anuke.mindustry.entities.BulletType;
import io.anuke.mindustry.entities.Player;
import io.anuke.mindustry.entities.*;
import io.anuke.mindustry.entities.effect.Fx;
import io.anuke.mindustry.entities.effect.Shaders;
import io.anuke.mindustry.world.Tile;
import io.anuke.ucore.UCore;
import io.anuke.ucore.core.*;
import io.anuke.ucore.entities.*;
import io.anuke.ucore.util.Angles;
@@ -103,6 +100,10 @@ public class Enemy extends DestructibleEntity{
}
void updateTargeting(boolean nearCore){
if(target != null && target instanceof TileEntity && ((TileEntity)target).dead){
target = null;
}
if(Timers.get(this, "target", 15) && !nearCore){
target = Vars.world.findTileTarget(x, y, null, range, false);
@@ -110,10 +111,8 @@ public class Enemy extends DestructibleEntity{
if(target == null){
target = Entities.getClosest(Entities.defaultGroup(), x, y, range, e -> e instanceof Player);
}
}
if(target instanceof Enemy){
UCore.log(target);
}else if(nearCore){
target = Vars.control.getCore().entity;
}
if(target != null && bullet != null){