219 lines
9.2 KiB
C#
219 lines
9.2 KiB
C#
using System.Collections.Generic;
|
||
using Cielonos.MainGame.Buffs.Character;
|
||
using SLSUtilities.General;
|
||
using SoftCircuits.Collections;
|
||
using UnityEngine;
|
||
|
||
namespace Cielonos.MainGame.Characters
|
||
{
|
||
public partial class EventSubmodule : SubmoduleBase<CharacterBase>
|
||
{
|
||
public EventSubmodule(CharacterBase owner) : base(owner)
|
||
{
|
||
onCombatStart = new OrderedDictionary<string, PrioritizedAction>();
|
||
onCombatEnd = new OrderedDictionary<string, PrioritizedAction>();
|
||
|
||
onDeath = new OrderedDictionary<string, PrioritizedAction>();
|
||
|
||
onHealthChanged = new OrderedDictionary<string, PrioritizedAction<float>>();
|
||
onEnergyChanged = new OrderedDictionary<string, PrioritizedAction<float>>();
|
||
|
||
onFirstJump = new OrderedDictionary<string, PrioritizedAction>();
|
||
onJumpLand = new OrderedDictionary<string, PrioritizedAction>();
|
||
onDashStart = new OrderedDictionary<string, PrioritizedAction>();
|
||
onDashEnd = new OrderedDictionary<string, PrioritizedAction>();
|
||
onDodgeStart = new OrderedDictionary<string, PrioritizedAction>();
|
||
onDodgeEnd = new OrderedDictionary<string, PrioritizedAction>();
|
||
|
||
|
||
onGetHit = new OrderedDictionary<string, PrioritizedAction<AttackAreaBase>>();
|
||
onHurt = new OrderedDictionary<string, PrioritizedAction<AttackAreaBase>>();
|
||
onGetBreakthrough = new OrderedDictionary<string, PrioritizedAction<AttackAreaBase>>();
|
||
onStartAttack = new OrderedDictionary<string, PrioritizedAction<AttackAreaBase, CharacterBase, Attack.Context>>();
|
||
onFinishAttack = new OrderedDictionary<string, PrioritizedAction<AttackAreaBase, CharacterBase, Attack.Result>>();
|
||
onBeforeGetAttacked = new OrderedDictionary<string, PrioritizedAction<AttackAreaBase, Attack.Context>>();
|
||
onAfterGetAttacked = new OrderedDictionary<string, PrioritizedAction<AttackAreaBase, Attack.Result>>();
|
||
onBlockSuccess = new OrderedDictionary<string, PrioritizedAction<AttackAreaBase, BlockSource>>();
|
||
onNormalBlockSuccess = new OrderedDictionary<string, PrioritizedAction<AttackAreaBase, BlockSource>>();
|
||
onPerfectBlockSuccess = new OrderedDictionary<string, PrioritizedAction<AttackAreaBase, BlockSource>>();
|
||
onNormalDodgeSuccess = new OrderedDictionary<string, PrioritizedAction<AttackAreaBase, DodgeSource>>();
|
||
onPerfectDodgeSuccess = new OrderedDictionary<string, PrioritizedAction<AttackAreaBase, DodgeSource>>();
|
||
|
||
onApplyBuffToTarget = new OrderedDictionary<string, PrioritizedAction<CharacterBuffBase>>();
|
||
}
|
||
}
|
||
|
||
#region Combat Events
|
||
|
||
public partial class EventSubmodule
|
||
{
|
||
/// <summary>
|
||
/// 战斗开始时
|
||
/// </summary>
|
||
public OrderedDictionary<string, PrioritizedAction> onCombatStart;
|
||
|
||
/// <summary>
|
||
/// 战斗结束时
|
||
/// </summary>
|
||
public OrderedDictionary<string, PrioritizedAction> onCombatEnd;
|
||
}
|
||
|
||
#endregion
|
||
|
||
#region Death Events
|
||
|
||
public partial class EventSubmodule
|
||
{
|
||
/// <summary>
|
||
/// 死亡时。
|
||
/// <para>
|
||
/// 注意:onDeath 回调在 Destroy(gameObject) 之前同步执行。
|
||
/// 请勿在回调中启动协程或异步任务,因为 GameObject 将在本帧末尾被销毁,
|
||
/// 任何依赖该对象存活的后续帧逻辑都会失败。
|
||
/// </para>
|
||
/// </summary>
|
||
public OrderedDictionary<string, PrioritizedAction> onDeath;
|
||
}
|
||
|
||
#endregion
|
||
|
||
#region Action Events
|
||
|
||
public partial class EventSubmodule
|
||
{
|
||
/// <summary>
|
||
/// 第一次跳跃时
|
||
/// </summary>
|
||
public OrderedDictionary<string, PrioritizedAction> onFirstJump;
|
||
|
||
/// <summary>
|
||
/// 跳跃落地时
|
||
/// </summary>
|
||
public OrderedDictionary<string, PrioritizedAction> onJumpLand;
|
||
|
||
/// <summary>
|
||
/// 冲刺开始时
|
||
/// </summary>
|
||
public OrderedDictionary<string, PrioritizedAction> onDashStart;
|
||
|
||
/// <summary>
|
||
/// 冲刺结束时
|
||
/// </summary>
|
||
public OrderedDictionary<string, PrioritizedAction> onDashEnd;
|
||
|
||
/// <summary>
|
||
/// 闪避开始时,注意,冲刺也属于闪避,会触发这个事件
|
||
/// </summary>
|
||
public OrderedDictionary<string, PrioritizedAction> onDodgeStart;
|
||
|
||
/// <summary>
|
||
/// 闪避结束时,注意,冲刺也属于闪避,会触发这个事件
|
||
/// </summary>
|
||
public OrderedDictionary<string, PrioritizedAction> onDodgeEnd;
|
||
}
|
||
|
||
#endregion
|
||
|
||
#region Attribute Change Events
|
||
|
||
public partial class EventSubmodule
|
||
{
|
||
/// <summary>
|
||
/// 生命变化时,参数为变化的数值
|
||
/// </summary>
|
||
public OrderedDictionary<string, PrioritizedAction<float>> onHealthChanged;
|
||
|
||
/// <summary>
|
||
/// 能量变化时,参数为变化的数值
|
||
/// </summary>
|
||
public OrderedDictionary<string, PrioritizedAction<float>> onEnergyChanged;
|
||
}
|
||
|
||
#endregion
|
||
|
||
#region Attack Interaction Events
|
||
|
||
public partial class EventSubmodule
|
||
{
|
||
/// <summary>
|
||
/// 被击中时。参数为产生命中的攻击区域。
|
||
/// <para> 注意,不需要必须受到伤害 </para>
|
||
/// </summary>
|
||
public OrderedDictionary<string, PrioritizedAction<AttackAreaBase>> onGetHit;
|
||
|
||
/// <summary>
|
||
/// 受到伤害时。参数为产生产伤害的攻击区域。
|
||
/// </summary>
|
||
public OrderedDictionary<string, PrioritizedAction<AttackAreaBase>> onHurt;
|
||
|
||
/// <summary>
|
||
/// 被突破时。参数为产生产击破的攻击区域。
|
||
/// <para> 注意,不需要必须受到伤害 </para>
|
||
/// </summary>
|
||
public OrderedDictionary<string, PrioritizedAction<AttackAreaBase>> onGetBreakthrough;
|
||
|
||
/// <summary>
|
||
/// 开始攻击时。参数为产生成攻击的攻击区域、被攻击目标和攻击上下文。
|
||
/// <para> 此时还未开始攻击结果的计算,因此可以在这个事件中利用 Context 修改其内部的 AttackValue </para>
|
||
/// </summary>
|
||
public OrderedDictionary<string, PrioritizedAction<AttackAreaBase, CharacterBase, Attack.Context>> onStartAttack;
|
||
|
||
/// <summary>
|
||
/// 完成攻击时,参数为产生成攻击的攻击区域、被攻击目标和(已完成的)攻击结果
|
||
/// <para> 此时攻击结果已经计算完成,因此可以在这个事件中根据攻击结果进行一些后续处理 </para>
|
||
/// </summary>
|
||
public OrderedDictionary<string, PrioritizedAction<AttackAreaBase, CharacterBase, Attack.Result>> onFinishAttack;
|
||
|
||
/// <summary>
|
||
/// 被攻击前,参数为攻击区域和攻击上下文
|
||
/// <para> 此时还未开始扣血和打断动作逻辑,因此可以在这个事件中一票否决(设定isImmune)或者修改即将受到的最终伤害修饰算子 </para>
|
||
/// </summary>
|
||
public OrderedDictionary<string, PrioritizedAction<AttackAreaBase, Attack.Context>> onBeforeGetAttacked;
|
||
|
||
/// <summary>
|
||
/// 被攻击后,参数为攻击区域和攻击结果
|
||
/// <para> 此时攻击结果已经计算完成,因此可以在这个事件中根据攻击结果进行一些后续处理 </para>
|
||
/// </summary>
|
||
public OrderedDictionary<string, PrioritizedAction<AttackAreaBase, Attack.Result>> onAfterGetAttacked;
|
||
|
||
/// <summary>
|
||
/// (任何)格挡成功时,参数为攻击区域和格挡来源
|
||
/// </summary>
|
||
public OrderedDictionary<string, PrioritizedAction<AttackAreaBase, BlockSource>> onBlockSuccess;
|
||
|
||
/// <summary>
|
||
/// 普通格挡成功时,参数为攻击区域和格挡来源
|
||
/// </summary>
|
||
public OrderedDictionary<string, PrioritizedAction<AttackAreaBase, BlockSource>> onNormalBlockSuccess;
|
||
|
||
/// <summary>
|
||
/// 完美格挡成功时,参数为攻击区域和格挡来源
|
||
/// </summary>
|
||
public OrderedDictionary<string, PrioritizedAction<AttackAreaBase, BlockSource>> onPerfectBlockSuccess;
|
||
|
||
/// <summary>
|
||
/// 普通闪避成功时,参数为闪避来源
|
||
/// </summary>
|
||
public OrderedDictionary<string, PrioritizedAction<AttackAreaBase, DodgeSource>> onNormalDodgeSuccess;
|
||
|
||
/// <summary>
|
||
/// 完美闪避成功时,参数为闪避来源
|
||
/// </summary>
|
||
public OrderedDictionary<string, PrioritizedAction<AttackAreaBase, DodgeSource>> onPerfectDodgeSuccess;
|
||
}
|
||
|
||
#endregion
|
||
|
||
#region Buff Events
|
||
|
||
public partial class EventSubmodule
|
||
{
|
||
/// <summary>
|
||
/// 作为来源向其他角色施加 Buff 时触发,参数为即将施加的 Buff 实例。
|
||
/// <para> 在 OnBuffApply 之前调用,可用于在 Buff 生效前修改其属性。 </para>
|
||
/// </summary>
|
||
public OrderedDictionary<string, PrioritizedAction<CharacterBuffBase>> onApplyBuffToTarget;
|
||
}
|
||
|
||
#endregion
|
||
} |