Fixed build block repair / Sectors in random maps / Editor unlocks
This commit is contained in:
@@ -16,6 +16,7 @@ import io.anuke.mindustry.entities.effect.Lightning;
|
|||||||
import io.anuke.mindustry.game.ContentList;
|
import io.anuke.mindustry.game.ContentList;
|
||||||
import io.anuke.mindustry.graphics.Palette;
|
import io.anuke.mindustry.graphics.Palette;
|
||||||
import io.anuke.mindustry.world.Tile;
|
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.mindustry.world.blocks.distribution.MassDriver.DriverBulletData;
|
||||||
import io.anuke.ucore.core.Effects;
|
import io.anuke.ucore.core.Effects;
|
||||||
import io.anuke.ucore.core.Timers;
|
import io.anuke.ucore.core.Timers;
|
||||||
@@ -63,11 +64,11 @@ public class TurretBullets extends BulletList implements ContentList{
|
|||||||
@Override
|
@Override
|
||||||
public void hitTile(Bullet b, Tile tile){
|
public void hitTile(Bullet b, Tile tile){
|
||||||
super.hit(b);
|
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);
|
Effects.effect(BlockFx.healBlock, tile.drawx(), tile.drawy(), tile.block().size);
|
||||||
tile.entity.health += healAmount;
|
tile.entity.healBy(healAmount);
|
||||||
tile.entity.health = Mathf.clamp(tile.entity.health, 0, tile.block().health);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -210,7 +210,9 @@ public class Bullet extends BulletEntity<BulletType> implements TeamTrait, SyncT
|
|||||||
tile = tile.target();
|
tile = tile.target();
|
||||||
|
|
||||||
if(tile.entity != null && tile.entity.collide(this) && !tile.entity.isDead() && (type.collidesTeam || tile.getTeam() != team)){
|
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){
|
if(!supressCollision){
|
||||||
type.hitTile(this, tile);
|
type.hitTile(this, tile);
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.badlogic.gdx.utils.Array;
|
|||||||
import com.badlogic.gdx.utils.ObjectMap;
|
import com.badlogic.gdx.utils.ObjectMap;
|
||||||
import com.badlogic.gdx.utils.ObjectMap.Entry;
|
import com.badlogic.gdx.utils.ObjectMap.Entry;
|
||||||
import com.badlogic.gdx.utils.ObjectSet;
|
import com.badlogic.gdx.utils.ObjectSet;
|
||||||
|
import io.anuke.mindustry.core.GameState.State;
|
||||||
import io.anuke.mindustry.net.Net;
|
import io.anuke.mindustry.net.Net;
|
||||||
import io.anuke.mindustry.type.ContentType;
|
import io.anuke.mindustry.type.ContentType;
|
||||||
import io.anuke.ucore.core.Settings;
|
import io.anuke.ucore.core.Settings;
|
||||||
@@ -46,7 +47,7 @@ public class Unlocks{
|
|||||||
//client connected to server: always return the IP-specific set
|
//client connected to server: always return the IP-specific set
|
||||||
if(Net.client()){
|
if(Net.client()){
|
||||||
return getSet(Net.getLastIP());
|
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();
|
return rootSet();
|
||||||
}else{ //per-mode set
|
}else{ //per-mode set
|
||||||
return getSet(state.mode.name());
|
return getSet(state.mode.name());
|
||||||
|
|||||||
@@ -229,7 +229,8 @@ public class DesktopInput extends InputHandler{
|
|||||||
}else{ //if it's out of bounds, shooting is just fine
|
}else{ //if it's out of bounds, shooting is just fine
|
||||||
player.isShooting = true;
|
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){
|
if(recipe == null){
|
||||||
player.clearBuilding();
|
player.clearBuilding();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -141,6 +141,7 @@ public class WorldGenerator{
|
|||||||
|
|
||||||
public void playRandomMap(){
|
public void playRandomMap(){
|
||||||
ui.loadLogic(() -> {
|
ui.loadLogic(() -> {
|
||||||
|
world.setSector(null);
|
||||||
logic.reset();
|
logic.reset();
|
||||||
|
|
||||||
int sx = (short)Mathf.range(Short.MAX_VALUE/2);
|
int sx = (short)Mathf.range(Short.MAX_VALUE/2);
|
||||||
|
|||||||
Reference in New Issue
Block a user