Editor & access modifier fixes

This commit is contained in:
Anuken
2022-02-20 16:58:29 -05:00
parent 21bf26fa78
commit 8b916d03af
10 changed files with 24 additions and 12 deletions

View File

@@ -20,9 +20,8 @@ public class EmpBulletType extends BasicBulletType{
if(!b.absorbed){
Vars.indexer.allBuildings(x, y, radius, other -> {
if(other.team == b.team){
if(other.block.hasPower && other.block.canOverdrive && other.timeScale < timeIncrease){
other.timeScale = Math.max(other.timeScale, timeIncrease);
other.timeScaleDuration = Math.max(other.timeScaleDuration, timeDuration);
if(other.block.hasPower && other.block.canOverdrive && other.timeScale() < timeIncrease){
other.applyBoost(timeIncrease, timeDuration);
chainEffect.at(x, y, 0, hitColor, other);
applyEffect.at(other, other.block.size * 7f);
}
@@ -39,8 +38,7 @@ public class EmpBulletType extends BasicBulletType{
}
if(other.power != null && other.power.graph.getLastPowerProduced() > 0f){
other.timeScale = Math.min(other.timeScale, powerSclDecrease);
other.timeScaleDuration = timeDuration;
other.applySlowdown(powerSclDecrease, timeDuration);
other.damage(damage * powerDamageScl);
hitPowerEffect.at(other.x, other.y, b.angleTo(other), hitColor);
chainEffect.at(x, y, 0, hitColor, other);

View File

@@ -346,6 +346,14 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
timeScale = Math.max(timeScale, intensity);
}
public void applySlowdown(float intensity, float duration){
//do not refresh time scale when getting a weaker intensity
if(intensity <= this.timeScale - 0.001f){
timeScaleDuration = Math.max(timeScaleDuration, duration);
}
timeScale = Math.min(timeScale, intensity);
}
public void applyHealSuppression(float amount){
healSuppressionTime = Math.max(healSuppressionTime, Time.time + amount);
}