mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-19 16:57:15 +07:00
Removed core drone
This commit is contained in:
parent
d691e9f39d
commit
fdd0c25a25
@ -36,9 +36,6 @@ import java.io.IOException;
|
|||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
|
|
||||||
public class CoreBlock extends StorageBlock{
|
public class CoreBlock extends StorageBlock{
|
||||||
protected float droneRespawnDuration = 60 * 6;
|
|
||||||
protected UnitType droneType = UnitTypes.spirit;
|
|
||||||
|
|
||||||
protected TextureRegion openRegion;
|
protected TextureRegion openRegion;
|
||||||
protected TextureRegion topRegion;
|
protected TextureRegion topRegion;
|
||||||
|
|
||||||
@ -187,38 +184,11 @@ public class CoreBlock extends StorageBlock{
|
|||||||
}
|
}
|
||||||
entity.heat = Mathf.lerpDelta(entity.heat, 1f, 0.1f);
|
entity.heat = Mathf.lerpDelta(entity.heat, 1f, 0.1f);
|
||||||
entity.time += entity.delta();
|
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){
|
if(entity.progress >= 1f){
|
||||||
Call.onUnitRespawn(tile, entity.currentUnit);
|
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 class CoreEntity extends TileEntity implements SpawnerTrait{
|
||||||
public Unit currentUnit;
|
public Unit currentUnit;
|
||||||
int droneID = -1;
|
|
||||||
boolean solid = true;
|
boolean solid = true;
|
||||||
float warmup;
|
|
||||||
float progress;
|
float progress;
|
||||||
float time;
|
float time;
|
||||||
float heat;
|
float heat;
|
||||||
@ -253,13 +221,11 @@ public class CoreBlock extends StorageBlock{
|
|||||||
@Override
|
@Override
|
||||||
public void write(DataOutput stream) throws IOException{
|
public void write(DataOutput stream) throws IOException{
|
||||||
stream.writeBoolean(solid);
|
stream.writeBoolean(solid);
|
||||||
stream.writeInt(droneID);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void read(DataInput stream) throws IOException{
|
public void read(DataInput stream) throws IOException{
|
||||||
solid = stream.readBoolean();
|
solid = stream.readBoolean();
|
||||||
droneID = stream.readInt();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user