Implemented 'deep' unplaceable floor blocks
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
#Autogenerated file. Do not modify.
|
#Autogenerated file. Do not modify.
|
||||||
#Sat Apr 14 21:02:06 EDT 2018
|
#Sat Apr 14 21:49:43 EDT 2018
|
||||||
version=release
|
version=release
|
||||||
androidBuildCode=922
|
androidBuildCode=923
|
||||||
name=Mindustry
|
name=Mindustry
|
||||||
code=3.5
|
code=3.5
|
||||||
build=custom build
|
build=custom build
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ public class Blocks {
|
|||||||
}},
|
}},
|
||||||
|
|
||||||
deepwater = new Floor("deepwater") {{
|
deepwater = new Floor("deepwater") {{
|
||||||
|
placeableOn = false;
|
||||||
liquidColor = Color.valueOf("546bb3");
|
liquidColor = Color.valueOf("546bb3");
|
||||||
speedMultiplier = 0.2f;
|
speedMultiplier = 0.2f;
|
||||||
variants = 0;
|
variants = 0;
|
||||||
|
|||||||
@@ -236,7 +236,11 @@ public class Player extends Unit{
|
|||||||
|
|
||||||
dashing = Inputs.keyDown("dash");
|
dashing = Inputs.keyDown("dash");
|
||||||
|
|
||||||
float speed = dashing ? (debug ? Player.dashSpeed * 5f : Player.dashSpeed) : Player.speed;
|
float speed = dashing ? (debug ? Player.dashSpeed * 5f : Player.dashSpeed) : Player.speed ;
|
||||||
|
|
||||||
|
float carrySlowdown = 0.3f;
|
||||||
|
|
||||||
|
speed *= ((1f-carrySlowdown) + (inventory.hasItem() ? (float)inventory.getItem().amount/inventory.capacity(): 1f) * carrySlowdown);
|
||||||
|
|
||||||
if(health < maxhealth && timer.get(timerRegen, 20))
|
if(health < maxhealth && timer.get(timerRegen, 20))
|
||||||
health ++;
|
health ++;
|
||||||
|
|||||||
@@ -60,6 +60,8 @@ public class Block extends BaseBlock {
|
|||||||
public boolean breakable;
|
public boolean breakable;
|
||||||
/**whether this block can be drowned in*/
|
/**whether this block can be drowned in*/
|
||||||
public boolean liquid;
|
public boolean liquid;
|
||||||
|
/**whether this floor can be placed on.*/
|
||||||
|
public boolean placeableOn = true;
|
||||||
/**time it takes to break*/
|
/**time it takes to break*/
|
||||||
public float breaktime = 18;
|
public float breaktime = 18;
|
||||||
/**tile entity health*/
|
/**tile entity health*/
|
||||||
|
|||||||
@@ -132,14 +132,14 @@ public class Placement {
|
|||||||
for(int dx = 0; dx < type.size; dx ++){
|
for(int dx = 0; dx < type.size; dx ++){
|
||||||
for(int dy = 0; dy < type.size; dy ++){
|
for(int dy = 0; dy < type.size; dy ++){
|
||||||
Tile other = world.tile(x + dx + offsetx, y + dy + offsety);
|
Tile other = world.tile(x + dx + offsetx, y + dy + offsety);
|
||||||
if(other == null || (other.block() != Blocks.air && !other.block().alwaysReplace) || isSpawnPoint(other)){
|
if(other == null || (other.block() != Blocks.air && !other.block().alwaysReplace) || isSpawnPoint(other) || !other.floor().placeableOn){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}else {
|
}else {
|
||||||
return (tile.getTeam() == Team.none || tile.getTeam() == team)
|
return (tile.getTeam() == Team.none || tile.getTeam() == team) && tile.floor().placeableOn
|
||||||
&& ((type.canReplace(tile.block()) && !(type == tile.block() && rotation == tile.getRotation() && type.rotate)) || tile.block().alwaysReplace)
|
&& ((type.canReplace(tile.block()) && !(type == tile.block() && rotation == tile.getRotation() && type.rotate)) || tile.block().alwaysReplace)
|
||||||
&& tile.block().isMultiblock() == type.isMultiblock() || tile.block() == Blocks.air;
|
&& tile.block().isMultiblock() == type.isMultiblock() || tile.block() == Blocks.air;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user