mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-12 03:37:27 +07:00
Bugfixes
This commit is contained in:
parent
478d86677d
commit
1676ad5f1b
@ -837,6 +837,7 @@ team.none.name = gray
|
||||
team.green.name = green
|
||||
team.purple.name = purple
|
||||
unit.spirit.name = Spirit Repair Drone
|
||||
unit.draug.name = Draug Miner Drone
|
||||
unit.spirit.description = Automatically repairs blocks.
|
||||
unit.phantom.name = Phantom Builder Drone
|
||||
unit.phantom.description = An advanced drone unit. Helps players build blocks
|
||||
|
@ -1687,7 +1687,7 @@ public class Blocks implements ContentList{
|
||||
|
||||
repairPoint = new RepairPoint("repair-point"){{
|
||||
requirements(Category.units, ItemStack.with(Items.lead, 30, Items.copper, 30, Items.silicon, 30));
|
||||
repairSpeed = 0.1f;
|
||||
repairSpeed = 0.3f;
|
||||
powerUse = 1f;
|
||||
}};
|
||||
|
||||
|
@ -261,7 +261,7 @@ public class TechTree implements ContentList{
|
||||
});
|
||||
|
||||
node(wraithFactory, () -> {
|
||||
node(spiritFactory, () -> {
|
||||
node(ghoulFactory, () -> {
|
||||
node(revenantFactory, () -> {
|
||||
|
||||
});
|
||||
|
@ -436,12 +436,16 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
||||
table.update(() -> {
|
||||
Vector2 v = button.localToStageCoordinates(Tmp.v1.setZero());
|
||||
table.setPosition(v.x, v.y, Align.topLeft);
|
||||
if(!isShown()){
|
||||
table.remove();
|
||||
lastTable[0] = null;
|
||||
}
|
||||
});
|
||||
|
||||
table.pack();
|
||||
table.act(Core.graphics.getDeltaTime());
|
||||
|
||||
Core.scene.add(table);
|
||||
addChild(table);
|
||||
lastTable[0] = table;
|
||||
});
|
||||
}
|
||||
|
@ -46,8 +46,6 @@ public abstract class BulletType extends Content{
|
||||
public StatusEffect status = StatusEffects.none;
|
||||
/** Intensity of applied status effect in terms of duration. */
|
||||
public float statusDuration = 60 * 1f;
|
||||
/** Whether to sync this bullet to clients. */
|
||||
public boolean syncable;
|
||||
/** Whether this bullet type collides with tiles. */
|
||||
public boolean collidesTiles = true;
|
||||
/** Whether this bullet type collides with tiles that are of the same team. */
|
||||
|
@ -105,7 +105,8 @@ public abstract class BaseUnit extends Unit implements ShooterTrait{
|
||||
}
|
||||
|
||||
public boolean targetHasFlag(BlockFlag flag){
|
||||
return target instanceof TileEntity && ((TileEntity)target).tile.block().flags.contains(flag);
|
||||
return (target instanceof TileEntity && ((TileEntity)target).tile.block().flags.contains(flag)) ||
|
||||
(target instanceof Tile && ((Tile)target).block().flags.contains(flag));
|
||||
}
|
||||
|
||||
public void setState(UnitState state){
|
||||
|
@ -17,7 +17,7 @@ public abstract class BaseDrone extends FlyingUnit{
|
||||
|
||||
public void update(){
|
||||
if(health >= maxHealth()){
|
||||
state.set(attack);
|
||||
state.set(getStartState());
|
||||
}else if(!targetHasFlag(BlockFlag.repair)){
|
||||
if(retarget()){
|
||||
Tile repairPoint = Geometry.findClosest(x, y, world.indexer.getAllied(team, BlockFlag.repair));
|
||||
@ -44,7 +44,7 @@ public abstract class BaseDrone extends FlyingUnit{
|
||||
|
||||
@Override
|
||||
public void behavior(){
|
||||
if(health <= health * type.retreatPercent){
|
||||
if(health <= maxHealth() * type.retreatPercent && !state.is(retreat) && Geometry.findClosest(x, y, world.indexer.getAllied(team, BlockFlag.repair)) != null){
|
||||
setState(retreat);
|
||||
}
|
||||
}
|
||||
|
@ -33,32 +33,21 @@ public class MinerDrone extends BaseDrone implements MinerTrait{
|
||||
|
||||
if(entity == null) return;
|
||||
|
||||
if(targetItem == null){
|
||||
findItem();
|
||||
}
|
||||
findItem();
|
||||
|
||||
//core full
|
||||
//core full of the target item, do nothing
|
||||
if(targetItem != null && entity.block.acceptStack(targetItem, 1, entity.tile, MinerDrone.this) == 0){
|
||||
MinerDrone.this.clearItem();
|
||||
return;
|
||||
}
|
||||
|
||||
//if inventory is full, drop it off.
|
||||
if(item.amount >= getItemCapacity()){
|
||||
if(item.amount >= getItemCapacity() || (targetItem != null && !acceptsItem(targetItem))){
|
||||
setState(drop);
|
||||
}else{
|
||||
if(targetItem != null && !acceptsItem(targetItem)){
|
||||
setState(drop);
|
||||
return;
|
||||
}
|
||||
|
||||
if(retarget()){
|
||||
findItem();
|
||||
|
||||
if(targetItem == null) return;
|
||||
|
||||
if(retarget() && targetItem != null){
|
||||
target = world.indexer.findClosestOre(x, y, targetItem);
|
||||
};
|
||||
}
|
||||
|
||||
if(target instanceof Tile){
|
||||
moveTo(type.range / 1.5f);
|
||||
@ -92,13 +81,7 @@ public class MinerDrone extends BaseDrone implements MinerTrait{
|
||||
}
|
||||
|
||||
public void update(){
|
||||
if(item.amount == 0){
|
||||
setState(mine);
|
||||
return;
|
||||
}
|
||||
|
||||
if(item.item.type != ItemType.material){
|
||||
item.amount = 0;
|
||||
if(item.amount == 0 || item.item.type != ItemType.material){
|
||||
setState(mine);
|
||||
return;
|
||||
}
|
||||
|
@ -204,7 +204,7 @@ public class MassDriver extends Block{
|
||||
if(entity.link == other.pos()){
|
||||
Call.linkMassDriver(null, tile, -1);
|
||||
return false;
|
||||
}else if(other.block() instanceof MassDriver && other.dst(tile) <= range){
|
||||
}else if(other.block() instanceof MassDriver && other.dst(tile) <= range && other.getTeam() == tile.getTeam()){
|
||||
Call.linkMassDriver(null, tile, other.pos());
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user