Mass driver power fix / Bugfixes

This commit is contained in:
Anuken
2019-05-31 09:10:37 -04:00
parent 72cad1409f
commit 581782af28
4 changed files with 14 additions and 13 deletions

View File

@@ -802,7 +802,7 @@ block.spectre.name = Spectre
block.meltdown.name = Meltdown block.meltdown.name = Meltdown
block.container.name = Container block.container.name = Container
block.launch-pad.name = Launch Pad block.launch-pad.name = Launch Pad
block.launch-pad.description = Launches batches of items without any need for a core launch. Unfinished. block.launch-pad.description = Launches batches of items without any need for a core launch.
block.launch-pad-large.name = Large Launch Pad block.launch-pad-large.name = Large Launch Pad
team.blue.name = blue team.blue.name = blue
team.red.name = red team.red.name = red

View File

@@ -943,7 +943,7 @@ public class Blocks implements ContentList{
itemCapacity = 120; itemCapacity = 120;
reloadTime = 200f; reloadTime = 200f;
range = 440f; range = 440f;
consumes.power(2f); consumes.power(1.75f);
}}; }};
//endregion //endregion

View File

@@ -29,12 +29,21 @@ public class FileChooser extends FloatingDialog{
private Predicate<FileHandle> filter; private Predicate<FileHandle> filter;
private Consumer<FileHandle> selectListener; private Consumer<FileHandle> selectListener;
private boolean open; private boolean open;
private int lastWidth = Core.graphics.getWidth(), lastHeight = Core.graphics.getHeight();
public FileChooser(String title, Predicate<FileHandle> filter, boolean open, Consumer<FileHandle> result){ public FileChooser(String title, Predicate<FileHandle> filter, boolean open, Consumer<FileHandle> result){
super(title); super(title);
this.open = open; this.open = open;
this.filter = filter; this.filter = filter;
this.selectListener = result; this.selectListener = result;
update(() -> {
if(Core.graphics.getWidth() != lastWidth || Core.graphics.getHeight() != lastHeight){
updateFiles(false);
lastHeight = Core.graphics.getHeight();
lastWidth = Core.graphics.getWidth();
}
});
} }
private void setupWidgets(){ private void setupWidgets(){
@@ -268,14 +277,6 @@ public class FileChooser extends FloatingDialog{
return this; return this;
} }
public void fileSelected(Consumer<FileHandle> listener){
this.selectListener = listener;
}
public interface FileHandleFilter{
boolean accept(FileHandle file);
}
public class FileHistory{ public class FileHistory{
private Array<FileHandle> history = new Array<>(); private Array<FileHandle> history = new Array<>();
private int index; private int index;

View File

@@ -78,7 +78,7 @@ public class MassDriver extends Block{
//reload regardless of state //reload regardless of state
if(entity.reload > 0f){ if(entity.reload > 0f){
entity.reload = Mathf.clamp(entity.reload - entity.delta() / reloadTime); entity.reload = Mathf.clamp(entity.reload - entity.delta() / reloadTime * entity.power.satisfaction);
} }
//cleanup waiting shooters that are not valid //cleanup waiting shooters that are not valid
@@ -114,7 +114,7 @@ public class MassDriver extends Block{
} }
//align to shooter rotation //align to shooter rotation
entity.rotation = Mathf.slerpDelta(entity.rotation, tile.angleTo(entity.currentShooter()), rotateSpeed); entity.rotation = Mathf.slerpDelta(entity.rotation, tile.angleTo(entity.currentShooter()), rotateSpeed * entity.power.satisfaction);
}else if(entity.state == DriverState.shooting){ }else if(entity.state == DriverState.shooting){
//if there's nothing to shoot at OR someone wants to shoot at this thing, bail //if there's nothing to shoot at OR someone wants to shoot at this thing, bail
if(!hasLink || !entity.waitingShooters.isEmpty()){ if(!hasLink || !entity.waitingShooters.isEmpty()){
@@ -133,7 +133,7 @@ public class MassDriver extends Block{
other.waitingShooters.add(tile); other.waitingShooters.add(tile);
//align to target location //align to target location
entity.rotation = Mathf.slerpDelta(entity.rotation, targetRotation, rotateSpeed); entity.rotation = Mathf.slerpDelta(entity.rotation, targetRotation, rotateSpeed * entity.power.satisfaction);
//fire when it's the first in the queue and angles are ready. //fire when it's the first in the queue and angles are ready.
if(other.currentShooter() == tile && if(other.currentShooter() == tile &&