Increased bridge range / Bugfixes

This commit is contained in:
Anuken
2018-07-14 09:26:34 -04:00
parent 302ae0a83c
commit 0db6020231
7 changed files with 24 additions and 31 deletions

View File

@@ -27,12 +27,13 @@ public class DistributionBlocks extends BlockList implements ContentList{
}};
bridgeConveyor = new BufferedItemBridge("bridge-conveyor"){{
range = 3;
range = 4;
speed = 60f;
}};
phaseConveyor = new ItemBridge("phase-conveyor"){{
range = 7;
hasPower = false;
range = 11;
hasPower = true;
consumes.power(0.05f);
}};

View File

@@ -58,13 +58,13 @@ public class LiquidBlocks extends BlockList implements ContentList{
liquidJunction = new LiquidJunction("liquid-junction");
bridgeConduit = new LiquidExtendingBridge("bridge-conduit"){{
range = 3;
range = 4;
hasPower = false;
}};
phaseConduit = new LiquidBridge("phase-conduit"){{
range = 7;
hasPower = false;
range = 11;
hasPower = true;
consumes.power(0.05f);
}};
}

View File

@@ -112,6 +112,8 @@ public class MapEditor{
boolean isfloor = drawBlock instanceof Floor && drawBlock != Blocks.air;
if(drawBlock.isMultiblock()){
x = Mathf.clamp(x, (drawBlock.size-1)/2, map.width() - drawBlock.size/2 - 1);
y = Mathf.clamp(y, (drawBlock.size-1)/2, map.height() - drawBlock.size/2 - 1);
int offsetx = -(drawBlock.size - 1) / 2;
int offsety = -(drawBlock.size - 1) / 2;

View File

@@ -23,10 +23,6 @@ import static io.anuke.mindustry.Vars.world;
public abstract class FlyingUnit extends BaseUnit implements CarryTrait{
protected static Translator vec = new Translator();
protected static float wobblyness = 0.6f;
protected Trail trail = new Trail(8);
protected CarriableTrait carrying;
protected final UnitState
resupply = new UnitState(){
@@ -44,6 +40,7 @@ public abstract class FlyingUnit extends BaseUnit implements CarryTrait{
}
}
},
idle = new UnitState(){
public void update(){
retarget(() -> {
@@ -62,6 +59,7 @@ public abstract class FlyingUnit extends BaseUnit implements CarryTrait{
velocity.scl(0.8f);
}
},
attack = new UnitState(){
public void entered(){
target = null;
@@ -88,7 +86,7 @@ public abstract class FlyingUnit extends BaseUnit implements CarryTrait{
attack(150f);
if((Mathf.angNear(angleTo(target), rotation, 15f) || !inventory.getAmmo().bullet.keepVelocity) //bombers don't care about rotation
&& distanceTo(target) < inventory.getAmmo().getRange()){
&& distanceTo(target) < inventory.getAmmo().getRange()){
AmmoType ammo = inventory.getAmmo();
inventory.useAmmo();
@@ -117,6 +115,8 @@ public abstract class FlyingUnit extends BaseUnit implements CarryTrait{
}
}
};
protected Trail trail = new Trail(8);
protected CarriableTrait carrying;
//instantiation only
public FlyingUnit(){
@@ -149,7 +149,7 @@ public abstract class FlyingUnit extends BaseUnit implements CarryTrait{
updateRotation();
trail.update(x + Angles.trnsx(rotation + 180f, 6f) + Mathf.range(wobblyness),
y + Angles.trnsy(rotation + 180f, 6f) + Mathf.range(wobblyness));
y + Angles.trnsy(rotation + 180f, 6f) + Mathf.range(wobblyness));
wobble();
}
@@ -173,7 +173,7 @@ public abstract class FlyingUnit extends BaseUnit implements CarryTrait{
@Override
public void behavior(){
if(health <= health * type.retreatPercent && !isWave &&
Geometry.findClosest(x, y, world.indexer().getAllied(team, BlockFlag.repair)) != null){
Geometry.findClosest(x, y, world.indexer().getAllied(team, BlockFlag.repair)) != null){
setState(retreat);
}

View File

@@ -9,18 +9,12 @@ import io.anuke.ucore.core.Events;
import io.anuke.ucore.core.Settings;
public class ContentDatabase{
/**
* Maps unlockable type names to a set of unlocked content.
*/
/** Maps unlockable type names to a set of unlocked content.*/
private ObjectMap<String, ObjectSet<String>> unlocked = new ObjectMap<>();
/**
* Whether unlockables have changed since the last save.
*/
/** Whether unlockables have changed since the last save.*/
private boolean dirty;
/**
* Returns whether or not this piece of content is unlocked yet.
*/
/** Returns whether or not this piece of content is unlocked yet.*/
public boolean isUnlocked(UnlockableContent content){
if(!unlocked.containsKey(content.getContentTypeName())){
unlocked.put(content.getContentTypeName(), new ObjectSet<>());
@@ -57,16 +51,12 @@ public class ContentDatabase{
return ret;
}
/**
* Returns whether unlockables have changed since the last save.
*/
/** Returns whether unlockables have changed since the last save.*/
public boolean isDirty(){
return dirty;
}
/**
* Clears all unlocked content.
*/
/** Clears all unlocked content.*/
public void reset(){
unlocked.clear();
dirty = true;

View File

@@ -153,7 +153,7 @@ public class LevelDialog extends FloatingDialog{
pane.setFadeScrollBars(false);
table.row();
for(GameMode mode : GameMode.values()){
table.labelWrap("[accent]" + mode.toString() + ":[] [lightgray]" + mode.description()).width(600f);
table.labelWrap("[accent]" + mode.toString() + ":[] [lightgray]" + mode.description()).width(400f);
table.row();
}

View File

@@ -99,8 +99,8 @@ public class ItemBridge extends Block{
Lines.dashLine(
x * tilesize + Geometry.d4[i].x * (tilesize / 2f + 2),
y * tilesize + Geometry.d4[i].y * (tilesize / 2f + 2),
x * tilesize + Geometry.d4[i].x * range * tilesize,
y * tilesize + Geometry.d4[i].y * range * tilesize,
x * tilesize + Geometry.d4[i].x * (range + 0.5f) * tilesize,
y * tilesize + Geometry.d4[i].y * (range + 0.5f) * tilesize,
range);
}