Skip to content

Commit

Permalink
Fixed accelerator timing
Browse files Browse the repository at this point in the history
  • Loading branch information
Anuken committed Jan 29, 2025
1 parent a7f38ac commit e308afb
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions core/src/mindustry/world/blocks/campaign/Accelerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public class AcceleratorBuild extends Building implements LaunchAnimator{
@Override
public void updateTile(){
super.updateTile();
heat = Mathf.lerpDelta(heat, efficiency, 0.05f);
heat = Mathf.lerpDelta(heat, launching ? 1f : efficiency, 0.05f);
statusLerp = Mathf.lerpDelta(statusLerp, power.status, 0.05f);

if(!launching){
Expand Down Expand Up @@ -212,7 +212,7 @@ public void drawLight(){
}

public boolean canLaunch(){
return isValid() && state.isCampaign() && efficiency > 0f && power.graph.getBatteryStored() >= powerBufferRequirement-0.00001f && progress >= 1f;
return isValid() && state.isCampaign() && efficiency > 0f && power.graph.getBatteryStored() >= powerBufferRequirement-0.00001f && progress >= 1f && !launching;
}

@Override
Expand All @@ -224,7 +224,7 @@ public Cursor getCursor(){
public void drawSelect(){
super.drawSelect();

if(power.graph.getBatteryStored() < powerBufferRequirement){
if(power.graph.getBatteryStored() < powerBufferRequirement && !launching){
drawPlaceText(Core.bundle.get("bar.nobatterypower"), tile.x, tile.y, false);
}
}
Expand All @@ -241,12 +241,11 @@ public void buildConfiguration(Table table){
power.graph.useBatteries(powerBufferRequirement);
progress = 0f;

var core = team.core();

renderer.showLaunch(this);

Time.runTask(core.launchDuration() - 8f, () -> {
Time.runTask(launchDuration() - 6f, () -> {
//unlock right before launch
launching = false;
sector.planet.unlockedOnLand.each(UnlockableContent::unlock);

universe.clearLoadoutInfo();
Expand Down

0 comments on commit e308afb

Please sign in to comment.