Special floors for cores

This commit is contained in:
Anuken
2022-02-16 11:00:18 -05:00
parent a0c373bec6
commit 49d5513c4e
7 changed files with 33 additions and 6 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 B

View File

@@ -818,6 +818,7 @@ ability.energyfield = Energy Field: [accent]{0}[] damage ~ [accent]{1}[] blocks
bar.drilltierreq = Better Drill Required bar.drilltierreq = Better Drill Required
bar.noresources = Missing Resources bar.noresources = Missing Resources
bar.corereq = Core Base Required bar.corereq = Core Base Required
bar.corefloor = Core Zone Tile Required
bar.cargounitcap = Cargo Unit Cap Reached bar.cargounitcap = Cargo Unit Cap Reached
bar.drillspeed = Drill Speed: {0}/s bar.drillspeed = Drill Speed: {0}/s
bar.pumpspeed = Pump Speed: {0}/s bar.pumpspeed = Pump Speed: {0}/s

View File

@@ -541,3 +541,4 @@
63162=carbide-wall-large|block-carbide-wall-large-ui 63162=carbide-wall-large|block-carbide-wall-large-ui
63161=prime-control-core|block-prime-control-core-ui 63161=prime-control-core|block-prime-control-core-ui
63160=ore-wall-thorium|block-ore-wall-thorium-ui 63160=ore-wall-thorium|block-ore-wall-thorium-ui
63159=core-zone|block-core-zone-ui

View File

