Misc bugfixes
This commit is contained in:
@@ -3039,7 +3039,7 @@ public class UnitTypes{
|
|||||||
|
|
||||||
unitSpawned = new MissileUnitType("disrupt-missile"){{
|
unitSpawned = new MissileUnitType("disrupt-missile"){{
|
||||||
speed = 4.5f;
|
speed = 4.5f;
|
||||||
maxRange = 80f;
|
maxRange = 5f;
|
||||||
outlineColor = Pal.darkOutline;
|
outlineColor = Pal.darkOutline;
|
||||||
health = 70;
|
health = 70;
|
||||||
homingDelay = 10f;
|
homingDelay = 10f;
|
||||||
@@ -3072,7 +3072,7 @@ public class UnitTypes{
|
|||||||
mirror = false;
|
mirror = false;
|
||||||
reload = 1f;
|
reload = 1f;
|
||||||
shootOnDeath = true;
|
shootOnDeath = true;
|
||||||
bullet = new ExplosionBulletType(145f, 25f){{
|
bullet = new ExplosionBulletType(120f, 25f){{
|
||||||
suppressionRange = 140f;
|
suppressionRange = 140f;
|
||||||
shootEffect = new ExplosionEffect(){{
|
shootEffect = new ExplosionEffect(){{
|
||||||
lifetime = 50f;
|
lifetime = 50f;
|
||||||
|
|||||||
@@ -231,19 +231,7 @@ public class DesktopInput extends InputHandler{
|
|||||||
Draw.reset();
|
Draw.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!valid && state.rules.placeRangeCheck){
|
drawOverlapCheck(block, cursorX, cursorY, valid);
|
||||||
var blocker = Build.getEnemyOverlap(block, player.team(), cursorX, cursorY);
|
|
||||||
if(blocker != null){
|
|
||||||
Drawf.selected(blocker, Pal.remove);
|
|
||||||
Tmp.v1.set(cursorX, cursorY).scl(tilesize).add(block.offset, block.offset).sub(blocker).scl(-1f).nor();
|
|
||||||
Drawf.dashLineDst(Pal.remove,
|
|
||||||
cursorX * tilesize + block.offset + Tmp.v1.x * block.size * tilesize/2f,
|
|
||||||
cursorY * tilesize + block.offset + Tmp.v1.y * block.size * tilesize/2f,
|
|
||||||
blocker.x + Tmp.v1.x * -blocker.block.size * tilesize/2f,
|
|
||||||
blocker.y + Tmp.v1.y * -blocker.block.size * tilesize/2f
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -719,6 +719,22 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void drawOverlapCheck(Block block, int cursorX, int cursorY, boolean valid){
|
||||||
|
if(!valid && state.rules.placeRangeCheck){
|
||||||
|
var blocker = Build.getEnemyOverlap(block, player.team(), cursorX, cursorY);
|
||||||
|
if(blocker != null){
|
||||||
|
Drawf.selected(blocker, Pal.remove);
|
||||||
|
Tmp.v1.set(cursorX, cursorY).scl(tilesize).add(block.offset, block.offset).sub(blocker).scl(-1f).nor();
|
||||||
|
Drawf.dashLineDst(Pal.remove,
|
||||||
|
cursorX * tilesize + block.offset + Tmp.v1.x * block.size * tilesize/2f,
|
||||||
|
cursorY * tilesize + block.offset + Tmp.v1.y * block.size * tilesize/2f,
|
||||||
|
blocker.x + Tmp.v1.x * -blocker.block.size * tilesize/2f,
|
||||||
|
blocker.y + Tmp.v1.y * -blocker.block.size * tilesize/2f
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public boolean requestMatches(BuildPlan request){
|
public boolean requestMatches(BuildPlan request){
|
||||||
Tile tile = world.tile(request.x, request.y);
|
Tile tile = world.tile(request.x, request.y);
|
||||||
return tile != null && tile.build instanceof ConstructBuild cons && cons.current == request.block;
|
return tile != null && tile.build instanceof ConstructBuild cons && cons.current == request.block;
|
||||||
|
|||||||
@@ -374,8 +374,12 @@ public class MobileInput extends InputHandler implements GestureListener{
|
|||||||
|
|
||||||
//draw last placed request
|
//draw last placed request
|
||||||
if(!request.breaking && request == lastPlaced && request.block != null && request.block.drawArrow){
|
if(!request.breaking && request == lastPlaced && request.block != null && request.block.drawArrow){
|
||||||
|
boolean valid = validPlace(tile.x, tile.y, request.block, rotation);
|
||||||
Draw.mixcol();
|
Draw.mixcol();
|
||||||
request.block.drawPlace(tile.x, tile.y, rotation, validPlace(tile.x, tile.y, request.block, rotation));
|
request.block.drawPlace(tile.x, tile.y, rotation, valid);
|
||||||
|
|
||||||
|
drawOverlapCheck(request.block, tile.x, tile.y, valid);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user