Skip to content

Commit

Permalink
More missile target draw improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
MEEPofFaith committed Apr 17, 2024
1 parent 71ef1db commit 62fa73e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
8 changes: 4 additions & 4 deletions src/progressed/content/bullets/PayloadBullets.java
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public static void load(){
hitEffect = MissileFx.smallBoom;
hitSound = Sounds.explosion;

zoneRadius = 2f * 8f;
drawZone = false;
gravity = 0.05f;
arcFragDrift = 2f;
targetDriftDrag = 0.02f;
Expand Down Expand Up @@ -268,6 +268,7 @@ public static void load(){
buildingDamageMultiplier = 0.5f;
homingPower = 0.5f;

drawZone = false;
trailColor = targetColor = zoneColor = Pal.suppress;
trailLength = 12;
trailWidth = 1f;
Expand Down Expand Up @@ -397,8 +398,7 @@ public static void load(){
zoneRadius = 8f * 8f;
trailLength = 35;
trailWidth = 2.5f;
trailColor = Pal.sapBulletBack; //Black doesn't work because of bloom
targetColor = zoneColor = Color.black;
targetColor = zoneColor = trailColor = Pal.sapBulletBack; //Black doesn't work because of bloom
zoneLayer = Layer.bullet - 0.03f;

accel = 0.01f;
Expand Down Expand Up @@ -445,7 +445,7 @@ public static void load(){

ohno = (ArcMissileBulletType)paragonCluster.copy();
ohno.sprite = "prog-mats-sandbox-nuke";
ohno.targetColor = ohno.trailColor = ohno.zoneColor = Color.red;
ohno.targetColor = ohno.trailColor = ohno.zoneColor = Pal.remove;
ohno.rangeChange = 500 * tilesize;

ArcMissileBulletType stop = (ArcMissileBulletType)artemisRecursive.copy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void load(){

@Override
public void draw(Bullet b){
if(drawZone) drawTargetZone(b);
drawTargetZone(b);

ArcBulletData data = (ArcBulletData)b.data;
float lastHX = Draw3D.x(b.lastX, data.lastZ),
Expand Down
27 changes: 15 additions & 12 deletions src/progressed/entities/bullet/pseudo3d/ArcBulletType.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ public class ArcBulletType extends BulletType{

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

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

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

@Override
public void draw(Bullet b){
if(drawZone) drawTargetZone(b);
drawTargetZone(b);
Draw.z(layer);
drawTrail(b);
}
Expand All @@ -277,16 +278,18 @@ public void drawTargetZone(Bullet b){
PMDrawf.ring(x, y, zoneRadius, zoneRadius + 2f);
for(int i = 0; i < 4; i++){
float a = ang + 90 * i;
Drawf.tri(x + Angles.trnsx(a, zoneRadius), y + Angles.trnsy(a, zoneRadius), shortSpikeWidth, shortSpike, a + 180);
Drawf.tri(x + Angles.trnsx(a, zoneRadius), y + Angles.trnsy(a, zoneRadius), spikesWidth1, spikesLength1, a + 180);
Drawf.tri(x + Angles.trnsx(a, zoneRadius), y + Angles.trnsy(a, zoneRadius), spikesWidth1, spikesLength1 / 2f, a);
}
for(int i = 0; i < 4; i++){
float a = ang + 45 + 90 * i;
Drawf.tri(x + Angles.trnsx(a, zoneRadius), y + Angles.trnsy(a, zoneRadius), longSpikeWidth, longSpike, a + 180);
Drawf.tri(x + Angles.trnsx(a, zoneRadius), y + Angles.trnsy(a, zoneRadius), spikesWidth2, spikesLength2, a + 180);
Drawf.tri(x + Angles.trnsx(a, zoneRadius), y + Angles.trnsy(a, zoneRadius), spikesWidth2, spikesLength2 / 2f, a);
}
}

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

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

0 comments on commit 62fa73e

Please sign in to comment.