File tree Expand file tree Collapse file tree
Patches/Functions/Holidays Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,6 +9,12 @@ namespace LabExtended.Core.Configs
99 /// </summary>
1010 public class ApiConfig
1111 {
12+ /// <summary>
13+ /// Gets or sets the probability of SCP-956 utilizing the Capybara model.
14+ /// </summary>
15+ [ Description ( "Sets the chance of SCP-559 using the Capybara model." ) ]
16+ public float ? Scp956CapybaraChance { get ; set ; } = null ;
17+
1218 /// <summary>
1319 /// Gets or sets the configuration settings for file storage.
1420 /// </summary>
Original file line number Diff line number Diff line change 1+ using HarmonyLib ;
2+
3+ using LabExtended . Core ;
4+ using LabExtended . Utilities ;
5+
6+ using UnityEngine ;
7+
8+ namespace LabExtended . Patches . Functions . Holidays
9+ {
10+ /// <summary>
11+ /// Implements the Scp956CapybaraChance config.
12+ /// </summary>
13+ public static class CapybaraChancePatch
14+ {
15+ /// <summary>
16+ /// The number which forces a Capybara model ...........
17+ /// </summary>
18+ public const byte CapybaraNumber = 67 ;
19+
20+ [ HarmonyPatch ( typeof ( Scp956Pinata ) , nameof ( Scp956Pinata . Network_carpincho ) , MethodType . Setter ) ]
21+ private static bool Prefix ( Scp956Pinata __instance , ref byte value )
22+ {
23+ if ( ApiLoader . ApiConfig ? . Scp956CapybaraChance is null )
24+ return true ;
25+
26+ var chance = Mathf . Clamp ( ApiLoader . ApiConfig . Scp956CapybaraChance . Value , 0f , 100f ) ;
27+
28+ if ( ! WeightUtils . GetBool ( chance ) )
29+ {
30+ if ( value == CapybaraNumber )
31+ {
32+ value = 1 ;
33+ }
34+ }
35+ else
36+ {
37+ value = CapybaraNumber ;
38+ }
39+
40+ return true ;
41+ }
42+ }
43+ }
You can’t perform that action at this time.
0 commit comments