Regen suppression unit + system
This commit is contained in:
@@ -76,6 +76,8 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
||||
LiquidModule liquids;
|
||||
ConsumeModule cons;
|
||||
|
||||
public transient float healSuppressionTime = -1f;
|
||||
|
||||
private transient float timeScale = 1f, timeScaleDuration;
|
||||
private transient float dumpAccum;
|
||||
|
||||
@@ -329,6 +331,14 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
||||
timeScale = Math.max(timeScale, intensity);
|
||||
}
|
||||
|
||||
public void applyHealSuppression(float amount){
|
||||
healSuppressionTime = Math.max(healSuppressionTime, Time.time + amount);
|
||||
}
|
||||
|
||||
public boolean isHealSuppressed(){
|
||||
return Time.time <= healSuppressionTime;
|
||||
}
|
||||
|
||||
public Building nearby(int dx, int dy){
|
||||
return world.build(tile.x + dx, tile.y + dy);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user