@@ -50,6 +50,7 @@ public class Blocks{
regolithWall, yellowStoneWall, rhyoliteWall, carbonWall, redIceWall, ferricStoneWall, beryllicStoneWall, arkyicWall, crystallineStoneWall, redStoneWall, redDiamondWall, regolithWall, yellowStoneWall, rhyoliteWall, carbonWall, redIceWall, ferricStoneWall, beryllicStoneWall, arkyicWall, crystallineStoneWall, redStoneWall, redDiamondWall,
ferricStone, ferricCraters, carbonStone, beryllicStone, crystallineStone, crystalFloor, yellowStonePlates, ferricStone, ferricCraters, carbonStone, beryllicStone, crystallineStone, crystalFloor, yellowStonePlates,
iceSnow, sandWater, darksandWater, duneWall, sandWall, moss, sporeMoss, shale, shaleWall, grass, salt, iceSnow, sandWater, darksandWater, duneWall, sandWall, moss, sporeMoss, shale, shaleWall, grass, salt,
coreZone,
//boulders //boulders
shaleBoulder, sandBoulder, daciteBoulder, boulder, snowBoulder, basaltBoulder, carbonBoulder, ferricBoulder, beryllicBoulder, yellowStoneBoulder, shaleBoulder, sandBoulder, daciteBoulder, boulder, snowBoulder, basaltBoulder, carbonBoulder, ferricBoulder, beryllicBoulder, yellowStoneBoulder,
arkyicBoulder, crystalCluster, vibrantCrystalCluster, crystalBlocks, crystalOrbs, crystallineBoulder, redIceBoulder, rhyoliteBoulder, redStoneBoulder, arkyicBoulder, crystalCluster, vibrantCrystalCluster, crystalBlocks, crystalOrbs, crystallineBoulder, redIceBoulder, rhyoliteBoulder, redStoneBoulder,
@@ -528,6 +529,11 @@ public class Blocks{
attributes.set(Attribute.spores, 0.15f); attributes.set(Attribute.spores, 0.15f);
}}; }};
coreZone = new Floor("core-zone"){{
variants = 0;
allowCorePlacement = true;
}};
sporeMoss = new Floor("spore-moss"){{ sporeMoss = new Floor("spore-moss"){{
variants = 3; variants = 3;
attributes.set(Attribute.spores, 0.3f); attributes.set(Attribute.spores, 0.3f);
@@ -2546,6 +2552,7 @@ public class Blocks{
requirements(Category.effect, BuildVisibility.editorOnly, with(Items.copper, 1000, Items.lead, 800)); requirements(Category.effect, BuildVisibility.editorOnly, with(Items.copper, 1000, Items.lead, 800));
alwaysUnlocked = true; alwaysUnlocked = true;
isFirstTier = true;
unitType = UnitTypes.alpha; unitType = UnitTypes.alpha;
health = 1100; health = 1100;
itemCapacity = 4000; itemCapacity = 4000;
@@ -2582,8 +2589,9 @@ public class Blocks{
coreBastion = new CoreBlock("core-bastion"){{ coreBastion = new CoreBlock("core-bastion"){{
//TODO cost //TODO cost
requirements(Category.effect, BuildVisibility.editorOnly, with(Items.graphite, 1000, Items.silicon, 2000, Items.beryllium, 800)); requirements(Category.effect, with(Items.graphite, 1000, Items.silicon, 2000, Items.beryllium, 800));
isFirstTier = true;
unitType = UnitTypes.evoke; unitType = UnitTypes.evoke;
health = 7000; health = 7000;
itemCapacity = 8000; itemCapacity = 8000;
@@ -2591,6 +2599,9 @@ public class Blocks{
thrusterLength = 34/4f; thrusterLength = 34/4f;
armor = 5f; armor = 5f;
//TODO should this be higher?
buildCostMultiplier = 0.75f;
unitCapModifier = 2; unitCapModifier = 2;
researchCostMultiplier = 0.07f; researchCostMultiplier = 0.07f;
}}; }};

View File

@@ -278,7 +278,9 @@ public class DesktopInput extends InputHandler{
shouldShoot = !scene.hasMouse() && !locked; shouldShoot = !scene.hasMouse() && !locked;
if(!locked && block == null && !scene.hasField()){ if(!locked && block == null && !scene.hasField() &&
//disable command mode when player unit can boost and command mode binding is the same
!(!player.dead() && player.unit().type.canBoost && keybinds.get(Binding.commandMode).key == keybinds.get(Binding.boost).key)){
commandMode = input.keyDown(Binding.commandMode); commandMode = input.keyDown(Binding.commandMode);
}else{ }else{
commandMode = false; commandMode = false;
@@ -691,7 +693,6 @@ public class DesktopInput extends InputHandler{
public boolean tap(float x, float y, int count, KeyCode button){ public boolean tap(float x, float y, int count, KeyCode button){
if(scene.hasMouse() || !commandMode) return false; if(scene.hasMouse() || !commandMode) return false;
//TODO doesn't work properly
tappedOne = true; tappedOne = true;
//click: select a single unit //click: select a single unit

View File

@@ -71,6 +71,8 @@ public class Floor extends Block{
public boolean canShadow = true; public boolean canShadow = true;
/** Whether this overlay needs a surface to be on. False for floating blocks, like spawns. */ /** Whether this overlay needs a surface to be on. False for floating blocks, like spawns. */
public boolean needsSurface = true; public boolean needsSurface = true;
/** If true, cores can be placed on this floor. */
public boolean allowCorePlacement = false;
/** If true, this ore is allowed on walls. */ /** If true, this ore is allowed on walls. */
public boolean wallOre = false; public boolean wallOre = false;
/** Actual ID used for blend groups. Internal. */ /** Actual ID used for blend groups. Internal. */

View File

@@ -32,6 +32,7 @@ public class CoreBlock extends StorageBlock{
public @Load(value = "@-thruster1", fallback = "clear-effect") TextureRegion thruster1; //top right public @Load(value = "@-thruster1", fallback = "clear-effect") TextureRegion thruster1; //top right
public @Load(value = "@-thruster2", fallback = "clear-effect") TextureRegion thruster2; //bot left public @Load(value = "@-thruster2", fallback = "clear-effect") TextureRegion thruster2; //bot left
public float thrusterLength = 14f/4f; public float thrusterLength = 14f/4f;
public boolean isFirstTier;
public UnitType unitType = UnitTypes.alpha; public UnitType unitType = UnitTypes.alpha;
@@ -124,6 +125,13 @@ public class CoreBlock extends StorageBlock{
if(tile == null) return false; if(tile == null) return false;
//in the editor, you can place them anywhere for convenience //in the editor, you can place them anywhere for convenience
if(state.isEditor()) return true; if(state.isEditor()) return true;
//special floor upon which cores can be placed
tile.getLinkedTiles(tempTiles);
if(!tempTiles.contains(o -> !o.floor().allowCorePlacement)){
return true;
}
CoreBuild core = team.core(); CoreBuild core = team.core();
//must have all requirements //must have all requirements
if(core == null || (!state.rules.infiniteResources && !core.items.has(requirements, state.rules.buildCostMultiplier))) return false; if(core == null || (!state.rules.infiniteResources && !core.items.has(requirements, state.rules.buildCostMultiplier))) return false;
@@ -171,6 +179,9 @@ public class CoreBlock extends StorageBlock{
if(!canPlaceOn(world.tile(x, y), player.team(), rotation)){ if(!canPlaceOn(world.tile(x, y), player.team(), rotation)){
drawPlaceText(Core.bundle.get( drawPlaceText(Core.bundle.get(
isFirstTier ?
//TODO better message
"bar.corefloor" :
(player.team().core() != null && player.team().core().items.has(requirements, state.rules.buildCostMultiplier)) || state.rules.infiniteResources ? (player.team().core() != null && player.team().core().items.has(requirements, state.rules.buildCostMultiplier)) || state.rules.infiniteResources ?
"bar.corereq" : "bar.corereq" :
"bar.noresources" "bar.noresources"