10
10
import mindustry .entities .bullet .*;
11
11
import mindustry .gen .*;
12
12
import mindustry .graphics .*;
13
- import progressed .content .bullets .*;
14
13
import progressed .content .effects .*;
15
14
import progressed .entities .*;
16
15
import progressed .entities .bullet .pseudo3d .*;
17
16
import progressed .graphics .renders .*;
18
- import progressed .graphics .trails .*;
19
17
20
18
public class BlackHoleBulletType extends BulletType {
21
19
static Seq <Class <?>> immuneTypes = Seq .with (
@@ -32,6 +30,7 @@ public class BlackHoleBulletType extends BulletType{
32
30
public Effect absorbEffect = EnergyFx .blackHoleAbsorb , swirlEffect = EnergyFx .blackHoleSwirl ;
33
31
public float suctionRadius = 160f , size = 6f , lensEdge = -1f , damageRadius = 17f ;
34
32
public float force = 10f , scaledForce = 800f , bulletForce = 0.1f , bulletScaledForce = 1f ;
33
+ public float bulletDamage = 10f ;
35
34
public float swirlInterval = 3f ;
36
35
public int swirlEffects = 4 ;
37
36
public boolean repel ;
@@ -85,9 +84,14 @@ public void update(Bullet b){
85
84
other .move (impulse .x , impulse .y );
86
85
}
87
86
88
- /*if(Mathf.within(b.x, b.y, other.x, other.y, size * 2f)){
89
- absorbBullet(other);
90
- }*/
87
+ if (other .type .hittable && Mathf .within (b .x , b .y , other .x , other .y , size * 2f )){
88
+ float realDamage = bulletDamage * damageMultiplier (b );
89
+ if (other .damage > realDamage ){
90
+ other .damage (other .damage - realDamage );
91
+ }else {
92
+ other .remove ();
93
+ }
94
+ }
91
95
}
92
96
});
93
97
}
@@ -137,19 +141,6 @@ public void despawned(Bullet b){
137
141
}
138
142
}
139
143
140
- public void absorbBullet (Bullet bullet ){
141
- if (absorbEffect != Fx .none ) absorbEffect .at (bullet .x , bullet .y );
142
- if (bullet .type .trailLength > 0 && bullet .trail != null && bullet .trail .size () > 0 ){
143
- if (bullet .trail instanceof PMTrail t ){
144
- TrailFadeFx .PMTrailFade .at (bullet .x , bullet .y , bullet .type .trailWidth , bullet .type .trailColor , t .copyPM ());
145
- }else {
146
- Fx .trailFade .at (bullet .x , bullet .y , bullet .type .trailWidth , bullet .type .trailColor , bullet .trail .copy ());
147
- }
148
- }
149
- bullet .type = PMBullets .absorbed ;
150
- bullet .absorb ();
151
- }
152
-
153
144
public static boolean checkType (BulletType type ){ //Returns true for bullets immune to suction.
154
145
return immuneTypes .contains (c -> c .isAssignableFrom (type .getClass ()));
155
146
}
0 commit comments