Merge branch 'master' of https://github.com/Anuken/Mindustry into 7.0-features

This commit is contained in:
Anuken
2021-10-12 12:36:20 -04:00
80 changed files with 2247 additions and 187 deletions

View File

@@ -10,6 +10,7 @@ import arc.util.*;
import arc.util.io.*;
import mindustry.annotations.Annotations.*;
import mindustry.content.*;
import mindustry.entities.*;
import mindustry.gen.*;
import mindustry.graphics.*;
import mindustry.logic.*;
@@ -31,13 +32,16 @@ public class ForceProjector extends Block{
public float cooldownNormal = 1.75f;
public float cooldownLiquid = 1.5f;
public float cooldownBrokenBase = 0.35f;
public Effect absorbEffect = Fx.absorb;
public Effect shieldBreakEffect = Fx.shieldBreak;
public @Load("@-top") TextureRegion topRegion;
static ForceBuild paramEntity;
static Effect paramEffect;
static final Cons<Bullet> shieldConsumer = trait -> {
if(trait.team != paramEntity.team && trait.type.absorbable && Intersector.isInsideHexagon(paramEntity.x, paramEntity.y, paramEntity.realRadius() * 2f, trait.x(), trait.y())){
trait.absorb();
Fx.absorb.at(trait);
paramEffect.at(trait);
paramEntity.hit = 1f;
paramEntity.buildup += trait.damage();
}
@@ -154,7 +158,7 @@ public class ForceProjector extends Block{
if(buildup >= shieldHealth + phaseShieldBoost * phaseHeat && !broken){
broken = true;
buildup = shieldHealth;
Fx.shieldBreak.at(x, y, realRadius(), team.color);
shieldBreakEffect.at(x, y, realRadius(), team.color);
}
if(hit > 0f){
@@ -165,6 +169,7 @@ public class ForceProjector extends Block{
if(realRadius > 0 && !broken){
paramEntity = this;
paramEffect = absorbEffect;
Groups.bullet.intersect(x - realRadius, y - realRadius, realRadius * 2f, realRadius * 2f, shieldConsumer);
}
}

View File

@@ -69,13 +69,8 @@ public class OverflowGate extends Block{
}else if(bc && !ac){
to = b;
}else{
if(rotation == 0){
to = a;
if(flip) rotation =1;
}else{
to = b;
if(flip) rotation = 0;
}
to = (rotation & (1 << from)) == 0 ? a : b;
if(flip) rotation ^= (1 << from);
}
}

View File

@@ -114,13 +114,8 @@ public class Sorter extends Block{
}else if(!bc){
return null;
}else{
if(rotation == 0){
to = a;
if(flip) this.rotation = (byte)1;
}else{
to = b;
if(flip) this.rotation = (byte)0;
}
to = (rotation & (1 << dir)) == 0 ? a : b;
if(flip) rotation ^= (1 << dir);
}
}

View File

@@ -349,7 +349,7 @@ public class PowerNode extends PowerBlock{
public static boolean insulated(int x, int y, int x2, int y2){
return world.raycast(x, y, x2, y2, (wx, wy) -> {
Building tile = world.build(wx, wy);
return tile != null && tile.block.insulated;
return tile != null && tile.isInsulated();
});
}