@@ -318,6 +318,11 @@ export class BattleAnimation {
318318 ignore_if_dodge ?: boolean ;
319319 trail : boolean ;
320320 trail_factor : number ;
321+ trail_count : number ;
322+ trail_colorize : {
323+ color : number ;
324+ intensity : number ;
325+ } ;
321326 duration : number ;
322327 } [ ] = [ ] ;
323328 public particles_sequence : ParticlesInfo ;
@@ -1362,6 +1367,8 @@ export class BattleAnimation {
13621367 const count = lighting_seq . count ?? 1 ;
13631368 const trail = lighting_seq . trail ?? true ;
13641369 const trail_factor = lighting_seq . trail_factor ?? 0.5 ;
1370+ const trail_count = lighting_seq . trail_count ?? - 1 ;
1371+ const trail_colorize = lighting_seq . trail_colorize ?? null ;
13651372 const duration = _ . clamp ( lighting_seq . duration , 30 , Infinity ) ;
13661373 for ( let j = 0 ; j < count ; ++ j ) {
13671374 let resolve_function ;
@@ -1433,8 +1440,17 @@ export class BattleAnimation {
14331440 this . trails_objs . push ( trail_image ) ;
14341441 this . ability_sprites_groups [ group_pos ] . addChild ( trail_image ) ;
14351442 img . data . trail_image = trail_image ;
1443+ img . data . trail_count = trail_count ;
1444+ img . data . trail_applied = 0 ;
14361445 img . data . trail_enabled = true ;
14371446 img . data . render_texture = this . game . make . renderTexture ( img . width , img . height ) ;
1447+
1448+ if ( trail_colorize ) {
1449+ const colorize_filter = this . game . add . filter ( "Colorize" ) as Phaser . Filter . Colorize ;
1450+ colorize_filter . color = trail_colorize . color ;
1451+ colorize_filter . intensity = trail_colorize . intensity ;
1452+ trail_image . filters = [ colorize_filter ] ;
1453+ }
14381454 }
14391455
14401456 const y_data = cumsum ( random_normal ( data_size , lighting_seq . roughness ?? 0.01 , 0 ) ) ;
@@ -1982,6 +1998,12 @@ export class BattleAnimation {
19821998 if ( sprite . data . keep_core_white ) {
19831999 sprite . tint = sprite . data . color ;
19842000 }
2001+ if ( sprite . data . trail_count > 0 ) {
2002+ if ( sprite . data . trail_applied > sprite . data . trail_count ) {
2003+ return ;
2004+ }
2005+ ++ sprite . data . trail_applied ;
2006+ }
19852007 if ( sprite . data . render_texture ) {
19862008 sprite . data . render_texture . renderXY ( sprite , 0 , 0 ) ;
19872009 bm_data . draw ( sprite . data . render_texture ) ;
0 commit comments