using System.Collections.Generic; using Continentis.MainGame.Card; using UnityEngine.Events; using SoftCircuits.Collections; using SoulliesFramework.General; namespace Continentis.MainGame.Character { public partial class EventSubmodule : SubmoduleBase { public OrderedDictionary onCombatStart; //战斗开始时 public OrderedDictionary onCombatEnd; //战斗结束时 public OrderedDictionary onRoundStart; //每回合开始时 public OrderedDictionary onRoundEnd; //每回合结束时 public OrderedDictionary>> onStartAttack; //开始攻击时,参数为被攻击目标列表 public OrderedDictionary, List>> onFinishAttack; //完成攻击时,参数为被攻击目标列表和对应的攻击结果列表 public OrderedDictionary> onGetAttacked; //被攻击时,参数为攻击者和攻击结果 public OrderedDictionary onActionStart; //每次行动开始时 public OrderedDictionary onActionEnd; //每次行动结束时 public OrderedDictionary> onBeforeUseCard; //使用卡牌前,参数为使用的卡牌 public OrderedDictionary> onAfterUseCard; //使用卡牌后,参数为使用的卡牌 public EventSubmodule(CharacterBase character) : base(character) { onCombatStart = new OrderedDictionary(); onCombatEnd = new OrderedDictionary(); onRoundStart = new OrderedDictionary(); onRoundEnd = new OrderedDictionary(); onActionStart = new OrderedDictionary(); onActionEnd = new OrderedDictionary(); onStartAttack = new OrderedDictionary>>(); onFinishAttack = new OrderedDictionary, List>>(); onGetAttacked = new OrderedDictionary>(); onBeforeUseCard = new OrderedDictionary>(); onAfterUseCard = new OrderedDictionary>(); /* OnActionStart.InsertByPriority("First", new EventAction(()=>Debug.Log("First"), 0)); OnActionStart.InsertByPriority("Third", new EventAction(()=>Debug.Log("Third"), 2)); OnActionStart.InsertByPriority("Second", new EventAction(()=>Debug.Log("Second"), 1)); foreach (var (key, action) in OnActionStart) { action.Invoke(); } */ } } public partial class EventSubmodule { protected void SetUpDefaultEvents() { } } } namespace Continentis.MainGame.Character { public class AttackResult { public CharacterBase attacker; //攻击者 public int startDamage; //攻击开始时的原始伤害值 public bool isDodged; //是否被闪避 public int blockedDamage; //格挡掉的伤害 public int shieldedDamage; //护盾吸收的伤害 public int hurtDamage; //实际受到的伤害 public bool IsHurt => hurtDamage > 0; //是否实际受到伤害 public AttackResult(CharacterBase attacker, int startDamage, bool isDodged, int blocked, int shielded, int hurt) { this.attacker = attacker; this.startDamage = startDamage; this.isDodged = isDodged; this.blockedDamage = blocked; this.shieldedDamage = shielded; this.hurtDamage = hurt; } } }