123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- using CommonAI.Zone;
- using CommonAI.Zone.Helper;
- using CommonAI.Zone.Instance;
- using CommonLang;
- using XmdsCommon.Plugin;
- using XmdsCommonServer.Plugin;
- using XmdsCommonServer.Plugin.XmdsSkillTemplate.DamageCalculator;
- using XmdsCommonServer.XLS.Data;
- using XmdsCommonSkill.Plugin.Buffs;
- namespace XmdsCommonSkill.Plugin.Skills.Remedy
- {
- /// <summary>
- /// 治疗, 二技能: 2-3(复数绿色的精灵环绕在奶妈四周,范围为X码,类似死亡先知大招,3s,绿色精灵会每1S触碰队友一次回血百分之X)
- /// </summary>
- public class Remedy_510230 : Remedy_510220
- {
- private static readonly int ID = 510230;
- public override int SkillID { get { return ID; } }
- //霸体buff
- private static int Buff_ID = (int)XmdsBuffBase.XmdsBuffList.COM_INGORE_CTRL;
- // 回血系数
- protected XmdsSkillValue valueSet4;
- //范围解控,提供霸体buff
- protected XmdsSkillValue valueSet5;
- protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
- {
- base.OnInit(info, unit, ref template);
- unit.RegistLaunchSkillOver(OnLaunchSkillOver, info);
- var pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_ID);
- var bt = pack.mBuffTemplate;
- bt.IsHarmful = true;
- bt.LifeTimeMS = valueSet5.GetValue(info.TalentSkillLevel3, 2);
- pack.BindTemplateAndDispose();
- unit.RegistSendBuff(bt);
- }
- protected override void OnSkillDataChange(GameSkill gs, XmdsVirtual unit)
- {
- base.OnSkillDataChange(gs, unit);
- var bt = unit.GetRegistBuff(Buff_ID);
- bt.LifeTimeMS = valueSet5.GetValue(gs.TalentSkillLevel3, 2);
- }
- // 释放初始,解控,并提供霸体buff
- protected int OnLaunchSkillOver(GameSkill info, XmdsCommonServer.Plugin.XmdsVirtual launcher, CommonAI.Zone.Instance.InstanceUnit.SkillState state)
- {
- //治疗自己和队友
- using (var list = ListObjectPool<InstanceUnit>.AllocAutoRelease())
- {
- launcher.mUnit.Parent.getObjectsRoundRange<InstanceUnit>(
- (obj, dx, dy, dr) =>
- {
- var u = obj as InstanceUnit;
- //己方单位.
- if (launcher.IsAllies(u.Virtual as XmdsVirtual))
- {
- return CMath.includeRoundPoint(dx, dy, dr, u.X, u.Y);
- }
- return false;
- },
- launcher.mUnit.X,
- launcher.mUnit.Y,
- valueSet5.GetValue(info.TalentSkillLevel3, 1),
- list, launcher.mUnit.AoiStatus);
- foreach(InstanceUnit unit in list)
- {
- (unit.Virtual as XmdsVirtual).RemoveControlBuff();
- unit.AddBuff(Buff_ID, launcher.mUnit);
- }
- }
- return 0;
- }
- protected override void OnSkillLogicEvent(BattleParams param)
- {
- base.OnSkillLogicEvent(param);
- if (param.Attacker.IsAllies(param.Hitter, true, true))
- {
- int addHP = CUtils.CastInt(param.Attacker.MirrorProp.MaxAttack * XmdsUnitProp.PER * valueSet4.GetValue(param.GameSkill.TalentSkillLevel3));
- param.Hitter.mUnit.AddHP(addHP, param.Attacker.mUnit);
- }
- }
- protected override void OnInitConfig()
- {
- XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
- base.InitBaseConfig(data);
- InitData(data, out buffTime, XmdsSkillData.XmdsSkillDataKey.DmgRate);
- InitData(data, out valueSet, XmdsSkillData.XmdsSkillDataKey.ValueSet);
- InitData(data, out valueSet2, XmdsSkillData.XmdsSkillDataKey.ValueSet2);
- InitData(data, out valueSet3, XmdsSkillData.XmdsSkillDataKey.ValueSet3);
- InitData(data, out valueSet4, XmdsSkillData.XmdsSkillDataKey.ValueSet4);
- //2-3免控
- InitData(data, out valueSet5, XmdsSkillData.XmdsSkillDataKey.ValueSet5);
- }
- }
- }
|