Turn MiningRange into a UnitType variable. (#5112)
* Turn MiningRange into a UnitType variable. Long range mining go brrrrr * Anuke Approved
This commit is contained in:
@@ -82,8 +82,6 @@ public class Vars implements Loadable{
|
|||||||
public static final float itemSize = 5f;
|
public static final float itemSize = 5f;
|
||||||
/** units outside of this bound will die instantly */
|
/** units outside of this bound will die instantly */
|
||||||
public static final float finalWorldBounds = 500;
|
public static final float finalWorldBounds = 500;
|
||||||
/** mining range for manual miners */
|
|
||||||
public static final float miningRange = 70f;
|
|
||||||
/** range for building */
|
/** range for building */
|
||||||
public static final float buildingRange = 220f;
|
public static final float buildingRange = 220f;
|
||||||
/** range for moving items */
|
/** range for moving items */
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ public class MinerAI extends AIController{
|
|||||||
|
|
||||||
if(!(unit.canMine()) || core == null) return;
|
if(!(unit.canMine()) || core == null) return;
|
||||||
|
|
||||||
if(unit.mineTile != null && !unit.mineTile.within(unit, unit.type.range)){
|
if(unit.mineTile != null && !unit.mineTile.within(unit, unit.type.miningRange)){
|
||||||
unit.mineTile(null);
|
unit.mineTile(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,9 +44,9 @@ public class MinerAI extends AIController{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(ore != null){
|
if(ore != null){
|
||||||
moveTo(ore, unit.type.range / 2f, 20f);
|
moveTo(ore, unit.type.miningRange / 2f, 20f);
|
||||||
|
|
||||||
if(unit.within(ore, unit.type.range)){
|
if(unit.within(ore, unit.type.miningRange)){
|
||||||
unit.mineTile = ore;
|
unit.mineTile = ore;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ abstract class MinerComp implements Itemsc, Posc, Teamc, Rotc, Drawc{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean validMine(Tile tile, boolean checkDst){
|
public boolean validMine(Tile tile, boolean checkDst){
|
||||||
return !(tile == null || tile.block() != Blocks.air || (!within(tile.worldx(), tile.worldy(), miningRange) && checkDst)
|
return !(tile == null || tile.block() != Blocks.air || (!within(tile.worldx(), tile.worldy(), type.miningRange) && checkDst)
|
||||||
|| tile.drop() == null || !canMine(tile.drop()));
|
|| tile.drop() == null || !canMine(tile.drop()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ public class UnitType extends UnlockableContent{
|
|||||||
public Prov<? extends UnitController> defaultController = () -> !flying ? new GroundAI() : new FlyingAI();
|
public Prov<? extends UnitController> defaultController = () -> !flying ? new GroundAI() : new FlyingAI();
|
||||||
public float speed = 1.1f, boostMultiplier = 1f, rotateSpeed = 5f, baseRotateSpeed = 5f;
|
public float speed = 1.1f, boostMultiplier = 1f, rotateSpeed = 5f, baseRotateSpeed = 5f;
|
||||||
public float drag = 0.3f, accel = 0.5f, landShake = 0f, rippleScale = 1f, riseSpeed = 0.08f, fallSpeed = 0.018f;
|
public float drag = 0.3f, accel = 0.5f, landShake = 0f, rippleScale = 1f, riseSpeed = 0.08f, fallSpeed = 0.018f;
|
||||||
public float health = 200f, range = -1, armor = 0f, maxRange = -1f;
|
public float health = 200f, range = -1, miningRange = 70f, armor = 0f, maxRange = -1f;
|
||||||
public float crashDamageMultiplier = 1f;
|
public float crashDamageMultiplier = 1f;
|
||||||
public boolean targetAir = true, targetGround = true;
|
public boolean targetAir = true, targetGround = true;
|
||||||
public boolean faceTarget = true, rotateShooting = true, isCounted = true, lowAltitude = false, circleTarget = false;
|
public boolean faceTarget = true, rotateShooting = true, isCounted = true, lowAltitude = false, circleTarget = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user