Smarter payload routers / 2x display / Campaign tweaks
BIN
core/assets-raw/sprites/blocks/logic/large-logic-display.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
|
|
@ -4,5 +4,6 @@
|
|||
flattenPaths: true,
|
||||
maxWidth: 4096,
|
||||
maxHeight: 4096,
|
||||
minHeight: 2048,
|
||||
fast: true
|
||||
}
|
||||
|
|
|
|||
|
|
@ -584,6 +584,7 @@ blocks.itemsmoved = Move Speed
|
|||
blocks.launchtime = Time Between Launches
|
||||
blocks.shootrange = Range
|
||||
blocks.size = Size
|
||||
blocks.displaysize = Display Size
|
||||
blocks.liquidcapacity = Liquid Capacity
|
||||
blocks.powerrange = Power Range
|
||||
blocks.linkrange = Link Range
|
||||
|
|
@ -1117,6 +1118,7 @@ block.micro-processor.name = Micro Processor
|
|||
block.logic-processor.name = Logic Processor
|
||||
block.hyper-processor.name = Hyper Processor
|
||||
block.logic-display.name = Logic Display
|
||||
block.large-logic-display.name = Large Logic Display
|
||||
block.memory-cell.name = Memory Cell
|
||||
|
||||
team.blue.name = blue
|
||||
|
|
|
|||
|
|
@ -310,3 +310,4 @@
|
|||
63434=snow-boulder|block-snow-boulder-medium
|
||||
63433=dacite-wall|block-dacite-wall-medium
|
||||
63432=dacite-boulder|block-dacite-boulder-medium
|
||||
63431=large-logic-display|block-large-logic-display-medium
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 808 B After Width: | Height: | Size: 811 B |
|
Before Width: | Height: | Size: 973 KiB After Width: | Height: | Size: 958 KiB |
|
Before Width: | Height: | Size: 357 KiB After Width: | Height: | Size: 365 KiB |
|
Before Width: | Height: | Size: 187 KiB After Width: | Height: | Size: 188 KiB |
|
Before Width: | Height: | Size: 408 KiB After Width: | Height: | Size: 415 KiB |
|
Before Width: | Height: | Size: 1.3 MiB After Width: | Height: | Size: 1.2 MiB |
|
Before Width: | Height: | Size: 2.1 MiB After Width: | Height: | Size: 2.1 MiB |
|
Before Width: | Height: | Size: 189 KiB After Width: | Height: | Size: 189 KiB |
|
Before Width: | Height: | Size: 415 KiB After Width: | Height: | Size: 418 KiB |
|
Before Width: | Height: | Size: 1.3 MiB After Width: | Height: | Size: 1.3 MiB |
|
|
@ -83,7 +83,7 @@ public class Blocks implements ContentList{
|
|||
repairPoint, resupplyPoint,
|
||||
|
||||
//logic
|
||||
message, switchBlock, microProcessor, logicProcessor, hyperProcessor, logicDisplay, memoryCell,
|
||||
message, switchBlock, microProcessor, logicProcessor, hyperProcessor, largeLogicDisplay, logicDisplay, memoryCell,
|
||||
|
||||
//campaign
|
||||
launchPad, launchPadLarge,
|
||||
|
|
@ -1136,7 +1136,7 @@ public class Blocks implements ContentList{
|
|||
requirements(Category.power, with(Items.copper, 35, Items.graphite, 25, Items.lead, 40, Items.silicon, 30));
|
||||
powerProduction = 5.5f;
|
||||
itemDuration = 90f;
|
||||
consumes.liquid(Liquids.water, 0.05f);
|
||||
consumes.liquid(Liquids.water, 0.06f);
|
||||
hasLiquids = true;
|
||||
size = 2;
|
||||
}};
|
||||
|
|
@ -1943,18 +1943,26 @@ public class Blocks implements ContentList{
|
|||
size = 3;
|
||||
}};
|
||||
|
||||
memoryCell = new MemoryBlock("memory-cell"){{
|
||||
requirements(Category.logic, with(Items.graphite, 40, Items.silicon, 40));
|
||||
|
||||
memoryCapacity = 64;
|
||||
}};
|
||||
|
||||
logicDisplay = new LogicDisplay("logic-display"){{
|
||||
requirements(Category.logic, with(Items.copper, 200, Items.lead, 120, Items.silicon, 100, Items.metaglass, 50));
|
||||
requirements(Category.logic, with(Items.lead, 100, Items.silicon, 50, Items.metaglass, 50));
|
||||
|
||||
displaySize = 80;
|
||||
|
||||
size = 3;
|
||||
}};
|
||||
|
||||
memoryCell = new MemoryBlock("memory-cell"){{
|
||||
requirements(Category.logic, with(Items.graphite, 40, Items.silicon, 40));
|
||||
largeLogicDisplay = new LogicDisplay("large-logic-display"){{
|
||||
requirements(Category.logic, with(Items.lead, 200, Items.silicon, 150, Items.metaglass, 100, Items.phasefabric, 75));
|
||||
|
||||
memoryCapacity = 64;
|
||||
displaySize = 176;
|
||||
|
||||
size = 6;
|
||||
}};
|
||||
|
||||
//endregion
|
||||
|
|
|
|||
|
|
@ -208,7 +208,9 @@ public class TechTree implements ContentList{
|
|||
node(switchBlock, () -> {
|
||||
node(message, () -> {
|
||||
node(logicDisplay, () -> {
|
||||
node(largeLogicDisplay, () -> {
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
node(memoryCell, () -> {
|
||||
|
|
|
|||
|
|
@ -491,7 +491,7 @@ public class UI implements ApplicationListener, Loadable{
|
|||
Table t = new Table();
|
||||
t.touchable = Touchable.disabled;
|
||||
t.background(Styles.black3).margin(8f)
|
||||
.add(text).style(Styles.outlineLabel);
|
||||
.add(text).style(Styles.outlineLabel).labelAlign(Align.center);
|
||||
t.update(() -> t.setPosition(Core.graphics.getWidth()/2f, Core.graphics.getHeight()/2f, Align.center));
|
||||
t.actions(Actions.fadeOut(3, Interp.pow4In), Actions.remove());
|
||||
Core.scene.add(t);
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public class LExecutor{
|
|||
|
||||
public static final int
|
||||
maxGraphicsBuffer = 256,
|
||||
maxDisplayBuffer = 512,
|
||||
maxDisplayBuffer = 1024,
|
||||
maxTextBuffer = 256;
|
||||
|
||||
public LInstruction[] instructions = {};
|
||||
|
|
|
|||
|
|
@ -70,10 +70,6 @@ public class HudFragment extends Fragment{
|
|||
coreItems.clear();
|
||||
});
|
||||
|
||||
Events.on(TurnEvent.class, e -> {
|
||||
ui.announce("[accent][[ Turn " + universe.turn() + " ]");
|
||||
});
|
||||
|
||||
//paused table
|
||||
parent.fill(t -> {
|
||||
t.top().visible(() -> state.isPaused() && !state.isOutOfTime()).touchable = Touchable.disabled;
|
||||
|
|
@ -293,16 +289,19 @@ public class HudFragment extends Fragment{
|
|||
|
||||
top.defaults().pad(2).size(150f, 54f);
|
||||
//TODO localize
|
||||
top.button("Ignore", () -> {
|
||||
top.button("Skip", () -> {
|
||||
universe.runTurn();
|
||||
state.set(State.playing);
|
||||
|
||||
//announce turn info only when something is skipped.
|
||||
ui.announce("[accent][[ Turn " + universe.turn() + " ]\n[scarlet]" + attackedSectors.size + "[lightgray] sector(s) attacked.");
|
||||
});
|
||||
|
||||
//TODO localize
|
||||
top.button("Switch Sectors", () -> {
|
||||
ui.paused.runExitSave();
|
||||
|
||||
|
||||
//switch to first attacked sector
|
||||
control.playSector(attackedSectors.first());
|
||||
}).disabled(b -> attackedSectors.isEmpty());
|
||||
}).margin(8).growX();
|
||||
|
|
|
|||
|
|
@ -108,6 +108,7 @@ public class PayloadConveyor extends Block{
|
|||
if(curStep > step){
|
||||
boolean valid = step != -1;
|
||||
step = curStep;
|
||||
boolean had = item != null;
|
||||
|
||||
if(valid && stepAccepted != curStep && item != null){
|
||||
if(next != null){
|
||||
|
|
@ -129,9 +130,17 @@ public class PayloadConveyor extends Block{
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(had && item != null){
|
||||
moveFailed();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void moveFailed(){
|
||||
|
||||
}
|
||||
|
||||
public void moved(){
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,9 @@ import arc.math.*;
|
|||
import arc.util.*;
|
||||
import mindustry.annotations.Annotations.*;
|
||||
import mindustry.entities.units.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.graphics.*;
|
||||
import mindustry.world.blocks.payloads.*;
|
||||
|
||||
public class PayloadRouter extends PayloadConveyor{
|
||||
public @Load("@-over") TextureRegion overRegion;
|
||||
|
|
@ -33,13 +35,25 @@ public class PayloadRouter extends PayloadConveyor{
|
|||
smoothRot = rotdeg();
|
||||
}
|
||||
|
||||
public void pickNext(){
|
||||
if(item != null){
|
||||
int rotations = 0;
|
||||
do{
|
||||
rotation = (rotation + 1) % 4;
|
||||
onProximityUpdate();
|
||||
}while((blocked || next == null || !next.acceptPayload(next, item)) && ++rotations < 4);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void moved(){
|
||||
int rotations = 0;
|
||||
do{
|
||||
rotation = (rotation + 1) % 4;
|
||||
onProximityUpdate();
|
||||
}while((blocked || next == null) && ++rotations < 4);
|
||||
public void handlePayload(Building source, Payload payload){
|
||||
super.handlePayload(source, payload);
|
||||
pickNext();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void moveFailed(){
|
||||
pickNext();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ import arc.util.*;
|
|||
import mindustry.annotations.Annotations.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.graphics.*;
|
||||
import mindustry.logic.*;
|
||||
import mindustry.world.*;
|
||||
import mindustry.world.meta.*;
|
||||
|
||||
public class LogicDisplay extends Block{
|
||||
public static final byte
|
||||
|
|
@ -34,11 +34,18 @@ public class LogicDisplay extends Block{
|
|||
solid = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStats(){
|
||||
super.setStats();
|
||||
|
||||
stats.add(BlockStat.displaySize, "@x@", displaySize, displaySize);
|
||||
}
|
||||
|
||||
public class LogicDisplayBuild extends Building{
|
||||
public FrameBuffer buffer;
|
||||
public float color = Color.whiteFloatBits;
|
||||
public float stroke = 1f;
|
||||
public LongQueue commands = new LongQueue(LExecutor.maxDisplayBuffer);
|
||||
public LongQueue commands = new LongQueue(256);
|
||||
|
||||
@Override
|
||||
public void draw(){
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import java.util.Locale;
|
|||
public enum BlockStat{
|
||||
health(StatCategory.general),
|
||||
size(StatCategory.general),
|
||||
displaySize(StatCategory.general),
|
||||
buildTime(StatCategory.general),
|
||||
buildCost(StatCategory.general),
|
||||
|
||||
|
|
|
|||