mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-03-14 11:59:20 +07:00
Mass driver power fix / Bugfixes
This commit is contained in:
parent
72cad1409f
commit
581782af28
@ -802,7 +802,7 @@ block.spectre.name = Spectre
|
||||
block.meltdown.name = Meltdown
|
||||
block.container.name = Container
|
||||
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
|
||||
team.blue.name = blue
|
||||
team.red.name = red
|
||||
|
@ -943,7 +943,7 @@ public class Blocks implements ContentList{
|
||||
itemCapacity = 120;
|
||||
reloadTime = 200f;
|
||||
range = 440f;
|
||||
consumes.power(2f);
|
||||
consumes.power(1.75f);
|
||||
}};
|
||||
|
||||
//endregion
|
||||
|
@ -29,12 +29,21 @@ public class FileChooser extends FloatingDialog{
|
||||
private Predicate<FileHandle> filter;
|
||||
private Consumer<FileHandle> selectListener;
|
||||
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){
|
||||
super(title);
|
||||
this.open = open;
|
||||
this.filter = filter;
|
||||
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(){
|
||||
@ -268,14 +277,6 @@ public class FileChooser extends FloatingDialog{
|
||||
return this;
|
||||
}
|
||||
|
||||
public void fileSelected(Consumer<FileHandle> listener){
|
||||
this.selectListener = listener;
|
||||
}
|
||||
|
||||
public interface FileHandleFilter{
|
||||
boolean accept(FileHandle file);
|
||||
}
|
||||
|
||||
public class FileHistory{
|
||||
private Array<FileHandle> history = new Array<>();
|
||||
private int index;
|
||||
|
@ -78,7 +78,7 @@ public class MassDriver extends Block{
|
||||
|
||||
//reload regardless of state
|
||||
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
|
||||
@ -114,7 +114,7 @@ public class MassDriver extends Block{
|
||||
}
|
||||
|
||||
//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){
|
||||
//if there's nothing to shoot at OR someone wants to shoot at this thing, bail
|
||||
if(!hasLink || !entity.waitingShooters.isEmpty()){
|
||||
@ -133,7 +133,7 @@ public class MassDriver extends Block{
|
||||
other.waitingShooters.add(tile);
|
||||
|
||||
//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.
|
||||
if(other.currentShooter() == tile &&
|
||||
|
Loading…
Reference in New Issue
Block a user