Payload resprites
|
Before Width: | Height: | Size: 351 B After Width: | Height: | Size: 352 B |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 2.8 KiB |
BIN
core/assets-raw/sprites/blocks/payload/constructor-out.png
Normal file
|
After Width: | Height: | Size: 565 B |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.7 KiB |
BIN
core/assets-raw/sprites/blocks/payload/deconstructor-in.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
BIN
core/assets-raw/sprites/blocks/payload/large-constructor-out.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 129 B |
|
After Width: | Height: | Size: 569 B |
|
After Width: | Height: | Size: 1013 B |
|
After Width: | Height: | Size: 518 B |
|
After Width: | Height: | Size: 416 B |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 463 B |
|
After Width: | Height: | Size: 307 B |
|
After Width: | Height: | Size: 599 B |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
@@ -531,3 +531,5 @@
|
|||||||
63172=drone-center|block-drone-center-ui
|
63172=drone-center|block-drone-center-ui
|
||||||
63171=effect-drone|unit-effect-drone-ui
|
63171=effect-drone|unit-effect-drone-ui
|
||||||
63170=world-processor|block-world-processor-ui
|
63170=world-processor|block-world-processor-ui
|
||||||
|
63169=reinforced-payload-conveyor|block-reinforced-payload-conveyor-ui
|
||||||
|
63168=reinforced-payload-router|block-reinforced-payload-router-ui
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
package mindustry.ai;
|
package mindustry.ai;
|
||||||
|
|
||||||
import arc.*;
|
import arc.*;
|
||||||
|
import arc.math.geom.*;
|
||||||
import arc.struct.*;
|
import arc.struct.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import arc.util.async.*;
|
import arc.util.async.*;
|
||||||
import mindustry.game.EventType.*;
|
import mindustry.game.EventType.*;
|
||||||
|
import mindustry.gen.*;
|
||||||
|
import mindustry.world.*;
|
||||||
|
|
||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
@@ -22,13 +25,7 @@ public class ControlPathfinder implements Runnable{
|
|||||||
TaskQueue queue = new TaskQueue();
|
TaskQueue queue = new TaskQueue();
|
||||||
|
|
||||||
//PATHFINDING THREAD DATA
|
//PATHFINDING THREAD DATA
|
||||||
IntMap<PathRequest> requests = new IntMap<>();
|
ObjectMap<Unit, PathRequest> requests = new ObjectMap<>();
|
||||||
|
|
||||||
|
|
||||||
/** @return the next target ID to use as a unique path identifier. */
|
|
||||||
public int nextTargetId(){
|
|
||||||
return lastTargetId ++;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ControlPathfinder(){
|
public ControlPathfinder(){
|
||||||
Events.on(WorldLoadEvent.class, event -> {
|
Events.on(WorldLoadEvent.class, event -> {
|
||||||
@@ -41,6 +38,16 @@ public class ControlPathfinder implements Runnable{
|
|||||||
Events.on(ResetEvent.class, event -> stop());
|
Events.on(ResetEvent.class, event -> stop());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** @return the next target ID to use as a unique path identifier. */
|
||||||
|
public int nextTargetId(){
|
||||||
|
return lastTargetId ++;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getPathPosition(Unit unit, int pathId, Vec2 destination){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/** Starts or restarts the pathfinding thread. */
|
/** Starts or restarts the pathfinding thread. */
|
||||||
private void start(){
|
private void start(){
|
||||||
stop();
|
stop();
|
||||||
@@ -56,6 +63,15 @@ public class ControlPathfinder implements Runnable{
|
|||||||
requests.clear();
|
requests.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//distance heuristic: manhattan
|
||||||
|
private static float dstCost(float x, float y, float x2, float y2){
|
||||||
|
return Math.abs(x - x2) + Math.abs(x2 - y2);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static float tileCost(Tile a, Tile b){
|
||||||
|
return 1f;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run(){
|
public void run(){
|
||||||
while(true){
|
while(true){
|
||||||
@@ -88,10 +104,34 @@ public class ControlPathfinder implements Runnable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
class PathRequest{
|
class PathRequest{
|
||||||
public int lastRequestFrame;
|
GridBits closed;
|
||||||
|
PQueue<Tile> queue;
|
||||||
|
|
||||||
public void update(long maxUpdateNs){
|
//TODO how will costs be computed? where will they be stored...?
|
||||||
|
|
||||||
|
int lastId;
|
||||||
|
int curId;
|
||||||
|
int lastFrame;
|
||||||
|
|
||||||
|
PathRequest(){
|
||||||
|
clear();
|
||||||
|
|
||||||
|
lastId = curId;
|
||||||
|
}
|
||||||
|
|
||||||
|
void update(long maxUpdateNs){
|
||||||
|
if(curId != lastId){
|
||||||
|
clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void clear(){
|
||||||
|
//TODO
|
||||||
|
|
||||||
|
closed = new GridBits(world.width(), world.height());
|
||||||
|
queue = new PQueue<>(16, (a, b) -> 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,15 +14,11 @@ public class CommandAI extends AIController{
|
|||||||
updateVisuals();
|
updateVisuals();
|
||||||
updateTargeting();
|
updateTargeting();
|
||||||
|
|
||||||
//TODO
|
|
||||||
|
|
||||||
if(attackTarget != null){
|
if(attackTarget != null){
|
||||||
if(targetPos == null) targetPos = new Vec2();
|
if(targetPos == null) targetPos = new Vec2();
|
||||||
targetPos.set(attackTarget);
|
targetPos.set(attackTarget);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(targetPos != null){
|
if(targetPos != null){
|
||||||
moveTo(targetPos, attackTarget != null ? unit.type.range - 10f : 0f);
|
moveTo(targetPos, attackTarget != null ? unit.type.range - 10f : 0f);
|
||||||
|
|
||||||
|
|||||||
@@ -145,7 +145,8 @@ public class Blocks{
|
|||||||
droneCenter,
|
droneCenter,
|
||||||
|
|
||||||
//payloads
|
//payloads
|
||||||
payloadConveyor, payloadRouter, payloadPropulsionTower, smallDeconstructor, deconstructor, constructor, largeConstructor, payloadLoader, payloadUnloader,
|
payloadConveyor, payloadRouter, reinforcedPayloadConveyor, reinforcedPayloadRouter, payloadPropulsionTower, smallDeconstructor, deconstructor, constructor, largeConstructor, payloadLoader, payloadUnloader,
|
||||||
|
|
||||||
|
|
||||||
//logic
|
//logic
|
||||||
message, switchBlock, microProcessor, logicProcessor, hyperProcessor, largeLogicDisplay, logicDisplay, memoryCell, memoryBank,
|
message, switchBlock, microProcessor, logicProcessor, hyperProcessor, largeLogicDisplay, logicDisplay, memoryCell, memoryBank,
|
||||||
@@ -3550,12 +3551,26 @@ public class Blocks{
|
|||||||
//region payloads
|
//region payloads
|
||||||
|
|
||||||
payloadConveyor = new PayloadConveyor("payload-conveyor"){{
|
payloadConveyor = new PayloadConveyor("payload-conveyor"){{
|
||||||
requirements(Category.units, with(Items.graphite, 10));
|
requirements(Category.units, with(Items.graphite, 10, Items.copper, 10));
|
||||||
canOverdrive = false;
|
canOverdrive = false;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
payloadRouter = new PayloadRouter("payload-router"){{
|
payloadRouter = new PayloadRouter("payload-router"){{
|
||||||
requirements(Category.units, with(Items.graphite, 15));
|
requirements(Category.units, with(Items.graphite, 15, Items.copper, 10));
|
||||||
|
canOverdrive = false;
|
||||||
|
}};
|
||||||
|
|
||||||
|
reinforcedPayloadConveyor = new PayloadConveyor("reinforced-payload-conveyor"){{
|
||||||
|
requirements(Category.units, with(Items.tungsten, 10));
|
||||||
|
moveTime = 35f;
|
||||||
|
canOverdrive = false;
|
||||||
|
health = 800;
|
||||||
|
}};
|
||||||
|
|
||||||
|
reinforcedPayloadRouter = new PayloadRouter("reinforced-payload-router"){{
|
||||||
|
requirements(Category.units, with(Items.tungsten, 15));
|
||||||
|
moveTime = 35f;
|
||||||
|
health = 800;
|
||||||
canOverdrive = false;
|
canOverdrive = false;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
@@ -3570,7 +3585,7 @@ public class Blocks{
|
|||||||
}};
|
}};
|
||||||
|
|
||||||
smallDeconstructor = new PayloadDeconstructor("small-deconstructor"){{
|
smallDeconstructor = new PayloadDeconstructor("small-deconstructor"){{
|
||||||
requirements(Category.units, with(Items.thorium, 80, Items.silicon, 80, Items.graphite, 80));
|
requirements(Category.units, with(Items.beryllium, 100, Items.silicon, 100, Items.oxide, 50, Items.graphite, 80));
|
||||||
itemCapacity = 100;
|
itemCapacity = 100;
|
||||||
consumes.power(1f);
|
consumes.power(1f);
|
||||||
size = 3;
|
size = 3;
|
||||||
@@ -3579,7 +3594,7 @@ public class Blocks{
|
|||||||
|
|
||||||
//TODO consider usefulness and applicability to serpulo
|
//TODO consider usefulness and applicability to serpulo
|
||||||
deconstructor = new PayloadDeconstructor("deconstructor"){{
|
deconstructor = new PayloadDeconstructor("deconstructor"){{
|
||||||
requirements(Category.units, with(Items.thorium, 250, Items.silicon, 200, Items.graphite, 250));
|
requirements(Category.units, with(Items.beryllium, 250, Items.oxide, 100, Items.silicon, 250, Items.carbide, 250));
|
||||||
itemCapacity = 250;
|
itemCapacity = 250;
|
||||||
consumes.power(3f);
|
consumes.power(3f);
|
||||||
size = 5;
|
size = 5;
|
||||||
@@ -3588,7 +3603,7 @@ public class Blocks{
|
|||||||
|
|
||||||
//TODO move completely to erekir tech tree?
|
//TODO move completely to erekir tech tree?
|
||||||
constructor = new Constructor("constructor"){{
|
constructor = new Constructor("constructor"){{
|
||||||
requirements(Category.units, with(Items.silicon, 80, Items.graphite, 120));
|
requirements(Category.units, with(Items.silicon, 100, Items.beryllium, 150, Items.tungsten, 80));
|
||||||
hasPower = true;
|
hasPower = true;
|
||||||
consumes.power(2f);
|
consumes.power(2f);
|
||||||
size = 3;
|
size = 3;
|
||||||
@@ -3596,7 +3611,7 @@ public class Blocks{
|
|||||||
|
|
||||||
//yes this block is pretty much useless
|
//yes this block is pretty much useless
|
||||||
largeConstructor = new Constructor("large-constructor"){{
|
largeConstructor = new Constructor("large-constructor"){{
|
||||||
requirements(Category.units, with(Items.silicon, 150, Items.graphite, 150, Items.phaseFabric, 40));
|
requirements(Category.units, with(Items.silicon, 150, Items.oxide, 150, Items.tungsten, 200, Items.phaseFabric, 40));
|
||||||
hasPower = true;
|
hasPower = true;
|
||||||
consumes.power(2f);
|
consumes.power(2f);
|
||||||
maxBlockSize = 4;
|
maxBlockSize = 4;
|
||||||
|
|||||||
@@ -1164,6 +1164,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||||||
if(value instanceof Item) type = Item.class;
|
if(value instanceof Item) type = Item.class;
|
||||||
if(value instanceof Block) type = Block.class;
|
if(value instanceof Block) type = Block.class;
|
||||||
if(value instanceof Liquid) type = Liquid.class;
|
if(value instanceof Liquid) type = Liquid.class;
|
||||||
|
if(value instanceof UnitType) type = UnitType.class;
|
||||||
|
|
||||||
if(builder != null && builder.isPlayer()){
|
if(builder != null && builder.isPlayer()){
|
||||||
lastAccessed = builder.getPlayer().name;
|
lastAccessed = builder.getPlayer().name;
|
||||||
|
|||||||
@@ -1249,10 +1249,6 @@ public class UnitType extends UnlockableContent{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void applyOutlineColor(Unit unit){
|
public void applyOutlineColor(Unit unit){
|
||||||
if(unit.isBoss()){
|
|
||||||
Draw.mixcol(unit.team.color, Mathf.absin(7f, 1f));
|
|
||||||
}
|
|
||||||
|
|
||||||
if(unit.drownTime > 0 && unit.lastDrownFloor != null){
|
if(unit.drownTime > 0 && unit.lastDrownFloor != null){
|
||||||
Draw.color(Color.white, Tmp.c1.set(unit.lastDrownFloor.mapColor).mul(0.8f), unit.drownTime * 0.9f);
|
Draw.color(Color.white, Tmp.c1.set(unit.lastDrownFloor.mapColor).mul(0.8f), unit.drownTime * 0.9f);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import mindustry.world.meta.*;
|
|||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
public class PayloadConveyor extends Block{
|
public class PayloadConveyor extends Block{
|
||||||
public float moveTime = 40f, moveForce = 201f;
|
public float moveTime = 45f, moveForce = 201f;
|
||||||
public @Load("@-top") TextureRegion topRegion;
|
public @Load("@-top") TextureRegion topRegion;
|
||||||
public @Load("@-edge") TextureRegion edgeRegion;
|
public @Load("@-edge") TextureRegion edgeRegion;
|
||||||
public Interp interp = Interp.pow5;
|
public Interp interp = Interp.pow5;
|
||||||
|
|||||||