From a97112adac127c45eb6dc774ad8fd2ecfa6b4611 Mon Sep 17 00:00:00 2001 From: Gurge44 Date: Tue, 3 Dec 2024 09:53:21 +0100 Subject: [PATCH] and even more fixes --- .editorconfig | 23 ++++++++++++----------- GameMode/SoloPVP.cs | 3 ++- Modules/CustomRolesHelper.cs | 1 + Modules/OptionHolder.cs | 6 ------ Roles/Crewmate/Negotiator.cs | 5 ++++- Roles/RoleBase.cs | 9 ++++++++- 6 files changed, 27 insertions(+), 20 deletions(-) diff --git a/.editorconfig b/.editorconfig index 21a5847d8..808886d28 100644 --- a/.editorconfig +++ b/.editorconfig @@ -73,6 +73,7 @@ resharper_braces_for_lock = required_for_multiline resharper_braces_for_using = required_for_multiline resharper_braces_for_while = required_for_multiline resharper_braces_redundant = true +resharper_csharp_align_multiline_calls_chain = false resharper_csharp_indent_statement_pars = outside_and_inside resharper_csharp_outdent_commas = true resharper_csharp_stick_comment = false @@ -116,31 +117,31 @@ dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case dotnet_naming_symbols.interface.applicable_kinds = interface dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected -dotnet_naming_symbols.interface.required_modifiers = +dotnet_naming_symbols.interface.required_modifiers = dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected -dotnet_naming_symbols.types.required_modifiers = +dotnet_naming_symbols.types.required_modifiers = dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected -dotnet_naming_symbols.non_field_members.required_modifiers = +dotnet_naming_symbols.non_field_members.required_modifiers = # Naming styles dotnet_naming_style.begins_with_i.required_prefix = I -dotnet_naming_style.begins_with_i.required_suffix = -dotnet_naming_style.begins_with_i.word_separator = +dotnet_naming_style.begins_with_i.required_suffix = +dotnet_naming_style.begins_with_i.word_separator = dotnet_naming_style.begins_with_i.capitalization = pascal_case -dotnet_naming_style.pascal_case.required_prefix = -dotnet_naming_style.pascal_case.required_suffix = -dotnet_naming_style.pascal_case.word_separator = +dotnet_naming_style.pascal_case.required_prefix = +dotnet_naming_style.pascal_case.required_suffix = +dotnet_naming_style.pascal_case.word_separator = dotnet_naming_style.pascal_case.capitalization = pascal_case -dotnet_naming_style.pascal_case.required_prefix = -dotnet_naming_style.pascal_case.required_suffix = -dotnet_naming_style.pascal_case.word_separator = +dotnet_naming_style.pascal_case.required_prefix = +dotnet_naming_style.pascal_case.required_suffix = +dotnet_naming_style.pascal_case.word_separator = dotnet_naming_style.pascal_case.capitalization = pascal_case dotnet_style_coalesce_expression = true:suggestion dotnet_style_null_propagation = true:suggestion diff --git a/GameMode/SoloPVP.cs b/GameMode/SoloPVP.cs index 153cfc369..ce6f4d6dd 100644 --- a/GameMode/SoloPVP.cs +++ b/GameMode/SoloPVP.cs @@ -325,7 +325,8 @@ internal static class SoloPVP if (!__instance.SoloAlive()) { - if (__instance.inVent && KB_BootVentWhenDead.GetBool()) __instance.MyPhysics.RpcExitVent(2); + if (__instance.inVent && KB_BootVentWhenDead.GetBool()) + __instance.MyPhysics.RpcExitVent(2); Vector2 pos = Pelican.GetBlackRoomPS(); float dis = Vector2.Distance(pos, __instance.Pos()); diff --git a/Modules/CustomRolesHelper.cs b/Modules/CustomRolesHelper.cs index 26353bd92..2727c8807 100644 --- a/Modules/CustomRolesHelper.cs +++ b/Modules/CustomRolesHelper.cs @@ -794,6 +794,7 @@ internal static class CustomRolesHelper CustomRoles.Markseeker when Markseeker.CancelVote.GetBool() => true, CustomRoles.Godfather when Options.GodfatherCancelVote.GetBool() => true, CustomRoles.Socialite when Socialite.CancelVote.GetBool() => true, + CustomRoles.Negotiator when Negotiator.CancelVote.GetBool() => true, CustomRoles.President => true, diff --git a/Modules/OptionHolder.cs b/Modules/OptionHolder.cs index 1a5d12451..a4db9d366 100644 --- a/Modules/OptionHolder.cs +++ b/Modules/OptionHolder.cs @@ -681,7 +681,6 @@ public static class Options public static OptionItem UseUnshiftTriggerForNKs; public static OptionItem UsePhantomBasis; public static OptionItem UsePhantomBasisForNKs; - public static OptionItem UseVoteCancelling; public static OptionItem AutoKickStart; public static OptionItem AutoKickStartAsBan; public static OptionItem AutoKickStartTimes; @@ -1932,11 +1931,6 @@ public static class Options .SetParent(UsePhantomBasis) .SetColor(new Color32(255, 255, 44, byte.MaxValue)); - UseVoteCancelling = new BooleanOptionItem(23852, "UseVoteCancelling", false, TabGroup.TaskSettings) - .SetGameMode(CustomGameMode.Standard) - .SetHeader(true) - .SetColor(new Color32(0, 65, 196, byte.MaxValue)); - EveryoneCanVent = new BooleanOptionItem(23853, "EveryoneCanVent", false, TabGroup.TaskSettings) .SetGameMode(CustomGameMode.Standard) .SetHeader(true) diff --git a/Roles/Crewmate/Negotiator.cs b/Roles/Crewmate/Negotiator.cs index 7ed610a29..900f70c04 100644 --- a/Roles/Crewmate/Negotiator.cs +++ b/Roles/Crewmate/Negotiator.cs @@ -22,6 +22,8 @@ public class Negotiator : RoleBase private Dictionary> PermanentPenalties; private byte TargetId; + public static OptionItem CancelVote; + public override bool IsEnable => On; public override void SetupCustomOption() @@ -32,7 +34,8 @@ public class Negotiator : RoleBase .AutoSetupOption(ref LowSpeed, 0.9f, new FloatValueRule(0.1f, 2f, 0.1f), OptionFormat.Multiplier) .AutoSetupOption(ref AbilityUseLimit, 0, new IntegerValueRule(0, 20, 1), OptionFormat.Times) .AutoSetupOption(ref AbilityUseGainWithEachTaskCompleted, 0.4f, new FloatValueRule(0f, 5f, 0.05f), OptionFormat.Times) - .AutoSetupOption(ref AbilityChargesWhenFinishedTasks, 0.2f, new FloatValueRule(0f, 5f, 0.05f), OptionFormat.Times); + .AutoSetupOption(ref AbilityChargesWhenFinishedTasks, 0.2f, new FloatValueRule(0f, 5f, 0.05f), OptionFormat.Times) + .CreateVoteCancellingSetting(ref CancelVote); } public override void Init() diff --git a/Roles/RoleBase.cs b/Roles/RoleBase.cs index 468718062..b3cf0c515 100644 --- a/Roles/RoleBase.cs +++ b/Roles/RoleBase.cs @@ -228,8 +228,15 @@ public class OptionSetupHandler(int id, TabGroup tab, CustomRoles role) return this; } - public void CreateOverrideTasksData() + public OptionSetupHandler CreateOverrideTasksData() { Options.OverrideTasksData.Create(++_id, tab, role); + return this; + } + + public OptionSetupHandler CreateVoteCancellingSetting(ref OptionItem field) + { + field = Options.CreateVoteCancellingUseSetting(++_id, role, tab); + return this; } } \ No newline at end of file