Skip to content

Commit cfe7777

Browse files
committed
Fix rise effect crash
1 parent 6a66bf3 commit cfe7777

2 files changed

Lines changed: 9 additions & 15 deletions

File tree

src/progressed/content/blocks/PMBlocks.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,7 @@ public static void load(){
474474
shootType = new MagmaBulletType(76f, 24f){{
475475
shake = 2f;
476476
crackEffects = 6;
477+
groundRise = 6f;
477478
}};
478479

479480
consumePower(17f);

src/progressed/content/effects/OtherFx.java

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,14 @@ public class OtherFx{
3333
Floor f = t.floor();
3434
if(f instanceof SteamVent) return;
3535
TextureRegion region = f.variantRegions[Mathf.randomSeed(t.pos(), 0, Math.max(0, f.variantRegions.length - 1))];
36-
float x = t.drawx(), y = t.drawy() + e.rotation * e.fout();
37-
38-
Draw.z(Draw.z() - ((float)t.y / world.height()) / 1000f);;
39-
for(int i = 0; i < region.width; i++){
40-
PixmapRegion image = Core.atlas.getPixmap(region);
41-
float c1 = Tmp.c1.set(image.get(i, 0)).toFloatBits();
42-
float c2 = Tmp.c2.set(Tmp.c1).lerp(Color.black, e.fout() / 4f).toFloatBits();
43-
44-
float px = x - region.width / 4f / 2f + i / 4f, py = y - region.height / 4f / 2f, by = py - e.rotation * e.fout();
45-
float p = 1f / 8f;
46-
47-
Fill.quad(px - p, by, c2, px - p, py, c1, px + p, py, c1, px + p, by, c2);
48-
}
49-
50-
rect(region, x, y);
36+
float x = t.drawx(), riseAmount = e.rotation * e.fout(), y = t.drawy();
37+
38+
Draw.z(Draw.z() - ((float)t.y / world.height()) / 1000f);
39+
TextureRegion riseRegion = Tmp.tr1;
40+
riseRegion.set(region);
41+
riseRegion.set(region.u, region.v, region.u2, region.v + (region.v2 - region.v) / region.height);
42+
Draw.rect(riseRegion, x, y - region.height / 8f + riseAmount / 2f, region.width / 4f, riseAmount);
43+
rect(region, x, y + riseAmount);
5144
}).layer(Layer.floor + 0.01f),
5245

5346
concretionSlam = new Effect(23, e -> {

0 commit comments

Comments
 (0)