12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- using CommonAI.Data;
- using CommonAI.Zone;
- using CommonAI.Zone.Formula;
- using CommonAI.Zone.Helper;
- using CommonAI.Zone.Instance;
- using CommonLang;
- using System;
- using XmdsCommon.Plugin;
- using XmdsCommonServer.Plugin;
- using XmdsCommonServer.XLS.Data;
- using XmdsCommonSkill.Plugin.Buffs;
- using XmdsCommonSkill.Plugin.PassiveSkills.Magic;
- using static CommonAI.Zone.Instance.InstanceUnit;
- namespace XmdsCommonSkill.Plugin.Skills.Boss
- {
- /// <summary>
- /// boss - 1 - 捕猎(选中一名玩家,3秒后以该玩家所在坐标为终点进行冲锋,对路径上所有目标造成伤害,并附加流血效果)
- /// </summary>
- public class Boss_90308 : XmdsSkillBase
- {
- private static int ID = 90308;
- private static int Buff_ID = (int)XmdsBuffBase.XmdsBuffList.BOSS_ZB_BLESS;
- public static XmdsSkillValue dmgValue; // 伤害系数1
- public static XmdsSkillValue valueSet1; // 伤害系数2
- public static XmdsSkillValue valueSet2; // 流血系数
- public static XmdsSkillValue valueSet3; // 流血时间
- public override int SkillID { get { return ID; } }
- protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
- {
- XmdsBuffPack pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_ID);
- XmdsBuff_Bleed buff = (XmdsBuff_Bleed)pack.GetXmdsBuff(XmdsBuffProperties.XmdsBuffAbility.Bleed);
- buff.deepValue = 1.5f;
- BuffTemplate bt = pack.mBuffTemplate;
- bt.IsHarmful = true;
- bt.LifeTimeMS = valueSet3.GetValue();
- pack.BindTemplateAndDispose();
- unit.RegistSendBuff(bt);
- unit.RegistOnHitOther(OnHandleHitOther, info);
- }
- //伤害计算
- protected override void OnSkillDamagePerEvent(BattleParams param)
- {
- if(param.AtkProp.DamagePerID == 1)
- {
- param.SkillDamagePer = dmgValue.GetValue();
- }
- else
- {
- param.SkillDamagePer = valueSet1.GetValue();
- }
- }
- private float OnHandleHitOther(float damage, XmdsVirtual hitted, XmdsVirtual attacker, AttackSource source,
- ref XmdsVirtual.AtkResult result, DamageType damageType, GameSkill skill, ref bool isEndDispatch)
- {
- // 流血
- var buff = attacker.GetRegisBuffVirtual(Buff_ID) as XmdsBuff_Bleed;
- buff.ChangeValue = Math.Max(1, CUtils.CastInt(damage * XmdsUnitProp.PER * valueSet2.GetValue()));
- hitted.mUnit.AddBuff(Buff_ID, attacker.mUnit);
- return damage;
- }
- protected override void OnInitSkillParam()
- {
- XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
- InitData(data, out dmgValue, XmdsSkillData.XmdsSkillDataKey.DmgRate);
- InitData(data, out valueSet1, XmdsSkillData.XmdsSkillDataKey.ValueSet);
- InitData(data, out valueSet2, XmdsSkillData.XmdsSkillDataKey.ValueSet2);
- InitData(data, out valueSet3, XmdsSkillData.XmdsSkillDataKey.ValueSet3);
- }
- }
- }
|