Placement range check rule implemented
This commit is contained in:
@@ -1061,6 +1061,7 @@ rules.aitier = AI Tier
|
|||||||
rules.cleanupdeadteams = Clean Up Defeated Team Buildings (PvP)
|
rules.cleanupdeadteams = Clean Up Defeated Team Buildings (PvP)
|
||||||
rules.corecapture = Capture Core On Destruction
|
rules.corecapture = Capture Core On Destruction
|
||||||
rules.polygoncoreprotection = Polygonal Core Protection
|
rules.polygoncoreprotection = Polygonal Core Protection
|
||||||
|
rules.placerangecheck = Placement Range Check
|
||||||
rules.enemyCheat = Infinite AI (Red Team) Resources
|
rules.enemyCheat = Infinite AI (Red Team) Resources
|
||||||
rules.blockhealthmultiplier = Block Health Multiplier
|
rules.blockhealthmultiplier = Block Health Multiplier
|
||||||
rules.blockdamagemultiplier = Block Damage Multiplier
|
rules.blockdamagemultiplier = Block Damage Multiplier
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ public class Drawf{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void dashLineDst(Color color, float x, float y, float x2, float y2){
|
public static void dashLineDst(Color color, float x, float y, float x2, float y2){
|
||||||
dashLine(color, x, y, x2, y2, (int)(Mathf.dst(x, y, x2, y2) / tilesize * 2));
|
dashLine(color, x, y, x2, y2, (int)(Mathf.dst(x, y, x2, y2) / tilesize));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void dashLine(Color color, float x, float y, float x2, float y2){
|
public static void dashLine(Color color, float x, float y, float x2, float y2){
|
||||||
|
|||||||
@@ -234,7 +234,7 @@ public class DesktopInput extends InputHandler{
|
|||||||
if(!valid && state.rules.placeRangeCheck){
|
if(!valid && state.rules.placeRangeCheck){
|
||||||
var blocker = Build.getEnemyOverlap(block, player.team(), cursorX, cursorY);
|
var blocker = Build.getEnemyOverlap(block, player.team(), cursorX, cursorY);
|
||||||
if(blocker != null){
|
if(blocker != null){
|
||||||
Drawf.selected(blocker, blocker.team.color);
|
Drawf.selected(blocker, Pal.remove);
|
||||||
Tmp.v1.set(cursorX, cursorY).scl(tilesize).add(block.offset, block.offset).sub(blocker).scl(-1f).nor();
|
Tmp.v1.set(cursorX, cursorY).scl(tilesize).add(block.offset, block.offset).sub(blocker).scl(-1f).nor();
|
||||||
Drawf.dashLineDst(Pal.remove,
|
Drawf.dashLineDst(Pal.remove,
|
||||||
cursorX * tilesize + block.offset + Tmp.v1.x * block.size * tilesize/2f,
|
cursorX * tilesize + block.offset + Tmp.v1.x * block.size * tilesize/2f,
|
||||||
|
|||||||
@@ -185,6 +185,7 @@ public class CustomRulesDialog extends BaseDialog{
|
|||||||
check("@rules.attack", b -> rules.attackMode = b, () -> rules.attackMode);
|
check("@rules.attack", b -> rules.attackMode = b, () -> rules.attackMode);
|
||||||
check("@rules.buildai", b -> rules.teams.get(rules.waveTeam).ai = rules.teams.get(rules.waveTeam).infiniteResources = b, () -> rules.teams.get(rules.waveTeam).ai);
|
check("@rules.buildai", b -> rules.teams.get(rules.waveTeam).ai = rules.teams.get(rules.waveTeam).infiniteResources = b, () -> rules.teams.get(rules.waveTeam).ai);
|
||||||
check("@rules.corecapture", b -> rules.coreCapture = b, () -> rules.coreCapture);
|
check("@rules.corecapture", b -> rules.coreCapture = b, () -> rules.coreCapture);
|
||||||
|
check("@rules.placerangecheck", b -> rules.placeRangeCheck = b, () -> rules.placeRangeCheck);
|
||||||
check("@rules.polygoncoreprotection", b -> rules.polygonCoreProtection = b, () -> rules.polygonCoreProtection);
|
check("@rules.polygoncoreprotection", b -> rules.polygonCoreProtection = b, () -> rules.polygonCoreProtection);
|
||||||
number("@rules.enemycorebuildradius", f -> rules.enemyCoreBuildRadius = f * tilesize, () -> Math.min(rules.enemyCoreBuildRadius / tilesize, 200), () -> !rules.polygonCoreProtection);
|
number("@rules.enemycorebuildradius", f -> rules.enemyCoreBuildRadius = f * tilesize, () -> Math.min(rules.enemyCoreBuildRadius / tilesize, 200), () -> !rules.polygonCoreProtection);
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import static mindustry.Vars.*;
|
|||||||
|
|
||||||
public class BaseTurret extends Block{
|
public class BaseTurret extends Block{
|
||||||
public float range = 80f;
|
public float range = 80f;
|
||||||
|
public float placeOverlapMargin = 8 * 6f;
|
||||||
public float rotateSpeed = 5;
|
public float rotateSpeed = 5;
|
||||||
|
|
||||||
public float coolantUsage = 0.2f;
|
public float coolantUsage = 0.2f;
|
||||||
@@ -45,7 +46,7 @@ public class BaseTurret extends Block{
|
|||||||
consumes.add(coolantOverride != null ? new ConsumeLiquid(coolantOverride, coolantUsage) : new ConsumeCoolant(coolantUsage)).update(false).boost();
|
consumes.add(coolantOverride != null ? new ConsumeLiquid(coolantOverride, coolantUsage) : new ConsumeCoolant(coolantUsage)).update(false).boost();
|
||||||
}
|
}
|
||||||
|
|
||||||
placeOverlapRange = Math.max(placeOverlapRange, range);
|
placeOverlapRange = Math.max(placeOverlapRange, range + placeOverlapMargin);
|
||||||
super.init();
|
super.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user