@tool extends RichTextEffect class_name SmallWaveEffect var bbcode = "smallwave" func _process_custom_fx(char_fx: CharFXTransform) -> bool: var time = fmod(char_fx.elapsed_time * 8 - char_fx.relative_index + 100, 10) var local_time = fmod(time, 1) if time < 1: char_fx.offset = Vector2(0, -5 * (sin(local_time * PI))) if time < 3 or time >= 8: var color_time = local_time if time >= 1 and time < 3: color_time += 1 if time >= 2 and time < 3: color_time += 1 if time >= 0 and time < 3: color_time += 1 if time >= 9 or time < 3: color_time += 1 char_fx.color.a = (sin(color_time / 5 * PI)) * 0.3 + 0.7 else: char_fx.color.a = 0.7 return true