Some visual tweaks
This commit is contained in:
@@ -9,6 +9,8 @@ import mindustry.*;
|
||||
import mindustry.content.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.graphics.*;
|
||||
import mindustry.world.blocks.defense.MendProjector.*;
|
||||
import mindustry.world.blocks.defense.RegenProjector.*;
|
||||
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
@@ -48,11 +50,14 @@ public class SuppressionFieldAbility extends Ability{
|
||||
float prev = build.healSuppressionTime;
|
||||
build.applyHealSuppression(reload + 1f);
|
||||
|
||||
any = true;
|
||||
//TODO maybe should be block field instead of instanceof check
|
||||
if(build.wasRecentlyHealed(60f * 12f) || (build instanceof MendBuild || build instanceof RegenProjectorBuild)){
|
||||
any = true;
|
||||
|
||||
//add prev check so ability spam doesn't lead to particle spam (essentially, recently suppressed blocks don't get new particles)
|
||||
if(!headless && prev - Time.time <= reload/2f){
|
||||
builds.add(build);
|
||||
//add prev check so ability spam doesn't lead to particle spam (essentially, recently suppressed blocks don't get new particles)
|
||||
if(!headless && prev - Time.time <= reload/2f){
|
||||
builds.add(build);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -77,6 +77,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
||||
ConsumeModule cons;
|
||||
|
||||
public transient float healSuppressionTime = -1f;
|
||||
public transient float lastHealTime = -120f * 10f;
|
||||
|
||||
private transient float timeScale = 1f, timeScaleDuration;
|
||||
private transient float dumpAccum;
|
||||
@@ -339,6 +340,14 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
||||
return Time.time <= healSuppressionTime;
|
||||
}
|
||||
|
||||
public void recentlyHealed(){
|
||||
lastHealTime = Time.time;
|
||||
}
|
||||
|
||||
public boolean wasRecentlyHealed(float duration){
|
||||
return lastHealTime + duration >= Time.time;
|
||||
}
|
||||
|
||||
public Building nearby(int dx, int dy){
|
||||
return world.build(tile.x + dx, tile.y + dy);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user