Hover unit stuff

This commit is contained in:
Anuken
2022-04-30 23:00:35 -04:00
parent f833a4e1bb
commit 25208d0797
11 changed files with 99 additions and 14 deletions

View File

@@ -142,7 +142,7 @@ public class UnitPayload implements Payload{
if(unit.type == null) return;
//TODO this would be more accurate but has all sorts of associated problems (?)
if(true){
if(false){
float e = unit.elevation;
unit.elevation = 0f;
//avoids drawing mining or building

View File

@@ -327,11 +327,12 @@ public class UnitAssembler extends PayloadBlock{
units.clear();
}
powerWarmup = Mathf.lerpDelta(powerWarmup, efficiency > 0.0001f ? 1f : 0f, 0.1f);
droneWarmup = Mathf.lerpDelta(droneWarmup, units.size < dronesCreated ? efficiency : 0f, 0.1f);
float powerStatus = power == null ? 1f : power.status;
powerWarmup = Mathf.lerpDelta(powerStatus, powerStatus > 0.0001f ? 1f : 0f, 0.1f);
droneWarmup = Mathf.lerpDelta(droneWarmup, units.size < dronesCreated ? powerStatus : 0f, 0.1f);
totalDroneProgress += droneWarmup * delta();
if(units.size < dronesCreated && (droneProgress += edelta() / droneConstructTime) >= 1f){
if(units.size < dronesCreated && (droneProgress += delta() * powerStatus / droneConstructTime) >= 1f){
if(!net.client()){
var unit = droneType.create(team);
if(unit instanceof BuildingTetherc bt){