mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-19 16:57:15 +07:00
Special floors for cores
This commit is contained in:
parent
a0c373bec6
commit
49d5513c4e
BIN
core/assets-raw/sprites/blocks/environment/core-zone.png
Normal file
BIN
core/assets-raw/sprites/blocks/environment/core-zone.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 272 B |
@ -818,6 +818,7 @@ ability.energyfield = Energy Field: [accent]{0}[] damage ~ [accent]{1}[] blocks
|
||||
bar.drilltierreq = Better Drill Required
|
||||
bar.noresources = Missing Resources
|
||||
bar.corereq = Core Base Required
|
||||
bar.corefloor = Core Zone Tile Required
|
||||
bar.cargounitcap = Cargo Unit Cap Reached
|
||||
bar.drillspeed = Drill Speed: {0}/s
|
||||
bar.pumpspeed = Pump Speed: {0}/s
|
||||
|
@ -541,3 +541,4 @@
|
||||
63162=carbide-wall-large|block-carbide-wall-large-ui
|
||||
63161=prime-control-core|block-prime-control-core-ui
|
||||
63160=ore-wall-thorium|block-ore-wall-thorium-ui
|
||||
63159=core-zone|block-core-zone-ui
|
||||
|
@ -50,6 +50,7 @@ public class Blocks{
|
||||
regolithWall, yellowStoneWall, rhyoliteWall, carbonWall, redIceWall, ferricStoneWall, beryllicStoneWall, arkyicWall, crystallineStoneWall, redStoneWall, redDiamondWall,
|
||||
ferricStone, ferricCraters, carbonStone, beryllicStone, crystallineStone, crystalFloor, yellowStonePlates,
|
||||
iceSnow, sandWater, darksandWater, duneWall, sandWall, moss, sporeMoss, shale, shaleWall, grass, salt,
|
||||
coreZone,
|
||||
//boulders
|
||||
shaleBoulder, sandBoulder, daciteBoulder, boulder, snowBoulder, basaltBoulder, carbonBoulder, ferricBoulder, beryllicBoulder, yellowStoneBoulder,
|
||||
arkyicBoulder, crystalCluster, vibrantCrystalCluster, crystalBlocks, crystalOrbs, crystallineBoulder, redIceBoulder, rhyoliteBoulder, redStoneBoulder,
|
||||
@ -528,6 +529,11 @@ public class Blocks{
|
||||
attributes.set(Attribute.spores, 0.15f);
|
||||
}};
|
||||
|
||||
coreZone = new Floor("core-zone"){{
|
||||
variants = 0;
|
||||
allowCorePlacement = true;
|
||||
}};
|
||||
|
||||
sporeMoss = new Floor("spore-moss"){{
|
||||
variants = 3;
|
||||
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));
|
||||
alwaysUnlocked = true;
|
||||
|
||||
isFirstTier = true;
|
||||
unitType = UnitTypes.alpha;
|
||||
health = 1100;
|
||||
itemCapacity = 4000;
|
||||
@ -2582,8 +2589,9 @@ public class Blocks{
|
||||
|
||||
coreBastion = new CoreBlock("core-bastion"){{
|
||||
//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;
|
||||
health = 7000;
|
||||
itemCapacity = 8000;
|
||||
@ -2591,6 +2599,9 @@ public class Blocks{
|
||||
thrusterLength = 34/4f;
|
||||
armor = 5f;
|
||||
|
||||
//TODO should this be higher?
|
||||
buildCostMultiplier = 0.75f;
|
||||
|
||||
unitCapModifier = 2;
|
||||
researchCostMultiplier = 0.07f;
|
||||
}};
|
||||
|
@ -278,7 +278,9 @@ public class DesktopInput extends InputHandler{
|
||||
|
||||
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);
|
||||
}else{
|
||||
commandMode = false;
|
||||
@ -691,7 +693,6 @@ public class DesktopInput extends InputHandler{
|
||||
public boolean tap(float x, float y, int count, KeyCode button){
|
||||
if(scene.hasMouse() || !commandMode) return false;
|
||||
|
||||
//TODO doesn't work properly
|
||||
tappedOne = true;
|
||||
|
||||
//click: select a single unit
|
||||
|
@ -71,6 +71,8 @@ public class Floor extends Block{
|
||||
public boolean canShadow = true;
|
||||
/** Whether this overlay needs a surface to be on. False for floating blocks, like spawns. */
|
||||
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. */
|
||||
public boolean wallOre = false;
|
||||
/** Actual ID used for blend groups. Internal. */
|
||||
|
@ -32,6 +32,7 @@ public class CoreBlock extends StorageBlock{
|
||||
public @Load(value = "@-thruster1", fallback = "clear-effect") TextureRegion thruster1; //top right
|
||||
public @Load(value = "@-thruster2", fallback = "clear-effect") TextureRegion thruster2; //bot left
|
||||
public float thrusterLength = 14f/4f;
|
||||
public boolean isFirstTier;
|
||||
|
||||
public UnitType unitType = UnitTypes.alpha;
|
||||
|
||||
@ -124,6 +125,13 @@ public class CoreBlock extends StorageBlock{
|
||||
if(tile == null) return false;
|
||||
//in the editor, you can place them anywhere for convenience
|
||||
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();
|
||||
//must have all requirements
|
||||
if(core == null || (!state.rules.infiniteResources && !core.items.has(requirements, state.rules.buildCostMultiplier))) return false;
|
||||
@ -171,9 +179,12 @@ public class CoreBlock extends StorageBlock{
|
||||
if(!canPlaceOn(world.tile(x, y), player.team(), rotation)){
|
||||
|
||||
drawPlaceText(Core.bundle.get(
|
||||
(player.team().core() != null && player.team().core().items.has(requirements, state.rules.buildCostMultiplier)) || state.rules.infiniteResources ?
|
||||
"bar.corereq" :
|
||||
"bar.noresources"
|
||||
isFirstTier ?
|
||||
//TODO better message
|
||||
"bar.corefloor" :
|
||||
(player.team().core() != null && player.team().core().items.has(requirements, state.rules.buildCostMultiplier)) || state.rules.infiniteResources ?
|
||||
"bar.corereq" :
|
||||
"bar.noresources"
|
||||
), x, y, valid);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user