123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- using CommonAI.Zone;
- using CommonAI.Zone.Helper;
- using CommonAI.Zone.Instance;
- using CommonLang;
- using XmdsCommon.Plugin;
- using XmdsCommonServer.Plugin;
- using XmdsCommonServer.XLS.Data;
- using XmdsCommonSkill.Plugin.Buffs;
- using XmdsCommonSkill.Plugin.PassiveSkills.Remedy;
- namespace XmdsCommonSkill.Plugin.Skills.Remedy
- {
- /// <summary>
- /// 治疗, 四技能4-6(蔓延打到的敌人被埋下种子,得到一个DEBUFF,在3秒后释放一个相同的蔓延藤曼对周围被打到的人受到伤害并禁锢1s )
- /// </summary>
- public class Remedy_510460 : Remedy_510450
- {
- private static readonly int ID = 510460;
- private static readonly int Buff_ID = (int)XmdsBuffBase.XmdsBuffList.REMEDY_4_6_DEBUFF;
- private static readonly int Buff_JINGUEXT = (int)XmdsBuffBase.XmdsBuffList.REMEDY_4_6_JINGUEXT;
- public override int SkillID { get { return ID; } }
- //伤害系数,额外附加N层毒
- private XmdsSkillValue valueSet4;
- //扩展配置
- private XmdsSkillValue valueSet6; //延时藤蔓时间
- private XmdsSkillValue valueSet7; //二段禁锢
- //二段禁锢伤害信息, 命中人数
- public HashMap<uint, int> mHitUnitExt = new HashMap<uint, int>();
- //藤蔓再次释放debuff标记数量
- private int tengManDebuff = 0;
- protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
- {
- base.OnInit(info, unit, ref template);
- //禁锢二段禁锢buf
- XmdsBuffPack pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_JINGUEXT);
- BuffTemplate bt = pack.mBuffTemplate;
- bt.IsHarmful = true;
- bt.LifeTimeMS = valueSet7.GetValue(info.TalentSkillLevel3);
- pack.BindTemplateAndDispose();
- unit.RegistSendBuff(bt);
- // 延时藤蔓debuff
- var pack1 = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(Buff_ID);
- var bt1 = pack1.mBuffTemplate;
- bt1.IsHarmful = true;
- bt1.LifeTimeMS = valueSet6.GetValue(info.TalentSkillLevel3);
- pack1.BindTemplateAndDispose();
- unit.RegistSendBuff(bt1);
- }
- protected override void OnSkillDataChange(GameSkill gs, XmdsVirtual unit)
- {
- base.OnSkillDataChange(gs, unit);
- var bt1 = unit.GetRegistBuff(Buff_JINGUEXT);
- bt1.LifeTimeMS = valueSet7.GetValue(gs.TalentSkillLevel3);
- var bt2 = unit.GetRegistBuff(Buff_ID);
- bt2.LifeTimeMS = valueSet6.GetValue(gs.TalentSkillLevel3);
- }
- protected override bool OnSkillFinalDamageModifyEvent(BattleParams param)
- {
- //额外禁锢
- if (param.AtkProp.DamagePerID == 3)
- {
- if (mHitUnitExt.ContainsKey(param.Hitter.mUnit.ID))
- {
- return true;
- }
- mHitUnitExt.Put(param.Hitter.mUnit.ID, 1);
- //2段禁锢
- param.Hitter.mUnit.AddBuff(Buff_JINGUEXT, param.Attacker.mUnit);
- //额外附加N层毒
- PlayerCache_Remedy talnet = param.Attacker.GetPlayerCache() as PlayerCache_Remedy;
- if (talnet == null)
- {
- log.Warn("Remedy_510460叠毒找不到天赋:" + param.Attacker.mUnit.PlayerUUID + ", " + param.Attacker.mUnit.Parent.GetSceneID());
- }
- else if (talnet.IsCanAddPosion(param.Hitter))
- {
- param.Hitter.mUnit.AddBuff(Remedy_510601.Buff_POISON, param.Attacker.mUnit, 0, false, false, false, 0, valueSet4.GetValue(param.GameSkill.TalentSkillLevel3, 2));
- }
- return false;
- }
- else
- {
- return base.OnSkillFinalDamageModifyEvent(param); ;
- }
- }
- protected override int OnLaunchSkillOver(GameSkill info, XmdsCommonServer.Plugin.XmdsVirtual launcher, CommonAI.Zone.Instance.InstanceUnit.SkillState state)
- {
- base.OnLaunchSkillOver(info, launcher, state);
- this.tengManDebuff = 0;
- this.mHitUnitExt.Clear();
- return 0;
- }
- protected override void OnSkillDamagePerEvent(BattleParams param)
- {
- if(param.AtkProp.DamagePerID == 3)
- {
- param.SkillDamagePer = valueSet4.GetValue(param.GameSkill.TalentSkillLevel3, 1);
- }
- else
- {
- base.OnSkillDamagePerEvent(param);
- }
- }
- protected override void OnSkillLogicEvent(BattleParams param)
- {
- base.OnSkillLogicEvent(param);
- //藤蔓延时标记
- if(param.AtkProp.DamagePerID == 1)
- {
- //最多标记三个
- if(param.Hitter.mUnit.GetBuffByID(Buff_ID) == null && this.tengManDebuff < 3)
- {
- param.Hitter.mUnit.AddBuff(Buff_ID, param.Attacker.mUnit);
- this.tengManDebuff++;
- }
- }
- else if (param.AtkProp.DamagePerID == 3) //二段禁锢
- {
-
- }
- }
- 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);
- InitData(data, out valueSet8, XmdsSkillData.XmdsSkillDataKey.ValueSet8);
- }
- }
- }
|