Skip to content

Commit

Permalink
Less cursed shenanigans
Browse files Browse the repository at this point in the history
  • Loading branch information
MEEPofFaith committed Apr 4, 2024
1 parent d0ca32d commit ad856dc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 29 deletions.
20 changes: 1 addition & 19 deletions src/progressed/content/bullets/PMBullets.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import arc.graphics.*;
import blackhole.entities.bullet.*;
import blackhole.entities.effect.SwirlEffect.*;
import mindustry.content.*;
import mindustry.entities.bullet.*;
import mindustry.entities.effect.*;
Expand Down Expand Up @@ -117,24 +116,7 @@ public static void load(){
float life = EnergyFx.kugelblitzGrow.lifetime;
chargeEffect = new MultiEffect(
new WrapEffect(
new RepeatEffect(EnergyFx.kugelblitzCharge, (life - EnergyFx.kugelblitzCharge.lifetime - 1f) / times, times){
@Override
protected void add(float x, float y, float rotation, Color color, Object data){
var entity = BlackHoleEffectState.create();
entity.effect = this;
entity.rotation = baseRotation + rotation;
entity.data = data;
entity.lifetime = lifetime;
entity.set(x, y);
entity.color.set(color);
if(followParent && data instanceof Posc p){
entity.parent = p;
entity.rotWithParent = rotWithParent;
}
entity.add();
}
}.followParent(true).rotWithParent(true),
Color.black, 48f
new RepeatEffect(EnergyFx.kugelblitzCharge, (life - EnergyFx.kugelblitzCharge.lifetime - 1f) / times, times), Color.black, 48f
),
EnergyFx.kugelblitzGrow
);
Expand Down
14 changes: 4 additions & 10 deletions src/progressed/entities/effect/RepeatEffect.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package progressed.entities.effect;

import arc.graphics.g2d.*;
import arc.graphics.*;
import arc.util.*;
import mindustry.entities.*;

public class RepeatEffect extends Effect{
Expand All @@ -21,16 +22,9 @@ public void init(){
}

@Override
public void render(EffectContainer e){
var cont = e.inner();
float life = e.time;
public void create(float x, float y, float rotation, Color color, Object data){
for(int i = 0; i < times; i++){
float del = i * interval;
if(life > del && life <= del + effect.lifetime){
cont.set(e.id + i, e.color, life - del, effect.lifetime, e.rotation, e.x, e.y, e.data);
Draw.z(effect.layer);
effect.render(cont);
}
Time.run(i * interval, () -> effect.create(x, y, rotation, color, data));
}
}
}

0 comments on commit ad856dc

Please sign in to comment.