Zone requirement changes / Bugfixes

This commit is contained in:
Anuken
2019-04-20 19:57:20 -04:00
parent af91979d4c
commit 75dcceff43
23 changed files with 2255 additions and 2077 deletions

View File

@@ -86,6 +86,7 @@ public class Damage{
tr.trns(angle, length);
world.raycastEachWorld(x, y, x + tr.x, y + tr.y, (cx, cy) -> {
Tile tile = world.tile(cx, cy);
if(tile != null) tile = tile.target();
if(tile != null && tile.entity != null && tile.target().getTeamID() != team.ordinal() && tile.entity.collide(hitter)){
tile.entity.collision(hitter);
hitter.getBulletType().hit(hitter, tile.worldx(), tile.worldy());
@@ -113,7 +114,7 @@ public class Damage{
rect.width += expand * 2;
rect.height += expand * 2;
Consumer<io.anuke.mindustry.entities.type.Unit> cons = e -> {
Consumer<Unit> cons = e -> {
e.hitbox(hitrect);
Rectangle other = hitrect;
other.y -= expand;
@@ -134,8 +135,8 @@ public class Damage{
}
/** Damages all entities and blocks in a radius that are enemies of the team. */
public static void damageUnits(Team team, float x, float y, float size, float damage, Predicate<io.anuke.mindustry.entities.type.Unit> predicate, Consumer<io.anuke.mindustry.entities.type.Unit> acceptor){
Consumer<io.anuke.mindustry.entities.type.Unit> cons = entity -> {
public static void damageUnits(Team team, float x, float y, float size, float damage, Predicate<Unit> predicate, Consumer<Unit> acceptor){
Consumer<Unit> cons = entity -> {
if(!predicate.test(entity)) return;
entity.hitbox(hitrect);