From b5a84ce9aec933dd3e481556844e00d18f930f27 Mon Sep 17 00:00:00 2001 From: yukieiji Date: Sun, 11 Feb 2024 22:28:33 +0900 Subject: [PATCH 01/24] fix:raise hand one time --- ExtremeRoles/Module/SystemType/RaiseHandSystem.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ExtremeRoles/Module/SystemType/RaiseHandSystem.cs b/ExtremeRoles/Module/SystemType/RaiseHandSystem.cs index 82c0cc2f8..6a009f807 100644 --- a/ExtremeRoles/Module/SystemType/RaiseHandSystem.cs +++ b/ExtremeRoles/Module/SystemType/RaiseHandSystem.cs @@ -164,15 +164,22 @@ public void Deserialize(MessageReader reader, bool initialState) } } + var downHand = new List(this.raisedHand.Count); foreach (byte id in this.raisedHand.Keys) { if (!newRaiseHand.Remove(id) && this.allHand.TryGetValue(id, out var hand) && hand != null) { + downHand.Add(id); hand.Down(); } } + + foreach (byte id in downHand) + { + this.raisedHand.Remove(id); + } } public void Serialize(MessageWriter writer, bool initialState) From 1f2be271c776032da15f7797c5d28b298f7046cf Mon Sep 17 00:00:00 2001 From: yukieiji Date: Sun, 11 Feb 2024 23:12:59 +0900 Subject: [PATCH 02/24] update:veta --- ExtremeRoles.Beta | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ExtremeRoles.Beta b/ExtremeRoles.Beta index 439473f2a..cd18c61fd 160000 --- a/ExtremeRoles.Beta +++ b/ExtremeRoles.Beta @@ -1 +1 @@ -Subproject commit 439473f2ae2aea7bf2e7447edd3b4962d7c75e0a +Subproject commit cd18c61fd84b0a84a794c478abb7326f4422300b From 2a2f95b9ffff752829da5d5ca852902c9a0cbb66 Mon Sep 17 00:00:00 2001 From: yukieiji Date: Tue, 13 Feb 2024 23:16:12 +0900 Subject: [PATCH 03/24] refactor:tests --- ExtremeRoles.Test/GameTestRunner.cs | 20 ++++++++++---------- ExtremeRoles/Resources/Loader.cs | 5 +++++ 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/ExtremeRoles.Test/GameTestRunner.cs b/ExtremeRoles.Test/GameTestRunner.cs index 476976f09..351a94424 100644 --- a/ExtremeRoles.Test/GameTestRunner.cs +++ b/ExtremeRoles.Test/GameTestRunner.cs @@ -34,25 +34,24 @@ public override void Run() GameMudderEndTestingBehaviour.Instance.StartCoroutine( GameMudderEndTestingBehaviour.Instance.Run( new("Random", 3), - new("NeutralRemove", 5, new () - { + new("NeutralRemove", 5, + [ ExtremeRoleId.Jester, ExtremeRoleId.TaskMaster, ExtremeRoleId.Neet, ExtremeRoleId.Umbrer, ExtremeRoleId.Madmate - }), - new("YokoWin", 5, new() { ExtremeRoleId.Yoko }, + ]), + new("YokoWin", 5, [ ExtremeRoleId.Yoko ], () => { GameUtility.UpdateExROption( new((int)GlobalOption.IsSameNeutralSameWin, 1)); }), new("NeutralWin", 100, - new () - { + [ ExtremeRoleId.Alice, ExtremeRoleId.Jackal, ExtremeRoleId.Missionary, ExtremeRoleId.Miner, ExtremeRoleId.Eater, ExtremeRoleId.Queen - }, + ], () => { GameUtility.UpdateExROption( @@ -61,7 +60,7 @@ public override void Run() new RequireOption( Int32OptionNames.NumImpostors, 0)); }), - new("QueenWin", 100, new () { ExtremeRoleId.Queen }, + new("QueenWin", 100, [ ExtremeRoleId.Queen ], () => { GameUtility.UpdateExROption( @@ -70,7 +69,7 @@ public override void Run() new RequireOption( Int32OptionNames.NumImpostors, 3)); }), - new("YandereWin", 100, new HashSet() { ExtremeRoleId.Yandere }))); + new("YandereWin", 100, [ ExtremeRoleId.Yandere ]))); } } @@ -132,6 +131,7 @@ private IEnumerator runTestCase(GameTestRunner.TestCase testCase) { this.Logger.LogInfo("Wait for 30s"); GC.Collect(); + Resources.Loader.ResetCache(); yield return UnityResource.UnloadUnusedAssets(); yield return new WaitForSeconds(30.0f); this.count = 0; @@ -142,7 +142,7 @@ private IEnumerator runTestCase(GameTestRunner.TestCase testCase) while (GameUtility.IsContinue) { var player = CachedPlayerControl.AllPlayerControls.OrderBy(x => RandomGenerator.Instance.Next()).First(); - if (!player.Data.IsDead || ExtremeRoleManager.GameRole[player.PlayerId].Id != ExtremeRoleId.Assassin) + if (!player.Data.IsDead && ExtremeRoleManager.GameRole[player.PlayerId].Id != ExtremeRoleId.Assassin) { Player.RpcUncheckMurderPlayer(player.PlayerId, player.PlayerId, byte.MinValue); yield return new WaitForSeconds(1.0f); diff --git a/ExtremeRoles/Resources/Loader.cs b/ExtremeRoles/Resources/Loader.cs index 7d89b544e..90173289b 100644 --- a/ExtremeRoles/Resources/Loader.cs +++ b/ExtremeRoles/Resources/Loader.cs @@ -148,6 +148,11 @@ public static class Path public static class Loader { + public static void ResetCache() + { + cachedBundle.Clear(); + cachedSprite.Clear(); + } private static readonly Dictionary cachedSprite = new Dictionary (); private static readonly Dictionary cachedBundle = new Dictionary(); From 910223791ca5fbad49665b8c0852bce1a7235bc7 Mon Sep 17 00:00:00 2001 From: yukieiji Date: Tue, 13 Feb 2024 21:05:25 +0900 Subject: [PATCH 04/24] refactor:move IRoleAbility method --- .../Roles/API/Interface/IRoleAbility.cs | 55 +++++++++---------- ExtremeRoles/Roles/API/RoleSetting.cs | 10 +++- 2 files changed, 35 insertions(+), 30 deletions(-) diff --git a/ExtremeRoles/Roles/API/Interface/IRoleAbility.cs b/ExtremeRoles/Roles/API/Interface/IRoleAbility.cs index ddda35754..6e17607ea 100644 --- a/ExtremeRoles/Roles/API/Interface/IRoleAbility.cs +++ b/ExtremeRoles/Roles/API/Interface/IRoleAbility.cs @@ -4,7 +4,7 @@ using ExtremeRoles.Module; using ExtremeRoles.Module.AbilityFactory; using ExtremeRoles.Module.AbilityBehavior.Interface; -using ExtremeRoles.Module.CustomOption; + using ExtremeRoles.Performance; namespace ExtremeRoles.Roles.API.Interface; @@ -28,6 +28,32 @@ public ExtremeAbilityButton Button public bool UseAbility(); public bool IsAbilityUse(); + + public void RoleAbilityInit() + { + if (this.Button == null) { return; } + + var allOpt = OptionManager.Instance; + this.Button.Behavior.SetCoolTime( + allOpt.GetValue( + this.GetRoleOptionId(RoleAbilityCommonOption.AbilityCoolTime))); + + if (allOpt.TryGet( + this.GetRoleOptionId(RoleAbilityCommonOption.AbilityActiveTime), + out var activeTimeOption)) + { + this.Button.Behavior.SetActiveTime(activeTimeOption.GetValue()); + } + + if (this.Button.Behavior is ICountBehavior countBehavior) + { + countBehavior.SetAbilityCount( + allOpt.GetValue(this.GetRoleOptionId( + RoleAbilityCommonOption.AbilityCount))); + } + + this.Button.OnMeetingEnd(); + } } public static class IRoleAbilityMixin @@ -254,31 +280,4 @@ public static bool IsCommonUse(this IRoleAbility _) ExileController.Instance == null && IntroCutscene.Instance == null; } - - public static void RoleAbilityInit(this IRoleAbility self) - { - - if (self.Button == null) { return; } - - var allOpt = OptionManager.Instance; - self.Button.Behavior.SetCoolTime( - allOpt.GetValue( - self.GetRoleOptionId(RoleAbilityCommonOption.AbilityCoolTime))); - - if (allOpt.TryGet( - self.GetRoleOptionId(RoleAbilityCommonOption.AbilityActiveTime), - out var activeTimeOption)) - { - self.Button.Behavior.SetActiveTime(activeTimeOption.GetValue()); - } - - if (self.Button.Behavior is ICountBehavior countBehavior) - { - countBehavior.SetAbilityCount( - allOpt.GetValue(self.GetRoleOptionId( - RoleAbilityCommonOption.AbilityCount))); - } - - self.Button.OnMeetingEnd(); - } } diff --git a/ExtremeRoles/Roles/API/RoleSetting.cs b/ExtremeRoles/Roles/API/RoleSetting.cs index b5c1ed428..47feeb30b 100644 --- a/ExtremeRoles/Roles/API/RoleSetting.cs +++ b/ExtremeRoles/Roles/API/RoleSetting.cs @@ -1,5 +1,6 @@ using System; using ExtremeRoles.Module.CustomOption; +using ExtremeRoles.Roles.API.Interface; namespace ExtremeRoles.Roles.API; @@ -48,6 +49,11 @@ public void Initialize() { CommonInit(); RoleSpecificInit(); + + if (this is IRoleAbility ability) + { + ability.RoleAbilityInit(); + } } public void CreateRoleAllOption( @@ -56,7 +62,7 @@ public void CreateRoleAllOption( this.OptionIdOffset = optionIdOffset; var parentOps = CreateSpawnOption(); CreateVisionOption(parentOps); - + if (this.CanKill) { CreateKillerOption(parentOps); @@ -70,7 +76,7 @@ public void CreateRoleSpecificOption( { this.OptionIdOffset = optionIdOffset; CreateVisionOption(parentOps); - + if (this.CanKill) { CreateKillerOption(parentOps); From b90265e56de7149cb351a3a2d01f3106889a91e4 Mon Sep 17 00:00:00 2001 From: yukieiji Date: Tue, 13 Feb 2024 21:07:44 +0900 Subject: [PATCH 05/24] refactor: combinations --- ExtremeRoles/Roles/Combination/Accelerator.cs | 2 -- ExtremeRoles/Roles/Combination/HeroAcademia.cs | 4 ---- ExtremeRoles/Roles/Combination/Kids.cs | 5 ++--- ExtremeRoles/Roles/Combination/Mover.cs | 2 -- ExtremeRoles/Roles/Combination/Traitor.cs | 1 - 5 files changed, 2 insertions(+), 12 deletions(-) diff --git a/ExtremeRoles/Roles/Combination/Accelerator.cs b/ExtremeRoles/Roles/Combination/Accelerator.cs index dfd0fab93..e3fc0d08e 100644 --- a/ExtremeRoles/Roles/Combination/Accelerator.cs +++ b/ExtremeRoles/Roles/Combination/Accelerator.cs @@ -200,8 +200,6 @@ protected override void CreateSpecificOption( protected override void RoleSpecificInit() { - this.RoleAbilityInit(); - this.roleNamePrefix = this.CreateImpCrewPrefix(); this.canUseOtherPlayer = OptionManager.Instance.GetValue( diff --git a/ExtremeRoles/Roles/Combination/HeroAcademia.cs b/ExtremeRoles/Roles/Combination/HeroAcademia.cs index 10d139596..4238f84c7 100644 --- a/ExtremeRoles/Roles/Combination/HeroAcademia.cs +++ b/ExtremeRoles/Roles/Combination/HeroAcademia.cs @@ -675,8 +675,6 @@ protected override void CreateSpecificOption( protected override void RoleSpecificInit() { - this.RoleAbilityInit(); - this.featKillPer = OptionManager.Instance.GetValue( GetRoleOptionId(HeroOption.FeatKillPercentage)) / 100.0f; this.featButtonAbilityPer = OptionManager.Instance.GetValue( @@ -857,7 +855,6 @@ protected override void CreateSpecificOption( protected override void RoleSpecificInit() { - this.RoleAbilityInit(); this.vigilanteArrowTime = OptionManager.Instance.GetValue( GetRoleOptionId(VillanOption.VigilanteSeeTime)); this.vigilanteArrowTimer = 0.0f; @@ -1063,7 +1060,6 @@ protected override void CreateSpecificOption( protected override void RoleSpecificInit() { - this.RoleAbilityInit(); this.range = OptionManager.Instance.GetValue( GetRoleOptionId(VigilanteOption.Range)); } diff --git a/ExtremeRoles/Roles/Combination/Kids.cs b/ExtremeRoles/Roles/Combination/Kids.cs index f5091b684..2402483e9 100644 --- a/ExtremeRoles/Roles/Combination/Kids.cs +++ b/ExtremeRoles/Roles/Combination/Kids.cs @@ -285,9 +285,9 @@ public void CreateAbility() new RoleButtonActivator(), KeyCode.F); - this.RoleAbilityInit(); + ((IRoleAbility)(this)).RoleAbilityInit(); - if (this.Button?.Behavior is DelinquentAbilityBehavior behavior) + if (this.Button?.Behavior is DelinquentAbilityBehavior behavior) { behavior.SetAbilityCount( OptionManager.Instance.GetValue(GetRoleOptionId( @@ -365,7 +365,6 @@ protected override void RoleSpecificInit() this.range = OptionManager.Instance.GetValue( GetRoleOptionId(DelinqentOption.Range)); - this.RoleAbilityInit(); if (this.Button?.Behavior is DelinquentAbilityBehavior behavior) { behavior.SetAbilityCount( diff --git a/ExtremeRoles/Roles/Combination/Mover.cs b/ExtremeRoles/Roles/Combination/Mover.cs index 693fff7d6..244ab27e5 100644 --- a/ExtremeRoles/Roles/Combination/Mover.cs +++ b/ExtremeRoles/Roles/Combination/Mover.cs @@ -268,8 +268,6 @@ protected override void CreateSpecificOption( protected override void RoleSpecificInit() { - this.RoleAbilityInit(); - this.roleNamePrefix = this.CreateImpCrewPrefix(); this.hasConsole = new ConsoleData(); diff --git a/ExtremeRoles/Roles/Combination/Traitor.cs b/ExtremeRoles/Roles/Combination/Traitor.cs index 8a9408fb2..c3deeef6e 100644 --- a/ExtremeRoles/Roles/Combination/Traitor.cs +++ b/ExtremeRoles/Roles/Combination/Traitor.cs @@ -374,7 +374,6 @@ protected override void RoleSpecificInit() { this.canUseButton = false; this.nextUseAbilityType = AbilityType.Admin; - this.RoleAbilityInit(); } private void updateAbility() From 658d086e829e43a128df64121c542e482ba87964 Mon Sep 17 00:00:00 2001 From: yukieiji Date: Tue, 13 Feb 2024 21:16:25 +0900 Subject: [PATCH 06/24] refactor:crewmate --- ExtremeRoles/Roles/Solo/Crewmate/Agency.cs | 2 -- ExtremeRoles/Roles/Solo/Crewmate/BodyGuard.cs | 29 +++++++--------- ExtremeRoles/Roles/Solo/Crewmate/Carpenter.cs | 8 ++--- .../Roles/Solo/Crewmate/CurseMaker.cs | 14 ++++---- .../Roles/Solo/Crewmate/Delusioner.cs | 1 - ExtremeRoles/Roles/Solo/Crewmate/Fencer.cs | 2 -- .../Roles/Solo/Crewmate/Maintainer.cs | 4 +-- ExtremeRoles/Roles/Solo/Crewmate/Moderator.cs | 1 - ExtremeRoles/Roles/Solo/Crewmate/Opener.cs | 1 - .../Roles/Solo/Crewmate/Photographer.cs | 3 -- ExtremeRoles/Roles/Solo/Crewmate/Psychic.cs | 14 ++++---- .../Roles/Solo/Crewmate/Supervisor.cs | 7 ++-- .../Roles/Solo/Crewmate/Teleporter.cs | 33 +++++++++---------- .../Roles/Solo/Crewmate/TimeMaster.cs | 2 -- ExtremeRoles/Roles/Solo/Crewmate/Watchdog.cs | 6 ++-- 15 files changed, 49 insertions(+), 78 deletions(-) diff --git a/ExtremeRoles/Roles/Solo/Crewmate/Agency.cs b/ExtremeRoles/Roles/Solo/Crewmate/Agency.cs index 1ac522917..37eee81dd 100644 --- a/ExtremeRoles/Roles/Solo/Crewmate/Agency.cs +++ b/ExtremeRoles/Roles/Solo/Crewmate/Agency.cs @@ -276,8 +276,6 @@ protected override void RoleSpecificInit() this.takeTaskRange = OptionManager.Instance.GetValue( GetRoleOptionId(AgencyOption.TakeTaskRange)); - this.RoleAbilityInit(); - this.TakeTask = new List(); } diff --git a/ExtremeRoles/Roles/Solo/Crewmate/BodyGuard.cs b/ExtremeRoles/Roles/Solo/Crewmate/BodyGuard.cs index 94ff90c64..41664e02c 100644 --- a/ExtremeRoles/Roles/Solo/Crewmate/BodyGuard.cs +++ b/ExtremeRoles/Roles/Solo/Crewmate/BodyGuard.cs @@ -513,13 +513,17 @@ public void CreateAbility() new RoleButtonActivator(), KeyCode.F); - this.RoleAbilityInit(); - if (this.Button.Behavior is BodyGuardAbilityBehavior behavior) - { - behavior.SetAbilityCount( - OptionManager.Instance.GetValue(GetRoleOptionId( - RoleAbilityCommonOption.AbilityCount))); - } + ((IRoleAbility)(this)).RoleAbilityInit(); + + if (this.Button.Behavior is BodyGuardAbilityBehavior behavior) + { + int abilityNum = OptionManager.Instance.GetValue(GetRoleOptionId( + RoleAbilityCommonOption.AbilityCount)); + + this.shildNum = abilityNum; + behavior.SetAbilityCount(abilityNum); + } + this.Button.SetLabelToCrewmate(); } @@ -763,7 +767,6 @@ protected override void CreateSpecificOption( protected override void RoleSpecificInit() { - var allOpt = OptionManager.Instance; IsBlockMeetingKill = allOpt.GetValue( @@ -784,15 +787,5 @@ protected override void RoleSpecificInit() this.awakeMeetingAbility = this.meetingAbilityTaskGage <= 0.0f; this.awakeMeetingReport = this.meetingReportTaskGage <= 0.0f; - - this.RoleAbilityInit(); - if (this.Button?.Behavior is BodyGuardAbilityBehavior behavior) - { - int abilityNum = allOpt.GetValue(GetRoleOptionId( - RoleAbilityCommonOption.AbilityCount)); - - this.shildNum = abilityNum; - behavior.SetAbilityCount(abilityNum); - } } } diff --git a/ExtremeRoles/Roles/Solo/Crewmate/Carpenter.cs b/ExtremeRoles/Roles/Solo/Crewmate/Carpenter.cs index e0b1bec15..fc0487abf 100644 --- a/ExtremeRoles/Roles/Solo/Crewmate/Carpenter.cs +++ b/ExtremeRoles/Roles/Solo/Crewmate/Carpenter.cs @@ -534,8 +534,9 @@ public void CreateAbility() ventRemoveModeCheck: IsVentMode), new RoleButtonActivator(), KeyCode.F); - abilityInit(); - this.Button.SetLabelToCrewmate(); + + this.RoleAbilityInit(); + this.Button.SetLabelToCrewmate(); } public bool UseAbility() @@ -752,7 +753,6 @@ protected override void RoleSpecificInit() this.awakeRole = false; this.HasOtherVision = false; } - abilityInit(); } private void createAbilityOption(IOptionInfo parentOps) @@ -787,7 +787,7 @@ private void createAbilityOption(IOptionInfo parentOps) ).SetOptionUnit(OptionUnit.ScrewNum); } - private void abilityInit() + public void RoleAbilityInit() { if (this.Button == null) { return; } diff --git a/ExtremeRoles/Roles/Solo/Crewmate/CurseMaker.cs b/ExtremeRoles/Roles/Solo/Crewmate/CurseMaker.cs index 502fab6e7..d61f9c38c 100644 --- a/ExtremeRoles/Roles/Solo/Crewmate/CurseMaker.cs +++ b/ExtremeRoles/Roles/Solo/Crewmate/CurseMaker.cs @@ -15,9 +15,9 @@ namespace ExtremeRoles.Roles.Solo.Crewmate; -public sealed class CurseMaker : - SingleRoleBase, - IRoleAbility, +public sealed class CurseMaker : + SingleRoleBase, + IRoleAbility, IRoleMurderPlayerHook, IRoleUpdate { @@ -234,7 +234,7 @@ public void CleanUp() if (killer == target) { this.deadBodyId = byte.MaxValue; - return; + return; } using (var caller = RPCOperator.CreateCaller( @@ -350,8 +350,6 @@ protected override void CreateSpecificOption( protected override void RoleSpecificInit() { - this.RoleAbilityInit(); - var allOption = OptionManager.Instance; this.additionalKillCool = allOption.GetValue( @@ -383,7 +381,7 @@ protected override void RoleSpecificInit() this.deadBodyData = new Dictionary(); this.deadBodyArrow = new Dictionary(); - this.isRemoveDeadBody = + this.isRemoveDeadBody = this.isNotRemoveDeadBodyByTask && this.notRemoveDeadBodyTaskGage == 0.0f ? false : true; this.curCurseTime = allOption.GetValue( @@ -469,7 +467,7 @@ public void Update(PlayerControl rolePlayer) { if (deadBodyInfo.IsValid()) { - if (deadBodyInfo.ComputeDeltaTime() > this.searchDeadBodyTime && + if (deadBodyInfo.ComputeDeltaTime() > this.searchDeadBodyTime && !this.deadBodyArrow.ContainsKey(playerId)) { var arrow = new Arrow(this.NameColor); diff --git a/ExtremeRoles/Roles/Solo/Crewmate/Delusioner.cs b/ExtremeRoles/Roles/Solo/Crewmate/Delusioner.cs index 561d7ed80..d03802af2 100644 --- a/ExtremeRoles/Roles/Solo/Crewmate/Delusioner.cs +++ b/ExtremeRoles/Roles/Solo/Crewmate/Delusioner.cs @@ -366,7 +366,6 @@ protected override void RoleSpecificInit() { this.isOneTimeAwake = false; } - this.RoleAbilityInit(); } } #if DEBUG diff --git a/ExtremeRoles/Roles/Solo/Crewmate/Fencer.cs b/ExtremeRoles/Roles/Solo/Crewmate/Fencer.cs index 4df11494e..69c074504 100644 --- a/ExtremeRoles/Roles/Solo/Crewmate/Fencer.cs +++ b/ExtremeRoles/Roles/Solo/Crewmate/Fencer.cs @@ -205,7 +205,5 @@ protected override void RoleSpecificInit() this.Timer = 0.0f; this.MaxTime = OptionManager.Instance.GetValue( GetRoleOptionId(FencerOption.ResetTime)); - - this.RoleAbilityInit(); } } diff --git a/ExtremeRoles/Roles/Solo/Crewmate/Maintainer.cs b/ExtremeRoles/Roles/Solo/Crewmate/Maintainer.cs index 3091c03a3..0028dd561 100644 --- a/ExtremeRoles/Roles/Solo/Crewmate/Maintainer.cs +++ b/ExtremeRoles/Roles/Solo/Crewmate/Maintainer.cs @@ -105,7 +105,5 @@ protected override void CreateSpecificOption( } protected override void RoleSpecificInit() - { - this.RoleAbilityInit(); - } + { } } diff --git a/ExtremeRoles/Roles/Solo/Crewmate/Moderator.cs b/ExtremeRoles/Roles/Solo/Crewmate/Moderator.cs index d040e53b5..c2409d3b3 100644 --- a/ExtremeRoles/Roles/Solo/Crewmate/Moderator.cs +++ b/ExtremeRoles/Roles/Solo/Crewmate/Moderator.cs @@ -224,7 +224,6 @@ protected override void RoleSpecificInit() this.offset = OptionManager.Instance.GetValue( this.GetRoleOptionId(ModeratorOption.MeetingTimerOffset)); - this.RoleAbilityInit(); ExtremeSystemTypeManager.Instance.TryAdd(ExtremeSystemType.ModdedMeetingTimeSystem, new ModdedMeetingTimeSystem()); } diff --git a/ExtremeRoles/Roles/Solo/Crewmate/Opener.cs b/ExtremeRoles/Roles/Solo/Crewmate/Opener.cs index 8b298a2dc..53b8cc7fd 100644 --- a/ExtremeRoles/Roles/Solo/Crewmate/Opener.cs +++ b/ExtremeRoles/Roles/Solo/Crewmate/Opener.cs @@ -154,7 +154,6 @@ protected override void CreateSpecificOption( protected override void RoleSpecificInit() { - this.RoleAbilityInit(); this.isUpgraded = false; this.range = OptionManager.Instance.GetValue( GetRoleOptionId(OpenerOption.Range)); diff --git a/ExtremeRoles/Roles/Solo/Crewmate/Photographer.cs b/ExtremeRoles/Roles/Solo/Crewmate/Photographer.cs index db97730ee..3eeb921b2 100644 --- a/ExtremeRoles/Roles/Solo/Crewmate/Photographer.cs +++ b/ExtremeRoles/Roles/Solo/Crewmate/Photographer.cs @@ -574,9 +574,6 @@ protected override void RoleSpecificInit() GetRoleOptionId(PhotographerOption.PhotoRange))); this.photoCreater.IsUpgraded = this.upgradePhotoTaskGage <= 0.0f; - - this.RoleAbilityInit(); - } private void sendPhotoInfo() diff --git a/ExtremeRoles/Roles/Solo/Crewmate/Psychic.cs b/ExtremeRoles/Roles/Solo/Crewmate/Psychic.cs index 49d2b5d8e..a393a6f43 100644 --- a/ExtremeRoles/Roles/Solo/Crewmate/Psychic.cs +++ b/ExtremeRoles/Roles/Solo/Crewmate/Psychic.cs @@ -235,7 +235,12 @@ public void CreateAbility() CleanUp, ForceAbilityOff); this.Button.SetLabelToCrewmate(); - } + + if (this.Button?.Behavior is ICountBehavior behavior) + { + this.counters = new List(behavior.AbilityCount); + } + } public void ForceAbilityOff() { @@ -459,13 +464,6 @@ protected override void RoleSpecificInit() this.popUpper = new TextPopUpper( 3, 2.5f, new Vector3(-3.75f, -2.5f, -250.0f), TMPro.TextAlignmentOptions.BottomLeft); - - this.RoleAbilityInit(); - - if (this.Button?.Behavior is ICountBehavior behavior) - { - this.counters = new List(behavior.AbilityCount); - } } private void sendPhotoInfo() diff --git a/ExtremeRoles/Roles/Solo/Crewmate/Supervisor.cs b/ExtremeRoles/Roles/Solo/Crewmate/Supervisor.cs index eb77a5925..2a33f9b9a 100644 --- a/ExtremeRoles/Roles/Solo/Crewmate/Supervisor.cs +++ b/ExtremeRoles/Roles/Solo/Crewmate/Supervisor.cs @@ -70,9 +70,9 @@ public void CreateAbility() public bool IsAbilityUse() { - return + return this.IsCommonUse() && ( - MapBehaviour.Instance == null || + MapBehaviour.Instance == null || !MapBehaviour.Instance.isActiveAndEnabled); } @@ -126,7 +126,7 @@ public void Update(PlayerControl rolePlayer) if (!this.Button.IsAbilityActive()) { this.chargeTime.gameObject.SetActive(false); - return; + return; } this.chargeTime.text = Mathf.CeilToInt(this.Button.Timer).ToString(); @@ -155,6 +155,5 @@ protected override void RoleSpecificInit() GetRoleOptionId(SuperviosrOption.IsBoostTask)); this.taskGage = OptionManager.Instance.GetValue( GetRoleOptionId(SuperviosrOption.TaskGage)) / 100.0f; - this.RoleAbilityInit(); } } diff --git a/ExtremeRoles/Roles/Solo/Crewmate/Teleporter.cs b/ExtremeRoles/Roles/Solo/Crewmate/Teleporter.cs index e57d1af96..545040e29 100644 --- a/ExtremeRoles/Roles/Solo/Crewmate/Teleporter.cs +++ b/ExtremeRoles/Roles/Solo/Crewmate/Teleporter.cs @@ -202,7 +202,21 @@ public static void SetPortal(byte teleporterPlayerId, Vector2 pos) } } - public void IncreaseAbilityCount() + public void RoleAbilityInit() + { + if (this.Button == null) { return; } + + var allOpt = OptionManager.Instance; + this.Button.Behavior.SetCoolTime( + allOpt.GetValue(this.GetRoleOptionId( + RoleAbilityCommonOption.AbilityCoolTime))); + + this.behavior.SetAbilityCount(0); + + this.Button.OnMeetingEnd(); + } + + public void IncreaseAbilityCount() { this.behavior.SetAbilityCount( this.behavior.AbilityCount + 1); @@ -238,7 +252,7 @@ public void CreateAbility() new RoleButtonActivator(), KeyCode.F); this.Button.SetLabelToCrewmate(); - this.abilityInit(); + this.RoleAbilityInit(); } public bool UseAbility() @@ -296,21 +310,6 @@ protected override void RoleSpecificInit() GetRoleOptionId(TeleporterOption.CanUseOtherPlayer)); this.partNum = OptionManager.Instance.GetValue( GetRoleOptionId(RoleAbilityCommonOption.AbilityCount)); - this.abilityInit(); - } - - private void abilityInit() - { - if (this.Button == null) { return; } - - var allOpt = OptionManager.Instance; - this.Button.Behavior.SetCoolTime( - allOpt.GetValue(this.GetRoleOptionId( - RoleAbilityCommonOption.AbilityCoolTime))); - - this.behavior.SetAbilityCount(0); - - this.Button.OnMeetingEnd(); } private static void setPartFromMapJsonInfo(JArray json, int num) diff --git a/ExtremeRoles/Roles/Solo/Crewmate/TimeMaster.cs b/ExtremeRoles/Roles/Solo/Crewmate/TimeMaster.cs index 2c6076add..22d47aac4 100644 --- a/ExtremeRoles/Roles/Solo/Crewmate/TimeMaster.cs +++ b/ExtremeRoles/Roles/Solo/Crewmate/TimeMaster.cs @@ -383,8 +383,6 @@ protected override void CreateSpecificOption( protected override void RoleSpecificInit() { - this.RoleAbilityInit(); - if (history != null || CachedPlayerControl.LocalPlayer == null) { return; } history = CachedPlayerControl.LocalPlayer.PlayerControl.gameObject.AddComponent< diff --git a/ExtremeRoles/Roles/Solo/Crewmate/Watchdog.cs b/ExtremeRoles/Roles/Solo/Crewmate/Watchdog.cs index 563047e71..aeb90e711 100644 --- a/ExtremeRoles/Roles/Solo/Crewmate/Watchdog.cs +++ b/ExtremeRoles/Roles/Solo/Crewmate/Watchdog.cs @@ -128,7 +128,7 @@ public void Update(PlayerControl rolePlayer) if (!this.Button.IsAbilityActive()) { this.chargeTime.gameObject.SetActive(false); - return; + return; } @@ -144,7 +144,5 @@ protected override void CreateSpecificOption( } protected override void RoleSpecificInit() - { - this.RoleAbilityInit(); - } + { } } From 3fa3d9fbcdab30b6c0f10eefb1d7723c71f5c747 Mon Sep 17 00:00:00 2001 From: yukieiji Date: Tue, 13 Feb 2024 21:20:09 +0900 Subject: [PATCH 07/24] refactor:Impostor --- .../Roles/Solo/Impostor/AssaultMaster.cs | 17 ++++++++--------- ExtremeRoles/Roles/Solo/Impostor/Bomber.cs | 3 --- ExtremeRoles/Roles/Solo/Impostor/Carrier.cs | 1 - ExtremeRoles/Roles/Solo/Impostor/Commander.cs | 9 ++++----- ExtremeRoles/Roles/Solo/Impostor/Cracker.cs | 1 - ExtremeRoles/Roles/Solo/Impostor/Crewshroom.cs | 2 -- ExtremeRoles/Roles/Solo/Impostor/Evolver.cs | 8 +++----- ExtremeRoles/Roles/Solo/Impostor/Faker.cs | 1 - ExtremeRoles/Roles/Solo/Impostor/Hypnotist.cs | 2 -- ExtremeRoles/Roles/Solo/Impostor/LastWolf.cs | 6 ++---- ExtremeRoles/Roles/Solo/Impostor/Magician.cs | 2 -- ExtremeRoles/Roles/Solo/Impostor/Mery.cs | 3 --- ExtremeRoles/Roles/Solo/Impostor/OverLoader.cs | 10 ++++------ ExtremeRoles/Roles/Solo/Impostor/Painter.cs | 1 - ExtremeRoles/Roles/Solo/Impostor/SandWorm.cs | 7 ++----- ExtremeRoles/Roles/Solo/Impostor/SlaveDriver.cs | 1 - ExtremeRoles/Roles/Solo/Impostor/Slime.cs | 11 +++++------ ExtremeRoles/Roles/Solo/Impostor/Smasher.cs | 1 - ExtremeRoles/Roles/Solo/Impostor/Terorist.cs | 2 -- ExtremeRoles/Roles/Solo/Impostor/Thief.cs | 2 -- 20 files changed, 28 insertions(+), 62 deletions(-) diff --git a/ExtremeRoles/Roles/Solo/Impostor/AssaultMaster.cs b/ExtremeRoles/Roles/Solo/Impostor/AssaultMaster.cs index aaa3d742f..2a495dca0 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/AssaultMaster.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/AssaultMaster.cs @@ -26,7 +26,7 @@ public enum AssaultMasterOption } public ExtremeAbilityButton Button - { + { get => this.reloadButton; set { @@ -36,14 +36,14 @@ public ExtremeAbilityButton Button private ExtremeAbilityButton reloadButton; private TMPro.TextMeshPro reduceKillCoolText; - + private int stock; private int stockMax; private int addStockWhenReport; private int addStockWhenMeetingButton; private float cockingReduceTime; private float reloadReduceTimePerStock; - + private bool isResetCoolTimeWhenKill; private float defaultReloadCoolTime; @@ -83,7 +83,7 @@ public void HookReportButton( addStock(this.addStockWhenMeetingButton); } - public bool IsAbilityUse() => + public bool IsAbilityUse() => this.IsCommonUse() && this.stock > 0 && PlayerControl.LocalPlayer.killTimer > 0; @@ -150,7 +150,7 @@ public bool UseAbility() } public void Update(PlayerControl rolePlayer) { - if (this.reduceKillCoolText == null && + if (this.reduceKillCoolText == null && this.Button != null) { this.reduceKillCoolText = GameObject.Instantiate( @@ -162,10 +162,10 @@ public void Update(PlayerControl rolePlayer) } if (this.reduceKillCoolText == null) { return; } - + if (this.stock == 0) { - this.reduceKillCoolText.text = + this.reduceKillCoolText.text = Translation.GetString("noStockNow"); } else @@ -192,7 +192,7 @@ public override bool TryRolePlayerKillTo( { this.KillCoolTime = this.defaultKillCool; } - + if (this.isResetCoolTimeWhenKill && this.Button != null) { this.Button.OnMeetingEnd(); @@ -275,7 +275,6 @@ protected override void RoleSpecificInit() { this.defaultKillCool = this.KillCoolTime; } - this.RoleAbilityInit(); } private void addStock(int addNum) diff --git a/ExtremeRoles/Roles/Solo/Impostor/Bomber.cs b/ExtremeRoles/Roles/Solo/Impostor/Bomber.cs index aa57977f6..af6460aa8 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Bomber.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Bomber.cs @@ -130,8 +130,6 @@ protected override void CreateSpecificOption( protected override void RoleSpecificInit() { - this.RoleAbilityInit(); - var allOption = OptionManager.Instance; this.timerMinTime = allOption.GetValue( @@ -147,7 +145,6 @@ protected override void RoleSpecificInit() this.bombPlayerId = new Queue(); resetTimer(); - } public void ResetOnMeetingStart() diff --git a/ExtremeRoles/Roles/Solo/Impostor/Carrier.cs b/ExtremeRoles/Roles/Solo/Impostor/Carrier.cs index 990cf2061..572fb2b84 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Carrier.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Carrier.cs @@ -224,7 +224,6 @@ protected override void RoleSpecificInit() GetRoleOptionId(CarrierOption.CarryDistance)); this.canReportOnCarry = OptionManager.Instance.GetValue( GetRoleOptionId(CarrierOption.CanReportOnCarry)); - this.RoleAbilityInit(); } public void AllReset(PlayerControl rolePlayer) diff --git a/ExtremeRoles/Roles/Solo/Impostor/Commander.cs b/ExtremeRoles/Roles/Solo/Impostor/Commander.cs index 122a45ca1..3c4a5f51b 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Commander.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Commander.cs @@ -15,7 +15,7 @@ namespace ExtremeRoles.Roles.Solo.Impostor; public sealed class Commander : SingleRoleBase, IRoleAbility { public ExtremeAbilityButton Button - { + { get => this.commandAttackButton; set { @@ -70,8 +70,8 @@ public static void AttackCommad(byte rolePlayerId) float killCool = CachedPlayerControl.LocalPlayer.PlayerControl.killTimer; if (killCool > 0.1f) { - float newKillCool = killCool - - commander.killCoolReduceTime - + float newKillCool = killCool - + commander.killCoolReduceTime - (commander.killCoolImpNumBonus * deadImpNum); CachedPlayerControl.LocalPlayer.PlayerControl.killTimer = Mathf.Clamp( @@ -119,7 +119,7 @@ public override bool TryRolePlayerKillTo( { ++this.killCount; this.killCount = this.killCount % this.increaseKillNum; - if (this.killCount == 0 && + if (this.killCount == 0 && this.Button.Behavior is AbilityCountBehavior countBehavior) { countBehavior.SetAbilityCount(countBehavior.AbilityCount + 1); @@ -156,6 +156,5 @@ protected override void RoleSpecificInit() GetRoleOptionId(CommanderOption.IncreaseKillNum)); this.killCount = 0; - this.RoleAbilityInit(); } } diff --git a/ExtremeRoles/Roles/Solo/Impostor/Cracker.cs b/ExtremeRoles/Roles/Solo/Impostor/Cracker.cs index c302f0939..66a06d95c 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Cracker.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Cracker.cs @@ -166,6 +166,5 @@ protected override void RoleSpecificInit() GetRoleOptionId(CrackerOption.CanCrackDistance)); this.IsRemoveDeadBody = OptionManager.Instance.GetValue( GetRoleOptionId(CrackerOption.RemoveDeadBody)); - this.RoleAbilityInit(); } } diff --git a/ExtremeRoles/Roles/Solo/Impostor/Crewshroom.cs b/ExtremeRoles/Roles/Solo/Impostor/Crewshroom.cs index 5ba539028..7e631ce1f 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Crewshroom.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Crewshroom.cs @@ -79,8 +79,6 @@ protected override void CreateSpecificOption( protected override void RoleSpecificInit() { - this.RoleAbilityInit(); - ExtremeSystemTypeManager.Instance.TryAdd( ModedMushroomSystem.Type, new ModedMushroomSystem( diff --git a/ExtremeRoles/Roles/Solo/Impostor/Evolver.cs b/ExtremeRoles/Roles/Solo/Impostor/Evolver.cs index 61a6a81b4..fae2d8ca2 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Evolver.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Evolver.cs @@ -104,7 +104,7 @@ public void CleanUp() this.KillCoolTime = this.KillCoolTime * ((100f - this.reduceRate) / 100f); this.reduceRate = this.reduceRate * this.reruceMulti; - + this.CanKill = true; this.KillCoolTime = Mathf.Clamp( this.KillCoolTime, 0.1f, this.defaultKillCoolTime); @@ -131,7 +131,7 @@ public bool CheckAbility() { result = this.eatingBodyId == this.targetBody.PlayerId; } - + this.Button.Behavior.SetButtonText( result ? this.eatingText : this.defaultButtonText); @@ -176,8 +176,6 @@ protected override void CreateSpecificOption( protected override void RoleSpecificInit() { - this.RoleAbilityInit(); - if(!this.HasOtherKillCool) { this.HasOtherKillCool = true; @@ -186,7 +184,7 @@ protected override void RoleSpecificInit() } this.defaultKillCoolTime = this.KillCoolTime; - + var allOption = OptionManager.Instance; this.isEvolvdAnimation = allOption.GetValue( diff --git a/ExtremeRoles/Roles/Solo/Impostor/Faker.cs b/ExtremeRoles/Roles/Solo/Impostor/Faker.cs index 8c9053d84..c6f826408 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Faker.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Faker.cs @@ -134,7 +134,6 @@ protected override void CreateSpecificOption( protected override void RoleSpecificInit() { - this.RoleAbilityInit(); ExtremeSystemTypeManager.Instance.TryAdd(ExtremeSystemType.FakerDummy, new FakerDummySystem()); } } diff --git a/ExtremeRoles/Roles/Solo/Impostor/Hypnotist.cs b/ExtremeRoles/Roles/Solo/Impostor/Hypnotist.cs index a0d03885a..e4f08b9f2 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Hypnotist.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Hypnotist.cs @@ -617,8 +617,6 @@ protected override void CreateSpecificOption( protected override void RoleSpecificInit() { - this.RoleAbilityInit(); - var curOption = GameOptionsManager.Instance.CurrentGameOptions; this.defaultKillCool = curOption.GetFloat(FloatOptionNames.KillCooldown); diff --git a/ExtremeRoles/Roles/Solo/Impostor/LastWolf.cs b/ExtremeRoles/Roles/Solo/Impostor/LastWolf.cs index a660beed6..178158695 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/LastWolf.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/LastWolf.cs @@ -104,7 +104,7 @@ public void ResetOnMeetingStart() if (this.isAwake) { this.HasOtherKillCool = true; - float reduceRate = this.noneAwakeKillBonus * this.noneAwakeKillCount + + float reduceRate = this.noneAwakeKillBonus * this.noneAwakeKillCount + this.deadPlayerKillBonus * (float)( GameData.Instance.AllPlayers.Count - computeAlivePlayerNum() - this.noneAwakeKillCount); this.KillCoolTime = this.KillCoolTime * (100.0f - reduceRate) / 100.0f; @@ -151,7 +151,7 @@ public void Update(PlayerControl rolePlayer) foreach (var player in GameData.Instance.AllPlayers.GetFastEnumerator()) { - if (ExtremeRoleManager.GameRole[player.PlayerId].IsImpostor() && + if (ExtremeRoleManager.GameRole[player.PlayerId].IsImpostor() && (!player.IsDead && !player.Disconnected)) { ++impNum; @@ -290,8 +290,6 @@ protected override void CreateSpecificOption( protected override void RoleSpecificInit() { - this.RoleAbilityInit(); - var allOpt = OptionManager.Instance; this.awakeImpNum = allOpt.GetValue( diff --git a/ExtremeRoles/Roles/Solo/Impostor/Magician.cs b/ExtremeRoles/Roles/Solo/Impostor/Magician.cs index 9579651e6..bafb375dc 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Magician.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Magician.cs @@ -168,7 +168,5 @@ protected override void RoleSpecificInit() GetRoleOptionId(MagicianOption.IncludeSpawnPoint)); this.includeSpawnPoint = allOption.GetValue( GetRoleOptionId(MagicianOption.IncludeRolePlayer)); - - this.RoleAbilityInit(); } } diff --git a/ExtremeRoles/Roles/Solo/Impostor/Mery.cs b/ExtremeRoles/Roles/Solo/Impostor/Mery.cs index d6bcba8f2..6643ed093 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Mery.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Mery.cs @@ -331,9 +331,6 @@ protected override void CreateSpecificOption( protected override void RoleSpecificInit() { - - this.RoleAbilityInit(); - var allOption = OptionManager.Instance; this.ActiveNum = allOption.GetValue( diff --git a/ExtremeRoles/Roles/Solo/Impostor/OverLoader.cs b/ExtremeRoles/Roles/Solo/Impostor/OverLoader.cs index 7cfea948a..69c34ad33 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/OverLoader.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/OverLoader.cs @@ -73,7 +73,7 @@ public OverLoader() : base( { this.IsOverLoad = false; } - + public static void SwitchAbility(byte rolePlayerId, bool activate) { var overLoader = ExtremeRoleManager.GetSafeCastedRole(rolePlayerId); @@ -95,7 +95,7 @@ public void CreateAbility() this.CleanUp); } - public bool IsAbilityUse() => + public bool IsAbilityUse() => this.IsAwake && this.IsCommonUse(); public void ResetOnMeetingEnd(GameData.PlayerInfo exiledPlayer = null) @@ -145,7 +145,7 @@ public void Update(PlayerControl rolePlayer) } } - if (this.awakeImpNum >= impNum && + if (this.awakeImpNum >= impNum && this.killCount >= this.awakeKillCount) { this.Button.SetButtonShow(true); @@ -325,7 +325,7 @@ protected override void RoleSpecificInit() this.isAwakedHasOtherKillRange = true; } - if (this.awakeImpNum >= curOption.GetInt(Int32OptionNames.NumImpostors) && + if (this.awakeImpNum >= curOption.GetInt(Int32OptionNames.NumImpostors) && this.awakeKillCount == 0) { this.isAwake = true; @@ -333,8 +333,6 @@ protected override void RoleSpecificInit() this.HasOtherKillCool = this.isAwakedHasOtherKillCool; this.HasOtherKillRange = this.isAwakedHasOtherKillRange; } - - this.RoleAbilityInit(); } private void abilityOn() diff --git a/ExtremeRoles/Roles/Solo/Impostor/Painter.cs b/ExtremeRoles/Roles/Solo/Impostor/Painter.cs index 291d619ad..7a0d85e04 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Painter.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Painter.cs @@ -150,6 +150,5 @@ protected override void RoleSpecificInit() { this.paintDistance = OptionManager.Instance.GetValue( GetRoleOptionId(PainterOption.CanPaintDistance)); - this.RoleAbilityInit(); } } diff --git a/ExtremeRoles/Roles/Solo/Impostor/SandWorm.cs b/ExtremeRoles/Roles/Solo/Impostor/SandWorm.cs index 51ca4f93d..2956d6fc9 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/SandWorm.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/SandWorm.cs @@ -164,9 +164,8 @@ public void CreateAbility() IsAbilityUse, UseAbility), new AssaultButtonAutoActivator(), KeyCode.F); - - this.RoleAbilityInit(); - } + ((IRoleAbility)(this)).RoleAbilityInit(); + } public bool IsAbilityUse() { @@ -261,8 +260,6 @@ protected override void RoleSpecificInit() this.KillCoolTime = GameOptionsManager.Instance.CurrentGameOptions.GetFloat( FloatOptionNames.KillCooldown); } - - this.RoleAbilityInit(); } private static bool isVentIn() diff --git a/ExtremeRoles/Roles/Solo/Impostor/SlaveDriver.cs b/ExtremeRoles/Roles/Solo/Impostor/SlaveDriver.cs index dc0f27d99..29858c0cb 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/SlaveDriver.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/SlaveDriver.cs @@ -88,7 +88,6 @@ protected override void RoleSpecificInit() GetRoleOptionId(SlaveDriverOption.RevartTaskNum)); this.range = OptionManager.Instance.GetValue( GetRoleOptionId(SlaveDriverOption.Range)); - this.RoleAbilityInit(); } public void ResetOnMeetingEnd(GameData.PlayerInfo exiledPlayer = null) diff --git a/ExtremeRoles/Roles/Solo/Impostor/Slime.cs b/ExtremeRoles/Roles/Solo/Impostor/Slime.cs index 953ce8ca5..d23c4cf74 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Slime.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Slime.cs @@ -11,7 +11,7 @@ namespace ExtremeRoles.Roles.Solo.Impostor; -public sealed class Slime : +public sealed class Slime : SingleRoleBase, IRoleAbility, IRoleSpecialReset, @@ -62,7 +62,7 @@ public static void Ability(ref MessageReader reader) private static void setPlayerSpriteToConsole(Slime slime, PlayerControl player, int index) { Console console = CachedShipStatus.Instance.AllConsoles[index]; - + if (console == null || console.Image == null) { return; } slime.consoleObj = new GameObject("MorphConsole"); @@ -112,13 +112,13 @@ public void CreateAbility() abilityOff: this.CleanUp); } - public bool IsAbilityActive() => + public bool IsAbilityActive() => CachedPlayerControl.LocalPlayer.PlayerControl.moveable || this.isKilling; public bool IsAbilityUse() { PlayerControl localPlayer = CachedPlayerControl.LocalPlayer; - + this.targetConsole = Player.GetClosestConsole( localPlayer, localPlayer.MaxReportDistance); @@ -157,7 +157,7 @@ public bool UseAbility() } setPlayerSpriteToConsole(this, player, i); - + return true; } return false; @@ -191,7 +191,6 @@ protected override void CreateSpecificOption( protected override void RoleSpecificInit() { - this.RoleAbilityInit(); this.isKilling = false; } diff --git a/ExtremeRoles/Roles/Solo/Impostor/Smasher.cs b/ExtremeRoles/Roles/Solo/Impostor/Smasher.cs index c91ec574b..965336dfb 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Smasher.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Smasher.cs @@ -146,7 +146,6 @@ protected override void CreateSpecificOption( protected override void RoleSpecificInit() { - this.RoleAbilityInit(); this.penaltyKillCool = OptionManager.Instance.GetValue( GetRoleOptionId(SmasherOption.SmashPenaltyKillCool)); } diff --git a/ExtremeRoles/Roles/Solo/Impostor/Terorist.cs b/ExtremeRoles/Roles/Solo/Impostor/Terorist.cs index 15f5d11d8..b99153877 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Terorist.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Terorist.cs @@ -95,8 +95,6 @@ protected override void CreateSpecificOption( protected override void RoleSpecificInit() { - this.RoleAbilityInit(); - if (CachedShipStatus.Systems.TryGetValue(SystemTypes.Sabotage, out var system) && system.IsTryCast(out var saboSystem)) { diff --git a/ExtremeRoles/Roles/Solo/Impostor/Thief.cs b/ExtremeRoles/Roles/Solo/Impostor/Thief.cs index 67d036644..cbe2618cd 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Thief.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Thief.cs @@ -142,8 +142,6 @@ protected override void CreateSpecificOption( protected override void RoleSpecificInit() { - this.RoleAbilityInit(); - var allOption = OptionManager.Instance; this.activeRange = allOption.GetValue(GetRoleOptionId(ThiefOption.Range)); From 3d3af509f37c48f8ffbfadae68284cc4688673f6 Mon Sep 17 00:00:00 2001 From: yukieiji Date: Tue, 13 Feb 2024 21:21:15 +0900 Subject: [PATCH 08/24] refactor:Neutral --- ExtremeRoles/Roles/Solo/Neutral/Alice.cs | 8 +++----- ExtremeRoles/Roles/Solo/Neutral/Eater.cs | 2 -- ExtremeRoles/Roles/Solo/Neutral/Hatter.cs | 2 -- ExtremeRoles/Roles/Solo/Neutral/Jackal.cs | 10 ++++------ ExtremeRoles/Roles/Solo/Neutral/Jester.cs | 5 ++--- ExtremeRoles/Roles/Solo/Neutral/Madmate.cs | 2 -- ExtremeRoles/Roles/Solo/Neutral/Missionary.cs | 2 -- ExtremeRoles/Roles/Solo/Neutral/Umbrer.cs | 2 -- 8 files changed, 9 insertions(+), 24 deletions(-) diff --git a/ExtremeRoles/Roles/Solo/Neutral/Alice.cs b/ExtremeRoles/Roles/Solo/Neutral/Alice.cs index cd5d36c9e..c0984a072 100644 --- a/ExtremeRoles/Roles/Solo/Neutral/Alice.cs +++ b/ExtremeRoles/Roles/Solo/Neutral/Alice.cs @@ -23,7 +23,7 @@ public enum AliceOption } public ExtremeAbilityButton Button - { + { get => this.aliceShipBroken; set { @@ -52,7 +52,7 @@ public void CreateAbility() Path.AliceShipBroken)); } - public override bool IsSameTeam(SingleRoleBase targetRole) => + public override bool IsSameTeam(SingleRoleBase targetRole) => this.IsNeutralSameTeam(targetRole); public bool IsAbilityUse() @@ -125,7 +125,7 @@ public static void ShipBroken( if (alice == null) { return; } var player = Helper.Player.GetPlayerControlById(targetPlayerId); if (player == null) { return; } - + for (int i = 0; i < player.Data.Tasks.Count; ++i) { if (addTaskId.Count == 0) { break; } @@ -181,8 +181,6 @@ protected override void RoleSpecificInit() GetRoleOptionId(AliceOption.RevartLongTaskNum)); this.RevartCommonTask = allOption.GetValue( GetRoleOptionId(AliceOption.RevartCommonTaskNum)); - - this.RoleAbilityInit(); } public void ResetOnMeetingStart() diff --git a/ExtremeRoles/Roles/Solo/Neutral/Eater.cs b/ExtremeRoles/Roles/Solo/Neutral/Eater.cs index 7a61f3b17..5ba86e84e 100644 --- a/ExtremeRoles/Roles/Solo/Neutral/Eater.cs +++ b/ExtremeRoles/Roles/Solo/Neutral/Eater.cs @@ -343,8 +343,6 @@ protected override void RoleSpecificInit() this.deadBodyArrow = new Dictionary(); this.isActivated = false; - this.RoleAbilityInit(); - if (this.Button?.Behavior is AbilityCountBehavior behaviour) { int abilityNum = allOpt.GetValue(GetRoleOptionId( diff --git a/ExtremeRoles/Roles/Solo/Neutral/Hatter.cs b/ExtremeRoles/Roles/Solo/Neutral/Hatter.cs index eda5c0181..1f7749cbf 100644 --- a/ExtremeRoles/Roles/Solo/Neutral/Hatter.cs +++ b/ExtremeRoles/Roles/Solo/Neutral/Hatter.cs @@ -192,8 +192,6 @@ protected override void RoleSpecificInit() this.curSkipCount = 0; this.isAssassinMeeting = false; this.IsWin = false; - - this.RoleAbilityInit(); } public void ResetOnMeetingStart() diff --git a/ExtremeRoles/Roles/Solo/Neutral/Jackal.cs b/ExtremeRoles/Roles/Solo/Neutral/Jackal.cs index 9ba15bfe1..07c2bb015 100644 --- a/ExtremeRoles/Roles/Solo/Neutral/Jackal.cs +++ b/ExtremeRoles/Roles/Solo/Neutral/Jackal.cs @@ -321,7 +321,7 @@ public override Color GetTargetRoleSeeColor( { return ColorPalette.JackalBlue; } - + return base.GetTargetRoleSeeColor(targetRole, targetPlayerId); } @@ -376,7 +376,7 @@ public override void RolePlayerKilledAction( public bool IsAbilityUse() { - + this.Target = Player.GetClosestPlayerInRange( CachedPlayerControl.LocalPlayer, this, GameOptionsData.KillDistances[ @@ -392,7 +392,7 @@ public bool UseAbility() if (!isLoverAndSetTarget(targetPlayerId)) { return false; } PlayerControl rolePlayer = CachedPlayerControl.LocalPlayer; - + using (var caller = RPCOperator.CreateCaller( RPCOperator.Command.ReplaceRole)) { @@ -487,8 +487,6 @@ protected override void RoleSpecificInit() GetRoleOptionId(JackalOption.UpgradeSidekickNum)); this.SidekickOption.ApplyOption(); - - this.RoleAbilityInit(); } private void createJackalOption(IOptionInfo parentOps) @@ -629,7 +627,7 @@ public override Color GetTargetRoleSeeColor( SingleRoleBase targetRole, byte targetPlayerId) { - + if (targetPlayerId == this.jackalPlayerId) { return ColorPalette.JackalBlue; diff --git a/ExtremeRoles/Roles/Solo/Neutral/Jester.cs b/ExtremeRoles/Roles/Solo/Neutral/Jester.cs index f68dbe397..d05ed3ec9 100644 --- a/ExtremeRoles/Roles/Solo/Neutral/Jester.cs +++ b/ExtremeRoles/Roles/Solo/Neutral/Jester.cs @@ -18,7 +18,7 @@ public enum JesterOption } public ExtremeAbilityButton Button - { + { get => this.outburstButton; set { @@ -146,7 +146,7 @@ public void CleanUp() if (killTarget == null) { return; } if (killTarget.Data.IsDead || killTarget.Data.Disconnected) { return; } if (killTarget.PlayerId == CachedPlayerControl.LocalPlayer.PlayerId) { return; } - + using (var caller = RPCOperator.CreateCaller( RPCOperator.Command.JesterOutburstKill)) { @@ -178,7 +178,6 @@ protected override void RoleSpecificInit() GetRoleOptionId(JesterOption.UseSabotage)); this.outburstDistance = OptionManager.Instance.GetValue( GetRoleOptionId(JesterOption.OutburstDistance)); - this.RoleAbilityInit(); } public void ResetOnMeetingStart() diff --git a/ExtremeRoles/Roles/Solo/Neutral/Madmate.cs b/ExtremeRoles/Roles/Solo/Neutral/Madmate.cs index 9b04fa5c6..ef69bbb3f 100644 --- a/ExtremeRoles/Roles/Solo/Neutral/Madmate.cs +++ b/ExtremeRoles/Roles/Solo/Neutral/Madmate.cs @@ -242,7 +242,5 @@ protected override void RoleSpecificInit() this.seeFromImpostorTaskGage <= 0.0f; this.FakeImposter = this.isUpdateMadmate; - - this.RoleAbilityInit(); } } diff --git a/ExtremeRoles/Roles/Solo/Neutral/Missionary.cs b/ExtremeRoles/Roles/Solo/Neutral/Missionary.cs index 10bee8838..a57cfcde2 100644 --- a/ExtremeRoles/Roles/Solo/Neutral/Missionary.cs +++ b/ExtremeRoles/Roles/Solo/Neutral/Missionary.cs @@ -132,8 +132,6 @@ protected override void RoleSpecificInit() this.judgementTarget = new HashSet(); resetTimer(); - this.RoleAbilityInit(); - } public void CreateAbility() diff --git a/ExtremeRoles/Roles/Solo/Neutral/Umbrer.cs b/ExtremeRoles/Roles/Solo/Neutral/Umbrer.cs index 376f6a072..e52c2ddca 100644 --- a/ExtremeRoles/Roles/Solo/Neutral/Umbrer.cs +++ b/ExtremeRoles/Roles/Solo/Neutral/Umbrer.cs @@ -373,8 +373,6 @@ protected override void RoleSpecificInit() this.maxTimer = allOpt.GetValue(GetRoleOptionId(UmbrerOption.KeepUpgradedVirus)); this.isFetch = false; - - this.RoleAbilityInit(); } private bool isInfectOtherPlayer(PlayerControl sourcePlayer) { From 333a075f7ba43aec9291e61e27bc839317fc66cb Mon Sep 17 00:00:00 2001 From: yukieiji Date: Tue, 13 Feb 2024 21:23:12 +0900 Subject: [PATCH 09/24] feat:comments --- ExtremeRoles/Roles/API/RoleSetting.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/ExtremeRoles/Roles/API/RoleSetting.cs b/ExtremeRoles/Roles/API/RoleSetting.cs index 47feeb30b..58526d09c 100644 --- a/ExtremeRoles/Roles/API/RoleSetting.cs +++ b/ExtremeRoles/Roles/API/RoleSetting.cs @@ -50,6 +50,7 @@ public void Initialize() CommonInit(); RoleSpecificInit(); + //TODO : 消して動くかチェック if (this is IRoleAbility ability) { ability.RoleAbilityInit(); From 495d5052b0286ecede56a82496a86580b2e6503d Mon Sep 17 00:00:00 2001 From: yukieiji Date: Tue, 13 Feb 2024 21:26:48 +0900 Subject: [PATCH 10/24] refactor:IsCommonUse --- .../Roles/API/Interface/IRoleAbility.cs | 30 +++++++++---------- ExtremeRoles/Roles/Combination/Accelerator.cs | 2 +- .../Roles/Combination/DetectiveOffice.cs | 2 +- .../Roles/Combination/HeroAcademia.cs | 6 ++-- ExtremeRoles/Roles/Combination/Kids.cs | 2 +- ExtremeRoles/Roles/Combination/Mover.cs | 2 +- ExtremeRoles/Roles/Combination/Traitor.cs | 4 +-- ExtremeRoles/Roles/Solo/Crewmate/Agency.cs | 2 +- ExtremeRoles/Roles/Solo/Crewmate/BodyGuard.cs | 2 +- ExtremeRoles/Roles/Solo/Crewmate/Carpenter.cs | 2 +- .../Roles/Solo/Crewmate/CurseMaker.cs | 2 +- .../Roles/Solo/Crewmate/Delusioner.cs | 2 +- ExtremeRoles/Roles/Solo/Crewmate/Fencer.cs | 2 +- .../Roles/Solo/Crewmate/Maintainer.cs | 2 +- ExtremeRoles/Roles/Solo/Crewmate/Moderator.cs | 2 +- ExtremeRoles/Roles/Solo/Crewmate/Opener.cs | 2 +- .../Roles/Solo/Crewmate/Photographer.cs | 2 +- ExtremeRoles/Roles/Solo/Crewmate/Psychic.cs | 4 +-- .../Roles/Solo/Crewmate/Supervisor.cs | 2 +- .../Roles/Solo/Crewmate/Teleporter.cs | 2 +- .../Roles/Solo/Crewmate/TimeMaster.cs | 2 +- ExtremeRoles/Roles/Solo/Crewmate/Watchdog.cs | 2 +- .../Roles/Solo/Impostor/AssaultMaster.cs | 2 +- ExtremeRoles/Roles/Solo/Impostor/Bomber.cs | 2 +- ExtremeRoles/Roles/Solo/Impostor/Carrier.cs | 2 +- ExtremeRoles/Roles/Solo/Impostor/Commander.cs | 2 +- ExtremeRoles/Roles/Solo/Impostor/Cracker.cs | 2 +- .../Roles/Solo/Impostor/Crewshroom.cs | 2 +- ExtremeRoles/Roles/Solo/Impostor/Evolver.cs | 2 +- ExtremeRoles/Roles/Solo/Impostor/Faker.cs | 2 +- ExtremeRoles/Roles/Solo/Impostor/Hypnotist.cs | 6 ++-- ExtremeRoles/Roles/Solo/Impostor/LastWolf.cs | 2 +- ExtremeRoles/Roles/Solo/Impostor/Magician.cs | 2 +- ExtremeRoles/Roles/Solo/Impostor/Mery.cs | 2 +- .../Roles/Solo/Impostor/OverLoader.cs | 2 +- ExtremeRoles/Roles/Solo/Impostor/Painter.cs | 2 +- .../Roles/Solo/Impostor/SlaveDriver.cs | 2 +- ExtremeRoles/Roles/Solo/Impostor/Slime.cs | 2 +- ExtremeRoles/Roles/Solo/Impostor/Smasher.cs | 2 +- ExtremeRoles/Roles/Solo/Impostor/Terorist.cs | 2 +- ExtremeRoles/Roles/Solo/Impostor/Thief.cs | 2 +- ExtremeRoles/Roles/Solo/Impostor/Zombie.cs | 2 +- ExtremeRoles/Roles/Solo/Neutral/Alice.cs | 2 +- ExtremeRoles/Roles/Solo/Neutral/Eater.cs | 2 +- ExtremeRoles/Roles/Solo/Neutral/Hatter.cs | 2 +- ExtremeRoles/Roles/Solo/Neutral/Jackal.cs | 2 +- ExtremeRoles/Roles/Solo/Neutral/Jester.cs | 2 +- ExtremeRoles/Roles/Solo/Neutral/Madmate.cs | 2 +- ExtremeRoles/Roles/Solo/Neutral/Miner.cs | 2 +- ExtremeRoles/Roles/Solo/Neutral/Missionary.cs | 2 +- ExtremeRoles/Roles/Solo/Neutral/Queen.cs | 4 +-- ExtremeRoles/Roles/Solo/Neutral/TotoCalcio.cs | 2 +- ExtremeRoles/Roles/Solo/Neutral/Umbrer.cs | 2 +- 53 files changed, 74 insertions(+), 74 deletions(-) diff --git a/ExtremeRoles/Roles/API/Interface/IRoleAbility.cs b/ExtremeRoles/Roles/API/Interface/IRoleAbility.cs index 6e17607ea..3abc6f4fe 100644 --- a/ExtremeRoles/Roles/API/Interface/IRoleAbility.cs +++ b/ExtremeRoles/Roles/API/Interface/IRoleAbility.cs @@ -23,7 +23,7 @@ public ExtremeAbilityButton Button set; } - public void CreateAbility(); + public void CreateAbility(); public bool UseAbility(); @@ -54,6 +54,20 @@ public void RoleAbilityInit() this.Button.OnMeetingEnd(); } + + protected static bool IsCommonUse() + { + PlayerControl localPlayer = CachedPlayerControl.LocalPlayer; + + return + localPlayer != null && + localPlayer.Data != null && + !localPlayer.Data.IsDead && + localPlayer.CanMove && + MeetingHud.Instance == null && + ExileController.Instance == null && + IntroCutscene.Instance == null; + } } public static class IRoleAbilityMixin @@ -266,18 +280,4 @@ public static void CreateAbilityCountOption( public static int GetRoleOptionId( this IRoleAbility self, RoleAbilityCommonOption option) => ((RoleOptionBase)self).GetRoleOptionId((int)option); - - public static bool IsCommonUse(this IRoleAbility _) - { - PlayerControl localPlayer = CachedPlayerControl.LocalPlayer; - - return - localPlayer != null && - localPlayer.Data != null && - !localPlayer.Data.IsDead && - localPlayer.CanMove && - MeetingHud.Instance == null && - ExileController.Instance == null && - IntroCutscene.Instance == null; - } } diff --git a/ExtremeRoles/Roles/Combination/Accelerator.cs b/ExtremeRoles/Roles/Combination/Accelerator.cs index e3fc0d08e..c5c95ca33 100644 --- a/ExtremeRoles/Roles/Combination/Accelerator.cs +++ b/ExtremeRoles/Roles/Combination/Accelerator.cs @@ -148,7 +148,7 @@ public void CreateAbility() public bool IsAbilityActive() => CachedPlayerControl.LocalPlayer.PlayerControl.moveable; - public bool IsAbilityUse() => this.IsCommonUse(); + public bool IsAbilityUse() => IRoleAbility.IsCommonUse(); public void ResetOnMeetingEnd(GameData.PlayerInfo? exiledPlayer = null) { diff --git a/ExtremeRoles/Roles/Combination/DetectiveOffice.cs b/ExtremeRoles/Roles/Combination/DetectiveOffice.cs index ea60a98aa..47f49a475 100644 --- a/ExtremeRoles/Roles/Combination/DetectiveOffice.cs +++ b/ExtremeRoles/Roles/Combination/DetectiveOffice.cs @@ -763,7 +763,7 @@ public void CreateAbility() } public bool IsAbilityUse() => - this.IsCommonUse() && Minigame.Instance == null; + IRoleAbility.IsCommonUse() && Minigame.Instance == null; public bool IsOpen() => Minigame.Instance != null; diff --git a/ExtremeRoles/Roles/Combination/HeroAcademia.cs b/ExtremeRoles/Roles/Combination/HeroAcademia.cs index 4238f84c7..f70e08e5f 100644 --- a/ExtremeRoles/Roles/Combination/HeroAcademia.cs +++ b/ExtremeRoles/Roles/Combination/HeroAcademia.cs @@ -469,7 +469,7 @@ public void CreateAbility() public bool IsAbilityUse() => this.cond == OneForAllCondition.FeatButtonAbility && - this.IsCommonUse(); + IRoleAbility.IsCommonUse(); public void ResetOnMeetingEnd(GameData.PlayerInfo? exiledPlayer = null) { @@ -723,7 +723,7 @@ public void CreateAbility() abilityOff: CleanUp); } - public bool IsAbilityUse() => this.IsCommonUse(); + public bool IsAbilityUse() => IRoleAbility.IsCommonUse(); public void ResetOnMeetingEnd(GameData.PlayerInfo? exiledPlayer = null) { @@ -925,7 +925,7 @@ public bool IsAbilityUse() this.target = player.PlayerId; - return this.IsCommonUse() && this.target != byte.MaxValue; + return IRoleAbility.IsCommonUse() && this.target != byte.MaxValue; } public void CleanUp() { diff --git a/ExtremeRoles/Roles/Combination/Kids.cs b/ExtremeRoles/Roles/Combination/Kids.cs index 2402483e9..72eb9100e 100644 --- a/ExtremeRoles/Roles/Combination/Kids.cs +++ b/ExtremeRoles/Roles/Combination/Kids.cs @@ -307,7 +307,7 @@ public bool IsAbilityUse() return this.curAbilityType switch { AbilityType.Scribe => - this.IsCommonUse(), + IRoleAbility.IsCommonUse(), AbilityType.SelfBomb => Player.GetClosestPlayerInRange( CachedPlayerControl.LocalPlayer, this, this.range) != null, diff --git a/ExtremeRoles/Roles/Combination/Mover.cs b/ExtremeRoles/Roles/Combination/Mover.cs index 244ab27e5..baf6dd40b 100644 --- a/ExtremeRoles/Roles/Combination/Mover.cs +++ b/ExtremeRoles/Roles/Combination/Mover.cs @@ -194,7 +194,7 @@ public bool IsAbilityUse() if (this.targetConsole == null) { return false; } return - this.IsCommonUse() && + IRoleAbility.IsCommonUse() && this.targetConsole.Image != null && GameSystem.IsValidConsole(localPlayer, this.targetConsole); } diff --git a/ExtremeRoles/Roles/Combination/Traitor.cs b/ExtremeRoles/Roles/Combination/Traitor.cs index c3deeef6e..8368266f5 100644 --- a/ExtremeRoles/Roles/Combination/Traitor.cs +++ b/ExtremeRoles/Roles/Combination/Traitor.cs @@ -209,14 +209,14 @@ public bool IsAbilityUse() { case AbilityType.Admin: return - this.IsCommonUse() && + IRoleAbility.IsCommonUse() && ( MapBehaviour.Instance == null || !MapBehaviour.Instance.isActiveAndEnabled ); case AbilityType.Security: case AbilityType.Vital: - return this.IsCommonUse() && Minigame.Instance == null; + return IRoleAbility.IsCommonUse() && Minigame.Instance == null; default: return false; } diff --git a/ExtremeRoles/Roles/Solo/Crewmate/Agency.cs b/ExtremeRoles/Roles/Solo/Crewmate/Agency.cs index 37eee81dd..aafe7bf15 100644 --- a/ExtremeRoles/Roles/Solo/Crewmate/Agency.cs +++ b/ExtremeRoles/Roles/Solo/Crewmate/Agency.cs @@ -194,7 +194,7 @@ public bool IsAbilityUse() this.TargetPlayer = target.PlayerId; } - return this.IsCommonUse() && this.TargetPlayer != byte.MaxValue; + return IRoleAbility.IsCommonUse() && this.TargetPlayer != byte.MaxValue; } public void ResetOnMeetingStart() diff --git a/ExtremeRoles/Roles/Solo/Crewmate/BodyGuard.cs b/ExtremeRoles/Roles/Solo/Crewmate/BodyGuard.cs index 41664e02c..f017be706 100644 --- a/ExtremeRoles/Roles/Solo/Crewmate/BodyGuard.cs +++ b/ExtremeRoles/Roles/Solo/Crewmate/BodyGuard.cs @@ -595,7 +595,7 @@ public bool IsAbilityUse() } } - return this.IsCommonUse() && this.targetPlayer != byte.MaxValue; + return IRoleAbility.IsCommonUse() && this.targetPlayer != byte.MaxValue; } public void ResetOnMeetingStart() diff --git a/ExtremeRoles/Roles/Solo/Crewmate/Carpenter.cs b/ExtremeRoles/Roles/Solo/Crewmate/Carpenter.cs index fc0487abf..da31180d3 100644 --- a/ExtremeRoles/Roles/Solo/Crewmate/Carpenter.cs +++ b/ExtremeRoles/Roles/Solo/Crewmate/Carpenter.cs @@ -564,7 +564,7 @@ public bool IsAbilityUse() return this.IsAwake && - this.IsCommonUse() && + IRoleAbility.IsCommonUse() && !( // Miraとファングルはカメラ設置できない, TODO:ファングルはカメラ設置できるか調査 this.targetVent == null && (mapId == 1 || mapId == 5) diff --git a/ExtremeRoles/Roles/Solo/Crewmate/CurseMaker.cs b/ExtremeRoles/Roles/Solo/Crewmate/CurseMaker.cs index d61f9c38c..3d810d6e5 100644 --- a/ExtremeRoles/Roles/Solo/Crewmate/CurseMaker.cs +++ b/ExtremeRoles/Roles/Solo/Crewmate/CurseMaker.cs @@ -207,7 +207,7 @@ public bool IsAbilityUse() { this.targetBody = Player.GetDeadBodyInfo( this.deadBodyCheckRange); - return this.IsCommonUse() && this.targetBody != null; + return IRoleAbility.IsCommonUse() && this.targetBody != null; } public void CleanUp() diff --git a/ExtremeRoles/Roles/Solo/Crewmate/Delusioner.cs b/ExtremeRoles/Roles/Solo/Crewmate/Delusioner.cs index d03802af2..1bcf83215 100644 --- a/ExtremeRoles/Roles/Solo/Crewmate/Delusioner.cs +++ b/ExtremeRoles/Roles/Solo/Crewmate/Delusioner.cs @@ -109,7 +109,7 @@ public bool IsAbilityUse() this.targetPlayerId = target.PlayerId; - return this.IsCommonUse(); + return IRoleAbility.IsCommonUse(); } public void ModifiedVote( diff --git a/ExtremeRoles/Roles/Solo/Crewmate/Fencer.cs b/ExtremeRoles/Roles/Solo/Crewmate/Fencer.cs index 69c074504..0f0976c4b 100644 --- a/ExtremeRoles/Roles/Solo/Crewmate/Fencer.cs +++ b/ExtremeRoles/Roles/Solo/Crewmate/Fencer.cs @@ -142,7 +142,7 @@ public bool UseAbility() public bool IsAbilityUse() { - return this.IsCommonUse(); + return IRoleAbility.IsCommonUse(); } public void ResetOnMeetingStart() diff --git a/ExtremeRoles/Roles/Solo/Crewmate/Maintainer.cs b/ExtremeRoles/Roles/Solo/Crewmate/Maintainer.cs index 0028dd561..d49356a10 100644 --- a/ExtremeRoles/Roles/Solo/Crewmate/Maintainer.cs +++ b/ExtremeRoles/Roles/Solo/Crewmate/Maintainer.cs @@ -83,7 +83,7 @@ public bool IsAbilityUse() } } - return sabotageActive && this.IsCommonUse(); + return sabotageActive && IRoleAbility.IsCommonUse(); } diff --git a/ExtremeRoles/Roles/Solo/Crewmate/Moderator.cs b/ExtremeRoles/Roles/Solo/Crewmate/Moderator.cs index c2409d3b3..d12849d64 100644 --- a/ExtremeRoles/Roles/Solo/Crewmate/Moderator.cs +++ b/ExtremeRoles/Roles/Solo/Crewmate/Moderator.cs @@ -174,7 +174,7 @@ public bool UseAbility() return true; } - public bool IsAbilityUse() => this.IsCommonUse(); + public bool IsAbilityUse() => IRoleAbility.IsCommonUse(); public void ResetOnMeetingStart() { diff --git a/ExtremeRoles/Roles/Solo/Crewmate/Opener.cs b/ExtremeRoles/Roles/Solo/Crewmate/Opener.cs index 53b8cc7fd..2261d5b71 100644 --- a/ExtremeRoles/Roles/Solo/Crewmate/Opener.cs +++ b/ExtremeRoles/Roles/Solo/Crewmate/Opener.cs @@ -88,7 +88,7 @@ public bool IsAbilityUse() return false; } - return this.IsCommonUse() && !this.targetDoor.IsOpen; + return IRoleAbility.IsCommonUse() && !this.targetDoor.IsOpen; } public void ResetOnMeetingStart() diff --git a/ExtremeRoles/Roles/Solo/Crewmate/Photographer.cs b/ExtremeRoles/Roles/Solo/Crewmate/Photographer.cs index 3eeb921b2..7b4c48445 100644 --- a/ExtremeRoles/Roles/Solo/Crewmate/Photographer.cs +++ b/ExtremeRoles/Roles/Solo/Crewmate/Photographer.cs @@ -375,7 +375,7 @@ public bool UseAbility() } public bool IsAbilityUse() - => this.IsAwake && this.IsCommonUse(); + => this.IsAwake && IRoleAbility.IsCommonUse(); public string GetFakeOptionString() => ""; diff --git a/ExtremeRoles/Roles/Solo/Crewmate/Psychic.cs b/ExtremeRoles/Roles/Solo/Crewmate/Psychic.cs index a393a6f43..e361977ac 100644 --- a/ExtremeRoles/Roles/Solo/Crewmate/Psychic.cs +++ b/ExtremeRoles/Roles/Solo/Crewmate/Psychic.cs @@ -257,7 +257,7 @@ public void CleanUp() public bool CheckAbility() => this.startPos == CachedPlayerControl.LocalPlayer.PlayerControl.GetTruePosition() && - this.IsCommonUse(); + IRoleAbility.IsCommonUse(); public bool UseAbility() { @@ -268,7 +268,7 @@ public bool UseAbility() } public bool IsAbilityUse() - => this.IsAwake && this.IsCommonUse(); + => this.IsAwake && IRoleAbility.IsCommonUse(); public string GetFakeOptionString() => ""; diff --git a/ExtremeRoles/Roles/Solo/Crewmate/Supervisor.cs b/ExtremeRoles/Roles/Solo/Crewmate/Supervisor.cs index 2a33f9b9a..046d6db1c 100644 --- a/ExtremeRoles/Roles/Solo/Crewmate/Supervisor.cs +++ b/ExtremeRoles/Roles/Solo/Crewmate/Supervisor.cs @@ -71,7 +71,7 @@ public void CreateAbility() public bool IsAbilityUse() { return - this.IsCommonUse() && ( + IRoleAbility.IsCommonUse() && ( MapBehaviour.Instance == null || !MapBehaviour.Instance.isActiveAndEnabled); } diff --git a/ExtremeRoles/Roles/Solo/Crewmate/Teleporter.cs b/ExtremeRoles/Roles/Solo/Crewmate/Teleporter.cs index 545040e29..c9e6fbbe5 100644 --- a/ExtremeRoles/Roles/Solo/Crewmate/Teleporter.cs +++ b/ExtremeRoles/Roles/Solo/Crewmate/Teleporter.cs @@ -282,7 +282,7 @@ public bool UseAbility() return true; } - public bool IsAbilityUse() => this.IsCommonUse(); + public bool IsAbilityUse() => IRoleAbility.IsCommonUse(); public void ResetOnMeetingStart() { diff --git a/ExtremeRoles/Roles/Solo/Crewmate/TimeMaster.cs b/ExtremeRoles/Roles/Solo/Crewmate/TimeMaster.cs index 22d47aac4..331dc57ed 100644 --- a/ExtremeRoles/Roles/Solo/Crewmate/TimeMaster.cs +++ b/ExtremeRoles/Roles/Solo/Crewmate/TimeMaster.cs @@ -328,7 +328,7 @@ public bool UseAbility() return true; } - public bool IsAbilityUse() => this.IsCommonUse(); + public bool IsAbilityUse() => IRoleAbility.IsCommonUse(); public void ResetOnMeetingStart() { diff --git a/ExtremeRoles/Roles/Solo/Crewmate/Watchdog.cs b/ExtremeRoles/Roles/Solo/Crewmate/Watchdog.cs index aeb90e711..914f5f28e 100644 --- a/ExtremeRoles/Roles/Solo/Crewmate/Watchdog.cs +++ b/ExtremeRoles/Roles/Solo/Crewmate/Watchdog.cs @@ -72,7 +72,7 @@ public void CreateAbility() public bool IsAbilityUse() { - return this.IsCommonUse() && Minigame.Instance == null; + return IRoleAbility.IsCommonUse() && Minigame.Instance == null; } public bool IsOpen() => Minigame.Instance != null; diff --git a/ExtremeRoles/Roles/Solo/Impostor/AssaultMaster.cs b/ExtremeRoles/Roles/Solo/Impostor/AssaultMaster.cs index 2a495dca0..2903e1ecd 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/AssaultMaster.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/AssaultMaster.cs @@ -84,7 +84,7 @@ public void HookReportButton( } public bool IsAbilityUse() => - this.IsCommonUse() && + IRoleAbility.IsCommonUse() && this.stock > 0 && PlayerControl.LocalPlayer.killTimer > 0; diff --git a/ExtremeRoles/Roles/Solo/Impostor/Bomber.cs b/ExtremeRoles/Roles/Solo/Impostor/Bomber.cs index af6460aa8..e8273fac6 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Bomber.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Bomber.cs @@ -73,7 +73,7 @@ public void CreateAbility() public bool IsAbilityUse() { this.setTargetPlayer = Player.GetClosestPlayerInKillRange(); - return this.IsCommonUse() && this.setTargetPlayer != null; + return IRoleAbility.IsCommonUse() && this.setTargetPlayer != null; } public void ForceCleanUp() diff --git a/ExtremeRoles/Roles/Solo/Impostor/Carrier.cs b/ExtremeRoles/Roles/Solo/Impostor/Carrier.cs index 572fb2b84..f2e63ece3 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Carrier.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Carrier.cs @@ -149,7 +149,7 @@ public void CreateAbility() public bool IsAbilityUse() { this.targetBody = Player.GetDeadBodyInfo(this.carryDistance); - return this.IsCommonUse() && this.targetBody != null; + return IRoleAbility.IsCommonUse() && this.targetBody != null; } public void ResetOnMeetingEnd(GameData.PlayerInfo exiledPlayer = null) diff --git a/ExtremeRoles/Roles/Solo/Impostor/Commander.cs b/ExtremeRoles/Roles/Solo/Impostor/Commander.cs index 3c4a5f51b..0d6827723 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Commander.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Commander.cs @@ -88,7 +88,7 @@ public void CreateAbility() Path.CommanderAttackCommand)); } - public bool IsAbilityUse() => this.IsCommonUse(); + public bool IsAbilityUse() => IRoleAbility.IsCommonUse(); public void ResetOnMeetingEnd(GameData.PlayerInfo exiledPlayer = null) { diff --git a/ExtremeRoles/Roles/Solo/Impostor/Cracker.cs b/ExtremeRoles/Roles/Solo/Impostor/Cracker.cs index 66a06d95c..4b2ca2e97 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Cracker.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Cracker.cs @@ -117,7 +117,7 @@ public bool IsAbilityUse() this.targetDeadBodyId = info.PlayerId; } - return this.IsCommonUse() && this.targetDeadBodyId != byte.MaxValue; + return IRoleAbility.IsCommonUse() && this.targetDeadBodyId != byte.MaxValue; } public void ResetOnMeetingEnd(GameData.PlayerInfo exiledPlayer = null) diff --git a/ExtremeRoles/Roles/Solo/Impostor/Crewshroom.cs b/ExtremeRoles/Roles/Solo/Impostor/Crewshroom.cs index 7e631ce1f..86ea6da6f 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Crewshroom.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Crewshroom.cs @@ -49,7 +49,7 @@ public override string GetIntroDescription() _ => base.GetIntroDescription() }; - public bool IsAbilityUse() => this.IsCommonUse(); + public bool IsAbilityUse() => IRoleAbility.IsCommonUse(); public void ResetOnMeetingEnd(GameData.PlayerInfo? exiledPlayer = null) { diff --git a/ExtremeRoles/Roles/Solo/Impostor/Evolver.cs b/ExtremeRoles/Roles/Solo/Impostor/Evolver.cs index fae2d8ca2..fd5603224 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Evolver.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Evolver.cs @@ -74,7 +74,7 @@ public bool IsAbilityUse() { this.targetBody = Player.GetDeadBodyInfo( this.eatingRange); - return this.IsCommonUse() && this.targetBody != null; + return IRoleAbility.IsCommonUse() && this.targetBody != null; } public void ForceCleanUp() diff --git a/ExtremeRoles/Roles/Solo/Impostor/Faker.cs b/ExtremeRoles/Roles/Solo/Impostor/Faker.cs index c6f826408..c3ea5900c 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Faker.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Faker.cs @@ -67,7 +67,7 @@ public bool IsAbilityUse() isPlayerDummy ? this.playerDummyStr : this.deadBodyDummyStr, isPlayerDummy ? this.playerDummy : this.deadBodyDummy); - return this.IsCommonUse(); + return IRoleAbility.IsCommonUse(); } public void ResetOnMeetingEnd(GameData.PlayerInfo exiledPlayer = null) diff --git a/ExtremeRoles/Roles/Solo/Impostor/Hypnotist.cs b/ExtremeRoles/Roles/Solo/Impostor/Hypnotist.cs index e4f08b9f2..76941b5f2 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Hypnotist.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Hypnotist.cs @@ -307,7 +307,7 @@ public bool IsAbilityUse() CachedPlayerControl.LocalPlayer, this, this.range); - return this.target != null && this.IsCommonUse(); + return this.target != null && IRoleAbility.IsCommonUse(); } public void ResetOnMeetingStart() @@ -1152,14 +1152,14 @@ public bool IsAbilityUse() { case AbilityType.Admin: return - this.IsCommonUse() && + IRoleAbility.IsCommonUse() && ( MapBehaviour.Instance == null || !MapBehaviour.Instance.isActiveAndEnabled ); case AbilityType.Security: case AbilityType.Vital: - return this.IsCommonUse() && Minigame.Instance == null; + return IRoleAbility.IsCommonUse() && Minigame.Instance == null; default: return false; } diff --git a/ExtremeRoles/Roles/Solo/Impostor/LastWolf.cs b/ExtremeRoles/Roles/Solo/Impostor/LastWolf.cs index 178158695..7c48bed48 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/LastWolf.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/LastWolf.cs @@ -95,7 +95,7 @@ public void CreateAbility() public bool IsAbilityUse() => this.IsAwake && - this.IsCommonUse() && + IRoleAbility.IsCommonUse() && VisionComputer.Instance.IsModifierResetted(); public void ResetOnMeetingStart() diff --git a/ExtremeRoles/Roles/Solo/Impostor/Magician.cs b/ExtremeRoles/Roles/Solo/Impostor/Magician.cs index bafb375dc..420bb60c7 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Magician.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Magician.cs @@ -63,7 +63,7 @@ public void CreateAbility() this.airShipSpawn = GameSystem.GetAirShipRandomSpawn(); } - public bool IsAbilityUse() => this.IsCommonUse(); + public bool IsAbilityUse() => IRoleAbility.IsCommonUse(); public void ResetOnMeetingEnd(GameData.PlayerInfo exiledPlayer = null) { diff --git a/ExtremeRoles/Roles/Solo/Impostor/Mery.cs b/ExtremeRoles/Roles/Solo/Impostor/Mery.cs index 6643ed093..b917fe9cd 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Mery.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Mery.cs @@ -294,7 +294,7 @@ public void CreateAbility() public bool IsAbilityUse() { - return this.IsCommonUse(); + return IRoleAbility.IsCommonUse(); } public bool UseAbility() diff --git a/ExtremeRoles/Roles/Solo/Impostor/OverLoader.cs b/ExtremeRoles/Roles/Solo/Impostor/OverLoader.cs index 69c34ad33..b3d3655ea 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/OverLoader.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/OverLoader.cs @@ -96,7 +96,7 @@ public void CreateAbility() } public bool IsAbilityUse() => - this.IsAwake && this.IsCommonUse(); + this.IsAwake && IRoleAbility.IsCommonUse(); public void ResetOnMeetingEnd(GameData.PlayerInfo exiledPlayer = null) { diff --git a/ExtremeRoles/Roles/Solo/Impostor/Painter.cs b/ExtremeRoles/Roles/Solo/Impostor/Painter.cs index 7a0d85e04..7b51e569a 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Painter.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Painter.cs @@ -105,7 +105,7 @@ public bool IsAbilityUse() this.targetDeadBodyId = info.PlayerId; } - return this.IsCommonUse() && this.targetDeadBodyId != byte.MaxValue; + return IRoleAbility.IsCommonUse() && this.targetDeadBodyId != byte.MaxValue; } public void ResetOnMeetingEnd(GameData.PlayerInfo exiledPlayer = null) diff --git a/ExtremeRoles/Roles/Solo/Impostor/SlaveDriver.cs b/ExtremeRoles/Roles/Solo/Impostor/SlaveDriver.cs index 29858c0cb..ca66ae668 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/SlaveDriver.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/SlaveDriver.cs @@ -172,6 +172,6 @@ public bool IsAbilityUse() this.target = target.PlayerId; - return this.IsCommonUse() && !this.effectPlayer.Contains(this.target); + return IRoleAbility.IsCommonUse() && !this.effectPlayer.Contains(this.target); } } diff --git a/ExtremeRoles/Roles/Solo/Impostor/Slime.cs b/ExtremeRoles/Roles/Solo/Impostor/Slime.cs index d23c4cf74..dd242c94e 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Slime.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Slime.cs @@ -125,7 +125,7 @@ public bool IsAbilityUse() if (this.targetConsole == null) { return false; } return - this.IsCommonUse() && + IRoleAbility.IsCommonUse() && this.targetConsole.Image != null && GameSystem.IsValidConsole(localPlayer, this.targetConsole); } diff --git a/ExtremeRoles/Roles/Solo/Impostor/Smasher.cs b/ExtremeRoles/Roles/Solo/Impostor/Smasher.cs index 965336dfb..af996483d 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Smasher.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Smasher.cs @@ -51,7 +51,7 @@ public bool IsAbilityUse() { this.targetPlayerId = player.PlayerId; } - return this.IsCommonUse() && this.targetPlayerId != byte.MaxValue; + return IRoleAbility.IsCommonUse() && this.targetPlayerId != byte.MaxValue; } public bool UseAbility() diff --git a/ExtremeRoles/Roles/Solo/Impostor/Terorist.cs b/ExtremeRoles/Roles/Solo/Impostor/Terorist.cs index b99153877..6357f8364 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Terorist.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Terorist.cs @@ -50,7 +50,7 @@ public bool IsAbilityUse() { if (this.teroSabo is null || this.saboSystem == null) { return false; } - return this.IsCommonUse() && !this.teroSabo.IsActive && + return IRoleAbility.IsCommonUse() && !this.teroSabo.IsActive && (this.canActiveOtherSabotage || !this.saboSystem.AnyActive); } diff --git a/ExtremeRoles/Roles/Solo/Impostor/Thief.cs b/ExtremeRoles/Roles/Solo/Impostor/Thief.cs index cbe2618cd..674d26f47 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Thief.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Thief.cs @@ -74,7 +74,7 @@ public bool IsAbilityUse() { this.targetBody = Player.GetDeadBodyInfo( this.activeRange); - return this.IsCommonUse() && this.targetBody != null; + return IRoleAbility.IsCommonUse() && this.targetBody != null; } public void ForceCleanUp() diff --git a/ExtremeRoles/Roles/Solo/Impostor/Zombie.cs b/ExtremeRoles/Roles/Solo/Impostor/Zombie.cs index 0968fe2a6..db5ea4e01 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Zombie.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Zombie.cs @@ -186,7 +186,7 @@ public bool UseAbility() } public bool IsAbilityUse() - => this.IsCommonUse() && + => IRoleAbility.IsCommonUse() && tryGetPlayerInRoom(out SystemTypes? room) && room.HasValue && this.setRooms.ContainsKey(room.Value); diff --git a/ExtremeRoles/Roles/Solo/Neutral/Alice.cs b/ExtremeRoles/Roles/Solo/Neutral/Alice.cs index c0984a072..c0ba45e43 100644 --- a/ExtremeRoles/Roles/Solo/Neutral/Alice.cs +++ b/ExtremeRoles/Roles/Solo/Neutral/Alice.cs @@ -57,7 +57,7 @@ public override bool IsSameTeam(SingleRoleBase targetRole) => public bool IsAbilityUse() { - return this.IsCommonUse(); + return IRoleAbility.IsCommonUse(); } public override void RolePlayerKilledAction( diff --git a/ExtremeRoles/Roles/Solo/Neutral/Eater.cs b/ExtremeRoles/Roles/Solo/Neutral/Eater.cs index 5ba86e84e..81ee756dc 100644 --- a/ExtremeRoles/Roles/Solo/Neutral/Eater.cs +++ b/ExtremeRoles/Roles/Solo/Neutral/Eater.cs @@ -143,7 +143,7 @@ public bool IsAbilityUse() !hasDedBodyTarget && hasPlayerTarget ? EaterAbilityMode.Kill : EaterAbilityMode.DeadBody); - return this.IsCommonUse() && + return IRoleAbility.IsCommonUse() && (hasPlayerTarget || hasDedBodyTarget); } diff --git a/ExtremeRoles/Roles/Solo/Neutral/Hatter.cs b/ExtremeRoles/Roles/Solo/Neutral/Hatter.cs index 1f7749cbf..df7b48db1 100644 --- a/ExtremeRoles/Roles/Solo/Neutral/Hatter.cs +++ b/ExtremeRoles/Roles/Solo/Neutral/Hatter.cs @@ -82,7 +82,7 @@ public void CreateAbility() public override bool IsSameTeam(SingleRoleBase targetRole) => this.IsNeutralSameTeam(targetRole); - public bool IsAbilityUse() => this.IsCommonUse(); + public bool IsAbilityUse() => IRoleAbility.IsCommonUse(); public bool UseAbility() { diff --git a/ExtremeRoles/Roles/Solo/Neutral/Jackal.cs b/ExtremeRoles/Roles/Solo/Neutral/Jackal.cs index 07c2bb015..aa0b2668b 100644 --- a/ExtremeRoles/Roles/Solo/Neutral/Jackal.cs +++ b/ExtremeRoles/Roles/Solo/Neutral/Jackal.cs @@ -382,7 +382,7 @@ public bool IsAbilityUse() this, GameOptionsData.KillDistances[ Mathf.Clamp(this.createSidekickRange, 0, 2)]); - return this.Target != null && this.IsCommonUse(); + return this.Target != null && IRoleAbility.IsCommonUse(); } public bool UseAbility() diff --git a/ExtremeRoles/Roles/Solo/Neutral/Jester.cs b/ExtremeRoles/Roles/Solo/Neutral/Jester.cs index d05ed3ec9..0b0f4fcad 100644 --- a/ExtremeRoles/Roles/Solo/Neutral/Jester.cs +++ b/ExtremeRoles/Roles/Solo/Neutral/Jester.cs @@ -118,7 +118,7 @@ public bool IsAbilityUse() this.tmpTarget = Helper.Player.GetClosestPlayerInRange( CachedPlayerControl.LocalPlayer, this, this.outburstDistance); - return this.IsCommonUse() && this.tmpTarget != null; + return IRoleAbility.IsCommonUse() && this.tmpTarget != null; } public override void ExiledAction(PlayerControl rolePlayer) diff --git a/ExtremeRoles/Roles/Solo/Neutral/Madmate.cs b/ExtremeRoles/Roles/Solo/Neutral/Madmate.cs index ef69bbb3f..ff42cf335 100644 --- a/ExtremeRoles/Roles/Solo/Neutral/Madmate.cs +++ b/ExtremeRoles/Roles/Solo/Neutral/Madmate.cs @@ -86,7 +86,7 @@ public bool UseAbility() return true; } - public bool IsAbilityUse() => this.IsCommonUse(); + public bool IsAbilityUse() => IRoleAbility.IsCommonUse(); public void ResetOnMeetingStart() { diff --git a/ExtremeRoles/Roles/Solo/Neutral/Miner.cs b/ExtremeRoles/Roles/Solo/Neutral/Miner.cs index a2c9e548b..7248e8c34 100644 --- a/ExtremeRoles/Roles/Solo/Neutral/Miner.cs +++ b/ExtremeRoles/Roles/Solo/Neutral/Miner.cs @@ -197,7 +197,7 @@ public void CleanUp() ++this.mineId; } - public bool IsAbilityUse() => this.IsCommonUse(); + public bool IsAbilityUse() => IRoleAbility.IsCommonUse(); public void AllReset(PlayerControl rolePlayer) { diff --git a/ExtremeRoles/Roles/Solo/Neutral/Missionary.cs b/ExtremeRoles/Roles/Solo/Neutral/Missionary.cs index a57cfcde2..d227a44bd 100644 --- a/ExtremeRoles/Roles/Solo/Neutral/Missionary.cs +++ b/ExtremeRoles/Roles/Solo/Neutral/Missionary.cs @@ -158,7 +158,7 @@ public bool IsAbilityUse() } } - return this.IsCommonUse() && this.TargetPlayer != byte.MaxValue; + return IRoleAbility.IsCommonUse() && this.TargetPlayer != byte.MaxValue; } public void ResetOnMeetingStart() diff --git a/ExtremeRoles/Roles/Solo/Neutral/Queen.cs b/ExtremeRoles/Roles/Solo/Neutral/Queen.cs index 1a29c1372..e27a82322 100644 --- a/ExtremeRoles/Roles/Solo/Neutral/Queen.cs +++ b/ExtremeRoles/Roles/Solo/Neutral/Queen.cs @@ -350,7 +350,7 @@ public bool IsAbilityUse() CachedPlayerControl.LocalPlayer, this, this.range); - return this.Target != null && this.IsCommonUse(); + return this.Target != null && IRoleAbility.IsCommonUse(); } public void ResetOnMeetingStart() @@ -642,7 +642,7 @@ public void CreateAbility() throw new Exception("Don't call this class method!!"); } - public bool IsAbilityUse() => this.IsCommonUse(); + public bool IsAbilityUse() => IRoleAbility.IsCommonUse(); public void ResetOnMeetingEnd(GameData.PlayerInfo exiledPlayer = null) { diff --git a/ExtremeRoles/Roles/Solo/Neutral/TotoCalcio.cs b/ExtremeRoles/Roles/Solo/Neutral/TotoCalcio.cs index f8f39a13c..035138f72 100644 --- a/ExtremeRoles/Roles/Solo/Neutral/TotoCalcio.cs +++ b/ExtremeRoles/Roles/Solo/Neutral/TotoCalcio.cs @@ -80,7 +80,7 @@ public bool IsAbilityUse() if (this.tmpTarget == null || this.tmpTarget.Data == null) { return false; } - bool commonUse = this.IsCommonUse(); + bool commonUse = IRoleAbility.IsCommonUse(); if (this.betPlayer != null) { diff --git a/ExtremeRoles/Roles/Solo/Neutral/Umbrer.cs b/ExtremeRoles/Roles/Solo/Neutral/Umbrer.cs index e52c2ddca..906f9252b 100644 --- a/ExtremeRoles/Roles/Solo/Neutral/Umbrer.cs +++ b/ExtremeRoles/Roles/Solo/Neutral/Umbrer.cs @@ -250,7 +250,7 @@ public bool IsAbilityUse() if (this.tmpTarget == null) { return false; } - return this.IsCommonUse() && !this.container.IsFinalStage(this.tmpTarget.PlayerId); + return IRoleAbility.IsCommonUse() && !this.container.IsFinalStage(this.tmpTarget.PlayerId); } public void ResetOnMeetingStart() From d0df52a690547f54e856a5432d477521772a8306 Mon Sep 17 00:00:00 2001 From: yukieiji Date: Tue, 13 Feb 2024 21:34:52 +0900 Subject: [PATCH 11/24] refactor:IRoleAbility and IRoleAutoBuildAbility --- .../Roles/API/Interface/IRoleAbility.cs | 39 +++++++++++-------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/ExtremeRoles/Roles/API/Interface/IRoleAbility.cs b/ExtremeRoles/Roles/API/Interface/IRoleAbility.cs index 3abc6f4fe..ce77e3184 100644 --- a/ExtremeRoles/Roles/API/Interface/IRoleAbility.cs +++ b/ExtremeRoles/Roles/API/Interface/IRoleAbility.cs @@ -15,20 +15,18 @@ public enum RoleAbilityCommonOption AbilityCount, AbilityActiveTime, } + + public interface IRoleAbility : IRoleResetMeeting { - public ExtremeAbilityButton Button - { - get; - set; - } + public ExtremeAbilityButton Button + { + get; + set; + } public void CreateAbility(); - public bool UseAbility(); - - public bool IsAbilityUse(); - public void RoleAbilityInit() { if (this.Button == null) { return; } @@ -70,6 +68,13 @@ protected static bool IsCommonUse() } } +public interface IRoleAutoBuildAbility : IRoleAbility +{ + public bool UseAbility(); + + public bool IsAbilityUse(); +} + public static class IRoleAbilityMixin { private const float defaultCoolTime = 30.0f; @@ -80,7 +85,7 @@ public static class IRoleAbilityMixin private const float step = 0.5f; public static void CreateNormalAbilityButton( - this IRoleAbility self, + this IRoleAutoBuildAbility self, string textKey, Sprite sprite, Func checkAbility = null, @@ -103,7 +108,7 @@ public static void CreateNormalAbilityButton( } public static void CreateAbilityCountButton( - this IRoleAbility self, + this IRoleAutoBuildAbility self, string textKey, Sprite sprite, Func checkAbility = null, @@ -129,7 +134,7 @@ public static void CreateAbilityCountButton( public static void CreateReclickableAbilityButton( - this IRoleAbility self, + this IRoleAutoBuildAbility self, string textKey, Sprite sprite, Func checkAbility = null, @@ -149,7 +154,7 @@ public static void CreateReclickableAbilityButton( } public static void CreateReclickableCountAbilityButton( - this IRoleAbility self, + this IRoleAutoBuildAbility self, string textKey, Sprite sprite, Func checkAbility = null, @@ -169,7 +174,7 @@ public static void CreateReclickableCountAbilityButton( } public static void CreateChargeAbilityButton( - this IRoleAbility self, + this IRoleAutoBuildAbility self, string textKey, Sprite sprite, Func checkAbility = null, @@ -192,7 +197,7 @@ public static void CreateChargeAbilityButton( } public static void CreatePassiveAbilityButton( - this IRoleAbility self, + this IRoleAutoBuildAbility self, string activateButtonName, string deactivateButtonName, Sprite activateSprite, @@ -217,7 +222,7 @@ public static void CreatePassiveAbilityButton( public static void CreateCommonAbilityOption( - this IRoleAbility self, + this IRoleAutoBuildAbility self, IOptionInfo parentOps, float defaultActiveTime = float.MaxValue) { @@ -251,7 +256,7 @@ public static void CreateCommonAbilityOption( } public static void CreateAbilityCountOption( - this IRoleAbility self, + this IRoleAutoBuildAbility self, IOptionInfo parentOps, int defaultAbilityCount, int maxAbilityCount, From 2dd964859a0680819c8aad5631fd98824618e3dc Mon Sep 17 00:00:00 2001 From: yukieiji Date: Tue, 13 Feb 2024 21:35:05 +0900 Subject: [PATCH 12/24] refactor:Combination --- ExtremeRoles/Roles/Combination/Accelerator.cs | 2 +- ExtremeRoles/Roles/Combination/DetectiveOffice.cs | 2 +- ExtremeRoles/Roles/Combination/HeroAcademia.cs | 6 +++--- ExtremeRoles/Roles/Combination/Kids.cs | 2 +- ExtremeRoles/Roles/Combination/Mover.cs | 2 +- ExtremeRoles/Roles/Combination/Traitor.cs | 2 +- ExtremeRoles/Roles/Solo/Crewmate/Agency.cs | 4 ++-- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ExtremeRoles/Roles/Combination/Accelerator.cs b/ExtremeRoles/Roles/Combination/Accelerator.cs index c5c95ca33..9a2decff1 100644 --- a/ExtremeRoles/Roles/Combination/Accelerator.cs +++ b/ExtremeRoles/Roles/Combination/Accelerator.cs @@ -23,7 +23,7 @@ public AcceleratorManager() : base(new Accelerator(), 1) public sealed class Accelerator : MultiAssignRoleBase, - IRoleAbility, + IRoleAutoBuildAbility, IRoleSpecialReset, IRoleUsableOverride { diff --git a/ExtremeRoles/Roles/Combination/DetectiveOffice.cs b/ExtremeRoles/Roles/Combination/DetectiveOffice.cs index 47f49a475..aefd602d3 100644 --- a/ExtremeRoles/Roles/Combination/DetectiveOffice.cs +++ b/ExtremeRoles/Roles/Combination/DetectiveOffice.cs @@ -516,7 +516,7 @@ private void downgradeDetective() } } -public class DetectiveApprentice : MultiAssignRoleBase, IRoleAbility, IRoleReportHook +public class DetectiveApprentice : MultiAssignRoleBase, IRoleAutoBuildAbility, IRoleReportHook { public struct DetectiveApprenticeOptionHolder diff --git a/ExtremeRoles/Roles/Combination/HeroAcademia.cs b/ExtremeRoles/Roles/Combination/HeroAcademia.cs index f70e08e5f..57bf39949 100644 --- a/ExtremeRoles/Roles/Combination/HeroAcademia.cs +++ b/ExtremeRoles/Roles/Combination/HeroAcademia.cs @@ -416,7 +416,7 @@ private static void updateHero( } -public sealed class Hero : MultiAssignRoleBase, IRoleAbility, IRoleUpdate, IRoleSpecialReset +public sealed class Hero : MultiAssignRoleBase, IRoleAutoBuildAbility, IRoleUpdate, IRoleSpecialReset { public enum OneForAllCondition : byte { @@ -689,7 +689,7 @@ private void setButtonActive(bool active) } } } -public sealed class Villain : MultiAssignRoleBase, IRoleAbility, IRoleUpdate, IRoleSpecialReset +public sealed class Villain : MultiAssignRoleBase, IRoleAutoBuildAbility, IRoleUpdate, IRoleSpecialReset { public enum VillanOption { @@ -861,7 +861,7 @@ protected override void RoleSpecificInit() } } -public sealed class Vigilante : MultiAssignRoleBase, IRoleAbility, IRoleUpdate, IRoleWinPlayerModifier +public sealed class Vigilante : MultiAssignRoleBase, IRoleAutoBuildAbility, IRoleUpdate, IRoleWinPlayerModifier { public enum VigilanteCondition : byte { diff --git a/ExtremeRoles/Roles/Combination/Kids.cs b/ExtremeRoles/Roles/Combination/Kids.cs index 72eb9100e..3864efa68 100644 --- a/ExtremeRoles/Roles/Combination/Kids.cs +++ b/ExtremeRoles/Roles/Combination/Kids.cs @@ -58,7 +58,7 @@ public override void InitializeGhostRole( } } -public sealed class Delinquent : MultiAssignRoleBase, IRoleAbility +public sealed class Delinquent : MultiAssignRoleBase, IRoleAutoBuildAbility { public enum AbilityType : byte { diff --git a/ExtremeRoles/Roles/Combination/Mover.cs b/ExtremeRoles/Roles/Combination/Mover.cs index baf6dd40b..fb6a106f2 100644 --- a/ExtremeRoles/Roles/Combination/Mover.cs +++ b/ExtremeRoles/Roles/Combination/Mover.cs @@ -23,7 +23,7 @@ public MoverManager() : base(new Mover(), 1) public sealed class Mover : MultiAssignRoleBase, - IRoleAbility, + IRoleAutoBuildAbility, IRoleSpecialReset, IRoleUsableOverride { diff --git a/ExtremeRoles/Roles/Combination/Traitor.cs b/ExtremeRoles/Roles/Combination/Traitor.cs index 8368266f5..dcc26575c 100644 --- a/ExtremeRoles/Roles/Combination/Traitor.cs +++ b/ExtremeRoles/Roles/Combination/Traitor.cs @@ -63,7 +63,7 @@ protected override void CommonInit() } -public sealed class Traitor : MultiAssignRoleBase, IRoleAbility, IRoleUpdate, IRoleSpecialSetUp +public sealed class Traitor : MultiAssignRoleBase, IRoleAutoBuildAbility, IRoleUpdate, IRoleSpecialSetUp { public enum AbilityType : byte { diff --git a/ExtremeRoles/Roles/Solo/Crewmate/Agency.cs b/ExtremeRoles/Roles/Solo/Crewmate/Agency.cs index aafe7bf15..321338f13 100644 --- a/ExtremeRoles/Roles/Solo/Crewmate/Agency.cs +++ b/ExtremeRoles/Roles/Solo/Crewmate/Agency.cs @@ -12,7 +12,7 @@ namespace ExtremeRoles.Roles.Solo.Crewmate; -public sealed class Agency : SingleRoleBase, IRoleAbility, IRoleUpdate +public sealed class Agency : SingleRoleBase, IRoleAutoBuildAbility, IRoleUpdate { public bool CanSeeTaskBar { get; private set; } @@ -194,7 +194,7 @@ public bool IsAbilityUse() this.TargetPlayer = target.PlayerId; } - return IRoleAbility.IsCommonUse() && this.TargetPlayer != byte.MaxValue; + return IRoleAutoBuildAbility.IsCommonUse() && this.TargetPlayer != byte.MaxValue; } public void ResetOnMeetingStart() From c65583b93015e5e61fa2586dc03cb55af85f8e03 Mon Sep 17 00:00:00 2001 From: yukieiji Date: Tue, 13 Feb 2024 21:40:29 +0900 Subject: [PATCH 13/24] refactor:crewmate --- ExtremeRoles/Roles/Solo/Crewmate/CurseMaker.cs | 2 +- ExtremeRoles/Roles/Solo/Crewmate/Delusioner.cs | 2 +- ExtremeRoles/Roles/Solo/Crewmate/Fencer.cs | 2 +- ExtremeRoles/Roles/Solo/Crewmate/Maintainer.cs | 2 +- ExtremeRoles/Roles/Solo/Crewmate/Moderator.cs | 2 +- ExtremeRoles/Roles/Solo/Crewmate/Opener.cs | 2 +- ExtremeRoles/Roles/Solo/Crewmate/Photographer.cs | 2 +- ExtremeRoles/Roles/Solo/Crewmate/Psychic.cs | 2 +- ExtremeRoles/Roles/Solo/Crewmate/Supervisor.cs | 2 +- ExtremeRoles/Roles/Solo/Crewmate/Teleporter.cs | 2 +- ExtremeRoles/Roles/Solo/Crewmate/TimeMaster.cs | 2 +- ExtremeRoles/Roles/Solo/Crewmate/Watchdog.cs | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ExtremeRoles/Roles/Solo/Crewmate/CurseMaker.cs b/ExtremeRoles/Roles/Solo/Crewmate/CurseMaker.cs index 3d810d6e5..05794e460 100644 --- a/ExtremeRoles/Roles/Solo/Crewmate/CurseMaker.cs +++ b/ExtremeRoles/Roles/Solo/Crewmate/CurseMaker.cs @@ -17,7 +17,7 @@ namespace ExtremeRoles.Roles.Solo.Crewmate; public sealed class CurseMaker : SingleRoleBase, - IRoleAbility, + IRoleAutoBuildAbility, IRoleMurderPlayerHook, IRoleUpdate { diff --git a/ExtremeRoles/Roles/Solo/Crewmate/Delusioner.cs b/ExtremeRoles/Roles/Solo/Crewmate/Delusioner.cs index 1bcf83215..4e5aa4091 100644 --- a/ExtremeRoles/Roles/Solo/Crewmate/Delusioner.cs +++ b/ExtremeRoles/Roles/Solo/Crewmate/Delusioner.cs @@ -16,7 +16,7 @@ namespace ExtremeRoles.Roles.Solo.Crewmate; public sealed class Delusioner : SingleRoleBase, - IRoleAbility, + IRoleAutoBuildAbility, IRoleAwake, IRoleVoteModifier { diff --git a/ExtremeRoles/Roles/Solo/Crewmate/Fencer.cs b/ExtremeRoles/Roles/Solo/Crewmate/Fencer.cs index 0f0976c4b..6ab07b138 100644 --- a/ExtremeRoles/Roles/Solo/Crewmate/Fencer.cs +++ b/ExtremeRoles/Roles/Solo/Crewmate/Fencer.cs @@ -11,7 +11,7 @@ namespace ExtremeRoles.Roles.Solo.Crewmate; -public sealed class Fencer : SingleRoleBase, IRoleAbility, IRoleUpdate +public sealed class Fencer : SingleRoleBase, IRoleAutoBuildAbility, IRoleUpdate { public enum FencerOption { diff --git a/ExtremeRoles/Roles/Solo/Crewmate/Maintainer.cs b/ExtremeRoles/Roles/Solo/Crewmate/Maintainer.cs index d49356a10..010031600 100644 --- a/ExtremeRoles/Roles/Solo/Crewmate/Maintainer.cs +++ b/ExtremeRoles/Roles/Solo/Crewmate/Maintainer.cs @@ -10,7 +10,7 @@ namespace ExtremeRoles.Roles.Solo.Crewmate; -public sealed class Maintainer : SingleRoleBase, IRoleAbility +public sealed class Maintainer : SingleRoleBase, IRoleAutoBuildAbility { public ExtremeAbilityButton Button { diff --git a/ExtremeRoles/Roles/Solo/Crewmate/Moderator.cs b/ExtremeRoles/Roles/Solo/Crewmate/Moderator.cs index d12849d64..cdac7d95c 100644 --- a/ExtremeRoles/Roles/Solo/Crewmate/Moderator.cs +++ b/ExtremeRoles/Roles/Solo/Crewmate/Moderator.cs @@ -17,7 +17,7 @@ namespace ExtremeRoles.Roles.Solo.Crewmate; public sealed class Moderator : SingleRoleBase, - IRoleAbility, + IRoleAutoBuildAbility, IRoleAwake { public enum ModeratorOption diff --git a/ExtremeRoles/Roles/Solo/Crewmate/Opener.cs b/ExtremeRoles/Roles/Solo/Crewmate/Opener.cs index 2261d5b71..4e247b877 100644 --- a/ExtremeRoles/Roles/Solo/Crewmate/Opener.cs +++ b/ExtremeRoles/Roles/Solo/Crewmate/Opener.cs @@ -10,7 +10,7 @@ namespace ExtremeRoles.Roles.Solo.Crewmate; -public sealed class Opener : SingleRoleBase, IRoleAbility, IRoleUpdate +public sealed class Opener : SingleRoleBase, IRoleAutoBuildAbility, IRoleUpdate { public enum OpenerOption { diff --git a/ExtremeRoles/Roles/Solo/Crewmate/Photographer.cs b/ExtremeRoles/Roles/Solo/Crewmate/Photographer.cs index 7b4c48445..339a820d5 100644 --- a/ExtremeRoles/Roles/Solo/Crewmate/Photographer.cs +++ b/ExtremeRoles/Roles/Solo/Crewmate/Photographer.cs @@ -23,7 +23,7 @@ namespace ExtremeRoles.Roles.Solo.Crewmate; public sealed class Photographer : SingleRoleBase, - IRoleAbility, + IRoleAutoBuildAbility, IRoleAwake, IRoleReportHook { diff --git a/ExtremeRoles/Roles/Solo/Crewmate/Psychic.cs b/ExtremeRoles/Roles/Solo/Crewmate/Psychic.cs index e361977ac..9dc593702 100644 --- a/ExtremeRoles/Roles/Solo/Crewmate/Psychic.cs +++ b/ExtremeRoles/Roles/Solo/Crewmate/Psychic.cs @@ -22,7 +22,7 @@ namespace ExtremeRoles.Roles.Solo.Crewmate; public sealed class Psychic : SingleRoleBase, - IRoleAbility, + IRoleAutoBuildAbility, IRoleAwake, IRoleReportHook { diff --git a/ExtremeRoles/Roles/Solo/Crewmate/Supervisor.cs b/ExtremeRoles/Roles/Solo/Crewmate/Supervisor.cs index 046d6db1c..6f373fab0 100644 --- a/ExtremeRoles/Roles/Solo/Crewmate/Supervisor.cs +++ b/ExtremeRoles/Roles/Solo/Crewmate/Supervisor.cs @@ -9,7 +9,7 @@ namespace ExtremeRoles.Roles.Solo.Crewmate; -public sealed class Supervisor : SingleRoleBase, IRoleAbility, IRoleUpdate +public sealed class Supervisor : SingleRoleBase, IRoleAutoBuildAbility, IRoleUpdate { public enum SuperviosrOption { diff --git a/ExtremeRoles/Roles/Solo/Crewmate/Teleporter.cs b/ExtremeRoles/Roles/Solo/Crewmate/Teleporter.cs index c9e6fbbe5..7e5cd59ae 100644 --- a/ExtremeRoles/Roles/Solo/Crewmate/Teleporter.cs +++ b/ExtremeRoles/Roles/Solo/Crewmate/Teleporter.cs @@ -23,7 +23,7 @@ namespace ExtremeRoles.Roles.Solo.Crewmate; public sealed class Teleporter : - SingleRoleBase, IRoleAbility, IRoleSpecialSetUp + SingleRoleBase, IRoleAutoBuildAbility, IRoleSpecialSetUp { public sealed class TeleporterAbilityBehavior : AbilityBehaviorBase, ICountBehavior diff --git a/ExtremeRoles/Roles/Solo/Crewmate/TimeMaster.cs b/ExtremeRoles/Roles/Solo/Crewmate/TimeMaster.cs index 331dc57ed..b753b59e5 100644 --- a/ExtremeRoles/Roles/Solo/Crewmate/TimeMaster.cs +++ b/ExtremeRoles/Roles/Solo/Crewmate/TimeMaster.cs @@ -15,7 +15,7 @@ namespace ExtremeRoles.Roles.Solo.Crewmate; -public sealed class TimeMaster : SingleRoleBase, IRoleAbility +public sealed class TimeMaster : SingleRoleBase, IRoleAutoBuildAbility { public enum TimeMasterOption { diff --git a/ExtremeRoles/Roles/Solo/Crewmate/Watchdog.cs b/ExtremeRoles/Roles/Solo/Crewmate/Watchdog.cs index 914f5f28e..cb5add41e 100644 --- a/ExtremeRoles/Roles/Solo/Crewmate/Watchdog.cs +++ b/ExtremeRoles/Roles/Solo/Crewmate/Watchdog.cs @@ -11,7 +11,7 @@ namespace ExtremeRoles.Roles.Solo.Crewmate; -public sealed class Watchdog : SingleRoleBase, IRoleAbility, IRoleUpdate +public sealed class Watchdog : SingleRoleBase, IRoleAutoBuildAbility, IRoleUpdate { public ExtremeAbilityButton Button { From 63a98ff7e480d8ebf6b9ae6d3548e247e9cf336b Mon Sep 17 00:00:00 2001 From: yukieiji Date: Tue, 13 Feb 2024 21:48:22 +0900 Subject: [PATCH 14/24] refactor:impostor --- ExtremeRoles/Roles/Solo/Impostor/AssaultMaster.cs | 2 +- ExtremeRoles/Roles/Solo/Impostor/Bomber.cs | 2 +- ExtremeRoles/Roles/Solo/Impostor/Carrier.cs | 2 +- ExtremeRoles/Roles/Solo/Impostor/Commander.cs | 2 +- ExtremeRoles/Roles/Solo/Impostor/Cracker.cs | 2 +- ExtremeRoles/Roles/Solo/Impostor/Crewshroom.cs | 2 +- ExtremeRoles/Roles/Solo/Impostor/Evolver.cs | 2 +- ExtremeRoles/Roles/Solo/Impostor/Faker.cs | 2 +- ExtremeRoles/Roles/Solo/Impostor/Hypnotist.cs | 4 ++-- ExtremeRoles/Roles/Solo/Impostor/LastWolf.cs | 2 +- ExtremeRoles/Roles/Solo/Impostor/Magician.cs | 2 +- ExtremeRoles/Roles/Solo/Impostor/Mery.cs | 2 +- ExtremeRoles/Roles/Solo/Impostor/OverLoader.cs | 2 +- ExtremeRoles/Roles/Solo/Impostor/Painter.cs | 2 +- ExtremeRoles/Roles/Solo/Impostor/SlaveDriver.cs | 2 +- ExtremeRoles/Roles/Solo/Impostor/Slime.cs | 2 +- ExtremeRoles/Roles/Solo/Impostor/Smasher.cs | 2 +- ExtremeRoles/Roles/Solo/Impostor/Terorist.cs | 2 +- ExtremeRoles/Roles/Solo/Impostor/Thief.cs | 2 +- ExtremeRoles/Roles/Solo/Impostor/Zombie.cs | 2 +- 20 files changed, 21 insertions(+), 21 deletions(-) diff --git a/ExtremeRoles/Roles/Solo/Impostor/AssaultMaster.cs b/ExtremeRoles/Roles/Solo/Impostor/AssaultMaster.cs index 2903e1ecd..ce32fdae4 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/AssaultMaster.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/AssaultMaster.cs @@ -12,7 +12,7 @@ namespace ExtremeRoles.Roles.Solo.Impostor; -public sealed class AssaultMaster : SingleRoleBase, IRoleAbility, IRoleReportHook, IRoleUpdate +public sealed class AssaultMaster : SingleRoleBase, IRoleAutoBuildAbility, IRoleReportHook, IRoleUpdate { public enum AssaultMasterOption { diff --git a/ExtremeRoles/Roles/Solo/Impostor/Bomber.cs b/ExtremeRoles/Roles/Solo/Impostor/Bomber.cs index e8273fac6..9e6a94134 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Bomber.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Bomber.cs @@ -18,7 +18,7 @@ namespace ExtremeRoles.Roles.Solo.Impostor; -public sealed class Bomber : SingleRoleBase, IRoleAbility, IRoleUpdate +public sealed class Bomber : SingleRoleBase, IRoleAutoBuildAbility, IRoleUpdate { public enum BomberOption { diff --git a/ExtremeRoles/Roles/Solo/Impostor/Carrier.cs b/ExtremeRoles/Roles/Solo/Impostor/Carrier.cs index f2e63ece3..433047e4d 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Carrier.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Carrier.cs @@ -15,7 +15,7 @@ namespace ExtremeRoles.Roles.Solo.Impostor; -public sealed class Carrier : SingleRoleBase, IRoleAbility, IRoleSpecialReset +public sealed class Carrier : SingleRoleBase, IRoleAutoBuildAbility, IRoleSpecialReset { private DeadBody carringBody; private float[] alphaValue; diff --git a/ExtremeRoles/Roles/Solo/Impostor/Commander.cs b/ExtremeRoles/Roles/Solo/Impostor/Commander.cs index 0d6827723..bad2dece7 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Commander.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Commander.cs @@ -12,7 +12,7 @@ namespace ExtremeRoles.Roles.Solo.Impostor; -public sealed class Commander : SingleRoleBase, IRoleAbility +public sealed class Commander : SingleRoleBase, IRoleAutoBuildAbility { public ExtremeAbilityButton Button { diff --git a/ExtremeRoles/Roles/Solo/Impostor/Cracker.cs b/ExtremeRoles/Roles/Solo/Impostor/Cracker.cs index 4b2ca2e97..fa1d82f23 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Cracker.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Cracker.cs @@ -13,7 +13,7 @@ namespace ExtremeRoles.Roles.Solo.Impostor; -public sealed class Cracker : SingleRoleBase, IRoleAbility +public sealed class Cracker : SingleRoleBase, IRoleAutoBuildAbility { public sealed class CrackTrace : IMeetingResetObject { diff --git a/ExtremeRoles/Roles/Solo/Impostor/Crewshroom.cs b/ExtremeRoles/Roles/Solo/Impostor/Crewshroom.cs index 86ea6da6f..0b87ba252 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Crewshroom.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Crewshroom.cs @@ -14,7 +14,7 @@ namespace ExtremeRoles.Roles.Solo.Impostor; #nullable enable -public sealed class Crewshroom : SingleRoleBase, IRoleAbility +public sealed class Crewshroom : SingleRoleBase, IRoleAutoBuildAbility { public ExtremeAbilityButton Button { get; set; } diff --git a/ExtremeRoles/Roles/Solo/Impostor/Evolver.cs b/ExtremeRoles/Roles/Solo/Impostor/Evolver.cs index fd5603224..87d0cc14b 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Evolver.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Evolver.cs @@ -11,7 +11,7 @@ namespace ExtremeRoles.Roles.Solo.Impostor; -public sealed class Evolver : SingleRoleBase, IRoleAbility +public sealed class Evolver : SingleRoleBase, IRoleAutoBuildAbility { public enum EvolverOption { diff --git a/ExtremeRoles/Roles/Solo/Impostor/Faker.cs b/ExtremeRoles/Roles/Solo/Impostor/Faker.cs index c3ea5900c..9e3f6eacc 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Faker.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Faker.cs @@ -11,7 +11,7 @@ namespace ExtremeRoles.Roles.Solo.Impostor; -public sealed class Faker : SingleRoleBase, IRoleAbility +public sealed class Faker : SingleRoleBase, IRoleAutoBuildAbility { public enum FakerDummyOps : byte { diff --git a/ExtremeRoles/Roles/Solo/Impostor/Hypnotist.cs b/ExtremeRoles/Roles/Solo/Impostor/Hypnotist.cs index 76941b5f2..c245eca89 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Hypnotist.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Hypnotist.cs @@ -33,7 +33,7 @@ namespace ExtremeRoles.Roles.Solo.Impostor; public sealed class Hypnotist : SingleRoleBase, - IRoleAbility, + IRoleAutoBuildAbility, IRoleAwake, IRoleMurderPlayerHook, IRoleSpecialReset @@ -891,7 +891,7 @@ private static IReadOnlyList getRedPartPos(in JToken json) public sealed class Doll : SingleRoleBase, - IRoleAbility, + IRoleAutoBuildAbility, IRoleUpdate, IRoleHasParent, IRoleWinPlayerModifier diff --git a/ExtremeRoles/Roles/Solo/Impostor/LastWolf.cs b/ExtremeRoles/Roles/Solo/Impostor/LastWolf.cs index 7c48bed48..f9e72dbad 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/LastWolf.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/LastWolf.cs @@ -13,7 +13,7 @@ namespace ExtremeRoles.Roles.Solo.Impostor; -public sealed class LastWolf : SingleRoleBase, IRoleAbility, IRoleAwake +public sealed class LastWolf : SingleRoleBase, IRoleAutoBuildAbility, IRoleAwake { public static float LightOffVision { get; private set; } = 0.1f; diff --git a/ExtremeRoles/Roles/Solo/Impostor/Magician.cs b/ExtremeRoles/Roles/Solo/Impostor/Magician.cs index 420bb60c7..6f86a8cd8 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Magician.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Magician.cs @@ -16,7 +16,7 @@ namespace ExtremeRoles.Roles.Solo.Impostor; -public sealed class Magician : SingleRoleBase, IRoleAbility +public sealed class Magician : SingleRoleBase, IRoleAutoBuildAbility { public ExtremeAbilityButton Button diff --git a/ExtremeRoles/Roles/Solo/Impostor/Mery.cs b/ExtremeRoles/Roles/Solo/Impostor/Mery.cs index b917fe9cd..49511c697 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Mery.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Mery.cs @@ -20,7 +20,7 @@ namespace ExtremeRoles.Roles.Solo.Impostor; -public sealed class Mery : SingleRoleBase, IRoleAbility +public sealed class Mery : SingleRoleBase, IRoleAutoBuildAbility { public sealed class Camp : IUpdatableObject { diff --git a/ExtremeRoles/Roles/Solo/Impostor/OverLoader.cs b/ExtremeRoles/Roles/Solo/Impostor/OverLoader.cs index b3d3655ea..db4a47c26 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/OverLoader.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/OverLoader.cs @@ -15,7 +15,7 @@ namespace ExtremeRoles.Roles.Solo.Impostor; -public sealed class OverLoader : SingleRoleBase, IRoleAbility, IRoleAwake +public sealed class OverLoader : SingleRoleBase, IRoleAutoBuildAbility, IRoleAwake { public enum OverLoaderOption diff --git a/ExtremeRoles/Roles/Solo/Impostor/Painter.cs b/ExtremeRoles/Roles/Solo/Impostor/Painter.cs index 7b51e569a..9b9822085 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Painter.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Painter.cs @@ -8,7 +8,7 @@ namespace ExtremeRoles.Roles.Solo.Impostor; -public sealed class Painter : SingleRoleBase, IRoleAbility +public sealed class Painter : SingleRoleBase, IRoleAutoBuildAbility { public enum PainterOption { diff --git a/ExtremeRoles/Roles/Solo/Impostor/SlaveDriver.cs b/ExtremeRoles/Roles/Solo/Impostor/SlaveDriver.cs index ca66ae668..8dc784995 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/SlaveDriver.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/SlaveDriver.cs @@ -15,7 +15,7 @@ namespace ExtremeRoles.Roles.Solo.Impostor; public sealed class SlaveDriver : SingleRoleBase, - IRoleAbility + IRoleAutoBuildAbility { public sealed class HarassmentReportSerializer : IStringSerializer { diff --git a/ExtremeRoles/Roles/Solo/Impostor/Slime.cs b/ExtremeRoles/Roles/Solo/Impostor/Slime.cs index dd242c94e..661e7ae5a 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Slime.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Slime.cs @@ -13,7 +13,7 @@ namespace ExtremeRoles.Roles.Solo.Impostor; public sealed class Slime : SingleRoleBase, - IRoleAbility, + IRoleAutoBuildAbility, IRoleSpecialReset, IRolePerformKillHook { diff --git a/ExtremeRoles/Roles/Solo/Impostor/Smasher.cs b/ExtremeRoles/Roles/Solo/Impostor/Smasher.cs index af996483d..59af098fb 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Smasher.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Smasher.cs @@ -8,7 +8,7 @@ namespace ExtremeRoles.Roles.Solo.Impostor; -public sealed class Smasher : SingleRoleBase, IRoleAbility +public sealed class Smasher : SingleRoleBase, IRoleAutoBuildAbility { public enum SmasherOption { diff --git a/ExtremeRoles/Roles/Solo/Impostor/Terorist.cs b/ExtremeRoles/Roles/Solo/Impostor/Terorist.cs index 6357f8364..164e601bc 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Terorist.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Terorist.cs @@ -12,7 +12,7 @@ namespace ExtremeRoles.Roles.Solo.Impostor; -public sealed class Terorist : SingleRoleBase, IRoleAbility +public sealed class Terorist : SingleRoleBase, IRoleAutoBuildAbility { public enum TeroristOption { diff --git a/ExtremeRoles/Roles/Solo/Impostor/Thief.cs b/ExtremeRoles/Roles/Solo/Impostor/Thief.cs index 674d26f47..79395e202 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Thief.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Thief.cs @@ -14,7 +14,7 @@ namespace ExtremeRoles.Roles.Solo.Impostor; -public sealed class Thief : SingleRoleBase, IRoleAbility +public sealed class Thief : SingleRoleBase, IRoleAutoBuildAbility { public enum ThiefOption { diff --git a/ExtremeRoles/Roles/Solo/Impostor/Zombie.cs b/ExtremeRoles/Roles/Solo/Impostor/Zombie.cs index db5ea4e01..1b55ebf0a 100644 --- a/ExtremeRoles/Roles/Solo/Impostor/Zombie.cs +++ b/ExtremeRoles/Roles/Solo/Impostor/Zombie.cs @@ -25,7 +25,7 @@ namespace ExtremeRoles.Roles.Solo.Impostor; public sealed class Zombie : SingleRoleBase, - IRoleAbility, + IRoleAutoBuildAbility, IRoleAwake, IRoleOnRevive { From 8b53d5d87de1f8265eb16acd2e3254505b912a43 Mon Sep 17 00:00:00 2001 From: yukieiji Date: Tue, 13 Feb 2024 21:53:35 +0900 Subject: [PATCH 15/24] refactor:neutral --- ExtremeRoles/Roles/Solo/Neutral/Alice.cs | 2 +- ExtremeRoles/Roles/Solo/Neutral/Eater.cs | 2 +- ExtremeRoles/Roles/Solo/Neutral/Hatter.cs | 2 +- ExtremeRoles/Roles/Solo/Neutral/Jackal.cs | 2 +- ExtremeRoles/Roles/Solo/Neutral/Jester.cs | 2 +- ExtremeRoles/Roles/Solo/Neutral/Madmate.cs | 2 +- ExtremeRoles/Roles/Solo/Neutral/Miner.cs | 2 +- ExtremeRoles/Roles/Solo/Neutral/Missionary.cs | 2 +- ExtremeRoles/Roles/Solo/Neutral/Queen.cs | 4 ++-- ExtremeRoles/Roles/Solo/Neutral/TotoCalcio.cs | 2 +- ExtremeRoles/Roles/Solo/Neutral/Umbrer.cs | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ExtremeRoles/Roles/Solo/Neutral/Alice.cs b/ExtremeRoles/Roles/Solo/Neutral/Alice.cs index c0ba45e43..a7070390c 100644 --- a/ExtremeRoles/Roles/Solo/Neutral/Alice.cs +++ b/ExtremeRoles/Roles/Solo/Neutral/Alice.cs @@ -12,7 +12,7 @@ namespace ExtremeRoles.Roles.Solo.Neutral; -public sealed class Alice : SingleRoleBase, IRoleAbility +public sealed class Alice : SingleRoleBase, IRoleAutoBuildAbility { public enum AliceOption { diff --git a/ExtremeRoles/Roles/Solo/Neutral/Eater.cs b/ExtremeRoles/Roles/Solo/Neutral/Eater.cs index 81ee756dc..7c4e0a4bf 100644 --- a/ExtremeRoles/Roles/Solo/Neutral/Eater.cs +++ b/ExtremeRoles/Roles/Solo/Neutral/Eater.cs @@ -16,7 +16,7 @@ namespace ExtremeRoles.Roles.Solo.Neutral; -public sealed class Eater : SingleRoleBase, IRoleAbility, IRoleMurderPlayerHook, IRoleUpdate +public sealed class Eater : SingleRoleBase, IRoleAutoBuildAbility, IRoleMurderPlayerHook, IRoleUpdate { public enum EaterOption { diff --git a/ExtremeRoles/Roles/Solo/Neutral/Hatter.cs b/ExtremeRoles/Roles/Solo/Neutral/Hatter.cs index df7b48db1..11ec46034 100644 --- a/ExtremeRoles/Roles/Solo/Neutral/Hatter.cs +++ b/ExtremeRoles/Roles/Solo/Neutral/Hatter.cs @@ -16,7 +16,7 @@ namespace ExtremeRoles.Roles.Solo.Neutral; -public sealed class Hatter : SingleRoleBase, IRoleAbility, IRoleUpdate, IDeadBodyReportOverride +public sealed class Hatter : SingleRoleBase, IRoleAutoBuildAbility, IRoleUpdate, IDeadBodyReportOverride { public enum HatterOption { diff --git a/ExtremeRoles/Roles/Solo/Neutral/Jackal.cs b/ExtremeRoles/Roles/Solo/Neutral/Jackal.cs index aa0b2668b..fbe27abb4 100644 --- a/ExtremeRoles/Roles/Solo/Neutral/Jackal.cs +++ b/ExtremeRoles/Roles/Solo/Neutral/Jackal.cs @@ -16,7 +16,7 @@ namespace ExtremeRoles.Roles.Solo.Neutral; -public sealed class Jackal : SingleRoleBase, IRoleAbility, IRoleSpecialReset +public sealed class Jackal : SingleRoleBase, IRoleAutoBuildAbility, IRoleSpecialReset { public enum JackalOption { diff --git a/ExtremeRoles/Roles/Solo/Neutral/Jester.cs b/ExtremeRoles/Roles/Solo/Neutral/Jester.cs index 0b0f4fcad..aff76ac6a 100644 --- a/ExtremeRoles/Roles/Solo/Neutral/Jester.cs +++ b/ExtremeRoles/Roles/Solo/Neutral/Jester.cs @@ -9,7 +9,7 @@ namespace ExtremeRoles.Roles.Solo.Neutral; -public sealed class Jester : SingleRoleBase, IRoleAbility +public sealed class Jester : SingleRoleBase, IRoleAutoBuildAbility { public enum JesterOption { diff --git a/ExtremeRoles/Roles/Solo/Neutral/Madmate.cs b/ExtremeRoles/Roles/Solo/Neutral/Madmate.cs index ff42cf335..0acdc0fbe 100644 --- a/ExtremeRoles/Roles/Solo/Neutral/Madmate.cs +++ b/ExtremeRoles/Roles/Solo/Neutral/Madmate.cs @@ -13,7 +13,7 @@ namespace ExtremeRoles.Roles.Solo.Neutral; public sealed class Madmate : SingleRoleBase, - IRoleAbility, + IRoleAutoBuildAbility, IRoleUpdate, IRoleSpecialSetUp, IRoleWinPlayerModifier diff --git a/ExtremeRoles/Roles/Solo/Neutral/Miner.cs b/ExtremeRoles/Roles/Solo/Neutral/Miner.cs index 7248e8c34..9dc4f742a 100644 --- a/ExtremeRoles/Roles/Solo/Neutral/Miner.cs +++ b/ExtremeRoles/Roles/Solo/Neutral/Miner.cs @@ -21,7 +21,7 @@ namespace ExtremeRoles.Roles.Solo.Neutral; public sealed class Miner : SingleRoleBase, - IRoleAbility, + IRoleAutoBuildAbility, IRoleUpdate, IRoleSpecialSetUp, IRoleSpecialReset diff --git a/ExtremeRoles/Roles/Solo/Neutral/Missionary.cs b/ExtremeRoles/Roles/Solo/Neutral/Missionary.cs index d227a44bd..adfafccc7 100644 --- a/ExtremeRoles/Roles/Solo/Neutral/Missionary.cs +++ b/ExtremeRoles/Roles/Solo/Neutral/Missionary.cs @@ -21,7 +21,7 @@ namespace ExtremeRoles.Roles.Solo.Neutral; public sealed class Missionary : SingleRoleBase, - IRoleAbility, + IRoleAutoBuildAbility, IRoleUpdate, IRoleVoteCheck { diff --git a/ExtremeRoles/Roles/Solo/Neutral/Queen.cs b/ExtremeRoles/Roles/Solo/Neutral/Queen.cs index e27a82322..a9f9eb6c7 100644 --- a/ExtremeRoles/Roles/Solo/Neutral/Queen.cs +++ b/ExtremeRoles/Roles/Solo/Neutral/Queen.cs @@ -21,7 +21,7 @@ namespace ExtremeRoles.Roles.Solo.Neutral; public sealed class Queen : SingleRoleBase, - IRoleAbility, + IRoleAutoBuildAbility, IRoleSpecialReset, IRoleMurderPlayerHook, IRoleUpdate @@ -519,7 +519,7 @@ private bool isNotSucideServant(byte playerId) public sealed class Servant : MultiAssignRoleBase, - IRoleAbility, + IRoleAutoBuildAbility, IRoleMurderPlayerHook, IRoleHasParent { diff --git a/ExtremeRoles/Roles/Solo/Neutral/TotoCalcio.cs b/ExtremeRoles/Roles/Solo/Neutral/TotoCalcio.cs index 035138f72..6d31da8bd 100644 --- a/ExtremeRoles/Roles/Solo/Neutral/TotoCalcio.cs +++ b/ExtremeRoles/Roles/Solo/Neutral/TotoCalcio.cs @@ -10,7 +10,7 @@ namespace ExtremeRoles.Roles.Solo.Neutral; -public sealed class Totocalcio : SingleRoleBase, IRoleAbility, IRoleWinPlayerModifier +public sealed class Totocalcio : SingleRoleBase, IRoleAutoBuildAbility, IRoleWinPlayerModifier { public enum TotocalcioOption { diff --git a/ExtremeRoles/Roles/Solo/Neutral/Umbrer.cs b/ExtremeRoles/Roles/Solo/Neutral/Umbrer.cs index 906f9252b..4297cccc4 100644 --- a/ExtremeRoles/Roles/Solo/Neutral/Umbrer.cs +++ b/ExtremeRoles/Roles/Solo/Neutral/Umbrer.cs @@ -16,7 +16,7 @@ namespace ExtremeRoles.Roles.Solo.Neutral; -public sealed class Umbrer : SingleRoleBase, IRoleAbility, IRoleSpecialSetUp, IRoleUpdate +public sealed class Umbrer : SingleRoleBase, IRoleAutoBuildAbility, IRoleSpecialSetUp, IRoleUpdate { private sealed class InfectedContainer { From ed5104f43905c6994b0a93972e3098676ec57fc6 Mon Sep 17 00:00:00 2001 From: yukieiji Date: Tue, 13 Feb 2024 21:56:15 +0900 Subject: [PATCH 16/24] refactor and fix: can't create opsions --- .../Roles/API/Interface/IRoleAbility.cs | 409 +++++++++--------- 1 file changed, 207 insertions(+), 202 deletions(-) diff --git a/ExtremeRoles/Roles/API/Interface/IRoleAbility.cs b/ExtremeRoles/Roles/API/Interface/IRoleAbility.cs index ce77e3184..09f1130a1 100644 --- a/ExtremeRoles/Roles/API/Interface/IRoleAbility.cs +++ b/ExtremeRoles/Roles/API/Interface/IRoleAbility.cs @@ -68,221 +68,226 @@ protected static bool IsCommonUse() } } -public interface IRoleAutoBuildAbility : IRoleAbility +public static class IRoleAbilityMixin { - public bool UseAbility(); + private const float defaultCoolTime = 30.0f; + private const float minCoolTime = 0.5f; + private const float maxCoolTime = 120.0f; + private const float minActiveTime = 0.5f; + private const float maxActiveTime = 60.0f; + private const float step = 0.5f; - public bool IsAbilityUse(); -} -public static class IRoleAbilityMixin -{ - private const float defaultCoolTime = 30.0f; - private const float minCoolTime = 0.5f; - private const float maxCoolTime = 120.0f; - private const float minActiveTime = 0.5f; - private const float maxActiveTime = 60.0f; - private const float step = 0.5f; - - public static void CreateNormalAbilityButton( - this IRoleAutoBuildAbility self, - string textKey, - Sprite sprite, - Func checkAbility = null, - Action abilityOff = null, - Action forceAbilityOff = null, - KeyCode hotkey = KeyCode.F) - { - - self.Button = RoleAbilityFactory.CreateReusableAbility( - textKey: textKey, - img: sprite, - canUse: self.IsAbilityUse, - ability: self.UseAbility, - canActivating: checkAbility, - abilityOff: abilityOff, - forceAbilityOff: forceAbilityOff, - hotKey: hotkey); - - self.RoleAbilityInit(); - } - - public static void CreateAbilityCountButton( - this IRoleAutoBuildAbility self, - string textKey, - Sprite sprite, - Func checkAbility = null, - Action abilityOff = null, - Action forceAbilityOff = null, - bool isReduceOnActive = false, - KeyCode hotkey = KeyCode.F) - { - self.Button = RoleAbilityFactory.CreateCountAbility( - textKey: textKey, - img: sprite, - canUse: self.IsAbilityUse, - ability: self.UseAbility, - canActivating: checkAbility, - abilityOff: abilityOff, - forceAbilityOff: forceAbilityOff, - isReduceOnActive: isReduceOnActive, - hotKey: hotkey); - - self.RoleAbilityInit(); - - } - - - public static void CreateReclickableAbilityButton( - this IRoleAutoBuildAbility self, - string textKey, - Sprite sprite, - Func checkAbility = null, - Action abilityOff = null, - KeyCode hotkey = KeyCode.F) - { - self.Button = RoleAbilityFactory.CreateReclickAbility( - textKey: textKey, - img: sprite, - canUse: self.IsAbilityUse, - ability: self.UseAbility, - canActivating: checkAbility, - abilityOff: abilityOff, - hotKey: hotkey); - - self.RoleAbilityInit(); - } - - public static void CreateReclickableCountAbilityButton( - this IRoleAutoBuildAbility self, - string textKey, - Sprite sprite, - Func checkAbility = null, - Action abilityOff = null, - KeyCode hotkey = KeyCode.F) - { - self.Button = RoleAbilityFactory.CreateReclickCountAbility( - textKey: textKey, - img: sprite, - canUse: self.IsAbilityUse, - ability: self.UseAbility, - canActivating: checkAbility, - abilityOff: abilityOff, - hotKey: hotkey); - - self.RoleAbilityInit(); - } - - public static void CreateChargeAbilityButton( - this IRoleAutoBuildAbility self, - string textKey, - Sprite sprite, - Func checkAbility = null, - Action abilityOff = null, - Action forceAbilityOff = null, - KeyCode hotkey = KeyCode.F) - { - - self.Button = RoleAbilityFactory.CreateChargableAbility( - textKey: textKey, - img: sprite, - canUse: self.IsAbilityUse, - ability: self.UseAbility, - canActivating: checkAbility, - abilityOff: abilityOff, - forceAbilityOff: forceAbilityOff, - hotKey: hotkey); - - self.RoleAbilityInit(); - } - - public static void CreatePassiveAbilityButton( - this IRoleAutoBuildAbility self, - string activateButtonName, - string deactivateButtonName, - Sprite activateSprite, - Sprite deactivateSprite, - Action abilityCleanUp, - Func checkAbility = null, - KeyCode hotkey = KeyCode.F) - { - self.Button = RoleAbilityFactory.CreatePassiveAbility( - activateTextKey: activateButtonName, - activateImg: activateSprite, - deactivateTextKey: deactivateButtonName, - deactivateImg: deactivateSprite, - canUse: self.IsAbilityUse, - ability: self.UseAbility, - canActivating: checkAbility, - abilityOff: abilityCleanUp, - hotKey: hotkey); - - self.RoleAbilityInit(); - } - - - public static void CreateCommonAbilityOption( - this IRoleAutoBuildAbility self, - IOptionInfo parentOps, - float defaultActiveTime = float.MaxValue) - { - - SingleRoleBase role = (SingleRoleBase)self; - - new FloatCustomOption( - self.GetRoleOptionId(RoleAbilityCommonOption.AbilityCoolTime), - string.Concat( - role.RoleName, - RoleAbilityCommonOption.AbilityCoolTime.ToString()), - defaultCoolTime, minCoolTime, maxCoolTime, step, - parentOps, format: OptionUnit.Second, - tab: role.Tab); - - if (defaultActiveTime != float.MaxValue) - { - defaultActiveTime = Mathf.Clamp( - defaultActiveTime, minActiveTime, maxActiveTime); - - new FloatCustomOption( - self.GetRoleOptionId(RoleAbilityCommonOption.AbilityActiveTime), - string.Concat( - role.RoleName, - RoleAbilityCommonOption.AbilityActiveTime.ToString()), - defaultActiveTime, minActiveTime, maxActiveTime, step, - parentOps, format: OptionUnit.Second, - tab: role.Tab); - } - - } + public static void CreateCommonAbilityOption( + this IRoleAbility self, + IOptionInfo parentOps, + float defaultActiveTime = float.MaxValue) + { + + SingleRoleBase role = (SingleRoleBase)self; + + new FloatCustomOption( + self.GetRoleOptionId(RoleAbilityCommonOption.AbilityCoolTime), + string.Concat( + role.RoleName, + RoleAbilityCommonOption.AbilityCoolTime.ToString()), + defaultCoolTime, minCoolTime, maxCoolTime, step, + parentOps, format: OptionUnit.Second, + tab: role.Tab); + + if (defaultActiveTime != float.MaxValue) + { + defaultActiveTime = Mathf.Clamp( + defaultActiveTime, minActiveTime, maxActiveTime); + + new FloatCustomOption( + self.GetRoleOptionId(RoleAbilityCommonOption.AbilityActiveTime), + string.Concat( + role.RoleName, + RoleAbilityCommonOption.AbilityActiveTime.ToString()), + defaultActiveTime, minActiveTime, maxActiveTime, step, + parentOps, format: OptionUnit.Second, + tab: role.Tab); + } + + } public static void CreateAbilityCountOption( - this IRoleAutoBuildAbility self, + this IRoleAbility self, IOptionInfo parentOps, int defaultAbilityCount, int maxAbilityCount, float defaultActiveTime = float.MaxValue, int minAbilityCount = 1) - { + { + + SingleRoleBase role = (SingleRoleBase)self; + + self.CreateCommonAbilityOption( + parentOps, + defaultActiveTime); + + new IntCustomOption( + self.GetRoleOptionId(RoleAbilityCommonOption.AbilityCount), + string.Concat( + role.RoleName, + RoleAbilityCommonOption.AbilityCount.ToString()), + defaultAbilityCount, minAbilityCount, + maxAbilityCount, 1, + parentOps, format: OptionUnit.Shot, + tab: role.Tab); + + } + + public static int GetRoleOptionId( + this IRoleAbility self, + RoleAbilityCommonOption option) => ((RoleOptionBase)self).GetRoleOptionId((int)option); +} + + + +public interface IRoleAutoBuildAbility : IRoleAbility +{ + public bool UseAbility(); - SingleRoleBase role = (SingleRoleBase)self; + public bool IsAbilityUse(); +} - self.CreateCommonAbilityOption( - parentOps, - defaultActiveTime); +public static class IRoleAutoBuildAbilityMixin +{ + public static void CreateNormalAbilityButton( + this IRoleAutoBuildAbility self, + string textKey, + Sprite sprite, + Func checkAbility = null, + Action abilityOff = null, + Action forceAbilityOff = null, + KeyCode hotkey = KeyCode.F) + { - new IntCustomOption( - self.GetRoleOptionId(RoleAbilityCommonOption.AbilityCount), - string.Concat( - role.RoleName, - RoleAbilityCommonOption.AbilityCount.ToString()), - defaultAbilityCount, minAbilityCount, - maxAbilityCount, 1, - parentOps, format: OptionUnit.Shot, - tab: role.Tab); + self.Button = RoleAbilityFactory.CreateReusableAbility( + textKey: textKey, + img: sprite, + canUse: self.IsAbilityUse, + ability: self.UseAbility, + canActivating: checkAbility, + abilityOff: abilityOff, + forceAbilityOff: forceAbilityOff, + hotKey: hotkey); + + self.RoleAbilityInit(); + } - } + public static void CreateAbilityCountButton( + this IRoleAutoBuildAbility self, + string textKey, + Sprite sprite, + Func checkAbility = null, + Action abilityOff = null, + Action forceAbilityOff = null, + bool isReduceOnActive = false, + KeyCode hotkey = KeyCode.F) + { + self.Button = RoleAbilityFactory.CreateCountAbility( + textKey: textKey, + img: sprite, + canUse: self.IsAbilityUse, + ability: self.UseAbility, + canActivating: checkAbility, + abilityOff: abilityOff, + forceAbilityOff: forceAbilityOff, + isReduceOnActive: isReduceOnActive, + hotKey: hotkey); + + self.RoleAbilityInit(); + + } - public static int GetRoleOptionId( - this IRoleAbility self, - RoleAbilityCommonOption option) => ((RoleOptionBase)self).GetRoleOptionId((int)option); + + public static void CreateReclickableAbilityButton( + this IRoleAutoBuildAbility self, + string textKey, + Sprite sprite, + Func checkAbility = null, + Action abilityOff = null, + KeyCode hotkey = KeyCode.F) + { + self.Button = RoleAbilityFactory.CreateReclickAbility( + textKey: textKey, + img: sprite, + canUse: self.IsAbilityUse, + ability: self.UseAbility, + canActivating: checkAbility, + abilityOff: abilityOff, + hotKey: hotkey); + + self.RoleAbilityInit(); + } + + public static void CreateReclickableCountAbilityButton( + this IRoleAutoBuildAbility self, + string textKey, + Sprite sprite, + Func checkAbility = null, + Action abilityOff = null, + KeyCode hotkey = KeyCode.F) + { + self.Button = RoleAbilityFactory.CreateReclickCountAbility( + textKey: textKey, + img: sprite, + canUse: self.IsAbilityUse, + ability: self.UseAbility, + canActivating: checkAbility, + abilityOff: abilityOff, + hotKey: hotkey); + + self.RoleAbilityInit(); + } + + public static void CreateChargeAbilityButton( + this IRoleAutoBuildAbility self, + string textKey, + Sprite sprite, + Func checkAbility = null, + Action abilityOff = null, + Action forceAbilityOff = null, + KeyCode hotkey = KeyCode.F) + { + + self.Button = RoleAbilityFactory.CreateChargableAbility( + textKey: textKey, + img: sprite, + canUse: self.IsAbilityUse, + ability: self.UseAbility, + canActivating: checkAbility, + abilityOff: abilityOff, + forceAbilityOff: forceAbilityOff, + hotKey: hotkey); + + self.RoleAbilityInit(); + } + + public static void CreatePassiveAbilityButton( + this IRoleAutoBuildAbility self, + string activateButtonName, + string deactivateButtonName, + Sprite activateSprite, + Sprite deactivateSprite, + Action abilityCleanUp, + Func checkAbility = null, + KeyCode hotkey = KeyCode.F) + { + self.Button = RoleAbilityFactory.CreatePassiveAbility( + activateTextKey: activateButtonName, + activateImg: activateSprite, + deactivateTextKey: deactivateButtonName, + deactivateImg: deactivateSprite, + canUse: self.IsAbilityUse, + ability: self.UseAbility, + canActivating: checkAbility, + abilityOff: abilityCleanUp, + hotKey: hotkey); + + self.RoleAbilityInit(); + } } From d895e55d3d365ddcbdce758c4a2f7931c858aa7a Mon Sep 17 00:00:00 2001 From: yukieiji Date: Tue, 13 Feb 2024 22:36:37 +0900 Subject: [PATCH 17/24] refactor:performance --- ExtremeRoles/Roles/API/Interface/IRoleAbility.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ExtremeRoles/Roles/API/Interface/IRoleAbility.cs b/ExtremeRoles/Roles/API/Interface/IRoleAbility.cs index 09f1130a1..bc19f7bfb 100644 --- a/ExtremeRoles/Roles/API/Interface/IRoleAbility.cs +++ b/ExtremeRoles/Roles/API/Interface/IRoleAbility.cs @@ -1,4 +1,6 @@ using System; +using System.Runtime.CompilerServices; + using UnityEngine; using ExtremeRoles.Module; @@ -53,6 +55,7 @@ public void RoleAbilityInit() this.Button.OnMeetingEnd(); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] protected static bool IsCommonUse() { PlayerControl localPlayer = CachedPlayerControl.LocalPlayer; From 64defdf88dff4767f2c7d33e117376da91d49656 Mon Sep 17 00:00:00 2001 From: yukieiji Date: Thu, 15 Feb 2024 20:51:12 +0900 Subject: [PATCH 18/24] feat:test run player --- ExtremeRoles.Test/GameTestRunner.cs | 2 + ExtremeRoles.Test/Helper/GameUtility.cs | 7 +-- ExtremeRoles.Test/Patch/RoleManagerPatch.cs | 57 +++++++++++++++++++++ 3 files changed, 61 insertions(+), 5 deletions(-) create mode 100644 ExtremeRoles.Test/Patch/RoleManagerPatch.cs diff --git a/ExtremeRoles.Test/GameTestRunner.cs b/ExtremeRoles.Test/GameTestRunner.cs index 351a94424..b2257270f 100644 --- a/ExtremeRoles.Test/GameTestRunner.cs +++ b/ExtremeRoles.Test/GameTestRunner.cs @@ -76,6 +76,8 @@ public override void Run() [Il2CppRegister] public sealed class GameMudderEndTestingBehaviour : MonoBehaviour { + public static bool Enable => instance != null; + public static GameMudderEndTestingBehaviour Instance { get diff --git a/ExtremeRoles.Test/Helper/GameUtility.cs b/ExtremeRoles.Test/Helper/GameUtility.cs index 2c05327db..5c41ef649 100644 --- a/ExtremeRoles.Test/Helper/GameUtility.cs +++ b/ExtremeRoles.Test/Helper/GameUtility.cs @@ -83,9 +83,8 @@ public static void PrepereGameWithRandom(ManualLogSource logger) } logger.LogInfo("Update Roles and Player...."); - enableXion(); - for (int playerId = 0; playerId < 15; ++playerId) + for (int playerId = 0; playerId < 14; ++playerId) { string playerName = $"TestPlayer_{playerId}"; logger.LogInfo($"spawn : {playerName}"); @@ -136,10 +135,8 @@ public static void PrepereGameWithRole(ManualLogSource logger, HashSet(); + + foreach (PlayerControl player in allPlayer) + { + il2CppListPlayer.Add(player.Data); + } + + GameManager.Instance.LogicRoleSelection.AssignRolesForTeam( + il2CppListPlayer, currentOption, RoleTeamTypes.Impostor, + adjustedNumImpostors, + new Il2CppSystem.Nullable() + { + value = RoleTypes.Impostor, + has_value = true + }); + GameManager.Instance.LogicRoleSelection.AssignRolesForTeam( + il2CppListPlayer, currentOption, RoleTeamTypes.Crewmate, + int.MaxValue, + new Il2CppSystem.Nullable() + { + value = RoleTypes.Crewmate, + has_value = true + }); + + // アサイン済みにする + foreach (PlayerControl player in allPlayer) + { + player.roleAssigned = true; + } + } +} \ No newline at end of file From e68d51fb6f43193ad225430ff75fd92bada96814 Mon Sep 17 00:00:00 2001 From: yukieiji Date: Thu, 15 Feb 2024 21:03:16 +0900 Subject: [PATCH 19/24] fix:Introcut progress cooltime --- ExtremeRoles/Module/ExtremeAbilityButton.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ExtremeRoles/Module/ExtremeAbilityButton.cs b/ExtremeRoles/Module/ExtremeAbilityButton.cs index 13ffdd726..6ec74bd1d 100644 --- a/ExtremeRoles/Module/ExtremeAbilityButton.cs +++ b/ExtremeRoles/Module/ExtremeAbilityButton.cs @@ -113,7 +113,12 @@ public void SetLabelToCrewmate() public void Update() { - if (!this.isShow || this.button == null) { return; } + if (!this.isShow || + this.button == null || + IntroCutscene.Instance != null) + { + return; + } bool isActive = this.activator.IsActive(); From ab4d2068fc433250a9517293fc72447fdbb2c8d8 Mon Sep 17 00:00:00 2001 From: yukieiji Date: Thu, 15 Feb 2024 21:35:26 +0900 Subject: [PATCH 20/24] feat:IRoleAbilityTests --- ExtremeRoles.Test/GameTestRunner.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ExtremeRoles.Test/GameTestRunner.cs b/ExtremeRoles.Test/GameTestRunner.cs index b2257270f..01275b53d 100644 --- a/ExtremeRoles.Test/GameTestRunner.cs +++ b/ExtremeRoles.Test/GameTestRunner.cs @@ -34,6 +34,24 @@ public override void Run() GameMudderEndTestingBehaviour.Instance.StartCoroutine( GameMudderEndTestingBehaviour.Instance.Run( new("Random", 3), + new("IRoleAbilityRole", 5, + [ + ExtremeRoleId.Carpenter, + ExtremeRoleId.BodyGuard, + ExtremeRoleId.SandWorm, + ]), + new("IRoleAutoBuildAbilityRole", 5, + [ + ExtremeRoleId.Hatter, + ExtremeRoleId.Eater, + ExtremeRoleId.Carrier, + ExtremeRoleId.Thief, + ExtremeRoleId.Traitor, + ExtremeRoleId.Teleporter, + ExtremeRoleId.Supervisor, + ExtremeRoleId.Psychic, + ExtremeRoleId.Mover, + ]), new("NeutralRemove", 5, [ ExtremeRoleId.Jester, ExtremeRoleId.TaskMaster, From a5ca0baa9f6775fb164dd84351a38cd3360dd5e3 Mon Sep 17 00:00:00 2001 From: yukieiji Date: Thu, 15 Feb 2024 22:20:53 +0900 Subject: [PATCH 21/24] change : disable xion --- ExtremeRoles.Test/Helper/GameUtility.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ExtremeRoles.Test/Helper/GameUtility.cs b/ExtremeRoles.Test/Helper/GameUtility.cs index 5c41ef649..63304789b 100644 --- a/ExtremeRoles.Test/Helper/GameUtility.cs +++ b/ExtremeRoles.Test/Helper/GameUtility.cs @@ -82,6 +82,8 @@ public static void PrepereGameWithRandom(ManualLogSource logger) opt.UpdateSelection(newIndex); } + disableXion(); + logger.LogInfo("Update Roles and Player...."); for (int playerId = 0; playerId < 14; ++playerId) @@ -135,6 +137,8 @@ public static void PrepereGameWithRole(ManualLogSource logger, HashSet } - private static void enableXion() + private static void disableXion() { OptionManager.Instance.GetIOption( - (int)RoleGlobalOption.UseXion).UpdateSelection(1); + (int)RoleGlobalOption.UseXion).UpdateSelection(0); } private static void enableRandomNormalRole(ManualLogSource logger) From 63fe312b3a4f218fefb00ec94fdea19f66722a3c Mon Sep 17 00:00:00 2001 From: yukieiji Date: Thu, 15 Feb 2024 22:21:11 +0900 Subject: [PATCH 22/24] fix:reload assets --- ExtremeRoles/Resources/Loader.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ExtremeRoles/Resources/Loader.cs b/ExtremeRoles/Resources/Loader.cs index 90173289b..22d719f06 100644 --- a/ExtremeRoles/Resources/Loader.cs +++ b/ExtremeRoles/Resources/Loader.cs @@ -150,6 +150,10 @@ public static class Loader { public static void ResetCache() { + foreach(var bundle in cachedBundle.Values) + { + bundle.Unload(false); + } cachedBundle.Clear(); cachedSprite.Clear(); } From 56e962ce4bc52d62eda08590d5f72ea00f59cf21 Mon Sep 17 00:00:00 2001 From: yukieiji Date: Thu, 15 Feb 2024 22:21:22 +0900 Subject: [PATCH 23/24] change:tests --- ExtremeRoles.Test/ExtremeRolesTestPlugin.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ExtremeRoles.Test/ExtremeRolesTestPlugin.cs b/ExtremeRoles.Test/ExtremeRolesTestPlugin.cs index 90a46c415..f423d74ff 100644 --- a/ExtremeRoles.Test/ExtremeRolesTestPlugin.cs +++ b/ExtremeRoles.Test/ExtremeRolesTestPlugin.cs @@ -41,7 +41,7 @@ public static void Prefix(ChatController __instance) GameUtility.ChangePresetTo(19); - var runner = new ImgLoadRunner(); + var runner = new GameTestRunner(); runner.Run(); } } From a844e5270432cc8985dfaf0910a26af296dd03f5 Mon Sep 17 00:00:00 2001 From: yukieiji Date: Thu, 15 Feb 2024 22:23:18 +0900 Subject: [PATCH 24/24] bump up:version --- ExtremeRoles/ExtremeRoles.csproj | 2 +- ExtremeSkins/ExtremeSkins.csproj | 2 +- ExtremeVoiceEngine/ExtremeVoiceEngine.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ExtremeRoles/ExtremeRoles.csproj b/ExtremeRoles/ExtremeRoles.csproj index edde54403..49290fb78 100644 --- a/ExtremeRoles/ExtremeRoles.csproj +++ b/ExtremeRoles/ExtremeRoles.csproj @@ -3,7 +3,7 @@ net6.0 latest 7 - 9.2.3.2 + 9.2.3.3 PublicBeta Extreme Roles for Advanced user diff --git a/ExtremeSkins/ExtremeSkins.csproj b/ExtremeSkins/ExtremeSkins.csproj index d18284a25..17857d250 100644 --- a/ExtremeSkins/ExtremeSkins.csproj +++ b/ExtremeSkins/ExtremeSkins.csproj @@ -3,7 +3,7 @@ net6.0 latest 7 - 8.2.0.40 + 8.2.0.41 AnimationVisor Extreme Skins for Extreme Roles diff --git a/ExtremeVoiceEngine/ExtremeVoiceEngine.csproj b/ExtremeVoiceEngine/ExtremeVoiceEngine.csproj index fc3748ed7..296ff7556 100644 --- a/ExtremeVoiceEngine/ExtremeVoiceEngine.csproj +++ b/ExtremeVoiceEngine/ExtremeVoiceEngine.csproj @@ -4,7 +4,7 @@ net6.0 latest 7 - 2.0.0.48 + 2.0.0.49 AmongUsV20230711 Extreme Voice Engine for bridging Extreme Roles and Voice Engine