Supression system improvements
This commit is contained in:
@@ -14,8 +14,6 @@ import mindustry.gen.*;
|
||||
import mindustry.graphics.*;
|
||||
import mindustry.type.*;
|
||||
import mindustry.world.*;
|
||||
import mindustry.world.blocks.defense.MendProjector.*;
|
||||
import mindustry.world.blocks.defense.RegenProjector.*;
|
||||
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
@@ -40,7 +38,7 @@ public class Damage{
|
||||
build.applyHealSuppression(reload + 1f);
|
||||
|
||||
//TODO maybe should be block field instead of instanceof check
|
||||
if(build.wasRecentlyHealed(60f * 12f) || (build instanceof MendBuild || build instanceof RegenProjectorBuild)){
|
||||
if(build.wasRecentlyHealed(60f * 12f) || build.block.suppressable){
|
||||
|
||||
//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){
|
||||
|
||||
@@ -1100,6 +1100,19 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
||||
Draw.color();
|
||||
}
|
||||
|
||||
/** @return whether a building has regen/healing suppressed; if so, spawns particles on it. */
|
||||
public boolean checkSuppression(){
|
||||
if(isHealSuppressed()){
|
||||
if(Mathf.chanceDelta(0.03)){
|
||||
Fx.regenSuppressParticle.at(x + Mathf.range(block.size * tilesize/2f - 1f), y + Mathf.range(block.size * tilesize/2f - 1f));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/** Called after the block is placed by this client. */
|
||||
@CallSuper
|
||||
public void playerPlaced(Object config){
|
||||
|
||||
Reference in New Issue
Block a user