All hail the cuteness of this crater roomba critter
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
BIN
core/assets-raw/sprites/units/crater-base.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
core/assets-raw/sprites/units/crater-leg.png
Normal file
|
After Width: | Height: | Size: 481 B |
BIN
core/assets-raw/sprites/units/crater.png
Normal file
|
After Width: | Height: | Size: 7.1 KiB |
@@ -923,6 +923,8 @@ block.conveyor.name = Conveyor
|
|||||||
block.titanium-conveyor.name = Titanium Conveyor
|
block.titanium-conveyor.name = Titanium Conveyor
|
||||||
block.armored-conveyor.name = Armored Conveyor
|
block.armored-conveyor.name = Armored Conveyor
|
||||||
block.armored-conveyor.description = Moves items at the same speed as titanium conveyors, but possesses more armor. Does not accept inputs from the sides from anything but other conveyor belts.
|
block.armored-conveyor.description = Moves items at the same speed as titanium conveyors, but possesses more armor. Does not accept inputs from the sides from anything but other conveyor belts.
|
||||||
|
block.compressed-conveyor.name = Compressed Conveyor
|
||||||
|
block.compressed-conveyor.description = Employs craters to move items around,\ninput items at the start,\nextract at the end.
|
||||||
block.junction.name = Junction
|
block.junction.name = Junction
|
||||||
block.router.name = Router
|
block.router.name = Router
|
||||||
block.distributor.name = Distributor
|
block.distributor.name = Distributor
|
||||||
@@ -1037,6 +1039,7 @@ unit.spirit.name = Spirit Repair Drone
|
|||||||
unit.draug.name = Draug Miner Drone
|
unit.draug.name = Draug Miner Drone
|
||||||
unit.phantom.name = Phantom Builder Drone
|
unit.phantom.name = Phantom Builder Drone
|
||||||
unit.dagger.name = Dagger
|
unit.dagger.name = Dagger
|
||||||
|
unit.crater.name = Crater
|
||||||
unit.crawler.name = Crawler
|
unit.crawler.name = Crawler
|
||||||
unit.titan.name = Titan
|
unit.titan.name = Titan
|
||||||
unit.ghoul.name = Ghoul Bomber
|
unit.ghoul.name = Ghoul Bomber
|
||||||
@@ -1102,6 +1105,7 @@ unit.draug.description = A primitive mining drone. Cheap to produce. Expendable.
|
|||||||
unit.spirit.description = A modified draug drone, designed for repair instead of mining. Automatically fixes any damaged blocks in the area.
|
unit.spirit.description = A modified draug drone, designed for repair instead of mining. Automatically fixes any damaged blocks in the area.
|
||||||
unit.phantom.description = An advanced drone unit. Follows users. Assists in block construction.
|
unit.phantom.description = An advanced drone unit. Follows users. Assists in block construction.
|
||||||
unit.dagger.description = The most basic ground mech. Cheap to produce. Overwhelming when used in swarms.
|
unit.dagger.description = The most basic ground mech. Cheap to produce. Overwhelming when used in swarms.
|
||||||
|
unit.crater.description = Logistic roomba, inhabits compressed conveyors to move items around.
|
||||||
unit.crawler.description = A ground unit consisting of a stripped-down frame with high explosives strapped on top. Not particular durable. Explodes on contact with enemies.
|
unit.crawler.description = A ground unit consisting of a stripped-down frame with high explosives strapped on top. Not particular durable. Explodes on contact with enemies.
|
||||||
unit.titan.description = An advanced, armored ground unit. Attacks both ground and air targets. Equipped with two miniature Scorch-class flamethrowers.
|
unit.titan.description = An advanced, armored ground unit. Attacks both ground and air targets. Equipped with two miniature Scorch-class flamethrowers.
|
||||||
unit.fortress.description = A heavy artillery mech. Equipped with two modified Hail-type cannons for long-range assault on enemy structures and units.
|
unit.fortress.description = A heavy artillery mech. Equipped with two modified Hail-type cannons for long-range assault on enemy structures and units.
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 747 B After Width: | Height: | Size: 751 B |
|
Before Width: | Height: | Size: 957 KiB After Width: | Height: | Size: 961 KiB |
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 332 KiB After Width: | Height: | Size: 333 KiB |
@@ -57,7 +57,7 @@ public class Blocks implements ContentList{
|
|||||||
scrapWall, scrapWallLarge, scrapWallHuge, scrapWallGigantic, thruster, //ok, these names are getting ridiculous, but at least I don't have humongous walls yet
|
scrapWall, scrapWallLarge, scrapWallHuge, scrapWallGigantic, thruster, //ok, these names are getting ridiculous, but at least I don't have humongous walls yet
|
||||||
|
|
||||||
//transport
|
//transport
|
||||||
conveyor, titaniumConveyor, armoredConveyor, distributor, junction, itemBridge, phaseConveyor, sorter, invertedSorter, router, overflowGate, massDriver,
|
conveyor, titaniumConveyor, armoredConveyor, compressedConveyor, distributor, junction, itemBridge, phaseConveyor, sorter, invertedSorter, router, overflowGate, massDriver,
|
||||||
|
|
||||||
//liquids
|
//liquids
|
||||||
mechanicalPump, rotaryPump, thermalPump, conduit, pulseConduit, platedConduit, liquidRouter, liquidTank, liquidJunction, bridgeConduit, phaseConduit,
|
mechanicalPump, rotaryPump, thermalPump, conduit, pulseConduit, platedConduit, liquidRouter, liquidTank, liquidJunction, bridgeConduit, phaseConduit,
|
||||||
@@ -897,6 +897,12 @@ public class Blocks implements ContentList{
|
|||||||
speed = 0.08f;
|
speed = 0.08f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
compressedConveyor = new CompressedConveyor("compressed-conveyor"){{
|
||||||
|
requirements(Category.distribution, ItemStack.with(Items.plastanium, 1, Items.surgealloy, 1, Items.phasefabric, 1));
|
||||||
|
health = 150;
|
||||||
|
speed = 0f;
|
||||||
|
}};
|
||||||
|
|
||||||
junction = new Junction("junction"){{
|
junction = new Junction("junction"){{
|
||||||
requirements(Category.distribution, ItemStack.with(Items.copper, 1), true);
|
requirements(Category.distribution, ItemStack.with(Items.copper, 1), true);
|
||||||
speed = 26;
|
speed = 26;
|
||||||
|
|||||||
@@ -11,12 +11,30 @@ import mindustry.type.*;
|
|||||||
|
|
||||||
public class UnitTypes implements ContentList{
|
public class UnitTypes implements ContentList{
|
||||||
public static UnitType
|
public static UnitType
|
||||||
draug, spirit, phantom,
|
crater, draug, spirit, phantom,
|
||||||
wraith, ghoul, revenant, lich, reaper,
|
wraith, ghoul, revenant, lich, reaper,
|
||||||
dagger, crawler, titan, fortress, eruptor, chaosArray, eradicator;
|
dagger, crawler, titan, fortress, eruptor, chaosArray, eradicator;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void load(){
|
public void load(){
|
||||||
|
crater = new UnitType("crater", CraterUnit::new){{
|
||||||
|
maxVelocity = 0.75f;
|
||||||
|
speed = 0.1f;
|
||||||
|
drag = 0.25f;
|
||||||
|
hitsize = 4f;
|
||||||
|
mass = 0.5f;
|
||||||
|
health = 50;
|
||||||
|
rotatespeed = 0.1f;
|
||||||
|
itemCapacity = 10;
|
||||||
|
weapon = new Weapon(){{
|
||||||
|
length = 1.5f;
|
||||||
|
reload = 28f;
|
||||||
|
alternate = true;
|
||||||
|
ejectEffect = Fx.shellEjectSmall;
|
||||||
|
bullet = Bullets.standardCopper;
|
||||||
|
}};
|
||||||
|
}};
|
||||||
|
|
||||||
draug = new UnitType("draug", MinerDrone::new){{
|
draug = new UnitType("draug", MinerDrone::new){{
|
||||||
flying = true;
|
flying = true;
|
||||||
drag = 0.01f;
|
drag = 0.01f;
|
||||||
|
|||||||
122
core/src/mindustry/entities/type/base/CraterUnit.java
Normal file
@@ -0,0 +1,122 @@
|
|||||||
|
package mindustry.entities.type.base;
|
||||||
|
|
||||||
|
import arc.*;
|
||||||
|
import arc.graphics.g2d.*;
|
||||||
|
import arc.math.*;
|
||||||
|
import arc.scene.ui.layout.*;
|
||||||
|
import arc.util.*;
|
||||||
|
import mindustry.content.*;
|
||||||
|
import mindustry.entities.*;
|
||||||
|
import mindustry.entities.Effects.*;
|
||||||
|
import mindustry.entities.units.*;
|
||||||
|
import mindustry.game.EventType.*;
|
||||||
|
import mindustry.graphics.*;
|
||||||
|
import mindustry.ui.*;
|
||||||
|
import mindustry.world.*;
|
||||||
|
import mindustry.world.blocks.distribution.*;
|
||||||
|
|
||||||
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
|
public class CraterUnit extends GroundUnit{
|
||||||
|
|
||||||
|
public final Effect io = Fx.plasticburn;
|
||||||
|
public int inactivity = 0;
|
||||||
|
|
||||||
|
public final UnitState
|
||||||
|
|
||||||
|
load = new UnitState(){
|
||||||
|
public void update(){
|
||||||
|
if(item().amount >= getItemCapacity() || !velocity.isZero(1f) || inactivity++ > 120) state.set(move);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
move = new UnitState(){
|
||||||
|
public void update(){
|
||||||
|
velocity.add(vec.trnsExact(angleTo(on().front()), type.speed * Time.delta()));
|
||||||
|
rotation = Mathf.slerpDelta(rotation, baseRotation, type.rotatespeed);
|
||||||
|
|
||||||
|
if(dst(on()) < 2.5f && on().block() instanceof CompressedConveyor && ((CompressedConveyor) on().block()).end(on())){
|
||||||
|
state.set(unload);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
unload = new UnitState(){
|
||||||
|
public void update(){
|
||||||
|
|
||||||
|
if(on().block() instanceof CompressedConveyor && !((CompressedConveyor)on().block()).end(on())){
|
||||||
|
state.set(move);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(item().amount-- > 0){
|
||||||
|
int rot = on().rotation();
|
||||||
|
on().block().offloadNear(on(), item().item);
|
||||||
|
on().rotation(rot);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UnitState getStartState(){
|
||||||
|
return load;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawStats(){
|
||||||
|
if(item.amount > 0) drawBackItems();
|
||||||
|
drawLight();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update(){
|
||||||
|
super.update();
|
||||||
|
|
||||||
|
if(on() == null || !on().block().compressable || item.amount == 0){
|
||||||
|
Effects.effect(io, x, y);
|
||||||
|
kill();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void added(){
|
||||||
|
super.added();
|
||||||
|
Effects.effect(io, x, y);
|
||||||
|
baseRotation = rotation;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDeath(){
|
||||||
|
Events.fire(new UnitDestroyEvent(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isCommanded(){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Tile on(){
|
||||||
|
return world.ltileWorld(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void drawBackItems(){
|
||||||
|
float itemtime = 0.5f;
|
||||||
|
float backTrns = 0f;
|
||||||
|
|
||||||
|
float size = itemSize / 1.5f;
|
||||||
|
|
||||||
|
Draw.rect(item.item.icon(Cicon.medium),
|
||||||
|
x + Angles.trnsx(rotation + 180f, backTrns),
|
||||||
|
y + Angles.trnsy(rotation + 180f, backTrns),
|
||||||
|
size, size, rotation);
|
||||||
|
|
||||||
|
Fonts.outline.draw(item.amount + "",
|
||||||
|
x + Angles.trnsx(rotation + 180f, backTrns),
|
||||||
|
y + Angles.trnsy(rotation + 180f, backTrns) - 1,
|
||||||
|
Pal.accent, 0.25f * itemtime / Scl.scl(1f), false, Align.center);
|
||||||
|
|
||||||
|
Draw.reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean loading(){
|
||||||
|
return state.is(load);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -99,6 +99,8 @@ public class Block extends BlockStorage{
|
|||||||
public boolean sync;
|
public boolean sync;
|
||||||
/** Whether this block uses conveyor-type placement mode.*/
|
/** Whether this block uses conveyor-type placement mode.*/
|
||||||
public boolean conveyorPlacement;
|
public boolean conveyorPlacement;
|
||||||
|
/** Whether this block uses is compatible with compressed.*/
|
||||||
|
public boolean compressable;
|
||||||
/**
|
/**
|
||||||
* The color of this block when displayed on the minimap or map preview.
|
* The color of this block when displayed on the minimap or map preview.
|
||||||
* Do not set manually! This is overriden when loading for most blocks.
|
* Do not set manually! This is overriden when loading for most blocks.
|
||||||
|
|||||||
@@ -0,0 +1,119 @@
|
|||||||
|
package mindustry.world.blocks.distribution;
|
||||||
|
|
||||||
|
import arc.*;
|
||||||
|
import arc.graphics.g2d.*;
|
||||||
|
import mindustry.content.*;
|
||||||
|
import mindustry.entities.type.*;
|
||||||
|
import mindustry.entities.type.base.*;
|
||||||
|
import mindustry.game.EventType.*;
|
||||||
|
import mindustry.type.*;
|
||||||
|
import mindustry.world.*;
|
||||||
|
|
||||||
|
public class CompressedConveyor extends ArmoredConveyor{
|
||||||
|
protected TextureRegion start;
|
||||||
|
public TextureRegion end;
|
||||||
|
|
||||||
|
protected static int cooldown = 10;
|
||||||
|
|
||||||
|
public CompressedConveyor(String name){
|
||||||
|
super(name);
|
||||||
|
compressable = true;
|
||||||
|
entityType = CompressedConveyorEntity::new;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void load(){
|
||||||
|
int i;
|
||||||
|
for(i = 0; i < regions.length; i++){
|
||||||
|
for(int j = 0; j < 4; j++){
|
||||||
|
regions[i][j] = Core.atlas.find(name + "-" + i + "-" + 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
start = Core.atlas.find(name + "-5-0");
|
||||||
|
end = Core.atlas.find(name + "-6-0");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void draw(Tile tile){
|
||||||
|
super.draw(tile);
|
||||||
|
|
||||||
|
if(start(tile) && end(tile)) return;
|
||||||
|
if(start(tile)) Draw.rect(start, tile.drawx(), tile.drawy(), tile.rotation() * 90);
|
||||||
|
if( end(tile)) Draw.rect( end, tile.drawx(), tile.drawy(), tile.rotation() * 90);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean start(Tile tile){
|
||||||
|
Tile[] inputs = new Tile[]{tile.back(), tile.left(), tile.right()};
|
||||||
|
for(Tile input : inputs){
|
||||||
|
if(input != null && input.getTeam() == tile.getTeam() && input.block().compressable && input.front() == tile) return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean end(Tile tile){
|
||||||
|
Tile next = tile.front();
|
||||||
|
if(next == null) return true;
|
||||||
|
if(next.getTeam() != tile.getTeam()) return true;
|
||||||
|
return !next.block().compressable;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void unitOn(Tile tile, Unit unit){
|
||||||
|
CompressedConveyorEntity entity = tile.ent();
|
||||||
|
entity.reload = cooldown;
|
||||||
|
if(unit instanceof CraterUnit) entity.crater = (CraterUnit)unit;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update(Tile tile){
|
||||||
|
CompressedConveyorEntity entity = tile.ent();
|
||||||
|
if(entity.reload > 0) entity.reload--;
|
||||||
|
}
|
||||||
|
|
||||||
|
class CompressedConveyorEntity extends ConveyorEntity{
|
||||||
|
public int reload = 0;
|
||||||
|
public CraterUnit crater = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean acceptItem(Item item, Tile tile, Tile source){
|
||||||
|
CompressedConveyorEntity entity = tile.ent();
|
||||||
|
|
||||||
|
if(!start(tile)) return false;
|
||||||
|
if(entity.crater == null || entity.crater.dead || !entity.crater.loading() || entity.crater.on() != tile){
|
||||||
|
if(entity.reload > 0) return false;
|
||||||
|
entity.reload = cooldown;
|
||||||
|
entity.crater = (CraterUnit)UnitTypes.crater.create(tile.getTeam());
|
||||||
|
entity.crater.set(tile.drawx(), tile.drawy());
|
||||||
|
entity.crater.rotation = tile.rotation() * 90;
|
||||||
|
entity.crater.add();
|
||||||
|
Events.fire(new UnitCreateEvent(entity.crater));
|
||||||
|
}
|
||||||
|
|
||||||
|
if(entity.crater.item().amount > 0 && entity.crater.item().item != item) return false;
|
||||||
|
if(entity.crater.item().amount >= entity.crater.getItemCapacity()) return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handleItem(Item item, Tile tile, Tile source){
|
||||||
|
CompressedConveyorEntity entity = tile.ent();
|
||||||
|
|
||||||
|
entity.crater.item().item = item;
|
||||||
|
entity.crater.item().amount++;
|
||||||
|
entity.crater.inactivity = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int acceptStack(Item item, int amount, Tile tile, Unit source){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handleStack(Item item, int amount, Tile tile, Unit source){
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -30,7 +30,7 @@ public class Conveyor extends Block implements Autotiler{
|
|||||||
private static ItemPos pos2 = new ItemPos();
|
private static ItemPos pos2 = new ItemPos();
|
||||||
private final Vec2 tr1 = new Vec2();
|
private final Vec2 tr1 = new Vec2();
|
||||||
private final Vec2 tr2 = new Vec2();
|
private final Vec2 tr2 = new Vec2();
|
||||||
private TextureRegion[][] regions = new TextureRegion[7][4];
|
protected TextureRegion[][] regions = new TextureRegion[7][4];
|
||||||
|
|
||||||
public float speed = 0f;
|
public float speed = 0f;
|
||||||
|
|
||||||
|
|||||||