Fixed build block repair / Sectors in random maps / Editor unlocks

This commit is contained in:
Anuken
2018-10-18 16:31:15 -04:00
parent 5e5838a8c1
commit 91a2dfab36
5 changed files with 12 additions and 6 deletions

View File

@@ -16,6 +16,7 @@ import io.anuke.mindustry.entities.effect.Lightning;
import io.anuke.mindustry.game.ContentList;
import io.anuke.mindustry.graphics.Palette;
import io.anuke.mindustry.world.Tile;
import io.anuke.mindustry.world.blocks.BuildBlock;
import io.anuke.mindustry.world.blocks.distribution.MassDriver.DriverBulletData;
import io.anuke.ucore.core.Effects;
import io.anuke.ucore.core.Timers;
@@ -63,11 +64,11 @@ public class TurretBullets extends BulletList implements ContentList{
@Override
public void hitTile(Bullet b, Tile tile){
super.hit(b);
tile = tile.target();
if(tile.getTeam() == b.getTeam()){
if(tile.getTeam() == b.getTeam() && !(tile.block() instanceof BuildBlock)){
Effects.effect(BlockFx.healBlock, tile.drawx(), tile.drawy(), tile.block().size);
tile.entity.health += healAmount;
tile.entity.health = Mathf.clamp(tile.entity.health, 0, tile.block().health);
tile.entity.healBy(healAmount);
}
}
};

View File

@@ -210,7 +210,9 @@ public class Bullet extends BulletEntity<BulletType> implements TeamTrait, SyncT
tile = tile.target();
if(tile.entity != null && tile.entity.collide(this) && !tile.entity.isDead() && (type.collidesTeam || tile.getTeam() != team)){
tile.entity.collision(this);
if(tile.getTeam() != team){
tile.entity.collision(this);
}
if(!supressCollision){
type.hitTile(this, tile);

View File

@@ -4,6 +4,7 @@ import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.ObjectMap;
import com.badlogic.gdx.utils.ObjectMap.Entry;
import com.badlogic.gdx.utils.ObjectSet;
import io.anuke.mindustry.core.GameState.State;
import io.anuke.mindustry.net.Net;
import io.anuke.mindustry.type.ContentType;
import io.anuke.ucore.core.Settings;
@@ -46,7 +47,7 @@ public class Unlocks{
//client connected to server: always return the IP-specific set
if(Net.client()){
return getSet(Net.getLastIP());
}else if(world.getSector() != null || state.mode.infiniteResources){ //sector-sandbox have shared set
}else if((world.getSector() != null || state.mode.infiniteResources) || state.is(State.menu)){ //sector-sandbox have shared set
return rootSet();
}else{ //per-mode set
return getSet(state.mode.name());

View File

@@ -229,7 +229,8 @@ public class DesktopInput extends InputHandler{
}else{ //if it's out of bounds, shooting is just fine
player.isShooting = true;
}
}else if(Inputs.keyTap(section, "deselect") && (recipe != null || mode != none || player.isBuilding())){
}else if(Inputs.keyTap(section, "deselect") && (recipe != null || mode != none || player.isBuilding()) &&
!(player.getCurrentRequest() != null && player.getCurrentRequest().remove && KeyBinds.get(section, "deselect") == KeyBinds.get(section, "break"))){
if(recipe == null){
player.clearBuilding();
}

View File

@@ -141,6 +141,7 @@ public class WorldGenerator{
public void playRandomMap(){
ui.loadLogic(() -> {
world.setSector(null);
logic.reset();
int sx = (short)Mathf.range(Short.MAX_VALUE/2);