コード例 #1
0
ファイル: BuffCastor.cs プロジェクト: wxl-007/ShadowDota
        /// <summary>
        /// 这个函数目前没有作用,
        /// 准备将来用于Buff第一次释放时,需要调用的函数
        /// </summary>
        public void FirstCast(RtBufData rtbf)
        {
            ///
            /// --- 设置NPC的状态 ---
            ///

            ServerNPC     hang = BFSelector.getHangUp(rtbf);
            ServerLifeNpc life = hang as ServerLifeNpc;

            if (life != null)
            {
                NpcStatus status = (NpcStatus)Enum.ToObject(typeof(NpcStatus), rtbf.BuffCfg.Status);
                //去除不需要挂载的状态
                status = status.rmDiscrete();
                if (status != NpcStatus.None)
                {
                    life.curStatus = life.curStatus.set(status);
                }

                //如果有嘲讽的话
                if (status.AnySame(NpcStatus.Taunt))
                {
                    life.addHatred(rtbf.CastorNpcID, 1);
                }
            }

            ///
            /// ---- 释放技能 ---
            ///
            castBuff_Skill(rtbf, BuffPhase.Start);
        }
コード例 #2
0
ファイル: BuffCastor.cs プロジェクト: wxl-007/ShadowDota
        /// <summary>
        /// Buff结束时,处理的逻辑
        /// </summary>
        public void EndCast(RtBufData rtbf)
        {
            ///
            /// --- 解除NPC的状态 ---
            ///

            ServerNPC     hang = BFSelector.getHangUp(rtbf);
            ServerLifeNpc life = hang as ServerLifeNpc;

            if (life != null)
            {
                NpcStatus status = (NpcStatus)Enum.ToObject(typeof(NpcStatus), rtbf.BuffCfg.Status);
                //去除不需要挂载的状态
                status = status.rmDiscrete();

                ///
                /// 如果还有同类型的,其他Buff则不应该清除Buff的状态
                ///
                if (status != NpcStatus.None)
                {
                    NpcStatus toCleared = WarServerManager.Instance.bufMgr.SiftOutStatus(status, rtbf.ID, rtbf.HangUpNpcID);
                    life.curStatus = life.curStatus.clear(toCleared);
                }

                ///
                /// 删除嘲讽的目标
                ///
                if (status.check(NpcStatus.Taunt))
                {
                    life.clearSpecHatred(rtbf.CastorNpcID);
                }
            }

            ///
            /// ---- 解除挂载的Trigger ----
            ///
            int NpcId = hang.UniqueID;

            WarServerManager.Instance.triMgr.RemoveTrigger(rtbf.TriggerID, NpcId);

            ///
            /// ---- 是否删除NPC (目前不适用) ----
            ///
            if (life != null)
            {
                SelfDescribed des = new SelfDescribed()
                {
                    src       = hang.UniqueID,
                    target    = hang.UniqueID,
                    act       = Verb.Punch,
                    srcEnd    = null,
                    targetEnd = new EndResult( )
                    {
                        param1 = life.data.rtData.totalHp * 10,
                        param2 = 0,
                        param3 = 2,
                    },
                };

                WarSrcAnimParam warParam = new WarSrcAnimParam()
                {
                    OP        = EffectOp.Injury,
                    described = des,
                };
            }

            ///
            /// ---- 释放技能 ---
            ///
            castBuff_Skill(rtbf, BuffPhase.End);
        }