From 5e249e50ddf08bb494eae3eabb252c674b6b98c0 Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 1 Nov 2021 11:46:32 -0400 Subject: [PATCH] Beam tower --- core/assets/icons/icons.properties | 1 + core/assets/logicids.dat | Bin 2964 -> 2976 bytes core/src/mindustry/content/Blocks.java | 13 ++++++++++++- .../world/blocks/power/BeamNode.java | 18 ++++++++++-------- gradle.properties | 2 +- 5 files changed, 24 insertions(+), 10 deletions(-) diff --git a/core/assets/icons/icons.properties b/core/assets/icons/icons.properties index f2f1ee21d3..01d2269b92 100755 --- a/core/assets/icons/icons.properties +++ b/core/assets/icons/icons.properties @@ -414,3 +414,4 @@ 63294=turbine-condenser|block-turbine-condenser-ui 63293=beam-node|block-beam-node-ui 63292=spark|unit-spark-ui +63291=beam-tower|block-beam-tower-ui diff --git a/core/assets/logicids.dat b/core/assets/logicids.dat index 2b46227808ef84bcf147956471b9460469f83f9c..58036a0bab1970165edb86dea9cf7d8f060dd18d 100644 GIT binary patch delta 28 jcmbOtzCfIbVZ}zKLQZb3q}0S*-IDzB)S}HroJvdpdtV5Y delta 16 XcmZ1=K1G~~VfjX;Le9 id)){ + if(dests[i] != null && (!(links[i].block instanceof BeamNode) || (links[i].tileX() != tileX() && links[i].tileY() != tileY()) || links[i].id > id)){ int dst = Math.max(Math.abs(dests[i].x - tile.x), Math.abs(dests[i].y - tile.y)); //don't draw lasers for adjacent blocks - if(dst > 1){ + if(dst > 1 + size/2){ var point = Geometry.d4[i]; float poff = tilesize/2f; - Drawf.laser(team, laser, laserEnd, x + poff*point.x, y + poff*point.y, dests[i].worldx() - poff*point.x, dests[i].worldy() - poff*point.y, w); + Drawf.laser(team, laser, laserEnd, x + poff*size*point.x, y + poff*size*point.y, dests[i].worldx() - poff*point.x, dests[i].worldy() - poff*point.y, w); } } } @@ -137,8 +138,9 @@ public class BeamNode extends PowerBlock{ var dir = Geometry.d4[i]; links[i] = null; dests[i] = null; + int offset = size/2; //find first block with power in range - for(int j = 1; j <= range; j++){ + for(int j = 1 + offset; j <= range + offset; j++){ var other = world.build(tile.x + j * dir.x, tile.y + j * dir.y); if(other != null && other.block.hasPower && other.team == team){ links[i] = other; diff --git a/gradle.properties b/gradle.properties index 10919a574f..e53459d921 100644 --- a/gradle.properties +++ b/gradle.properties @@ -24,4 +24,4 @@ android.useAndroidX=true #used for slow jitpack builds; TODO see if this actually works org.gradle.internal.http.socketTimeout=100000 org.gradle.internal.http.connectionTimeout=100000 -archash=f1b1c17bf6385b607dad4af3c51ad88646c9e9ca +archash=07d01125a25b789cc081249c469b91b5f65070dc