@@ -22,10 +22,10 @@ public class CassieMethod : SynchronousMethod
2222 {
2323 DefaultValue = new ( "" , "empty" ) ,
2424 } ,
25- new BoolArgument ( "should glitch" )
25+ new FloatArgument ( " glitch scale" , 0 , 1 )
2626 {
27- Description = "If true, SER will add random glitch effects to the announcement." ,
28- DefaultValue = new ( false , null ) ,
27+ DefaultValue = new ( 0f , "0%" ) ,
28+ Description = "The amount of glitching to apply to the announcement, from 0% to 100%"
2929 }
3030 ] ;
3131
@@ -34,45 +34,13 @@ public override void Execute()
3434 var isNoisy = Args . GetOption ( "mode" ) == "jingle" ;
3535 var message = Args . GetText ( "message" ) ;
3636 var subtitles = Args . GetText ( "subtitles" ) ;
37- var glitch = Args . GetBool ( "should glitch" ) ;
38-
39- // todo: check if this is still needed
40- if ( glitch )
41- {
42- // taken from Respawning.Announcements.WaveAnnouncementBase.PlayAnnouncement()
43- var chanceMultiplier = AlphaWarheadController . Detonated ? 2.5f : 1 ;
44- var glitchChance = UnityEngine . Random . Range ( 0.08f , 0.1f ) * chanceMultiplier ;
45- var jamChance = UnityEngine . Random . Range ( 0.07f , 0.09f ) * chanceMultiplier ;
46-
47- var strArray = message . Split ( [ ' ' ] , StringSplitOptions . None ) ;
48- message = "" ;
49- // taken from NineTailedFoxAnnouncer.ServerOnlyAddGlitchyPhrase()
50- for ( var index = 0 ; index < strArray . Length ; index ++ )
51- {
52- message += $ "{ strArray [ index ] } ";
53-
54- if ( index >= strArray . Length - 1 )
55- {
56- continue ;
57- }
58-
59- if ( UnityEngine . Random . value < glitchChance )
60- {
61- message += $ ".G{ UnityEngine . Random . Range ( 1 , 7 ) } ";
62- }
63-
64- if ( UnityEngine . Random . value < jamChance )
65- {
66- message += $ "jam_{ UnityEngine . Random . Range ( 0 , 70 ) : 000} _{ UnityEngine . Random . Range ( 2 , 6 ) } ";
67- }
68- }
69- }
37+ var glitch = Args . GetFloat ( "glitch scale" ) ;
7038
71- // todo: check if this glitchScale works as intended
7239 Announcer . Message (
7340 message ,
7441 subtitles ,
75- glitchScale : isNoisy ? 1 : 0
42+ isNoisy ,
43+ glitchScale : glitch
7644 ) ;
7745 }
7846}
0 commit comments