Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -113,6 +113,7 @@ public class SaveIO{
|
||||
|
||||
public static void write(OutputStream os, StringMap tags){
|
||||
try(DataOutputStream stream = new DataOutputStream(os)){
|
||||
Events.fire(new SaveWriteEvent());
|
||||
SaveVersion ver = getVersion();
|
||||
|
||||
stream.write(header);
|
||||
@@ -122,8 +123,6 @@ public class SaveIO{
|
||||
}else{
|
||||
ver.write(stream, tags);
|
||||
}
|
||||
|
||||
Events.fire(new SaveWriteEvent());
|
||||
}catch(Throwable e){
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
@@ -153,7 +157,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){
|
||||
@@ -164,6 +168,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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user