1- using Respawning ;
1+ using System ;
2+ using System . Linq ;
3+ using Respawning ;
24using SER . ArgumentSystem . Arguments ;
35using SER . ArgumentSystem . BaseArguments ;
6+ using SER . Helpers . Extensions ;
47using SER . MethodSystem . BaseMethods ;
58
69namespace SER . MethodSystem . Methods . CASSIEMethods ;
@@ -19,6 +22,11 @@ public class CassieMethod : SynchronousMethod
1922 new TextArgument ( "translation" )
2023 {
2124 DefaultValue = "" ,
25+ } ,
26+ new BoolArgument ( "should glitch" )
27+ {
28+ Description = "If true, SER will add random glitch effects to the announcement." ,
29+ DefaultValue = false ,
2230 }
2331 ] ;
2432
@@ -27,12 +35,38 @@ public override void Execute()
2735 var isNoisy = Args . GetOption ( "mode" ) == "jingle" ;
2836 var message = Args . GetText ( "message" ) ;
2937 var translation = Args . GetText ( "translation" ) ;
30-
31- RespawnEffectsController . PlayCassieAnnouncement (
32- message ,
33- false ,
34- isNoisy ,
35- ! string . IsNullOrWhiteSpace ( translation ) ,
36- translation ) ;
38+ var glitch = Args . GetBool ( "should glitch" ) ;
39+
40+ if ( glitch )
41+ {
42+ message = "jam_100_9 " + message
43+ . Split ( [ ' ' ] , StringSplitOptions . RemoveEmptyEntries )
44+ . Select ( part =>
45+ {
46+ if ( UnityEngine . Random . Range ( 1 , 3 ) == 1 ) return part ;
47+ return $ "pitch_{ UnityEngine . Random . Range ( 0.7f , 1.2f ) } { part } ";
48+
49+ } )
50+ . JoinStrings ( " " ) ;
51+ }
52+
53+ if ( string . IsNullOrEmpty ( translation ) )
54+ {
55+ RespawnEffectsController . PlayCassieAnnouncement (
56+ message ,
57+ false ,
58+ isNoisy
59+ ) ;
60+ }
61+ else
62+ {
63+ RespawnEffectsController . PlayCassieAnnouncement (
64+ message ,
65+ false ,
66+ isNoisy ,
67+ true ,
68+ translation
69+ ) ;
70+ }
3771 }
3872}
0 commit comments