123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- 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>
- /// 治疗, 五技能 5-3(角色脚下有一个光环,自身提升防御力、免伤、韧性,在此范围内,
- /// 所有友军提升此强化角色BUFF的一半效果 (防御力、免伤、韧性)
- /// </summary>
- public class Remedy_510530 : Remedy_510520
- {
- private static readonly int ID = 510530;
- private static readonly int BuffID_5_3 = (int)XmdsBuffBase.XmdsBuffList.REMEDY_5_3_TAG;
- private static readonly int BuffID_5_3_Allies = (int)XmdsBuffBase.XmdsBuffList.REMEDY_5_3_ALLIESTAG;
- public override int SkillID { get { return ID; } }
- //提升数值
- public XmdsSkillValue valueSet4; //自身强化光环
- // 扩展配置
- public XmdsSkillValue valueSet6; //队友强化光环
- private void BuffInit(GameSkill info, XmdsVirtual unit, XmdsSkillValue config, int BuffID)
- {
- var pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(BuffID);
- var buff1 = pack.GetXmdsBuff(0) as XmdsBuff_PropChange;
- buff1.CurentChangeType = XmdsVirtual.UnitAttributeType.Defence;
- buff1.IsPercent = true;
- buff1.CurrentValue = config.GetValue(info.TalentSkillLevel3, 1);
- var buff2 = pack.GetXmdsBuff(1) as XmdsBuff_PropChange;
- buff2.CurentChangeType = XmdsVirtual.UnitAttributeType.AllDmgReduce;
- buff2.IsPercent = true;
- buff2.CurrentValue = config.GetValue(info.TalentSkillLevel3, 2);
- var buff3 = pack.GetXmdsBuff(2) as XmdsBuff_PropChange;
- buff3.CurentChangeType = XmdsVirtual.UnitAttributeType.ControlTimeReduce;
- buff3.IsPercent = true;
- buff3.CurrentValue = config.GetValue(info.TalentSkillLevel3, 3);
- var bt = pack.mBuffTemplate;
- bt.IsHarmful = false;
- if (BuffID == BuffID_5_3)
- {
- var buff4 = pack.GetXmdsBuff(3) as XmdsBuff_AddBuff;
- buff4.addBuffId = BuffID_5_3_Allies;
- bt.LifeTimeMS = valueSet5.GetValue(info.SkillLevel, 4);
- }
- else
- {
- //写死,在增益圈中每隔一段时间会再续上
- bt.LifeTimeMS = 1000;
- }
-
- pack.BindTemplateAndDispose();
- unit.RegistSendBuff(bt);
- }
- protected override void OnSkillDataChange(GameSkill gs, XmdsVirtual unit)
- {
- if(unit == null)
- {
- log.Error("测试日志:510530 OnSkillDataChange单位为null!");
- return;
- }
- base.OnSkillDataChange(gs, unit);
- ReloadBuffData(gs, unit, BuffID_5_3, valueSet4);
- ReloadBuffData(gs, unit, BuffID_5_3_Allies, valueSet6);
- }
- private void ReloadBuffData(GameSkill gs, XmdsVirtual unit, int BuffID, XmdsSkillValue config)
- {
- var buff1 = unit.GetRegisBuffVirtual(BuffID, 0) as XmdsBuff_PropChange;
- buff1.CurrentValue = config.GetValue(gs.TalentSkillLevel3, 1);
- var buff2 = unit.GetRegisBuffVirtual(BuffID, 1) as XmdsBuff_PropChange;
- buff2.CurrentValue = config.GetValue(gs.TalentSkillLevel3, 2);
- var buff3 = unit.GetRegisBuffVirtual(BuffID, 2) as XmdsBuff_PropChange;
- buff3.CurrentValue = config.GetValue(gs.TalentSkillLevel3, 3);
- if(BuffID == BuffID_5_3)
- {
- var bt = unit.GetRegistBuff(BuffID);
- bt.LifeTimeMS = valueSet5.GetValue(gs.SkillLevel, 4);
- }
- }
- protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
- {
- base.OnInit(info, unit, ref template);
- //初始化光环buff
- BuffInit(info, unit, valueSet4, BuffID_5_3);
- //初始化队友光环buff
- BuffInit(info, unit, valueSet6, BuffID_5_3_Allies);
- }
- protected override void OnInitConfig()
- {
- XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
- base.InitBaseConfig(data);
- 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);
- // 扩展配置
- InitData(data, out valueSet5, XmdsSkillData.XmdsSkillDataKey.ValueSet5);
- InitData(data, out valueSet6, XmdsSkillData.XmdsSkillDataKey.ValueSet6);
- InitData(data, out valueSet7, XmdsSkillData.XmdsSkillDataKey.ValueSet7);
- }
- }
- }
|