12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- using CommonAI.Zone;
- using CommonAI.Zone.Helper;
- using CommonAI.Zone.Instance;
- using XmdsCommon.Plugin;
- using XmdsCommonServer.Plugin;
- using XmdsCommonServer.XLS.Data;
- using XmdsCommonSkill.Plugin.Buffs;
- using static CommonAI.Zone.Instance.InstanceUnit;
- namespace XmdsCommonSkill.Plugin.Skills.Remedy
- {
- /// <summary>
- /// 治疗, 二技能: 2-4(队友在受到治疗 S时间内,增加自身攻击力X)
- /// </summary>
- public class Remedy_510240 : Remedy_510200
- {
- private static readonly int ID = 510240;
- private static readonly int Buff_ID = (int)XmdsBuffBase.XmdsBuffList.REMEDY_2_4_ATTACKUP;
- public override int SkillID { get { return ID; } }
- // 伤害提升系数
- protected XmdsSkillValue valueSet2;
- protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
- {
- base.OnInit(info, unit, ref template);
- XmdsBuffPack pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_ID);
- var buff = (XmdsBuff_PropChange)pack.GetXmdsBuff(XmdsBuffProperties.XmdsBuffAbility.PropChange);
- buff.IsPercent = true;
- buff.CurentChangeType = XmdsVirtual.UnitAttributeType.Attack;
- buff.CurrentValue = valueSet2.GetValue(info.TalentSkillLevel1, 1);
- BuffTemplate bt = pack.mBuffTemplate;
- bt.IsHarmful = false;
- bt.LifeTimeMS = valueSet2.GetValue(info.TalentSkillLevel1, 2);
- pack.BindTemplateAndDispose();
- unit.RegistSendBuff(bt);
- }
- protected override void OnSkillDataChange(GameSkill gs, XmdsVirtual unit)
- {
- base.OnSkillDataChange(gs, unit);
- var buff = unit.GetRegisBuffVirtual(Buff_ID) as XmdsBuff_PropChange;
- buff.CurrentValue = valueSet2.GetValue(gs.TalentSkillLevel1, 1);
- var bt = unit.GetRegistBuff(Buff_ID);
- bt.LifeTimeMS = valueSet2.GetValue(gs.TalentSkillLevel1, 2);
- }
- protected override void OnSkillLogicEvent(BattleParams param)
- {
- if (param.Attacker.IsAllies(param.Hitter, true, true) && !param.GameSkill.mHitUnits.ContainsKey(param.Hitter.mUnit.ID))
- {
- AddHpBuff(param);
- param.Hitter.mUnit.AddBuff(Buff_ID, 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);
- }
- }
- }
|