123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- using CommonAI.Zone;
- using XmdsCommon.Plugin;
- using XmdsCommonServer.Plugin;
- using XmdsCommonSkill.Plugin.Buffs;
- using XmdsCommonServer.XLS.Data;
- namespace XmdsCommonSkill.Plugin.Skills.Assassin
- {
- /// <summary>
- /// 暗影之刃:命中目标之后,暗影之刃会对敌人造成多次伤害,每次造成x倍物攻伤害附加x物理伤害. //,并且暗影之刃会标记目标<X>秒.
- /// 伤害通过buff多次伤害,故此处buff没有生效概率,百分百起效.
- /// </summary>
- public class Assassin_200020 : XmdsSkillBase
- {
- public static int ID = 200020;
- /// 伤害倍数.
- public static XmdsSkillValue DP_1;
- // 暗影之刃 造成的多次伤害.
- public static int Buff_2 = (int)XmdsBuffBase.XmdsBuffList.AN_YIN_ZHI_REN;
- public static int BuffLifeTime = 2500; // 此buff用来实现多段伤害,故buffTime固定在编辑器里,此处不做配置表获取.
- public override int SkillID { get { return ID; } }
- protected override void OnSkillDamagePerEvent(BattleParams param)
- {
- int ret = CalDamagePer(DP_1, param.GameSkill.SkillLevel);
- param.SkillDamagePer = ret;
- }
- protected override void OnSkillLogicEvent(BattleParams param)
- {
- // 添加buff
- if (param.AtkProp.DamagePerID == 1)
- {
- //标记.
- //param.Hitter.mUnit.AddBuff(Buff_1, param.Attacker.mUnit);
- //伤害.
- XmdsBuffBase b3 = (XmdsBuffBase)param.Attacker.GetRegisBuffVirtual(Buff_2, 0);
- b3.SetOnHitCallBack(param.GameSkill, OnXmdsBuffHitEvent);
- param.Hitter.mUnit.AddBuff(Buff_2, param.Attacker.mUnit);
- param.UseDamageType = CommonAI.Data.DamageType.None;
- }
- //纯计算伤害.
- else if (param.AtkProp.DamagePerID == 2) { }
- }
- /// <summary>
- /// 初始化.
- /// </summary>
- protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
- {
- //多段伤害实现.
- XmdsBuffPack pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_2);
- BuffTemplate bt = pack.mBuffTemplate;
- bt.LifeTimeMS = BuffLifeTime;
- bt.IsHarmful = true;
- pack.BindTemplateAndDispose();
- unit.RegistSendBuff(bt);
- }
- private void OnXmdsBuffHitEvent(BattleParams param)
- {
- //重新
- this.OnDoSkillHitProcess(ref param);
- }
- protected override void OnInitSkillParam()
- {
- XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
- InitData(data, out DP_1, XmdsSkillData.XmdsSkillDataKey.DmgRate);
- }
- }
- }
|