12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
-
- using XmdsCommonServer.XLS.Data;
- using XmdsCommonServer.Plugin;
- using CommonAI.Zone;
- using XmdsCommon.Plugin;
- using XmdsCommonSkill.Plugin.Buffs;
- namespace XmdsCommonSkill.Plugin.Skills.Monster
- {
- /// <summary>
- /// 哺育者(琪尔嫚) - 潜伏: 哺育者潜入地下,变得不可被攻击,潜伏时间持续8秒.
- /// 期间哺育者将从地底对随机敌人发起攻击,造成x%倍物攻伤害和额外y点物理伤害.
- /// 实现方式:技能初始化后将10490414设置为false,潜伏施放后将原有技能置为false,BUFF结束时再将技能激活.
- /// </summary>
- public class Monster_10490404 : XmdsSkillBase
- {
- /// <summary>
- /// 技能ID.
- /// </summary>
- public static int ID = 10490404;
- public static int BUFF_ID = 10490404;
- public static XmdsSkillValue DP_1;
- public override int SkillID { get { return ID; } }
- protected override void OnSkillDamagePerEvent(BattleParams param)
- {
- int ret = CalDamagePer(DP_1, param.GameSkill.SkillLevel);
- param.SkillDamagePer = ret;
- }
- protected override void OnRegistEvent()
- {
- this.RegistEvent(EventType.UseFormluaType, OnUseFormluaTypeEvent);
- base.OnRegistEvent();
- }
- private void OnUseFormluaTypeEvent(BattleParams param)
- {
- //该技能无伤害.
- param.UseDamageType = CommonAI.Data.DamageType.None;
- }
- protected override void OnSkillLogicEvent(BattleParams param)
- {
- //思路.上变身无敌BUFF,激活地底攻击技能,冻结其他技能。
- ActiveSkills(param.Attacker, false);
- //上无敌变身BUFF.
- XmdsBuff_Invincible buff = param.Attacker.GetRegisBuffVirtual(BUFF_ID) as XmdsBuff_Invincible;
- buff.OnHandleBuffEndEvent += ((hitter, state) =>
- {
- {
- //还原技能状态.
- ActiveSkills(hitter, true);
- }
- });
- param.Attacker.mUnit.AddBuff(BUFF_ID);
- }
- private void ActiveSkills(XmdsVirtual zv, bool active)
- {
- //冻结技能,保证地底时不再施放.
- zv.mUnit.SetSkillActive(10490401, active, true);
- zv.mUnit.SetSkillActive(10490402, active, true);
- zv.mUnit.SetSkillActive(10490403, active, true);
- zv.mUnit.SetSkillActive(10490404, active, true);
- //激活地底时攻击技能.
- zv.mUnit.SetSkillActive(10490414, !active);
- }
- protected override void OnInit(GameSkill info, XmdsVirtual unit, ref SkillTemplate template)
- {
- XmdsBuffPack pack = XmdsBuffFactory.GetInstance().GetXmdsBuffPack(BUFF_ID);
- BuffTemplate bt = pack.mBuffTemplate;
- bt.IsHarmful = false;
- pack.BindTemplateAndDispose();
- unit.RegistSendBuff(bt);
- }
- protected override void OnInitOver(XmdsVirtual unit, GameSkill skill)
- {
- //初始化时先将该技能冻结,避免正常状态时使用.
- unit.mUnit.SetSkillActive(10490414, false);
- }
- protected override void OnInitSkillParam()
- {
- XmdsSkillData data = XmdsDataMgr.GetInstance().GetXmdsSkillData(ID);
- InitData(data, out DP_1, XmdsSkillData.XmdsSkillDataKey.DmgRate);
- }
- }
- }
|