Skip to content

Commit 2099fff

Browse files
committed
More missile target draw improvements
1 parent 71ef1db commit 2099fff

File tree

3 files changed

+20
-18
lines changed

3 files changed

+20
-18
lines changed

src/progressed/content/bullets/PayloadBullets.java

+4-5
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ public static void load(){
233233
hitEffect = MissileFx.smallBoom;
234234
hitSound = Sounds.explosion;
235235

236-
zoneRadius = 2f * 8f;
236+
drawZone = false;
237237
gravity = 0.05f;
238238
arcFragDrift = 2f;
239239
targetDriftDrag = 0.02f;
@@ -268,6 +268,7 @@ public static void load(){
268268
buildingDamageMultiplier = 0.5f;
269269
homingPower = 0.5f;
270270

271+
drawZone = false;
271272
trailColor = targetColor = zoneColor = Pal.suppress;
272273
trailLength = 12;
273274
trailWidth = 1f;
@@ -397,9 +398,7 @@ public static void load(){
397398
zoneRadius = 8f * 8f;
398399
trailLength = 35;
399400
trailWidth = 2.5f;
400-
trailColor = Pal.sapBulletBack; //Black doesn't work because of bloom
401-
targetColor = zoneColor = Color.black;
402-
zoneLayer = Layer.bullet - 0.03f;
401+
targetColor = zoneColor = trailColor = Pal.sapBulletBack; //Black is too dark for bloom
403402

404403
accel = 0.01f;
405404
gravity = 0.02f;
@@ -445,7 +444,7 @@ public static void load(){
445444

446445
ohno = (ArcMissileBulletType)paragonCluster.copy();
447446
ohno.sprite = "prog-mats-sandbox-nuke";
448-
ohno.targetColor = ohno.trailColor = ohno.zoneColor = Color.red;
447+
ohno.targetColor = ohno.trailColor = ohno.zoneColor = Pal.remove;
449448
ohno.rangeChange = 500 * tilesize;
450449

451450
ArcMissileBulletType stop = (ArcMissileBulletType)artemisRecursive.copy();

src/progressed/entities/bullet/pseudo3d/ArcBasicBulletType.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public void load(){
4242

4343
@Override
4444
public void draw(Bullet b){
45-
if(drawZone) drawTargetZone(b);
45+
drawTargetZone(b);
4646

4747
ArcBulletData data = (ArcBulletData)b.data;
4848
float lastHX = Draw3D.x(b.lastX, data.lastZ),

src/progressed/entities/bullet/pseudo3d/ArcBulletType.java

+15-12
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ public class ArcBulletType extends BulletType{
3737

3838
public boolean drawZone = false;
3939
public float zoneLayer = Layer.bullet;
40-
public float targetRadius = 12f, zoneRadius = 3f * 8f;
41-
public float shortSpikeWidth = -1f, shortSpike = -1f;
42-
public float longSpikeWidth = -1f, longSpike = -1f;
40+
public float targetRadius = 12f, zoneRadius = 3f * 8f, progressRadius = -1f;
41+
public float spikesWidth1 = -1f, spikesLength1 = -1f;
42+
public float spikesWidth2 = -1f, spikesLength2 = -1f;
4343
public float spokeWidth = 2f, spokeLength = 8f;
4444
public float spikeSpin = 0.5f;
4545
public float zoneLifeOffset = 0f;
@@ -79,10 +79,11 @@ public void initDrawSize(float range){
7979

8080
@Override
8181
public void init(){
82-
if(longSpike < 0) longSpike = zoneRadius / 2f;
83-
if(shortSpike < 0) shortSpike = longSpike / 2f;
84-
if(shortSpikeWidth < 0) shortSpikeWidth = shortSpike / 2f;
85-
if(longSpikeWidth < 0) longSpikeWidth = shortSpikeWidth;
82+
if(spikesLength2 < 0) spikesLength2 = zoneRadius / 2f;
83+
if(spikesLength1 < 0) spikesLength1 = spikesLength2 / 2f;
84+
if(spikesWidth1 < 0) spikesWidth1 = spikesLength1 / 2f;
85+
if(spikesWidth2 < 0) spikesWidth2 = spikesWidth1;
86+
if(progressRadius < 0) progressRadius = Math.max((drawZone ? zoneRadius + Math.max(spikesLength1, spikesLength2) / 2f : 0f), targetRadius + spokeLength / 2f) + 4f;
8687

8788
if(fragBullet instanceof ArcBulletType a){
8889
a.isInheritive = true;
@@ -253,7 +254,7 @@ public void updateTrail(Bullet b){
253254

254255
@Override
255256
public void draw(Bullet b){
256-
if(drawZone) drawTargetZone(b);
257+
drawTargetZone(b);
257258
Draw.z(layer);
258259
drawTrail(b);
259260
}
@@ -277,16 +278,18 @@ public void drawTargetZone(Bullet b){
277278
PMDrawf.ring(x, y, zoneRadius, zoneRadius + 2f);
278279
for(int i = 0; i < 4; i++){
279280
float a = ang + 90 * i;
280-
Drawf.tri(x + Angles.trnsx(a, zoneRadius), y + Angles.trnsy(a, zoneRadius), shortSpikeWidth, shortSpike, a + 180);
281+
Drawf.tri(x + Angles.trnsx(a, zoneRadius), y + Angles.trnsy(a, zoneRadius), spikesWidth1, spikesLength1, a + 180);
282+
Drawf.tri(x + Angles.trnsx(a, zoneRadius), y + Angles.trnsy(a, zoneRadius), spikesWidth1, spikesLength1 / 2f, a);
281283
}
282284
for(int i = 0; i < 4; i++){
283285
float a = ang + 45 + 90 * i;
284-
Drawf.tri(x + Angles.trnsx(a, zoneRadius), y + Angles.trnsy(a, zoneRadius), longSpikeWidth, longSpike, a + 180);
286+
Drawf.tri(x + Angles.trnsx(a, zoneRadius), y + Angles.trnsy(a, zoneRadius), spikesWidth2, spikesLength2, a + 180);
287+
Drawf.tri(x + Angles.trnsx(a, zoneRadius), y + Angles.trnsy(a, zoneRadius), spikesWidth2, spikesLength2 / 2f, a);
285288
}
286289
}
287290

288-
float fin = zoneLifeOffset + b.fin() * (1f - zoneLifeOffset);
289-
PMDrawf.progressRing(x, y, zoneRadius + 4f, zoneRadius + 8f, fin);
291+
float fin = b.fin() / lifetimeScl;
292+
PMDrawf.progressRing(x, y, progressRadius, progressRadius + 4f, fin);
290293

291294
PMDrawf.ring(x, y, targetRadius, targetRadius + 2f);
292295
Lines.stroke(spokeWidth);

0 commit comments

Comments
 (0)