Removed core drone

This commit is contained in:
Anuken 2019-01-06 09:27:56 -05:00
parent d691e9f39d
commit fdd0c25a25

View File

@ -36,9 +36,6 @@ import java.io.IOException;
import static io.anuke.mindustry.Vars.*;
public class CoreBlock extends StorageBlock{
protected float droneRespawnDuration = 60 * 6;
protected UnitType droneType = UnitTypes.spirit;
protected TextureRegion openRegion;
protected TextureRegion topRegion;
@ -187,38 +184,11 @@ public class CoreBlock extends StorageBlock{
}
entity.heat = Mathf.lerpDelta(entity.heat, 1f, 0.1f);
entity.time += entity.delta();
entity.progress += 1f / (entity.currentUnit instanceof Player ? state.mode.respawnTime : droneRespawnDuration) * entity.delta();
entity.progress += 1f / state.mode.respawnTime * entity.delta();
if(entity.progress >= 1f){
Call.onUnitRespawn(tile, entity.currentUnit);
}
}else if(!netServer.isWaitingForPlayers()){
entity.warmup += Time.delta();
if(entity.solid && entity.warmup > 60f && unitGroups[tile.getTeamID()].getByID(entity.droneID) == null && !Net.client()){
boolean found = false;
for(BaseUnit unit : unitGroups[tile.getTeamID()].all()){
if(unit.getType().id == droneType.id){
entity.droneID = unit.id;
found = true;
break;
}
}
if(!found && !TutorialSector.supressDrone()){
BaseUnit unit = droneType.create(tile.getTeam());
unit.setSpawner(tile);
unit.setDead(true);
unit.add();
useContent(tile, droneType);
entity.droneID = unit.id;
}
}
entity.heat = Mathf.lerpDelta(entity.heat, 0f, 0.1f);
}
}
@ -229,9 +199,7 @@ public class CoreBlock extends StorageBlock{
public class CoreEntity extends TileEntity implements SpawnerTrait{
public Unit currentUnit;
int droneID = -1;
boolean solid = true;
float warmup;
float progress;
float time;
float heat;
@ -253,13 +221,11 @@ public class CoreBlock extends StorageBlock{
@Override
public void write(DataOutput stream) throws IOException{
stream.writeBoolean(solid);
stream.writeInt(droneID);
}
@Override
public void read(DataInput stream) throws IOException{
solid = stream.readBoolean();
droneID = stream.readInt();
}
}
}