Miner drone / Editor bugfixes

This commit is contained in:
Anuken
2019-06-12 22:09:24 -04:00
parent 0cbbcc00a5
commit 8ac497354a
24 changed files with 4862 additions and 4714 deletions

View File

@@ -77,7 +77,7 @@ public class Blocks implements ContentList{
duo, scatter, scorch, hail, arc, wave, lancer, swarmer, salvo, fuse, ripple, cyclone, spectre, meltdown,
//units
spiritFactory, phantomFactory, wraithFactory, ghoulFactory, revenantFactory, daggerFactory, crawlerFactory, titanFactory,
draugFactory, spiritFactory, phantomFactory, wraithFactory, ghoulFactory, revenantFactory, daggerFactory, crawlerFactory, titanFactory,
fortressFactory, repairPoint,
//upgrades
@@ -1590,6 +1590,16 @@ public class Blocks implements ContentList{
BooleanProvider padVisible = () -> state.rules.attackMode || state.rules.pvp || state.isEditor();
draugFactory = new UnitFactory("draug-factory"){{
requirements(Category.units, ItemStack.with(Items.copper, 30, Items.lead, 120));
type = UnitTypes.draug;
produceTime = 5000;
size = 2;
maxSpawn = 2;
consumes.power(0.5f);
consumes.items();
}};
spiritFactory = new UnitFactory("spirit-factory"){{
requirements(Category.units, ItemStack.with(Items.copper, 70, Items.lead, 110, Items.silicon, 80));
type = UnitTypes.spirit;

View File

@@ -71,7 +71,7 @@ public class Mechs implements ContentList{
weapon = new Weapon("shockgun"){{
shake = 2f;
length = 1f;
reload = 45f;
reload = 55f;
shotDelay = 3f;
roundrobin = true;
shots = 2;
@@ -159,12 +159,12 @@ public class Mechs implements ContentList{
weaponOffsetX = 1;
weaponOffsetY = 0;
engineColor = Color.valueOf("feb380");
health = 320f;
health = 350f;
buildPower = 1.5f;
weapon = new Weapon("swarmer"){{
length = 1.5f;
recoil = 4f;
reload = 45f;
reload = 38f;
shots = 4;
spacing = 8f;
inaccuracy = 8f;

View File

@@ -8,12 +8,27 @@ import io.anuke.mindustry.type.Weapon;
public class UnitTypes implements ContentList{
public static UnitType
spirit, phantom,
draug, spirit, phantom,
wraith, ghoul, revenant, lich, reaper,
dagger, crawler, titan, fortress, eruptor, chaosArray, eradicator;
@Override
public void load(){
draug = new UnitType("draug", Draug.class, Draug::new){{
isFlying = true;
drag = 0.01f;
speed = 0.3f;
maxVelocity = 1.2f;
range = 50f;
health = 60;
minePower = 0.5f;
engineSize = 1.8f;
engineOffset = 5.7f;
weapon = new Weapon("you have incurred my wrath. prepare to die."){{
bullet = Bullets.lancerLaser;
}};
}};
spirit = new UnitType("spirit", Spirit.class, Spirit::new){{
isFlying = true;
drag = 0.01f;

View File

@@ -82,6 +82,7 @@ public class Zones implements ContentList{
alwaysUnlocked = true;
conditionWave = 5;
launchPeriod = 5;
loadout = Loadouts.basicFoundation;
zoneRequirements = ZoneRequirement.with(desertWastes, 60);
resources = new Item[]{Items.copper, Items.scrap, Items.lead, Items.coal, Items.sand};
}};

View File

@@ -9,7 +9,6 @@ import io.anuke.mindustry.world.Tile;
import io.anuke.mindustry.world.blocks.Floor;
import static io.anuke.mindustry.Vars.content;
import static io.anuke.mindustry.Vars.world;
public class DrawOperation{
private MapEditor editor;
@@ -66,7 +65,7 @@ public class DrawOperation{
tile.setFloor((Floor)content.block(to));
}else if(type == OpType.block.ordinal()){
Block block = content.block(to);
world.setBlock(tile, block, tile.getTeam(), tile.rotation());
tile.setBlock(block, tile.getTeam(), tile.rotation());
}else if(type == OpType.rotation.ordinal()){
tile.rotation(to);
}else if(type == OpType.team.ordinal()){

View File

@@ -112,14 +112,17 @@ public enum EditorTool{
if(editor.drawBlock.isOverlay()){
Block dest = tile.overlay();
if(dest == editor.drawBlock) return;
tester = t -> t.overlay() == dest;
setter = t -> t.setOverlay(editor.drawBlock);
}else if(editor.drawBlock.isFloor()){
Block dest = tile.floor();
if(dest == editor.drawBlock) return;
tester = t -> t.floor() == dest;
setter = t -> t.setFloorUnder(editor.drawBlock.asFloor());
}else{
Block dest = tile.block();
if(dest == editor.drawBlock) return;
tester = t -> t.block() == dest;
setter = t -> t.setBlock(editor.drawBlock);
}
@@ -130,9 +133,9 @@ public enum EditorTool{
//only fill synthetic blocks, it's meaningless otherwise
if(tile.link().synthetic()){
Team dest = tile.getTeam();
fill(editor, x, y, false, t -> t.getTeam() == dest, t -> t.setTeam(editor.drawTeam));
if(dest == editor.drawTeam) return;
fill(editor, x, y, false, t -> t.getTeamID() == dest.ordinal() && t.link().synthetic(), t -> t.setTeam(editor.drawTeam));
}
}
}

View File

@@ -413,7 +413,7 @@ public class MapEditorDialog extends Dialog implements Disposable{
}
Table table = new Table("dialogDim");
table.defaults().size(280f, 70f);
table.defaults().size(300f, 70f);
for(int i = 0; i < tool.altModes.length; i++){
int mode = i;

View File

@@ -0,0 +1,4 @@
package io.anuke.mindustry.entities.type.base;
public class Draug extends MinerDrone{
}

View File

@@ -53,9 +53,7 @@ public class MinerDrone extends FlyingUnit implements MinerTrait{
}
retarget(() -> {
if(getMineTile() == null){
findItem();
}
findItem();
if(targetItem == null) return;
@@ -147,6 +145,11 @@ public class MinerDrone extends FlyingUnit implements MinerTrait{
}
};
@Override
public UnitState getStartState(){
return mine;
}
@Override
public void update(){
super.update();

View File

@@ -127,7 +127,7 @@ public class UnitFactory extends Block{
Shaders.build.progress = entity.buildTime / produceTime;
Shaders.build.color.set(Pal.accent);
Shaders.build.color.a = entity.speedScl;
Shaders.build.time = -entity.time / 10f;
Shaders.build.time = -entity.time / 20f;
Draw.shader(Shaders.build);
Draw.rect(region, tile.drawx(), tile.drawy());
@@ -137,7 +137,7 @@ public class UnitFactory extends Block{
Draw.alpha(entity.speedScl);
Lines.lineAngleCenter(
tile.drawx() + Mathf.sin(entity.time, 6f, Vars.tilesize / 2f * size - 2f),
tile.drawx() + Mathf.sin(entity.time, 20f, Vars.tilesize / 2f * size - 2f),
tile.drawy(),
90,
size * Vars.tilesize - 4f);