Ejemplo n.º 1
0
        /// <summary>
        /// 释放技能效果
        /// </summary>
        /// <param name="src">效果发起者</param>
        /// <param name="skTarget">技能选择的目标,忽略</param>
        /// <param name="target">技能先选择目标后,再次Effect选择后的目标</param>
        /// <param name="skDirectHurt">是否是技能的直接伤害</param>
        /// <param name="container">所有数据展现的容器,本次Effect施法的效果会依次加入</param>
        public void Cast(ServerNPC src, IEnumerable <ServerNPC> skTarget, IEnumerable <ServerNPC> target, bool skDirectHurt, List <MsgParam> container)
        {
            ///
            /// 实际上该效果分为两部分的逻辑
            /// 1. 消除某些类型的buff
            /// 2. 消除特定ID的buff
            ///

                        #if DEBUG
            Utils.Assert(src == null, "DisperseEffect can't find src.");
            Utils.Assert(target == null, "DisperseEffect can't find target.");
                        #endif

            BuffMgr bufMgr = WarServerManager.Instance.bufMgr;

            //TODO: 1. 消除某些类型的buff


            /// 2. 消除特定ID的buff
            List <int> bufIds = new List <int>();
            if (cfg.Param4 > 0)
            {
                bufIds.Add(cfg.Param4);
            }
            if (cfg.Param5 > 0)
            {
                bufIds.Add(cfg.Param5);
            }
            if (cfg.Param6 > 0)
            {
                bufIds.Add(cfg.Param6);
            }

            int count = bufIds.Count;
            if (count > 0)
            {
                if (target.Any())
                {
                    foreach (ServerNPC npc in target)
                    {
                        for (int i = 0; i < count; ++i)
                        {
                            List <RtBufData> bufList = bufMgr.findBuff(bufIds[i], npc.UniqueID);

                            int foundBufCnt = bufList.Count;
                            if (foundBufCnt > 0)
                            {
                                for (int j = 0; j < foundBufCnt; ++j)
                                {
                                    bufMgr.rmBuff(bufList[j].ID, npc.UniqueID);
                                }
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 释放技能效果
        /// </summary>
        /// <param name="src">效果发起者</param>
        /// <param name="skTarget">技能选择的目标,本参数在这里无意义</param>
        /// <param name="target">技能先选择目标后,再次Effect选择后的目标。本参数数量 >= 0 </param></param>
        /// <param name="skDirectHurt">是否是技能的直接伤害, 这个没有伤害</param>
        /// <param name="container">所有数据展现的容器,本次Effect施法的效果会依次加入</param>
        public void Cast(ServerNPC src, IEnumerable <ServerNPC> skTarget, IEnumerable <ServerNPC> target, bool skDirectHurt, List <MsgParam> container)
        {
                        #if DEBUG
            Utils.Assert(cfg == null, "Effect configure is null in DotHotEffect.");
            Utils.Assert(skCfg == null, "skill configure is null in DotHotEffect.");
                        #endif

            foreach (ServerNPC bnpc in target)
            {
                WarTarAnimParam param = new WarTarAnimParam()
                {
                    OP        = EffectOp.DotHot,
                    HitAction = cfg.HitAction,
                };

                BuffMgr bufMgr = WarServerManager.Instance.bufMgr;

                BuffCtorParamEx ctor = new BuffCtorParamEx()
                {
                    fromNpcId = src.UniqueID,
                    toNpcId   = bnpc.UniqueID,
                    cfg       = base.cfg,
                };
                //创建BUff
                RtBufData maybe = bufMgr.createBuff(ctor);
                //statistics
                SelfDescribed des = statistics(maybe, src, bnpc);
                param.described = des;
                container.Add(param);
            }

            //通知给技能释放者的目标
            WarSrcAnimParam SrcParam = new WarSrcAnimParam()
            {
                OP             = EffectOp.DotHot,
                ShootAction    = skCfg.ShootAction,
                ShootTime      = skCfg.ShootTime,
                ShootEventTime = skCfg.ShootEventTime,
                described      = toSelf(src.UniqueID),
            };
            container.Add(SrcParam);
        }
Ejemplo n.º 3
0
        void Awake()
        {
            Instance = this;

            npcMgr = new ServerNpcMgrFactory().getNpcMgr();
            npcMgr.Init();

            creator = new ServerCreator(this);

            sufMgr = EffectSufferMgr.instance;

            npcSkill = SkillCastor.Instance;
            npcSkill.init(npcMgr);

            triMgr = TriggerMgr.Instance;
            triMgr.Init(npcMgr);

            bufMgr = BuffMgr.Instance;
            bufMgr.init(npcMgr, triMgr);

            StartCoroutine(checkClientUIReady());
        }