Tau idle regen / Fixed non-synced alts / Fixed units not retreating

This commit is contained in:
Anuken
2018-08-24 10:19:56 -04:00
parent 5e8686db77
commit e796d44f92
7 changed files with 39 additions and 9 deletions

View File

@@ -45,13 +45,12 @@ public class Mechs implements ContentList{
weapon = Weapons.blaster;
maxSpeed = 4f;
altChargeAlpha = 0.03f;
armor = 15f;
}
@Override
public void updateAlt(Player player){
if(player.altHeat >= 0.91f){
}
}
};
@@ -119,6 +118,9 @@ public class Mechs implements ContentList{
@Override
public void updateAlt(Player player){
//idle regen
player.healBy(0.01f * Timers.delta());
if(player.altHeat >= 0.91f){
Effects.effect(UnitFx.healWave, player);
rect.setSize(healRange*2f).setCenter(player.x, player.y);

View File

@@ -480,6 +480,8 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
control.database().unlockContent(mech);
}
mech.updateAlt(this);
if(mobile){
updateFlying();
}else{
@@ -499,8 +501,6 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
protected void updateMech(){
Tile tile = world.tileWorld(x, y);
mech.updateAlt(this);
if(boostHeat > liftoffBoost + 0.1f){
achievedFlight = true;
}

View File

@@ -80,7 +80,7 @@ public abstract class GroundUnit extends BaseUnit{
}
public void update(){
if(health >= health && !isCommanded()){
if(health >= maxHealth() && !isCommanded()){
state.set(attack);
}

View File

@@ -244,7 +244,7 @@ public class Drone extends FlyingUnit implements BuilderTrait{
}
public void update(){
if(health >= health){
if(health >= maxHealth()){
state.set(attack);
}else if(!targetHasFlag(BlockFlag.repair)){
if(timer.get(timerTarget, 20)){

View File

@@ -134,7 +134,33 @@ public class ContentDisplay{
}
public static void displayMech(Table table, Mech mech){
table.table(title -> {
title.addImage(mech.getContentIcon()).size(8 * 6);
title.add("[accent]" + mech.localizedName()).padLeft(5);
});
table.row();
table.addImage("white").height(3).color(Color.LIGHT_GRAY).pad(15).padLeft(0).padRight(0).fillX();
table.row();
if(mech.description != null){
table.add(mech.description).padLeft(5).padRight(5).width(400f).wrap().fillX();
table.row();
table.addImage("white").height(3).color(Color.LIGHT_GRAY).pad(15).padLeft(0).padRight(0).fillX();
table.row();
}
table.left().defaults().fillX();
//TODO stat list goes here
//table.add(Bundles.format("text.mech.armor", mech.armor));
table.row();
//table.add(Bundles.format("text.unit.speed", Strings.toFixed(mech.speed, 1)));
table.row();
table.row();
}
public static void displayUnit(Table table, UnitType unit){