mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-22 05:38:19 +07:00
Minor refactoring & tech tree fixes
This commit is contained in:
@ -270,10 +270,10 @@ public class ErekirTechTree{
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
node(tankReconstructor, () -> {
|
node(tankReconstructor, Seq.with(new OnSector(three)), () -> {
|
||||||
node(UnitTypes.locus);
|
node(UnitTypes.locus);
|
||||||
|
|
||||||
node(shipReconstructor, () -> {
|
node(shipReconstructor, Seq.with(new OnSector(four)), () -> {
|
||||||
node(UnitTypes.avert);
|
node(UnitTypes.avert);
|
||||||
|
|
||||||
node(mechReconstructor, () -> {
|
node(mechReconstructor, () -> {
|
||||||
|
@ -146,6 +146,7 @@ public class Planets{
|
|||||||
minZoom = 0.6f;
|
minZoom = 0.6f;
|
||||||
drawOrbit = false;
|
drawOrbit = false;
|
||||||
clipRadius = 2f;
|
clipRadius = 2f;
|
||||||
|
defaultEnv = Env.space;
|
||||||
|
|
||||||
generator = new AsteroidGenerator();
|
generator = new AsteroidGenerator();
|
||||||
cgen.get((AsteroidGenerator)generator);
|
cgen.get((AsteroidGenerator)generator);
|
||||||
|
@ -1245,7 +1245,7 @@ public class UnitTypes{
|
|||||||
//region air support
|
//region air support
|
||||||
|
|
||||||
mono = new UnitType("mono"){{
|
mono = new UnitType("mono"){{
|
||||||
defaultController = u -> new MinerAI();
|
controller = u -> new MinerAI();
|
||||||
|
|
||||||
flying = true;
|
flying = true;
|
||||||
drag = 0.06f;
|
drag = 0.06f;
|
||||||
@ -1264,7 +1264,7 @@ public class UnitTypes{
|
|||||||
}};
|
}};
|
||||||
|
|
||||||
poly = new UnitType("poly"){{
|
poly = new UnitType("poly"){{
|
||||||
defaultController = u -> new BuilderAI();
|
controller = u -> new BuilderAI();
|
||||||
|
|
||||||
flying = true;
|
flying = true;
|
||||||
drag = 0.05f;
|
drag = 0.05f;
|
||||||
@ -3418,7 +3418,7 @@ public class UnitTypes{
|
|||||||
//TODO bad name
|
//TODO bad name
|
||||||
evoke = new ErekirUnitType("evoke"){{
|
evoke = new ErekirUnitType("evoke"){{
|
||||||
coreUnitDock = true;
|
coreUnitDock = true;
|
||||||
defaultController = u -> new BuilderAI(true, coreFleeRange);
|
controller = u -> new BuilderAI(true, coreFleeRange);
|
||||||
isCounted = false;
|
isCounted = false;
|
||||||
envDisabled = 0;
|
envDisabled = 0;
|
||||||
|
|
||||||
@ -3478,7 +3478,7 @@ public class UnitTypes{
|
|||||||
|
|
||||||
incite = new ErekirUnitType("incite"){{
|
incite = new ErekirUnitType("incite"){{
|
||||||
coreUnitDock = true;
|
coreUnitDock = true;
|
||||||
defaultController = u -> new BuilderAI(true, coreFleeRange);
|
controller = u -> new BuilderAI(true, coreFleeRange);
|
||||||
isCounted = false;
|
isCounted = false;
|
||||||
envDisabled = 0;
|
envDisabled = 0;
|
||||||
|
|
||||||
@ -3551,7 +3551,7 @@ public class UnitTypes{
|
|||||||
|
|
||||||
emanate = new ErekirUnitType("emanate"){{
|
emanate = new ErekirUnitType("emanate"){{
|
||||||
coreUnitDock = true;
|
coreUnitDock = true;
|
||||||
defaultController = u -> new BuilderAI(true, coreFleeRange);
|
controller = u -> new BuilderAI(true, coreFleeRange);
|
||||||
isCounted = false;
|
isCounted = false;
|
||||||
envDisabled = 0;
|
envDisabled = 0;
|
||||||
|
|
||||||
|
@ -10,7 +10,6 @@ import mindustry.graphics.g3d.*;
|
|||||||
import mindustry.maps.generators.*;
|
import mindustry.maps.generators.*;
|
||||||
import mindustry.type.*;
|
import mindustry.type.*;
|
||||||
import mindustry.world.blocks.environment.*;
|
import mindustry.world.blocks.environment.*;
|
||||||
import mindustry.world.meta.*;
|
|
||||||
|
|
||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
@ -142,7 +141,6 @@ public class AsteroidGenerator extends BlankPlanetGenerator{
|
|||||||
|
|
||||||
state.rules.dragMultiplier = 0.7f; //yes, space actually has 0 drag but true 0% drag is very annoying
|
state.rules.dragMultiplier = 0.7f; //yes, space actually has 0 drag but true 0% drag is very annoying
|
||||||
state.rules.borderDarkness = false;
|
state.rules.borderDarkness = false;
|
||||||
state.rules.env = Env.space;
|
|
||||||
state.rules.waves = true;
|
state.rules.waves = true;
|
||||||
|
|
||||||
//TODO ???
|
//TODO ???
|
||||||
|
@ -471,7 +471,7 @@ public class ContentParser{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(value.has("defaultController")){
|
if(value.has("defaultController")){
|
||||||
unit.defaultController = u -> supply(resolve(value.getString("defaultController"), FlyingAI.class)).get();
|
unit.controller = u -> supply(resolve(value.getString("defaultController"), FlyingAI.class)).get();
|
||||||
value.remove("defaultController");
|
value.remove("defaultController");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ public class UnitType extends UnlockableContent{
|
|||||||
/** The default AI controller to assign on creation. */
|
/** The default AI controller to assign on creation. */
|
||||||
public Prov<? extends UnitController> aiController = () -> !flying ? new GroundAI() : new FlyingAI();
|
public Prov<? extends UnitController> aiController = () -> !flying ? new GroundAI() : new FlyingAI();
|
||||||
/** Function that chooses AI controller based on unit entity. */
|
/** Function that chooses AI controller based on unit entity. */
|
||||||
public Func<Unit, ? extends UnitController> defaultController = u -> !playerControllable || (u.team.isAI() && !u.team.rules().rtsAi) ? aiController.get() : new CommandAI();
|
public Func<Unit, ? extends UnitController> controller = u -> !playerControllable || (u.team.isAI() && !u.team.rules().rtsAi) ? aiController.get() : new CommandAI();
|
||||||
|
|
||||||
public Color outlineColor = Pal.darkerMetal;
|
public Color outlineColor = Pal.darkerMetal;
|
||||||
public int outlineRadius = 3;
|
public int outlineRadius = 3;
|
||||||
@ -219,7 +219,7 @@ public class UnitType extends UnlockableContent{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public UnitController createController(Unit unit){
|
public UnitController createController(Unit unit){
|
||||||
return defaultController.get(unit);
|
return controller.get(unit);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Unit create(Team team){
|
public Unit create(Team team){
|
||||||
|
Reference in New Issue
Block a user