123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- using CommonAI.Zone;
- using CommonAI.Zone.Helper;
- using CommonAI.Zone.Instance;
- using XmdsCommon.Plugin;
- using XmdsCommonServer.Plugin;
- using XmdsCommonServer.Plugin.XmdsSkillTemplate.Skills;
- using XmdsCommonServer.XLS.Data;
- using XmdsCommonSkill.Plugin.Interface;
- using static XmdsCommonSkill.Plugin.Interface.ComSpellTemplate;
- namespace XmdsCommonSkill.Plugin.Skills.Remedy
- {
- /// <summary>
- /// 治疗【1】技能 1 - 3(扇子在打到第一个敌人后会分生成5个扇子,扇形向前,飞出剩余相同距离,(每个扇子伤害独立,最多叠加3个扇子的伤害,恢复唯一,不重复累加))
- /// </summary>
- public class Remedy_510130 : Remedy_510120
- {
- private static readonly int ID = 510130;
- public override int SkillID { get { return ID; } }
- //伤害系数
- protected XmdsSkillValue valueSet4;
- //扩展配置
- protected XmdsSkillValue valueSet7; //最多被扇子击中N次
- //触发分裂伞的单位,不应该被分裂山击中
- private uint mIngoreUnit;
- protected override void OnSkillDamagePerEvent(BattleParams param)
- {
- if(param.AtkProp.DamagePerID == 0)
- {
- base.OnSkillDamagePerEvent(param);
- }
- else
- {
- //if(this.mIngoreUnit == param.Hitter.mUnit.ID)
- //{
- // param.SkillDamagePer = 0;
- // param.UseDamageType = CommonAI.Data.DamageType.None;
- //}
- //else
- {
- int count = param.GameSkill.mHitUnits.Get(param.Hitter.mUnit.ID);
- if (count > valueSet7.GetValue(param.GameSkill.TalentSkillLevel3))
- {
- param.SkillDamagePer = 0;
- param.UseDamageType = CommonAI.Data.DamageType.None;
- }
- else
- {
- param.SkillDamagePer = valueSet4.GetValue(param.GameSkill.TalentSkillLevel3);
- }
- param.GameSkill.mHitUnits.Put(param.Hitter.mUnit.ID, count + 1);
- }
-
- }
- }
- protected override int OnLaunchSkillOver(GameSkill info, XmdsCommonServer.Plugin.XmdsVirtual launcher, CommonAI.Zone.Instance.InstanceUnit.SkillState state)
- {
- base.OnLaunchSkillOver(info, launcher, state);
- this.mIngoreUnit = 0;
- return 0;
- }
- protected override void OnSkillLogicEvent(BattleParams param)
- {
- base.OnSkillLogicEvent(param);
- //第一次打击到敌人,创建法术, 而且是强依赖编辑器
- if (this.mIngoreUnit == 0 && !param.Attacker.IsAllies(param.Hitter, false))
- {
- this.mIngoreUnit = param.Hitter.mUnit.ID;
- float pointDirection = 0;
- if (param.Source.FromSpellUnit != null)
- {
- param.Source.FromSpellUnit.Parent.RemoveObject(param.Source.FromSpellUnit);
- pointDirection = param.Source.FromSpellUnit.Direction;
- }
- param.Attacker.mUnit.Parent.unitLaunchSpell(param.GameSkill.SkillType, param.Attacker.mUnit,
- ComSpellTemplate.Instance().GetSpellByID(XmdsSpellID.SPLIT_FAN), param.Hitter.mUnit.X, param.Hitter.mUnit.Y,
- param.Hitter.mUnit.ID, null, -1, 0, pointDirection);
- }
- }
- protected override void OnInitConfig()
- {
- XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
- base.InitBaseConfig(data);
- InitData(data, out valueSet1, 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);
- }
- }
- }
|