Unlockable mechs

This commit is contained in:
Anuken
2018-08-24 08:55:19 -04:00
parent 206314f4f4
commit 5de61aaed3
4 changed files with 29 additions and 8 deletions

View File

@@ -37,14 +37,23 @@ public class Mechs implements ContentList{
@Override
public void load(){
alpha = new Mech("alpha-mech", false){{
drillPower = 1;
mineSpeed = 1.5f;
speed = 0.5f;
boostSpeed = 0.85f;
weapon = Weapons.blaster;
maxSpeed = 4f;
}};
alpha = new Mech("alpha-mech", false){
{
drillPower = 1;
mineSpeed = 1.5f;
speed = 0.5f;
boostSpeed = 0.85f;
weapon = Weapons.blaster;
maxSpeed = 4f;
}
@Override
public void updateAlt(Player player){
if(player.altHeat >= 0.91f){
}
}
};
delta = new Mech("delta-mech", false){
{

View File

@@ -476,6 +476,9 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
updateShooting(); //server simulates player shooting
}
return;
}else{
//unlock mech when used
control.database().unlockContent(mech);
}
if(mobile){

View File

@@ -10,6 +10,8 @@ import io.anuke.mindustry.ui.ContentDisplay;
import io.anuke.ucore.graphics.Draw;
import io.anuke.ucore.scene.ui.layout.Table;
import static io.anuke.mindustry.Vars.mobile;
//TODO merge unit type with mech
public class Mech extends Upgrade implements UnlockableContent{
public boolean flying;
@@ -55,6 +57,11 @@ public class Mech extends Upgrade implements UnlockableContent{
public float getRotationAlpha(Player player){return 1f;}
@Override
public boolean isHidden() {
return !flying && mobile;
}
@Override
public void displayInfo(Table table){
ContentDisplay.displayMech(table, this);