@@ -59,7 +59,9 @@ public class CassetteMoveBlock : CustomCassetteBlock
5959 private readonly ParticleType P_Break ;
6060 private readonly ParticleType P_BreakPressed ;
6161
62- public CassetteMoveBlock ( Vector2 position , EntityID id , int width , int height , Directions direction , float moveSpeed , int index , float tempo , bool oldConnectionBehavior , Color ? overrideColor , float crashTime , float regenTime , bool shakeOnCollision )
62+ private readonly bool noDebris ;
63+
64+ public CassetteMoveBlock ( Vector2 position , EntityID id , int width , int height , Directions direction , float moveSpeed , int index , float tempo , bool oldConnectionBehavior , Color ? overrideColor , float crashTime , float regenTime , bool shakeOnCollision , bool noDebris )
6365 : base ( position , id , width , height , index , tempo , true , oldConnectionBehavior , dynamicHitbox : true , overrideColor )
6466 {
6567 startPosition = position ;
@@ -82,6 +84,8 @@ public CassetteMoveBlock(Vector2 position, EntityID id, int width, int height, D
8284 P_Break = new ParticleType ( MoveBlock . P_Break ) { Color = color } ;
8385 P_BreakPressed = new ParticleType ( MoveBlock . P_Break ) { Color = pressedColor } ;
8486
87+ this . noDebris = noDebris ;
88+
8589 DynamicData dynamicData = new ( this ) ;
8690 Add ( new MoveBlockRedirectable (
8791 dynamicData ,
@@ -116,7 +120,7 @@ public CassetteMoveBlock(Vector2 position, EntityID id, int width, int height, D
116120 }
117121
118122 public CassetteMoveBlock ( EntityData data , Vector2 offset , EntityID id )
119- : this ( data . Position + offset , id , data . Width , data . Height , data . Enum ( "direction" , Directions . Left ) , data . Bool ( "fast" ) ? FastMoveSpeed : data . Float ( "moveSpeed" , MoveSpeed ) , data . Int ( "index" ) , data . Float ( "tempo" , 1f ) , data . Bool ( "oldConnectionBehavior" , true ) , data . HexColorNullable ( "customColor" ) , data . Float ( "crashTime" , 0.15f ) , data . Float ( "regenTime" , 3f ) , data . Bool ( "shakeOnCollision" , true ) )
123+ : this ( data . Position + offset , id , data . Width , data . Height , data . Enum ( "direction" , Directions . Left ) , data . Bool ( "fast" ) ? FastMoveSpeed : data . Float ( "moveSpeed" , MoveSpeed ) , data . Int ( "index" ) , data . Float ( "tempo" , 1f ) , data . Bool ( "oldConnectionBehavior" , true ) , data . HexColorNullable ( "customColor" ) , data . Float ( "crashTime" , 0.15f ) , data . Float ( "regenTime" , 3f ) , data . Bool ( "shakeOnCollision" , true ) , data . Bool ( "noDebris" ) )
120124 {
121125 }
122126
@@ -260,19 +264,21 @@ private IEnumerator Controller()
260264 BreakParticles ( ) ;
261265 ( ( MoveBlockRedirectable ) Get < Redirectable > ( ) ) ? . ResetBlock ( ) ;
262266 List < MoveBlockDebris > debris = new ( ) ;
263- for ( int x = 0 ; x < Width ; x += 8 )
264- {
265- for ( int y = 0 ; y < Height ; y += 8 )
267+ if ( ! noDebris ) {
268+ for ( int x = 0 ; x < Width ; x += 8 )
266269 {
267- Vector2 offset = new ( x + 4f , y + 4f ) ;
268-
269- MoveBlockDebris d = Engine . Pooler . Create < MoveBlockDebris > ( ) . Init ( Position + offset , Center , startPosition + offset , spr =>
270+ for ( int y = 0 ; y < Height ; y += 8 )
270271 {
271- spr . Color = Activated ? color : pressedColor ;
272- } ) ;
273- d . Sprite . Texture = Calc . Random . Choose ( GFX . Game . GetAtlasSubtextures ( "objects/CommunalHelper/cassetteMoveBlock/debris" ) ) ;
274- debris . Add ( d ) ;
275- Scene . Add ( d ) ;
272+ Vector2 offset = new ( x + 4f , y + 4f ) ;
273+
274+ MoveBlockDebris d = Engine . Pooler . Create < MoveBlockDebris > ( ) . Init ( Position + offset , Center , startPosition + offset , spr =>
275+ {
276+ spr . Color = Activated ? color : pressedColor ;
277+ } ) ;
278+ d . Sprite . Texture = Calc . Random . Choose ( GFX . Game . GetAtlasSubtextures ( "objects/CommunalHelper/cassetteMoveBlock/debris" ) ) ;
279+ debris . Add ( d ) ;
280+ Scene . Add ( d ) ;
281+ }
276282 }
277283 }
278284 Vector2 newPosition = startPosition + blockOffset ;
@@ -336,7 +342,7 @@ private IEnumerator Controller()
336342
337343 private IEnumerator SoundFollowsDebrisCenter ( EventInstance instance , List < MoveBlockDebris > debris )
338344 {
339- while ( true )
345+ while ( true && debris . Count > 0 )
340346 {
341347 instance . getPlaybackState ( out PLAYBACK_STATE state ) ;
342348 if ( state == PLAYBACK_STATE . STOPPED )
0 commit comments