From dc008b1d95b77a1881dde631953407503bfc49e5 Mon Sep 17 00:00:00 2001 From: milimoe Date: Thu, 12 Sep 2024 00:32:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20CharacterEffectControlType?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Api/Utility/ActionQueue.cs | 2 +- Entity/Character/Character.cs | 42 ++++++++++++++++------------------- Library/Constant/TypeEnum.cs | 10 +++++++++ 3 files changed, 30 insertions(+), 24 deletions(-) diff --git a/Api/Utility/ActionQueue.cs b/Api/Utility/ActionQueue.cs index b5047e2..83d792b 100644 --- a/Api/Utility/ActionQueue.cs +++ b/Api/Utility/ActionQueue.cs @@ -958,7 +958,7 @@ namespace Milimoe.FunGame.Core.Api.Utility { money += (coefficient + 1) * new Random().Next(100, 200); string termination = CharacterSet.GetContinuousKilling(coefficient); - string msg = $"[ {killer} ] 终结了 [ {death} ] {(termination != "" ? " 的" + termination : "")},获得 {money} 金钱!"; + string msg = $"[ {killer} ] 终结了 [ {death} ]{(termination != "" ? " 的" + termination : "")},获得 {money} 金钱!"; if (assists.Length > 1) { msg += "助攻:[ " + string.Join(" ] / [ ", assists.Where(c => c != killer)) + " ]"; diff --git a/Entity/Character/Character.cs b/Entity/Character/Character.cs index ed26b19..c164797 100644 --- a/Entity/Character/Character.cs +++ b/Entity/Character/Character.cs @@ -137,12 +137,17 @@ namespace Milimoe.FunGame.Core.Entity public CharacterState CharacterState { get; set; } = CharacterState.Actionable; /// - /// 角色目前被特效施加的状态 + /// 角色目前被特效施加的状态 [ 用于设置角色是否被控制的状态 ] /// - public Dictionary CharacterEffectStates { get; } = []; + public Dictionary> CharacterEffectStates { get; } = []; + + /// + /// 角色目前被特效施加的控制效果 [ 用于特效判断是否需要在移除特效时更改角色状态 ] + /// + public Dictionary> CharacterEffectControlTypes { get; } = []; /// - /// 角色是否是中立的/无敌的 [ 战斗相关 ] + /// 角色是否是中立的 [ 战斗相关 ] /// public bool IsNeutral { get; set; } = false; @@ -976,7 +981,7 @@ namespace Milimoe.FunGame.Core.Entity if (IsNeutral) { - builder.AppendLine("角色是无敌的"); + builder.AppendLine("角色是中立单位,处于无敌状态"); } if (IsUnselectable) @@ -1009,25 +1014,16 @@ namespace Milimoe.FunGame.Core.Entity bool isBattleRestricted = false; bool isSkillRestricted = false; - foreach (CharacterState state in CharacterEffectStates.Values) - { - if (state == CharacterState.NotActionable) - { - isNotActionable = true; - } - else if (state == CharacterState.ActionRestricted) - { - isActionRestricted = true; - } - else if (state == CharacterState.BattleRestricted) - { - isBattleRestricted = true; - } - else if (state == CharacterState.SkillRestricted) - { - isSkillRestricted = true; - } - } + IEnumerable states = CharacterEffectStates.Values.SelectMany(list => list); + // 根据持有的特效判断角色所处的状态 + isNotActionable = states.Any(state => state == CharacterState.NotActionable); + isActionRestricted = states.Any(state => state == CharacterState.ActionRestricted); + isBattleRestricted = states.Any(state => state == CharacterState.BattleRestricted); + isSkillRestricted = states.Any(state => state == CharacterState.SkillRestricted); + + IEnumerable types = CharacterEffectControlTypes.Values.SelectMany(list => list); + // 判断角色的控制效果 + IsUnselectable = types.Any(type => type == EffectControlType.Unselectable); bool isControl = isNotActionable || isActionRestricted || isBattleRestricted || isSkillRestricted; bool isCasting = CharacterState == CharacterState.Casting; diff --git a/Library/Constant/TypeEnum.cs b/Library/Constant/TypeEnum.cs index c2ddbb0..1784642 100644 --- a/Library/Constant/TypeEnum.cs +++ b/Library/Constant/TypeEnum.cs @@ -213,6 +213,11 @@ namespace Milimoe.FunGame.Core.Library.Constant /// None, + /// + /// 标记,目标受到某些技能的标记 + /// + Mark, + /// /// 眩晕,目标无法行动 /// @@ -313,6 +318,11 @@ namespace Milimoe.FunGame.Core.Library.Constant /// Invulnerable, + /// + /// 不可选中,无法成为普攻和技能的目标 + /// + Unselectable, + /// /// 伤害提升,增加攻击输出 ///