Disperse turret mostly done

This commit is contained in:
Anuken
2022-02-12 10:20:37 -05:00
parent e8c277d7b8
commit b079955b52
16 changed files with 14 additions and 18 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 904 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 599 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 892 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 565 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 858 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -535,3 +535,4 @@
63168=reinforced-payload-router|block-reinforced-payload-router-ui 63168=reinforced-payload-router|block-reinforced-payload-router-ui
63167=disperse|block-disperse-ui 63167=disperse|block-disperse-ui
63166=large-shield-projector|block-large-shield-projector-ui 63166=large-shield-projector|block-large-shield-projector-ui
63165=payload-mass-driver|block-payload-mass-driver-ui

Binary file not shown.

View File

@@ -3345,7 +3345,7 @@ public class Blocks{
}}); }});
parts.add(new RegionPart("-mid"){{ parts.add(new RegionPart("-mid"){{
under = true; under = true;
moveY = -1f; moveY = -1.5f;
progress = PartProgress.reload; progress = PartProgress.reload;
heatProgress = PartProgress.reload.add(0.25f).min(PartProgress.warmup); heatProgress = PartProgress.reload.add(0.25f).min(PartProgress.warmup);
heatColor = Color.sky.cpy().a(0.9f); heatColor = Color.sky.cpy().a(0.9f);
@@ -3384,7 +3384,7 @@ public class Blocks{
range = 270f; range = 270f;
size = 4; size = 4;
limitRange(4f); limitRange(0f);
}}; }};
//endregion //endregion
@@ -3541,7 +3541,6 @@ public class Blocks{
tankAssembler = new UnitAssembler("tank-assembler"){{ tankAssembler = new UnitAssembler("tank-assembler"){{
requirements(Category.units, with(Items.graphite, 600, Items.beryllium, 600, Items.oxide, 200, Items.tungsten, 500)); requirements(Category.units, with(Items.graphite, 600, Items.beryllium, 600, Items.oxide, 200, Items.tungsten, 500));
size = 5; size = 5;
//TODO requirements?
plans.add(new AssemblerUnitPlan(UnitTypes.vanquish, 60f * 50f, BlockStack.list(Blocks.tungstenWallLarge, 6, Blocks.duct, 14, Blocks.cliffCrusher, 12))); plans.add(new AssemblerUnitPlan(UnitTypes.vanquish, 60f * 50f, BlockStack.list(Blocks.tungstenWallLarge, 6, Blocks.duct, 14, Blocks.cliffCrusher, 12)));
consumes.power(3f); consumes.power(3f);
areaSize = 13; areaSize = 13;
@@ -3619,7 +3618,6 @@ public class Blocks{
}}; }};
//TODO //TODO
if(false)
payloadMassDriver = new PayloadMassDriver("payload-mass-driver"){{ payloadMassDriver = new PayloadMassDriver("payload-mass-driver"){{
requirements(Category.units, with(Items.tungsten, 120, Items.silicon, 120, Items.oxide, 60)); requirements(Category.units, with(Items.tungsten, 120, Items.silicon, 120, Items.oxide, 60));
size = 3; size = 3;

View File

@@ -3126,7 +3126,7 @@ public class UnitTypes{
//TODO bad name //TODO bad name
evoke = new ErekirUnitType("evoke"){{ evoke = new ErekirUnitType("evoke"){{
coreUnitDock = false; coreUnitDock = true;
defaultController = BuilderAI::new; defaultController = BuilderAI::new;
isCounted = false; isCounted = false;
envDisabled = 0; envDisabled = 0;
@@ -3183,7 +3183,7 @@ public class UnitTypes{
}}; }};
incite = new ErekirUnitType("incite"){{ incite = new ErekirUnitType("incite"){{
coreUnitDock = false; coreUnitDock = true;
defaultController = BuilderAI::new; defaultController = BuilderAI::new;
isCounted = false; isCounted = false;
envDisabled = 0; envDisabled = 0;
@@ -3252,7 +3252,7 @@ public class UnitTypes{
}}; }};
emanate = new ErekirUnitType("emanate"){{ emanate = new ErekirUnitType("emanate"){{
coreUnitDock = false; coreUnitDock = true;
defaultController = BuilderAI::new; defaultController = BuilderAI::new;
isCounted = false; isCounted = false;
envDisabled = 0; envDisabled = 0;

View File

@@ -462,16 +462,15 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
player.justSwitchTo = unit; player.justSwitchTo = unit;
} }
//TODO range check for docking //TODO range check for docking?
var before = player.unit(); var before = player.unit();
player.unit(unit); player.unit(unit);
//TODO test this in multiplayer if(before != null && !before.isNull()){
if(unit.type.coreUnitDock && before != null && !before.isNull()){
if(before.spawnedByCore){ if(before.spawnedByCore){
unit.dockedType = before.type; unit.dockedType = before.type;
}else if(before.dockedType != null){ }else if(before.dockedType != null && before.dockedType.coreUnitDock){
//direct dock transfer??? //direct dock transfer???
unit.dockedType = before.dockedType; unit.dockedType = before.dockedType;
} }
@@ -494,7 +493,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
if(player == null) return; if(player == null) return;
//TODO test this in multiplayer //TODO test this in multiplayer
if(!player.dead() && player.unit().type.coreUnitDock && !player.unit().spawnedByCore){ if(!player.dead() && !player.unit().spawnedByCore && player.unit().dockedType != null && player.unit().dockedType.coreUnitDock){
//TODO respawn ON the unit, with an animation? //TODO respawn ON the unit, with an animation?
var docked = player.unit().dockedType; var docked = player.unit().dockedType;
if(docked == null){ if(docked == null){

View File

@@ -69,7 +69,7 @@ public class UnitType extends UnlockableContent{
public boolean logicControllable = true; public boolean logicControllable = true;
public boolean playerControllable = true; public boolean playerControllable = true;
public boolean allowedInPayloads = true; public boolean allowedInPayloads = true;
/** TODO If true, core units need to "dock" to this unit to work, and can un-dock at the unit instead of respawning at core. */ /** TODO If true, core units will re-appear on this unit when respawning. */
public boolean coreUnitDock = false; public boolean coreUnitDock = false;
public boolean createWreck = true; public boolean createWreck = true;
public boolean createScorch = true; public boolean createScorch = true;

View File

@@ -13,7 +13,6 @@ public class ErekirUnitType extends UnitType{
commandLimit = 0; commandLimit = 0;
outlineColor = Pal.darkOutline; outlineColor = Pal.darkOutline;
envDisabled = Env.space; envDisabled = Env.space;
coreUnitDock = true;
unitBasedDefaultController = u -> !playerControllable || u.team.isAI() ? defaultController.get() : new CommandAI(); unitBasedDefaultController = u -> !playerControllable || u.team.isAI() ? defaultController.get() : new CommandAI();
} }
} }

View File

@@ -14,8 +14,7 @@ public class Stats{
/** Production time period in ticks. Used for crafters. **/ /** Production time period in ticks. Used for crafters. **/
public float timePeriod = -1; public float timePeriod = -1;
@Nullable private @Nullable OrderedMap<StatCat, OrderedMap<Stat, Seq<StatValue>>> map;
private OrderedMap<StatCat, OrderedMap<Stat, Seq<StatValue>>> map;
private boolean dirty; private boolean dirty;
/** Adds a single float value with this stat, formatted to 2 decimal places. */ /** Adds a single float value with this stat, formatted to 2 decimal places. */
@@ -91,8 +90,8 @@ public class Stats{
public void remove(Stat stat){ public void remove(Stat stat){
if(map == null) map = new OrderedMap<>(); if(map == null) map = new OrderedMap<>();
if(!map.containsKey(stat.category) || !map.get(stat.category).containsKey(stat)){ if(!map.containsKey(stat.category)){
throw new RuntimeException("No stat entry found: \"" + stat + "\" in block."); return;
} }
map.get(stat.category).remove(stat); map.get(stat.category).remove(stat);