@@ -43,7 +43,7 @@ public class ArcBulletType extends BulletType{
43
43
public float spokeWidth = 2f , spokeLength = 8f ;
44
44
public float spikeSpin = 0.5f ;
45
45
public float zoneLifeOffset = 0f ;
46
- public float growTime = 6f , shrinkTime = 0f ;
46
+ public float growTime = 10f , shrinkTime = 0f ;
47
47
public Color zoneColor = Color .red , targetColor = Color .red ;
48
48
49
49
static {
@@ -89,6 +89,7 @@ public void init(){
89
89
if (fragBullet instanceof ArcBulletType a ){
90
90
a .isInheritive = true ;
91
91
a .zoneLifeOffset = a .zoneLifeOffset * a .lifetimeScl + lifetimeScl ;
92
+ shrinkTime = 0 ;
92
93
}
93
94
94
95
if (intervalBullet instanceof ArcBulletType a ) a .isInheritive = true ;
@@ -190,7 +191,7 @@ public void createFrags(Bullet b, float x, float y){
190
191
if (fragBullet instanceof ArcBulletType aType ){
191
192
for (int i = 0 ; i < fragBullets ; i ++){
192
193
float a = b .rotation () + Mathf .range (fragRandomSpread / 2 ) + fragAngle + ((i - fragBullets /2f ) * fragSpread );
193
- aType .create3DInherit (b , a , aType .arcFragDrift , false );
194
+ (( ArcBulletData ) aType .create3DInherit (b , a , aType .arcFragDrift , false ). data ). splitFrom = ( ArcBulletType ) b . type ;
194
195
}
195
196
}else {
196
197
super .createFrags (b , x , y );
@@ -276,20 +277,30 @@ public void drawTargetZone(Bullet b){
276
277
Draw .color (zoneColor );
277
278
278
279
float realLife = b .lifetime * lifetimeScl ;
279
- float scl = Mathf .curve (b .time , 0 , growTime ) - Mathf .curve (b .time , realLife - shrinkTime , realLife );
280
+ float grow = Mathf .curve (b .time , 0 , growTime );
281
+ float shrink = Mathf .curve (b .time , realLife - shrinkTime , realLife );
282
+ float scl = grow - shrink ;
283
+
284
+ ArcBulletType splitFrom = ((ArcBulletData )b .data ).splitFrom ;
285
+ boolean split = splitFrom != null ;
286
+ if (split ) grow = Interp .smooth .apply (grow );
287
+ float fout = 1 - shrink ;
280
288
281
289
float x = b .aimX , y = b .aimY ;
282
290
float ang = Mathf .randomSeed (b .id , 360 ) + b .time * spikeSpin ;
283
- float zR = zoneRadius * scl ;
284
- if ( drawZone && zR > 0f ){
291
+ if ( drawZone ){
292
+ float zR = split ? Mathf . lerp ( splitFrom . zoneRadius , zoneRadius , grow ) * fout : zoneRadius * scl ;
285
293
PMDrawf .ring (x , y , zR , zR + 2f );
286
- float sW1 = spikesWidth1 * scl , sL1 = spikesLength1 * scl ;
294
+
295
+ float sW1 = split ? Mathf .lerp (splitFrom .spikesWidth1 , spikesWidth1 , grow ) * fout : spikesWidth1 * scl ,
296
+ sL1 = split ? Mathf .lerp (splitFrom .spikesLength1 , spikesLength1 , grow ) * fout : spikesLength1 * scl ;
287
297
for (int i = 0 ; i < 4 ; i ++){
288
298
float a = ang + 90 * i ;
289
299
Drawf .tri (x + Angles .trnsx (a , zR ), y + Angles .trnsy (a , zR ), sW1 , sL1 , a + 180 );
290
300
Drawf .tri (x + Angles .trnsx (a , zR ), y + Angles .trnsy (a , zR ), sW1 , sL1 / 2f , a );
291
301
}
292
- float sW2 = spikesWidth2 * scl , sL2 = spikesLength2 * scl ;
302
+ float sW2 = split ? Mathf .lerp (splitFrom .spikesWidth2 , spikesWidth2 , grow ) * fout : spikesWidth2 * scl ,
303
+ sL2 = split ? Mathf .lerp (splitFrom .spikesLength2 , spikesLength2 , grow ) * fout : spikesLength2 * scl ;
293
304
for (int i = 0 ; i < 4 ; i ++){
294
305
float a = ang + 45 + 90 * i ;
295
306
Drawf .tri (x + Angles .trnsx (a , zR ), y + Angles .trnsy (a , zR ), sW2 , sL2 , a + 180 );
@@ -298,14 +309,17 @@ public void drawTargetZone(Bullet b){
298
309
}
299
310
300
311
float fin = b .fin () / lifetimeScl ;
301
- PMDrawf .progressRing (x , y , progressRadius * scl , (progressRadius + 4f ) * scl , fin );
302
-
303
- PMDrawf .ring (x , y , targetRadius * scl , (targetRadius + 2f ) * scl );
304
- Lines .stroke (spokeWidth * scl );
305
- float tR = targetRadius * scl ;
312
+ float pR = split ? Mathf .lerp (splitFrom .progressRadius , progressRadius , grow ) * fout : progressRadius * scl ;
313
+ PMDrawf .progressRing (x , y , pR , pR + 4f , fin );
314
+
315
+ float tR = split ? Mathf .lerp (splitFrom .targetRadius , targetRadius , grow ) * fout : targetRadius * scl ,
316
+ sW = split ? Mathf .lerp (splitFrom .spokeWidth , spokeWidth , grow ) * fout : spokeWidth * scl ,
317
+ sL = split ? Mathf .lerp (splitFrom .spokeLength , spokeLength , grow ) * fout : spokeLength * scl ;
318
+ PMDrawf .ring (x , y , tR , tR + 2 );
319
+ Lines .stroke (sW );
306
320
for (int i = 0 ; i < 4 ; i ++){
307
321
float a = -ang + 90 * i ;
308
- Lines .lineAngleCenter (x + Angles .trnsx (a , tR ), y + Angles .trnsy (a , tR ), a , spokeLength * scl , false );
322
+ Lines .lineAngleCenter (x + Angles .trnsx (a , tR ), y + Angles .trnsy (a , tR ), a , sL , false );
309
323
}
310
324
}
311
325
@@ -467,6 +481,7 @@ public static class ArcBulletData implements Cloneable{
467
481
public float xAccel , yAccel ;
468
482
public float lastZ , z , zVel , gravity ;
469
483
public float targetDriftX , targetDriftY ;
484
+ public ArcBulletType splitFrom ;
470
485
471
486
public ArcBulletData (float z , float zVel , float gravity ){
472
487
this .z = z ;
0 commit comments