更新
This commit is contained in:
@@ -24,6 +24,9 @@ namespace Continentis.MainGame.Character
|
||||
public OrderedDictionary<string, PrioritizedAction<CardInstance, List<CharacterBase>>> onBeforePlayCard; //使用卡牌前,参数为使用的卡牌
|
||||
public OrderedDictionary<string, PrioritizedAction<CardInstance, List<CharacterBase>>> onAfterPlayCard; //使用卡牌后,参数为使用的卡牌
|
||||
|
||||
/// <summary>角色死亡时触发,供 Buff / 技能系统订阅响应</summary>
|
||||
public OrderedDictionary<string, PrioritizedAction> onDeath; //角色死亡时
|
||||
|
||||
public EventSubmodule(CharacterBase character) : base(character)
|
||||
{
|
||||
onCombatStart = new OrderedDictionary<string, PrioritizedAction>();
|
||||
@@ -42,6 +45,8 @@ namespace Continentis.MainGame.Character
|
||||
onBeforePlayCard = new OrderedDictionary<string, PrioritizedAction<CardInstance, List<CharacterBase>>>();
|
||||
onAfterPlayCard = new OrderedDictionary<string, PrioritizedAction<CardInstance, List<CharacterBase>>>();
|
||||
|
||||
onDeath = new OrderedDictionary<string, PrioritizedAction>();
|
||||
|
||||
onActionStart.InsertByPriority("StaminaRecover", new PrioritizedAction(() =>
|
||||
{
|
||||
owner.ModifyAttribute("Stamina", owner.GetAttribute("StaminaRecoverPerAction"));
|
||||
@@ -89,15 +94,19 @@ namespace Continentis.MainGame.Character
|
||||
public int blockedDamage; //格挡掉的伤害
|
||||
public int shieldedDamage; //护盾吸收的伤害
|
||||
public int hurtDamage; //实际受到的伤害
|
||||
|
||||
/// <summary>本次攻击的上下文,包含标签等扩展信息。</summary>
|
||||
public AttackContext context;
|
||||
|
||||
public bool IsHurt => hurtDamage > 0; //是否实际受到伤害
|
||||
|
||||
public AttackResult(CharacterBase attacker, CharacterBase target, int startDamage, CardInstance attackCard, bool isDodged, int blocked, int shielded, int hurt)
|
||||
public AttackResult(CharacterBase attacker, CharacterBase target, int startDamage, AttackContext context, bool isDodged, int blocked, int shielded, int hurt)
|
||||
{
|
||||
this.attacker = attacker;
|
||||
this.target = target;
|
||||
this.attackCard = attackCard;
|
||||
this.attackCard = context?.sourceCard;
|
||||
this.startDamage = startDamage;
|
||||
this.context = context ?? new AttackContext();
|
||||
this.isDodged = isDodged;
|
||||
this.blockedDamage = blocked;
|
||||
this.shieldedDamage = shielded;
|
||||
|
||||
Reference in New Issue
Block a user